@univerjs/sheets-table 0.10.2 → 0.10.3-experimental.20250812-b4b6f1a

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/index.js CHANGED
@@ -1,56 +1,56 @@
1
- var Ke = Object.defineProperty;
2
- var Xe = (t, e, n) => e in t ? Ke(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var b = (t, e, n) => Xe(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { CellValueType as q, BorderStyleTypes as Ze, generateRandomId as L, IUniverInstanceService as W, Inject as C, LocaleService as de, Disposable as k, CommandType as N, IUndoRedoService as A, ICommandService as x, sequenceExecute as B, IResourceManagerService as et, Rectangle as Se, RTree as tt, InterceptorEffectEnum as nt, UniverInstanceType as he, customNameCharacterCheck as rt, ILogService as st, Injector as Be, Plugin as at, merge as ot, registerDependencies as it, touchDependencies as Me, IConfigService as lt } from "@univerjs/core";
5
- import { getSheetCommandTarget as $, SheetInterceptorService as _e, INTERCEPTOR_POINT as Le, AddRangeThemeMutation as Ee, RemoveRangeThemeMutation as We, SheetRangeThemeModel as He, SheetsSelectionsService as ge, InsertRowMutation as Pe, RemoveRowMutation as Ve, getMoveRangeUndoRedoMutations as me, InsertColMutation as qe, RemoveColMutation as Je, IExclusiveRangeService as ut, RefRangeService as ct, RemoveColCommand as dt, RemoveRowCommand as ht, InsertColCommand as gt, InsertRowCommand as mt, SheetRangeThemeService as bt, RangeThemeStyle as wt } from "@univerjs/sheets";
6
- import { Subject as Q, BehaviorSubject as ke, filter as be, switchMap as ve } from "rxjs";
7
- var I = /* @__PURE__ */ ((t) => (t.Insert = "insert", t.Delete = "delete", t))(I || {}), D = /* @__PURE__ */ ((t) => (t.Row = "row", t.Col = "column", t))(D || {}), Qe = /* @__PURE__ */ ((t) => (t.None = "none", t.String = "string", t.Number = "number", t.Date = "date", t.Bool = "bool", t.Checkbox = "checkbox", t.List = "list", t))(Qe || {}), ee = /* @__PURE__ */ ((t) => (t.manual = "manual", t.condition = "condition", t))(ee || {}), U = /* @__PURE__ */ ((t) => (t.Date = "date", t.Number = "number", t.String = "string", t.Logic = "logic", t))(U || {}), F = /* @__PURE__ */ ((t) => (t.Equal = "equal", t.NotEqual = "notEqual", t.GreaterThan = "greaterThan", t.GreaterThanOrEqual = "greaterThanOrEqual", t.LessThan = "lessThan", t.LessThanOrEqual = "lessThanOrEqual", t.Between = "between", t.NotBetween = "notBetween", t.Above = "above", t.Below = "below", t.TopN = "topN", t))(F || {}), P = /* @__PURE__ */ ((t) => (t.Equal = "equal", t.NotEqual = "notEqual", t.Contains = "contains", t.NotContains = "notContains", t.StartsWith = "startsWith", t.EndsWith = "endsWith", t))(P || {}), g = /* @__PURE__ */ ((t) => (t.Equal = "equal", t.NotEqual = "notEqual", t.After = "after", t.AfterOrEqual = "afterOrEqual", t.Before = "before", t.BeforeOrEqual = "beforeOrEqual", t.Between = "between", t.NotBetween = "notBetween", t.Today = "today", t.Yesterday = "yesterday", t.Tomorrow = "tomorrow", t.ThisWeek = "thisWeek", t.LastWeek = "lastWeek", t.NextWeek = "nextWeek", t.ThisMonth = "thisMonth", t.LastMonth = "lastMonth", t.NextMonth = "nextMonth", t.ThisQuarter = "thisQuarter", t.LastQuarter = "lastQuarter", t.NextQuarter = "nextQuarter", t.ThisYear = "thisYear", t.LastYear = "lastYear", t.NextYear = "nextYear", t.YearToDate = "yearToDate", t.Quarter = "quarter", t.Month = "month", t.M1 = "m1", t.M2 = "m2", t.M3 = "m3", t.M4 = "m4", t.M5 = "m5", t.M6 = "m6", t.M7 = "m7", t.M8 = "m8", t.M9 = "m9", t.M10 = "m10", t.M11 = "m11", t.M12 = "m12", t.Q1 = "q1", t.Q2 = "q2", t.Q3 = "q3", t.Q4 = "q4", t))(g || {}), V = /* @__PURE__ */ ((t) => (t[t.FilteredSortNone = 1] = "FilteredSortNone", t[t.FilteredSortAsc = 2] = "FilteredSortAsc", t[t.FilteredSortDesc = 3] = "FilteredSortDesc", t[t.FilterNoneSortNone = 4] = "FilterNoneSortNone", t[t.FilterNoneSortAsc = 5] = "FilterNoneSortAsc", t[t.FilterNoneSortDesc = 6] = "FilterNoneSortDesc", t))(V || {}), G = /* @__PURE__ */ ((t) => (t.Asc = "asc", t.Desc = "desc", t.None = "none", t))(G || {});
8
- function Z(t, e) {
1
+ var Ze = Object.defineProperty;
2
+ var et = (t, e, n) => e in t ? Ze(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var b = (t, e, n) => et(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { CellValueType as q, BorderStyleTypes as tt, generateRandomId as L, IUniverInstanceService as W, Inject as C, LocaleService as de, Disposable as k, CommandType as N, IUndoRedoService as A, ICommandService as x, sequenceExecute as B, IResourceManagerService as nt, Rectangle as pe, RTree as rt, InterceptorEffectEnum as st, UniverInstanceType as he, customNameCharacterCheck as at, ILogService as ot, Injector as Ae, IConfigService as Be, Plugin as it, merge as lt, registerDependencies as ut, touchDependencies as Ie } from "@univerjs/core";
5
+ import { getSheetCommandTarget as $, SheetInterceptorService as Ce, INTERCEPTOR_POINT as Le, AddRangeThemeMutation as Ee, RemoveRangeThemeMutation as We, SheetRangeThemeModel as He, SheetsSelectionsService as ge, InsertRowMutation as Pe, RemoveRowMutation as Ve, getMoveRangeUndoRedoMutations as me, InsertColMutation as qe, RemoveColMutation as Je, IExclusiveRangeService as ct, RefRangeService as dt, RemoveColCommand as ht, RemoveRowCommand as gt, InsertColCommand as mt, InsertRowCommand as bt, SheetRangeThemeService as wt, RangeThemeStyle as ft } from "@univerjs/sheets";
6
+ import { Subject as Q, BehaviorSubject as ke, filter as be, switchMap as Me } from "rxjs";
7
+ var I = /* @__PURE__ */ ((t) => (t.Insert = "insert", t.Delete = "delete", t))(I || {}), D = /* @__PURE__ */ ((t) => (t.Row = "row", t.Col = "column", t))(D || {}), Qe = /* @__PURE__ */ ((t) => (t.None = "none", t.String = "string", t.Number = "number", t.Date = "date", t.Bool = "bool", t.Checkbox = "checkbox", t.List = "list", t))(Qe || {}), Z = /* @__PURE__ */ ((t) => (t.manual = "manual", t.condition = "condition", t))(Z || {}), U = /* @__PURE__ */ ((t) => (t.Date = "date", t.Number = "number", t.String = "string", t.Logic = "logic", t))(U || {}), F = /* @__PURE__ */ ((t) => (t.Equal = "equal", t.NotEqual = "notEqual", t.GreaterThan = "greaterThan", t.GreaterThanOrEqual = "greaterThanOrEqual", t.LessThan = "lessThan", t.LessThanOrEqual = "lessThanOrEqual", t.Between = "between", t.NotBetween = "notBetween", t.Above = "above", t.Below = "below", t.TopN = "topN", t))(F || {}), P = /* @__PURE__ */ ((t) => (t.Equal = "equal", t.NotEqual = "notEqual", t.Contains = "contains", t.NotContains = "notContains", t.StartsWith = "startsWith", t.EndsWith = "endsWith", t))(P || {}), g = /* @__PURE__ */ ((t) => (t.Equal = "equal", t.NotEqual = "notEqual", t.After = "after", t.AfterOrEqual = "afterOrEqual", t.Before = "before", t.BeforeOrEqual = "beforeOrEqual", t.Between = "between", t.NotBetween = "notBetween", t.Today = "today", t.Yesterday = "yesterday", t.Tomorrow = "tomorrow", t.ThisWeek = "thisWeek", t.LastWeek = "lastWeek", t.NextWeek = "nextWeek", t.ThisMonth = "thisMonth", t.LastMonth = "lastMonth", t.NextMonth = "nextMonth", t.ThisQuarter = "thisQuarter", t.LastQuarter = "lastQuarter", t.NextQuarter = "nextQuarter", t.ThisYear = "thisYear", t.LastYear = "lastYear", t.NextYear = "nextYear", t.YearToDate = "yearToDate", t.Quarter = "quarter", t.Month = "month", t.M1 = "m1", t.M2 = "m2", t.M3 = "m3", t.M4 = "m4", t.M5 = "m5", t.M6 = "m6", t.M7 = "m7", t.M8 = "m8", t.M9 = "m9", t.M10 = "m10", t.M11 = "m11", t.M12 = "m12", t.Q1 = "q1", t.Q2 = "q2", t.Q3 = "q3", t.Q4 = "q4", t))(g || {}), V = /* @__PURE__ */ ((t) => (t[t.FilteredSortNone = 1] = "FilteredSortNone", t[t.FilteredSortAsc = 2] = "FilteredSortAsc", t[t.FilteredSortDesc = 3] = "FilteredSortDesc", t[t.FilterNoneSortNone = 4] = "FilterNoneSortNone", t[t.FilterNoneSortAsc = 5] = "FilterNoneSortAsc", t[t.FilterNoneSortDesc = 6] = "FilterNoneSortDesc", t))(V || {}), Y = /* @__PURE__ */ ((t) => (t.Asc = "asc", t.Desc = "desc", t.None = "none", t))(Y || {});
8
+ function X(t, e) {
9
9
  return `${e} ${t}`;
10
10
  }
11
- const Fe = "TRUE", De = "FALSE", Rt = (t) => {
11
+ const ve = "TRUE", Fe = "FALSE", Rt = (t) => {
12
12
  var n;
13
13
  return ((n = t.body) == null ? void 0 : n.dataStream.replace(/\r\n$/, "")) || "";
14
14
  };
15
15
  function Ye(t) {
16
16
  if (t) {
17
17
  const { v: e, t: n, p: r } = t;
18
- return r ? Rt(r) : (n === q.FORCE_STRING || n === q.STRING) && e !== void 0 && e !== null ? String(e) : n === q.BOOLEAN ? e ? Fe : De : n === q.NUMBER ? String(e) : typeof e === "boolean" ? e ? Fe : De : e == null ? "" : String(e);
18
+ return r ? Rt(r) : (n === q.FORCE_STRING || n === q.STRING) && e !== void 0 && e !== null ? String(e) : n === q.BOOLEAN ? e ? ve : Fe : n === q.NUMBER ? String(e) : typeof e === "boolean" ? e ? ve : Fe : e == null ? "" : String(e);
19
19
  }
20
20
  return "";
21
21
  }
22
- function ft(t, e) {
22
+ function pt(t, e) {
23
23
  if (t != null)
24
24
  switch (e) {
25
- case G.Asc:
25
+ case Y.Asc:
26
26
  return V.FilteredSortAsc;
27
- case G.Desc:
27
+ case Y.Desc:
28
28
  return V.FilteredSortDesc;
29
29
  default:
30
30
  return V.FilteredSortNone;
31
31
  }
32
32
  else
33
33
  switch (e) {
34
- case G.Asc:
34
+ case Y.Asc:
35
35
  return V.FilterNoneSortAsc;
36
- case G.Desc:
36
+ case Y.Desc:
37
37
  return V.FilterNoneSortDesc;
38
38
  default:
39
39
  return V.FilterNoneSortNone;
40
40
  }
41
41
  }
42
- function pt(t) {
43
- return t ? t.filterType === ee.condition : !1;
42
+ function St(t) {
43
+ return t ? t.filterType === Z.condition : !1;
44
44
  }
45
45
  function tr(t) {
46
- return t ? t.filterType === ee.manual : !1;
46
+ return t ? t.filterType === Z.manual : !1;
47
47
  }
48
48
  const y = {
49
- s: Ze.THIN,
49
+ s: tt.THIN,
50
50
  cl: {
51
51
  rgb: "rgb(95 101 116)"
52
52
  }
53
- }, nr = {
53
+ }, Ge = "sheets-table.config", De = {}, nr = {
54
54
  headerRowStyle: {
55
55
  bd: {
56
56
  t: y
@@ -104,14 +104,14 @@ const y = {
104
104
  }
105
105
  };
106
106
  return e;
107
- }, St = [
107
+ }, Ct = [
108
108
  [["#6280F9", "#FFFFFF", "#BAC6F8", "#D2DAFA"], ["#fff"]],
109
109
  [["#16BDCA", "#FFFFFF", "#EDFAFA", "#AFECEF"], ["#000"]],
110
110
  [["#31C48D", "#FFFFFF", "#F3FAF7", "#BCF0DA"], ["#fff"]],
111
111
  [["#AC94FA", "#FFFFFF", "#F6F5FF", "#EDEBFE"], ["#fff"]],
112
112
  [["#F17EBB", "#FFFFFF", "#FDF2F8", "#FCE8F3"], ["#fff"]],
113
113
  [["#F98080", "#FFFFFF", "#FDF2F2", "#FDE8E8"], ["#fff"]]
114
- ], Y = St.map((t, e) => {
114
+ ], je = Ct.map((t, e) => {
115
115
  const [n, r] = t, [s, a, o, l] = n, [u] = r;
116
116
  return {
117
117
  name: `table-default-${e}`,
@@ -191,79 +191,79 @@ class J {
191
191
  this.id = e.id, this.displayName = e.displayName, this.dataType = e.dataType, this.formula = e.formula, this.meta = e.meta, this.style = e.style;
192
192
  }
193
193
  }
194
- const Ct = (t) => t.getMonth() <= 2, _t = (t) => {
194
+ const _t = (t) => t.getMonth() <= 2, Tt = (t) => {
195
195
  const e = t.getMonth();
196
196
  return e > 2 && e <= 5;
197
- }, Tt = (t) => {
197
+ }, It = (t) => {
198
198
  const e = t.getMonth();
199
199
  return e > 5 && e <= 8;
200
- }, It = (t) => {
200
+ }, Mt = (t) => {
201
201
  const e = t.getMonth();
202
202
  return e > 8 && e <= 11;
203
- }, Mt = (t) => t.getMonth() === 0, vt = (t) => t.getMonth() === 1, Ft = (t) => t.getMonth() === 2, Dt = (t) => t.getMonth() === 3, Nt = (t) => t.getMonth() === 4, yt = (t) => t.getMonth() === 5, xt = (t) => t.getMonth() === 6, Ot = (t) => t.getMonth() === 7, Ut = (t) => t.getMonth() === 8, $t = (t) => t.getMonth() === 9, At = (t) => t.getMonth() === 10, Bt = (t) => t.getMonth() === 11, Lt = (t, e = /* @__PURE__ */ new Date()) => t.toDateString() === e.toDateString(), Et = (t, e = /* @__PURE__ */ new Date()) => {
203
+ }, vt = (t) => t.getMonth() === 0, Ft = (t) => t.getMonth() === 1, Dt = (t) => t.getMonth() === 2, Nt = (t) => t.getMonth() === 3, yt = (t) => t.getMonth() === 4, xt = (t) => t.getMonth() === 5, Ot = (t) => t.getMonth() === 6, Ut = (t) => t.getMonth() === 7, $t = (t) => t.getMonth() === 8, At = (t) => t.getMonth() === 9, Bt = (t) => t.getMonth() === 10, Lt = (t) => t.getMonth() === 11, Et = (t, e = /* @__PURE__ */ new Date()) => t.toDateString() === e.toDateString(), Wt = (t, e = /* @__PURE__ */ new Date()) => {
204
204
  const n = new Date(e);
205
205
  return n.setDate(n.getDate() + 1), t.toDateString() === n.toDateString();
206
- }, Wt = (t, e = /* @__PURE__ */ new Date()) => {
206
+ }, Ht = (t, e = /* @__PURE__ */ new Date()) => {
207
207
  const n = new Date(e);
208
208
  return n.setDate(n.getDate() - 1), t.toDateString() === n.toDateString();
209
- }, j = (t) => {
209
+ }, G = (t) => {
210
210
  const e = t.getDay(), n = t.getDate() - e + (e === 0 ? -6 : 1), r = new Date(t);
211
211
  return r.setDate(n), r;
212
- }, Ge = 10080 * 60 * 1e3, Ht = (t, e = /* @__PURE__ */ new Date()) => {
213
- const n = j(t), r = j(e);
214
- return n.toDateString() === r.toDateString();
215
- }, Pt = (t, e = /* @__PURE__ */ new Date()) => {
216
- const n = j(t), r = new Date(j(e).getTime() + Ge);
212
+ }, ze = 10080 * 60 * 1e3, Pt = (t, e = /* @__PURE__ */ new Date()) => {
213
+ const n = G(t), r = G(e);
217
214
  return n.toDateString() === r.toDateString();
218
215
  }, Vt = (t, e = /* @__PURE__ */ new Date()) => {
219
- const n = j(t), r = new Date(j(e).getTime() - Ge);
216
+ const n = G(t), r = new Date(G(e).getTime() + ze);
220
217
  return n.toDateString() === r.toDateString();
221
- }, qt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth(), Jt = (t) => {
218
+ }, qt = (t, e = /* @__PURE__ */ new Date()) => {
219
+ const n = G(t), r = new Date(G(e).getTime() - ze);
220
+ return n.toDateString() === r.toDateString();
221
+ }, Jt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth(), kt = (t) => {
222
222
  const e = new Date(t);
223
223
  return e.setHours(0, 0, 0, 0), e.setDate(1), e;
224
- }, kt = (t, e = /* @__PURE__ */ new Date()) => {
224
+ }, Qt = (t, e = /* @__PURE__ */ new Date()) => {
225
225
  const n = new Date(e);
226
226
  n.setHours(0, 0, 0, 0), n.setMonth(n.getMonth() + 1, 1);
227
227
  const r = new Date(n);
228
228
  r.setMonth(r.getMonth() + 1, 0);
229
229
  const s = t.getTime();
230
230
  return s >= n.getTime() && s < r.getTime();
231
- }, Qt = (t, e = /* @__PURE__ */ new Date()) => {
232
- const n = Jt(e), r = new Date(n);
231
+ }, Yt = (t, e = /* @__PURE__ */ new Date()) => {
232
+ const n = kt(e), r = new Date(n);
233
233
  r.setMonth(r.getMonth() + 1, 0);
234
234
  const s = t.getTime();
235
235
  return s >= n.getTime() && s < r.getTime();
236
- }, Te = (t) => {
236
+ }, _e = (t) => {
237
237
  const e = new Date(t);
238
238
  e.setHours(0, 0, 0, 0), e.setDate(1);
239
239
  const n = e.getMonth();
240
240
  return e.setMonth(n - n % 3), e;
241
- }, Yt = (t, e = /* @__PURE__ */ new Date()) => {
242
- const n = Te(e), r = new Date(n);
241
+ }, Gt = (t, e = /* @__PURE__ */ new Date()) => {
242
+ const n = _e(e), r = new Date(n);
243
243
  r.setMonth(r.getMonth() + 3);
244
244
  const s = t.getTime();
245
245
  return s >= n.getTime() && s < r.getTime();
246
- }, Gt = (t, e = /* @__PURE__ */ new Date()) => {
247
- const n = Te(e), r = new Date(n);
246
+ }, jt = (t, e = /* @__PURE__ */ new Date()) => {
247
+ const n = _e(e), r = new Date(n);
248
248
  r.setMonth(r.getMonth() + 3);
249
249
  const s = new Date(r);
250
250
  s.setMonth(s.getMonth() + 3, 0);
251
251
  const a = t.getTime();
252
252
  return a >= r.getTime() && a < s.getTime();
253
- }, jt = (t, e = /* @__PURE__ */ new Date()) => {
254
- const n = Te(e), r = new Date(n);
253
+ }, zt = (t, e = /* @__PURE__ */ new Date()) => {
254
+ const n = _e(e), r = new Date(n);
255
255
  r.setMonth(r.getMonth() - 3);
256
256
  const s = new Date(n);
257
257
  s.setDate(0);
258
258
  const a = t.getTime();
259
259
  return a >= r.getTime() && a < s.getTime();
260
- }, zt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear(), Kt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() + 1, Xt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() - 1, Zt = (t, e = /* @__PURE__ */ new Date()) => {
260
+ }, Kt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear(), Xt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() + 1, Zt = (t, e = /* @__PURE__ */ new Date()) => t.getFullYear() === e.getFullYear() - 1, en = (t, e = /* @__PURE__ */ new Date()) => {
261
261
  const n = new Date(e);
262
262
  n.setHours(0, 0, 0, 0), n.setMonth(0, 1);
263
263
  const r = t.getTime();
264
264
  return r >= n.getTime() && r < e.getTime();
265
265
  };
266
- function en(t) {
266
+ function tn(t) {
267
267
  switch (t.compareType) {
268
268
  case g.Equal: {
269
269
  const e = new Date(t.expectedValue);
@@ -301,105 +301,105 @@ function en(t) {
301
301
  };
302
302
  case g.Today: {
303
303
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
304
- return (n) => Lt(n, e);
304
+ return (n) => Et(n, e);
305
305
  }
306
306
  case g.Yesterday: {
307
307
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
308
- return (n) => Wt(n, e);
308
+ return (n) => Ht(n, e);
309
309
  }
310
310
  case g.Tomorrow: {
311
311
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
312
- return (n) => Et(n, e);
312
+ return (n) => Wt(n, e);
313
313
  }
314
314
  case g.ThisWeek: {
315
315
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
316
- return (n) => Ht(n, e);
316
+ return (n) => Pt(n, e);
317
317
  }
318
318
  case g.LastWeek: {
319
319
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
320
- return (n) => Vt(n, e);
320
+ return (n) => qt(n, e);
321
321
  }
322
322
  case g.NextWeek: {
323
323
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
324
- return (n) => Pt(n, e);
324
+ return (n) => Vt(n, e);
325
325
  }
326
326
  case g.ThisMonth: {
327
327
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
328
- return (n) => qt(n, e);
328
+ return (n) => Jt(n, e);
329
329
  }
330
330
  case g.LastMonth: {
331
331
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
332
- return (n) => Qt(n, e);
332
+ return (n) => Yt(n, e);
333
333
  }
334
334
  case g.NextMonth: {
335
335
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
336
- return (n) => kt(n, e);
336
+ return (n) => Qt(n, e);
337
337
  }
338
338
  case g.ThisQuarter: {
339
339
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
340
- return (n) => Yt(n, e);
340
+ return (n) => Gt(n, e);
341
341
  }
342
342
  case g.LastQuarter: {
343
343
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
344
- return (n) => jt(n, e);
344
+ return (n) => zt(n, e);
345
345
  }
346
346
  case g.NextQuarter: {
347
347
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
348
- return (n) => Gt(n, e);
348
+ return (n) => jt(n, e);
349
349
  }
350
350
  case g.ThisYear: {
351
351
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
352
- return (n) => zt(n, e);
352
+ return (n) => Kt(n, e);
353
353
  }
354
354
  case g.LastYear: {
355
355
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
356
- return (n) => Xt(n, e);
356
+ return (n) => Zt(n, e);
357
357
  }
358
358
  case g.NextYear: {
359
359
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
360
- return (n) => Kt(n, e);
360
+ return (n) => Xt(n, e);
361
361
  }
362
362
  case g.YearToDate: {
363
363
  const e = t.anchorTime ? new Date(t.anchorTime) : /* @__PURE__ */ new Date();
364
- return (n) => Zt(n, e);
364
+ return (n) => en(n, e);
365
365
  }
366
366
  case g.M1:
367
- return Mt;
368
- case g.M2:
369
367
  return vt;
370
- case g.M3:
368
+ case g.M2:
371
369
  return Ft;
372
- case g.M4:
370
+ case g.M3:
373
371
  return Dt;
374
- case g.M5:
372
+ case g.M4:
375
373
  return Nt;
376
- case g.M6:
374
+ case g.M5:
377
375
  return yt;
378
- case g.M7:
376
+ case g.M6:
379
377
  return xt;
380
- case g.M8:
378
+ case g.M7:
381
379
  return Ot;
382
- case g.M9:
380
+ case g.M8:
383
381
  return Ut;
384
- case g.M10:
382
+ case g.M9:
385
383
  return $t;
386
- case g.M11:
384
+ case g.M10:
387
385
  return At;
388
- case g.M12:
386
+ case g.M11:
389
387
  return Bt;
388
+ case g.M12:
389
+ return Lt;
390
390
  case g.Q1:
391
- return Ct;
392
- case g.Q2:
393
391
  return _t;
394
- case g.Q3:
392
+ case g.Q2:
395
393
  return Tt;
396
- case g.Q4:
394
+ case g.Q3:
397
395
  return It;
396
+ case g.Q4:
397
+ return Mt;
398
398
  default:
399
399
  throw new Error("Unsupported compare type");
400
400
  }
401
401
  }
402
- class tn {
402
+ class nn {
403
403
  /**
404
404
  * Initializes a new instance of the Heap class.
405
405
  */
@@ -463,7 +463,7 @@ class tn {
463
463
  return this.heap.includes(e);
464
464
  }
465
465
  }
466
- class nn extends tn {
466
+ class rn extends nn {
467
467
  /**
468
468
  * Initializes a new instance of the MinHeap class.
469
469
  */
@@ -502,13 +502,13 @@ class nn extends tn {
502
502
  this.heap[0] = this.heap.pop(), this.shiftDown(0);
503
503
  }
504
504
  }
505
- const rn = (t, e) => {
506
- const n = new nn();
505
+ const sn = (t, e) => {
506
+ const n = new rn();
507
507
  for (const r of t)
508
508
  n.insert(r), n.size() > e && n.pop();
509
509
  return n.heap;
510
- }, sn = (t, e) => t > e, an = (t, e) => t < e, on = (t, e, n) => rn(t, e).includes(n);
511
- function ln(t, e) {
510
+ }, an = (t, e) => t > e, on = (t, e) => t < e, ln = (t, e, n) => sn(t, e).includes(n);
511
+ function un(t, e) {
512
512
  switch (t.compareType) {
513
513
  case F.Equal: {
514
514
  const n = Number(t.expectedValue);
@@ -544,59 +544,59 @@ function ln(t, e) {
544
544
  }
545
545
  case F.Above: {
546
546
  const n = e.average;
547
- return (r) => sn(r, n);
547
+ return (r) => an(r, n);
548
548
  }
549
549
  case F.Below: {
550
550
  const n = e.average;
551
- return (r) => an(r, n);
551
+ return (r) => on(r, n);
552
552
  }
553
553
  case F.TopN: {
554
554
  const n = e.list, r = Number(t.expectedValue);
555
- return (s) => on(n, r, s);
555
+ return (s) => ln(n, r, s);
556
556
  }
557
557
  }
558
558
  }
559
- const K = (t) => {
559
+ const z = (t) => {
560
560
  const n = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\\\*/g, ".*").replace(/\\\?/g, ".");
561
561
  return new RegExp(`^${n}$`);
562
- }, un = (t, e) => K(e).test(t), cn = (t, e) => !K(e).test(t), dn = (t, e) => K(`*${e}*`).test(t), hn = (t, e) => !K(`*${e}*`).test(t), gn = (t, e) => K(`${e}*`).test(t), mn = (t, e) => K(`*${e}`).test(t);
563
- function bn(t) {
562
+ }, cn = (t, e) => z(e).test(t), dn = (t, e) => !z(e).test(t), hn = (t, e) => z(`*${e}*`).test(t), gn = (t, e) => !z(`*${e}*`).test(t), mn = (t, e) => z(`${e}*`).test(t), bn = (t, e) => z(`*${e}`).test(t);
563
+ function wn(t) {
564
564
  switch (t.compareType) {
565
565
  case P.Equal:
566
- return (e) => un(e, t.expectedValue);
567
- case P.NotEqual:
568
566
  return (e) => cn(e, t.expectedValue);
569
- case P.Contains:
567
+ case P.NotEqual:
570
568
  return (e) => dn(e, t.expectedValue);
571
- case P.NotContains:
569
+ case P.Contains:
572
570
  return (e) => hn(e, t.expectedValue);
573
- case P.StartsWith:
571
+ case P.NotContains:
574
572
  return (e) => gn(e, t.expectedValue);
575
- case P.EndsWith:
573
+ case P.StartsWith:
576
574
  return (e) => mn(e, t.expectedValue);
575
+ case P.EndsWith:
576
+ return (e) => bn(e, t.expectedValue);
577
577
  default:
578
578
  return console.error(`Unknown filter operator: ${t.compareType}`), (e) => !0;
579
579
  }
580
580
  }
581
- const wn = /* @__PURE__ */ new Set([
581
+ const fn = /* @__PURE__ */ new Set([
582
582
  F.Above,
583
583
  F.Below,
584
584
  F.TopN
585
585
  ]);
586
586
  g.Today, g.Yesterday, g.Tomorrow, g.ThisWeek, g.LastWeek, g.NextWeek, g.ThisMonth, g.LastMonth, g.NextMonth, g.ThisQuarter, g.LastQuarter, g.NextQuarter, g.NextYear, g.ThisYear, g.LastYear, g.YearToDate;
587
- function je(t) {
588
- return wn.has(t);
587
+ function Ke(t) {
588
+ return fn.has(t);
589
589
  }
590
590
  function Rn(t, e) {
591
- if (je(t.filterInfo.compareType))
591
+ if (Ke(t.filterInfo.compareType))
592
592
  return (n) => !0;
593
593
  switch (t.filterInfo.conditionType) {
594
594
  case U.Date:
595
- return en(t.filterInfo);
595
+ return tn(t.filterInfo);
596
596
  case U.Number:
597
- return ln(t.filterInfo, e);
597
+ return un(t.filterInfo, e);
598
598
  case U.String:
599
- return bn(t.filterInfo);
599
+ return wn(t.filterInfo);
600
600
  case U.Logic:
601
601
  default:
602
602
  return (n) => !0;
@@ -606,24 +606,32 @@ function oe(t, e, n, r) {
606
606
  switch (r) {
607
607
  case U.Date: {
608
608
  const s = Ne(t, e, n);
609
- return s ? Sn(s) : null;
609
+ return s ? Cn(s) : null;
610
610
  }
611
611
  case U.Number:
612
612
  return Ne(t, e, n);
613
613
  case U.String:
614
614
  default:
615
- return pn(t, e, n);
615
+ return Sn(t, e, n);
616
616
  }
617
617
  }
618
- const fn = (t) => {
618
+ const pn = (t) => {
619
619
  var n;
620
620
  return ((n = t.body) == null ? void 0 : n.dataStream.replace(/\r\n$/, "")) || "";
621
621
  };
622
- function pn(t, e, n) {
622
+ function Sn(t, e, n) {
623
623
  const r = t.getCell(e, n);
624
624
  if (!r) return null;
625
625
  const { v: s, t: a, p: o } = r;
626
- return o ? fn(o) : typeof s == "string" ? a === q.BOOLEAN ? s.toUpperCase() : s : typeof s == "number" ? a === q.BOOLEAN ? s ? "TRUE" : "FALSE" : s : typeof s == "boolean" ? s ? "TRUE" : "FALSE" : s === void 0 ? "(空白)" : String(s);
626
+ if (o)
627
+ return pn(o);
628
+ if (typeof s == "string")
629
+ return a === q.BOOLEAN ? s.toUpperCase() : s;
630
+ if (typeof s == "number")
631
+ return a === q.BOOLEAN ? s ? "TRUE" : "FALSE" : s;
632
+ if (typeof s == "boolean") return s ? "TRUE" : "FALSE";
633
+ if (s !== void 0)
634
+ return String(s);
627
635
  }
628
636
  function Ne(t, e, n) {
629
637
  const r = t.getCell(e, n);
@@ -631,7 +639,7 @@ function Ne(t, e, n) {
631
639
  const { v: s, t: a, p: o } = r;
632
640
  return o ? null : typeof s == "string" && a === q.NUMBER ? Number(t.getCellRaw(e, n).v) : Number(s);
633
641
  }
634
- function Sn(t) {
642
+ function Cn(t) {
635
643
  const e = new Date(Date.UTC(1900, 0, 1, 0, 0, 0)), n = new Date(Date.UTC(1900, 1, 28, 0, 0, 0));
636
644
  let r = t - 1;
637
645
  return r > (n.getTime() - e.getTime()) / (1e3 * 3600 * 24) && (r -= 1), r < 0 && (r = t), new Date(e.getTime() + r * (1e3 * 3600 * 24));
@@ -654,8 +662,8 @@ class ye {
654
662
  }
655
663
  getFilterState(e) {
656
664
  var r;
657
- const n = ((r = this._tableSortInfo) == null ? void 0 : r.columnIndex) === e ? this._tableSortInfo.sortState : G.None;
658
- return ft(this._tableColumnFilterList[e], n);
665
+ const n = ((r = this._tableSortInfo) == null ? void 0 : r.columnIndex) === e ? this._tableSortInfo.sortState : Y.None;
666
+ return pt(this._tableColumnFilterList[e], n);
659
667
  }
660
668
  getSortState() {
661
669
  var e;
@@ -681,7 +689,7 @@ class ye {
681
689
  if (a && e) {
682
690
  const { startRow: o, endRow: l, startColumn: u } = n, i = u + r, h = this.getExecuteFunc(e, n, r, a);
683
691
  for (let d = o; d <= l; d++) {
684
- const c = pt(a) ? a.filterInfo.conditionType : U.String;
692
+ const c = St(a) ? a.filterInfo.conditionType : U.String;
685
693
  oe(e, d, i, c) === null ? s.add(d) : h(oe(e, d, i, c)) || s.add(d);
686
694
  }
687
695
  }
@@ -699,11 +707,11 @@ class ye {
699
707
  };
700
708
  }
701
709
  getExecuteFunc(e, n, r, s) {
702
- if (s.filterType === ee.manual) {
710
+ if (s.filterType === Z.manual) {
703
711
  const a = new Set(s.values);
704
712
  return (o) => a.has(o);
705
- } else if (s.filterType === ee.condition) {
706
- const o = je(s.filterInfo.compareType) ? this._getNumberCalculatedOptions(e, n, r) : void 0;
713
+ } else if (s.filterType === Z.condition) {
714
+ const o = Ke(s.filterInfo.compareType) ? this._getNumberCalculatedOptions(e, n, r) : void 0;
707
715
  return Rn(s, o);
708
716
  } else
709
717
  return (a) => !0;
@@ -839,7 +847,7 @@ class xe {
839
847
  }
840
848
  getTableStyleId() {
841
849
  var e;
842
- return (e = this._tableStyleId) != null ? e : Y[0].name;
850
+ return (e = this._tableStyleId) != null ? e : je[0].name;
843
851
  }
844
852
  setTableStyleId(e) {
845
853
  this._tableStyleId = e;
@@ -909,8 +917,8 @@ class xe {
909
917
  this._id = "", this._name = "", this._tableStyleId = "", this._showHeader = !0, this._showFooter = !0, delete this._range, this._columns.clear(), this._columnOrder = [];
910
918
  }
911
919
  }
912
- var Cn = Object.getOwnPropertyDescriptor, _n = (t, e, n, r) => {
913
- for (var s = r > 1 ? void 0 : r ? Cn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
920
+ var _n = Object.getOwnPropertyDescriptor, Tn = (t, e, n, r) => {
921
+ for (var s = r > 1 ? void 0 : r ? _n(e, n) : e, a = t.length - 1, o; a >= 0; a--)
914
922
  (o = t[a]) && (s = o(s) || s);
915
923
  return s;
916
924
  }, Oe = (t, e) => (n, r) => e(n, r, t);
@@ -941,7 +949,7 @@ let _ = class extends k {
941
949
  var d;
942
950
  const a = (d = this._univerInstanceService.getUnit(e)) == null ? void 0 : d.getSheetBySheetId(n), { startRow: o, startColumn: l, endColumn: u } = r, i = [], h = s != null ? s : "Column";
943
951
  for (let c = l; c <= u; c++)
944
- i.push(Ye(a == null ? void 0 : a.getCell(o, c)) || Z(c - l + 1, h));
952
+ i.push(Ye(a == null ? void 0 : a.getCell(o, c)) || X(c - l + 1, h));
945
953
  return i;
946
954
  }
947
955
  /**
@@ -1074,7 +1082,7 @@ let _ = class extends k {
1074
1082
  else if (o === "column") {
1075
1083
  d.endColumn += u;
1076
1084
  for (let c = 0; c < u; c++) {
1077
- const m = this._localeService.t("sheets-table.columnPrefix"), S = new J(L(), Z(s.getColumnsCount() + 1 + c, m));
1085
+ const m = this._localeService.t("sheets-table.columnPrefix"), S = new J(L(), X(s.getColumnsCount() + 1 + c, m));
1078
1086
  i != null && i[c] && S.fromJSON(i[c]);
1079
1087
  const w = l + c - h.startColumn;
1080
1088
  s.insertColumn(w, S);
@@ -1104,7 +1112,7 @@ let _ = class extends k {
1104
1112
  if (o.startColumn < a.startColumn) {
1105
1113
  const l = a.startColumn - o.startColumn, u = this._localeService.t("sheets-table.columnPrefix");
1106
1114
  for (let i = 0; i < l; i++)
1107
- s.insertColumn(a.startColumn, new J(L(), Z(s.getColumnsCount() + 1, u)));
1115
+ s.insertColumn(a.startColumn, new J(L(), X(s.getColumnsCount() + 1, u)));
1108
1116
  } else if (o.startColumn > a.startColumn) {
1109
1117
  const l = o.startColumn - a.startColumn;
1110
1118
  for (let u = l - 1; u >= 0; u--) {
@@ -1121,7 +1129,7 @@ let _ = class extends k {
1121
1129
  } else if (o.endColumn > a.endColumn) {
1122
1130
  const l = o.endColumn - a.endColumn;
1123
1131
  for (let u = 0; u < l; u++)
1124
- s.insertColumn(a.endColumn, new J(L(), Z(s.getColumnsCount() + 1, "Column")));
1132
+ s.insertColumn(a.endColumn, new J(L(), X(s.getColumnsCount() + 1, "Column")));
1125
1133
  }
1126
1134
  s.setRange(o), this._tableRangeChanged$.next({
1127
1135
  unitId: e,
@@ -1210,16 +1218,16 @@ let _ = class extends k {
1210
1218
  }), this._tableMap.clear();
1211
1219
  }
1212
1220
  };
1213
- _ = _n([
1221
+ _ = Tn([
1214
1222
  Oe(0, W),
1215
1223
  Oe(1, C(de))
1216
1224
  ], _);
1217
- var Tn = Object.getOwnPropertyDescriptor, In = (t, e, n, r) => {
1218
- for (var s = r > 1 ? void 0 : r ? Tn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
1225
+ var In = Object.getOwnPropertyDescriptor, Mn = (t, e, n, r) => {
1226
+ for (var s = r > 1 ? void 0 : r ? In(e, n) : e, a = t.length - 1, o; a >= 0; a--)
1219
1227
  (o = t[a]) && (s = o(s) || s);
1220
1228
  return s;
1221
- }, Mn = (t, e) => (n, r) => e(n, r, t);
1222
- let z = class extends k {
1229
+ }, vn = (t, e) => (n, r) => e(n, r, t);
1230
+ let j = class extends k {
1223
1231
  constructor(t) {
1224
1232
  super(), this._tableManager = t;
1225
1233
  }
@@ -1263,24 +1271,24 @@ let z = class extends k {
1263
1271
  return oe(t, e, n, r);
1264
1272
  }
1265
1273
  };
1266
- z = In([
1267
- Mn(0, C(_))
1268
- ], z);
1269
- const te = {
1274
+ j = Mn([
1275
+ vn(0, C(_))
1276
+ ], j);
1277
+ const ee = {
1270
1278
  id: "sheet.mutation.add-table",
1271
1279
  type: N.MUTATION,
1272
1280
  handler: (t, e) => {
1273
1281
  const { tableId: n, unitId: r, subUnitId: s, name: a, range: o, header: l, options: u } = e;
1274
- return t.get(z).addTable(r, s, a, o, l, n, u), !0;
1282
+ return t.get(j).addTable(r, s, a, o, l, n, u), !0;
1275
1283
  }
1276
- }, ne = {
1284
+ }, te = {
1277
1285
  id: "sheet.mutation.delete-table",
1278
1286
  type: N.MUTATION,
1279
1287
  handler: (t, e) => {
1280
1288
  const { unitId: n, subUnitId: r, tableId: s } = e;
1281
- return t.get(z).deleteTable(n, r, s), !0;
1289
+ return t.get(j).deleteTable(n, r, s), !0;
1282
1290
  }
1283
- }, vn = {
1291
+ }, Fn = {
1284
1292
  id: "sheet.command.add-table",
1285
1293
  type: N.COMMAND,
1286
1294
  handler: (t, e) => {
@@ -1290,17 +1298,17 @@ const te = {
1290
1298
  const n = t.get(A), r = t.get(x), s = t.get(de), a = (w = e.id) != null ? w : L();
1291
1299
  let o = e.name;
1292
1300
  if (!o) {
1293
- const R = t.get(_).getTableList(e.unitId).length;
1294
- o = `${s.t("sheets-table.tablePrefix")}${R + 1}`;
1301
+ const f = t.get(_).getTableList(e.unitId).length;
1302
+ o = `${s.t("sheets-table.tablePrefix")}${f + 1}`;
1295
1303
  }
1296
1304
  const l = [], u = [], i = t.get(_), { unitId: h, subUnitId: d, range: c } = e, m = i.getColumnHeader(h, d, c, s.t("sheets-table.columnPrefix"));
1297
- return l.push({ id: te.id, params: { ...e, tableId: a, name: o, header: m } }), u.push({ id: ne.id, params: { tableId: a, unitId: e.unitId } }), B(l, r) && n.pushUndoRedo({
1305
+ return l.push({ id: ee.id, params: { ...e, tableId: a, name: o, header: m } }), u.push({ id: te.id, params: { tableId: a, unitId: e.unitId } }), B(l, r) && n.pushUndoRedo({
1298
1306
  unitID: e.unitId,
1299
1307
  undoMutations: u,
1300
1308
  redoMutations: l
1301
1309
  }), !0;
1302
1310
  }
1303
- }, Fn = {
1311
+ }, Dn = {
1304
1312
  id: "sheet.command.delete-table",
1305
1313
  type: N.COMMAND,
1306
1314
  handler: (t, e) => {
@@ -1309,8 +1317,8 @@ const te = {
1309
1317
  const n = t.get(A), r = t.get(x), s = t.get(_), a = [], o = [], l = s.getTable(e.unitId, e.tableId), u = l == null ? void 0 : l.toJSON();
1310
1318
  if (!u)
1311
1319
  throw new Error("[TableManager]: Table not found");
1312
- return a.push({ id: ne.id, params: { ...e } }), o.push({
1313
- id: te.id,
1320
+ return a.push({ id: te.id, params: { ...e } }), o.push({
1321
+ id: ee.id,
1314
1322
  params: {
1315
1323
  unitId: e.unitId,
1316
1324
  subUnitId: e.subUnitId,
@@ -1325,29 +1333,29 @@ const te = {
1325
1333
  redoMutations: a
1326
1334
  }), !0;
1327
1335
  }
1328
- }, Ce = {
1336
+ }, Se = {
1329
1337
  id: "sheet.mutation.set-table-filter",
1330
1338
  type: N.MUTATION,
1331
1339
  handler: (t, e) => {
1332
1340
  const { tableId: n, unitId: r, column: s, tableFilter: a } = e;
1333
1341
  return t.get(_).addFilter(r, n, s, a), !0;
1334
1342
  }
1335
- }, Dn = {
1343
+ }, Nn = {
1336
1344
  id: "sheet.command.set-table-filter",
1337
1345
  type: N.COMMAND,
1338
1346
  handler: (t, e) => {
1339
1347
  if (!e)
1340
1348
  return !1;
1341
1349
  const n = t.get(A), r = t.get(x), s = e.tableId || L(), a = [], o = [];
1342
- return a.push({ id: Ce.id, params: { ...e, tableId: s } }), o.push({ id: Ce.id, params: { ...e, tableId: s, tableFilter: void 0 } }), B(a, r) && n.pushUndoRedo({
1350
+ return a.push({ id: Se.id, params: { ...e, tableId: s } }), o.push({ id: Se.id, params: { ...e, tableId: s, tableFilter: void 0 } }), B(a, r) && n.pushUndoRedo({
1343
1351
  unitID: e.unitId,
1344
1352
  undoMutations: o,
1345
1353
  redoMutations: a
1346
1354
  }), !0;
1347
1355
  }
1348
- }, ze = "SHEET_TABLE_PLUGIN", se = "SHEET_TABLE", Nn = "table-custom";
1349
- var yn = Object.getOwnPropertyDescriptor, xn = (t, e, n, r) => {
1350
- for (var s = r > 1 ? void 0 : r ? yn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
1356
+ }, Xe = "SHEET_TABLE_PLUGIN", re = "SHEET_TABLE", yn = "table-custom";
1357
+ var xn = Object.getOwnPropertyDescriptor, On = (t, e, n, r) => {
1358
+ for (var s = r > 1 ? void 0 : r ? xn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
1351
1359
  (o = t[a]) && (s = o(s) || s);
1352
1360
  return s;
1353
1361
  }, we = (t, e) => (n, r) => e(n, r, t);
@@ -1360,13 +1368,13 @@ let E = class extends k {
1360
1368
  getContainerTableWithRange(e, n, r) {
1361
1369
  const s = this._ensureTableRangeRTree(e), o = Array.from(s.bulkSearch([{ unitId: e, sheetId: n, range: r }])).find((l) => {
1362
1370
  const u = this._tableManager.getTable(e, String(l));
1363
- return u ? Se.contains(u.getRange(), r) : !1;
1371
+ return u ? pe.contains(u.getRange(), r) : !1;
1364
1372
  });
1365
1373
  if (o)
1366
1374
  return this._tableManager.getTable(e, String(o));
1367
1375
  }
1368
1376
  _ensureTableRangeRTree(e) {
1369
- return this._tableRangeRTree.has(e) || this._tableRangeRTree.set(e, new tt()), this._tableRangeRTree.get(e);
1377
+ return this._tableRangeRTree.has(e) || this._tableRangeRTree.set(e, new rt()), this._tableRangeRTree.get(e);
1370
1378
  }
1371
1379
  registerTableChangeEvent() {
1372
1380
  this.disposeWithMe(
@@ -1409,7 +1417,7 @@ let E = class extends k {
1409
1417
  registerTableHeaderInterceptor() {
1410
1418
  this.disposeWithMe(
1411
1419
  this._sheetInterceptorService.intercept(Le.CELL_CONTENT, {
1412
- effect: nt.Value,
1420
+ effect: st.Value,
1413
1421
  handler: (e, n, r) => {
1414
1422
  const { row: s, col: a, unitId: o, subUnitId: l } = n, u = this._ensureTableRangeRTree(o);
1415
1423
  if ((e == null ? void 0 : e.v) === void 0 && u) {
@@ -1452,7 +1460,7 @@ let E = class extends k {
1452
1460
  }
1453
1461
  },
1454
1462
  businesses: [he.UNIVER_SHEET],
1455
- pluginName: ze,
1463
+ pluginName: Xe,
1456
1464
  onLoad: (e, n) => {
1457
1465
  this._fromJSON(e, n);
1458
1466
  },
@@ -1465,10 +1473,10 @@ let E = class extends k {
1465
1473
  super.dispose(), this._tableRangeRTree.clear();
1466
1474
  }
1467
1475
  };
1468
- E = xn([
1469
- we(0, C(_e)),
1476
+ E = On([
1477
+ we(0, C(Ce)),
1470
1478
  we(1, C(_)),
1471
- we(2, C(et))
1479
+ we(2, C(nt))
1472
1480
  ], E);
1473
1481
  const p = {
1474
1482
  id: "sheet.mutation.set-sheet-table",
@@ -1479,7 +1487,7 @@ const p = {
1479
1487
  const { unitId: n, tableId: r, config: s } = e;
1480
1488
  return t.get(_).setTableByConfig(n, r, s), !0;
1481
1489
  }
1482
- }, On = {
1490
+ }, Un = {
1483
1491
  id: "sheet.command.add-table-theme",
1484
1492
  type: N.COMMAND,
1485
1493
  handler: (t, e) => {
@@ -1530,7 +1538,7 @@ const p = {
1530
1538
  redoMutations: o
1531
1539
  }), !0;
1532
1540
  }
1533
- }, Un = {
1541
+ }, $n = {
1534
1542
  id: "sheet.command.remove-table-theme",
1535
1543
  type: N.COMMAND,
1536
1544
  handler: (t, e) => {
@@ -1538,8 +1546,8 @@ const p = {
1538
1546
  return !1;
1539
1547
  const { unitId: n, tableId: r, themeName: s } = e, a = t.get(_), o = t.get(He), l = a.getTableById(n, r);
1540
1548
  if (!l) return !1;
1541
- const u = l.getSubunitId(), i = [], h = [], d = o.getRegisteredRangeThemes().filter((R) => R == null ? void 0 : R.startsWith("table-default"));
1542
- let m = o.getRegisteredRangeThemes().filter((R) => R == null ? void 0 : R.startsWith(Nn)).find((R) => R !== s);
1549
+ const u = l.getSubunitId(), i = [], h = [], d = o.getRegisteredRangeThemes().filter((f) => f == null ? void 0 : f.startsWith("table-default"));
1550
+ let m = o.getRegisteredRangeThemes().filter((f) => f == null ? void 0 : f.startsWith(yn)).find((f) => f !== s);
1543
1551
  m || (m = d[0]), i.push({ id: p.id, params: { unitId: n, subUnitId: u, tableId: r, config: { theme: m } } }), i.push({ id: We.id, params: { unitId: n, subUnitId: u, styleName: s } });
1544
1552
  const S = o.getDefaultRangeThemeStyle(s);
1545
1553
  S && (h.push({ id: Ee.id, params: { unitId: n, subUnitId: u, styleJSON: S.toJson() } }), h.push({ id: p.id, params: { unitId: n, subUnitId: u, tableId: r, config: { theme: s } } }));
@@ -1550,7 +1558,7 @@ const p = {
1550
1558
  undoMutations: h
1551
1559
  }), !0;
1552
1560
  }
1553
- }, $n = {
1561
+ }, An = {
1554
1562
  id: "sheet.command.set-table-config",
1555
1563
  type: N.COMMAND,
1556
1564
  // eslint-disable-next-line max-lines-per-function
@@ -1563,8 +1571,8 @@ const p = {
1563
1571
  if (S && S.getSheets().forEach((O) => {
1564
1572
  w.add(O.getName());
1565
1573
  }), s) {
1566
- if (!rt(s, w))
1567
- return t.get(st).warn(c.t("sheets-table.tableNameError")), !1;
1574
+ if (!at(s, w))
1575
+ return t.get(ot).warn(c.t("sheets-table.tableNameError")), !1;
1568
1576
  h.name = i.getDisplayName(), d.name = s;
1569
1577
  }
1570
1578
  o && (h.rowColOperation = {
@@ -1575,13 +1583,13 @@ const p = {
1575
1583
  }, d.rowColOperation = o), a && (h.updateRange = {
1576
1584
  newRange: i.getRange()
1577
1585
  }, d.updateRange = a), l && (h.theme = i.getTableStyleId(), d.theme = l);
1578
- const f = {
1586
+ const R = {
1579
1587
  unitId: n,
1580
1588
  subUnitId: i.getSubunitId(),
1581
1589
  tableId: r,
1582
1590
  config: d
1583
1591
  };
1584
- return t.get(x).executeCommand(p.id, f), t.get(A).pushUndoRedo({
1592
+ return t.get(x).executeCommand(p.id, R), t.get(A).pushUndoRedo({
1585
1593
  unitID: n,
1586
1594
  undoMutations: [
1587
1595
  {
@@ -1597,12 +1605,12 @@ const p = {
1597
1605
  redoMutations: [
1598
1606
  {
1599
1607
  id: p.id,
1600
- params: f
1608
+ params: R
1601
1609
  }
1602
1610
  ]
1603
1611
  }), !0;
1604
1612
  }
1605
- }, An = {
1613
+ }, Bn = {
1606
1614
  id: "sheet.command.table-insert-row",
1607
1615
  type: N.COMMAND,
1608
1616
  handler: (t) => {
@@ -1615,16 +1623,16 @@ const p = {
1615
1623
  t.get(_);
1616
1624
  const h = u[0].range, c = t.get(E).getContainerTableWithRange(a, o, h);
1617
1625
  if (!c) return !1;
1618
- const m = h.endRow - h.startRow + 1, w = s.getRowCount() - 1, f = s.getCellMatrix().getDataRange().endRow, R = [], T = [];
1619
- if (w - f < m)
1620
- R.push({
1626
+ const m = h.endRow - h.startRow + 1, w = s.getRowCount() - 1, R = s.getCellMatrix().getDataRange().endRow, f = [], T = [];
1627
+ if (w - R < m)
1628
+ f.push({
1621
1629
  id: Pe.id,
1622
1630
  params: {
1623
1631
  unitId: a,
1624
1632
  subUnitId: o,
1625
1633
  range: { ...h }
1626
1634
  }
1627
- }), R.push({
1635
+ }), f.push({
1628
1636
  id: p.id,
1629
1637
  params: {
1630
1638
  unitId: a,
@@ -1661,7 +1669,7 @@ const p = {
1661
1669
  });
1662
1670
  else {
1663
1671
  const M = { ...c.getRange() };
1664
- R.push({
1672
+ f.push({
1665
1673
  id: p.id,
1666
1674
  params: {
1667
1675
  unitId: a,
@@ -1689,14 +1697,14 @@ const p = {
1689
1697
  }
1690
1698
  }
1691
1699
  });
1692
- const X = me(
1700
+ const K = me(
1693
1701
  t,
1694
1702
  {
1695
1703
  unitId: a,
1696
1704
  subUnitId: o,
1697
1705
  range: {
1698
1706
  startRow: h.startRow,
1699
- endRow: f,
1707
+ endRow: R,
1700
1708
  startColumn: M.startColumn,
1701
1709
  endColumn: M.endColumn
1702
1710
  }
@@ -1706,22 +1714,22 @@ const p = {
1706
1714
  subUnitId: o,
1707
1715
  range: {
1708
1716
  startRow: h.startRow + m,
1709
- endRow: f + m,
1717
+ endRow: R + m,
1710
1718
  startColumn: M.startColumn,
1711
1719
  endColumn: M.endColumn
1712
1720
  }
1713
1721
  }
1714
1722
  );
1715
- X && (R.push(...X.redos), T.push(...X.undos));
1723
+ K && (f.push(...K.redos), T.push(...K.undos));
1716
1724
  }
1717
1725
  const O = t.get(x);
1718
- return B(R, O) && t.get(A).pushUndoRedo({
1726
+ return B(f, O) && t.get(A).pushUndoRedo({
1719
1727
  unitID: a,
1720
1728
  undoMutations: T,
1721
- redoMutations: R
1729
+ redoMutations: f
1722
1730
  }), !0;
1723
1731
  }
1724
- }, Bn = {
1732
+ }, Ln = {
1725
1733
  id: "sheet.command.table-insert-col",
1726
1734
  type: N.COMMAND,
1727
1735
  handler: (t) => {
@@ -1733,16 +1741,16 @@ const p = {
1733
1741
  return !1;
1734
1742
  const i = l[0].range, d = t.get(E).getContainerTableWithRange(s, a, i);
1735
1743
  if (!d) return !1;
1736
- const c = i.endColumn - i.startColumn + 1, S = r.getColumnCount() - 1, w = r.getCellMatrix().getDataRange().endColumn, f = [], R = [];
1744
+ const c = i.endColumn - i.startColumn + 1, S = r.getColumnCount() - 1, w = r.getCellMatrix().getDataRange().endColumn, R = [], f = [];
1737
1745
  if (S - w < c)
1738
- f.push({
1746
+ R.push({
1739
1747
  id: qe.id,
1740
1748
  params: {
1741
1749
  unitId: s,
1742
1750
  subUnitId: a,
1743
1751
  range: { ...i }
1744
1752
  }
1745
- }), f.push({
1753
+ }), R.push({
1746
1754
  id: p.id,
1747
1755
  params: {
1748
1756
  unitId: s,
@@ -1757,7 +1765,7 @@ const p = {
1757
1765
  }
1758
1766
  }
1759
1767
  }
1760
- }), R.push({
1768
+ }), f.push({
1761
1769
  id: p.id,
1762
1770
  params: {
1763
1771
  unitId: s,
@@ -1772,7 +1780,7 @@ const p = {
1772
1780
  }
1773
1781
  }
1774
1782
  }
1775
- }), R.push({
1783
+ }), f.push({
1776
1784
  id: Je.id,
1777
1785
  params: {
1778
1786
  unitId: s,
@@ -1782,7 +1790,7 @@ const p = {
1782
1790
  });
1783
1791
  else {
1784
1792
  const v = d.getRange();
1785
- f.push({
1793
+ R.push({
1786
1794
  id: p.id,
1787
1795
  params: {
1788
1796
  unitId: s,
@@ -1797,7 +1805,7 @@ const p = {
1797
1805
  }
1798
1806
  }
1799
1807
  }
1800
- }), R.push({
1808
+ }), f.push({
1801
1809
  id: p.id,
1802
1810
  params: {
1803
1811
  unitId: s,
@@ -1836,16 +1844,16 @@ const p = {
1836
1844
  }
1837
1845
  }
1838
1846
  );
1839
- M && (f.push(...M.redos), R.push(...M.undos));
1847
+ M && (R.push(...M.redos), f.push(...M.undos));
1840
1848
  }
1841
1849
  const T = t.get(x);
1842
- return B(f, T) && t.get(A).pushUndoRedo({
1850
+ return B(R, T) && t.get(A).pushUndoRedo({
1843
1851
  unitID: s,
1844
- undoMutations: R,
1845
- redoMutations: f
1852
+ undoMutations: f,
1853
+ redoMutations: R
1846
1854
  }), !0;
1847
1855
  }
1848
- }, Ln = {
1856
+ }, En = {
1849
1857
  id: "sheet.command.table-remove-row",
1850
1858
  type: N.COMMAND,
1851
1859
  handler: (t, e) => {
@@ -1888,14 +1896,14 @@ const p = {
1888
1896
  }
1889
1897
  }
1890
1898
  });
1891
- const R = r.worksheet.getCellMatrix().getDataRange().endRow, T = me(
1899
+ const f = r.worksheet.getCellMatrix().getDataRange().endRow, T = me(
1892
1900
  t,
1893
1901
  {
1894
1902
  unitId: s,
1895
1903
  subUnitId: a,
1896
1904
  range: {
1897
1905
  startRow: i.endRow + 1,
1898
- endRow: R,
1906
+ endRow: f,
1899
1907
  startColumn: w.startColumn,
1900
1908
  endColumn: w.endColumn
1901
1909
  }
@@ -1905,7 +1913,7 @@ const p = {
1905
1913
  subUnitId: a,
1906
1914
  range: {
1907
1915
  startRow: i.startRow,
1908
- endRow: R - c,
1916
+ endRow: f - c,
1909
1917
  startColumn: w.startColumn,
1910
1918
  endColumn: w.endColumn
1911
1919
  }
@@ -1919,7 +1927,7 @@ const p = {
1919
1927
  redoMutations: m
1920
1928
  }), !0;
1921
1929
  }
1922
- }, En = {
1930
+ }, Wn = {
1923
1931
  id: "sheet.command.table-remove-col",
1924
1932
  type: N.COMMAND,
1925
1933
  handler: (t, e) => {
@@ -1935,7 +1943,7 @@ const p = {
1935
1943
  return !1;
1936
1944
  const h = u[0].range, c = t.get(E).getContainerTableWithRange(a, o, h);
1937
1945
  if (!c) return !1;
1938
- const m = h.endColumn - h.startColumn + 1, S = [], w = [], f = c.getRange();
1946
+ const m = h.endColumn - h.startColumn + 1, S = [], w = [], R = c.getRange();
1939
1947
  S.push({
1940
1948
  id: p.id,
1941
1949
  params: {
@@ -1952,10 +1960,10 @@ const p = {
1952
1960
  }
1953
1961
  }
1954
1962
  });
1955
- const R = [], T = h.startColumn - f.startColumn;
1956
- for (let re = 0; re < m; re++) {
1957
- const Ie = c.getTableInfo().columns[T + re];
1958
- Ie && R.push(Ie);
1963
+ const f = [], T = h.startColumn - R.startColumn;
1964
+ for (let ne = 0; ne < m; ne++) {
1965
+ const Te = c.getTableInfo().columns[T + ne];
1966
+ Te && f.push(Te);
1959
1967
  }
1960
1968
  w.push({
1961
1969
  id: p.id,
@@ -1969,7 +1977,7 @@ const p = {
1969
1977
  rowColType: D.Col,
1970
1978
  index: h.startColumn,
1971
1979
  count: m,
1972
- columnsJson: R
1980
+ columnsJson: f
1973
1981
  }
1974
1982
  }
1975
1983
  }
@@ -1980,8 +1988,8 @@ const p = {
1980
1988
  unitId: a,
1981
1989
  subUnitId: o,
1982
1990
  range: {
1983
- startRow: f.startRow,
1984
- endRow: f.endRow,
1991
+ startRow: R.startRow,
1992
+ endRow: R.endRow,
1985
1993
  startColumn: h.endColumn + 1,
1986
1994
  endColumn: v
1987
1995
  }
@@ -1990,27 +1998,27 @@ const p = {
1990
1998
  unitId: a,
1991
1999
  subUnitId: o,
1992
2000
  range: {
1993
- startRow: f.startRow,
1994
- endRow: f.endRow,
2001
+ startRow: R.startRow,
2002
+ endRow: R.endRow,
1995
2003
  startColumn: h.startColumn,
1996
2004
  endColumn: v - m
1997
2005
  }
1998
2006
  }
1999
2007
  );
2000
2008
  M && (S.push(...M.redos), w.push(...M.undos));
2001
- const X = t.get(x);
2002
- return B(S, X) && t.get(A).pushUndoRedo({
2009
+ const K = t.get(x);
2010
+ return B(S, K) && t.get(A).pushUndoRedo({
2003
2011
  unitID: a,
2004
2012
  undoMutations: w,
2005
2013
  redoMutations: S
2006
2014
  }), !0;
2007
2015
  }
2008
- }, Wn = "sheets-table.config", Ue = {};
2016
+ };
2009
2017
  var Hn = Object.getOwnPropertyDescriptor, Pn = (t, e, n, r) => {
2010
2018
  for (var s = r > 1 ? void 0 : r ? Hn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
2011
2019
  (o = t[a]) && (s = o(s) || s);
2012
2020
  return s;
2013
- }, $e = (t, e) => (n, r) => e(n, r, t);
2021
+ }, Ue = (t, e) => (n, r) => e(n, r, t);
2014
2022
  let ie = class extends k {
2015
2023
  constructor(t, e) {
2016
2024
  super(), this._tableManager = t, this._exclusiveRangeService = e, this._initRangeListener();
@@ -2019,7 +2027,7 @@ let ie = class extends k {
2019
2027
  this.disposeWithMe(
2020
2028
  this._tableManager.tableRangeChanged$.subscribe((t) => {
2021
2029
  const { range: e, tableId: n, unitId: r, subUnitId: s } = t;
2022
- this._exclusiveRangeService.clearExclusiveRangesByGroupId(r, s, se, n), this._exclusiveRangeService.addExclusiveRange(r, s, se, [{
2030
+ this._exclusiveRangeService.clearExclusiveRangesByGroupId(r, s, re, n), this._exclusiveRangeService.addExclusiveRange(r, s, re, [{
2023
2031
  range: { ...e },
2024
2032
  groupId: n
2025
2033
  }]);
@@ -2027,7 +2035,7 @@ let ie = class extends k {
2027
2035
  ), this.disposeWithMe(
2028
2036
  this._tableManager.tableAdd$.subscribe((t) => {
2029
2037
  const { tableId: e, unitId: n, subUnitId: r, range: s } = t;
2030
- this._exclusiveRangeService.addExclusiveRange(n, r, se, [{
2038
+ this._exclusiveRangeService.addExclusiveRange(n, r, re, [{
2031
2039
  range: { ...s },
2032
2040
  groupId: e
2033
2041
  }]);
@@ -2035,14 +2043,14 @@ let ie = class extends k {
2035
2043
  ), this.disposeWithMe(
2036
2044
  this._tableManager.tableDelete$.subscribe((t) => {
2037
2045
  const { tableId: e, unitId: n, subUnitId: r } = t;
2038
- this._exclusiveRangeService.clearExclusiveRangesByGroupId(n, r, se, e);
2046
+ this._exclusiveRangeService.clearExclusiveRangesByGroupId(n, r, re, e);
2039
2047
  })
2040
2048
  );
2041
2049
  }
2042
2050
  };
2043
2051
  ie = Pn([
2044
- $e(0, C(_)),
2045
- $e(1, C(ut))
2052
+ Ue(0, C(_)),
2053
+ Ue(1, C(ct))
2046
2054
  ], ie);
2047
2055
  var Vn = Object.getOwnPropertyDescriptor, qn = (t, e, n, r) => {
2048
2056
  for (var s = r > 1 ? void 0 : r ? Vn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
@@ -2059,13 +2067,13 @@ let le = class extends k {
2059
2067
  getMutations(e) {
2060
2068
  const n = { redos: [], undos: [] }, { id: r, params: s } = e;
2061
2069
  switch (r) {
2062
- case mt.id:
2070
+ case bt.id:
2063
2071
  return t._generateTableMutationWithInsertRow(s);
2064
- case gt.id:
2072
+ case mt.id:
2065
2073
  return t._generateTableMutationWithInsertCol(s);
2066
- case ht.id:
2074
+ case gt.id:
2067
2075
  return t._generateTableMutationWithRemoveRow(s);
2068
- case dt.id:
2076
+ case ht.id:
2069
2077
  return t._generateTableMutationWithRemoveCol(s);
2070
2078
  }
2071
2079
  return n;
@@ -2173,10 +2181,10 @@ let le = class extends k {
2173
2181
  const { range: i } = t, h = i.endRow - i.startRow + 1;
2174
2182
  return u.forEach((d) => {
2175
2183
  const c = d.getRange();
2176
- if (Se.intersects(c, i))
2184
+ if (pe.intersects(c, i))
2177
2185
  if (i.startRow <= c.startRow && i.endRow >= c.startRow) {
2178
2186
  r.push({
2179
- id: ne.id,
2187
+ id: te.id,
2180
2188
  params: {
2181
2189
  unitId: o,
2182
2190
  subUnitId: l,
@@ -2185,7 +2193,7 @@ let le = class extends k {
2185
2193
  });
2186
2194
  const m = d.toJSON();
2187
2195
  e.push({
2188
- id: te.id,
2196
+ id: ee.id,
2189
2197
  params: {
2190
2198
  unitId: o,
2191
2199
  subUnitId: l,
@@ -2266,24 +2274,24 @@ let le = class extends k {
2266
2274
  const { range: i } = t, h = i.endColumn - i.startColumn + 1;
2267
2275
  return u.forEach((d) => {
2268
2276
  const c = d.getRange();
2269
- if (Se.intersects(c, i)) {
2277
+ if (pe.intersects(c, i)) {
2270
2278
  if (i.startColumn <= c.startColumn && i.endColumn >= c.endColumn) {
2271
2279
  r.push({
2272
- id: ne.id,
2280
+ id: te.id,
2273
2281
  params: {
2274
2282
  unitId: o,
2275
2283
  subUnitId: l,
2276
2284
  tableId: d.getId()
2277
2285
  }
2278
2286
  });
2279
- const m = d.toJSON(), { startRow: S, startColumn: w, endColumn: f } = m.range, R = this._univerInstanceService.getUnit(o), T = R == null ? void 0 : R.getSheetBySheetId(l);
2287
+ const m = d.toJSON(), { startRow: S, startColumn: w, endColumn: R } = m.range, f = this._univerInstanceService.getUnit(o), T = f == null ? void 0 : f.getSheetBySheetId(l);
2280
2288
  if (!T)
2281
2289
  return { undos: e, redos: n, preRedos: r, preUndos: s };
2282
2290
  const O = [];
2283
- for (let v = w; v <= f; v++)
2284
- O.push(Ye(T == null ? void 0 : T.getCell(S, v)) || Z(v - w + 1, this._localeService.t("sheets-table.columnPrefix")));
2291
+ for (let v = w; v <= R; v++)
2292
+ O.push(Ye(T == null ? void 0 : T.getCell(S, v)) || X(v - w + 1, this._localeService.t("sheets-table.columnPrefix")));
2285
2293
  e.push({
2286
- id: te.id,
2294
+ id: ee.id,
2287
2295
  params: {
2288
2296
  unitId: o,
2289
2297
  subUnitId: l,
@@ -2314,8 +2322,8 @@ let le = class extends k {
2314
2322
  });
2315
2323
  const S = [];
2316
2324
  for (let w = 0; w < m; w++) {
2317
- const f = d.getTableColumnByIndex(w);
2318
- f && S.push(f.toJSON());
2325
+ const R = d.getTableColumnByIndex(w);
2326
+ R && S.push(R.toJSON());
2319
2327
  }
2320
2328
  e.push({
2321
2329
  id: p.id,
@@ -2353,9 +2361,9 @@ let le = class extends k {
2353
2361
  }
2354
2362
  });
2355
2363
  const S = [], w = i.startColumn - c.startColumn;
2356
- for (let f = 0; f < m; f++) {
2357
- const R = d.getTableColumnByIndex(f + w);
2358
- R && S.push(R.toJSON());
2364
+ for (let R = 0; R < m; R++) {
2365
+ const f = d.getTableColumnByIndex(R + w);
2366
+ f && S.push(f.toJSON());
2359
2367
  }
2360
2368
  e.push({
2361
2369
  id: p.id,
@@ -2393,8 +2401,8 @@ let le = class extends k {
2393
2401
  });
2394
2402
  const m = [], S = i.startColumn - c.startColumn;
2395
2403
  for (let w = 0; w < h; w++) {
2396
- const f = d.getTableColumnByIndex(w + S);
2397
- f && m.push(f.toJSON());
2404
+ const R = d.getTableColumnByIndex(w + S);
2405
+ R && m.push(R.toJSON());
2398
2406
  }
2399
2407
  e.push({
2400
2408
  id: p.id,
@@ -2473,10 +2481,10 @@ let le = class extends k {
2473
2481
  };
2474
2482
  le = qn([
2475
2483
  H(0, C(x)),
2476
- H(1, C(ct)),
2484
+ H(1, C(dt)),
2477
2485
  H(2, C(W)),
2478
- H(3, C(Be)),
2479
- H(4, C(_e)),
2486
+ H(3, C(Ae)),
2487
+ H(4, C(Ce)),
2480
2488
  H(5, C(_)),
2481
2489
  H(6, C(de))
2482
2490
  ], le);
@@ -2484,72 +2492,81 @@ var Jn = Object.getOwnPropertyDescriptor, kn = (t, e, n, r) => {
2484
2492
  for (var s = r > 1 ? void 0 : r ? Jn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
2485
2493
  (o = t[a]) && (s = o(s) || s);
2486
2494
  return s;
2487
- }, Re = (t, e) => (n, r) => e(n, r, t);
2495
+ }, se = (t, e) => (n, r) => e(n, r, t);
2488
2496
  let ue = class extends k {
2489
- constructor(t, e, n) {
2490
- super(), this._tableManager = t, this._sheetRangeThemeService = e, this._sheetRangeThemeModel = n, this.registerTableChangeEvent(), this._initDefaultTableTheme();
2497
+ constructor(e, n, r, s) {
2498
+ super();
2499
+ b(this, "_defaultThemeIndex", 0);
2500
+ b(this, "_allThemes", []);
2501
+ this._tableManager = e, this._sheetRangeThemeService = n, this._sheetRangeThemeModel = r, this._configService = s, this._initUserTableTheme(), this.registerTableChangeEvent(), this._initDefaultTableTheme();
2491
2502
  }
2492
2503
  registerTableChangeEvent() {
2493
2504
  this.disposeWithMe(
2494
- this._tableManager.tableAdd$.subscribe((t) => {
2495
- const { range: e, tableId: n, unitId: r, subUnitId: s } = t, o = this._tableManager.getTable(r, n).getTableStyleId() || Y[0].name;
2496
- this._sheetRangeThemeService.registerRangeThemeStyle(o, {
2497
- unitId: r,
2498
- subUnitId: s,
2499
- range: { ...e }
2505
+ this._tableManager.tableAdd$.subscribe((e) => {
2506
+ const { range: n, tableId: r, unitId: s, subUnitId: a } = e, o = this._tableManager.getTable(s, r), l = this._allThemes[this._defaultThemeIndex].name;
2507
+ o.setTableStyleId(l), this._sheetRangeThemeService.registerRangeThemeStyle(l, {
2508
+ unitId: s,
2509
+ subUnitId: a,
2510
+ range: { ...n }
2500
2511
  });
2501
2512
  })
2502
2513
  ), this.disposeWithMe(
2503
- this._tableManager.tableRangeChanged$.subscribe((t) => {
2504
- const { range: e, oldRange: n, tableId: r, unitId: s, subUnitId: a } = t, l = this._tableManager.getTable(s, r).getTableStyleId() || Y[0].name;
2505
- this._sheetRangeThemeService.removeRangeThemeRule(l, {
2506
- unitId: s,
2507
- subUnitId: a,
2514
+ this._tableManager.tableRangeChanged$.subscribe((e) => {
2515
+ const { range: n, oldRange: r, tableId: s, unitId: a, subUnitId: o } = e, l = this._tableManager.getTable(a, s);
2516
+ let u = l.getTableStyleId();
2517
+ u || (u = this._allThemes[this._defaultThemeIndex].name, l.setTableStyleId(u)), this._sheetRangeThemeService.removeRangeThemeRule(u, {
2518
+ unitId: a,
2519
+ subUnitId: o,
2520
+ range: { ...r }
2521
+ }), this._sheetRangeThemeService.registerRangeThemeStyle(u, {
2522
+ unitId: a,
2523
+ subUnitId: o,
2508
2524
  range: { ...n }
2509
- }), this._sheetRangeThemeService.registerRangeThemeStyle(l, {
2510
- unitId: s,
2511
- subUnitId: a,
2512
- range: { ...e }
2513
2525
  });
2514
2526
  })
2515
2527
  ), this.disposeWithMe(
2516
- this._tableManager.tableThemeChanged$.subscribe((t) => {
2517
- const { theme: e, oldTheme: n, tableId: r, unitId: s, subUnitId: a } = t, l = this._tableManager.getTable(s, r).getRange();
2518
- this._sheetRangeThemeService.removeRangeThemeRule(n, {
2519
- unitId: s,
2520
- subUnitId: a,
2521
- range: { ...l }
2522
- }), this._sheetRangeThemeService.registerRangeThemeStyle(e, {
2523
- unitId: s,
2524
- subUnitId: a,
2525
- range: { ...l }
2528
+ this._tableManager.tableThemeChanged$.subscribe((e) => {
2529
+ const { theme: n, oldTheme: r, tableId: s, unitId: a, subUnitId: o } = e, u = this._tableManager.getTable(a, s).getRange();
2530
+ this._sheetRangeThemeService.removeRangeThemeRule(r, {
2531
+ unitId: a,
2532
+ subUnitId: o,
2533
+ range: { ...u }
2534
+ }), this._sheetRangeThemeService.registerRangeThemeStyle(n, {
2535
+ unitId: a,
2536
+ subUnitId: o,
2537
+ range: { ...u }
2526
2538
  });
2527
2539
  })
2528
2540
  ), this.disposeWithMe(
2529
- this._tableManager.tableDelete$.subscribe((t) => {
2530
- const { range: e, unitId: n, subUnitId: r, tableStyleId: s = Y[0].name } = t;
2531
- this._sheetRangeThemeService.removeRangeThemeRule(s, {
2532
- unitId: n,
2533
- subUnitId: r,
2534
- range: { ...e }
2541
+ this._tableManager.tableDelete$.subscribe((e) => {
2542
+ const { range: n, unitId: r, subUnitId: s, tableStyleId: a = this._allThemes[this._defaultThemeIndex].name } = e;
2543
+ this._sheetRangeThemeService.removeRangeThemeRule(a, {
2544
+ unitId: r,
2545
+ subUnitId: s,
2546
+ range: { ...n }
2535
2547
  });
2536
2548
  })
2537
2549
  );
2538
2550
  }
2551
+ _initUserTableTheme() {
2552
+ const e = this._configService.getConfig(Ge) || {}, n = e.defaultThemeIndex || 0, r = e.userThemes || [];
2553
+ this._defaultThemeIndex = n, this._allThemes = r.concat(je);
2554
+ }
2539
2555
  _initDefaultTableTheme() {
2540
- for (let t = 0; t < Y.length; t++) {
2541
- const { name: e, style: n } = Y[t], r = new wt(e, n);
2542
- this._sheetRangeThemeModel.registerDefaultRangeTheme(r);
2556
+ for (let e = 0; e < this._allThemes.length; e++) {
2557
+ const { name: n, style: r } = this._allThemes[e], s = new ft(n, r);
2558
+ this._sheetRangeThemeModel.registerDefaultRangeTheme(s);
2543
2559
  }
2544
2560
  }
2545
2561
  dispose() {
2546
- super.dispose();
2562
+ super.dispose(), this._allThemes = [], this._defaultThemeIndex = 0;
2547
2563
  }
2548
2564
  };
2549
2565
  ue = kn([
2550
- Re(0, C(_)),
2551
- Re(1, C(bt)),
2552
- Re(2, C(He))
2566
+ se(0, C(_)),
2567
+ se(1, C(wt)),
2568
+ se(2, C(He)),
2569
+ se(3, Be)
2553
2570
  ], ue);
2554
2571
  var Qn = Object.getOwnPropertyDescriptor, Yn = (t, e, n, r) => {
2555
2572
  for (var s = r > 1 ? void 0 : r ? Qn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
@@ -2584,9 +2601,9 @@ let ce = class extends k {
2584
2601
  _initFilteredOutRows() {
2585
2602
  this._tableManager.tableInitStatus$.pipe(
2586
2603
  be((e) => e),
2587
- ve(() => this._univerInstanceService.getCurrentTypeOfUnit$(he.UNIVER_SHEET)),
2604
+ Me(() => this._univerInstanceService.getCurrentTypeOfUnit$(he.UNIVER_SHEET)),
2588
2605
  be((e) => e != null),
2589
- ve((e) => e.activeSheet$),
2606
+ Me((e) => e.activeSheet$),
2590
2607
  be((e) => e != null)
2591
2608
  ).subscribe(() => {
2592
2609
  const e = $(this._univerInstanceService);
@@ -2624,101 +2641,101 @@ let ce = class extends k {
2624
2641
  };
2625
2642
  ce = Yn([
2626
2643
  fe(0, C(_)),
2627
- fe(1, C(_e)),
2644
+ fe(1, C(Ce)),
2628
2645
  fe(2, C(W))
2629
2646
  ], ce);
2630
2647
  var Gn = Object.getOwnPropertyDescriptor, jn = (t, e, n, r) => {
2631
2648
  for (var s = r > 1 ? void 0 : r ? Gn(e, n) : e, a = t.length - 1, o; a >= 0; a--)
2632
2649
  (o = t[a]) && (s = o(s) || s);
2633
2650
  return s;
2634
- }, pe = (t, e) => (n, r) => e(n, r, t), ae;
2635
- let Ae = (ae = class extends at {
2636
- constructor(t = Ue, e, n, r) {
2651
+ }, Re = (t, e) => (n, r) => e(n, r, t), ae;
2652
+ let $e = (ae = class extends it {
2653
+ constructor(t = De, e, n, r) {
2637
2654
  super(), this._config = t, this._injector = e, this._configService = n, this._commandService = r;
2638
- const { ...s } = ot(
2655
+ const { ...s } = lt(
2639
2656
  {},
2640
- Ue,
2657
+ De,
2641
2658
  this._config
2642
2659
  );
2643
- this._configService.setConfig(Wn, s), this._initRegisterCommand();
2660
+ this._configService.setConfig(Ge, s), this._initRegisterCommand();
2644
2661
  }
2645
2662
  onStarting() {
2646
- it(this._injector, [
2663
+ ut(this._injector, [
2647
2664
  [_],
2648
2665
  [ue],
2649
2666
  [E],
2650
- [z],
2667
+ [j],
2651
2668
  [ce],
2652
2669
  [ie],
2653
2670
  [le]
2654
- ]), Me(this._injector, [
2671
+ ]), Ie(this._injector, [
2655
2672
  [ie],
2656
2673
  [le],
2657
2674
  [ue],
2658
2675
  [E],
2659
- [z],
2676
+ [j],
2660
2677
  [ce]
2661
2678
  ]);
2662
2679
  }
2663
2680
  onReady() {
2664
- Me(this._injector, [
2681
+ Ie(this._injector, [
2665
2682
  [_]
2666
2683
  ]);
2667
2684
  }
2668
2685
  _initRegisterCommand() {
2669
2686
  [
2670
- vn,
2671
- te,
2672
2687
  Fn,
2673
- ne,
2674
- Ce,
2688
+ ee,
2675
2689
  Dn,
2676
- $n,
2690
+ te,
2691
+ Se,
2692
+ Nn,
2693
+ An,
2677
2694
  p,
2678
- On,
2679
2695
  Un,
2680
- An,
2696
+ $n,
2681
2697
  Bn,
2682
2698
  Ln,
2683
- En
2699
+ En,
2700
+ Wn
2684
2701
  ].forEach((t) => this._commandService.registerCommand(t));
2685
2702
  }
2686
- }, b(ae, "pluginName", ze), b(ae, "type", he.UNIVER_SHEET), ae);
2687
- Ae = jn([
2688
- pe(1, C(Be)),
2689
- pe(2, lt),
2690
- pe(3, C(x))
2691
- ], Ae);
2703
+ }, b(ae, "pluginName", Xe), b(ae, "type", he.UNIVER_SHEET), ae);
2704
+ $e = jn([
2705
+ Re(1, C(Ae)),
2706
+ Re(2, Be),
2707
+ Re(3, C(x))
2708
+ ], $e);
2692
2709
  export {
2693
- vn as AddSheetTableCommand,
2694
- te as AddSheetTableMutation,
2695
- On as AddTableThemeCommand,
2696
- Fn as DeleteSheetTableCommand,
2697
- ne as DeleteSheetTableMutation,
2698
- Un as RemoveTableThemeCommand,
2699
- Nn as SHEET_TABLE_CUSTOM_THEME_PREFIX,
2700
- $n as SetSheetTableCommand,
2701
- Dn as SetSheetTableFilterCommand,
2702
- Ce as SetSheetTableFilterMutation,
2710
+ Fn as AddSheetTableCommand,
2711
+ ee as AddSheetTableMutation,
2712
+ Un as AddTableThemeCommand,
2713
+ Dn as DeleteSheetTableCommand,
2714
+ te as DeleteSheetTableMutation,
2715
+ $n as RemoveTableThemeCommand,
2716
+ yn as SHEET_TABLE_CUSTOM_THEME_PREFIX,
2717
+ An as SetSheetTableCommand,
2718
+ Nn as SetSheetTableFilterCommand,
2719
+ Se as SetSheetTableFilterMutation,
2703
2720
  p as SetSheetTableMutation,
2704
- Bn as SheetTableInsertColCommand,
2705
- An as SheetTableInsertRowCommand,
2706
- En as SheetTableRemoveColCommand,
2707
- Ln as SheetTableRemoveRowCommand,
2708
- z as SheetTableService,
2721
+ Ln as SheetTableInsertColCommand,
2722
+ Bn as SheetTableInsertRowCommand,
2723
+ Wn as SheetTableRemoveColCommand,
2724
+ En as SheetTableRemoveRowCommand,
2725
+ j as SheetTableService,
2709
2726
  V as SheetsTableButtonStateEnum,
2710
2727
  E as SheetsTableController,
2711
- G as SheetsTableSortStateEnum,
2728
+ Y as SheetsTableSortStateEnum,
2712
2729
  Qe as TableColumnDataTypeEnum,
2713
- ee as TableColumnFilterTypeEnum,
2730
+ Z as TableColumnFilterTypeEnum,
2714
2731
  U as TableConditionTypeEnum,
2715
2732
  g as TableDateCompareTypeEnum,
2716
2733
  _ as TableManager,
2717
2734
  F as TableNumberCompareTypeEnum,
2718
2735
  P as TableStringCompareTypeEnum,
2719
- Ae as UniverSheetsTablePlugin,
2736
+ $e as UniverSheetsTablePlugin,
2720
2737
  nr as customEmptyThemeWithBorderStyle,
2721
- pt as isConditionFilter,
2738
+ St as isConditionFilter,
2722
2739
  tr as isManualFilter,
2723
2740
  rr as processStyleWithBorderStyle
2724
2741
  };