@aiquants/virtualscroll 3.11.1 → 3.11.2

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,5 +1,5 @@
1
- import { jsx as Q, jsxs as Zt, Fragment as pn } from "react/jsx-runtime";
2
- import Jn, { useState as Ve, useCallback as p, useSyncExternalStore as ei, memo as ti, forwardRef as Qr, useRef as u, useImperativeHandle as Jr, useMemo as ge, useLayoutEffect as je, useEffect as q, useId as ri, useReducer as ni, createElement as rn } from "react";
1
+ import { jsx as Z, jsxs as Zt, Fragment as pn } from "react/jsx-runtime";
2
+ import Jn, { useState as Ce, useCallback as p, useSyncExternalStore as ei, memo as ti, forwardRef as Qr, useRef as u, useImperativeHandle as Jr, useMemo as ge, useLayoutEffect as We, useEffect as W, useId as ri, useReducer as ni, createElement as rn } from "react";
3
3
  import { twMerge as Ot } from "tailwind-merge";
4
4
  const ii = 1e-6, _n = (t, e, r) => {
5
5
  if (!(Number.isFinite(e) && e > 0))
@@ -30,7 +30,7 @@ const ii = 1e-6, _n = (t, e, r) => {
30
30
  n.subscribers.delete(e), n.subscribers.size === 0 && n.disarm !== null && (n.disarm(), n.disarm = null);
31
31
  };
32
32
  }, Fn = (t) => {
33
- const [e, r] = Ve(ai), n = p((l) => e === null ? On : li(e, l), [e]), i = p(() => e === null ? null : e.devicePixelRatio, [e]), s = ei(n, i, oi), a = p(
33
+ const [e, r] = Ce(ai), n = p((l) => e === null ? On : li(e, l), [e]), i = p(() => e === null ? null : e.devicePixelRatio, [e]), s = ei(n, i, oi), a = p(
34
34
  (l) => {
35
35
  if (l === null)
36
36
  return;
@@ -110,7 +110,7 @@ const ii = 1e-6, _n = (t, e, r) => {
110
110
  }
111
111
  return Object.freeze(s);
112
112
  };
113
- class F {
113
+ class L {
114
114
  level;
115
115
  prefix;
116
116
  impl;
@@ -123,7 +123,7 @@ class F {
123
123
  constructor(e = 2, r = "[virtualscroll]", n = console) {
124
124
  this.level = e, this.prefix = r, this.impl = n;
125
125
  }
126
- static instance = new F(2, "[virtualscroll]");
126
+ static instance = new L(2, "[virtualscroll]");
127
127
  /**
128
128
  * @method setLevel
129
129
  * @description Updates the current log level for the static instance.
@@ -131,7 +131,7 @@ class F {
131
131
  * @param {LogLevel} level - The new log level.
132
132
  */
133
133
  static setLevel(e) {
134
- F.instance.setLevel(e);
134
+ L.instance.setLevel(e);
135
135
  }
136
136
  /**
137
137
  * @method setLevel
@@ -149,7 +149,7 @@ class F {
149
149
  * @param {ILogger} impl - The new logger implementation.
150
150
  */
151
151
  static setImplementation(e) {
152
- F.instance.setImplementation(e);
152
+ L.instance.setImplementation(e);
153
153
  }
154
154
  /**
155
155
  * @method setImplementation
@@ -168,7 +168,7 @@ class F {
168
168
  * @returns {boolean} True if a message at `level` would be emitted. / `level` のメッセージが出力されるなら true。
169
169
  */
170
170
  static isEnabled(e) {
171
- return F.instance.isEnabled(e);
171
+ return L.instance.isEnabled(e);
172
172
  }
173
173
  /**
174
174
  * @method isEnabled
@@ -213,25 +213,25 @@ class F {
213
213
  return typeof e == "string" ? [`${this.prefix} ${e}`] : [this.prefix, e];
214
214
  }
215
215
  static debug(e, ...r) {
216
- F.instance.debug(e, ...r);
216
+ L.instance.debug(e, ...r);
217
217
  }
218
218
  debug(e, ...r) {
219
- this.level <= 0 && this.impl.debug(...this.formatMessage(F.resolveLazy(e)), ...r.map(F.resolveLazy));
219
+ this.level <= 0 && this.impl.debug(...this.formatMessage(L.resolveLazy(e)), ...r.map(L.resolveLazy));
220
220
  }
221
221
  info(e, ...r) {
222
- this.level <= 1 && this.impl.info(...this.formatMessage(F.resolveLazy(e)), ...r.map(F.resolveLazy));
222
+ this.level <= 1 && this.impl.info(...this.formatMessage(L.resolveLazy(e)), ...r.map(L.resolveLazy));
223
223
  }
224
224
  static warn(e, ...r) {
225
- F.instance.warn(e, ...r);
225
+ L.instance.warn(e, ...r);
226
226
  }
227
227
  warn(e, ...r) {
228
- this.level <= 2 && this.impl.warn(...this.formatMessage(F.resolveLazy(e)), ...r.map(F.resolveLazy));
228
+ this.level <= 2 && this.impl.warn(...this.formatMessage(L.resolveLazy(e)), ...r.map(L.resolveLazy));
229
229
  }
230
230
  static error(e, ...r) {
231
- F.instance.error(e, ...r);
231
+ L.instance.error(e, ...r);
232
232
  }
233
233
  error(e, ...r) {
234
- this.level <= 3 && this.impl.error(...this.formatMessage(F.resolveLazy(e)), ...r.map(F.resolveLazy));
234
+ this.level <= 3 && this.impl.error(...this.formatMessage(L.resolveLazy(e)), ...r.map(L.resolveLazy));
235
235
  }
236
236
  }
237
237
  const Xn = (t) => typeof t.setPointerCapture == "function" && typeof t.releasePointerCapture == "function" && typeof t.hasPointerCapture == "function", Bn = (t, e) => Xn(t) && t.hasPointerCapture(e), _r = (t, e) => {
@@ -254,7 +254,7 @@ const Xn = (t) => typeof t.setPointerCapture == "function" && typeof t.releasePo
254
254
  }, Wr = 6, hi = 8, pi = ({ dragState: t, normalizedDistance: e }) => {
255
255
  const r = 1 + e * 0.18, n = 0.16 + e * 0.24, i = 0.38 + e * 0.28, s = t.active ? "80ms ease-out" : "220ms ease";
256
256
  return /* @__PURE__ */ Zt(pn, { children: [
257
- /* @__PURE__ */ Q(
257
+ /* @__PURE__ */ Z(
258
258
  "div",
259
259
  {
260
260
  className: "aqvs-tap-scroll-circle-visual-outer",
@@ -266,7 +266,7 @@ const Xn = (t) => typeof t.setPointerCapture == "function" && typeof t.releasePo
266
266
  }
267
267
  }
268
268
  ),
269
- /* @__PURE__ */ Q(
269
+ /* @__PURE__ */ Z(
270
270
  "div",
271
271
  {
272
272
  className: "aqvs-tap-scroll-circle-inner",
@@ -281,146 +281,154 @@ const Xn = (t) => typeof t.setPointerCapture == "function" && typeof t.releasePo
281
281
  ] });
282
282
  }, mn = ti(
283
283
  Qr(({ onDragChange: t, className: e, maxVisualDistance: r = 160, size: n = 40, style: i, opacity: s = 1, renderVisual: a, axis: l = "y" }, f) => {
284
- const [b, g] = Ve(bn), M = u(null), N = u(null), S = u({ x: 0, y: 0 }), L = u(null), X = u(0), K = p(
284
+ const [g, x] = Ce(bn), S = u(null), N = u(null), M = u({ x: 0, y: 0 }), _ = u(null), F = u(0), J = p(
285
285
  (C) => {
286
- g(C), t(C);
286
+ x(C), t(C);
287
287
  },
288
288
  [t]
289
- ), ae = p(
290
- (C, W, se = !1) => {
291
- const { x: He, y: ce } = S.current, Pe = C - He, Rt = W - ce;
292
- let re, st;
289
+ ), ie = p(
290
+ (C, K, ee = !1) => {
291
+ const { x: He, y: ce } = M.current, Pe = C - He, Rt = K - ce;
292
+ let ne, st;
293
293
  if (l === "xy")
294
- re = Math.hypot(Pe, Rt), st = re < Wr ? 0 : 1;
294
+ ne = Math.hypot(Pe, Rt), st = ne < Wr ? 0 : 1;
295
295
  else {
296
- const Ae = l === "x" ? Pe : Rt;
297
- re = Math.abs(Ae), st = re < Wr ? 0 : Ae < 0 ? -1 : 1;
296
+ const Ve = l === "x" ? Pe : Rt;
297
+ ne = Math.abs(Ve), st = ne < Wr ? 0 : Ve < 0 ? -1 : 1;
298
298
  }
299
- const vt = X.current;
300
- let ve = st;
299
+ const wt = F.current;
300
+ let we = st;
301
301
  const Ke = Wr + hi;
302
- st === 0 ? vt !== 0 && re < Ke ? ve = vt : (ve = 0, se || (X.current = 0)) : st !== vt && vt !== 0 && re < Ke ? ve = vt : X.current = st, K({
303
- active: se || re >= Wr,
302
+ st === 0 ? wt !== 0 && ne < Ke ? we = wt : (we = 0, ee || (F.current = 0)) : st !== wt && wt !== 0 && ne < Ke ? we = wt : F.current = st, J({
303
+ active: ee || ne >= Wr,
304
304
  offsetX: Pe,
305
305
  offsetY: Rt,
306
- distance: re,
307
- direction: ve,
308
- pointerId: M.current
306
+ distance: ne,
307
+ direction: we,
308
+ pointerId: S.current
309
309
  });
310
310
  },
311
- [K, l]
312
- ), De = p((C) => {
311
+ [J, l]
312
+ ), ze = p((C) => {
313
313
  if (C === null)
314
314
  return;
315
- const W = L.current;
316
- W !== null && dr(W, C);
317
- }, []), T = p(
315
+ const K = _.current;
316
+ K !== null && dr(K, C);
317
+ }, []), $ = p(
318
318
  (C = !1) => {
319
- C && De(M.current), M.current = null, N.current = null, X.current = 0, K(bn);
319
+ C && ze(S.current), S.current = null, N.current = null, F.current = 0, J(bn);
320
320
  },
321
- [K, De]
322
- ), A = p(
321
+ [J, ze]
322
+ ), I = p(
323
323
  (C) => {
324
- if (M.current !== null && M.current !== C.pointerId) {
324
+ if (S.current !== null && S.current !== C.pointerId) {
325
325
  N.current = { pointerId: C.pointerId, clientX: C.clientX, clientY: C.clientY }, C.preventDefault(), C.stopPropagation();
326
326
  return;
327
327
  }
328
328
  C.preventDefault(), C.stopPropagation();
329
- const W = L.current ?? C.currentTarget, { left: se, top: He, width: ce, height: Pe } = W.getBoundingClientRect();
330
- S.current = { x: se + ce / 2, y: He + Pe / 2 }, M.current = C.pointerId, _r(W, C.pointerId), ae(C.clientX, C.clientY, !0);
329
+ const K = _.current ?? C.currentTarget, { left: ee, top: He, width: ce, height: Pe } = K.getBoundingClientRect();
330
+ M.current = { x: ee + ce / 2, y: He + Pe / 2 }, S.current = C.pointerId, _r(K, C.pointerId), ie(C.clientX, C.clientY, !0);
331
331
  },
332
- [ae]
333
- ), P = p(
332
+ [ie]
333
+ ), R = p(
334
334
  (C) => {
335
- if (M.current !== C.pointerId) {
335
+ if (S.current !== C.pointerId) {
336
336
  N.current !== null && N.current.pointerId === C.pointerId && (N.current = { pointerId: C.pointerId, clientX: C.clientX, clientY: C.clientY });
337
337
  return;
338
338
  }
339
- C.preventDefault(), ae(C.clientX, C.clientY);
339
+ C.preventDefault(), ie(C.clientX, C.clientY);
340
340
  },
341
- [ae]
342
- ), Z = p(
341
+ [ie]
342
+ ), X = p(
343
343
  (C) => {
344
- if (M.current !== C.pointerId) {
344
+ if (S.current !== C.pointerId) {
345
345
  N.current !== null && N.current.pointerId === C.pointerId && (N.current = null);
346
346
  return;
347
347
  }
348
348
  C.preventDefault(), C.stopPropagation();
349
- const W = N.current;
350
- if (N.current = null, W !== null) {
351
- De(C.pointerId);
352
- const se = L.current;
353
- if (se === null || _r(se, W.pointerId) !== "inactive-pointer") {
354
- M.current = W.pointerId, ae(W.clientX, W.clientY, !0);
349
+ const K = N.current;
350
+ if (N.current = null, K !== null) {
351
+ ze(C.pointerId);
352
+ const ee = _.current;
353
+ if (ee === null || _r(ee, K.pointerId) !== "inactive-pointer") {
354
+ S.current = K.pointerId, ie(K.clientX, K.clientY, !0);
355
355
  return;
356
356
  }
357
357
  }
358
- T(!0);
358
+ $(!0);
359
359
  },
360
- [T, De, ae]
361
- ), $ = p(
360
+ [$, ze, ie]
361
+ ), B = p(
362
362
  (C) => {
363
- C.target === C.currentTarget && M.current === C.pointerId && T(!1);
363
+ C.target === C.currentTarget && S.current === C.pointerId && $(!1);
364
364
  },
365
- [T]
365
+ [$]
366
366
  );
367
367
  Jr(
368
368
  f,
369
369
  () => ({
370
+ /**
371
+ * Returns the circle to its resting state and reports it through `onDragChange`.
372
+ * サークルを静止の状態へ戻し、`onDragChange` で知らせる処理。
373
+ */
370
374
  reset: () => {
371
- T(!0);
375
+ $(!0);
372
376
  },
373
- getElement: () => L.current
377
+ /**
378
+ * Reads the circle's root element (null while it is not mounted).
379
+ * サークルのルートの要素を読む処理 (マウントしていない間は null)。
380
+ */
381
+ getElement: () => _.current
374
382
  }),
375
- [T]
383
+ [$]
376
384
  );
377
- const _ = Math.min(Math.max(s, 0), 1), he = n / 64, ne = Math.min(b.distance, r) / r, ie = b.direction * ne * 10 * he;
378
- let Te;
385
+ const k = Math.min(Math.max(s, 0), 1), be = n / 64, se = Math.min(g.distance, r) / r, oe = g.direction * se * 10 * be;
386
+ let pe;
379
387
  if (l === "xy") {
380
- const C = b.distance, W = C === 0 ? 0 : ie * b.offsetX / C, se = C === 0 ? 0 : ie * b.offsetY / C;
381
- Te = `translate(${W}px, ${se}px)`;
382
- } else l === "x" ? Te = `translateX(${ie}px)` : Te = `translateY(${ie}px)`;
383
- const xe = a ?? pi, Le = {
384
- dragState: b,
385
- normalizedDistance: ne,
386
- sizeScale: he,
388
+ const C = g.distance, K = C === 0 ? 0 : oe * g.offsetX / C, ee = C === 0 ? 0 : oe * g.offsetY / C;
389
+ pe = `translate(${K}px, ${ee}px)`;
390
+ } else l === "x" ? pe = `translateX(${oe}px)` : pe = `translateY(${oe}px)`;
391
+ const xe = a ?? pi, ke = {
392
+ dragState: g,
393
+ normalizedDistance: se,
394
+ sizeScale: be,
387
395
  size: n,
388
- opacity: _
389
- }, Tt = {
396
+ opacity: k
397
+ }, je = {
390
398
  ...i,
391
399
  width: n,
392
400
  height: n,
393
- transform: Te
401
+ transform: pe
394
402
  };
395
- return Tt.opacity = _, /* @__PURE__ */ Q(
403
+ return je.opacity = k, /* @__PURE__ */ Z(
396
404
  "div",
397
405
  {
398
- ref: L,
406
+ ref: _,
399
407
  "data-testid": "virtual-scroll-tap-circle",
400
408
  className: Ot("aqvs-tap-scroll-circle", e),
401
- style: Tt,
409
+ style: je,
402
410
  tabIndex: -1,
403
- onPointerDown: A,
404
- onPointerMove: P,
405
- onPointerUp: Z,
406
- onPointerCancel: Z,
407
- onLostPointerCapture: $,
411
+ onPointerDown: I,
412
+ onPointerMove: R,
413
+ onPointerUp: X,
414
+ onPointerCancel: X,
415
+ onLostPointerCapture: B,
408
416
  role: "presentation",
409
- children: xe(Le)
417
+ children: xe(ke)
410
418
  }
411
419
  );
412
420
  })
413
421
  );
414
422
  mn.displayName = "TapScrollCircle";
415
- const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
416
- const r = e === "x", n = t.getBoundingClientRect(), i = r ? n.width : n.height, s = (g) => {
417
- const M = Number.parseFloat(g);
418
- return Number.isFinite(M) ? M : 0;
419
- }, a = window.getComputedStyle(t), l = s(r ? a.width : a.height), f = l > 0 ? l + s(r ? a.paddingLeft : a.paddingTop) + s(r ? a.paddingRight : a.paddingBottom) + s(r ? a.borderLeftWidth : a.borderTopWidth) + s(r ? a.borderRightWidth : a.borderBottomWidth) : 0, b = f > 0 ? f : r ? t.offsetWidth : t.offsetHeight;
420
- return b <= 0 || i <= 0 ? 1 : i / b;
423
+ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
424
+ const r = e === "x", n = t.getBoundingClientRect(), i = r ? n.width : n.height, s = (x) => {
425
+ const S = Number.parseFloat(x);
426
+ return Number.isFinite(S) ? S : 0;
427
+ }, a = window.getComputedStyle(t), l = s(r ? a.width : a.height), f = l > 0 ? l + s(r ? a.paddingLeft : a.paddingTop) + s(r ? a.paddingRight : a.paddingBottom) + s(r ? a.borderLeftWidth : a.borderTopWidth) + s(r ? a.borderRightWidth : a.borderBottomWidth) : 0, g = f > 0 ? f : r ? t.offsetWidth : t.offsetHeight;
428
+ return g <= 0 || i <= 0 ? 1 : i / g;
421
429
  }, qn = (t) => {
422
430
  t.preventDefault();
423
- }, Or = "virtualscroll:tap-scroll-cancel", xn = 20, vn = 0.01, mi = (t, e) => e <= 0 || t <= 0 ? 0 : t >= e ? 1 : te(t / e, vn, 1 - vn), gi = 250, bi = 60, xi = 20, vi = 20, Yn = {
431
+ }, Or = "virtualscroll:tap-scroll-cancel", vn = 20, xn = 0.01, mi = (t, e) => e <= 0 || t <= 0 ? 0 : t >= e ? 1 : re(t / e, xn, 1 - xn), gi = 250, bi = 60, vi = 20, xi = 20, Yn = {
424
432
  /** 速度が最大に達する引き距離 (px)。`maxVisualDistance` の既定値。 */
425
433
  maxDistance: 240,
426
434
  /** 最小速度倍率 (ビューポート比)。 */
@@ -440,7 +448,15 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
440
448
  mainSizeKey: "width",
441
449
  crossSizeKey: "height",
442
450
  thumbTranslateFunction: "translateX",
451
+ /**
452
+ * Picks the component of a pointer drag along the horizontal bar.
453
+ * ポインタのドラッグの、横のバーに沿う成分を選ぶ処理。
454
+ */
443
455
  selectDelta: (e, r) => e,
456
+ /**
457
+ * Reads a pointer's coordinate along the horizontal bar.
458
+ * ポインタの、横のバーに沿う座標を読む処理。
459
+ */
444
460
  getPointerCoordinate: ({ clientX: e }) => e,
445
461
  arrowIcons: ["◀", "▶"],
446
462
  directionClass: "aqvs-scrollbar-horizontal",
@@ -449,7 +465,15 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
449
465
  mainSizeKey: "height",
450
466
  crossSizeKey: "width",
451
467
  thumbTranslateFunction: "translateY",
468
+ /**
469
+ * Picks the component of a pointer drag along the vertical bar.
470
+ * ポインタのドラッグの、縦のバーに沿う成分を選ぶ処理。
471
+ */
452
472
  selectDelta: (e, r) => r,
473
+ /**
474
+ * Reads a pointer's coordinate along the vertical bar.
475
+ * ポインタの、縦のバーに沿う座標を読む処理。
476
+ */
453
477
  getPointerCoordinate: ({ clientY: e }) => e,
454
478
  arrowIcons: ["▲", "▼"],
455
479
  directionClass: "aqvs-scrollbar-vertical",
@@ -465,58 +489,71 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
465
489
  maxVisualDistance: t?.maxVisualDistance ?? Kt.maxVisualDistance,
466
490
  maxSpeedMultiplier: n,
467
491
  minSpeedMultiplier: Math.max(t?.minSpeedMultiplier ?? Kt.minSpeedMultiplier, 0),
468
- opacity: te(t?.opacity ?? Kt.opacity, 0, 1),
492
+ opacity: re(t?.opacity ?? Kt.opacity, 0, 1),
469
493
  renderVisual: t?.renderVisual ?? Kt.renderVisual,
470
494
  maxSpeedCurve: t?.maxSpeedCurve ?? Kt.maxSpeedCurve
471
495
  };
472
496
  }, yi = ({ isDragging: t, isThumbHovered: e, enableThumbDrag: r }) => ge(() => r ? t ? "dragging" : e ? "hover" : "idle" : "disabled", [r, t, e]), Ii = ({ canUseArrowButtons: t, enableArrowButtons: e, keyboardOperable: r, resetTapScroll: n, scrollByStep: i }) => {
473
497
  const s = u(null), a = u(null), l = u(null), f = p(() => {
474
498
  s.current !== null && (window.clearInterval(s.current), s.current = null), a.current !== null && (window.clearTimeout(a.current), a.current = null), l.current !== null && (window.removeEventListener("pointerup", l.current), window.removeEventListener("pointercancel", l.current), window.removeEventListener("blur", l.current), l.current = null);
475
- }, []), b = p(() => {
499
+ }, []), g = p(() => {
476
500
  f();
477
- }, [f]), g = p(
478
- (N) => (S) => {
479
- if (!t)
480
- return;
481
- S.cancelable && S.preventDefault(), S.stopPropagation(), n(), f(), i(N), a.current = window.setTimeout(() => {
482
- s.current = window.setInterval(() => {
483
- i(N);
484
- }, bi);
485
- }, gi);
486
- const L = () => f();
487
- l.current = L, window.addEventListener("pointerup", L), window.addEventListener("pointercancel", L), window.addEventListener("blur", L);
488
- },
501
+ }, [f]), x = p(
502
+ (N) => (
503
+ /**
504
+ * Handles a press on an arrow: one step at once, then a repeat while the press is held, ended by the release anywhere,
505
+ * a cancel or the window losing focus.
506
+ * 矢印の押下を扱う処理。すぐに 1 段進め、押している間は繰り返し、どこでの解放・取り消し・ウィンドウのフォーカスの喪失で止める。
507
+ */
508
+ ((M) => {
509
+ if (!t)
510
+ return;
511
+ M.cancelable && M.preventDefault(), M.stopPropagation(), n(), f(), i(N), a.current = window.setTimeout(() => {
512
+ s.current = window.setInterval(() => {
513
+ i(N);
514
+ }, bi);
515
+ }, gi);
516
+ const _ = () => f();
517
+ l.current = _, window.addEventListener("pointerup", _), window.addEventListener("pointercancel", _), window.addEventListener("blur", _);
518
+ })
519
+ ),
489
520
  [t, f, n, i]
490
- ), M = p(
491
- (N) => (S) => {
492
- e && r && (S.key === "Enter" || S.key === " " || S.key === "Spacebar") && (S.preventDefault(), i(N));
493
- },
521
+ ), S = p(
522
+ (N) => (
523
+ /**
524
+ * Handles Enter and Space on a focused arrow as one step, unless the bar is pointer-only or its arrows are disabled.
525
+ * フォーカスした矢印での Enter と Space を 1 段として扱う処理 (バーがポインタ専用か矢印が無効なら何もしない)。
526
+ */
527
+ ((M) => {
528
+ e && r && (M.key === "Enter" || M.key === " " || M.key === "Spacebar") && (M.preventDefault(), i(N));
529
+ })
530
+ ),
494
531
  [e, r, i]
495
532
  );
496
- return q(() => {
533
+ return W(() => {
497
534
  t || f();
498
- }, [t, f]), q(() => () => {
535
+ }, [t, f]), W(() => () => {
499
536
  f();
500
- }, [f]), { handleArrowPointerDown: g, handleArrowPointerUp: b, handleArrowKeyDown: M };
537
+ }, [f]), { handleArrowPointerDown: x, handleArrowPointerUp: g, handleArrowKeyDown: S };
501
538
  }, Pi = 700, ur = (t, e) => typeof t == "number" && Number.isFinite(t) ? t : e, fn = ({ distance: t, maxDistance: e, viewportSize: r, minSpeedMultiplier: n, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: a }) => {
502
- const l = Math.max(ur(t, 0), 0), f = ur(e, 0), b = f > 0 ? Math.min(l, f) / f : 1, g = Math.max(ur(r, 0), 0), M = Math.max(ur(n, 0), 0), N = Math.max(ur(i, 0), 0), S = Math.max(g * M, 40), L = s ? S : 1200, X = Math.max(g * N, L), K = a ? Math.max(ur(a.exponentialScale, N), 0) : 0, ae = a ? Math.min(X, Math.max(g * K, S)) : X, De = Math.max(ae, S);
503
- let T = b ** 1.1;
539
+ const l = Math.max(ur(t, 0), 0), f = ur(e, 0), g = f > 0 ? Math.min(l, f) / f : 1, x = Math.max(ur(r, 0), 0), S = Math.max(ur(n, 0), 0), N = Math.max(ur(i, 0), 0), M = Math.max(x * S, 40), _ = s ? M : 1200, F = Math.max(x * N, _), J = a ? Math.max(ur(a.exponentialScale, N), 0) : 0, ie = a ? Math.min(F, Math.max(x * J, M)) : F, ze = Math.max(ie, M);
540
+ let $ = g ** 1.1;
504
541
  if (a) {
505
- const P = Math.min(Math.max(ur(a.exponentialSteepness, 0), 0), Pi);
506
- if (P === 0)
507
- T = b;
542
+ const R = Math.min(Math.max(ur(a.exponentialSteepness, 0), 0), Pi);
543
+ if (R === 0)
544
+ $ = g;
508
545
  else {
509
- const Z = Math.expm1(P) || 1;
510
- T = Math.min(Math.max(Math.expm1(P * b) / Z, 0), 1);
546
+ const X = Math.expm1(R) || 1;
547
+ $ = Math.min(Math.max(Math.expm1(R * g) / X, 0), 1);
511
548
  }
512
549
  }
513
- const A = Math.min(Math.max(ur(a?.easedOffset, 0), 0), 1);
514
- return S + (De - S) * (A + (1 - A) * T);
550
+ const I = Math.min(Math.max(ur(a?.easedOffset, 0), 0), 1);
551
+ return M + (ze - M) * (I + (1 - I) * $);
515
552
  }, Ei = (t) => {
516
553
  if (!t || t <= 0)
517
554
  return nn;
518
555
  const e = Math.max(1, t), r = Math.log10(e), n = nn + r * Si;
519
- return te(n, nn, Mi);
556
+ return re(n, nn, Mi);
520
557
  }, Un = ({
521
558
  contentSize: t,
522
559
  viewportSize: e,
@@ -527,239 +564,239 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
527
564
  enableArrowButtons: a = !0,
528
565
  enableArrowButtonTabStops: l = !0,
529
566
  horizontal: f = !1,
530
- enableHorizontalTapCircle: b = !1,
531
- stretchMainSize: g = !1,
532
- scrollBarWidth: M = 12,
567
+ enableHorizontalTapCircle: g = !1,
568
+ stretchMainSize: x = !1,
569
+ scrollBarWidth: S = 12,
533
570
  className: N,
534
- ariaControls: S,
535
- tapScrollCircleOptions: L,
536
- itemCount: X,
537
- renderThumbOverlay: K,
538
- visibleStartIndex: ae,
539
- visibleEndIndex: De,
540
- locale: T,
541
- labels: A
571
+ ariaControls: M,
572
+ tapScrollCircleOptions: _,
573
+ itemCount: F,
574
+ renderThumbOverlay: J,
575
+ visibleStartIndex: ie,
576
+ visibleEndIndex: ze,
577
+ locale: $,
578
+ labels: I
542
579
  }) => {
543
- const [P, Z] = Ve(!1), [$, _] = Ve(!1), [he, ne] = Ve(!1), ie = u(null), Te = u({
580
+ const [R, X] = Ce(!1), [B, k] = Ce(!1), [be, se] = Ce(!1), oe = u(null), pe = u({
544
581
  pointerId: null,
545
582
  startThumbPosition: 0,
546
583
  startClientX: 0,
547
584
  startClientY: 0,
548
585
  scale: 1,
549
586
  captureTarget: null
550
- }), xe = u({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), Le = u(r), Tt = u(n), C = u(wn), W = u(null), se = u(null), He = u(null), ce = u(0), Pe = u(0), Rt = ge(() => dn(L, X), [X, L]), re = ge(() => Ri(f), [f]), st = ge(() => $n(T, A), [T, A]), vt = Ti(st, f), ve = ge(() => new Intl.NumberFormat(Hn(T), { style: "percent", maximumFractionDigits: 0 }), [T]), Ke = !l, {
551
- enabled: Ae,
587
+ }), xe = u({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), ke = u(r), je = u(n), C = u(wn), K = u(null), ee = u(null), He = u(null), ce = u(0), Pe = u(0), Rt = ge(() => dn(_, F), [F, _]), ne = ge(() => Ri(f), [f]), st = ge(() => $n($, I), [$, I]), wt = Ti(st, f), we = ge(() => new Intl.NumberFormat(Hn($), { style: "percent", maximumFractionDigits: 0 }), [$]), Ke = !l, {
588
+ enabled: Ve,
552
589
  size: Ze,
553
590
  offsetX: Qe,
554
591
  offsetY: Vt,
555
- className: we,
592
+ className: Se,
556
593
  maxVisualDistance: yt,
557
594
  maxSpeedMultiplier: $e,
558
595
  minSpeedMultiplier: D,
559
596
  opacity: ot,
560
- renderVisual: z,
561
- maxSpeedCurve: dt
562
- } = Rt, O = u({
597
+ renderVisual: A,
598
+ maxSpeedCurve: ft
599
+ } = Rt, z = u({
563
600
  viewportSize: e,
564
601
  maxScrollPosition: Math.max(t - e, 0),
565
602
  scrollBarVisible: t > e,
566
603
  effectiveTapMaxDistance: Math.max(yt, 1),
567
604
  tapCircleMaxSpeedMultiplier: $e,
568
605
  tapCircleMinSpeedMultiplier: D,
569
- tapCircleMaxSpeedCurve: dt,
570
- tapScrollCircleOptions: L,
606
+ tapCircleMaxSpeedCurve: ft,
607
+ tapScrollCircleOptions: _,
571
608
  effectiveTrackLength: 0,
572
609
  onScroll: n,
573
610
  scrollPosition: r
574
- }), { mainSizeKey: Ee, crossSizeKey: ft, thumbTranslateFunction: H, selectDelta: ht, getPointerCoordinate: At, arrowIcons: y, directionClass: $t, orientation: pt } = re, Xe = Math.max(yt, 1), wt = e / t, Xt = Math.max(e - M * 2, 0), v = wt * Xt, Y = Math.min(Math.max(xn, v || 0), Xt || xn), ee = Math.max(t - e, 0), le = Ke ? void 0 : ve.format(mi(r, ee)), oe = Math.max(Xt - Y, 0), Ne = ee <= 0 || oe <= 0 ? 0 : te(r / ee * oe, 0, oe), Re = Ne + Y / 2, { ratio: Se, attach: at } = Fn("[ScrollBar] the thumb"), Be = Se === null ? Ne : _n(Ne, Se, "none"), U = t > e || P, mt = U && a;
575
- je(() => {
576
- O.current = {
611
+ }), { mainSizeKey: Ae, crossSizeKey: ht, thumbTranslateFunction: H, selectDelta: pt, getPointerCoordinate: At, arrowIcons: y, directionClass: Ht, orientation: mt } = ne, Xe = Math.max(yt, 1), St = e / t, $t = Math.max(e - S * 2, 0), v = St * $t, Y = Math.min(Math.max(vn, v || 0), $t || vn), te = Math.max(t - e, 0), le = Ke ? void 0 : we.format(mi(r, te)), ae = Math.max($t - Y, 0), Ee = te <= 0 || ae <= 0 ? 0 : re(r / te * ae, 0, ae), Te = Ee + Y / 2, { ratio: Me, attach: at } = Fn("[ScrollBar] the thumb"), Be = Me === null ? Ee : _n(Ee, Me, "none"), U = t > e || R, gt = U && a;
612
+ We(() => {
613
+ z.current = {
577
614
  viewportSize: e,
578
- maxScrollPosition: ee,
615
+ maxScrollPosition: te,
579
616
  scrollBarVisible: U,
580
617
  effectiveTapMaxDistance: Xe,
581
618
  tapCircleMaxSpeedMultiplier: $e,
582
619
  tapCircleMinSpeedMultiplier: D,
583
- tapCircleMaxSpeedCurve: dt,
584
- tapScrollCircleOptions: L,
585
- effectiveTrackLength: oe,
620
+ tapCircleMaxSpeedCurve: ft,
621
+ tapScrollCircleOptions: _,
622
+ effectiveTrackLength: ae,
586
623
  onScroll: n,
587
624
  scrollPosition: r
588
625
  };
589
- }), je(() => {
590
- Le.current = r;
591
- }, [r]), je(() => {
592
- Tt.current = n;
593
- }, [n]), q(() => {
594
- i || _(!1);
626
+ }), We(() => {
627
+ ke.current = r;
628
+ }, [r]), We(() => {
629
+ je.current = n;
630
+ }, [n]), W(() => {
631
+ i || k(!1);
595
632
  }, [i]);
596
- const be = yi({ isDragging: P, isThumbHovered: $, enableThumbDrag: i }), ye = p((d, E) => {
597
- const k = O.current, ue = E ?? Le.current;
598
- if (Tt.current) {
599
- const Fe = Tt.current(d, ue);
600
- if (typeof Fe == "number" && Number.isFinite(Fe))
601
- return Le.current = Fe, Fe;
633
+ const ve = yi({ isDragging: R, isThumbHovered: B, enableThumbDrag: i }), Re = p((d, E) => {
634
+ const O = z.current, ue = E ?? ke.current;
635
+ if (je.current) {
636
+ const Oe = je.current(d, ue);
637
+ if (typeof Oe == "number" && Number.isFinite(Oe))
638
+ return ke.current = Oe, Oe;
602
639
  }
603
- const ze = typeof d == "function" ? d(ue) : d, tt = Math.max(k.maxScrollPosition, 0), de = k.scrollBarVisible ? te(ze, 0, tt) : 0;
604
- return Le.current = de, de;
605
- }, []), _e = p(
640
+ const De = typeof d == "function" ? d(ue) : d, tt = Math.max(O.maxScrollPosition, 0), de = O.scrollBarVisible ? re(De, 0, tt) : 0;
641
+ return ke.current = de, de;
642
+ }, []), Le = p(
606
643
  (d) => {
607
- const E = O.current, k = Le.current;
644
+ const E = z.current, O = ke.current;
608
645
  if (!E.scrollBarVisible || E.maxScrollPosition <= 0) {
609
- const jt = ye(0, k), It = jt - k;
646
+ const jt = Re(0, O), It = jt - O;
610
647
  return { nextPosition: jt, actualDelta: It, reachedBoundary: !0 };
611
648
  }
612
649
  if (d === 0)
613
- return { nextPosition: k, actualDelta: 0, reachedBoundary: !1 };
614
- const ze = ye((jt) => te(jt + d, 0, E.maxScrollPosition), k), tt = ze - k, de = d < 0 && k + d <= 0, Fe = d > 0 && k + d >= E.maxScrollPosition, bt = d < 0 && (ze <= 0 || de && tt === 0) || d > 0 && (ze >= E.maxScrollPosition || Fe && tt === 0);
615
- return { nextPosition: ze, actualDelta: tt, reachedBoundary: bt };
650
+ return { nextPosition: O, actualDelta: 0, reachedBoundary: !1 };
651
+ const De = Re((jt) => re(jt + d, 0, E.maxScrollPosition), O), tt = De - O, de = d < 0 && O + d <= 0, Oe = d > 0 && O + d >= E.maxScrollPosition, vt = d < 0 && (De <= 0 || de && tt === 0) || d > 0 && (De >= E.maxScrollPosition || Oe && tt === 0);
652
+ return { nextPosition: De, actualDelta: tt, reachedBoundary: vt };
616
653
  },
617
- [ye]
654
+ [Re]
618
655
  ), Et = p(
619
656
  (d, E) => {
620
657
  d.current += E;
621
- const k = Math.max(O.current.maxScrollPosition, 0);
622
- k > 0 && (d.current = te(d.current, -k, k));
623
- const ue = _e(d.current);
658
+ const O = Math.max(z.current.maxScrollPosition, 0);
659
+ O > 0 && (d.current = re(d.current, -O, O));
660
+ const ue = Le(d.current);
624
661
  return d.current -= ue.actualDelta, ue.reachedBoundary && (d.current = 0), ue;
625
662
  },
626
- [_e]
627
- ), We = p(() => {
628
- se.current !== null && (window.cancelAnimationFrame(se.current), se.current = null), He.current = null, ce.current = 0, Pe.current = 0;
663
+ [Le]
664
+ ), Ue = p(() => {
665
+ ee.current !== null && (window.cancelAnimationFrame(ee.current), ee.current = null), He.current = null, ce.current = 0, Pe.current = 0;
629
666
  }, []), qe = p(() => {
630
- C.current = { ...wn }, ne(!1), W.current?.reset(), We();
631
- }, [We]), Je = p(
667
+ C.current = { ...wn }, se(!1), K.current?.reset(), Ue();
668
+ }, [Ue]), Je = p(
632
669
  (d) => {
633
- const E = C.current, k = O.current;
670
+ const E = C.current, O = z.current;
634
671
  if (!E.active || E.direction === 0) {
635
- We();
672
+ Ue();
636
673
  return;
637
674
  }
638
- if (!k.scrollBarVisible || k.maxScrollPosition <= 0) {
639
- We();
675
+ if (!O.scrollBarVisible || O.maxScrollPosition <= 0) {
676
+ Ue();
640
677
  return;
641
678
  }
642
- const ue = He.current ?? d, ze = Math.max((d - ue) / 1e3, 0), tt = Math.min(ze, Wn);
679
+ const ue = He.current ?? d, De = Math.max((d - ue) / 1e3, 0), tt = Math.min(De, Wn);
643
680
  if (He.current = d, tt <= 0) {
644
- se.current = window.requestAnimationFrame(Je);
681
+ ee.current = window.requestAnimationFrame(Je);
645
682
  return;
646
683
  }
647
684
  const de = fn({
648
685
  distance: E.distance,
649
- maxDistance: k.effectiveTapMaxDistance,
650
- viewportSize: k.viewportSize,
651
- minSpeedMultiplier: k.tapCircleMinSpeedMultiplier,
652
- maxSpeedMultiplier: k.tapCircleMaxSpeedMultiplier,
653
- hasCustomMaxSpeedMultiplier: typeof k.tapScrollCircleOptions?.maxSpeedMultiplier == "number",
654
- curve: k.tapCircleMaxSpeedCurve
686
+ maxDistance: O.effectiveTapMaxDistance,
687
+ viewportSize: O.viewportSize,
688
+ minSpeedMultiplier: O.tapCircleMinSpeedMultiplier,
689
+ maxSpeedMultiplier: O.tapCircleMaxSpeedMultiplier,
690
+ hasCustomMaxSpeedMultiplier: typeof O.tapScrollCircleOptions?.maxSpeedMultiplier == "number",
691
+ curve: O.tapCircleMaxSpeedCurve
655
692
  });
656
693
  Pe.current !== E.direction && (Pe.current = E.direction, ce.current = 0);
657
- const { reachedBoundary: Fe } = Et(ce, E.direction * de * tt);
658
- if (Fe) {
659
- We();
694
+ const { reachedBoundary: Oe } = Et(ce, E.direction * de * tt);
695
+ if (Oe) {
696
+ Ue();
660
697
  return;
661
698
  }
662
- se.current = window.requestAnimationFrame(Je);
699
+ ee.current = window.requestAnimationFrame(Je);
663
700
  },
664
- [Et, We]
701
+ [Et, Ue]
665
702
  ), w = p(() => {
666
- se.current === null && (He.current = null, ce.current = 0, se.current = window.requestAnimationFrame(Je));
703
+ ee.current === null && (He.current = null, ce.current = 0, ee.current = window.requestAnimationFrame(Je));
667
704
  }, [Je]);
668
- q(() => {
705
+ W(() => {
669
706
  const d = C.current;
670
707
  !d.active || d.direction === 0 || w();
671
- }, [t, e, w]), q(() => () => {
672
- We();
673
- }, [We]);
674
- const I = p(
708
+ }, [t, e, w]), W(() => () => {
709
+ Ue();
710
+ }, [Ue]);
711
+ const P = p(
675
712
  (d) => {
676
- C.current = d, ne(d.active), d.active && d.direction !== 0 ? w() : We();
713
+ C.current = d, se(d.active), d.active && d.direction !== 0 ? w() : Ue();
677
714
  },
678
- [w, We]
715
+ [w, Ue]
679
716
  );
680
- q(() => {
681
- Ae || qe();
682
- }, [qe, Ae]), q(() => {
717
+ W(() => {
718
+ Ve || qe();
719
+ }, [qe, Ve]), W(() => {
683
720
  const d = (E) => {
684
721
  const ue = E.detail?.paneId;
685
- ue && S && ue !== S || qe();
722
+ ue && M && ue !== M || qe();
686
723
  };
687
724
  return window.addEventListener(Or, d), () => {
688
725
  window.removeEventListener(Or, d);
689
726
  };
690
- }, [S, qe]), q(() => {
691
- if (!Ae)
727
+ }, [M, qe]), W(() => {
728
+ if (!Ve)
692
729
  return;
693
730
  const d = (E) => {
694
731
  if (!C.current.active || C.current.pointerId === E.pointerId)
695
732
  return;
696
- const k = E.target;
697
- if (!(k instanceof Node)) {
733
+ const O = E.target;
734
+ if (!(O instanceof Node)) {
698
735
  qe();
699
736
  return;
700
737
  }
701
- W.current?.getElement()?.contains(k) || qe();
738
+ K.current?.getElement()?.contains(O) || qe();
702
739
  };
703
740
  return document.addEventListener("pointerdown", d, !0), () => {
704
741
  document.removeEventListener("pointerdown", d, !0);
705
742
  };
706
- }, [qe, Ae]);
743
+ }, [qe, Ve]);
707
744
  const Ye = (d) => {
708
- if (!U || oe <= 0 || ee <= 0)
745
+ if (!U || ae <= 0 || te <= 0)
709
746
  return 0;
710
- const E = te(d, 0, oe);
711
- return te(E / oe * ee, 0, ee);
712
- }, Ie = p((d) => {
713
- const { scrollBarVisible: E, effectiveTrackLength: k, maxScrollPosition: ue } = O.current;
714
- if (F.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: d, trackLen: k, maxScroll: ue })), k <= 0 || ue <= 0)
747
+ const E = re(d, 0, ae);
748
+ return re(E / ae * te, 0, te);
749
+ }, ye = p((d) => {
750
+ const { scrollBarVisible: E, effectiveTrackLength: O, maxScrollPosition: ue } = z.current;
751
+ if (L.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: d, trackLen: O, maxScroll: ue })), O <= 0 || ue <= 0)
715
752
  return null;
716
- const ze = te(d, 0, k);
717
- return te(ze / k * ue, 0, ue);
718
- }, []), Ue = p((d) => Zr(d, f ? "x" : "y"), [f]), et = p(
753
+ const De = re(d, 0, O);
754
+ return re(De / O * ue, 0, ue);
755
+ }, []), Ge = p((d) => Zr(d, f ? "x" : "y"), [f]), et = p(
719
756
  (d) => {
720
- const E = Te.current;
757
+ const E = pe.current;
721
758
  if (E.pointerId !== d.pointerId)
722
759
  return;
723
- const k = d.clientX - E.startClientX, ue = d.clientY - E.startClientY, ze = ht(k, ue) / (E.scale || 1);
724
- F.debug("[ScrollBar] handleThumbPointerMove", () => ({
725
- delta: ze,
760
+ const O = d.clientX - E.startClientX, ue = d.clientY - E.startClientY, De = pt(O, ue) / (E.scale || 1);
761
+ L.debug("[ScrollBar] handleThumbPointerMove", () => ({
762
+ delta: De,
726
763
  startThumbPosition: E.startThumbPosition,
727
764
  clientY: d.clientY,
728
765
  startClientY: E.startClientY,
729
- metrics: O.current
766
+ metrics: z.current
730
767
  }));
731
- const tt = Ie(E.startThumbPosition + ze);
732
- tt !== null && ye(tt), d.cancelable && d.preventDefault();
768
+ const tt = ye(E.startThumbPosition + De);
769
+ tt !== null && Re(tt), d.cancelable && d.preventDefault();
733
770
  },
734
- [ht, Ie, ye]
735
- ), Oe = p(
771
+ [pt, ye, Re]
772
+ ), _e = p(
736
773
  (d) => {
737
- const E = Te.current;
774
+ const E = pe.current;
738
775
  if (E.pointerId === d.pointerId)
739
- if (document.removeEventListener("pointermove", et), document.removeEventListener("pointerup", Oe), document.removeEventListener("pointercancel", Oe), E.captureTarget !== null && dr(E.captureTarget, d.pointerId), Te.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, Z(!1), ie.current) {
740
- const k = ie.current.getBoundingClientRect();
741
- d.clientX >= k.left && d.clientX <= k.right && d.clientY >= k.top && d.clientY <= k.bottom || _(!1);
776
+ if (document.removeEventListener("pointermove", et), document.removeEventListener("pointerup", _e), document.removeEventListener("pointercancel", _e), E.captureTarget !== null && dr(E.captureTarget, d.pointerId), pe.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, X(!1), oe.current) {
777
+ const O = oe.current.getBoundingClientRect();
778
+ d.clientX >= O.left && d.clientX <= O.right && d.clientY >= O.top && d.clientY <= O.bottom || k(!1);
742
779
  } else
743
- _(!1);
780
+ k(!1);
744
781
  },
745
782
  [et]
746
783
  );
747
- q(() => () => {
748
- document.removeEventListener("pointermove", et), document.removeEventListener("pointerup", Oe), document.removeEventListener("pointercancel", Oe);
749
- }, [et, Oe]);
750
- const me = u(0), gt = u(0), Qt = p(
784
+ W(() => () => {
785
+ document.removeEventListener("pointermove", et), document.removeEventListener("pointerup", _e), document.removeEventListener("pointercancel", _e);
786
+ }, [et, _e]);
787
+ const me = u(0), bt = u(0), Qt = p(
751
788
  (d) => {
752
- const E = Math.max(Math.round(O.current.viewportSize / vi), xi);
753
- gt.current !== d && (gt.current = d, me.current = 0), Et(me, d * E);
789
+ const E = Math.max(Math.round(z.current.viewportSize / xi), vi);
790
+ bt.current !== d && (bt.current = d, me.current = 0), Et(me, d * E);
754
791
  },
755
792
  [Et]
756
- ), { handleArrowPointerDown: hr, handleArrowPointerUp: Ft, handleArrowKeyDown: St } = Ii({
757
- canUseArrowButtons: mt,
793
+ ), { handleArrowPointerDown: hr, handleArrowPointerUp: Ft, handleArrowKeyDown: Mt } = Ii({
794
+ canUseArrowButtons: gt,
758
795
  enableArrowButtons: a,
759
796
  keyboardOperable: !Ke,
760
797
  resetTapScroll: qe,
761
798
  scrollByStep: Qt
762
- }), zt = (d) => {
799
+ }), Dt = (d) => {
763
800
  if (!U)
764
801
  return;
765
802
  if (!i) {
@@ -769,15 +806,15 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
769
806
  if (d.pointerType === "mouse" && d.button !== 0 || d.ctrlKey)
770
807
  return;
771
808
  qe();
772
- const E = d.currentTarget, k = Ue(E), ue = _r(E, d.pointerId) === "captured" ? E : null;
773
- Te.current = {
809
+ const E = d.currentTarget, O = Ge(E), ue = _r(E, d.pointerId) === "captured" ? E : null;
810
+ pe.current = {
774
811
  pointerId: d.pointerId,
775
- startThumbPosition: Ne,
812
+ startThumbPosition: Ee,
776
813
  startClientX: d.clientX,
777
814
  startClientY: d.clientY,
778
- scale: k,
815
+ scale: O,
779
816
  captureTarget: ue
780
- }, document.addEventListener("pointermove", et), document.addEventListener("pointerup", Oe), document.addEventListener("pointercancel", Oe), Z(!0), _(!0), d.preventDefault(), d.stopPropagation();
817
+ }, document.addEventListener("pointermove", et), document.addEventListener("pointerup", _e), document.addEventListener("pointercancel", _e), X(!0), k(!0), d.preventDefault(), d.stopPropagation();
781
818
  }, Gt = (d) => {
782
819
  if (!U)
783
820
  return;
@@ -787,169 +824,169 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
787
824
  }
788
825
  if (d.pointerType === "mouse" && d.button !== 0 || d.ctrlKey)
789
826
  return;
790
- const E = d.currentTarget, k = E.getBoundingClientRect(), ue = At(d), ze = Ue(E), tt = (ue - (f ? k.left : k.top)) / ze;
827
+ const E = d.currentTarget, O = E.getBoundingClientRect(), ue = At(d), De = Ge(E), tt = (ue - (f ? O.left : O.top)) / De;
791
828
  qe();
792
- const de = tt - Y / 2, Fe = Ye(de);
793
- ye(Fe), _r(E, d.pointerId), xe.current = {
829
+ const de = tt - Y / 2, Oe = Ye(de);
830
+ Re(Oe), _r(E, d.pointerId), xe.current = {
794
831
  pointerId: d.pointerId,
795
832
  startThumbPosition: de,
796
833
  startClientX: d.clientX,
797
834
  startClientY: d.clientY,
798
- scale: ze
835
+ scale: De
799
836
  }, d.preventDefault(), d.stopPropagation();
800
- }, Dt = () => {
837
+ }, zt = () => {
801
838
  xe.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
802
839
  }, or = (d) => {
803
840
  const E = xe.current;
804
841
  if (E.pointerId !== d.pointerId)
805
842
  return;
806
843
  if (d.pointerType === "mouse" && d.buttons === 0) {
807
- Dt();
844
+ zt();
808
845
  return;
809
846
  }
810
- const k = d.clientX - E.startClientX, ue = d.clientY - E.startClientY, ze = ht(k, ue) / (E.scale || 1), tt = Ye(E.startThumbPosition + ze);
811
- ye(tt), d.cancelable && d.preventDefault();
847
+ const O = d.clientX - E.startClientX, ue = d.clientY - E.startClientY, De = pt(O, ue) / (E.scale || 1), tt = Ye(E.startThumbPosition + De);
848
+ Re(tt), d.cancelable && d.preventDefault();
812
849
  }, Ir = (d) => {
813
- xe.current.pointerId === d.pointerId && (dr(d.currentTarget, d.pointerId), Dt(), d.preventDefault(), d.stopPropagation());
850
+ xe.current.pointerId === d.pointerId && (dr(d.currentTarget, d.pointerId), zt(), d.preventDefault(), d.stopPropagation());
814
851
  }, kt = (d) => {
815
- xe.current.pointerId === d.pointerId && (dr(d.currentTarget, d.pointerId), Dt());
816
- }, xr = (d) => {
817
- d.target === d.currentTarget && xe.current.pointerId === d.pointerId && Dt();
818
- }, ar = ge(() => te((he ? 1 : 0.8) * ot, 0, 1), [he, ot]), Lt = ge(() => {
852
+ xe.current.pointerId === d.pointerId && (dr(d.currentTarget, d.pointerId), zt());
853
+ }, vr = (d) => {
854
+ d.target === d.currentTarget && xe.current.pointerId === d.pointerId && zt();
855
+ }, ar = ge(() => re((be ? 1 : 0.8) * ot, 0, 1), [be, ot]), Lt = ge(() => {
819
856
  const E = `calc(50% - ${Ze / 2}px + ${Vt}px)`;
820
857
  return {
821
858
  left: Qe,
822
859
  top: E
823
860
  };
824
- }, [Qe, Vt, Ze]), cr = (d, E, k, ue) => /* @__PURE__ */ Q(
861
+ }, [Qe, Vt, Ze]), cr = (d, E, O, ue) => /* @__PURE__ */ Z(
825
862
  "button",
826
863
  {
827
864
  type: "button",
828
865
  tabIndex: Ke ? -1 : 0,
829
866
  className: "aqvs-scrollbar-arrow-button",
830
867
  style: {
831
- [Ee]: M,
832
- [ft]: M
868
+ [Ae]: S,
869
+ [ht]: S
833
870
  },
834
871
  "aria-label": E,
835
872
  onPointerDown: hr(d),
836
873
  onPointerUp: Ft,
837
874
  onPointerLeave: Ft,
838
875
  onPointerCancel: Ft,
839
- onKeyDown: St(d),
876
+ onKeyDown: Mt(d),
840
877
  "aria-disabled": !a,
841
- disabled: !mt,
842
- children: /* @__PURE__ */ Q("span", { "aria-hidden": "true", children: k })
878
+ disabled: !gt,
879
+ children: /* @__PURE__ */ Z("span", { "aria-hidden": "true", children: O })
843
880
  },
844
881
  ue
845
- ), Bt = K && U ? {
846
- orientation: pt,
882
+ ), Xt = J && U ? {
883
+ orientation: mt,
847
884
  scrollPosition: r,
848
- maxScrollPosition: ee,
885
+ maxScrollPosition: te,
849
886
  contentSize: t,
850
887
  viewportSize: e,
851
888
  thumbSize: Y,
852
- thumbPosition: Ne,
853
- thumbCenter: Re,
854
- trackSize: Xt,
855
- isDragging: P,
856
- isTapScrollActive: he,
857
- visibleStartIndex: ae,
858
- visibleEndIndex: De
889
+ thumbPosition: Ee,
890
+ thumbCenter: Te,
891
+ trackSize: $t,
892
+ isDragging: R,
893
+ isTapScrollActive: be,
894
+ visibleStartIndex: ie,
895
+ visibleEndIndex: ze
859
896
  } : null;
860
897
  return /* @__PURE__ */ Zt(
861
898
  "div",
862
899
  {
863
- className: Ot("aqvs-scrollbar", $t, N),
900
+ className: Ot("aqvs-scrollbar", Ht, N),
864
901
  style: {
865
902
  // 自己計測ペインの縦バーはインライン主軸寸を書かない (ラチェット遮断 — ペイン仕様 §2.5)。
866
903
  // 横バーは stretch が主軸を寸法決めできないため常に書く
867
- ...g && !f ? {} : { [Ee]: e },
868
- [ft]: M
904
+ ...x && !f ? {} : { [Ae]: e },
905
+ [ht]: S
869
906
  },
870
907
  "data-visible": U ? "true" : "false",
871
908
  role: "scrollbar",
872
- "aria-label": vt.bar,
909
+ "aria-label": wt.bar,
873
910
  "aria-hidden": Ke ? !0 : void 0,
874
911
  tabIndex: Ke ? void 0 : -1,
875
912
  onPointerDown: Ke ? qn : void 0,
876
- "aria-controls": S,
913
+ "aria-controls": M,
877
914
  "aria-valuenow": r,
878
915
  "aria-valuemin": 0,
879
- "aria-valuemax": ee,
916
+ "aria-valuemax": te,
880
917
  "aria-valuetext": le,
881
918
  "aria-orientation": f ? "horizontal" : "vertical",
882
919
  children: [
883
- (!f || b) && U && Ae && /* @__PURE__ */ Q(
920
+ (!f || g) && U && Ve && /* @__PURE__ */ Z(
884
921
  mn,
885
922
  {
886
923
  axis: f ? "x" : "y",
887
- ref: W,
888
- className: Ot("aqvs-scrollbar-tap-circle-wrapper", we),
924
+ ref: K,
925
+ className: Ot("aqvs-scrollbar-tap-circle-wrapper", Se),
889
926
  size: Ze,
890
927
  maxVisualDistance: Xe,
891
928
  style: Lt,
892
929
  opacity: ar,
893
- renderVisual: z,
894
- onDragChange: I
930
+ renderVisual: A,
931
+ onDragChange: P
895
932
  },
896
933
  "tap-circle"
897
934
  ),
898
- cr(-1, vt.arrows[0], y[0], "arrow-start"),
935
+ cr(-1, wt.arrows[0], y[0], "arrow-start"),
899
936
  /* @__PURE__ */ Zt(
900
937
  "div",
901
938
  {
902
939
  className: "aqvs-scrollbar-track",
903
940
  style: {
904
- borderRadius: M / 2
941
+ borderRadius: S / 2
905
942
  },
906
943
  onPointerDown: Gt,
907
944
  onPointerMove: or,
908
945
  onPointerUp: Ir,
909
946
  onPointerCancel: kt,
910
- onLostPointerCapture: xr,
947
+ onLostPointerCapture: vr,
911
948
  "aria-disabled": !s,
912
949
  children: [
913
- Bt && /* @__PURE__ */ Q("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: K?.(Bt) }, "overlay"),
914
- /* @__PURE__ */ Q(
950
+ Xt && /* @__PURE__ */ Z("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: J?.(Xt) }, "overlay"),
951
+ /* @__PURE__ */ Z(
915
952
  "div",
916
953
  {
917
954
  ref: at,
918
955
  className: "aqvs-scrollbar-thumb-wrapper",
919
956
  style: {
920
- [Ee]: Y,
957
+ [Ae]: Y,
921
958
  top: 0,
922
959
  left: 0,
923
960
  ...f ? { bottom: 0 } : { right: 0 },
924
961
  transform: `${H}(${Be}px)`
925
962
  },
926
- "data-visible": U || P ? "true" : "false",
927
- onPointerDown: zt,
963
+ "data-visible": U || R ? "true" : "false",
964
+ onPointerDown: Dt,
928
965
  role: "slider",
929
- "aria-label": vt.thumb,
966
+ "aria-label": wt.thumb,
930
967
  "aria-orientation": f ? "horizontal" : "vertical",
931
968
  "aria-valuenow": r,
932
969
  "aria-valuemin": 0,
933
- "aria-valuemax": ee,
970
+ "aria-valuemax": te,
934
971
  "aria-valuetext": le,
935
972
  "aria-disabled": !i,
936
973
  tabIndex: Ke ? void 0 : -1,
937
- children: /* @__PURE__ */ Q(
974
+ children: /* @__PURE__ */ Z(
938
975
  "div",
939
976
  {
940
- ref: ie,
977
+ ref: oe,
941
978
  className: Ot("aqvs-scrollbar-thumb", f ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
942
979
  "data-testid": "aqvs-scrollbar-thumb",
943
- "data-thumb-state": be,
980
+ "data-thumb-state": ve,
944
981
  style: {
945
- borderRadius: M - 1,
982
+ borderRadius: S - 1,
946
983
  cursor: i ? "pointer" : "default"
947
984
  },
948
985
  onMouseEnter: () => {
949
- i && _(!0);
986
+ i && k(!0);
950
987
  },
951
988
  onMouseLeave: () => {
952
- i && _(!1);
989
+ i && k(!1);
953
990
  }
954
991
  },
955
992
  "thumb"
@@ -961,7 +998,7 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
961
998
  },
962
999
  "track"
963
1000
  ),
964
- cr(1, vt.arrows[1], y[1], "arrow-end")
1001
+ cr(1, wt.arrows[1], y[1], "arrow-end")
965
1002
  ]
966
1003
  }
967
1004
  );
@@ -977,7 +1014,7 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
977
1014
  maxSpeedMultiplier: n.maxSpeedMultiplier,
978
1015
  hasCustomMaxSpeedMultiplier: n.hasCustomMaxSpeedMultiplier,
979
1016
  curve: n.curve
980
- }), b = fn({
1017
+ }), g = fn({
981
1018
  distance: l,
982
1019
  maxDistance: r,
983
1020
  viewportSize: i.viewportSize,
@@ -986,13 +1023,19 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
986
1023
  hasCustomMaxSpeedMultiplier: i.hasCustomMaxSpeedMultiplier,
987
1024
  curve: i.curve
988
1025
  });
989
- return { x: f * s / l, y: b * a / l };
1026
+ return { x: f * s / l, y: g * a / l };
990
1027
  }, ls = (t) => {
991
1028
  const { quantum: e, resetOnDirectionChange: r = !0 } = t;
992
1029
  if (!(Number.isFinite(e) && e > 0))
993
1030
  throw new TypeError(`[createResidualQuantizer] quantum must be a finite positive number, received ${e}`);
994
1031
  let n = 0;
995
1032
  return {
1033
+ /**
1034
+ * Adds a delta to the residue and emits the whole quanta it holds (a non-finite delta, or one beyond
1035
+ * `Number.MAX_SAFE_INTEGER`, emits 0 and leaves the residue as it is).
1036
+ * 差分を残差へ足し、残差が持つ量子の整数倍を放出する処理 (非有限の差分と `Number.MAX_SAFE_INTEGER` を越える差分は 0 を放出し、
1037
+ * 残差を変えない)。
1038
+ */
996
1039
  push: (i) => {
997
1040
  if (!Number.isFinite(i) || Math.abs(i) > Number.MAX_SAFE_INTEGER)
998
1041
  return 0;
@@ -1000,7 +1043,15 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
1000
1043
  const s = Math.trunc(n / e) * e + 0;
1001
1044
  return n -= s, s;
1002
1045
  },
1046
+ /**
1047
+ * Reads the residue not yet emitted.
1048
+ * まだ放出していない残差を読む処理。
1049
+ */
1003
1050
  peekResidue: () => n,
1051
+ /**
1052
+ * Drops the residue.
1053
+ * 残差を捨てる処理。
1054
+ */
1004
1055
  reset: () => {
1005
1056
  n = 0;
1006
1057
  }
@@ -1019,7 +1070,7 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
1019
1070
  };
1020
1071
  }, Gn = /* @__PURE__ */ new WeakSet(), Mn = (t) => {
1021
1072
  Gn.add(t);
1022
- }, Ai = (t) => Gn.has(t), zi = ["mouse", "pen", "touch"], sn = (t, e) => !(t === "mouse" || t === "pen" || t === "touch") || e.includes(t), Di = (t) => t === "mouse" || t === "pen", zr = {
1073
+ }, Ai = (t) => Gn.has(t), Di = ["mouse", "pen", "touch"], sn = (t, e) => !(t === "mouse" || t === "pen" || t === "touch") || e.includes(t), zi = (t) => t === "mouse" || t === "pen", Dr = {
1023
1074
  maxVelocity: 6,
1024
1075
  minVelocity: 0.02,
1025
1076
  deceleration: 25e-4,
@@ -1039,36 +1090,36 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
1039
1090
  enableTrackClick: a = !0,
1040
1091
  enableArrowButtons: l = !0,
1041
1092
  enableArrowButtonTabStops: f = !0,
1042
- enablePointerDrag: b = !0,
1043
- pointerDragInputs: g = zi,
1044
- onScroll: M,
1093
+ enablePointerDrag: g = !0,
1094
+ pointerDragInputs: x = Di,
1095
+ onScroll: S,
1045
1096
  className: N,
1046
- testId: S,
1047
- style: L,
1048
- background: X,
1049
- tapScrollCircleOptions: K,
1050
- inertiaOptions: ae,
1051
- itemCount: De,
1052
- renderThumbOverlay: T,
1053
- wheelSpeedMultiplier: A = 1,
1054
- overscrollBehavior: P = "auto",
1055
- onWheelHorizontal: Z,
1056
- onPanHorizontal: $,
1057
- contentInsets: _,
1058
- visibleStartIndex: he,
1059
- visibleEndIndex: ne,
1060
- renderOverlay: ie,
1061
- initialScrollPosition: Te = 0,
1097
+ testId: M,
1098
+ style: _,
1099
+ background: F,
1100
+ tapScrollCircleOptions: J,
1101
+ inertiaOptions: ie,
1102
+ itemCount: ze,
1103
+ renderThumbOverlay: $,
1104
+ wheelSpeedMultiplier: I = 1,
1105
+ overscrollBehavior: R = "auto",
1106
+ onWheelHorizontal: X,
1107
+ onPanHorizontal: B,
1108
+ contentInsets: k,
1109
+ visibleStartIndex: be,
1110
+ visibleEndIndex: se,
1111
+ renderOverlay: oe,
1112
+ initialScrollPosition: pe = 0,
1062
1113
  contentProps: xe,
1063
- locale: Le,
1064
- labels: Tt
1114
+ locale: ke,
1115
+ labels: je
1065
1116
  }, C) => {
1066
- const W = u(Number.isFinite(Te) ? Math.max(0, Te) : 0), se = u(null), He = u(null), ce = r === void 0, [Pe, Rt] = Ve(0), re = r ?? Pe, st = u(null), vt = u(e), ve = u(!1), Ke = p(() => {
1067
- !ve.current || vt.current <= 0 || st.current === "zero" || (st.current = "zero", F.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."));
1117
+ const K = u(Number.isFinite(pe) ? Math.max(0, pe) : 0), ee = u(null), He = u(null), ce = r === void 0, [Pe, Rt] = Ce(0), ne = r ?? Pe, st = u(null), wt = u(e), we = u(!1), Ke = p(() => {
1118
+ !we.current || wt.current <= 0 || st.current === "zero" || (st.current = "zero", L.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."));
1068
1119
  }, []);
1069
- je(() => {
1070
- vt.current = e, Ke();
1071
- }, [e, Ke]), je(() => {
1120
+ We(() => {
1121
+ wt.current = e, Ke();
1122
+ }, [e, Ke]), We(() => {
1072
1123
  if (!ce)
1073
1124
  return;
1074
1125
  const v = He.current;
@@ -1077,48 +1128,48 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
1077
1128
  const Y = () => {
1078
1129
  const le = v.offsetHeight;
1079
1130
  if (le > 0) {
1080
- ve.current = !1, Rt((oe) => oe === le ? oe : le);
1131
+ we.current = !1, Rt((ae) => ae === le ? ae : le);
1081
1132
  return;
1082
1133
  }
1083
- ve.current = v.offsetParent !== null, Ke();
1134
+ we.current = v.offsetParent !== null, Ke();
1084
1135
  };
1085
1136
  Y();
1086
- const ee = typeof ResizeObserver == "function" ? new ResizeObserver(Y) : null;
1087
- return ee?.observe(v), () => {
1088
- ee?.disconnect(), ve.current = !1;
1137
+ const te = typeof ResizeObserver == "function" ? new ResizeObserver(Y) : null;
1138
+ return te?.observe(v), () => {
1139
+ te?.disconnect(), we.current = !1;
1089
1140
  };
1090
- }, [ce, Ke]), je(() => {
1141
+ }, [ce, Ke]), We(() => {
1091
1142
  ce && n?.(Pe);
1092
- }, [ce, Pe, n]), je(() => {
1143
+ }, [ce, Pe, n]), We(() => {
1093
1144
  if (ce)
1094
1145
  return;
1095
- const v = se.current;
1146
+ const v = ee.current;
1096
1147
  if (!v)
1097
1148
  return;
1098
1149
  const Y = () => {
1099
1150
  const le = v.clientHeight;
1100
- if (le <= 0 || Math.abs(le - re) <= 1)
1151
+ if (le <= 0 || Math.abs(le - ne) <= 1)
1101
1152
  return;
1102
- const oe = `${re}/${le}`;
1103
- st.current !== oe && (st.current = oe, F.warn(
1104
- `[ScrollPane] viewportSize=${re} but the host band is ${le}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.`
1153
+ const ae = `${ne}/${le}`;
1154
+ st.current !== ae && (st.current = ae, L.warn(
1155
+ `[ScrollPane] viewportSize=${ne} but the host band is ${le}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.`
1105
1156
  ));
1106
1157
  };
1107
1158
  if (Y(), typeof ResizeObserver != "function")
1108
1159
  return;
1109
- const ee = new ResizeObserver(Y);
1110
- return ee.observe(v), () => {
1111
- ee.disconnect();
1160
+ const te = new ResizeObserver(Y);
1161
+ return te.observe(v), () => {
1162
+ te.disconnect();
1112
1163
  };
1113
- }, [ce, re]);
1114
- const Ae = u(Z);
1115
- q(() => {
1116
- Ae.current = Z;
1117
- }, [Z]);
1118
- const Ze = u($);
1119
- q(() => {
1120
- Ze.current = $;
1121
- }, [$]);
1164
+ }, [ce, ne]);
1165
+ const Ve = u(X);
1166
+ W(() => {
1167
+ Ve.current = X;
1168
+ }, [X]);
1169
+ const Ze = u(B);
1170
+ W(() => {
1171
+ Ze.current = B;
1172
+ }, [B]);
1122
1173
  const Qe = u({
1123
1174
  frame: null,
1124
1175
  velocity: 0,
@@ -1126,161 +1177,177 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
1126
1177
  generation: 0
1127
1178
  }), Vt = ge(
1128
1179
  () => ({
1129
- maxVelocity: ae?.maxVelocity ?? zr.maxVelocity,
1130
- minVelocity: ae?.minVelocity ?? zr.minVelocity,
1131
- deceleration: ae?.deceleration ?? zr.deceleration,
1132
- velocitySampleWindow: ae?.velocitySampleWindow ?? zr.velocitySampleWindow,
1133
- startVelocityThreshold: ae?.startVelocityThreshold ?? zr.startVelocityThreshold
1180
+ maxVelocity: ie?.maxVelocity ?? Dr.maxVelocity,
1181
+ minVelocity: ie?.minVelocity ?? Dr.minVelocity,
1182
+ deceleration: ie?.deceleration ?? Dr.deceleration,
1183
+ velocitySampleWindow: ie?.velocitySampleWindow ?? Dr.velocitySampleWindow,
1184
+ startVelocityThreshold: ie?.startVelocityThreshold ?? Dr.startVelocityThreshold
1134
1185
  }),
1135
- [ae]
1136
- ), we = ge(() => ({
1137
- top: Math.max(0, _?.top ?? 0),
1138
- bottom: Math.max(0, _?.bottom ?? 0)
1139
- }), [_]);
1140
- F.debug("[ScrollPane] ScrollPane rendered", () => ({
1186
+ [ie]
1187
+ ), Se = ge(() => ({
1188
+ top: Math.max(0, k?.top ?? 0),
1189
+ bottom: Math.max(0, k?.bottom ?? 0)
1190
+ }), [k]);
1191
+ L.debug("[ScrollPane] ScrollPane rendered", () => ({
1141
1192
  contentSize: e,
1142
- viewportSize: re,
1193
+ viewportSize: ne,
1143
1194
  scrollBarWidth: i,
1144
1195
  className: N,
1145
- style: L,
1146
- tapScrollCircleOptions: K,
1147
- inertiaOptions: ae,
1148
- enablePointerDrag: b,
1149
- contentInsets: we
1196
+ style: _,
1197
+ tapScrollCircleOptions: J,
1198
+ inertiaOptions: ie,
1199
+ enablePointerDrag: g,
1200
+ contentInsets: Se
1150
1201
  }));
1151
- const yt = u({ contentSize: e, viewportSize: re }), $e = ge(() => e > re, [e, re]), D = p(
1202
+ const yt = u({ contentSize: e, viewportSize: ne }), $e = ge(() => e > ne, [e, ne]), D = p(
1152
1203
  (v, Y) => {
1153
- let ee = Y ?? yt.current;
1154
- Y && !(Number.isFinite(Y.contentSize) && Number.isFinite(Y.viewportSize)) && (F.warn("[ScrollPane] scrollTo received non-finite dimsOverride; falling back to the committed dims", { dimsOverride: Y }), ee = yt.current);
1155
- const { contentSize: le, viewportSize: oe } = ee, Ne = le > oe, Re = W.current;
1156
- if (F.debug("[ScrollPane] scrollTo called", () => ({ newPosition: v, contentSize: le, viewportSize: oe, currentIsScrollable: Ne, prevPosition: Re })), !Ne)
1157
- return W.current !== 0 && (W.current = 0, M?.(0, Re)), W.current;
1158
- const Se = typeof v == "function" ? v(W.current) : v;
1159
- if (!Number.isFinite(Se))
1160
- return F.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: Se }), W.current;
1161
- const at = Math.max(le - oe, 0), Be = te(Se, 0, at);
1162
- return W.current !== Be && (W.current = Be, M?.(Be, Re)), W.current;
1204
+ let te = Y ?? yt.current;
1205
+ Y && !(Number.isFinite(Y.contentSize) && Number.isFinite(Y.viewportSize)) && (L.warn("[ScrollPane] scrollTo received non-finite dimsOverride; falling back to the committed dims", { dimsOverride: Y }), te = yt.current);
1206
+ const { contentSize: le, viewportSize: ae } = te, Ee = le > ae, Te = K.current;
1207
+ if (L.debug("[ScrollPane] scrollTo called", () => ({ newPosition: v, contentSize: le, viewportSize: ae, currentIsScrollable: Ee, prevPosition: Te })), !Ee)
1208
+ return K.current !== 0 && (K.current = 0, S?.(0, Te)), K.current;
1209
+ const Me = typeof v == "function" ? v(K.current) : v;
1210
+ if (!Number.isFinite(Me))
1211
+ return L.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: Me }), K.current;
1212
+ const at = Math.max(le - ae, 0), Be = re(Me, 0, at);
1213
+ return K.current !== Be && (K.current = Be, S?.(Be, Te)), K.current;
1163
1214
  },
1164
- [M]
1215
+ [S]
1165
1216
  ), ot = u(D);
1166
- q(() => {
1217
+ W(() => {
1167
1218
  ot.current = D;
1168
1219
  }, [D]);
1169
- const z = p(() => {
1220
+ const A = p(() => {
1170
1221
  const v = Qe.current;
1171
1222
  v.generation += 1, v.frame !== null && cancelAnimationFrame(v.frame), v.frame = null, v.velocity = 0, v.lastTimestamp = null;
1172
- }, []), dt = u(z);
1173
- q(() => {
1174
- dt.current = z;
1175
- }, [z]), q(() => () => {
1176
- dt.current();
1223
+ }, []), ft = u(A);
1224
+ W(() => {
1225
+ ft.current = A;
1226
+ }, [A]), W(() => () => {
1227
+ ft.current();
1177
1228
  }, []);
1178
- const O = p(
1229
+ const z = p(
1179
1230
  (v) => {
1180
1231
  if (!$e)
1181
1232
  return;
1182
- const { maxVelocity: Y, minVelocity: ee, deceleration: le, startVelocityThreshold: oe } = Vt, Ne = te(v, -Y, Y);
1183
- if (Math.abs(Ne) < oe)
1233
+ const { maxVelocity: Y, minVelocity: te, deceleration: le, startVelocityThreshold: ae } = Vt, Ee = re(v, -Y, Y);
1234
+ if (Math.abs(Ee) < ae)
1184
1235
  return;
1185
- z(), Qe.current.velocity = Ne, Qe.current.lastTimestamp = null;
1186
- const Re = Qe.current.generation, Se = (at) => {
1236
+ A(), Qe.current.velocity = Ee, Qe.current.lastTimestamp = null;
1237
+ const Te = Qe.current.generation, Me = (at) => {
1187
1238
  const Be = Qe.current;
1188
- if (Be.generation !== Re)
1239
+ if (Be.generation !== Te)
1189
1240
  return;
1190
1241
  if (Be.lastTimestamp === null) {
1191
- Be.lastTimestamp = at, Be.frame = requestAnimationFrame(Se);
1242
+ Be.lastTimestamp = at, Be.frame = requestAnimationFrame(Me);
1192
1243
  return;
1193
1244
  }
1194
1245
  const U = at - Be.lastTimestamp;
1195
1246
  if (Be.lastTimestamp = at, U <= 0) {
1196
- Be.frame = requestAnimationFrame(Se);
1247
+ Be.frame = requestAnimationFrame(Me);
1197
1248
  return;
1198
1249
  }
1199
- const mt = Be.velocity;
1200
- let be = mt;
1201
- const ye = le * U;
1202
- mt > 0 ? be = Math.max(0, mt - ye) : mt < 0 && (be = Math.min(0, mt + ye));
1203
- const Et = (mt + be) / 2 * U, We = W.current;
1204
- if (Et !== 0 && ot.current((Ie) => Ie + Et), Qe.current.generation !== Re)
1250
+ const gt = Be.velocity;
1251
+ let ve = gt;
1252
+ const Re = le * U;
1253
+ gt > 0 ? ve = Math.max(0, gt - Re) : gt < 0 && (ve = Math.min(0, gt + Re));
1254
+ const Et = (gt + ve) / 2 * U, Ue = K.current;
1255
+ if (Et !== 0 && ot.current((ye) => ye + Et), Qe.current.generation !== Te)
1205
1256
  return;
1206
- const qe = W.current, { contentSize: Je, viewportSize: w } = yt.current, I = Math.max(Je - w, 0);
1207
- Be.velocity = be;
1208
- const Ye = qe === We || qe <= 0 && be <= 0 || qe >= I && be >= 0;
1209
- if (Math.abs(be) < ee || Ye) {
1210
- z();
1257
+ const qe = K.current, { contentSize: Je, viewportSize: w } = yt.current, P = Math.max(Je - w, 0);
1258
+ Be.velocity = ve;
1259
+ const Ye = qe === Ue || qe <= 0 && ve <= 0 || qe >= P && ve >= 0;
1260
+ if (Math.abs(ve) < te || Ye) {
1261
+ A();
1211
1262
  return;
1212
1263
  }
1213
- Be.frame = requestAnimationFrame(Se);
1264
+ Be.frame = requestAnimationFrame(Me);
1214
1265
  };
1215
- Qe.current.frame = requestAnimationFrame(Se);
1266
+ Qe.current.frame = requestAnimationFrame(Me);
1216
1267
  },
1217
- [$e, Vt, z]
1218
- ), Ee = u(O);
1219
- q(() => {
1220
- Ee.current = O;
1221
- }, [O]), je(() => {
1222
- yt.current = { contentSize: e, viewportSize: re };
1223
- }, [e, re]), je(() => {
1268
+ [$e, Vt, A]
1269
+ ), Ae = u(z);
1270
+ W(() => {
1271
+ Ae.current = z;
1272
+ }, [z]), We(() => {
1273
+ yt.current = { contentSize: e, viewportSize: ne };
1274
+ }, [e, ne]), We(() => {
1224
1275
  const v = He.current;
1225
1276
  if (!v) return;
1226
1277
  const Y = () => {
1227
- v.scrollTop !== 0 && (F.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: v.scrollTop })), v.scrollTop = 0), v.scrollLeft !== 0 && (v.scrollLeft = 0);
1278
+ v.scrollTop !== 0 && (L.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: v.scrollTop })), v.scrollTop = 0), v.scrollLeft !== 0 && (v.scrollLeft = 0);
1228
1279
  };
1229
1280
  return v.addEventListener("scroll", Y), () => v.removeEventListener("scroll", Y);
1230
- }, []), je(() => {
1281
+ }, []), We(() => {
1231
1282
  if ($e) {
1232
- F.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: e, viewportSize: re, scrollPosition: W.current }));
1233
- const v = te(e - re, 0, e);
1234
- W.current > v && D(v);
1283
+ L.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: e, viewportSize: ne, scrollPosition: K.current }));
1284
+ const v = re(e - ne, 0, e);
1285
+ K.current > v && D(v);
1235
1286
  } else
1236
1287
  D(0);
1237
- }, [$e, D, e, re]);
1238
- const ft = u({ isScrollable: $e, viewportSize: re, wheelSpeedMultiplier: A, overscrollBehavior: P });
1239
- je(() => {
1240
- ft.current = { isScrollable: $e, viewportSize: re, wheelSpeedMultiplier: A, overscrollBehavior: P };
1241
- }, [$e, re, A, P]);
1288
+ }, [$e, D, e, ne]);
1289
+ const ht = u({ isScrollable: $e, viewportSize: ne, wheelSpeedMultiplier: I, overscrollBehavior: R });
1290
+ We(() => {
1291
+ ht.current = { isScrollable: $e, viewportSize: ne, wheelSpeedMultiplier: I, overscrollBehavior: R };
1292
+ }, [$e, ne, I, R]);
1242
1293
  const H = p(
1243
1294
  (v) => {
1244
1295
  if (Ai(v))
1245
1296
  return !1;
1246
- const { isScrollable: Y, viewportSize: ee, wheelSpeedMultiplier: le, overscrollBehavior: oe } = ft.current, Ne = Vi(v, ee);
1247
- if (Ne.isZoomGesture)
1297
+ const { isScrollable: Y, viewportSize: te, wheelSpeedMultiplier: le, overscrollBehavior: ae } = ht.current, Ee = Vi(v, te);
1298
+ if (Ee.isZoomGesture)
1248
1299
  return !1;
1249
- if (Ne.isHorizontalDominant)
1250
- return Ae.current ? (Mn(v), v.preventDefault(), z(), Ae.current(Ne.horizontalDelta), !0) : !1;
1251
- if (!Y || Ne.verticalDelta === 0)
1300
+ if (Ee.isHorizontalDominant)
1301
+ return Ve.current ? (Mn(v), v.preventDefault(), A(), Ve.current(Ee.horizontalDelta), !0) : !1;
1302
+ if (!Y || Ee.verticalDelta === 0)
1252
1303
  return !1;
1253
- let Re = Ne.verticalDelta;
1254
- if (le !== 1 && (Re *= le), oe !== "contain") {
1255
- const Se = W.current, at = Math.max(yt.current.contentSize - ee, 0);
1256
- if (Re > 0 && Se >= at || Re < 0 && Se <= 0)
1304
+ let Te = Ee.verticalDelta;
1305
+ if (le !== 1 && (Te *= le), ae !== "contain") {
1306
+ const Me = K.current, at = Math.max(yt.current.contentSize - te, 0);
1307
+ if (Te > 0 && Me >= at || Te < 0 && Me <= 0)
1257
1308
  return !1;
1258
1309
  }
1259
- return Mn(v), v.preventDefault(), z(), F.debug("[ScrollPane] wheel event", () => ({ deltaY: Re, scrollPosition: W.current, wheelSpeedMultiplier: le, deltaMode: v.deltaMode, scrollTop: He.current?.scrollTop })), D((Se) => Se + Re), !0;
1310
+ return Mn(v), v.preventDefault(), A(), L.debug("[ScrollPane] wheel event", () => ({ deltaY: Te, scrollPosition: K.current, wheelSpeedMultiplier: le, deltaMode: v.deltaMode, scrollTop: He.current?.scrollTop })), D((Me) => Me + Te), !0;
1260
1311
  },
1261
- [D, z]
1312
+ [D, A]
1262
1313
  );
1263
- q(() => {
1314
+ W(() => {
1264
1315
  const v = (le) => {
1265
1316
  H(le);
1266
1317
  }, Y = () => {
1267
- z();
1268
- }, ee = se.current;
1269
- return ee && (ee.addEventListener("wheel", v, { passive: !1 }), ee.addEventListener("pointerdown", Y, { capture: !0, passive: !0 })), () => {
1270
- ee && (ee.removeEventListener("wheel", v), ee.removeEventListener("pointerdown", Y, { capture: !0 }));
1318
+ A();
1319
+ }, te = ee.current;
1320
+ return te && (te.addEventListener("wheel", v, { passive: !1 }), te.addEventListener("pointerdown", Y, { capture: !0, passive: !0 })), () => {
1321
+ te && (te.removeEventListener("wheel", v), te.removeEventListener("pointerdown", Y, { capture: !0 }));
1271
1322
  };
1272
- }, [H, z]), Jr(
1323
+ }, [H, A]), Jr(
1273
1324
  C,
1274
1325
  () => ({
1275
- scrollTo: (v, Y) => (z(), D(v, Y)),
1276
- getScrollPosition: () => W.current,
1326
+ /**
1327
+ * Stops any inertia, then jumps to a pane position (clamped); returns the applied position.
1328
+ * 慣性を止めてからペインの位置へ跳ぶ (クランプする) 処理。当てた位置を返す。
1329
+ */
1330
+ scrollTo: (v, Y) => (A(), D(v, Y)),
1331
+ /**
1332
+ * Reads the pane position (synchronously fresh, from the position ref).
1333
+ * ペインの位置を読む処理 (位置の ref から読むので同期で最新)。
1334
+ */
1335
+ getScrollPosition: () => K.current,
1336
+ /**
1337
+ * Reads the content size the pane was given.
1338
+ * ペインが受け取った中身の寸法を読む処理。
1339
+ */
1277
1340
  getContentSize: () => e,
1278
- getViewportSize: () => re,
1341
+ /**
1342
+ * Reads the viewport size the pane uses (given or measured).
1343
+ * ペインが使う表示域の寸法 (与えられたか測ったもの) を読む処理。
1344
+ */
1345
+ getViewportSize: () => ne,
1279
1346
  applyWheel: H
1280
1347
  }),
1281
- [D, e, re, z, H]
1348
+ [D, e, ne, A, H]
1282
1349
  );
1283
- const ht = ri(), At = xe?.id ?? ht, y = u({
1350
+ const pt = ri(), At = xe?.id ?? pt, y = u({
1284
1351
  pointerType: "",
1285
1352
  pointerId: null,
1286
1353
  startClientY: 0,
@@ -1293,141 +1360,141 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
1293
1360
  velocitySamples: [],
1294
1361
  scale: 1,
1295
1362
  scaleX: 1
1296
- }), $t = u(b), pt = u(g);
1297
- q(() => {
1298
- $t.current = b;
1299
- }, [b]), q(() => {
1300
- pt.current = g;
1301
- }, [g]);
1363
+ }), Ht = u(g), mt = u(x);
1364
+ W(() => {
1365
+ Ht.current = g;
1366
+ }, [g]), W(() => {
1367
+ mt.current = x;
1368
+ }, [x]);
1302
1369
  const Xe = u($e);
1303
- q(() => {
1370
+ W(() => {
1304
1371
  Xe.current = $e;
1305
1372
  }, [$e]);
1306
- const wt = u(Vt);
1307
- q(() => {
1308
- wt.current = Vt;
1309
- }, [Vt]), q(() => {
1373
+ const St = u(Vt);
1374
+ W(() => {
1375
+ St.current = Vt;
1376
+ }, [Vt]), W(() => {
1310
1377
  const v = y.current;
1311
- if (b && $e && (v.pointerId === null || sn(v.pointerType, g)) || v.pointerId === null)
1378
+ if (g && $e && (v.pointerId === null || sn(v.pointerType, x)) || v.pointerId === null)
1312
1379
  return;
1313
1380
  const Y = He.current;
1314
1381
  v.clickResetTimer !== null && (window.clearTimeout(v.clickResetTimer), v.clickResetTimer = null);
1315
- const ee = v.isDragging && v.shouldCancelNextClick, le = v.pointerId;
1316
- v.pointerId = null, v.pointerType = "", v.startClientY = 0, v.startScroll = 0, v.isDragging = !1, v.shouldCancelNextClick = ee, v.velocitySamples = [], v.scale = 1, Y !== null && dr(Y, le);
1317
- }, [b, g, $e]), q(() => {
1382
+ const te = v.isDragging && v.shouldCancelNextClick, le = v.pointerId;
1383
+ v.pointerId = null, v.pointerType = "", v.startClientY = 0, v.startScroll = 0, v.isDragging = !1, v.shouldCancelNextClick = te, v.velocitySamples = [], v.scale = 1, Y !== null && dr(Y, le);
1384
+ }, [g, x, $e]), W(() => {
1318
1385
  const v = He.current;
1319
1386
  if (!v)
1320
1387
  return;
1321
- const Y = 6, ee = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), le = () => {
1388
+ const Y = 6, te = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), le = () => {
1322
1389
  const w = y.current;
1323
1390
  w.pointerId = null, w.pointerType = "", w.startClientY = 0, w.startScroll = 0, w.isDragging = !1, w.velocitySamples = [], w.scale = 1;
1324
- }, oe = () => {
1391
+ }, ae = () => {
1325
1392
  const w = y.current;
1326
1393
  w.clickResetTimer !== null && (window.clearTimeout(w.clickResetTimer), w.clickResetTimer = null);
1327
- }, Ne = (w) => {
1328
- const I = y.current, Ye = ee();
1329
- I.velocitySamples.push({ clientY: w, time: Ye });
1330
- const Ie = wt.current.velocitySampleWindow;
1331
- I.velocitySamples = I.velocitySamples.filter((Ue) => Ye - Ue.time <= Ie);
1332
- }, Re = (w) => w instanceof HTMLElement && w.closest("[data-scrollpane-ignore-drag='true']") !== null, Se = (w) => {
1333
- const I = y.current;
1334
- I.shouldCancelNextClick && (w.preventDefault(), w.stopPropagation(), I.shouldCancelNextClick = !1);
1394
+ }, Ee = (w) => {
1395
+ const P = y.current, Ye = te();
1396
+ P.velocitySamples.push({ clientY: w, time: Ye });
1397
+ const ye = St.current.velocitySampleWindow;
1398
+ P.velocitySamples = P.velocitySamples.filter((Ge) => Ye - Ge.time <= ye);
1399
+ }, Te = (w) => w instanceof HTMLElement && w.closest("[data-scrollpane-ignore-drag='true']") !== null, Me = (w) => {
1400
+ const P = y.current;
1401
+ P.shouldCancelNextClick && (w.preventDefault(), w.stopPropagation(), P.shouldCancelNextClick = !1);
1335
1402
  }, at = (w) => {
1336
- const I = y.current;
1337
- I.isDragging || (I.isDragging = !0, I.shouldCancelNextClick = !0, Bn(v, w.pointerId) || _r(v, w.pointerId), Ne(w.clientY));
1403
+ const P = y.current;
1404
+ P.isDragging || (P.isDragging = !0, P.shouldCancelNextClick = !0, Bn(v, w.pointerId) || _r(v, w.pointerId), Ee(w.clientY));
1338
1405
  }, Be = (w) => w.isTrusted || w.target === v, U = (w) => {
1339
- const I = y.current;
1340
- dr(v, w), I.shouldCancelNextClick = !1, oe(), le();
1341
- }, mt = (w) => {
1342
- const I = y.current;
1343
- if (I.pointerId !== w.pointerId)
1406
+ const P = y.current;
1407
+ dr(v, w), P.shouldCancelNextClick = !1, ae(), le();
1408
+ }, gt = (w) => {
1409
+ const P = y.current;
1410
+ if (P.pointerId !== w.pointerId)
1344
1411
  return;
1345
- if (w.buttons === 0 && Di(w.pointerType)) {
1412
+ if (w.buttons === 0 && zi(w.pointerType)) {
1346
1413
  U(w.pointerId);
1347
1414
  return;
1348
1415
  }
1349
- if (!($t.current && Xe.current) || !sn(w.pointerType, pt.current))
1416
+ if (!(Ht.current && Xe.current) || !sn(w.pointerType, mt.current))
1350
1417
  return;
1351
- if (!I.isDragging) {
1352
- const et = Math.abs(w.clientY - I.startClientY), Oe = Ze.current ? Math.abs(w.clientX - I.startClientX) : 0;
1353
- if (Math.max(et, Oe) < Y || (at(w), !I.isDragging))
1418
+ if (!P.isDragging) {
1419
+ const et = Math.abs(w.clientY - P.startClientY), _e = Ze.current ? Math.abs(w.clientX - P.startClientX) : 0;
1420
+ if (Math.max(et, _e) < Y || (at(w), !P.isDragging))
1354
1421
  return;
1355
1422
  }
1356
- Ne(w.clientY);
1357
- const Ye = (w.clientY - I.startClientY) / (I.scale || 1), Ie = I.startScroll - Ye;
1358
- ot.current(Ie);
1359
- const Ue = Ze.current;
1360
- if (Ue) {
1361
- const et = w.clientX - I.lastPanClientX;
1362
- I.lastPanClientX = w.clientX, et !== 0 && Ue(-et / (I.scaleX || 1));
1423
+ Ee(w.clientY);
1424
+ const Ye = (w.clientY - P.startClientY) / (P.scale || 1), ye = P.startScroll - Ye;
1425
+ ot.current(ye);
1426
+ const Ge = Ze.current;
1427
+ if (Ge) {
1428
+ const et = w.clientX - P.lastPanClientX;
1429
+ P.lastPanClientX = w.clientX, et !== 0 && Ge(-et / (P.scaleX || 1));
1363
1430
  }
1364
1431
  w.cancelable && w.preventDefault();
1365
- }, be = () => {
1432
+ }, ve = () => {
1366
1433
  const w = y.current;
1367
- return w.pointerId !== null || !w.shouldCancelNextClick ? !1 : (oe(), w.clickResetTimer = window.setTimeout(() => {
1368
- const I = y.current;
1369
- I.shouldCancelNextClick = !1, I.clickResetTimer = null;
1434
+ return w.pointerId !== null || !w.shouldCancelNextClick ? !1 : (ae(), w.clickResetTimer = window.setTimeout(() => {
1435
+ const P = y.current;
1436
+ P.shouldCancelNextClick = !1, P.clickResetTimer = null;
1370
1437
  }, 0), !0);
1371
- }, ye = (w) => {
1372
- const I = y.current;
1373
- if (I.pointerId !== w.pointerId) {
1374
- be();
1438
+ }, Re = (w) => {
1439
+ const P = y.current;
1440
+ if (P.pointerId !== w.pointerId) {
1441
+ ve();
1375
1442
  return;
1376
1443
  }
1377
- I.isDragging && I.shouldCancelNextClick && w.cancelable && (w.preventDefault(), w.stopPropagation()), I.isDragging && Ne(w.clientY);
1444
+ P.isDragging && P.shouldCancelNextClick && w.cancelable && (w.preventDefault(), w.stopPropagation()), P.isDragging && Ee(w.clientY);
1378
1445
  let Ye = 0;
1379
- if (I.isDragging && I.velocitySamples.length >= 2) {
1380
- const Ue = I.velocitySamples, et = wt.current.velocitySampleWindow, Oe = Ue[Ue.length - 1], me = Ue.find((gt) => Oe.time - gt.time <= et) ?? Ue[0];
1381
- if (Oe && me && Oe.time !== me.time) {
1382
- const gt = Oe.clientY - me.clientY, Qt = Oe.time - me.time;
1383
- Ye = -(gt / Qt) / (I.scale || 1);
1446
+ if (P.isDragging && P.velocitySamples.length >= 2) {
1447
+ const Ge = P.velocitySamples, et = St.current.velocitySampleWindow, _e = Ge[Ge.length - 1], me = Ge.find((bt) => _e.time - bt.time <= et) ?? Ge[0];
1448
+ if (_e && me && _e.time !== me.time) {
1449
+ const bt = _e.clientY - me.clientY, Qt = _e.time - me.time;
1450
+ Ye = -(bt / Qt) / (P.scale || 1);
1384
1451
  }
1385
1452
  }
1386
- oe(), I.shouldCancelNextClick && (I.clickResetTimer = window.setTimeout(() => {
1387
- const Ue = y.current;
1388
- Ue.shouldCancelNextClick = !1, Ue.clickResetTimer = null;
1453
+ ae(), P.shouldCancelNextClick && (P.clickResetTimer = window.setTimeout(() => {
1454
+ const Ge = y.current;
1455
+ Ge.shouldCancelNextClick = !1, Ge.clickResetTimer = null;
1389
1456
  }, 0));
1390
- const Ie = wt.current.startVelocityThreshold;
1391
- le(), dr(v, w.pointerId), Math.abs(Ye) >= Ie && Ee.current?.(Ye);
1392
- }, _e = (w) => {
1457
+ const ye = St.current.startVelocityThreshold;
1458
+ le(), dr(v, w.pointerId), Math.abs(Ye) >= ye && Ae.current?.(Ye);
1459
+ }, Le = (w) => {
1393
1460
  if (y.current.pointerId !== null) {
1394
1461
  if (!w.isPrimary || w.pointerType !== y.current.pointerType)
1395
1462
  return;
1396
1463
  U(y.current.pointerId);
1397
1464
  }
1398
- if (y.current.shouldCancelNextClick && (oe(), y.current.shouldCancelNextClick = !1), !($t.current && Xe.current) || !sn(w.pointerType, pt.current) || w.button !== 0 && w.pointerType === "mouse" || w.ctrlKey || w.metaKey || w.altKey || Re(w.target))
1465
+ if (y.current.shouldCancelNextClick && (ae(), y.current.shouldCancelNextClick = !1), !(Ht.current && Xe.current) || !sn(w.pointerType, mt.current) || w.button !== 0 && w.pointerType === "mouse" || w.ctrlKey || w.metaKey || w.altKey || Te(w.target))
1399
1466
  return;
1400
- window.dispatchEvent(new CustomEvent(Or, { detail: { paneId: ht } })), dt.current?.();
1401
- const I = y.current;
1402
- oe(), I.pointerId = w.pointerId, I.pointerType = w.pointerType, I.startClientY = w.clientY, I.startClientX = w.clientX, I.lastPanClientX = w.clientX, I.startScroll = W.current, I.scale = Zr(v, "y"), I.scaleX = Ze.current ? Zr(v, "x") : 1, I.isDragging = !1, I.shouldCancelNextClick = !1, I.velocitySamples = [];
1467
+ window.dispatchEvent(new CustomEvent(Or, { detail: { paneId: pt } })), ft.current?.();
1468
+ const P = y.current;
1469
+ ae(), P.pointerId = w.pointerId, P.pointerType = w.pointerType, P.startClientY = w.clientY, P.startClientX = w.clientX, P.lastPanClientX = w.clientX, P.startScroll = K.current, P.scale = Zr(v, "y"), P.scaleX = Ze.current ? Zr(v, "x") : 1, P.isDragging = !1, P.shouldCancelNextClick = !1, P.velocitySamples = [];
1403
1470
  }, Et = (w) => {
1404
1471
  if (y.current.pointerId !== w.pointerId) {
1405
- be();
1472
+ ve();
1406
1473
  return;
1407
1474
  }
1408
1475
  Be(w) && U(w.pointerId);
1409
1476
  }, qe = [
1410
- ["click", Se, !0],
1411
- ["pointerdown", _e, { passive: !1 }],
1477
+ ["click", Me, !0],
1478
+ ["pointerdown", Le, { passive: !1 }],
1412
1479
  ["lostpointercapture", (w) => {
1413
1480
  w.target !== v || y.current.pointerId !== w.pointerId || U(w.pointerId);
1414
1481
  }, void 0]
1415
1482
  ], Je = [
1416
- ["pointermove", mt, { passive: !1 }],
1417
- ["pointerup", ye, void 0],
1483
+ ["pointermove", gt, { passive: !1 }],
1484
+ ["pointerup", Re, void 0],
1418
1485
  ["pointercancel", Et, void 0]
1419
1486
  ];
1420
1487
  return Ur(v, qe, "add"), Ur(window, Je, "add"), () => {
1421
1488
  Ur(v, qe, "remove"), Ur(window, Je, "remove");
1422
1489
  const w = y.current;
1423
- w.pointerId !== null && dr(v, w.pointerId), oe(), le();
1490
+ w.pointerId !== null && dr(v, w.pointerId), ae(), le();
1424
1491
  };
1425
- }, [ht]);
1426
- const Xt = p(
1427
- (v) => (z(), D(v)),
1428
- [D, z]
1492
+ }, [pt]);
1493
+ const $t = p(
1494
+ (v) => (A(), D(v)),
1495
+ [D, A]
1429
1496
  );
1430
- return /* @__PURE__ */ Zt("div", { ref: se, "data-testid": S, "data-self-measured": ce ? "true" : void 0, className: Ot("aqvs-scroll-pane", N), style: L, children: [
1497
+ return /* @__PURE__ */ Zt("div", { ref: ee, "data-testid": M, "data-self-measured": ce ? "true" : void 0, className: Ot("aqvs-scroll-pane", N), style: _, children: [
1431
1498
  /* @__PURE__ */ Zt(
1432
1499
  "div",
1433
1500
  {
@@ -1439,9 +1506,9 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
1439
1506
  // レイアウトを所有することで、「計測した値を書き戻して自分のサイズを変える」
1440
1507
  // フィードバックループが構造的に起こらず、初回 paint の時点でも帯は実寸で正しい
1441
1508
  // (数値の反映だけが 1 コミット遅れる)。明示モードは従来どおり px を書く。
1442
- height: ce ? void 0 : re,
1443
- paddingTop: we.top,
1444
- paddingBottom: we.bottom,
1509
+ height: ce ? void 0 : ne,
1510
+ paddingTop: Se.top,
1511
+ paddingBottom: Se.bottom,
1445
1512
  // スクロール不能時 (contentSize <= viewportSize) は touch-action を通常に戻し、
1446
1513
  // 短いリスト上のタッチがページ全体のパンを妨げるデッドゾーン化を防ぐ。
1447
1514
  // 直接操作 (指・ペン) のドラッグを許可していない場合も付けない。
@@ -1455,92 +1522,92 @@ const te = (t, e, r) => Math.max(e, Math.min(r, t)), Zr = (t, e) => {
1455
1522
  // 同一条件で揃えてあるため状態としても一貫している。
1456
1523
  // 非同期コンテンツを先読みして確保する挙動は意図的に入れていない
1457
1524
  // (空のペインがページのパンを殺すデッドゾーンになり、そちらの実害の方が大きいため)。
1458
- ...b && $e && g.some((v) => v === "touch" || v === "pen") ? { touchAction: "none" } : {}
1525
+ ...g && $e && x.some((v) => v === "touch" || v === "pen") ? { touchAction: "none" } : {}
1459
1526
  },
1460
1527
  ...xe,
1461
1528
  id: At,
1462
1529
  children: [
1463
- X,
1464
- t(W.current)
1530
+ F,
1531
+ t(K.current)
1465
1532
  ]
1466
1533
  }
1467
1534
  ),
1468
- /* @__PURE__ */ Q(
1535
+ /* @__PURE__ */ Z(
1469
1536
  Un,
1470
1537
  {
1471
1538
  contentSize: e,
1472
- viewportSize: re,
1539
+ viewportSize: ne,
1473
1540
  stretchMainSize: ce,
1474
- scrollPosition: W.current,
1475
- onScroll: Xt,
1541
+ scrollPosition: K.current,
1542
+ onScroll: $t,
1476
1543
  enableThumbDrag: s,
1477
1544
  enableTrackClick: a,
1478
1545
  enableArrowButtons: l,
1479
1546
  enableArrowButtonTabStops: f,
1480
1547
  scrollBarWidth: i,
1481
1548
  ariaControls: At,
1482
- tapScrollCircleOptions: K,
1483
- itemCount: De,
1484
- renderThumbOverlay: T,
1485
- visibleStartIndex: he,
1486
- visibleEndIndex: ne,
1487
- locale: Le,
1488
- labels: Tt
1549
+ tapScrollCircleOptions: J,
1550
+ itemCount: ze,
1551
+ renderThumbOverlay: $,
1552
+ visibleStartIndex: be,
1553
+ visibleEndIndex: se,
1554
+ locale: ke,
1555
+ labels: je
1489
1556
  },
1490
1557
  "scrollbar"
1491
1558
  ),
1492
- ie?.()
1559
+ oe?.()
1493
1560
  ] });
1494
1561
  }
1495
1562
  ), Tn = (t, e, r) => Math.min(Math.max(t, e), r), us = ({ dragState: t, normalizedDistance: e, sizeScale: r, size: n }) => {
1496
- const i = Math.max(n / 2, 1), s = 1 + e * 0.65, a = Math.max(0.65, 1 - e * 0.25), l = t.direction * e * 26 * r, f = 0.8 + e * 0.18, b = 3 * r, g = 6 * r, M = 22 * r, N = Math.abs(l) + g, S = l > 0 ? b : -Math.abs(l) - b, L = Math.max(2.5, 3 * r), X = Tn(t.offsetX, -i, i), K = Tn(t.offsetY, -i, i), ae = i * 0.35, De = X / i * ae, T = K / i * ae, A = De * 0.45, P = T * 0.45, Z = Math.max(M * 0.38, 6), $ = 0.65 + e * 0.2, _ = t.active;
1563
+ const i = Math.max(n / 2, 1), s = 1 + e * 0.65, a = Math.max(0.65, 1 - e * 0.25), l = t.direction * e * 26 * r, f = 0.8 + e * 0.18, g = 3 * r, x = 6 * r, S = 22 * r, N = Math.abs(l) + x, M = l > 0 ? g : -Math.abs(l) - g, _ = Math.max(2.5, 3 * r), F = Tn(t.offsetX, -i, i), J = Tn(t.offsetY, -i, i), ie = i * 0.35, ze = F / i * ie, $ = J / i * ie, I = ze * 0.45, R = $ * 0.45, X = Math.max(S * 0.38, 6), B = 0.65 + e * 0.2, k = t.active;
1497
1564
  return /* @__PURE__ */ Zt(pn, { children: [
1498
- /* @__PURE__ */ Q(
1565
+ /* @__PURE__ */ Z(
1499
1566
  "div",
1500
1567
  {
1501
1568
  className: "aqvs-tap-scroll-circle-gradient",
1502
1569
  style: {
1503
1570
  transform: `scale(${a}, ${s})`,
1504
- transition: _ ? "40ms transform ease-out" : "200ms ease transform"
1571
+ transition: k ? "40ms transform ease-out" : "200ms ease transform"
1505
1572
  }
1506
1573
  }
1507
1574
  ),
1508
- /* @__PURE__ */ Q(
1575
+ /* @__PURE__ */ Z(
1509
1576
  "div",
1510
1577
  {
1511
1578
  className: "aqvs-sample-visual-pupil",
1512
1579
  style: {
1513
- width: M,
1514
- height: M,
1515
- transform: `translate(calc(-50% + ${De}px), calc(-50% + ${T}px)) scale(${a}, ${f * s})`,
1516
- transition: _ ? "70ms transform ease-out" : "200ms ease transform"
1580
+ width: S,
1581
+ height: S,
1582
+ transform: `translate(calc(-50% + ${ze}px), calc(-50% + ${$}px)) scale(${a}, ${f * s})`,
1583
+ transition: k ? "70ms transform ease-out" : "200ms ease transform"
1517
1584
  }
1518
1585
  }
1519
1586
  ),
1520
- /* @__PURE__ */ Q(
1587
+ /* @__PURE__ */ Z(
1521
1588
  "div",
1522
1589
  {
1523
1590
  className: "aqvs-sample-visual-highlight",
1524
1591
  style: {
1525
- width: Z,
1526
- height: Z,
1527
- transform: `translate(calc(-50% + ${A}px), calc(-50% + ${P}px)) scale(${a}, ${s})`,
1528
- opacity: $,
1592
+ width: X,
1593
+ height: X,
1594
+ transform: `translate(calc(-50% + ${I}px), calc(-50% + ${R}px)) scale(${a}, ${s})`,
1595
+ opacity: B,
1529
1596
  boxShadow: "0 0 8px rgba(255,255,255,0.45)",
1530
- transition: _ ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
1597
+ transition: k ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
1531
1598
  }
1532
1599
  }
1533
1600
  ),
1534
- /* @__PURE__ */ Q(
1601
+ /* @__PURE__ */ Z(
1535
1602
  "div",
1536
1603
  {
1537
1604
  className: "aqvs-sample-visual-rod",
1538
1605
  style: {
1539
- width: L,
1606
+ width: _,
1540
1607
  height: N,
1541
- transform: `translate(-50%, ${S}px)`,
1608
+ transform: `translate(-50%, ${M}px)`,
1542
1609
  opacity: e,
1543
- transition: _ ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
1610
+ transition: k ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
1544
1611
  }
1545
1612
  }
1546
1613
  )
@@ -1633,26 +1700,26 @@ class sr {
1633
1700
  if (i > 0 && l !== void 0) {
1634
1701
  if (s = l, n?.materialize) {
1635
1702
  const f = n?.sampleRange ?? { from: 0, to: Math.min(Rr - 1, i - 1) };
1636
- let b = Math.max(0, Math.trunc(f.from)), g = Math.min(Math.trunc(f.to), i - 1);
1637
- b > g && (b = 0, g = Math.min(Rr - 1, i - 1)), a = { from: b, values: sr._collectValidatedValues(r, b, g) };
1703
+ let g = Math.max(0, Math.trunc(f.from)), x = Math.min(Math.trunc(f.to), i - 1);
1704
+ g > x && (g = 0, x = Math.min(Rr - 1, i - 1)), a = { from: g, values: sr._collectValidatedValues(r, g, x) };
1638
1705
  }
1639
1706
  } else if (i > 0) {
1640
1707
  const f = n?.sampleRange ?? {
1641
1708
  from: 0,
1642
1709
  to: Math.min(Rr - 1, i - 1)
1643
1710
  };
1644
- let b = Math.max(0, Math.trunc(f.from)), g = Math.min(Math.trunc(f.to), i - 1);
1645
- if (b > g && (b = 0, g = Math.min(Rr - 1, i - 1)), i > Rr)
1646
- s = sr._sampleBaseValueStrided(r, i, Rr), n?.materialize && (a = { from: b, values: sr._collectValidatedValues(r, b, g) });
1711
+ let g = Math.max(0, Math.trunc(f.from)), x = Math.min(Math.trunc(f.to), i - 1);
1712
+ if (g > x && (g = 0, x = Math.min(Rr - 1, i - 1)), i > Rr)
1713
+ s = sr._sampleBaseValueStrided(r, i, Rr), n?.materialize && (a = { from: g, values: sr._collectValidatedValues(r, g, x) });
1647
1714
  else {
1648
- const M = sr._collectValidatedValues(r, b, g);
1649
- s = sr._modeOrMedian([...M]), n?.materialize && (a = { from: b, values: M });
1715
+ const S = sr._collectValidatedValues(r, g, x);
1716
+ s = sr._modeOrMedian([...S]), n?.materialize && (a = { from: g, values: S });
1650
1717
  }
1651
1718
  }
1652
1719
  if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = r, this.baseValue = s, a)
1653
1720
  for (let f = 0; f < a.values.length; f++) {
1654
- const b = a.from + f, g = a.values[f] - this.baseValue;
1655
- g !== 0 && (this.deltas.set(b, g), this._updateTree(b, g));
1721
+ const g = a.from + f, x = a.values[f] - this.baseValue;
1722
+ x !== 0 && (this.deltas.set(g, x), this._updateTree(g, x));
1656
1723
  }
1657
1724
  this.total = this.getTotal(), this.revisionCount += 1;
1658
1725
  }
@@ -1707,9 +1774,9 @@ class sr {
1707
1774
  }
1708
1775
  if (s > e.length * 0.2) {
1709
1776
  const a = [];
1710
- for (const [f, b] of i.entries())
1711
- b === s && a.push(f);
1712
- const l = a.reduce((f, b) => f + b, 0);
1777
+ for (const [f, g] of i.entries())
1778
+ g === s && a.push(f);
1779
+ const l = a.reduce((f, g) => f + g, 0);
1713
1780
  n = Math.floor(l / a.length);
1714
1781
  }
1715
1782
  return n;
@@ -1824,8 +1891,8 @@ class sr {
1824
1891
  throw new Error(`Value must be a finite number: ${s}`);
1825
1892
  if (s < 0)
1826
1893
  throw new Error("Value cannot be negative.");
1827
- const a = n.get(i), l = a === void 0 ? this.deltas.get(i) ?? 0 : a, f = l + this.baseValue, b = s - f;
1828
- b !== 0 && r.push({ index: i, change: b }), n.set(i, l + b);
1894
+ const a = n.get(i), l = a === void 0 ? this.deltas.get(i) ?? 0 : a, f = l + this.baseValue, g = s - f;
1895
+ g !== 0 && r.push({ index: i, change: g }), n.set(i, l + g);
1829
1896
  }
1830
1897
  return r;
1831
1898
  }
@@ -1876,9 +1943,9 @@ class sr {
1876
1943
  const i = e.ranges;
1877
1944
  if (i && i.length > 0) {
1878
1945
  for (const l of i) {
1879
- const f = Math.max(0, Math.trunc(l.from)), b = Math.min(Math.trunc(l.to), this.size - 1);
1880
- for (let g = f; g <= b; g++)
1881
- this._materialize(g);
1946
+ const f = Math.max(0, Math.trunc(l.from)), g = Math.min(Math.trunc(l.to), this.size - 1);
1947
+ for (let x = f; x <= g; x++)
1948
+ this._materialize(x);
1882
1949
  }
1883
1950
  if (r === void 0)
1884
1951
  return;
@@ -1960,36 +2027,36 @@ class sr {
1960
2027
  this._materializeRanges(r.materializeOption);
1961
2028
  const s = r.materializeOption?.materialize === !0;
1962
2029
  for (; ; ) {
1963
- let a = 0n, l = i - 1n, f, b, g = this.total;
2030
+ let a = 0n, l = i - 1n, f, g, x = this.total;
1964
2031
  for (; a <= l; ) {
1965
- const S = a + l >> 1n, L = Number(S), X = this.prefixSum(L);
1966
- if (g = X.total, n ? X.cumulative >= e : X.cumulative <= e)
1967
- if (f = S, b = X, n) {
1968
- if (S === 0n)
2032
+ const M = a + l >> 1n, _ = Number(M), F = this.prefixSum(_);
2033
+ if (x = F.total, n ? F.cumulative >= e : F.cumulative <= e)
2034
+ if (f = M, g = F, n) {
2035
+ if (M === 0n)
1969
2036
  break;
1970
- l = S - 1n;
2037
+ l = M - 1n;
1971
2038
  } else
1972
- a = S + 1n;
2039
+ a = M + 1n;
1973
2040
  else if (n)
1974
- a = S + 1n;
2041
+ a = M + 1n;
1975
2042
  else {
1976
- if (S === 0n)
2043
+ if (M === 0n)
1977
2044
  break;
1978
- l = S - 1n;
2045
+ l = M - 1n;
1979
2046
  }
1980
2047
  }
1981
- const M = b, N = f !== void 0 ? Number(f) : -1;
2048
+ const S = g, N = f !== void 0 ? Number(f) : -1;
1982
2049
  if (s && N >= 0) {
1983
- const S = this.deltas.get(N) ?? 0;
1984
- if (this._materialize(N), (this.deltas.get(N) ?? 0) !== S)
2050
+ const M = this.deltas.get(N) ?? 0;
2051
+ if (this._materialize(N), (this.deltas.get(N) ?? 0) !== M)
1985
2052
  continue;
1986
2053
  }
1987
2054
  return {
1988
2055
  index: N,
1989
- total: g,
1990
- cumulative: M?.cumulative,
1991
- currentValue: M?.currentValue,
1992
- safeIndex: M?.safeIndex
2056
+ total: x,
2057
+ cumulative: S?.cumulative,
2058
+ currentValue: S?.currentValue,
2059
+ safeIndex: S?.safeIndex
1993
2060
  };
1994
2061
  }
1995
2062
  }
@@ -2006,7 +2073,7 @@ class sr {
2006
2073
  return { cumulative: 0, total: this.total, currentValue: 0, safeIndex: 0 };
2007
2074
  if (this.size === 0)
2008
2075
  return { cumulative: 0, total: this.getTotal(), currentValue: 0, safeIndex: 0 };
2009
- const n = te(Math.trunc(e), 0, this.size - 1), i = r?.materializeOption;
2076
+ const n = re(Math.trunc(e), 0, this.size - 1), i = r?.materializeOption;
2010
2077
  this._materializeRanges(i, n, !0);
2011
2078
  let s = 0, a = n + 1;
2012
2079
  for (; a > 0; ) {
@@ -2284,11 +2351,11 @@ const _i = (t, e) => {
2284
2351
  }, jn = (t, e, r) => {
2285
2352
  const n = Number.isFinite(t) && t > 0 ? Math.trunc(t) : 0, i = u(null), s = u({ size: n, valueOrFn: e, options: r });
2286
2353
  i.current === null && (i.current = new sr(n, e, r));
2287
- const a = i.current, l = s.current, f = l.size !== n, b = l.valueOrFn !== e, g = _i(l.options, r) || l.options?.baseValue !== r?.baseValue, M = l.size === 0 && n > 0 && (!i.current || i.current.base === 0);
2288
- if (b || g) {
2354
+ const a = i.current, l = s.current, f = l.size !== n, g = l.valueOrFn !== e, x = _i(l.options, r) || l.options?.baseValue !== r?.baseValue, S = l.size === 0 && n > 0 && (!i.current || i.current.base === 0);
2355
+ if (g || x) {
2289
2356
  const N = r?.resetOnValueFnChange ?? !0;
2290
- g || b && N || M ? (r?.debug && F.debug("[useFenwickMapTree] reset", { valueOrFnChanged: b, optionsChanged: g }), a.reset(n, e, r)) : (f && (r?.debug && F.debug("[useFenwickMapTree] resize (with valueFn change)", { from: l.size, to: n }), a.changeSize(n)), r?.debug && F.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: b }), a.setValueFn(e, { reset: !1 })), s.current = { size: n, valueOrFn: e, options: r };
2291
- } else f && (r?.debug && F.debug("[useFenwickMapTree] resize", { from: l.size, to: n }), M ? a.reset(n, e, r) : a.changeSize(n), s.current = { size: n, valueOrFn: e, options: r });
2357
+ x || g && N || S ? (r?.debug && L.debug("[useFenwickMapTree] reset", { valueOrFnChanged: g, optionsChanged: x }), a.reset(n, e, r)) : (f && (r?.debug && L.debug("[useFenwickMapTree] resize (with valueFn change)", { from: l.size, to: n }), a.changeSize(n)), r?.debug && L.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: g }), a.setValueFn(e, { reset: !1 })), s.current = { size: n, valueOrFn: e, options: r };
2358
+ } else f && (r?.debug && L.debug("[useFenwickMapTree] resize", { from: l.size, to: n }), S ? a.reset(n, e, r) : a.changeSize(n), s.current = { size: n, valueOrFn: e, options: r });
2292
2359
  return a;
2293
2360
  }, Oi = (t) => t + 1, Kn = (t) => {
2294
2361
  const [e, r] = ni(Oi, 0), n = p(
@@ -2361,47 +2428,47 @@ class an {
2361
2428
  }
2362
2429
  function ki(t) {
2363
2430
  const e = u(/* @__PURE__ */ new Map()), r = u(new an()), n = Math.floor(t), i = u(n);
2364
- q(() => {
2431
+ W(() => {
2365
2432
  if (i.current = n, Number.isNaN(n) || n < 0) {
2366
- F.warn(`useLruCache: invalid capacity ${t}; the cache will not store any entries.`), e.current.clear(), r.current = new an();
2433
+ L.warn(`useLruCache: invalid capacity ${t}; the cache will not store any entries.`), e.current.clear(), r.current = new an();
2367
2434
  return;
2368
2435
  }
2369
2436
  if (Number.isFinite(n))
2370
- for (let g = r.current.peekHead(); g !== null && e.current.size > n; g = r.current.peekHead())
2371
- r.current.remove(g), e.current.delete(g.key);
2437
+ for (let x = r.current.peekHead(); x !== null && e.current.size > n; x = r.current.peekHead())
2438
+ r.current.remove(x), e.current.delete(x.key);
2372
2439
  }, [t, n]);
2373
- const s = p((g) => {
2374
- const M = e.current.get(g);
2375
- if (M)
2376
- return r.current.moveToTail(M), M.value;
2377
- }, []), a = p((g, M) => {
2440
+ const s = p((x) => {
2441
+ const S = e.current.get(x);
2442
+ if (S)
2443
+ return r.current.moveToTail(S), S.value;
2444
+ }, []), a = p((x, S) => {
2378
2445
  const N = i.current;
2379
2446
  if (Number.isNaN(N) || N <= 0)
2380
2447
  return;
2381
- let S = e.current.get(g);
2382
- if (S)
2383
- S.value = M, r.current.moveToTail(S);
2448
+ let M = e.current.get(x);
2449
+ if (M)
2450
+ M.value = S, r.current.moveToTail(M);
2384
2451
  else {
2385
2452
  if (e.current.size >= N) {
2386
- const L = r.current.removeHead();
2387
- L && e.current.delete(L.key);
2453
+ const _ = r.current.removeHead();
2454
+ _ && e.current.delete(_.key);
2388
2455
  }
2389
- S = new Fi(g, M), e.current.set(g, S), r.current.addToTail(S);
2456
+ M = new Fi(x, S), e.current.set(x, M), r.current.addToTail(M);
2390
2457
  }
2391
- }, []), l = p((g) => e.current.has(g), []), f = p((g) => {
2392
- const M = e.current.get(g);
2393
- M && (r.current.remove(M), e.current.delete(g));
2394
- }, []), b = p(() => {
2458
+ }, []), l = p((x) => e.current.has(x), []), f = p((x) => {
2459
+ const S = e.current.get(x);
2460
+ S && (r.current.remove(S), e.current.delete(x));
2461
+ }, []), g = p(() => {
2395
2462
  e.current.clear(), r.current = new an();
2396
2463
  }, []);
2397
- return ge(() => ({ get: s, set: a, has: l, remove: f, clear: b }), [s, a, l, f, b]);
2464
+ return ge(() => ({ get: s, set: a, has: l, remove: f, clear: g }), [s, a, l, f, g]);
2398
2465
  }
2399
2466
  const Hi = 1e4, ds = () => {
2400
2467
  const { get: t, set: e, has: r, clear: n } = ki(Hi);
2401
2468
  return ge(() => ({ get: t, set: e, has: r, clear: n }), [t, e, r, n]);
2402
2469
  }, fs = (t, e) => {
2403
2470
  const r = u(e), n = u(t);
2404
- je(() => {
2471
+ We(() => {
2405
2472
  r.current = e, n.current = t;
2406
2473
  }, [e, t]);
2407
2474
  const i = u(/* @__PURE__ */ new WeakMap());
@@ -2418,97 +2485,101 @@ const Hi = 1e4, ds = () => {
2418
2485
  }, Rn = -200, yn = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, $i = (t) => {
2419
2486
  const e = u(t);
2420
2487
  e.current = t;
2421
- const r = u(yn), n = u(null), [i, s] = Ve(!1), a = u(null), l = u(null), f = u({ residual: 0, direction: 0 }), b = u({ residual: 0, direction: 0 }), g = p(() => {
2422
- a.current !== null && (window.cancelAnimationFrame(a.current), a.current = null), l.current = null, f.current = { residual: 0, direction: 0 }, b.current = { residual: 0, direction: 0 };
2423
- }, []), M = p((T, A, P, Z, $, _) => {
2424
- const he = A > 0 ? 1 : A < 0 ? -1 : 0;
2425
- he !== 0 && he !== T.direction && (T.direction = he, T.residual = 0), T.residual += A * P;
2426
- const ne = Math.max($(), 0);
2427
- ne > 0 && (T.residual = te(T.residual, -ne, ne));
2428
- const ie = T.residual;
2429
- if (ie === 0)
2488
+ const r = u(yn), n = u(null), [i, s] = Ce(!1), a = u(null), l = u(!1), f = u(null), g = u({ residual: 0, direction: 0 }), x = u({ residual: 0, direction: 0 }), S = p(() => {
2489
+ a.current !== null && (window.cancelAnimationFrame(a.current), a.current = null), f.current = null, g.current = { residual: 0, direction: 0 }, x.current = { residual: 0, direction: 0 };
2490
+ }, []), N = p((I, R, X, B, k, be) => {
2491
+ const se = R > 0 ? 1 : R < 0 ? -1 : 0;
2492
+ se !== 0 && se !== I.direction && (I.direction = se, I.residual = 0), I.residual += R * X;
2493
+ const oe = Math.max(k(), 0);
2494
+ oe > 0 && (I.residual = re(I.residual, -oe, oe));
2495
+ const pe = I.residual;
2496
+ if (pe === 0)
2430
2497
  return { actualDelta: 0, atBoundary: !1 };
2431
- const Te = Z(), xe = _(ie), Le = xe - Te;
2432
- T.residual -= Le;
2433
- const Tt = ie < 0 && Te + ie <= 0, C = ie > 0 && Te + ie >= ne, W = ie < 0 && (xe <= 0 || Tt && Le === 0) || ie > 0 && (xe >= ne || C && Le === 0);
2434
- return W && (T.residual = 0), { actualDelta: Le, atBoundary: W };
2435
- }, []), N = p(
2436
- (T) => {
2437
- const A = e.current, P = r.current;
2438
- if (!P.active || P.direction === 0) {
2439
- g();
2498
+ const xe = B(), ke = be(pe), je = ke - xe;
2499
+ I.residual -= je;
2500
+ const C = pe < 0 && xe + pe <= 0, K = pe > 0 && xe + pe >= oe, ee = pe < 0 && (ke <= 0 || C && je === 0) || pe > 0 && (ke >= oe || K && je === 0);
2501
+ return ee && (I.residual = 0), { actualDelta: je, atBoundary: ee };
2502
+ }, []), M = p(
2503
+ (I) => {
2504
+ const R = e.current, X = r.current;
2505
+ if (!l.current) {
2506
+ S();
2507
+ return;
2508
+ }
2509
+ if (!X.active || X.direction === 0) {
2510
+ S();
2440
2511
  return;
2441
2512
  }
2442
- const Z = l.current ?? T, $ = Math.max((T - Z) / 1e3, 0), _ = Math.min($, Wn);
2443
- if (l.current = T, _ <= 0) {
2444
- a.current = window.requestAnimationFrame(N);
2513
+ const B = f.current ?? I, k = Math.max((I - B) / 1e3, 0), be = Math.min(k, Wn);
2514
+ if (f.current = I, be <= 0) {
2515
+ a.current = window.requestAnimationFrame(M);
2445
2516
  return;
2446
2517
  }
2447
- const he = Ni({ offsetX: P.offsetX, offsetY: P.offsetY, maxDistance: A.maxDistance, x: A.xSpeedParams, y: A.ySpeedParams }), ne = M(f.current, he.x, _, A.getHx, A.getMaxHx, (Le) => A.applyHxRef.current(A.getHx() + Le));
2448
- ne.actualDelta !== 0 && (A.pendingColAnchorRef.current = null);
2449
- const ie = M(b.current, he.y, _, A.getVy, A.getMaxVy, A.applyVy), Te = A.getMaxHx() <= 0 || ne.atBoundary || P.offsetX === 0, xe = A.getMaxVy() <= 0 || ie.atBoundary || P.offsetY === 0;
2450
- if (Te && xe) {
2451
- g();
2518
+ const se = Ni({ offsetX: X.offsetX, offsetY: X.offsetY, maxDistance: R.maxDistance, x: R.xSpeedParams, y: R.ySpeedParams }), oe = N(g.current, se.x, be, R.getHx, R.getMaxHx, (je) => R.applyHxRef.current(R.getHx() + je));
2519
+ oe.actualDelta !== 0 && (R.pendingColAnchorRef.current = null);
2520
+ const pe = N(x.current, se.y, be, R.getVy, R.getMaxVy, R.applyVy), xe = R.getMaxHx() <= 0 || oe.atBoundary || X.offsetX === 0, ke = R.getMaxVy() <= 0 || pe.atBoundary || X.offsetY === 0;
2521
+ if (xe && ke) {
2522
+ S();
2452
2523
  return;
2453
2524
  }
2454
- a.current = window.requestAnimationFrame(N);
2525
+ a.current = window.requestAnimationFrame(M);
2455
2526
  },
2456
- [g, M]
2457
- ), S = p(() => {
2458
- a.current === null && (l.current = null, f.current = { residual: 0, direction: 0 }, b.current = { residual: 0, direction: 0 }, a.current = window.requestAnimationFrame(N));
2459
- }, [N]), L = p(() => {
2460
- r.current = { ...yn }, s(!1), n.current?.reset(), g();
2461
- }, [g]), X = p(
2462
- (T) => {
2463
- r.current = T, s(T.active), T.active && T.direction !== 0 ? S() : g();
2527
+ [S, N]
2528
+ ), _ = p(() => {
2529
+ a.current === null && (f.current = null, g.current = { residual: 0, direction: 0 }, x.current = { residual: 0, direction: 0 }, a.current = window.requestAnimationFrame(M));
2530
+ }, [M]), F = p(() => {
2531
+ r.current = { ...yn }, s(!1), n.current?.reset(), S();
2532
+ }, [S]), J = p(
2533
+ (I) => {
2534
+ r.current = I, s(I.active), I.active && I.direction !== 0 ? _() : S();
2464
2535
  },
2465
- [S, g]
2466
- ), { enabled: K, xExtentFreshness: ae, yExtentFreshness: De } = t;
2467
- return q(() => {
2468
- const T = r.current;
2469
- !T.active || T.direction === 0 || S();
2470
- }, [ae, De, S]), q(() => {
2471
- const T = () => {
2472
- L();
2536
+ [_, S]
2537
+ ), { enabled: ie, xExtentFreshness: ze, yExtentFreshness: $ } = t;
2538
+ return W(() => {
2539
+ const I = r.current;
2540
+ !I.active || I.direction === 0 || _();
2541
+ }, [ze, $, _]), W(() => {
2542
+ const I = () => {
2543
+ F();
2473
2544
  };
2474
- return window.addEventListener(Or, T), () => {
2475
- window.removeEventListener(Or, T);
2545
+ return window.addEventListener(Or, I), () => {
2546
+ window.removeEventListener(Or, I);
2476
2547
  };
2477
- }, [L]), q(() => {
2478
- if (!K)
2548
+ }, [F]), W(() => {
2549
+ if (!ie)
2479
2550
  return;
2480
- const T = (A) => {
2481
- if (!r.current.active || r.current.pointerId === A.pointerId)
2551
+ const I = (R) => {
2552
+ if (!r.current.active || r.current.pointerId === R.pointerId)
2482
2553
  return;
2483
- const P = A.target;
2484
- if (!(P instanceof Node)) {
2485
- L();
2554
+ const X = R.target;
2555
+ if (!(X instanceof Node)) {
2556
+ F();
2486
2557
  return;
2487
2558
  }
2488
- n.current?.getElement()?.contains(P) || L();
2559
+ n.current?.getElement()?.contains(X) || F();
2489
2560
  };
2490
- return document.addEventListener("pointerdown", T, !0), () => {
2491
- document.removeEventListener("pointerdown", T, !0);
2561
+ return document.addEventListener("pointerdown", I, !0), () => {
2562
+ document.removeEventListener("pointerdown", I, !0);
2492
2563
  };
2493
- }, [K, L]), q(() => {
2494
- K || L();
2495
- }, [K, L]), q(() => () => {
2496
- g();
2497
- }, [g]), { isTapActive: i, handleTapCircleDragChange: X, tapCircleHandleRef: n };
2498
- }, ct = (t, e) => e <= 0 ? 0 : te(t, 0, e - 1), In = (t) => ({
2564
+ }, [ie, F]), W(() => {
2565
+ ie || F();
2566
+ }, [ie, F]), We(() => (l.current = !0, () => {
2567
+ l.current = !1, S();
2568
+ }), [S]), { isTapActive: i, handleTapCircleDragChange: J, tapCircleHandleRef: n };
2569
+ }, lt = (t, e) => e <= 0 ? 0 : re(t, 0, e - 1), In = (t) => ({
2499
2570
  top: Math.max(0, t?.top ?? 0),
2500
2571
  bottom: Math.max(0, t?.bottom ?? 0)
2501
- }), Mt = (t, e) => t <= e ? 0 : t - e, br = (t, e) => t <= 0 ? 0 : t + e, Fr = 1e3, hn = 2e3, Zn = 1048576, fr = 2 ** -10, Pn = (t) => t === "center" ? null : t === "bottom" ? "end" : "start", En = (t) => t !== null && t.panePosition <= 0 ? null : t, Xi = Object.freeze({ top: 0, bottom: 0 }), Bi = (t, e, r, n) => {
2572
+ }), Tt = (t, e) => t <= e ? 0 : t - e, br = (t, e) => t <= 0 ? 0 : t + e, Fr = 1e3, hn = 2e3, Zn = 1048576, fr = 2 ** -10, Pn = (t) => t === "center" ? null : t === "bottom" ? "end" : "start", En = (t) => t !== null && t.panePosition <= 0 ? null : t, Xi = Object.freeze({ top: 0, bottom: 0 }), Bi = (t, e, r, n) => {
2502
2573
  const i = e + n.top, s = e + r - n.bottom;
2503
2574
  return t.top >= i - fr && t.bottom <= s + fr ? null : t.top < i || t.bottom - t.top > s - i ? { align: "top", offset: n.top } : { align: "bottom", offset: -n.bottom };
2504
2575
  }, qi = (t, e, r) => t <= fr ? "start" : t >= e - fr ? "end" : r !== null && Math.abs(t - r.panePosition) <= fr ? r.edge : "none", Yi = ({ translateY: t, snapEdge: e, children: r, boundaryRef: n }) => {
2505
2576
  const { ratio: i, attach: s } = Fn("[VirtualScroll] the items wrapper"), a = i === null ? t : _n(t, i, e);
2506
- return /* @__PURE__ */ Q("div", { ref: n, className: "aqvs-items-boundary", children: /* @__PURE__ */ Q("div", { ref: s, className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${a}px)`, willChange: "transform" }, children: r }) });
2577
+ return /* @__PURE__ */ Z("div", { ref: n, className: "aqvs-items-boundary", children: /* @__PURE__ */ Z("div", { ref: s, className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${a}px)`, willChange: "transform" }, children: r }) });
2507
2578
  }, Wi = 40, Gr = (t) => {
2508
2579
  if (!Number.isFinite(t)) return 0n;
2509
2580
  const e = Math.trunc(t);
2510
2581
  return e <= 0 ? 0n : BigInt(e);
2511
- }, Dr = (t, e, r) => {
2582
+ }, zr = (t, e, r) => {
2512
2583
  const n = r - 1, i = t.findIndexAtOrAfter(e, it);
2513
2584
  if (i.index === -1 || i.index > n || i.cumulative === void 0 || i.currentValue === void 0) {
2514
2585
  const s = t.prefixSum(n, it);
@@ -2519,77 +2590,74 @@ const Hi = 1e4, ds = () => {
2519
2590
  const a = Gr(n);
2520
2591
  if (a === 0n)
2521
2592
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
2522
- const l = (T) => T < 0n ? 0n : T >= a ? a - 1n : T, f = Dr(s, t, n);
2523
- let b = l(Gr(f.index));
2524
- const g = f.top - t, M = (T) => {
2525
- const A = Number(T);
2526
- if (!Number.isSafeInteger(A))
2593
+ const l = ($) => $ < 0n ? 0n : $ >= a ? a - 1n : $, f = zr(s, t, n);
2594
+ let g = l(Gr(f.index));
2595
+ const x = f.top - t, S = ($) => {
2596
+ const I = Number($);
2597
+ if (!Number.isSafeInteger(I))
2527
2598
  return null;
2528
- const { cumulative: P } = s.prefixSum(A, it);
2529
- if (!Number.isFinite(P))
2599
+ const { cumulative: R } = s.prefixSum(I, it);
2600
+ if (!Number.isFinite(R))
2530
2601
  return null;
2531
- const { index: Z } = s.findIndexAtOrAfter(P + 0.5, it);
2532
- if (Z === -1)
2602
+ const { index: X } = s.findIndexAtOrAfter(R + 0.5, it);
2603
+ if (X === -1)
2533
2604
  return null;
2534
- const $ = Gr(Z);
2535
- return $ > T ? $ : null;
2536
- }, N = (T, A) => {
2537
- let P = A, Z = T, $ = T, _ = 0;
2538
- for (; Z < a && P < e; ) {
2539
- const he = Number(Z), ne = i(he);
2540
- if (P += ne, $ = Z, Z += 1n, !Number.isFinite(ne) || ne < 0)
2605
+ const B = Gr(X);
2606
+ return B > $ ? B : null;
2607
+ }, N = ($, I) => {
2608
+ let R = I, X = $, B = $, k = 0;
2609
+ for (; X < a && R < e; ) {
2610
+ const be = Number(X), se = i(be);
2611
+ if (R += se, B = X, X += 1n, !Number.isFinite(se) || se < 0)
2541
2612
  break;
2542
- if (ne === 0) {
2543
- if (_ += 1, _ > Fr) {
2544
- const ie = M($);
2545
- if (ie !== null && ie > Z)
2546
- Z = ie, _ = 0;
2547
- else if (ie !== null && ie === Z && i(Number(Z)) > 0)
2548
- _ = 0;
2613
+ if (se === 0) {
2614
+ if (k += 1, k > Fr) {
2615
+ const oe = S(B);
2616
+ if (oe !== null && oe > X)
2617
+ X = oe, k = 0;
2618
+ else if (oe !== null && oe === X && i(Number(X)) > 0)
2619
+ k = 0;
2549
2620
  else
2550
2621
  break;
2551
2622
  }
2552
2623
  } else
2553
- _ = 0;
2624
+ k = 0;
2554
2625
  }
2555
- return { height: P, end: $ };
2626
+ return { height: R, end: B };
2556
2627
  };
2557
- let { height: S, end: L } = N(b, g);
2558
- if (S < e && b > 0n) {
2559
- let T = b, A = S + Math.abs(Math.min(0, g)), P = 0;
2560
- for (; T > 0n && A < e; ) {
2561
- T -= 1n;
2562
- const $ = Number(T), _ = i($);
2563
- if (A += _, !Number.isFinite(_) || _ < 0)
2628
+ let { height: M, end: _ } = N(g, x);
2629
+ if (M < e && g > 0n) {
2630
+ let $ = g, I = M + Math.abs(Math.min(0, x)), R = 0;
2631
+ for (; $ > 0n && I < e; ) {
2632
+ $ -= 1n;
2633
+ const B = Number($), k = i(B);
2634
+ if (I += k, !Number.isFinite(k) || k < 0)
2564
2635
  break;
2565
- if (_ === 0) {
2566
- if (P += 1, P > Fr) {
2567
- if (!Number.isSafeInteger($))
2636
+ if (k === 0) {
2637
+ if (R += 1, R > Fr) {
2638
+ if (!Number.isSafeInteger(B))
2568
2639
  break;
2569
- const { cumulative: he } = s.prefixSum($, it);
2570
- if (!Number.isFinite(he))
2571
- break;
2572
- const { index: ne } = s.findIndexAtOrAfter(he - 0.5, it), ie = ne === -1 ? -1n : Gr(ne);
2573
- if (ie >= 0n && ie < T)
2574
- T = ie + 1n, P = 0;
2575
- else if (ie === T && T >= 1n && i(Number(T - 1n)) > 0)
2576
- P = 0;
2640
+ const { cumulative: be } = s.prefixSum(B, it), { index: se } = s.findIndexAtOrAfter(be - 0.5, it), oe = se === -1 ? -1n : Gr(se);
2641
+ if (oe >= 0n && oe < $)
2642
+ $ = oe + 1n, R = 0;
2643
+ else if (oe === $ && $ >= 1n && i(Number($ - 1n)) > 0)
2644
+ R = 0;
2577
2645
  else
2578
2646
  break;
2579
2647
  }
2580
2648
  } else
2581
- P = 0;
2649
+ R = 0;
2582
2650
  }
2583
- b = l(T);
2584
- const Z = N(b, 0);
2585
- S = Z.height, L = Z.end;
2651
+ g = l($);
2652
+ const X = N(g, 0);
2653
+ M = X.height, _ = X.end;
2586
2654
  }
2587
- const X = l(b), K = l(L), ae = l(X - BigInt(Math.max(0, r))), De = l(K + BigInt(Math.max(0, r)));
2655
+ const F = l(g), J = l(_), ie = l(F - BigInt(Math.max(0, r))), ze = l(J + BigInt(Math.max(0, r)));
2588
2656
  return {
2589
- renderingStartIndex: ct(Number(ae), n),
2590
- renderingEndIndex: ct(Number(De), n),
2591
- visibleStartIndex: ct(Number(X), n),
2592
- visibleEndIndex: ct(Number(K), n)
2657
+ renderingStartIndex: lt(Number(ie), n),
2658
+ renderingEndIndex: lt(Number(ze), n),
2659
+ visibleStartIndex: lt(Number(F), n),
2660
+ visibleEndIndex: lt(Number(J), n)
2593
2661
  };
2594
2662
  }, Qn = (t, e, r, n, i, s, a) => {
2595
2663
  if (n === 0)
@@ -2597,65 +2665,65 @@ const Hi = 1e4, ds = () => {
2597
2665
  const f = Number.isFinite(a) ? Math.min(Math.max(0, t), a) : Math.max(0, t);
2598
2666
  if (n >= Number.MAX_SAFE_INTEGER)
2599
2667
  return Ui(f, e, r, n, i, s);
2600
- const b = Dr(s, f, n);
2601
- let g = b.index, M = b.top - f;
2602
- const N = M, S = (T, A) => {
2603
- let P = T, Z = A, $ = 0;
2604
- for (; P < n && Z < e; ) {
2605
- const _ = i(P);
2606
- if (Z += _, P++, !Number.isFinite(_) || _ < 0)
2668
+ const g = zr(s, f, n);
2669
+ let x = g.index, S = g.top - f;
2670
+ const N = S, M = ($, I) => {
2671
+ let R = $, X = I, B = 0;
2672
+ for (; R < n && X < e; ) {
2673
+ const k = i(R);
2674
+ if (X += k, R++, !Number.isFinite(k) || k < 0)
2607
2675
  break;
2608
- if (_ === 0) {
2609
- if ($++, $ > Fr) {
2610
- const { cumulative: he } = s.prefixSum(P - 1, it), { index: ne } = Number.isFinite(he) ? s.findIndexAtOrAfter(he + 0.5, it) : { index: -1 };
2611
- if (ne > P)
2612
- P = ne, $ = 0;
2613
- else if (ne === P && i(P) > 0)
2614
- $ = 0;
2676
+ if (k === 0) {
2677
+ if (B++, B > Fr) {
2678
+ const { cumulative: be } = s.prefixSum(R - 1, it), { index: se } = Number.isFinite(be) ? s.findIndexAtOrAfter(be + 0.5, it) : { index: -1 };
2679
+ if (se > R)
2680
+ R = se, B = 0;
2681
+ else if (se === R && i(R) > 0)
2682
+ B = 0;
2615
2683
  else
2616
2684
  break;
2617
2685
  }
2618
2686
  } else
2619
- $ = 0;
2687
+ B = 0;
2620
2688
  }
2621
- return { cursor: P, height: Z };
2622
- }, L = S(g, M);
2623
- let X = L.cursor;
2624
- if (M = L.height, M < e && g > 0) {
2625
- let T = M + Math.abs(Math.min(0, N)), A = g - 1, P = 0;
2626
- for (; A >= 0 && T < e; ) {
2627
- const $ = i(A);
2628
- if (T += $, !Number.isFinite($) || $ < 0) {
2629
- A--;
2689
+ return { cursor: R, height: X };
2690
+ }, _ = M(x, S);
2691
+ let F = _.cursor;
2692
+ if (S = _.height, S < e && x > 0) {
2693
+ let $ = S + Math.abs(Math.min(0, N)), I = x - 1, R = 0;
2694
+ for (; I >= 0 && $ < e; ) {
2695
+ const B = i(I);
2696
+ if ($ += B, !Number.isFinite(B) || B < 0) {
2697
+ I--;
2630
2698
  break;
2631
2699
  }
2632
- if ($ === 0) {
2633
- if (P++, P > Fr) {
2634
- const { cumulative: _ } = s.prefixSum(A, it), { index: he } = Number.isFinite(_) ? s.findIndexAtOrAfter(_ - 0.5, it) : { index: -1 };
2635
- if (he !== -1 && he < A) {
2636
- A = he, P = 0;
2700
+ if (B === 0) {
2701
+ if (R++, R > Fr) {
2702
+ const { cumulative: k } = s.prefixSum(I, it), { index: be } = s.findIndexAtOrAfter(k - 0.5, it);
2703
+ if (be !== -1 && be < I) {
2704
+ I = be, R = 0;
2637
2705
  continue;
2638
2706
  }
2639
- if (he === A && A >= 1 && i(A - 1) > 0)
2640
- P = 0;
2707
+ if (be === I && I >= 1 && i(I - 1) > 0)
2708
+ R = 0;
2641
2709
  else {
2642
- A--;
2710
+ I--;
2643
2711
  break;
2644
2712
  }
2645
2713
  }
2646
2714
  } else
2647
- P = 0;
2648
- A--;
2715
+ R = 0;
2716
+ I--;
2649
2717
  }
2650
- g = ct(A + 1, n);
2651
- const Z = S(g, 0);
2652
- X = Z.cursor, M = Z.height;
2718
+ x = lt(I + 1, n);
2719
+ const X = M(x, 0);
2720
+ F = X.cursor, S = X.height;
2653
2721
  }
2654
- const K = ct(g - r, n), ae = ct(Math.max(X - 1, g), n), De = ct(ae + r, n);
2655
- return { renderingStartIndex: K, renderingEndIndex: De, visibleStartIndex: g, visibleEndIndex: ae };
2722
+ const J = lt(x - r, n), ie = lt(Math.max(F - 1, x), n), ze = lt(ie + r, n);
2723
+ return { renderingStartIndex: J, renderingEndIndex: ze, visibleStartIndex: x, visibleEndIndex: ie };
2656
2724
  }, Nn = (t, e, r) => {
2657
- const n = Math.max(0, e ?? 0), i = u({ last: 0, id: null, arg: null }).current;
2658
- return q(
2725
+ const n = Math.max(0, e), i = u({ last: 0, id: null, arg: null }).current;
2726
+ return W(
2659
2727
  () => () => {
2660
2728
  if (i.id !== null && (cancelAnimationFrame(i.id), i.id = null), i.arg !== null && t.current) {
2661
2729
  try {
@@ -2677,8 +2745,8 @@ const Hi = 1e4, ds = () => {
2677
2745
  if (t.current)
2678
2746
  try {
2679
2747
  r(t.current, i.arg);
2680
- } catch (b) {
2681
- console.error("[useThrottledInvoker] Error invoking callback", b);
2748
+ } catch (g) {
2749
+ console.error("[useThrottledInvoker] Error invoking callback", g);
2682
2750
  }
2683
2751
  i.arg = null, i.last = l;
2684
2752
  }
@@ -2688,19 +2756,19 @@ const Hi = 1e4, ds = () => {
2688
2756
  },
2689
2757
  [n, r, t, i]
2690
2758
  );
2691
- }, Gi = Jn.memo(({ index: t, top: e, height: r, item: n, children: i, clipItemHeight: s, enableKeyboardNavigation: a, onKeyDown: l, onEscapeKeyDown: f, onFocus: b, registerItemRef: g }) => {
2692
- const M = p((K) => g(t, K), [t, g]), N = p((K) => l(K, t), [t, l]), S = p((K) => f?.(K, t), [t, f]), L = p(() => b(t), [t, b]), X = p((K) => {
2693
- K.currentTarget.focus({ preventScroll: !0 });
2759
+ }, Gi = Jn.memo(({ index: t, top: e, height: r, item: n, children: i, clipItemHeight: s, enableKeyboardNavigation: a, onKeyDown: l, onEscapeKeyDown: f, onFocus: g, registerItemRef: x }) => {
2760
+ const S = p((J) => x(t, J), [t, x]), N = p((J) => l(J, t), [t, l]), M = p((J) => f?.(J, t), [t, f]), _ = p(() => g(t), [t, g]), F = p((J) => {
2761
+ J.currentTarget.focus({ preventScroll: !0 });
2694
2762
  }, []);
2695
2763
  return (
2696
2764
  // 行ラッパーの role は消費側の複合ウィジェット契約 (listbox / tree / grid — README「Composite widget
2697
2765
  // roles」) の所有物で、パッケージが既定 role を課すと衝突する。キー/フォーカス結線は
2698
2766
  // enableKeyboardNavigation の行ナビゲーション機構そのもの。
2699
2767
  // biome-ignore lint/a11y/noStaticElementInteractions: role は消費側の複合ウィジェット契約の所有物 (上記)
2700
- /* @__PURE__ */ Q(
2768
+ /* @__PURE__ */ Z(
2701
2769
  "div",
2702
2770
  {
2703
- ref: M,
2771
+ ref: S,
2704
2772
  "data-index": t,
2705
2773
  "data-virtualscroll-item": "true",
2706
2774
  className: "aqvs-item-container",
@@ -2710,10 +2778,10 @@ const Hi = 1e4, ds = () => {
2710
2778
  overflow: s ? "hidden" : void 0
2711
2779
  },
2712
2780
  tabIndex: a ? -1 : void 0,
2713
- onPointerDown: a ? X : void 0,
2781
+ onPointerDown: a ? F : void 0,
2714
2782
  onKeyDownCapture: a ? N : void 0,
2715
- onKeyDown: a && f ? S : void 0,
2716
- onFocusCapture: a ? L : void 0,
2783
+ onKeyDown: a && f ? M : void 0,
2784
+ onFocusCapture: a ? _ : void 0,
2717
2785
  children: i(n, t)
2718
2786
  }
2719
2787
  )
@@ -2728,46 +2796,46 @@ const Hi = 1e4, ds = () => {
2728
2796
  className: a,
2729
2797
  testId: l,
2730
2798
  onScroll: f,
2731
- onRangeChange: b,
2732
- onScrollAdjust: g,
2733
- children: M,
2799
+ onRangeChange: g,
2800
+ onScrollAdjust: x,
2801
+ children: S,
2734
2802
  background: N,
2735
- initialScrollIndex: S,
2736
- initialScrollOffset: L,
2737
- initialScrollAnchor: X,
2738
- callbackThrottleMs: K = 5,
2739
- contentInsets: ae,
2740
- onItemFocus: De,
2741
- scrollBarOptions: T,
2742
- behaviorOptions: A,
2743
- onWheelHorizontal: P,
2744
- onPanHorizontal: Z,
2745
- horizontalKeyInputs: $,
2746
- horizontalKeyStep: _ = Wi,
2747
- contentProps: he,
2748
- liveRegion: ne,
2749
- locale: ie,
2750
- labels: Te
2803
+ initialScrollIndex: M,
2804
+ initialScrollOffset: _,
2805
+ initialScrollAnchor: F,
2806
+ callbackThrottleMs: J = 5,
2807
+ contentInsets: ie,
2808
+ onItemFocus: ze,
2809
+ scrollBarOptions: $,
2810
+ behaviorOptions: I,
2811
+ onWheelHorizontal: R,
2812
+ onPanHorizontal: X,
2813
+ horizontalKeyInputs: B,
2814
+ horizontalKeyStep: k = Wi,
2815
+ contentProps: be,
2816
+ liveRegion: se,
2817
+ locale: oe,
2818
+ labels: pe
2751
2819
  }, xe) => {
2752
- const { width: Le, enableThumbDrag: Tt, enableTrackClick: C, enableArrowButtons: W, enableArrowButtonTabStops: se, enableScrollToTopBottomButtons: He, renderThumbOverlay: ce, tapScrollCircleOptions: Pe } = T ?? {}, Rt = se === !1, re = ge(() => $n(ie, Te), [ie, Te]), { enablePointerDrag: st, pointerDragInputs: vt, enableKeyboardNavigation: ve = !0, enableEscapeRowReturn: Ke = !1, wheelSpeedMultiplier: Ae, inertiaOptions: Ze, overscrollBehavior: Qe, clipItemHeight: Vt = !1, resetOnGetItemHeightChange: we = !1 } = A ?? {}, [yt, $e] = Ve(0), D = i ?? yt, ot = p((c) => {
2820
+ const { width: ke, enableThumbDrag: je, enableTrackClick: C, enableArrowButtons: K, enableArrowButtonTabStops: ee, enableScrollToTopBottomButtons: He, renderThumbOverlay: ce, tapScrollCircleOptions: Pe } = $ ?? {}, Rt = ee === !1, ne = ge(() => $n(oe, pe), [oe, pe]), { enablePointerDrag: st, pointerDragInputs: wt, enableKeyboardNavigation: we = !0, enableEscapeRowReturn: Ke = !1, wheelSpeedMultiplier: Ve, inertiaOptions: Ze, overscrollBehavior: Qe, clipItemHeight: Vt = !1, resetOnGetItemHeightChange: Se = !1 } = I ?? {}, [yt, $e] = Ce(0), D = i ?? yt, ot = p((c) => {
2753
2821
  $e((h) => h === c ? h : c);
2754
- }, []), z = u(null), dt = u({
2822
+ }, []), A = u(null), ft = u({
2755
2823
  renderingStartIndex: 0,
2756
2824
  renderingEndIndex: 0,
2757
2825
  visibleStartIndex: 0,
2758
2826
  visibleEndIndex: 0,
2759
2827
  scrollPosition: 0,
2760
2828
  totalHeight: 0
2761
- }), O = u(X && t > 0 ? { index: te(Math.trunc(X.index), 0, t - 1), align: "top", offset: -Math.max(0, X.offsetPx ?? 0) } : null), Ee = u(!1), ft = u(!0);
2762
- q(() => {
2763
- if (ft.current) {
2764
- ft.current = !1;
2829
+ }), z = u(F && t > 0 ? { index: re(Math.trunc(F.index), 0, t - 1), align: "top", offset: -Math.max(0, F.offsetPx ?? 0) } : null), Ae = u(!1), ht = u(!0);
2830
+ W(() => {
2831
+ if (ht.current) {
2832
+ ht.current = !1;
2765
2833
  return;
2766
2834
  }
2767
- we && (O.current = null);
2768
- }, [we, n]);
2769
- const H = ge(() => In(ae), [ae]), [ht] = Ve(() => {
2770
- const h = X?.index ?? S, m = typeof h == "number" && Number.isFinite(h) ? Math.max(0, Math.trunc(h)) : 0;
2835
+ Se && (z.current = null);
2836
+ }, [Se, n]);
2837
+ const H = ge(() => In(ie), [ie]), [pt] = Ce(() => {
2838
+ const h = F?.index ?? M, m = typeof h == "number" && Number.isFinite(h) ? Math.max(0, Math.trunc(h)) : 0;
2771
2839
  return { from: Math.max(0, m - 50), to: m + 50 };
2772
2840
  }), At = ge(
2773
2841
  // 目的: Fenwick Tree のオプション設定
@@ -2775,101 +2843,101 @@ const Hi = 1e4, ds = () => {
2775
2843
  // itemCount には依存させない (依存させると追記のたびに options 参照が変わり、計測済み高さが全消去される)。
2776
2844
  // この useMemo により sampleRange を毎レンダー新規生成しない = 参照同一性由来の破壊的 reset を防ぐ。
2777
2845
  () => ({
2778
- sampleRange: ht,
2779
- resetOnValueFnChange: we,
2846
+ sampleRange: pt,
2847
+ resetOnValueFnChange: Se,
2780
2848
  materialize: !0
2781
2849
  }),
2782
- [we, ht]
2783
- ), y = jn(t, n, At), { revision: $t, change: pt } = Kn(y), [Xe] = Ve(() => {
2850
+ [Se, pt]
2851
+ ), y = jn(t, n, At), { revision: Ht, change: mt } = Kn(y), [Xe] = Ce(() => {
2784
2852
  let c = 0, h = 0;
2785
- if (X && t > 0) {
2786
- const m = te(Math.trunc(X.index), 0, t - 1), V = Math.max(0, X.offsetPx ?? 0), B = te(m - s * 2, 0, t - 1), G = te(m + s * 2, 0, t - 1), j = m > 0 || V > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: B, to: G }] } } : void 0, { cumulative: fe, total: ke, currentValue: Ge } = y.prefixSum(m, j), Me = Math.max(fe - Ge + V, 0);
2787
- c = br(Me, H.top), h = ke ?? y.getTotal();
2788
- } else if (typeof S == "number") {
2789
- const m = te(S, 0, t - 1), V = te(m - s * 2, 0, t - 1), B = te(m + s * 2, 0, t - 1), G = S > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: V, to: B }] } } : void 0, { cumulative: j, total: fe, currentValue: ke } = y.prefixSum(S, G), Ge = Math.max(j - ke, 0);
2790
- c = br(Ge, H.top), h = fe ?? y.getTotal();
2791
- } else typeof L == "number" && (c = br(Math.max(L, 0), H.top)), h = y.getTotal();
2853
+ if (F && t > 0) {
2854
+ const m = re(Math.trunc(F.index), 0, t - 1), V = Math.max(0, F.offsetPx ?? 0), q = re(m - s * 2, 0, t - 1), G = re(m + s * 2, 0, t - 1), j = m > 0 || V > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: q, to: G }] } } : void 0, { cumulative: fe, currentValue: Fe } = y.prefixSum(m, j), ct = Math.max(fe - Fe + V, 0);
2855
+ c = br(ct, H.top), h = y.getTotal();
2856
+ } else if (typeof M == "number") {
2857
+ const m = re(M, 0, t - 1), V = re(m - s * 2, 0, t - 1), q = re(m + s * 2, 0, t - 1), G = M > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: V, to: q }] } } : void 0, { cumulative: j, currentValue: fe } = y.prefixSum(M, G), Fe = Math.max(j - fe, 0);
2858
+ c = br(Fe, H.top), h = y.getTotal();
2859
+ } else typeof _ == "number" && (c = br(Math.max(_, 0), H.top)), h = y.getTotal();
2792
2860
  return { position: c, total: h };
2793
- }), [wt, Xt] = Ve(Xe.position), [v, Y] = Ve(Xe.total), [ee, le] = Ve(() => X && t > 0 || typeof S == "number" ? En({ edge: "start", panePosition: Xe.position }) : null), oe = u(ee), Ne = u(v), Re = p((c) => {
2794
- Ne.current !== c && (Ne.current = c, Y(c));
2795
- }, []), Se = p((c) => {
2796
- const h = oe.current, m = En(c);
2797
- h === m || h !== null && m !== null && h.edge === m.edge && h.panePosition === m.panePosition || (oe.current = m, le(m));
2861
+ }), [St, $t] = Ce(Xe.position), [v, Y] = Ce(Xe.total), [te, le] = Ce(() => F && t > 0 || typeof M == "number" ? En({ edge: "start", panePosition: Xe.position }) : null), ae = u(te), Ee = u(v), Te = p((c) => {
2862
+ Ee.current !== c && (Ee.current = c, Y(c));
2863
+ }, []), Me = p((c) => {
2864
+ const h = ae.current, m = En(c);
2865
+ h === m || h !== null && m !== null && h.edge === m.edge && h.panePosition === m.panePosition || (ae.current = m, le(m));
2798
2866
  }, []), at = p(
2799
2867
  (c, h) => {
2800
- const m = oe.current;
2801
- m === null || Math.abs(m.panePosition - c) > fr || Se({ edge: m.edge, panePosition: h });
2868
+ const m = ae.current;
2869
+ m === null || Math.abs(m.panePosition - c) > fr || Me({ edge: m.edge, panePosition: h });
2802
2870
  },
2803
- [Se]
2871
+ [Me]
2804
2872
  ), Be = p(() => {
2805
- oe.current !== null && Se(null);
2806
- }, [Se]), U = u(Xe.position), mt = u(H.top), be = u(f ?? void 0), ye = u(b ?? void 0), _e = u(g), Et = u(P), We = ($?.length ?? 0) > 0, qe = !!P;
2807
- q(() => {
2808
- We && (ve || F.warn("[VirtualScroll] horizontalKeyInputs is set but behaviorOptions.enableKeyboardNavigation is false; horizontal keyboard scrolling is disabled because the row key handler is not mounted."), qe || F.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(_) && _ > 0 || F.warn(`[VirtualScroll] horizontalKeyStep must be a finite positive number, received ${_}. Horizontal arrow keys are left untouched.`));
2809
- }, [We, qe, ve, _]);
2810
- const Je = u(/* @__PURE__ */ new Map()), w = u(null), I = u(null), [Ye, Ie] = Ve(null), [Ue, et] = Ve(!1), Oe = u(null), me = u(null), gt = u(null), Qt = u(null), hr = p(() => {
2811
- const c = me.current, h = gt.current, m = Qt.current;
2873
+ ae.current !== null && Me(null);
2874
+ }, [Me]), U = u(Xe.position), gt = u(H.top), ve = u(f ?? void 0), Re = u(g ?? void 0), Le = u(x), Et = u(R), Ue = (B?.length ?? 0) > 0, qe = !!R;
2875
+ W(() => {
2876
+ Ue && (we || L.warn("[VirtualScroll] horizontalKeyInputs is set but behaviorOptions.enableKeyboardNavigation is false; horizontal keyboard scrolling is disabled because the row key handler is not mounted."), qe || L.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(k) && k > 0 || L.warn(`[VirtualScroll] horizontalKeyStep must be a finite positive number, received ${k}. Horizontal arrow keys are left untouched.`));
2877
+ }, [Ue, qe, we, k]);
2878
+ const Je = u(/* @__PURE__ */ new Map()), w = u(null), P = u(null), [Ye, ye] = Ce(null), [Ge, et] = Ce(!1), _e = u(null), me = u(null), bt = u(null), Qt = u(null), hr = p(() => {
2879
+ const c = me.current, h = bt.current, m = Qt.current;
2812
2880
  if (c === null || h === null || m === null || c.dataset.visible !== "true")
2813
2881
  return Xi;
2814
- const V = Zr(c, "y"), B = m.getBoundingClientRect().top, G = h.getBoundingClientRect(), j = (G.top - B) / V, fe = (G.bottom - B) / V;
2815
- return j + fe < D ? { top: te(fe, 0, D), bottom: 0 } : { top: 0, bottom: te(D - j, 0, D) };
2816
- }, [D]), Ft = u(!1), St = u(0), zt = u(!1), Gt = u(!1), Dt = u(t);
2817
- Dt.current !== t && (Dt.current = t, Gt.current = !0), je(() => {
2818
- be.current = f ?? void 0, ye.current = b ?? void 0, _e.current = g, Et.current = P;
2819
- }, [b, f, g, P]);
2882
+ const V = Zr(c, "y"), q = m.getBoundingClientRect().top, G = h.getBoundingClientRect(), j = (G.top - q) / V, fe = (G.bottom - q) / V;
2883
+ return j + fe < D ? { top: re(fe, 0, D), bottom: 0 } : { top: 0, bottom: re(D - j, 0, D) };
2884
+ }, [D]), Ft = u(!1), Mt = u(0), Dt = u(!1), Gt = u(!1), zt = u(t);
2885
+ zt.current !== t && (zt.current = t, Gt.current = !0), We(() => {
2886
+ ve.current = f ?? void 0, Re.current = g ?? void 0, Le.current = x, Et.current = R;
2887
+ }, [g, f, x, R]);
2820
2888
  const or = p(
2821
2889
  (c) => {
2822
- if (ve && c && typeof c.focus == "function")
2890
+ if (we && c && typeof c.focus == "function")
2823
2891
  try {
2824
2892
  c.focus({ preventScroll: !0 });
2825
2893
  } catch {
2826
2894
  c.focus();
2827
2895
  }
2828
2896
  },
2829
- [ve]
2897
+ [we]
2830
2898
  ), Ir = p((c, { position: h, totalHeight: m }) => {
2831
2899
  c(h, m);
2832
- }, []), kt = Nn(be, K, Ir), xr = p((c, h) => {
2900
+ }, []), kt = Nn(ve, J, Ir), vr = p((c, h) => {
2833
2901
  c(h);
2834
- }, []), ar = Nn(ye, K, xr), Lt = u(H.top);
2902
+ }, []), ar = Nn(Re, J, vr), Lt = u(H.top);
2835
2903
  Lt.current = H.top;
2836
2904
  const cr = u(kt);
2837
- cr.current = kt, q(() => (Ee.current = !1, () => {
2838
- Ee.current = !0, Oe.current && (clearTimeout(Oe.current), Oe.current = null);
2839
- }), []), q(() => {
2840
- ve || (Je.current.clear(), w.current = null, I.current = null);
2841
- }, [ve]);
2842
- const Bt = p(
2905
+ cr.current = kt, W(() => (Ae.current = !1, () => {
2906
+ Ae.current = !0, _e.current && (clearTimeout(_e.current), _e.current = null);
2907
+ }), []), W(() => {
2908
+ we || (Je.current.clear(), w.current = null, P.current = null);
2909
+ }, [we]);
2910
+ const Xt = p(
2843
2911
  (c, h) => {
2844
2912
  if (!h) {
2845
2913
  Je.current.delete(c);
2846
2914
  return;
2847
2915
  }
2848
- ve && (Je.current.set(c, h), w.current === c && (w.current = null, I.current = c, or(h)));
2916
+ we && (Je.current.set(c, h), w.current === c && (w.current = null, P.current = c, or(h)));
2849
2917
  },
2850
- [ve, or]
2918
+ [we, or]
2851
2919
  ), d = 0.01, E = u({
2852
2920
  rafId: null,
2853
2921
  loopActive: !1,
2854
2922
  idleFrames: 0,
2855
2923
  lastRenderedPosition: Xe.position
2856
- }), k = p(() => {
2924
+ }), O = p(() => {
2857
2925
  const c = E.current;
2858
2926
  c.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(c.rafId), c.rafId = null, c.loopActive = !1, c.idleFrames = 0;
2859
2927
  }, []);
2860
- q(
2928
+ W(
2861
2929
  () => () => {
2862
- k();
2930
+ O();
2863
2931
  },
2864
- [k]
2932
+ [O]
2865
2933
  );
2866
2934
  const ue = u(() => {
2867
- }), ze = p(() => {
2935
+ }), De = p(() => {
2868
2936
  const c = E.current;
2869
2937
  c.rafId = null;
2870
- const h = U.current, m = Mt(h, Lt.current), V = y.getTotal();
2871
- if (Xt((G) => Math.abs(G - h) < d ? G : h), Math.abs(c.lastRenderedPosition - h) >= d ? (cr.current({ position: m, totalHeight: V }), c.lastRenderedPosition = h, c.idleFrames = 0) : c.idleFrames += 1, c.idleFrames >= 2) {
2872
- k();
2938
+ const h = U.current, m = Tt(h, Lt.current), V = y.getTotal();
2939
+ if ($t((G) => Math.abs(G - h) < d ? G : h), Math.abs(c.lastRenderedPosition - h) >= d ? (cr.current({ position: m, totalHeight: V }), c.lastRenderedPosition = h, c.idleFrames = 0) : c.idleFrames += 1, c.idleFrames >= 2) {
2940
+ O();
2873
2941
  return;
2874
2942
  }
2875
2943
  if (typeof requestAnimationFrame == "function") {
@@ -2877,260 +2945,260 @@ const Hi = 1e4, ds = () => {
2877
2945
  return;
2878
2946
  }
2879
2947
  c.loopActive = !1;
2880
- }, [y, k]);
2881
- ue.current = ze;
2948
+ }, [y, O]);
2949
+ ue.current = De;
2882
2950
  const tt = p(() => {
2883
2951
  const c = E.current;
2884
2952
  if (c.idleFrames = 0, !c.loopActive) {
2885
2953
  if (c.loopActive = !0, typeof requestAnimationFrame == "function") {
2886
- c.rafId = requestAnimationFrame(ze);
2954
+ c.rafId = requestAnimationFrame(De);
2887
2955
  return;
2888
2956
  }
2889
2957
  c.loopActive = !1;
2890
2958
  }
2891
- }, [ze]), de = p(
2959
+ }, [De]), de = p(
2892
2960
  (c, h) => {
2893
- const m = h?.immediate ?? !1, V = Mt(c, H.top);
2961
+ const m = h?.immediate ?? !1, V = Tt(c, H.top);
2894
2962
  if (U.current = c, m) {
2895
- E.current.lastRenderedPosition = c, E.current.idleFrames = 0, Xt(c), kt({ position: V, totalHeight: y.getTotal() });
2963
+ E.current.lastRenderedPosition = c, E.current.idleFrames = 0, $t(c), kt({ position: V, totalHeight: y.getTotal() });
2896
2964
  return;
2897
2965
  }
2898
2966
  tt();
2899
2967
  },
2900
2968
  [tt, y, H.top, kt]
2901
- ), Fe = p((c, h = 0) => {
2902
- const m = z.current;
2969
+ ), Oe = p((c, h = 0) => {
2970
+ const m = A.current;
2903
2971
  if (!m)
2904
2972
  return c;
2905
2973
  const V = m.getScrollPosition();
2906
- St.current += 1;
2907
- const B = m.getContentSize() + h, G = m.getViewportSize(), j = m.scrollTo(c, { contentSize: B, viewportSize: G });
2908
- return j === V && (St.current = Math.max(0, St.current - 1)), Math.abs(j - c) > 0.5 && (zt.current = !0), j;
2909
- }, []), bt = p((c, h) => {
2910
- const m = z.current;
2974
+ Mt.current += 1;
2975
+ const q = m.getContentSize() + h, G = m.getViewportSize(), j = m.scrollTo(c, { contentSize: q, viewportSize: G });
2976
+ return j === V && (Mt.current = Math.max(0, Mt.current - 1)), Math.abs(j - c) > 0.5 && (Dt.current = !0), j;
2977
+ }, []), vt = p((c, h) => {
2978
+ const m = A.current;
2911
2979
  if (m === null) {
2912
2980
  h();
2913
2981
  return;
2914
2982
  }
2915
2983
  const V = m.getScrollPosition();
2916
2984
  h();
2917
- const B = _e.current;
2918
- if (B === void 0)
2985
+ const q = Le.current;
2986
+ if (q === void 0)
2919
2987
  return;
2920
- const G = Mt(m.getScrollPosition(), Lt.current), j = G - Mt(V, Lt.current);
2921
- j !== 0 && B({ position: G, delta: j, cause: c });
2988
+ const G = Tt(m.getScrollPosition(), Lt.current), j = G - Tt(V, Lt.current);
2989
+ j !== 0 && q({ position: G, delta: j, cause: c });
2922
2990
  }, []), jt = u(!1);
2923
- q(() => {
2991
+ W(() => {
2924
2992
  if (!jt.current)
2925
- if (jt.current = !0, X == null && typeof S != "number" && typeof L == "number") {
2926
- const c = br(Math.max(L, 0), H.top), h = Math.abs(c - U.current) > 0.5;
2927
- de(c, { immediate: !0 }), h && z.current?.scrollTo(c);
2993
+ if (jt.current = !0, F == null && typeof M != "number" && typeof _ == "number") {
2994
+ const c = br(Math.max(_, 0), H.top), h = Math.abs(c - U.current) > 0.5;
2995
+ de(c, { immediate: !0 }), h && A.current?.scrollTo(c);
2928
2996
  } else
2929
2997
  de(U.current, { immediate: !0 });
2930
- }, [X, S, L, H.top, de]), q(() => {
2998
+ }, [F, M, _, H.top, de]), W(() => {
2931
2999
  const c = y.getTotal();
2932
3000
  if (v !== c) {
2933
- Re(c);
3001
+ Te(c);
2934
3002
  return;
2935
3003
  }
2936
- if (zt.current) {
2937
- zt.current = !1;
2938
- const h = z.current;
2939
- h && Math.abs(h.getScrollPosition() - U.current) > 0.5 && bt("re-issue", () => {
2940
- const m = Fe(U.current);
2941
- zt.current = !1, de(m, { immediate: !0 });
3004
+ if (Dt.current) {
3005
+ Dt.current = !1;
3006
+ const h = A.current;
3007
+ h && Math.abs(h.getScrollPosition() - U.current) > 0.5 && vt("re-issue", () => {
3008
+ const m = Oe(U.current);
3009
+ Dt.current = !1, de(m, { immediate: !0 });
2942
3010
  });
2943
3011
  }
2944
- }, [y, v, t, bt, Fe, de]), q(() => {
2945
- if (O.current !== null) {
2946
- const { index: c, align: h, offset: m } = O.current, V = ct(c, t), { cumulative: B, currentValue: G } = y.prefixSum(V, it);
2947
- if (B !== void 0 && G !== void 0) {
2948
- const j = Math.max(B - G, 0);
3012
+ }, [y, v, t, vt, Oe, de]), W(() => {
3013
+ if (z.current !== null) {
3014
+ const { index: c, align: h, offset: m } = z.current, V = lt(c, t), { cumulative: q, currentValue: G } = y.prefixSum(V, it);
3015
+ if (q !== void 0 && G !== void 0) {
3016
+ const j = Math.max(q - G, 0);
2949
3017
  let fe = j;
2950
- h === "bottom" ? fe = B - D : h === "center" && (fe = j + G / 2 - D / 2), m && (fe -= m), fe = Math.max(0, fe);
2951
- const ke = Math.max(0, v + H.top + H.bottom - D), Ge = Math.min(br(fe, H.top), ke);
2952
- Math.abs(Ge - U.current) > fr && (F.debug("[VirtualScroll] Drift correction", {
3018
+ h === "bottom" ? fe = q - D : h === "center" && (fe = j + G / 2 - D / 2), m && (fe -= m), fe = Math.max(0, fe);
3019
+ const Fe = Math.max(0, v + H.top + H.bottom - D), ct = Math.min(br(fe, H.top), Fe);
3020
+ Math.abs(ct - U.current) > fr && (L.debug("[VirtualScroll] Drift correction", {
2953
3021
  from: U.current,
2954
- to: Ge,
3022
+ to: ct,
2955
3023
  targetIndex: V
2956
- }), bt("drift", () => {
2957
- St.current === 0 && (St.current += 1), z.current?.scrollTo(Ge), de(Ge, { immediate: !0 });
2958
- const Me = Pn(h);
2959
- Se(Me === null ? null : { edge: Me, panePosition: Ge });
3024
+ }), vt("drift", () => {
3025
+ Mt.current === 0 && (Mt.current += 1), A.current?.scrollTo(ct), de(ct, { immediate: !0 });
3026
+ const Ie = Pn(h);
3027
+ Me(Ie === null ? null : { edge: Ie, panePosition: ct });
2960
3028
  }));
2961
3029
  }
2962
3030
  }
2963
3031
  Gt.current = !1;
2964
- }, [v, y, t, H.top, bt, Se, de, D, H.bottom, Re]), q(() => {
2965
- const c = mt.current;
2966
- if (c === H.top || (mt.current = H.top, O.current))
3032
+ }, [v, y, t, H.top, vt, Me, de, D, H.bottom, Te]), W(() => {
3033
+ const c = gt.current;
3034
+ if (c === H.top || (gt.current = H.top, z.current))
2967
3035
  return;
2968
- const h = Mt(U.current, c), m = br(h, H.top);
2969
- U.current = m, z.current?.scrollTo(m), de(m, { immediate: !0 });
3036
+ const h = Tt(U.current, c), m = br(h, H.top);
3037
+ U.current = m, A.current?.scrollTo(m), de(m, { immediate: !0 });
2970
3038
  }, [H.top, de]);
2971
3039
  const It = p(
2972
3040
  (c, h) => {
2973
3041
  if (t === 0)
2974
3042
  return;
2975
- const m = ct(c, t), V = y.get(m), B = h - V, G = pt(() => y.update(m, h));
2976
- G !== void 0 && Re(G), F.debug("[VirtualScroll] Updated item size manually", { index: m, size: h, total: G });
2977
- let j = O.current ? O.current.index : null;
3043
+ const m = lt(c, t), V = y.get(m), q = h - V, G = mt(() => y.update(m, h));
3044
+ G !== void 0 && Te(G), L.debug("[VirtualScroll] Updated item size manually", { index: m, size: h, total: G });
3045
+ let j = z.current ? z.current.index : null;
2978
3046
  if (j === null) {
2979
- const fe = U.current, ke = In(ae).top, Ge = Mt(fe, ke);
2980
- j = Dr(y, Ge, t).index;
3047
+ const fe = U.current, Fe = In(ie).top, ct = Tt(fe, Fe);
3048
+ j = zr(y, ct, t).index;
2981
3049
  }
2982
- if (m < j && B !== 0) {
2983
- const fe = U.current, ke = fe + B;
2984
- bt("item-resize", () => {
2985
- Fe(ke, B), de(ke, { immediate: !0 }), at(fe, ke);
2986
- }), F.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: fe, to: ke, causedByIndex: m, delta: B, activeVisibleStartIndex: j });
3050
+ if (m < j && q !== 0) {
3051
+ const fe = U.current, Fe = fe + q;
3052
+ vt("item-resize", () => {
3053
+ Oe(Fe, q), de(Fe, { immediate: !0 }), at(fe, Fe);
3054
+ }), L.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: fe, to: Fe, causedByIndex: m, delta: q, activeVisibleStartIndex: j });
2987
3055
  }
2988
3056
  },
2989
- [y, t, bt, at, pt, Fe, de, ae, Re]
3057
+ [y, t, vt, at, mt, Oe, de, ie, Te]
2990
3058
  ), rt = p(
2991
3059
  (c, h) => {
2992
- if (!z.current || t === 0)
3060
+ if (!A.current || t === 0)
2993
3061
  return;
2994
- const m = ct(c, t);
3062
+ const m = lt(c, t);
2995
3063
  let V;
2996
3064
  if (h?.align === "nearest") {
2997
3065
  const Yr = h.offset;
2998
3066
  if (Yr !== void 0)
2999
3067
  throw new RangeError(`[VirtualScroll] scrollToIndex: align "nearest" takes no offset (it lands the row at the edge of the band a visible scroll-to-edge pill leaves); received an offset of type ${typeof Yr}.`);
3000
- const o = y.prefixSum(m, it), x = Bi({ top: o.cumulative - o.currentValue, bottom: o.cumulative }, Mt(U.current, H.top), D, hr());
3001
- if (x === null)
3068
+ const o = y.prefixSum(m, it), b = Bi({ top: o.cumulative - o.currentValue, bottom: o.cumulative }, Tt(U.current, H.top), D, hr());
3069
+ if (b === null)
3002
3070
  return;
3003
- V = x;
3071
+ V = b;
3004
3072
  } else
3005
3073
  V = h;
3006
- const B = ct(m - s * 2, t), G = ct(m + s * 2, t), { cumulative: j, total: fe, currentValue: ke } = pt(() => y.prefixSum(m, { materializeOption: { materialize: !0, ranges: [{ from: B, to: G }] } }));
3007
- if (F.debug("[VirtualScroll] Scrolling to index:", m, "ItemBottom:", j, "Total height:", fe, "ItemHeight:", ke, "safeIndexFrom:", B, "safeIndexTo:", G), !fe)
3074
+ const q = lt(m - s * 2, t), G = lt(m + s * 2, t), { cumulative: j, total: fe, currentValue: Fe } = mt(() => y.prefixSum(m, { materializeOption: { materialize: !0, ranges: [{ from: q, to: G }] } }));
3075
+ if (L.debug("[VirtualScroll] Scrolling to index:", m, "ItemBottom:", j, "Total height:", fe, "ItemHeight:", Fe, "safeIndexFrom:", q, "safeIndexTo:", G), !fe)
3008
3076
  return;
3009
- const Ge = Math.max(j - ke, 0);
3010
- let Me = Ge;
3011
- V?.align === "bottom" ? Me = j - D : V?.align === "center" && (Me = Ge + ke / 2 - D / 2), V?.offset && (Me -= V.offset), Me = Math.max(0, Me);
3012
- const Ht = br(Me, H.top), xt = z.current?.getContentSize() ?? fe + H.top + H.bottom, ut = Math.max(0, xt - D), _t = Math.min(Ht, ut);
3013
- O.current = {
3077
+ const ct = Math.max(j - Fe, 0);
3078
+ let Ie = ct;
3079
+ V?.align === "bottom" ? Ie = j - D : V?.align === "center" && (Ie = ct + Fe / 2 - D / 2), V?.offset && (Ie -= V.offset), Ie = Math.max(0, Ie);
3080
+ const Wt = br(Ie, H.top), xt = A.current?.getContentSize() ?? fe + H.top + H.bottom, dt = Math.max(0, xt - D), _t = Math.min(Wt, dt);
3081
+ z.current = {
3014
3082
  index: m,
3015
3083
  align: V?.align,
3016
3084
  offset: V?.offset
3017
3085
  };
3018
3086
  const ir = Pn(V?.align);
3019
- Se(ir === null ? null : { edge: ir, panePosition: _t });
3020
- const Mr = !E.current.loopActive && U.current === _t, Br = z.current?.getScrollPosition() ?? -1, qr = Math.abs(Br - _t) > fr;
3021
- Ft.current = !1, St.current = 0, qr && (Ft.current = !0, St.current += 1, z.current?.scrollTo(_t)), Re(fe), Mr || de(_t, { immediate: !0 }), F.debug("[VirtualScroll] Setting scroll position to:", _t, { original: Ht, max: ut });
3087
+ Me(ir === null ? null : { edge: ir, panePosition: _t });
3088
+ const Mr = !E.current.loopActive && U.current === _t, Br = A.current?.getScrollPosition() ?? -1, qr = Math.abs(Br - _t) > fr;
3089
+ Ft.current = !1, Mt.current = 0, qr && (Ft.current = !0, Mt.current += 1, A.current?.scrollTo(_t)), Te(fe), Mr || de(_t, { immediate: !0 }), L.debug("[VirtualScroll] Setting scroll position to:", _t, { original: Wt, max: dt });
3022
3090
  },
3023
- [y, s, t, H.top, H.bottom, D, pt, hr, Se, de, Re]
3024
- ), Jt = u(X && t === 0 ? X : null);
3025
- q(() => {
3091
+ [y, s, t, H.top, H.bottom, D, mt, hr, Me, de, Te]
3092
+ ), Jt = u(F && t === 0 ? F : null);
3093
+ W(() => {
3026
3094
  const c = Jt.current;
3027
- !c || t === 0 || (Jt.current = null, rt(te(Math.trunc(c.index), 0, t - 1), { align: "top", offset: -Math.max(0, c.offsetPx ?? 0) }));
3095
+ !c || t === 0 || (Jt.current = null, rt(re(Math.trunc(c.index), 0, t - 1), { align: "top", offset: -Math.max(0, c.offsetPx ?? 0) }));
3028
3096
  }, [t, rt]);
3029
- const qt = p(
3097
+ const Bt = p(
3030
3098
  (c) => {
3031
- if (!z.current || t === 0)
3099
+ if (!A.current || t === 0)
3032
3100
  return;
3033
- const h = y.getTotal(), m = te(Math.floor(c), 0, h), V = Dr(y, m, t);
3101
+ const h = y.getTotal(), m = re(Math.floor(c), 0, h), V = zr(y, m, t);
3034
3102
  rt(V.index, { offset: V.top - m });
3035
3103
  },
3036
3104
  [y, t, rt]
3037
3105
  ), er = p(() => {
3038
3106
  if (t === 0)
3039
3107
  return null;
3040
- const c = Mt(U.current, H.top), h = Dr(y, c, t);
3108
+ const c = Tt(U.current, H.top), h = zr(y, c, t);
3041
3109
  return { index: h.index, offsetPx: Math.max(0, c - h.top) };
3042
3110
  }, [y, t, H.top]), lr = p(
3043
3111
  (c) => {
3044
- const h = Mt(U.current, H.top), m = typeof c == "function" ? c(h) : c;
3045
- qt(m);
3046
- const V = z.current?.getScrollPosition(), B = typeof V == "number" ? V : U.current;
3047
- return de(B), Mt(B, Lt.current);
3112
+ const h = Tt(U.current, H.top), m = typeof c == "function" ? c(h) : c;
3113
+ Bt(m);
3114
+ const V = A.current?.getScrollPosition(), q = typeof V == "number" ? V : U.current;
3115
+ return de(q), Tt(q, Lt.current);
3048
3116
  },
3049
- [H.top, qt, de]
3117
+ [H.top, Bt, de]
3050
3118
  ), tr = p((c) => {
3051
- const h = z.current;
3119
+ const h = A.current;
3052
3120
  if (!h)
3053
- return Mt(U.current, Lt.current);
3121
+ return Tt(U.current, Lt.current);
3054
3122
  const m = h.scrollTo((V) => V + c);
3055
- return Mt(m, Lt.current);
3056
- }, []), Nt = p((c) => z.current?.applyWheel(c) ?? !1, []), pr = p(
3123
+ return Tt(m, Lt.current);
3124
+ }, []), Nt = p((c) => A.current?.applyWheel(c) ?? !1, []), pr = p(
3057
3125
  (c, h) => {
3058
- F.debug("[VirtualScroll] Scroll position changed:", c);
3126
+ L.debug("[VirtualScroll] Scroll position changed:", c);
3059
3127
  const m = Ft.current;
3060
3128
  m && (Ft.current = !1);
3061
- const V = St.current > 0;
3062
- V && (St.current = 0);
3063
- const B = Gt.current && Dt.current === t;
3064
- if (m || V || B || (O.current = null, Be()), de(c), He) {
3129
+ const V = Mt.current > 0;
3130
+ V && (Mt.current = 0);
3131
+ const q = Gt.current && zt.current === t;
3132
+ if (m || V || q || (z.current = null, Be()), de(c), He) {
3065
3133
  if (m || V)
3066
3134
  return;
3067
3135
  const G = c - h;
3068
- if (F.debug("[VirtualScroll] Scroll diff:", G, "New:", c, "Prev:", h), Math.abs(G) > 1) {
3136
+ if (L.debug("[VirtualScroll] Scroll diff:", G, "New:", c, "Prev:", h), Math.abs(G) > 1) {
3069
3137
  const j = G > 0 ? "down" : "up";
3070
- Ie(j), et(!0), F.debug("[VirtualScroll] Showing scroll buttons. Direction:", j), Oe.current && clearTimeout(Oe.current), Oe.current = setTimeout(() => {
3071
- et(!1), F.debug("[VirtualScroll] Hiding scroll buttons");
3138
+ ye(j), et(!0), L.debug("[VirtualScroll] Showing scroll buttons. Direction:", j), _e.current && clearTimeout(_e.current), _e.current = setTimeout(() => {
3139
+ et(!1), L.debug("[VirtualScroll] Hiding scroll buttons");
3072
3140
  }, 2e3);
3073
3141
  }
3074
3142
  }
3075
3143
  },
3076
3144
  [de, Be, He, t]
3077
- ), Ct = ge(() => Mt(wt, H.top), [H.top, wt]), lt = ge(() => {
3145
+ ), Ct = ge(() => Tt(St, H.top), [H.top, St]), ut = ge(() => {
3078
3146
  const c = y.getTotal(), h = Qn(Ct, D, s, t, n, y, c);
3079
- return F.debug("[VirtualScroll] Calculated rendering range:", () => ({
3147
+ return L.debug("[VirtualScroll] Calculated rendering range:", () => ({
3080
3148
  ...h,
3081
3149
  scrollPosition: Ct,
3082
3150
  renderingContentSize: c,
3083
3151
  overscanCount: s,
3084
3152
  viewportSize: D
3085
3153
  })), h;
3086
- }, [Ct, D, s, t, n, y, $t]), { renderingStartIndex: rr, renderingEndIndex: Pt, visibleStartIndex: Yt, visibleEndIndex: Wt } = lt, Ce = p(
3154
+ }, [Ct, D, s, t, n, y, Ht]), { renderingStartIndex: rr, renderingEndIndex: Pt, visibleStartIndex: qt, visibleEndIndex: Yt } = ut, Ne = p(
3087
3155
  (c, h) => {
3088
- if (!ve || t === 0)
3156
+ if (!we || t === 0)
3089
3157
  return;
3090
- const m = ct(c, t), V = h?.ensureVisible ?? !0;
3158
+ const m = lt(c, t), V = h?.ensureVisible ?? !0;
3091
3159
  V && rt(m, { align: "nearest" });
3092
- const B = Je.current.get(m);
3093
- if (B) {
3094
- w.current = null, I.current = m, or(B);
3160
+ const q = Je.current.get(m);
3161
+ if (q) {
3162
+ w.current = null, P.current = m, or(q);
3095
3163
  return;
3096
3164
  }
3097
3165
  V && (w.current = m);
3098
3166
  },
3099
- [ve, t, rt, or]
3100
- ), vr = p(
3167
+ [we, t, rt, or]
3168
+ ), xr = p(
3101
3169
  (c, h) => {
3102
- if (!(!ve || c.defaultPrevented) && !(c.altKey || c.metaKey || c.ctrlKey) && c.target === c.currentTarget && !c.currentTarget.isContentEditable) {
3170
+ if (!(!we || c.defaultPrevented) && !(c.altKey || c.metaKey || c.ctrlKey) && c.target === c.currentTarget && !c.currentTarget.isContentEditable) {
3103
3171
  if (c.key === "ArrowLeft" || c.key === "ArrowRight") {
3104
3172
  const m = Et.current;
3105
- if (!m || c.shiftKey || !$?.includes("arrow") || !(Number.isFinite(_) && _ > 0))
3173
+ if (!m || c.shiftKey || !B?.includes("arrow") || !(Number.isFinite(k) && k > 0))
3106
3174
  return;
3107
- c.preventDefault(), m(c.key === "ArrowLeft" ? -_ : _);
3175
+ c.preventDefault(), m(c.key === "ArrowLeft" ? -k : k);
3108
3176
  return;
3109
3177
  }
3110
3178
  if (c.key === "ArrowDown") {
3111
- h < t - 1 && (c.preventDefault(), Ce(h + 1));
3179
+ h < t - 1 && (c.preventDefault(), Ne(h + 1));
3112
3180
  return;
3113
3181
  }
3114
3182
  if (c.key === "ArrowUp") {
3115
- h > 0 && (c.preventDefault(), Ce(h - 1));
3183
+ h > 0 && (c.preventDefault(), Ne(h - 1));
3116
3184
  return;
3117
3185
  }
3118
3186
  if (c.key === "PageDown") {
3119
3187
  if (h < t - 1) {
3120
3188
  c.preventDefault();
3121
- const { visibleStartIndex: m, visibleEndIndex: V } = dt.current, B = Math.max(V - m + 1, 1), G = Math.max(B, 1), j = ct(Math.min(h + G, t - 1), t);
3122
- Ce(j);
3189
+ const { visibleStartIndex: m, visibleEndIndex: V } = ft.current, q = Math.max(V - m + 1, 1), G = Math.max(q, 1), j = lt(Math.min(h + G, t - 1), t);
3190
+ Ne(j);
3123
3191
  }
3124
3192
  return;
3125
3193
  }
3126
3194
  if (c.key === "PageUp" && h > 0) {
3127
3195
  c.preventDefault();
3128
- const { visibleStartIndex: m, visibleEndIndex: V } = dt.current, B = Math.max(V - m + 1, 1), G = Math.max(B, 1), j = ct(h - G, t);
3129
- Ce(j);
3196
+ const { visibleStartIndex: m, visibleEndIndex: V } = ft.current, q = Math.max(V - m + 1, 1), G = Math.max(q, 1), j = lt(h - G, t);
3197
+ Ne(j);
3130
3198
  }
3131
3199
  }
3132
3200
  },
3133
- [ve, t, Ce, $, _]
3201
+ [we, t, Ne, B, k]
3134
3202
  ), Pr = p(
3135
3203
  /**
3136
3204
  * Returns focus from an element inside the row back to the row wrapper on Escape.
@@ -3143,26 +3211,26 @@ const Hi = 1e4, ds = () => {
3143
3211
  if (c.key !== "Escape" || c.defaultPrevented || c.nativeEvent.isComposing || c.target === c.currentTarget)
3144
3212
  return;
3145
3213
  const m = c.target;
3146
- m instanceof HTMLInputElement || m instanceof HTMLTextAreaElement || m instanceof HTMLSelectElement || m.isContentEditable || (c.preventDefault(), Ce(h));
3214
+ m instanceof HTMLInputElement || m instanceof HTMLTextAreaElement || m instanceof HTMLSelectElement || m.isContentEditable || (c.preventDefault(), Ne(h));
3147
3215
  },
3148
- [Ce]
3216
+ [Ne]
3149
3217
  ), Er = p(
3150
3218
  (c) => {
3151
- if (!ve)
3219
+ if (!we)
3152
3220
  return;
3153
- const h = ct(c, t);
3154
- w.current = null, I.current = h, De?.(h);
3221
+ const h = lt(c, t);
3222
+ w.current = null, P.current = h, ze?.(h);
3155
3223
  },
3156
- [ve, t, De]
3224
+ [we, t, ze]
3157
3225
  );
3158
- q(() => {
3159
- const c = z.current?.getScrollPosition() ?? 0, h = U.current, m = Mt(h, H.top);
3160
- F.debug("[VirtualScroll] Range change effect triggered", () => ({
3226
+ W(() => {
3227
+ const c = A.current?.getScrollPosition() ?? 0, h = U.current, m = Tt(h, H.top);
3228
+ L.debug("[VirtualScroll] Range change effect triggered", () => ({
3161
3229
  renderingStartIndex: rr,
3162
3230
  renderingEndIndex: Pt,
3163
- visibleStartIndex: Yt,
3164
- visibleEndIndex: Wt,
3165
- scrollPositionState: wt,
3231
+ visibleStartIndex: qt,
3232
+ visibleEndIndex: Yt,
3233
+ scrollPositionState: St,
3166
3234
  paneScrollPosition: h,
3167
3235
  logicalScrollPosition: m,
3168
3236
  contentSize: v,
@@ -3170,141 +3238,140 @@ const Hi = 1e4, ds = () => {
3170
3238
  })), ar({
3171
3239
  renderingStartIndex: rr,
3172
3240
  renderingEndIndex: Pt,
3173
- visibleStartIndex: Yt,
3174
- visibleEndIndex: Wt,
3241
+ visibleStartIndex: qt,
3242
+ visibleEndIndex: Yt,
3175
3243
  scrollPosition: m,
3176
3244
  totalHeight: v
3177
3245
  });
3178
- }, [v, Pt, rr, H.top, ar, wt, Wt, Yt]);
3246
+ }, [v, Pt, rr, H.top, ar, St, Yt, qt]);
3179
3247
  const en = p(() => {
3180
3248
  if (!He)
3181
3249
  return null;
3182
- const c = Ue && Ye !== null, h = Ye === "up", m = c && !Rt ? 0 : -1;
3183
- return /* @__PURE__ */ Q("div", { ref: me, className: "aqvs-scroll-to-edge-overlay", "data-visible": c, inert: !c, "aria-hidden": Rt ? !0 : void 0, onPointerDown: Rt ? qn : void 0, children: h ? /* @__PURE__ */ Q("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ Q(
3250
+ const c = Ge && Ye !== null, h = Ye === "up", m = c && !Rt ? 0 : -1;
3251
+ return /* @__PURE__ */ Z("div", { ref: me, className: "aqvs-scroll-to-edge-overlay", "data-visible": c, inert: !c, "aria-hidden": Rt ? !0 : void 0, onPointerDown: Rt ? qn : void 0, children: h ? /* @__PURE__ */ Z("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ Z(
3184
3252
  "button",
3185
3253
  {
3186
- ref: gt,
3254
+ ref: bt,
3187
3255
  type: "button",
3188
3256
  className: "aqvs-scroll-to-edge-button",
3189
3257
  tabIndex: m,
3190
3258
  onClick: (V) => {
3191
3259
  V.stopPropagation(), Ft.current = !0, rt(0), et(!1);
3192
3260
  },
3193
- children: re.scrollToTop
3261
+ children: ne.scrollToTop
3194
3262
  }
3195
- ) }) : /* @__PURE__ */ Q("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ Q(
3263
+ ) }) : /* @__PURE__ */ Z("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ Z(
3196
3264
  "button",
3197
3265
  {
3198
- ref: gt,
3266
+ ref: bt,
3199
3267
  type: "button",
3200
3268
  className: "aqvs-scroll-to-edge-button",
3201
3269
  tabIndex: m,
3202
3270
  onClick: (V) => {
3203
3271
  V.stopPropagation(), Ft.current = !0, rt(t - 1), et(!1);
3204
3272
  },
3205
- children: re.scrollToBottom
3273
+ children: ne.scrollToBottom
3206
3274
  }
3207
3275
  ) }) });
3208
- }, [He, Rt, Ue, Ye, rt, t, re]), Nr = u(0), { visibleItems: Cr, renderAnchor: mr } = ge(() => {
3276
+ }, [He, Rt, Ge, Ye, rt, t, ne]), Nr = u(0), { visibleItems: Cr, renderAnchor: mr } = ge(() => {
3209
3277
  if (t === 0)
3210
3278
  return {
3211
- visibleItems: /* @__PURE__ */ Q("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ Q("div", { className: "aqvs-no-items-text", children: re.noItems }) }),
3279
+ visibleItems: /* @__PURE__ */ Z("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ Z("div", { className: "aqvs-no-items-text", children: ne.noItems }) }),
3212
3280
  renderAnchor: 0
3213
3281
  };
3214
- const c = ct(rr, t), h = ct(Pt, t), { cumulative: m, currentValue: V } = y.prefixSum(c, it), B = m - V;
3215
- Number.isFinite(B) && Math.abs(B - Nr.current) > Zn && (Nr.current = B);
3282
+ const c = lt(rr, t), h = lt(Pt, t), { cumulative: m, currentValue: V } = y.prefixSum(c, it), q = m - V;
3283
+ Number.isFinite(q) && Math.abs(q - Nr.current) > Zn && (Nr.current = q);
3216
3284
  const G = Nr.current, j = [], fe = [];
3217
- let ke = 0, Ge = B;
3218
- for (let Me = c; Me <= h; Me++) {
3285
+ let Fe = 0, ct = q;
3286
+ for (let Ie = c; Ie <= h; Ie++) {
3219
3287
  if (fe.length >= hn) {
3220
- F.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: hn, safeRenderingStartIndex: c, safeRenderingEndIndex: h });
3288
+ L.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: hn, safeRenderingStartIndex: c, safeRenderingEndIndex: h });
3221
3289
  break;
3222
3290
  }
3223
- const Ht = n(Me), xt = y.get(Me), ut = Ht - xt;
3224
- ut !== 0 && j.push({ index: Me, value: Ht });
3225
- const _t = Ge + ke, ir = r ? r(Me) : Me;
3291
+ const Wt = n(Ie), xt = y.get(Ie), dt = Wt - xt;
3292
+ dt !== 0 && j.push({ index: Ie, value: Wt });
3293
+ const _t = ct + Fe, ir = r ? r(Ie) : Ie;
3226
3294
  fe.push(
3227
- /* @__PURE__ */ Q(
3295
+ /* @__PURE__ */ Z(
3228
3296
  Gi,
3229
3297
  {
3230
- index: Me,
3298
+ index: Ie,
3231
3299
  top: _t - G,
3232
- height: Ht,
3233
- item: e(Me),
3300
+ height: Wt,
3301
+ item: e(Ie),
3234
3302
  clipItemHeight: Vt,
3235
- enableKeyboardNavigation: ve,
3236
- onKeyDown: vr,
3303
+ enableKeyboardNavigation: we,
3304
+ onKeyDown: xr,
3237
3305
  onEscapeKeyDown: Ke ? Pr : void 0,
3238
3306
  onFocus: Er,
3239
- registerItemRef: Bt,
3240
- children: M
3307
+ registerItemRef: Xt,
3308
+ children: S
3241
3309
  },
3242
3310
  ir
3243
3311
  )
3244
- ), ke += ut, Ge += xt;
3312
+ ), Fe += dt, ct += xt;
3245
3313
  }
3246
3314
  return j.length > 0 && Promise.resolve().then(() => {
3247
- if (Ee.current)
3315
+ if (Ae.current)
3248
3316
  return;
3249
- let Me = 0;
3250
- for (const ut of j)
3251
- if (ut.index < Yt) {
3252
- const _t = y.get(ut.index);
3253
- Me += ut.value - _t;
3317
+ let Ie = 0;
3318
+ for (const dt of j)
3319
+ if (dt.index < qt) {
3320
+ const _t = y.get(dt.index);
3321
+ Ie += dt.value - _t;
3254
3322
  }
3255
- const Ht = pt(() => y.updates(j));
3256
- if (Ee.current || typeof Ht != "number")
3257
- return;
3258
- Re(Ht), F.debug("[VirtualScroll] Updated heights for items", j, "New total height:", Ht);
3259
- const xt = z.current?.getScrollPosition() ?? U.current;
3260
- if (Me !== 0) {
3261
- const ut = xt + Me;
3262
- bt("reconciliation", () => {
3263
- Fe(ut, Me), de(ut, { immediate: !0 }), at(xt, ut);
3264
- }), F.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: xt, to: ut, shiftAmount: Me });
3323
+ mt(() => y.updates(j));
3324
+ const Wt = y.getTotal();
3325
+ Te(Wt), L.debug("[VirtualScroll] Updated heights for items", j, "New total height:", Wt);
3326
+ const xt = A.current?.getScrollPosition() ?? U.current;
3327
+ if (Ie !== 0) {
3328
+ const dt = xt + Ie;
3329
+ vt("reconciliation", () => {
3330
+ Oe(dt, Ie), de(dt, { immediate: !0 }), at(xt, dt);
3331
+ }), L.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: xt, to: dt, shiftAmount: Ie });
3265
3332
  } else xt !== U.current && de(xt);
3266
3333
  }), { visibleItems: fe, renderAnchor: G };
3267
3334
  }, [
3268
- bt,
3335
+ vt,
3269
3336
  at,
3270
- pt,
3271
- M,
3337
+ mt,
3338
+ S,
3272
3339
  Vt,
3273
- ve,
3340
+ we,
3274
3341
  t,
3275
3342
  y,
3276
3343
  e,
3277
3344
  r,
3278
3345
  n,
3279
3346
  Er,
3280
- vr,
3347
+ xr,
3281
3348
  Ke,
3282
3349
  Pr,
3283
- Fe,
3284
- Bt,
3350
+ Oe,
3351
+ Xt,
3285
3352
  Pt,
3286
3353
  rr,
3287
- re,
3288
- $t,
3354
+ ne,
3355
+ Ht,
3289
3356
  de,
3290
- Yt,
3291
- Re
3357
+ qt,
3358
+ Te
3292
3359
  ]), kr = p(
3293
3360
  (c) => {
3294
- const h = (K ?? 0) > 0, m = Math.abs(c - wt), V = h && m > 0.5 ? wt : c, B = Mt(V, H.top);
3295
- if (F.debug("[VirtualScroll] Rendering visible items", () => ({
3361
+ const h = J > 0, m = Math.abs(c - St), V = h && m > 0.5 ? St : c, q = Tt(V, H.top);
3362
+ if (L.debug("[VirtualScroll] Rendering visible items", () => ({
3296
3363
  currentScrollPosition: c,
3297
- effectiveScrollPosition: B,
3364
+ effectiveScrollPosition: q,
3298
3365
  renderingStartIndex: rr,
3299
3366
  renderingEndIndex: Pt,
3300
3367
  itemCount: t,
3301
3368
  viewportSize: D,
3302
- callbackThrottleMs: K,
3369
+ callbackThrottleMs: J,
3303
3370
  diff: m,
3304
3371
  rawEffectiveScrollPosition: V
3305
3372
  })), t === 0)
3306
3373
  return Cr;
3307
- const G = H.top + mr - V, j = y.getTotal(), fe = qi(V, j + H.top + H.bottom - D, ee), ke = H.bottom > 0 ? /* @__PURE__ */ Q(
3374
+ const G = H.top + mr - V, j = y.getTotal(), fe = qi(V, j + H.top + H.bottom - D, te), Fe = H.bottom > 0 ? /* @__PURE__ */ Z(
3308
3375
  "div",
3309
3376
  {
3310
3377
  className: "aqvs-bottom-inset",
@@ -3316,37 +3383,37 @@ const Hi = 1e4, ds = () => {
3316
3383
  },
3317
3384
  "virtualscroll-bottom-inset"
3318
3385
  ) : null;
3319
- return F.debug("[VirtualScroll] Rendering items", () => ({
3386
+ return L.debug("[VirtualScroll] Rendering items", () => ({
3320
3387
  containerTop: G,
3321
3388
  snapEdge: fe,
3322
3389
  logicalScrollPosition: Ct,
3323
3390
  resolvedInsets: H,
3324
- effectiveScrollPosition: B
3391
+ effectiveScrollPosition: q
3325
3392
  })), /* @__PURE__ */ Zt(Yi, { translateY: G, snapEdge: fe, boundaryRef: Qt, children: [
3326
3393
  Cr,
3327
- ke
3394
+ Fe
3328
3395
  ] });
3329
3396
  },
3330
- [ee, K, t, y, Ct, mr, Pt, rr, H, wt, D, Cr]
3397
+ [te, J, t, y, Ct, mr, Pt, rr, H, St, D, Cr]
3331
3398
  ), wr = ge(() => ({
3332
- renderingStartIndex: lt.renderingStartIndex,
3333
- renderingEndIndex: lt.renderingEndIndex,
3334
- visibleStartIndex: lt.visibleStartIndex,
3335
- visibleEndIndex: lt.visibleEndIndex,
3399
+ renderingStartIndex: ut.renderingStartIndex,
3400
+ renderingEndIndex: ut.renderingEndIndex,
3401
+ visibleStartIndex: ut.visibleStartIndex,
3402
+ visibleEndIndex: ut.visibleEndIndex,
3336
3403
  scrollPosition: Ct,
3337
3404
  totalHeight: y.getTotal()
3338
- }), [lt, Ct, y, $t]);
3339
- q(() => {
3340
- dt.current = wr;
3405
+ }), [ut, Ct, y, Ht]);
3406
+ W(() => {
3407
+ ft.current = wr;
3341
3408
  }, [wr]);
3342
- const [Hr, $r] = Ve(""), Xr = u(ne);
3343
- je(() => {
3344
- Xr.current = ne;
3345
- }, [ne]);
3346
- const nr = ne?.debounceMs ?? 400, Sr = Number.isFinite(nr) && nr >= 0, gr = ne !== void 0;
3347
- q(() => {
3348
- gr && !Sr && F.warn(`[VirtualScroll] liveRegion.debounceMs must be a finite number >= 0, received ${nr}. Announcements are disabled.`);
3349
- }, [gr, Sr, nr]), q(() => {
3409
+ const [Hr, $r] = Ce(""), Xr = u(se);
3410
+ We(() => {
3411
+ Xr.current = se;
3412
+ }, [se]);
3413
+ const nr = se?.debounceMs ?? 400, Sr = Number.isFinite(nr) && nr >= 0, gr = se !== void 0;
3414
+ W(() => {
3415
+ gr && !Sr && L.warn(`[VirtualScroll] liveRegion.debounceMs must be a finite number >= 0, received ${nr}. Announcements are disabled.`);
3416
+ }, [gr, Sr, nr]), W(() => {
3350
3417
  if (!(gr && Sr)) {
3351
3418
  $r("");
3352
3419
  return;
@@ -3355,36 +3422,61 @@ const Hi = 1e4, ds = () => {
3355
3422
  const h = Xr.current?.format;
3356
3423
  if (!h)
3357
3424
  return;
3358
- const m = h({ visibleStartIndex: Yt, visibleEndIndex: Wt, itemCount: t });
3425
+ const m = h({ visibleStartIndex: qt, visibleEndIndex: Yt, itemCount: t });
3359
3426
  $r(m);
3360
3427
  }, nr);
3361
3428
  return () => clearTimeout(c);
3362
- }, [gr, Sr, nr, Yt, Wt, t]), Jr(
3429
+ }, [gr, Sr, nr, qt, Yt, t]), Jr(
3363
3430
  xe,
3364
3431
  () => ({
3432
+ /**
3433
+ * Reads the logical scroll position (the pane's position less the top inset), or the `-1` sentinel while the pane is
3434
+ * unconnected.
3435
+ * 論理スクロール位置 (ペインの位置から上のインセットを引いたもの) を読む処理。ペインが未接続の間は番兵の `-1`。
3436
+ */
3365
3437
  getScrollPosition: () => {
3366
- const c = z.current?.getScrollPosition();
3367
- return typeof c == "number" ? Mt(c, Lt.current) : -1;
3438
+ const c = A.current?.getScrollPosition();
3439
+ return typeof c == "number" ? Tt(c, Lt.current) : -1;
3368
3440
  },
3369
- getContentSize: () => z.current?.getContentSize() ?? -1,
3370
- getViewportSize: () => z.current?.getViewportSize() ?? -1,
3441
+ /**
3442
+ * Reads the pane's content size (insets included), or the `-1` sentinel while the pane is unconnected.
3443
+ * ペインの中身の寸法 (インセット込み) を読む処理。ペインが未接続の間は番兵の `-1`。
3444
+ */
3445
+ getContentSize: () => A.current?.getContentSize() ?? -1,
3446
+ /**
3447
+ * Reads the pane's viewport size, or the `-1` sentinel while the pane is unconnected.
3448
+ * ペインの表示域の寸法を読む処理。ペインが未接続の間は番兵の `-1`。
3449
+ */
3450
+ getViewportSize: () => A.current?.getViewportSize() ?? -1,
3371
3451
  scrollTo: lr,
3372
3452
  scrollBy: tr,
3373
3453
  applyWheel: Nt,
3374
3454
  scrollToIndex: rt,
3455
+ /**
3456
+ * Reads the total of the row-height tree (insets excluded).
3457
+ * 行の高さの木の合計 (インセットを除く) を読む処理。
3458
+ */
3375
3459
  getFenwickTreeTotalHeight: () => y.getTotal(),
3460
+ /**
3461
+ * Reads the number of rows the row-height tree holds.
3462
+ * 行の高さの木が持つ行の数を読む処理。
3463
+ */
3376
3464
  getFenwickSize: () => y.getSize(),
3377
- focusItemAtIndex: Ce,
3378
- getRange: () => dt.current,
3465
+ focusItemAtIndex: Ne,
3466
+ /**
3467
+ * Reads the range the last commit published (one render behind).
3468
+ * 最後の確定が公開した範囲 (描画 1 回ぶん遅れる) を読む処理。
3469
+ */
3470
+ getRange: () => ft.current,
3379
3471
  getScrollAnchor: er,
3380
3472
  updateItemSize: It
3381
3473
  }),
3382
- [lr, tr, Nt, rt, y, Ce, er, It]
3474
+ [lr, tr, Nt, rt, y, Ne, er, It]
3383
3475
  );
3384
- const tn = y.getTotal() + H.top + H.bottom, Vr = /* @__PURE__ */ Q(
3476
+ const tn = y.getTotal() + H.top + H.bottom, Vr = /* @__PURE__ */ Z(
3385
3477
  Li,
3386
3478
  {
3387
- ref: z,
3479
+ ref: A,
3388
3480
  contentSize: tn,
3389
3481
  viewportSize: i,
3390
3482
  onViewportSizeChange: ot,
@@ -3396,33 +3488,33 @@ const Hi = 1e4, ds = () => {
3396
3488
  inertiaOptions: Ze,
3397
3489
  overscrollBehavior: Qe,
3398
3490
  itemCount: t,
3399
- scrollBarWidth: Le,
3400
- enableThumbDrag: Tt,
3491
+ scrollBarWidth: ke,
3492
+ enableThumbDrag: je,
3401
3493
  enableTrackClick: C,
3402
- enableArrowButtons: W,
3403
- enableArrowButtonTabStops: se,
3494
+ enableArrowButtons: K,
3495
+ enableArrowButtonTabStops: ee,
3404
3496
  enablePointerDrag: st,
3405
- pointerDragInputs: vt,
3497
+ pointerDragInputs: wt,
3406
3498
  renderThumbOverlay: ce,
3407
- wheelSpeedMultiplier: Ae,
3408
- onWheelHorizontal: P,
3409
- onPanHorizontal: Z,
3499
+ wheelSpeedMultiplier: Ve,
3500
+ onWheelHorizontal: R,
3501
+ onPanHorizontal: X,
3410
3502
  contentInsets: H,
3411
- contentProps: he,
3412
- visibleStartIndex: Yt,
3413
- visibleEndIndex: Wt,
3503
+ contentProps: be,
3504
+ visibleStartIndex: qt,
3505
+ visibleEndIndex: Yt,
3414
3506
  renderOverlay: en,
3415
3507
  initialScrollPosition: Xe.position,
3416
- locale: ie,
3417
- labels: Te,
3508
+ locale: oe,
3509
+ labels: pe,
3418
3510
  children: kr
3419
3511
  }
3420
3512
  );
3421
3513
  return gr ? /* @__PURE__ */ Zt(pn, { children: [
3422
3514
  Vr,
3423
- /* @__PURE__ */ Q("div", { className: "aqvs-live-region", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-aqvs-live-region": "", children: Hr })
3515
+ /* @__PURE__ */ Z("div", { className: "aqvs-live-region", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-aqvs-live-region": "", children: Hr })
3424
3516
  ] }) : Vr;
3425
- }, Ki = Qr(ji), Lr = 262144, Cn = 3, Zi = 32768, Vn = 128, An = 128, zn = 128, Dn = 128, cn = 10, Qi = (t, e) => Math.max(1, Math.floor((t ?? Zi) / Math.max(1, e))), Ji = (t, e, r, n, i) => {
3517
+ }, Ki = Qr(ji), Lr = 262144, Cn = 3, Zi = 32768, Vn = 128, An = 128, Dn = 128, zn = 128, cn = 10, Qi = (t, e) => Math.max(1, Math.floor((t ?? Zi) / Math.max(1, e))), Ji = (t, e, r, n, i) => {
3426
3518
  let s = 0, a = 0, l = Math.max(0, Math.min(n, r - 1));
3427
3519
  for (; l < r && s < t && a < hn; )
3428
3520
  s += e(l), a += 1, l += 1;
@@ -3439,31 +3531,31 @@ const Hi = 1e4, ds = () => {
3439
3531
  const f = Qn(t, e, r, n, i, s, a);
3440
3532
  if (n === 0)
3441
3533
  return { renderingColStart: 0, renderingColEnd: 0, visibleColStart: 0, visibleColEnd: 0, colAnchor: 0 };
3442
- const b = te(f.renderingStartIndex, 0, n - 1), { cumulative: g, currentValue: M } = s.prefixSum(b, it), N = g - M, S = Number.isFinite(N) && Math.abs(N - l) > Zn ? N : l;
3534
+ const g = re(f.renderingStartIndex, 0, n - 1), { cumulative: x, currentValue: S } = s.prefixSum(g, it), N = x - S, M = Number.isFinite(N) && Math.abs(N - l) > Zn ? N : l;
3443
3535
  return {
3444
3536
  renderingColStart: f.renderingStartIndex,
3445
3537
  renderingColEnd: f.renderingEndIndex,
3446
3538
  visibleColStart: f.visibleStartIndex,
3447
3539
  visibleColEnd: f.visibleEndIndex,
3448
- colAnchor: S
3540
+ colAnchor: M
3449
3541
  };
3450
3542
  }, Ln = [], ts = (t, e, r, n, i) => {
3451
3543
  const s = [], a = [], l = n.prefixSum(t, it);
3452
- let f = l.cumulative - l.currentValue, b = 0, g = t;
3453
- for (; g <= e; ) {
3544
+ let f = l.cumulative - l.currentValue, g = 0, x = t;
3545
+ for (; x <= e; ) {
3454
3546
  if (s.length >= i)
3455
- return { columns: s, widthUpdates: a, truncated: e - g + 1 };
3456
- const M = r(g), N = n.get(g);
3457
- if (M !== N && a.push({ index: g, value: M }), M > 0) {
3458
- s.push({ col: g, left: f, width: M }), f += N, b = 0, g += 1;
3547
+ return { columns: s, widthUpdates: a, truncated: e - x + 1 };
3548
+ const S = r(x), N = n.get(x);
3549
+ if (S !== N && a.push({ index: x, value: S }), S > 0) {
3550
+ s.push({ col: x, left: f, width: S }), f += N, g = 0, x += 1;
3459
3551
  continue;
3460
3552
  }
3461
- if (f += N, b += 1, g += 1, b > Fr) {
3462
- const S = n.findIndexAtOrAfter(f + 0.5, it);
3463
- if (S.index === -1 || S.index <= g || !Number.isSafeInteger(S.index))
3553
+ if (f += N, g += 1, x += 1, g > Fr) {
3554
+ const M = n.findIndexAtOrAfter(f + 0.5, it);
3555
+ if (M.index === -1 || M.index <= x || !Number.isSafeInteger(M.index))
3464
3556
  break;
3465
- const L = n.prefixSum(S.index, it);
3466
- f = L.cumulative - L.currentValue, g = S.index, b = 0;
3557
+ const _ = n.prefixSum(M.index, it);
3558
+ f = _.cumulative - _.currentValue, x = M.index, g = 0;
3467
3559
  }
3468
3560
  }
3469
3561
  return { columns: s, widthUpdates: a, truncated: 0 };
@@ -3479,8 +3571,8 @@ const Hi = 1e4, ds = () => {
3479
3571
  const i = [], s = [];
3480
3572
  let a = 0;
3481
3573
  for (let l = t - e; l < t; l += 1) {
3482
- const f = r(l), b = n.get(l);
3483
- f !== b && s.push({ index: l, value: f }), f > 0 && i.push({ col: l, left: a, width: f }), a += b;
3574
+ const f = r(l), g = n.get(l);
3575
+ f !== g && s.push({ index: l, value: f }), f > 0 && i.push({ col: l, left: a, width: f }), a += g;
3484
3576
  }
3485
3577
  return { columns: i, widthUpdates: s, width: a };
3486
3578
  }, Kr = (t, e, r) => Math.min(t, Math.max(0, r - e)), is = { renderingColStart: 0, renderingColEnd: 0, visibleColStart: 0, visibleColEnd: 0, colAnchor: 0, key: "0:0:0" }, ss = ({
@@ -3493,268 +3585,268 @@ const Hi = 1e4, ds = () => {
3493
3585
  children: a,
3494
3586
  getCellProps: l,
3495
3587
  getRowProps: f,
3496
- contentProps: b,
3497
- background: g,
3498
- contentInsets: M,
3588
+ contentProps: g,
3589
+ background: x,
3590
+ contentInsets: S,
3499
3591
  onRowFocus: N,
3500
- frozenLeadingCols: S = 0,
3501
- frozenLeadingRows: L = 0,
3502
- frozenTrailingCols: X = 0,
3503
- frozenTrailingRows: K = 0,
3504
- horizontalKeyInputs: ae,
3505
- horizontalKeyStep: De,
3506
- onScroll: T,
3507
- onRangeChange: A,
3508
- onRenderTruncated: P,
3509
- callbackThrottleMs: Z,
3510
- initialScrollAnchor: $,
3511
- overscanRows: _ = Cn,
3512
- overscanCols: he = Cn,
3513
- viewportSize: ne,
3514
- __maxRenderedCells: ie,
3515
- behaviorOptions: Te,
3592
+ frozenLeadingCols: M = 0,
3593
+ frozenLeadingRows: _ = 0,
3594
+ frozenTrailingCols: F = 0,
3595
+ frozenTrailingRows: J = 0,
3596
+ horizontalKeyInputs: ie,
3597
+ horizontalKeyStep: ze,
3598
+ onScroll: $,
3599
+ onRangeChange: I,
3600
+ onRenderTruncated: R,
3601
+ callbackThrottleMs: X,
3602
+ initialScrollAnchor: B,
3603
+ overscanRows: k = Cn,
3604
+ overscanCols: be = Cn,
3605
+ viewportSize: se,
3606
+ __maxRenderedCells: oe,
3607
+ behaviorOptions: pe,
3516
3608
  scrollBarOptions: xe,
3517
- liveRegion: Le,
3518
- locale: Tt,
3609
+ liveRegion: ke,
3610
+ locale: je,
3519
3611
  labels: C,
3520
- className: W,
3521
- testId: se
3612
+ className: K,
3613
+ testId: ee
3522
3614
  }, He) => {
3523
3615
  const ce = u(null), Pe = u(null), Rt = u(r);
3524
3616
  Rt.current = r;
3525
- const re = u(n);
3526
- re.current = n;
3527
- const st = Te?.resetOnGetColWidthChange === !0, ve = Te?.resetOnGetItemHeightChange === !0 ? r : null, Ke = st ? n : null, Ae = p(
3617
+ const ne = u(n);
3618
+ ne.current = n;
3619
+ const st = pe?.resetOnGetColWidthChange === !0, we = pe?.resetOnGetItemHeightChange === !0 ? r : null, Ke = st ? n : null, Ve = p(
3528
3620
  (o) => jr(Rt.current(o), "row", o),
3529
- [ve]
3621
+ [we]
3530
3622
  ), Ze = p(
3531
- (o) => jr(re.current(o), "col", o),
3623
+ (o) => jr(ne.current(o), "col", o),
3532
3624
  [Ke]
3533
- ), Qe = Te?.defaultColWidth, Vt = ge(() => {
3625
+ ), Qe = pe?.defaultColWidth, Vt = ge(() => {
3534
3626
  if (Qe !== void 0 && !(Number.isInteger(Qe) && Qe >= 0 && Qe <= Lr))
3535
3627
  throw new RangeError(`[VirtualGrid] behaviorOptions.defaultColWidth must be an integer in [0, ${Lr}], received ${Qe}.`);
3536
3628
  return { resetOnValueFnChange: st, baseValue: Qe };
3537
- }, [st, Qe]), we = jn(e, Ze, Vt), { revision: yt, change: $e } = Kn(we);
3538
- if (!(Number.isInteger(S) && S >= 0 && S <= Vn))
3539
- throw new RangeError(`[VirtualGrid] frozenLeadingCols must be an integer in [0, ${Vn}], received ${S}.`);
3540
- const D = Math.min(S, e), ot = u(0);
3541
- if (!(Number.isInteger(X) && X >= 0 && X <= zn))
3542
- throw new RangeError(`[VirtualGrid] frozenTrailingCols must be an integer in [0, ${zn}], received ${X}.`);
3543
- const z = Math.min(X, e - D), dt = u(0);
3544
- if (!(Number.isInteger(L) && L >= 0 && L <= An))
3545
- throw new RangeError(`[VirtualGrid] frozenLeadingRows must be an integer in [0, ${An}], received ${L}.`);
3546
- const O = Math.min(L, t);
3547
- if (!(Number.isInteger(K) && K >= 0 && K <= Dn))
3548
- throw new RangeError(`[VirtualGrid] frozenTrailingRows must be an integer in [0, ${Dn}], received ${K}.`);
3549
- const Ee = Math.min(K, t - O), ft = Math.max(0, t - O - Ee), H = u(!1), ht = u(0), At = u(0), [y, $t] = Ve(0), { frozenRows: pt, frozenHeight: Xe } = ge(() => {
3550
- if (O === 0)
3629
+ }, [st, Qe]), Se = jn(e, Ze, Vt), { revision: yt, change: $e } = Kn(Se);
3630
+ if (!(Number.isInteger(M) && M >= 0 && M <= Vn))
3631
+ throw new RangeError(`[VirtualGrid] frozenLeadingCols must be an integer in [0, ${Vn}], received ${M}.`);
3632
+ const D = Math.min(M, e), ot = u(0);
3633
+ if (!(Number.isInteger(F) && F >= 0 && F <= Dn))
3634
+ throw new RangeError(`[VirtualGrid] frozenTrailingCols must be an integer in [0, ${Dn}], received ${F}.`);
3635
+ const A = Math.min(F, e - D), ft = u(0);
3636
+ if (!(Number.isInteger(_) && _ >= 0 && _ <= An))
3637
+ throw new RangeError(`[VirtualGrid] frozenLeadingRows must be an integer in [0, ${An}], received ${_}.`);
3638
+ const z = Math.min(_, t);
3639
+ if (!(Number.isInteger(J) && J >= 0 && J <= zn))
3640
+ throw new RangeError(`[VirtualGrid] frozenTrailingRows must be an integer in [0, ${zn}], received ${J}.`);
3641
+ const Ae = Math.min(J, t - z), ht = Math.max(0, t - z - Ae), H = u(!1), pt = u(0), At = u(0), [y, Ht] = Ce(0), { frozenRows: mt, frozenHeight: Xe } = ge(() => {
3642
+ if (z === 0)
3551
3643
  return { frozenRows: [], frozenHeight: 0 };
3552
3644
  const o = [];
3553
- let x = 0;
3554
- for (let R = 0; R < O; R += 1) {
3555
- const J = Ae(R);
3556
- J > 0 && o.push({ row: R, top: x, height: J }), x += J;
3645
+ let b = 0;
3646
+ for (let T = 0; T < z; T += 1) {
3647
+ const Q = Ve(T);
3648
+ Q > 0 && o.push({ row: T, top: b, height: Q }), b += Q;
3557
3649
  }
3558
- return { frozenRows: o, frozenHeight: x };
3559
- }, [O, y, Ae]);
3560
- ht.current = Xe;
3561
- const [wt, Xt] = Ve(0), { trailingRows: v, trailingHeight: Y } = ge(() => {
3562
- if (Ee === 0)
3650
+ return { frozenRows: o, frozenHeight: b };
3651
+ }, [z, y, Ve]);
3652
+ pt.current = Xe;
3653
+ const [St, $t] = Ce(0), { trailingRows: v, trailingHeight: Y } = ge(() => {
3654
+ if (Ae === 0)
3563
3655
  return { trailingRows: [], trailingHeight: 0 };
3564
3656
  const o = [];
3565
- let x = 0;
3566
- for (let R = t - Ee; R < t; R += 1) {
3567
- const J = Ae(R);
3568
- J > 0 && o.push({ row: R, top: x, height: J }), x += J;
3657
+ let b = 0;
3658
+ for (let T = t - Ae; T < t; T += 1) {
3659
+ const Q = Ve(T);
3660
+ Q > 0 && o.push({ row: T, top: b, height: Q }), b += Q;
3569
3661
  }
3570
- return { trailingRows: o, trailingHeight: x };
3571
- }, [Ee, t, wt, Ae]);
3662
+ return { trailingRows: o, trailingHeight: b };
3663
+ }, [Ae, t, St, Ve]);
3572
3664
  At.current = Y;
3573
- const ee = p((o) => Ae(o + O), [Ae, O]), le = u(N);
3665
+ const te = p((o) => Ve(o + z), [Ve, z]), le = u(N);
3574
3666
  le.current = N;
3575
- const oe = N !== void 0, Ne = ge(() => oe ? (o) => le.current?.(o + O) : void 0, [O, oe]), Re = Xe, Se = Y, [at, Be] = Ve(O), U = u(null), mt = u(!1);
3576
- if (at !== O) {
3577
- Be(O), mt.current = !0;
3667
+ const ae = N !== void 0, Ee = ge(() => ae ? (o) => le.current?.(o + z) : void 0, [z, ae]), Te = Xe, Me = Y, [at, Be] = Ce(z), U = u(null), gt = u(!1);
3668
+ if (at !== z) {
3669
+ Be(z), gt.current = !0;
3578
3670
  const o = ce.current?.getScrollAnchor() ?? null;
3579
3671
  U.current = o === null ? null : { row: o.index + at, offsetPx: o.offsetPx };
3580
3672
  }
3581
- const be = u(0), ye = u(0), [_e, Et] = Ve(is), We = u(_e);
3582
- We.current = _e;
3583
- const qe = u(0), [Je, w] = Ve(() => we.getTotal()), I = u(Je);
3584
- I.current = Je;
3673
+ const ve = u(0), Re = u(0), [Le, Et] = Ce(is), Ue = u(Le);
3674
+ Ue.current = Le;
3675
+ const qe = u(0), [Je, w] = Ce(() => Se.getTotal()), P = u(Je);
3676
+ P.current = Je;
3585
3677
  const Ye = p((o) => {
3586
- typeof o == "number" && Number.isFinite(o) && (I.current = o, w(o));
3678
+ typeof o == "number" && Number.isFinite(o) && (P.current = o, w(o));
3587
3679
  }, []);
3588
- je(() => {
3589
- const o = we.getTotal();
3590
- typeof o == "number" && Number.isFinite(o) && o !== I.current && Ye(o);
3680
+ We(() => {
3681
+ const o = Se.getTotal();
3682
+ typeof o == "number" && Number.isFinite(o) && o !== P.current && Ye(o);
3591
3683
  });
3592
- const Ie = xe?.width ?? 12, Ue = ne === void 0 ? null : { width: Math.max(0, Math.round(ne.width) - Ie), height: Math.max(0, Math.round(ne.height) - Ie) }, [et, Oe] = Ve({ width: 0, height: 0 }), me = Ue ?? { width: Math.max(0, et.width - Ie), height: Math.max(0, et.height - Ie) }, gt = u(me);
3593
- gt.current = me;
3684
+ const ye = xe?.width ?? 12, Ge = se === void 0 ? null : { width: Math.max(0, Math.round(se.width) - ye), height: Math.max(0, Math.round(se.height) - ye) }, [et, _e] = Ce({ width: 0, height: 0 }), me = Ge ?? { width: Math.max(0, et.width - ye), height: Math.max(0, et.height - ye) }, bt = u(me);
3685
+ bt.current = me;
3594
3686
  const Qt = me.height > 0 && me.height - Xe - Y <= 0;
3595
3687
  H.current = Qt;
3596
- const hr = Ue !== null, Ft = p(
3688
+ const hr = Ge !== null, Ft = p(
3597
3689
  (o) => {
3598
3690
  if (Pe.current = o, hr)
3599
3691
  return () => {
3600
3692
  Pe.current = null;
3601
3693
  };
3602
- const x = () => {
3603
- const J = Math.round(o.clientWidth), pe = Math.round(o.clientHeight);
3604
- Oe((nt) => nt.width === J && nt.height === pe ? nt : { width: J, height: pe });
3694
+ const b = () => {
3695
+ const Q = Math.round(o.clientWidth), he = Math.round(o.clientHeight);
3696
+ _e((nt) => nt.width === Q && nt.height === he ? nt : { width: Q, height: he });
3605
3697
  };
3606
- x();
3607
- const R = new ResizeObserver(x);
3608
- return R.observe(o), () => {
3609
- R.disconnect(), Pe.current = null;
3698
+ b();
3699
+ const T = new ResizeObserver(b);
3700
+ return T.observe(o), () => {
3701
+ T.disconnect(), Pe.current = null;
3610
3702
  };
3611
3703
  },
3612
3704
  [hr]
3613
- ), St = p(() => {
3705
+ ), Mt = p(() => {
3614
3706
  const o = Pe.current;
3615
- o !== null && o.style.setProperty("--aqvs-grid-hx-residual", `${qe.current - be.current}px`);
3616
- }, []), zt = p(() => Math.max(0, gt.current.width - ot.current - dt.current), []), Gt = p(() => Math.max(0, I.current - ot.current - dt.current - zt()), [zt]), Dt = p(() => {
3617
- const o = zt(), x = es(ot.current + be.current, o, he, e, Ze, we, I.current, We.current.colAnchor);
3618
- if (D > 0 && (x.renderingColStart = Math.max(x.renderingColStart, D), x.visibleColStart = Math.max(x.visibleColStart, D)), z > 0) {
3619
- const J = e - z - 1;
3620
- x.renderingColEnd = Math.min(x.renderingColEnd, J), x.visibleColEnd = Math.min(x.visibleColEnd, J);
3707
+ o !== null && o.style.setProperty("--aqvs-grid-hx-residual", `${qe.current - ve.current}px`);
3708
+ }, []), Dt = p(() => Math.max(0, bt.current.width - ot.current - ft.current), []), Gt = p(() => Math.max(0, P.current - ot.current - ft.current - Dt()), [Dt]), zt = p(() => {
3709
+ const o = Dt(), b = es(ot.current + ve.current, o, be, e, Ze, Se, P.current, Ue.current.colAnchor);
3710
+ if (D > 0 && (b.renderingColStart = Math.max(b.renderingColStart, D), b.visibleColStart = Math.max(b.visibleColStart, D)), A > 0) {
3711
+ const Q = e - A - 1;
3712
+ b.renderingColEnd = Math.min(b.renderingColEnd, Q), b.visibleColEnd = Math.min(b.visibleColEnd, Q);
3621
3713
  }
3622
- (D > 0 || z > 0) && (o <= 0 || x.renderingColStart > x.renderingColEnd) && (x.renderingColStart = e, x.renderingColEnd = e - 1, x.visibleColStart = e, x.visibleColEnd = e - 1);
3623
- const R = `${x.renderingColStart}:${x.renderingColEnd}:${x.colAnchor}`;
3624
- R !== We.current.key && Et({ ...x, key: R });
3625
- }, [he, e, Ze, we, D, z, zt]), [or, Ir] = Ve(0), kt = u(null), xr = p(() => {
3714
+ (D > 0 || A > 0) && (o <= 0 || b.renderingColStart > b.renderingColEnd) && (b.renderingColStart = e, b.renderingColEnd = e - 1, b.visibleColStart = e, b.visibleColEnd = e - 1);
3715
+ const T = `${b.renderingColStart}:${b.renderingColEnd}:${b.colAnchor}`;
3716
+ T !== Ue.current.key && Et({ ...b, key: T });
3717
+ }, [be, e, Ze, Se, D, A, Dt]), [or, Ir] = Ce(0), kt = u(null), vr = p(() => {
3626
3718
  kt.current === null && (kt.current = requestAnimationFrame(() => {
3627
- kt.current = null, Ir(be.current);
3719
+ kt.current = null, Ir(ve.current);
3628
3720
  }));
3629
3721
  }, []);
3630
- q(
3722
+ W(
3631
3723
  () => () => {
3632
3724
  kt.current !== null && cancelAnimationFrame(kt.current);
3633
3725
  },
3634
3726
  []
3635
3727
  );
3636
- const ar = u(T);
3637
- ar.current = T;
3638
- const Lt = u(A);
3639
- Lt.current = A;
3640
- const cr = u(P);
3641
- cr.current = P;
3642
- const Bt = u(null), [d, E] = Ve(null), [k, ue] = Ve(me.height);
3643
- k !== me.height && (ue(me.height), E(null));
3644
- const ze = $ === void 0 || t === 0 ? 0 : te(Math.trunc($.row), 0, t - 1), tt = ge(() => {
3645
- const o = Bt.current?.renderingStartIndex ?? ze;
3646
- return Ji(Math.max(0, me.height - ht.current - At.current), Ae, t, o, _);
3647
- }, [me.height, Ae, t, ze, _, Re, Se]), de = d ?? tt, Fe = p(() => {
3648
- const o = Bt.current;
3728
+ const ar = u($);
3729
+ ar.current = $;
3730
+ const Lt = u(I);
3731
+ Lt.current = I;
3732
+ const cr = u(R);
3733
+ cr.current = R;
3734
+ const Xt = u(null), [d, E] = Ce(null), [O, ue] = Ce(me.height);
3735
+ O !== me.height && (ue(me.height), E(null));
3736
+ const De = B === void 0 || t === 0 ? 0 : re(Math.trunc(B.row), 0, t - 1), tt = ge(() => {
3737
+ const o = Xt.current?.renderingStartIndex ?? De;
3738
+ return Ji(Math.max(0, me.height - pt.current - At.current), Ve, t, o, k);
3739
+ }, [me.height, Ve, t, De, k, Te, Me]), de = d ?? tt, Oe = p(() => {
3740
+ const o = Xt.current;
3649
3741
  if (o === null)
3650
3742
  return null;
3651
- const x = We.current;
3743
+ const b = Ue.current;
3652
3744
  return {
3653
3745
  renderingRowStart: o.renderingStartIndex,
3654
3746
  renderingRowEnd: o.renderingEndIndex,
3655
3747
  visibleRowStart: o.visibleStartIndex,
3656
3748
  visibleRowEnd: o.visibleEndIndex,
3657
- renderingColStart: x.renderingColStart,
3658
- renderingColEnd: x.renderingColEnd,
3659
- visibleColStart: x.visibleColStart,
3660
- visibleColEnd: x.visibleColEnd,
3661
- scrollX: be.current,
3662
- scrollY: ye.current,
3663
- totalWidth: I.current,
3749
+ renderingColStart: b.renderingColStart,
3750
+ renderingColEnd: b.renderingColEnd,
3751
+ visibleColStart: b.visibleColStart,
3752
+ visibleColEnd: b.visibleColEnd,
3753
+ scrollX: ve.current,
3754
+ scrollY: Re.current,
3755
+ totalWidth: P.current,
3664
3756
  // 帯高は鮮度加算 (格納はスクロール木のみ — 帯行リサイズ後も総高が正しい。R1 是正。
3665
3757
  // 3.5.0: 末尾帯高 H_T も同じ鮮度規律で加算)
3666
- totalHeight: o.totalHeight + ht.current + At.current
3758
+ totalHeight: o.totalHeight + pt.current + At.current
3667
3759
  };
3668
- }, []), bt = p(() => {
3669
- const o = Fe();
3760
+ }, []), vt = p(() => {
3761
+ const o = Oe();
3670
3762
  o !== null && Lt.current?.(o);
3671
- }, [Fe]), jt = p(
3763
+ }, [Oe]), jt = p(
3672
3764
  (o) => {
3673
- const x = Gt(), R = te(o, 0, x);
3674
- return R !== be.current && (be.current = R, St(), Dt(), xr(), ar.current?.({ x: R, y: ye.current })), R;
3765
+ const b = Gt(), T = re(o, 0, b);
3766
+ return T !== ve.current && (ve.current = T, Mt(), zt(), vr(), ar.current?.({ x: T, y: Re.current })), T;
3675
3767
  },
3676
- [St, Dt, xr, Gt]
3768
+ [Mt, zt, vr, Gt]
3677
3769
  ), It = u(jt);
3678
- It.current = jt, je(() => {
3679
- qe.current = _e.colAnchor, St(), bt();
3680
- }, [_e, St, bt]), je(() => {
3681
- Bt.current !== null && bt();
3682
- }, [Xe, Y, bt]);
3770
+ It.current = jt, We(() => {
3771
+ qe.current = Le.colAnchor, Mt(), vt();
3772
+ }, [Le, Mt, vt]), We(() => {
3773
+ Xt.current !== null && vt();
3774
+ }, [Xe, Y, vt]);
3683
3775
  const rt = u(null), Jt = p(
3684
3776
  (o) => {
3685
- const x = te(o.col, 0, Math.max(0, e - 1)), R = we.prefixSum(x, it), J = R.cumulative - R.currentValue, pe = R.currentValue, nt = zt();
3686
- return (o.alignX === "end" ? J + pe - ot.current - nt : o.alignX === "center" ? J + pe / 2 - ot.current - nt / 2 : J - ot.current) + o.offsetX;
3777
+ const b = re(o.col, 0, Math.max(0, e - 1)), T = Se.prefixSum(b, it), Q = T.cumulative - T.currentValue, he = T.currentValue, nt = Dt();
3778
+ return (o.alignX === "end" ? Q + he - ot.current - nt : o.alignX === "center" ? Q + he / 2 - ot.current - nt / 2 : Q - ot.current) + o.offsetX;
3687
3779
  },
3688
- [we, e, zt]
3689
- ), qt = u(null), er = p(() => {
3690
- const o = qt.current;
3691
- qt.current = null, !(o === null || o.length === 0) && Ye($e(() => we.updates(o)));
3692
- }, [we, $e, Ye]), lr = u({ count: 0, warned: !1 }), { frozenColumns: tr, frozenWidth: Nt } = ge(() => {
3780
+ [Se, e, Dt]
3781
+ ), Bt = u(null), er = p(() => {
3782
+ const o = Bt.current;
3783
+ Bt.current = null, !(o === null || o.length === 0) && Ye($e(() => Se.updates(o)));
3784
+ }, [Se, $e, Ye]), lr = u({ count: 0, warned: !1 }), { frozenColumns: tr, frozenWidth: Nt } = ge(() => {
3693
3785
  if (D === 0)
3694
3786
  return lr.current.count = 0, lr.current.warned = !1, { frozenColumns: Ln, frozenWidth: 0 };
3695
- const { columns: o, widthUpdates: x, width: R } = rs(D, Ze, we);
3696
- if (x.length > 0) {
3697
- const J = lr.current;
3698
- J.count >= cn ? J.warned || (J.warned = !0, F.warn("[VirtualGrid] getColWidth keeps disagreeing with its own previous values inside the frozen band; width self-heal is suspended until a converged pass re-arms it (unstable accessor).", {
3787
+ const { columns: o, widthUpdates: b, width: T } = rs(D, Ze, Se);
3788
+ if (b.length > 0) {
3789
+ const Q = lr.current;
3790
+ Q.count >= cn ? Q.warned || (Q.warned = !0, L.warn("[VirtualGrid] getColWidth keeps disagreeing with its own previous values inside the frozen band; width self-heal is suspended until a converged pass re-arms it (unstable accessor).", {
3699
3791
  frozenCols: D,
3700
- pendingUpdates: x.length
3701
- })) : (J.count += 1, qt.current = [...qt.current ?? [], ...x], Promise.resolve().then(er));
3792
+ pendingUpdates: b.length
3793
+ })) : (Q.count += 1, Bt.current = [...Bt.current ?? [], ...b], Promise.resolve().then(er));
3702
3794
  } else
3703
3795
  lr.current.count = 0, lr.current.warned = !1;
3704
- return { frozenColumns: o, frozenWidth: R };
3705
- }, [D, yt, Ze, we, er]);
3706
- ot.current = Nt, je(() => {
3796
+ return { frozenColumns: o, frozenWidth: T };
3797
+ }, [D, yt, Ze, Se, er]);
3798
+ ot.current = Nt, We(() => {
3707
3799
  D > 0 ? Pe.current?.style.setProperty("--aqvs-grid-frozen-width", `${Nt}px`) : Pe.current?.style.removeProperty("--aqvs-grid-frozen-width");
3708
3800
  }, [Nt, D]);
3709
- const pr = u({ count: 0, warned: !1 }), { trailingColumns: Ct, trailingWidth: lt } = ge(() => {
3710
- if (z === 0)
3801
+ const pr = u({ count: 0, warned: !1 }), { trailingColumns: Ct, trailingWidth: ut } = ge(() => {
3802
+ if (A === 0)
3711
3803
  return pr.current.count = 0, pr.current.warned = !1, { trailingColumns: Ln, trailingWidth: 0 };
3712
- const { columns: o, widthUpdates: x, width: R } = ns(e, z, Ze, we);
3713
- if (x.length > 0) {
3714
- const J = pr.current;
3715
- J.count >= cn ? J.warned || (J.warned = !0, F.warn("[VirtualGrid] getColWidth keeps disagreeing with its own previous values inside the trailing band; width self-heal is suspended until a converged pass re-arms it (unstable accessor).", {
3716
- trailingCols: z,
3717
- pendingUpdates: x.length
3718
- })) : (J.count += 1, qt.current = [...qt.current ?? [], ...x], Promise.resolve().then(er));
3804
+ const { columns: o, widthUpdates: b, width: T } = ns(e, A, Ze, Se);
3805
+ if (b.length > 0) {
3806
+ const Q = pr.current;
3807
+ Q.count >= cn ? Q.warned || (Q.warned = !0, L.warn("[VirtualGrid] getColWidth keeps disagreeing with its own previous values inside the trailing band; width self-heal is suspended until a converged pass re-arms it (unstable accessor).", {
3808
+ trailingCols: A,
3809
+ pendingUpdates: b.length
3810
+ })) : (Q.count += 1, Bt.current = [...Bt.current ?? [], ...b], Promise.resolve().then(er));
3719
3811
  } else
3720
3812
  pr.current.count = 0, pr.current.warned = !1;
3721
- return { trailingColumns: o, trailingWidth: R };
3722
- }, [z, e, yt, Ze, we, er]);
3723
- dt.current = lt, je(() => {
3724
- z > 0 ? Pe.current?.style.setProperty("--aqvs-grid-trailing-width", `${lt}px`) : Pe.current?.style.removeProperty("--aqvs-grid-trailing-width");
3725
- }, [lt, z]);
3726
- const rr = ge(() => ({ ...xe, tapScrollCircleOptions: { ...xe?.tapScrollCircleOptions, enabled: !1 } }), [xe]), Pt = xe?.tapScrollCircleOptions, Yt = typeof Pt?.maxSpeedMultiplier == "number", Wt = ge(
3813
+ return { trailingColumns: o, trailingWidth: T };
3814
+ }, [A, e, yt, Ze, Se, er]);
3815
+ ft.current = ut, We(() => {
3816
+ A > 0 ? Pe.current?.style.setProperty("--aqvs-grid-trailing-width", `${ut}px`) : Pe.current?.style.removeProperty("--aqvs-grid-trailing-width");
3817
+ }, [ut, A]);
3818
+ const rr = ge(() => ({ ...xe, tapScrollCircleOptions: { ...xe?.tapScrollCircleOptions, enabled: !1 } }), [xe]), Pt = xe?.tapScrollCircleOptions, qt = typeof Pt?.maxSpeedMultiplier == "number", Yt = ge(
3727
3819
  () => ({
3728
3820
  ...Pt,
3729
3821
  offsetX: Pt?.offsetX === void 0 ? Rn : Pt.offsetX,
3730
3822
  offsetY: Pt?.offsetY === void 0 ? Rn : Pt.offsetY
3731
3823
  }),
3732
3824
  [Pt]
3733
- ), Ce = ge(() => dn(Wt, Math.max(0, e - D - z)), [Wt, e, D, z]), vr = ge(() => dn(Wt, ft), [Wt, ft]), Pr = Ce.enabled, Er = Math.max(Ce.maxVisualDistance, 1), en = {
3734
- viewportSize: Math.max(0, me.width - Nt - lt),
3735
- minSpeedMultiplier: Ce.minSpeedMultiplier,
3736
- maxSpeedMultiplier: Ce.maxSpeedMultiplier,
3737
- hasCustomMaxSpeedMultiplier: Yt,
3738
- curve: Ce.maxSpeedCurve
3825
+ ), Ne = ge(() => dn(Yt, Math.max(0, e - D - A)), [Yt, e, D, A]), xr = ge(() => dn(Yt, ht), [Yt, ht]), Pr = Ne.enabled, Er = Math.max(Ne.maxVisualDistance, 1), en = {
3826
+ viewportSize: Math.max(0, me.width - Nt - ut),
3827
+ minSpeedMultiplier: Ne.minSpeedMultiplier,
3828
+ maxSpeedMultiplier: Ne.maxSpeedMultiplier,
3829
+ hasCustomMaxSpeedMultiplier: qt,
3830
+ curve: Ne.maxSpeedCurve
3739
3831
  }, Nr = {
3740
3832
  viewportSize: Math.max(0, me.height - Xe - Y),
3741
- minSpeedMultiplier: vr.minSpeedMultiplier,
3742
- maxSpeedMultiplier: vr.maxSpeedMultiplier,
3743
- hasCustomMaxSpeedMultiplier: Yt,
3744
- curve: vr.maxSpeedCurve
3745
- }, Cr = p(() => be.current, []), mr = p(() => {
3833
+ minSpeedMultiplier: xr.minSpeedMultiplier,
3834
+ maxSpeedMultiplier: xr.maxSpeedMultiplier,
3835
+ hasCustomMaxSpeedMultiplier: qt,
3836
+ curve: xr.maxSpeedCurve
3837
+ }, Cr = p(() => ve.current, []), mr = p(() => {
3746
3838
  const o = ce.current;
3747
- return o === null ? ye.current : o.getScrollPosition();
3839
+ return o === null ? Re.current : o.getScrollPosition();
3748
3840
  }, []), kr = p(() => {
3749
3841
  const o = ce.current;
3750
3842
  return o === null ? 0 : Math.max(0, Math.max(0, o.getContentSize()) - Math.max(0, o.getViewportSize()));
3751
3843
  }, []), wr = p((o) => {
3752
- const x = ce.current;
3753
- if (x === null)
3754
- return ye.current;
3755
- const R = x.scrollBy(o);
3756
- return ye.current = R, R;
3757
- }, []), Hr = Gt() > 0 || kr() > 0, $r = `${Je}:${Nt}:${lt}:${me.width}:${_e.key}`, Xr = `${t}:${d ?? -1}:${Xe}:${Y}:${me.height}`, { isTapActive: nr, handleTapCircleDragChange: Sr, tapCircleHandleRef: gr } = $i({
3844
+ const b = ce.current;
3845
+ if (b === null)
3846
+ return Re.current;
3847
+ const T = b.scrollBy(o);
3848
+ return Re.current = T, T;
3849
+ }, []), Hr = Gt() > 0 || kr() > 0, $r = `${Je}:${Nt}:${ut}:${me.width}:${Le.key}`, Xr = `${t}:${d ?? -1}:${Xe}:${Y}:${me.height}`, { isTapActive: nr, handleTapCircleDragChange: Sr, tapCircleHandleRef: gr } = $i({
3758
3850
  enabled: Pr && Hr,
3759
3851
  maxDistance: Er,
3760
3852
  xSpeedParams: en,
@@ -3768,109 +3860,109 @@ const Hi = 1e4, ds = () => {
3768
3860
  pendingColAnchorRef: rt,
3769
3861
  xExtentFreshness: $r,
3770
3862
  yExtentFreshness: Xr
3771
- }), tn = ge(() => te((nr ? 1 : 0.8) * Ce.opacity, 0, 1), [nr, Ce.opacity]);
3772
- je(() => {
3863
+ }), tn = ge(() => re((nr ? 1 : 0.8) * Ne.opacity, 0, 1), [nr, Ne.opacity]);
3864
+ We(() => {
3773
3865
  const o = rt.current;
3774
- o === null ? It.current(be.current) : It.current(Jt(o)), Dt();
3775
- }, [me.width, Je, yt, Nt, lt, Dt, Jt]);
3866
+ o === null ? It.current(ve.current) : It.current(Jt(o)), zt();
3867
+ }, [me.width, Je, yt, Nt, ut, zt, Jt]);
3776
3868
  const Vr = u(!1);
3777
- je(() => {
3778
- if (Vr.current || $ === void 0 || e === 0)
3869
+ We(() => {
3870
+ if (Vr.current || B === void 0 || e === 0)
3779
3871
  return;
3780
3872
  Vr.current = !0;
3781
- const o = te(Math.trunc($.col), 0, e - 1);
3782
- if (o < D || o >= e - z)
3873
+ const o = re(Math.trunc(B.col), 0, e - 1);
3874
+ if (o < D || o >= e - A)
3783
3875
  return;
3784
- const x = { col: o, alignX: "start", offsetX: Math.max(0, $.offsetX) };
3785
- rt.current = x, It.current(Jt(x));
3786
- }, [$, e, Jt, D, z]);
3876
+ const b = { col: o, alignX: "start", offsetX: Math.max(0, B.offsetX) };
3877
+ rt.current = b, It.current(Jt(b));
3878
+ }, [B, e, Jt, D, A]);
3787
3879
  const c = p((o) => {
3788
- ye.current = o, ar.current?.({ x: be.current, y: o });
3880
+ Re.current = o, ar.current?.({ x: ve.current, y: o });
3789
3881
  }, []), h = p(
3790
3882
  (o) => {
3791
- if (ft === 0 || H.current)
3792
- Bt.current = { renderingStartIndex: t, renderingEndIndex: t - 1, visibleStartIndex: t, visibleEndIndex: t - 1, scrollPosition: 0, totalHeight: ft === 0 ? 0 : o.totalHeight }, ye.current = 0;
3883
+ if (ht === 0 || H.current)
3884
+ Xt.current = { renderingStartIndex: t, renderingEndIndex: t - 1, visibleStartIndex: t, visibleEndIndex: t - 1, scrollPosition: 0, totalHeight: ht === 0 ? 0 : o.totalHeight }, Re.current = 0;
3793
3885
  else {
3794
- const x = O;
3795
- Bt.current = {
3796
- renderingStartIndex: o.renderingStartIndex + x,
3797
- renderingEndIndex: o.renderingEndIndex + x,
3798
- visibleStartIndex: o.visibleStartIndex + x,
3799
- visibleEndIndex: o.visibleEndIndex + x,
3886
+ const b = z;
3887
+ Xt.current = {
3888
+ renderingStartIndex: o.renderingStartIndex + b,
3889
+ renderingEndIndex: o.renderingEndIndex + b,
3890
+ visibleStartIndex: o.visibleStartIndex + b,
3891
+ visibleEndIndex: o.visibleEndIndex + b,
3800
3892
  scrollPosition: o.scrollPosition,
3801
3893
  totalHeight: o.totalHeight
3802
- }, ye.current = o.scrollPosition;
3894
+ }, Re.current = o.scrollPosition;
3803
3895
  }
3804
- E((x) => {
3805
- const R = Math.max(1, o.renderingEndIndex - o.renderingStartIndex + 1);
3806
- return R === x ? x : R;
3807
- }), bt();
3896
+ E((b) => {
3897
+ const T = Math.max(1, o.renderingEndIndex - o.renderingStartIndex + 1);
3898
+ return T === b ? b : T;
3899
+ }), vt();
3808
3900
  },
3809
- [bt, O, ft, t]
3901
+ [vt, z, ht, t]
3810
3902
  ), m = p((o) => {
3811
- rt.current = null, It.current(be.current + o);
3812
- }, []), V = Qi(ie, de + pt.length + v.length), B = u({ count: 0, warned: !1 }), { placedColumns: G, truncatedCols: j } = ge(() => {
3813
- const o = Math.max(0, me.width - Nt - lt);
3903
+ rt.current = null, It.current(ve.current + o);
3904
+ }, []), V = Qi(oe, de + mt.length + v.length), q = u({ count: 0, warned: !1 }), { placedColumns: G, truncatedCols: j } = ge(() => {
3905
+ const o = Math.max(0, me.width - Nt - ut);
3814
3906
  if (e === 0 || o <= 0)
3815
3907
  return { placedColumns: [], truncatedCols: 0 };
3816
- if (_e.renderingColStart > _e.renderingColEnd)
3908
+ if (Le.renderingColStart > Le.renderingColEnd)
3817
3909
  return { placedColumns: [], truncatedCols: 0 };
3818
- const x = Math.max(1, V - tr.length - Ct.length), { columns: R, widthUpdates: J, truncated: pe } = ts(te(_e.renderingColStart, 0, e - 1), te(_e.renderingColEnd, 0, e - 1), Ze, we, x);
3819
- if (J.length > 0) {
3820
- const nt = B.current;
3821
- nt.count >= cn ? nt.warned || (nt.warned = !0, F.warn("[VirtualGrid] getColWidth keeps disagreeing with its own previous values; width self-heal is suspended until a converged (zero-deviation) pass re-arms it (unstable accessor — the accessor must be index-stable while the ordering is unchanged).", {
3822
- window: _e.key,
3823
- pendingUpdates: J.length
3824
- })) : (nt.count += 1, qt.current = [...qt.current ?? [], ...J], Promise.resolve().then(er));
3910
+ const b = Math.max(1, V - tr.length - Ct.length), { columns: T, widthUpdates: Q, truncated: he } = ts(re(Le.renderingColStart, 0, e - 1), re(Le.renderingColEnd, 0, e - 1), Ze, Se, b);
3911
+ if (Q.length > 0) {
3912
+ const nt = q.current;
3913
+ nt.count >= cn ? nt.warned || (nt.warned = !0, L.warn("[VirtualGrid] getColWidth keeps disagreeing with its own previous values; width self-heal is suspended until a converged (zero-deviation) pass re-arms it (unstable accessor — the accessor must be index-stable while the ordering is unchanged).", {
3914
+ window: Le.key,
3915
+ pendingUpdates: Q.length
3916
+ })) : (nt.count += 1, Bt.current = [...Bt.current ?? [], ...Q], Promise.resolve().then(er));
3825
3917
  } else
3826
- B.current.count = 0, B.current.warned = !1;
3827
- return { placedColumns: R, truncatedCols: pe };
3828
- }, [_e, e, me.width, Nt, lt, tr.length, Ct.length, yt, Ze, we, V, er]), fe = u("");
3829
- q(() => {
3918
+ q.current.count = 0, q.current.warned = !1;
3919
+ return { placedColumns: T, truncatedCols: he };
3920
+ }, [Le, e, me.width, Nt, ut, tr.length, Ct.length, yt, Ze, Se, V, er]), fe = u("");
3921
+ W(() => {
3830
3922
  if (j > 0) {
3831
- const o = `${_e.key}:${j}`;
3832
- o !== fe.current && (fe.current = o, cr.current?.({ renderedCells: (G.length + tr.length + Ct.length) * (de + pt.length + v.length), droppedCols: j }));
3923
+ const o = `${Le.key}:${j}`;
3924
+ o !== fe.current && (fe.current = o, cr.current?.({ renderedCells: (G.length + tr.length + Ct.length) * (de + mt.length + v.length), droppedCols: j }));
3833
3925
  }
3834
- }, [j, _e.key, G.length, tr.length, Ct.length, de, pt.length, v.length]);
3835
- const ke = _e.colAnchor, Ge = p(
3926
+ }, [j, Le.key, G.length, tr.length, Ct.length, de, mt.length, v.length]);
3927
+ const Fe = Le.colAnchor, ct = p(
3836
3928
  (o) => {
3837
- const x = f?.(o), R = Ae(o) === 0, J = R ? null : G.map(({ col: pe, left: nt, width: Tr }) => {
3838
- const Ut = l?.(o, pe), Ar = { ...Ut?.style, left: nt - ke, width: Tr };
3839
- return /* @__PURE__ */ rn("div", { ...Ut, key: s ? s(o, pe) : pe, className: Ot("aqvs-grid-cell", Ut?.className), style: Ar }, a(i(o, pe), o, pe));
3929
+ const b = f?.(o), T = Ve(o) === 0, Q = T ? null : G.map(({ col: he, left: nt, width: Tr }) => {
3930
+ const Ut = l?.(o, he), Ar = { ...Ut?.style, left: nt - Fe, width: Tr };
3931
+ return /* @__PURE__ */ rn("div", { ...Ut, key: s ? s(o, he) : he, className: Ot("aqvs-grid-cell", Ut?.className), style: Ar }, a(i(o, he), o, he));
3840
3932
  });
3841
- return D === 0 && z === 0 ? /* @__PURE__ */ Q("div", { ...x, className: Ot("aqvs-grid-row", x?.className), style: x?.style, children: J }) : /* @__PURE__ */ Zt("div", { ...x, "data-aqvs-frozen-row": D > 0 ? "" : void 0, className: Ot("aqvs-grid-row aqvs-grid-row-frozen-host", x?.className), style: x?.style, children: [
3842
- R ? null : tr.map(({ col: pe, left: nt, width: Tr }) => {
3843
- const Ut = l?.(o, pe), Ar = { ...Ut?.style, left: nt, width: Tr };
3844
- return /* @__PURE__ */ rn("div", { ...Ut, "data-aqvs-frozen-cell": "", key: s ? s(o, pe) : pe, className: Ot("aqvs-grid-cell", Ut?.className), style: Ar }, a(i(o, pe), o, pe));
3933
+ return D === 0 && A === 0 ? /* @__PURE__ */ Z("div", { ...b, className: Ot("aqvs-grid-row", b?.className), style: b?.style, children: Q }) : /* @__PURE__ */ Zt("div", { ...b, "data-aqvs-frozen-row": D > 0 ? "" : void 0, className: Ot("aqvs-grid-row aqvs-grid-row-frozen-host", b?.className), style: b?.style, children: [
3934
+ T ? null : tr.map(({ col: he, left: nt, width: Tr }) => {
3935
+ const Ut = l?.(o, he), Ar = { ...Ut?.style, left: nt, width: Tr };
3936
+ return /* @__PURE__ */ rn("div", { ...Ut, "data-aqvs-frozen-cell": "", key: s ? s(o, he) : he, className: Ot("aqvs-grid-cell", Ut?.className), style: Ar }, a(i(o, he), o, he));
3845
3937
  }),
3846
- R ? null : /* @__PURE__ */ Q("div", { className: "aqvs-grid-row-scroll", children: /* @__PURE__ */ Q("div", { className: "aqvs-grid-row-scroll-inner", children: J }) }),
3847
- R || z === 0 ? null : /* @__PURE__ */ Q("div", { className: "aqvs-grid-row-trailing", children: /* @__PURE__ */ Q("div", { className: "aqvs-grid-row-trailing-inner", children: Ct.map(({ col: pe, left: nt, width: Tr }) => {
3848
- const Ut = l?.(o, pe), Ar = { ...Ut?.style, left: nt, width: Tr };
3849
- return /* @__PURE__ */ rn("div", { ...Ut, "data-aqvs-trailing-cell": "", key: s ? s(o, pe) : pe, className: Ot("aqvs-grid-cell", Ut?.className), style: Ar }, a(i(o, pe), o, pe));
3938
+ T ? null : /* @__PURE__ */ Z("div", { className: "aqvs-grid-row-scroll", children: /* @__PURE__ */ Z("div", { className: "aqvs-grid-row-scroll-inner", children: Q }) }),
3939
+ T || A === 0 ? null : /* @__PURE__ */ Z("div", { className: "aqvs-grid-row-trailing", children: /* @__PURE__ */ Z("div", { className: "aqvs-grid-row-trailing-inner", children: Ct.map(({ col: he, left: nt, width: Tr }) => {
3940
+ const Ut = l?.(o, he), Ar = { ...Ut?.style, left: nt, width: Tr };
3941
+ return /* @__PURE__ */ rn("div", { ...Ut, "data-aqvs-trailing-cell": "", key: s ? s(o, he) : he, className: Ot("aqvs-grid-cell", Ut?.className), style: Ar }, a(i(o, he), o, he));
3850
3942
  }) }) })
3851
3943
  ] });
3852
3944
  },
3853
- [G, tr, Ct, D, z, ke, f, l, s, i, a, Ae]
3854
- ), [Me, Ht] = Ve(""), xt = u(null), ut = u(!1), _t = u(Le);
3855
- _t.current = Le;
3945
+ [G, tr, Ct, D, A, Fe, f, l, s, i, a, Ve]
3946
+ ), [Ie, Wt] = Ce(""), xt = u(null), dt = u(!1), _t = u(ke);
3947
+ _t.current = ke;
3856
3948
  const ir = p(() => {
3857
3949
  const o = _t.current;
3858
- if (o === void 0 || ut.current)
3950
+ if (o === void 0 || dt.current)
3859
3951
  return;
3860
- const x = o.debounceMs ?? 400;
3861
- Number.isFinite(x) && x >= 0 && (xt.current !== null && window.clearTimeout(xt.current), xt.current = window.setTimeout(() => {
3952
+ const b = o.debounceMs ?? 400;
3953
+ Number.isFinite(b) && b >= 0 && (xt.current !== null && window.clearTimeout(xt.current), xt.current = window.setTimeout(() => {
3862
3954
  xt.current = null;
3863
- const R = Fe();
3864
- R !== null && Ht(o.buildMessage(R));
3865
- }, x));
3866
- }, [Fe]), Mr = Le?.debounceMs ?? 400, Br = Number.isFinite(Mr) && Mr >= 0, qr = Le !== void 0;
3867
- q(() => {
3868
- qr && !Br && F.warn(`[VirtualGrid] liveRegion.debounceMs must be a finite number >= 0, received ${Mr}. Announcements are disabled.`);
3869
- }, [qr, Br, Mr]), q(() => (ut.current = !1, () => {
3870
- ut.current = !0, xt.current !== null && window.clearTimeout(xt.current);
3871
- }), []), q(() => {
3955
+ const T = Oe();
3956
+ T !== null && Wt(o.buildMessage(T));
3957
+ }, b));
3958
+ }, [Oe]), Mr = ke?.debounceMs ?? 400, Br = Number.isFinite(Mr) && Mr >= 0, qr = ke !== void 0;
3959
+ W(() => {
3960
+ qr && !Br && L.warn(`[VirtualGrid] liveRegion.debounceMs must be a finite number >= 0, received ${Mr}. Announcements are disabled.`);
3961
+ }, [qr, Br, Mr]), W(() => (dt.current = !1, () => {
3962
+ dt.current = !0, xt.current !== null && window.clearTimeout(xt.current);
3963
+ }), []), W(() => {
3872
3964
  ir();
3873
- }, [_e, ir]);
3965
+ }, [Le, ir]);
3874
3966
  const Yr = p(
3875
3967
  (o) => {
3876
3968
  h(o), ir();
@@ -3880,159 +3972,221 @@ const Hi = 1e4, ds = () => {
3880
3972
  return Jr(
3881
3973
  He,
3882
3974
  () => ({
3975
+ /**
3976
+ * Applies `y` through the embedded row list's `scrollTo` (it floors and pins a row anchor) and `x` through `applyHx`,
3977
+ * clearing any column anchor; returns the applied position.
3978
+ * `y` は埋め込みの行の一覧の `scrollTo` (切り捨てて行のアンカーを張る) で、`x` は列のアンカーを外して `applyHx` で当て、当てた位置を
3979
+ * 返す処理。
3980
+ */
3883
3981
  scrollTo: (o) => {
3884
- const x = ce.current;
3885
- let R = ye.current;
3886
- o.y !== void 0 && x !== null && (x.scrollTo(o.y), R = x.getScrollPosition(), ye.current = R);
3887
- let J = be.current;
3888
- return o.x !== void 0 && (rt.current = null, J = It.current(o.x)), { x: J, y: R };
3982
+ const b = ce.current;
3983
+ let T = Re.current;
3984
+ o.y !== void 0 && b !== null && (b.scrollTo(o.y), T = b.getScrollPosition(), Re.current = T);
3985
+ let Q = ve.current;
3986
+ return o.x !== void 0 && (rt.current = null, Q = It.current(o.x)), { x: Q, y: T };
3889
3987
  },
3988
+ /**
3989
+ * Applies a non-zero `y` delta through `applyVy` and a non-zero `x` delta through `applyHx` (clearing any column anchor);
3990
+ * returns the applied position.
3991
+ * 0 でない `y` の差分は `applyVy` で、0 でない `x` の差分は列のアンカーを外して `applyHx` で当て、当てた位置を返す処理。
3992
+ */
3890
3993
  scrollBy: (o) => {
3891
- const x = o.y !== void 0 && o.y !== 0 ? wr(o.y) : ye.current;
3892
- let R = be.current;
3893
- return o.x !== void 0 && o.x !== 0 && (rt.current = null, R = It.current(be.current + o.x)), { x: R, y: x };
3994
+ const b = o.y !== void 0 && o.y !== 0 ? wr(o.y) : Re.current;
3995
+ let T = ve.current;
3996
+ return o.x !== void 0 && o.x !== 0 && (rt.current = null, T = It.current(ve.current + o.x)), { x: T, y: b };
3894
3997
  },
3895
- scrollToCell: (o, x, R) => {
3896
- const J = ce.current;
3897
- if (J !== null && t > 0) {
3898
- const pe = te(Math.trunc(o), 0, t - 1);
3899
- pe >= O && pe < t - Ee && J.scrollToIndex(pe - O, { align: R?.alignY ?? "top", offset: R?.offsetY });
3998
+ /**
3999
+ * Reveals a cell: a scroll row through the embedded row list's `scrollToIndex` (translated by −R), a scroll column by
4000
+ * arming a column anchor and applying its position; a frozen or trailing band row or column leaves its axis as it is.
4001
+ * セルを見せる処理。スクロール行は −R へ訳して埋め込みの行の一覧の `scrollToIndex` で、スクロール列は列のアンカーを張ってその位置を
4002
+ * 当てる。先頭・末尾の帯の行や列を狙った軸はそのまま。
4003
+ */
4004
+ scrollToCell: (o, b, T) => {
4005
+ const Q = ce.current;
4006
+ if (Q !== null && t > 0) {
4007
+ const he = re(Math.trunc(o), 0, t - 1);
4008
+ he >= z && he < t - Ae && Q.scrollToIndex(he - z, { align: T?.alignY ?? "top", offset: T?.offsetY });
3900
4009
  }
3901
4010
  if (e > 0) {
3902
- const pe = te(Math.trunc(x), 0, e - 1);
3903
- if (pe >= D && pe < e - z) {
3904
- const nt = { col: pe, alignX: R?.alignX ?? "start", offsetX: R?.offsetX ?? 0 };
4011
+ const he = re(Math.trunc(b), 0, e - 1);
4012
+ if (he >= D && he < e - A) {
4013
+ const nt = { col: he, alignX: T?.alignX ?? "start", offsetX: T?.offsetX ?? 0 };
3905
4014
  rt.current = nt, It.current(Jt(nt));
3906
4015
  }
3907
4016
  }
3908
4017
  },
3909
- getScrollPosition: () => ({ x: be.current, y: mr() }),
4018
+ /**
4019
+ * Reads the position: `x` from the horizontal cell, `y` through `getVy` (the embedded handle, or the last position once the
4020
+ * grid has unmounted).
4021
+ * 位置を読む処理。`x` は横の位置のセルから、`y` は `getVy` (埋め込みのハンドル。グリッドのアンマウントの後は最後の位置) から。
4022
+ */
4023
+ getScrollPosition: () => ({ x: ve.current, y: mr() }),
4024
+ /**
4025
+ * Captures the `{ row, col, offsetX, offsetY }` anchor of the first visible cell of the scroll band, on the same boundary
4026
+ * rule as the row side; null when either count is 0 or there is no scroll row.
4027
+ * スクロール帯の最初に見えるセルの `{ row, col, offsetX, offsetY }` のアンカーを、行の側と同じ境界の規則で捕える処理。どちらかの数が 0、
4028
+ * またはスクロール行が無ければ null。
4029
+ */
3910
4030
  getScrollAnchor: () => {
3911
4031
  if (t === 0 || e === 0)
3912
4032
  return null;
3913
4033
  const o = ce.current?.getScrollAnchor() ?? null;
3914
4034
  if (o === null)
3915
4035
  return null;
3916
- const x = ot.current + be.current, R = we.findIndexAtOrAfter(x, it);
3917
- if (R.index === -1)
3918
- return { row: o.index + O, col: e - 1, offsetX: 0, offsetY: o.offsetPx };
3919
- if (R.cumulative === x)
3920
- return { row: o.index + O, col: te(R.index + 1, 0, e - 1), offsetX: 0, offsetY: o.offsetPx };
3921
- const J = we.prefixSum(R.index, it);
3922
- return { row: o.index + O, col: R.index, offsetX: Math.max(0, x - (J.cumulative - J.currentValue)), offsetY: o.offsetPx };
4036
+ const b = ot.current + ve.current, T = Se.findIndexAtOrAfter(b, it);
4037
+ if (T.index === -1)
4038
+ return { row: o.index + z, col: e - 1, offsetX: 0, offsetY: o.offsetPx };
4039
+ if (T.cumulative === b)
4040
+ return { row: o.index + z, col: re(T.index + 1, 0, e - 1), offsetX: 0, offsetY: o.offsetPx };
4041
+ const Q = Se.prefixSum(T.index, it);
4042
+ return { row: o.index + z, col: T.index, offsetX: Math.max(0, b - (Q.cumulative - Q.currentValue)), offsetY: o.offsetPx };
3923
4043
  },
3924
- getViewportSize: () => ({ width: gt.current.width, height: gt.current.height }),
4044
+ /**
4045
+ * Reads the cell viewport (the measured or given box without the bars).
4046
+ * セルのビューポート (測ったか与えられた箱からバーを除いたもの) を読む処理。
4047
+ */
4048
+ getViewportSize: () => ({ width: bt.current.width, height: bt.current.height }),
4049
+ /**
4050
+ * Reads the content size: the total column width, and the band heights plus the embedded row list's content size
4051
+ * (insets included; 0 once the grid has unmounted).
4052
+ * 中身の寸法を読む処理。列の総幅と、帯の高さに埋め込みの行の一覧の中身の高さ (インセット込み。グリッドのアンマウントの後は 0) を足したもの。
4053
+ */
3925
4054
  // 縦はインセット込みの行側 getContentSize を単一情報源にする (range.totalHeight は木総高のみ)。
3926
4055
  // 3.5.0: height = H_F + 埋め込み + H_T
3927
- getContentSize: () => ({ width: I.current, height: ce.current === null ? 0 : ht.current + At.current + Math.max(0, ce.current.getContentSize()) }),
3928
- getRange: Fe,
3929
- updateRowSize: (o, x) => {
3930
- jr(x, "row", o), Math.trunc(o) < O ? $t((R) => R + 1) : Ee > 0 && Math.trunc(o) >= t - Ee ? Xt((R) => R + 1) : ce.current?.updateItemSize(Math.trunc(o) - O, x);
4056
+ getContentSize: () => ({ width: P.current, height: ce.current === null ? 0 : pt.current + At.current + Math.max(0, ce.current.getContentSize()) }),
4057
+ getRange: Oe,
4058
+ /**
4059
+ * Takes a row's new height (validated first): a leading or trailing band row re-reads its accessor through its epoch, a
4060
+ * scroll row goes to the embedded row list's `updateItemSize` (translated by −R).
4061
+ * 行の新しい高さを受け取る処理 (先に検証)。先頭・末尾の帯の行は epoch でアクセサを読み直させ、スクロール行は −R へ訳して埋め込みの
4062
+ * 行の一覧の `updateItemSize` へ渡す。
4063
+ */
4064
+ updateRowSize: (o, b) => {
4065
+ jr(b, "row", o), Math.trunc(o) < z ? Ht((T) => T + 1) : Ae > 0 && Math.trunc(o) >= t - Ae ? $t((T) => T + 1) : ce.current?.updateItemSize(Math.trunc(o) - z, b);
3931
4066
  },
3932
- updateColSize: (o, x) => {
3933
- jr(x, "col", o), Ye($e(() => we.update(te(Math.trunc(o), 0, Math.max(0, e - 1)), x)));
4067
+ /**
4068
+ * Takes a column's new width (validated first) into the width tree and mirrors the new total width at once.
4069
+ * 列の新しい幅を (先に検証して) 幅木へ入れ、新しい総幅をすぐに写す処理。
4070
+ */
4071
+ updateColSize: (o, b) => {
4072
+ jr(b, "col", o), Ye($e(() => Se.update(re(Math.trunc(o), 0, Math.max(0, e - 1)), b)));
3934
4073
  },
4074
+ /**
4075
+ * Reads the effective frozen bands of both axes and both ends (the visible trailing sizes through `trailingVisibleSize`).
4076
+ * 両軸・両端の実効の凍結帯を読む処理 (見えている末尾の寸法は `trailingVisibleSize` で求める)。
4077
+ */
3935
4078
  getFrozenSize: () => ({
3936
4079
  cols: D,
3937
4080
  width: ot.current,
3938
- rows: O,
3939
- height: ht.current,
3940
- trailingCols: z,
3941
- trailingRows: Ee,
3942
- trailingWidth: dt.current,
4081
+ rows: z,
4082
+ height: pt.current,
4083
+ trailingCols: A,
4084
+ trailingRows: Ae,
4085
+ trailingWidth: ft.current,
3943
4086
  trailingHeight: At.current,
3944
4087
  // vis は単一 JS 源ヘルパーの呼び出しのみ (式の再導出禁止 — 3.5.0 プラン §2.1-4)
3945
- trailingVisibleWidth: Kr(dt.current, ot.current, gt.current.width),
3946
- trailingVisibleHeight: Kr(At.current, ht.current, gt.current.height)
4088
+ trailingVisibleWidth: Kr(ft.current, ot.current, bt.current.width),
4089
+ trailingVisibleHeight: Kr(At.current, pt.current, bt.current.height)
3947
4090
  }),
4091
+ /**
4092
+ * Applies one wheel event through the embedded row list (its horizontal part reaches the grid's own axis through the
4093
+ * row list's `onWheelHorizontal`); returns whether the event was consumed, false once the grid has unmounted.
4094
+ * ホイールのイベント 1 つを埋め込みの行の一覧で当てる処理 (横の成分は行の一覧の `onWheelHorizontal` を通ってグリッド自身の軸へ届く)。
4095
+ * 消費したかを返し、グリッドのアンマウントの後は false。
4096
+ */
3948
4097
  applyWheel: (o) => ce.current?.applyWheel(o) ?? !1,
3949
- focusRowAtIndex: (o, x) => {
3950
- const R = Math.trunc(o);
3951
- R < O ? Pe.current?.querySelector(`[data-aqvs-frozen-band-row="${R}"]`)?.focus() : Ee > 0 && R >= t - Ee ? Pe.current?.querySelector(`[data-aqvs-trailing-band-row="${R}"]`)?.focus() : ce.current?.focusItemAtIndex(R - O, x);
4098
+ /**
4099
+ * Focuses a row: a leading or trailing band row through its band DOM, a scroll row through the embedded row list's
4100
+ * `focusItemAtIndex` (translated by −R).
4101
+ * 行へフォーカスする処理。先頭・末尾の帯の行は帯の DOM へ直接、スクロール行は −R へ訳して埋め込みの行の一覧の `focusItemAtIndex` で。
4102
+ */
4103
+ focusRowAtIndex: (o, b) => {
4104
+ const T = Math.trunc(o);
4105
+ T < z ? Pe.current?.querySelector(`[data-aqvs-frozen-band-row="${T}"]`)?.focus() : Ae > 0 && T >= t - Ae ? Pe.current?.querySelector(`[data-aqvs-trailing-band-row="${T}"]`)?.focus() : ce.current?.focusItemAtIndex(T - z, b);
3952
4106
  }
3953
4107
  }),
3954
- [t, e, we, $e, Fe, Ye, Jt, mr, wr, D, O, z, Ee]
3955
- ), /* @__PURE__ */ Zt("div", { ref: Ft, className: Ot("aqvs-grid", O > 0 ? "aqvs-grid-has-frozen-rows" : "", Ee > 0 ? "aqvs-grid-has-trailing-rows" : "", W), "data-testid": se, children: [
3956
- O > 0 ? (
4108
+ [t, e, Se, $e, Oe, Ye, Jt, mr, wr, D, z, A, Ae]
4109
+ ), /* @__PURE__ */ Zt("div", { ref: Ft, className: Ot("aqvs-grid", z > 0 ? "aqvs-grid-has-frozen-rows" : "", Ae > 0 ? "aqvs-grid-has-trailing-rows" : "", K), "data-testid": ee, children: [
4110
+ z > 0 ? (
3957
4111
  // 凍結行帯 (行凍結設計 §4-2): グリッド所有の帯外バンド — 行本体は renderRow を
3958
4112
  // そのまま再利用する (F > 0 の凍結セル / クリップ / hx 残差 var は継承で無償追随
3959
4113
  // = 4 象限コーナーの成立点)。top は木絶対プレフィックス、高さ 0 行は DOM 非生成
3960
- /* @__PURE__ */ Q("div", { className: "aqvs-grid-frozen-rows", style: { height: Xe }, "data-testid": se ? `${se}-frozen-rows` : void 0, children: pt.map(({ row: o, top: x, height: R }) => (
4114
+ /* @__PURE__ */ Z("div", { className: "aqvs-grid-frozen-rows", style: { height: Xe }, "data-testid": ee ? `${ee}-frozen-rows` : void 0, children: mt.map(({ row: o, top: b, height: T }) => (
3961
4115
  // 行ラッパーの role は消費側の複合ウィジェット契約 (listbox / tree / grid — README
3962
4116
  // 「Composite widget roles」) の所有物で、パッケージが既定 role を課すと衝突する。
3963
4117
  // フォーカス結線は focusRowAtIndex ↔ onRowFocus 往復のバンド版そのもの。右インセット
3964
4118
  // (right: scrollBarWidth + overflow クリップ) は縦バーコーナーの予約 — ペインの
3965
4119
  // クリップ箱 (root − バー幅) と帯のクリップ箱を一致させる (R1 是正)。
3966
4120
  // biome-ignore lint/a11y/noStaticElementInteractions: role は消費側の複合ウィジェット契約の所有物 (上記)
3967
- /* @__PURE__ */ Q("div", { "data-aqvs-frozen-band-row": o, className: "aqvs-grid-frozen-band-row", style: { top: x, height: R, right: Ie }, tabIndex: -1, onFocus: () => N?.(o), children: Ge(o) }, o)
4121
+ /* @__PURE__ */ Z("div", { "data-aqvs-frozen-band-row": o, className: "aqvs-grid-frozen-band-row", style: { top: b, height: T, right: ye }, tabIndex: -1, onFocus: () => N?.(o), children: ct(o) }, o)
3968
4122
  )) })
3969
4123
  ) : null,
3970
- /* @__PURE__ */ Q("div", { className: "aqvs-grid-main", "data-testid": se ? `${se}-main` : void 0, children: /* @__PURE__ */ Q(
4124
+ /* @__PURE__ */ Z("div", { className: "aqvs-grid-main", "data-testid": ee ? `${ee}-main` : void 0, children: /* @__PURE__ */ Z(
3971
4125
  Ki,
3972
4126
  {
3973
4127
  ref: ce,
3974
- itemCount: Qt ? 0 : ft,
3975
- getItem: (o) => o + O,
3976
- getItemKey: (o) => o + O,
3977
- getItemHeight: ee,
3978
- overscanCount: _,
4128
+ itemCount: Qt ? 0 : ht,
4129
+ getItem: (o) => o + z,
4130
+ getItemKey: (o) => o + z,
4131
+ getItemHeight: te,
4132
+ overscanCount: k,
3979
4133
  viewportSize: me.height > 0 ? Math.max(0, me.height - Xe - Y) : void 0,
3980
- callbackThrottleMs: Z,
3981
- behaviorOptions: Te,
4134
+ callbackThrottleMs: X,
4135
+ behaviorOptions: pe,
3982
4136
  scrollBarOptions: rr,
3983
- contentProps: b,
3984
- background: g,
3985
- contentInsets: M,
3986
- onItemFocus: Ne,
3987
- horizontalKeyInputs: ae,
3988
- horizontalKeyStep: De,
4137
+ contentProps: g,
4138
+ background: x,
4139
+ contentInsets: S,
4140
+ onItemFocus: Ee,
4141
+ horizontalKeyInputs: ie,
4142
+ horizontalKeyStep: ze,
3989
4143
  initialScrollAnchor: (
3990
4144
  // トグル済みなら視点保存 (捕捉アンカー) のみ — 捕捉 null は undefined (先頭)
3991
4145
  // へ落とし、消費済みマウント props の蘇りを断つ (R2 是正)。未トグルのみ
3992
4146
  // マウント props の凍結行 no-op 付き −R 変換 (列の §8 no-op と同文)
3993
- mt.current ? U.current !== null && U.current.row >= O && ft > 0 ? { index: U.current.row - O, offsetPx: U.current.offsetPx } : void 0 : $ !== void 0 && ft > 0 && Math.trunc($.row) >= O && Math.trunc($.row) < t - Ee ? { index: Math.trunc($.row) - O, offsetPx: $.offsetY } : void 0
4147
+ gt.current ? U.current !== null && U.current.row >= z && ht > 0 ? { index: U.current.row - z, offsetPx: U.current.offsetPx } : void 0 : B !== void 0 && ht > 0 && Math.trunc(B.row) >= z && Math.trunc(B.row) < t - Ae ? { index: Math.trunc(B.row) - z, offsetPx: B.offsetY } : void 0
3994
4148
  ),
3995
4149
  onScroll: c,
3996
4150
  onRangeChange: Yr,
3997
4151
  onWheelHorizontal: m,
3998
4152
  onPanHorizontal: m,
3999
- locale: Tt,
4153
+ locale: je,
4000
4154
  labels: C,
4001
- testId: se ? `${se}-rows` : void 0,
4002
- children: Ge
4155
+ testId: ee ? `${ee}-rows` : void 0,
4156
+ children: ct
4003
4157
  },
4004
- O
4158
+ z
4005
4159
  ) }),
4006
- Ee > 0 ? (
4160
+ Ae > 0 ? (
4007
4161
  // 末尾行帯 (3.5.0 プラン §6.1-17): .aqvs-grid-main の**後**・hbar の**前**の兄弟
4008
4162
  // (AT には「最終行が最後」の DOM 順正しさ。縦バーは帯の上で自然に終端)。帯クリップ高は
4009
4163
  // インライン H_T_vis (単一 JS 源 — 帯寸の CSS 変数は幅 2 つのみで高さ変数は導入しない)、
4010
4164
  // inner はインライン木高 H_T の bottom 定着 — 帯上端 = extent − H_T_vis が全構成で
4011
4165
  // 成立し、重複縮退では帯の**末尾**行が可視に残る。行本体は renderRow 逐語再利用
4012
4166
  // (先頭列 / 末尾列の帯構造を継承し 4 象限コーナー全種が無償で成立)
4013
- /* @__PURE__ */ Q("div", { className: "aqvs-grid-trailing-rows", style: { height: Kr(Y, Xe, me.height) }, "data-testid": se ? `${se}-trailing-rows` : void 0, children: /* @__PURE__ */ Q("div", { className: "aqvs-grid-trailing-rows-inner", style: { height: Y }, children: v.map(({ row: o, top: x, height: R }) => (
4167
+ /* @__PURE__ */ Z("div", { className: "aqvs-grid-trailing-rows", style: { height: Kr(Y, Xe, me.height) }, "data-testid": ee ? `${ee}-trailing-rows` : void 0, children: /* @__PURE__ */ Z("div", { className: "aqvs-grid-trailing-rows-inner", style: { height: Y }, children: v.map(({ row: o, top: b, height: T }) => (
4014
4168
  // 帯行は帯ローカル top + right: scrollBarWidth (縦バーコーナーの予約 — 先頭帯行と
4015
4169
  // 同文) + tabIndex −1 + onFocus フル行 index (focusRowAtIndex ↔ onRowFocus 往復)。
4016
4170
  // biome-ignore lint/a11y/noStaticElementInteractions: role は消費側の複合ウィジェット契約の所有物 (先頭帯行と同文)
4017
- /* @__PURE__ */ Q("div", { "data-aqvs-trailing-band-row": o, className: "aqvs-grid-trailing-band-row", style: { top: x, height: R, right: Ie }, tabIndex: -1, onFocus: () => N?.(o), children: Ge(o) }, o)
4171
+ /* @__PURE__ */ Z("div", { "data-aqvs-trailing-band-row": o, className: "aqvs-grid-trailing-band-row", style: { top: b, height: T, right: ye }, tabIndex: -1, onFocus: () => N?.(o), children: ct(o) }, o)
4018
4172
  )) }) })
4019
4173
  ) : null,
4020
- /* @__PURE__ */ Q("div", { className: "aqvs-grid-hbar-strip", style: { height: Ie, paddingRight: z > 0 ? Ie + Kr(lt, Nt, me.width) : Ie }, "data-testid": se ? `${se}-hbar` : void 0, children: /* @__PURE__ */ Q(
4174
+ /* @__PURE__ */ Z("div", { className: "aqvs-grid-hbar-strip", style: { height: ye, paddingRight: A > 0 ? ye + Kr(ut, Nt, me.width) : ye }, "data-testid": ee ? `${ee}-hbar` : void 0, children: /* @__PURE__ */ Z(
4021
4175
  Un,
4022
4176
  {
4023
4177
  horizontal: !0,
4024
- contentSize: Math.max(0, Je - Nt - lt),
4025
- viewportSize: Math.max(0, me.width - Nt - lt),
4178
+ contentSize: Math.max(0, Je - Nt - ut),
4179
+ viewportSize: Math.max(0, me.width - Nt - ut),
4026
4180
  scrollPosition: or,
4027
- itemCount: Math.max(0, e - D - z),
4181
+ itemCount: Math.max(0, e - D - A),
4028
4182
  tapScrollCircleOptions: xe?.tapScrollCircleOptions,
4029
- onScroll: (o, x) => (rt.current = null, It.current(typeof o == "function" ? o(x) : o)),
4183
+ onScroll: (o, b) => (rt.current = null, It.current(typeof o == "function" ? o(b) : o)),
4030
4184
  enableThumbDrag: xe?.enableThumbDrag,
4031
4185
  enableTrackClick: xe?.enableTrackClick,
4032
4186
  enableArrowButtons: xe?.enableArrowButtons,
4033
4187
  enableArrowButtonTabStops: xe?.enableArrowButtonTabStops,
4034
- scrollBarWidth: Ie,
4035
- locale: Tt,
4188
+ scrollBarWidth: ye,
4189
+ locale: je,
4036
4190
  labels: C
4037
4191
  }
4038
4192
  ) }),
@@ -4042,39 +4196,39 @@ const Hi = 1e4, ds = () => {
4042
4196
  // 帯幅非依存 (凍結トグル不変)。wrapper は純配置で transition を持たない
4043
4197
  // (フェードはサークルルートのインライン opacity — §8.7)。hbar strip の後・
4044
4198
  // live region の前 = 共有 z-50 層の DOM 後勝ちで最前
4045
- /* @__PURE__ */ Q(
4199
+ /* @__PURE__ */ Z(
4046
4200
  "div",
4047
4201
  {
4048
4202
  className: "aqvs-grid-tap-circle-wrapper",
4049
4203
  "data-aqvs-grid-tap-circle": "",
4050
4204
  style: {
4051
- left: `min(calc(100% - ${Ie + Ce.size}px), max(calc(100% - ${Ie}px + ${Ce.offsetX}px), calc(75% - ${Ce.size / 2}px)))`,
4052
- top: `min(calc(100% - ${Ie + Ce.size}px), max(calc(100% - ${Ie}px + ${Ce.offsetY}px), calc(75% - ${Ce.size / 2}px)))`
4205
+ left: `min(calc(100% - ${ye + Ne.size}px), max(calc(100% - ${ye}px + ${Ne.offsetX}px), calc(75% - ${Ne.size / 2}px)))`,
4206
+ top: `min(calc(100% - ${ye + Ne.size}px), max(calc(100% - ${ye}px + ${Ne.offsetY}px), calc(75% - ${Ne.size / 2}px)))`
4053
4207
  },
4054
- children: /* @__PURE__ */ Q(
4208
+ children: /* @__PURE__ */ Z(
4055
4209
  mn,
4056
4210
  {
4057
4211
  axis: "xy",
4058
4212
  ref: gr,
4059
- className: Ot("aqvs-grid-tap-circle", Ce.className),
4060
- size: Ce.size,
4213
+ className: Ot("aqvs-grid-tap-circle", Ne.className),
4214
+ size: Ne.size,
4061
4215
  maxVisualDistance: Er,
4062
4216
  opacity: tn,
4063
- renderVisual: Ce.renderVisual,
4217
+ renderVisual: Ne.renderVisual,
4064
4218
  onDragChange: Sr
4065
4219
  }
4066
4220
  )
4067
4221
  }
4068
4222
  ),
4069
- Le !== void 0 ? /* @__PURE__ */ Q("div", { className: "aqvs-grid-live-region", "aria-live": "polite", "data-testid": se ? `${se}-live` : void 0, children: Me }) : null
4223
+ ke !== void 0 ? /* @__PURE__ */ Z("div", { className: "aqvs-grid-live-region", "aria-live": "polite", "data-testid": ee ? `${ee}-live` : void 0, children: Ie }) : null
4070
4224
  ] });
4071
4225
  }, hs = Qr(ss);
4072
4226
  export {
4073
4227
  sr as FenwickMapTree,
4074
4228
  Vn as MAX_FROZEN_LEADING_COLS,
4075
4229
  An as MAX_FROZEN_LEADING_ROWS,
4076
- zn as MAX_FROZEN_TRAILING_COLS,
4077
- Dn as MAX_FROZEN_TRAILING_ROWS,
4230
+ Dn as MAX_FROZEN_TRAILING_COLS,
4231
+ zn as MAX_FROZEN_TRAILING_ROWS,
4078
4232
  Zi as MAX_RENDERED_CELLS,
4079
4233
  Lr as MAX_TRACK_SIZE,
4080
4234
  Un as ScrollBar,
@@ -4089,7 +4243,7 @@ export {
4089
4243
  fn as computeTapScrollSpeed,
4090
4244
  Ni as computeTapScrollVelocity,
4091
4245
  ls as createResidualQuantizer,
4092
- te as minmax,
4246
+ re as minmax,
4093
4247
  $n as resolveVirtualScrollLabels,
4094
4248
  Hn as resolveVirtualScrollLocale,
4095
4249
  us as tapScrollCircleSampleVisual,