@univerjs/sheets-formula-ui 0.9.1 → 0.9.2

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