@univerjs/sheets-formula 0.1.17 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -1,25 +1,25 @@
1
1
  var ja = Object.defineProperty;
2
2
  var Qa = (a, e, t) => e in a ? ja(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
3
  var x = (a, e, t) => Qa(a, typeof e != "symbol" ? e + "" : e, t);
4
- import { Disposable as re, ObjectMatrix as Q, Dimension as Sn, OnLifecycle as Le, LifecycleStages as Ae, IUniverInstanceService as Pe, CellValueType as He, ThemeService as fn, ICommandService as fe, isFormulaString as Ee, isFormulaId as Ne, Tools as ie, Direction as X, UniverInstanceType as G, DEFAULT_EMPTY_DOCUMENT_VALUE as jn, toDisposable as Z, ColorKit as Qn, CommandType as Se, Rectangle as ge, isRealNum as za, getCellValueType as Za, LocaleService as we, FOCUSING_DOC as Ja, FOCUSING_UNIVER_EDITOR as ei, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE as ti, FOCUSING_EDITOR_INPUT_FORMULA as pt, DisposableCollection as zn, RANGE_TYPE as xe, getCellInfoInMergeData as ni, AbsoluteRefType as J, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as ai, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as ii, IContextService as ri, throttle as In, cellToRange as ui, isICellData as oi, RxDisposable as mi, Plugin as Zn, DependentOn as ci } from "@univerjs/core";
5
- import { Inject as y, Injector as mt, createIdentifier as yt } from "@wendellhu/redi";
6
- import { SetDefinedNameMutation as Nn, RemoveDefinedNameMutation as Rn, FormulaDataModel as Ge, IActiveDirtyManagerService as sn, IDefinedNamesService as Jn, SetArrayFormulaDataMutation as Ct, stripErrorMargin as ea, LexerTreeBuilder as Xe, ErrorType as K, SetFormulaCalculationResultMutation as ta, sequenceNodeType as me, serializeRange as ot, FUNCTION_NAMES_COMPATIBILITY as F, FunctionType as r, FUNCTION_NAMES_CUBE as _e, FUNCTION_NAMES_DATABASE as oe, FUNCTION_NAMES_DATE as w, FUNCTION_NAMES_ENGINEERING as M, FUNCTION_NAMES_FINANCIAL as O, FUNCTION_NAMES_INFORMATION as j, FUNCTION_NAMES_LOGICAL as z, FUNCTION_NAMES_LOOKUP as B, FUNCTION_NAMES_MATH as S, FUNCTION_NAMES_STATISTICAL as P, FUNCTION_NAMES_TEXT as v, FUNCTION_NAMES_WEB as Xt, isReferenceStrings as fi, functionArray as si, functionCompatibility as li, functionCube as di, functionDatabase as pi, functionDate as Li, functionEngineering as Ai, functionFinancial as Pi, functionInformation as bi, functionLogical as Ti, functionLookup as Ei, functionMath as Si, functionMeta as Ii, functionStatistical as Ni, functionText as Ri, functionUniver as Ci, functionWeb as hi, IFunctionService as na, ERROR_TYPE_SET as _i, matchToken as Ue, matchRefDrawToken as Cn, compareToken as Yt, deserializeRangeWithSheet as qe, normalizeSheetName as Oi, serializeRangeToRefString as St, generateStringWithSequence as ln, getAbsoluteRefTypeWitString as Mi, SetFormulaCalculationStartMutation as hn, SetFormulaCalculationNotificationMutation as Di, FormulaExecuteStageType as Wt, FormulaExecutedStateType as Be, SetFormulaDataMutation as Lt, initSheetFormulaData as _n, RegisterFunctionMutation as gi, UnregisterFunctionMutation as xi, serializeRangeWithSpreadsheet as vi, serializeRangeWithSheet as qi, SetOtherFormulaMutation as yi, RemoveOtherFormulaMutation as Fi, UniverFormulaEnginePlugin as Ui } from "@univerjs/engine-formula";
7
- import { IRenderManagerService as Ft, DeviceInputEventType as de, ITextSelectionRenderManager as Bi } from "@univerjs/engine-render";
8
- import { SetRangeValuesMutation as pe, SetStyleCommand as dn, MoveRangeMutation as On, MoveRowsMutation as Mn, MoveColsMutation as Dn, ReorderRangeMutation as gn, RemoveRowMutation as xn, RemoveColMutation as vn, RemoveSheetMutation as nn, InsertSheetMutation as an, SetDefinedNameCommand as rn, INTERCEPTOR_POINT as pn, SheetInterceptorService as Ut, SetRangeValuesUndoMutationFactory as Vi, SetRangeValuesCommand as Hi, SelectionManagerService as Ln, getSheetCommandTarget as wi, getCellAtRowCol as Gi, SetSelectionsOperation as Xi, NORMAL_SELECTION_PLUGIN_NAME as De, WorkbookEditablePermission as aa, WorksheetEditPermission as ia, WorksheetSetCellValuePermission as ra, RangeProtectionPermissionEditPoint as ua, convertSelectionDataToRange as Kt, getNormalSelectionStyle as Yi, setEndForRange as Wi, getPrimaryForRange as Ki, SetBorderCommand as oa, ClearSelectionFormatCommand as ma, INumfmtService as ki, handleMoveRange as ca, EffectRefRangId as k, runRefRangeMutations as $, handleMoveRows as fa, handleMoveCols as sa, handleInsertRow as la, handleInsertCol as da, handleIRemoveRow as pa, handleIRemoveCol as La, handleDeleteRangeMoveLeft as Aa, handleDeleteRangeMoveUp as Pa, handleInsertRangeMoveDown as ba, handleInsertRangeMoveRight as Ta, RemoveSheetCommand as $i, SetWorksheetNameCommand as ji, DeleteRangeMoveLeftCommand as Qi, DeleteRangeMoveUpCommand as zi, RemoveColCommand as Zi, RemoveRowCommand as Ji, InsertRangeMoveDownCommand as er, InsertRangeMoveRightCommand as tr, InsertColCommand as nr, InsertRowCommand as ar, MoveColsCommand as ir, MoveRowsCommand as rr, MoveRangeCommand as ur, SetWorksheetActiveOperation as or, InsertDefinedNameCommand as mr, RemoveDefinedNameCommand as cr, RefRangeService as fr, handleDefaultRangeChangeWithEffectRefCommands as sr } from "@univerjs/sheets";
9
- import { DATA_TYPE as qn, APPLY_TYPE as lr, IAutoFillService as dr, PREDEFINED_HOOK_NAME as Ve, COPY_TYPE as Ea, ISheetClipboardService as pr, SelectionShape as Lr, IEditorBridgeService as Sa, SheetSkeletonManagerService as Ia, ISelectionRenderService as Na, SheetPasteCommand as Ar, useActiveWorkbook as Pr, getCurrentRangeDisable$ as Ra, PASTE_SPECIAL_MENU_ID as br, whenFormulaEditorActivated as ct, getEditorObject as yn, MoveSelectionCommand as Fn, JumpOver as Un, ExpandSelectionCommand as Bn, CellAlertType as Tr, HoverManagerService as Er, CellAlertManagerService as Sr } from "@univerjs/sheets-ui";
10
- import { IEditorService as ft, ISidebarService as Ir, MenuGroup as Nr, MenuItemType as An, MenuPosition as Rr, getMenuHiddenObservable as Cr, IClipboardInterfaceService as Vn, KeyCode as H, MetaKeys as Re, ComponentManager as hr, BuiltInUIPart as _r, IMenuService as Or, IShortcutService as Mr, IUIPartsService as Dr, SetEditorResizeOperation as gr, IContextMenuService as xr, IProgressService as vr } from "@univerjs/ui";
11
- import { useDependency as le, connectInjector as qr } from "@wendellhu/redi/react-bindings";
12
- import { Subject as ve, combineLatestWith as yr, map as Ze, switchMap as Fr, of as Hn, Observable as Ur, merge as wn, bufferTime as Br, filter as Vr } from "rxjs";
13
- import Hr, { forwardRef as st, useRef as Ca, createElement as lt, useState as Y, useEffect as ht } from "react";
14
- import { Popup as ha, Select as wr, Input as Gr, Button as kt } from "@univerjs/design";
15
- import { ReplaceContentCommand as Xr, DocSkeletonManagerService as Yr, MoveCursorOperation as Wr, TextSelectionManagerService as Kr } from "@univerjs/docs";
16
- const Pn = "formula-ui";
17
- var kr = Object.defineProperty, $r = Object.getOwnPropertyDescriptor, jr = (a, e, t, n) => {
18
- for (var i = n > 1 ? void 0 : n ? $r(e, t) : e, u = a.length - 1, o; u >= 0; u--)
4
+ import { Disposable as re, ObjectMatrix as Q, Dimension as In, OnLifecycle as Le, LifecycleStages as Ae, IUniverInstanceService as Pe, CellValueType as Rt, ThemeService as sn, ICommandService as fe, isFormulaString as Ie, isFormulaId as ye, Tools as ie, Direction as X, UniverInstanceType as G, DEFAULT_EMPTY_DOCUMENT_VALUE as jn, toDisposable as Z, ColorKit as Qn, CommandType as Te, Rectangle as De, isRealNum as za, getCellValueType as Za, LocaleService as He, FOCUSING_DOC as Ja, FOCUSING_UNIVER_EDITOR as ei, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE as ti, FOCUSING_EDITOR_INPUT_FORMULA as dt, DisposableCollection as zn, RANGE_TYPE as ge, getCellInfoInMergeData as ni, AbsoluteRefType as J, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as ai, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as ii, IContextService as ri, throttle as Nn, cellToRange as ui, isICellData as oi, RxDisposable as mi, Plugin as Zn, DependentOn as ci } from "@univerjs/core";
5
+ import { Inject as q, Injector as ot, createIdentifier as qt } from "@wendellhu/redi";
6
+ import { SetDefinedNameMutation as Rn, RemoveDefinedNameMutation as Cn, FormulaDataModel as we, IActiveDirtyManagerService as ln, IDefinedNamesService as Jn, SetArrayFormulaDataMutation as Ct, stripErrorMargin as fi, LexerTreeBuilder as mt, ErrorType as K, SetFormulaCalculationResultMutation as ea, sequenceNodeType as me, serializeRange as ut, FUNCTION_NAMES_COMPATIBILITY as F, FunctionType as r, FUNCTION_NAMES_CUBE as he, FUNCTION_NAMES_DATABASE as oe, FUNCTION_NAMES_DATE as w, FUNCTION_NAMES_ENGINEERING as M, FUNCTION_NAMES_FINANCIAL as O, FUNCTION_NAMES_INFORMATION as j, FUNCTION_NAMES_LOGICAL as z, FUNCTION_NAMES_LOOKUP as B, FUNCTION_NAMES_MATH as S, FUNCTION_NAMES_STATISTICAL as P, FUNCTION_NAMES_TEXT as v, FUNCTION_NAMES_WEB as Gt, isReferenceStrings as si, functionArray as li, functionCompatibility as di, functionCube as pi, functionDatabase as Li, functionDate as Ai, functionEngineering as Pi, functionFinancial as bi, functionInformation as Ti, functionLogical as Ei, functionLookup as Si, functionMath as Ii, functionMeta as Ni, functionStatistical as Ri, functionText as Ci, functionUniver as hi, functionWeb as _i, IFunctionService as ta, ERROR_TYPE_SET as Oi, matchToken as Ue, matchRefDrawToken as hn, compareToken as Xt, deserializeRangeWithSheet as ve, normalizeSheetName as Mi, serializeRangeToRefString as Et, generateStringWithSequence as dn, getAbsoluteRefTypeWitString as Di, SetFormulaCalculationStartMutation as Yt, SetFormulaCalculationStopMutation as gi, SetFormulaCalculationNotificationMutation as xi, FormulaExecuteStageType as Wt, FormulaExecutedStateType as Be, SetFormulaDataMutation as pt, initSheetFormulaData as _n, RegisterFunctionMutation as vi, UnregisterFunctionMutation as yi, serializeRangeWithSpreadsheet as qi, serializeRangeWithSheet as Fi, SetOtherFormulaMutation as Ui, RemoveOtherFormulaMutation as Bi, UniverFormulaEnginePlugin as Vi } from "@univerjs/engine-formula";
7
+ import { IRenderManagerService as Ft, DeviceInputEventType as de, ITextSelectionRenderManager as Hi } from "@univerjs/engine-render";
8
+ import { SetRangeValuesMutation as pe, SetStyleCommand as pn, MoveRangeMutation as On, MoveRowsMutation as Mn, MoveColsMutation as Dn, ReorderRangeMutation as gn, RemoveRowMutation as xn, RemoveColMutation as vn, RemoveSheetMutation as nn, InsertSheetMutation as an, SetDefinedNameCommand as rn, INTERCEPTOR_POINT as na, SheetInterceptorService as Ln, SetRangeValuesUndoMutationFactory as wi, SetRangeValuesCommand as Gi, SelectionManagerService as An, getSheetCommandTarget as Xi, getCellAtRowCol as Yi, SetSelectionsOperation as Wi, NORMAL_SELECTION_PLUGIN_NAME as Me, WorkbookEditablePermission as aa, WorksheetEditPermission as ia, WorksheetSetCellValuePermission as ra, RangeProtectionPermissionEditPoint as ua, convertSelectionDataToRange as Kt, getNormalSelectionStyle as Ki, setEndForRange as ki, getPrimaryForRange as $i, SetBorderCommand as oa, ClearSelectionFormatCommand as ma, INumfmtService as ji, handleMoveRange as ca, EffectRefRangId as k, runRefRangeMutations as $, handleMoveRows as fa, handleMoveCols as sa, handleInsertRow as la, handleInsertCol as da, handleIRemoveRow as pa, handleIRemoveCol as La, handleDeleteRangeMoveLeft as Aa, handleDeleteRangeMoveUp as Pa, handleInsertRangeMoveDown as ba, handleInsertRangeMoveRight as Ta, RemoveSheetCommand as Qi, SetWorksheetNameCommand as zi, DeleteRangeMoveLeftCommand as Zi, DeleteRangeMoveUpCommand as Ji, RemoveColCommand as er, RemoveRowCommand as tr, InsertRangeMoveDownCommand as nr, InsertRangeMoveRightCommand as ar, InsertColCommand as ir, InsertRowCommand as rr, MoveColsCommand as ur, MoveRowsCommand as or, MoveRangeCommand as mr, SetWorksheetActiveOperation as cr, InsertDefinedNameCommand as fr, RemoveDefinedNameCommand as sr, RefRangeService as lr, handleDefaultRangeChangeWithEffectRefCommands as dr } from "@univerjs/sheets";
9
+ import { DATA_TYPE as yn, APPLY_TYPE as pr, IAutoFillService as Lr, PREDEFINED_HOOK_NAME as Ve, COPY_TYPE as Ea, ISheetClipboardService as Ar, SelectionShape as Pr, IEditorBridgeService as Sa, SheetSkeletonManagerService as Ia, ISelectionRenderService as Na, SheetPasteCommand as br, useActiveWorkbook as Tr, getCurrentRangeDisable$ as Ra, PASTE_SPECIAL_MENU_ID as Er, whenFormulaEditorActivated as ct, getEditorObject as qn, MoveSelectionCommand as Fn, JumpOver as Un, ExpandSelectionCommand as Bn, CellAlertType as Sr, HoverManagerService as Ir, CellAlertManagerService as Nr } from "@univerjs/sheets-ui";
10
+ import { IEditorService as Ge, ISidebarService as Rr, MenuGroup as Cr, MenuItemType as Pn, MenuPosition as hr, getMenuHiddenObservable as _r, IClipboardInterfaceService as Vn, KeyCode as H, MetaKeys as Ne, ComponentManager as Or, BuiltInUIPart as Mr, IMenuService as Dr, IShortcutService as gr, IUIPartsService as xr, SetEditorResizeOperation as vr, IContextMenuService as yr, IProgressService as qr } from "@univerjs/ui";
11
+ import { useDependency as le, connectInjector as Fr } from "@wendellhu/redi/react-bindings";
12
+ import { Subject as xe, combineLatestWith as Ur, map as ze, switchMap as Br, of as Hn, Observable as Vr, merge as wn, filter as un, bufferTime as Hr } from "rxjs";
13
+ import wr, { forwardRef as ft, useRef as Ca, createElement as st, useState as Y, useEffect as ht } from "react";
14
+ import { Popup as ha, Select as Gr, Input as Xr, Button as kt } from "@univerjs/design";
15
+ import { ReplaceContentCommand as Yr, DocSkeletonManagerService as Wr, MoveCursorOperation as Kr, TextSelectionManagerService as kr } from "@univerjs/docs";
16
+ const bn = "formula-ui";
17
+ var $r = Object.defineProperty, jr = Object.getOwnPropertyDescriptor, Qr = (a, e, t, n) => {
18
+ for (var i = n > 1 ? void 0 : n ? jr(e, t) : e, u = a.length - 1, o; u >= 0; u--)
19
19
  (o = a[u]) && (i = (n ? o(e, t, i) : o(i)) || i);
20
- return n && i && kr(e, t, i), i;
21
- }, At = (a, e) => (t, n) => e(t, n, a);
22
- let Je = class extends re {
20
+ return n && i && $r(e, t, i), i;
21
+ }, Lt = (a, e) => (t, n) => e(t, n, a);
22
+ let Ze = class extends re {
23
23
  constructor(a, e, t, n) {
24
24
  super(), this._activeDirtyManagerService = a, this._univerInstanceService = e, this._formulaDataModel = t, this._definedNamesService = n, this._initialize();
25
25
  }
@@ -31,7 +31,7 @@ let Je = class extends re {
31
31
  commandId: pe.id,
32
32
  getDirtyData: (a) => {
33
33
  const e = a.params;
34
- return e.trigger === dn.id ? {} : {
34
+ return e.trigger === pn.id ? {} : {
35
35
  dirtyRanges: this._getSetRangeValuesMutationDirtyRange(e)
36
36
  };
37
37
  }
@@ -107,14 +107,14 @@ let Je = class extends re {
107
107
  });
108
108
  }
109
109
  _initialDefinedName() {
110
- this._activeDirtyManagerService.register(Nn.id, {
111
- commandId: Nn.id,
110
+ this._activeDirtyManagerService.register(Rn.id, {
111
+ commandId: Rn.id,
112
112
  getDirtyData: (a) => {
113
113
  const e = a.params;
114
114
  return { dirtyDefinedNameMap: this._getDefinedNameMutation(e) };
115
115
  }
116
- }), this._activeDirtyManagerService.register(Rn.id, {
117
- commandId: Rn.id,
116
+ }), this._activeDirtyManagerService.register(Cn.id, {
117
+ commandId: Cn.id,
118
118
  getDirtyData: (a) => {
119
119
  const e = a.params;
120
120
  return { dirtyDefinedNameMap: this._getDefinedNameMutation(e) };
@@ -149,37 +149,37 @@ let Je = class extends re {
149
149
  }
150
150
  _getDeleteRangeMutationDirtyRange(a) {
151
151
  const { subUnitId: e, unitId: t, range: n, shiftDimension: i } = a, u = [], o = this._univerInstanceService.getUniverSheetInstance(t), m = o == null ? void 0 : o.getSheetBySheetId(e), c = (m == null ? void 0 : m.getLastRowWithContent()) || 0, f = (m == null ? void 0 : m.getLastColumnWithContent()) || 0, d = new Q();
152
- let s = null;
153
- const { startRow: l, startColumn: L, endRow: A, endColumn: E } = n;
154
- i === Sn.ROWS ? s = this._rangeToMatrix({
155
- startRow: l,
152
+ let l = null;
153
+ const { startRow: s, startColumn: L, endRow: A, endColumn: E } = n;
154
+ i === In.ROWS ? l = this._rangeToMatrix({
155
+ startRow: s,
156
156
  startColumn: L,
157
157
  endRow: c,
158
158
  endColumn: E
159
- }) : i === Sn.COLUMNS && (s = this._rangeToMatrix({
160
- startRow: l,
159
+ }) : i === In.COLUMNS && (l = this._rangeToMatrix({
160
+ startRow: s,
161
161
  startColumn: L,
162
162
  endRow: A,
163
163
  endColumn: f
164
- })), s != null && d.merge(s);
164
+ })), l != null && d.merge(l);
165
165
  const b = d.getData();
166
166
  return u.push(...this._getDirtyRangesByCellValue(t, e, b)), u.push(...this._getDirtyRangesForArrayFormula(t, e, b)), u;
167
167
  }
168
168
  _getRemoveRowOrColumnMutation(a, e = !0) {
169
169
  const { subUnitId: t, unitId: n, range: i } = a, u = [], o = this._univerInstanceService.getUniverSheetInstance(n), m = o == null ? void 0 : o.getSheetBySheetId(t), c = (m == null ? void 0 : m.getRowCount()) || 0, f = (m == null ? void 0 : m.getColumnCount()) || 0, d = new Q();
170
- let s = null;
171
- const { startRow: l, endRow: L, startColumn: A, endColumn: E } = i;
172
- e === !0 ? s = this._rangeToMatrix({
173
- startRow: l,
170
+ let l = null;
171
+ const { startRow: s, endRow: L, startColumn: A, endColumn: E } = i;
172
+ e === !0 ? l = this._rangeToMatrix({
173
+ startRow: s,
174
174
  startColumn: 0,
175
175
  endRow: L,
176
176
  endColumn: f - 1
177
- }) : s = this._rangeToMatrix({
177
+ }) : l = this._rangeToMatrix({
178
178
  startRow: 0,
179
179
  startColumn: A,
180
180
  endRow: c,
181
181
  endColumn: E
182
- }), s != null && d.merge(s);
182
+ }), l != null && d.merge(l);
183
183
  const b = d.getData();
184
184
  return u.push(...this._getDirtyRangesByCellValue(n, t, b)), u.push(...this._getDirtyRangesForArrayFormula(n, t, b)), u;
185
185
  }
@@ -217,7 +217,7 @@ let Je = class extends re {
217
217
  if ((o = u == null ? void 0 : u[a]) != null && o[e]) {
218
218
  const c = new Q((m = u == null ? void 0 : u[a]) == null ? void 0 : m[e]);
219
219
  i.forValue((f, d) => {
220
- c.forValue((s, l, L) => {
220
+ c.forValue((l, s, L) => {
221
221
  if (L == null)
222
222
  return !0;
223
223
  const { startRow: A, startColumn: E, endRow: b, endColumn: C } = L;
@@ -237,19 +237,19 @@ let Je = class extends re {
237
237
  return n;
238
238
  }
239
239
  };
240
- Je = jr([
241
- Le(Ae.Ready, Je),
242
- At(0, sn),
243
- At(1, Pe),
244
- At(2, y(Ge)),
245
- At(3, Jn)
246
- ], Je);
247
- var Qr = Object.defineProperty, zr = Object.getOwnPropertyDescriptor, Zr = (a, e, t, n) => {
248
- for (var i = n > 1 ? void 0 : n ? zr(e, t) : e, u = a.length - 1, o; u >= 0; u--)
240
+ Ze = Qr([
241
+ Le(Ae.Ready, Ze),
242
+ Lt(0, ln),
243
+ Lt(1, Pe),
244
+ Lt(2, q(we)),
245
+ Lt(3, Jn)
246
+ ], Ze);
247
+ var zr = Object.defineProperty, Zr = Object.getOwnPropertyDescriptor, Jr = (a, e, t, n) => {
248
+ for (var i = n > 1 ? void 0 : n ? Zr(e, t) : e, u = a.length - 1, o; u >= 0; u--)
249
249
  (o = a[u]) && (i = (n ? o(e, t, i) : o(i)) || i);
250
- return n && i && Qr(e, t, i), i;
251
- }, Pt = (a, e) => (t, n) => e(t, n, a);
252
- let et = class extends re {
250
+ return n && i && zr(e, t, i), i;
251
+ }, At = (a, e) => (t, n) => e(t, n, a);
252
+ let Je = class extends re {
253
253
  constructor(a, e, t, n) {
254
254
  super(), this._commandService = a, this._sheetInterceptorService = e, this._formulaDataModel = t, this._themeService = n, this._initialize();
255
255
  }
@@ -271,40 +271,40 @@ let et = class extends re {
271
271
  }
272
272
  _initInterceptorCellContent() {
273
273
  this.disposeWithMe(
274
- this._sheetInterceptorService.intercept(pn.CELL_CONTENT, {
274
+ this._sheetInterceptorService.intercept(na.CELL_CONTENT, {
275
275
  priority: 100,
276
276
  handler: (a, e, t) => {
277
- var f, d, s;
278
- const { unitId: n, subUnitId: i, row: u, col: o } = e, m = this._formulaDataModel.getArrayFormulaCellData(), c = (s = (d = (f = m == null ? void 0 : m[n]) == null ? void 0 : f[i]) == null ? void 0 : d[u]) == null ? void 0 : s[o];
277
+ var f, d, l;
278
+ const { unitId: n, subUnitId: i, row: u, col: o } = e, m = this._formulaDataModel.getArrayFormulaCellData(), c = (l = (d = (f = m == null ? void 0 : m[n]) == null ? void 0 : f[i]) == null ? void 0 : d[u]) == null ? void 0 : l[o];
279
279
  return c == null ? t(a) : c.v == null && c.t == null ? t({
280
280
  ...a,
281
281
  ...c,
282
282
  v: 0,
283
283
  // Default value for empty cell
284
- t: He.NUMBER
285
- }) : (a == null ? void 0 : a.t) === He.NUMBER && typeof (a == null ? void 0 : a.v) == "number" ? t({
284
+ t: Rt.NUMBER
285
+ }) : (a == null ? void 0 : a.t) === Rt.NUMBER && typeof (a == null ? void 0 : a.v) == "number" ? t({
286
286
  ...a,
287
287
  ...c,
288
- v: ea(a.v)
288
+ v: fi(a.v)
289
289
  }) : t({ ...a, ...c });
290
290
  }
291
291
  })
292
292
  );
293
293
  }
294
294
  };
295
- et = Zr([
296
- Le(Ae.Ready, et),
297
- Pt(0, fe),
298
- Pt(1, y(Ut)),
299
- Pt(2, y(Ge)),
300
- Pt(3, y(fn))
301
- ], et);
302
- var Jr = Object.defineProperty, eu = Object.getOwnPropertyDescriptor, tu = (a, e, t, n) => {
303
- for (var i = n > 1 ? void 0 : n ? eu(e, t) : e, u = a.length - 1, o; u >= 0; u--)
295
+ Je = Jr([
296
+ Le(Ae.Ready, Je),
297
+ At(0, fe),
298
+ At(1, q(Ln)),
299
+ At(2, q(we)),
300
+ At(3, q(sn))
301
+ ], Je);
302
+ var eu = Object.defineProperty, tu = Object.getOwnPropertyDescriptor, nu = (a, e, t, n) => {
303
+ for (var i = n > 1 ? void 0 : n ? tu(e, t) : e, u = a.length - 1, o; u >= 0; u--)
304
304
  (o = a[u]) && (i = (n ? o(e, t, i) : o(i)) || i);
305
- return n && i && Jr(e, t, i), i;
305
+ return n && i && eu(e, t, i), i;
306
306
  }, Gn = (a, e) => (t, n) => e(t, n, a);
307
- let It = class extends re {
307
+ let St = class extends re {
308
308
  constructor(a, e) {
309
309
  super(), this._autoFillService = a, this._lexerTreeBuilder = e, this._initialize();
310
310
  }
@@ -313,12 +313,12 @@ let It = class extends re {
313
313
  }
314
314
  _registerAutoFill() {
315
315
  const a = {
316
- type: qn.FORMULA,
316
+ type: yn.FORMULA,
317
317
  priority: 1001,
318
- match: (e) => Ee(e == null ? void 0 : e.f) || Ne(e == null ? void 0 : e.si),
319
- isContinue: (e, t) => e.type === qn.FORMULA,
318
+ match: (e) => Ie(e == null ? void 0 : e.f) || ye(e == null ? void 0 : e.si),
319
+ isContinue: (e, t) => e.type === yn.FORMULA,
320
320
  applyFunctions: {
321
- [lr.COPY]: (e, t, n, i) => {
321
+ [pr.COPY]: (e, t, n, i) => {
322
322
  const { data: u, index: o } = e;
323
323
  return this._fillCopyFormula(u, t, n, o, i);
324
324
  }
@@ -328,39 +328,39 @@ let It = class extends re {
328
328
  }
329
329
  _fillCopyFormula(a, e, t, n, i) {
330
330
  var c, f;
331
- const u = au(i), o = [], m = /* @__PURE__ */ new Map();
331
+ const u = iu(i), o = [], m = /* @__PURE__ */ new Map();
332
332
  for (let d = 1; d <= e; d++) {
333
- const s = (d - 1) % a.length, l = ie.deepClone(a[s]);
334
- if (l) {
335
- const L = ((c = a[s]) == null ? void 0 : c.f) || "", A = ((f = a[s]) == null ? void 0 : f.si) || "", E = Ee(L);
336
- if (Ne(A))
337
- l.si = A, l.f = null, l.v = null, l.p = null, t === X.DOWN || t === X.RIGHT ? o.push(l) : o.unshift(l);
333
+ const l = (d - 1) % a.length, s = ie.deepClone(a[l]);
334
+ if (s) {
335
+ const L = ((c = a[l]) == null ? void 0 : c.f) || "", A = ((f = a[l]) == null ? void 0 : f.si) || "", E = Ie(L);
336
+ if (ye(A))
337
+ s.si = A, s.f = null, s.v = null, s.p = null, s.t = null, t === X.DOWN || t === X.RIGHT ? o.push(s) : o.unshift(s);
338
338
  else if (E) {
339
- let C = m.get(s);
339
+ let C = m.get(l);
340
340
  if (C)
341
- l.si = C, l.f = null, l.v = null, l.p = null;
341
+ s.si = C, s.f = null, s.v = null, s.p = null, s.t = null;
342
342
  else {
343
- C = ie.generateRandomId(6), m.set(s, C);
344
- const { offsetX: T, offsetY: p } = nu(u, t), h = this._lexerTreeBuilder.moveFormulaRefOffset(
343
+ C = ie.generateRandomId(6), m.set(l, C);
344
+ const { offsetX: T, offsetY: p } = au(u, t), h = this._lexerTreeBuilder.moveFormulaRefOffset(
345
345
  L,
346
346
  T,
347
347
  p
348
348
  );
349
- l.si = C, l.f = h, l.v = null, l.p = null;
349
+ s.si = C, s.f = h, s.v = null, s.p = null, s.t = null;
350
350
  }
351
- t === X.DOWN || t === X.RIGHT ? o.push(l) : o.unshift(l);
351
+ t === X.DOWN || t === X.RIGHT ? o.push(s) : o.unshift(s);
352
352
  }
353
353
  }
354
354
  }
355
355
  return o;
356
356
  }
357
357
  };
358
- It = tu([
359
- Le(Ae.Ready, It),
360
- Gn(0, dr),
361
- Gn(1, y(Xe))
362
- ], It);
363
- function nu(a, e) {
358
+ St = nu([
359
+ Le(Ae.Ready, St),
360
+ Gn(0, Lr),
361
+ Gn(1, q(mt))
362
+ ], St);
363
+ function au(a, e) {
364
364
  let t = 0, n = 0;
365
365
  switch (e) {
366
366
  case X.UP:
@@ -378,7 +378,7 @@ function nu(a, e) {
378
378
  }
379
379
  return { offsetX: t, offsetY: n };
380
380
  }
381
- function au(a) {
381
+ function iu(a) {
382
382
  let e = 0;
383
383
  for (const t in a)
384
384
  a[t].forEach((n) => {
@@ -386,13 +386,13 @@ function au(a) {
386
386
  });
387
387
  return e;
388
388
  }
389
- var iu = Object.defineProperty, ru = Object.getOwnPropertyDescriptor, uu = (a, e, t, n) => {
390
- for (var i = n > 1 ? void 0 : n ? ru(e, t) : e, u = a.length - 1, o; u >= 0; u--)
389
+ var ru = Object.defineProperty, uu = Object.getOwnPropertyDescriptor, ou = (a, e, t, n) => {
390
+ for (var i = n > 1 ? void 0 : n ? uu(e, t) : e, u = a.length - 1, o; u >= 0; u--)
391
391
  (o = a[u]) && (i = (n ? o(e, t, i) : o(i)) || i);
392
- return n && i && iu(e, t, i), i;
393
- }, ke = (a, e) => (t, n) => e(t, n, a);
394
- const ou = "default-paste-formula";
395
- let tt = class extends re {
392
+ return n && i && ru(e, t, i), i;
393
+ }, Ke = (a, e) => (t, n) => e(t, n, a);
394
+ const mu = "default-paste-formula";
395
+ let et = class extends re {
396
396
  constructor(a, e, t, n, i) {
397
397
  super(), this._currentUniverSheet = a, this._lexerTreeBuilder = e, this._sheetClipboardService = t, this._injector = n, this._formulaDataModel = i, this._initialize();
398
398
  }
@@ -412,13 +412,13 @@ let tt = class extends re {
412
412
  }
413
413
  _pasteWithFormulaHook() {
414
414
  return {
415
- id: ou,
415
+ id: mu,
416
416
  priority: 10,
417
417
  onPasteCells: (a, e, t, n) => this._onPasteCells(a, e, t, n, !1)
418
418
  };
419
419
  }
420
420
  _onPasteCells(a, e, t, n, i) {
421
- var l;
421
+ var s;
422
422
  const u = n.pasteType;
423
423
  if (u === Ve.SPECIAL_PASTE_VALUE || u === Ve.SPECIAL_PASTE_FORMAT || u === Ve.SPECIAL_PASTE_COL_WIDTH)
424
424
  return {
@@ -429,13 +429,13 @@ let tt = class extends re {
429
429
  copyType: n.copyType || Ea.COPY,
430
430
  copyRange: a == null ? void 0 : a.range,
431
431
  pasteType: n.pasteType
432
- }, m = e.range, c = t, f = this._currentUniverSheet.getCurrentUnitForType(G.UNIVER_SHEET), d = e.unitId || f.getUnitId(), s = e.subUnitId || ((l = f.getActiveSheet()) == null ? void 0 : l.getSheetId());
433
- return !d || !s ? {
432
+ }, m = e.range, c = t, f = this._currentUniverSheet.getCurrentUnitForType(G.UNIVER_SHEET), d = e.unitId || f.getUnitId(), l = e.subUnitId || ((s = f.getActiveSheet()) == null ? void 0 : s.getSheetId());
433
+ return !d || !l ? {
434
434
  undos: [],
435
435
  redos: []
436
- } : this._injector.invoke((L) => mu(
436
+ } : this._injector.invoke((L) => cu(
437
437
  d,
438
- s,
438
+ l,
439
439
  m,
440
440
  c,
441
441
  L,
@@ -447,73 +447,73 @@ let tt = class extends re {
447
447
  ));
448
448
  }
449
449
  };
450
- tt = uu([
451
- Le(Ae.Ready, tt),
452
- ke(0, Pe),
453
- ke(1, y(Xe)),
454
- ke(2, pr),
455
- ke(3, y(mt)),
456
- ke(4, y(Ge))
457
- ], tt);
458
- function mu(a, e, t, n, i, u, o, m, c = !1, f) {
459
- const d = [], s = [], l = new Q(), L = /* @__PURE__ */ new Map();
450
+ et = ou([
451
+ Le(Ae.Ready, et),
452
+ Ke(0, Pe),
453
+ Ke(1, q(mt)),
454
+ Ke(2, Ar),
455
+ Ke(3, q(ot)),
456
+ Ke(4, q(we))
457
+ ], et);
458
+ function cu(a, e, t, n, i, u, o, m, c = !1, f) {
459
+ const d = [], l = [], s = new Q(), L = /* @__PURE__ */ new Map();
460
460
  let A = 0, E = 0;
461
461
  if (u && u.copyRange) {
462
462
  const { copyType: T, copyRange: p } = u;
463
463
  T === Ea.COPY && p && (A = p.rows.length, E = p.cols.length);
464
464
  }
465
465
  n.forValue((T, p, h) => {
466
- var q, D, U, I;
466
+ var y, D, U, I;
467
467
  const _ = h.f || "", V = h.si || "";
468
468
  let R = {};
469
469
  if (c && (R = ie.deepClone(h), R.s = null), !(!A || !E)) {
470
- if (Ne(V)) {
470
+ if (ye(V)) {
471
471
  const { unitId: g = "", subUnitId: te = "", range: W } = f || {};
472
472
  if ((g && a !== g || te && e !== te) && (W != null && W.rows) && (W != null && W.cols)) {
473
- const ne = m.getFormulaStringByCell(W.rows[T], W.cols[p], te, g), Ce = T % A, se = p % E, We = u != null && u.copyRange ? (q = u == null ? void 0 : u.copyRange) == null ? void 0 : q.cols[se] : se, ue = u != null && u.copyRange ? (D = u == null ? void 0 : u.copyRange) == null ? void 0 : D.rows[Ce] : Ce, Ke = t.cols[p] - We, he = t.rows[T] - ue, Ht = o.moveFormulaRefOffset(ne || "", Ke, he);
474
- R.si = null, R.f = Ht, R.v = null, R.p = null;
473
+ const ne = m.getFormulaStringByCell(W.rows[T], W.cols[p], te, g), Re = T % A, se = p % E, Ye = u != null && u.copyRange ? (y = u == null ? void 0 : u.copyRange) == null ? void 0 : y.cols[se] : se, ue = u != null && u.copyRange ? (D = u == null ? void 0 : u.copyRange) == null ? void 0 : D.rows[Re] : Re, We = t.cols[p] - Ye, Ce = t.rows[T] - ue, Vt = o.moveFormulaRefOffset(ne || "", We, Ce);
474
+ R.si = null, R.f = Vt, R.v = null, R.p = null;
475
475
  } else
476
476
  R.si = V, R.f = null, R.v = null, R.p = null;
477
- } else if (Ee(_)) {
477
+ } else if (Ie(_)) {
478
478
  const g = T % A, te = p % E, W = `${g}_${te}`;
479
479
  let ne = L.get(W);
480
480
  if (ne)
481
481
  R.si = ne, R.f = null, R.v = null, R.p = null;
482
482
  else {
483
483
  ne = ie.generateRandomId(6), L.set(W, ne);
484
- const Ce = u != null && u.copyRange ? (U = u == null ? void 0 : u.copyRange) == null ? void 0 : U.cols[te] : te, se = u != null && u.copyRange ? (I = u == null ? void 0 : u.copyRange) == null ? void 0 : I.rows[g] : g, We = t.cols[p] - Ce, ue = t.rows[T] - se, Ke = o.moveFormulaRefOffset(_, We, ue);
485
- R.si = ne, R.f = Ke, R.v = null, R.p = null;
484
+ const Re = u != null && u.copyRange ? (U = u == null ? void 0 : u.copyRange) == null ? void 0 : U.cols[te] : te, se = u != null && u.copyRange ? (I = u == null ? void 0 : u.copyRange) == null ? void 0 : I.rows[g] : g, Ye = t.cols[p] - Re, ue = t.rows[T] - se, We = o.moveFormulaRefOffset(_, Ye, ue);
485
+ R.si = ne, R.f = We, R.v = null, R.p = null;
486
486
  }
487
487
  }
488
488
  if (u.pasteType === Ve.SPECIAL_PASTE_FORMULA && h.p) {
489
- const g = cu(h);
489
+ const g = fu(h);
490
490
  g && (R.p = null, R.v = g);
491
491
  }
492
- l.setValue(t.rows[T], t.cols[p], R);
492
+ s.setValue(t.rows[T], t.cols[p], R);
493
493
  }
494
494
  });
495
495
  const b = {
496
496
  unitId: a,
497
497
  subUnitId: e,
498
- cellValue: l.getData()
498
+ cellValue: s.getData()
499
499
  };
500
500
  d.push({
501
501
  id: pe.id,
502
502
  params: b
503
503
  });
504
- const C = Vi(
504
+ const C = wi(
505
505
  i,
506
506
  b
507
507
  );
508
- return s.push({
508
+ return l.push({
509
509
  id: pe.id,
510
510
  params: C
511
511
  }), {
512
- undos: s,
512
+ undos: l,
513
513
  redos: d
514
514
  };
515
515
  }
516
- function cu(a) {
516
+ function fu(a) {
517
517
  if (a != null && a.p) {
518
518
  const e = a == null ? void 0 : a.p.body;
519
519
  if (e == null)
@@ -522,16 +522,16 @@ function cu(a) {
522
522
  return t.substring(t.length - 2, t.length) === jn ? t.substring(0, t.length - 2) : t;
523
523
  }
524
524
  }
525
- var fu = Object.defineProperty, su = Object.getOwnPropertyDescriptor, lu = (a, e, t, n) => {
526
- for (var i = n > 1 ? void 0 : n ? su(e, t) : e, u = a.length - 1, o; u >= 0; u--)
525
+ var su = Object.defineProperty, lu = Object.getOwnPropertyDescriptor, du = (a, e, t, n) => {
526
+ for (var i = n > 1 ? void 0 : n ? lu(e, t) : e, u = a.length - 1, o; u >= 0; u--)
527
527
  (o = a[u]) && (i = (n ? o(e, t, i) : o(i)) || i);
528
- return n && i && fu(e, t, i), i;
529
- }, be = (a, e) => (t, n) => e(t, n, a);
528
+ return n && i && su(e, t, i), i;
529
+ }, _e = (a, e) => (t, n) => e(t, n, a);
530
530
  let _t = class extends re {
531
- constructor(e, t, n, i, u, o, m, c, f, d) {
531
+ constructor(e, t, n, i, u, o, m, c) {
532
532
  super();
533
533
  x(this, "_previousShape");
534
- this._context = e, this._editorBridgeService = t, this._formulaDataModel = n, this._lexerTreeBuilder = i, this._themeService = u, this._renderManagerService = o, this._selectionRenderService = m, this._sheetSkeletonManagerService = c, this._commandService = f, this._sheetInterceptorService = d, this._initInterceptorEditorStart(), this._commandExecutedListener(), this._initInterceptorCell();
534
+ this._context = e, this._editorBridgeService = t, this._formulaDataModel = n, this._themeService = i, this._renderManagerService = u, this._selectionRenderService = o, this._sheetSkeletonManagerService = m, this._commandService = c, this._initInterceptorEditorStart(), this._commandExecutedListener();
535
535
  }
536
536
  _initInterceptorEditorStart() {
537
537
  this.disposeWithMe(
@@ -544,18 +544,18 @@ let _t = class extends re {
544
544
  const { row: i, col: u, unitId: o, subUnitId: m, worksheet: c } = t, f = this._formulaDataModel.getArrayFormulaRange(), d = this._formulaDataModel.getArrayFormulaCellData();
545
545
  if (this._removeArrayFormulaRangeShape(), e == null)
546
546
  return n(e);
547
- let s = null;
548
- const l = this._formulaDataModel.getFormulaStringByCell(i, u, m, o);
549
- if (l !== null && (s = { f: l }), e.v != null && e.v !== "" && ((b = (E = (A = d[o]) == null ? void 0 : A[m]) == null ? void 0 : E[i]) == null ? void 0 : b[u]) == null)
550
- return s ? { ...e, ...s } : n(e);
547
+ let l = null;
548
+ const s = this._formulaDataModel.getFormulaStringByCell(i, u, m, o);
549
+ if (s !== null && (l = { f: s }), e.v != null && e.v !== "" && ((b = (E = (A = d[o]) == null ? void 0 : A[m]) == null ? void 0 : E[i]) == null ? void 0 : b[u]) == null)
550
+ return l ? { ...e, ...l } : n(e);
551
551
  const L = (C = f == null ? void 0 : f[o]) == null ? void 0 : C[m];
552
552
  return L != null && new Q(L).forValue((T, p, h) => {
553
553
  if (h == null)
554
554
  return !0;
555
- const { startRow: _, startColumn: V, endRow: R, endColumn: q } = h;
555
+ const { startRow: _, startColumn: V, endRow: R, endColumn: y } = h;
556
556
  if (T === i && p === u)
557
557
  return this._createArrayFormulaRangeShape(h, o), !1;
558
- if (i >= _ && i <= R && u >= V && u <= q) {
558
+ if (i >= _ && i <= R && u >= V && u <= y) {
559
559
  const D = c.getCell(_, V);
560
560
  if ((D == null ? void 0 : D.v) === K.SPILL)
561
561
  return;
@@ -565,34 +565,21 @@ let _t = class extends re {
565
565
  m,
566
566
  o
567
567
  );
568
- return U == null || U.f == null ? !0 : (s == null && (s = {
568
+ return U == null || U.f == null ? !0 : (l == null && (l = {
569
569
  f: U.f,
570
570
  isInArrayFormulaRange: !0
571
571
  }), this._createArrayFormulaRangeShape(h, o), !1);
572
572
  }
573
- }), s ? { ...e, ...s } : n(e);
573
+ }), l ? { ...e, ...l } : n(e);
574
574
  }
575
575
  }
576
576
  )
577
577
  )
578
578
  );
579
579
  }
580
- _initInterceptorCell() {
581
- this.disposeWithMe(
582
- this._sheetInterceptorService.intercept(pn.CELL_CONTENT, {
583
- handler: (e, t, n) => e && e.v == null && e.t == null && e.f != null ? n({
584
- ...e,
585
- v: null,
586
- // Default value for empty cell, information displayed before calculation
587
- t: He.NUMBER
588
- }) : n(e),
589
- priority: 10
590
- })
591
- );
592
- }
593
580
  _commandExecutedListener() {
594
581
  this.disposeWithMe(this._commandService.onCommandExecuted((e, t) => {
595
- (e.id === ta.id || e.id === Ct.id && t && t.remove) && this._removeArrayFormulaRangeShape();
582
+ (e.id === ea.id || e.id === Ct.id && t && t.remove) && this._removeArrayFormulaRangeShape();
596
583
  }));
597
584
  }
598
585
  _createArrayFormulaRangeShape(e, t) {
@@ -611,56 +598,54 @@ let _t = class extends re {
611
598
  style: u
612
599
  }), f = (L = this._sheetSkeletonManagerService.getCurrent()) == null ? void 0 : L.skeleton;
613
600
  if (!o || !f) return;
614
- const { rowHeaderWidth: d, columnHeaderHeight: s } = f, l = new Lr(o, 100, !1, this._themeService);
615
- l.update(m, d, s, u, c), l.setEvent(!1), this._previousShape = l;
601
+ const { rowHeaderWidth: d, columnHeaderHeight: l } = f, s = new Pr(o, 100, !1, this._themeService);
602
+ s.update(m, d, l, u, c), s.setEvent(!1), this._previousShape = s;
616
603
  }
617
604
  _removeArrayFormulaRangeShape() {
618
605
  this._previousShape != null && (this._previousShape.dispose(), this._previousShape = null);
619
606
  }
620
607
  };
621
- _t = lu([
622
- be(1, y(Sa)),
623
- be(2, y(Ge)),
624
- be(3, y(Xe)),
625
- be(4, y(fn)),
626
- be(5, Ft),
627
- be(6, Na),
628
- be(7, y(Ia)),
629
- be(8, fe),
630
- be(9, y(Ut))
608
+ _t = du([
609
+ _e(1, q(Sa)),
610
+ _e(2, q(we)),
611
+ _e(3, q(sn)),
612
+ _e(4, Ft),
613
+ _e(5, Na),
614
+ _e(6, q(Ia)),
615
+ _e(7, fe)
631
616
  ], _t);
632
617
  const _a = {
633
618
  id: "sheet.command.paste-formula",
634
- type: Se.COMMAND,
635
- handler: async (a) => a.get(fe).executeCommand(Ar.id, {
619
+ type: Te.COMMAND,
620
+ handler: async (a) => a.get(fe).executeCommand(br.id, {
636
621
  value: Ve.SPECIAL_PASTE_FORMULA
637
622
  })
638
623
  }, Oa = {
639
624
  id: "formula-ui.command.insert-function",
640
- type: Se.COMMAND,
625
+ type: Te.COMMAND,
641
626
  handler: async (a, e) => {
642
627
  const { list: t } = e, n = a.get(fe), i = new Q();
643
628
  t.forEach((o) => {
644
- const { range: m, primary: c, formula: f } = o, { row: d, column: s } = c, l = ie.generateRandomId(6);
645
- i.setValue(d, s, {
629
+ const { range: m, primary: c, formula: f } = o, { row: d, column: l } = c, s = ie.generateRandomId(6);
630
+ i.setValue(d, l, {
646
631
  f,
647
- si: l
632
+ si: s
648
633
  });
649
634
  const { startRow: L, startColumn: A, endRow: E, endColumn: b } = m;
650
635
  for (let C = L; C <= E; C++)
651
636
  for (let T = A; T <= b; T++)
652
- (C !== d || T !== s) && i.setValue(C, T, {
653
- si: l
637
+ (C !== d || T !== l) && i.setValue(C, T, {
638
+ si: s
654
639
  });
655
640
  });
656
641
  const u = {
657
642
  value: i.getData()
658
643
  };
659
- return n.executeCommand(Hi.id, u);
644
+ return n.executeCommand(Gi.id, u);
660
645
  }
661
- }, ye = {
646
+ }, qe = {
662
647
  id: "formula-ui.operation.select-editor-formula",
663
- type: Se.OPERATION,
648
+ type: Te.OPERATION,
664
649
  handler: (a, e) => (
665
650
  // const { eventType, keycode } = params;
666
651
  // const formulaPromptService = accessor.get(IFormulaPromptService);
@@ -690,14 +675,14 @@ const _a = {
690
675
  // }
691
676
  !0
692
677
  )
693
- }, Fe = yt("formula-ui.prompt-service");
678
+ }, Fe = qt("formula-ui.prompt-service");
694
679
  class Ma {
695
680
  constructor() {
696
- x(this, "_search$", new ve());
697
- x(this, "_help$", new ve());
698
- x(this, "_navigate$", new ve());
699
- x(this, "_accept$", new ve());
700
- x(this, "_acceptFormulaName$", new ve());
681
+ x(this, "_search$", new xe());
682
+ x(this, "_help$", new xe());
683
+ x(this, "_navigate$", new xe());
684
+ x(this, "_accept$", new xe());
685
+ x(this, "_acceptFormulaName$", new xe());
701
686
  x(this, "search$", this._search$.asObservable());
702
687
  x(this, "help$", this._help$.asObservable());
703
688
  x(this, "navigate$", this._navigate$.asObservable());
@@ -856,35 +841,35 @@ class Ma {
856
841
  return this._isLockedOnSelectionInsertRefString;
857
842
  }
858
843
  }
859
- const un = {
844
+ const on = {
860
845
  id: "formula-ui.operation.help-function",
861
- type: Se.OPERATION,
846
+ type: Te.OPERATION,
862
847
  handler: async (a, e) => (a.get(Fe).help(e), !0)
863
- }, bn = {
848
+ }, Tn = {
864
849
  id: "formula-ui.operation.insert-function",
865
- type: Se.OPERATION,
850
+ type: Te.OPERATION,
866
851
  handler: async (a, e) => {
867
852
  var C, T;
868
- const t = a.get(Ln), n = a.get(ft), i = t.getSelections();
853
+ const t = a.get(An), n = a.get(Ge), i = t.getSelections();
869
854
  if (!i || !i.length)
870
855
  return !1;
871
- const u = wi(a.get(Pe));
856
+ const u = Xi(a.get(Pe));
872
857
  if (!u) return !1;
873
- const { worksheet: o, unitId: m, subUnitId: c } = u, f = o.getCellMatrix(), { value: d } = e, s = a.get(fe), l = [];
858
+ const { worksheet: o, unitId: m, subUnitId: c } = u, f = o.getCellMatrix(), { value: d } = e, l = a.get(fe), s = [];
874
859
  let L = null, A = 0, E = 0, b = "";
875
- if (i.length === 1 && (Lu(i[0].range) || Au(i[0].range))) {
860
+ if (i.length === 1 && (Au(i[0].range) || Pu(i[0].range))) {
876
861
  const { range: p, primary: h } = i[0], _ = (C = h == null ? void 0 : h.actualRow) != null ? C : p.startRow, V = (T = h == null ? void 0 : h.actualColumn) != null ? T : p.startColumn;
877
862
  L = p, A = _, E = V;
878
863
  const R = Xn(f, _, V);
879
- R && (b = ot(R));
864
+ R && (b = ut(R));
880
865
  } else
881
866
  i.some((p) => {
882
867
  var I, g;
883
- const { range: h, primary: _ } = p, V = (I = _ == null ? void 0 : _.actualRow) != null ? I : h.startRow, R = (g = _ == null ? void 0 : _.actualColumn) != null ? g : h.startColumn, q = Xn(f, V, R);
884
- if (!q)
868
+ const { range: h, primary: _ } = p, V = (I = _ == null ? void 0 : _.actualRow) != null ? I : h.startRow, R = (g = _ == null ? void 0 : _.actualColumn) != null ? g : h.startColumn, y = Xn(f, V, R);
869
+ if (!y)
885
870
  return L = h, A = V, E = R, !0;
886
- const D = ot(q), U = `=${d}(${D})`;
887
- return l.push({
871
+ const D = ut(y), U = `=${d}(${D})`;
872
+ return s.push({
888
873
  range: h,
889
874
  primary: {
890
875
  row: V,
@@ -894,8 +879,8 @@ const un = {
894
879
  }), !1;
895
880
  });
896
881
  if (L) {
897
- const p = Gi(A, E, o), h = {
898
- range: ge.clone(L),
882
+ const p = Yi(A, E, o), h = {
883
+ range: De.clone(L),
899
884
  primary: {
900
885
  startRow: p.startRow,
901
886
  startColumn: p.startColumn,
@@ -909,20 +894,20 @@ const un = {
909
894
  }, _ = {
910
895
  unitId: m,
911
896
  subUnitId: c,
912
- pluginName: De,
897
+ pluginName: Me,
913
898
  selections: [h]
914
899
  };
915
- await s.executeCommand(Xi.id, _), setTimeout(() => {
900
+ await l.executeCommand(Wi.id, _), setTimeout(() => {
916
901
  n.setFormula(`=${d}(${b}`);
917
902
  }, 0);
918
903
  }
919
- return l.length === 0 ? !1 : s.executeCommand(Oa.id, {
920
- list: l
904
+ return s.length === 0 ? !1 : l.executeCommand(Oa.id, {
905
+ list: s
921
906
  });
922
907
  }
923
908
  };
924
909
  function Xn(a, e, t) {
925
- const n = du(a, e, t);
910
+ const n = pu(a, e, t);
926
911
  if (n !== e)
927
912
  return {
928
913
  startRow: n,
@@ -930,7 +915,7 @@ function Xn(a, e, t) {
930
915
  startColumn: t,
931
916
  endColumn: t
932
917
  };
933
- const i = pu(a, e, t);
918
+ const i = Lu(a, e, t);
934
919
  return i !== t ? {
935
920
  startRow: e,
936
921
  endRow: e,
@@ -938,7 +923,7 @@ function Xn(a, e, t) {
938
923
  endColumn: t - 1
939
924
  } : null;
940
925
  }
941
- function du(a, e, t) {
926
+ function pu(a, e, t) {
942
927
  let n = !1;
943
928
  if (e === 0) return e;
944
929
  for (let i = e - 1; i >= 0; i--) {
@@ -955,7 +940,7 @@ function du(a, e, t) {
955
940
  }
956
941
  return e;
957
942
  }
958
- function pu(a, e, t) {
943
+ function Lu(a, e, t) {
959
944
  let n = !1;
960
945
  if (t === 0) return t;
961
946
  for (let i = t - 1; i >= 0; i--) {
@@ -980,31 +965,31 @@ function Ot(a) {
980
965
  const t = e.dataStream, i = t.substring(t.length - 2, t.length) === jn ? t.substring(0, t.length - 2) : t;
981
966
  return za(i);
982
967
  }
983
- return a && (a.t === He.NUMBER || Za(a) === He.NUMBER);
968
+ return a && (a.t === Rt.NUMBER || Za(a) === Rt.NUMBER);
984
969
  }
985
- function Lu(a) {
970
+ function Au(a) {
986
971
  return a.startRow === a.endRow && a.startColumn === a.endColumn;
987
972
  }
988
- function Au(a) {
973
+ function Pu(a) {
989
974
  return a.startRow !== a.endRow && a.startColumn !== a.endColumn;
990
975
  }
991
- const Da = `${Pn}_MORE_FUNCTIONS_COMPONENT`, ga = {
976
+ const Da = `${bn}_MORE_FUNCTIONS_COMPONENT`, ga = {
992
977
  id: "formula-ui.operation.more-functions",
993
- type: Se.OPERATION,
994
- handler: async (a) => (a.get(Ir).open({
978
+ type: Te.OPERATION,
979
+ handler: async (a) => (a.get(Rr).open({
995
980
  header: { title: "formula.insert.tooltip" },
996
981
  children: { label: Da }
997
982
  }), !0)
998
- }, Tn = {
983
+ }, En = {
999
984
  id: "formula-ui.operation.change-ref-to-absolute",
1000
- type: Se.OPERATION,
985
+ type: Te.OPERATION,
1001
986
  handler: async (a) => !0
1002
- }, on = {
987
+ }, mn = {
1003
988
  id: "formula-ui.operation.search-function",
1004
- type: Se.OPERATION,
989
+ type: Te.OPERATION,
1005
990
  handler: async (a, e) => (a.get(Fe).search(e), !0)
1006
991
  };
1007
- var xa = { exports: {} }, Bt = {};
992
+ var xa = { exports: {} }, Ut = {};
1008
993
  /**
1009
994
  * @license React
1010
995
  * react-jsx-runtime.production.min.js
@@ -1014,18 +999,18 @@ var xa = { exports: {} }, Bt = {};
1014
999
  * This source code is licensed under the MIT license found in the
1015
1000
  * LICENSE file in the root directory of this source tree.
1016
1001
  */
1017
- var Pu = Hr, bu = Symbol.for("react.element"), Tu = Symbol.for("react.fragment"), Eu = Object.prototype.hasOwnProperty, Su = Pu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Iu = { key: !0, ref: !0, __self: !0, __source: !0 };
1002
+ var bu = wr, Tu = Symbol.for("react.element"), Eu = Symbol.for("react.fragment"), Su = Object.prototype.hasOwnProperty, Iu = bu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Nu = { key: !0, ref: !0, __self: !0, __source: !0 };
1018
1003
  function va(a, e, t) {
1019
1004
  var n, i = {}, u = null, o = null;
1020
1005
  t !== void 0 && (u = "" + t), e.key !== void 0 && (u = "" + e.key), e.ref !== void 0 && (o = e.ref);
1021
- for (n in e) Eu.call(e, n) && !Iu.hasOwnProperty(n) && (i[n] = e[n]);
1006
+ for (n in e) Su.call(e, n) && !Nu.hasOwnProperty(n) && (i[n] = e[n]);
1022
1007
  if (a && a.defaultProps) for (n in e = a.defaultProps, e) i[n] === void 0 && (i[n] = e[n]);
1023
- return { $$typeof: bu, type: a, key: u, ref: o, props: i, _owner: Su.current };
1008
+ return { $$typeof: Tu, type: a, key: u, ref: o, props: i, _owner: Iu.current };
1024
1009
  }
1025
- Bt.Fragment = Tu;
1026
- Bt.jsx = va;
1027
- Bt.jsxs = va;
1028
- xa.exports = Bt;
1010
+ Ut.Fragment = Eu;
1011
+ Ut.jsx = va;
1012
+ Ut.jsxs = va;
1013
+ xa.exports = Ut;
1029
1014
  var N = xa.exports, ce = function() {
1030
1015
  return ce = Object.assign || function(a) {
1031
1016
  for (var e, t = 1, n = arguments.length; t < n; t++) {
@@ -1034,23 +1019,23 @@ var N = xa.exports, ce = function() {
1034
1019
  }
1035
1020
  return a;
1036
1021
  }, ce.apply(this, arguments);
1037
- }, Nu = function(a, e) {
1022
+ }, Ru = function(a, e) {
1038
1023
  var t = {};
1039
1024
  for (var n in a) Object.prototype.hasOwnProperty.call(a, n) && e.indexOf(n) < 0 && (t[n] = a[n]);
1040
1025
  if (a != null && typeof Object.getOwnPropertySymbols == "function")
1041
1026
  for (var i = 0, n = Object.getOwnPropertySymbols(a); i < n.length; i++)
1042
1027
  e.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(a, n[i]) && (t[n[i]] = a[n[i]]);
1043
1028
  return t;
1044
- }, dt = st(function(a, e) {
1045
- var t = a.icon, n = a.id, i = a.className, u = a.extend, o = Nu(a, ["icon", "id", "className", "extend"]), m = "univerjs-icon univerjs-icon-".concat(n, " ").concat(i || "").trim(), c = Ca("_".concat(hu()));
1046
- return qa(t, "".concat(n), { defIds: t.defIds, idSuffix: c.current }, ce({ ref: e, className: m }, o), u);
1029
+ }, lt = ft(function(a, e) {
1030
+ var t = a.icon, n = a.id, i = a.className, u = a.extend, o = Ru(a, ["icon", "id", "className", "extend"]), m = "univerjs-icon univerjs-icon-".concat(n, " ").concat(i || "").trim(), c = Ca("_".concat(_u()));
1031
+ return ya(t, "".concat(n), { defIds: t.defIds, idSuffix: c.current }, ce({ ref: e, className: m }, o), u);
1047
1032
  });
1048
- function qa(a, e, t, n, i) {
1049
- return lt(a.tag, ce(ce({ key: e }, Ru(a, t, i)), n), (Cu(a, t).children || []).map(function(u, o) {
1050
- return qa(u, "".concat(e, "-").concat(a.tag, "-").concat(o), t, void 0, i);
1033
+ function ya(a, e, t, n, i) {
1034
+ return st(a.tag, ce(ce({ key: e }, Cu(a, t, i)), n), (hu(a, t).children || []).map(function(u, o) {
1035
+ return ya(u, "".concat(e, "-").concat(a.tag, "-").concat(o), t, void 0, i);
1051
1036
  }));
1052
1037
  }
1053
- function Ru(a, e, t) {
1038
+ function Cu(a, e, t) {
1054
1039
  var n = ce({}, a.attrs);
1055
1040
  t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1);
1056
1041
  var i = e.defIds;
@@ -1059,55 +1044,55 @@ function Ru(a, e, t) {
1059
1044
  typeof m == "string" && (n[o] = m.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
1060
1045
  })), n;
1061
1046
  }
1062
- function Cu(a, e) {
1047
+ function hu(a, e) {
1063
1048
  var t, n = e.defIds;
1064
1049
  return !n || n.length === 0 ? a : a.tag === "defs" && (!((t = a.children) === null || t === void 0) && t.length) ? ce(ce({}, a), { children: a.children.map(function(i) {
1065
1050
  return typeof i.attrs.id == "string" && n && n.indexOf(i.attrs.id) > -1 ? ce(ce({}, i), { attrs: ce(ce({}, i.attrs), { id: i.attrs.id + e.idSuffix }) }) : i;
1066
1051
  }) }) : a;
1067
1052
  }
1068
- function hu() {
1053
+ function _u() {
1069
1054
  return Math.random().toString(36).substring(2, 8);
1070
1055
  }
1071
- dt.displayName = "UniverIcon";
1072
- var _u = { 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" } }] }, ya = st(function(a, e) {
1073
- return lt(dt, Object.assign({}, a, {
1056
+ lt.displayName = "UniverIcon";
1057
+ var Ou = { 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" } }] }, qa = ft(function(a, e) {
1058
+ return st(lt, Object.assign({}, a, {
1074
1059
  id: "check-mark-single",
1075
1060
  ref: e,
1076
- icon: _u
1061
+ icon: Ou
1077
1062
  }));
1078
1063
  });
1079
- ya.displayName = "CheckMarkSingle";
1080
- var Ou = { 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" } }] }, Fa = st(function(a, e) {
1081
- return lt(dt, Object.assign({}, a, {
1064
+ qa.displayName = "CheckMarkSingle";
1065
+ var Mu = { 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" } }] }, Fa = ft(function(a, e) {
1066
+ return st(lt, Object.assign({}, a, {
1082
1067
  id: "close-single",
1083
1068
  ref: e,
1084
- icon: Ou
1069
+ icon: Mu
1085
1070
  }));
1086
1071
  });
1087
1072
  Fa.displayName = "CloseSingle";
1088
- var Mu = { 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" } }] }, Ua = st(function(a, e) {
1089
- return lt(dt, Object.assign({}, a, {
1073
+ var Du = { 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" } }] }, Ua = ft(function(a, e) {
1074
+ return st(lt, Object.assign({}, a, {
1090
1075
  id: "details-single",
1091
1076
  ref: e,
1092
- icon: Mu
1077
+ icon: Du
1093
1078
  }));
1094
1079
  });
1095
1080
  Ua.displayName = "DetailsSingle";
1096
- var Du = { 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" } }] }, Ba = st(function(a, e) {
1097
- return lt(dt, Object.assign({}, a, {
1081
+ var gu = { 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" } }] }, Ba = ft(function(a, e) {
1082
+ return st(lt, Object.assign({}, a, {
1098
1083
  id: "more-single",
1099
1084
  ref: e,
1100
- icon: Du
1085
+ icon: gu
1101
1086
  }));
1102
1087
  });
1103
1088
  Ba.displayName = "MoreSingle";
1104
- function gu(a, e) {
1105
- return Object.keys(a).filter((t) => isNaN(Number(t))).map((t) => ({
1089
+ function xu(a, e) {
1090
+ return Object.keys(a).filter((t) => isNaN(Number(t)) && t !== "DefinedName").map((t) => ({
1106
1091
  label: e.t(`formula.functionType.${t.toLocaleLowerCase()}`),
1107
1092
  value: `${a[t]}`
1108
1093
  }));
1109
1094
  }
1110
- function xu(a, e) {
1095
+ function vu(a, e) {
1111
1096
  let t = "";
1112
1097
  return a.aliasFunctionName ? (t = e.t(a.aliasFunctionName), t === a.aliasFunctionName && (t = a.functionName)) : t = a.functionName, t;
1113
1098
  }
@@ -1121,28 +1106,28 @@ function Va(a) {
1121
1106
  if (a.require && a.repeat)
1122
1107
  return `${a.name},...`;
1123
1108
  }
1124
- const vu = "univer-formula-help-function", qu = "univer-formula-help-function-title", yu = "univer-formula-help-function-title-icons", Fu = "univer-formula-help-function-title-icon", Uu = "univer-formula-help-function-content", Bu = "univer-formula-help-function-content-inner", Vu = "univer-formula-help-function-content-params", Hu = "univer-formula-help-function-content-params-title", wu = "univer-formula-help-function-content-params-detail", Gu = "univer-formula-help-function-active", Xu = "univer-formula-help-decorator", Yu = "univer-formula-help-param", Wu = "univer-formula-help-param-prefix", Ku = "univer-formula-help-param-item", ku = "univer-formula-help-param-active", ee = {
1125
- formulaHelpFunction: vu,
1109
+ const yu = "univer-formula-help-function", qu = "univer-formula-help-function-title", Fu = "univer-formula-help-function-title-icons", Uu = "univer-formula-help-function-title-icon", Bu = "univer-formula-help-function-content", Vu = "univer-formula-help-function-content-inner", Hu = "univer-formula-help-function-content-params", wu = "univer-formula-help-function-content-params-title", Gu = "univer-formula-help-function-content-params-detail", Xu = "univer-formula-help-function-active", Yu = "univer-formula-help-decorator", Wu = "univer-formula-help-param", Ku = "univer-formula-help-param-prefix", ku = "univer-formula-help-param-item", $u = "univer-formula-help-param-active", ee = {
1110
+ formulaHelpFunction: yu,
1126
1111
  formulaHelpFunctionTitle: qu,
1127
- formulaHelpFunctionTitleIcons: yu,
1128
- formulaHelpFunctionTitleIcon: Fu,
1129
- formulaHelpFunctionContent: Uu,
1130
- formulaHelpFunctionContentInner: Bu,
1131
- formulaHelpFunctionContentParams: Vu,
1132
- formulaHelpFunctionContentParamsTitle: Hu,
1133
- formulaHelpFunctionContentParamsDetail: wu,
1134
- formulaHelpFunctionActive: Gu,
1135
- formulaHelpDecorator: Xu,
1136
- formulaHelpParam: Yu,
1137
- formulaHelpParamPrefix: Wu,
1138
- formulaHelpParamItem: Ku,
1139
- formulaHelpParamActive: ku
1112
+ formulaHelpFunctionTitleIcons: Fu,
1113
+ formulaHelpFunctionTitleIcon: Uu,
1114
+ formulaHelpFunctionContent: Bu,
1115
+ formulaHelpFunctionContentInner: Vu,
1116
+ formulaHelpFunctionContentParams: Hu,
1117
+ formulaHelpFunctionContentParamsTitle: wu,
1118
+ formulaHelpFunctionContentParamsDetail: Gu,
1119
+ formulaHelpFunctionActive: Xu,
1120
+ formulaHelpDecorator: Yu,
1121
+ formulaHelpParam: Wu,
1122
+ formulaHelpParamPrefix: Ku,
1123
+ formulaHelpParamItem: ku,
1124
+ formulaHelpParamActive: $u
1140
1125
  };
1141
- function $u() {
1142
- const [a, e] = Y(!1), [t, n] = Y(!0), [i, u] = Y(!0), [o, m] = Y(0), [c, f] = Y([0, 0]), [d, s] = Y({ left: 0, top: 0 }), [l, L] = Y(null), A = le(Fe), E = le(we), b = E.t("formula.prompt.required"), C = E.t("formula.prompt.optional"), T = le(Pe), p = le(ft);
1126
+ function ju() {
1127
+ const [a, e] = Y(!1), [t, n] = Y(!0), [i, u] = Y(!0), [o, m] = Y(0), [c, f] = Y([0, 0]), [d, l] = Y({ left: 0, top: 0 }), [s, L] = Y(null), A = le(Fe), E = le(He), b = E.t("formula.prompt.required"), C = E.t("formula.prompt.optional"), T = le(Pe), p = le(Ge);
1143
1128
  ht(() => {
1144
- const R = A.help$.subscribe((q) => {
1145
- const { visible: D, paramIndex: U, functionInfo: I } = q;
1129
+ const R = A.help$.subscribe((y) => {
1130
+ const { visible: D, paramIndex: U, functionInfo: I } = y;
1146
1131
  if (!D) {
1147
1132
  e(D);
1148
1133
  return;
@@ -1151,17 +1136,17 @@ function $u() {
1151
1136
  if (g == null)
1152
1137
  return;
1153
1138
  const { left: te, top: W, height: ne } = g;
1154
- I.description === "" && I.functionParameter.length === 0 || (f([te, W + ne]), m(U), L(I), s({ left: te, top: W }), e(D));
1139
+ I.description === "" && I.functionParameter.length === 0 || (f([te, W + ne]), m(U), L(I), l({ left: te, top: W }), e(D));
1155
1140
  });
1156
1141
  return () => {
1157
1142
  R == null || R.unsubscribe();
1158
1143
  };
1159
1144
  }, []);
1160
1145
  function h() {
1161
- const q = T.getCurrentUniverDocInstance().getUnitId();
1162
- if (!p.isEditor(q))
1146
+ const y = T.getCurrentUniverDocInstance().getUnitId();
1147
+ if (!p.isEditor(y))
1163
1148
  return;
1164
- const D = p.getEditor(q);
1149
+ const D = p.getEditor(y);
1165
1150
  return D == null ? void 0 : D.getBoundingClientRect();
1166
1151
  }
1167
1152
  function _(R) {
@@ -1170,13 +1155,13 @@ function $u() {
1170
1155
  function V() {
1171
1156
  u(!i);
1172
1157
  }
1173
- return /* @__PURE__ */ N.jsx(N.Fragment, { children: i ? /* @__PURE__ */ N.jsx(ha, { visible: a, offset: c, children: l ? /* @__PURE__ */ N.jsxs("div", { className: ee.formulaHelpFunction, children: [
1158
+ return /* @__PURE__ */ N.jsx(N.Fragment, { children: i ? /* @__PURE__ */ N.jsx(ha, { visible: a, offset: c, children: s ? /* @__PURE__ */ N.jsxs("div", { className: ee.formulaHelpFunction, children: [
1174
1159
  /* @__PURE__ */ N.jsxs("div", { className: ee.formulaHelpFunctionTitle, children: [
1175
1160
  /* @__PURE__ */ N.jsx(
1176
- ju,
1161
+ Qu,
1177
1162
  {
1178
- prefix: l.functionName,
1179
- value: l.functionParameter,
1163
+ prefix: s.functionName,
1164
+ value: s.functionParameter,
1180
1165
  active: o,
1181
1166
  onClick: _
1182
1167
  }
@@ -1214,24 +1199,24 @@ function $u() {
1214
1199
  $t,
1215
1200
  {
1216
1201
  title: E.t("formula.prompt.helpExample"),
1217
- value: `${l.functionName}(${l.functionParameter.map((R) => R.example).join(",")})`
1202
+ value: `${s.functionName}(${s.functionParameter.map((R) => R.example).join(",")})`
1218
1203
  }
1219
1204
  ),
1220
1205
  /* @__PURE__ */ N.jsx(
1221
1206
  $t,
1222
1207
  {
1223
1208
  title: E.t("formula.prompt.helpAbstract"),
1224
- value: l.description
1209
+ value: s.description
1225
1210
  }
1226
1211
  ),
1227
- l && l.functionParameter && l.functionParameter.map((R, q) => /* @__PURE__ */ N.jsx(
1212
+ s && s.functionParameter && s.functionParameter.map((R, y) => /* @__PURE__ */ N.jsx(
1228
1213
  $t,
1229
1214
  {
1230
- className: o === q ? ee.formulaHelpFunctionActive : "",
1215
+ className: o === y ? ee.formulaHelpFunctionActive : "",
1231
1216
  title: R.name,
1232
1217
  value: `${R.require ? b : C} ${R.detail}`
1233
1218
  },
1234
- q
1219
+ y
1235
1220
  ))
1236
1221
  ] })
1237
1222
  }
@@ -1249,7 +1234,7 @@ function $u() {
1249
1234
  const $t = (a) => /* @__PURE__ */ N.jsxs("div", { className: ee.formulaHelpFunctionContentParams, children: [
1250
1235
  /* @__PURE__ */ N.jsx("div", { className: `${ee.formulaHelpFunctionContentParamsTitle} ${a.className}`, children: a.title }),
1251
1236
  /* @__PURE__ */ N.jsx("div", { className: ee.formulaHelpFunctionContentParamsDetail, children: a.value })
1252
- ] }), ju = (a) => {
1237
+ ] }), Qu = (a) => {
1253
1238
  const { prefix: e, value: t, active: n, onClick: i } = a;
1254
1239
  return /* @__PURE__ */ N.jsxs("div", { className: ee.formulaHelpParam, children: [
1255
1240
  /* @__PURE__ */ N.jsxs("span", { className: ee.formulaHelpParamPrefix, children: [
@@ -1272,49 +1257,49 @@ const $t = (a) => /* @__PURE__ */ N.jsxs("div", { className: ee.formulaHelpFunct
1272
1257
  )),
1273
1258
  ")"
1274
1259
  ] });
1275
- }, Qu = "univer-formula-search-function", zu = "univer-formula-search-function-item", Zu = "univer-formula-search-function-item-name", Ju = "univer-formula-search-function-item-name-light", eo = "univer-formula-search-function-item-desc", to = "univer-formula-search-function-item-active", Ie = {
1276
- formulaSearchFunction: Qu,
1277
- formulaSearchFunctionItem: zu,
1278
- formulaSearchFunctionItemName: Zu,
1279
- formulaSearchFunctionItemNameLight: Ju,
1280
- formulaSearchFunctionItemDesc: eo,
1281
- formulaSearchFunctionItemActive: to
1260
+ }, zu = "univer-formula-search-function", Zu = "univer-formula-search-function-item", Ju = "univer-formula-search-function-item-name", eo = "univer-formula-search-function-item-name-light", to = "univer-formula-search-function-item-desc", no = "univer-formula-search-function-item-active", Ee = {
1261
+ formulaSearchFunction: zu,
1262
+ formulaSearchFunctionItem: Zu,
1263
+ formulaSearchFunctionItemName: Ju,
1264
+ formulaSearchFunctionItemNameLight: eo,
1265
+ formulaSearchFunctionItemDesc: to,
1266
+ formulaSearchFunctionItemActive: no
1282
1267
  };
1283
- function no() {
1284
- const [a, e] = Y(!1), [t, n] = Y(0), [i, u] = Y([0, 0]), [o, m] = Y([]), [c, f] = Y(""), d = Ca(null), s = le(Fe), l = le(Pe), L = le(ft);
1268
+ function ao() {
1269
+ const [a, e] = Y(!1), [t, n] = Y(0), [i, u] = Y([0, 0]), [o, m] = Y([]), [c, f] = Y(""), d = Ca(null), l = le(Fe), s = le(Pe), L = le(Ge);
1285
1270
  ht(() => {
1286
1271
  let T = [], p = 0;
1287
- const h = s.search$.subscribe((R) => {
1288
- const { visible: q, searchText: D, searchList: U } = R;
1289
- if (!q) {
1290
- e(q);
1272
+ const h = l.search$.subscribe((R) => {
1273
+ const { visible: y, searchText: D, searchList: U } = R;
1274
+ if (!y) {
1275
+ e(y);
1291
1276
  return;
1292
1277
  }
1293
1278
  const I = A();
1294
1279
  if (I == null)
1295
1280
  return;
1296
1281
  const { left: g, top: te, height: W } = I;
1297
- f(D), m(U), T = U, u([g, te + W]), e(q), n(0), p = 0;
1298
- }), _ = s.navigate$.subscribe((R) => {
1299
- const { direction: q } = R;
1300
- if (q === X.UP) {
1282
+ f(D), m(U), T = U, u([g, te + W]), e(y), n(0), p = 0;
1283
+ }), _ = l.navigate$.subscribe((R) => {
1284
+ const { direction: y } = R;
1285
+ if (y === X.UP) {
1301
1286
  let D = p - 1;
1302
1287
  D = D < 0 ? T.length - 1 : D, n(D), p = D;
1303
- } else if (q === X.DOWN) {
1288
+ } else if (y === X.DOWN) {
1304
1289
  let D = p + 1;
1305
1290
  D = D >= T.length ? 0 : D, n(D), p = D;
1306
1291
  }
1307
1292
  C(p);
1308
- }), V = s.accept$.subscribe((R) => {
1309
- const q = T[p].name;
1310
- s.acceptFormulaName(q);
1293
+ }), V = l.accept$.subscribe((R) => {
1294
+ const y = T[p].name;
1295
+ l.acceptFormulaName(y);
1311
1296
  });
1312
1297
  return () => {
1313
1298
  h == null || h.unsubscribe(), _ == null || _.unsubscribe(), V == null || V.unsubscribe();
1314
1299
  };
1315
1300
  }, []);
1316
1301
  function A() {
1317
- const p = l.getCurrentUniverDocInstance().getUnitId();
1302
+ const p = s.getCurrentUniverDocInstance().getUnitId();
1318
1303
  if (!L.isEditor(p))
1319
1304
  return;
1320
1305
  const h = L.getEditor(p);
@@ -1328,11 +1313,11 @@ function no() {
1328
1313
  }
1329
1314
  function C(T) {
1330
1315
  var g;
1331
- const p = (g = d.current) == null ? void 0 : g.querySelectorAll(`.${Ie.formulaSearchFunctionItem}`)[T];
1316
+ const p = (g = d.current) == null ? void 0 : g.querySelectorAll(`.${Ee.formulaSearchFunctionItem}`)[T];
1332
1317
  if (!p) return;
1333
1318
  const h = p.parentNode;
1334
1319
  if (!h) return;
1335
- const V = h.getBoundingClientRect().top, R = h.offsetHeight, q = p.getBoundingClientRect(), D = q.top, U = q.height;
1320
+ const V = h.getBoundingClientRect().top, R = h.offsetHeight, y = p.getBoundingClientRect(), D = y.top, U = y.height;
1336
1321
  if (D >= 0 && D > V && D - V + U <= R)
1337
1322
  return;
1338
1323
  const I = p.offsetTop - (R - U) / 2;
@@ -1341,33 +1326,33 @@ function no() {
1341
1326
  behavior: "smooth"
1342
1327
  });
1343
1328
  }
1344
- return o.length > 0 && /* @__PURE__ */ N.jsx(ha, { visible: a, offset: i, children: /* @__PURE__ */ N.jsx("ul", { className: Ie.formulaSearchFunction, ref: d, children: o.map((T, p) => /* @__PURE__ */ N.jsxs(
1329
+ return o.length > 0 && /* @__PURE__ */ N.jsx(ha, { visible: a, offset: i, children: /* @__PURE__ */ N.jsx("ul", { className: Ee.formulaSearchFunction, ref: d, children: o.map((T, p) => /* @__PURE__ */ N.jsxs(
1345
1330
  "li",
1346
1331
  {
1347
- className: t === p ? `${Ie.formulaSearchFunctionItem} ${Ie.formulaSearchFunctionItemActive}` : Ie.formulaSearchFunctionItem,
1332
+ className: t === p ? `${Ee.formulaSearchFunctionItem} ${Ee.formulaSearchFunctionItemActive}` : Ee.formulaSearchFunctionItem,
1348
1333
  onMouseEnter: () => E(p),
1349
1334
  onMouseLeave: b,
1350
- onClick: () => s.acceptFormulaName(T.name),
1335
+ onClick: () => l.acceptFormulaName(T.name),
1351
1336
  children: [
1352
- /* @__PURE__ */ N.jsxs("span", { className: Ie.formulaSearchFunctionItemName, children: [
1353
- /* @__PURE__ */ N.jsx("span", { className: Ie.formulaSearchFunctionItemNameLight, children: T.name.substring(0, c.length) }),
1337
+ /* @__PURE__ */ N.jsxs("span", { className: Ee.formulaSearchFunctionItemName, children: [
1338
+ /* @__PURE__ */ N.jsx("span", { className: Ee.formulaSearchFunctionItemNameLight, children: T.name.substring(0, c.length) }),
1354
1339
  /* @__PURE__ */ N.jsx("span", { children: T.name.slice(c.length) })
1355
1340
  ] }),
1356
- /* @__PURE__ */ N.jsx("span", { className: Ie.formulaSearchFunctionItemDesc, children: T.desc })
1341
+ /* @__PURE__ */ N.jsx("span", { className: Ee.formulaSearchFunctionItemDesc, children: T.desc })
1357
1342
  ]
1358
1343
  },
1359
1344
  p
1360
1345
  )) }) });
1361
1346
  }
1362
- function ao() {
1347
+ function io() {
1363
1348
  return /* @__PURE__ */ N.jsxs(N.Fragment, { children: [
1364
- /* @__PURE__ */ N.jsx(no, {}),
1365
- /* @__PURE__ */ N.jsx($u, {})
1349
+ /* @__PURE__ */ N.jsx(ao, {}),
1350
+ /* @__PURE__ */ N.jsx(ju, {})
1366
1351
  ] });
1367
1352
  }
1368
- const io = "univer-formula-more-functions", ro = "univer-formula-more-functions-operation", Yn = {
1369
- formulaMoreFunctions: io,
1370
- formulaMoreFunctionsOperation: ro
1353
+ const ro = "univer-formula-more-functions", uo = "univer-formula-more-functions-operation", Yn = {
1354
+ formulaMoreFunctions: ro,
1355
+ formulaMoreFunctionsOperation: uo
1371
1356
  };
1372
1357
  function Ha(a) {
1373
1358
  const { prefix: e, value: t } = a;
@@ -1383,35 +1368,35 @@ function Ha(a) {
1383
1368
  ")"
1384
1369
  ] });
1385
1370
  }
1386
- const uo = "univer-formula-function-params", oo = "univer-formula-function-params-title", mo = "univer-formula-function-params-detail", jt = {
1387
- formulaFunctionParams: uo,
1388
- formulaFunctionParamsTitle: oo,
1389
- formulaFunctionParamsDetail: mo
1371
+ const oo = "univer-formula-function-params", mo = "univer-formula-function-params-title", co = "univer-formula-function-params-detail", jt = {
1372
+ formulaFunctionParams: oo,
1373
+ formulaFunctionParamsTitle: mo,
1374
+ formulaFunctionParamsDetail: co
1390
1375
  };
1391
- function Qe(a) {
1376
+ function je(a) {
1392
1377
  const { className: e, value: t, title: n } = a;
1393
1378
  return /* @__PURE__ */ N.jsxs("div", { className: jt.formulaFunctionParams, children: [
1394
1379
  /* @__PURE__ */ N.jsx("div", { className: `${jt.formulaFunctionParamsTitle} ${e}`, children: n }),
1395
1380
  /* @__PURE__ */ N.jsx("div", { className: jt.formulaFunctionParamsDetail, children: t })
1396
1381
  ] });
1397
1382
  }
1398
- const co = "univer-formula-input-params-list", fo = "univer-formula-input-params-list-item-name", so = "univer-formula-input-params-list-item-selector", $e = {
1399
- formulaInputParamsList: co,
1400
- formulaInputParamsListItemName: fo,
1401
- formulaInputParamsListItemSelector: so
1383
+ const fo = "univer-formula-input-params-list", so = "univer-formula-input-params-list-item-name", lo = "univer-formula-input-params-list-item-selector", ke = {
1384
+ formulaInputParamsList: fo,
1385
+ formulaInputParamsListItemName: so,
1386
+ formulaInputParamsListItemSelector: lo
1402
1387
  };
1403
- function lo(a) {
1388
+ function po(a) {
1404
1389
  const { functionInfo: e, onChange: t } = a;
1405
1390
  if (!e) return null;
1406
1391
  Y([]);
1407
1392
  const [n, i] = Y(e.functionParameter), [u, o] = Y(-1);
1408
- return /* @__PURE__ */ N.jsxs("div", { className: $e.formulaInputParams, children: [
1409
- /* @__PURE__ */ N.jsx("div", { className: $e.formulaInputParamsList, children: n.map((m, c) => /* @__PURE__ */ N.jsxs("div", { children: [
1410
- /* @__PURE__ */ N.jsx("div", { className: $e.formulaInputParamsListItemName, children: m.name }),
1411
- /* @__PURE__ */ N.jsx("div", { className: $e.formulaInputParamsListItemSelector })
1393
+ return /* @__PURE__ */ N.jsxs("div", { className: ke.formulaInputParams, children: [
1394
+ /* @__PURE__ */ N.jsx("div", { className: ke.formulaInputParamsList, children: n.map((m, c) => /* @__PURE__ */ N.jsxs("div", { children: [
1395
+ /* @__PURE__ */ N.jsx("div", { className: ke.formulaInputParamsListItemName, children: m.name }),
1396
+ /* @__PURE__ */ N.jsx("div", { className: ke.formulaInputParamsListItemSelector })
1412
1397
  ] }, c)) }),
1413
- /* @__PURE__ */ N.jsx("div", { className: $e.formulaInputParamsInfo, children: /* @__PURE__ */ N.jsx(
1414
- Qe,
1398
+ /* @__PURE__ */ N.jsx("div", { className: ke.formulaInputParamsInfo, children: /* @__PURE__ */ N.jsx(
1399
+ je,
1415
1400
  {
1416
1401
  title: u === -1 ? /* @__PURE__ */ N.jsx(Ha, { prefix: e.functionName, value: n }) : n[u].name,
1417
1402
  value: u === -1 ? e.description : n[u].detail
@@ -1419,7 +1404,7 @@ function lo(a) {
1419
1404
  ) })
1420
1405
  ] });
1421
1406
  }
1422
- const po = [], Lo = [
1407
+ const Lo = [], Ao = [
1423
1408
  {
1424
1409
  functionName: F.BETADIST,
1425
1410
  functionType: r.Compatibility,
@@ -2256,9 +2241,9 @@ const po = [], Lo = [
2256
2241
  }
2257
2242
  ]
2258
2243
  }
2259
- ], Ao = [
2244
+ ], Po = [
2260
2245
  {
2261
- functionName: _e.CUBEKPIMEMBER,
2246
+ functionName: he.CUBEKPIMEMBER,
2262
2247
  functionType: r.Cube,
2263
2248
  description: "formula.functionList.CUBEKPIMEMBER.description",
2264
2249
  abstract: "formula.functionList.CUBEKPIMEMBER.abstract",
@@ -2280,7 +2265,7 @@ const po = [], Lo = [
2280
2265
  ]
2281
2266
  },
2282
2267
  {
2283
- functionName: _e.CUBEMEMBER,
2268
+ functionName: he.CUBEMEMBER,
2284
2269
  functionType: r.Cube,
2285
2270
  description: "formula.functionList.CUBEMEMBER.description",
2286
2271
  abstract: "formula.functionList.CUBEMEMBER.abstract",
@@ -2302,7 +2287,7 @@ const po = [], Lo = [
2302
2287
  ]
2303
2288
  },
2304
2289
  {
2305
- functionName: _e.CUBEMEMBERPROPERTY,
2290
+ functionName: he.CUBEMEMBERPROPERTY,
2306
2291
  functionType: r.Cube,
2307
2292
  description: "formula.functionList.CUBEMEMBERPROPERTY.description",
2308
2293
  abstract: "formula.functionList.CUBEMEMBERPROPERTY.abstract",
@@ -2324,7 +2309,7 @@ const po = [], Lo = [
2324
2309
  ]
2325
2310
  },
2326
2311
  {
2327
- functionName: _e.CUBERANKEDMEMBER,
2312
+ functionName: he.CUBERANKEDMEMBER,
2328
2313
  functionType: r.Cube,
2329
2314
  description: "formula.functionList.CUBERANKEDMEMBER.description",
2330
2315
  abstract: "formula.functionList.CUBERANKEDMEMBER.abstract",
@@ -2346,7 +2331,7 @@ const po = [], Lo = [
2346
2331
  ]
2347
2332
  },
2348
2333
  {
2349
- functionName: _e.CUBESET,
2334
+ functionName: he.CUBESET,
2350
2335
  functionType: r.Cube,
2351
2336
  description: "formula.functionList.CUBESET.description",
2352
2337
  abstract: "formula.functionList.CUBESET.abstract",
@@ -2368,7 +2353,7 @@ const po = [], Lo = [
2368
2353
  ]
2369
2354
  },
2370
2355
  {
2371
- functionName: _e.CUBESETCOUNT,
2356
+ functionName: he.CUBESETCOUNT,
2372
2357
  functionType: r.Cube,
2373
2358
  description: "formula.functionList.CUBESETCOUNT.description",
2374
2359
  abstract: "formula.functionList.CUBESETCOUNT.abstract",
@@ -2390,7 +2375,7 @@ const po = [], Lo = [
2390
2375
  ]
2391
2376
  },
2392
2377
  {
2393
- functionName: _e.CUBEVALUE,
2378
+ functionName: he.CUBEVALUE,
2394
2379
  functionType: r.Cube,
2395
2380
  description: "formula.functionList.CUBEVALUE.description",
2396
2381
  abstract: "formula.functionList.CUBEVALUE.abstract",
@@ -2411,7 +2396,7 @@ const po = [], Lo = [
2411
2396
  }
2412
2397
  ]
2413
2398
  }
2414
- ], Po = [
2399
+ ], bo = [
2415
2400
  {
2416
2401
  functionName: oe.DAVERAGE,
2417
2402
  functionType: r.Database,
@@ -2676,7 +2661,7 @@ const po = [], Lo = [
2676
2661
  }
2677
2662
  ]
2678
2663
  }
2679
- ], bo = [
2664
+ ], To = [
2680
2665
  {
2681
2666
  functionName: w.DATE,
2682
2667
  functionType: r.Date,
@@ -2735,16 +2720,9 @@ const po = [], Lo = [
2735
2720
  abstract: "formula.functionList.DATEVALUE.abstract",
2736
2721
  functionParameter: [
2737
2722
  {
2738
- name: "formula.functionList.DATEVALUE.functionParameter.number1.name",
2739
- detail: "formula.functionList.DATEVALUE.functionParameter.number1.detail",
2740
- example: "A1:A20",
2741
- require: 1,
2742
- repeat: 0
2743
- },
2744
- {
2745
- name: "formula.functionList.DATEVALUE.functionParameter.number2.name",
2746
- detail: "formula.functionList.DATEVALUE.functionParameter.number2.detail",
2747
- example: "A1:A20",
2723
+ name: "formula.functionList.DATEVALUE.functionParameter.dateText.name",
2724
+ detail: "formula.functionList.DATEVALUE.functionParameter.dateText.detail",
2725
+ example: '"2024-8-8"',
2748
2726
  require: 1,
2749
2727
  repeat: 0
2750
2728
  }
@@ -2983,22 +2961,7 @@ const po = [], Lo = [
2983
2961
  functionType: r.Date,
2984
2962
  description: "formula.functionList.NOW.description",
2985
2963
  abstract: "formula.functionList.NOW.abstract",
2986
- functionParameter: [
2987
- {
2988
- name: "formula.functionList.NOW.functionParameter.number1.name",
2989
- detail: "formula.functionList.NOW.functionParameter.number1.detail",
2990
- example: "A1:A20",
2991
- require: 1,
2992
- repeat: 0
2993
- },
2994
- {
2995
- name: "formula.functionList.NOW.functionParameter.number2.name",
2996
- detail: "formula.functionList.NOW.functionParameter.number2.detail",
2997
- example: "A1:A20",
2998
- require: 1,
2999
- repeat: 0
3000
- }
3001
- ]
2964
+ functionParameter: []
3002
2965
  },
3003
2966
  {
3004
2967
  functionName: w.SECOND,
@@ -3029,16 +2992,23 @@ const po = [], Lo = [
3029
2992
  abstract: "formula.functionList.TIME.abstract",
3030
2993
  functionParameter: [
3031
2994
  {
3032
- name: "formula.functionList.TIME.functionParameter.number1.name",
3033
- detail: "formula.functionList.TIME.functionParameter.number1.detail",
3034
- example: "A1:A20",
2995
+ name: "formula.functionList.TIME.functionParameter.hour.name",
2996
+ detail: "formula.functionList.TIME.functionParameter.hour.detail",
2997
+ example: "15",
3035
2998
  require: 1,
3036
2999
  repeat: 0
3037
3000
  },
3038
3001
  {
3039
- name: "formula.functionList.TIME.functionParameter.number2.name",
3040
- detail: "formula.functionList.TIME.functionParameter.number2.detail",
3041
- example: "A1:A20",
3002
+ name: "formula.functionList.TIME.functionParameter.minute.name",
3003
+ detail: "formula.functionList.TIME.functionParameter.minute.detail",
3004
+ example: "20",
3005
+ require: 1,
3006
+ repeat: 0
3007
+ },
3008
+ {
3009
+ name: "formula.functionList.TIME.functionParameter.second.name",
3010
+ detail: "formula.functionList.TIME.functionParameter.second.detail",
3011
+ example: "59",
3042
3012
  require: 1,
3043
3013
  repeat: 0
3044
3014
  }
@@ -3051,16 +3021,9 @@ const po = [], Lo = [
3051
3021
  abstract: "formula.functionList.TIMEVALUE.abstract",
3052
3022
  functionParameter: [
3053
3023
  {
3054
- name: "formula.functionList.TIMEVALUE.functionParameter.number1.name",
3055
- detail: "formula.functionList.TIMEVALUE.functionParameter.number1.detail",
3056
- example: "A1:A20",
3057
- require: 1,
3058
- repeat: 0
3059
- },
3060
- {
3061
- name: "formula.functionList.TIMEVALUE.functionParameter.number2.name",
3062
- detail: "formula.functionList.TIMEVALUE.functionParameter.number2.detail",
3063
- example: "A1:A20",
3024
+ name: "formula.functionList.TIMEVALUE.functionParameter.timeText.name",
3025
+ detail: "formula.functionList.TIMEVALUE.functionParameter.timeText.detail",
3026
+ example: '"15:20:59"',
3064
3027
  require: 1,
3065
3028
  repeat: 0
3066
3029
  }
@@ -3198,7 +3161,7 @@ const po = [], Lo = [
3198
3161
  }
3199
3162
  ]
3200
3163
  }
3201
- ], To = [
3164
+ ], Eo = [
3202
3165
  {
3203
3166
  functionName: M.BESSELI,
3204
3167
  functionType: r.Engineering,
@@ -4387,7 +4350,7 @@ const po = [], Lo = [
4387
4350
  }
4388
4351
  ]
4389
4352
  }
4390
- ], Eo = [
4353
+ ], So = [
4391
4354
  {
4392
4355
  functionName: O.ACCRINT,
4393
4356
  functionType: r.Financial,
@@ -5598,7 +5561,7 @@ const po = [], Lo = [
5598
5561
  }
5599
5562
  ]
5600
5563
  }
5601
- ], So = [
5564
+ ], Io = [
5602
5565
  {
5603
5566
  functionName: j.CELL,
5604
5567
  functionType: r.Information,
@@ -5984,7 +5947,7 @@ const po = [], Lo = [
5984
5947
  }
5985
5948
  ]
5986
5949
  }
5987
- ], Io = [
5950
+ ], No = [
5988
5951
  {
5989
5952
  functionName: z.AND,
5990
5953
  functionType: r.Logical,
@@ -6418,7 +6381,7 @@ const po = [], Lo = [
6418
6381
  }
6419
6382
  ]
6420
6383
  }
6421
- ], No = [
6384
+ ], Ro = [
6422
6385
  {
6423
6386
  functionName: B.ADDRESS,
6424
6387
  functionType: r.Lookup,
@@ -7352,7 +7315,7 @@ const po = [], Lo = [
7352
7315
  }
7353
7316
  ]
7354
7317
  }
7355
- ], Ro = [
7318
+ ], Co = [
7356
7319
  {
7357
7320
  functionName: S.ABS,
7358
7321
  functionType: r.Math,
@@ -7486,16 +7449,9 @@ const po = [], Lo = [
7486
7449
  abstract: "formula.functionList.ASIN.abstract",
7487
7450
  functionParameter: [
7488
7451
  {
7489
- name: "formula.functionList.ASIN.functionParameter.number1.name",
7490
- detail: "formula.functionList.ASIN.functionParameter.number1.detail",
7491
- example: "A1:A20",
7492
- require: 1,
7493
- repeat: 0
7494
- },
7495
- {
7496
- name: "formula.functionList.ASIN.functionParameter.number2.name",
7497
- detail: "formula.functionList.ASIN.functionParameter.number2.detail",
7498
- example: "A1:A20",
7452
+ name: "formula.functionList.ASIN.functionParameter.number.name",
7453
+ detail: "formula.functionList.ASIN.functionParameter.number.detail",
7454
+ example: "0",
7499
7455
  require: 1,
7500
7456
  repeat: 0
7501
7457
  }
@@ -7508,16 +7464,9 @@ const po = [], Lo = [
7508
7464
  abstract: "formula.functionList.ASINH.abstract",
7509
7465
  functionParameter: [
7510
7466
  {
7511
- name: "formula.functionList.ASINH.functionParameter.number1.name",
7512
- detail: "formula.functionList.ASINH.functionParameter.number1.detail",
7513
- example: "A1:A20",
7514
- require: 1,
7515
- repeat: 0
7516
- },
7517
- {
7518
- name: "formula.functionList.ASINH.functionParameter.number2.name",
7519
- detail: "formula.functionList.ASINH.functionParameter.number2.detail",
7520
- example: "A1:A20",
7467
+ name: "formula.functionList.ASINH.functionParameter.number.name",
7468
+ detail: "formula.functionList.ASINH.functionParameter.number.detail",
7469
+ example: "10",
7521
7470
  require: 1,
7522
7471
  repeat: 0
7523
7472
  }
@@ -7530,16 +7479,9 @@ const po = [], Lo = [
7530
7479
  abstract: "formula.functionList.ATAN.abstract",
7531
7480
  functionParameter: [
7532
7481
  {
7533
- name: "formula.functionList.ATAN.functionParameter.number1.name",
7534
- detail: "formula.functionList.ATAN.functionParameter.number1.detail",
7535
- example: "A1:A20",
7536
- require: 1,
7537
- repeat: 0
7538
- },
7539
- {
7540
- name: "formula.functionList.ATAN.functionParameter.number2.name",
7541
- detail: "formula.functionList.ATAN.functionParameter.number2.detail",
7542
- example: "A1:A20",
7482
+ name: "formula.functionList.ATAN.functionParameter.number.name",
7483
+ detail: "formula.functionList.ATAN.functionParameter.number.detail",
7484
+ example: "1",
7543
7485
  require: 1,
7544
7486
  repeat: 0
7545
7487
  }
@@ -7552,16 +7494,16 @@ const po = [], Lo = [
7552
7494
  abstract: "formula.functionList.ATAN2.abstract",
7553
7495
  functionParameter: [
7554
7496
  {
7555
- name: "formula.functionList.ATAN2.functionParameter.number1.name",
7556
- detail: "formula.functionList.ATAN2.functionParameter.number1.detail",
7557
- example: "A1:A20",
7497
+ name: "formula.functionList.ATAN2.functionParameter.xNum.name",
7498
+ detail: "formula.functionList.ATAN2.functionParameter.xNum.detail",
7499
+ example: "4",
7558
7500
  require: 1,
7559
7501
  repeat: 0
7560
7502
  },
7561
7503
  {
7562
- name: "formula.functionList.ATAN2.functionParameter.number2.name",
7563
- detail: "formula.functionList.ATAN2.functionParameter.number2.detail",
7564
- example: "A1:A20",
7504
+ name: "formula.functionList.ATAN2.functionParameter.yNum.name",
7505
+ detail: "formula.functionList.ATAN2.functionParameter.yNum.detail",
7506
+ example: "3",
7565
7507
  require: 1,
7566
7508
  repeat: 0
7567
7509
  }
@@ -7574,16 +7516,9 @@ const po = [], Lo = [
7574
7516
  abstract: "formula.functionList.ATANH.abstract",
7575
7517
  functionParameter: [
7576
7518
  {
7577
- name: "formula.functionList.ATANH.functionParameter.number1.name",
7578
- detail: "formula.functionList.ATANH.functionParameter.number1.detail",
7579
- example: "A1:A20",
7580
- require: 1,
7581
- repeat: 0
7582
- },
7583
- {
7584
- name: "formula.functionList.ATANH.functionParameter.number2.name",
7585
- detail: "formula.functionList.ATANH.functionParameter.number2.detail",
7586
- example: "A1:A20",
7519
+ name: "formula.functionList.ATANH.functionParameter.number.name",
7520
+ detail: "formula.functionList.ATANH.functionParameter.number.detail",
7521
+ example: "0.1",
7587
7522
  require: 1,
7588
7523
  repeat: 0
7589
7524
  }
@@ -7728,16 +7663,9 @@ const po = [], Lo = [
7728
7663
  abstract: "formula.functionList.COS.abstract",
7729
7664
  functionParameter: [
7730
7665
  {
7731
- name: "formula.functionList.COS.functionParameter.number1.name",
7732
- detail: "formula.functionList.COS.functionParameter.number1.detail",
7733
- example: "A1:A20",
7734
- require: 1,
7735
- repeat: 0
7736
- },
7737
- {
7738
- name: "formula.functionList.COS.functionParameter.number2.name",
7739
- detail: "formula.functionList.COS.functionParameter.number2.detail",
7740
- example: "A1:A20",
7666
+ name: "formula.functionList.COS.functionParameter.number.name",
7667
+ detail: "formula.functionList.COS.functionParameter.number.detail",
7668
+ example: "1",
7741
7669
  require: 1,
7742
7670
  repeat: 0
7743
7671
  }
@@ -8984,7 +8912,7 @@ const po = [], Lo = [
8984
8912
  {
8985
8913
  name: "formula.functionList.SUMIFS.functionParameter.criteria2.name",
8986
8914
  detail: "formula.functionList.SUMIFS.functionParameter.criteria2.detail",
8987
- example: '"<100"',
8915
+ example: '"<20"',
8988
8916
  require: 0,
8989
8917
  repeat: 1
8990
8918
  }
@@ -9107,16 +9035,9 @@ const po = [], Lo = [
9107
9035
  abstract: "formula.functionList.TAN.abstract",
9108
9036
  functionParameter: [
9109
9037
  {
9110
- name: "formula.functionList.TAN.functionParameter.number1.name",
9111
- detail: "formula.functionList.TAN.functionParameter.number1.detail",
9112
- example: "A1:A20",
9113
- require: 1,
9114
- repeat: 0
9115
- },
9116
- {
9117
- name: "formula.functionList.TAN.functionParameter.number2.name",
9118
- detail: "formula.functionList.TAN.functionParameter.number2.detail",
9119
- example: "A1:A20",
9038
+ name: "formula.functionList.TAN.functionParameter.number.name",
9039
+ detail: "formula.functionList.TAN.functionParameter.number.detail",
9040
+ example: "1",
9120
9041
  require: 1,
9121
9042
  repeat: 0
9122
9043
  }
@@ -9129,16 +9050,9 @@ const po = [], Lo = [
9129
9050
  abstract: "formula.functionList.TANH.abstract",
9130
9051
  functionParameter: [
9131
9052
  {
9132
- name: "formula.functionList.TANH.functionParameter.number1.name",
9133
- detail: "formula.functionList.TANH.functionParameter.number1.detail",
9134
- example: "A1:A20",
9135
- require: 1,
9136
- repeat: 0
9137
- },
9138
- {
9139
- name: "formula.functionList.TANH.functionParameter.number2.name",
9140
- detail: "formula.functionList.TANH.functionParameter.number2.detail",
9141
- example: "A1:A20",
9053
+ name: "formula.functionList.TANH.functionParameter.number.name",
9054
+ detail: "formula.functionList.TANH.functionParameter.number.detail",
9055
+ example: "1",
9142
9056
  require: 1,
9143
9057
  repeat: 0
9144
9058
  }
@@ -9166,7 +9080,7 @@ const po = [], Lo = [
9166
9080
  }
9167
9081
  ]
9168
9082
  }
9169
- ], Co = [
9083
+ ], ho = [
9170
9084
  {
9171
9085
  functionName: P.AVEDEV,
9172
9086
  functionType: r.Statistical,
@@ -9183,9 +9097,9 @@ const po = [], Lo = [
9183
9097
  {
9184
9098
  name: "formula.functionList.AVEDEV.functionParameter.number2.name",
9185
9099
  detail: "formula.functionList.AVEDEV.functionParameter.number2.detail",
9186
- example: "A1:A20",
9187
- require: 1,
9188
- repeat: 0
9100
+ example: "B1:B20",
9101
+ require: 0,
9102
+ repeat: 1
9189
9103
  }
9190
9104
  ]
9191
9105
  },
@@ -9241,18 +9155,25 @@ const po = [], Lo = [
9241
9155
  abstract: "formula.functionList.AVERAGEIF.abstract",
9242
9156
  functionParameter: [
9243
9157
  {
9244
- name: "formula.functionList.AVERAGEIF.functionParameter.number1.name",
9245
- detail: "formula.functionList.AVERAGEIF.functionParameter.number1.detail",
9158
+ name: "formula.functionList.AVERAGEIF.functionParameter.range.name",
9159
+ detail: "formula.functionList.AVERAGEIF.functionParameter.range.detail",
9246
9160
  example: "A1:A20",
9247
9161
  require: 1,
9248
9162
  repeat: 0
9249
9163
  },
9250
9164
  {
9251
- name: "formula.functionList.AVERAGEIF.functionParameter.number2.name",
9252
- detail: "formula.functionList.AVERAGEIF.functionParameter.number2.detail",
9253
- example: "A1:A20",
9165
+ name: "formula.functionList.AVERAGEIF.functionParameter.criteria.name",
9166
+ detail: "formula.functionList.AVERAGEIF.functionParameter.criteria.detail",
9167
+ example: '">5"',
9254
9168
  require: 1,
9255
9169
  repeat: 0
9170
+ },
9171
+ {
9172
+ name: "formula.functionList.AVERAGEIF.functionParameter.averageRange.name",
9173
+ detail: "formula.functionList.AVERAGEIF.functionParameter.averageRange.detail",
9174
+ example: "B1:B20",
9175
+ require: 0,
9176
+ repeat: 0
9256
9177
  }
9257
9178
  ]
9258
9179
  },
@@ -9263,18 +9184,39 @@ const po = [], Lo = [
9263
9184
  abstract: "formula.functionList.AVERAGEIFS.abstract",
9264
9185
  functionParameter: [
9265
9186
  {
9266
- name: "formula.functionList.AVERAGEIFS.functionParameter.number1.name",
9267
- detail: "formula.functionList.AVERAGEIFS.functionParameter.number1.detail",
9187
+ name: "formula.functionList.AVERAGEIFS.functionParameter.averageRange.name",
9188
+ detail: "formula.functionList.AVERAGEIFS.functionParameter.averageRange.detail",
9268
9189
  example: "A1:A20",
9269
9190
  require: 1,
9270
9191
  repeat: 0
9271
9192
  },
9272
9193
  {
9273
- name: "formula.functionList.AVERAGEIFS.functionParameter.number2.name",
9274
- detail: "formula.functionList.AVERAGEIFS.functionParameter.number2.detail",
9275
- example: "A1:A20",
9194
+ name: "formula.functionList.AVERAGEIFS.functionParameter.criteriaRange1.name",
9195
+ detail: "formula.functionList.AVERAGEIFS.functionParameter.criteriaRange1.detail",
9196
+ example: "B1:B20",
9276
9197
  require: 1,
9277
9198
  repeat: 0
9199
+ },
9200
+ {
9201
+ name: "formula.functionList.AVERAGEIFS.functionParameter.criteria1.name",
9202
+ detail: "formula.functionList.AVERAGEIFS.functionParameter.criteria1.detail",
9203
+ example: '">10"',
9204
+ require: 1,
9205
+ repeat: 0
9206
+ },
9207
+ {
9208
+ name: "formula.functionList.AVERAGEIFS.functionParameter.criteriaRange2.name",
9209
+ detail: "formula.functionList.AVERAGEIFS.functionParameter.criteriaRange2.detail",
9210
+ example: "C1:C20",
9211
+ require: 0,
9212
+ repeat: 1
9213
+ },
9214
+ {
9215
+ name: "formula.functionList.AVERAGEIFS.functionParameter.criteria2.name",
9216
+ detail: "formula.functionList.AVERAGEIFS.functionParameter.criteria2.detail",
9217
+ example: '"<20"',
9218
+ require: 0,
9219
+ repeat: 1
9278
9220
  }
9279
9221
  ]
9280
9222
  },
@@ -9617,15 +9559,8 @@ const po = [], Lo = [
9617
9559
  abstract: "formula.functionList.COUNTBLANK.abstract",
9618
9560
  functionParameter: [
9619
9561
  {
9620
- name: "formula.functionList.COUNTBLANK.functionParameter.number1.name",
9621
- detail: "formula.functionList.COUNTBLANK.functionParameter.number1.detail",
9622
- example: "A1:A20",
9623
- require: 1,
9624
- repeat: 0
9625
- },
9626
- {
9627
- name: "formula.functionList.COUNTBLANK.functionParameter.number2.name",
9628
- detail: "formula.functionList.COUNTBLANK.functionParameter.number2.detail",
9562
+ name: "formula.functionList.COUNTBLANK.functionParameter.range.name",
9563
+ detail: "formula.functionList.COUNTBLANK.functionParameter.range.detail",
9629
9564
  example: "A1:A20",
9630
9565
  require: 1,
9631
9566
  repeat: 0
@@ -9639,16 +9574,16 @@ const po = [], Lo = [
9639
9574
  abstract: "formula.functionList.COUNTIF.abstract",
9640
9575
  functionParameter: [
9641
9576
  {
9642
- name: "formula.functionList.COUNTIF.functionParameter.number1.name",
9643
- detail: "formula.functionList.COUNTIF.functionParameter.number1.detail",
9577
+ name: "formula.functionList.COUNTIF.functionParameter.range.name",
9578
+ detail: "formula.functionList.COUNTIF.functionParameter.range.detail",
9644
9579
  example: "A1:A20",
9645
9580
  require: 1,
9646
9581
  repeat: 0
9647
9582
  },
9648
9583
  {
9649
- name: "formula.functionList.COUNTIF.functionParameter.number2.name",
9650
- detail: "formula.functionList.COUNTIF.functionParameter.number2.detail",
9651
- example: "A1:A20",
9584
+ name: "formula.functionList.COUNTIF.functionParameter.criteria.name",
9585
+ detail: "formula.functionList.COUNTIF.functionParameter.criteria.detail",
9586
+ example: '">5"',
9652
9587
  require: 1,
9653
9588
  repeat: 0
9654
9589
  }
@@ -9661,18 +9596,32 @@ const po = [], Lo = [
9661
9596
  abstract: "formula.functionList.COUNTIFS.abstract",
9662
9597
  functionParameter: [
9663
9598
  {
9664
- name: "formula.functionList.COUNTIFS.functionParameter.number1.name",
9665
- detail: "formula.functionList.COUNTIFS.functionParameter.number1.detail",
9599
+ name: "formula.functionList.COUNTIFS.functionParameter.criteriaRange1.name",
9600
+ detail: "formula.functionList.COUNTIFS.functionParameter.criteriaRange1.detail",
9666
9601
  example: "A1:A20",
9667
9602
  require: 1,
9668
9603
  repeat: 0
9669
9604
  },
9670
9605
  {
9671
- name: "formula.functionList.COUNTIFS.functionParameter.number2.name",
9672
- detail: "formula.functionList.COUNTIFS.functionParameter.number2.detail",
9673
- example: "A1:A20",
9606
+ name: "formula.functionList.COUNTIFS.functionParameter.criteria1.name",
9607
+ detail: "formula.functionList.COUNTIFS.functionParameter.criteria1.detail",
9608
+ example: '">10"',
9674
9609
  require: 1,
9675
9610
  repeat: 0
9611
+ },
9612
+ {
9613
+ name: "formula.functionList.COUNTIFS.functionParameter.criteriaRange2.name",
9614
+ detail: "formula.functionList.COUNTIFS.functionParameter.criteriaRange2.detail",
9615
+ example: "B1:B20",
9616
+ require: 0,
9617
+ repeat: 1
9618
+ },
9619
+ {
9620
+ name: "formula.functionList.COUNTIFS.functionParameter.criteria2.name",
9621
+ detail: "formula.functionList.COUNTIFS.functionParameter.criteria2.detail",
9622
+ example: '"<20"',
9623
+ require: 0,
9624
+ repeat: 1
9676
9625
  }
9677
9626
  ]
9678
9627
  },
@@ -10476,18 +10425,18 @@ const po = [], Lo = [
10476
10425
  abstract: "formula.functionList.MAXA.abstract",
10477
10426
  functionParameter: [
10478
10427
  {
10479
- name: "formula.functionList.MAXA.functionParameter.number1.name",
10480
- detail: "formula.functionList.MAXA.functionParameter.number1.detail",
10428
+ name: "formula.functionList.MAXA.functionParameter.value1.name",
10429
+ detail: "formula.functionList.MAXA.functionParameter.value1.detail",
10481
10430
  example: "A1:A20",
10482
10431
  require: 1,
10483
10432
  repeat: 0
10484
10433
  },
10485
10434
  {
10486
- name: "formula.functionList.MAXA.functionParameter.number2.name",
10487
- detail: "formula.functionList.MAXA.functionParameter.number2.detail",
10488
- example: "A1:A20",
10489
- require: 1,
10490
- repeat: 0
10435
+ name: "formula.functionList.MAXA.functionParameter.value2.name",
10436
+ detail: "formula.functionList.MAXA.functionParameter.value2.detail",
10437
+ example: "B1:B20",
10438
+ require: 0,
10439
+ repeat: 1
10491
10440
  }
10492
10441
  ]
10493
10442
  },
@@ -10507,7 +10456,7 @@ const po = [], Lo = [
10507
10456
  {
10508
10457
  name: "formula.functionList.MAXIFS.functionParameter.criteriaRange1.name",
10509
10458
  detail: "formula.functionList.MAXIFS.functionParameter.criteriaRange1.detail",
10510
- example: "A1:A20",
10459
+ example: "B1:B20",
10511
10460
  require: 1,
10512
10461
  repeat: 0
10513
10462
  },
@@ -10521,14 +10470,14 @@ const po = [], Lo = [
10521
10470
  {
10522
10471
  name: "formula.functionList.MAXIFS.functionParameter.criteriaRange2.name",
10523
10472
  detail: "formula.functionList.MAXIFS.functionParameter.criteriaRange2.detail",
10524
- example: "A1:A20",
10473
+ example: "C1:C20",
10525
10474
  require: 0,
10526
10475
  repeat: 1
10527
10476
  },
10528
10477
  {
10529
10478
  name: "formula.functionList.MAXIFS.functionParameter.criteria2.name",
10530
10479
  detail: "formula.functionList.MAXIFS.functionParameter.criteria2.detail",
10531
- example: '"<100"',
10480
+ example: '"<20"',
10532
10481
  require: 0,
10533
10482
  repeat: 1
10534
10483
  }
@@ -10586,18 +10535,18 @@ const po = [], Lo = [
10586
10535
  abstract: "formula.functionList.MINA.abstract",
10587
10536
  functionParameter: [
10588
10537
  {
10589
- name: "formula.functionList.MINA.functionParameter.number1.name",
10590
- detail: "formula.functionList.MINA.functionParameter.number1.detail",
10538
+ name: "formula.functionList.MINA.functionParameter.value1.name",
10539
+ detail: "formula.functionList.MINA.functionParameter.value1.detail",
10591
10540
  example: "A1:A20",
10592
10541
  require: 1,
10593
10542
  repeat: 0
10594
10543
  },
10595
10544
  {
10596
- name: "formula.functionList.MINA.functionParameter.number2.name",
10597
- detail: "formula.functionList.MINA.functionParameter.number2.detail",
10598
- example: "A1:A20",
10599
- require: 1,
10600
- repeat: 0
10545
+ name: "formula.functionList.MINA.functionParameter.value2.name",
10546
+ detail: "formula.functionList.MINA.functionParameter.value2.detail",
10547
+ example: "B1:B20",
10548
+ require: 0,
10549
+ repeat: 1
10601
10550
  }
10602
10551
  ]
10603
10552
  },
@@ -10608,18 +10557,39 @@ const po = [], Lo = [
10608
10557
  abstract: "formula.functionList.MINIFS.abstract",
10609
10558
  functionParameter: [
10610
10559
  {
10611
- name: "formula.functionList.MINIFS.functionParameter.number1.name",
10612
- detail: "formula.functionList.MINIFS.functionParameter.number1.detail",
10560
+ name: "formula.functionList.MINIFS.functionParameter.minRange.name",
10561
+ detail: "formula.functionList.MINIFS.functionParameter.minRange.detail",
10613
10562
  example: "A1:A20",
10614
10563
  require: 1,
10615
10564
  repeat: 0
10616
10565
  },
10617
10566
  {
10618
- name: "formula.functionList.MINIFS.functionParameter.number2.name",
10619
- detail: "formula.functionList.MINIFS.functionParameter.number2.detail",
10620
- example: "A1:A20",
10567
+ name: "formula.functionList.MINIFS.functionParameter.criteriaRange1.name",
10568
+ detail: "formula.functionList.MINIFS.functionParameter.criteriaRange1.detail",
10569
+ example: "B1:B20",
10621
10570
  require: 1,
10622
10571
  repeat: 0
10572
+ },
10573
+ {
10574
+ name: "formula.functionList.MINIFS.functionParameter.criteria1.name",
10575
+ detail: "formula.functionList.MINIFS.functionParameter.criteria1.detail",
10576
+ example: '">10"',
10577
+ require: 1,
10578
+ repeat: 0
10579
+ },
10580
+ {
10581
+ name: "formula.functionList.MINIFS.functionParameter.criteriaRange2.name",
10582
+ detail: "formula.functionList.MINIFS.functionParameter.criteriaRange2.detail",
10583
+ example: "C1:C20",
10584
+ require: 0,
10585
+ repeat: 1
10586
+ },
10587
+ {
10588
+ name: "formula.functionList.MINIFS.functionParameter.criteria2.name",
10589
+ detail: "formula.functionList.MINIFS.functionParameter.criteria2.detail",
10590
+ example: '"<20"',
10591
+ require: 0,
10592
+ repeat: 1
10623
10593
  }
10624
10594
  ]
10625
10595
  },
@@ -11635,7 +11605,7 @@ const po = [], Lo = [
11635
11605
  }
11636
11606
  ]
11637
11607
  }
11638
- ], ho = [
11608
+ ], _o = [
11639
11609
  {
11640
11610
  functionName: v.ASC,
11641
11611
  functionType: r.Text,
@@ -12649,9 +12619,9 @@ const po = [], Lo = [
12649
12619
  }
12650
12620
  ]
12651
12621
  }
12652
- ], _o = [], Oo = [
12622
+ ], Oo = [], Mo = [
12653
12623
  {
12654
- functionName: Xt.ENCODEURL,
12624
+ functionName: Gt.ENCODEURL,
12655
12625
  functionType: r.Web,
12656
12626
  description: "formula.functionList.ENCODEURL.description",
12657
12627
  abstract: "formula.functionList.ENCODEURL.abstract",
@@ -12673,7 +12643,7 @@ const po = [], Lo = [
12673
12643
  ]
12674
12644
  },
12675
12645
  {
12676
- functionName: Xt.FILTERXML,
12646
+ functionName: Gt.FILTERXML,
12677
12647
  functionType: r.Web,
12678
12648
  description: "formula.functionList.FILTERXML.description",
12679
12649
  abstract: "formula.functionList.FILTERXML.abstract",
@@ -12695,7 +12665,7 @@ const po = [], Lo = [
12695
12665
  ]
12696
12666
  },
12697
12667
  {
12698
- functionName: Xt.WEBSERVICE,
12668
+ functionName: Gt.WEBSERVICE,
12699
12669
  functionType: r.Web,
12700
12670
  description: "formula.functionList.WEBSERVICE.description",
12701
12671
  abstract: "formula.functionList.WEBSERVICE.abstract",
@@ -12716,29 +12686,29 @@ const po = [], Lo = [
12716
12686
  }
12717
12687
  ]
12718
12688
  }
12719
- ], Mo = [
12720
- ...Eo,
12721
- ...bo,
12722
- ...Ro,
12689
+ ], Do = [
12690
+ ...So,
12691
+ ...To,
12723
12692
  ...Co,
12724
- ...No,
12725
- ...Po,
12726
12693
  ...ho,
12694
+ ...Ro,
12695
+ ...bo,
12696
+ ..._o,
12697
+ ...No,
12727
12698
  ...Io,
12728
- ...So,
12729
- ...To,
12699
+ ...Eo,
12700
+ ...Po,
12730
12701
  ...Ao,
12702
+ ...Mo,
12731
12703
  ...Lo,
12732
- ...Oo,
12733
- ...po,
12734
- ..._o
12704
+ ...Oo
12735
12705
  ];
12736
- var Do = Object.defineProperty, go = Object.getOwnPropertyDescriptor, xo = (a, e, t, n) => {
12737
- for (var i = n > 1 ? void 0 : n ? go(e, t) : e, u = a.length - 1, o; u >= 0; u--)
12706
+ var go = Object.defineProperty, xo = Object.getOwnPropertyDescriptor, vo = (a, e, t, n) => {
12707
+ for (var i = n > 1 ? void 0 : n ? xo(e, t) : e, u = a.length - 1, o; u >= 0; u--)
12738
12708
  (o = a[u]) && (i = (n ? o(e, t, i) : o(i)) || i);
12739
- return n && i && Do(e, t, i), i;
12709
+ return n && i && go(e, t, i), i;
12740
12710
  }, Wn = (a, e) => (t, n) => e(t, n, a);
12741
- const Ye = yt("formula-ui.description-service");
12711
+ const Xe = qt("formula-ui.description-service");
12742
12712
  let Mt = class {
12743
12713
  constructor(a = [], e, t) {
12744
12714
  x(this, "_descriptions", []);
@@ -12759,8 +12729,8 @@ let Mt = class {
12759
12729
  getSearchListByName(a) {
12760
12730
  const e = [], t = this._functionService.getDescriptions();
12761
12731
  return a = a.toLocaleUpperCase(), t.forEach((n) => {
12762
- const { functionName: i, abstract: u } = n;
12763
- i.toLocaleUpperCase().indexOf(a) > -1 && e.push({ name: i, desc: u });
12732
+ const { functionName: i, abstract: u, functionType: o } = n;
12733
+ i.toLocaleUpperCase().indexOf(a) > -1 && o !== r.DefinedName && e.push({ name: i, desc: u });
12764
12734
  }), e;
12765
12735
  }
12766
12736
  getSearchListByNameFirstLetter(a) {
@@ -12774,7 +12744,7 @@ let Mt = class {
12774
12744
  const e = [];
12775
12745
  return this._functionService.getDescriptions().forEach((n) => {
12776
12746
  const { functionName: i, functionType: u, abstract: o } = n;
12777
- (u === a || a === -1) && e.push({ name: i, desc: o });
12747
+ (u === a || a === -1) && u !== r.DefinedName && e.push({ name: i, desc: o });
12778
12748
  }), e;
12779
12749
  }
12780
12750
  registerDescriptions(a) {
@@ -12797,7 +12767,7 @@ let Mt = class {
12797
12767
  if (e.length === 0)
12798
12768
  return !1;
12799
12769
  const t = e[0].description;
12800
- return !fi(t);
12770
+ return !si(t);
12801
12771
  }
12802
12772
  _initialize() {
12803
12773
  this._localeService.localeChanged$.subscribe(() => {
@@ -12806,7 +12776,6 @@ let Mt = class {
12806
12776
  }
12807
12777
  _initDescription() {
12808
12778
  const a = [
12809
- ...si,
12810
12779
  ...li,
12811
12780
  ...di,
12812
12781
  ...pi,
@@ -12821,13 +12790,14 @@ let Mt = class {
12821
12790
  ...Ni,
12822
12791
  ...Ri,
12823
12792
  ...Ci,
12824
- ...hi
12825
- ].map((t) => t[1]), e = Mo.filter((t) => a.includes(t.functionName));
12793
+ ...hi,
12794
+ ..._i
12795
+ ].map((t) => t[1]), e = Do.filter((t) => a.includes(t.functionName));
12826
12796
  this._descriptions = e.concat(this._description);
12827
12797
  }
12828
12798
  _registerDescriptions() {
12829
12799
  const a = this._localeService, e = this._descriptions.map((t) => ({
12830
- functionName: xu(t, a),
12800
+ functionName: vu(t, a),
12831
12801
  functionType: t.functionType,
12832
12802
  description: a.t(t.description),
12833
12803
  abstract: a.t(t.abstract),
@@ -12842,21 +12812,21 @@ let Mt = class {
12842
12812
  this._functionService.registerDescriptions(...e);
12843
12813
  }
12844
12814
  };
12845
- Mt = xo([
12846
- Wn(1, na),
12847
- Wn(2, y(we))
12815
+ Mt = vo([
12816
+ Wn(1, ta),
12817
+ Wn(2, q(He))
12848
12818
  ], Mt);
12849
- const vo = "univer-formula-select-function-select", qo = "univer-formula-select-function-result", yo = "univer-formula-select-function-result-item", Fo = "univer-formula-select-function-result-item-name-light", Uo = "univer-formula-select-function-result-item-selected", Bo = "univer-formula-select-function-result-item-active", Vo = "univer-formula-select-function-content", Te = {
12850
- formulaSelectFunctionSelect: vo,
12819
+ const yo = "univer-formula-select-function-select", qo = "univer-formula-select-function-result", Fo = "univer-formula-select-function-result-item", Uo = "univer-formula-select-function-result-item-name-light", Bo = "univer-formula-select-function-result-item-selected", Vo = "univer-formula-select-function-result-item-active", Ho = "univer-formula-select-function-content", be = {
12820
+ formulaSelectFunctionSelect: yo,
12851
12821
  formulaSelectFunctionResult: qo,
12852
- formulaSelectFunctionResultItem: yo,
12853
- formulaSelectFunctionResultItemNameLight: Fo,
12854
- formulaSelectFunctionResultItemSelected: Uo,
12855
- formulaSelectFunctionResultItemActive: Bo,
12856
- formulaSelectFunctionContent: Vo
12822
+ formulaSelectFunctionResultItem: Fo,
12823
+ formulaSelectFunctionResultItemNameLight: Uo,
12824
+ formulaSelectFunctionResultItemSelected: Bo,
12825
+ formulaSelectFunctionResultItemActive: Vo,
12826
+ formulaSelectFunctionContent: Ho
12857
12827
  };
12858
- function Ho(a) {
12859
- const { onChange: e } = a, t = "-1", [n, i] = Y(""), [u, o] = Y([]), [m, c] = Y(0), [f, d] = Y(t), [s, l] = Y(0), [L, A] = Y(null), E = le(Ye), b = le(we), C = gu(r, b);
12828
+ function wo(a) {
12829
+ const { onChange: e } = a, t = "-1", [n, i] = Y(""), [u, o] = Y([]), [m, c] = Y(0), [f, d] = Y(t), [l, s] = Y(0), [L, A] = Y(null), E = le(Xe), b = le(He), C = xu(r, b);
12860
12830
  C.unshift({
12861
12831
  label: b.t("formula.moreFunctions.allFunctions"),
12862
12832
  value: t
@@ -12870,13 +12840,13 @@ function Ho(a) {
12870
12840
  const h = (I) => {
12871
12841
  if (n.trim() === "") return I;
12872
12842
  const g = new RegExp(`(${n.toLocaleUpperCase()})`);
12873
- return I.split(g).filter(Boolean).map((W, ne) => W.match(g) ? /* @__PURE__ */ N.jsx("span", { className: Te.formulaSelectFunctionResultItemNameLight, children: W }, ne) : W);
12843
+ return I.split(g).filter(Boolean).map((W, ne) => W.match(g) ? /* @__PURE__ */ N.jsx("span", { className: be.formulaSelectFunctionResultItemNameLight, children: W }, ne) : W);
12874
12844
  }, _ = (I) => {
12875
12845
  if (u.length === 0) {
12876
12846
  A(null);
12877
12847
  return;
12878
12848
  }
12879
- l(I);
12849
+ s(I);
12880
12850
  const g = E.getFunctionInfo(u[I].name);
12881
12851
  if (!g) {
12882
12852
  A(null);
@@ -12894,7 +12864,7 @@ function Ho(a) {
12894
12864
  const g = E.getSearchListByName(I);
12895
12865
  o(g);
12896
12866
  }
12897
- function q(I) {
12867
+ function y(I) {
12898
12868
  if (I.stopPropagation(), I.key === "ArrowDown") {
12899
12869
  const g = m + 1;
12900
12870
  c(g === u.length ? 0 : g);
@@ -12909,13 +12879,13 @@ function Ho(a) {
12909
12879
  c(-1);
12910
12880
  };
12911
12881
  return /* @__PURE__ */ N.jsxs("div", { children: [
12912
- /* @__PURE__ */ N.jsxs("div", { className: Te.formulaSelectFunctionSelect, children: [
12913
- /* @__PURE__ */ N.jsx(wr, { value: f, options: C, onChange: V }),
12882
+ /* @__PURE__ */ N.jsxs("div", { className: be.formulaSelectFunctionSelect, children: [
12883
+ /* @__PURE__ */ N.jsx(Gr, { value: f, options: C, onChange: V }),
12914
12884
  /* @__PURE__ */ N.jsx(
12915
- Gr,
12885
+ Xr,
12916
12886
  {
12917
12887
  placeholder: b.t("formula.moreFunctions.searchFunctionPlaceholder"),
12918
- onKeyDown: q,
12888
+ onKeyDown: y,
12919
12889
  value: n,
12920
12890
  onChange: R,
12921
12891
  size: "large",
@@ -12923,38 +12893,38 @@ function Ho(a) {
12923
12893
  }
12924
12894
  )
12925
12895
  ] }),
12926
- /* @__PURE__ */ N.jsx("ul", { className: Te.formulaSelectFunctionResult, onKeyDown: q, tabIndex: -1, children: u.map(({ name: I }, g) => /* @__PURE__ */ N.jsxs(
12896
+ /* @__PURE__ */ N.jsx("ul", { className: be.formulaSelectFunctionResult, onKeyDown: y, tabIndex: -1, children: u.map(({ name: I }, g) => /* @__PURE__ */ N.jsxs(
12927
12897
  "li",
12928
12898
  {
12929
- className: m === g ? `${Te.formulaSelectFunctionResultItem} ${Te.formulaSelectFunctionResultItemActive}` : Te.formulaSelectFunctionResultItem,
12899
+ className: m === g ? `${be.formulaSelectFunctionResultItem} ${be.formulaSelectFunctionResultItemActive}` : be.formulaSelectFunctionResultItem,
12930
12900
  onMouseEnter: () => D(g),
12931
12901
  onMouseLeave: U,
12932
12902
  onClick: () => _(g),
12933
12903
  children: [
12934
- s === g && /* @__PURE__ */ N.jsx(ya, { className: Te.formulaSelectFunctionResultItemSelected }),
12935
- /* @__PURE__ */ N.jsx("span", { className: Te.formulaSelectFunctionResultItemName, children: h(I) })
12904
+ l === g && /* @__PURE__ */ N.jsx(qa, { className: be.formulaSelectFunctionResultItemSelected }),
12905
+ /* @__PURE__ */ N.jsx("span", { className: be.formulaSelectFunctionResultItemName, children: h(I) })
12936
12906
  ]
12937
12907
  },
12938
12908
  g
12939
12909
  )) }),
12940
- L && /* @__PURE__ */ N.jsxs("div", { className: Te.formulaSelectFunctionContent, children: [
12941
- /* @__PURE__ */ N.jsx(Qe, { title: L.functionName, value: L.description }),
12910
+ L && /* @__PURE__ */ N.jsxs("div", { className: be.formulaSelectFunctionContent, children: [
12911
+ /* @__PURE__ */ N.jsx(je, { title: L.functionName, value: L.description }),
12942
12912
  /* @__PURE__ */ N.jsx(
12943
- Qe,
12913
+ je,
12944
12914
  {
12945
12915
  title: b.t("formula.moreFunctions.syntax"),
12946
12916
  value: /* @__PURE__ */ N.jsx(Ha, { prefix: L.functionName, value: L.functionParameter })
12947
12917
  }
12948
12918
  ),
12949
12919
  /* @__PURE__ */ N.jsx(
12950
- Qe,
12920
+ je,
12951
12921
  {
12952
12922
  title: b.t("formula.prompt.helpExample"),
12953
12923
  value: `${L.functionName}(${L.functionParameter.map((I) => I.example).join(",")})`
12954
12924
  }
12955
12925
  ),
12956
12926
  L.functionParameter && L.functionParameter.map((I, g) => /* @__PURE__ */ N.jsx(
12957
- Qe,
12927
+ je,
12958
12928
  {
12959
12929
  title: I.name,
12960
12930
  value: `${I.require ? T : p} ${I.detail}`
@@ -12964,8 +12934,8 @@ function Ho(a) {
12964
12934
  ] })
12965
12935
  ] });
12966
12936
  }
12967
- function wo() {
12968
- const a = Pr(), [e, t] = Y(!0), [n, i] = Y(!1), [u, o] = Y(null), m = le(we), c = le(ft);
12937
+ function Go() {
12938
+ const a = Tr(), [e, t] = Y(!0), [n, i] = Y(!1), [u, o] = Y(null), m = le(He), c = le(Ge);
12969
12939
  function f() {
12970
12940
  t(!e), i(!n);
12971
12941
  }
@@ -12973,8 +12943,8 @@ function wo() {
12973
12943
  c.setFormula(`=${u == null ? void 0 : u.functionName}(`);
12974
12944
  }
12975
12945
  return /* @__PURE__ */ N.jsxs("div", { className: Yn.formulaMoreFunctions, children: [
12976
- e && /* @__PURE__ */ N.jsx(Ho, { onChange: o }),
12977
- n && /* @__PURE__ */ N.jsx(lo, { functionInfo: u, onChange: () => {
12946
+ e && /* @__PURE__ */ N.jsx(wo, { onChange: o }),
12947
+ n && /* @__PURE__ */ N.jsx(po, { functionInfo: u, onChange: () => {
12978
12948
  } }),
12979
12949
  /* @__PURE__ */ N.jsxs("div", { className: Yn.formulaMoreFunctionsOperation, children: [
12980
12950
  n && /* @__PURE__ */ N.jsx(kt, { type: "primary", size: "small", onClick: f, children: m.t("formula.moreFunctions.next") }),
@@ -12983,21 +12953,21 @@ function wo() {
12983
12953
  ] })
12984
12954
  ] });
12985
12955
  }
12986
- const Nt = {
12987
- type: Se.MUTATION,
12956
+ const It = {
12957
+ type: Te.MUTATION,
12988
12958
  id: "sheet.mutation.data-validation-formula-mark-dirty",
12989
12959
  handler() {
12990
12960
  return !0;
12991
12961
  }
12992
12962
  };
12993
- function Go(a) {
12963
+ function Xo(a) {
12994
12964
  return {
12995
- id: bn.id,
12965
+ id: Tn.id,
12996
12966
  icon: "FunctionSingle",
12997
12967
  tooltip: "formula.insert.tooltip",
12998
- group: Nr.TOOLBAR_FORMULAS_INSERT,
12999
- type: An.SELECTOR,
13000
- positions: [Rr.TOOLBAR_START],
12968
+ group: Cr.TOOLBAR_FORMULAS_INSERT,
12969
+ type: Pn.SELECTOR,
12970
+ positions: [hr.TOOLBAR_START],
13001
12971
  selections: [
13002
12972
  {
13003
12973
  label: "SUM",
@@ -13025,56 +12995,53 @@ function Go(a) {
13025
12995
  icon: "MinSingle"
13026
12996
  }
13027
12997
  ],
13028
- hidden$: Cr(a, G.UNIVER_SHEET),
12998
+ hidden$: _r(a, G.UNIVER_SHEET),
13029
12999
  disabled$: Ra(a, { workbookTypes: [aa], worksheetTypes: [ia, ra], rangeTypes: [ua] })
13030
13000
  };
13031
13001
  }
13032
- function Xo(a) {
13002
+ function Yo(a) {
13033
13003
  return {
13034
13004
  id: ga.id,
13035
13005
  title: "formula.insert.more",
13036
- positions: bn.id,
13037
- type: An.BUTTON
13006
+ positions: Tn.id,
13007
+ type: Pn.BUTTON
13038
13008
  };
13039
13009
  }
13040
- function Yo(a) {
13010
+ function Wo(a) {
13041
13011
  return a.get(Pe).getCurrentTypeOfUnit$(G.UNIVER_SHEET).pipe(
13042
- Fr((n) => n ? a.get(Vn) ? new Ur((u) => u.next(!a.get(Vn).supportClipboard)) : Hn(!0) : Hn(!0))
13012
+ Br((n) => n ? a.get(Vn) ? new Vr((u) => u.next(!a.get(Vn).supportClipboard)) : Hn(!0) : Hn(!0))
13043
13013
  );
13044
13014
  }
13045
- function Wo(a) {
13015
+ function Ko(a) {
13046
13016
  return {
13047
13017
  id: _a.id,
13048
- type: An.BUTTON,
13018
+ type: Pn.BUTTON,
13049
13019
  title: "formula.operation.pasteFormula",
13050
- positions: [br],
13051
- disabled$: Yo(a).pipe(
13052
- yr(Ra(a, { workbookTypes: [aa], rangeTypes: [ua], worksheetTypes: [ra, ia] })),
13053
- Ze(([e, t]) => e || t)
13020
+ positions: [Er],
13021
+ disabled$: Wo(a).pipe(
13022
+ Ur(Ra(a, { workbookTypes: [aa], rangeTypes: [ua], worksheetTypes: [ra, ia] })),
13023
+ ze(([e, t]) => e || t)
13054
13024
  )
13055
13025
  };
13056
13026
  }
13057
13027
  const wa = "meta_key_ctrl_And_Shift";
13058
- function Ko(a) {
13028
+ function ko(a) {
13059
13029
  return a.getContextValue(Ja) && a.getContextValue(ei) && a.getContextValue(ti);
13060
13030
  }
13061
13031
  function Ga(a) {
13062
- return (Ee(a == null ? void 0 : a.f) || Ne(a == null ? void 0 : a.si)) && typeof (a == null ? void 0 : a.v) == "string" && _i.has(a.v) ? a.v : null;
13032
+ return (Ie(a == null ? void 0 : a.f) || ye(a == null ? void 0 : a.si)) && typeof (a == null ? void 0 : a.v) == "string" && Oi.has(a.v) ? a.v : null;
13063
13033
  }
13064
- function ko(a) {
13065
- return (Ee(a == null ? void 0 : a.f) || Ne(a == null ? void 0 : a.si)) && (a == null ? void 0 : a.t) === He.NUMBER && typeof (a == null ? void 0 : a.v) == "number" ? ea(a.v) : null;
13066
- }
13067
- const Vt = [
13034
+ const Bt = [
13068
13035
  H.ARROW_DOWN,
13069
13036
  H.ARROW_UP,
13070
13037
  H.ARROW_LEFT,
13071
13038
  H.ARROW_RIGHT
13072
- ], $o = [...Vt, H.ENTER, H.TAB, H.ESC];
13039
+ ], $o = [...Bt, H.ENTER, H.TAB, H.ESC];
13073
13040
  function jo() {
13074
13041
  const a = [];
13075
13042
  for (const e of $o)
13076
13043
  a.push({
13077
- id: ye.id,
13044
+ id: qe.id,
13078
13045
  binding: e,
13079
13046
  preconditions: (t) => ct(t),
13080
13047
  staticParameters: {
@@ -13086,40 +13053,40 @@ function jo() {
13086
13053
  }
13087
13054
  function Qo() {
13088
13055
  const a = [];
13089
- for (const e of Vt)
13056
+ for (const e of Bt)
13090
13057
  a.push({
13091
- id: ye.id,
13092
- binding: e | Re.SHIFT,
13058
+ id: qe.id,
13059
+ binding: e | Ne.SHIFT,
13093
13060
  preconditions: (t) => ct(t),
13094
13061
  staticParameters: {
13095
13062
  eventType: de.Keyboard,
13096
13063
  keycode: e,
13097
- metaKey: Re.SHIFT
13064
+ metaKey: Ne.SHIFT
13098
13065
  }
13099
13066
  });
13100
13067
  return a;
13101
13068
  }
13102
13069
  function zo() {
13103
13070
  const a = [];
13104
- for (const e of Vt)
13071
+ for (const e of Bt)
13105
13072
  a.push({
13106
- id: ye.id,
13107
- binding: e | Re.CTRL_COMMAND,
13073
+ id: qe.id,
13074
+ binding: e | Ne.CTRL_COMMAND,
13108
13075
  preconditions: (t) => ct(t),
13109
13076
  staticParameters: {
13110
13077
  eventType: de.Keyboard,
13111
13078
  keycode: e,
13112
- metaKey: Re.CTRL_COMMAND
13079
+ metaKey: Ne.CTRL_COMMAND
13113
13080
  }
13114
13081
  });
13115
13082
  return a;
13116
13083
  }
13117
13084
  function Zo() {
13118
13085
  const a = [];
13119
- for (const e of Vt)
13086
+ for (const e of Bt)
13120
13087
  a.push({
13121
- id: ye.id,
13122
- binding: e | Re.SHIFT | Re.CTRL_COMMAND,
13088
+ id: qe.id,
13089
+ binding: e | Ne.SHIFT | Ne.CTRL_COMMAND,
13123
13090
  preconditions: (t) => ct(t),
13124
13091
  staticParameters: {
13125
13092
  eventType: de.Keyboard,
@@ -13130,7 +13097,7 @@ function Zo() {
13130
13097
  return a;
13131
13098
  }
13132
13099
  const Jo = {
13133
- id: Tn.id,
13100
+ id: En.id,
13134
13101
  binding: H.F4,
13135
13102
  preconditions: (a) => ct(a)
13136
13103
  };
@@ -13138,9 +13105,9 @@ function em() {
13138
13105
  const a = [];
13139
13106
  for (const e of [H.ENTER, H.TAB, H.ARROW_DOWN, H.ARROW_UP])
13140
13107
  a.push({
13141
- id: ye.id,
13108
+ id: qe.id,
13142
13109
  binding: e,
13143
- preconditions: (t) => Ko(t),
13110
+ preconditions: (t) => ko(t),
13144
13111
  staticParameters: {
13145
13112
  eventType: de.Keyboard,
13146
13113
  keycode: e,
@@ -13155,7 +13122,7 @@ var tm = Object.defineProperty, nm = Object.getOwnPropertyDescriptor, am = (a, e
13155
13122
  return n && i && tm(e, t, i), i;
13156
13123
  }, Oe = (a, e) => (t, n) => e(t, n, a);
13157
13124
  const Xa = {};
13158
- let nt = class extends re {
13125
+ let tt = class extends re {
13159
13126
  constructor(a, e, t, n, i, u, o, m) {
13160
13127
  super(), this._config = a, this._injector = e, this._menuService = t, this._commandService = n, this._shortcutService = i, this._uiPartsService = u, this._renderManagerService = o, this._componentManager = m, this._initialize();
13161
13128
  }
@@ -13164,7 +13131,7 @@ let nt = class extends re {
13164
13131
  }
13165
13132
  _registerMenus() {
13166
13133
  const { menu: a = {} } = this._config;
13167
- [Go, Xo, Wo].forEach(
13134
+ [Xo, Yo, Ko].forEach(
13168
13135
  (e) => {
13169
13136
  this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(e), a));
13170
13137
  }
@@ -13174,13 +13141,13 @@ let nt = class extends re {
13174
13141
  [
13175
13142
  Oa,
13176
13143
  _a,
13177
- bn,
13144
+ Tn,
13178
13145
  ga,
13146
+ mn,
13179
13147
  on,
13180
- un,
13181
- ye,
13182
- Tn,
13183
- Nt
13148
+ qe,
13149
+ En,
13150
+ It
13184
13151
  ].forEach((a) => this.disposeWithMe(this._commandService.registerCommand(a)));
13185
13152
  }
13186
13153
  _registerShortcuts() {
@@ -13197,23 +13164,23 @@ let nt = class extends re {
13197
13164
  }
13198
13165
  _registerComponents() {
13199
13166
  this.disposeWithMe(
13200
- this._uiPartsService.registerComponent(_r.CONTENT, () => qr(ao, this._injector))
13201
- ), this._componentManager.register(Da, wo);
13167
+ this._uiPartsService.registerComponent(Mr.CONTENT, () => Fr(io, this._injector))
13168
+ ), this._componentManager.register(Da, Go);
13202
13169
  }
13203
13170
  _registerRenderModules() {
13204
13171
  this.disposeWithMe(this._renderManagerService.registerRenderModule(G.UNIVER_SHEET, _t));
13205
13172
  }
13206
13173
  };
13207
- nt = am([
13208
- Le(Ae.Ready, nt),
13209
- Oe(1, y(mt)),
13210
- Oe(2, Or),
13174
+ tt = am([
13175
+ Le(Ae.Ready, tt),
13176
+ Oe(1, q(ot)),
13177
+ Oe(2, Dr),
13211
13178
  Oe(3, fe),
13212
- Oe(4, Mr),
13213
- Oe(5, Dr),
13179
+ Oe(4, gr),
13180
+ Oe(5, xr),
13214
13181
  Oe(6, Ft),
13215
- Oe(7, y(hr))
13216
- ], nt);
13182
+ Oe(7, q(Or))
13183
+ ], tt);
13217
13184
  const Kn = "formula_reference_selection_plugin_name";
13218
13185
  function Qt(a, e, t) {
13219
13186
  const n = a.getCurrentTheme(), i = new Qn(e).setAlpha(0.05).toRgbString();
@@ -13238,8 +13205,8 @@ var im = Object.defineProperty, rm = Object.getOwnPropertyDescriptor, um = (a, e
13238
13205
  return n && i && im(e, t, i), i;
13239
13206
  }, ae = (a, e) => (t, n) => e(t, n, a);
13240
13207
  const om = [ai, ii];
13241
- let Rt = class extends re {
13242
- constructor(e, t, n, i, u, o, m, c, f, d, s, l, L, A, E) {
13208
+ let Nt = class extends re {
13209
+ constructor(e, t, n, i, u, o, m, c, f, d, l, s, L, A, E) {
13243
13210
  super();
13244
13211
  x(this, "_formulaRefColors", []);
13245
13212
  x(this, "_previousSequenceNodes");
@@ -13255,7 +13222,7 @@ let Rt = class extends re {
13255
13222
  x(this, "_userCursorMove", !1);
13256
13223
  x(this, "_previousEditorUnitId");
13257
13224
  x(this, "_existsSequenceNode", !1);
13258
- this._commandService = e, this._contextService = t, this._textSelectionRenderManager = n, this._editorBridgeService = i, this._formulaPromptService = u, this._lexerTreeBuilder = o, this._renderManagerService = m, this._themeService = c, this._selectionManagerService = f, this._univerInstanceService = d, this._selectionRenderService = s, this._descriptionService = l, this._textSelectionManagerService = L, this._contextMenuService = A, this._editorService = E, this._initialize();
13225
+ this._commandService = e, this._contextService = t, this._textSelectionRenderManager = n, this._editorBridgeService = i, this._formulaPromptService = u, this._lexerTreeBuilder = o, this._renderManagerService = m, this._themeService = c, this._selectionManagerService = f, this._univerInstanceService = d, this._selectionRenderService = l, this._descriptionService = s, this._textSelectionManagerService = L, this._contextMenuService = A, this._editorService = E, this._initialize();
13259
13226
  }
13260
13227
  dispose() {
13261
13228
  this._formulaRefColors = [], this._resetTemp();
@@ -13323,18 +13290,18 @@ let Rt = class extends re {
13323
13290
  })
13324
13291
  ), this.disposeWithMe(
13325
13292
  this._editorService.closeRangePrompt$.subscribe(() => {
13326
- (!this._editorService.getSpreadsheetFocusState() || !this._formulaPromptService.isLockedSelectionInsert()) && (this._closeRangePrompt(), this._selectionManagerService.changePlugin(De));
13293
+ (!this._editorService.getSpreadsheetFocusState() || !this._formulaPromptService.isLockedSelectionInsert()) && (this._closeRangePrompt(), this._selectionManagerService.changePlugin(Me));
13327
13294
  })
13328
13295
  );
13329
13296
  }
13330
13297
  _closeRangePrompt(e) {
13331
13298
  const t = this._selectionManagerService.getCurrent();
13332
- if (this._insertSelections = [], (t == null ? void 0 : t.pluginName) === De) {
13299
+ if (this._insertSelections = [], (t == null ? void 0 : t.pluginName) === Me) {
13333
13300
  this._disableForceKeepVisible();
13334
13301
  return;
13335
13302
  }
13336
- this._selectionManagerService.clear(), e && this._editorService.isSheetEditor(e) ? (this._selectionManagerService.changePlugin(De), this._updateEditorModel(`\r
13337
- `, [])) : this._selectionManagerService.changePluginNoRefresh(De), this._contextService.setContextValue(pt, !1), this._disableForceKeepVisible(), this._selectionRenderService.resetStyle(), this._resetTemp(), this._hideFunctionPanel();
13303
+ this._selectionManagerService.clear(), e && this._editorService.isSheetEditor(e) ? (this._selectionManagerService.changePlugin(Me), this._updateEditorModel(`\r
13304
+ `, [])) : this._selectionManagerService.changePluginNoRefresh(Me), this._contextService.setContextValue(dt, !1), this._disableForceKeepVisible(), this._selectionRenderService.resetStyle(), this._resetTemp(), this._hideFunctionPanel();
13338
13305
  }
13339
13306
  _initialRefSelectionUpdateEvent() {
13340
13307
  const e = new zn();
@@ -13345,7 +13312,7 @@ let Rt = class extends re {
13345
13312
  const t = this._selectionManagerService.getCurrent();
13346
13313
  if (this._formulaPromptService.disableSelectionMoving(), (t == null ? void 0 : t.pluginName) !== Kn)
13347
13314
  return;
13348
- this._updateRefSelectionStyle(this._isSelectionMovingRefSelections), this._selectionRenderService.getCurrentControls().forEach((i) => {
13315
+ this._updateRefSelectionStyle(this._isSelectionMovingRefSelections), this._selectionRenderService.getSelectionControls().forEach((i) => {
13349
13316
  i.disableHelperSelection(), e.add(
13350
13317
  Z(
13351
13318
  i.selectionMoving$.subscribe((u) => {
@@ -13422,17 +13389,17 @@ let Rt = class extends re {
13422
13389
  }
13423
13390
  const m = e.length - o.token.length, c = { ...o };
13424
13391
  c.token = e, c.endIndex += m, i[u] = c;
13425
- const f = this._descriptionService.hasDefinedNameDescription(e), d = this._descriptionService.isFormulaDefinedName(e), s = e.length + 1, l = !f || d;
13426
- l && i.splice(u + 1, 0, Ue.OPEN_BRACKET);
13392
+ const f = this._descriptionService.hasDefinedNameDescription(e), d = this._descriptionService.isFormulaDefinedName(e), l = e.length + 1, s = !f || d;
13393
+ s && i.splice(u + 1, 0, Ue.OPEN_BRACKET);
13427
13394
  for (let A = u + 2, E = i.length; A < E; A++) {
13428
13395
  const b = i[A];
13429
13396
  if (typeof b == "string")
13430
13397
  continue;
13431
13398
  const C = { ...b };
13432
- C.startIndex += s, C.endIndex += s, i[A] = C;
13399
+ C.startIndex += l, C.endIndex += l, i[A] = C;
13433
13400
  }
13434
13401
  let L = c.endIndex + 1;
13435
- l && (L += 1), this._syncToEditor(i, L);
13402
+ s && (L += 1), this._syncToEditor(i, L);
13436
13403
  })
13437
13404
  )
13438
13405
  );
@@ -13454,7 +13421,7 @@ let Rt = class extends re {
13454
13421
  const f = this._descriptionService.getSearchListByNameFirstLetter(c);
13455
13422
  if (this._hideFunctionPanel(), f == null || f.length === 0)
13456
13423
  return;
13457
- this._commandService.executeCommand(on.id, {
13424
+ this._commandService.executeCommand(mn.id, {
13458
13425
  visible: !0,
13459
13426
  searchText: c,
13460
13427
  searchList: f
@@ -13473,17 +13440,17 @@ let Rt = class extends re {
13473
13440
  }
13474
13441
  _changeHelpFunctionPanelState(e, t) {
13475
13442
  const n = this._descriptionService.getFunctionInfo(e);
13476
- this._hideFunctionPanel(), n != null && this._commandService.executeCommand(un.id, {
13443
+ this._hideFunctionPanel(), n != null && this._commandService.executeCommand(on.id, {
13477
13444
  visible: !0,
13478
13445
  paramIndex: t,
13479
13446
  functionInfo: n
13480
13447
  });
13481
13448
  }
13482
13449
  _hideFunctionPanel() {
13483
- this._commandService.executeCommand(on.id, {
13450
+ this._commandService.executeCommand(mn.id, {
13484
13451
  visible: !1,
13485
13452
  searchText: ""
13486
- }), this._commandService.executeCommand(un.id, {
13453
+ }), this._commandService.executeCommand(on.id, {
13487
13454
  visible: !1,
13488
13455
  paramIndex: -1
13489
13456
  });
@@ -13503,7 +13470,7 @@ let Rt = class extends re {
13503
13470
  this._disableForceKeepVisible();
13504
13471
  return;
13505
13472
  }
13506
- Cn(e) ? (this._editorBridgeService.enableForceKeepVisible(), this._contextMenuService.disable(), this._formulaPromptService.enableLockedSelectionInsert(), this._selectionRenderService.enableRemainLast(), this._arrowMoveActionState !== 1 && (this._arrowMoveActionState = 2)) : this._disableForceKeepVisible();
13473
+ hn(e) ? (this._editorBridgeService.enableForceKeepVisible(), this._contextMenuService.disable(), this._formulaPromptService.enableLockedSelectionInsert(), this._selectionRenderService.enableRemainLast(), this._arrowMoveActionState !== 1 && (this._arrowMoveActionState = 2)) : this._disableForceKeepVisible();
13507
13474
  }
13508
13475
  /**
13509
13476
  *
@@ -13533,7 +13500,7 @@ let Rt = class extends re {
13533
13500
  if (!(e != null && e.getBody()))
13534
13501
  return;
13535
13502
  const t = e.getUnitId(), n = this._editorService.getEditor(t), i = (o = (u = e.getBody()) == null ? void 0 : u.dataStream) != null ? o : "";
13536
- return !n || !n.onlyInputRange() ? { dataStream: i, offset: 0 } : { dataStream: Yt.EQUALS + i, offset: 1 };
13503
+ return !n || !n.onlyInputRange() ? { dataStream: i, offset: 0 } : { dataStream: Xt.EQUALS + i, offset: 1 };
13537
13504
  }
13538
13505
  _getFormulaAndCellEditorBody(e) {
13539
13506
  return e.map((t) => {
@@ -13553,8 +13520,8 @@ let Rt = class extends re {
13553
13520
  */
13554
13521
  _contextSwitch() {
13555
13522
  const e = this._getCurrentBodyDataStreamAndOffset();
13556
- if (e && Ee(e.dataStream)) {
13557
- this._contextService.setContextValue(pt, !0);
13523
+ if (e && Ie(e.dataStream)) {
13524
+ this._contextService.setContextValue(dt, !0);
13558
13525
  const t = this._lexerTreeBuilder.sequenceNodesBuilder(e.dataStream.replace(/\r/g, "").replace(/\n/g, "")) || [];
13559
13526
  this._formulaPromptService.setSequenceNodes(t);
13560
13527
  const n = this._textSelectionManagerService.getActiveRange();
@@ -13564,10 +13531,10 @@ let Rt = class extends re {
13564
13531
  this._currentInsertRefStringIndex = i - 1 + e.offset;
13565
13532
  return;
13566
13533
  }
13567
- this._contextService.setContextValue(pt, !1), this._formulaPromptService.disableLockedSelectionChange(), this._formulaPromptService.disableLockedSelectionInsert(), this._formulaPromptService.clearSequenceNodes(), this._hideFunctionPanel();
13534
+ this._contextService.setContextValue(dt, !1), this._formulaPromptService.disableLockedSelectionChange(), this._formulaPromptService.disableLockedSelectionInsert(), this._formulaPromptService.clearSequenceNodes(), this._hideFunctionPanel();
13568
13535
  }
13569
13536
  _getContextState() {
13570
- return this._contextService.getContextValue(pt);
13537
+ return this._contextService.getContextValue(dt);
13571
13538
  }
13572
13539
  /**
13573
13540
  * Switch from formula selection state to regular selection state.
@@ -13575,10 +13542,10 @@ let Rt = class extends re {
13575
13542
  _switchSelectionPlugin() {
13576
13543
  if (this._getContextState() === !0) {
13577
13544
  this._selectionManagerService.changePluginNoRefresh(Kn);
13578
- const e = Yi(this._themeService);
13545
+ const e = Ki(this._themeService);
13579
13546
  e.strokeDash = 8, e.hasAutoFill = !1, e.hasRowHeader = !1, e.hasColumnHeader = !1, this._selectionRenderService.setStyle(e);
13580
13547
  } else
13581
- this._selectionManagerService.changePluginNoRefresh(De), this._selectionRenderService.resetStyle();
13548
+ this._selectionManagerService.changePluginNoRefresh(Me), this._selectionRenderService.resetStyle();
13582
13549
  }
13583
13550
  /**
13584
13551
  * Highlight cell editor and formula bar editor.
@@ -13610,7 +13577,7 @@ let Rt = class extends re {
13610
13577
  const d = e[c];
13611
13578
  if (typeof d == "string" || this._descriptionService.hasDefinedNameDescription(d.token.trim()))
13612
13579
  continue;
13613
- const { startIndex: s, endIndex: l, nodeType: L, token: A } = d;
13580
+ const { startIndex: l, endIndex: s, nodeType: L, token: A } = d;
13614
13581
  let E = "";
13615
13582
  if (L === me.REFERENCE) {
13616
13583
  if (i.has(A))
@@ -13626,8 +13593,8 @@ let Rt = class extends re {
13626
13593
  });
13627
13594
  } else L === me.NUMBER ? E = this._numberColor : L === me.STRING ? E = this._stringColor : L === me.ARRAY && (E = this._stringColor);
13628
13595
  E && E.length > 0 && t.push({
13629
- st: s + 1 - o,
13630
- ed: l + 2 - o,
13596
+ st: l + 1 - o,
13597
+ ed: s + 2 - o,
13631
13598
  ts: {
13632
13599
  cl: {
13633
13600
  rgb: E
@@ -13651,32 +13618,32 @@ let Rt = class extends re {
13651
13618
  return;
13652
13619
  let m = null;
13653
13620
  for (let c = 0, f = e.length; c < f; c++) {
13654
- const d = e[c], { themeColor: s, token: l, refIndex: L } = d, A = qe(l), { unitId: E, sheetName: b, range: C } = A, T = Wi(C, o.getRowCount(), o.getColumnCount());
13621
+ const d = e[c], { themeColor: l, token: s, refIndex: L } = d, A = ve(s), { unitId: E, sheetName: b, range: C } = A, T = ki(C, o.getRowCount(), o.getColumnCount());
13655
13622
  if (E != null && E.length > 0 && t !== E)
13656
13623
  continue;
13657
13624
  const p = this._getSheetIdByName(t, b.trim());
13658
13625
  if (b.length !== 0 && p !== n || this._exceedCurrentRange(T, o.getRowCount(), o.getColumnCount()))
13659
13626
  continue;
13660
- const h = this._getPrimary(T, s, L);
13627
+ const h = this._getPrimary(T, l, L);
13661
13628
  if (h) {
13662
13629
  m = h;
13663
13630
  continue;
13664
13631
  }
13665
- const _ = Ki(T, o);
13666
- !ge.equals(_, T) && T.startRow === T.endRow && T.startColumn === T.endColumn && (T.startRow = _.startRow, T.endRow = _.endRow, T.startColumn = _.startColumn, T.endColumn = _.endColumn), i.push({
13632
+ const _ = $i(T, o);
13633
+ !De.equals(_, T) && T.startRow === T.endRow && T.startColumn === T.endColumn && (T.startRow = _.startRow, T.endRow = _.endRow, T.startColumn = _.startColumn, T.endColumn = _.endColumn), i.push({
13667
13634
  range: T,
13668
13635
  primary: _,
13669
- style: Qt(this._themeService, s, L.toString())
13636
+ style: Qt(this._themeService, l, L.toString())
13670
13637
  });
13671
13638
  }
13672
13639
  m && i.push(m), i.length !== 0 && this._selectionManagerService.add(i);
13673
13640
  }
13674
13641
  _getPrimary(e, t, n) {
13675
- var s;
13676
- const i = (s = this._insertSelections.find((l) => {
13677
- const { startRow: L, startColumn: A, endRow: E, endColumn: b } = l.range;
13642
+ var l;
13643
+ const i = (l = this._insertSelections.find((s) => {
13644
+ const { startRow: L, startColumn: A, endRow: E, endColumn: b } = s.range;
13678
13645
  return L === e.startRow && A === e.startColumn && E === e.endRow && b === e.endColumn || L === e.startRow && A === e.startColumn && e.startRow === e.endRow && e.startColumn === e.endColumn;
13679
- })) == null ? void 0 : s.primary;
13646
+ })) == null ? void 0 : l.primary;
13680
13647
  if (i == null)
13681
13648
  return;
13682
13649
  const {
@@ -13696,7 +13663,7 @@ let Rt = class extends re {
13696
13663
  _getSheetIdByName(e, t) {
13697
13664
  var i;
13698
13665
  const n = this._univerInstanceService.getUniverSheetInstance(e);
13699
- return (i = n == null ? void 0 : n.getSheetBySheetName(Oi(t))) == null ? void 0 : i.getSheetId();
13666
+ return (i = n == null ? void 0 : n.getSheetBySheetName(Mi(t))) == null ? void 0 : i.getSheetId();
13700
13667
  }
13701
13668
  _getSheetNameById(e, t) {
13702
13669
  var u;
@@ -13732,7 +13699,7 @@ let Rt = class extends re {
13732
13699
  const { openUnitId: o, openSheetId: m } = this._getOpenForCurrentSheet();
13733
13700
  t === o ? i = "" : i = t, n === m ? u = "" : u = this._getSheetNameById(t, n);
13734
13701
  const { range: c, primary: f } = e;
13735
- let { startRow: d, endRow: s, startColumn: l, endColumn: L } = c;
13702
+ let { startRow: d, endRow: l, startColumn: s, endColumn: L } = c;
13736
13703
  const { startAbsoluteRefType: A, endAbsoluteRefType: E, rangeType: b } = c;
13737
13704
  if (f) {
13738
13705
  const {
@@ -13743,15 +13710,15 @@ let Rt = class extends re {
13743
13710
  startColumn: _,
13744
13711
  endColumn: V
13745
13712
  } = f;
13746
- (C || T) && p === d && _ === l && h === s && V === L && (d = p, l = _, s = p, L = _);
13713
+ (C || T) && p === d && _ === s && h === l && V === L && (d = p, s = _, l = p, L = _);
13747
13714
  }
13748
- return St({
13715
+ return Et({
13749
13716
  sheetName: u,
13750
13717
  unitId: i,
13751
13718
  range: {
13752
13719
  startRow: d,
13753
- endRow: s,
13754
- startColumn: l,
13720
+ endRow: l,
13721
+ startColumn: s,
13755
13722
  endColumn: L,
13756
13723
  rangeType: b,
13757
13724
  startAbsoluteRefType: A,
@@ -13765,7 +13732,7 @@ let Rt = class extends re {
13765
13732
  * @param textSelectionOffset
13766
13733
  */
13767
13734
  _syncToEditor(e, t, n, i = !0) {
13768
- let u = ln(e);
13735
+ let u = dn(e);
13769
13736
  const { textRuns: o, refSelections: m } = this._buildTextRuns(e);
13770
13737
  this._isSelectionMovingRefSelections = m;
13771
13738
  const c = this._textSelectionManagerService.getActiveRange();
@@ -13773,13 +13740,13 @@ let Rt = class extends re {
13773
13740
  return;
13774
13741
  const { collapsed: f, style: d } = c;
13775
13742
  this._currentInsertRefStringIndex = t, n == null && (n = this._univerInstanceService.getCurrentUniverDocInstance().getUnitId()), this._fitEditorSize();
13776
- const s = this._editorService.getEditor(n);
13777
- s != null && s.isSingleChoice() && (u = u.split(",")[0]);
13778
- let l = u, L = 1;
13779
- (!s || !s.onlyInputRange()) && (l = `${Yt.EQUALS}${u}`, L = 0), i ? this._commandService.executeCommand(Xr.id, {
13743
+ const l = this._editorService.getEditor(n);
13744
+ l != null && l.isSingleChoice() && (u = u.split(",")[0]);
13745
+ let s = u, L = 1;
13746
+ (!l || !l.onlyInputRange()) && (s = `${Xt.EQUALS}${u}`, L = 0), i ? this._commandService.executeCommand(Yr.id, {
13780
13747
  unitId: n,
13781
13748
  body: {
13782
- dataStream: l,
13749
+ dataStream: s,
13783
13750
  textRuns: o
13784
13751
  },
13785
13752
  textRanges: [
@@ -13791,7 +13758,7 @@ let Rt = class extends re {
13791
13758
  }
13792
13759
  ],
13793
13760
  segmentId: null
13794
- }) : (this._updateEditorModel(`${l}\r
13761
+ }) : (this._updateEditorModel(`${s}\r
13795
13762
  `, o), this._textSelectionManagerService.replaceTextRanges([
13796
13763
  {
13797
13764
  startOffset: t + 1 - L,
@@ -13804,7 +13771,7 @@ let Rt = class extends re {
13804
13771
  }
13805
13772
  _fitEditorSize() {
13806
13773
  const t = this._univerInstanceService.getCurrentUniverDocInstance().getUnitId();
13807
- this._editorService.isEditor(t) && !this._editorService.isSheetEditor(t) || this._commandService.executeCommand(gr.id, {
13774
+ this._editorService.isEditor(t) && !this._editorService.isSheetEditor(t) || this._commandService.executeCommand(vr.id, {
13808
13775
  unitId: t
13809
13776
  });
13810
13777
  }
@@ -13818,7 +13785,7 @@ let Rt = class extends re {
13818
13785
  const n = this._univerInstanceService.getCurrentUniverDocInstance(), i = n.getUnitId();
13819
13786
  if (!this._editorService.isEditor(i))
13820
13787
  return;
13821
- const u = (c = this._renderManagerService.getRenderById(i)) == null ? void 0 : c.with(Yr).getViewModel();
13788
+ const u = (c = this._renderManagerService.getRenderById(i)) == null ? void 0 : c.with(Wr).getViewModel();
13822
13789
  if (u == null || n == null)
13823
13790
  return;
13824
13791
  const o = n == null ? void 0 : n.getSnapshot();
@@ -13870,24 +13837,24 @@ let Rt = class extends re {
13870
13837
  const i = this._getCurrentChar();
13871
13838
  if (i == null)
13872
13839
  return;
13873
- this._previousInsertRefStringIndex = this._currentInsertRefStringIndex, !Cn(i) && this._focusIsOnlyRange(e.length) && (this._formulaPromptService.insertSequenceString(this._currentInsertRefStringIndex, Ue.COMMA), n = this._formulaPromptService.getSequenceNodes(), this._previousInsertRefStringIndex += 1), this._previousSequenceNodes = ie.deepClone(n);
13840
+ this._previousInsertRefStringIndex = this._currentInsertRefStringIndex, !hn(i) && this._focusIsOnlyRange(e.length) && (this._formulaPromptService.insertSequenceString(this._currentInsertRefStringIndex, Ue.COMMA), n = this._formulaPromptService.getSequenceNodes(), this._previousInsertRefStringIndex += 1), this._previousSequenceNodes = ie.deepClone(n);
13874
13841
  const u = this._getRefString(t);
13875
13842
  this._formulaPromptService.setSequenceNodes(n), this._formulaPromptService.insertSequenceRef(this._previousInsertRefStringIndex, u), this._selectionRenderService.disableSkipRemainLast();
13876
13843
  }
13877
13844
  this._arrowMoveActionState = 2, this._previousRangesCount = e.length;
13878
13845
  }
13879
13846
  _updateRefSelectionStyle(e) {
13880
- const t = this._selectionRenderService.getCurrentControls(), { unitId: n, sheetId: i } = this._getCurrentUnitIdAndSheetId();
13847
+ const t = this._selectionRenderService.getSelectionControls(), { unitId: n, sheetId: i } = this._getCurrentUnitIdAndSheetId();
13881
13848
  for (let u = 0, o = e.length; u < o; u++) {
13882
- const m = e[u], { refIndex: c, themeColor: f, token: d } = m, s = qe(d), { unitId: l, sheetName: L, range: A } = s;
13883
- if (l != null && l.length > 0 && n !== l)
13849
+ const m = e[u], { refIndex: c, themeColor: f, token: d } = m, l = ve(d), { unitId: s, sheetName: L, range: A } = l;
13850
+ if (s != null && s.length > 0 && n !== s)
13884
13851
  continue;
13885
13852
  const E = this._getSheetIdByName(n, L.trim());
13886
13853
  if (E != null && E !== i)
13887
13854
  continue;
13888
13855
  const b = t.find((T) => {
13889
13856
  const { startRow: p, startColumn: h, endRow: _, endColumn: V, rangeType: R } = T.getRange();
13890
- return R === xe.COLUMN && h === A.startColumn && V === A.endColumn || R === xe.ROW && p === A.startRow && _ === A.endRow || p === A.startRow && h === A.startColumn && _ === A.endRow && V === A.endColumn || p === A.startRow && h === A.startColumn && A.startRow === A.endRow && A.startColumn === A.endColumn;
13857
+ return R === ge.COLUMN && h === A.startColumn && V === A.endColumn || R === ge.ROW && p === A.startRow && _ === A.endRow || p === A.startRow && h === A.startColumn && _ === A.endRow && V === A.endColumn || p === A.startRow && h === A.startColumn && A.startRow === A.endRow && A.startColumn === A.endColumn;
13891
13858
  });
13892
13859
  if (b == null)
13893
13860
  continue;
@@ -13917,11 +13884,11 @@ let Rt = class extends re {
13917
13884
  } = f;
13918
13885
  (C || T) && p === u && _ === m && h === o && V === c && (u = p, m = _, o = p, c = _);
13919
13886
  }
13920
- const d = Number(i), s = this._formulaPromptService.getCurrentSequenceNodeByIndex(d);
13921
- let l = { startAbsoluteRefType: J.NONE };
13922
- if (typeof s != "string") {
13923
- const C = s.token;
13924
- l = Mi(C), l.endAbsoluteRefType == null && (l.endAbsoluteRefType = l.startAbsoluteRefType);
13887
+ const d = Number(i), l = this._formulaPromptService.getCurrentSequenceNodeByIndex(d);
13888
+ let s = { startAbsoluteRefType: J.NONE };
13889
+ if (typeof l != "string") {
13890
+ const C = l.token;
13891
+ s = Di(C), s.endAbsoluteRefType == null && (s.endAbsoluteRefType = s.startAbsoluteRefType);
13925
13892
  }
13926
13893
  const L = this._getRefString({
13927
13894
  range: {
@@ -13929,7 +13896,7 @@ let Rt = class extends re {
13929
13896
  endRow: Math.max(u, o),
13930
13897
  startColumn: Math.min(m, c),
13931
13898
  endColumn: Math.max(m, c),
13932
- ...l
13899
+ ...s
13933
13900
  },
13934
13901
  primary: f,
13935
13902
  style: null
@@ -13941,12 +13908,12 @@ let Rt = class extends re {
13941
13908
  _refreshFormulaAndCellEditor(e) {
13942
13909
  var t;
13943
13910
  for (const n of e) {
13944
- const i = yn(n, this._renderManagerService), u = i == null ? void 0 : i.document;
13911
+ const i = qn(n, this._renderManagerService), u = i == null ? void 0 : i.document;
13945
13912
  u != null && ((t = u.getSkeleton()) == null || t.calculate(), u.makeDirty());
13946
13913
  }
13947
13914
  }
13948
13915
  _setRemainCapture() {
13949
- const { unitId: e } = this._getCurrentUnitIdAndSheetId(), t = yn(e, this._renderManagerService), n = t == null ? void 0 : t.engine;
13916
+ const { unitId: e } = this._getCurrentUnitIdAndSheetId(), t = qn(e, this._renderManagerService), n = t == null ? void 0 : t.engine;
13950
13917
  n == null || n.setRemainCapture();
13951
13918
  }
13952
13919
  _cursorStateListener() {
@@ -13993,10 +13960,10 @@ let Rt = class extends re {
13993
13960
  _pressArrowKey(e) {
13994
13961
  const { keycode: t, metaKey: n } = e;
13995
13962
  let i = X.DOWN;
13996
- t === H.ARROW_DOWN ? i = X.DOWN : t === H.ARROW_UP ? i = X.UP : t === H.ARROW_LEFT ? i = X.LEFT : t === H.ARROW_RIGHT && (i = X.RIGHT), n === Re.CTRL_COMMAND ? this._commandService.executeCommand(Fn.id, {
13963
+ t === H.ARROW_DOWN ? i = X.DOWN : t === H.ARROW_UP ? i = X.UP : t === H.ARROW_LEFT ? i = X.LEFT : t === H.ARROW_RIGHT && (i = X.RIGHT), n === Ne.CTRL_COMMAND ? this._commandService.executeCommand(Fn.id, {
13997
13964
  direction: i,
13998
13965
  jumpOver: Un.moveGap
13999
- }) : n === Re.SHIFT ? this._commandService.executeCommand(Bn.id, {
13966
+ }) : n === Ne.SHIFT ? this._commandService.executeCommand(Bn.id, {
14000
13967
  direction: i
14001
13968
  }) : n === wa ? this._commandService.executeCommand(Bn.id, {
14002
13969
  direction: i,
@@ -14006,10 +13973,10 @@ let Rt = class extends re {
14006
13973
  });
14007
13974
  }
14008
13975
  _commandExecutedListener() {
14009
- const e = [ye.id];
13976
+ const e = [qe.id];
14010
13977
  this.disposeWithMe(
14011
13978
  this._commandService.onCommandExecuted((t) => {
14012
- if (t.id === Tn.id)
13979
+ if (t.id === En.id)
14013
13980
  this._changeRefString();
14014
13981
  else if (e.includes(t.id)) {
14015
13982
  const n = t.params, { keycode: i, isSingleEditor: u = !1 } = n;
@@ -14050,7 +14017,7 @@ let Rt = class extends re {
14050
14017
  return;
14051
14018
  }
14052
14019
  if (this._arrowMoveActionState === 2 && (this._arrowMoveActionState = 3), (this._selectionManagerService.getSelectionRanges() || []).length === 0) {
14053
- const f = this._selectionManagerService.getLastByPlugin(De);
14020
+ const f = this._selectionManagerService.getLastByPlugin(Me);
14054
14021
  if (f != null) {
14055
14022
  const d = ie.deepClone(f);
14056
14023
  this._selectionManagerService.add([d]);
@@ -14067,7 +14034,7 @@ let Rt = class extends re {
14067
14034
  if (e == null)
14068
14035
  return;
14069
14036
  let t = X.LEFT;
14070
- e === H.ARROW_DOWN ? t = X.DOWN : e === H.ARROW_UP ? t = X.UP : e === H.ARROW_RIGHT && (t = X.RIGHT), this._commandService.executeCommand(Wr.id, {
14037
+ e === H.ARROW_DOWN ? t = X.DOWN : e === H.ARROW_UP ? t = X.UP : e === H.ARROW_RIGHT && (t = X.RIGHT), this._commandService.executeCommand(Kr.id, {
14071
14038
  direction: t
14072
14039
  });
14073
14040
  }
@@ -14085,7 +14052,7 @@ let Rt = class extends re {
14085
14052
  Z(
14086
14053
  this._editorService.inputFormula$.subscribe((e) => {
14087
14054
  const { formulaString: t, editorUnitId: n } = e;
14088
- if (t.substring(0, 1) !== Yt.EQUALS)
14055
+ if (t.substring(0, 1) !== Xt.EQUALS)
14089
14056
  return;
14090
14057
  this._editorBridgeService.isVisible().visible === !1 && this._editorBridgeService.changeVisible({
14091
14058
  visible: !0,
@@ -14112,15 +14079,15 @@ let Rt = class extends re {
14112
14079
  let m = u.token;
14113
14080
  o.length > 1 && (m = o[o.length - 1]);
14114
14081
  let c = "";
14115
- for (let s = 0, l = o.length; s < l - 1; s++)
14116
- c += o[s];
14082
+ for (let l = 0, s = o.length; l < s - 1; l++)
14083
+ c += o[l];
14117
14084
  let f = m;
14118
14085
  if (m.indexOf(Ue.COLON) > -1)
14119
14086
  if (!this._userCursorMove)
14120
14087
  f = this._changeRangeRef(m);
14121
14088
  else {
14122
- const s = m.split(Ue.COLON), l = s[0], L = s[1];
14123
- n - u.startIndex <= l.length ? f = this._changeSingleRef(l) + Ue.COLON + L : f = l + Ue.COLON + this._changeSingleRef(L);
14089
+ const l = m.split(Ue.COLON), s = l[0], L = l[1];
14090
+ n - u.startIndex <= s.length ? f = this._changeSingleRef(s) + Ue.COLON + L : f = s + Ue.COLON + this._changeSingleRef(L);
14124
14091
  }
14125
14092
  else
14126
14093
  f = this._changeSingleRef(m);
@@ -14129,52 +14096,60 @@ let Rt = class extends re {
14129
14096
  this._formulaPromptService.updateSequenceRef(i, f), this._syncToEditor(this._formulaPromptService.getSequenceNodes(), n + d + 1);
14130
14097
  }
14131
14098
  _changeRangeRef(e) {
14132
- const t = qe(e).range;
14099
+ const t = ve(e).range;
14133
14100
  let n = "";
14134
- 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 = ot(t), n;
14101
+ 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 = ut(t), n;
14135
14102
  }
14136
14103
  _changeSingleRef(e) {
14137
- const t = qe(e).range, n = t.startAbsoluteRefType;
14104
+ const t = ve(e).range, n = t.startAbsoluteRefType;
14138
14105
  let i = "";
14139
- 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), i = ot(t), i;
14106
+ 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), i = ut(t), i;
14140
14107
  }
14141
14108
  _getEditorObject() {
14142
14109
  const e = this._univerInstanceService.getCurrentUniverDocInstance().getUnitId(), t = this._editorService.getEditor(e);
14143
14110
  return t == null ? void 0 : t.render;
14144
14111
  }
14145
14112
  };
14146
- Rt = um([
14147
- Le(Ae.Rendered, Rt),
14113
+ Nt = um([
14114
+ Le(Ae.Rendered, Nt),
14148
14115
  ae(0, fe),
14149
14116
  ae(1, ri),
14150
- ae(2, Bi),
14151
- ae(3, y(Sa)),
14152
- ae(4, y(Fe)),
14153
- ae(5, y(Xe)),
14117
+ ae(2, Hi),
14118
+ ae(3, q(Sa)),
14119
+ ae(4, q(Fe)),
14120
+ ae(5, q(mt)),
14154
14121
  ae(6, Ft),
14155
- ae(7, y(fn)),
14156
- ae(8, y(Ln)),
14122
+ ae(7, q(sn)),
14123
+ ae(8, q(An)),
14157
14124
  ae(9, Pe),
14158
- ae(10, y(Na)),
14159
- ae(11, y(Ye)),
14160
- ae(12, y(Kr)),
14161
- ae(13, xr),
14162
- ae(14, ft)
14163
- ], Rt);
14125
+ ae(10, q(Na)),
14126
+ ae(11, q(Xe)),
14127
+ ae(12, q(kr)),
14128
+ ae(13, yr),
14129
+ ae(14, Ge)
14130
+ ], Nt);
14164
14131
  var mm = Object.defineProperty, cm = Object.getOwnPropertyDescriptor, fm = (a, e, t, n) => {
14165
14132
  for (var i = n > 1 ? void 0 : n ? cm(e, t) : e, u = a.length - 1, o; u >= 0; u--)
14166
14133
  (o = a[u]) && (i = (n ? o(e, t, i) : o(i)) || i);
14167
14134
  return n && i && mm(e, t, i), i;
14168
- }, je = (a, e) => (t, n) => e(t, n, a);
14169
- let at = class extends re {
14135
+ }, $e = (a, e) => (t, n) => e(t, n, a);
14136
+ let nt = class extends re {
14170
14137
  constructor(e, t, n, i, u) {
14171
14138
  super();
14172
14139
  x(this, "_waitingCommandQueue", []);
14173
- x(this, "_executingCommandQueue", []);
14140
+ x(this, "_executingDirtyData", {
14141
+ dirtyRanges: [],
14142
+ dirtyNameMap: {},
14143
+ dirtyDefinedNameMap: {},
14144
+ dirtyUnitFeatureMap: {},
14145
+ dirtyUnitOtherFormulaMap: {}
14146
+ });
14174
14147
  x(this, "_setTimeoutKey", -1);
14175
14148
  x(this, "_startExecutionTime", 0);
14176
14149
  x(this, "_formulaCalculationDoneCount", 0);
14177
14150
  x(this, "_arrayFormulaCalculationDoneCount", 0);
14151
+ x(this, "_executionInProgressParams", null);
14152
+ x(this, "_restartCalculation", !1);
14178
14153
  this._commandService = e, this._activeDirtyManagerService = t, this._numfmtService = n, this._formulaDataModel = i, this._progressService = u, this._initialize();
14179
14154
  }
14180
14155
  _initialize() {
@@ -14186,19 +14161,20 @@ let at = class extends re {
14186
14161
  if (this._activeDirtyManagerService.get(e.id)) {
14187
14162
  if (e.id === pe.id) {
14188
14163
  const n = e.params;
14189
- if (t && t.onlyLocal === !0 || n.trigger === dn.id || n.trigger === oa.id || n.trigger === ma.id)
14164
+ if (t && t.onlyLocal === !0 || n.trigger === pn.id || n.trigger === oa.id || n.trigger === ma.id)
14190
14165
  return;
14191
14166
  }
14192
14167
  this._waitingCommandQueue.push(e), clearTimeout(this._setTimeoutKey), this._setTimeoutKey = setTimeout(() => {
14193
- this._commandService.executeCommand(
14194
- hn.id,
14168
+ const n = this._generateDirty(this._waitingCommandQueue);
14169
+ this._executingDirtyData = this._mergeDirty(this._executingDirtyData, n), this._executionInProgressParams == null ? this._commandService.executeCommand(
14170
+ Yt.id,
14195
14171
  {
14196
- ...this._generateDirty(this._waitingCommandQueue)
14172
+ ...this._executingDirtyData
14197
14173
  },
14198
14174
  {
14199
14175
  onlyLocal: !0
14200
14176
  }
14201
- ), this._startExecutionTime = performance.now(), this._executingCommandQueue = this._waitingCommandQueue, this._waitingCommandQueue = [];
14177
+ ) : (this._restartCalculation = !0, this._commandService.executeCommand(gi.id, {})), this._startExecutionTime = performance.now(), this._waitingCommandQueue = [];
14202
14178
  }, 100);
14203
14179
  }
14204
14180
  })
@@ -14210,8 +14186,8 @@ let at = class extends re {
14210
14186
  const c = this._activeDirtyManagerService.get(m.id);
14211
14187
  if (c == null)
14212
14188
  continue;
14213
- const f = c.getDirtyData(m), { dirtyRanges: d, dirtyNameMap: s, dirtyDefinedNameMap: l, dirtyUnitFeatureMap: L, dirtyUnitOtherFormulaMap: A } = f;
14214
- d != null && t.push(...d), s != null && this._mergeDirtyNameMap(n, s), l != null && this._mergeDirtyNameMap(i, l), L != null && this._mergeDirtyUnitFeatureOrOtherFormulaMap(u, L), A != null && this._mergeDirtyUnitFeatureOrOtherFormulaMap(o, A);
14189
+ const f = c.getDirtyData(m), { dirtyRanges: d, dirtyNameMap: l, dirtyDefinedNameMap: s, dirtyUnitFeatureMap: L, dirtyUnitOtherFormulaMap: A } = f;
14190
+ d != null && t.push(...d), l != null && this._mergeDirtyNameMap(n, l), s != null && this._mergeDirtyNameMap(i, s), L != null && this._mergeDirtyUnitFeatureOrOtherFormulaMap(u, L), A != null && this._mergeDirtyUnitFeatureOrOtherFormulaMap(o, A);
14215
14191
  }
14216
14192
  return {
14217
14193
  dirtyRanges: t,
@@ -14222,6 +14198,16 @@ let at = class extends re {
14222
14198
  // numfmtItemMap,
14223
14199
  };
14224
14200
  }
14201
+ _mergeDirty(e, t) {
14202
+ const n = [...e.dirtyRanges, ...t.dirtyRanges], i = { ...e.dirtyNameMap }, u = { ...e.dirtyDefinedNameMap }, o = { ...e.dirtyUnitFeatureMap }, m = { ...e.dirtyUnitOtherFormulaMap };
14203
+ return this._mergeDirtyNameMap(i, t.dirtyNameMap), this._mergeDirtyNameMap(u, t.dirtyDefinedNameMap), this._mergeDirtyUnitFeatureOrOtherFormulaMap(o, t.dirtyUnitFeatureMap), this._mergeDirtyUnitFeatureOrOtherFormulaMap(m, t.dirtyUnitOtherFormulaMap), {
14204
+ dirtyRanges: n,
14205
+ dirtyNameMap: i,
14206
+ dirtyDefinedNameMap: u,
14207
+ dirtyUnitFeatureMap: o,
14208
+ dirtyUnitOtherFormulaMap: m
14209
+ };
14210
+ }
14225
14211
  _mergeDirtyNameMap(e, t) {
14226
14212
  Object.keys(t).forEach((n) => {
14227
14213
  e[n] == null && (e[n] = {}), Object.keys(t[n]).forEach((i) => {
@@ -14239,18 +14225,20 @@ let at = class extends re {
14239
14225
  });
14240
14226
  });
14241
14227
  }
14228
+ // eslint-disable-next-line max-lines-per-function
14242
14229
  _initialExecuteFormulaProcessListener() {
14243
- const e = In(this._pushFormulaTask.bind(this), 300), t = In(this._pushArrayFormulaTask.bind(this), 300);
14230
+ const e = Nn(this._pushFormulaTask.bind(this), 300), t = Nn(this._pushArrayFormulaTask.bind(this), 300);
14244
14231
  let n = null, i = 0, u = 0, o = 0, m = !1, c = !1;
14245
14232
  this.disposeWithMe(
14233
+ // eslint-disable-next-line complexity, max-lines-per-function
14246
14234
  this._commandService.onCommandExecuted((f) => {
14247
- if (f.id !== Di.id)
14235
+ if (f.id !== xi.id)
14248
14236
  return;
14249
14237
  const d = f.params;
14250
14238
  if (d.stageInfo != null) {
14251
14239
  const {
14252
- totalFormulasToCalculate: s,
14253
- completedFormulasCount: l,
14240
+ totalFormulasToCalculate: l,
14241
+ completedFormulasCount: s,
14254
14242
  totalArrayFormulasToCalculate: L,
14255
14243
  completedArrayFormulasCount: A,
14256
14244
  stage: E
@@ -14258,32 +14246,49 @@ let at = class extends re {
14258
14246
  E === Wt.START_DEPENDENCY ? (i++, n !== null && (clearTimeout(n), n = null), n = setTimeout(() => {
14259
14247
  const b = u - this._formulaCalculationDoneCount + (o - this._arrayFormulaCalculationDoneCount) + 100;
14260
14248
  this._progressService.insertTaskCount(b), this._progressService.pushTask({ count: 5 }), n = null;
14261
- }, 1e3)) : E === Wt.CURRENTLY_CALCULATING ? (l === 1 && !m && (m = !0, n ? u += s : this._progressService.insertTaskCount(s)), n ? this._formulaCalculationDoneCount = l : e(l)) : E === Wt.CURRENTLY_CALCULATING_ARRAY_FORMULA && (A === 1 && !c && (c = !0, n ? o += L : this._progressService.insertTaskCount(L)), n ? this._arrayFormulaCalculationDoneCount = A : t(A));
14249
+ }, 1e3)) : E === Wt.CURRENTLY_CALCULATING ? (s === 1 && !m && (m = !0, n ? u += l : this._progressService.insertTaskCount(l)), n ? this._formulaCalculationDoneCount = s : e(s)) : E === Wt.CURRENTLY_CALCULATING_ARRAY_FORMULA && (A === 1 && !c && (c = !0, n ? o += L : this._progressService.insertTaskCount(L)), n ? this._arrayFormulaCalculationDoneCount = A : t(A)), this._executionInProgressParams = d.stageInfo;
14262
14250
  } else {
14263
- const s = d.functionsExecutedState;
14264
- let l = "";
14265
- switch (s) {
14251
+ const l = d.functionsExecutedState;
14252
+ let s = "";
14253
+ switch (i--, l) {
14266
14254
  case Be.NOT_EXECUTED:
14267
- l = "No tasks are being executed anymore", this._executingCommandQueue = [];
14255
+ s = "No tasks are being executed anymore", this._resetExecutingDirtyData();
14268
14256
  break;
14269
14257
  case Be.STOP_EXECUTION:
14270
- l = "The execution of the formula has been stopped", this._waitingCommandQueue.unshift(...this._executingCommandQueue), this._executingCommandQueue = [];
14258
+ s = "The execution of the formula has been stopped", this._progressService.stop(), i = 0;
14271
14259
  break;
14272
14260
  case Be.SUCCESS:
14273
- l = `Formula calculation succeeded, Total time consumed: ${performance.now() - this._startExecutionTime} ms`, this._executingCommandQueue = [];
14261
+ s = `Formula calculation succeeded, Total time consumed: ${performance.now() - this._startExecutionTime} ms`, this._resetExecutingDirtyData();
14274
14262
  break;
14275
14263
  case Be.INITIAL:
14276
- l = "Waiting for calculation", this._executingCommandQueue = [];
14264
+ s = "Waiting for calculation", this._resetExecutingDirtyData();
14277
14265
  break;
14278
14266
  }
14279
- i--, i === 0 && (n ? (clearTimeout(n), n = null) : s === Be.SUCCESS ? this._progressService.complete() : s === Be.STOP_EXECUTION && this._progressService.stop(), this._formulaCalculationDoneCount = 0, this._arrayFormulaCalculationDoneCount = 0, m = !1, c = !1), console.warn(`execution result${l}`);
14267
+ i === 0 && (n ? (clearTimeout(n), n = null) : l === Be.SUCCESS && this._progressService.complete(), this._formulaCalculationDoneCount = 0, this._arrayFormulaCalculationDoneCount = 0, m = !1, c = !1), l === Be.STOP_EXECUTION && this._restartCalculation ? (this._restartCalculation = !1, this._commandService.executeCommand(
14268
+ Yt.id,
14269
+ {
14270
+ ...this._executingDirtyData
14271
+ },
14272
+ {
14273
+ onlyLocal: !0
14274
+ }
14275
+ )) : this._executionInProgressParams = null, console.warn(`execution result${s}`);
14280
14276
  }
14281
14277
  })
14282
14278
  );
14283
14279
  }
14280
+ _resetExecutingDirtyData() {
14281
+ this._executingDirtyData = {
14282
+ dirtyRanges: [],
14283
+ dirtyNameMap: {},
14284
+ dirtyDefinedNameMap: {},
14285
+ dirtyUnitFeatureMap: {},
14286
+ dirtyUnitOtherFormulaMap: {}
14287
+ };
14288
+ }
14284
14289
  _initialExecuteFormula() {
14285
14290
  this._commandService.executeCommand(
14286
- hn.id,
14291
+ Yt.id,
14287
14292
  {
14288
14293
  commands: [],
14289
14294
  forceCalculation: !0
@@ -14314,14 +14319,14 @@ let at = class extends re {
14314
14319
  this._arrayFormulaCalculationDoneCount = e, this._progressService.pushTask({ count: t });
14315
14320
  }
14316
14321
  };
14317
- at = fm([
14318
- Le(Ae.Ready, at),
14319
- je(0, fe),
14320
- je(1, sn),
14321
- je(2, y(ki)),
14322
- je(3, y(Ge)),
14323
- je(4, y(vr))
14324
- ], at);
14322
+ nt = fm([
14323
+ Le(Ae.Ready, nt),
14324
+ $e(0, fe),
14325
+ $e(1, ln),
14326
+ $e(2, q(ji)),
14327
+ $e(3, q(we)),
14328
+ $e(4, q(qr))
14329
+ ], nt);
14325
14330
  function sm(a, e, t) {
14326
14331
  var n;
14327
14332
  return a == null || a[e] == null || ((n = a[e]) == null ? void 0 : n[t]) == null;
@@ -14351,27 +14356,27 @@ function dm(a, e) {
14351
14356
  if (u == null || o == null)
14352
14357
  return !0;
14353
14358
  Object.keys(u).forEach((m) => {
14354
- const c = new Q(u[m] || {}), f = new Q(o[m] || {}), d = new Q(), s = new Q();
14359
+ const c = new Q(u[m] || {}), f = new Q(o[m] || {}), d = new Q(), l = new Q();
14355
14360
  if (c.forValue((b, C, T) => {
14356
14361
  if (T == null)
14357
14362
  return !0;
14358
14363
  const p = Ya(T);
14359
- p !== null && (d.setValue(b, C, p), s.setValue(b, C, f.getValue(b, C)));
14364
+ p !== null && (d.setValue(b, C, p), l.setValue(b, C, f.getValue(b, C)));
14360
14365
  }), d.getSizeOf() === 0)
14361
14366
  return;
14362
- const l = {
14367
+ const s = {
14363
14368
  subUnitId: m,
14364
14369
  unitId: i,
14365
14370
  cellValue: d.clone()
14366
14371
  }, L = {
14367
14372
  id: pe.id,
14368
- params: l
14373
+ params: s
14369
14374
  };
14370
14375
  n.push(L);
14371
14376
  const A = {
14372
14377
  subUnitId: m,
14373
14378
  unitId: i,
14374
- cellValue: s.clone()
14379
+ cellValue: l.clone()
14375
14380
  }, E = {
14376
14381
  id: pe.id,
14377
14382
  params: A
@@ -14420,7 +14425,7 @@ function Lm(a, e, t) {
14420
14425
  redoFormulaData: n,
14421
14426
  undoFormulaData: i
14422
14427
  };
14423
- const s = a[o][m], l = e[o][m], L = new Q(s || {}), A = new Q(l || {}), E = Am(L, u, f, d, c);
14428
+ const l = a[o][m], s = e[o][m], L = new Q(l || {}), A = new Q(s || {}), E = Am(L, u, f, d, c);
14424
14429
  return n = Dm(E, L, A), i = gm(E, L), {
14425
14430
  redoFormulaData: n,
14426
14431
  undoFormulaData: i
@@ -14431,7 +14436,7 @@ function Am(a, e, t, n, i) {
14431
14436
  return a.forValue((o, m, c) => {
14432
14437
  if (c == null || !vm(c)) return !0;
14433
14438
  const f = ui(o, m);
14434
- let d = null, s = !1;
14439
+ let d = null, l = !1;
14435
14440
  if ([
14436
14441
  0,
14437
14442
  1,
@@ -14440,10 +14445,10 @@ function Am(a, e, t, n, i) {
14440
14445
  ].includes(e))
14441
14446
  d = Pm(e, t, n, f);
14442
14447
  else if (i != null) {
14443
- const l = bm(e, i, f);
14444
- d = l.newCell, s = l.isReverse;
14448
+ const s = bm(e, i, f);
14449
+ d = s.newCell, l = s.isReverse;
14445
14450
  }
14446
- s ? u.unshift({ oldCell: f, newCell: d }) : u.push({ oldCell: f, newCell: d });
14451
+ l ? u.unshift({ oldCell: f, newCell: d }) : u.push({ oldCell: f, newCell: d });
14447
14452
  }), u;
14448
14453
  }
14449
14454
  function Pm(a, e, t, n) {
@@ -14605,8 +14610,8 @@ function Dm(a, e, t) {
14605
14610
  return a.forEach((i) => {
14606
14611
  const { oldCell: u, newCell: o } = i, { startRow: m, startColumn: c } = u, f = t.getValue(m, c) || e.getValue(m, c), d = xm(f);
14607
14612
  if (n.setValue(m, c, { f: null, si: null }), o) {
14608
- const { startRow: s, startColumn: l } = o;
14609
- n.setValue(s, l, d);
14613
+ const { startRow: l, startColumn: s } = o;
14614
+ n.setValue(l, s, d);
14610
14615
  }
14611
14616
  }), n.clone();
14612
14617
  }
@@ -14615,8 +14620,8 @@ function gm(a, e) {
14615
14620
  return a.reverse().forEach((n) => {
14616
14621
  const { oldCell: i, newCell: u } = n, { startRow: o, startColumn: m } = i, c = e.getValue(o, m), f = Ya(c);
14617
14622
  if (u) {
14618
- const { startRow: d, startColumn: s } = u;
14619
- t.setValue(d, s, { f: null, si: null });
14623
+ const { startRow: d, startColumn: l } = u;
14624
+ t.setValue(d, l, { f: null, si: null });
14620
14625
  }
14621
14626
  t.setValue(o, m, f);
14622
14627
  }), t.clone();
@@ -14624,7 +14629,7 @@ function gm(a, e) {
14624
14629
  function Ya(a) {
14625
14630
  if (a == null)
14626
14631
  return;
14627
- const { f: e, si: t, x: n = 0, y: i = 0 } = a, u = Ee(e), o = Ne(t);
14632
+ const { f: e, si: t, x: n = 0, y: i = 0 } = a, u = Ie(e), o = ye(t);
14628
14633
  if (!u && !o)
14629
14634
  return {
14630
14635
  f: null,
@@ -14636,7 +14641,7 @@ function Ya(a) {
14636
14641
  function xm(a) {
14637
14642
  if (a == null)
14638
14643
  return;
14639
- const { f: e, si: t } = a, n = Ee(e), i = Ne(t);
14644
+ const { f: e, si: t } = a, n = Ie(e), i = ye(t);
14640
14645
  if (!n && !i)
14641
14646
  return {
14642
14647
  f: null,
@@ -14646,17 +14651,17 @@ function xm(a) {
14646
14651
  return n && (u.f = e), i && !n && (u.si = t), u;
14647
14652
  }
14648
14653
  function vm(a) {
14649
- const e = (a == null ? void 0 : a.f) || "", t = (a == null ? void 0 : a.si) || "", n = Ee(e), i = Ne(t);
14654
+ const e = (a == null ? void 0 : a.f) || "", t = (a == null ? void 0 : a.si) || "", n = Ie(e), i = ye(t);
14650
14655
  return !!(n || i);
14651
14656
  }
14652
- var qm = Object.defineProperty, ym = Object.getOwnPropertyDescriptor, Fm = (a, e, t, n) => {
14653
- for (var i = n > 1 ? void 0 : n ? ym(e, t) : e, u = a.length - 1, o; u >= 0; u--)
14657
+ var ym = Object.defineProperty, qm = Object.getOwnPropertyDescriptor, Fm = (a, e, t, n) => {
14658
+ for (var i = n > 1 ? void 0 : n ? qm(e, t) : e, u = a.length - 1, o; u >= 0; u--)
14654
14659
  (o = a[u]) && (i = (n ? o(e, t, i) : o(i)) || i);
14655
- return n && i && qm(e, t, i), i;
14656
- }, Me = (a, e) => (t, n) => e(t, n, a);
14657
- let it = class extends re {
14658
- constructor(a, e, t, n, i, u, o) {
14659
- super(), this._univerInstanceService = a, this._commandService = e, this._lexerTreeBuilder = t, this._formulaDataModel = n, this._sheetInterceptorService = i, this._selectionManagerService = u, this._injector = o, this._initialize();
14660
+ return n && i && ym(e, t, i), i;
14661
+ }, Se = (a, e) => (t, n) => e(t, n, a);
14662
+ let at = class extends re {
14663
+ constructor(a, e, t, n, i, u, o, m) {
14664
+ super(), this._univerInstanceService = a, this._commandService = e, this._lexerTreeBuilder = t, this._formulaDataModel = n, this._sheetInterceptorService = i, this._selectionManagerService = u, this._editorService = o, this._injector = m, this._initialize();
14660
14665
  }
14661
14666
  _initialize() {
14662
14667
  this._commandExecutedListener();
@@ -14671,7 +14676,7 @@ let it = class extends re {
14671
14676
  if (a.params)
14672
14677
  if (a.id === pe.id) {
14673
14678
  const t = a.params;
14674
- if (e && e.onlyLocal === !0 || t.trigger === dn.id || t.trigger === oa.id || t.trigger === ma.id)
14679
+ if (e && e.onlyLocal === !0 || t.trigger === pn.id || t.trigger === oa.id || t.trigger === ma.id)
14675
14680
  return;
14676
14681
  this._handleSetRangeValuesMutation(t);
14677
14682
  } else if (a.id === nn.id) {
@@ -14685,14 +14690,18 @@ let it = class extends re {
14685
14690
  this._univerInstanceService.getTypeOfUnitAdded$(G.UNIVER_SHEET),
14686
14691
  this._univerInstanceService.getTypeOfUnitAdded$(G.UNIVER_DOC),
14687
14692
  this._univerInstanceService.getTypeOfUnitAdded$(G.UNIVER_SLIDE)
14693
+ ).pipe(
14694
+ un((a) => this._editorService.getEditor(a.getUnitId()) == null)
14688
14695
  ).subscribe((a) => this._handleUnitAdded(a))
14689
14696
  )
14690
14697
  ), this.disposeWithMe(
14691
14698
  Z(
14692
14699
  wn(
14693
- this._univerInstanceService.getTypeOfUnitDisposed$(G.UNIVER_SHEET).pipe(Ze((a) => a.getUnitId())),
14694
- this._univerInstanceService.getTypeOfUnitDisposed$(G.UNIVER_DOC).pipe(Ze((a) => a.getUnitId())),
14695
- this._univerInstanceService.getTypeOfUnitDisposed$(G.UNIVER_SLIDE).pipe(Ze((a) => a.getUnitId()))
14700
+ this._univerInstanceService.getTypeOfUnitDisposed$(G.UNIVER_SHEET).pipe(ze((a) => a.getUnitId())),
14701
+ this._univerInstanceService.getTypeOfUnitDisposed$(G.UNIVER_DOC).pipe(ze((a) => a.getUnitId())),
14702
+ this._univerInstanceService.getTypeOfUnitDisposed$(G.UNIVER_SLIDE).pipe(ze((a) => a.getUnitId()))
14703
+ ).pipe(
14704
+ un((a) => this._editorService.getEditor(a) == null)
14696
14705
  ).subscribe((a) => this._handleRemoveSheetMutation(a))
14697
14706
  )
14698
14707
  );
@@ -14707,7 +14716,7 @@ let it = class extends re {
14707
14716
  }
14708
14717
  };
14709
14718
  this._formulaDataModel.updateArrayFormulaCellData(t, e, n), this._formulaDataModel.updateArrayFormulaRange(t, e, n), this._commandService.executeCommand(
14710
- Lt.id,
14719
+ pt.id,
14711
14720
  {
14712
14721
  formulaData: u
14713
14722
  },
@@ -14730,7 +14739,7 @@ let it = class extends re {
14730
14739
  _handleRemoveSheetMutation(a, e) {
14731
14740
  const t = this._formulaDataModel.getFormulaData(), n = zt(t, a, e), i = this._formulaDataModel.getArrayFormulaRange(), u = zt(i, a, e), o = this._formulaDataModel.getArrayFormulaCellData(), m = zt(o, a, e);
14732
14741
  n && this._commandService.executeCommand(
14733
- Lt.id,
14742
+ pt.id,
14734
14743
  {
14735
14744
  formulaData: n
14736
14745
  },
@@ -14751,7 +14760,7 @@ let it = class extends re {
14751
14760
  _handleInsertSheetMutation(a) {
14752
14761
  const { sheet: e, unitId: t } = a, n = this._formulaDataModel.getFormulaData(), { id: i, cellData: u } = e, o = new Q(u), m = _n(n, t, i, o);
14753
14762
  this._commandService.executeCommand(
14754
- Lt.id,
14763
+ pt.id,
14755
14764
  {
14756
14765
  formulaData: m
14757
14766
  },
@@ -14769,7 +14778,7 @@ let it = class extends re {
14769
14778
  const m = o.getCellMatrix(), c = o.getSheetId(), f = _n(e, t, c, m);
14770
14779
  i[t][c] = (d = f[t]) == null ? void 0 : d[c];
14771
14780
  }) : n === G.UNIVER_DOC || G.UNIVER_SLIDE, this._commandService.executeCommand(
14772
- Lt.id,
14781
+ pt.id,
14773
14782
  {
14774
14783
  formulaData: i
14775
14784
  },
@@ -14782,43 +14791,43 @@ let it = class extends re {
14782
14791
  const { id: e } = a;
14783
14792
  let t = null;
14784
14793
  switch (e) {
14785
- case ur.id:
14794
+ case mr.id:
14786
14795
  t = this._handleMoveRange(a);
14787
14796
  break;
14788
- case rr.id:
14797
+ case or.id:
14789
14798
  t = this._handleMoveRows(a);
14790
14799
  break;
14791
- case ir.id:
14800
+ case ur.id:
14792
14801
  t = this._handleMoveCols(a);
14793
14802
  break;
14794
- case ar.id:
14803
+ case rr.id:
14795
14804
  t = this._handleInsertRow(a);
14796
14805
  break;
14797
- case nr.id:
14806
+ case ir.id:
14798
14807
  t = this._handleInsertCol(a);
14799
14808
  break;
14800
- case tr.id:
14809
+ case ar.id:
14801
14810
  t = this._handleInsertRangeMoveRight(a);
14802
14811
  break;
14803
- case er.id:
14812
+ case nr.id:
14804
14813
  t = this._handleInsertRangeMoveDown(a);
14805
14814
  break;
14806
- case Ji.id:
14815
+ case tr.id:
14807
14816
  t = this._handleRemoveRow(a);
14808
14817
  break;
14809
- case Zi.id:
14818
+ case er.id:
14810
14819
  t = this._handleRemoveCol(a);
14811
14820
  break;
14812
- case zi.id:
14821
+ case Ji.id:
14813
14822
  t = this._handleDeleteRangeMoveUp(a);
14814
14823
  break;
14815
- case Qi.id:
14824
+ case Zi.id:
14816
14825
  t = this._handleDeleteRangeMoveLeft(a);
14817
14826
  break;
14818
- case ji.id:
14827
+ case zi.id:
14819
14828
  t = this._handleSetWorksheetName(a);
14820
14829
  break;
14821
- case $i.id:
14830
+ case Qi.id:
14822
14831
  t = this._handleRemoveWorksheet(a);
14823
14832
  break;
14824
14833
  }
@@ -14865,18 +14874,18 @@ let it = class extends re {
14865
14874
  startColumn: 0,
14866
14875
  endRow: n,
14867
14876
  endColumn: c.getColumnCount() - 1,
14868
- rangeType: xe.ROW
14869
- }, s = {
14877
+ rangeType: ge.ROW
14878
+ }, l = {
14870
14879
  startRow: i,
14871
14880
  startColumn: 0,
14872
14881
  endRow: u,
14873
14882
  endColumn: c.getColumnCount() - 1,
14874
- rangeType: xe.ROW
14883
+ rangeType: ge.ROW
14875
14884
  };
14876
14885
  return {
14877
14886
  type: 1,
14878
14887
  from: d,
14879
- to: s,
14888
+ to: l,
14880
14889
  unitId: m,
14881
14890
  sheetId: f
14882
14891
  };
@@ -14894,18 +14903,18 @@ let it = class extends re {
14894
14903
  startColumn: t,
14895
14904
  endRow: c.getRowCount() - 1,
14896
14905
  endColumn: n,
14897
- rangeType: xe.COLUMN
14898
- }, s = {
14906
+ rangeType: ge.COLUMN
14907
+ }, l = {
14899
14908
  startRow: 0,
14900
14909
  startColumn: i,
14901
14910
  endRow: c.getRowCount() - 1,
14902
14911
  endColumn: u,
14903
- rangeType: xe.COLUMN
14912
+ rangeType: ge.COLUMN
14904
14913
  };
14905
14914
  return {
14906
14915
  type: 2,
14907
14916
  from: d,
14908
- to: s,
14917
+ to: l,
14909
14918
  unitId: m,
14910
14919
  sheetId: f
14911
14920
  };
@@ -15031,8 +15040,8 @@ let it = class extends re {
15031
15040
  const f = Object.keys(c);
15032
15041
  ie.isDefine(i[m]) || (i[m] = {}), ie.isDefine(u[m]) || (u[m] = {});
15033
15042
  for (const d of f) {
15034
- const s = new Q(c[d] || {}), l = new Q(), L = new Q();
15035
- s.forValue((A, E, b) => {
15043
+ const l = new Q(c[d] || {}), s = new Q(), L = new Q();
15044
+ l.forValue((A, E, b) => {
15036
15045
  var D;
15037
15046
  if (!b) return !0;
15038
15047
  const { f: C, x: T, y: p, si: h } = b, _ = this._lexerTreeBuilder.sequenceNodesBuilder(C);
@@ -15044,9 +15053,9 @@ let it = class extends re {
15044
15053
  const g = _[U];
15045
15054
  if (typeof g == "string" || g.nodeType !== me.REFERENCE)
15046
15055
  continue;
15047
- const { token: te } = g, W = qe(te), { range: ne, sheetName: Ce, unitId: se } = W;
15056
+ const { token: te } = g, W = ve(te), { range: ne, sheetName: Re, unitId: se } = W;
15048
15057
  o.push({ row: A, column: E, range: ne });
15049
- const We = se == null || se.length === 0 ? m : se, ue = (D = e == null ? void 0 : e[We]) == null ? void 0 : D[Ce];
15058
+ const Ye = se == null || se.length === 0 ? m : se, ue = (D = e == null ? void 0 : e[Ye]) == null ? void 0 : D[Re];
15050
15059
  if (!this._checkIsSameUnitAndSheet(
15051
15060
  t.unitId,
15052
15061
  t.sheetId,
@@ -15056,64 +15065,64 @@ let it = class extends re {
15056
15065
  ue || ""
15057
15066
  ))
15058
15067
  continue;
15059
- const Ke = {
15068
+ const We = {
15060
15069
  range: ne,
15061
15070
  sheetId: ue,
15062
15071
  unitId: se,
15063
- sheetName: Ce,
15072
+ sheetName: Re,
15064
15073
  refOffsetX: T || 0,
15065
15074
  refOffsetY: p || 0
15066
15075
  };
15067
- let he = null;
15076
+ let Ce = null;
15068
15077
  if (t.type === 11) {
15069
15078
  const {
15070
- unitId: Ht,
15071
- sheetId: wt,
15072
- sheetName: Gt
15079
+ unitId: Vt,
15080
+ sheetId: Ht,
15081
+ sheetName: wt
15073
15082
  } = t;
15074
- if (Gt == null || ue == null || ue.length === 0 || wt !== ue)
15083
+ if (wt == null || ue == null || ue.length === 0 || Ht !== ue)
15075
15084
  continue;
15076
- he = St({
15085
+ Ce = Et({
15077
15086
  range: ne,
15078
- sheetName: Gt,
15087
+ sheetName: wt,
15079
15088
  unitId: se
15080
15089
  });
15081
15090
  } else if (t.type === 12) {
15082
15091
  const {
15083
- unitId: Ht,
15084
- sheetId: wt,
15085
- sheetName: Gt
15092
+ unitId: Vt,
15093
+ sheetId: Ht,
15094
+ sheetName: wt
15086
15095
  } = t;
15087
- if (ue == null || ue.length === 0 || wt !== ue)
15096
+ if (ue == null || ue.length === 0 || Ht !== ue)
15088
15097
  continue;
15089
- he = K.REF;
15098
+ Ce = K.REF;
15090
15099
  } else
15091
- he = this._getNewRangeByMoveParam(
15092
- Ke,
15100
+ Ce = this._getNewRangeByMoveParam(
15101
+ We,
15093
15102
  t,
15094
15103
  m,
15095
15104
  d
15096
15105
  );
15097
- he != null && (_[U] = {
15106
+ Ce != null && (_[U] = {
15098
15107
  ...g,
15099
- token: he
15108
+ token: Ce
15100
15109
  }, V = !0, R.push(U));
15101
15110
  }
15102
15111
  if (!V)
15103
15112
  return !0;
15104
- const q = this._updateRefOffset(_, R, T, p);
15105
- l.setValue(A, E, {
15113
+ const y = this._updateRefOffset(_, R, T, p);
15114
+ s.setValue(A, E, {
15106
15115
  f: C,
15107
15116
  x: T,
15108
15117
  y: p,
15109
15118
  si: h
15110
15119
  }), L.setValue(A, E, {
15111
- f: `=${ln(q)}`,
15120
+ f: `=${dn(y)}`,
15112
15121
  x: T,
15113
15122
  y: p,
15114
15123
  si: h
15115
15124
  });
15116
- }), i[m] && (i[m][d] = l.getData()), u[m] && (u[m][d] = L.getData());
15125
+ }), i[m] && (i[m][d] = s.getData()), u[m] && (u[m][d] = L.getData());
15117
15126
  }
15118
15127
  }
15119
15128
  return { newFormulaData: u, oldFormulaData: i, refRanges: o };
@@ -15121,8 +15130,8 @@ let it = class extends re {
15121
15130
  _getNewRangeByMoveParam(a, e, t, n) {
15122
15131
  const { type: i, unitId: u, sheetId: o, range: m, from: c, to: f } = e, {
15123
15132
  range: d,
15124
- sheetId: s,
15125
- unitId: l,
15133
+ sheetId: l,
15134
+ unitId: s,
15126
15135
  sheetName: L,
15127
15136
  refOffsetX: A,
15128
15137
  refOffsetY: E
@@ -15132,16 +15141,16 @@ let it = class extends re {
15132
15141
  o,
15133
15142
  t,
15134
15143
  n,
15135
- l,
15136
- s
15144
+ s,
15145
+ l
15137
15146
  ))
15138
15147
  return;
15139
- const b = ge.moveOffset(d, A, E);
15148
+ const b = De.moveOffset(d, A, E);
15140
15149
  let C = null;
15141
15150
  if (i === 0) {
15142
15151
  if (c == null || f == null)
15143
15152
  return;
15144
- const T = this._checkMoveEdge(b, c), p = ge.getIntersects(b, c);
15153
+ const T = this._checkMoveEdge(b, c), p = De.getIntersects(b, c);
15145
15154
  if (p == null)
15146
15155
  return;
15147
15156
  const h = ca(
@@ -15154,7 +15163,7 @@ let it = class extends re {
15154
15163
  } else if (i === 1) {
15155
15164
  if (c == null || f == null)
15156
15165
  return;
15157
- const T = this._checkMoveEdge(b, c), p = ge.getIntersects(b, c);
15166
+ const T = this._checkMoveEdge(b, c), p = De.getIntersects(b, c);
15158
15167
  if (p == null)
15159
15168
  return;
15160
15169
  const h = fa(
@@ -15167,7 +15176,7 @@ let it = class extends re {
15167
15176
  } else if (i === 2) {
15168
15177
  if (c == null || f == null)
15169
15178
  return;
15170
- const T = this._checkMoveEdge(b, c), p = ge.getIntersects(b, c);
15179
+ const T = this._checkMoveEdge(b, c), p = De.getIntersects(b, c);
15171
15180
  if (p == null)
15172
15181
  return;
15173
15182
  const h = sa(
@@ -15294,10 +15303,10 @@ let it = class extends re {
15294
15303
  }
15295
15304
  }
15296
15305
  if (C != null)
15297
- return St({
15306
+ return Et({
15298
15307
  range: C,
15299
15308
  sheetName: L,
15300
- unitId: l
15309
+ unitId: s
15301
15310
  });
15302
15311
  }
15303
15312
  _checkIsSameUnitAndSheet(a, e, t, n, i, u) {
@@ -15319,13 +15328,13 @@ let it = class extends re {
15319
15328
  i.push(m);
15320
15329
  continue;
15321
15330
  }
15322
- const { token: c } = m, f = qe(c), { range: d, sheetName: s, unitId: l } = f, L = ge.moveOffset(d, t, n);
15331
+ const { token: c } = m, f = ve(c), { range: d, sheetName: l, unitId: s } = f, L = De.moveOffset(d, t, n);
15323
15332
  i.push({
15324
15333
  ...m,
15325
- token: St({
15334
+ token: Et({
15326
15335
  range: L,
15327
- unitId: l,
15328
- sheetName: s
15336
+ unitId: s,
15337
+ sheetName: l
15329
15338
  })
15330
15339
  });
15331
15340
  }
@@ -15368,10 +15377,10 @@ let it = class extends re {
15368
15377
  _getMoveNewRange(a, e, t, n, i, u) {
15369
15378
  const { startRow: o, endRow: m, startColumn: c, endColumn: f } = e, {
15370
15379
  startRow: d,
15371
- startColumn: s,
15372
- endRow: l,
15380
+ startColumn: l,
15381
+ endRow: s,
15373
15382
  endColumn: L,
15374
- rangeType: A = xe.NORMAL
15383
+ rangeType: A = ge.NORMAL
15375
15384
  } = t, { startRow: E, startColumn: b, endRow: C, endColumn: T } = n, {
15376
15385
  startRow: p,
15377
15386
  endRow: h,
@@ -15379,7 +15388,7 @@ let it = class extends re {
15379
15388
  endColumn: V
15380
15389
  } = u, {
15381
15390
  startRow: R,
15382
- endRow: q,
15391
+ endRow: y,
15383
15392
  startColumn: D,
15384
15393
  endColumn: U
15385
15394
  } = i, I = { ...i };
@@ -15387,32 +15396,32 @@ let it = class extends re {
15387
15396
  if (c === D && f === U)
15388
15397
  if (o < R)
15389
15398
  I.startRow = o;
15390
- else if (m < q)
15399
+ else if (m < y)
15391
15400
  I.startRow = o;
15392
- else if (m >= q && E <= q)
15393
- I.startRow = l + 1, I.endRow = m;
15394
- else if (E > q)
15395
- I.endRow -= l + 1 - R;
15401
+ else if (m >= y && E <= y)
15402
+ I.startRow = s + 1, I.endRow = m;
15403
+ else if (E > y)
15404
+ I.endRow -= s + 1 - R;
15396
15405
  else
15397
15406
  return;
15398
15407
  else
15399
15408
  return;
15400
15409
  else if (a === 1)
15401
15410
  if (c === D && f === U)
15402
- if (m > q)
15411
+ if (m > y)
15403
15412
  I.endRow = m;
15404
15413
  else if (o > R)
15405
15414
  I.endRow = m;
15406
15415
  else if (o <= R && C >= R)
15407
15416
  I.endRow = d + 1, I.startRow = o;
15408
15417
  else if (C < R)
15409
- I.startRow += q - d + 1;
15418
+ I.startRow += y - d + 1;
15410
15419
  else
15411
15420
  return;
15412
15421
  else
15413
15422
  return;
15414
15423
  else if (a === 2)
15415
- if (o === R && m === q)
15424
+ if (o === R && m === y)
15416
15425
  if (c < D)
15417
15426
  I.startColumn = c;
15418
15427
  else if (f < U)
@@ -15426,20 +15435,20 @@ let it = class extends re {
15426
15435
  else
15427
15436
  return;
15428
15437
  else if (a === 3)
15429
- if (o === R && m === q)
15438
+ if (o === R && m === y)
15430
15439
  if (f > U)
15431
15440
  I.endColumn = f;
15432
15441
  else if (c > D)
15433
15442
  I.endColumn = f;
15434
15443
  else if (c <= D && T >= D)
15435
- I.endColumn = s + 1, I.startColumn = c;
15444
+ I.endColumn = l + 1, I.startColumn = c;
15436
15445
  else if (T < D)
15437
- I.startColumn += U - s + 1;
15446
+ I.startColumn += U - l + 1;
15438
15447
  else
15439
15448
  return;
15440
15449
  else
15441
15450
  return;
15442
- else a === 4 ? (I.startRow = o, I.startColumn = c, I.endRow = m, I.endColumn = f) : s <= D && L >= U ? E > q ? I.endRow -= l - d + 1 : C < R && (I.startRow += l - d + 1) : d <= R && l >= q ? b > U ? I.endColumn -= L - s + 1 : T < D && (I.startColumn += L - s + 1) : ((b <= V + 1 && T >= U || b <= D && T >= _ - 1) && E <= R && C >= q || (E <= h + 1 && C >= q || E <= R && C >= p - 1) && b <= D && T >= U) && (I.startRow = o, I.startColumn = c, I.endRow = m, I.endColumn = f);
15451
+ else a === 4 ? (I.startRow = o, I.startColumn = c, I.endRow = m, I.endColumn = f) : l <= D && L >= U ? E > y ? I.endRow -= s - d + 1 : C < R && (I.startRow += s - d + 1) : d <= R && s >= y ? b > U ? I.endColumn -= L - l + 1 : T < D && (I.startColumn += L - l + 1) : ((b <= V + 1 && T >= U || b <= D && T >= _ - 1) && E <= R && C >= y || (E <= h + 1 && C >= y || E <= R && C >= p - 1) && b <= D && T >= U) && (I.startRow = o, I.startColumn = c, I.endRow = m, I.endColumn = f);
15443
15452
  return I;
15444
15453
  }
15445
15454
  _getCurrentSheetInfo() {
@@ -15451,22 +15460,23 @@ let it = class extends re {
15451
15460
  };
15452
15461
  }
15453
15462
  };
15454
- it = Fm([
15455
- Le(Ae.Ready, it),
15456
- Me(0, Pe),
15457
- Me(1, fe),
15458
- Me(2, y(Xe)),
15459
- Me(3, y(Ge)),
15460
- Me(4, y(Ut)),
15461
- Me(5, y(Ln)),
15462
- Me(6, y(mt))
15463
- ], it);
15463
+ at = Fm([
15464
+ Le(Ae.Ready, at),
15465
+ Se(0, Pe),
15466
+ Se(1, fe),
15467
+ Se(2, q(mt)),
15468
+ Se(3, q(we)),
15469
+ Se(4, q(Ln)),
15470
+ Se(5, q(An)),
15471
+ Se(6, Ge),
15472
+ Se(7, q(ot))
15473
+ ], at);
15464
15474
  var Um = Object.defineProperty, Bm = Object.getOwnPropertyDescriptor, Vm = (a, e, t, n) => {
15465
15475
  for (var i = n > 1 ? void 0 : n ? Bm(e, t) : e, u = a.length - 1, o; u >= 0; u--)
15466
15476
  (o = a[u]) && (i = (n ? o(e, t, i) : o(i)) || i);
15467
15477
  return n && i && Um(e, t, i), i;
15468
15478
  }, Hm = (a, e) => (t, n) => e(t, n, a);
15469
- const En = yt(
15479
+ const Sn = qt(
15470
15480
  "formula-ui.formula-custom-function-service"
15471
15481
  );
15472
15482
  let Dt = class extends re {
@@ -15476,7 +15486,7 @@ let Dt = class extends re {
15476
15486
  registerFunctions(a) {
15477
15487
  const e = [], t = a.map((n) => (e.push(n[1]), [n[0].toString(), n[1]]));
15478
15488
  return this._commandService.executeCommand(
15479
- gi.id,
15489
+ vi.id,
15480
15490
  {
15481
15491
  functions: t
15482
15492
  },
@@ -15485,7 +15495,7 @@ let Dt = class extends re {
15485
15495
  }
15486
15496
  ), Z(() => {
15487
15497
  this._commandService.executeCommand(
15488
- xi.id,
15498
+ yi.id,
15489
15499
  {
15490
15500
  functions: e
15491
15501
  },
@@ -15503,8 +15513,8 @@ var wm = Object.defineProperty, Gm = Object.getOwnPropertyDescriptor, Xm = (a, e
15503
15513
  for (var i = n > 1 ? void 0 : n ? Gm(e, t) : e, u = a.length - 1, o; u >= 0; u--)
15504
15514
  (o = a[u]) && (i = (n ? o(e, t, i) : o(i)) || i);
15505
15515
  return n && i && wm(e, t, i), i;
15506
- }, bt = (a, e) => (t, n) => e(t, n, a);
15507
- const Wa = yt(
15516
+ }, Pt = (a, e) => (t, n) => e(t, n, a);
15517
+ const Wa = qt(
15508
15518
  "formula-ui.register-function-service"
15509
15519
  );
15510
15520
  let gt = class extends re {
@@ -15534,18 +15544,18 @@ let gt = class extends re {
15534
15544
  }
15535
15545
  };
15536
15546
  gt = Xm([
15537
- bt(0, y(we)),
15538
- bt(1, y(Ye)),
15539
- bt(2, y(En)),
15540
- bt(3, na)
15547
+ Pt(0, q(He)),
15548
+ Pt(1, q(Xe)),
15549
+ Pt(2, q(Sn)),
15550
+ Pt(3, ta)
15541
15551
  ], gt);
15542
15552
  var Ym = Object.defineProperty, Wm = Object.getOwnPropertyDescriptor, Km = (a, e, t, n) => {
15543
15553
  for (var i = n > 1 ? void 0 : n ? Wm(e, t) : e, u = a.length - 1, o; u >= 0; u--)
15544
15554
  (o = a[u]) && (i = (n ? o(e, t, i) : o(i)) || i);
15545
15555
  return n && i && Ym(e, t, i), i;
15546
- }, Tt = (a, e) => (t, n) => e(t, n, a);
15556
+ }, bt = (a, e) => (t, n) => e(t, n, a);
15547
15557
  const Zt = "AllDefaultWorkbook";
15548
- let rt = class extends re {
15558
+ let it = class extends re {
15549
15559
  constructor(e, t, n, i) {
15550
15560
  super();
15551
15561
  x(this, "_preUnitId", null);
@@ -15572,12 +15582,12 @@ let rt = class extends re {
15572
15582
  this.disposeWithMe(
15573
15583
  this._commandService.onCommandExecuted((e, t) => {
15574
15584
  if (!(t != null && t.fromCollab)) {
15575
- if (e.id === or.id)
15585
+ if (e.id === cr.id)
15576
15586
  this._unregisterDescriptionsForNotInSheetId(), this._registerDescriptions();
15577
- else if (e.id === mr.id) {
15587
+ else if (e.id === fr.id) {
15578
15588
  const n = e.params;
15579
15589
  this._registerDescription(n);
15580
- } else if (e.id === cr.id) {
15590
+ } else if (e.id === sr.id) {
15581
15591
  const n = e.params;
15582
15592
  this._unregisterDescription(n);
15583
15593
  } else if (e.id === rn.id) {
@@ -15660,13 +15670,13 @@ let rt = class extends re {
15660
15670
  }), this._descriptionService.unregisterDescriptions(i);
15661
15671
  }
15662
15672
  };
15663
- rt = Km([
15664
- Le(Ae.Rendered, rt),
15665
- Tt(0, Ye),
15666
- Tt(1, Jn),
15667
- Tt(2, Pe),
15668
- Tt(3, fe)
15669
- ], rt);
15673
+ it = Km([
15674
+ Le(Ae.Rendered, it),
15675
+ bt(0, Xe),
15676
+ bt(1, Jn),
15677
+ bt(2, Pe),
15678
+ bt(3, fe)
15679
+ ], it);
15670
15680
  var km = Object.defineProperty, $m = Object.getOwnPropertyDescriptor, jm = (a, e, t, n) => {
15671
15681
  for (var i = n > 1 ? void 0 : n ? $m(e, t) : e, u = a.length - 1, o; u >= 0; u--)
15672
15682
  (o = a[u]) && (i = (n ? o(e, t, i) : o(i)) || i);
@@ -15678,28 +15688,28 @@ let xt = class extends re {
15678
15688
  }
15679
15689
  registerFormula(a, e) {
15680
15690
  const t = /* @__PURE__ */ new Map(), n = this._lexerTreeBuilder.sequenceNodesBuilder(a), i = new zn(), u = (o) => {
15681
- const m = this._univerInstanceService.getCurrentUnitForType(G.UNIVER_SHEET), c = m.getActiveSheet(), f = m.getUnitId(), d = c == null ? void 0 : c.getSheetId(), s = n == null ? void 0 : n.map((L) => {
15691
+ const m = this._univerInstanceService.getCurrentUnitForType(G.UNIVER_SHEET), c = m.getActiveSheet(), f = m.getUnitId(), d = c == null ? void 0 : c.getSheetId(), l = n == null ? void 0 : n.map((L) => {
15682
15692
  if (typeof L == "object" && L.nodeType === me.REFERENCE) {
15683
15693
  const A = t.get(L.token);
15684
15694
  if (A.unitId && A.unitId !== f && A.subUnitId && A.subUnitId !== d)
15685
15695
  return L;
15686
- const E = sr(A.range, o);
15696
+ const E = dr(A.range, o);
15687
15697
  let b = "";
15688
- return A.unitId && A.sheetName ? b = vi(A.unitId, A.sheetName, A.range) : A.sheetName ? b = qi(A.sheetName, A.range) : b = E ? ot(E) : K.ERROR, {
15698
+ return A.unitId && A.sheetName ? b = qi(A.unitId, A.sheetName, A.range) : A.sheetName ? b = Fi(A.sheetName, A.range) : b = E ? ut(E) : K.ERROR, {
15689
15699
  ...L,
15690
15700
  token: b
15691
15701
  };
15692
15702
  } else
15693
15703
  return L;
15694
- }), l = s && ln(s);
15695
- return e(`=${l}`);
15704
+ }), s = l && dn(l);
15705
+ return e(`=${s}`);
15696
15706
  };
15697
15707
  return n == null || n.forEach((o) => {
15698
15708
  if (typeof o == "object" && o.nodeType === me.REFERENCE) {
15699
- const m = qe(o.token), { range: c, unitId: f, sheetName: d } = m, s = f ? this._univerInstanceService.getUniverSheetInstance(f) : this._univerInstanceService.getCurrentUnitForType(G.UNIVER_SHEET), l = d ? s == null ? void 0 : s.getSheetBySheetName(d) : s == null ? void 0 : s.getActiveSheet();
15700
- if (!l)
15709
+ const m = ve(o.token), { range: c, unitId: f, sheetName: d } = m, l = f ? this._univerInstanceService.getUniverSheetInstance(f) : this._univerInstanceService.getCurrentUnitForType(G.UNIVER_SHEET), s = d ? l == null ? void 0 : l.getSheetBySheetName(d) : l == null ? void 0 : l.getActiveSheet();
15710
+ if (!s)
15701
15711
  return;
15702
- const L = l.getSheetId(), A = {
15712
+ const L = s.getSheetId(), A = {
15703
15713
  unitId: f,
15704
15714
  subUnitId: L,
15705
15715
  range: c,
@@ -15711,11 +15721,11 @@ let xt = class extends re {
15711
15721
  }
15712
15722
  };
15713
15723
  xt = jm([
15714
- Jt(0, y(fr)),
15715
- Jt(1, y(Xe)),
15724
+ Jt(0, q(lr)),
15725
+ Jt(1, q(mt)),
15716
15726
  Jt(2, Pe)
15717
15727
  ], xt);
15718
- var ze = /* @__PURE__ */ ((a) => (a[a.NOT_REGISTER = 1] = "NOT_REGISTER", a[a.SUCCESS = 2] = "SUCCESS", a[a.WAIT = 3] = "WAIT", a[a.ERROR = 4] = "ERROR", a))(ze || {}), Qm = Object.defineProperty, zm = Object.getOwnPropertyDescriptor, Zm = (a, e, t, n) => {
15728
+ var Qe = /* @__PURE__ */ ((a) => (a[a.NOT_REGISTER = 1] = "NOT_REGISTER", a[a.SUCCESS = 2] = "SUCCESS", a[a.WAIT = 3] = "WAIT", a[a.ERROR = 4] = "ERROR", a))(Qe || {}), Qm = Object.defineProperty, zm = Object.getOwnPropertyDescriptor, Zm = (a, e, t, n) => {
15719
15729
  for (var i = n > 1 ? void 0 : n ? zm(e, t) : e, u = a.length - 1, o; u >= 0; u--)
15720
15730
  (o = a[u]) && (i = (n ? o(e, t, i) : o(i)) || i);
15721
15731
  return n && i && Qm(e, t, i), i;
@@ -15724,9 +15734,9 @@ let vt = class extends re {
15724
15734
  constructor(e, t) {
15725
15735
  super();
15726
15736
  x(this, "_formulaCacheMap", /* @__PURE__ */ new Map());
15727
- x(this, "_formulaChange$", new ve());
15737
+ x(this, "_formulaChange$", new xe());
15728
15738
  x(this, "formulaChange$", this._formulaChange$.asObservable());
15729
- x(this, "_formulaResult$", new ve());
15739
+ x(this, "_formulaResult$", new xe());
15730
15740
  x(this, "formulaResult$", this._formulaResult$.asObservable());
15731
15741
  this._commandService = e, this._activeDirtyManagerService = t, this._initFormulaRegister(), this._initFormulaCalculationResultChange();
15732
15742
  }
@@ -15741,25 +15751,25 @@ let vt = class extends re {
15741
15751
  }
15742
15752
  _initFormulaRegister() {
15743
15753
  this._activeDirtyManagerService.register(
15744
- Nt.id,
15754
+ It.id,
15745
15755
  {
15746
- commandId: Nt.id,
15756
+ commandId: It.id,
15747
15757
  getDirtyData(e) {
15748
15758
  return {
15749
15759
  dirtyUnitOtherFormulaMap: e.params
15750
15760
  };
15751
15761
  }
15752
15762
  }
15753
- ), this.formulaChange$.pipe(Br(16), Vr((e) => !!e.length), Ze((e) => e.reduce((t, n) => {
15763
+ ), this.formulaChange$.pipe(Hr(16), un((e) => !!e.length), ze((e) => e.reduce((t, n) => {
15754
15764
  const { unitId: i, subUnitId: u, formulaId: o, formulaText: m } = n;
15755
15765
  return t[i] || (t[i] = {}), t[i][u] || (t[i][u] = {}), t[i][u][o] = { f: m }, t;
15756
15766
  }, {}))).subscribe((e) => {
15757
15767
  for (const t in e)
15758
15768
  for (const n in e[t]) {
15759
15769
  const i = e[t][n], u = { unitId: t, subUnitId: n, formulaMap: i };
15760
- this._commandService.executeCommand(yi.id, u).then(() => {
15770
+ this._commandService.executeCommand(Ui.id, u).then(() => {
15761
15771
  this._commandService.executeCommand(
15762
- Nt.id,
15772
+ It.id,
15763
15773
  { [t]: { [n]: i } }
15764
15774
  );
15765
15775
  });
@@ -15768,21 +15778,21 @@ let vt = class extends re {
15768
15778
  }
15769
15779
  _initFormulaCalculationResultChange() {
15770
15780
  this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
15771
- if (e.id === ta.id) {
15781
+ if (e.id === ea.id) {
15772
15782
  const t = e.params, { unitOtherData: n } = t, i = {};
15773
15783
  for (const u in n) {
15774
15784
  const o = n[u], m = {};
15775
15785
  i[u] = m;
15776
15786
  for (const c in o) {
15777
- const f = this._ensureCacheMap(u, c), d = o[c], s = [];
15778
- m[c] = s;
15779
- for (const l in d) {
15780
- const L = d[l];
15781
- if (f.has(l)) {
15782
- const A = f.get(l);
15783
- A.result = L, A.status = ze.SUCCESS, A.callbacks.forEach((E) => {
15787
+ const f = this._ensureCacheMap(u, c), d = o[c], l = [];
15788
+ m[c] = l;
15789
+ for (const s in d) {
15790
+ const L = d[s];
15791
+ if (f.has(s)) {
15792
+ const A = f.get(s);
15793
+ A.result = L, A.status = Qe.SUCCESS, A.callbacks.forEach((E) => {
15784
15794
  E(L);
15785
- }), A.callbacks.clear(), s.push(A);
15795
+ }), A.callbacks.clear(), l.push(A);
15786
15796
  }
15787
15797
  }
15788
15798
  }
@@ -15795,7 +15805,7 @@ let vt = class extends re {
15795
15805
  const u = this._createFormulaId(e, t);
15796
15806
  return this._ensureCacheMap(e, t).set(u, {
15797
15807
  result: void 0,
15798
- status: ze.WAIT,
15808
+ status: Qe.WAIT,
15799
15809
  formulaId: u,
15800
15810
  callbacks: /* @__PURE__ */ new Set(),
15801
15811
  extra: i
@@ -15812,13 +15822,13 @@ let vt = class extends re {
15812
15822
  subUnitId: t,
15813
15823
  formulaIdList: n
15814
15824
  };
15815
- this._commandService.executeCommand(Fi.id, i);
15825
+ this._commandService.executeCommand(Bi.id, i);
15816
15826
  const u = this._ensureCacheMap(e, t);
15817
15827
  n.forEach((o) => u.delete(o));
15818
15828
  }
15819
15829
  getFormulaValue(e, t, n) {
15820
15830
  const i = this._ensureCacheMap(e, t), u = i.get(n);
15821
- return u ? u.status === ze.SUCCESS || u.status === ze.ERROR ? Promise.resolve(u) : new Promise((o) => {
15831
+ return u ? u.status === Qe.SUCCESS || u.status === Qe.ERROR ? Promise.resolve(u) : new Promise((o) => {
15822
15832
  u.callbacks.add(() => {
15823
15833
  o(i.get(n));
15824
15834
  });
@@ -15830,7 +15840,7 @@ let vt = class extends re {
15830
15840
  };
15831
15841
  vt = Zm([
15832
15842
  kn(0, fe),
15833
- kn(1, sn)
15843
+ kn(1, ln)
15834
15844
  ], vt);
15835
15845
  var Jm = Object.defineProperty, ec = Object.getOwnPropertyDescriptor, tc = (a, e, t, n) => {
15836
15846
  for (var i = n > 1 ? void 0 : n ? ec(e, t) : e, u = a.length - 1, o; u >= 0; u--)
@@ -15851,7 +15861,7 @@ const tn = "SHEET_FORMULA_ALERT", nc = {
15851
15861
  [K.CONNECT]: "connect",
15852
15862
  [K.NULL]: "null"
15853
15863
  };
15854
- let mn = class extends re {
15864
+ let cn = class extends re {
15855
15865
  constructor(a, e, t, n) {
15856
15866
  super(), this._context = a, this._hoverManagerService = e, this._cellAlertManagerService = t, this._localeService = n, this._init();
15857
15867
  }
@@ -15873,7 +15883,7 @@ let mn = class extends re {
15873
15883
  if (m && m.row === a.location.row && m.col === a.location.col && m.subUnitId === a.location.subUnitId && m.unitId === a.location.unitId)
15874
15884
  return;
15875
15885
  this._cellAlertManagerService.showAlert({
15876
- type: Tr.ERROR,
15886
+ type: Sr.ERROR,
15877
15887
  title: this._localeService.t("formula.error.title"),
15878
15888
  message: this._localeService.t(`formula.error.${nc[u]}`),
15879
15889
  location: a.location,
@@ -15888,11 +15898,11 @@ let mn = class extends re {
15888
15898
  }));
15889
15899
  }
15890
15900
  };
15891
- mn = tc([
15892
- en(1, y(Er)),
15893
- en(2, y(Sr)),
15894
- en(3, y(we))
15895
- ], mn);
15901
+ cn = tc([
15902
+ en(1, q(Ir)),
15903
+ en(2, q(Nr)),
15904
+ en(3, q(He))
15905
+ ], cn);
15896
15906
  var ac = Object.defineProperty, ic = Object.getOwnPropertyDescriptor, rc = (a, e, t, n) => {
15897
15907
  for (var i = n > 1 ? void 0 : n ? ic(e, t) : e, u = a.length - 1, o; u >= 0; u--)
15898
15908
  (o = a[u]) && (i = (n ? o(e, t, i) : o(i)) || i);
@@ -15904,42 +15914,36 @@ const oc = {
15904
15914
  color: "#409f11"
15905
15915
  }
15906
15916
  };
15907
- let ut = class extends mi {
15917
+ let rt = class extends mi {
15908
15918
  constructor(a) {
15909
15919
  super(), this._sheetInterceptorService = a, this._init();
15910
15920
  }
15911
15921
  _init() {
15912
15922
  this.disposeWithMe(this._sheetInterceptorService.intercept(
15913
- pn.CELL_CONTENT,
15923
+ na.CELL_CONTENT,
15914
15924
  {
15915
- handler: (a, e, t) => {
15916
- const n = ko(a);
15917
- return n !== null ? t({
15918
- ...a,
15919
- v: n
15920
- }) : Ga(a) ? t({
15921
- ...a,
15922
- markers: {
15923
- ...a == null ? void 0 : a.markers,
15924
- ...oc
15925
- }
15926
- }) : t(a);
15927
- },
15925
+ handler: (a, e, t) => Ga(a) ? t({
15926
+ ...a,
15927
+ markers: {
15928
+ ...a == null ? void 0 : a.markers,
15929
+ ...oc
15930
+ }
15931
+ }) : t(a),
15928
15932
  priority: 10
15929
15933
  }
15930
15934
  ));
15931
15935
  }
15932
15936
  };
15933
- ut = rc([
15934
- Le(Ae.Rendered, ut),
15935
- uc(0, y(Ut))
15936
- ], ut);
15937
+ rt = rc([
15938
+ Le(Ae.Rendered, rt),
15939
+ uc(0, q(Ln))
15940
+ ], rt);
15937
15941
  var Ka = Object.defineProperty, mc = Object.getOwnPropertyDescriptor, cc = (a, e, t) => e in a ? Ka(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t, ka = (a, e, t, n) => {
15938
15942
  for (var i = n > 1 ? void 0 : n ? mc(e, t) : e, u = a.length - 1, o; u >= 0; u--)
15939
15943
  (o = a[u]) && (i = (n ? o(e, t, i) : o(i)) || i);
15940
15944
  return n && i && Ka(e, t, i), i;
15941
- }, cn = (a, e) => (t, n) => e(t, n, a), $a = (a, e, t) => cc(a, typeof e != "symbol" ? e + "" : e, t);
15942
- let qt = class extends Zn {
15945
+ }, fn = (a, e) => (t, n) => e(t, n, a), $a = (a, e, t) => cc(a, typeof e != "symbol" ? e + "" : e, t);
15946
+ let yt = class extends Zn {
15943
15947
  constructor(a = {}, e, t) {
15944
15948
  super(), this._config = a, this._injector = e, this._renderManagerService = t, this._config = ie.deepMerge({}, Xa, this._config);
15945
15949
  }
@@ -15951,7 +15955,7 @@ let qt = class extends Zn {
15951
15955
  }
15952
15956
  _registerRenderModules() {
15953
15957
  [
15954
- mn
15958
+ cn
15955
15959
  ].forEach((a) => {
15956
15960
  this.disposeWithMe(this._renderManagerService.registerRenderModule(G.UNIVER_SHEET, a));
15957
15961
  });
@@ -15961,7 +15965,7 @@ let qt = class extends Zn {
15961
15965
  // services
15962
15966
  [Fe, { useClass: Ma }],
15963
15967
  [
15964
- Ye,
15968
+ Xe,
15965
15969
  {
15966
15970
  useFactory: () => {
15967
15971
  var e;
@@ -15969,39 +15973,39 @@ let qt = class extends Zn {
15969
15973
  }
15970
15974
  }
15971
15975
  ],
15972
- [En, { useClass: Dt }],
15976
+ [Sn, { useClass: Dt }],
15973
15977
  [Wa, { useClass: gt }],
15974
15978
  [xt],
15975
15979
  [vt],
15976
15980
  // controllers
15977
15981
  [
15978
- nt,
15982
+ tt,
15979
15983
  {
15980
- useFactory: () => this._injector.createInstance(nt, this._config)
15984
+ useFactory: () => this._injector.createInstance(tt, this._config)
15981
15985
  }
15982
15986
  ],
15983
- [Rt],
15984
- [It],
15985
- [tt],
15987
+ [Nt],
15988
+ [St],
15986
15989
  [et],
15990
+ [Je],
15991
+ [nt],
15987
15992
  [at],
15988
- [it],
15989
15993
  [_t],
15990
- [Je],
15991
- [rt],
15992
- [ut]
15994
+ [Ze],
15995
+ [it],
15996
+ [rt]
15993
15997
  ].forEach((e) => this._injector.add(e));
15994
15998
  }
15995
15999
  };
15996
- $a(qt, "pluginName", Pn);
15997
- $a(qt, "type", G.UNIVER_SHEET);
15998
- qt = ka([
15999
- ci(Ui),
16000
- cn(1, y(mt)),
16001
- cn(2, Ft)
16002
- ], qt);
16003
- var Et;
16004
- let $n = (Et = class extends Zn {
16000
+ $a(yt, "pluginName", bn);
16001
+ $a(yt, "type", G.UNIVER_SHEET);
16002
+ yt = ka([
16003
+ ci(Vi),
16004
+ fn(1, q(ot)),
16005
+ fn(2, Ft)
16006
+ ], yt);
16007
+ var Tt;
16008
+ let $n = (Tt = class extends Zn {
16005
16009
  constructor(a = {}, e) {
16006
16010
  super(), this._config = a, this._injector = e, this._config = ie.deepMerge({}, Xa, this._config);
16007
16011
  }
@@ -16013,7 +16017,7 @@ let $n = (Et = class extends Zn {
16013
16017
  // services
16014
16018
  [Fe, { useClass: Ma }],
16015
16019
  [
16016
- Ye,
16020
+ Xe,
16017
16021
  {
16018
16022
  useFactory: () => {
16019
16023
  var e;
@@ -16021,32 +16025,41 @@ let $n = (Et = class extends Zn {
16021
16025
  }
16022
16026
  }
16023
16027
  ],
16024
- [En, { useClass: Dt }],
16028
+ [Sn, { useClass: Dt }],
16025
16029
  [Wa, { useClass: gt }],
16026
16030
  [xt],
16027
16031
  [vt],
16028
- [tt],
16029
16032
  [et],
16033
+ [Je],
16034
+ [nt],
16030
16035
  [at],
16036
+ [Ze],
16031
16037
  [it],
16032
- [Je],
16033
- [rt],
16034
- [ut]
16038
+ [rt]
16035
16039
  ].forEach((e) => this._injector.add(e));
16036
16040
  }
16037
- }, x(Et, "pluginName", Pn), x(Et, "type", G.UNIVER_SHEET), Et);
16041
+ }, x(Tt, "pluginName", bn), x(Tt, "type", G.UNIVER_SHEET), Tt);
16038
16042
  $n = ka([
16039
- cn(1, y(mt))
16043
+ fn(1, q(ot))
16040
16044
  ], $n);
16041
16045
  export {
16042
16046
  Mt as DescriptionService,
16043
16047
  Dt as FormulaCustomFunctionService,
16044
16048
  xt as FormulaRefRangeService,
16045
- Ye as IDescriptionService,
16046
- En as IFormulaCustomFunctionService,
16049
+ on as HelpFunctionOperation,
16050
+ Xe as IDescriptionService,
16051
+ Sn as IFormulaCustomFunctionService,
16047
16052
  Wa as IRegisterFunctionService,
16053
+ Oa as InsertFunctionCommand,
16054
+ Tn as InsertFunctionOperation,
16055
+ ga as MoreFunctionsOperation,
16056
+ It as OtherFormulaMarkDirty,
16057
+ En as ReferenceAbsoluteOperation,
16048
16058
  gt as RegisterFunctionService,
16049
16059
  vt as RegisterOtherFormulaService,
16060
+ mn as SearchFunctionOperation,
16061
+ qe as SelectEditorFormulaOperation,
16062
+ _a as SheetOnlyPasteFormulaCommand,
16050
16063
  $n as UniverSheetsFormulaMobilePlugin,
16051
- qt as UniverSheetsFormulaPlugin
16064
+ yt as UniverSheetsFormulaPlugin
16052
16065
  };