@univerjs/sheets-formula-ui 0.7.0 → 0.8.0-beta.0

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.
Files changed (43) hide show
  1. package/lib/cjs/index.js +7 -7
  2. package/lib/cjs/locale/en-US.js +1 -1
  3. package/lib/cjs/locale/fa-IR.js +1 -1
  4. package/lib/cjs/locale/fr-FR.js +1 -1
  5. package/lib/cjs/locale/ru-RU.js +1 -1
  6. package/lib/cjs/locale/vi-VN.js +1 -1
  7. package/lib/cjs/locale/zh-CN.js +1 -1
  8. package/lib/cjs/locale/zh-TW.js +1 -1
  9. package/lib/es/index.js +1434 -1359
  10. package/lib/es/locale/en-US.js +5 -0
  11. package/lib/es/locale/fa-IR.js +5 -0
  12. package/lib/es/locale/fr-FR.js +5 -0
  13. package/lib/es/locale/ru-RU.js +5 -0
  14. package/lib/es/locale/vi-VN.js +5 -0
  15. package/lib/es/locale/zh-CN.js +5 -0
  16. package/lib/es/locale/zh-TW.js +5 -0
  17. package/lib/index.css +1 -1
  18. package/lib/index.js +1434 -1359
  19. package/lib/locale/en-US.js +5 -0
  20. package/lib/locale/fa-IR.js +5 -0
  21. package/lib/locale/fr-FR.js +5 -0
  22. package/lib/locale/ru-RU.js +5 -0
  23. package/lib/locale/vi-VN.js +5 -0
  24. package/lib/locale/zh-CN.js +5 -0
  25. package/lib/locale/zh-TW.js +5 -0
  26. package/lib/types/controllers/menu.d.ts +6 -0
  27. package/lib/types/controllers/shortcuts/quick-sum.shortcut.d.ts +2 -0
  28. package/lib/types/locale/en-US.d.ts +5 -0
  29. package/lib/types/locale/fa-IR.d.ts +5 -0
  30. package/lib/types/locale/fr-FR.d.ts +5 -0
  31. package/lib/types/locale/ru-RU.d.ts +5 -0
  32. package/lib/types/locale/vi-VN.d.ts +5 -0
  33. package/lib/types/locale/zh-CN.d.ts +5 -0
  34. package/lib/types/locale/zh-TW.d.ts +5 -0
  35. package/lib/umd/index.js +7 -7
  36. package/lib/umd/locale/en-US.js +1 -1
  37. package/lib/umd/locale/fa-IR.js +1 -1
  38. package/lib/umd/locale/fr-FR.js +1 -1
  39. package/lib/umd/locale/ru-RU.js +1 -1
  40. package/lib/umd/locale/vi-VN.js +1 -1
  41. package/lib/umd/locale/zh-CN.js +1 -1
  42. package/lib/umd/locale/zh-TW.js +1 -1
  43. package/package.json +13 -13
package/lib/es/index.js CHANGED
@@ -1,44 +1,44 @@
1
- var $r = Object.defineProperty;
2
- var Ur = (e, t, n) => t in e ? $r(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var j = (e, t, n) => Ur(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { CommandType as ye, ICommandService as ue, createIdentifier as Vr, IContextService as zt, IUniverInstanceService as ee, Rectangle as Vn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Zt, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Wn, DEFAULT_EMPTY_DOCUMENT_VALUE as Hn, isRealNum as Wr, CellValueType as vn, getCellValueType as Hr, LocaleService as tt, Tools as Je, Inject as B, Injector as dt, ThemeService as ht, toDisposable as Bn, DisposableCollection as We, RANGE_TYPE as me, UniverInstanceType as J, ColorKit as Xt, getBodySlice as pn, Direction as ce, EDITOR_ACTIVATED as pt, createInternalEditorID as Br, generateRandomId as jr, BuildTextUtils as qr, RichTextBuilder as Kr, Disposable as nt, ObjectMatrix as ke, Range as Yr, isFormulaString as Ie, isFormulaId as He, FOCUSING_DOC as Gr, FOCUSING_UNIVER_EDITOR as zr, isICellData as Zr, ILogService as Xr, RxDisposable as Qr, InterceptorEffectEnum as Jr, DependentOn as eo, IConfigService as to, Plugin as no, merge as ro, registerDependencies as oo, touchDependencies as so } from "@univerjs/core";
5
- import { SheetPasteCommand as io, PREDEFINED_HOOK_NAME as Xe, IEditorBridgeService as Qt, SetCellEditVisibleOperation as jn, SheetSkeletonManagerService as At, BaseSelectionRenderService as co, getCoordByOffset as Cn, checkInHeaderRanges as _n, getAllSelection as lo, genNormalSelectionStyle as qn, getSheetObject as ao, attachSelectionWithCoord as Bt, SelectionControl as Kn, MoveSelectionCommand as Rn, JumpOver as bn, ExpandSelectionCommand as En, EMBEDDING_FORMULA_EDITOR as uo, IMarkSelectionService as ho, HoverManagerService as fo, CellAlertManagerService as go, CellAlertType as mo, IAutoFillService as So, APPLY_TYPE as vo, DATA_TYPE as In, ISheetClipboardService as po, COPY_TYPE as Yn, SELECTION_SHAPE_DEPTH as Co, useActiveWorkbook as _o, getCurrentRangeDisable$ as Gn, PASTE_SPECIAL_MENU_ID as Ro, whenFormulaEditorActivated as ft, SheetsUIPart as bo, RANGE_SELECTOR_COMPONENT_KEY as Eo, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as Io } from "@univerjs/sheets-ui";
6
- import { sequenceNodeType as z, serializeRange as Se, LexerTreeBuilder as Ce, deserializeRangeWithSheetWithCache as yo, matchRefDrawToken as To, isFormulaLexerToken as xo, matchToken as et, deserializeRangeWithSheet as rt, serializeRangeToRefString as Oo, serializeRangeWithSheet as at, generateStringWithSequence as No, operatorToken as zn, FormulaDataModel as gt, ERROR_TYPE_SET as Mo, ErrorType as ie, SetFormulaCalculationResultMutation as wo, SetArrayFormulaDataMutation as Ao, SetFormulaCalculationStopMutation as ko, FunctionType as Fo, UniverFormulaEnginePlugin as Do } from "@univerjs/engine-formula";
7
- import { Subject as st, BehaviorSubject as Zn, throttleTime as Lo, debounceTime as Jt, filter as jt, map as Xn, distinctUntilChanged as Po, merge as $o, combineLatestWith as Uo, switchMap as Vo, of as yn, Observable as Wo } from "rxjs";
8
- import { IEditorService as Be, DocSelectionRenderService as Qn, ReplaceTextRunsCommand as Tn, MoveSelectionOperation as Ho, MoveCursorOperation as Bo, useKeyboardEvent as jo, useResize as qo, DocBackScrollRenderController as Ko, RichTextEditor as Yo } from "@univerjs/docs-ui";
9
- import { DeviceInputEventType as Te, ScrollTimerType as Ut, SHEET_VIEWPORT_KEY as xn, Vector2 as On, IRenderManagerService as xe } from "@univerjs/engine-render";
10
- import { SheetsSelectionsService as en, getSheetCommandTarget as Jn, getCellAtRowCol as Go, SetSelectionsOperation as tn, IRefSelectionsService as kt, SelectionMoveType as Vt, convertSelectionDataToRange as zo, setEndForRange as Zo, REF_SELECTIONS_ENABLED as Nn, SetWorksheetActiveOperation as Mn, SheetInterceptorService as nn, ReorderRangeCommand as Xo, SetRangeValuesMutation as bt, SetRangeValuesUndoMutationFactory as Qo, BEFORE_CELL_EDIT as Jo, SetWorksheetRowAutoHeightMutation as es, INTERCEPTOR_POINT as ts, WorksheetSetCellValuePermission as er, WorksheetEditPermission as tr, RangeProtectionPermissionEditPoint as nr, WorkbookEditablePermission as rr } from "@univerjs/sheets";
11
- import { InsertFunctionCommand as ns, IDescriptionService as Ft, TriggerCalculationController as rs, UniverSheetsFormulaPlugin as os } from "@univerjs/sheets-formula";
12
- import { ISidebarService as rn, useDependency as T, useEvent as Q, useObservable as ve, RectPopup as qt, IShortcutService as Dt, KeyCode as L, MetaKeys as W, IContextMenuService as ss, useUpdateEffect as is, IZenZoneService as cs, ProgressBar as ls, MenuItemType as on, getMenuHiddenObservable as as, IClipboardInterfaceService as wn, RibbonStartGroup as us, IMenuManagerService as ds, IUIPartsService as or, ComponentManager as sr, connectInjector as ir, BuiltInUIPart as hs } from "@univerjs/ui";
13
- import { jsx as O, jsxs as V, Fragment as fs } from "react/jsx-runtime";
14
- import { clsx as pe, borderTopClassName as gs, borderClassName as sn, scrollbarClassName as cr, Tooltip as ms, Dialog as Ss, Input as lr, Button as Qe, borderLeftClassName as vs, Select as ps } from "@univerjs/design";
15
- import { forwardRef as Oe, useRef as Y, createElement as je, useEffect as P, useMemo as oe, useState as U, useCallback as Et, useLayoutEffect as It, useImperativeHandle as Cs } from "react";
16
- import { DocSelectionManagerService as ar } from "@univerjs/docs";
17
- import { debounceTime as _s } from "rxjs/operators";
18
- const cn = {
1
+ var Vr = Object.defineProperty;
2
+ var Wr = (e, t, n) => t in e ? Vr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var j = (e, t, n) => Wr(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { CommandType as Te, ICommandService as ue, createIdentifier as Hr, IContextService as rn, IUniverInstanceService as ee, Rectangle as Kn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as on, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Yn, DEFAULT_EMPTY_DOCUMENT_VALUE as Gn, isRealNum as Br, CellValueType as En, getCellValueType as jr, LocaleService as at, Tools as it, Inject as B, Injector as Ct, ThemeService as _t, toDisposable as zn, DisposableCollection as He, RANGE_TYPE as Se, UniverInstanceType as q, ColorKit as sn, getBodySlice as bn, Direction as ce, EDITOR_ACTIVATED as Tt, createInternalEditorID as qr, generateRandomId as Kr, BuildTextUtils as Yr, RichTextBuilder as Gr, Disposable as lt, ObjectMatrix as Fe, Range as zr, isFormulaString as ye, isFormulaId as Be, FOCUSING_DOC as Zr, FOCUSING_UNIVER_EDITOR as Xr, isICellData as Qr, ILogService as Jr, RxDisposable as eo, InterceptorEffectEnum as to, DependentOn as no, IConfigService as ro, Plugin as oo, merge as so, registerDependencies as io, touchDependencies as co } from "@univerjs/core";
5
+ import { SheetPasteCommand as ao, PREDEFINED_HOOK_NAME as ot, IEditorBridgeService as cn, SetCellEditVisibleOperation as Zn, SheetSkeletonManagerService as Vt, BaseSelectionRenderService as lo, getCoordByOffset as In, checkInHeaderRanges as yn, getAllSelection as uo, genNormalSelectionStyle as Xn, getSheetObject as ho, attachSelectionWithCoord as Xt, SelectionControl as Qn, MoveSelectionCommand as Tn, JumpOver as xn, ExpandSelectionCommand as On, EMBEDDING_FORMULA_EDITOR as fo, IMarkSelectionService as go, HoverManagerService as mo, CellAlertManagerService as po, CellAlertType as So, IAutoFillService as vo, APPLY_TYPE as Co, DATA_TYPE as Nn, ISheetClipboardService as _o, COPY_TYPE as Jn, SELECTION_SHAPE_DEPTH as Ro, useActiveWorkbook as Eo, getCurrentRangeDisable$ as je, PASTE_SPECIAL_MENU_ID as bo, whenFormulaEditorActivated as Rt, whenSheetEditorFocused as Io, SheetsUIPart as yo, RANGE_SELECTOR_COMPONENT_KEY as To, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as xo } from "@univerjs/sheets-ui";
6
+ import { sequenceNodeType as Z, serializeRange as ve, LexerTreeBuilder as _e, deserializeRangeWithSheetWithCache as Oo, matchRefDrawToken as No, isFormulaLexerToken as Mo, matchToken as ct, deserializeRangeWithSheet as ut, serializeRangeToRefString as wo, serializeRangeWithSheet as St, generateStringWithSequence as Ao, operatorToken as er, FormulaDataModel as Et, ERROR_TYPE_SET as ko, ErrorType as ie, SetFormulaCalculationResultMutation as Fo, SetArrayFormulaDataMutation as Do, SetFormulaCalculationStopMutation as Lo, FunctionType as $o, UniverFormulaEnginePlugin as Po } from "@univerjs/engine-formula";
7
+ import { Subject as ft, BehaviorSubject as tr, throttleTime as Uo, debounceTime as an, filter as Qt, map as nr, distinctUntilChanged as Vo, merge as Wo, combineLatestWith as Ho, switchMap as Bo, of as Mn, Observable as jo } from "rxjs";
8
+ import { IEditorService as qe, DocSelectionRenderService as rr, ReplaceTextRunsCommand as wn, MoveSelectionOperation as qo, MoveCursorOperation as Ko, useKeyboardEvent as Yo, useResize as Go, DocBackScrollRenderController as zo, RichTextEditor as Zo } from "@univerjs/docs-ui";
9
+ import { DeviceInputEventType as xe, ScrollTimerType as Yt, SHEET_VIEWPORT_KEY as An, Vector2 as kn, IRenderManagerService as Oe } from "@univerjs/engine-render";
10
+ import { SheetsSelectionsService as ln, getSheetCommandTarget as or, getCellAtRowCol as Xo, SetSelectionsOperation as un, IRefSelectionsService as Wt, SelectionMoveType as Gt, convertSelectionDataToRange as Qo, setEndForRange as Jo, REF_SELECTIONS_ENABLED as Fn, SetWorksheetActiveOperation as Dn, SheetInterceptorService as dn, ReorderRangeCommand as es, SetRangeValuesMutation as Mt, SetRangeValuesUndoMutationFactory as ts, BEFORE_CELL_EDIT as ns, SetWorksheetRowAutoHeightMutation as rs, INTERCEPTOR_POINT as os, WorksheetSetCellValuePermission as Ke, WorksheetEditPermission as Ye, RangeProtectionPermissionEditPoint as Ge, WorkbookEditablePermission as ze } from "@univerjs/sheets";
11
+ import { InsertFunctionCommand as ss, IDescriptionService as Ht, TriggerCalculationController as is, QuickSumCommand as cs, UniverSheetsFormulaPlugin as as } from "@univerjs/sheets-formula";
12
+ import { ISidebarService as hn, useDependency as T, useEvent as J, useObservable as Ce, RectPopup as Jt, IShortcutService as Bt, KeyCode as D, MetaKeys as P, IContextMenuService as ls, useUpdateEffect as us, IZenZoneService as ds, ProgressBar as hs, MenuItemType as Ze, getMenuHiddenObservable as dt, IClipboardInterfaceService as Ln, RibbonFormulasGroup as $n, IMenuManagerService as fs, IUIPartsService as sr, ComponentManager as ir, connectInjector as cr, BuiltInUIPart as gs } from "@univerjs/ui";
13
+ import { jsx as O, jsxs as W, Fragment as ms } from "react/jsx-runtime";
14
+ import { clsx as fe, borderTopClassName as ps, borderClassName as fn, scrollbarClassName as ar, Tooltip as Ss, Dialog as vs, Input as lr, Button as st, borderLeftClassName as Cs, Select as _s } from "@univerjs/design";
15
+ import { forwardRef as Ne, useRef as G, createElement as Xe, useEffect as $, useMemo as oe, useState as V, useCallback as wt, useLayoutEffect as At, useImperativeHandle as Rs } from "react";
16
+ import { DocSelectionManagerService as ur } from "@univerjs/docs";
17
+ import { debounceTime as Es } from "rxjs/operators";
18
+ const gn = {
19
19
  id: "sheet.command.paste-formula",
20
- type: ye.COMMAND,
21
- handler: async (e) => e.get(ue).executeCommand(io.id, {
22
- value: Xe.SPECIAL_PASTE_FORMULA
20
+ type: Te.COMMAND,
21
+ handler: async (e) => e.get(ue).executeCommand(ao.id, {
22
+ value: ot.SPECIAL_PASTE_FORMULA
23
23
  })
24
- }, ot = {
24
+ }, ht = {
25
25
  id: "formula-ui.operation.select-editor-formula",
26
- type: ye.OPERATION,
26
+ type: Te.OPERATION,
27
27
  handler: (e, t) => !0
28
28
  };
29
- var Rs = Object.getOwnPropertyDescriptor, bs = (e, t, n, o) => {
30
- for (var r = o > 1 ? void 0 : o ? Rs(t, n) : t, s = e.length - 1, c; s >= 0; s--)
29
+ var bs = Object.getOwnPropertyDescriptor, Is = (e, t, n, o) => {
30
+ for (var r = o > 1 ? void 0 : o ? bs(t, n) : t, s = e.length - 1, c; s >= 0; s--)
31
31
  (c = e[s]) && (r = c(r) || r);
32
32
  return r;
33
- }, Es = (e, t) => (n, o) => t(n, o, e);
34
- const Is = "FORMULA_PROMPT_ACTIVATED", ln = Vr("formula-ui.prompt-service");
35
- let Kt = class {
33
+ }, ys = (e, t) => (n, o) => t(n, o, e);
34
+ const Ts = "FORMULA_PROMPT_ACTIVATED", mn = Hr("formula-ui.prompt-service");
35
+ let en = class {
36
36
  constructor(e) {
37
- j(this, "_search$", new st());
38
- j(this, "_help$", new st());
39
- j(this, "_navigate$", new st());
40
- j(this, "_accept$", new st());
41
- j(this, "_acceptFormulaName$", new st());
37
+ j(this, "_search$", new ft());
38
+ j(this, "_help$", new ft());
39
+ j(this, "_navigate$", new ft());
40
+ j(this, "_accept$", new ft());
41
+ j(this, "_acceptFormulaName$", new ft());
42
42
  j(this, "search$", this._search$.asObservable());
43
43
  j(this, "help$", this._help$.asObservable());
44
44
  j(this, "navigate$", this._navigate$.asObservable());
@@ -55,7 +55,7 @@ let Kt = class {
55
55
  this._search$.complete(), this._help$.complete(), this._navigate$.complete(), this._accept$.complete(), this._acceptFormulaName$.complete(), this._sequenceNodes = [];
56
56
  }
57
57
  search(e) {
58
- this._contextService.setContextValue(Is, e.visible), this._searching = e.visible, this._search$.next(e);
58
+ this._contextService.setContextValue(Ts, e.visible), this._searching = e.visible, this._search$.next(e);
59
59
  }
60
60
  isSearching() {
61
61
  return this._searching;
@@ -117,7 +117,7 @@ let Kt = class {
117
117
  */
118
118
  updateSequenceRef(e, t) {
119
119
  const n = this._sequenceNodes[e];
120
- if (typeof n == "string" || n.nodeType !== z.REFERENCE)
120
+ if (typeof n == "string" || n.nodeType !== Z.REFERENCE)
121
121
  return;
122
122
  const o = t.length - n.token.length, r = { ...n };
123
123
  r.token = t, r.endIndex += o, this._sequenceNodes[e] = r;
@@ -125,8 +125,8 @@ let Kt = class {
125
125
  const i = this._sequenceNodes[s];
126
126
  if (typeof i == "string")
127
127
  continue;
128
- const a = { ...i };
129
- a.startIndex += o, a.endIndex += o, this._sequenceNodes[s] = a;
128
+ const l = { ...i };
129
+ l.startIndex += o, l.endIndex += o, this._sequenceNodes[s] = l;
130
130
  }
131
131
  }
132
132
  /**
@@ -141,7 +141,7 @@ let Kt = class {
141
141
  token: t,
142
142
  startIndex: e,
143
143
  endIndex: e + n - 1,
144
- nodeType: z.REFERENCE
144
+ nodeType: Z.REFERENCE
145
145
  });
146
146
  for (let r = o + 1, s = this._sequenceNodes.length; r < s; r++) {
147
147
  const c = this._sequenceNodes[r];
@@ -164,8 +164,8 @@ let Kt = class {
164
164
  const i = this._sequenceNodes[s];
165
165
  if (typeof i == "string")
166
166
  continue;
167
- const a = { ...i };
168
- a.startIndex += r, a.endIndex += r, this._sequenceNodes[s] = a;
167
+ const l = { ...i };
168
+ l.startIndex += r, l.endIndex += r, this._sequenceNodes[s] = l;
169
169
  }
170
170
  }
171
171
  enableLockedSelectionChange() {
@@ -187,130 +187,130 @@ let Kt = class {
187
187
  return this._isLockedOnSelectionInsertRefString;
188
188
  }
189
189
  };
190
- Kt = bs([
191
- Es(0, zt)
192
- ], Kt);
193
- const ys = {
190
+ en = Is([
191
+ ys(0, rn)
192
+ ], en);
193
+ const xs = {
194
194
  id: "formula-ui.operation.help-function",
195
- type: ye.OPERATION,
196
- handler: async (e, t) => (e.get(ln).help(t), !0)
197
- }, an = {
195
+ type: Te.OPERATION,
196
+ handler: async (e, t) => (e.get(mn).help(t), !0)
197
+ }, he = {
198
198
  id: "formula-ui.operation.insert-function",
199
- type: ye.OPERATION,
199
+ type: Te.OPERATION,
200
200
  // eslint-disable-next-line
201
201
  handler: async (e, t) => {
202
- var p, _;
203
- const n = e.get(en), o = e.get(Be), r = n.getCurrentSelections();
202
+ var v, _;
203
+ const n = e.get(ln), o = e.get(qe), r = n.getCurrentSelections();
204
204
  if (!r || !r.length)
205
205
  return !1;
206
- const s = Jn(e.get(ee));
206
+ const s = or(e.get(ee));
207
207
  if (!s) return !1;
208
- const { worksheet: c, unitId: i, subUnitId: a } = s, f = c.getCellMatrix(), { value: h } = t, m = e.get(ue);
209
- e.get(Qt);
208
+ const { worksheet: c, unitId: i, subUnitId: l } = s, f = c.getCellMatrix(), { value: h } = t, m = e.get(ue);
209
+ e.get(cn);
210
210
  const u = [], d = [];
211
- let l = null, v = 0, g = 0, S = "";
212
- if (r.length === 1 && (Os(r[0].range) || Ns(r[0].range) && kn(f, r[0].range))) {
213
- const { range: R, primary: C } = r[0], y = (p = C == null ? void 0 : C.actualRow) != null ? p : R.startRow, N = (_ = C == null ? void 0 : C.actualColumn) != null ? _ : R.startColumn;
214
- l = R, v = y, g = N;
215
- const k = An(f, y, N);
216
- k && (S = Se(k));
211
+ let a = null, S = 0, g = 0, p = "";
212
+ if (r.length === 1 && (Ms(r[0].range) || ws(r[0].range) && Un(f, r[0].range))) {
213
+ const { range: R, primary: C } = r[0], y = (v = C == null ? void 0 : C.actualRow) != null ? v : R.startRow, N = (_ = C == null ? void 0 : C.actualColumn) != null ? _ : R.startColumn;
214
+ a = R, S = y, g = N;
215
+ const k = Pn(f, y, N);
216
+ k && (p = ve(k));
217
217
  } else
218
218
  r.some((R) => {
219
219
  var N, k;
220
220
  const { range: C, primary: y } = R;
221
- if (kn(f, C)) {
222
- const F = (N = y == null ? void 0 : y.actualRow) != null ? N : C.startRow, x = (k = y == null ? void 0 : y.actualColumn) != null ? k : C.startColumn, w = An(f, F, x);
221
+ if (Un(f, C)) {
222
+ const F = (N = y == null ? void 0 : y.actualRow) != null ? N : C.startRow, x = (k = y == null ? void 0 : y.actualColumn) != null ? k : C.startColumn, w = Pn(f, F, x);
223
223
  if (!w)
224
- return l = C, v = F, g = x, !0;
225
- const M = Se(w), E = `=${h}(${M})`;
224
+ return a = C, S = F, g = x, !0;
225
+ const M = ve(w), b = `=${h}(${M})`;
226
226
  u.push({
227
227
  range: C,
228
228
  primary: {
229
229
  row: F,
230
230
  column: x
231
231
  },
232
- formula: E
232
+ formula: b
233
233
  });
234
234
  } else {
235
235
  const { startRow: F, startColumn: x, endRow: w, endColumn: M } = C;
236
236
  if (F === w) {
237
- const E = Ms(f, F, M, c.getColumnCount() - 1), b = E === M ? M - 1 : M, I = Se({
237
+ const b = As(f, F, M, c.getColumnCount() - 1), E = b === M ? M - 1 : M, I = ve({
238
238
  startRow: F,
239
239
  endRow: w,
240
240
  startColumn: x,
241
- endColumn: b
241
+ endColumn: E
242
242
  }), A = `=${h}(${I})`;
243
243
  d.push({
244
244
  range: C,
245
245
  primary: {
246
246
  row: F,
247
- column: E
247
+ column: b
248
248
  },
249
249
  formula: A
250
250
  });
251
251
  } else {
252
- let E = -1;
252
+ let b = -1;
253
253
  for (let I = x; I <= M; I++) {
254
- const A = ws(f, I, w, c.getRowCount() - 1);
255
- E = Math.max(E, A);
254
+ const A = ks(f, I, w, c.getRowCount() - 1);
255
+ b = Math.max(b, A);
256
256
  }
257
- const b = E === w ? w - 1 : w;
257
+ const E = b === w ? w - 1 : w;
258
258
  for (let I = x; I <= M; I++) {
259
- const A = Se({
259
+ const A = ve({
260
260
  startRow: F,
261
- endRow: b,
261
+ endRow: E,
262
262
  startColumn: I,
263
263
  endColumn: I
264
- }), D = `=${h}(${A})`;
264
+ }), L = `=${h}(${A})`;
265
265
  d.push({
266
266
  range: C,
267
267
  primary: {
268
- row: E,
268
+ row: b,
269
269
  column: I
270
270
  },
271
- formula: D
271
+ formula: L
272
272
  });
273
273
  }
274
274
  }
275
275
  }
276
276
  return !1;
277
277
  });
278
- if (l) {
279
- const R = Go(v, g, c), C = {
280
- range: Vn.clone(l),
278
+ if (a) {
279
+ const R = Xo(S, g, c), C = {
280
+ range: Kn.clone(a),
281
281
  primary: {
282
282
  startRow: R.startRow,
283
283
  startColumn: R.startColumn,
284
284
  endRow: R.endRow,
285
285
  endColumn: R.endColumn,
286
- actualRow: v,
286
+ actualRow: S,
287
287
  actualColumn: g,
288
288
  isMerged: R.isMerged,
289
- isMergedMainCell: R.startRow === v && R.startColumn === g
289
+ isMergedMainCell: R.startRow === S && R.startColumn === g
290
290
  }
291
291
  }, y = {
292
292
  unitId: i,
293
- subUnitId: a,
293
+ subUnitId: l,
294
294
  selections: [C]
295
295
  };
296
- await m.executeCommand(tn.id, y);
297
- const N = o.getEditor(Zt), k = o.getEditor(Wn);
298
- m.syncExecuteCommand(jn.id, {
296
+ await m.executeCommand(un.id, y);
297
+ const N = o.getEditor(on), k = o.getEditor(Yn);
298
+ m.syncExecuteCommand(Zn.id, {
299
299
  visible: !0,
300
300
  unitId: i,
301
- eventType: Te.Dblclick
301
+ eventType: xe.Dblclick
302
302
  });
303
- const F = `=${h}(${S}`;
303
+ const F = `=${h}(${p}`;
304
304
  N == null || N.replaceText(F), k == null || k.replaceText(F, !1);
305
305
  }
306
- return u.length === 0 && d.length === 0 ? !1 : m.executeCommand(ns.id, {
306
+ return u.length === 0 && d.length === 0 ? !1 : m.executeCommand(ss.id, {
307
307
  list: u,
308
308
  listOfRangeHasNumber: d
309
309
  });
310
310
  }
311
311
  };
312
- function An(e, t, n) {
313
- const o = Ts(e, t, n);
312
+ function Pn(e, t, n) {
313
+ const o = Os(e, t, n);
314
314
  if (o !== t)
315
315
  return {
316
316
  startRow: o,
@@ -318,7 +318,7 @@ function An(e, t, n) {
318
318
  startColumn: n,
319
319
  endColumn: n
320
320
  };
321
- const r = xs(e, t, n);
321
+ const r = Ns(e, t, n);
322
322
  return r !== n ? {
323
323
  startRow: t,
324
324
  endRow: t,
@@ -326,16 +326,16 @@ function An(e, t, n) {
326
326
  endColumn: n - 1
327
327
  } : null;
328
328
  }
329
- function Ts(e, t, n) {
329
+ function Os(e, t, n) {
330
330
  let o = !1;
331
331
  if (t === 0) return t;
332
332
  for (let r = t - 1; r >= 0; r--) {
333
333
  const s = e.getValue(r, n);
334
- if (ut(s) && !o) {
334
+ if (vt(s) && !o) {
335
335
  if (r === 0) return 0;
336
336
  o = !0;
337
337
  } else {
338
- if (o && !ut(s))
338
+ if (o && !vt(s))
339
339
  return r + 1;
340
340
  if (o && r === 0)
341
341
  return 0;
@@ -343,16 +343,16 @@ function Ts(e, t, n) {
343
343
  }
344
344
  return t;
345
345
  }
346
- function xs(e, t, n) {
346
+ function Ns(e, t, n) {
347
347
  let o = !1;
348
348
  if (n === 0) return n;
349
349
  for (let r = n - 1; r >= 0; r--) {
350
350
  const s = e.getValue(t, r);
351
- if (ut(s) && !o) {
351
+ if (vt(s) && !o) {
352
352
  if (r === 0) return 0;
353
353
  o = !0;
354
354
  } else {
355
- if (o && !ut(s))
355
+ if (o && !vt(s))
356
356
  return r + 1;
357
357
  if (o && r === 0)
358
358
  return 0;
@@ -360,57 +360,57 @@ function xs(e, t, n) {
360
360
  }
361
361
  return n;
362
362
  }
363
- function ut(e) {
363
+ function vt(e) {
364
364
  if (e != null && e.p) {
365
365
  const t = e == null ? void 0 : e.p.body;
366
366
  if (t == null)
367
367
  return !1;
368
- const n = t.dataStream, r = n.substring(n.length - 2, n.length) === Hn ? n.substring(0, n.length - 2) : n;
369
- return Wr(r);
368
+ const n = t.dataStream, r = n.substring(n.length - 2, n.length) === Gn ? n.substring(0, n.length - 2) : n;
369
+ return Br(r);
370
370
  }
371
- return e && (e.t === vn.NUMBER || Hr(e) === vn.NUMBER);
371
+ return e && (e.t === En.NUMBER || jr(e) === En.NUMBER);
372
372
  }
373
- function Os(e) {
373
+ function Ms(e) {
374
374
  return e.startRow === e.endRow && e.startColumn === e.endColumn;
375
375
  }
376
- function Ns(e) {
376
+ function ws(e) {
377
377
  return e.startRow !== e.endRow && e.startColumn !== e.endColumn;
378
378
  }
379
- function kn(e, t) {
379
+ function Un(e, t) {
380
380
  for (let n = t.startRow; n <= t.endRow; n++)
381
381
  for (let o = t.startColumn; o <= t.endColumn; o++)
382
- if (ut(e.getValue(n, o)))
382
+ if (vt(e.getValue(n, o)))
383
383
  return !1;
384
384
  return !0;
385
385
  }
386
- function Ms(e, t, n, o) {
386
+ function As(e, t, n, o) {
387
387
  for (let r = n; r <= o; r++)
388
388
  if (!e.getValue(t, r))
389
389
  return r;
390
390
  return o;
391
391
  }
392
- function ws(e, t, n, o) {
392
+ function ks(e, t, n, o) {
393
393
  for (let r = n; r <= o; r++)
394
394
  if (!e.getValue(r, t))
395
395
  return r;
396
396
  return o;
397
397
  }
398
- const ur = "SHEET_FORMULA_UI_PLUGIN", dr = `${ur}_MORE_FUNCTIONS_COMPONENT`, un = {
398
+ const dr = "SHEET_FORMULA_UI_PLUGIN", hr = `${dr}_MORE_FUNCTIONS_COMPONENT`, fr = {
399
399
  id: "formula-ui.operation.more-functions",
400
- type: ye.OPERATION,
401
- handler: async (e) => (e.get(rn).open({
400
+ type: Te.OPERATION,
401
+ handler: async (e) => (e.get(hn).open({
402
402
  header: { title: "formula.insert.tooltip" },
403
- children: { label: dr }
403
+ children: { label: hr }
404
404
  }), !0)
405
- }, hr = {
405
+ }, gr = {
406
406
  id: "formula-ui.operation.change-ref-to-absolute",
407
- type: ye.OPERATION,
407
+ type: Te.OPERATION,
408
408
  handler: async (e) => !0
409
- }, As = {
409
+ }, Fs = {
410
410
  id: "formula-ui.operation.search-function",
411
- type: ye.OPERATION,
412
- handler: async (e, t) => (e.get(ln).search(t), !0)
413
- }, dn = (e, t, n = !0) => {
411
+ type: Te.OPERATION,
412
+ handler: async (e, t) => (e.get(mn).search(t), !0)
413
+ }, pn = (e, t, n = !0) => {
414
414
  let o = -1;
415
415
  return e.reduce((r, s, c) => {
416
416
  if (r.isFinish)
@@ -419,47 +419,47 @@ const ur = "SHEET_FORMULA_UI_PLUGIN", dr = `${ur}_MORE_FUNCTIONS_COMPONENT`, un
419
419
  if (typeof s != "string")
420
420
  r.currentIndex += s.token.length;
421
421
  else {
422
- const a = s.length;
423
- r.currentIndex += a;
422
+ const l = s.length;
423
+ r.currentIndex += l;
424
424
  }
425
425
  return (n ? r.currentIndex === t : t > i && t <= r.currentIndex) && (o = c, r.isFinish = !0), r;
426
426
  }, { currentIndex: 0, isFinish: !1 }), o;
427
- }, fr = (e, t) => {
427
+ }, mr = (e, t) => {
428
428
  const n = e[t];
429
429
  let o = -1;
430
- if (!n || typeof n == "string" || n.nodeType !== z.REFERENCE) return -1;
430
+ if (!n || typeof n == "string" || n.nodeType !== Z.REFERENCE) return -1;
431
431
  for (let r = 0; r <= t; r++) {
432
432
  const s = e[r];
433
- typeof s != "string" && s.nodeType === z.REFERENCE && o++;
433
+ typeof s != "string" && s.nodeType === Z.REFERENCE && o++;
434
434
  }
435
435
  return o;
436
436
  };
437
- var ae = function() {
438
- return ae = Object.assign || function(e) {
437
+ var le = function() {
438
+ return le = Object.assign || function(e) {
439
439
  for (var t, n = 1, o = arguments.length; n < o; n++) {
440
440
  t = arguments[n];
441
441
  for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
442
442
  }
443
443
  return e;
444
- }, ae.apply(this, arguments);
445
- }, ks = function(e, t) {
444
+ }, le.apply(this, arguments);
445
+ }, Ds = function(e, t) {
446
446
  var n = {};
447
447
  for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
448
448
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
449
449
  for (var r = 0, o = Object.getOwnPropertySymbols(e); r < o.length; r++)
450
450
  t.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[r]) && (n[o[r]] = e[o[r]]);
451
451
  return n;
452
- }, qe = Oe(function(e, t) {
453
- var n = e.icon, o = e.id, r = e.className, s = e.extend, c = ks(e, ["icon", "id", "className", "extend"]), i = "univerjs-icon univerjs-icon-".concat(o, " ").concat(r || "").trim(), a = Y("_".concat(Ls()));
454
- return gr(n, "".concat(o), { defIds: n.defIds, idSuffix: a.current }, ae({ ref: t, className: i }, c), s);
452
+ }, Qe = Ne(function(e, t) {
453
+ var n = e.icon, o = e.id, r = e.className, s = e.extend, c = Ds(e, ["icon", "id", "className", "extend"]), i = "univerjs-icon univerjs-icon-".concat(o, " ").concat(r || "").trim(), l = G("_".concat(Ps()));
454
+ return pr(n, "".concat(o), { defIds: n.defIds, idSuffix: l.current }, le({ ref: t, className: i }, c), s);
455
455
  });
456
- function gr(e, t, n, o, r) {
457
- return je(e.tag, ae(ae({ key: t }, Fs(e, n, r)), o), (Ds(e, n).children || []).map(function(s, c) {
458
- return gr(s, "".concat(t, "-").concat(e.tag, "-").concat(c), n, void 0, r);
456
+ function pr(e, t, n, o, r) {
457
+ return Xe(e.tag, le(le({ key: t }, Ls(e, n, r)), o), ($s(e, n).children || []).map(function(s, c) {
458
+ return pr(s, "".concat(t, "-").concat(e.tag, "-").concat(c), n, void 0, r);
459
459
  }));
460
460
  }
461
- function Fs(e, t, n) {
462
- var o = ae({}, e.attrs);
461
+ function Ls(e, t, n) {
462
+ var o = le({}, e.attrs);
463
463
  n != null && n.colorChannel1 && o.fill === "colorChannel1" && (o.fill = n.colorChannel1), e.tag === "mask" && o.id && (o.id = o.id + t.idSuffix), Object.entries(o).forEach(function(s) {
464
464
  var c = s[0], i = s[1];
465
465
  c === "mask" && typeof i == "string" && (o[c] = i.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
@@ -470,71 +470,71 @@ function Fs(e, t, n) {
470
470
  typeof i == "string" && (o[c] = i.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
471
471
  })), o;
472
472
  }
473
- function Ds(e, t) {
473
+ function $s(e, t) {
474
474
  var n, o = t.defIds;
475
- return !o || o.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ? ae(ae({}, e), { children: e.children.map(function(r) {
476
- return typeof r.attrs.id == "string" && o && o.indexOf(r.attrs.id) > -1 ? ae(ae({}, r), { attrs: ae(ae({}, r.attrs), { id: r.attrs.id + t.idSuffix }) }) : r;
475
+ return !o || o.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ? le(le({}, e), { children: e.children.map(function(r) {
476
+ return typeof r.attrs.id == "string" && o && o.indexOf(r.attrs.id) > -1 ? le(le({}, r), { attrs: le(le({}, r.attrs), { id: r.attrs.id + t.idSuffix }) }) : r;
477
477
  }) }) : e;
478
478
  }
479
- function Ls() {
479
+ function Ps() {
480
480
  return Math.random().toString(36).substring(2, 8);
481
481
  }
482
- qe.displayName = "UniverIcon";
483
- var Ps = { 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" } }] }, mr = Oe(function(e, t) {
484
- return je(qe, Object.assign({}, e, {
482
+ Qe.displayName = "UniverIcon";
483
+ var Us = { 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" } }] }, Sr = Ne(function(e, t) {
484
+ return Xe(Qe, Object.assign({}, e, {
485
485
  id: "check-mark-single",
486
486
  ref: t,
487
- icon: Ps
487
+ icon: Us
488
488
  }));
489
489
  });
490
- mr.displayName = "CheckMarkSingle";
491
- var $s = { 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" } }] }, Sr = Oe(function(e, t) {
492
- return je(qe, Object.assign({}, e, {
490
+ Sr.displayName = "CheckMarkSingle";
491
+ var Vs = { 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" } }] }, vr = Ne(function(e, t) {
492
+ return Xe(Qe, Object.assign({}, e, {
493
493
  id: "close-single",
494
494
  ref: t,
495
- icon: $s
495
+ icon: Vs
496
496
  }));
497
497
  });
498
- Sr.displayName = "CloseSingle";
499
- var Us = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, vr = Oe(function(e, t) {
500
- return je(qe, Object.assign({}, e, {
498
+ vr.displayName = "CloseSingle";
499
+ var Ws = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Cr = Ne(function(e, t) {
500
+ return Xe(Qe, Object.assign({}, e, {
501
501
  id: "delete-single",
502
502
  ref: t,
503
- icon: Us
503
+ icon: Ws
504
504
  }));
505
505
  });
506
- vr.displayName = "DeleteSingle";
507
- var Vs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, pr = Oe(function(e, t) {
508
- return je(qe, Object.assign({}, e, {
506
+ Cr.displayName = "DeleteSingle";
507
+ var Hs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, _r = Ne(function(e, t) {
508
+ return Xe(Qe, Object.assign({}, e, {
509
509
  id: "increase-single",
510
510
  ref: t,
511
- icon: Vs
511
+ icon: Hs
512
512
  }));
513
513
  });
514
- pr.displayName = "IncreaseSingle";
515
- var Ws = { 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" } }] }, Cr = Oe(function(e, t) {
516
- return je(qe, Object.assign({}, e, {
514
+ _r.displayName = "IncreaseSingle";
515
+ var Bs = { 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" } }] }, Rr = Ne(function(e, t) {
516
+ return Xe(Qe, Object.assign({}, e, {
517
517
  id: "more-single",
518
518
  ref: t,
519
- icon: Ws
519
+ icon: Bs
520
520
  }));
521
521
  });
522
- Cr.displayName = "MoreSingle";
523
- var Hs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.6185 12.4423C12.5907 12.2749 12.7773 12.15 12.9343 12.2308L15.4242 13.5126C15.6102 13.6084 15.5544 13.8745 15.3439 13.8955L14.2456 14.184L13.4521 15.1286C13.3495 15.2939 13.085 15.2463 13.0534 15.0568L12.6185 12.4423Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1 3.6C1 2.16406 2.16406 1 3.6 1H12.3C13.7359 1 14.9 2.16406 14.9 3.6V5.81156C14.9003 5.81881 14.9004 5.82609 14.9004 5.8334C14.9004 5.84071 14.9003 5.84799 14.9 5.85524V10.045C14.9003 10.0522 14.9004 10.0595 14.9004 10.0668C14.9004 10.3982 14.6318 10.6668 14.3004 10.6668H11.1668C10.8907 10.6668 10.6668 10.8907 10.6668 11.1668V14.3C10.6668 14.6314 10.3982 14.9 10.0668 14.9L10.05 14.8998L3.6 14.9C2.16406 14.9 1 13.7359 1 12.3V3.6ZM13.2 5.2334C13.4761 5.2334 13.7 5.00954 13.7 4.7334V3.6C13.7 2.8268 13.0732 2.2 12.3 2.2H11.1668C10.8907 2.2 10.6668 2.42386 10.6668 2.7V4.7334C10.6668 5.00954 10.8907 5.2334 11.1668 5.2334H13.2ZM10.6668 6.9334C10.6668 6.65726 10.8907 6.4334 11.1668 6.4334H13.2C13.4761 6.4334 13.7 6.65726 13.7 6.9334V8.9668C13.7 9.24294 13.4761 9.4668 13.2 9.4668H11.1668C10.8907 9.4668 10.6668 9.24294 10.6668 8.9668V6.9334ZM8.9668 5.2334C9.24294 5.2334 9.4668 5.00954 9.4668 4.7334V2.7C9.4668 2.42386 9.24294 2.2 8.9668 2.2H6.9334C6.65726 2.2 6.4334 2.42386 6.4334 2.7V4.7334C6.4334 5.00954 6.65726 5.2334 6.9334 5.2334L8.9668 5.2334ZM6.4334 6.9334C6.4334 6.65726 6.65726 6.4334 6.9334 6.4334L8.9668 6.4334C9.24294 6.4334 9.4668 6.65726 9.4668 6.9334V8.9668C9.4668 9.24294 9.24294 9.4668 8.9668 9.4668L6.9334 9.4668C6.65726 9.4668 6.4334 9.24294 6.4334 8.9668V6.9334ZM4.7334 5.2334C5.00954 5.2334 5.2334 5.00954 5.2334 4.7334V2.7C5.2334 2.42386 5.00954 2.2 4.7334 2.2H3.6C2.8268 2.2 2.2 2.8268 2.2 3.6V4.7334C2.2 5.00954 2.42386 5.2334 2.7 5.2334H4.7334ZM2.2 6.9334C2.2 6.65726 2.42386 6.4334 2.7 6.4334H4.7334C5.00954 6.4334 5.2334 6.65725 5.2334 6.9334V8.9668C5.2334 9.24294 5.00954 9.4668 4.7334 9.4668H2.7C2.42386 9.4668 2.2 9.24294 2.2 8.9668V6.9334ZM5.2334 11.1668C5.2334 10.8907 5.00954 10.6668 4.7334 10.6668H2.7C2.42386 10.6668 2.2 10.8907 2.2 11.1668V12.3C2.2 13.0732 2.8268 13.7 3.6 13.7H4.7334C5.00954 13.7 5.2334 13.4761 5.2334 13.2V11.1668ZM9.4668 11.1668C9.4668 10.8907 9.24294 10.6668 8.9668 10.6668H6.9334C6.65726 10.6668 6.4334 10.8907 6.4334 11.1668V13.2C6.4334 13.4761 6.65726 13.7 6.9334 13.7H8.9668C9.24294 13.7 9.4668 13.4761 9.4668 13.2V11.1668Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, _r = Oe(function(e, t) {
524
- return je(qe, Object.assign({}, e, {
522
+ Rr.displayName = "MoreSingle";
523
+ var js = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.6185 12.4423C12.5907 12.2749 12.7773 12.15 12.9343 12.2308L15.4242 13.5126C15.6102 13.6084 15.5544 13.8745 15.3439 13.8955L14.2456 14.184L13.4521 15.1286C13.3495 15.2939 13.085 15.2463 13.0534 15.0568L12.6185 12.4423Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1 3.6C1 2.16406 2.16406 1 3.6 1H12.3C13.7359 1 14.9 2.16406 14.9 3.6V5.81156C14.9003 5.81881 14.9004 5.82609 14.9004 5.8334C14.9004 5.84071 14.9003 5.84799 14.9 5.85524V10.045C14.9003 10.0522 14.9004 10.0595 14.9004 10.0668C14.9004 10.3982 14.6318 10.6668 14.3004 10.6668H11.1668C10.8907 10.6668 10.6668 10.8907 10.6668 11.1668V14.3C10.6668 14.6314 10.3982 14.9 10.0668 14.9L10.05 14.8998L3.6 14.9C2.16406 14.9 1 13.7359 1 12.3V3.6ZM13.2 5.2334C13.4761 5.2334 13.7 5.00954 13.7 4.7334V3.6C13.7 2.8268 13.0732 2.2 12.3 2.2H11.1668C10.8907 2.2 10.6668 2.42386 10.6668 2.7V4.7334C10.6668 5.00954 10.8907 5.2334 11.1668 5.2334H13.2ZM10.6668 6.9334C10.6668 6.65726 10.8907 6.4334 11.1668 6.4334H13.2C13.4761 6.4334 13.7 6.65726 13.7 6.9334V8.9668C13.7 9.24294 13.4761 9.4668 13.2 9.4668H11.1668C10.8907 9.4668 10.6668 9.24294 10.6668 8.9668V6.9334ZM8.9668 5.2334C9.24294 5.2334 9.4668 5.00954 9.4668 4.7334V2.7C9.4668 2.42386 9.24294 2.2 8.9668 2.2H6.9334C6.65726 2.2 6.4334 2.42386 6.4334 2.7V4.7334C6.4334 5.00954 6.65726 5.2334 6.9334 5.2334L8.9668 5.2334ZM6.4334 6.9334C6.4334 6.65726 6.65726 6.4334 6.9334 6.4334L8.9668 6.4334C9.24294 6.4334 9.4668 6.65726 9.4668 6.9334V8.9668C9.4668 9.24294 9.24294 9.4668 8.9668 9.4668L6.9334 9.4668C6.65726 9.4668 6.4334 9.24294 6.4334 8.9668V6.9334ZM4.7334 5.2334C5.00954 5.2334 5.2334 5.00954 5.2334 4.7334V2.7C5.2334 2.42386 5.00954 2.2 4.7334 2.2H3.6C2.8268 2.2 2.2 2.8268 2.2 3.6V4.7334C2.2 5.00954 2.42386 5.2334 2.7 5.2334H4.7334ZM2.2 6.9334C2.2 6.65726 2.42386 6.4334 2.7 6.4334H4.7334C5.00954 6.4334 5.2334 6.65725 5.2334 6.9334V8.9668C5.2334 9.24294 5.00954 9.4668 4.7334 9.4668H2.7C2.42386 9.4668 2.2 9.24294 2.2 8.9668V6.9334ZM5.2334 11.1668C5.2334 10.8907 5.00954 10.6668 4.7334 10.6668H2.7C2.42386 10.6668 2.2 10.8907 2.2 11.1668V12.3C2.2 13.0732 2.8268 13.7 3.6 13.7H4.7334C5.00954 13.7 5.2334 13.4761 5.2334 13.2V11.1668ZM9.4668 11.1668C9.4668 10.8907 9.24294 10.6668 8.9668 10.6668H6.9334C6.65726 10.6668 6.4334 10.8907 6.4334 11.1668V13.2C6.4334 13.4761 6.65726 13.7 6.9334 13.7H8.9668C9.24294 13.7 9.4668 13.4761 9.4668 13.2V11.1668Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Er = Ne(function(e, t) {
524
+ return Xe(Qe, Object.assign({}, e, {
525
525
  id: "select-range-single",
526
526
  ref: t,
527
- icon: Hs
527
+ icon: js
528
528
  }));
529
529
  });
530
- _r.displayName = "SelectRangeSingle";
531
- function Bs(e, t) {
530
+ Er.displayName = "SelectRangeSingle";
531
+ function qs(e, t) {
532
532
  return Object.keys(e).filter((n) => isNaN(Number(n)) && n !== "DefinedName").map((n) => ({
533
533
  label: t.t(`formula.functionType.${n.toLocaleLowerCase()}`),
534
534
  value: `${e[n]}`
535
535
  }));
536
536
  }
537
- function Rr(e) {
537
+ function br(e) {
538
538
  if (!e.require && !e.repeat)
539
539
  return `[${e.name}]`;
540
540
  if (e.require && !e.repeat)
@@ -544,8 +544,8 @@ function Rr(e) {
544
544
  if (e.require && e.repeat)
545
545
  return `${e.name},...`;
546
546
  }
547
- const js = (e, t = 100) => {
548
- P(() => {
547
+ const Ks = (e, t = 100) => {
548
+ $(() => {
549
549
  let n = null;
550
550
  const o = () => {
551
551
  n === null && (n = window.setTimeout(() => {
@@ -557,85 +557,85 @@ const js = (e, t = 100) => {
557
557
  };
558
558
  }, [e, t]);
559
559
  };
560
- function br(e, t, n) {
561
- const o = T(Be), r = oe(() => new Zn({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = T(rn), c = T(ee), i = Q(() => {
560
+ function Ir(e, t, n) {
561
+ const o = T(qe), r = oe(() => new tr({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = T(hn), c = T(ee), i = J(() => {
562
562
  var _;
563
- const a = o.getEditor(e);
564
- if (!a)
563
+ const l = o.getEditor(e);
564
+ if (!l)
565
565
  return;
566
- const f = a.getBoundingClientRect(), { marginTop: h = 0, marginBottom: m = 0 } = a.getDocumentData().documentStyle, u = a.getSkeleton();
566
+ const f = l.getBoundingClientRect(), { marginTop: h = 0, marginBottom: m = 0 } = l.getDocumentData().documentStyle, u = l.getSkeleton();
567
567
  if (!u) return;
568
568
  const d = (_ = u.getSkeletonData()) == null ? void 0 : _.pages[0].height;
569
- let { left: l, top: v, right: g, bottom: S } = f;
570
- v = v + h, S = d ? v + d : S - m;
571
- const p = r.getValue();
572
- if (!(p.left === l && p.top === v && p.right === g && p.bottom === S))
573
- return r.next({ left: l - 1, right: g + 1, top: v - 1, bottom: S + 1 }), f;
569
+ let { left: a, top: S, right: g, bottom: p } = f;
570
+ S = S + h, p = d ? S + d : p - m;
571
+ const v = r.getValue();
572
+ if (!(v.left === a && v.top === S && v.right === g && v.bottom === p))
573
+ return r.next({ left: a - 1, right: g + 1, top: S - 1, bottom: p + 1 }), f;
574
574
  });
575
- return P(() => {
575
+ return $(() => {
576
576
  t && i();
577
- }, [e, o, c.unitAdded$, i, t, ...n != null ? n : []]), js(i), P(() => {
578
- const a = s.scrollEvent$.pipe(Lo(100)).subscribe(i);
577
+ }, [e, o, c.unitAdded$, i, t, ...n != null ? n : []]), Ks(i), $(() => {
578
+ const l = s.scrollEvent$.pipe(Uo(100)).subscribe(i);
579
579
  return () => {
580
- a.unsubscribe();
580
+ l.unsubscribe();
581
581
  };
582
582
  }, []), [r, i];
583
583
  }
584
- const Ke = (e) => {
585
- const t = Y(e);
584
+ const Je = (e) => {
585
+ const t = G(e);
586
586
  return t.current = e, t;
587
- }, qs = (e, t, n) => {
588
- const o = T(Ft), r = T(Ce), [s, c] = U(), [i, a] = U(-1), [f, h] = U(!0), m = Ke(f), u = Y(t);
587
+ }, Ys = (e, t, n) => {
588
+ const o = T(Ht), r = T(_e), [s, c] = V(), [i, l] = V(-1), [f, h] = V(!0), m = Je(f), u = G(t);
589
589
  u.current = t;
590
590
  const d = () => {
591
- c(void 0), a(-1), h(!1);
591
+ c(void 0), l(-1), h(!1);
592
592
  };
593
- return P(() => {
593
+ return $(() => {
594
594
  if (n && e) {
595
- const l = n.selectionChange$.pipe(Jt(50)).subscribe((g) => {
595
+ const a = n.selectionChange$.pipe(an(50)).subscribe((g) => {
596
596
  if (g.textRanges.length === 1) {
597
- const [S] = g.textRanges;
598
- if (S.collapsed && m.current) {
599
- const p = r.getFunctionAndParameter(`${u.current}A`, S.startOffset - 1);
600
- if (p) {
601
- const { functionName: _, paramIndex: R } = p, C = o.getFunctionInfo(_);
602
- c(C), a(R);
597
+ const [p] = g.textRanges;
598
+ if (p.collapsed && m.current) {
599
+ const v = r.getFunctionAndParameter(`${u.current}A`, p.startOffset - 1);
600
+ if (v) {
601
+ const { functionName: _, paramIndex: R } = v, C = o.getFunctionInfo(_);
602
+ c(C), l(R);
603
603
  return;
604
604
  }
605
605
  }
606
606
  }
607
- c(void 0), a(-1);
608
- }), v = n.selectionChange$.pipe(
609
- jt((g) => g.isEditing),
610
- jt((g) => g.textRanges.length === 1),
611
- Xn((g) => g.textRanges[0].startOffset),
612
- Po()
607
+ c(void 0), l(-1);
608
+ }), S = n.selectionChange$.pipe(
609
+ Qt((g) => g.isEditing),
610
+ Qt((g) => g.textRanges.length === 1),
611
+ nr((g) => g.textRanges[0].startOffset),
612
+ Vo()
613
613
  ).subscribe(() => {
614
614
  h(!0);
615
615
  });
616
616
  return () => {
617
- l.unsubscribe(), v.unsubscribe();
617
+ a.unsubscribe(), S.unsubscribe();
618
618
  };
619
619
  }
620
- }, [n, e]), P(() => {
620
+ }, [n, e]), $(() => {
621
621
  e || d();
622
622
  }, [e]), {
623
623
  functionInfo: s,
624
624
  paramIndex: i,
625
625
  reset: d
626
626
  };
627
- }, Ks = ({ onClick: e }) => /* @__PURE__ */ O(
627
+ }, Gs = ({ onClick: e }) => /* @__PURE__ */ O(
628
628
  "div",
629
629
  {
630
630
  className: "univer-z-[15] univer-box-border univer-h-[18px] univer-cursor-pointer univer-overflow-visible univer-whitespace-nowrap univer-rounded-l univer-border univer-border-r-0 univer-border-gray-600 univer-bg-primary-600 univer-p-0.5 univer-text-xs univer-font-bold univer-leading-[13px] univer-text-white",
631
631
  onClick: e,
632
632
  children: "?"
633
633
  }
634
- ), Wt = ({ className: e, title: t, value: n }) => /* @__PURE__ */ V("div", { className: "univer-my-2", children: [
634
+ ), zt = ({ className: e, title: t, value: n }) => /* @__PURE__ */ W("div", { className: "univer-my-2", children: [
635
635
  /* @__PURE__ */ O(
636
636
  "div",
637
637
  {
638
- className: pe("univer-mb-2 univer-text-sm univer-font-medium univer-text-gray-900 dark:univer-text-white", e),
638
+ className: fe("univer-mb-2 univer-text-sm univer-font-medium univer-text-gray-900 dark:!univer-text-white", e),
639
639
  children: t
640
640
  }
641
641
  ),
@@ -646,50 +646,50 @@ const Ke = (e) => {
646
646
  children: n
647
647
  }
648
648
  )
649
- ] }), Ys = (e) => {
649
+ ] }), zs = (e) => {
650
650
  const { prefix: t, value: n, active: o, onClick: r } = e;
651
- return /* @__PURE__ */ V("div", { children: [
652
- /* @__PURE__ */ V("span", { children: [
651
+ return /* @__PURE__ */ W("div", { children: [
652
+ /* @__PURE__ */ W("span", { children: [
653
653
  t,
654
654
  "("
655
655
  ] }),
656
- n && n.map((s, c) => /* @__PURE__ */ V("span", { children: [
656
+ n && n.map((s, c) => /* @__PURE__ */ W("span", { children: [
657
657
  /* @__PURE__ */ O(
658
658
  "span",
659
659
  {
660
660
  className: o === c ? "univer-text-primary-500" : "",
661
661
  onClick: () => r(c),
662
- children: Rr(s)
662
+ children: br(s)
663
663
  }
664
664
  ),
665
665
  c === n.length - 1 ? "" : ","
666
666
  ] }, s.name)),
667
667
  ")"
668
668
  ] });
669
- }, Fn = () => {
669
+ }, Vn = () => {
670
670
  };
671
- function Gs(e) {
672
- const { onParamsSwitch: t = Fn, onClose: n = Fn, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: c, paramIndex: i, reset: a } = qs(o, s, r), f = oe(() => !!c && i >= 0, [c, i]), h = T(Qt), m = !ve(h.helpFunctionVisible$), [u, d] = U(!0), l = T(tt), v = l.t("formula.prompt.required"), g = l.t("formula.prompt.optional"), S = r.getEditorId(), [p] = br(S, f, [c, i]);
671
+ function Zs(e) {
672
+ const { onParamsSwitch: t = Vn, onClose: n = Vn, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: c, paramIndex: i, reset: l } = Ys(o, s, r), f = oe(() => !!c && i >= 0, [c, i]), h = T(cn), m = !Ce(h.helpFunctionVisible$), [u, d] = V(!0), a = T(at), S = a.t("formula.prompt.required"), g = a.t("formula.prompt.optional"), p = r.getEditorId(), [v] = Ir(p, f, [c, i]);
673
673
  function _(y) {
674
674
  t && t(y);
675
675
  }
676
- const R = Q((y) => {
676
+ const R = J((y) => {
677
677
  h.helpFunctionVisible$.next(!y);
678
678
  }), C = () => {
679
679
  R(!0), n();
680
680
  };
681
- return f && c ? m ? /* @__PURE__ */ O(qt, { portal: !0, anchorRect$: p, direction: "left-center", children: /* @__PURE__ */ O(Ks, { onClick: () => R(!1) }) }, "hidden") : /* @__PURE__ */ O(qt, { portal: !0, onClickOutside: () => a(), anchorRect$: p, direction: "vertical", children: /* @__PURE__ */ V(
681
+ return f && c ? m ? /* @__PURE__ */ O(Jt, { portal: !0, anchorRect$: v, direction: "left-center", children: /* @__PURE__ */ O(Gs, { onClick: () => R(!1) }) }, "hidden") : /* @__PURE__ */ O(Jt, { portal: !0, onClickOutside: () => l(), anchorRect$: v, direction: "vertical", children: /* @__PURE__ */ W(
682
682
  "div",
683
683
  {
684
- className: pe("univer-m-0 univer-box-border univer-w-[250px] univer-select-none univer-list-none univer-rounded-lg univer-bg-white univer-leading-5 univer-shadow-md univer-outline-none", sn),
684
+ className: fe("univer-m-0 univer-box-border univer-w-[250px] univer-select-none univer-list-none univer-rounded-lg univer-bg-white univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900", fn),
685
685
  children: [
686
- /* @__PURE__ */ V(
686
+ /* @__PURE__ */ W(
687
687
  "div",
688
688
  {
689
- className: pe("univer-box-border univer-flex univer-items-center univer-justify-between univer-px-4 univer-py-3 univer-text-xs univer-font-medium univer-text-gray-900 univer-wrap-anywhere dark:univer-text-white", gs),
689
+ className: fe("univer-box-border univer-flex univer-items-center univer-justify-between univer-px-4 univer-py-3 univer-text-xs univer-font-medium univer-text-gray-900 univer-wrap-anywhere dark:!univer-text-white", ps),
690
690
  children: [
691
691
  /* @__PURE__ */ O(
692
- Ys,
692
+ zs,
693
693
  {
694
694
  prefix: c.functionName,
695
695
  value: c.functionParameter,
@@ -697,22 +697,22 @@ function Gs(e) {
697
697
  onClick: _
698
698
  }
699
699
  ),
700
- /* @__PURE__ */ V("div", { className: "univer-flex", children: [
700
+ /* @__PURE__ */ W("div", { className: "univer-flex", children: [
701
701
  /* @__PURE__ */ O(
702
702
  "div",
703
703
  {
704
704
  className: "univer-ml-2 univer-flex univer-h-6 univer-w-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-bg-transparent univer-p-0 univer-text-xs univer-text-gray-500 univer-outline-none univer-transition-colors hover:univer-bg-gray-200",
705
705
  style: { transform: u ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
706
706
  onClick: () => d(!u),
707
- children: /* @__PURE__ */ O(Cr, {})
707
+ children: /* @__PURE__ */ O(Rr, {})
708
708
  }
709
709
  ),
710
710
  /* @__PURE__ */ O(
711
711
  "div",
712
712
  {
713
- className: "univer-ml-2 univer-flex univer-h-6 univer-w-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-bg-transparent univer-p-0 univer-text-xs univer-text-gray-600 univer-outline-none univer-transition-colors dark:univer-text-gray-200 hover:univer-bg-gray-300",
713
+ className: "univer-ml-2 univer-flex univer-h-6 univer-w-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-bg-transparent univer-p-0 univer-text-xs univer-text-gray-600 univer-outline-none univer-transition-colors dark:!univer-text-gray-200 hover:univer-bg-gray-300",
714
714
  onClick: C,
715
- children: /* @__PURE__ */ O(Sr, {})
715
+ children: /* @__PURE__ */ O(vr, {})
716
716
  }
717
717
  )
718
718
  ] })
@@ -727,27 +727,27 @@ function Gs(e) {
727
727
  height: u ? "unset" : 0,
728
728
  padding: u ? "revert-layer" : 0
729
729
  },
730
- children: /* @__PURE__ */ V("div", { className: "univer-mt-3", children: [
730
+ children: /* @__PURE__ */ W("div", { className: "univer-mt-3", children: [
731
731
  /* @__PURE__ */ O(
732
- Wt,
732
+ zt,
733
733
  {
734
- title: l.t("formula.prompt.helpExample"),
734
+ title: a.t("formula.prompt.helpExample"),
735
735
  value: `${c.functionName}(${c.functionParameter.map((y) => y.example).join(",")})`
736
736
  }
737
737
  ),
738
738
  /* @__PURE__ */ O(
739
- Wt,
739
+ zt,
740
740
  {
741
- title: l.t("formula.prompt.helpAbstract"),
741
+ title: a.t("formula.prompt.helpAbstract"),
742
742
  value: c.description
743
743
  }
744
744
  ),
745
745
  c && c.functionParameter && c.functionParameter.map((y, N) => /* @__PURE__ */ O(
746
- Wt,
746
+ zt,
747
747
  {
748
748
  className: i === N ? "univer-text-primary-500" : "",
749
749
  title: y.name,
750
- value: `${y.require ? v : g} ${y.detail}`
750
+ value: `${y.require ? S : g} ${y.detail}`
751
751
  },
752
752
  N
753
753
  ))
@@ -758,30 +758,30 @@ function Gs(e) {
758
758
  }
759
759
  ) }, "show") : null;
760
760
  }
761
- const zs = (e) => {
762
- const t = T(Be);
763
- return Q((o) => {
761
+ const Xs = (e) => {
762
+ const t = T(qe);
763
+ return J((o) => {
764
764
  var r, s;
765
765
  if (e) {
766
766
  t.focus(e.getEditorId());
767
767
  const c = [...e.getSelectionRanges()];
768
- if (Je.isDefine(o))
768
+ if (it.isDefine(o))
769
769
  e.setSelectionRanges([{ startOffset: o, endOffset: o }]);
770
770
  else if (!c.length && !e.docSelectionRenderService.isOnPointerEvent) {
771
771
  const i = (s = (r = e.getDocumentData().body) == null ? void 0 : r.dataStream) != null ? s : `\r
772
- `, a = Math.max(i.length - 2, 0);
773
- e.setSelectionRanges([{ startOffset: a, endOffset: a }]);
772
+ `, l = Math.max(i.length - 2, 0);
773
+ e.setSelectionRanges([{ startOffset: l, endOffset: l }]);
774
774
  } else
775
775
  e.setSelectionRanges(c);
776
776
  }
777
777
  });
778
778
  };
779
- var Zs = Object.getOwnPropertyDescriptor, Xs = (e, t, n, o) => {
780
- for (var r = o > 1 ? void 0 : o ? Zs(t, n) : t, s = e.length - 1, c; s >= 0; s--)
779
+ var Qs = Object.getOwnPropertyDescriptor, Js = (e, t, n, o) => {
780
+ for (var r = o > 1 ? void 0 : o ? Qs(t, n) : t, s = e.length - 1, c; s >= 0; s--)
781
781
  (c = e[s]) && (r = c(r) || r);
782
782
  return r;
783
- }, Ze = (e, t) => (n, o) => t(n, o, e);
784
- let Fe = class extends co {
783
+ }, rt = (e, t) => (n, o) => t(n, o, e);
784
+ let De = class extends lo {
785
785
  constructor(t, n, o, r, s, c, i) {
786
786
  super(
787
787
  n,
@@ -792,7 +792,7 @@ let Fe = class extends co {
792
792
  );
793
793
  j(this, "_workbookSelections");
794
794
  j(this, "_eventDisposables");
795
- this._context = t, this._contextService = c, this._refSelectionsService = i, this._workbookSelections = this._refSelectionsService.getWorkbookSelections(this._context.unitId), this._initSelectionChangeListener(), this._initSkeletonChangeListener(), this._initUserActionSyncListener(), this._setSelectionStyle(Qs(this._themeService)), this._remainLastEnabled = !0, this._highlightHeader = !1;
795
+ this._context = t, this._contextService = c, this._refSelectionsService = i, this._workbookSelections = this._refSelectionsService.getWorkbookSelections(this._context.unitId), this._initSelectionChangeListener(), this._initSkeletonChangeListener(), this._initUserActionSyncListener(), this._setSelectionStyle(ei(this._themeService)), this._remainLastEnabled = !0, this._highlightHeader = !1;
796
796
  }
797
797
  getLocation() {
798
798
  return this._skeleton.getLocation();
@@ -816,7 +816,7 @@ let Fe = class extends co {
816
816
  * Call this method and user will be able to select on the canvas to update selections.
817
817
  */
818
818
  enableSelectionChanging() {
819
- return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), Bn(() => this._disableSelectionChanging());
819
+ return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), zn(() => this._disableSelectionChanging());
820
820
  }
821
821
  _disableSelectionChanging() {
822
822
  var t;
@@ -826,27 +826,27 @@ let Fe = class extends co {
826
826
  this._disableSelectionChanging();
827
827
  }
828
828
  _initCanvasEventListeners() {
829
- const t = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = t, { scene: c } = this._context, i = new We();
830
- return i.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((a, f) => {
831
- this.inRefSelectionMode() && (this._onPointerDown(a, r.zIndex + 1, me.NORMAL, this._getActiveViewport(a)), a.button !== 2 && f.stopPropagation());
829
+ const t = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = t, { scene: c } = this._context, i = new He();
830
+ return i.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((l, f) => {
831
+ this.inRefSelectionMode() && (this._onPointerDown(l, r.zIndex + 1, Se.NORMAL, this._getActiveViewport(l)), l.button !== 2 && f.stopPropagation());
832
832
  })), i.add(
833
- n == null ? void 0 : n.onPointerDown$.subscribeEvent((a, f) => {
833
+ n == null ? void 0 : n.onPointerDown$.subscribeEvent((l, f) => {
834
834
  if (!this.inRefSelectionMode()) return;
835
- const h = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: m } = Cn(a.offsetX, a.offsetY, c, h);
836
- _n(this._workbookSelections.getCurrentSelections(), m, me.ROW) || (this._onPointerDown(a, (r.zIndex || 1) + 1, me.ROW, this._getActiveViewport(a), Ut.Y), a.button !== 2 && f.stopPropagation());
835
+ const h = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: m } = In(l.offsetX, l.offsetY, c, h);
836
+ yn(this._workbookSelections.getCurrentSelections(), m, Se.ROW) || (this._onPointerDown(l, (r.zIndex || 1) + 1, Se.ROW, this._getActiveViewport(l), Yt.Y), l.button !== 2 && f.stopPropagation());
837
837
  })
838
- ), i.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((a, f) => {
838
+ ), i.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((l, f) => {
839
839
  if (!this.inRefSelectionMode()) return;
840
- const h = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: m } = Cn(a.offsetX, a.offsetY, c, h);
841
- _n(this._workbookSelections.getCurrentSelections(), m, me.COLUMN) || (this._onPointerDown(a, (r.zIndex || 1) + 1, me.COLUMN, this._getActiveViewport(a), Ut.X), a.button !== 2 && f.stopPropagation());
842
- })), i.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((a, f) => {
840
+ const h = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: m } = In(l.offsetX, l.offsetY, c, h);
841
+ yn(this._workbookSelections.getCurrentSelections(), m, Se.COLUMN) || (this._onPointerDown(l, (r.zIndex || 1) + 1, Se.COLUMN, this._getActiveViewport(l), Yt.X), l.button !== 2 && f.stopPropagation());
842
+ })), i.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((l, f) => {
843
843
  if (this._reset(), !this.inRefSelectionMode()) return;
844
- const h = this._sheetSkeletonManagerService.getCurrent().skeleton, m = lo(h);
844
+ const h = this._sheetSkeletonManagerService.getCurrent().skeleton, m = uo(h);
845
845
  this._addSelectionControlByModelData(m), this._selectionMoveStart$.next(this.getSelectionDataWithStyle());
846
846
  const u = c.onPointerUp$.subscribeEvent(() => {
847
847
  u.unsubscribe(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle());
848
848
  });
849
- a.button !== 2 && f.stopPropagation();
849
+ l.button !== 2 && f.stopPropagation();
850
850
  })), i;
851
851
  }
852
852
  /**
@@ -856,7 +856,7 @@ let Fe = class extends co {
856
856
  */
857
857
  _addSelectionControlByModelData(t) {
858
858
  var c;
859
- const n = this._skeleton, o = (c = t.style) != null ? c : qn(this._themeService), r = this._scene;
859
+ const n = this._skeleton, o = (c = t.style) != null ? c : Xn(this._themeService), r = this._scene;
860
860
  return t.style = o, this.newSelectionControl(r, n, t);
861
861
  }
862
862
  _initSelectionChangeListener() {
@@ -869,18 +869,18 @@ let Fe = class extends co {
869
869
  */
870
870
  _initUserActionSyncListener() {
871
871
  this.disposeWithMe(this.selectionMoveStart$.subscribe((t) => {
872
- this._updateSelections(t, Vt.MOVE_START);
872
+ this._updateSelections(t, Gt.MOVE_START);
873
873
  })), this.disposeWithMe(this.selectionMoving$.subscribe((t) => {
874
- this._updateSelections(t, Vt.MOVING);
874
+ this._updateSelections(t, Gt.MOVING);
875
875
  })), this.disposeWithMe(this.selectionMoveEnd$.subscribe((t) => {
876
- this._updateSelections(t, Vt.MOVE_END);
876
+ this._updateSelections(t, Gt.MOVE_END);
877
877
  }));
878
878
  }
879
879
  _updateSelections(t, n) {
880
880
  const r = this._context.unit.getActiveSheet().getSheetId();
881
881
  t.length !== 0 && this._workbookSelections.setSelections(
882
882
  r,
883
- t.map((s) => zo(s)),
883
+ t.map((s) => Qo(s)),
884
884
  n
885
885
  );
886
886
  }
@@ -888,7 +888,7 @@ let Fe = class extends co {
888
888
  this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((t) => {
889
889
  if (!t)
890
890
  return;
891
- const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(xn.VIEW_MAIN);
891
+ const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(An.VIEW_MAIN);
892
892
  this._skeleton && this._skeleton.worksheet.getSheetId() !== n.worksheet.getSheetId() && this._reset(), this._changeRuntime(n, o, r);
893
893
  const s = this._workbookSelections.getCurrentSelections();
894
894
  this.resetSelectionsByModelData(s);
@@ -896,10 +896,10 @@ let Fe = class extends co {
896
896
  }
897
897
  _getActiveViewport(t) {
898
898
  const n = this._getSheetObject();
899
- return n == null ? void 0 : n.scene.getActiveViewportByCoord(On.FromArray([t.offsetX, t.offsetY]));
899
+ return n == null ? void 0 : n.scene.getActiveViewportByCoord(kn.FromArray([t.offsetX, t.offsetY]));
900
900
  }
901
901
  _getSheetObject() {
902
- return ao(this._context.unit, this._context);
902
+ return ho(this._context.unit, this._context);
903
903
  }
904
904
  /**
905
905
  * Handle pointer down event, bind pointermove & pointerup handler.
@@ -912,40 +912,40 @@ let Fe = class extends co {
912
912
  * @param scrollTimerType
913
913
  */
914
914
  // eslint-disable-next-line complexity, max-lines-per-function
915
- _onPointerDown(t, n = 0, o = me.NORMAL, r, s = Ut.ALL) {
915
+ _onPointerDown(t, n = 0, o = Se.NORMAL, r, s = Yt.ALL) {
916
916
  var x;
917
917
  this._rangeType = o;
918
918
  const c = this._skeleton, i = this._scene;
919
919
  if (!i || !c)
920
920
  return;
921
921
  r && (this._activeViewport = r);
922
- const { offsetX: a, offsetY: f } = t, h = i.getViewport(xn.VIEW_MAIN);
922
+ const { offsetX: l, offsetY: f } = t, h = i.getViewport(An.VIEW_MAIN);
923
923
  if (!h) return;
924
- const m = i.getCoordRelativeToViewport(On.FromArray([a, f])), { x: u, y: d } = m;
924
+ const m = i.getCoordRelativeToViewport(kn.FromArray([l, f])), { x: u, y: d } = m;
925
925
  this._startViewportPosX = u, this._startViewportPosY = d;
926
- const l = i.getScrollXYInfoByViewport(m), { scaleX: v, scaleY: g } = i.getAncestorScale(), S = this._skeleton.getCellByOffset(u, d, v, g, l);
927
- if (!S) return;
926
+ const a = i.getScrollXYInfoByViewport(m), { scaleX: S, scaleY: g } = i.getAncestorScale(), p = this._skeleton.getCellByOffset(u, d, S, g, a);
927
+ if (!p) return;
928
928
  switch (o) {
929
- case me.NORMAL:
929
+ case Se.NORMAL:
930
930
  break;
931
- case me.ROW:
932
- S.startColumn = 0, S.endColumn = this._skeleton.getColumnCount() - 1;
931
+ case Se.ROW:
932
+ p.startColumn = 0, p.endColumn = this._skeleton.getColumnCount() - 1;
933
933
  break;
934
- case me.COLUMN:
935
- S.startRow = 0, S.endRow = this._skeleton.getRowCount() - 1;
934
+ case Se.COLUMN:
935
+ p.startRow = 0, p.endRow = this._skeleton.getRowCount() - 1;
936
936
  break;
937
- case me.ALL:
938
- S.startRow = 0, S.startColumn = 0, S.endRow = this._skeleton.getRowCount() - 1, S.endColumn = this._skeleton.getColumnCount() - 1;
937
+ case Se.ALL:
938
+ p.startRow = 0, p.startColumn = 0, p.endRow = this._skeleton.getRowCount() - 1, p.endColumn = this._skeleton.getColumnCount() - 1;
939
939
  }
940
- const p = { range: S, primary: S, style: null };
941
- p.range.rangeType = o;
942
- const _ = Bt(p, this._skeleton);
940
+ const v = { range: p, primary: p, style: null };
941
+ v.range.rangeType = o;
942
+ const _ = Xt(v, this._skeleton);
943
943
  this._startRangeWhenPointerDown = { ..._.rangeWithCoord };
944
944
  const R = { ..._.rangeWithCoord, rangeType: o };
945
945
  let C = this.getActiveSelectionControl();
946
946
  const y = this.getSelectionControls();
947
947
  for (const w of y) {
948
- if (t.button === 2 && Vn.contains(w.model, R)) {
948
+ if (t.button === 2 && Kn.contains(w.model, R)) {
949
949
  C = w;
950
950
  return;
951
951
  }
@@ -963,7 +963,7 @@ let Fe = class extends co {
963
963
  o,
964
964
  C
965
965
  // Get updated in this method
966
- ) : F && C ? C.updateRangeBySelectionWithCoord(_) : C = this.newSelectionControl(i, c, p);
966
+ ) : F && C ? C.updateRangeBySelectionWithCoord(_) : C = this.newSelectionControl(i, c, v);
967
967
  for (let w = 0; w < this.getSelectionControls().length - 1; w++)
968
968
  this.getSelectionControls()[w].clearHighlight();
969
969
  this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), i.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (x = i.getTransformer()) == null || x.clearSelectedObjects(), this._setupPointerMoveListener(h, C, o, s, u, d), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._scenePointerUpSub = i.onPointerUp$.subscribeEvent(() => {
@@ -979,13 +979,13 @@ let Fe = class extends co {
979
979
  * @returns {SelectionControl} selectionControl just created
980
980
  */
981
981
  newSelectionControl(t, n, o) {
982
- const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: c } = n, i = new Kn(t, r, this._themeService, {
982
+ const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: c } = n, i = new Qn(t, r, this._themeService, {
983
983
  highlightHeader: this._highlightHeader,
984
984
  enableAutoFill: !1,
985
985
  rowHeaderWidth: s,
986
986
  columnHeaderHeight: c
987
- }), a = Bt(o, n);
988
- return i.updateRangeBySelectionWithCoord(a), this._selectionControls.push(i), i.setControlExtension({
987
+ }), l = Xt(o, n);
988
+ return i.updateRangeBySelectionWithCoord(l), this._selectionControls.push(i), i.setControlExtension({
989
989
  skeleton: n,
990
990
  scene: t,
991
991
  themeService: this._themeService,
@@ -998,48 +998,48 @@ let Fe = class extends co {
998
998
  }), i;
999
999
  }
1000
1000
  };
1001
- Fe = Xs([
1002
- Ze(1, B(dt)),
1003
- Ze(2, B(ht)),
1004
- Ze(3, Dt),
1005
- Ze(4, B(At)),
1006
- Ze(5, zt),
1007
- Ze(6, kt)
1008
- ], Fe);
1009
- function Qs(e) {
1010
- const t = qn(e);
1001
+ De = Js([
1002
+ rt(1, B(Ct)),
1003
+ rt(2, B(_t)),
1004
+ rt(3, Bt),
1005
+ rt(4, B(Vt)),
1006
+ rt(5, rn),
1007
+ rt(6, Wt)
1008
+ ], De);
1009
+ function ei(e) {
1010
+ const t = Xn(e);
1011
1011
  return t.widgets = { tl: !0, tc: !0, tr: !0, ml: !0, mr: !0, bl: !0, bc: !0, br: !0 }, t;
1012
1012
  }
1013
- function Js(e) {
1013
+ function ti(e) {
1014
1014
  var r, s;
1015
1015
  const n = e.get(ee).getCurrentUniverDocInstance();
1016
1016
  return n != null && n.getBody() ? { dataStream: (s = (r = n.getBody()) == null ? void 0 : r.dataStream) != null ? s : "", offset: 0 } : void 0;
1017
1017
  }
1018
- var Ae = /* @__PURE__ */ ((e) => (e[e.NOT_SELECT = 0] = "NOT_SELECT", e[e.NEED_ADD = 1] = "NEED_ADD", e[e.CAN_EDIT = 2] = "CAN_EDIT", e[e.EDIT_OTHER_SHEET_REFERENCE = 3] = "EDIT_OTHER_SHEET_REFERENCE", e))(Ae || {});
1019
- function ei(e) {
1018
+ var ke = /* @__PURE__ */ ((e) => (e[e.NOT_SELECT = 0] = "NOT_SELECT", e[e.NEED_ADD = 1] = "NEED_ADD", e[e.CAN_EDIT = 2] = "CAN_EDIT", e[e.EDIT_OTHER_SHEET_REFERENCE = 3] = "EDIT_OTHER_SHEET_REFERENCE", e))(ke || {});
1019
+ function ni(e) {
1020
1020
  var N;
1021
- const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, c = T(xe), i = T(ee), a = c.getRenderById(r), f = c.getRenderById(t), h = f == null ? void 0 : f.with(Qn), m = T(ar), u = T(dt), [d, l] = U(
1021
+ const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, c = T(Oe), i = T(ee), l = c.getRenderById(r), f = c.getRenderById(t), h = f == null ? void 0 : f.with(rr), m = T(ur), u = T(Ct), [d, a] = V(
1022
1022
  0
1023
1023
  /* NOT_SELECT */
1024
- ), v = T(Ce), g = Y(!0), S = a == null ? void 0 : a.with(Fe), p = Ke(d), _ = i.getUnit(r, J.UNIVER_SHEET), R = _ == null ? void 0 : _.getSheetBySheetId(s), C = Q((k) => {
1025
- S && S.setSkipLastEnabled(
1024
+ ), S = T(_e), g = G(!0), p = l == null ? void 0 : l.with(De), v = Je(d), _ = i.getUnit(r, q.UNIVER_SHEET), R = _ == null ? void 0 : _.getSheetBySheetId(s), C = J((k) => {
1025
+ p && p.setSkipLastEnabled(
1026
1026
  k === 1 || k === 3
1027
1027
  /* EDIT_OTHER_SHEET_REFERENCE */
1028
- ), p.current = k, l(k);
1029
- }), y = Q(() => {
1028
+ ), v.current = k, a(k);
1029
+ }), y = J(() => {
1030
1030
  var H, se;
1031
1031
  if (!_) return;
1032
- const k = _.getActiveSheet(), F = h == null ? void 0 : h.getActiveTextRange(), x = F != null && F.collapsed ? F.startOffset : -1, w = Js(u);
1032
+ const k = _.getActiveSheet(), F = h == null ? void 0 : h.getActiveTextRange(), x = F != null && F.collapsed ? F.startOffset : -1, w = ti(u);
1033
1033
  if (!w) return;
1034
- const M = (H = w == null ? void 0 : w.dataStream) == null ? void 0 : H.slice(0, -2), E = ((se = v.sequenceNodesBuilder(M)) != null ? se : []).map((q) => typeof q == "object" ? q.nodeType === z.REFERENCE ? {
1035
- ...q,
1036
- range: yo(q.token)
1034
+ const M = (H = w == null ? void 0 : w.dataStream) == null ? void 0 : H.slice(0, -2), b = ((se = S.sequenceNodesBuilder(M)) != null ? se : []).map((K) => typeof K == "object" ? K.nodeType === Z.REFERENCE ? {
1035
+ ...K,
1036
+ range: Oo(K.token)
1037
1037
  } : {
1038
- ...q,
1038
+ ...K,
1039
1039
  range: void 0
1040
- } : q), b = M[x - 1], I = M[x], A = E.find((q) => typeof q == "object" && q.nodeType === z.REFERENCE && x === q.endIndex + 2), D = b && To(b) && (!I || xo(I) && I !== et.OPEN_BRACKET), $ = !!A;
1041
- if ((M == null ? void 0 : M.substring(0, 1)) === "=" && (D || $))
1042
- if ($) {
1040
+ } : K), E = M[x - 1], I = M[x], A = b.find((K) => typeof K == "object" && K.nodeType === Z.REFERENCE && x === K.endIndex + 2), L = E && No(E) && (!I || Mo(I) && I !== ct.OPEN_BRACKET), U = !!A;
1041
+ if ((M == null ? void 0 : M.substring(0, 1)) === "=" && (L || U))
1042
+ if (U) {
1043
1043
  if (g.current)
1044
1044
  return;
1045
1045
  !A.range.sheetName && k.getSheetId() === (R == null ? void 0 : R.getSheetId()) || A.range.sheetName === k.getName() ? C(
@@ -1060,17 +1060,17 @@ function ei(e) {
1060
1060
  /* NOT_SELECT */
1061
1061
  );
1062
1062
  });
1063
- return P(() => {
1064
- const k = m.textSelection$.pipe(jt((F) => F.unitId === t)).subscribe(() => {
1063
+ return $(() => {
1064
+ const k = m.textSelection$.pipe(Qt((F) => F.unitId === t)).subscribe(() => {
1065
1065
  y();
1066
1066
  });
1067
1067
  return () => k.unsubscribe();
1068
- }, [y, m.textSelection$, t]), P(() => {
1068
+ }, [y, m.textSelection$, t]), $(() => {
1069
1069
  n || (C(
1070
1070
  0
1071
1071
  /* NOT_SELECT */
1072
1072
  ), g.current = !0);
1073
- }, [n, C]), P(() => {
1073
+ }, [n, C]), $(() => {
1074
1074
  var F;
1075
1075
  if (!o) return;
1076
1076
  const k = (F = f == null ? void 0 : f.mainComponent) == null ? void 0 : F.onPointerDown$.subscribeEvent(() => {
@@ -1080,20 +1080,20 @@ function ei(e) {
1080
1080
  ), g.current = !0;
1081
1081
  });
1082
1082
  return () => k == null ? void 0 : k.unsubscribe();
1083
- }, [o, (N = f == null ? void 0 : f.mainComponent) == null ? void 0 : N.onPointerDown$, C]), P(() => {
1083
+ }, [o, (N = f == null ? void 0 : f.mainComponent) == null ? void 0 : N.onPointerDown$, C]), $(() => {
1084
1084
  if (!n) return;
1085
1085
  const k = _ == null ? void 0 : _.activeSheet$.subscribe(() => {
1086
1086
  y();
1087
1087
  });
1088
1088
  return () => k == null ? void 0 : k.unsubscribe();
1089
- }, [y, n, _ == null ? void 0 : _.activeSheet$]), { isSelecting: d, isSelectingRef: p };
1089
+ }, [y, n, _ == null ? void 0 : _.activeSheet$]), { isSelecting: d, isSelectingRef: v };
1090
1090
  }
1091
- const ti = () => {
1092
- const e = T(Ce);
1093
- return Et((n) => e.sequenceNodesBuilder(n) || [], [e]);
1091
+ const ri = () => {
1092
+ const e = T(_e);
1093
+ return wt((n) => e.sequenceNodesBuilder(n) || [], [e]);
1094
1094
  };
1095
- function ni(e, t, n) {
1096
- const o = new Xt(t).setAlpha(0.05).toRgbString();
1095
+ function oi(e, t, n) {
1096
+ const o = new sn(t).setAlpha(0.05).toRgbString();
1097
1097
  return {
1098
1098
  id: n,
1099
1099
  strokeWidth: 1,
@@ -1105,7 +1105,7 @@ function ni(e, t, n) {
1105
1105
  widgetStroke: e.getColorFromTheme("white")
1106
1106
  };
1107
1107
  }
1108
- function Er(e) {
1108
+ function yr(e) {
1109
1109
  var _, R, C;
1110
1110
  const {
1111
1111
  unitId: t,
@@ -1115,42 +1115,42 @@ function Er(e) {
1115
1115
  editor: s,
1116
1116
  refSelectionsService: c,
1117
1117
  refSelectionsRenderService: i,
1118
- sheetSkeletonManagerService: a,
1118
+ sheetSkeletonManagerService: l,
1119
1119
  themeService: f,
1120
1120
  univerInstanceService: h
1121
- } = e, m = o.getUnitId(), u = h.getUnit(t, J.UNIVER_SHEET), d = u == null ? void 0 : u.getActiveSheet(), l = [];
1121
+ } = e, m = o.getUnitId(), u = h.getUnit(t, q.UNIVER_SHEET), d = u == null ? void 0 : u.getActiveSheet(), a = [];
1122
1122
  if (!u || !d) {
1123
- c.setSelections(l);
1123
+ c.setSelections(a);
1124
1124
  return;
1125
1125
  }
1126
- const v = d.getSheetId(), g = (y) => {
1126
+ const S = d.getSheetId(), g = (y) => {
1127
1127
  var N;
1128
1128
  return (N = u == null ? void 0 : u.getSheetBySheetName(y)) == null ? void 0 : N.getSheetId();
1129
1129
  };
1130
- if (!((_ = a == null ? void 0 : a.getWorksheetSkeleton(v)) == null ? void 0 : _.skeleton)) return;
1131
- const p = [];
1130
+ if (!((_ = l == null ? void 0 : l.getWorksheetSkeleton(S)) == null ? void 0 : _.skeleton)) return;
1131
+ const v = [];
1132
1132
  for (let y = 0, N = r.length; y < N; y++) {
1133
- const k = r[y], { themeColor: F, token: x, refIndex: w, endIndex: M } = k, E = rt(x), { unitId: b, sheetName: I, range: A } = E, D = g(I);
1134
- if (m !== t && b !== m || b && b !== m || D && D !== v || !D && v !== n)
1133
+ const k = r[y], { themeColor: F, token: x, refIndex: w, endIndex: M } = k, b = ut(x), { unitId: E, sheetName: I, range: A } = b, L = g(I);
1134
+ if (m !== t && E !== m || E && E !== m || L && L !== S || !L && S !== n)
1135
1135
  continue;
1136
- const $ = Zo(A, d.getRowCount(), d.getColumnCount());
1137
- $.unitId = t, $.sheetId = v, l.push({
1138
- range: $,
1136
+ const U = Jo(A, d.getRowCount(), d.getColumnCount());
1137
+ U.unitId = t, U.sheetId = S, a.push({
1138
+ range: U,
1139
1139
  primary: null,
1140
- style: ni(f, F, w.toString())
1141
- }), p.push(M);
1140
+ style: oi(f, F, w.toString())
1141
+ }), v.push(M);
1142
1142
  }
1143
1143
  if (s) {
1144
- const y = (C = (R = s.getSelectionRanges()) == null ? void 0 : R[0]) == null ? void 0 : C.startOffset, N = p.findIndex((k) => k + 2 === y);
1144
+ const y = (C = (R = s.getSelectionRanges()) == null ? void 0 : R[0]) == null ? void 0 : C.startOffset, N = v.findIndex((k) => k + 2 === y);
1145
1145
  N !== -1 ? i == null || i.setActiveSelectionIndex(N) : i == null || i.resetActiveSelectionIndex();
1146
1146
  }
1147
- return l;
1147
+ return a;
1148
1148
  }
1149
- function ri(e, t) {
1150
- const n = T(ee), o = T(ht), r = T(kt), c = T(xe).getRenderById(e), i = c == null ? void 0 : c.with(Fe), a = c == null ? void 0 : c.with(At), f = Q((h, m) => {
1151
- const u = n.getCurrentUnitOfType(J.UNIVER_SHEET);
1149
+ function si(e, t) {
1150
+ const n = T(ee), o = T(_t), r = T(Wt), c = T(Oe).getRenderById(e), i = c == null ? void 0 : c.with(De), l = c == null ? void 0 : c.with(Vt), f = J((h, m) => {
1151
+ const u = n.getCurrentUnitOfType(q.UNIVER_SHEET);
1152
1152
  if (!u || i != null && i.selectionMoving) return;
1153
- const d = Er({
1153
+ const d = yr({
1154
1154
  unitId: e,
1155
1155
  subUnitId: t,
1156
1156
  currentWorkbook: u,
@@ -1158,59 +1158,59 @@ function ri(e, t) {
1158
1158
  editor: m,
1159
1159
  refSelectionsService: r,
1160
1160
  refSelectionsRenderService: i,
1161
- sheetSkeletonManagerService: a,
1161
+ sheetSkeletonManagerService: l,
1162
1162
  themeService: o,
1163
1163
  univerInstanceService: n
1164
1164
  });
1165
1165
  if (!d) return;
1166
1166
  ((i == null ? void 0 : i.getSelectionControls()) || []).length === d.length ? i == null || i.resetSelectionsByModelData(d) : r.setSelections(d);
1167
1167
  });
1168
- return P(() => () => {
1168
+ return $(() => () => {
1169
1169
  i == null || i.resetActiveSelectionIndex();
1170
1170
  }, [i]), f;
1171
1171
  }
1172
- function Ir(e = "") {
1173
- const t = T(Ft), n = oi(), o = T(ue), r = oe(() => e.length, [e]);
1174
- return Q((c, i, a = !0, f) => {
1172
+ function Tr(e = "") {
1173
+ const t = T(Ht), n = ii(), o = T(ue), r = oe(() => e.length, [e]);
1174
+ return J((c, i, l = !0, f) => {
1175
1175
  const h = c.getDocumentData(), m = c.getEditorId();
1176
1176
  if (!h)
1177
1177
  return [];
1178
1178
  const u = h.body;
1179
1179
  if (!u)
1180
1180
  return [];
1181
- const d = u.dataStream.slice(0, u.dataStream.length - 2), l = { dataStream: "", ...h.body };
1181
+ const d = u.dataStream.slice(0, u.dataStream.length - 2), a = { dataStream: "", ...h.body };
1182
1182
  if (!d.startsWith(e)) return [];
1183
1183
  if (i == null || i.length === 0)
1184
- return l.textRuns = [], o.syncExecuteCommand(Tn.id, {
1184
+ return a.textRuns = [], o.syncExecuteCommand(wn.id, {
1185
1185
  unitId: m,
1186
- body: pn(l, 0, l.dataStream.length - 2)
1186
+ body: bn(a, 0, a.dataStream.length - 2)
1187
1187
  }), [];
1188
1188
  {
1189
- const { textRuns: v, refSelections: g } = si(t, n, i);
1190
- r && v.forEach((_) => {
1189
+ const { textRuns: S, refSelections: g } = ci(t, n, i);
1190
+ r && S.forEach((_) => {
1191
1191
  _.ed = _.ed + r, _.st = _.st + r;
1192
- }), l.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...v];
1193
- const S = i.reduce((_, R) => typeof R == "string" ? `${_}${R}` : `${_}${R.token}`, "");
1194
- l.dataStream = `${e}${S}\r
1192
+ }), a.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...S];
1193
+ const p = i.reduce((_, R) => typeof R == "string" ? `${_}${R}` : `${_}${R.token}`, "");
1194
+ a.dataStream = `${e}${p}\r
1195
1195
  `;
1196
- let p;
1197
- if (a) {
1198
- p = c.getSelectionRanges();
1199
- const _ = l.dataStream.length - 2 + r;
1200
- p.forEach((R) => {
1196
+ let v;
1197
+ if (l) {
1198
+ v = c.getSelectionRanges();
1199
+ const _ = a.dataStream.length - 2 + r;
1200
+ v.forEach((R) => {
1201
1201
  R.startOffset = Math.max(0, Math.min(R.startOffset, _)), R.endOffset = Math.max(0, Math.min(R.endOffset, _));
1202
1202
  });
1203
1203
  }
1204
- return o.syncExecuteCommand(Tn.id, {
1204
+ return o.syncExecuteCommand(wn.id, {
1205
1205
  unitId: m,
1206
- body: pn(l, 0, l.dataStream.length - 2),
1207
- textRanges: f != null ? f : p
1206
+ body: bn(a, 0, a.dataStream.length - 2),
1207
+ textRanges: f != null ? f : v
1208
1208
  }), g;
1209
1209
  }
1210
1210
  });
1211
1211
  }
1212
- function oi() {
1213
- const e = T(ht), t = e.getCurrentTheme();
1212
+ function ii() {
1213
+ const e = T(_t), t = e.getCurrentTheme();
1214
1214
  return oe(() => {
1215
1215
  const o = [
1216
1216
  e.getColorFromTheme("loop-color.1"),
@@ -1229,8 +1229,8 @@ function oi() {
1229
1229
  return { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: c };
1230
1230
  }, [t]);
1231
1231
  }
1232
- function si(e, t, n) {
1233
- const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: c } = t, i = [], a = [], f = /* @__PURE__ */ new Map();
1232
+ function ci(e, t, n) {
1233
+ const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: c } = t, i = [], l = [], f = /* @__PURE__ */ new Map();
1234
1234
  let h = 0;
1235
1235
  for (let m = 0, u = n.length; m < u; m++) {
1236
1236
  const d = n[m];
@@ -1261,36 +1261,36 @@ function si(e, t, n) {
1261
1261
  });
1262
1262
  continue;
1263
1263
  }
1264
- const { startIndex: l, endIndex: v, nodeType: g, token: S } = d;
1265
- let p = "";
1266
- if (g === z.REFERENCE) {
1267
- if (f.has(S))
1268
- p = f.get(S);
1264
+ const { startIndex: a, endIndex: S, nodeType: g, token: p } = d;
1265
+ let v = "";
1266
+ if (g === Z.REFERENCE) {
1267
+ if (f.has(p))
1268
+ v = f.get(p);
1269
1269
  else {
1270
1270
  const _ = h % o.length;
1271
- p = o[_], f.set(S, p), h++;
1271
+ v = o[_], f.set(p, v), h++;
1272
1272
  }
1273
- a.push({
1273
+ l.push({
1274
1274
  refIndex: m,
1275
- themeColor: p,
1276
- token: S,
1275
+ themeColor: v,
1276
+ token: p,
1277
1277
  startIndex: d.startIndex,
1278
1278
  endIndex: d.endIndex,
1279
- index: a.length
1279
+ index: l.length
1280
1280
  });
1281
- } else g === z.NUMBER ? p = r : (g === z.STRING || g === z.ARRAY) && (p = s);
1282
- p && p.length > 0 ? i.push({
1283
- st: l,
1284
- ed: v + 1,
1281
+ } else g === Z.NUMBER ? v = r : (g === Z.STRING || g === Z.ARRAY) && (v = s);
1282
+ v && v.length > 0 ? i.push({
1283
+ st: a,
1284
+ ed: S + 1,
1285
1285
  ts: {
1286
1286
  cl: {
1287
- rgb: p
1287
+ rgb: v
1288
1288
  },
1289
1289
  fs: 11
1290
1290
  }
1291
1291
  }) : i.push({
1292
- st: l,
1293
- ed: v + 1,
1292
+ st: a,
1293
+ ed: S + 1,
1294
1294
  ts: {
1295
1295
  cl: {
1296
1296
  rgb: c
@@ -1299,276 +1299,276 @@ function si(e, t, n) {
1299
1299
  }
1300
1300
  });
1301
1301
  }
1302
- return { textRuns: i, refSelections: a };
1302
+ return { textRuns: i, refSelections: l };
1303
1303
  }
1304
- const ii = (e, t, n, o) => {
1305
- const r = T(ue), s = T(Dt), c = Y(t);
1304
+ const ai = (e, t, n, o) => {
1305
+ const r = T(ue), s = T(Bt), c = G(t);
1306
1306
  c.current = t;
1307
- const i = Y(o);
1308
- i.current = o, P(() => {
1307
+ const i = G(o);
1308
+ i.current = o, $(() => {
1309
1309
  if (!n || !e)
1310
1310
  return;
1311
- const f = `sheet.formula-embedding-editor.${n.getEditorId()}`, h = new We(), m = (l, v) => {
1311
+ const f = `sheet.formula-embedding-editor.${n.getEditorId()}`, h = new He(), m = (a, S) => {
1312
1312
  if (i.current) {
1313
- i.current(l, v);
1313
+ i.current(a, S);
1314
1314
  return;
1315
1315
  }
1316
1316
  let g = ce.LEFT;
1317
- l === L.ARROW_DOWN ? g = ce.DOWN : l === L.ARROW_UP ? g = ce.UP : l === L.ARROW_RIGHT && (g = ce.RIGHT), v === W.SHIFT ? r.executeCommand(Ho.id, {
1317
+ a === D.ARROW_DOWN ? g = ce.DOWN : a === D.ARROW_UP ? g = ce.UP : a === D.ARROW_RIGHT && (g = ce.RIGHT), S === P.SHIFT ? r.executeCommand(qo.id, {
1318
1318
  direction: g
1319
- }) : r.executeCommand(Bo.id, {
1319
+ }) : r.executeCommand(Ko.id, {
1320
1320
  direction: g
1321
1321
  });
1322
- }, u = (l, v) => {
1322
+ }, u = (a, S) => {
1323
1323
  let g = ce.DOWN;
1324
- l === L.ARROW_DOWN ? g = ce.DOWN : l === L.ARROW_UP ? g = ce.UP : l === L.ARROW_LEFT ? g = ce.LEFT : l === L.ARROW_RIGHT && (g = ce.RIGHT), c.current ? v === W.CTRL_COMMAND ? r.executeCommand(Rn.id, {
1324
+ a === D.ARROW_DOWN ? g = ce.DOWN : a === D.ARROW_UP ? g = ce.UP : a === D.ARROW_LEFT ? g = ce.LEFT : a === D.ARROW_RIGHT && (g = ce.RIGHT), c.current ? S === P.CTRL_COMMAND ? r.executeCommand(Tn.id, {
1325
1325
  direction: g,
1326
- jumpOver: bn.moveGap,
1326
+ jumpOver: xn.moveGap,
1327
1327
  extra: "formula-editor",
1328
- fromCurrentSelection: c.current === Ae.NEED_ADD || c.current === Ae.EDIT_OTHER_SHEET_REFERENCE
1329
- }) : v === W.SHIFT ? r.executeCommand(En.id, {
1328
+ fromCurrentSelection: c.current === ke.NEED_ADD || c.current === ke.EDIT_OTHER_SHEET_REFERENCE
1329
+ }) : S === P.SHIFT ? r.executeCommand(On.id, {
1330
1330
  direction: g,
1331
1331
  extra: "formula-editor"
1332
- }) : v === (W.CTRL_COMMAND | W.SHIFT) ? r.executeCommand(En.id, {
1332
+ }) : S === (P.CTRL_COMMAND | P.SHIFT) ? r.executeCommand(On.id, {
1333
1333
  direction: g,
1334
- jumpOver: bn.moveGap,
1334
+ jumpOver: xn.moveGap,
1335
1335
  extra: "formula-editor"
1336
- }) : r.executeCommand(Rn.id, {
1336
+ }) : r.executeCommand(Tn.id, {
1337
1337
  direction: g,
1338
1338
  extra: "formula-editor",
1339
- fromCurrentSelection: c.current === Ae.NEED_ADD || c.current === Ae.EDIT_OTHER_SHEET_REFERENCE
1340
- }) : m(l, v);
1339
+ fromCurrentSelection: c.current === ke.NEED_ADD || c.current === ke.EDIT_OTHER_SHEET_REFERENCE
1340
+ }) : m(a, S);
1341
1341
  };
1342
1342
  return h.add(r.registerCommand({
1343
1343
  id: f,
1344
- type: ye.OPERATION,
1345
- handler(l, v) {
1346
- const { keyCode: g, metaKey: S } = v;
1347
- u(g, S);
1344
+ type: Te.OPERATION,
1345
+ handler(a, S) {
1346
+ const { keyCode: g, metaKey: p } = S;
1347
+ u(g, p);
1348
1348
  }
1349
1349
  })), [
1350
- { keyCode: L.ARROW_DOWN },
1351
- { keyCode: L.ARROW_LEFT },
1352
- { keyCode: L.ARROW_RIGHT },
1353
- { keyCode: L.ARROW_UP },
1354
- { keyCode: L.ARROW_DOWN, metaKey: W.SHIFT },
1355
- { keyCode: L.ARROW_LEFT, metaKey: W.SHIFT },
1356
- { keyCode: L.ARROW_RIGHT, metaKey: W.SHIFT },
1357
- { keyCode: L.ARROW_UP, metaKey: W.SHIFT },
1358
- { keyCode: L.ARROW_DOWN, metaKey: W.CTRL_COMMAND },
1359
- { keyCode: L.ARROW_LEFT, metaKey: W.CTRL_COMMAND },
1360
- { keyCode: L.ARROW_RIGHT, metaKey: W.CTRL_COMMAND },
1361
- { keyCode: L.ARROW_UP, metaKey: W.CTRL_COMMAND },
1362
- { keyCode: L.ARROW_DOWN, metaKey: W.CTRL_COMMAND | W.SHIFT },
1363
- { keyCode: L.ARROW_LEFT, metaKey: W.CTRL_COMMAND | W.SHIFT },
1364
- { keyCode: L.ARROW_RIGHT, metaKey: W.CTRL_COMMAND | W.SHIFT },
1365
- { keyCode: L.ARROW_UP, metaKey: W.CTRL_COMMAND | W.SHIFT }
1366
- ].map(({ keyCode: l, metaKey: v }) => ({
1350
+ { keyCode: D.ARROW_DOWN },
1351
+ { keyCode: D.ARROW_LEFT },
1352
+ { keyCode: D.ARROW_RIGHT },
1353
+ { keyCode: D.ARROW_UP },
1354
+ { keyCode: D.ARROW_DOWN, metaKey: P.SHIFT },
1355
+ { keyCode: D.ARROW_LEFT, metaKey: P.SHIFT },
1356
+ { keyCode: D.ARROW_RIGHT, metaKey: P.SHIFT },
1357
+ { keyCode: D.ARROW_UP, metaKey: P.SHIFT },
1358
+ { keyCode: D.ARROW_DOWN, metaKey: P.CTRL_COMMAND },
1359
+ { keyCode: D.ARROW_LEFT, metaKey: P.CTRL_COMMAND },
1360
+ { keyCode: D.ARROW_RIGHT, metaKey: P.CTRL_COMMAND },
1361
+ { keyCode: D.ARROW_UP, metaKey: P.CTRL_COMMAND },
1362
+ { keyCode: D.ARROW_DOWN, metaKey: P.CTRL_COMMAND | P.SHIFT },
1363
+ { keyCode: D.ARROW_LEFT, metaKey: P.CTRL_COMMAND | P.SHIFT },
1364
+ { keyCode: D.ARROW_RIGHT, metaKey: P.CTRL_COMMAND | P.SHIFT },
1365
+ { keyCode: D.ARROW_UP, metaKey: P.CTRL_COMMAND | P.SHIFT }
1366
+ ].map(({ keyCode: a, metaKey: S }) => ({
1367
1367
  id: f,
1368
- binding: v ? l | v : l,
1368
+ binding: S ? a | S : a,
1369
1369
  preconditions: () => !0,
1370
1370
  priority: 900,
1371
1371
  staticParameters: {
1372
- eventType: Te.Keyboard,
1373
- keyCode: l,
1374
- metaKey: v
1372
+ eventType: xe.Keyboard,
1373
+ keyCode: a,
1374
+ metaKey: S
1375
1375
  }
1376
- })).forEach((l) => {
1377
- h.add(s.registerShortcut(l));
1376
+ })).forEach((a) => {
1377
+ h.add(s.registerShortcut(a));
1378
1378
  }), () => {
1379
1379
  h.dispose();
1380
1380
  };
1381
1381
  }, [r, n, e, s]);
1382
- }, ci = (e, t, n, o = !0) => {
1382
+ }, li = (e, t, n, o = !0) => {
1383
1383
  var u;
1384
- const r = T(xe), s = T(zt), c = T(ss), i = T(kt), a = T(ee), f = ve(oe(() => a.getCurrentTypeOfUnit$(J.UNIVER_SHEET), [a])), h = r.getRenderById((u = f == null ? void 0 : f.getUnitId()) != null ? u : ""), m = h == null ? void 0 : h.with(Fe);
1385
- It(() => {
1384
+ const r = T(Oe), s = T(rn), c = T(ls), i = T(Wt), l = T(ee), f = Ce(oe(() => l.getCurrentTypeOfUnit$(q.UNIVER_SHEET), [l])), h = r.getRenderById((u = f == null ? void 0 : f.getUnitId()) != null ? u : ""), m = h == null ? void 0 : h.with(De);
1385
+ At(() => {
1386
1386
  if (e)
1387
- return s.setContextValue(pt, !0), () => {
1388
- s.setContextValue(pt, !1), i.clear();
1387
+ return s.setContextValue(Tt, !0), () => {
1388
+ s.setContextValue(Tt, !1), i.clear();
1389
1389
  };
1390
- }, [s, e, i]), It(() => {
1390
+ }, [s, e, i]), At(() => {
1391
1391
  if (e && t) {
1392
1392
  const d = m == null ? void 0 : m.enableSelectionChanging();
1393
- return s.setContextValue(Nn, !0), () => {
1394
- s.setContextValue(Nn, !1), d == null || d.dispose();
1393
+ return s.setContextValue(Fn, !0), () => {
1394
+ s.setContextValue(Fn, !1), d == null || d.dispose();
1395
1395
  };
1396
1396
  }
1397
- }, [s, e, m, t]), P(() => {
1397
+ }, [s, e, m, t]), $(() => {
1398
1398
  if (e)
1399
- return s.setContextValue(pt, !0), o && c.disable(), () => {
1400
- s.setContextValue(pt, !1), o && c.enable();
1399
+ return s.setContextValue(Tt, !0), o && c.disable(), () => {
1400
+ s.setContextValue(Tt, !1), o && c.enable();
1401
1401
  };
1402
- }, [c, s, e, o]), P(() => {
1402
+ }, [c, s, e, o]), $(() => {
1403
1403
  e && (m == null || m.setSkipLastEnabled(!1));
1404
1404
  }, [e, m]);
1405
- }, li = (e, t, n) => {
1406
- const o = T(ee), r = T(en);
1407
- return Et(() => {
1405
+ }, ui = (e, t, n) => {
1406
+ const o = T(ee), r = T(ln);
1407
+ return wt(() => {
1408
1408
  if (e) {
1409
- const c = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], i = o.getCurrentUnitForType(J.UNIVER_SHEET), a = i == null ? void 0 : i.getActiveSheet();
1410
- (i == null ? void 0 : i.getUnitId()) !== t && o.setCurrentUnitForType(t), a && a.getSheetId() === n && r.setSelections(c);
1409
+ const c = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], i = o.getCurrentUnitForType(q.UNIVER_SHEET), l = i == null ? void 0 : i.getActiveSheet();
1410
+ (i == null ? void 0 : i.getUnitId()) !== t && o.setCurrentUnitForType(t), l && l.getSheetId() === n && r.setSelections(c);
1411
1411
  }
1412
1412
  }, [e, r, n, t, o]);
1413
- }, ai = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0), Yt = (e) => e.map((t) => typeof t == "string" ? t : t.token).join(""), Ct = (e, t = !1, n = "", o = !1) => !t && !o ? e.map((r) => Se(r.range)) : e.map((r) => o ? Oo(r) : r.sheetName !== "" && r.sheetName !== n ? at(r.sheetName, r.range) : Se(r.range)), ui = (e) => {
1413
+ }, di = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0), tn = (e) => e.map((t) => typeof t == "string" ? t : t.token).join(""), xt = (e, t = !1, n = "", o = !1) => !t && !o ? e.map((r) => ve(r.range)) : e.map((r) => o ? wo(r) : r.sheetName !== "" && r.sheetName !== n ? St(r.sheetName, r.range) : ve(r.range)), hi = (e) => {
1414
1414
  var h, m, u;
1415
1415
  const { editor: t, lexerTreeBuilder: n } = e, o = t == null ? void 0 : t.getSelectionRanges();
1416
1416
  if ((o == null ? void 0 : o.length) !== 1)
1417
1417
  return;
1418
1418
  const s = o[0].startOffset - 1, c = ((m = (h = t == null ? void 0 : t.getDocumentData().body) == null ? void 0 : h.dataStream) != null ? m : `\r
1419
- `).slice(0, -2), i = (u = n.sequenceNodesBuilder(c.slice(1))) != null ? u : [], a = dn(i, s, !1), f = fr(i, a);
1419
+ `).slice(0, -2), i = (u = n.sequenceNodesBuilder(c.slice(1))) != null ? u : [], l = pn(i, s, !1), f = mr(i, l);
1420
1420
  return {
1421
- nodeIndex: a,
1421
+ nodeIndex: l,
1422
1422
  updatingRefIndex: f,
1423
1423
  sequenceNodes: i,
1424
1424
  offset: s
1425
1425
  };
1426
- }, di = () => {
1427
- }, hi = (e, t, n, o, r, s, c, i, a, f = di) => {
1426
+ }, fi = () => {
1427
+ }, gi = (e, t, n, o, r, s, c, i, l, f = fi) => {
1428
1428
  var w;
1429
- const h = T(xe), m = T(ee), u = T(ue), d = T(ar), l = T(ht), v = T(Ce), g = m.getUnit(o), S = Q((M) => {
1430
- var E, b;
1431
- return (b = (E = g == null ? void 0 : g.getSheetBySheetId(M)) == null ? void 0 : E.getName()) != null ? b : "";
1432
- }), p = oe(() => S(r), [S, r]), _ = ve(g == null ? void 0 : g.activeSheet$), R = Ke({ activeSheet: _, sheetName: p }), C = ve(oe(() => m.getCurrentTypeOfUnit$(J.UNIVER_SHEET), [m])), y = h.getRenderById((w = C == null ? void 0 : C.getUnitId()) != null ? w : ""), N = y == null ? void 0 : y.with(Fe), k = y == null ? void 0 : y.with(At), F = T(kt), x = Q((M, E) => {
1433
- var H, se, q, _e, Ye, ne;
1434
- const b = ui({ editor: a, lexerTreeBuilder: v });
1435
- if (!b) return;
1436
- const { nodeIndex: I, updatingRefIndex: A, sequenceNodes: D, offset: $ } = b;
1437
- if (n.current === Ae.NEED_ADD)
1438
- if ($ !== 0) {
1439
- if (I === -1 && D.length)
1429
+ const h = T(Oe), m = T(ee), u = T(ue), d = T(ur), a = T(_t), S = T(_e), g = m.getUnit(o), p = J((M) => {
1430
+ var b, E;
1431
+ return (E = (b = g == null ? void 0 : g.getSheetBySheetId(M)) == null ? void 0 : b.getName()) != null ? E : "";
1432
+ }), v = oe(() => p(r), [p, r]), _ = Ce(g == null ? void 0 : g.activeSheet$), R = Je({ activeSheet: _, sheetName: v }), C = Ce(oe(() => m.getCurrentTypeOfUnit$(q.UNIVER_SHEET), [m])), y = h.getRenderById((w = C == null ? void 0 : C.getUnitId()) != null ? w : ""), N = y == null ? void 0 : y.with(De), k = y == null ? void 0 : y.with(Vt), F = T(Wt), x = J((M, b) => {
1433
+ var H, se, K, Re, et, ne;
1434
+ const E = hi({ editor: l, lexerTreeBuilder: S });
1435
+ if (!E) return;
1436
+ const { nodeIndex: I, updatingRefIndex: A, sequenceNodes: L, offset: U } = E;
1437
+ if (n.current === ke.NEED_ADD)
1438
+ if (U !== 0) {
1439
+ if (I === -1 && L.length)
1440
1440
  return;
1441
- const Z = M[M.length - 1], X = D.splice(I + 1), he = (H = Z.sheetId) != null ? H : r, te = {
1442
- range: Z,
1443
- unitId: (se = Z.unitId) != null ? se : C.getUnitId(),
1444
- sheetName: S(he)
1445
- }, fe = he !== r, le = (C == null ? void 0 : C.getUnitId()) !== o, Ge = Ct([te], c && (fe || le), p, le);
1446
- D.push({ token: Ge[0], nodeType: z.REFERENCE });
1447
- const De = [...D, ...X], de = Yt(De);
1448
- f(de, ai(D), E);
1441
+ const X = M[M.length - 1], Q = L.splice(I + 1), ge = (H = X.sheetId) != null ? H : r, te = {
1442
+ range: X,
1443
+ unitId: (se = X.unitId) != null ? se : C.getUnitId(),
1444
+ sheetName: p(ge)
1445
+ }, me = ge !== r, ae = (C == null ? void 0 : C.getUnitId()) !== o, tt = xt([te], c && (me || ae), v, ae);
1446
+ L.push({ token: tt[0], nodeType: Z.REFERENCE });
1447
+ const Le = [...L, ...Q], de = tn(Le);
1448
+ f(de, di(L), b);
1449
1449
  } else {
1450
- const Z = M[M.length - 1], X = (q = Z.sheetId) != null ? q : r, he = {
1451
- range: Z,
1452
- unitId: (_e = Z.unitId) != null ? _e : o,
1453
- sheetName: S(X)
1454
- }, fe = Ct([he], c && X !== r);
1455
- D.unshift({ token: fe[0], nodeType: z.REFERENCE });
1456
- const le = Yt(D);
1457
- f(le, fe[0].length, E);
1450
+ const X = M[M.length - 1], Q = (K = X.sheetId) != null ? K : r, ge = {
1451
+ range: X,
1452
+ unitId: (Re = X.unitId) != null ? Re : o,
1453
+ sheetName: p(Q)
1454
+ }, me = xt([ge], c && Q !== r);
1455
+ L.unshift({ token: me[0], nodeType: Z.REFERENCE });
1456
+ const ae = tn(L);
1457
+ f(ae, me[0].length, b);
1458
1458
  }
1459
- else if (n.current === Ae.EDIT_OTHER_SHEET_REFERENCE) {
1460
- const Z = M.pop();
1461
- if (!Z) return;
1462
- const X = D[I];
1463
- if (typeof X == "object" && X.nodeType === z.REFERENCE) {
1464
- const he = X.token;
1465
- X.token = p === (_ == null ? void 0 : _.getName()) ? Se(Z) : at(_.getName(), Z);
1466
- const te = $ + (X.token.length - he.length);
1467
- f(No(D), te, E);
1459
+ else if (n.current === ke.EDIT_OTHER_SHEET_REFERENCE) {
1460
+ const X = M.pop();
1461
+ if (!X) return;
1462
+ const Q = L[I];
1463
+ if (typeof Q == "object" && Q.nodeType === Z.REFERENCE) {
1464
+ const ge = Q.token;
1465
+ Q.token = v === (_ == null ? void 0 : _.getName()) ? ve(X) : St(_.getName(), X);
1466
+ const te = U + (Q.token.length - ge.length);
1467
+ f(Ao(L), te, b);
1468
1468
  }
1469
1469
  } else {
1470
- const Z = [...M];
1470
+ const X = [...M];
1471
1471
  if (A !== -1) {
1472
- const G = Z.pop();
1473
- G && Z.splice(A, 0, G);
1472
+ const z = X.pop();
1473
+ z && X.splice(A, 0, z);
1474
1474
  }
1475
- let X = 0;
1476
- const he = D.map((G) => {
1477
- var ge, Re, Ne;
1478
- if (typeof G == "string")
1479
- return G;
1480
- if (G.nodeType === z.REFERENCE) {
1481
- const Le = rt(G.token);
1482
- if (Le.sheetName || (Le.sheetName = p), c && ((ge = R.current.activeSheet) == null ? void 0 : ge.getName()) !== Le.sheetName)
1483
- return G.token;
1484
- const be = Z[X];
1485
- if (X++, !be)
1475
+ let Q = 0;
1476
+ const ge = L.map((z) => {
1477
+ var pe, Ee, Me;
1478
+ if (typeof z == "string")
1479
+ return z;
1480
+ if (z.nodeType === Z.REFERENCE) {
1481
+ const $e = ut(z.token);
1482
+ if ($e.sheetName || ($e.sheetName = v), c && ((pe = R.current.activeSheet) == null ? void 0 : pe.getName()) !== $e.sheetName)
1483
+ return z.token;
1484
+ const be = X[Q];
1485
+ if (Q++, !be)
1486
1486
  return "";
1487
- const Pt = (Re = be.sheetId) != null ? Re : r, $t = {
1487
+ const qt = (Ee = be.sheetId) != null ? Ee : r, Kt = {
1488
1488
  range: be,
1489
- unitId: (Ne = be.unitId) != null ? Ne : o,
1490
- sheetName: S(Pt)
1489
+ unitId: (Me = be.unitId) != null ? Me : o,
1490
+ sheetName: p(qt)
1491
1491
  };
1492
- return Ct([$t], c, p)[0];
1492
+ return xt([Kt], c, v)[0];
1493
1493
  }
1494
- return G.token;
1494
+ return z.token;
1495
1495
  });
1496
- let te = "", fe;
1497
- he.forEach((G, ge) => {
1498
- te += G, ge === I && (fe = te.length);
1496
+ let te = "", me;
1497
+ ge.forEach((z, pe) => {
1498
+ te += z, pe === I && (me = te.length);
1499
1499
  });
1500
- const le = [];
1501
- for (let G = X; G <= M.length - 1; G++) {
1502
- const ge = M[G], Re = (Ye = ge.sheetId) != null ? Ye : r, Ne = {
1503
- range: ge,
1504
- unitId: (ne = ge.unitId) != null ? ne : o,
1505
- sheetName: S(Re)
1506
- }, be = Ct([Ne], c && Re !== r, p);
1507
- le.push(be[0]);
1500
+ const ae = [];
1501
+ for (let z = Q; z <= M.length - 1; z++) {
1502
+ const pe = M[z], Ee = (et = pe.sheetId) != null ? et : r, Me = {
1503
+ range: pe,
1504
+ unitId: (ne = pe.unitId) != null ? ne : o,
1505
+ sheetName: p(Ee)
1506
+ }, be = xt([Me], c && Ee !== r, v);
1507
+ ae.push(be[0]);
1508
1508
  }
1509
- const Ge = D[D.length - 1], De = Ge && (typeof Ge == "string" ? !1 : Ge.nodeType === z.REFERENCE), de = `${te}${le.length && De ? "," : ""}${le.join(",")}`;
1510
- f(de, !le.length && fe ? fe : de.length, E);
1509
+ const tt = L[L.length - 1], Le = tt && (typeof tt == "string" ? !1 : tt.nodeType === Z.REFERENCE), de = `${te}${ae.length && Le ? "," : ""}${ae.join(",")}`;
1510
+ f(de, !ae.length && me ? me : de.length, b);
1511
1511
  }
1512
1512
  });
1513
- P(() => {
1513
+ $(() => {
1514
1514
  if (N && e) {
1515
1515
  let M = !0;
1516
- const E = (I, A) => {
1516
+ const b = (I, A) => {
1517
1517
  if (M) {
1518
1518
  M = !1;
1519
1519
  return;
1520
1520
  }
1521
- x(I.map((D) => D.rangeWithCoord), A);
1522
- }, b = new We();
1523
- return b.add(N.selectionMoving$.subscribe((I) => {
1524
- E(I, !1);
1525
- })), b.add(N.selectionMoveEnd$.subscribe((I) => {
1526
- E(I, !0);
1521
+ x(I.map((L) => L.rangeWithCoord), A);
1522
+ }, E = new He();
1523
+ return E.add(N.selectionMoving$.subscribe((I) => {
1524
+ b(I, !1);
1525
+ })), E.add(N.selectionMoveEnd$.subscribe((I) => {
1526
+ b(I, !0);
1527
1527
  })), () => {
1528
- b.dispose();
1528
+ E.dispose();
1529
1529
  };
1530
1530
  }
1531
- }, [e, x, N]), P(() => {
1532
- if (t && N && a) {
1533
- const M = new We(), E = () => {
1534
- M.dispose(), N.getSelectionControls().forEach((A, D) => {
1531
+ }, [e, x, N]), $(() => {
1532
+ if (t && N && l) {
1533
+ const M = new He(), b = () => {
1534
+ M.dispose(), N.getSelectionControls().forEach((A, L) => {
1535
1535
  M.add(
1536
- A.selectionScaling$.subscribe(($) => {
1537
- const H = N.getSelectionDataWithStyle().map((q) => q.rangeWithCoord), se = H[D];
1538
- $.sheetId = se.sheetId, $.unitId = se.unitId, H[D] = $, x(H, !1);
1536
+ A.selectionScaling$.subscribe((U) => {
1537
+ const H = N.getSelectionDataWithStyle().map((K) => K.rangeWithCoord), se = H[L];
1538
+ U.sheetId = se.sheetId, U.unitId = se.unitId, H[L] = U, x(H, !1);
1539
1539
  })
1540
1540
  ), M.add(
1541
- A.selectionMoving$.subscribe(($) => {
1542
- const H = N.getSelectionDataWithStyle().map((q) => q.rangeWithCoord), se = H[D];
1543
- $.sheetId = se.sheetId, $.unitId = se.unitId, H[D] = $, x(H, !0);
1541
+ A.selectionMoving$.subscribe((U) => {
1542
+ const H = N.getSelectionDataWithStyle().map((K) => K.rangeWithCoord), se = H[L];
1543
+ U.sheetId = se.sheetId, U.unitId = se.unitId, H[L] = U, x(H, !0);
1544
1544
  })
1545
1545
  );
1546
1546
  });
1547
- }, b = $o(
1548
- a.input$,
1547
+ }, E = Wo(
1548
+ l.input$,
1549
1549
  F.selectionSet$,
1550
1550
  N.selectionMoveEnd$
1551
1551
  ).pipe(
1552
- _s(50)
1552
+ Es(50)
1553
1553
  ).subscribe(() => {
1554
- E();
1554
+ b();
1555
1555
  });
1556
1556
  return () => {
1557
- b.unsubscribe(), M.dispose();
1557
+ E.unsubscribe(), M.dispose();
1558
1558
  };
1559
1559
  }
1560
- }, [a, t, x, N, F.selectionSet$]), N == null || N.getSelectionDataWithStyle(), P(() => {
1560
+ }, [l, t, x, N, F.selectionSet$]), N == null || N.getSelectionDataWithStyle(), $(() => {
1561
1561
  if (i) {
1562
- const M = u.onCommandExecuted((E) => {
1562
+ const M = u.onCommandExecuted((b) => {
1563
1563
  var I;
1564
- if (E.id !== tn.id)
1564
+ if (b.id !== un.id)
1565
1565
  return;
1566
- const b = E.params;
1567
- if (b.extra === "formula-editor" && b.selections.length) {
1568
- const A = b.selections[b.selections.length - 1];
1566
+ const E = b.params;
1567
+ if (E.extra === "formula-editor" && E.selections.length) {
1568
+ const A = E.selections[E.selections.length - 1];
1569
1569
  if (A) {
1570
- const D = n.current === Ae.NEED_ADD, $ = ((I = N == null ? void 0 : N.getSelectionDataWithStyle()) != null ? I : []).map((H) => H.rangeWithCoord);
1571
- D ? $.push(A.range) : $[$.length - 1] = A.range, x($, !0);
1570
+ const L = n.current === ke.NEED_ADD, U = ((I = N == null ? void 0 : N.getSelectionDataWithStyle()) != null ? I : []).map((H) => H.rangeWithCoord);
1571
+ L ? U.push(A.range) : U[U.length - 1] = A.range, x(U, !0);
1572
1572
  }
1573
1573
  }
1574
1574
  });
@@ -1576,51 +1576,51 @@ const ii = (e, t, n, o) => {
1576
1576
  M.dispose();
1577
1577
  };
1578
1578
  }
1579
- }, [u, a, n, v, i, x, N]), P(() => {
1580
- if (!a)
1579
+ }, [u, l, n, S, i, x, N]), $(() => {
1580
+ if (!l)
1581
1581
  return;
1582
- const M = d.textSelection$.subscribe((E) => {
1583
- E.unitId === a.getEditorId() && Er({
1582
+ const M = d.textSelection$.subscribe((b) => {
1583
+ b.unitId === l.getEditorId() && yr({
1584
1584
  unitId: o,
1585
1585
  subUnitId: r,
1586
1586
  refSelections: s.current,
1587
- editor: a,
1587
+ editor: l,
1588
1588
  refSelectionsService: F,
1589
1589
  refSelectionsRenderService: N,
1590
1590
  sheetSkeletonManagerService: k,
1591
- themeService: l,
1591
+ themeService: a,
1592
1592
  univerInstanceService: m,
1593
1593
  currentWorkbook: C
1594
1594
  });
1595
1595
  });
1596
1596
  return () => M.unsubscribe();
1597
- }, [d.textSelection$, a, s, N, F, k, r, l, o, m]);
1598
- }, fi = (e, t, n, o, r, s) => {
1599
- const c = T(ue), i = T(Be), f = T(xe).getRenderById(t), h = T(ee), m = f == null ? void 0 : f.with(Fe);
1600
- P(() => {
1597
+ }, [d.textSelection$, l, s, N, F, k, r, a, o, m]);
1598
+ }, mi = (e, t, n, o, r, s) => {
1599
+ const c = T(ue), i = T(qe), f = T(Oe).getRenderById(t), h = T(ee), m = f == null ? void 0 : f.with(De);
1600
+ $(() => {
1601
1601
  if (e && m)
1602
1602
  if (n) {
1603
1603
  const u = () => {
1604
- const v = m.getSelectionControls().length;
1605
- for (let g = 1; g <= v; g++)
1604
+ const S = m.getSelectionControls().length;
1605
+ for (let g = 1; g <= S; g++)
1606
1606
  m.clearLastSelection();
1607
1607
  return setTimeout(() => {
1608
1608
  s();
1609
1609
  }, 30);
1610
- }, d = c.onCommandExecuted((v) => {
1611
- v.id === Mn.id && u();
1612
- }), l = h.getCurrentTypeOfUnit$(J.UNIVER_SHEET).subscribe((v) => {
1610
+ }, d = c.onCommandExecuted((S) => {
1611
+ S.id === Dn.id && u();
1612
+ }), a = h.getCurrentTypeOfUnit$(q.UNIVER_SHEET).subscribe((S) => {
1613
1613
  u();
1614
1614
  });
1615
1615
  return () => {
1616
- d.dispose(), l.unsubscribe();
1616
+ d.dispose(), a.unsubscribe();
1617
1617
  };
1618
1618
  } else {
1619
1619
  const u = c.beforeCommandExecuted((d) => {
1620
- if (d.id === Mn.id) {
1620
+ if (d.id === Dn.id) {
1621
1621
  o(!1), r(), s();
1622
- const l = i.getEditor(Zt);
1623
- l == null || l.focus();
1622
+ const a = i.getEditor(on);
1623
+ a == null || a.focus();
1624
1624
  }
1625
1625
  });
1626
1626
  return () => {
@@ -1628,9 +1628,9 @@ const ii = (e, t, n, o) => {
1628
1628
  };
1629
1629
  }
1630
1630
  }, [e, m]);
1631
- }, gi = (e, t, n) => {
1632
- const o = T(Ce), r = Y(!0);
1633
- P(() => {
1631
+ }, pi = (e, t, n) => {
1632
+ const o = T(_e), r = G(!0);
1633
+ $(() => {
1634
1634
  if (e) {
1635
1635
  const s = setTimeout(() => {
1636
1636
  r.current = !1;
@@ -1639,95 +1639,95 @@ const ii = (e, t, n, o) => {
1639
1639
  clearTimeout(s);
1640
1640
  };
1641
1641
  }
1642
- }, [e]), P(() => {
1642
+ }, [e]), $(() => {
1643
1643
  if (!r.current && t) {
1644
1644
  const s = o.checkIfAddBracket(n);
1645
- t(s === 0 && n.startsWith(zn.EQUALS), `${n}`);
1645
+ t(s === 0 && n.startsWith(er.EQUALS), `${n}`);
1646
1646
  }
1647
1647
  }, [n, t]);
1648
- }, mi = (e, t = [], n) => {
1649
- const o = T(Ft), [r, s] = U([]), [c, i] = U(""), a = Y(-1), f = Ke({ nodes: t }), h = () => {
1650
- s([]), i(""), a.current = -1;
1648
+ }, Si = (e, t = [], n) => {
1649
+ const o = T(Ht), [r, s] = V([]), [c, i] = V(""), l = G(-1), f = Je({ nodes: t }), h = () => {
1650
+ s([]), i(""), l.current = -1;
1651
1651
  };
1652
- return P(() => {
1652
+ return $(() => {
1653
1653
  if (n && e) {
1654
- const u = n.input$.pipe(Jt(300)).subscribe(() => {
1654
+ const u = n.input$.pipe(an(300)).subscribe(() => {
1655
1655
  const d = n.getSelectionRanges();
1656
1656
  if (d.length === 1) {
1657
- const l = f.current.nodes, v = d[0];
1658
- if (v.collapsed) {
1659
- const g = dn(l, v.startOffset - 1, !1);
1660
- a.current = g;
1661
- const S = l[g];
1662
- if (S && typeof S != "string" && S.nodeType === z.FUNCTION) {
1663
- a.current = g;
1664
- const p = S.token, _ = o.getSearchListByNameFirstLetter(p);
1665
- s(_), i(p);
1657
+ const a = f.current.nodes, S = d[0];
1658
+ if (S.collapsed) {
1659
+ const g = pn(a, S.startOffset - 1, !1);
1660
+ l.current = g;
1661
+ const p = a[g];
1662
+ if (p && typeof p != "string" && p.nodeType === Z.FUNCTION) {
1663
+ l.current = g;
1664
+ const v = p.token, _ = o.getSearchListByNameFirstLetter(v);
1665
+ s(_), i(v);
1666
1666
  return;
1667
1667
  }
1668
1668
  }
1669
1669
  }
1670
- a.current = -1, i(""), s((l) => l != null && l.length ? [] : l);
1670
+ l.current = -1, i(""), s((a) => a != null && a.length ? [] : a);
1671
1671
  });
1672
1672
  return () => {
1673
1673
  u.unsubscribe();
1674
1674
  };
1675
1675
  }
1676
- }, [n, e]), P(() => {
1676
+ }, [n, e]), $(() => {
1677
1677
  e || h();
1678
1678
  }, [e]), {
1679
1679
  searchList: r,
1680
1680
  searchText: c,
1681
1681
  handlerFormulaReplace: (u) => {
1682
1682
  const d = [...f.current.nodes];
1683
- if (a.current !== -1) {
1684
- const l = d.splice(a.current + 1), v = d.pop() || "";
1685
- let g = (typeof v == "string" ? v.length : v.token.length) - u.length;
1686
- return d.push(u), l[0] !== et.OPEN_BRACKET && (d.push(et.OPEN_BRACKET), g--), { text: Yt([...d, ...l]), offset: g };
1683
+ if (l.current !== -1) {
1684
+ const a = d.splice(l.current + 1), S = d.pop() || "";
1685
+ let g = (typeof S == "string" ? S.length : S.token.length) - u.length;
1686
+ return d.push(u), a[0] !== ct.OPEN_BRACKET && (d.push(ct.OPEN_BRACKET), g--), { text: tn([...d, ...a]), offset: g };
1687
1687
  }
1688
1688
  },
1689
1689
  reset: h
1690
1690
  };
1691
- }, Si = () => {
1692
- }, vi = Oe(pi);
1693
- function pi(e, t) {
1694
- const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: c = Si } = e, i = s.getEditorId(), a = T(Dt), f = T(ue), { searchList: h, searchText: m, handlerFormulaReplace: u, reset: d } = mi(n, o, s), l = oe(() => !!h.length, [h]), v = Y(void 0), [g, S] = U(0), p = Y(!1), [_] = br(i, l, [m, h]), R = Ke({ searchList: h, active: g }), C = (x) => {
1691
+ }, vi = () => {
1692
+ }, Ci = Ne(_i);
1693
+ function _i(e, t) {
1694
+ const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: c = vi } = e, i = s.getEditorId(), l = T(Bt), f = T(ue), { searchList: h, searchText: m, handlerFormulaReplace: u, reset: d } = Si(n, o, s), a = oe(() => !!h.length, [h]), S = G(void 0), [g, p] = V(0), v = G(!1), [_] = Ir(i, a, [m, h]), R = Je({ searchList: h, active: g }), C = (x) => {
1695
1695
  const w = u(x);
1696
1696
  w && (d(), r(w));
1697
1697
  };
1698
1698
  function y(x) {
1699
- p.current && S(x);
1699
+ v.current && p(x);
1700
1700
  }
1701
1701
  function N() {
1702
- p.current && S(-1);
1702
+ v.current && p(-1);
1703
1703
  }
1704
- P(() => {
1704
+ $(() => {
1705
1705
  if (!h.length)
1706
1706
  return;
1707
- const x = `sheet.formula-embedding-editor.search_function.${i}`, w = new We(), M = (E) => {
1708
- const { searchList: b, active: I } = R.current;
1709
- switch (E) {
1710
- case L.ARROW_UP: {
1711
- S((A) => {
1712
- const D = Math.max(0, A - 1);
1713
- return k(D), D;
1707
+ const x = `sheet.formula-embedding-editor.search_function.${i}`, w = new He(), M = (b) => {
1708
+ const { searchList: E, active: I } = R.current;
1709
+ switch (b) {
1710
+ case D.ARROW_UP: {
1711
+ p((A) => {
1712
+ const L = Math.max(0, A - 1);
1713
+ return k(L), L;
1714
1714
  });
1715
1715
  break;
1716
1716
  }
1717
- case L.ARROW_DOWN: {
1718
- S((A) => {
1719
- const D = Math.min(b.length - 1, A + 1);
1720
- return k(D), D;
1717
+ case D.ARROW_DOWN: {
1718
+ p((A) => {
1719
+ const L = Math.min(E.length - 1, A + 1);
1720
+ return k(L), L;
1721
1721
  });
1722
1722
  break;
1723
1723
  }
1724
- case L.TAB:
1725
- case L.ENTER: {
1726
- const A = b[I];
1724
+ case D.TAB:
1725
+ case D.ENTER: {
1726
+ const A = E[I];
1727
1727
  C(A.name);
1728
1728
  break;
1729
1729
  }
1730
- case L.ESC: {
1730
+ case D.ESC: {
1731
1731
  d(), c();
1732
1732
  break;
1733
1733
  }
@@ -1735,35 +1735,35 @@ function pi(e, t) {
1735
1735
  };
1736
1736
  return w.add(f.registerCommand({
1737
1737
  id: x,
1738
- type: ye.OPERATION,
1739
- handler(E, b) {
1740
- const { keyCode: I } = b;
1738
+ type: Te.OPERATION,
1739
+ handler(b, E) {
1740
+ const { keyCode: I } = E;
1741
1741
  M(I);
1742
1742
  }
1743
- })), [L.ARROW_UP, L.ARROW_DOWN, L.ENTER, L.ESC, L.TAB].map((E) => ({
1743
+ })), [D.ARROW_UP, D.ARROW_DOWN, D.ENTER, D.ESC, D.TAB].map((b) => ({
1744
1744
  id: x,
1745
- binding: E,
1745
+ binding: b,
1746
1746
  preconditions: () => !0,
1747
1747
  priority: 1e3,
1748
1748
  staticParameters: {
1749
- eventType: Te.Keyboard,
1750
- keyCode: E
1749
+ eventType: xe.Keyboard,
1750
+ keyCode: b
1751
1751
  }
1752
- })).forEach((E) => {
1753
- w.add(a.registerShortcut(E));
1752
+ })).forEach((b) => {
1753
+ w.add(l.registerShortcut(b));
1754
1754
  }), () => {
1755
1755
  w.dispose();
1756
1756
  };
1757
1757
  }, [h]);
1758
1758
  function k(x) {
1759
- const w = v.current;
1759
+ const w = S.current;
1760
1760
  if (!w) return;
1761
1761
  const M = w.children[x];
1762
1762
  if (!M) return;
1763
- const b = w.getBoundingClientRect().top, I = w.offsetHeight, A = M.getBoundingClientRect(), D = A.top, $ = A.height;
1764
- if (D >= 0 && D > b && D - b + $ <= I)
1763
+ const E = w.getBoundingClientRect().top, I = w.offsetHeight, A = M.getBoundingClientRect(), L = A.top, U = A.height;
1764
+ if (L >= 0 && L > E && L - E + U <= I)
1765
1765
  return;
1766
- const H = M.offsetTop - (I - $) / 2;
1766
+ const H = M.offsetTop - (I - U) / 2;
1767
1767
  w.scrollTo({
1768
1768
  top: H,
1769
1769
  behavior: "smooth"
@@ -1772,23 +1772,24 @@ function pi(e, t) {
1772
1772
  const F = oe(() => {
1773
1773
  let x = "";
1774
1774
  return () => {
1775
- clearTimeout(x), p.current = !0, x = setTimeout(() => {
1776
- p.current = !1;
1775
+ clearTimeout(x), v.current = !0, x = setTimeout(() => {
1776
+ v.current = !1;
1777
1777
  }, 300);
1778
1778
  };
1779
1779
  }, []);
1780
- return h.length > 0 && l && /* @__PURE__ */ O(qt, { portal: !0, anchorRect$: _, direction: "vertical", children: /* @__PURE__ */ O(
1780
+ return h.length > 0 && a && /* @__PURE__ */ O(Jt, { portal: !0, anchorRect$: _, direction: "vertical", children: /* @__PURE__ */ O(
1781
1781
  "ul",
1782
1782
  {
1783
1783
  ref: (x) => {
1784
- v.current = x, t && (t.current = x);
1784
+ S.current = x, t && (t.current = x);
1785
1785
  },
1786
- className: pe("univer-m-0 univer-box-border univer-max-h-[400px] univer-w-[250px] univer-list-none univer-overflow-y-auto univer-rounded-lg univer-bg-white univer-p-2 univer-leading-5 univer-shadow-md univer-outline-none", sn, cr),
1787
- children: h.map((x, w) => /* @__PURE__ */ V(
1786
+ "data-u-comp": "sheets-formula-editor",
1787
+ className: fe("univer-m-0 univer-box-border univer-max-h-[400px] univer-w-[250px] univer-list-none univer-overflow-y-auto univer-rounded-lg univer-bg-white univer-p-2 univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900", fn, ar),
1788
+ children: h.map((x, w) => /* @__PURE__ */ W(
1788
1789
  "li",
1789
1790
  {
1790
- className: pe("univer-box-border univer-cursor-pointer univer-rounded univer-px-2 univer-py-1 univer-text-gray-900 univer-transition-colors dark:univer-text-white", {
1791
- "univer-bg-gray-200 dark:univer-bg-gray-600": g === w
1791
+ className: fe("univer-box-border univer-cursor-pointer univer-rounded univer-px-2 univer-py-1 univer-text-gray-900 univer-transition-colors dark:!univer-text-white", {
1792
+ "univer-bg-gray-200 dark:!univer-bg-gray-600": g === w
1792
1793
  }),
1793
1794
  onMouseEnter: () => y(w),
1794
1795
  onMouseLeave: N,
@@ -1797,7 +1798,7 @@ function pi(e, t) {
1797
1798
  C(x.name), s && s.focus();
1798
1799
  },
1799
1800
  children: [
1800
- /* @__PURE__ */ V("span", { className: "univer-text-xs", children: [
1801
+ /* @__PURE__ */ W("span", { className: "univer-text-xs", children: [
1801
1802
  /* @__PURE__ */ O("span", { className: "univer-text-red-500", children: x.name.substring(0, m.length) }),
1802
1803
  /* @__PURE__ */ O("span", { children: x.name.slice(m.length) })
1803
1804
  ] }),
@@ -1815,9 +1816,9 @@ function pi(e, t) {
1815
1816
  }
1816
1817
  ) });
1817
1818
  }
1818
- const Ci = (e) => e.startsWith(zn.EQUALS) ? e.slice(1) : "", Dn = () => {
1819
- }, _i = Oe((e, t) => {
1820
- var fn, gn;
1819
+ const Ri = (e) => e.startsWith(er.EQUALS) ? e.slice(1) : "", Wn = () => {
1820
+ }, Ei = Ne((e, t) => {
1821
+ var vn, Cn;
1821
1822
  const {
1822
1823
  errorText: n,
1823
1824
  initValue: o,
@@ -1825,70 +1826,70 @@ const Ci = (e) => e.startsWith(zn.EQUALS) ? e.slice(1) : "", Dn = () => {
1825
1826
  subUnitId: s,
1826
1827
  isFocus: c = !0,
1827
1828
  isSupportAcrossSheet: i = !1,
1828
- onFocus: a = Dn,
1829
- onBlur: f = Dn,
1829
+ onFocus: l = Wn,
1830
+ onBlur: f = Wn,
1830
1831
  onChange: h,
1831
1832
  onVerify: m,
1832
1833
  className: u,
1833
1834
  editorId: d,
1834
- moveCursor: l = !0,
1835
- onFormulaSelectingChange: v,
1835
+ moveCursor: a = !0,
1836
+ onFormulaSelectingChange: S,
1836
1837
  keyboardEventConfig: g,
1837
- onMoveInEditor: S,
1838
- resetSelectionOnBlur: p = !0,
1838
+ onMoveInEditor: p,
1839
+ resetSelectionOnBlur: v = !0,
1839
1840
  autoScrollbar: _ = !0,
1840
1841
  isSingle: R = !0,
1841
1842
  disableSelectionOnClick: C = !1,
1842
1843
  autofocus: y = !0,
1843
1844
  disableContextMenu: N,
1844
1845
  style: k
1845
- } = e, F = T(Be), x = Y(null), w = Q(h);
1846
- Cs(t, () => ({
1847
- isClickOutSide: (K) => x.current ? !x.current.contains(K.target) : !1
1846
+ } = e, F = T(qe), x = G(null), w = J(h);
1847
+ Rs(t, () => ({
1848
+ isClickOutSide: (Y) => x.current ? !x.current.contains(Y.target) : !1
1848
1849
  }));
1849
- const M = Q(v), E = Y(null), b = Y(void 0), I = b.current, [A, D] = U(c), $ = Y(null), H = oe(() => d != null ? d : Br(`${uo}-${jr(4)}`), []), se = oe(() => n !== void 0, [n]), q = T(ee), _e = q.getUnit(H);
1850
- ve(_e == null ? void 0 : _e.change$);
1851
- const Ye = ti(), ne = qr.transform.getPlainText((gn = (fn = _e == null ? void 0 : _e.getBody()) == null ? void 0 : fn.dataStream) != null ? gn : ""), Z = Ke(ne), X = oe(() => Ci(ne), [ne]), he = oe(() => Ye(X), [X, Ye]), { isSelecting: te, isSelectingRef: fe } = ei({ unitId: r, subUnitId: s, editorId: H, isFocus: A, disableOnClick: C }), le = Y(""), De = T(xe).getRenderById(H), de = De == null ? void 0 : De.with(Qn), G = de == null ? void 0 : de.isFocusing, ge = oe(() => q.getCurrentTypeOfUnit$(J.UNIVER_DOC), [q]), Re = ve(ge), Ne = (Re == null ? void 0 : Re.getUnitId()) === H, Le = Y([]), be = te;
1852
- is(() => {
1850
+ const M = J(S), b = G(null), E = G(void 0), I = E.current, [A, L] = V(c), U = G(null), H = oe(() => d != null ? d : qr(`${fo}-${Kr(4)}`), []), se = oe(() => n !== void 0, [n]), K = T(ee), Re = K.getUnit(H);
1851
+ Ce(Re == null ? void 0 : Re.change$);
1852
+ const et = ri(), ne = Yr.transform.getPlainText((Cn = (vn = Re == null ? void 0 : Re.getBody()) == null ? void 0 : vn.dataStream) != null ? Cn : ""), X = Je(ne), Q = oe(() => Ri(ne), [ne]), ge = oe(() => et(Q), [Q, et]), { isSelecting: te, isSelectingRef: me } = ni({ unitId: r, subUnitId: s, editorId: H, isFocus: A, disableOnClick: C }), ae = G(""), Le = T(Oe).getRenderById(H), de = Le == null ? void 0 : Le.with(rr), z = de == null ? void 0 : de.isFocusing, pe = oe(() => K.getCurrentTypeOfUnit$(q.UNIVER_DOC), [K]), Ee = Ce(pe), Me = (Ee == null ? void 0 : Ee.getUnitId()) === H, $e = G([]), be = te;
1853
+ us(() => {
1853
1854
  w(ne);
1854
1855
  }, [ne, w]);
1855
- const Pt = Ir("="), $t = ri(r, s), Pe = Q((K, re = !0, Me, Ee) => {
1856
- if (!b.current) return;
1857
- le.current = K;
1858
- const mt = K[0] === "=" ? K.slice(1) : "", we = Ye(mt), Dr = we.reduce(($e, vt) => typeof vt == "object" ? `${$e}${vt.token}` : `${$e}${vt}`, ""), St = Pt(
1859
- b.current,
1860
- Dr === mt ? we : [],
1856
+ const qt = Tr("="), Kt = si(r, s), Pe = J((Y, re = !0, we, Ie) => {
1857
+ if (!E.current) return;
1858
+ ae.current = Y;
1859
+ const bt = Y[0] === "=" ? Y.slice(1) : "", Ae = et(bt), $r = Ae.reduce((Ue, yt) => typeof yt == "object" ? `${Ue}${yt.token}` : `${Ue}${yt}`, ""), It = qt(
1860
+ E.current,
1861
+ $r === bt ? Ae : [],
1861
1862
  re,
1862
- Ee
1863
+ Ie
1863
1864
  );
1864
- if (Le.current = St, Me) {
1865
- const $e = Ee != null ? Ee : I == null ? void 0 : I.getSelectionRanges();
1866
- if (($e == null ? void 0 : $e.length) !== 1)
1865
+ if ($e.current = It, we) {
1866
+ const Ue = Ie != null ? Ie : I == null ? void 0 : I.getSelectionRanges();
1867
+ if ((Ue == null ? void 0 : Ue.length) !== 1)
1867
1868
  return;
1868
- const Lr = $e[0].startOffset - 1, Pr = dn(we, Lr, !1), mn = fr(we, Pr);
1869
- if (mn >= 0) {
1870
- const Sn = St.splice(mn, 1)[0];
1871
- Sn && St.push(Sn);
1869
+ const Pr = Ue[0].startOffset - 1, Ur = pn(Ae, Pr, !1), _n = mr(Ae, Ur);
1870
+ if (_n >= 0) {
1871
+ const Rn = It.splice(_n, 1)[0];
1872
+ Rn && It.push(Rn);
1872
1873
  }
1873
- $t(A ? St : [], b.current);
1874
+ Kt(A ? It : [], E.current);
1874
1875
  }
1875
1876
  });
1876
- P(() => {
1877
+ $(() => {
1877
1878
  A && Pe(ne, !1, !0);
1878
- }, [A]), P(() => {
1879
+ }, [A]), $(() => {
1879
1880
  if (A) {
1880
- if (le.current === ne) return;
1881
+ if (ae.current === ne) return;
1881
1882
  Pe(ne, !1, !0);
1882
1883
  }
1883
- }, [ne]), gi(A, m, ne);
1884
- const ze = zs(I), hn = li(A, r, s);
1885
- P(() => {
1886
- var K;
1887
- M(te, (K = de == null ? void 0 : de.isFocusing) != null ? K : !0);
1888
- }, [M, te]), jo(A, g, I), It(() => {
1889
- let K;
1890
- if ($.current) {
1891
- K = F.register({
1884
+ }, [ne]), pi(A, m, ne);
1885
+ const nt = Xs(I), Sn = ui(A, r, s);
1886
+ $(() => {
1887
+ var Y;
1888
+ M(te, (Y = de == null ? void 0 : de.isFocusing) != null ? Y : !0);
1889
+ }, [M, te]), Yo(A, g, I), At(() => {
1890
+ let Y;
1891
+ if (U.current) {
1892
+ Y = F.register({
1892
1893
  autofocus: y,
1893
1894
  editorUnitId: H,
1894
1895
  initialSnapshot: {
@@ -1903,63 +1904,63 @@ const Ci = (e) => e.startsWith(zn.EQUALS) ? e.slice(1) : "", Dn = () => {
1903
1904
  },
1904
1905
  documentStyle: {}
1905
1906
  }
1906
- }, $.current);
1907
+ }, U.current);
1907
1908
  const re = F.getEditor(H);
1908
- b.current = re, Pe(o, !1, !0);
1909
+ E.current = re, Pe(o, !1, !0);
1909
1910
  }
1910
1911
  return () => {
1911
- K == null || K.dispose();
1912
+ Y == null || Y.dispose();
1912
1913
  };
1913
- }, []), It(() => {
1914
- c ? (D(c), ze()) : (p && (I == null || I.blur(), hn()), D(c));
1915
- }, [c, I, ze, hn, p]);
1916
- const { checkScrollBar: wr } = qo(I, R, _);
1917
- ci(A, !!(te && Ne), r, N), ii(!!(A && G && l), be, I, S);
1918
- const Ar = Q((K, re, Me) => {
1919
- if (!G)
1914
+ }, []), At(() => {
1915
+ c ? (L(c), nt()) : (v && (I == null || I.blur(), Sn()), L(c));
1916
+ }, [c, I, nt, Sn, v]);
1917
+ const { checkScrollBar: kr } = Go(I, R, _);
1918
+ li(A, !!(te && Me), r, N), ai(!!(A && z && a), be, I, p);
1919
+ const Fr = J((Y, re, we) => {
1920
+ if (!z)
1920
1921
  return;
1921
- const Ee = re !== -1 ? [{ startOffset: re + 1, endOffset: re + 1, collapsed: !0 }] : void 0;
1922
- Pe(`=${K}`, !0, Me, Ee), Me && (ze(), re !== -1 && setTimeout(() => {
1923
- const mt = { startOffset: re + 1, endOffset: re + 1 }, we = I == null ? void 0 : I.render.with(Ko);
1924
- we == null || we.scrollToRange({ ...mt, collapsed: !0 });
1925
- }, 50), wr());
1922
+ const Ie = re !== -1 ? [{ startOffset: re + 1, endOffset: re + 1, collapsed: !0 }] : void 0;
1923
+ Pe(`=${Y}`, !0, we, Ie), we && (nt(), re !== -1 && setTimeout(() => {
1924
+ const bt = { startOffset: re + 1, endOffset: re + 1 }, Ae = I == null ? void 0 : I.render.with(zo);
1925
+ Ae == null || Ae.scrollToRange({ ...bt, collapsed: !0 });
1926
+ }, 50), kr());
1926
1927
  });
1927
- hi(
1928
- A && !!(te && Ne),
1928
+ gi(
1929
+ A && !!(te && Me),
1929
1930
  A,
1930
- fe,
1931
+ me,
1931
1932
  r,
1932
1933
  s,
1933
- Le,
1934
+ $e,
1934
1935
  i,
1935
1936
  !!be,
1936
1937
  I,
1937
- Ar
1938
- ), fi(A && !!(te && Ne), r, i, D, f, () => {
1939
- Pe(Z.current, !1, !0);
1938
+ Fr
1939
+ ), mi(A && !!(te && Me), r, i, L, f, () => {
1940
+ Pe(X.current, !1, !0);
1940
1941
  });
1941
- const kr = (K) => {
1942
- if (K) {
1942
+ const Dr = (Y) => {
1943
+ if (Y) {
1943
1944
  const re = I == null ? void 0 : I.getSelectionRanges();
1944
1945
  if (re && re.length === 1) {
1945
- const Me = re[0];
1946
- if (Me.collapsed) {
1947
- const Ee = K.offset;
1946
+ const we = re[0];
1947
+ if (we.collapsed) {
1948
+ const Ie = Y.offset;
1948
1949
  setTimeout(() => {
1949
- I == null || I.setSelectionRanges([{ startOffset: Me.startOffset - Ee, endOffset: Me.endOffset - Ee }]);
1950
+ I == null || I.setSelectionRanges([{ startOffset: we.startOffset - Ie, endOffset: we.endOffset - Ie }]);
1950
1951
  }, 30);
1951
1952
  }
1952
1953
  }
1953
- ze(), Pe(`=${K.text}`);
1954
+ nt(), Pe(`=${Y.text}`);
1954
1955
  }
1955
- }, Fr = () => {
1956
- D(!0), a(), ze();
1956
+ }, Lr = () => {
1957
+ L(!0), l(), nt();
1957
1958
  };
1958
- return /* @__PURE__ */ V("div", { className: u, children: [
1959
+ return /* @__PURE__ */ W("div", { className: u, children: [
1959
1960
  /* @__PURE__ */ O(
1960
1961
  "div",
1961
1962
  {
1962
- className: pe(
1963
+ className: fe(
1963
1964
  `
1964
1965
  univer-relative univer-box-border univer-flex univer-h-full univer-w-full univer-items-center
1965
1966
  univer-justify-around univer-gap-2 univer-rounded-none univer-p-0 univer-ring-1
@@ -1973,47 +1974,47 @@ const Ci = (e) => e.startsWith(zn.EQUALS) ? e.slice(1) : "", Dn = () => {
1973
1974
  children: /* @__PURE__ */ O(
1974
1975
  "div",
1975
1976
  {
1976
- ref: $,
1977
+ ref: U,
1977
1978
  className: "univer-relative univer-h-full univer-w-full",
1978
- onMouseUp: Fr
1979
+ onMouseUp: Lr
1979
1980
  }
1980
1981
  )
1981
1982
  }
1982
1983
  ),
1983
1984
  n !== void 0 ? /* @__PURE__ */ O("div", { className: "univer-my-1 univer-text-xs univer-text-red-500", children: n }) : null,
1984
1985
  I ? /* @__PURE__ */ O(
1985
- Gs,
1986
+ Zs,
1986
1987
  {
1987
1988
  editor: I,
1988
1989
  isFocus: A,
1989
1990
  formulaText: ne,
1990
- onClose: () => ze()
1991
+ onClose: () => nt()
1991
1992
  }
1992
1993
  ) : null,
1993
1994
  I ? /* @__PURE__ */ O(
1994
- vi,
1995
+ Ci,
1995
1996
  {
1996
1997
  isFocus: A,
1997
- sequenceNodes: he,
1998
- onSelect: kr,
1999
- ref: E,
1998
+ sequenceNodes: ge,
1999
+ onSelect: Dr,
2000
+ ref: b,
2000
2001
  editor: I
2001
2002
  }
2002
2003
  ) : null
2003
2004
  ] });
2004
2005
  });
2005
- function Ri(e, t, n, o) {
2006
- const r = T(Ce), s = Ir(""), c = ve(e == null ? void 0 : e.getDocumentDataModel().change$), [i, a] = U([]), f = T(ho), h = Y(""), m = T(ee);
2007
- return P(() => {
2006
+ function bi(e, t, n, o) {
2007
+ const r = T(_e), s = Tr(""), c = Ce(e == null ? void 0 : e.getDocumentDataModel().change$), [i, l] = V([]), f = T(go), h = G(""), m = T(ee);
2008
+ return $(() => {
2008
2009
  if (!e) return;
2009
2010
  const u = e.getDocumentDataModel().getPlainText();
2010
2011
  if (h.current === u)
2011
2012
  return;
2012
2013
  h.current = u;
2013
2014
  const d = r.sequenceNodesBuilder(u);
2014
- a(d != null ? d : []);
2015
- }, [c, e, r]), P(() => {
2016
- var l, v;
2015
+ l(d != null ? d : []);
2016
+ }, [c, e, r]), $(() => {
2017
+ var a, S;
2017
2018
  if (!e) return;
2018
2019
  if (!t) {
2019
2020
  const g = e.getDocumentData();
@@ -2021,19 +2022,19 @@ function Ri(e, t, n, o) {
2021
2022
  ...g,
2022
2023
  body: {
2023
2024
  ...g.body,
2024
- dataStream: (v = (l = g.body) == null ? void 0 : l.dataStream) != null ? v : "",
2025
+ dataStream: (S = (a = g.body) == null ? void 0 : a.dataStream) != null ? S : "",
2025
2026
  textRuns: []
2026
2027
  }
2027
2028
  });
2028
2029
  return;
2029
2030
  }
2030
- const u = s(e, i, !1), d = new We();
2031
+ const u = s(e, i, !1), d = new He();
2031
2032
  return u.forEach((g) => {
2032
- const S = rt(g.token), p = m.getCurrentUnitForType(J.UNIVER_SHEET), _ = p == null ? void 0 : p.getActiveSheet();
2033
- if (!S.sheetName && o !== (_ == null ? void 0 : _.getSheetId()) || S.sheetName && (_ == null ? void 0 : _.getName()) !== S.sheetName)
2033
+ const p = ut(g.token), v = m.getCurrentUnitForType(q.UNIVER_SHEET), _ = v == null ? void 0 : v.getActiveSheet();
2034
+ if (!p.sheetName && o !== (_ == null ? void 0 : _.getSheetId()) || p.sheetName && (_ == null ? void 0 : _.getName()) !== p.sheetName)
2034
2035
  return;
2035
- const R = new Xt(g.themeColor).toRgb(), C = f.addShape({
2036
- range: S.range,
2036
+ const R = new sn(g.themeColor).toRgb(), C = f.addShape({
2037
+ range: p.range,
2037
2038
  style: {
2038
2039
  stroke: g.themeColor,
2039
2040
  fill: `rgba(${R.r}, ${R.g}, ${R.b}, 0.1)`,
@@ -2047,19 +2048,19 @@ function Ri(e, t, n, o) {
2047
2048
  };
2048
2049
  }, [e, t, s, f, i]), { sequenceNodes: i };
2049
2050
  }
2050
- function bi(e) {
2051
- const t = T(en), { supportAcrossSheet: n = !1, unitId: o, subUnitId: r, onChange: s } = e, i = T(ee).getUnit(o, J.UNIVER_SHEET), a = Q(s), f = Q((h, m) => {
2051
+ function Ii(e) {
2052
+ const t = T(ln), { supportAcrossSheet: n = !1, unitId: o, subUnitId: r, onChange: s } = e, i = T(ee).getUnit(o, q.UNIVER_SHEET), l = J(s), f = J((h, m) => {
2052
2053
  const u = i == null ? void 0 : i.getActiveSheet();
2053
2054
  if (!u || !n && u.getSheetId() !== r || !(h != null && h.length)) return;
2054
- const d = h.map((l) => ({
2055
- range: l.range,
2055
+ const d = h.map((a) => ({
2056
+ range: a.range,
2056
2057
  unitId: o,
2057
2058
  sheetName: u.getSheetId() === r ? "" : u.getName()
2058
2059
  }));
2059
- a(d, m);
2060
+ l(d, m);
2060
2061
  });
2061
- P(() => {
2062
- const h = new We();
2062
+ $(() => {
2063
+ const h = new He();
2063
2064
  return h.add(t.selectionMoveStart$.subscribe((m) => {
2064
2065
  f(m, !0);
2065
2066
  })), h.add(t.selectionMoving$.subscribe((m) => {
@@ -2071,14 +2072,14 @@ function bi(e) {
2071
2072
  };
2072
2073
  }, [f, t.selectionMoveEnd$, t.selectionMoveStart$, t.selectionMoving$]);
2073
2074
  }
2074
- const Ln = (e) => !e.some((n) => {
2075
+ const Hn = (e) => !e.some((n) => {
2075
2076
  if (typeof n == "string") {
2076
- if (n !== et.COMMA)
2077
+ if (n !== ct.COMMA)
2077
2078
  return !0;
2078
- } else if (n.nodeType !== z.REFERENCE)
2079
+ } else if (n.nodeType !== Z.REFERENCE)
2079
2080
  return !0;
2080
2081
  return !1;
2081
- }), Ei = (e) => {
2082
+ }), yi = (e) => {
2082
2083
  if (e.endColumn < e.startColumn) {
2083
2084
  const t = e.endColumn;
2084
2085
  e.endColumn = e.startColumn, e.startColumn = t;
@@ -2089,7 +2090,7 @@ const Ln = (e) => !e.some((n) => {
2089
2090
  }
2090
2091
  return e;
2091
2092
  };
2092
- function Ii(e) {
2093
+ function Ti(e) {
2093
2094
  const {
2094
2095
  visible: t,
2095
2096
  initialValue: n,
@@ -2098,49 +2099,49 @@ function Ii(e) {
2098
2099
  maxRangeCount: s = 1 / 0,
2099
2100
  supportAcrossSheet: c,
2100
2101
  onConfirm: i,
2101
- onClose: a,
2102
+ onClose: l,
2102
2103
  onShowBySelection: f
2103
- } = e, h = T(tt), m = T(Ce), [u, d] = U([]), [l, v] = U(0), g = Y(null);
2104
- P(() => {
2104
+ } = e, h = T(at), m = T(_e), [u, d] = V([]), [a, S] = V(0), g = G(null);
2105
+ $(() => {
2105
2106
  if (t && n.length) {
2106
- const R = n.map((C) => C.sheetName ? at(C.sheetName, C.range) : Se(C.range));
2107
- d(R), v(R.length - 1);
2107
+ const R = n.map((C) => C.sheetName ? St(C.sheetName, C.range) : ve(C.range));
2108
+ d(R), S(R.length - 1);
2108
2109
  } else
2109
- d([""]), v(0);
2110
+ d([""]), S(0);
2110
2111
  }, [t]);
2111
- const S = (R, C) => {
2112
+ const p = (R, C) => {
2112
2113
  const y = [...u];
2113
2114
  y[R] = C, d(y);
2114
- }, p = () => {
2115
- d([...u, ""]), v(u.length);
2115
+ }, v = () => {
2116
+ d([...u, ""]), S(u.length);
2116
2117
  }, _ = (R) => {
2117
2118
  u.splice(R, 1), d([...u]);
2118
2119
  };
2119
- return bi({
2120
+ return Ii({
2120
2121
  unitId: o,
2121
2122
  subUnitId: r,
2122
2123
  supportAcrossSheet: c,
2123
2124
  onChange: (R, C) => {
2124
2125
  if (!t && f != null && f(R))
2125
2126
  return;
2126
- const y = new Set(u), N = R.map((x) => x.sheetName ? at(x.sheetName, x.range) : Se(x.range)), k = N.filter((x) => !y.has(x));
2127
+ const y = new Set(u), N = R.map((x) => x.sheetName ? St(x.sheetName, x.range) : ve(x.range)), k = N.filter((x) => !y.has(x));
2127
2128
  if (!k.length) return;
2128
2129
  const F = [...u];
2129
2130
  if (N.length > 1) {
2130
- C || F.splice(l, 1), F.push(...k);
2131
+ C || F.splice(a, 1), F.push(...k);
2131
2132
  const x = F.slice(0, s);
2132
- d(x), v(x.length - 1), requestAnimationFrame(() => {
2133
+ d(x), S(x.length - 1), requestAnimationFrame(() => {
2133
2134
  var w;
2134
2135
  (w = g.current) == null || w.scrollTo({ top: g.current.scrollHeight });
2135
2136
  });
2136
2137
  } else {
2137
- F.splice(l, 1, ...k);
2138
+ F.splice(a, 1, ...k);
2138
2139
  const x = F.slice(0, s);
2139
- d(x), v(l + k.length - 1);
2140
+ d(x), S(a + k.length - 1);
2140
2141
  }
2141
2142
  }
2142
2143
  }), /* @__PURE__ */ O(
2143
- Ss,
2144
+ vs,
2144
2145
  {
2145
2146
  width: "328px",
2146
2147
  open: t,
@@ -2148,33 +2149,32 @@ function Ii(e) {
2148
2149
  draggable: !0,
2149
2150
  mask: !1,
2150
2151
  maskClosable: !1,
2151
- footer: /* @__PURE__ */ V("footer", { children: [
2152
- /* @__PURE__ */ O(Qe, { onClick: a, children: h.t("rangeSelector.cancel") }),
2152
+ footer: /* @__PURE__ */ W("footer", { className: "univer-flex univer-gap-2", children: [
2153
+ /* @__PURE__ */ O(st, { onClick: l, children: h.t("rangeSelector.cancel") }),
2153
2154
  /* @__PURE__ */ O(
2154
- Qe,
2155
+ st,
2155
2156
  {
2156
- style: { marginLeft: 10 },
2157
2157
  variant: "primary",
2158
2158
  onClick: () => {
2159
2159
  i(
2160
2160
  u.filter((R) => {
2161
2161
  const C = m.sequenceNodesBuilder(R);
2162
- return C && C.length === 1 && typeof C[0] != "string" && C[0].nodeType === z.REFERENCE;
2163
- }).map((R) => rt(R)).map((R) => ({ ...R, range: Ei(R.range) }))
2162
+ return C && C.length === 1 && typeof C[0] != "string" && C[0].nodeType === Z.REFERENCE;
2163
+ }).map((R) => ut(R)).map((R) => ({ ...R, range: yi(R.range) }))
2164
2164
  );
2165
2165
  },
2166
2166
  children: h.t("rangeSelector.confirm")
2167
2167
  }
2168
2168
  )
2169
2169
  ] }),
2170
- onClose: a,
2171
- children: /* @__PURE__ */ V(
2170
+ onClose: l,
2171
+ children: /* @__PURE__ */ W(
2172
2172
  "div",
2173
2173
  {
2174
2174
  ref: g,
2175
- className: pe("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6", cr),
2175
+ className: fe("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6", ar),
2176
2176
  children: [
2177
- u.map((R, C) => /* @__PURE__ */ V(
2177
+ u.map((R, C) => /* @__PURE__ */ W(
2178
2178
  "div",
2179
2179
  {
2180
2180
  className: "univer-mb-2 univer-flex univer-items-center univer-gap-4",
@@ -2182,16 +2182,17 @@ function Ii(e) {
2182
2182
  /* @__PURE__ */ O(
2183
2183
  lr,
2184
2184
  {
2185
- className: "univer-w-full",
2185
+ className: fe("univer-w-full", {
2186
+ "univer-border-primary-600": a === C
2187
+ }),
2186
2188
  placeholder: h.t("rangeSelector.placeHolder"),
2187
- onFocus: () => v(C),
2189
+ onFocus: () => S(C),
2188
2190
  value: R,
2189
- onChange: (y) => S(C, y),
2190
- style: { borderColor: l === C ? "rgb(var(--primary-color))" : void 0 }
2191
+ onChange: (y) => p(C, y)
2191
2192
  }
2192
2193
  ),
2193
2194
  u.length > 1 && /* @__PURE__ */ O(
2194
- vr,
2195
+ Cr,
2195
2196
  {
2196
2197
  className: "univer-cursor-pointer",
2197
2198
  onClick: () => _(C)
@@ -2201,8 +2202,8 @@ function Ii(e) {
2201
2202
  },
2202
2203
  C
2203
2204
  )),
2204
- u.length < s && /* @__PURE__ */ O("div", { children: /* @__PURE__ */ V(Qe, { variant: "link", onClick: p, children: [
2205
- /* @__PURE__ */ O(pr, {}),
2205
+ u.length < s && /* @__PURE__ */ O("div", { children: /* @__PURE__ */ W(st, { variant: "link", onClick: v, children: [
2206
+ /* @__PURE__ */ O(_r, {}),
2206
2207
  /* @__PURE__ */ O("span", { children: h.t("rangeSelector.addAnotherRange") })
2207
2208
  ] }) })
2208
2209
  ]
@@ -2211,35 +2212,35 @@ function Ii(e) {
2211
2212
  }
2212
2213
  );
2213
2214
  }
2214
- function yi(e) {
2215
- return e.split(et.COMMA).filter((t) => !!t).map((t) => rt(t));
2215
+ function xi(e) {
2216
+ return e.split(ct.COMMA).filter((t) => !!t).map((t) => ut(t));
2216
2217
  }
2217
- function Ti(e) {
2218
- return e.map((t) => t.sheetName ? at(t.sheetName, t.range) : Se(t.range)).join(et.COMMA);
2218
+ function Oi(e) {
2219
+ return e.map((t) => t.sheetName ? St(t.sheetName, t.range) : ve(t.range)).join(ct.COMMA);
2219
2220
  }
2220
- function yr(e) {
2221
- const [t, n] = U(null), {
2221
+ function xr(e) {
2222
+ const [t, n] = V(null), {
2222
2223
  onVerify: o,
2223
2224
  selectorRef: r,
2224
2225
  unitId: s,
2225
2226
  subUnitId: c,
2226
2227
  maxRangeCount: i,
2227
- supportAcrossSheet: a,
2228
+ supportAcrossSheet: l,
2228
2229
  autoFocus: f,
2229
2230
  onChange: h,
2230
2231
  onRangeSelectorDialogVisibleChange: m,
2231
2232
  onClickOutside: u,
2232
2233
  onFocusChange: d,
2233
- forceShowDialogWhenSelectionChanged: l,
2234
- hideEditor: v,
2234
+ forceShowDialogWhenSelectionChanged: a,
2235
+ hideEditor: S,
2235
2236
  resetRange: g
2236
- } = e, [S, p] = U(f != null ? f : !1), [_, R] = U(!1), [C, y] = U([]), N = T(tt), k = T(Be), { sequenceNodes: F } = Ri(t, S, s, c), x = Ke(F), w = T(ue), M = Q(() => {
2237
+ } = e, [p, v] = V(f != null ? f : !1), [_, R] = V(!1), [C, y] = V([]), N = T(at), k = T(qe), { sequenceNodes: F } = bi(t, p, s, c), x = Je(F), w = T(ue), M = J(() => {
2237
2238
  t == null || t.setSelectionRanges([]), t == null || t.blur(), k.blur();
2238
- }), E = Q(() => {
2239
- var b;
2240
- M(), y(yi((b = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? b : "")), R(!0);
2239
+ }), b = J(() => {
2240
+ var E;
2241
+ M(), y(xi((E = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? E : "")), R(!0);
2241
2242
  });
2242
- return P(() => {
2243
+ return $(() => {
2243
2244
  r && (r.current = {
2244
2245
  get editor() {
2245
2246
  return t;
@@ -2248,59 +2249,65 @@ function yr(e) {
2248
2249
  k.focus(t.getEditorId());
2249
2250
  },
2250
2251
  blur: M,
2251
- verify: () => Ln(x.current),
2252
- showDialog: (b) => {
2253
- M(), y(b), R(!0);
2252
+ verify: () => Hn(x.current),
2253
+ showDialog: (E) => {
2254
+ M(), y(E), R(!0);
2254
2255
  },
2255
2256
  hideDialog: () => {
2256
2257
  y([]), R(!1);
2257
2258
  },
2258
2259
  getValue: () => {
2259
- var b;
2260
- return (b = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? b : "";
2260
+ var E;
2261
+ return (E = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? E : "";
2261
2262
  }
2262
2263
  });
2263
- }, [M, t, k, r, x]), P(() => {
2264
- var b;
2265
- o == null || o(Ln(F), (b = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? b : "");
2266
- }, [F]), P(() => {
2264
+ }, [M, t, k, r, x]), $(() => {
2265
+ var E;
2266
+ o == null || o(Hn(F), (E = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? E : "");
2267
+ }, [F]), $(() => {
2267
2268
  m == null || m(_);
2268
- }, [_]), P(() => {
2269
+ }, [_]), $(() => {
2269
2270
  if (_ && g)
2270
2271
  return () => {
2271
- const b = {
2272
+ const E = {
2272
2273
  unitId: s,
2273
2274
  subUnitId: c,
2274
2275
  selections: g
2275
2276
  };
2276
- w.executeCommand(tn.id, b);
2277
+ w.executeCommand(un.id, E);
2277
2278
  };
2278
- }, [_]), /* @__PURE__ */ V(fs, { children: [
2279
- v ? null : /* @__PURE__ */ O(
2280
- Yo,
2279
+ }, [_]), /* @__PURE__ */ W(ms, { children: [
2280
+ S ? null : /* @__PURE__ */ O(
2281
+ Zo,
2281
2282
  {
2282
2283
  isSingle: !0,
2283
2284
  ...e,
2284
- onFocusChange: (b, I) => {
2285
- p(b), d == null || d(b, I);
2285
+ onFocusChange: (E, I) => {
2286
+ v(E), d == null || d(E, I);
2286
2287
  },
2287
2288
  editorRef: n,
2288
2289
  onClickOutside: () => {
2289
- p(!1), M(), u == null || u();
2290
+ v(!1), M(), u == null || u();
2290
2291
  },
2291
- icon: /* @__PURE__ */ O(ms, { title: N.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ O(_r, { className: "univer-cursor-pointer", onClick: E }) })
2292
+ icon: /* @__PURE__ */ O(Ss, { title: N.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ O(
2293
+ Er,
2294
+ {
2295
+ className: "univer-cursor-pointer dark:!univer-text-gray-300",
2296
+ onClick: b
2297
+ }
2298
+ ) })
2292
2299
  }
2293
2300
  ),
2294
2301
  /* @__PURE__ */ O(
2295
- Ii,
2302
+ Ti,
2296
2303
  {
2297
2304
  initialValue: C,
2298
2305
  unitId: s,
2299
2306
  subUnitId: c,
2300
2307
  visible: _,
2301
2308
  maxRangeCount: i,
2302
- onConfirm: (b) => {
2303
- const I = Ti(b), A = Kr.newEmptyData();
2309
+ onConfirm: (E) => {
2310
+ const I = Oi(E), A = Gr.newEmptyData();
2304
2311
  A.body.dataStream = I, t == null || t.replaceText(I, !1), h == null || h(A, I), R(!1), y([]), requestAnimationFrame(() => {
2305
2312
  M();
2306
2313
  });
@@ -2308,15 +2315,15 @@ function yr(e) {
2308
2315
  onClose: () => {
2309
2316
  R(!1), y([]);
2310
2317
  },
2311
- supportAcrossSheet: a,
2312
- onShowBySelection: (b) => S || l ? (y(b), R(!0), !1) : !0
2318
+ supportAcrossSheet: l,
2319
+ onShowBySelection: (E) => p || a ? (y(E), R(!0), !1) : !0
2313
2320
  }
2314
2321
  )
2315
2322
  ] });
2316
2323
  }
2317
- class Tr {
2324
+ class Or {
2318
2325
  constructor() {
2319
- j(this, "_currentSelector$", new Zn(null));
2326
+ j(this, "_currentSelector$", new tr(null));
2320
2327
  j(this, "currentSelector$", this._currentSelector$.asObservable());
2321
2328
  }
2322
2329
  showRangeSelectorDialog(t) {
@@ -2328,56 +2335,56 @@ class Tr {
2328
2335
  return this._currentSelector$.next(t), o;
2329
2336
  }
2330
2337
  }
2331
- var xi = Object.getOwnPropertyDescriptor, Oi = (e, t, n, o) => {
2332
- for (var r = o > 1 ? void 0 : o ? xi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2338
+ var Ni = Object.getOwnPropertyDescriptor, Mi = (e, t, n, o) => {
2339
+ for (var r = o > 1 ? void 0 : o ? Ni(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2333
2340
  (c = e[s]) && (r = c(r) || r);
2334
2341
  return r;
2335
- }, _t = (e, t) => (n, o) => t(n, o, e);
2336
- let yt = class extends nt {
2342
+ }, Ot = (e, t) => (n, o) => t(n, o, e);
2343
+ let kt = class extends lt {
2337
2344
  constructor(e, t, n, o) {
2338
2345
  super(), this._sheetInterceptorService = e, this._univerInstanceService = t, this._formulaDataModel = n, this._lexerTreeBuilder = o, this._initialize();
2339
2346
  }
2340
2347
  _initialize() {
2341
2348
  this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
2342
- getMutations: (e) => e.id === Xo.id ? this._reorderFormula(e.params) : {
2349
+ getMutations: (e) => e.id === es.id ? this._reorderFormula(e.params) : {
2343
2350
  redos: [],
2344
2351
  undos: []
2345
2352
  }
2346
2353
  }));
2347
2354
  }
2348
2355
  _reorderFormula(e) {
2349
- const t = [], n = [], { unitId: o, subUnitId: r, range: s, order: c } = e, i = this._univerInstanceService.getUniverSheetInstance(o), a = i == null ? void 0 : i.getSheetBySheetId(r);
2350
- if (!a)
2356
+ const t = [], n = [], { unitId: o, subUnitId: r, range: s, order: c } = e, i = this._univerInstanceService.getUniverSheetInstance(o), l = i == null ? void 0 : i.getSheetBySheetId(r);
2357
+ if (!l)
2351
2358
  return {
2352
2359
  redos: t,
2353
2360
  undos: n
2354
2361
  };
2355
- const f = a.getCellMatrix(), h = new ke(), m = new ke();
2362
+ const f = l.getCellMatrix(), h = new Fe(), m = new Fe();
2356
2363
  let u = !1;
2357
- return Yr.foreach(s, (d, l) => {
2358
- let v = d;
2359
- c.hasOwnProperty(d) && (v = c[d]);
2360
- const g = f.getValue(v, l);
2364
+ return zr.foreach(s, (d, a) => {
2365
+ let S = d;
2366
+ c.hasOwnProperty(d) && (S = c[d]);
2367
+ const g = f.getValue(S, a);
2361
2368
  if (g != null && g.f || g != null && g.si) {
2362
2369
  u = !0;
2363
- const S = this._formulaDataModel.getFormulaStringByCell(v, l, r, o), p = this._lexerTreeBuilder.moveFormulaRefOffset(
2364
- S,
2370
+ const p = this._formulaDataModel.getFormulaStringByCell(S, a, r, o), v = this._lexerTreeBuilder.moveFormulaRefOffset(
2371
+ p,
2365
2372
  0,
2366
- d - v
2367
- ), _ = Je.deepClone(g);
2368
- _.f = p, _.si = null, h.setValue(d, l, _);
2373
+ d - S
2374
+ ), _ = it.deepClone(g);
2375
+ _.f = v, _.si = null, h.setValue(d, a, _);
2369
2376
  } else
2370
- h.setValue(d, l, g);
2371
- m.setValue(d, l, f.getValue(d, l));
2377
+ h.setValue(d, a, g);
2378
+ m.setValue(d, a, f.getValue(d, a));
2372
2379
  }), u ? (t.push({
2373
- id: bt.id,
2380
+ id: Mt.id,
2374
2381
  params: {
2375
2382
  unitId: o,
2376
2383
  subUnitId: r,
2377
2384
  cellValue: h.getMatrix()
2378
2385
  }
2379
2386
  }), n.push({
2380
- id: bt.id,
2387
+ id: Mt.id,
2381
2388
  params: {
2382
2389
  unitId: o,
2383
2390
  subUnitId: r,
@@ -2392,25 +2399,25 @@ let yt = class extends nt {
2392
2399
  };
2393
2400
  }
2394
2401
  };
2395
- yt = Oi([
2396
- _t(0, B(nn)),
2397
- _t(1, B(ee)),
2398
- _t(2, B(gt)),
2399
- _t(3, B(Ce))
2400
- ], yt);
2401
- const Ni = "sheets-formula-ui.base.config", Pn = {};
2402
- function Mi(e) {
2403
- return e.getContextValue(Gr) && e.getContextValue(zr);
2404
- }
2405
- function xr(e, t = !1) {
2406
- return !t && !(Ie(e == null ? void 0 : e.f) || He(e == null ? void 0 : e.si)) ? null : typeof (e == null ? void 0 : e.v) == "string" && Mo.has(e.v) ? e.v : null;
2407
- }
2408
- var wi = Object.getOwnPropertyDescriptor, Ai = (e, t, n, o) => {
2409
- for (var r = o > 1 ? void 0 : o ? wi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2402
+ kt = Mi([
2403
+ Ot(0, B(dn)),
2404
+ Ot(1, B(ee)),
2405
+ Ot(2, B(Et)),
2406
+ Ot(3, B(_e))
2407
+ ], kt);
2408
+ const wi = "sheets-formula-ui.base.config", Bn = {};
2409
+ function Ai(e) {
2410
+ return e.getContextValue(Zr) && e.getContextValue(Xr);
2411
+ }
2412
+ function Nr(e, t = !1) {
2413
+ return !t && !(ye(e == null ? void 0 : e.f) || Be(e == null ? void 0 : e.si)) ? null : typeof (e == null ? void 0 : e.v) == "string" && ko.has(e.v) ? e.v : null;
2414
+ }
2415
+ var ki = Object.getOwnPropertyDescriptor, Fi = (e, t, n, o) => {
2416
+ for (var r = o > 1 ? void 0 : o ? ki(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2410
2417
  (c = e[s]) && (r = c(r) || r);
2411
2418
  return r;
2412
- }, it = (e, t) => (n, o) => t(n, o, e);
2413
- const Ht = "SHEET_FORMULA_ALERT", ki = {
2419
+ }, gt = (e, t) => (n, o) => t(n, o, e);
2420
+ const Zt = "SHEET_FORMULA_ALERT", Di = {
2414
2421
  [ie.DIV_BY_ZERO]: "divByZero",
2415
2422
  [ie.NAME]: "name",
2416
2423
  [ie.VALUE]: "value",
@@ -2424,7 +2431,7 @@ const Ht = "SHEET_FORMULA_ALERT", ki = {
2424
2431
  [ie.CONNECT]: "connect",
2425
2432
  [ie.NULL]: "null"
2426
2433
  };
2427
- let Gt = class extends nt {
2434
+ let nn = class extends lt {
2428
2435
  constructor(e, t, n, o, r, s) {
2429
2436
  super(), this._context = e, this._hoverManagerService = t, this._cellAlertManagerService = n, this._localeService = o, this._formulaDataModel = r, this._zenZoneService = s, this._init();
2430
2437
  }
@@ -2432,29 +2439,29 @@ let Gt = class extends nt {
2432
2439
  this._initCellAlertPopup(), this._initZenService();
2433
2440
  }
2434
2441
  _initCellAlertPopup() {
2435
- this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(Jt(100)).subscribe((e) => {
2442
+ this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(an(100)).subscribe((e) => {
2436
2443
  var t, n, o, r, s;
2437
2444
  if (e) {
2438
2445
  const i = this._context.unit.getActiveSheet();
2439
2446
  if (!i) return;
2440
- const a = i.getCell(e.location.row, e.location.col), f = (r = (o = (n = (t = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : t[e.location.unitId]) == null ? void 0 : n[e.location.subUnitId]) == null ? void 0 : o[e.location.row]) == null ? void 0 : r[e.location.col];
2441
- if (Zr(a)) {
2442
- const h = xr(a, !!f);
2447
+ const l = i.getCell(e.location.row, e.location.col), f = (r = (o = (n = (t = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : t[e.location.unitId]) == null ? void 0 : n[e.location.subUnitId]) == null ? void 0 : o[e.location.row]) == null ? void 0 : r[e.location.col];
2448
+ if (Qr(l)) {
2449
+ const h = Nr(l, !!f);
2443
2450
  if (!h) {
2444
2451
  this._hideAlert();
2445
2452
  return;
2446
2453
  }
2447
- const m = this._cellAlertManagerService.currentAlert.get(Ht), u = (s = m == null ? void 0 : m.alert) == null ? void 0 : s.location;
2454
+ const m = this._cellAlertManagerService.currentAlert.get(Zt), u = (s = m == null ? void 0 : m.alert) == null ? void 0 : s.location;
2448
2455
  if (u && u.row === e.location.row && u.col === e.location.col && u.subUnitId === e.location.subUnitId && u.unitId === e.location.unitId)
2449
2456
  return;
2450
2457
  this._cellAlertManagerService.showAlert({
2451
- type: mo.ERROR,
2458
+ type: So.ERROR,
2452
2459
  title: this._localeService.t("formula.error.title"),
2453
- message: this._localeService.t(`formula.error.${ki[h]}`),
2460
+ message: this._localeService.t(`formula.error.${Di[h]}`),
2454
2461
  location: e.location,
2455
2462
  width: 200,
2456
2463
  height: 74,
2457
- key: Ht
2464
+ key: Zt
2458
2465
  });
2459
2466
  return;
2460
2467
  }
@@ -2468,33 +2475,33 @@ let Gt = class extends nt {
2468
2475
  }));
2469
2476
  }
2470
2477
  _hideAlert() {
2471
- this._cellAlertManagerService.removeAlert(Ht);
2478
+ this._cellAlertManagerService.removeAlert(Zt);
2472
2479
  }
2473
2480
  };
2474
- Gt = Ai([
2475
- it(1, B(fo)),
2476
- it(2, B(go)),
2477
- it(3, B(tt)),
2478
- it(4, B(gt)),
2479
- it(5, cs)
2480
- ], Gt);
2481
- var Fi = Object.getOwnPropertyDescriptor, Di = (e, t, n, o) => {
2482
- for (var r = o > 1 ? void 0 : o ? Fi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2481
+ nn = Fi([
2482
+ gt(1, B(mo)),
2483
+ gt(2, B(po)),
2484
+ gt(3, B(at)),
2485
+ gt(4, B(Et)),
2486
+ gt(5, ds)
2487
+ ], nn);
2488
+ var Li = Object.getOwnPropertyDescriptor, $i = (e, t, n, o) => {
2489
+ for (var r = o > 1 ? void 0 : o ? Li(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2483
2490
  (c = e[s]) && (r = c(r) || r);
2484
2491
  return r;
2485
- }, $n = (e, t) => (n, o) => t(n, o, e);
2486
- let Tt = class extends nt {
2492
+ }, jn = (e, t) => (n, o) => t(n, o, e);
2493
+ let Ft = class extends lt {
2487
2494
  constructor(e, t) {
2488
2495
  super(), this._autoFillService = e, this._lexerTreeBuilder = t, this._registerAutoFill();
2489
2496
  }
2490
2497
  _registerAutoFill() {
2491
2498
  const e = {
2492
- type: In.FORMULA,
2499
+ type: Nn.FORMULA,
2493
2500
  priority: 1001,
2494
- match: (t) => Ie(t == null ? void 0 : t.f) || He(t == null ? void 0 : t.si),
2495
- isContinue: (t, n) => t.type === In.FORMULA,
2501
+ match: (t) => ye(t == null ? void 0 : t.f) || Be(t == null ? void 0 : t.si),
2502
+ isContinue: (t, n) => t.type === Nn.FORMULA,
2496
2503
  applyFunctions: {
2497
- [vo.COPY]: (t, n, o, r, s) => {
2504
+ [Co.COPY]: (t, n, o, r, s) => {
2498
2505
  const { data: c, index: i } = t;
2499
2506
  return this._fillCopyFormula(c, n, o, i, r, s);
2500
2507
  }
@@ -2504,49 +2511,49 @@ let Tt = class extends nt {
2504
2511
  }
2505
2512
  _fillCopyFormula(e, t, n, o, r, s) {
2506
2513
  var f, h;
2507
- const c = Pi(r), i = [], a = /* @__PURE__ */ new Map();
2514
+ const c = Ui(r), i = [], l = /* @__PURE__ */ new Map();
2508
2515
  for (let m = 1; m <= t; m++) {
2509
- const u = (m - 1) % e.length, d = o[u], l = Je.deepClone(e[u]);
2510
- if (l) {
2511
- const v = ((f = e[u]) == null ? void 0 : f.f) || "", g = ((h = e[u]) == null ? void 0 : h.si) || "", S = Ie(v);
2512
- if (He(g))
2513
- l.si = g, l.f = null, l.v = null, l.p = null, l.t = null, i.push(l);
2514
- else if (S) {
2515
- let _ = a.get(u);
2516
+ const u = (m - 1) % e.length, d = o[u], a = it.deepClone(e[u]);
2517
+ if (a) {
2518
+ const S = ((f = e[u]) == null ? void 0 : f.f) || "", g = ((h = e[u]) == null ? void 0 : h.si) || "", p = ye(S);
2519
+ if (Be(g))
2520
+ a.si = g, a.f = null, a.v = null, a.p = null, a.t = null, i.push(a);
2521
+ else if (p) {
2522
+ let _ = l.get(u);
2516
2523
  if (_)
2517
- l.si = _, l.f = null, l.v = null, l.p = null, l.t = null;
2524
+ a.si = _, a.f = null, a.v = null, a.p = null, a.t = null;
2518
2525
  else {
2519
- _ = Je.generateRandomId(6), a.set(u, _);
2520
- const { offsetX: R, offsetY: C } = Li(c, t, n, s, d), y = this._lexerTreeBuilder.moveFormulaRefOffset(
2521
- v,
2526
+ _ = it.generateRandomId(6), l.set(u, _);
2527
+ const { offsetX: R, offsetY: C } = Pi(c, t, n, s, d), y = this._lexerTreeBuilder.moveFormulaRefOffset(
2528
+ S,
2522
2529
  R,
2523
2530
  C
2524
2531
  );
2525
- l.si = _, l.f = y, l.v = null, l.p = null, l.t = null;
2532
+ a.si = _, a.f = y, a.v = null, a.p = null, a.t = null;
2526
2533
  }
2527
- i.push(l);
2534
+ i.push(a);
2528
2535
  }
2529
2536
  }
2530
2537
  }
2531
2538
  return i;
2532
2539
  }
2533
2540
  };
2534
- Tt = Di([
2535
- $n(0, So),
2536
- $n(1, B(Ce))
2537
- ], Tt);
2538
- function Li(e, t, n, o, r) {
2539
- const { source: s, target: c } = o, { rows: i } = c, { rows: a } = s;
2541
+ Ft = $i([
2542
+ jn(0, vo),
2543
+ jn(1, B(_e))
2544
+ ], Ft);
2545
+ function Pi(e, t, n, o, r) {
2546
+ const { source: s, target: c } = o, { rows: i } = c, { rows: l } = s;
2540
2547
  let f = 0, h = 0;
2541
2548
  switch (n) {
2542
2549
  case ce.UP:
2543
- h = i[r] - a[r];
2550
+ h = i[r] - l[r];
2544
2551
  break;
2545
2552
  case ce.RIGHT:
2546
2553
  f = e;
2547
2554
  break;
2548
2555
  case ce.DOWN:
2549
- h = i[r] - a[r];
2556
+ h = i[r] - l[r];
2550
2557
  break;
2551
2558
  case ce.LEFT:
2552
2559
  f = -e * t;
@@ -2554,7 +2561,7 @@ function Li(e, t, n, o, r) {
2554
2561
  }
2555
2562
  return { offsetX: f, offsetY: h };
2556
2563
  }
2557
- function Pi(e) {
2564
+ function Ui(e) {
2558
2565
  let t = 0;
2559
2566
  for (const n in e)
2560
2567
  e[n].forEach((o) => {
@@ -2562,13 +2569,13 @@ function Pi(e) {
2562
2569
  });
2563
2570
  return t;
2564
2571
  }
2565
- var $i = Object.getOwnPropertyDescriptor, Ui = (e, t, n, o) => {
2566
- for (var r = o > 1 ? void 0 : o ? $i(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2572
+ var Vi = Object.getOwnPropertyDescriptor, Wi = (e, t, n, o) => {
2573
+ for (var r = o > 1 ? void 0 : o ? Vi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2567
2574
  (c = e[s]) && (r = c(r) || r);
2568
2575
  return r;
2569
- }, ct = (e, t) => (n, o) => t(n, o, e);
2570
- const Vi = "default-paste-formula";
2571
- let xt = class extends nt {
2576
+ }, mt = (e, t) => (n, o) => t(n, o, e);
2577
+ const Hi = "default-paste-formula";
2578
+ let Dt = class extends lt {
2572
2579
  constructor(e, t, n, o, r) {
2573
2580
  super(), this._currentUniverSheet = e, this._lexerTreeBuilder = t, this._sheetClipboardService = n, this._injector = o, this._formulaDataModel = r, this._initialize();
2574
2581
  }
@@ -2580,7 +2587,7 @@ let xt = class extends nt {
2580
2587
  }
2581
2588
  _pasteFormulaHook() {
2582
2589
  return {
2583
- id: Xe.SPECIAL_PASTE_FORMULA,
2590
+ id: ot.SPECIAL_PASTE_FORMULA,
2584
2591
  priority: 10,
2585
2592
  specialPasteInfo: { label: "specialPaste.formula" },
2586
2593
  onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !0)
@@ -2588,7 +2595,7 @@ let xt = class extends nt {
2588
2595
  }
2589
2596
  _pasteWithFormulaHook() {
2590
2597
  return {
2591
- id: Vi,
2598
+ id: Hi,
2592
2599
  priority: 10,
2593
2600
  onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !1)
2594
2601
  };
@@ -2596,27 +2603,27 @@ let xt = class extends nt {
2596
2603
  _onPasteCells(e, t, n, o, r) {
2597
2604
  var u;
2598
2605
  if ([
2599
- Xe.SPECIAL_PASTE_FORMAT,
2600
- Xe.SPECIAL_PASTE_COL_WIDTH
2606
+ ot.SPECIAL_PASTE_FORMAT,
2607
+ ot.SPECIAL_PASTE_COL_WIDTH
2601
2608
  ].includes(o.pasteType))
2602
2609
  return {
2603
2610
  undos: [],
2604
2611
  redos: []
2605
2612
  };
2606
- const c = this._currentUniverSheet.getCurrentUnitForType(J.UNIVER_SHEET), i = t.unitId || c.getUnitId(), a = t.subUnitId || ((u = c.getActiveSheet()) == null ? void 0 : u.getSheetId());
2607
- if (!i || !a)
2613
+ const c = this._currentUniverSheet.getCurrentUnitForType(q.UNIVER_SHEET), i = t.unitId || c.getUnitId(), l = t.subUnitId || ((u = c.getActiveSheet()) == null ? void 0 : u.getSheetId());
2614
+ if (!i || !l)
2608
2615
  return {
2609
2616
  undos: [],
2610
2617
  redos: []
2611
2618
  };
2612
2619
  const f = t.range, h = n, m = {
2613
- copyType: o.copyType || Yn.COPY,
2620
+ copyType: o.copyType || Jn.COPY,
2614
2621
  copyRange: e == null ? void 0 : e.range,
2615
2622
  pasteType: o.pasteType
2616
2623
  };
2617
- return this._injector.invoke((d) => Wi(
2624
+ return this._injector.invoke((d) => Bi(
2618
2625
  i,
2619
- a,
2626
+ l,
2620
2627
  f,
2621
2628
  h,
2622
2629
  d,
@@ -2628,15 +2635,15 @@ let xt = class extends nt {
2628
2635
  ));
2629
2636
  }
2630
2637
  };
2631
- xt = Ui([
2632
- ct(0, ee),
2633
- ct(1, B(Ce)),
2634
- ct(2, po),
2635
- ct(3, B(dt)),
2636
- ct(4, B(gt))
2637
- ], xt);
2638
- function Wi(e, t, n, o, r, s, c, i, a = !1, f) {
2639
- const h = [], m = [], u = Hi(e, t, n, o, s, c, i, f);
2638
+ Dt = Wi([
2639
+ mt(0, ee),
2640
+ mt(1, B(_e)),
2641
+ mt(2, _o),
2642
+ mt(3, B(Ct)),
2643
+ mt(4, B(Et))
2644
+ ], Dt);
2645
+ function Bi(e, t, n, o, r, s, c, i, l = !1, f) {
2646
+ const h = [], m = [], u = ji(e, t, n, o, s, c, i, f);
2640
2647
  if (!u.hasValue())
2641
2648
  return {
2642
2649
  undos: [],
@@ -2648,112 +2655,112 @@ function Wi(e, t, n, o, r, s, c, i, a = !1, f) {
2648
2655
  cellValue: u.getData()
2649
2656
  };
2650
2657
  h.push({
2651
- id: bt.id,
2658
+ id: Mt.id,
2652
2659
  params: d
2653
2660
  });
2654
- const l = Qo(
2661
+ const a = ts(
2655
2662
  r,
2656
2663
  d
2657
2664
  );
2658
2665
  return m.push({
2659
- id: bt.id,
2660
- params: l
2666
+ id: Mt.id,
2667
+ params: a
2661
2668
  }), {
2662
2669
  undos: m,
2663
2670
  redos: h
2664
2671
  };
2665
2672
  }
2666
- function Hi(e, t, n, o, r, s, c, i) {
2667
- return i ? r.pasteType === Xe.SPECIAL_PASTE_VALUE ? ji(e, t, n, o, c, i) : r.pasteType === Xe.SPECIAL_PASTE_FORMULA ? qi(e, t, n, o, s, c, i) : Ki(e, t, n, o, r.copyType, s, c, i) : Bi(e, t, n, o, c);
2673
+ function ji(e, t, n, o, r, s, c, i) {
2674
+ return i ? r.pasteType === ot.SPECIAL_PASTE_VALUE ? Ki(e, t, n, o, c, i) : r.pasteType === ot.SPECIAL_PASTE_FORMULA ? Yi(e, t, n, o, s, c, i) : Gi(e, t, n, o, r.copyType, s, c, i) : qi(e, t, n, o, c);
2668
2675
  }
2669
- function Bi(e, t, n, o, r) {
2670
- const s = new ke(), c = r.getSheetFormulaData(e, t);
2671
- return o.forValue((i, a, f) => {
2676
+ function qi(e, t, n, o, r) {
2677
+ const s = new Fe(), c = r.getSheetFormulaData(e, t);
2678
+ return o.forValue((i, l, f) => {
2672
2679
  var d;
2673
- const h = n.rows[i], m = n.cols[a], u = {};
2674
- Ie(f.v) ? (u.v = null, u.f = `${f.v}`, u.si = null, u.p = null, s.setValue(h, m, u)) : (d = c == null ? void 0 : c[h]) != null && d[m] && (u.v = f.v, u.f = null, u.si = null, u.p = null, s.setValue(h, m, u));
2680
+ const h = n.rows[i], m = n.cols[l], u = {};
2681
+ ye(f.v) ? (u.v = null, u.f = `${f.v}`, u.si = null, u.p = null, s.setValue(h, m, u)) : (d = c == null ? void 0 : c[h]) != null && d[m] && (u.v = f.v, u.f = null, u.si = null, u.p = null, s.setValue(h, m, u));
2675
2682
  }), s;
2676
2683
  }
2677
- function ji(e, t, n, o, r, s) {
2684
+ function Ki(e, t, n, o, r, s) {
2678
2685
  var f, h;
2679
- const c = new ke(), i = (h = (f = r.getArrayFormulaCellData()) == null ? void 0 : f[s.unitId]) == null ? void 0 : h[s.subUnitId], a = r.getSheetFormulaData(e, t);
2686
+ const c = new Fe(), i = (h = (f = r.getArrayFormulaCellData()) == null ? void 0 : f[s.unitId]) == null ? void 0 : h[s.subUnitId], l = r.getSheetFormulaData(e, t);
2680
2687
  return o.forValue((m, u, d) => {
2681
2688
  var _, R;
2682
- const l = s.range.rows[m % s.range.rows.length], v = s.range.cols[u % s.range.cols.length], g = n.rows[m], S = n.cols[u], p = {};
2683
- if (Ie(d.f) || He(d.si))
2684
- p.v = d.v, p.f = null, p.si = null, p.p = null, c.setValue(g, S, p);
2685
- else if ((_ = i == null ? void 0 : i[l]) != null && _[v]) {
2686
- const C = i[l][v];
2687
- p.v = C.v, p.f = null, p.si = null, p.p = null, c.setValue(g, S, p);
2688
- } else if ((R = a == null ? void 0 : a[g]) != null && R[S]) {
2689
- if (p.v = d.v, p.f = null, p.si = null, p.p = null, d.p) {
2690
- const C = Or(d);
2691
- C && (p.v = C);
2689
+ const a = s.range.rows[m % s.range.rows.length], S = s.range.cols[u % s.range.cols.length], g = n.rows[m], p = n.cols[u], v = {};
2690
+ if (ye(d.f) || Be(d.si))
2691
+ v.v = d.v, v.f = null, v.si = null, v.p = null, c.setValue(g, p, v);
2692
+ else if ((_ = i == null ? void 0 : i[a]) != null && _[S]) {
2693
+ const C = i[a][S];
2694
+ v.v = C.v, v.f = null, v.si = null, v.p = null, c.setValue(g, p, v);
2695
+ } else if ((R = l == null ? void 0 : l[g]) != null && R[p]) {
2696
+ if (v.v = d.v, v.f = null, v.si = null, v.p = null, d.p) {
2697
+ const C = Mr(d);
2698
+ C && (v.v = C);
2692
2699
  }
2693
- c.setValue(g, S, p);
2700
+ c.setValue(g, p, v);
2694
2701
  }
2695
2702
  }), c;
2696
2703
  }
2697
- function qi(e, t, n, o, r, s, c) {
2698
- const i = new ke(), a = /* @__PURE__ */ new Map();
2704
+ function Yi(e, t, n, o, r, s, c) {
2705
+ const i = new Fe(), l = /* @__PURE__ */ new Map();
2699
2706
  return o.forValue((f, h, m) => {
2700
- const u = n.rows[f], d = n.cols[h], l = {};
2701
- if (He(m.si)) {
2707
+ const u = n.rows[f], d = n.cols[h], a = {};
2708
+ if (Be(m.si)) {
2702
2709
  if (c.unitId !== e || c.subUnitId !== t) {
2703
- const v = s.getFormulaStringByCell(
2710
+ const S = s.getFormulaStringByCell(
2704
2711
  c.range.rows[f % c.range.rows.length],
2705
2712
  c.range.cols[h % c.range.cols.length],
2706
2713
  c.subUnitId,
2707
2714
  c.unitId
2708
- ), g = n.cols[h] - c.range.cols[h % c.range.cols.length], S = n.rows[f] - c.range.rows[f % c.range.rows.length], p = r.moveFormulaRefOffset(v || "", g, S);
2709
- l.si = null, l.f = p;
2715
+ ), g = n.cols[h] - c.range.cols[h % c.range.cols.length], p = n.rows[f] - c.range.rows[f % c.range.rows.length], v = r.moveFormulaRefOffset(S || "", g, p);
2716
+ a.si = null, a.f = v;
2710
2717
  } else
2711
- l.si = m.si, l.f = null;
2712
- l.v = null, l.p = null, i.setValue(u, d, l);
2713
- } else if (Ie(m.f)) {
2714
- const v = `${f % c.range.rows.length}_${h % c.range.cols.length}`;
2715
- let g = a.get(v);
2718
+ a.si = m.si, a.f = null;
2719
+ a.v = null, a.p = null, i.setValue(u, d, a);
2720
+ } else if (ye(m.f)) {
2721
+ const S = `${f % c.range.rows.length}_${h % c.range.cols.length}`;
2722
+ let g = l.get(S);
2716
2723
  if (g)
2717
- l.si = g, l.f = null;
2724
+ a.si = g, a.f = null;
2718
2725
  else {
2719
- g = Je.generateRandomId(6), a.set(v, g);
2720
- const S = n.cols[h] - c.range.cols[h % c.range.cols.length], p = n.rows[f] - c.range.rows[f % c.range.rows.length], _ = r.moveFormulaRefOffset(m.f || "", S, p);
2721
- l.si = g, l.f = _;
2726
+ g = it.generateRandomId(6), l.set(S, g);
2727
+ const p = n.cols[h] - c.range.cols[h % c.range.cols.length], v = n.rows[f] - c.range.rows[f % c.range.rows.length], _ = r.moveFormulaRefOffset(m.f || "", p, v);
2728
+ a.si = g, a.f = _;
2722
2729
  }
2723
- l.v = null, l.p = null, i.setValue(u, d, l);
2730
+ a.v = null, a.p = null, i.setValue(u, d, a);
2724
2731
  } else {
2725
- if (l.v = m.v, l.f = null, l.si = null, l.p = null, m.p) {
2726
- const v = Or(m);
2727
- v && (l.v = v);
2732
+ if (a.v = m.v, a.f = null, a.si = null, a.p = null, m.p) {
2733
+ const S = Mr(m);
2734
+ S && (a.v = S);
2728
2735
  }
2729
- i.setValue(u, d, l);
2736
+ i.setValue(u, d, a);
2730
2737
  }
2731
2738
  }), i;
2732
2739
  }
2733
- function Ki(e, t, n, o, r, s, c, i) {
2734
- const a = new ke(), f = /* @__PURE__ */ new Map(), h = c.getSheetFormulaData(e, t), m = [];
2735
- return r === Yn.CUT ? o.forValue((u, d, l) => {
2736
- const v = n.rows[u], g = n.cols[d], S = {};
2737
- if (He(l.si)) {
2738
- if (Ie(l.f))
2739
- m.push(l.si), S.f = l.f, S.si = l.si;
2740
- else if (m.includes(l.si))
2741
- S.f = null, S.si = l.si;
2740
+ function Gi(e, t, n, o, r, s, c, i) {
2741
+ const l = new Fe(), f = /* @__PURE__ */ new Map(), h = c.getSheetFormulaData(e, t), m = [];
2742
+ return r === Jn.CUT ? o.forValue((u, d, a) => {
2743
+ const S = n.rows[u], g = n.cols[d], p = {};
2744
+ if (Be(a.si)) {
2745
+ if (ye(a.f))
2746
+ m.push(a.si), p.f = a.f, p.si = a.si;
2747
+ else if (m.includes(a.si))
2748
+ p.f = null, p.si = a.si;
2742
2749
  else {
2743
- const p = c.getFormulaStringByCell(
2750
+ const v = c.getFormulaStringByCell(
2744
2751
  i.range.rows[u % i.range.rows.length],
2745
2752
  i.range.cols[d % i.range.cols.length],
2746
2753
  i.subUnitId,
2747
2754
  i.unitId
2748
2755
  );
2749
- S.f = p, S.si = null;
2756
+ p.f = v, p.si = null;
2750
2757
  }
2751
- S.v = null, S.p = null, a.setValue(v, g, S);
2752
- } else Ie(l.f) && (S.f = l.f, S.si = null, S.v = null, S.p = null, a.setValue(v, g, S));
2753
- }) : o.forValue((u, d, l) => {
2754
- var p;
2755
- const v = n.rows[u], g = n.cols[d], S = {};
2756
- if (He(l.si)) {
2758
+ p.v = null, p.p = null, l.setValue(S, g, p);
2759
+ } else ye(a.f) && (p.f = a.f, p.si = null, p.v = null, p.p = null, l.setValue(S, g, p));
2760
+ }) : o.forValue((u, d, a) => {
2761
+ var v;
2762
+ const S = n.rows[u], g = n.cols[d], p = {};
2763
+ if (Be(a.si)) {
2757
2764
  if (i.unitId !== e || i.subUnitId !== t) {
2758
2765
  const _ = c.getFormulaStringByCell(
2759
2766
  i.range.rows[u % i.range.rows.length],
@@ -2761,59 +2768,59 @@ function Ki(e, t, n, o, r, s, c, i) {
2761
2768
  i.subUnitId,
2762
2769
  i.unitId
2763
2770
  ), R = n.cols[d] - i.range.cols[d % i.range.cols.length], C = n.rows[u] - i.range.rows[u % i.range.rows.length], y = s.moveFormulaRefOffset(_ || "", R, C);
2764
- S.si = null, S.f = y;
2771
+ p.si = null, p.f = y;
2765
2772
  } else
2766
- S.si = l.si, S.f = null;
2767
- S.v = null, S.p = null, a.setValue(v, g, S);
2768
- } else if (Ie(l.f)) {
2773
+ p.si = a.si, p.f = null;
2774
+ p.v = null, p.p = null, l.setValue(S, g, p);
2775
+ } else if (ye(a.f)) {
2769
2776
  const _ = `${u % i.range.rows.length}_${d % i.range.cols.length}`;
2770
2777
  let R = f.get(_);
2771
2778
  if (R)
2772
- S.si = R, S.f = null;
2779
+ p.si = R, p.f = null;
2773
2780
  else {
2774
- R = Je.generateRandomId(6), f.set(_, R);
2775
- const C = n.cols[d] - i.range.cols[d % i.range.cols.length], y = n.rows[u] - i.range.rows[u % i.range.rows.length], N = s.moveFormulaRefOffset(l.f || "", C, y);
2776
- S.si = R, S.f = N;
2781
+ R = it.generateRandomId(6), f.set(_, R);
2782
+ const C = n.cols[d] - i.range.cols[d % i.range.cols.length], y = n.rows[u] - i.range.rows[u % i.range.rows.length], N = s.moveFormulaRefOffset(a.f || "", C, y);
2783
+ p.si = R, p.f = N;
2777
2784
  }
2778
- S.v = null, S.p = null, a.setValue(v, g, S);
2779
- } else (p = h == null ? void 0 : h[v]) != null && p[g] && (S.v = l.v, S.f = null, S.si = null, S.p = l.p, a.setValue(v, g, S));
2780
- }), m.length > 0 && new ke(h).forValue((u, d, l) => {
2781
- if (!(i.range.rows.includes(u) && i.range.cols.includes(d)) && !(n.rows.includes(u) && n.cols.includes(d)) && m.includes(l == null ? void 0 : l.si)) {
2782
- const v = c.getFormulaStringByCell(
2785
+ p.v = null, p.p = null, l.setValue(S, g, p);
2786
+ } else (v = h == null ? void 0 : h[S]) != null && v[g] && (p.v = a.v, p.f = null, p.si = null, p.p = a.p, l.setValue(S, g, p));
2787
+ }), m.length > 0 && new Fe(h).forValue((u, d, a) => {
2788
+ if (!(i.range.rows.includes(u) && i.range.cols.includes(d)) && !(n.rows.includes(u) && n.cols.includes(d)) && m.includes(a == null ? void 0 : a.si)) {
2789
+ const S = c.getFormulaStringByCell(
2783
2790
  u,
2784
2791
  d,
2785
2792
  i.subUnitId,
2786
2793
  i.unitId
2787
2794
  );
2788
- a.setValue(u, d, {
2789
- f: v,
2795
+ l.setValue(u, d, {
2796
+ f: S,
2790
2797
  si: null,
2791
2798
  v: null,
2792
2799
  p: null
2793
2800
  });
2794
2801
  }
2795
- }), a;
2802
+ }), l;
2796
2803
  }
2797
- function Or(e) {
2804
+ function Mr(e) {
2798
2805
  if (e != null && e.p) {
2799
2806
  const t = e == null ? void 0 : e.p.body;
2800
2807
  if (t == null)
2801
2808
  return;
2802
2809
  const n = t.dataStream;
2803
- return n.substring(n.length - 2, n.length) === Hn ? n.substring(0, n.length - 2) : n;
2810
+ return n.substring(n.length - 2, n.length) === Gn ? n.substring(0, n.length - 2) : n;
2804
2811
  }
2805
2812
  }
2806
- var Yi = Object.getOwnPropertyDescriptor, Gi = (e, t, n, o) => {
2807
- for (var r = o > 1 ? void 0 : o ? Yi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2813
+ var zi = Object.getOwnPropertyDescriptor, Zi = (e, t, n, o) => {
2814
+ for (var r = o > 1 ? void 0 : o ? zi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2808
2815
  (c = e[s]) && (r = c(r) || r);
2809
2816
  return r;
2810
- }, Ue = (e, t) => (n, o) => t(n, o, e);
2811
- let Ot = class extends nt {
2812
- constructor(t, n, o, r, s, c, i, a) {
2817
+ }, Ve = (e, t) => (n, o) => t(n, o, e);
2818
+ let Lt = class extends lt {
2819
+ constructor(t, n, o, r, s, c, i, l) {
2813
2820
  super();
2814
2821
  j(this, "_previousShape");
2815
2822
  j(this, "_skeleton");
2816
- this._context = t, this._sheetInterceptorService = n, this._formulaDataModel = o, this._themeService = r, this._renderManagerService = s, this._sheetSkeletonManagerService = c, this._commandService = i, this._logService = a, this._initSkeletonChangeListener(), this._initInterceptorEditorStart(), this._commandExecutedListener();
2823
+ this._context = t, this._sheetInterceptorService = n, this._formulaDataModel = o, this._themeService = r, this._renderManagerService = s, this._sheetSkeletonManagerService = c, this._commandService = i, this._logService = l, this._initSkeletonChangeListener(), this._initInterceptorEditorStart(), this._commandExecutedListener();
2817
2824
  }
2818
2825
  _initSkeletonChangeListener() {
2819
2826
  this.disposeWithMe(
@@ -2838,19 +2845,19 @@ let Ot = class extends nt {
2838
2845
  }
2839
2846
  _initInterceptorEditorStart() {
2840
2847
  this.disposeWithMe(
2841
- Bn(
2842
- this._sheetInterceptorService.writeCellInterceptor.intercept(Jo, {
2848
+ zn(
2849
+ this._sheetInterceptorService.writeCellInterceptor.intercept(ns, {
2843
2850
  handler: (t, n, o) => {
2844
- var l, v, g, S;
2845
- const { row: r, col: s, unitId: c, subUnitId: i, worksheet: a } = n, f = this._formulaDataModel.getArrayFormulaRange(), h = this._formulaDataModel.getArrayFormulaCellData();
2851
+ var a, S, g, p;
2852
+ const { row: r, col: s, unitId: c, subUnitId: i, worksheet: l } = n, f = this._formulaDataModel.getArrayFormulaRange(), h = this._formulaDataModel.getArrayFormulaCellData();
2846
2853
  if (this._removeArrayFormulaRangeShape(), t == null)
2847
2854
  return o(t);
2848
2855
  let m = null;
2849
2856
  const u = this._formulaDataModel.getFormulaStringByCell(r, s, i, c);
2850
- if (u !== null && (m = { f: u }), t.v != null && t.v !== "" && ((g = (v = (l = h[c]) == null ? void 0 : l[i]) == null ? void 0 : v[r]) == null ? void 0 : g[s]) == null)
2857
+ if (u !== null && (m = { f: u }), t.v != null && t.v !== "" && ((g = (S = (a = h[c]) == null ? void 0 : a[i]) == null ? void 0 : S[r]) == null ? void 0 : g[s]) == null)
2851
2858
  return m ? { ...t, ...m } : o(t);
2852
- const d = (S = f == null ? void 0 : f[c]) == null ? void 0 : S[i];
2853
- return d != null && (m = this._displayArrayFormulaRangeShape(d, r, s, c, i, a, m)), m ? { ...t, ...m } : o(t);
2859
+ const d = (p = f == null ? void 0 : f[c]) == null ? void 0 : p[i];
2860
+ return d != null && (m = this._displayArrayFormulaRangeShape(d, r, s, c, i, l, m)), m ? { ...t, ...m } : o(t);
2854
2861
  }
2855
2862
  })
2856
2863
  )
@@ -2858,10 +2865,10 @@ let Ot = class extends nt {
2858
2865
  }
2859
2866
  _commandExecutedListener() {
2860
2867
  this.disposeWithMe(this._commandService.onCommandExecuted((t, n) => {
2861
- (t.id === wo.id || t.id === Ao.id && n && n.remove) && this._removeArrayFormulaRangeShape();
2868
+ (t.id === Fo.id || t.id === Do.id && n && n.remove) && this._removeArrayFormulaRangeShape();
2862
2869
  })), this.disposeWithMe(
2863
2870
  this._commandService.beforeCommandExecuted((t) => {
2864
- es.id === t.id && requestIdleCallback(() => {
2871
+ rs.id === t.id && requestIdleCallback(() => {
2865
2872
  const n = t.params, { unitId: o, subUnitId: r, rowsAutoHeightInfo: s } = n;
2866
2873
  this._refreshArrayFormulaRangeShapeByRow(o, r, s);
2867
2874
  });
@@ -2869,21 +2876,21 @@ let Ot = class extends nt {
2869
2876
  );
2870
2877
  }
2871
2878
  _displayArrayFormulaRangeShape(t, n, o, r, s, c, i) {
2872
- const a = this._formulaDataModel.getSheetFormulaData(r, s);
2873
- return new ke(t).forValue((f, h, m) => {
2879
+ const l = this._formulaDataModel.getSheetFormulaData(r, s);
2880
+ return new Fe(t).forValue((f, h, m) => {
2874
2881
  var g;
2875
2882
  if (m == null)
2876
2883
  return !0;
2877
- const { startRow: u, startColumn: d, endRow: l, endColumn: v } = m;
2884
+ const { startRow: u, startColumn: d, endRow: a, endColumn: S } = m;
2878
2885
  if (f === n && h === o)
2879
2886
  return this._createArrayFormulaRangeShape(m, r), !1;
2880
- if (n >= u && n <= l && o >= d && o <= v) {
2881
- const S = c.getCell(u, d);
2882
- if ((S == null ? void 0 : S.v) === ie.SPILL)
2887
+ if (n >= u && n <= a && o >= d && o <= S) {
2888
+ const p = c.getCell(u, d);
2889
+ if ((p == null ? void 0 : p.v) === ie.SPILL)
2883
2890
  return;
2884
- const p = (g = a == null ? void 0 : a[f]) == null ? void 0 : g[h];
2885
- return p == null || p.f == null ? !0 : (i == null && (i = {
2886
- f: p.f,
2891
+ const v = (g = l == null ? void 0 : l[f]) == null ? void 0 : g[h];
2892
+ return v == null || v.f == null ? !0 : (i == null && (i = {
2893
+ f: v.f,
2887
2894
  isInArrayFormulaRange: !0
2888
2895
  }), this._createArrayFormulaRangeShape(m, r), !1);
2889
2896
  }
@@ -2900,12 +2907,12 @@ let Ot = class extends nt {
2900
2907
  style: {
2901
2908
  strokeWidth: 1,
2902
2909
  stroke: this._themeService.getColorFromTheme("primary.600"),
2903
- fill: new Xt(this._themeService.getColorFromTheme("white")).setAlpha(0).toString(),
2910
+ fill: new sn(this._themeService.getColorFromTheme("white")).setAlpha(0).toString(),
2904
2911
  widgets: {}
2905
2912
  }
2906
- }, i = Bt(c, r), { rowHeaderWidth: a, columnHeaderHeight: f } = r, h = new Kn(s, Co.FORMULA_EDITOR_SHOW, this._themeService, {
2913
+ }, i = Xt(c, r), { rowHeaderWidth: l, columnHeaderHeight: f } = r, h = new Qn(s, Ro.FORMULA_EDITOR_SHOW, this._themeService, {
2907
2914
  highlightHeader: !1,
2908
- rowHeaderWidth: a,
2915
+ rowHeaderWidth: l,
2909
2916
  columnHeaderHeight: f
2910
2917
  });
2911
2918
  h.updateRangeBySelectionWithCoord(i), h.setEvent(!1), this._previousShape = h;
@@ -2931,8 +2938,8 @@ let Ot = class extends nt {
2931
2938
  _refreshArrayFormulaRangeShapeByRow(t, n, o) {
2932
2939
  if (!this._checkCurrentSheet(t, n) || !this._previousShape) return;
2933
2940
  const { startRow: r, endRow: s, startColumn: c, endColumn: i } = this._previousShape.getRange();
2934
- for (let a = 0; a < o.length; a++) {
2935
- const { row: f } = o[a];
2941
+ for (let l = 0; l < o.length; l++) {
2942
+ const { row: f } = o[l];
2936
2943
  if (r >= f) {
2937
2944
  const h = {
2938
2945
  startRow: r,
@@ -2946,40 +2953,40 @@ let Ot = class extends nt {
2946
2953
  }
2947
2954
  }
2948
2955
  };
2949
- Ot = Gi([
2950
- Ue(1, B(nn)),
2951
- Ue(2, B(gt)),
2952
- Ue(3, B(ht)),
2953
- Ue(4, xe),
2954
- Ue(5, B(At)),
2955
- Ue(6, ue),
2956
- Ue(7, Xr)
2957
- ], Ot);
2958
- var zi = Object.getOwnPropertyDescriptor, Zi = (e, t, n, o) => {
2959
- for (var r = o > 1 ? void 0 : o ? zi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2956
+ Lt = Zi([
2957
+ Ve(1, B(dn)),
2958
+ Ve(2, B(Et)),
2959
+ Ve(3, B(_t)),
2960
+ Ve(4, Oe),
2961
+ Ve(5, B(Vt)),
2962
+ Ve(6, ue),
2963
+ Ve(7, Jr)
2964
+ ], Lt);
2965
+ var Xi = Object.getOwnPropertyDescriptor, Qi = (e, t, n, o) => {
2966
+ for (var r = o > 1 ? void 0 : o ? Xi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2960
2967
  (c = e[s]) && (r = c(r) || r);
2961
2968
  return r;
2962
- }, Un = (e, t) => (n, o) => t(n, o, e);
2963
- const Xi = {
2969
+ }, qn = (e, t) => (n, o) => t(n, o, e);
2970
+ const Ji = {
2964
2971
  tl: {
2965
2972
  size: 6,
2966
2973
  color: "#409f11"
2967
2974
  }
2968
2975
  };
2969
- let Nt = class extends Qr {
2976
+ let $t = class extends eo {
2970
2977
  constructor(e, t) {
2971
2978
  super(), this._sheetInterceptorService = e, this._formulaDataModel = t, this.disposeWithMe(this._sheetInterceptorService.intercept(
2972
- ts.CELL_CONTENT,
2979
+ os.CELL_CONTENT,
2973
2980
  {
2974
- effect: Jr.Style,
2981
+ effect: to.Style,
2975
2982
  handler: (n, o, r) => {
2976
- var i, a, f, h;
2977
- const s = (h = (f = (a = (i = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : i[o.unitId]) == null ? void 0 : a[o.subUnitId]) == null ? void 0 : f[o.row]) == null ? void 0 : h[o.col];
2978
- return xr(n, !!s) ? r({
2983
+ var i, l, f, h;
2984
+ const s = (h = (f = (l = (i = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : i[o.unitId]) == null ? void 0 : l[o.subUnitId]) == null ? void 0 : f[o.row]) == null ? void 0 : h[o.col];
2985
+ return Nr(n, !!s) ? r({
2979
2986
  ...n,
2980
2987
  markers: {
2981
2988
  ...n == null ? void 0 : n.markers,
2982
- ...Xi
2989
+ ...Ji
2983
2990
  }
2984
2991
  }) : r(n);
2985
2992
  },
@@ -2988,35 +2995,35 @@ let Nt = class extends Qr {
2988
2995
  ));
2989
2996
  }
2990
2997
  };
2991
- Nt = Zi([
2992
- Un(0, B(nn)),
2993
- Un(1, B(gt))
2994
- ], Nt);
2995
- function Qi() {
2996
- const e = T(rs), t = T(ue), n = ve(e.progress$), o = Et(() => {
2997
- t.executeCommand(ko.id);
2998
- }, [t]), r = Et(() => {
2998
+ $t = Qi([
2999
+ qn(0, B(dn)),
3000
+ qn(1, B(Et))
3001
+ ], $t);
3002
+ function ec() {
3003
+ const e = T(is), t = T(ue), n = Ce(e.progress$), o = wt(() => {
3004
+ t.executeCommand(Lo.id);
3005
+ }, [t]), r = wt(() => {
2999
3006
  e.clearProgress();
3000
3007
  }, [e]);
3001
- return /* @__PURE__ */ O(ls, { progress: n, onTerminate: o, onClearProgress: r });
3008
+ return /* @__PURE__ */ O(hs, { progress: n, onTerminate: o, onClearProgress: r });
3002
3009
  }
3003
- function Nr(e) {
3010
+ function wr(e) {
3004
3011
  const { prefix: t, value: n } = e;
3005
- return /* @__PURE__ */ V("div", { children: [
3006
- /* @__PURE__ */ V("span", { children: [
3012
+ return /* @__PURE__ */ W("div", { children: [
3013
+ /* @__PURE__ */ W("span", { children: [
3007
3014
  t,
3008
3015
  "("
3009
3016
  ] }),
3010
- n && n.map((o, r) => /* @__PURE__ */ V("span", { children: [
3011
- /* @__PURE__ */ O("span", { children: Rr(o) }),
3017
+ n && n.map((o, r) => /* @__PURE__ */ W("span", { children: [
3018
+ /* @__PURE__ */ O("span", { children: br(o) }),
3012
3019
  r === n.length - 1 ? "" : ","
3013
3020
  ] }, r)),
3014
3021
  ")"
3015
3022
  ] });
3016
3023
  }
3017
- function lt(e) {
3024
+ function pt(e) {
3018
3025
  const { className: t, value: n, title: o } = e;
3019
- return /* @__PURE__ */ V("div", { className: "univer-mb-2 univer-text-xs", children: [
3026
+ return /* @__PURE__ */ W("div", { className: "univer-mb-2 univer-text-xs", children: [
3020
3027
  /* @__PURE__ */ O(
3021
3028
  "div",
3022
3029
  {
@@ -3030,88 +3037,88 @@ function lt(e) {
3030
3037
  /* @__PURE__ */ O(
3031
3038
  "div",
3032
3039
  {
3033
- className: "univer-text-gray-900 dark:univer-text-white",
3040
+ className: "univer-text-gray-900 dark:!univer-text-white",
3034
3041
  children: n
3035
3042
  }
3036
3043
  )
3037
3044
  ] });
3038
3045
  }
3039
- function Ji(e) {
3046
+ function tc(e) {
3040
3047
  const { functionInfo: t, onChange: n } = e;
3041
3048
  if (!t) return null;
3042
- const [o, r] = U([]), [s, c] = U(t.functionParameter), [i, a] = U(-1);
3043
- return /* @__PURE__ */ V("div", { children: [
3044
- /* @__PURE__ */ O("div", { className: "univer-h-[364px] univer-overflow-y-auto", children: s.map((f, h) => /* @__PURE__ */ V("div", { children: [
3049
+ const [o, r] = V([]), [s, c] = V(t.functionParameter), [i, l] = V(-1);
3050
+ return /* @__PURE__ */ W("div", { children: [
3051
+ /* @__PURE__ */ O("div", { className: "univer-h-[364px] univer-overflow-y-auto", children: s.map((f, h) => /* @__PURE__ */ W("div", { children: [
3045
3052
  /* @__PURE__ */ O("div", { className: "univer-text-sm", children: f.name }),
3046
3053
  /* @__PURE__ */ O("div", { className: "univer-mb-2 univer-mt-1" })
3047
3054
  ] }, h)) }),
3048
- /* @__PURE__ */ O("div", { className: pe("univer-flex-1 univer-p-3", vs), children: /* @__PURE__ */ O(
3049
- lt,
3055
+ /* @__PURE__ */ O("div", { className: fe("univer-flex-1 univer-p-3", Cs), children: /* @__PURE__ */ O(
3056
+ pt,
3050
3057
  {
3051
- title: i === -1 ? /* @__PURE__ */ O(Nr, { prefix: t.functionName, value: s }) : s[i].name,
3058
+ title: i === -1 ? /* @__PURE__ */ O(wr, { prefix: t.functionName, value: s }) : s[i].name,
3052
3059
  value: i === -1 ? t.description : s[i].detail
3053
3060
  }
3054
3061
  ) })
3055
3062
  ] });
3056
3063
  }
3057
- function ec(e) {
3058
- const { onChange: t } = e, n = "-1", [o, r] = U(""), [s, c] = U([]), [i, a] = U(0), [f, h] = U(n), [m, u] = U(0), [d, l] = U(null), v = T(Ft), g = T(tt), S = T(rn), p = ve(S.sidebarOptions$), _ = Bs(Fo, g);
3064
+ function nc(e) {
3065
+ const { onChange: t } = e, n = "-1", [o, r] = V(""), [s, c] = V([]), [i, l] = V(0), [f, h] = V(n), [m, u] = V(0), [d, a] = V(null), S = T(Ht), g = T(at), p = T(hn), v = Ce(p.sidebarOptions$), _ = qs($o, g);
3059
3066
  _.unshift({
3060
3067
  label: g.t("formula.moreFunctions.allFunctions"),
3061
3068
  value: n
3062
3069
  });
3063
3070
  const R = g.t("formula.prompt.required"), C = g.t("formula.prompt.optional");
3064
- P(() => {
3071
+ $(() => {
3065
3072
  k(n);
3066
- }, []), P(() => {
3073
+ }, []), $(() => {
3067
3074
  N(0);
3068
- }, [s]), P(() => {
3069
- p != null && p.visible && (r(""), c([]), a(0), h(n), u(0), l(null), k(n));
3070
- }, [p]);
3071
- const y = (E) => {
3072
- if (o.trim() === "") return E;
3073
- const b = new RegExp(`(${o.toLocaleUpperCase()})`);
3074
- return E.split(b).filter(Boolean).map((A, D) => A.match(b) ? /* @__PURE__ */ O("span", { className: "univer-text-red-500", children: A }, D) : A);
3075
- }, N = (E) => {
3075
+ }, [s]), $(() => {
3076
+ v != null && v.visible && (r(""), c([]), l(0), h(n), u(0), a(null), k(n));
3077
+ }, [v]);
3078
+ const y = (b) => {
3079
+ if (o.trim() === "") return b;
3080
+ const E = new RegExp(`(${o.toLocaleUpperCase()})`);
3081
+ return b.split(E).filter(Boolean).map((A, L) => A.match(E) ? /* @__PURE__ */ O("span", { className: "univer-text-red-500", children: A }, L) : A);
3082
+ }, N = (b) => {
3076
3083
  if (s.length === 0) {
3077
- l(null);
3084
+ a(null);
3078
3085
  return;
3079
3086
  }
3080
- u(E);
3081
- const b = v.getFunctionInfo(s[E].name);
3082
- if (!b) {
3083
- l(null);
3087
+ u(b);
3088
+ const E = S.getFunctionInfo(s[b].name);
3089
+ if (!E) {
3090
+ a(null);
3084
3091
  return;
3085
3092
  }
3086
- l(b), t(b);
3093
+ a(E), t(E);
3087
3094
  };
3088
- function k(E) {
3089
- h(E);
3090
- const b = v.getSearchListByType(+E);
3091
- c(b);
3092
- }
3093
- function F(E) {
3094
- r(E);
3095
- const b = v.getSearchListByName(E);
3096
- c(b);
3097
- }
3098
- function x(E) {
3099
- if (E.stopPropagation(), E.key === "ArrowDown") {
3100
- const b = i + 1;
3101
- a(b === s.length ? 0 : b);
3102
- } else if (E.key === "ArrowUp") {
3103
- const b = i - 1;
3104
- a(b === -1 ? s.length - 1 : b);
3105
- } else E.key === "Enter" && N(i);
3106
- }
3107
- const w = (E) => {
3108
- a(E);
3095
+ function k(b) {
3096
+ h(b);
3097
+ const E = S.getSearchListByType(+b);
3098
+ c(E);
3099
+ }
3100
+ function F(b) {
3101
+ r(b);
3102
+ const E = S.getSearchListByName(b);
3103
+ c(E);
3104
+ }
3105
+ function x(b) {
3106
+ if (b.stopPropagation(), b.key === "ArrowDown") {
3107
+ const E = i + 1;
3108
+ l(E === s.length ? 0 : E);
3109
+ } else if (b.key === "ArrowUp") {
3110
+ const E = i - 1;
3111
+ l(E === -1 ? s.length - 1 : E);
3112
+ } else b.key === "Enter" && N(i);
3113
+ }
3114
+ const w = (b) => {
3115
+ l(b);
3109
3116
  }, M = () => {
3110
- a(-1);
3117
+ l(-1);
3111
3118
  };
3112
- return /* @__PURE__ */ V("div", { children: [
3113
- /* @__PURE__ */ V("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-[10%]", children: [
3114
- /* @__PURE__ */ O(ps, { value: f, options: _, onChange: k }),
3119
+ return /* @__PURE__ */ W("div", { children: [
3120
+ /* @__PURE__ */ W("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-[10%]", children: [
3121
+ /* @__PURE__ */ O(_s, { value: f, options: _, onChange: k }),
3115
3122
  /* @__PURE__ */ O(
3116
3123
  lr,
3117
3124
  {
@@ -3127,88 +3134,88 @@ function ec(e) {
3127
3134
  /* @__PURE__ */ O(
3128
3135
  "ul",
3129
3136
  {
3130
- className: pe("univer-mx-0 univer-mb-0 univer-mt-2 univer-box-border univer-max-h-[364px] univer-w-full univer-select-none univer-list-none univer-overflow-y-auto univer-rounded univer-p-3 univer-outline-none", sn),
3137
+ className: fe("univer-mx-0 univer-mb-0 univer-mt-2 univer-box-border univer-max-h-[364px] univer-w-full univer-select-none univer-list-none univer-overflow-y-auto univer-rounded univer-p-3 univer-outline-none", fn),
3131
3138
  onKeyDown: x,
3132
3139
  tabIndex: -1,
3133
- children: s.map(({ name: E }, b) => /* @__PURE__ */ V(
3140
+ children: s.map(({ name: b }, E) => /* @__PURE__ */ W(
3134
3141
  "li",
3135
3142
  {
3136
- className: pe("univer-relative univer-box-border univer-cursor-pointer univer-rounded univer-px-7 univer-py-1 univer-text-sm univer-text-gray-900 univer-transition-colors dark:univer-text-white", {
3137
- "univer-bg-gray-200": i === b
3143
+ className: fe("univer-relative univer-box-border univer-cursor-pointer univer-rounded univer-px-7 univer-py-1 univer-text-sm univer-text-gray-900 univer-transition-colors dark:!univer-text-white", {
3144
+ "univer-bg-gray-200": i === E
3138
3145
  }),
3139
- onMouseEnter: () => w(b),
3146
+ onMouseEnter: () => w(E),
3140
3147
  onMouseLeave: M,
3141
- onClick: () => N(b),
3148
+ onClick: () => N(E),
3142
3149
  children: [
3143
- m === b && /* @__PURE__ */ O(
3144
- mr,
3150
+ m === E && /* @__PURE__ */ O(
3151
+ Sr,
3145
3152
  {
3146
3153
  className: "univer-absolute univer-left-1.5 univer-top-1/2 univer-inline-flex -univer-translate-y-1/2 univer-text-base univer-text-primary-600"
3147
3154
  }
3148
3155
  ),
3149
- /* @__PURE__ */ O("span", { className: "univer-block", children: y(E) })
3156
+ /* @__PURE__ */ O("span", { className: "univer-block", children: y(b) })
3150
3157
  ]
3151
3158
  },
3152
- b
3159
+ E
3153
3160
  ))
3154
3161
  }
3155
3162
  ),
3156
- d && /* @__PURE__ */ V("div", { className: "univer-mx-0 univer-my-2 univer-max-h-[307px] univer-overflow-y-auto", children: [
3157
- /* @__PURE__ */ O(lt, { title: d.functionName, value: d.description }),
3163
+ d && /* @__PURE__ */ W("div", { className: "univer-mx-0 univer-my-2 univer-max-h-[307px] univer-overflow-y-auto", children: [
3164
+ /* @__PURE__ */ O(pt, { title: d.functionName, value: d.description }),
3158
3165
  /* @__PURE__ */ O(
3159
- lt,
3166
+ pt,
3160
3167
  {
3161
3168
  title: g.t("formula.moreFunctions.syntax"),
3162
- value: /* @__PURE__ */ O(Nr, { prefix: d.functionName, value: d.functionParameter })
3169
+ value: /* @__PURE__ */ O(wr, { prefix: d.functionName, value: d.functionParameter })
3163
3170
  }
3164
3171
  ),
3165
3172
  /* @__PURE__ */ O(
3166
- lt,
3173
+ pt,
3167
3174
  {
3168
3175
  title: g.t("formula.prompt.helpExample"),
3169
- value: `${d.functionName}(${d.functionParameter.map((E) => E.example).join(",")})`
3176
+ value: `${d.functionName}(${d.functionParameter.map((b) => b.example).join(",")})`
3170
3177
  }
3171
3178
  ),
3172
- d.functionParameter && d.functionParameter.map((E) => /* @__PURE__ */ O(
3173
- lt,
3179
+ d.functionParameter && d.functionParameter.map((b) => /* @__PURE__ */ O(
3180
+ pt,
3174
3181
  {
3175
- title: E.name,
3176
- value: `${E.require ? R : C} ${E.detail}`
3182
+ title: b.name,
3183
+ value: `${b.require ? R : C} ${b.detail}`
3177
3184
  },
3178
- E.name
3185
+ b.name
3179
3186
  ))
3180
3187
  ] })
3181
3188
  ] });
3182
3189
  }
3183
- function tc() {
3184
- const e = _o(), [t, n] = U(!0), [o, r] = U(!1), [s, c] = U(null);
3185
- T(Qt);
3186
- const i = T(tt), a = T(Be), f = T(ee), h = T(ue);
3190
+ function rc() {
3191
+ const e = Eo(), [t, n] = V(!0), [o, r] = V(!1), [s, c] = V(null);
3192
+ T(cn);
3193
+ const i = T(at), l = T(qe), f = T(ee), h = T(ue);
3187
3194
  function m() {
3188
3195
  n(!t), r(!o);
3189
3196
  }
3190
3197
  function u() {
3191
- const d = Jn(f);
3198
+ const d = or(f);
3192
3199
  if (!d) return;
3193
- h.executeCommand(jn.id, {
3200
+ h.executeCommand(Zn.id, {
3194
3201
  visible: !0,
3195
3202
  unitId: d.unitId,
3196
- eventType: Te.Dblclick
3203
+ eventType: xe.Dblclick
3197
3204
  });
3198
- const l = a.getEditor(Zt), v = a.getEditor(Wn), g = `=${s == null ? void 0 : s.functionName}(`;
3199
- l == null || l.replaceText(g), v == null || v.replaceText(g, !1);
3205
+ const a = l.getEditor(on), S = l.getEditor(Yn), g = `=${s == null ? void 0 : s.functionName}(`;
3206
+ a == null || a.replaceText(g), S == null || S.replaceText(g, !1);
3200
3207
  }
3201
- return /* @__PURE__ */ V("div", { className: "univer-flex univer-h-full univer-flex-col univer-justify-between univer-leading-5", children: [
3202
- t && /* @__PURE__ */ O(ec, { onChange: c }),
3203
- o && /* @__PURE__ */ O(Ji, { functionInfo: s, onChange: () => {
3208
+ return /* @__PURE__ */ W("div", { className: "univer-flex univer-h-full univer-flex-col univer-justify-between univer-leading-5", children: [
3209
+ t && /* @__PURE__ */ O(nc, { onChange: c }),
3210
+ o && /* @__PURE__ */ O(tc, { functionInfo: s, onChange: () => {
3204
3211
  } }),
3205
- /* @__PURE__ */ V(
3212
+ /* @__PURE__ */ W(
3206
3213
  "div",
3207
3214
  {
3208
3215
  className: "univer-flex univer-justify-end",
3209
3216
  children: [
3210
3217
  o && /* @__PURE__ */ O(
3211
- Qe,
3218
+ st,
3212
3219
  {
3213
3220
  variant: "primary",
3214
3221
  onClick: m,
@@ -3216,9 +3223,9 @@ function tc() {
3216
3223
  children: i.t("formula.moreFunctions.next")
3217
3224
  }
3218
3225
  ),
3219
- o && /* @__PURE__ */ O(Qe, { onClick: m, className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0", children: i.t("formula.moreFunctions.prev") }),
3226
+ o && /* @__PURE__ */ O(st, { onClick: m, className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0", children: i.t("formula.moreFunctions.prev") }),
3220
3227
  t && !!e && /* @__PURE__ */ O(
3221
- Qe,
3228
+ st,
3222
3229
  {
3223
3230
  variant: "primary",
3224
3231
  onClick: u,
@@ -3231,189 +3238,256 @@ function tc() {
3231
3238
  )
3232
3239
  ] });
3233
3240
  }
3234
- function nc(e) {
3241
+ function oc(e) {
3235
3242
  return {
3236
- id: an.id,
3237
- icon: "FunctionSingle",
3238
- tooltip: "formula.insert.tooltip",
3239
- type: on.SELECTOR,
3240
- selections: [
3241
- {
3242
- label: {
3243
- name: "SUM",
3244
- selectable: !1
3245
- },
3246
- value: "SUM",
3247
- icon: "SumSingle"
3248
- },
3249
- {
3250
- label: {
3251
- name: "AVERAGE",
3252
- selectable: !1
3253
- },
3254
- value: "AVERAGE",
3255
- icon: "AvgSingle"
3256
- },
3257
- {
3258
- label: {
3259
- name: "COUNT",
3260
- selectable: !1
3261
- },
3262
- value: "COUNT",
3263
- icon: "CntSingle"
3264
- },
3265
- {
3266
- label: {
3267
- name: "MAX",
3268
- selectable: !1
3269
- },
3270
- value: "MAX",
3271
- icon: "MaxSingle"
3272
- },
3273
- {
3274
- label: {
3275
- name: "MIN",
3276
- selectable: !1
3277
- },
3278
- value: "MIN",
3279
- icon: "MinSingle"
3280
- }
3281
- ],
3282
- hidden$: as(e, J.UNIVER_SHEET),
3283
- disabled$: Gn(e, { workbookTypes: [rr], worksheetTypes: [tr, er], rangeTypes: [nr] })
3243
+ id: he.id,
3244
+ title: "SUM",
3245
+ icon: "SumSingle",
3246
+ type: Ze.BUTTON,
3247
+ params: {
3248
+ value: "SUM"
3249
+ },
3250
+ hidden$: dt(e, q.UNIVER_SHEET),
3251
+ disabled$: je(e, {
3252
+ workbookTypes: [ze],
3253
+ worksheetTypes: [Ye, Ke],
3254
+ rangeTypes: [Ge]
3255
+ })
3256
+ };
3257
+ }
3258
+ function sc(e) {
3259
+ return {
3260
+ id: he.id,
3261
+ title: "COUNT",
3262
+ icon: "CntSingle",
3263
+ type: Ze.BUTTON,
3264
+ params: {
3265
+ value: "COUNT"
3266
+ },
3267
+ hidden$: dt(e, q.UNIVER_SHEET),
3268
+ disabled$: je(e, {
3269
+ workbookTypes: [ze],
3270
+ worksheetTypes: [Ye, Ke],
3271
+ rangeTypes: [Ge]
3272
+ })
3273
+ };
3274
+ }
3275
+ function ic(e) {
3276
+ return {
3277
+ id: he.id,
3278
+ title: "AVERAGE",
3279
+ icon: "AvgSingle",
3280
+ type: Ze.BUTTON,
3281
+ params: {
3282
+ value: "AVERAGE"
3283
+ },
3284
+ hidden$: dt(e, q.UNIVER_SHEET),
3285
+ disabled$: je(e, {
3286
+ workbookTypes: [ze],
3287
+ worksheetTypes: [Ye, Ke],
3288
+ rangeTypes: [Ge]
3289
+ })
3290
+ };
3291
+ }
3292
+ function cc(e) {
3293
+ return {
3294
+ id: he.id,
3295
+ title: "MAX",
3296
+ icon: "MaxSingle",
3297
+ type: Ze.BUTTON,
3298
+ params: {
3299
+ value: "MAX"
3300
+ },
3301
+ hidden$: dt(e, q.UNIVER_SHEET),
3302
+ disabled$: je(e, {
3303
+ workbookTypes: [ze],
3304
+ worksheetTypes: [Ye, Ke],
3305
+ rangeTypes: [Ge]
3306
+ })
3307
+ };
3308
+ }
3309
+ function ac(e) {
3310
+ return {
3311
+ id: he.id,
3312
+ title: "MIN",
3313
+ icon: "MinSingle",
3314
+ type: Ze.BUTTON,
3315
+ params: {
3316
+ value: "MIN"
3317
+ },
3318
+ hidden$: dt(e, q.UNIVER_SHEET),
3319
+ disabled$: je(e, {
3320
+ workbookTypes: [ze],
3321
+ worksheetTypes: [Ye, Ke],
3322
+ rangeTypes: [Ge]
3323
+ })
3284
3324
  };
3285
3325
  }
3286
- function rc(e) {
3326
+ function lc(e) {
3287
3327
  return {
3288
- id: un.id,
3328
+ id: fr.id,
3289
3329
  title: "formula.insert.more",
3290
- type: on.BUTTON
3330
+ type: Ze.BUTTON,
3331
+ hidden$: dt(e, q.UNIVER_SHEET),
3332
+ disabled$: je(e, {
3333
+ workbookTypes: [ze],
3334
+ worksheetTypes: [Ye, Ke],
3335
+ rangeTypes: [Ge]
3336
+ })
3291
3337
  };
3292
3338
  }
3293
- function oc(e) {
3294
- return e.get(ee).getCurrentTypeOfUnit$(J.UNIVER_SHEET).pipe(
3295
- Vo((o) => o ? e.get(wn) ? new Wo((s) => s.next(!e.get(wn).supportClipboard)) : yn(!0) : yn(!0))
3339
+ function uc(e) {
3340
+ return e.get(ee).getCurrentTypeOfUnit$(q.UNIVER_SHEET).pipe(
3341
+ Bo((o) => o ? e.get(Ln) ? new jo((s) => s.next(!e.get(Ln).supportClipboard)) : Mn(!0) : Mn(!0))
3296
3342
  );
3297
3343
  }
3298
- function sc(e) {
3344
+ function dc(e) {
3299
3345
  return {
3300
- id: cn.id,
3301
- type: on.BUTTON,
3346
+ id: gn.id,
3347
+ type: Ze.BUTTON,
3302
3348
  title: "formula.operation.pasteFormula",
3303
- disabled$: oc(e).pipe(
3304
- Uo(Gn(e, { workbookTypes: [rr], rangeTypes: [nr], worksheetTypes: [er, tr] })),
3305
- Xn(([t, n]) => t || n)
3349
+ disabled$: uc(e).pipe(
3350
+ Ho(je(e, {
3351
+ workbookTypes: [ze],
3352
+ rangeTypes: [Ge],
3353
+ worksheetTypes: [Ke, Ye]
3354
+ })),
3355
+ nr(([t, n]) => t || n)
3306
3356
  )
3307
3357
  };
3308
3358
  }
3309
- const ic = {
3310
- [us.FORMULAS_INSERT]: {
3311
- [an.id]: {
3312
- order: 1,
3313
- menuItemFactory: nc,
3314
- [un.id]: {
3315
- order: 1,
3316
- menuItemFactory: rc
3317
- }
3359
+ const hc = {
3360
+ [$n.BASIC]: {
3361
+ [`${he.id}.sum`]: {
3362
+ order: 0,
3363
+ menuItemFactory: oc
3364
+ },
3365
+ [`${he.id}.count`]: {
3366
+ order: 0,
3367
+ menuItemFactory: sc
3368
+ },
3369
+ [`${he.id}.average`]: {
3370
+ order: 0,
3371
+ menuItemFactory: ic
3372
+ },
3373
+ [`${he.id}.max`]: {
3374
+ order: 0,
3375
+ menuItemFactory: cc
3376
+ },
3377
+ [`${he.id}.min`]: {
3378
+ order: 0,
3379
+ menuItemFactory: ac
3318
3380
  }
3319
3381
  },
3320
- [Ro]: {
3321
- [cn.id]: {
3382
+ [$n.OTHERS]: {
3383
+ order: 0,
3384
+ menuItemFactory: lc
3385
+ },
3386
+ [bo]: {
3387
+ [gn.id]: {
3322
3388
  order: 4,
3323
- menuItemFactory: sc
3389
+ menuItemFactory: dc
3324
3390
  }
3325
3391
  }
3326
- }, cc = "meta_key_ctrl_And_Shift", Lt = [
3327
- L.ARROW_DOWN,
3328
- L.ARROW_UP,
3329
- L.ARROW_LEFT,
3330
- L.ARROW_RIGHT
3331
- ], lc = [...Lt, L.ENTER, L.TAB, L.ESC];
3332
- function ac() {
3392
+ }, fc = "meta_key_ctrl_And_Shift", jt = [
3393
+ D.ARROW_DOWN,
3394
+ D.ARROW_UP,
3395
+ D.ARROW_LEFT,
3396
+ D.ARROW_RIGHT
3397
+ ], gc = [...jt, D.ENTER, D.TAB, D.ESC];
3398
+ function mc() {
3333
3399
  const e = [];
3334
- for (const t of lc)
3400
+ for (const t of gc)
3335
3401
  e.push({
3336
- id: ot.id,
3402
+ id: ht.id,
3337
3403
  binding: t,
3338
- preconditions: (n) => ft(n),
3404
+ preconditions: (n) => Rt(n),
3339
3405
  staticParameters: {
3340
- eventType: Te.Keyboard,
3406
+ eventType: xe.Keyboard,
3341
3407
  keycode: t
3342
3408
  }
3343
3409
  });
3344
3410
  return e;
3345
3411
  }
3346
- function uc() {
3412
+ function pc() {
3347
3413
  const e = [];
3348
- for (const t of Lt)
3414
+ for (const t of jt)
3349
3415
  e.push({
3350
- id: ot.id,
3351
- binding: t | W.SHIFT,
3352
- preconditions: (n) => ft(n),
3416
+ id: ht.id,
3417
+ binding: t | P.SHIFT,
3418
+ preconditions: (n) => Rt(n),
3353
3419
  staticParameters: {
3354
- eventType: Te.Keyboard,
3420
+ eventType: xe.Keyboard,
3355
3421
  keycode: t,
3356
- metaKey: W.SHIFT
3422
+ metaKey: P.SHIFT
3357
3423
  }
3358
3424
  });
3359
3425
  return e;
3360
3426
  }
3361
- function dc() {
3427
+ function Sc() {
3362
3428
  const e = [];
3363
- for (const t of Lt)
3429
+ for (const t of jt)
3364
3430
  e.push({
3365
- id: ot.id,
3366
- binding: t | W.CTRL_COMMAND,
3367
- preconditions: (n) => ft(n),
3431
+ id: ht.id,
3432
+ binding: t | P.CTRL_COMMAND,
3433
+ preconditions: (n) => Rt(n),
3368
3434
  staticParameters: {
3369
- eventType: Te.Keyboard,
3435
+ eventType: xe.Keyboard,
3370
3436
  keycode: t,
3371
- metaKey: W.CTRL_COMMAND
3437
+ metaKey: P.CTRL_COMMAND
3372
3438
  }
3373
3439
  });
3374
3440
  return e;
3375
3441
  }
3376
- function hc() {
3442
+ function vc() {
3377
3443
  const e = [];
3378
- for (const t of Lt)
3444
+ for (const t of jt)
3379
3445
  e.push({
3380
- id: ot.id,
3381
- binding: t | W.SHIFT | W.CTRL_COMMAND,
3382
- preconditions: (n) => ft(n),
3446
+ id: ht.id,
3447
+ binding: t | P.SHIFT | P.CTRL_COMMAND,
3448
+ preconditions: (n) => Rt(n),
3383
3449
  staticParameters: {
3384
- eventType: Te.Keyboard,
3450
+ eventType: xe.Keyboard,
3385
3451
  keycode: t,
3386
- metaKey: cc
3452
+ metaKey: fc
3387
3453
  }
3388
3454
  });
3389
3455
  return e;
3390
3456
  }
3391
- const fc = {
3392
- id: hr.id,
3393
- binding: L.F4,
3394
- preconditions: (e) => ft(e)
3457
+ const Cc = {
3458
+ id: gr.id,
3459
+ binding: D.F4,
3460
+ preconditions: (e) => Rt(e)
3395
3461
  };
3396
- function gc() {
3462
+ function _c() {
3397
3463
  const e = [];
3398
- for (const t of [L.ENTER, L.TAB, L.ARROW_DOWN, L.ARROW_UP])
3464
+ for (const t of [D.ENTER, D.TAB, D.ARROW_DOWN, D.ARROW_UP])
3399
3465
  e.push({
3400
- id: ot.id,
3466
+ id: ht.id,
3401
3467
  binding: t,
3402
- preconditions: (n) => Mi(n),
3468
+ preconditions: (n) => Ai(n),
3403
3469
  staticParameters: {
3404
- eventType: Te.Keyboard,
3470
+ eventType: xe.Keyboard,
3405
3471
  keycode: t,
3406
3472
  isSingleEditor: !0
3407
3473
  }
3408
3474
  });
3409
3475
  return e;
3410
3476
  }
3411
- var mc = Object.getOwnPropertyDescriptor, Sc = (e, t, n, o) => {
3412
- for (var r = o > 1 ? void 0 : o ? mc(t, n) : t, s = e.length - 1, c; s >= 0; s--)
3477
+ const Rc = {
3478
+ id: cs.id,
3479
+ binding: P.ALT | D.EQUAL,
3480
+ preconditions: Io,
3481
+ mac: P.CTRL_COMMAND | P.ALT | D.EQUAL,
3482
+ description: "shortcut.sheets-formula-ui.quick-sum",
3483
+ group: "4_sheet-edit"
3484
+ };
3485
+ var Ec = Object.getOwnPropertyDescriptor, bc = (e, t, n, o) => {
3486
+ for (var r = o > 1 ? void 0 : o ? Ec(t, n) : t, s = e.length - 1, c; s >= 0; s--)
3413
3487
  (c = e[s]) && (r = c(r) || r);
3414
3488
  return r;
3415
- }, Ve = (e, t) => (n, o) => t(n, o, e);
3416
- let Mt = class extends nt {
3489
+ }, We = (e, t) => (n, o) => t(n, o, e);
3490
+ let Pt = class extends lt {
3417
3491
  constructor(e, t, n, o, r, s, c) {
3418
3492
  super(), this._injector = e, this._menuManagerService = t, this._commandService = n, this._shortcutService = o, this._uiPartsService = r, this._renderManagerService = s, this._componentManager = c, this._initialize();
3419
3493
  }
@@ -3421,51 +3495,52 @@ let Mt = class extends nt {
3421
3495
  this._registerCommands(), this._registerMenus(), this._registerShortcuts(), this._registerComponents(), this._registerRenderModules();
3422
3496
  }
3423
3497
  _registerMenus() {
3424
- this._menuManagerService.mergeMenu(ic);
3498
+ this._menuManagerService.mergeMenu(hc);
3425
3499
  }
3426
3500
  _registerCommands() {
3427
3501
  [
3428
- cn,
3429
- an,
3430
- un,
3431
- As,
3432
- ys,
3433
- ot,
3434
- hr
3502
+ gn,
3503
+ he,
3504
+ fr,
3505
+ Fs,
3506
+ xs,
3507
+ ht,
3508
+ gr
3435
3509
  ].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e)));
3436
3510
  }
3437
3511
  _registerShortcuts() {
3438
3512
  [
3439
- ...ac(),
3440
- ...uc(),
3441
- ...dc(),
3442
- ...hc(),
3443
- ...gc(),
3444
- fc
3513
+ ...mc(),
3514
+ ...pc(),
3515
+ ...Sc(),
3516
+ ...vc(),
3517
+ ..._c(),
3518
+ Rc,
3519
+ Cc
3445
3520
  ].forEach((e) => {
3446
3521
  this.disposeWithMe(this._shortcutService.registerShortcut(e));
3447
3522
  });
3448
3523
  }
3449
3524
  _registerComponents() {
3450
- this.disposeWithMe(this._uiPartsService.registerComponent(bo.FORMULA_AUX, () => ir(Qi, this._injector))), this._componentManager.register(dr, tc);
3525
+ this.disposeWithMe(this._uiPartsService.registerComponent(yo.FORMULA_AUX, () => cr(ec, this._injector))), this._componentManager.register(hr, rc);
3451
3526
  }
3452
3527
  _registerRenderModules() {
3453
- this.disposeWithMe(this._renderManagerService.registerRenderModule(J.UNIVER_SHEET, [Ot]));
3528
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(q.UNIVER_SHEET, [Lt]));
3454
3529
  }
3455
3530
  };
3456
- Mt = Sc([
3457
- Ve(0, B(dt)),
3458
- Ve(1, ds),
3459
- Ve(2, ue),
3460
- Ve(3, Dt),
3461
- Ve(4, or),
3462
- Ve(5, xe),
3463
- Ve(6, B(sr))
3464
- ], Mt);
3465
- const vc = () => {
3531
+ Pt = bc([
3532
+ We(0, B(Ct)),
3533
+ We(1, fs),
3534
+ We(2, ue),
3535
+ We(3, Bt),
3536
+ We(4, sr),
3537
+ We(5, Oe),
3538
+ We(6, B(ir))
3539
+ ], Pt);
3540
+ const Ic = () => {
3466
3541
  var o, r;
3467
- const e = T(Tr), t = ve(e.currentSelector$), n = Y(null);
3468
- return P(() => {
3542
+ const e = T(Or), t = Ce(e.currentSelector$), n = G(null);
3543
+ return $(() => {
3469
3544
  var s, c;
3470
3545
  if (t)
3471
3546
  return (c = n.current) == null || c.showDialog((s = t.initialValue) != null ? s : []), () => {
@@ -3473,7 +3548,7 @@ const vc = () => {
3473
3548
  (i = n.current) == null || i.hideDialog();
3474
3549
  };
3475
3550
  }, [t]), /* @__PURE__ */ O(
3476
- yr,
3551
+ xr,
3477
3552
  {
3478
3553
  unitId: (o = t == null ? void 0 : t.unitId) != null ? o : "",
3479
3554
  subUnitId: (r = t == null ? void 0 : t.subUnitId) != null ? r : "",
@@ -3481,86 +3556,86 @@ const vc = () => {
3481
3556
  selectorRef: n,
3482
3557
  onChange: (s, c) => {
3483
3558
  var i;
3484
- t == null || t.callback((i = c == null ? void 0 : c.split(",").map((a) => rt(a))) != null ? i : []);
3559
+ t == null || t.callback((i = c == null ? void 0 : c.split(",").map((l) => ut(l))) != null ? i : []);
3485
3560
  }
3486
3561
  }
3487
3562
  );
3488
3563
  };
3489
- var pc = Object.defineProperty, Cc = Object.getOwnPropertyDescriptor, _c = (e, t, n) => t in e ? pc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Rc = (e, t, n, o) => {
3490
- for (var r = o > 1 ? void 0 : o ? Cc(t, n) : t, s = e.length - 1, c; s >= 0; s--)
3564
+ var yc = Object.defineProperty, Tc = Object.getOwnPropertyDescriptor, xc = (e, t, n) => t in e ? yc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Oc = (e, t, n, o) => {
3565
+ for (var r = o > 1 ? void 0 : o ? Tc(t, n) : t, s = e.length - 1, c; s >= 0; s--)
3491
3566
  (c = e[s]) && (r = c(r) || r);
3492
3567
  return r;
3493
- }, Rt = (e, t) => (n, o) => t(n, o, e), Mr = (e, t, n) => _c(e, typeof t != "symbol" ? t + "" : t, n);
3494
- let wt = class extends no {
3495
- constructor(e = Pn, t, n, o, r) {
3568
+ }, Nt = (e, t) => (n, o) => t(n, o, e), Ar = (e, t, n) => xc(e, typeof t != "symbol" ? t + "" : t, n);
3569
+ let Ut = class extends oo {
3570
+ constructor(e = Bn, t, n, o, r) {
3496
3571
  super(), this._config = e, this._injector = t, this._renderManagerService = n, this._configService = o, this._uiPartsService = r;
3497
- const { menu: s, ...c } = ro(
3498
- Pn,
3572
+ const { menu: s, ...c } = so(
3573
+ Bn,
3499
3574
  this._config
3500
3575
  );
3501
- s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(Ni, c, { merge: !0 });
3576
+ s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(wi, c, { merge: !0 });
3502
3577
  }
3503
3578
  onStarting() {
3504
- oo(this._injector, [
3505
- [ln, { useClass: Kt }],
3506
- [Tr],
3507
- [Mt],
3508
- [Tt],
3509
- [xt],
3510
- [Ot],
3511
- [Nt],
3512
- [yt]
3579
+ io(this._injector, [
3580
+ [mn, { useClass: en }],
3581
+ [Or],
3582
+ [Pt],
3583
+ [Ft],
3584
+ [Dt],
3585
+ [Lt],
3586
+ [$t],
3587
+ [kt]
3513
3588
  ]), this._initUIPart();
3514
3589
  }
3515
3590
  onReady() {
3516
3591
  [
3517
- [Fe]
3592
+ [De]
3518
3593
  ].forEach((e) => {
3519
- this.disposeWithMe(this._renderManagerService.registerRenderModule(J.UNIVER_SHEET, e));
3594
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(q.UNIVER_SHEET, e));
3520
3595
  });
3521
3596
  }
3522
3597
  onRendered() {
3523
3598
  [
3524
- [Gt]
3599
+ [nn]
3525
3600
  ].forEach((e) => {
3526
- this.disposeWithMe(this._renderManagerService.registerRenderModule(J.UNIVER_SHEET, e));
3527
- }), so(this._injector, [
3528
- [Mt],
3601
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(q.UNIVER_SHEET, e));
3602
+ }), co(this._injector, [
3603
+ [Pt],
3529
3604
  // FormulaProgressBar relies on TriggerCalculationController, but it is necessary to ensure that the formula calculation is done after rendered.
3530
- [xt],
3531
- [Nt]
3605
+ [Dt],
3606
+ [$t]
3532
3607
  ]);
3533
3608
  }
3534
3609
  onSteady() {
3535
- this._injector.get(Tt), this._injector.get(yt);
3610
+ this._injector.get(Ft), this._injector.get(kt);
3536
3611
  }
3537
3612
  _initUIPart() {
3538
- const e = this._injector.get(sr);
3539
- this.disposeWithMe(e.register(Eo, yr)), this.disposeWithMe(e.register(Io, _i)), this.disposeWithMe(this._uiPartsService.registerComponent(hs.GLOBAL, () => ir(vc, this._injector)));
3613
+ const e = this._injector.get(ir);
3614
+ this.disposeWithMe(e.register(To, xr)), this.disposeWithMe(e.register(xo, Ei)), this.disposeWithMe(this._uiPartsService.registerComponent(gs.GLOBAL, () => cr(Ic, this._injector)));
3540
3615
  }
3541
3616
  };
3542
- Mr(wt, "pluginName", ur);
3543
- Mr(wt, "type", J.UNIVER_SHEET);
3544
- wt = Rc([
3545
- eo(Do, os),
3546
- Rt(1, B(dt)),
3547
- Rt(2, xe),
3548
- Rt(3, to),
3549
- Rt(4, or)
3550
- ], wt);
3617
+ Ar(Ut, "pluginName", dr);
3618
+ Ar(Ut, "type", q.UNIVER_SHEET);
3619
+ Ut = Oc([
3620
+ no(Po, as),
3621
+ Nt(1, B(Ct)),
3622
+ Nt(2, Oe),
3623
+ Nt(3, ro),
3624
+ Nt(4, sr)
3625
+ ], Ut);
3551
3626
  export {
3552
- Is as FORMULA_PROMPT_ACTIVATED,
3553
- _i as FormulaEditor,
3554
- yt as FormulaReorderController,
3555
- Tr as GlobalRangeSelectorService,
3556
- ys as HelpFunctionOperation,
3557
- an as InsertFunctionOperation,
3558
- un as MoreFunctionsOperation,
3559
- yr as RangeSelector,
3560
- Fe as RefSelectionsRenderService,
3561
- hr as ReferenceAbsoluteOperation,
3562
- As as SearchFunctionOperation,
3563
- ot as SelectEditorFormulaOperation,
3564
- cn as SheetOnlyPasteFormulaCommand,
3565
- wt as UniverSheetsFormulaUIPlugin
3627
+ Ts as FORMULA_PROMPT_ACTIVATED,
3628
+ Ei as FormulaEditor,
3629
+ kt as FormulaReorderController,
3630
+ Or as GlobalRangeSelectorService,
3631
+ xs as HelpFunctionOperation,
3632
+ he as InsertFunctionOperation,
3633
+ fr as MoreFunctionsOperation,
3634
+ xr as RangeSelector,
3635
+ De as RefSelectionsRenderService,
3636
+ gr as ReferenceAbsoluteOperation,
3637
+ Fs as SearchFunctionOperation,
3638
+ ht as SelectEditorFormulaOperation,
3639
+ gn as SheetOnlyPasteFormulaCommand,
3640
+ Ut as UniverSheetsFormulaUIPlugin
3566
3641
  };