@univerjs/sheets-data-validation 0.12.2 → 0.12.3-experimental.20251205-e439e48

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,34 +1,34 @@
1
- var St = Object.defineProperty;
2
- var Et = (o, a, e) => a in o ? St(o, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[a] = e;
3
- var m = (o, a, e) => Et(o, typeof a != "symbol" ? a + "" : a, e);
4
- import { Inject as v, ICommandService as U, IUniverInstanceService as O, Disposable as W, ObjectMatrix as Se, getIntersectRange as ot, UniverInstanceType as N, Range as L, Rectangle as I, isFormulaString as S, DataValidationType as T, getOriginCellValue as Vt, RBush as Mt, debounce as yt, Tools as E, DataValidationStatus as b, WrapStrategy as ve, DataValidationOperator as h, numfmt as P, dayjs as st, DataValidationRenderMode as Pe, CommandType as z, IUndoRedoService as Z, sequenceExecute as Ae, isRangesEqual as nt, IPermissionService as Tt, generateRandomId as Ye, toDisposable as Xe, Injector as Ke, CellValueType as Ft, RxDisposable as Nt, LifecycleService as Ct, LifecycleStages as et, bufferDebounceTime as Ot, DependentOn as wt, IConfigService as It, Plugin as At, merge as Dt } from "@univerjs/core";
5
- import { DataValidationModel as De, DataValidatorRegistryService as q, UpdateRuleType as M, BaseDataValidator as G, TextLengthErrorTitleMap as bt, AddDataValidationMutation as D, RemoveDataValidationMutation as A, UpdateDataValidationMutation as y, getRuleSetting as Lt, getRuleOptions as Ut, UniverDataValidationPlugin as Bt } from "@univerjs/data-validation";
6
- import { ERROR_TYPE_SET as xt, LexerTreeBuilder as Y, isReferenceString as lt, sequenceNodeType as Pt, deserializeRangeWithSheet as Ht, deserializeRangeWithSheetWithCache as Wt, operatorToken as $t } from "@univerjs/engine-formula";
7
- import { SetRangeValuesMutation as se, RemoveSheetMutation as ut, getSheetCommandTarget as ze, SetRangeValuesUndoMutationFactory as dt, WorksheetViewPermission as kt, RefRangeService as jt, handleCommonDefaultRangeChangeWithEffectRefCommands as Qt, SheetInterceptorService as ct, RemoveSheetCommand as qt, CopySheetCommand as Gt, SheetsSelectionsService as ht, ClearSelectionAllCommand as Yt } from "@univerjs/sheets";
8
- import { Subject as Ge, bufferWhen as Xt, filter as tt } from "rxjs";
9
- import { RegisterOtherFormulaService as mt, FormulaRefRangeService as gt } from "@univerjs/sheets-formula";
10
- var Kt = Object.getOwnPropertyDescriptor, zt = (o, a, e, t) => {
11
- for (var r = t > 1 ? void 0 : t ? Kt(a, e) : a, i = o.length - 1, s; i >= 0; i--)
12
- (s = o[i]) && (r = s(r) || r);
1
+ var Et = Object.defineProperty;
2
+ var Mt = (s, a, e) => a in s ? Et(s, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[a] = e;
3
+ var m = (s, a, e) => Mt(s, typeof a != "symbol" ? a + "" : a, e);
4
+ import { Inject as v, ICommandService as B, IUniverInstanceService as I, Disposable as x, ObjectMatrix as Me, getIntersectRange as ot, UniverInstanceType as N, Range as U, Rectangle as w, isFormulaString as S, getOriginCellValue as Vt, Injector as be, numfmt as L, DataValidationType as T, RBush as yt, debounce as Tt, Tools as M, DataValidationStatus as b, WrapStrategy as Se, DataValidationOperator as h, dayjs as nt, DataValidationRenderMode as We, CommandType as z, IUndoRedoService as Z, sequenceExecute as Le, isRangesEqual as lt, IPermissionService as Ft, generateRandomId as Xe, toDisposable as Ke, CellValueType as Ct, RxDisposable as Nt, LifecycleService as Ot, LifecycleStages as et, bufferDebounceTime as wt, DependentOn as At, IConfigService as It, Plugin as Dt, merge as bt } from "@univerjs/core";
5
+ import { DataValidationModel as ce, DataValidatorRegistryService as G, UpdateRuleType as V, BaseDataValidator as Y, TextLengthErrorTitleMap as Lt, AddDataValidationMutation as D, RemoveDataValidationMutation as A, UpdateDataValidationMutation as y, getRuleSetting as Ut, getRuleOptions as Bt, UniverDataValidationPlugin as xt } from "@univerjs/data-validation";
6
+ import { ERROR_TYPE_SET as Pt, LexerTreeBuilder as X, isReferenceString as ut, sequenceNodeType as Ht, deserializeRangeWithSheet as Wt, deserializeRangeWithSheetWithCache as $t, operatorToken as kt } from "@univerjs/engine-formula";
7
+ import { SetRangeValuesMutation as ne, RemoveSheetMutation as dt, getSheetCommandTarget as ze, SetRangeValuesUndoMutationFactory as ct, WorksheetViewPermission as jt, RefRangeService as Qt, handleCommonDefaultRangeChangeWithEffectRefCommands as qt, SheetInterceptorService as ht, RemoveSheetCommand as Gt, CopySheetCommand as Yt, SheetsSelectionsService as mt, ClearSelectionAllCommand as Xt } from "@univerjs/sheets";
8
+ import { Subject as Ye, bufferWhen as Kt, filter as tt } from "rxjs";
9
+ import { RegisterOtherFormulaService as gt, FormulaRefRangeService as pt } from "@univerjs/sheets-formula";
10
+ var zt = Object.getOwnPropertyDescriptor, Zt = (s, a, e, t) => {
11
+ for (var r = t > 1 ? void 0 : t ? zt(a, e) : a, i = s.length - 1, o; i >= 0; i--)
12
+ (o = s[i]) && (r = o(r) || r);
13
13
  return r;
14
- }, He = (o, a) => (e, t) => a(e, t, o);
15
- let Q = class extends W {
14
+ }, $e = (s, a) => (e, t) => a(e, t, s);
15
+ let Q = class extends x {
16
16
  constructor(a, e, t) {
17
17
  super();
18
18
  m(this, "_cacheMatrix", /* @__PURE__ */ new Map());
19
- m(this, "_dirtyRanges$", new Ge());
19
+ m(this, "_dirtyRanges$", new Ye());
20
20
  m(this, "dirtyRanges$", this._dirtyRanges$.asObservable());
21
21
  this._commandService = a, this._univerInstanceService = e, this._sheetDataValidationModel = t, this._initDirtyRanges(), this._initSheetRemove();
22
22
  }
23
23
  _initDirtyRanges() {
24
- this.disposeWithMe(this._commandService.onCommandExecuted((a) => {
25
- if (a.id === se.id) {
26
- const { cellValue: e, unitId: t, subUnitId: r } = a.params;
27
- if (e) {
28
- const i = new Se(e).getDataRange();
29
- if (i.endRow === -1) return;
30
- const l = this._sheetDataValidationModel.getRules(t, r).map((u) => u.ranges).flat().map((u) => ot(u, i)).filter(Boolean);
31
- l.length && this.markRangeDirty(t, r, l, !0);
24
+ this.disposeWithMe(this._commandService.onCommandExecuted((a, e) => {
25
+ if (a.id === ne.id && !(e != null && e.onlyLocal)) {
26
+ const { cellValue: t, unitId: r, subUnitId: i } = a.params;
27
+ if (t) {
28
+ const o = new Me(t).getDataRange();
29
+ if (o.endRow === -1) return;
30
+ const u = this._sheetDataValidationModel.getRules(r, i).map((d) => d.ranges).flat().map((d) => ot(d, o)).filter(Boolean);
31
+ u.length && this.markRangeDirty(r, i, u, !0);
32
32
  }
33
33
  }
34
34
  }));
@@ -36,7 +36,7 @@ let Q = class extends W {
36
36
  _initSheetRemove() {
37
37
  this.disposeWithMe(this._commandService.onCommandExecuted((a) => {
38
38
  var e;
39
- if (a.id === ut.id) {
39
+ if (a.id === dt.id) {
40
40
  const { unitId: t, subUnitId: r } = a.params;
41
41
  (e = this._cacheMatrix.get(t)) == null || e.delete(r);
42
42
  }
@@ -48,7 +48,7 @@ let Q = class extends W {
48
48
  let t = this._cacheMatrix.get(a);
49
49
  t || (t = /* @__PURE__ */ new Map(), this._cacheMatrix.set(a, t));
50
50
  let r = t.get(e);
51
- return r || (r = new Se(), t.set(e, r)), r;
51
+ return r || (r = new Me(), t.set(e, r)), r;
52
52
  }
53
53
  ensureCache(a, e) {
54
54
  return this._ensureCache(a, e);
@@ -61,8 +61,8 @@ let Q = class extends W {
61
61
  }
62
62
  markRangeDirty(a, e, t, r) {
63
63
  const i = this._ensureCache(a, e);
64
- t.forEach((s) => {
65
- L.foreach(s, (n, l) => {
64
+ t.forEach((o) => {
65
+ U.foreach(o, (n, l) => {
66
66
  i.getValue(n, l) !== void 0 && i.setValue(n, l, void 0);
67
67
  });
68
68
  }), this._dirtyRanges$.next({ unitId: a, subUnitId: e, ranges: t, isSetRange: r });
@@ -70,8 +70,8 @@ let Q = class extends W {
70
70
  _deleteRange(a, e, t) {
71
71
  const r = this._ensureCache(a, e);
72
72
  t.forEach((i) => {
73
- L.foreach(i, (s, n) => {
74
- r.realDeleteValue(s, n);
73
+ U.foreach(i, (o, n) => {
74
+ r.realDeleteValue(o, n);
75
75
  });
76
76
  }), this._dirtyRanges$.next({ unitId: a, subUnitId: e, ranges: t });
77
77
  }
@@ -79,33 +79,33 @@ let Q = class extends W {
79
79
  return this._ensureCache(a, e).getValue(t, r);
80
80
  }
81
81
  };
82
- Q = zt([
83
- He(0, v(U)),
84
- He(1, v(O)),
85
- He(2, v(De))
82
+ Q = Zt([
83
+ $e(0, v(B)),
84
+ $e(1, v(I)),
85
+ $e(2, v(ce))
86
86
  ], Q);
87
- function oe(o) {
87
+ function oe(s) {
88
88
  var a, e;
89
- return (e = (a = o == null ? void 0 : o[0]) == null ? void 0 : a[0]) == null ? void 0 : e.v;
89
+ return (e = (a = s == null ? void 0 : s[0]) == null ? void 0 : a[0]) == null ? void 0 : e.v;
90
90
  }
91
- function pe(o) {
91
+ function _e(s) {
92
92
  var a;
93
- return (a = o == null ? void 0 : o[0]) == null ? void 0 : a[0];
93
+ return (a = s == null ? void 0 : s[0]) == null ? void 0 : a[0];
94
94
  }
95
- function C(o) {
96
- return !xt.has(o);
95
+ function F(s) {
96
+ return !Pt.has(s);
97
97
  }
98
- function de(o, a) {
98
+ function he(s, a) {
99
99
  var t;
100
- const e = a.getValidatorItem(o);
100
+ const e = a.getValidatorItem(s);
101
101
  return (t = e == null ? void 0 : e.offsetFormulaByRange) != null ? t : !1;
102
102
  }
103
- var Zt = Object.getOwnPropertyDescriptor, Jt = (o, a, e, t) => {
104
- for (var r = t > 1 ? void 0 : t ? Zt(a, e) : a, i = o.length - 1, s; i >= 0; i--)
105
- (s = o[i]) && (r = s(r) || r);
103
+ var Jt = Object.getOwnPropertyDescriptor, ea = (s, a, e, t) => {
104
+ for (var r = t > 1 ? void 0 : t ? Jt(a, e) : a, i = s.length - 1, o; i >= 0; i--)
105
+ (o = s[i]) && (r = o(r) || r);
106
106
  return r;
107
- }, re = (o, a) => (e, t) => a(e, t, o);
108
- let H = class extends W {
107
+ }, se = (s, a) => (e, t) => a(e, t, s);
108
+ let W = class extends x {
109
109
  constructor(a, e, t, r, i) {
110
110
  super();
111
111
  /**
@@ -124,8 +124,8 @@ let H = class extends W {
124
124
  const t = a[e];
125
125
  if (this._instanceSrv.getUnitType(e) === N.UNIVER_SHEET)
126
126
  for (const i in t) {
127
- const s = t[i], { ruleFormulaMap: n } = this._ensureMaps(e, i);
128
- s.forEach((l) => {
127
+ const o = t[i], { ruleFormulaMap: n } = this._ensureMaps(e, i);
128
+ o.forEach((l) => {
129
129
  var c, g;
130
130
  const u = n.get((c = l.extra) == null ? void 0 : c.ruleId), d = this._dataValidationModel.getRuleById(e, i, (g = l.extra) == null ? void 0 : g.ruleId);
131
131
  d && u && this._dataValidationCacheService.markRangeDirty(e, i, d.ranges);
@@ -139,16 +139,16 @@ let H = class extends W {
139
139
  t || (t = /* @__PURE__ */ new Map(), this._ruleFormulaMap.set(a, t)), r || (r = /* @__PURE__ */ new Map(), this._ruleFormulaMap2.set(a, r));
140
140
  let i = t.get(e);
141
141
  i || (i = /* @__PURE__ */ new Map(), t.set(e, i));
142
- let s = r.get(e);
143
- return s || (s = /* @__PURE__ */ new Map(), r.set(e, s)), { ruleFormulaMap: i, ruleFormulaMap2: s };
142
+ let o = r.get(e);
143
+ return o || (o = /* @__PURE__ */ new Map(), r.set(e, o)), { ruleFormulaMap: i, ruleFormulaMap2: o };
144
144
  }
145
145
  _registerFormula(a, e, t, r, i) {
146
146
  return this._registerOtherFormulaService.registerFormulaWithRange(a, e, r, i, { ruleId: t });
147
147
  }
148
148
  _handleDirtyRanges(a, e, t) {
149
149
  this._dataValidationModel.getRules(a, e).forEach((i) => {
150
- const s = i.ranges;
151
- I.doAnyRangesIntersect(s, t) && this.makeRuleDirty(a, e, i.uid);
150
+ const o = i.ranges;
151
+ w.doAnyRangesIntersect(o, t) && this.makeRuleDirty(a, e, i.uid);
152
152
  });
153
153
  }
154
154
  _initDirtyRanges() {
@@ -157,18 +157,18 @@ let H = class extends W {
157
157
  }));
158
158
  }
159
159
  deleteByRuleId(a, e, t) {
160
- const { ruleFormulaMap: r, ruleFormulaMap2: i } = this._ensureMaps(a, e), s = this._dataValidationModel.getRuleById(a, e, t), n = r.get(t);
161
- if (!s || !n)
160
+ const { ruleFormulaMap: r, ruleFormulaMap2: i } = this._ensureMaps(a, e), o = this._dataValidationModel.getRuleById(a, e, t), n = r.get(t);
161
+ if (!o || !n)
162
162
  return;
163
163
  const l = r.get(t);
164
164
  l && (r.delete(t), this._registerOtherFormulaService.deleteFormula(a, e, [l.formulaId]));
165
165
  const u = i.get(t);
166
166
  u && (i.delete(t), this._registerOtherFormulaService.deleteFormula(a, e, [u.formulaId]));
167
167
  }
168
- _addFormulaByRange(a, e, t, r, i, s) {
169
- const { ruleFormulaMap: n, ruleFormulaMap2: l } = this._ensureMaps(a, e), u = s[0].startRow, d = s[0].startColumn;
168
+ _addFormulaByRange(a, e, t, r, i, o) {
169
+ const { ruleFormulaMap: n, ruleFormulaMap2: l } = this._ensureMaps(a, e), u = o[0].startRow, d = o[0].startColumn;
170
170
  if (r && S(r)) {
171
- const c = this._registerFormula(a, e, t, r, s);
171
+ const c = this._registerFormula(a, e, t, r, o);
172
172
  n.set(t, {
173
173
  formula: r,
174
174
  originCol: d,
@@ -177,7 +177,7 @@ let H = class extends W {
177
177
  });
178
178
  }
179
179
  if (i && S(i)) {
180
- const c = this._registerFormula(a, e, t, i, s);
180
+ const c = this._registerFormula(a, e, t, i, o);
181
181
  l.set(t, {
182
182
  formula: i,
183
183
  originCol: d,
@@ -187,70 +187,197 @@ let H = class extends W {
187
187
  }
188
188
  }
189
189
  addRule(a, e, t) {
190
- if (de(t.type, this._validatorRegistryService)) {
191
- const { ranges: r, formula1: i, formula2: s, uid: n } = t;
192
- this._addFormulaByRange(a, e, n, i, s, r);
190
+ if (he(t.type, this._validatorRegistryService)) {
191
+ const { ranges: r, formula1: i, formula2: o, uid: n } = t;
192
+ this._addFormulaByRange(a, e, n, i, o, r);
193
193
  }
194
194
  }
195
195
  async getCellFormulaValue(a, e, t, r, i) {
196
- var f, p;
197
- const { ruleFormulaMap: s } = this._ensureMaps(a, e), n = s.get(t);
196
+ var _, f;
197
+ const { ruleFormulaMap: o } = this._ensureMaps(a, e), n = o.get(t);
198
198
  if (!n)
199
199
  return Promise.resolve(void 0);
200
200
  const l = await this._registerOtherFormulaService.getFormulaValue(a, e, n.formulaId), { originRow: u, originCol: d } = n, c = r - u, g = i - d;
201
- return pe((p = (f = l == null ? void 0 : l.result) == null ? void 0 : f[c]) == null ? void 0 : p[g]);
201
+ return _e((f = (_ = l == null ? void 0 : l.result) == null ? void 0 : _[c]) == null ? void 0 : f[g]);
202
202
  }
203
203
  async getCellFormula2Value(a, e, t, r, i) {
204
- var f, p;
205
- const { ruleFormulaMap2: s } = this._ensureMaps(a, e), n = s.get(t);
204
+ var _, f;
205
+ const { ruleFormulaMap2: o } = this._ensureMaps(a, e), n = o.get(t);
206
206
  if (!n)
207
207
  return Promise.resolve(void 0);
208
208
  const l = await this._registerOtherFormulaService.getFormulaValue(a, e, n.formulaId), { originRow: u, originCol: d } = n, c = r - u, g = i - d;
209
- return pe((p = (f = l == null ? void 0 : l.result) == null ? void 0 : f[c]) == null ? void 0 : p[g]);
209
+ return _e((f = (_ = l == null ? void 0 : l.result) == null ? void 0 : _[c]) == null ? void 0 : f[g]);
210
210
  }
211
211
  getCellFormulaValueSync(a, e, t, r, i) {
212
- var f, p;
213
- const { ruleFormulaMap: s } = this._ensureMaps(a, e), n = s.get(t);
212
+ var _, f;
213
+ const { ruleFormulaMap: o } = this._ensureMaps(a, e), n = o.get(t);
214
214
  if (!n)
215
215
  return;
216
216
  const l = this._registerOtherFormulaService.getFormulaValueSync(a, e, n.formulaId), { originRow: u, originCol: d } = n, c = r - u, g = i - d;
217
- return pe((p = (f = l == null ? void 0 : l.result) == null ? void 0 : f[c]) == null ? void 0 : p[g]);
217
+ return _e((f = (_ = l == null ? void 0 : l.result) == null ? void 0 : _[c]) == null ? void 0 : f[g]);
218
218
  }
219
219
  getCellFormula2ValueSync(a, e, t, r, i) {
220
- var f, p;
221
- const { ruleFormulaMap2: s } = this._ensureMaps(a, e), n = s.get(t);
220
+ var _, f;
221
+ const { ruleFormulaMap2: o } = this._ensureMaps(a, e), n = o.get(t);
222
222
  if (!n)
223
223
  return;
224
224
  const l = this._registerOtherFormulaService.getFormulaValueSync(a, e, n.formulaId), { originRow: u, originCol: d } = n, c = r - u, g = i - d;
225
- return pe((p = (f = l == null ? void 0 : l.result) == null ? void 0 : f[c]) == null ? void 0 : p[g]);
225
+ return _e((f = (_ = l == null ? void 0 : l.result) == null ? void 0 : _[c]) == null ? void 0 : f[g]);
226
226
  }
227
227
  getRuleFormulaInfo(a, e, t) {
228
228
  const { ruleFormulaMap: r } = this._ensureMaps(a, e);
229
229
  return r.get(t);
230
230
  }
231
231
  makeRuleDirty(a, e, t) {
232
- var s, n, l, u;
233
- const r = (n = (s = this._ruleFormulaMap.get(a)) == null ? void 0 : s.get(e)) == null ? void 0 : n.get(t), i = (u = (l = this._ruleFormulaMap2.get(a)) == null ? void 0 : l.get(e)) == null ? void 0 : u.get(t);
232
+ var o, n, l, u;
233
+ const r = (n = (o = this._ruleFormulaMap.get(a)) == null ? void 0 : o.get(e)) == null ? void 0 : n.get(t), i = (u = (l = this._ruleFormulaMap2.get(a)) == null ? void 0 : l.get(e)) == null ? void 0 : u.get(t);
234
234
  r && this._registerOtherFormulaService.markFormulaDirty(a, e, r.formulaId), i && this._registerOtherFormulaService.markFormulaDirty(a, e, i.formulaId);
235
235
  }
236
236
  };
237
- H = Jt([
238
- re(0, O),
239
- re(1, v(mt)),
240
- re(2, v(De)),
241
- re(3, v(Q)),
242
- re(4, v(q))
243
- ], H);
244
- var ea = Object.getOwnPropertyDescriptor, ta = (o, a, e, t) => {
245
- for (var r = t > 1 ? void 0 : t ? ea(a, e) : a, i = o.length - 1, s; i >= 0; i--)
246
- (s = o[i]) && (r = s(r) || r);
237
+ W = ea([
238
+ se(0, I),
239
+ se(1, v(gt)),
240
+ se(2, v(ce)),
241
+ se(3, v(Q)),
242
+ se(4, v(G))
243
+ ], W);
244
+ function re(s) {
245
+ return Vt(s);
246
+ }
247
+ function ft(s) {
248
+ var a;
249
+ return String((a = re(s)) != null ? a : "");
250
+ }
251
+ function er(s) {
252
+ return s.filter(Boolean).join(",");
253
+ }
254
+ function Ee(s) {
255
+ return s.split(",").filter(Boolean);
256
+ }
257
+ function tr(s) {
258
+ const a = re(s);
259
+ return a == null ? "" : a.toString();
260
+ }
261
+ function Ue(s, a, e) {
262
+ const { formula1: t, formula2: r } = a, i = a.ranges[0].startRow, o = a.ranges[0].startColumn, n = e.row - i, l = e.col - o, u = S(t) ? s.moveFormulaRefOffset(t, l, n, !0) : t, d = S(r) ? s.moveFormulaRefOffset(r, l, n, !0) : r;
263
+ return {
264
+ transformedFormula1: u,
265
+ transformedFormula2: d
266
+ };
267
+ }
268
+ var ta = Object.getOwnPropertyDescriptor, aa = (s, a, e, t) => {
269
+ for (var r = t > 1 ? void 0 : t ? ta(a, e) : a, i = s.length - 1, o; i >= 0; i--)
270
+ (o = s[i]) && (r = o(r) || r);
247
271
  return r;
248
- }, ie = (o, a) => (e, t) => a(e, t, o);
249
- let K = class extends W {
250
- constructor(a, e, t, r, i) {
272
+ }, at = (s, a) => (e, t) => a(e, t, s);
273
+ let le = class extends x {
274
+ constructor(a, e) {
275
+ super();
276
+ // Cache structure: unitId -> subUnitId -> ruleId -> cache item
277
+ m(this, "_cache", /* @__PURE__ */ new Map());
278
+ this._injector = a, this._dataValidationModel = e, this._initRuleChangeListener();
279
+ }
280
+ _initRuleChangeListener() {
281
+ this.disposeWithMe(
282
+ this._dataValidationModel.ruleChange$.subscribe((a) => {
283
+ (a.type === "remove" || a.type === "update") && this.markRuleDirty(a.unitId, a.subUnitId, a.rule.uid);
284
+ })
285
+ );
286
+ }
287
+ /**
288
+ * Get cached list data or compute and cache it if not exists.
289
+ */
290
+ getOrCompute(a, e, t) {
291
+ const r = this.getCache(a, e, t.uid);
292
+ if (r)
293
+ return r;
294
+ const o = this._injector.get(q).getRuleFormulaResultSync(a, e, t.uid);
295
+ return this.computeAndCache(a, e, t, o);
296
+ }
297
+ _ensureCache(a, e) {
298
+ let t = this._cache.get(a);
299
+ t || (t = /* @__PURE__ */ new Map(), this._cache.set(a, t));
300
+ let r = t.get(e);
301
+ return r || (r = /* @__PURE__ */ new Map(), t.set(e, r)), r;
302
+ }
303
+ /**
304
+ * Get cached list data for a rule. Returns undefined if not cached.
305
+ */
306
+ getCache(a, e, t) {
307
+ var r, i;
308
+ return (i = (r = this._cache.get(a)) == null ? void 0 : r.get(e)) == null ? void 0 : i.get(t);
309
+ }
310
+ /**
311
+ * Set cache for a rule.
312
+ */
313
+ setCache(a, e, t, r) {
314
+ this._ensureCache(a, e).set(t, r);
315
+ }
316
+ /**
317
+ * Mark a rule's cache as dirty (invalidate it).
318
+ * Called when formula results change.
319
+ */
320
+ markRuleDirty(a, e, t) {
321
+ var r, i;
322
+ (i = (r = this._cache.get(a)) == null ? void 0 : r.get(e)) == null || i.delete(t);
323
+ }
324
+ /**
325
+ * Clear all caches.
326
+ */
327
+ clear() {
328
+ this._cache.clear();
329
+ }
330
+ /**
331
+ * Compute list data from formula result and cache it.
332
+ */
333
+ computeAndCache(a, e, t, r) {
334
+ var _, f, R;
335
+ const { formula1: i = "", formula2: o = "" } = t, n = S(i) ? this._getRuleFormulaResultSet((R = (f = (_ = r == null ? void 0 : r[0]) == null ? void 0 : _.result) == null ? void 0 : f[0]) == null ? void 0 : R[0]) : Ee(i), l = o.split(","), u = n.map((E, p) => ({ label: E, color: l[p] || "" })), d = {};
336
+ for (const E of u)
337
+ E.color && (d[E.label] = E.color);
338
+ const c = new Set(n), g = { list: n, listWithColor: u, colorMap: d, set: c };
339
+ return this.setCache(a, e, t.uid, g), g;
340
+ }
341
+ /**
342
+ * Extract string list from formula result cells.
343
+ */
344
+ _getRuleFormulaResultSet(a) {
345
+ var t, r;
346
+ if (!a)
347
+ return [];
348
+ const e = /* @__PURE__ */ new Set();
349
+ for (let i = 0, o = a.length; i < o; i++) {
350
+ const n = a[i];
351
+ if (n)
352
+ for (let l = 0, u = n.length; l < u; l++) {
353
+ const d = n[l], c = re(d);
354
+ if (c != null) {
355
+ if (typeof c != "string" && typeof (d == null ? void 0 : d.s) == "object" && ((r = (t = d.s) == null ? void 0 : t.n) != null && r.pattern)) {
356
+ e.add(L.format(d.s.n.pattern, c, { throws: !1 }));
357
+ continue;
358
+ }
359
+ const g = typeof c == "string" ? c : String(c);
360
+ F(g) && e.add(g);
361
+ }
362
+ }
363
+ }
364
+ return [...e];
365
+ }
366
+ };
367
+ le = aa([
368
+ at(0, v(be)),
369
+ at(1, v(ce))
370
+ ], le);
371
+ var ra = Object.getOwnPropertyDescriptor, ia = (s, a, e, t) => {
372
+ for (var r = t > 1 ? void 0 : t ? ra(a, e) : a, i = s.length - 1, o; i >= 0; i--)
373
+ (o = s[i]) && (r = o(r) || r);
374
+ return r;
375
+ }, ee = (s, a) => (e, t) => a(e, t, s);
376
+ let q = class extends x {
377
+ constructor(a, e, t, r, i, o) {
251
378
  super();
252
379
  m(this, "_formulaRuleMap", /* @__PURE__ */ new Map());
253
- this._instanceService = a, this._registerOtherFormulaService = e, this._dataValidationCacheService = t, this._dataValidationModel = r, this._validatorRegistryService = i, this._initFormulaResultHandler();
380
+ this._instanceService = a, this._registerOtherFormulaService = e, this._dataValidationCacheService = t, this._dataValidationModel = r, this._validatorRegistryService = i, this._listCacheService = o, this._initFormulaResultHandler();
254
381
  }
255
382
  _initFormulaResultHandler() {
256
383
  this.disposeWithMe(this._registerOtherFormulaService.formulaResult$.subscribe((a) => {
@@ -258,12 +385,13 @@ let K = class extends W {
258
385
  const t = a[e];
259
386
  if (this._instanceService.getUnitType(e) === N.UNIVER_SHEET)
260
387
  for (const i in t) {
261
- const s = t[i], n = this._ensureRuleFormulaMap(e, i);
262
- s.forEach((l) => {
263
- var u, d;
264
- if (n.get((u = l.extra) == null ? void 0 : u.ruleId)) {
265
- const c = this._dataValidationModel.getRuleById(e, i, (d = l.extra) == null ? void 0 : d.ruleId);
266
- c && this._dataValidationCacheService.markRangeDirty(e, i, c.ranges);
388
+ const o = t[i], n = this._ensureRuleFormulaMap(e, i);
389
+ o.forEach((l) => {
390
+ var d;
391
+ const u = (d = l.extra) == null ? void 0 : d.ruleId;
392
+ if (u && n.get(u)) {
393
+ const c = this._dataValidationModel.getRuleById(e, i, u);
394
+ c && (this._listCacheService.markRuleDirty(e, i, u), this._dataValidationCacheService.markRangeDirty(e, i, c.ranges));
267
395
  }
268
396
  });
269
397
  }
@@ -281,69 +409,63 @@ let K = class extends W {
281
409
  return this._registerOtherFormulaService.registerFormulaWithRange(a, e, t, i, { ruleId: r });
282
410
  }
283
411
  addRule(a, e, t) {
284
- if (!de(t.type, this._validatorRegistryService) && t.type !== T.CHECKBOX) {
285
- const { formula1: r, formula2: i, uid: s } = t, n = S(r), l = S(i);
412
+ if (!he(t.type, this._validatorRegistryService) && t.type !== T.CHECKBOX) {
413
+ const { formula1: r, formula2: i, uid: o } = t, n = S(r), l = S(i);
286
414
  if (!n && !l)
287
415
  return;
288
416
  const u = this._ensureRuleFormulaMap(a, e), d = [void 0, void 0];
289
417
  if (n) {
290
- const c = this._registerSingleFormula(a, e, r, s);
418
+ const c = this._registerSingleFormula(a, e, r, o);
291
419
  d[0] = { id: c, text: r };
292
420
  }
293
421
  if (l) {
294
- const c = this._registerSingleFormula(a, e, i, s);
422
+ const c = this._registerSingleFormula(a, e, i, o);
295
423
  d[1] = { id: c, text: i };
296
424
  }
297
- u.set(s, d);
425
+ u.set(o, d);
298
426
  }
299
427
  }
300
428
  removeRule(a, e, t) {
301
429
  const i = this._ensureRuleFormulaMap(a, e).get(t);
302
430
  if (!i)
303
431
  return;
304
- const [s, n] = i, l = [s == null ? void 0 : s.id, n == null ? void 0 : n.id].filter(Boolean);
432
+ const [o, n] = i, l = [o == null ? void 0 : o.id, n == null ? void 0 : n.id].filter(Boolean);
305
433
  l.length && this._registerOtherFormulaService.deleteFormula(a, e, l);
306
434
  }
307
435
  getRuleFormulaResult(a, e, t) {
308
436
  const i = this._ensureRuleFormulaMap(a, e).get(t);
309
437
  if (!i)
310
438
  return Promise.resolve(null);
311
- const s = async (n) => n && this._registerOtherFormulaService.getFormulaValue(a, e, n.id);
439
+ const o = async (n) => n && this._registerOtherFormulaService.getFormulaValue(a, e, n.id);
312
440
  return Promise.all([
313
- s(i[0]),
314
- s(i[1])
441
+ o(i[0]),
442
+ o(i[1])
315
443
  ]);
316
444
  }
317
445
  getRuleFormulaResultSync(a, e, t) {
318
446
  const i = this._ensureRuleFormulaMap(a, e).get(t);
319
447
  if (i)
320
- return i.map((s) => {
321
- if (s)
322
- return this._registerOtherFormulaService.getFormulaValueSync(a, e, s.id);
448
+ return i.map((o) => {
449
+ if (o)
450
+ return this._registerOtherFormulaService.getFormulaValueSync(a, e, o.id);
323
451
  });
324
452
  }
325
453
  getRuleFormulaInfo(a, e, t) {
326
454
  return this._ensureRuleFormulaMap(a, e).get(t);
327
455
  }
328
456
  };
329
- K = ta([
330
- ie(0, O),
331
- ie(1, v(mt)),
332
- ie(2, v(Q)),
333
- ie(3, v(De)),
334
- ie(4, v(q))
335
- ], K);
336
- function ne(o) {
337
- return Vt(o);
338
- }
339
- function pt(o) {
340
- var a;
341
- return String((a = ne(o)) != null ? a : "");
342
- }
457
+ q = ia([
458
+ ee(0, I),
459
+ ee(1, v(gt)),
460
+ ee(2, v(Q)),
461
+ ee(3, v(ce)),
462
+ ee(4, v(G)),
463
+ ee(5, v(le))
464
+ ], q);
343
465
  class Ze {
344
466
  constructor(a, e, t, r, i = !1) {
345
467
  m(this, "_map");
346
- m(this, "_tree", new Mt());
468
+ m(this, "_tree", new yt());
347
469
  m(this, "_dirty", !0);
348
470
  m(this, "_buildTree", () => {
349
471
  if (!this._dirty || this._disableTree)
@@ -362,7 +484,7 @@ class Ze {
362
484
  });
363
485
  }), this._tree.load(a), this._dirty = !1;
364
486
  });
365
- m(this, "_debonceBuildTree", yt(this._buildTree, 0));
487
+ m(this, "_debonceBuildTree", Tt(this._buildTree, 0));
366
488
  this._unitId = e, this._subUnitId = t, this._univerInstanceService = r, this._disableTree = i, this._map = a, this._buildTree();
367
489
  }
368
490
  get _worksheet() {
@@ -372,10 +494,10 @@ class Ze {
372
494
  _addRule(a, e) {
373
495
  if (!this._worksheet)
374
496
  return;
375
- const t = I.mergeRanges(e.map((r) => L.transformRange(r, this._worksheet)));
497
+ const t = w.mergeRanges(e.map((r) => U.transformRange(r, this._worksheet)));
376
498
  this._map.forEach((r, i) => {
377
- const s = I.subtractMulti(r, t);
378
- s.length === 0 ? this._map.delete(i) : this._map.set(i, s);
499
+ const o = w.subtractMulti(r, t);
500
+ o.length === 0 ? this._map.delete(i) : this._map.set(i, o);
379
501
  }), this._dirty = !0, this._map.set(a, t), this._debonceBuildTree();
380
502
  }
381
503
  addRule(a) {
@@ -384,9 +506,9 @@ class Ze {
384
506
  removeRange(a) {
385
507
  if (!this._worksheet)
386
508
  return;
387
- const e = a.map((t) => L.transformRange(t, this._worksheet));
509
+ const e = a.map((t) => U.transformRange(t, this._worksheet));
388
510
  this._map.forEach((t, r) => {
389
- const i = I.subtractMulti(t, e);
511
+ const i = w.subtractMulti(t, e);
390
512
  i.length === 0 ? this._map.delete(r) : this._map.set(r, i);
391
513
  }), this._dirty = !0, this._debonceBuildTree();
392
514
  }
@@ -404,11 +526,11 @@ class Ze {
404
526
  if (!t.length)
405
527
  return;
406
528
  let r = this._map.get(e);
407
- r ? (this._map.set(e, I.mergeRanges([...r, ...t])), r = this._map.get(e)) : (r = t, this._map.set(e, r)), this._map.forEach((i, s) => {
408
- if (s === e)
529
+ r ? (this._map.set(e, w.mergeRanges([...r, ...t])), r = this._map.get(e)) : (r = t, this._map.set(e, r)), this._map.forEach((i, o) => {
530
+ if (o === e)
409
531
  return;
410
- const n = I.subtractMulti(i, t);
411
- n.length === 0 ? this._map.delete(s) : this._map.set(s, n);
532
+ const n = w.subtractMulti(i, t);
533
+ n.length === 0 ? this._map.delete(o) : this._map.set(o, n);
412
534
  });
413
535
  }), this._dirty = !0, this._debonceBuildTree();
414
536
  }
@@ -417,14 +539,14 @@ class Ze {
417
539
  let t = 0;
418
540
  return a.forEach((r, i) => {
419
541
  var l;
420
- const s = (l = this._map.get(r.uid)) != null ? l : [], n = r.ranges;
421
- s.length !== 0 && (s.length !== n.length || s.some((u, d) => !I.equals(u, n[d]))) && e.push({
542
+ const o = (l = this._map.get(r.uid)) != null ? l : [], n = r.ranges;
543
+ o.length !== 0 && (o.length !== n.length || o.some((u, d) => !w.equals(u, n[d]))) && e.push({
422
544
  type: "update",
423
545
  ruleId: r.uid,
424
546
  oldRanges: n,
425
- newRanges: I.sort(s),
547
+ newRanges: w.sort(o),
426
548
  rule: r
427
- }), s.length === 0 && (e.push({
549
+ }), o.length === 0 && (e.push({
428
550
  type: "delete",
429
551
  rule: r,
430
552
  index: i - t
@@ -434,35 +556,35 @@ class Ze {
434
556
  diffWithAddition(a, e) {
435
557
  const t = [];
436
558
  let r = 0;
437
- return a.forEach((i, s) => {
559
+ return a.forEach((i, o) => {
438
560
  var u;
439
561
  const n = (u = this._map.get(i.uid)) != null ? u : [], l = i.ranges;
440
- n.length !== 0 && (n.length !== l.length || n.some((d, c) => !I.equals(d, l[c]))) && t.push({
562
+ n.length !== 0 && (n.length !== l.length || n.some((d, c) => !w.equals(d, l[c]))) && t.push({
441
563
  type: "update",
442
564
  ruleId: i.uid,
443
565
  oldRanges: l,
444
- newRanges: I.sort(n),
566
+ newRanges: w.sort(n),
445
567
  rule: i
446
568
  }), n.length === 0 && (t.push({
447
569
  type: "delete",
448
570
  rule: i,
449
- index: s - r
571
+ index: o - r
450
572
  }), r++);
451
573
  }), Array.from(e).forEach((i) => {
452
574
  var n;
453
- const s = (n = this._map.get(i.uid)) != null ? n : [];
575
+ const o = (n = this._map.get(i.uid)) != null ? n : [];
454
576
  t.push({
455
577
  type: "add",
456
578
  rule: {
457
579
  ...i,
458
- ranges: I.sort(s)
580
+ ranges: w.sort(o)
459
581
  }
460
582
  });
461
583
  }), t;
462
584
  }
463
585
  clone() {
464
586
  return new Ze(
465
- new Map(E.deepClone(Array.from(this._map.entries()))),
587
+ new Map(M.deepClone(Array.from(this._map.entries()))),
466
588
  this._unitId,
467
589
  this._subUnitId,
468
590
  this._univerInstanceService,
@@ -481,20 +603,20 @@ class Ze {
481
603
  return t.length > 0 ? t[0].ruleId : void 0;
482
604
  }
483
605
  }
484
- var aa = Object.getOwnPropertyDescriptor, ra = (o, a, e, t) => {
485
- for (var r = t > 1 ? void 0 : t ? aa(a, e) : a, i = o.length - 1, s; i >= 0; i--)
486
- (s = o[i]) && (r = s(r) || r);
606
+ var sa = Object.getOwnPropertyDescriptor, oa = (s, a, e, t) => {
607
+ for (var r = t > 1 ? void 0 : t ? sa(a, e) : a, i = s.length - 1, o; i >= 0; i--)
608
+ (o = s[i]) && (r = o(r) || r);
487
609
  return r;
488
- }, X = (o, a) => (e, t) => a(e, t, o);
489
- let F = class extends W {
490
- constructor(a, e, t, r, i, s, n) {
610
+ }, K = (s, a) => (e, t) => a(e, t, s);
611
+ let C = class extends x {
612
+ constructor(a, e, t, r, i, o, n) {
491
613
  super();
492
614
  m(this, "_ruleMatrixMap", /* @__PURE__ */ new Map());
493
- m(this, "_validStatusChange$", new Ge());
494
- m(this, "_ruleChange$", new Ge());
615
+ m(this, "_validStatusChange$", new Ye());
616
+ m(this, "_ruleChange$", new Ye());
495
617
  m(this, "ruleChange$", this._ruleChange$.asObservable());
496
618
  m(this, "validStatusChange$", this._validStatusChange$.asObservable());
497
- this._dataValidationModel = a, this._univerInstanceService = e, this._dataValidatorRegistryService = t, this._dataValidationCacheService = r, this._dataValidationFormulaService = i, this._dataValidationCustomFormulaService = s, this._commandService = n, this._initRuleUpdateListener(), this.disposeWithMe(() => {
619
+ this._dataValidationModel = a, this._univerInstanceService = e, this._dataValidatorRegistryService = t, this._dataValidationCacheService = r, this._dataValidationFormulaService = i, this._dataValidationCustomFormulaService = o, this._commandService = n, this._initRuleUpdateListener(), this.disposeWithMe(() => {
498
620
  this._ruleChange$.complete(), this._validStatusChange$.complete();
499
621
  }), this._initUniverInstanceListener();
500
622
  }
@@ -505,7 +627,7 @@ let F = class extends W {
505
627
  })
506
628
  ), this.disposeWithMe(
507
629
  this._commandService.onCommandExecuted((a) => {
508
- if (a.id === ut.id) {
630
+ if (a.id === dt.id) {
509
631
  const { unitId: e, subUnitId: t } = a.params, r = this._ruleMatrixMap.get(e);
510
632
  r && r.delete(t);
511
633
  }
@@ -516,12 +638,12 @@ let F = class extends W {
516
638
  const a = this._dataValidationModel.getAll();
517
639
  for (const [e, t] of a)
518
640
  for (const [r, i] of t)
519
- for (const s of i)
520
- this._addRule(e, r, s), this._ruleChange$.next({
641
+ for (const o of i)
642
+ this._addRule(e, r, o), this._ruleChange$.next({
521
643
  type: "add",
522
644
  unitId: e,
523
645
  subUnitId: r,
524
- rule: s,
646
+ rule: o,
525
647
  source: "patched"
526
648
  });
527
649
  this.disposeWithMe(
@@ -556,11 +678,11 @@ let F = class extends W {
556
678
  });
557
679
  }
558
680
  _updateRule(a, e, t, r, i) {
559
- const s = this._ensureRuleMatrix(a, e), n = {
681
+ const o = this._ensureRuleMatrix(a, e), n = {
560
682
  ...r,
561
683
  ...i.payload
562
684
  };
563
- i.type === M.RANGE ? s.updateRange(t, i.payload) : i.type === M.ALL && s.updateRange(t, i.payload.ranges), this._dataValidationCacheService.removeRule(a, e, r), this._dataValidationCacheService.addRule(a, e, n), this._dataValidationFormulaService.removeRule(a, e, r.uid), this._dataValidationFormulaService.addRule(a, e, n), this._dataValidationCustomFormulaService.deleteByRuleId(a, e, t), this._dataValidationCustomFormulaService.addRule(a, e, n);
685
+ i.type === V.RANGE ? o.updateRange(t, i.payload) : i.type === V.ALL && o.updateRange(t, i.payload.ranges), this._dataValidationCacheService.removeRule(a, e, r), this._dataValidationCacheService.addRule(a, e, n), this._dataValidationFormulaService.removeRule(a, e, r.uid), this._dataValidationFormulaService.addRule(a, e, n), this._dataValidationCustomFormulaService.deleteByRuleId(a, e, t), this._dataValidationCustomFormulaService.addRule(a, e, n);
564
686
  }
565
687
  _removeRule(a, e, t) {
566
688
  this._ensureRuleMatrix(a, e).removeRule(t), this._dataValidationCacheService.removeRule(a, e, t), this._dataValidationCustomFormulaService.deleteByRuleId(a, e, t.uid);
@@ -577,34 +699,34 @@ let F = class extends W {
577
699
  return this._dataValidationModel.getRuleById(a, e, i);
578
700
  }
579
701
  validator(a, e, t) {
580
- const { col: r, row: i, unitId: s, subUnitId: n, worksheet: l } = e, u = (p, R) => {
581
- t && t(p, R), R && this._validStatusChange$.next({
582
- unitId: s,
702
+ const { col: r, row: i, unitId: o, subUnitId: n, worksheet: l } = e, u = (f, R) => {
703
+ t && t(f, R), R && this._validStatusChange$.next({
704
+ unitId: o,
583
705
  subUnitId: n,
584
706
  ruleId: a.uid,
585
- status: p,
707
+ status: f,
586
708
  row: i,
587
709
  col: r
588
710
  });
589
- }, d = l.getCellValueOnly(i, r), c = this.getValidator(a.type), g = l.getCellRaw(i, r), f = ne(g);
711
+ }, d = l.getCellValueOnly(i, r), c = this.getValidator(a.type), g = l.getCellRaw(i, r), _ = re(g);
590
712
  if (c) {
591
- const p = this._dataValidationCacheService.ensureCache(s, n), R = p.getValue(i, r);
592
- return R == null ? (p.setValue(i, r, b.VALIDATING), c.validator(
713
+ const f = this._dataValidationCacheService.ensureCache(o, n), R = f.getValue(i, r);
714
+ return R == null ? (f.setValue(i, r, b.VALIDATING), c.validator(
593
715
  {
594
- value: f,
595
- unitId: s,
716
+ value: _,
717
+ unitId: o,
596
718
  subUnitId: n,
597
719
  row: i,
598
720
  column: r,
599
721
  worksheet: e.worksheet,
600
722
  workbook: e.workbook,
601
- interceptValue: ne(d),
723
+ interceptValue: re(d),
602
724
  t: g == null ? void 0 : g.t
603
725
  },
604
726
  a
605
- ).then((V) => {
606
- const _ = V ? b.VALID : b.INVALID, w = p.getValue(i, r);
607
- _ === b.VALID ? p.realDeleteValue(i, r) : p.setValue(i, r, _), u(_, R !== w);
727
+ ).then((E) => {
728
+ const p = E ? b.VALID : b.INVALID, O = f.getValue(i, r);
729
+ p === b.VALID ? f.realDeleteValue(i, r) : f.setValue(i, r, p), u(p, R !== O);
608
730
  }), b.VALIDATING) : (u(R != null ? R : b.VALID, !1), R != null ? R : b.VALID);
609
731
  } else
610
732
  return u(b.VALID, !1), b.VALID;
@@ -634,21 +756,21 @@ let F = class extends W {
634
756
  return this._dataValidationModel.getAll();
635
757
  }
636
758
  };
637
- F = ra([
638
- X(0, v(De)),
639
- X(1, O),
640
- X(2, v(q)),
641
- X(3, v(Q)),
642
- X(4, v(K)),
643
- X(5, v(H)),
644
- X(6, U)
645
- ], F);
646
- const Ee = 1, Ve = 0;
647
- function at(o, a) {
648
- return E.isBlank(o) ? a.t("dataValidation.validFail.value") : S(o) ? a.t("dataValidation.validFail.primitive") : "";
759
+ C = oa([
760
+ K(0, v(ce)),
761
+ K(1, I),
762
+ K(2, v(G)),
763
+ K(3, v(Q)),
764
+ K(4, v(q)),
765
+ K(5, v(W)),
766
+ K(6, B)
767
+ ], C);
768
+ const Ve = 1, ye = 0;
769
+ function rt(s, a) {
770
+ return M.isBlank(s) ? a.t("dataValidation.validFail.value") : S(s) ? a.t("dataValidation.validFail.primitive") : "";
649
771
  }
650
- const fe = (o) => E.isDefine(o) && String(o).toLowerCase() === "true" ? "1" : String(o).toLowerCase() === "false" ? "0" : o;
651
- class ia extends G {
772
+ const ve = (s) => M.isDefine(s) && String(s).toLowerCase() === "true" ? "1" : String(s).toLowerCase() === "false" ? "0" : s;
773
+ class na extends Y {
652
774
  constructor() {
653
775
  super(...arguments);
654
776
  m(this, "id", T.CHECKBOX);
@@ -657,15 +779,15 @@ class ia extends G {
657
779
  m(this, "scopes", ["sheet"]);
658
780
  m(this, "order", 41);
659
781
  m(this, "offsetFormulaByRange", !1);
660
- m(this, "_formulaService", this.injector.get(K));
782
+ m(this, "_formulaService", this.injector.get(q));
661
783
  m(this, "skipDefaultFontRender", (e, t, r) => {
662
- const { unitId: i, subUnitId: s } = r, { formula1: n, formula2: l } = this.parseFormulaSync(e, i, s), u = `${t != null ? t : ""}`;
784
+ const { unitId: i, subUnitId: o } = r, { formula1: n, formula2: l } = this.parseFormulaSync(e, i, o), u = `${t != null ? t : ""}`;
663
785
  return !u || u === `${n}` || u === `${l}`;
664
786
  });
665
787
  }
666
788
  validatorFormula(e, t, r) {
667
- const { formula1: i, formula2: s } = e, n = i === s;
668
- if (E.isBlank(i) && E.isBlank(s))
789
+ const { formula1: i, formula2: o } = e, n = i === o;
790
+ if (M.isBlank(i) && M.isBlank(o))
669
791
  return {
670
792
  success: !0
671
793
  };
@@ -675,7 +797,7 @@ class ia extends G {
675
797
  formula1: this.localeService.t("dataValidation.validFail.checkboxEqual"),
676
798
  formula2: this.localeService.t("dataValidation.validFail.checkboxEqual")
677
799
  };
678
- const l = at(i, this.localeService), u = at(s, this.localeService);
800
+ const l = rt(i, this.localeService), u = rt(o, this.localeService);
679
801
  return {
680
802
  success: !l && !u,
681
803
  formula1: l,
@@ -683,11 +805,11 @@ class ia extends G {
683
805
  };
684
806
  }
685
807
  async parseFormula(e, t, r) {
686
- var c, g, f, p;
687
- const { formula1: i = Ee, formula2: s = Ve } = e, n = await this._formulaService.getRuleFormulaResult(t, r, e.uid), l = S(i) ? oe((g = (c = n == null ? void 0 : n[0]) == null ? void 0 : c.result) == null ? void 0 : g[0][0]) : i, u = S(s) ? oe((p = (f = n == null ? void 0 : n[1]) == null ? void 0 : f.result) == null ? void 0 : p[0][0]) : s, d = C(String(l)) && C(String(u));
808
+ var c, g, _, f;
809
+ const { formula1: i = Ve, formula2: o = ye } = e, n = await this._formulaService.getRuleFormulaResult(t, r, e.uid), l = S(i) ? oe((g = (c = n == null ? void 0 : n[0]) == null ? void 0 : c.result) == null ? void 0 : g[0][0]) : i, u = S(o) ? oe((f = (_ = n == null ? void 0 : n[1]) == null ? void 0 : _.result) == null ? void 0 : f[0][0]) : o, d = F(String(l)) && F(String(u));
688
810
  return {
689
- formula1: fe(l),
690
- formula2: fe(u),
811
+ formula1: ve(l),
812
+ formula2: ve(u),
691
813
  originFormula1: l,
692
814
  originFormula2: u,
693
815
  isFormulaValid: d
@@ -695,23 +817,23 @@ class ia extends G {
695
817
  }
696
818
  getExtraStyle(e, t) {
697
819
  return {
698
- tb: ve.CLIP
820
+ tb: Se.CLIP
699
821
  };
700
822
  }
701
823
  parseFormulaSync(e, t, r) {
702
- var c, g, f, p;
703
- const { formula1: i = Ee, formula2: s = Ve } = e, n = this._formulaService.getRuleFormulaResultSync(t, r, e.uid), l = S(i) ? oe((g = (c = n == null ? void 0 : n[0]) == null ? void 0 : c.result) == null ? void 0 : g[0][0]) : i, u = S(s) ? oe((p = (f = n == null ? void 0 : n[1]) == null ? void 0 : f.result) == null ? void 0 : p[0][0]) : s, d = C(String(l)) && C(String(u));
824
+ var c, g, _, f;
825
+ const { formula1: i = Ve, formula2: o = ye } = e, n = this._formulaService.getRuleFormulaResultSync(t, r, e.uid), l = S(i) ? oe((g = (c = n == null ? void 0 : n[0]) == null ? void 0 : c.result) == null ? void 0 : g[0][0]) : i, u = S(o) ? oe((f = (_ = n == null ? void 0 : n[1]) == null ? void 0 : _.result) == null ? void 0 : f[0][0]) : o, d = F(String(l)) && F(String(u));
704
826
  return {
705
- formula1: fe(l),
706
- formula2: fe(u),
827
+ formula1: ve(l),
828
+ formula2: ve(u),
707
829
  originFormula1: l,
708
830
  originFormula2: u,
709
831
  isFormulaValid: d
710
832
  };
711
833
  }
712
834
  async isValidType(e, t, r) {
713
- const { value: i, unitId: s, subUnitId: n } = e, { formula1: l, formula2: u, originFormula1: d, originFormula2: c } = await this.parseFormula(r, s, n);
714
- return !E.isDefine(l) || !E.isDefine(u) ? !0 : E.isDefine(i) && (String(i) === String(l) || String(i) === String(u) || String(i) === String(d != null ? d : "") || String(i) === String(c != null ? c : ""));
835
+ const { value: i, unitId: o, subUnitId: n } = e, { formula1: l, formula2: u, originFormula1: d, originFormula2: c } = await this.parseFormula(r, o, n);
836
+ return !M.isDefine(l) || !M.isDefine(u) ? !0 : M.isDefine(i) && (String(i) === String(l) || String(i) === String(u) || String(i) === String(d != null ? d : "") || String(i) === String(c != null ? c : ""));
715
837
  }
716
838
  generateRuleErrorMessage(e) {
717
839
  return this.localeService.t("dataValidation.checkbox.error");
@@ -720,7 +842,7 @@ class ia extends G {
720
842
  return this.titleStr;
721
843
  }
722
844
  }
723
- const oa = {
845
+ const la = {
724
846
  [h.BETWEEN]: "dataValidation.date.operators.between",
725
847
  [h.EQUAL]: "dataValidation.date.operators.equal",
726
848
  [h.GREATER_THAN]: "dataValidation.date.operators.greaterThan",
@@ -731,7 +853,7 @@ const oa = {
731
853
  [h.NOT_EQUAL]: "dataValidation.date.operators.notEqual"
732
854
  };
733
855
  h.BETWEEN + "", h.EQUAL + "", h.GREATER_THAN + "", h.GREATER_THAN_OR_EQUAL + "", h.LESS_THAN + "", h.LESS_THAN_OR_EQUAL + "", h.NOT_BETWEEN + "", h.NOT_EQUAL + "";
734
- const rt = {
856
+ const it = {
735
857
  [h.BETWEEN]: "dataValidation.date.ruleName.between",
736
858
  [h.EQUAL]: "dataValidation.date.ruleName.equal",
737
859
  [h.GREATER_THAN]: "dataValidation.date.ruleName.greaterThan",
@@ -741,7 +863,7 @@ const rt = {
741
863
  [h.NOT_BETWEEN]: "dataValidation.date.ruleName.notBetween",
742
864
  [h.NOT_EQUAL]: "dataValidation.date.ruleName.notEqual",
743
865
  NONE: "dataValidation.date.ruleName.legal"
744
- }, sa = {
866
+ }, ua = {
745
867
  [h.BETWEEN]: "dataValidation.date.errorMsg.between",
746
868
  [h.EQUAL]: "dataValidation.date.errorMsg.equal",
747
869
  [h.GREATER_THAN]: "dataValidation.date.errorMsg.greaterThan",
@@ -751,37 +873,19 @@ const rt = {
751
873
  [h.NOT_BETWEEN]: "dataValidation.date.errorMsg.notBetween",
752
874
  [h.NOT_EQUAL]: "dataValidation.date.errorMsg.notEqual",
753
875
  NONE: "dataValidation.date.errorMsg.legal"
754
- }, be = [
876
+ }, Be = [
755
877
  h.BETWEEN,
756
878
  h.NOT_BETWEEN
757
- ], le = "{FORMULA1}", ue = "{FORMULA2}";
758
- function Ka(o) {
759
- return o.filter(Boolean).join(",");
760
- }
761
- function _e(o) {
762
- return o.split(",").filter(Boolean);
763
- }
764
- function za(o) {
765
- const a = ne(o);
766
- return a == null ? "" : a.toString();
767
- }
768
- function Le(o, a, e) {
769
- const { formula1: t, formula2: r } = a, i = a.ranges[0].startRow, s = a.ranges[0].startColumn, n = e.row - i, l = e.col - s, u = S(t) ? o.moveFormulaRefOffset(t, l, n, !0) : t, d = S(r) ? o.moveFormulaRefOffset(r, l, n, !0) : r;
770
- return {
771
- transformedFormula1: u,
772
- transformedFormula2: d
773
- };
774
- }
775
- const We = (o) => {
879
+ ], ue = "{FORMULA1}", de = "{FORMULA2}", ke = (s) => {
776
880
  var e, t;
777
- if (o == null || typeof o == "boolean")
881
+ if (s == null || typeof s == "boolean")
778
882
  return;
779
- if (typeof o == "number" || !Number.isNaN(+o))
780
- return +o;
781
- const a = (e = P.parseDate(o)) == null ? void 0 : e.v;
782
- return E.isDefine(a) ? a : (t = P.parseDate(st(o).format("YYYY-MM-DD HH:mm:ss"))) == null ? void 0 : t.v;
883
+ if (typeof s == "number" || !Number.isNaN(+s))
884
+ return +s;
885
+ const a = (e = L.parseDate(s)) == null ? void 0 : e.v;
886
+ return M.isDefine(a) ? a : (t = L.parseDate(nt(s).format("YYYY-MM-DD HH:mm:ss"))) == null ? void 0 : t.v;
783
887
  };
784
- class na extends G {
888
+ class da extends Y {
785
889
  constructor() {
786
890
  super(...arguments);
787
891
  m(this, "id", T.DATE);
@@ -798,23 +902,23 @@ class na extends G {
798
902
  h.NOT_EQUAL
799
903
  ]);
800
904
  m(this, "scopes", ["sheet"]);
801
- m(this, "_customFormulaService", this.injector.get(H));
802
- m(this, "_lexerTreeBuilder", this.injector.get(Y));
905
+ m(this, "_customFormulaService", this.injector.get(W));
906
+ m(this, "_lexerTreeBuilder", this.injector.get(X));
803
907
  }
804
- async parseFormula(e, t, r, i, s) {
805
- const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, s), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, s), { formula1: u, formula2: d } = e, c = C(String(n == null ? void 0 : n.v)) && C(String(l == null ? void 0 : l.v));
908
+ async parseFormula(e, t, r, i, o) {
909
+ const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, o), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, o), { formula1: u, formula2: d } = e, c = F(String(n == null ? void 0 : n.v)) && F(String(l == null ? void 0 : l.v));
806
910
  return {
807
- formula1: We(S(u) ? n == null ? void 0 : n.v : u),
808
- formula2: We(S(d) ? l == null ? void 0 : l.v : d),
911
+ formula1: ke(S(u) ? n == null ? void 0 : n.v : u),
912
+ formula2: ke(S(d) ? l == null ? void 0 : l.v : d),
809
913
  isFormulaValid: c
810
914
  };
811
915
  }
812
916
  async isValidType(e) {
813
917
  const { interceptValue: t, value: r } = e;
814
- return typeof r == "number" && typeof t == "string" ? !!P.parseDate(t) : typeof t == "string" ? !!P.parseDate(t) : !1;
918
+ return typeof r == "number" && typeof t == "string" ? !!L.parseDate(t) : typeof t == "string" ? !!L.parseDate(t) : !1;
815
919
  }
816
920
  _validatorSingleFormula(e) {
817
- return !E.isBlank(e) && (S(e) || !Number.isNaN(+e) || !!(e && P.parseDate(e)));
921
+ return !M.isBlank(e) && (S(e) || !Number.isNaN(+e) || !!(e && L.parseDate(e)));
818
922
  }
819
923
  validatorFormula(e, t, r) {
820
924
  const i = e.operator;
@@ -822,68 +926,68 @@ class na extends G {
822
926
  return {
823
927
  success: !0
824
928
  };
825
- const s = this._validatorSingleFormula(e.formula1), n = this.localeService.t("dataValidation.validFail.date");
826
- if (be.includes(i)) {
929
+ const o = this._validatorSingleFormula(e.formula1), n = this.localeService.t("dataValidation.validFail.date");
930
+ if (Be.includes(i)) {
827
931
  const u = this._validatorSingleFormula(e.formula2);
828
932
  return {
829
- success: s && u,
830
- formula1: s ? void 0 : n,
933
+ success: o && u,
934
+ formula1: o ? void 0 : n,
831
935
  formula2: u ? void 0 : n
832
936
  };
833
937
  }
834
938
  return {
835
- success: s,
836
- formula1: s ? void 0 : n
939
+ success: o,
940
+ formula1: o ? void 0 : n
837
941
  };
838
942
  }
839
943
  normalizeFormula(e, t, r) {
840
- const { formula1: i, formula2: s, bizInfo: n } = e, l = (u) => {
944
+ const { formula1: i, formula2: o, bizInfo: n } = e, l = (u) => {
841
945
  var c;
842
946
  if (!u)
843
947
  return u;
844
948
  let d;
845
949
  if (!Number.isNaN(+u))
846
- d = P.dateFromSerial(+u);
950
+ d = L.dateFromSerial(+u);
847
951
  else {
848
- const g = (c = P.parseDate(u)) == null ? void 0 : c.v;
952
+ const g = (c = L.parseDate(u)) == null ? void 0 : c.v;
849
953
  if (g == null)
850
954
  return "";
851
- d = P.dateFromSerial(g);
955
+ d = L.dateFromSerial(g);
852
956
  }
853
- return st(`${d[0]}/${d[1]}/${d[2]} ${d[3]}:${d[4]}:${d[5]}`).format(n != null && n.showTime ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD");
957
+ return nt(`${d[0]}/${d[1]}/${d[2]} ${d[3]}:${d[4]}:${d[5]}`).format(n != null && n.showTime ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD");
854
958
  };
855
959
  return {
856
960
  formula1: S(i) ? i : l(`${i}`),
857
- formula2: S(s) ? s : l(`${s}`)
961
+ formula2: S(o) ? o : l(`${o}`)
858
962
  };
859
963
  }
860
964
  transform(e, t, r) {
861
965
  const { value: i } = e;
862
966
  return {
863
967
  ...e,
864
- value: We(i)
968
+ value: ke(i)
865
969
  };
866
970
  }
867
971
  get operatorNames() {
868
- return this.operators.map((e) => this.localeService.t(oa[e]));
972
+ return this.operators.map((e) => this.localeService.t(la[e]));
869
973
  }
870
974
  generateRuleName(e) {
871
975
  var r, i;
872
976
  if (!e.operator)
873
- return this.localeService.t(rt.NONE);
874
- const t = this.localeService.t(rt[e.operator]).replace(le, (r = e.formula1) != null ? r : "").replace(ue, (i = e.formula2) != null ? i : "");
977
+ return this.localeService.t(it.NONE);
978
+ const t = this.localeService.t(it[e.operator]).replace(ue, (r = e.formula1) != null ? r : "").replace(de, (i = e.formula2) != null ? i : "");
875
979
  return `${this.titleStr} ${t}`;
876
980
  }
877
981
  generateRuleErrorMessage(e, t) {
878
982
  if (!e.operator)
879
983
  return this.titleStr;
880
- const { transformedFormula1: r, transformedFormula2: i } = Le(this._lexerTreeBuilder, e, t);
881
- return `${this.localeService.t(sa[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
984
+ const { transformedFormula1: r, transformedFormula2: i } = Ue(this._lexerTreeBuilder, e, t);
985
+ return `${this.localeService.t(ua[e.operator]).replace(ue, r != null ? r : "").replace(de, i != null ? i : "")}`;
882
986
  }
883
987
  }
884
988
  h.BETWEEN + "", h.EQUAL + "", h.GREATER_THAN + "", h.GREATER_THAN_OR_EQUAL + "", h.LESS_THAN + "", h.LESS_THAN_OR_EQUAL + "", h.NOT_BETWEEN + "", h.NOT_EQUAL + "";
885
989
  h.BETWEEN + "", h.EQUAL + "", h.GREATER_THAN + "", h.GREATER_THAN_OR_EQUAL + "", h.LESS_THAN + "", h.LESS_THAN_OR_EQUAL + "", h.NOT_BETWEEN + "", h.NOT_EQUAL + "";
886
- const Me = {
990
+ const Te = {
887
991
  [h.BETWEEN]: "dataValidation.errorMsg.between",
888
992
  [h.EQUAL]: "dataValidation.errorMsg.equal",
889
993
  [h.GREATER_THAN]: "dataValidation.errorMsg.greaterThan",
@@ -894,15 +998,15 @@ const Me = {
894
998
  [h.NOT_EQUAL]: "dataValidation.errorMsg.notEqual",
895
999
  NONE: "dataValidation.errorMsg.legal"
896
1000
  };
897
- function ye(o) {
898
- return +o;
1001
+ function Fe(s) {
1002
+ return +s;
899
1003
  }
900
- class la extends G {
1004
+ class ca extends Y {
901
1005
  constructor() {
902
1006
  super(...arguments);
903
- m(this, "_customFormulaService", this.injector.get(H));
1007
+ m(this, "_customFormulaService", this.injector.get(W));
904
1008
  m(this, "id", T.DECIMAL);
905
- m(this, "_lexerTreeBuilder", this.injector.get(Y));
1009
+ m(this, "_lexerTreeBuilder", this.injector.get(X));
906
1010
  m(this, "title", "dataValidation.decimal.title");
907
1011
  m(this, "order", 20);
908
1012
  m(this, "operators", [
@@ -918,24 +1022,24 @@ class la extends G {
918
1022
  m(this, "scopes", ["sheet"]);
919
1023
  }
920
1024
  _isFormulaOrNumber(e) {
921
- return !E.isBlank(e) && (S(e) || !Number.isNaN(+e));
1025
+ return !M.isBlank(e) && (S(e) || !Number.isNaN(+e));
922
1026
  }
923
1027
  async isValidType(e, t, r) {
924
1028
  const { value: i } = e;
925
- return !Number.isNaN(ye(i));
1029
+ return !Number.isNaN(Fe(i));
926
1030
  }
927
1031
  transform(e, t, r) {
928
1032
  const { value: i } = e;
929
1033
  return {
930
1034
  ...e,
931
- value: ye(i)
1035
+ value: Fe(i)
932
1036
  };
933
1037
  }
934
1038
  _parseNumber(e) {
935
1039
  return e == null ? Number.NaN : +e;
936
1040
  }
937
- async parseFormula(e, t, r, i, s) {
938
- const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, s), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, s), { formula1: u, formula2: d } = e, c = C(String(n == null ? void 0 : n.v)) && C(String(l == null ? void 0 : l.v));
1041
+ async parseFormula(e, t, r, i, o) {
1042
+ const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, o), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, o), { formula1: u, formula2: d } = e, c = F(String(n == null ? void 0 : n.v)) && F(String(l == null ? void 0 : l.v));
939
1043
  return {
940
1044
  formula1: this._parseNumber(S(u) ? n == null ? void 0 : n.v : u),
941
1045
  formula2: this._parseNumber(S(d) ? l == null ? void 0 : l.v : d),
@@ -948,90 +1052,93 @@ class la extends G {
948
1052
  return {
949
1053
  success: !0
950
1054
  };
951
- const s = E.isDefine(e.formula1) && this._isFormulaOrNumber(e.formula1), n = E.isDefine(e.formula2) && this._isFormulaOrNumber(e.formula2), l = be.includes(i), u = this.localeService.t("dataValidation.validFail.number");
1055
+ const o = M.isDefine(e.formula1) && this._isFormulaOrNumber(e.formula1), n = M.isDefine(e.formula2) && this._isFormulaOrNumber(e.formula2), l = Be.includes(i), u = this.localeService.t("dataValidation.validFail.number");
952
1056
  return l ? {
953
- success: s && n,
954
- formula1: s ? void 0 : u,
1057
+ success: o && n,
1058
+ formula1: o ? void 0 : u,
955
1059
  formula2: n ? void 0 : u
956
1060
  } : {
957
- success: s,
958
- formula1: s ? "" : u
1061
+ success: o,
1062
+ formula1: o ? "" : u
959
1063
  };
960
1064
  }
961
1065
  generateRuleErrorMessage(e, t) {
962
1066
  if (!e.operator)
963
- return this.localeService.t(Me.NONE).replace("{TYPE}", this.titleStr);
964
- const { transformedFormula1: r, transformedFormula2: i } = Le(this._lexerTreeBuilder, e, t);
965
- return `${this.localeService.t(Me[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
1067
+ return this.localeService.t(Te.NONE).replace("{TYPE}", this.titleStr);
1068
+ const { transformedFormula1: r, transformedFormula2: i } = Ue(this._lexerTreeBuilder, e, t);
1069
+ return `${this.localeService.t(Te[e.operator]).replace(ue, r != null ? r : "").replace(de, i != null ? i : "")}`;
966
1070
  }
967
1071
  }
968
- function $e(o) {
969
- if (!o)
1072
+ function ha(s) {
1073
+ var e, t;
1074
+ if (!s)
970
1075
  return [];
971
1076
  const a = /* @__PURE__ */ new Set();
972
- return o.forEach(
973
- (e) => {
974
- e.forEach((t) => {
975
- var i, s;
976
- const r = ne(t);
977
- if (r != null) {
978
- if (typeof r != "string" && typeof (t == null ? void 0 : t.s) == "object" && ((s = (i = t.s) == null ? void 0 : i.n) != null && s.pattern)) {
979
- a.add(P.format(t.s.n.pattern, r, { throws: !1 }));
980
- return;
1077
+ for (let r = 0, i = s.length; r < i; r++) {
1078
+ const o = s[r];
1079
+ if (o)
1080
+ for (let n = 0, l = o.length; n < l; n++) {
1081
+ const u = o[n], d = re(u);
1082
+ if (d != null) {
1083
+ if (typeof d != "string" && typeof (u == null ? void 0 : u.s) == "object" && ((t = (e = u.s) == null ? void 0 : e.n) != null && t.pattern)) {
1084
+ a.add(L.format(u.s.n.pattern, d, { throws: !1 }));
1085
+ continue;
981
1086
  }
982
- C(r.toString()) && a.add(r.toString());
1087
+ const c = typeof d == "string" ? d : String(d);
1088
+ F(c) && a.add(c);
983
1089
  }
984
- });
985
- }
986
- ), [...a];
1090
+ }
1091
+ }
1092
+ return [...a];
987
1093
  }
988
- const ua = [
1094
+ const ma = [
989
1095
  "if",
990
1096
  "indirect",
991
1097
  "choose",
992
1098
  "offset"
993
1099
  ];
994
- function da(o, a) {
995
- if (!S(o) || lt(o.slice(1)))
1100
+ function ga(s, a) {
1101
+ if (!S(s) || ut(s.slice(1)))
996
1102
  return !0;
997
- const t = a.sequenceNodesBuilder(o);
998
- return t && t.some((r) => typeof r == "object" && r.nodeType === Pt.FUNCTION && ua.indexOf(r.token.toLowerCase()) > -1);
1103
+ const t = a.sequenceNodesBuilder(s);
1104
+ return t && t.some((r) => typeof r == "object" && r.nodeType === Ht.FUNCTION && ma.indexOf(r.token.toLowerCase()) > -1);
999
1105
  }
1000
- function ca(o, a) {
1001
- const { formula1: e = "", ranges: t } = o;
1002
- if (lt(e.slice(1))) {
1003
- const i = Ht(e.slice(1));
1004
- if ((!i.sheetName || i.sheetName === a) && t.some((s) => I.intersects(s, i.range)))
1106
+ function pa(s, a) {
1107
+ const { formula1: e = "", ranges: t } = s;
1108
+ if (ut(e.slice(1))) {
1109
+ const i = Wt(e.slice(1));
1110
+ if ((!i.sheetName || i.sheetName === a) && t.some((o) => w.intersects(o, i.range)))
1005
1111
  return !0;
1006
1112
  }
1007
1113
  return !1;
1008
1114
  }
1009
- class ft extends G {
1115
+ class _t extends Y {
1010
1116
  constructor() {
1011
1117
  super(...arguments);
1012
- m(this, "formulaService", this.injector.get(K));
1013
- m(this, "_lexer", this.injector.get(Y));
1014
- m(this, "_univerInstanceService", this.injector.get(O));
1118
+ m(this, "formulaService", this.injector.get(q));
1119
+ m(this, "_lexer", this.injector.get(X));
1120
+ m(this, "_univerInstanceService", this.injector.get(I));
1121
+ m(this, "_listCacheService", this.injector.get(le));
1015
1122
  m(this, "order", 50);
1016
1123
  m(this, "offsetFormulaByRange", !1);
1017
1124
  m(this, "id", T.LIST);
1018
1125
  m(this, "title", "dataValidation.list.title");
1019
1126
  m(this, "operators", []);
1020
1127
  m(this, "scopes", ["sheet"]);
1021
- m(this, "skipDefaultFontRender", (e) => e.renderMode !== Pe.TEXT);
1128
+ m(this, "skipDefaultFontRender", (e) => e.renderMode !== We.TEXT);
1022
1129
  }
1023
1130
  validatorFormula(e, t, r) {
1024
1131
  var u, d, c;
1025
- const i = !E.isBlank(e.formula1), s = da((u = e.formula1) != null ? u : "", this._lexer), n = (c = (d = this._univerInstanceService.getUnit(t, N.UNIVER_SHEET)) == null ? void 0 : d.getSheetBySheetId(r)) == null ? void 0 : c.getName(), l = ca(e, n != null ? n : "");
1132
+ const i = !M.isBlank(e.formula1), o = ga((u = e.formula1) != null ? u : "", this._lexer), n = (c = (d = this._univerInstanceService.getUnit(t, N.UNIVER_SHEET)) == null ? void 0 : d.getSheetBySheetId(r)) == null ? void 0 : c.getName(), l = pa(e, n != null ? n : "");
1026
1133
  return {
1027
- success: !!(i && s && !l),
1028
- formula1: i ? s ? l ? this.localeService.t("dataValidation.validFail.listIntersects") : void 0 : this.localeService.t("dataValidation.validFail.listInvalid") : this.localeService.t("dataValidation.validFail.list")
1134
+ success: !!(i && o && !l),
1135
+ formula1: i ? o ? l ? this.localeService.t("dataValidation.validFail.listIntersects") : void 0 : this.localeService.t("dataValidation.validFail.listInvalid") : this.localeService.t("dataValidation.validFail.list")
1029
1136
  };
1030
1137
  }
1031
1138
  getExtraStyle(e, t, { style: r }) {
1032
- var s;
1033
- const i = (s = r.tb !== ve.OVERFLOW ? r.tb : ve.CLIP) != null ? s : ve.WRAP;
1034
- if (e.type === T.LIST && (e.renderMode === Pe.ARROW || e.renderMode === Pe.TEXT)) {
1139
+ var o;
1140
+ const i = (o = r.tb !== Se.OVERFLOW ? r.tb : Se.CLIP) != null ? o : Se.WRAP;
1141
+ if (e.type === T.LIST && (e.renderMode === We.ARROW || e.renderMode === We.TEXT)) {
1035
1142
  const n = this.getListWithColorMap(e), l = `${t != null ? t : ""}`, u = n[l];
1036
1143
  if (u)
1037
1144
  return {
@@ -1047,21 +1154,24 @@ class ft extends G {
1047
1154
  }
1048
1155
  parseCellValue(e) {
1049
1156
  const t = e.toString();
1050
- return _e(t);
1157
+ return Ee(t);
1051
1158
  }
1052
1159
  async parseFormula(e, t, r) {
1053
1160
  var l, u;
1054
- const i = await this.formulaService.getRuleFormulaResult(t, r, e.uid), s = oe((u = (l = i == null ? void 0 : i[0]) == null ? void 0 : l.result) == null ? void 0 : u[0][0]);
1161
+ const i = await this.formulaService.getRuleFormulaResult(t, r, e.uid), o = oe((u = (l = i == null ? void 0 : i[0]) == null ? void 0 : l.result) == null ? void 0 : u[0][0]);
1055
1162
  return {
1056
1163
  formula1: void 0,
1057
1164
  formula2: void 0,
1058
- isFormulaValid: C(String(s))
1165
+ isFormulaValid: F(String(o))
1059
1166
  };
1060
1167
  }
1061
1168
  async isValidType(e, t, r) {
1062
- var g, f;
1063
- const { value: i, unitId: s, subUnitId: n } = e, { formula1: l = "" } = r, u = await this.formulaService.getRuleFormulaResult(s, n, r.uid), d = S(l) ? $e((f = (g = u == null ? void 0 : u[0]) == null ? void 0 : g.result) == null ? void 0 : f[0][0]) : _e(l);
1064
- return this.parseCellValue(i).every((p) => d.includes(p));
1169
+ const { value: i, unitId: o, subUnitId: n } = e, { formula1: l = "" } = r, u = S(l) ? this._listCacheService.getOrCompute(
1170
+ o,
1171
+ n,
1172
+ r
1173
+ ).list : Ee(l);
1174
+ return this.parseCellValue(i).every((c) => u.includes(c));
1065
1175
  }
1066
1176
  generateRuleName() {
1067
1177
  return this.localeService.t("dataValidation.list.name");
@@ -1069,41 +1179,60 @@ class ft extends G {
1069
1179
  generateRuleErrorMessage() {
1070
1180
  return this.localeService.t("dataValidation.list.error");
1071
1181
  }
1182
+ _getUnitAndSubUnit(e, t) {
1183
+ var o, n;
1184
+ const r = (o = e ? this._univerInstanceService.getUniverSheetInstance(e) : void 0) != null ? o : this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET);
1185
+ if (!r) return null;
1186
+ const i = (n = t ? r.getSheetBySheetId(t) : void 0) != null ? n : r.getActiveSheet();
1187
+ return i ? {
1188
+ unitId: r.getUnitId(),
1189
+ subUnitId: i.getSheetId()
1190
+ } : null;
1191
+ }
1072
1192
  getList(e, t, r) {
1073
- var g, f, p, R;
1074
- const { formula1: i = "" } = e, s = this.injector.get(O), n = (g = t ? s.getUniverSheetInstance(t) : void 0) != null ? g : s.getCurrentUnitForType(N.UNIVER_SHEET);
1075
- if (!n) return [];
1076
- const l = (f = r ? n.getSheetBySheetId(r) : void 0) != null ? f : n.getActiveSheet();
1077
- if (!l) return [];
1078
- const u = n.getUnitId(), d = l.getSheetId(), c = this.formulaService.getRuleFormulaResultSync(u, d, e.uid);
1079
- return S(i) ? $e((R = (p = c == null ? void 0 : c[0]) == null ? void 0 : p.result) == null ? void 0 : R[0][0]) : _e(i);
1193
+ const i = this._getUnitAndSubUnit(t, r);
1194
+ if (!i) return [];
1195
+ const { unitId: o, subUnitId: n } = i;
1196
+ return this._listCacheService.getOrCompute(
1197
+ o,
1198
+ n,
1199
+ e
1200
+ ).list;
1080
1201
  }
1081
1202
  async getListAsync(e, t, r) {
1082
- var g, f, p, R;
1083
- const { formula1: i = "" } = e, s = this.injector.get(O), n = (g = t ? s.getUniverSheetInstance(t) : void 0) != null ? g : s.getCurrentUnitForType(N.UNIVER_SHEET);
1084
- if (!n) return [];
1085
- const l = (f = r ? n.getSheetBySheetId(r) : void 0) != null ? f : n.getActiveSheet();
1086
- if (!l) return [];
1087
- const u = n.getUnitId(), d = l.getSheetId(), c = await this.formulaService.getRuleFormulaResult(u, d, e.uid);
1088
- return S(i) ? $e((R = (p = c == null ? void 0 : c[0]) == null ? void 0 : p.result) == null ? void 0 : R[0][0]) : _e(i);
1203
+ var d, c;
1204
+ const { formula1: i = "" } = e, o = this._getUnitAndSubUnit(t, r);
1205
+ if (!o) return [];
1206
+ const { unitId: n, subUnitId: l } = o, u = await this.formulaService.getRuleFormulaResult(n, l, e.uid);
1207
+ return S(i) ? ha((c = (d = u == null ? void 0 : u[0]) == null ? void 0 : d.result) == null ? void 0 : c[0][0]) : Ee(i);
1089
1208
  }
1090
1209
  getListWithColor(e, t, r) {
1091
- const i = this.getList(e, t, r), s = (e.formula2 || "").split(",");
1092
- return i.map((n, l) => ({ label: n, color: s[l] }));
1210
+ const i = this._getUnitAndSubUnit(t, r);
1211
+ if (!i) return [];
1212
+ const { unitId: o, subUnitId: n } = i;
1213
+ return this._listCacheService.getOrCompute(
1214
+ o,
1215
+ n,
1216
+ e
1217
+ ).listWithColor;
1093
1218
  }
1094
1219
  getListWithColorMap(e, t, r) {
1095
- const i = this.getListWithColor(e, t, r), s = {};
1096
- return i.forEach((n) => {
1097
- n.color && (s[n.label] = n.color);
1098
- }), s;
1220
+ const i = this._getUnitAndSubUnit(t, r);
1221
+ if (!i) return {};
1222
+ const { unitId: o, subUnitId: n } = i;
1223
+ return this._listCacheService.getOrCompute(
1224
+ o,
1225
+ n,
1226
+ e
1227
+ ).colorMap;
1099
1228
  }
1100
1229
  }
1101
- class ha extends G {
1230
+ class fa extends Y {
1102
1231
  constructor() {
1103
1232
  super(...arguments);
1104
1233
  m(this, "id", T.TEXT_LENGTH);
1105
1234
  m(this, "title", "dataValidation.textLength.title");
1106
- m(this, "_lexerTreeBuilder", this.injector.get(Y));
1235
+ m(this, "_lexerTreeBuilder", this.injector.get(X));
1107
1236
  m(this, "order", 30);
1108
1237
  m(this, "operators", [
1109
1238
  h.BETWEEN,
@@ -1116,10 +1245,10 @@ class ha extends G {
1116
1245
  h.NOT_EQUAL
1117
1246
  ]);
1118
1247
  m(this, "scopes", ["sheet"]);
1119
- m(this, "_customFormulaService", this.injector.get(H));
1248
+ m(this, "_customFormulaService", this.injector.get(W));
1120
1249
  }
1121
1250
  _isFormulaOrInt(e) {
1122
- return !E.isBlank(e) && (S(e) || !Number.isNaN(+e) && Number.isInteger(+e));
1251
+ return !M.isBlank(e) && (S(e) || !Number.isNaN(+e) && Number.isInteger(+e));
1123
1252
  }
1124
1253
  validatorFormula(e, t, r) {
1125
1254
  const i = e.operator;
@@ -1127,21 +1256,21 @@ class ha extends G {
1127
1256
  return {
1128
1257
  success: !1
1129
1258
  };
1130
- const s = E.isDefine(e.formula1) && this._isFormulaOrInt(e.formula1), n = E.isDefine(e.formula2) && this._isFormulaOrInt(e.formula2), l = be.includes(i), u = this.localeService.t("dataValidation.validFail.number");
1259
+ const o = M.isDefine(e.formula1) && this._isFormulaOrInt(e.formula1), n = M.isDefine(e.formula2) && this._isFormulaOrInt(e.formula2), l = Be.includes(i), u = this.localeService.t("dataValidation.validFail.number");
1131
1260
  return l ? {
1132
- success: s && n,
1133
- formula1: s ? void 0 : u,
1261
+ success: o && n,
1262
+ formula1: o ? void 0 : u,
1134
1263
  formula2: n ? void 0 : u
1135
1264
  } : {
1136
- success: s,
1265
+ success: o,
1137
1266
  formula1: u
1138
1267
  };
1139
1268
  }
1140
1269
  _parseNumber(e) {
1141
1270
  return e == null ? Number.NaN : +e;
1142
1271
  }
1143
- async parseFormula(e, t, r, i, s) {
1144
- const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, s), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, s), { formula1: u, formula2: d } = e, c = C(String(n == null ? void 0 : n.v)) && C(String(l == null ? void 0 : l.v));
1272
+ async parseFormula(e, t, r, i, o) {
1273
+ const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, o), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, o), { formula1: u, formula2: d } = e, c = F(String(n == null ? void 0 : n.v)) && F(String(l == null ? void 0 : l.v));
1145
1274
  return {
1146
1275
  formula1: this._parseNumber(S(u) ? n == null ? void 0 : n.v : u),
1147
1276
  formula2: this._parseNumber(S(d) ? l == null ? void 0 : l.v : d),
@@ -1161,110 +1290,110 @@ class ha extends G {
1161
1290
  generateRuleErrorMessage(e, t) {
1162
1291
  if (!e.operator)
1163
1292
  return this.titleStr;
1164
- const { transformedFormula1: r, transformedFormula2: i } = Le(this._lexerTreeBuilder, e, t);
1165
- return `${this.localeService.t(bt[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
1293
+ const { transformedFormula1: r, transformedFormula2: i } = Ue(this._lexerTreeBuilder, e, t);
1294
+ return `${this.localeService.t(Lt[e.operator]).replace(ue, r != null ? r : "").replace(de, i != null ? i : "")}`;
1166
1295
  }
1167
1296
  }
1168
- function _t(o) {
1297
+ function vt(s) {
1169
1298
  var e, t;
1170
- return o ? o.p ? !((t = (e = o.p.body) == null ? void 0 : e.dataStream) != null ? t : "").slice(0, -2).trim() : E.isBlank(o.v) : !0;
1299
+ return s ? s.p ? !((t = (e = s.p.body) == null ? void 0 : e.dataStream) != null ? t : "").slice(0, -2).trim() : M.isBlank(s.v) : !0;
1171
1300
  }
1172
- function Ue(o, a, e, t, r = "command", i = !0) {
1173
- const s = t.get(Y), n = t.get(q), l = [], u = [], d = t.get(F), c = t.get(O), g = ze(c, { unitId: o, subUnitId: a });
1301
+ function xe(s, a, e, t, r = "command", i = !0) {
1302
+ const o = t.get(X), n = t.get(G), l = [], u = [], d = t.get(C), c = t.get(I), g = ze(c, { unitId: s, subUnitId: a });
1174
1303
  if (!g)
1175
1304
  return {
1176
1305
  redoMutations: l,
1177
1306
  undoMutations: u
1178
1307
  };
1179
- const { worksheet: f } = g, p = new Se();
1308
+ const { worksheet: _ } = g, f = new Me();
1180
1309
  let R = !1;
1181
- function V(_, w) {
1182
- i && _.forEach(($) => {
1183
- L.foreach($, (B, k) => {
1184
- const x = f.getCellRaw(B, k), J = pt(x);
1185
- (_t(x) || J === w) && !(x != null && x.p) && (R = !0, p.setValue(B, k, {
1186
- v: w,
1310
+ function E(p, O) {
1311
+ i && p.forEach(($) => {
1312
+ U.foreach($, (P, k) => {
1313
+ const H = _.getCellRaw(P, k), J = ft(H);
1314
+ (vt(H) || J === O) && !(H != null && H.p) && (R = !0, f.setValue(P, k, {
1315
+ v: O,
1187
1316
  p: null
1188
1317
  }));
1189
1318
  });
1190
1319
  });
1191
1320
  }
1192
- if (e.forEach((_) => {
1193
- switch (_.type) {
1321
+ if (e.forEach((p) => {
1322
+ switch (p.type) {
1194
1323
  case "delete":
1195
1324
  l.push({
1196
1325
  id: A.id,
1197
1326
  params: {
1198
- unitId: o,
1327
+ unitId: s,
1199
1328
  subUnitId: a,
1200
- ruleId: _.rule.uid,
1329
+ ruleId: p.rule.uid,
1201
1330
  source: r
1202
1331
  }
1203
1332
  }), u.unshift({
1204
1333
  id: D.id,
1205
1334
  params: {
1206
- unitId: o,
1335
+ unitId: s,
1207
1336
  subUnitId: a,
1208
- rule: _.rule,
1209
- index: _.index,
1337
+ rule: p.rule,
1338
+ index: p.index,
1210
1339
  source: r
1211
1340
  }
1212
1341
  });
1213
1342
  break;
1214
1343
  case "update": {
1215
- if (de(_.rule.type, n)) {
1216
- const $ = _.oldRanges[0].startRow, B = _.oldRanges[0].startColumn, k = _.newRanges[0].startRow, x = _.newRanges[0].startColumn, J = k - $, ce = x - B, he = S(_.rule.formula1) ? s.moveFormulaRefOffset(_.rule.formula1, ce, J) : _.rule.formula1, me = S(_.rule.formula2) ? s.moveFormulaRefOffset(_.rule.formula2, ce, J) : _.rule.formula2;
1217
- he !== _.rule.formula1 || me !== _.rule.formula2 || !nt(_.newRanges, _.oldRanges) ? (l.push({
1344
+ if (he(p.rule.type, n)) {
1345
+ const $ = p.oldRanges[0].startRow, P = p.oldRanges[0].startColumn, k = p.newRanges[0].startRow, H = p.newRanges[0].startColumn, J = k - $, me = H - P, ge = S(p.rule.formula1) ? o.moveFormulaRefOffset(p.rule.formula1, me, J) : p.rule.formula1, pe = S(p.rule.formula2) ? o.moveFormulaRefOffset(p.rule.formula2, me, J) : p.rule.formula2;
1346
+ ge !== p.rule.formula1 || pe !== p.rule.formula2 || !lt(p.newRanges, p.oldRanges) ? (l.push({
1218
1347
  id: y.id,
1219
1348
  params: {
1220
- unitId: o,
1349
+ unitId: s,
1221
1350
  subUnitId: a,
1222
- ruleId: _.ruleId,
1351
+ ruleId: p.ruleId,
1223
1352
  payload: {
1224
- type: M.ALL,
1353
+ type: V.ALL,
1225
1354
  payload: {
1226
- formula1: he,
1227
- formula2: me,
1228
- ranges: _.newRanges
1355
+ formula1: ge,
1356
+ formula2: pe,
1357
+ ranges: p.newRanges
1229
1358
  }
1230
1359
  }
1231
1360
  }
1232
1361
  }), u.unshift({
1233
1362
  id: y.id,
1234
1363
  params: {
1235
- unitId: o,
1364
+ unitId: s,
1236
1365
  subUnitId: a,
1237
- ruleId: _.ruleId,
1366
+ ruleId: p.ruleId,
1238
1367
  payload: {
1239
- type: M.ALL,
1368
+ type: V.ALL,
1240
1369
  payload: {
1241
- formula1: _.rule.formula1,
1242
- formula2: _.rule.formula2,
1243
- ranges: _.oldRanges
1370
+ formula1: p.rule.formula1,
1371
+ formula2: p.rule.formula2,
1372
+ ranges: p.oldRanges
1244
1373
  }
1245
1374
  }
1246
1375
  }
1247
1376
  })) : (l.push({
1248
1377
  id: y.id,
1249
1378
  params: {
1250
- unitId: o,
1379
+ unitId: s,
1251
1380
  subUnitId: a,
1252
- ruleId: _.ruleId,
1381
+ ruleId: p.ruleId,
1253
1382
  payload: {
1254
- type: M.RANGE,
1255
- payload: _.newRanges
1383
+ type: V.RANGE,
1384
+ payload: p.newRanges
1256
1385
  },
1257
1386
  source: r
1258
1387
  }
1259
1388
  }), u.unshift({
1260
1389
  id: y.id,
1261
1390
  params: {
1262
- unitId: o,
1391
+ unitId: s,
1263
1392
  subUnitId: a,
1264
- ruleId: _.ruleId,
1393
+ ruleId: p.ruleId,
1265
1394
  payload: {
1266
- type: M.RANGE,
1267
- payload: _.oldRanges
1395
+ type: V.RANGE,
1396
+ payload: p.oldRanges
1268
1397
  },
1269
1398
  source: r
1270
1399
  }
@@ -1273,32 +1402,32 @@ function Ue(o, a, e, t, r = "command", i = !0) {
1273
1402
  l.push({
1274
1403
  id: y.id,
1275
1404
  params: {
1276
- unitId: o,
1405
+ unitId: s,
1277
1406
  subUnitId: a,
1278
- ruleId: _.ruleId,
1407
+ ruleId: p.ruleId,
1279
1408
  payload: {
1280
- type: M.RANGE,
1281
- payload: _.newRanges
1409
+ type: V.RANGE,
1410
+ payload: p.newRanges
1282
1411
  },
1283
1412
  source: r
1284
1413
  }
1285
1414
  }), u.unshift({
1286
1415
  id: y.id,
1287
1416
  params: {
1288
- unitId: o,
1417
+ unitId: s,
1289
1418
  subUnitId: a,
1290
- ruleId: _.ruleId,
1419
+ ruleId: p.ruleId,
1291
1420
  payload: {
1292
- type: M.RANGE,
1293
- payload: _.oldRanges
1421
+ type: V.RANGE,
1422
+ payload: p.oldRanges
1294
1423
  },
1295
1424
  source: r
1296
1425
  }
1297
1426
  });
1298
- const w = d.getRuleById(o, a, _.ruleId);
1299
- if (w && w.type === T.CHECKBOX) {
1300
- const B = d.getValidator(T.CHECKBOX).parseFormulaSync(w, o, a);
1301
- V(_.newRanges, B.formula2);
1427
+ const O = d.getRuleById(s, a, p.ruleId);
1428
+ if (O && O.type === T.CHECKBOX) {
1429
+ const P = d.getValidator(T.CHECKBOX).parseFormulaSync(O, s, a);
1430
+ E(p.newRanges, P.formula2);
1302
1431
  }
1303
1432
  break;
1304
1433
  }
@@ -1306,70 +1435,70 @@ function Ue(o, a, e, t, r = "command", i = !0) {
1306
1435
  if (l.push({
1307
1436
  id: D.id,
1308
1437
  params: {
1309
- unitId: o,
1438
+ unitId: s,
1310
1439
  subUnitId: a,
1311
- rule: _.rule,
1440
+ rule: p.rule,
1312
1441
  source: r
1313
1442
  }
1314
1443
  }), u.unshift({
1315
1444
  id: A.id,
1316
1445
  params: {
1317
- unitId: o,
1446
+ unitId: s,
1318
1447
  subUnitId: a,
1319
- ruleId: _.rule.uid,
1448
+ ruleId: p.rule.uid,
1320
1449
  source: r
1321
1450
  }
1322
- }), _.rule.type === T.CHECKBOX) {
1323
- const $ = d.getValidator(T.CHECKBOX).parseFormulaSync(_.rule, o, a);
1324
- V(_.rule.ranges, $.originFormula2);
1451
+ }), p.rule.type === T.CHECKBOX) {
1452
+ const $ = d.getValidator(T.CHECKBOX).parseFormulaSync(p.rule, s, a);
1453
+ E(p.rule.ranges, $.originFormula2);
1325
1454
  }
1326
1455
  break;
1327
1456
  }
1328
1457
  }
1329
1458
  }), R) {
1330
- const _ = {
1331
- id: se.id,
1459
+ const p = {
1460
+ id: ne.id,
1332
1461
  params: {
1333
- unitId: o,
1462
+ unitId: s,
1334
1463
  subUnitId: a,
1335
- cellValue: p.getData()
1464
+ cellValue: f.getData()
1336
1465
  }
1337
- }, w = {
1338
- id: se.id,
1339
- params: dt(t, _.params)
1466
+ }, O = {
1467
+ id: ne.id,
1468
+ params: ct(t, p.params)
1340
1469
  };
1341
- l.push(_), u.push(w);
1470
+ l.push(p), u.push(O);
1342
1471
  }
1343
1472
  return {
1344
1473
  redoMutations: l,
1345
1474
  undoMutations: u
1346
1475
  };
1347
1476
  }
1348
- const ma = {
1477
+ const _a = {
1349
1478
  type: z.COMMAND,
1350
1479
  id: "sheet.command.updateDataValidationRuleRange",
1351
- handler(o, a) {
1480
+ handler(s, a) {
1352
1481
  if (!a)
1353
1482
  return !1;
1354
- const { unitId: e, subUnitId: t, ranges: r, ruleId: i } = a, s = o.get(F), n = o.get(U), l = o.get(Z);
1355
- if (!s.getRuleById(e, t, i))
1483
+ const { unitId: e, subUnitId: t, ranges: r, ruleId: i } = a, o = s.get(C), n = s.get(B), l = s.get(Z);
1484
+ if (!o.getRuleById(e, t, i))
1356
1485
  return !1;
1357
- const d = s.getRuleObjectMatrix(e, t).clone();
1486
+ const d = o.getRuleObjectMatrix(e, t).clone();
1358
1487
  d.updateRange(i, r);
1359
- const c = d.diff(s.getRules(e, t)), { redoMutations: g, undoMutations: f } = Ue(e, t, c, o);
1488
+ const c = d.diff(o.getRules(e, t)), { redoMutations: g, undoMutations: _ } = xe(e, t, c, s);
1360
1489
  return l.pushUndoRedo({
1361
- undoMutations: f,
1490
+ undoMutations: _,
1362
1491
  redoMutations: g,
1363
1492
  unitID: e
1364
- }), Ae(g, n), !0;
1493
+ }), Le(g, n), !0;
1365
1494
  }
1366
- }, ga = {
1495
+ }, va = {
1367
1496
  type: z.COMMAND,
1368
1497
  id: "sheet.command.addDataValidation",
1369
- handler(o, a) {
1498
+ handler(s, a) {
1370
1499
  if (!a)
1371
1500
  return !1;
1372
- const { unitId: e, subUnitId: t, rule: r } = a, i = o.get(F), s = o.get(U), n = o.get(Z), l = i.getRuleObjectMatrix(e, t).clone();
1501
+ const { unitId: e, subUnitId: t, rule: r } = a, i = s.get(C), o = s.get(B), n = s.get(Z), l = i.getRuleObjectMatrix(e, t).clone();
1373
1502
  l.addRule(r);
1374
1503
  const u = l.diff(i.getRules(e, t)), d = i.getValidator(r.type), c = {
1375
1504
  unitId: e,
@@ -1378,11 +1507,11 @@ const ma = {
1378
1507
  ...r,
1379
1508
  ...d == null ? void 0 : d.normalizeFormula(r, e, t)
1380
1509
  }
1381
- }, { redoMutations: g, undoMutations: f } = Ue(e, t, u, o);
1510
+ }, { redoMutations: g, undoMutations: _ } = xe(e, t, u, s);
1382
1511
  return g.push({
1383
1512
  id: D.id,
1384
1513
  params: c
1385
- }), f.unshift({
1514
+ }), _.unshift({
1386
1515
  id: A.id,
1387
1516
  params: {
1388
1517
  unitId: e,
@@ -1392,104 +1521,104 @@ const ma = {
1392
1521
  }), n.pushUndoRedo({
1393
1522
  unitID: e,
1394
1523
  redoMutations: g,
1395
- undoMutations: f
1396
- }), Ae(g, s), !0;
1524
+ undoMutations: _
1525
+ }), Le(g, o), !0;
1397
1526
  }
1398
- }, pa = {
1527
+ }, Ra = {
1399
1528
  type: z.COMMAND,
1400
1529
  id: "sheets.command.update-data-validation-setting",
1401
1530
  // eslint-disable-next-line max-lines-per-function
1402
- handler(o, a) {
1531
+ handler(s, a) {
1403
1532
  if (!a)
1404
1533
  return !1;
1405
- const e = o.get(U), t = o.get(Z), r = o.get(F), i = o.get(q), { unitId: s, subUnitId: n, ruleId: l, setting: u } = a, d = i.getValidatorItem(u.type);
1534
+ const e = s.get(B), t = s.get(Z), r = s.get(C), i = s.get(G), { unitId: o, subUnitId: n, ruleId: l, setting: u } = a, d = i.getValidatorItem(u.type);
1406
1535
  if (!d)
1407
1536
  return !1;
1408
- const c = r.getRuleById(s, n, l);
1537
+ const c = r.getRuleById(o, n, l);
1409
1538
  if (!c)
1410
1539
  return !1;
1411
1540
  const g = { ...c, ...u };
1412
- if (!d.validatorFormula(g, s, n).success)
1541
+ if (!d.validatorFormula(g, o, n).success)
1413
1542
  return !1;
1414
- const f = {
1415
- unitId: s,
1543
+ const _ = {
1544
+ unitId: o,
1416
1545
  subUnitId: n,
1417
1546
  ruleId: l,
1418
1547
  payload: {
1419
- type: M.SETTING,
1548
+ type: V.SETTING,
1420
1549
  payload: {
1421
1550
  ...u,
1422
- ...d.normalizeFormula(g, s, n)
1551
+ ...d.normalizeFormula(g, o, n)
1423
1552
  }
1424
1553
  }
1425
- }, p = [{
1554
+ }, f = [{
1426
1555
  id: y.id,
1427
- params: f
1556
+ params: _
1428
1557
  }], R = {
1429
- unitId: s,
1558
+ unitId: o,
1430
1559
  subUnitId: n,
1431
1560
  ruleId: l,
1432
1561
  payload: {
1433
- type: M.SETTING,
1434
- payload: Lt(c)
1562
+ type: V.SETTING,
1563
+ payload: Ut(c)
1435
1564
  }
1436
- }, V = [{
1565
+ }, E = [{
1437
1566
  id: y.id,
1438
1567
  params: R
1439
1568
  }];
1440
1569
  if (u.type === T.CHECKBOX) {
1441
- const w = c.ranges, $ = o.get(O), B = ze($, { unitId: s, subUnitId: n });
1442
- if (B) {
1443
- const k = new Se(), { worksheet: x } = B, { formula2: J = Ve, formula1: ce = Ee } = c, { formula2: he = Ve, formula1: me = Ee } = u;
1444
- let Be = !1;
1445
- if (w.forEach((ge) => {
1446
- L.foreach(ge, (ae, xe) => {
1447
- const j = x.getCellRaw(ae, xe), Je = pt(j);
1448
- (_t(j) || Je === String(J)) && !(j != null && j.p) ? (k.setValue(ae, xe, {
1449
- v: he,
1570
+ const O = c.ranges, $ = s.get(I), P = ze($, { unitId: o, subUnitId: n });
1571
+ if (P) {
1572
+ const k = new Me(), { worksheet: H } = P, { formula2: J = ye, formula1: me = Ve } = c, { formula2: ge = ye, formula1: pe = Ve } = u;
1573
+ let Pe = !1;
1574
+ if (O.forEach((fe) => {
1575
+ U.foreach(fe, (ie, He) => {
1576
+ const j = H.getCellRaw(ie, He), Je = ft(j);
1577
+ (vt(j) || Je === String(J)) && !(j != null && j.p) ? (k.setValue(ie, He, {
1578
+ v: ge,
1450
1579
  p: null
1451
- }), Be = !0) : Je === String(ce) && !(j != null && j.p) && (k.setValue(ae, xe, {
1452
- v: me,
1580
+ }), Pe = !0) : Je === String(me) && !(j != null && j.p) && (k.setValue(ie, He, {
1581
+ v: pe,
1453
1582
  p: null
1454
- }), Be = !0);
1583
+ }), Pe = !0);
1455
1584
  });
1456
- }), Be) {
1457
- const ge = {
1458
- id: se.id,
1585
+ }), Pe) {
1586
+ const fe = {
1587
+ id: ne.id,
1459
1588
  params: {
1460
- unitId: s,
1589
+ unitId: o,
1461
1590
  subUnitId: n,
1462
1591
  cellValue: k.getData()
1463
1592
  }
1464
- }, ae = {
1465
- id: se.id,
1466
- params: dt(o, ge.params)
1593
+ }, ie = {
1594
+ id: ne.id,
1595
+ params: ct(s, fe.params)
1467
1596
  };
1468
- p.push(ge), V.push(ae);
1597
+ f.push(fe), E.push(ie);
1469
1598
  }
1470
1599
  }
1471
1600
  }
1472
- return Ae(p, e).result ? (t.pushUndoRedo({
1473
- unitID: s,
1474
- redoMutations: p,
1475
- undoMutations: V
1601
+ return Le(f, e).result ? (t.pushUndoRedo({
1602
+ unitID: o,
1603
+ redoMutations: f,
1604
+ undoMutations: E
1476
1605
  }), !0) : !1;
1477
1606
  }
1478
- }, fa = {
1607
+ }, Sa = {
1479
1608
  type: z.COMMAND,
1480
1609
  id: "sheets.command.update-data-validation-options",
1481
- handler(o, a) {
1610
+ handler(s, a) {
1482
1611
  if (!a)
1483
1612
  return !1;
1484
- const e = o.get(U), t = o.get(Z), r = o.get(F), { unitId: i, subUnitId: s, ruleId: n, options: l } = a, u = r.getRuleById(i, s, n);
1613
+ const e = s.get(B), t = s.get(Z), r = s.get(C), { unitId: i, subUnitId: o, ruleId: n, options: l } = a, u = r.getRuleById(i, o, n);
1485
1614
  if (!u)
1486
1615
  return !1;
1487
1616
  const d = {
1488
1617
  unitId: i,
1489
- subUnitId: s,
1618
+ subUnitId: o,
1490
1619
  ruleId: n,
1491
1620
  payload: {
1492
- type: M.OPTIONS,
1621
+ type: V.OPTIONS,
1493
1622
  payload: l
1494
1623
  }
1495
1624
  }, c = [{
@@ -1497,46 +1626,46 @@ const ma = {
1497
1626
  params: d
1498
1627
  }], g = {
1499
1628
  unitId: i,
1500
- subUnitId: s,
1629
+ subUnitId: o,
1501
1630
  ruleId: n,
1502
1631
  payload: {
1503
- type: M.OPTIONS,
1504
- payload: Ut(u)
1632
+ type: V.OPTIONS,
1633
+ payload: Bt(u)
1505
1634
  }
1506
- }, f = [{
1635
+ }, _ = [{
1507
1636
  id: y.id,
1508
1637
  params: g
1509
1638
  }];
1510
1639
  return t.pushUndoRedo({
1511
1640
  unitID: i,
1512
1641
  redoMutations: c,
1513
- undoMutations: f
1642
+ undoMutations: _
1514
1643
  }), e.executeCommand(y.id, d), !0;
1515
1644
  }
1516
- }, _a = {
1645
+ }, Ea = {
1517
1646
  type: z.COMMAND,
1518
1647
  id: "sheets.command.clear-range-data-validation",
1519
- handler(o, a) {
1648
+ handler(s, a) {
1520
1649
  if (!a)
1521
1650
  return !1;
1522
- const { unitId: e, subUnitId: t, ranges: r } = a, i = o.get(U), s = o.get(O), n = ze(s, { unitId: e, subUnitId: t }), l = o.get(F);
1651
+ const { unitId: e, subUnitId: t, ranges: r } = a, i = s.get(B), o = s.get(I), n = ze(o, { unitId: e, subUnitId: t }), l = s.get(C);
1523
1652
  if (!n) return !1;
1524
- const u = o.get(Z), d = l.getRuleObjectMatrix(e, t).clone();
1653
+ const u = s.get(Z), d = l.getRuleObjectMatrix(e, t).clone();
1525
1654
  d.removeRange(r);
1526
- const c = d.diff(l.getRules(e, t)), { redoMutations: g, undoMutations: f } = Ue(e, t, c, o);
1655
+ const c = d.diff(l.getRules(e, t)), { redoMutations: g, undoMutations: _ } = xe(e, t, c, s);
1527
1656
  return u.pushUndoRedo({
1528
1657
  unitID: e,
1529
1658
  redoMutations: g,
1530
- undoMutations: f
1531
- }), Ae(g, i).result;
1659
+ undoMutations: _
1660
+ }), Le(g, i).result;
1532
1661
  }
1533
- }, Ra = {
1662
+ }, Ma = {
1534
1663
  type: z.COMMAND,
1535
1664
  id: "sheet.command.remove-all-data-validation",
1536
- handler(o, a) {
1665
+ handler(s, a) {
1537
1666
  if (!a)
1538
1667
  return !1;
1539
- const { unitId: e, subUnitId: t } = a, r = o.get(U), i = o.get(F), s = o.get(Z), n = [...i.getRules(e, t)], l = {
1668
+ const { unitId: e, subUnitId: t } = a, r = s.get(B), i = s.get(C), o = s.get(Z), n = [...i.getRules(e, t)], l = {
1540
1669
  unitId: e,
1541
1670
  subUnitId: t,
1542
1671
  ruleId: n.map((c) => c.uid)
@@ -1551,14 +1680,14 @@ const ma = {
1551
1680
  rule: n
1552
1681
  }
1553
1682
  }];
1554
- return s.pushUndoRedo({
1683
+ return o.pushUndoRedo({
1555
1684
  redoMutations: u,
1556
1685
  undoMutations: d,
1557
1686
  unitID: e
1558
1687
  }), r.executeCommand(A.id, l), !0;
1559
1688
  }
1560
- }, va = (o, a) => {
1561
- const e = o.get(F), { unitId: t, subUnitId: r, ruleId: i, source: s } = a;
1689
+ }, Va = (s, a) => {
1690
+ const e = s.get(C), { unitId: t, subUnitId: r, ruleId: i, source: o } = a;
1562
1691
  if (Array.isArray(i)) {
1563
1692
  const l = i.map((u) => e.getRuleById(t, r, u)).filter(Boolean);
1564
1693
  return [{
@@ -1567,7 +1696,7 @@ const ma = {
1567
1696
  unitId: t,
1568
1697
  subUnitId: r,
1569
1698
  rule: l,
1570
- source: s
1699
+ source: o
1571
1700
  }
1572
1701
  }];
1573
1702
  }
@@ -1582,13 +1711,13 @@ const ma = {
1582
1711
  index: e.getRuleIndex(t, r, i)
1583
1712
  }
1584
1713
  }];
1585
- }, Sa = {
1714
+ }, ya = {
1586
1715
  type: z.COMMAND,
1587
1716
  id: "sheet.command.remove-data-validation-rule",
1588
- handler(o, a) {
1717
+ handler(s, a) {
1589
1718
  if (!a)
1590
1719
  return !1;
1591
- const { unitId: e, subUnitId: t, ruleId: r } = a, i = o.get(U), s = o.get(Z), n = o.get(F), l = [{
1720
+ const { unitId: e, subUnitId: t, ruleId: r } = a, i = s.get(B), o = s.get(Z), n = s.get(C), l = [{
1592
1721
  id: A.id,
1593
1722
  params: a
1594
1723
  }], u = [{
@@ -1602,70 +1731,70 @@ const ma = {
1602
1731
  index: n.getRuleIndex(e, t, r)
1603
1732
  }
1604
1733
  }];
1605
- return s.pushUndoRedo({
1734
+ return o.pushUndoRedo({
1606
1735
  undoMutations: u,
1607
1736
  redoMutations: l,
1608
1737
  unitID: a.unitId
1609
1738
  }), i.executeCommand(A.id, a), !0;
1610
1739
  }
1611
- }, Ea = "SHEET_DATA_VALIDATION_PLUGIN";
1612
- var Rt = /* @__PURE__ */ ((o) => (o[o.View = 0] = "View", o[o.Edit = 1] = "Edit", o[o.ManageCollaborator = 2] = "ManageCollaborator", o[o.Print = 3] = "Print", o[o.Duplicate = 4] = "Duplicate", o[o.Comment = 5] = "Comment", o[o.Copy = 6] = "Copy", o[o.Share = 7] = "Share", o[o.Export = 8] = "Export", o[o.MoveWorksheet = 9] = "MoveWorksheet", o[o.DeleteWorksheet = 10] = "DeleteWorksheet", o[o.HideWorksheet = 11] = "HideWorksheet", o[o.RenameWorksheet = 12] = "RenameWorksheet", o[o.CreateWorksheet = 13] = "CreateWorksheet", o[o.SetWorksheetStyle = 14] = "SetWorksheetStyle", o[o.EditWorksheetCell = 15] = "EditWorksheetCell", o[o.InsertHyperlink = 16] = "InsertHyperlink", o[o.Sort = 17] = "Sort", o[o.Filter = 18] = "Filter", o[o.PivotTable = 19] = "PivotTable", o[o.FloatImg = 20] = "FloatImg", o[o.History = 21] = "History", o[o.RwHgtClWdt = 22] = "RwHgtClWdt", o[o.ViemRwHgtClWdt = 23] = "ViemRwHgtClWdt", o[o.ViewFilter = 24] = "ViewFilter", o[o.MoveSheet = 25] = "MoveSheet", o[o.DeleteSheet = 26] = "DeleteSheet", o[o.HideSheet = 27] = "HideSheet", o[o.CopySheet = 28] = "CopySheet", o[o.RenameSheet = 29] = "RenameSheet", o[o.CreateSheet = 30] = "CreateSheet", o[o.SelectProtectedCells = 31] = "SelectProtectedCells", o[o.SelectUnProtectedCells = 32] = "SelectUnProtectedCells", o[o.SetCellStyle = 33] = "SetCellStyle", o[o.SetCellValue = 34] = "SetCellValue", o[o.SetRowStyle = 35] = "SetRowStyle", o[o.SetColumnStyle = 36] = "SetColumnStyle", o[o.InsertRow = 37] = "InsertRow", o[o.InsertColumn = 38] = "InsertColumn", o[o.DeleteRow = 39] = "DeleteRow", o[o.DeleteColumn = 40] = "DeleteColumn", o[o.EditExtraObject = 41] = "EditExtraObject", o[o.Delete = 42] = "Delete", o[o.RecoverHistory = 43] = "RecoverHistory", o[o.ViewHistory = 44] = "ViewHistory", o[o.CreatePermissionObject = 45] = "CreatePermissionObject", o[o.UNRECOGNIZED = -1] = "UNRECOGNIZED", o))(Rt || {}), Va = Object.getOwnPropertyDescriptor, Ma = (o, a, e, t) => {
1613
- for (var r = t > 1 ? void 0 : t ? Va(a, e) : a, i = o.length - 1, s; i >= 0; i--)
1614
- (s = o[i]) && (r = s(r) || r);
1740
+ }, Ta = "SHEET_DATA_VALIDATION_PLUGIN";
1741
+ var Rt = /* @__PURE__ */ ((s) => (s[s.View = 0] = "View", s[s.Edit = 1] = "Edit", s[s.ManageCollaborator = 2] = "ManageCollaborator", s[s.Print = 3] = "Print", s[s.Duplicate = 4] = "Duplicate", s[s.Comment = 5] = "Comment", s[s.Copy = 6] = "Copy", s[s.Share = 7] = "Share", s[s.Export = 8] = "Export", s[s.MoveWorksheet = 9] = "MoveWorksheet", s[s.DeleteWorksheet = 10] = "DeleteWorksheet", s[s.HideWorksheet = 11] = "HideWorksheet", s[s.RenameWorksheet = 12] = "RenameWorksheet", s[s.CreateWorksheet = 13] = "CreateWorksheet", s[s.SetWorksheetStyle = 14] = "SetWorksheetStyle", s[s.EditWorksheetCell = 15] = "EditWorksheetCell", s[s.InsertHyperlink = 16] = "InsertHyperlink", s[s.Sort = 17] = "Sort", s[s.Filter = 18] = "Filter", s[s.PivotTable = 19] = "PivotTable", s[s.FloatImg = 20] = "FloatImg", s[s.History = 21] = "History", s[s.RwHgtClWdt = 22] = "RwHgtClWdt", s[s.ViemRwHgtClWdt = 23] = "ViemRwHgtClWdt", s[s.ViewFilter = 24] = "ViewFilter", s[s.MoveSheet = 25] = "MoveSheet", s[s.DeleteSheet = 26] = "DeleteSheet", s[s.HideSheet = 27] = "HideSheet", s[s.CopySheet = 28] = "CopySheet", s[s.RenameSheet = 29] = "RenameSheet", s[s.CreateSheet = 30] = "CreateSheet", s[s.SelectProtectedCells = 31] = "SelectProtectedCells", s[s.SelectUnProtectedCells = 32] = "SelectUnProtectedCells", s[s.SetCellStyle = 33] = "SetCellStyle", s[s.SetCellValue = 34] = "SetCellValue", s[s.SetRowStyle = 35] = "SetRowStyle", s[s.SetColumnStyle = 36] = "SetColumnStyle", s[s.InsertRow = 37] = "InsertRow", s[s.InsertColumn = 38] = "InsertColumn", s[s.DeleteRow = 39] = "DeleteRow", s[s.DeleteColumn = 40] = "DeleteColumn", s[s.EditExtraObject = 41] = "EditExtraObject", s[s.Delete = 42] = "Delete", s[s.RecoverHistory = 43] = "RecoverHistory", s[s.ViewHistory = 44] = "ViewHistory", s[s.CreatePermissionObject = 45] = "CreatePermissionObject", s[s.UNRECOGNIZED = -1] = "UNRECOGNIZED", s))(Rt || {}), Fa = Object.getOwnPropertyDescriptor, Ca = (s, a, e, t) => {
1742
+ for (var r = t > 1 ? void 0 : t ? Fa(a, e) : a, i = s.length - 1, o; i >= 0; i--)
1743
+ (o = s[i]) && (r = o(r) || r);
1615
1744
  return r;
1616
- }, ke = (o, a) => (e, t) => a(e, t, o);
1617
- let Te = class extends W {
1618
- constructor(o, a, e) {
1619
- super(), this._univerInstanceService = o, this._permissionService = a, this._lexerTreeBuilder = e;
1745
+ }, je = (s, a) => (e, t) => a(e, t, s);
1746
+ let Ce = class extends x {
1747
+ constructor(s, a, e) {
1748
+ super(), this._univerInstanceService = s, this._permissionService = a, this._lexerTreeBuilder = e;
1620
1749
  }
1621
- getFormulaRefCheck(o) {
1750
+ getFormulaRefCheck(s) {
1622
1751
  var e, t;
1623
- const a = this._lexerTreeBuilder.sequenceNodesBuilder(o);
1752
+ const a = this._lexerTreeBuilder.sequenceNodesBuilder(s);
1624
1753
  if (!a)
1625
1754
  return !0;
1626
1755
  for (let r = 0; r < a.length; r++) {
1627
1756
  const i = a[r];
1628
1757
  if (typeof i == "string")
1629
1758
  continue;
1630
- const { token: s } = i, n = Wt(s), l = this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET);
1759
+ const { token: o } = i, n = $t(o), l = this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET);
1631
1760
  let u = l.getActiveSheet();
1632
1761
  const d = l.getUnitId();
1633
1762
  if (n.sheetName) {
1634
1763
  if (u = l.getSheetBySheetName(n.sheetName), !u)
1635
1764
  return !1;
1636
1765
  const R = u == null ? void 0 : u.getSheetId();
1637
- if (!this._permissionService.getPermissionPoint(new kt(d, R).id)) return !1;
1766
+ if (!this._permissionService.getPermissionPoint(new jt(d, R).id)) return !1;
1638
1767
  }
1639
1768
  if (!u)
1640
1769
  return !1;
1641
- const { startRow: c, endRow: g, startColumn: f, endColumn: p } = n.range;
1770
+ const { startRow: c, endRow: g, startColumn: _, endColumn: f } = n.range;
1642
1771
  for (let R = c; R <= g; R++)
1643
- for (let V = f; V <= p; V++) {
1644
- const _ = (t = (e = u.getCell(R, V)) == null ? void 0 : e.selectionProtection) == null ? void 0 : t[0];
1645
- if ((_ == null ? void 0 : _[Rt.View]) === !1)
1772
+ for (let E = _; E <= f; E++) {
1773
+ const p = (t = (e = u.getCell(R, E)) == null ? void 0 : e.selectionProtection) == null ? void 0 : t[0];
1774
+ if ((p == null ? void 0 : p[Rt.View]) === !1)
1646
1775
  return !1;
1647
1776
  }
1648
1777
  }
1649
1778
  return !0;
1650
1779
  }
1651
1780
  };
1652
- Te = Ma([
1653
- ke(0, O),
1654
- ke(1, Tt),
1655
- ke(2, v(Y))
1656
- ], Te);
1657
- const ya = "sheets-data-validation.config", it = {};
1658
- var Ta = Object.getOwnPropertyDescriptor, Fa = (o, a, e, t) => {
1659
- for (var r = t > 1 ? void 0 : t ? Ta(a, e) : a, i = o.length - 1, s; i >= 0; i--)
1660
- (s = o[i]) && (r = s(r) || r);
1781
+ Ce = Ca([
1782
+ je(0, I),
1783
+ je(1, Ft),
1784
+ je(2, v(X))
1785
+ ], Ce);
1786
+ const Na = "sheets-data-validation.config", st = {};
1787
+ var Oa = Object.getOwnPropertyDescriptor, wa = (s, a, e, t) => {
1788
+ for (var r = t > 1 ? void 0 : t ? Oa(a, e) : a, i = s.length - 1, o; i >= 0; i--)
1789
+ (o = s[i]) && (r = o(r) || r);
1661
1790
  return r;
1662
- }, je = (o, a) => (e, t) => a(e, t, o);
1663
- let Fe = class extends W {
1791
+ }, Qe = (s, a) => (e, t) => a(e, t, s);
1792
+ let Ne = class extends x {
1664
1793
  constructor(a, e, t) {
1665
1794
  super();
1666
1795
  m(this, "_disposableMap", /* @__PURE__ */ new Map());
1667
1796
  m(this, "registerRule", (a, e, t) => {
1668
- de(t.type, this._validatorRegistryService) && this.register(a, e, t);
1797
+ he(t.type, this._validatorRegistryService) && this.register(a, e, t);
1669
1798
  });
1670
1799
  this._dataValidationModel = a, this._formulaRefRangeService = e, this._validatorRegistryService = t, this._initRefRange();
1671
1800
  }
@@ -1674,7 +1803,7 @@ let Fe = class extends W {
1674
1803
  }
1675
1804
  // eslint-disable-next-line max-lines-per-function
1676
1805
  register(a, e, t) {
1677
- const r = t.ranges, i = t.formula1, s = t.formula2, n = this._formulaRefRangeService.registerRangeFormula(a, e, r, [i != null ? i : "", s != null ? s : ""], (u) => {
1806
+ const r = t.ranges, i = t.formula1, o = t.formula2, n = this._formulaRefRangeService.registerRangeFormula(a, e, r, [i != null ? i : "", o != null ? o : ""], (u) => {
1678
1807
  if (u.length === 0)
1679
1808
  return {
1680
1809
  undos: [{
@@ -1704,7 +1833,7 @@ let Fe = class extends W {
1704
1833
  subUnitId: e,
1705
1834
  ruleId: t.uid,
1706
1835
  payload: {
1707
- type: M.ALL,
1836
+ type: V.ALL,
1708
1837
  payload: {
1709
1838
  ranges: g.ranges,
1710
1839
  formula1: g.formulas[0],
@@ -1720,18 +1849,18 @@ let Fe = class extends W {
1720
1849
  subUnitId: e,
1721
1850
  ruleId: t.uid,
1722
1851
  payload: {
1723
- type: M.ALL,
1852
+ type: V.ALL,
1724
1853
  payload: {
1725
1854
  ranges: r,
1726
1855
  formula1: i,
1727
- formula2: s
1856
+ formula2: o
1728
1857
  }
1729
1858
  },
1730
1859
  source: "patched"
1731
1860
  }
1732
1861
  });
1733
- for (let f = 1; f < u.length; f++) {
1734
- const p = u[f], R = Ye();
1862
+ for (let _ = 1; _ < u.length; _++) {
1863
+ const f = u[_], R = Xe();
1735
1864
  d.push({
1736
1865
  id: D.id,
1737
1866
  params: {
@@ -1740,9 +1869,9 @@ let Fe = class extends W {
1740
1869
  rule: {
1741
1870
  ...t,
1742
1871
  uid: R,
1743
- formula1: p.formulas[0],
1744
- formula2: p.formulas[1],
1745
- ranges: p.ranges
1872
+ formula1: f.formulas[0],
1873
+ formula2: f.formulas[1],
1874
+ ranges: f.ranges
1746
1875
  },
1747
1876
  source: "patched"
1748
1877
  }
@@ -1767,54 +1896,54 @@ let Fe = class extends W {
1767
1896
  const a = this._dataValidationModel.getAll();
1768
1897
  for (const [e, t] of a)
1769
1898
  for (const [r, i] of t)
1770
- for (const s of i)
1771
- this.registerRule(e, r, s);
1899
+ for (const o of i)
1900
+ this.registerRule(e, r, o);
1772
1901
  this.disposeWithMe(
1773
1902
  this._dataValidationModel.ruleChange$.subscribe((e) => {
1774
1903
  const { unitId: t, subUnitId: r, rule: i } = e;
1775
1904
  switch (e.type) {
1776
1905
  case "add": {
1777
- const s = e.rule;
1778
- this.registerRule(e.unitId, e.subUnitId, s);
1906
+ const o = e.rule;
1907
+ this.registerRule(e.unitId, e.subUnitId, o);
1779
1908
  break;
1780
1909
  }
1781
1910
  case "remove": {
1782
- const s = this._disposableMap.get(this._getIdWithUnitId(t, r, i.uid));
1783
- s && s.dispose();
1911
+ const o = this._disposableMap.get(this._getIdWithUnitId(t, r, i.uid));
1912
+ o && o.dispose();
1784
1913
  break;
1785
1914
  }
1786
1915
  case "update": {
1787
- const s = e.rule, n = this._disposableMap.get(this._getIdWithUnitId(t, r, s.uid));
1788
- n && n.dispose(), this.registerRule(e.unitId, e.subUnitId, s);
1916
+ const o = e.rule, n = this._disposableMap.get(this._getIdWithUnitId(t, r, o.uid));
1917
+ n && n.dispose(), this.registerRule(e.unitId, e.subUnitId, o);
1789
1918
  break;
1790
1919
  }
1791
1920
  }
1792
1921
  })
1793
- ), this.disposeWithMe(Xe(() => {
1922
+ ), this.disposeWithMe(Ke(() => {
1794
1923
  this._disposableMap.forEach((e) => {
1795
1924
  e.dispose();
1796
1925
  }), this._disposableMap.clear();
1797
1926
  }));
1798
1927
  }
1799
1928
  };
1800
- Fe = Fa([
1801
- je(0, v(F)),
1802
- je(1, v(gt)),
1803
- je(2, v(q))
1804
- ], Fe);
1805
- var Na = Object.getOwnPropertyDescriptor, Ca = (o, a, e, t) => {
1806
- for (var r = t > 1 ? void 0 : t ? Na(a, e) : a, i = o.length - 1, s; i >= 0; i--)
1807
- (s = o[i]) && (r = s(r) || r);
1929
+ Ne = wa([
1930
+ Qe(0, v(C)),
1931
+ Qe(1, v(pt)),
1932
+ Qe(2, v(G))
1933
+ ], Ne);
1934
+ var Aa = Object.getOwnPropertyDescriptor, Ia = (s, a, e, t) => {
1935
+ for (var r = t > 1 ? void 0 : t ? Aa(a, e) : a, i = s.length - 1, o; i >= 0; i--)
1936
+ (o = s[i]) && (r = o(r) || r);
1808
1937
  return r;
1809
- }, ee = (o, a) => (e, t) => a(e, t, o);
1810
- let Ne = class extends W {
1811
- constructor(a, e, t, r, i, s) {
1938
+ }, te = (s, a) => (e, t) => a(e, t, s);
1939
+ let Oe = class extends x {
1940
+ constructor(a, e, t, r, i, o) {
1812
1941
  super();
1813
1942
  m(this, "_disposableMap", /* @__PURE__ */ new Map());
1814
1943
  m(this, "registerRule", (a, e, t) => {
1815
- de(t.type, this._validatorRegistryService) || (this.register(a, e, t), this.registerFormula(a, e, t));
1944
+ he(t.type, this._validatorRegistryService) || (this.register(a, e, t), this.registerFormula(a, e, t));
1816
1945
  });
1817
- this._dataValidationModel = a, this._injector = e, this._refRangeService = t, this._dataValidationFormulaService = r, this._formulaRefRangeService = i, this._validatorRegistryService = s, this._initRefRange();
1946
+ this._dataValidationModel = a, this._injector = e, this._refRangeService = t, this._dataValidationFormulaService = r, this._formulaRefRangeService = i, this._validatorRegistryService = o, this._initRefRange();
1818
1947
  }
1819
1948
  _getIdWithUnitId(a, e, t) {
1820
1949
  return `${a}_${e}_${t}`;
@@ -1822,19 +1951,19 @@ let Ne = class extends W {
1822
1951
  // eslint-disable-next-line max-lines-per-function
1823
1952
  registerFormula(a, e, t) {
1824
1953
  var u;
1825
- const r = t.uid, i = this._getIdWithUnitId(a, e, r), s = (u = this._disposableMap.get(i)) != null ? u : /* @__PURE__ */ new Set(), n = (d, c) => {
1954
+ const r = t.uid, i = this._getIdWithUnitId(a, e, r), o = (u = this._disposableMap.get(i)) != null ? u : /* @__PURE__ */ new Set(), n = (d, c) => {
1826
1955
  const g = this._dataValidationModel.getRuleById(a, e, r);
1827
1956
  if (!g)
1828
1957
  return { redos: [], undos: [] };
1829
- const f = g[d];
1830
- if (!f || f === c)
1958
+ const _ = g[d];
1959
+ if (!_ || _ === c)
1831
1960
  return { redos: [], undos: [] };
1832
- const p = {
1961
+ const f = {
1833
1962
  unitId: a,
1834
1963
  subUnitId: e,
1835
1964
  ruleId: t.uid,
1836
1965
  payload: {
1837
- type: M.SETTING,
1966
+ type: V.SETTING,
1838
1967
  payload: {
1839
1968
  type: g.type,
1840
1969
  formula1: g.formula1,
@@ -1848,7 +1977,7 @@ let Ne = class extends W {
1848
1977
  subUnitId: e,
1849
1978
  ruleId: t.uid,
1850
1979
  payload: {
1851
- type: M.SETTING,
1980
+ type: V.SETTING,
1852
1981
  payload: {
1853
1982
  type: g.type,
1854
1983
  formula1: g.formula1,
@@ -1856,18 +1985,18 @@ let Ne = class extends W {
1856
1985
  }
1857
1986
  },
1858
1987
  source: "patched"
1859
- }, V = [
1988
+ }, E = [
1860
1989
  {
1861
1990
  id: y.id,
1862
- params: p
1991
+ params: f
1863
1992
  }
1864
- ], _ = [
1993
+ ], p = [
1865
1994
  {
1866
1995
  id: y.id,
1867
1996
  params: R
1868
1997
  }
1869
1998
  ];
1870
- return { redos: V, undos: _ };
1999
+ return { redos: E, undos: p };
1871
2000
  }, l = this._dataValidationFormulaService.getRuleFormulaInfo(a, e, r);
1872
2001
  if (l) {
1873
2002
  const [d, c] = l;
@@ -1876,132 +2005,132 @@ let Ne = class extends W {
1876
2005
  a,
1877
2006
  e,
1878
2007
  d.text,
1879
- (f) => n("formula1", f)
2008
+ (_) => n("formula1", _)
1880
2009
  );
1881
- s.add(() => g.dispose());
2010
+ o.add(() => g.dispose());
1882
2011
  }
1883
2012
  if (c) {
1884
2013
  const g = this._formulaRefRangeService.registerFormula(
1885
2014
  a,
1886
2015
  e,
1887
2016
  c.text,
1888
- (f) => n("formula2", f)
2017
+ (_) => n("formula2", _)
1889
2018
  );
1890
- s.add(() => g.dispose());
2019
+ o.add(() => g.dispose());
1891
2020
  }
1892
2021
  }
1893
2022
  }
1894
2023
  register(a, e, t) {
1895
2024
  var l;
1896
2025
  const r = (u) => {
1897
- const d = [...t.ranges], g = d.map((p) => Qt(p, u)).filter((p) => !!p).flat();
1898
- if (nt(g, d))
2026
+ const d = [...t.ranges], g = d.map((f) => qt(f, u)).filter((f) => !!f).flat();
2027
+ if (lt(g, d))
1899
2028
  return { redos: [], undos: [] };
1900
2029
  if (g.length) {
1901
- const p = {
2030
+ const f = {
1902
2031
  unitId: a,
1903
2032
  subUnitId: e,
1904
2033
  ruleId: t.uid,
1905
2034
  payload: {
1906
- type: M.RANGE,
2035
+ type: V.RANGE,
1907
2036
  payload: g
1908
2037
  },
1909
2038
  source: "patched"
1910
- }, R = [{ id: y.id, params: p }], V = [{
2039
+ }, R = [{ id: y.id, params: f }], E = [{
1911
2040
  id: y.id,
1912
2041
  params: {
1913
2042
  unitId: a,
1914
2043
  subUnitId: e,
1915
2044
  ruleId: t.uid,
1916
2045
  payload: {
1917
- type: M.RANGE,
2046
+ type: V.RANGE,
1918
2047
  payload: d
1919
2048
  },
1920
2049
  source: "patched"
1921
2050
  }
1922
2051
  }];
1923
- return { redos: R, undos: V };
2052
+ return { redos: R, undos: E };
1924
2053
  } else {
1925
- const p = { unitId: a, subUnitId: e, ruleId: t.uid }, R = [{ id: A.id, params: p }], V = va(this._injector, p);
1926
- return { redos: R, undos: V };
2054
+ const f = { unitId: a, subUnitId: e, ruleId: t.uid }, R = [{ id: A.id, params: f }], E = Va(this._injector, f);
2055
+ return { redos: R, undos: E };
1927
2056
  }
1928
2057
  }, i = [];
1929
2058
  t.ranges.forEach((u) => {
1930
2059
  const d = this._refRangeService.registerRefRange(u, r, a, e);
1931
2060
  i.push(() => d.dispose());
1932
2061
  });
1933
- const s = this._getIdWithUnitId(a, e, t.uid), n = (l = this._disposableMap.get(s)) != null ? l : /* @__PURE__ */ new Set();
1934
- n.add(() => i.forEach((u) => u())), this._disposableMap.set(s, n);
2062
+ const o = this._getIdWithUnitId(a, e, t.uid), n = (l = this._disposableMap.get(o)) != null ? l : /* @__PURE__ */ new Set();
2063
+ n.add(() => i.forEach((u) => u())), this._disposableMap.set(o, n);
1935
2064
  }
1936
2065
  _initRefRange() {
1937
2066
  const a = this._dataValidationModel.getAll();
1938
2067
  for (const [e, t] of a)
1939
2068
  for (const [r, i] of t)
1940
- for (const s of i)
1941
- this.registerRule(e, r, s);
2069
+ for (const o of i)
2070
+ this.registerRule(e, r, o);
1942
2071
  this.disposeWithMe(
1943
2072
  this._dataValidationModel.ruleChange$.subscribe((e) => {
1944
2073
  const { unitId: t, subUnitId: r, rule: i } = e;
1945
2074
  switch (e.type) {
1946
2075
  case "add": {
1947
- const s = e.rule;
1948
- this.registerRule(e.unitId, e.subUnitId, s);
2076
+ const o = e.rule;
2077
+ this.registerRule(e.unitId, e.subUnitId, o);
1949
2078
  break;
1950
2079
  }
1951
2080
  case "remove": {
1952
- const s = this._disposableMap.get(this._getIdWithUnitId(t, r, i.uid));
1953
- s && s.forEach((n) => n());
2081
+ const o = this._disposableMap.get(this._getIdWithUnitId(t, r, i.uid));
2082
+ o && o.forEach((n) => n());
1954
2083
  break;
1955
2084
  }
1956
2085
  case "update": {
1957
- const s = e.rule, n = this._disposableMap.get(this._getIdWithUnitId(t, r, s.uid));
1958
- n && n.forEach((l) => l()), this.registerRule(e.unitId, e.subUnitId, s);
2086
+ const o = e.rule, n = this._disposableMap.get(this._getIdWithUnitId(t, r, o.uid));
2087
+ n && n.forEach((l) => l()), this.registerRule(e.unitId, e.subUnitId, o);
1959
2088
  break;
1960
2089
  }
1961
2090
  }
1962
2091
  })
1963
- ), this.disposeWithMe(Xe(() => {
2092
+ ), this.disposeWithMe(Ke(() => {
1964
2093
  this._disposableMap.forEach((e) => {
1965
2094
  e.forEach((t) => t());
1966
2095
  }), this._disposableMap.clear();
1967
2096
  }));
1968
2097
  }
1969
2098
  };
1970
- Ne = Ca([
1971
- ee(0, v(F)),
1972
- ee(1, v(Ke)),
1973
- ee(2, v(jt)),
1974
- ee(3, v(K)),
1975
- ee(4, v(gt)),
1976
- ee(5, v(q))
1977
- ], Ne);
1978
- var Oa = Object.getOwnPropertyDescriptor, wa = (o, a, e, t) => {
1979
- for (var r = t > 1 ? void 0 : t ? Oa(a, e) : a, i = o.length - 1, s; i >= 0; i--)
1980
- (s = o[i]) && (r = s(r) || r);
2099
+ Oe = Ia([
2100
+ te(0, v(C)),
2101
+ te(1, v(be)),
2102
+ te(2, v(Qt)),
2103
+ te(3, v(q)),
2104
+ te(4, v(pt)),
2105
+ te(5, v(G))
2106
+ ], Oe);
2107
+ var Da = Object.getOwnPropertyDescriptor, ba = (s, a, e, t) => {
2108
+ for (var r = t > 1 ? void 0 : t ? Da(a, e) : a, i = s.length - 1, o; i >= 0; i--)
2109
+ (o = s[i]) && (r = o(r) || r);
1981
2110
  return r;
1982
- }, Qe = (o, a) => (e, t) => a(e, t, o);
1983
- let Ce = class extends W {
1984
- constructor(o, a, e) {
1985
- super(), this._sheetInterceptorService = o, this._univerInstanceService = a, this._sheetDataValidationModel = e, this._initSheetChange();
2111
+ }, qe = (s, a) => (e, t) => a(e, t, s);
2112
+ let we = class extends x {
2113
+ constructor(s, a, e) {
2114
+ super(), this._sheetInterceptorService = s, this._univerInstanceService = a, this._sheetDataValidationModel = e, this._initSheetChange();
1986
2115
  }
1987
2116
  // eslint-disable-next-line max-lines-per-function
1988
2117
  _initSheetChange() {
1989
2118
  this.disposeWithMe(
1990
2119
  this._sheetInterceptorService.interceptCommand({
1991
2120
  // eslint-disable-next-line max-lines-per-function
1992
- getMutations: (o) => {
2121
+ getMutations: (s) => {
1993
2122
  var a;
1994
- if (o.id === qt.id) {
1995
- const e = o.params, t = e.unitId || this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET).getUnitId(), r = this._univerInstanceService.getUniverSheetInstance(t);
2123
+ if (s.id === Gt.id) {
2124
+ const e = s.params, t = e.unitId || this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET).getUnitId(), r = this._univerInstanceService.getUniverSheetInstance(t);
1996
2125
  if (!r)
1997
2126
  return { redos: [], undos: [] };
1998
2127
  const i = e.subUnitId || ((a = r.getActiveSheet()) == null ? void 0 : a.getSheetId());
1999
2128
  if (!i)
2000
2129
  return { redos: [], undos: [] };
2001
- const s = this._sheetDataValidationModel.getRules(t, i);
2002
- if (s.length === 0)
2130
+ const o = this._sheetDataValidationModel.getRules(t, i);
2131
+ if (o.length === 0)
2003
2132
  return { redos: [], undos: [] };
2004
- const n = s.map((d) => d.uid), l = {
2133
+ const n = o.map((d) => d.uid), l = {
2005
2134
  unitId: t,
2006
2135
  subUnitId: i,
2007
2136
  ruleId: n,
@@ -2009,7 +2138,7 @@ let Ce = class extends W {
2009
2138
  }, u = {
2010
2139
  unitId: t,
2011
2140
  subUnitId: i,
2012
- rule: [...s],
2141
+ rule: [...o],
2013
2142
  source: "patched"
2014
2143
  };
2015
2144
  return {
@@ -2022,14 +2151,14 @@ let Ce = class extends W {
2022
2151
  params: u
2023
2152
  }]
2024
2153
  };
2025
- } else if (o.id === Gt.id) {
2026
- const e = o.params, { unitId: t, subUnitId: r, targetSubUnitId: i } = e;
2154
+ } else if (s.id === Yt.id) {
2155
+ const e = s.params, { unitId: t, subUnitId: r, targetSubUnitId: i } = e;
2027
2156
  if (!t || !r || !i)
2028
2157
  return { redos: [], undos: [] };
2029
- const s = this._sheetDataValidationModel.getRules(t, r);
2030
- if (s.length === 0)
2158
+ const o = this._sheetDataValidationModel.getRules(t, r);
2159
+ if (o.length === 0)
2031
2160
  return { redos: [], undos: [] };
2032
- const n = s.map((l) => ({ ...l, uid: Ye(6) }));
2161
+ const n = o.map((l) => ({ ...l, uid: Xe(6) }));
2033
2162
  return {
2034
2163
  redos: [
2035
2164
  {
@@ -2061,12 +2190,12 @@ let Ce = class extends W {
2061
2190
  );
2062
2191
  }
2063
2192
  };
2064
- Ce = wa([
2065
- Qe(0, v(ct)),
2066
- Qe(1, v(O)),
2067
- Qe(2, v(F))
2068
- ], Ce);
2069
- class Ia extends G {
2193
+ we = ba([
2194
+ qe(0, v(ht)),
2195
+ qe(1, v(I)),
2196
+ qe(2, v(C))
2197
+ ], we);
2198
+ class La extends Y {
2070
2199
  constructor() {
2071
2200
  super(...arguments);
2072
2201
  m(this, "id", T.ANY);
@@ -2095,7 +2224,7 @@ class Ia extends G {
2095
2224
  return this.localeService.t("dataValidation.any.error");
2096
2225
  }
2097
2226
  }
2098
- class Aa extends G {
2227
+ class Ua extends Y {
2099
2228
  constructor() {
2100
2229
  super(...arguments);
2101
2230
  m(this, "id", T.CUSTOM);
@@ -2103,12 +2232,12 @@ class Aa extends G {
2103
2232
  m(this, "operators", []);
2104
2233
  m(this, "scopes", ["sheet"]);
2105
2234
  m(this, "order", 60);
2106
- m(this, "_customFormulaService", this.injector.get(H));
2107
- m(this, "_lexerTreeBuilder", this.injector.get(Y));
2235
+ m(this, "_customFormulaService", this.injector.get(W));
2236
+ m(this, "_lexerTreeBuilder", this.injector.get(X));
2108
2237
  }
2109
2238
  validatorFormula(e, t, r) {
2110
2239
  var u;
2111
- const i = S(e.formula1), s = (u = e.formula1) != null ? u : "", l = this._lexerTreeBuilder.checkIfAddBracket(s) === 0 && s.startsWith($t.EQUALS);
2240
+ const i = S(e.formula1), o = (u = e.formula1) != null ? u : "", l = this._lexerTreeBuilder.checkIfAddBracket(o) === 0 && o.startsWith(kt.EQUALS);
2112
2241
  return {
2113
2242
  success: i && l,
2114
2243
  formula1: i && l ? "" : this.localeService.t("dataValidation.validFail.formula")
@@ -2122,8 +2251,8 @@ class Aa extends G {
2122
2251
  };
2123
2252
  }
2124
2253
  async isValidType(e, t, r) {
2125
- const { column: i, row: s, unitId: n, subUnitId: l } = e, u = await this._customFormulaService.getCellFormulaValue(n, l, r.uid, s, i), d = u == null ? void 0 : u.v;
2126
- return C(String(d)) && E.isDefine(d) && d !== "" ? u.t === Ft.BOOLEAN ? !!d : typeof d == "boolean" ? d : typeof d == "number" ? !!d : typeof d == "string" ? C(d) : !!d : !1;
2254
+ const { column: i, row: o, unitId: n, subUnitId: l } = e, u = await this._customFormulaService.getCellFormulaValue(n, l, r.uid, o, i), d = u == null ? void 0 : u.v;
2255
+ return F(String(d)) && M.isDefine(d) && d !== "" ? u.t === Ct.BOOLEAN ? !!d : typeof d == "boolean" ? d : typeof d == "number" ? !!d : typeof d == "string" ? F(d) : !!d : !1;
2127
2256
  }
2128
2257
  generateRuleErrorMessage(e) {
2129
2258
  return this.localeService.t("dataValidation.custom.error");
@@ -2133,7 +2262,7 @@ class Aa extends G {
2133
2262
  return this.localeService.t("dataValidation.custom.ruleName").replace("{FORMULA1}", (t = e.formula1) != null ? t : "");
2134
2263
  }
2135
2264
  }
2136
- class Da extends ft {
2265
+ class Ba extends _t {
2137
2266
  constructor() {
2138
2267
  super(...arguments);
2139
2268
  m(this, "id", T.LIST_MULTIPLE);
@@ -2142,11 +2271,11 @@ class Da extends ft {
2142
2271
  m(this, "skipDefaultFontRender", () => !0);
2143
2272
  }
2144
2273
  }
2145
- class ba extends G {
2274
+ class xa extends Y {
2146
2275
  constructor() {
2147
2276
  super(...arguments);
2148
- m(this, "_customFormulaService", this.injector.get(H));
2149
- m(this, "_lexerTreeBuilder", this.injector.get(Y));
2277
+ m(this, "_customFormulaService", this.injector.get(W));
2278
+ m(this, "_lexerTreeBuilder", this.injector.get(X));
2150
2279
  m(this, "id", T.WHOLE);
2151
2280
  m(this, "title", "dataValidation.whole.title");
2152
2281
  m(this, "order", 10);
@@ -2163,28 +2292,28 @@ class ba extends G {
2163
2292
  m(this, "scopes", ["sheet"]);
2164
2293
  }
2165
2294
  _isFormulaOrInt(e) {
2166
- return !E.isBlank(e) && (S(e) || !Number.isNaN(+e) && Number.isInteger(+e));
2295
+ return !M.isBlank(e) && (S(e) || !Number.isNaN(+e) && Number.isInteger(+e));
2167
2296
  }
2168
2297
  async isValidType(e, t, r) {
2169
- const { value: i } = e, s = ye(i);
2170
- return !Number.isNaN(s) && Number.isInteger(s);
2298
+ const { value: i } = e, o = Fe(i);
2299
+ return !Number.isNaN(o) && Number.isInteger(o);
2171
2300
  }
2172
2301
  transform(e, t, r) {
2173
2302
  const { value: i } = e;
2174
2303
  return {
2175
2304
  ...e,
2176
- value: ye(i)
2305
+ value: Fe(i)
2177
2306
  };
2178
2307
  }
2179
2308
  _parseNumber(e) {
2180
2309
  return e == null ? Number.NaN : +e;
2181
2310
  }
2182
- async parseFormula(e, t, r, i, s) {
2183
- const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, s), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, s), { formula1: u, formula2: d } = e, c = S(u) ? n == null ? void 0 : n.v : u, g = S(d) ? l == null ? void 0 : l.v : d, f = C(`${c}`) && C(`${g}`);
2311
+ async parseFormula(e, t, r, i, o) {
2312
+ const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, o), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, o), { formula1: u, formula2: d } = e, c = S(u) ? n == null ? void 0 : n.v : u, g = S(d) ? l == null ? void 0 : l.v : d, _ = F(`${c}`) && F(`${g}`);
2184
2313
  return {
2185
2314
  formula1: this._parseNumber(c),
2186
2315
  formula2: this._parseNumber(g),
2187
- isFormulaValid: f
2316
+ isFormulaValid: _
2188
2317
  };
2189
2318
  }
2190
2319
  validatorFormula(e, t, r) {
@@ -2193,62 +2322,62 @@ class ba extends G {
2193
2322
  return {
2194
2323
  success: !0
2195
2324
  };
2196
- const s = E.isDefine(e.formula1) && this._isFormulaOrInt(e.formula1), n = E.isDefine(e.formula2) && this._isFormulaOrInt(e.formula2), l = be.includes(i), u = this.localeService.t("dataValidation.validFail.number");
2325
+ const o = M.isDefine(e.formula1) && this._isFormulaOrInt(e.formula1), n = M.isDefine(e.formula2) && this._isFormulaOrInt(e.formula2), l = Be.includes(i), u = this.localeService.t("dataValidation.validFail.number");
2197
2326
  return l ? {
2198
- success: s && n,
2199
- formula1: s ? void 0 : u,
2327
+ success: o && n,
2328
+ formula1: o ? void 0 : u,
2200
2329
  formula2: n ? void 0 : u
2201
2330
  } : {
2202
- success: s,
2331
+ success: o,
2203
2332
  formula1: u
2204
2333
  };
2205
2334
  }
2206
2335
  generateRuleErrorMessage(e, t) {
2207
2336
  if (!e.operator)
2208
- return this.localeService.t(Me.NONE).replace("{TYPE}", this.titleStr);
2209
- const { transformedFormula1: r, transformedFormula2: i } = Le(this._lexerTreeBuilder, e, t);
2210
- return `${this.localeService.t(Me[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
2337
+ return this.localeService.t(Te.NONE).replace("{TYPE}", this.titleStr);
2338
+ const { transformedFormula1: r, transformedFormula2: i } = Ue(this._lexerTreeBuilder, e, t);
2339
+ return `${this.localeService.t(Te[e.operator]).replace(ue, r != null ? r : "").replace(de, i != null ? i : "")}`;
2211
2340
  }
2212
2341
  }
2213
- var La = Object.getOwnPropertyDescriptor, Ua = (o, a, e, t) => {
2214
- for (var r = t > 1 ? void 0 : t ? La(a, e) : a, i = o.length - 1, s; i >= 0; i--)
2215
- (s = o[i]) && (r = s(r) || r);
2342
+ var Pa = Object.getOwnPropertyDescriptor, Ha = (s, a, e, t) => {
2343
+ for (var r = t > 1 ? void 0 : t ? Pa(a, e) : a, i = s.length - 1, o; i >= 0; i--)
2344
+ (o = s[i]) && (r = o(r) || r);
2216
2345
  return r;
2217
- }, te = (o, a) => (e, t) => a(e, t, o);
2218
- let Oe = class extends Nt {
2219
- constructor(o, a, e, t, r, i) {
2220
- super(), this._univerInstanceService = o, this._dataValidatorRegistryService = a, this._injector = e, this._selectionManagerService = t, this._sheetInterceptorService = r, this._sheetDataValidationModel = i, this._init();
2346
+ }, ae = (s, a) => (e, t) => a(e, t, s);
2347
+ let Ae = class extends Nt {
2348
+ constructor(s, a, e, t, r, i) {
2349
+ super(), this._univerInstanceService = s, this._dataValidatorRegistryService = a, this._injector = e, this._selectionManagerService = t, this._sheetInterceptorService = r, this._sheetDataValidationModel = i, this._init();
2221
2350
  }
2222
2351
  _init() {
2223
2352
  this._registerValidators(), this._initCommandInterceptor();
2224
2353
  }
2225
2354
  _registerValidators() {
2226
2355
  [
2227
- Ia,
2228
- la,
2229
- ba,
2230
- ha,
2356
+ La,
2357
+ ca,
2358
+ xa,
2359
+ fa,
2360
+ da,
2231
2361
  na,
2232
- ia,
2233
- ft,
2234
- Da,
2235
- Aa
2236
- ].forEach((o) => {
2237
- const a = this._injector.createInstance(o);
2238
- this.disposeWithMe(this._dataValidatorRegistryService.register(a)), this.disposeWithMe(Xe(() => this._injector.delete(o)));
2362
+ _t,
2363
+ Ba,
2364
+ Ua
2365
+ ].forEach((s) => {
2366
+ const a = this._injector.createInstance(s);
2367
+ this.disposeWithMe(this._dataValidatorRegistryService.register(a)), this.disposeWithMe(Ke(() => this._injector.delete(s)));
2239
2368
  });
2240
2369
  }
2241
2370
  _initCommandInterceptor() {
2242
2371
  this._sheetInterceptorService.interceptCommand({
2243
- getMutations: (o) => {
2372
+ getMutations: (s) => {
2244
2373
  var a;
2245
- if (o.id === Yt.id) {
2374
+ if (s.id === Xt.id) {
2246
2375
  const e = this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET), t = e.getUnitId(), r = e.getActiveSheet();
2247
2376
  if (!r)
2248
2377
  throw new Error("No active sheet found");
2249
- const i = r.getSheetId(), s = (a = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : a.map((c) => c.range), n = this._sheetDataValidationModel.getRuleObjectMatrix(t, i).clone();
2250
- s && n.removeRange(s);
2251
- const l = n.diff(this._sheetDataValidationModel.getRules(t, i)), { redoMutations: u, undoMutations: d } = Ue(t, i, l, this._injector, "patched");
2378
+ const i = r.getSheetId(), o = (a = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : a.map((c) => c.range), n = this._sheetDataValidationModel.getRuleObjectMatrix(t, i).clone();
2379
+ o && n.removeRange(o);
2380
+ const l = n.diff(this._sheetDataValidationModel.getRules(t, i)), { redoMutations: u, undoMutations: d } = xe(t, i, l, this._injector, "patched");
2252
2381
  return {
2253
2382
  undos: d,
2254
2383
  redos: u
@@ -2262,226 +2391,228 @@ let Oe = class extends Nt {
2262
2391
  });
2263
2392
  }
2264
2393
  };
2265
- Oe = Ua([
2266
- te(0, O),
2267
- te(1, v(q)),
2268
- te(2, v(Ke)),
2269
- te(3, v(ht)),
2270
- te(4, v(ct)),
2271
- te(5, v(F))
2272
- ], Oe);
2273
- var Ba = Object.getOwnPropertyDescriptor, xa = (o, a, e, t) => {
2274
- for (var r = t > 1 ? void 0 : t ? Ba(a, e) : a, i = o.length - 1, s; i >= 0; i--)
2275
- (s = o[i]) && (r = s(r) || r);
2394
+ Ae = Ha([
2395
+ ae(0, I),
2396
+ ae(1, v(G)),
2397
+ ae(2, v(be)),
2398
+ ae(3, v(mt)),
2399
+ ae(4, v(ht)),
2400
+ ae(5, v(C))
2401
+ ], Ae);
2402
+ var Wa = Object.getOwnPropertyDescriptor, $a = (s, a, e, t) => {
2403
+ for (var r = t > 1 ? void 0 : t ? Wa(a, e) : a, i = s.length - 1, o; i >= 0; i--)
2404
+ (o = s[i]) && (r = o(r) || r);
2276
2405
  return r;
2277
- }, Re = (o, a) => (e, t) => a(e, t, o);
2278
- let we = class extends W {
2279
- constructor(o, a, e, t) {
2280
- super(), this._univerInstanceService = o, this._sheetDataValidationModel = a, this._dataValidationCacheService = e, this._lifecycleService = t, this._initRecalculate();
2406
+ }, Re = (s, a) => (e, t) => a(e, t, s);
2407
+ let Ie = class extends x {
2408
+ constructor(s, a, e, t) {
2409
+ super(), this._univerInstanceService = s, this._sheetDataValidationModel = a, this._dataValidationCacheService = e, this._lifecycleService = t, this._initRecalculate();
2281
2410
  }
2282
2411
  _initRecalculate() {
2283
- const o = (a) => {
2412
+ const s = (a) => {
2284
2413
  if (a.length === 0)
2285
2414
  return;
2286
2415
  const e = this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET), t = e == null ? void 0 : e.getActiveSheet(), r = {};
2287
2416
  a.flat().forEach((i) => {
2288
2417
  r[i.unitId] || (r[i.unitId] = {}), r[i.unitId][i.subUnitId] || (r[i.unitId][i.subUnitId] = []);
2289
- const s = this._univerInstanceService.getUnit(i.unitId, N.UNIVER_SHEET), n = s == null ? void 0 : s.getSheetBySheetId(i.subUnitId);
2290
- n && r[i.unitId][i.subUnitId].push(...i.ranges.map((l) => L.transformRange(l, n)));
2291
- }), Object.entries(r).forEach(([i, s]) => {
2292
- Object.entries(s).forEach(([n, l]) => {
2418
+ const o = this._univerInstanceService.getUnit(i.unitId, N.UNIVER_SHEET), n = o == null ? void 0 : o.getSheetBySheetId(i.subUnitId);
2419
+ n && r[i.unitId][i.subUnitId].push(...i.ranges.map((l) => U.transformRange(l, n)));
2420
+ }), Object.entries(r).forEach(([i, o]) => {
2421
+ Object.entries(o).forEach(([n, l]) => {
2293
2422
  (e == null ? void 0 : e.getUnitId()) === i && (t == null ? void 0 : t.getSheetId()) === n ? this.validatorRanges(i, n, l) : requestIdleCallback(() => {
2294
2423
  this.validatorRanges(i, n, l);
2295
2424
  });
2296
2425
  });
2297
2426
  });
2298
2427
  };
2299
- this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(Xt(() => this._lifecycleService.lifecycle$.pipe(tt((a) => a === et.Rendered)))).subscribe(o)), this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(tt(() => this._lifecycleService.stage >= et.Rendered), Ot(20)).subscribe(o));
2428
+ this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(Kt(() => this._lifecycleService.lifecycle$.pipe(tt((a) => a === et.Rendered)))).subscribe(s)), this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(tt(() => this._lifecycleService.stage >= et.Rendered), wt(20)).subscribe(s));
2300
2429
  }
2301
- async _validatorByCell(o, a, e, t) {
2302
- const r = o.getUnitId(), i = a.getSheetId();
2303
- if (!E.isDefine(e) || !E.isDefine(t))
2430
+ async _validatorByCell(s, a, e, t) {
2431
+ const r = s.getUnitId(), i = a.getSheetId();
2432
+ if (!M.isDefine(e) || !M.isDefine(t))
2304
2433
  throw new Error(`row or col is not defined, row: ${e}, col: ${t}`);
2305
- const s = this._sheetDataValidationModel.getRuleByLocation(r, i, e, t);
2306
- return s ? new Promise((n) => {
2307
- this._sheetDataValidationModel.validator(s, { unitId: r, subUnitId: i, row: e, col: t, worksheet: a, workbook: o }, (l) => {
2434
+ const o = this._sheetDataValidationModel.getRuleByLocation(r, i, e, t);
2435
+ return o ? new Promise((n) => {
2436
+ this._sheetDataValidationModel.validator(o, { unitId: r, subUnitId: i, row: e, col: t, worksheet: a, workbook: s }, (l) => {
2308
2437
  n(l);
2309
2438
  });
2310
2439
  }) : b.VALID;
2311
2440
  }
2312
- async validatorCell(o, a, e, t) {
2313
- const r = this._univerInstanceService.getUnit(o, N.UNIVER_SHEET);
2441
+ async validatorCell(s, a, e, t) {
2442
+ const r = this._univerInstanceService.getUnit(s, N.UNIVER_SHEET);
2314
2443
  if (!r)
2315
- throw new Error(`cannot find current workbook, unitId: ${o}`);
2444
+ throw new Error(`cannot find current workbook, unitId: ${s}`);
2316
2445
  const i = r.getSheetBySheetId(a);
2317
2446
  if (!i)
2318
2447
  throw new Error(`cannot find current worksheet, sheetId: ${a}`);
2319
2448
  return this._validatorByCell(r, i, e, t);
2320
2449
  }
2321
- validatorRanges(o, a, e) {
2450
+ validatorRanges(s, a, e) {
2322
2451
  if (!e.length)
2323
2452
  return Promise.resolve([]);
2324
- const t = this._univerInstanceService.getUnit(o, N.UNIVER_SHEET);
2453
+ const t = this._univerInstanceService.getUnit(s, N.UNIVER_SHEET);
2325
2454
  if (!t)
2326
- throw new Error(`cannot find current workbook, unitId: ${o}`);
2455
+ throw new Error(`cannot find current workbook, unitId: ${s}`);
2327
2456
  const r = t.getSheetBySheetId(a);
2328
2457
  if (!r)
2329
2458
  throw new Error(`cannot find current worksheet, sheetId: ${a}`);
2330
- const s = this._sheetDataValidationModel.getRules(o, a).map((l) => l.ranges).flat(), n = e.map((l) => s.map((u) => ot(l, u))).flat().filter(Boolean);
2459
+ const o = this._sheetDataValidationModel.getRules(s, a).map((l) => l.ranges).flat(), n = e.map((l) => o.map((u) => ot(l, u))).flat().filter(Boolean);
2331
2460
  return Promise.all(n.map((l) => {
2332
2461
  const u = [];
2333
- return L.foreach(l, (d, c) => {
2462
+ return U.foreach(l, (d, c) => {
2334
2463
  u.push(this._validatorByCell(t, r, d, c));
2335
2464
  }), Promise.all(u);
2336
2465
  }));
2337
2466
  }
2338
- async validatorWorksheet(o, a) {
2339
- const e = this._univerInstanceService.getUnit(o, N.UNIVER_SHEET);
2467
+ async validatorWorksheet(s, a) {
2468
+ const e = this._univerInstanceService.getUnit(s, N.UNIVER_SHEET);
2340
2469
  if (!e)
2341
- throw new Error(`cannot find current workbook, unitId: ${o}`);
2470
+ throw new Error(`cannot find current workbook, unitId: ${s}`);
2342
2471
  const t = e.getSheetBySheetId(a);
2343
2472
  if (!t)
2344
2473
  throw new Error(`cannot find current worksheet, sheetId: ${a}`);
2345
- const r = this._sheetDataValidationModel.getRules(o, a);
2474
+ const r = this._sheetDataValidationModel.getRules(s, a);
2346
2475
  return await Promise.all(
2347
2476
  r.map((i) => Promise.all(
2348
- i.ranges.map((s) => {
2477
+ i.ranges.map((o) => {
2349
2478
  const n = [];
2350
- return L.foreach(s, (l, u) => {
2479
+ return U.foreach(o, (l, u) => {
2351
2480
  n.push(this._validatorByCell(e, t, l, u));
2352
2481
  }), Promise.all(n);
2353
2482
  })
2354
2483
  ))
2355
- ), this._dataValidationCacheService.ensureCache(o, a);
2484
+ ), this._dataValidationCacheService.ensureCache(s, a);
2356
2485
  }
2357
- async validatorWorkbook(o) {
2358
- const a = this._sheetDataValidationModel.getSubUnitIds(o), e = await Promise.all(a.map((r) => this.validatorWorksheet(o, r))), t = {};
2486
+ async validatorWorkbook(s) {
2487
+ const a = this._sheetDataValidationModel.getSubUnitIds(s), e = await Promise.all(a.map((r) => this.validatorWorksheet(s, r))), t = {};
2359
2488
  return e.forEach((r, i) => {
2360
2489
  t[a[i]] = r;
2361
2490
  }), t;
2362
2491
  }
2363
- getDataValidations(o, a, e) {
2364
- const t = this._sheetDataValidationModel.getRuleObjectMatrix(o, a), r = /* @__PURE__ */ new Set();
2365
- return e.forEach((s) => {
2366
- L.foreach(s, (n, l) => {
2492
+ getDataValidations(s, a, e) {
2493
+ const t = this._sheetDataValidationModel.getRuleObjectMatrix(s, a), r = /* @__PURE__ */ new Set();
2494
+ return e.forEach((o) => {
2495
+ U.foreach(o, (n, l) => {
2367
2496
  const u = t.getValue(n, l);
2368
2497
  u && r.add(u);
2369
2498
  });
2370
- }), Array.from(r).map((s) => this._sheetDataValidationModel.getRuleById(o, a, s)).filter(Boolean);
2499
+ }), Array.from(r).map((o) => this._sheetDataValidationModel.getRuleById(s, a, o)).filter(Boolean);
2371
2500
  }
2372
- getDataValidation(o, a, e) {
2373
- return this.getDataValidations(o, a, e)[0];
2501
+ getDataValidation(s, a, e) {
2502
+ return this.getDataValidations(s, a, e)[0];
2374
2503
  }
2375
2504
  };
2376
- we = xa([
2377
- Re(0, O),
2378
- Re(1, v(F)),
2505
+ Ie = $a([
2506
+ Re(0, I),
2507
+ Re(1, v(C)),
2379
2508
  Re(2, v(Q)),
2380
- Re(3, v(Ct))
2381
- ], we);
2382
- var Pa = Object.defineProperty, Ha = Object.getOwnPropertyDescriptor, Wa = (o, a, e) => a in o ? Pa(o, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[a] = e, $a = (o, a, e, t) => {
2383
- for (var r = t > 1 ? void 0 : t ? Ha(a, e) : a, i = o.length - 1, s; i >= 0; i--)
2384
- (s = o[i]) && (r = s(r) || r);
2509
+ Re(3, v(Ot))
2510
+ ], Ie);
2511
+ var ka = Object.defineProperty, ja = Object.getOwnPropertyDescriptor, Qa = (s, a, e) => a in s ? ka(s, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[a] = e, qa = (s, a, e, t) => {
2512
+ for (var r = t > 1 ? void 0 : t ? ja(a, e) : a, i = s.length - 1, o; i >= 0; i--)
2513
+ (o = s[i]) && (r = o(r) || r);
2385
2514
  return r;
2386
- }, qe = (o, a) => (e, t) => a(e, t, o), vt = (o, a, e) => Wa(o, typeof a != "symbol" ? a + "" : a, e);
2387
- let Ie = class extends At {
2388
- constructor(o = it, a, e, t) {
2389
- super(), this._config = o, this._injector = a, this._commandService = e, this._configService = t;
2390
- const { ...r } = Dt(
2515
+ }, Ge = (s, a) => (e, t) => a(e, t, s), St = (s, a, e) => Qa(s, typeof a != "symbol" ? a + "" : a, e);
2516
+ let De = class extends Dt {
2517
+ constructor(s = st, a, e, t) {
2518
+ super(), this._config = s, this._injector = a, this._commandService = e, this._configService = t;
2519
+ const { ...r } = bt(
2391
2520
  {},
2392
- it,
2521
+ st,
2393
2522
  this._config
2394
2523
  );
2395
- this._configService.setConfig(ya, r);
2524
+ this._configService.setConfig(Na, r);
2396
2525
  }
2397
2526
  onStarting() {
2398
2527
  [
2399
2528
  [Q],
2400
- [K],
2401
- [H],
2529
+ [le],
2530
+ [q],
2531
+ [W],
2532
+ [Ie],
2533
+ [C],
2534
+ [Ae],
2535
+ [Ce],
2402
2536
  [we],
2403
- [F],
2404
2537
  [Oe],
2405
- [Te],
2406
- [Ce],
2407
- [Ne],
2408
- [Fe]
2409
- ].forEach((o) => {
2410
- this._injector.add(o);
2538
+ [Ne]
2539
+ ].forEach((s) => {
2540
+ this._injector.add(s);
2411
2541
  }), [
2412
- ga,
2413
- ma,
2414
- pa,
2415
- fa,
2416
- Sa,
2542
+ va,
2543
+ _a,
2417
2544
  Ra,
2418
- _a
2419
- ].forEach((o) => {
2420
- this._commandService.registerCommand(o);
2421
- }), this._injector.get(Q), this._injector.get(we), this._injector.get(Oe), this._injector.get(Fe), this._injector.get(Ne);
2545
+ Sa,
2546
+ ya,
2547
+ Ma,
2548
+ Ea
2549
+ ].forEach((s) => {
2550
+ this._commandService.registerCommand(s);
2551
+ }), this._injector.get(Q), this._injector.get(Ie), this._injector.get(Ae), this._injector.get(Ne), this._injector.get(Oe);
2422
2552
  }
2423
2553
  onReady() {
2424
- this._injector.get(Ce);
2554
+ this._injector.get(we);
2425
2555
  }
2426
2556
  onRendered() {
2427
- this._injector.get(Te);
2557
+ this._injector.get(Ce);
2428
2558
  }
2429
2559
  };
2430
- vt(Ie, "pluginName", Ea);
2431
- vt(Ie, "type", N.UNIVER_SHEET);
2432
- Ie = $a([
2433
- wt(Bt),
2434
- qe(1, v(Ke)),
2435
- qe(2, U),
2436
- qe(3, It)
2437
- ], Ie);
2438
- function Za(o) {
2439
- const e = o.get(ht).getCurrentSelections().map((i) => i.range);
2560
+ St(De, "pluginName", Ta);
2561
+ St(De, "type", N.UNIVER_SHEET);
2562
+ De = qa([
2563
+ At(xt),
2564
+ Ge(1, v(be)),
2565
+ Ge(2, B),
2566
+ Ge(3, It)
2567
+ ], De);
2568
+ function ar(s) {
2569
+ const e = s.get(mt).getCurrentSelections().map((i) => i.range);
2440
2570
  return {
2441
- uid: Ye(6),
2571
+ uid: Xe(6),
2442
2572
  type: T.DECIMAL,
2443
2573
  operator: h.EQUAL,
2444
2574
  formula1: "100",
2445
2575
  ranges: e != null ? e : [{ startColumn: 0, endColumn: 0, startRow: 0, endRow: 0 }]
2446
2576
  };
2447
2577
  }
2448
- const Ja = "data-validation.custom-formula-input", er = "data-validation.formula-input", tr = "data-validation.list-formula-input", ar = "data-validation.checkbox-formula-input";
2578
+ const rr = "data-validation.custom-formula-input", ir = "data-validation.formula-input", sr = "data-validation.list-formula-input", or = "data-validation.checkbox-formula-input";
2449
2579
  export {
2450
- ga as AddSheetDataValidationCommand,
2451
- er as BASE_FORMULA_INPUT_NAME,
2452
- Ee as CHECKBOX_FORMULA_1,
2453
- Ve as CHECKBOX_FORMULA_2,
2454
- ar as CHECKBOX_FORMULA_INPUT_NAME,
2455
- Ja as CUSTOM_FORMULA_INPUT_NAME,
2456
- ia as CheckboxValidator,
2457
- _a as ClearRangeDataValidationCommand,
2458
- Ea as DATA_VALIDATION_PLUGIN_NAME,
2580
+ va as AddSheetDataValidationCommand,
2581
+ ir as BASE_FORMULA_INPUT_NAME,
2582
+ Ve as CHECKBOX_FORMULA_1,
2583
+ ye as CHECKBOX_FORMULA_2,
2584
+ or as CHECKBOX_FORMULA_INPUT_NAME,
2585
+ rr as CUSTOM_FORMULA_INPUT_NAME,
2586
+ na as CheckboxValidator,
2587
+ Ea as ClearRangeDataValidationCommand,
2588
+ Ta as DATA_VALIDATION_PLUGIN_NAME,
2459
2589
  Q as DataValidationCacheService,
2460
- H as DataValidationCustomFormulaService,
2461
- Te as DataValidationFormulaController,
2462
- K as DataValidationFormulaService,
2463
- na as DateValidator,
2464
- tr as LIST_FORMULA_INPUT_NAME,
2465
- Da as ListMultipleValidator,
2466
- ft as ListValidator,
2467
- Ra as RemoveSheetAllDataValidationCommand,
2468
- Sa as RemoveSheetDataValidationCommand,
2469
- F as SheetDataValidationModel,
2470
- we as SheetsDataValidationValidatorService,
2471
- Ie as UniverSheetsDataValidationPlugin,
2472
- fa as UpdateSheetDataValidationOptionsCommand,
2473
- ma as UpdateSheetDataValidationRangeCommand,
2474
- pa as UpdateSheetDataValidationSettingCommand,
2475
- Za as createDefaultNewRule,
2476
- _e as deserializeListOptions,
2477
- ye as getCellValueNumber,
2478
- ne as getCellValueOrigin,
2479
- za as getDataValidationCellValue,
2480
- Ue as getDataValidationDiffMutations,
2481
- pe as getFormulaCellData,
2590
+ W as DataValidationCustomFormulaService,
2591
+ Ce as DataValidationFormulaController,
2592
+ q as DataValidationFormulaService,
2593
+ le as DataValidationListCacheService,
2594
+ da as DateValidator,
2595
+ sr as LIST_FORMULA_INPUT_NAME,
2596
+ Ba as ListMultipleValidator,
2597
+ _t as ListValidator,
2598
+ Ma as RemoveSheetAllDataValidationCommand,
2599
+ ya as RemoveSheetDataValidationCommand,
2600
+ C as SheetDataValidationModel,
2601
+ Ie as SheetsDataValidationValidatorService,
2602
+ De as UniverSheetsDataValidationPlugin,
2603
+ Sa as UpdateSheetDataValidationOptionsCommand,
2604
+ _a as UpdateSheetDataValidationRangeCommand,
2605
+ Ra as UpdateSheetDataValidationSettingCommand,
2606
+ ar as createDefaultNewRule,
2607
+ Ee as deserializeListOptions,
2608
+ Fe as getCellValueNumber,
2609
+ re as getCellValueOrigin,
2610
+ tr as getDataValidationCellValue,
2611
+ xe as getDataValidationDiffMutations,
2612
+ _e as getFormulaCellData,
2482
2613
  oe as getFormulaResult,
2483
- Le as getTransformedFormula,
2484
- C as isLegalFormulaResult,
2485
- Ka as serializeListOptions,
2486
- fe as transformCheckboxValue
2614
+ Ue as getTransformedFormula,
2615
+ F as isLegalFormulaResult,
2616
+ er as serializeListOptions,
2617
+ ve as transformCheckboxValue
2487
2618
  };