@univerjs/sheets-formula 0.1.11 → 0.1.12

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,16 +1,16 @@
1
1
  var Vr = Object.defineProperty;
2
2
  var Hr = (r, e, t) => e in r ? Vr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var M = (r, e, t) => (Hr(r, typeof e != "symbol" ? e + "" : e, t), t);
4
- import { Disposable as te, ObjectMatrix as $, Dimension as hn, OnLifecycle as me, LifecycleStages as se, IUniverInstanceService as de, CellValueType as Tt, ThemeService as rn, ICommandService as oe, isFormulaString as ve, isFormulaId as ke, Tools as ne, Direction as V, CommandType as Ee, UniverInstanceType as G, toDisposable as Q, ColorKit as Vn, Rectangle as Ce, DEFAULT_EMPTY_DOCUMENT_VALUE as zr, isRealNum as Gr, getCellValueType as Xr, LocaleService as _e, FOCUSING_DOC as Yr, FOCUSING_UNIVER_EDITOR as Wr, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE as Kr, FOCUSING_EDITOR_INPUT_FORMULA as Ze, DisposableCollection as Hn, RANGE_TYPE as De, AbsoluteRefType as J, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as $r, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Qr, IContextService as jr, throttle as Jr, cellToRange as Zr, RxDisposable as ea, Plugin as ta } from "@univerjs/core";
4
+ import { Disposable as ne, ObjectMatrix as $, Dimension as hn, OnLifecycle as me, LifecycleStages as se, IUniverInstanceService as de, CellValueType as Tt, ThemeService as rn, ICommandService as oe, isFormulaString as ve, isFormulaId as ke, Tools as te, Direction as V, CommandType as Ee, UniverInstanceType as G, toDisposable as Q, ColorKit as Vn, Rectangle as Ce, DEFAULT_EMPTY_DOCUMENT_VALUE as zr, isRealNum as Gr, getCellValueType as Xr, LocaleService as _e, FOCUSING_DOC as Yr, FOCUSING_UNIVER_EDITOR as Wr, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE as Kr, FOCUSING_EDITOR_INPUT_FORMULA as et, DisposableCollection as Hn, RANGE_TYPE as De, AbsoluteRefType as J, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as $r, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Qr, IContextService as jr, throttle as Jr, cellToRange as Zr, RxDisposable as ea, Plugin as ta } from "@univerjs/core";
5
5
  import { Inject as B, Injector as gt, createIdentifier as Ot } from "@wendellhu/redi";
6
- import { SetDefinedNameMutation as En, RemoveDefinedNameMutation as Pn, FormulaDataModel as Xe, IActiveDirtyManagerService as an, IDefinedNamesService as zn, SetArrayFormulaDataMutation as St, LexerTreeBuilder as Ue, ErrorType as X, SetFormulaCalculationResultMutation as Gn, sequenceNodeType as ae, serializeRange as Ge, FUNCTION_NAMES_COMPATIBILITY as F, FunctionType as i, FUNCTION_NAMES_CUBE as Ie, FUNCTION_NAMES_DATABASE as re, FUNCTION_NAMES_DATE as H, FUNCTION_NAMES_ENGINEERING as g, FUNCTION_NAMES_FINANCIAL as D, FUNCTION_NAMES_INFORMATION as K, FUNCTION_NAMES_LOGICAL as j, FUNCTION_NAMES_LOOKUP as q, FUNCTION_NAMES_MATH as T, FUNCTION_NAMES_STATISTICAL as h, FUNCTION_NAMES_TEXT as x, FUNCTION_NAMES_WEB as Bt, isReferenceStrings as na, functionArray as ra, functionCompatibility as aa, functionCube as ia, functionDatabase as oa, functionDate as ua, functionEngineering as ca, functionFinancial as ma, functionInformation as sa, functionLogical as fa, functionLookup as la, functionMath as da, functionMeta as ba, functionStatistical as pa, functionText as ha, functionUniver as Ea, functionWeb as Pa, IFunctionService as Xn, ERROR_TYPE_SET as La, matchToken as ye, matchRefDrawToken as Ln, compareToken as kt, deserializeRangeWithSheet as Oe, normalizeSheetName as Aa, serializeRangeToRefString as mt, generateStringWithSequence as on, getAbsoluteRefTypeWitString as Ra, SetFormulaCalculationStartMutation as An, SetFormulaCalculationNotificationMutation as Ia, FormulaExecuteStageType as Ut, FormulaExecutedStateType as Be, SetFormulaDataMutation as et, initSheetFormulaData as Rn, RegisterFunctionMutation as Ta, UnregisterFunctionMutation as Sa, serializeRangeWithSpreadsheet as Na, serializeRangeWithSheet as Ca, SetOtherFormulaMutation as Da, RemoveOtherFormulaMutation as ga } from "@univerjs/engine-formula";
6
+ import { SetDefinedNameMutation as En, RemoveDefinedNameMutation as Pn, FormulaDataModel as Ye, IActiveDirtyManagerService as an, IDefinedNamesService as zn, SetArrayFormulaDataMutation as St, LexerTreeBuilder as Ue, ErrorType as X, SetFormulaCalculationResultMutation as Gn, sequenceNodeType as ae, serializeRange as Xe, FUNCTION_NAMES_COMPATIBILITY as F, FunctionType as i, FUNCTION_NAMES_CUBE as Ie, FUNCTION_NAMES_DATABASE as re, FUNCTION_NAMES_DATE as H, FUNCTION_NAMES_ENGINEERING as g, FUNCTION_NAMES_FINANCIAL as D, FUNCTION_NAMES_INFORMATION as K, FUNCTION_NAMES_LOGICAL as j, FUNCTION_NAMES_LOOKUP as q, FUNCTION_NAMES_MATH as T, FUNCTION_NAMES_STATISTICAL as h, FUNCTION_NAMES_TEXT as x, FUNCTION_NAMES_WEB as Bt, isReferenceStrings as na, functionArray as ra, functionCompatibility as aa, functionCube as ia, functionDatabase as oa, functionDate as ua, functionEngineering as ca, functionFinancial as ma, functionInformation as sa, functionLogical as fa, functionLookup as la, functionMath as da, functionMeta as ba, functionStatistical as pa, functionText as ha, functionUniver as Ea, functionWeb as Pa, IFunctionService as Xn, ERROR_TYPE_SET as La, matchToken as ye, matchRefDrawToken as Ln, compareToken as kt, deserializeRangeWithSheet as Oe, normalizeSheetName as Aa, serializeRangeToRefString as st, generateStringWithSequence as on, getAbsoluteRefTypeWitString as Ra, SetFormulaCalculationStartMutation as An, SetFormulaCalculationNotificationMutation as Ia, FormulaExecuteStageType as Ut, FormulaExecutedStateType as Be, SetFormulaDataMutation as tt, initSheetFormulaData as Rn, RegisterFunctionMutation as Ta, UnregisterFunctionMutation as Sa, serializeRangeWithSpreadsheet as Na, serializeRangeWithSheet as Ca, SetOtherFormulaMutation as Da, RemoveOtherFormulaMutation as ga } from "@univerjs/engine-formula";
7
7
  import { SetRangeValuesMutation as le, SetStyleCommand as un, MoveRangeMutation as In, MoveRowsMutation as Tn, MoveColsMutation as Sn, RemoveRowMutation as Nn, RemoveColMutation as Cn, RemoveSheetMutation as Wt, InsertSheetMutation as Kt, SetDefinedNameCommand as $t, INTERCEPTOR_POINT as cn, SheetInterceptorService as vt, SetRangeValuesUndoMutationFactory as Oa, SetRangeValuesCommand as va, SelectionManagerService as mn, getSheetCommandTarget as _a, getCellAtRowCol as Ma, SetSelectionsOperation as xa, NORMAL_SELECTION_PLUGIN_NAME as Ne, getCurrentSheetDisabled$ as ya, convertSelectionDataToRange as Ft, getNormalSelectionStyle as Ba, setEndForRange as ka, getPrimaryForRange as Ua, SetBorderCommand as Yn, ClearSelectionFormatCommand as Wn, INumfmtService as Fa, handleMoveRange as Kn, EffectRefRangId as Y, runRefRangeMutations as W, handleMoveRows as $n, handleMoveCols as Qn, handleInsertRow as jn, handleInsertCol as Jn, handleIRemoveRow as Zn, handleIRemoveCol as er, handleDeleteRangeMoveLeft as tr, handleDeleteRangeMoveUp as nr, handleInsertRangeMoveDown as rr, handleInsertRangeMoveRight as ar, RemoveSheetCommand as qa, SetWorksheetNameCommand as wa, DeleteRangeMoveLeftCommand as Va, DeleteRangeMoveUpCommand as Ha, RemoveColCommand as za, RemoveRowCommand as Ga, InsertRangeMoveDownCommand as Xa, InsertRangeMoveRightCommand as Ya, InsertColCommand as Wa, InsertRowCommand as Ka, MoveColsCommand as $a, MoveRowsCommand as Qa, MoveRangeCommand as ja, SetWorksheetActiveOperation as Ja, InsertDefinedNameCommand as Za, RemoveDefinedNameCommand as ei, RefRangeService as ti, handleDefaultRangeChangeWithEffectRefCommands as ni } from "@univerjs/sheets";
8
- import { DATA_TYPE as Dn, APPLY_TYPE as ri, IAutoFillService as ai, SheetPasteCommand as ii, COPY_TYPE as ir, PREDEFINED_HOOK_NAME as oi, ISheetClipboardService as ui, SelectionShape as ci, IEditorBridgeService as or, SheetSkeletonManagerService as sn, ISelectionRenderService as ur, useActiveWorkbook as mi, PASTE_SPECIAL_MENU_ID as si, whenFormulaEditorActivated as Ye, getEditorObject as gn, MoveSelectionCommand as tt, JumpOver as On, ExpandSelectionCommand as vn, CellAlertType as fi, HoverManagerService as li, CellAlertManagerService as di } from "@univerjs/sheets-ui";
8
+ import { DATA_TYPE as Dn, APPLY_TYPE as ri, IAutoFillService as ai, SheetPasteCommand as ii, COPY_TYPE as ir, PREDEFINED_HOOK_NAME as oi, ISheetClipboardService as ui, SelectionShape as ci, IEditorBridgeService as or, SheetSkeletonManagerService as sn, ISelectionRenderService as ur, useActiveWorkbook as mi, PASTE_SPECIAL_MENU_ID as si, whenFormulaEditorActivated as We, getEditorObject as gn, MoveSelectionCommand as nt, JumpOver as On, ExpandSelectionCommand as vn, CellAlertType as fi, HoverManagerService as li, CellAlertManagerService as di } from "@univerjs/sheets-ui";
9
9
  import { IRenderManagerService as fn, DeviceInputEventType as fe, getCellInfoInMergeData as bi, ITextSelectionRenderManager as pi } from "@univerjs/engine-render";
10
- import { IEditorService as We, ISidebarService as hi, MenuGroup as Ei, MenuItemType as ln, MenuPosition as Pi, getMenuHiddenObservable as Li, IClipboardInterfaceService as Ai, KeyCode as w, MetaKeys as Ae, DesktopUIPart as Ri, ComponentManager as Ii, IMenuService as Ti, IShortcutService as Si, IUIController as Ni, SetEditorResizeOperation as Ci, IContextMenuService as Di, IProgressService as gi } from "@univerjs/ui";
10
+ import { IEditorService as Ke, ISidebarService as hi, MenuGroup as Ei, MenuItemType as ln, MenuPosition as Pi, getMenuHiddenObservable as Li, IClipboardInterfaceService as Ai, KeyCode as w, MetaKeys as Ae, ComponentManager as Ri, BuiltInUIPart as Ii, IMenuService as Ti, IShortcutService as Si, IUIPartsService as Ni, SetEditorResizeOperation as Ci, IContextMenuService as Di, IProgressService as gi } from "@univerjs/ui";
11
11
  import { useDependency as ce, connectInjector as Oi } from "@wendellhu/redi/react-bindings";
12
- import { Subject as ge, Observable as vi, merge as _n, map as st, bufferTime as _i, filter as Mi } from "rxjs";
13
- import xi, { forwardRef as Ke, useRef as cr, createElement as $e, useState as z, useEffect as Nt } from "react";
12
+ import { Subject as ge, Observable as vi, merge as _n, map as ft, bufferTime as _i, filter as Mi } from "rxjs";
13
+ import xi, { forwardRef as $e, useRef as cr, createElement as Qe, useState as z, useEffect as Nt } from "react";
14
14
  import { Popup as mr, Select as yi, Input as Bi, Button as qt } from "@univerjs/design";
15
15
  import { ReplaceContentCommand as ki, MoveCursorOperation as Ui, TextSelectionManagerService as Fi, DocViewModelManagerService as qi } from "@univerjs/docs";
16
16
  const sr = "formula-ui";
@@ -18,8 +18,8 @@ var wi = Object.defineProperty, Vi = Object.getOwnPropertyDescriptor, Hi = (r, e
18
18
  for (var a = n > 1 ? void 0 : n ? Vi(e, t) : e, o = r.length - 1, u; o >= 0; o--)
19
19
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
20
20
  return n && a && wi(e, t, a), a;
21
- }, nt = (r, e) => (t, n) => e(t, n, r);
22
- let ft = class extends te {
21
+ }, rt = (r, e) => (t, n) => e(t, n, r);
22
+ let lt = class extends ne {
23
23
  constructor(r, e, t, n) {
24
24
  super(), this._activeDirtyManagerService = r, this._univerInstanceService = e, this._formulaDataModel = t, this._definedNamesService = n, this._initialize();
25
25
  }
@@ -136,29 +136,29 @@ let ft = class extends te {
136
136
  return o.push(...this._getDirtyRangesByCellValue(t, e, u)), o.push(...this._getDirtyRangesByCellValue(t, e, c)), o.push(...this._getDirtyRangesForArrayFormula(t, e, c)), o;
137
137
  }
138
138
  _getDeleteRangeMutationDirtyRange(r) {
139
- const { subUnitId: e, unitId: t, range: n, shiftDimension: a } = r, o = [], u = this._univerInstanceService.getUniverSheetInstance(t), c = u == null ? void 0 : u.getSheetBySheetId(e), m = (c == null ? void 0 : c.getLastRowWithContent()) || 0, s = (c == null ? void 0 : c.getLastColumnWithContent()) || 0, d = new $();
139
+ const { subUnitId: e, unitId: t, range: n, shiftDimension: a } = r, o = [], u = this._univerInstanceService.getUniverSheetInstance(t), c = u == null ? void 0 : u.getSheetBySheetId(e), m = (c == null ? void 0 : c.getLastRowWithContent()) || 0, s = (c == null ? void 0 : c.getLastColumnWithContent()) || 0, l = new $();
140
140
  let f = null;
141
- const { startRow: l, startColumn: E, endRow: P, endColumn: R } = n;
141
+ const { startRow: d, startColumn: E, endRow: P, endColumn: R } = n;
142
142
  a === hn.ROWS ? f = this._rangeToMatrix({
143
- startRow: l,
143
+ startRow: d,
144
144
  startColumn: E,
145
145
  endRow: m,
146
146
  endColumn: R
147
147
  }) : a === hn.COLUMNS && (f = this._rangeToMatrix({
148
- startRow: l,
148
+ startRow: d,
149
149
  startColumn: E,
150
150
  endRow: P,
151
151
  endColumn: s
152
- })), f != null && d.merge(f);
153
- const b = d.getData();
152
+ })), f != null && l.merge(f);
153
+ const b = l.getData();
154
154
  return o.push(...this._getDirtyRangesByCellValue(t, e, b)), o.push(...this._getDirtyRangesForArrayFormula(t, e, b)), o;
155
155
  }
156
156
  _getRemoveRowOrColumnMutation(r, e = !0) {
157
- const { subUnitId: t, unitId: n, range: a } = r, o = [], u = this._univerInstanceService.getUniverSheetInstance(n), c = u == null ? void 0 : u.getSheetBySheetId(t), m = (c == null ? void 0 : c.getRowCount()) || 0, s = (c == null ? void 0 : c.getColumnCount()) || 0, d = new $();
157
+ const { subUnitId: t, unitId: n, range: a } = r, o = [], u = this._univerInstanceService.getUniverSheetInstance(n), c = u == null ? void 0 : u.getSheetBySheetId(t), m = (c == null ? void 0 : c.getRowCount()) || 0, s = (c == null ? void 0 : c.getColumnCount()) || 0, l = new $();
158
158
  let f = null;
159
- const { startRow: l, endRow: E, startColumn: P, endColumn: R } = a;
159
+ const { startRow: d, endRow: E, startColumn: P, endColumn: R } = a;
160
160
  e === !0 ? f = this._rangeToMatrix({
161
- startRow: l,
161
+ startRow: d,
162
162
  startColumn: 0,
163
163
  endRow: E,
164
164
  endColumn: s - 1
@@ -167,8 +167,8 @@ let ft = class extends te {
167
167
  startColumn: P,
168
168
  endRow: m,
169
169
  endColumn: R
170
- }), f != null && d.merge(f);
171
- const b = d.getData();
170
+ }), f != null && l.merge(f);
171
+ const b = l.getData();
172
172
  return o.push(...this._getDirtyRangesByCellValue(n, t, b)), o.push(...this._getDirtyRangesForArrayFormula(n, t, b)), o;
173
173
  }
174
174
  _getRemoveSheetMutation(r) {
@@ -204,12 +204,12 @@ let ft = class extends te {
204
204
  const a = new $(t), o = this._formulaDataModel.getArrayFormulaRange();
205
205
  if ((u = o == null ? void 0 : o[r]) != null && u[e]) {
206
206
  const m = new $((c = o == null ? void 0 : o[r]) == null ? void 0 : c[e]);
207
- a.forValue((s, d) => {
208
- m.forValue((f, l, E) => {
207
+ a.forValue((s, l) => {
208
+ m.forValue((f, d, E) => {
209
209
  if (E == null)
210
210
  return !0;
211
211
  const { startRow: P, startColumn: R, endRow: b, endColumn: S } = E;
212
- s >= P && s <= b && d >= R && d <= S && n.push({
212
+ s >= P && s <= b && l >= R && l <= S && n.push({
213
213
  unitId: r,
214
214
  sheetId: e,
215
215
  range: {
@@ -225,19 +225,19 @@ let ft = class extends te {
225
225
  return n;
226
226
  }
227
227
  };
228
- ft = Hi([
229
- me(se.Ready, ft),
230
- nt(0, an),
231
- nt(1, de),
232
- nt(2, B(Xe)),
233
- nt(3, zn)
234
- ], ft);
228
+ lt = Hi([
229
+ me(se.Ready, lt),
230
+ rt(0, an),
231
+ rt(1, de),
232
+ rt(2, B(Ye)),
233
+ rt(3, zn)
234
+ ], lt);
235
235
  var zi = Object.defineProperty, Gi = Object.getOwnPropertyDescriptor, Xi = (r, e, t, n) => {
236
236
  for (var a = n > 1 ? void 0 : n ? Gi(e, t) : e, o = r.length - 1, u; o >= 0; o--)
237
237
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
238
238
  return n && a && zi(e, t, a), a;
239
- }, rt = (r, e) => (t, n) => e(t, n, r);
240
- let lt = class extends te {
239
+ }, at = (r, e) => (t, n) => e(t, n, r);
240
+ let dt = class extends ne {
241
241
  constructor(r, e, t, n) {
242
242
  super(), this._commandService = r, this._sheetInterceptorService = e, this._formulaDataModel = t, this._themeService = n, this._initialize();
243
243
  }
@@ -262,8 +262,8 @@ let lt = class extends te {
262
262
  this._sheetInterceptorService.intercept(cn.CELL_CONTENT, {
263
263
  priority: 100,
264
264
  handler: (r, e, t) => {
265
- var s, d, f;
266
- const { unitId: n, subUnitId: a, row: o, col: u } = e, c = this._formulaDataModel.getArrayFormulaCellData(), m = (f = (d = (s = c == null ? void 0 : c[n]) == null ? void 0 : s[a]) == null ? void 0 : d[o]) == null ? void 0 : f[u];
265
+ var s, l, f;
266
+ const { unitId: n, subUnitId: a, row: o, col: u } = e, c = this._formulaDataModel.getArrayFormulaCellData(), m = (f = (l = (s = c == null ? void 0 : c[n]) == null ? void 0 : s[a]) == null ? void 0 : l[o]) == null ? void 0 : f[u];
267
267
  return m == null ? t(r) : m.v == null && m.t == null ? t({
268
268
  ...r,
269
269
  ...m,
@@ -276,19 +276,19 @@ let lt = class extends te {
276
276
  );
277
277
  }
278
278
  };
279
- lt = Xi([
280
- me(se.Ready, lt),
281
- rt(0, oe),
282
- rt(1, B(vt)),
283
- rt(2, B(Xe)),
284
- rt(3, B(rn))
285
- ], lt);
279
+ dt = Xi([
280
+ me(se.Ready, dt),
281
+ at(0, oe),
282
+ at(1, B(vt)),
283
+ at(2, B(Ye)),
284
+ at(3, B(rn))
285
+ ], dt);
286
286
  var Yi = Object.defineProperty, Wi = Object.getOwnPropertyDescriptor, Ki = (r, e, t, n) => {
287
287
  for (var a = n > 1 ? void 0 : n ? Wi(e, t) : e, o = r.length - 1, u; o >= 0; o--)
288
288
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
289
289
  return n && a && Yi(e, t, a), a;
290
290
  }, Mn = (r, e) => (t, n) => e(t, n, r);
291
- let dt = class extends te {
291
+ let bt = class extends ne {
292
292
  constructor(r, e) {
293
293
  super(), this._autoFillService = r, this._lexerTreeBuilder = e, this._initialize();
294
294
  }
@@ -313,37 +313,37 @@ let dt = class extends te {
313
313
  _fillCopyFormula(r, e, t, n, a) {
314
314
  var m, s;
315
315
  const o = Qi(a), u = [], c = /* @__PURE__ */ new Map();
316
- for (let d = 1; d <= e; d++) {
317
- const f = (d - 1) % r.length, l = ne.deepClone(r[f]);
318
- if (l) {
316
+ for (let l = 1; l <= e; l++) {
317
+ const f = (l - 1) % r.length, d = te.deepClone(r[f]);
318
+ if (d) {
319
319
  const E = ((m = r[f]) == null ? void 0 : m.f) || "", P = ((s = r[f]) == null ? void 0 : s.si) || "", R = ve(E);
320
320
  if (ke(P))
321
- l.si = P, l.f = null, l.v = null, l.p = null, t === V.DOWN || t === V.RIGHT ? u.push(l) : u.unshift(l);
321
+ d.si = P, d.f = null, d.v = null, d.p = null, t === V.DOWN || t === V.RIGHT ? u.push(d) : u.unshift(d);
322
322
  else if (R) {
323
323
  let S = c.get(f);
324
324
  if (S)
325
- l.si = S, l.f = null, l.v = null, l.p = null;
325
+ d.si = S, d.f = null, d.v = null, d.p = null;
326
326
  else {
327
- S = ne.generateRandomId(6), c.set(f, S);
327
+ S = te.generateRandomId(6), c.set(f, S);
328
328
  const { offsetX: L, offsetY: p } = $i(o, t), C = this._lexerTreeBuilder.moveFormulaRefOffset(
329
329
  E,
330
330
  L,
331
331
  p
332
332
  );
333
- l.si = S, l.f = C, l.v = null, l.p = null;
333
+ d.si = S, d.f = C, d.v = null, d.p = null;
334
334
  }
335
- t === V.DOWN || t === V.RIGHT ? u.push(l) : u.unshift(l);
335
+ t === V.DOWN || t === V.RIGHT ? u.push(d) : u.unshift(d);
336
336
  }
337
337
  }
338
338
  }
339
339
  return u;
340
340
  }
341
341
  };
342
- dt = Ki([
343
- me(se.Ready, dt),
342
+ bt = Ki([
343
+ me(se.Ready, bt),
344
344
  Mn(0, ai),
345
345
  Mn(1, B(Ue))
346
- ], dt);
346
+ ], bt);
347
347
  function $i(r, e) {
348
348
  let t = 0, n = 0;
349
349
  switch (e) {
@@ -381,9 +381,9 @@ var ji = Object.defineProperty, Ji = Object.getOwnPropertyDescriptor, Zi = (r, e
381
381
  for (var a = n > 1 ? void 0 : n ? Ji(e, t) : e, o = r.length - 1, u; o >= 0; o--)
382
382
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
383
383
  return n && a && ji(e, t, a), a;
384
- }, at = (r, e) => (t, n) => e(t, n, r);
384
+ }, it = (r, e) => (t, n) => e(t, n, r);
385
385
  const eo = "default-paste-formula";
386
- let bt = class extends te {
386
+ let pt = class extends ne {
387
387
  constructor(r, e, t, n) {
388
388
  super(), this._currentUniverSheet = r, this._lexerTreeBuilder = e, this._sheetClipboardService = t, this._injector = n, this._initialize();
389
389
  }
@@ -413,10 +413,10 @@ let bt = class extends te {
413
413
  copyType: n.copyType || ir.COPY,
414
414
  copyRange: r == null ? void 0 : r.range,
415
415
  pasteType: n.pasteType
416
- }, u = e.range, c = t, m = this._currentUniverSheet.getCurrentUnitForType(G.UNIVER_SHEET), s = m.getUnitId(), d = m.getActiveSheet().getSheetId();
416
+ }, u = e.range, c = t, m = this._currentUniverSheet.getCurrentUnitForType(G.UNIVER_SHEET), s = m.getUnitId(), l = m.getActiveSheet().getSheetId();
417
417
  return this._injector.invoke((f) => to(
418
418
  s,
419
- d,
419
+ l,
420
420
  u,
421
421
  c,
422
422
  f,
@@ -426,45 +426,45 @@ let bt = class extends te {
426
426
  ));
427
427
  }
428
428
  };
429
- bt = Zi([
430
- me(se.Ready, bt),
431
- at(0, de),
432
- at(1, B(Ue)),
433
- at(2, ui),
434
- at(3, B(gt))
435
- ], bt);
429
+ pt = Zi([
430
+ me(se.Ready, pt),
431
+ it(0, de),
432
+ it(1, B(Ue)),
433
+ it(2, ui),
434
+ it(3, B(gt))
435
+ ], pt);
436
436
  function to(r, e, t, n, a, o, u, c = !1) {
437
- const m = [], s = [], d = new $(), f = /* @__PURE__ */ new Map();
438
- let l = 0, E = 0;
437
+ const m = [], s = [], l = new $(), f = /* @__PURE__ */ new Map();
438
+ let d = 0, E = 0;
439
439
  if (o && o.copyRange) {
440
440
  const { copyType: b, copyRange: S } = o;
441
- b === ir.COPY && S && (l = S.rows.length, E = S.cols.length);
441
+ b === ir.COPY && S && (d = S.rows.length, E = S.cols.length);
442
442
  }
443
443
  n.forValue((b, S, L) => {
444
444
  var v, O;
445
445
  const p = L.f || "", C = L.si || "";
446
446
  let A = {};
447
- if (c && (A = ne.deepClone(L)), !(!l || !E)) {
447
+ if (c && (A = te.deepClone(L)), !(!d || !E)) {
448
448
  if (ke(C))
449
449
  A.si = C, A.f = null, A.v = null, A.p = null;
450
450
  else if (ve(p) && o.pasteType === oi.DEFAULT_PASTE) {
451
- const y = b % l, _ = S % E, U = `${y}_${_}`;
451
+ const y = b % d, _ = S % E, U = `${y}_${_}`;
452
452
  let I = f.get(U);
453
453
  if (I)
454
454
  A.si = I, A.f = null, A.v = null, A.p = null;
455
455
  else {
456
- I = ne.generateRandomId(6), f.set(U, I);
457
- const k = o != null && o.copyRange ? (v = o == null ? void 0 : o.copyRange) == null ? void 0 : v.cols[_] : _, be = o != null && o.copyRange ? (O = o == null ? void 0 : o.copyRange) == null ? void 0 : O.rows[y] : y, ue = t.cols[S] - k, Re = t.rows[b] - be, Je = u.moveFormulaRefOffset(p, ue, Re);
458
- A.si = I, A.f = Je, A.v = null, A.p = null;
456
+ I = te.generateRandomId(6), f.set(U, I);
457
+ const k = o != null && o.copyRange ? (v = o == null ? void 0 : o.copyRange) == null ? void 0 : v.cols[_] : _, be = o != null && o.copyRange ? (O = o == null ? void 0 : o.copyRange) == null ? void 0 : O.rows[y] : y, ue = t.cols[S] - k, Re = t.rows[b] - be, Ze = u.moveFormulaRefOffset(p, ue, Re);
458
+ A.si = I, A.f = Ze, A.v = null, A.p = null;
459
459
  }
460
460
  }
461
- d.setValue(t.rows[b], t.cols[S], A);
461
+ l.setValue(t.rows[b], t.cols[S], A);
462
462
  }
463
463
  });
464
464
  const P = {
465
465
  unitId: r,
466
466
  subUnitId: e,
467
- cellValue: d.getData()
467
+ cellValue: l.getData()
468
468
  };
469
469
  m.push({
470
470
  id: le.id,
@@ -487,11 +487,11 @@ var no = Object.defineProperty, ro = Object.getOwnPropertyDescriptor, ao = (r, e
487
487
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
488
488
  return n && a && no(e, t, a), a;
489
489
  }, pe = (r, e) => (t, n) => e(t, n, r);
490
- let Ct = class extends te {
491
- constructor(e, t, n, a, o, u, c, m, s, d) {
490
+ let Ct = class extends ne {
491
+ constructor(e, t, n, a, o, u, c, m, s, l) {
492
492
  super();
493
493
  M(this, "_previousShape");
494
- this._context = e, this._editorBridgeService = t, this._formulaDataModel = n, this._lexerTreeBuilder = a, this._themeService = o, this._renderManagerService = u, this._selectionRenderService = c, this._sheetSkeletonManagerService = m, this._commandService = s, this._sheetInterceptorService = d, this._initInterceptorEditorStart(), this._commandExecutedListener(), this._initInterceptorCell();
494
+ this._context = e, this._editorBridgeService = t, this._formulaDataModel = n, this._lexerTreeBuilder = a, this._themeService = o, this._renderManagerService = u, this._selectionRenderService = c, this._sheetSkeletonManagerService = m, this._commandService = s, this._sheetInterceptorService = l, this._initInterceptorEditorStart(), this._commandExecutedListener(), this._initInterceptorCell();
495
495
  }
496
496
  _initInterceptorEditorStart() {
497
497
  this.disposeWithMe(
@@ -501,12 +501,12 @@ let Ct = class extends te {
501
501
  {
502
502
  handler: (e, t, n) => {
503
503
  var P, R, b, S;
504
- const { row: a, col: o, unitId: u, subUnitId: c, worksheet: m } = t, s = this._formulaDataModel.getArrayFormulaRange(), d = this._formulaDataModel.getArrayFormulaCellData();
504
+ const { row: a, col: o, unitId: u, subUnitId: c, worksheet: m } = t, s = this._formulaDataModel.getArrayFormulaRange(), l = this._formulaDataModel.getArrayFormulaCellData();
505
505
  if (this._removeArrayFormulaRangeShape(), e == null)
506
506
  return n(e);
507
507
  let f = null;
508
- const l = this._formulaDataModel.getFormulaStringByCell(a, o, c, u);
509
- if (l !== null && (f = { f: l }), e.v != null && e.v !== "" && ((b = (R = (P = d[u]) == null ? void 0 : P[c]) == null ? void 0 : R[a]) == null ? void 0 : b[o]) == null)
508
+ const d = this._formulaDataModel.getFormulaStringByCell(a, o, c, u);
509
+ if (d !== null && (f = { f: d }), e.v != null && e.v !== "" && ((b = (R = (P = l[u]) == null ? void 0 : P[c]) == null ? void 0 : R[a]) == null ? void 0 : b[o]) == null)
510
510
  return f ? { ...e, ...f } : n(e);
511
511
  const E = (S = s == null ? void 0 : s[u]) == null ? void 0 : S[c];
512
512
  return E != null && new $(E).forValue((L, p, C) => {
@@ -571,8 +571,8 @@ let Ct = class extends te {
571
571
  }), s = (E = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : E.skeleton;
572
572
  if (!u || !s)
573
573
  return;
574
- const { rowHeaderWidth: d, columnHeaderHeight: f } = s, l = new ci(u, 100, !1, this._themeService);
575
- l.update(c, d, f, o, m), l.setEvent(!1), this._previousShape = l;
574
+ const { rowHeaderWidth: l, columnHeaderHeight: f } = s, d = new ci(u, 100, !1, this._themeService);
575
+ d.update(c, l, f, o, m), d.setEvent(!1), this._previousShape = d;
576
576
  }
577
577
  _removeArrayFormulaRangeShape() {
578
578
  this._previousShape != null && (this._previousShape.dispose(), this._previousShape = null);
@@ -580,7 +580,7 @@ let Ct = class extends te {
580
580
  };
581
581
  Ct = ao([
582
582
  pe(1, B(or)),
583
- pe(2, B(Xe)),
583
+ pe(2, B(Ye)),
584
584
  pe(3, B(Ue)),
585
585
  pe(4, B(rn)),
586
586
  pe(5, fn),
@@ -595,16 +595,16 @@ const dr = {
595
595
  handler: async (r, e) => {
596
596
  const { list: t } = e, n = r.get(oe), a = new $();
597
597
  t.forEach((u) => {
598
- const { range: c, primary: m, formula: s } = u, { row: d, column: f } = m, l = ne.generateRandomId(6);
599
- a.setValue(d, f, {
598
+ const { range: c, primary: m, formula: s } = u, { row: l, column: f } = m, d = te.generateRandomId(6);
599
+ a.setValue(l, f, {
600
600
  f: s,
601
- si: l
601
+ si: d
602
602
  });
603
603
  const { startRow: E, startColumn: P, endRow: R, endColumn: b } = c;
604
604
  for (let S = E; S <= R; S++)
605
605
  for (let L = P; L <= b; L++)
606
- (S !== d || L !== f) && a.setValue(S, L, {
607
- si: l
606
+ (S !== l || L !== f) && a.setValue(S, L, {
607
+ si: d
608
608
  });
609
609
  });
610
610
  const o = {
@@ -819,27 +819,27 @@ const Qt = {
819
819
  type: Ee.OPERATION,
820
820
  handler: async (r, e) => {
821
821
  var S, L;
822
- const t = r.get(mn), n = r.get(We), a = t.getSelections();
822
+ const t = r.get(mn), n = r.get(Ke), a = t.getSelections();
823
823
  if (!a || !a.length)
824
824
  return !1;
825
825
  const o = _a(r.get(de));
826
826
  if (!o)
827
827
  return !1;
828
- const { worksheet: u, unitId: c, subUnitId: m } = o, s = u.getCellMatrix(), { value: d } = e, f = r.get(oe), l = [];
828
+ const { worksheet: u, unitId: c, subUnitId: m } = o, s = u.getCellMatrix(), { value: l } = e, f = r.get(oe), d = [];
829
829
  let E = null, P = 0, R = 0, b = "";
830
830
  if (a.length === 1 && (co(a[0].range) || mo(a[0].range))) {
831
831
  const { range: p, primary: C } = a[0], A = (S = C == null ? void 0 : C.actualRow) != null ? S : p.startRow, v = (L = C == null ? void 0 : C.actualColumn) != null ? L : p.startColumn;
832
832
  E = p, P = A, R = v;
833
833
  const O = xn(s, A, v);
834
- O && (b = Ge(O));
834
+ O && (b = Xe(O));
835
835
  } else
836
836
  a.some((p) => {
837
837
  var I, k;
838
838
  const { range: C, primary: A } = p, v = (I = A == null ? void 0 : A.actualRow) != null ? I : C.startRow, O = (k = A == null ? void 0 : A.actualColumn) != null ? k : C.startColumn, y = xn(s, v, O);
839
839
  if (!y)
840
840
  return E = C, P = v, R = O, !0;
841
- const _ = Ge(y), U = `=${d}(${_})`;
842
- return l.push({
841
+ const _ = Xe(y), U = `=${l}(${_})`;
842
+ return d.push({
843
843
  range: C,
844
844
  primary: {
845
845
  row: v,
@@ -868,11 +868,11 @@ const Qt = {
868
868
  selections: [C]
869
869
  };
870
870
  await f.executeCommand(xa.id, A), setTimeout(() => {
871
- n.setFormula(`=${d}(${b}`);
871
+ n.setFormula(`=${l}(${b}`);
872
872
  }, 0);
873
873
  }
874
- return l.length === 0 ? !1 : f.executeCommand(dr.id, {
875
- list: l
874
+ return d.length === 0 ? !1 : f.executeCommand(dr.id, {
875
+ list: d
876
876
  });
877
877
  }
878
878
  };
@@ -1005,12 +1005,12 @@ var N = hr.exports, ie = function() {
1005
1005
  for (var a = 0, n = Object.getOwnPropertySymbols(r); a < n.length; a++)
1006
1006
  e.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(r, n[a]) && (t[n[a]] = r[n[a]]);
1007
1007
  return t;
1008
- }, Qe = Ke(function(r, e) {
1008
+ }, je = $e(function(r, e) {
1009
1009
  var t = r.icon, n = r.id, a = r.className, o = r.extend, u = Eo(r, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(n, " ").concat(a || "").trim(), m = cr("_".concat(Ao()));
1010
1010
  return Pr(t, "".concat(n), { defIds: t.defIds, idSuffix: m.current }, ie({ ref: e, className: c }, u), o);
1011
1011
  });
1012
1012
  function Pr(r, e, t, n, a) {
1013
- return $e(r.tag, ie(ie({ key: e }, Po(r, t, a)), n), (Lo(r, t).children || []).map(function(o, u) {
1013
+ return Qe(r.tag, ie(ie({ key: e }, Po(r, t, a)), n), (Lo(r, t).children || []).map(function(o, u) {
1014
1014
  return Pr(o, "".concat(e, "-").concat(r.tag, "-").concat(u), t, void 0, a);
1015
1015
  }));
1016
1016
  }
@@ -1032,9 +1032,9 @@ function Lo(r, e) {
1032
1032
  function Ao() {
1033
1033
  return Math.random().toString(36).substring(2, 8);
1034
1034
  }
1035
- Qe.displayName = "UniverIcon";
1036
- var Ro = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.44 3.57291C14.698 3.83093 14.698 4.24927 14.44 4.50729L6.44342 12.5037C6.28721 12.6599 6.03395 12.6599 5.87774 12.5037L1.55992 8.18578C1.3019 7.92776 1.3019 7.50942 1.55993 7.2514C1.81795 6.99338 2.23629 6.99338 2.49431 7.25141L6.01916 10.7763C6.09727 10.8544 6.2239 10.8544 6.30201 10.7763L13.5056 3.57291C13.7636 3.31489 14.1819 3.31489 14.44 3.57291Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Lr = Ke(function(r, e) {
1037
- return $e(Qe, Object.assign({}, r, {
1035
+ je.displayName = "UniverIcon";
1036
+ var Ro = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Lr = $e(function(r, e) {
1037
+ return Qe(je, Object.assign({}, r, {
1038
1038
  id: "check-mark-single",
1039
1039
  ref: e,
1040
1040
  icon: Ro
@@ -1042,8 +1042,8 @@ var Ro = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em"
1042
1042
  });
1043
1043
  Lr.displayName = "CheckMarkSingle";
1044
1044
  const Io = Lr;
1045
- var To = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M4.57061 3.65132C4.31677 3.39748 3.90521 3.39748 3.65137 3.65132C3.39753 3.90516 3.39753 4.31672 3.65137 4.57056L7.08079 7.99998L3.65123 11.4295C3.39739 11.6834 3.39739 12.0949 3.65123 12.3488C3.90507 12.6026 4.31662 12.6026 4.57047 12.3488L8.00003 8.91921L11.4295 12.3487C11.6834 12.6026 12.0949 12.6026 12.3488 12.3487C12.6026 12.0949 12.6026 11.6833 12.3488 11.4295L8.91927 7.99998L12.3486 4.57061C12.6025 4.31677 12.6025 3.90521 12.3486 3.65137C12.0948 3.39753 11.6832 3.39753 11.4294 3.65137L8.00003 7.08074L4.57061 3.65132Z" } }] }, Ar = Ke(function(r, e) {
1046
- return $e(Qe, Object.assign({}, r, {
1045
+ var To = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z" } }] }, Ar = $e(function(r, e) {
1046
+ return Qe(je, Object.assign({}, r, {
1047
1047
  id: "close-single",
1048
1048
  ref: e,
1049
1049
  icon: To
@@ -1051,8 +1051,8 @@ var To = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em"
1051
1051
  });
1052
1052
  Ar.displayName = "CloseSingle";
1053
1053
  const So = Ar;
1054
- var No = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_102_891", style: { maskType: "alpha" }, width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#DCDCDC", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { fill: "currentColor", mask: "url(#mask0_102_891)" }, children: [{ tag: "path", attrs: { d: "M8.7965 5.29175C8.7965 5.73167 8.43988 6.08829 7.99996 6.08829 7.56005 6.08829 7.20343 5.73167 7.20343 5.29175 7.20343 4.85184 7.56005 4.49522 7.99996 4.49522 8.43988 4.49522 8.7965 4.85184 8.7965 5.29175zM8.63719 7.68135C8.63719 7.32942 8.35189 7.04413 7.99996 7.04413 7.64803 7.04413 7.36274 7.32942 7.36274 7.68135V11.5047C7.36274 11.8566 7.64803 12.1419 7.99996 12.1419 8.35189 12.1419 8.63719 11.8566 8.63719 11.5047V7.68135z" } }, { tag: "path", attrs: { d: "M0.990479 7.99996C0.990479 4.12873 4.12873 0.990479 7.99996 0.990479C11.8712 0.990479 15.0094 4.12873 15.0094 7.99996C15.0094 11.8712 11.8712 15.0094 7.99996 15.0094C4.12873 15.0094 0.990479 11.8712 0.990479 7.99996ZM7.99996 2.26493C4.83259 2.26493 2.26493 4.83259 2.26493 7.99996C2.26493 11.1673 4.83259 13.735 7.99996 13.735C11.1673 13.735 13.735 11.1673 13.735 7.99996C13.735 4.83259 11.1673 2.26493 7.99996 2.26493Z", fillRule: "evenodd", clipRule: "evenodd" } }] }] }, Rr = Ke(function(r, e) {
1055
- return $e(Qe, Object.assign({}, r, {
1054
+ var No = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.75 5.32495C8.75 5.73916 8.41421 6.07495 8 6.07495 7.58579 6.07495 7.25 5.73916 7.25 5.32495 7.25 4.91074 7.58579 4.57495 8 4.57495 8.41421 4.57495 8.75 4.91074 8.75 5.32495zM8.5999 7.52505C8.5999 7.19368 8.33127 6.92505 7.9999 6.92505 7.66853 6.92505 7.3999 7.19368 7.3999 7.52505V11.425C7.3999 11.7564 7.66853 12.025 7.9999 12.025 8.33127 12.025 8.5999 11.7564 8.5999 11.425V7.52505z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M0.899902 8.00002C0.899902 4.0788 4.07868 0.900024 7.9999 0.900024C11.9211 0.900024 15.0999 4.0788 15.0999 8.00002C15.0999 11.9212 11.9211 15.1 7.9999 15.1C4.07868 15.1 0.899902 11.9212 0.899902 8.00002ZM7.9999 2.10002C4.74142 2.10002 2.0999 4.74154 2.0999 8.00002C2.0999 11.2585 4.74142 13.9 7.9999 13.9C11.2584 13.9 13.8999 11.2585 13.8999 8.00002C13.8999 4.74154 11.2584 2.10002 7.9999 2.10002Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Rr = $e(function(r, e) {
1055
+ return Qe(je, Object.assign({}, r, {
1056
1056
  id: "details-single",
1057
1057
  ref: e,
1058
1058
  icon: No
@@ -1060,8 +1060,8 @@ var No = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em"
1060
1060
  });
1061
1061
  Rr.displayName = "DetailsSingle";
1062
1062
  const Co = Rr;
1063
- var Do = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.45493 2.80093C5.74783 2.49409 6.2227 2.49409 6.5156 2.80093L11.0156 7.51523C11.3085 7.82207 11.3085 8.31956 11.0156 8.6264L6.44488 13.27C6.15199 13.5768 5.67711 13.5768 5.38422 13.27C5.09133 12.9631 5.09133 12.4656 5.38422 12.1588L9.28804 8.20898C9.36409 8.13203 9.36517 8.00855 9.29047 7.93029L5.45493 3.9121C5.16204 3.60526 5.16204 3.10777 5.45493 2.80093Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ir = Ke(function(r, e) {
1064
- return $e(Qe, Object.assign({}, r, {
1063
+ var Do = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.90913 3.57564C6.14345 3.34132 6.52335 3.34132 6.75766 3.57564L10.7577 7.57564C10.992 7.80995 10.992 8.18985 10.7577 8.42417L6.75766 12.4242C6.52335 12.6585 6.14345 12.6585 5.90913 12.4242C5.67482 12.1899 5.67482 11.81 5.90913 11.5756L9.48487 7.9999L5.90913 4.42417C5.67482 4.18985 5.67482 3.80995 5.90913 3.57564Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ir = $e(function(r, e) {
1064
+ return Qe(je, Object.assign({}, r, {
1065
1065
  id: "more-single",
1066
1066
  ref: e,
1067
1067
  icon: Do
@@ -1107,7 +1107,7 @@ const _o = "univer-formula-help-function", Mo = "univer-formula-help-function-ti
1107
1107
  formulaHelpParamActive: Xo
1108
1108
  };
1109
1109
  function Yo() {
1110
- const [r, e] = z(!1), [t, n] = z(!0), [a, o] = z(!0), [u, c] = z(0), [m, s] = z([0, 0]), [d, f] = z({ left: 0, top: 0 }), [l, E] = z(null), P = ce(Fe), R = ce(_e), b = R.t("formula.prompt.required"), S = R.t("formula.prompt.optional"), L = ce(de), p = ce(We);
1110
+ const [r, e] = z(!1), [t, n] = z(!0), [a, o] = z(!0), [u, c] = z(0), [m, s] = z([0, 0]), [l, f] = z({ left: 0, top: 0 }), [d, E] = z(null), P = ce(Fe), R = ce(_e), b = R.t("formula.prompt.required"), S = R.t("formula.prompt.optional"), L = ce(de), p = ce(Ke);
1111
1111
  Nt(() => {
1112
1112
  const v = P.help$.subscribe((O) => {
1113
1113
  const { visible: y, paramIndex: _, functionInfo: U } = O;
@@ -1135,13 +1135,13 @@ function Yo() {
1135
1135
  function A(v) {
1136
1136
  c(v);
1137
1137
  }
1138
- return /* @__PURE__ */ N.jsx(N.Fragment, { children: a ? /* @__PURE__ */ N.jsx(mr, { visible: r, offset: m, children: l ? /* @__PURE__ */ N.jsxs("div", { className: ee.formulaHelpFunction, children: [
1138
+ return /* @__PURE__ */ N.jsx(N.Fragment, { children: a ? /* @__PURE__ */ N.jsx(mr, { visible: r, offset: m, children: d ? /* @__PURE__ */ N.jsxs("div", { className: ee.formulaHelpFunction, children: [
1139
1139
  /* @__PURE__ */ N.jsxs("div", { className: ee.formulaHelpFunctionTitle, children: [
1140
1140
  /* @__PURE__ */ N.jsx(
1141
1141
  Wo,
1142
1142
  {
1143
- prefix: l.functionName,
1144
- value: l.functionParameter,
1143
+ prefix: d.functionName,
1144
+ value: d.functionParameter,
1145
1145
  active: u,
1146
1146
  onClick: A
1147
1147
  }
@@ -1179,17 +1179,17 @@ function Yo() {
1179
1179
  wt,
1180
1180
  {
1181
1181
  title: R.t("formula.prompt.helpExample"),
1182
- value: `${l.functionName}(${l.functionParameter.map((v) => v.example).join(",")})`
1182
+ value: `${d.functionName}(${d.functionParameter.map((v) => v.example).join(",")})`
1183
1183
  }
1184
1184
  ),
1185
1185
  /* @__PURE__ */ N.jsx(
1186
1186
  wt,
1187
1187
  {
1188
1188
  title: R.t("formula.prompt.helpAbstract"),
1189
- value: l.description
1189
+ value: d.description
1190
1190
  }
1191
1191
  ),
1192
- l && l.functionParameter && l.functionParameter.map((v, O) => /* @__PURE__ */ N.jsx(
1192
+ d && d.functionParameter && d.functionParameter.map((v, O) => /* @__PURE__ */ N.jsx(
1193
1193
  wt,
1194
1194
  {
1195
1195
  className: u === O ? ee.formulaHelpFunctionActive : "",
@@ -1206,7 +1206,7 @@ function Yo() {
1206
1206
  {
1207
1207
  className: ee.formulaHelpDecorator,
1208
1208
  onClick: () => o(!a),
1209
- style: { left: d.left - 24, top: d.top },
1209
+ style: { left: l.left - 24, top: l.top },
1210
1210
  children: /* @__PURE__ */ N.jsx(Co, {})
1211
1211
  }
1212
1212
  ) : /* @__PURE__ */ N.jsx(N.Fragment, {}) });
@@ -1246,7 +1246,7 @@ const wt = (r) => /* @__PURE__ */ N.jsxs("div", { className: ee.formulaHelpFunct
1246
1246
  formulaSearchFunctionItemActive: Zo
1247
1247
  };
1248
1248
  function eu() {
1249
- const [r, e] = z(!1), [t, n] = z(0), [a, o] = z([0, 0]), [u, c] = z([]), [m, s] = z(""), d = cr(null), f = ce(Fe), l = ce(de), E = ce(We);
1249
+ const [r, e] = z(!1), [t, n] = z(0), [a, o] = z([0, 0]), [u, c] = z([]), [m, s] = z(""), l = cr(null), f = ce(Fe), d = ce(de), E = ce(Ke);
1250
1250
  Nt(() => {
1251
1251
  let L = [], p = 0;
1252
1252
  const C = f.search$.subscribe((O) => {
@@ -1279,7 +1279,7 @@ function eu() {
1279
1279
  };
1280
1280
  }, []);
1281
1281
  function P() {
1282
- const p = l.getCurrentUniverDocInstance().getUnitId();
1282
+ const p = d.getCurrentUniverDocInstance().getUnitId();
1283
1283
  if (!E.isEditor(p))
1284
1284
  return;
1285
1285
  const C = E.getEditor(p);
@@ -1293,7 +1293,7 @@ function eu() {
1293
1293
  }
1294
1294
  function S(L) {
1295
1295
  var k;
1296
- const p = (k = d.current) == null ? void 0 : k.querySelectorAll(`.${Le.formulaSearchFunctionItem}`)[L];
1296
+ const p = (k = l.current) == null ? void 0 : k.querySelectorAll(`.${Le.formulaSearchFunctionItem}`)[L];
1297
1297
  if (!p)
1298
1298
  return;
1299
1299
  const C = p.parentNode;
@@ -1308,7 +1308,7 @@ function eu() {
1308
1308
  behavior: "smooth"
1309
1309
  });
1310
1310
  }
1311
- return u.length > 0 && /* @__PURE__ */ N.jsx(mr, { visible: r, offset: a, children: /* @__PURE__ */ N.jsx("ul", { className: Le.formulaSearchFunction, ref: d, children: u.map((L, p) => /* @__PURE__ */ N.jsxs(
1311
+ return u.length > 0 && /* @__PURE__ */ N.jsx(mr, { visible: r, offset: a, children: /* @__PURE__ */ N.jsx("ul", { className: Le.formulaSearchFunction, ref: l, children: u.map((L, p) => /* @__PURE__ */ N.jsxs(
1312
1312
  "li",
1313
1313
  {
1314
1314
  className: t === p ? `${Le.formulaSearchFunctionItem} ${Le.formulaSearchFunctionItemActive}` : Le.formulaSearchFunctionItem,
@@ -12699,7 +12699,7 @@ var Du = Object.defineProperty, gu = Object.getOwnPropertyDescriptor, Ou = (r, e
12699
12699
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
12700
12700
  return n && a && Du(e, t, a), a;
12701
12701
  }, Bn = (r, e) => (t, n) => e(t, n, r);
12702
- const je = Ot("formula-ui.description-service");
12702
+ const Je = Ot("formula-ui.description-service");
12703
12703
  let Jt = class {
12704
12704
  constructor(r = [], e, t) {
12705
12705
  M(this, "_descriptions", []);
@@ -12817,7 +12817,7 @@ const vu = "univer-formula-select-function-select", _u = "univer-formula-select-
12817
12817
  formulaSelectFunctionContent: ku
12818
12818
  };
12819
12819
  function Uu(r) {
12820
- const { onChange: e } = r, t = "-1", [n, a] = z(""), [o, u] = z([]), [c, m] = z(0), [s, d] = z(t), [f, l] = z(0), [E, P] = z(null), R = ce(je), b = ce(_e), S = Oo(i, b);
12820
+ const { onChange: e } = r, t = "-1", [n, a] = z(""), [o, u] = z([]), [c, m] = z(0), [s, l] = z(t), [f, d] = z(0), [E, P] = z(null), R = ce(Je), b = ce(_e), S = Oo(i, b);
12821
12821
  S.unshift({
12822
12822
  label: b.t("formula.moreFunctions.allFunctions"),
12823
12823
  value: t
@@ -12838,7 +12838,7 @@ function Uu(r) {
12838
12838
  P(null);
12839
12839
  return;
12840
12840
  }
12841
- l(I);
12841
+ d(I);
12842
12842
  const k = R.getFunctionInfo(o[I].name);
12843
12843
  if (!k) {
12844
12844
  P(null);
@@ -12847,7 +12847,7 @@ function Uu(r) {
12847
12847
  P(k), e(k);
12848
12848
  };
12849
12849
  function v(I) {
12850
- d(I);
12850
+ l(I);
12851
12851
  const k = R.getSearchListByType(+I);
12852
12852
  u(k);
12853
12853
  }
@@ -12928,24 +12928,25 @@ function Uu(r) {
12928
12928
  ] });
12929
12929
  }
12930
12930
  function Fu() {
12931
- const r = mi(), [e, t] = z(!0), [n, a] = z(!1), [o, u] = z([]), [c, m] = z(null), s = ce(_e), d = ce(We);
12932
- function f() {
12931
+ const r = mi(), [e, t] = z(!0), [n, a] = z(!1), [o, u] = z(null), c = ce(_e), m = ce(Ke);
12932
+ function s() {
12933
12933
  t(!e), a(!n);
12934
12934
  }
12935
12935
  function l() {
12936
- d.setFormula(`=${c == null ? void 0 : c.functionName}(`);
12936
+ m.setFormula(`=${o == null ? void 0 : o.functionName}(`);
12937
12937
  }
12938
12938
  return /* @__PURE__ */ N.jsxs("div", { className: yn.formulaMoreFunctions, children: [
12939
- e && /* @__PURE__ */ N.jsx(Uu, { onChange: m }),
12940
- n && /* @__PURE__ */ N.jsx(su, { functionInfo: c, onChange: u }),
12939
+ e && /* @__PURE__ */ N.jsx(Uu, { onChange: u }),
12940
+ n && /* @__PURE__ */ N.jsx(su, { functionInfo: o, onChange: () => {
12941
+ } }),
12941
12942
  /* @__PURE__ */ N.jsxs("div", { className: yn.formulaMoreFunctionsOperation, children: [
12942
- n && /* @__PURE__ */ N.jsx(qt, { type: "primary", size: "small", onClick: f, children: s.t("formula.moreFunctions.next") }),
12943
- n && /* @__PURE__ */ N.jsx(qt, { size: "small", onClick: f, children: s.t("formula.moreFunctions.prev") }),
12944
- e && !!r && /* @__PURE__ */ N.jsx(qt, { type: "primary", size: "small", onClick: l, children: s.t("formula.moreFunctions.confirm") })
12943
+ n && /* @__PURE__ */ N.jsx(qt, { type: "primary", size: "small", onClick: s, children: c.t("formula.moreFunctions.next") }),
12944
+ n && /* @__PURE__ */ N.jsx(qt, { size: "small", onClick: s, children: c.t("formula.moreFunctions.prev") }),
12945
+ e && !!r && /* @__PURE__ */ N.jsx(qt, { type: "primary", size: "small", onClick: l, children: c.t("formula.moreFunctions.confirm") })
12945
12946
  ] })
12946
12947
  ] });
12947
12948
  }
12948
- const pt = {
12949
+ const ht = {
12949
12950
  type: Ee.MUTATION,
12950
12951
  id: "sheet.mutation.data-validation-formula-mark-dirty",
12951
12952
  handler() {
@@ -12991,7 +12992,7 @@ function qu(r) {
12991
12992
  disabled$: ya(r)
12992
12993
  };
12993
12994
  }
12994
- function wu() {
12995
+ function wu(r) {
12995
12996
  return {
12996
12997
  id: pr.id,
12997
12998
  title: "formula.insert.more",
@@ -13030,7 +13031,7 @@ function Xu() {
13030
13031
  r.push({
13031
13032
  id: Me.id,
13032
13033
  binding: e,
13033
- preconditions: (t) => Ye(t),
13034
+ preconditions: (t) => We(t),
13034
13035
  staticParameters: {
13035
13036
  eventType: fe.Keyboard,
13036
13037
  keycode: e
@@ -13044,7 +13045,7 @@ function Yu() {
13044
13045
  r.push({
13045
13046
  id: Me.id,
13046
13047
  binding: e | Ae.SHIFT,
13047
- preconditions: (t) => Ye(t),
13048
+ preconditions: (t) => We(t),
13048
13049
  staticParameters: {
13049
13050
  eventType: fe.Keyboard,
13050
13051
  keycode: e,
@@ -13059,7 +13060,7 @@ function Wu() {
13059
13060
  r.push({
13060
13061
  id: Me.id,
13061
13062
  binding: e | Ae.CTRL_COMMAND,
13062
- preconditions: (t) => Ye(t),
13063
+ preconditions: (t) => We(t),
13063
13064
  staticParameters: {
13064
13065
  eventType: fe.Keyboard,
13065
13066
  keycode: e,
@@ -13074,7 +13075,7 @@ function Ku() {
13074
13075
  r.push({
13075
13076
  id: Me.id,
13076
13077
  binding: e | Ae.SHIFT | Ae.CTRL_COMMAND,
13077
- preconditions: (t) => Ye(t),
13078
+ preconditions: (t) => We(t),
13078
13079
  staticParameters: {
13079
13080
  eventType: fe.Keyboard,
13080
13081
  keycode: e,
@@ -13086,7 +13087,7 @@ function Ku() {
13086
13087
  const $u = {
13087
13088
  id: bn.id,
13088
13089
  binding: w.F4,
13089
- preconditions: (r) => Ye(r)
13090
+ preconditions: (r) => We(r)
13090
13091
  };
13091
13092
  function Qu() {
13092
13093
  const r = [];
@@ -13108,17 +13109,19 @@ var ju = Object.defineProperty, Ju = Object.getOwnPropertyDescriptor, Zu = (r, e
13108
13109
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
13109
13110
  return n && a && ju(e, t, a), a;
13110
13111
  }, Te = (r, e) => (t, n) => e(t, n, r);
13111
- let ht = class extends te {
13112
- constructor(r, e, t, n, a, o, u) {
13113
- super(), this._injector = r, this._menuService = e, this._commandService = t, this._shortcutService = n, this._uiController = a, this._renderManagerService = o, this._componentManager = u, this._initialize();
13112
+ const ec = {};
13113
+ let Ge = class extends ne {
13114
+ constructor(r, e, t, n, a, o, u, c) {
13115
+ super(), this._config = r, this._injector = e, this._menuService = t, this._commandService = n, this._shortcutService = a, this._uiPartsService = o, this._renderManagerService = u, this._componentManager = c, this._initialize();
13114
13116
  }
13115
13117
  _initialize() {
13116
13118
  this._registerCommands(), this._registerMenus(), this._registerShortcuts(), this._registerComponents(), this._registerRenderControllers();
13117
13119
  }
13118
13120
  _registerMenus() {
13121
+ const { menu: r = {} } = this._config;
13119
13122
  [qu, wu, Hu].forEach(
13120
- (r) => {
13121
- this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(r)));
13123
+ (e) => {
13124
+ this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(e), r));
13122
13125
  }
13123
13126
  );
13124
13127
  }
@@ -13132,7 +13135,7 @@ let ht = class extends te {
13132
13135
  Qt,
13133
13136
  Me,
13134
13137
  bn,
13135
- pt
13138
+ ht
13136
13139
  ].forEach((r) => this.disposeWithMe(this._commandService.registerCommand(r)));
13137
13140
  }
13138
13141
  _registerShortcuts() {
@@ -13149,23 +13152,23 @@ let ht = class extends te {
13149
13152
  }
13150
13153
  _registerComponents() {
13151
13154
  this.disposeWithMe(
13152
- this._uiController.registerComponent(Ri.CONTENT, () => Oi(tu, this._injector))
13155
+ this._uiPartsService.registerComponent(Ii.CONTENT, () => Oi(tu, this._injector))
13153
13156
  ), this._componentManager.register(br, Fu);
13154
13157
  }
13155
13158
  _registerRenderControllers() {
13156
13159
  this.disposeWithMe(this._renderManagerService.registerRenderController(G.UNIVER_SHEET, Ct));
13157
13160
  }
13158
13161
  };
13159
- ht = Zu([
13160
- me(se.Ready, ht),
13161
- Te(0, B(gt)),
13162
- Te(1, Ti),
13163
- Te(2, oe),
13164
- Te(3, Si),
13165
- Te(4, Ni),
13166
- Te(5, fn),
13167
- Te(6, B(Ii))
13168
- ], ht);
13162
+ Ge = Zu([
13163
+ me(se.Ready, Ge),
13164
+ Te(1, B(gt)),
13165
+ Te(2, Ti),
13166
+ Te(3, oe),
13167
+ Te(4, Si),
13168
+ Te(5, Ni),
13169
+ Te(6, fn),
13170
+ Te(7, B(Ri))
13171
+ ], Ge);
13169
13172
  const kn = "formula_reference_selection_plugin_name";
13170
13173
  function Ht(r, e, t) {
13171
13174
  const n = r.getCurrentTheme(), a = new Vn(e).setAlpha(0.05).toRgbString();
@@ -13184,14 +13187,14 @@ function Ht(r, e, t) {
13184
13187
  hasColumnHeader: !1
13185
13188
  };
13186
13189
  }
13187
- var ec = Object.defineProperty, tc = Object.getOwnPropertyDescriptor, nc = (r, e, t, n) => {
13188
- for (var a = n > 1 ? void 0 : n ? tc(e, t) : e, o = r.length - 1, u; o >= 0; o--)
13190
+ var tc = Object.defineProperty, nc = Object.getOwnPropertyDescriptor, rc = (r, e, t, n) => {
13191
+ for (var a = n > 1 ? void 0 : n ? nc(e, t) : e, o = r.length - 1, u; o >= 0; o--)
13189
13192
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
13190
- return n && a && ec(e, t, a), a;
13193
+ return n && a && tc(e, t, a), a;
13191
13194
  }, Z = (r, e) => (t, n) => e(t, n, r);
13192
- const rc = [$r, Qr];
13193
- let Et = class extends te {
13194
- constructor(e, t, n, a, o, u, c, m, s, d, f, l, E, P, R, b, S) {
13195
+ const ac = [$r, Qr];
13196
+ let Et = class extends ne {
13197
+ constructor(e, t, n, a, o, u, c, m, s, l, f, d, E, P, R, b, S) {
13195
13198
  super();
13196
13199
  M(this, "_formulaRefColors", []);
13197
13200
  M(this, "_previousSequenceNodes");
@@ -13207,7 +13210,7 @@ let Et = class extends te {
13207
13210
  M(this, "_userCursorMove", !1);
13208
13211
  M(this, "_previousEditorUnitId");
13209
13212
  M(this, "_existsSequenceNode", !1);
13210
- this._commandService = e, this._contextService = t, this._textSelectionRenderManager = n, this._editorBridgeService = a, this._formulaPromptService = o, this._lexerTreeBuilder = u, this._renderManagerService = c, this._themeService = m, this._selectionManagerService = s, this._sheetSkeletonManagerService = d, this._univerInstanceService = f, this._selectionRenderService = l, this._descriptionService = E, this._textSelectionManagerService = P, this._docViewModelManagerService = R, this._contextMenuService = b, this._editorService = S, this._initialize();
13213
+ this._commandService = e, this._contextService = t, this._textSelectionRenderManager = n, this._editorBridgeService = a, this._formulaPromptService = o, this._lexerTreeBuilder = u, this._renderManagerService = c, this._themeService = m, this._selectionManagerService = s, this._sheetSkeletonManagerService = l, this._univerInstanceService = f, this._selectionRenderService = d, this._descriptionService = E, this._textSelectionManagerService = P, this._docViewModelManagerService = R, this._contextMenuService = b, this._editorService = S, this._initialize();
13211
13214
  }
13212
13215
  dispose() {
13213
13216
  this._formulaRefColors = [], this._resetTemp();
@@ -13286,7 +13289,7 @@ let Et = class extends te {
13286
13289
  return;
13287
13290
  }
13288
13291
  this._selectionManagerService.clear(), e && this._editorService.isSheetEditor(e) ? (this._selectionManagerService.changePlugin(Ne), this._updateEditorModel(`\r
13289
- `, [])) : this._selectionManagerService.changePluginNoRefresh(Ne), this._contextService.setContextValue(Ze, !1), this._disableForceKeepVisible(), this._selectionRenderService.resetStyle(), this._resetTemp(), this._hideFunctionPanel();
13292
+ `, [])) : this._selectionManagerService.changePluginNoRefresh(Ne), this._contextService.setContextValue(et, !1), this._disableForceKeepVisible(), this._selectionRenderService.resetStyle(), this._resetTemp(), this._hideFunctionPanel();
13290
13293
  }
13291
13294
  _initialRefSelectionUpdateEvent() {
13292
13295
  const e = new Hn();
@@ -13374,8 +13377,8 @@ let Et = class extends te {
13374
13377
  }
13375
13378
  const c = e.length - u.token.length, m = { ...u };
13376
13379
  m.token = e, m.endIndex += c, a[o] = m;
13377
- const s = this._descriptionService.hasDefinedNameDescription(e), d = this._descriptionService.isFormulaDefinedName(e), f = e.length + 1, l = !s || d;
13378
- l && a.splice(o + 1, 0, ye.OPEN_BRACKET);
13380
+ const s = this._descriptionService.hasDefinedNameDescription(e), l = this._descriptionService.isFormulaDefinedName(e), f = e.length + 1, d = !s || l;
13381
+ d && a.splice(o + 1, 0, ye.OPEN_BRACKET);
13379
13382
  for (let P = o + 2, R = a.length; P < R; P++) {
13380
13383
  const b = a[P];
13381
13384
  if (typeof b == "string")
@@ -13384,7 +13387,7 @@ let Et = class extends te {
13384
13387
  S.startIndex += f, S.endIndex += f, a[P] = S;
13385
13388
  }
13386
13389
  let E = m.endIndex + 1;
13387
- l && (E += 1), this._syncToEditor(a, E);
13390
+ d && (E += 1), this._syncToEditor(a, E);
13388
13391
  })
13389
13392
  )
13390
13393
  );
@@ -13495,7 +13498,7 @@ let Et = class extends te {
13495
13498
  }
13496
13499
  _editorModelUnitIds() {
13497
13500
  const t = this._univerInstanceService.getCurrentUniverDocInstance().getUnitId();
13498
- return this._editorService.isEditor(t) && !this._editorService.isSheetEditor(t) ? [t] : rc;
13501
+ return this._editorService.isEditor(t) && !this._editorService.isSheetEditor(t) ? [t] : ac;
13499
13502
  }
13500
13503
  /**
13501
13504
  * Detect whether the user's input content is a formula. If it is a formula,
@@ -13506,7 +13509,7 @@ let Et = class extends te {
13506
13509
  _contextSwitch() {
13507
13510
  const e = this._getCurrentBodyDataStreamAndOffset();
13508
13511
  if (e && ve(e.dataStream)) {
13509
- this._contextService.setContextValue(Ze, !0);
13512
+ this._contextService.setContextValue(et, !0);
13510
13513
  const t = this._lexerTreeBuilder.sequenceNodesBuilder(e.dataStream.replace(/\r/g, "").replace(/\n/g, "")) || [];
13511
13514
  this._formulaPromptService.setSequenceNodes(t);
13512
13515
  const n = this._textSelectionManagerService.getActiveRange();
@@ -13516,10 +13519,10 @@ let Et = class extends te {
13516
13519
  this._currentInsertRefStringIndex = a - 1 + e.offset;
13517
13520
  return;
13518
13521
  }
13519
- this._contextService.setContextValue(Ze, !1), this._formulaPromptService.disableLockedSelectionChange(), this._formulaPromptService.disableLockedSelectionInsert(), this._formulaPromptService.clearSequenceNodes(), this._hideFunctionPanel();
13522
+ this._contextService.setContextValue(et, !1), this._formulaPromptService.disableLockedSelectionChange(), this._formulaPromptService.disableLockedSelectionInsert(), this._formulaPromptService.clearSequenceNodes(), this._hideFunctionPanel();
13520
13523
  }
13521
13524
  _getContextState() {
13522
- return this._contextService.getContextValue(Ze);
13525
+ return this._contextService.getContextValue(et);
13523
13526
  }
13524
13527
  /**
13525
13528
  * Switch from formula selection state to regular selection state.
@@ -13559,10 +13562,10 @@ let Et = class extends te {
13559
13562
  let o = 0;
13560
13563
  const u = ((c = this._getCurrentBodyDataStreamAndOffset()) == null ? void 0 : c.offset) || 0;
13561
13564
  for (let m = 0, s = e.length; m < s; m++) {
13562
- const d = e[m];
13563
- if (typeof d == "string" || this._descriptionService.hasDefinedNameDescription(d.token.trim()))
13565
+ const l = e[m];
13566
+ if (typeof l == "string" || this._descriptionService.hasDefinedNameDescription(l.token.trim()))
13564
13567
  continue;
13565
- const { startIndex: f, endIndex: l, nodeType: E, token: P } = d;
13568
+ const { startIndex: f, endIndex: d, nodeType: E, token: P } = l;
13566
13569
  let R = "";
13567
13570
  if (E === ae.REFERENCE) {
13568
13571
  if (a.has(P))
@@ -13580,7 +13583,7 @@ let Et = class extends te {
13580
13583
  E === ae.NUMBER ? R = this._numberColor : E === ae.STRING ? R = this._stringColor : E === ae.ARRAY && (R = this._stringColor);
13581
13584
  R && R.length > 0 && t.push({
13582
13585
  st: f + 1 - u,
13583
- ed: l + 2 - u,
13586
+ ed: d + 2 - u,
13584
13587
  ts: {
13585
13588
  cl: {
13586
13589
  rgb: R
@@ -13604,7 +13607,7 @@ let Et = class extends te {
13604
13607
  return;
13605
13608
  let c = null;
13606
13609
  for (let m = 0, s = e.length; m < s; m++) {
13607
- const d = e[m], { themeColor: f, token: l, refIndex: E } = d, P = Oe(l), { unitId: R, sheetName: b, range: S } = P, L = ka(S, u.getRowCount(), u.getColumnCount());
13610
+ const l = e[m], { themeColor: f, token: d, refIndex: E } = l, P = Oe(d), { unitId: R, sheetName: b, range: S } = P, L = ka(S, u.getRowCount(), u.getColumnCount());
13608
13611
  if (R != null && R.length > 0 && t !== R)
13609
13612
  continue;
13610
13613
  const p = this._getSheetIdByName(t, b.trim());
@@ -13626,8 +13629,8 @@ let Et = class extends te {
13626
13629
  }
13627
13630
  _getPrimary(e, t, n) {
13628
13631
  var f;
13629
- const a = (f = this._insertSelections.find((l) => {
13630
- const { startRow: E, startColumn: P, endRow: R, endColumn: b } = l.range;
13632
+ const a = (f = this._insertSelections.find((d) => {
13633
+ const { startRow: E, startColumn: P, endRow: R, endColumn: b } = d.range;
13631
13634
  return E === e.startRow && P === e.startColumn && R === e.endRow && b === e.endColumn || E === e.startRow && P === e.startColumn && e.startRow === e.endRow && e.startColumn === e.endColumn;
13632
13635
  })) == null ? void 0 : f.primary;
13633
13636
  if (a == null)
@@ -13638,9 +13641,9 @@ let Et = class extends te {
13638
13641
  startRow: c,
13639
13642
  endRow: m,
13640
13643
  startColumn: s,
13641
- endColumn: d
13644
+ endColumn: l
13642
13645
  } = a;
13643
- return (o || u) && c === e.startRow && s === e.startColumn && e.startRow === e.endRow && e.startColumn === e.endColumn && (e.endRow = m, e.endColumn = d), {
13646
+ return (o || u) && c === e.startRow && s === e.startColumn && e.startRow === e.endRow && e.startColumn === e.endColumn && (e.endRow = m, e.endColumn = l), {
13644
13647
  range: e,
13645
13648
  primary: a,
13646
13649
  style: Ht(this._themeService, t, n.toString())
@@ -13692,7 +13695,7 @@ let Et = class extends te {
13692
13695
  const { openUnitId: u, openSheetId: c } = this._getOpenForCurrentSheet();
13693
13696
  t === u ? a = "" : a = t, n === c ? o = "" : o = this._getSheetNameById(t, n);
13694
13697
  const { range: m, primary: s } = e;
13695
- let { startRow: d, endRow: f, startColumn: l, endColumn: E } = m;
13698
+ let { startRow: l, endRow: f, startColumn: d, endColumn: E } = m;
13696
13699
  const { startAbsoluteRefType: P, endAbsoluteRefType: R, rangeType: b } = m;
13697
13700
  if (s) {
13698
13701
  const {
@@ -13703,15 +13706,15 @@ let Et = class extends te {
13703
13706
  startColumn: A,
13704
13707
  endColumn: v
13705
13708
  } = s;
13706
- (S || L) && p === d && A === l && C === f && v === E && (d = p, l = A, f = p, E = A);
13709
+ (S || L) && p === l && A === d && C === f && v === E && (l = p, d = A, f = p, E = A);
13707
13710
  }
13708
- return mt({
13711
+ return st({
13709
13712
  sheetName: o,
13710
13713
  unitId: a,
13711
13714
  range: {
13712
- startRow: d,
13715
+ startRow: l,
13713
13716
  endRow: f,
13714
- startColumn: l,
13717
+ startColumn: d,
13715
13718
  endColumn: E,
13716
13719
  rangeType: b,
13717
13720
  startAbsoluteRefType: P,
@@ -13731,15 +13734,15 @@ let Et = class extends te {
13731
13734
  const m = this._textSelectionManagerService.getActiveRange();
13732
13735
  if (m == null)
13733
13736
  return;
13734
- const { collapsed: s, style: d } = m;
13737
+ const { collapsed: s, style: l } = m;
13735
13738
  this._currentInsertRefStringIndex = t, n == null && (n = this._univerInstanceService.getCurrentUniverDocInstance().getUnitId()), this._fitEditorSize();
13736
13739
  const f = this._editorService.getEditor(n);
13737
13740
  f != null && f.isSingleChoice() && (o = o.split(",")[0]);
13738
- let l = o, E = 1;
13739
- (!f || !f.onlyInputRange()) && (l = `${kt.EQUALS}${o}`, E = 0), a ? this._commandService.executeCommand(ki.id, {
13741
+ let d = o, E = 1;
13742
+ (!f || !f.onlyInputRange()) && (d = `${kt.EQUALS}${o}`, E = 0), a ? this._commandService.executeCommand(ki.id, {
13740
13743
  unitId: n,
13741
13744
  body: {
13742
- dataStream: l,
13745
+ dataStream: d,
13743
13746
  textRuns: u
13744
13747
  },
13745
13748
  textRanges: [
@@ -13747,16 +13750,16 @@ let Et = class extends te {
13747
13750
  startOffset: t + 1 - E,
13748
13751
  endOffset: t + 1 - E,
13749
13752
  collapsed: s,
13750
- style: d
13753
+ style: l
13751
13754
  }
13752
13755
  ],
13753
13756
  segmentId: null
13754
- }) : (this._updateEditorModel(`${l}\r
13757
+ }) : (this._updateEditorModel(`${d}\r
13755
13758
  `, u), this._textSelectionManagerService.replaceTextRanges([
13756
13759
  {
13757
13760
  startOffset: t + 1 - E,
13758
13761
  endOffset: t + 1 - E,
13759
- style: d
13762
+ style: l
13760
13763
  }
13761
13764
  ])), setTimeout(() => {
13762
13765
  this._textSelectionRenderManager.focus(), this._setRemainCapture();
@@ -13791,7 +13794,7 @@ let Et = class extends te {
13791
13794
  }
13792
13795
  _inertControlSelectionReplace(e) {
13793
13796
  this._previousSequenceNodes == null && (this._previousSequenceNodes = this._formulaPromptService.getSequenceNodes()), this._previousInsertRefStringIndex == null && (this._previousInsertRefStringIndex = this._currentInsertRefStringIndex);
13794
- const t = ne.deepClone(this._previousSequenceNodes);
13797
+ const t = te.deepClone(this._previousSequenceNodes);
13795
13798
  if (t == null)
13796
13799
  return;
13797
13800
  const n = this._getRefString(e);
@@ -13829,7 +13832,7 @@ let Et = class extends te {
13829
13832
  const a = this._getCurrentChar();
13830
13833
  if (a == null)
13831
13834
  return;
13832
- this._previousInsertRefStringIndex = this._currentInsertRefStringIndex, !Ln(a) && this._focusIsOnlyRange(e.length) && (this._formulaPromptService.insertSequenceString(this._currentInsertRefStringIndex, ye.COMMA), n = this._formulaPromptService.getSequenceNodes(), this._previousInsertRefStringIndex += 1), this._previousSequenceNodes = ne.deepClone(n);
13835
+ this._previousInsertRefStringIndex = this._currentInsertRefStringIndex, !Ln(a) && this._focusIsOnlyRange(e.length) && (this._formulaPromptService.insertSequenceString(this._currentInsertRefStringIndex, ye.COMMA), n = this._formulaPromptService.getSequenceNodes(), this._previousInsertRefStringIndex += 1), this._previousSequenceNodes = te.deepClone(n);
13833
13836
  const o = this._getRefString(t);
13834
13837
  this._formulaPromptService.setSequenceNodes(n), this._formulaPromptService.insertSequenceRef(this._previousInsertRefStringIndex, o), this._selectionRenderService.disableSkipRemainLast();
13835
13838
  }
@@ -13838,8 +13841,8 @@ let Et = class extends te {
13838
13841
  _updateRefSelectionStyle(e) {
13839
13842
  const t = this._selectionRenderService.getCurrentControls(), { unitId: n, sheetId: a } = this._getCurrentUnitIdAndSheetId();
13840
13843
  for (let o = 0, u = e.length; o < u; o++) {
13841
- const c = e[o], { refIndex: m, themeColor: s, token: d } = c, f = Oe(d), { unitId: l, sheetName: E, range: P } = f;
13842
- if (l != null && l.length > 0 && n !== l)
13844
+ const c = e[o], { refIndex: m, themeColor: s, token: l } = c, f = Oe(l), { unitId: d, sheetName: E, range: P } = f;
13845
+ if (d != null && d.length > 0 && n !== d)
13843
13846
  continue;
13844
13847
  const R = this._getSheetIdByName(n, E.trim());
13845
13848
  if (R != null && R !== a)
@@ -13861,7 +13864,7 @@ let Et = class extends te {
13861
13864
  const { skeleton: n } = this._getCurrentUnitIdAndSheetId();
13862
13865
  this._formulaPromptService.enableLockedSelectionChange();
13863
13866
  const a = (b = t.selectionStyle) == null ? void 0 : b.id;
13864
- if (a == null || !ne.isStringNumber(a))
13867
+ if (a == null || !te.isStringNumber(a))
13865
13868
  return;
13866
13869
  let { startRow: o, endRow: u, startColumn: c, endColumn: m } = e;
13867
13870
  const s = bi(o, c, n == null ? void 0 : n.mergeData);
@@ -13876,11 +13879,11 @@ let Et = class extends te {
13876
13879
  } = s;
13877
13880
  (S || L) && p === o && A === c && C === u && v === m && (o = p, c = A, u = p, m = A);
13878
13881
  }
13879
- const d = Number(a), f = this._formulaPromptService.getCurrentSequenceNodeByIndex(d);
13880
- let l = { startAbsoluteRefType: J.NONE };
13882
+ const l = Number(a), f = this._formulaPromptService.getCurrentSequenceNodeByIndex(l);
13883
+ let d = { startAbsoluteRefType: J.NONE };
13881
13884
  if (typeof f != "string") {
13882
13885
  const S = f.token;
13883
- l = Ra(S), l.endAbsoluteRefType == null && (l.endAbsoluteRefType = l.startAbsoluteRefType);
13886
+ d = Ra(S), d.endAbsoluteRefType == null && (d.endAbsoluteRefType = d.startAbsoluteRefType);
13884
13887
  }
13885
13888
  const E = this._getRefString({
13886
13889
  range: {
@@ -13888,13 +13891,13 @@ let Et = class extends te {
13888
13891
  endRow: Math.max(o, u),
13889
13892
  startColumn: Math.min(c, m),
13890
13893
  endColumn: Math.max(c, m),
13891
- ...l
13894
+ ...d
13892
13895
  },
13893
13896
  primary: s,
13894
13897
  style: null
13895
13898
  });
13896
- this._formulaPromptService.updateSequenceRef(d, E);
13897
- const P = this._formulaPromptService.getSequenceNodes(), R = P[d];
13899
+ this._formulaPromptService.updateSequenceRef(l, E);
13900
+ const P = this._formulaPromptService.getSequenceNodes(), R = P[l];
13898
13901
  typeof R != "string" && (this._syncToEditor(P, R.endIndex + 1), t.update(e, void 0, void 0, void 0, this._selectionRenderService.convertCellRangeToInfo(s)));
13899
13902
  }
13900
13903
  _refreshFormulaAndCellEditor(e) {
@@ -13931,7 +13934,7 @@ let Et = class extends te {
13931
13934
  visible: !1,
13932
13935
  eventType: fe.Keyboard,
13933
13936
  keycode: t
13934
- }), this._commandService.executeCommand(tt.id, {
13937
+ }), this._commandService.executeCommand(nt.id, {
13935
13938
  direction: V.DOWN
13936
13939
  }));
13937
13940
  }
@@ -13945,7 +13948,7 @@ let Et = class extends te {
13945
13948
  visible: !1,
13946
13949
  eventType: fe.Keyboard,
13947
13950
  keycode: t
13948
- }), this._commandService.executeCommand(tt.id, {
13951
+ }), this._commandService.executeCommand(nt.id, {
13949
13952
  direction: V.RIGHT
13950
13953
  }));
13951
13954
  }
@@ -13960,7 +13963,7 @@ let Et = class extends te {
13960
13963
  _pressArrowKey(e) {
13961
13964
  const { keycode: t, metaKey: n } = e;
13962
13965
  let a = V.DOWN;
13963
- t === w.ARROW_DOWN ? a = V.DOWN : t === w.ARROW_UP ? a = V.UP : t === w.ARROW_LEFT ? a = V.LEFT : t === w.ARROW_RIGHT && (a = V.RIGHT), n === Ae.CTRL_COMMAND ? this._commandService.executeCommand(tt.id, {
13966
+ t === w.ARROW_DOWN ? a = V.DOWN : t === w.ARROW_UP ? a = V.UP : t === w.ARROW_LEFT ? a = V.LEFT : t === w.ARROW_RIGHT && (a = V.RIGHT), n === Ae.CTRL_COMMAND ? this._commandService.executeCommand(nt.id, {
13964
13967
  direction: a,
13965
13968
  jumpOver: On.moveGap
13966
13969
  }) : n === Ae.SHIFT ? this._commandService.executeCommand(vn.id, {
@@ -13968,7 +13971,7 @@ let Et = class extends te {
13968
13971
  }) : n === Nr ? this._commandService.executeCommand(vn.id, {
13969
13972
  direction: a,
13970
13973
  jumpOver: On.moveGap
13971
- }) : this._commandService.executeCommand(tt.id, {
13974
+ }) : this._commandService.executeCommand(nt.id, {
13972
13975
  direction: a
13973
13976
  });
13974
13977
  }
@@ -14019,8 +14022,8 @@ let Et = class extends te {
14019
14022
  if (this._arrowMoveActionState === 2 && (this._arrowMoveActionState = 3), (this._selectionManagerService.getSelectionRanges() || []).length === 0) {
14020
14023
  const s = this._selectionManagerService.getLastByPlugin(Ne);
14021
14024
  if (s != null) {
14022
- const d = ne.deepClone(s);
14023
- this._selectionManagerService.add([d]);
14025
+ const l = te.deepClone(s);
14026
+ this._selectionManagerService.add([l]);
14024
14027
  }
14025
14028
  }
14026
14029
  this._pressArrowKey(n);
@@ -14083,38 +14086,38 @@ let Et = class extends te {
14083
14086
  let c = o.token;
14084
14087
  u.length > 1 && (c = u[u.length - 1]);
14085
14088
  let m = "";
14086
- for (let f = 0, l = u.length; f < l - 1; f++)
14089
+ for (let f = 0, d = u.length; f < d - 1; f++)
14087
14090
  m += u[f];
14088
14091
  let s = c;
14089
14092
  if (c.indexOf(ye.COLON) > -1)
14090
14093
  if (!this._userCursorMove)
14091
14094
  s = this._changeRangeRef(c);
14092
14095
  else {
14093
- const f = c.split(ye.COLON), l = f[0], E = f[1];
14094
- n - o.startIndex <= l.length ? s = this._changeSingleRef(l) + ye.COLON + E : s = l + ye.COLON + this._changeSingleRef(E);
14096
+ const f = c.split(ye.COLON), d = f[0], E = f[1];
14097
+ n - o.startIndex <= d.length ? s = this._changeSingleRef(d) + ye.COLON + E : s = d + ye.COLON + this._changeSingleRef(E);
14095
14098
  }
14096
14099
  else
14097
14100
  s = this._changeSingleRef(c);
14098
14101
  s = m + s;
14099
- const d = s.length - o.token.length;
14100
- this._formulaPromptService.updateSequenceRef(a, s), this._syncToEditor(this._formulaPromptService.getSequenceNodes(), n + d + 1);
14102
+ const l = s.length - o.token.length;
14103
+ this._formulaPromptService.updateSequenceRef(a, s), this._syncToEditor(this._formulaPromptService.getSequenceNodes(), n + l + 1);
14101
14104
  }
14102
14105
  _changeRangeRef(e) {
14103
14106
  const t = Oe(e).range;
14104
14107
  let n = "";
14105
- return t.startAbsoluteRefType === J.NONE || t.startAbsoluteRefType == null ? (t.startAbsoluteRefType = J.ALL, t.endAbsoluteRefType = J.ALL) : (t.startAbsoluteRefType = J.NONE, t.endAbsoluteRefType = J.NONE), n = Ge(t), n;
14108
+ return t.startAbsoluteRefType === J.NONE || t.startAbsoluteRefType == null ? (t.startAbsoluteRefType = J.ALL, t.endAbsoluteRefType = J.ALL) : (t.startAbsoluteRefType = J.NONE, t.endAbsoluteRefType = J.NONE), n = Xe(t), n;
14106
14109
  }
14107
14110
  _changeSingleRef(e) {
14108
14111
  const t = Oe(e).range, n = t.startAbsoluteRefType;
14109
14112
  let a = "";
14110
- return n === J.NONE || n == null ? (t.startAbsoluteRefType = J.ALL, t.endAbsoluteRefType = J.ALL) : n === J.ALL ? (t.startAbsoluteRefType = J.ROW, t.endAbsoluteRefType = J.ROW) : n === J.ROW ? (t.startAbsoluteRefType = J.COLUMN, t.endAbsoluteRefType = J.COLUMN) : (t.startAbsoluteRefType = J.NONE, t.endAbsoluteRefType = J.NONE), a = Ge(t), a;
14113
+ return n === J.NONE || n == null ? (t.startAbsoluteRefType = J.ALL, t.endAbsoluteRefType = J.ALL) : n === J.ALL ? (t.startAbsoluteRefType = J.ROW, t.endAbsoluteRefType = J.ROW) : n === J.ROW ? (t.startAbsoluteRefType = J.COLUMN, t.endAbsoluteRefType = J.COLUMN) : (t.startAbsoluteRefType = J.NONE, t.endAbsoluteRefType = J.NONE), a = Xe(t), a;
14111
14114
  }
14112
14115
  _getEditorObject() {
14113
14116
  const e = this._univerInstanceService.getCurrentUniverDocInstance().getUnitId(), t = this._editorService.getEditor(e);
14114
14117
  return t == null ? void 0 : t.render;
14115
14118
  }
14116
14119
  };
14117
- Et = nc([
14120
+ Et = rc([
14118
14121
  me(se.Rendered, Et),
14119
14122
  Z(0, oe),
14120
14123
  Z(1, jr),
@@ -14128,18 +14131,18 @@ Et = nc([
14128
14131
  Z(9, B(sn)),
14129
14132
  Z(10, de),
14130
14133
  Z(11, B(ur)),
14131
- Z(12, B(je)),
14134
+ Z(12, B(Je)),
14132
14135
  Z(13, B(Fi)),
14133
14136
  Z(14, B(qi)),
14134
14137
  Z(15, Di),
14135
- Z(16, We)
14138
+ Z(16, Ke)
14136
14139
  ], Et);
14137
- var ac = Object.defineProperty, ic = Object.getOwnPropertyDescriptor, oc = (r, e, t, n) => {
14138
- for (var a = n > 1 ? void 0 : n ? ic(e, t) : e, o = r.length - 1, u; o >= 0; o--)
14140
+ var ic = Object.defineProperty, oc = Object.getOwnPropertyDescriptor, uc = (r, e, t, n) => {
14141
+ for (var a = n > 1 ? void 0 : n ? oc(e, t) : e, o = r.length - 1, u; o >= 0; o--)
14139
14142
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
14140
- return n && a && ac(e, t, a), a;
14143
+ return n && a && ic(e, t, a), a;
14141
14144
  }, Ve = (r, e) => (t, n) => e(t, n, r);
14142
- let Pt = class extends te {
14145
+ let Pt = class extends ne {
14143
14146
  constructor(e, t, n, a, o) {
14144
14147
  super();
14145
14148
  M(this, "_waitingCommandQueue", []);
@@ -14182,8 +14185,8 @@ let Pt = class extends te {
14182
14185
  const m = this._activeDirtyManagerService.get(c.id);
14183
14186
  if (m == null)
14184
14187
  continue;
14185
- const s = m.getDirtyData(c), { dirtyRanges: d, dirtyNameMap: f, dirtyDefinedNameMap: l, dirtyUnitFeatureMap: E, dirtyUnitOtherFormulaMap: P } = s;
14186
- d != null && t.push(...d), f != null && this._mergeDirtyNameMap(n, f), l != null && this._mergeDirtyNameMap(a, l), E != null && this._mergeDirtyUnitFeatureOrOtherFormulaMap(o, E), P != null && this._mergeDirtyUnitFeatureOrOtherFormulaMap(u, P);
14188
+ const s = m.getDirtyData(c), { dirtyRanges: l, dirtyNameMap: f, dirtyDefinedNameMap: d, dirtyUnitFeatureMap: E, dirtyUnitOtherFormulaMap: P } = s;
14189
+ l != null && t.push(...l), f != null && this._mergeDirtyNameMap(n, f), d != null && this._mergeDirtyNameMap(a, d), E != null && this._mergeDirtyUnitFeatureOrOtherFormulaMap(o, E), P != null && this._mergeDirtyUnitFeatureOrOtherFormulaMap(u, P);
14187
14190
  }
14188
14191
  return {
14189
14192
  dirtyRanges: t,
@@ -14223,13 +14226,13 @@ let Pt = class extends te {
14223
14226
  const {
14224
14227
  totalFormulasToCalculate: m,
14225
14228
  completedFormulasCount: s,
14226
- totalArrayFormulasToCalculate: d,
14229
+ totalArrayFormulasToCalculate: l,
14227
14230
  completedArrayFormulasCount: f,
14228
- stage: l
14231
+ stage: d
14229
14232
  } = c.stageInfo;
14230
- l === Ut.START_DEPENDENCY ? (t !== null && (clearTimeout(t), t = null), t = setTimeout(() => {
14233
+ d === Ut.START_DEPENDENCY ? (t !== null && (clearTimeout(t), t = null), t = setTimeout(() => {
14231
14234
  this._progressService.insertTaskCount(100), this._progressService.pushTask({ count: 5 }), n = !0, t = null;
14232
- }, 1e3)) : l === Ut.CURRENTLY_CALCULATING ? (!a && n && (a = !0, this._progressService.insertTaskCount(m)), e(s)) : l === Ut.CURRENTLY_CALCULATING_ARRAY_FORMULA && (!o && n && (o = !0, this._progressService.insertTaskCount(d)), e(f));
14235
+ }, 1e3)) : d === Ut.CURRENTLY_CALCULATING ? (!a && n && (a = !0, this._progressService.insertTaskCount(m)), e(s)) : d === Ut.CURRENTLY_CALCULATING_ARRAY_FORMULA && (!o && n && (o = !0, this._progressService.insertTaskCount(l)), e(f));
14233
14236
  } else {
14234
14237
  const m = c.functionsExecutedState;
14235
14238
  let s = "";
@@ -14273,15 +14276,15 @@ let Pt = class extends te {
14273
14276
  this._formulaCalculationDoneCount = e, this._progressService.pushTask({ count: t });
14274
14277
  }
14275
14278
  };
14276
- Pt = oc([
14279
+ Pt = uc([
14277
14280
  me(se.Ready, Pt),
14278
14281
  Ve(0, oe),
14279
14282
  Ve(1, an),
14280
14283
  Ve(2, B(Fa)),
14281
- Ve(3, B(Xe)),
14284
+ Ve(3, B(Ye)),
14282
14285
  Ve(4, B(gi))
14283
14286
  ], Pt);
14284
- function uc(r, e, t) {
14287
+ function cc(r, e, t) {
14285
14288
  var n;
14286
14289
  return r == null || r[e] == null || ((n = r[e]) == null ? void 0 : n[t]) == null;
14287
14290
  }
@@ -14299,32 +14302,32 @@ function zt(r, e, t) {
14299
14302
  [e]: null
14300
14303
  };
14301
14304
  }
14302
- function cc(r, e, t) {
14305
+ function mc(r, e, t) {
14303
14306
  const { type: n } = t;
14304
- return n === 11 || n === 12 ? mc(r, e) : sc(r, e, t);
14307
+ return n === 11 || n === 12 ? sc(r, e) : fc(r, e, t);
14305
14308
  }
14306
- function mc(r, e) {
14309
+ function sc(r, e) {
14307
14310
  const t = [], n = [];
14308
14311
  return Object.keys(e).forEach((a) => {
14309
14312
  const o = e[a], u = r[a];
14310
14313
  if (o == null || u == null)
14311
14314
  return !0;
14312
14315
  Object.keys(o).forEach((c) => {
14313
- const m = new $(o[c] || {}), s = new $(u[c] || {}), d = new $(), f = new $();
14316
+ const m = new $(o[c] || {}), s = new $(u[c] || {}), l = new $(), f = new $();
14314
14317
  if (m.forValue((b, S, L) => {
14315
14318
  if (L == null)
14316
14319
  return !0;
14317
14320
  const p = pn(L);
14318
- p !== null && (d.setValue(b, S, p), f.setValue(b, S, s.getValue(b, S)));
14319
- }), d.getSizeOf() === 0)
14321
+ p !== null && (l.setValue(b, S, p), f.setValue(b, S, s.getValue(b, S)));
14322
+ }), l.getSizeOf() === 0)
14320
14323
  return;
14321
- const l = {
14324
+ const d = {
14322
14325
  subUnitId: c,
14323
14326
  unitId: a,
14324
- cellValue: d.clone()
14327
+ cellValue: l.clone()
14325
14328
  }, E = {
14326
14329
  id: le.id,
14327
- params: l
14330
+ params: d
14328
14331
  };
14329
14332
  n.push(E);
14330
14333
  const P = {
@@ -14342,94 +14345,94 @@ function mc(r, e) {
14342
14345
  redos: n
14343
14346
  };
14344
14347
  }
14345
- function sc(r, e, t) {
14346
- const { sheetId: n, unitId: a } = t, { redoFormulaData: o, undoFormulaData: u } = fc(r, e, t), c = [], m = [];
14348
+ function fc(r, e, t) {
14349
+ const { sheetId: n, unitId: a } = t, { redoFormulaData: o, undoFormulaData: u } = lc(r, e, t), c = [], m = [];
14347
14350
  if (Object.keys(o).length !== 0) {
14348
14351
  const s = {
14349
14352
  subUnitId: n,
14350
14353
  unitId: a,
14351
14354
  cellValue: o
14352
- }, d = {
14355
+ }, l = {
14353
14356
  id: le.id,
14354
14357
  params: s
14355
14358
  };
14356
- c.push(d);
14359
+ c.push(l);
14357
14360
  }
14358
14361
  if (Object.keys(u).length !== 0) {
14359
14362
  const s = {
14360
14363
  subUnitId: n,
14361
14364
  unitId: a,
14362
14365
  cellValue: u
14363
- }, d = {
14366
+ }, l = {
14364
14367
  id: le.id,
14365
14368
  params: s
14366
14369
  };
14367
- m.push(d);
14370
+ m.push(l);
14368
14371
  }
14369
14372
  return {
14370
14373
  undos: m,
14371
14374
  redos: c
14372
14375
  };
14373
14376
  }
14374
- function fc(r, e, t) {
14377
+ function lc(r, e, t) {
14375
14378
  let n = {}, a = {};
14376
- const { type: o, unitId: u, sheetId: c, range: m, from: s, to: d } = t;
14377
- if (uc(r, u, c))
14379
+ const { type: o, unitId: u, sheetId: c, range: m, from: s, to: l } = t;
14380
+ if (cc(r, u, c))
14378
14381
  return {
14379
14382
  redoFormulaData: n,
14380
14383
  undoFormulaData: a
14381
14384
  };
14382
- const f = r[u][c], l = e[u][c], E = new $(f || {}), P = new $(l || {}), R = [];
14385
+ const f = r[u][c], d = e[u][c], E = new $(f || {}), P = new $(d || {}), R = [];
14383
14386
  let b = !1;
14384
14387
  return E.forValue((S, L, p) => {
14385
14388
  if (p == null)
14386
14389
  return !0;
14387
- if (!Nc(p))
14390
+ if (!Cc(p))
14388
14391
  return;
14389
14392
  const C = Zr(S, L);
14390
14393
  let A = null;
14391
14394
  switch (o) {
14392
14395
  case 0:
14393
- if (s == null || d == null)
14396
+ if (s == null || l == null)
14394
14397
  return;
14395
- A = lc(s, d, C);
14398
+ A = dc(s, l, C);
14396
14399
  break;
14397
14400
  case 1:
14398
- if (s == null || d == null)
14401
+ if (s == null || l == null)
14399
14402
  return;
14400
- A = dc(s, d, C);
14403
+ A = bc(s, l, C);
14401
14404
  break;
14402
14405
  case 2:
14403
- if (s == null || d == null)
14406
+ if (s == null || l == null)
14404
14407
  return;
14405
- A = bc(s, d, C);
14408
+ A = pc(s, l, C);
14406
14409
  break;
14407
14410
  }
14408
- if (ne.isDefine(m))
14411
+ if (te.isDefine(m))
14409
14412
  switch (o) {
14410
14413
  case 3:
14411
- A = pc(m, C), b = !0;
14414
+ A = hc(m, C), b = !0;
14412
14415
  break;
14413
14416
  case 4:
14414
- A = hc(m, C), b = !0;
14417
+ A = Ec(m, C), b = !0;
14415
14418
  break;
14416
14419
  case 5:
14417
- A = Ec(m, C);
14420
+ A = Pc(m, C);
14418
14421
  break;
14419
14422
  case 6:
14420
- A = Pc(m, C);
14423
+ A = Lc(m, C);
14421
14424
  break;
14422
14425
  case 7:
14423
- A = Lc(m, C);
14426
+ A = Ac(m, C);
14424
14427
  break;
14425
14428
  case 8:
14426
- A = Ac(m, C);
14429
+ A = Rc(m, C);
14427
14430
  break;
14428
14431
  case 9:
14429
- A = Rc(m, C), b = !0;
14432
+ A = Ic(m, C), b = !0;
14430
14433
  break;
14431
14434
  case 10:
14432
- A = Ic(m, C), b = !0;
14435
+ A = Tc(m, C), b = !0;
14433
14436
  break;
14434
14437
  }
14435
14438
  A != null && (b ? R.unshift({
@@ -14439,12 +14442,12 @@ function fc(r, e, t) {
14439
14442
  oldCell: C,
14440
14443
  newCell: A
14441
14444
  }));
14442
- }), n = Tc(R, E, P), a = Sc(R, E), {
14445
+ }), n = Sc(R, E, P), a = Nc(R, E), {
14443
14446
  redoFormulaData: n,
14444
14447
  undoFormulaData: a
14445
14448
  };
14446
14449
  }
14447
- function lc(r, e, t) {
14450
+ function dc(r, e, t) {
14448
14451
  const n = Kn(
14449
14452
  {
14450
14453
  id: Y.MoveRangeCommandId,
@@ -14454,7 +14457,7 @@ function lc(r, e, t) {
14454
14457
  );
14455
14458
  return W(n, t);
14456
14459
  }
14457
- function dc(r, e, t) {
14460
+ function bc(r, e, t) {
14458
14461
  const n = $n(
14459
14462
  {
14460
14463
  id: Y.MoveRowsCommandId,
@@ -14464,7 +14467,7 @@ function dc(r, e, t) {
14464
14467
  );
14465
14468
  return W(n, t);
14466
14469
  }
14467
- function bc(r, e, t) {
14470
+ function pc(r, e, t) {
14468
14471
  const n = Qn(
14469
14472
  {
14470
14473
  id: Y.MoveColsCommandId,
@@ -14474,7 +14477,7 @@ function bc(r, e, t) {
14474
14477
  );
14475
14478
  return W(n, t);
14476
14479
  }
14477
- function pc(r, e) {
14480
+ function hc(r, e) {
14478
14481
  const t = jn(
14479
14482
  {
14480
14483
  id: Y.InsertRowCommandId,
@@ -14484,7 +14487,7 @@ function pc(r, e) {
14484
14487
  );
14485
14488
  return W(t, e);
14486
14489
  }
14487
- function hc(r, e) {
14490
+ function Ec(r, e) {
14488
14491
  const t = Jn(
14489
14492
  {
14490
14493
  id: Y.InsertColCommandId,
@@ -14494,7 +14497,7 @@ function hc(r, e) {
14494
14497
  );
14495
14498
  return W(t, e);
14496
14499
  }
14497
- function Ec(r, e) {
14500
+ function Pc(r, e) {
14498
14501
  const t = Zn(
14499
14502
  {
14500
14503
  id: Y.RemoveRowCommandId,
@@ -14504,7 +14507,7 @@ function Ec(r, e) {
14504
14507
  );
14505
14508
  return W(t, e);
14506
14509
  }
14507
- function Pc(r, e) {
14510
+ function Lc(r, e) {
14508
14511
  const t = er(
14509
14512
  {
14510
14513
  id: Y.RemoveColCommandId,
@@ -14514,7 +14517,7 @@ function Pc(r, e) {
14514
14517
  );
14515
14518
  return W(t, e);
14516
14519
  }
14517
- function Lc(r, e) {
14520
+ function Ac(r, e) {
14518
14521
  const t = tr(
14519
14522
  {
14520
14523
  id: Y.DeleteRangeMoveLeftCommandId,
@@ -14524,7 +14527,7 @@ function Lc(r, e) {
14524
14527
  );
14525
14528
  return W(t, e);
14526
14529
  }
14527
- function Ac(r, e) {
14530
+ function Rc(r, e) {
14528
14531
  const t = nr(
14529
14532
  {
14530
14533
  id: Y.DeleteRangeMoveUpCommandId,
@@ -14534,7 +14537,7 @@ function Ac(r, e) {
14534
14537
  );
14535
14538
  return W(t, e);
14536
14539
  }
14537
- function Rc(r, e) {
14540
+ function Ic(r, e) {
14538
14541
  const t = rr(
14539
14542
  {
14540
14543
  id: Y.InsertRangeMoveDownCommandId,
@@ -14544,7 +14547,7 @@ function Rc(r, e) {
14544
14547
  );
14545
14548
  return W(t, e);
14546
14549
  }
14547
- function Ic(r, e) {
14550
+ function Tc(r, e) {
14548
14551
  const t = ar(
14549
14552
  {
14550
14553
  id: Y.InsertRangeMoveRightCommandId,
@@ -14554,17 +14557,17 @@ function Ic(r, e) {
14554
14557
  );
14555
14558
  return W(t, e);
14556
14559
  }
14557
- function Tc(r, e, t) {
14560
+ function Sc(r, e, t) {
14558
14561
  const n = new $({});
14559
14562
  return r.forEach((a) => {
14560
- const { oldCell: o, newCell: u } = a, { startRow: c, startColumn: m } = o, { startRow: s, startColumn: d } = u, f = t.getValue(c, m) || e.getValue(c, m), l = pn(f);
14561
- n.setValue(c, m, { f: null, si: null }), n.setValue(s, d, l);
14563
+ const { oldCell: o, newCell: u } = a, { startRow: c, startColumn: m } = o, { startRow: s, startColumn: l } = u, f = t.getValue(c, m) || e.getValue(c, m), d = pn(f);
14564
+ n.setValue(c, m, { f: null, si: null }), n.setValue(s, l, d);
14562
14565
  }), n.clone();
14563
14566
  }
14564
- function Sc(r, e) {
14567
+ function Nc(r, e) {
14565
14568
  const t = new $({});
14566
14569
  return r.forEach((n) => {
14567
- const { oldCell: a, newCell: o } = n, { startRow: u, startColumn: c } = a, { startRow: m, startColumn: s } = o, d = e.getValue(u, c), f = pn(d);
14570
+ const { oldCell: a, newCell: o } = n, { startRow: u, startColumn: c } = a, { startRow: m, startColumn: s } = o, l = e.getValue(u, c), f = pn(l);
14568
14571
  t.setValue(m, s, { f: null, si: null }), t.setValue(u, c, f);
14569
14572
  }), t.clone();
14570
14573
  }
@@ -14580,16 +14583,16 @@ function pn(r) {
14580
14583
  const c = {};
14581
14584
  return u && (c.si = t), o && n === 0 && a === 0 && (c.f = e), c;
14582
14585
  }
14583
- function Nc(r) {
14586
+ function Cc(r) {
14584
14587
  const e = (r == null ? void 0 : r.f) || "", t = (r == null ? void 0 : r.si) || "", n = ve(e), a = ke(t);
14585
14588
  return !!(n || a);
14586
14589
  }
14587
- var Cc = Object.defineProperty, Dc = Object.getOwnPropertyDescriptor, gc = (r, e, t, n) => {
14588
- for (var a = n > 1 ? void 0 : n ? Dc(e, t) : e, o = r.length - 1, u; o >= 0; o--)
14590
+ var Dc = Object.defineProperty, gc = Object.getOwnPropertyDescriptor, Oc = (r, e, t, n) => {
14591
+ for (var a = n > 1 ? void 0 : n ? gc(e, t) : e, o = r.length - 1, u; o >= 0; o--)
14589
14592
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
14590
- return n && a && Cc(e, t, a), a;
14593
+ return n && a && Dc(e, t, a), a;
14591
14594
  }, Se = (r, e) => (t, n) => e(t, n, r);
14592
- let Lt = class extends te {
14595
+ let Lt = class extends ne {
14593
14596
  constructor(r, e, t, n, a, o, u) {
14594
14597
  super(), this._univerInstanceService = r, this._commandService = e, this._lexerTreeBuilder = t, this._formulaDataModel = n, this._sheetInterceptorService = a, this._selectionManagerService = o, this._injector = u, this._initialize();
14595
14598
  }
@@ -14626,9 +14629,9 @@ let Lt = class extends te {
14626
14629
  ), this.disposeWithMe(
14627
14630
  Q(
14628
14631
  _n(
14629
- this._univerInstanceService.getTypeOfUnitDisposed$(G.UNIVER_SHEET).pipe(st((r) => r.getUnitId())),
14630
- this._univerInstanceService.getTypeOfUnitDisposed$(G.UNIVER_DOC).pipe(st((r) => r.getUnitId())),
14631
- this._univerInstanceService.getTypeOfUnitDisposed$(G.UNIVER_SLIDE).pipe(st((r) => r.getUnitId()))
14632
+ this._univerInstanceService.getTypeOfUnitDisposed$(G.UNIVER_SHEET).pipe(ft((r) => r.getUnitId())),
14633
+ this._univerInstanceService.getTypeOfUnitDisposed$(G.UNIVER_DOC).pipe(ft((r) => r.getUnitId())),
14634
+ this._univerInstanceService.getTypeOfUnitDisposed$(G.UNIVER_SLIDE).pipe(ft((r) => r.getUnitId()))
14632
14635
  ).subscribe((r) => this._handleRemoveSheetMutation(r))
14633
14636
  )
14634
14637
  );
@@ -14643,7 +14646,7 @@ let Lt = class extends te {
14643
14646
  }
14644
14647
  };
14645
14648
  this._formulaDataModel.updateArrayFormulaCellData(t, e, n), this._formulaDataModel.updateArrayFormulaRange(t, e, n), this._commandService.executeCommand(
14646
- et.id,
14649
+ tt.id,
14647
14650
  {
14648
14651
  formulaData: o
14649
14652
  },
@@ -14666,7 +14669,7 @@ let Lt = class extends te {
14666
14669
  _handleRemoveSheetMutation(r, e) {
14667
14670
  const t = this._formulaDataModel.getFormulaData(), n = zt(t, r, e), a = this._formulaDataModel.getArrayFormulaRange(), o = zt(a, r, e), u = this._formulaDataModel.getArrayFormulaCellData(), c = zt(u, r, e);
14668
14671
  n && this._commandService.executeCommand(
14669
- et.id,
14672
+ tt.id,
14670
14673
  {
14671
14674
  formulaData: n
14672
14675
  },
@@ -14687,7 +14690,7 @@ let Lt = class extends te {
14687
14690
  _handleInsertSheetMutation(r) {
14688
14691
  const { sheet: e, unitId: t } = r, n = this._formulaDataModel.getFormulaData(), { id: a, cellData: o } = e, u = new $(o), c = Rn(n, t, a, u);
14689
14692
  this._commandService.executeCommand(
14690
- et.id,
14693
+ tt.id,
14691
14694
  {
14692
14695
  formulaData: c
14693
14696
  },
@@ -14701,11 +14704,11 @@ let Lt = class extends te {
14701
14704
  [t]: {}
14702
14705
  };
14703
14706
  n === G.UNIVER_SHEET ? r.getSheets().forEach((u) => {
14704
- var d;
14707
+ var l;
14705
14708
  const c = u.getCellMatrix(), m = u.getSheetId(), s = Rn(e, t, m, c);
14706
- a[t][m] = (d = s[t]) == null ? void 0 : d[m];
14709
+ a[t][m] = (l = s[t]) == null ? void 0 : l[m];
14707
14710
  }) : n === G.UNIVER_DOC || G.UNIVER_SLIDE, this._commandService.executeCommand(
14708
- et.id,
14711
+ tt.id,
14709
14712
  {
14710
14713
  formulaData: a
14711
14714
  },
@@ -14763,7 +14766,7 @@ let Lt = class extends te {
14763
14766
  a,
14764
14767
  n,
14765
14768
  t
14766
- ), { undos: u, redos: c } = cc(a, o, t);
14769
+ ), { undos: u, redos: c } = mc(a, o, t);
14767
14770
  return {
14768
14771
  undos: u,
14769
14772
  redos: c
@@ -14797,7 +14800,7 @@ let Lt = class extends te {
14797
14800
  const {
14798
14801
  fromRange: { startRow: t, endRow: n },
14799
14802
  toRange: { startRow: a, endRow: o }
14800
- } = e, u = this._univerInstanceService.getCurrentUnitForType(G.UNIVER_SHEET), c = u.getUnitId(), m = u.getActiveSheet(), s = m.getSheetId(), d = {
14803
+ } = e, u = this._univerInstanceService.getCurrentUnitForType(G.UNIVER_SHEET), c = u.getUnitId(), m = u.getActiveSheet(), s = m.getSheetId(), l = {
14801
14804
  startRow: t,
14802
14805
  startColumn: 0,
14803
14806
  endRow: n,
@@ -14812,7 +14815,7 @@ let Lt = class extends te {
14812
14815
  };
14813
14816
  return {
14814
14817
  type: 1,
14815
- from: d,
14818
+ from: l,
14816
14819
  to: f,
14817
14820
  unitId: c,
14818
14821
  sheetId: s
@@ -14825,7 +14828,7 @@ let Lt = class extends te {
14825
14828
  const {
14826
14829
  fromRange: { startColumn: t, endColumn: n },
14827
14830
  toRange: { startColumn: a, endColumn: o }
14828
- } = e, u = this._univerInstanceService.getCurrentUnitForType(G.UNIVER_SHEET), c = u.getUnitId(), m = u.getActiveSheet(), s = m.getSheetId(), d = {
14831
+ } = e, u = this._univerInstanceService.getCurrentUnitForType(G.UNIVER_SHEET), c = u.getUnitId(), m = u.getActiveSheet(), s = m.getSheetId(), l = {
14829
14832
  startRow: 0,
14830
14833
  startColumn: t,
14831
14834
  endRow: m.getRowCount() - 1,
@@ -14840,7 +14843,7 @@ let Lt = class extends te {
14840
14843
  };
14841
14844
  return {
14842
14845
  type: 2,
14843
- from: d,
14846
+ from: l,
14844
14847
  to: f,
14845
14848
  unitId: c,
14846
14849
  sheetId: s
@@ -14966,7 +14969,7 @@ let Lt = class extends te {
14966
14969
  };
14967
14970
  }
14968
14971
  _getFormulaReferenceMoveInfo(r, e, t) {
14969
- if (!ne.isDefine(r))
14972
+ if (!te.isDefine(r))
14970
14973
  return { newFormulaData: {}, oldFormulaData: {}, refRanges: [] };
14971
14974
  const n = Object.keys(r);
14972
14975
  if (n.length === 0)
@@ -14977,9 +14980,9 @@ let Lt = class extends te {
14977
14980
  if (m == null)
14978
14981
  continue;
14979
14982
  const s = Object.keys(m);
14980
- ne.isDefine(a[c]) || (a[c] = {}), ne.isDefine(o[c]) || (o[c] = {});
14981
- for (const d of s) {
14982
- const f = new $(m[d] || {}), l = new $(), E = new $();
14983
+ te.isDefine(a[c]) || (a[c] = {}), te.isDefine(o[c]) || (o[c] = {});
14984
+ for (const l of s) {
14985
+ const f = new $(m[l] || {}), d = new $(), E = new $();
14983
14986
  f.forValue((P, R, b) => {
14984
14987
  var _;
14985
14988
  if (!b)
@@ -14993,14 +14996,14 @@ let Lt = class extends te {
14993
14996
  const k = A[U];
14994
14997
  if (typeof k == "string" || k.nodeType !== ae.REFERENCE)
14995
14998
  continue;
14996
- const { token: be } = k, ue = Oe(be), { range: Re, sheetName: Je, unitId: xe } = ue;
14999
+ const { token: be } = k, ue = Oe(be), { range: Re, sheetName: Ze, unitId: xe } = ue;
14997
15000
  u.push({ row: P, column: R, range: Re });
14998
- const Fr = xe == null || xe.length === 0 ? c : xe, Pe = (_ = e == null ? void 0 : e[Fr]) == null ? void 0 : _[Je];
15001
+ const Fr = xe == null || xe.length === 0 ? c : xe, Pe = (_ = e == null ? void 0 : e[Fr]) == null ? void 0 : _[Ze];
14999
15002
  if (!this._checkIsSameUnitAndSheet(
15000
15003
  t.unitId,
15001
15004
  t.sheetId,
15002
15005
  c,
15003
- d,
15006
+ l,
15004
15007
  xe,
15005
15008
  Pe || ""
15006
15009
  ))
@@ -15009,7 +15012,7 @@ let Lt = class extends te {
15009
15012
  range: Re,
15010
15013
  sheetId: Pe,
15011
15014
  unitId: xe,
15012
- sheetName: Je,
15015
+ sheetName: Ze,
15013
15016
  refOffsetX: L || 0,
15014
15017
  refOffsetY: p || 0
15015
15018
  };
@@ -15022,7 +15025,7 @@ let Lt = class extends te {
15022
15025
  } = t;
15023
15026
  if (yt == null || Pe == null || Pe.length === 0 || xt !== Pe)
15024
15027
  continue;
15025
- qe = mt({
15028
+ qe = st({
15026
15029
  range: Re,
15027
15030
  sheetName: yt,
15028
15031
  unitId: xe
@@ -15041,7 +15044,7 @@ let Lt = class extends te {
15041
15044
  qr,
15042
15045
  t,
15043
15046
  c,
15044
- d
15047
+ l
15045
15048
  );
15046
15049
  qe != null && (A[U] = {
15047
15050
  ...k,
@@ -15051,7 +15054,7 @@ let Lt = class extends te {
15051
15054
  if (!v)
15052
15055
  return !0;
15053
15056
  const y = this._updateRefOffset(A, O, L, p);
15054
- l.setValue(P, R, {
15057
+ d.setValue(P, R, {
15055
15058
  f: S,
15056
15059
  x: L,
15057
15060
  y: p,
@@ -15062,16 +15065,16 @@ let Lt = class extends te {
15062
15065
  y: p,
15063
15066
  si: C
15064
15067
  });
15065
- }), a[c] && (a[c][d] = l.getData()), o[c] && (o[c][d] = E.getData());
15068
+ }), a[c] && (a[c][l] = d.getData()), o[c] && (o[c][l] = E.getData());
15066
15069
  }
15067
15070
  }
15068
15071
  return { newFormulaData: o, oldFormulaData: a, refRanges: u };
15069
15072
  }
15070
15073
  _getNewRangeByMoveParam(r, e, t, n) {
15071
15074
  const { type: a, unitId: o, sheetId: u, range: c, from: m, to: s } = e, {
15072
- range: d,
15075
+ range: l,
15073
15076
  sheetId: f,
15074
- unitId: l,
15077
+ unitId: d,
15075
15078
  sheetName: E,
15076
15079
  refOffsetX: P,
15077
15080
  refOffsetY: R
@@ -15081,11 +15084,11 @@ let Lt = class extends te {
15081
15084
  u,
15082
15085
  t,
15083
15086
  n,
15084
- l,
15087
+ d,
15085
15088
  f
15086
15089
  ))
15087
15090
  return;
15088
- const b = Ce.moveOffset(d, P, R);
15091
+ const b = Ce.moveOffset(l, P, R);
15089
15092
  let S = null;
15090
15093
  if (a === 0) {
15091
15094
  if (m == null || s == null)
@@ -15243,10 +15246,10 @@ let Lt = class extends te {
15243
15246
  }
15244
15247
  }
15245
15248
  if (S != null)
15246
- return mt({
15249
+ return st({
15247
15250
  range: S,
15248
15251
  sheetName: E,
15249
- unitId: l
15252
+ unitId: d
15250
15253
  });
15251
15254
  }
15252
15255
  _checkIsSameUnitAndSheet(r, e, t, n, a, o) {
@@ -15268,12 +15271,12 @@ let Lt = class extends te {
15268
15271
  a.push(c);
15269
15272
  continue;
15270
15273
  }
15271
- const { token: m } = c, s = Oe(m), { range: d, sheetName: f, unitId: l } = s, E = Ce.moveOffset(d, t, n);
15274
+ const { token: m } = c, s = Oe(m), { range: l, sheetName: f, unitId: d } = s, E = Ce.moveOffset(l, t, n);
15272
15275
  a.push({
15273
15276
  ...c,
15274
- token: mt({
15277
+ token: st({
15275
15278
  range: E,
15276
- unitId: l,
15279
+ unitId: d,
15277
15280
  sheetName: f
15278
15281
  })
15279
15282
  });
@@ -15316,9 +15319,9 @@ let Lt = class extends te {
15316
15319
  */
15317
15320
  _getMoveNewRange(r, e, t, n, a, o) {
15318
15321
  const { startRow: u, endRow: c, startColumn: m, endColumn: s } = e, {
15319
- startRow: d,
15322
+ startRow: l,
15320
15323
  startColumn: f,
15321
- endRow: l,
15324
+ endRow: d,
15322
15325
  endColumn: E,
15323
15326
  rangeType: P = De.NORMAL
15324
15327
  } = t, { startRow: R, startColumn: b, endRow: S, endColumn: L } = n, {
@@ -15339,9 +15342,9 @@ let Lt = class extends te {
15339
15342
  else if (c < y)
15340
15343
  I.startRow = u;
15341
15344
  else if (c >= y && R <= y)
15342
- I.startRow = l + 1, I.endRow = c;
15345
+ I.startRow = d + 1, I.endRow = c;
15343
15346
  else if (R > y)
15344
- I.endRow -= l + 1 - O;
15347
+ I.endRow -= d + 1 - O;
15345
15348
  else
15346
15349
  return;
15347
15350
  else
@@ -15353,9 +15356,9 @@ let Lt = class extends te {
15353
15356
  else if (u > O)
15354
15357
  I.endRow = c;
15355
15358
  else if (u <= O && S >= O)
15356
- I.endRow = d + 1, I.startRow = u;
15359
+ I.endRow = l + 1, I.startRow = u;
15357
15360
  else if (S < O)
15358
- I.startRow += y - d + 1;
15361
+ I.startRow += y - l + 1;
15359
15362
  else
15360
15363
  return;
15361
15364
  else
@@ -15389,7 +15392,7 @@ let Lt = class extends te {
15389
15392
  else
15390
15393
  return;
15391
15394
  else
15392
- r === 4 ? (I.startRow = u, I.startColumn = m, I.endRow = c, I.endColumn = s) : f <= _ && E >= U ? R > y ? I.endRow -= l - d + 1 : S < O && (I.startRow += l - d + 1) : d <= O && l >= y ? b > U ? I.endColumn -= E - f + 1 : L < _ && (I.startColumn += E - f + 1) : ((b <= v + 1 && L >= U || b <= _ && L >= A - 1) && R <= O && S >= y || (R <= C + 1 && S >= y || R <= O && S >= p - 1) && b <= _ && L >= U) && (I.startRow = u, I.startColumn = m, I.endRow = c, I.endColumn = s);
15395
+ r === 4 ? (I.startRow = u, I.startColumn = m, I.endRow = c, I.endColumn = s) : f <= _ && E >= U ? R > y ? I.endRow -= d - l + 1 : S < O && (I.startRow += d - l + 1) : l <= O && d >= y ? b > U ? I.endColumn -= E - f + 1 : L < _ && (I.startColumn += E - f + 1) : ((b <= v + 1 && L >= U || b <= _ && L >= A - 1) && R <= O && S >= y || (R <= C + 1 && S >= y || R <= O && S >= p - 1) && b <= _ && L >= U) && (I.startRow = u, I.startColumn = m, I.endRow = c, I.endColumn = s);
15393
15396
  return I;
15394
15397
  }
15395
15398
  _getCurrentSheetInfo() {
@@ -15400,12 +15403,12 @@ let Lt = class extends te {
15400
15403
  };
15401
15404
  }
15402
15405
  };
15403
- Lt = gc([
15406
+ Lt = Oc([
15404
15407
  me(se.Ready, Lt),
15405
15408
  Se(0, de),
15406
15409
  Se(1, oe),
15407
15410
  Se(2, B(Ue)),
15408
- Se(3, B(Xe)),
15411
+ Se(3, B(Ye)),
15409
15412
  Se(4, B(vt)),
15410
15413
  Se(5, B(mn)),
15411
15414
  Se(6, B(gt))
@@ -15943,7 +15946,7 @@ const Dr = {}, gr = {
15943
15946
  number2: { name: "number2", detail: "second" }
15944
15947
  }
15945
15948
  }
15946
- }, Oc = {
15949
+ }, vc = {
15947
15950
  CUBEKPIMEMBER: {
15948
15951
  description: "Returns a key performance indicator (KPI) property and displays the KPI name in the cell. A KPI is a quantifiable measurement, such as monthly gross profit or quarterly employee turnover, that is used to monitor an organization's performance.",
15949
15952
  abstract: "Returns a key performance indicator (KPI) property and displays the KPI name in the cell. A KPI is a quantifiable measurement, such as monthly gross profit or quarterly employee turnover, that is used to monitor an organization's performance.",
@@ -16042,7 +16045,7 @@ const Dr = {}, gr = {
16042
16045
  number2: { name: "number2", detail: "second" }
16043
16046
  }
16044
16047
  }
16045
- }, vc = {
16048
+ }, _c = {
16046
16049
  DAVERAGE: {
16047
16050
  description: "Returns the average of selected database entries",
16048
16051
  abstract: "Returns the average of selected database entries",
@@ -22021,7 +22024,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
22021
22024
  number2: { name: "number2", detail: "second" }
22022
22025
  }
22023
22026
  }
22024
- }, _c = {
22027
+ }, Mc = {
22025
22028
  ASC: {
22026
22029
  description: "Changes full-width (double-byte) English letters or katakana within a character string to half-width (single-byte) characters",
22027
22030
  abstract: "Changes full-width (double-byte) English letters or katakana within a character string to half-width (single-byte) characters",
@@ -22680,7 +22683,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
22680
22683
  number2: { name: "number2", detail: "second" }
22681
22684
  }
22682
22685
  }
22683
- }, Mc = {}, xc = {
22686
+ }, xc = {}, yc = {
22684
22687
  ENCODEURL: {
22685
22688
  description: "Returns a URL-encoded string",
22686
22689
  abstract: "Returns a URL-encoded string",
@@ -22723,7 +22726,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
22723
22726
  number2: { name: "number2", detail: "second" }
22724
22727
  }
22725
22728
  }
22726
- }, Vm = {
22729
+ }, Hm = {
22727
22730
  formula: {
22728
22731
  insert: {
22729
22732
  tooltip: "Functions",
@@ -22740,16 +22743,16 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
22740
22743
  ...Br,
22741
22744
  ...kr,
22742
22745
  ...yr,
22743
- ...vc,
22744
22746
  ..._c,
22747
+ ...Mc,
22745
22748
  ...xr,
22746
22749
  ...Mr,
22747
22750
  ...vr,
22748
- ...Oc,
22751
+ ...vc,
22749
22752
  ...gr,
22750
- ...xc,
22753
+ ...yc,
22751
22754
  ...Dr,
22752
- ...Mc
22755
+ ...xc
22753
22756
  },
22754
22757
  prompt: {
22755
22758
  helpExample: "EXAMPLE",
@@ -22802,7 +22805,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
22802
22805
  pasteFormula: "Paste Formula"
22803
22806
  }
22804
22807
  }
22805
- }, yc = {}, Bc = {
22808
+ }, Bc = {}, kc = {
22806
22809
  BETADIST: {
22807
22810
  description: "返回 beta 累积分布函数",
22808
22811
  abstract: "返回 beta 累积分布函数",
@@ -23335,7 +23338,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
23335
23338
  number2: { name: "number2", detail: "second" }
23336
23339
  }
23337
23340
  }
23338
- }, kc = {
23341
+ }, Uc = {
23339
23342
  CUBEKPIMEMBER: {
23340
23343
  description: "返回重要性能指示器 (KPI) 属性,并在单元格中显示 KPI 名称。 KPI 是一种用于监控单位绩效的可计量度量值,如每月总利润或季度员工调整。",
23341
23344
  abstract: "返回重要性能指示器 (KPI) 属性,并在单元格中显示 KPI 名称。 KPI 是一种用于监控单位绩效的可计量度量值,如每月总利润或季度员工调整。",
@@ -23434,7 +23437,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
23434
23437
  number2: { name: "number2", detail: "second" }
23435
23438
  }
23436
23439
  }
23437
- }, Uc = {
23440
+ }, Fc = {
23438
23441
  DAVERAGE: {
23439
23442
  description: "返回所选数据库条目的平均值",
23440
23443
  abstract: "返回所选数据库条目的平均值",
@@ -23603,7 +23606,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
23603
23606
  number2: { name: "number2", detail: "second" }
23604
23607
  }
23605
23608
  }
23606
- }, Fc = {
23609
+ }, qc = {
23607
23610
  DATE: {
23608
23611
  description: "采用三个单独的值并将它们合并为一个日期。",
23609
23612
  abstract: "返回特定日期的序列号",
@@ -23949,7 +23952,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
23949
23952
  number2: { name: "number2", detail: "second" }
23950
23953
  }
23951
23954
  }
23952
- }, qc = {
23955
+ }, wc = {
23953
23956
  BESSELI: {
23954
23957
  description: "返回修正的贝赛耳函数 In(x)",
23955
23958
  abstract: "返回修正的贝赛耳函数 In(x)",
@@ -24706,7 +24709,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
24706
24709
  number2: { name: "number2", detail: "second" }
24707
24710
  }
24708
24711
  }
24709
- }, wc = {
24712
+ }, Vc = {
24710
24713
  ACCRINT: {
24711
24714
  description: "返回定期支付利息的债券的应计利息",
24712
24715
  abstract: "返回定期支付利息的债券的应计利息",
@@ -25477,7 +25480,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
25477
25480
  number2: { name: "number2", detail: "second" }
25478
25481
  }
25479
25482
  }
25480
- }, Vc = {
25483
+ }, Hc = {
25481
25484
  CELL: {
25482
25485
  description: "返回有关单元格格式、位置或内容的信息",
25483
25486
  abstract: "返回有关单元格格式、位置或内容的信息",
@@ -25761,7 +25764,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
25761
25764
  number2: { name: "number2", detail: "second" }
25762
25765
  }
25763
25766
  }
25764
- }, Hc = {
25767
+ }, zc = {
25765
25768
  AND: {
25766
25769
  description: "如果其所有参数均为 TRUE,则返回 TRUE",
25767
25770
  abstract: "如果其所有参数均为 TRUE,则返回 TRUE",
@@ -26039,7 +26042,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
26039
26042
  number2: { name: "number2", detail: "second" }
26040
26043
  }
26041
26044
  }
26042
- }, zc = {
26045
+ }, Gc = {
26043
26046
  ADDRESS: {
26044
26047
  description: "根据指定行号和列号获得工作表中的某个单元格的地址。 例如,ADDRESS(2,3) 返回 $C$2。 再例如,ADDRESS(77,300) 返回 $KN$77。 可以使用其他函数(如 ROW 和 COLUMN 函数)为 ADDRESS 函数提供行号和列号参数。",
26045
26048
  abstract: "以文本形式将引用值返回到工作表的单个单元格",
@@ -26636,7 +26639,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
26636
26639
  2 - 执行依赖于 lookup_array 按降序排序的二进制搜索。 如果未排序,将返回无效结果。` }
26637
26640
  }
26638
26641
  }
26639
- }, Gc = {
26642
+ }, Xc = {
26640
26643
  ABS: {
26641
26644
  description: "返回数字的绝对值。一个数字的绝对值是该数字不带其符号的形式。",
26642
26645
  abstract: "返回数字的绝对值",
@@ -27801,7 +27804,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
27801
27804
  number2: { name: "number2", detail: "second" }
27802
27805
  }
27803
27806
  }
27804
- }, Xc = {
27807
+ }, Yc = {
27805
27808
  AVEDEV: {
27806
27809
  description: "返回数据点与它们的平均值的绝对偏差平均值",
27807
27810
  abstract: "返回数据点与它们的平均值的绝对偏差平均值",
@@ -29390,7 +29393,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
29390
29393
  number2: { name: "number2", detail: "second" }
29391
29394
  }
29392
29395
  }
29393
- }, Yc = {
29396
+ }, Wc = {
29394
29397
  ASC: {
29395
29398
  description: "将字符串中的全角(双字节)英文字母或片假名更改为半角(单字节)字符",
29396
29399
  abstract: "将字符串中的全角(双字节)英文字母或片假名更改为半角(单字节)字符",
@@ -30049,7 +30052,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
30049
30052
  number2: { name: "number2", detail: "second" }
30050
30053
  }
30051
30054
  }
30052
- }, Wc = {}, Kc = {
30055
+ }, Kc = {}, $c = {
30053
30056
  ENCODEURL: {
30054
30057
  description: "返回 URL 编码的字符串",
30055
30058
  abstract: "返回 URL 编码的字符串",
@@ -30092,7 +30095,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
30092
30095
  number2: { name: "number2", detail: "second" }
30093
30096
  }
30094
30097
  }
30095
- }, $c = {
30098
+ }, Qc = {
30096
30099
  formula: {
30097
30100
  insert: {
30098
30101
  tooltip: "函数",
@@ -30104,21 +30107,21 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
30104
30107
  more: "更多函数..."
30105
30108
  },
30106
30109
  functionList: {
30107
- ...wc,
30108
- ...Fc,
30109
- ...Gc,
30110
+ ...Vc,
30111
+ ...qc,
30110
30112
  ...Xc,
30111
- ...zc,
30112
- ...Uc,
30113
30113
  ...Yc,
30114
+ ...Gc,
30115
+ ...Fc,
30116
+ ...Wc,
30117
+ ...zc,
30114
30118
  ...Hc,
30115
- ...Vc,
30116
- ...qc,
30119
+ ...wc,
30120
+ ...Uc,
30117
30121
  ...kc,
30122
+ ...$c,
30118
30123
  ...Bc,
30119
- ...Kc,
30120
- ...yc,
30121
- ...Wc
30124
+ ...Kc
30122
30125
  },
30123
30126
  prompt: {
30124
30127
  helpExample: "示例",
@@ -30171,7 +30174,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
30171
30174
  pasteFormula: "仅粘贴公式"
30172
30175
  }
30173
30176
  }
30174
- }, Qc = {
30177
+ }, jc = {
30175
30178
  CUBEKPIMEMBER: {
30176
30179
  description: "Возвращает свойство ключевого показателя эффективности (KPI) и отображает имя KPI в ячейке. KPI — это количественная мера, такая как ежемесячная валовая прибыль или ежеквартальная текучесть сотрудников, используемая для мониторинга производительности организации.",
30177
30180
  abstract: "Возвращает свойство ключевого показателя эффективности (KPI) и отображает имя KPI в ячейке. KPI — это количественная мера, такая как ежемесячная валовая прибыль или ежеквартальная текучесть сотрудников, используемая для мониторинга производительности организации.",
@@ -30270,7 +30273,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
30270
30273
  number2: { name: "number2", detail: "второй" }
30271
30274
  }
30272
30275
  }
30273
- }, jc = {
30276
+ }, Jc = {
30274
30277
  DAVERAGE: {
30275
30278
  description: "Возвращает среднее значение выбранных записей базы данных",
30276
30279
  abstract: "Возвращает среднее значение выбранных записей базы данных",
@@ -30439,7 +30442,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
30439
30442
  number2: { name: "number2", detail: "второй" }
30440
30443
  }
30441
30444
  }
30442
- }, Jc = {
30445
+ }, Zc = {
30443
30446
  ASC: {
30444
30447
  description: "Преобразует символы полного (двойного) байта английских букв или катаканы внутри строки символов в символы половинного (одинарного) байта",
30445
30448
  abstract: "Преобразует символы полного (двойного) байта английских букв или катаканы внутри строки символов в символы половинного (одинарного) байта",
@@ -31098,7 +31101,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
31098
31101
  number2: { name: "number2", detail: "второй" }
31099
31102
  }
31100
31103
  }
31101
- }, Zc = {}, em = {
31104
+ }, em = {}, tm = {
31102
31105
  ENCODEURL: {
31103
31106
  description: "Возвращает строку, закодированную в формате URL",
31104
31107
  abstract: "Возвращает строку, закодированную в формате URL",
@@ -31141,7 +31144,7 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
31141
31144
  number2: { name: "number2", detail: "второй" }
31142
31145
  }
31143
31146
  }
31144
- }, Hm = {
31147
+ }, zm = {
31145
31148
  formula: {
31146
31149
  insert: {
31147
31150
  tooltip: "Функции",
@@ -31158,16 +31161,16 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
31158
31161
  ...Br,
31159
31162
  ...kr,
31160
31163
  ...yr,
31161
- ...jc,
31162
31164
  ...Jc,
31165
+ ...Zc,
31163
31166
  ...xr,
31164
31167
  ...Mr,
31165
31168
  ...vr,
31166
- ...Qc,
31169
+ ...jc,
31167
31170
  ...gr,
31168
- ...em,
31171
+ ...tm,
31169
31172
  ...Dr,
31170
- ...Zc
31173
+ ...em
31171
31174
  },
31172
31175
  prompt: {
31173
31176
  helpExample: "ПРИМЕР",
@@ -31221,15 +31224,15 @@ If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.` }
31221
31224
  }
31222
31225
  }
31223
31226
  };
31224
- var tm = Object.defineProperty, nm = Object.getOwnPropertyDescriptor, rm = (r, e, t, n) => {
31225
- for (var a = n > 1 ? void 0 : n ? nm(e, t) : e, o = r.length - 1, u; o >= 0; o--)
31227
+ var nm = Object.defineProperty, rm = Object.getOwnPropertyDescriptor, am = (r, e, t, n) => {
31228
+ for (var a = n > 1 ? void 0 : n ? rm(e, t) : e, o = r.length - 1, u; o >= 0; o--)
31226
31229
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
31227
- return n && a && tm(e, t, a), a;
31228
- }, am = (r, e) => (t, n) => e(t, n, r);
31230
+ return n && a && nm(e, t, a), a;
31231
+ }, im = (r, e) => (t, n) => e(t, n, r);
31229
31232
  const Ur = Ot(
31230
31233
  "formula-ui.formula-custom-function-service"
31231
31234
  );
31232
- let Zt = class extends te {
31235
+ let Zt = class extends ne {
31233
31236
  constructor(r) {
31234
31237
  super(), this._commandService = r;
31235
31238
  }
@@ -31256,18 +31259,18 @@ let Zt = class extends te {
31256
31259
  });
31257
31260
  }
31258
31261
  };
31259
- Zt = rm([
31260
- am(0, oe)
31262
+ Zt = am([
31263
+ im(0, oe)
31261
31264
  ], Zt);
31262
- var im = Object.defineProperty, om = Object.getOwnPropertyDescriptor, um = (r, e, t, n) => {
31263
- for (var a = n > 1 ? void 0 : n ? om(e, t) : e, o = r.length - 1, u; o >= 0; o--)
31265
+ var om = Object.defineProperty, um = Object.getOwnPropertyDescriptor, cm = (r, e, t, n) => {
31266
+ for (var a = n > 1 ? void 0 : n ? um(e, t) : e, o = r.length - 1, u; o >= 0; o--)
31264
31267
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
31265
- return n && a && im(e, t, a), a;
31266
- }, it = (r, e) => (t, n) => e(t, n, r);
31267
- const cm = Ot(
31268
+ return n && a && om(e, t, a), a;
31269
+ }, ot = (r, e) => (t, n) => e(t, n, r);
31270
+ const mm = Ot(
31268
31271
  "formula-ui.register-function-service"
31269
31272
  );
31270
- let en = class extends te {
31273
+ let en = class extends ne {
31271
31274
  constructor(r, e, t, n) {
31272
31275
  super(), this._localeService = r, this._descriptionService = e, this._formulaCustomFunctionService = t, this._functionService = n;
31273
31276
  }
@@ -31293,19 +31296,19 @@ let en = class extends te {
31293
31296
  });
31294
31297
  }
31295
31298
  };
31296
- en = um([
31297
- it(0, B(_e)),
31298
- it(1, B(je)),
31299
- it(2, B(Ur)),
31300
- it(3, Xn)
31299
+ en = cm([
31300
+ ot(0, B(_e)),
31301
+ ot(1, B(Je)),
31302
+ ot(2, B(Ur)),
31303
+ ot(3, Xn)
31301
31304
  ], en);
31302
- var mm = Object.defineProperty, sm = Object.getOwnPropertyDescriptor, fm = (r, e, t, n) => {
31303
- for (var a = n > 1 ? void 0 : n ? sm(e, t) : e, o = r.length - 1, u; o >= 0; o--)
31305
+ var sm = Object.defineProperty, fm = Object.getOwnPropertyDescriptor, lm = (r, e, t, n) => {
31306
+ for (var a = n > 1 ? void 0 : n ? fm(e, t) : e, o = r.length - 1, u; o >= 0; o--)
31304
31307
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
31305
- return n && a && mm(e, t, a), a;
31306
- }, ot = (r, e) => (t, n) => e(t, n, r);
31308
+ return n && a && sm(e, t, a), a;
31309
+ }, ut = (r, e) => (t, n) => e(t, n, r);
31307
31310
  const Gt = "AllDefaultWorkbook";
31308
- let At = class extends te {
31311
+ let At = class extends ne {
31309
31312
  constructor(e, t, n, a) {
31310
31313
  super();
31311
31314
  M(this, "_preUnitId", null);
@@ -31420,67 +31423,67 @@ let At = class extends te {
31420
31423
  }), this._descriptionService.unregisterDescriptions(a);
31421
31424
  }
31422
31425
  };
31423
- At = fm([
31426
+ At = lm([
31424
31427
  me(se.Rendered, At),
31425
- ot(0, je),
31426
- ot(1, zn),
31427
- ot(2, de),
31428
- ot(3, oe)
31428
+ ut(0, Je),
31429
+ ut(1, zn),
31430
+ ut(2, de),
31431
+ ut(3, oe)
31429
31432
  ], At);
31430
- var lm = Object.defineProperty, dm = Object.getOwnPropertyDescriptor, bm = (r, e, t, n) => {
31431
- for (var a = n > 1 ? void 0 : n ? dm(e, t) : e, o = r.length - 1, u; o >= 0; o--)
31433
+ var dm = Object.defineProperty, bm = Object.getOwnPropertyDescriptor, pm = (r, e, t, n) => {
31434
+ for (var a = n > 1 ? void 0 : n ? bm(e, t) : e, o = r.length - 1, u; o >= 0; o--)
31432
31435
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
31433
- return n && a && lm(e, t, a), a;
31436
+ return n && a && dm(e, t, a), a;
31434
31437
  }, Xt = (r, e) => (t, n) => e(t, n, r);
31435
- let tn = class extends te {
31438
+ let tn = class extends ne {
31436
31439
  constructor(r, e, t) {
31437
31440
  super(), this._refRangeService = r, this._lexerTreeBuilder = e, this._univerInstanceService = t;
31438
31441
  }
31439
31442
  registerFormula(r, e) {
31440
31443
  const t = /* @__PURE__ */ new Map(), n = this._lexerTreeBuilder.sequenceNodesBuilder(r), a = new Hn(), o = (u) => {
31441
- const c = this._univerInstanceService.getCurrentUnitForType(G.UNIVER_SHEET), m = c.getActiveSheet(), s = c.getUnitId(), d = m.getSheetId(), f = n == null ? void 0 : n.map((E) => {
31444
+ const c = this._univerInstanceService.getCurrentUnitForType(G.UNIVER_SHEET), m = c.getActiveSheet(), s = c.getUnitId(), l = m.getSheetId(), f = n == null ? void 0 : n.map((E) => {
31442
31445
  if (typeof E == "object" && E.nodeType === ae.REFERENCE) {
31443
31446
  const P = t.get(E.token);
31444
- if (P.unitId && P.unitId !== s && P.subUnitId && P.subUnitId !== d)
31447
+ if (P.unitId && P.unitId !== s && P.subUnitId && P.subUnitId !== l)
31445
31448
  return E;
31446
31449
  const R = ni(P.range, u);
31447
31450
  let b = "";
31448
- return P.unitId && P.sheetName ? b = Na(P.unitId, P.sheetName, P.range) : P.sheetName ? b = Ca(P.sheetName, P.range) : b = R ? Ge(R) : X.ERROR, {
31451
+ return P.unitId && P.sheetName ? b = Na(P.unitId, P.sheetName, P.range) : P.sheetName ? b = Ca(P.sheetName, P.range) : b = R ? Xe(R) : X.ERROR, {
31449
31452
  ...E,
31450
31453
  token: b
31451
31454
  };
31452
31455
  } else
31453
31456
  return E;
31454
- }), l = f && on(f);
31455
- return e(`=${l}`);
31457
+ }), d = f && on(f);
31458
+ return e(`=${d}`);
31456
31459
  };
31457
31460
  return n == null || n.forEach((u) => {
31458
31461
  if (typeof u == "object" && u.nodeType === ae.REFERENCE) {
31459
- const c = Oe(u.token), { range: m, unitId: s, sheetName: d } = c, f = s ? this._univerInstanceService.getUniverSheetInstance(s) : this._univerInstanceService.getCurrentUnitForType(G.UNIVER_SHEET), l = d ? f == null ? void 0 : f.getSheetBySheetName(d) : f == null ? void 0 : f.getActiveSheet();
31460
- if (!l)
31462
+ const c = Oe(u.token), { range: m, unitId: s, sheetName: l } = c, f = s ? this._univerInstanceService.getUniverSheetInstance(s) : this._univerInstanceService.getCurrentUnitForType(G.UNIVER_SHEET), d = l ? f == null ? void 0 : f.getSheetBySheetName(l) : f == null ? void 0 : f.getActiveSheet();
31463
+ if (!d)
31461
31464
  return;
31462
- const E = l.getSheetId(), P = {
31465
+ const E = d.getSheetId(), P = {
31463
31466
  unitId: s,
31464
31467
  subUnitId: E,
31465
31468
  range: m,
31466
- sheetName: d
31469
+ sheetName: l
31467
31470
  };
31468
31471
  t.set(u.token, P), a.add(this._refRangeService.registerRefRange(m, o, s, E));
31469
31472
  }
31470
31473
  }), a;
31471
31474
  }
31472
31475
  };
31473
- tn = bm([
31476
+ tn = pm([
31474
31477
  Xt(0, B(ti)),
31475
31478
  Xt(1, B(Ue)),
31476
31479
  Xt(2, de)
31477
31480
  ], tn);
31478
- var ze = /* @__PURE__ */ ((r) => (r[r.NOT_REGISTER = 1] = "NOT_REGISTER", r[r.SUCCESS = 2] = "SUCCESS", r[r.WAIT = 3] = "WAIT", r[r.ERROR = 4] = "ERROR", r))(ze || {}), pm = Object.defineProperty, hm = Object.getOwnPropertyDescriptor, Em = (r, e, t, n) => {
31479
- for (var a = n > 1 ? void 0 : n ? hm(e, t) : e, o = r.length - 1, u; o >= 0; o--)
31481
+ var ze = /* @__PURE__ */ ((r) => (r[r.NOT_REGISTER = 1] = "NOT_REGISTER", r[r.SUCCESS = 2] = "SUCCESS", r[r.WAIT = 3] = "WAIT", r[r.ERROR = 4] = "ERROR", r))(ze || {}), hm = Object.defineProperty, Em = Object.getOwnPropertyDescriptor, Pm = (r, e, t, n) => {
31482
+ for (var a = n > 1 ? void 0 : n ? Em(e, t) : e, o = r.length - 1, u; o >= 0; o--)
31480
31483
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
31481
- return n && a && pm(e, t, a), a;
31484
+ return n && a && hm(e, t, a), a;
31482
31485
  }, Un = (r, e) => (t, n) => e(t, n, r);
31483
- let nn = class extends te {
31486
+ let nn = class extends ne {
31484
31487
  constructor(e, t) {
31485
31488
  super();
31486
31489
  M(this, "_formulaCacheMap", /* @__PURE__ */ new Map());
@@ -31497,20 +31500,20 @@ let nn = class extends te {
31497
31500
  return a || (a = /* @__PURE__ */ new Map(), n.set(t, a)), a;
31498
31501
  }
31499
31502
  _createFormulaId(e, t) {
31500
- return `sheet.dv_${e}_${t}_${ne.generateRandomId(8)}`;
31503
+ return `sheet.dv_${e}_${t}_${te.generateRandomId(8)}`;
31501
31504
  }
31502
31505
  _initFormulaRegister() {
31503
31506
  this._activeDirtyManagerService.register(
31504
- pt.id,
31507
+ ht.id,
31505
31508
  {
31506
- commandId: pt.id,
31509
+ commandId: ht.id,
31507
31510
  getDirtyData(e) {
31508
31511
  return {
31509
31512
  dirtyUnitOtherFormulaMap: e.params
31510
31513
  };
31511
31514
  }
31512
31515
  }
31513
- ), this.formulaChange$.pipe(_i(16), Mi((e) => !!e.length), st((e) => e.reduce((t, n) => {
31516
+ ), this.formulaChange$.pipe(_i(16), Mi((e) => !!e.length), ft((e) => e.reduce((t, n) => {
31514
31517
  const { unitId: a, subUnitId: o, formulaId: u, formulaText: c } = n;
31515
31518
  return t[a] || (t[a] = {}), t[a][o] || (t[a][o] = {}), t[a][o][u] = { f: c }, t;
31516
31519
  }, {}))).subscribe((e) => {
@@ -31519,7 +31522,7 @@ let nn = class extends te {
31519
31522
  const a = e[t][n], o = { unitId: t, subUnitId: n, formulaMap: a };
31520
31523
  this._commandService.executeCommand(Da.id, o).then(() => {
31521
31524
  this._commandService.executeCommand(
31522
- pt.id,
31525
+ ht.id,
31523
31526
  { [t]: { [n]: a } }
31524
31527
  );
31525
31528
  });
@@ -31534,12 +31537,12 @@ let nn = class extends te {
31534
31537
  const u = n[o], c = {};
31535
31538
  a[o] = c;
31536
31539
  for (const m in u) {
31537
- const s = this._ensureCacheMap(o, m), d = u[m], f = [];
31540
+ const s = this._ensureCacheMap(o, m), l = u[m], f = [];
31538
31541
  c[m] = f;
31539
- for (const l in d) {
31540
- const E = d[l];
31541
- if (s.has(l)) {
31542
- const P = s.get(l);
31542
+ for (const d in l) {
31543
+ const E = l[d];
31544
+ if (s.has(d)) {
31545
+ const P = s.get(d);
31543
31546
  P.result = E, P.status = ze.SUCCESS, P.callbacks.forEach((R) => {
31544
31547
  R(E);
31545
31548
  }), P.callbacks.clear(), f.push(P);
@@ -31588,16 +31591,16 @@ let nn = class extends te {
31588
31591
  return this._ensureCacheMap(e, t).get(n);
31589
31592
  }
31590
31593
  };
31591
- nn = Em([
31594
+ nn = Pm([
31592
31595
  Un(0, oe),
31593
31596
  Un(1, an)
31594
31597
  ], nn);
31595
- var Pm = Object.defineProperty, Lm = Object.getOwnPropertyDescriptor, Am = (r, e, t, n) => {
31596
- for (var a = n > 1 ? void 0 : n ? Lm(e, t) : e, o = r.length - 1, u; o >= 0; o--)
31598
+ var Lm = Object.defineProperty, Am = Object.getOwnPropertyDescriptor, Rm = (r, e, t, n) => {
31599
+ for (var a = n > 1 ? void 0 : n ? Am(e, t) : e, o = r.length - 1, u; o >= 0; o--)
31597
31600
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
31598
- return n && a && Pm(e, t, a), a;
31599
- }, ut = (r, e) => (t, n) => e(t, n, r);
31600
- const Yt = "SHEET_FORMULA_ALERT", Rm = {
31601
+ return n && a && Lm(e, t, a), a;
31602
+ }, ct = (r, e) => (t, n) => e(t, n, r);
31603
+ const Yt = "SHEET_FORMULA_ALERT", Im = {
31601
31604
  [X.DIV_BY_ZERO]: "divByZero",
31602
31605
  [X.NAME]: "name",
31603
31606
  [X.VALUE]: "value",
@@ -31611,7 +31614,7 @@ const Yt = "SHEET_FORMULA_ALERT", Rm = {
31611
31614
  [X.CONNECT]: "connect",
31612
31615
  [X.NULL]: "null"
31613
31616
  };
31614
- let Rt = class extends te {
31617
+ let Rt = class extends ne {
31615
31618
  constructor(r, e, t, n) {
31616
31619
  super(), this._hoverManagerService = r, this._cellAlertManagerService = e, this._univerInstanceService = t, this._localeService = n, this._init();
31617
31620
  }
@@ -31633,7 +31636,7 @@ let Rt = class extends te {
31633
31636
  this._cellAlertManagerService.showAlert({
31634
31637
  type: fi.ERROR,
31635
31638
  title: this._localeService.t("formula.error.title"),
31636
- message: this._localeService.t(`formula.error.${Rm[o]}`),
31639
+ message: this._localeService.t(`formula.error.${Im[o]}`),
31637
31640
  location: r.location,
31638
31641
  width: 200,
31639
31642
  height: 74,
@@ -31646,17 +31649,17 @@ let Rt = class extends te {
31646
31649
  }));
31647
31650
  }
31648
31651
  };
31649
- Rt = Am([
31652
+ Rt = Rm([
31650
31653
  me(se.Rendered, Rt),
31651
- ut(0, B(li)),
31652
- ut(1, B(di)),
31653
- ut(2, de),
31654
- ut(3, B(_e))
31654
+ ct(0, B(li)),
31655
+ ct(1, B(di)),
31656
+ ct(2, de),
31657
+ ct(3, B(_e))
31655
31658
  ], Rt);
31656
- var Im = Object.defineProperty, Tm = Object.getOwnPropertyDescriptor, Sm = (r, e, t, n) => {
31657
- for (var a = n > 1 ? void 0 : n ? Tm(e, t) : e, o = r.length - 1, u; o >= 0; o--)
31659
+ var Tm = Object.defineProperty, Sm = Object.getOwnPropertyDescriptor, Nm = (r, e, t, n) => {
31660
+ for (var a = n > 1 ? void 0 : n ? Sm(e, t) : e, o = r.length - 1, u; o >= 0; o--)
31658
31661
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
31659
- return n && a && Im(e, t, a), a;
31662
+ return n && a && Tm(e, t, a), a;
31660
31663
  }, Fn = (r, e) => (t, n) => e(t, n, r);
31661
31664
  let It = class extends ea {
31662
31665
  constructor(r, e) {
@@ -31691,31 +31694,29 @@ let It = class extends ea {
31691
31694
  );
31692
31695
  }
31693
31696
  };
31694
- It = Sm([
31697
+ It = Nm([
31695
31698
  me(se.Rendered, It),
31696
31699
  Fn(0, B(sn)),
31697
31700
  Fn(1, B(vt))
31698
31701
  ], It);
31699
- var Nm = Object.defineProperty, Cm = Object.getOwnPropertyDescriptor, Dm = (r, e, t, n) => {
31700
- for (var a = n > 1 ? void 0 : n ? Cm(e, t) : e, o = r.length - 1, u; o >= 0; o--)
31702
+ var Cm = Object.defineProperty, Dm = Object.getOwnPropertyDescriptor, gm = (r, e, t, n) => {
31703
+ for (var a = n > 1 ? void 0 : n ? Dm(e, t) : e, o = r.length - 1, u; o >= 0; o--)
31701
31704
  (u = r[o]) && (a = (n ? u(e, t, a) : u(a)) || a);
31702
- return n && a && Nm(e, t, a), a;
31703
- }, qn = (r, e) => (t, n) => e(t, n, r), ct;
31704
- let wn = (ct = class extends ta {
31705
- constructor(r, e, t) {
31706
- super(), this._config = r, this._injector = e, this._localeService = t;
31705
+ return n && a && Cm(e, t, a), a;
31706
+ }, qn = (r, e) => (t, n) => e(t, n, r), mt;
31707
+ let wn = (mt = class extends ta {
31708
+ constructor(r = {}, e, t) {
31709
+ super(), this._config = r, this._injector = e, this._localeService = t, this._config = te.deepMerge({}, ec, this._config);
31707
31710
  }
31708
31711
  onStarting() {
31709
31712
  this._init();
31710
31713
  }
31711
31714
  _init() {
31712
- this._localeService.load({
31713
- zhCN: $c
31714
- }), [
31715
+ this._localeService.load({ zhCN: Qc }), [
31715
31716
  // services
31716
31717
  [Fe, { useClass: io }],
31717
31718
  [
31718
- je,
31719
+ Je,
31719
31720
  {
31720
31721
  useFactory: () => {
31721
31722
  var e;
@@ -31724,26 +31725,31 @@ let wn = (ct = class extends ta {
31724
31725
  }
31725
31726
  ],
31726
31727
  [Ur, { useClass: Zt }],
31727
- [cm, { useClass: en }],
31728
+ [mm, { useClass: en }],
31728
31729
  [tn],
31729
31730
  [nn],
31730
31731
  // controllers
31731
- [ht],
31732
+ [
31733
+ Ge,
31734
+ {
31735
+ useFactory: () => this._injector.createInstance(Ge, this._config)
31736
+ }
31737
+ ],
31732
31738
  [Et],
31733
- [dt],
31734
31739
  [bt],
31735
- [lt],
31740
+ [pt],
31741
+ [dt],
31736
31742
  [Pt],
31737
31743
  [Lt],
31738
31744
  [Ct],
31739
- [ft],
31745
+ [lt],
31740
31746
  [At],
31741
31747
  [It],
31742
31748
  [Rt]
31743
31749
  ].forEach((e) => this._injector.add(e));
31744
31750
  }
31745
- }, M(ct, "pluginName", sr), M(ct, "type", G.UNIVER_SHEET), ct);
31746
- wn = Dm([
31751
+ }, M(mt, "pluginName", sr), M(mt, "type", G.UNIVER_SHEET), mt);
31752
+ wn = gm([
31747
31753
  qn(1, B(gt)),
31748
31754
  qn(2, B(_e))
31749
31755
  ], wn);
@@ -31751,14 +31757,14 @@ export {
31751
31757
  Jt as DescriptionService,
31752
31758
  Zt as FormulaCustomFunctionService,
31753
31759
  tn as FormulaRefRangeService,
31754
- je as IDescriptionService,
31760
+ Je as IDescriptionService,
31755
31761
  Ur as IFormulaCustomFunctionService,
31756
- cm as IRegisterFunctionService,
31762
+ mm as IRegisterFunctionService,
31757
31763
  en as RegisterFunctionService,
31758
31764
  nn as RegisterOtherFormulaService,
31759
31765
  fr as SPECIAL_PASTE_FORMULA,
31760
31766
  wn as UniverSheetsFormulaPlugin,
31761
- Vm as enUS,
31762
- Hm as ruRU,
31763
- $c as zhCN
31767
+ Hm as enUS,
31768
+ zm as ruRU,
31769
+ Qc as zhCN
31764
31770
  };