@univerjs/sheets 0.6.3 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var ii = Object.defineProperty;
2
2
  var ai = (n, e, t) => e in n ? ii(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
3
  var R = (n, e, t) => ai(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { Tools as O, CommandType as v, ICommandService as E, IUndoRedoService as V, createInterceptorKey as ut, Disposable as ae, UniverInstanceType as B, InterceptorEffectEnum as ce, InterceptorManager as Ro, toDisposable as Pe, remove as ze, composeInterceptors as ui, DisposableCollection as Gt, IUniverInstanceService as M, BooleanNumber as te, HorizontalAlign as Co, BorderStyleTypes as Ss, Inject as $, IResourceManagerService as on, RTree as li, generateRandomId as ci, insertMatrixArray as pn, sliceMatrixArray as ws, concatMatrixArray as Is, spliceArray as vs, normalizeTextRuns as di, CellValueType as re, isRealNum as po, isBooleanString as Ms, isSafeNumeric as hi, ObjectMatrix as G, sequenceExecute as z, RxDisposable as _s, LocaleService as Ye, RANGE_TYPE as L, selectionToArray as mi, Rectangle as N, createIdentifier as So, IContextService as ys, ErrorService as Ut, Range as K, cellToRange as bs, PermissionStatus as J, IPermissionService as Fe, isICellData as Es, Dimension as fe, getArrayLength as Us, Direction as ue, mergeWorksheetSnapshotWithDefault as gi, moveMatrixArray as ks, BorderType as le, FontWeight as fi, FontItalic as Ri, Injector as Hn, ILogService as Ts, DocumentDataModel as Ci, BuildTextUtils as pi, TextX as Si, IConfigService as Ps, Optional as wi, queryObjectMatrix as qe, CustomCommandExecutionError as Ii, IAuthzIoService as vi, UserManagerService as Mi, LRUMap as _i, DependentOn as yi, Plugin as bi, merge as Ei, IS_ROW_STYLE_PRECEDE_COLUMN_STYLE as Ui, AUTO_HEIGHT_FOR_MERGED_CELLS as ki, registerDependencies as Ti, mergeOverrideWithDependencies as Pi, touchDependencies as cn, createRowColIter as Ni, CellModeEnum as Oi } from "@univerjs/core";
4
+ import { Tools as O, CommandType as v, ICommandService as E, IUndoRedoService as V, createInterceptorKey as ut, Disposable as ue, UniverInstanceType as B, InterceptorEffectEnum as ce, InterceptorManager as Ro, toDisposable as Pe, remove as ze, composeInterceptors as ui, DisposableCollection as Gt, IUniverInstanceService as M, BooleanNumber as te, HorizontalAlign as po, BorderStyleTypes as Ss, Inject as $, IResourceManagerService as on, RTree as li, generateRandomId as ci, insertMatrixArray as Cn, sliceMatrixArray as ws, concatMatrixArray as Is, spliceArray as vs, normalizeTextRuns as di, CellValueType as ie, isRealNum as Co, isBooleanString as Ms, isSafeNumeric as hi, ObjectMatrix as G, sequenceExecute as z, RxDisposable as _s, LocaleService as Ye, RANGE_TYPE as L, selectionToArray as mi, Rectangle as N, createIdentifier as So, IContextService as ys, ErrorService as Ut, Range as K, cellToRange as bs, PermissionStatus as J, IPermissionService as Fe, isICellData as Es, Dimension as fe, getArrayLength as Us, Direction as pe, mergeWorksheetSnapshotWithDefault as gi, moveMatrixArray as ks, BorderType as le, FontWeight as fi, FontItalic as Ri, Injector as Hn, ILogService as Ts, DocumentDataModel as pi, BuildTextUtils as Ci, TextX as Si, IConfigService as Ps, Optional as wi, queryObjectMatrix as qe, CustomCommandExecutionError as Ii, IAuthzIoService as vi, UserManagerService as Mi, LRUMap as _i, DependentOn as yi, Plugin as bi, merge as Ei, IS_ROW_STYLE_PRECEDE_COLUMN_STYLE as Ui, AUTO_HEIGHT_FOR_MERGED_CELLS as ki, registerDependencies as Ti, mergeOverrideWithDependencies as Pi, touchDependencies as cn, createRowColIter as Ni, CellModeEnum as Oi } from "@univerjs/core";
5
5
  import { SetDefinedNameMutation as zt, RemoveDefinedNameMutation as Sn, SetDefinedNameMutationFactory as Di, SetFormulaCalculationResultMutation as Ai, handleNumfmtInCell as xi, IDefinedNamesService as Ns, stripErrorMargin as Wi, LexerTreeBuilder as $i, operatorToken as Vi, deserializeRangeWithSheet as Li, sequenceNodeType as Hi, deserializeRangeWithSheetWithCache as Bi, UniverFormulaEnginePlugin as Fi } from "@univerjs/engine-formula";
6
6
  import { DataSyncPrimaryController as ji } from "@univerjs/rpc";
7
7
  import { Subject as Le, BehaviorSubject as dt, merge as Wt, shareReplay as Gi, takeUntil as lo, switchMap as Ke, of as Dt, distinctUntilChanged as zi, skip as Os, map as co, first as Ki, filter as jo } from "rxjs";
@@ -151,11 +151,11 @@ const Nd = (n, e) => {
151
151
  subUnitId: u,
152
152
  rules: m
153
153
  })) {
154
- const f = [{ id: Ae.id, params: { unitId: a, subUnitId: u, rules: m } }], C = [{ id: Je.id, params: { unitId: a, subUnitId: u, ruleIds: m.map((p) => p.id) } }];
154
+ const f = [{ id: Ae.id, params: { unitId: a, subUnitId: u, rules: m } }], p = [{ id: Je.id, params: { unitId: a, subUnitId: u, ruleIds: m.map((C) => C.id) } }];
155
155
  o.pushUndoRedo({
156
156
  unitID: a,
157
157
  redoMutations: f,
158
- undoMutations: C
158
+ undoMutations: p
159
159
  });
160
160
  }
161
161
  return !0;
@@ -289,8 +289,8 @@ var na = Object.getOwnPropertyDescriptor, oa = (n, e, t, o) => {
289
289
  (i = n[r]) && (s = i(s) || s);
290
290
  return s;
291
291
  }, sa = (n, e) => (t, o) => e(t, o, n);
292
- const Jo = ut("BEFORE_CELL_EDIT"), no = ut("AFTER_CELL_EDIT"), oo = ut("AFTER_CELL_EDIT_ASYNC");
293
- let F = class extends ae {
292
+ const Jo = ut("BEFORE_CELL_EDIT"), no = ut("AFTER_CELL_EDIT"), oo = ut("VALIDATE_CELL");
293
+ let F = class extends ue {
294
294
  /** @ignore */
295
295
  constructor(e) {
296
296
  super();
@@ -306,7 +306,7 @@ let F = class extends ae {
306
306
  R(this, "writeCellInterceptor", new Ro({
307
307
  BEFORE_CELL_EDIT: Jo,
308
308
  AFTER_CELL_EDIT: no,
309
- AFTER_CELL_EDIT_ASYNC: oo
309
+ VALIDATE_CELL: oo
310
310
  }));
311
311
  this._univerInstanceService = e, this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(B.UNIVER_SHEET).subscribe((t) => {
312
312
  this._interceptWorkbook(t);
@@ -442,7 +442,7 @@ let F = class extends ae {
442
442
  }
443
443
  // #endregion
444
444
  // #region intercept on writing cell
445
- async onWriteCell(e, t, o, s, r) {
445
+ onWriteCell(e, t, o, s, r) {
446
446
  const i = {
447
447
  subUnitId: t.getSheetId(),
448
448
  unitId: e.getUnitId(),
@@ -451,10 +451,21 @@ let F = class extends ae {
451
451
  row: o,
452
452
  col: s,
453
453
  origin: O.deepClone(r)
454
- }, a = this.writeCellInterceptor.fetchThroughInterceptors(no)(r, i);
455
- return await this.writeCellInterceptor.fetchThroughInterceptors(oo)(Promise.resolve(a), i);
454
+ };
455
+ return this.writeCellInterceptor.fetchThroughInterceptors(no)(r, i);
456
456
  }
457
457
  // #endregion
458
+ onValidateCell(e, t, o, s) {
459
+ const r = {
460
+ subUnitId: t.getSheetId(),
461
+ unitId: e.getUnitId(),
462
+ workbook: e,
463
+ worksheet: t,
464
+ row: o,
465
+ col: s
466
+ };
467
+ return this.writeCellInterceptor.fetchThroughInterceptors(oo)(Promise.resolve(!0), r);
468
+ }
458
469
  intercept(e, t) {
459
470
  const o = e;
460
471
  this._interceptorsByName.has(o) || this._interceptorsByName.set(o, []);
@@ -566,7 +577,7 @@ const he = {
566
577
  secondColumnStyle: 256,
567
578
  lastColumnStyle: 512
568
579
  };
569
- class Ct {
580
+ class pt {
570
581
  /**
571
582
  * @constructor
572
583
  * @param {string} name The name of the range theme style, it used to identify the range theme style.
@@ -702,7 +713,7 @@ class Ct {
702
713
  this._mergeCacheMap.clear();
703
714
  }
704
715
  }
705
- const ia = (n, e, t) => new Ct(`light-${n}`, {
716
+ const ia = (n, e, t) => new pt(`light-${n}`, {
706
717
  headerRowStyle: {
707
718
  bg: {
708
719
  rgb: e
@@ -723,7 +734,7 @@ const ia = (n, e, t) => new Ct(`light-${n}`, {
723
734
  rgb: e
724
735
  }
725
736
  }
726
- }), aa = (n, e, t) => new Ct(`middle-${n}`, {
737
+ }), aa = (n, e, t) => new pt(`middle-${n}`, {
727
738
  headerRowStyle: {
728
739
  bg: {
729
740
  rgb: e
@@ -749,7 +760,7 @@ const ia = (n, e, t) => new Ct(`light-${n}`, {
749
760
  rgb: t
750
761
  }
751
762
  }
752
- }), ua = (n, e, t, o) => new Ct(`dark-${n}`, {
763
+ }), ua = (n, e, t, o) => new pt(`dark-${n}`, {
753
764
  headerRowStyle: {
754
765
  bg: {
755
766
  rgb: e
@@ -757,7 +768,7 @@ const ia = (n, e, t) => new Ct(`light-${n}`, {
757
768
  cl: {
758
769
  rgb: "rgb(255, 255, 255)"
759
770
  },
760
- ht: Co.CENTER,
771
+ ht: po.CENTER,
761
772
  bl: te.TRUE
762
773
  },
763
774
  firstRowStyle: {
@@ -950,7 +961,7 @@ const ia = (n, e, t) => new Ct(`light-${n}`, {
950
961
  cl: {
951
962
  rgb: "rgb(255,255,255)"
952
963
  },
953
- ht: Co.CENTER,
964
+ ht: po.CENTER,
954
965
  bl: te.TRUE
955
966
  },
956
967
  firstRowStyle: {
@@ -958,7 +969,7 @@ const ia = (n, e, t) => new Ct(`light-${n}`, {
958
969
  rgb: "rgb(217,225,242)"
959
970
  }
960
971
  }
961
- }, Ra = new Ct("default", As), Ca = new Ct("default-last-row", {
972
+ }, Ra = new pt("default", As), pa = new pt("default-last-row", {
962
973
  ...As,
963
974
  lastRowStyle: {
964
975
  bd: {
@@ -969,17 +980,17 @@ const ia = (n, e, t) => new Ct(`light-${n}`, {
969
980
  }
970
981
  }
971
982
  },
972
- ht: Co.CENTER,
983
+ ht: po.CENTER,
973
984
  bl: te.TRUE
974
985
  }
975
986
  });
976
- var pa = Object.getOwnPropertyDescriptor, Sa = (n, e, t, o) => {
977
- for (var s = o > 1 ? void 0 : o ? pa(e, t) : e, r = n.length - 1, i; r >= 0; r--)
987
+ var Ca = Object.getOwnPropertyDescriptor, Sa = (n, e, t, o) => {
988
+ for (var s = o > 1 ? void 0 : o ? Ca(e, t) : e, r = n.length - 1, i; r >= 0; r--)
978
989
  (i = n[r]) && (s = i(s) || s);
979
990
  return s;
980
991
  }, qo = (n, e) => (t, o) => e(t, o, n);
981
992
  const wa = "SHEET_RANGE_THEME_MODEL_PLUGIN";
982
- let Be = class extends ae {
993
+ let Be = class extends ue {
983
994
  constructor(e, t) {
984
995
  super();
985
996
  R(this, "_rangeThemeStyleMap", /* @__PURE__ */ new Map());
@@ -989,7 +1000,7 @@ let Be = class extends ae {
989
1000
  this._sheetInterceptorService = e, this._resourceManagerService = t, this._registerIntercept(), this._initSnapshot(), this._initDefaultTheme();
990
1001
  }
991
1002
  _initDefaultTheme() {
992
- this.registerDefaultRangeTheme(Ra), this.registerDefaultRangeTheme(Ca);
1003
+ this.registerDefaultRangeTheme(Ra), this.registerDefaultRangeTheme(pa);
993
1004
  for (const e of fa)
994
1005
  this.registerDefaultRangeTheme(e);
995
1006
  }
@@ -1107,7 +1118,7 @@ let Be = class extends ae {
1107
1118
  const r = t[s], { themeName: i, rangeInfo: a } = r;
1108
1119
  this.registerRangeThemeRule(i, a), this._ensureRTreeCollection(a.unitId).insert({ unitId: s, sheetId: a.subUnitId, range: a.range, id: s });
1109
1120
  }), Object.keys(o).forEach((s) => {
1110
- const r = o[s], i = new Ct(r.name);
1121
+ const r = o[s], i = new pt(r.name);
1111
1122
  i.fromJson(r), this._ensureRangeThemeStyleMap(s).set(i.getName(), i);
1112
1123
  }));
1113
1124
  }
@@ -1151,7 +1162,7 @@ function Ia(n, e) {
1151
1162
  unitId: o.getUnitId()
1152
1163
  } : null;
1153
1164
  }
1154
- function P(n, e = {}) {
1165
+ function k(n, e = {}) {
1155
1166
  const { unitId: t, subUnitId: o } = e, s = t ? n.getUniverSheetInstance(t) : n.getCurrentUnitForType(B.UNIVER_SHEET);
1156
1167
  if (!s) return null;
1157
1168
  const r = o ? s.getSheetBySheetId(o) : s.getActiveSheet(!0);
@@ -1175,7 +1186,7 @@ const Kt = {
1175
1186
  id: "sheet.mutation.set-worksheet-range-theme-style",
1176
1187
  type: v.MUTATION,
1177
1188
  handler: (n, e) => {
1178
- const { unitId: t, subUnitId: o, range: s, themeName: r } = e, i = n.get(M), a = P(i), u = n.get(Be);
1189
+ const { unitId: t, subUnitId: o, range: s, themeName: r } = e, i = n.get(M), a = k(i), u = n.get(Be);
1179
1190
  return a ? (u.registerRangeThemeRule(r, { range: s, unitId: t, subUnitId: o }), !0) : !1;
1180
1191
  }
1181
1192
  }, va = (n, e) => {
@@ -1193,7 +1204,7 @@ const Kt = {
1193
1204
  id: "sheet.mutation.remove-worksheet-range-theme-style",
1194
1205
  type: v.MUTATION,
1195
1206
  handler: (n, e) => {
1196
- const { unitId: t, subUnitId: o, range: s, themeName: r } = e, i = n.get(M), a = P(i), u = n.get(Be);
1207
+ const { unitId: t, subUnitId: o, range: s, themeName: r } = e, i = n.get(M), a = k(i), u = n.get(Be);
1197
1208
  return a ? (u.removeRangeThemeRule(r, { range: s, unitId: t, subUnitId: o }), !0) : !1;
1198
1209
  }
1199
1210
  }, Ma = (n, e) => {
@@ -1242,7 +1253,7 @@ const Kt = {
1242
1253
  hd: 0
1243
1254
  }, d = s.startRow, h = s.endRow - s.startRow + 1;
1244
1255
  for (let f = d; f < d + h; f++)
1245
- r ? pn(f, (g = r[f - s.startRow]) != null ? g : c, l) : pn(f, c, l);
1256
+ r ? Cn(f, (g = r[f - s.startRow]) != null ? g : c, l) : Cn(f, c, l);
1246
1257
  return u.setRowCount(u.getRowCount() + s.endRow - s.startRow + 1), u.getCellMatrix().insertRows(s.startRow, h), !0;
1247
1258
  }
1248
1259
  }, Bn = (n, e) => {
@@ -1265,11 +1276,11 @@ const Kt = {
1265
1276
  if (!s) return !1;
1266
1277
  const r = s.getColumnManager(), { range: i, colInfo: a } = e, l = r.getColumnData(), c = i.startColumn, d = i.endColumn - i.startColumn + 1, h = s.getConfig().defaultColumnWidth;
1267
1278
  for (let f = c; f < c + d; f++) {
1268
- const C = {
1279
+ const p = {
1269
1280
  w: h,
1270
1281
  hd: 0
1271
1282
  };
1272
- a ? pn(f, (g = a[f - i.startColumn]) != null ? g : C, l) : pn(f, C, l);
1283
+ a ? Cn(f, (g = a[f - i.startColumn]) != null ? g : p, l) : Cn(f, p, l);
1273
1284
  }
1274
1285
  return s.setColumnCount(s.getColumnCount() + i.endColumn - i.startColumn + 1), s.getCellMatrix().insertColumns(i.startColumn, d), !0;
1275
1286
  }
@@ -1396,16 +1407,16 @@ function Pa(n, e, t) {
1396
1407
  if (e.t) return e.t;
1397
1408
  if (e.v === null) return null;
1398
1409
  const o = n.getStyleByCell(e), s = n.getStyleByCell(t);
1399
- if (t.t === re.FORCE_STRING) {
1410
+ if (t.t === ie.FORCE_STRING) {
1400
1411
  if (!to((r = s == null ? void 0 : s.n) == null ? void 0 : r.pattern) && e.v !== void 0) {
1401
- if (po(e.v))
1402
- return re.NUMBER;
1412
+ if (Co(e.v))
1413
+ return ie.NUMBER;
1403
1414
  if (Ms(`${e.v}`))
1404
- return re.BOOLEAN;
1415
+ return ie.BOOLEAN;
1405
1416
  }
1406
- return re.FORCE_STRING;
1417
+ return ie.FORCE_STRING;
1407
1418
  }
1408
- return Na(o) ? to((i = o == null ? void 0 : o.n) == null ? void 0 : i.pattern) ? re.STRING : Xo(e, t) : to((a = s == null ? void 0 : s.n) == null ? void 0 : a.pattern) ? re.STRING : Xo(e, t);
1419
+ return Na(o) ? to((i = o == null ? void 0 : o.n) == null ? void 0 : i.pattern) ? ie.STRING : Xo(e, t) : to((a = s == null ? void 0 : s.n) == null ? void 0 : a.pattern) ? ie.STRING : Xo(e, t);
1409
1420
  }
1410
1421
  function Xo(n, e) {
1411
1422
  return n.v !== void 0 ? Zo(n.v, n.t) : Zo(e.v, e.t);
@@ -1415,10 +1426,10 @@ function Na(n) {
1415
1426
  return !!((e = n == null ? void 0 : n.n) != null && e.pattern);
1416
1427
  }
1417
1428
  function Zo(n, e) {
1418
- return n === null ? null : typeof n == "string" ? po(n) ? (+n == 0 || +n == 1) && e === re.BOOLEAN ? re.BOOLEAN : re.NUMBER : Ms(n) ? re.BOOLEAN : re.STRING : typeof n == "number" ? (n === 0 || n === 1) && e === re.BOOLEAN ? re.BOOLEAN : re.NUMBER : typeof n == "boolean" ? re.BOOLEAN : re.FORCE_STRING;
1429
+ return n === null ? null : typeof n == "string" ? Co(n) ? (+n == 0 || +n == 1) && e === ie.BOOLEAN ? ie.BOOLEAN : ie.NUMBER : Ms(n) ? ie.BOOLEAN : ie.STRING : typeof n == "number" ? (n === 0 || n === 1) && e === ie.BOOLEAN ? ie.BOOLEAN : ie.NUMBER : typeof n == "boolean" ? ie.BOOLEAN : ie.FORCE_STRING;
1419
1430
  }
1420
1431
  function Qo(n, e) {
1421
- return n === re.NUMBER ? Number(e.v) : n === re.BOOLEAN ? Oa(e.v) ? 1 : 0 : n === re.STRING || n === re.FORCE_STRING ? `${e.v}` : e.v;
1432
+ return n === ie.NUMBER ? Number(e.v) : n === ie.BOOLEAN ? Oa(e.v) ? 1 : 0 : n === ie.STRING || n === ie.FORCE_STRING ? `${e.v}` : e.v;
1422
1433
  }
1423
1434
  function Oa(n) {
1424
1435
  if (typeof n == "string") {
@@ -1453,14 +1464,14 @@ const be = (n, e) => {
1453
1464
  throw new Error("worksheet is null error!");
1454
1465
  const u = a.getCellMatrix(), l = i.getStyles(), c = new G();
1455
1466
  return new G(s).forValue((h, m, g) => {
1456
- const f = O.deepClone(u == null ? void 0 : u.getValue(h, m)) || {}, C = l.getStyleByCell(f), p = l.getStyleByCell(g);
1457
- f.s = Ua(C, p), c.setValue(h, m, Da(f));
1467
+ const f = O.deepClone(u == null ? void 0 : u.getValue(h, m)) || {}, p = l.getStyleByCell(f), C = l.getStyleByCell(g);
1468
+ f.s = Ua(p, C), c.setValue(h, m, Da(f));
1458
1469
  }), {
1459
1470
  ...e,
1460
1471
  options: {},
1461
1472
  cellValue: c.getMatrix()
1462
1473
  };
1463
- }, Z = {
1474
+ }, X = {
1464
1475
  id: "sheet.mutation.set-range-values",
1465
1476
  type: v.MUTATION,
1466
1477
  handler: (n, e) => {
@@ -1491,9 +1502,9 @@ const be = (n, e) => {
1491
1502
  }, h = be(
1492
1503
  n,
1493
1504
  d
1494
- ), m = [{ id: Z.id, params: d }], g = [{ id: Z.id, params: h }];
1505
+ ), m = [{ id: X.id, params: d }], g = [{ id: X.id, params: h }];
1495
1506
  if (a) {
1496
- const C = {
1507
+ const p = {
1497
1508
  unitId: s,
1498
1509
  subUnitId: r,
1499
1510
  range: {
@@ -1502,14 +1513,14 @@ const be = (n, e) => {
1502
1513
  startColumn: 0,
1503
1514
  endColumn: c - 1
1504
1515
  }
1505
- }, p = wo(
1516
+ }, C = wo(
1506
1517
  n,
1507
- C
1518
+ p
1508
1519
  );
1509
- m.unshift({ id: je.id, params: C }), g.push({ id: Ge.id, params: p });
1520
+ m.unshift({ id: je.id, params: p }), g.push({ id: Ge.id, params: C });
1510
1521
  }
1511
1522
  if (u) {
1512
- const C = {
1523
+ const p = {
1513
1524
  unitId: s,
1514
1525
  subUnitId: r,
1515
1526
  range: {
@@ -1518,11 +1529,11 @@ const be = (n, e) => {
1518
1529
  startColumn: c,
1519
1530
  endColumn: c - 1 + u
1520
1531
  }
1521
- }, p = Bn(
1532
+ }, C = Bn(
1522
1533
  n,
1523
- C
1534
+ p
1524
1535
  );
1525
- m.unshift({ id: We.id, params: C }), g.push({ id: ye.id, params: p });
1536
+ m.unshift({ id: We.id, params: p }), g.push({ id: ye.id, params: C });
1526
1537
  }
1527
1538
  return z(m, t).result ? (o.pushUndoRedo({
1528
1539
  unitID: s,
@@ -1616,8 +1627,8 @@ function Fn(n, e, t, o) {
1616
1627
  });
1617
1628
  return u;
1618
1629
  }
1619
- var pe = /* @__PURE__ */ ((n) => (n[n.MOVE_START = 0] = "MOVE_START", n[n.MOVING = 1] = "MOVING", n[n.MOVE_END = 2] = "MOVE_END", n[n.ONLY_SET = 3] = "ONLY_SET", n))(pe || {});
1620
- class Ba extends ae {
1630
+ var Ce = /* @__PURE__ */ ((n) => (n[n.MOVE_START = 0] = "MOVE_START", n[n.MOVING = 1] = "MOVING", n[n.MOVE_END = 2] = "MOVE_END", n[n.ONLY_SET = 3] = "ONLY_SET", n))(Ce || {});
1631
+ class Ba extends ue {
1621
1632
  constructor(t) {
1622
1633
  super();
1623
1634
  /**
@@ -1652,16 +1663,16 @@ class Ba extends ae {
1652
1663
  */
1653
1664
  setSelections(t, o = [], s) {
1654
1665
  switch (this.setSelectionsOfWorksheet(t, o), s) {
1655
- case pe.MOVE_START:
1666
+ case Ce.MOVE_START:
1656
1667
  this._selectionMoveStart$.next(o);
1657
1668
  break;
1658
- case pe.MOVING:
1669
+ case Ce.MOVING:
1659
1670
  this._selectionMoving$.next(o);
1660
1671
  break;
1661
- case pe.MOVE_END:
1672
+ case Ce.MOVE_END:
1662
1673
  this._beforeSelectionMoveEnd$.next(o), this._selectionMoveEnd$.next(o);
1663
1674
  break;
1664
- case pe.ONLY_SET: {
1675
+ case Ce.ONLY_SET: {
1665
1676
  this._selectionSet$.next(o);
1666
1677
  break;
1667
1678
  }
@@ -1782,7 +1793,7 @@ let H = class extends _s {
1782
1793
  this._ensureWorkbookSelection(u).setSelections(
1783
1794
  t,
1784
1795
  o || [],
1785
- s != null ? s : pe.ONLY_SET
1796
+ s != null ? s : Ce.ONLY_SET
1786
1797
  );
1787
1798
  return;
1788
1799
  }
@@ -1791,7 +1802,7 @@ let H = class extends _s {
1791
1802
  throw new Error("[SheetsSelectionsService]: cannot find current selection position!");
1792
1803
  const { unitId: i, sheetId: a } = r;
1793
1804
  if (typeof e == "object") {
1794
- const u = e != null ? e : o, l = t != null ? t : pe.ONLY_SET;
1805
+ const u = e != null ? e : o, l = t != null ? t : Ce.ONLY_SET;
1795
1806
  this._ensureWorkbookSelection(i).setSelections(a, u, l);
1796
1807
  }
1797
1808
  }
@@ -1852,19 +1863,19 @@ const Dd = "DISABLE_NORMAL_SELECTIONS", Ad = "SELECTIONS_ENABLED", za = "REF_SEL
1852
1863
  subUnitId: c,
1853
1864
  unitId: u,
1854
1865
  cellValue: Ws(h)
1855
- }, C = be(
1866
+ }, p = be(
1856
1867
  n,
1857
1868
  f
1858
1869
  );
1859
1870
  m.push({
1860
- id: Z.id,
1871
+ id: X.id,
1861
1872
  params: f
1862
1873
  }), g.push({
1863
- id: Z.id,
1864
- params: C
1874
+ id: X.id,
1875
+ params: p
1865
1876
  });
1866
- const p = i.onCommandExecute({ id: Io.id });
1867
- return m.push(...p.redos), g.unshift(...p.undos), z(m, o) ? (r.pushUndoRedo({
1877
+ const C = i.onCommandExecute({ id: Io.id });
1878
+ return m.push(...C.redos), g.unshift(...C.undos), z(m, o) ? (r.pushUndoRedo({
1868
1879
  // If there are multiple mutations that form an encapsulated project, they must be encapsulated in the same undo redo element.
1869
1880
  // Hooks can be used to hook the code of external controllers to add new actions.
1870
1881
  unitID: u,
@@ -1891,13 +1902,13 @@ const Dd = "DISABLE_NORMAL_SELECTIONS", Ad = "SELECTIONS_ENABLED", za = "REF_SEL
1891
1902
  }, g = be(
1892
1903
  n,
1893
1904
  m
1894
- ), f = i.onCommandExecute({ id: vo.id }), C = [{ id: Z.id, params: m }, ...f.redos], p = [...f.undos, { id: Z.id, params: g }];
1895
- return z(C, o).result ? (r.pushUndoRedo({
1905
+ ), f = i.onCommandExecute({ id: vo.id }), p = [{ id: X.id, params: m }, ...f.redos], C = [...f.undos, { id: X.id, params: g }];
1906
+ return z(p, o).result ? (r.pushUndoRedo({
1896
1907
  // If there are multiple mutations that form an encapsulated project, they must be encapsulated in the same undo redo element.
1897
1908
  // Hooks can be used to hook the code of external controllers to add new actions.
1898
1909
  unitID: u,
1899
- undoMutations: p,
1900
- redoMutations: C
1910
+ undoMutations: C,
1911
+ redoMutations: p
1901
1912
  }), !0) : !1;
1902
1913
  }
1903
1914
  }, Mo = {
@@ -1916,19 +1927,19 @@ const Dd = "DISABLE_NORMAL_SELECTIONS", Ad = "SELECTIONS_ENABLED", za = "REF_SEL
1916
1927
  subUnitId: c,
1917
1928
  unitId: u,
1918
1929
  cellValue: La(h)
1919
- }, C = be(
1930
+ }, p = be(
1920
1931
  n,
1921
1932
  f
1922
1933
  );
1923
1934
  m.push({
1924
- id: Z.id,
1935
+ id: X.id,
1925
1936
  params: f
1926
1937
  }), g.push({
1927
- id: Z.id,
1928
- params: C
1938
+ id: X.id,
1939
+ params: p
1929
1940
  });
1930
- const p = i.onCommandExecute({ id: Mo.id });
1931
- return m.push(...p.redos), g.unshift(...p.undos), z(m, o) ? (r.pushUndoRedo({
1941
+ const C = i.onCommandExecute({ id: Mo.id });
1942
+ return m.push(...C.redos), g.unshift(...C.undos), z(m, o) ? (r.pushUndoRedo({
1932
1943
  // If there are multiple mutations that form an encapsulated project, they must be encapsulated in the same undo redo element.
1933
1944
  // Hooks can be used to hook the code of external controllers to add new actions.
1934
1945
  unitID: u,
@@ -1969,7 +1980,7 @@ const Dd = "DISABLE_NORMAL_SELECTIONS", Ad = "SELECTIONS_ENABLED", za = "REF_SEL
1969
1980
  id: "sheet.command.copy-sheet",
1970
1981
  handler: (n, e) => {
1971
1982
  var w, y;
1972
- const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(F), i = n.get(Ye), a = P(s, e);
1983
+ const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(F), i = n.get(Ye), a = k(s, e);
1973
1984
  if (!a)
1974
1985
  return !1;
1975
1986
  const { workbook: u, worksheet: l, unitId: c, subUnitId: d } = a, h = O.deepClone(l.getConfig());
@@ -1981,22 +1992,22 @@ const Dd = "DISABLE_NORMAL_SELECTIONS", Ad = "SELECTIONS_ENABLED", za = "REF_SEL
1981
1992
  }, f = $s(
1982
1993
  n,
1983
1994
  g
1984
- ), C = r.onCommandExecute({
1995
+ ), p = r.onCommandExecute({
1985
1996
  id: Vs.id,
1986
1997
  params: { unitId: c, subUnitId: d, targetSubUnitId: h.id }
1987
- }), p = [
1988
- ...(w = C.preRedos) != null ? w : [],
1998
+ }), C = [
1999
+ ...(w = p.preRedos) != null ? w : [],
1989
2000
  { id: Yt.id, params: g },
1990
- ...C.redos
2001
+ ...p.redos
1991
2002
  ], S = [
1992
- ...(y = C.preUndos) != null ? y : [],
2003
+ ...(y = p.preUndos) != null ? y : [],
1993
2004
  { id: Tt.id, params: f },
1994
- ...C.undos
2005
+ ...p.undos
1995
2006
  ];
1996
- return z(p, t).result ? (o.pushUndoRedo({
2007
+ return z(C, t).result ? (o.pushUndoRedo({
1997
2008
  unitID: c,
1998
2009
  undoMutations: S,
1999
- redoMutations: p
2010
+ redoMutations: C
2000
2011
  }), !0) : !1;
2001
2012
  }
2002
2013
  };
@@ -2094,7 +2105,7 @@ function Se(n, e) {
2094
2105
  };
2095
2106
  }
2096
2107
  const Ze = (n, e, t) => ({
2097
- id: se.id,
2108
+ id: re.id,
2098
2109
  params: {
2099
2110
  unitId: e.getUnitId(),
2100
2111
  subUnitId: t.getSheetId(),
@@ -2164,7 +2175,7 @@ function eu(n, e) {
2164
2175
  const o = n.get(ys).getContextValue(za);
2165
2176
  return n.get(o && !e ? Qa : H);
2166
2177
  }
2167
- const se = {
2178
+ const re = {
2168
2179
  id: "sheet.operation.set-selections",
2169
2180
  type: v.OPERATION,
2170
2181
  handler: (n, e) => {
@@ -2177,14 +2188,14 @@ const se = {
2177
2188
  type: v.COMMAND,
2178
2189
  handler: (n, e) => {
2179
2190
  if (!e) return !1;
2180
- const { unitId: t, subUnit: o, range: s } = e, r = n.get(E), i = P(n.get(M), e);
2191
+ const { unitId: t, subUnit: o, range: s } = e, r = n.get(E), i = k(n.get(M), e);
2181
2192
  if (!i) return !1;
2182
2193
  const a = [{
2183
2194
  range: s,
2184
2195
  primary: Se(s, i.worksheet),
2185
2196
  style: null
2186
2197
  }];
2187
- return r.syncExecuteCommand(se.id, {
2198
+ return r.syncExecuteCommand(re.id, {
2188
2199
  unitId: t,
2189
2200
  subUnitId: o,
2190
2201
  selections: a
@@ -2195,7 +2206,7 @@ const se = {
2195
2206
  id: Ls,
2196
2207
  handler: async (n, e) => {
2197
2208
  var I, w;
2198
- const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(Ut), i = n.get(Ye), a = n.get(F), u = P(s);
2209
+ const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(Ut), i = n.get(Ye), a = n.get(F), u = k(s);
2199
2210
  if (!u || !await a.beforeCommandExecute({ id: wt.id, params: e }))
2200
2211
  return !1;
2201
2212
  const { worksheet: c, subUnitId: d, unitId: h } = u, m = _o(
@@ -2213,59 +2224,59 @@ const se = {
2213
2224
  ...m.redos,
2214
2225
  ...g.redos,
2215
2226
  {
2216
- id: se.id,
2227
+ id: re.id,
2217
2228
  params: {
2218
2229
  unitId: h,
2219
2230
  subUnitId: d,
2220
2231
  selections: [{ range: e.toRange, primary: nu(e.fromRange, e.toRange, c) }],
2221
- type: pe.MOVE_END
2232
+ type: Ce.MOVE_END
2222
2233
  }
2223
2234
  }
2224
- ], C = [
2235
+ ], p = [
2225
2236
  ...(w = g.preUndos) != null ? w : [],
2226
2237
  ...m.undos,
2227
2238
  ...g.undos,
2228
2239
  {
2229
- id: se.id,
2240
+ id: re.id,
2230
2241
  params: {
2231
2242
  unitId: h,
2232
2243
  subUnitId: d,
2233
2244
  selections: [{ range: e.fromRange, primary: Se(e.fromRange, c) }],
2234
- type: pe.MOVE_END
2245
+ type: Ce.MOVE_END
2235
2246
  }
2236
2247
  }
2237
- ], p = z(f, t).result, S = a.afterCommandExecute({
2248
+ ], C = z(f, t).result, S = a.afterCommandExecute({
2238
2249
  id: wt.id,
2239
2250
  params: { ...e }
2240
2251
  });
2241
- return p ? (z(S.redos, t), o.pushUndoRedo({
2252
+ return C ? (z(S.redos, t), o.pushUndoRedo({
2242
2253
  unitID: h,
2243
- undoMutations: [...C, ...S.undos],
2254
+ undoMutations: [...p, ...S.undos],
2244
2255
  redoMutations: [...f, ...S.redos]
2245
2256
  }), !0) : !1;
2246
2257
  }
2247
2258
  };
2248
2259
  function _o(n, e, t, o = !1) {
2249
- const s = [], r = [], { range: i, subUnitId: a, unitId: u } = e, { range: l, subUnitId: c } = t, h = n.get(M).getUniverSheetInstance(u), m = h == null ? void 0 : h.getSheetBySheetId(c), g = h == null ? void 0 : h.getSheetBySheetId(a), f = m == null ? void 0 : m.getCellMatrix(), C = g == null ? void 0 : g.getCellMatrix();
2250
- if (m && g && f && C) {
2251
- const p = jn(l, m, !1);
2252
- if (!N.equals(l, p) && !o)
2260
+ const s = [], r = [], { range: i, subUnitId: a, unitId: u } = e, { range: l, subUnitId: c } = t, h = n.get(M).getUniverSheetInstance(u), m = h == null ? void 0 : h.getSheetBySheetId(c), g = h == null ? void 0 : h.getSheetBySheetId(a), f = m == null ? void 0 : m.getCellMatrix(), p = g == null ? void 0 : g.getCellMatrix();
2261
+ if (m && g && f && p) {
2262
+ const C = jn(l, m, !1);
2263
+ if (!N.equals(l, C) && !o)
2253
2264
  return null;
2254
2265
  const S = new G(), I = new G(), w = new G();
2255
- K.foreach(i, (U, k) => {
2256
- const x = C.getValue(U, k);
2257
- if (S.setValue(U, k, O.deepClone(x)), x) {
2266
+ K.foreach(i, (P, U) => {
2267
+ const x = p.getValue(P, U);
2268
+ if (S.setValue(P, U, O.deepClone(x)), x) {
2258
2269
  const j = h == null ? void 0 : h.getStyles().get(x.s);
2259
- w.setValue(U, k, O.deepClone(j));
2270
+ w.setValue(P, U, O.deepClone(j));
2260
2271
  }
2261
- I.setValue(U, k, null);
2272
+ I.setValue(P, U, null);
2262
2273
  });
2263
2274
  const y = new G(), b = new G();
2264
- K.foreach(l, (U, k) => {
2265
- y.setValue(U, k, O.deepClone(f.getValue(U, k)));
2266
- }), K.foreach(i, (U, k) => {
2267
- const x = bs(U, k), j = N.getRelativeRange(x, i), Q = N.getPositionRange(j, l), Y = O.deepClone(w.getValue(U, k)), ee = O.deepClone(S.getValue(U, k));
2268
- ee && Y && (ee.s = Y), b.setValue(Q.startRow, Q.startColumn, ee);
2275
+ K.foreach(l, (P, U) => {
2276
+ y.setValue(P, U, O.deepClone(f.getValue(P, U)));
2277
+ }), K.foreach(i, (P, U) => {
2278
+ const x = bs(P, U), j = N.getRelativeRange(x, i), Z = N.getPositionRange(j, l), Q = O.deepClone(w.getValue(P, U)), ee = O.deepClone(S.getValue(P, U));
2279
+ ee && Q && (ee.s = Q), b.setValue(Z.startRow, Z.startColumn, ee);
2269
2280
  });
2270
2281
  const D = {
2271
2282
  fromRange: e.range,
@@ -2728,49 +2739,50 @@ const sn = {
2728
2739
  id: "sheet.command.set-range-values",
2729
2740
  type: v.COMMAND,
2730
2741
  handler: (n, e) => {
2731
- var T;
2732
- const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(H), i = n.get(F), a = n.get(Fe), u = P(s, e);
2742
+ var P;
2743
+ const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(H), i = n.get(F), a = n.get(Fe), u = k(s, e);
2733
2744
  if (!u) return !1;
2734
- const { subUnitId: l, unitId: c, workbook: d, worksheet: h } = u, { value: m, range: g } = e, f = g ? [g] : (T = r.getCurrentSelections()) == null ? void 0 : T.map((U) => U.range);
2735
- if (!f || !f.length || !a.getPermissionPoint(new Oe(c, l).id)) return !1;
2745
+ const { subUnitId: l, unitId: c, workbook: d, worksheet: h } = u, { value: m, range: g, redoUndoId: f } = e, p = g ? [g] : (P = r.getCurrentSelections()) == null ? void 0 : P.map((U) => U.range);
2746
+ if (!p || !p.length || !a.getPermissionPoint(new Oe(c, l).id)) return !1;
2736
2747
  const C = new G();
2737
- let p;
2748
+ let S;
2738
2749
  if (O.isArray(m))
2739
- for (let U = 0; U < f.length; U++) {
2740
- const { startRow: k, startColumn: x, endRow: j, endColumn: Q } = f[U];
2741
- for (let Y = 0; Y <= j - k; Y++)
2742
- for (let ee = 0; ee <= Q - x; ee++)
2743
- C.setValue(Y + k, ee + x, m[Y][ee]);
2750
+ for (let U = 0; U < p.length; U++) {
2751
+ const { startRow: x, startColumn: j, endRow: Z, endColumn: Q } = p[U];
2752
+ for (let ee = 0; ee <= Z - x; ee++)
2753
+ for (let se = 0; se <= Q - j; se++)
2754
+ C.setValue(ee + x, se + j, m[ee][se]);
2744
2755
  }
2745
2756
  else if (Es(m))
2746
- for (let U = 0; U < f.length; U++) {
2747
- const { startRow: k, startColumn: x, endRow: j, endColumn: Q } = f[U];
2748
- for (let Y = k; Y <= j; Y++)
2749
- for (let ee = x; ee <= Q; ee++)
2750
- C.setValue(Y, ee, m);
2757
+ for (let U = 0; U < p.length; U++) {
2758
+ const { startRow: x, startColumn: j, endRow: Z, endColumn: Q } = p[U];
2759
+ for (let ee = x; ee <= Z; ee++)
2760
+ for (let se = j; se <= Q; se++)
2761
+ C.setValue(ee, se, m);
2751
2762
  }
2752
2763
  else
2753
- p = m;
2754
- const S = { subUnitId: l, unitId: c, cellValue: p != null ? p : C.getMatrix() }, I = be(n, S);
2755
- if (!t.syncExecuteCommand(Z.id, S)) return !1;
2756
- const { undos: y, redos: b } = i.onCommandExecute({
2764
+ S = m;
2765
+ const I = { subUnitId: l, unitId: c, cellValue: S != null ? S : C.getMatrix() }, w = be(n, I);
2766
+ if (!t.syncExecuteCommand(X.id, I)) return !1;
2767
+ const { undos: b, redos: D } = i.onCommandExecute({
2757
2768
  id: sn.id,
2758
- params: { ...S, range: f }
2769
+ params: { ...I, range: p }
2759
2770
  });
2760
- if (z([...b], t).result) {
2771
+ if (z([...D], t).result) {
2761
2772
  const U = Ze(g != null ? g : C.getRange(), d, h);
2762
2773
  return o.pushUndoRedo({
2763
2774
  unitID: c,
2764
2775
  undoMutations: [
2765
- { id: Z.id, params: I },
2766
- ...y,
2776
+ { id: X.id, params: w },
2777
+ ...b,
2767
2778
  U
2768
2779
  ],
2769
2780
  redoMutations: [
2770
- { id: Z.id, params: S },
2771
- ...b,
2781
+ { id: X.id, params: I },
2782
+ ...D,
2772
2783
  O.deepClone(U)
2773
- ]
2784
+ ],
2785
+ id: f
2774
2786
  }), !0;
2775
2787
  }
2776
2788
  return !1;
@@ -2785,8 +2797,8 @@ function hr(n, e) {
2785
2797
  if (a === fe.COLUMNS) {
2786
2798
  const b = Math.min(i.endRow, g.endRow);
2787
2799
  let D = 0;
2788
- for (let U = i.startRow; U <= b; U++) {
2789
- const k = m.getRow(U), x = k ? Us(k) - 1 : 0;
2800
+ for (let P = i.startRow; P <= b; P++) {
2801
+ const U = m.getRow(P), x = U ? Us(U) - 1 : 0;
2790
2802
  D = Math.max(D, x);
2791
2803
  }
2792
2804
  I = {
@@ -2836,14 +2848,14 @@ function hr(n, e) {
2836
2848
  subUnitId: r,
2837
2849
  unitId: s,
2838
2850
  cellValue: u
2839
- }, C = be(
2851
+ }, p = be(
2840
2852
  n,
2841
2853
  f
2842
- ), { undos: p, redos: S } = c.onCommandExecute({
2854
+ ), { undos: C, redos: S } = c.onCommandExecute({
2843
2855
  id: sn.id,
2844
2856
  params: { ...f, range: i }
2845
2857
  });
2846
- t.push({ id: Z.id, params: f }, ...S), o.push({ id: Z.id, params: C }, ...p);
2858
+ t.push({ id: X.id, params: f }, ...S), o.push({ id: X.id, params: p }, ...C);
2847
2859
  }
2848
2860
  return {
2849
2861
  redo: t,
@@ -2860,15 +2872,15 @@ function mr(n, e) {
2860
2872
  }, f = be(
2861
2873
  n,
2862
2874
  g
2863
- ), C = l.onCommandExecute({
2875
+ ), p = l.onCommandExecute({
2864
2876
  id: sn.id,
2865
2877
  params: g
2866
2878
  });
2867
- if (t.push({ id: Z.id, params: g }, ...C.redos), o.push(...C.undos, {
2868
- id: Z.id,
2879
+ if (t.push({ id: X.id, params: g }, ...p.redos), o.push(...p.undos, {
2880
+ id: X.id,
2869
2881
  params: f
2870
2882
  }), i.startColumn <= m.endColumn || i.startRow <= m.endRow) {
2871
- let p = null, S = null;
2883
+ let C = null, S = null;
2872
2884
  if (a === fe.COLUMNS && i.endColumn < m.endColumn) {
2873
2885
  const I = Math.min(i.endRow, m.endRow);
2874
2886
  let w = 0;
@@ -2876,7 +2888,7 @@ function mr(n, e) {
2876
2888
  const D = h.getRow(b), T = D ? Us(D) - 1 : 0;
2877
2889
  w = Math.max(w, T);
2878
2890
  }
2879
- p = {
2891
+ C = {
2880
2892
  startRow: i.startRow,
2881
2893
  startColumn: i.endColumn + 1,
2882
2894
  endRow: I,
@@ -2885,14 +2897,14 @@ function mr(n, e) {
2885
2897
  const y = i.endColumn - i.startColumn + 1;
2886
2898
  S = {
2887
2899
  startRow: i.startRow,
2888
- startColumn: p.startColumn - y,
2900
+ startColumn: C.startColumn - y,
2889
2901
  endRow: I,
2890
- endColumn: p.endColumn - y
2902
+ endColumn: C.endColumn - y
2891
2903
  };
2892
2904
  }
2893
2905
  if (a === fe.ROWS && i.endRow < m.endRow) {
2894
2906
  const I = Math.min(i.endColumn, m.endColumn), w = m.endRow;
2895
- p = {
2907
+ C = {
2896
2908
  startRow: i.endRow + 1,
2897
2909
  startColumn: i.startColumn,
2898
2910
  endRow: w,
@@ -2900,16 +2912,16 @@ function mr(n, e) {
2900
2912
  };
2901
2913
  const y = i.endRow - i.startRow + 1;
2902
2914
  S = {
2903
- startRow: p.startRow - y,
2915
+ startRow: C.startRow - y,
2904
2916
  startColumn: i.startColumn,
2905
- endRow: p.endRow - y,
2917
+ endRow: C.endRow - y,
2906
2918
  endColumn: I
2907
2919
  };
2908
2920
  }
2909
- if (p && S) {
2921
+ if (C && S) {
2910
2922
  const I = _o(
2911
2923
  n,
2912
- { unitId: s, subUnitId: r, range: p },
2924
+ { unitId: s, subUnitId: r, range: C },
2913
2925
  { subUnitId: r, range: S },
2914
2926
  !0
2915
2927
  );
@@ -2966,7 +2978,7 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
2966
2978
  id: gr,
2967
2979
  handler: async (n, e) => {
2968
2980
  var w, y, b;
2969
- const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(H), i = n.get(F), a = P(s);
2981
+ const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(H), i = n.get(F), a = k(s);
2970
2982
  if (!a) return !1;
2971
2983
  const { worksheet: u, workbook: l, subUnitId: c, unitId: d } = a;
2972
2984
  let h = e == null ? void 0 : e.range;
@@ -2979,14 +2991,14 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
2979
2991
  }, g = i.onCommandExecute({
2980
2992
  id: Pt.id,
2981
2993
  params: { range: h }
2982
- }), { redo: f, undo: C } = mr(
2994
+ }), { redo: f, undo: p } = mr(
2983
2995
  n,
2984
2996
  m
2985
- ), p = [...(y = g.preRedos) != null ? y : [], ...f], S = [...g.undos, ...C];
2986
- return p.push(...g.redos), p.push(Ze(h, l, u)), S.push(...(b = g.preUndos) != null ? b : []), z(p, t).result ? (o.pushUndoRedo({
2997
+ ), C = [...(y = g.preRedos) != null ? y : [], ...f], S = [...g.undos, ...p];
2998
+ return C.push(...g.redos), C.push(Ze(h, l, u)), S.push(...(b = g.preUndos) != null ? b : []), z(C, t).result ? (o.pushUndoRedo({
2987
2999
  unitID: d,
2988
3000
  undoMutations: S.reverse(),
2989
- redoMutations: p
3001
+ redoMutations: C
2990
3002
  }), !0) : !1;
2991
3003
  }
2992
3004
  // all subsequent mutations should succeed inorder to make the whole process succeed
@@ -2996,7 +3008,7 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
2996
3008
  id: fr,
2997
3009
  handler: async (n, e) => {
2998
3010
  var w, y, b;
2999
- const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(H), i = n.get(F), a = P(s);
3011
+ const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(H), i = n.get(F), a = k(s);
3000
3012
  if (!a) return !1;
3001
3013
  const { unitId: u, subUnitId: l, workbook: c, worksheet: d } = a;
3002
3014
  let h = e == null ? void 0 : e.range;
@@ -3009,14 +3021,14 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3009
3021
  }, g = i.onCommandExecute({
3010
3022
  id: Nt.id,
3011
3023
  params: { range: h }
3012
- }), { redo: f, undo: C } = mr(
3024
+ }), { redo: f, undo: p } = mr(
3013
3025
  n,
3014
3026
  m
3015
- ), p = [...(y = g.preRedos) != null ? y : [], ...f], S = [...g.undos, ...C];
3016
- return p.push(...g.redos), p.push(Ze(h, c, d)), S.push(...(b = g.preUndos) != null ? b : []), z(p, t).result ? (o.pushUndoRedo({
3027
+ ), C = [...(y = g.preRedos) != null ? y : [], ...f], S = [...g.undos, ...p];
3028
+ return C.push(...g.redos), C.push(Ze(h, c, d)), S.push(...(b = g.preUndos) != null ? b : []), z(C, t).result ? (o.pushUndoRedo({
3017
3029
  unitID: u,
3018
3030
  undoMutations: S.reverse(),
3019
- redoMutations: p
3031
+ redoMutations: C
3020
3032
  }), !0) : !1;
3021
3033
  }
3022
3034
  // all subsequent mutations should succeed inorder to make the whole process succeed
@@ -3087,18 +3099,18 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3087
3099
  id: "sheet.command.insert-range-move-down",
3088
3100
  // eslint-disable-next-line max-lines-per-function
3089
3101
  handler: async (n, e) => {
3090
- var j, Q, Y;
3102
+ var j, Z, Q;
3091
3103
  const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(H), i = n.get(F), a = n.get(Ut), u = n.get(Ye);
3092
3104
  if (r.isOverlapping())
3093
3105
  return a.emit(u.t("sheets.info.overlappingSelections")), !1;
3094
- const l = P(s);
3106
+ const l = k(s);
3095
3107
  if (!l) return !1;
3096
3108
  const { unitId: c, subUnitId: d, worksheet: h, workbook: m } = l;
3097
3109
  let g = e == null ? void 0 : e.range;
3098
3110
  if (g || (g = (j = r.getCurrentLastSelection()) == null ? void 0 : j.range), !g) return !1;
3099
- const f = [], C = [], p = h.getCellMatrix(), S = p.getDataRange(), w = p.getSlice(S.startRow, S.endRow, g.startColumn, g.endColumn).getDataRange().endRow, y = Math.max(w + (g.endRow - g.startRow + 1) - S.endRow, 0);
3111
+ const f = [], p = [], C = h.getCellMatrix(), S = C.getDataRange(), w = C.getSlice(S.startRow, S.endRow, g.startColumn, g.endColumn).getDataRange().endRow, y = Math.max(w + (g.endRow - g.startRow + 1) - S.endRow, 0);
3100
3112
  if (y > 0) {
3101
- const ee = g.startRow - 1, Ce = h.getRowHeight(ee), ie = {
3113
+ const ee = g.startRow - 1, se = h.getRowHeight(ee), ae = {
3102
3114
  unitId: c,
3103
3115
  subUnitId: d,
3104
3116
  range: {
@@ -3108,24 +3120,24 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3108
3120
  endColumn: S.endColumn
3109
3121
  },
3110
3122
  rowInfo: new Array(y).fill(void 0).map(() => ({
3111
- h: Ce,
3123
+ h: se,
3112
3124
  hd: te.FALSE
3113
3125
  }))
3114
3126
  };
3115
3127
  f.push({
3116
3128
  id: je.id,
3117
- params: ie
3129
+ params: ae
3118
3130
  });
3119
3131
  const $e = wo(
3120
3132
  n,
3121
- ie
3133
+ ae
3122
3134
  );
3123
- C.push({ id: Ge.id, params: $e });
3135
+ p.push({ id: Ge.id, params: $e });
3124
3136
  }
3125
3137
  const b = {};
3126
- K.foreach(g, (ee, Ce) => {
3127
- const ie = h.getCell(ee, Ce);
3128
- ie && (b[ee] || (b[ee] = {}), b[ee][Ce] = { s: ie.s });
3138
+ K.foreach(g, (ee, se) => {
3139
+ const ae = h.getCell(ee, se);
3140
+ ae && (b[ee] || (b[ee] = {}), b[ee][se] = { s: ae.s });
3129
3141
  });
3130
3142
  const D = {
3131
3143
  range: g,
@@ -3133,18 +3145,18 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3133
3145
  unitId: c,
3134
3146
  shiftDimension: fe.ROWS,
3135
3147
  cellValue: b
3136
- }, { redo: T, undo: U } = hr(
3148
+ }, { redo: T, undo: P } = hr(
3137
3149
  n,
3138
3150
  D
3139
3151
  );
3140
- f.push(...T), C.push(...U);
3141
- const k = i.onCommandExecute({
3152
+ f.push(...T), p.push(...P);
3153
+ const U = i.onCommandExecute({
3142
3154
  id: rn.id,
3143
3155
  params: { range: g }
3144
3156
  });
3145
- return f.push(...k.redos), f.push(Ze(g, m, h)), C.push(...(Q = k.preUndos) != null ? Q : []), f.unshift(...(Y = k.preRedos) != null ? Y : []), C.unshift(...k.undos), z(f, t) ? (o.pushUndoRedo({
3157
+ return f.push(...U.redos), f.push(Ze(g, m, h)), p.push(...(Z = U.preUndos) != null ? Z : []), f.unshift(...(Q = U.preRedos) != null ? Q : []), p.unshift(...U.undos), z(f, t) ? (o.pushUndoRedo({
3146
3158
  unitID: c,
3147
- undoMutations: C.reverse(),
3159
+ undoMutations: p.reverse(),
3148
3160
  redoMutations: f
3149
3161
  }), !0) : !1;
3150
3162
  }
@@ -3155,21 +3167,21 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3155
3167
  id: To,
3156
3168
  // eslint-disable-next-line max-lines-per-function
3157
3169
  handler: async (n, e) => {
3158
- var j, Q, Y;
3170
+ var j, Z, Q;
3159
3171
  const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(H), i = n.get(F), a = n.get(Ut), u = n.get(Ye);
3160
3172
  if (r.isOverlapping())
3161
3173
  return a.emit(u.t("sheets.info.overlappingSelections")), !1;
3162
- const l = P(s);
3174
+ const l = k(s);
3163
3175
  if (!l) return !1;
3164
3176
  const { workbook: c, worksheet: d, unitId: h, subUnitId: m } = l;
3165
3177
  let g = e == null ? void 0 : e.range;
3166
3178
  if (g || (g = (j = r.getCurrentLastSelection()) == null ? void 0 : j.range), !g) return !1;
3167
- const f = [], C = [], p = d.getCellMatrix(), S = p.getDataRange(), w = p.getSlice(g.startRow, g.endRow, S.startColumn, S.endColumn).getDataRange().endColumn, y = Math.max(
3179
+ const f = [], p = [], C = d.getCellMatrix(), S = C.getDataRange(), w = C.getSlice(g.startRow, g.endRow, S.startColumn, S.endColumn).getDataRange().endColumn, y = Math.max(
3168
3180
  w + (g.endColumn - g.startColumn + 1) - S.endColumn,
3169
3181
  0
3170
3182
  );
3171
3183
  if (y > 0) {
3172
- const ee = g.startColumn - 1, Ce = d.getColumnWidth(ee), ie = {
3184
+ const ee = g.startColumn - 1, se = d.getColumnWidth(ee), ae = {
3173
3185
  unitId: h,
3174
3186
  subUnitId: m,
3175
3187
  range: {
@@ -3179,24 +3191,24 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3179
3191
  endColumn: S.endColumn + y
3180
3192
  },
3181
3193
  colInfo: new Array(y).fill(void 0).map(() => ({
3182
- w: Ce,
3194
+ w: se,
3183
3195
  hd: te.FALSE
3184
3196
  }))
3185
3197
  };
3186
3198
  f.push({
3187
3199
  id: We.id,
3188
- params: ie
3200
+ params: ae
3189
3201
  });
3190
3202
  const $e = Bn(
3191
3203
  n,
3192
- ie
3204
+ ae
3193
3205
  );
3194
- C.push({ id: ye.id, params: $e });
3206
+ p.push({ id: ye.id, params: $e });
3195
3207
  }
3196
3208
  const b = {};
3197
- K.foreach(g, (ee, Ce) => {
3198
- const ie = d.getCell(ee, Ce);
3199
- !ie || !ie.s || (b[ee] || (b[ee] = {}), b[ee][Ce] = { s: ie.s });
3209
+ K.foreach(g, (ee, se) => {
3210
+ const ae = d.getCell(ee, se);
3211
+ !ae || !ae.s || (b[ee] || (b[ee] = {}), b[ee][se] = { s: ae.s });
3200
3212
  });
3201
3213
  const D = {
3202
3214
  range: g,
@@ -3204,18 +3216,18 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3204
3216
  unitId: h,
3205
3217
  shiftDimension: fe.COLUMNS,
3206
3218
  cellValue: b
3207
- }, { redo: T, undo: U } = hr(
3219
+ }, { redo: T, undo: P } = hr(
3208
3220
  n,
3209
3221
  D
3210
3222
  );
3211
- f.push(...T), C.push(...U);
3212
- const k = i.onCommandExecute({
3223
+ f.push(...T), p.push(...P);
3224
+ const U = i.onCommandExecute({
3213
3225
  id: zn.id,
3214
3226
  params: { range: g }
3215
3227
  });
3216
- return f.push(...k.redos), f.push(Ze(g, c, d)), C.push(...(Q = k.preUndos) != null ? Q : []), f.unshift(...(Y = k.preRedos) != null ? Y : []), C.unshift(...k.undos), z(f, t).result ? (o.pushUndoRedo({
3228
+ return f.push(...U.redos), f.push(Ze(g, c, d)), p.push(...(Z = U.preUndos) != null ? Z : []), f.unshift(...(Q = U.preRedos) != null ? Q : []), p.unshift(...U.undos), z(f, t).result ? (o.pushUndoRedo({
3217
3229
  unitID: h,
3218
- undoMutations: C.reverse(),
3230
+ undoMutations: p.reverse(),
3219
3231
  redoMutations: f
3220
3232
  }), !0) : !1;
3221
3233
  }
@@ -3229,7 +3241,7 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3229
3241
  return await o.beforeCommandExecute({
3230
3242
  id: Qe.id,
3231
3243
  params: e
3232
- }) ? t.syncExecuteCommand(Cr.id, {
3244
+ }) ? t.syncExecuteCommand(pr.id, {
3233
3245
  range: s,
3234
3246
  direction: r,
3235
3247
  unitId: i,
@@ -3237,21 +3249,21 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3237
3249
  cellValue: u
3238
3250
  }) : !1;
3239
3251
  }
3240
- }, Cr = {
3252
+ }, pr = {
3241
3253
  type: v.COMMAND,
3242
3254
  id: "sheet.command.insert-row-by-range",
3243
3255
  handler: (n, e) => {
3244
- var T, U, k, x;
3245
- const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(F), i = P(s, e);
3256
+ var T, P, U, x;
3257
+ const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(F), i = k(s, e);
3246
3258
  if (!i) return !1;
3247
3259
  const { workbook: a, worksheet: u } = i, { range: l, direction: c, unitId: d, subUnitId: h, cellValue: m } = e, { startRow: g, endRow: f } = l;
3248
3260
  l.rangeType = L.ROW;
3249
- const C = c === ue.UP ? g : g - 1, p = u.getRowHeight(C), S = {
3261
+ const p = c === pe.UP ? g : g - 1, C = u.getRowHeight(p), S = {
3250
3262
  unitId: d,
3251
3263
  subUnitId: h,
3252
3264
  range: l,
3253
3265
  rowInfo: new Array(f - g + 1).fill(void 0).map(() => ({
3254
- h: p,
3266
+ h: C,
3255
3267
  hd: te.FALSE
3256
3268
  }))
3257
3269
  // row height should inherit from the anchor row
@@ -3260,7 +3272,7 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3260
3272
  S
3261
3273
  ), w = [{ id: je.id, params: S }], y = [{ id: Ge.id, params: I }];
3262
3274
  m && w.push({
3263
- id: Z.id,
3275
+ id: X.id,
3264
3276
  params: {
3265
3277
  unitId: d,
3266
3278
  subUnitId: h,
@@ -3271,7 +3283,7 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3271
3283
  id: Qe.id,
3272
3284
  params: e
3273
3285
  });
3274
- return w.unshift(...(T = b.preRedos) != null ? T : []), w.push(...(U = b.redos) != null ? U : []), w.push(Ze(l, a, u)), y.unshift(...(k = b.preUndos) != null ? k : []), y.push(...(x = b.undos) != null ? x : []), z(w, t).result ? (o.pushUndoRedo({
3286
+ return w.unshift(...(T = b.preRedos) != null ? T : []), w.push(...(P = b.redos) != null ? P : []), w.push(Ze(l, a, u)), y.unshift(...(U = b.preUndos) != null ? U : []), y.push(...(x = b.undos) != null ? x : []), z(w, t).result ? (o.pushUndoRedo({
3275
3287
  unitID: e.unitId,
3276
3288
  undoMutations: y,
3277
3289
  redoMutations: w
@@ -3288,12 +3300,12 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3288
3300
  o = t[0];
3289
3301
  else
3290
3302
  return !1;
3291
- const s = n.get(M), r = P(s);
3303
+ const s = n.get(M), r = k(s);
3292
3304
  if (!r) return !1;
3293
3305
  const { worksheet: i, subUnitId: a, unitId: u } = r, { startRow: l, endRow: c } = o, d = 0, h = i.getColumnCount() - 1, m = {
3294
3306
  unitId: u,
3295
3307
  subUnitId: a,
3296
- direction: ue.UP,
3308
+ direction: pe.UP,
3297
3309
  range: {
3298
3310
  startRow: l,
3299
3311
  endRow: c,
@@ -3310,18 +3322,18 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3310
3322
  id: "sheet.command.insert-row-after",
3311
3323
  handler: async (n) => {
3312
3324
  var f;
3313
- const t = (f = n.get(H).getCurrentSelections()) == null ? void 0 : f.map((C) => C.range);
3325
+ const t = (f = n.get(H).getCurrentSelections()) == null ? void 0 : f.map((p) => p.range);
3314
3326
  let o;
3315
3327
  if ((t == null ? void 0 : t.length) === 1)
3316
3328
  o = t[0];
3317
3329
  else
3318
3330
  return !1;
3319
- const s = n.get(M), r = P(s);
3331
+ const s = n.get(M), r = k(s);
3320
3332
  if (!r) return !1;
3321
3333
  const { worksheet: i, unitId: a, subUnitId: u } = r, l = o.endRow - o.startRow + 1, c = o.endRow + 1, d = o.endRow + l, h = 0, m = i.getColumnCount() - 1, g = {
3322
3334
  unitId: a,
3323
3335
  subUnitId: u,
3324
- direction: ue.DOWN,
3336
+ direction: pe.DOWN,
3325
3337
  range: {
3326
3338
  startRow: c,
3327
3339
  endRow: d,
@@ -3338,19 +3350,19 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3338
3350
  type: v.COMMAND,
3339
3351
  id: "sheet.command.insert-multi-rows-above",
3340
3352
  handler: async (n, e) => {
3341
- var p;
3342
- const o = (p = n.get(H).getCurrentSelections()) == null ? void 0 : p.map((S) => S.range);
3353
+ var C;
3354
+ const o = (C = n.get(H).getCurrentSelections()) == null ? void 0 : C.map((S) => S.range);
3343
3355
  let s;
3344
3356
  if ((o == null ? void 0 : o.length) === 1)
3345
3357
  s = o[0];
3346
3358
  else
3347
3359
  return !1;
3348
- const r = n.get(M), i = P(r);
3360
+ const r = n.get(M), i = k(r);
3349
3361
  if (!i) return !1;
3350
- const { worksheet: a, unitId: u, subUnitId: l } = i, c = e.value || 0, d = s.startRow, h = s.startRow + c - 1, m = 0, g = a.getColumnCount() - 1, f = lt(a, d, h, m, g, !0, d - 1), C = {
3362
+ const { worksheet: a, unitId: u, subUnitId: l } = i, c = e.value || 0, d = s.startRow, h = s.startRow + c - 1, m = 0, g = a.getColumnCount() - 1, f = lt(a, d, h, m, g, !0, d - 1), p = {
3351
3363
  unitId: u,
3352
3364
  subUnitId: l,
3353
- direction: ue.UP,
3365
+ direction: pe.UP,
3354
3366
  range: {
3355
3367
  startRow: d,
3356
3368
  endRow: h,
@@ -3361,25 +3373,25 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3361
3373
  // copy styles from the row above
3362
3374
  cellValue: f
3363
3375
  };
3364
- return n.get(E).executeCommand(Qe.id, C);
3376
+ return n.get(E).executeCommand(Qe.id, p);
3365
3377
  }
3366
3378
  }, mu = {
3367
3379
  type: v.COMMAND,
3368
3380
  id: "sheet.command.insert-multi-rows-after",
3369
3381
  handler: async (n, e) => {
3370
- var C;
3371
- const o = (C = n.get(H).getCurrentSelections()) == null ? void 0 : C.map((p) => p.range);
3382
+ var p;
3383
+ const o = (p = n.get(H).getCurrentSelections()) == null ? void 0 : p.map((C) => C.range);
3372
3384
  let s;
3373
3385
  if ((o == null ? void 0 : o.length) === 1)
3374
3386
  s = o[0];
3375
3387
  else
3376
3388
  return !1;
3377
- const r = n.get(M), i = P(r);
3389
+ const r = n.get(M), i = k(r);
3378
3390
  if (!i) return !1;
3379
3391
  const { worksheet: a, unitId: u, subUnitId: l } = i, c = e.value || 0, d = s.endRow + 1, h = s.endRow + c, m = 0, g = a.getColumnCount() - 1, f = {
3380
3392
  unitId: u,
3381
3393
  subUnitId: l,
3382
- direction: ue.DOWN,
3394
+ direction: pe.DOWN,
3383
3395
  range: {
3384
3396
  startRow: d,
3385
3397
  endRow: h,
@@ -3392,9 +3404,9 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3392
3404
  };
3393
3405
  return n.get(E).executeCommand(Qe.id, f);
3394
3406
  }
3395
- }, pr = "sheet.command.insert-col", et = {
3407
+ }, Cr = "sheet.command.insert-col", et = {
3396
3408
  type: v.COMMAND,
3397
- id: pr,
3409
+ id: Cr,
3398
3410
  handler: async (n, e) => {
3399
3411
  const t = n.get(E), o = n.get(F), { range: s, direction: r, subUnitId: i, unitId: a, cellValue: u } = e;
3400
3412
  return await o.beforeCommandExecute({
@@ -3412,23 +3424,23 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3412
3424
  type: v.COMMAND,
3413
3425
  id: "sheet.command.insert-col-by-range",
3414
3426
  handler: (n, e) => {
3415
- var D, T, U, k;
3427
+ var D, T, P, U;
3416
3428
  const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(F), { range: i, direction: a, subUnitId: u, unitId: l, cellValue: c } = e, { startColumn: d, endColumn: h } = e.range;
3417
3429
  i.rangeType = L.COLUMN;
3418
- const m = s.getUniverSheetInstance(e.unitId), g = m.getSheetBySheetId(e.subUnitId), f = a === ue.LEFT ? d : d - 1, C = g.getColumnWidth(f), p = {
3430
+ const m = s.getUniverSheetInstance(e.unitId), g = m.getSheetBySheetId(e.subUnitId), f = a === pe.LEFT ? d : d - 1, p = g.getColumnWidth(f), C = {
3419
3431
  unitId: l,
3420
3432
  subUnitId: u,
3421
3433
  range: i,
3422
3434
  colInfo: new Array(h - d + 1).fill(void 0).map(() => ({
3423
- w: C,
3435
+ w: p,
3424
3436
  hd: te.FALSE
3425
3437
  }))
3426
3438
  }, S = Bn(
3427
3439
  n,
3428
- p
3429
- ), I = [{ id: We.id, params: p }], w = [{ id: ye.id, params: S }];
3440
+ C
3441
+ ), I = [{ id: We.id, params: C }], w = [{ id: ye.id, params: S }];
3430
3442
  c && I.push({
3431
- id: Z.id,
3443
+ id: X.id,
3432
3444
  params: {
3433
3445
  unitId: l,
3434
3446
  subUnitId: u,
@@ -3439,7 +3451,7 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3439
3451
  id: et.id,
3440
3452
  params: e
3441
3453
  });
3442
- return I.unshift(...(D = y.preRedos) != null ? D : []), I.push(...(T = y.redos) != null ? T : []), I.push(Ze(i, m, g)), w.unshift(...(U = y.preUndos) != null ? U : []), w.push(...(k = y.undos) != null ? k : []), z(I, t).result ? (o.pushUndoRedo({
3454
+ return I.unshift(...(D = y.preRedos) != null ? D : []), I.push(...(T = y.redos) != null ? T : []), I.push(Ze(i, m, g)), w.unshift(...(P = y.preUndos) != null ? P : []), w.push(...(U = y.undos) != null ? U : []), z(I, t).result ? (o.pushUndoRedo({
3443
3455
  unitID: e.unitId,
3444
3456
  undoMutations: w.filter(Boolean),
3445
3457
  redoMutations: I.filter(Boolean)
@@ -3455,12 +3467,12 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3455
3467
  o = t[0].range;
3456
3468
  else
3457
3469
  return !1;
3458
- const s = n.get(M), r = P(s);
3470
+ const s = n.get(M), r = k(s);
3459
3471
  if (!r) return !1;
3460
3472
  const { worksheet: i, unitId: a, subUnitId: u } = r, { startColumn: l, endColumn: c } = o, d = 0, h = i.getRowCount() - 1, m = {
3461
3473
  unitId: a,
3462
3474
  subUnitId: u,
3463
- direction: ue.LEFT,
3475
+ direction: pe.LEFT,
3464
3476
  range: {
3465
3477
  startColumn: l,
3466
3478
  endColumn: c,
@@ -3483,12 +3495,12 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3483
3495
  o = t[0].range;
3484
3496
  else
3485
3497
  return !1;
3486
- const s = n.get(M), r = P(s);
3498
+ const s = n.get(M), r = k(s);
3487
3499
  if (!r) return !1;
3488
3500
  const { worksheet: i, unitId: a, subUnitId: u } = r, l = o.endColumn - o.startColumn + 1, c = o.endColumn + 1, d = o.endColumn + l, h = 0, m = i.getRowCount() - 1, g = {
3489
3501
  unitId: a,
3490
3502
  subUnitId: u,
3491
- direction: ue.RIGHT,
3503
+ direction: pe.RIGHT,
3492
3504
  range: {
3493
3505
  startColumn: c,
3494
3506
  endColumn: d,
@@ -3510,12 +3522,12 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3510
3522
  s = o[0].range;
3511
3523
  else
3512
3524
  return !1;
3513
- const r = n.get(M), i = P(r);
3525
+ const r = n.get(M), i = k(r);
3514
3526
  if (!i) return !1;
3515
3527
  const { worksheet: a, unitId: u, subUnitId: l } = i, c = e.value || 0, d = s.startColumn, h = s.startColumn + c - 1, m = 0, g = a.getRowCount() - 1, f = {
3516
3528
  unitId: u,
3517
3529
  subUnitId: l,
3518
- direction: ue.LEFT,
3530
+ direction: pe.LEFT,
3519
3531
  range: {
3520
3532
  startColumn: d,
3521
3533
  endColumn: h,
@@ -3528,7 +3540,7 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3528
3540
  };
3529
3541
  return n.get(E).executeCommand(et.id, f);
3530
3542
  }
3531
- }, Cu = {
3543
+ }, pu = {
3532
3544
  type: v.COMMAND,
3533
3545
  id: "sheet.command.insert-multi-cols-right",
3534
3546
  handler: async (n, e) => {
@@ -3538,12 +3550,12 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3538
3550
  s = o[0].range;
3539
3551
  else
3540
3552
  return !1;
3541
- const r = n.get(M), i = P(r);
3553
+ const r = n.get(M), i = k(r);
3542
3554
  if (!i) return !1;
3543
3555
  const { worksheet: a, unitId: u, subUnitId: l } = i, c = e.value || 0, d = s.endColumn + 1, h = s.endColumn + c, m = 0, g = a.getRowCount() - 1, f = {
3544
3556
  unitId: u,
3545
3557
  subUnitId: l,
3546
- direction: ue.RIGHT,
3558
+ direction: pe.RIGHT,
3547
3559
  range: {
3548
3560
  startColumn: d,
3549
3561
  endColumn: h,
@@ -3555,17 +3567,17 @@ const gr = "sheet.command.delete-range-move-left", Pt = {
3555
3567
  };
3556
3568
  return n.get(E).executeCommand(et.id, f);
3557
3569
  }
3558
- }, pu = {
3570
+ }, Cu = {
3559
3571
  id: "sheet.command.insert-sheet",
3560
3572
  type: v.COMMAND,
3561
3573
  handler: (n, e) => {
3562
- var C;
3574
+ var p;
3563
3575
  const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(Ye), i = Ia(s, { unitId: e == null ? void 0 : e.unitId });
3564
3576
  if (!i) return !1;
3565
3577
  const { unitId: a, workbook: u } = i;
3566
3578
  let l = u.getSheets().length;
3567
3579
  const c = e == null ? void 0 : e.sheet, d = c == null ? void 0 : c.id, h = gi(c || {});
3568
- e ? (l = (C = e.index) != null ? C : l, h.id = d || O.generateRandomId(), h.name = (c == null ? void 0 : c.name) || u.generateNewSheetName(`${r.t("sheets.tabs.sheet")}`)) : (h.id = O.generateRandomId(), h.name = u.generateNewSheetName(`${r.t("sheets.tabs.sheet")}`));
3580
+ e ? (l = (p = e.index) != null ? p : l, h.id = d || O.generateRandomId(), h.name = (c == null ? void 0 : c.name) || u.generateNewSheetName(`${r.t("sheets.tabs.sheet")}`)) : (h.id = O.generateRandomId(), h.name = u.generateNewSheetName(`${r.t("sheets.tabs.sheet")}`));
3569
3581
  const m = {
3570
3582
  index: l,
3571
3583
  sheet: h,
@@ -3664,65 +3676,65 @@ const wr = "sheet.command.move-rows", Kn = {
3664
3676
  type: v.COMMAND,
3665
3677
  // eslint-disable-next-line max-lines-per-function
3666
3678
  handler: (n, e) => {
3667
- var j, Q;
3679
+ var j, Z;
3668
3680
  const t = n.get(H), {
3669
3681
  fromRange: { startRow: o },
3670
3682
  toRange: { startRow: s },
3671
3683
  range: r
3672
3684
  } = e, i = r ? [vr(r)] : t.getCurrentSelections(), a = i == null ? void 0 : i.filter(
3673
- (Y) => Y.range.rangeType === L.ROW && Y.range.startRow <= o && o <= Y.range.endRow
3685
+ (Q) => Q.range.rangeType === L.ROW && Q.range.startRow <= o && o <= Q.range.endRow
3674
3686
  );
3675
3687
  if ((a == null ? void 0 : a.length) !== 1)
3676
3688
  return !1;
3677
- const u = n.get(F), l = n.get(M), c = P(l, e);
3689
+ const u = n.get(F), l = n.get(M), c = k(l, e);
3678
3690
  if (!c) return !1;
3679
- const { workbook: d, worksheet: h } = c, m = d.getUnitId(), g = h.getSheetId(), f = n.get(Ut), C = n.get(Ye), p = a[0].range, S = a[0].primary, I = jn(p, h, !1);
3680
- if (!N.equals(p, I))
3681
- return f.emit(C.t("sheets.info.partOfCell")), !1;
3691
+ const { workbook: d, worksheet: h } = c, m = d.getUnitId(), g = h.getSheetId(), f = n.get(Ut), p = n.get(Ye), C = a[0].range, S = a[0].primary, I = jn(C, h, !1);
3692
+ if (!N.equals(C, I))
3693
+ return f.emit(p.t("sheets.info.partOfCell")), !1;
3682
3694
  if (Iu(s, h))
3683
- return f.emit(C.t("sheets.info.acrossMergedCell")), !1;
3695
+ return f.emit(p.t("sheets.info.acrossMergedCell")), !1;
3684
3696
  const w = {
3685
- ...p,
3697
+ ...C,
3686
3698
  startRow: s,
3687
- endRow: s + p.endRow - p.startRow
3699
+ endRow: s + C.endRow - C.startRow
3688
3700
  }, y = {
3689
3701
  unitId: m,
3690
3702
  subUnitId: g,
3691
- sourceRange: p,
3703
+ sourceRange: C,
3692
3704
  targetRange: w
3693
- }, b = Su(n, y), D = n.get(E), T = u.onCommandExecute({ id: Kn.id, params: e }), U = [
3705
+ }, b = Su(n, y), D = n.get(E), T = u.onCommandExecute({ id: Kn.id, params: e }), P = [
3694
3706
  ...(j = T.preRedos) != null ? j : [],
3695
3707
  { id: it.id, params: y }
3696
- ], k = [
3697
- ...(Q = T.preUndos) != null ? Q : [],
3708
+ ], U = [
3709
+ ...(Z = T.preUndos) != null ? Z : [],
3698
3710
  { id: it.id, params: b }
3699
3711
  ];
3700
3712
  if (S) {
3701
- const ee = s - o < 0, Ce = p.endRow - p.startRow + 1, ie = ee ? w : {
3713
+ const ee = s - o < 0, se = C.endRow - C.startRow + 1, ae = ee ? w : {
3702
3714
  ...w,
3703
- startRow: w.startRow - Ce,
3704
- endRow: w.endRow - Ce
3715
+ startRow: w.startRow - se,
3716
+ endRow: w.endRow - se
3705
3717
  }, $e = {
3706
3718
  unitId: m,
3707
3719
  subUnitId: g,
3708
- type: pe.MOVE_END,
3720
+ type: Ce.MOVE_END,
3709
3721
  selections: [{
3710
- range: ie,
3711
- primary: Se(ie, h),
3722
+ range: ae,
3723
+ primary: Se(ae, h),
3712
3724
  style: null
3713
3725
  }]
3714
- }, pt = {
3726
+ }, Ct = {
3715
3727
  unitId: m,
3716
3728
  subUnitId: g,
3717
- type: pe.MOVE_END,
3718
- selections: [{ range: p, primary: S, style: null }]
3729
+ type: Ce.MOVE_END,
3730
+ selections: [{ range: C, primary: S, style: null }]
3719
3731
  };
3720
- U.push({ id: se.id, params: $e }), k.push({ id: se.id, params: pt });
3732
+ P.push({ id: re.id, params: $e }), U.push({ id: re.id, params: Ct });
3721
3733
  }
3722
- return U.push(...T.redos), k.push(...T.undos), z(U, D).result ? (n.get(V).pushUndoRedo({
3734
+ return P.push(...T.redos), U.push(...T.undos), z(P, D).result ? (n.get(V).pushUndoRedo({
3723
3735
  unitID: m,
3724
- undoMutations: k,
3725
- redoMutations: U
3736
+ undoMutations: U,
3737
+ redoMutations: P
3726
3738
  }), !0) : !1;
3727
3739
  }
3728
3740
  }, Ir = "sheet.command.move-cols", Jn = {
@@ -3730,61 +3742,61 @@ const wr = "sheet.command.move-rows", Kn = {
3730
3742
  type: v.COMMAND,
3731
3743
  // eslint-disable-next-line max-lines-per-function
3732
3744
  handler: (n, e) => {
3733
- var j, Q;
3745
+ var j, Z;
3734
3746
  const t = n.get(H), {
3735
3747
  fromRange: { startColumn: o },
3736
3748
  toRange: { startColumn: s },
3737
3749
  range: r
3738
3750
  } = e, i = r ? [vr(r)] : t.getCurrentSelections(), a = i == null ? void 0 : i.filter(
3739
- (Y) => Y.range.rangeType === L.COLUMN && Y.range.startColumn <= o && o <= Y.range.endColumn
3751
+ (Q) => Q.range.rangeType === L.COLUMN && Q.range.startColumn <= o && o <= Q.range.endColumn
3740
3752
  );
3741
3753
  if ((a == null ? void 0 : a.length) !== 1)
3742
3754
  return !1;
3743
- const u = n.get(F), l = n.get(M), c = P(l, e);
3755
+ const u = n.get(F), l = n.get(M), c = k(l, e);
3744
3756
  if (!c) return !1;
3745
- const { workbook: d, worksheet: h } = c, m = d.getUnitId(), g = h.getSheetId(), f = n.get(Ut), C = n.get(Ye), p = a[0].range, S = a[0].primary, I = jn(p, h, !1);
3746
- if (!N.equals(p, I))
3747
- return f.emit(C.t("sheets.info.partOfCell")), !1;
3757
+ const { workbook: d, worksheet: h } = c, m = d.getUnitId(), g = h.getSheetId(), f = n.get(Ut), p = n.get(Ye), C = a[0].range, S = a[0].primary, I = jn(C, h, !1);
3758
+ if (!N.equals(C, I))
3759
+ return f.emit(p.t("sheets.info.partOfCell")), !1;
3748
3760
  if (vu(s, h))
3749
- return f.emit(C.t("sheets.info.acrossMergedCell")), !1;
3761
+ return f.emit(p.t("sheets.info.acrossMergedCell")), !1;
3750
3762
  const w = {
3751
- ...p,
3763
+ ...C,
3752
3764
  startColumn: s,
3753
- endColumn: s + p.endColumn - p.startColumn
3765
+ endColumn: s + C.endColumn - C.startColumn
3754
3766
  }, y = {
3755
3767
  unitId: m,
3756
3768
  subUnitId: g,
3757
- sourceRange: p,
3769
+ sourceRange: C,
3758
3770
  targetRange: w
3759
- }, b = wu(n, y), D = n.get(E), T = u.onCommandExecute({ id: Jn.id, params: e }), U = [
3771
+ }, b = wu(n, y), D = n.get(E), T = u.onCommandExecute({ id: Jn.id, params: e }), P = [
3760
3772
  ...(j = T.preRedos) != null ? j : [],
3761
3773
  { id: at.id, params: y }
3762
- ], k = [
3763
- ...(Q = T.preUndos) != null ? Q : [],
3774
+ ], U = [
3775
+ ...(Z = T.preUndos) != null ? Z : [],
3764
3776
  { id: at.id, params: b }
3765
3777
  ];
3766
3778
  if (S) {
3767
- const Y = p.endColumn - p.startColumn + 1, ie = s - o < 0 ? w : {
3779
+ const Q = C.endColumn - C.startColumn + 1, ae = s - o < 0 ? w : {
3768
3780
  ...w,
3769
- startColumn: w.startColumn - Y,
3770
- endColumn: w.endColumn - Y
3781
+ startColumn: w.startColumn - Q,
3782
+ endColumn: w.endColumn - Q
3771
3783
  }, $e = {
3772
3784
  unitId: m,
3773
3785
  subUnitId: g,
3774
- type: pe.MOVE_END,
3775
- selections: [{ range: ie, primary: Se(ie, h), style: null }]
3776
- }, pt = {
3786
+ type: Ce.MOVE_END,
3787
+ selections: [{ range: ae, primary: Se(ae, h), style: null }]
3788
+ }, Ct = {
3777
3789
  unitId: m,
3778
3790
  subUnitId: g,
3779
- type: pe.MOVE_END,
3780
- selections: [{ range: p, primary: S, style: null }]
3791
+ type: Ce.MOVE_END,
3792
+ selections: [{ range: C, primary: S, style: null }]
3781
3793
  };
3782
- U.push({ id: se.id, params: $e }), k.push({ id: se.id, params: pt });
3794
+ P.push({ id: re.id, params: $e }), U.push({ id: re.id, params: Ct });
3783
3795
  }
3784
- return U.push(...T.redos), k.push(...T.undos), z(U, D).result && n.get(V).pushUndoRedo({
3796
+ return P.push(...T.redos), U.push(...T.undos), z(P, D).result && n.get(V).pushUndoRedo({
3785
3797
  unitID: m,
3786
- undoMutations: k,
3787
- redoMutations: U
3798
+ undoMutations: U,
3799
+ redoMutations: P
3788
3800
  }), !0;
3789
3801
  }
3790
3802
  };
@@ -3799,16 +3811,16 @@ const qt = {
3799
3811
  id: "sheet.mutation.register-worksheet-range-theme-style",
3800
3812
  type: v.MUTATION,
3801
3813
  handler: (n, e) => {
3802
- const { unitId: t, rangeThemeStyleJson: o, themeName: s } = e, r = n.get(M), i = P(r), a = n.get(Be);
3814
+ const { unitId: t, rangeThemeStyleJson: o, themeName: s } = e, r = n.get(M), i = k(r), a = n.get(Be);
3803
3815
  if (!i) return !1;
3804
- const u = new Ct(s, o);
3816
+ const u = new pt(s, o);
3805
3817
  return a.registerRangeThemeStyle(t, u), !0;
3806
3818
  }
3807
3819
  }, Po = {
3808
3820
  id: "sheet.mutation.unregister-worksheet-range-theme-style",
3809
3821
  type: v.MUTATION,
3810
3822
  handler: (n, e) => {
3811
- const { unitId: t, themeName: o } = e, s = n.get(M), r = P(s), i = n.get(Be);
3823
+ const { unitId: t, themeName: o } = e, s = n.get(M), r = k(s), i = n.get(Be);
3812
3824
  return r ? (i.unregisterRangeThemeStyle(t, o), !0) : !1;
3813
3825
  }
3814
3826
  }, Mu = {
@@ -3818,7 +3830,7 @@ const qt = {
3818
3830
  if (!e)
3819
3831
  return !1;
3820
3832
  const { unitId: t, rangeThemeStyle: o } = e, s = n.get(M), r = n.get(E), i = n.get(V);
3821
- if (!P(s)) return !1;
3833
+ if (!k(s)) return !1;
3822
3834
  const u = {
3823
3835
  unitId: t,
3824
3836
  themeName: o.getName(),
@@ -3863,12 +3875,12 @@ const qt = {
3863
3875
  handler: (n, e) => {
3864
3876
  if (!e)
3865
3877
  return !1;
3866
- const t = n.get(M), o = P(t, e);
3878
+ const t = n.get(M), o = k(t, e);
3867
3879
  if (!o) return !1;
3868
3880
  const { workbook: s, worksheet: r } = o, i = n.get(F), { range: a, unitId: u, subUnitId: l } = e, c = Fn([a], n, u, l).reverse(), d = [], h = [];
3869
3881
  c.forEach((f) => {
3870
- var D, T, U, k;
3871
- const C = [], p = [], S = {
3882
+ var D, T, P, U;
3883
+ const p = [], C = [], S = {
3872
3884
  unitId: u,
3873
3885
  subUnitId: l,
3874
3886
  range: f
@@ -3883,7 +3895,7 @@ const qt = {
3883
3895
  id: No,
3884
3896
  params: { range: f }
3885
3897
  });
3886
- p.push(...(D = b.preRedos) != null ? D : []), p.push({ id: Ge.id, params: S }), p.push(...(T = b.redos) != null ? T : []), C.push(...(U = b.preUndos) != null ? U : []), C.push({ id: je.id, params: I }), C.push({ id: Z.id, params: y }), C.push(...(k = b.undos) != null ? k : []), h.push(...p), d.unshift(...C);
3898
+ C.push(...(D = b.preRedos) != null ? D : []), C.push({ id: Ge.id, params: S }), C.push(...(T = b.redos) != null ? T : []), p.push(...(P = b.preUndos) != null ? P : []), p.push({ id: je.id, params: I }), p.push({ id: X.id, params: y }), p.push(...(U = b.undos) != null ? U : []), h.push(...C), d.unshift(...p);
3887
3899
  }), h.push(Ze(a, s, r));
3888
3900
  const m = n.get(E);
3889
3901
  return z(h, m).result ? (n.get(V).pushUndoRedo({
@@ -3900,7 +3912,7 @@ const qt = {
3900
3912
  const t = n.get(H), o = n.get(F), s = n.get(E);
3901
3913
  let r = e == null ? void 0 : e.range;
3902
3914
  if (r || (r = (h = t.getCurrentLastSelection()) == null ? void 0 : h.range), !r) return !1;
3903
- const i = n.get(M), a = P(i);
3915
+ const i = n.get(M), a = k(i);
3904
3916
  if (!a) return !1;
3905
3917
  const { worksheet: u, subUnitId: l, unitId: c } = a;
3906
3918
  return r = {
@@ -3920,10 +3932,10 @@ const qt = {
3920
3932
  type: v.COMMAND,
3921
3933
  id: "sheet.command.remove-col-by-range",
3922
3934
  handler: (n, e) => {
3923
- var p, S, I;
3935
+ var C, S, I;
3924
3936
  if (!e)
3925
3937
  return !1;
3926
- const t = n.get(M), o = P(t, e);
3938
+ const t = n.get(M), o = k(t, e);
3927
3939
  if (!o) return !1;
3928
3940
  const { workbook: s, worksheet: r } = o, i = n.get(F), { range: a, unitId: u, subUnitId: l } = e, c = {
3929
3941
  unitId: u,
@@ -3939,7 +3951,7 @@ const qt = {
3939
3951
  }), f = n.get(E);
3940
3952
  return z(
3941
3953
  [
3942
- ...(p = g.preRedos) != null ? p : [],
3954
+ ...(C = g.preRedos) != null ? C : [],
3943
3955
  { id: ye.id, params: c },
3944
3956
  ...g.redos,
3945
3957
  Ze(a, s, r)
@@ -3950,7 +3962,7 @@ const qt = {
3950
3962
  undoMutations: [
3951
3963
  ...(S = g.preUndos) != null ? S : [],
3952
3964
  { id: We.id, params: d },
3953
- { id: Z.id, params: m },
3965
+ { id: X.id, params: m },
3954
3966
  ...g.undos
3955
3967
  ],
3956
3968
  redoMutations: [
@@ -3968,7 +3980,7 @@ const qt = {
3968
3980
  const t = n.get(H), o = n.get(F), s = n.get(E);
3969
3981
  let r = e == null ? void 0 : e.range;
3970
3982
  if (r || (r = (h = t.getCurrentLastSelection()) == null ? void 0 : h.range), !r) return !1;
3971
- const i = n.get(M), a = P(i);
3983
+ const i = n.get(M), a = k(i);
3972
3984
  if (!a) return !1;
3973
3985
  const { worksheet: u, subUnitId: l, unitId: c } = a;
3974
3986
  return r = {
@@ -3988,8 +4000,8 @@ const qt = {
3988
4000
  id: "sheet.command.remove-sheet",
3989
4001
  type: v.COMMAND,
3990
4002
  handler: (n, e) => {
3991
- var p, S;
3992
- const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(F), i = P(s, e);
4003
+ var C, S;
4004
+ const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(F), i = k(s, e);
3993
4005
  if (!i) return !1;
3994
4006
  const { unitId: a, subUnitId: u, workbook: l, worksheet: c } = i;
3995
4007
  if (l.getSheets().length <= 1) return !1;
@@ -4003,7 +4015,7 @@ const qt = {
4003
4015
  ), m = r.onCommandExecute({
4004
4016
  id: Do.id,
4005
4017
  params: { unitId: a, subUnitId: u }
4006
- }), g = [...(p = m.preRedos) != null ? p : [], { id: Tt.id, params: d }, ...m.redos], f = [...(S = m.preUndos) != null ? S : [], { id: Yt.id, params: h }, ...m.undos];
4018
+ }), g = [...(C = m.preRedos) != null ? C : [], { id: Tt.id, params: d }, ...m.redos], f = [...(S = m.preUndos) != null ? S : [], { id: Yt.id, params: h }, ...m.undos];
4007
4019
  return z(g, t).result ? (o.pushUndoRedo({
4008
4020
  unitID: a,
4009
4021
  undoMutations: f,
@@ -4075,20 +4087,20 @@ const qt = {
4075
4087
  var x;
4076
4088
  const t = n.get(H), o = n.get(E), s = n.get(V), r = n.get(M), i = (e == null ? void 0 : e.ranges) || ((x = t.getCurrentSelections()) == null ? void 0 : x.map((j) => j.range));
4077
4089
  if (!(i != null && i.length)) return !1;
4078
- const a = P(r);
4090
+ const a = k(r);
4079
4091
  if (!a) return !1;
4080
4092
  const { subUnitId: u, unitId: l, worksheet: c } = a, d = {
4081
4093
  unitId: l,
4082
4094
  subUnitId: u,
4083
4095
  ranges: i
4084
- }, m = c.getConfig().mergeData.filter((j) => i.some((Q) => N.intersects(Q, j)));
4096
+ }, m = c.getConfig().mergeData.filter((j) => i.some((Z) => N.intersects(Z, j)));
4085
4097
  if (!m.length) return !1;
4086
4098
  const g = we(
4087
4099
  n,
4088
4100
  d
4089
4101
  ), f = t.getCurrentSelections();
4090
4102
  if (!(f != null && f.length)) return !1;
4091
- const C = O.deepClone(f), p = O.deepClone(f), S = p[p.length - 1], { startRow: I, startColumn: w } = S.range;
4103
+ const p = O.deepClone(f), C = O.deepClone(f), S = C[C.length - 1], { startRow: I, startColumn: w } = S.range;
4092
4104
  S.primary = {
4093
4105
  startRow: I,
4094
4106
  startColumn: w,
@@ -4109,16 +4121,16 @@ const qt = {
4109
4121
  cellValue: y.undoParams.getMatrix()
4110
4122
  }, T = [
4111
4123
  { id: oe.id, params: g },
4112
- { id: Z.id, params: b },
4113
- { id: se.id, params: { selections: p } }
4114
- ], U = [
4124
+ { id: X.id, params: b },
4125
+ { id: re.id, params: { selections: C } }
4126
+ ], P = [
4115
4127
  { id: ne.id, params: g },
4116
- { id: Z.id, params: D },
4117
- { id: se.id, params: { selections: C } }
4128
+ { id: X.id, params: D },
4129
+ { id: re.id, params: { selections: p } }
4118
4130
  ];
4119
4131
  return z(T, o) ? (s.pushUndoRedo({
4120
4132
  unitID: l,
4121
- undoMutations: U,
4133
+ undoMutations: P,
4122
4134
  redoMutations: T
4123
4135
  }), !0) : !1;
4124
4136
  }
@@ -4167,7 +4179,7 @@ const bu = (n) => {
4167
4179
  id: br,
4168
4180
  type: v.COMMAND,
4169
4181
  handler: (n, e) => {
4170
- var f, C;
4182
+ var f, p;
4171
4183
  const { subUnitId: t, unitId: o, range: s, order: r } = e, i = n.get(E), a = {
4172
4184
  id: vn.id,
4173
4185
  params: {
@@ -4184,7 +4196,7 @@ const bu = (n) => {
4184
4196
  a,
4185
4197
  ...c.redos
4186
4198
  ], h = [
4187
- ...(C = c.preUndos) != null ? C : [],
4199
+ ...(p = c.preUndos) != null ? p : [],
4188
4200
  u,
4189
4201
  ...c.undos
4190
4202
  ], m = z(d, i), g = l.afterCommandExecute({ id: ho.id, params: e });
@@ -4314,20 +4326,20 @@ const Ao = (n, e, t, o) => {
4314
4326
  };
4315
4327
  };
4316
4328
  function Uu(n, e, t) {
4317
- const { style: o, color: s, type: r } = n.getBorderInfo(), i = r === le.TOP || r === le.ALL || r === le.OUTSIDE, a = r === le.LEFT || r === le.ALL || r === le.OUTSIDE, u = r === le.BOTTOM || r === le.ALL || r === le.OUTSIDE, l = r === le.RIGHT || r === le.ALL || r === le.OUTSIDE, c = r === le.VERTICAL || r === le.ALL || r === le.INSIDE, d = r === le.HORIZONTAL || r === le.ALL || r === le.INSIDE, h = r.indexOf("tlbr") > -1, m = r.indexOf("tlbc") > -1, g = r.indexOf("tlmr") > -1, f = r.indexOf("bltr") > -1, C = r.indexOf("mltr") > -1, p = r.indexOf("bctr") > -1, S = t[0], {
4329
+ const { style: o, color: s, type: r } = n.getBorderInfo(), i = r === le.TOP || r === le.ALL || r === le.OUTSIDE, a = r === le.LEFT || r === le.ALL || r === le.OUTSIDE, u = r === le.BOTTOM || r === le.ALL || r === le.OUTSIDE, l = r === le.RIGHT || r === le.ALL || r === le.OUTSIDE, c = r === le.VERTICAL || r === le.ALL || r === le.INSIDE, d = r === le.HORIZONTAL || r === le.ALL || r === le.INSIDE, h = r.indexOf("tlbr") > -1, m = r.indexOf("tlbc") > -1, g = r.indexOf("tlmr") > -1, f = r.indexOf("bltr") > -1, p = r.indexOf("mltr") > -1, C = r.indexOf("bctr") > -1, S = t[0], {
4318
4330
  topRangeOut: I,
4319
4331
  leftRangeOut: w,
4320
4332
  bottomRangeOut: y,
4321
4333
  rightRangeOut: b,
4322
4334
  topRange: D,
4323
4335
  leftRange: T,
4324
- bottomRange: U,
4325
- rightRange: k
4326
- } = Eu(S), x = new G(), { worksheet: j, unitId: Q, subUnitId: Y } = e;
4336
+ bottomRange: P,
4337
+ rightRange: U
4338
+ } = Eu(S), x = new G(), { worksheet: j, unitId: Z, subUnitId: Q } = e;
4327
4339
  return {
4328
4340
  worksheet: j,
4329
- unitId: Q,
4330
- subUnitId: Y,
4341
+ unitId: Z,
4342
+ subUnitId: Q,
4331
4343
  style: o,
4332
4344
  color: s,
4333
4345
  type: r,
@@ -4341,16 +4353,16 @@ function Uu(n, e, t) {
4341
4353
  tl_bc: m,
4342
4354
  tl_mr: g,
4343
4355
  bl_tr: f,
4344
- ml_tr: C,
4345
- bc_tr: p,
4356
+ ml_tr: p,
4357
+ bc_tr: C,
4346
4358
  topRangeOut: I,
4347
4359
  leftRangeOut: w,
4348
4360
  bottomRangeOut: y,
4349
4361
  rightRangeOut: b,
4350
4362
  topRange: D,
4351
4363
  leftRange: T,
4352
- bottomRange: U,
4353
- rightRange: k,
4364
+ bottomRange: P,
4365
+ rightRange: U,
4354
4366
  range: S,
4355
4367
  mr: x,
4356
4368
  borderStyle: {
@@ -4428,93 +4440,93 @@ function Tu(n) {
4428
4440
  t && u(n.range, { tl_br: O.deepClone(e) }, !0), o && u(n.range, { tl_bc: O.deepClone(e) }, !0), s && u(n.range, { tl_mr: O.deepClone(e) }, !0), r && u(n.range, { bl_tr: O.deepClone(e) }, !0), i && u(n.range, { ml_tr: O.deepClone(e) }, !0), a && u(n.range, { bc_tr: O.deepClone(e) }, !0);
4429
4441
  }
4430
4442
  const Pu = (n) => {
4431
- const { top: e, left: t, right: o, bottom: s, borderStyle: r, bottomRange: i, topRange: a, leftRange: u, rightRange: l, bottomRangeOut: c, topRangeOut: d, leftRangeOut: h, rightRangeOut: m } = n, g = (f, C, p) => {
4432
- Ao(n, f, C, p);
4443
+ const { top: e, left: t, right: o, bottom: s, borderStyle: r, bottomRange: i, topRange: a, leftRange: u, rightRange: l, bottomRangeOut: c, topRangeOut: d, leftRangeOut: h, rightRangeOut: m } = n, g = (f, p, C) => {
4444
+ Ao(n, f, p, C);
4433
4445
  };
4434
4446
  e && (g(d, { b: null }), g(a, { t: O.deepClone(r) }, !0)), s && (g(c, { t: null }), g(i, { b: O.deepClone(r) }, !0)), t && (g(h, { r: null }), g(u, { l: O.deepClone(r) }, !0)), o && (g(m, { l: null }), g(l, { r: O.deepClone(r) }, !0));
4435
4447
  }, Nu = (n) => {
4436
- const { range: e, worksheet: t, mr: o, top: s, bottom: r, left: i, right: a, vertical: u, horizontal: l, tl_br: c, tl_bc: d, tl_mr: h, bl_tr: m, ml_tr: g, bc_tr: f, topRange: C, bottomRange: p, leftRange: S, rightRange: I, topRangeOut: w, bottomRangeOut: y, leftRangeOut: b, rightRangeOut: D } = n, T = (U, k, x) => {
4437
- Ao(n, U, k, x);
4448
+ const { range: e, worksheet: t, mr: o, top: s, bottom: r, left: i, right: a, vertical: u, horizontal: l, tl_br: c, tl_bc: d, tl_mr: h, bl_tr: m, ml_tr: g, bc_tr: f, topRange: p, bottomRange: C, leftRange: S, rightRange: I, topRangeOut: w, bottomRangeOut: y, leftRangeOut: b, rightRangeOut: D } = n, T = (P, U, x) => {
4449
+ Ao(n, P, U, x);
4438
4450
  };
4439
- !s && !r && !i && !a && !u && !l && !c && !d && !h && !m && !g && !f && (Mn(e, (U, k) => {
4440
- var j, Q, Y, ee, Ce, ie, $e, pt;
4441
- const x = t.getMergedCell(U, k);
4451
+ !s && !r && !i && !a && !u && !l && !c && !d && !h && !m && !g && !f && (Mn(e, (P, U) => {
4452
+ var j, Z, Q, ee, se, ae, $e, Ct;
4453
+ const x = t.getMergedCell(P, U);
4442
4454
  if (x) {
4443
4455
  if (x.endColumn !== e.endColumn) {
4444
- const q = (j = o.getValue(x.startRow, x.startColumn)) == null ? void 0 : j.s;
4445
- o.setValue(U, k, {
4456
+ const Y = (j = o.getValue(x.startRow, x.startColumn)) == null ? void 0 : j.s;
4457
+ o.setValue(P, U, {
4446
4458
  s: {
4447
- bd: q != null && q.bd ? Object.assign(q.bd, { r: null }) : { r: null }
4459
+ bd: Y != null && Y.bd ? Object.assign(Y.bd, { r: null }) : { r: null }
4448
4460
  }
4449
4461
  });
4450
4462
  }
4451
4463
  if (x.startColumn !== e.startColumn) {
4452
- const q = (Q = o.getValue(x.startRow, x.startColumn)) == null ? void 0 : Q.s;
4453
- o.setValue(U, k, {
4464
+ const Y = (Z = o.getValue(x.startRow, x.startColumn)) == null ? void 0 : Z.s;
4465
+ o.setValue(P, U, {
4454
4466
  s: {
4455
- bd: q != null && q.bd ? Object.assign(q.bd, { l: null }) : { l: null }
4467
+ bd: Y != null && Y.bd ? Object.assign(Y.bd, { l: null }) : { l: null }
4456
4468
  }
4457
4469
  });
4458
4470
  }
4459
4471
  if (x.endRow !== e.endRow) {
4460
- const q = (Y = o.getValue(x.startRow, x.startColumn)) == null ? void 0 : Y.s;
4461
- o.setValue(U, k, {
4472
+ const Y = (Q = o.getValue(x.startRow, x.startColumn)) == null ? void 0 : Q.s;
4473
+ o.setValue(P, U, {
4462
4474
  s: {
4463
- bd: q != null && q.bd ? Object.assign(q.bd, { b: null }) : { b: null }
4475
+ bd: Y != null && Y.bd ? Object.assign(Y.bd, { b: null }) : { b: null }
4464
4476
  }
4465
4477
  });
4466
4478
  }
4467
4479
  if (x.startRow !== e.startRow) {
4468
- const q = (ee = o.getValue(x.startRow, x.startColumn)) == null ? void 0 : ee.s;
4469
- o.setValue(U, k, {
4480
+ const Y = (ee = o.getValue(x.startRow, x.startColumn)) == null ? void 0 : ee.s;
4481
+ o.setValue(P, U, {
4470
4482
  s: {
4471
- bd: q != null && q.bd ? Object.assign(q.bd, { t: null }) : { t: null }
4483
+ bd: Y != null && Y.bd ? Object.assign(Y.bd, { t: null }) : { t: null }
4472
4484
  }
4473
4485
  });
4474
4486
  }
4475
4487
  } else {
4476
- if (k !== e.endColumn) {
4477
- const q = (Ce = o.getValue(U, k)) == null ? void 0 : Ce.s;
4478
- o.setValue(U, k, {
4488
+ if (U !== e.endColumn) {
4489
+ const Y = (se = o.getValue(P, U)) == null ? void 0 : se.s;
4490
+ o.setValue(P, U, {
4479
4491
  s: {
4480
- bd: q != null && q.bd ? Object.assign(q.bd, { r: null }) : { r: null }
4492
+ bd: Y != null && Y.bd ? Object.assign(Y.bd, { r: null }) : { r: null }
4481
4493
  }
4482
4494
  });
4483
4495
  }
4484
- if (k !== e.startColumn) {
4485
- const q = (ie = o.getValue(U, k)) == null ? void 0 : ie.s;
4486
- o.setValue(U, k, {
4496
+ if (U !== e.startColumn) {
4497
+ const Y = (ae = o.getValue(P, U)) == null ? void 0 : ae.s;
4498
+ o.setValue(P, U, {
4487
4499
  s: {
4488
- bd: q != null && q.bd ? Object.assign(q.bd, { l: null }) : { l: null }
4500
+ bd: Y != null && Y.bd ? Object.assign(Y.bd, { l: null }) : { l: null }
4489
4501
  }
4490
4502
  });
4491
4503
  }
4492
- if (U !== e.endRow) {
4493
- const q = ($e = o.getValue(U, k)) == null ? void 0 : $e.s;
4494
- o.setValue(U, k, {
4504
+ if (P !== e.endRow) {
4505
+ const Y = ($e = o.getValue(P, U)) == null ? void 0 : $e.s;
4506
+ o.setValue(P, U, {
4495
4507
  s: {
4496
- bd: q != null && q.bd ? Object.assign(q.bd, { b: null }) : { b: null }
4508
+ bd: Y != null && Y.bd ? Object.assign(Y.bd, { b: null }) : { b: null }
4497
4509
  }
4498
4510
  });
4499
4511
  }
4500
- if (U !== e.startRow) {
4501
- const q = (pt = o.getValue(U, k)) == null ? void 0 : pt.s;
4502
- o.setValue(U, k, {
4512
+ if (P !== e.startRow) {
4513
+ const Y = (Ct = o.getValue(P, U)) == null ? void 0 : Ct.s;
4514
+ o.setValue(P, U, {
4503
4515
  s: {
4504
- bd: q != null && q.bd ? Object.assign(q.bd, { t: null }) : { t: null }
4516
+ bd: Y != null && Y.bd ? Object.assign(Y.bd, { t: null }) : { t: null }
4505
4517
  }
4506
4518
  });
4507
4519
  }
4508
4520
  }
4509
- }), T(w, { b: null }), T(C, { t: null }, !0), T(y, { t: null }), T(p, { b: null }, !0), T(b, { r: null }), T(S, { l: null }, !0), T(D, { l: null }), T(I, { r: null }, !0), T(e, { tl_br: null }, !0), T(e, { tl_bc: null }, !0), T(e, { tl_mr: null }, !0), T(e, { bl_tr: null }, !0), T(e, { ml_tr: null }, !0), T(e, { bc_tr: null }, !0));
4521
+ }), T(w, { b: null }), T(p, { t: null }, !0), T(y, { t: null }), T(C, { b: null }, !0), T(b, { r: null }), T(S, { l: null }, !0), T(D, { l: null }), T(I, { r: null }, !0), T(e, { tl_br: null }, !0), T(e, { tl_bc: null }, !0), T(e, { tl_mr: null }, !0), T(e, { bl_tr: null }, !0), T(e, { ml_tr: null }, !0), T(e, { bc_tr: null }, !0));
4510
4522
  }, an = {
4511
4523
  id: "sheet.command.set-border",
4512
4524
  type: v.COMMAND,
4513
4525
  handler: (n, e) => {
4514
- var p;
4515
- const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(H), i = n.get(Ot), a = P(s, e);
4526
+ var C;
4527
+ const t = n.get(E), o = n.get(V), s = n.get(M), r = n.get(H), i = n.get(Ot), a = k(s, e);
4516
4528
  if (!a) return !1;
4517
- const u = (e == null ? void 0 : e.ranges) || ((p = r.getCurrentSelections()) == null ? void 0 : p.map((S) => S.range));
4529
+ const u = (e == null ? void 0 : e.ranges) || ((C = r.getCurrentSelections()) == null ? void 0 : C.map((S) => S.range));
4518
4530
  if (!(u != null && u.length))
4519
4531
  return !1;
4520
4532
  const { activeBorderType: l } = i.getBorderInfo();
@@ -4529,10 +4541,10 @@ const Pu = (n) => {
4529
4541
  n,
4530
4542
  g
4531
4543
  );
4532
- return t.syncExecuteCommand(Z.id, g) ? (o.pushUndoRedo({
4544
+ return t.syncExecuteCommand(X.id, g) ? (o.pushUndoRedo({
4533
4545
  unitID: d,
4534
- undoMutations: [{ id: Z.id, params: f }],
4535
- redoMutations: [{ id: Z.id, params: g }]
4546
+ undoMutations: [{ id: X.id, params: f }],
4547
+ redoMutations: [{ id: X.id, params: g }]
4536
4548
  }), !0) : !1;
4537
4549
  }
4538
4550
  }, Ou = {
@@ -4602,7 +4614,7 @@ const Vu = (n, e) => {
4602
4614
  id: "sheet.mutation.set-col-data",
4603
4615
  type: v.MUTATION,
4604
4616
  handler: (n, e) => {
4605
- const { columnData: t } = e, o = n.get(M), s = P(o, e);
4617
+ const { columnData: t } = e, o = n.get(M), s = k(o, e);
4606
4618
  if (!s) return !1;
4607
4619
  const { worksheet: r } = s, i = r.getColumnManager();
4608
4620
  for (const a in t) {
@@ -4620,7 +4632,7 @@ const Vu = (n, e) => {
4620
4632
  type: v.COMMAND,
4621
4633
  id: "sheet.command.set-col-data",
4622
4634
  handler: (n, e) => {
4623
- const t = n.get(E), o = n.get(V), s = n.get(M), r = P(s, e);
4635
+ const t = n.get(E), o = n.get(V), s = n.get(M), r = k(s, e);
4624
4636
  if (!r) return !1;
4625
4637
  const { columnData: i } = e, { unitId: a, subUnitId: u, worksheet: l } = r, c = {
4626
4638
  subUnitId: u,
@@ -4687,8 +4699,8 @@ const Vu = (n, e) => {
4687
4699
  type: v.COMMAND,
4688
4700
  id: "sheet.command.set-col-visible-on-cols",
4689
4701
  handler: (n, e) => {
4690
- var p, S;
4691
- const { unitId: t, subUnitId: o, ranges: s } = e, r = n.get(F), i = n.get(E), a = n.get(M), u = P(a, { unitId: t, subUnitId: o });
4702
+ var C, S;
4703
+ const { unitId: t, subUnitId: o, ranges: s } = e, r = n.get(F), i = n.get(E), a = n.get(M), u = k(a, { unitId: t, subUnitId: o });
4692
4704
  if (!u) return !1;
4693
4705
  const { worksheet: l } = u, c = {
4694
4706
  unitId: t,
@@ -4709,22 +4721,22 @@ const Vu = (n, e) => {
4709
4721
  }))
4710
4722
  }, g = z([
4711
4723
  { id: Zt.id, params: c },
4712
- { id: se.id, params: d }
4724
+ { id: re.id, params: d }
4713
4725
  ], i), f = r.onCommandExecute({
4714
4726
  id: Xn.id,
4715
4727
  params: e
4716
- }), C = z([...f.redos], i);
4717
- return g.result && C.result && n.get(V).pushUndoRedo({
4728
+ }), p = z([...f.redos], i);
4729
+ return g.result && p.result && n.get(V).pushUndoRedo({
4718
4730
  unitID: t,
4719
4731
  undoMutations: [
4720
4732
  { id: Xt.id, params: h },
4721
- { id: se.id, params: m },
4722
- ...(p = f.undos) != null ? p : []
4733
+ { id: re.id, params: m },
4734
+ ...(C = f.undos) != null ? C : []
4723
4735
  ],
4724
4736
  redoMutations: [
4725
4737
  ...(S = f.preRedos) != null ? S : [],
4726
4738
  { id: Zt.id, params: c },
4727
- { id: se.id, params: d },
4739
+ { id: re.id, params: d },
4728
4740
  ...f.redos
4729
4741
  ]
4730
4742
  }), !0;
@@ -4736,7 +4748,7 @@ const Vu = (n, e) => {
4736
4748
  var l;
4737
4749
  const e = n.get(H), t = n.get(E), o = (l = e.getCurrentSelections()) == null ? void 0 : l.map((c) => c.range).filter((c) => c.rangeType === L.COLUMN);
4738
4750
  if (!(o != null && o.length)) return !1;
4739
- const s = P(n.get(M));
4751
+ const s = k(n.get(M));
4740
4752
  if (!s) return !1;
4741
4753
  const { worksheet: r, unitId: i, subUnitId: a } = s, u = o.map((c) => r.getHiddenCols(c.startColumn, c.endColumn)).flat();
4742
4754
  return t.executeCommand(Xn.id, {
@@ -4753,7 +4765,7 @@ const Vu = (n, e) => {
4753
4765
  const t = n.get(H), o = n.get(F), s = n.get(M), r = n.get(E);
4754
4766
  let i = (S = e == null ? void 0 : e.ranges) != null && S.length ? e.ranges : (I = t.getCurrentSelections()) == null ? void 0 : I.map((b) => b.range).filter((b) => b.rangeType === L.COLUMN);
4755
4767
  if (!(i != null && i.length)) return !1;
4756
- const a = P(s, e);
4768
+ const a = k(s, e);
4757
4769
  if (!a) return !1;
4758
4770
  const { worksheet: u, unitId: l, subUnitId: c } = a;
4759
4771
  i = Fu(a.worksheet, i);
@@ -4776,23 +4788,23 @@ const Vu = (n, e) => {
4776
4788
  }))
4777
4789
  }, f = z([
4778
4790
  { id: Xt.id, params: d },
4779
- { id: se.id, params: h }
4780
- ], r), C = o.onCommandExecute({
4791
+ { id: re.id, params: h }
4792
+ ], r), p = o.onCommandExecute({
4781
4793
  id: Ur.id,
4782
4794
  params: d
4783
- }), p = z([...C.redos], r);
4784
- return f.result && p.result ? (n.get(V).pushUndoRedo({
4795
+ }), C = z([...p.redos], r);
4796
+ return f.result && C.result ? (n.get(V).pushUndoRedo({
4785
4797
  unitID: l,
4786
4798
  undoMutations: [
4787
4799
  { id: Zt.id, params: m },
4788
- { id: se.id, params: g },
4789
- ...(w = C.undos) != null ? w : []
4800
+ { id: re.id, params: g },
4801
+ ...(w = p.undos) != null ? w : []
4790
4802
  ],
4791
4803
  redoMutations: [
4792
- ...(y = C.preRedos) != null ? y : [],
4804
+ ...(y = p.preRedos) != null ? y : [],
4793
4805
  { id: Xt.id, params: d },
4794
- { id: se.id, params: h },
4795
- ...C.redos
4806
+ { id: re.id, params: h },
4807
+ ...p.redos
4796
4808
  ]
4797
4809
  }), !0) : !1;
4798
4810
  }
@@ -4886,7 +4898,7 @@ const Tr = {
4886
4898
  type: v.COMMAND,
4887
4899
  id: "sheet.command.set-frozen",
4888
4900
  handler: (n, e) => {
4889
- const t = n.get(E), o = n.get(V), s = n.get(M), r = P(s, { unitId: e.unitId, subUnitId: e.subUnitId });
4901
+ const t = n.get(E), o = n.get(V), s = n.get(M), r = k(s, { unitId: e.unitId, subUnitId: e.subUnitId });
4890
4902
  if (!r) return !1;
4891
4903
  const { unitId: i, subUnitId: a, worksheet: u } = r, { startColumn: l, startRow: c, xSplit: d, ySplit: h } = e;
4892
4904
  if (c >= u.getRowCount() || l >= u.getColumnCount() || d >= u.getColumnCount() || h >= u.getRowCount())
@@ -4906,7 +4918,7 @@ const Tr = {
4906
4918
  type: v.COMMAND,
4907
4919
  id: "sheet.command.cancel-frozen",
4908
4920
  handler: (n, e) => {
4909
- const t = n.get(E), o = n.get(M), s = n.get(V), r = P(o, { unitId: e == null ? void 0 : e.unitId, subUnitId: e == null ? void 0 : e.subUnitId });
4921
+ const t = n.get(E), o = n.get(M), s = n.get(V), r = k(o, { unitId: e == null ? void 0 : e.unitId, subUnitId: e == null ? void 0 : e.subUnitId });
4910
4922
  if (!r) return !1;
4911
4923
  const { unitId: i, subUnitId: a } = r, u = {
4912
4924
  unitId: i,
@@ -4926,7 +4938,7 @@ const Tr = {
4926
4938
  id: "sheet.mutation.set-gridlines-color",
4927
4939
  type: v.MUTATION,
4928
4940
  handler: (n, e) => {
4929
- const t = P(n.get(M), e);
4941
+ const t = k(n.get(M), e);
4930
4942
  if (!t) return !1;
4931
4943
  const { worksheet: o } = t, s = o.getConfig();
4932
4944
  return s.gridlinesColor = e.color, !0;
@@ -4935,7 +4947,7 @@ const Tr = {
4935
4947
  type: v.COMMAND,
4936
4948
  id: "sheet.command.set-gridlines-color",
4937
4949
  handler: (n, e) => {
4938
- const t = n.get(E), o = n.get(V), s = n.get(M), r = P(s);
4950
+ const t = n.get(E), o = n.get(V), s = n.get(M), r = k(s);
4939
4951
  if (!r) return !1;
4940
4952
  const { worksheet: i } = r, a = i.getConfig().gridlinesColor;
4941
4953
  if (a === (e == null ? void 0 : e.color)) return !1;
@@ -5005,7 +5017,7 @@ const Tr = {
5005
5017
  id: "sheet.mutation.set-row-data",
5006
5018
  type: v.MUTATION,
5007
5019
  handler: (n, e) => {
5008
- const { rowData: t } = e, o = n.get(M), s = P(o, e);
5020
+ const { rowData: t } = e, o = n.get(M), s = k(o, e);
5009
5021
  if (!s) return !1;
5010
5022
  const { worksheet: r } = s, i = r.getRowManager();
5011
5023
  for (const a in t) {
@@ -5023,7 +5035,7 @@ const Tr = {
5023
5035
  type: v.COMMAND,
5024
5036
  id: "sheet.command.set-row-data",
5025
5037
  handler: (n, e) => {
5026
- const t = n.get(E), o = n.get(V), s = n.get(M), r = P(s, e);
5038
+ const t = n.get(E), o = n.get(V), s = n.get(M), r = k(s, e);
5027
5039
  if (!r) return !1;
5028
5040
  const { rowData: i } = e, { unitId: a, subUnitId: u, worksheet: l } = r, c = {
5029
5041
  subUnitId: u,
@@ -5090,8 +5102,8 @@ const Tr = {
5090
5102
  type: v.COMMAND,
5091
5103
  id: "sheet.command.set-specific-rows-visible",
5092
5104
  handler: (n, e) => {
5093
- var p, S, I;
5094
- const { unitId: t, subUnitId: o, ranges: s } = e, r = n.get(E), i = n.get(V), a = n.get(F), u = P(n.get(M), { unitId: t, subUnitId: o });
5105
+ var C, S, I;
5106
+ const { unitId: t, subUnitId: o, ranges: s } = e, r = n.get(E), i = n.get(V), a = n.get(F), u = k(n.get(M), { unitId: t, subUnitId: o });
5095
5107
  if (!u) return !1;
5096
5108
  const { worksheet: l } = u, c = { unitId: t, subUnitId: o, ranges: s }, d = {
5097
5109
  unitId: t,
@@ -5113,25 +5125,25 @@ const Tr = {
5113
5125
  }, g = z(
5114
5126
  [
5115
5127
  { id: Qt.id, params: c },
5116
- { id: se.id, params: d }
5128
+ { id: re.id, params: d }
5117
5129
  ],
5118
5130
  r
5119
5131
  ), f = a.onCommandExecute({
5120
5132
  id: Zn.id,
5121
5133
  params: e
5122
- }), C = z([...f.redos], r);
5123
- return g.result && C.result && i.pushUndoRedo({
5134
+ }), p = z([...f.redos], r);
5135
+ return g.result && p.result && i.pushUndoRedo({
5124
5136
  unitID: t,
5125
5137
  undoMutations: [
5126
- ...(p = f.preUndos) != null ? p : [],
5138
+ ...(C = f.preUndos) != null ? C : [],
5127
5139
  { id: en.id, params: h },
5128
- { id: se.id, params: m },
5140
+ { id: re.id, params: m },
5129
5141
  ...(S = f.undos) != null ? S : []
5130
5142
  ],
5131
5143
  redoMutations: [
5132
5144
  ...(I = f.preRedos) != null ? I : [],
5133
5145
  { id: Qt.id, params: c },
5134
- { id: se.id, params: d },
5146
+ { id: re.id, params: d },
5135
5147
  ...f.redos
5136
5148
  ]
5137
5149
  }), !0;
@@ -5143,7 +5155,7 @@ const Tr = {
5143
5155
  var c;
5144
5156
  const e = n.get(H), t = n.get(M), o = n.get(E), s = (c = e.getCurrentSelections()) == null ? void 0 : c.map((d) => d.range).filter((d) => d.rangeType === L.ROW);
5145
5157
  if (!(s != null && s.length)) return !1;
5146
- const r = P(t);
5158
+ const r = k(t);
5147
5159
  if (!r) return !1;
5148
5160
  const { worksheet: i, unitId: a, subUnitId: u } = r, l = s.map((d) => i.getHiddenRows(d.startRow, d.endRow)).flat();
5149
5161
  return o.executeCommand(Zn.id, {
@@ -5160,7 +5172,7 @@ const Tr = {
5160
5172
  const t = n.get(H), o = n.get(E), s = n.get(V), r = n.get(M), i = n.get(F);
5161
5173
  let a = (S = e == null ? void 0 : e.ranges) != null && S.length ? e.ranges : (I = t.getCurrentSelections()) == null ? void 0 : I.map((T) => T.range).filter((T) => T.rangeType === L.ROW);
5162
5174
  if (!(a != null && a.length)) return !1;
5163
- const u = P(r, e);
5175
+ const u = k(r, e);
5164
5176
  if (!u) return !1;
5165
5177
  a = Qu(u.worksheet, a);
5166
5178
  const { unitId: l, subUnitId: c, worksheet: d } = u, h = { unitId: l, subUnitId: c, ranges: a }, m = {
@@ -5180,25 +5192,25 @@ const Tr = {
5180
5192
  primary: Se(T, d),
5181
5193
  style: null
5182
5194
  }))
5183
- }, C = i.onCommandExecute({ id: Or.id, params: h });
5195
+ }, p = i.onCommandExecute({ id: Or.id, params: h });
5184
5196
  return z([
5185
- ...(w = C.preRedos) != null ? w : [],
5197
+ ...(w = p.preRedos) != null ? w : [],
5186
5198
  { id: en.id, params: h },
5187
- { id: se.id, params: m },
5188
- ...C.redos
5199
+ { id: re.id, params: m },
5200
+ ...p.redos
5189
5201
  ], o).result && s.pushUndoRedo({
5190
5202
  unitID: l,
5191
5203
  undoMutations: [
5192
- ...(y = C.preUndos) != null ? y : [],
5204
+ ...(y = p.preUndos) != null ? y : [],
5193
5205
  { id: Qt.id, params: g },
5194
- { id: se.id, params: f },
5195
- ...(b = C.undos) != null ? b : []
5206
+ { id: re.id, params: f },
5207
+ ...(b = p.undos) != null ? b : []
5196
5208
  ],
5197
5209
  redoMutations: [
5198
- ...(D = C.preRedos) != null ? D : [],
5210
+ ...(D = p.preRedos) != null ? D : [],
5199
5211
  { id: en.id, params: h },
5200
- { id: se.id, params: m },
5201
- ...C.redos
5212
+ { id: re.id, params: m },
5213
+ ...p.redos
5202
5214
  ]
5203
5215
  }), !0;
5204
5216
  }
@@ -5242,7 +5254,7 @@ const Re = {
5242
5254
  id: "sheet.command.set-style",
5243
5255
  handler: (n, e) => {
5244
5256
  var y;
5245
- const t = n.get(M), o = P(t, e);
5257
+ const t = n.get(M), o = k(t, e);
5246
5258
  if (!o) return !1;
5247
5259
  const { unitId: s, subUnitId: r, worksheet: i } = o, { range: a, style: u } = e, l = n.get(E), c = n.get(V), d = n.get(H), h = a ? [a] : (y = d.getCurrentSelections()) == null ? void 0 : y.map((b) => b.range);
5248
5260
  if (!(h != null && h.length))
@@ -5250,10 +5262,10 @@ const Re = {
5250
5262
  const m = new G(), g = Ya(i);
5251
5263
  if (O.isArray(u.value))
5252
5264
  for (let b = 0; b < h.length; b++)
5253
- g.forOperableEach(h[b], (D, T, U) => {
5265
+ g.forOperableEach(h[b], (D, T, P) => {
5254
5266
  m.setValue(D, T, {
5255
5267
  s: {
5256
- [u.type]: u.value[D - U.startRow][T - U.startColumn]
5268
+ [u.type]: u.value[D - P.startRow][T - P.startColumn]
5257
5269
  }
5258
5270
  });
5259
5271
  });
@@ -5264,26 +5276,26 @@ const Re = {
5264
5276
  [u.type]: u.value
5265
5277
  }
5266
5278
  };
5267
- g.forOperableEach(h[b], (T, U) => m.setValue(T, U, D));
5279
+ g.forOperableEach(h[b], (T, P) => m.setValue(T, P, D));
5268
5280
  }
5269
5281
  const f = {
5270
5282
  subUnitId: r,
5271
5283
  unitId: s,
5272
5284
  cellValue: m.getMatrix()
5273
- }, C = be(
5285
+ }, p = be(
5274
5286
  n,
5275
5287
  f
5276
- ), p = l.syncExecuteCommand(
5277
- Z.id,
5288
+ ), C = l.syncExecuteCommand(
5289
+ X.id,
5278
5290
  f
5279
5291
  ), { undos: S, redos: I } = n.get(F).onCommandExecute({
5280
5292
  id: Re.id,
5281
5293
  params: e
5282
5294
  }), w = z([...I], l);
5283
- return p && w.result ? (c.pushUndoRedo({
5295
+ return C && w.result ? (c.pushUndoRedo({
5284
5296
  unitID: f.unitId,
5285
- undoMutations: [{ id: Z.id, params: C }, ...S],
5286
- redoMutations: [{ id: Z.id, params: f }, ...I]
5297
+ undoMutations: [{ id: X.id, params: p }, ...S],
5298
+ redoMutations: [{ id: X.id, params: f }, ...I]
5287
5299
  }), !0) : !1;
5288
5300
  }
5289
5301
  }, jd = {
@@ -5292,7 +5304,7 @@ const Re = {
5292
5304
  handler: (n) => {
5293
5305
  const e = n.get(H).getCurrentLastSelection();
5294
5306
  if (!e) return !1;
5295
- const t = P(n.get(M));
5307
+ const t = k(n.get(M));
5296
5308
  if (!t) return !1;
5297
5309
  const { worksheet: o } = t, { actualRow: s, actualColumn: r } = e.primary, a = {
5298
5310
  style: {
@@ -5308,7 +5320,7 @@ const Re = {
5308
5320
  handler: (n) => {
5309
5321
  const e = n.get(H).getCurrentLastSelection();
5310
5322
  if (!e) return !1;
5311
- const t = P(n.get(M));
5323
+ const t = k(n.get(M));
5312
5324
  if (!t) return !1;
5313
5325
  const { worksheet: o } = t;
5314
5326
  let s = !0;
@@ -5330,7 +5342,7 @@ const Re = {
5330
5342
  handler: (n) => {
5331
5343
  const e = n.get(H).getCurrentLastSelection();
5332
5344
  if (!e) return !1;
5333
- const t = P(n.get(M));
5345
+ const t = k(n.get(M));
5334
5346
  if (!t) return !1;
5335
5347
  const { worksheet: o } = t;
5336
5348
  let s = !0;
@@ -5351,7 +5363,7 @@ const Re = {
5351
5363
  handler: (n) => {
5352
5364
  const e = n.get(H).getCurrentLastSelection();
5353
5365
  if (!e) return !1;
5354
- const t = P(n.get(M));
5366
+ const t = k(n.get(M));
5355
5367
  if (!t) return !1;
5356
5368
  const { worksheet: o } = t;
5357
5369
  let s = !0;
@@ -5370,7 +5382,7 @@ const Re = {
5370
5382
  handler: (n) => {
5371
5383
  const e = n.get(H).getCurrentLastSelection();
5372
5384
  if (!e) return !1;
5373
- const t = P(n.get(M));
5385
+ const t = k(n.get(M));
5374
5386
  if (!t) return !1;
5375
5387
  const { worksheet: o } = t;
5376
5388
  let s = !0;
@@ -5562,7 +5574,7 @@ const Re = {
5562
5574
  type: v.COMMAND,
5563
5575
  id: "sheet.command.set-tab-color",
5564
5576
  handler: (n, e) => {
5565
- const t = n.get(E), o = n.get(V), s = P(n.get(M));
5577
+ const t = n.get(E), o = n.get(V), s = k(n.get(M));
5566
5578
  if (!s) return !1;
5567
5579
  const { unitId: r, subUnitId: i } = s, a = {
5568
5580
  color: e.value,
@@ -5617,7 +5629,7 @@ const Re = {
5617
5629
  type: v.COMMAND,
5618
5630
  id: "sheet.command.set-worksheet-activate",
5619
5631
  handler: (n, e, t) => {
5620
- const o = n.get(E), s = P(n.get(M), e);
5632
+ const o = n.get(E), s = k(n.get(M), e);
5621
5633
  if (!s) return !1;
5622
5634
  const { unitId: r, subUnitId: i } = s;
5623
5635
  return new Promise((a) => {
@@ -5650,7 +5662,7 @@ const Re = {
5650
5662
  type: v.MUTATION,
5651
5663
  handler: (n, e) => {
5652
5664
  var u;
5653
- const t = n.get(M), o = P(t, e);
5665
+ const t = n.get(M), o = k(t, e);
5654
5666
  if (!o) return !1;
5655
5667
  const { worksheet: s } = o, r = s.getConfig().defaultColumnWidth, i = s.getColumnManager(), a = e.ranges;
5656
5668
  for (let l = 0; l < a.length; l++) {
@@ -5671,29 +5683,29 @@ const Re = {
5671
5683
  const o = n.get(H).getCurrentSelections();
5672
5684
  if (!(o != null && o.length))
5673
5685
  return !1;
5674
- const s = n.get(E), r = n.get(V), i = P(n.get(M));
5686
+ const s = n.get(E), r = n.get(V), i = k(n.get(M));
5675
5687
  if (!i) return !1;
5676
- const { worksheet: a, unitId: u, subUnitId: l } = i, { anchorCol: c, deltaX: d } = e, m = a.getColumnWidth(c) + d, g = o.length === 1 && o[0].range.rangeType === L.ALL, f = o.filter((D) => D.range.rangeType === L.COLUMN), C = g ? L.ALL : f.some(({ range: D }) => {
5677
- const { startColumn: T, endColumn: U } = D;
5678
- return T <= c && c <= U;
5688
+ const { worksheet: a, unitId: u, subUnitId: l } = i, { anchorCol: c, deltaX: d } = e, m = a.getColumnWidth(c) + d, g = o.length === 1 && o[0].range.rangeType === L.ALL, f = o.filter((D) => D.range.rangeType === L.COLUMN), p = g ? L.ALL : f.some(({ range: D }) => {
5689
+ const { startColumn: T, endColumn: P } = D;
5690
+ return T <= c && c <= P;
5679
5691
  }) ? L.COLUMN : L.NORMAL;
5680
- let p;
5681
- if (C === L.ALL) {
5692
+ let C;
5693
+ if (p === L.ALL) {
5682
5694
  const D = a.getRowCount(), T = new Array(a.getColumnCount()).fill(void 0).map(
5683
- (U, k) => ({ startRow: 0, endRow: D - 1, startColumn: k, endColumn: k })
5695
+ (P, U) => ({ startRow: 0, endRow: D - 1, startColumn: U, endColumn: U })
5684
5696
  );
5685
- p = {
5697
+ C = {
5686
5698
  subUnitId: l,
5687
5699
  unitId: u,
5688
5700
  colWidth: m,
5689
5701
  ranges: T
5690
5702
  };
5691
- } else C === L.COLUMN ? p = {
5703
+ } else p === L.COLUMN ? C = {
5692
5704
  subUnitId: l,
5693
5705
  unitId: u,
5694
5706
  ranges: f.map((D) => N.clone(D.range)),
5695
5707
  colWidth: m
5696
- } : p = {
5708
+ } : C = {
5697
5709
  subUnitId: l,
5698
5710
  unitId: u,
5699
5711
  colWidth: m,
@@ -5708,18 +5720,18 @@ const Re = {
5708
5720
  };
5709
5721
  const { undos: S, redos: I } = n.get(F).onCommandExecute({
5710
5722
  id: xo.id,
5711
- params: p
5723
+ params: C
5712
5724
  }), w = $r(
5713
- p,
5725
+ C,
5714
5726
  a
5715
5727
  ), y = s.syncExecuteCommand(
5716
5728
  st.id,
5717
- p
5729
+ C
5718
5730
  ), b = z([...I], s);
5719
5731
  return y && b.result && r.pushUndoRedo({
5720
5732
  unitID: u,
5721
5733
  undoMutations: [{ id: st.id, params: w }, ...S],
5722
- redoMutations: [{ id: st.id, params: p }, ...I]
5734
+ redoMutations: [{ id: st.id, params: C }, ...I]
5723
5735
  }), !0;
5724
5736
  }
5725
5737
  }, _n = {
@@ -5729,7 +5741,7 @@ const Re = {
5729
5741
  var S, I, w, y;
5730
5742
  const t = n.get(H), o = n.get(E), s = n.get(V), r = n.get(F), i = (S = e == null ? void 0 : e.ranges) != null && S.length ? e.ranges : (I = t.getCurrentSelections()) == null ? void 0 : I.map((b) => b.range);
5731
5743
  if (!(i != null && i.length)) return !1;
5732
- const a = P(n.get(M), e);
5744
+ const a = k(n.get(M), e);
5733
5745
  if (!a) return !1;
5734
5746
  const { subUnitId: u, unitId: l, worksheet: c } = a, d = {
5735
5747
  subUnitId: u,
@@ -5739,14 +5751,14 @@ const Re = {
5739
5751
  }, h = $r(d, c), m = o.syncExecuteCommand(st.id, d), { undos: g, redos: f } = n.get(F).onCommandExecute({
5740
5752
  id: _n.id,
5741
5753
  params: d
5742
- }), C = r.onCommandExecute({
5754
+ }), p = r.onCommandExecute({
5743
5755
  id: _n.id,
5744
5756
  params: d
5745
- }), p = z([...f, ...C.redos], o);
5746
- return m && p.result ? (s.pushUndoRedo({
5757
+ }), C = z([...f, ...p.redos], o);
5758
+ return m && C.result ? (s.pushUndoRedo({
5747
5759
  unitID: l,
5748
- undoMutations: [...(w = C.preUndos) != null ? w : [], { id: st.id, params: h }, ...g],
5749
- redoMutations: [...(y = C.preRedos) != null ? y : [], { id: st.id, params: d }, ...f]
5760
+ undoMutations: [...(w = p.preUndos) != null ? w : [], { id: st.id, params: h }, ...g],
5761
+ redoMutations: [...(y = p.preRedos) != null ? y : [], { id: st.id, params: d }, ...f]
5750
5762
  }), !0) : !1;
5751
5763
  }
5752
5764
  };
@@ -5755,7 +5767,7 @@ const Ft = {
5755
5767
  id: "sheet.mutation.set-worksheet-default-style",
5756
5768
  type: v.MUTATION,
5757
5769
  handler: (n, e) => {
5758
- const { defaultStyle: t } = e, o = n.get(M), s = P(o);
5770
+ const { defaultStyle: t } = e, o = n.get(M), s = k(o);
5759
5771
  if (!s) return !1;
5760
5772
  const { worksheet: r } = s;
5761
5773
  return r ? (r.setDefaultCellStyle(t), !0) : !1;
@@ -5805,7 +5817,7 @@ const Ft = {
5805
5817
  type: v.COMMAND,
5806
5818
  id: "sheet.command.set-worksheet-hidden",
5807
5819
  handler: (n, e) => {
5808
- const t = n.get(E), o = n.get(V), s = n.get(Ut), r = n.get(Ye), i = P(n.get(M), e);
5820
+ const t = n.get(E), o = n.get(V), s = n.get(Ut), r = n.get(Ye), i = k(n.get(M), e);
5809
5821
  if (!i) return !1;
5810
5822
  const { workbook: a, worksheet: u, unitId: l, subUnitId: c } = i;
5811
5823
  if (u.getConfig().hidden === te.TRUE) return !1;
@@ -5814,7 +5826,7 @@ const Ft = {
5814
5826
  subUnitId: c,
5815
5827
  hidden: te.TRUE
5816
5828
  }, m = Vr(n, h);
5817
- return a.getSheets().filter((p) => p.getConfig().hidden === te.FALSE).length === 1 ? (s.emit(r.t("sheets.info.hideSheet")), !1) : t.syncExecuteCommand(mt.id, h) ? (o.pushUndoRedo({
5829
+ return a.getSheets().filter((C) => C.getConfig().hidden === te.FALSE).length === 1 ? (s.emit(r.t("sheets.info.hideSheet")), !1) : t.syncExecuteCommand(mt.id, h) ? (o.pushUndoRedo({
5818
5830
  unitID: l,
5819
5831
  undoMutations: [{ id: mt.id, params: m }],
5820
5832
  redoMutations: [{ id: mt.id, params: h }]
@@ -5845,7 +5857,7 @@ const Ft = {
5845
5857
  id: "sheet.command.set-worksheet-name",
5846
5858
  handler: (n, e) => {
5847
5859
  var g, f;
5848
- const t = n.get(E), o = n.get(V), s = n.get(F), r = P(n.get(M), e);
5860
+ const t = n.get(E), o = n.get(V), s = n.get(F), r = k(n.get(M), e);
5849
5861
  if (!r) return !1;
5850
5862
  const { unitId: i, subUnitId: a } = r, u = {
5851
5863
  subUnitId: a,
@@ -5876,7 +5888,7 @@ const Ft = {
5876
5888
  ...O.deepClone(e),
5877
5889
  toOrder: e.fromOrder,
5878
5890
  fromOrder: e.toOrder
5879
- }), Cn = {
5891
+ }), pn = {
5880
5892
  id: "sheet.mutation.set-worksheet-order",
5881
5893
  type: v.MUTATION,
5882
5894
  handler: (n, e) => {
@@ -5889,7 +5901,7 @@ const Ft = {
5889
5901
  type: v.COMMAND,
5890
5902
  id: "sheet.command.set-worksheet-order",
5891
5903
  handler: (n, e) => {
5892
- const t = n.get(E), o = n.get(V), s = P(n.get(M), e);
5904
+ const t = n.get(E), o = n.get(V), s = k(n.get(M), e);
5893
5905
  if (!s) return !1;
5894
5906
  const { workbook: r, unitId: i, subUnitId: a } = s, l = {
5895
5907
  fromOrder: r.getConfig().sheetOrder.indexOf(a),
@@ -5897,10 +5909,10 @@ const Ft = {
5897
5909
  unitId: i,
5898
5910
  subUnitId: a
5899
5911
  }, c = Rl(n, l);
5900
- return t.syncExecuteCommand(Cn.id, l) ? (o.pushUndoRedo({
5912
+ return t.syncExecuteCommand(pn.id, l) ? (o.pushUndoRedo({
5901
5913
  unitID: i,
5902
- undoMutations: [{ id: Cn.id, params: c }],
5903
- redoMutations: [{ id: Cn.id, params: l }]
5914
+ undoMutations: [{ id: pn.id, params: c }],
5915
+ redoMutations: [{ id: pn.id, params: l }]
5904
5916
  }), !0) : !1;
5905
5917
  }
5906
5918
  };
@@ -6007,7 +6019,7 @@ const ve = () => [yo, Ne, Br, Hr], ct = [_.Edit, _.View, _.ManageCollaborator, _
6007
6019
  Zs,
6008
6020
  Ys,
6009
6021
  Fs
6010
- ], Cl = [
6022
+ ], pl = [
6011
6023
  _.Edit,
6012
6024
  _.Print,
6013
6025
  _.Comment,
@@ -6062,8 +6074,8 @@ const ve = () => [yo, Ne, Br, Hr], ct = [_.Edit, _.View, _.ManageCollaborator, _
6062
6074
  _.SetRowStyle,
6063
6075
  _.Sort
6064
6076
  ];
6065
- var pl = Object.getOwnPropertyDescriptor, Sl = (n, e, t, o) => {
6066
- for (var s = o > 1 ? void 0 : o ? pl(e, t) : e, r = n.length - 1, i; r >= 0; r--)
6077
+ var Cl = Object.getOwnPropertyDescriptor, Sl = (n, e, t, o) => {
6078
+ for (var s = o > 1 ? void 0 : o ? Cl(e, t) : e, r = n.length - 1, i; r >= 0; r--)
6067
6079
  (i = n[r]) && (s = i(s) || s);
6068
6080
  return s;
6069
6081
  }, tt = (n, e) => (t, o) => e(t, o, n);
@@ -6304,7 +6316,7 @@ const $o = {
6304
6316
  type: v.MUTATION,
6305
6317
  handler: (n, e) => {
6306
6318
  var l;
6307
- const { ranges: t, rowHeight: o } = e, s = n.get(M), r = P(s, e);
6319
+ const { ranges: t, rowHeight: o } = e, s = n.get(M), r = k(s, e);
6308
6320
  if (!r) return !1;
6309
6321
  const { worksheet: i } = r, a = i.getRowManager(), u = i.getConfig().defaultRowHeight;
6310
6322
  for (const { startRow: c, endRow: d } of t)
@@ -6319,7 +6331,7 @@ const $o = {
6319
6331
  type: v.MUTATION,
6320
6332
  handler: (n, e) => {
6321
6333
  var a;
6322
- const { ranges: t, autoHeightInfo: o } = e, s = n.get(M), r = P(s, e);
6334
+ const { ranges: t, autoHeightInfo: o } = e, s = n.get(M), r = k(s, e);
6323
6335
  if (!r) return !1;
6324
6336
  const i = r.worksheet.getRowManager();
6325
6337
  for (const { startRow: u, endRow: l } of t)
@@ -6333,7 +6345,7 @@ const $o = {
6333
6345
  id: "sheet.mutation.set-worksheet-row-auto-height",
6334
6346
  type: v.MUTATION,
6335
6347
  handler: (n, e) => {
6336
- const { rowsAutoHeightInfo: t } = e, o = n.get(M), s = P(o, e);
6348
+ const { rowsAutoHeightInfo: t } = e, o = n.get(M), s = k(o, e);
6337
6349
  if (!s) return !1;
6338
6350
  const r = s.worksheet.getRowManager();
6339
6351
  for (const { row: i, autoHeight: a } of t) {
@@ -6347,33 +6359,33 @@ const $o = {
6347
6359
  id: "sheet.command.delta-row-height",
6348
6360
  // eslint-disable-next-line max-lines-per-function
6349
6361
  handler: async (n, e) => {
6350
- var U, k;
6362
+ var P, U;
6351
6363
  const o = n.get(H).getCurrentSelections(), s = n.get(F);
6352
6364
  if (!(o != null && o.length))
6353
6365
  return !1;
6354
- const r = P(n.get(M));
6366
+ const r = k(n.get(M));
6355
6367
  if (!r) return !1;
6356
6368
  const { worksheet: i, subUnitId: a, unitId: u } = r, { anchorRow: l, deltaY: c } = e, h = i.getRowHeight(l) + c, m = o.length === 1 && o[0].range.rangeType === L.ALL, g = o.filter((x) => x.range.rangeType === L.ROW), f = m ? L.ALL : g.some(({ range: x }) => {
6357
- const { startRow: j, endRow: Q } = x;
6358
- return j <= l && l <= Q;
6369
+ const { startRow: j, endRow: Z } = x;
6370
+ return j <= l && l <= Z;
6359
6371
  }) ? L.ROW : L.NORMAL;
6360
- let C;
6372
+ let p;
6361
6373
  if (f === L.ALL) {
6362
6374
  const x = i.getColumnCount(), j = new Array(i.getRowCount()).fill(void 0).map(
6363
- (Q, Y) => ({ startRow: Y, endRow: Y, startColumn: 0, endColumn: x - 1 })
6375
+ (Z, Q) => ({ startRow: Q, endRow: Q, startColumn: 0, endColumn: x - 1 })
6364
6376
  );
6365
- C = {
6377
+ p = {
6366
6378
  subUnitId: a,
6367
6379
  unitId: u,
6368
6380
  rowHeight: h,
6369
6381
  ranges: j
6370
6382
  };
6371
- } else f === L.ROW ? C = {
6383
+ } else f === L.ROW ? p = {
6372
6384
  subUnitId: a,
6373
6385
  unitId: u,
6374
6386
  ranges: g.map((x) => N.clone(x.range)),
6375
6387
  rowHeight: h
6376
- } : C = {
6388
+ } : p = {
6377
6389
  subUnitId: a,
6378
6390
  unitId: u,
6379
6391
  rowHeight: h,
@@ -6386,18 +6398,18 @@ const $o = {
6386
6398
  }
6387
6399
  ]
6388
6400
  };
6389
- const p = Fr(C, i), S = {
6401
+ const C = Fr(p, i), S = {
6390
6402
  unitId: u,
6391
6403
  subUnitId: a,
6392
- ranges: C.ranges,
6404
+ ranges: p.ranges,
6393
6405
  autoHeightInfo: te.FALSE
6394
6406
  }, I = Vo(S, i), w = n.get(E), y = n.get(V), b = s.onCommandExecute({
6395
6407
  id: Lo.id,
6396
- params: C
6408
+ params: p
6397
6409
  }), D = z([
6398
6410
  {
6399
6411
  id: rt.id,
6400
- params: C
6412
+ params: p
6401
6413
  },
6402
6414
  {
6403
6415
  id: xe.id,
@@ -6407,10 +6419,10 @@ const $o = {
6407
6419
  return D.result && T.result ? (y.pushUndoRedo({
6408
6420
  unitID: u,
6409
6421
  undoMutations: [
6410
- ...(U = b.preUndos) != null ? U : [],
6422
+ ...(P = b.preUndos) != null ? P : [],
6411
6423
  {
6412
6424
  id: rt.id,
6413
- params: p
6425
+ params: C
6414
6426
  },
6415
6427
  {
6416
6428
  id: xe.id,
@@ -6419,10 +6431,10 @@ const $o = {
6419
6431
  ...b.undos
6420
6432
  ],
6421
6433
  redoMutations: [
6422
- ...(k = b.preRedos) != null ? k : [],
6434
+ ...(U = b.preRedos) != null ? U : [],
6423
6435
  {
6424
6436
  id: rt.id,
6425
- params: C
6437
+ params: p
6426
6438
  },
6427
6439
  {
6428
6440
  id: xe.id,
@@ -6441,7 +6453,7 @@ const $o = {
6441
6453
  const t = n.get(H), o = n.get(E), s = n.get(V), r = n.get(M), i = n.get(F), a = (I = e == null ? void 0 : e.ranges) != null && I.length ? e.ranges : (w = t.getCurrentSelections()) == null ? void 0 : w.map((D) => D.range);
6442
6454
  if (!(a != null && a.length))
6443
6455
  return !1;
6444
- const u = P(r, e);
6456
+ const u = k(r, e);
6445
6457
  if (!u) return !1;
6446
6458
  const { unitId: l, subUnitId: c, worksheet: d } = u, h = {
6447
6459
  subUnitId: c,
@@ -6453,7 +6465,7 @@ const $o = {
6453
6465
  subUnitId: c,
6454
6466
  ranges: h.ranges,
6455
6467
  autoHeightInfo: te.FALSE
6456
- }, f = Vo(g, d), C = z([
6468
+ }, f = Vo(g, d), p = z([
6457
6469
  {
6458
6470
  id: rt.id,
6459
6471
  params: h
@@ -6462,14 +6474,14 @@ const $o = {
6462
6474
  id: xe.id,
6463
6475
  params: g
6464
6476
  }
6465
- ], o), p = i.onCommandExecute({
6477
+ ], o), C = i.onCommandExecute({
6466
6478
  id: Ho.id,
6467
6479
  params: h
6468
- }), S = z([...p.redos], o);
6469
- return C.result && S.result ? (s.pushUndoRedo({
6480
+ }), S = z([...C.redos], o);
6481
+ return p.result && S.result ? (s.pushUndoRedo({
6470
6482
  unitID: l,
6471
6483
  undoMutations: [
6472
- ...(y = p.preRedos) != null ? y : [],
6484
+ ...(y = C.preRedos) != null ? y : [],
6473
6485
  {
6474
6486
  id: rt.id,
6475
6487
  params: m
@@ -6478,10 +6490,10 @@ const $o = {
6478
6490
  id: xe.id,
6479
6491
  params: f
6480
6492
  },
6481
- ...p.undos
6493
+ ...C.undos
6482
6494
  ],
6483
6495
  redoMutations: [
6484
- ...(b = p.preRedos) != null ? b : [],
6496
+ ...(b = C.preRedos) != null ? b : [],
6485
6497
  {
6486
6498
  id: rt.id,
6487
6499
  params: h
@@ -6490,7 +6502,7 @@ const $o = {
6490
6502
  id: xe.id,
6491
6503
  params: g
6492
6504
  },
6493
- ...p.redos
6505
+ ...C.redos
6494
6506
  ]
6495
6507
  }), !0) : !1;
6496
6508
  }
@@ -6498,10 +6510,10 @@ const $o = {
6498
6510
  type: v.COMMAND,
6499
6511
  id: "sheet.command.set-row-is-auto-height",
6500
6512
  handler: (n, e) => {
6501
- var p, S;
6502
- const t = n.get(E), o = n.get(V), s = n.get(H), r = n.get(M), i = P(r, e);
6513
+ var C, S;
6514
+ const t = n.get(E), o = n.get(V), s = n.get(H), r = n.get(M), i = k(r, e);
6503
6515
  if (!i) return !1;
6504
- const { unitId: a, subUnitId: u, worksheet: l } = i, c = (p = e == null ? void 0 : e.ranges) != null && p.length ? e.ranges : (S = s.getCurrentSelections()) == null ? void 0 : S.map((I) => I.range);
6516
+ const { unitId: a, subUnitId: u, worksheet: l } = i, c = (C = e == null ? void 0 : e.ranges) != null && C.length ? e.ranges : (S = s.getCurrentSelections()) == null ? void 0 : S.map((I) => I.range);
6505
6517
  if (!(c != null && c.length))
6506
6518
  return !1;
6507
6519
  const d = {
@@ -6516,8 +6528,8 @@ const $o = {
6516
6528
  ), { undos: g, redos: f } = n.get(F).onCommandExecute({
6517
6529
  id: Bo.id,
6518
6530
  params: d
6519
- }), C = z([...f], t);
6520
- return m && C.result ? (o.pushUndoRedo({
6531
+ }), p = z([...f], t);
6532
+ return m && p.result ? (o.pushUndoRedo({
6521
6533
  unitID: a,
6522
6534
  undoMutations: [{ id: xe.id, params: h }, ...g],
6523
6535
  redoMutations: [{ id: xe.id, params: d }, ...f]
@@ -6528,7 +6540,7 @@ const $o = {
6528
6540
  id: "sheet.command.set-worksheet-show",
6529
6541
  handler: (n, e) => {
6530
6542
  const { unitId: t, subUnitId: o } = e, s = n.get(E), r = n.get(V), i = n.get(M);
6531
- if (!P(n.get(M))) return !1;
6543
+ if (!k(n.get(M))) return !1;
6532
6544
  const u = i.getCurrentUnitForType(B.UNIVER_SHEET);
6533
6545
  if (!u) return !1;
6534
6546
  const l = u.getSheetBySheetId(o);
@@ -6611,7 +6623,7 @@ function Tl(n) {
6611
6623
  return kl(n.p);
6612
6624
  if (n.v && typeof n.v == "string")
6613
6625
  return n.v;
6614
- if (n.t && (n.t === re.FORCE_STRING || n.t === re.STRING))
6626
+ if (n.t && (n.t === ie.FORCE_STRING || n.t === ie.STRING))
6615
6627
  return String(n.v);
6616
6628
  }
6617
6629
  }
@@ -6627,20 +6639,20 @@ function Pl(n, e, t, o, s = !1) {
6627
6639
  h.push(y), d && d.update(y);
6628
6640
  }
6629
6641
  const m = c ? d.getDelimiter() : t, g = El(m, s, o);
6630
- let f = -1, C = 0, p = 0;
6642
+ let f = -1, p = 0, C = 0;
6631
6643
  const S = [];
6632
6644
  for (const I of h) {
6633
6645
  if (I !== void 0) {
6634
6646
  const w = String(I).split(g);
6635
- f < 0 ? f = w.length : f = Math.max(f, w.length), S.push(w), C = p;
6647
+ f < 0 ? f = w.length : f = Math.max(f, w.length), S.push(w), p = C;
6636
6648
  } else
6637
6649
  S.push(void 0);
6638
- p++;
6650
+ C++;
6639
6651
  }
6640
6652
  return {
6641
6653
  rs: S,
6642
6654
  maxLength: f === -1 ? 0 : f,
6643
- lastRow: C
6655
+ lastRow: p
6644
6656
  };
6645
6657
  }
6646
6658
  const Nl = {
@@ -6649,15 +6661,15 @@ const Nl = {
6649
6661
  // eslint-disable-next-line max-lines-per-function
6650
6662
  handler: (n, e) => {
6651
6663
  const { unitId: t, subUnitId: o, range: s, delimiter: r, customDelimiter: i, treatMultipleDelimitersAsOne: a } = e, u = n.get(E), l = n.get(M), c = n.get(V);
6652
- if (!P(n.get(M))) return !1;
6664
+ if (!k(n.get(M))) return !1;
6653
6665
  const h = l.getCurrentUnitForType(B.UNIVER_SHEET);
6654
6666
  if (!h) return !1;
6655
6667
  const m = h.getSheetBySheetId(o);
6656
6668
  if (!m) return !1;
6657
- const { lastRow: g, rs: f, maxLength: C } = Pl(m, s, r, i, a), p = m.getColumnCount(), { startColumn: S } = K.transformRange(s, m);
6669
+ const { lastRow: g, rs: f, maxLength: p } = Pl(m, s, r, i, a), C = m.getColumnCount(), { startColumn: S } = K.transformRange(s, m);
6658
6670
  if (s.startColumn !== s.endColumn)
6659
6671
  return !1;
6660
- const I = [], w = [], y = S + C + 1 - p;
6672
+ const I = [], w = [], y = S + p + 1 - C;
6661
6673
  if (y > 0) {
6662
6674
  const x = {
6663
6675
  unitId: t,
@@ -6665,8 +6677,8 @@ const Nl = {
6665
6677
  range: {
6666
6678
  startRow: 0,
6667
6679
  endRow: m.getRowCount() - 1,
6668
- startColumn: p - 1,
6669
- endColumn: p - 1 + y
6680
+ startColumn: C - 1,
6681
+ endColumn: C - 1 + y
6670
6682
  }
6671
6683
  };
6672
6684
  I.push({
@@ -6683,13 +6695,13 @@ const Nl = {
6683
6695
  startRow: s.startRow,
6684
6696
  endRow: g,
6685
6697
  startColumn: S,
6686
- endColumn: S + C
6698
+ endColumn: S + p
6687
6699
  }, D = new G();
6688
6700
  for (let x = b.startRow; x <= b.endRow; x++)
6689
6701
  for (let j = b.startColumn; j <= b.endColumn; j++) {
6690
- const Q = f[x - b.startRow];
6691
- j === 0 && (Q == null ? void 0 : Q.length) === 1 ? D.setValue(x, j, m.getCell(x, j)) : D.setValue(x, j, {
6692
- v: (Q == null ? void 0 : Q[j - b.startColumn]) || null,
6702
+ const Z = f[x - b.startRow];
6703
+ j === 0 && (Z == null ? void 0 : Z.length) === 1 ? D.setValue(x, j, m.getCell(x, j)) : D.setValue(x, j, {
6704
+ v: (Z == null ? void 0 : Z[j - b.startColumn]) || null,
6693
6705
  p: null,
6694
6706
  f: null,
6695
6707
  si: null,
@@ -6700,13 +6712,13 @@ const Nl = {
6700
6712
  unitId: t,
6701
6713
  subUnitId: o,
6702
6714
  cellValue: D.clone()
6703
- }, U = be(n, T);
6715
+ }, P = be(n, T);
6704
6716
  return I.push({
6705
- id: Z.id,
6717
+ id: X.id,
6706
6718
  params: T
6707
6719
  }), w.unshift({
6708
- id: Z.id,
6709
- params: U
6720
+ id: X.id,
6721
+ params: P
6710
6722
  }), z(I, u).result ? (c.pushUndoRedo({
6711
6723
  unitID: t,
6712
6724
  undoMutations: w,
@@ -6725,42 +6737,42 @@ const Nl = {
6725
6737
  const h = l.getCell(s, r);
6726
6738
  if (!(h != null && h.p))
6727
6739
  return !1;
6728
- const m = O.deepClone(h.p), g = new Ci(m), f = pi.paragraph.bullet.toggleChecklist({
6740
+ const m = O.deepClone(h.p), g = new pi(m), f = Ci.paragraph.bullet.toggleChecklist({
6729
6741
  document: g,
6730
6742
  paragraphIndex: i
6731
6743
  });
6732
6744
  if (!f)
6733
6745
  return !1;
6734
6746
  Si.apply(g.getBody(), f.serialize());
6735
- const C = {
6747
+ const p = {
6736
6748
  unitId: t,
6737
6749
  subUnitId: o,
6738
6750
  cellValue: {
6739
6751
  [s]: {
6740
6752
  [r]: {
6741
6753
  p: m,
6742
- t: re.STRING
6754
+ t: ie.STRING
6743
6755
  }
6744
6756
  }
6745
6757
  }
6746
- }, p = {
6747
- id: Z.id,
6748
- params: C
6749
- }, S = be(n, C), I = {
6750
- id: Z.id,
6758
+ }, C = {
6759
+ id: X.id,
6760
+ params: p
6761
+ }, S = be(n, p), I = {
6762
+ id: X.id,
6751
6763
  params: S
6752
- }, w = [p], y = [I];
6764
+ }, w = [C], y = [I];
6753
6765
  return c.pushUndoRedo({
6754
6766
  redoMutations: w,
6755
6767
  undoMutations: y,
6756
6768
  unitID: t
6757
- }), d.syncExecuteCommand(p.id, p.params);
6769
+ }), d.syncExecuteCommand(C.id, C.params);
6758
6770
  }
6759
6771
  }, jt = {
6760
6772
  id: "sheet.mutation.toggle-gridlines",
6761
6773
  type: v.MUTATION,
6762
6774
  handler: (n, e) => {
6763
- const t = P(n.get(M), e);
6775
+ const t = k(n.get(M), e);
6764
6776
  if (!t) return !1;
6765
6777
  const { worksheet: o } = t, s = o.getConfig();
6766
6778
  return s.showGridlines = e.showGridlines, !0;
@@ -6769,7 +6781,7 @@ const Nl = {
6769
6781
  type: v.COMMAND,
6770
6782
  id: "sheet.command.toggle-gridlines",
6771
6783
  handler: (n, e) => {
6772
- const t = n.get(E), o = n.get(V), s = n.get(M), r = P(s);
6784
+ const t = n.get(E), o = n.get(V), s = n.get(M), r = k(s);
6773
6785
  if (!r) return !1;
6774
6786
  const { worksheet: i } = r, a = i.getConfig().showGridlines;
6775
6787
  if (a === (e == null ? void 0 : e.showGridlines)) return !1;
@@ -6796,7 +6808,7 @@ const Nl = {
6796
6808
  if (!e)
6797
6809
  return !1;
6798
6810
  const { unitId: t, themeName: o } = e, s = n.get(M), r = n.get(E), i = n.get(V), a = n.get(Be);
6799
- if (!P(s)) return !1;
6811
+ if (!k(s)) return !1;
6800
6812
  const l = {
6801
6813
  unitId: t,
6802
6814
  themeName: o
@@ -7000,12 +7012,12 @@ var Fl = Object.getOwnPropertyDescriptor, jl = (n, e, t, o) => {
7000
7012
  (i = n[r]) && (s = i(s) || s);
7001
7013
  return s;
7002
7014
  }, ro = (n, e) => (t, o) => e(t, o, n);
7003
- let En = class extends ae {
7015
+ let En = class extends ue {
7004
7016
  // eslint-disable-next-line max-lines-per-function
7005
7017
  constructor(n, e, t) {
7006
7018
  var s;
7007
7019
  super(), this._commandService = n, this._configService = e, this._dataSyncPrimaryController = t, [
7008
- Z,
7020
+ X,
7009
7021
  We,
7010
7022
  je,
7011
7023
  Yt,
@@ -7025,9 +7037,7 @@ let En = class extends ae {
7025
7037
  xl,
7026
7038
  en,
7027
7039
  // formula SUBTOTAL
7028
- Qt,
7029
- Xt,
7030
- Zt
7040
+ Qt
7031
7041
  ].forEach((r) => {
7032
7042
  var i;
7033
7043
  this._commandService.registerCommand(r), (i = this._dataSyncPrimaryController) == null || i.registerSyncingMutations(r);
@@ -7044,7 +7054,7 @@ let En = class extends ae {
7044
7054
  fu,
7045
7055
  gu,
7046
7056
  Ru,
7047
- Cu,
7057
+ pu,
7048
7058
  Sr,
7049
7059
  et,
7050
7060
  rn,
@@ -7053,9 +7063,9 @@ let En = class extends ae {
7053
7063
  cu,
7054
7064
  mu,
7055
7065
  hu,
7056
- Cr,
7066
+ pr,
7057
7067
  Qe,
7058
- pu,
7068
+ Cu,
7059
7069
  Jn,
7060
7070
  wt,
7061
7071
  Kn,
@@ -7075,6 +7085,8 @@ let En = class extends ae {
7075
7085
  Ou,
7076
7086
  Du,
7077
7087
  Ur,
7088
+ Xt,
7089
+ Zt,
7078
7090
  _n,
7079
7091
  Lu,
7080
7092
  Lt,
@@ -7105,7 +7117,7 @@ let En = class extends ae {
7105
7117
  mt,
7106
7118
  Wo,
7107
7119
  Lr,
7108
- Cn,
7120
+ pn,
7109
7121
  jr,
7110
7122
  rt,
7111
7123
  Bo,
@@ -7113,7 +7125,7 @@ let En = class extends ae {
7113
7125
  st,
7114
7126
  // SetWorksheetColIsAutoWidthCommand,
7115
7127
  tu,
7116
- se,
7128
+ re,
7117
7129
  Ll,
7118
7130
  uu,
7119
7131
  Mr,
@@ -7164,7 +7176,7 @@ var Gl = Object.getOwnPropertyDescriptor, zl = (n, e, t, o) => {
7164
7176
  (i = n[r]) && (s = i(s) || s);
7165
7177
  return s;
7166
7178
  }, os = (n, e) => (t, o) => e(t, o, n);
7167
- let Un = class extends ae {
7179
+ let Un = class extends ue {
7168
7180
  constructor(n, e) {
7169
7181
  super(), this._univerInstanceService = n, this._commandService = e, this._initialize();
7170
7182
  }
@@ -7189,7 +7201,7 @@ let Un = class extends ae {
7189
7201
  cellValue: m
7190
7202
  };
7191
7203
  s.push({
7192
- id: Z.id,
7204
+ id: X.id,
7193
7205
  params: g
7194
7206
  });
7195
7207
  }
@@ -7228,7 +7240,7 @@ var Jl = Object.getOwnPropertyDescriptor, Yl = (n, e, t, o) => {
7228
7240
  return s;
7229
7241
  }, rs = (n, e) => (t, o) => e(t, o, n);
7230
7242
  const ql = "SHEET_DEFINED_NAME_PLUGIN", nh = "AllDefaultWorkbook";
7231
- let kn = class extends ae {
7243
+ let kn = class extends ue {
7232
7244
  constructor(n, e) {
7233
7245
  super(), this._definedNamesService = n, this._resourceManagerService = e, this._initialize();
7234
7246
  }
@@ -7271,7 +7283,7 @@ kn = Yl([
7271
7283
  const W = {
7272
7284
  MoveRangeCommandId: Ls,
7273
7285
  InsertRowCommandId: Rr,
7274
- InsertColCommandId: pr,
7286
+ InsertColCommandId: Cr,
7275
7287
  RemoveColCommandId: Oo,
7276
7288
  RemoveRowCommandId: No,
7277
7289
  DeleteRangeMoveLeftCommandId: gr,
@@ -7282,7 +7294,7 @@ const W = {
7282
7294
  MoveRowsCommandId: wr,
7283
7295
  ReorderRangeCommandId: br
7284
7296
  };
7285
- var X = /* @__PURE__ */ ((n) => (n[n.Set = 0] = "Set", n[n.Delete = 1] = "Delete", n[n.HorizontalMove = 2] = "HorizontalMove", n[n.VerticalMove = 3] = "VerticalMove", n[n.Unknown = 4] = "Unknown", n))(X || {});
7297
+ var q = /* @__PURE__ */ ((n) => (n[n.Set = 0] = "Set", n[n.Delete = 1] = "Delete", n[n.HorizontalMove = 2] = "HorizontalMove", n[n.VerticalMove = 3] = "VerticalMove", n[n.Unknown = 4] = "Unknown", n))(q || {});
7286
7298
  const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
7287
7299
  const e = { ...n }, t = Number.isNaN(e.startRow) && Number.isNaN(e.endRow) && !Number.isNaN(e.startColumn) && !Number.isNaN(e.endColumn), o = Number.isNaN(e.startColumn) && Number.isNaN(e.endColumn) && !Number.isNaN(e.startRow) && !Number.isNaN(e.endRow);
7288
7300
  return (e.rangeType === L.COLUMN || t) && (e.startRow = 0, e.endRow = dn), (e.rangeType === L.ROW || o) && (e.startColumn = 0, e.endColumn = dn), e.rangeType === L.ALL && (e.startColumn = 0, e.endColumn = dn, e.startRow = 0, e.endRow = dn), e;
@@ -7296,15 +7308,15 @@ const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
7296
7308
  rangeType: e
7297
7309
  };
7298
7310
  }, Tn = (n, e, t) => {
7299
- const o = { ...t }, s = { ...e }, r = (f, C) => {
7300
- const p = Math.max(f.start, C.start), S = Math.min(f.end, C.end);
7301
- return S < p ? null : { start: p, end: S };
7302
- }, i = (f) => f.end - f.start + 1, a = (f, C) => ({
7303
- start: f.start - C.start,
7304
- end: f.start - C.start + f.end - f.start
7305
- }), u = (f, C) => ({
7306
- start: C.start + f.start,
7307
- end: C.start + f.start + f.end - f.start
7311
+ const o = { ...t }, s = { ...e }, r = (f, p) => {
7312
+ const C = Math.max(f.start, p.start), S = Math.min(f.end, p.end);
7313
+ return S < C ? null : { start: C, end: S };
7314
+ }, i = (f) => f.end - f.start + 1, a = (f, p) => ({
7315
+ start: f.start - p.start,
7316
+ end: f.start - p.start + f.end - f.start
7317
+ }), u = (f, p) => ({
7318
+ start: p.start + f.start,
7319
+ end: p.start + f.start + f.end - f.start
7308
7320
  }), l = e.start > n.start;
7309
7321
  if (l) {
7310
7322
  const f = Math.min(n.end, e.start) - n.start + 1;
@@ -7316,8 +7328,8 @@ const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
7316
7328
  else if (h) {
7317
7329
  const f = i(h);
7318
7330
  if (m) {
7319
- const C = a(o, n), p = u(C, s);
7320
- o.start = p.start, o.end = p.end;
7331
+ const p = a(o, n), C = u(p, s);
7332
+ o.start = C.start, o.end = C.end;
7321
7333
  } else h.start > n.start ? l ? (o.end -= f + c, o.start -= c) : o.end -= f : l ? o.end -= f : o.start > n.start && o.end > n.end ? (o.start -= c, o.end -= c + f) : o.end -= f;
7322
7334
  }
7323
7335
  const g = r(s, o);
@@ -7336,11 +7348,11 @@ const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
7336
7348
  );
7337
7349
  return a === null ? [
7338
7350
  {
7339
- type: X.Delete
7351
+ type: q.Delete
7340
7352
  }
7341
7353
  ] : [
7342
7354
  {
7343
- type: X.VerticalMove,
7355
+ type: q.VerticalMove,
7344
7356
  step: a.step || 0,
7345
7357
  length: a.length || 0
7346
7358
  }
@@ -7364,7 +7376,7 @@ const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
7364
7376
  const r = new G();
7365
7377
  return K.foreach(t, (a, u) => {
7366
7378
  var l;
7367
- if (o.hasOwnProperty(a)) {
7379
+ if (Object.prototype.hasOwnProperty.call(o, a)) {
7368
7380
  const c = o[a], d = (l = s.getValue(c, u)) != null ? l : 0;
7369
7381
  r.setValue(a, u, d);
7370
7382
  }
@@ -7382,11 +7394,11 @@ const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
7382
7394
  );
7383
7395
  return a === null ? [
7384
7396
  {
7385
- type: X.Delete
7397
+ type: q.Delete
7386
7398
  }
7387
7399
  ] : [
7388
7400
  {
7389
- type: X.HorizontalMove,
7401
+ type: q.HorizontalMove,
7390
7402
  step: a.step || 0,
7391
7403
  length: a.length || 0
7392
7404
  }
@@ -7406,15 +7418,15 @@ const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
7406
7418
  return [];
7407
7419
  const s = [];
7408
7420
  if (N.contains(t, e) && s.push({
7409
- type: X.Delete
7421
+ type: q.Delete
7410
7422
  }), N.contains(o, e)) {
7411
7423
  s.push({
7412
- type: X.Delete
7424
+ type: q.Delete
7413
7425
  });
7414
7426
  const a = N.getRelativeRange(e, o), u = N.getPositionRange(a, t);
7415
7427
  return [
7416
7428
  {
7417
- type: X.Set,
7429
+ type: q.Set,
7418
7430
  range: u
7419
7431
  }
7420
7432
  ];
@@ -7446,9 +7458,9 @@ const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
7446
7458
  endRow: t.endRow - u
7447
7459
  };
7448
7460
  return l && K.foreach(l, (m, g) => {
7449
- var p;
7450
- const f = m + u, C = g + a;
7451
- s.setValue(f, C, (p = r.getValue(m, g)) != null ? p : 0);
7461
+ var C;
7462
+ const f = m + u, p = g + a;
7463
+ s.setValue(f, p, (C = r.getValue(m, g)) != null ? C : 0);
7452
7464
  }), qe(s, (m) => m === 1);
7453
7465
  }, _t = (n, e) => {
7454
7466
  const t = He(n), o = He(e), s = (i) => i.endColumn - i.startColumn + 1, r = (i) => i.endRow - i.startRow + 1;
@@ -7482,11 +7494,11 @@ const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
7482
7494
  return [];
7483
7495
  const o = [], s = _t(t, e);
7484
7496
  if (!s)
7485
- o.push({ type: X.Delete });
7497
+ o.push({ type: q.Delete });
7486
7498
  else {
7487
7499
  const { step: i, length: a } = s;
7488
7500
  o.push({
7489
- type: X.HorizontalMove,
7501
+ type: q.HorizontalMove,
7490
7502
  step: i,
7491
7503
  length: a
7492
7504
  });
@@ -7499,11 +7511,11 @@ const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
7499
7511
  return [];
7500
7512
  const o = [], s = _t(_e(t), _e(e));
7501
7513
  if (!s)
7502
- o.push({ type: X.Delete });
7514
+ o.push({ type: q.Delete });
7503
7515
  else {
7504
7516
  const { step: i, length: a } = s;
7505
7517
  o.push({
7506
- type: X.VerticalMove,
7518
+ type: q.VerticalMove,
7507
7519
  step: i,
7508
7520
  length: a
7509
7521
  });
@@ -7519,7 +7531,7 @@ const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
7519
7531
  if (o[i] === r) {
7520
7532
  const a = Number(i);
7521
7533
  return s.push({
7522
- type: X.VerticalMove,
7534
+ type: q.VerticalMove,
7523
7535
  step: a - r,
7524
7536
  length: 0
7525
7537
  }), s;
@@ -7563,15 +7575,15 @@ const dn = Number.MAX_SAFE_INTEGER, He = (n) => {
7563
7575
  function sc(n, e, t) {
7564
7576
  const o = [];
7565
7577
  if (N.contains(e, t) && o.push({
7566
- type: X.Delete
7578
+ type: q.Delete
7567
7579
  }), N.contains(n, t)) {
7568
7580
  o.push({
7569
- type: X.Delete
7581
+ type: q.Delete
7570
7582
  });
7571
7583
  const s = N.getRelativeRange(t, n), r = N.getPositionRange(s, e);
7572
7584
  return [
7573
7585
  {
7574
- type: X.Set,
7586
+ type: q.Set,
7575
7587
  range: r
7576
7588
  }
7577
7589
  ];
@@ -7585,7 +7597,7 @@ const rc = (n, e) => {
7585
7597
  return [];
7586
7598
  const o = [], s = yt(_e(t), _e(e)), { step: r, length: i } = s;
7587
7599
  return o.push({
7588
- type: X.VerticalMove,
7600
+ type: q.VerticalMove,
7589
7601
  step: r,
7590
7602
  length: i
7591
7603
  }), o;
@@ -7596,7 +7608,7 @@ const rc = (n, e) => {
7596
7608
  return [];
7597
7609
  const o = [], s = yt(t, e), { step: r, length: i } = s;
7598
7610
  return o.push({
7599
- type: X.HorizontalMove,
7611
+ type: q.HorizontalMove,
7600
7612
  step: r,
7601
7613
  length: i
7602
7614
  }), o;
@@ -7607,7 +7619,7 @@ const rc = (n, e) => {
7607
7619
  return [];
7608
7620
  const o = [], s = yt(_e(t), _e(e)), { step: r, length: i } = s;
7609
7621
  return o.push({
7610
- type: X.VerticalMove,
7622
+ type: q.VerticalMove,
7611
7623
  step: r,
7612
7624
  length: i
7613
7625
  }), o;
@@ -7638,7 +7650,7 @@ const rc = (n, e) => {
7638
7650
  return [];
7639
7651
  const o = [], s = yt(t, e), { step: r, length: i } = s;
7640
7652
  return o.push({
7641
- type: X.HorizontalMove,
7653
+ type: q.HorizontalMove,
7642
7654
  step: r,
7643
7655
  length: i
7644
7656
  }), o;
@@ -7669,11 +7681,11 @@ const rc = (n, e) => {
7669
7681
  return [];
7670
7682
  const o = [], s = _t(t, e);
7671
7683
  if (!s)
7672
- o.push({ type: X.Delete });
7684
+ o.push({ type: q.Delete });
7673
7685
  else {
7674
7686
  const { step: i, length: a } = s;
7675
7687
  o.push({
7676
- type: X.HorizontalMove,
7688
+ type: q.HorizontalMove,
7677
7689
  step: i,
7678
7690
  length: a
7679
7691
  });
@@ -7709,11 +7721,11 @@ const rc = (n, e) => {
7709
7721
  return [];
7710
7722
  const o = [], s = _t(_e(t), _e(e));
7711
7723
  if (!s)
7712
- o.push({ type: X.Delete });
7724
+ o.push({ type: q.Delete });
7713
7725
  else {
7714
7726
  const { step: i, length: a } = s;
7715
7727
  o.push({
7716
- type: X.VerticalMove,
7728
+ type: q.VerticalMove,
7717
7729
  step: i,
7718
7730
  length: a
7719
7731
  });
@@ -7751,40 +7763,26 @@ const rc = (n, e) => {
7751
7763
  o.removeRows(i, u);
7752
7764
  }), qe(o, (r) => r === 1);
7753
7765
  }, Rc = (n, e) => {
7754
- const t = n.params, o = t.range.startRow, s = t.range.endRow - t.range.startRow + 1, r = t.direction;
7755
- return r === ue.UP && o === e.startRow || r === ue.DOWN && o - 1 === e.endRow ? [
7756
- {
7757
- startRow: e.startRow,
7758
- endRow: e.endRow + s,
7759
- startColumn: e.startColumn,
7760
- endColumn: e.endColumn
7761
- }
7762
- ] : e.startRow >= o ? [{
7766
+ const t = n.params, o = t.range.startRow, s = t.range.endRow - t.range.startRow + 1;
7767
+ return e.startRow >= o ? [{
7763
7768
  startRow: e.startRow + s,
7764
7769
  endRow: e.endRow + s,
7765
7770
  startColumn: e.startColumn,
7766
7771
  endColumn: e.endColumn
7767
- }] : e.endRow <= o ? [e] : [{
7772
+ }] : e.endRow < o ? [e] : [{
7768
7773
  startRow: e.startRow,
7769
7774
  endRow: e.endRow + s,
7770
7775
  startColumn: e.startColumn,
7771
7776
  endColumn: e.endColumn
7772
7777
  }];
7773
- }, Cc = (n, e) => {
7774
- const t = n.params, o = t.range.startColumn, s = t.range.endColumn - t.range.startColumn + 1, r = t.direction;
7775
- return r === ue.LEFT && o === e.startColumn || r === ue.RIGHT && o - 1 === e.endColumn ? [
7776
- {
7777
- startRow: e.startRow,
7778
- endRow: e.endRow,
7779
- startColumn: e.startColumn,
7780
- endColumn: e.endColumn + s
7781
- }
7782
- ] : e.startColumn >= o ? [{
7778
+ }, pc = (n, e) => {
7779
+ const t = n.params, o = t.range.startColumn, s = t.range.endColumn - t.range.startColumn + 1;
7780
+ return e.startColumn >= o ? [{
7783
7781
  startRow: e.startRow,
7784
7782
  endRow: e.endRow,
7785
7783
  startColumn: e.startColumn + s,
7786
7784
  endColumn: e.endColumn + s
7787
- }] : e.endColumn <= o ? [e] : [{
7785
+ }] : e.endColumn < o ? [e] : [{
7788
7786
  startRow: e.startRow,
7789
7787
  endRow: e.endRow,
7790
7788
  startColumn: e.startColumn,
@@ -7794,23 +7792,23 @@ const rc = (n, e) => {
7794
7792
  let t = { ...e };
7795
7793
  return n.forEach((o) => {
7796
7794
  switch (o.type) {
7797
- case X.Delete: {
7795
+ case q.Delete: {
7798
7796
  t = null;
7799
7797
  break;
7800
7798
  }
7801
- case X.HorizontalMove: {
7799
+ case q.HorizontalMove: {
7802
7800
  if (!t)
7803
7801
  return;
7804
7802
  t.startColumn += o.step, t.endColumn += o.step + (o.length || 0);
7805
7803
  break;
7806
7804
  }
7807
- case X.VerticalMove: {
7805
+ case q.VerticalMove: {
7808
7806
  if (!t)
7809
7807
  return;
7810
7808
  t.startRow += o.step, t.endRow += o.step + (o.length || 0);
7811
7809
  break;
7812
7810
  }
7813
- case X.Set: {
7811
+ case q.Set: {
7814
7812
  t = o.range;
7815
7813
  break;
7816
7814
  }
@@ -7881,7 +7879,7 @@ const rc = (n, e) => {
7881
7879
  case W.InsertRangeMoveRightCommandId:
7882
7880
  return cc(e, n);
7883
7881
  case W.InsertColCommandId:
7884
- return Cc(e, n);
7882
+ return pc(e, n);
7885
7883
  case W.InsertRowCommandId:
7886
7884
  return Rc(e, n);
7887
7885
  case W.MoveColsCommandId:
@@ -7902,42 +7900,42 @@ const rc = (n, e) => {
7902
7900
  const o = bt(t, n);
7903
7901
  return o ? [o] : [];
7904
7902
  }, sh = (n, e, t) => [Pt.id, Nt.id, rn.id, To].includes(e.id) || Qr(e, t).some((r) => N.intersects(r, n)) ? as(n, e) : n;
7905
- function pc(n, e) {
7903
+ function Cc(n, e) {
7906
7904
  const { id: t, params: o } = e;
7907
7905
  let s = {
7908
7906
  length: 0,
7909
7907
  step: 0,
7910
- type: X.Unknown
7908
+ type: q.Unknown
7911
7909
  };
7912
7910
  switch (t) {
7913
7911
  case Tt.id:
7914
- s.type = X.Delete;
7912
+ s.type = q.Delete;
7915
7913
  break;
7916
7914
  case it.id:
7917
7915
  s = Tn(
7918
7916
  { start: o.sourceRange.startRow, end: o.sourceRange.endRow },
7919
7917
  { start: o.targetRange.startRow, end: o.targetRange.endRow },
7920
7918
  { start: n.startRow, end: n.endRow }
7921
- ), s.type = X.VerticalMove;
7919
+ ), s.type = q.VerticalMove;
7922
7920
  break;
7923
7921
  case at.id:
7924
7922
  s = Tn(
7925
7923
  { start: o.sourceRange.startColumn, end: o.sourceRange.endColumn },
7926
7924
  { start: o.targetRange.startColumn, end: o.targetRange.endColumn },
7927
7925
  { start: n.startColumn, end: n.endColumn }
7928
- ), s.type = X.HorizontalMove;
7926
+ ), s.type = q.HorizontalMove;
7929
7927
  break;
7930
7928
  case ye.id:
7931
- s = _t(o.range, n), s ? s.type = X.HorizontalMove : s = { step: 0, length: 0, type: X.Delete };
7929
+ s = _t(o.range, n), s ? s.type = q.HorizontalMove : s = { step: 0, length: 0, type: q.Delete };
7932
7930
  break;
7933
7931
  case Ge.id:
7934
- s = _t(_e(o.range), _e(n)), s ? s.type = X.VerticalMove : s = { step: 0, length: 0, type: X.Delete };
7932
+ s = _t(_e(o.range), _e(n)), s ? s.type = q.VerticalMove : s = { step: 0, length: 0, type: q.Delete };
7935
7933
  break;
7936
7934
  case je.id:
7937
- s = yt(_e(o.range), _e(n)), s.type = X.VerticalMove;
7935
+ s = yt(_e(o.range), _e(n)), s.type = q.VerticalMove;
7938
7936
  break;
7939
7937
  case We.id:
7940
- s = yt(o.range, n), s.type = X.HorizontalMove;
7938
+ s = yt(o.range, n), s.type = q.HorizontalMove;
7941
7939
  break;
7942
7940
  case ft.id:
7943
7941
  {
@@ -8088,7 +8086,7 @@ function rh(n, e) {
8088
8086
  const t = n.get(M), o = n.get(H);
8089
8087
  switch (e.id) {
8090
8088
  case W.MoveColsCommandId: {
8091
- const c = e.params, d = P(t, {
8089
+ const c = e.params, d = k(t, {
8092
8090
  unitId: c.unitId,
8093
8091
  subUnitId: c.subUnitId
8094
8092
  });
@@ -8106,7 +8104,7 @@ function rh(n, e) {
8106
8104
  };
8107
8105
  }
8108
8106
  case W.MoveRowsCommandId: {
8109
- const c = e.params, d = P(t, {
8107
+ const c = e.params, d = k(t, {
8110
8108
  unitId: c.unitId,
8111
8109
  subUnitId: c.subUnitId
8112
8110
  });
@@ -8124,7 +8122,7 @@ function rh(n, e) {
8124
8122
  };
8125
8123
  }
8126
8124
  case W.MoveRangeCommandId: {
8127
- const c = e.params, d = P(t);
8125
+ const c = e.params, d = k(t);
8128
8126
  return {
8129
8127
  unitId: d.unitId,
8130
8128
  subUnitId: d.subUnitId,
@@ -8170,7 +8168,7 @@ function rh(n, e) {
8170
8168
  };
8171
8169
  }
8172
8170
  case W.RemoveRowCommandId: {
8173
- const d = e.params.range, h = P(t);
8171
+ const d = e.params.range, h = k(t);
8174
8172
  return {
8175
8173
  unitId: h.unitId,
8176
8174
  subUnitId: h.subUnitId,
@@ -8185,7 +8183,7 @@ function rh(n, e) {
8185
8183
  };
8186
8184
  }
8187
8185
  case W.RemoveColCommandId: {
8188
- const d = e.params.range, h = P(t);
8186
+ const d = e.params.range, h = k(t);
8189
8187
  return {
8190
8188
  unitId: h.unitId,
8191
8189
  subUnitId: h.subUnitId,
@@ -8201,7 +8199,7 @@ function rh(n, e) {
8201
8199
  }
8202
8200
  case W.DeleteRangeMoveUpCommandId:
8203
8201
  case W.InsertRangeMoveDownCommandId: {
8204
- const c = e, d = P(t), h = ((s = c.params) == null ? void 0 : s.range) || ((i = (r = o.getCurrentSelections()) == null ? void 0 : r.map((m) => m.range)) == null ? void 0 : i[0]);
8202
+ const c = e, d = k(t), h = ((s = c.params) == null ? void 0 : s.range) || ((i = (r = o.getCurrentSelections()) == null ? void 0 : r.map((m) => m.range)) == null ? void 0 : i[0]);
8205
8203
  return h ? {
8206
8204
  unitId: d.unitId,
8207
8205
  subUnitId: d.subUnitId,
@@ -8221,7 +8219,7 @@ function rh(n, e) {
8221
8219
  }
8222
8220
  case W.DeleteRangeMoveLeftCommandId:
8223
8221
  case W.InsertRangeMoveRightCommandId: {
8224
- const d = ((a = e.params) == null ? void 0 : a.range) || ((l = (u = o.getCurrentSelections()) == null ? void 0 : u.map((m) => m.range)) == null ? void 0 : l[0]), h = P(t);
8222
+ const d = ((a = e.params) == null ? void 0 : a.range) || ((l = (u = o.getCurrentSelections()) == null ? void 0 : u.map((m) => m.range)) == null ? void 0 : l[0]), h = k(t);
8225
8223
  return d ? {
8226
8224
  unitId: h.unitId,
8227
8225
  subUnitId: h.subUnitId,
@@ -8248,7 +8246,7 @@ function rh(n, e) {
8248
8246
  startColumn: d.startColumn,
8249
8247
  endColumn: d.endColumn
8250
8248
  });
8251
- const g = P(t);
8249
+ const g = k(t);
8252
8250
  return {
8253
8251
  unitId: g.unitId,
8254
8252
  subUnitId: g.subUnitId,
@@ -8263,7 +8261,7 @@ var wc = Object.getOwnPropertyDescriptor, Ic = (n, e, t, o) => {
8263
8261
  return s;
8264
8262
  }, hn = (n, e) => (t, o) => e(t, o, n);
8265
8263
  const vc = ut("MERGE_REDO"), Mc = ut("MERGE_UNDO"), us = Math.floor(Number.MAX_SAFE_INTEGER / 10);
8266
- class _c extends ae {
8264
+ class _c extends ue {
8267
8265
  constructor(e, t, o, s, r = !1) {
8268
8266
  super(), this._unitId = e, this._subUnitId = t, this._range = o, this._callback = s, this._skipIntersects = r;
8269
8267
  }
@@ -8286,14 +8284,14 @@ class _c extends ae {
8286
8284
  if (i != null && i.some((a) => N.intersects(a, this._range)))
8287
8285
  return;
8288
8286
  }
8289
- const t = pc(this._range, e);
8287
+ const t = Cc(this._range, e);
8290
8288
  if (t && N.equals(t, this._range))
8291
8289
  return !1;
8292
8290
  const o = this._range;
8293
8291
  this._range = t, this._callback(o, t);
8294
8292
  }
8295
8293
  }
8296
- let Et = class extends ae {
8294
+ let Et = class extends ue {
8297
8295
  constructor(e, t, o, s) {
8298
8296
  super();
8299
8297
  R(this, "interceptor", new Ro({ MERGE_REDO: vc, MERGE_UNDO: Mc }));
@@ -8396,10 +8394,10 @@ let Et = class extends ae {
8396
8394
  }
8397
8395
  case W.ReorderRangeCommandId: {
8398
8396
  const h = e, { range: m, order: g } = h.params, f = [];
8399
- for (let C = m.startRow; C <= m.endRow; C++)
8400
- C in g && f.push({
8401
- startRow: C,
8402
- endRow: C,
8397
+ for (let p = m.startRow; p <= m.endRow; p++)
8398
+ p in g && f.push({
8399
+ startRow: p,
8400
+ endRow: p,
8403
8401
  startColumn: m.startColumn,
8404
8402
  endColumn: m.endColumn
8405
8403
  });
@@ -8582,7 +8580,7 @@ function ei(n, e) {
8582
8580
  return t;
8583
8581
  }
8584
8582
  const Tc = ut("mergeCellPermissionCheck");
8585
- let Pn = class extends ae {
8583
+ let Pn = class extends ue {
8586
8584
  constructor(e, t, o, s, r, i) {
8587
8585
  super();
8588
8586
  R(this, "disposableCollection", new Gt());
@@ -8624,7 +8622,7 @@ let Pn = class extends ae {
8624
8622
  const r = [], i = [], a = { redos: r, undos: i };
8625
8623
  if (!s || !s.length)
8626
8624
  return a;
8627
- const u = P(this._univerInstanceService, { unitId: t, subUnitId: o });
8625
+ const u = k(this._univerInstanceService, { unitId: t, subUnitId: o });
8628
8626
  if (!u)
8629
8627
  return a;
8630
8628
  const { worksheet: l } = u, d = l.getMergeData().filter((h) => s.some((m) => N.intersects(h, m)));
@@ -8740,8 +8738,8 @@ let Pn = class extends ae {
8740
8738
  if (i.forEach((g) => {
8741
8739
  if (c <= g.startRow && d >= g.endRow) {
8742
8740
  a.ranges.push(g);
8743
- const f = qr({ id: W.MoveRowsCommandId, params: e }, g), C = bt(f, g);
8744
- C && u.ranges.push(C);
8741
+ const f = qr({ id: W.MoveRowsCommandId, params: e }, g), p = bt(f, g);
8742
+ p && u.ranges.push(p);
8745
8743
  }
8746
8744
  }), a.ranges.length === 0)
8747
8745
  return this._handleNull();
@@ -8764,8 +8762,8 @@ let Pn = class extends ae {
8764
8762
  if (i.forEach((g) => {
8765
8763
  if (c <= g.startColumn && d >= g.endColumn) {
8766
8764
  a.ranges.push(g);
8767
- const f = Xr({ id: W.MoveColsCommandId, params: e }, g), C = bt(f, g);
8768
- C && u.ranges.push(C);
8765
+ const f = Xr({ id: W.MoveColsCommandId, params: e }, g), p = bt(f, g);
8766
+ p && u.ranges.push(p);
8769
8767
  }
8770
8768
  }), a.ranges.length === 0)
8771
8769
  return this._handleNull();
@@ -8846,15 +8844,15 @@ let Pn = class extends ae {
8846
8844
  const r = Ue(s, o);
8847
8845
  if (!r)
8848
8846
  return this._handleNull();
8849
- const { range: i } = e, { startRow: a, endRow: u } = i, l = O.deepClone(r.getMergeData()).reduce((p, S) => (a > S.startRow && a <= S.endRow && p.push(S), p), []);
8847
+ const { range: i } = e, { startRow: a, endRow: u } = i, l = O.deepClone(r.getMergeData()).reduce((C, S) => (a > S.startRow && a <= S.endRow && C.push(S), C), []);
8850
8848
  if (l.length === 0)
8851
8849
  return this._handleNull();
8852
- const c = O.deepClone(r.getMergeData()).reduce((p, S) => {
8850
+ const c = O.deepClone(r.getMergeData()).reduce((C, S) => {
8853
8851
  if (a > S.startRow && a <= S.endRow) {
8854
8852
  const I = u - a + 1;
8855
- S.endRow += I, this._checkIsMergeCell(S) && p.push(S);
8853
+ S.endRow += I, this._checkIsMergeCell(S) && C.push(S);
8856
8854
  }
8857
- return p;
8855
+ return C;
8858
8856
  }, []), d = {
8859
8857
  unitId: t,
8860
8858
  subUnitId: o,
@@ -8872,11 +8870,11 @@ let Pn = class extends ae {
8872
8870
  ), f = [
8873
8871
  { id: oe.id, params: d },
8874
8872
  { id: ne.id, params: m }
8875
- ], C = [
8873
+ ], p = [
8876
8874
  { id: oe.id, params: g },
8877
8875
  { id: ne.id, params: h }
8878
8876
  ];
8879
- return { redos: f, undos: C };
8877
+ return { redos: f, undos: p };
8880
8878
  }
8881
8879
  _handleInsertColCommand(e, t, o) {
8882
8880
  const { range: s } = e, r = Ee(this._univerInstanceService, t);
@@ -8885,15 +8883,15 @@ let Pn = class extends ae {
8885
8883
  const i = Ue(r, o);
8886
8884
  if (!i)
8887
8885
  return this._handleNull();
8888
- const { startColumn: a, endColumn: u } = s, l = O.deepClone(i.getMergeData()).reduce((p, S) => (a > S.startColumn && a <= S.endColumn && p.push(S), p), []);
8886
+ const { startColumn: a, endColumn: u } = s, l = O.deepClone(i.getMergeData()).reduce((C, S) => (a > S.startColumn && a <= S.endColumn && C.push(S), C), []);
8889
8887
  if (l.length === 0)
8890
8888
  return this._handleNull();
8891
- const c = O.deepClone(i.getMergeData()).reduce((p, S) => {
8889
+ const c = O.deepClone(i.getMergeData()).reduce((C, S) => {
8892
8890
  if (a > S.startColumn && a <= S.endColumn) {
8893
8891
  const I = u - a + 1;
8894
- S.endColumn += I, this._checkIsMergeCell(S) && p.push(S);
8892
+ S.endColumn += I, this._checkIsMergeCell(S) && C.push(S);
8895
8893
  }
8896
- return p;
8894
+ return C;
8897
8895
  }, []), d = {
8898
8896
  unitId: t,
8899
8897
  subUnitId: o,
@@ -8911,11 +8909,11 @@ let Pn = class extends ae {
8911
8909
  ), f = [
8912
8910
  { id: oe.id, params: d },
8913
8911
  { id: ne.id, params: m }
8914
- ], C = [
8912
+ ], p = [
8915
8913
  { id: oe.id, params: g },
8916
8914
  { id: ne.id, params: h }
8917
8915
  ];
8918
- return { redos: f, undos: C };
8916
+ return { redos: f, undos: p };
8919
8917
  }
8920
8918
  _handleRemoveColCommand(e, t, o) {
8921
8919
  const s = Ee(this._univerInstanceService, t);
@@ -8948,8 +8946,8 @@ let Pn = class extends ae {
8948
8946
  }, g = Te(
8949
8947
  this._injector,
8950
8948
  m
8951
- ), f = [{ id: oe.id, params: d }], C = [{ id: ne.id, params: m }], p = [{ id: oe.id, params: g }], S = [{ id: ne.id, params: h }];
8952
- return { preUndos: p, undos: S, preRedos: f, redos: C };
8949
+ ), f = [{ id: oe.id, params: d }], p = [{ id: ne.id, params: m }], C = [{ id: oe.id, params: g }], S = [{ id: ne.id, params: h }];
8950
+ return { preUndos: C, undos: S, preRedos: f, redos: p };
8953
8951
  }
8954
8952
  _handleRemoveRowCommand(e, t, o) {
8955
8953
  const { range: s } = e, r = Ee(this._univerInstanceService, t);
@@ -8982,8 +8980,8 @@ let Pn = class extends ae {
8982
8980
  }, g = Te(
8983
8981
  this._injector,
8984
8982
  m
8985
- ), f = [{ id: oe.id, params: d }], C = [{ id: ne.id, params: m }], p = [{ id: oe.id, params: g }], S = [{ id: ne.id, params: h }];
8986
- return { preUndos: p, undos: S, preRedos: f, redos: C };
8983
+ ), f = [{ id: oe.id, params: d }], p = [{ id: ne.id, params: m }], C = [{ id: oe.id, params: g }], S = [{ id: ne.id, params: h }];
8984
+ return { preUndos: C, undos: S, preRedos: f, redos: p };
8987
8985
  }
8988
8986
  _handleInsertRangeMoveRightCommand(e, t, o) {
8989
8987
  const s = Ee(this._univerInstanceService, t);
@@ -8994,20 +8992,20 @@ let Pn = class extends ae {
8994
8992
  return this._handleNull();
8995
8993
  const i = e.range, a = r.getMaxColumns() - 1, u = r.getMergeData(), l = [], c = [];
8996
8994
  u.forEach((f) => {
8997
- const { startRow: C, endRow: p, startColumn: S, endColumn: I } = i;
8995
+ const { startRow: p, endRow: C, startColumn: S, endColumn: I } = i;
8998
8996
  if (N.intersects(
8999
8997
  {
9000
- startRow: C,
8998
+ startRow: p,
9001
8999
  startColumn: S,
9002
- endRow: p,
9000
+ endRow: C,
9003
9001
  endColumn: a
9004
9002
  },
9005
9003
  f
9006
9004
  ) && (l.push(f), N.contains(
9007
9005
  {
9008
- startRow: C,
9006
+ startRow: p,
9009
9007
  startColumn: S,
9010
- endRow: p,
9008
+ endRow: C,
9011
9009
  endColumn: a
9012
9010
  },
9013
9011
  f
@@ -9068,11 +9066,11 @@ let Pn = class extends ae {
9068
9066
  u.forEach((I) => {
9069
9067
  const { startRow: w, startColumn: y, endColumn: b, endRow: D } = i;
9070
9068
  if (N.intersects({ startRow: w, startColumn: y, endRow: a, endColumn: b }, I) && (l.push(I), N.contains({ startRow: w, startColumn: y, endRow: a, endColumn: b }, I))) {
9071
- const k = D - w + 1;
9069
+ const U = D - w + 1;
9072
9070
  c.push({
9073
- startRow: I.startRow + k,
9071
+ startRow: I.startRow + U,
9074
9072
  startColumn: I.startColumn,
9075
- endRow: I.endRow + k,
9073
+ endRow: I.endRow + U,
9076
9074
  endColumn: I.endColumn
9077
9075
  });
9078
9076
  }
@@ -9096,12 +9094,12 @@ let Pn = class extends ae {
9096
9094
  id: oe.id,
9097
9095
  params: d
9098
9096
  }
9099
- ], C = [
9097
+ ], p = [
9100
9098
  {
9101
9099
  id: ne.id,
9102
9100
  params: m
9103
9101
  }
9104
- ], p = [
9102
+ ], C = [
9105
9103
  {
9106
9104
  id: oe.id,
9107
9105
  params: g
@@ -9112,7 +9110,7 @@ let Pn = class extends ae {
9112
9110
  params: h
9113
9111
  }
9114
9112
  ];
9115
- return { redos: C, undos: S, preRedos: f, preUndos: p };
9113
+ return { redos: p, undos: S, preRedos: f, preUndos: C };
9116
9114
  }
9117
9115
  _handleDeleteRangeMoveUpCommand(e, t, o) {
9118
9116
  const s = Ee(this._univerInstanceService, t);
@@ -9125,7 +9123,7 @@ let Pn = class extends ae {
9125
9123
  u.forEach((I) => {
9126
9124
  const { startRow: w, startColumn: y, endColumn: b, endRow: D } = i;
9127
9125
  if (N.intersects({ startRow: w, startColumn: y, endRow: a, endColumn: b }, I) && (l.push(I), N.contains({ startRow: w, startColumn: y, endRow: a, endColumn: b }, I))) {
9128
- const k = D - w + 1, x = N.moveVertical(I, -k);
9126
+ const U = D - w + 1, x = N.moveVertical(I, -U);
9129
9127
  c.push(x);
9130
9128
  }
9131
9129
  });
@@ -9148,12 +9146,12 @@ let Pn = class extends ae {
9148
9146
  id: oe.id,
9149
9147
  params: d
9150
9148
  }
9151
- ], C = [
9149
+ ], p = [
9152
9150
  {
9153
9151
  id: ne.id,
9154
9152
  params: m
9155
9153
  }
9156
- ], p = [
9154
+ ], C = [
9157
9155
  {
9158
9156
  id: oe.id,
9159
9157
  params: g
@@ -9164,7 +9162,7 @@ let Pn = class extends ae {
9164
9162
  params: h
9165
9163
  }
9166
9164
  ];
9167
- return { redos: C, undos: S, preRedos: f, preUndos: p };
9165
+ return { redos: p, undos: S, preRedos: f, preUndos: C };
9168
9166
  }
9169
9167
  _handleDeleteRangeMoveLeftCommand(e, t, o) {
9170
9168
  const s = Ee(this._univerInstanceService, t);
@@ -9175,20 +9173,20 @@ let Pn = class extends ae {
9175
9173
  return this._handleNull();
9176
9174
  const i = e.range, a = r.getMaxColumns() - 1, u = r.getMergeData(), l = [], c = [];
9177
9175
  u.forEach((f) => {
9178
- const { startRow: C, endRow: p, startColumn: S, endColumn: I } = i;
9176
+ const { startRow: p, endRow: C, startColumn: S, endColumn: I } = i;
9179
9177
  if (N.intersects(
9180
9178
  {
9181
- startRow: C,
9179
+ startRow: p,
9182
9180
  startColumn: S,
9183
- endRow: p,
9181
+ endRow: C,
9184
9182
  endColumn: a
9185
9183
  },
9186
9184
  f
9187
9185
  ) && (l.push(f), N.contains(
9188
9186
  {
9189
- startRow: C,
9187
+ startRow: p,
9190
9188
  startColumn: S,
9191
- endRow: p,
9189
+ endRow: C,
9192
9190
  endColumn: a
9193
9191
  },
9194
9192
  f
@@ -9248,8 +9246,8 @@ let Pn = class extends ae {
9248
9246
  if (!o) return;
9249
9247
  const { sourceRange: s, targetRange: r } = e.params, i = s.startColumn === r.startColumn && s.endColumn === r.endColumn, a = i ? s.endRow - s.startRow + 1 : s.endColumn - s.startColumn + 1, u = i ? s.startRow : s.startColumn, l = i ? r.startRow : r.startColumn, c = o.getConfig().mergeData, d = [];
9250
9248
  c.forEach((f) => {
9251
- let { startRow: C, endRow: p, startColumn: S, endColumn: I, rangeType: w } = f;
9252
- N.intersects(f, s) || (i ? u < C && l > p ? (C -= a, p -= a) : u > p && l <= C && (C += a, p += a) : u < S && l > I ? (S -= a, I -= a) : u > I && l <= S && (S += a, I += a)), f.startRow === f.endRow && f.startColumn === f.endColumn || d.push({ startRow: C, endRow: p, startColumn: S, endColumn: I, rangeType: w });
9249
+ let { startRow: p, endRow: C, startColumn: S, endColumn: I, rangeType: w } = f;
9250
+ N.intersects(f, s) || (i ? u < p && l > C ? (p -= a, C -= a) : u > C && l <= p && (p += a, C += a) : u < S && l > I ? (S -= a, I -= a) : u > I && l <= S && (S += a, I += a)), f.startRow === f.endRow && f.startColumn === f.endColumn || d.push({ startRow: p, endRow: C, startColumn: S, endColumn: I, rangeType: w });
9253
9251
  }), o.setMergeData(d), this.disposableCollection.dispose();
9254
9252
  const { unitId: h, subUnitId: m } = e.params, g = (f) => this.refRangeHandle(f, h, m);
9255
9253
  d.forEach((f) => {
@@ -9264,13 +9262,13 @@ let Pn = class extends ae {
9264
9262
  const s = o.getConfig().mergeData, r = e.params;
9265
9263
  if (!r) return;
9266
9264
  const { range: i } = r, a = e.id.includes("row"), u = e.id.includes("insert"), l = a ? i.startRow : i.startColumn, c = a ? i.endRow : i.endColumn, d = c - l + 1, h = [];
9267
- s.forEach((C) => {
9268
- let { startRow: p, endRow: S, startColumn: I, endColumn: w, rangeType: y } = C;
9269
- u ? a ? l <= p && (p += d, S += d) : l <= I && (I += d, w += d) : a ? c < p && (p -= d, S -= d) : c < I && (I -= d, w -= d), C.startRow === C.endRow && C.startColumn === C.endColumn || h.push({ startRow: p, endRow: S, startColumn: I, endColumn: w, rangeType: y });
9265
+ s.forEach((p) => {
9266
+ let { startRow: C, endRow: S, startColumn: I, endColumn: w, rangeType: y } = p;
9267
+ u ? a ? l <= C && (C += d, S += d) : l <= I && (I += d, w += d) : a ? c < C && (C -= d, S -= d) : c < I && (I -= d, w -= d), p.startRow === p.endRow && p.startColumn === p.endColumn || h.push({ startRow: C, endRow: S, startColumn: I, endColumn: w, rangeType: y });
9270
9268
  }), o.setMergeData(h), this.disposableCollection.dispose();
9271
- const { unitId: m, subUnitId: g } = e.params, f = (C) => this.refRangeHandle(C, m, g);
9272
- h.forEach((C) => {
9273
- this.disposableCollection.add(this._refRangeService.registerRefRange(C, f, m, g));
9269
+ const { unitId: m, subUnitId: g } = e.params, f = (p) => this.refRangeHandle(p, m, g);
9270
+ h.forEach((p) => {
9271
+ this.disposableCollection.add(this._refRangeService.registerRefRange(p, f, m, g));
9274
9272
  });
9275
9273
  }
9276
9274
  }));
@@ -9295,7 +9293,7 @@ var Pc = Object.getOwnPropertyDescriptor, Nc = (n, e, t, o) => {
9295
9293
  (i = n[r]) && (s = i(s) || s);
9296
9294
  return s;
9297
9295
  }, Oc = (n, e) => (t, o) => e(t, o, n);
9298
- let Nn = class extends ae {
9296
+ let Nn = class extends ue {
9299
9297
  constructor(n) {
9300
9298
  super(), this._sheetInterceptorService = n, this._initialize();
9301
9299
  }
@@ -9310,7 +9308,7 @@ let Nn = class extends ae {
9310
9308
  handler: (n, e, t) => {
9311
9309
  var s;
9312
9310
  const o = e.workbook.getStyles().getStyleByCell(n);
9313
- return (s = o == null ? void 0 : o.n) != null && s.pattern ? t({ ...n }) : (n == null ? void 0 : n.t) === re.NUMBER && n.v !== void 0 && n.v !== null && po(n.v) ? t({
9311
+ return (s = o == null ? void 0 : o.n) != null && s.pattern ? t({ ...n }) : (n == null ? void 0 : n.t) === ie.NUMBER && n.v !== void 0 && n.v !== null && Co(n.v) ? t({
9314
9312
  ...n,
9315
9313
  v: Wi(Number(n.v))
9316
9314
  }) : t({ ...n });
@@ -9327,7 +9325,7 @@ var Dc = Object.getOwnPropertyDescriptor, Ac = (n, e, t, o) => {
9327
9325
  (i = n[r]) && (s = i(s) || s);
9328
9326
  return s;
9329
9327
  }, Ve = (n, e) => (t, o) => e(t, o, n);
9330
- let On = class extends ae {
9328
+ let On = class extends ue {
9331
9329
  constructor(e, t, o, s, r, i, a, u, l, c) {
9332
9330
  super();
9333
9331
  R(this, "disposableCollection", new Gt());
@@ -9453,7 +9451,7 @@ let On = class extends ae {
9453
9451
  }
9454
9452
  _permissionCheckWithInsertRangeMove(e) {
9455
9453
  var l;
9456
- const t = P(this._univerInstanceService);
9454
+ const t = k(this._univerInstanceService);
9457
9455
  if (!t)
9458
9456
  return !1;
9459
9457
  const { worksheet: o, unitId: s, subUnitId: r } = t, i = O.deepClone((l = this._selectionManagerService.getCurrentLastSelection()) == null ? void 0 : l.range);
@@ -9461,7 +9459,7 @@ let On = class extends ae {
9461
9459
  }
9462
9460
  _permissionCheckByWorksheetCommand(e, t, o) {
9463
9461
  var l, c;
9464
- const s = P(this._univerInstanceService, { unitId: t, subUnitId: o });
9462
+ const s = k(this._univerInstanceService, { unitId: t, subUnitId: o });
9465
9463
  if (!s)
9466
9464
  return !1;
9467
9465
  const { unitId: r, subUnitId: i } = s, a = this._worksheetProtectionRuleModel.getRule(r, i), u = this._rangeProtectionRuleModel.getSubunitRuleList(r, i).length > 0;
@@ -9469,36 +9467,36 @@ let On = class extends ae {
9469
9467
  }
9470
9468
  permissionCheckWithoutRange(e) {
9471
9469
  var h, m, g, f;
9472
- const t = P(this._univerInstanceService);
9470
+ const t = k(this._univerInstanceService);
9473
9471
  if (!t)
9474
9472
  return !1;
9475
9473
  const { worksheet: o, unitId: s, subUnitId: r } = t, i = this._selectionManagerService.getCurrentLastSelection();
9476
9474
  if (!i)
9477
9475
  return !0;
9478
9476
  const a = (m = (h = i == null ? void 0 : i.primary) == null ? void 0 : h.actualRow) != null ? m : 0, u = (f = (g = i == null ? void 0 : i.primary) == null ? void 0 : g.actualColumn) != null ? f : 0, { workbookTypes: l, worksheetTypes: c, rangeTypes: d } = e;
9479
- return !(l && l.some((p) => {
9477
+ return !(l && l.some((C) => {
9480
9478
  var w, y;
9481
- const S = new p(s);
9479
+ const S = new C(s);
9482
9480
  return ((y = (w = this._permissionService.getPermissionPoint(S.id)) == null ? void 0 : w.value) != null ? y : !1) === !1;
9483
- }) === !0 || c && c.some((p) => {
9481
+ }) === !0 || c && c.some((C) => {
9484
9482
  var w, y;
9485
- const S = new p(s, r);
9483
+ const S = new C(s, r);
9486
9484
  return ((y = (w = this._permissionService.getPermissionPoint(S.id)) == null ? void 0 : w.value) != null ? y : !1) === !1;
9487
- }) === !0 || d && d.some((p) => {
9488
- var b, D, T, U, k;
9485
+ }) === !0 || d && d.some((C) => {
9486
+ var b, D, T, P, U;
9489
9487
  const S = (D = (b = o.getCell(a, u)) == null ? void 0 : b.selectionProtection) == null ? void 0 : D[0];
9490
9488
  if (!(S != null && S.ruleId))
9491
9489
  return !1;
9492
9490
  const I = (T = this._rangeProtectionRuleModel.getRule(s, r, S.ruleId)) == null ? void 0 : T.permissionId;
9493
9491
  if (!I)
9494
9492
  return !1;
9495
- const w = new p(s, r, I);
9496
- return ((k = (U = this._permissionService.getPermissionPoint(w.id)) == null ? void 0 : U.value) != null ? k : !1) === !1;
9493
+ const w = new C(s, r, I);
9494
+ return ((U = (P = this._permissionService.getPermissionPoint(w.id)) == null ? void 0 : P.value) != null ? U : !1) === !1;
9497
9495
  }) === !0);
9498
9496
  }
9499
9497
  permissionCheckWithRanges(e, t, o, s) {
9500
9498
  var m;
9501
- const r = P(this._univerInstanceService);
9499
+ const r = k(this._univerInstanceService);
9502
9500
  if (!r)
9503
9501
  return !1;
9504
9502
  const { workbook: i, worksheet: a } = r;
@@ -9508,11 +9506,11 @@ let On = class extends ae {
9508
9506
  return !1;
9509
9507
  const { workbookTypes: l, worksheetTypes: c, rangeTypes: d } = e, h = [];
9510
9508
  return l && h.push(...l.map((g) => new g(o).id)), c && h.push(...c.map((g) => new g(o, s).id)), d && this._rangeProtectionRuleModel.getSubunitRuleList(o, s).forEach((g) => {
9511
- u.some((C) => g.ranges.some((p) => N.intersects(p, C))) && h.push(...d.map((C) => new C(o, s, g.permissionId).id));
9509
+ u.some((p) => g.ranges.some((C) => N.intersects(C, p))) && h.push(...d.map((p) => new p(o, s, g.permissionId).id));
9512
9510
  }), h.length ? this._permissionService.composePermission(h).every((g) => g.value) : !0;
9513
9511
  }
9514
9512
  _permissionCheckByMoveCommand(e) {
9515
- const t = P(this._univerInstanceService);
9513
+ const t = k(this._univerInstanceService);
9516
9514
  if (!t)
9517
9515
  return !1;
9518
9516
  const { worksheet: o, unitId: s, subUnitId: r } = t, i = e.toRange;
@@ -9529,7 +9527,7 @@ let On = class extends ae {
9529
9527
  }), !0);
9530
9528
  }
9531
9529
  _permissionCheckByMoveRangeCommand(e) {
9532
- const t = P(this._univerInstanceService);
9530
+ const t = k(this._univerInstanceService);
9533
9531
  if (!t)
9534
9532
  return !1;
9535
9533
  const { worksheet: o, unitId: s, subUnitId: r } = t, i = e.toRange, a = this._rangeProtectionRuleModel.getSubunitRuleList(s, r).reduce((u, l) => [...u, ...l.ranges], []).filter((u) => N.intersects(u, i));
@@ -9558,17 +9556,17 @@ let On = class extends ae {
9558
9556
  let g = m.formulaOrRefString;
9559
9557
  g.startsWith(Vi.EQUALS) && (g = g.slice(1));
9560
9558
  const f = g.split(",");
9561
- for (let C = 0; C < f.length; C++) {
9562
- const p = f[C], S = Li(p);
9559
+ for (let p = 0; p < f.length; p++) {
9560
+ const C = f[p], S = Li(C);
9563
9561
  if (S.sheetName) {
9564
9562
  const I = d.getSheetBySheetName(S.sheetName);
9565
9563
  if (!I)
9566
9564
  return !0;
9567
9565
  const { startRow: w, endRow: y, startColumn: b, endColumn: D } = S.range;
9568
9566
  for (let T = w; T <= y; T++)
9569
- for (let U = b; U <= D; U++) {
9570
- const k = (a = (i = I.getCell(T, U)) == null ? void 0 : i.selectionProtection) == null ? void 0 : a[0];
9571
- if ((k == null ? void 0 : k[_.View]) === !1)
9567
+ for (let P = b; P <= D; P++) {
9568
+ const U = (a = (i = I.getCell(T, P)) == null ? void 0 : i.selectionProtection) == null ? void 0 : a[0];
9569
+ if ((U == null ? void 0 : U[_.View]) === !1)
9572
9570
  return !1;
9573
9571
  }
9574
9572
  }
@@ -9579,25 +9577,25 @@ let On = class extends ae {
9579
9577
  if (!g)
9580
9578
  return !0;
9581
9579
  for (let f = 0; f < g.length; f++) {
9582
- const C = g[f];
9583
- if (typeof C == "string" || C.nodeType !== Hi.REFERENCE)
9580
+ const p = g[f];
9581
+ if (typeof p == "string" || p.nodeType !== Hi.REFERENCE)
9584
9582
  continue;
9585
- const { token: p } = C, S = Bi(p), I = S.unitId ? this._univerInstanceService.getUnit(S.unitId) : this._univerInstanceService.getCurrentUnitForType(B.UNIVER_SHEET);
9583
+ const { token: C } = p, S = Bi(C), I = S.unitId ? this._univerInstanceService.getUnit(S.unitId) : this._univerInstanceService.getCurrentUnitForType(B.UNIVER_SHEET);
9586
9584
  if (!I) return !0;
9587
9585
  let w = S.sheetName ? I.getSheetBySheetName(S.sheetName) : I.getActiveSheet();
9588
9586
  const y = I.getUnitId();
9589
9587
  if (S.sheetName) {
9590
9588
  if (w = I.getSheetBySheetName(S.sheetName), !w)
9591
9589
  return !0;
9592
- const k = w == null ? void 0 : w.getSheetId();
9593
- if (!this._permissionService.getPermissionPoint(new Gn(y, k).id)) return !1;
9590
+ const U = w == null ? void 0 : w.getSheetId();
9591
+ if (!this._permissionService.getPermissionPoint(new Gn(y, U).id)) return !1;
9594
9592
  }
9595
9593
  if (!w)
9596
9594
  return !0;
9597
- const { startRow: b, endRow: D, startColumn: T, endColumn: U } = S.range;
9598
- for (let k = b; k <= D; k++)
9599
- for (let x = T; x <= U; x++) {
9600
- const j = (l = (u = w.getCell(k, x)) == null ? void 0 : u.selectionProtection) == null ? void 0 : l[0];
9595
+ const { startRow: b, endRow: D, startColumn: T, endColumn: P } = S.range;
9596
+ for (let U = b; U <= D; U++)
9597
+ for (let x = T; x <= P; x++) {
9598
+ const j = (l = (u = w.getCell(U, x)) == null ? void 0 : u.selectionProtection) == null ? void 0 : l[0];
9601
9599
  if ((j == null ? void 0 : j[_.View]) === !1)
9602
9600
  return !1;
9603
9601
  }
@@ -9606,11 +9604,11 @@ let On = class extends ae {
9606
9604
  }
9607
9605
  }
9608
9606
  if (o) {
9609
- const c = P(this._univerInstanceService);
9607
+ const c = k(this._univerInstanceService);
9610
9608
  if (!c)
9611
9609
  return !1;
9612
- const d = e.unitId || c.unitId, h = e.subUnitId || c.subUnitId, g = this._rangeProtectionRuleModel.getSubunitRuleList(d, h).filter((C) => C.ranges.some((p) => N.intersects(p, o))).map((C) => new Ne(d, h, C.permissionId).id);
9613
- if (!this._permissionService.composePermission(g).every((C) => C.value))
9610
+ const d = e.unitId || c.unitId, h = e.subUnitId || c.subUnitId, g = this._rangeProtectionRuleModel.getSubunitRuleList(d, h).filter((p) => p.ranges.some((C) => N.intersects(C, o))).map((p) => new Ne(d, h, p.permissionId).id);
9611
+ if (!this._permissionService.composePermission(g).every((p) => p.value))
9614
9612
  return !1;
9615
9613
  }
9616
9614
  return !0;
@@ -9633,7 +9631,7 @@ var xc = Object.getOwnPropertyDescriptor, Wc = (n, e, t, o) => {
9633
9631
  (i = n[r]) && (s = i(s) || s);
9634
9632
  return s;
9635
9633
  }, io = (n, e) => (t, o) => e(t, o, n);
9636
- let Rt = class extends ae {
9634
+ let Rt = class extends ue {
9637
9635
  constructor(e, t, o) {
9638
9636
  super();
9639
9637
  R(this, "_cellRuleCache", /* @__PURE__ */ new Map());
@@ -9727,8 +9725,8 @@ let Rt = class extends ae {
9727
9725
  }), this._permissionIdCache.delete(s.permissionId);
9728
9726
  }
9729
9727
  _getSelectionActions(e, t, o) {
9730
- var l, c, d, h, m, g, f, C, p, S, I, w;
9731
- const s = (d = (c = this._permissionService.getPermissionPoint((l = new Ne(e, t, o.permissionId)) == null ? void 0 : l.id)) == null ? void 0 : c.value) != null ? d : !0, r = (g = (m = this._permissionService.getPermissionPoint((h = new yo(e, t, o.permissionId)) == null ? void 0 : h.id)) == null ? void 0 : m.value) != null ? g : !0, i = (p = (C = this._permissionService.getPermissionPoint((f = new Br(e, t, o.permissionId)) == null ? void 0 : f.id)) == null ? void 0 : C.value) != null ? p : !1, a = (w = (I = this._permissionService.getPermissionPoint((S = new Hr(e, t, o.permissionId)) == null ? void 0 : S.id)) == null ? void 0 : I.value) != null ? w : !1;
9728
+ var l, c, d, h, m, g, f, p, C, S, I, w;
9729
+ const s = (d = (c = this._permissionService.getPermissionPoint((l = new Ne(e, t, o.permissionId)) == null ? void 0 : l.id)) == null ? void 0 : c.value) != null ? d : !0, r = (g = (m = this._permissionService.getPermissionPoint((h = new yo(e, t, o.permissionId)) == null ? void 0 : h.id)) == null ? void 0 : m.value) != null ? g : !0, i = (C = (p = this._permissionService.getPermissionPoint((f = new Br(e, t, o.permissionId)) == null ? void 0 : f.id)) == null ? void 0 : p.value) != null ? C : !1, a = (w = (I = this._permissionService.getPermissionPoint((S = new Hr(e, t, o.permissionId)) == null ? void 0 : S.id)) == null ? void 0 : I.value) != null ? w : !1;
9732
9730
  return {
9733
9731
  [_.Edit]: s,
9734
9732
  [_.View]: r,
@@ -9749,12 +9747,12 @@ let Rt = class extends ae {
9749
9747
  a.ranges.forEach((c) => {
9750
9748
  const { startRow: d, endRow: h, startColumn: m, endColumn: g } = c;
9751
9749
  for (let f = d; f <= h; f++) {
9752
- const C = r.get(`${f}`);
9753
- C ? C.set(a.id, u) : r.set(`${f}`, /* @__PURE__ */ new Map([[a.id, u]]));
9754
- for (let p = m; p <= g; p++) {
9755
- o.set(`${f}-${p}`, a.id), s.set(`${f}-${p}`, l);
9756
- const S = i.get(`${p}`);
9757
- S ? S.set(a.id, u) : i.set(`${p}`, /* @__PURE__ */ new Map([[a.id, u]]));
9750
+ const p = r.get(`${f}`);
9751
+ p ? p.set(a.id, u) : r.set(`${f}`, /* @__PURE__ */ new Map([[a.id, u]]));
9752
+ for (let C = m; C <= g; C++) {
9753
+ o.set(`${f}-${C}`, a.id), s.set(`${f}-${C}`, l);
9754
+ const S = i.get(`${C}`);
9755
+ S ? S.set(a.id, u) : i.set(`${C}`, /* @__PURE__ */ new Map([[a.id, u]]));
9758
9756
  }
9759
9757
  }
9760
9758
  }), this._permissionIdCache.set(a.permissionId, a.id);
@@ -9802,11 +9800,11 @@ let Rt = class extends ae {
9802
9800
  i.ranges.forEach((c) => {
9803
9801
  const { startRow: d, endRow: h, startColumn: m, endColumn: g } = c;
9804
9802
  for (let f = d; f <= h; f++) {
9805
- const C = a.get(`${f}`);
9806
- C ? C.set(r, l) : a.set(`${f}`, /* @__PURE__ */ new Map([[r, l]]));
9807
- for (let p = m; p <= g; p++) {
9808
- const S = u.get(`${p}`);
9809
- S ? S.set(r, l) : u.set(`${p}`, /* @__PURE__ */ new Map([[r, l]]));
9803
+ const p = a.get(`${f}`);
9804
+ p ? p.set(r, l) : a.set(`${f}`, /* @__PURE__ */ new Map([[r, l]]));
9805
+ for (let C = m; C <= g; C++) {
9806
+ const S = u.get(`${C}`);
9807
+ S ? S.set(r, l) : u.set(`${C}`, /* @__PURE__ */ new Map([[r, l]]));
9810
9808
  }
9811
9809
  }
9812
9810
  });
@@ -9867,7 +9865,7 @@ var $c = Object.getOwnPropertyDescriptor, Vc = (n, e, t, o) => {
9867
9865
  (i = n[r]) && (s = i(s) || s);
9868
9866
  return s;
9869
9867
  }, ke = (n, e) => (t, o) => e(t, o, n);
9870
- let Dn = class extends ae {
9868
+ let Dn = class extends ue {
9871
9869
  constructor(n, e, t, o, s, r, i, a, u, l, c) {
9872
9870
  super(), this._univerInstanceService = n, this._permissionService = e, this._authzIoService = t, this._rangeProtectionRuleModel = o, this._worksheetProtectionRuleModel = s, this._userManagerService = r, this._worksheetProtectionPointRuleModel = i, this._sheetInterceptorService = a, this._undoRedoService = u, this._commandService = l, this._rangeProtectionCache = c;
9873
9871
  }
@@ -9935,7 +9933,7 @@ let Dn = class extends ae {
9935
9933
  objectID: e,
9936
9934
  objectType: A.Workbook,
9937
9935
  unitID: e,
9938
- actions: Cl
9936
+ actions: pl
9939
9937
  }).then((o) => {
9940
9938
  tn().forEach((s) => {
9941
9939
  const r = new s(e), i = r.subType, a = o.find((u) => u.action === i);
@@ -10125,7 +10123,7 @@ var Lc = Object.getOwnPropertyDescriptor, Hc = (n, e, t, o) => {
10125
10123
  (i = n[r]) && (s = i(s) || s);
10126
10124
  return s;
10127
10125
  }, mn = (n, e) => (t, o) => e(t, o, n);
10128
- let An = class extends ae {
10126
+ let An = class extends ue {
10129
10127
  constructor(n, e, t, o) {
10130
10128
  super(), this._permissionService = n, this._worksheetProtectionRuleModel = e, this._sheetInterceptorService = t, this._rangeProtectionCache = o, this._initViewModelByRangeInterceptor(), this._initViewModelBySheetInterceptor();
10131
10129
  }
@@ -10240,7 +10238,7 @@ nn = Fc([
10240
10238
  ms(1, $(Fe))
10241
10239
  ], nn);
10242
10240
  const gs = So("univer.exclusive-range-service");
10243
- class jc extends ae {
10241
+ class jc extends ue {
10244
10242
  constructor() {
10245
10243
  super(...arguments);
10246
10244
  /**
@@ -10308,7 +10306,7 @@ var Gc = Object.getOwnPropertyDescriptor, zc = (n, e, t, o) => {
10308
10306
  (i = n[r]) && (s = i(s) || s);
10309
10307
  return s;
10310
10308
  }, ao = (n, e) => (t, o) => e(t, o, n);
10311
- let go = class extends ae {
10309
+ let go = class extends ue {
10312
10310
  constructor(n, e, t) {
10313
10311
  super(), this._resourceManagerService = n, this._univerInstanceService = e, this._logService = t;
10314
10312
  }
@@ -10382,7 +10380,7 @@ var Kc = Object.getOwnPropertyDescriptor, Jc = (n, e, t, o) => {
10382
10380
  return s;
10383
10381
  }, nt = (n, e) => (t, o) => e(t, o, n);
10384
10382
  const fs = [We.id, je.id, ye.id, Ge.id], Rs = [it.id, at.id];
10385
- let xn = class extends ae {
10383
+ let xn = class extends ue {
10386
10384
  constructor(e, t, o, s, r, i, a, u) {
10387
10385
  super();
10388
10386
  R(this, "disposableCollection", new Gt());
@@ -10543,13 +10541,13 @@ let xn = class extends ae {
10543
10541
  if (!o) return;
10544
10542
  const { sourceRange: s, targetRange: r } = e.params, i = s.startColumn === r.startColumn && s.endColumn === r.endColumn, a = i ? s.endRow - s.startRow + 1 : s.endColumn - s.startColumn + 1, u = i ? s.startRow : s.startColumn, l = i ? r.startRow : r.startColumn;
10545
10543
  this._selectionProtectionRuleModel.getSubunitRuleList(t.getUnitId(), o.getSheetId()).forEach((f) => {
10546
- f.ranges.forEach((p) => {
10547
- let { startRow: S, endRow: I, startColumn: w, endColumn: y } = p;
10548
- N.intersects(p, s) || (i ? u < S && l > I ? (S -= a, I -= a) : u > I && l <= S && (S += a, I += a) : u < w && l > y ? (w -= a, y -= a) : u > y && l <= w && (w += a, y += a)), this._checkIsRightRange({ startRow: S, endRow: I, startColumn: w, endColumn: y }) && (p.startColumn = w, p.endColumn = y, p.startRow = S, p.endRow = I);
10544
+ f.ranges.forEach((C) => {
10545
+ let { startRow: S, endRow: I, startColumn: w, endColumn: y } = C;
10546
+ N.intersects(C, s) || (i ? u < S && l > I ? (S -= a, I -= a) : u > I && l <= S && (S += a, I += a) : u < w && l > y ? (w -= a, y -= a) : u > y && l <= w && (w += a, y += a)), this._checkIsRightRange({ startRow: S, endRow: I, startColumn: w, endColumn: y }) && (C.startColumn = w, C.endColumn = y, C.startRow = S, C.endRow = I);
10549
10547
  });
10550
10548
  }), this.disposableCollection.dispose();
10551
10549
  const { unitId: d, subUnitId: h } = e.params, m = (f) => this.refRangeHandle(f, d, h);
10552
- this._selectionProtectionRuleModel.getSubunitRuleList(d, h).reduce((f, C) => [...f, ...C.ranges], []).forEach((f) => {
10550
+ this._selectionProtectionRuleModel.getSubunitRuleList(d, h).reduce((f, p) => [...f, ...p.ranges], []).forEach((f) => {
10553
10551
  this.disposableCollection.add(this._refRangeService.registerRefRange(f, m, d, h));
10554
10552
  }), this._selectionProtectionRenderModel.clear();
10555
10553
  }
@@ -10561,15 +10559,15 @@ let xn = class extends ae {
10561
10559
  const s = e.params;
10562
10560
  if (!s) return;
10563
10561
  const { range: r } = s, i = e.id.includes("row"), a = e.id.includes("insert"), u = i ? r.startRow : r.startColumn, l = i ? r.endRow : r.endColumn, c = l - u + 1;
10564
- this._selectionProtectionRuleModel.getSubunitRuleList(t.getUnitId(), o.getSheetId()).forEach((C) => {
10565
- C.ranges.forEach((S) => {
10562
+ this._selectionProtectionRuleModel.getSubunitRuleList(t.getUnitId(), o.getSheetId()).forEach((p) => {
10563
+ p.ranges.forEach((S) => {
10566
10564
  let { startRow: I, endRow: w, startColumn: y, endColumn: b } = S;
10567
10565
  a ? i ? u <= I && (I += c, w += c) : u <= y && (y += c, b += c) : i ? l < I && (I -= c, w -= c) : l < y && (y -= c, b -= c), this._checkIsRightRange({ startRow: I, endRow: w, startColumn: y, endColumn: b }) && (S.startColumn = y, S.endColumn = b, S.startRow = I, S.endRow = w);
10568
10566
  });
10569
10567
  }), this.disposableCollection.dispose();
10570
- const { unitId: h, subUnitId: m } = e.params, g = (C) => this.refRangeHandle(C, h, m);
10571
- this._selectionProtectionRuleModel.getSubunitRuleList(h, m).reduce((C, p) => [...C, ...p.ranges], []).forEach((C) => {
10572
- this.disposableCollection.add(this._refRangeService.registerRefRange(C, g, h, m));
10568
+ const { unitId: h, subUnitId: m } = e.params, g = (p) => this.refRangeHandle(p, h, m);
10569
+ this._selectionProtectionRuleModel.getSubunitRuleList(h, m).reduce((p, C) => [...p, ...C.ranges], []).forEach((p) => {
10570
+ this.disposableCollection.add(this._refRangeService.registerRefRange(p, g, h, m));
10573
10571
  }), this._selectionProtectionRenderModel.clear();
10574
10572
  }
10575
10573
  }));
@@ -10623,7 +10621,7 @@ var Yc = Object.getOwnPropertyDescriptor, qc = (n, e, t, o) => {
10623
10621
  return s;
10624
10622
  }, At = (n, e) => (t, o) => e(t, o, n);
10625
10623
  const Xc = "SHEET_RANGE_PROTECTION_PLUGIN";
10626
- let Wn = class extends ae {
10624
+ let Wn = class extends ue {
10627
10625
  constructor(n, e, t, o, s) {
10628
10626
  super(), this._selectionProtectionRuleModel = n, this._permissionService = e, this._resourceManagerService = t, this._selectionProtectionCache = o, this._univerInstanceService = s, this._initSnapshot(), this._initRuleChange();
10629
10627
  }
@@ -10717,7 +10715,7 @@ var Zc = Object.getOwnPropertyDescriptor, Qc = (n, e, t, o) => {
10717
10715
  (i = n[r]) && (s = i(s) || s);
10718
10716
  return s;
10719
10717
  }, xt = (n, e) => (t, o) => e(t, o, n);
10720
- let $n = class extends ae {
10718
+ let $n = class extends ue {
10721
10719
  constructor(n, e, t, o, s) {
10722
10720
  super(), this._permissionService = n, this._univerInstanceService = e, this._rangeProtectionRuleModel = t, this._worksheetProtectionRuleModel = o, this._worksheetProtectionPointModel = s, this._init();
10723
10721
  }
@@ -10765,7 +10763,7 @@ var ed = Object.getOwnPropertyDescriptor, td = (n, e, t, o) => {
10765
10763
  (i = n[r]) && (s = i(s) || s);
10766
10764
  return s;
10767
10765
  }, nd = (n, e) => (t, o) => e(t, o, n);
10768
- let fo = class extends ae {
10766
+ let fo = class extends ue {
10769
10767
  constructor(n) {
10770
10768
  super(), this._sheetRangeThemeModel = n;
10771
10769
  }
@@ -10818,7 +10816,7 @@ var od = Object.getOwnPropertyDescriptor, sd = (n, e, t, o) => {
10818
10816
  (i = n[r]) && (s = i(s) || s);
10819
10817
  return s;
10820
10818
  }, rd = (n, e) => (t, o) => e(t, o, n);
10821
- let Vn = class extends ae {
10819
+ let Vn = class extends ue {
10822
10820
  constructor(e) {
10823
10821
  super();
10824
10822
  R(this, "_sheetSkeletonStore", /* @__PURE__ */ new Map());
@@ -10844,7 +10842,7 @@ var id = Object.defineProperty, ad = Object.getOwnPropertyDescriptor, ud = (n, e
10844
10842
  for (var s = o > 1 ? void 0 : o ? ad(e, t) : e, r = n.length - 1, i; r >= 0; r--)
10845
10843
  (i = n[r]) && (s = i(s) || s);
10846
10844
  return s;
10847
- }, Cs = (n, e) => (t, o) => e(t, o, n), ti = (n, e, t) => ud(n, typeof e != "symbol" ? e + "" : e, t);
10845
+ }, ps = (n, e) => (t, o) => e(t, o, n), ti = (n, e, t) => ud(n, typeof e != "symbol" ? e + "" : e, t);
10848
10846
  const cd = "SHEET_PLUGIN";
10849
10847
  let Ln = class extends bi {
10850
10848
  constructor(n = ss, e, t) {
@@ -10936,8 +10934,8 @@ ti(Ln, "pluginName", cd);
10936
10934
  ti(Ln, "type", B.UNIVER_SHEET);
10937
10935
  Ln = ld([
10938
10936
  yi(Fi),
10939
- Cs(1, $(Hn)),
10940
- Cs(2, Ps)
10937
+ ps(1, $(Hn)),
10938
+ ps(2, Ps)
10941
10939
  ], Ln);
10942
10940
  var dd = /* @__PURE__ */ ((n) => (n.SET_WORKSHEET_ROW_HEIGHT = "sheet.mutation.set-worksheet-row-height", n.SET_WORKSHEET_ROW_IS_AUTO_HEIGHT = "sheet.mutation.set-worksheet-row-is-auto-height", n.SET_WORKSHEET_ROW_AUTO_HEIGHT = "sheet.mutation.set-worksheet-row-auto-height", n.SET_WORKSHEET_COL_WIDTH = "sheet.mutation.set-worksheet-col-width", n.SET_WORKSHEET_ACTIVE = "sheet.operation.set-worksheet-active", n.MOVE_ROWS = "sheet.mutation.move-rows", n.MOVE_COLUMNS = "sheet.mutation.move-columns", n.SET_COL_HIDDEN = "sheet.mutation.set-col-hidden", n.SET_COL_VISIBLE = "sheet.mutation.set-col-visible", n.SET_ROW_HIDDEN = "sheet.mutation.set-row-hidden", n.SET_ROW_VISIBLE = "sheet.mutation.set-row-visible", n.INSERT_COL = "sheet.mutation.insert-col", n.INSERT_ROW = "sheet.mutation.insert-row", n.REMOVE_COL = "sheet.mutation.remove-col", n.REMOVE_ROW = "sheet.mutation.remove-row", n.TOGGLE_GRIDLINES = "sheet.mutation.toggle-gridlines", n.SET_GRIDLINES_COLOR = "sheet.mutation.set-gridlines-color", n))(dd || {}), hd = /* @__PURE__ */ ((n) => (n.SET_RANGE_VALUES = "sheet.mutation.set-range-values", n.MOVE_RANGE = "sheet.mutation.move-range", n.REMOVE_WORKSHEET_MERGE = "sheet.mutation.remove-worksheet-merge", n.ADD_WORKSHEET_MERGE = "sheet.mutation.add-worksheet-merge", n.REORDER_RANGE = "sheet.mutation.reorder-range", n.SET_WORKSHEET_DEFAULT_STYLE = "sheet.mutation.set-worksheet-default-style", n.SET_ROW_DATA = "sheet.mutation.set-row-data", n.SET_COL_DATA = "sheet.mutation.set-col-data", n.SET_WORKSHEET_RANGE_THEME_STYLE = "sheet.mutation.set-worksheet-range-theme-style", n.DELETE_WORKSHEET_RANGE_THEME_STYLE = "sheet.mutation.delete-worksheet-range-theme-style", n))(hd || {});
10943
10941
  const ih = [
@@ -10959,7 +10957,7 @@ const ih = [
10959
10957
  jt.id,
10960
10958
  Ht.id
10961
10959
  ], ah = [
10962
- Z.id,
10960
+ X.id,
10963
10961
  ft.id,
10964
10962
  oe.id,
10965
10963
  ne.id,
@@ -11227,19 +11225,19 @@ const mh = (n, e, t) => {
11227
11225
  const c = s[(s == null ? void 0 : s.length) - 1].primary;
11228
11226
  if (c) {
11229
11227
  const { actualColumn: d, actualRow: h } = c;
11230
- let { startRow: m, startColumn: g, endRow: f, endColumn: C } = i[i.length - 1];
11228
+ let { startRow: m, startColumn: g, endRow: f, endColumn: p } = i[i.length - 1];
11231
11229
  if (r === fe.COLUMNS) {
11232
11230
  const w = t.find((y) => y.startColumn === d && y.endColumn === d && h === y.startRow);
11233
- w && (C = w.endColumn, m = w.startRow, f = w.endRow);
11231
+ w && (p = w.endColumn, m = w.startRow, f = w.endRow);
11234
11232
  } else if (r === fe.ROWS) {
11235
11233
  const w = t.find((y) => y.startRow === h && y.endRow === h && d === y.startColumn);
11236
- w && (f = w.endRow, g = w.startColumn, C = w.endColumn);
11234
+ w && (f = w.endRow, g = w.startColumn, p = w.endColumn);
11237
11235
  }
11238
- const p = {
11236
+ const C = {
11239
11237
  startRow: m,
11240
11238
  startColumn: g,
11241
11239
  endRow: f,
11242
- endColumn: C,
11240
+ endColumn: p,
11243
11241
  actualRow: h,
11244
11242
  actualColumn: d,
11245
11243
  isMerged: !0,
@@ -11247,15 +11245,15 @@ const mh = (n, e, t) => {
11247
11245
  }, S = s.map((w, y, b) => ({
11248
11246
  range: w.range,
11249
11247
  style: null,
11250
- primary: y === b.length - 1 ? p : null
11248
+ primary: y === b.length - 1 ? C : null
11251
11249
  })), I = {
11252
11250
  unitId: a,
11253
11251
  subUnitId: u,
11254
- type: pe.ONLY_SET,
11252
+ type: Ce.ONLY_SET,
11255
11253
  selections: S
11256
11254
  };
11257
11255
  return {
11258
- id: se.id,
11256
+ id: re.id,
11259
11257
  params: I
11260
11258
  };
11261
11259
  }
@@ -11268,21 +11266,21 @@ const mh = (n, e, t) => {
11268
11266
  const u = {
11269
11267
  unitId: s,
11270
11268
  subUnitId: r,
11271
- type: pe.ONLY_SET,
11269
+ type: Ce.ONLY_SET,
11272
11270
  selections: [...o]
11273
11271
  };
11274
11272
  return {
11275
- id: se.id,
11273
+ id: re.id,
11276
11274
  params: u
11277
11275
  };
11278
11276
  }
11279
11277
  return null;
11280
11278
  };
11281
- function ps(n) {
11279
+ function Cs(n) {
11282
11280
  return n == null ? !1 : n.v !== void 0 && n.v !== null && n.v !== "" || n.p !== void 0;
11283
11281
  }
11284
11282
  function Qn(n, e) {
11285
- return n && n.spanAnchor ? ps(e.getValue(n.spanAnchor.startRow, n.spanAnchor.startColumn)) : ps(n);
11283
+ return n && n.spanAnchor ? Cs(e.getValue(n.spanAnchor.startRow, n.spanAnchor.startColumn)) : Cs(n);
11286
11284
  }
11287
11285
  function gd(n, e, t, o, s) {
11288
11286
  const r = n.getCellMatrix(), i = n.getSpanModel().getMergedCellRange(e, t, o, s), a = new G();
@@ -11359,7 +11357,7 @@ function Rd(n, e, t, o) {
11359
11357
  range: n
11360
11358
  };
11361
11359
  }
11362
- function Cd(n, e, t, o) {
11360
+ function pd(n, e, t, o) {
11363
11361
  const { startRow: s, startColumn: r, endColumn: i } = n;
11364
11362
  let a = null, u = !1;
11365
11363
  for (let l = r; l <= i; l++) {
@@ -11388,7 +11386,7 @@ function Cd(n, e, t, o) {
11388
11386
  range: n
11389
11387
  };
11390
11388
  }
11391
- function pd(n, e, t, o) {
11389
+ function Cd(n, e, t, o) {
11392
11390
  const { startColumn: s, endColumn: r, endRow: i } = n;
11393
11391
  let a = null, u = !1;
11394
11392
  for (let l = s; l <= r; l++) {
@@ -11423,29 +11421,29 @@ function fh(n, e, t) {
11423
11421
  const m = [];
11424
11422
  for (; d; ) {
11425
11423
  if (d = !1, l && h.startRow !== 0) {
11426
- const { hasValue: g, range: f, spanAnchor: C } = Cd(h, r, 1, i);
11427
- if (C && m.push(C), g) {
11424
+ const { hasValue: g, range: f, spanAnchor: p } = pd(h, r, 1, i);
11425
+ if (p && m.push(p), g) {
11428
11426
  h = f, d = !0;
11429
11427
  continue;
11430
11428
  }
11431
11429
  }
11432
11430
  if (c && h.endRow !== o - 1) {
11433
- const { hasValue: g, range: f, spanAnchor: C } = pd(h, r, 1, i);
11434
- if (C && m.push(C), g) {
11431
+ const { hasValue: g, range: f, spanAnchor: p } = Cd(h, r, 1, i);
11432
+ if (p && m.push(p), g) {
11435
11433
  h = f, d = !0;
11436
11434
  continue;
11437
11435
  }
11438
11436
  }
11439
11437
  if (a && h.startColumn !== 0) {
11440
- const { hasValue: g, range: f, spanAnchor: C } = fd(h, r, 1, i);
11441
- if (C && m.push(C), g) {
11438
+ const { hasValue: g, range: f, spanAnchor: p } = fd(h, r, 1, i);
11439
+ if (p && m.push(p), g) {
11442
11440
  h = f, d = !0;
11443
11441
  continue;
11444
11442
  }
11445
11443
  }
11446
11444
  if (u && h.endColumn !== s - 1) {
11447
- const { hasValue: g, range: f, spanAnchor: C } = Rd(h, r, 1, i);
11448
- if (C && m.push(C), g) {
11445
+ const { hasValue: g, range: f, spanAnchor: p } = Rd(h, r, 1, i);
11446
+ if (p && m.push(p), g) {
11449
11447
  h = f, d = !0;
11450
11448
  continue;
11451
11449
  }
@@ -11524,33 +11522,33 @@ function gn(n, e, t) {
11524
11522
  }
11525
11523
  const Sd = (n, e, t, o, s = 1) => {
11526
11524
  switch (o) {
11527
- case ue.UP:
11525
+ case pe.UP:
11528
11526
  return ni(n, e, t, s);
11529
- case ue.DOWN:
11527
+ case pe.DOWN:
11530
11528
  return oi(n, e, t, s);
11531
- case ue.LEFT:
11529
+ case pe.LEFT:
11532
11530
  return si(n, e, t, s);
11533
- case ue.RIGHT:
11531
+ case pe.RIGHT:
11534
11532
  return ri(n, e, t, s);
11535
11533
  }
11536
11534
  }, Rh = (n, e, t) => {
11537
11535
  let o, s = -1, r;
11538
- for (let p = 0; p < n.length; p++)
11539
- if (n[p].primary) {
11540
- o = n[p], s = p, r = o.primary;
11536
+ for (let C = 0; C < n.length; C++)
11537
+ if (n[C].primary) {
11538
+ o = n[C], s = C, r = o.primary;
11541
11539
  break;
11542
11540
  }
11543
11541
  if (s === -1)
11544
11542
  return null;
11545
- const i = e === ue.LEFT || e === ue.UP, a = i ? s - 1 >= 0 ? s - 1 : n.length - 1 : s + 1 < n.length ? s + 1 : 0, u = n[a];
11543
+ const i = e === pe.LEFT || e === pe.UP, a = i ? s - 1 >= 0 ? s - 1 : n.length - 1 : s + 1 < n.length ? s + 1 : 0, u = n[a];
11546
11544
  if (!o || !r)
11547
11545
  return null;
11548
11546
  const l = { ...r }, { startRow: c, startColumn: d, endRow: h, endColumn: m } = o.range, g = i ? l.startRow === c && l.startColumn === d : l.endRow === h && l.endColumn === m, f = g && i;
11549
11547
  if (!N.equals(o.range, l)) {
11550
- const p = g ? u.range : Sd(o.range, t, l, e);
11551
- if (!p)
11548
+ const C = g ? u.range : Sd(o.range, t, l, e);
11549
+ if (!C)
11552
11550
  return null;
11553
- const S = f ? gn(p.endRow, p.endColumn, t) : gn(p.startRow, p.startColumn, t);
11551
+ const S = f ? gn(C.endRow, C.endColumn, t) : gn(C.startRow, C.startColumn, t);
11554
11552
  return {
11555
11553
  startRow: S.startRow,
11556
11554
  startColumn: S.startColumn,
@@ -11558,14 +11556,14 @@ const Sd = (n, e, t, o, s = 1) => {
11558
11556
  endColumn: S.endColumn
11559
11557
  };
11560
11558
  }
11561
- const C = f ? gn(u.range.endRow, u.range.endColumn, t) : gn(u.range.startRow, u.range.startColumn, t);
11559
+ const p = f ? gn(u.range.endRow, u.range.endColumn, t) : gn(u.range.startRow, u.range.startColumn, t);
11562
11560
  return {
11563
- startRow: C.startRow,
11564
- startColumn: C.startColumn,
11565
- endRow: C.endRow,
11566
- endColumn: C.endColumn
11561
+ startRow: p.startRow,
11562
+ startColumn: p.startColumn,
11563
+ endRow: p.endRow,
11564
+ endColumn: p.endColumn
11567
11565
  };
11568
- }, Ch = {
11566
+ }, ph = {
11569
11567
  /**
11570
11568
  * The permission point for adding or editing workbook comments
11571
11569
  */
@@ -11718,7 +11716,7 @@ const Sd = (n, e, t, o, s = 1) => {
11718
11716
  * The permission point for viewing the range protection settings
11719
11717
  */
11720
11718
  RangeProtectionPermissionViewPoint: yo
11721
- }, ph = (n, e, t, o) => {
11719
+ }, Ch = (n, e, t, o) => {
11722
11720
  const s = n.get(Fe), r = n.get(me), i = s.getPermissionPoint(new Me(e).id);
11723
11721
  if (!(i != null && i.value))
11724
11722
  return !1;
@@ -11753,7 +11751,7 @@ function vd(n, e, t, o) {
11753
11751
  n,
11754
11752
  l
11755
11753
  );
11756
- s.push({ id: Z.id, params: c }), r.push({ id: Z.id, params: l });
11754
+ s.push({ id: X.id, params: c }), r.push({ id: X.id, params: l });
11757
11755
  }), {
11758
11756
  undos: s,
11759
11757
  redos: r
@@ -11779,8 +11777,8 @@ const eo = {
11779
11777
  ranges: u
11780
11778
  };
11781
11779
  c.push({ id: oe.id, params: m }), c.push({ id: ne.id, params: g });
11782
- const f = we(n, m), C = Te(n, g);
11783
- if (d.push({ id: oe.id, params: C }), d.push({ id: ne.id, params: f }), h) {
11780
+ const f = we(n, m), p = Te(n, g);
11781
+ if (d.push({ id: oe.id, params: p }), d.push({ id: ne.id, params: f }), h) {
11784
11782
  const S = vd(n, r, l, u);
11785
11783
  c.unshift(...S.redos), d.push(...S.undos);
11786
11784
  }
@@ -11851,7 +11849,7 @@ const eo = {
11851
11849
  }
11852
11850
  };
11853
11851
  function vh(n, e, t, o, s) {
11854
- const r = n.get(M), i = P(r, { unitId: e, subUnitId: t });
11852
+ const r = n.get(M), i = k(r, { unitId: e, subUnitId: t });
11855
11853
  if (!i) return;
11856
11854
  const { worksheet: a } = i;
11857
11855
  if (a.getMergeData().some((d) => o.some((h) => N.intersects(h, d))))
@@ -11885,7 +11883,7 @@ const _d = (n, e) => {
11885
11883
  id: "sheet.command.set-worksheet-right-to-left",
11886
11884
  handler: async (n, e) => {
11887
11885
  var d;
11888
- const t = n.get(E), o = n.get(V), s = P(n.get(M), e);
11886
+ const t = n.get(E), o = n.get(V), s = k(n.get(M), e);
11889
11887
  if (!s) return !1;
11890
11888
  const { unitId: r, subUnitId: i } = s;
11891
11889
  let a = te.FALSE;
@@ -11912,7 +11910,6 @@ const _d = (n, e) => {
11912
11910
  };
11913
11911
  export {
11914
11912
  no as AFTER_CELL_EDIT,
11915
- oo as AFTER_CELL_EDIT_ASYNC,
11916
11913
  mh as AddMergeRedoSelectionsOperationFactory,
11917
11914
  Te as AddMergeUndoMutationFactory,
11918
11915
  gh as AddMergeUndoSelectionsOperationFactory,
@@ -11967,18 +11964,18 @@ export {
11967
11964
  Bn as InsertColMutationUndoFactory,
11968
11965
  uu as InsertDefinedNameCommand,
11969
11966
  Ru as InsertMultiColsLeftCommand,
11970
- Cu as InsertMultiColsRightCommand,
11967
+ pu as InsertMultiColsRightCommand,
11971
11968
  hu as InsertMultiRowsAboveCommand,
11972
11969
  mu as InsertMultiRowsAfterCommand,
11973
11970
  rn as InsertRangeMoveDownCommand,
11974
11971
  zn as InsertRangeMoveRightCommand,
11975
11972
  du as InsertRowAfterCommand,
11976
11973
  cu as InsertRowBeforeCommand,
11977
- Cr as InsertRowByRangeCommand,
11974
+ pr as InsertRowByRangeCommand,
11978
11975
  Qe as InsertRowCommand,
11979
11976
  je as InsertRowMutation,
11980
11977
  wo as InsertRowMutationUndoFactory,
11981
- pu as InsertSheetCommand,
11978
+ Cu as InsertSheetCommand,
11982
11979
  Yt as InsertSheetMutation,
11983
11980
  $s as InsertSheetUndoMutationFactory,
11984
11981
  ta as InterceptCellContentPriority,
@@ -11994,8 +11991,8 @@ export {
11994
11991
  it as MoveRowsMutation,
11995
11992
  Su as MoveRowsMutationUndoFactory,
11996
11993
  go as NumfmtService,
11997
- X as OperatorType,
11998
- Ch as PermissionPointsDefinitions,
11994
+ q as OperatorType,
11995
+ ph as PermissionPointsDefinitions,
11999
11996
  za as REF_SELECTIONS_ENABLED,
12000
11997
  Qd as RangeMergeUtil,
12001
11998
  Rt as RangeProtectionCache,
@@ -12007,7 +12004,7 @@ export {
12007
12004
  nn as RangeProtectionRenderModel,
12008
12005
  me as RangeProtectionRuleModel,
12009
12006
  Wn as RangeProtectionService,
12010
- Ct as RangeThemeStyle,
12007
+ pt as RangeThemeStyle,
12011
12008
  Et as RefRangeService,
12012
12009
  ts as RefSelectionsService,
12013
12010
  Mu as RegisterWorksheetRangeThemeStyleCommand,
@@ -12037,7 +12034,7 @@ export {
12037
12034
  ch as SELECTION_CONTROL_BORDER_BUFFER_WIDTH,
12038
12035
  Ll as ScrollToCellOperation,
12039
12036
  tu as SelectRangeCommand,
12040
- pe as SelectionMoveType,
12037
+ Ce as SelectionMoveType,
12041
12038
  ol as SetBackgroundColorCommand,
12042
12039
  jd as SetBoldCommand,
12043
12040
  xu as SetBorderBasicCommand,
@@ -12067,7 +12064,7 @@ export {
12067
12064
  Ju as SetProtectionCommand,
12068
12065
  ge as SetRangeProtectionMutation,
12069
12066
  sn as SetRangeValuesCommand,
12070
- Z as SetRangeValuesMutation,
12067
+ X as SetRangeValuesMutation,
12071
12068
  be as SetRangeValuesUndoMutationFactory,
12072
12069
  qu as SetRowDataCommand,
12073
12070
  Bt as SetRowDataMutation,
@@ -12078,7 +12075,7 @@ export {
12078
12075
  Qt as SetRowVisibleMutation,
12079
12076
  Er as SetSelectedColsVisibleCommand,
12080
12077
  Nr as SetSelectedRowsVisibleCommand,
12081
- se as SetSelectionsOperation,
12078
+ re as SetSelectionsOperation,
12082
12079
  Xn as SetSpecificColsVisibleCommand,
12083
12080
  Zn as SetSpecificRowsVisibleCommand,
12084
12081
  Kd as SetStrikeThroughCommand,
@@ -12104,7 +12101,7 @@ export {
12104
12101
  Wo as SetWorksheetNameCommand,
12105
12102
  yn as SetWorksheetNameMutation,
12106
12103
  Lr as SetWorksheetOrderCommand,
12107
- Cn as SetWorksheetOrderMutation,
12104
+ pn as SetWorksheetOrderMutation,
12108
12105
  vl as SetWorksheetPermissionPointsCommand,
12109
12106
  $o as SetWorksheetPermissionPointsMutation,
12110
12107
  Ml as SetWorksheetProtectionCommand,
@@ -12138,6 +12135,7 @@ export {
12138
12135
  Ln as UniverSheetsPlugin,
12139
12136
  Al as UnregisterWorksheetRangeThemeStyleCommand,
12140
12137
  Po as UnregisterWorksheetRangeThemeStyleMutation,
12138
+ oo as VALIDATE_CELL,
12141
12139
  Yi as ViewStateEnum,
12142
12140
  Hs as WorkbookCommentPermission,
12143
12141
  Bs as WorkbookCopyPermission,
@@ -12184,17 +12182,17 @@ export {
12184
12182
  dr as WorksheetSortPermission,
12185
12183
  Gn as WorksheetViewPermission,
12186
12184
  vh as addMergeCellsUtil,
12187
- pc as adjustRangeOnMutation,
12185
+ Cc as adjustRangeOnMutation,
12188
12186
  jn as alignToMergedCellsBorders,
12189
12187
  ct as baseProtectionActions,
12190
12188
  Zo as checkCellValueType,
12191
- ph as checkRangesEditablePermission,
12189
+ Ch as checkRangesEditablePermission,
12192
12190
  md as convertPrimaryWithCoordToPrimary,
12193
12191
  hh as convertSelectionDataToRange,
12194
12192
  lt as copyRangeStyles,
12195
12193
  $l as createTopMatrixFromMatrix,
12196
12194
  Wl as createTopMatrixFromRanges,
12197
- Cl as defaultWorkbookPermissionPoints,
12195
+ pl as defaultWorkbookPermissionPoints,
12198
12196
  so as defaultWorksheetPermissionPoint,
12199
12197
  fh as expandToContinuousRange,
12200
12198
  th as factoryRemoveNumfmtUndoMutation,
@@ -12217,7 +12215,7 @@ export {
12217
12215
  mr as getRemoveRangeMutations,
12218
12216
  eu as getSelectionsService,
12219
12217
  rh as getSeparateEffectedRangesOnCommand,
12220
- P as getSheetCommandTarget,
12218
+ k as getSheetCommandTarget,
12221
12219
  Ia as getSheetCommandTargetWorkbook,
12222
12220
  kt as getSheetMutationTarget,
12223
12221
  lh as getSkeletonChangedEffectedRange,