@univerjs/sheets-data-validation 0.6.0-nightly.202502141606 → 0.6.0-nightly.202502161605

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -1,32 +1,32 @@
1
- var ft = Object.defineProperty;
2
- var vt = (o, a, e) => a in o ? ft(o, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[a] = e;
3
- var g = (o, a, e) => vt(o, typeof a != "symbol" ? a + "" : a, e);
4
- import { Inject as R, ICommandService as x, IUniverInstanceService as w, Disposable as W, ObjectMatrix as Se, UniverInstanceType as N, Range as b, isFormulaString as S, DataValidationType as T, getOriginCellValue as Rt, RBush as St, debounce as Vt, Rectangle as O, Tools as V, DataValidationStatus as D, WrapStrategy as Re, DataValidationOperator as h, numfmt as j, dayjs as at, DataValidationRenderMode as Be, CommandType as z, IUndoRedoService as Z, sequenceExecute as Oe, isRangesEqual as rt, generateRandomId as Mt, toDisposable as Qe, IPermissionService as yt, Injector as qe, CellValueType as Et, RxDisposable as Tt, LifecycleService as Ft, LifecycleStages as ze, bufferDebounceTime as Nt, DependentOn as Ct, IConfigService as wt, Plugin as It, merge as Ot } from "@univerjs/core";
5
- import { DataValidationModel as Ge, DataValidatorRegistryService as q, UpdateRuleType as y, BaseDataValidator as G, TextLengthErrorTitleMap as At, AddDataValidationMutation as L, RemoveDataValidationMutation as A, UpdateDataValidationMutation as E, getRuleSetting as Dt, getRuleOptions as bt, UniverDataValidationPlugin as Lt } from "@univerjs/data-validation";
6
- import { SetRangeValuesMutation as se, RemoveSheetMutation as it, getSheetCommandTarget as Ye, SetRangeValuesUndoMutationFactory as ot, WorksheetViewPermission as xt, RefRangeService as Bt, handleCommonDefaultRangeChangeWithEffectRefCommands as Ut, SheetInterceptorService as st, RemoveSheetCommand as Ht, SheetsSelectionsService as nt, ClearSelectionAllCommand as Wt } from "@univerjs/sheets";
7
- import { Subject as je, bufferWhen as Pt, filter as Ze } from "rxjs";
1
+ var Rt = Object.defineProperty;
2
+ var St = (s, a, e) => a in s ? Rt(s, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[a] = e;
3
+ var f = (s, a, e) => St(s, typeof a != "symbol" ? a + "" : a, e);
4
+ import { Inject as S, ICommandService as x, IUniverInstanceService as O, Disposable as $, ObjectMatrix as ve, UniverInstanceType as N, Range as b, isFormulaString as v, DataValidationType as T, getOriginCellValue as vt, RBush as Vt, debounce as Mt, Rectangle as I, Tools as V, DataValidationStatus as D, WrapStrategy as Se, DataValidationOperator as h, numfmt as Q, dayjs as at, DataValidationRenderMode as Be, CommandType as z, IUndoRedoService as Z, sequenceExecute as Ie, isRangesEqual as rt, generateRandomId as yt, toDisposable as qe, IPermissionService as Et, Injector as Ge, CellValueType as Tt, RxDisposable as Ft, LifecycleService as Nt, LifecycleStages as ze, bufferDebounceTime as Ct, DependentOn as Ot, Plugin as wt, merge as It, IConfigService as At } from "@univerjs/core";
5
+ import { DataValidationModel as ke, DataValidatorRegistryService as G, UpdateRuleType as y, BaseDataValidator as k, TextLengthErrorTitleMap as Dt, AddDataValidationMutation as L, RemoveDataValidationMutation as A, UpdateDataValidationMutation as E, getRuleSetting as bt, getRuleOptions as Lt, UniverDataValidationPlugin as xt } from "@univerjs/data-validation";
6
+ import { SetRangeValuesMutation as oe, RemoveSheetMutation as it, getSheetCommandTarget as Ye, SetRangeValuesUndoMutationFactory as st, WorksheetViewPermission as Bt, RefRangeService as Ut, handleCommonDefaultRangeChangeWithEffectRefCommands as Pt, SheetInterceptorService as ot, RemoveSheetCommand as $t, SheetsSelectionsService as nt, ClearSelectionAllCommand as Ht } from "@univerjs/sheets";
7
+ import { Subject as Qe, bufferWhen as Wt, filter as Ze } from "rxjs";
8
8
  import { RegisterOtherFormulaService as lt, FormulaRefRangeService as ut } from "@univerjs/sheets-formula";
9
- import { ERROR_TYPE_SET as $t, LexerTreeBuilder as Y, isReferenceString as dt, sequenceNodeType as kt, deserializeRangeWithSheet as jt, deserializeRangeWithSheetWithCache as Qt, operatorToken as qt } from "@univerjs/engine-formula";
10
- const Gt = "SHEET_DATA_VALIDATION_PLUGIN";
11
- var Yt = Object.getOwnPropertyDescriptor, Xt = (o, a, e, t) => {
12
- for (var r = t > 1 ? void 0 : t ? Yt(a, e) : a, i = o.length - 1, s; i >= 0; i--)
13
- (s = o[i]) && (r = s(r) || r);
14
- return r;
15
- }, Je = (o, a) => (e, t) => a(e, t, o);
16
- let Q = class extends W {
9
+ import { ERROR_TYPE_SET as jt, LexerTreeBuilder as Y, isReferenceString as dt, sequenceNodeType as Qt, deserializeRangeWithSheet as qt, deserializeRangeWithSheetWithCache as Gt, operatorToken as kt } from "@univerjs/engine-formula";
10
+ const Yt = "SHEET_DATA_VALIDATION_PLUGIN";
11
+ var Xt = Object.defineProperty, Kt = Object.getOwnPropertyDescriptor, zt = (s, a, e, t) => {
12
+ for (var r = t > 1 ? void 0 : t ? Kt(a, e) : a, i = s.length - 1, o; i >= 0; i--)
13
+ (o = s[i]) && (r = (t ? o(a, e, r) : o(r)) || r);
14
+ return t && r && Xt(a, e, r), r;
15
+ }, Je = (s, a) => (e, t) => a(e, t, s);
16
+ let q = class extends $ {
17
17
  constructor(a, e) {
18
18
  super();
19
- g(this, "_cacheMatrix", /* @__PURE__ */ new Map());
20
- g(this, "_dirtyRanges$", new je());
21
- g(this, "dirtyRanges$", this._dirtyRanges$.asObservable());
19
+ f(this, "_cacheMatrix", /* @__PURE__ */ new Map());
20
+ f(this, "_dirtyRanges$", new Qe());
21
+ f(this, "dirtyRanges$", this._dirtyRanges$.asObservable());
22
22
  this._commandService = a, this._univerInstanceService = e, this._initDirtyRanges(), this._initSheetRemove();
23
23
  }
24
24
  _initDirtyRanges() {
25
25
  this.disposeWithMe(this._commandService.onCommandExecuted((a) => {
26
- if (a.id === se.id) {
26
+ if (a.id === oe.id) {
27
27
  const { cellValue: e, unitId: t, subUnitId: r } = a.params;
28
28
  if (e) {
29
- const i = new Se(e).getDataRange();
29
+ const i = new ve(e).getDataRange();
30
30
  if (i.endRow === -1) return;
31
31
  this.markRangeDirty(t, r, [i]);
32
32
  }
@@ -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 ve(), t.set(e, r)), r;
52
52
  }
53
53
  ensureCache(a, e) {
54
54
  return this._ensureCache(a, e);
@@ -62,16 +62,16 @@ let Q = class extends W {
62
62
  markRangeDirty(a, e, t) {
63
63
  const r = this._ensureCache(a, e);
64
64
  t.forEach((i) => {
65
- b.foreach(i, (s, n) => {
66
- r.setValue(s, n, void 0);
65
+ b.foreach(i, (o, n) => {
66
+ r.setValue(o, n, void 0);
67
67
  });
68
68
  }), this._dirtyRanges$.next({ unitId: a, subUnitId: e, ranges: t });
69
69
  }
70
70
  _deleteRange(a, e, t) {
71
71
  const r = this._ensureCache(a, e);
72
72
  t.forEach((i) => {
73
- b.foreach(i, (s, n) => {
74
- r.realDeleteValue(s, n);
73
+ b.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,39 +79,39 @@ let Q = class extends W {
79
79
  return this._ensureCache(a, e).getValue(t, r);
80
80
  }
81
81
  };
82
- Q = Xt([
83
- Je(0, R(x)),
84
- Je(1, R(w))
85
- ], Q);
86
- function oe(o) {
82
+ q = zt([
83
+ Je(0, S(x)),
84
+ Je(1, S(O))
85
+ ], q);
86
+ function se(s) {
87
87
  var a, e;
88
- return (e = (a = o == null ? void 0 : o[0]) == null ? void 0 : a[0]) == null ? void 0 : e.v;
88
+ return (e = (a = s == null ? void 0 : s[0]) == null ? void 0 : a[0]) == null ? void 0 : e.v;
89
89
  }
90
- function _e(o) {
90
+ function ge(s) {
91
91
  var a;
92
- return (a = o == null ? void 0 : o[0]) == null ? void 0 : a[0];
92
+ return (a = s == null ? void 0 : s[0]) == null ? void 0 : a[0];
93
93
  }
94
- function C(o) {
95
- return !$t.has(o);
94
+ function C(s) {
95
+ return !jt.has(s);
96
96
  }
97
- function de(o, a) {
97
+ function de(s, a) {
98
98
  var t;
99
- const e = a.getValidatorItem(o);
99
+ const e = a.getValidatorItem(s);
100
100
  return (t = e == null ? void 0 : e.offsetFormulaByRange) != null ? t : !1;
101
101
  }
102
- var Kt = Object.getOwnPropertyDescriptor, zt = (o, a, e, t) => {
103
- for (var r = t > 1 ? void 0 : t ? Kt(a, e) : a, i = o.length - 1, s; i >= 0; i--)
104
- (s = o[i]) && (r = s(r) || r);
105
- return r;
106
- }, re = (o, a) => (e, t) => a(e, t, o);
107
- let H = class extends W {
102
+ var Zt = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, ea = (s, a, e, t) => {
103
+ for (var r = t > 1 ? void 0 : t ? Jt(a, e) : a, i = s.length - 1, o; i >= 0; i--)
104
+ (o = s[i]) && (r = (t ? o(a, e, r) : o(r)) || r);
105
+ return t && r && Zt(a, e, r), r;
106
+ }, re = (s, a) => (e, t) => a(e, t, s);
107
+ let P = class extends $ {
108
108
  constructor(a, e, t, r, i) {
109
109
  super();
110
110
  /**
111
111
  * Map of origin formula of rule
112
112
  */
113
- g(this, "_ruleFormulaMap", /* @__PURE__ */ new Map());
114
- g(this, "_ruleFormulaMap2", /* @__PURE__ */ new Map());
113
+ f(this, "_ruleFormulaMap", /* @__PURE__ */ new Map());
114
+ f(this, "_ruleFormulaMap2", /* @__PURE__ */ new Map());
115
115
  this._instanceSrv = a, this._registerOtherFormulaService = e, this._dataValidationModel = t, this._dataValidationCacheService = r, this._validatorRegistryService = i, this._initFormulaResultHandler();
116
116
  }
117
117
  _initFormulaResultHandler() {
@@ -120,8 +120,8 @@ let H = class extends W {
120
120
  const t = a[e];
121
121
  if (this._instanceSrv.getUnitType(e) === N.UNIVER_SHEET)
122
122
  for (const i in t) {
123
- const s = t[i], { ruleFormulaMap: n } = this._ensureMaps(e, i);
124
- s.forEach((l) => {
123
+ const o = t[i], { ruleFormulaMap: n } = this._ensureMaps(e, i);
124
+ o.forEach((l) => {
125
125
  var c, m;
126
126
  const u = n.get((c = l.extra) == null ? void 0 : c.ruleId), d = this._dataValidationModel.getRuleById(e, i, (m = l.extra) == null ? void 0 : m.ruleId);
127
127
  d && u && this._dataValidationCacheService.markRangeDirty(e, i, d.ranges);
@@ -135,25 +135,25 @@ let H = class extends W {
135
135
  t || (t = /* @__PURE__ */ new Map(), this._ruleFormulaMap.set(a, t)), r || (r = /* @__PURE__ */ new Map(), this._ruleFormulaMap2.set(a, r));
136
136
  let i = t.get(e);
137
137
  i || (i = /* @__PURE__ */ new Map(), t.set(e, i));
138
- let s = r.get(e);
139
- return s || (s = /* @__PURE__ */ new Map(), r.set(e, s)), { ruleFormulaMap: i, ruleFormulaMap2: s };
138
+ let o = r.get(e);
139
+ return o || (o = /* @__PURE__ */ new Map(), r.set(e, o)), { ruleFormulaMap: i, ruleFormulaMap2: o };
140
140
  }
141
141
  _registerFormula(a, e, t, r, i) {
142
142
  return this._registerOtherFormulaService.registerFormulaWithRange(a, e, r, i, { ruleId: t });
143
143
  }
144
144
  deleteByRuleId(a, e, t) {
145
- const { ruleFormulaMap: r, ruleFormulaMap2: i } = this._ensureMaps(a, e), s = this._dataValidationModel.getRuleById(a, e, t), n = r.get(t);
146
- if (!s || !n)
145
+ const { ruleFormulaMap: r, ruleFormulaMap2: i } = this._ensureMaps(a, e), o = this._dataValidationModel.getRuleById(a, e, t), n = r.get(t);
146
+ if (!o || !n)
147
147
  return;
148
148
  const l = r.get(t);
149
149
  l && (r.delete(t), this._registerOtherFormulaService.deleteFormula(a, e, [l.formulaId]));
150
150
  const u = i.get(t);
151
151
  u && (i.delete(t), this._registerOtherFormulaService.deleteFormula(a, e, [u.formulaId]));
152
152
  }
153
- _addFormulaByRange(a, e, t, r, i, s) {
154
- const { ruleFormulaMap: n, ruleFormulaMap2: l } = this._ensureMaps(a, e), u = s[0].startRow, d = s[0].startColumn;
155
- if (r && S(r)) {
156
- const c = this._registerFormula(a, e, t, r, s);
153
+ _addFormulaByRange(a, e, t, r, i, o) {
154
+ const { ruleFormulaMap: n, ruleFormulaMap2: l } = this._ensureMaps(a, e), u = o[0].startRow, d = o[0].startColumn;
155
+ if (r && v(r)) {
156
+ const c = this._registerFormula(a, e, t, r, o);
157
157
  n.set(t, {
158
158
  formula: r,
159
159
  originCol: d,
@@ -161,8 +161,8 @@ let H = class extends W {
161
161
  formulaId: c
162
162
  });
163
163
  }
164
- if (i && S(i)) {
165
- const c = this._registerFormula(a, e, t, i, s);
164
+ if (i && v(i)) {
165
+ const c = this._registerFormula(a, e, t, i, o);
166
166
  l.set(t, {
167
167
  formula: i,
168
168
  originCol: d,
@@ -173,63 +173,63 @@ let H = class extends W {
173
173
  }
174
174
  addRule(a, e, t) {
175
175
  if (de(t.type, this._validatorRegistryService)) {
176
- const { ranges: r, formula1: i, formula2: s, uid: n } = t;
177
- this._addFormulaByRange(a, e, n, i, s, r);
176
+ const { ranges: r, formula1: i, formula2: o, uid: n } = t;
177
+ this._addFormulaByRange(a, e, n, i, o, r);
178
178
  }
179
179
  }
180
180
  async getCellFormulaValue(a, e, t, r, i) {
181
- var p, _;
182
- const { ruleFormulaMap: s } = this._ensureMaps(a, e), n = s.get(t);
181
+ var _, g;
182
+ const { ruleFormulaMap: o } = this._ensureMaps(a, e), n = o.get(t);
183
183
  if (!n)
184
184
  return Promise.resolve(void 0);
185
185
  const l = await this._registerOtherFormulaService.getFormulaValue(a, e, n.formulaId), { originRow: u, originCol: d } = n, c = r - u, m = i - d;
186
- return _e((_ = (p = l == null ? void 0 : l.result) == null ? void 0 : p[c]) == null ? void 0 : _[m]);
186
+ return ge((g = (_ = l == null ? void 0 : l.result) == null ? void 0 : _[c]) == null ? void 0 : g[m]);
187
187
  }
188
188
  async getCellFormula2Value(a, e, t, r, i) {
189
- var p, _;
190
- const { ruleFormulaMap2: s } = this._ensureMaps(a, e), n = s.get(t);
189
+ var _, g;
190
+ const { ruleFormulaMap2: o } = this._ensureMaps(a, e), n = o.get(t);
191
191
  if (!n)
192
192
  return Promise.resolve(void 0);
193
193
  const l = await this._registerOtherFormulaService.getFormulaValue(a, e, n.formulaId), { originRow: u, originCol: d } = n, c = r - u, m = i - d;
194
- return _e((_ = (p = l == null ? void 0 : l.result) == null ? void 0 : p[c]) == null ? void 0 : _[m]);
194
+ return ge((g = (_ = l == null ? void 0 : l.result) == null ? void 0 : _[c]) == null ? void 0 : g[m]);
195
195
  }
196
196
  getCellFormulaValueSync(a, e, t, r, i) {
197
- var p, _;
198
- const { ruleFormulaMap: s } = this._ensureMaps(a, e), n = s.get(t);
197
+ var _, g;
198
+ const { ruleFormulaMap: o } = this._ensureMaps(a, e), n = o.get(t);
199
199
  if (!n)
200
200
  return;
201
201
  const l = this._registerOtherFormulaService.getFormulaValueSync(a, e, n.formulaId), { originRow: u, originCol: d } = n, c = r - u, m = i - d;
202
- return _e((_ = (p = l == null ? void 0 : l.result) == null ? void 0 : p[c]) == null ? void 0 : _[m]);
202
+ return ge((g = (_ = l == null ? void 0 : l.result) == null ? void 0 : _[c]) == null ? void 0 : g[m]);
203
203
  }
204
204
  getCellFormula2ValueSync(a, e, t, r, i) {
205
- var p, _;
206
- const { ruleFormulaMap2: s } = this._ensureMaps(a, e), n = s.get(t);
205
+ var _, g;
206
+ const { ruleFormulaMap2: o } = this._ensureMaps(a, e), n = o.get(t);
207
207
  if (!n)
208
208
  return;
209
209
  const l = this._registerOtherFormulaService.getFormulaValueSync(a, e, n.formulaId), { originRow: u, originCol: d } = n, c = r - u, m = i - d;
210
- return _e((_ = (p = l == null ? void 0 : l.result) == null ? void 0 : p[c]) == null ? void 0 : _[m]);
210
+ return ge((g = (_ = l == null ? void 0 : l.result) == null ? void 0 : _[c]) == null ? void 0 : g[m]);
211
211
  }
212
212
  getRuleFormulaInfo(a, e, t) {
213
213
  const { ruleFormulaMap: r } = this._ensureMaps(a, e);
214
214
  return r.get(t);
215
215
  }
216
216
  };
217
- H = zt([
218
- re(0, w),
219
- re(1, R(lt)),
220
- re(2, R(Ge)),
221
- re(3, R(Q)),
222
- re(4, R(q))
223
- ], H);
224
- var Zt = Object.getOwnPropertyDescriptor, Jt = (o, a, e, t) => {
225
- for (var r = t > 1 ? void 0 : t ? Zt(a, e) : a, i = o.length - 1, s; i >= 0; i--)
226
- (s = o[i]) && (r = s(r) || r);
227
- return r;
228
- }, ie = (o, a) => (e, t) => a(e, t, o);
229
- let K = class extends W {
217
+ P = ea([
218
+ re(0, O),
219
+ re(1, S(lt)),
220
+ re(2, S(ke)),
221
+ re(3, S(q)),
222
+ re(4, S(G))
223
+ ], P);
224
+ var ta = Object.defineProperty, aa = Object.getOwnPropertyDescriptor, ra = (s, a, e, t) => {
225
+ for (var r = t > 1 ? void 0 : t ? aa(a, e) : a, i = s.length - 1, o; i >= 0; i--)
226
+ (o = s[i]) && (r = (t ? o(a, e, r) : o(r)) || r);
227
+ return t && r && ta(a, e, r), r;
228
+ }, ie = (s, a) => (e, t) => a(e, t, s);
229
+ let K = class extends $ {
230
230
  constructor(a, e, t, r, i) {
231
231
  super();
232
- g(this, "_formulaRuleMap", /* @__PURE__ */ new Map());
232
+ f(this, "_formulaRuleMap", /* @__PURE__ */ new Map());
233
233
  this._instanceService = a, this._registerOtherFormulaService = e, this._dataValidationCacheService = t, this._dataValidationModel = r, this._validatorRegistryService = i, this._initFormulaResultHandler();
234
234
  }
235
235
  _initFormulaResultHandler() {
@@ -238,8 +238,8 @@ let K = class extends W {
238
238
  const t = a[e];
239
239
  if (this._instanceService.getUnitType(e) === N.UNIVER_SHEET)
240
240
  for (const i in t) {
241
- const s = t[i], n = this._ensureRuleFormulaMap(e, i);
242
- s.forEach((l) => {
241
+ const o = t[i], n = this._ensureRuleFormulaMap(e, i);
242
+ o.forEach((l) => {
243
243
  var u, d;
244
244
  if (n.get((u = l.extra) == null ? void 0 : u.ruleId)) {
245
245
  const c = this._dataValidationModel.getRuleById(e, i, (d = l.extra) == null ? void 0 : d.ruleId);
@@ -262,70 +262,70 @@ let K = class extends W {
262
262
  }
263
263
  addRule(a, e, t) {
264
264
  if (!de(t.type, this._validatorRegistryService) && t.type !== T.CHECKBOX) {
265
- const { formula1: r, formula2: i, uid: s } = t, n = S(r), l = S(i);
265
+ const { formula1: r, formula2: i, uid: o } = t, n = v(r), l = v(i);
266
266
  if (!n && !l)
267
267
  return;
268
268
  const u = this._ensureRuleFormulaMap(a, e), d = [void 0, void 0];
269
269
  if (n) {
270
- const c = this._registerSingleFormula(a, e, r, s);
270
+ const c = this._registerSingleFormula(a, e, r, o);
271
271
  d[0] = { id: c, text: r };
272
272
  }
273
273
  if (l) {
274
- const c = this._registerSingleFormula(a, e, i, s);
274
+ const c = this._registerSingleFormula(a, e, i, o);
275
275
  d[1] = { id: c, text: i };
276
276
  }
277
- u.set(s, d);
277
+ u.set(o, d);
278
278
  }
279
279
  }
280
280
  removeRule(a, e, t) {
281
281
  const i = this._ensureRuleFormulaMap(a, e).get(t);
282
282
  if (!i)
283
283
  return;
284
- const [s, n] = i, l = [s == null ? void 0 : s.id, n == null ? void 0 : n.id].filter(Boolean);
284
+ const [o, n] = i, l = [o == null ? void 0 : o.id, n == null ? void 0 : n.id].filter(Boolean);
285
285
  l.length && this._registerOtherFormulaService.deleteFormula(a, e, l);
286
286
  }
287
287
  getRuleFormulaResult(a, e, t) {
288
288
  const i = this._ensureRuleFormulaMap(a, e).get(t);
289
289
  if (!i)
290
290
  return Promise.resolve(null);
291
- const s = async (n) => n && this._registerOtherFormulaService.getFormulaValue(a, e, n.id);
291
+ const o = async (n) => n && this._registerOtherFormulaService.getFormulaValue(a, e, n.id);
292
292
  return Promise.all([
293
- s(i[0]),
294
- s(i[1])
293
+ o(i[0]),
294
+ o(i[1])
295
295
  ]);
296
296
  }
297
297
  getRuleFormulaResultSync(a, e, t) {
298
298
  const i = this._ensureRuleFormulaMap(a, e).get(t);
299
299
  if (i)
300
- return i.map((s) => {
301
- if (s)
302
- return this._registerOtherFormulaService.getFormulaValueSync(a, e, s.id);
300
+ return i.map((o) => {
301
+ if (o)
302
+ return this._registerOtherFormulaService.getFormulaValueSync(a, e, o.id);
303
303
  });
304
304
  }
305
305
  getRuleFormulaInfo(a, e, t) {
306
306
  return this._ensureRuleFormulaMap(a, e).get(t);
307
307
  }
308
308
  };
309
- K = Jt([
310
- ie(0, w),
311
- ie(1, R(lt)),
312
- ie(2, R(Q)),
313
- ie(3, R(Ge)),
314
- ie(4, R(q))
309
+ K = ra([
310
+ ie(0, O),
311
+ ie(1, S(lt)),
312
+ ie(2, S(q)),
313
+ ie(3, S(ke)),
314
+ ie(4, S(G))
315
315
  ], K);
316
- function ne(o) {
317
- return Rt(o);
316
+ function ne(s) {
317
+ return vt(s);
318
318
  }
319
- function ct(o) {
319
+ function ct(s) {
320
320
  var a;
321
- return String((a = ne(o)) != null ? a : "");
321
+ return String((a = ne(s)) != null ? a : "");
322
322
  }
323
323
  class Xe {
324
324
  constructor(a, e, t, r, i = !1) {
325
- g(this, "_map");
326
- g(this, "_tree", new St());
327
- g(this, "_dirty", !0);
328
- g(this, "_buildTree", () => {
325
+ f(this, "_map");
326
+ f(this, "_tree", new Vt());
327
+ f(this, "_dirty", !0);
328
+ f(this, "_buildTree", () => {
329
329
  if (!this._dirty || this._disableTree)
330
330
  return;
331
331
  this._tree.clear();
@@ -342,7 +342,7 @@ class Xe {
342
342
  });
343
343
  }), this._tree.load(a), this._dirty = !1;
344
344
  });
345
- g(this, "_debonceBuildTree", Vt(this._buildTree, 0));
345
+ f(this, "_debonceBuildTree", Mt(this._buildTree, 0));
346
346
  this._unitId = e, this._subUnitId = t, this._univerInstanceService = r, this._disableTree = i, this._map = a, this._buildTree();
347
347
  }
348
348
  get _worksheet() {
@@ -352,10 +352,10 @@ class Xe {
352
352
  _addRule(a, e) {
353
353
  if (!this._worksheet)
354
354
  return;
355
- const t = O.mergeRanges(e.map((r) => b.transformRange(r, this._worksheet)));
355
+ const t = I.mergeRanges(e.map((r) => b.transformRange(r, this._worksheet)));
356
356
  this._map.forEach((r, i) => {
357
- const s = O.subtractMulti(r, t);
358
- s.length === 0 ? this._map.delete(i) : this._map.set(i, s);
357
+ const o = I.subtractMulti(r, t);
358
+ o.length === 0 ? this._map.delete(i) : this._map.set(i, o);
359
359
  }), this._dirty = !0, this._map.set(a, t), this._debonceBuildTree();
360
360
  }
361
361
  addRule(a) {
@@ -366,7 +366,7 @@ class Xe {
366
366
  return;
367
367
  const e = a.map((t) => b.transformRange(t, this._worksheet));
368
368
  this._map.forEach((t, r) => {
369
- const i = O.subtractMulti(t, e);
369
+ const i = I.subtractMulti(t, e);
370
370
  i.length === 0 ? this._map.delete(r) : this._map.set(r, i);
371
371
  }), this._dirty = !0, this._debonceBuildTree();
372
372
  }
@@ -384,11 +384,11 @@ class Xe {
384
384
  if (!t.length)
385
385
  return;
386
386
  let r = this._map.get(e);
387
- r ? (this._map.set(e, O.mergeRanges([...r, ...t])), r = this._map.get(e)) : (r = t, this._map.set(e, r)), this._map.forEach((i, s) => {
388
- if (s === e)
387
+ 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, o) => {
388
+ if (o === e)
389
389
  return;
390
- const n = O.subtractMulti(i, t);
391
- n.length === 0 ? this._map.delete(s) : this._map.set(s, n);
390
+ const n = I.subtractMulti(i, t);
391
+ n.length === 0 ? this._map.delete(o) : this._map.set(o, n);
392
392
  });
393
393
  }), this._dirty = !0, this._debonceBuildTree();
394
394
  }
@@ -397,14 +397,14 @@ class Xe {
397
397
  let t = 0;
398
398
  return a.forEach((r, i) => {
399
399
  var l;
400
- const s = (l = this._map.get(r.uid)) != null ? l : [], n = r.ranges;
401
- s.length !== 0 && (s.length !== n.length || s.some((u, d) => !O.equals(u, n[d]))) && e.push({
400
+ const o = (l = this._map.get(r.uid)) != null ? l : [], n = r.ranges;
401
+ o.length !== 0 && (o.length !== n.length || o.some((u, d) => !I.equals(u, n[d]))) && e.push({
402
402
  type: "update",
403
403
  ruleId: r.uid,
404
404
  oldRanges: n,
405
- newRanges: O.sort(s),
405
+ newRanges: I.sort(o),
406
406
  rule: r
407
- }), s.length === 0 && (e.push({
407
+ }), o.length === 0 && (e.push({
408
408
  type: "delete",
409
409
  rule: r,
410
410
  index: i - t
@@ -414,28 +414,28 @@ class Xe {
414
414
  diffWithAddition(a, e) {
415
415
  const t = [];
416
416
  let r = 0;
417
- return a.forEach((i, s) => {
417
+ return a.forEach((i, o) => {
418
418
  var u;
419
419
  const n = (u = this._map.get(i.uid)) != null ? u : [], l = i.ranges;
420
- n.length !== 0 && (n.length !== l.length || n.some((d, c) => !O.equals(d, l[c]))) && t.push({
420
+ n.length !== 0 && (n.length !== l.length || n.some((d, c) => !I.equals(d, l[c]))) && t.push({
421
421
  type: "update",
422
422
  ruleId: i.uid,
423
423
  oldRanges: l,
424
- newRanges: O.sort(n),
424
+ newRanges: I.sort(n),
425
425
  rule: i
426
426
  }), n.length === 0 && (t.push({
427
427
  type: "delete",
428
428
  rule: i,
429
- index: s - r
429
+ index: o - r
430
430
  }), r++);
431
431
  }), Array.from(e).forEach((i) => {
432
432
  var n;
433
- const s = (n = this._map.get(i.uid)) != null ? n : [];
433
+ const o = (n = this._map.get(i.uid)) != null ? n : [];
434
434
  t.push({
435
435
  type: "add",
436
436
  rule: {
437
437
  ...i,
438
- ranges: O.sort(s)
438
+ ranges: I.sort(o)
439
439
  }
440
440
  });
441
441
  }), t;
@@ -461,20 +461,20 @@ class Xe {
461
461
  return t.length > 0 ? t[0].ruleId : void 0;
462
462
  }
463
463
  }
464
- var ea = Object.getOwnPropertyDescriptor, ta = (o, a, e, t) => {
465
- for (var r = t > 1 ? void 0 : t ? ea(a, e) : a, i = o.length - 1, s; i >= 0; i--)
466
- (s = o[i]) && (r = s(r) || r);
467
- return r;
468
- }, X = (o, a) => (e, t) => a(e, t, o);
469
- let F = class extends W {
470
- constructor(a, e, t, r, i, s, n) {
464
+ var ia = Object.defineProperty, sa = Object.getOwnPropertyDescriptor, oa = (s, a, e, t) => {
465
+ for (var r = t > 1 ? void 0 : t ? sa(a, e) : a, i = s.length - 1, o; i >= 0; i--)
466
+ (o = s[i]) && (r = (t ? o(a, e, r) : o(r)) || r);
467
+ return t && r && ia(a, e, r), r;
468
+ }, X = (s, a) => (e, t) => a(e, t, s);
469
+ let F = class extends $ {
470
+ constructor(a, e, t, r, i, o, n) {
471
471
  super();
472
- g(this, "_ruleMatrixMap", /* @__PURE__ */ new Map());
473
- g(this, "_validStatusChange$", new je());
474
- g(this, "_ruleChange$", new je());
475
- g(this, "ruleChange$", this._ruleChange$.asObservable());
476
- g(this, "validStatusChange$", this._validStatusChange$.asObservable());
477
- 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(() => {
472
+ f(this, "_ruleMatrixMap", /* @__PURE__ */ new Map());
473
+ f(this, "_validStatusChange$", new Qe());
474
+ f(this, "_ruleChange$", new Qe());
475
+ f(this, "ruleChange$", this._ruleChange$.asObservable());
476
+ f(this, "validStatusChange$", this._validStatusChange$.asObservable());
477
+ 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(() => {
478
478
  this._ruleChange$.complete(), this._validStatusChange$.complete();
479
479
  }), this._initUniverInstanceListener();
480
480
  }
@@ -496,12 +496,12 @@ let F = class extends W {
496
496
  const a = this._dataValidationModel.getAll();
497
497
  for (const [e, t] of a)
498
498
  for (const [r, i] of t)
499
- for (const s of i)
500
- this._addRule(e, r, s), this._ruleChange$.next({
499
+ for (const o of i)
500
+ this._addRule(e, r, o), this._ruleChange$.next({
501
501
  type: "add",
502
502
  unitId: e,
503
503
  subUnitId: r,
504
- rule: s,
504
+ rule: o,
505
505
  source: "patched"
506
506
  });
507
507
  this.disposeWithMe(
@@ -536,11 +536,11 @@ let F = class extends W {
536
536
  });
537
537
  }
538
538
  _updateRule(a, e, t, r, i) {
539
- const s = this._ensureRuleMatrix(a, e), n = {
539
+ const o = this._ensureRuleMatrix(a, e), n = {
540
540
  ...r,
541
541
  ...i.payload
542
542
  };
543
- i.type === y.RANGE ? s.updateRange(t, i.payload) : i.type === y.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);
543
+ i.type === y.RANGE ? o.updateRange(t, i.payload) : i.type === y.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);
544
544
  }
545
545
  _removeRule(a, e, t) {
546
546
  this._ensureRuleMatrix(a, e).removeRule(t), this._dataValidationCacheService.removeRule(a, e, t), this._dataValidationCustomFormulaService.deleteByRuleId(a, e, t.uid);
@@ -557,22 +557,22 @@ let F = class extends W {
557
557
  return this._dataValidationModel.getRuleById(a, e, i);
558
558
  }
559
559
  validator(a, e, t) {
560
- const { col: r, row: i, unitId: s, subUnitId: n, worksheet: l } = e, u = (_, v) => {
561
- t && t(_, v), v && this._validStatusChange$.next({
562
- unitId: s,
560
+ const { col: r, row: i, unitId: o, subUnitId: n, worksheet: l } = e, u = (g, R) => {
561
+ t && t(g, R), R && this._validStatusChange$.next({
562
+ unitId: o,
563
563
  subUnitId: n,
564
564
  ruleId: a.uid,
565
- status: _,
565
+ status: g,
566
566
  row: i,
567
567
  col: r
568
568
  });
569
- }, d = l.getCellValueOnly(i, r), c = this.getValidator(a.type), m = l.getCellRaw(i, r), p = ne(m);
569
+ }, d = l.getCellValueOnly(i, r), c = this.getValidator(a.type), m = l.getCellRaw(i, r), _ = ne(m);
570
570
  if (c) {
571
- const _ = this._dataValidationCacheService.ensureCache(s, n), v = _.getValue(i, r);
572
- return v == null ? (_.setValue(i, r, D.VALIDATING), c.validator(
571
+ const g = this._dataValidationCacheService.ensureCache(o, n), R = g.getValue(i, r);
572
+ return R == null ? (g.setValue(i, r, D.VALIDATING), c.validator(
573
573
  {
574
- value: p,
575
- unitId: s,
574
+ value: _,
575
+ unitId: o,
576
576
  subUnitId: n,
577
577
  row: i,
578
578
  column: r,
@@ -583,11 +583,11 @@ let F = class extends W {
583
583
  },
584
584
  a
585
585
  ).then((M) => {
586
- const f = M ? D.VALID : D.INVALID;
587
- f === D.VALID ? _.realDeleteValue(i, r) : _.setValue(i, r, f);
588
- const I = _.getValue(i, r);
589
- u(f, v !== I);
590
- }), D.VALIDATING) : (u(v != null ? v : D.VALID, !1), v != null ? v : D.VALID);
586
+ const p = M ? D.VALID : D.INVALID;
587
+ p === D.VALID ? g.realDeleteValue(i, r) : g.setValue(i, r, p);
588
+ const w = g.getValue(i, r);
589
+ u(p, R !== w);
590
+ }), D.VALIDATING) : (u(R != null ? R : D.VALID, !1), R != null ? R : D.VALID);
591
591
  } else
592
592
  return u(D.VALID, !1), D.VALID;
593
593
  }
@@ -616,37 +616,37 @@ let F = class extends W {
616
616
  return this._dataValidationModel.getAll();
617
617
  }
618
618
  };
619
- F = ta([
620
- X(0, R(Ge)),
621
- X(1, w),
622
- X(2, R(q)),
623
- X(3, R(Q)),
624
- X(4, R(K)),
625
- X(5, R(H)),
619
+ F = oa([
620
+ X(0, S(ke)),
621
+ X(1, O),
622
+ X(2, S(G)),
623
+ X(3, S(q)),
624
+ X(4, S(K)),
625
+ X(5, S(P)),
626
626
  X(6, x)
627
627
  ], F);
628
628
  const Ve = 1, Me = 0;
629
- function et(o, a) {
630
- return V.isBlank(o) ? a.t("dataValidation.validFail.value") : S(o) ? a.t("dataValidation.validFail.primitive") : "";
629
+ function et(s, a) {
630
+ return V.isBlank(s) ? a.t("dataValidation.validFail.value") : v(s) ? a.t("dataValidation.validFail.primitive") : "";
631
631
  }
632
- const pe = (o) => V.isDefine(o) && String(o).toLowerCase() === "true" ? "1" : String(o).toLowerCase() === "false" ? "0" : o;
633
- class aa extends G {
632
+ const _e = (s) => V.isDefine(s) && String(s).toLowerCase() === "true" ? "1" : String(s).toLowerCase() === "false" ? "0" : s;
633
+ class na extends k {
634
634
  constructor() {
635
635
  super(...arguments);
636
- g(this, "id", T.CHECKBOX);
637
- g(this, "title", "dataValidation.checkbox.title");
638
- g(this, "operators", []);
639
- g(this, "scopes", ["sheet"]);
640
- g(this, "offsetFormulaByRange", !1);
641
- g(this, "_formulaService", this.injector.get(K));
642
- g(this, "skipDefaultFontRender", (e, t, r) => {
643
- const { unitId: i, subUnitId: s } = r, { formula1: n, formula2: l } = this.parseFormulaSync(e, i, s), u = `${t != null ? t : ""}`;
636
+ f(this, "id", T.CHECKBOX);
637
+ f(this, "title", "dataValidation.checkbox.title");
638
+ f(this, "operators", []);
639
+ f(this, "scopes", ["sheet"]);
640
+ f(this, "offsetFormulaByRange", !1);
641
+ f(this, "_formulaService", this.injector.get(K));
642
+ f(this, "skipDefaultFontRender", (e, t, r) => {
643
+ const { unitId: i, subUnitId: o } = r, { formula1: n, formula2: l } = this.parseFormulaSync(e, i, o), u = `${t != null ? t : ""}`;
644
644
  return !u || u === `${n}` || u === `${l}`;
645
645
  });
646
646
  }
647
647
  validatorFormula(e, t, r) {
648
- const { formula1: i, formula2: s } = e, n = i === s;
649
- if (V.isBlank(i) && V.isBlank(s))
648
+ const { formula1: i, formula2: o } = e, n = i === o;
649
+ if (V.isBlank(i) && V.isBlank(o))
650
650
  return {
651
651
  success: !0
652
652
  };
@@ -656,7 +656,7 @@ class aa extends G {
656
656
  formula1: this.localeService.t("dataValidation.validFail.checkboxEqual"),
657
657
  formula2: this.localeService.t("dataValidation.validFail.checkboxEqual")
658
658
  };
659
- const l = et(i, this.localeService), u = et(s, this.localeService);
659
+ const l = et(i, this.localeService), u = et(o, this.localeService);
660
660
  return {
661
661
  success: !l && !u,
662
662
  formula1: l,
@@ -664,11 +664,11 @@ class aa extends G {
664
664
  };
665
665
  }
666
666
  async parseFormula(e, t, r) {
667
- var c, m, p, _;
668
- const { formula1: i = Ve, formula2: s = Me } = e, n = await this._formulaService.getRuleFormulaResult(t, r, e.uid), l = S(i) ? oe((m = (c = n == null ? void 0 : n[0]) == null ? void 0 : c.result) == null ? void 0 : m[0][0]) : i, u = S(s) ? oe((_ = (p = n == null ? void 0 : n[1]) == null ? void 0 : p.result) == null ? void 0 : _[0][0]) : s, d = C(String(l)) && C(String(u));
667
+ var c, m, _, g;
668
+ const { formula1: i = Ve, formula2: o = Me } = e, n = await this._formulaService.getRuleFormulaResult(t, r, e.uid), l = v(i) ? se((m = (c = n == null ? void 0 : n[0]) == null ? void 0 : c.result) == null ? void 0 : m[0][0]) : i, u = v(o) ? se((g = (_ = n == null ? void 0 : n[1]) == null ? void 0 : _.result) == null ? void 0 : g[0][0]) : o, d = C(String(l)) && C(String(u));
669
669
  return {
670
- formula1: pe(l),
671
- formula2: pe(u),
670
+ formula1: _e(l),
671
+ formula2: _e(u),
672
672
  originFormula1: l,
673
673
  originFormula2: u,
674
674
  isFormulaValid: d
@@ -676,29 +676,29 @@ class aa extends G {
676
676
  }
677
677
  getExtraStyle(e, t) {
678
678
  return {
679
- tb: Re.CLIP
679
+ tb: Se.CLIP
680
680
  };
681
681
  }
682
682
  parseFormulaSync(e, t, r) {
683
- var c, m, p, _;
684
- const { formula1: i = Ve, formula2: s = Me } = e, n = this._formulaService.getRuleFormulaResultSync(t, r, e.uid), l = S(i) ? oe((m = (c = n == null ? void 0 : n[0]) == null ? void 0 : c.result) == null ? void 0 : m[0][0]) : i, u = S(s) ? oe((_ = (p = n == null ? void 0 : n[1]) == null ? void 0 : p.result) == null ? void 0 : _[0][0]) : s, d = C(String(l)) && C(String(u));
683
+ var c, m, _, g;
684
+ const { formula1: i = Ve, formula2: o = Me } = e, n = this._formulaService.getRuleFormulaResultSync(t, r, e.uid), l = v(i) ? se((m = (c = n == null ? void 0 : n[0]) == null ? void 0 : c.result) == null ? void 0 : m[0][0]) : i, u = v(o) ? se((g = (_ = n == null ? void 0 : n[1]) == null ? void 0 : _.result) == null ? void 0 : g[0][0]) : o, d = C(String(l)) && C(String(u));
685
685
  return {
686
- formula1: pe(l),
687
- formula2: pe(u),
686
+ formula1: _e(l),
687
+ formula2: _e(u),
688
688
  originFormula1: l,
689
689
  originFormula2: u,
690
690
  isFormulaValid: d
691
691
  };
692
692
  }
693
693
  async isValidType(e, t, r) {
694
- const { value: i, unitId: s, subUnitId: n } = e, { formula1: l, formula2: u, originFormula1: d, originFormula2: c } = await this.parseFormula(r, s, n);
694
+ const { value: i, unitId: o, subUnitId: n } = e, { formula1: l, formula2: u, originFormula1: d, originFormula2: c } = await this.parseFormula(r, o, n);
695
695
  return !V.isDefine(l) || !V.isDefine(u) ? !0 : V.isDefine(i) && (String(i) === String(l) || String(i) === String(u) || String(i) === String(d != null ? d : "") || String(i) === String(c != null ? c : ""));
696
696
  }
697
697
  generateRuleErrorMessage(e) {
698
698
  return this.localeService.t("dataValidation.checkbox.error");
699
699
  }
700
700
  }
701
- const ra = {
701
+ const la = {
702
702
  [h.BETWEEN]: "dataValidation.date.operators.between",
703
703
  [h.EQUAL]: "dataValidation.date.operators.equal",
704
704
  [h.GREATER_THAN]: "dataValidation.date.operators.greaterThan",
@@ -709,7 +709,7 @@ const ra = {
709
709
  [h.NOT_EQUAL]: "dataValidation.date.operators.notEqual"
710
710
  };
711
711
  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 + "";
712
- const ia = {
712
+ const ua = {
713
713
  [h.BETWEEN]: "dataValidation.date.ruleName.between",
714
714
  [h.EQUAL]: "dataValidation.date.ruleName.equal",
715
715
  [h.GREATER_THAN]: "dataValidation.date.ruleName.greaterThan",
@@ -718,7 +718,7 @@ const ia = {
718
718
  [h.LESS_THAN_OR_EQUAL]: "dataValidation.date.ruleName.lessThanOrEqual",
719
719
  [h.NOT_BETWEEN]: "dataValidation.date.ruleName.notBetween",
720
720
  [h.NOT_EQUAL]: "dataValidation.date.ruleName.notEqual"
721
- }, oa = {
721
+ }, da = {
722
722
  [h.BETWEEN]: "dataValidation.date.errorMsg.between",
723
723
  [h.EQUAL]: "dataValidation.date.errorMsg.equal",
724
724
  [h.GREATER_THAN]: "dataValidation.date.errorMsg.greaterThan",
@@ -731,38 +731,38 @@ const ia = {
731
731
  h.BETWEEN,
732
732
  h.NOT_BETWEEN
733
733
  ], le = "{FORMULA1}", ue = "{FORMULA2}";
734
- function Ya(o) {
735
- return o.filter(Boolean).join(",");
734
+ function ir(s) {
735
+ return s.filter(Boolean).join(",");
736
736
  }
737
- function fe(o) {
738
- return o.split(",").filter(Boolean);
737
+ function pe(s) {
738
+ return s.split(",").filter(Boolean);
739
739
  }
740
- function Xa(o) {
741
- const a = ne(o);
740
+ function sr(s) {
741
+ const a = ne(s);
742
742
  return a == null ? "" : a.toString();
743
743
  }
744
- function De(o, a, e) {
745
- 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;
744
+ function De(s, a, e) {
745
+ 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 = v(t) ? s.moveFormulaRefOffset(t, l, n, !0) : t, d = v(r) ? s.moveFormulaRefOffset(r, l, n, !0) : r;
746
746
  return {
747
747
  transformedFormula1: u,
748
748
  transformedFormula2: d
749
749
  };
750
750
  }
751
- const Ue = (o) => {
751
+ const Ue = (s) => {
752
752
  var e, t;
753
- if (o == null || typeof o == "boolean")
753
+ if (s == null || typeof s == "boolean")
754
754
  return;
755
- if (typeof o == "number" || !Number.isNaN(+o))
756
- return +o;
757
- const a = (e = j.parseDate(o)) == null ? void 0 : e.v;
758
- return V.isDefine(a) ? a : (t = j.parseDate(at(o).format("YYYY-MM-DD HH:mm:ss"))) == null ? void 0 : t.v;
755
+ if (typeof s == "number" || !Number.isNaN(+s))
756
+ return +s;
757
+ const a = (e = Q.parseDate(s)) == null ? void 0 : e.v;
758
+ return V.isDefine(a) ? a : (t = Q.parseDate(at(s).format("YYYY-MM-DD HH:mm:ss"))) == null ? void 0 : t.v;
759
759
  };
760
- class sa extends G {
760
+ class ca extends k {
761
761
  constructor() {
762
762
  super(...arguments);
763
- g(this, "id", T.DATE);
764
- g(this, "title", "dataValidation.date.title");
765
- g(this, "operators", [
763
+ f(this, "id", T.DATE);
764
+ f(this, "title", "dataValidation.date.title");
765
+ f(this, "operators", [
766
766
  h.BETWEEN,
767
767
  h.EQUAL,
768
768
  h.GREATER_THAN,
@@ -772,24 +772,24 @@ class sa extends G {
772
772
  h.NOT_BETWEEN,
773
773
  h.NOT_EQUAL
774
774
  ]);
775
- g(this, "scopes", ["sheet"]);
776
- g(this, "_customFormulaService", this.injector.get(H));
777
- g(this, "_lexerTreeBuilder", this.injector.get(Y));
775
+ f(this, "scopes", ["sheet"]);
776
+ f(this, "_customFormulaService", this.injector.get(P));
777
+ f(this, "_lexerTreeBuilder", this.injector.get(Y));
778
778
  }
779
- async parseFormula(e, t, r, i, s) {
780
- 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));
779
+ async parseFormula(e, t, r, i, o) {
780
+ 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 = C(String(n == null ? void 0 : n.v)) && C(String(l == null ? void 0 : l.v));
781
781
  return {
782
- formula1: Ue(S(u) ? n == null ? void 0 : n.v : u),
783
- formula2: Ue(S(d) ? l == null ? void 0 : l.v : d),
782
+ formula1: Ue(v(u) ? n == null ? void 0 : n.v : u),
783
+ formula2: Ue(v(d) ? l == null ? void 0 : l.v : d),
784
784
  isFormulaValid: c
785
785
  };
786
786
  }
787
787
  async isValidType(e) {
788
788
  const { interceptValue: t, value: r } = e;
789
- return typeof r == "number" && typeof t == "string" ? !0 : typeof t == "string" ? !!j.parseDate(t) : !1;
789
+ return typeof r == "number" && typeof t == "string" ? !0 : typeof t == "string" ? !!Q.parseDate(t) : !1;
790
790
  }
791
791
  _validatorSingleFormula(e) {
792
- return !V.isBlank(e) && (S(e) || !Number.isNaN(+e) || !!(e && j.parseDate(e)));
792
+ return !V.isBlank(e) && (v(e) || !Number.isNaN(+e) || !!(e && Q.parseDate(e)));
793
793
  }
794
794
  validatorFormula(e, t, r) {
795
795
  const i = e.operator;
@@ -797,39 +797,39 @@ class sa extends G {
797
797
  return {
798
798
  success: !1
799
799
  };
800
- const s = this._validatorSingleFormula(e.formula1), n = this.localeService.t("dataValidation.validFail.date");
800
+ const o = this._validatorSingleFormula(e.formula1), n = this.localeService.t("dataValidation.validFail.date");
801
801
  if (Ae.includes(i)) {
802
802
  const u = this._validatorSingleFormula(e.formula2);
803
803
  return {
804
- success: s && u,
805
- formula1: s ? void 0 : n,
804
+ success: o && u,
805
+ formula1: o ? void 0 : n,
806
806
  formula2: u ? void 0 : n
807
807
  };
808
808
  }
809
809
  return {
810
- success: s,
811
- formula1: s ? void 0 : n
810
+ success: o,
811
+ formula1: o ? void 0 : n
812
812
  };
813
813
  }
814
814
  normalizeFormula(e, t, r) {
815
- const { formula1: i, formula2: s, bizInfo: n } = e, l = (u) => {
815
+ const { formula1: i, formula2: o, bizInfo: n } = e, l = (u) => {
816
816
  var c;
817
817
  if (!u)
818
818
  return u;
819
819
  let d;
820
820
  if (!Number.isNaN(+u))
821
- d = j.dateFromSerial(+u);
821
+ d = Q.dateFromSerial(+u);
822
822
  else {
823
- const m = (c = j.parseDate(u)) == null ? void 0 : c.v;
823
+ const m = (c = Q.parseDate(u)) == null ? void 0 : c.v;
824
824
  if (m == null)
825
825
  return "";
826
- d = j.dateFromSerial(m);
826
+ d = Q.dateFromSerial(m);
827
827
  }
828
828
  return at(`${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");
829
829
  };
830
830
  return {
831
- formula1: S(i) ? i : l(`${i}`),
832
- formula2: S(s) ? s : l(`${s}`)
831
+ formula1: v(i) ? i : l(`${i}`),
832
+ formula2: v(o) ? o : l(`${o}`)
833
833
  };
834
834
  }
835
835
  transform(e, t, r) {
@@ -840,20 +840,20 @@ class sa extends G {
840
840
  };
841
841
  }
842
842
  get operatorNames() {
843
- return this.operators.map((e) => this.localeService.t(ra[e]));
843
+ return this.operators.map((e) => this.localeService.t(la[e]));
844
844
  }
845
845
  generateRuleName(e) {
846
846
  var r, i;
847
847
  if (!e.operator)
848
848
  return this.titleStr;
849
- const t = this.localeService.t(ia[e.operator]).replace(le, (r = e.formula1) != null ? r : "").replace(ue, (i = e.formula2) != null ? i : "");
849
+ const t = this.localeService.t(ua[e.operator]).replace(le, (r = e.formula1) != null ? r : "").replace(ue, (i = e.formula2) != null ? i : "");
850
850
  return `${this.titleStr} ${t}`;
851
851
  }
852
852
  generateRuleErrorMessage(e, t) {
853
853
  if (!e.operator)
854
854
  return this.titleStr;
855
855
  const { transformedFormula1: r, transformedFormula2: i } = De(this._lexerTreeBuilder, e, t);
856
- return `${this.localeService.t(oa[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
856
+ return `${this.localeService.t(da[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
857
857
  }
858
858
  }
859
859
  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 + "";
@@ -868,18 +868,18 @@ const ht = {
868
868
  [h.NOT_BETWEEN]: "dataValidation.errorMsg.notBetween",
869
869
  [h.NOT_EQUAL]: "dataValidation.errorMsg.notEqual"
870
870
  };
871
- function ye(o) {
872
- let a = o;
873
- return typeof o == "string" ? ((o.startsWith("¥") || o.startsWith("$")) && (a = o.slice(1)), +a) : +o;
871
+ function ye(s) {
872
+ let a = s;
873
+ return typeof s == "string" ? ((s.startsWith("¥") || s.startsWith("$")) && (a = s.slice(1)), +a) : +s;
874
874
  }
875
- class na extends G {
875
+ class ha extends k {
876
876
  constructor() {
877
877
  super(...arguments);
878
- g(this, "_customFormulaService", this.injector.get(H));
879
- g(this, "id", T.DECIMAL);
880
- g(this, "_lexerTreeBuilder", this.injector.get(Y));
881
- g(this, "title", "dataValidation.decimal.title");
882
- g(this, "operators", [
878
+ f(this, "_customFormulaService", this.injector.get(P));
879
+ f(this, "id", T.DECIMAL);
880
+ f(this, "_lexerTreeBuilder", this.injector.get(Y));
881
+ f(this, "title", "dataValidation.decimal.title");
882
+ f(this, "operators", [
883
883
  h.BETWEEN,
884
884
  h.EQUAL,
885
885
  h.GREATER_THAN,
@@ -889,10 +889,10 @@ class na extends G {
889
889
  h.NOT_BETWEEN,
890
890
  h.NOT_EQUAL
891
891
  ]);
892
- g(this, "scopes", ["sheet"]);
892
+ f(this, "scopes", ["sheet"]);
893
893
  }
894
894
  _isFormulaOrNumber(e) {
895
- return !V.isBlank(e) && (S(e) || !Number.isNaN(+e));
895
+ return !V.isBlank(e) && (v(e) || !Number.isNaN(+e));
896
896
  }
897
897
  async isValidType(e, t, r) {
898
898
  const { value: i } = e;
@@ -908,11 +908,11 @@ class na extends G {
908
908
  _parseNumber(e) {
909
909
  return e == null ? Number.NaN : +e;
910
910
  }
911
- async parseFormula(e, t, r, i, s) {
912
- 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));
911
+ async parseFormula(e, t, r, i, o) {
912
+ 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 = C(String(n == null ? void 0 : n.v)) && C(String(l == null ? void 0 : l.v));
913
913
  return {
914
- formula1: this._parseNumber(S(u) ? n == null ? void 0 : n.v : u),
915
- formula2: this._parseNumber(S(d) ? l == null ? void 0 : l.v : d),
914
+ formula1: this._parseNumber(v(u) ? n == null ? void 0 : n.v : u),
915
+ formula2: this._parseNumber(v(d) ? l == null ? void 0 : l.v : d),
916
916
  isFormulaValid: c
917
917
  };
918
918
  }
@@ -922,14 +922,14 @@ class na extends G {
922
922
  return {
923
923
  success: !1
924
924
  };
925
- const s = V.isDefine(e.formula1) && this._isFormulaOrNumber(e.formula1), n = V.isDefine(e.formula2) && this._isFormulaOrNumber(e.formula2), l = Ae.includes(i), u = this.localeService.t("dataValidation.validFail.number");
925
+ const o = V.isDefine(e.formula1) && this._isFormulaOrNumber(e.formula1), n = V.isDefine(e.formula2) && this._isFormulaOrNumber(e.formula2), l = Ae.includes(i), u = this.localeService.t("dataValidation.validFail.number");
926
926
  return l ? {
927
- success: s && n,
928
- formula1: s ? void 0 : u,
927
+ success: o && n,
928
+ formula1: o ? void 0 : u,
929
929
  formula2: n ? void 0 : u
930
930
  } : {
931
- success: s,
932
- formula1: s ? "" : u
931
+ success: o,
932
+ formula1: o ? "" : u
933
933
  };
934
934
  }
935
935
  generateRuleErrorMessage(e, t) {
@@ -939,18 +939,18 @@ class na extends G {
939
939
  return `${this.localeService.t(ht[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
940
940
  }
941
941
  }
942
- function He(o) {
943
- if (!o)
942
+ function Pe(s) {
943
+ if (!s)
944
944
  return [];
945
945
  const a = /* @__PURE__ */ new Set();
946
- return o.forEach(
946
+ return s.forEach(
947
947
  (e) => {
948
948
  e.forEach((t) => {
949
- var i, s;
949
+ var i, o;
950
950
  const r = ne(t);
951
951
  if (r != null) {
952
- if (typeof r != "string" && typeof (t == null ? void 0 : t.s) == "object" && ((s = (i = t.s) == null ? void 0 : i.n) != null && s.pattern)) {
953
- a.add(j.format(t.s.n.pattern, r, { throws: !1 }));
952
+ if (typeof r != "string" && typeof (t == null ? void 0 : t.s) == "object" && ((o = (i = t.s) == null ? void 0 : i.n) != null && o.pattern)) {
953
+ a.add(Q.format(t.s.n.pattern, r, { throws: !1 }));
954
954
  return;
955
955
  }
956
956
  C(r.toString()) && a.add(r.toString());
@@ -959,51 +959,51 @@ function He(o) {
959
959
  }
960
960
  ), [...a];
961
961
  }
962
- const la = [
962
+ const ma = [
963
963
  "if",
964
964
  "indirect",
965
965
  "choose",
966
966
  "offset"
967
967
  ];
968
- function ua(o, a) {
969
- if (!S(o) || dt(o.slice(1)))
968
+ function fa(s, a) {
969
+ if (!v(s) || dt(s.slice(1)))
970
970
  return !0;
971
- const t = a.sequenceNodesBuilder(o);
972
- return t && t.some((r) => typeof r == "object" && r.nodeType === kt.FUNCTION && la.indexOf(r.token.toLowerCase()) > -1);
971
+ const t = a.sequenceNodesBuilder(s);
972
+ return t && t.some((r) => typeof r == "object" && r.nodeType === Qt.FUNCTION && ma.indexOf(r.token.toLowerCase()) > -1);
973
973
  }
974
- function da(o, a) {
975
- const { formula1: e = "", ranges: t } = o;
974
+ function ga(s, a) {
975
+ const { formula1: e = "", ranges: t } = s;
976
976
  if (dt(e.slice(1))) {
977
- const i = jt(e.slice(1));
978
- if ((!i.sheetName || i.sheetName === a) && t.some((s) => O.intersects(s, i.range)))
977
+ const i = qt(e.slice(1));
978
+ if ((!i.sheetName || i.sheetName === a) && t.some((o) => I.intersects(o, i.range)))
979
979
  return !0;
980
980
  }
981
981
  return !1;
982
982
  }
983
- class mt extends G {
983
+ class mt extends k {
984
984
  constructor() {
985
985
  super(...arguments);
986
- g(this, "formulaService", this.injector.get(K));
987
- g(this, "_lexer", this.injector.get(Y));
988
- g(this, "_univerInstanceService", this.injector.get(w));
989
- g(this, "offsetFormulaByRange", !1);
990
- g(this, "id", T.LIST);
991
- g(this, "title", "dataValidation.list.title");
992
- g(this, "operators", []);
993
- g(this, "scopes", ["sheet"]);
994
- g(this, "skipDefaultFontRender", (e) => e.renderMode !== Be.TEXT);
986
+ f(this, "formulaService", this.injector.get(K));
987
+ f(this, "_lexer", this.injector.get(Y));
988
+ f(this, "_univerInstanceService", this.injector.get(O));
989
+ f(this, "offsetFormulaByRange", !1);
990
+ f(this, "id", T.LIST);
991
+ f(this, "title", "dataValidation.list.title");
992
+ f(this, "operators", []);
993
+ f(this, "scopes", ["sheet"]);
994
+ f(this, "skipDefaultFontRender", (e) => e.renderMode !== Be.TEXT);
995
995
  }
996
996
  validatorFormula(e, t, r) {
997
997
  var u, d, c;
998
- const i = !V.isBlank(e.formula1), s = ua((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 = da(e, n != null ? n : "");
998
+ const i = !V.isBlank(e.formula1), o = fa((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 = ga(e, n != null ? n : "");
999
999
  return {
1000
- success: !!(i && s && !l),
1001
- formula1: i ? s ? l ? this.localeService.t("dataValidation.validFail.listIntersects") : void 0 : this.localeService.t("dataValidation.validFail.listInvalid") : this.localeService.t("dataValidation.validFail.list")
1000
+ success: !!(i && o && !l),
1001
+ formula1: i ? o ? l ? this.localeService.t("dataValidation.validFail.listIntersects") : void 0 : this.localeService.t("dataValidation.validFail.listInvalid") : this.localeService.t("dataValidation.validFail.list")
1002
1002
  };
1003
1003
  }
1004
1004
  getExtraStyle(e, t, { style: r }) {
1005
- var s;
1006
- const i = (s = r.tb !== Re.OVERFLOW ? r.tb : Re.CLIP) != null ? s : Re.WRAP;
1005
+ var o;
1006
+ const i = (o = r.tb !== Se.OVERFLOW ? r.tb : Se.CLIP) != null ? o : Se.WRAP;
1007
1007
  if (e.type === T.LIST && (e.renderMode === Be.ARROW || e.renderMode === Be.TEXT)) {
1008
1008
  const n = this.getListWithColorMap(e), l = `${t != null ? t : ""}`, u = n[l];
1009
1009
  if (u)
@@ -1020,21 +1020,21 @@ class mt extends G {
1020
1020
  }
1021
1021
  parseCellValue(e) {
1022
1022
  const t = e.toString();
1023
- return fe(t);
1023
+ return pe(t);
1024
1024
  }
1025
1025
  async parseFormula(e, t, r) {
1026
1026
  var l, u;
1027
- 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]);
1027
+ const i = await this.formulaService.getRuleFormulaResult(t, r, e.uid), o = se((u = (l = i == null ? void 0 : i[0]) == null ? void 0 : l.result) == null ? void 0 : u[0][0]);
1028
1028
  return {
1029
1029
  formula1: void 0,
1030
1030
  formula2: void 0,
1031
- isFormulaValid: C(String(s))
1031
+ isFormulaValid: C(String(o))
1032
1032
  };
1033
1033
  }
1034
1034
  async isValidType(e, t, r) {
1035
- var m, p;
1036
- const { value: i, unitId: s, subUnitId: n } = e, { formula1: l = "" } = r, u = await this.formulaService.getRuleFormulaResult(s, n, r.uid), d = S(l) ? He((p = (m = u == null ? void 0 : u[0]) == null ? void 0 : m.result) == null ? void 0 : p[0][0]) : fe(l);
1037
- return this.parseCellValue(i).every((_) => d.includes(_));
1035
+ var m, _;
1036
+ const { value: i, unitId: o, subUnitId: n } = e, { formula1: l = "" } = r, u = await this.formulaService.getRuleFormulaResult(o, n, r.uid), d = v(l) ? Pe((_ = (m = u == null ? void 0 : u[0]) == null ? void 0 : m.result) == null ? void 0 : _[0][0]) : pe(l);
1037
+ return this.parseCellValue(i).every((g) => d.includes(g));
1038
1038
  }
1039
1039
  generateRuleName() {
1040
1040
  return this.localeService.t("dataValidation.list.name");
@@ -1043,41 +1043,41 @@ class mt extends G {
1043
1043
  return this.localeService.t("dataValidation.list.error");
1044
1044
  }
1045
1045
  getList(e, t, r) {
1046
- var m, p, _, v;
1047
- const { formula1: i = "" } = e, s = this.injector.get(w), n = (m = t ? s.getUniverSheetInstance(t) : void 0) != null ? m : s.getCurrentUnitForType(N.UNIVER_SHEET);
1046
+ var m, _, g, R;
1047
+ const { formula1: i = "" } = e, o = this.injector.get(O), n = (m = t ? o.getUniverSheetInstance(t) : void 0) != null ? m : o.getCurrentUnitForType(N.UNIVER_SHEET);
1048
1048
  if (!n) return [];
1049
- const l = (p = r ? n.getSheetBySheetId(r) : void 0) != null ? p : n.getActiveSheet();
1049
+ const l = (_ = r ? n.getSheetBySheetId(r) : void 0) != null ? _ : n.getActiveSheet();
1050
1050
  if (!l) return [];
1051
1051
  const u = n.getUnitId(), d = l.getSheetId(), c = this.formulaService.getRuleFormulaResultSync(u, d, e.uid);
1052
- return S(i) ? He((v = (_ = c == null ? void 0 : c[0]) == null ? void 0 : _.result) == null ? void 0 : v[0][0]) : fe(i);
1052
+ return v(i) ? Pe((R = (g = c == null ? void 0 : c[0]) == null ? void 0 : g.result) == null ? void 0 : R[0][0]) : pe(i);
1053
1053
  }
1054
1054
  async getListAsync(e, t, r) {
1055
- var m, p, _, v;
1056
- const { formula1: i = "" } = e, s = this.injector.get(w), n = (m = t ? s.getUniverSheetInstance(t) : void 0) != null ? m : s.getCurrentUnitForType(N.UNIVER_SHEET);
1055
+ var m, _, g, R;
1056
+ const { formula1: i = "" } = e, o = this.injector.get(O), n = (m = t ? o.getUniverSheetInstance(t) : void 0) != null ? m : o.getCurrentUnitForType(N.UNIVER_SHEET);
1057
1057
  if (!n) return [];
1058
- const l = (p = r ? n.getSheetBySheetId(r) : void 0) != null ? p : n.getActiveSheet();
1058
+ const l = (_ = r ? n.getSheetBySheetId(r) : void 0) != null ? _ : n.getActiveSheet();
1059
1059
  if (!l) return [];
1060
1060
  const u = n.getUnitId(), d = l.getSheetId(), c = await this.formulaService.getRuleFormulaResult(u, d, e.uid);
1061
- return S(i) ? He((v = (_ = c == null ? void 0 : c[0]) == null ? void 0 : _.result) == null ? void 0 : v[0][0]) : fe(i);
1061
+ return v(i) ? Pe((R = (g = c == null ? void 0 : c[0]) == null ? void 0 : g.result) == null ? void 0 : R[0][0]) : pe(i);
1062
1062
  }
1063
1063
  getListWithColor(e, t, r) {
1064
- const i = this.getList(e, t, r), s = (e.formula2 || "").split(",");
1065
- return i.map((n, l) => ({ label: n, color: s[l] }));
1064
+ const i = this.getList(e, t, r), o = (e.formula2 || "").split(",");
1065
+ return i.map((n, l) => ({ label: n, color: o[l] }));
1066
1066
  }
1067
1067
  getListWithColorMap(e, t, r) {
1068
- const i = this.getListWithColor(e, t, r), s = {};
1068
+ const i = this.getListWithColor(e, t, r), o = {};
1069
1069
  return i.forEach((n) => {
1070
- n.color && (s[n.label] = n.color);
1071
- }), s;
1070
+ n.color && (o[n.label] = n.color);
1071
+ }), o;
1072
1072
  }
1073
1073
  }
1074
- class ca extends G {
1074
+ class _a extends k {
1075
1075
  constructor() {
1076
1076
  super(...arguments);
1077
- g(this, "id", T.TEXT_LENGTH);
1078
- g(this, "title", "dataValidation.textLength.title");
1079
- g(this, "_lexerTreeBuilder", this.injector.get(Y));
1080
- g(this, "operators", [
1077
+ f(this, "id", T.TEXT_LENGTH);
1078
+ f(this, "title", "dataValidation.textLength.title");
1079
+ f(this, "_lexerTreeBuilder", this.injector.get(Y));
1080
+ f(this, "operators", [
1081
1081
  h.BETWEEN,
1082
1082
  h.EQUAL,
1083
1083
  h.GREATER_THAN,
@@ -1087,11 +1087,11 @@ class ca extends G {
1087
1087
  h.NOT_BETWEEN,
1088
1088
  h.NOT_EQUAL
1089
1089
  ]);
1090
- g(this, "scopes", ["sheet"]);
1091
- g(this, "_customFormulaService", this.injector.get(H));
1090
+ f(this, "scopes", ["sheet"]);
1091
+ f(this, "_customFormulaService", this.injector.get(P));
1092
1092
  }
1093
1093
  _isFormulaOrInt(e) {
1094
- return !V.isBlank(e) && (S(e) || !Number.isNaN(+e) && Number.isInteger(+e));
1094
+ return !V.isBlank(e) && (v(e) || !Number.isNaN(+e) && Number.isInteger(+e));
1095
1095
  }
1096
1096
  validatorFormula(e, t, r) {
1097
1097
  const i = e.operator;
@@ -1099,24 +1099,24 @@ class ca extends G {
1099
1099
  return {
1100
1100
  success: !1
1101
1101
  };
1102
- const s = V.isDefine(e.formula1) && this._isFormulaOrInt(e.formula1), n = V.isDefine(e.formula2) && this._isFormulaOrInt(e.formula2), l = Ae.includes(i), u = this.localeService.t("dataValidation.validFail.number");
1102
+ const o = V.isDefine(e.formula1) && this._isFormulaOrInt(e.formula1), n = V.isDefine(e.formula2) && this._isFormulaOrInt(e.formula2), l = Ae.includes(i), u = this.localeService.t("dataValidation.validFail.number");
1103
1103
  return l ? {
1104
- success: s && n,
1105
- formula1: s ? void 0 : u,
1104
+ success: o && n,
1105
+ formula1: o ? void 0 : u,
1106
1106
  formula2: n ? void 0 : u
1107
1107
  } : {
1108
- success: s,
1108
+ success: o,
1109
1109
  formula1: u
1110
1110
  };
1111
1111
  }
1112
1112
  _parseNumber(e) {
1113
1113
  return e == null ? Number.NaN : +e;
1114
1114
  }
1115
- async parseFormula(e, t, r, i, s) {
1116
- 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));
1115
+ async parseFormula(e, t, r, i, o) {
1116
+ 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 = C(String(n == null ? void 0 : n.v)) && C(String(l == null ? void 0 : l.v));
1117
1117
  return {
1118
- formula1: this._parseNumber(S(u) ? n == null ? void 0 : n.v : u),
1119
- formula2: this._parseNumber(S(d) ? l == null ? void 0 : l.v : d),
1118
+ formula1: this._parseNumber(v(u) ? n == null ? void 0 : n.v : u),
1119
+ formula2: this._parseNumber(v(d) ? l == null ? void 0 : l.v : d),
1120
1120
  isFormulaValid: c
1121
1121
  };
1122
1122
  }
@@ -1134,109 +1134,109 @@ class ca extends G {
1134
1134
  if (!e.operator)
1135
1135
  return this.titleStr;
1136
1136
  const { transformedFormula1: r, transformedFormula2: i } = De(this._lexerTreeBuilder, e, t);
1137
- return `${this.localeService.t(At[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
1137
+ return `${this.localeService.t(Dt[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
1138
1138
  }
1139
1139
  }
1140
- function gt(o) {
1140
+ function ft(s) {
1141
1141
  var e, t;
1142
- return o ? o.p ? !((t = (e = o.p.body) == null ? void 0 : e.dataStream) != null ? t : "").slice(0, -2).trim() : V.isBlank(o.v) : !0;
1142
+ return s ? s.p ? !((t = (e = s.p.body) == null ? void 0 : e.dataStream) != null ? t : "").slice(0, -2).trim() : V.isBlank(s.v) : !0;
1143
1143
  }
1144
- function be(o, a, e, t, r = "command", i = !0) {
1145
- const s = t.get(Y), n = t.get(q), l = [], u = [], d = t.get(F), c = t.get(w), m = Ye(c, { unitId: o, subUnitId: a });
1144
+ function be(s, a, e, t, r = "command", i = !0) {
1145
+ const o = t.get(Y), n = t.get(G), l = [], u = [], d = t.get(F), c = t.get(O), m = Ye(c, { unitId: s, subUnitId: a });
1146
1146
  if (!m)
1147
1147
  return {
1148
1148
  redoMutations: l,
1149
1149
  undoMutations: u
1150
1150
  };
1151
- const { worksheet: p } = m, _ = new Se();
1152
- let v = !1;
1153
- function M(f, I) {
1154
- i && f.forEach((P) => {
1155
- b.foreach(P, (B, $) => {
1156
- const U = p.getCellRaw(B, $), J = ct(U);
1157
- (gt(U) || J === I) && !(U != null && U.p) && (v = !0, _.setValue(B, $, {
1158
- v: I,
1151
+ const { worksheet: _ } = m, g = new ve();
1152
+ let R = !1;
1153
+ function M(p, w) {
1154
+ i && p.forEach((H) => {
1155
+ b.foreach(H, (B, W) => {
1156
+ const U = _.getCellRaw(B, W), J = ct(U);
1157
+ (ft(U) || J === w) && !(U != null && U.p) && (R = !0, g.setValue(B, W, {
1158
+ v: w,
1159
1159
  p: null
1160
1160
  }));
1161
1161
  });
1162
1162
  });
1163
1163
  }
1164
- if (e.forEach((f) => {
1165
- switch (f.type) {
1164
+ if (e.forEach((p) => {
1165
+ switch (p.type) {
1166
1166
  case "delete":
1167
1167
  l.push({
1168
1168
  id: A.id,
1169
1169
  params: {
1170
- unitId: o,
1170
+ unitId: s,
1171
1171
  subUnitId: a,
1172
- ruleId: f.rule.uid,
1172
+ ruleId: p.rule.uid,
1173
1173
  source: r
1174
1174
  }
1175
1175
  }), u.unshift({
1176
1176
  id: L.id,
1177
1177
  params: {
1178
- unitId: o,
1178
+ unitId: s,
1179
1179
  subUnitId: a,
1180
- rule: f.rule,
1181
- index: f.index,
1180
+ rule: p.rule,
1181
+ index: p.index,
1182
1182
  source: r
1183
1183
  }
1184
1184
  });
1185
1185
  break;
1186
1186
  case "update": {
1187
- if (de(f.rule.type, n)) {
1188
- const P = f.oldRanges[0].startRow, B = f.oldRanges[0].startColumn, $ = f.newRanges[0].startRow, U = f.newRanges[0].startColumn, J = $ - P, ce = U - B, he = S(f.rule.formula1) ? s.moveFormulaRefOffset(f.rule.formula1, ce, J) : f.rule.formula1, me = S(f.rule.formula2) ? s.moveFormulaRefOffset(f.rule.formula2, ce, J) : f.rule.formula2;
1189
- he !== f.rule.formula1 || me !== f.rule.formula2 || !rt(f.newRanges, f.oldRanges) ? (l.push({
1187
+ if (de(p.rule.type, n)) {
1188
+ const H = p.oldRanges[0].startRow, B = p.oldRanges[0].startColumn, W = p.newRanges[0].startRow, U = p.newRanges[0].startColumn, J = W - H, ce = U - B, he = v(p.rule.formula1) ? o.moveFormulaRefOffset(p.rule.formula1, ce, J) : p.rule.formula1, me = v(p.rule.formula2) ? o.moveFormulaRefOffset(p.rule.formula2, ce, J) : p.rule.formula2;
1189
+ he !== p.rule.formula1 || me !== p.rule.formula2 || !rt(p.newRanges, p.oldRanges) ? (l.push({
1190
1190
  id: E.id,
1191
1191
  params: {
1192
- unitId: o,
1192
+ unitId: s,
1193
1193
  subUnitId: a,
1194
- ruleId: f.ruleId,
1194
+ ruleId: p.ruleId,
1195
1195
  payload: {
1196
1196
  type: y.ALL,
1197
1197
  payload: {
1198
1198
  formula1: he,
1199
1199
  formula2: me,
1200
- ranges: f.newRanges
1200
+ ranges: p.newRanges
1201
1201
  }
1202
1202
  }
1203
1203
  }
1204
1204
  }), u.unshift({
1205
1205
  id: E.id,
1206
1206
  params: {
1207
- unitId: o,
1207
+ unitId: s,
1208
1208
  subUnitId: a,
1209
- ruleId: f.ruleId,
1209
+ ruleId: p.ruleId,
1210
1210
  payload: {
1211
1211
  type: y.ALL,
1212
1212
  payload: {
1213
- formula1: f.rule.formula1,
1214
- formula2: f.rule.formula2,
1215
- ranges: f.oldRanges
1213
+ formula1: p.rule.formula1,
1214
+ formula2: p.rule.formula2,
1215
+ ranges: p.oldRanges
1216
1216
  }
1217
1217
  }
1218
1218
  }
1219
1219
  })) : (l.push({
1220
1220
  id: E.id,
1221
1221
  params: {
1222
- unitId: o,
1222
+ unitId: s,
1223
1223
  subUnitId: a,
1224
- ruleId: f.ruleId,
1224
+ ruleId: p.ruleId,
1225
1225
  payload: {
1226
1226
  type: y.RANGE,
1227
- payload: f.newRanges
1227
+ payload: p.newRanges
1228
1228
  },
1229
1229
  source: r
1230
1230
  }
1231
1231
  }), u.unshift({
1232
1232
  id: E.id,
1233
1233
  params: {
1234
- unitId: o,
1234
+ unitId: s,
1235
1235
  subUnitId: a,
1236
- ruleId: f.ruleId,
1236
+ ruleId: p.ruleId,
1237
1237
  payload: {
1238
1238
  type: y.RANGE,
1239
- payload: f.oldRanges
1239
+ payload: p.oldRanges
1240
1240
  },
1241
1241
  source: r
1242
1242
  }
@@ -1245,32 +1245,32 @@ function be(o, a, e, t, r = "command", i = !0) {
1245
1245
  l.push({
1246
1246
  id: E.id,
1247
1247
  params: {
1248
- unitId: o,
1248
+ unitId: s,
1249
1249
  subUnitId: a,
1250
- ruleId: f.ruleId,
1250
+ ruleId: p.ruleId,
1251
1251
  payload: {
1252
1252
  type: y.RANGE,
1253
- payload: f.newRanges
1253
+ payload: p.newRanges
1254
1254
  },
1255
1255
  source: r
1256
1256
  }
1257
1257
  }), u.unshift({
1258
1258
  id: E.id,
1259
1259
  params: {
1260
- unitId: o,
1260
+ unitId: s,
1261
1261
  subUnitId: a,
1262
- ruleId: f.ruleId,
1262
+ ruleId: p.ruleId,
1263
1263
  payload: {
1264
1264
  type: y.RANGE,
1265
- payload: f.oldRanges
1265
+ payload: p.oldRanges
1266
1266
  },
1267
1267
  source: r
1268
1268
  }
1269
1269
  });
1270
- const I = d.getRuleById(o, a, f.ruleId);
1271
- if (I && I.type === T.CHECKBOX) {
1272
- const B = d.getValidator(T.CHECKBOX).parseFormulaSync(I, o, a);
1273
- M(f.newRanges, B.formula2);
1270
+ const w = d.getRuleById(s, a, p.ruleId);
1271
+ if (w && w.type === T.CHECKBOX) {
1272
+ const B = d.getValidator(T.CHECKBOX).parseFormulaSync(w, s, a);
1273
+ M(p.newRanges, B.formula2);
1274
1274
  }
1275
1275
  break;
1276
1276
  }
@@ -1278,70 +1278,70 @@ function be(o, a, e, t, r = "command", i = !0) {
1278
1278
  if (l.push({
1279
1279
  id: L.id,
1280
1280
  params: {
1281
- unitId: o,
1281
+ unitId: s,
1282
1282
  subUnitId: a,
1283
- rule: f.rule,
1283
+ rule: p.rule,
1284
1284
  source: r
1285
1285
  }
1286
1286
  }), u.unshift({
1287
1287
  id: A.id,
1288
1288
  params: {
1289
- unitId: o,
1289
+ unitId: s,
1290
1290
  subUnitId: a,
1291
- ruleId: f.rule.uid,
1291
+ ruleId: p.rule.uid,
1292
1292
  source: r
1293
1293
  }
1294
- }), f.rule.type === T.CHECKBOX) {
1295
- const P = d.getValidator(T.CHECKBOX).parseFormulaSync(f.rule, o, a);
1296
- M(f.rule.ranges, P.originFormula2);
1294
+ }), p.rule.type === T.CHECKBOX) {
1295
+ const H = d.getValidator(T.CHECKBOX).parseFormulaSync(p.rule, s, a);
1296
+ M(p.rule.ranges, H.originFormula2);
1297
1297
  }
1298
1298
  break;
1299
1299
  }
1300
1300
  }
1301
- }), v) {
1302
- const f = {
1303
- id: se.id,
1301
+ }), R) {
1302
+ const p = {
1303
+ id: oe.id,
1304
1304
  params: {
1305
- unitId: o,
1305
+ unitId: s,
1306
1306
  subUnitId: a,
1307
- cellValue: _.getData()
1307
+ cellValue: g.getData()
1308
1308
  }
1309
- }, I = {
1310
- id: se.id,
1311
- params: ot(t, f.params)
1309
+ }, w = {
1310
+ id: oe.id,
1311
+ params: st(t, p.params)
1312
1312
  };
1313
- l.push(f), u.push(I);
1313
+ l.push(p), u.push(w);
1314
1314
  }
1315
1315
  return {
1316
1316
  redoMutations: l,
1317
1317
  undoMutations: u
1318
1318
  };
1319
1319
  }
1320
- const ha = {
1320
+ const pa = {
1321
1321
  type: z.COMMAND,
1322
1322
  id: "sheet.command.updateDataValidationRuleRange",
1323
- handler(o, a) {
1323
+ handler(s, a) {
1324
1324
  if (!a)
1325
1325
  return !1;
1326
- const { unitId: e, subUnitId: t, ranges: r, ruleId: i } = a, s = o.get(F), n = o.get(x), l = o.get(Z);
1327
- if (!s.getRuleById(e, t, i))
1326
+ const { unitId: e, subUnitId: t, ranges: r, ruleId: i } = a, o = s.get(F), n = s.get(x), l = s.get(Z);
1327
+ if (!o.getRuleById(e, t, i))
1328
1328
  return !1;
1329
- const d = s.getRuleObjectMatrix(e, t).clone();
1329
+ const d = o.getRuleObjectMatrix(e, t).clone();
1330
1330
  d.updateRange(i, r);
1331
- const c = d.diff(s.getRules(e, t)), { redoMutations: m, undoMutations: p } = be(e, t, c, o);
1331
+ const c = d.diff(o.getRules(e, t)), { redoMutations: m, undoMutations: _ } = be(e, t, c, s);
1332
1332
  return l.pushUndoRedo({
1333
- undoMutations: p,
1333
+ undoMutations: _,
1334
1334
  redoMutations: m,
1335
1335
  unitID: e
1336
- }), Oe(m, n), !0;
1336
+ }), Ie(m, n), !0;
1337
1337
  }
1338
- }, ma = {
1338
+ }, Ra = {
1339
1339
  type: z.COMMAND,
1340
1340
  id: "sheet.command.addDataValidation",
1341
- handler(o, a) {
1341
+ handler(s, a) {
1342
1342
  if (!a)
1343
1343
  return !1;
1344
- const { unitId: e, subUnitId: t, rule: r } = a, i = o.get(F), s = o.get(x), n = o.get(Z), l = i.getRuleObjectMatrix(e, t).clone();
1344
+ const { unitId: e, subUnitId: t, rule: r } = a, i = s.get(F), o = s.get(x), n = s.get(Z), l = i.getRuleObjectMatrix(e, t).clone();
1345
1345
  l.addRule(r);
1346
1346
  const u = l.diff(i.getRules(e, t)), d = i.getValidator(r.type), c = {
1347
1347
  unitId: e,
@@ -1350,11 +1350,11 @@ const ha = {
1350
1350
  ...r,
1351
1351
  ...d == null ? void 0 : d.normalizeFormula(r, e, t)
1352
1352
  }
1353
- }, { redoMutations: m, undoMutations: p } = be(e, t, u, o);
1353
+ }, { redoMutations: m, undoMutations: _ } = be(e, t, u, s);
1354
1354
  return m.push({
1355
1355
  id: L.id,
1356
1356
  params: c
1357
- }), p.unshift({
1357
+ }), _.unshift({
1358
1358
  id: A.id,
1359
1359
  params: {
1360
1360
  unitId: e,
@@ -1364,101 +1364,101 @@ const ha = {
1364
1364
  }), n.pushUndoRedo({
1365
1365
  unitID: e,
1366
1366
  redoMutations: m,
1367
- undoMutations: p
1368
- }), Oe(m, s), !0;
1367
+ undoMutations: _
1368
+ }), Ie(m, o), !0;
1369
1369
  }
1370
- }, ga = {
1370
+ }, Sa = {
1371
1371
  type: z.COMMAND,
1372
1372
  id: "sheets.command.update-data-validation-setting",
1373
1373
  // eslint-disable-next-line max-lines-per-function
1374
- handler(o, a) {
1374
+ handler(s, a) {
1375
1375
  if (!a)
1376
1376
  return !1;
1377
- const e = o.get(x), 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);
1377
+ const e = s.get(x), t = s.get(Z), r = s.get(F), i = s.get(G), { unitId: o, subUnitId: n, ruleId: l, setting: u } = a, d = i.getValidatorItem(u.type);
1378
1378
  if (!d)
1379
1379
  return !1;
1380
- const c = r.getRuleById(s, n, l);
1380
+ const c = r.getRuleById(o, n, l);
1381
1381
  if (!c)
1382
1382
  return !1;
1383
1383
  const m = { ...c, ...u };
1384
- if (!d.validatorFormula(m, s, n).success)
1384
+ if (!d.validatorFormula(m, o, n).success)
1385
1385
  return !1;
1386
- const p = {
1387
- unitId: s,
1386
+ const _ = {
1387
+ unitId: o,
1388
1388
  subUnitId: n,
1389
1389
  ruleId: l,
1390
1390
  payload: {
1391
1391
  type: y.SETTING,
1392
1392
  payload: {
1393
1393
  ...u,
1394
- ...d.normalizeFormula(m, s, n)
1394
+ ...d.normalizeFormula(m, o, n)
1395
1395
  }
1396
1396
  }
1397
- }, _ = [{
1397
+ }, g = [{
1398
1398
  id: E.id,
1399
- params: p
1400
- }], v = {
1401
- unitId: s,
1399
+ params: _
1400
+ }], R = {
1401
+ unitId: o,
1402
1402
  subUnitId: n,
1403
1403
  ruleId: l,
1404
1404
  payload: {
1405
1405
  type: y.SETTING,
1406
- payload: Dt(c)
1406
+ payload: bt(c)
1407
1407
  }
1408
1408
  }, M = [{
1409
1409
  id: E.id,
1410
- params: v
1410
+ params: R
1411
1411
  }];
1412
1412
  if (u.type === T.CHECKBOX) {
1413
- const I = c.ranges, P = o.get(w), B = Ye(P, { unitId: s, subUnitId: n });
1413
+ const w = c.ranges, H = s.get(O), B = Ye(H, { unitId: o, subUnitId: n });
1414
1414
  if (B) {
1415
- const $ = new Se(), { worksheet: U } = B, { formula2: J = Me, formula1: ce = Ve } = c, { formula2: he = Me, formula1: me = Ve } = u;
1415
+ const W = new ve(), { worksheet: U } = B, { formula2: J = Me, formula1: ce = Ve } = c, { formula2: he = Me, formula1: me = Ve } = u;
1416
1416
  let Le = !1;
1417
- if (I.forEach((ge) => {
1418
- b.foreach(ge, (ae, xe) => {
1419
- const k = U.getCellRaw(ae, xe), Ke = ct(k);
1420
- (gt(k) || Ke === String(J)) && !(k != null && k.p) ? ($.setValue(ae, xe, {
1417
+ if (w.forEach((fe) => {
1418
+ b.foreach(fe, (ae, xe) => {
1419
+ const j = U.getCellRaw(ae, xe), Ke = ct(j);
1420
+ (ft(j) || Ke === String(J)) && !(j != null && j.p) ? (W.setValue(ae, xe, {
1421
1421
  v: he,
1422
1422
  p: null
1423
- }), Le = !0) : Ke === String(ce) && !(k != null && k.p) && ($.setValue(ae, xe, {
1423
+ }), Le = !0) : Ke === String(ce) && !(j != null && j.p) && (W.setValue(ae, xe, {
1424
1424
  v: me,
1425
1425
  p: null
1426
1426
  }), Le = !0);
1427
1427
  });
1428
1428
  }), Le) {
1429
- const ge = {
1430
- id: se.id,
1429
+ const fe = {
1430
+ id: oe.id,
1431
1431
  params: {
1432
- unitId: s,
1432
+ unitId: o,
1433
1433
  subUnitId: n,
1434
- cellValue: $.getData()
1434
+ cellValue: W.getData()
1435
1435
  }
1436
1436
  }, ae = {
1437
- id: se.id,
1438
- params: ot(o, ge.params)
1437
+ id: oe.id,
1438
+ params: st(s, fe.params)
1439
1439
  };
1440
- _.push(ge), M.push(ae);
1440
+ g.push(fe), M.push(ae);
1441
1441
  }
1442
1442
  }
1443
1443
  }
1444
- return Oe(_, e).result ? (t.pushUndoRedo({
1445
- unitID: s,
1446
- redoMutations: _,
1444
+ return Ie(g, e).result ? (t.pushUndoRedo({
1445
+ unitID: o,
1446
+ redoMutations: g,
1447
1447
  undoMutations: M
1448
1448
  }), !0) : !1;
1449
1449
  }
1450
- }, _a = {
1450
+ }, va = {
1451
1451
  type: z.COMMAND,
1452
1452
  id: "sheets.command.update-data-validation-options",
1453
- handler(o, a) {
1453
+ handler(s, a) {
1454
1454
  if (!a)
1455
1455
  return !1;
1456
- const e = o.get(x), t = o.get(Z), r = o.get(F), { unitId: i, subUnitId: s, ruleId: n, options: l } = a, u = r.getRuleById(i, s, n);
1456
+ const e = s.get(x), t = s.get(Z), r = s.get(F), { unitId: i, subUnitId: o, ruleId: n, options: l } = a, u = r.getRuleById(i, o, n);
1457
1457
  if (!u)
1458
1458
  return !1;
1459
1459
  const d = {
1460
1460
  unitId: i,
1461
- subUnitId: s,
1461
+ subUnitId: o,
1462
1462
  ruleId: n,
1463
1463
  payload: {
1464
1464
  type: y.OPTIONS,
@@ -1469,46 +1469,46 @@ const ha = {
1469
1469
  params: d
1470
1470
  }], m = {
1471
1471
  unitId: i,
1472
- subUnitId: s,
1472
+ subUnitId: o,
1473
1473
  ruleId: n,
1474
1474
  payload: {
1475
1475
  type: y.OPTIONS,
1476
- payload: bt(u)
1476
+ payload: Lt(u)
1477
1477
  }
1478
- }, p = [{
1478
+ }, _ = [{
1479
1479
  id: E.id,
1480
1480
  params: m
1481
1481
  }];
1482
1482
  return t.pushUndoRedo({
1483
1483
  unitID: i,
1484
1484
  redoMutations: c,
1485
- undoMutations: p
1485
+ undoMutations: _
1486
1486
  }), e.executeCommand(E.id, d), !0;
1487
1487
  }
1488
- }, pa = {
1488
+ }, Va = {
1489
1489
  type: z.COMMAND,
1490
1490
  id: "sheets.command.clear-range-data-validation",
1491
- handler(o, a) {
1491
+ handler(s, a) {
1492
1492
  if (!a)
1493
1493
  return !1;
1494
- const { unitId: e, subUnitId: t, ranges: r } = a, i = o.get(x), s = o.get(w), n = Ye(s, { unitId: e, subUnitId: t }), l = o.get(F);
1494
+ const { unitId: e, subUnitId: t, ranges: r } = a, i = s.get(x), o = s.get(O), n = Ye(o, { unitId: e, subUnitId: t }), l = s.get(F);
1495
1495
  if (!n) return !1;
1496
- const u = o.get(Z), d = l.getRuleObjectMatrix(e, t).clone();
1496
+ const u = s.get(Z), d = l.getRuleObjectMatrix(e, t).clone();
1497
1497
  d.removeRange(r);
1498
- const c = d.diff(l.getRules(e, t)), { redoMutations: m, undoMutations: p } = be(e, t, c, o);
1498
+ const c = d.diff(l.getRules(e, t)), { redoMutations: m, undoMutations: _ } = be(e, t, c, s);
1499
1499
  return u.pushUndoRedo({
1500
1500
  unitID: e,
1501
1501
  redoMutations: m,
1502
- undoMutations: p
1503
- }), Oe(m, i).result;
1502
+ undoMutations: _
1503
+ }), Ie(m, i).result;
1504
1504
  }
1505
- }, fa = {
1505
+ }, Ma = {
1506
1506
  type: z.COMMAND,
1507
1507
  id: "sheet.command.remove-all-data-validation",
1508
- handler(o, a) {
1508
+ handler(s, a) {
1509
1509
  if (!a)
1510
1510
  return !1;
1511
- const { unitId: e, subUnitId: t } = a, r = o.get(x), i = o.get(F), s = o.get(Z), n = [...i.getRules(e, t)], l = {
1511
+ const { unitId: e, subUnitId: t } = a, r = s.get(x), i = s.get(F), o = s.get(Z), n = [...i.getRules(e, t)], l = {
1512
1512
  unitId: e,
1513
1513
  subUnitId: t,
1514
1514
  ruleId: n.map((c) => c.uid)
@@ -1523,14 +1523,14 @@ const ha = {
1523
1523
  rule: n
1524
1524
  }
1525
1525
  }];
1526
- return s.pushUndoRedo({
1526
+ return o.pushUndoRedo({
1527
1527
  redoMutations: u,
1528
1528
  undoMutations: d,
1529
1529
  unitID: e
1530
1530
  }), r.executeCommand(A.id, l), !0;
1531
1531
  }
1532
- }, va = (o, a) => {
1533
- const e = o.get(F), { unitId: t, subUnitId: r, ruleId: i, source: s } = a;
1532
+ }, ya = (s, a) => {
1533
+ const e = s.get(F), { unitId: t, subUnitId: r, ruleId: i, source: o } = a;
1534
1534
  if (Array.isArray(i)) {
1535
1535
  const l = i.map((u) => e.getRuleById(t, r, u)).filter(Boolean);
1536
1536
  return [{
@@ -1539,7 +1539,7 @@ const ha = {
1539
1539
  unitId: t,
1540
1540
  subUnitId: r,
1541
1541
  rule: l,
1542
- source: s
1542
+ source: o
1543
1543
  }
1544
1544
  }];
1545
1545
  }
@@ -1554,13 +1554,13 @@ const ha = {
1554
1554
  index: e.getRuleIndex(t, r, i)
1555
1555
  }
1556
1556
  }];
1557
- }, Ra = {
1557
+ }, Ea = {
1558
1558
  type: z.COMMAND,
1559
1559
  id: "sheet.command.remove-data-validation-rule",
1560
- handler(o, a) {
1560
+ handler(s, a) {
1561
1561
  if (!a)
1562
1562
  return !1;
1563
- const { unitId: e, subUnitId: t, ruleId: r } = a, i = o.get(x), s = o.get(Z), n = o.get(F), l = [{
1563
+ const { unitId: e, subUnitId: t, ruleId: r } = a, i = s.get(x), o = s.get(Z), n = s.get(F), l = [{
1564
1564
  id: A.id,
1565
1565
  params: a
1566
1566
  }], u = [{
@@ -1574,23 +1574,23 @@ const ha = {
1574
1574
  index: n.getRuleIndex(e, t, r)
1575
1575
  }
1576
1576
  }];
1577
- return s.pushUndoRedo({
1577
+ return o.pushUndoRedo({
1578
1578
  undoMutations: u,
1579
1579
  redoMutations: l,
1580
1580
  unitID: a.unitId
1581
1581
  }), i.executeCommand(A.id, a), !0;
1582
1582
  }
1583
- }, Sa = "sheets-data-validation.config", tt = {};
1584
- var Va = Object.getOwnPropertyDescriptor, Ma = (o, a, e, t) => {
1585
- for (var r = t > 1 ? void 0 : t ? Va(a, e) : a, i = o.length - 1, s; i >= 0; i--)
1586
- (s = o[i]) && (r = s(r) || r);
1587
- return r;
1588
- }, We = (o, a) => (e, t) => a(e, t, o);
1589
- let Ee = class extends W {
1583
+ }, Ta = "sheets-data-validation.config", tt = {};
1584
+ var Fa = Object.defineProperty, Na = Object.getOwnPropertyDescriptor, Ca = (s, a, e, t) => {
1585
+ for (var r = t > 1 ? void 0 : t ? Na(a, e) : a, i = s.length - 1, o; i >= 0; i--)
1586
+ (o = s[i]) && (r = (t ? o(a, e, r) : o(r)) || r);
1587
+ return t && r && Fa(a, e, r), r;
1588
+ }, $e = (s, a) => (e, t) => a(e, t, s);
1589
+ let Ee = class extends $ {
1590
1590
  constructor(a, e, t) {
1591
1591
  super();
1592
- g(this, "_disposableMap", /* @__PURE__ */ new Map());
1593
- g(this, "registerRule", (a, e, t) => {
1592
+ f(this, "_disposableMap", /* @__PURE__ */ new Map());
1593
+ f(this, "registerRule", (a, e, t) => {
1594
1594
  de(t.type, this._validatorRegistryService) && this.register(a, e, t);
1595
1595
  });
1596
1596
  this._dataValidationModel = a, this._formulaRefRangeService = e, this._validatorRegistryService = t, this._initRefRange();
@@ -1600,7 +1600,7 @@ let Ee = class extends W {
1600
1600
  }
1601
1601
  // eslint-disable-next-line max-lines-per-function
1602
1602
  register(a, e, t) {
1603
- const r = t.ranges, i = t.formula1, s = t.formula2, n = this._formulaRefRangeService.registerRangeFormula(a, e, r, [i != null ? i : "", s != null ? s : ""], (u) => {
1603
+ const r = t.ranges, i = t.formula1, o = t.formula2, n = this._formulaRefRangeService.registerRangeFormula(a, e, r, [i != null ? i : "", o != null ? o : ""], (u) => {
1604
1604
  if (u.length === 0)
1605
1605
  return {
1606
1606
  undos: [{
@@ -1650,14 +1650,14 @@ let Ee = class extends W {
1650
1650
  payload: {
1651
1651
  ranges: r,
1652
1652
  formula1: i,
1653
- formula2: s
1653
+ formula2: o
1654
1654
  }
1655
1655
  },
1656
1656
  source: "patched"
1657
1657
  }
1658
1658
  });
1659
- for (let p = 1; p < u.length; p++) {
1660
- const _ = u[p], v = Mt();
1659
+ for (let _ = 1; _ < u.length; _++) {
1660
+ const g = u[_], R = yt();
1661
1661
  d.push({
1662
1662
  id: L.id,
1663
1663
  params: {
@@ -1665,10 +1665,10 @@ let Ee = class extends W {
1665
1665
  subUnitId: e,
1666
1666
  rule: {
1667
1667
  ...t,
1668
- uid: v,
1669
- formula1: _.formulas[0],
1670
- formula2: _.formulas[1],
1671
- ranges: _.ranges
1668
+ uid: R,
1669
+ formula1: g.formulas[0],
1670
+ formula2: g.formulas[1],
1671
+ ranges: g.ranges
1672
1672
  },
1673
1673
  source: "patched"
1674
1674
  }
@@ -1677,7 +1677,7 @@ let Ee = class extends W {
1677
1677
  params: {
1678
1678
  unitId: a,
1679
1679
  subUnitId: e,
1680
- ruleId: v,
1680
+ ruleId: R,
1681
1681
  source: "patched"
1682
1682
  }
1683
1683
  });
@@ -1693,99 +1693,99 @@ let Ee = class extends W {
1693
1693
  const a = this._dataValidationModel.getAll();
1694
1694
  for (const [e, t] of a)
1695
1695
  for (const [r, i] of t)
1696
- for (const s of i)
1697
- this.registerRule(e, r, s);
1696
+ for (const o of i)
1697
+ this.registerRule(e, r, o);
1698
1698
  this.disposeWithMe(
1699
1699
  this._dataValidationModel.ruleChange$.subscribe((e) => {
1700
1700
  const { unitId: t, subUnitId: r, rule: i } = e;
1701
1701
  switch (e.type) {
1702
1702
  case "add": {
1703
- const s = e.rule;
1704
- this.registerRule(e.unitId, e.subUnitId, s);
1703
+ const o = e.rule;
1704
+ this.registerRule(e.unitId, e.subUnitId, o);
1705
1705
  break;
1706
1706
  }
1707
1707
  case "remove": {
1708
- const s = this._disposableMap.get(this._getIdWithUnitId(t, r, i.uid));
1709
- s && s.dispose();
1708
+ const o = this._disposableMap.get(this._getIdWithUnitId(t, r, i.uid));
1709
+ o && o.dispose();
1710
1710
  break;
1711
1711
  }
1712
1712
  case "update": {
1713
- const s = e.rule, n = this._disposableMap.get(this._getIdWithUnitId(t, r, s.uid));
1714
- n && n.dispose(), this.registerRule(e.unitId, e.subUnitId, s);
1713
+ const o = e.rule, n = this._disposableMap.get(this._getIdWithUnitId(t, r, o.uid));
1714
+ n && n.dispose(), this.registerRule(e.unitId, e.subUnitId, o);
1715
1715
  break;
1716
1716
  }
1717
1717
  }
1718
1718
  })
1719
- ), this.disposeWithMe(Qe(() => {
1719
+ ), this.disposeWithMe(qe(() => {
1720
1720
  this._disposableMap.forEach((e) => {
1721
1721
  e.dispose();
1722
1722
  }), this._disposableMap.clear();
1723
1723
  }));
1724
1724
  }
1725
1725
  };
1726
- Ee = Ma([
1727
- We(0, R(F)),
1728
- We(1, R(ut)),
1729
- We(2, R(q))
1726
+ Ee = Ca([
1727
+ $e(0, S(F)),
1728
+ $e(1, S(ut)),
1729
+ $e(2, S(G))
1730
1730
  ], Ee);
1731
- var _t = /* @__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))(_t || {}), ya = Object.getOwnPropertyDescriptor, Ea = (o, a, e, t) => {
1732
- for (var r = t > 1 ? void 0 : t ? ya(a, e) : a, i = o.length - 1, s; i >= 0; i--)
1733
- (s = o[i]) && (r = s(r) || r);
1734
- return r;
1735
- }, Pe = (o, a) => (e, t) => a(e, t, o);
1736
- let Te = class extends W {
1737
- constructor(o, a, e) {
1738
- super(), this._univerInstanceService = o, this._permissionService = a, this._lexerTreeBuilder = e;
1739
- }
1740
- getFormulaRefCheck(o) {
1731
+ var gt = /* @__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))(gt || {}), Oa = Object.defineProperty, wa = Object.getOwnPropertyDescriptor, Ia = (s, a, e, t) => {
1732
+ for (var r = t > 1 ? void 0 : t ? wa(a, e) : a, i = s.length - 1, o; i >= 0; i--)
1733
+ (o = s[i]) && (r = (t ? o(a, e, r) : o(r)) || r);
1734
+ return t && r && Oa(a, e, r), r;
1735
+ }, He = (s, a) => (e, t) => a(e, t, s);
1736
+ let Te = class extends $ {
1737
+ constructor(s, a, e) {
1738
+ super(), this._univerInstanceService = s, this._permissionService = a, this._lexerTreeBuilder = e;
1739
+ }
1740
+ getFormulaRefCheck(s) {
1741
1741
  var e, t;
1742
- const a = this._lexerTreeBuilder.sequenceNodesBuilder(o);
1742
+ const a = this._lexerTreeBuilder.sequenceNodesBuilder(s);
1743
1743
  if (!a)
1744
1744
  return !0;
1745
1745
  for (let r = 0; r < a.length; r++) {
1746
1746
  const i = a[r];
1747
1747
  if (typeof i == "string")
1748
1748
  continue;
1749
- const { token: s } = i, n = Qt(s), l = this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET);
1749
+ const { token: o } = i, n = Gt(o), l = this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET);
1750
1750
  let u = l.getActiveSheet();
1751
1751
  const d = l.getUnitId();
1752
1752
  if (n.sheetName) {
1753
1753
  if (u = l.getSheetBySheetName(n.sheetName), !u)
1754
1754
  return !1;
1755
- const v = u == null ? void 0 : u.getSheetId();
1756
- if (!this._permissionService.getPermissionPoint(new xt(d, v).id)) return !1;
1755
+ const R = u == null ? void 0 : u.getSheetId();
1756
+ if (!this._permissionService.getPermissionPoint(new Bt(d, R).id)) return !1;
1757
1757
  }
1758
1758
  if (!u)
1759
1759
  return !1;
1760
- const { startRow: c, endRow: m, startColumn: p, endColumn: _ } = n.range;
1761
- for (let v = c; v <= m; v++)
1762
- for (let M = p; M <= _; M++) {
1763
- const f = (t = (e = u.getCell(v, M)) == null ? void 0 : e.selectionProtection) == null ? void 0 : t[0];
1764
- if ((f == null ? void 0 : f[_t.View]) === !1)
1760
+ const { startRow: c, endRow: m, startColumn: _, endColumn: g } = n.range;
1761
+ for (let R = c; R <= m; R++)
1762
+ for (let M = _; M <= g; M++) {
1763
+ const p = (t = (e = u.getCell(R, M)) == null ? void 0 : e.selectionProtection) == null ? void 0 : t[0];
1764
+ if ((p == null ? void 0 : p[gt.View]) === !1)
1765
1765
  return !1;
1766
1766
  }
1767
1767
  }
1768
1768
  return !0;
1769
1769
  }
1770
1770
  };
1771
- Te = Ea([
1772
- Pe(0, w),
1773
- Pe(1, yt),
1774
- Pe(2, R(Y))
1771
+ Te = Ia([
1772
+ He(0, O),
1773
+ He(1, Et),
1774
+ He(2, S(Y))
1775
1775
  ], Te);
1776
- var Ta = Object.getOwnPropertyDescriptor, Fa = (o, a, e, t) => {
1777
- for (var r = t > 1 ? void 0 : t ? Ta(a, e) : a, i = o.length - 1, s; i >= 0; i--)
1778
- (s = o[i]) && (r = s(r) || r);
1779
- return r;
1780
- }, ee = (o, a) => (e, t) => a(e, t, o);
1781
- let Fe = class extends W {
1782
- constructor(a, e, t, r, i, s) {
1776
+ var Aa = Object.defineProperty, Da = Object.getOwnPropertyDescriptor, ba = (s, a, e, t) => {
1777
+ for (var r = t > 1 ? void 0 : t ? Da(a, e) : a, i = s.length - 1, o; i >= 0; i--)
1778
+ (o = s[i]) && (r = (t ? o(a, e, r) : o(r)) || r);
1779
+ return t && r && Aa(a, e, r), r;
1780
+ }, ee = (s, a) => (e, t) => a(e, t, s);
1781
+ let Fe = class extends $ {
1782
+ constructor(a, e, t, r, i, o) {
1783
1783
  super();
1784
- g(this, "_disposableMap", /* @__PURE__ */ new Map());
1785
- g(this, "registerRule", (a, e, t) => {
1784
+ f(this, "_disposableMap", /* @__PURE__ */ new Map());
1785
+ f(this, "registerRule", (a, e, t) => {
1786
1786
  de(t.type, this._validatorRegistryService) || (this.register(a, e, t), this.registerFormula(a, e, t));
1787
1787
  });
1788
- this._dataValidationModel = a, this._injector = e, this._refRangeService = t, this._dataValidationFormulaService = r, this._formulaRefRangeService = i, this._validatorRegistryService = s, this._initRefRange();
1788
+ this._dataValidationModel = a, this._injector = e, this._refRangeService = t, this._dataValidationFormulaService = r, this._formulaRefRangeService = i, this._validatorRegistryService = o, this._initRefRange();
1789
1789
  }
1790
1790
  _getIdWithUnitId(a, e, t) {
1791
1791
  return `${a}_${e}_${t}`;
@@ -1793,14 +1793,14 @@ let Fe = class extends W {
1793
1793
  // eslint-disable-next-line max-lines-per-function
1794
1794
  registerFormula(a, e, t) {
1795
1795
  var u;
1796
- const r = t.uid, i = this._getIdWithUnitId(a, e, r), s = (u = this._disposableMap.get(i)) != null ? u : /* @__PURE__ */ new Set(), n = (d, c) => {
1796
+ const r = t.uid, i = this._getIdWithUnitId(a, e, r), o = (u = this._disposableMap.get(i)) != null ? u : /* @__PURE__ */ new Set(), n = (d, c) => {
1797
1797
  const m = this._dataValidationModel.getRuleById(a, e, r);
1798
1798
  if (!m)
1799
1799
  return { redos: [], undos: [] };
1800
- const p = m[d];
1801
- if (!p || p === c)
1800
+ const _ = m[d];
1801
+ if (!_ || _ === c)
1802
1802
  return { redos: [], undos: [] };
1803
- const _ = {
1803
+ const g = {
1804
1804
  unitId: a,
1805
1805
  subUnitId: e,
1806
1806
  ruleId: t.uid,
@@ -1814,7 +1814,7 @@ let Fe = class extends W {
1814
1814
  }
1815
1815
  },
1816
1816
  source: "patched"
1817
- }, v = {
1817
+ }, R = {
1818
1818
  unitId: a,
1819
1819
  subUnitId: e,
1820
1820
  ruleId: t.uid,
@@ -1830,15 +1830,15 @@ let Fe = class extends W {
1830
1830
  }, M = [
1831
1831
  {
1832
1832
  id: E.id,
1833
- params: _
1833
+ params: g
1834
1834
  }
1835
- ], f = [
1835
+ ], p = [
1836
1836
  {
1837
1837
  id: E.id,
1838
- params: v
1838
+ params: R
1839
1839
  }
1840
1840
  ];
1841
- return { redos: M, undos: f };
1841
+ return { redos: M, undos: p };
1842
1842
  }, l = this._dataValidationFormulaService.getRuleFormulaInfo(a, e, r);
1843
1843
  if (l) {
1844
1844
  const [d, c] = l;
@@ -1847,29 +1847,29 @@ let Fe = class extends W {
1847
1847
  a,
1848
1848
  e,
1849
1849
  d.text,
1850
- (p) => n("formula1", p)
1850
+ (_) => n("formula1", _)
1851
1851
  );
1852
- s.add(() => m.dispose());
1852
+ o.add(() => m.dispose());
1853
1853
  }
1854
1854
  if (c) {
1855
1855
  const m = this._formulaRefRangeService.registerFormula(
1856
1856
  a,
1857
1857
  e,
1858
1858
  c.text,
1859
- (p) => n("formula2", p)
1859
+ (_) => n("formula2", _)
1860
1860
  );
1861
- s.add(() => m.dispose());
1861
+ o.add(() => m.dispose());
1862
1862
  }
1863
1863
  }
1864
1864
  }
1865
1865
  register(a, e, t) {
1866
1866
  var l;
1867
1867
  const r = (u) => {
1868
- const d = [...t.ranges], m = d.map((_) => Ut(_, u)).filter((_) => !!_).flat();
1868
+ const d = [...t.ranges], m = d.map((g) => Pt(g, u)).filter((g) => !!g).flat();
1869
1869
  if (rt(m, d))
1870
1870
  return { redos: [], undos: [] };
1871
1871
  if (m.length) {
1872
- const _ = {
1872
+ const g = {
1873
1873
  unitId: a,
1874
1874
  subUnitId: e,
1875
1875
  ruleId: t.uid,
@@ -1878,7 +1878,7 @@ let Fe = class extends W {
1878
1878
  payload: m
1879
1879
  },
1880
1880
  source: "patched"
1881
- }, v = [{ id: E.id, params: _ }], M = [{
1881
+ }, R = [{ id: E.id, params: g }], M = [{
1882
1882
  id: E.id,
1883
1883
  params: {
1884
1884
  unitId: a,
@@ -1891,86 +1891,86 @@ let Fe = class extends W {
1891
1891
  source: "patched"
1892
1892
  }
1893
1893
  }];
1894
- return { redos: v, undos: M };
1894
+ return { redos: R, undos: M };
1895
1895
  } else {
1896
- const _ = { unitId: a, subUnitId: e, ruleId: t.uid }, v = [{ id: A.id, params: _ }], M = va(this._injector, _);
1897
- return { redos: v, undos: M };
1896
+ const g = { unitId: a, subUnitId: e, ruleId: t.uid }, R = [{ id: A.id, params: g }], M = ya(this._injector, g);
1897
+ return { redos: R, undos: M };
1898
1898
  }
1899
1899
  }, i = [];
1900
1900
  t.ranges.forEach((u) => {
1901
1901
  const d = this._refRangeService.registerRefRange(u, r, a, e);
1902
1902
  i.push(() => d.dispose());
1903
1903
  });
1904
- const s = this._getIdWithUnitId(a, e, t.uid), n = (l = this._disposableMap.get(s)) != null ? l : /* @__PURE__ */ new Set();
1905
- n.add(() => i.forEach((u) => u())), this._disposableMap.set(s, n);
1904
+ const o = this._getIdWithUnitId(a, e, t.uid), n = (l = this._disposableMap.get(o)) != null ? l : /* @__PURE__ */ new Set();
1905
+ n.add(() => i.forEach((u) => u())), this._disposableMap.set(o, n);
1906
1906
  }
1907
1907
  _initRefRange() {
1908
1908
  const a = this._dataValidationModel.getAll();
1909
1909
  for (const [e, t] of a)
1910
1910
  for (const [r, i] of t)
1911
- for (const s of i)
1912
- this.registerRule(e, r, s);
1911
+ for (const o of i)
1912
+ this.registerRule(e, r, o);
1913
1913
  this.disposeWithMe(
1914
1914
  this._dataValidationModel.ruleChange$.subscribe((e) => {
1915
1915
  const { unitId: t, subUnitId: r, rule: i } = e;
1916
1916
  switch (e.type) {
1917
1917
  case "add": {
1918
- const s = e.rule;
1919
- this.registerRule(e.unitId, e.subUnitId, s);
1918
+ const o = e.rule;
1919
+ this.registerRule(e.unitId, e.subUnitId, o);
1920
1920
  break;
1921
1921
  }
1922
1922
  case "remove": {
1923
- const s = this._disposableMap.get(this._getIdWithUnitId(t, r, i.uid));
1924
- s && s.forEach((n) => n());
1923
+ const o = this._disposableMap.get(this._getIdWithUnitId(t, r, i.uid));
1924
+ o && o.forEach((n) => n());
1925
1925
  break;
1926
1926
  }
1927
1927
  case "update": {
1928
- const s = e.rule, n = this._disposableMap.get(this._getIdWithUnitId(t, r, s.uid));
1929
- n && n.forEach((l) => l()), this.registerRule(e.unitId, e.subUnitId, s);
1928
+ const o = e.rule, n = this._disposableMap.get(this._getIdWithUnitId(t, r, o.uid));
1929
+ n && n.forEach((l) => l()), this.registerRule(e.unitId, e.subUnitId, o);
1930
1930
  break;
1931
1931
  }
1932
1932
  }
1933
1933
  })
1934
- ), this.disposeWithMe(Qe(() => {
1934
+ ), this.disposeWithMe(qe(() => {
1935
1935
  this._disposableMap.forEach((e) => {
1936
1936
  e.forEach((t) => t());
1937
1937
  }), this._disposableMap.clear();
1938
1938
  }));
1939
1939
  }
1940
1940
  };
1941
- Fe = Fa([
1942
- ee(0, R(F)),
1943
- ee(1, R(qe)),
1944
- ee(2, R(Bt)),
1945
- ee(3, R(K)),
1946
- ee(4, R(ut)),
1947
- ee(5, R(q))
1941
+ Fe = ba([
1942
+ ee(0, S(F)),
1943
+ ee(1, S(Ge)),
1944
+ ee(2, S(Ut)),
1945
+ ee(3, S(K)),
1946
+ ee(4, S(ut)),
1947
+ ee(5, S(G))
1948
1948
  ], Fe);
1949
- var Na = Object.getOwnPropertyDescriptor, Ca = (o, a, e, t) => {
1950
- for (var r = t > 1 ? void 0 : t ? Na(a, e) : a, i = o.length - 1, s; i >= 0; i--)
1951
- (s = o[i]) && (r = s(r) || r);
1952
- return r;
1953
- }, $e = (o, a) => (e, t) => a(e, t, o);
1954
- let Ne = class extends W {
1955
- constructor(o, a, e) {
1956
- super(), this._sheetInterceptorService = o, this._univerInstanceService = a, this._sheetDataValidationModel = e, this._initSheetChange();
1949
+ var La = Object.defineProperty, xa = Object.getOwnPropertyDescriptor, Ba = (s, a, e, t) => {
1950
+ for (var r = t > 1 ? void 0 : t ? xa(a, e) : a, i = s.length - 1, o; i >= 0; i--)
1951
+ (o = s[i]) && (r = (t ? o(a, e, r) : o(r)) || r);
1952
+ return t && r && La(a, e, r), r;
1953
+ }, We = (s, a) => (e, t) => a(e, t, s);
1954
+ let Ne = class extends $ {
1955
+ constructor(s, a, e) {
1956
+ super(), this._sheetInterceptorService = s, this._univerInstanceService = a, this._sheetDataValidationModel = e, this._initSheetChange();
1957
1957
  }
1958
1958
  _initSheetChange() {
1959
1959
  this.disposeWithMe(
1960
1960
  this._sheetInterceptorService.interceptCommand({
1961
- getMutations: (o) => {
1961
+ getMutations: (s) => {
1962
1962
  var a;
1963
- if (o.id === Ht.id) {
1964
- const e = o.params, t = e.unitId || this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET).getUnitId(), r = this._univerInstanceService.getUniverSheetInstance(t);
1963
+ if (s.id === $t.id) {
1964
+ const e = s.params, t = e.unitId || this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET).getUnitId(), r = this._univerInstanceService.getUniverSheetInstance(t);
1965
1965
  if (!r)
1966
1966
  return { redos: [], undos: [] };
1967
1967
  const i = e.subUnitId || ((a = r.getActiveSheet()) == null ? void 0 : a.getSheetId());
1968
1968
  if (!i)
1969
1969
  return { redos: [], undos: [] };
1970
- const s = this._sheetDataValidationModel.getRules(t, i);
1971
- if (s.length === 0)
1970
+ const o = this._sheetDataValidationModel.getRules(t, i);
1971
+ if (o.length === 0)
1972
1972
  return { redos: [], undos: [] };
1973
- const n = s.map((d) => d.uid), l = {
1973
+ const n = o.map((d) => d.uid), l = {
1974
1974
  unitId: t,
1975
1975
  subUnitId: i,
1976
1976
  ruleId: n,
@@ -1978,7 +1978,7 @@ let Ne = class extends W {
1978
1978
  }, u = {
1979
1979
  unitId: t,
1980
1980
  subUnitId: i,
1981
- rule: [...s],
1981
+ rule: [...o],
1982
1982
  source: "patched"
1983
1983
  };
1984
1984
  return {
@@ -1998,19 +1998,19 @@ let Ne = class extends W {
1998
1998
  );
1999
1999
  }
2000
2000
  };
2001
- Ne = Ca([
2002
- $e(0, R(st)),
2003
- $e(1, R(w)),
2004
- $e(2, R(F))
2001
+ Ne = Ba([
2002
+ We(0, S(ot)),
2003
+ We(1, S(O)),
2004
+ We(2, S(F))
2005
2005
  ], Ne);
2006
- class wa extends G {
2006
+ class Ua extends k {
2007
2007
  constructor() {
2008
2008
  super(...arguments);
2009
- g(this, "id", T.ANY);
2010
- g(this, "title", "dataValidation.any.title");
2011
- g(this, "operators", []);
2012
- g(this, "scopes", ["sheet"]);
2013
- g(this, "offsetFormulaByRange", !1);
2009
+ f(this, "id", T.ANY);
2010
+ f(this, "title", "dataValidation.any.title");
2011
+ f(this, "operators", []);
2012
+ f(this, "scopes", ["sheet"]);
2013
+ f(this, "offsetFormulaByRange", !1);
2014
2014
  }
2015
2015
  async parseFormula(e, t, r) {
2016
2016
  return {
@@ -2031,19 +2031,19 @@ class wa extends G {
2031
2031
  return this.localeService.t("dataValidation.any.error");
2032
2032
  }
2033
2033
  }
2034
- class Ia extends G {
2034
+ class Pa extends k {
2035
2035
  constructor() {
2036
2036
  super(...arguments);
2037
- g(this, "id", T.CUSTOM);
2038
- g(this, "title", "dataValidation.custom.title");
2039
- g(this, "operators", []);
2040
- g(this, "scopes", ["sheet"]);
2041
- g(this, "_customFormulaService", this.injector.get(H));
2042
- g(this, "_lexerTreeBuilder", this.injector.get(Y));
2037
+ f(this, "id", T.CUSTOM);
2038
+ f(this, "title", "dataValidation.custom.title");
2039
+ f(this, "operators", []);
2040
+ f(this, "scopes", ["sheet"]);
2041
+ f(this, "_customFormulaService", this.injector.get(P));
2042
+ f(this, "_lexerTreeBuilder", this.injector.get(Y));
2043
2043
  }
2044
2044
  validatorFormula(e, t, r) {
2045
2045
  var u;
2046
- const i = S(e.formula1), s = (u = e.formula1) != null ? u : "", l = this._lexerTreeBuilder.checkIfAddBracket(s) === 0 && s.startsWith(qt.EQUALS);
2046
+ const i = v(e.formula1), o = (u = e.formula1) != null ? u : "", l = this._lexerTreeBuilder.checkIfAddBracket(o) === 0 && o.startsWith(kt.EQUALS);
2047
2047
  return {
2048
2048
  success: i && l,
2049
2049
  formula1: i && l ? "" : this.localeService.t("dataValidation.validFail.formula")
@@ -2057,8 +2057,8 @@ class Ia extends G {
2057
2057
  };
2058
2058
  }
2059
2059
  async isValidType(e, t, r) {
2060
- 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;
2061
- return C(String(d)) && V.isDefine(d) && d !== "" ? u.t === Et.BOOLEAN ? !!d : typeof d == "boolean" ? d : typeof d == "number" ? !!d : typeof d == "string" ? C(d) : !!d : !1;
2060
+ 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;
2061
+ return C(String(d)) && V.isDefine(d) && d !== "" ? u.t === Tt.BOOLEAN ? !!d : typeof d == "boolean" ? d : typeof d == "number" ? !!d : typeof d == "string" ? C(d) : !!d : !1;
2062
2062
  }
2063
2063
  generateRuleErrorMessage(e) {
2064
2064
  return this.localeService.t("dataValidation.custom.error");
@@ -2068,23 +2068,23 @@ class Ia extends G {
2068
2068
  return this.localeService.t("dataValidation.custom.ruleName").replace("{FORMULA1}", (t = e.formula1) != null ? t : "");
2069
2069
  }
2070
2070
  }
2071
- class Oa extends mt {
2071
+ class $a extends mt {
2072
2072
  constructor() {
2073
2073
  super(...arguments);
2074
- g(this, "id", T.LIST_MULTIPLE);
2075
- g(this, "title", "dataValidation.listMultiple.title");
2076
- g(this, "offsetFormulaByRange", !1);
2077
- g(this, "skipDefaultFontRender", () => !0);
2074
+ f(this, "id", T.LIST_MULTIPLE);
2075
+ f(this, "title", "dataValidation.listMultiple.title");
2076
+ f(this, "offsetFormulaByRange", !1);
2077
+ f(this, "skipDefaultFontRender", () => !0);
2078
2078
  }
2079
2079
  }
2080
- class Aa extends G {
2080
+ class Ha extends k {
2081
2081
  constructor() {
2082
2082
  super(...arguments);
2083
- g(this, "_customFormulaService", this.injector.get(H));
2084
- g(this, "_lexerTreeBuilder", this.injector.get(Y));
2085
- g(this, "id", T.WHOLE);
2086
- g(this, "title", "dataValidation.whole.title");
2087
- g(this, "operators", [
2083
+ f(this, "_customFormulaService", this.injector.get(P));
2084
+ f(this, "_lexerTreeBuilder", this.injector.get(Y));
2085
+ f(this, "id", T.WHOLE);
2086
+ f(this, "title", "dataValidation.whole.title");
2087
+ f(this, "operators", [
2088
2088
  h.BETWEEN,
2089
2089
  h.EQUAL,
2090
2090
  h.GREATER_THAN,
@@ -2094,14 +2094,14 @@ class Aa extends G {
2094
2094
  h.NOT_BETWEEN,
2095
2095
  h.NOT_EQUAL
2096
2096
  ]);
2097
- g(this, "scopes", ["sheet"]);
2097
+ f(this, "scopes", ["sheet"]);
2098
2098
  }
2099
2099
  _isFormulaOrInt(e) {
2100
- return !V.isBlank(e) && (S(e) || !Number.isNaN(+e) && Number.isInteger(+e));
2100
+ return !V.isBlank(e) && (v(e) || !Number.isNaN(+e) && Number.isInteger(+e));
2101
2101
  }
2102
2102
  async isValidType(e, t, r) {
2103
- const { value: i } = e, s = ye(i);
2104
- return !Number.isNaN(s) && Number.isInteger(s);
2103
+ const { value: i } = e, o = ye(i);
2104
+ return !Number.isNaN(o) && Number.isInteger(o);
2105
2105
  }
2106
2106
  transform(e, t, r) {
2107
2107
  const { value: i } = e;
@@ -2113,12 +2113,12 @@ class Aa extends G {
2113
2113
  _parseNumber(e) {
2114
2114
  return e == null ? Number.NaN : +e;
2115
2115
  }
2116
- async parseFormula(e, t, r, i, s) {
2117
- 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, m = S(d) ? l == null ? void 0 : l.v : d, p = C(`${c}`) && C(`${m}`);
2116
+ async parseFormula(e, t, r, i, o) {
2117
+ 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 = v(u) ? n == null ? void 0 : n.v : u, m = v(d) ? l == null ? void 0 : l.v : d, _ = C(`${c}`) && C(`${m}`);
2118
2118
  return {
2119
2119
  formula1: this._parseNumber(c),
2120
2120
  formula2: this._parseNumber(m),
2121
- isFormulaValid: p
2121
+ isFormulaValid: _
2122
2122
  };
2123
2123
  }
2124
2124
  validatorFormula(e, t, r) {
@@ -2127,13 +2127,13 @@ class Aa extends G {
2127
2127
  return {
2128
2128
  success: !1
2129
2129
  };
2130
- const s = V.isDefine(e.formula1) && this._isFormulaOrInt(e.formula1), n = V.isDefine(e.formula2) && this._isFormulaOrInt(e.formula2), l = Ae.includes(i), u = this.localeService.t("dataValidation.validFail.number");
2130
+ const o = V.isDefine(e.formula1) && this._isFormulaOrInt(e.formula1), n = V.isDefine(e.formula2) && this._isFormulaOrInt(e.formula2), l = Ae.includes(i), u = this.localeService.t("dataValidation.validFail.number");
2131
2131
  return l ? {
2132
- success: s && n,
2133
- formula1: s ? void 0 : u,
2132
+ success: o && n,
2133
+ formula1: o ? void 0 : u,
2134
2134
  formula2: n ? void 0 : u
2135
2135
  } : {
2136
- success: s,
2136
+ success: o,
2137
2137
  formula1: u
2138
2138
  };
2139
2139
  }
@@ -2144,44 +2144,44 @@ class Aa extends G {
2144
2144
  return `${this.localeService.t(ht[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
2145
2145
  }
2146
2146
  }
2147
- var Da = Object.getOwnPropertyDescriptor, ba = (o, a, e, t) => {
2148
- for (var r = t > 1 ? void 0 : t ? Da(a, e) : a, i = o.length - 1, s; i >= 0; i--)
2149
- (s = o[i]) && (r = s(r) || r);
2150
- return r;
2151
- }, te = (o, a) => (e, t) => a(e, t, o);
2152
- let Ce = class extends Tt {
2153
- constructor(o, a, e, t, r, i) {
2154
- super(), this._univerInstanceService = o, this._dataValidatorRegistryService = a, this._injector = e, this._selectionManagerService = t, this._sheetInterceptorService = r, this._sheetDataValidationModel = i, this._init();
2147
+ var Wa = Object.defineProperty, ja = Object.getOwnPropertyDescriptor, Qa = (s, a, e, t) => {
2148
+ for (var r = t > 1 ? void 0 : t ? ja(a, e) : a, i = s.length - 1, o; i >= 0; i--)
2149
+ (o = s[i]) && (r = (t ? o(a, e, r) : o(r)) || r);
2150
+ return t && r && Wa(a, e, r), r;
2151
+ }, te = (s, a) => (e, t) => a(e, t, s);
2152
+ let Ce = class extends Ft {
2153
+ constructor(s, a, e, t, r, i) {
2154
+ super(), this._univerInstanceService = s, this._dataValidatorRegistryService = a, this._injector = e, this._selectionManagerService = t, this._sheetInterceptorService = r, this._sheetDataValidationModel = i, this._init();
2155
2155
  }
2156
2156
  _init() {
2157
2157
  this._registerValidators(), this._initCommandInterceptor();
2158
2158
  }
2159
2159
  _registerValidators() {
2160
2160
  [
2161
- wa,
2162
- na,
2163
- Aa,
2161
+ Ua,
2162
+ ha,
2163
+ Ha,
2164
+ _a,
2164
2165
  ca,
2165
- sa,
2166
- aa,
2166
+ na,
2167
2167
  mt,
2168
- Oa,
2169
- Ia
2170
- ].forEach((o) => {
2171
- const a = this._injector.createInstance(o);
2172
- this.disposeWithMe(this._dataValidatorRegistryService.register(a)), this.disposeWithMe(Qe(() => this._injector.delete(o)));
2168
+ $a,
2169
+ Pa
2170
+ ].forEach((s) => {
2171
+ const a = this._injector.createInstance(s);
2172
+ this.disposeWithMe(this._dataValidatorRegistryService.register(a)), this.disposeWithMe(qe(() => this._injector.delete(s)));
2173
2173
  });
2174
2174
  }
2175
2175
  _initCommandInterceptor() {
2176
2176
  this._sheetInterceptorService.interceptCommand({
2177
- getMutations: (o) => {
2177
+ getMutations: (s) => {
2178
2178
  var a;
2179
- if (o.id === Wt.id) {
2179
+ if (s.id === Ht.id) {
2180
2180
  const e = this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET), t = e.getUnitId(), r = e.getActiveSheet();
2181
2181
  if (!r)
2182
2182
  throw new Error("No active sheet found");
2183
- const i = r.getSheetId(), s = (a = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : a.map((c) => c.range), n = this._sheetDataValidationModel.getRuleObjectMatrix(t, i).clone();
2184
- s && n.removeRange(s);
2183
+ const i = r.getSheetId(), o = (a = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : a.map((c) => c.range), n = this._sheetDataValidationModel.getRuleObjectMatrix(t, i).clone();
2184
+ o && n.removeRange(o);
2185
2185
  const l = n.diff(this._sheetDataValidationModel.getRules(t, i)), { redoMutations: u, undoMutations: d } = be(t, i, l, this._injector, "patched");
2186
2186
  return {
2187
2187
  undos: d,
@@ -2196,158 +2196,158 @@ let Ce = class extends Tt {
2196
2196
  });
2197
2197
  }
2198
2198
  };
2199
- Ce = ba([
2200
- te(0, w),
2201
- te(1, R(q)),
2202
- te(2, R(qe)),
2203
- te(3, R(nt)),
2204
- te(4, R(st)),
2205
- te(5, R(F))
2199
+ Ce = Qa([
2200
+ te(0, O),
2201
+ te(1, S(G)),
2202
+ te(2, S(Ge)),
2203
+ te(3, S(nt)),
2204
+ te(4, S(ot)),
2205
+ te(5, S(F))
2206
2206
  ], Ce);
2207
- var La = Object.getOwnPropertyDescriptor, xa = (o, a, e, t) => {
2208
- for (var r = t > 1 ? void 0 : t ? La(a, e) : a, i = o.length - 1, s; i >= 0; i--)
2209
- (s = o[i]) && (r = s(r) || r);
2210
- return r;
2211
- }, ve = (o, a) => (e, t) => a(e, t, o);
2212
- let we = class extends W {
2213
- constructor(o, a, e, t) {
2214
- super(), this._univerInstanceService = o, this._sheetDataValidationModel = a, this._dataValidationCacheService = e, this._lifecycleService = t, this._initRecalculate();
2207
+ var qa = Object.defineProperty, Ga = Object.getOwnPropertyDescriptor, ka = (s, a, e, t) => {
2208
+ for (var r = t > 1 ? void 0 : t ? Ga(a, e) : a, i = s.length - 1, o; i >= 0; i--)
2209
+ (o = s[i]) && (r = (t ? o(a, e, r) : o(r)) || r);
2210
+ return t && r && qa(a, e, r), r;
2211
+ }, Re = (s, a) => (e, t) => a(e, t, s);
2212
+ let Oe = class extends $ {
2213
+ constructor(s, a, e, t) {
2214
+ super(), this._univerInstanceService = s, this._sheetDataValidationModel = a, this._dataValidationCacheService = e, this._lifecycleService = t, this._initRecalculate();
2215
2215
  }
2216
2216
  _initRecalculate() {
2217
- const o = (a) => {
2217
+ const s = (a) => {
2218
2218
  if (a.length === 0)
2219
2219
  return;
2220
2220
  const e = this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET), t = e == null ? void 0 : e.getActiveSheet(), r = {};
2221
2221
  a.flat().forEach((i) => {
2222
2222
  r[i.unitId] || (r[i.unitId] = {}), r[i.unitId][i.subUnitId] || (r[i.unitId][i.subUnitId] = []);
2223
- const s = this._univerInstanceService.getUnit(i.unitId, N.UNIVER_SHEET), n = s == null ? void 0 : s.getSheetBySheetId(i.subUnitId);
2223
+ const o = this._univerInstanceService.getUnit(i.unitId, N.UNIVER_SHEET), n = o == null ? void 0 : o.getSheetBySheetId(i.subUnitId);
2224
2224
  n && r[i.unitId][i.subUnitId].push(...i.ranges.map((l) => b.transformRange(l, n)));
2225
- }), Object.entries(r).forEach(([i, s]) => {
2226
- Object.entries(s).forEach(([n, l]) => {
2225
+ }), Object.entries(r).forEach(([i, o]) => {
2226
+ Object.entries(o).forEach(([n, l]) => {
2227
2227
  (e == null ? void 0 : e.getUnitId()) === i && (t == null ? void 0 : t.getSheetId()) === n ? this.validatorRanges(i, n, l) : requestIdleCallback(() => {
2228
2228
  this.validatorRanges(i, n, l);
2229
2229
  });
2230
2230
  });
2231
2231
  });
2232
2232
  };
2233
- this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(Pt(() => this._lifecycleService.lifecycle$.pipe(Ze((a) => a === ze.Rendered)))).subscribe(o)), this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(Ze(() => this._lifecycleService.stage >= ze.Rendered), Nt(20)).subscribe(o));
2233
+ this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(Wt(() => this._lifecycleService.lifecycle$.pipe(Ze((a) => a === ze.Rendered)))).subscribe(s)), this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(Ze(() => this._lifecycleService.stage >= ze.Rendered), Ct(20)).subscribe(s));
2234
2234
  }
2235
- async _validatorByCell(o, a, e, t) {
2236
- const r = o.getUnitId(), i = a.getSheetId();
2235
+ async _validatorByCell(s, a, e, t) {
2236
+ const r = s.getUnitId(), i = a.getSheetId();
2237
2237
  if (!V.isDefine(e) || !V.isDefine(t))
2238
2238
  throw new Error(`row or col is not defined, row: ${e}, col: ${t}`);
2239
- const s = this._sheetDataValidationModel.getRuleByLocation(r, i, e, t);
2240
- return s ? new Promise((n) => {
2241
- this._sheetDataValidationModel.validator(s, { unitId: r, subUnitId: i, row: e, col: t, worksheet: a, workbook: o }, (l) => {
2239
+ const o = this._sheetDataValidationModel.getRuleByLocation(r, i, e, t);
2240
+ return o ? new Promise((n) => {
2241
+ this._sheetDataValidationModel.validator(o, { unitId: r, subUnitId: i, row: e, col: t, worksheet: a, workbook: s }, (l) => {
2242
2242
  n(l);
2243
2243
  });
2244
2244
  }) : D.VALID;
2245
2245
  }
2246
- async validatorCell(o, a, e, t) {
2247
- const r = this._univerInstanceService.getUnit(o, N.UNIVER_SHEET);
2246
+ async validatorCell(s, a, e, t) {
2247
+ const r = this._univerInstanceService.getUnit(s, N.UNIVER_SHEET);
2248
2248
  if (!r)
2249
- throw new Error(`cannot find current workbook, unitId: ${o}`);
2249
+ throw new Error(`cannot find current workbook, unitId: ${s}`);
2250
2250
  const i = r.getSheetBySheetId(a);
2251
2251
  if (!i)
2252
2252
  throw new Error(`cannot find current worksheet, sheetId: ${a}`);
2253
2253
  return this._validatorByCell(r, i, e, t);
2254
2254
  }
2255
- validatorRanges(o, a, e) {
2255
+ validatorRanges(s, a, e) {
2256
2256
  if (!e.length)
2257
2257
  return Promise.resolve([]);
2258
- const t = this._univerInstanceService.getUnit(o, N.UNIVER_SHEET);
2258
+ const t = this._univerInstanceService.getUnit(s, N.UNIVER_SHEET);
2259
2259
  if (!t)
2260
- throw new Error(`cannot find current workbook, unitId: ${o}`);
2260
+ throw new Error(`cannot find current workbook, unitId: ${s}`);
2261
2261
  const r = t.getSheetBySheetId(a);
2262
2262
  if (!r)
2263
2263
  throw new Error(`cannot find current worksheet, sheetId: ${a}`);
2264
2264
  return Promise.all(e.map((i) => {
2265
- const s = [];
2265
+ const o = [];
2266
2266
  return b.foreach(i, (n, l) => {
2267
- s.push(this._validatorByCell(t, r, n, l));
2268
- }), Promise.all(s);
2267
+ o.push(this._validatorByCell(t, r, n, l));
2268
+ }), Promise.all(o);
2269
2269
  }));
2270
2270
  }
2271
- async validatorWorksheet(o, a) {
2272
- const e = this._univerInstanceService.getUnit(o, N.UNIVER_SHEET);
2271
+ async validatorWorksheet(s, a) {
2272
+ const e = this._univerInstanceService.getUnit(s, N.UNIVER_SHEET);
2273
2273
  if (!e)
2274
- throw new Error(`cannot find current workbook, unitId: ${o}`);
2274
+ throw new Error(`cannot find current workbook, unitId: ${s}`);
2275
2275
  const t = e.getSheetBySheetId(a);
2276
2276
  if (!t)
2277
2277
  throw new Error(`cannot find current worksheet, sheetId: ${a}`);
2278
- const r = this._sheetDataValidationModel.getRules(o, a);
2279
- return await Promise.all(r.map((i) => Promise.all(i.ranges.map((s) => {
2278
+ const r = this._sheetDataValidationModel.getRules(s, a);
2279
+ return await Promise.all(r.map((i) => Promise.all(i.ranges.map((o) => {
2280
2280
  const n = [];
2281
- return b.foreach(s, (l, u) => {
2281
+ return b.foreach(o, (l, u) => {
2282
2282
  n.push(this._validatorByCell(e, t, l, u));
2283
2283
  }), n;
2284
- })))), this._dataValidationCacheService.ensureCache(o, a);
2284
+ })))), this._dataValidationCacheService.ensureCache(s, a);
2285
2285
  }
2286
- async validatorWorkbook(o) {
2287
- const a = this._sheetDataValidationModel.getSubUnitIds(o), e = await Promise.all(a.map((r) => this.validatorWorksheet(o, r))), t = {};
2286
+ async validatorWorkbook(s) {
2287
+ const a = this._sheetDataValidationModel.getSubUnitIds(s), e = await Promise.all(a.map((r) => this.validatorWorksheet(s, r))), t = {};
2288
2288
  return e.forEach((r, i) => {
2289
2289
  t[a[i]] = r;
2290
2290
  }), t;
2291
2291
  }
2292
- getDataValidations(o, a, e) {
2293
- const t = this._sheetDataValidationModel.getRuleObjectMatrix(o, a), r = /* @__PURE__ */ new Set();
2294
- return e.forEach((s) => {
2295
- b.foreach(s, (n, l) => {
2292
+ getDataValidations(s, a, e) {
2293
+ const t = this._sheetDataValidationModel.getRuleObjectMatrix(s, a), r = /* @__PURE__ */ new Set();
2294
+ return e.forEach((o) => {
2295
+ b.foreach(o, (n, l) => {
2296
2296
  const u = t.getValue(n, l);
2297
2297
  u && r.add(u);
2298
2298
  });
2299
- }), Array.from(r).map((s) => this._sheetDataValidationModel.getRuleById(o, a, s)).filter(Boolean);
2299
+ }), Array.from(r).map((o) => this._sheetDataValidationModel.getRuleById(s, a, o)).filter(Boolean);
2300
2300
  }
2301
- getDataValidation(o, a, e) {
2302
- return this.getDataValidations(o, a, e)[0];
2301
+ getDataValidation(s, a, e) {
2302
+ return this.getDataValidations(s, a, e)[0];
2303
2303
  }
2304
2304
  };
2305
- we = xa([
2306
- ve(0, w),
2307
- ve(1, R(F)),
2308
- ve(2, R(Q)),
2309
- ve(3, R(Ft))
2310
- ], we);
2311
- var Ba = Object.defineProperty, Ua = Object.getOwnPropertyDescriptor, Ha = (o, a, e) => a in o ? Ba(o, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[a] = e, Wa = (o, a, e, t) => {
2312
- for (var r = t > 1 ? void 0 : t ? Ua(a, e) : a, i = o.length - 1, s; i >= 0; i--)
2313
- (s = o[i]) && (r = s(r) || r);
2314
- return r;
2315
- }, ke = (o, a) => (e, t) => a(e, t, o), pt = (o, a, e) => Ha(o, typeof a != "symbol" ? a + "" : a, e);
2316
- let Ie = class extends It {
2317
- constructor(o = tt, a, e, t) {
2318
- super(), this._config = o, this._injector = a, this._commandService = e, this._configService = t;
2319
- const { ...r } = Ot(
2305
+ Oe = ka([
2306
+ Re(0, O),
2307
+ Re(1, S(F)),
2308
+ Re(2, S(q)),
2309
+ Re(3, S(Nt))
2310
+ ], Oe);
2311
+ var _t = Object.defineProperty, Ya = Object.getOwnPropertyDescriptor, Xa = (s, a, e) => a in s ? _t(s, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[a] = e, Ka = (s, a, e, t) => {
2312
+ for (var r = t > 1 ? void 0 : t ? Ya(a, e) : a, i = s.length - 1, o; i >= 0; i--)
2313
+ (o = s[i]) && (r = (t ? o(a, e, r) : o(r)) || r);
2314
+ return t && r && _t(a, e, r), r;
2315
+ }, je = (s, a) => (e, t) => a(e, t, s), pt = (s, a, e) => Xa(s, typeof a != "symbol" ? a + "" : a, e);
2316
+ let we = class extends wt {
2317
+ constructor(s = tt, a, e, t) {
2318
+ super(), this._config = s, this._injector = a, this._commandService = e, this._configService = t;
2319
+ const { ...r } = It(
2320
2320
  {},
2321
2321
  tt,
2322
2322
  this._config
2323
2323
  );
2324
- this._configService.setConfig(Sa, r);
2324
+ this._configService.setConfig(Ta, r);
2325
2325
  }
2326
2326
  onStarting() {
2327
2327
  [
2328
- [Q],
2328
+ [q],
2329
2329
  [K],
2330
- [H],
2331
- [we],
2330
+ [P],
2331
+ [Oe],
2332
2332
  [F],
2333
2333
  [Ce],
2334
2334
  [Te],
2335
2335
  [Ne],
2336
2336
  [Fe],
2337
2337
  [Ee]
2338
- ].forEach((o) => {
2339
- this._injector.add(o);
2338
+ ].forEach((s) => {
2339
+ this._injector.add(s);
2340
2340
  }), [
2341
- ma,
2342
- ha,
2343
- ga,
2344
- _a,
2345
2341
  Ra,
2346
- fa,
2347
- pa
2348
- ].forEach((o) => {
2349
- this._commandService.registerCommand(o);
2350
- }), this._injector.get(Q), this._injector.get(we), this._injector.get(Ce), this._injector.get(Ee), this._injector.get(Fe);
2342
+ pa,
2343
+ Sa,
2344
+ va,
2345
+ Ea,
2346
+ Ma,
2347
+ Va
2348
+ ].forEach((s) => {
2349
+ this._commandService.registerCommand(s);
2350
+ }), this._injector.get(q), this._injector.get(Oe), this._injector.get(Ce), this._injector.get(Ee), this._injector.get(Fe);
2351
2351
  }
2352
2352
  onReady() {
2353
2353
  this._injector.get(Ne);
@@ -2356,16 +2356,16 @@ let Ie = class extends It {
2356
2356
  this._injector.get(Te);
2357
2357
  }
2358
2358
  };
2359
- pt(Ie, "pluginName", Gt);
2360
- pt(Ie, "type", N.UNIVER_SHEET);
2361
- Ie = Wa([
2362
- Ct(Lt),
2363
- ke(1, R(qe)),
2364
- ke(2, x),
2365
- ke(3, wt)
2366
- ], Ie);
2367
- function Ka(o) {
2368
- const e = o.get(nt).getCurrentSelections().map((i) => i.range);
2359
+ pt(we, "pluginName", Yt);
2360
+ pt(we, "type", N.UNIVER_SHEET);
2361
+ we = Ka([
2362
+ Ot(xt),
2363
+ je(1, S(Ge)),
2364
+ je(2, x),
2365
+ je(3, At)
2366
+ ], we);
2367
+ function or(s) {
2368
+ const e = s.get(nt).getCurrentSelections().map((i) => i.range);
2369
2369
  return {
2370
2370
  uid: V.generateRandomId(6),
2371
2371
  type: T.DECIMAL,
@@ -2375,35 +2375,35 @@ function Ka(o) {
2375
2375
  };
2376
2376
  }
2377
2377
  export {
2378
- ma as AddSheetDataValidationCommand,
2378
+ Ra as AddSheetDataValidationCommand,
2379
2379
  Ve as CHECKBOX_FORMULA_1,
2380
2380
  Me as CHECKBOX_FORMULA_2,
2381
- aa as CheckboxValidator,
2382
- pa as ClearRangeDataValidationCommand,
2383
- Gt as DATA_VALIDATION_PLUGIN_NAME,
2384
- Q as DataValidationCacheService,
2385
- H as DataValidationCustomFormulaService,
2381
+ na as CheckboxValidator,
2382
+ Va as ClearRangeDataValidationCommand,
2383
+ Yt as DATA_VALIDATION_PLUGIN_NAME,
2384
+ q as DataValidationCacheService,
2385
+ P as DataValidationCustomFormulaService,
2386
2386
  Te as DataValidationFormulaController,
2387
2387
  K as DataValidationFormulaService,
2388
- sa as DateValidator,
2389
- Oa as ListMultipleValidator,
2388
+ ca as DateValidator,
2389
+ $a as ListMultipleValidator,
2390
2390
  mt as ListValidator,
2391
- fa as RemoveSheetAllDataValidationCommand,
2392
- Ra as RemoveSheetDataValidationCommand,
2391
+ Ma as RemoveSheetAllDataValidationCommand,
2392
+ Ea as RemoveSheetDataValidationCommand,
2393
2393
  F as SheetDataValidationModel,
2394
- we as SheetsDataValidationValidatorService,
2395
- Ie as UniverSheetsDataValidationPlugin,
2396
- _a as UpdateSheetDataValidationOptionsCommand,
2397
- ha as UpdateSheetDataValidationRangeCommand,
2398
- ga as UpdateSheetDataValidationSettingCommand,
2399
- Ka as createDefaultNewRule,
2400
- fe as deserializeListOptions,
2394
+ Oe as SheetsDataValidationValidatorService,
2395
+ we as UniverSheetsDataValidationPlugin,
2396
+ va as UpdateSheetDataValidationOptionsCommand,
2397
+ pa as UpdateSheetDataValidationRangeCommand,
2398
+ Sa as UpdateSheetDataValidationSettingCommand,
2399
+ or as createDefaultNewRule,
2400
+ pe as deserializeListOptions,
2401
2401
  ne as getCellValueOrigin,
2402
- Xa as getDataValidationCellValue,
2402
+ sr as getDataValidationCellValue,
2403
2403
  be as getDataValidationDiffMutations,
2404
- _e as getFormulaCellData,
2405
- oe as getFormulaResult,
2404
+ ge as getFormulaCellData,
2405
+ se as getFormulaResult,
2406
2406
  C as isLegalFormulaResult,
2407
- Ya as serializeListOptions,
2408
- pe as transformCheckboxValue
2407
+ ir as serializeListOptions,
2408
+ _e as transformCheckboxValue
2409
2409
  };