@aiquants/virtualscroll 3.0.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,26 @@
1
- import { jsx as de, jsxs as Mt, Fragment as dr } from "react/jsx-runtime";
2
- import xr, { memo as Ir, forwardRef as Zt, useState as rt, useRef as g, useCallback as S, useImperativeHandle as Jt, useMemo as Fe, useLayoutEffect as nt, useEffect as q, useId as Sr } from "react";
3
- import { twMerge as Et } from "tailwind-merge";
4
- class T {
1
+ import { jsx as ne, jsxs as Tt, Fragment as rr } from "react/jsx-runtime";
2
+ import Nr, { memo as zr, forwardRef as nr, useState as je, useRef as g, useCallback as S, useImperativeHandle as ir, useMemo as _e, useLayoutEffect as Ze, useEffect as X, useId as Vr } from "react";
3
+ import { twMerge as zt } from "tailwind-merge";
4
+ const xn = (r) => {
5
+ const { quantum: e, resetOnDirectionChange: t = !0 } = r;
6
+ if (!(Number.isFinite(e) && e > 0))
7
+ throw new TypeError(`[createResidualQuantizer] quantum must be a finite positive number, received ${e}`);
8
+ let n = 0;
9
+ return {
10
+ push: (i) => {
11
+ if (!Number.isFinite(i) || Math.abs(i) > Number.MAX_SAFE_INTEGER)
12
+ return 0;
13
+ t && n !== 0 && i !== 0 && Math.sign(i) !== Math.sign(n) && (n = 0), n += i;
14
+ const s = Math.trunc(n / e) * e + 0;
15
+ return n -= s, s;
16
+ },
17
+ peekResidue: () => n,
18
+ reset: () => {
19
+ n = 0;
20
+ }
21
+ };
22
+ };
23
+ class y {
5
24
  level;
6
25
  prefix;
7
26
  impl;
@@ -14,7 +33,7 @@ class T {
14
33
  constructor(e = 2, t = "[virtualscroll]", n = console) {
15
34
  this.level = e, this.prefix = t, this.impl = n;
16
35
  }
17
- static instance = new T(2, "[virtualscroll]");
36
+ static instance = new y(2, "[virtualscroll]");
18
37
  /**
19
38
  * @method setLevel
20
39
  * @description Updates the current log level for the static instance.
@@ -22,7 +41,7 @@ class T {
22
41
  * @param {LogLevel} level - The new log level.
23
42
  */
24
43
  static setLevel(e) {
25
- T.instance.setLevel(e);
44
+ y.instance.setLevel(e);
26
45
  }
27
46
  /**
28
47
  * @method setLevel
@@ -40,7 +59,7 @@ class T {
40
59
  * @param {ILogger} impl - The new logger implementation.
41
60
  */
42
61
  static setImplementation(e) {
43
- T.instance.setImplementation(e);
62
+ y.instance.setImplementation(e);
44
63
  }
45
64
  /**
46
65
  * @method setImplementation
@@ -58,7 +77,7 @@ class T {
58
77
  * @param {string} prefix - The new prefix.
59
78
  */
60
79
  static setPrefix(e) {
61
- T.instance.setPrefix(e);
80
+ y.instance.setPrefix(e);
62
81
  }
63
82
  /**
64
83
  * @method setPrefix
@@ -77,7 +96,7 @@ class T {
77
96
  * @returns {boolean} True if a message at `level` would be emitted. / `level` のメッセージが出力されるなら true。
78
97
  */
79
98
  static isEnabled(e) {
80
- return T.instance.isEnabled(e);
99
+ return y.instance.isEnabled(e);
81
100
  }
82
101
  /**
83
102
  * @method isEnabled
@@ -122,41 +141,41 @@ class T {
122
141
  return typeof e == "string" ? [`${this.prefix} ${e}`] : [this.prefix, e];
123
142
  }
124
143
  static debug(e, ...t) {
125
- T.instance.debug(e, ...t);
144
+ y.instance.debug(e, ...t);
126
145
  }
127
146
  debug(e, ...t) {
128
- this.level <= 0 && this.impl.debug(...this.formatMessage(T.resolveLazy(e)), ...t.map(T.resolveLazy));
147
+ this.level <= 0 && this.impl.debug(...this.formatMessage(y.resolveLazy(e)), ...t.map(y.resolveLazy));
129
148
  }
130
149
  static info(e, ...t) {
131
- T.instance.info(e, ...t);
150
+ y.instance.info(e, ...t);
132
151
  }
133
152
  info(e, ...t) {
134
- this.level <= 1 && this.impl.info(...this.formatMessage(T.resolveLazy(e)), ...t.map(T.resolveLazy));
153
+ this.level <= 1 && this.impl.info(...this.formatMessage(y.resolveLazy(e)), ...t.map(y.resolveLazy));
135
154
  }
136
155
  static warn(e, ...t) {
137
- T.instance.warn(e, ...t);
156
+ y.instance.warn(e, ...t);
138
157
  }
139
158
  warn(e, ...t) {
140
- this.level <= 2 && this.impl.warn(...this.formatMessage(T.resolveLazy(e)), ...t.map(T.resolveLazy));
159
+ this.level <= 2 && this.impl.warn(...this.formatMessage(y.resolveLazy(e)), ...t.map(y.resolveLazy));
141
160
  }
142
161
  static error(e, ...t) {
143
- T.instance.error(e, ...t);
162
+ y.instance.error(e, ...t);
144
163
  }
145
164
  error(e, ...t) {
146
- this.level <= 3 && this.impl.error(...this.formatMessage(T.resolveLazy(e)), ...t.map(T.resolveLazy));
165
+ this.level <= 3 && this.impl.error(...this.formatMessage(y.resolveLazy(e)), ...t.map(y.resolveLazy));
147
166
  }
148
167
  }
149
- const rr = {
168
+ const fr = {
150
169
  active: !1,
151
170
  offsetX: 0,
152
171
  offsetY: 0,
153
172
  distance: 0,
154
173
  direction: 0,
155
174
  pointerId: null
156
- }, $t = 6, vr = 8, wr = ({ dragState: r, normalizedDistance: e }) => {
175
+ }, jt = 6, Cr = 8, Dr = ({ dragState: r, normalizedDistance: e }) => {
157
176
  const t = 1 + e * 0.18, n = 0.16 + e * 0.24, i = 0.38 + e * 0.28, s = r.active ? "80ms ease-out" : "220ms ease";
158
- return /* @__PURE__ */ Mt(dr, { children: [
159
- /* @__PURE__ */ de(
177
+ return /* @__PURE__ */ Tt(rr, { children: [
178
+ /* @__PURE__ */ ne(
160
179
  "div",
161
180
  {
162
181
  className: "aqvs-tap-scroll-circle-visual-outer",
@@ -168,7 +187,7 @@ const rr = {
168
187
  }
169
188
  }
170
189
  ),
171
- /* @__PURE__ */ de(
190
+ /* @__PURE__ */ ne(
172
191
  "div",
173
192
  {
174
193
  className: "aqvs-tap-scroll-circle-inner",
@@ -181,154 +200,160 @@ const rr = {
181
200
  }
182
201
  )
183
202
  ] });
184
- }, fr = Ir(
185
- Zt(({ onDragChange: r, className: e, maxVisualDistance: t = 160, size: n = 40, style: i, opacity: s = 1, renderVisual: a }, c) => {
186
- const [f, b] = rt(rr), I = g(null), w = g(null), V = g({ x: 0, y: 0 }), h = g(null), z = g(0), G = S(
203
+ }, Sr = zr(
204
+ nr(({ onDragChange: r, className: e, maxVisualDistance: t = 160, size: n = 40, style: i, opacity: s = 1, renderVisual: a }, m) => {
205
+ const [d, b] = je(fr), x = g(null), T = g(null), C = g({ x: 0, y: 0 }), h = g(null), L = g(0), U = S(
187
206
  (v) => {
188
207
  b(v), r(v);
189
208
  },
190
209
  [r]
191
- ), H = S(
192
- (v, W, ge = !1) => {
193
- const { x: qe, y: ee } = V.current, X = v - qe, Xe = W - ee, $e = Math.abs(Xe), ze = $e < $t ? 0 : Xe < 0 ? -1 : 1, Ce = z.current;
194
- let je = ze;
195
- const Ge = $t + vr;
196
- ze === 0 ? Ce !== 0 && $e < Ge ? je = Ce : (je = 0, ge || (z.current = 0)) : ze !== Ce && Ce !== 0 && $e < Ge ? je = Ce : z.current = ze, G({
197
- active: ge || $e >= $t,
198
- offsetX: X,
199
- offsetY: Xe,
210
+ ), D = S(
211
+ (v, K, de = !1) => {
212
+ const { x: qe, y: Xe } = C.current, V = v - qe, ke = K - Xe, $e = Math.abs(ke), ze = $e < jt ? 0 : ke < 0 ? -1 : 1, Fe = L.current;
213
+ let Ue = ze;
214
+ const De = jt + Cr;
215
+ ze === 0 ? Fe !== 0 && $e < De ? Ue = Fe : (Ue = 0, de || (L.current = 0)) : ze !== Fe && Fe !== 0 && $e < De ? Ue = Fe : L.current = ze, U({
216
+ active: de || $e >= jt,
217
+ offsetX: V,
218
+ offsetY: ke,
200
219
  distance: $e,
201
- direction: je,
202
- pointerId: I.current
220
+ direction: Ue,
221
+ pointerId: x.current
203
222
  });
204
223
  },
205
- [G]
206
- ), pe = S((v) => {
224
+ [U]
225
+ ), le = S((v) => {
207
226
  if (v === null)
208
227
  return;
209
- const W = h.current;
210
- W?.hasPointerCapture(v) && W.releasePointerCapture(v);
211
- }, []), me = S(
228
+ const K = h.current;
229
+ K?.hasPointerCapture(v) && K.releasePointerCapture(v);
230
+ }, []), ce = S(
212
231
  (v = !1) => {
213
- v && pe(I.current), I.current = null, w.current = null, z.current = 0, G(rr);
232
+ v && le(x.current), x.current = null, T.current = null, L.current = 0, U(fr);
214
233
  },
215
- [G, pe]
216
- ), oe = S(
234
+ [U, le]
235
+ ), te = S(
217
236
  (v) => {
218
- if (I.current !== null && I.current !== v.pointerId) {
219
- w.current = { pointerId: v.pointerId, clientX: v.clientX, clientY: v.clientY }, v.preventDefault(), v.stopPropagation();
237
+ if (x.current !== null && x.current !== v.pointerId) {
238
+ T.current = { pointerId: v.pointerId, clientX: v.clientX, clientY: v.clientY }, v.preventDefault(), v.stopPropagation();
220
239
  return;
221
240
  }
222
241
  v.preventDefault(), v.stopPropagation();
223
- const W = h.current ?? v.currentTarget, { left: ge, top: qe, width: ee, height: X } = W.getBoundingClientRect();
224
- V.current = { x: ge + ee / 2, y: qe + X / 2 }, I.current = v.pointerId;
242
+ const K = h.current ?? v.currentTarget, { left: de, top: qe, width: Xe, height: V } = K.getBoundingClientRect();
243
+ C.current = { x: de + Xe / 2, y: qe + V / 2 }, x.current = v.pointerId;
225
244
  try {
226
- W.setPointerCapture(v.pointerId);
245
+ K.setPointerCapture(v.pointerId);
227
246
  } catch {
228
247
  }
229
- H(v.clientX, v.clientY, !0);
248
+ D(v.clientX, v.clientY, !0);
230
249
  },
231
- [H]
232
- ), ce = S(
250
+ [D]
251
+ ), se = S(
233
252
  (v) => {
234
- if (I.current !== v.pointerId) {
235
- w.current !== null && w.current.pointerId === v.pointerId && (w.current = { pointerId: v.pointerId, clientX: v.clientX, clientY: v.clientY });
253
+ if (x.current !== v.pointerId) {
254
+ T.current !== null && T.current.pointerId === v.pointerId && (T.current = { pointerId: v.pointerId, clientX: v.clientX, clientY: v.clientY });
236
255
  return;
237
256
  }
238
- v.preventDefault(), H(v.clientX, v.clientY);
257
+ v.preventDefault(), D(v.clientX, v.clientY);
239
258
  },
240
- [H]
241
- ), he = S(
259
+ [D]
260
+ ), ue = S(
242
261
  (v) => {
243
- if (I.current !== v.pointerId) {
244
- w.current !== null && w.current.pointerId === v.pointerId && (w.current = null);
262
+ if (x.current !== v.pointerId) {
263
+ T.current !== null && T.current.pointerId === v.pointerId && (T.current = null);
245
264
  return;
246
265
  }
247
266
  v.preventDefault(), v.stopPropagation();
248
- const W = w.current;
249
- if (w.current = null, W !== null) {
250
- pe(v.pointerId);
251
- const ge = h.current;
267
+ const K = T.current;
268
+ if (T.current = null, K !== null) {
269
+ le(v.pointerId);
270
+ const de = h.current;
252
271
  let qe = !0;
253
- if (ge !== null && typeof ge.setPointerCapture == "function")
272
+ if (de !== null && typeof de.setPointerCapture == "function")
254
273
  try {
255
- ge.setPointerCapture(W.pointerId);
256
- } catch (ee) {
257
- (typeof ee == "object" && ee !== null && "name" in ee ? ee.name : void 0) === "NotFoundError" && (qe = !1);
274
+ de.setPointerCapture(K.pointerId);
275
+ } catch (Xe) {
276
+ (typeof Xe == "object" && Xe !== null && "name" in Xe ? Xe.name : void 0) === "NotFoundError" && (qe = !1);
258
277
  }
259
278
  if (qe) {
260
- I.current = W.pointerId, H(W.clientX, W.clientY, !0);
279
+ x.current = K.pointerId, D(K.clientX, K.clientY, !0);
261
280
  return;
262
281
  }
263
282
  }
264
- me(!0);
283
+ ce(!0);
265
284
  },
266
- [me, pe, H]
267
- ), P = S(
285
+ [ce, le, D]
286
+ ), R = S(
268
287
  (v) => {
269
- v.target === v.currentTarget && I.current === v.pointerId && me(!1);
288
+ v.target === v.currentTarget && x.current === v.pointerId && ce(!1);
270
289
  },
271
- [me]
290
+ [ce]
272
291
  );
273
- Jt(
274
- c,
292
+ ir(
293
+ m,
275
294
  () => ({
276
295
  reset: () => {
277
- me(!0);
296
+ ce(!0);
278
297
  },
279
298
  getElement: () => h.current
280
299
  }),
281
- [me]
300
+ [ce]
282
301
  );
283
- const _ = Math.min(Math.max(s, 0), 1), M = n / 64, Z = Math.min(f.distance, t) / t, Q = f.direction * Z * 10 * M, U = a ?? wr, Se = {
284
- dragState: f,
285
- normalizedDistance: Z,
286
- sizeScale: M,
302
+ const F = Math.min(Math.max(s, 0), 1), w = n / 64, j = Math.min(d.distance, t) / t, Z = d.direction * j * 10 * w, W = a ?? Dr, pe = {
303
+ dragState: d,
304
+ normalizedDistance: j,
305
+ sizeScale: w,
287
306
  size: n,
288
- opacity: _
289
- }, C = {
307
+ opacity: F
308
+ }, A = {
290
309
  ...i,
291
310
  width: n,
292
311
  height: n,
293
- transform: `translateY(${Q}px)`
312
+ transform: `translateY(${Z}px)`
294
313
  };
295
- return C.opacity = _, /* @__PURE__ */ de(
314
+ return A.opacity = F, /* @__PURE__ */ ne(
296
315
  "div",
297
316
  {
298
317
  ref: h,
299
318
  "data-testid": "virtual-scroll-tap-circle",
300
- className: Et("aqvs-tap-scroll-circle", e),
301
- style: C,
319
+ className: zt("aqvs-tap-scroll-circle", e),
320
+ style: A,
302
321
  tabIndex: -1,
303
- onPointerDown: oe,
304
- onPointerMove: ce,
305
- onPointerUp: he,
306
- onPointerCancel: he,
307
- onLostPointerCapture: P,
322
+ onPointerDown: te,
323
+ onPointerMove: se,
324
+ onPointerUp: ue,
325
+ onPointerCancel: ue,
326
+ onLostPointerCapture: R,
308
327
  role: "presentation",
309
- children: U(Se)
328
+ children: W(pe)
310
329
  }
311
330
  );
312
331
  })
313
332
  );
314
- fr.displayName = "TapScrollCircle";
315
- const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scroll-cancel", nr = 20, Tr = 250, Pr = 60, Mr = 20, yr = 20, pr = {
333
+ Sr.displayName = "TapScrollCircle";
334
+ const ie = (r, e, t) => Math.max(e, Math.min(t, r)), Tr = (r, e) => {
335
+ const t = e === "x", n = r.getBoundingClientRect(), i = t ? n.width : n.height, s = (x) => {
336
+ const T = Number.parseFloat(x);
337
+ return Number.isFinite(T) ? T : 0;
338
+ }, a = window.getComputedStyle(r), m = s(t ? a.width : a.height), d = m > 0 ? m + s(t ? a.paddingLeft : a.paddingTop) + s(t ? a.paddingRight : a.paddingBottom) + s(t ? a.borderLeftWidth : a.borderTopWidth) + s(t ? a.borderRightWidth : a.borderBottomWidth) : 0, b = d > 0 ? d : t ? r.offsetWidth : r.offsetHeight;
339
+ return b <= 0 || i <= 0 ? 1 : i / b;
340
+ }, tr = "virtualscroll:tap-scroll-cancel", mr = 20, Ar = 250, Lr = 60, Or = 20, _r = 20, wr = {
316
341
  /** 速度が最大に達する引き距離 (px)。`maxVisualDistance` の既定値。 */
317
342
  maxDistance: 240,
318
343
  /** 最小速度倍率 (ビューポート比)。 */
319
344
  minSpeedMultiplier: 0.2
320
- }, Rr = pr.maxDistance, ir = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, Ut = 2.2, Er = 8, Nr = 120, Vr = 1 / 10, dt = {
345
+ }, kr = wr.maxDistance, pr = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, Zt = 2.2, Fr = 8, Yr = 120, Br = 1 / 10, ut = {
321
346
  enabled: !0,
322
347
  size: 40,
323
348
  offsetX: -80,
324
349
  offsetY: 0,
325
350
  className: void 0,
326
- maxVisualDistance: Rr,
327
- minSpeedMultiplier: pr.minSpeedMultiplier,
351
+ maxVisualDistance: kr,
352
+ minSpeedMultiplier: wr.minSpeedMultiplier,
328
353
  opacity: 0.9,
329
354
  renderVisual: void 0,
330
355
  maxSpeedCurve: void 0
331
- }, zr = (r) => r ? {
356
+ }, Hr = (r) => r ? {
332
357
  mainSizeKey: "width",
333
358
  crossSizeKey: "height",
334
359
  positionKey: "left",
@@ -348,70 +373,70 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
348
373
  arrowIcons: ["▲", "▼"],
349
374
  directionClass: "aqvs-scrollbar-vertical",
350
375
  orientation: "vertical"
351
- }, Cr = (r, e) => {
352
- const t = r?.maxSpeedMultiplier, n = typeof t == "number" ? t : _r(e);
376
+ }, qr = (r, e) => {
377
+ const t = r?.maxSpeedMultiplier, n = typeof t == "number" ? t : Kr(e);
353
378
  return {
354
- enabled: r?.enabled ?? dt.enabled,
355
- size: r?.size ?? dt.size,
356
- offsetX: r?.offsetX ?? dt.offsetX,
357
- offsetY: r?.offsetY ?? dt.offsetY,
358
- className: r?.className ?? dt.className,
359
- maxVisualDistance: r?.maxVisualDistance ?? dt.maxVisualDistance,
379
+ enabled: r?.enabled ?? ut.enabled,
380
+ size: r?.size ?? ut.size,
381
+ offsetX: r?.offsetX ?? ut.offsetX,
382
+ offsetY: r?.offsetY ?? ut.offsetY,
383
+ className: r?.className ?? ut.className,
384
+ maxVisualDistance: r?.maxVisualDistance ?? ut.maxVisualDistance,
360
385
  maxSpeedMultiplier: n,
361
- minSpeedMultiplier: Math.max(r?.minSpeedMultiplier ?? dt.minSpeedMultiplier, 0),
362
- opacity: le(r?.opacity ?? dt.opacity, 0, 1),
363
- renderVisual: r?.renderVisual ?? dt.renderVisual,
364
- maxSpeedCurve: r?.maxSpeedCurve ?? dt.maxSpeedCurve
386
+ minSpeedMultiplier: Math.max(r?.minSpeedMultiplier ?? ut.minSpeedMultiplier, 0),
387
+ opacity: ie(r?.opacity ?? ut.opacity, 0, 1),
388
+ renderVisual: r?.renderVisual ?? ut.renderVisual,
389
+ maxSpeedCurve: r?.maxSpeedCurve ?? ut.maxSpeedCurve
365
390
  };
366
- }, Dr = ({ isDragging: r, isThumbHovered: e, enableThumbDrag: t }) => Fe(() => t ? r ? "dragging" : e ? "hover" : "idle" : "disabled", [t, r, e]), Ar = ({ canUseArrowButtons: r, enableArrowButtons: e, resetTapScroll: t, scrollByStep: n }) => {
367
- const i = g(null), s = g(null), a = g(null), c = S(() => {
391
+ }, Xr = ({ isDragging: r, isThumbHovered: e, enableThumbDrag: t }) => _e(() => t ? r ? "dragging" : e ? "hover" : "idle" : "disabled", [t, r, e]), $r = ({ canUseArrowButtons: r, enableArrowButtons: e, resetTapScroll: t, scrollByStep: n }) => {
392
+ const i = g(null), s = g(null), a = g(null), m = S(() => {
368
393
  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
- }, []), f = S(() => {
370
- c();
371
- }, [c]), b = S(
372
- (w) => (V) => {
394
+ }, []), d = S(() => {
395
+ m();
396
+ }, [m]), b = S(
397
+ (T) => (C) => {
373
398
  if (!r)
374
399
  return;
375
- V.cancelable && V.preventDefault(), V.stopPropagation(), t(), c(), n(w), s.current = window.setTimeout(() => {
400
+ C.cancelable && C.preventDefault(), C.stopPropagation(), t(), m(), n(T), s.current = window.setTimeout(() => {
376
401
  i.current = window.setInterval(() => {
377
- n(w);
378
- }, Pr);
379
- }, Tr);
380
- const h = () => c();
402
+ n(T);
403
+ }, Lr);
404
+ }, Ar);
405
+ const h = () => m();
381
406
  a.current = h, window.addEventListener("pointerup", h), window.addEventListener("pointercancel", h), window.addEventListener("blur", h);
382
407
  },
383
- [r, c, t, n]
384
- ), I = S(
385
- (w) => (V) => {
386
- e && (V.key === "Enter" || V.key === " " || V.key === "Spacebar") && (V.preventDefault(), n(w));
408
+ [r, m, t, n]
409
+ ), x = S(
410
+ (T) => (C) => {
411
+ e && (C.key === "Enter" || C.key === " " || C.key === "Spacebar") && (C.preventDefault(), n(T));
387
412
  },
388
413
  [e, n]
389
414
  );
390
- return q(() => {
391
- r || c();
392
- }, [r, c]), q(() => () => {
393
- c();
394
- }, [c]), { handleArrowPointerDown: b, handleArrowPointerUp: f, handleArrowKeyDown: I };
395
- }, Lr = 700, It = (r, e) => typeof r == "number" && Number.isFinite(r) ? r : e, Or = ({ distance: r, maxDistance: e, viewportSize: t, minSpeedMultiplier: n, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: a }) => {
396
- const c = Math.max(It(r, 0), 0), f = It(e, 0), b = f > 0 ? Math.min(c, f) / f : 1, I = Math.max(It(t, 0), 0), w = Math.max(It(n, 0), 0), V = Math.max(It(i, 0), 0), h = Math.max(I * w, 40), z = s ? h : 1200, G = Math.max(I * V, z), H = a ? Math.max(It(a.exponentialScale, V), 0) : 0, pe = a ? Math.min(G, Math.max(I * H, h)) : G, me = Math.max(pe, h);
397
- let oe = b ** 1.1;
415
+ return X(() => {
416
+ r || m();
417
+ }, [r, m]), X(() => () => {
418
+ m();
419
+ }, [m]), { handleArrowPointerDown: b, handleArrowPointerUp: d, handleArrowKeyDown: x };
420
+ }, Ur = 700, It = (r, e) => typeof r == "number" && Number.isFinite(r) ? r : e, Wr = ({ distance: r, maxDistance: e, viewportSize: t, minSpeedMultiplier: n, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: a }) => {
421
+ const m = Math.max(It(r, 0), 0), d = It(e, 0), b = d > 0 ? Math.min(m, d) / d : 1, x = Math.max(It(t, 0), 0), T = Math.max(It(n, 0), 0), C = Math.max(It(i, 0), 0), h = Math.max(x * T, 40), L = s ? h : 1200, U = Math.max(x * C, L), D = a ? Math.max(It(a.exponentialScale, C), 0) : 0, le = a ? Math.min(U, Math.max(x * D, h)) : U, ce = Math.max(le, h);
422
+ let te = b ** 1.1;
398
423
  if (a) {
399
- const he = Math.min(Math.max(It(a.exponentialSteepness, 0), 0), Lr);
400
- if (he === 0)
401
- oe = b;
424
+ const ue = Math.min(Math.max(It(a.exponentialSteepness, 0), 0), Ur);
425
+ if (ue === 0)
426
+ te = b;
402
427
  else {
403
- const P = Math.expm1(he) || 1;
404
- oe = Math.min(Math.max(Math.expm1(he * b) / P, 0), 1);
428
+ const R = Math.expm1(ue) || 1;
429
+ te = Math.min(Math.max(Math.expm1(ue * b) / R, 0), 1);
405
430
  }
406
431
  }
407
- const ce = Math.min(Math.max(It(a?.easedOffset, 0), 0), 1);
408
- return h + (me - h) * (ce + (1 - ce) * oe);
409
- }, _r = (r) => {
432
+ const se = Math.min(Math.max(It(a?.easedOffset, 0), 0), 1);
433
+ return h + (ce - h) * (se + (1 - se) * te);
434
+ }, Kr = (r) => {
410
435
  if (!r || r <= 0)
411
- return Ut;
412
- const e = Math.max(1, r), t = Math.log10(e), n = Ut + t * Er;
413
- return le(n, Ut, Nr);
414
- }, kr = ({
436
+ return Zt;
437
+ const e = Math.max(1, r), t = Math.log10(e), n = Zt + t * Fr;
438
+ return ie(n, Zt, Yr);
439
+ }, Gr = ({
415
440
  contentSize: r,
416
441
  viewportSize: e,
417
442
  scrollPosition: t,
@@ -419,248 +444,239 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
419
444
  enableThumbDrag: i = !0,
420
445
  enableTrackClick: s = !0,
421
446
  enableArrowButtons: a = !0,
422
- horizontal: c = !1,
423
- scrollBarWidth: f = 12,
447
+ horizontal: m = !1,
448
+ scrollBarWidth: d = 12,
424
449
  className: b,
425
- ariaControls: I,
426
- tapScrollCircleOptions: w,
427
- itemCount: V,
450
+ ariaControls: x,
451
+ tapScrollCircleOptions: T,
452
+ itemCount: C,
428
453
  renderThumbOverlay: h,
429
- visibleStartIndex: z,
430
- visibleEndIndex: G
454
+ visibleStartIndex: L,
455
+ visibleEndIndex: U
431
456
  }) => {
432
- const [H, pe] = rt(!1), [me, oe] = rt(!1), [ce, he] = rt(!1), P = g(null), _ = g({
457
+ const [D, le] = je(!1), [ce, te] = je(!1), [se, ue] = je(!1), R = g(null), F = g({
433
458
  pointerId: null,
434
459
  startThumbPosition: 0,
435
460
  startClientX: 0,
436
461
  startClientY: 0,
437
462
  scale: 1,
438
463
  captureTarget: null
439
- }), M = g({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), Z = g(t), Q = g(n), U = g(ir), Se = g(null), C = g(null), v = g(null), W = g(0), ge = g(0), qe = Fe(() => Cr(w, V), [V, w]), ee = Fe(() => zr(c), [c]), {
440
- enabled: X,
441
- size: Xe,
464
+ }), w = g({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), j = g(t), Z = g(n), W = g(pr), pe = g(null), A = g(null), v = g(null), K = g(0), de = g(0), qe = _e(() => qr(T, C), [C, T]), Xe = _e(() => Hr(m), [m]), {
465
+ enabled: V,
466
+ size: ke,
442
467
  offsetX: $e,
443
468
  offsetY: ze,
444
- className: Ce,
445
- maxVisualDistance: je,
446
- maxSpeedMultiplier: Ge,
447
- minSpeedMultiplier: K,
448
- opacity: Ae,
449
- renderVisual: ue,
450
- maxSpeedCurve: be
451
- } = qe, Te = g({
469
+ className: Fe,
470
+ maxVisualDistance: Ue,
471
+ maxSpeedMultiplier: De,
472
+ minSpeedMultiplier: Me,
473
+ opacity: Ve,
474
+ renderVisual: be,
475
+ maxSpeedCurve: Ie
476
+ } = qe, G = g({
452
477
  viewportSize: e,
453
478
  maxScrollPosition: Math.max(r - e, 0),
454
479
  scrollBarVisible: r > e,
455
- effectiveTapMaxDistance: Math.max(je, 1),
456
- tapCircleMaxSpeedMultiplier: Ge,
457
- tapCircleMinSpeedMultiplier: K,
458
- tapCircleMaxSpeedCurve: be,
459
- tapScrollCircleOptions: w,
480
+ effectiveTapMaxDistance: Math.max(Ue, 1),
481
+ tapCircleMaxSpeedMultiplier: De,
482
+ tapCircleMinSpeedMultiplier: Me,
483
+ tapCircleMaxSpeedCurve: Ie,
484
+ tapScrollCircleOptions: T,
460
485
  effectiveTrackLength: 0,
461
486
  onScroll: n,
462
487
  scrollPosition: t
463
- }), { mainSizeKey: et, crossSizeKey: mt, positionKey: N, selectDelta: it, getPointerCoordinate: vt, arrowLabels: E, arrowIcons: J, directionClass: Ze, orientation: ht } = ee, Le = Math.max(je, 1), st = e / r, ie = Math.max(e - f * 2, 0), p = st * ie, F = Math.min(Math.max(nr, p || 0), ie || nr), B = r - e, Y = Math.max(ie - F, 0), te = B <= 0 || Y <= 0 ? 0 : le(t / B * Y, 0, Y), Me = te + F / 2, j = r > e || H, re = j && a;
464
- nt(() => {
465
- Te.current = {
488
+ }), { mainSizeKey: Qe, crossSizeKey: We, positionKey: dt, selectDelta: it, getPointerCoordinate: E, arrowLabels: gt, arrowIcons: re, directionClass: N, orientation: st } = Xe, Ke = Math.max(Ue, 1), ft = e / r, Ae = Math.max(e - d * 2, 0), f = ft * Ae, P = Math.min(Math.max(mr, f || 0), Ae || mr), q = r - e, B = Math.max(Ae - P, 0), Q = q <= 0 || B <= 0 ? 0 : ie(t / q * B, 0, B), Se = Q + P / 2, J = r > e || D, xe = J && a;
489
+ Ze(() => {
490
+ G.current = {
466
491
  viewportSize: e,
467
- maxScrollPosition: B,
468
- scrollBarVisible: j,
469
- effectiveTapMaxDistance: Le,
470
- tapCircleMaxSpeedMultiplier: Ge,
471
- tapCircleMinSpeedMultiplier: K,
472
- tapCircleMaxSpeedCurve: be,
473
- tapScrollCircleOptions: w,
474
- effectiveTrackLength: Y,
492
+ maxScrollPosition: q,
493
+ scrollBarVisible: J,
494
+ effectiveTapMaxDistance: Ke,
495
+ tapCircleMaxSpeedMultiplier: De,
496
+ tapCircleMinSpeedMultiplier: Me,
497
+ tapCircleMaxSpeedCurve: Ie,
498
+ tapScrollCircleOptions: T,
499
+ effectiveTrackLength: B,
475
500
  onScroll: n,
476
501
  scrollPosition: t
477
502
  };
478
- }), nt(() => {
479
- Z.current = t;
480
- }, [t]), nt(() => {
481
- Q.current = n;
482
- }, [n]), q(() => {
483
- i || oe(!1);
503
+ }), Ze(() => {
504
+ j.current = t;
505
+ }, [t]), Ze(() => {
506
+ Z.current = n;
507
+ }, [n]), X(() => {
508
+ i || te(!1);
484
509
  }, [i]);
485
- const De = Dr({ isDragging: H, isThumbHovered: me, enableThumbDrag: i }), ne = S((l, x) => {
486
- const R = Te.current, D = x ?? Z.current;
487
- if (Q.current) {
488
- const Ee = Q.current(l, D);
489
- if (typeof Ee == "number" && Number.isFinite(Ee))
490
- return Z.current = Ee, Ee;
510
+ const Pe = Xr({ isDragging: D, isThumbHovered: ce, enableThumbDrag: i }), $ = S((l, I) => {
511
+ const z = G.current, H = I ?? j.current;
512
+ if (Z.current) {
513
+ const nt = Z.current(l, H);
514
+ if (typeof nt == "number" && Number.isFinite(nt))
515
+ return j.current = nt, nt;
491
516
  }
492
- const $ = typeof l == "function" ? l(D) : l, ye = Math.max(R.maxScrollPosition, 0), Re = R.scrollBarVisible ? le($, 0, ye) : 0;
493
- return Z.current = Re, Re;
494
- }, []), Je = S(
517
+ const ge = typeof l == "function" ? l(H) : l, Ne = Math.max(z.maxScrollPosition, 0), rt = z.scrollBarVisible ? ie(ge, 0, Ne) : 0;
518
+ return j.current = rt, rt;
519
+ }, []), ye = S(
495
520
  (l) => {
496
- const x = Te.current, R = Z.current;
497
- if (!x.scrollBarVisible || x.maxScrollPosition <= 0) {
498
- const Ye = ne(0, R), xt = Ye - R;
499
- return { nextPosition: Ye, actualDelta: xt, reachedBoundary: !0 };
521
+ const I = G.current, z = j.current;
522
+ if (!I.scrollBarVisible || I.maxScrollPosition <= 0) {
523
+ const at = $(0, z), pt = at - z;
524
+ return { nextPosition: at, actualDelta: pt, reachedBoundary: !0 };
500
525
  }
501
526
  if (l === 0)
502
- return { nextPosition: R, actualDelta: 0, reachedBoundary: !1 };
503
- const $ = ne((Ye) => le(Ye + l, 0, x.maxScrollPosition), R), ye = $ - R, Re = l < 0 && R + l <= 0, Ee = l > 0 && R + l >= x.maxScrollPosition, lt = l < 0 && ($ <= 0 || Re && ye === 0) || l > 0 && ($ >= x.maxScrollPosition || Ee && ye === 0);
504
- return { nextPosition: $, actualDelta: ye, reachedBoundary: lt };
527
+ return { nextPosition: z, actualDelta: 0, reachedBoundary: !1 };
528
+ const ge = $((at) => ie(at + l, 0, I.maxScrollPosition), z), Ne = ge - z, rt = l < 0 && z + l <= 0, nt = l > 0 && z + l >= I.maxScrollPosition, mt = l < 0 && (ge <= 0 || rt && Ne === 0) || l > 0 && (ge >= I.maxScrollPosition || nt && Ne === 0);
529
+ return { nextPosition: ge, actualDelta: Ne, reachedBoundary: mt };
505
530
  },
506
- [ne]
507
- ), Oe = S(
508
- (l, x) => {
509
- l.current += x;
510
- const R = Math.max(Te.current.maxScrollPosition, 0);
511
- R > 0 && (l.current = le(l.current, -R, R));
512
- const D = Je(l.current);
513
- return l.current -= D.actualDelta, D.reachedBoundary && (l.current = 0), D;
531
+ [$]
532
+ ), Ce = S(
533
+ (l, I) => {
534
+ l.current += I;
535
+ const z = Math.max(G.current.maxScrollPosition, 0);
536
+ z > 0 && (l.current = ie(l.current, -z, z));
537
+ const H = ye(l.current);
538
+ return l.current -= H.actualDelta, H.reachedBoundary && (l.current = 0), H;
514
539
  },
515
- [Je]
516
- ), ae = S(() => {
517
- C.current !== null && (window.cancelAnimationFrame(C.current), C.current = null), v.current = null, W.current = 0, ge.current = 0;
518
- }, []), ve = S(() => {
519
- U.current = { ...ir }, he(!1), Se.current?.reset(), ae();
520
- }, [ae]), Ue = S(
540
+ [ye]
541
+ ), fe = S(() => {
542
+ A.current !== null && (window.cancelAnimationFrame(A.current), A.current = null), v.current = null, K.current = 0, de.current = 0;
543
+ }, []), Re = S(() => {
544
+ W.current = { ...pr }, ue(!1), pe.current?.reset(), fe();
545
+ }, [fe]), Je = S(
521
546
  (l) => {
522
- const x = U.current, R = Te.current;
523
- if (!x.active || x.direction === 0) {
524
- ae();
547
+ const I = W.current, z = G.current;
548
+ if (!I.active || I.direction === 0) {
549
+ fe();
525
550
  return;
526
551
  }
527
- if (!R.scrollBarVisible || R.maxScrollPosition <= 0) {
528
- ae();
552
+ if (!z.scrollBarVisible || z.maxScrollPosition <= 0) {
553
+ fe();
529
554
  return;
530
555
  }
531
- const D = v.current ?? l, $ = Math.max((l - D) / 1e3, 0), ye = Math.min($, Vr);
532
- if (v.current = l, ye <= 0) {
533
- C.current = window.requestAnimationFrame(Ue);
556
+ const H = v.current ?? l, ge = Math.max((l - H) / 1e3, 0), Ne = Math.min(ge, Br);
557
+ if (v.current = l, Ne <= 0) {
558
+ A.current = window.requestAnimationFrame(Je);
534
559
  return;
535
560
  }
536
- const Re = Or({
537
- distance: x.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
561
+ const rt = Wr({
562
+ distance: I.distance,
563
+ maxDistance: z.effectiveTapMaxDistance,
564
+ viewportSize: z.viewportSize,
565
+ minSpeedMultiplier: z.tapCircleMinSpeedMultiplier,
566
+ maxSpeedMultiplier: z.tapCircleMaxSpeedMultiplier,
567
+ hasCustomMaxSpeedMultiplier: typeof z.tapScrollCircleOptions?.maxSpeedMultiplier == "number",
568
+ curve: z.tapCircleMaxSpeedCurve
544
569
  });
545
- ge.current !== x.direction && (ge.current = x.direction, W.current = 0);
546
- const { reachedBoundary: Ee } = Oe(W, x.direction * Re * ye);
547
- if (Ee) {
548
- ae();
570
+ de.current !== I.direction && (de.current = I.direction, K.current = 0);
571
+ const { reachedBoundary: nt } = Ce(K, I.direction * rt * Ne);
572
+ if (nt) {
573
+ fe();
549
574
  return;
550
575
  }
551
- C.current = window.requestAnimationFrame(Ue);
576
+ A.current = window.requestAnimationFrame(Je);
552
577
  },
553
- [Oe, ae]
554
- ), Ve = S(() => {
555
- C.current === null && (v.current = null, W.current = 0, C.current = window.requestAnimationFrame(Ue));
556
- }, [Ue]);
557
- q(() => {
558
- const l = U.current;
559
- !l.active || l.direction === 0 || Ve();
560
- }, [r, e, Ve]), q(() => () => {
561
- ae();
562
- }, [ae]);
563
- const ft = S(
578
+ [Ce, fe]
579
+ ), Le = S(() => {
580
+ A.current === null && (v.current = null, K.current = 0, A.current = window.requestAnimationFrame(Je));
581
+ }, [Je]);
582
+ X(() => {
583
+ const l = W.current;
584
+ !l.active || l.direction === 0 || Le();
585
+ }, [r, e, Le]), X(() => () => {
586
+ fe();
587
+ }, [fe]);
588
+ const ot = S(
564
589
  (l) => {
565
- U.current = l, he(l.active), l.active && l.direction !== 0 ? Ve() : ae();
590
+ W.current = l, ue(l.active), l.active && l.direction !== 0 ? Le() : fe();
566
591
  },
567
- [Ve, ae]
592
+ [Le, fe]
568
593
  );
569
- q(() => {
570
- X || ve();
571
- }, [ve, X]), q(() => {
572
- const l = (x) => {
573
- const D = x.detail?.paneId;
574
- D && I && D !== I || ve();
594
+ X(() => {
595
+ V || Re();
596
+ }, [Re, V]), X(() => {
597
+ const l = (I) => {
598
+ const H = I.detail?.paneId;
599
+ H && x && H !== x || Re();
575
600
  };
576
- return window.addEventListener(Gt, l), () => {
577
- window.removeEventListener(Gt, l);
601
+ return window.addEventListener(tr, l), () => {
602
+ window.removeEventListener(tr, l);
578
603
  };
579
- }, [I, ve]), q(() => {
580
- if (!X)
604
+ }, [x, Re]), X(() => {
605
+ if (!V)
581
606
  return;
582
- const l = (x) => {
583
- if (!U.current.active || U.current.pointerId === x.pointerId)
607
+ const l = (I) => {
608
+ if (!W.current.active || W.current.pointerId === I.pointerId)
584
609
  return;
585
- const R = x.target;
586
- if (!(R instanceof Node)) {
587
- ve();
610
+ const z = I.target;
611
+ if (!(z instanceof Node)) {
612
+ Re();
588
613
  return;
589
614
  }
590
- Se.current?.getElement()?.contains(R) || ve();
615
+ pe.current?.getElement()?.contains(z) || Re();
591
616
  };
592
617
  return document.addEventListener("pointerdown", l, !0), () => {
593
618
  document.removeEventListener("pointerdown", l, !0);
594
619
  };
595
- }, [ve, X]);
596
- const Qe = (l) => {
597
- if (!j || Y <= 0 || B <= 0)
620
+ }, [Re, V]);
621
+ const we = (l) => {
622
+ if (!J || B <= 0 || q <= 0)
598
623
  return 0;
599
- const x = le(l, 0, Y);
600
- return le(x / Y * B, 0, B);
601
- }, ot = S((l) => {
602
- const { scrollBarVisible: x, effectiveTrackLength: R, maxScrollPosition: D } = Te.current;
603
- if (T.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: l, trackLen: R, maxScroll: D })), R <= 0 || D <= 0)
624
+ const I = ie(l, 0, B);
625
+ return ie(I / B * q, 0, q);
626
+ }, et = S((l) => {
627
+ const { scrollBarVisible: I, effectiveTrackLength: z, maxScrollPosition: H } = G.current;
628
+ if (y.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: l, trackLen: z, maxScroll: H })), z <= 0 || H <= 0)
604
629
  return null;
605
- const $ = le(l, 0, R);
606
- return le($ / R * D, 0, D);
607
- }, []), d = S(
608
- (l) => {
609
- const x = l.getBoundingClientRect(), R = c ? x.width : x.height, D = (lt) => {
610
- const Ye = Number.parseFloat(lt);
611
- return Number.isFinite(Ye) ? Ye : 0;
612
- }, $ = window.getComputedStyle(l), ye = D(c ? $.width : $.height), Re = ye > 0 ? ye + D(c ? $.paddingLeft : $.paddingTop) + D(c ? $.paddingRight : $.paddingBottom) + D(c ? $.borderLeftWidth : $.borderTopWidth) + D(c ? $.borderRightWidth : $.borderBottomWidth) : 0, Ee = Re > 0 ? Re : c ? l.offsetWidth : l.offsetHeight;
613
- return Ee <= 0 || R <= 0 ? 1 : R / Ee;
614
- },
615
- [c]
616
- ), y = S(
630
+ const ge = ie(l, 0, z);
631
+ return ie(ge / z * H, 0, H);
632
+ }, []), p = S((l) => Tr(l, m ? "x" : "y"), [m]), M = S(
617
633
  (l) => {
618
- const x = _.current;
619
- if (x.pointerId !== l.pointerId)
634
+ const I = F.current;
635
+ if (I.pointerId !== l.pointerId)
620
636
  return;
621
- const R = l.clientX - x.startClientX, D = l.clientY - x.startClientY, $ = it(R, D) / (x.scale || 1);
622
- T.debug("[ScrollBar] handleThumbPointerMove", () => ({
623
- delta: $,
624
- startThumbPosition: x.startThumbPosition,
637
+ const z = l.clientX - I.startClientX, H = l.clientY - I.startClientY, ge = it(z, H) / (I.scale || 1);
638
+ y.debug("[ScrollBar] handleThumbPointerMove", () => ({
639
+ delta: ge,
640
+ startThumbPosition: I.startThumbPosition,
625
641
  clientY: l.clientY,
626
- startClientY: x.startClientY,
627
- metrics: Te.current
642
+ startClientY: I.startClientY,
643
+ metrics: G.current
628
644
  }));
629
- const ye = ot(x.startThumbPosition + $);
630
- ye !== null && ne(ye), l.cancelable && l.preventDefault();
645
+ const Ne = et(I.startThumbPosition + ge);
646
+ Ne !== null && $(Ne), l.cancelable && l.preventDefault();
631
647
  },
632
- [it, ot, ne]
633
- ), xe = S(
648
+ [it, et, $]
649
+ ), oe = S(
634
650
  (l) => {
635
- const x = _.current;
636
- if (x.pointerId !== l.pointerId)
651
+ const I = F.current;
652
+ if (I.pointerId !== l.pointerId)
637
653
  return;
638
- document.removeEventListener("pointermove", y), document.removeEventListener("pointerup", xe), document.removeEventListener("pointercancel", xe);
639
- const R = x.captureTarget;
640
- if (R?.hasPointerCapture?.(l.pointerId) && R.releasePointerCapture(l.pointerId), _.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, pe(!1), P.current) {
641
- const D = P.current.getBoundingClientRect();
642
- l.clientX >= D.left && l.clientX <= D.right && l.clientY >= D.top && l.clientY <= D.bottom || oe(!1);
654
+ document.removeEventListener("pointermove", M), document.removeEventListener("pointerup", oe), document.removeEventListener("pointercancel", oe);
655
+ const z = I.captureTarget;
656
+ if (z?.hasPointerCapture?.(l.pointerId) && z.releasePointerCapture(l.pointerId), F.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, le(!1), R.current) {
657
+ const H = R.current.getBoundingClientRect();
658
+ l.clientX >= H.left && l.clientX <= H.right && l.clientY >= H.top && l.clientY <= H.bottom || te(!1);
643
659
  } else
644
- oe(!1);
660
+ te(!1);
645
661
  },
646
- [y]
662
+ [M]
647
663
  );
648
- q(() => () => {
649
- document.removeEventListener("pointermove", y), document.removeEventListener("pointerup", xe), document.removeEventListener("pointercancel", xe);
650
- }, [y, xe]);
651
- const tt = g(0), _e = g(0), ct = S(
664
+ X(() => () => {
665
+ document.removeEventListener("pointermove", M), document.removeEventListener("pointerup", oe), document.removeEventListener("pointercancel", oe);
666
+ }, [M, oe]);
667
+ const tt = g(0), Ee = g(0), Vt = S(
652
668
  (l) => {
653
- const x = Math.max(Math.round(Te.current.viewportSize / yr), Mr);
654
- _e.current !== l && (_e.current = l, tt.current = 0), Oe(tt, l * x);
669
+ const I = Math.max(Math.round(G.current.viewportSize / _r), Or);
670
+ Ee.current !== l && (Ee.current = l, tt.current = 0), Ce(tt, l * I);
655
671
  },
656
- [Oe]
657
- ), { handleArrowPointerDown: ut, handleArrowPointerUp: at, handleArrowKeyDown: gt } = Ar({
658
- canUseArrowButtons: re,
672
+ [Ce]
673
+ ), { handleArrowPointerDown: lt, handleArrowPointerUp: Ye, handleArrowKeyDown: bt } = $r({
674
+ canUseArrowButtons: xe,
659
675
  enableArrowButtons: a,
660
- resetTapScroll: ve,
661
- scrollByStep: ct
662
- }), pt = (l) => {
663
- if (!j)
676
+ resetTapScroll: Re,
677
+ scrollByStep: Vt
678
+ }), Pt = (l) => {
679
+ if (!J)
664
680
  return;
665
681
  if (!i) {
666
682
  l.preventDefault(), l.stopPropagation();
@@ -668,25 +684,25 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
668
684
  }
669
685
  if (l.pointerType === "mouse" && l.button !== 0 || l.ctrlKey)
670
686
  return;
671
- ve();
672
- const x = l.currentTarget, R = d(x);
673
- let D = null;
674
- if (x.setPointerCapture)
687
+ Re();
688
+ const I = l.currentTarget, z = p(I);
689
+ let H = null;
690
+ if (I.setPointerCapture)
675
691
  try {
676
- x.setPointerCapture(l.pointerId), D = x;
692
+ I.setPointerCapture(l.pointerId), H = I;
677
693
  } catch {
678
- D = null;
694
+ H = null;
679
695
  }
680
- _.current = {
696
+ F.current = {
681
697
  pointerId: l.pointerId,
682
- startThumbPosition: te,
698
+ startThumbPosition: Q,
683
699
  startClientX: l.clientX,
684
700
  startClientY: l.clientY,
685
- scale: R,
686
- captureTarget: D
687
- }, document.addEventListener("pointermove", y), document.addEventListener("pointerup", xe), document.addEventListener("pointercancel", xe), pe(!0), oe(!0), l.preventDefault(), l.stopPropagation();
688
- }, yt = (l) => {
689
- if (!j)
701
+ scale: z,
702
+ captureTarget: H
703
+ }, document.addEventListener("pointermove", M), document.addEventListener("pointerup", oe), document.addEventListener("pointercancel", oe), le(!0), te(!0), l.preventDefault(), l.stopPropagation();
704
+ }, Ft = (l) => {
705
+ if (!J)
690
706
  return;
691
707
  if (!s) {
692
708
  l.preventDefault(), l.stopPropagation();
@@ -694,168 +710,168 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
694
710
  }
695
711
  if (l.pointerType === "mouse" && l.button !== 0 || l.ctrlKey)
696
712
  return;
697
- const x = l.currentTarget, R = x.getBoundingClientRect(), D = vt(l), $ = d(x), ye = (D - (c ? R.left : R.top)) / $;
698
- ve();
699
- const Re = ye - F / 2, Ee = Qe(Re);
700
- if (ne(Ee), x.setPointerCapture)
713
+ const I = l.currentTarget, z = I.getBoundingClientRect(), H = E(l), ge = p(I), Ne = (H - (m ? z.left : z.top)) / ge;
714
+ Re();
715
+ const rt = Ne - P / 2, nt = we(rt);
716
+ if ($(nt), I.setPointerCapture)
701
717
  try {
702
- x.setPointerCapture(l.pointerId);
718
+ I.setPointerCapture(l.pointerId);
703
719
  } catch {
704
720
  }
705
- M.current = {
721
+ w.current = {
706
722
  pointerId: l.pointerId,
707
- startThumbPosition: Re,
723
+ startThumbPosition: rt,
708
724
  startClientX: l.clientX,
709
725
  startClientY: l.clientY,
710
- scale: $
726
+ scale: ge
711
727
  }, l.preventDefault(), l.stopPropagation();
712
- }, wt = () => {
713
- M.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
714
- }, Nt = (l) => {
715
- const x = M.current;
716
- if (x.pointerId !== l.pointerId)
728
+ }, ct = () => {
729
+ w.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
730
+ }, yt = (l) => {
731
+ const I = w.current;
732
+ if (I.pointerId !== l.pointerId)
717
733
  return;
718
734
  if (l.pointerType === "mouse" && l.buttons === 0) {
719
- wt();
735
+ ct();
720
736
  return;
721
737
  }
722
- const R = l.clientX - x.startClientX, D = l.clientY - x.startClientY, $ = it(R, D) / (x.scale || 1), ye = Qe(x.startThumbPosition + $);
723
- ne(ye), l.cancelable && l.preventDefault();
724
- }, At = (l) => {
725
- if (M.current.pointerId !== l.pointerId)
738
+ const z = l.clientX - I.startClientX, H = l.clientY - I.startClientY, ge = it(z, H) / (I.scale || 1), Ne = we(I.startThumbPosition + ge);
739
+ $(Ne), l.cancelable && l.preventDefault();
740
+ }, Yt = (l) => {
741
+ if (w.current.pointerId !== l.pointerId)
726
742
  return;
727
- const x = l.currentTarget;
728
- x.hasPointerCapture?.(l.pointerId) && x.releasePointerCapture(l.pointerId), wt(), l.preventDefault(), l.stopPropagation();
729
- }, we = (l) => {
730
- if (M.current.pointerId !== l.pointerId)
743
+ const I = l.currentTarget;
744
+ I.hasPointerCapture?.(l.pointerId) && I.releasePointerCapture(l.pointerId), ct(), l.preventDefault(), l.stopPropagation();
745
+ }, Ct = (l) => {
746
+ if (w.current.pointerId !== l.pointerId)
731
747
  return;
732
- const x = l.currentTarget;
733
- x.hasPointerCapture?.(l.pointerId) && x.releasePointerCapture(l.pointerId), wt();
734
- }, bt = (l) => {
735
- l.target === l.currentTarget && M.current.pointerId === l.pointerId && wt();
736
- }, Lt = Fe(() => le((ce ? 1 : 0.8) * Ae, 0, 1), [ce, Ae]), Ot = Fe(() => {
737
- const x = `calc(50% - ${Xe / 2}px + ${ze}px)`;
748
+ const I = l.currentTarget;
749
+ I.hasPointerCapture?.(l.pointerId) && I.releasePointerCapture(l.pointerId), ct();
750
+ }, Bt = (l) => {
751
+ l.target === l.currentTarget && w.current.pointerId === l.pointerId && ct();
752
+ }, he = _e(() => ie((se ? 1 : 0.8) * Ve, 0, 1), [se, Ve]), xt = _e(() => {
753
+ const I = `calc(50% - ${ke / 2}px + ${ze}px)`;
738
754
  return {
739
755
  left: $e,
740
- top: x
756
+ top: I
741
757
  };
742
- }, [$e, ze, Xe]), We = (l, x, R, D) => /* @__PURE__ */ de(
758
+ }, [$e, ze, ke]), Dt = (l, I, z, H) => /* @__PURE__ */ ne(
743
759
  "button",
744
760
  {
745
761
  type: "button",
746
762
  tabIndex: 0,
747
763
  className: "aqvs-scrollbar-arrow-button",
748
764
  style: {
749
- [et]: f,
750
- [mt]: f
765
+ [Qe]: d,
766
+ [We]: d
751
767
  },
752
- "aria-label": x,
753
- onPointerDown: ut(l),
754
- onPointerUp: at,
755
- onPointerLeave: at,
756
- onPointerCancel: at,
757
- onKeyDown: gt(l),
768
+ "aria-label": I,
769
+ onPointerDown: lt(l),
770
+ onPointerUp: Ye,
771
+ onPointerLeave: Ye,
772
+ onPointerCancel: Ye,
773
+ onKeyDown: bt(l),
758
774
  "aria-disabled": !a,
759
- disabled: !re,
760
- children: /* @__PURE__ */ de("span", { "aria-hidden": "true", children: R })
775
+ disabled: !xe,
776
+ children: /* @__PURE__ */ ne("span", { "aria-hidden": "true", children: z })
761
777
  },
762
- D
763
- ), Vt = h && j ? {
764
- orientation: ht,
778
+ H
779
+ ), At = h && J ? {
780
+ orientation: st,
765
781
  scrollPosition: t,
766
- maxScrollPosition: B,
782
+ maxScrollPosition: q,
767
783
  contentSize: r,
768
784
  viewportSize: e,
769
- thumbSize: F,
770
- thumbPosition: te,
771
- thumbCenter: Me,
772
- trackSize: ie,
773
- isDragging: H,
774
- isTapScrollActive: ce,
775
- visibleStartIndex: z,
776
- visibleEndIndex: G
785
+ thumbSize: P,
786
+ thumbPosition: Q,
787
+ thumbCenter: Se,
788
+ trackSize: Ae,
789
+ isDragging: D,
790
+ isTapScrollActive: se,
791
+ visibleStartIndex: L,
792
+ visibleEndIndex: U
777
793
  } : null;
778
- return /* @__PURE__ */ Mt(
794
+ return /* @__PURE__ */ Tt(
779
795
  "div",
780
796
  {
781
- className: Et("aqvs-scrollbar", Ze, b),
797
+ className: zt("aqvs-scrollbar", N, b),
782
798
  style: {
783
- [et]: e,
784
- [mt]: f
799
+ [Qe]: e,
800
+ [We]: d
785
801
  },
786
- "data-visible": j ? "true" : "false",
802
+ "data-visible": J ? "true" : "false",
787
803
  role: "scrollbar",
788
804
  tabIndex: -1,
789
- "aria-controls": I,
805
+ "aria-controls": x,
790
806
  "aria-valuenow": t,
791
807
  "aria-valuemin": 0,
792
- "aria-valuemax": B,
793
- "aria-orientation": c ? "horizontal" : "vertical",
808
+ "aria-valuemax": q,
809
+ "aria-orientation": m ? "horizontal" : "vertical",
794
810
  children: [
795
- !c && j && X && /* @__PURE__ */ de(
796
- fr,
811
+ !m && J && V && /* @__PURE__ */ ne(
812
+ Sr,
797
813
  {
798
- ref: Se,
799
- className: Et("aqvs-scrollbar-tap-circle-wrapper", Ce),
800
- size: Xe,
801
- maxVisualDistance: Le,
802
- style: Ot,
803
- opacity: Lt,
804
- renderVisual: ue,
805
- onDragChange: ft
814
+ ref: pe,
815
+ className: zt("aqvs-scrollbar-tap-circle-wrapper", Fe),
816
+ size: ke,
817
+ maxVisualDistance: Ke,
818
+ style: xt,
819
+ opacity: he,
820
+ renderVisual: be,
821
+ onDragChange: ot
806
822
  },
807
823
  "tap-circle"
808
824
  ),
809
- We(-1, E[0], J[0], "arrow-start"),
810
- /* @__PURE__ */ Mt(
825
+ Dt(-1, gt[0], re[0], "arrow-start"),
826
+ /* @__PURE__ */ Tt(
811
827
  "div",
812
828
  {
813
829
  className: "aqvs-scrollbar-track",
814
830
  style: {
815
- borderRadius: f / 2
831
+ borderRadius: d / 2
816
832
  },
817
- onPointerDown: yt,
818
- onPointerMove: Nt,
819
- onPointerUp: At,
820
- onPointerCancel: we,
821
- onLostPointerCapture: bt,
833
+ onPointerDown: Ft,
834
+ onPointerMove: yt,
835
+ onPointerUp: Yt,
836
+ onPointerCancel: Ct,
837
+ onLostPointerCapture: Bt,
822
838
  "aria-disabled": !s,
823
839
  children: [
824
- Vt && /* @__PURE__ */ de("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: h?.(Vt) }, "overlay"),
825
- /* @__PURE__ */ de(
840
+ At && /* @__PURE__ */ ne("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: h?.(At) }, "overlay"),
841
+ /* @__PURE__ */ ne(
826
842
  "div",
827
843
  {
828
844
  className: "aqvs-scrollbar-thumb-wrapper",
829
845
  style: {
830
- [et]: F,
831
- [N]: te,
832
- ...c ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
846
+ [Qe]: P,
847
+ [dt]: Q,
848
+ ...m ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
833
849
  },
834
- "data-visible": j || H ? "true" : "false",
835
- onPointerDown: pt,
850
+ "data-visible": J || D ? "true" : "false",
851
+ onPointerDown: Pt,
836
852
  role: "slider",
837
- "aria-orientation": c ? "horizontal" : "vertical",
853
+ "aria-orientation": m ? "horizontal" : "vertical",
838
854
  "aria-valuenow": t,
839
855
  "aria-valuemin": 0,
840
- "aria-valuemax": B,
856
+ "aria-valuemax": q,
841
857
  "aria-disabled": !i,
842
858
  tabIndex: -1,
843
- children: /* @__PURE__ */ de(
859
+ children: /* @__PURE__ */ ne(
844
860
  "div",
845
861
  {
846
- ref: P,
847
- className: Et("aqvs-scrollbar-thumb", c ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
862
+ ref: R,
863
+ className: zt("aqvs-scrollbar-thumb", m ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
848
864
  "data-testid": "aqvs-scrollbar-thumb",
849
- "data-thumb-state": De,
865
+ "data-thumb-state": Pe,
850
866
  style: {
851
- borderRadius: f - 1,
867
+ borderRadius: d - 1,
852
868
  cursor: i ? "pointer" : "default"
853
869
  },
854
870
  onMouseEnter: () => {
855
- i && oe(!0);
871
+ i && te(!0);
856
872
  },
857
873
  onMouseLeave: () => {
858
- i && oe(!1);
874
+ i && te(!1);
859
875
  }
860
876
  },
861
877
  "thumb"
@@ -867,11 +883,11 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
867
883
  },
868
884
  "track"
869
885
  ),
870
- We(1, E[1], J[1], "arrow-end")
886
+ Dt(1, gt[1], re[1], "arrow-end")
871
887
  ]
872
888
  }
873
889
  );
874
- }, Fr = 16, sr = (r, e, t) => e === 1 ? r * Fr : e === 2 ? r * t : r, Yr = (r, e) => {
890
+ }, jr = 16, hr = (r, e, t) => e === 1 ? r * jr : e === 2 ? r * t : r, Zr = (r, e) => {
875
891
  const t = r.shiftKey && r.deltaX === 0, n = t ? r.deltaY : r.deltaX, i = t ? 0 : r.deltaY, s = n !== 0 && Math.abs(n) >= Math.abs(i);
876
892
  return {
877
893
  // ❗ ズームでもデルタは潰さない。ここは**事実だけ**を報告し、「横取りしない」という
@@ -880,21 +896,21 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
880
896
  // どのテストも検出できなくなる (変異解析で実証済み)。
881
897
  isZoomGesture: r.ctrlKey,
882
898
  isHorizontalDominant: s,
883
- horizontalDelta: sr(n, r.deltaMode, e),
884
- verticalDelta: sr(i, r.deltaMode, e)
899
+ horizontalDelta: hr(n, r.deltaMode, e),
900
+ verticalDelta: hr(i, r.deltaMode, e)
885
901
  };
886
- }, mr = /* @__PURE__ */ new WeakSet(), or = (r) => {
887
- mr.add(r);
888
- }, Br = (r) => mr.has(r), Hr = ["mouse", "pen", "touch"], Wt = (r, e) => !(r === "mouse" || r === "pen" || r === "touch") || e.includes(r), qr = (r) => r === "mouse" || r === "pen", Ct = {
902
+ }, Mr = /* @__PURE__ */ new WeakSet(), gr = (r) => {
903
+ Mr.add(r);
904
+ }, Qr = (r) => Mr.has(r), Jr = ["mouse", "pen", "touch"], Qt = (r, e) => !(r === "mouse" || r === "pen" || r === "touch") || e.includes(r), en = (r) => r === "mouse" || r === "pen", _t = {
889
905
  maxVelocity: 6,
890
906
  minVelocity: 0.02,
891
907
  deceleration: 25e-4,
892
908
  velocitySampleWindow: 90,
893
909
  startVelocityThreshold: 0.04
894
- }, kt = (r, e, t) => {
910
+ }, qt = (r, e, t) => {
895
911
  for (const [n, i, s] of e)
896
912
  t === "add" ? r.addEventListener(n, i, s) : r.removeEventListener(n, i, s);
897
- }, Xr = Zt(
913
+ }, tn = nr(
898
914
  ({
899
915
  children: r,
900
916
  contentSize: e,
@@ -903,239 +919,239 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
903
919
  scrollBarWidth: i = 12,
904
920
  enableThumbDrag: s = !0,
905
921
  enableTrackClick: a = !0,
906
- enableArrowButtons: c = !0,
907
- enablePointerDrag: f = !0,
908
- pointerDragInputs: b = Hr,
909
- onScroll: I,
910
- className: w,
911
- testId: V,
922
+ enableArrowButtons: m = !0,
923
+ enablePointerDrag: d = !0,
924
+ pointerDragInputs: b = Jr,
925
+ onScroll: x,
926
+ className: T,
927
+ testId: C,
912
928
  style: h,
913
- background: z,
914
- tapScrollCircleOptions: G,
915
- inertiaOptions: H,
916
- itemCount: pe,
917
- renderThumbOverlay: me,
918
- wheelSpeedMultiplier: oe = 1,
919
- overscrollBehavior: ce = "auto",
920
- onWheelHorizontal: he,
921
- contentInsets: P,
922
- visibleStartIndex: _,
923
- visibleEndIndex: M,
924
- renderOverlay: Z,
925
- initialScrollPosition: Q = 0,
926
- contentProps: U
927
- }, Se) => {
928
- const C = g(Number.isFinite(Q) ? Math.max(0, Q) : 0), v = g(null), W = g(null), ge = t === void 0, [qe, ee] = rt(0), X = t ?? qe, Xe = g(null);
929
- nt(() => {
930
- if (!ge)
929
+ background: L,
930
+ tapScrollCircleOptions: U,
931
+ inertiaOptions: D,
932
+ itemCount: le,
933
+ renderThumbOverlay: ce,
934
+ wheelSpeedMultiplier: te = 1,
935
+ overscrollBehavior: se = "auto",
936
+ onWheelHorizontal: ue,
937
+ contentInsets: R,
938
+ visibleStartIndex: F,
939
+ visibleEndIndex: w,
940
+ renderOverlay: j,
941
+ initialScrollPosition: Z = 0,
942
+ contentProps: W
943
+ }, pe) => {
944
+ const A = g(Number.isFinite(Z) ? Math.max(0, Z) : 0), v = g(null), K = g(null), de = t === void 0, [qe, Xe] = je(0), V = t ?? qe, ke = g(null);
945
+ Ze(() => {
946
+ if (!de)
931
947
  return;
932
- const p = W.current;
933
- if (!p)
948
+ const f = K.current;
949
+ if (!f)
934
950
  return;
935
- const F = () => {
936
- const Y = p.offsetHeight;
937
- if (Y > 0) {
938
- ee((te) => te === Y ? te : Y);
951
+ const P = () => {
952
+ const B = f.offsetHeight;
953
+ if (B > 0) {
954
+ Xe((Q) => Q === B ? Q : B);
939
955
  return;
940
956
  }
941
- p.offsetParent !== null && e > 0 && Xe.current !== "zero" && (Xe.current = "zero", T.warn("[ScrollPane] The self-measured viewport is 0px. Give the scroll pane's host element a definite height (e.g. h-full, flex-1 + min-h-0, an explicit px height), or pass viewportSize explicitly."));
957
+ f.offsetParent !== null && e > 0 && ke.current !== "zero" && (ke.current = "zero", y.warn("[ScrollPane] The self-measured viewport is 0px. Give the scroll pane's host element a definite height (e.g. h-full, flex-1 + min-h-0, an explicit px height), or pass viewportSize explicitly."));
942
958
  };
943
- if (F(), typeof ResizeObserver != "function")
959
+ if (P(), typeof ResizeObserver != "function")
944
960
  return;
945
- const B = new ResizeObserver(F);
946
- return B.observe(p), () => {
947
- B.disconnect();
961
+ const q = new ResizeObserver(P);
962
+ return q.observe(f), () => {
963
+ q.disconnect();
948
964
  };
949
- }, [e, ge]), nt(() => {
950
- ge && n?.(qe);
951
- }, [ge, qe, n]), nt(() => {
952
- if (ge)
965
+ }, [e, de]), Ze(() => {
966
+ de && n?.(qe);
967
+ }, [de, qe, n]), Ze(() => {
968
+ if (de)
953
969
  return;
954
- const p = v.current;
955
- if (!p)
970
+ const f = v.current;
971
+ if (!f)
956
972
  return;
957
- const F = () => {
958
- const Y = p.clientHeight;
959
- if (Y <= 0 || Math.abs(Y - X) <= 1)
973
+ const P = () => {
974
+ const B = f.clientHeight;
975
+ if (B <= 0 || Math.abs(B - V) <= 1)
960
976
  return;
961
- const te = `${X}/${Y}`;
962
- Xe.current !== te && (Xe.current = te, T.warn(
963
- `[ScrollPane] viewportSize=${X} but the host band is ${Y}px. The clip window, max scroll position, thumb mapping, rendered row count and scrollability all derive from viewportSize, so they are now wrong. Omit viewportSize to let the pane measure itself.`
977
+ const Q = `${V}/${B}`;
978
+ ke.current !== Q && (ke.current = Q, y.warn(
979
+ `[ScrollPane] viewportSize=${V} but the host band is ${B}px. The clip window, max scroll position, thumb mapping, rendered row count and scrollability all derive from viewportSize, so they are now wrong. Omit viewportSize to let the pane measure itself.`
964
980
  ));
965
981
  };
966
- if (F(), typeof ResizeObserver != "function")
982
+ if (P(), typeof ResizeObserver != "function")
967
983
  return;
968
- const B = new ResizeObserver(F);
969
- return B.observe(p), () => {
970
- B.disconnect();
984
+ const q = new ResizeObserver(P);
985
+ return q.observe(f), () => {
986
+ q.disconnect();
971
987
  };
972
- }, [ge, X]);
973
- const $e = g(he);
974
- q(() => {
975
- $e.current = he;
976
- }, [he]);
988
+ }, [de, V]);
989
+ const $e = g(ue);
990
+ X(() => {
991
+ $e.current = ue;
992
+ }, [ue]);
977
993
  const ze = g({
978
994
  frame: null,
979
995
  velocity: 0,
980
996
  lastTimestamp: null,
981
997
  generation: 0
982
- }), Ce = Fe(
998
+ }), Fe = _e(
983
999
  () => ({
984
- maxVelocity: H?.maxVelocity ?? Ct.maxVelocity,
985
- minVelocity: H?.minVelocity ?? Ct.minVelocity,
986
- deceleration: H?.deceleration ?? Ct.deceleration,
987
- velocitySampleWindow: H?.velocitySampleWindow ?? Ct.velocitySampleWindow,
988
- startVelocityThreshold: H?.startVelocityThreshold ?? Ct.startVelocityThreshold
1000
+ maxVelocity: D?.maxVelocity ?? _t.maxVelocity,
1001
+ minVelocity: D?.minVelocity ?? _t.minVelocity,
1002
+ deceleration: D?.deceleration ?? _t.deceleration,
1003
+ velocitySampleWindow: D?.velocitySampleWindow ?? _t.velocitySampleWindow,
1004
+ startVelocityThreshold: D?.startVelocityThreshold ?? _t.startVelocityThreshold
989
1005
  }),
990
- [H]
991
- ), je = Fe(() => ({
992
- top: Math.max(0, P?.top ?? 0),
993
- bottom: Math.max(0, P?.bottom ?? 0)
994
- }), [P]);
995
- T.debug("[ScrollPane] ScrollPane rendered", () => ({
1006
+ [D]
1007
+ ), Ue = _e(() => ({
1008
+ top: Math.max(0, R?.top ?? 0),
1009
+ bottom: Math.max(0, R?.bottom ?? 0)
1010
+ }), [R]);
1011
+ y.debug("[ScrollPane] ScrollPane rendered", () => ({
996
1012
  contentSize: e,
997
- viewportSize: X,
1013
+ viewportSize: V,
998
1014
  scrollBarWidth: i,
999
- className: w,
1015
+ className: T,
1000
1016
  style: h,
1001
- tapScrollCircleOptions: G,
1002
- inertiaOptions: H,
1003
- enablePointerDrag: f,
1004
- contentInsets: je
1017
+ tapScrollCircleOptions: U,
1018
+ inertiaOptions: D,
1019
+ enablePointerDrag: d,
1020
+ contentInsets: Ue
1005
1021
  }));
1006
- const Ge = g({ contentSize: e, viewportSize: X }), K = Fe(() => e > X, [e, X]), Ae = S(
1007
- (p, F) => {
1008
- let B = F ?? Ge.current;
1009
- F && !(Number.isFinite(F.contentSize) && Number.isFinite(F.viewportSize)) && (T.warn("[ScrollPane] scrollTo received non-finite dimsOverride; falling back to the committed dims", { dimsOverride: F }), B = Ge.current);
1010
- const { contentSize: Y, viewportSize: te } = B, Me = Y > te, j = C.current;
1011
- if (T.debug("[ScrollPane] scrollTo called", () => ({ newPosition: p, contentSize: Y, viewportSize: te, currentIsScrollable: Me, prevPosition: j })), !Me)
1012
- return C.current !== 0 && (C.current = 0, I?.(0, j)), C.current;
1013
- const re = typeof p == "function" ? p(C.current) : p;
1014
- if (!Number.isFinite(re))
1015
- return T.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: re }), C.current;
1016
- const De = Math.max(Y - te, 0), ne = le(re, 0, De);
1017
- return C.current !== ne && (C.current = ne, I?.(ne, j)), C.current;
1022
+ const De = g({ contentSize: e, viewportSize: V }), Me = _e(() => e > V, [e, V]), Ve = S(
1023
+ (f, P) => {
1024
+ let q = P ?? De.current;
1025
+ P && !(Number.isFinite(P.contentSize) && Number.isFinite(P.viewportSize)) && (y.warn("[ScrollPane] scrollTo received non-finite dimsOverride; falling back to the committed dims", { dimsOverride: P }), q = De.current);
1026
+ const { contentSize: B, viewportSize: Q } = q, Se = B > Q, J = A.current;
1027
+ if (y.debug("[ScrollPane] scrollTo called", () => ({ newPosition: f, contentSize: B, viewportSize: Q, currentIsScrollable: Se, prevPosition: J })), !Se)
1028
+ return A.current !== 0 && (A.current = 0, x?.(0, J)), A.current;
1029
+ const xe = typeof f == "function" ? f(A.current) : f;
1030
+ if (!Number.isFinite(xe))
1031
+ return y.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: xe }), A.current;
1032
+ const Pe = Math.max(B - Q, 0), $ = ie(xe, 0, Pe);
1033
+ return A.current !== $ && (A.current = $, x?.($, J)), A.current;
1018
1034
  },
1019
- [I]
1020
- ), ue = g(Ae);
1021
- q(() => {
1022
- ue.current = Ae;
1023
- }, [Ae]);
1024
- const be = S(() => {
1025
- const p = ze.current;
1026
- p.generation += 1, p.frame !== null && cancelAnimationFrame(p.frame), p.frame = null, p.velocity = 0, p.lastTimestamp = null;
1027
- }, []), Te = g(be);
1028
- q(() => {
1029
- Te.current = be;
1030
- }, [be]), q(() => () => {
1031
- Te.current();
1035
+ [x]
1036
+ ), be = g(Ve);
1037
+ X(() => {
1038
+ be.current = Ve;
1039
+ }, [Ve]);
1040
+ const Ie = S(() => {
1041
+ const f = ze.current;
1042
+ f.generation += 1, f.frame !== null && cancelAnimationFrame(f.frame), f.frame = null, f.velocity = 0, f.lastTimestamp = null;
1043
+ }, []), G = g(Ie);
1044
+ X(() => {
1045
+ G.current = Ie;
1046
+ }, [Ie]), X(() => () => {
1047
+ G.current();
1032
1048
  }, []);
1033
- const et = S(
1034
- (p) => {
1035
- if (!K)
1049
+ const Qe = S(
1050
+ (f) => {
1051
+ if (!Me)
1036
1052
  return;
1037
- const { maxVelocity: F, minVelocity: B, deceleration: Y, startVelocityThreshold: te } = Ce, Me = le(p, -F, F);
1038
- if (Math.abs(Me) < te)
1053
+ const { maxVelocity: P, minVelocity: q, deceleration: B, startVelocityThreshold: Q } = Fe, Se = ie(f, -P, P);
1054
+ if (Math.abs(Se) < Q)
1039
1055
  return;
1040
- be(), ze.current.velocity = Me, ze.current.lastTimestamp = null;
1041
- const j = ze.current.generation, re = (De) => {
1042
- const ne = ze.current;
1043
- if (ne.generation !== j)
1056
+ Ie(), ze.current.velocity = Se, ze.current.lastTimestamp = null;
1057
+ const J = ze.current.generation, xe = (Pe) => {
1058
+ const $ = ze.current;
1059
+ if ($.generation !== J)
1044
1060
  return;
1045
- if (ne.lastTimestamp === null) {
1046
- ne.lastTimestamp = De, ne.frame = requestAnimationFrame(re);
1061
+ if ($.lastTimestamp === null) {
1062
+ $.lastTimestamp = Pe, $.frame = requestAnimationFrame(xe);
1047
1063
  return;
1048
1064
  }
1049
- const Je = De - ne.lastTimestamp;
1050
- if (ne.lastTimestamp = De, Je <= 0) {
1051
- ne.frame = requestAnimationFrame(re);
1065
+ const ye = Pe - $.lastTimestamp;
1066
+ if ($.lastTimestamp = Pe, ye <= 0) {
1067
+ $.frame = requestAnimationFrame(xe);
1052
1068
  return;
1053
1069
  }
1054
- const Oe = ne.velocity;
1055
- let ae = Oe;
1056
- const ve = Y * Je;
1057
- Oe > 0 ? ae = Math.max(0, Oe - ve) : Oe < 0 && (ae = Math.min(0, Oe + ve));
1058
- const Ve = (Oe + ae) / 2 * Je, ft = C.current;
1059
- if (Ve !== 0 && ue.current((tt) => tt + Ve), ze.current.generation !== j)
1070
+ const Ce = $.velocity;
1071
+ let fe = Ce;
1072
+ const Re = B * ye;
1073
+ Ce > 0 ? fe = Math.max(0, Ce - Re) : Ce < 0 && (fe = Math.min(0, Ce + Re));
1074
+ const Le = (Ce + fe) / 2 * ye, ot = A.current;
1075
+ if (Le !== 0 && be.current((tt) => tt + Le), ze.current.generation !== J)
1060
1076
  return;
1061
- const Qe = C.current, { contentSize: ot, viewportSize: d } = Ge.current, y = Math.max(ot - d, 0);
1062
- ne.velocity = ae;
1063
- const xe = Qe === ft || Qe <= 0 && ae <= 0 || Qe >= y && ae >= 0;
1064
- if (Math.abs(ae) < B || xe) {
1065
- be();
1077
+ const we = A.current, { contentSize: et, viewportSize: p } = De.current, M = Math.max(et - p, 0);
1078
+ $.velocity = fe;
1079
+ const oe = we === ot || we <= 0 && fe <= 0 || we >= M && fe >= 0;
1080
+ if (Math.abs(fe) < q || oe) {
1081
+ Ie();
1066
1082
  return;
1067
1083
  }
1068
- ne.frame = requestAnimationFrame(re);
1084
+ $.frame = requestAnimationFrame(xe);
1069
1085
  };
1070
- ze.current.frame = requestAnimationFrame(re);
1086
+ ze.current.frame = requestAnimationFrame(xe);
1071
1087
  },
1072
- [K, Ce, be]
1073
- ), mt = g(et);
1074
- q(() => {
1075
- mt.current = et;
1076
- }, [et]), nt(() => {
1077
- Ge.current = { contentSize: e, viewportSize: X };
1078
- }, [e, X]), nt(() => {
1079
- const p = W.current;
1080
- if (!p) return;
1081
- const F = () => {
1082
- p.scrollTop !== 0 && (T.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: p.scrollTop })), p.scrollTop = 0), p.scrollLeft !== 0 && (p.scrollLeft = 0);
1088
+ [Me, Fe, Ie]
1089
+ ), We = g(Qe);
1090
+ X(() => {
1091
+ We.current = Qe;
1092
+ }, [Qe]), Ze(() => {
1093
+ De.current = { contentSize: e, viewportSize: V };
1094
+ }, [e, V]), Ze(() => {
1095
+ const f = K.current;
1096
+ if (!f) return;
1097
+ const P = () => {
1098
+ f.scrollTop !== 0 && (y.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: f.scrollTop })), f.scrollTop = 0), f.scrollLeft !== 0 && (f.scrollLeft = 0);
1083
1099
  };
1084
- return p.addEventListener("scroll", F), () => p.removeEventListener("scroll", F);
1085
- }, []), nt(() => {
1086
- if (K) {
1087
- T.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: e, viewportSize: X, scrollPosition: C.current }));
1088
- const p = le(e - X, 0, e);
1089
- C.current > p && Ae(p);
1100
+ return f.addEventListener("scroll", P), () => f.removeEventListener("scroll", P);
1101
+ }, []), Ze(() => {
1102
+ if (Me) {
1103
+ y.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: e, viewportSize: V, scrollPosition: A.current }));
1104
+ const f = ie(e - V, 0, e);
1105
+ A.current > f && Ve(f);
1090
1106
  } else
1091
- Ae(0);
1092
- }, [K, Ae, e, X]);
1093
- const N = g({ isScrollable: K, viewportSize: X, wheelSpeedMultiplier: oe, overscrollBehavior: ce });
1094
- nt(() => {
1095
- N.current = { isScrollable: K, viewportSize: X, wheelSpeedMultiplier: oe, overscrollBehavior: ce };
1096
- }, [K, X, oe, ce]);
1107
+ Ve(0);
1108
+ }, [Me, Ve, e, V]);
1109
+ const dt = g({ isScrollable: Me, viewportSize: V, wheelSpeedMultiplier: te, overscrollBehavior: se });
1110
+ Ze(() => {
1111
+ dt.current = { isScrollable: Me, viewportSize: V, wheelSpeedMultiplier: te, overscrollBehavior: se };
1112
+ }, [Me, V, te, se]);
1097
1113
  const it = S(
1098
- (p) => {
1099
- if (Br(p))
1114
+ (f) => {
1115
+ if (Qr(f))
1100
1116
  return !1;
1101
- const { isScrollable: F, viewportSize: B, wheelSpeedMultiplier: Y, overscrollBehavior: te } = N.current, Me = Yr(p, B);
1102
- if (Me.isZoomGesture)
1117
+ const { isScrollable: P, viewportSize: q, wheelSpeedMultiplier: B, overscrollBehavior: Q } = dt.current, Se = Zr(f, q);
1118
+ if (Se.isZoomGesture)
1103
1119
  return !1;
1104
- if (Me.isHorizontalDominant)
1105
- return $e.current ? (or(p), p.preventDefault(), be(), $e.current(Me.horizontalDelta), !0) : !1;
1106
- if (!F || Me.verticalDelta === 0)
1120
+ if (Se.isHorizontalDominant)
1121
+ return $e.current ? (gr(f), f.preventDefault(), Ie(), $e.current(Se.horizontalDelta), !0) : !1;
1122
+ if (!P || Se.verticalDelta === 0)
1107
1123
  return !1;
1108
- let j = Me.verticalDelta;
1109
- if (Y !== 1 && (j *= Y), te !== "contain") {
1110
- const re = C.current, De = Math.max(Ge.current.contentSize - B, 0);
1111
- if (j > 0 && re >= De || j < 0 && re <= 0)
1124
+ let J = Se.verticalDelta;
1125
+ if (B !== 1 && (J *= B), Q !== "contain") {
1126
+ const xe = A.current, Pe = Math.max(De.current.contentSize - q, 0);
1127
+ if (J > 0 && xe >= Pe || J < 0 && xe <= 0)
1112
1128
  return !1;
1113
1129
  }
1114
- return or(p), p.preventDefault(), be(), T.debug("[ScrollPane] wheel event", () => ({ deltaY: j, scrollPosition: C.current, wheelSpeedMultiplier: Y, deltaMode: p.deltaMode, scrollTop: W.current?.scrollTop })), Ae((re) => re + j), !0;
1130
+ return gr(f), f.preventDefault(), Ie(), y.debug("[ScrollPane] wheel event", () => ({ deltaY: J, scrollPosition: A.current, wheelSpeedMultiplier: B, deltaMode: f.deltaMode, scrollTop: K.current?.scrollTop })), Ve((xe) => xe + J), !0;
1115
1131
  },
1116
- [Ae, be]
1132
+ [Ve, Ie]
1117
1133
  );
1118
- q(() => {
1119
- const p = (Y) => {
1120
- it(Y);
1121
- }, F = () => {
1122
- be();
1123
- }, B = v.current;
1124
- return B && (B.addEventListener("wheel", p, { passive: !1 }), B.addEventListener("pointerdown", F, { capture: !0, passive: !0 })), () => {
1125
- B && (B.removeEventListener("wheel", p), B.removeEventListener("pointerdown", F, { capture: !0 }));
1134
+ X(() => {
1135
+ const f = (B) => {
1136
+ it(B);
1137
+ }, P = () => {
1138
+ Ie();
1139
+ }, q = v.current;
1140
+ return q && (q.addEventListener("wheel", f, { passive: !1 }), q.addEventListener("pointerdown", P, { capture: !0, passive: !0 })), () => {
1141
+ q && (q.removeEventListener("wheel", f), q.removeEventListener("pointerdown", P, { capture: !0 }));
1126
1142
  };
1127
- }, [it, be]), Jt(
1128
- Se,
1143
+ }, [it, Ie]), ir(
1144
+ pe,
1129
1145
  () => ({
1130
- scrollTo: (p, F) => (be(), Ae(p, F)),
1131
- getScrollPosition: () => C.current,
1146
+ scrollTo: (f, P) => (Ie(), Ve(f, P)),
1147
+ getScrollPosition: () => A.current,
1132
1148
  getContentSize: () => e,
1133
- getViewportSize: () => X,
1149
+ getViewportSize: () => V,
1134
1150
  applyWheel: it
1135
1151
  }),
1136
- [Ae, e, X, be, it]
1152
+ [Ve, e, V, Ie, it]
1137
1153
  );
1138
- const vt = Sr(), E = U?.id ?? vt, J = g({
1154
+ const E = Vr(), gt = W?.id ?? E, re = g({
1139
1155
  pointerType: "",
1140
1156
  pointerId: null,
1141
1157
  startClientY: 0,
@@ -1143,152 +1159,153 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
1143
1159
  isDragging: !1,
1144
1160
  shouldCancelNextClick: !1,
1145
1161
  clickResetTimer: null,
1146
- velocitySamples: []
1147
- }), Ze = g(f), ht = g(b);
1148
- q(() => {
1149
- Ze.current = f;
1150
- }, [f]), q(() => {
1151
- ht.current = b;
1162
+ velocitySamples: [],
1163
+ scale: 1
1164
+ }), N = g(d), st = g(b);
1165
+ X(() => {
1166
+ N.current = d;
1167
+ }, [d]), X(() => {
1168
+ st.current = b;
1152
1169
  }, [b]);
1153
- const Le = g(K);
1154
- q(() => {
1155
- Le.current = K;
1156
- }, [K]);
1157
- const st = g(Ce);
1158
- q(() => {
1159
- st.current = Ce;
1160
- }, [Ce]), q(() => {
1161
- const p = J.current;
1162
- if (f && K && (p.pointerId === null || Wt(p.pointerType, b)) || p.pointerId === null)
1170
+ const Ke = g(Me);
1171
+ X(() => {
1172
+ Ke.current = Me;
1173
+ }, [Me]);
1174
+ const ft = g(Fe);
1175
+ X(() => {
1176
+ ft.current = Fe;
1177
+ }, [Fe]), X(() => {
1178
+ const f = re.current;
1179
+ if (d && Me && (f.pointerId === null || Qt(f.pointerType, b)) || f.pointerId === null)
1163
1180
  return;
1164
- const F = W.current;
1165
- p.clickResetTimer !== null && (window.clearTimeout(p.clickResetTimer), p.clickResetTimer = null);
1166
- const B = p.isDragging && p.shouldCancelNextClick, Y = p.pointerId;
1167
- p.pointerId = null, p.pointerType = "", p.startClientY = 0, p.startScroll = 0, p.isDragging = !1, p.shouldCancelNextClick = B, p.velocitySamples = [], F?.hasPointerCapture(Y) && F.releasePointerCapture(Y);
1168
- }, [f, b, K]), q(() => {
1169
- const p = W.current;
1170
- if (!p)
1181
+ const P = K.current;
1182
+ f.clickResetTimer !== null && (window.clearTimeout(f.clickResetTimer), f.clickResetTimer = null);
1183
+ const q = f.isDragging && f.shouldCancelNextClick, B = f.pointerId;
1184
+ f.pointerId = null, f.pointerType = "", f.startClientY = 0, f.startScroll = 0, f.isDragging = !1, f.shouldCancelNextClick = q, f.velocitySamples = [], f.scale = 1, P?.hasPointerCapture(B) && P.releasePointerCapture(B);
1185
+ }, [d, b, Me]), X(() => {
1186
+ const f = K.current;
1187
+ if (!f)
1171
1188
  return;
1172
- const F = 6, B = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), Y = () => {
1173
- const d = J.current;
1174
- d.pointerId = null, d.pointerType = "", d.startClientY = 0, d.startScroll = 0, d.isDragging = !1, d.velocitySamples = [];
1175
- }, te = () => {
1176
- const d = J.current;
1177
- d.clickResetTimer !== null && (window.clearTimeout(d.clickResetTimer), d.clickResetTimer = null);
1178
- }, Me = (d) => {
1179
- const y = J.current, xe = B();
1180
- y.velocitySamples.push({ clientY: d, time: xe });
1181
- const tt = st.current.velocitySampleWindow;
1182
- y.velocitySamples = y.velocitySamples.filter((_e) => xe - _e.time <= tt);
1183
- }, j = (d) => d instanceof HTMLElement && d.closest("[data-scrollpane-ignore-drag='true']") !== null, re = (d) => {
1184
- const y = J.current;
1185
- y.shouldCancelNextClick && (d.preventDefault(), d.stopPropagation(), y.shouldCancelNextClick = !1);
1186
- }, De = (d) => {
1187
- const y = J.current;
1188
- if (!y.isDragging) {
1189
- if (y.isDragging = !0, y.shouldCancelNextClick = !0, !p.hasPointerCapture(d.pointerId))
1189
+ const P = 6, q = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), B = () => {
1190
+ const p = re.current;
1191
+ p.pointerId = null, p.pointerType = "", p.startClientY = 0, p.startScroll = 0, p.isDragging = !1, p.velocitySamples = [], p.scale = 1;
1192
+ }, Q = () => {
1193
+ const p = re.current;
1194
+ p.clickResetTimer !== null && (window.clearTimeout(p.clickResetTimer), p.clickResetTimer = null);
1195
+ }, Se = (p) => {
1196
+ const M = re.current, oe = q();
1197
+ M.velocitySamples.push({ clientY: p, time: oe });
1198
+ const tt = ft.current.velocitySampleWindow;
1199
+ M.velocitySamples = M.velocitySamples.filter((Ee) => oe - Ee.time <= tt);
1200
+ }, J = (p) => p instanceof HTMLElement && p.closest("[data-scrollpane-ignore-drag='true']") !== null, xe = (p) => {
1201
+ const M = re.current;
1202
+ M.shouldCancelNextClick && (p.preventDefault(), p.stopPropagation(), M.shouldCancelNextClick = !1);
1203
+ }, Pe = (p) => {
1204
+ const M = re.current;
1205
+ if (!M.isDragging) {
1206
+ if (M.isDragging = !0, M.shouldCancelNextClick = !0, !f.hasPointerCapture(p.pointerId))
1190
1207
  try {
1191
- p.setPointerCapture(d.pointerId);
1208
+ f.setPointerCapture(p.pointerId);
1192
1209
  } catch {
1193
1210
  }
1194
- Me(d.clientY);
1211
+ Se(p.clientY);
1195
1212
  }
1196
- }, ne = (d) => d.isTrusted || d.target === p, Je = (d) => {
1197
- const y = J.current;
1198
- p.hasPointerCapture(d) && p.releasePointerCapture(d), y.shouldCancelNextClick = !1, te(), Y();
1199
- }, Oe = (d) => {
1200
- const y = J.current;
1201
- if (y.pointerId !== d.pointerId)
1213
+ }, $ = (p) => p.isTrusted || p.target === f, ye = (p) => {
1214
+ const M = re.current;
1215
+ f.hasPointerCapture(p) && f.releasePointerCapture(p), M.shouldCancelNextClick = !1, Q(), B();
1216
+ }, Ce = (p) => {
1217
+ const M = re.current;
1218
+ if (M.pointerId !== p.pointerId)
1202
1219
  return;
1203
- if (d.buttons === 0 && qr(d.pointerType)) {
1204
- Je(d.pointerId);
1220
+ if (p.buttons === 0 && en(p.pointerType)) {
1221
+ ye(p.pointerId);
1205
1222
  return;
1206
1223
  }
1207
- if (!(Ze.current && Le.current) || !Wt(d.pointerType, ht.current) || !y.isDragging && (Math.abs(d.clientY - y.startClientY) < F || (De(d), !y.isDragging)))
1224
+ if (!(N.current && Ke.current) || !Qt(p.pointerType, st.current) || !M.isDragging && (Math.abs(p.clientY - M.startClientY) < P || (Pe(p), !M.isDragging)))
1208
1225
  return;
1209
- Me(d.clientY);
1210
- const xe = d.clientY - y.startClientY, tt = y.startScroll - xe;
1211
- ue.current(tt), d.cancelable && d.preventDefault();
1212
- }, ae = () => {
1213
- const d = J.current;
1214
- return d.pointerId !== null || !d.shouldCancelNextClick ? !1 : (te(), d.clickResetTimer = window.setTimeout(() => {
1215
- const y = J.current;
1216
- y.shouldCancelNextClick = !1, y.clickResetTimer = null;
1226
+ Se(p.clientY);
1227
+ const oe = (p.clientY - M.startClientY) / (M.scale || 1), tt = M.startScroll - oe;
1228
+ be.current(tt), p.cancelable && p.preventDefault();
1229
+ }, fe = () => {
1230
+ const p = re.current;
1231
+ return p.pointerId !== null || !p.shouldCancelNextClick ? !1 : (Q(), p.clickResetTimer = window.setTimeout(() => {
1232
+ const M = re.current;
1233
+ M.shouldCancelNextClick = !1, M.clickResetTimer = null;
1217
1234
  }, 0), !0);
1218
- }, ve = (d) => {
1219
- const y = J.current;
1220
- if (y.pointerId !== d.pointerId) {
1221
- ae();
1235
+ }, Re = (p) => {
1236
+ const M = re.current;
1237
+ if (M.pointerId !== p.pointerId) {
1238
+ fe();
1222
1239
  return;
1223
1240
  }
1224
- y.isDragging && y.shouldCancelNextClick && d.cancelable && (d.preventDefault(), d.stopPropagation()), y.isDragging && Me(d.clientY);
1225
- let xe = 0;
1226
- if (y.isDragging && y.velocitySamples.length >= 2) {
1227
- const _e = y.velocitySamples, ct = st.current.velocitySampleWindow, ut = _e[_e.length - 1], at = _e.find((gt) => ut.time - gt.time <= ct) ?? _e[0];
1228
- if (ut && at && ut.time !== at.time) {
1229
- const gt = ut.clientY - at.clientY, pt = ut.time - at.time;
1230
- xe = -(gt / pt);
1241
+ M.isDragging && M.shouldCancelNextClick && p.cancelable && (p.preventDefault(), p.stopPropagation()), M.isDragging && Se(p.clientY);
1242
+ let oe = 0;
1243
+ if (M.isDragging && M.velocitySamples.length >= 2) {
1244
+ const Ee = M.velocitySamples, Vt = ft.current.velocitySampleWindow, lt = Ee[Ee.length - 1], Ye = Ee.find((bt) => lt.time - bt.time <= Vt) ?? Ee[0];
1245
+ if (lt && Ye && lt.time !== Ye.time) {
1246
+ const bt = lt.clientY - Ye.clientY, Pt = lt.time - Ye.time;
1247
+ oe = -(bt / Pt) / (M.scale || 1);
1231
1248
  }
1232
1249
  }
1233
- te(), y.shouldCancelNextClick && (y.clickResetTimer = window.setTimeout(() => {
1234
- const _e = J.current;
1235
- _e.shouldCancelNextClick = !1, _e.clickResetTimer = null;
1250
+ Q(), M.shouldCancelNextClick && (M.clickResetTimer = window.setTimeout(() => {
1251
+ const Ee = re.current;
1252
+ Ee.shouldCancelNextClick = !1, Ee.clickResetTimer = null;
1236
1253
  }, 0));
1237
- const tt = st.current.startVelocityThreshold;
1238
- Y(), p.hasPointerCapture(d.pointerId) && p.releasePointerCapture(d.pointerId), Math.abs(xe) >= tt && mt.current?.(xe);
1239
- }, Ue = (d) => {
1240
- if (J.current.pointerId !== null) {
1241
- if (!d.isPrimary || d.pointerType !== J.current.pointerType)
1254
+ const tt = ft.current.startVelocityThreshold;
1255
+ B(), f.hasPointerCapture(p.pointerId) && f.releasePointerCapture(p.pointerId), Math.abs(oe) >= tt && We.current?.(oe);
1256
+ }, Je = (p) => {
1257
+ if (re.current.pointerId !== null) {
1258
+ if (!p.isPrimary || p.pointerType !== re.current.pointerType)
1242
1259
  return;
1243
- Je(J.current.pointerId);
1260
+ ye(re.current.pointerId);
1244
1261
  }
1245
- if (J.current.shouldCancelNextClick && (te(), J.current.shouldCancelNextClick = !1), !(Ze.current && Le.current) || !Wt(d.pointerType, ht.current) || d.button !== 0 && d.pointerType === "mouse" || d.ctrlKey || d.metaKey || d.altKey || j(d.target))
1262
+ if (re.current.shouldCancelNextClick && (Q(), re.current.shouldCancelNextClick = !1), !(N.current && Ke.current) || !Qt(p.pointerType, st.current) || p.button !== 0 && p.pointerType === "mouse" || p.ctrlKey || p.metaKey || p.altKey || J(p.target))
1246
1263
  return;
1247
- window.dispatchEvent(new CustomEvent(Gt, { detail: { paneId: vt } })), Te.current?.();
1248
- const y = J.current;
1249
- te(), y.pointerId = d.pointerId, y.pointerType = d.pointerType, y.startClientY = d.clientY, y.startScroll = C.current, y.isDragging = !1, y.shouldCancelNextClick = !1, y.velocitySamples = [];
1250
- }, Ve = (d) => {
1251
- if (J.current.pointerId !== d.pointerId) {
1252
- ae();
1264
+ window.dispatchEvent(new CustomEvent(tr, { detail: { paneId: E } })), G.current?.();
1265
+ const M = re.current;
1266
+ Q(), M.pointerId = p.pointerId, M.pointerType = p.pointerType, M.startClientY = p.clientY, M.startScroll = A.current, M.scale = Tr(f, "y"), M.isDragging = !1, M.shouldCancelNextClick = !1, M.velocitySamples = [];
1267
+ }, Le = (p) => {
1268
+ if (re.current.pointerId !== p.pointerId) {
1269
+ fe();
1253
1270
  return;
1254
1271
  }
1255
- ne(d) && Je(d.pointerId);
1256
- }, Qe = [
1257
- ["click", re, !0],
1258
- ["pointerdown", Ue, { passive: !1 }],
1259
- ["lostpointercapture", (d) => {
1260
- d.target !== p || J.current.pointerId !== d.pointerId || Je(d.pointerId);
1272
+ $(p) && ye(p.pointerId);
1273
+ }, we = [
1274
+ ["click", xe, !0],
1275
+ ["pointerdown", Je, { passive: !1 }],
1276
+ ["lostpointercapture", (p) => {
1277
+ p.target !== f || re.current.pointerId !== p.pointerId || ye(p.pointerId);
1261
1278
  }, void 0]
1262
- ], ot = [
1263
- ["pointermove", Oe, { passive: !1 }],
1264
- ["pointerup", ve, void 0],
1265
- ["pointercancel", Ve, void 0]
1279
+ ], et = [
1280
+ ["pointermove", Ce, { passive: !1 }],
1281
+ ["pointerup", Re, void 0],
1282
+ ["pointercancel", Le, void 0]
1266
1283
  ];
1267
- return kt(p, Qe, "add"), kt(window, ot, "add"), () => {
1268
- kt(p, Qe, "remove"), kt(window, ot, "remove");
1269
- const d = J.current;
1270
- d.pointerId !== null && p.hasPointerCapture(d.pointerId) && p.releasePointerCapture(d.pointerId), te(), Y();
1284
+ return qt(f, we, "add"), qt(window, et, "add"), () => {
1285
+ qt(f, we, "remove"), qt(window, et, "remove");
1286
+ const p = re.current;
1287
+ p.pointerId !== null && f.hasPointerCapture(p.pointerId) && f.releasePointerCapture(p.pointerId), Q(), B();
1271
1288
  };
1272
- }, [vt]);
1273
- const ie = S(
1274
- (p) => (be(), Ae(p)),
1275
- [Ae, be]
1289
+ }, [E]);
1290
+ const Ae = S(
1291
+ (f) => (Ie(), Ve(f)),
1292
+ [Ve, Ie]
1276
1293
  );
1277
- return /* @__PURE__ */ Mt("div", { ref: v, "data-testid": V, "data-self-measured": ge ? "true" : void 0, className: Et("aqvs-scroll-pane", w), style: h, children: [
1278
- /* @__PURE__ */ Mt(
1294
+ return /* @__PURE__ */ Tt("div", { ref: v, "data-testid": C, "data-self-measured": de ? "true" : void 0, className: zt("aqvs-scroll-pane", T), style: h, children: [
1295
+ /* @__PURE__ */ Tt(
1279
1296
  "div",
1280
1297
  {
1281
- ref: W,
1282
- className: Et("aqvs-scroll-pane-content"),
1298
+ ref: K,
1299
+ className: zt("aqvs-scroll-pane-content"),
1283
1300
  "data-testid": "aqvs-scroll-pane-content",
1284
1301
  style: {
1285
1302
  // ❗ 自己計測モードでは高さを書かない。CSS の `height: 100%` (= ルートの確定高さ) が
1286
1303
  // レイアウトを所有することで、「計測した値を書き戻して自分のサイズを変える」
1287
1304
  // フィードバックループが構造的に起こらず、初回 paint の時点でも帯は実寸で正しい
1288
1305
  // (数値の反映だけが 1 コミット遅れる)。明示モードは従来どおり px を書く。
1289
- height: ge ? void 0 : X,
1290
- paddingTop: je.top,
1291
- paddingBottom: je.bottom,
1306
+ height: de ? void 0 : V,
1307
+ paddingTop: Ue.top,
1308
+ paddingBottom: Ue.bottom,
1292
1309
  // スクロール不能時 (contentSize <= viewportSize) は touch-action を通常に戻し、
1293
1310
  // 短いリスト上のタッチがページ全体のパンを妨げるデッドゾーン化を防ぐ。
1294
1311
  // 直接操作 (指・ペン) のドラッグを許可していない場合も付けない。
@@ -1302,102 +1319,102 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
1302
1319
  // 同一条件で揃えてあるため状態としても一貫している。
1303
1320
  // 非同期コンテンツを先読みして確保する挙動は意図的に入れていない
1304
1321
  // (空のペインがページのパンを殺すデッドゾーンになり、そちらの実害の方が大きいため)。
1305
- ...f && K && b.some((p) => p === "touch" || p === "pen") ? { touchAction: "none" } : {}
1322
+ ...d && Me && b.some((f) => f === "touch" || f === "pen") ? { touchAction: "none" } : {}
1306
1323
  },
1307
- ...U,
1308
- id: E,
1324
+ ...W,
1325
+ id: gt,
1309
1326
  children: [
1310
- z,
1311
- r(C.current)
1327
+ L,
1328
+ r(A.current)
1312
1329
  ]
1313
1330
  }
1314
1331
  ),
1315
- /* @__PURE__ */ de(
1316
- kr,
1332
+ /* @__PURE__ */ ne(
1333
+ Gr,
1317
1334
  {
1318
1335
  contentSize: e,
1319
- viewportSize: X,
1320
- scrollPosition: C.current,
1321
- onScroll: ie,
1336
+ viewportSize: V,
1337
+ scrollPosition: A.current,
1338
+ onScroll: Ae,
1322
1339
  enableThumbDrag: s,
1323
1340
  enableTrackClick: a,
1324
- enableArrowButtons: c,
1341
+ enableArrowButtons: m,
1325
1342
  scrollBarWidth: i,
1326
- ariaControls: E,
1327
- tapScrollCircleOptions: G,
1328
- itemCount: pe,
1329
- renderThumbOverlay: me,
1330
- visibleStartIndex: _,
1331
- visibleEndIndex: M
1343
+ ariaControls: gt,
1344
+ tapScrollCircleOptions: U,
1345
+ itemCount: le,
1346
+ renderThumbOverlay: ce,
1347
+ visibleStartIndex: F,
1348
+ visibleEndIndex: w
1332
1349
  },
1333
1350
  "scrollbar"
1334
1351
  ),
1335
- Z?.()
1352
+ j?.()
1336
1353
  ] });
1337
1354
  }
1338
- ), ar = (r, e, t) => Math.min(Math.max(r, e), t), an = ({ dragState: r, normalizedDistance: e, sizeScale: t, size: n }) => {
1339
- const i = Math.max(n / 2, 1), s = 1 + e * 0.65, a = Math.max(0.65, 1 - e * 0.25), c = r.direction * e * 26 * t, f = 0.8 + e * 0.18, b = 3 * t, I = 6 * t, w = 22 * t, V = Math.abs(c) + I, h = c > 0 ? b : -Math.abs(c) - b, z = Math.max(2.5, 3 * t), G = ar(r.offsetX, -i, i), H = ar(r.offsetY, -i, i), pe = i * 0.35, me = G / i * pe, oe = H / i * pe, ce = me * 0.45, he = oe * 0.45, P = Math.max(w * 0.38, 6), _ = 0.65 + e * 0.2, M = r.active;
1340
- return /* @__PURE__ */ Mt(dr, { children: [
1341
- /* @__PURE__ */ de(
1355
+ ), br = (r, e, t) => Math.min(Math.max(r, e), t), vn = ({ dragState: r, normalizedDistance: e, sizeScale: t, size: n }) => {
1356
+ const i = Math.max(n / 2, 1), s = 1 + e * 0.65, a = Math.max(0.65, 1 - e * 0.25), m = r.direction * e * 26 * t, d = 0.8 + e * 0.18, b = 3 * t, x = 6 * t, T = 22 * t, C = Math.abs(m) + x, h = m > 0 ? b : -Math.abs(m) - b, L = Math.max(2.5, 3 * t), U = br(r.offsetX, -i, i), D = br(r.offsetY, -i, i), le = i * 0.35, ce = U / i * le, te = D / i * le, se = ce * 0.45, ue = te * 0.45, R = Math.max(T * 0.38, 6), F = 0.65 + e * 0.2, w = r.active;
1357
+ return /* @__PURE__ */ Tt(rr, { children: [
1358
+ /* @__PURE__ */ ne(
1342
1359
  "div",
1343
1360
  {
1344
1361
  className: "aqvs-tap-scroll-circle-gradient",
1345
1362
  style: {
1346
1363
  transform: `scale(${a}, ${s})`,
1347
- transition: M ? "40ms transform ease-out" : "200ms ease transform"
1364
+ transition: w ? "40ms transform ease-out" : "200ms ease transform"
1348
1365
  }
1349
1366
  }
1350
1367
  ),
1351
- /* @__PURE__ */ de(
1368
+ /* @__PURE__ */ ne(
1352
1369
  "div",
1353
1370
  {
1354
1371
  className: "aqvs-sample-visual-pupil",
1355
1372
  style: {
1356
- width: w,
1357
- height: w,
1358
- transform: `translate(calc(-50% + ${me}px), calc(-50% + ${oe}px)) scale(${a}, ${f * s})`,
1359
- transition: M ? "70ms transform ease-out" : "200ms ease transform"
1373
+ width: T,
1374
+ height: T,
1375
+ transform: `translate(calc(-50% + ${ce}px), calc(-50% + ${te}px)) scale(${a}, ${d * s})`,
1376
+ transition: w ? "70ms transform ease-out" : "200ms ease transform"
1360
1377
  }
1361
1378
  }
1362
1379
  ),
1363
- /* @__PURE__ */ de(
1380
+ /* @__PURE__ */ ne(
1364
1381
  "div",
1365
1382
  {
1366
1383
  className: "aqvs-sample-visual-highlight",
1367
1384
  style: {
1368
- width: P,
1369
- height: P,
1370
- transform: `translate(calc(-50% + ${ce}px), calc(-50% + ${he}px)) scale(${a}, ${s})`,
1371
- opacity: _,
1385
+ width: R,
1386
+ height: R,
1387
+ transform: `translate(calc(-50% + ${se}px), calc(-50% + ${ue}px)) scale(${a}, ${s})`,
1388
+ opacity: F,
1372
1389
  boxShadow: "0 0 8px rgba(255,255,255,0.45)",
1373
- transition: M ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
1390
+ transition: w ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
1374
1391
  }
1375
1392
  }
1376
1393
  ),
1377
- /* @__PURE__ */ de(
1394
+ /* @__PURE__ */ ne(
1378
1395
  "div",
1379
1396
  {
1380
1397
  className: "aqvs-sample-visual-rod",
1381
1398
  style: {
1382
- width: z,
1383
- height: V,
1399
+ width: L,
1400
+ height: C,
1384
1401
  transform: `translate(-50%, ${h}px)`,
1385
1402
  opacity: e,
1386
- transition: M ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
1403
+ transition: w ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
1387
1404
  }
1388
1405
  }
1389
1406
  )
1390
1407
  ] });
1391
- }, Ft = 100, $r = (r) => {
1408
+ }, Xt = 100, rn = (r) => {
1392
1409
  if (!Number.isFinite(r))
1393
1410
  return 0n;
1394
1411
  const e = Math.trunc(r);
1395
1412
  return e <= 0 ? 0n : BigInt(e);
1396
- }, Kt = (r, e) => {
1413
+ }, Jt = (r, e) => {
1397
1414
  if (!Number.isFinite(r))
1398
1415
  throw new Error(`valueFn returned a non-finite value at index ${e}: ${r}`);
1399
1416
  return r;
1400
- }, Rt = (r) => {
1417
+ }, Nt = (r) => {
1401
1418
  if (r <= 0 || !Number.isFinite(r))
1402
1419
  return 0;
1403
1420
  const e = Math.trunc(r);
@@ -1472,25 +1489,25 @@ class St {
1472
1489
  }
1473
1490
  let s = 0, a;
1474
1491
  if (i > 0) {
1475
- const c = n?.sampleRange ?? {
1492
+ const m = n?.sampleRange ?? {
1476
1493
  from: 0,
1477
- to: Math.min(Ft - 1, i - 1)
1494
+ to: Math.min(Xt - 1, i - 1)
1478
1495
  };
1479
- let f = Math.max(0, Math.trunc(c.from)), b = Math.min(Math.trunc(c.to), i - 1);
1480
- if (f > b && (f = 0, b = Math.min(Ft - 1, i - 1)), i > Ft)
1481
- s = St._sampleBaseValueStrided(t, i, Ft), n?.materialize && (a = { from: f, values: St._collectValidatedValues(t, f, b) });
1496
+ let d = Math.max(0, Math.trunc(m.from)), b = Math.min(Math.trunc(m.to), i - 1);
1497
+ if (d > b && (d = 0, b = Math.min(Xt - 1, i - 1)), i > Xt)
1498
+ s = St._sampleBaseValueStrided(t, i, Xt), n?.materialize && (a = { from: d, values: St._collectValidatedValues(t, d, b) });
1482
1499
  else {
1483
- const I = St._collectValidatedValues(t, f, b);
1484
- s = St._modeOrMedian([...I]), n?.materialize && (a = { from: f, values: I });
1500
+ const x = St._collectValidatedValues(t, d, b);
1501
+ s = St._modeOrMedian([...x]), n?.materialize && (a = { from: d, values: x });
1485
1502
  }
1486
1503
  }
1487
1504
  if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = t, this.baseValue = s, a)
1488
- for (let c = 0; c < a.values.length; c++) {
1489
- const f = a.from + c;
1490
- if (f >= this.size)
1505
+ for (let m = 0; m < a.values.length; m++) {
1506
+ const d = a.from + m;
1507
+ if (d >= this.size)
1491
1508
  break;
1492
- const b = a.values[c] - this.baseValue;
1493
- b !== 0 && (this.deltas.set(f, b), this._updateTree(f, b));
1509
+ const b = a.values[m] - this.baseValue;
1510
+ b !== 0 && (this.deltas.set(d, b), this._updateTree(d, b));
1494
1511
  }
1495
1512
  this.total = this.getTotal();
1496
1513
  }
@@ -1521,7 +1538,7 @@ class St {
1521
1538
  static _collectValidatedValues(e, t, n) {
1522
1539
  const i = [];
1523
1540
  for (let s = t; s <= n; s++)
1524
- i.push(Kt(e(s), s));
1541
+ i.push(Jt(e(s), s));
1525
1542
  return i;
1526
1543
  }
1527
1544
  /**
@@ -1535,22 +1552,22 @@ class St {
1535
1552
  static _modeOrMedian(e) {
1536
1553
  if (e.length === 0)
1537
1554
  return 0;
1538
- e.sort((a, c) => a - c);
1555
+ e.sort((a, m) => a - m);
1539
1556
  const t = Math.floor(e.length / 2);
1540
1557
  let n;
1541
1558
  e.length % 2 === 0 ? n = Math.floor((e[t - 1] + e[t]) / 2) : n = e[t];
1542
1559
  const i = /* @__PURE__ */ new Map();
1543
1560
  let s = 0;
1544
1561
  for (const a of e) {
1545
- const c = (i.get(a) ?? 0) + 1;
1546
- i.set(a, c), c > s && (s = c);
1562
+ const m = (i.get(a) ?? 0) + 1;
1563
+ i.set(a, m), m > s && (s = m);
1547
1564
  }
1548
1565
  if (s > e.length * 0.2) {
1549
1566
  const a = [];
1550
- for (const [f, b] of i.entries())
1551
- b === s && a.push(f);
1552
- const c = a.reduce((f, b) => f + b, 0);
1553
- n = Math.floor(c / a.length);
1567
+ for (const [d, b] of i.entries())
1568
+ b === s && a.push(d);
1569
+ const m = a.reduce((d, b) => d + b, 0);
1570
+ n = Math.floor(m / a.length);
1554
1571
  }
1555
1572
  return n;
1556
1573
  }
@@ -1571,7 +1588,7 @@ class St {
1571
1588
  i % 2 === 0 && (i += 1);
1572
1589
  const s = [];
1573
1590
  for (let a = 0; a < t && s.length < n; a += i)
1574
- s.push(Kt(e(a), a));
1591
+ s.push(Jt(e(a), a));
1575
1592
  return St._modeOrMedian(s);
1576
1593
  }
1577
1594
  /**
@@ -1644,7 +1661,7 @@ class St {
1644
1661
  let n = e + 1;
1645
1662
  for (; n <= this.size; ) {
1646
1663
  this.tree.set(n, (this.tree.get(n) ?? 0) + t);
1647
- const i = Rt(n);
1664
+ const i = Nt(n);
1648
1665
  if (i === 0)
1649
1666
  break;
1650
1667
  n += i;
@@ -1670,8 +1687,8 @@ class St {
1670
1687
  throw new Error(`Value must be a finite number: ${s}`);
1671
1688
  if (s < 0)
1672
1689
  throw new Error("Value cannot be negative.");
1673
- const a = n.has(i) ? n.get(i) ?? 0 : this.deltas.get(i) ?? 0, c = a + this.baseValue, f = s - c;
1674
- f !== 0 && t.push({ index: i, change: f }), n.set(i, a + f);
1690
+ const a = n.has(i) ? n.get(i) ?? 0 : this.deltas.get(i) ?? 0, m = a + this.baseValue, d = s - m;
1691
+ d !== 0 && t.push({ index: i, change: d }), n.set(i, a + d);
1675
1692
  }
1676
1693
  return t;
1677
1694
  }
@@ -1688,7 +1705,7 @@ class St {
1688
1705
  let e = 0, t = this.size;
1689
1706
  for (; t > 0; ) {
1690
1707
  e += this.tree.get(t) ?? 0;
1691
- const n = Rt(t);
1708
+ const n = Nt(t);
1692
1709
  if (n === 0)
1693
1710
  break;
1694
1711
  t -= n;
@@ -1705,7 +1722,7 @@ class St {
1705
1722
  */
1706
1723
  _materialize(e, t = !0) {
1707
1724
  if (this.valueFn) {
1708
- const n = this.deltas.get(e) ?? 0, s = Kt(this.valueFn(e), e) - this.baseValue;
1725
+ const n = this.deltas.get(e) ?? 0, s = Jt(this.valueFn(e), e) - this.baseValue;
1709
1726
  if (s !== n && (s === 0 ? this.deltas.delete(e) : this.deltas.set(e, s), t)) {
1710
1727
  const a = s - n;
1711
1728
  this._updateTree(e, a);
@@ -1726,10 +1743,10 @@ class St {
1726
1743
  return;
1727
1744
  const i = e.ranges;
1728
1745
  if (i && i.length > 0) {
1729
- for (const c of i) {
1730
- const f = Math.max(0, Math.trunc(c.from)), b = Math.min(Math.trunc(c.to), this.size - 1);
1731
- for (let I = f; I <= b; I++)
1732
- this._materialize(I);
1746
+ for (const m of i) {
1747
+ const d = Math.max(0, Math.trunc(m.from)), b = Math.min(Math.trunc(m.to), this.size - 1);
1748
+ for (let x = d; x <= b; x++)
1749
+ this._materialize(x);
1733
1750
  }
1734
1751
  if (t === void 0)
1735
1752
  return;
@@ -1766,8 +1783,8 @@ class St {
1766
1783
  return { index: -1, total: this.total ?? this.getTotal(), cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
1767
1784
  if (!i)
1768
1785
  break;
1769
- const c = this.deltas.get(s) ?? 0;
1770
- if (this._materialize(s), (this.deltas.get(s) ?? 0) === c)
1786
+ const m = this.deltas.get(s) ?? 0;
1787
+ if (this._materialize(s), (this.deltas.get(s) ?? 0) === m)
1771
1788
  break;
1772
1789
  }
1773
1790
  const a = this.prefixSum(s);
@@ -1795,8 +1812,8 @@ class St {
1795
1812
  for (; s > 0; s >>= 1) {
1796
1813
  const a = n + s;
1797
1814
  if (a <= this.size) {
1798
- const f = (this.tree.get(a) ?? 0) + this.baseValue * s;
1799
- (t ? i + f < e : i + f <= e) && (n = a, i += f);
1815
+ const d = (this.tree.get(a) ?? 0) + this.baseValue * s;
1816
+ (t ? i + d < e : i + d <= e) && (n = a, i += d);
1800
1817
  }
1801
1818
  }
1802
1819
  return t ? n : n - 1;
@@ -1809,20 +1826,20 @@ class St {
1809
1826
  _findIndexLarge(e, t, n) {
1810
1827
  if (this.size === 0)
1811
1828
  return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
1812
- const i = $r(this.size);
1829
+ const i = rn(this.size);
1813
1830
  if (i === 0n)
1814
1831
  return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
1815
1832
  this._materializeRanges(t.materializeOption);
1816
1833
  const s = t.materializeOption?.materialize === !0;
1817
1834
  for (; ; ) {
1818
- let a = 0n, c = i - 1n, f, b, I = this.total;
1819
- for (; a <= c; ) {
1820
- const h = a + c >> 1n, z = Number(h), G = this.prefixSum(z);
1821
- if (I = G.total, n ? G.cumulative >= e : G.cumulative <= e)
1822
- if (f = h, b = G, n) {
1835
+ let a = 0n, m = i - 1n, d, b, x = this.total;
1836
+ for (; a <= m; ) {
1837
+ const h = a + m >> 1n, L = Number(h), U = this.prefixSum(L);
1838
+ if (x = U.total, n ? U.cumulative >= e : U.cumulative <= e)
1839
+ if (d = h, b = U, n) {
1823
1840
  if (h === 0n)
1824
1841
  break;
1825
- c = h - 1n;
1842
+ m = h - 1n;
1826
1843
  } else
1827
1844
  a = h + 1n;
1828
1845
  else if (n)
@@ -1830,21 +1847,21 @@ class St {
1830
1847
  else {
1831
1848
  if (h === 0n)
1832
1849
  break;
1833
- c = h - 1n;
1850
+ m = h - 1n;
1834
1851
  }
1835
1852
  }
1836
- const w = b, V = f !== void 0 ? Number(f) : -1;
1837
- if (s && V >= 0) {
1838
- const h = this.deltas.get(V) ?? 0;
1839
- if (this._materialize(V), (this.deltas.get(V) ?? 0) !== h)
1853
+ const T = b, C = d !== void 0 ? Number(d) : -1;
1854
+ if (s && C >= 0) {
1855
+ const h = this.deltas.get(C) ?? 0;
1856
+ if (this._materialize(C), (this.deltas.get(C) ?? 0) !== h)
1840
1857
  continue;
1841
1858
  }
1842
1859
  return {
1843
- index: V,
1844
- total: I,
1845
- cumulative: w?.cumulative,
1846
- currentValue: w?.currentValue,
1847
- safeIndex: w?.safeIndex
1860
+ index: C,
1861
+ total: x,
1862
+ cumulative: T?.cumulative,
1863
+ currentValue: T?.currentValue,
1864
+ safeIndex: T?.safeIndex
1848
1865
  };
1849
1866
  }
1850
1867
  }
@@ -1861,19 +1878,19 @@ class St {
1861
1878
  return { cumulative: 0, total: this.total, currentValue: 0, safeIndex: 0 };
1862
1879
  if (this.size === 0)
1863
1880
  return { cumulative: 0, total: this.total ?? 0, currentValue: 0, safeIndex: 0 };
1864
- const n = le(Math.trunc(e), 0, this.size - 1), i = t?.materializeOption;
1881
+ const n = ie(Math.trunc(e), 0, this.size - 1), i = t?.materializeOption;
1865
1882
  this._materializeRanges(i, n, !0);
1866
1883
  let s = 0, a = n + 1;
1867
1884
  for (; a > 0; ) {
1868
- const f = this.tree.get(a) ?? 0;
1869
- s += f;
1870
- const b = Rt(a);
1885
+ const d = this.tree.get(a) ?? 0;
1886
+ s += d;
1887
+ const b = Nt(a);
1871
1888
  if (b === 0)
1872
1889
  break;
1873
1890
  a -= b;
1874
1891
  }
1875
- const c = i?.materialize ? this.get(n) : (this.deltas.get(n) || 0) + this.baseValue;
1876
- return { cumulative: s + this.baseValue * (n + 1), total: this.total, currentValue: c, safeIndex: n };
1892
+ const m = i?.materialize ? this.get(n) : (this.deltas.get(n) || 0) + this.baseValue;
1893
+ return { cumulative: s + this.baseValue * (n + 1), total: this.total, currentValue: m, safeIndex: n };
1877
1894
  }
1878
1895
  /**
1879
1896
  * @method get
@@ -1906,7 +1923,7 @@ class St {
1906
1923
  else {
1907
1924
  this.total = this._computeTreeTotal();
1908
1925
  const n = this.prefixSum(this.getSize() - 1);
1909
- n.cumulative !== n.total && T.error("Inconsistent Fenwick Tree state");
1926
+ n.cumulative !== n.total && y.error("Inconsistent Fenwick Tree state");
1910
1927
  }
1911
1928
  return this.total;
1912
1929
  }
@@ -1930,7 +1947,7 @@ class St {
1930
1947
  let s = n + 1;
1931
1948
  for (; s <= this.size; ) {
1932
1949
  t.set(s, (t.get(s) ?? 0) + i);
1933
- const a = Rt(s);
1950
+ const a = Nt(s);
1934
1951
  if (a === 0)
1935
1952
  break;
1936
1953
  s += a;
@@ -2013,7 +2030,7 @@ class St {
2013
2030
  this.size = t, this.rebuildTree();
2014
2031
  }
2015
2032
  const i = this.prefixSum(this.getSize() - 1);
2016
- i.cumulative !== i.total && T.error("Inconsistent Fenwick Tree state");
2033
+ i.cumulative !== i.total && y.error("Inconsistent Fenwick Tree state");
2017
2034
  }
2018
2035
  /**
2019
2036
  * @private
@@ -2047,14 +2064,14 @@ class St {
2047
2064
  _propagateDeltaToGrownNodes(e, t, n, i) {
2048
2065
  let s = e + 1;
2049
2066
  for (; s <= n; ) {
2050
- const a = Rt(s);
2067
+ const a = Nt(s);
2051
2068
  if (a === 0)
2052
2069
  break;
2053
2070
  s += a;
2054
2071
  }
2055
2072
  for (; s <= i; ) {
2056
2073
  this.tree.set(s, (this.tree.get(s) ?? 0) + t);
2057
- const a = Rt(s);
2074
+ const a = Nt(s);
2058
2075
  if (a === 0)
2059
2076
  break;
2060
2077
  s += a;
@@ -2148,20 +2165,20 @@ class St {
2148
2165
  return this._findIndex(e, t ?? {}, !1);
2149
2166
  }
2150
2167
  }
2151
- const Ur = (r, e) => {
2168
+ const nn = (r, e) => {
2152
2169
  const t = r?.sampleRange, n = e?.sampleRange;
2153
2170
  return t === n ? !1 : t && n ? t.from !== n.from || t.to !== n.to : !0;
2154
- }, Wr = (r, e, t) => {
2171
+ }, sn = (r, e, t) => {
2155
2172
  const n = Number.isFinite(r) && r > 0 ? Math.trunc(r) : 0, i = g(null), s = g({ size: n, valueOrFn: e, options: t });
2156
2173
  i.current === null && (i.current = new St(n, e, t));
2157
- const a = i.current, c = s.current, f = c.size !== n, b = c.valueOrFn !== e, I = Ur(c.options, t), w = c.size === 0 && n > 0 && (!i.current || i.current.base === 0);
2158
- if (b || I) {
2159
- const V = t?.resetOnValueFnChange ?? !0;
2160
- I || b && V || w ? (t?.debug && T.debug("[useFenwickMapTree] reset", { valueOrFnChanged: b, optionsChanged: I }), a.reset(n, e, t)) : (f && (t?.debug && T.debug("[useFenwickMapTree] resize (with valueFn change)", { from: c.size, to: n }), a.changeSize(n)), t?.debug && T.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: b }), a.setValueFn(e, { reset: !1 })), s.current = { size: n, valueOrFn: e, options: t };
2161
- } else f && (t?.debug && T.debug("[useFenwickMapTree] resize", { from: c.size, to: n }), w ? a.reset(n, e, t) : a.changeSize(n), s.current = { size: n, valueOrFn: e, options: t });
2174
+ const a = i.current, m = s.current, d = m.size !== n, b = m.valueOrFn !== e, x = nn(m.options, t), T = m.size === 0 && n > 0 && (!i.current || i.current.base === 0);
2175
+ if (b || x) {
2176
+ const C = t?.resetOnValueFnChange ?? !0;
2177
+ x || b && C || T ? (t?.debug && y.debug("[useFenwickMapTree] reset", { valueOrFnChanged: b, optionsChanged: x }), a.reset(n, e, t)) : (d && (t?.debug && y.debug("[useFenwickMapTree] resize (with valueFn change)", { from: m.size, to: n }), a.changeSize(n)), t?.debug && y.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: b }), a.setValueFn(e, { reset: !1 })), s.current = { size: n, valueOrFn: e, options: t };
2178
+ } else d && (t?.debug && y.debug("[useFenwickMapTree] resize", { from: m.size, to: n }), T ? a.reset(n, e, t) : a.changeSize(n), s.current = { size: n, valueOrFn: e, options: t });
2162
2179
  return a;
2163
2180
  };
2164
- class Kr {
2181
+ class on {
2165
2182
  key;
2166
2183
  value;
2167
2184
  prev = null;
@@ -2170,7 +2187,7 @@ class Kr {
2170
2187
  this.key = e, this.value = t;
2171
2188
  }
2172
2189
  }
2173
- class jt {
2190
+ class er {
2174
2191
  head = null;
2175
2192
  tail = null;
2176
2193
  /**
@@ -2211,225 +2228,225 @@ class jt {
2211
2228
  this.remove(e), this.addToTail(e);
2212
2229
  }
2213
2230
  }
2214
- function jr(r) {
2215
- const e = g(/* @__PURE__ */ new Map()), t = g(new jt()), n = Math.floor(r), i = g(n);
2216
- q(() => {
2231
+ function an(r) {
2232
+ const e = g(/* @__PURE__ */ new Map()), t = g(new er()), n = Math.floor(r), i = g(n);
2233
+ X(() => {
2217
2234
  if (i.current = n, Number.isNaN(n) || n < 0) {
2218
- T.warn(`useLruCache: invalid capacity ${r}; the cache will not store any entries.`), e.current.clear(), t.current = new jt();
2235
+ y.warn(`useLruCache: invalid capacity ${r}; the cache will not store any entries.`), e.current.clear(), t.current = new er();
2219
2236
  return;
2220
2237
  }
2221
2238
  if (Number.isFinite(n))
2222
2239
  for (; e.current.size > n; ) {
2223
- const I = t.current.removeHead();
2224
- if (I)
2225
- e.current.delete(I.key);
2240
+ const x = t.current.removeHead();
2241
+ if (x)
2242
+ e.current.delete(x.key);
2226
2243
  else
2227
2244
  break;
2228
2245
  }
2229
2246
  }, [r, n]);
2230
- const s = S((I) => {
2231
- const w = e.current.get(I);
2232
- if (w)
2233
- return t.current.moveToTail(w), w.value;
2234
- }, []), a = S((I, w) => {
2235
- const V = i.current;
2236
- if (Number.isNaN(V) || V <= 0)
2247
+ const s = S((x) => {
2248
+ const T = e.current.get(x);
2249
+ if (T)
2250
+ return t.current.moveToTail(T), T.value;
2251
+ }, []), a = S((x, T) => {
2252
+ const C = i.current;
2253
+ if (Number.isNaN(C) || C <= 0)
2237
2254
  return;
2238
- let h = e.current.get(I);
2255
+ let h = e.current.get(x);
2239
2256
  if (h)
2240
- h.value = w, t.current.moveToTail(h);
2257
+ h.value = T, t.current.moveToTail(h);
2241
2258
  else {
2242
- if (e.current.size >= V) {
2243
- const z = t.current.removeHead();
2244
- z && e.current.delete(z.key);
2259
+ if (e.current.size >= C) {
2260
+ const L = t.current.removeHead();
2261
+ L && e.current.delete(L.key);
2245
2262
  }
2246
- h = new Kr(I, w), e.current.set(I, h), t.current.addToTail(h);
2263
+ h = new on(x, T), e.current.set(x, h), t.current.addToTail(h);
2247
2264
  }
2248
- }, []), c = S((I) => e.current.has(I), []), f = S((I) => {
2249
- const w = e.current.get(I);
2250
- w && (t.current.remove(w), e.current.delete(I));
2265
+ }, []), m = S((x) => e.current.has(x), []), d = S((x) => {
2266
+ const T = e.current.get(x);
2267
+ T && (t.current.remove(T), e.current.delete(x));
2251
2268
  }, []), b = S(() => {
2252
- e.current.clear(), t.current = new jt();
2269
+ e.current.clear(), t.current = new er();
2253
2270
  }, []);
2254
- return Fe(() => ({ get: s, set: a, has: c, remove: f, clear: b }), [s, a, c, f, b]);
2271
+ return _e(() => ({ get: s, set: a, has: m, remove: d, clear: b }), [s, a, m, d, b]);
2255
2272
  }
2256
- const Gr = 1e4, ln = () => {
2257
- const { get: r, set: e, has: t, clear: n } = jr(Gr);
2258
- return Fe(() => ({ get: r, set: e, has: t, clear: n }), [r, e, t, n]);
2259
- }, cn = (r, e) => {
2273
+ const ln = 1e4, In = () => {
2274
+ const { get: r, set: e, has: t, clear: n } = an(ln);
2275
+ return _e(() => ({ get: r, set: e, has: t, clear: n }), [r, e, t, n]);
2276
+ }, Sn = (r, e) => {
2260
2277
  const t = g(e), n = g(r);
2261
- nt(() => {
2278
+ Ze(() => {
2262
2279
  t.current = e, n.current = r;
2263
2280
  }, [e, r]);
2264
2281
  const i = g(/* @__PURE__ */ new WeakMap());
2265
2282
  return S((s) => {
2266
2283
  if (!s || i.current.has(s))
2267
2284
  return;
2268
- const a = (c) => {
2269
- t.current?.enableBridge !== !1 && n.current.current?.applyWheel(c);
2285
+ const a = (m) => {
2286
+ t.current?.enableBridge !== !1 && n.current.current?.applyWheel(m);
2270
2287
  };
2271
2288
  return s.addEventListener("wheel", a, { passive: !1 }), i.current.set(s, a), () => {
2272
2289
  i.current.get(s) === a && (s.removeEventListener("wheel", a), i.current.delete(s));
2273
2290
  };
2274
2291
  }, []);
2275
- }, Pe = (r, e) => e <= 0 ? 0 : le(r, 0, e - 1), lr = (r) => ({
2292
+ }, ve = (r, e) => e <= 0 ? 0 : ie(r, 0, e - 1), xr = (r) => ({
2276
2293
  top: Math.max(0, r?.top ?? 0),
2277
2294
  bottom: Math.max(0, r?.bottom ?? 0)
2278
- }), Ke = (r, e) => r <= e ? 0 : r - e, Pt = (r, e) => r <= 0 ? 0 : r + e, Yt = 1e3, cr = 2e3, Zr = 1048576, Jr = 40, Dt = (r) => {
2295
+ }), Ge = (r, e) => r <= e ? 0 : r - e, Mt = (r, e) => r <= 0 ? 0 : r + e, $t = 1e3, vr = 2e3, cn = 1048576, un = 40, kt = (r) => {
2279
2296
  if (!Number.isFinite(r)) return 0n;
2280
2297
  const e = Math.trunc(r);
2281
2298
  return e <= 0 ? 0n : BigInt(e);
2282
- }, Qr = (r, e, t, n, i, s, a, c) => {
2283
- const f = Dt(n);
2284
- if (f === 0n)
2299
+ }, dn = (r, e, t, n, i, s, a, m) => {
2300
+ const d = kt(n);
2301
+ if (d === 0n)
2285
2302
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
2286
- const b = (P) => P < 0n ? 0n : P >= f ? f - 1n : P, I = { materializeOption: { materialize: !1 } }, { index: w, cumulative: V } = s.findIndexAtOrAfter(r, I);
2303
+ const b = (R) => R < 0n ? 0n : R >= d ? d - 1n : R, x = { materializeOption: { materialize: !1 } }, { index: T, cumulative: C } = s.findIndexAtOrAfter(r, x);
2287
2304
  let h;
2288
- w === -1 ? h = f - 1n : (V === r ? h = Dt(w + 1) : h = Dt(w), h >= f && (h = f - 1n)), r <= 0 && (h = 0n), c && r >= a && (h = f - 1n);
2289
- const z = (P) => {
2290
- const _ = Number(P);
2291
- if (!Number.isSafeInteger(_))
2305
+ T === -1 ? h = d - 1n : (C === r ? h = kt(T + 1) : h = kt(T), h >= d && (h = d - 1n)), r <= 0 && (h = 0n), m && r >= a && (h = d - 1n);
2306
+ const L = (R) => {
2307
+ const F = Number(R);
2308
+ if (!Number.isSafeInteger(F))
2292
2309
  return null;
2293
- const { cumulative: M } = s.prefixSum(_, { materializeOption: { materialize: !1 } });
2294
- if (!Number.isFinite(M))
2310
+ const { cumulative: w } = s.prefixSum(F, { materializeOption: { materialize: !1 } });
2311
+ if (!Number.isFinite(w))
2295
2312
  return null;
2296
- const { index: Z } = s.findIndexAtOrAfter(M + 0.5, { materializeOption: { materialize: !1 } });
2297
- if (Z === -1)
2313
+ const { index: j } = s.findIndexAtOrAfter(w + 0.5, { materializeOption: { materialize: !1 } });
2314
+ if (j === -1)
2298
2315
  return null;
2299
- const Q = Dt(Z);
2300
- return Q > P ? Q : null;
2301
- }, G = (P) => {
2302
- let _ = 0, M = P, Z = P, Q = 0n, U = 0;
2303
- for (; M < f && _ < e; ) {
2304
- const Se = Number(M), C = i(Se);
2305
- if (_ += C, Z = M, M += 1n, Q += 1n, !Number.isFinite(C) || C < 0)
2316
+ const Z = kt(j);
2317
+ return Z > R ? Z : null;
2318
+ }, U = (R) => {
2319
+ let F = 0, w = R, j = R, Z = 0n, W = 0;
2320
+ for (; w < d && F < e; ) {
2321
+ const pe = Number(w), A = i(pe);
2322
+ if (F += A, j = w, w += 1n, Z += 1n, !Number.isFinite(A) || A < 0)
2306
2323
  break;
2307
- if (C === 0) {
2308
- if (U += 1, U > Yt) {
2309
- const v = z(Z);
2310
- if (v !== null && v > M)
2311
- M = v, U = 0;
2312
- else if (v !== null && v === M && i(Number(M)) > 0)
2313
- U = 0;
2324
+ if (A === 0) {
2325
+ if (W += 1, W > $t) {
2326
+ const v = L(j);
2327
+ if (v !== null && v > w)
2328
+ w = v, W = 0;
2329
+ else if (v !== null && v === w && i(Number(w)) > 0)
2330
+ W = 0;
2314
2331
  else
2315
2332
  break;
2316
2333
  }
2317
2334
  } else
2318
- U = 0;
2335
+ W = 0;
2319
2336
  }
2320
- return Q === 0n && (Z = P), { height: _, end: Z };
2337
+ return Z === 0n && (j = R), { height: F, end: j };
2321
2338
  };
2322
- let { height: H, end: pe } = G(h);
2323
- if (H < e && h > 0n) {
2324
- let P = h, _ = H, M = 0;
2325
- for (; P > 0n && _ < e; ) {
2326
- P -= 1n;
2327
- const Q = Number(P), U = i(Q);
2328
- if (_ += U, !Number.isFinite(U) || U < 0)
2339
+ let { height: D, end: le } = U(h);
2340
+ if (D < e && h > 0n) {
2341
+ let R = h, F = D, w = 0;
2342
+ for (; R > 0n && F < e; ) {
2343
+ R -= 1n;
2344
+ const Z = Number(R), W = i(Z);
2345
+ if (F += W, !Number.isFinite(W) || W < 0)
2329
2346
  break;
2330
- if (U === 0) {
2331
- if (M += 1, M > Yt) {
2332
- const Se = Number(P);
2333
- if (!Number.isSafeInteger(Se))
2347
+ if (W === 0) {
2348
+ if (w += 1, w > $t) {
2349
+ const pe = Number(R);
2350
+ if (!Number.isSafeInteger(pe))
2334
2351
  break;
2335
- const { cumulative: C } = s.prefixSum(Se, { materializeOption: { materialize: !1 } });
2336
- if (!Number.isFinite(C))
2352
+ const { cumulative: A } = s.prefixSum(pe, { materializeOption: { materialize: !1 } });
2353
+ if (!Number.isFinite(A))
2337
2354
  break;
2338
- const { index: v } = s.findIndexAtOrAfter(C - 0.5, { materializeOption: { materialize: !1 } }), W = v === -1 ? -1n : Dt(v);
2339
- if (W >= 0n && W < P)
2340
- P = W + 1n, M = 0;
2341
- else if (W === P && P >= 1n && i(Number(P - 1n)) > 0)
2342
- M = 0;
2355
+ const { index: v } = s.findIndexAtOrAfter(A - 0.5, { materializeOption: { materialize: !1 } }), K = v === -1 ? -1n : kt(v);
2356
+ if (K >= 0n && K < R)
2357
+ R = K + 1n, w = 0;
2358
+ else if (K === R && R >= 1n && i(Number(R - 1n)) > 0)
2359
+ w = 0;
2343
2360
  else
2344
2361
  break;
2345
2362
  }
2346
2363
  } else
2347
- M = 0;
2364
+ w = 0;
2348
2365
  }
2349
- h = b(P);
2350
- const Z = G(h);
2351
- H = Z.height, pe = Z.end;
2366
+ h = b(R);
2367
+ const j = U(h);
2368
+ D = j.height, le = j.end;
2352
2369
  }
2353
- const me = b(h), oe = b(pe), ce = b(me - BigInt(Math.max(0, t))), he = b(oe + BigInt(Math.max(0, t)));
2370
+ const ce = b(h), te = b(le), se = b(ce - BigInt(Math.max(0, t))), ue = b(te + BigInt(Math.max(0, t)));
2354
2371
  return {
2355
- renderingStartIndex: Pe(Number(ce), n),
2356
- renderingEndIndex: Pe(Number(he), n),
2357
- visibleStartIndex: Pe(Number(me), n),
2358
- visibleEndIndex: Pe(Number(oe), n)
2372
+ renderingStartIndex: ve(Number(se), n),
2373
+ renderingEndIndex: ve(Number(ue), n),
2374
+ visibleStartIndex: ve(Number(ce), n),
2375
+ visibleEndIndex: ve(Number(te), n)
2359
2376
  };
2360
- }, en = (r, e, t, n, i, s, a) => {
2377
+ }, fn = (r, e, t, n, i, s, a) => {
2361
2378
  if (n === 0)
2362
2379
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
2363
- const c = Number.isFinite(a), f = c ? Math.min(Math.max(0, r), a) : Math.max(0, r);
2380
+ const m = Number.isFinite(a), d = m ? Math.min(Math.max(0, r), a) : Math.max(0, r);
2364
2381
  if (n >= Number.MAX_SAFE_INTEGER)
2365
- return Qr(f, e, t, n, i, s, a, c);
2366
- const { index: b, cumulative: I, currentValue: w } = s.findIndexAtOrAfter(f, { materializeOption: { materialize: !1 } }), V = b === -1 ? e <= 0 || (I ?? 0) < f + (w ?? 0) ? n - 1 : 0 : b;
2367
- let h = Pe(V, n), z = 0;
2368
- if (b !== -1 && I === f)
2369
- h = Pe(b + 1, n), z = 0;
2370
- else if (h === b && I !== void 0 && w !== void 0)
2371
- z = I - w - f;
2382
+ return dn(d, e, t, n, i, s, a, m);
2383
+ const { index: b, cumulative: x, currentValue: T } = s.findIndexAtOrAfter(d, { materializeOption: { materialize: !1 } }), C = b === -1 ? e <= 0 || (x ?? 0) < d + (T ?? 0) ? n - 1 : 0 : b;
2384
+ let h = ve(C, n), L = 0;
2385
+ if (b !== -1 && x === d)
2386
+ h = ve(b + 1, n), L = 0;
2387
+ else if (h === b && x !== void 0 && T !== void 0)
2388
+ L = x - T - d;
2372
2389
  else {
2373
- const { cumulative: P, currentValue: _ } = s.prefixSum(h, { materializeOption: { materialize: !1 } });
2374
- z = (P ?? 0) - (_ ?? 0) - f;
2390
+ const { cumulative: R, currentValue: F } = s.prefixSum(h, { materializeOption: { materialize: !1 } });
2391
+ L = (R ?? 0) - (F ?? 0) - d;
2375
2392
  }
2376
- const G = z, H = (P, _) => {
2377
- let M = P, Z = _, Q = 0;
2378
- for (; M < n && Z < e; ) {
2379
- const U = i(M);
2380
- if (Z += U, M++, !Number.isFinite(U) || U < 0)
2393
+ const U = L, D = (R, F) => {
2394
+ let w = R, j = F, Z = 0;
2395
+ for (; w < n && j < e; ) {
2396
+ const W = i(w);
2397
+ if (j += W, w++, !Number.isFinite(W) || W < 0)
2381
2398
  break;
2382
- if (U === 0) {
2383
- if (Q++, Q > Yt) {
2384
- const { cumulative: Se } = s.prefixSum(M - 1, { materializeOption: { materialize: !1 } }), { index: C } = Number.isFinite(Se) ? s.findIndexAtOrAfter(Se + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2385
- if (C > M)
2386
- M = C, Q = 0;
2387
- else if (C === M && i(M) > 0)
2388
- Q = 0;
2399
+ if (W === 0) {
2400
+ if (Z++, Z > $t) {
2401
+ const { cumulative: pe } = s.prefixSum(w - 1, { materializeOption: { materialize: !1 } }), { index: A } = Number.isFinite(pe) ? s.findIndexAtOrAfter(pe + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2402
+ if (A > w)
2403
+ w = A, Z = 0;
2404
+ else if (A === w && i(w) > 0)
2405
+ Z = 0;
2389
2406
  else
2390
2407
  break;
2391
2408
  }
2392
2409
  } else
2393
- Q = 0;
2410
+ Z = 0;
2394
2411
  }
2395
- return { cursor: M, height: Z };
2396
- }, pe = H(h, z);
2397
- let me = pe.cursor;
2398
- if (z = pe.height, z < e && h > 0) {
2399
- let P = z + Math.abs(Math.min(0, G)), _ = h - 1, M = 0;
2400
- for (; _ >= 0 && P < e; ) {
2401
- const Q = i(_);
2402
- if (P += Q, !Number.isFinite(Q) || Q < 0) {
2403
- _--;
2412
+ return { cursor: w, height: j };
2413
+ }, le = D(h, L);
2414
+ let ce = le.cursor;
2415
+ if (L = le.height, L < e && h > 0) {
2416
+ let R = L + Math.abs(Math.min(0, U)), F = h - 1, w = 0;
2417
+ for (; F >= 0 && R < e; ) {
2418
+ const Z = i(F);
2419
+ if (R += Z, !Number.isFinite(Z) || Z < 0) {
2420
+ F--;
2404
2421
  break;
2405
2422
  }
2406
- if (Q === 0) {
2407
- if (M++, M > Yt) {
2408
- const { cumulative: U } = s.prefixSum(_, { materializeOption: { materialize: !1 } }), { index: Se } = Number.isFinite(U) ? s.findIndexAtOrAfter(U - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2409
- if (Se !== -1 && Se < _) {
2410
- _ = Se, M = 0;
2423
+ if (Z === 0) {
2424
+ if (w++, w > $t) {
2425
+ const { cumulative: W } = s.prefixSum(F, { materializeOption: { materialize: !1 } }), { index: pe } = Number.isFinite(W) ? s.findIndexAtOrAfter(W - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2426
+ if (pe !== -1 && pe < F) {
2427
+ F = pe, w = 0;
2411
2428
  continue;
2412
2429
  }
2413
- if (Se === _ && _ >= 1 && i(_ - 1) > 0)
2414
- M = 0;
2430
+ if (pe === F && F >= 1 && i(F - 1) > 0)
2431
+ w = 0;
2415
2432
  else {
2416
- _--;
2433
+ F--;
2417
2434
  break;
2418
2435
  }
2419
2436
  }
2420
2437
  } else
2421
- M = 0;
2422
- _--;
2438
+ w = 0;
2439
+ F--;
2423
2440
  }
2424
- h = Pe(_ + 1, n);
2425
- const Z = H(h, 0);
2426
- me = Z.cursor, z = Z.height;
2441
+ h = ve(F + 1, n);
2442
+ const j = D(h, 0);
2443
+ ce = j.cursor, L = j.height;
2427
2444
  }
2428
- const oe = Pe(h - t, n), ce = Pe(Math.max(me - 1, h), n), he = Pe(ce + t, n);
2429
- return { renderingStartIndex: oe, renderingEndIndex: he, visibleStartIndex: h, visibleEndIndex: ce };
2430
- }, ur = (r, e, t) => {
2445
+ const te = ve(h - t, n), se = ve(Math.max(ce - 1, h), n), ue = ve(se + t, n);
2446
+ return { renderingStartIndex: te, renderingEndIndex: ue, visibleStartIndex: h, visibleEndIndex: se };
2447
+ }, Ir = (r, e, t) => {
2431
2448
  const n = Math.max(0, e ?? 0), i = g({ last: 0, id: null, arg: null }).current;
2432
- return q(
2449
+ return X(
2433
2450
  () => () => {
2434
2451
  if (i.id !== null && (cancelAnimationFrame(i.id), i.id = null), i.arg !== null && r.current) {
2435
2452
  try {
@@ -2444,17 +2461,17 @@ const Gr = 1e4, ln = () => {
2444
2461
  ), S(
2445
2462
  (s) => {
2446
2463
  if (i.arg = s, i.id !== null) return;
2447
- const a = (c) => {
2464
+ const a = (m) => {
2448
2465
  if (i.id = null, i.arg === null) return;
2449
- const f = c - i.last;
2450
- if (n === 0 || i.last === 0 || f >= n) {
2466
+ const d = m - i.last;
2467
+ if (n === 0 || i.last === 0 || d >= n) {
2451
2468
  if (r.current)
2452
2469
  try {
2453
2470
  t(r.current, i.arg);
2454
2471
  } catch (b) {
2455
2472
  console.error("[useThrottledInvoker] Error invoking callback", b);
2456
2473
  }
2457
- i.arg = null, i.last = c;
2474
+ i.arg = null, i.last = m;
2458
2475
  }
2459
2476
  i.arg !== null && (i.id = requestAnimationFrame(a));
2460
2477
  };
@@ -2462,30 +2479,37 @@ const Gr = 1e4, ln = () => {
2462
2479
  },
2463
2480
  [n, t, r, i]
2464
2481
  );
2465
- }, tn = xr.memo(({ index: r, top: e, height: t, item: n, children: i, clipItemHeight: s, enableKeyboardNavigation: a, onKeyDown: c, onFocus: f, registerItemRef: b }) => {
2466
- const I = S((z) => b(r, z), [r, b]), w = S((z) => c(z, r), [r, c]), V = S(() => f(r), [r, f]), h = S((z) => {
2467
- z.currentTarget.focus({ preventScroll: !0 });
2482
+ }, mn = Nr.memo(({ index: r, top: e, height: t, item: n, children: i, clipItemHeight: s, enableKeyboardNavigation: a, onKeyDown: m, onEscapeKeyDown: d, onFocus: b, registerItemRef: x }) => {
2483
+ const T = S((D) => x(r, D), [r, x]), C = S((D) => m(D, r), [r, m]), h = S((D) => d?.(D, r), [r, d]), L = S(() => b(r), [r, b]), U = S((D) => {
2484
+ D.currentTarget.focus({ preventScroll: !0 });
2468
2485
  }, []);
2469
- return /* @__PURE__ */ de(
2470
- "div",
2471
- {
2472
- ref: I,
2473
- "data-index": r,
2474
- "data-virtualscroll-item": "true",
2475
- className: "aqvs-item-container",
2476
- style: {
2477
- top: e,
2478
- height: t,
2479
- overflow: s ? "hidden" : void 0
2480
- },
2481
- tabIndex: a ? -1 : void 0,
2482
- onPointerDown: a ? h : void 0,
2483
- onKeyDownCapture: a ? w : void 0,
2484
- onFocusCapture: a ? V : void 0,
2485
- children: i(n, r)
2486
- }
2486
+ return (
2487
+ // 行ラッパーの role は消費側の複合ウィジェット契約 (listbox / tree / grid — README「Composite widget
2488
+ // roles」) の所有物で、パッケージが既定 role を課すと衝突する。キー/フォーカス結線は
2489
+ // enableKeyboardNavigation の行ナビゲーション機構そのもの。
2490
+ // biome-ignore lint/a11y/noStaticElementInteractions: role は消費側の複合ウィジェット契約の所有物 (上記)
2491
+ /* @__PURE__ */ ne(
2492
+ "div",
2493
+ {
2494
+ ref: T,
2495
+ "data-index": r,
2496
+ "data-virtualscroll-item": "true",
2497
+ className: "aqvs-item-container",
2498
+ style: {
2499
+ top: e,
2500
+ height: t,
2501
+ overflow: s ? "hidden" : void 0
2502
+ },
2503
+ tabIndex: a ? -1 : void 0,
2504
+ onPointerDown: a ? U : void 0,
2505
+ onKeyDownCapture: a ? C : void 0,
2506
+ onKeyDown: a && d ? h : void 0,
2507
+ onFocusCapture: a ? L : void 0,
2508
+ children: i(n, r)
2509
+ }
2510
+ )
2487
2511
  );
2488
- }), rn = ({
2512
+ }), pn = ({
2489
2513
  itemCount: r,
2490
2514
  getItem: e,
2491
2515
  getItemKey: t,
@@ -2493,624 +2517,668 @@ const Gr = 1e4, ln = () => {
2493
2517
  viewportSize: i,
2494
2518
  overscanCount: s = 15,
2495
2519
  className: a,
2496
- testId: c,
2497
- onScroll: f,
2520
+ testId: m,
2521
+ onScroll: d,
2498
2522
  onRangeChange: b,
2499
- children: I,
2500
- background: w,
2501
- initialScrollIndex: V,
2523
+ children: x,
2524
+ background: T,
2525
+ initialScrollIndex: C,
2502
2526
  initialScrollOffset: h,
2503
- initialScrollAnchor: z,
2504
- callbackThrottleMs: G = 5,
2505
- contentInsets: H,
2506
- onItemFocus: pe,
2507
- scrollBarOptions: me,
2508
- behaviorOptions: oe,
2509
- onWheelHorizontal: ce,
2510
- horizontalKeyInputs: he,
2511
- horizontalKeyStep: P = Jr,
2512
- contentProps: _
2513
- }, M) => {
2514
- const { width: Z, enableThumbDrag: Q, enableTrackClick: U, enableArrowButtons: Se, enableScrollToTopBottomButtons: C, renderThumbOverlay: v, tapScrollCircleOptions: W } = me ?? {}, { enablePointerDrag: ge, pointerDragInputs: qe, enableKeyboardNavigation: ee = !0, wheelSpeedMultiplier: X, inertiaOptions: Xe, overscrollBehavior: $e, clipItemHeight: ze = !1, resetOnGetItemHeightChange: Ce = !1 } = oe ?? {}, [je, Ge] = rt(0), K = i ?? je, Ae = S((o) => {
2515
- Ge((u) => u === o ? u : o);
2516
- }, []), ue = g(null), be = g({
2527
+ initialScrollAnchor: L,
2528
+ callbackThrottleMs: U = 5,
2529
+ contentInsets: D,
2530
+ onItemFocus: le,
2531
+ scrollBarOptions: ce,
2532
+ behaviorOptions: te,
2533
+ onWheelHorizontal: se,
2534
+ horizontalKeyInputs: ue,
2535
+ horizontalKeyStep: R = un,
2536
+ contentProps: F,
2537
+ liveRegion: w
2538
+ }, j) => {
2539
+ const { width: Z, enableThumbDrag: W, enableTrackClick: pe, enableArrowButtons: A, enableScrollToTopBottomButtons: v, renderThumbOverlay: K, tapScrollCircleOptions: de } = ce ?? {}, { enablePointerDrag: qe, pointerDragInputs: Xe, enableKeyboardNavigation: V = !0, enableEscapeRowReturn: ke = !1, wheelSpeedMultiplier: $e, inertiaOptions: ze, overscrollBehavior: Fe, clipItemHeight: Ue = !1, resetOnGetItemHeightChange: De = !1 } = te ?? {}, [Me, Ve] = je(0), be = i ?? Me, Ie = S((o) => {
2540
+ Ve((c) => c === o ? c : o);
2541
+ }, []), G = g(null), Qe = g({
2517
2542
  renderingStartIndex: 0,
2518
2543
  renderingEndIndex: 0,
2519
2544
  visibleStartIndex: 0,
2520
2545
  visibleEndIndex: 0,
2521
2546
  scrollPosition: 0,
2522
2547
  totalHeight: 0
2523
- }), Te = g(z && r > 0 ? { index: le(Math.trunc(z.index), 0, r - 1), align: "top", offset: -Math.max(0, z.offsetPx ?? 0) } : null), et = g(!1), mt = g(!0);
2524
- q(() => {
2525
- if (mt.current) {
2526
- mt.current = !1;
2548
+ }), We = g(L && r > 0 ? { index: ie(Math.trunc(L.index), 0, r - 1), align: "top", offset: -Math.max(0, L.offsetPx ?? 0) } : null), dt = g(!1), it = g(!0);
2549
+ X(() => {
2550
+ if (it.current) {
2551
+ it.current = !1;
2527
2552
  return;
2528
2553
  }
2529
- Ce && (Te.current = null);
2530
- }, [Ce, n]);
2531
- const N = Fe(() => lr(H), [H]), [it] = rt(() => {
2532
- const u = z?.index ?? V, m = typeof u == "number" && Number.isFinite(u) ? Math.max(0, Math.trunc(u)) : 0;
2533
- return { from: Math.max(0, m - 50), to: m + 50 };
2534
- }), vt = Fe(
2554
+ De && (We.current = null);
2555
+ }, [De, n]);
2556
+ const E = _e(() => xr(D), [D]), [gt] = je(() => {
2557
+ const c = L?.index ?? C, u = typeof c == "number" && Number.isFinite(c) ? Math.max(0, Math.trunc(c)) : 0;
2558
+ return { from: Math.max(0, u - 50), to: u + 50 };
2559
+ }), re = _e(
2535
2560
  // 目的: Fenwick Tree のオプション設定
2536
2561
  // 依存関係: resetOnGetItemHeightChange, initialSampleRange (マウント時固定)
2537
2562
  // itemCount には依存させない (依存させると追記のたびに options 参照が変わり、計測済み高さが全消去される)。
2538
2563
  // この useMemo により sampleRange を毎レンダー新規生成しない = 参照同一性由来の破壊的 reset を防ぐ。
2539
2564
  () => ({
2540
- sampleRange: it,
2541
- resetOnValueFnChange: Ce,
2565
+ sampleRange: gt,
2566
+ resetOnValueFnChange: De,
2542
2567
  materialize: !0
2543
2568
  }),
2544
- [Ce, it]
2545
- ), E = Wr(r, n, vt), [J] = rt(() => {
2546
- let o = 0, u = 0;
2547
- if (z && r > 0) {
2548
- const m = le(Math.trunc(z.index), 0, r - 1), A = Math.max(0, z.offsetPx ?? 0), L = le(m - s * 2, 0, r - 1), O = le(m + s * 2, 0, r - 1), k = m > 0 || A > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: L, to: O }] } } : void 0, { cumulative: se, total: Ne, currentValue: Ie } = E.prefixSum(m, k), fe = Math.max(se - Ie + A, 0);
2549
- o = Pt(fe, N.top), u = Ne ?? E.getTotal();
2550
- } else if (typeof V == "number") {
2551
- const m = le(V, 0, r - 1), A = le(m - s * 2, 0, r - 1), L = le(m + s * 2, 0, r - 1), O = V > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: A, to: L }] } } : void 0, { cumulative: k, total: se, currentValue: Ne } = E.prefixSum(V, O), Ie = Math.max(k - Ne, 0);
2552
- o = Pt(Ie, N.top), u = se ?? E.getTotal();
2553
- } else typeof h == "number" && (o = Pt(Math.max(h, 0), N.top)), u = E.getTotal();
2554
- return { position: o, total: u };
2555
- }), [Ze, ht] = rt(J.position), [Le, st] = rt(J.total), ie = g(J.position), p = g(N.top), F = g(f ?? void 0), B = g(b ?? void 0), Y = g(ce), te = (he?.length ?? 0) > 0, Me = !!ce;
2556
- q(() => {
2557
- te && (ee || T.warn("[VirtualScroll] horizontalKeyInputs is set but behaviorOptions.enableKeyboardNavigation is false; horizontal keyboard scrolling is disabled because the row key handler is not mounted."), Me || T.warn("[VirtualScroll] horizontalKeyInputs is set but onWheelHorizontal is missing; horizontal keyboard scrolling is disabled because the package does not own the horizontal axis."), Number.isFinite(P) && P > 0 || T.warn(`[VirtualScroll] horizontalKeyStep must be a finite positive number, received ${P}. Horizontal arrow keys are left untouched.`));
2558
- }, [te, Me, ee, P]);
2559
- const j = g(/* @__PURE__ */ new Map()), re = g(null), De = g(null), [ne, Je] = rt(null), [Oe, ae] = rt(!1), ve = g(null), Ue = g(!1), Ve = g(0), ft = g(!1), Qe = g(!1), ot = g(r);
2560
- ot.current !== r && (ot.current = r, Qe.current = !0), nt(() => {
2561
- F.current = f ?? void 0, B.current = b ?? void 0, Y.current = ce;
2562
- }, [b, f, ce]);
2563
- const d = S(
2569
+ [De, gt]
2570
+ ), N = sn(r, n, re), [st] = je(() => {
2571
+ let o = 0, c = 0;
2572
+ if (L && r > 0) {
2573
+ const u = ie(Math.trunc(L.index), 0, r - 1), O = Math.max(0, L.offsetPx ?? 0), _ = ie(u - s * 2, 0, r - 1), k = ie(u + s * 2, 0, r - 1), Y = u > 0 || O > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: _, to: k }] } } : void 0, { cumulative: ee, total: Te, currentValue: me } = N.prefixSum(u, Y), ae = Math.max(ee - me + O, 0);
2574
+ o = Mt(ae, E.top), c = Te ?? N.getTotal();
2575
+ } else if (typeof C == "number") {
2576
+ const u = ie(C, 0, r - 1), O = ie(u - s * 2, 0, r - 1), _ = ie(u + s * 2, 0, r - 1), k = C > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: O, to: _ }] } } : void 0, { cumulative: Y, total: ee, currentValue: Te } = N.prefixSum(C, k), me = Math.max(Y - Te, 0);
2577
+ o = Mt(me, E.top), c = ee ?? N.getTotal();
2578
+ } else typeof h == "number" && (o = Mt(Math.max(h, 0), E.top)), c = N.getTotal();
2579
+ return { position: o, total: c };
2580
+ }), [Ke, ft] = je(st.position), [Ae, f] = je(st.total), P = g(st.position), q = g(E.top), B = g(d ?? void 0), Q = g(b ?? void 0), Se = g(se), J = (ue?.length ?? 0) > 0, xe = !!se;
2581
+ X(() => {
2582
+ J && (V || y.warn("[VirtualScroll] horizontalKeyInputs is set but behaviorOptions.enableKeyboardNavigation is false; horizontal keyboard scrolling is disabled because the row key handler is not mounted."), xe || y.warn("[VirtualScroll] horizontalKeyInputs is set but onWheelHorizontal is missing; horizontal keyboard scrolling is disabled because the package does not own the horizontal axis."), Number.isFinite(R) && R > 0 || y.warn(`[VirtualScroll] horizontalKeyStep must be a finite positive number, received ${R}. Horizontal arrow keys are left untouched.`));
2583
+ }, [J, xe, V, R]);
2584
+ const Pe = g(/* @__PURE__ */ new Map()), $ = g(null), ye = g(null), [Ce, fe] = je(null), [Re, Je] = je(!1), Le = g(null), ot = g(!1), we = g(0), et = g(!1), p = g(!1), M = g(r);
2585
+ M.current !== r && (M.current = r, p.current = !0), Ze(() => {
2586
+ B.current = d ?? void 0, Q.current = b ?? void 0, Se.current = se;
2587
+ }, [b, d, se]);
2588
+ const oe = S(
2564
2589
  (o) => {
2565
- if (ee && o && typeof o.focus == "function")
2590
+ if (V && o && typeof o.focus == "function")
2566
2591
  try {
2567
2592
  o.focus({ preventScroll: !0 });
2568
2593
  } catch {
2569
2594
  o.focus();
2570
2595
  }
2571
2596
  },
2572
- [ee]
2573
- ), y = S((o, { position: u, totalHeight: m }) => {
2574
- o(u, m);
2575
- }, []), xe = ur(F, G, y), tt = S((o, u) => {
2576
- o(u);
2577
- }, []), _e = ur(B, G, tt), ct = g(N.top);
2578
- ct.current = N.top;
2579
- const ut = g(xe);
2580
- ut.current = xe, q(() => (et.current = !1, () => {
2581
- et.current = !0, ve.current && (clearTimeout(ve.current), ve.current = null);
2582
- }), []), q(() => {
2583
- ee || (j.current.clear(), re.current = null, De.current = null);
2584
- }, [ee]);
2585
- const at = S(
2586
- (o, u) => {
2587
- if (!u) {
2588
- j.current.delete(o);
2597
+ [V]
2598
+ ), tt = S((o, { position: c, totalHeight: u }) => {
2599
+ o(c, u);
2600
+ }, []), Ee = Ir(B, U, tt), Vt = S((o, c) => {
2601
+ o(c);
2602
+ }, []), lt = Ir(Q, U, Vt), Ye = g(E.top);
2603
+ Ye.current = E.top;
2604
+ const bt = g(Ee);
2605
+ bt.current = Ee, X(() => (dt.current = !1, () => {
2606
+ dt.current = !0, Le.current && (clearTimeout(Le.current), Le.current = null);
2607
+ }), []), X(() => {
2608
+ V || (Pe.current.clear(), $.current = null, ye.current = null);
2609
+ }, [V]);
2610
+ const Pt = S(
2611
+ (o, c) => {
2612
+ if (!c) {
2613
+ Pe.current.delete(o);
2589
2614
  return;
2590
2615
  }
2591
- ee && (j.current.set(o, u), re.current === o && (re.current = null, De.current = o, d(u)));
2616
+ V && (Pe.current.set(o, c), $.current === o && ($.current = null, ye.current = o, oe(c)));
2592
2617
  },
2593
- [ee, d]
2594
- ), gt = 0.01, pt = g({
2618
+ [V, oe]
2619
+ ), Ft = 0.01, ct = g({
2595
2620
  rafId: null,
2596
2621
  loopActive: !1,
2597
2622
  idleFrames: 0,
2598
- lastRenderedPosition: J.position
2623
+ lastRenderedPosition: st.position
2599
2624
  }), yt = S(() => {
2600
- const o = pt.current;
2625
+ const o = ct.current;
2601
2626
  o.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(o.rafId), o.rafId = null, o.loopActive = !1, o.idleFrames = 0;
2602
2627
  }, []);
2603
- q(
2628
+ X(
2604
2629
  () => () => {
2605
2630
  yt();
2606
2631
  },
2607
2632
  [yt]
2608
2633
  );
2609
- const wt = g(() => {
2610
- }), Nt = S(() => {
2611
- const o = pt.current;
2634
+ const Yt = g(() => {
2635
+ }), Ct = S(() => {
2636
+ const o = ct.current;
2612
2637
  o.rafId = null;
2613
- const u = ie.current, m = Ke(u, ct.current), A = E.getTotal();
2614
- if (ht((O) => Math.abs(O - u) < gt ? O : u), Math.abs(o.lastRenderedPosition - u) >= gt ? (ut.current({ position: m, totalHeight: A }), o.lastRenderedPosition = u, o.idleFrames = 0) : o.idleFrames += 1, o.idleFrames >= 2) {
2638
+ const c = P.current, u = Ge(c, Ye.current), O = N.getTotal();
2639
+ if (ft((k) => Math.abs(k - c) < Ft ? k : c), Math.abs(o.lastRenderedPosition - c) >= Ft ? (bt.current({ position: u, totalHeight: O }), o.lastRenderedPosition = c, o.idleFrames = 0) : o.idleFrames += 1, o.idleFrames >= 2) {
2615
2640
  yt();
2616
2641
  return;
2617
2642
  }
2618
2643
  if (typeof requestAnimationFrame == "function") {
2619
- o.rafId = requestAnimationFrame((O) => wt.current(O));
2644
+ o.rafId = requestAnimationFrame((k) => Yt.current(k));
2620
2645
  return;
2621
2646
  }
2622
2647
  o.loopActive = !1;
2623
- }, [E, yt]);
2624
- wt.current = Nt;
2625
- const At = S(() => {
2626
- const o = pt.current;
2648
+ }, [N, yt]);
2649
+ Yt.current = Ct;
2650
+ const Bt = S(() => {
2651
+ const o = ct.current;
2627
2652
  if (o.idleFrames = 0, !o.loopActive) {
2628
2653
  if (o.loopActive = !0, typeof requestAnimationFrame == "function") {
2629
- o.rafId = requestAnimationFrame(Nt);
2654
+ o.rafId = requestAnimationFrame(Ct);
2630
2655
  return;
2631
2656
  }
2632
2657
  o.loopActive = !1;
2633
2658
  }
2634
- }, [Nt]), we = S(
2635
- (o, u) => {
2636
- const m = u?.immediate ?? !1, A = Ke(o, N.top);
2637
- if (ie.current = o, m) {
2638
- pt.current.lastRenderedPosition = o, pt.current.idleFrames = 0, ht(o), xe({ position: A, totalHeight: E.getTotal() });
2659
+ }, [Ct]), he = S(
2660
+ (o, c) => {
2661
+ const u = c?.immediate ?? !1, O = Ge(o, E.top);
2662
+ if (P.current = o, u) {
2663
+ ct.current.lastRenderedPosition = o, ct.current.idleFrames = 0, ft(o), Ee({ position: O, totalHeight: N.getTotal() });
2639
2664
  return;
2640
2665
  }
2641
- At();
2666
+ Bt();
2642
2667
  },
2643
- [At, E, N.top, xe]
2644
- ), bt = S((o, u = 0) => {
2645
- const m = ue.current;
2646
- if (!m)
2668
+ [Bt, N, E.top, Ee]
2669
+ ), xt = S((o, c = 0) => {
2670
+ const u = G.current;
2671
+ if (!u)
2647
2672
  return o;
2648
- const A = m.getScrollPosition();
2649
- Ve.current += 1;
2650
- const L = m.getContentSize() + u, O = m.getViewportSize(), k = m.scrollTo(o, { contentSize: L, viewportSize: O });
2651
- return k === A && (Ve.current = Math.max(0, Ve.current - 1)), Math.abs(k - o) > 0.5 && (ft.current = !0), k;
2652
- }, []), Lt = g(!1);
2653
- q(() => {
2654
- if (!Lt.current)
2655
- if (Lt.current = !0, z == null && typeof V != "number" && typeof h == "number") {
2656
- const o = Pt(Math.max(h, 0), N.top), u = Math.abs(o - ie.current) > 0.5;
2657
- we(o, { immediate: !0 }), u && ue.current?.scrollTo(o);
2673
+ const O = u.getScrollPosition();
2674
+ we.current += 1;
2675
+ const _ = u.getContentSize() + c, k = u.getViewportSize(), Y = u.scrollTo(o, { contentSize: _, viewportSize: k });
2676
+ return Y === O && (we.current = Math.max(0, we.current - 1)), Math.abs(Y - o) > 0.5 && (et.current = !0), Y;
2677
+ }, []), Dt = g(!1);
2678
+ X(() => {
2679
+ if (!Dt.current)
2680
+ if (Dt.current = !0, L == null && typeof C != "number" && typeof h == "number") {
2681
+ const o = Mt(Math.max(h, 0), E.top), c = Math.abs(o - P.current) > 0.5;
2682
+ he(o, { immediate: !0 }), c && G.current?.scrollTo(o);
2658
2683
  } else
2659
- we(ie.current, { immediate: !0 });
2660
- }, [z, V, h, N.top, we]), q(() => {
2661
- const o = E.getTotal();
2662
- if (Le !== o) {
2663
- st(o);
2684
+ he(P.current, { immediate: !0 });
2685
+ }, [L, C, h, E.top, he]), X(() => {
2686
+ const o = N.getTotal();
2687
+ if (Ae !== o) {
2688
+ f(o);
2664
2689
  return;
2665
2690
  }
2666
- if (ft.current) {
2667
- ft.current = !1;
2668
- const u = ue.current;
2669
- if (u && Math.abs(u.getScrollPosition() - ie.current) > 0.5) {
2670
- const m = bt(ie.current);
2671
- ft.current = !1, we(m, { immediate: !0 });
2691
+ if (et.current) {
2692
+ et.current = !1;
2693
+ const c = G.current;
2694
+ if (c && Math.abs(c.getScrollPosition() - P.current) > 0.5) {
2695
+ const u = xt(P.current);
2696
+ et.current = !1, he(u, { immediate: !0 });
2672
2697
  }
2673
2698
  }
2674
- }, [E, Le, r, bt, we]), q(() => {
2675
- if (Te.current !== null) {
2676
- const { index: o, align: u, offset: m } = Te.current, A = Pe(o, r), { cumulative: L, currentValue: O } = E.prefixSum(A, { materializeOption: { materialize: !1 } });
2677
- if (L !== void 0 && O !== void 0) {
2678
- const k = Math.max(L - O, 0);
2679
- let se = k;
2680
- u === "bottom" ? se = L - K : u === "center" && (se = k + O / 2 - K / 2), m && (se -= m), se = Math.max(0, se);
2681
- const Ne = Math.max(0, Le + N.top + N.bottom - K), Ie = Math.min(Pt(se, N.top), Ne);
2682
- Math.abs(Ie - ie.current) > 1 && (T.debug("[VirtualScroll] Drift correction", {
2683
- from: ie.current,
2684
- to: Ie,
2685
- targetIndex: A
2686
- }), Ve.current === 0 && (Ve.current += 1), ue.current?.scrollTo(Ie), we(Ie, { immediate: !0 }));
2699
+ }, [N, Ae, r, xt, he]), X(() => {
2700
+ if (We.current !== null) {
2701
+ const { index: o, align: c, offset: u } = We.current, O = ve(o, r), { cumulative: _, currentValue: k } = N.prefixSum(O, { materializeOption: { materialize: !1 } });
2702
+ if (_ !== void 0 && k !== void 0) {
2703
+ const Y = Math.max(_ - k, 0);
2704
+ let ee = Y;
2705
+ c === "bottom" ? ee = _ - be : c === "center" && (ee = Y + k / 2 - be / 2), u && (ee -= u), ee = Math.max(0, ee);
2706
+ const Te = Math.max(0, Ae + E.top + E.bottom - be), me = Math.min(Mt(ee, E.top), Te);
2707
+ Math.abs(me - P.current) > 1 && (y.debug("[VirtualScroll] Drift correction", {
2708
+ from: P.current,
2709
+ to: me,
2710
+ targetIndex: O
2711
+ }), we.current === 0 && (we.current += 1), G.current?.scrollTo(me), he(me, { immediate: !0 }));
2687
2712
  }
2688
2713
  }
2689
- Qe.current = !1;
2690
- }, [Le, E, r, N.top, we, K, N.bottom]), q(() => {
2691
- const o = p.current;
2692
- if (o === N.top || (p.current = N.top, Te.current))
2714
+ p.current = !1;
2715
+ }, [Ae, N, r, E.top, he, be, E.bottom]), X(() => {
2716
+ const o = q.current;
2717
+ if (o === E.top || (q.current = E.top, We.current))
2693
2718
  return;
2694
- const u = Ke(ie.current, o), m = Pt(u, N.top);
2695
- ie.current = m, ue.current?.scrollTo(m), we(m, { immediate: !0 });
2696
- }, [N.top, we]);
2697
- const Ot = S(
2698
- (o, u) => {
2719
+ const c = Ge(P.current, o), u = Mt(c, E.top);
2720
+ P.current = u, G.current?.scrollTo(u), he(u, { immediate: !0 });
2721
+ }, [E.top, he]);
2722
+ const At = S(
2723
+ (o, c) => {
2699
2724
  if (r === 0)
2700
2725
  return;
2701
- const m = Pe(o, r), A = E.get(m), L = u - A, O = E.update(m, u);
2702
- O !== void 0 && st(O), T.debug("[VirtualScroll] Updated item size manually", { index: m, size: u, total: O });
2703
- let k = Te.current ? Te.current.index : null;
2704
- if (k === null) {
2705
- const se = ie.current, Ne = lr(H).top, Ie = Ke(se, Ne), { index: fe, cumulative: Be } = E.findIndexAtOrAfter(Ie, { materializeOption: { materialize: !1 } });
2706
- k = Be !== void 0 && Be === Ie ? fe + 1 : fe;
2726
+ const u = ve(o, r), O = N.get(u), _ = c - O, k = N.update(u, c);
2727
+ k !== void 0 && f(k), y.debug("[VirtualScroll] Updated item size manually", { index: u, size: c, total: k });
2728
+ let Y = We.current ? We.current.index : null;
2729
+ if (Y === null) {
2730
+ const ee = P.current, Te = xr(D).top, me = Ge(ee, Te), { index: ae, cumulative: Be } = N.findIndexAtOrAfter(me, { materializeOption: { materialize: !1 } });
2731
+ Y = Be !== void 0 && Be === me ? ae + 1 : ae;
2707
2732
  }
2708
- if (k !== -1 && m < k && L !== 0) {
2709
- const se = ie.current, Ne = se + L;
2710
- bt(Ne, L), we(Ne, { immediate: !0 }), T.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: se, to: Ne, causedByIndex: m, delta: L, activeVisibleStartIndex: k });
2733
+ if (Y !== -1 && u < Y && _ !== 0) {
2734
+ const ee = P.current, Te = ee + _;
2735
+ xt(Te, _), he(Te, { immediate: !0 }), y.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: ee, to: Te, causedByIndex: u, delta: _, activeVisibleStartIndex: Y });
2711
2736
  }
2712
2737
  },
2713
- [E, r, bt, we, H]
2714
- ), We = S(
2715
- (o, u) => {
2716
- if (!ue.current || r === 0)
2738
+ [N, r, xt, he, D]
2739
+ ), l = S(
2740
+ (o, c) => {
2741
+ if (!G.current || r === 0)
2717
2742
  return;
2718
- const m = Pe(o, r), A = Pe(m - s * 2, r), L = Pe(m + s * 2, r), { cumulative: O, total: k, currentValue: se } = E.prefixSum(m, { materializeOption: { materialize: !0, ranges: [{ from: A, to: L }] } });
2719
- if (T.debug("[VirtualScroll] Scrolling to index:", m, "ItemBottom:", O, "Total height:", k, "ItemHeight:", se, "safeIndexFrom:", A, "safeIndexTo:", L), !k)
2743
+ const u = ve(o, r), O = ve(u - s * 2, r), _ = ve(u + s * 2, r), { cumulative: k, total: Y, currentValue: ee } = N.prefixSum(u, { materializeOption: { materialize: !0, ranges: [{ from: O, to: _ }] } });
2744
+ if (y.debug("[VirtualScroll] Scrolling to index:", u, "ItemBottom:", k, "Total height:", Y, "ItemHeight:", ee, "safeIndexFrom:", O, "safeIndexTo:", _), !Y)
2720
2745
  return;
2721
- const Ne = Math.max(O - se, 0);
2722
- let Ie = Ne;
2723
- u?.align === "bottom" ? Ie = O - K : u?.align === "center" && (Ie = Ne + se / 2 - K / 2), u?.offset && (Ie -= u.offset), Ie = Math.max(0, Ie);
2724
- const fe = Pt(Ie, N.top), Be = ue.current?.getContentSize() ?? k + N.top + N.bottom, ke = Math.max(0, Be - K), He = Math.min(fe, ke);
2725
- Te.current = {
2726
- index: m,
2727
- align: u?.align,
2728
- offset: u?.offset
2746
+ const Te = Math.max(k - ee, 0);
2747
+ let me = Te;
2748
+ c?.align === "bottom" ? me = k - be : c?.align === "center" && (me = Te + ee / 2 - be / 2), c?.offset && (me -= c.offset), me = Math.max(0, me);
2749
+ const ae = Mt(me, E.top), Be = G.current?.getContentSize() ?? Y + E.top + E.bottom, Oe = Math.max(0, Be - be), He = Math.min(ae, Oe);
2750
+ We.current = {
2751
+ index: u,
2752
+ align: c?.align,
2753
+ offset: c?.offset
2729
2754
  };
2730
- const zt = ue.current?.getScrollPosition() ?? -1, Xt = Math.abs(zt - He) > 0.5;
2731
- Ue.current = !1, Ve.current = 0, Xt && (Ue.current = !0, Ve.current += 1, ue.current?.scrollTo(He)), st(k), we(He, { immediate: !0 }), T.debug("[VirtualScroll] Setting scroll position to:", He, { original: fe, max: ke });
2755
+ const Ot = G.current?.getScrollPosition() ?? -1, Gt = Math.abs(Ot - He) > 0.5;
2756
+ ot.current = !1, we.current = 0, Gt && (ot.current = !0, we.current += 1, G.current?.scrollTo(He)), f(Y), he(He, { immediate: !0 }), y.debug("[VirtualScroll] Setting scroll position to:", He, { original: ae, max: Oe });
2732
2757
  },
2733
- [E, s, r, N.top, N.bottom, K, we]
2734
- ), Vt = g(z && r === 0 ? z : null);
2735
- q(() => {
2736
- const o = Vt.current;
2737
- !o || r === 0 || (Vt.current = null, We(le(Math.trunc(o.index), 0, r - 1), { align: "top", offset: -Math.max(0, o.offsetPx ?? 0) }));
2738
- }, [r, We]);
2739
- const l = S(
2758
+ [N, s, r, E.top, E.bottom, be, he]
2759
+ ), I = g(L && r === 0 ? L : null);
2760
+ X(() => {
2761
+ const o = I.current;
2762
+ !o || r === 0 || (I.current = null, l(ie(Math.trunc(o.index), 0, r - 1), { align: "top", offset: -Math.max(0, o.offsetPx ?? 0) }));
2763
+ }, [r, l]);
2764
+ const z = S(
2740
2765
  (o) => {
2741
- if (!ue.current || r === 0)
2766
+ if (!G.current || r === 0)
2742
2767
  return;
2743
- const u = E.getTotal(), m = le(Math.floor(o), 0, u), { index: A, cumulative: L, currentValue: O } = E.findIndexAtOrAfter(m, { materializeOption: { materialize: !1 } }), se = (L ?? 0) - (O ?? 0) - m;
2744
- We(A, { offset: se });
2768
+ const c = N.getTotal(), u = ie(Math.floor(o), 0, c), { index: O, cumulative: _, currentValue: k } = N.findIndexAtOrAfter(u, { materializeOption: { materialize: !1 } }), ee = (_ ?? 0) - (k ?? 0) - u;
2769
+ l(O, { offset: ee });
2745
2770
  },
2746
- [E, r, We]
2747
- ), x = S(() => {
2771
+ [N, r, l]
2772
+ ), H = S(() => {
2748
2773
  if (r === 0)
2749
2774
  return null;
2750
- const o = Ke(ie.current, N.top), { index: u, cumulative: m, currentValue: A } = E.findIndexAtOrAfter(o, { materializeOption: { materialize: !1 } });
2751
- if (u === -1)
2775
+ const o = Ge(P.current, E.top), { index: c, cumulative: u, currentValue: O } = N.findIndexAtOrAfter(o, { materializeOption: { materialize: !1 } });
2776
+ if (c === -1)
2752
2777
  return { index: r - 1, offsetPx: 0 };
2753
- if (m === o)
2754
- return { index: le(u + 1, 0, r - 1), offsetPx: 0 };
2755
- const L = (m ?? 0) - (A ?? 0);
2756
- return { index: u, offsetPx: Math.max(0, o - L) };
2757
- }, [E, r, N.top]), R = S(
2778
+ if (u === o)
2779
+ return { index: ie(c + 1, 0, r - 1), offsetPx: 0 };
2780
+ const _ = (u ?? 0) - (O ?? 0);
2781
+ return { index: c, offsetPx: Math.max(0, o - _) };
2782
+ }, [N, r, E.top]), ge = S(
2758
2783
  (o) => {
2759
- const u = Ke(ie.current, N.top), m = typeof o == "function" ? o(u) : o;
2760
- l(m);
2761
- const A = ue.current?.getScrollPosition(), L = typeof A == "number" ? A : ie.current;
2762
- return we(L), Ke(L, ct.current);
2784
+ const c = Ge(P.current, E.top), u = typeof o == "function" ? o(c) : o;
2785
+ z(u);
2786
+ const O = G.current?.getScrollPosition(), _ = typeof O == "number" ? O : P.current;
2787
+ return he(_), Ge(_, Ye.current);
2763
2788
  },
2764
- [N.top, l, we]
2765
- ), D = S((o) => {
2766
- const u = ue.current;
2767
- if (!u)
2768
- return Ke(ie.current, ct.current);
2769
- const m = u.scrollTo((A) => A + o);
2770
- return Ke(m, ct.current);
2771
- }, []), $ = S((o) => ue.current?.applyWheel(o) ?? !1, []), ye = S(
2772
- (o, u) => {
2773
- T.debug("[VirtualScroll] Scroll position changed:", o);
2774
- const m = Ue.current;
2775
- m && (Ue.current = !1);
2776
- const A = Ve.current > 0;
2777
- A && (Ve.current = 0);
2778
- const L = Qe.current && ot.current === r;
2779
- if (m || A || L || (Te.current = null), we(o), C) {
2780
- if (m || A)
2789
+ [E.top, z, he]
2790
+ ), Ne = S((o) => {
2791
+ const c = G.current;
2792
+ if (!c)
2793
+ return Ge(P.current, Ye.current);
2794
+ const u = c.scrollTo((O) => O + o);
2795
+ return Ge(u, Ye.current);
2796
+ }, []), rt = S((o) => G.current?.applyWheel(o) ?? !1, []), nt = S(
2797
+ (o, c) => {
2798
+ y.debug("[VirtualScroll] Scroll position changed:", o);
2799
+ const u = ot.current;
2800
+ u && (ot.current = !1);
2801
+ const O = we.current > 0;
2802
+ O && (we.current = 0);
2803
+ const _ = p.current && M.current === r;
2804
+ if (u || O || _ || (We.current = null), he(o), v) {
2805
+ if (u || O)
2781
2806
  return;
2782
- const O = o - u;
2783
- if (T.debug("[VirtualScroll] Scroll diff:", O, "New:", o, "Prev:", u), Math.abs(O) > 1) {
2784
- const k = O > 0 ? "down" : "up";
2785
- Je(k), ae(!0), T.debug("[VirtualScroll] Showing scroll buttons. Direction:", k), ve.current && clearTimeout(ve.current), ve.current = setTimeout(() => {
2786
- ae(!1), T.debug("[VirtualScroll] Hiding scroll buttons");
2807
+ const k = o - c;
2808
+ if (y.debug("[VirtualScroll] Scroll diff:", k, "New:", o, "Prev:", c), Math.abs(k) > 1) {
2809
+ const Y = k > 0 ? "down" : "up";
2810
+ fe(Y), Je(!0), y.debug("[VirtualScroll] Showing scroll buttons. Direction:", Y), Le.current && clearTimeout(Le.current), Le.current = setTimeout(() => {
2811
+ Je(!1), y.debug("[VirtualScroll] Hiding scroll buttons");
2787
2812
  }, 2e3);
2788
2813
  }
2789
2814
  }
2790
2815
  },
2791
- [we, C, r]
2792
- ), Re = Fe(() => Ke(Ze, N.top), [N.top, Ze]), Ee = Fe(() => {
2793
- const o = E.getTotal(), u = en(Re, K, s, r, n, E, o);
2794
- return T.debug("[VirtualScroll] Calculated rendering range:", () => ({
2795
- ...u,
2796
- scrollPosition: Re,
2816
+ [he, v, r]
2817
+ ), mt = _e(() => Ge(Ke, E.top), [E.top, Ke]), at = _e(() => {
2818
+ const o = N.getTotal(), c = fn(mt, be, s, r, n, N, o);
2819
+ return y.debug("[VirtualScroll] Calculated rendering range:", () => ({
2820
+ ...c,
2821
+ scrollPosition: mt,
2797
2822
  renderingContentSize: o,
2798
2823
  overscanCount: s,
2799
- viewportSize: K
2800
- })), u;
2801
- }, [Re, K, s, r, n, E]), { renderingStartIndex: lt, renderingEndIndex: Ye, visibleStartIndex: xt, visibleEndIndex: _t } = Ee, Tt = S(
2802
- (o, u) => {
2803
- if (!ee || r === 0)
2824
+ viewportSize: be
2825
+ })), c;
2826
+ }, [mt, be, s, r, n, N]), { renderingStartIndex: pt, renderingEndIndex: wt, visibleStartIndex: vt, visibleEndIndex: Rt } = at, ht = S(
2827
+ (o, c) => {
2828
+ if (!V || r === 0)
2804
2829
  return;
2805
- const m = Pe(o, r);
2806
- if (!(u?.ensureVisible ?? !0)) {
2807
- const ke = j.current.get(m);
2808
- ke && (re.current = null, De.current = m, d(ke));
2830
+ const u = ve(o, r);
2831
+ if (!(c?.ensureVisible ?? !0)) {
2832
+ const Oe = Pe.current.get(u);
2833
+ Oe && ($.current = null, ye.current = u, oe(Oe));
2809
2834
  return;
2810
2835
  }
2811
- const L = E.prefixSum(m, { materializeOption: { materialize: !1 } }), O = L.currentValue, k = Math.max(L.cumulative - O, 0), se = k + O, Ne = Ke(ie.current, N.top), Ie = Ne + K;
2812
- if (k < Ne || se > Ie) {
2813
- We(m);
2814
- const ke = j.current.get(m);
2815
- ke ? (re.current = null, De.current = m, d(ke)) : re.current = m;
2836
+ const _ = N.prefixSum(u, { materializeOption: { materialize: !1 } }), k = _.currentValue, Y = Math.max(_.cumulative - k, 0), ee = Y + k, Te = Ge(P.current, E.top), me = Te + be;
2837
+ if (Y < Te || ee > me) {
2838
+ l(u);
2839
+ const Oe = Pe.current.get(u);
2840
+ Oe ? ($.current = null, ye.current = u, oe(Oe)) : $.current = u;
2816
2841
  return;
2817
2842
  }
2818
- const Be = j.current.get(m);
2843
+ const Be = Pe.current.get(u);
2819
2844
  if (Be) {
2820
- re.current = null, De.current = m, d(Be);
2845
+ $.current = null, ye.current = u, oe(Be);
2821
2846
  return;
2822
2847
  }
2823
- re.current = m;
2848
+ $.current = u;
2824
2849
  },
2825
- [ee, r, E, N.top, We, d, K]
2826
- ), Qt = S(
2827
- (o, u) => {
2828
- if (!(!ee || o.defaultPrevented) && !(o.altKey || o.metaKey || o.ctrlKey) && o.target === o.currentTarget && !o.currentTarget.isContentEditable) {
2850
+ [V, r, N, E.top, l, oe, be]
2851
+ ), sr = S(
2852
+ (o, c) => {
2853
+ if (!(!V || o.defaultPrevented) && !(o.altKey || o.metaKey || o.ctrlKey) && o.target === o.currentTarget && !o.currentTarget.isContentEditable) {
2829
2854
  if (o.key === "ArrowLeft" || o.key === "ArrowRight") {
2830
- const m = Y.current;
2831
- if (!m || o.shiftKey || !he?.includes("arrow") || !(Number.isFinite(P) && P > 0))
2855
+ const u = Se.current;
2856
+ if (!u || o.shiftKey || !ue?.includes("arrow") || !(Number.isFinite(R) && R > 0))
2832
2857
  return;
2833
- o.preventDefault(), m(o.key === "ArrowLeft" ? -P : P);
2858
+ o.preventDefault(), u(o.key === "ArrowLeft" ? -R : R);
2834
2859
  return;
2835
2860
  }
2836
2861
  if (o.key === "ArrowDown") {
2837
- u < r - 1 && (o.preventDefault(), Tt(u + 1));
2862
+ c < r - 1 && (o.preventDefault(), ht(c + 1));
2838
2863
  return;
2839
2864
  }
2840
2865
  if (o.key === "ArrowUp") {
2841
- u > 0 && (o.preventDefault(), Tt(u - 1));
2866
+ c > 0 && (o.preventDefault(), ht(c - 1));
2842
2867
  return;
2843
2868
  }
2844
2869
  if (o.key === "PageDown") {
2845
- if (u < r - 1) {
2870
+ if (c < r - 1) {
2846
2871
  o.preventDefault();
2847
- const { visibleStartIndex: m, visibleEndIndex: A } = be.current, L = Math.max(A - m + 1, 1), O = Math.max(L, 1), k = Pe(Math.min(u + O, r - 1), r);
2848
- Tt(k);
2872
+ const { visibleStartIndex: u, visibleEndIndex: O } = Qe.current, _ = Math.max(O - u + 1, 1), k = Math.max(_, 1), Y = ve(Math.min(c + k, r - 1), r);
2873
+ ht(Y);
2849
2874
  }
2850
2875
  return;
2851
2876
  }
2852
- if (o.key === "PageUp" && u > 0) {
2877
+ if (o.key === "PageUp" && c > 0) {
2853
2878
  o.preventDefault();
2854
- const { visibleStartIndex: m, visibleEndIndex: A } = be.current, L = Math.max(A - m + 1, 1), O = Math.max(L, 1), k = Pe(u - O, r);
2855
- Tt(k);
2879
+ const { visibleStartIndex: u, visibleEndIndex: O } = Qe.current, _ = Math.max(O - u + 1, 1), k = Math.max(_, 1), Y = ve(c - k, r);
2880
+ ht(Y);
2856
2881
  }
2857
2882
  }
2858
2883
  },
2859
- [ee, r, Tt, he, P]
2860
- ), er = S(
2884
+ [V, r, ht, ue, R]
2885
+ ), or = S(
2886
+ /**
2887
+ * Returns focus from an element inside the row back to the row wrapper on Escape.
2888
+ * 行内要素の Escape で行ラッパーへフォーカスを戻す処理。
2889
+ *
2890
+ * @param event - Keyboard event (bubble phase on the row wrapper) / 行ラッパー bubble フェーズのキーイベント
2891
+ * @param index - Row index / 行インデックス
2892
+ */
2893
+ (o, c) => {
2894
+ if (o.key !== "Escape" || o.defaultPrevented || o.nativeEvent.isComposing || o.target === o.currentTarget)
2895
+ return;
2896
+ const u = o.target;
2897
+ u instanceof HTMLInputElement || u instanceof HTMLTextAreaElement || u instanceof HTMLSelectElement || u.isContentEditable || (o.preventDefault(), ht(c));
2898
+ },
2899
+ [ht]
2900
+ ), ar = S(
2861
2901
  (o) => {
2862
- if (!ee)
2902
+ if (!V)
2863
2903
  return;
2864
- const u = Pe(o, r);
2865
- re.current = null, De.current = u, pe?.(u);
2904
+ const c = ve(o, r);
2905
+ $.current = null, ye.current = c, le?.(c);
2866
2906
  },
2867
- [ee, r, pe]
2907
+ [V, r, le]
2868
2908
  );
2869
- q(() => {
2870
- const o = ue.current?.getScrollPosition() ?? 0, u = ie.current, m = Ke(u, N.top);
2871
- T.debug("[VirtualScroll] Range change effect triggered", () => ({
2872
- renderingStartIndex: lt,
2873
- renderingEndIndex: Ye,
2874
- visibleStartIndex: xt,
2875
- visibleEndIndex: _t,
2876
- scrollPositionState: Ze,
2877
- paneScrollPosition: u,
2878
- logicalScrollPosition: m,
2879
- contentSize: Le,
2909
+ X(() => {
2910
+ const o = G.current?.getScrollPosition() ?? 0, c = P.current, u = Ge(c, E.top);
2911
+ y.debug("[VirtualScroll] Range change effect triggered", () => ({
2912
+ renderingStartIndex: pt,
2913
+ renderingEndIndex: wt,
2914
+ visibleStartIndex: vt,
2915
+ visibleEndIndex: Rt,
2916
+ scrollPositionState: Ke,
2917
+ paneScrollPosition: c,
2918
+ logicalScrollPosition: u,
2919
+ contentSize: Ae,
2880
2920
  scrollPaneScrollPosition: o
2881
- })), _e({
2882
- renderingStartIndex: lt,
2883
- renderingEndIndex: Ye,
2884
- visibleStartIndex: xt,
2885
- visibleEndIndex: _t,
2886
- scrollPosition: m,
2887
- totalHeight: Le
2921
+ })), lt({
2922
+ renderingStartIndex: pt,
2923
+ renderingEndIndex: wt,
2924
+ visibleStartIndex: vt,
2925
+ visibleEndIndex: Rt,
2926
+ scrollPosition: u,
2927
+ totalHeight: Ae
2888
2928
  });
2889
- }, [Le, Ye, lt, N.top, _e, Ze, _t, xt]);
2890
- const hr = S(() => {
2891
- if (!C)
2929
+ }, [Ae, wt, pt, E.top, lt, Ke, Rt, vt]);
2930
+ const Pr = S(() => {
2931
+ if (!v)
2892
2932
  return null;
2893
- const o = Oe && ne !== null;
2894
- return /* @__PURE__ */ de("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": o, inert: !o, children: ne === "up" ? /* @__PURE__ */ de("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ de(
2933
+ const o = Re && Ce !== null;
2934
+ return /* @__PURE__ */ ne("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": o, inert: !o, children: Ce === "up" ? /* @__PURE__ */ ne("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ ne(
2895
2935
  "button",
2896
2936
  {
2897
2937
  type: "button",
2898
2938
  className: "aqvs-scroll-to-edge-button",
2899
2939
  tabIndex: o ? 0 : -1,
2900
- onClick: (m) => {
2901
- m.stopPropagation(), Ue.current = !0, We(0), ae(!1);
2940
+ onClick: (u) => {
2941
+ u.stopPropagation(), ot.current = !0, l(0), Je(!1);
2902
2942
  },
2903
2943
  children: "Top"
2904
2944
  }
2905
- ) }) : /* @__PURE__ */ de("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ de(
2945
+ ) }) : /* @__PURE__ */ ne("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ ne(
2906
2946
  "button",
2907
2947
  {
2908
2948
  type: "button",
2909
2949
  className: "aqvs-scroll-to-edge-button",
2910
2950
  tabIndex: o ? 0 : -1,
2911
- onClick: (m) => {
2912
- m.stopPropagation(), Ue.current = !0, We(r - 1), ae(!1);
2951
+ onClick: (u) => {
2952
+ u.stopPropagation(), ot.current = !0, l(r - 1), Je(!1);
2913
2953
  },
2914
2954
  children: "Bottom"
2915
2955
  }
2916
2956
  ) }) });
2917
- }, [C, Oe, ne, We, r]), Bt = g(0), { visibleItems: Ht, renderAnchor: qt } = Fe(() => {
2957
+ }, [v, Re, Ce, l, r]), Ut = g(0), { visibleItems: Wt, renderAnchor: Kt } = _e(() => {
2918
2958
  if (r === 0)
2919
2959
  return {
2920
- visibleItems: /* @__PURE__ */ de("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ de("div", { className: "aqvs-no-items-text", children: "No items" }) }),
2960
+ visibleItems: /* @__PURE__ */ ne("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ ne("div", { className: "aqvs-no-items-text", children: "No items" }) }),
2921
2961
  renderAnchor: 0
2922
2962
  };
2923
- const o = Pe(lt, r), u = Pe(Ye, r), { cumulative: m, currentValue: A } = E.prefixSum(o, { materializeOption: { materialize: !1 } }), L = m - A;
2924
- Number.isFinite(L) && Math.abs(L - Bt.current) > Zr && (Bt.current = L);
2925
- const O = Bt.current, k = [], se = [];
2926
- let Ne = 0, Ie = L;
2927
- for (let fe = o; fe <= u; fe++) {
2928
- if (se.length >= cr) {
2929
- T.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: cr, safeRenderingStartIndex: o, safeRenderingEndIndex: u });
2963
+ const o = ve(pt, r), c = ve(wt, r), { cumulative: u, currentValue: O } = N.prefixSum(o, { materializeOption: { materialize: !1 } }), _ = u - O;
2964
+ Number.isFinite(_) && Math.abs(_ - Ut.current) > cn && (Ut.current = _);
2965
+ const k = Ut.current, Y = [], ee = [];
2966
+ let Te = 0, me = _;
2967
+ for (let ae = o; ae <= c; ae++) {
2968
+ if (ee.length >= vr) {
2969
+ y.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: vr, safeRenderingStartIndex: o, safeRenderingEndIndex: c });
2930
2970
  break;
2931
2971
  }
2932
- const Be = n(fe), ke = E.get(fe), He = Be - ke;
2933
- He !== 0 && k.push({ index: fe, value: Be });
2934
- const zt = Ie + Ne, Xt = t ? t(fe) : fe;
2935
- se.push(
2936
- /* @__PURE__ */ de(
2937
- tn,
2972
+ const Be = n(ae), Oe = N.get(ae), He = Be - Oe;
2973
+ He !== 0 && Y.push({ index: ae, value: Be });
2974
+ const Ot = me + Te, Gt = t ? t(ae) : ae;
2975
+ ee.push(
2976
+ /* @__PURE__ */ ne(
2977
+ mn,
2938
2978
  {
2939
- index: fe,
2940
- top: zt - O,
2979
+ index: ae,
2980
+ top: Ot - k,
2941
2981
  height: Be,
2942
- item: e(fe),
2943
- clipItemHeight: ze,
2944
- enableKeyboardNavigation: ee,
2945
- onKeyDown: Qt,
2946
- onFocus: er,
2947
- registerItemRef: at,
2948
- children: I
2982
+ item: e(ae),
2983
+ clipItemHeight: Ue,
2984
+ enableKeyboardNavigation: V,
2985
+ onKeyDown: sr,
2986
+ onEscapeKeyDown: ke ? or : void 0,
2987
+ onFocus: ar,
2988
+ registerItemRef: Pt,
2989
+ children: x
2949
2990
  },
2950
- Xt
2991
+ Gt
2951
2992
  )
2952
- ), Ne += He, Ie += ke;
2993
+ ), Te += He, me += Oe;
2953
2994
  }
2954
- return k.length > 0 && Promise.resolve().then(() => {
2955
- if (et.current)
2995
+ return Y.length > 0 && Promise.resolve().then(() => {
2996
+ if (dt.current)
2956
2997
  return;
2957
- let fe = 0;
2958
- for (const He of k)
2959
- if (He.index < xt) {
2960
- const zt = E.get(He.index);
2961
- fe += He.value - zt;
2998
+ let ae = 0;
2999
+ for (const He of Y)
3000
+ if (He.index < vt) {
3001
+ const Ot = N.get(He.index);
3002
+ ae += He.value - Ot;
2962
3003
  }
2963
- const Be = E.updates(k);
2964
- if (et.current || typeof Be != "number")
3004
+ const Be = N.updates(Y);
3005
+ if (dt.current || typeof Be != "number")
2965
3006
  return;
2966
- st(Be), T.debug("[VirtualScroll] Updated heights for items", k, "New total height:", Be);
2967
- const ke = ue.current?.getScrollPosition() ?? ie.current;
2968
- if (fe !== 0) {
2969
- const He = ke + fe;
2970
- bt(He, fe), we(He, { immediate: !0 }), T.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: ke, to: He, shiftAmount: fe });
2971
- } else ke !== ie.current && we(ke);
2972
- }), { visibleItems: se, renderAnchor: O };
3007
+ f(Be), y.debug("[VirtualScroll] Updated heights for items", Y, "New total height:", Be);
3008
+ const Oe = G.current?.getScrollPosition() ?? P.current;
3009
+ if (ae !== 0) {
3010
+ const He = Oe + ae;
3011
+ xt(He, ae), he(He, { immediate: !0 }), y.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: Oe, to: He, shiftAmount: ae });
3012
+ } else Oe !== P.current && he(Oe);
3013
+ }), { visibleItems: ee, renderAnchor: k };
2973
3014
  }, [
2974
- I,
2975
- ze,
2976
- Le,
2977
- ee,
3015
+ x,
3016
+ Ue,
3017
+ Ae,
3018
+ V,
2978
3019
  r,
2979
- E,
3020
+ N,
2980
3021
  e,
2981
3022
  t,
2982
3023
  n,
2983
- er,
2984
- Qt,
2985
- bt,
2986
- at,
2987
- Ye,
2988
- lt,
2989
- we,
2990
- xt
2991
- ]), gr = S(
3024
+ ar,
3025
+ sr,
3026
+ ke,
3027
+ or,
3028
+ xt,
3029
+ Pt,
3030
+ wt,
3031
+ pt,
3032
+ he,
3033
+ vt
3034
+ ]), yr = S(
2992
3035
  (o) => {
2993
- const u = (G ?? 0) > 0, m = Math.abs(o - Ze), A = u && m > 0.5 ? Ze : o, L = Ke(A, N.top);
2994
- if (T.debug("[VirtualScroll] Rendering visible items", () => ({
3036
+ const c = (U ?? 0) > 0, u = Math.abs(o - Ke), O = c && u > 0.5 ? Ke : o, _ = Ge(O, E.top);
3037
+ if (y.debug("[VirtualScroll] Rendering visible items", () => ({
2995
3038
  currentScrollPosition: o,
2996
- effectiveScrollPosition: L,
2997
- renderingStartIndex: lt,
2998
- renderingEndIndex: Ye,
3039
+ effectiveScrollPosition: _,
3040
+ renderingStartIndex: pt,
3041
+ renderingEndIndex: wt,
2999
3042
  itemCount: r,
3000
- viewportSize: K,
3001
- callbackThrottleMs: G,
3002
- diff: m,
3003
- rawEffectiveScrollPosition: A
3043
+ viewportSize: be,
3044
+ callbackThrottleMs: U,
3045
+ diff: u,
3046
+ rawEffectiveScrollPosition: O
3004
3047
  })), r === 0)
3005
- return Ht;
3006
- const O = N.top + qt - A, k = N.bottom > 0 ? /* @__PURE__ */ de(
3048
+ return Wt;
3049
+ const k = E.top + Kt - O, Y = E.bottom > 0 ? /* @__PURE__ */ ne(
3007
3050
  "div",
3008
3051
  {
3009
3052
  className: "aqvs-bottom-inset",
3010
3053
  style: {
3011
3054
  // ラッパー座標での bottom インセット位置 = コンテンツ総高さ (最終行の下端) - アンカー。
3012
- top: E.getTotal() - qt,
3013
- height: N.bottom
3055
+ top: N.getTotal() - Kt,
3056
+ height: E.bottom
3014
3057
  }
3015
3058
  },
3016
3059
  "virtualscroll-bottom-inset"
3017
3060
  ) : null;
3018
- return T.debug("[VirtualScroll] Rendering items", () => ({
3019
- containerTop: O,
3020
- logicalScrollPosition: Re,
3021
- resolvedInsets: N,
3022
- effectiveScrollPosition: L
3023
- })), /* @__PURE__ */ Mt("div", { className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${O}px)`, willChange: "transform" }, children: [
3024
- Ht,
3025
- k
3061
+ return y.debug("[VirtualScroll] Rendering items", () => ({
3062
+ containerTop: k,
3063
+ logicalScrollPosition: mt,
3064
+ resolvedInsets: E,
3065
+ effectiveScrollPosition: _
3066
+ })), /* @__PURE__ */ Tt("div", { className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${k}px)`, willChange: "transform" }, children: [
3067
+ Wt,
3068
+ Y
3026
3069
  ] });
3027
3070
  },
3028
- [G, r, E, Re, qt, Ye, lt, N, Ze, K, Ht]
3029
- ), tr = Fe(
3071
+ [U, r, N, mt, Kt, wt, pt, E, Ke, be, Wt]
3072
+ ), lr = _e(
3030
3073
  () => ({
3031
- renderingStartIndex: Ee.renderingStartIndex,
3032
- renderingEndIndex: Ee.renderingEndIndex,
3033
- visibleStartIndex: Ee.visibleStartIndex,
3034
- visibleEndIndex: Ee.visibleEndIndex,
3035
- scrollPosition: Re,
3036
- totalHeight: E.getTotal()
3074
+ renderingStartIndex: at.renderingStartIndex,
3075
+ renderingEndIndex: at.renderingEndIndex,
3076
+ visibleStartIndex: at.visibleStartIndex,
3077
+ visibleEndIndex: at.visibleEndIndex,
3078
+ scrollPosition: mt,
3079
+ totalHeight: N.getTotal()
3037
3080
  // contentSize (State) ではなく最新値を反映
3038
3081
  }),
3039
3082
  // contentSize を依存に含めることで、updateItemSize/updates 等で木の総高さが変わった際に
3040
3083
  // (fenwickTree は安定参照のため getTotal() の変化だけでは再計算されない) 総高さを再取得する。
3041
- [Ee, Re, E, Le]
3084
+ [at, mt, N, Ae]
3042
3085
  );
3043
- q(() => {
3044
- be.current = tr;
3045
- }, [tr]), Jt(
3046
- M,
3086
+ X(() => {
3087
+ Qe.current = lr;
3088
+ }, [lr]);
3089
+ const [Rr, cr] = je(""), ur = g(w);
3090
+ Ze(() => {
3091
+ ur.current = w;
3092
+ }, [w]);
3093
+ const Et = w?.debounceMs ?? 400, Ht = Number.isFinite(Et) && Et >= 0, Lt = w !== void 0;
3094
+ X(() => {
3095
+ Lt && !Ht && y.warn(`[VirtualScroll] liveRegion.debounceMs must be a finite number >= 0, received ${Et}. Announcements are disabled.`);
3096
+ }, [Lt, Ht, Et]), X(() => {
3097
+ if (!(Lt && Ht)) {
3098
+ cr("");
3099
+ return;
3100
+ }
3101
+ const o = setTimeout(() => {
3102
+ const c = ur.current?.format;
3103
+ if (!c)
3104
+ return;
3105
+ const u = c({ visibleStartIndex: vt, visibleEndIndex: Rt, itemCount: r });
3106
+ cr(u);
3107
+ }, Et);
3108
+ return () => clearTimeout(o);
3109
+ }, [Lt, Ht, Et, vt, Rt, r]), ir(
3110
+ j,
3047
3111
  () => ({
3048
3112
  getScrollPosition: () => {
3049
- const o = ue.current?.getScrollPosition();
3050
- return typeof o == "number" ? Ke(o, ct.current) : -1;
3113
+ const o = G.current?.getScrollPosition();
3114
+ return typeof o == "number" ? Ge(o, Ye.current) : -1;
3051
3115
  },
3052
- getContentSize: () => ue.current?.getContentSize() ?? -1,
3053
- getViewportSize: () => ue.current?.getViewportSize() ?? -1,
3054
- scrollTo: R,
3055
- scrollBy: D,
3056
- applyWheel: $,
3057
- scrollToIndex: We,
3058
- getFenwickTreeTotalHeight: () => E.getTotal(),
3059
- getFenwickSize: () => E.getSize(),
3060
- focusItemAtIndex: Tt,
3061
- getRange: () => be.current,
3062
- getScrollAnchor: x,
3063
- updateItemSize: Ot
3116
+ getContentSize: () => G.current?.getContentSize() ?? -1,
3117
+ getViewportSize: () => G.current?.getViewportSize() ?? -1,
3118
+ scrollTo: ge,
3119
+ scrollBy: Ne,
3120
+ applyWheel: rt,
3121
+ scrollToIndex: l,
3122
+ getFenwickTreeTotalHeight: () => N.getTotal(),
3123
+ getFenwickSize: () => N.getSize(),
3124
+ focusItemAtIndex: ht,
3125
+ getRange: () => Qe.current,
3126
+ getScrollAnchor: H,
3127
+ updateItemSize: At
3064
3128
  }),
3065
- [R, D, $, We, E, Tt, x, Ot]
3129
+ [ge, Ne, rt, l, N, ht, H, At]
3066
3130
  );
3067
- const br = E.getTotal() + N.top + N.bottom;
3068
- return /* @__PURE__ */ de(
3069
- Xr,
3131
+ const Er = N.getTotal() + E.top + E.bottom, dr = /* @__PURE__ */ ne(
3132
+ tn,
3070
3133
  {
3071
- ref: ue,
3072
- contentSize: br,
3134
+ ref: G,
3135
+ contentSize: Er,
3073
3136
  viewportSize: i,
3074
- onViewportSizeChange: Ae,
3137
+ onViewportSizeChange: Ie,
3075
3138
  className: a,
3076
- testId: c,
3077
- onScroll: ye,
3078
- background: w,
3079
- tapScrollCircleOptions: W,
3080
- inertiaOptions: Xe,
3081
- overscrollBehavior: $e,
3139
+ testId: m,
3140
+ onScroll: nt,
3141
+ background: T,
3142
+ tapScrollCircleOptions: de,
3143
+ inertiaOptions: ze,
3144
+ overscrollBehavior: Fe,
3082
3145
  itemCount: r,
3083
3146
  scrollBarWidth: Z,
3084
- enableThumbDrag: Q,
3085
- enableTrackClick: U,
3086
- enableArrowButtons: Se,
3087
- enablePointerDrag: ge,
3088
- pointerDragInputs: qe,
3089
- renderThumbOverlay: v,
3090
- wheelSpeedMultiplier: X,
3091
- onWheelHorizontal: ce,
3092
- contentInsets: N,
3093
- contentProps: _,
3094
- visibleStartIndex: xt,
3095
- visibleEndIndex: _t,
3096
- renderOverlay: hr,
3097
- initialScrollPosition: J.position,
3098
- children: gr
3147
+ enableThumbDrag: W,
3148
+ enableTrackClick: pe,
3149
+ enableArrowButtons: A,
3150
+ enablePointerDrag: qe,
3151
+ pointerDragInputs: Xe,
3152
+ renderThumbOverlay: K,
3153
+ wheelSpeedMultiplier: $e,
3154
+ onWheelHorizontal: se,
3155
+ contentInsets: E,
3156
+ contentProps: F,
3157
+ visibleStartIndex: vt,
3158
+ visibleEndIndex: Rt,
3159
+ renderOverlay: Pr,
3160
+ initialScrollPosition: st.position,
3161
+ children: yr
3099
3162
  }
3100
3163
  );
3101
- }, un = Zt(rn);
3164
+ return Lt ? /* @__PURE__ */ Tt(rr, { children: [
3165
+ dr,
3166
+ /* @__PURE__ */ ne("div", { className: "aqvs-live-region", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-aqvs-live-region": "", children: Rr })
3167
+ ] }) : dr;
3168
+ }, Tn = nr(pn);
3102
3169
  export {
3103
3170
  St as FenwickMapTree,
3104
- kr as ScrollBar,
3105
- Xr as ScrollPane,
3106
- pr as TAP_SCROLL_SPEED_DEFAULTS,
3107
- un as VirtualScroll,
3108
- _r as computeAutoTapScrollMaxSpeedMultiplier,
3109
- Or as computeTapScrollSpeed,
3110
- le as minmax,
3111
- an as tapScrollCircleSampleVisual,
3112
- Wr as useFenwickMapTree,
3113
- ln as useHeightCache,
3114
- jr as useLruCache,
3115
- cn as useWheelBridge
3171
+ Gr as ScrollBar,
3172
+ tn as ScrollPane,
3173
+ wr as TAP_SCROLL_SPEED_DEFAULTS,
3174
+ Tn as VirtualScroll,
3175
+ Kr as computeAutoTapScrollMaxSpeedMultiplier,
3176
+ Wr as computeTapScrollSpeed,
3177
+ xn as createResidualQuantizer,
3178
+ ie as minmax,
3179
+ vn as tapScrollCircleSampleVisual,
3180
+ sn as useFenwickMapTree,
3181
+ In as useHeightCache,
3182
+ an as useLruCache,
3183
+ Sn as useWheelBridge
3116
3184
  };