@univerjs/sheets-filter 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/index.js CHANGED
@@ -1,89 +1,90 @@
1
- var ve = Object.defineProperty;
2
- var Me = (i, r, e) => r in i ? ve(i, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[r] = e;
3
- var w = (i, r, e) => Me(i, typeof r != "symbol" ? r + "" : r, e);
4
- import { isNumeric as Ee, Disposable as B, Rectangle as K, mergeSets as G, Tools as te, extractPureTextFromCell as ye, CellValueType as X, UniverInstanceType as D, fromCallback as Oe, CommandType as E, IResourceManagerService as Ae, IUniverInstanceService as T, ICommandService as N, IUndoRedoService as q, sequenceExecute as Te, ErrorService as Ne, LocaleService as xe, Inject as I, Optional as Ie, DisposableCollection as $e, moveMatrixArray as re, Plugin as Pe, merge as Ue, touchDependencies as De, Injector as Le, IConfigService as Be } from "@univerjs/core";
5
- import { getSheetCommandTarget as b, SheetsSelectionsService as be, isSingleCellSelection as He, expandToContinuousRange as de, SheetInterceptorService as ze, RefRangeService as We, SetWorksheetActiveOperation as Ve, CopySheetCommand as je, RemoveSheetCommand as ke, INTERCEPTOR_POINT as qe, RemoveRowMutation as Qe, InsertRowMutation as Ge, SetRangeValuesMutation as Je, MoveRowsCommand as Ye, MoveRangeCommand as Ke, EffectRefRangId as ne, RemoveRowCommand as Xe, RemoveColCommand as Ze, InsertColCommand as et, InsertRowCommand as tt } from "@univerjs/sheets";
6
- import { BehaviorSubject as L, merge as rt, filter as nt, switchMap as it, of as st } from "rxjs";
7
- import { DataSyncPrimaryController as ot } from "@univerjs/rpc";
8
- import { IActiveDirtyManagerService as lt, ISheetRowFilteredService as at } from "@univerjs/engine-formula";
9
- const ue = "sheet.mutation.set-filter-range", he = "sheet.mutation.set-filter-criteria", me = "sheet.mutation.remove-filter", fe = "sheet.mutation.re-calc-filter", ge = /* @__PURE__ */ new Set([
10
- ue,
11
- he,
1
+ var Ee = Object.defineProperty;
2
+ var Oe = (i, r, e) => r in i ? Ee(i, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[r] = e;
3
+ var S = (i, r, e) => Oe(i, typeof r != "symbol" ? r + "" : r, e);
4
+ import { isNumeric as ye, Disposable as B, Rectangle as X, mergeSets as J, Tools as re, extractPureTextFromCell as Ae, CellValueType as Z, ColorKit as ne, UniverInstanceType as b, fromCallback as Te, CommandType as E, IResourceManagerService as Ne, IUniverInstanceService as T, ICommandService as N, IUndoRedoService as G, sequenceExecute as xe, ErrorService as Ie, LocaleService as $e, Inject as $, Optional as Ue, DisposableCollection as Le, moveMatrixArray as ie, Plugin as Pe, merge as be, touchDependencies as De, Injector as Be, IConfigService as He } from "@univerjs/core";
5
+ import { getSheetCommandTarget as H, SheetsSelectionsService as ze, isSingleCellSelection as Ve, expandToContinuousRange as he, SheetInterceptorService as We, RefRangeService as je, SetWorksheetActiveOperation as ke, CopySheetCommand as qe, RemoveSheetCommand as Ge, INTERCEPTOR_POINT as Qe, RemoveRowMutation as Je, InsertRowMutation as Ke, SetRangeValuesMutation as Ye, MoveRowsCommand as Xe, MoveRangeCommand as Ze, EffectRefRangId as se, RemoveRowCommand as et, RemoveColCommand as tt, InsertColCommand as rt, InsertRowCommand as nt } from "@univerjs/sheets";
6
+ import { BehaviorSubject as D, merge as it, filter as st, switchMap as ot, of as lt } from "rxjs";
7
+ import { COLOR_BLACK_RGB as at } from "@univerjs/engine-render";
8
+ import { DataSyncPrimaryController as ct } from "@univerjs/rpc";
9
+ import { IActiveDirtyManagerService as ut, ISheetRowFilteredService as dt } from "@univerjs/engine-formula";
10
+ const fe = "sheet.mutation.set-filter-range", me = "sheet.mutation.set-filter-criteria", ge = "sheet.mutation.remove-filter", _e = "sheet.mutation.re-calc-filter", Re = /* @__PURE__ */ new Set([
11
+ fe,
12
12
  me,
13
- fe
13
+ ge,
14
+ _e
14
15
  ]);
15
- var x = /* @__PURE__ */ ((i) => (i.EQUAL = "equal", i.GREATER_THAN = "greaterThan", i.GREATER_THAN_OR_EQUAL = "greaterThanOrEqual", i.LESS_THAN = "lessThan", i.LESS_THAN_OR_EQUAL = "lessThanOrEqual", i.NOT_EQUALS = "notEqual", i))(x || {});
16
- const ct = {
16
+ var I = /* @__PURE__ */ ((i) => (i[i.VALUES = 0] = "VALUES", i[i.COLORS = 1] = "COLORS", i[i.CONDITIONS = 2] = "CONDITIONS", i))(I || {}), x = /* @__PURE__ */ ((i) => (i.EQUAL = "equal", i.GREATER_THAN = "greaterThan", i.GREATER_THAN_OR_EQUAL = "greaterThanOrEqual", i.LESS_THAN = "lessThan", i.LESS_THAN_OR_EQUAL = "lessThanOrEqual", i.NOT_EQUALS = "notEqual", i))(x || {});
17
+ const ht = {
17
18
  operator: x.GREATER_THAN,
18
- fn: (i, r) => U(i) ? i > r : !1
19
- }, dt = {
19
+ fn: (i, r) => P(i) ? i > r : !1
20
+ }, ft = {
20
21
  operator: x.GREATER_THAN_OR_EQUAL,
21
- fn: (i, r) => U(i) ? i >= r : !1
22
- }, ut = {
22
+ fn: (i, r) => P(i) ? i >= r : !1
23
+ }, mt = {
23
24
  operator: x.LESS_THAN,
24
- fn: (i, r) => U(i) ? i < r : !1
25
- }, ht = {
25
+ fn: (i, r) => P(i) ? i < r : !1
26
+ }, gt = {
26
27
  operator: x.LESS_THAN_OR_EQUAL,
27
- fn: (i, r) => U(i) ? i <= r : !1
28
- }, mt = {
28
+ fn: (i, r) => P(i) ? i <= r : !1
29
+ }, _t = {
29
30
  operator: x.EQUAL,
30
- fn: (i, r) => U(i) ? i === r : !1
31
- }, _e = {
31
+ fn: (i, r) => P(i) ? i === r : !1
32
+ }, Ce = {
32
33
  operator: x.NOT_EQUALS,
33
34
  fn: (i, r) => {
34
35
  if (typeof r == "string") {
35
36
  if (r === " ")
36
37
  return i != null;
37
- const e = Ce(i);
38
- return e && Rt(r) ? !pe(r).test(e) : e !== r;
38
+ const e = Fe(i);
39
+ return e && Ft(r) ? !Se(r).test(e) : e !== r;
39
40
  }
40
- return U(i) ? i !== r : !0;
41
+ return P(i) ? i !== r : !0;
41
42
  }
42
- }, Re = /* @__PURE__ */ new Map([]), ft = [ct, dt, ut, ht, mt, _e];
43
- ft.forEach((i) => {
44
- Re.set(i.operator, i);
43
+ }, pe = /* @__PURE__ */ new Map([]), Rt = [ht, ft, mt, gt, _t, Ce];
44
+ Rt.forEach((i) => {
45
+ pe.set(i.operator, i);
45
46
  });
46
- function gt(i) {
47
+ function Ct(i) {
47
48
  return !!i;
48
49
  }
49
- const _t = {
50
+ const pt = {
50
51
  fn: (i, r) => {
51
- const e = Ce(i);
52
- return e === null ? r === "" : pe(r).test(e);
52
+ const e = Fe(i);
53
+ return e === null ? r === "" : Se(r).test(e);
53
54
  }
54
55
  };
55
- function ie(i) {
56
- return i ? Re.get(i) : _t;
56
+ function oe(i) {
57
+ return i ? pe.get(i) : pt;
57
58
  }
58
- function U(i) {
59
+ function P(i) {
59
60
  return typeof i == "number";
60
61
  }
61
- function se(i) {
62
- return !!(typeof i == "number" || typeof i == "string" && Ee(i));
62
+ function le(i) {
63
+ return !!(typeof i == "number" || typeof i == "string" && ye(i));
63
64
  }
64
- function Ce(i) {
65
+ function Fe(i) {
65
66
  return typeof i == "boolean" || i == null ? null : typeof i == "string" ? i : i.toString();
66
67
  }
67
- function Rt(i) {
68
+ function Ft(i) {
68
69
  return typeof i == "number" ? !1 : i.indexOf("*") !== -1 || i.indexOf("?") !== -1;
69
70
  }
70
- function pe(i) {
71
+ function Se(i) {
71
72
  const r = i.replace(/[.+^${}()|[\]\\]/g, "\\$&").replaceAll("?", ".").replace(/[*]/g, ".$&");
72
73
  return new RegExp(`^${r}$`);
73
74
  }
74
- const J = () => /* @__PURE__ */ new Set();
75
- class V extends B {
75
+ const K = () => /* @__PURE__ */ new Set();
76
+ class j extends B {
76
77
  constructor(e, t, n) {
77
78
  super();
78
- w(this, "_filteredOutRows$", new L(J()));
79
+ S(this, "_filteredOutRows$", new D(K()));
79
80
  /** An observable value. A set of filtered out rows. */
80
- w(this, "filteredOutRows$", this._filteredOutRows$.asObservable());
81
+ S(this, "filteredOutRows$", this._filteredOutRows$.asObservable());
81
82
  // TODO: we may need to update which cols have criteria rather than simple boolean
82
- w(this, "_hasCriteria$", new L(!1));
83
- w(this, "hasCriteria$", this._hasCriteria$.asObservable());
84
- w(this, "_filterColumnByIndex", /* @__PURE__ */ new Map());
85
- w(this, "_alreadyFilteredOutRows", J());
86
- w(this, "_range");
83
+ S(this, "_hasCriteria$", new D(!1));
84
+ S(this, "hasCriteria$", this._hasCriteria$.asObservable());
85
+ S(this, "_filterColumnByIndex", /* @__PURE__ */ new Map());
86
+ S(this, "_alreadyFilteredOutRows", K());
87
+ S(this, "_range");
87
88
  this.unitId = e, this.subUnitId = t, this._worksheet = n;
88
89
  }
89
90
  get filteredOutRows() {
@@ -100,7 +101,7 @@ class V extends B {
100
101
  */
101
102
  serialize() {
102
103
  const e = {
103
- ref: K.clone(this._range),
104
+ ref: X.clone(this._range),
104
105
  filterColumns: this._getAllFilterColumns(!0).sort(([t], [n]) => t - n).map(([t, n]) => n.serialize())
105
106
  };
106
107
  return this._alreadyFilteredOutRows && (e.cachedFilteredOut = Array.from(this._alreadyFilteredOutRows).sort()), e;
@@ -113,7 +114,7 @@ class V extends B {
113
114
  * @param autoFilter auto filter data
114
115
  */
115
116
  static deserialize(e, t, n, s) {
116
- const o = new V(e, t, n);
117
+ const o = new j(e, t, n);
117
118
  return o._dump(s), o;
118
119
  }
119
120
  _dump(e) {
@@ -136,7 +137,7 @@ class V extends B {
136
137
  getFilteredOutRowsExceptCol(e) {
137
138
  return this._getAllFilterColumns(!0).filter(([t]) => t !== e).reduce((t, [, n]) => {
138
139
  const s = n.calc({ getAlreadyFilteredOutRows: () => t });
139
- return s ? G(t, s) : t;
140
+ return s ? J(t, s) : t;
140
141
  }, /* @__PURE__ */ new Set());
141
142
  }
142
143
  /**
@@ -180,7 +181,7 @@ class V extends B {
180
181
  return e ? t : t.map(([n, s]) => s);
181
182
  }
182
183
  _reCalcAllColumns() {
183
- this._alreadyFilteredOutRows = J(), this._getAllFilterColumns().forEach((e) => e.__clearCache()), this._reCalcWithNoCacheColumns();
184
+ this._alreadyFilteredOutRows = K(), this._getAllFilterColumns().forEach((e) => e.__clearCache()), this._reCalcWithNoCacheColumns();
184
185
  }
185
186
  _setCriteriaWithoutReCalc(e, t) {
186
187
  const n = this._range;
@@ -190,7 +191,7 @@ class V extends B {
190
191
  if (e > o || e < s)
191
192
  throw new Error(`[FilterModel] could not set criteria on column ${e} which is out of range!`);
192
193
  let l;
193
- this._filterColumnByIndex.has(e) ? l = this._filterColumnByIndex.get(e) : (l = new Ct(
194
+ this._filterColumnByIndex.has(e) ? l = this._filterColumnByIndex.get(e) : (l = new St(
194
195
  this.unitId,
195
196
  this.subUnitId,
196
197
  this._worksheet,
@@ -209,31 +210,34 @@ class V extends B {
209
210
  this._hasCriteria$.next(this._filterColumnByIndex.size > 0);
210
211
  }
211
212
  _rebuildAlreadyFilteredOutRowsWithCache() {
212
- const e = this._getAllFilterColumns().filter((t) => t.hasCache()).reduce((t, n) => G(t, n.filteredOutRows), /* @__PURE__ */ new Set());
213
+ const e = this._getAllFilterColumns().filter((t) => t.hasCache()).reduce((t, n) => J(t, n.filteredOutRows), /* @__PURE__ */ new Set());
213
214
  this._alreadyFilteredOutRows = e;
214
215
  }
215
216
  _reCalcWithNoCacheColumns() {
216
217
  const e = this._getAllFilterColumns().filter((t) => !t.hasCache());
217
218
  for (const t of e) {
218
219
  const n = t.reCalc();
219
- n && (this._alreadyFilteredOutRows = G(this._alreadyFilteredOutRows, n));
220
+ n && (this._alreadyFilteredOutRows = J(this._alreadyFilteredOutRows, n));
220
221
  }
221
222
  }
222
223
  }
223
- class Ct extends B {
224
+ class St extends B {
224
225
  constructor(e, t, n, s, o) {
225
226
  super();
226
- w(this, "_filteredOutRows", null);
227
+ S(this, "_filteredOutRows", null);
227
228
  /** Cache the filter function. */
228
- w(this, "_filterFn", null);
229
- w(this, "_range", null);
230
- w(this, "_column", 0);
231
- w(this, "_filterByValues", !1);
229
+ S(this, "_filterFn", null);
230
+ S(this, "_range", null);
231
+ S(this, "_column", 0);
232
+ S(this, "_filterBy", I.VALUES);
232
233
  this.unitId = e, this.subUnitId = t, this._worksheet = n, this._criteria = s, this._filterColumnContext = o;
233
234
  }
234
235
  get filteredOutRows() {
235
236
  return this._filteredOutRows;
236
237
  }
238
+ get filterBy() {
239
+ return this._filterBy;
240
+ }
237
241
  dispose() {
238
242
  super.dispose(), this._filteredOutRows = null;
239
243
  }
@@ -246,7 +250,7 @@ class Ct extends B {
246
250
  serialize() {
247
251
  if (!this._criteria)
248
252
  throw new Error("[FilterColumn]: could not serialize without a filter column!");
249
- return te.deepClone({
253
+ return re.deepClone({
250
254
  ...this._criteria,
251
255
  colId: this._column
252
256
  });
@@ -262,7 +266,7 @@ class Ct extends B {
262
266
  this._criteria = e, this._generateFilterFn(), this._filteredOutRows = null;
263
267
  }
264
268
  getColumnData() {
265
- return te.deepClone(this._criteria);
269
+ return re.deepClone(this._criteria);
266
270
  }
267
271
  /**
268
272
  * Trigger new calculation on this `FilterModel` instance.
@@ -285,85 +289,109 @@ class Ct extends B {
285
289
  const { row: a, rowSpan: c, col: h } = l;
286
290
  if (o.has(a) && (!c || c === 1))
287
291
  continue;
288
- const d = this._filterByValues ? ye(this._worksheet.getCell(a, h)) : yt(this._worksheet, a, h);
289
- if (!this._filterFn(d) && (s.add(a), c))
290
- for (let u = 1; u < c; u++)
291
- s.add(a + u);
292
+ if (!(this._filterBy === I.VALUES ? this._filterFn(Ae(this._worksheet.getCell(a, h))) : this._filterBy === I.COLORS ? this._filterFn(this._worksheet.getComposedCellStyle(a, h)) : this._filterFn(Nt(this._worksheet, a, h))) && (s.add(a), c))
293
+ for (let d = 1; d < c; d++)
294
+ s.add(a + d);
292
295
  }
293
296
  return s;
294
297
  }
295
298
  _generateFilterFn() {
296
- this._criteria && (this._filterFn = pt(this._criteria), this._filterByValues = !!this._criteria.filters);
299
+ this._criteria && (this._filterFn = wt(this._criteria), this._filterBy = this._criteria.filters ? I.VALUES : this._criteria.colorFilters ? I.COLORS : I.CONDITIONS);
297
300
  }
298
301
  }
299
- function pt(i) {
302
+ function wt(i) {
300
303
  if (i.filters)
301
- return Ft(i.filters);
304
+ return vt(i.filters);
305
+ if (i.colorFilters)
306
+ return Mt(i.colorFilters);
302
307
  if (i.customFilters)
303
- return wt(i.customFilters);
308
+ return Et(i.customFilters);
304
309
  throw new Error("[FilterModel]: other types of filters are not supported yet.");
305
310
  }
306
- function Ft(i) {
311
+ function vt(i) {
307
312
  const r = !!i.blank, e = new Set(i.filters);
308
313
  return (t) => t === void 0 || t === "" ? r : e.has(typeof t == "string" ? t : `${t}`);
309
314
  }
310
- function wt(i) {
311
- const r = i.customFilters.map((e) => Et(e));
312
- return Mt(r) ? i.and ? St(r) : vt(r) : r[0];
315
+ function Mt(i) {
316
+ if (i.cellFillColors) {
317
+ const r = new Set(i.cellFillColors);
318
+ return (e) => {
319
+ var n;
320
+ if (!e || !((n = e.bg) != null && n.rgb))
321
+ return !!r.has(null);
322
+ const t = new ne(e.bg.rgb).toRgbString();
323
+ return r.has(t);
324
+ };
325
+ }
326
+ if (i.cellTextColors) {
327
+ const r = new Set(i.cellTextColors);
328
+ return (e) => {
329
+ var n;
330
+ if (!e || !((n = e.cl) != null && n.rgb))
331
+ return !!r.has(at);
332
+ const t = new ne(e.cl.rgb).toRgbString();
333
+ return r.has(t);
334
+ };
335
+ }
336
+ throw new Error("[FilterModel]: color filters are not supported yet.");
313
337
  }
314
- function St(i) {
338
+ function Et(i) {
339
+ const r = i.customFilters.map((e) => Tt(e));
340
+ return At(r) ? i.and ? Ot(r) : yt(r) : r[0];
341
+ }
342
+ function Ot(i) {
315
343
  const [r, e] = i;
316
344
  return (t) => r(t) && e(t);
317
345
  }
318
- function vt(i) {
346
+ function yt(i) {
319
347
  const [r, e] = i;
320
348
  return (t) => r(t) || e(t);
321
349
  }
322
- function Mt(i) {
350
+ function At(i) {
323
351
  return i.length === 2;
324
352
  }
325
- function Et(i) {
353
+ function Tt(i) {
326
354
  const r = i.val;
327
- if (i.operator === x.NOT_EQUALS && !se(r))
328
- return (n) => _e.fn(n, r);
329
- if (gt(i.operator)) {
330
- if (!se(r)) return () => !1;
331
- const n = ie(i.operator), s = Number(r);
355
+ if (i.operator === x.NOT_EQUALS && !le(r))
356
+ return (n) => Ce.fn(n, r);
357
+ if (Ct(i.operator)) {
358
+ if (!le(r)) return () => !1;
359
+ const n = oe(i.operator), s = Number(r);
332
360
  return (o) => n.fn(o, s);
333
361
  }
334
- const e = ie(i.operator);
362
+ const e = oe(i.operator);
335
363
  return (t) => e.fn(t, r);
336
364
  }
337
- function yt(i, r, e) {
365
+ function Nt(i, r, e) {
338
366
  const t = i.getCell(r, e);
339
367
  if (!t) return null;
340
368
  const n = i.getCellRaw(r, e);
341
- return t && !n ? oe(t) : n ? t.t === X.NUMBER && typeof t.v == "string" ? n.v : oe(n) : null;
369
+ return t && !n ? ae(t) : n ? t.t === Z.NUMBER && typeof t.v == "string" ? n.v : ae(n) : null;
342
370
  }
343
- function oe(i) {
371
+ function ae(i) {
344
372
  var t, n;
345
373
  const r = (n = (t = i.p) == null ? void 0 : t.body) == null ? void 0 : n.dataStream;
346
374
  if (r) return r.trimEnd();
347
375
  const e = i.v;
348
- return typeof e == "string" ? i.t === X.BOOLEAN ? e.toUpperCase() : e : typeof e == "number" ? i.t === X.BOOLEAN ? e ? "TRUE" : "FALSE" : e : typeof e == "boolean" ? e ? "TRUE" : "FALSE" : "";
376
+ return typeof e == "string" ? i.t === Z.BOOLEAN ? e.toUpperCase() : e : typeof e == "number" ? i.t === Z.BOOLEAN ? e ? "TRUE" : "FALSE" : e : typeof e == "boolean" ? e ? "TRUE" : "FALSE" : "";
349
377
  }
350
- var Ot = Object.getOwnPropertyDescriptor, At = (i, r, e, t) => {
351
- for (var n = t > 1 ? void 0 : t ? Ot(r, e) : r, s = i.length - 1, o; s >= 0; s--)
378
+ var xt = Object.getOwnPropertyDescriptor, It = (i, r, e, t) => {
379
+ for (var n = t > 1 ? void 0 : t ? xt(r, e) : r, s = i.length - 1, o; s >= 0; s--)
352
380
  (o = i[s]) && (n = o(n) || n);
353
381
  return n;
354
382
  }, Y = (i, r) => (e, t) => r(e, t, i);
355
- const Fe = "SHEET_FILTER_PLUGIN";
383
+ const we = "SHEET_FILTER_PLUGIN";
356
384
  let M = class extends B {
357
385
  constructor(r, e, t) {
358
386
  super();
359
- w(this, "_filterModels", /* @__PURE__ */ new Map());
360
- w(this, "_loadedUnitId$", new L(null));
361
- w(this, "loadedUnitId$", this._loadedUnitId$.asObservable());
362
- w(this, "_errorMsg$", new L(null));
363
- w(this, "errorMsg$", this._errorMsg$.asObservable());
364
- w(this, "_activeFilterModel$", new L(null));
387
+ S(this, "_filterModels", /* @__PURE__ */ new Map());
388
+ S(this, "_loadedUnitId$", new D(null));
389
+ S(this, "loadedUnitId$", this._loadedUnitId$.asObservable());
390
+ S(this, "_errorMsg$", new D(null));
391
+ S(this, "errorMsg$", this._errorMsg$.asObservable());
392
+ S(this, "_activeFilterModel$", new D(null));
365
393
  /** An observable value emitting the current Workbook's active Worksheet's filter model (if there is one). */
366
- w(this, "activeFilterModel$", this._activeFilterModel$.asObservable());
394
+ S(this, "activeFilterModel$", this._activeFilterModel$.asObservable());
367
395
  this._resourcesManagerService = r, this._univerInstanceService = e, this._commandService = t, this._initModel(), this._initActiveFilterModel();
368
396
  }
369
397
  /** The current Workbook's active Worksheet's filter model (if there is one). */
@@ -385,7 +413,7 @@ let M = class extends B {
385
413
  const s = n.getSheetBySheetId(e);
386
414
  if (!s)
387
415
  throw new Error(`[SheetsFilterService]: could not create "FilterModel" on a non-existing worksheet ${e}!`);
388
- const o = new V(r, e, s);
416
+ const o = new j(r, e, s);
389
417
  return this._cacheFilterModel(r, e, o), o;
390
418
  }
391
419
  getFilterModel(r, e) {
@@ -402,7 +430,7 @@ let M = class extends B {
402
430
  _updateActiveFilterModel() {
403
431
  let r;
404
432
  try {
405
- if (r = this._univerInstanceService.getCurrentUnitForType(D.UNIVER_SHEET), !r) {
433
+ if (r = this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET), !r) {
406
434
  this._activeFilterModel$.next(null);
407
435
  return;
408
436
  }
@@ -420,13 +448,13 @@ let M = class extends B {
420
448
  }
421
449
  _initActiveFilterModel() {
422
450
  this.disposeWithMe(
423
- rt(
451
+ it(
424
452
  // source1: executing filter related mutations
425
- Oe(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(nt(([r]) => r.type === E.MUTATION && ge.has(r.id))),
453
+ Te(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(st(([r]) => r.type === E.MUTATION && Re.has(r.id))),
426
454
  // source2: activate sheet changes
427
- this._univerInstanceService.getCurrentTypeOfUnit$(D.UNIVER_SHEET).pipe(it((r) => {
455
+ this._univerInstanceService.getCurrentTypeOfUnit$(b.UNIVER_SHEET).pipe(ot((r) => {
428
456
  var e;
429
- return (e = r == null ? void 0 : r.activeSheet$) != null ? e : st(null);
457
+ return (e = r == null ? void 0 : r.activeSheet$) != null ? e : lt(null);
430
458
  }))
431
459
  ).subscribe(() => this._updateActiveFilterModel())
432
460
  );
@@ -443,14 +471,14 @@ let M = class extends B {
443
471
  _deserializeAutoFiltersForUnit(r, e) {
444
472
  const t = this._univerInstanceService.getUniverSheetInstance(r);
445
473
  Object.keys(e).forEach((n) => {
446
- const s = e[n], o = V.deserialize(r, n, t.getSheetBySheetId(n), s);
474
+ const s = e[n], o = j.deserialize(r, n, t.getSheetBySheetId(n), s);
447
475
  this._cacheFilterModel(r, n, o);
448
476
  });
449
477
  }
450
478
  _initModel() {
451
479
  this._resourcesManagerService.registerPluginResource({
452
- pluginName: Fe,
453
- businesses: [D.UNIVER_SHEET],
480
+ pluginName: we,
481
+ businesses: [b.UNIVER_SHEET],
454
482
  toJson: (r) => this._serializeAutoFiltersForUnit(r),
455
483
  parseJson: (r) => JSON.parse(r),
456
484
  onLoad: (r, e) => {
@@ -466,98 +494,98 @@ let M = class extends B {
466
494
  this._filterModels.has(r) || this._filterModels.set(r, /* @__PURE__ */ new Map()), this._filterModels.get(r).set(e, t);
467
495
  }
468
496
  };
469
- M = At([
470
- Y(0, Ae),
497
+ M = It([
498
+ Y(0, Ne),
471
499
  Y(1, T),
472
500
  Y(2, N)
473
501
  ], M);
474
502
  const R = {
475
- id: ue,
503
+ id: fe,
476
504
  type: E.MUTATION,
477
505
  handler: (i, r) => {
478
506
  const { subUnitId: e, unitId: t, range: n } = r;
479
507
  return i.get(M).ensureFilterModel(t, e).setRange(n), !0;
480
508
  }
481
509
  }, p = {
482
- id: he,
510
+ id: me,
483
511
  type: E.MUTATION,
484
512
  handler: (i, r) => {
485
513
  const { subUnitId: e, unitId: t, criteria: n, col: s, reCalc: o = !0 } = r, a = i.get(M).getFilterModel(t, e);
486
514
  return a ? (a.setCriteria(s, n, o), !0) : !1;
487
515
  }
488
- }, y = {
489
- id: me,
516
+ }, O = {
517
+ id: ge,
490
518
  type: E.MUTATION,
491
519
  handler: (i, r) => {
492
520
  const { unitId: e, subUnitId: t } = r;
493
521
  return i.get(M).removeFilterModel(e, t);
494
522
  }
495
523
  }, W = {
496
- id: fe,
524
+ id: _e,
497
525
  type: E.MUTATION,
498
526
  handler: (i, r) => {
499
527
  const { unitId: e, subUnitId: t } = r, s = i.get(M).getFilterModel(e, t);
500
528
  return s ? (s.reCalc(), !0) : !1;
501
529
  }
502
- }, Tt = {
530
+ }, $t = {
503
531
  id: "sheet.command.set-filter-range",
504
532
  type: E.COMMAND,
505
533
  handler: (i, r) => {
506
- const e = i.get(M), t = i.get(N), n = i.get(q), s = i.get(T), { unitId: o, subUnitId: l, range: a } = r;
507
- if (!b(s, r) || e.getFilterModel(o, l)) return !1;
534
+ const e = i.get(M), t = i.get(N), n = i.get(G), s = i.get(T), { unitId: o, subUnitId: l, range: a } = r;
535
+ if (!H(s, r) || e.getFilterModel(o, l)) return !1;
508
536
  if (a.endRow === a.startRow) {
509
- const f = i.get(Ne), g = i.get(xe);
510
- return f.emit(g.t("sheets-filter.command.not-valid-filter-range")), !1;
537
+ const m = i.get(Ie), g = i.get($e);
538
+ return m.emit(g.t("sheets-filter.command.not-valid-filter-range")), !1;
511
539
  }
512
- const d = { id: R.id, params: { unitId: o, subUnitId: l, range: a } }, u = t.syncExecuteCommand(d.id, d.params);
513
- return u && n.pushUndoRedo({
540
+ const u = { id: R.id, params: { unitId: o, subUnitId: l, range: a } }, d = t.syncExecuteCommand(u.id, u.params);
541
+ return d && n.pushUndoRedo({
514
542
  unitID: o,
515
- undoMutations: [{ id: y.id, params: { unitId: o, subUnitId: l } }],
516
- redoMutations: [d]
517
- }), u;
543
+ undoMutations: [{ id: O.id, params: { unitId: o, subUnitId: l } }],
544
+ redoMutations: [u]
545
+ }), d;
518
546
  }
519
- }, Nt = {
547
+ }, Ut = {
520
548
  id: "sheet.command.remove-sheet-filter",
521
549
  type: E.COMMAND,
522
550
  handler: (i, r) => {
523
- const e = i.get(T), t = i.get(M), n = i.get(N), s = i.get(q), o = b(e, r);
551
+ const e = i.get(T), t = i.get(M), n = i.get(N), s = i.get(G), o = H(e, r);
524
552
  if (!o) return !1;
525
553
  const { unitId: l, subUnitId: a } = o, c = t.getFilterModel(l, a);
526
554
  if (!c) return !1;
527
- const h = c == null ? void 0 : c.serialize(), d = xt(l, a, h), u = n.syncExecuteCommand(y.id, { unitId: l, subUnitId: a });
528
- return u && s.pushUndoRedo({
555
+ const h = c == null ? void 0 : c.serialize(), u = Lt(l, a, h), d = n.syncExecuteCommand(O.id, { unitId: l, subUnitId: a });
556
+ return d && s.pushUndoRedo({
529
557
  unitID: l,
530
- undoMutations: d,
531
- redoMutations: [{ id: y.id, params: { unitId: l, subUnitId: a } }]
532
- }), u;
558
+ undoMutations: u,
559
+ redoMutations: [{ id: O.id, params: { unitId: l, subUnitId: a } }]
560
+ }), d;
533
561
  }
534
- }, Gt = {
562
+ }, Zt = {
535
563
  id: "sheet.command.smart-toggle-filter",
536
564
  type: E.COMMAND,
537
565
  handler: async (i) => {
538
- const r = i.get(T), e = i.get(M), t = i.get(N), n = r.getCurrentUnitForType(D.UNIVER_SHEET), s = n == null ? void 0 : n.getActiveSheet();
566
+ const r = i.get(T), e = i.get(M), t = i.get(N), n = r.getCurrentUnitForType(b.UNIVER_SHEET), s = n == null ? void 0 : n.getActiveSheet();
539
567
  if (!s || !n) return !1;
540
568
  const o = n.getUnitId(), l = s.getSheetId();
541
569
  if (e.getFilterModel(o, l))
542
- return t.executeCommand(Nt.id, { unitId: o, subUnitId: l });
543
- const h = i.get(be).getCurrentLastSelection();
570
+ return t.executeCommand(Ut.id, { unitId: o, subUnitId: l });
571
+ const h = i.get(ze).getCurrentLastSelection();
544
572
  if (!h) return !1;
545
- const d = h.range, u = He(h) ? de(d, { left: !0, right: !0, up: !0, down: !0 }, s) : d;
546
- return t.executeCommand(Tt.id, {
573
+ const u = h.range, d = Ve(h) ? he(u, { left: !0, right: !0, up: !0, down: !0 }, s) : u;
574
+ return t.executeCommand($t.id, {
547
575
  unitId: o,
548
576
  subUnitId: l,
549
- range: u
577
+ range: d
550
578
  });
551
579
  }
552
- }, Jt = {
580
+ }, er = {
553
581
  id: "sheet.command.set-filter-criteria",
554
582
  type: E.COMMAND,
555
583
  handler: (i, r) => {
556
- const e = i.get(M), t = i.get(N), n = i.get(q), { unitId: s, subUnitId: o, col: l, criteria: a } = r, c = e.getFilterModel(s, o);
584
+ const e = i.get(M), t = i.get(N), n = i.get(G), { unitId: s, subUnitId: o, col: l, criteria: a } = r, c = e.getFilterModel(s, o);
557
585
  if (!c) return !1;
558
586
  const h = c.getRange();
559
587
  if (!h || l < h.startColumn || l > h.endColumn) return !1;
560
- const d = c.getFilterColumn(l), u = $t(s, o, l, d), f = {
588
+ const u = c.getFilterColumn(l), d = bt(s, o, l, u), m = {
561
589
  id: p.id,
562
590
  params: {
563
591
  unitId: s,
@@ -565,39 +593,39 @@ const R = {
565
593
  col: l,
566
594
  criteria: a
567
595
  }
568
- }, g = t.syncExecuteCommand(f.id, f.params);
596
+ }, g = t.syncExecuteCommand(m.id, m.params);
569
597
  return g && n.pushUndoRedo({
570
598
  unitID: s,
571
- undoMutations: [u],
572
- redoMutations: [f]
599
+ undoMutations: [d],
600
+ redoMutations: [m]
573
601
  }), g;
574
602
  }
575
- }, Yt = {
603
+ }, tr = {
576
604
  id: "sheet.command.clear-filter-criteria",
577
605
  type: E.COMMAND,
578
606
  handler: (i, r) => {
579
- const e = i.get(M), t = i.get(q), n = i.get(N), s = i.get(T), o = b(s, r);
607
+ const e = i.get(M), t = i.get(G), n = i.get(N), s = i.get(T), o = H(s, r);
580
608
  if (!o) return !1;
581
609
  const { unitId: l, subUnitId: a } = o, c = e.getFilterModel(o.unitId, o.subUnitId);
582
610
  if (!c) return !1;
583
- const h = c.serialize(), d = we(l, a, h), u = It(l, a, h);
584
- return Te(u, n).result ? (t.pushUndoRedo({
611
+ const h = c.serialize(), u = ve(l, a, h), d = Pt(l, a, h);
612
+ return xe(d, n).result ? (t.pushUndoRedo({
585
613
  unitID: l,
586
- undoMutations: d,
587
- redoMutations: u
614
+ undoMutations: u,
615
+ redoMutations: d
588
616
  }), !0) : !1;
589
617
  }
590
- }, Kt = {
618
+ }, rr = {
591
619
  id: "sheet.command.re-calc-filter",
592
620
  type: E.COMMAND,
593
621
  handler: (i, r) => {
594
- const e = i.get(M), t = i.get(N), n = i.get(T), s = b(n, r);
622
+ const e = i.get(M), t = i.get(N), n = i.get(T), s = H(n, r);
595
623
  if (!s) return !1;
596
624
  const { unitId: o, subUnitId: l } = s;
597
625
  return e.getFilterModel(s.unitId, s.subUnitId) ? t.executeCommand(W.id, { unitId: o, subUnitId: l }) : !1;
598
626
  }
599
627
  };
600
- function xt(i, r, e) {
628
+ function Lt(i, r, e) {
601
629
  const t = [], n = {
602
630
  id: R.id,
603
631
  params: {
@@ -606,9 +634,9 @@ function xt(i, r, e) {
606
634
  range: e.ref
607
635
  }
608
636
  };
609
- return t.push(n), we(i, r, e).forEach((o) => t.push(o)), t;
637
+ return t.push(n), ve(i, r, e).forEach((o) => t.push(o)), t;
610
638
  }
611
- function we(i, r, e) {
639
+ function ve(i, r, e) {
612
640
  var n;
613
641
  const t = [];
614
642
  return (n = e.filterColumns) == null || n.forEach((s) => {
@@ -624,7 +652,7 @@ function we(i, r, e) {
624
652
  t.push(o);
625
653
  }), t;
626
654
  }
627
- function It(i, r, e) {
655
+ function Pt(i, r, e) {
628
656
  var n;
629
657
  const t = [];
630
658
  return (n = e.filterColumns) == null || n.forEach((s) => {
@@ -640,7 +668,7 @@ function It(i, r, e) {
640
668
  t.push(o);
641
669
  }), t;
642
670
  }
643
- function $t(i, r, e, t) {
671
+ function bt(i, r, e, t) {
644
672
  if (!t)
645
673
  return {
646
674
  id: p.id,
@@ -662,8 +690,8 @@ function $t(i, r, e, t) {
662
690
  }
663
691
  };
664
692
  }
665
- const Pt = "sheets-filter.config", le = {};
666
- function Ut(i, r) {
693
+ const Dt = "sheets-filter.config", ce = {};
694
+ function Bt(i, r) {
667
695
  for (let e = 0; e < i.length; e++) {
668
696
  let t = e;
669
697
  if (i[e])
@@ -672,18 +700,18 @@ function Ut(i, r) {
672
700
  }
673
701
  return i.filter((e) => e !== null);
674
702
  }
675
- function $(i) {
676
- return Ut(i, (r, e) => r.id === p.id && e.id === p.id && r.params.unitId === e.params.unitId && r.params.subUnitId === e.params.subUnitId && r.params.col === e.params.col);
703
+ function U(i) {
704
+ return Bt(i, (r, e) => r.id === p.id && e.id === p.id && r.params.unitId === e.params.unitId && r.params.subUnitId === e.params.subUnitId && r.params.col === e.params.col);
677
705
  }
678
- var Dt = Object.getOwnPropertyDescriptor, Lt = (i, r, e, t) => {
679
- for (var n = t > 1 ? void 0 : t ? Dt(r, e) : r, s = i.length - 1, o; s >= 0; s--)
706
+ var Ht = Object.getOwnPropertyDescriptor, zt = (i, r, e, t) => {
707
+ for (var n = t > 1 ? void 0 : t ? Ht(r, e) : r, s = i.length - 1, o; s >= 0; s--)
680
708
  (o = i[s]) && (n = o(n) || n);
681
709
  return n;
682
- }, P = (i, r) => (e, t) => r(e, t, i);
683
- let j = class extends B {
710
+ }, L = (i, r) => (e, t) => r(e, t, i);
711
+ let k = class extends B {
684
712
  constructor(r, e, t, n, s, o) {
685
713
  super();
686
- w(this, "_disposableCollection", new $e());
714
+ S(this, "_disposableCollection", new Le());
687
715
  this._commandService = r, this._sheetInterceptorService = e, this._sheetsFilterService = t, this._univerInstanceService = n, this._refRangeService = s, this._dataSyncPrimaryController = o, this._initCommands(), this._initRowFilteredInterceptor(), this._initInterceptors(), this._commandExecutedListener(), this._initErrorHandling();
688
716
  }
689
717
  _initCommands() {
@@ -691,7 +719,7 @@ let j = class extends B {
691
719
  p,
692
720
  R,
693
721
  W,
694
- y
722
+ O
695
723
  ].forEach((r) => {
696
724
  var e;
697
725
  this.disposeWithMe(this._commandService.registerCommand(r)), (e = this._dataSyncPrimaryController) == null || e.registerSyncingMutations(r);
@@ -701,7 +729,7 @@ let j = class extends B {
701
729
  this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
702
730
  getMutations: (r) => this._getUpdateFilter(r)
703
731
  })), this.disposeWithMe(this._commandService.onCommandExecuted((r) => {
704
- if (r.id === Ve.id) {
732
+ if (r.id === ke.id) {
705
733
  const e = r.params, t = e.subUnitId, n = e.unitId;
706
734
  if (!t || !n)
707
735
  return;
@@ -727,31 +755,31 @@ let j = class extends B {
727
755
  if (!t || !n) return;
728
756
  const s = (l = this._sheetsFilterService.getFilterModel(r, e)) == null ? void 0 : l.getRange(), o = (a) => {
729
757
  switch (a.id) {
730
- case tt.id: {
731
- const c = a.params, h = c.unitId || r, d = c.subUnitId || e;
732
- return this._handleInsertRowCommand(c, h, d);
758
+ case nt.id: {
759
+ const c = a.params, h = c.unitId || r, u = c.subUnitId || e;
760
+ return this._handleInsertRowCommand(c, h, u);
733
761
  }
734
- case et.id: {
735
- const c = a.params, h = c.unitId || r, d = c.subUnitId || e;
736
- return this._handleInsertColCommand(c, h, d);
762
+ case rt.id: {
763
+ const c = a.params, h = c.unitId || r, u = c.subUnitId || e;
764
+ return this._handleInsertColCommand(c, h, u);
737
765
  }
738
- case Ze.id: {
766
+ case tt.id: {
739
767
  const c = a.params;
740
768
  return this._handleRemoveColCommand(c, r, e);
741
769
  }
742
- case Xe.id: {
770
+ case et.id: {
743
771
  const c = a.params;
744
772
  return this._handleRemoveRowCommand(c, r, e);
745
773
  }
746
- case ne.MoveColsCommandId: {
774
+ case se.MoveColsCommandId: {
747
775
  const c = a.params;
748
776
  return this._handleMoveColsCommand(c, r, e);
749
777
  }
750
- case ne.MoveRowsCommandId: {
778
+ case se.MoveRowsCommandId: {
751
779
  const c = a.params;
752
780
  return this._handleMoveRowsCommand(c, r, e);
753
781
  }
754
- case Ke.id: {
782
+ case Ze.id: {
755
783
  const c = a.params;
756
784
  return this._handleMoveRangeCommand(c, r, e);
757
785
  }
@@ -763,11 +791,11 @@ let j = class extends B {
763
791
  _getUpdateFilter(r) {
764
792
  const { id: e } = r;
765
793
  switch (e) {
766
- case ke.id: {
794
+ case Ge.id: {
767
795
  const t = r.params;
768
796
  return this._handleRemoveSheetCommand(t, t.unitId, t.subUnitId);
769
797
  }
770
- case je.id: {
798
+ case qe.id: {
771
799
  const t = r.params, { targetSubUnitId: n, unitId: s, subUnitId: o } = t;
772
800
  return !s || !o || !n ? this._handleNull() : this._handleCopySheetCommand(s, o, n);
773
801
  }
@@ -785,7 +813,7 @@ let j = class extends B {
785
813
  const { startColumn: o, endColumn: l } = s, { startColumn: a, endColumn: c } = r.range, h = c - a + 1;
786
814
  if (c > l)
787
815
  return this._handleNull();
788
- const d = [], u = [], f = a, g = {
816
+ const u = [], d = [], m = a, g = {
789
817
  unitId: e,
790
818
  subUnitId: t,
791
819
  range: {
@@ -798,13 +826,13 @@ let j = class extends B {
798
826
  subUnitId: t,
799
827
  range: s
800
828
  };
801
- d.push({ id: R.id, params: g }), u.push({ id: R.id, params: C });
802
- const F = n.getAllFilterColumns().filter((m) => m[0] >= f);
829
+ u.push({ id: R.id, params: g }), d.push({ id: R.id, params: C });
830
+ const F = n.getAllFilterColumns().filter((f) => f[0] >= m);
803
831
  if (F.length !== 0) {
804
- const { newRange: m, oldRange: v } = this._moveCriteria(e, t, F, h);
805
- d.push(...m.redos, ...v.redos), u.push(...m.undos, ...v.undos);
832
+ const { newRange: f, oldRange: v } = this._moveCriteria(e, t, F, h);
833
+ u.push(...f.redos, ...v.redos), d.push(...f.undos, ...v.undos);
806
834
  }
807
- return { redos: $(d), undos: $(u) };
835
+ return { redos: U(u), undos: U(d) };
808
836
  }
809
837
  _handleInsertRowCommand(r, e, t) {
810
838
  var C;
@@ -814,7 +842,7 @@ let j = class extends B {
814
842
  const { startRow: o, endRow: l } = s, { startRow: a, endRow: c } = r.range, h = c - a + 1;
815
843
  if (c > l)
816
844
  return this._handleNull();
817
- const d = [], u = [], f = {
845
+ const u = [], d = [], m = {
818
846
  unitId: e,
819
847
  subUnitId: t,
820
848
  range: {
@@ -827,9 +855,9 @@ let j = class extends B {
827
855
  subUnitId: t,
828
856
  range: s
829
857
  };
830
- return d.push({ id: R.id, params: f }), u.push({ id: R.id, params: g }), {
831
- redos: $(d),
832
- undos: $(u)
858
+ return u.push({ id: R.id, params: m }), d.push({ id: R.id, params: g }), {
859
+ redos: U(u),
860
+ undos: U(d)
833
861
  };
834
862
  }
835
863
  _handleRemoveColCommand(r, e, t) {
@@ -840,36 +868,36 @@ let j = class extends B {
840
868
  const { startColumn: o, endColumn: l } = s, { startColumn: a, endColumn: c } = r.range;
841
869
  if (a > l)
842
870
  return this._handleNull();
843
- const h = [], d = [], u = c < o ? 0 : Math.min(c, l) - Math.max(a, o) + 1, f = c - a + 1, g = n.getAllFilterColumns();
871
+ const h = [], u = [], d = c < o ? 0 : Math.min(c, l) - Math.max(a, o) + 1, m = c - a + 1, g = n.getAllFilterColumns();
844
872
  g.forEach((_) => {
845
- const [m, v] = _;
846
- m <= c && m >= a && (h.push({ id: p.id, params: { unitId: e, subUnitId: t, col: m, criteria: null } }), d.push({ id: p.id, params: { unitId: e, subUnitId: t, col: m, criteria: { ...v.serialize(), colId: m } } }));
873
+ const [f, v] = _;
874
+ f <= c && f >= a && (h.push({ id: p.id, params: { unitId: e, subUnitId: t, col: f, criteria: null } }), u.push({ id: p.id, params: { unitId: e, subUnitId: t, col: f, criteria: { ...v.serialize(), colId: f } } }));
847
875
  });
848
876
  const C = g.filter((_) => {
849
- const [m, v] = _;
850
- return m > c;
877
+ const [f, v] = _;
878
+ return f > c;
851
879
  });
852
- let S = { undos: [], redos: [] };
880
+ let w = { undos: [], redos: [] };
853
881
  if (C.length > 0) {
854
- const { oldRange: _, newRange: m } = this._moveCriteria(e, t, C, -f);
855
- S = m, h.push(..._.redos), d.unshift(..._.undos);
882
+ const { oldRange: _, newRange: f } = this._moveCriteria(e, t, C, -m);
883
+ w = f, h.push(..._.redos), u.unshift(..._.undos);
856
884
  }
857
- if (u === l - o + 1) {
885
+ if (d === l - o + 1) {
858
886
  const _ = {
859
887
  unitId: e,
860
888
  subUnitId: t
861
889
  };
862
- h.push({ id: y.id, params: _ }), d.unshift({ id: R.id, params: { range: s, unitId: e, subUnitId: t } });
890
+ h.push({ id: O.id, params: _ }), u.unshift({ id: R.id, params: { range: s, unitId: e, subUnitId: t } });
863
891
  } else {
864
- const _ = o <= a ? o : u === 0 ? o - f : a, m = o <= a ? l - u : l - f, v = {
892
+ const _ = o <= a ? o : d === 0 ? o - m : a, f = o <= a ? l - d : l - m, v = {
865
893
  unitId: e,
866
894
  subUnitId: t,
867
- range: { ...s, startColumn: _, endColumn: m }
895
+ range: { ...s, startColumn: _, endColumn: f }
868
896
  };
869
- h.push({ id: R.id, params: v }), d.unshift({ id: R.id, params: { range: s, unitId: e, subUnitId: t } }), h.push(...S.redos), d.unshift(...S.undos);
897
+ h.push({ id: R.id, params: v }), u.unshift({ id: R.id, params: { range: s, unitId: e, subUnitId: t } }), h.push(...w.redos), u.unshift(...w.undos);
870
898
  }
871
899
  return {
872
- undos: d,
900
+ undos: u,
873
901
  redos: h
874
902
  };
875
903
  }
@@ -897,44 +925,44 @@ let j = class extends B {
897
925
  }
898
926
  }]
899
927
  };
900
- const h = [], d = [], u = n.getAllFilterColumns(), f = o <= c && o >= a;
901
- d.push({ id: R.id, params: { range: s, unitId: e, subUnitId: t } });
928
+ const h = [], u = [], d = n.getAllFilterColumns(), m = o <= c && o >= a;
929
+ u.push({ id: R.id, params: { range: s, unitId: e, subUnitId: t } });
902
930
  const g = Math.min(c, l) - Math.max(a, o) + 1;
903
- if (g === l - o + 1 || f) {
904
- const S = {
931
+ if (g === l - o + 1 || m) {
932
+ const w = {
905
933
  unitId: e,
906
934
  subUnitId: t
907
935
  };
908
- h.push({ id: y.id, params: S }), u.forEach((F) => {
909
- const [_, m] = F, v = {
936
+ h.push({ id: O.id, params: w }), d.forEach((F) => {
937
+ const [_, f] = F, v = {
910
938
  unitId: e,
911
939
  subUnitId: t,
912
940
  col: _,
913
- criteria: { ...m.serialize(), colId: _ }
941
+ criteria: { ...f.serialize(), colId: _ }
914
942
  };
915
- d.push({ id: p.id, params: v });
943
+ u.push({ id: p.id, params: v });
916
944
  });
917
945
  } else {
918
- const S = (C = this._univerInstanceService.getUniverSheetInstance(e)) == null ? void 0 : C.getSheetBySheetId(t);
919
- if (!S)
946
+ const w = (C = this._univerInstanceService.getUniverSheetInstance(e)) == null ? void 0 : C.getSheetBySheetId(t);
947
+ if (!w)
920
948
  return this._handleNull();
921
949
  const F = [];
922
- for (let O = a; O <= c; O++)
923
- S.getRowFiltered(O) && F.push(O);
924
- const _ = Math.min(o, a), m = _ + (l - o) - g + F.length, v = {
950
+ for (let y = a; y <= c; y++)
951
+ w.getRowFiltered(y) && F.push(y);
952
+ const _ = Math.min(o, a), f = _ + (l - o) - g + F.length, v = {
925
953
  unitId: e,
926
954
  subUnitId: t,
927
955
  range: {
928
956
  ...s,
929
957
  startRow: _,
930
- endRow: m
958
+ endRow: f
931
959
  }
932
960
  };
933
961
  h.push({ id: R.id, params: v });
934
962
  }
935
963
  return {
936
- undos: $(d),
937
- redos: $(h)
964
+ undos: U(u),
965
+ redos: U(h)
938
966
  };
939
967
  }
940
968
  // eslint-disable-next-line max-lines-per-function
@@ -946,58 +974,58 @@ let j = class extends B {
946
974
  const { startColumn: o, endColumn: l } = s, { fromRange: a, toRange: c } = r;
947
975
  if (a.endColumn < o && c.startColumn <= o || a.startColumn > l && c.endColumn > l)
948
976
  return this._handleNull();
949
- const h = [], d = [], u = {};
950
- for (let m = o; m <= l; m++)
951
- u[m] = {
952
- colIndex: m,
953
- filter: n.getFilterColumn(m)
977
+ const h = [], u = [], d = {};
978
+ for (let f = o; f <= l; f++)
979
+ d[f] = {
980
+ colIndex: f,
981
+ filter: n.getFilterColumn(f)
954
982
  };
955
- re(a.startColumn, a.endColumn - a.startColumn + 1, c.startColumn, u);
956
- let f = s.startColumn, g = s.endColumn;
957
- o >= a.startColumn && o <= a.endColumn && c.startColumn > a.startColumn && a.endColumn < l && (f = a.endColumn + 1), l >= a.startColumn && l <= a.endColumn && c.startColumn < a.startColumn && a.startColumn > o && (g = a.startColumn - 1);
958
- const C = Object.keys(u).map((m) => Number(m)), S = C.find((m) => u[m].colIndex === g), F = C.find((m) => u[m].colIndex === f);
959
- if (C.forEach((m) => {
960
- var Z, ee;
961
- const { colIndex: v, filter: O } = u[m], A = m;
962
- if (O) {
963
- if (A >= F && A <= S) {
983
+ ie(a.startColumn, a.endColumn - a.startColumn + 1, c.startColumn, d);
984
+ let m = s.startColumn, g = s.endColumn;
985
+ o >= a.startColumn && o <= a.endColumn && c.startColumn > a.startColumn && a.endColumn < l && (m = a.endColumn + 1), l >= a.startColumn && l <= a.endColumn && c.startColumn < a.startColumn && a.startColumn > o && (g = a.startColumn - 1);
986
+ const C = Object.keys(d).map((f) => Number(f)), w = C.find((f) => d[f].colIndex === g), F = C.find((f) => d[f].colIndex === m);
987
+ if (C.forEach((f) => {
988
+ var ee, te;
989
+ const { colIndex: v, filter: y } = d[f], A = f;
990
+ if (y) {
991
+ if (A >= F && A <= w) {
964
992
  const Q = {
965
993
  unitId: e,
966
994
  subUnitId: t,
967
995
  col: A,
968
- criteria: { ...O.serialize(), colId: A }
969
- }, Se = {
996
+ criteria: { ...y.serialize(), colId: A }
997
+ }, Me = {
970
998
  unitId: e,
971
999
  subUnitId: t,
972
1000
  col: A,
973
- criteria: n.getFilterColumn(A) ? { ...(Z = n.getFilterColumn(A)) == null ? void 0 : Z.serialize(), colId: A } : null
1001
+ criteria: n.getFilterColumn(A) ? { ...(ee = n.getFilterColumn(A)) == null ? void 0 : ee.serialize(), colId: A } : null
974
1002
  };
975
- h.push({ id: p.id, params: Q }), d.push({ id: p.id, params: Se });
1003
+ h.push({ id: p.id, params: Q }), u.push({ id: p.id, params: Me });
976
1004
  }
977
- if (!((ee = u[v]) != null && ee.filter)) {
1005
+ if (!((te = d[v]) != null && te.filter)) {
978
1006
  const Q = {
979
1007
  unitId: e,
980
1008
  subUnitId: t,
981
1009
  col: v,
982
1010
  criteria: null
983
1011
  };
984
- h.push({ id: p.id, params: Q }), d.push({ id: p.id, params: { unitId: e, subUnitId: t, col: v, criteria: { ...O.serialize(), colId: v } } });
1012
+ h.push({ id: p.id, params: Q }), u.push({ id: p.id, params: { unitId: e, subUnitId: t, col: v, criteria: { ...y.serialize(), colId: v } } });
985
1013
  }
986
1014
  }
987
- }), o !== F || l !== S) {
988
- const m = {
1015
+ }), o !== F || l !== w) {
1016
+ const f = {
989
1017
  unitId: e,
990
1018
  subUnitId: t,
991
1019
  range: {
992
1020
  ...s,
993
1021
  startColumn: F,
994
- endColumn: S
1022
+ endColumn: w
995
1023
  }
996
1024
  };
997
- h.unshift({ id: R.id, params: m }), d.unshift({ id: R.id, params: { range: s, unitId: e, subUnitId: t } });
1025
+ h.unshift({ id: R.id, params: f }), u.unshift({ id: R.id, params: { range: s, unitId: e, subUnitId: t } });
998
1026
  }
999
1027
  return {
1000
- undos: d,
1028
+ undos: u,
1001
1029
  redos: h
1002
1030
  };
1003
1031
  }
@@ -1009,30 +1037,30 @@ let j = class extends B {
1009
1037
  const { startRow: o, endRow: l } = s, { fromRange: a, toRange: c } = r;
1010
1038
  if (a.endRow < o && c.startRow <= o || a.startRow > l && c.endRow > l)
1011
1039
  return this._handleNull();
1012
- const h = [], d = [], u = {};
1013
- for (let m = o; m <= l; m++)
1014
- u[m] = {
1015
- oldIndex: m
1040
+ const h = [], u = [], d = {};
1041
+ for (let f = o; f <= l; f++)
1042
+ d[f] = {
1043
+ oldIndex: f
1016
1044
  };
1017
- const f = o;
1045
+ const m = o;
1018
1046
  let g = l;
1019
- l >= a.startRow && l <= a.endRow && c.startRow < a.startRow && a.startRow > o && (g = a.startRow - 1), re(a.startRow, a.endRow - a.startRow + 1, c.startRow, u);
1020
- const C = Object.keys(u).map((m) => Number(m)), S = C.find((m) => u[m].oldIndex === g), F = C.find((m) => u[m].oldIndex === f);
1021
- if (o !== F || l !== S) {
1022
- const m = {
1047
+ l >= a.startRow && l <= a.endRow && c.startRow < a.startRow && a.startRow > o && (g = a.startRow - 1), ie(a.startRow, a.endRow - a.startRow + 1, c.startRow, d);
1048
+ const C = Object.keys(d).map((f) => Number(f)), w = C.find((f) => d[f].oldIndex === g), F = C.find((f) => d[f].oldIndex === m);
1049
+ if (o !== F || l !== w) {
1050
+ const f = {
1023
1051
  unitId: e,
1024
1052
  subUnitId: t,
1025
1053
  range: {
1026
1054
  ...s,
1027
1055
  startRow: F,
1028
- endRow: S
1056
+ endRow: w
1029
1057
  }
1030
1058
  };
1031
- h.push({ id: R.id, params: m }, { id: W.id, params: { unitId: e, subUnitId: t } }), d.push({ id: R.id, params: { range: s, unitId: e, subUnitId: t } }, { id: W.id, params: { unitId: e, subUnitId: t } });
1059
+ h.push({ id: R.id, params: f }, { id: W.id, params: { unitId: e, subUnitId: t } }), u.push({ id: R.id, params: { range: s, unitId: e, subUnitId: t } }, { id: W.id, params: { unitId: e, subUnitId: t } });
1032
1060
  }
1033
1061
  return {
1034
1062
  redos: h,
1035
- undos: d
1063
+ undos: u
1036
1064
  };
1037
1065
  }
1038
1066
  _handleMoveRangeCommand(r, e, t) {
@@ -1043,26 +1071,26 @@ let j = class extends B {
1043
1071
  if (!l)
1044
1072
  return this._handleNull();
1045
1073
  const a = [], c = [];
1046
- if (K.contains(n, l)) {
1047
- const h = l.startRow - n.startRow, d = l.startColumn - n.startColumn, u = {
1074
+ if (X.contains(n, l)) {
1075
+ const h = l.startRow - n.startRow, u = l.startColumn - n.startColumn, d = {
1048
1076
  startRow: s.startRow + h,
1049
- startColumn: s.startColumn + d,
1077
+ startColumn: s.startColumn + u,
1050
1078
  endRow: s.startRow + h + (l.endRow - l.startRow),
1051
- endColumn: s.startColumn + d + (l.endColumn - l.startColumn)
1052
- }, f = {
1053
- id: y.id,
1079
+ endColumn: s.startColumn + u + (l.endColumn - l.startColumn)
1080
+ }, m = {
1081
+ id: O.id,
1054
1082
  params: {
1055
1083
  unitId: e,
1056
1084
  subUnitId: t
1057
1085
  }
1058
- }, g = { id: R.id, params: { unitId: e, subUnitId: t, range: u } }, C = { id: R.id, params: { unitId: e, subUnitId: t, range: l } };
1059
- a.push(f, g), c.push(f, C);
1060
- const S = o.getAllFilterColumns(), F = s.startColumn - n.startColumn;
1061
- S.forEach((_) => {
1062
- const [m, v] = _;
1063
- v && (a.push({ id: p.id, params: { unitId: e, subUnitId: t, col: m + F, criteria: { ...v.serialize(), colId: m + F } } }), c.push({ id: p.id, params: { unitId: e, subUnitId: t, col: m, criteria: { ...v.serialize(), colId: m } } }));
1086
+ }, g = { id: R.id, params: { unitId: e, subUnitId: t, range: d } }, C = { id: R.id, params: { unitId: e, subUnitId: t, range: l } };
1087
+ a.push(m, g), c.push(m, C);
1088
+ const w = o.getAllFilterColumns(), F = s.startColumn - n.startColumn;
1089
+ w.forEach((_) => {
1090
+ const [f, v] = _;
1091
+ v && (a.push({ id: p.id, params: { unitId: e, subUnitId: t, col: f + F, criteria: { ...v.serialize(), colId: f + F } } }), c.push({ id: p.id, params: { unitId: e, subUnitId: t, col: f, criteria: { ...v.serialize(), colId: f } } }));
1064
1092
  });
1065
- } else if (K.intersects(s, l)) {
1093
+ } else if (X.intersects(s, l)) {
1066
1094
  const h = {
1067
1095
  ...l,
1068
1096
  endRow: Math.max(l.endRow, s.endRow)
@@ -1084,7 +1112,7 @@ let j = class extends B {
1084
1112
  const o = [], l = [];
1085
1113
  return n.getAllFilterColumns().forEach(([c, h]) => {
1086
1114
  l.push({ id: p.id, params: { unitId: e, subUnitId: t, col: c, criteria: { ...h.serialize(), colId: c } } });
1087
- }), o.push({ id: y.id, params: { unitId: e, subUnitId: t, range: s } }), l.unshift({ id: R.id, params: { range: s, unitId: e, subUnitId: t } }), {
1115
+ }), o.push({ id: O.id, params: { unitId: e, subUnitId: t, range: s } }), l.unshift({ id: R.id, params: { range: s, unitId: e, subUnitId: t } }), {
1088
1116
  undos: l,
1089
1117
  redos: o
1090
1118
  };
@@ -1097,9 +1125,9 @@ let j = class extends B {
1097
1125
  if (!s)
1098
1126
  return this._handleNull();
1099
1127
  const o = [], l = [], a = [], c = [];
1100
- return n.getAllFilterColumns().forEach(([d, u]) => {
1101
- o.push({ id: p.id, params: { unitId: r, subUnitId: t, col: d, criteria: { ...u.serialize(), colId: d } } }), a.push({ id: p.id, params: { unitId: r, subUnitId: t, col: d, criteria: null } });
1102
- }), a.push({ id: y.id, params: { unitId: r, subUnitId: t, range: s } }), o.unshift({ id: R.id, params: { range: s, unitId: r, subUnitId: t } }), {
1128
+ return n.getAllFilterColumns().forEach(([u, d]) => {
1129
+ o.push({ id: p.id, params: { unitId: r, subUnitId: t, col: u, criteria: { ...d.serialize(), colId: u } } }), a.push({ id: p.id, params: { unitId: r, subUnitId: t, col: u, criteria: null } });
1130
+ }), a.push({ id: O.id, params: { unitId: r, subUnitId: t, range: s } }), o.unshift({ id: R.id, params: { range: s, unitId: r, subUnitId: t } }), {
1103
1131
  undos: l,
1104
1132
  redos: o,
1105
1133
  preUndos: a,
@@ -1110,7 +1138,7 @@ let j = class extends B {
1110
1138
  return { redos: [], undos: [] };
1111
1139
  }
1112
1140
  _initRowFilteredInterceptor() {
1113
- this.disposeWithMe(this._sheetInterceptorService.intercept(qe.ROW_FILTERED, {
1141
+ this.disposeWithMe(this._sheetInterceptorService.intercept(Qe.ROW_FILTERED, {
1114
1142
  // sheet-interceptor.service.ts
1115
1143
  handler: (r, e) => {
1116
1144
  var t, n;
@@ -1129,35 +1157,35 @@ let j = class extends B {
1129
1157
  col: -1
1130
1158
  }, o = [], l = [], a = [], c = [];
1131
1159
  return t.forEach((h) => {
1132
- const [d, u] = h;
1160
+ const [u, d] = h;
1133
1161
  l.push({
1134
1162
  id: p.id,
1135
1163
  params: {
1136
1164
  ...s,
1137
- col: d
1165
+ col: u
1138
1166
  }
1139
1167
  }), o.push({
1140
1168
  id: p.id,
1141
1169
  params: {
1142
1170
  ...s,
1143
- col: d,
1144
- criteria: { ...u.serialize(), colId: d }
1171
+ col: u,
1172
+ criteria: { ...d.serialize(), colId: u }
1145
1173
  }
1146
1174
  });
1147
1175
  }), t.forEach((h) => {
1148
- const [d, u] = h;
1176
+ const [u, d] = h;
1149
1177
  c.push({
1150
1178
  id: p.id,
1151
1179
  params: {
1152
1180
  ...s,
1153
- col: d + n,
1154
- criteria: { ...u.serialize(), colId: d + n }
1181
+ col: u + n,
1182
+ criteria: { ...d.serialize(), colId: u + n }
1155
1183
  }
1156
1184
  }), a.push({
1157
1185
  id: p.id,
1158
1186
  params: {
1159
1187
  ...s,
1160
- col: d + n,
1188
+ col: u + n,
1161
1189
  criteria: null
1162
1190
  }
1163
1191
  });
@@ -1177,40 +1205,40 @@ let j = class extends B {
1177
1205
  var c, h;
1178
1206
  const { unitId: t, subUnitId: n } = r.params || {}, s = this._sheetsFilterService.getFilterModel(t, n);
1179
1207
  if (!s) return;
1180
- const o = Array.from(s.filteredOutRows).sort((d, u) => d - u), l = [];
1208
+ const o = Array.from(s.filteredOutRows).sort((u, d) => u - d), l = [];
1181
1209
  let a = !1;
1182
- if (r.id === Qe.id) {
1183
- const { startRow: d, endRow: u } = r.params.range, f = o.filter((g) => g >= d && g <= u);
1210
+ if (r.id === Je.id) {
1211
+ const { startRow: u, endRow: d } = r.params.range, m = o.filter((g) => g >= u && g <= d);
1184
1212
  o.forEach((g) => {
1185
- if (g < d)
1213
+ if (g < u)
1186
1214
  l.push(g);
1187
- else if (a = !0, g <= u) {
1188
- const C = Math.max(d, l.length ? l[l.length - 1] + 1 : d);
1215
+ else if (a = !0, g <= d) {
1216
+ const C = Math.max(u, l.length ? l[l.length - 1] + 1 : u);
1189
1217
  l.push(C);
1190
1218
  } else
1191
- l.push(g - (u - d + 1 - f.length));
1219
+ l.push(g - (d - u + 1 - m.length));
1192
1220
  });
1193
1221
  }
1194
- if (r.id === Ge.id) {
1195
- const { startRow: d, endRow: u } = r.params.range;
1196
- o.forEach((f) => {
1197
- f >= d ? (a = !0, l.push(f + (u - d + 1))) : l.push(f);
1222
+ if (r.id === Ke.id) {
1223
+ const { startRow: u, endRow: d } = r.params.range;
1224
+ o.forEach((m) => {
1225
+ m >= u ? (a = !0, l.push(m + (d - u + 1))) : l.push(m);
1198
1226
  });
1199
1227
  }
1200
- if (a && (s.filteredOutRows = new Set(l)), r.id === Je.id && !(e != null && e.onlyLocal)) {
1201
- const d = this._getExtendRegion(t, n);
1202
- if (d) {
1203
- const u = r.params.cellValue;
1204
- if (u)
1205
- for (let f = d.startColumn; f <= d.endColumn; f++) {
1206
- const g = (c = u == null ? void 0 : u[d.startRow]) == null ? void 0 : c[f];
1228
+ if (a && (s.filteredOutRows = new Set(l)), r.id === Ye.id && !(e != null && e.onlyLocal)) {
1229
+ const u = this._getExtendRegion(t, n);
1230
+ if (u) {
1231
+ const d = r.params.cellValue;
1232
+ if (d)
1233
+ for (let m = u.startColumn; m <= u.endColumn; m++) {
1234
+ const g = (c = d == null ? void 0 : d[u.startRow]) == null ? void 0 : c[m];
1207
1235
  if (g && this._cellHasValue(g)) {
1208
1236
  const C = (h = this._univerInstanceService.getUnit(t)) == null ? void 0 : h.getSheetBySheetId(n);
1209
1237
  if (C) {
1210
- const S = de(d, { down: !0 }, C), F = this._sheetsFilterService.getFilterModel(t, n), _ = F.getRange();
1238
+ const w = he(u, { down: !0 }, C), F = this._sheetsFilterService.getFilterModel(t, n), _ = F.getRange();
1211
1239
  F.setRange({
1212
1240
  ..._,
1213
- endRow: S.endRow
1241
+ endRow: w.endRow
1214
1242
  }), this._registerRefRange(t, n);
1215
1243
  }
1216
1244
  }
@@ -1243,12 +1271,12 @@ let j = class extends B {
1243
1271
  }
1244
1272
  _initErrorHandling() {
1245
1273
  this.disposeWithMe(this._commandService.beforeCommandExecuted((r) => {
1246
- const e = r.params, t = b(this._univerInstanceService);
1274
+ const e = r.params, t = H(this._univerInstanceService);
1247
1275
  if (!t) return;
1248
1276
  const { subUnitId: n, unitId: s } = t, o = this._sheetsFilterService.getFilterModel(s, n);
1249
1277
  if (!o) return;
1250
1278
  const l = o.getRange();
1251
- if (r.id === Ye.id && e.fromRange.startRow <= l.startRow && e.fromRange.endRow < l.endRow && e.fromRange.endRow >= l.startRow)
1279
+ if (r.id === Xe.id && e.fromRange.startRow <= l.startRow && e.fromRange.endRow < l.endRow && e.fromRange.endRow >= l.startRow)
1252
1280
  throw this._sheetsFilterService.setFilterErrorMsg("sheets-filter.msg.filter-header-forbidden"), new Error("[SheetsFilterController]: Cannot move header row of filter");
1253
1281
  }));
1254
1282
  }
@@ -1257,25 +1285,25 @@ let j = class extends B {
1257
1285
  return !(e.length === 0 || e.every((t) => t == null));
1258
1286
  }
1259
1287
  };
1260
- j = Lt([
1261
- P(0, N),
1262
- P(1, I(ze)),
1263
- P(2, I(M)),
1264
- P(3, T),
1265
- P(4, I(We)),
1266
- P(5, Ie(ot))
1267
- ], j);
1268
- var Bt = Object.getOwnPropertyDescriptor, bt = (i, r, e, t) => {
1269
- for (var n = t > 1 ? void 0 : t ? Bt(r, e) : r, s = i.length - 1, o; s >= 0; s--)
1288
+ k = zt([
1289
+ L(0, N),
1290
+ L(1, $(We)),
1291
+ L(2, $(M)),
1292
+ L(3, T),
1293
+ L(4, $(je)),
1294
+ L(5, Ue(ct))
1295
+ ], k);
1296
+ var Vt = Object.getOwnPropertyDescriptor, Wt = (i, r, e, t) => {
1297
+ for (var n = t > 1 ? void 0 : t ? Vt(r, e) : r, s = i.length - 1, o; s >= 0; s--)
1270
1298
  (o = i[s]) && (n = o(n) || n);
1271
1299
  return n;
1272
- }, H = (i, r) => (e, t) => r(e, t, i);
1273
- let k = class extends B {
1300
+ }, z = (i, r) => (e, t) => r(e, t, i);
1301
+ let q = class extends B {
1274
1302
  constructor(i, r, e, t) {
1275
1303
  super(), this._activeDirtyManagerService = i, this._sheetRowFilteredService = r, this._sheetsFilterService = e, this._univerInstanceService = t, this._initFormulaDirtyRange(), this._registerSheetRowFiltered();
1276
1304
  }
1277
1305
  _initFormulaDirtyRange() {
1278
- ge.forEach((i) => {
1306
+ Re.forEach((i) => {
1279
1307
  this._activeDirtyManagerService.register(
1280
1308
  i,
1281
1309
  {
@@ -1319,68 +1347,69 @@ let k = class extends B {
1319
1347
  });
1320
1348
  }
1321
1349
  };
1322
- k = bt([
1323
- H(0, I(lt)),
1324
- H(1, I(at)),
1325
- H(2, I(M)),
1326
- H(3, T)
1327
- ], k);
1328
- var Ht = Object.getOwnPropertyDescriptor, zt = (i, r, e, t) => {
1329
- for (var n = t > 1 ? void 0 : t ? Ht(r, e) : r, s = i.length - 1, o; s >= 0; s--)
1350
+ q = Wt([
1351
+ z(0, $(ut)),
1352
+ z(1, $(dt)),
1353
+ z(2, $(M)),
1354
+ z(3, T)
1355
+ ], q);
1356
+ var jt = Object.getOwnPropertyDescriptor, kt = (i, r, e, t) => {
1357
+ for (var n = t > 1 ? void 0 : t ? jt(r, e) : r, s = i.length - 1, o; s >= 0; s--)
1330
1358
  (o = i[s]) && (n = o(n) || n);
1331
1359
  return n;
1332
- }, ae = (i, r) => (e, t) => r(e, t, i), z;
1333
- let ce = (z = class extends Pe {
1334
- constructor(i = le, r, e) {
1360
+ }, ue = (i, r) => (e, t) => r(e, t, i), V;
1361
+ let de = (V = class extends Pe {
1362
+ constructor(i = ce, r, e) {
1335
1363
  super(), this._config = i, this._injector = r, this._configService = e;
1336
- const { ...t } = Ue(
1364
+ const { ...t } = be(
1337
1365
  {},
1338
- le,
1366
+ ce,
1339
1367
  this._config
1340
1368
  );
1341
- this._configService.setConfig(Pt, t);
1369
+ this._configService.setConfig(Dt, t);
1342
1370
  }
1343
1371
  onStarting() {
1344
1372
  [
1345
- [k],
1373
+ [q],
1346
1374
  [M],
1347
- [j]
1375
+ [k]
1348
1376
  ].forEach((i) => this._injector.add(i));
1349
1377
  }
1350
1378
  onReady() {
1351
1379
  De(this._injector, [
1352
- [k],
1353
- [j]
1380
+ [q],
1381
+ [k]
1354
1382
  ]);
1355
1383
  }
1356
- }, w(z, "type", D.UNIVER_SHEET), w(z, "pluginName", Fe), z);
1357
- ce = zt([
1358
- ae(1, I(Le)),
1359
- ae(2, Be)
1360
- ], ce);
1384
+ }, S(V, "type", b.UNIVER_SHEET), S(V, "pluginName", we), V);
1385
+ de = kt([
1386
+ ue(1, $(Be)),
1387
+ ue(2, He)
1388
+ ], de);
1361
1389
  export {
1362
- Yt as ClearSheetsFilterCriteriaCommand,
1390
+ tr as ClearSheetsFilterCriteriaCommand,
1363
1391
  x as CustomFilterOperator,
1364
- ge as FILTER_MUTATIONS,
1365
- Ct as FilterColumn,
1366
- V as FilterModel,
1367
- Kt as ReCalcSheetsFilterCommand,
1392
+ Re as FILTER_MUTATIONS,
1393
+ I as FilterBy,
1394
+ St as FilterColumn,
1395
+ j as FilterModel,
1396
+ rr as ReCalcSheetsFilterCommand,
1368
1397
  W as ReCalcSheetsFilterMutation,
1369
- Nt as RemoveSheetFilterCommand,
1370
- y as RemoveSheetsFilterMutation,
1371
- Fe as SHEET_FILTER_SNAPSHOT_ID,
1372
- Tt as SetSheetFilterRangeCommand,
1373
- Jt as SetSheetsFilterCriteriaCommand,
1398
+ Ut as RemoveSheetFilterCommand,
1399
+ O as RemoveSheetsFilterMutation,
1400
+ we as SHEET_FILTER_SNAPSHOT_ID,
1401
+ $t as SetSheetFilterRangeCommand,
1402
+ er as SetSheetsFilterCriteriaCommand,
1374
1403
  p as SetSheetsFilterCriteriaMutation,
1375
1404
  R as SetSheetsFilterRangeMutation,
1376
1405
  M as SheetsFilterService,
1377
- Gt as SmartToggleSheetsFilterCommand,
1378
- ce as UniverSheetsFilterPlugin,
1379
- mt as equals,
1380
- ie as getCustomFilterFn,
1381
- ct as greaterThan,
1382
- dt as greaterThanOrEqualTo,
1383
- ut as lessThan,
1384
- ht as lessThanOrEqualTo,
1385
- _e as notEquals
1406
+ Zt as SmartToggleSheetsFilterCommand,
1407
+ de as UniverSheetsFilterPlugin,
1408
+ _t as equals,
1409
+ oe as getCustomFilterFn,
1410
+ ht as greaterThan,
1411
+ ft as greaterThanOrEqualTo,
1412
+ mt as lessThan,
1413
+ gt as lessThanOrEqualTo,
1414
+ Ce as notEquals
1386
1415
  };