@marimo-team/islands 0.19.7-dev30 → 0.19.7-dev33

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.
@@ -6,8 +6,8 @@ import { t as require_react } from "./react-DdA8EBol.js";
6
6
  import { t as require_compiler_runtime } from "./compiler-runtime-DHFVbq0b.js";
7
7
  import { n as Copy, r as toast, t as copyToClipboard } from "./copy-B59Bw3-w.js";
8
8
  import "./Combination-Bg-xN8JV.js";
9
- import { A as logNever, E as useOnMount, i as SelectContent, l as SelectTrigger, o as SelectItem, r as Select, t as Label, u as SelectValue } from "./label-DC2pbeUJ.js";
10
- import { S as DropdownMenuSubTrigger, W as ErrorBoundary, b as DropdownMenuSub, fn as Trash, g as DropdownMenuItem, hn as Pencil, ht as capitalize_default, i as Input, m as DropdownMenuContent, mn as Plus, mt as marked, p as DropdownMenu, pt as useNonce, t as BulkEdit, v as DropdownMenuPortal, x as DropdownMenuSubContent, y as DropdownMenuSeparator } from "./types-ZLLMdAtn.js";
9
+ import { O as logNever, i as SelectContent, l as SelectTrigger, o as SelectItem, r as Select, t as Label, u as SelectValue } from "./label-C4PtQcza.js";
10
+ import { S as DropdownMenuSubTrigger, W as ErrorBoundary, b as DropdownMenuSub, fn as Trash, g as DropdownMenuItem, hn as Pencil, ht as capitalize_default, i as Input, m as DropdownMenuContent, mn as Plus, mt as marked, p as DropdownMenu, pt as useNonce, t as BulkEdit, v as DropdownMenuPortal, x as DropdownMenuSubContent, y as DropdownMenuSeparator } from "./types-DBsIRhMX.js";
11
11
  import { l as Events, t as Button } from "./button-BWvsJ2Wr.js";
12
12
  import { s as Logger } from "./hotkeys-B5WnGZXF.js";
13
13
  import { t as require_jsx_runtime } from "./jsx-runtime-CTBg5pdT.js";
@@ -3170,34 +3170,34 @@ let __tla = (async () => {
3170
3170
  kind: GridCellKind.Loading,
3171
3171
  allowOverlay: false
3172
3172
  };
3173
- function drawCells(e, t, n, r, i, a, o, s, c, l, u, f, m, h, g, y, x, S, C, E, D, O, k, A, j, M, N, P, F, I, L, Fr, B, Ir, V) {
3174
- let H = (E == null ? void 0 : E.size) ?? 2 ** 53 - 1, Lr = performance.now(), U = I.baseFontFull;
3173
+ function drawCells(e, t, n, r, i, a, o, s, c, l, u, f, m, h, g, y, x, S, C, E, D, O, k, A, j, M, N, P, F, I, L, Pr, B, Fr, V) {
3174
+ let H = (E == null ? void 0 : E.size) ?? 2 ** 53 - 1, Ir = performance.now(), U = I.baseFontFull;
3175
3175
  e.font = U;
3176
- let Rr = {
3176
+ let Lr = {
3177
3177
  ctx: e
3178
3178
  }, W = [
3179
3179
  0,
3180
3180
  0
3181
- ], G = x > 0 ? getFreezeTrailingHeight(c, x, l) : 0, zr, K, q = getSkipPoint(C);
3182
- return walkColumns(t, s, a, o, i, (t2, a2, o2, s2, Br) => {
3183
- let Vr = Math.max(0, s2 - a2), Hr = a2 + Vr, Ur = i + 1, Wr = t2.width - Vr, Gr = r - i - 1;
3181
+ ], G = x > 0 ? getFreezeTrailingHeight(c, x, l) : 0, Rr, K, q = getSkipPoint(C);
3182
+ return walkColumns(t, s, a, o, i, (t2, a2, o2, s2, zr) => {
3183
+ let Br = Math.max(0, s2 - a2), Vr = a2 + Br, Hr = i + 1, Ur = t2.width - Br, Wr = r - i - 1;
3184
3184
  if (C.length > 0) {
3185
3185
  let e2 = false;
3186
3186
  for (let t3 = 0; t3 < C.length; t3++) {
3187
3187
  let n2 = C[t3];
3188
- if (intersectRect(Hr, Ur, Wr, Gr, n2.x, n2.y, n2.width, n2.height)) {
3188
+ if (intersectRect(Vr, Hr, Ur, Wr, n2.x, n2.y, n2.width, n2.height)) {
3189
3189
  e2 = true;
3190
3190
  break;
3191
3191
  }
3192
3192
  }
3193
3193
  if (!e2) return;
3194
3194
  }
3195
- let Kr = () => {
3196
- e.save(), e.beginPath(), e.rect(Hr, Ur, Wr, Gr), e.clip();
3197
- }, qr = D.columns.hasIndex(t2.sourceIndex), J = f(t2.group ?? "").overrideTheme, Jr = t2.themeOverride === void 0 && J === void 0 ? I : mergeAndRealizeTheme(I, J, t2.themeOverride), Yr = Jr.baseFontFull;
3198
- Yr !== U && (U = Yr, e.font = Yr), Kr();
3199
- let Xr;
3200
- return walkRowsInCol(Br, o2, r, c, l, x, S, q, (i2, o3, l2, f2, x2) => {
3195
+ let Gr = () => {
3196
+ e.save(), e.beginPath(), e.rect(Vr, Hr, Ur, Wr), e.clip();
3197
+ }, Kr = D.columns.hasIndex(t2.sourceIndex), J = f(t2.group ?? "").overrideTheme, qr = t2.themeOverride === void 0 && J === void 0 ? I : mergeAndRealizeTheme(I, J, t2.themeOverride), Jr = qr.baseFontFull;
3198
+ Jr !== U && (U = Jr, e.font = Jr), Gr();
3199
+ let Yr;
3200
+ return walkRowsInCol(zr, o2, r, c, l, x, S, q, (i2, o3, l2, f2, x2) => {
3201
3201
  var _a, _b, _c;
3202
3202
  if (o3 < 0 || (W[0] = t2.sourceIndex, W[1] = o3, E !== void 0 && !E.has(W))) return;
3203
3203
  if (C.length > 0) {
@@ -3211,32 +3211,32 @@ let __tla = (async () => {
3211
3211
  }
3212
3212
  if (!e2) return;
3213
3213
  }
3214
- let S2 = D.rows.hasIndex(o3), q2 = h.hasIndex(o3), Br2 = o3 < c ? u(W) : loadingCell$1, Vr2 = a2, Hr2 = t2.width, Ur2 = false, Wr2 = false;
3215
- if (Br2.span !== void 0) {
3216
- let [r2, c2] = Br2.span, u2 = `${o3},${r2},${c2},${t2.sticky}`;
3214
+ let S2 = D.rows.hasIndex(o3), q2 = h.hasIndex(o3), zr2 = o3 < c ? u(W) : loadingCell$1, Br2 = a2, Vr2 = t2.width, Hr2 = false, Ur2 = false;
3215
+ if (zr2.span !== void 0) {
3216
+ let [r2, c2] = zr2.span, u2 = `${o3},${r2},${c2},${t2.sticky}`;
3217
3217
  if (K === void 0 && (K = /* @__PURE__ */ new Set()), K.has(u2)) {
3218
3218
  H--;
3219
3219
  return;
3220
3220
  } else {
3221
- let r3 = getSpanBounds(Br2.span, a2, i2, t2.width, l2, t2, n), o4 = t2.sticky ? r3[0] : r3[1];
3222
- if (!t2.sticky && r3[0] !== void 0 && (Wr2 = true), o4 !== void 0) {
3223
- Vr2 = o4.x, Hr2 = o4.width, K.add(u2), e.restore(), Xr = void 0, e.save(), e.beginPath();
3221
+ let r3 = getSpanBounds(zr2.span, a2, i2, t2.width, l2, t2, n), o4 = t2.sticky ? r3[0] : r3[1];
3222
+ if (!t2.sticky && r3[0] !== void 0 && (Ur2 = true), o4 !== void 0) {
3223
+ Br2 = o4.x, Vr2 = o4.width, K.add(u2), e.restore(), Yr = void 0, e.save(), e.beginPath();
3224
3224
  let t3 = Math.max(0, s2 - o4.x);
3225
- e.rect(o4.x + t3, i2, o4.width - t3, l2), zr === void 0 && (zr = []), zr.push({
3225
+ e.rect(o4.x + t3, i2, o4.width - t3, l2), Rr === void 0 && (Rr = []), Rr.push({
3226
3226
  x: o4.x + t3,
3227
3227
  y: i2,
3228
3228
  width: o4.width - t3,
3229
3229
  height: l2
3230
- }), e.clip(), Ur2 = true;
3230
+ }), e.clip(), Hr2 = true;
3231
3231
  }
3232
3232
  }
3233
3233
  }
3234
- let Gr2 = m == null ? void 0 : m(o3), J2 = x2 && ((_a = t2.trailingRowOptions) == null ? void 0 : _a.themeOverride) !== void 0 ? (_b = t2.trailingRowOptions) == null ? void 0 : _b.themeOverride : void 0, Y = Br2.themeOverride === void 0 && Gr2 === void 0 && J2 === void 0 ? Jr : mergeAndRealizeTheme(Jr, Gr2, J2, Br2.themeOverride);
3234
+ let Wr2 = m == null ? void 0 : m(o3), J2 = x2 && ((_a = t2.trailingRowOptions) == null ? void 0 : _a.themeOverride) !== void 0 ? (_b = t2.trailingRowOptions) == null ? void 0 : _b.themeOverride : void 0, Y = zr2.themeOverride === void 0 && Wr2 === void 0 && J2 === void 0 ? qr : mergeAndRealizeTheme(qr, Wr2, J2, zr2.themeOverride);
3235
3235
  e.beginPath();
3236
- let Zr = cellIsSelected(W, Br2, D), X = cellIsInRange(W, Br2, D, y), Qr = Br2.span !== void 0 && D.columns.some((e2) => Br2.span !== void 0 && e2 >= Br2.span[0] && e2 <= Br2.span[1]);
3237
- Zr && !g && y ? X = 0 : Zr && y && (X = Math.max(X, 1)), Qr && X++, Zr || (S2 && X++, qr && !x2 && X++);
3238
- let $r = Br2.kind === GridCellKind.Protected ? Y.bgCellMedium : Y.bgCell, ei;
3239
- if ((f2 || $r !== I.bgCell) && (ei = blend($r, ei)), X > 0 || q2) {
3236
+ let Xr = cellIsSelected(W, zr2, D), X = cellIsInRange(W, zr2, D, y), Zr = zr2.span !== void 0 && D.columns.some((e2) => zr2.span !== void 0 && e2 >= zr2.span[0] && e2 <= zr2.span[1]);
3237
+ Xr && !g && y ? X = 0 : Xr && y && (X = Math.max(X, 1)), Zr && X++, Xr || (S2 && X++, Kr && !x2 && X++);
3238
+ let Qr = zr2.kind === GridCellKind.Protected ? Y.bgCellMedium : Y.bgCell, ei;
3239
+ if ((f2 || Qr !== I.bgCell) && (ei = blend(Qr, ei)), X > 0 || q2) {
3240
3240
  q2 && (ei = blend(Y.bgHeader, ei));
3241
3241
  for (let e2 = 0; e2 < X; e2++) ei = blend(Y.accentLight, ei);
3242
3242
  } else if (O !== void 0) {
@@ -3249,28 +3249,28 @@ let __tla = (async () => {
3249
3249
  let n2 = k[e2], r2 = n2.range;
3250
3250
  n2.style !== "solid-outline" && r2.x <= t2.sourceIndex && t2.sourceIndex < r2.x + r2.width && r2.y <= o3 && o3 < r2.y + r2.height && (ei = blend(n2.color, ei));
3251
3251
  }
3252
- let ni = false;
3252
+ let ti = false;
3253
3253
  if (E !== void 0) {
3254
3254
  let t3 = i2 + 1, n2 = (f2 ? t3 + l2 - 1 : Math.min(t3 + l2 - 1, r - G)) - t3;
3255
- (n2 !== l2 - 1 || Vr2 + 1 <= s2) && (ni = true, e.save(), e.beginPath(), e.rect(Vr2 + 1, t3, Hr2 - 1, n2), e.clip()), ei = ei === void 0 ? Y.bgCell : blend(ei, Y.bgCell);
3255
+ (n2 !== l2 - 1 || Br2 + 1 <= s2) && (ti = true, e.save(), e.beginPath(), e.rect(Br2 + 1, t3, Vr2 - 1, n2), e.clip()), ei = ei === void 0 ? Y.bgCell : blend(ei, Y.bgCell);
3256
3256
  }
3257
- let ri = t2.sourceIndex === n.length - 1, ii = o3 === c - 1;
3258
- ei !== void 0 && (e.fillStyle = ei, Xr !== void 0 && (Xr.fillStyle = ei), E === void 0 ? e.fillRect(Vr2, i2, Hr2, l2) : e.fillRect(Vr2 + 1, i2 + 1, Hr2 - (ri ? 2 : 1), l2 - (ii ? 2 : 1))), Br2.style === "faded" && (e.globalAlpha = 0.6);
3259
- let oi;
3257
+ let ni = t2.sourceIndex === n.length - 1, ii = o3 === c - 1;
3258
+ ei !== void 0 && (e.fillStyle = ei, Yr !== void 0 && (Yr.fillStyle = ei), E === void 0 ? e.fillRect(Br2, i2, Vr2, l2) : e.fillRect(Br2 + 1, i2 + 1, Vr2 - (ni ? 2 : 1), l2 - (ii ? 2 : 1))), zr2.style === "faded" && (e.globalAlpha = 0.6);
3259
+ let ai;
3260
3260
  for (let e2 = 0; e2 < M.length; e2++) {
3261
3261
  let n2 = M[e2];
3262
3262
  if (n2.item[0] === t2.sourceIndex && n2.item[1] === o3) {
3263
- oi = n2;
3263
+ ai = n2;
3264
3264
  break;
3265
3265
  }
3266
3266
  }
3267
- if (Hr2 > V && !Wr2) {
3267
+ if (Vr2 > V && !Ur2) {
3268
3268
  let n2 = Y.baseFontFull;
3269
- n2 !== U && (e.font = n2, U = n2), Xr = drawCell(e, Br2, t2.sourceIndex, o3, ri, ii, Vr2, i2, Hr2, l2, X > 0, Y, ei ?? Y.bgCell, A, j, (oi == null ? void 0 : oi.hoverAmount) ?? 0, N, F, Lr, P, Xr, L, Fr, B, Ir);
3269
+ n2 !== U && (e.font = n2, U = n2), Yr = drawCell(e, zr2, t2.sourceIndex, o3, ni, ii, Br2, i2, Vr2, l2, X > 0, Y, ei ?? Y.bgCell, A, j, (ai == null ? void 0 : ai.hoverAmount) ?? 0, N, F, Ir, P, Yr, L, Pr, B, Fr);
3270
3270
  }
3271
- return ni && e.restore(), Br2.style === "faded" && (e.globalAlpha = 1), H--, Ur2 && (e.restore(), (_c = Xr == null ? void 0 : Xr.deprep) == null ? void 0 : _c.call(Xr, Rr), Xr = void 0, Kr(), U = Yr, e.font = Yr), H <= 0;
3271
+ return ti && e.restore(), zr2.style === "faded" && (e.globalAlpha = 1), H--, Hr2 && (e.restore(), (_c = Yr == null ? void 0 : Yr.deprep) == null ? void 0 : _c.call(Yr, Lr), Yr = void 0, Gr(), U = Jr, e.font = Jr), H <= 0;
3272
3272
  }), e.restore(), H <= 0;
3273
- }), zr;
3273
+ }), Rr;
3274
3274
  }
3275
3275
  var allocatedItem = [
3276
3276
  0,
@@ -3358,8 +3358,8 @@ let __tla = (async () => {
3358
3358
  e.save(), e.beginPath(), e.rect(r2 + g2, s, t2.width - g2, o), e.clip();
3359
3359
  let E2 = y(t2.group ?? "").overrideTheme, j = t2.themeOverride === void 0 && E2 === void 0 ? f : mergeAndRealizeTheme(f, E2, t2.themeOverride);
3360
3360
  j.bgHeader !== f.bgHeader && (e.fillStyle = j.bgHeader, e.fill()), j !== f && (e.font = j.baseFontFull);
3361
- let M = u.columns.hasIndex(t2.sourceIndex), N = c !== void 0 || l, P = !N && O === -1 && D === t2.sourceIndex, F = N ? 0 : ((_a2 = h.find((e2) => e2.item[0] === t2.sourceIndex && e2.item[1] === -1)) == null ? void 0 : _a2.hoverAmount) ?? 0, I = (u == null ? void 0 : u.current) !== void 0 && u.current.cell[0] === t2.sourceIndex, L = M ? j.accentColor : I ? j.bgHeaderHasFocus : j.bgHeader, Fr = n ? s : 0, B = t2.sourceIndex === 0 ? 0 : 1;
3362
- M ? (e.fillStyle = L, e.fillRect(r2 + B, Fr, t2.width - B, o)) : (I || F > 0) && (e.beginPath(), e.rect(r2 + B, Fr, t2.width - B, o), I && (e.fillStyle = j.bgHeaderHasFocus, e.fill()), F > 0 && (e.globalAlpha = F, e.fillStyle = j.bgHeaderHovered, e.fill(), e.globalAlpha = 1)), drawHeader(e, r2, Fr, t2.width, o, t2, M, j, P, P ? k : void 0, P ? A : void 0, I, F, m, S, C), e.restore();
3361
+ let M = u.columns.hasIndex(t2.sourceIndex), N = c !== void 0 || l, P = !N && O === -1 && D === t2.sourceIndex, F = N ? 0 : ((_a2 = h.find((e2) => e2.item[0] === t2.sourceIndex && e2.item[1] === -1)) == null ? void 0 : _a2.hoverAmount) ?? 0, I = (u == null ? void 0 : u.current) !== void 0 && u.current.cell[0] === t2.sourceIndex, L = M ? j.accentColor : I ? j.bgHeaderHasFocus : j.bgHeader, Pr = n ? s : 0, B = t2.sourceIndex === 0 ? 0 : 1;
3362
+ M ? (e.fillStyle = L, e.fillRect(r2 + B, Pr, t2.width - B, o)) : (I || F > 0) && (e.beginPath(), e.rect(r2 + B, Pr, t2.width - B, o), I && (e.fillStyle = j.bgHeaderHasFocus, e.fill()), F > 0 && (e.globalAlpha = F, e.fillStyle = j.bgHeaderHovered, e.fill(), e.globalAlpha = 1)), drawHeader(e, r2, Pr, t2.width, o, t2, M, j, P, P ? k : void 0, P ? A : void 0, I, F, m, S, C), e.restore();
3363
3363
  }), n && drawGroups(e, t, i, a, s, r, f, m, h, g, y, x);
3364
3364
  }
3365
3365
  function drawGroups(e, t, n, r, i, a, o, s, c, l, u, f) {
@@ -4404,34 +4404,34 @@ let __tla = (async () => {
4404
4404
  }
4405
4405
  function drawGrid(e, t) {
4406
4406
  var _a;
4407
- let { canvasCtx: n, headerCanvasCtx: r, width: i, height: a, cellXOffset: o, cellYOffset: s, translateX: c, translateY: l, mappedColumns: u, enableGroups: f, freezeColumns: m, dragAndDropState: h, theme: g, drawFocus: y, headerHeight: x, groupHeaderHeight: S, disabledRows: C, rowHeight: E, verticalBorder: D, overrideCursor: O, isResizing: k, selection: A, fillHandle: j, freezeTrailingRows: M, rows: N, getCellContent: P, getGroupDetails: F, getRowThemeOverride: I, isFocused: L, drawHeaderCallback: Fr, prelightCells: B, drawCellCallback: Ir, highlightRegions: V, resizeCol: H, imageLoader: Lr, lastBlitData: U, hoverValues: Rr, hyperWrapping: W, hoverInfo: G, spriteManager: zr, maxScaleFactor: K, hasAppendRow: q, touchMode: Br, enqueue: Hr, renderStateProvider: Ur, getCellRenderer: Wr, renderStrategy: Gr, bufferACtx: Kr, bufferBCtx: qr, damage: J, minimumCellWidth: Jr, resizeIndicator: Yr } = e;
4407
+ let { canvasCtx: n, headerCanvasCtx: r, width: i, height: a, cellXOffset: o, cellYOffset: s, translateX: c, translateY: l, mappedColumns: u, enableGroups: f, freezeColumns: m, dragAndDropState: h, theme: g, drawFocus: y, headerHeight: x, groupHeaderHeight: S, disabledRows: C, rowHeight: E, verticalBorder: D, overrideCursor: O, isResizing: k, selection: A, fillHandle: j, freezeTrailingRows: M, rows: N, getCellContent: P, getGroupDetails: F, getRowThemeOverride: I, isFocused: L, drawHeaderCallback: Pr, prelightCells: B, drawCellCallback: Fr, highlightRegions: V, resizeCol: H, imageLoader: Ir, lastBlitData: U, hoverValues: Lr, hyperWrapping: W, hoverInfo: G, spriteManager: Rr, maxScaleFactor: K, hasAppendRow: q, touchMode: Br, enqueue: Vr, renderStateProvider: Hr, getCellRenderer: Ur, renderStrategy: Wr, bufferACtx: Gr, bufferBCtx: Kr, damage: J, minimumCellWidth: qr, resizeIndicator: Jr } = e;
4408
4408
  if (i === 0 || a === 0) return;
4409
- let Xr = Gr === "double-buffer", Y = Math.min(K, Math.ceil(window.devicePixelRatio ?? 1)), Zr = Gr !== "direct" && computeCanBlit(e, t), X = n.canvas;
4409
+ let Yr = Wr === "double-buffer", Y = Math.min(K, Math.ceil(window.devicePixelRatio ?? 1)), Xr = Wr !== "direct" && computeCanBlit(e, t), X = n.canvas;
4410
4410
  (X.width !== i * Y || X.height !== a * Y) && (X.width = i * Y, X.height = a * Y, X.style.width = i + "px", X.style.height = a + "px");
4411
- let Qr = r.canvas, $r = f ? S + x : x, ei = $r + 1;
4412
- (Qr.width !== i * Y || Qr.height !== ei * Y) && (Qr.width = i * Y, Qr.height = ei * Y, Qr.style.width = i + "px", Qr.style.height = ei + "px");
4413
- let ti = Kr.canvas, ni = qr.canvas;
4414
- Xr && (ti.width !== i * Y || ti.height !== a * Y) && (ti.width = i * Y, ti.height = a * Y, U.current !== void 0 && (U.current.aBufferScroll = void 0)), Xr && (ni.width !== i * Y || ni.height !== a * Y) && (ni.width = i * Y, ni.height = a * Y, U.current !== void 0 && (U.current.bBufferScroll = void 0));
4415
- let ri = U.current;
4416
- if (Zr === true && o === (ri == null ? void 0 : ri.cellXOffset) && s === (ri == null ? void 0 : ri.cellYOffset) && c === (ri == null ? void 0 : ri.translateX) && l === (ri == null ? void 0 : ri.translateY)) return;
4417
- let ii = null;
4418
- Xr && (ii = n);
4419
- let ai = r, oi;
4420
- oi = Xr ? J === void 0 ? (ri == null ? void 0 : ri.lastBuffer) === "b" ? Kr : qr : (ri == null ? void 0 : ri.lastBuffer) === "b" ? qr : Kr : n;
4421
- let si = oi.canvas, ci = Xr ? si === ti ? ni : ti : X, li = typeof E == "number" ? () => E : E;
4422
- ai.save(), oi.save(), ai.beginPath(), oi.beginPath(), ai.textBaseline = "middle", oi.textBaseline = "middle", Y !== 1 && (ai.scale(Y, Y), oi.scale(Y, Y));
4423
- let ui = getEffectiveColumns(u, o, i, h, c), di = [], fi = y && ((_a = A.current) == null ? void 0 : _a.cell[1]) === s && l === 0, pi = false;
4411
+ let Zr = r.canvas, Qr = f ? S + x : x, $r = Qr + 1;
4412
+ (Zr.width !== i * Y || Zr.height !== $r * Y) && (Zr.width = i * Y, Zr.height = $r * Y, Zr.style.width = i + "px", Zr.style.height = $r + "px");
4413
+ let ei = Gr.canvas, ti = Kr.canvas;
4414
+ Yr && (ei.width !== i * Y || ei.height !== a * Y) && (ei.width = i * Y, ei.height = a * Y, U.current !== void 0 && (U.current.aBufferScroll = void 0)), Yr && (ti.width !== i * Y || ti.height !== a * Y) && (ti.width = i * Y, ti.height = a * Y, U.current !== void 0 && (U.current.bBufferScroll = void 0));
4415
+ let ni = U.current;
4416
+ if (Xr === true && o === (ni == null ? void 0 : ni.cellXOffset) && s === (ni == null ? void 0 : ni.cellYOffset) && c === (ni == null ? void 0 : ni.translateX) && l === (ni == null ? void 0 : ni.translateY)) return;
4417
+ let ri = null;
4418
+ Yr && (ri = n);
4419
+ let ii = r, ai;
4420
+ ai = Yr ? J === void 0 ? (ni == null ? void 0 : ni.lastBuffer) === "b" ? Gr : Kr : (ni == null ? void 0 : ni.lastBuffer) === "b" ? Kr : Gr : n;
4421
+ let oi = ai.canvas, si = Yr ? oi === ei ? ti : ei : X, ci = typeof E == "number" ? () => E : E;
4422
+ ii.save(), ai.save(), ii.beginPath(), ai.beginPath(), ii.textBaseline = "middle", ai.textBaseline = "middle", Y !== 1 && (ii.scale(Y, Y), ai.scale(Y, Y));
4423
+ let li = getEffectiveColumns(u, o, i, h, c), ui = [], di = y && ((_a = A.current) == null ? void 0 : _a.cell[1]) === s && l === 0, pi = false;
4424
4424
  if (V !== void 0) {
4425
4425
  for (let e2 of V) if (e2.style !== "no-outline" && e2.range.y === s && l === 0) {
4426
4426
  pi = true;
4427
4427
  break;
4428
4428
  }
4429
4429
  }
4430
- let hi = () => {
4431
- drawGridHeaders(ai, ui, f, G, i, c, x, S, h, k, A, g, zr, Rr, D, F, J, Fr, Br), drawGridLines(ai, ui, s, c, l, i, a, void 0, void 0, S, $r, li, I, D, M, N, g, true), ai.beginPath(), ai.moveTo(0, ei - 0.5), ai.lineTo(i, ei - 0.5), ai.strokeStyle = blend(g.headerBottomBorderColor ?? g.horizontalBorderColor ?? g.borderColor, g.bgHeader), ai.stroke(), pi && drawHighlightRings(ai, i, a, o, s, c, l, u, m, x, S, E, M, N, V, g), fi && drawFillHandle(ai, i, a, s, c, l, ui, u, g, $r, A, li, P, M, q, j, N);
4430
+ let mi = () => {
4431
+ drawGridHeaders(ii, li, f, G, i, c, x, S, h, k, A, g, Rr, Lr, D, F, J, Pr, Br), drawGridLines(ii, li, s, c, l, i, a, void 0, void 0, S, Qr, ci, I, D, M, N, g, true), ii.beginPath(), ii.moveTo(0, $r - 0.5), ii.lineTo(i, $r - 0.5), ii.strokeStyle = blend(g.headerBottomBorderColor ?? g.horizontalBorderColor ?? g.borderColor, g.bgHeader), ii.stroke(), pi && drawHighlightRings(ii, i, a, o, s, c, l, u, m, x, S, E, M, N, V, g), di && drawFillHandle(ii, i, a, s, c, l, li, u, g, Qr, A, ci, P, M, q, j, N);
4432
4432
  };
4433
4433
  if (J !== void 0) {
4434
- let e2 = ui[ui.length - 1].sourceIndex + 1, t2 = J.hasItemInRegion([
4434
+ let e2 = li[li.length - 1].sourceIndex + 1, t2 = J.hasItemInRegion([
4435
4435
  {
4436
4436
  x: o,
4437
4437
  y: -2,
@@ -4464,54 +4464,54 @@ let __tla = (async () => {
4464
4464
  when: M > 0
4465
4465
  }
4466
4466
  ]), n2 = (e3) => {
4467
- drawCells(e3, ui, u, a, $r, c, l, s, N, li, P, F, I, C, L, y, M, q, di, J, A, B, V, Lr, zr, Rr, G, Ir, W, g, Hr, Ur, Wr, O, Jr);
4467
+ drawCells(e3, li, u, a, Qr, c, l, s, N, ci, P, F, I, C, L, y, M, q, ui, J, A, B, V, Ir, Rr, Lr, G, Fr, W, g, Vr, Hr, Ur, O, qr);
4468
4468
  let t3 = A.current;
4469
- j && y && t3 !== void 0 && J.has(rectBottomRight(t3.range)) && drawFillHandle(e3, i, a, s, c, l, ui, u, g, $r, A, li, P, M, q, j, N);
4469
+ j && y && t3 !== void 0 && J.has(rectBottomRight(t3.range)) && drawFillHandle(e3, i, a, s, c, l, li, u, g, Qr, A, ci, P, M, q, j, N);
4470
4470
  };
4471
- t2 && (n2(oi), ii !== null && (ii.save(), ii.scale(Y, Y), ii.textBaseline = "middle", n2(ii), ii.restore()), J.hasHeader() && (clipHeaderDamage(ai, ui, i, S, $r, c, l, s, J), hi())), oi.restore(), ai.restore();
4471
+ t2 && (n2(ai), ri !== null && (ri.save(), ri.scale(Y, Y), ri.textBaseline = "middle", n2(ri), ri.restore()), J.hasHeader() && (clipHeaderDamage(ii, li, i, S, Qr, c, l, s, J), mi())), ai.restore(), ii.restore();
4472
4472
  return;
4473
4473
  }
4474
- if ((Zr !== true || o !== (ri == null ? void 0 : ri.cellXOffset) || c !== (ri == null ? void 0 : ri.translateX) || fi !== (ri == null ? void 0 : ri.mustDrawFocusOnHeader) || pi !== (ri == null ? void 0 : ri.mustDrawHighlightRingsOnHeader)) && hi(), Zr === true) {
4475
- assert(ci !== void 0 && ri !== void 0);
4476
- let { regions: e2 } = blitLastFrame(oi, ci, ci === ti ? ri.aBufferScroll : ri.bBufferScroll, ci === ti ? ri.bBufferScroll : ri.aBufferScroll, ri, o, s, c, l, M, i, a, N, $r, Y, u, ui, E, Xr);
4477
- di = e2;
4478
- } else Zr !== false && (assert(ri !== void 0), di = blitResizedCol(ri, o, s, c, l, i, a, $r, ui, Zr));
4479
- overdrawStickyBoundaries(oi, ui, i, a, M, N, D, li, g);
4480
- let gi = drawHighlightRings(oi, i, a, o, s, c, l, u, m, x, S, E, M, N, V, g), _i = y ? drawFillHandle(oi, i, a, s, c, l, ui, u, g, $r, A, li, P, M, q, j, N) : void 0;
4481
- if (oi.fillStyle = g.bgCell, di.length > 0) {
4482
- oi.beginPath();
4483
- for (let e2 of di) oi.rect(e2.x, e2.y, e2.width, e2.height);
4484
- oi.clip(), oi.fill(), oi.beginPath();
4485
- } else oi.fillRect(0, 0, i, a);
4486
- let vi = drawCells(oi, ui, u, a, $r, c, l, s, N, li, P, F, I, C, L, y, M, q, di, J, A, B, V, Lr, zr, Rr, G, Ir, W, g, Hr, Ur, Wr, O, Jr);
4487
- drawBlanks(oi, ui, u, i, a, $r, c, l, s, N, li, I, A.rows, C, M, q, di, J, g), drawExtraRowThemes(oi, ui, s, c, l, i, a, di, $r, li, I, D, M, N, g), drawGridLines(oi, ui, s, c, l, i, a, di, vi, S, $r, li, I, D, M, N, g), gi == null ? void 0 : gi(), _i == null ? void 0 : _i(), k && Yr !== "none" && walkColumns(ui, 0, c, 0, $r, (e2, t2) => e2.sourceIndex === H ? (drawColumnResizeOutline(ai, t2 + e2.width, 0, $r + 1, blend(g.resizeIndicatorColor ?? g.accentLight, g.bgHeader)), Yr === "full" && drawColumnResizeOutline(oi, t2 + e2.width, $r, a, blend(g.resizeIndicatorColor ?? g.accentLight, g.bgCell)), true) : false), ii !== null && (ii.fillStyle = g.bgCell, ii.fillRect(0, 0, i, a), ii.drawImage(oi.canvas, 0, 0));
4488
- let yi = getLastRow(ui, a, $r, c, l, s, N, li, M, q);
4489
- Lr == null ? void 0 : Lr.setWindow({
4474
+ if ((Xr !== true || o !== (ni == null ? void 0 : ni.cellXOffset) || c !== (ni == null ? void 0 : ni.translateX) || di !== (ni == null ? void 0 : ni.mustDrawFocusOnHeader) || pi !== (ni == null ? void 0 : ni.mustDrawHighlightRingsOnHeader)) && mi(), Xr === true) {
4475
+ assert(si !== void 0 && ni !== void 0);
4476
+ let { regions: e2 } = blitLastFrame(ai, si, si === ei ? ni.aBufferScroll : ni.bBufferScroll, si === ei ? ni.bBufferScroll : ni.aBufferScroll, ni, o, s, c, l, M, i, a, N, Qr, Y, u, li, E, Yr);
4477
+ ui = e2;
4478
+ } else Xr !== false && (assert(ni !== void 0), ui = blitResizedCol(ni, o, s, c, l, i, a, Qr, li, Xr));
4479
+ overdrawStickyBoundaries(ai, li, i, a, M, N, D, ci, g);
4480
+ let hi = drawHighlightRings(ai, i, a, o, s, c, l, u, m, x, S, E, M, N, V, g), gi = y ? drawFillHandle(ai, i, a, s, c, l, li, u, g, Qr, A, ci, P, M, q, j, N) : void 0;
4481
+ if (ai.fillStyle = g.bgCell, ui.length > 0) {
4482
+ ai.beginPath();
4483
+ for (let e2 of ui) ai.rect(e2.x, e2.y, e2.width, e2.height);
4484
+ ai.clip(), ai.fill(), ai.beginPath();
4485
+ } else ai.fillRect(0, 0, i, a);
4486
+ let _i = drawCells(ai, li, u, a, Qr, c, l, s, N, ci, P, F, I, C, L, y, M, q, ui, J, A, B, V, Ir, Rr, Lr, G, Fr, W, g, Vr, Hr, Ur, O, qr);
4487
+ drawBlanks(ai, li, u, i, a, Qr, c, l, s, N, ci, I, A.rows, C, M, q, ui, J, g), drawExtraRowThemes(ai, li, s, c, l, i, a, ui, Qr, ci, I, D, M, N, g), drawGridLines(ai, li, s, c, l, i, a, ui, _i, S, Qr, ci, I, D, M, N, g), hi == null ? void 0 : hi(), gi == null ? void 0 : gi(), k && Jr !== "none" && walkColumns(li, 0, c, 0, Qr, (e2, t2) => e2.sourceIndex === H ? (drawColumnResizeOutline(ii, t2 + e2.width, 0, Qr + 1, blend(g.resizeIndicatorColor ?? g.accentLight, g.bgHeader)), Jr === "full" && drawColumnResizeOutline(ai, t2 + e2.width, Qr, a, blend(g.resizeIndicatorColor ?? g.accentLight, g.bgCell)), true) : false), ri !== null && (ri.fillStyle = g.bgCell, ri.fillRect(0, 0, i, a), ri.drawImage(ai.canvas, 0, 0));
4488
+ let vi = getLastRow(li, a, Qr, c, l, s, N, ci, M, q);
4489
+ Ir == null ? void 0 : Ir.setWindow({
4490
4490
  x: o,
4491
4491
  y: s,
4492
- width: ui.length,
4493
- height: yi - s
4492
+ width: li.length,
4493
+ height: vi - s
4494
4494
  }, m, Array.from({
4495
4495
  length: M
4496
4496
  }, (e2, t2) => N - 1 - t2));
4497
- let bi = ri !== void 0 && (o !== ri.cellXOffset || c !== ri.translateX), xi = ri !== void 0 && (s !== ri.cellYOffset || l !== ri.translateY);
4497
+ let yi = ni !== void 0 && (o !== ni.cellXOffset || c !== ni.translateX), bi = ni !== void 0 && (s !== ni.cellYOffset || l !== ni.translateY);
4498
4498
  U.current = {
4499
4499
  cellXOffset: o,
4500
4500
  cellYOffset: s,
4501
4501
  translateX: c,
4502
4502
  translateY: l,
4503
- mustDrawFocusOnHeader: fi,
4503
+ mustDrawFocusOnHeader: di,
4504
4504
  mustDrawHighlightRingsOnHeader: pi,
4505
- lastBuffer: Xr ? si === ti ? "a" : "b" : void 0,
4506
- aBufferScroll: si === ti ? [
4507
- bi,
4508
- xi
4509
- ] : ri == null ? void 0 : ri.aBufferScroll,
4510
- bBufferScroll: si === ni ? [
4511
- bi,
4512
- xi
4513
- ] : ri == null ? void 0 : ri.bBufferScroll
4514
- }, oi.restore(), ai.restore();
4505
+ lastBuffer: Yr ? oi === ei ? "a" : "b" : void 0,
4506
+ aBufferScroll: oi === ei ? [
4507
+ yi,
4508
+ bi
4509
+ ] : ni == null ? void 0 : ni.aBufferScroll,
4510
+ bBufferScroll: oi === ti ? [
4511
+ yi,
4512
+ bi
4513
+ ] : ni == null ? void 0 : ni.bBufferScroll
4514
+ }, ai.restore(), ii.restore();
4515
4515
  }
4516
4516
  var import_clamp$3 = __toESM(require_clamp(), 1), hoverTime = 80;
4517
4517
  function easeOutCubic(e) {
@@ -4609,64 +4609,64 @@ let __tla = (async () => {
4609
4609
  var _a;
4610
4610
  return e.kind === GridCellKind.Custom ? e.copyData : ((_a = t == null ? void 0 : t(e)) == null ? void 0 : _a.getAccessibilityString(e)) ?? "";
4611
4611
  }, data_grid_default = import_react.memo(import_react.forwardRef((e, t) => {
4612
- let { width: n, height: r, accessibilityHeight: i, columns: a, cellXOffset: o, cellYOffset: s, headerHeight: c, fillHandle: l = false, groupHeaderHeight: u, rowHeight: f, rows: m, getCellContent: h, getRowThemeOverride: g, onHeaderMenuClick: y, onHeaderIndicatorClick: x, enableGroups: S, isFilling: C, onCanvasFocused: E, onCanvasBlur: D, isFocused: O, selection: k, freezeColumns: A, onContextMenu: j, freezeTrailingRows: M, fixedShadowX: N = true, fixedShadowY: P = true, drawFocusRing: F, onMouseDown: I, onMouseUp: L, onMouseMoveRaw: Fr, onMouseMove: B, onItemHovered: Ir, dragAndDropState: V, firstColAccessible: H, onKeyDown: Lr, onKeyUp: U, highlightRegions: Rr, canvasRef: W, onDragStart: G, onDragEnd: zr, eventTargetRef: K, isResizing: q, resizeColumn: Br, isDragging: Hr, isDraggable: Ur = false, allowResize: Wr, disabledRows: Gr, hasAppendRow: Kr, getGroupDetails: qr, theme: J, prelightCells: Jr, headerIcons: Yr, verticalBorder: Xr, drawCell: Y, drawHeader: Zr, onCellFocused: X, onDragOverCell: Qr, onDrop: $r, onDragLeave: ei, imageWindowLoader: ti, smoothScrollX: ri = false, smoothScrollY: ci = false, experimental: li, getCellRenderer: ui, resizeIndicator: di = "full" } = e, fi = e.translateX ?? 0, pi = e.translateY ?? 0, mi = Math.max(A, Math.min(a.length - 1, o)), hi = import_react.useRef(null), gi = import_react.useRef((li == null ? void 0 : li.eventTarget) ?? window), _i = gi.current, vi = ti, yi = import_react.useRef(), [bi, Si] = import_react.useState(false), Ci = import_react.useRef([]), wi = import_react.useRef(), [Ti, Ei] = import_react.useState(), [Di, Oi] = import_react.useState(), ki = import_react.useRef(null), [Ai, ji] = import_react.useState(), [Mi, Ni] = import_react.useState(false), Pi = import_react.useRef(Mi);
4613
- Pi.current = Mi;
4614
- let Fi = import_react.useMemo(() => new SpriteManager(Yr, () => {
4615
- Qi.current = void 0, na.current();
4612
+ let { width: n, height: r, accessibilityHeight: i, columns: a, cellXOffset: o, cellYOffset: s, headerHeight: c, fillHandle: l = false, groupHeaderHeight: u, rowHeight: f, rows: m, getCellContent: h, getRowThemeOverride: g, onHeaderMenuClick: y, onHeaderIndicatorClick: x, enableGroups: S, isFilling: C, onCanvasFocused: E, onCanvasBlur: D, isFocused: O, selection: k, freezeColumns: A, onContextMenu: j, freezeTrailingRows: M, fixedShadowX: N = true, fixedShadowY: P = true, drawFocusRing: F, onMouseDown: I, onMouseUp: L, onMouseMoveRaw: Pr, onMouseMove: B, onItemHovered: Fr, dragAndDropState: V, firstColAccessible: H, onKeyDown: Ir, onKeyUp: U, highlightRegions: Lr, canvasRef: W, onDragStart: G, onDragEnd: Rr, eventTargetRef: K, isResizing: q, resizeColumn: Br, isDragging: Vr, isDraggable: Hr = false, allowResize: Ur, disabledRows: Wr, hasAppendRow: Gr, getGroupDetails: Kr, theme: J, prelightCells: qr, headerIcons: Jr, verticalBorder: Yr, drawCell: Y, drawHeader: Xr, onCellFocused: X, onDragOverCell: Zr, onDrop: Qr, onDragLeave: $r, imageWindowLoader: ti, smoothScrollX: oi = false, smoothScrollY: si = false, experimental: ci, getCellRenderer: li, resizeIndicator: ui = "full" } = e, di = e.translateX ?? 0, fi = e.translateY ?? 0, pi = Math.max(A, Math.min(a.length - 1, o)), mi = import_react.useRef(null), hi = import_react.useRef((ci == null ? void 0 : ci.eventTarget) ?? window), gi = hi.current, _i = ti, vi = import_react.useRef(), [bi, xi] = import_react.useState(false), Si = import_react.useRef([]), Ci = import_react.useRef(), [wi, Ti] = import_react.useState(), [Ei, Di] = import_react.useState(), Oi = import_react.useRef(null), [ki, Ai] = import_react.useState(), [ji, Mi] = import_react.useState(false), Ni = import_react.useRef(ji);
4613
+ Ni.current = ji;
4614
+ let Pi = import_react.useMemo(() => new SpriteManager(Jr, () => {
4615
+ Zi.current = void 0, na.current();
4616
4616
  }), [
4617
- Yr
4618
- ]), Ii = S ? u + c : c, Li = import_react.useRef(-1), Ri = ((li == null ? void 0 : li.enableFirefoxRescaling) ?? false) && browserIsFirefox.value, zi = ((li == null ? void 0 : li.enableSafariRescaling) ?? false) && browserIsSafari.value;
4617
+ Jr
4618
+ ]), Fi = S ? u + c : c, Ii = import_react.useRef(-1), Li = ((ci == null ? void 0 : ci.enableFirefoxRescaling) ?? false) && browserIsFirefox.value, Ri = ((ci == null ? void 0 : ci.enableSafariRescaling) ?? false) && browserIsSafari.value;
4619
4619
  import_react.useLayoutEffect(() => {
4620
- window.devicePixelRatio === 1 || !Ri && !zi || (Li.current !== -1 && Si(true), window.clearTimeout(Li.current), Li.current = window.setTimeout(() => {
4621
- Si(false), Li.current = -1;
4620
+ window.devicePixelRatio === 1 || !Li && !Ri || (Ii.current !== -1 && xi(true), window.clearTimeout(Ii.current), Ii.current = window.setTimeout(() => {
4621
+ xi(false), Ii.current = -1;
4622
4622
  }, 200));
4623
4623
  }, [
4624
4624
  s,
4625
- mi,
4626
- fi,
4627
4625
  pi,
4628
- Ri,
4629
- zi
4626
+ di,
4627
+ fi,
4628
+ Li,
4629
+ Ri
4630
4630
  ]);
4631
- let Bi = useMappedColumns(a, A), Vi = N ? getStickyWidth(Bi, V) : 0, Hi = import_react.useCallback((e2, t2, i2) => {
4631
+ let zi = useMappedColumns(a, A), Bi = N ? getStickyWidth(zi, V) : 0, Vi = import_react.useCallback((e2, t2, i2) => {
4632
4632
  let a2 = e2.getBoundingClientRect();
4633
- if (t2 >= Bi.length || i2 >= m) return;
4634
- let o2 = a2.width / n, c2 = computeBounds(t2, i2, n, r, u, Ii, mi, s, fi, pi, m, A, M, Bi, f);
4633
+ if (t2 >= zi.length || i2 >= m) return;
4634
+ let o2 = a2.width / n, c2 = computeBounds(t2, i2, n, r, u, Fi, pi, s, di, fi, m, A, M, zi, f);
4635
4635
  return o2 !== 1 && (c2.x *= o2, c2.y *= o2, c2.width *= o2, c2.height *= o2), c2.x += a2.x, c2.y += a2.y, c2;
4636
4636
  }, [
4637
4637
  n,
4638
4638
  r,
4639
4639
  u,
4640
- Ii,
4641
- mi,
4640
+ Fi,
4641
+ pi,
4642
4642
  s,
4643
+ di,
4643
4644
  fi,
4644
- pi,
4645
4645
  m,
4646
4646
  A,
4647
4647
  M,
4648
- Bi,
4648
+ zi,
4649
4649
  f
4650
- ]), Ui = import_react.useCallback((e2, t2, i2, a2) => {
4651
- let o2 = e2.getBoundingClientRect(), h2 = o2.width / n, g2 = (t2 - o2.left) / h2, y2 = (i2 - o2.top) / h2, x2 = getEffectiveColumns(Bi, mi, n, void 0, fi), C2 = 0, E2 = 0;
4650
+ ]), Hi = import_react.useCallback((e2, t2, i2, a2) => {
4651
+ let o2 = e2.getBoundingClientRect(), h2 = o2.width / n, g2 = (t2 - o2.left) / h2, y2 = (i2 - o2.top) / h2, x2 = getEffectiveColumns(zi, pi, n, void 0, di), C2 = 0, E2 = 0;
4652
4652
  a2 instanceof MouseEvent && (C2 = a2.button, E2 = a2.buttons);
4653
- let D2 = getColumnIndexForX(g2, x2, fi), O2 = getRowIndexForY(y2, r, S, c, u, m, f, s, pi, M), A2 = (a2 == null ? void 0 : a2.shiftKey) === true, j2 = (a2 == null ? void 0 : a2.ctrlKey) === true, N2 = (a2 == null ? void 0 : a2.metaKey) === true, P2 = a2 !== void 0 && !(a2 instanceof MouseEvent) || (a2 == null ? void 0 : a2.pointerType) === "touch", F2 = [
4653
+ let D2 = getColumnIndexForX(g2, x2, di), O2 = getRowIndexForY(y2, r, S, c, u, m, f, s, fi, M), A2 = (a2 == null ? void 0 : a2.shiftKey) === true, j2 = (a2 == null ? void 0 : a2.ctrlKey) === true, N2 = (a2 == null ? void 0 : a2.metaKey) === true, P2 = a2 !== void 0 && !(a2 instanceof MouseEvent) || (a2 == null ? void 0 : a2.pointerType) === "touch", F2 = [
4654
4654
  g2 < 0 ? -1 : n < g2 ? 1 : 0,
4655
- y2 < Ii ? -1 : r < y2 ? 1 : 0
4655
+ y2 < Fi ? -1 : r < y2 ? 1 : 0
4656
4656
  ], I2;
4657
4657
  if (D2 === -1 || y2 < 0 || g2 < 0 || O2 === void 0 || g2 > n || y2 > r) {
4658
4658
  let i3 = g2 > n ? 1 : g2 < 0 ? -1 : 0, a3 = y2 > r ? 1 : y2 < 0 ? -1 : 0, o3 = i3 * 2, s2 = a3 * 2;
4659
4659
  i3 === 0 && (o3 = D2 === -1 ? OutOfBoundsRegionAxis.EndPadding : OutOfBoundsRegionAxis.Center), a3 === 0 && (s2 = O2 === void 0 ? OutOfBoundsRegionAxis.EndPadding : OutOfBoundsRegionAxis.Center);
4660
4660
  let c2 = false;
4661
4661
  if (D2 === -1 && O2 === -1) {
4662
- let n2 = Hi(e2, Bi.length - 1, -1);
4662
+ let n2 = Vi(e2, zi.length - 1, -1);
4663
4663
  assert(n2 !== void 0), c2 = t2 < n2.x + n2.width + 5;
4664
4664
  }
4665
4665
  let l2 = g2 > n && g2 < n + getScrollBarWidth() || y2 > r && y2 < r + getScrollBarWidth();
4666
4666
  I2 = {
4667
4667
  kind: "out-of-bounds",
4668
4668
  location: [
4669
- D2 === -1 ? g2 < 0 ? 0 : Bi.length - 1 : D2,
4669
+ D2 === -1 ? g2 < 0 ? 0 : zi.length - 1 : D2,
4670
4670
  O2 ?? m - 1
4671
4671
  ],
4672
4672
  region: [
@@ -4684,17 +4684,17 @@ let __tla = (async () => {
4684
4684
  isMaybeScrollbar: l2
4685
4685
  };
4686
4686
  } else if (O2 <= -1) {
4687
- let n2 = Hi(e2, D2, O2);
4687
+ let n2 = Vi(e2, D2, O2);
4688
4688
  assert(n2 !== void 0);
4689
4689
  let r2 = n2 !== void 0 && n2.x + n2.width - t2 <= 5, a3 = D2 - 1;
4690
- t2 - n2.x <= 5 && a3 >= 0 ? (r2 = true, n2 = Hi(e2, a3, O2), assert(n2 !== void 0), I2 = {
4690
+ t2 - n2.x <= 5 && a3 >= 0 ? (r2 = true, n2 = Vi(e2, a3, O2), assert(n2 !== void 0), I2 = {
4691
4691
  kind: S && O2 === -2 ? groupHeaderKind : headerKind,
4692
4692
  location: [
4693
4693
  a3,
4694
4694
  O2
4695
4695
  ],
4696
4696
  bounds: n2,
4697
- group: Bi[a3].group ?? "",
4697
+ group: zi[a3].group ?? "",
4698
4698
  isEdge: r2,
4699
4699
  shiftKey: A2,
4700
4700
  ctrlKey: j2,
@@ -4707,7 +4707,7 @@ let __tla = (async () => {
4707
4707
  scrollEdge: F2
4708
4708
  }) : I2 = {
4709
4709
  kind: S && O2 === -2 ? groupHeaderKind : headerKind,
4710
- group: Bi[D2].group ?? "",
4710
+ group: zi[D2].group ?? "",
4711
4711
  location: [
4712
4712
  D2,
4713
4713
  O2
@@ -4725,11 +4725,11 @@ let __tla = (async () => {
4725
4725
  scrollEdge: F2
4726
4726
  };
4727
4727
  } else {
4728
- let n2 = Hi(e2, D2, O2);
4728
+ let n2 = Vi(e2, D2, O2);
4729
4729
  assert(n2 !== void 0);
4730
4730
  let r2 = n2 !== void 0 && n2.x + n2.width - t2 < 5, a3 = false;
4731
4731
  if (l && k.current !== void 0) {
4732
- let n3 = rectBottomRight(k.current.range), r3 = Hi(e2, n3[0], n3[1]);
4732
+ let n3 = rectBottomRight(k.current.range), r3 = Vi(e2, n3[0], n3[1]);
4733
4733
  if (r3 !== void 0) {
4734
4734
  let e3 = r3.x + r3.width - 2, n4 = r3.y + r3.height - 2;
4735
4735
  a3 = Math.abs(e3 - t2) < fillHandleClickSize && Math.abs(n4 - i2) < fillHandleClickSize;
@@ -4758,9 +4758,9 @@ let __tla = (async () => {
4758
4758
  return I2;
4759
4759
  }, [
4760
4760
  n,
4761
- Bi,
4762
- mi,
4763
- fi,
4761
+ zi,
4762
+ pi,
4763
+ di,
4764
4764
  r,
4765
4765
  S,
4766
4766
  c,
@@ -4768,16 +4768,16 @@ let __tla = (async () => {
4768
4768
  m,
4769
4769
  f,
4770
4770
  s,
4771
- pi,
4771
+ fi,
4772
4772
  M,
4773
- Hi,
4773
+ Vi,
4774
4774
  l,
4775
4775
  k,
4776
- Ii
4777
- ]), [Wi] = Ti ?? [], Gi = import_react.useRef(() => {
4778
- }), Ki = import_react.useRef(Ti);
4779
- Ki.current = Ti;
4780
- let [qi, Ji] = import_react.useMemo(() => {
4776
+ Fi
4777
+ ]), [Ui] = wi ?? [], Wi = import_react.useRef(() => {
4778
+ }), Gi = import_react.useRef(wi);
4779
+ Gi.current = wi;
4780
+ let [Ki, qi] = import_react.useMemo(() => {
4781
4781
  let e2 = document.createElement("canvas"), t2 = document.createElement("canvas");
4782
4782
  return e2.style.display = "none", e2.style.opacity = "0", e2.style.position = "fixed", t2.style.display = "none", t2.style.opacity = "0", t2.style.position = "fixed", [
4783
4783
  e2.getContext("2d", {
@@ -4789,102 +4789,102 @@ let __tla = (async () => {
4789
4789
  ];
4790
4790
  }, []);
4791
4791
  import_react.useLayoutEffect(() => {
4792
- if (!(qi === null || Ji === null)) return document.documentElement.append(qi.canvas), document.documentElement.append(Ji.canvas), () => {
4793
- qi.canvas.remove(), Ji.canvas.remove();
4792
+ if (!(Ki === null || qi === null)) return document.documentElement.append(Ki.canvas), document.documentElement.append(qi.canvas), () => {
4793
+ Ki.canvas.remove(), qi.canvas.remove();
4794
4794
  };
4795
4795
  }, [
4796
- qi,
4797
- Ji
4796
+ Ki,
4797
+ qi
4798
4798
  ]);
4799
- let Yi = import_react.useMemo(() => new RenderStateProvider(), []), Xi = Ri && bi ? 1 : zi && bi ? 2 : 5, Zi = (li == null ? void 0 : li.disableMinimumCellWidth) === true ? 1 : 10, Qi = import_react.useRef(), $i = import_react.useRef(null), ea = import_react.useRef(null), ta = import_react.useCallback(() => {
4799
+ let Ji = import_react.useMemo(() => new RenderStateProvider(), []), Yi = Li && bi ? 1 : Ri && bi ? 2 : 5, Xi = (ci == null ? void 0 : ci.disableMinimumCellWidth) === true ? 1 : 10, Zi = import_react.useRef(), Qi = import_react.useRef(null), $i = import_react.useRef(null), ea = import_react.useCallback(() => {
4800
4800
  var _a2;
4801
- let e2 = hi.current, t2 = ki.current;
4802
- if (e2 === null || t2 === null || ($i.current === null && ($i.current = e2.getContext("2d", {
4801
+ let e2 = mi.current, t2 = Oi.current;
4802
+ if (e2 === null || t2 === null || (Qi.current === null && (Qi.current = e2.getContext("2d", {
4803
4803
  alpha: false
4804
- }), e2.width = 0, e2.height = 0), ea.current === null && (ea.current = t2.getContext("2d", {
4804
+ }), e2.width = 0, e2.height = 0), $i.current === null && ($i.current = t2.getContext("2d", {
4805
4805
  alpha: false
4806
- }), t2.width = 0, t2.height = 0), $i.current === null || ea.current === null || qi === null || Ji === null)) return;
4806
+ }), t2.width = 0, t2.height = 0), Qi.current === null || $i.current === null || Ki === null || qi === null)) return;
4807
4807
  let i2 = false, a2 = (e3) => {
4808
- i2 = true, ji(e3);
4809
- }, o2 = Qi.current, y2 = {
4810
- headerCanvasCtx: ea.current,
4811
- canvasCtx: $i.current,
4812
- bufferACtx: qi,
4813
- bufferBCtx: Ji,
4808
+ i2 = true, Ai(e3);
4809
+ }, o2 = Zi.current, y2 = {
4810
+ headerCanvasCtx: $i.current,
4811
+ canvasCtx: Qi.current,
4812
+ bufferACtx: Ki,
4813
+ bufferBCtx: qi,
4814
4814
  width: n,
4815
4815
  height: r,
4816
- cellXOffset: mi,
4816
+ cellXOffset: pi,
4817
4817
  cellYOffset: s,
4818
- translateX: Math.round(fi),
4819
- translateY: Math.round(pi),
4820
- mappedColumns: Bi,
4818
+ translateX: Math.round(di),
4819
+ translateY: Math.round(fi),
4820
+ mappedColumns: zi,
4821
4821
  enableGroups: S,
4822
4822
  freezeColumns: A,
4823
4823
  dragAndDropState: V,
4824
4824
  theme: J,
4825
4825
  headerHeight: c,
4826
4826
  groupHeaderHeight: u,
4827
- disabledRows: Gr ?? CompactSelection.empty(),
4827
+ disabledRows: Wr ?? CompactSelection.empty(),
4828
4828
  rowHeight: f,
4829
- verticalBorder: Xr,
4829
+ verticalBorder: Yr,
4830
4830
  isResizing: q,
4831
4831
  resizeCol: Br,
4832
4832
  isFocused: O,
4833
4833
  selection: k,
4834
4834
  fillHandle: l,
4835
4835
  drawCellCallback: Y,
4836
- hasAppendRow: Kr,
4836
+ hasAppendRow: Gr,
4837
4837
  overrideCursor: a2,
4838
- maxScaleFactor: Xi,
4838
+ maxScaleFactor: Yi,
4839
4839
  freezeTrailingRows: M,
4840
4840
  rows: m,
4841
4841
  drawFocus: F,
4842
4842
  getCellContent: h,
4843
- getGroupDetails: qr ?? ((e3) => ({
4843
+ getGroupDetails: Kr ?? ((e3) => ({
4844
4844
  name: e3
4845
4845
  })),
4846
4846
  getRowThemeOverride: g,
4847
- drawHeaderCallback: Zr,
4848
- prelightCells: Jr,
4849
- highlightRegions: Rr,
4850
- imageLoader: vi,
4851
- lastBlitData: wi,
4852
- damage: yi.current,
4853
- hoverValues: Ci.current,
4854
- hoverInfo: Ki.current,
4855
- spriteManager: Fi,
4847
+ drawHeaderCallback: Xr,
4848
+ prelightCells: qr,
4849
+ highlightRegions: Lr,
4850
+ imageLoader: _i,
4851
+ lastBlitData: Ci,
4852
+ damage: vi.current,
4853
+ hoverValues: Si.current,
4854
+ hoverInfo: Gi.current,
4855
+ spriteManager: Pi,
4856
4856
  scrolling: bi,
4857
- hyperWrapping: (li == null ? void 0 : li.hyperWrapping) ?? false,
4858
- touchMode: Mi,
4859
- enqueue: Gi.current,
4860
- renderStateProvider: Yi,
4861
- renderStrategy: (li == null ? void 0 : li.renderStrategy) ?? (browserIsSafari.value ? "double-buffer" : "single-buffer"),
4862
- getCellRenderer: ui,
4863
- minimumCellWidth: Zi,
4864
- resizeIndicator: di
4857
+ hyperWrapping: (ci == null ? void 0 : ci.hyperWrapping) ?? false,
4858
+ touchMode: ji,
4859
+ enqueue: Wi.current,
4860
+ renderStateProvider: Ji,
4861
+ renderStrategy: (ci == null ? void 0 : ci.renderStrategy) ?? (browserIsSafari.value ? "double-buffer" : "single-buffer"),
4862
+ getCellRenderer: li,
4863
+ minimumCellWidth: Xi,
4864
+ resizeIndicator: ui
4865
4865
  };
4866
- y2.damage === void 0 ? (Qi.current = y2, drawGrid(y2, o2)) : drawGrid(y2, void 0), !i2 && (y2.damage === void 0 || y2.damage.has((_a2 = Ki == null ? void 0 : Ki.current) == null ? void 0 : _a2[0])) && ji(void 0);
4866
+ y2.damage === void 0 ? (Zi.current = y2, drawGrid(y2, o2)) : drawGrid(y2, void 0), !i2 && (y2.damage === void 0 || y2.damage.has((_a2 = Gi == null ? void 0 : Gi.current) == null ? void 0 : _a2[0])) && Ai(void 0);
4867
4867
  }, [
4868
+ Ki,
4868
4869
  qi,
4869
- Ji,
4870
4870
  n,
4871
4871
  r,
4872
- mi,
4872
+ pi,
4873
4873
  s,
4874
+ di,
4874
4875
  fi,
4875
- pi,
4876
- Bi,
4876
+ zi,
4877
4877
  S,
4878
4878
  A,
4879
4879
  V,
4880
4880
  J,
4881
4881
  c,
4882
4882
  u,
4883
- Gr,
4883
+ Wr,
4884
4884
  f,
4885
- Xr,
4885
+ Yr,
4886
4886
  q,
4887
- Kr,
4887
+ Gr,
4888
4888
  Br,
4889
4889
  O,
4890
4890
  k,
@@ -4892,74 +4892,74 @@ let __tla = (async () => {
4892
4892
  M,
4893
4893
  m,
4894
4894
  F,
4895
- Xi,
4895
+ Yi,
4896
4896
  h,
4897
- qr,
4897
+ Kr,
4898
4898
  g,
4899
4899
  Y,
4900
- Zr,
4901
- Jr,
4902
- Rr,
4903
- vi,
4904
- Fi,
4900
+ Xr,
4901
+ qr,
4902
+ Lr,
4903
+ _i,
4904
+ Pi,
4905
4905
  bi,
4906
- li == null ? void 0 : li.hyperWrapping,
4907
- li == null ? void 0 : li.renderStrategy,
4908
- Mi,
4909
- Yi,
4910
- ui,
4911
- Zi,
4912
- di
4913
- ]), na = import_react.useRef(ta);
4906
+ ci == null ? void 0 : ci.hyperWrapping,
4907
+ ci == null ? void 0 : ci.renderStrategy,
4908
+ ji,
4909
+ Ji,
4910
+ li,
4911
+ Xi,
4912
+ ui
4913
+ ]), na = import_react.useRef(ea);
4914
4914
  import_react.useLayoutEffect(() => {
4915
- ta(), na.current = ta;
4915
+ ea(), na.current = ea;
4916
4916
  }, [
4917
- ta
4917
+ ea
4918
4918
  ]), import_react.useLayoutEffect(() => {
4919
4919
  (async () => {
4920
4920
  var _a2;
4921
- ((_a2 = document == null ? void 0 : document.fonts) == null ? void 0 : _a2.ready) !== void 0 && (await document.fonts.ready, Qi.current = void 0, na.current());
4921
+ ((_a2 = document == null ? void 0 : document.fonts) == null ? void 0 : _a2.ready) !== void 0 && (await document.fonts.ready, Zi.current = void 0, na.current());
4922
4922
  })();
4923
4923
  }, []);
4924
4924
  let ia = import_react.useCallback((e2) => {
4925
- yi.current = e2, na.current(), yi.current = void 0;
4925
+ vi.current = e2, na.current(), vi.current = void 0;
4926
4926
  }, []);
4927
- Gi.current = useAnimationQueue(ia);
4928
- let oa = import_react.useCallback((e2) => {
4927
+ Wi.current = useAnimationQueue(ia);
4928
+ let aa = import_react.useCallback((e2) => {
4929
4929
  ia(new CellSet(e2.map((e3) => e3.cell)));
4930
4930
  }, [
4931
4931
  ia
4932
4932
  ]);
4933
- vi.setCallback(ia);
4934
- let [sa, ca] = import_react.useState(false), [la, ua] = Wi ?? [], da = la !== void 0 && ua === -1, fa = la !== void 0 && ua === -2, pa = false, ma = false, ha = Ai;
4935
- if (ha === void 0 && la !== void 0 && ua !== void 0 && ua > -1 && ua < m) {
4933
+ _i.setCallback(ia);
4934
+ let [oa, sa] = import_react.useState(false), [ca, la] = Ui ?? [], ua = ca !== void 0 && la === -1, da = ca !== void 0 && la === -2, fa = false, pa = false, ma = ki;
4935
+ if (ma === void 0 && ca !== void 0 && la !== void 0 && la > -1 && la < m) {
4936
4936
  let e2 = h([
4937
- la,
4938
- ua
4937
+ ca,
4938
+ la
4939
4939
  ], true);
4940
- pa = e2.kind === InnerGridCellKind.NewRow || e2.kind === InnerGridCellKind.Marker && e2.markerKind !== "number", ma = e2.kind === GridCellKind.Boolean && booleanCellIsEditable(e2), ha = e2.cursor;
4940
+ fa = e2.kind === InnerGridCellKind.NewRow || e2.kind === InnerGridCellKind.Marker && e2.markerKind !== "number", pa = e2.kind === GridCellKind.Boolean && booleanCellIsEditable(e2), ma = e2.cursor;
4941
4941
  }
4942
- let ga = Hr ? "grabbing" : (Di ?? false) || q ? "col-resize" : sa || C ? "crosshair" : ha === void 0 ? da || pa || ma || fa ? "pointer" : "default" : ha, _a = import_react.useMemo(() => ({
4942
+ let ha = Vr ? "grabbing" : (Ei ?? false) || q ? "col-resize" : oa || C ? "crosshair" : ma === void 0 ? ua || fa || pa || da ? "pointer" : "default" : ma, ga = import_react.useMemo(() => ({
4943
4943
  contain: "strict",
4944
4944
  display: "block",
4945
- cursor: ga
4945
+ cursor: ha
4946
4946
  }), [
4947
- ga
4948
- ]), va = import_react.useRef("default"), ya = K == null ? void 0 : K.current;
4949
- ya != null && va.current !== _a.cursor && (ya.style.cursor = va.current = _a.cursor);
4950
- let ba = import_react.useCallback((e2, t2, n2, r2) => {
4951
- if (qr === void 0) return;
4952
- let i2 = qr(e2);
4947
+ ha
4948
+ ]), _a = import_react.useRef("default"), va = K == null ? void 0 : K.current;
4949
+ va != null && _a.current !== ga.cursor && (va.style.cursor = _a.current = ga.cursor);
4950
+ let ya = import_react.useCallback((e2, t2, n2, r2) => {
4951
+ if (Kr === void 0) return;
4952
+ let i2 = Kr(e2);
4953
4953
  if (i2.actions !== void 0) {
4954
4954
  let e3 = getActionBoundsForGroup(t2, i2.actions);
4955
4955
  for (let [a2, o2] of e3.entries()) if (pointInRect(o2, n2 + t2.x, r2 + o2.y)) return i2.actions[a2];
4956
4956
  }
4957
4957
  }, [
4958
- qr
4959
- ]), xa = import_react.useCallback((e2, t2, n2, r2) => {
4960
- let i2 = Bi[t2];
4961
- if (!Hr && !q && !(Di ?? false)) {
4962
- let a2 = Hi(e2, t2, -1);
4958
+ Kr
4959
+ ]), ba = import_react.useCallback((e2, t2, n2, r2) => {
4960
+ let i2 = zi[t2];
4961
+ if (!Vr && !q && !(Ei ?? false)) {
4962
+ let a2 = Vi(e2, t2, -1);
4963
4963
  assert(a2 !== void 0);
4964
4964
  let o2 = computeHeaderLayout(void 0, i2, a2.x, a2.y, a2.width, a2.height, J, direction(i2.title) === "rtl");
4965
4965
  if (i2.hasMenu === true && o2.menuBounds !== void 0 && pointInRect(o2.menuBounds, n2, r2)) return {
@@ -4972,56 +4972,56 @@ let __tla = (async () => {
4972
4972
  };
4973
4973
  }
4974
4974
  }, [
4975
- Bi,
4976
- Hi,
4977
- Di,
4978
- Hr,
4975
+ zi,
4976
+ Vi,
4977
+ Ei,
4978
+ Vr,
4979
4979
  q,
4980
4980
  J
4981
- ]), Sa = import_react.useRef(0), Ca = import_react.useRef(), wa = import_react.useRef(false), Ta = import_react.useCallback((e2) => {
4982
- let t2 = hi.current, n2 = K == null ? void 0 : K.current;
4981
+ ]), xa = import_react.useRef(0), Sa = import_react.useRef(), Ca = import_react.useRef(false), wa = import_react.useCallback((e2) => {
4982
+ let t2 = mi.current, n2 = K == null ? void 0 : K.current;
4983
4983
  if (t2 === null || e2.target !== t2 && e2.target !== n2) return;
4984
- wa.current = true;
4984
+ Ca.current = true;
4985
4985
  let r2, i2;
4986
4986
  if (e2 instanceof MouseEvent ? (r2 = e2.clientX, i2 = e2.clientY) : (r2 = e2.touches[0].clientX, i2 = e2.touches[0].clientY), e2.target === n2 && n2 !== null) {
4987
4987
  let e3 = n2.getBoundingClientRect();
4988
4988
  if (r2 > e3.right || i2 > e3.bottom) return;
4989
4989
  }
4990
- let a2 = Ui(t2, r2, i2, e2);
4991
- Ca.current = a2.location, a2.isTouch && (Sa.current = Date.now()), Pi.current !== a2.isTouch && Ni(a2.isTouch), !(a2.kind === "header" && xa(t2, a2.location[0], r2, i2) !== void 0) && (a2.kind === "group-header" && ba(a2.group, a2.bounds, a2.localEventX, a2.localEventY) !== void 0 || (I == null ? void 0 : I(a2), !a2.isTouch && Ur !== true && Ur !== a2.kind && a2.button < 3 && a2.button !== 1 && e2.preventDefault()));
4990
+ let a2 = Hi(t2, r2, i2, e2);
4991
+ Sa.current = a2.location, a2.isTouch && (xa.current = Date.now()), Ni.current !== a2.isTouch && Mi(a2.isTouch), !(a2.kind === "header" && ba(t2, a2.location[0], r2, i2) !== void 0) && (a2.kind === "group-header" && ya(a2.group, a2.bounds, a2.localEventX, a2.localEventY) !== void 0 || (I == null ? void 0 : I(a2), !a2.isTouch && Hr !== true && Hr !== a2.kind && a2.button < 3 && a2.button !== 1 && e2.preventDefault()));
4992
4992
  }, [
4993
4993
  K,
4994
- Ur,
4995
- Ui,
4994
+ Hr,
4995
+ Hi,
4996
+ ya,
4996
4997
  ba,
4997
- xa,
4998
4998
  I
4999
4999
  ]);
5000
- useEventListener("touchstart", Ta, _i, false), useEventListener("mousedown", Ta, _i, false);
5001
- let Ea = import_react.useRef(0), Da = import_react.useCallback((e2) => {
5000
+ useEventListener("touchstart", wa, gi, false), useEventListener("mousedown", wa, gi, false);
5001
+ let Ta = import_react.useRef(0), Ea = import_react.useCallback((e2) => {
5002
5002
  var _a2, _b;
5003
- let t2 = Ea.current;
5004
- Ea.current = Date.now();
5005
- let n2 = hi.current;
5006
- if (wa.current = false, L === void 0 || n2 === null) return;
5003
+ let t2 = Ta.current;
5004
+ Ta.current = Date.now();
5005
+ let n2 = mi.current;
5006
+ if (Ca.current = false, L === void 0 || n2 === null) return;
5007
5007
  let r2 = K == null ? void 0 : K.current, i2 = e2.target !== n2 && e2.target !== r2, a2, o2, s2 = true;
5008
5008
  if (e2 instanceof MouseEvent) {
5009
5009
  if (a2 = e2.clientX, o2 = e2.clientY, s2 = e2.button < 3, e2.pointerType === "touch") return;
5010
5010
  } else a2 = e2.changedTouches[0].clientX, o2 = e2.changedTouches[0].clientY;
5011
- let c2 = Ui(n2, a2, o2, e2);
5012
- c2.isTouch && Sa.current !== 0 && Date.now() - Sa.current > 500 && (c2 = {
5011
+ let c2 = Hi(n2, a2, o2, e2);
5012
+ c2.isTouch && xa.current !== 0 && Date.now() - xa.current > 500 && (c2 = {
5013
5013
  ...c2,
5014
5014
  isLongTouch: true
5015
5015
  }), t2 !== 0 && Date.now() - t2 < (c2.isTouch ? 1e3 : 500) && (c2 = {
5016
5016
  ...c2,
5017
5017
  isDoubleClick: true
5018
- }), Pi.current !== c2.isTouch && Ni(c2.isTouch), !i2 && e2.cancelable && s2 && e2.preventDefault();
5019
- let [l2] = c2.location, u2 = xa(n2, l2, a2, o2);
5018
+ }), Ni.current !== c2.isTouch && Mi(c2.isTouch), !i2 && e2.cancelable && s2 && e2.preventDefault();
5019
+ let [l2] = c2.location, u2 = ba(n2, l2, a2, o2);
5020
5020
  if (c2.kind === "header" && u2 !== void 0) {
5021
- (c2.button !== 0 || ((_a2 = Ca.current) == null ? void 0 : _a2[0]) !== l2 || ((_b = Ca.current) == null ? void 0 : _b[1]) !== -1) && L(c2, true);
5021
+ (c2.button !== 0 || ((_a2 = Sa.current) == null ? void 0 : _a2[0]) !== l2 || ((_b = Sa.current) == null ? void 0 : _b[1]) !== -1) && L(c2, true);
5022
5022
  return;
5023
5023
  } else if (c2.kind === "group-header") {
5024
- let e3 = ba(c2.group, c2.bounds, c2.localEventX, c2.localEventY);
5024
+ let e3 = ya(c2.group, c2.bounds, c2.localEventX, c2.localEventY);
5025
5025
  if (e3 !== void 0) {
5026
5026
  c2.button === 0 && e3.onClick(c2);
5027
5027
  return;
@@ -5031,83 +5031,83 @@ let __tla = (async () => {
5031
5031
  }, [
5032
5032
  L,
5033
5033
  K,
5034
- Ui,
5035
- xa,
5036
- ba
5034
+ Hi,
5035
+ ba,
5036
+ ya
5037
5037
  ]);
5038
- useEventListener("mouseup", Da, _i, false), useEventListener("touchend", Da, _i, false), useEventListener("click", import_react.useCallback((e2) => {
5038
+ useEventListener("mouseup", Ea, gi, false), useEventListener("touchend", Ea, gi, false), useEventListener("click", import_react.useCallback((e2) => {
5039
5039
  var _a2, _b;
5040
- let t2 = hi.current;
5040
+ let t2 = mi.current;
5041
5041
  if (t2 === null) return;
5042
5042
  let n2 = K == null ? void 0 : K.current, r2 = e2.target !== t2 && e2.target !== n2, i2, a2, o2 = true;
5043
5043
  e2 instanceof MouseEvent ? (i2 = e2.clientX, a2 = e2.clientY, o2 = e2.button < 3) : (i2 = e2.changedTouches[0].clientX, a2 = e2.changedTouches[0].clientY);
5044
- let s2 = Ui(t2, i2, a2, e2);
5045
- Pi.current !== s2.isTouch && Ni(s2.isTouch), !r2 && e2.cancelable && o2 && e2.preventDefault();
5044
+ let s2 = Hi(t2, i2, a2, e2);
5045
+ Ni.current !== s2.isTouch && Mi(s2.isTouch), !r2 && e2.cancelable && o2 && e2.preventDefault();
5046
5046
  let [c2] = s2.location;
5047
5047
  if (s2.kind === "header") {
5048
- let e3 = xa(t2, c2, i2, a2);
5049
- e3 !== void 0 && s2.button === 0 && ((_a2 = Ca.current) == null ? void 0 : _a2[0]) === c2 && ((_b = Ca.current) == null ? void 0 : _b[1]) === -1 && (e3.area === "menu" ? y == null ? void 0 : y(c2, e3.bounds) : e3.area === "indicator" && (x == null ? void 0 : x(c2, e3.bounds)));
5048
+ let e3 = ba(t2, c2, i2, a2);
5049
+ e3 !== void 0 && s2.button === 0 && ((_a2 = Sa.current) == null ? void 0 : _a2[0]) === c2 && ((_b = Sa.current) == null ? void 0 : _b[1]) === -1 && (e3.area === "menu" ? y == null ? void 0 : y(c2, e3.bounds) : e3.area === "indicator" && (x == null ? void 0 : x(c2, e3.bounds)));
5050
5050
  } else if (s2.kind === "group-header") {
5051
- let e3 = ba(s2.group, s2.bounds, s2.localEventX, s2.localEventY);
5051
+ let e3 = ya(s2.group, s2.bounds, s2.localEventX, s2.localEventY);
5052
5052
  e3 !== void 0 && s2.button === 0 && e3.onClick(s2);
5053
5053
  }
5054
5054
  }, [
5055
5055
  K,
5056
- Ui,
5057
- xa,
5056
+ Hi,
5057
+ ba,
5058
5058
  y,
5059
5059
  x,
5060
- ba
5061
- ]), _i, false), useEventListener("contextmenu", import_react.useCallback((e2) => {
5062
- let t2 = hi.current, n2 = K == null ? void 0 : K.current;
5063
- t2 === null || e2.target !== t2 && e2.target !== n2 || j === void 0 || j(Ui(t2, e2.clientX, e2.clientY, e2), () => {
5060
+ ya
5061
+ ]), gi, false), useEventListener("contextmenu", import_react.useCallback((e2) => {
5062
+ let t2 = mi.current, n2 = K == null ? void 0 : K.current;
5063
+ t2 === null || e2.target !== t2 && e2.target !== n2 || j === void 0 || j(Hi(t2, e2.clientX, e2.clientY, e2), () => {
5064
5064
  e2.cancelable && e2.preventDefault();
5065
5065
  });
5066
5066
  }, [
5067
5067
  K,
5068
- Ui,
5068
+ Hi,
5069
5069
  j
5070
5070
  ]), (K == null ? void 0 : K.current) ?? null, false);
5071
5071
  let Oa = import_react.useCallback((e2) => {
5072
- yi.current = new CellSet(e2.map((e3) => e3.item)), Ci.current = e2, na.current(), yi.current = void 0;
5073
- }, []), Aa = import_react.useMemo(() => new AnimationManager(Oa), [
5072
+ vi.current = new CellSet(e2.map((e3) => e3.item)), Si.current = e2, na.current(), vi.current = void 0;
5073
+ }, []), ka = import_react.useMemo(() => new AnimationManager(Oa), [
5074
5074
  Oa
5075
- ]), ja = import_react.useRef(Aa);
5076
- ja.current = Aa, import_react.useLayoutEffect(() => {
5077
- let e2 = ja.current;
5078
- if (Wi === void 0 || Wi[1] < 0) {
5079
- e2.setHovered(Wi);
5075
+ ]), Aa = import_react.useRef(ka);
5076
+ Aa.current = ka, import_react.useLayoutEffect(() => {
5077
+ let e2 = Aa.current;
5078
+ if (Ui === void 0 || Ui[1] < 0) {
5079
+ e2.setHovered(Ui);
5080
5080
  return;
5081
5081
  }
5082
- let t2 = h(Wi, true), n2 = ui(t2), r2 = n2 === void 0 && t2.kind === GridCellKind.Custom || (n2 == null ? void 0 : n2.needsHover) !== void 0 && (typeof n2.needsHover == "boolean" ? n2.needsHover : n2.needsHover(t2));
5083
- e2.setHovered(r2 ? Wi : void 0);
5082
+ let t2 = h(Ui, true), n2 = li(t2), r2 = n2 === void 0 && t2.kind === GridCellKind.Custom || (n2 == null ? void 0 : n2.needsHover) !== void 0 && (typeof n2.needsHover == "boolean" ? n2.needsHover : n2.needsHover(t2));
5083
+ e2.setHovered(r2 ? Ui : void 0);
5084
5084
  }, [
5085
5085
  h,
5086
- ui,
5087
- Wi
5086
+ li,
5087
+ Ui
5088
5088
  ]);
5089
- let Ma = import_react.useRef();
5089
+ let ja = import_react.useRef();
5090
5090
  useEventListener("mousemove", import_react.useCallback((e2) => {
5091
5091
  var _a2;
5092
- let t2 = hi.current;
5092
+ let t2 = mi.current;
5093
5093
  if (t2 === null) return;
5094
- let n2 = K == null ? void 0 : K.current, r2 = e2.target !== t2 && e2.target !== n2, i2 = Ui(t2, e2.clientX, e2.clientY, e2);
5095
- if (i2.kind !== "out-of-bounds" && r2 && !wa.current && !i2.isTouch) return;
5094
+ let n2 = K == null ? void 0 : K.current, r2 = e2.target !== t2 && e2.target !== n2, i2 = Hi(t2, e2.clientX, e2.clientY, e2);
5095
+ if (i2.kind !== "out-of-bounds" && r2 && !Ca.current && !i2.isTouch) return;
5096
5096
  let a2 = (e3, t3) => {
5097
- Ei((n3) => n3 === e3 || (n3 == null ? void 0 : n3[0][0]) === (e3 == null ? void 0 : e3[0][0]) && (n3 == null ? void 0 : n3[0][1]) === (e3 == null ? void 0 : e3[0][1]) && ((n3 == null ? void 0 : n3[1][0]) === (e3 == null ? void 0 : e3[1][0]) && (n3 == null ? void 0 : n3[1][1]) === (e3 == null ? void 0 : e3[1][1]) || !t3) ? n3 : e3);
5097
+ Ti((n3) => n3 === e3 || (n3 == null ? void 0 : n3[0][0]) === (e3 == null ? void 0 : e3[0][0]) && (n3 == null ? void 0 : n3[0][1]) === (e3 == null ? void 0 : e3[0][1]) && ((n3 == null ? void 0 : n3[1][0]) === (e3 == null ? void 0 : e3[1][0]) && (n3 == null ? void 0 : n3[1][1]) === (e3 == null ? void 0 : e3[1][1]) || !t3) ? n3 : e3);
5098
5098
  };
5099
- if (!mouseEventArgsAreEqual(i2, Ma.current)) ji(void 0), Ir == null ? void 0 : Ir(i2), a2(i2.kind === "out-of-bounds" ? void 0 : [
5099
+ if (!mouseEventArgsAreEqual(i2, ja.current)) Ai(void 0), Fr == null ? void 0 : Fr(i2), a2(i2.kind === "out-of-bounds" ? void 0 : [
5100
5100
  i2.location,
5101
5101
  [
5102
5102
  i2.localEventX,
5103
5103
  i2.localEventY
5104
5104
  ]
5105
- ], true), Ma.current = i2;
5105
+ ], true), ja.current = i2;
5106
5106
  else if (i2.kind === "cell" || i2.kind === "header" || i2.kind === "group-header") {
5107
5107
  let e3 = false, t3 = true;
5108
5108
  if (i2.kind === "cell") {
5109
5109
  let n4 = h(i2.location);
5110
- t3 = ((_a2 = ui(n4)) == null ? void 0 : _a2.needsHoverPosition) ?? n4.kind === GridCellKind.Custom, e3 = t3;
5110
+ t3 = ((_a2 = li(n4)) == null ? void 0 : _a2.needsHoverPosition) ?? n4.kind === GridCellKind.Custom, e3 = t3;
5111
5111
  } else e3 = true;
5112
5112
  let n3 = [
5113
5113
  i2.location,
@@ -5116,29 +5116,29 @@ let __tla = (async () => {
5116
5116
  i2.localEventY
5117
5117
  ]
5118
5118
  ];
5119
- a2(n3, t3), Ki.current = n3, e3 && ia(new CellSet([
5119
+ a2(n3, t3), Gi.current = n3, e3 && ia(new CellSet([
5120
5120
  i2.location
5121
5121
  ]));
5122
5122
  }
5123
5123
  let o2 = i2.location[0] >= (H ? 0 : 1);
5124
- Oi(i2.kind === "header" && i2.isEdge && o2 && Wr === true), ca(i2.kind === "cell" && i2.isFillHandle), Fr == null ? void 0 : Fr(e2), B(i2);
5124
+ Di(i2.kind === "header" && i2.isEdge && o2 && Ur === true), sa(i2.kind === "cell" && i2.isFillHandle), Pr == null ? void 0 : Pr(e2), B(i2);
5125
5125
  }, [
5126
5126
  K,
5127
- Ui,
5127
+ Hi,
5128
5128
  H,
5129
- Wr,
5130
- Fr,
5129
+ Ur,
5130
+ Pr,
5131
5131
  B,
5132
- Ir,
5132
+ Fr,
5133
5133
  h,
5134
- ui,
5134
+ li,
5135
5135
  ia
5136
- ]), _i, true);
5137
- let Na = import_react.useCallback((e2) => {
5138
- let t2 = hi.current;
5136
+ ]), gi, true);
5137
+ let Ma = import_react.useCallback((e2) => {
5138
+ let t2 = mi.current;
5139
5139
  if (t2 === null) return;
5140
5140
  let n2, r2;
5141
- k.current !== void 0 && (n2 = Hi(t2, k.current.cell[0], k.current.cell[1]), r2 = k.current.cell), Lr == null ? void 0 : Lr({
5141
+ k.current !== void 0 && (n2 = Vi(t2, k.current.cell[0], k.current.cell[1]), r2 = k.current.cell), Ir == null ? void 0 : Ir({
5142
5142
  bounds: n2,
5143
5143
  stopPropagation: () => e2.stopPropagation(),
5144
5144
  preventDefault: () => e2.preventDefault(),
@@ -5153,14 +5153,14 @@ let __tla = (async () => {
5153
5153
  location: r2
5154
5154
  });
5155
5155
  }, [
5156
- Lr,
5156
+ Ir,
5157
5157
  k,
5158
- Hi
5158
+ Vi
5159
5159
  ]), Pa = import_react.useCallback((e2) => {
5160
- let t2 = hi.current;
5160
+ let t2 = mi.current;
5161
5161
  if (t2 === null) return;
5162
5162
  let n2, r2;
5163
- k.current !== void 0 && (n2 = Hi(t2, k.current.cell[0], k.current.cell[1]), r2 = k.current.cell), U == null ? void 0 : U({
5163
+ k.current !== void 0 && (n2 = Vi(t2, k.current.cell[0], k.current.cell[1]), r2 = k.current.cell), U == null ? void 0 : U({
5164
5164
  bounds: n2,
5165
5165
  stopPropagation: () => e2.stopPropagation(),
5166
5166
  preventDefault: () => e2.preventDefault(),
@@ -5177,26 +5177,26 @@ let __tla = (async () => {
5177
5177
  }, [
5178
5178
  U,
5179
5179
  k,
5180
- Hi
5181
- ]), Ia = import_react.useCallback((e2) => {
5182
- if (hi.current = e2, W !== void 0 && (W.current = e2), li == null ? void 0 : li.eventTarget) gi.current = li.eventTarget;
5183
- else if (e2 === null) gi.current = window;
5180
+ Vi
5181
+ ]), Fa = import_react.useCallback((e2) => {
5182
+ if (mi.current = e2, W !== void 0 && (W.current = e2), ci == null ? void 0 : ci.eventTarget) hi.current = ci.eventTarget;
5183
+ else if (e2 === null) hi.current = window;
5184
5184
  else {
5185
5185
  let t2 = e2.getRootNode();
5186
- t2 === document && (gi.current = window), gi.current = t2;
5186
+ t2 === document && (hi.current = window), hi.current = t2;
5187
5187
  }
5188
5188
  }, [
5189
5189
  W,
5190
- li == null ? void 0 : li.eventTarget
5190
+ ci == null ? void 0 : ci.eventTarget
5191
5191
  ]);
5192
5192
  useEventListener("dragstart", import_react.useCallback((e2) => {
5193
- let t2 = hi.current;
5194
- if (t2 === null || Ur === false || q) {
5193
+ let t2 = mi.current;
5194
+ if (t2 === null || Hr === false || q) {
5195
5195
  e2.preventDefault();
5196
5196
  return;
5197
5197
  }
5198
- let n2, r2, i2 = Ui(t2, e2.clientX, e2.clientY);
5199
- if (Ur !== true && i2.kind !== Ur) {
5198
+ let n2, r2, i2 = Hi(t2, e2.clientX, e2.clientY);
5199
+ if (Hr !== true && i2.kind !== Hr) {
5200
5200
  e2.preventDefault();
5201
5201
  return;
5202
5202
  }
@@ -5215,90 +5215,90 @@ let __tla = (async () => {
5215
5215
  else {
5216
5216
  let [n3, r3] = i2.location;
5217
5217
  if (r3 !== void 0) {
5218
- let i3 = document.createElement("canvas"), a3 = Hi(t2, n3, r3);
5218
+ let i3 = document.createElement("canvas"), a3 = Vi(t2, n3, r3);
5219
5219
  assert(a3 !== void 0);
5220
5220
  let o3 = Math.ceil(window.devicePixelRatio ?? 1);
5221
5221
  i3.width = a3.width * o3, i3.height = a3.height * o3;
5222
5222
  let s3 = i3.getContext("2d");
5223
- s3 !== null && (s3.scale(o3, o3), s3.textBaseline = "middle", r3 === -1 ? (s3.font = J.headerFontFull, s3.fillStyle = J.bgHeader, s3.fillRect(0, 0, i3.width, i3.height), drawHeader(s3, 0, 0, a3.width, a3.height, Bi[n3], false, J, false, void 0, void 0, false, 0, Fi, Zr, false)) : (s3.font = J.baseFontFull, s3.fillStyle = J.bgCell, s3.fillRect(0, 0, i3.width, i3.height), drawCell(s3, h([
5223
+ s3 !== null && (s3.scale(o3, o3), s3.textBaseline = "middle", r3 === -1 ? (s3.font = J.headerFontFull, s3.fillStyle = J.bgHeader, s3.fillRect(0, 0, i3.width, i3.height), drawHeader(s3, 0, 0, a3.width, a3.height, zi[n3], false, J, false, void 0, void 0, false, 0, Pi, Xr, false)) : (s3.font = J.baseFontFull, s3.fillStyle = J.bgCell, s3.fillRect(0, 0, i3.width, i3.height), drawCell(s3, h([
5224
5224
  n3,
5225
5225
  r3
5226
- ]), 0, r3, false, false, 0, 0, a3.width, a3.height, false, J, J.bgCell, vi, Fi, 1, void 0, false, 0, void 0, void 0, void 0, Yi, ui, () => void 0))), i3.style.left = "-100%", i3.style.position = "absolute", i3.style.width = `${a3.width}px`, i3.style.height = `${a3.height}px`, document.body.append(i3), e2.dataTransfer.setDragImage(i3, a3.width / 2, a3.height / 2), window.setTimeout(() => {
5226
+ ]), 0, r3, false, false, 0, 0, a3.width, a3.height, false, J, J.bgCell, _i, Pi, 1, void 0, false, 0, void 0, void 0, void 0, Ji, li, () => void 0))), i3.style.left = "-100%", i3.style.position = "absolute", i3.style.width = `${a3.width}px`, i3.style.height = `${a3.height}px`, document.body.append(i3), e2.dataTransfer.setDragImage(i3, a3.width / 2, a3.height / 2), window.setTimeout(() => {
5227
5227
  i3.remove();
5228
5228
  }, 0);
5229
5229
  }
5230
5230
  }
5231
5231
  else e2.preventDefault();
5232
5232
  }, [
5233
- Ur,
5233
+ Hr,
5234
5234
  q,
5235
- Ui,
5236
- G,
5237
5235
  Hi,
5236
+ G,
5237
+ Vi,
5238
5238
  J,
5239
- Bi,
5240
- Fi,
5241
- Zr,
5239
+ zi,
5240
+ Pi,
5241
+ Xr,
5242
5242
  h,
5243
- vi,
5244
- Yi,
5245
- ui
5243
+ _i,
5244
+ Ji,
5245
+ li
5246
5246
  ]), (K == null ? void 0 : K.current) ?? null, false, false);
5247
- let La = import_react.useRef();
5247
+ let Ia = import_react.useRef();
5248
5248
  useEventListener("dragover", import_react.useCallback((e2) => {
5249
- let t2 = hi.current;
5250
- if ($r !== void 0 && e2.preventDefault(), t2 === null || Qr === void 0) return;
5251
- let [n2, r2] = Ui(t2, e2.clientX, e2.clientY).location, i2 = n2 - (H ? 0 : 1), [a2, o2] = La.current ?? [];
5252
- (a2 !== i2 || o2 !== r2) && (La.current = [
5249
+ let t2 = mi.current;
5250
+ if (Qr !== void 0 && e2.preventDefault(), t2 === null || Zr === void 0) return;
5251
+ let [n2, r2] = Hi(t2, e2.clientX, e2.clientY).location, i2 = n2 - (H ? 0 : 1), [a2, o2] = Ia.current ?? [];
5252
+ (a2 !== i2 || o2 !== r2) && (Ia.current = [
5253
5253
  i2,
5254
5254
  r2
5255
- ], Qr([
5255
+ ], Zr([
5256
5256
  i2,
5257
5257
  r2
5258
5258
  ], e2.dataTransfer));
5259
5259
  }, [
5260
5260
  H,
5261
- Ui,
5262
- Qr,
5263
- $r
5261
+ Hi,
5262
+ Zr,
5263
+ Qr
5264
5264
  ]), (K == null ? void 0 : K.current) ?? null, false, false), useEventListener("dragend", import_react.useCallback(() => {
5265
- La.current = void 0, zr == null ? void 0 : zr();
5265
+ Ia.current = void 0, Rr == null ? void 0 : Rr();
5266
5266
  }, [
5267
- zr
5267
+ Rr
5268
5268
  ]), (K == null ? void 0 : K.current) ?? null, false, false), useEventListener("drop", import_react.useCallback((e2) => {
5269
- let t2 = hi.current;
5270
- if (t2 === null || $r === void 0) return;
5269
+ let t2 = mi.current;
5270
+ if (t2 === null || Qr === void 0) return;
5271
5271
  e2.preventDefault();
5272
- let [n2, r2] = Ui(t2, e2.clientX, e2.clientY).location;
5273
- $r([
5272
+ let [n2, r2] = Hi(t2, e2.clientX, e2.clientY).location;
5273
+ Qr([
5274
5274
  n2 - (H ? 0 : 1),
5275
5275
  r2
5276
5276
  ], e2.dataTransfer);
5277
5277
  }, [
5278
5278
  H,
5279
- Ui,
5280
- $r
5279
+ Hi,
5280
+ Qr
5281
5281
  ]), (K == null ? void 0 : K.current) ?? null, false, false), useEventListener("dragleave", import_react.useCallback(() => {
5282
- ei == null ? void 0 : ei();
5282
+ $r == null ? void 0 : $r();
5283
5283
  }, [
5284
- ei
5284
+ $r
5285
5285
  ]), (K == null ? void 0 : K.current) ?? null, false, false);
5286
5286
  let Ra = import_react.useRef(k);
5287
5287
  Ra.current = k;
5288
- let Ba = import_react.useRef(null), Ua = import_react.useCallback((e2) => {
5288
+ let Va = import_react.useRef(null), Ha = import_react.useCallback((e2) => {
5289
5289
  var _a2;
5290
- hi.current === null || !hi.current.contains(document.activeElement) || (e2 === null && Ra.current.current !== void 0 ? (_a2 = W == null ? void 0 : W.current) == null ? void 0 : _a2.focus({
5290
+ mi.current === null || !mi.current.contains(document.activeElement) || (e2 === null && Ra.current.current !== void 0 ? (_a2 = W == null ? void 0 : W.current) == null ? void 0 : _a2.focus({
5291
5291
  preventScroll: true
5292
5292
  }) : e2 !== null && e2.focus({
5293
5293
  preventScroll: true
5294
- }), Ba.current = e2);
5294
+ }), Va.current = e2);
5295
5295
  }, [
5296
5296
  W
5297
5297
  ]);
5298
5298
  import_react.useImperativeHandle(t, () => ({
5299
5299
  focus: () => {
5300
5300
  var _a2;
5301
- let e2 = Ba.current;
5301
+ let e2 = Va.current;
5302
5302
  e2 === null || !document.contains(e2) ? (_a2 = W == null ? void 0 : W.current) == null ? void 0 : _a2.focus({
5303
5303
  preventScroll: true
5304
5304
  }) : e2.focus({
@@ -5306,26 +5306,26 @@ let __tla = (async () => {
5306
5306
  });
5307
5307
  },
5308
5308
  getBounds: (e2, t2) => {
5309
- if (!(W === void 0 || W.current === null)) return Hi(W.current, e2 ?? 0, t2 ?? -1);
5309
+ if (!(W === void 0 || W.current === null)) return Vi(W.current, e2 ?? 0, t2 ?? -1);
5310
5310
  },
5311
- damage: oa
5311
+ damage: aa
5312
5312
  }), [
5313
5313
  W,
5314
- oa,
5315
- Hi
5314
+ aa,
5315
+ Vi
5316
5316
  ]);
5317
- let Wa = import_react.useRef(), Ga = useDebouncedMemo(() => {
5317
+ let Ua = import_react.useRef(), Wa = useDebouncedMemo(() => {
5318
5318
  var _a2, _b, _c;
5319
- if (n < 50 || (li == null ? void 0 : li.disableAccessibilityTree) === true) return null;
5320
- let e2 = getEffectiveColumns(Bi, mi, n, V, fi), t2 = H ? 0 : -1;
5319
+ if (n < 50 || (ci == null ? void 0 : ci.disableAccessibilityTree) === true) return null;
5320
+ let e2 = getEffectiveColumns(zi, pi, n, V, di), t2 = H ? 0 : -1;
5321
5321
  !H && ((_a2 = e2[0]) == null ? void 0 : _a2.sourceIndex) === 0 && (e2 = e2.slice(1));
5322
5322
  let [r2, a2] = ((_b = k.current) == null ? void 0 : _b.cell) ?? [], o2 = (_c = k.current) == null ? void 0 : _c.range, c2 = e2.map((e3) => e3.sourceIndex), l2 = (0, import_range$1.default)(s, Math.min(m, s + i));
5323
- return r2 !== void 0 && a2 !== void 0 && !(c2.includes(r2) && l2.includes(a2)) && Ua(null), import_react.createElement("table", {
5323
+ return r2 !== void 0 && a2 !== void 0 && !(c2.includes(r2) && l2.includes(a2)) && Ha(null), import_react.createElement("table", {
5324
5324
  key: "access-tree",
5325
5325
  role: "grid",
5326
5326
  "aria-rowcount": m + 1,
5327
5327
  "aria-multiselectable": "true",
5328
- "aria-colcount": Bi.length + t2
5328
+ "aria-colcount": zi.length + t2
5329
5329
  }, import_react.createElement("thead", {
5330
5330
  role: "rowgroup"
5331
5331
  }, import_react.createElement("tr", {
@@ -5337,7 +5337,7 @@ let __tla = (async () => {
5337
5337
  "aria-colindex": e3.sourceIndex + 1 + t2,
5338
5338
  tabIndex: -1,
5339
5339
  onFocus: (t3) => {
5340
- if (t3.target !== Ba.current) return X == null ? void 0 : X([
5340
+ if (t3.target !== Va.current) return X == null ? void 0 : X([
5341
5341
  e3.sourceIndex,
5342
5342
  -1
5343
5343
  ]);
@@ -5365,8 +5365,8 @@ let __tla = (async () => {
5365
5365
  "data-testid": u2,
5366
5366
  onClick: () => {
5367
5367
  let e4 = W == null ? void 0 : W.current;
5368
- if (e4 != null) return Lr == null ? void 0 : Lr({
5369
- bounds: Hi(e4, i2, n2),
5368
+ if (e4 != null) return Ir == null ? void 0 : Ir({
5369
+ bounds: Vi(e4, i2, n2),
5370
5370
  cancel: () => void 0,
5371
5371
  preventDefault: () => void 0,
5372
5372
  stopPropagation: () => void 0,
@@ -5382,68 +5382,68 @@ let __tla = (async () => {
5382
5382
  },
5383
5383
  onFocusCapture: (e4) => {
5384
5384
  var _a3, _b2;
5385
- if (!(e4.target === Ba.current || ((_a3 = Wa.current) == null ? void 0 : _a3[0]) === i2 && ((_b2 = Wa.current) == null ? void 0 : _b2[1]) === n2)) return Wa.current = f2, X == null ? void 0 : X(f2);
5385
+ if (!(e4.target === Va.current || ((_a3 = Ua.current) == null ? void 0 : _a3[0]) === i2 && ((_b2 = Ua.current) == null ? void 0 : _b2[1]) === n2)) return Ua.current = f2, X == null ? void 0 : X(f2);
5386
5386
  },
5387
- ref: c3 ? Ua : void 0,
5387
+ ref: c3 ? Ha : void 0,
5388
5388
  tabIndex: -1
5389
- }, getRowData(m2, ui));
5389
+ }, getRowData(m2, li));
5390
5390
  })))));
5391
5391
  }, [
5392
5392
  n,
5393
- Bi,
5394
- mi,
5393
+ zi,
5394
+ pi,
5395
5395
  V,
5396
- fi,
5396
+ di,
5397
5397
  m,
5398
5398
  s,
5399
5399
  i,
5400
5400
  k,
5401
- Ua,
5401
+ Ha,
5402
5402
  h,
5403
5403
  W,
5404
- Lr,
5405
- Hi,
5404
+ Ir,
5405
+ Vi,
5406
5406
  X
5407
- ], 200), Ka = A === 0 || !N ? 0 : mi > A ? 1 : (0, import_clamp$2.default)(-fi / 100, 0, 1), qa = -s * 32 + pi, Ja = P ? (0, import_clamp$2.default)(-qa / 100, 0, 1) : 0, Ya = import_react.useMemo(() => {
5408
- if (!Ka && !Ja) return null;
5407
+ ], 200), Ga = A === 0 || !N ? 0 : pi > A ? 1 : (0, import_clamp$2.default)(-di / 100, 0, 1), Ka = -s * 32 + fi, qa = P ? (0, import_clamp$2.default)(-Ka / 100, 0, 1) : 0, Ja = import_react.useMemo(() => {
5408
+ if (!Ga && !qa) return null;
5409
5409
  let e2 = {
5410
5410
  position: "absolute",
5411
5411
  top: 0,
5412
- left: Vi,
5413
- width: n - Vi,
5412
+ left: Bi,
5413
+ width: n - Bi,
5414
5414
  height: r,
5415
- opacity: Ka,
5415
+ opacity: Ga,
5416
5416
  pointerEvents: "none",
5417
- transition: ri ? void 0 : "opacity 0.2s",
5417
+ transition: oi ? void 0 : "opacity 0.2s",
5418
5418
  boxShadow: "inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"
5419
5419
  }, t2 = {
5420
5420
  position: "absolute",
5421
- top: Ii,
5421
+ top: Fi,
5422
5422
  left: 0,
5423
5423
  width: n,
5424
5424
  height: r,
5425
- opacity: Ja,
5425
+ opacity: qa,
5426
5426
  pointerEvents: "none",
5427
- transition: ci ? void 0 : "opacity 0.2s",
5427
+ transition: si ? void 0 : "opacity 0.2s",
5428
5428
  boxShadow: "inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"
5429
5429
  };
5430
- return import_react.createElement(import_react.Fragment, null, Ka > 0 && import_react.createElement("div", {
5430
+ return import_react.createElement(import_react.Fragment, null, Ga > 0 && import_react.createElement("div", {
5431
5431
  id: "shadow-x",
5432
5432
  style: e2
5433
- }), Ja > 0 && import_react.createElement("div", {
5433
+ }), qa > 0 && import_react.createElement("div", {
5434
5434
  id: "shadow-y",
5435
5435
  style: t2
5436
5436
  }));
5437
5437
  }, [
5438
- Ka,
5439
- Ja,
5440
- Vi,
5438
+ Ga,
5439
+ qa,
5440
+ Bi,
5441
5441
  n,
5442
- ri,
5443
- Ii,
5442
+ oi,
5443
+ Fi,
5444
5444
  r,
5445
- ci
5446
- ]), Xa = import_react.useMemo(() => ({
5445
+ si
5446
+ ]), Ya = import_react.useMemo(() => ({
5447
5447
  position: "absolute",
5448
5448
  top: 0,
5449
5449
  left: 0
@@ -5451,34 +5451,34 @@ let __tla = (async () => {
5451
5451
  return import_react.createElement(import_react.Fragment, null, import_react.createElement("canvas", {
5452
5452
  "data-testid": "data-grid-canvas",
5453
5453
  tabIndex: 0,
5454
- onKeyDown: Na,
5454
+ onKeyDown: Ma,
5455
5455
  onKeyUp: Pa,
5456
5456
  onFocus: E,
5457
5457
  onBlur: D,
5458
- ref: Ia,
5459
- style: _a
5460
- }, Ga), import_react.createElement("canvas", {
5461
- ref: ki,
5462
- style: Xa
5463
- }), Ya);
5458
+ ref: Fa,
5459
+ style: ga
5460
+ }, Wa), import_react.createElement("canvas", {
5461
+ ref: Oi,
5462
+ style: Ya
5463
+ }), Ja);
5464
5464
  })), import_clamp$1 = __toESM(require_clamp(), 1);
5465
5465
  function offsetColumnSize(e, t, n, r) {
5466
5466
  return (0, import_clamp$1.default)(Math.round(t - (e.growOffset ?? 0)), Math.ceil(n), Math.floor(r));
5467
5467
  }
5468
5468
  var data_grid_dnd_default = (e) => {
5469
- let [t, n] = import_react.useState(), [r, i] = import_react.useState(), [a, o] = import_react.useState(), [s, c] = import_react.useState(), [l, u] = import_react.useState(false), [f, m] = import_react.useState(), [h, g] = import_react.useState(), [y, x] = import_react.useState(), [S, C] = import_react.useState(false), [E, D] = import_react.useState(), { onHeaderMenuClick: O, onHeaderIndicatorClick: k, getCellContent: A, onColumnMoved: j, onColumnResize: M, onColumnResizeStart: N, onColumnResizeEnd: P, gridRef: F, maxColumnWidth: I, minColumnWidth: L, onRowMoved: Fr, lockColumns: B, onColumnProposeMove: Ir, onMouseDown: V, onMouseUp: H, onItemHovered: Lr, onDragStart: U, canvasRef: Rr } = e, W = (M ?? P ?? N) !== void 0, { columns: G, selection: zr } = e, K = zr.columns, q = import_react.useCallback((e2) => {
5469
+ let [t, n] = import_react.useState(), [r, i] = import_react.useState(), [a, o] = import_react.useState(), [s, c] = import_react.useState(), [l, u] = import_react.useState(false), [f, m] = import_react.useState(), [h, g] = import_react.useState(), [y, x] = import_react.useState(), [S, C] = import_react.useState(false), [E, D] = import_react.useState(), { onHeaderMenuClick: O, onHeaderIndicatorClick: k, getCellContent: A, onColumnMoved: j, onColumnResize: M, onColumnResizeStart: N, onColumnResizeEnd: P, gridRef: F, maxColumnWidth: I, minColumnWidth: L, onRowMoved: Pr, lockColumns: B, onColumnProposeMove: Fr, onMouseDown: V, onMouseUp: H, onItemHovered: Ir, onDragStart: U, canvasRef: Lr } = e, W = (M ?? P ?? N) !== void 0, { columns: G, selection: Rr } = e, K = Rr.columns, q = import_react.useCallback((e2) => {
5470
5470
  let [t2, n2] = e2.location;
5471
- a !== void 0 && s !== t2 && t2 >= B ? (u(true), c(t2)) : h !== void 0 && n2 !== void 0 ? (C(true), x(Math.max(0, n2))) : r === void 0 && !l && !S && (Lr == null ? void 0 : Lr(e2));
5471
+ a !== void 0 && s !== t2 && t2 >= B ? (u(true), c(t2)) : h !== void 0 && n2 !== void 0 ? (C(true), x(Math.max(0, n2))) : r === void 0 && !l && !S && (Ir == null ? void 0 : Ir(e2));
5472
5472
  }, [
5473
5473
  a,
5474
5474
  h,
5475
5475
  s,
5476
- Lr,
5476
+ Ir,
5477
5477
  B,
5478
5478
  r,
5479
5479
  l,
5480
5480
  S
5481
- ]), Br = j !== void 0, Vr = import_react.useCallback((e2) => {
5481
+ ]), zr = j !== void 0, Br = import_react.useCallback((e2) => {
5482
5482
  var _a;
5483
5483
  if (e2.button === 0) {
5484
5484
  let [t2, r2] = e2.location;
@@ -5486,55 +5486,55 @@ let __tla = (async () => {
5486
5486
  let e3 = (_a = F == null ? void 0 : F.current) == null ? void 0 : _a.getBounds(G.length - 1, -1);
5487
5487
  e3 !== void 0 && (n(e3.x), i(G.length - 1));
5488
5488
  } else if (e2.kind === "header" && t2 >= B) {
5489
- let r3 = Rr == null ? void 0 : Rr.current;
5489
+ let r3 = Lr == null ? void 0 : Lr.current;
5490
5490
  if (e2.isEdge && W && r3) {
5491
5491
  n(e2.bounds.x), i(t2);
5492
5492
  let a2 = r3.getBoundingClientRect().width / r3.offsetWidth, o2 = e2.bounds.width / a2;
5493
5493
  N == null ? void 0 : N(G[t2], o2, t2, o2 + (G[t2].growOffset ?? 0));
5494
- } else e2.kind === "header" && Br && (m(e2.bounds.x), o(t2));
5495
- } else e2.kind === "cell" && B > 0 && t2 === 0 && r2 !== void 0 && Fr !== void 0 && (D(e2.bounds.y), g(r2));
5494
+ } else e2.kind === "header" && zr && (m(e2.bounds.x), o(t2));
5495
+ } else e2.kind === "cell" && B > 0 && t2 === 0 && r2 !== void 0 && Pr !== void 0 && (D(e2.bounds.y), g(r2));
5496
5496
  }
5497
5497
  V == null ? void 0 : V(e2);
5498
5498
  }, [
5499
5499
  V,
5500
5500
  W,
5501
5501
  B,
5502
- Fr,
5502
+ Pr,
5503
5503
  F,
5504
5504
  G,
5505
- Br,
5505
+ zr,
5506
5506
  N,
5507
- Rr
5508
- ]), Hr = import_react.useCallback((e2, t2) => {
5507
+ Lr
5508
+ ]), Vr = import_react.useCallback((e2, t2) => {
5509
5509
  l || S || (O == null ? void 0 : O(e2, t2));
5510
5510
  }, [
5511
5511
  l,
5512
5512
  S,
5513
5513
  O
5514
- ]), Ur = import_react.useCallback((e2, t2) => {
5514
+ ]), Hr = import_react.useCallback((e2, t2) => {
5515
5515
  l || S || (k == null ? void 0 : k(e2, t2));
5516
5516
  }, [
5517
5517
  l,
5518
5518
  S,
5519
5519
  k
5520
- ]), Wr = import_react.useRef(-1), Gr = import_react.useCallback(() => {
5521
- Wr.current = -1, g(void 0), x(void 0), D(void 0), C(false), o(void 0), c(void 0), m(void 0), u(false), i(void 0), n(void 0);
5522
- }, []), Kr = import_react.useCallback((e2, t2) => {
5520
+ ]), Ur = import_react.useRef(-1), Wr = import_react.useCallback(() => {
5521
+ Ur.current = -1, g(void 0), x(void 0), D(void 0), C(false), o(void 0), c(void 0), m(void 0), u(false), i(void 0), n(void 0);
5522
+ }, []), Gr = import_react.useCallback((e2, t2) => {
5523
5523
  if (e2.button === 0) {
5524
5524
  if (r !== void 0) {
5525
5525
  if ((K == null ? void 0 : K.hasIndex(r)) === true) for (let e4 of K) {
5526
5526
  if (e4 === r) continue;
5527
- let t3 = G[e4], n2 = offsetColumnSize(t3, Wr.current, L, I);
5527
+ let t3 = G[e4], n2 = offsetColumnSize(t3, Ur.current, L, I);
5528
5528
  M == null ? void 0 : M(t3, n2, e4, n2 + (t3.growOffset ?? 0));
5529
5529
  }
5530
- let e3 = offsetColumnSize(G[r], Wr.current, L, I);
5530
+ let e3 = offsetColumnSize(G[r], Ur.current, L, I);
5531
5531
  if (P == null ? void 0 : P(G[r], e3, r, e3 + (G[r].growOffset ?? 0)), K.hasIndex(r)) for (let e4 of K) {
5532
5532
  if (e4 === r) continue;
5533
- let t3 = G[e4], n2 = offsetColumnSize(t3, Wr.current, L, I);
5533
+ let t3 = G[e4], n2 = offsetColumnSize(t3, Ur.current, L, I);
5534
5534
  P == null ? void 0 : P(t3, n2, e4, n2 + (t3.growOffset ?? 0));
5535
5535
  }
5536
5536
  }
5537
- Gr(), a !== void 0 && s !== void 0 && (j == null ? void 0 : j(a, s)), h !== void 0 && y !== void 0 && (Fr == null ? void 0 : Fr(h, y));
5537
+ Wr(), a !== void 0 && s !== void 0 && (j == null ? void 0 : j(a, s)), h !== void 0 && y !== void 0 && (Pr == null ? void 0 : Pr(h, y));
5538
5538
  }
5539
5539
  H == null ? void 0 : H(e2, t2);
5540
5540
  }, [
@@ -5551,26 +5551,26 @@ let __tla = (async () => {
5551
5551
  I,
5552
5552
  M,
5553
5553
  j,
5554
- Fr,
5555
- Gr
5556
- ]), qr = import_react.useMemo(() => {
5557
- if (!(a === void 0 || s === void 0) && a !== s && (Ir == null ? void 0 : Ir(a, s)) !== false) return {
5554
+ Pr,
5555
+ Wr
5556
+ ]), Kr = import_react.useMemo(() => {
5557
+ if (!(a === void 0 || s === void 0) && a !== s && (Fr == null ? void 0 : Fr(a, s)) !== false) return {
5558
5558
  src: a,
5559
5559
  dest: s
5560
5560
  };
5561
5561
  }, [
5562
5562
  a,
5563
5563
  s,
5564
- Ir
5564
+ Fr
5565
5565
  ]), J = import_react.useCallback((e2) => {
5566
- let n2 = Rr == null ? void 0 : Rr.current;
5566
+ let n2 = Lr == null ? void 0 : Lr.current;
5567
5567
  if (a !== void 0 && f !== void 0) Math.abs(e2.clientX - f) > 20 && u(true);
5568
5568
  else if (h !== void 0 && E !== void 0) Math.abs(e2.clientY - E) > 20 && C(true);
5569
5569
  else if (r !== void 0 && t !== void 0 && n2) {
5570
5570
  let i2 = n2.getBoundingClientRect().width / n2.offsetWidth, a2 = (e2.clientX - t) / i2, o2 = G[r], s2 = offsetColumnSize(o2, a2, L, I);
5571
- if (M == null ? void 0 : M(o2, s2, r, s2 + (o2.growOffset ?? 0)), Wr.current = a2, (K == null ? void 0 : K.first()) === r) for (let e3 of K) {
5571
+ if (M == null ? void 0 : M(o2, s2, r, s2 + (o2.growOffset ?? 0)), Ur.current = a2, (K == null ? void 0 : K.first()) === r) for (let e3 of K) {
5572
5572
  if (e3 === r) continue;
5573
- let t2 = G[e3], n3 = offsetColumnSize(t2, Wr.current, L, I);
5573
+ let t2 = G[e3], n3 = offsetColumnSize(t2, Ur.current, L, I);
5574
5574
  M == null ? void 0 : M(t2, n3, e3, n3 + (t2.growOffset ?? 0));
5575
5575
  }
5576
5576
  }
@@ -5586,8 +5586,8 @@ let __tla = (async () => {
5586
5586
  I,
5587
5587
  M,
5588
5588
  K,
5589
- Rr
5590
- ]), Jr = import_react.useCallback((e2, t2) => {
5589
+ Lr
5590
+ ]), qr = import_react.useCallback((e2, t2) => {
5591
5591
  if (h === void 0 || y === void 0) return A(e2, t2);
5592
5592
  let [n2, r2] = e2;
5593
5593
  return r2 === y ? r2 = h : (r2 > y && --r2, r2 >= h && (r2 += 1)), A([
@@ -5598,10 +5598,10 @@ let __tla = (async () => {
5598
5598
  h,
5599
5599
  y,
5600
5600
  A
5601
- ]), Yr = import_react.useCallback((e2) => {
5602
- U == null ? void 0 : U(e2), e2.defaultPrevented() || Gr();
5601
+ ]), Jr = import_react.useCallback((e2) => {
5602
+ U == null ? void 0 : U(e2), e2.defaultPrevented() || Wr();
5603
5603
  }, [
5604
- Gr,
5604
+ Wr,
5605
5605
  U
5606
5606
  ]);
5607
5607
  return import_react.createElement(data_grid_default, {
@@ -5660,17 +5660,17 @@ let __tla = (async () => {
5660
5660
  resizeIndicator: e.resizeIndicator,
5661
5661
  verticalBorder: e.verticalBorder,
5662
5662
  width: e.width,
5663
- getCellContent: Jr,
5663
+ getCellContent: qr,
5664
5664
  isResizing: r !== void 0,
5665
- onHeaderMenuClick: Hr,
5666
- onHeaderIndicatorClick: Ur,
5665
+ onHeaderMenuClick: Vr,
5666
+ onHeaderIndicatorClick: Hr,
5667
5667
  isDragging: l,
5668
5668
  onItemHovered: q,
5669
- onDragStart: Yr,
5670
- onMouseDown: Vr,
5669
+ onDragStart: Jr,
5670
+ onMouseDown: Br,
5671
5671
  allowResize: W,
5672
- onMouseUp: Kr,
5673
- dragAndDropState: qr,
5672
+ onMouseUp: Gr,
5673
+ dragAndDropState: Kr,
5674
5674
  onMouseMoveRaw: J,
5675
5675
  ref: F
5676
5676
  });
@@ -5809,7 +5809,7 @@ let __tla = (async () => {
5809
5809
  use_kinetic_scroll_default(h && browserIsSafari.value, I, O);
5810
5810
  let L = import_react.useRef(I);
5811
5811
  L.current = I;
5812
- let Fr = import_react.useRef(), B = import_react.useRef(false);
5812
+ let Pr = import_react.useRef(), B = import_react.useRef(false);
5813
5813
  import_react.useLayoutEffect(() => {
5814
5814
  B.current ? I() : B.current = true;
5815
5815
  }, [
@@ -5817,7 +5817,7 @@ let __tla = (async () => {
5817
5817
  l,
5818
5818
  u
5819
5819
  ]);
5820
- let Ir = import_react.useCallback((e2) => {
5820
+ let Fr = import_react.useCallback((e2) => {
5821
5821
  O.current = e2, g !== void 0 && (g.current = e2);
5822
5822
  }, [
5823
5823
  g
@@ -5838,21 +5838,21 @@ let __tla = (async () => {
5838
5838
  }
5839
5839
  })), H += e2;
5840
5840
  }
5841
- let { ref: Lr, width: U, height: Rr } = useResizeDetector(y);
5842
- return typeof window < "u" && (((_a = Fr.current) == null ? void 0 : _a.height) !== Rr || ((_b = Fr.current) == null ? void 0 : _b.width) !== U) && (window.setTimeout(() => L.current(), 0), Fr.current = {
5841
+ let { ref: Ir, width: U, height: Lr } = useResizeDetector(y);
5842
+ return typeof window < "u" && (((_a = Pr.current) == null ? void 0 : _a.height) !== Lr || ((_b = Pr.current) == null ? void 0 : _b.width) !== U) && (window.setTimeout(() => L.current(), 0), Pr.current = {
5843
5843
  width: U,
5844
- height: Rr
5845
- }), (U ?? 0) === 0 || (Rr ?? 0) === 0 ? import_react.createElement("div", {
5846
- ref: Lr
5844
+ height: Lr
5845
+ }), (U ?? 0) === 0 || (Lr ?? 0) === 0 ? import_react.createElement("div", {
5846
+ ref: Ir
5847
5847
  }) : import_react.createElement("div", {
5848
- ref: Lr
5848
+ ref: Ir
5849
5849
  }, import_react.createElement(ScrollRegionStyle, {
5850
5850
  isSafari: browserIsSafari.value
5851
5851
  }, import_react.createElement("div", {
5852
5852
  className: "dvn-underlay"
5853
5853
  }, t), import_react.createElement("div", {
5854
- ref: Ir,
5855
- style: Fr.current,
5854
+ ref: Fr,
5855
+ style: Pr.current,
5856
5856
  draggable: o,
5857
5857
  onDragStart: (e2) => {
5858
5858
  o || (e2.stopPropagation(), e2.preventDefault());
@@ -5868,7 +5868,7 @@ let __tla = (async () => {
5868
5868
  }), import_react.createElement("div", {
5869
5869
  ref: j,
5870
5870
  style: {
5871
- height: Rr,
5871
+ height: Lr,
5872
5872
  maxHeight: n - Math.ceil(k % 1),
5873
5873
  position: "sticky",
5874
5874
  top: 0,
@@ -5882,15 +5882,15 @@ let __tla = (async () => {
5882
5882
  }, f))))));
5883
5883
  };
5884
5884
  var scrolling_data_grid_default = (e) => {
5885
- let { columns: t, rows: n, rowHeight: r, headerHeight: i, groupHeaderHeight: a, enableGroups: o, freezeColumns: s, experimental: c, nonGrowWidth: l, clientSize: u, className: f, onVisibleRegionChanged: m, scrollRef: h, preventDiagonalScrolling: g, rightElement: y, rightElementProps: x, overscrollX: S, overscrollY: C, initialSize: E, smoothScrollX: D = false, smoothScrollY: O = false, isDraggable: k } = e, { paddingRight: A, paddingBottom: j } = c ?? {}, [M, N] = u, P = import_react.useRef(), F = import_react.useRef(), I = import_react.useRef(), L = import_react.useRef(), Fr = l + Math.max(0, S ?? 0), B = o ? i + a : i;
5885
+ let { columns: t, rows: n, rowHeight: r, headerHeight: i, groupHeaderHeight: a, enableGroups: o, freezeColumns: s, experimental: c, nonGrowWidth: l, clientSize: u, className: f, onVisibleRegionChanged: m, scrollRef: h, preventDiagonalScrolling: g, rightElement: y, rightElementProps: x, overscrollX: S, overscrollY: C, initialSize: E, smoothScrollX: D = false, smoothScrollY: O = false, isDraggable: k } = e, { paddingRight: A, paddingBottom: j } = c ?? {}, [M, N] = u, P = import_react.useRef(), F = import_react.useRef(), I = import_react.useRef(), L = import_react.useRef(), Pr = l + Math.max(0, S ?? 0), B = o ? i + a : i;
5886
5886
  if (typeof r == "number") B += n * r;
5887
5887
  else for (let e2 = 0; e2 < n; e2++) B += r(e2);
5888
5888
  C !== void 0 && (B += C);
5889
- let Ir = import_react.useRef(), V = import_react.useCallback(() => {
5889
+ let Fr = import_react.useRef(), V = import_react.useCallback(() => {
5890
5890
  var _a, _b;
5891
- if (Ir.current === void 0) return;
5891
+ if (Fr.current === void 0) return;
5892
5892
  let e2 = {
5893
- ...Ir.current
5893
+ ...Fr.current
5894
5894
  }, i2 = 0, a2 = e2.x < 0 ? -e2.x : 0, o2 = 0, c2 = 0;
5895
5895
  e2.x = e2.x < 0 ? 0 : e2.x;
5896
5896
  let l2 = 0;
@@ -5938,7 +5938,7 @@ let __tla = (async () => {
5938
5938
  D,
5939
5939
  O
5940
5940
  ]), H = import_react.useCallback((e2) => {
5941
- Ir.current = e2, V();
5941
+ Fr.current = e2, V();
5942
5942
  }, [
5943
5943
  V
5944
5944
  ]);
@@ -5952,7 +5952,7 @@ let __tla = (async () => {
5952
5952
  kineticScrollPerfHack: c == null ? void 0 : c.kineticScrollPerfHack,
5953
5953
  preventDiagonalScrolling: g,
5954
5954
  draggable: k === true || typeof k == "string",
5955
- scrollWidth: Fr + (A ?? 0),
5955
+ scrollWidth: Pr + (A ?? 0),
5956
5956
  scrollHeight: B + (j ?? 0),
5957
5957
  clientHeight: N,
5958
5958
  rightElement: y,
@@ -6178,7 +6178,7 @@ let __tla = (async () => {
6178
6178
  a,
6179
6179
  S
6180
6180
  ]);
6181
- let Fr = import_react.useCallback((e2) => {
6181
+ let Pr = import_react.useCallback((e2) => {
6182
6182
  var _a;
6183
6183
  if ((_a = e2 == null ? void 0 : e2.stopPropagation) == null ? void 0 : _a.call(e2), C === void 0) return;
6184
6184
  let t2 = (C.selectedIndex + 1) % C.results;
@@ -6202,11 +6202,11 @@ let __tla = (async () => {
6202
6202
  u,
6203
6203
  M,
6204
6204
  C
6205
- ]), Ir = import_react.useCallback((e2) => {
6206
- (e2.ctrlKey || e2.metaKey) && e2.nativeEvent.code === "KeyF" || e2.key === "Escape" ? (I(), e2.stopPropagation(), e2.preventDefault()) : e2.key === "Enter" && (e2.shiftKey ? B() : Fr());
6205
+ ]), Fr = import_react.useCallback((e2) => {
6206
+ (e2.ctrlKey || e2.metaKey) && e2.nativeEvent.code === "KeyF" || e2.key === "Escape" ? (I(), e2.stopPropagation(), e2.preventDefault()) : e2.key === "Enter" && (e2.shiftKey ? B() : Pr());
6207
6207
  }, [
6208
6208
  I,
6209
- Fr,
6209
+ Pr,
6210
6210
  B
6211
6211
  ]);
6212
6212
  import_react.useEffect(() => () => {
@@ -6224,7 +6224,7 @@ let __tla = (async () => {
6224
6224
  }, [
6225
6225
  f
6226
6226
  ]);
6227
- let Lr = import_react.useMemo(() => {
6227
+ let Ir = import_react.useMemo(() => {
6228
6228
  if (!f && !V) return null;
6229
6229
  let e2;
6230
6230
  C !== void 0 && (e2 = C.results >= 1e3 ? "over 1000" : `${C.results} result${C.results === 1 ? "" : "s"}`, C.selectedIndex >= 0 && (e2 = `${C.selectedIndex + 1} of ${e2}`));
@@ -6249,7 +6249,7 @@ let __tla = (async () => {
6249
6249
  onChange: L,
6250
6250
  value: x,
6251
6251
  tabIndex: f ? void 0 : -1,
6252
- onKeyDownCapture: Ir
6252
+ onKeyDownCapture: Fr
6253
6253
  }), import_react.createElement("button", {
6254
6254
  "aria-label": "Previous Result",
6255
6255
  "aria-hidden": !f,
@@ -6260,7 +6260,7 @@ let __tla = (async () => {
6260
6260
  "aria-label": "Next Result",
6261
6261
  "aria-hidden": !f,
6262
6262
  tabIndex: f ? void 0 : -1,
6263
- onClick: Fr,
6263
+ onClick: Pr,
6264
6264
  disabled: ((C == null ? void 0 : C.results) ?? 0) === 0
6265
6265
  }, downArrow), m !== void 0 && import_react.createElement("button", {
6266
6266
  "aria-label": "Close Search",
@@ -6289,9 +6289,9 @@ let __tla = (async () => {
6289
6289
  a,
6290
6290
  L,
6291
6291
  x,
6292
- Ir,
6293
- B,
6294
6292
  Fr,
6293
+ B,
6294
+ Pr,
6295
6295
  m,
6296
6296
  I
6297
6297
  ]);
@@ -6375,7 +6375,7 @@ let __tla = (async () => {
6375
6375
  smoothScrollX: e.smoothScrollX,
6376
6376
  smoothScrollY: e.smoothScrollY,
6377
6377
  resizeIndicator: e.resizeIndicator
6378
- }), Lr);
6378
+ }), Ir);
6379
6379
  }, _exp$2 = () => (e) => Math.max(16, e.targetHeight - 10), RenameInput = styled_default("input")({
6380
6380
  name: "RenameInput",
6381
6381
  class: "gdg-r17m35ur",
@@ -7417,46 +7417,52 @@ let __tla = (async () => {
7417
7417
  };
7418
7418
  const DataEditor = import_react.forwardRef((e, t) => {
7419
7419
  var _a2, _b, _c2;
7420
- let [n, r] = import_react.useState(emptyGridSelection), [i, a] = import_react.useState(), o = import_react.useRef(null), s = import_react.useRef(null), [c, l] = import_react.useState(), u = import_react.useRef(), f = typeof window > "u" ? null : window, { imageEditorOverride: m, getRowThemeOverride: h, markdownDivCreateNode: g, width: y, height: x, columns: S, rows: C, getCellContent: E, onCellClicked: D, onCellActivated: O, onFillPattern: k, onFinishedEditing: A, coercePasteValue: j, drawHeader: M, drawCell: N, editorBloom: P, onHeaderClicked: F, onColumnProposeMove: I, rangeSelectionColumnSpanning: L = true, spanRangeBehavior: Fr = "default", onGroupHeaderClicked: B, onCellContextMenu: Ir, className: V, onHeaderContextMenu: H, getCellsForSelection: Lr, onGroupHeaderContextMenu: U, onGroupHeaderRenamed: Rr, onCellEdited: W, onCellsEdited: G, onSearchResultsChanged: zr, searchResults: K, onSearchValueChange: q, searchValue: Br, onKeyDown: Hr, onKeyUp: Ur, keybindings: Kr, editOnType: qr = true, onRowAppended: J, onColumnMoved: Jr, validateCell: Yr, highlightRegions: Xr, rangeSelect: Y = "rect", columnSelect: Zr = "multi", rowSelect: X = "multi", rangeSelectionBlending: Qr = "exclusive", columnSelectionBlending: $r = "exclusive", rowSelectionBlending: oi = "exclusive", onDelete: li, onDragStart: ui, onMouseMove: di, onPaste: fi, copyHeaders: mi = false, freezeColumns: hi = 0, cellActivationBehavior: gi = "second-click", rowSelectionMode: vi = "auto", onHeaderMenuClick: yi, onHeaderIndicatorClick: bi, getGroupDetails: Si, rowGrouping: Ci, onSearchClose: Ti, onItemHovered: Ei, onSelectionCleared: Di, showSearch: Oi, onVisibleRegionChanged: ki, gridSelection: Ai, onGridSelectionChange: ji, minColumnWidth: Mi = 50, maxColumnWidth: Ni = 500, maxColumnAutoWidth: Pi, provideEditor: Fi, trailingRowOptions: Ii, freezeTrailingRows: Li = 0, allowedFillDirections: Ri = "orthogonal", scrollOffsetX: zi, scrollOffsetY: Bi, verticalBorder: Vi, onDragOverCell: Hi, onDrop: Ui, onColumnResize: Wi, onColumnResizeEnd: Gi, onColumnResizeStart: Ki, customRenderers: qi, fillHandle: Yi, experimental: Xi, fixedShadowX: Zi, fixedShadowY: Qi, headerIcons: $i, imageWindowLoader: ea, initialSize: ta, isDraggable: na, onDragLeave: ra, onRowMoved: ia, overscrollX: aa, overscrollY: oa, preventDiagonalScrolling: sa, rightElement: ca, rightElementProps: la, trapFocus: ua = false, smoothScrollX: da, smoothScrollY: fa, scaleToRem: pa = false, rowHeight: ma = 34, headerHeight: ha = 36, groupHeaderHeight: ga = ha, theme: _a, isOutsideClick: va, renderers: ya, resizeIndicator: ba, scrollToActiveCell: xa = true, drawFocusRing: Sa = true } = e, Ca = Sa === "no-editor" ? i === void 0 : Sa, wa = typeof e.rowMarkers == "string" ? void 0 : e.rowMarkers, Ta = (wa == null ? void 0 : wa.kind) ?? e.rowMarkers ?? "none", Ea = (wa == null ? void 0 : wa.width) ?? e.rowMarkerWidth, Da = (wa == null ? void 0 : wa.startIndex) ?? e.rowMarkerStartIndex ?? 1, Oa = (wa == null ? void 0 : wa.theme) ?? e.rowMarkerTheme, ka = wa == null ? void 0 : wa.headerTheme, Ma = wa == null ? void 0 : wa.headerAlwaysVisible, Fa = X !== "multi", Ia = (wa == null ? void 0 : wa.checkboxStyle) ?? "square", La = Math.max(Mi, 20), Ra = Math.max(Ni, La), za = Math.max(Pi ?? Ra, La), Va = import_react.useMemo(() => typeof window > "u" ? {
7420
+ let [n, r] = import_react.useState(emptyGridSelection), [i, a] = import_react.useState(), o = import_react.useRef(null), s = import_react.useRef(null), [c, l] = import_react.useState(), u = import_react.useRef(), f = typeof window > "u" ? null : window, { imageEditorOverride: m, getRowThemeOverride: h, markdownDivCreateNode: g, width: y, height: x, columns: S, rows: C, getCellContent: E, onCellClicked: D, onCellActivated: O, onFillPattern: k, onFinishedEditing: A, coercePasteValue: j, drawHeader: M, drawCell: N, editorBloom: P, onHeaderClicked: F, onColumnProposeMove: I, rangeSelectionColumnSpanning: L = true, spanRangeBehavior: Pr = "default", onGroupHeaderClicked: B, onCellContextMenu: Fr, className: V, onHeaderContextMenu: H, getCellsForSelection: Ir, onGroupHeaderContextMenu: U, onGroupHeaderRenamed: Lr, onCellEdited: W, onCellsEdited: G, onSearchResultsChanged: Rr, searchResults: K, onSearchValueChange: q, searchValue: Br, onKeyDown: Vr, onKeyUp: Wr, keybindings: Gr, editOnType: Kr = true, onRowAppended: J, onColumnMoved: qr, validateCell: Jr, highlightRegions: Yr, rangeSelect: Y = "rect", columnSelect: Xr = "multi", rowSelect: X = "multi", rangeSelectionBlending: Zr = "exclusive", columnSelectionBlending: ii = "exclusive", rowSelectionBlending: si = "exclusive", onDelete: ci, onDragStart: li, onMouseMove: ui, onPaste: fi, copyHeaders: pi = false, freezeColumns: mi = 0, cellActivationBehavior: gi = "second-click", rowSelectionMode: _i = "auto", onHeaderMenuClick: vi, onHeaderIndicatorClick: bi, getGroupDetails: xi, rowGrouping: Ci, onSearchClose: wi, onItemHovered: Ti, onSelectionCleared: Ei, showSearch: Di, onVisibleRegionChanged: Oi, gridSelection: ki, onGridSelectionChange: Ai, minColumnWidth: ji = 50, maxColumnWidth: Mi = 500, maxColumnAutoWidth: Ni, provideEditor: Pi, trailingRowOptions: Fi, freezeTrailingRows: Ii = 0, allowedFillDirections: Li = "orthogonal", scrollOffsetX: Ri, scrollOffsetY: zi, verticalBorder: Bi, onDragOverCell: Vi, onDrop: Hi, onColumnResize: Ui, onColumnResizeEnd: Wi, onColumnResizeStart: Gi, customRenderers: qi, fillHandle: Ji, experimental: Yi, fixedShadowX: Xi, fixedShadowY: Zi, headerIcons: Qi, imageWindowLoader: $i, initialSize: ea, isDraggable: ta, onDragLeave: na, onRowMoved: ra, overscrollX: ia, overscrollY: aa, preventDiagonalScrolling: oa, rightElement: sa, rightElementProps: ca, trapFocus: la = false, smoothScrollX: ua, smoothScrollY: da, scaleToRem: fa = false, rowHeight: pa = 34, headerHeight: ma = 36, groupHeaderHeight: ha = ma, theme: ga, isOutsideClick: _a, renderers: va, resizeIndicator: ya, scrollToActiveCell: ba = true, drawFocusRing: xa = true } = e, Sa = xa === "no-editor" ? i === void 0 : xa, Ca = typeof e.rowMarkers == "string" ? void 0 : e.rowMarkers, wa = (Ca == null ? void 0 : Ca.kind) ?? e.rowMarkers ?? "none", Ta = (Ca == null ? void 0 : Ca.width) ?? e.rowMarkerWidth, Ea = (Ca == null ? void 0 : Ca.startIndex) ?? e.rowMarkerStartIndex ?? 1, Da = (Ca == null ? void 0 : Ca.theme) ?? e.rowMarkerTheme, Aa = Ca == null ? void 0 : Ca.headerTheme, Na = Ca == null ? void 0 : Ca.headerAlwaysVisible, Pa = X !== "multi", Fa = (Ca == null ? void 0 : Ca.checkboxStyle) ?? "square", Ia = Math.max(ji, 20), La = Math.max(Mi, Ia), za = Math.max(Ni ?? La, Ia), Ba = import_react.useMemo(() => typeof window > "u" ? {
7421
7421
  fontSize: "16px"
7422
- } : window.getComputedStyle(document.documentElement), []), { rows: Z, rowNumberMapper: Ha, rowHeight: Ua, getRowThemeOverride: Wa } = useRowGroupingInner(Ci, C, ma, h), { rowHeight: Ga, headerHeight: Ka, groupHeaderHeight: qa, theme: Ja, overscrollX: Ya, overscrollY: Xa } = useRemAdjuster({
7423
- groupHeaderHeight: ga,
7424
- headerHeight: ha,
7425
- overscrollX: aa,
7426
- overscrollY: oa,
7427
- remSize: import_react.useMemo(() => Number.parseFloat(Va.fontSize), [
7428
- Va
7422
+ } : window.getComputedStyle(document.documentElement), []), { rows: Z, rowNumberMapper: Va, rowHeight: Ha, getRowThemeOverride: Ua } = useRowGroupingInner(Ci, C, pa, h), { rowHeight: Wa, headerHeight: Ga, groupHeaderHeight: Ka, theme: qa, overscrollX: Ja, overscrollY: Ya } = useRemAdjuster({
7423
+ groupHeaderHeight: ha,
7424
+ headerHeight: ma,
7425
+ overscrollX: ia,
7426
+ overscrollY: aa,
7427
+ remSize: import_react.useMemo(() => Number.parseFloat(Ba.fontSize), [
7428
+ Ba
7429
7429
  ]),
7430
- rowHeight: Ua,
7431
- scaleToRem: pa,
7432
- theme: _a
7433
- }), Za = useKeybindingsWithDefaults(Kr), Qa = Ea ?? (C > 1e4 ? 48 : C > 1e3 ? 44 : C > 100 ? 36 : 32), $a = Ta !== "none", Q = $a ? 1 : 0, eo = J !== void 0, to = (Ii == null ? void 0 : Ii.sticky) === true, [no, ro] = import_react.useState(false), io = Oi ?? no, ao = import_react.useCallback(() => {
7434
- Ti === void 0 ? ro(false) : Ti();
7435
- }, [
7436
- Ti
7437
- ]), $ = import_react.useMemo(() => Ai === void 0 ? void 0 : shiftSelection(Ai, Q), [
7438
- Ai,
7430
+ rowHeight: Ha,
7431
+ scaleToRem: fa,
7432
+ theme: ga
7433
+ }), Xa = useKeybindingsWithDefaults(Gr), Za = Ta ?? (C > 1e4 ? 48 : C > 1e3 ? 44 : C > 100 ? 36 : 32), Qa = wa !== "none", Q = Qa ? 1 : 0, $a = J !== void 0, eo = (Fi == null ? void 0 : Fi.sticky) === true, [to, no] = import_react.useState(false), ro = Di ?? to, io = import_react.useCallback(() => {
7434
+ wi === void 0 ? no(false) : wi();
7435
+ }, [
7436
+ wi
7437
+ ]), $ = import_react.useMemo(() => ki === void 0 ? void 0 : shiftSelection(ki, Q), [
7438
+ ki,
7439
7439
  Q
7440
- ]) ?? n, oo = import_react.useRef();
7441
- oo.current === void 0 && (oo.current = new AbortController()), import_react.useEffect(() => () => oo == null ? void 0 : oo.current.abort(), []);
7442
- let [so, co] = useCellsForSelection(Lr, E, Q, oo.current, Z), lo = import_react.useCallback((e2, t2, n2) => {
7443
- if (Yr === void 0) return true;
7440
+ ]) ?? n, ao = import_react.useRef();
7441
+ ao.current === void 0 && (ao.current = new AbortController()), import_react.useEffect(() => () => ao == null ? void 0 : ao.current.abort(), []);
7442
+ let [oo, so] = useCellsForSelection(Ir, E, Q, ao.current, Z), co = import_react.useCallback((e2, t2, n2) => {
7443
+ if (Jr === void 0) return true;
7444
7444
  let r2 = [
7445
7445
  e2[0] - Q,
7446
7446
  e2[1]
7447
7447
  ];
7448
- return Yr == null ? void 0 : Yr(r2, t2, n2);
7448
+ return Jr == null ? void 0 : Jr(r2, t2, n2);
7449
7449
  }, [
7450
7450
  Q,
7451
- Yr
7452
- ]), uo = import_react.useRef(Ai), fo = import_react.useCallback((e2, t2) => {
7453
- t2 && (e2 = expandSelection(e2, so, Q, Fr, oo.current)), ji === void 0 ? r(e2) : (uo.current = shiftSelection(e2, -Q), ji(uo.current));
7451
+ Jr
7452
+ ]), lo = import_react.useRef(ki), uo = import_react.useCallback((e2, t2) => {
7453
+ t2 && (e2 = expandSelection(e2, oo, Q, Pr, ao.current)), Ai === void 0 ? r(e2) : (lo.current = shiftSelection(e2, -Q), Ai(lo.current));
7454
7454
  }, [
7455
- ji,
7456
- so,
7455
+ Ai,
7456
+ oo,
7457
7457
  Q,
7458
- Fr
7459
- ]), po = whenDefined(Wi, import_react.useCallback((e2, t2, n2, r2) => {
7458
+ Pr
7459
+ ]), fo = whenDefined(Ui, import_react.useCallback((e2, t2, n2, r2) => {
7460
+ Ui == null ? void 0 : Ui(S[n2 - Q], t2, n2 - Q, r2);
7461
+ }, [
7462
+ Ui,
7463
+ Q,
7464
+ S
7465
+ ])), po = whenDefined(Wi, import_react.useCallback((e2, t2, n2, r2) => {
7460
7466
  Wi == null ? void 0 : Wi(S[n2 - Q], t2, n2 - Q, r2);
7461
7467
  }, [
7462
7468
  Wi,
@@ -7468,92 +7474,86 @@ let __tla = (async () => {
7468
7474
  Gi,
7469
7475
  Q,
7470
7476
  S
7471
- ])), ho = whenDefined(Ki, import_react.useCallback((e2, t2, n2, r2) => {
7472
- Ki == null ? void 0 : Ki(S[n2 - Q], t2, n2 - Q, r2);
7473
- }, [
7474
- Ki,
7475
- Q,
7476
- S
7477
- ])), go = whenDefined(M, import_react.useCallback((e2, t2) => (M == null ? void 0 : M({
7477
+ ])), ho = whenDefined(M, import_react.useCallback((e2, t2) => (M == null ? void 0 : M({
7478
7478
  ...e2,
7479
7479
  columnIndex: e2.columnIndex - Q
7480
7480
  }, t2)) ?? false, [
7481
7481
  M,
7482
7482
  Q
7483
- ])), _o = whenDefined(N, import_react.useCallback((e2, t2) => (N == null ? void 0 : N({
7483
+ ])), go = whenDefined(N, import_react.useCallback((e2, t2) => (N == null ? void 0 : N({
7484
7484
  ...e2,
7485
7485
  col: e2.col - Q
7486
7486
  }, t2)) ?? false, [
7487
7487
  N,
7488
7488
  Q
7489
- ])), vo = import_react.useCallback((e2) => {
7490
- if (li !== void 0) {
7491
- let t2 = li(shiftSelection(e2, -Q));
7489
+ ])), _o = import_react.useCallback((e2) => {
7490
+ if (ci !== void 0) {
7491
+ let t2 = ci(shiftSelection(e2, -Q));
7492
7492
  return typeof t2 == "boolean" ? t2 : shiftSelection(t2, Q);
7493
7493
  }
7494
7494
  return true;
7495
7495
  }, [
7496
- li,
7496
+ ci,
7497
7497
  Q
7498
- ]), [yo, bo, xo] = useSelectionBehavior($, fo, Qr, $r, oi, Y, L), So = import_react.useMemo(() => mergeAndRealizeTheme(getDataEditorTheme(), Ja), [
7499
- Ja
7500
- ]), [Co, wo] = import_react.useState([
7498
+ ]), [vo, yo, bo] = useSelectionBehavior($, uo, Zr, ii, si, Y, L), xo = import_react.useMemo(() => mergeAndRealizeTheme(getDataEditorTheme(), qa), [
7499
+ qa
7500
+ ]), [So, Co] = import_react.useState([
7501
7501
  0,
7502
7502
  0,
7503
7503
  0
7504
- ]), To = import_react.useMemo(() => {
7505
- if (ya === void 0) return {};
7504
+ ]), wo = import_react.useMemo(() => {
7505
+ if (va === void 0) return {};
7506
7506
  let e2 = {};
7507
- for (let t2 of ya) e2[t2.kind] = t2;
7507
+ for (let t2 of va) e2[t2.kind] = t2;
7508
7508
  return e2;
7509
7509
  }, [
7510
- ya
7511
- ]), Eo = import_react.useCallback((e2) => e2.kind === GridCellKind.Custom ? qi == null ? void 0 : qi.find((t2) => t2.isMatch(e2)) : To[e2.kind], [
7510
+ va
7511
+ ]), To = import_react.useCallback((e2) => e2.kind === GridCellKind.Custom ? qi == null ? void 0 : qi.find((t2) => t2.isMatch(e2)) : wo[e2.kind], [
7512
7512
  qi,
7513
- To
7514
- ]), { sizedColumns: Do, nonGrowWidth: Oo } = useColumnSizer(S, Z, co, Co[0] - (Q === 0 ? 0 : Qa) - Co[2], La, za, So, Eo, oo.current);
7515
- Ta !== "none" && (Oo += Qa);
7516
- let ko = import_react.useMemo(() => Do.some((e2) => e2.group !== void 0), [
7517
- Do
7518
- ]), Ao = ko ? Ka + qa : Ka, jo = $.rows.length, Mo = Ta === "none" ? void 0 : jo === 0 ? false : jo === Z ? true : void 0, No = import_react.useMemo(() => Ta === "none" ? Do : [
7513
+ wo
7514
+ ]), { sizedColumns: Eo, nonGrowWidth: Do } = useColumnSizer(S, Z, so, So[0] - (Q === 0 ? 0 : Za) - So[2], Ia, za, xo, To, ao.current);
7515
+ wa !== "none" && (Do += Za);
7516
+ let Oo = import_react.useMemo(() => Eo.some((e2) => e2.group !== void 0), [
7517
+ Eo
7518
+ ]), ko = Oo ? Ga + Ka : Ga, Ao = $.rows.length, jo = wa === "none" ? void 0 : Ao === 0 ? false : Ao === Z ? true : void 0, Mo = import_react.useMemo(() => wa === "none" ? Eo : [
7519
7519
  {
7520
7520
  title: "",
7521
- width: Qa,
7521
+ width: Za,
7522
7522
  icon: void 0,
7523
7523
  hasMenu: false,
7524
7524
  style: "normal",
7525
- themeOverride: Oa,
7526
- rowMarker: Ia,
7527
- rowMarkerChecked: Mo,
7528
- headerRowMarkerTheme: ka,
7529
- headerRowMarkerAlwaysVisible: Ma,
7530
- headerRowMarkerDisabled: Fa
7525
+ themeOverride: Da,
7526
+ rowMarker: Fa,
7527
+ rowMarkerChecked: jo,
7528
+ headerRowMarkerTheme: Aa,
7529
+ headerRowMarkerAlwaysVisible: Na,
7530
+ headerRowMarkerDisabled: Pa
7531
7531
  },
7532
- ...Do
7532
+ ...Eo
7533
7533
  ], [
7534
- Ta,
7535
- Do,
7536
- Qa,
7537
- Oa,
7538
- Ia,
7539
- Mo,
7540
- ka,
7541
- Ma,
7542
- Fa
7543
- ]), Po = import_react.useRef({
7534
+ wa,
7535
+ Eo,
7536
+ Za,
7537
+ Da,
7538
+ Fa,
7539
+ jo,
7540
+ Aa,
7541
+ Na,
7542
+ Pa
7543
+ ]), No = import_react.useRef({
7544
7544
  height: 1,
7545
7545
  width: 1,
7546
7546
  x: 0,
7547
7547
  y: 0
7548
- }), Fo = import_react.useRef(false), { setVisibleRegion: Io, visibleRegion: Lo, scrollRef: Ro } = useInitialScrollOffset(zi, Bi, Ga, Po, () => Fo.current = true);
7549
- Po.current = Lo;
7550
- let zo = Lo.x + Q, Bo = Lo.y, Vo = import_react.useRef(null), Ho = import_react.useCallback((e2) => {
7548
+ }), Po = import_react.useRef(false), { setVisibleRegion: Fo, visibleRegion: Io, scrollRef: Lo } = useInitialScrollOffset(Ri, zi, Wa, No, () => Po.current = true);
7549
+ No.current = Io;
7550
+ let Ro = Io.x + Q, zo = Io.y, Bo = import_react.useRef(null), Vo = import_react.useCallback((e2) => {
7551
7551
  var _a3;
7552
- e2 === true ? (_a3 = Vo.current) == null ? void 0 : _a3.focus() : window.requestAnimationFrame(() => {
7552
+ e2 === true ? (_a3 = Bo.current) == null ? void 0 : _a3.focus() : window.requestAnimationFrame(() => {
7553
7553
  var _a4;
7554
- (_a4 = Vo.current) == null ? void 0 : _a4.focus();
7554
+ (_a4 = Bo.current) == null ? void 0 : _a4.focus();
7555
7555
  });
7556
- }, []), Uo = eo ? Z + 1 : Z, Wo = import_react.useCallback((e2) => {
7556
+ }, []), Ho = $a ? Z + 1 : Z, Uo = import_react.useCallback((e2) => {
7557
7557
  let t2 = Q === 0 ? e2 : e2.map((e3) => ({
7558
7558
  ...e3,
7559
7559
  location: [
@@ -7567,11 +7567,11 @@ let __tla = (async () => {
7567
7567
  W,
7568
7568
  G,
7569
7569
  Q
7570
- ]), [Go, Ko] = import_react.useState(), qo = $.current !== void 0 && $.current.range.width * $.current.range.height > 1 ? $.current.range : void 0, Jo = Ca ? (_a2 = $.current) == null ? void 0 : _a2.cell : void 0, Yo = Jo == null ? void 0 : Jo[0], Xo = Jo == null ? void 0 : Jo[1], Zo = import_react.useMemo(() => {
7571
- if ((Xr === void 0 || Xr.length === 0) && (qo ?? Yo ?? Xo ?? Go) === void 0) return;
7570
+ ]), [Wo, Go] = import_react.useState(), Ko = $.current !== void 0 && $.current.range.width * $.current.range.height > 1 ? $.current.range : void 0, qo = Sa ? (_a2 = $.current) == null ? void 0 : _a2.cell : void 0, Jo = qo == null ? void 0 : qo[0], Yo = qo == null ? void 0 : qo[1], Xo = import_react.useMemo(() => {
7571
+ if ((Yr === void 0 || Yr.length === 0) && (Ko ?? Jo ?? Yo ?? Wo) === void 0) return;
7572
7572
  let e2 = [];
7573
- if (Xr !== void 0) for (let t2 of Xr) {
7574
- let n2 = No.length - t2.range.x - Q;
7573
+ if (Yr !== void 0) for (let t2 of Yr) {
7574
+ let n2 = Mo.length - t2.range.x - Q;
7575
7575
  n2 > 0 && e2.push({
7576
7576
  color: t2.color,
7577
7577
  range: {
@@ -7582,56 +7582,56 @@ let __tla = (async () => {
7582
7582
  style: t2.style
7583
7583
  });
7584
7584
  }
7585
- return Go !== void 0 && e2.push({
7586
- color: withAlpha(So.accentColor, 0),
7587
- range: Go,
7585
+ return Wo !== void 0 && e2.push({
7586
+ color: withAlpha(xo.accentColor, 0),
7587
+ range: Wo,
7588
7588
  style: "dashed"
7589
- }), qo !== void 0 && e2.push({
7590
- color: withAlpha(So.accentColor, 0.5),
7591
- range: qo,
7589
+ }), Ko !== void 0 && e2.push({
7590
+ color: withAlpha(xo.accentColor, 0.5),
7591
+ range: Ko,
7592
7592
  style: "solid-outline"
7593
- }), Yo !== void 0 && Xo !== void 0 && e2.push({
7594
- color: So.accentColor,
7593
+ }), Jo !== void 0 && Yo !== void 0 && e2.push({
7594
+ color: xo.accentColor,
7595
7595
  range: {
7596
- x: Yo,
7597
- y: Xo,
7596
+ x: Jo,
7597
+ y: Yo,
7598
7598
  width: 1,
7599
7599
  height: 1
7600
7600
  },
7601
7601
  style: "solid-outline"
7602
7602
  }), e2.length > 0 ? e2 : void 0;
7603
7603
  }, [
7604
- Go,
7605
- qo,
7604
+ Wo,
7605
+ Ko,
7606
+ Jo,
7606
7607
  Yo,
7607
- Xo,
7608
- Xr,
7609
- No.length,
7610
- So.accentColor,
7608
+ Yr,
7609
+ Mo.length,
7610
+ xo.accentColor,
7611
7611
  Q
7612
- ]), Qo = import_react.useRef(No);
7613
- Qo.current = No;
7614
- let $o = import_react.useCallback(([e2, t2], n2 = false) => {
7612
+ ]), Zo = import_react.useRef(Mo);
7613
+ Zo.current = Mo;
7614
+ let Qo = import_react.useCallback(([e2, t2], n2 = false) => {
7615
7615
  var _a3, _b2, _c3, _d, _e, _f, _g;
7616
- let r2 = eo && t2 === Uo - 1;
7617
- if (e2 === 0 && $a) {
7616
+ let r2 = $a && t2 === Ho - 1;
7617
+ if (e2 === 0 && Qa) {
7618
7618
  if (r2) return loadingCell;
7619
- let e3 = Ha(t2);
7619
+ let e3 = Va(t2);
7620
7620
  return e3 === void 0 ? loadingCell : {
7621
7621
  kind: InnerGridCellKind.Marker,
7622
7622
  allowOverlay: false,
7623
- checkboxStyle: Ia,
7623
+ checkboxStyle: Fa,
7624
7624
  checked: ($ == null ? void 0 : $.rows.hasIndex(t2)) === true,
7625
- markerKind: Ta === "clickable-number" ? "number" : Ta,
7626
- row: Da + e3,
7627
- drawHandle: ia !== void 0,
7628
- cursor: Ta === "clickable-number" ? "pointer" : void 0
7625
+ markerKind: wa === "clickable-number" ? "number" : wa,
7626
+ row: Ea + e3,
7627
+ drawHandle: ra !== void 0,
7628
+ cursor: wa === "clickable-number" ? "pointer" : void 0
7629
7629
  };
7630
7630
  } else if (r2) {
7631
- let t3 = e2 === Q ? (Ii == null ? void 0 : Ii.hint) ?? "" : "", n3 = Qo.current[e2];
7631
+ let t3 = e2 === Q ? (Fi == null ? void 0 : Fi.hint) ?? "" : "", n3 = Zo.current[e2];
7632
7632
  if (((_a3 = n3 == null ? void 0 : n3.trailingRowOptions) == null ? void 0 : _a3.disabled) === true) return loadingCell;
7633
7633
  {
7634
- let e3 = ((_b2 = n3 == null ? void 0 : n3.trailingRowOptions) == null ? void 0 : _b2.hint) ?? t3, r3 = ((_c3 = n3 == null ? void 0 : n3.trailingRowOptions) == null ? void 0 : _c3.addIcon) ?? (Ii == null ? void 0 : Ii.addIcon);
7634
+ let e3 = ((_b2 = n3 == null ? void 0 : n3.trailingRowOptions) == null ? void 0 : _b2.hint) ?? t3, r3 = ((_c3 = n3 == null ? void 0 : n3.trailingRowOptions) == null ? void 0 : _c3.addIcon) ?? (Fi == null ? void 0 : Fi.addIcon);
7635
7635
  return {
7636
7636
  kind: InnerGridCellKind.NewRow,
7637
7637
  hint: e3,
@@ -7641,8 +7641,8 @@ let __tla = (async () => {
7641
7641
  }
7642
7642
  } else {
7643
7643
  let r3 = e2 - Q;
7644
- if (n2 || (Xi == null ? void 0 : Xi.strict) === true) {
7645
- let e3 = Po.current, n3 = e3.x > r3 || r3 > e3.x + e3.width || e3.y > t2 || t2 > e3.y + e3.height || t2 >= ss.current, i3 = r3 === ((_e = (_d = e3.extras) == null ? void 0 : _d.selected) == null ? void 0 : _e[0]) && t2 === ((_f = e3.extras) == null ? void 0 : _f.selected[1]), a2 = false;
7644
+ if (n2 || (Yi == null ? void 0 : Yi.strict) === true) {
7645
+ let e3 = No.current, n3 = e3.x > r3 || r3 > e3.x + e3.width || e3.y > t2 || t2 > e3.y + e3.height || t2 >= os.current, i3 = r3 === ((_e = (_d = e3.extras) == null ? void 0 : _d.selected) == null ? void 0 : _e[0]) && t2 === ((_f = e3.extras) == null ? void 0 : _f.selected[1]), a2 = false;
7646
7646
  if (((_g = e3.extras) == null ? void 0 : _g.freezeRegions) !== void 0) {
7647
7647
  for (let n4 of e3.extras.freezeRegions) if (pointInRect(n4, r3, t2)) {
7648
7648
  a2 = true;
@@ -7664,25 +7664,25 @@ let __tla = (async () => {
7664
7664
  }), i2;
7665
7665
  }
7666
7666
  }, [
7667
- eo,
7668
- Uo,
7669
7667
  $a,
7670
- Ha,
7671
- Ia,
7668
+ Ho,
7669
+ Qa,
7670
+ Va,
7671
+ Fa,
7672
7672
  $ == null ? void 0 : $.rows,
7673
- Ta,
7674
- Da,
7675
- ia,
7673
+ wa,
7674
+ Ea,
7675
+ ra,
7676
7676
  Q,
7677
- Ii == null ? void 0 : Ii.hint,
7678
- Ii == null ? void 0 : Ii.addIcon,
7679
- Xi == null ? void 0 : Xi.strict,
7677
+ Fi == null ? void 0 : Fi.hint,
7678
+ Fi == null ? void 0 : Fi.addIcon,
7679
+ Yi == null ? void 0 : Yi.strict,
7680
7680
  E
7681
- ]), es = import_react.useCallback((e2) => {
7682
- let t2 = (Si == null ? void 0 : Si(e2)) ?? {
7681
+ ]), $o = import_react.useCallback((e2) => {
7682
+ let t2 = (xi == null ? void 0 : xi(e2)) ?? {
7683
7683
  name: e2
7684
7684
  };
7685
- return Rr !== void 0 && e2 !== "" && (t2 = {
7685
+ return Lr !== void 0 && e2 !== "" && (t2 = {
7686
7686
  icon: t2.icon,
7687
7687
  name: t2.name,
7688
7688
  overrideTheme: t2.overrideTheme,
@@ -7691,7 +7691,7 @@ let __tla = (async () => {
7691
7691
  {
7692
7692
  title: "Rename",
7693
7693
  icon: "renameIcon",
7694
- onClick: (e3) => Ss({
7694
+ onClick: (e3) => xs({
7695
7695
  group: t2.name,
7696
7696
  bounds: e3.bounds
7697
7697
  })
@@ -7699,24 +7699,24 @@ let __tla = (async () => {
7699
7699
  ]
7700
7700
  }), t2;
7701
7701
  }, [
7702
- Si,
7703
- Rr
7704
- ]), ts = import_react.useCallback((e2) => {
7702
+ xi,
7703
+ Lr
7704
+ ]), es = import_react.useCallback((e2) => {
7705
7705
  var _a3;
7706
- let [t2, n2] = e2.cell, r2 = No[t2], i2 = (r2 == null ? void 0 : r2.group) === void 0 ? void 0 : (_a3 = es(r2.group)) == null ? void 0 : _a3.overrideTheme, o2 = r2 == null ? void 0 : r2.themeOverride, s2 = Wa == null ? void 0 : Wa(n2);
7706
+ let [t2, n2] = e2.cell, r2 = Mo[t2], i2 = (r2 == null ? void 0 : r2.group) === void 0 ? void 0 : (_a3 = $o(r2.group)) == null ? void 0 : _a3.overrideTheme, o2 = r2 == null ? void 0 : r2.themeOverride, s2 = Ua == null ? void 0 : Ua(n2);
7707
7707
  a({
7708
7708
  ...e2,
7709
- theme: mergeAndRealizeTheme(So, i2, o2, s2, e2.content.themeOverride)
7709
+ theme: mergeAndRealizeTheme(xo, i2, o2, s2, e2.content.themeOverride)
7710
7710
  });
7711
7711
  }, [
7712
- Wa,
7713
- No,
7714
- es,
7715
- So
7716
- ]), ns = import_react.useCallback((e2, t2, n2) => {
7712
+ Ua,
7713
+ Mo,
7714
+ $o,
7715
+ xo
7716
+ ]), ts = import_react.useCallback((e2, t2, n2) => {
7717
7717
  var _a3;
7718
7718
  if ($.current === void 0) return;
7719
- let [r2, i2] = $.current.cell, a2 = $o([
7719
+ let [r2, i2] = $.current.cell, a2 = Qo([
7720
7720
  r2,
7721
7721
  i2
7722
7722
  ]);
@@ -7740,7 +7740,7 @@ let __tla = (async () => {
7740
7740
  };
7741
7741
  break;
7742
7742
  }
7743
- ts({
7743
+ es({
7744
7744
  target: e2,
7745
7745
  content: t3,
7746
7746
  initialValue: n2,
@@ -7751,7 +7751,7 @@ let __tla = (async () => {
7751
7751
  highlight: n2 === void 0,
7752
7752
  forceEditMode: n2 !== void 0
7753
7753
  });
7754
- } else a2.kind === GridCellKind.Boolean && t2 && a2.readonly !== true && (Wo([
7754
+ } else a2.kind === GridCellKind.Boolean && t2 && a2.readonly !== true && (Uo([
7755
7755
  {
7756
7756
  location: $.current.cell,
7757
7757
  value: {
@@ -7759,25 +7759,25 @@ let __tla = (async () => {
7759
7759
  data: toggleBoolean(a2.data)
7760
7760
  }
7761
7761
  }
7762
- ]), (_a3 = Vo.current) == null ? void 0 : _a3.damage([
7762
+ ]), (_a3 = Bo.current) == null ? void 0 : _a3.damage([
7763
7763
  {
7764
7764
  cell: $.current.cell
7765
7765
  }
7766
7766
  ]));
7767
7767
  }, [
7768
- $o,
7768
+ Qo,
7769
7769
  $,
7770
- Wo,
7771
- ts
7772
- ]), rs = import_react.useCallback((e2, t2) => {
7770
+ Uo,
7771
+ es
7772
+ ]), ns = import_react.useCallback((e2, t2) => {
7773
7773
  var _a3;
7774
- let n2 = (_a3 = Vo.current) == null ? void 0 : _a3.getBounds(e2, t2);
7775
- if (n2 === void 0 || Ro.current === null) return;
7776
- let r2 = $o([
7774
+ let n2 = (_a3 = Bo.current) == null ? void 0 : _a3.getBounds(e2, t2);
7775
+ if (n2 === void 0 || Lo.current === null) return;
7776
+ let r2 = Qo([
7777
7777
  e2,
7778
7778
  t2
7779
7779
  ]);
7780
- r2.allowOverlay && ts({
7780
+ r2.allowOverlay && es({
7781
7781
  target: n2,
7782
7782
  content: r2,
7783
7783
  initialValue: void 0,
@@ -7789,12 +7789,12 @@ let __tla = (async () => {
7789
7789
  forceEditMode: true
7790
7790
  });
7791
7791
  }, [
7792
- $o,
7793
- Ro,
7794
- ts
7795
- ]), is = import_react.useCallback((e2, t2, n2 = "both", r2 = 0, i2 = 0, a2 = void 0) => {
7796
- if (Ro.current !== null) {
7797
- let o2 = Vo.current, c2 = s.current, l2 = typeof e2 == "number" ? e2 : e2.unit === "cell" ? e2.amount : void 0, u2 = typeof t2 == "number" ? t2 : t2.unit === "cell" ? t2.amount : void 0, f2 = typeof e2 != "number" && e2.unit === "px" ? e2.amount : void 0, m2 = typeof t2 != "number" && t2.unit === "px" ? t2.amount : void 0;
7792
+ Qo,
7793
+ Lo,
7794
+ es
7795
+ ]), rs = import_react.useCallback((e2, t2, n2 = "both", r2 = 0, i2 = 0, a2 = void 0) => {
7796
+ if (Lo.current !== null) {
7797
+ let o2 = Bo.current, c2 = s.current, l2 = typeof e2 == "number" ? e2 : e2.unit === "cell" ? e2.amount : void 0, u2 = typeof t2 == "number" ? t2 : t2.unit === "cell" ? t2.amount : void 0, f2 = typeof e2 != "number" && e2.unit === "px" ? e2.amount : void 0, m2 = typeof t2 != "number" && t2.unit === "px" ? t2.amount : void 0;
7798
7798
  if (o2 !== null && c2 !== null) {
7799
7799
  let s2 = {
7800
7800
  x: 0,
@@ -7806,11 +7806,11 @@ let __tla = (async () => {
7806
7806
  let y2 = c2.getBoundingClientRect(), x2 = y2.width / c2.offsetWidth;
7807
7807
  if (f2 !== void 0 && (s2 = {
7808
7808
  ...s2,
7809
- x: f2 - y2.left - Ro.current.scrollLeft,
7809
+ x: f2 - y2.left - Lo.current.scrollLeft,
7810
7810
  width: 1
7811
7811
  }), m2 !== void 0 && (s2 = {
7812
7812
  ...s2,
7813
- y: m2 + y2.top - Ro.current.scrollTop,
7813
+ y: m2 + y2.top - Lo.current.scrollTop,
7814
7814
  height: 1
7815
7815
  }), s2 !== void 0) {
7816
7816
  let o3 = {
@@ -7819,10 +7819,10 @@ let __tla = (async () => {
7819
7819
  width: s2.width + 2 * r2,
7820
7820
  height: s2.height + 2 * i2
7821
7821
  }, c3 = 0;
7822
- for (let e3 = 0; e3 < hi; e3++) c3 += Do[e3].width;
7823
- let l3 = 0, u3 = Li + (to ? 1 : 0);
7824
- u3 > 0 && (l3 = getFreezeTrailingHeight(Uo, u3, Ga));
7825
- let f3 = c3 * x2 + y2.left + Q * Qa * x2, m3 = y2.right, S2 = y2.top + Ao * x2, C2 = y2.bottom - l3 * x2, E2 = s2.width + r2 * 2;
7822
+ for (let e3 = 0; e3 < mi; e3++) c3 += Eo[e3].width;
7823
+ let l3 = 0, u3 = Ii + (eo ? 1 : 0);
7824
+ u3 > 0 && (l3 = getFreezeTrailingHeight(Ho, u3, Wa));
7825
+ let f3 = c3 * x2 + y2.left + Q * Za * x2, m3 = y2.right, S2 = y2.top + ko * x2, C2 = y2.bottom - l3 * x2, E2 = s2.width + r2 * 2;
7826
7826
  switch (a2 == null ? void 0 : a2.hAlign) {
7827
7827
  case "start":
7828
7828
  m3 = f3 + E2;
@@ -7846,35 +7846,35 @@ let __tla = (async () => {
7846
7846
  S2 = Math.floor((S2 + C2) / 2) - D2 / 2, C2 = S2 + D2;
7847
7847
  break;
7848
7848
  }
7849
- f3 > o3.x ? h2 = o3.x - f3 : m3 < o3.x + o3.width && (h2 = o3.x + o3.width - m3), S2 > o3.y ? g2 = o3.y - S2 : C2 < o3.y + o3.height && (g2 = o3.y + o3.height - C2), n2 === "vertical" || typeof e2 == "number" && e2 < hi ? h2 = 0 : (n2 === "horizontal" || typeof t2 == "number" && t2 >= Uo - u3) && (g2 = 0), (h2 !== 0 || g2 !== 0) && (x2 !== 1 && (h2 /= x2, g2 /= x2), Ro.current.scrollTo(h2 + Ro.current.scrollLeft, g2 + Ro.current.scrollTop));
7849
+ f3 > o3.x ? h2 = o3.x - f3 : m3 < o3.x + o3.width && (h2 = o3.x + o3.width - m3), S2 > o3.y ? g2 = o3.y - S2 : C2 < o3.y + o3.height && (g2 = o3.y + o3.height - C2), n2 === "vertical" || typeof e2 == "number" && e2 < mi ? h2 = 0 : (n2 === "horizontal" || typeof t2 == "number" && t2 >= Ho - u3) && (g2 = 0), (h2 !== 0 || g2 !== 0) && (x2 !== 1 && (h2 /= x2, g2 /= x2), Lo.current.scrollTo(h2 + Lo.current.scrollLeft, g2 + Lo.current.scrollTop));
7850
7850
  }
7851
7851
  }
7852
7852
  }
7853
7853
  }, [
7854
7854
  Q,
7855
- Li,
7856
- Qa,
7857
- Ro,
7858
- Ao,
7859
- hi,
7860
- Do,
7861
- Uo,
7862
- to,
7863
- Ga
7864
- ]), as = import_react.useRef(rs), os = import_react.useRef(E), ss = import_react.useRef(Z);
7865
- as.current = rs, os.current = E, ss.current = Z;
7866
- let cs = import_react.useCallback(async (e2, t2 = true) => {
7855
+ Ii,
7856
+ Za,
7857
+ Lo,
7858
+ ko,
7859
+ mi,
7860
+ Eo,
7861
+ Ho,
7862
+ eo,
7863
+ Wa
7864
+ ]), is = import_react.useRef(ns), as = import_react.useRef(E), os = import_react.useRef(Z);
7865
+ is.current = ns, as.current = E, os.current = Z;
7866
+ let ss = import_react.useCallback(async (e2, t2 = true) => {
7867
7867
  var _a3, _b2;
7868
- if (((_b2 = (_a3 = No[e2]) == null ? void 0 : _a3.trailingRowOptions) == null ? void 0 : _b2.disabled) === true) return;
7868
+ if (((_b2 = (_a3 = Mo[e2]) == null ? void 0 : _a3.trailingRowOptions) == null ? void 0 : _b2.disabled) === true) return;
7869
7869
  let n2 = J == null ? void 0 : J(), r2, i2 = true;
7870
7870
  n2 !== void 0 && (r2 = await n2, r2 === "top" && (i2 = false), typeof r2 == "number" && (i2 = false));
7871
7871
  let a2 = 0, o2 = () => {
7872
- if (ss.current <= Z) {
7872
+ if (os.current <= Z) {
7873
7873
  a2 < 500 && window.setTimeout(o2, a2), a2 = 50 + a2 * 2;
7874
7874
  return;
7875
7875
  }
7876
7876
  let n3 = typeof r2 == "number" ? r2 : i2 ? Z : 0;
7877
- oc.current(e2 - Q, n3), yo({
7877
+ ac.current(e2 - Q, n3), vo({
7878
7878
  cell: [
7879
7879
  e2,
7880
7880
  n3
@@ -7886,55 +7886,55 @@ let __tla = (async () => {
7886
7886
  height: 1
7887
7887
  }
7888
7888
  }, false, false, "edit");
7889
- let s2 = os.current([
7889
+ let s2 = as.current([
7890
7890
  e2 - Q,
7891
7891
  n3
7892
7892
  ]);
7893
7893
  s2.allowOverlay && isReadWriteCell(s2) && s2.readonly !== true && t2 && window.setTimeout(() => {
7894
- as.current(e2, n3);
7894
+ is.current(e2, n3);
7895
7895
  }, 0);
7896
7896
  };
7897
7897
  o2();
7898
7898
  }, [
7899
- No,
7899
+ Mo,
7900
7900
  J,
7901
7901
  Q,
7902
7902
  Z,
7903
- yo
7904
- ]), ls = import_react.useCallback((e2) => {
7903
+ vo
7904
+ ]), cs = import_react.useCallback((e2) => {
7905
7905
  var _a3, _b2;
7906
- let t2 = ((_b2 = (_a3 = Do[e2]) == null ? void 0 : _a3.trailingRowOptions) == null ? void 0 : _b2.targetColumn) ?? (Ii == null ? void 0 : Ii.targetColumn);
7907
- if (typeof t2 == "number") return t2 + ($a ? 1 : 0);
7906
+ let t2 = ((_b2 = (_a3 = Eo[e2]) == null ? void 0 : _a3.trailingRowOptions) == null ? void 0 : _b2.targetColumn) ?? (Fi == null ? void 0 : Fi.targetColumn);
7907
+ if (typeof t2 == "number") return t2 + (Qa ? 1 : 0);
7908
7908
  if (typeof t2 == "object") {
7909
7909
  let e3 = S.indexOf(t2);
7910
- if (e3 >= 0) return e3 + ($a ? 1 : 0);
7910
+ if (e3 >= 0) return e3 + (Qa ? 1 : 0);
7911
7911
  }
7912
7912
  }, [
7913
- Do,
7913
+ Eo,
7914
7914
  S,
7915
- $a,
7916
- Ii == null ? void 0 : Ii.targetColumn
7917
- ]), us = import_react.useRef(), ds = import_react.useRef(), fs = import_react.useCallback((e2, t2) => {
7915
+ Qa,
7916
+ Fi == null ? void 0 : Fi.targetColumn
7917
+ ]), ls = import_react.useRef(), us = import_react.useRef(), ds = import_react.useCallback((e2, t2) => {
7918
7918
  var _a3;
7919
7919
  let [n2, r2] = t2;
7920
- return mergeAndRealizeTheme(So, (_a3 = No[n2]) == null ? void 0 : _a3.themeOverride, Wa == null ? void 0 : Wa(r2), e2.themeOverride);
7920
+ return mergeAndRealizeTheme(xo, (_a3 = Mo[n2]) == null ? void 0 : _a3.themeOverride, Ua == null ? void 0 : Ua(r2), e2.themeOverride);
7921
7921
  }, [
7922
- Wa,
7923
- No,
7924
- So
7925
- ]), { mapper: ps } = useRowGrouping(Ci, C), ms = Ci == null ? void 0 : Ci.navigationBehavior, hs = import_react.useCallback((e2) => {
7922
+ Ua,
7923
+ Mo,
7924
+ xo
7925
+ ]), { mapper: fs } = useRowGrouping(Ci, C), ps = Ci == null ? void 0 : Ci.navigationBehavior, ms = import_react.useCallback((e2) => {
7926
7926
  var _a3, _b2, _c3;
7927
- let t2 = browserIsOSX.value ? e2.metaKey : e2.ctrlKey, n2 = t2 && X === "multi", r2 = t2 && Zr === "multi", [i2, o2] = e2.location, s2 = $.columns, c2 = $.rows, [l2, u2] = ((_a3 = $.current) == null ? void 0 : _a3.cell) ?? [];
7927
+ let t2 = browserIsOSX.value ? e2.metaKey : e2.ctrlKey, n2 = t2 && X === "multi", r2 = t2 && Xr === "multi", [i2, o2] = e2.location, s2 = $.columns, c2 = $.rows, [l2, u2] = ((_a3 = $.current) == null ? void 0 : _a3.cell) ?? [];
7928
7928
  if (e2.kind === "cell") {
7929
- if (ds.current = void 0, _s.current = [
7929
+ if (us.current = void 0, gs.current = [
7930
7930
  i2,
7931
7931
  o2
7932
- ], i2 === 0 && $a) {
7933
- if (eo === true && o2 === Z || Ta === "number" || X === "none") return;
7934
- let r3 = $o(e2.location);
7932
+ ], i2 === 0 && Qa) {
7933
+ if ($a === true && o2 === Z || wa === "number" || X === "none") return;
7934
+ let r3 = Qo(e2.location);
7935
7935
  if (r3.kind !== InnerGridCellKind.Marker) return;
7936
- if (ia !== void 0) {
7937
- let t3 = Eo(r3);
7936
+ if (ra !== void 0) {
7937
+ let t3 = To(r3);
7938
7938
  assert((t3 == null ? void 0 : t3.kind) === InnerGridCellKind.Marker);
7939
7939
  let n3 = (_b2 = t3 == null ? void 0 : t3.onClick) == null ? void 0 : _b2.call(t3, {
7940
7940
  ...e2,
@@ -7942,23 +7942,23 @@ let __tla = (async () => {
7942
7942
  posX: e2.localEventX,
7943
7943
  posY: e2.localEventY,
7944
7944
  bounds: e2.bounds,
7945
- theme: fs(r3, e2.location),
7945
+ theme: ds(r3, e2.location),
7946
7946
  preventDefault: () => void 0
7947
7947
  });
7948
7948
  if (n3 === void 0 || n3.checked === r3.checked) return;
7949
7949
  }
7950
- a(void 0), Ho();
7951
- let i3 = c2.hasIndex(o2), s3 = us.current;
7950
+ a(void 0), Vo();
7951
+ let i3 = c2.hasIndex(o2), s3 = ls.current;
7952
7952
  if (X === "multi" && (e2.shiftKey || e2.isLongTouch === true) && s3 !== void 0 && c2.hasIndex(s3)) {
7953
7953
  let e3 = [
7954
7954
  Math.min(s3, o2),
7955
7955
  Math.max(s3, o2) + 1
7956
7956
  ];
7957
- n2 || vi === "multi" ? bo(void 0, e3, true) : bo(CompactSelection.fromSingleSelection(e3), void 0, n2);
7958
- } else X === "multi" && (n2 || e2.isTouch || vi === "multi") ? i3 ? bo(c2.remove(o2), void 0, true) : (bo(void 0, o2, true), us.current = o2) : i3 && c2.length === 1 ? bo(CompactSelection.empty(), void 0, t2) : (bo(CompactSelection.fromSingleSelection(o2), void 0, t2), us.current = o2);
7959
- } else if (i2 >= Q && eo && o2 === Z) cs(ls(i2) ?? i2);
7957
+ n2 || _i === "multi" ? yo(void 0, e3, true) : yo(CompactSelection.fromSingleSelection(e3), void 0, n2);
7958
+ } else X === "multi" && (n2 || e2.isTouch || _i === "multi") ? i3 ? yo(c2.remove(o2), void 0, true) : (yo(void 0, o2, true), ls.current = o2) : i3 && c2.length === 1 ? yo(CompactSelection.empty(), void 0, t2) : (yo(CompactSelection.fromSingleSelection(o2), void 0, t2), ls.current = o2);
7959
+ } else if (i2 >= Q && $a && o2 === Z) ss(cs(i2) ?? i2);
7960
7960
  else if (l2 !== i2 || u2 !== o2) {
7961
- let n3 = $o(e2.location), r3 = Eo(n3);
7961
+ let n3 = Qo(e2.location), r3 = To(n3);
7962
7962
  if ((r3 == null ? void 0 : r3.onSelect) !== void 0) {
7963
7963
  let t3 = false;
7964
7964
  if (r3.onSelect({
@@ -7968,15 +7968,15 @@ let __tla = (async () => {
7968
7968
  posY: e2.localEventY,
7969
7969
  bounds: e2.bounds,
7970
7970
  preventDefault: () => t3 = true,
7971
- theme: fs(n3, e2.location)
7971
+ theme: ds(n3, e2.location)
7972
7972
  }), t3) return;
7973
7973
  }
7974
- if (ms === "block" && ps(o2).isGroupHeader) return;
7975
- let s3 = to && o2 === Z, c3 = to && $ !== void 0 && ((_c3 = $.current) == null ? void 0 : _c3.cell[1]) === Z;
7974
+ if (ps === "block" && fs(o2).isGroupHeader) return;
7975
+ let s3 = eo && o2 === Z, c3 = eo && $ !== void 0 && ((_c3 = $.current) == null ? void 0 : _c3.cell[1]) === Z;
7976
7976
  if ((e2.shiftKey || e2.isLongTouch === true) && l2 !== void 0 && u2 !== void 0 && $.current !== void 0 && !c3) {
7977
7977
  if (s3) return;
7978
7978
  let e3 = Math.min(i2, l2), n4 = Math.max(i2, l2), r4 = Math.min(o2, u2), a2 = Math.max(o2, u2);
7979
- yo({
7979
+ vo({
7980
7980
  ...$.current,
7981
7981
  range: {
7982
7982
  x: e3,
@@ -7984,8 +7984,8 @@ let __tla = (async () => {
7984
7984
  width: n4 - e3 + 1,
7985
7985
  height: a2 - r4 + 1
7986
7986
  }
7987
- }, true, t2, "click"), us.current = void 0, Ho();
7988
- } else yo({
7987
+ }, true, t2, "click"), ls.current = void 0, Vo();
7988
+ } else vo({
7989
7989
  cell: [
7990
7990
  i2,
7991
7991
  o2
@@ -7996,135 +7996,135 @@ let __tla = (async () => {
7996
7996
  width: 1,
7997
7997
  height: 1
7998
7998
  }
7999
- }, true, t2, "click"), us.current = void 0, a(void 0), Ho();
7999
+ }, true, t2, "click"), ls.current = void 0, a(void 0), Vo();
8000
8000
  }
8001
- } else if (e2.kind === "header") if (_s.current = [
8001
+ } else if (e2.kind === "header") if (gs.current = [
8002
8002
  i2,
8003
8003
  o2
8004
- ], a(void 0), $a && i2 === 0) us.current = void 0, ds.current = void 0, X === "multi" && (c2.length === Z ? bo(CompactSelection.empty(), void 0, t2) : bo(CompactSelection.fromSingleSelection([
8004
+ ], a(void 0), Qa && i2 === 0) ls.current = void 0, us.current = void 0, X === "multi" && (c2.length === Z ? yo(CompactSelection.empty(), void 0, t2) : yo(CompactSelection.fromSingleSelection([
8005
8005
  0,
8006
8006
  Z
8007
- ]), void 0, t2), Ho());
8007
+ ]), void 0, t2), Vo());
8008
8008
  else {
8009
- let n3 = ds.current;
8010
- if (Zr === "multi" && (e2.shiftKey || e2.isLongTouch === true) && n3 !== void 0 && s2.hasIndex(n3)) {
8009
+ let n3 = us.current;
8010
+ if (Xr === "multi" && (e2.shiftKey || e2.isLongTouch === true) && n3 !== void 0 && s2.hasIndex(n3)) {
8011
8011
  let e3 = [
8012
8012
  Math.min(n3, i2),
8013
8013
  Math.max(n3, i2) + 1
8014
8014
  ];
8015
- r2 ? xo(void 0, e3, t2) : xo(CompactSelection.fromSingleSelection(e3), void 0, t2);
8016
- } else r2 ? (s2.hasIndex(i2) ? xo(s2.remove(i2), void 0, t2) : xo(void 0, i2, t2), ds.current = i2) : Zr !== "none" && (xo(CompactSelection.fromSingleSelection(i2), void 0, t2), ds.current = i2);
8017
- us.current = void 0, Ho();
8015
+ r2 ? bo(void 0, e3, t2) : bo(CompactSelection.fromSingleSelection(e3), void 0, t2);
8016
+ } else r2 ? (s2.hasIndex(i2) ? bo(s2.remove(i2), void 0, t2) : bo(void 0, i2, t2), us.current = i2) : Xr !== "none" && (bo(CompactSelection.fromSingleSelection(i2), void 0, t2), us.current = i2);
8017
+ ls.current = void 0, Vo();
8018
8018
  }
8019
- else e2.kind === "group-header" ? _s.current = [
8019
+ else e2.kind === "group-header" ? gs.current = [
8020
8020
  i2,
8021
8021
  o2
8022
- ] : e2.kind === "out-of-bounds" && !e2.isMaybeScrollbar && (fo(emptyGridSelection, false), a(void 0), Ho(), Di == null ? void 0 : Di(), us.current = void 0, ds.current = void 0);
8022
+ ] : e2.kind === "out-of-bounds" && !e2.isMaybeScrollbar && (uo(emptyGridSelection, false), a(void 0), Vo(), Ei == null ? void 0 : Ei(), ls.current = void 0, us.current = void 0);
8023
8023
  }, [
8024
8024
  X,
8025
- Zr,
8025
+ Xr,
8026
8026
  $,
8027
- $a,
8027
+ Qa,
8028
8028
  Q,
8029
- eo,
8029
+ $a,
8030
8030
  Z,
8031
- Ta,
8032
- $o,
8033
- ia,
8034
- Ho,
8035
- vi,
8036
- Eo,
8037
- fs,
8038
- bo,
8039
- ls,
8031
+ wa,
8032
+ Qo,
8033
+ ra,
8034
+ Vo,
8035
+ _i,
8036
+ To,
8037
+ ds,
8038
+ yo,
8040
8039
  cs,
8041
- ms,
8040
+ ss,
8042
8041
  ps,
8043
- to,
8044
- yo,
8045
- xo,
8046
- fo,
8047
- Di
8048
- ]), gs = import_react.useRef(false), _s = import_react.useRef(), vs = import_react.useRef(Lo), ys = import_react.useRef(), bs = import_react.useCallback((e2) => {
8049
- if (ws.current = false, vs.current = Po.current, e2.button !== 0 && e2.button !== 1) {
8050
- ys.current = void 0;
8042
+ fs,
8043
+ eo,
8044
+ vo,
8045
+ bo,
8046
+ uo,
8047
+ Ei
8048
+ ]), hs = import_react.useRef(false), gs = import_react.useRef(), _s = import_react.useRef(Io), vs = import_react.useRef(), ys = import_react.useCallback((e2) => {
8049
+ if (Cs.current = false, _s.current = No.current, e2.button !== 0 && e2.button !== 1) {
8050
+ vs.current = void 0;
8051
8051
  return;
8052
8052
  }
8053
8053
  let t2 = performance.now();
8054
- ys.current = {
8054
+ vs.current = {
8055
8055
  button: e2.button,
8056
8056
  time: t2,
8057
8057
  location: e2.location
8058
- }, (e2 == null ? void 0 : e2.kind) === "header" && (gs.current = true);
8058
+ }, (e2 == null ? void 0 : e2.kind) === "header" && (hs.current = true);
8059
8059
  let n2 = e2.kind === "cell" && e2.isFillHandle;
8060
8060
  !n2 && e2.kind !== "cell" && e2.isEdge || (l({
8061
8061
  previousSelection: $,
8062
8062
  fillHandle: n2
8063
- }), _s.current = void 0, !e2.isTouch && e2.button === 0 && !n2 ? hs(e2) : !e2.isTouch && e2.button === 1 && (_s.current = e2.location));
8063
+ }), gs.current = void 0, !e2.isTouch && e2.button === 0 && !n2 ? ms(e2) : !e2.isTouch && e2.button === 1 && (gs.current = e2.location));
8064
8064
  }, [
8065
8065
  $,
8066
- hs
8067
- ]), [xs, Ss] = import_react.useState(), Cs = import_react.useCallback((e2) => {
8068
- if (e2.kind !== "group-header" || Zr !== "multi") return;
8066
+ ms
8067
+ ]), [bs, xs] = import_react.useState(), Ss = import_react.useCallback((e2) => {
8068
+ if (e2.kind !== "group-header" || Xr !== "multi") return;
8069
8069
  let t2 = browserIsOSX.value ? e2.metaKey : e2.ctrlKey, [n2] = e2.location, r2 = $.columns;
8070
8070
  if (n2 < Q) return;
8071
- let i2 = No[n2], a2 = n2, o2 = n2;
8072
- for (let e3 = n2 - 1; e3 >= Q && isGroupEqual(i2.group, No[e3].group); e3--) a2--;
8073
- for (let e3 = n2 + 1; e3 < No.length && isGroupEqual(i2.group, No[e3].group); e3++) o2++;
8074
- if (Ho(), t2) if (r2.hasAll([
8071
+ let i2 = Mo[n2], a2 = n2, o2 = n2;
8072
+ for (let e3 = n2 - 1; e3 >= Q && isGroupEqual(i2.group, Mo[e3].group); e3--) a2--;
8073
+ for (let e3 = n2 + 1; e3 < Mo.length && isGroupEqual(i2.group, Mo[e3].group); e3++) o2++;
8074
+ if (Vo(), t2) if (r2.hasAll([
8075
8075
  a2,
8076
8076
  o2 + 1
8077
8077
  ])) {
8078
8078
  let e3 = r2;
8079
8079
  for (let t3 = a2; t3 <= o2; t3++) e3 = e3.remove(t3);
8080
- xo(e3, void 0, t2);
8081
- } else xo(void 0, [
8080
+ bo(e3, void 0, t2);
8081
+ } else bo(void 0, [
8082
8082
  a2,
8083
8083
  o2 + 1
8084
8084
  ], t2);
8085
- else xo(CompactSelection.fromSingleSelection([
8085
+ else bo(CompactSelection.fromSingleSelection([
8086
8086
  a2,
8087
8087
  o2 + 1
8088
8088
  ]), void 0, t2);
8089
8089
  }, [
8090
- Zr,
8091
- Ho,
8090
+ Xr,
8091
+ Vo,
8092
8092
  $.columns,
8093
- No,
8093
+ Mo,
8094
8094
  Q,
8095
- xo
8096
- ]), ws = import_react.useRef(false), Ts = import_react.useCallback(async (e2) => {
8097
- if (so !== void 0 && po !== void 0) {
8098
- let t2 = Po.current.y, n2 = Po.current.height, r2 = so({
8095
+ bo
8096
+ ]), Cs = import_react.useRef(false), ws = import_react.useCallback(async (e2) => {
8097
+ if (oo !== void 0 && fo !== void 0) {
8098
+ let t2 = No.current.y, n2 = No.current.height, r2 = oo({
8099
8099
  x: e2,
8100
8100
  y: t2,
8101
8101
  width: 1,
8102
8102
  height: Math.min(n2, Z - t2)
8103
- }, oo.current.signal);
8103
+ }, ao.current.signal);
8104
8104
  typeof r2 != "object" && (r2 = await r2());
8105
- let i2 = Do[e2 - Q], a2 = document.createElement("canvas").getContext("2d", {
8105
+ let i2 = Eo[e2 - Q], a2 = document.createElement("canvas").getContext("2d", {
8106
8106
  alpha: false
8107
8107
  });
8108
8108
  if (a2 !== null) {
8109
- a2.font = So.baseFontFull;
8110
- let t3 = measureColumn(a2, So, i2, 0, r2, La, Ra, false, Eo);
8111
- po == null ? void 0 : po(i2, t3.width, e2, t3.width);
8109
+ a2.font = xo.baseFontFull;
8110
+ let t3 = measureColumn(a2, xo, i2, 0, r2, Ia, La, false, To);
8111
+ fo == null ? void 0 : fo(i2, t3.width, e2, t3.width);
8112
8112
  }
8113
8113
  }
8114
8114
  }, [
8115
- Do,
8116
- so,
8117
- Ra,
8118
- So,
8115
+ Eo,
8116
+ oo,
8119
8117
  La,
8120
- po,
8118
+ xo,
8119
+ Ia,
8120
+ fo,
8121
8121
  Q,
8122
8122
  Z,
8123
- Eo
8124
- ]), [Es, Ds] = import_react.useState(), Os = import_react.useCallback(async (e2, t2) => {
8123
+ To
8124
+ ]), [Ts, Es] = import_react.useState(), Ds = import_react.useCallback(async (e2, t2) => {
8125
8125
  var _a3, _b2;
8126
8126
  let n2 = (_a3 = e2.current) == null ? void 0 : _a3.range;
8127
- if (n2 === void 0 || so === void 0 || t2.current === void 0) return;
8127
+ if (n2 === void 0 || oo === void 0 || t2.current === void 0) return;
8128
8128
  let r2 = t2.current.range;
8129
8129
  if (k !== void 0) {
8130
8130
  let e3 = false;
@@ -8140,7 +8140,7 @@ let __tla = (async () => {
8140
8140
  preventDefault: () => e3 = true
8141
8141
  }), e3) return;
8142
8142
  }
8143
- let i2 = so(n2, oo.current.signal);
8143
+ let i2 = oo(n2, ao.current.signal);
8144
8144
  typeof i2 != "object" && (i2 = await i2());
8145
8145
  let a2 = i2, o2 = [];
8146
8146
  for (let e3 = 0; e3 < r2.width; e3++) for (let t3 = 0; t3 < r2.height; t3++) {
@@ -8157,16 +8157,16 @@ let __tla = (async () => {
8157
8157
  }
8158
8158
  });
8159
8159
  }
8160
- Wo(o2), (_b2 = Vo.current) == null ? void 0 : _b2.damage(o2.map((e3) => ({
8160
+ Uo(o2), (_b2 = Bo.current) == null ? void 0 : _b2.damage(o2.map((e3) => ({
8161
8161
  cell: e3.location
8162
8162
  })));
8163
8163
  }, [
8164
- so,
8165
- Wo,
8164
+ oo,
8165
+ Uo,
8166
8166
  k,
8167
8167
  Q
8168
- ]), ks = import_react.useCallback(() => {
8169
- $.current === void 0 || $.current.range.width <= 1 || Os({
8168
+ ]), Os = import_react.useCallback(() => {
8169
+ $.current === void 0 || $.current.range.width <= 1 || Ds({
8170
8170
  ...$,
8171
8171
  current: {
8172
8172
  ...$.current,
@@ -8177,10 +8177,10 @@ let __tla = (async () => {
8177
8177
  }
8178
8178
  }, $);
8179
8179
  }, [
8180
- Os,
8180
+ Ds,
8181
8181
  $
8182
- ]), As = import_react.useCallback(() => {
8183
- $.current === void 0 || $.current.range.height <= 1 || Os({
8182
+ ]), ks = import_react.useCallback(() => {
8183
+ $.current === void 0 || $.current.range.height <= 1 || Ds({
8184
8184
  ...$,
8185
8185
  current: {
8186
8186
  ...$.current,
@@ -8191,26 +8191,26 @@ let __tla = (async () => {
8191
8191
  }
8192
8192
  }, $);
8193
8193
  }, [
8194
- Os,
8194
+ Ds,
8195
8195
  $
8196
- ]), js = import_react.useCallback((e2, t2) => {
8196
+ ]), As = import_react.useCallback((e2, t2) => {
8197
8197
  var _a3, _b2;
8198
8198
  let n2 = c;
8199
- if (l(void 0), Ko(void 0), Ds(void 0), gs.current = false, t2) return;
8199
+ if (l(void 0), Go(void 0), Es(void 0), hs.current = false, t2) return;
8200
8200
  if ((n2 == null ? void 0 : n2.fillHandle) === true && $.current !== void 0 && ((_a3 = n2.previousSelection) == null ? void 0 : _a3.current) !== void 0) {
8201
- if (Go === void 0) return;
8201
+ if (Wo === void 0) return;
8202
8202
  let e3 = {
8203
8203
  ...$,
8204
8204
  current: {
8205
8205
  ...$.current,
8206
- range: combineRects(n2.previousSelection.current.range, Go)
8206
+ range: combineRects(n2.previousSelection.current.range, Wo)
8207
8207
  }
8208
8208
  };
8209
- Os(n2.previousSelection, e3), fo(e3, true);
8209
+ Ds(n2.previousSelection, e3), uo(e3, true);
8210
8210
  return;
8211
8211
  }
8212
- let [r2, i2] = e2.location, [a2, o2] = _s.current ?? [], s2 = () => {
8213
- ws.current = true;
8212
+ let [r2, i2] = e2.location, [a2, o2] = gs.current ?? [], s2 = () => {
8213
+ Cs.current = true;
8214
8214
  }, u2 = (t3) => {
8215
8215
  var _a4, _b3, _c3;
8216
8216
  let c2 = t3.isTouch || a2 === r2 && o2 === i2;
@@ -8220,9 +8220,9 @@ let __tla = (async () => {
8220
8220
  ], {
8221
8221
  ...t3,
8222
8222
  preventDefault: s2
8223
- })), t3.button === 1) return !ws.current;
8224
- if (!ws.current) {
8225
- let a3 = $o(e2.location), o3 = Eo(a3);
8223
+ })), t3.button === 1) return !Cs.current;
8224
+ if (!Cs.current) {
8225
+ let a3 = Qo(e2.location), o3 = To(a3);
8226
8226
  if (o3 !== void 0 && o3.onClick !== void 0 && c2) {
8227
8227
  let n3 = o3.onClick({
8228
8228
  ...t3,
@@ -8230,21 +8230,21 @@ let __tla = (async () => {
8230
8230
  posX: t3.localEventX,
8231
8231
  posY: t3.localEventY,
8232
8232
  bounds: t3.bounds,
8233
- theme: fs(a3, e2.location),
8233
+ theme: ds(a3, e2.location),
8234
8234
  preventDefault: s2
8235
8235
  });
8236
- n3 !== void 0 && !isInnerOnlyCell(n3) && isEditableGridCell(n3) && (Wo([
8236
+ n3 !== void 0 && !isInnerOnlyCell(n3) && isEditableGridCell(n3) && (Uo([
8237
8237
  {
8238
8238
  location: t3.location,
8239
8239
  value: n3
8240
8240
  }
8241
- ]), (_a4 = Vo.current) == null ? void 0 : _a4.damage([
8241
+ ]), (_a4 = Bo.current) == null ? void 0 : _a4.damage([
8242
8242
  {
8243
8243
  cell: t3.location
8244
8244
  }
8245
8245
  ]));
8246
8246
  }
8247
- if (ws.current || $.current === void 0) return false;
8247
+ if (Cs.current || $.current === void 0) return false;
8248
8248
  let l2 = false;
8249
8249
  switch (a3.activationBehaviorOverride ?? gi) {
8250
8250
  case "double-click":
@@ -8261,16 +8261,16 @@ let __tla = (async () => {
8261
8261
  if (l2) return O == null ? void 0 : O([
8262
8262
  r2 - Q,
8263
8263
  i2
8264
- ]), ns(t3.bounds, false), true;
8264
+ ]), ts(t3.bounds, false), true;
8265
8265
  }
8266
8266
  return false;
8267
8267
  }, f2 = e2.location[0] - Q;
8268
8268
  if (e2.isTouch) {
8269
- let t3 = Po.current, n3 = vs.current;
8269
+ let t3 = No.current, n3 = _s.current;
8270
8270
  if (t3.x !== n3.x || t3.y !== n3.y) return;
8271
8271
  if (e2.isLongTouch === true) {
8272
8272
  if (e2.kind === "cell" && itemsAreEqual((_b2 = $.current) == null ? void 0 : _b2.cell, e2.location)) {
8273
- Ir == null ? void 0 : Ir([
8273
+ Fr == null ? void 0 : Fr([
8274
8274
  f2,
8275
8275
  e2.location[1]
8276
8276
  ], {
@@ -8293,18 +8293,18 @@ let __tla = (async () => {
8293
8293
  return;
8294
8294
  }
8295
8295
  }
8296
- e2.kind === "cell" ? u2(e2) || hs(e2) : e2.kind === "group-header" ? B == null ? void 0 : B(f2, {
8296
+ e2.kind === "cell" ? u2(e2) || ms(e2) : e2.kind === "group-header" ? B == null ? void 0 : B(f2, {
8297
8297
  ...e2,
8298
8298
  preventDefault: s2
8299
8299
  }) : (e2.kind === "header" && (F == null ? void 0 : F(f2, {
8300
8300
  ...e2,
8301
8301
  preventDefault: s2
8302
- })), hs(e2));
8302
+ })), ms(e2));
8303
8303
  return;
8304
8304
  }
8305
8305
  if (e2.kind === "header") {
8306
8306
  if (f2 < 0) return;
8307
- e2.isEdge ? e2.isDoubleClick === true && Ts(r2) : e2.button === 0 && r2 === a2 && i2 === o2 && (F == null ? void 0 : F(f2, {
8307
+ e2.isEdge ? e2.isDoubleClick === true && ws(r2) : e2.button === 0 && r2 === a2 && i2 === o2 && (F == null ? void 0 : F(f2, {
8308
8308
  ...e2,
8309
8309
  preventDefault: s2
8310
8310
  }));
@@ -8314,33 +8314,33 @@ let __tla = (async () => {
8314
8314
  e2.button === 0 && r2 === a2 && i2 === o2 && (B == null ? void 0 : B(f2, {
8315
8315
  ...e2,
8316
8316
  preventDefault: s2
8317
- }), ws.current || Cs(e2));
8317
+ }), Cs.current || Ss(e2));
8318
8318
  }
8319
- e2.kind === "cell" && (e2.button === 0 || e2.button === 1) && u2(e2), _s.current = void 0;
8319
+ e2.kind === "cell" && (e2.button === 0 || e2.button === 1) && u2(e2), gs.current = void 0;
8320
8320
  }, [
8321
8321
  c,
8322
8322
  $,
8323
8323
  Q,
8324
- Go,
8325
- Os,
8326
- fo,
8324
+ Wo,
8325
+ Ds,
8326
+ uo,
8327
8327
  D,
8328
- $o,
8329
- Eo,
8328
+ Qo,
8329
+ To,
8330
8330
  gi,
8331
- fs,
8332
- Wo,
8331
+ ds,
8332
+ Uo,
8333
8333
  O,
8334
- ns,
8335
- Ir,
8334
+ ts,
8335
+ Fr,
8336
8336
  H,
8337
8337
  U,
8338
- hs,
8338
+ ms,
8339
8339
  B,
8340
8340
  F,
8341
- Ts,
8342
- Cs
8343
- ]), Ms = import_react.useCallback((e2) => {
8341
+ ws,
8342
+ Ss
8343
+ ]), js = import_react.useCallback((e2) => {
8344
8344
  let t2 = {
8345
8345
  ...e2,
8346
8346
  location: [
@@ -8348,56 +8348,56 @@ let __tla = (async () => {
8348
8348
  e2.location[1]
8349
8349
  ]
8350
8350
  };
8351
- di == null ? void 0 : di(t2), c !== void 0 && e2.buttons === 0 && (l(void 0), Ko(void 0), Ds(void 0), gs.current = false), Ds((t3) => {
8351
+ ui == null ? void 0 : ui(t2), c !== void 0 && e2.buttons === 0 && (l(void 0), Go(void 0), Es(void 0), hs.current = false), Es((t3) => {
8352
8352
  var _a3;
8353
- return gs.current ? [
8353
+ return hs.current ? [
8354
8354
  e2.scrollEdge[0],
8355
8355
  0
8356
- ] : e2.scrollEdge[0] === (t3 == null ? void 0 : t3[0]) && e2.scrollEdge[1] === t3[1] ? t3 : c === void 0 || (((_a3 = ys.current) == null ? void 0 : _a3.location[0]) ?? 0) < Q ? void 0 : e2.scrollEdge;
8356
+ ] : e2.scrollEdge[0] === (t3 == null ? void 0 : t3[0]) && e2.scrollEdge[1] === t3[1] ? t3 : c === void 0 || (((_a3 = vs.current) == null ? void 0 : _a3.location[0]) ?? 0) < Q ? void 0 : e2.scrollEdge;
8357
8357
  });
8358
8358
  }, [
8359
8359
  c,
8360
- di,
8360
+ ui,
8361
8361
  Q
8362
- ]), Ns = import_react.useCallback((e2, t2) => {
8363
- yi == null ? void 0 : yi(e2 - Q, t2);
8362
+ ]), Ms = import_react.useCallback((e2, t2) => {
8363
+ vi == null ? void 0 : vi(e2 - Q, t2);
8364
8364
  }, [
8365
- yi,
8365
+ vi,
8366
8366
  Q
8367
- ]), Ps = import_react.useCallback((e2, t2) => {
8367
+ ]), Ns = import_react.useCallback((e2, t2) => {
8368
8368
  bi == null ? void 0 : bi(e2 - Q, t2);
8369
8369
  }, [
8370
8370
  bi,
8371
8371
  Q
8372
- ]), Fs = (_b = $ == null ? void 0 : $.current) == null ? void 0 : _b.cell, Is = import_react.useCallback((e2, t2, n2, r2, i2, a2) => {
8373
- Fo.current = false;
8374
- let o2 = Fs;
8372
+ ]), Ps = (_b = $ == null ? void 0 : $.current) == null ? void 0 : _b.cell, Fs = import_react.useCallback((e2, t2, n2, r2, i2, a2) => {
8373
+ Po.current = false;
8374
+ let o2 = Ps;
8375
8375
  o2 !== void 0 && (o2 = [
8376
8376
  o2[0] - Q,
8377
8377
  o2[1]
8378
8378
  ]);
8379
- let s2 = hi === 0 ? void 0 : {
8379
+ let s2 = mi === 0 ? void 0 : {
8380
8380
  x: 0,
8381
8381
  y: e2.y,
8382
- width: hi,
8382
+ width: mi,
8383
8383
  height: e2.height
8384
8384
  }, c2 = [];
8385
- s2 !== void 0 && c2.push(s2), Li > 0 && (c2.push({
8385
+ s2 !== void 0 && c2.push(s2), Ii > 0 && (c2.push({
8386
8386
  x: e2.x - Q,
8387
- y: Z - Li,
8387
+ y: Z - Ii,
8388
8388
  width: e2.width,
8389
- height: Li
8390
- }), hi > 0 && c2.push({
8389
+ height: Ii
8390
+ }), mi > 0 && c2.push({
8391
8391
  x: 0,
8392
- y: Z - Li,
8393
- width: hi,
8394
- height: Li
8392
+ y: Z - Ii,
8393
+ width: mi,
8394
+ height: Ii
8395
8395
  }));
8396
8396
  let l2 = {
8397
8397
  x: e2.x - Q,
8398
8398
  y: e2.y,
8399
8399
  width: e2.width,
8400
- height: eo && e2.y + e2.height >= Z ? e2.height - 1 : e2.height,
8400
+ height: $a && e2.y + e2.height >= Z ? e2.height - 1 : e2.height,
8401
8401
  tx: i2,
8402
8402
  ty: a2,
8403
8403
  extras: {
@@ -8406,47 +8406,47 @@ let __tla = (async () => {
8406
8406
  freezeRegions: c2
8407
8407
  }
8408
8408
  };
8409
- Po.current = l2, Io(l2), wo([
8409
+ No.current = l2, Fo(l2), Co([
8410
8410
  t2,
8411
8411
  n2,
8412
8412
  r2
8413
- ]), ki == null ? void 0 : ki(l2, l2.tx, l2.ty, l2.extras);
8413
+ ]), Oi == null ? void 0 : Oi(l2, l2.tx, l2.ty, l2.extras);
8414
8414
  }, [
8415
- Fs,
8415
+ Ps,
8416
8416
  Q,
8417
- eo,
8417
+ $a,
8418
8418
  Z,
8419
- hi,
8420
- Li,
8421
- Io,
8422
- ki
8423
- ]), Ls = whenDefined(Jr, import_react.useCallback((e2, t2) => {
8424
- Jr == null ? void 0 : Jr(e2 - Q, t2 - Q), Zr !== "none" && xo(CompactSelection.fromSingleSelection(t2), void 0, true);
8419
+ mi,
8420
+ Ii,
8421
+ Fo,
8422
+ Oi
8423
+ ]), Is = whenDefined(qr, import_react.useCallback((e2, t2) => {
8424
+ qr == null ? void 0 : qr(e2 - Q, t2 - Q), Xr !== "none" && bo(CompactSelection.fromSingleSelection(t2), void 0, true);
8425
8425
  }, [
8426
- Zr,
8427
- Jr,
8426
+ Xr,
8427
+ qr,
8428
8428
  Q,
8429
- xo
8430
- ])), Rs = import_react.useRef(false), zs = import_react.useCallback((e2) => {
8429
+ bo
8430
+ ])), Ls = import_react.useRef(false), Rs = import_react.useCallback((e2) => {
8431
8431
  if (e2.location[0] === 0 && Q > 0) {
8432
8432
  e2.preventDefault();
8433
8433
  return;
8434
8434
  }
8435
- ui == null ? void 0 : ui({
8435
+ li == null ? void 0 : li({
8436
8436
  ...e2,
8437
8437
  location: [
8438
8438
  e2.location[0] - Q,
8439
8439
  e2.location[1]
8440
8440
  ]
8441
- }), e2.defaultPrevented() || (Rs.current = true), l(void 0);
8441
+ }), e2.defaultPrevented() || (Ls.current = true), l(void 0);
8442
8442
  }, [
8443
- ui,
8443
+ li,
8444
8444
  Q
8445
- ]), Bs = import_react.useCallback(() => {
8446
- Rs.current = false;
8447
- }, []), Vs = Ci == null ? void 0 : Ci.selectionBehavior, Hs = import_react.useCallback((e2) => {
8448
- if (Vs !== "block-spanning") return;
8449
- let { isGroupHeader: t2, path: n2, groupRows: r2 } = ps(e2);
8445
+ ]), zs = import_react.useCallback(() => {
8446
+ Ls.current = false;
8447
+ }, []), Bs = Ci == null ? void 0 : Ci.selectionBehavior, Vs = import_react.useCallback((e2) => {
8448
+ if (Bs !== "block-spanning") return;
8449
+ let { isGroupHeader: t2, path: n2, groupRows: r2 } = fs(e2);
8450
8450
  if (t2) return [
8451
8451
  e2,
8452
8452
  e2
@@ -8457,29 +8457,29 @@ let __tla = (async () => {
8457
8457
  e2 + r2 - i2 - 1
8458
8458
  ];
8459
8459
  }, [
8460
- ps,
8461
- Vs
8462
- ]), Us = import_react.useRef(), Ws = import_react.useCallback((e2) => {
8460
+ fs,
8461
+ Bs
8462
+ ]), Hs = import_react.useRef(), Us = import_react.useCallback((e2) => {
8463
8463
  var _a3, _b2, _c3;
8464
- if (!mouseEventArgsAreEqual(e2, Us.current) && (Us.current = e2, !(((_a3 = ys == null ? void 0 : ys.current) == null ? void 0 : _a3.button) !== void 0 && ys.current.button >= 1))) {
8465
- if (e2.buttons !== 0 && c !== void 0 && ((_b2 = ys.current) == null ? void 0 : _b2.location[0]) === 0 && e2.location[0] === 0 && Q === 1 && X === "multi" && c.previousSelection && !c.previousSelection.rows.hasIndex(ys.current.location[1]) && $.rows.hasIndex(ys.current.location[1])) {
8466
- let t2 = Math.min(ys.current.location[1], e2.location[1]), n2 = Math.max(ys.current.location[1], e2.location[1]) + 1;
8467
- bo(CompactSelection.fromSingleSelection([
8464
+ if (!mouseEventArgsAreEqual(e2, Hs.current) && (Hs.current = e2, !(((_a3 = vs == null ? void 0 : vs.current) == null ? void 0 : _a3.button) !== void 0 && vs.current.button >= 1))) {
8465
+ if (e2.buttons !== 0 && c !== void 0 && ((_b2 = vs.current) == null ? void 0 : _b2.location[0]) === 0 && e2.location[0] === 0 && Q === 1 && X === "multi" && c.previousSelection && !c.previousSelection.rows.hasIndex(vs.current.location[1]) && $.rows.hasIndex(vs.current.location[1])) {
8466
+ let t2 = Math.min(vs.current.location[1], e2.location[1]), n2 = Math.max(vs.current.location[1], e2.location[1]) + 1;
8467
+ yo(CompactSelection.fromSingleSelection([
8468
8468
  t2,
8469
8469
  n2
8470
8470
  ]), void 0, false);
8471
8471
  }
8472
- if (e2.buttons !== 0 && c !== void 0 && $.current !== void 0 && !Rs.current && !gs.current && (Y === "rect" || Y === "multi-rect")) {
8472
+ if (e2.buttons !== 0 && c !== void 0 && $.current !== void 0 && !Ls.current && !hs.current && (Y === "rect" || Y === "multi-rect")) {
8473
8473
  let [t2, n2] = $.current.cell, [r2, i2] = e2.location;
8474
- if (i2 < 0 && (i2 = Po.current.y), c.fillHandle === true && ((_c3 = c.previousSelection) == null ? void 0 : _c3.current) !== void 0) {
8474
+ if (i2 < 0 && (i2 = No.current.y), c.fillHandle === true && ((_c3 = c.previousSelection) == null ? void 0 : _c3.current) !== void 0) {
8475
8475
  let e3 = c.previousSelection.current.range;
8476
- i2 = Math.min(i2, eo ? Z - 1 : Z), Ko(getClosestRect(e3, r2, i2, Ri));
8476
+ i2 = Math.min(i2, $a ? Z - 1 : Z), Go(getClosestRect(e3, r2, i2, Li));
8477
8477
  } else {
8478
- if (eo && n2 === Z) return;
8479
- if (eo && i2 === Z) if (e2.kind === "out-of-bounds") i2--;
8478
+ if ($a && n2 === Z) return;
8479
+ if ($a && i2 === Z) if (e2.kind === "out-of-bounds") i2--;
8480
8480
  else return;
8481
8481
  r2 = Math.max(r2, Q);
8482
- let a2 = Hs(n2);
8482
+ let a2 = Vs(n2);
8483
8483
  i2 = a2 === void 0 ? i2 : (0, import_clamp.default)(i2, a2[0], a2[1]);
8484
8484
  let o2 = r2 - t2, s2 = i2 - n2, c2 = {
8485
8485
  x: o2 >= 0 ? t2 : r2,
@@ -8487,13 +8487,13 @@ let __tla = (async () => {
8487
8487
  width: Math.abs(o2) + 1,
8488
8488
  height: Math.abs(s2) + 1
8489
8489
  };
8490
- yo({
8490
+ vo({
8491
8491
  ...$.current,
8492
8492
  range: c2
8493
8493
  }, true, false, "drag");
8494
8494
  }
8495
8495
  }
8496
- Ei == null ? void 0 : Ei({
8496
+ Ti == null ? void 0 : Ti({
8497
8497
  ...e2,
8498
8498
  location: [
8499
8499
  e2.location[0] - Q,
@@ -8507,20 +8507,20 @@ let __tla = (async () => {
8507
8507
  X,
8508
8508
  $,
8509
8509
  Y,
8510
- Ei,
8511
- bo,
8512
- eo,
8510
+ Ti,
8511
+ yo,
8512
+ $a,
8513
8513
  Z,
8514
- Ri,
8515
- Hs,
8516
- yo
8514
+ Li,
8515
+ Vs,
8516
+ vo
8517
8517
  ]);
8518
- useAutoscroll(Es, Ro, import_react.useCallback(() => {
8518
+ useAutoscroll(Ts, Lo, import_react.useCallback(() => {
8519
8519
  var _a3, _b2;
8520
- let e2 = Us.current;
8520
+ let e2 = Hs.current;
8521
8521
  if (e2 === void 0) return;
8522
- let [t2, n2] = e2.scrollEdge, [r2, i2] = e2.location, a2 = Po.current;
8523
- t2 === -1 ? r2 = ((_b2 = (_a3 = a2.extras) == null ? void 0 : _a3.freezeRegion) == null ? void 0 : _b2.x) ?? a2.x : t2 === 1 && (r2 = a2.x + a2.width), n2 === -1 ? i2 = Math.max(0, a2.y) : n2 === 1 && (i2 = Math.min(Z - 1, a2.y + a2.height)), r2 = (0, import_clamp.default)(r2, 0, No.length - 1), i2 = (0, import_clamp.default)(i2, 0, Z - 1), Ws({
8522
+ let [t2, n2] = e2.scrollEdge, [r2, i2] = e2.location, a2 = No.current;
8523
+ t2 === -1 ? r2 = ((_b2 = (_a3 = a2.extras) == null ? void 0 : _a3.freezeRegion) == null ? void 0 : _b2.x) ?? a2.x : t2 === 1 && (r2 = a2.x + a2.width), n2 === -1 ? i2 = Math.max(0, a2.y) : n2 === 1 && (i2 = Math.min(Z - 1, a2.y + a2.height)), r2 = (0, import_clamp.default)(r2, 0, Mo.length - 1), i2 = (0, import_clamp.default)(i2, 0, Z - 1), Us({
8524
8524
  ...e2,
8525
8525
  location: [
8526
8526
  r2,
@@ -8528,43 +8528,43 @@ let __tla = (async () => {
8528
8528
  ]
8529
8529
  });
8530
8530
  }, [
8531
- No.length,
8532
- Ws,
8531
+ Mo.length,
8532
+ Us,
8533
8533
  Z
8534
8534
  ]));
8535
- let Gs = import_react.useCallback((e2) => {
8535
+ let Ws = import_react.useCallback((e2) => {
8536
8536
  if ($.current === void 0) return;
8537
- let [t2, n2] = e2, [r2, i2] = $.current.cell, a2 = $.current.range, o2 = a2.x, s2 = a2.x + a2.width, c2 = a2.y, l2 = a2.y + a2.height, [u2, f2] = Hs(i2) ?? [
8537
+ let [t2, n2] = e2, [r2, i2] = $.current.cell, a2 = $.current.range, o2 = a2.x, s2 = a2.x + a2.width, c2 = a2.y, l2 = a2.y + a2.height, [u2, f2] = Vs(i2) ?? [
8538
8538
  0,
8539
8539
  Z - 1
8540
8540
  ], m2 = f2 + 1;
8541
8541
  if (n2 !== 0) switch (n2) {
8542
8542
  case 2:
8543
- l2 = m2, c2 = i2, is(0, l2, "vertical");
8543
+ l2 = m2, c2 = i2, rs(0, l2, "vertical");
8544
8544
  break;
8545
8545
  case -2:
8546
- c2 = u2, l2 = i2 + 1, is(0, c2, "vertical");
8546
+ c2 = u2, l2 = i2 + 1, rs(0, c2, "vertical");
8547
8547
  break;
8548
8548
  case 1:
8549
- c2 < i2 ? (c2++, is(0, c2, "vertical")) : (l2 = Math.min(m2, l2 + 1), is(0, l2, "vertical"));
8549
+ c2 < i2 ? (c2++, rs(0, c2, "vertical")) : (l2 = Math.min(m2, l2 + 1), rs(0, l2, "vertical"));
8550
8550
  break;
8551
8551
  case -1:
8552
- l2 > i2 + 1 ? (l2--, is(0, l2, "vertical")) : (c2 = Math.max(u2, c2 - 1), is(0, c2, "vertical"));
8552
+ l2 > i2 + 1 ? (l2--, rs(0, l2, "vertical")) : (c2 = Math.max(u2, c2 - 1), rs(0, c2, "vertical"));
8553
8553
  break;
8554
8554
  default:
8555
8555
  assertNever(n2);
8556
8556
  }
8557
- if (t2 !== 0) if (t2 === 2) s2 = No.length, o2 = r2, is(s2 - 1 - Q, 0, "horizontal");
8558
- else if (t2 === -2) o2 = Q, s2 = r2 + 1, is(o2 - Q, 0, "horizontal");
8557
+ if (t2 !== 0) if (t2 === 2) s2 = Mo.length, o2 = r2, rs(s2 - 1 - Q, 0, "horizontal");
8558
+ else if (t2 === -2) o2 = Q, s2 = r2 + 1, rs(o2 - Q, 0, "horizontal");
8559
8559
  else {
8560
8560
  let e3 = [];
8561
- if (so !== void 0) {
8562
- let t3 = so({
8561
+ if (oo !== void 0) {
8562
+ let t3 = oo({
8563
8563
  x: o2,
8564
8564
  y: c2,
8565
8565
  width: s2 - o2 - Q,
8566
8566
  height: l2 - c2
8567
- }, oo.current.signal);
8567
+ }, ao.current.signal);
8568
8568
  typeof t3 == "object" && (e3 = getSpanStops(t3));
8569
8569
  }
8570
8570
  if (t2 === 1) {
@@ -8574,9 +8574,9 @@ let __tla = (async () => {
8574
8574
  let n3 = (0, import_range.default)(o2 + 1, r2 + 1).find((t4) => !e3.includes(t4 - Q));
8575
8575
  n3 !== void 0 && (o2 = n3, t3 = true);
8576
8576
  } else o2++, t3 = true;
8577
- t3 && is(o2, 0, "horizontal");
8577
+ t3 && rs(o2, 0, "horizontal");
8578
8578
  }
8579
- t3 || (s2 = Math.min(No.length, s2 + 1), is(s2 - 1 - Q, 0, "horizontal"));
8579
+ t3 || (s2 = Math.min(Mo.length, s2 + 1), rs(s2 - 1 - Q, 0, "horizontal"));
8580
8580
  } else if (t2 === -1) {
8581
8581
  let t3 = false;
8582
8582
  if (s2 > r2 + 1) {
@@ -8584,12 +8584,12 @@ let __tla = (async () => {
8584
8584
  let n3 = (0, import_range.default)(s2 - 1, r2, -1).find((t4) => !e3.includes(t4 - Q));
8585
8585
  n3 !== void 0 && (s2 = n3, t3 = true);
8586
8586
  } else s2--, t3 = true;
8587
- t3 && is(s2 - Q, 0, "horizontal");
8587
+ t3 && rs(s2 - Q, 0, "horizontal");
8588
8588
  }
8589
- t3 || (o2 = Math.max(Q, o2 - 1), is(o2 - Q, 0, "horizontal"));
8589
+ t3 || (o2 = Math.max(Q, o2 - 1), rs(o2 - Q, 0, "horizontal"));
8590
8590
  } else assertNever(t2);
8591
8591
  }
8592
- yo({
8592
+ vo({
8593
8593
  cell: $.current.cell,
8594
8594
  range: {
8595
8595
  x: o2,
@@ -8599,26 +8599,26 @@ let __tla = (async () => {
8599
8599
  }
8600
8600
  }, true, false, "keyboard-select");
8601
8601
  }, [
8602
- so,
8603
- Hs,
8602
+ oo,
8603
+ Vs,
8604
8604
  $,
8605
- No.length,
8605
+ Mo.length,
8606
8606
  Q,
8607
8607
  Z,
8608
- is,
8609
- yo
8610
- ]), Ks = import_react.useRef(xa);
8611
- Ks.current = xa;
8612
- let qs = import_react.useCallback((e2, t2, n2, r2) => {
8613
- let i2 = Uo - (n2 ? 0 : 1);
8614
- e2 = (0, import_clamp.default)(e2, Q, Do.length - 1 + Q), t2 = (0, import_clamp.default)(t2, 0, i2);
8615
- let a2 = Fs == null ? void 0 : Fs[0], o2 = Fs == null ? void 0 : Fs[1];
8608
+ rs,
8609
+ vo
8610
+ ]), Gs = import_react.useRef(ba);
8611
+ Gs.current = ba;
8612
+ let Ks = import_react.useCallback((e2, t2, n2, r2) => {
8613
+ let i2 = Ho - (n2 ? 0 : 1);
8614
+ e2 = (0, import_clamp.default)(e2, Q, Eo.length - 1 + Q), t2 = (0, import_clamp.default)(t2, 0, i2);
8615
+ let a2 = Ps == null ? void 0 : Ps[0], o2 = Ps == null ? void 0 : Ps[1];
8616
8616
  if (e2 === a2 && t2 === o2) return false;
8617
8617
  if (r2 && $.current !== void 0) {
8618
8618
  let n3 = [
8619
8619
  ...$.current.rangeStack
8620
8620
  ];
8621
- ($.current.range.width > 1 || $.current.range.height > 1) && n3.push($.current.range), fo({
8621
+ ($.current.range.width > 1 || $.current.range.height > 1) && n3.push($.current.range), uo({
8622
8622
  ...$,
8623
8623
  current: {
8624
8624
  cell: [
@@ -8634,7 +8634,7 @@ let __tla = (async () => {
8634
8634
  rangeStack: n3
8635
8635
  }
8636
8636
  }, true);
8637
- } else yo({
8637
+ } else vo({
8638
8638
  cell: [
8639
8639
  e2,
8640
8640
  t2
@@ -8646,48 +8646,48 @@ let __tla = (async () => {
8646
8646
  height: 1
8647
8647
  }
8648
8648
  }, true, false, "keyboard-nav");
8649
- return u.current !== void 0 && u.current[0] === e2 && u.current[1] === t2 && (u.current = void 0), Ks.current && is(e2 - Q, t2), true;
8649
+ return u.current !== void 0 && u.current[0] === e2 && u.current[1] === t2 && (u.current = void 0), Gs.current && rs(e2 - Q, t2), true;
8650
8650
  }, [
8651
- Uo,
8651
+ Ho,
8652
8652
  Q,
8653
- Do.length,
8654
- Fs,
8653
+ Eo.length,
8654
+ Ps,
8655
8655
  $,
8656
- is,
8657
- fo,
8658
- yo
8659
- ]), Js = import_react.useCallback((e2, t2) => {
8660
- (i == null ? void 0 : i.cell) !== void 0 && e2 !== void 0 && isEditableGridCell(e2) && (Wo([
8656
+ rs,
8657
+ uo,
8658
+ vo
8659
+ ]), qs = import_react.useCallback((e2, t2) => {
8660
+ (i == null ? void 0 : i.cell) !== void 0 && e2 !== void 0 && isEditableGridCell(e2) && (Uo([
8661
8661
  {
8662
8662
  location: i.cell,
8663
8663
  value: e2
8664
8664
  }
8665
8665
  ]), window.requestAnimationFrame(() => {
8666
8666
  var _a3;
8667
- (_a3 = Vo.current) == null ? void 0 : _a3.damage([
8667
+ (_a3 = Bo.current) == null ? void 0 : _a3.damage([
8668
8668
  {
8669
8669
  cell: i.cell
8670
8670
  }
8671
8671
  ]);
8672
- })), Ho(true), a(void 0);
8672
+ })), Vo(true), a(void 0);
8673
8673
  let [n2, r2] = t2;
8674
8674
  if ($.current !== void 0 && (n2 !== 0 || r2 !== 0)) {
8675
- let t3 = $.current.cell[1] === Uo - 1 && e2 !== void 0;
8676
- qs((0, import_clamp.default)($.current.cell[0] + n2, 0, No.length - 1), (0, import_clamp.default)($.current.cell[1] + r2, 0, Uo - 1), t3, false);
8675
+ let t3 = $.current.cell[1] === Ho - 1 && e2 !== void 0;
8676
+ Ks((0, import_clamp.default)($.current.cell[0] + n2, 0, Mo.length - 1), (0, import_clamp.default)($.current.cell[1] + r2, 0, Ho - 1), t3, false);
8677
8677
  }
8678
8678
  A == null ? void 0 : A(e2, t2);
8679
8679
  }, [
8680
8680
  i == null ? void 0 : i.cell,
8681
- Ho,
8681
+ Vo,
8682
8682
  $,
8683
8683
  A,
8684
- Wo,
8685
8684
  Uo,
8686
- qs,
8687
- No.length
8688
- ]), Ys = import_react.useMemo(() => `gdg-overlay-${idCounter++}`, []), Xs = import_react.useCallback((e2) => {
8685
+ Ho,
8686
+ Ks,
8687
+ Mo.length
8688
+ ]), Js = import_react.useMemo(() => `gdg-overlay-${idCounter++}`, []), Ys = import_react.useCallback((e2) => {
8689
8689
  var _a3, _b2, _c3, _d, _e;
8690
- Ho();
8690
+ Vo();
8691
8691
  let t2 = [];
8692
8692
  for (let n2 = e2.x; n2 < e2.x + e2.width; n2++) for (let r2 = e2.y; r2 < e2.y + e2.height; r2++) {
8693
8693
  let e3 = E([
@@ -8697,9 +8697,9 @@ let __tla = (async () => {
8697
8697
  if (!e3.allowOverlay && e3.kind !== GridCellKind.Boolean) continue;
8698
8698
  let i2;
8699
8699
  if (e3.kind === GridCellKind.Custom) {
8700
- let t3 = Eo(e3), n3 = (_a3 = t3 == null ? void 0 : t3.provideEditor) == null ? void 0 : _a3.call(t3, e3);
8700
+ let t3 = To(e3), n3 = (_a3 = t3 == null ? void 0 : t3.provideEditor) == null ? void 0 : _a3.call(t3, e3);
8701
8701
  (t3 == null ? void 0 : t3.onDelete) === void 0 ? isObjectEditorCallbackResult(n3) && (i2 = (_b2 = n3 == null ? void 0 : n3.deletedValue) == null ? void 0 : _b2.call(n3, e3)) : i2 = t3.onDelete(e3);
8702
- } else (isEditableGridCell(e3) && e3.allowOverlay || e3.kind === GridCellKind.Boolean) && (i2 = (_d = (_c3 = Eo(e3)) == null ? void 0 : _c3.onDelete) == null ? void 0 : _d.call(_c3, e3));
8702
+ } else (isEditableGridCell(e3) && e3.allowOverlay || e3.kind === GridCellKind.Boolean) && (i2 = (_d = (_c3 = To(e3)) == null ? void 0 : _c3.onDelete) == null ? void 0 : _d.call(_c3, e3));
8703
8703
  i2 !== void 0 && !isInnerOnlyCell(i2) && isEditableGridCell(i2) && t2.push({
8704
8704
  location: [
8705
8705
  n2,
@@ -8708,24 +8708,24 @@ let __tla = (async () => {
8708
8708
  value: i2
8709
8709
  });
8710
8710
  }
8711
- Wo(t2), (_e = Vo.current) == null ? void 0 : _e.damage(t2.map((e3) => ({
8711
+ Uo(t2), (_e = Bo.current) == null ? void 0 : _e.damage(t2.map((e3) => ({
8712
8712
  cell: e3.location
8713
8713
  })));
8714
8714
  }, [
8715
- Ho,
8715
+ Vo,
8716
8716
  E,
8717
- Eo,
8718
- Wo,
8717
+ To,
8718
+ Uo,
8719
8719
  Q
8720
- ]), Zs = i !== void 0, Qs = import_react.useCallback((e2) => {
8720
+ ]), Xs = i !== void 0, Zs = import_react.useCallback((e2) => {
8721
8721
  var _a3, _b2;
8722
8722
  let t2 = () => {
8723
8723
  e2.stopPropagation(), e2.preventDefault();
8724
8724
  }, n2 = {
8725
8725
  didMatch: false
8726
- }, { bounds: r2 } = e2, i2 = $.columns, s2 = $.rows, c2 = Za;
8727
- if (!Zs && isHotkey(c2.clear, e2, n2)) fo(emptyGridSelection, false), Di == null ? void 0 : Di();
8728
- else if (!Zs && isHotkey(c2.selectAll, e2, n2)) fo({
8726
+ }, { bounds: r2 } = e2, i2 = $.columns, s2 = $.rows, c2 = Xa;
8727
+ if (!Xs && isHotkey(c2.clear, e2, n2)) uo(emptyGridSelection, false), Ei == null ? void 0 : Ei();
8728
+ else if (!Xs && isHotkey(c2.selectAll, e2, n2)) uo({
8729
8729
  columns: CompactSelection.empty(),
8730
8730
  rows: CompactSelection.empty(),
8731
8731
  current: {
@@ -8744,22 +8744,22 @@ let __tla = (async () => {
8744
8744
  }, false);
8745
8745
  else if (isHotkey(c2.search, e2, n2)) (_b2 = o == null ? void 0 : o.current) == null ? void 0 : _b2.focus({
8746
8746
  preventScroll: true
8747
- }), ro(true);
8747
+ }), no(true);
8748
8748
  else if (isHotkey(c2.delete, e2, n2)) {
8749
- let e3 = (vo == null ? void 0 : vo($)) ?? true;
8749
+ let e3 = (_o == null ? void 0 : _o($)) ?? true;
8750
8750
  if (e3 !== false) {
8751
8751
  let t3 = e3 === true ? $ : e3;
8752
8752
  if (t3.current !== void 0) {
8753
- Xs(t3.current.range);
8754
- for (let e4 of t3.current.rangeStack) Xs(e4);
8753
+ Ys(t3.current.range);
8754
+ for (let e4 of t3.current.rangeStack) Ys(e4);
8755
8755
  }
8756
- for (let e4 of t3.rows) Xs({
8756
+ for (let e4 of t3.rows) Ys({
8757
8757
  x: Q,
8758
8758
  y: e4,
8759
8759
  width: S.length,
8760
8760
  height: 1
8761
8761
  });
8762
- for (let e4 of t3.columns) Xs({
8762
+ for (let e4 of t3.columns) Ys({
8763
8763
  x: e4,
8764
8764
  y: 0,
8765
8765
  width: 1,
@@ -8770,108 +8770,108 @@ let __tla = (async () => {
8770
8770
  if (n2.didMatch) return t2(), true;
8771
8771
  if ($.current === void 0) return false;
8772
8772
  let [l2, u2] = $.current.cell, [, f2] = $.current.cell, m2 = false, h2 = false;
8773
- if (isHotkey(c2.scrollToSelectedCell, e2, n2) ? oc.current(l2 - Q, u2) : Zr !== "none" && isHotkey(c2.selectColumn, e2, n2) ? i2.hasIndex(l2) ? xo(i2.remove(l2), void 0, true) : Zr === "single" ? xo(CompactSelection.fromSingleSelection(l2), void 0, true) : xo(void 0, l2, true) : X !== "none" && isHotkey(c2.selectRow, e2, n2) ? s2.hasIndex(u2) ? bo(s2.remove(u2), void 0, true) : X === "single" ? bo(CompactSelection.fromSingleSelection(u2), void 0, true) : bo(void 0, u2, true) : !Zs && r2 !== void 0 && isHotkey(c2.activateCell, e2, n2) ? u2 === Z && eo ? window.setTimeout(() => {
8774
- cs(ls(l2) ?? l2);
8773
+ if (isHotkey(c2.scrollToSelectedCell, e2, n2) ? ac.current(l2 - Q, u2) : Xr !== "none" && isHotkey(c2.selectColumn, e2, n2) ? i2.hasIndex(l2) ? bo(i2.remove(l2), void 0, true) : Xr === "single" ? bo(CompactSelection.fromSingleSelection(l2), void 0, true) : bo(void 0, l2, true) : X !== "none" && isHotkey(c2.selectRow, e2, n2) ? s2.hasIndex(u2) ? yo(s2.remove(u2), void 0, true) : X === "single" ? yo(CompactSelection.fromSingleSelection(u2), void 0, true) : yo(void 0, u2, true) : !Xs && r2 !== void 0 && isHotkey(c2.activateCell, e2, n2) ? u2 === Z && $a ? window.setTimeout(() => {
8774
+ ss(cs(l2) ?? l2);
8775
8775
  }, 0) : (O == null ? void 0 : O([
8776
8776
  l2 - Q,
8777
8777
  u2
8778
- ]), ns(r2, true)) : $.current.range.height > 1 && isHotkey(c2.downFill, e2, n2) ? As() : $.current.range.width > 1 && isHotkey(c2.rightFill, e2, n2) ? ks() : isHotkey(c2.goToNextPage, e2, n2) ? u2 += Math.max(1, Po.current.height - 4) : isHotkey(c2.goToPreviousPage, e2, n2) ? u2 -= Math.max(1, Po.current.height - 4) : isHotkey(c2.goToFirstCell, e2, n2) ? (a(void 0), u2 = 0, l2 = 0) : isHotkey(c2.goToLastCell, e2, n2) ? (a(void 0), u2 = 2 ** 53 - 1, l2 = 2 ** 53 - 1) : isHotkey(c2.selectToFirstCell, e2, n2) ? (a(void 0), Gs([
8778
+ ]), ts(r2, true)) : $.current.range.height > 1 && isHotkey(c2.downFill, e2, n2) ? ks() : $.current.range.width > 1 && isHotkey(c2.rightFill, e2, n2) ? Os() : isHotkey(c2.goToNextPage, e2, n2) ? u2 += Math.max(1, No.current.height - 4) : isHotkey(c2.goToPreviousPage, e2, n2) ? u2 -= Math.max(1, No.current.height - 4) : isHotkey(c2.goToFirstCell, e2, n2) ? (a(void 0), u2 = 0, l2 = 0) : isHotkey(c2.goToLastCell, e2, n2) ? (a(void 0), u2 = 2 ** 53 - 1, l2 = 2 ** 53 - 1) : isHotkey(c2.selectToFirstCell, e2, n2) ? (a(void 0), Ws([
8779
8779
  -2,
8780
8780
  -2
8781
- ])) : isHotkey(c2.selectToLastCell, e2, n2) ? (a(void 0), Gs([
8781
+ ])) : isHotkey(c2.selectToLastCell, e2, n2) ? (a(void 0), Ws([
8782
8782
  2,
8783
8783
  2
8784
- ])) : Zs ? (isHotkey(c2.closeOverlay, e2, n2) && a(void 0), isHotkey(c2.acceptOverlayDown, e2, n2) && (a(void 0), u2++), isHotkey(c2.acceptOverlayUp, e2, n2) && (a(void 0), u2--), isHotkey(c2.acceptOverlayLeft, e2, n2) && (a(void 0), l2--), isHotkey(c2.acceptOverlayRight, e2, n2) && (a(void 0), l2++)) : (isHotkey(c2.goDownCell, e2, n2) ? u2 += 1 : isHotkey(c2.goUpCell, e2, n2) ? --u2 : isHotkey(c2.goRightCell, e2, n2) ? l2 += 1 : isHotkey(c2.goLeftCell, e2, n2) ? --l2 : isHotkey(c2.goDownCellRetainSelection, e2, n2) ? (u2 += 1, m2 = true) : isHotkey(c2.goUpCellRetainSelection, e2, n2) ? (--u2, m2 = true) : isHotkey(c2.goRightCellRetainSelection, e2, n2) ? (l2 += 1, m2 = true) : isHotkey(c2.goLeftCellRetainSelection, e2, n2) ? (--l2, m2 = true) : isHotkey(c2.goToLastRow, e2, n2) ? u2 = Z - 1 : isHotkey(c2.goToFirstRow, e2, n2) ? u2 = -(2 ** 53 - 1) : isHotkey(c2.goToLastColumn, e2, n2) ? l2 = 2 ** 53 - 1 : isHotkey(c2.goToFirstColumn, e2, n2) ? l2 = -(2 ** 53 - 1) : (Y === "rect" || Y === "multi-rect") && (isHotkey(c2.selectGrowDown, e2, n2) ? Gs([
8784
+ ])) : Xs ? (isHotkey(c2.closeOverlay, e2, n2) && a(void 0), isHotkey(c2.acceptOverlayDown, e2, n2) && (a(void 0), u2++), isHotkey(c2.acceptOverlayUp, e2, n2) && (a(void 0), u2--), isHotkey(c2.acceptOverlayLeft, e2, n2) && (a(void 0), l2--), isHotkey(c2.acceptOverlayRight, e2, n2) && (a(void 0), l2++)) : (isHotkey(c2.goDownCell, e2, n2) ? u2 += 1 : isHotkey(c2.goUpCell, e2, n2) ? --u2 : isHotkey(c2.goRightCell, e2, n2) ? l2 += 1 : isHotkey(c2.goLeftCell, e2, n2) ? --l2 : isHotkey(c2.goDownCellRetainSelection, e2, n2) ? (u2 += 1, m2 = true) : isHotkey(c2.goUpCellRetainSelection, e2, n2) ? (--u2, m2 = true) : isHotkey(c2.goRightCellRetainSelection, e2, n2) ? (l2 += 1, m2 = true) : isHotkey(c2.goLeftCellRetainSelection, e2, n2) ? (--l2, m2 = true) : isHotkey(c2.goToLastRow, e2, n2) ? u2 = Z - 1 : isHotkey(c2.goToFirstRow, e2, n2) ? u2 = -(2 ** 53 - 1) : isHotkey(c2.goToLastColumn, e2, n2) ? l2 = 2 ** 53 - 1 : isHotkey(c2.goToFirstColumn, e2, n2) ? l2 = -(2 ** 53 - 1) : (Y === "rect" || Y === "multi-rect") && (isHotkey(c2.selectGrowDown, e2, n2) ? Ws([
8785
8785
  0,
8786
8786
  1
8787
- ]) : isHotkey(c2.selectGrowUp, e2, n2) ? Gs([
8787
+ ]) : isHotkey(c2.selectGrowUp, e2, n2) ? Ws([
8788
8788
  0,
8789
8789
  -1
8790
- ]) : isHotkey(c2.selectGrowRight, e2, n2) ? Gs([
8790
+ ]) : isHotkey(c2.selectGrowRight, e2, n2) ? Ws([
8791
8791
  1,
8792
8792
  0
8793
- ]) : isHotkey(c2.selectGrowLeft, e2, n2) ? Gs([
8793
+ ]) : isHotkey(c2.selectGrowLeft, e2, n2) ? Ws([
8794
8794
  -1,
8795
8795
  0
8796
- ]) : isHotkey(c2.selectToLastRow, e2, n2) ? Gs([
8796
+ ]) : isHotkey(c2.selectToLastRow, e2, n2) ? Ws([
8797
8797
  0,
8798
8798
  2
8799
- ]) : isHotkey(c2.selectToFirstRow, e2, n2) ? Gs([
8799
+ ]) : isHotkey(c2.selectToFirstRow, e2, n2) ? Ws([
8800
8800
  0,
8801
8801
  -2
8802
- ]) : isHotkey(c2.selectToLastColumn, e2, n2) ? Gs([
8802
+ ]) : isHotkey(c2.selectToLastColumn, e2, n2) ? Ws([
8803
8803
  2,
8804
8804
  0
8805
- ]) : isHotkey(c2.selectToFirstColumn, e2, n2) && Gs([
8805
+ ]) : isHotkey(c2.selectToFirstColumn, e2, n2) && Ws([
8806
8806
  -2,
8807
8807
  0
8808
- ])), h2 = n2.didMatch), ms !== void 0 && ms !== "normal" && u2 !== f2) {
8809
- let e3 = ms === "skip-up" || ms === "skip" || ms === "block", t3 = ms === "skip-down" || ms === "skip" || ms === "block", n3 = u2 < f2;
8808
+ ])), h2 = n2.didMatch), ps !== void 0 && ps !== "normal" && u2 !== f2) {
8809
+ let e3 = ps === "skip-up" || ps === "skip" || ps === "block", t3 = ps === "skip-down" || ps === "skip" || ps === "block", n3 = u2 < f2;
8810
8810
  if (n3 && e3) {
8811
- for (; u2 >= 0 && ps(u2).isGroupHeader; ) u2--;
8811
+ for (; u2 >= 0 && fs(u2).isGroupHeader; ) u2--;
8812
8812
  u2 < 0 && (u2 = f2);
8813
8813
  } else if (!n3 && t3) {
8814
- for (; u2 < Z && ps(u2).isGroupHeader; ) u2++;
8814
+ for (; u2 < Z && fs(u2).isGroupHeader; ) u2++;
8815
8815
  u2 >= Z && (u2 = f2);
8816
8816
  }
8817
8817
  }
8818
- let g2 = qs(l2, u2, false, m2), y2 = n2.didMatch;
8819
- return y2 && (g2 || !h2 || ua) && t2(), y2;
8818
+ let g2 = Ks(l2, u2, false, m2), y2 = n2.didMatch;
8819
+ return y2 && (g2 || !h2 || la) && t2(), y2;
8820
8820
  }, [
8821
- ms,
8822
- Zs,
8821
+ ps,
8822
+ Xs,
8823
8823
  $,
8824
- Za,
8825
- Zr,
8824
+ Xa,
8825
+ Xr,
8826
8826
  X,
8827
8827
  Y,
8828
8828
  Q,
8829
- ps,
8829
+ fs,
8830
8830
  Z,
8831
- qs,
8832
- fo,
8833
- Di,
8831
+ Ks,
8832
+ uo,
8833
+ Ei,
8834
8834
  S.length,
8835
- vo,
8836
- ua,
8837
- Xs,
8838
- xo,
8835
+ _o,
8836
+ la,
8837
+ Ys,
8839
8838
  bo,
8840
- eo,
8841
- ls,
8839
+ yo,
8840
+ $a,
8842
8841
  cs,
8842
+ ss,
8843
8843
  O,
8844
- ns,
8845
- As,
8844
+ ts,
8846
8845
  ks,
8847
- Gs
8848
- ]), $s = import_react.useCallback((e2) => {
8846
+ Os,
8847
+ Ws
8848
+ ]), Qs = import_react.useCallback((e2) => {
8849
8849
  let t2 = false;
8850
- if (Hr !== void 0 && Hr({
8850
+ if (Vr !== void 0 && Vr({
8851
8851
  ...e2,
8852
8852
  cancel: () => {
8853
8853
  t2 = true;
8854
8854
  }
8855
- }), t2 || Qs(e2) || $.current === void 0) return;
8856
- let [n2, r2] = $.current.cell, i2 = Po.current;
8857
- if (qr && !e2.metaKey && !e2.ctrlKey && $.current !== void 0 && e2.key.length === 1 && /[ -~]/g.test(e2.key) && e2.bounds !== void 0 && isReadWriteCell(E([
8855
+ }), t2 || Zs(e2) || $.current === void 0) return;
8856
+ let [n2, r2] = $.current.cell, i2 = No.current;
8857
+ if (Kr && !e2.metaKey && !e2.ctrlKey && $.current !== void 0 && e2.key.length === 1 && /[ -~]/g.test(e2.key) && e2.bounds !== void 0 && isReadWriteCell(E([
8858
8858
  n2 - Q,
8859
8859
  Math.max(0, Math.min(r2, Z - 1))
8860
8860
  ]))) {
8861
- if ((!eo || r2 !== Z) && (i2.y > r2 || r2 > i2.y + i2.height || i2.x > n2 || n2 > i2.x + i2.width)) return;
8862
- ns(e2.bounds, true, e2.key), e2.stopPropagation(), e2.preventDefault();
8861
+ if ((!$a || r2 !== Z) && (i2.y > r2 || r2 > i2.y + i2.height || i2.x > n2 || n2 > i2.x + i2.width)) return;
8862
+ ts(e2.bounds, true, e2.key), e2.stopPropagation(), e2.preventDefault();
8863
8863
  }
8864
8864
  }, [
8865
- qr,
8866
- Hr,
8867
- Qs,
8865
+ Kr,
8866
+ Vr,
8867
+ Zs,
8868
8868
  $,
8869
8869
  E,
8870
8870
  Q,
8871
8871
  Z,
8872
- eo,
8873
- ns
8874
- ]), ec = import_react.useCallback((e2, t2) => {
8872
+ $a,
8873
+ ts
8874
+ ]), $s = import_react.useCallback((e2, t2) => {
8875
8875
  let n2 = e2.location[0] - Q;
8876
8876
  if (e2.kind === "header" && (H == null ? void 0 : H(n2, {
8877
8877
  ...e2,
@@ -8885,24 +8885,24 @@ let __tla = (async () => {
8885
8885
  }
8886
8886
  if (e2.kind === "cell") {
8887
8887
  let [r2, i2] = e2.location;
8888
- Ir == null ? void 0 : Ir([
8888
+ Fr == null ? void 0 : Fr([
8889
8889
  n2,
8890
8890
  i2
8891
8891
  ], {
8892
8892
  ...e2,
8893
8893
  preventDefault: t2
8894
- }), gridSelectionHasItem($, e2.location) || qs(r2, i2, false, false);
8894
+ }), gridSelectionHasItem($, e2.location) || Ks(r2, i2, false, false);
8895
8895
  }
8896
8896
  }, [
8897
8897
  $,
8898
- Ir,
8898
+ Fr,
8899
8899
  U,
8900
8900
  H,
8901
8901
  Q,
8902
- qs
8903
- ]), tc = import_react.useCallback(async (e2) => {
8902
+ Ks
8903
+ ]), ec = import_react.useCallback(async (e2) => {
8904
8904
  var _a3, _b2, _c3;
8905
- if (!Za.paste) return;
8905
+ if (!Xa.paste) return;
8906
8906
  function t2(e3, t3, n3, r3) {
8907
8907
  var _a4, _b3;
8908
8908
  let i3 = typeof n3 == "object" ? (n3 == null ? void 0 : n3.join("\n")) ?? "" : (n3 == null ? void 0 : n3.toString()) ?? "";
@@ -8912,7 +8912,7 @@ let __tla = (async () => {
8912
8912
  location: t3,
8913
8913
  value: a3
8914
8914
  };
8915
- let o2 = Eo(e3);
8915
+ let o2 = To(e3);
8916
8916
  if (o2 === void 0) return;
8917
8917
  if (o2.kind === GridCellKind.Custom) {
8918
8918
  assert(e3.kind === GridCellKind.Custom);
@@ -8937,7 +8937,7 @@ let __tla = (async () => {
8937
8937
  }
8938
8938
  }
8939
8939
  }
8940
- let n2 = $.columns, r2 = $.rows, i2 = ((_a3 = Ro.current) == null ? void 0 : _a3.contains(document.activeElement)) === true || ((_b2 = s.current) == null ? void 0 : _b2.contains(document.activeElement)) === true, a2;
8940
+ let n2 = $.columns, r2 = $.rows, i2 = ((_a3 = Lo.current) == null ? void 0 : _a3.contains(document.activeElement)) === true || ((_b2 = s.current) == null ? void 0 : _b2.contains(document.activeElement)) === true, a2;
8941
8941
  if ($.current === void 0 ? n2.length === 1 ? a2 = [
8942
8942
  n2.first() ?? 0,
8943
8943
  0
@@ -8967,7 +8967,7 @@ let __tla = (async () => {
8967
8967
  let [s2, c2] = a2, l2 = [];
8968
8968
  do {
8969
8969
  if (fi === void 0) {
8970
- let e3 = $o(a2), i4 = r3 ?? (n3 == null ? void 0 : n3.map((e4) => e4.map((e5) => e5.rawValue).join(" ")).join(" ")) ?? "", o3 = t2(e3, a2, i4, void 0);
8970
+ let e3 = Qo(a2), i4 = r3 ?? (n3 == null ? void 0 : n3.map((e4) => e4.map((e5) => e5.rawValue).join(" ")).join(" ")) ?? "", o3 = t2(e3, a2, i4, void 0);
8971
8971
  o3 !== void 0 && l2.push(o3);
8972
8972
  break;
8973
8973
  }
@@ -8989,36 +8989,36 @@ let __tla = (async () => {
8989
8989
  n4 + s2,
8990
8990
  e3 + c2
8991
8991
  ], [a3, o3] = r5;
8992
- if (a3 >= No.length || o3 >= Uo) continue;
8993
- let u2 = t2($o(r5), r5, i4.rawValue, i4.formatted);
8992
+ if (a3 >= Mo.length || o3 >= Ho) continue;
8993
+ let u2 = t2(Qo(r5), r5, i4.rawValue, i4.formatted);
8994
8994
  u2 !== void 0 && l2.push(u2);
8995
8995
  }
8996
8996
  }
8997
8997
  } while (false);
8998
- Wo(l2), (_c3 = Vo.current) == null ? void 0 : _c3.damage(l2.map((e3) => ({
8998
+ Uo(l2), (_c3 = Bo.current) == null ? void 0 : _c3.damage(l2.map((e3) => ({
8999
8999
  cell: e3.location
9000
9000
  })));
9001
9001
  }
9002
9002
  }, [
9003
9003
  j,
9004
- Eo,
9005
- $o,
9004
+ To,
9005
+ Qo,
9006
9006
  $,
9007
- Za.paste,
9008
- Ro,
9009
- No.length,
9010
- Wo,
9007
+ Xa.paste,
9008
+ Lo,
9009
+ Mo.length,
9011
9010
  Uo,
9011
+ Ho,
9012
9012
  fi,
9013
9013
  Q,
9014
9014
  Z
9015
9015
  ]);
9016
- useEventListener("paste", tc, f, false, true);
9017
- let nc = import_react.useCallback(async (e2, t2) => {
9016
+ useEventListener("paste", ec, f, false, true);
9017
+ let tc = import_react.useCallback(async (e2, t2) => {
9018
9018
  var _a3, _b2;
9019
- if (!Za.copy) return;
9020
- let n2 = t2 === true || ((_a3 = Ro.current) == null ? void 0 : _a3.contains(document.activeElement)) === true || ((_b2 = s.current) == null ? void 0 : _b2.contains(document.activeElement)) === true, r2 = $.columns, i2 = $.rows, a2 = (t3, n3) => {
9021
- copyToClipboard$1(mi ? [
9019
+ if (!Xa.copy) return;
9020
+ let n2 = t2 === true || ((_a3 = Lo.current) == null ? void 0 : _a3.contains(document.activeElement)) === true || ((_b2 = s.current) == null ? void 0 : _b2.contains(document.activeElement)) === true, r2 = $.columns, i2 = $.rows, a2 = (t3, n3) => {
9021
+ copyToClipboard$1(pi ? [
9022
9022
  n3.map((e3) => ({
9023
9023
  kind: GridCellKind.Text,
9024
9024
  data: S[e3].title,
@@ -9028,32 +9028,32 @@ let __tla = (async () => {
9028
9028
  ...t3
9029
9029
  ] : t3, n3, e2);
9030
9030
  };
9031
- if (n2 && so !== void 0) {
9031
+ if (n2 && oo !== void 0) {
9032
9032
  if ($.current !== void 0) {
9033
- let e3 = so($.current.range, oo.current.signal);
9033
+ let e3 = oo($.current.range, ao.current.signal);
9034
9034
  typeof e3 != "object" && (e3 = await e3()), a2(e3, (0, import_range.default)($.current.range.x - Q, $.current.range.x + $.current.range.width - Q));
9035
9035
  } else if (i2 !== void 0 && i2.length > 0) {
9036
9036
  let e3 = [
9037
9037
  ...i2
9038
9038
  ].map((e4) => {
9039
- let t3 = so({
9039
+ let t3 = oo({
9040
9040
  x: Q,
9041
9041
  y: e4,
9042
9042
  width: S.length,
9043
9043
  height: 1
9044
- }, oo.current.signal);
9044
+ }, ao.current.signal);
9045
9045
  return typeof t3 == "object" ? t3[0] : t3().then((e5) => e5[0]);
9046
9046
  });
9047
9047
  e3.some((e4) => e4 instanceof Promise) ? a2(await Promise.all(e3), (0, import_range.default)(S.length)) : a2(e3, (0, import_range.default)(S.length));
9048
9048
  } else if (r2.length > 0) {
9049
9049
  let e3 = [], t3 = [];
9050
9050
  for (let n3 of r2) {
9051
- let r3 = so({
9051
+ let r3 = oo({
9052
9052
  x: n3,
9053
9053
  y: 0,
9054
9054
  width: 1,
9055
9055
  height: Z
9056
- }, oo.current.signal);
9056
+ }, ao.current.signal);
9057
9057
  typeof r3 != "object" && (r3 = await r3()), e3.push(r3), t3.push(n3 - Q);
9058
9058
  }
9059
9059
  e3.length === 1 ? a2(e3[0], t3) : a2(e3.reduce((e4, t4) => e4.map((e5, n3) => [
@@ -9064,17 +9064,17 @@ let __tla = (async () => {
9064
9064
  }
9065
9065
  }, [
9066
9066
  S,
9067
- so,
9067
+ oo,
9068
9068
  $,
9069
- Za.copy,
9069
+ Xa.copy,
9070
9070
  Q,
9071
- Ro,
9071
+ Lo,
9072
9072
  Z,
9073
- mi
9073
+ pi
9074
9074
  ]);
9075
- useEventListener("copy", nc, f, false, false), useEventListener("cut", import_react.useCallback(async (e2) => {
9075
+ useEventListener("copy", tc, f, false, false), useEventListener("cut", import_react.useCallback(async (e2) => {
9076
9076
  var _a3, _b2;
9077
- if (Za.cut && (((_a3 = Ro.current) == null ? void 0 : _a3.contains(document.activeElement)) === true || ((_b2 = s.current) == null ? void 0 : _b2.contains(document.activeElement)) === true) && (await nc(e2), $.current !== void 0)) {
9077
+ if (Xa.cut && (((_a3 = Lo.current) == null ? void 0 : _a3.contains(document.activeElement)) === true || ((_b2 = s.current) == null ? void 0 : _b2.contains(document.activeElement)) === true) && (await tc(e2), $.current !== void 0)) {
9078
9078
  let e3 = {
9079
9079
  current: {
9080
9080
  cell: $.current.cell,
@@ -9083,24 +9083,24 @@ let __tla = (async () => {
9083
9083
  },
9084
9084
  rows: CompactSelection.empty(),
9085
9085
  columns: CompactSelection.empty()
9086
- }, t2 = vo == null ? void 0 : vo(e3);
9086
+ }, t2 = _o == null ? void 0 : _o(e3);
9087
9087
  if (t2 === false || (e3 = t2 === true ? e3 : t2, e3.current === void 0)) return;
9088
- Xs(e3.current.range);
9088
+ Ys(e3.current.range);
9089
9089
  }
9090
9090
  }, [
9091
- Xs,
9091
+ Ys,
9092
9092
  $,
9093
- Za.cut,
9094
- nc,
9095
- Ro,
9096
- vo
9093
+ Xa.cut,
9094
+ tc,
9095
+ Lo,
9096
+ _o
9097
9097
  ]), f, false, false);
9098
- let rc = import_react.useCallback((e2, t2) => {
9099
- if (zr !== void 0) {
9098
+ let nc = import_react.useCallback((e2, t2) => {
9099
+ if (Rr !== void 0) {
9100
9100
  Q !== 0 && (e2 = e2.map((e3) => [
9101
9101
  e3[0] - Q,
9102
9102
  e3[1]
9103
- ])), zr(e2, t2);
9103
+ ])), Rr(e2, t2);
9104
9104
  return;
9105
9105
  }
9106
9106
  if (e2.length === 0 || t2 === -1) return;
@@ -9108,51 +9108,51 @@ let __tla = (async () => {
9108
9108
  u.current !== void 0 && u.current[0] === n2 && u.current[1] === r2 || (u.current = [
9109
9109
  n2,
9110
9110
  r2
9111
- ], qs(n2, r2, false, false));
9111
+ ], Ks(n2, r2, false, false));
9112
9112
  }, [
9113
- zr,
9113
+ Rr,
9114
9114
  Q,
9115
- qs
9116
- ]), [ic, ac] = ((_c2 = Ai == null ? void 0 : Ai.current) == null ? void 0 : _c2.cell) ?? [], oc = import_react.useRef(is);
9117
- oc.current = is, import_react.useLayoutEffect(() => {
9115
+ Ks
9116
+ ]), [rc, ic] = ((_c2 = ki == null ? void 0 : ki.current) == null ? void 0 : _c2.cell) ?? [], ac = import_react.useRef(rs);
9117
+ ac.current = rs, import_react.useLayoutEffect(() => {
9118
9118
  var _a3, _b2, _c3, _d;
9119
- Ks.current && !Fo.current && ic !== void 0 && ac !== void 0 && (ic !== ((_b2 = (_a3 = uo.current) == null ? void 0 : _a3.current) == null ? void 0 : _b2.cell[0]) || ac !== ((_d = (_c3 = uo.current) == null ? void 0 : _c3.current) == null ? void 0 : _d.cell[1])) && oc.current(ic, ac), Fo.current = false;
9119
+ Gs.current && !Po.current && rc !== void 0 && ic !== void 0 && (rc !== ((_b2 = (_a3 = lo.current) == null ? void 0 : _a3.current) == null ? void 0 : _b2.cell[0]) || ic !== ((_d = (_c3 = lo.current) == null ? void 0 : _c3.current) == null ? void 0 : _d.cell[1])) && ac.current(rc, ic), Po.current = false;
9120
9120
  }, [
9121
- ic,
9122
- ac
9121
+ rc,
9122
+ ic
9123
9123
  ]);
9124
- let sc = $.current !== void 0 && ($.current.cell[0] >= No.length || $.current.cell[1] >= Uo);
9124
+ let oc = $.current !== void 0 && ($.current.cell[0] >= Mo.length || $.current.cell[1] >= Ho);
9125
9125
  import_react.useLayoutEffect(() => {
9126
- sc && fo(emptyGridSelection, false);
9126
+ oc && uo(emptyGridSelection, false);
9127
9127
  }, [
9128
- sc,
9129
- fo
9128
+ oc,
9129
+ uo
9130
9130
  ]);
9131
- let cc = import_react.useMemo(() => eo === true && (Ii == null ? void 0 : Ii.tint) === true ? CompactSelection.fromSingleSelection(Uo - 1) : CompactSelection.empty(), [
9132
- Uo,
9133
- eo,
9134
- Ii == null ? void 0 : Ii.tint
9135
- ]), lc = import_react.useCallback((e2) => typeof Vi == "boolean" ? Vi : (Vi == null ? void 0 : Vi(e2 - Q)) ?? true, [
9131
+ let sc = import_react.useMemo(() => $a === true && (Fi == null ? void 0 : Fi.tint) === true ? CompactSelection.fromSingleSelection(Ho - 1) : CompactSelection.empty(), [
9132
+ Ho,
9133
+ $a,
9134
+ Fi == null ? void 0 : Fi.tint
9135
+ ]), cc = import_react.useCallback((e2) => typeof Bi == "boolean" ? Bi : (Bi == null ? void 0 : Bi(e2 - Q)) ?? true, [
9136
9136
  Q,
9137
- Vi
9138
- ]), uc = import_react.useMemo(() => {
9139
- if (xs === void 0 || s.current === null) return null;
9140
- let { bounds: e2, group: t2 } = xs, n2 = s.current.getBoundingClientRect();
9137
+ Bi
9138
+ ]), lc = import_react.useMemo(() => {
9139
+ if (bs === void 0 || s.current === null) return null;
9140
+ let { bounds: e2, group: t2 } = bs, n2 = s.current.getBoundingClientRect();
9141
9141
  return import_react.createElement(GroupRename, {
9142
9142
  bounds: e2,
9143
9143
  group: t2,
9144
9144
  canvasBounds: n2,
9145
- onClose: () => Ss(void 0),
9145
+ onClose: () => xs(void 0),
9146
9146
  onFinish: (e3) => {
9147
- Ss(void 0), Rr == null ? void 0 : Rr(t2, e3);
9147
+ xs(void 0), Lr == null ? void 0 : Lr(t2, e3);
9148
9148
  }
9149
9149
  });
9150
9150
  }, [
9151
- Rr,
9152
- xs
9153
- ]), dc = Math.min(No.length, hi + ($a ? 1 : 0));
9151
+ Lr,
9152
+ bs
9153
+ ]), uc = Math.min(Mo.length, mi + (Qa ? 1 : 0));
9154
9154
  import_react.useImperativeHandle(t, () => ({
9155
- appendRow: (e2, t2) => cs(e2 + Q, t2),
9155
+ appendRow: (e2, t2) => ss(e2 + Q, t2),
9156
9156
  updateCells: (e2) => {
9157
9157
  var _a3;
9158
9158
  return Q !== 0 && (e2 = e2.map((e3) => ({
@@ -9160,31 +9160,31 @@ let __tla = (async () => {
9160
9160
  e3.cell[0] + Q,
9161
9161
  e3.cell[1]
9162
9162
  ]
9163
- }))), (_a3 = Vo.current) == null ? void 0 : _a3.damage(e2);
9163
+ }))), (_a3 = Bo.current) == null ? void 0 : _a3.damage(e2);
9164
9164
  },
9165
9165
  getBounds: (e2, t2) => {
9166
9166
  var _a3;
9167
- if (!((s == null ? void 0 : s.current) === null || (Ro == null ? void 0 : Ro.current) === null)) {
9167
+ if (!((s == null ? void 0 : s.current) === null || (Lo == null ? void 0 : Lo.current) === null)) {
9168
9168
  if (e2 === void 0 && t2 === void 0) {
9169
- let e3 = s.current.getBoundingClientRect(), t3 = e3.width / Ro.current.clientWidth;
9169
+ let e3 = s.current.getBoundingClientRect(), t3 = e3.width / Lo.current.clientWidth;
9170
9170
  return {
9171
- x: e3.x - Ro.current.scrollLeft * t3,
9172
- y: e3.y - Ro.current.scrollTop * t3,
9173
- width: Ro.current.scrollWidth * t3,
9174
- height: Ro.current.scrollHeight * t3
9171
+ x: e3.x - Lo.current.scrollLeft * t3,
9172
+ y: e3.y - Lo.current.scrollTop * t3,
9173
+ width: Lo.current.scrollWidth * t3,
9174
+ height: Lo.current.scrollHeight * t3
9175
9175
  };
9176
9176
  }
9177
- return (_a3 = Vo.current) == null ? void 0 : _a3.getBounds((e2 ?? 0) + Q, t2);
9177
+ return (_a3 = Bo.current) == null ? void 0 : _a3.getBounds((e2 ?? 0) + Q, t2);
9178
9178
  }
9179
9179
  },
9180
9180
  focus: () => {
9181
9181
  var _a3;
9182
- return (_a3 = Vo.current) == null ? void 0 : _a3.focus();
9182
+ return (_a3 = Bo.current) == null ? void 0 : _a3.focus();
9183
9183
  },
9184
9184
  emit: async (e2) => {
9185
9185
  switch (e2) {
9186
9186
  case "delete":
9187
- $s({
9187
+ Qs({
9188
9188
  bounds: void 0,
9189
9189
  cancel: () => void 0,
9190
9190
  stopPropagation: () => void 0,
@@ -9200,7 +9200,7 @@ let __tla = (async () => {
9200
9200
  });
9201
9201
  break;
9202
9202
  case "fill-right":
9203
- $s({
9203
+ Qs({
9204
9204
  bounds: void 0,
9205
9205
  cancel: () => void 0,
9206
9206
  stopPropagation: () => void 0,
@@ -9216,7 +9216,7 @@ let __tla = (async () => {
9216
9216
  });
9217
9217
  break;
9218
9218
  case "fill-down":
9219
- $s({
9219
+ Qs({
9220
9220
  bounds: void 0,
9221
9221
  cancel: () => void 0,
9222
9222
  stopPropagation: () => void 0,
@@ -9232,34 +9232,34 @@ let __tla = (async () => {
9232
9232
  });
9233
9233
  break;
9234
9234
  case "copy":
9235
- await nc(void 0, true);
9235
+ await tc(void 0, true);
9236
9236
  break;
9237
9237
  case "paste":
9238
- await tc();
9238
+ await ec();
9239
9239
  break;
9240
9240
  }
9241
9241
  },
9242
- scrollTo: is,
9242
+ scrollTo: rs,
9243
9243
  remeasureColumns: (e2) => {
9244
- for (let t2 of e2) Ts(t2 + Q);
9244
+ for (let t2 of e2) ws(t2 + Q);
9245
9245
  }
9246
9246
  }), [
9247
- cs,
9248
- Ts,
9249
- Ro,
9250
- nc,
9251
- $s,
9247
+ ss,
9248
+ ws,
9249
+ Lo,
9252
9250
  tc,
9251
+ Qs,
9252
+ ec,
9253
9253
  Q,
9254
- is
9254
+ rs
9255
9255
  ]);
9256
- let [fc, pc] = Fs ?? [], mc = import_react.useCallback((e2) => {
9256
+ let [dc, fc] = Ps ?? [], pc = import_react.useCallback((e2) => {
9257
9257
  let [t2, n2] = e2;
9258
9258
  if (n2 === -1) {
9259
- Zr !== "none" && (xo(CompactSelection.fromSingleSelection(t2), void 0, false), Ho());
9259
+ Xr !== "none" && (bo(CompactSelection.fromSingleSelection(t2), void 0, false), Vo());
9260
9260
  return;
9261
9261
  }
9262
- fc === t2 && pc === n2 || (yo({
9262
+ dc === t2 && fc === n2 || (vo({
9263
9263
  cell: e2,
9264
9264
  range: {
9265
9265
  x: t2,
@@ -9267,171 +9267,171 @@ let __tla = (async () => {
9267
9267
  width: 1,
9268
9268
  height: 1
9269
9269
  }
9270
- }, true, false, "keyboard-nav"), is(t2, n2));
9270
+ }, true, false, "keyboard-nav"), rs(t2, n2));
9271
9271
  }, [
9272
- Zr,
9273
- Ho,
9274
- is,
9272
+ Xr,
9273
+ Vo,
9274
+ rs,
9275
+ dc,
9275
9276
  fc,
9276
- pc,
9277
- yo,
9278
- xo
9279
- ]), [hc, gc] = import_react.useState(false), _c = import_react.useRef((0, import_debounce.default)((e2) => {
9280
- gc(e2);
9281
- }, 5)), vc = import_react.useCallback(() => {
9282
- _c.current(true), $.current === void 0 && $.columns.length === 0 && $.rows.length === 0 && c === void 0 && yo({
9277
+ vo,
9278
+ bo
9279
+ ]), [mc, hc] = import_react.useState(false), gc = import_react.useRef((0, import_debounce.default)((e2) => {
9280
+ hc(e2);
9281
+ }, 5)), _c = import_react.useCallback(() => {
9282
+ gc.current(true), $.current === void 0 && $.columns.length === 0 && $.rows.length === 0 && c === void 0 && vo({
9283
9283
  cell: [
9284
9284
  Q,
9285
- Bo
9285
+ zo
9286
9286
  ],
9287
9287
  range: {
9288
9288
  x: Q,
9289
- y: Bo,
9289
+ y: zo,
9290
9290
  width: 1,
9291
9291
  height: 1
9292
9292
  }
9293
9293
  }, true, false, "keyboard-select");
9294
9294
  }, [
9295
- Bo,
9295
+ zo,
9296
9296
  $,
9297
9297
  c,
9298
9298
  Q,
9299
- yo
9300
- ]), yc = import_react.useCallback(() => {
9301
- _c.current(false);
9302
- }, []), [bc, xc] = import_react.useMemo(() => {
9303
- let e2, t2 = (Xi == null ? void 0 : Xi.scrollbarWidthOverride) ?? getScrollBarWidth(), n2 = Z + (eo ? 1 : 0);
9304
- if (typeof Ga == "number") e2 = Ao + n2 * Ga;
9299
+ vo
9300
+ ]), vc = import_react.useCallback(() => {
9301
+ gc.current(false);
9302
+ }, []), [yc, bc] = import_react.useMemo(() => {
9303
+ let e2, t2 = (Yi == null ? void 0 : Yi.scrollbarWidthOverride) ?? getScrollBarWidth(), n2 = Z + ($a ? 1 : 0);
9304
+ if (typeof Wa == "number") e2 = ko + n2 * Wa;
9305
9305
  else {
9306
9306
  let t3 = 0, r3 = Math.min(n2, 10);
9307
- for (let e3 = 0; e3 < r3; e3++) t3 += Ga(e3);
9308
- t3 = Math.floor(t3 / r3), e2 = Ao + n2 * t3;
9307
+ for (let e3 = 0; e3 < r3; e3++) t3 += Wa(e3);
9308
+ t3 = Math.floor(t3 / r3), e2 = ko + n2 * t3;
9309
9309
  }
9310
9310
  e2 += t2;
9311
- let r2 = No.reduce((e3, t3) => t3.width + e3, 0) + t2;
9311
+ let r2 = Mo.reduce((e3, t3) => t3.width + e3, 0) + t2;
9312
9312
  return [
9313
9313
  `${Math.min(1e5, r2)}px`,
9314
9314
  `${Math.min(1e5, e2)}px`
9315
9315
  ];
9316
9316
  }, [
9317
- No,
9318
- Xi == null ? void 0 : Xi.scrollbarWidthOverride,
9319
- Ga,
9317
+ Mo,
9318
+ Yi == null ? void 0 : Yi.scrollbarWidthOverride,
9319
+ Wa,
9320
9320
  Z,
9321
- eo,
9322
- Ao
9323
- ]), Sc = import_react.useMemo(() => makeCSSStyle(So), [
9324
- So
9321
+ $a,
9322
+ ko
9323
+ ]), xc = import_react.useMemo(() => makeCSSStyle(xo), [
9324
+ xo
9325
9325
  ]);
9326
9326
  return import_react.createElement(ThemeContext.Provider, {
9327
- value: So
9327
+ value: xo
9328
9328
  }, import_react.createElement(DataEditorContainer, {
9329
- style: Sc,
9329
+ style: xc,
9330
9330
  className: V,
9331
- inWidth: y ?? bc,
9332
- inHeight: x ?? xc
9331
+ inWidth: y ?? yc,
9332
+ inHeight: x ?? bc
9333
9333
  }, import_react.createElement(data_grid_search_default, {
9334
- fillHandle: Yi,
9335
- drawFocusRing: Ca,
9336
- experimental: Xi,
9337
- fixedShadowX: Zi,
9338
- fixedShadowY: Qi,
9339
- getRowThemeOverride: Wa,
9340
- headerIcons: $i,
9341
- imageWindowLoader: ea,
9342
- initialSize: ta,
9343
- isDraggable: na,
9344
- onDragLeave: ra,
9345
- onRowMoved: ia,
9346
- overscrollX: Ya,
9347
- overscrollY: Xa,
9348
- preventDiagonalScrolling: sa,
9349
- rightElement: ca,
9350
- rightElementProps: la,
9351
- smoothScrollX: da,
9352
- smoothScrollY: fa,
9334
+ fillHandle: Ji,
9335
+ drawFocusRing: Sa,
9336
+ experimental: Yi,
9337
+ fixedShadowX: Xi,
9338
+ fixedShadowY: Zi,
9339
+ getRowThemeOverride: Ua,
9340
+ headerIcons: Qi,
9341
+ imageWindowLoader: $i,
9342
+ initialSize: ea,
9343
+ isDraggable: ta,
9344
+ onDragLeave: na,
9345
+ onRowMoved: ra,
9346
+ overscrollX: Ja,
9347
+ overscrollY: Ya,
9348
+ preventDiagonalScrolling: oa,
9349
+ rightElement: sa,
9350
+ rightElementProps: ca,
9351
+ smoothScrollX: ua,
9352
+ smoothScrollY: da,
9353
9353
  className: V,
9354
- enableGroups: ko,
9355
- onCanvasFocused: vc,
9356
- onCanvasBlur: yc,
9354
+ enableGroups: Oo,
9355
+ onCanvasFocused: _c,
9356
+ onCanvasBlur: vc,
9357
9357
  canvasRef: s,
9358
- onContextMenu: ec,
9359
- theme: So,
9360
- cellXOffset: zo,
9361
- cellYOffset: Bo,
9362
- accessibilityHeight: Lo.height,
9363
- onDragEnd: Bs,
9364
- columns: No,
9365
- nonGrowWidth: Oo,
9366
- drawHeader: go,
9358
+ onContextMenu: $s,
9359
+ theme: xo,
9360
+ cellXOffset: Ro,
9361
+ cellYOffset: zo,
9362
+ accessibilityHeight: Io.height,
9363
+ onDragEnd: zs,
9364
+ columns: Mo,
9365
+ nonGrowWidth: Do,
9366
+ drawHeader: ho,
9367
9367
  onColumnProposeMove: I,
9368
- drawCell: _o,
9369
- disabledRows: cc,
9370
- freezeColumns: dc,
9368
+ drawCell: go,
9369
+ disabledRows: sc,
9370
+ freezeColumns: uc,
9371
9371
  lockColumns: Q,
9372
9372
  firstColAccessible: Q === 0,
9373
- getCellContent: $o,
9374
- minColumnWidth: La,
9375
- maxColumnWidth: Ra,
9373
+ getCellContent: Qo,
9374
+ minColumnWidth: Ia,
9375
+ maxColumnWidth: La,
9376
9376
  searchInputRef: o,
9377
- showSearch: io,
9378
- onSearchClose: ao,
9379
- highlightRegions: Zo,
9380
- getCellsForSelection: so,
9381
- getGroupDetails: es,
9382
- headerHeight: Ka,
9383
- isFocused: hc,
9384
- groupHeaderHeight: ko ? qa : 0,
9385
- freezeTrailingRows: Li + (eo && (Ii == null ? void 0 : Ii.sticky) === true ? 1 : 0),
9386
- hasAppendRow: eo,
9387
- onColumnResize: po,
9388
- onColumnResizeEnd: mo,
9389
- onColumnResizeStart: ho,
9390
- onCellFocused: mc,
9391
- onColumnMoved: Ls,
9392
- onDragStart: zs,
9393
- onHeaderMenuClick: Ns,
9394
- onHeaderIndicatorClick: Ps,
9395
- onItemHovered: Ws,
9377
+ showSearch: ro,
9378
+ onSearchClose: io,
9379
+ highlightRegions: Xo,
9380
+ getCellsForSelection: oo,
9381
+ getGroupDetails: $o,
9382
+ headerHeight: Ga,
9383
+ isFocused: mc,
9384
+ groupHeaderHeight: Oo ? Ka : 0,
9385
+ freezeTrailingRows: Ii + ($a && (Fi == null ? void 0 : Fi.sticky) === true ? 1 : 0),
9386
+ hasAppendRow: $a,
9387
+ onColumnResize: fo,
9388
+ onColumnResizeEnd: po,
9389
+ onColumnResizeStart: mo,
9390
+ onCellFocused: pc,
9391
+ onColumnMoved: Is,
9392
+ onDragStart: Rs,
9393
+ onHeaderMenuClick: Ms,
9394
+ onHeaderIndicatorClick: Ns,
9395
+ onItemHovered: Us,
9396
9396
  isFilling: (c == null ? void 0 : c.fillHandle) === true,
9397
- onMouseMove: Ms,
9398
- onKeyDown: $s,
9399
- onKeyUp: Ur,
9400
- onMouseDown: bs,
9401
- onMouseUp: js,
9402
- onDragOverCell: Hi,
9403
- onDrop: Ui,
9404
- onSearchResultsChanged: rc,
9405
- onVisibleRegionChanged: Is,
9406
- clientSize: Co,
9407
- rowHeight: Ga,
9397
+ onMouseMove: js,
9398
+ onKeyDown: Qs,
9399
+ onKeyUp: Wr,
9400
+ onMouseDown: ys,
9401
+ onMouseUp: As,
9402
+ onDragOverCell: Vi,
9403
+ onDrop: Hi,
9404
+ onSearchResultsChanged: nc,
9405
+ onVisibleRegionChanged: Fs,
9406
+ clientSize: So,
9407
+ rowHeight: Wa,
9408
9408
  searchResults: K,
9409
9409
  searchValue: Br,
9410
9410
  onSearchValueChange: q,
9411
- rows: Uo,
9412
- scrollRef: Ro,
9411
+ rows: Ho,
9412
+ scrollRef: Lo,
9413
9413
  selection: $,
9414
- translateX: Lo.tx,
9415
- translateY: Lo.ty,
9416
- verticalBorder: lc,
9417
- gridRef: Vo,
9418
- getCellRenderer: Eo,
9419
- resizeIndicator: ba
9420
- }), uc, i !== void 0 && import_react.createElement(import_react.Suspense, {
9414
+ translateX: Io.tx,
9415
+ translateY: Io.ty,
9416
+ verticalBorder: cc,
9417
+ gridRef: Bo,
9418
+ getCellRenderer: To,
9419
+ resizeIndicator: ya
9420
+ }), lc, i !== void 0 && import_react.createElement(import_react.Suspense, {
9421
9421
  fallback: null
9422
9422
  }, import_react.createElement(DataGridOverlayEditor, {
9423
9423
  ...i,
9424
- validateCell: lo,
9424
+ validateCell: co,
9425
9425
  bloom: P,
9426
- id: Ys,
9427
- getCellRenderer: Eo,
9428
- className: (Xi == null ? void 0 : Xi.isSubGrid) === true ? "click-outside-ignore" : void 0,
9429
- provideEditor: Fi,
9426
+ id: Js,
9427
+ getCellRenderer: To,
9428
+ className: (Yi == null ? void 0 : Yi.isSubGrid) === true ? "click-outside-ignore" : void 0,
9429
+ provideEditor: Pi,
9430
9430
  imageEditorOverride: m,
9431
- onFinishEditing: Js,
9431
+ onFinishEditing: qs,
9432
9432
  markdownDivCreateNode: g,
9433
- isOutsideClick: va,
9434
- customEventTarget: Xi == null ? void 0 : Xi.eventTarget
9433
+ isOutsideClick: _a,
9434
+ customEventTarget: Yi == null ? void 0 : Yi.eventTarget
9435
9435
  }))));
9436
9436
  });
9437
9437
  var defaultCellMaxSize = 20;
@@ -10398,36 +10398,36 @@ let __tla = (async () => {
10398
10398
  "Rename column"
10399
10399
  ]
10400
10400
  }), t[7] = f) : f = t[7];
10401
- let m;
10402
- t[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = (0, import_jsx_runtime.jsx)(Label, {
10401
+ let h;
10402
+ t[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = (0, import_jsx_runtime.jsx)(Label, {
10403
10403
  htmlFor: "rename-input",
10404
10404
  children: "Column name"
10405
- }), t[8] = m) : m = t[8];
10406
- let g;
10407
- t[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = (e2) => o(e2.target.value), t[9] = g) : g = t[9];
10408
- let x;
10409
- t[10] !== u || t[11] !== a ? (x = (0, import_jsx_runtime.jsxs)("div", {
10405
+ }), t[8] = h) : h = t[8];
10406
+ let y;
10407
+ t[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = (e2) => o(e2.target.value), t[9] = y) : y = t[9];
10408
+ let S;
10409
+ t[10] !== u || t[11] !== a ? (S = (0, import_jsx_runtime.jsxs)("div", {
10410
10410
  children: [
10411
- m,
10411
+ h,
10412
10412
  (0, import_jsx_runtime.jsx)(Input, {
10413
10413
  value: a,
10414
- onChange: g,
10414
+ onChange: y,
10415
10415
  placeholder: "Enter new column name",
10416
10416
  className: "mt-1",
10417
10417
  onKeyDown: u
10418
10418
  })
10419
10419
  ]
10420
- }), t[10] = u, t[11] = a, t[12] = x) : x = t[12];
10421
- let C = !a.trim(), E;
10422
- t[13] !== c || t[14] !== C ? (E = (0, import_jsx_runtime.jsx)(Button, {
10420
+ }), t[10] = u, t[11] = a, t[12] = S) : S = t[12];
10421
+ let C = !a.trim(), D;
10422
+ t[13] !== c || t[14] !== C ? (D = (0, import_jsx_runtime.jsx)(Button, {
10423
10423
  onClick: c,
10424
10424
  disabled: C,
10425
10425
  size: "sm",
10426
10426
  className: "w-full",
10427
10427
  children: "Rename"
10428
- }), t[13] = c, t[14] = C, t[15] = E) : E = t[15];
10429
- let O;
10430
- return t[16] !== x || t[17] !== E ? (O = (0, import_jsx_runtime.jsxs)(DropdownMenuSub, {
10428
+ }), t[13] = c, t[14] = C, t[15] = D) : D = t[15];
10429
+ let k;
10430
+ return t[16] !== S || t[17] !== D ? (k = (0, import_jsx_runtime.jsxs)(DropdownMenuSub, {
10431
10431
  children: [
10432
10432
  f,
10433
10433
  (0, import_jsx_runtime.jsx)(DropdownMenuPortal, {
@@ -10436,128 +10436,128 @@ let __tla = (async () => {
10436
10436
  children: (0, import_jsx_runtime.jsxs)("div", {
10437
10437
  className: "space-y-3",
10438
10438
  children: [
10439
- x,
10440
- E
10439
+ S,
10440
+ D
10441
10441
  ]
10442
10442
  })
10443
10443
  })
10444
10444
  })
10445
10445
  ]
10446
- }), t[16] = x, t[17] = E, t[18] = O) : O = t[18], O;
10446
+ }), t[16] = S, t[17] = D, t[18] = k) : k = t[18], k;
10447
10447
  }, AddColumnSub = (e) => {
10448
- let t = (0, import_compiler_runtime.c)(77), { direction: n, onAdd: r, onCancel: i } = e, [a, o] = (0, import_react.useState)(""), [s, c] = (0, import_react.useState)("string"), f, x, C, E, D, O, A, M, N, P, F, Fr, B, V, H;
10448
+ let t = (0, import_compiler_runtime.c)(77), { direction: n, onAdd: r, onCancel: i } = e, [a, o] = (0, import_react.useState)(""), [s, u] = (0, import_react.useState)("string"), y, S, C, E, D, k, j, M, N, P, L, Pr, Fr, V, H;
10449
10449
  if (t[0] !== a || t[1] !== s || t[2] !== n || t[3] !== r || t[4] !== i) {
10450
10450
  let e2 = [
10451
10451
  "string",
10452
10452
  "number",
10453
10453
  "boolean",
10454
10454
  "datetime"
10455
- ], Ir;
10456
- t[20] !== a || t[21] !== s || t[22] !== r ? (Ir = () => {
10457
- a.trim() && (r(a.trim(), s), o(""), c("string"));
10458
- }, t[20] = a, t[21] = s, t[22] = r, t[23] = Ir) : Ir = t[23], O = Ir;
10459
- let Lr2;
10460
- t[24] !== O || t[25] !== i ? (Lr2 = (e3) => {
10461
- e3.key === "Enter" ? O() : e3.key === "Escape" && i();
10462
- }, t[24] = O, t[25] = i, t[26] = Lr2) : Lr2 = t[26];
10463
- let U2 = Lr2;
10455
+ ], B;
10456
+ t[20] !== a || t[21] !== s || t[22] !== r ? (B = () => {
10457
+ a.trim() && (r(a.trim(), s), o(""), u("string"));
10458
+ }, t[20] = a, t[21] = s, t[22] = r, t[23] = B) : B = t[23], k = B;
10459
+ let Ir2;
10460
+ t[24] !== k || t[25] !== i ? (Ir2 = (e3) => {
10461
+ e3.key === "Enter" ? k() : e3.key === "Escape" && i();
10462
+ }, t[24] = k, t[25] = i, t[26] = Ir2) : Ir2 = t[26];
10463
+ let U2 = Ir2;
10464
10464
  D = DropdownMenuSub;
10465
- let Rr2;
10466
- t[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Rr2 = (0, import_jsx_runtime.jsx)(Plus, {
10465
+ let Lr2;
10466
+ t[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Lr2 = (0, import_jsx_runtime.jsx)(Plus, {
10467
10467
  className: "mr-2 h-3.5 w-3.5"
10468
- }), t[27] = Rr2) : Rr2 = t[27], t[28] === n ? H = t[29] : (H = (0, import_jsx_runtime.jsxs)(DropdownMenuSubTrigger, {
10468
+ }), t[27] = Lr2) : Lr2 = t[27], t[28] === n ? H = t[29] : (H = (0, import_jsx_runtime.jsxs)(DropdownMenuSubTrigger, {
10469
10469
  children: [
10470
- Rr2,
10470
+ Lr2,
10471
10471
  "Add column to the ",
10472
10472
  n
10473
10473
  ]
10474
- }), t[28] = n, t[29] = H), E = DropdownMenuPortal, C = DropdownMenuSubContent, V = "w-64 p-4", Fr = "space-y-3";
10474
+ }), t[28] = n, t[29] = H), E = DropdownMenuPortal, C = DropdownMenuSubContent, V = "w-64 p-4", Pr = "space-y-3";
10475
10475
  let W2 = `add-column-input-${n}`, G2;
10476
10476
  t[30] === W2 ? G2 = t[31] : (G2 = (0, import_jsx_runtime.jsx)(Label, {
10477
10477
  htmlFor: W2,
10478
10478
  children: "Column name"
10479
10479
  }), t[30] = W2, t[31] = G2);
10480
- let zr2 = `add-column-input-${n}`, K2;
10480
+ let Rr2 = `add-column-input-${n}`, K2;
10481
10481
  t[32] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (K2 = (e3) => o(e3.target.value), t[32] = K2) : K2 = t[32];
10482
10482
  let q2;
10483
- t[33] !== a || t[34] !== U2 || t[35] !== zr2 ? (q2 = (0, import_jsx_runtime.jsx)(Input, {
10484
- id: zr2,
10483
+ t[33] !== a || t[34] !== U2 || t[35] !== Rr2 ? (q2 = (0, import_jsx_runtime.jsx)(Input, {
10484
+ id: Rr2,
10485
10485
  value: a,
10486
10486
  onChange: K2,
10487
10487
  placeholder: "Enter column name",
10488
10488
  className: "mt-1",
10489
10489
  onKeyDown: U2
10490
- }), t[33] = a, t[34] = U2, t[35] = zr2, t[36] = q2) : q2 = t[36], t[37] !== G2 || t[38] !== q2 ? (B = (0, import_jsx_runtime.jsxs)("div", {
10490
+ }), t[33] = a, t[34] = U2, t[35] = Rr2, t[36] = q2) : q2 = t[36], t[37] !== G2 || t[38] !== q2 ? (Fr = (0, import_jsx_runtime.jsxs)("div", {
10491
10491
  children: [
10492
10492
  G2,
10493
10493
  q2
10494
10494
  ]
10495
- }), t[37] = G2, t[38] = q2, t[39] = B) : B = t[39];
10496
- let Br2 = `add-column-type-${n}`;
10497
- t[40] === Br2 ? F = t[41] : (F = (0, import_jsx_runtime.jsx)(Label, {
10498
- htmlFor: Br2,
10495
+ }), t[37] = G2, t[38] = q2, t[39] = Fr) : Fr = t[39];
10496
+ let zr2 = `add-column-type-${n}`;
10497
+ t[40] === zr2 ? L = t[41] : (L = (0, import_jsx_runtime.jsx)(Label, {
10498
+ htmlFor: zr2,
10499
10499
  children: "Data type"
10500
- }), t[40] = Br2, t[41] = F), x = Select, M = s, t[42] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = (e3) => c(e3), t[42] = N) : N = t[42];
10501
- let Vr = `add-column-type-${n}`, Hr;
10502
- t[43] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Hr = (0, import_jsx_runtime.jsx)(SelectValue, {}), t[43] = Hr) : Hr = t[43], t[44] === Vr ? P = t[45] : (P = (0, import_jsx_runtime.jsx)(SelectTrigger, {
10503
- id: Vr,
10500
+ }), t[40] = zr2, t[41] = L), S = Select, M = s, t[42] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = (e3) => u(e3), t[42] = N) : N = t[42];
10501
+ let Br = `add-column-type-${n}`, Vr;
10502
+ t[43] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Vr = (0, import_jsx_runtime.jsx)(SelectValue, {}), t[43] = Vr) : Vr = t[43], t[44] === Br ? P = t[45] : (P = (0, import_jsx_runtime.jsx)(SelectTrigger, {
10503
+ id: Br,
10504
10504
  className: "mt-1",
10505
- children: Hr
10506
- }), t[44] = Vr, t[45] = P), f = SelectContent, A = e2.map(_temp), t[0] = a, t[1] = s, t[2] = n, t[3] = r, t[4] = i, t[5] = f, t[6] = x, t[7] = C, t[8] = E, t[9] = D, t[10] = O, t[11] = A, t[12] = M, t[13] = N, t[14] = P, t[15] = F, t[16] = Fr, t[17] = B, t[18] = V, t[19] = H;
10507
- } else f = t[5], x = t[6], C = t[7], E = t[8], D = t[9], O = t[10], A = t[11], M = t[12], N = t[13], P = t[14], F = t[15], Fr = t[16], B = t[17], V = t[18], H = t[19];
10508
- let Lr;
10509
- t[46] !== f || t[47] !== A ? (Lr = (0, import_jsx_runtime.jsx)(f, {
10510
- children: A
10511
- }), t[46] = f, t[47] = A, t[48] = Lr) : Lr = t[48];
10505
+ children: Vr
10506
+ }), t[44] = Br, t[45] = P), y = SelectContent, j = e2.map(_temp), t[0] = a, t[1] = s, t[2] = n, t[3] = r, t[4] = i, t[5] = y, t[6] = S, t[7] = C, t[8] = E, t[9] = D, t[10] = k, t[11] = j, t[12] = M, t[13] = N, t[14] = P, t[15] = L, t[16] = Pr, t[17] = Fr, t[18] = V, t[19] = H;
10507
+ } else y = t[5], S = t[6], C = t[7], E = t[8], D = t[9], k = t[10], j = t[11], M = t[12], N = t[13], P = t[14], L = t[15], Pr = t[16], Fr = t[17], V = t[18], H = t[19];
10508
+ let Ir;
10509
+ t[46] !== y || t[47] !== j ? (Ir = (0, import_jsx_runtime.jsx)(y, {
10510
+ children: j
10511
+ }), t[46] = y, t[47] = j, t[48] = Ir) : Ir = t[48];
10512
10512
  let U;
10513
- t[49] !== x || t[50] !== Lr || t[51] !== M || t[52] !== N || t[53] !== P ? (U = (0, import_jsx_runtime.jsxs)(x, {
10513
+ t[49] !== S || t[50] !== Ir || t[51] !== M || t[52] !== N || t[53] !== P ? (U = (0, import_jsx_runtime.jsxs)(S, {
10514
10514
  value: M,
10515
10515
  onValueChange: N,
10516
10516
  children: [
10517
10517
  P,
10518
- Lr
10518
+ Ir
10519
10519
  ]
10520
- }), t[49] = x, t[50] = Lr, t[51] = M, t[52] = N, t[53] = P, t[54] = U) : U = t[54];
10521
- let Rr;
10522
- t[55] !== U || t[56] !== F ? (Rr = (0, import_jsx_runtime.jsxs)("div", {
10520
+ }), t[49] = S, t[50] = Ir, t[51] = M, t[52] = N, t[53] = P, t[54] = U) : U = t[54];
10521
+ let Lr;
10522
+ t[55] !== U || t[56] !== L ? (Lr = (0, import_jsx_runtime.jsxs)("div", {
10523
10523
  children: [
10524
- F,
10524
+ L,
10525
10525
  U
10526
10526
  ]
10527
- }), t[55] = U, t[56] = F, t[57] = Rr) : Rr = t[57];
10527
+ }), t[55] = U, t[56] = L, t[57] = Lr) : Lr = t[57];
10528
10528
  let W = !a.trim(), G;
10529
- t[58] !== O || t[59] !== W ? (G = (0, import_jsx_runtime.jsx)(Button, {
10530
- onClick: O,
10529
+ t[58] !== k || t[59] !== W ? (G = (0, import_jsx_runtime.jsx)(Button, {
10530
+ onClick: k,
10531
10531
  disabled: W,
10532
10532
  size: "sm",
10533
10533
  className: "w-full",
10534
10534
  children: "Add"
10535
- }), t[58] = O, t[59] = W, t[60] = G) : G = t[60];
10536
- let zr;
10537
- t[61] !== Rr || t[62] !== G || t[63] !== Fr || t[64] !== B ? (zr = (0, import_jsx_runtime.jsxs)("div", {
10538
- className: Fr,
10535
+ }), t[58] = k, t[59] = W, t[60] = G) : G = t[60];
10536
+ let Rr;
10537
+ t[61] !== Lr || t[62] !== G || t[63] !== Pr || t[64] !== Fr ? (Rr = (0, import_jsx_runtime.jsxs)("div", {
10538
+ className: Pr,
10539
10539
  children: [
10540
- B,
10541
- Rr,
10540
+ Fr,
10541
+ Lr,
10542
10542
  G
10543
10543
  ]
10544
- }), t[61] = Rr, t[62] = G, t[63] = Fr, t[64] = B, t[65] = zr) : zr = t[65];
10544
+ }), t[61] = Lr, t[62] = G, t[63] = Pr, t[64] = Fr, t[65] = Rr) : Rr = t[65];
10545
10545
  let K;
10546
- t[66] !== C || t[67] !== zr || t[68] !== V ? (K = (0, import_jsx_runtime.jsx)(C, {
10546
+ t[66] !== C || t[67] !== Rr || t[68] !== V ? (K = (0, import_jsx_runtime.jsx)(C, {
10547
10547
  className: V,
10548
- children: zr
10549
- }), t[66] = C, t[67] = zr, t[68] = V, t[69] = K) : K = t[69];
10548
+ children: Rr
10549
+ }), t[66] = C, t[67] = Rr, t[68] = V, t[69] = K) : K = t[69];
10550
10550
  let q;
10551
10551
  t[70] !== E || t[71] !== K ? (q = (0, import_jsx_runtime.jsx)(E, {
10552
10552
  children: K
10553
10553
  }), t[70] = E, t[71] = K, t[72] = q) : q = t[72];
10554
- let Br;
10555
- return t[73] !== D || t[74] !== q || t[75] !== H ? (Br = (0, import_jsx_runtime.jsxs)(D, {
10554
+ let zr;
10555
+ return t[73] !== D || t[74] !== q || t[75] !== H ? (zr = (0, import_jsx_runtime.jsxs)(D, {
10556
10556
  children: [
10557
10557
  H,
10558
10558
  q
10559
10559
  ]
10560
- }), t[73] = D, t[74] = q, t[75] = H, t[76] = Br) : Br = t[76], Br;
10560
+ }), t[73] = D, t[74] = q, t[75] = H, t[76] = zr) : zr = t[76], zr;
10561
10561
  };
10562
10562
  function _temp(e) {
10563
10563
  return (0, import_jsx_runtime.jsx)(SelectItem, {
@@ -10628,15 +10628,39 @@ let __tla = (async () => {
10628
10628
  }
10629
10629
  }
10630
10630
  }
10631
- GlideDataEditor = ({ data: e, setData: t, columnFields: n, setColumnFields: r, editableColumns: l, edits: u, onAddEdits: f, onAddRows: m, onDeleteRows: h, onRenameColumn: g, onDeleteColumn: y, onAddColumn: S }) => {
10632
- let { theme: D } = useTheme(), O = (0, import_react.useRef)(null), [k, j] = (0, import_react.useState)(), [M, I] = (0, import_react.useState)(false), [L, V] = import_react.useState({
10631
+ GlideDataEditor = ({ data: e, setData: t, columnFields: n, setColumnFields: r, editableColumns: c, edits: l, onAddEdits: u, onAddRows: f, onDeleteRows: m, onRenameColumn: h, onDeleteColumn: g, onAddColumn: x }) => {
10632
+ let { theme: E } = useTheme(), D = (0, import_react.useRef)(null), [O, A] = (0, import_react.useState)(), [j, F] = (0, import_react.useState)(false), [I, Fr] = import_react.useState({
10633
10633
  columns: CompactSelection.empty(),
10634
10634
  rows: CompactSelection.empty()
10635
- }), [H, Rr] = (0, import_react.useState)({}), W = useNonce();
10636
- useOnMount(() => {
10637
- if (u.length === 0) return;
10635
+ }), [V, U] = (0, import_react.useState)({}), Lr = useNonce(), W = (0, import_react.useRef)(false), G = (0, import_react.useMemo)(() => {
10636
+ let e2 = [];
10637
+ for (let [t2, r2] of Object.entries(n)) {
10638
+ let n2 = c === "all" || c.includes(t2);
10639
+ e2.push({
10640
+ id: t2,
10641
+ title: t2,
10642
+ width: V[t2],
10643
+ icon: n2 ? getColumnHeaderIcon(r2) : GridColumnIcon.ProtectedColumnOverlay,
10644
+ style: "normal",
10645
+ kind: getColumnKind(r2),
10646
+ dataType: r2,
10647
+ hasMenu: true,
10648
+ themeOverride: n2 ? void 0 : {
10649
+ bgCell: E === "light" ? "#F9F9FA" : "#1e1e21"
10650
+ }
10651
+ });
10652
+ }
10653
+ return e2;
10654
+ }, [
10655
+ n,
10656
+ V,
10657
+ c,
10658
+ E
10659
+ ]);
10660
+ (0, import_react.useEffect)(() => {
10661
+ if (W.current || e.length === 0 || (W.current = true, l.length === 0)) return;
10638
10662
  let n2 = /* @__PURE__ */ new Map();
10639
- for (let i2 of u) if (isPositionalEdit(i2)) if (i2.rowIdx >= e.length) {
10663
+ for (let i2 of l) if (isPositionalEdit(i2)) if (i2.rowIdx >= e.length) {
10640
10664
  n2.has(i2.rowIdx) || n2.set(i2.rowIdx, {});
10641
10665
  let e2 = n2.get(i2.rowIdx);
10642
10666
  e2 && (e2[i2.columnId] = i2.value);
@@ -10681,34 +10705,12 @@ let __tla = (async () => {
10681
10705
  i.length > 0 && t((e2) => [
10682
10706
  ...e2,
10683
10707
  ...i
10684
- ]), W();
10685
- });
10686
- let G = (0, import_react.useMemo)(() => {
10687
- let e2 = [];
10688
- for (let [t2, r2] of Object.entries(n)) {
10689
- let n2 = l === "all" || l.includes(t2);
10690
- e2.push({
10691
- id: t2,
10692
- title: t2,
10693
- width: H[t2],
10694
- icon: n2 ? getColumnHeaderIcon(r2) : GridColumnIcon.ProtectedColumnOverlay,
10695
- style: "normal",
10696
- kind: getColumnKind(r2),
10697
- dataType: r2,
10698
- hasMenu: true,
10699
- themeOverride: n2 ? void 0 : {
10700
- bgCell: D === "light" ? "#F9F9FA" : "#1e1e21"
10701
- }
10702
- });
10703
- }
10704
- return e2;
10708
+ ]), Lr();
10705
10709
  }, [
10706
- n,
10707
- H,
10708
- l,
10709
- D
10710
- ]), zr = (0, import_react.useCallback)((t2) => {
10711
- let [n2, r2] = t2, i = e[r2][G[n2].title], a = G[n2].kind, o = l === "all" || l.includes(G[n2].title);
10710
+ e.length
10711
+ ]);
10712
+ let Rr = (0, import_react.useCallback)((t2) => {
10713
+ let [n2, r2] = t2, i = e[r2][G[n2].title], a = G[n2].kind, o = c === "all" || c.includes(G[n2].title);
10712
10714
  if (a === GridCellKind.Boolean) {
10713
10715
  let e2 = !!i;
10714
10716
  return {
@@ -10734,7 +10736,7 @@ let __tla = (async () => {
10734
10736
  }, [
10735
10737
  G,
10736
10738
  e,
10737
- l
10739
+ c
10738
10740
  ]), K = (0, import_react.useCallback)((e2, n2) => {
10739
10741
  let [r2, i] = e2, a = G[r2], o = a.title, s = n2.data;
10740
10742
  (a.dataType === "number" || a.dataType === "integer") && (n2.data === void 0 || n2.data === "") && (s = null), t((e3) => {
@@ -10742,7 +10744,7 @@ let __tla = (async () => {
10742
10744
  ...e3
10743
10745
  ];
10744
10746
  return t2[i][o] = s, t2;
10745
- }), f([
10747
+ }), u([
10746
10748
  {
10747
10749
  rowIdx: i,
10748
10750
  columnId: o,
@@ -10751,14 +10753,14 @@ let __tla = (async () => {
10751
10753
  ]);
10752
10754
  }, [
10753
10755
  G,
10754
- f,
10756
+ u,
10755
10757
  t
10756
10758
  ]), q = (0, import_react.useCallback)((e2, t2) => {
10757
- Rr((n2) => ({
10759
+ U((n2) => ({
10758
10760
  ...n2,
10759
10761
  [e2.title]: t2
10760
10762
  }));
10761
- }, []), Br = (0, import_react.useCallback)((e2, t2, r2) => {
10763
+ }, []), zr = (0, import_react.useCallback)((e2, t2, r2) => {
10762
10764
  let [i, a] = e2;
10763
10765
  switch (n[G[i].title]) {
10764
10766
  case "number":
@@ -10773,40 +10775,40 @@ let __tla = (async () => {
10773
10775
  }, [
10774
10776
  n,
10775
10777
  G
10776
- ]), Vr = (0, import_react.useCallback)((n2) => {
10777
- if (O.current) {
10778
+ ]), Br = (0, import_react.useCallback)((n2) => {
10779
+ if (D.current) {
10778
10780
  if (Events.isMetaOrCtrl(n2) && n2.key === "c") {
10779
- O.current.emit("copy");
10781
+ D.current.emit("copy");
10780
10782
  return;
10781
10783
  }
10782
10784
  if (Events.isMetaOrCtrl(n2) && n2.key === "v") {
10783
10785
  pasteCells({
10784
- selection: L,
10786
+ selection: I,
10785
10787
  data: e,
10786
10788
  setData: t,
10787
10789
  columns: G,
10788
- editableColumns: l,
10789
- onAddEdits: f
10790
+ editableColumns: c,
10791
+ onAddEdits: u
10790
10792
  });
10791
10793
  return;
10792
10794
  }
10793
10795
  if (Events.isMetaOrCtrl(n2) && n2.key === "f") {
10794
- I((e2) => !e2), n2.stopPropagation(), n2.preventDefault();
10796
+ F((e2) => !e2), n2.stopPropagation(), n2.preventDefault();
10795
10797
  return;
10796
10798
  }
10797
10799
  if (n2.key === "Escape") {
10798
- I(false);
10800
+ F(false);
10799
10801
  return;
10800
10802
  }
10801
10803
  }
10802
10804
  }, [
10803
10805
  G,
10804
10806
  e,
10805
- l,
10806
- f,
10807
- L,
10807
+ c,
10808
+ u,
10809
+ I,
10808
10810
  t
10809
- ]), Hr = (0, import_react.useCallback)(() => {
10811
+ ]), Vr = (0, import_react.useCallback)(() => {
10810
10812
  let e2 = Object.fromEntries(G.map((e3) => {
10811
10813
  let t2 = e3.dataType;
10812
10814
  switch (t2) {
@@ -10841,7 +10843,7 @@ let __tla = (async () => {
10841
10843
  ];
10842
10844
  }
10843
10845
  }));
10844
- m([
10846
+ f([
10845
10847
  e2
10846
10848
  ]), t((t2) => [
10847
10849
  ...t2,
@@ -10849,102 +10851,102 @@ let __tla = (async () => {
10849
10851
  ]);
10850
10852
  }, [
10851
10853
  G,
10852
- m,
10854
+ f,
10853
10855
  t
10854
- ]), Ur = () => {
10855
- let e2 = L.rows.toArray();
10856
- h(e2);
10856
+ ]), Hr = () => {
10857
+ let e2 = I.rows.toArray();
10858
+ m(e2);
10857
10859
  let n2 = 0;
10858
10860
  for (let r2 of e2) {
10859
10861
  let e3 = r2 - n2;
10860
10862
  t((t2) => t2.filter((t3, n3) => n3 !== e3)), n2++;
10861
10863
  }
10862
- V({
10864
+ Fr({
10863
10865
  columns: CompactSelection.empty(),
10864
10866
  rows: CompactSelection.empty()
10865
10867
  });
10866
- }, Wr = useEvent_default((e2, t2) => {
10867
- j({
10868
+ }, Ur = useEvent_default((e2, t2) => {
10869
+ A({
10868
10870
  col: e2,
10869
10871
  bounds: t2
10870
10872
  });
10871
- }), Gr = async () => {
10872
- if (k) {
10873
- let e2 = G[k.col].title;
10874
- await copyToClipboard(e2), j(void 0);
10873
+ }), Wr = async () => {
10874
+ if (O) {
10875
+ let e2 = G[O.col].title;
10876
+ await copyToClipboard(e2), A(void 0);
10875
10877
  }
10876
10878
  };
10877
- function Kr(e2) {
10879
+ function Gr(e2) {
10878
10880
  toast({
10879
10881
  title: `Column '${e2}' already exists`,
10880
10882
  description: "Please enter a different column name",
10881
10883
  variant: "danger"
10882
10884
  });
10883
10885
  }
10884
- let qr = (e2) => {
10885
- if (k) {
10886
- let i = G[k.col].title;
10886
+ let Kr = (e2) => {
10887
+ if (O) {
10888
+ let i = G[O.col].title;
10887
10889
  if (n[e2]) {
10888
- Kr(e2);
10890
+ Gr(e2);
10889
10891
  return;
10890
10892
  }
10891
- let a = G[k.col].dataType;
10892
- g(k.col, e2), r((t2) => modifyColumnFields({
10893
+ let a = G[O.col].dataType;
10894
+ h(O.col, e2), r((t2) => modifyColumnFields({
10893
10895
  columnFields: t2,
10894
- columnIdx: k.col,
10896
+ columnIdx: O.col,
10895
10897
  type: "rename",
10896
10898
  dataType: a,
10897
10899
  newColumnName: e2
10898
- })), t((t2) => renameColumn(t2, i, e2)), j(void 0);
10900
+ })), t((t2) => renameColumn(t2, i, e2)), A(void 0);
10899
10901
  }
10900
10902
  }, J = () => {
10901
- k && (y(k.col), r((e2) => modifyColumnFields({
10903
+ O && (g(O.col), r((e2) => modifyColumnFields({
10902
10904
  columnFields: e2,
10903
- columnIdx: k.col,
10905
+ columnIdx: O.col,
10904
10906
  type: "remove"
10905
- })), t((e2) => removeColumn(e2, k.col)), j(void 0));
10906
- }, Jr = (e2) => {
10907
+ })), t((e2) => removeColumn(e2, O.col)), A(void 0));
10908
+ }, qr = (e2) => {
10907
10909
  let { direction: i, columnName: a, dataType: o } = e2;
10908
- if (k) {
10909
- let e3 = k.col + (i === "left" ? 0 : 1), s = Math.max(0, Math.min(e3, G.length));
10910
+ if (O) {
10911
+ let e3 = O.col + (i === "left" ? 0 : 1), s = Math.max(0, Math.min(e3, G.length));
10910
10912
  if (n[a]) {
10911
- Kr(a);
10913
+ Gr(a);
10912
10914
  return;
10913
10915
  }
10914
- S(s, a), r((e4) => modifyColumnFields({
10916
+ x(s, a), r((e4) => modifyColumnFields({
10915
10917
  columnFields: e4,
10916
10918
  columnIdx: s,
10917
10919
  type: "insert",
10918
10920
  dataType: o,
10919
10921
  newColumnName: a
10920
- })), t((e4) => insertColumn(e4, a)), j(void 0);
10922
+ })), t((e4) => insertColumn(e4, a)), A(void 0);
10921
10923
  }
10922
- }, Yr = (k == null ? void 0 : k.col) === G.length - 1, Xr = k !== void 0, Y = "mr-2 h-3.5 w-3.5", Zr = {
10924
+ }, Jr = (O == null ? void 0 : O.col) === G.length - 1, Yr = O !== void 0, Y = "mr-2 h-3.5 w-3.5", Xr = {
10923
10925
  hint: "New row",
10924
10926
  sticky: true,
10925
10927
  tint: true
10926
- }, X = e.length > 1e5, Qr = l === "all";
10928
+ }, X = e.length > 1e5, Zr = c === "all";
10927
10929
  return (0, import_jsx_runtime.jsxs)("div", {
10928
10930
  className: "relative w-full min-w-0",
10929
10931
  children: [
10930
10932
  (0, import_jsx_runtime.jsx)(ErrorBoundary, {
10931
10933
  children: (0, import_jsx_runtime.jsx)(DataEditorAll, {
10932
- ref: O,
10933
- getCellContent: zr,
10934
+ ref: D,
10935
+ getCellContent: Rr,
10934
10936
  columns: G,
10935
- gridSelection: L,
10936
- onGridSelectionChange: V,
10937
+ gridSelection: I,
10938
+ onGridSelectionChange: Fr,
10937
10939
  rows: e.length,
10938
10940
  overscrollX: 50,
10939
10941
  smoothScrollX: !X,
10940
10942
  smoothScrollY: !X,
10941
- validateCell: Br,
10943
+ validateCell: zr,
10942
10944
  getCellsForSelection: true,
10943
10945
  onPaste: true,
10944
- showSearch: M,
10946
+ showSearch: j,
10945
10947
  fillHandle: true,
10946
10948
  allowedFillDirections: "vertical",
10947
- onKeyDown: Vr,
10949
+ onKeyDown: Br,
10948
10950
  height: e.length > 10 ? 450 : void 0,
10949
10951
  width: "100%",
10950
10952
  rowMarkers: {
@@ -10953,44 +10955,44 @@ let __tla = (async () => {
10953
10955
  rowSelectionMode: "multi",
10954
10956
  onCellEdited: K,
10955
10957
  onColumnResize: q,
10956
- onHeaderMenuClick: Wr,
10957
- theme: getGlideTheme(D),
10958
- trailingRowOptions: Zr,
10959
- onRowAppended: Hr,
10958
+ onHeaderMenuClick: Ur,
10959
+ theme: getGlideTheme(E),
10960
+ trailingRowOptions: Xr,
10961
+ onRowAppended: Vr,
10960
10962
  maxColumnAutoWidth: 600,
10961
10963
  maxColumnWidth: 600
10962
10964
  })
10963
10965
  }),
10964
10966
  (() => {
10965
- if (!Xr) return;
10967
+ if (!Yr) return;
10966
10968
  let e2 = (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
10967
10969
  children: [
10968
- Qr && (0, import_jsx_runtime.jsx)(RenameColumnSub, {
10969
- currentColumnName: G[k.col].title,
10970
- onRename: qr,
10971
- onCancel: () => j(void 0)
10970
+ Zr && (0, import_jsx_runtime.jsx)(RenameColumnSub, {
10971
+ currentColumnName: G[O.col].title,
10972
+ onRename: Kr,
10973
+ onCancel: () => A(void 0)
10972
10974
  }),
10973
10975
  (0, import_jsx_runtime.jsx)(DropdownMenuSeparator, {}),
10974
10976
  (0, import_jsx_runtime.jsx)(AddColumnSub, {
10975
10977
  direction: "left",
10976
- onAdd: (e3, t2) => Jr({
10978
+ onAdd: (e3, t2) => qr({
10977
10979
  direction: "left",
10978
10980
  columnName: e3,
10979
10981
  dataType: t2
10980
10982
  }),
10981
- onCancel: () => j(void 0)
10983
+ onCancel: () => A(void 0)
10982
10984
  }),
10983
10985
  (0, import_jsx_runtime.jsx)(AddColumnSub, {
10984
10986
  direction: "right",
10985
- onAdd: (e3, t2) => Jr({
10987
+ onAdd: (e3, t2) => qr({
10986
10988
  direction: "right",
10987
10989
  columnName: e3,
10988
10990
  dataType: t2
10989
10991
  }),
10990
- onCancel: () => j(void 0)
10992
+ onCancel: () => A(void 0)
10991
10993
  }),
10992
10994
  (0, import_jsx_runtime.jsx)(DropdownMenuSeparator, {}),
10993
- !Yr && Qr && (0, import_jsx_runtime.jsxs)(DropdownMenuItem, {
10995
+ !Jr && Zr && (0, import_jsx_runtime.jsxs)(DropdownMenuItem, {
10994
10996
  onClick: J,
10995
10997
  className: "text-destructive focus:text-destructive",
10996
10998
  children: [
@@ -11003,17 +11005,17 @@ let __tla = (async () => {
11003
11005
  ]
11004
11006
  });
11005
11007
  return (0, import_jsx_runtime.jsx)(DropdownMenu, {
11006
- open: Xr,
11007
- onOpenChange: (e3) => !e3 && j(void 0),
11008
+ open: Yr,
11009
+ onOpenChange: (e3) => !e3 && A(void 0),
11008
11010
  children: (0, import_jsx_runtime.jsxs)(DropdownMenuContent, {
11009
11011
  style: {
11010
- left: (k == null ? void 0 : k.bounds.x) ?? 0,
11011
- top: ((k == null ? void 0 : k.bounds.y) ?? 0) + ((k == null ? void 0 : k.bounds.height) ?? 0)
11012
+ left: (O == null ? void 0 : O.bounds.x) ?? 0,
11013
+ top: ((O == null ? void 0 : O.bounds.y) ?? 0) + ((O == null ? void 0 : O.bounds.height) ?? 0)
11012
11014
  },
11013
11015
  className: "fixed w-52",
11014
11016
  children: [
11015
11017
  (0, import_jsx_runtime.jsxs)(DropdownMenuItem, {
11016
- onClick: Gr,
11018
+ onClick: Wr,
11017
11019
  children: [
11018
11020
  (0, import_jsx_runtime.jsx)(Copy, {
11019
11021
  className: Y
@@ -11031,10 +11033,10 @@ let __tla = (async () => {
11031
11033
  children: (0, import_jsx_runtime.jsx)(Button, {
11032
11034
  variant: "destructive",
11033
11035
  size: "sm",
11034
- disabled: L.rows.length === 0,
11036
+ disabled: I.rows.length === 0,
11035
11037
  className: "right-2 h-7",
11036
- onClick: Ur,
11037
- children: L.rows.length <= 1 ? "Delete row" : "Delete rows"
11038
+ onClick: Hr,
11039
+ children: I.rows.length <= 1 ? "Delete row" : "Delete rows"
11038
11040
  })
11039
11041
  })
11040
11042
  ]