@univerjs/sheets-data-validation 0.5.3-nightly.202501071618 → 0.5.3-nightly.202501090742

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 vt = Object.defineProperty;
2
- var Rt = (o, a, e) => a in o ? vt(o, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[a] = e;
3
- var g = (o, a, e) => Rt(o, typeof a != "symbol" ? a + "" : a, e);
4
- import { Inject as R, ICommandService as x, IUniverInstanceService as O, Disposable as $, ObjectMatrix as Se, UniverInstanceType as N, Range as b, isFormulaString as S, DataValidationType as T, getOriginCellValue as St, RBush as Vt, debounce as Mt, Rectangle as I, Tools as V, DataValidationStatus as D, WrapStrategy as Re, DataValidationOperator as h, numfmt as Q, dayjs as at, DataValidationRenderMode as Be, CommandType as K, 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";
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 K, 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
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 se, RemoveSheetMutation as it, getSheetCommandTarget as Ye, SetRangeValuesUndoMutationFactory as ot, WorksheetViewPermission as Bt, RefRangeService as Ut, handleCommonDefaultRangeChangeWithEffectRefCommands as Pt, SheetInterceptorService as st, RemoveSheetCommand as $t, SheetsSelectionsService as nt, ClearSelectionAllCommand as Ht } from "@univerjs/sheets";
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
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
9
  import { ERROR_TYPE_SET as jt, LexerTreeBuilder as Z, isReferenceString as dt, sequenceNodeType as Qt, deserializeRangeWithSheet as qt, deserializeRangeWithSheetWithCache as Gt } from "@univerjs/engine-formula";
10
10
  const kt = "SHEET_DATA_VALIDATION_PLUGIN";
11
- var Yt = Object.defineProperty, Xt = Object.getOwnPropertyDescriptor, Kt = (o, a, e, t) => {
12
- for (var r = t > 1 ? void 0 : t ? Xt(a, e) : a, i = o.length - 1, s; i >= 0; i--)
13
- (s = o[i]) && (r = (t ? s(a, e, r) : s(r)) || r);
11
+ var Yt = Object.defineProperty, Xt = Object.getOwnPropertyDescriptor, Kt = (s, a, e, t) => {
12
+ for (var r = t > 1 ? void 0 : t ? Xt(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
14
  return t && r && Yt(a, e, r), r;
15
- }, Je = (o, a) => (e, t) => a(e, t, o);
15
+ }, Je = (s, a) => (e, t) => a(e, t, s);
16
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 Qe());
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 $ {
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 $ {
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
  }
@@ -80,38 +80,38 @@ let q = class extends $ {
80
80
  }
81
81
  };
82
82
  q = Kt([
83
- Je(0, R(x)),
84
- Je(1, R(O))
83
+ Je(0, S(x)),
84
+ Je(1, S(O))
85
85
  ], q);
86
- function oe(o) {
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 !jt.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 zt = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, Jt = (o, a, e, t) => {
103
- for (var r = t > 1 ? void 0 : t ? Zt(a, e) : a, i = o.length - 1, s; i >= 0; i--)
104
- (s = o[i]) && (r = (t ? s(a, e, r) : s(r)) || r);
102
+ var zt = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, Jt = (s, a, e, t) => {
103
+ for (var r = t > 1 ? void 0 : t ? Zt(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
105
  return t && r && zt(a, e, r), r;
106
- }, re = (o, a) => (e, t) => a(e, t, o);
106
+ }, re = (s, a) => (e, t) => a(e, t, s);
107
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 P = class extends $ {
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 P = class extends $ {
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 P = class extends $ {
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,41 +173,41 @@ let P = class extends $ {
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);
@@ -216,20 +216,20 @@ let P = class extends $ {
216
216
  };
217
217
  P = Jt([
218
218
  re(0, O),
219
- re(1, R(lt)),
220
- re(2, R(ke)),
221
- re(3, R(q)),
222
- re(4, R(G))
219
+ re(1, S(lt)),
220
+ re(2, S(ke)),
221
+ re(3, S(q)),
222
+ re(4, S(G))
223
223
  ], P);
224
- var ea = Object.defineProperty, ta = Object.getOwnPropertyDescriptor, aa = (o, a, e, t) => {
225
- for (var r = t > 1 ? void 0 : t ? ta(a, e) : a, i = o.length - 1, s; i >= 0; i--)
226
- (s = o[i]) && (r = (t ? s(a, e, r) : s(r)) || r);
224
+ var ea = Object.defineProperty, ta = Object.getOwnPropertyDescriptor, aa = (s, a, e, t) => {
225
+ for (var r = t > 1 ? void 0 : t ? ta(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
227
  return t && r && ea(a, e, r), r;
228
- }, ie = (o, a) => (e, t) => a(e, t, o);
228
+ }, ie = (s, a) => (e, t) => a(e, t, s);
229
229
  let X = 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 X = class extends $ {
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,44 +262,44 @@ let X = class extends $ {
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) {
@@ -308,24 +308,24 @@ let X = class extends $ {
308
308
  };
309
309
  X = aa([
310
310
  ie(0, O),
311
- ie(1, R(lt)),
312
- ie(2, R(q)),
313
- ie(3, R(ke)),
314
- ie(4, R(G))
311
+ ie(1, S(lt)),
312
+ ie(2, S(q)),
313
+ ie(3, S(ke)),
314
+ ie(4, S(G))
315
315
  ], X);
316
- function ne(o) {
317
- return St(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 Vt());
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", Mt(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() {
@@ -354,8 +354,8 @@ class Xe {
354
354
  return;
355
355
  const t = I.mergeRanges(e.map((r) => b.transformRange(r, this._worksheet)));
356
356
  this._map.forEach((r, i) => {
357
- const s = I.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) {
@@ -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, I.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
390
  const n = I.subtractMulti(i, t);
391
- n.length === 0 ? this._map.delete(s) : this._map.set(s, n);
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) => !I.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: I.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,7 +414,7 @@ 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
420
  n.length !== 0 && (n.length !== l.length || n.some((d, c) => !I.equals(d, l[c]))) && t.push({
@@ -426,16 +426,16 @@ class Xe {
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: I.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 ra = Object.defineProperty, ia = Object.getOwnPropertyDescriptor, oa = (o, a, e, t) => {
465
- for (var r = t > 1 ? void 0 : t ? ia(a, e) : a, i = o.length - 1, s; i >= 0; i--)
466
- (s = o[i]) && (r = (t ? s(a, e, r) : s(r)) || r);
464
+ var ra = Object.defineProperty, ia = Object.getOwnPropertyDescriptor, sa = (s, a, e, t) => {
465
+ for (var r = t > 1 ? void 0 : t ? ia(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
467
  return t && r && ra(a, e, r), r;
468
- }, Y = (o, a) => (e, t) => a(e, t, o);
468
+ }, Y = (s, a) => (e, t) => a(e, t, s);
469
469
  let F = class extends $ {
470
- constructor(a, e, t, r, i, s, n) {
470
+ constructor(a, e, t, r, i, o, n) {
471
471
  super();
472
- g(this, "_ruleMatrixMap", /* @__PURE__ */ new Map());
473
- g(this, "_validStatusChange$", new Qe());
474
- g(this, "_ruleChange$", new Qe());
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 $ {
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 $ {
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 $ {
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 $ {
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 w = _.getValue(i, r);
589
- u(f, v !== w);
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 $ {
616
616
  return this._dataValidationModel.getAll();
617
617
  }
618
618
  };
619
- F = oa([
620
- Y(0, R(ke)),
619
+ F = sa([
620
+ Y(0, S(ke)),
621
621
  Y(1, O),
622
- Y(2, R(G)),
623
- Y(3, R(q)),
624
- Y(4, R(X)),
625
- Y(5, R(P)),
622
+ Y(2, S(G)),
623
+ Y(3, S(q)),
624
+ Y(4, S(X)),
625
+ Y(5, S(P)),
626
626
  Y(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 sa extends k {
632
+ const _e = (s) => V.isDefine(s) && String(s).toLowerCase() === "true" ? "1" : String(s).toLowerCase() === "false" ? "0" : s;
633
+ class oa 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(X));
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(X));
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 sa extends k {
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 sa extends k {
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,22 +676,22 @@ class sa extends k {
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) {
@@ -731,38 +731,38 @@ const la = {
731
731
  h.BETWEEN,
732
732
  h.NOT_BETWEEN
733
733
  ], le = "{FORMULA1}", ue = "{FORMULA2}";
734
- function rr(o) {
735
- return o.filter(Boolean).join(",");
734
+ function rr(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 ir(o) {
741
- const a = ne(o);
740
+ function ir(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 = Q.parseDate(o)) == null ? void 0 : e.v;
758
- return V.isDefine(a) ? a : (t = Q.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
760
  class da 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,15 +772,15 @@ class da extends k {
772
772
  h.NOT_BETWEEN,
773
773
  h.NOT_EQUAL
774
774
  ]);
775
- g(this, "scopes", ["sheet"]);
776
- g(this, "_customFormulaService", this.injector.get(P));
777
- g(this, "_lexerTreeBuilder", this.injector.get(Z));
775
+ f(this, "scopes", ["sheet"]);
776
+ f(this, "_customFormulaService", this.injector.get(P));
777
+ f(this, "_lexerTreeBuilder", this.injector.get(Z));
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
  }
@@ -789,7 +789,7 @@ class da extends k {
789
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 && Q.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,22 +797,22 @@ class da extends k {
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;
@@ -828,8 +828,8 @@ class da extends k {
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) {
@@ -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
875
  class ca extends k {
876
876
  constructor() {
877
877
  super(...arguments);
878
- g(this, "_customFormulaService", this.injector.get(P));
879
- g(this, "id", T.DECIMAL);
880
- g(this, "_lexerTreeBuilder", this.injector.get(Z));
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(Z));
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 ca extends k {
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 ca extends k {
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 ca extends k {
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,17 +939,17 @@ class ca extends k {
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 Pe(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)) {
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
953
  a.add(Q.format(t.s.n.pattern, r, { throws: !1 }));
954
954
  return;
955
955
  }
@@ -965,17 +965,17 @@ const ha = [
965
965
  "choose",
966
966
  "offset"
967
967
  ];
968
- function ma(o, a) {
969
- if (!S(o) || dt(o.slice(1)))
968
+ function ma(s, a) {
969
+ if (!v(s) || dt(s.slice(1)))
970
970
  return !0;
971
- const t = a.sequenceNodesBuilder(o);
971
+ const t = a.sequenceNodesBuilder(s);
972
972
  return t && t.some((r) => typeof r == "object" && r.nodeType === Qt.FUNCTION && ha.indexOf(r.token.toLowerCase()) > -1);
973
973
  }
974
- function ga(o, a) {
975
- const { formula1: e = "", ranges: t } = o;
974
+ function fa(s, a) {
975
+ const { formula1: e = "", ranges: t } = s;
976
976
  if (dt(e.slice(1))) {
977
977
  const i = qt(e.slice(1));
978
- if ((!i.sheetName || i.sheetName === a) && t.some((s) => I.intersects(s, i.range)))
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;
@@ -983,27 +983,27 @@ function ga(o, a) {
983
983
  class mt extends k {
984
984
  constructor() {
985
985
  super(...arguments);
986
- g(this, "formulaService", this.injector.get(X));
987
- g(this, "_lexer", this.injector.get(Z));
988
- g(this, "_univerInstanceService", this.injector.get(O));
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(X));
987
+ f(this, "_lexer", this.injector.get(Z));
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 = ma((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 : "");
998
+ const i = !V.isBlank(e.formula1), o = ma((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 = fa(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 k {
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) ? Pe((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 k {
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(O), 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) ? Pe((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(O), 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) ? Pe((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 _a extends k {
1074
+ class ga 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(Z));
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(Z));
1080
+ f(this, "operators", [
1081
1081
  h.BETWEEN,
1082
1082
  h.EQUAL,
1083
1083
  h.GREATER_THAN,
@@ -1087,11 +1087,11 @@ class _a extends k {
1087
1087
  h.NOT_BETWEEN,
1088
1088
  h.NOT_EQUAL
1089
1089
  ]);
1090
- g(this, "scopes", ["sheet"]);
1091
- g(this, "_customFormulaService", this.injector.get(P));
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 _a extends k {
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
  }
@@ -1137,106 +1137,106 @@ class _a extends k {
1137
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(Z), n = t.get(G), l = [], u = [], d = t.get(F), c = t.get(O), m = Ye(c, { unitId: o, subUnitId: a });
1144
+ function be(s, a, e, t, r = "command", i = !0) {
1145
+ const o = t.get(Z), 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, w) {
1154
- i && f.forEach((H) => {
1151
+ const { worksheet: _ } = m, g = new ve();
1152
+ let R = !1;
1153
+ function M(p, w) {
1154
+ i && p.forEach((H) => {
1155
1155
  b.foreach(H, (B, W) => {
1156
- const U = p.getCellRaw(B, W), J = ct(U);
1157
- (gt(U) || J === w) && !(U != null && U.p) && (v = !0, _.setValue(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
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 H = f.oldRanges[0].startRow, B = f.oldRanges[0].startColumn, W = f.newRanges[0].startRow, U = f.newRanges[0].startColumn, J = W - H, 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 w = d.getRuleById(o, a, f.ruleId);
1270
+ const w = d.getRuleById(s, a, p.ruleId);
1271
1271
  if (w && w.type === T.CHECKBOX) {
1272
- const B = d.getValidator(T.CHECKBOX).parseFormulaSync(w, o, a);
1273
- M(f.newRanges, B.formula2);
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 H = d.getValidator(T.CHECKBOX).parseFormulaSync(f.rule, o, a);
1296
- M(f.rule.ranges, H.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
1309
  }, w = {
1310
- id: se.id,
1311
- params: ot(t, f.params)
1310
+ id: oe.id,
1311
+ params: st(t, p.params)
1312
1312
  };
1313
- l.push(f), u.push(w);
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 pa = {
1320
+ const _a = {
1321
1321
  type: K.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
1336
  }), Ie(m, n), !0;
1337
1337
  }
1338
- }, fa = {
1338
+ }, pa = {
1339
1339
  type: K.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 pa = {
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,41 +1364,41 @@ const pa = {
1364
1364
  }), n.pushUndoRedo({
1365
1365
  unitID: e,
1366
1366
  redoMutations: m,
1367
- undoMutations: p
1368
- }), Ie(m, s), !0;
1367
+ undoMutations: _
1368
+ }), Ie(m, o), !0;
1369
1369
  }
1370
- }, va = {
1370
+ }, Ra = {
1371
1371
  type: K.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(G), { 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: {
@@ -1407,17 +1407,17 @@ const pa = {
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 w = c.ranges, H = o.get(O), B = Ye(H, { 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 W = 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 (w.forEach((ge) => {
1418
- b.foreach(ge, (ae, xe) => {
1417
+ if (w.forEach((fe) => {
1418
+ b.foreach(fe, (ae, xe) => {
1419
1419
  const j = U.getCellRaw(ae, xe), Ke = ct(j);
1420
- (gt(j) || Ke === String(J)) && !(j != null && j.p) ? (W.setValue(ae, xe, {
1420
+ (ft(j) || Ke === String(J)) && !(j != null && j.p) ? (W.setValue(ae, xe, {
1421
1421
  v: he,
1422
1422
  p: null
1423
1423
  }), Le = !0) : Ke === String(ce) && !(j != null && j.p) && (W.setValue(ae, xe, {
@@ -1426,39 +1426,39 @@ const pa = {
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
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 Ie(_, 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
- }, Ra = {
1450
+ }, Sa = {
1451
1451
  type: K.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 pa = {
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
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
- }, Sa = {
1488
+ }, va = {
1489
1489
  type: K.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(O), 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
1502
+ undoMutations: _
1503
1503
  }), Ie(m, i).result;
1504
1504
  }
1505
1505
  }, Va = {
1506
1506
  type: K.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 pa = {
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
- }, Ma = (o, a) => {
1533
- const e = o.get(F), { unitId: t, subUnitId: r, ruleId: i, source: s } = a;
1532
+ }, Ma = (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 pa = {
1539
1539
  unitId: t,
1540
1540
  subUnitId: r,
1541
1541
  rule: l,
1542
- source: s
1542
+ source: o
1543
1543
  }
1544
1544
  }];
1545
1545
  }
@@ -1557,10 +1557,10 @@ const pa = {
1557
1557
  }, ya = {
1558
1558
  type: K.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 pa = {
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
1583
  }, Ea = "sheets-data-validation.config", tt = {};
1584
- var Ta = Object.defineProperty, Fa = Object.getOwnPropertyDescriptor, Na = (o, a, e, t) => {
1585
- for (var r = t > 1 ? void 0 : t ? Fa(a, e) : a, i = o.length - 1, s; i >= 0; i--)
1586
- (s = o[i]) && (r = (t ? s(a, e, r) : s(r)) || r);
1584
+ var Ta = Object.defineProperty, Fa = Object.getOwnPropertyDescriptor, Na = (s, a, e, t) => {
1585
+ for (var r = t > 1 ? void 0 : t ? Fa(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
1587
  return t && r && Ta(a, e, r), r;
1588
- }, $e = (o, a) => (e, t) => a(e, t, o);
1588
+ }, $e = (s, a) => (e, t) => a(e, t, s);
1589
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 $ {
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 $ {
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 = yt();
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 $ {
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 $ {
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,25 +1693,25 @@ let Ee = class extends $ {
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
  }
@@ -1724,44 +1724,44 @@ let Ee = class extends $ {
1724
1724
  }
1725
1725
  };
1726
1726
  Ee = Na([
1727
- $e(0, R(F)),
1728
- $e(1, R(ut)),
1729
- $e(2, R(G))
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 || {}), Ca = Object.defineProperty, Oa = Object.getOwnPropertyDescriptor, wa = (o, a, e, t) => {
1732
- for (var r = t > 1 ? void 0 : t ? Oa(a, e) : a, i = o.length - 1, s; i >= 0; i--)
1733
- (s = o[i]) && (r = (t ? s(a, e, r) : s(r)) || r);
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 || {}), Ca = Object.defineProperty, Oa = Object.getOwnPropertyDescriptor, wa = (s, a, e, t) => {
1732
+ for (var r = t > 1 ? void 0 : t ? Oa(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
1734
  return t && r && Ca(a, e, r), r;
1735
- }, He = (o, a) => (e, t) => a(e, t, o);
1735
+ }, He = (s, a) => (e, t) => a(e, t, s);
1736
1736
  let Te = class extends $ {
1737
- constructor(o, a, e) {
1738
- super(), this._univerInstanceService = o, this._permissionService = a, this._lexerTreeBuilder = e;
1737
+ constructor(s, a, e) {
1738
+ super(), this._univerInstanceService = s, this._permissionService = a, this._lexerTreeBuilder = e;
1739
1739
  }
1740
- getFormulaRefCheck(o) {
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 = Gt(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 Bt(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
  }
@@ -1771,21 +1771,21 @@ let Te = class extends $ {
1771
1771
  Te = wa([
1772
1772
  He(0, O),
1773
1773
  He(1, Et),
1774
- He(2, R(Z))
1774
+ He(2, S(Z))
1775
1775
  ], Te);
1776
- var Ia = Object.defineProperty, Aa = Object.getOwnPropertyDescriptor, Da = (o, a, e, t) => {
1777
- for (var r = t > 1 ? void 0 : t ? Aa(a, e) : a, i = o.length - 1, s; i >= 0; i--)
1778
- (s = o[i]) && (r = (t ? s(a, e, r) : s(r)) || r);
1776
+ var Ia = Object.defineProperty, Aa = Object.getOwnPropertyDescriptor, Da = (s, a, e, t) => {
1777
+ for (var r = t > 1 ? void 0 : t ? Aa(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
1779
  return t && r && Ia(a, e, r), r;
1780
- }, ee = (o, a) => (e, t) => a(e, t, o);
1780
+ }, ee = (s, a) => (e, t) => a(e, t, s);
1781
1781
  let Fe = class extends $ {
1782
- constructor(a, e, t, r, i, s) {
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 $ {
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 $ {
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 $ {
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 $ {
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((_) => Pt(_, 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 $ {
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,42 +1891,42 @@ let Fe = class extends $ {
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 = Ma(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 = Ma(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
  }
@@ -1939,38 +1939,38 @@ let Fe = class extends $ {
1939
1939
  }
1940
1940
  };
1941
1941
  Fe = Da([
1942
- ee(0, R(F)),
1943
- ee(1, R(Ge)),
1944
- ee(2, R(Ut)),
1945
- ee(3, R(X)),
1946
- ee(4, R(ut)),
1947
- ee(5, R(G))
1942
+ ee(0, S(F)),
1943
+ ee(1, S(Ge)),
1944
+ ee(2, S(Ut)),
1945
+ ee(3, S(X)),
1946
+ ee(4, S(ut)),
1947
+ ee(5, S(G))
1948
1948
  ], Fe);
1949
- var ba = Object.defineProperty, La = Object.getOwnPropertyDescriptor, xa = (o, a, e, t) => {
1950
- for (var r = t > 1 ? void 0 : t ? La(a, e) : a, i = o.length - 1, s; i >= 0; i--)
1951
- (s = o[i]) && (r = (t ? s(a, e, r) : s(r)) || r);
1949
+ var ba = Object.defineProperty, La = Object.getOwnPropertyDescriptor, xa = (s, a, e, t) => {
1950
+ for (var r = t > 1 ? void 0 : t ? La(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
1952
  return t && r && ba(a, e, r), r;
1953
- }, We = (o, a) => (e, t) => a(e, t, o);
1953
+ }, We = (s, a) => (e, t) => a(e, t, s);
1954
1954
  let Ne = class extends $ {
1955
- constructor(o, a, e) {
1956
- super(), this._sheetInterceptorService = o, this._univerInstanceService = a, this._sheetDataValidationModel = e, this._initSheetChange();
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 === $t.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 $ {
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 {
@@ -1999,18 +1999,18 @@ let Ne = class extends $ {
1999
1999
  }
2000
2000
  };
2001
2001
  Ne = xa([
2002
- We(0, R(st)),
2003
- We(1, R(O)),
2004
- We(2, R(F))
2002
+ We(0, S(ot)),
2003
+ We(1, S(O)),
2004
+ We(2, S(F))
2005
2005
  ], Ne);
2006
2006
  class Ba 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 {
@@ -2034,14 +2034,14 @@ class Ba extends k {
2034
2034
  class Ua 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(P));
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
2042
  }
2043
2043
  validatorFormula(e, t, r) {
2044
- const i = S(e.formula1);
2044
+ const i = v(e.formula1);
2045
2045
  return {
2046
2046
  success: i,
2047
2047
  formula1: i ? "" : this.localeService.t("dataValidation.validFail.formula")
@@ -2055,7 +2055,7 @@ class Ua extends k {
2055
2055
  };
2056
2056
  }
2057
2057
  async isValidType(e, t, r) {
2058
- 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;
2058
+ 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;
2059
2059
  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;
2060
2060
  }
2061
2061
  generateRuleErrorMessage(e) {
@@ -2069,20 +2069,20 @@ class Ua extends k {
2069
2069
  class Pa extends mt {
2070
2070
  constructor() {
2071
2071
  super(...arguments);
2072
- g(this, "id", T.LIST_MULTIPLE);
2073
- g(this, "title", "dataValidation.listMultiple.title");
2074
- g(this, "offsetFormulaByRange", !1);
2075
- g(this, "skipDefaultFontRender", () => !0);
2072
+ f(this, "id", T.LIST_MULTIPLE);
2073
+ f(this, "title", "dataValidation.listMultiple.title");
2074
+ f(this, "offsetFormulaByRange", !1);
2075
+ f(this, "skipDefaultFontRender", () => !0);
2076
2076
  }
2077
2077
  }
2078
2078
  class $a extends k {
2079
2079
  constructor() {
2080
2080
  super(...arguments);
2081
- g(this, "_customFormulaService", this.injector.get(P));
2082
- g(this, "_lexerTreeBuilder", this.injector.get(Z));
2083
- g(this, "id", T.WHOLE);
2084
- g(this, "title", "dataValidation.whole.title");
2085
- g(this, "operators", [
2081
+ f(this, "_customFormulaService", this.injector.get(P));
2082
+ f(this, "_lexerTreeBuilder", this.injector.get(Z));
2083
+ f(this, "id", T.WHOLE);
2084
+ f(this, "title", "dataValidation.whole.title");
2085
+ f(this, "operators", [
2086
2086
  h.BETWEEN,
2087
2087
  h.EQUAL,
2088
2088
  h.GREATER_THAN,
@@ -2092,14 +2092,14 @@ class $a extends k {
2092
2092
  h.NOT_BETWEEN,
2093
2093
  h.NOT_EQUAL
2094
2094
  ]);
2095
- g(this, "scopes", ["sheet"]);
2095
+ f(this, "scopes", ["sheet"]);
2096
2096
  }
2097
2097
  _isFormulaOrInt(e) {
2098
- return !V.isBlank(e) && (S(e) || !Number.isNaN(+e) && Number.isInteger(+e));
2098
+ return !V.isBlank(e) && (v(e) || !Number.isNaN(+e) && Number.isInteger(+e));
2099
2099
  }
2100
2100
  async isValidType(e, t, r) {
2101
- const { value: i } = e, s = ye(i);
2102
- return !Number.isNaN(s) && Number.isInteger(s);
2101
+ const { value: i } = e, o = ye(i);
2102
+ return !Number.isNaN(o) && Number.isInteger(o);
2103
2103
  }
2104
2104
  transform(e, t, r) {
2105
2105
  const { value: i } = e;
@@ -2111,12 +2111,12 @@ class $a extends k {
2111
2111
  _parseNumber(e) {
2112
2112
  return e == null ? Number.NaN : +e;
2113
2113
  }
2114
- async parseFormula(e, t, r, i, s) {
2115
- 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}`);
2114
+ async parseFormula(e, t, r, i, o) {
2115
+ 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}`);
2116
2116
  return {
2117
2117
  formula1: this._parseNumber(c),
2118
2118
  formula2: this._parseNumber(m),
2119
- isFormulaValid: p
2119
+ isFormulaValid: _
2120
2120
  };
2121
2121
  }
2122
2122
  validatorFormula(e, t, r) {
@@ -2125,13 +2125,13 @@ class $a extends k {
2125
2125
  return {
2126
2126
  success: !1
2127
2127
  };
2128
- 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");
2128
+ 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");
2129
2129
  return l ? {
2130
- success: s && n,
2131
- formula1: s ? void 0 : u,
2130
+ success: o && n,
2131
+ formula1: o ? void 0 : u,
2132
2132
  formula2: n ? void 0 : u
2133
2133
  } : {
2134
- success: s,
2134
+ success: o,
2135
2135
  formula1: u
2136
2136
  };
2137
2137
  }
@@ -2142,14 +2142,14 @@ class $a extends k {
2142
2142
  return `${this.localeService.t(ht[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
2143
2143
  }
2144
2144
  }
2145
- var Ha = Object.defineProperty, Wa = Object.getOwnPropertyDescriptor, ja = (o, a, e, t) => {
2146
- for (var r = t > 1 ? void 0 : t ? Wa(a, e) : a, i = o.length - 1, s; i >= 0; i--)
2147
- (s = o[i]) && (r = (t ? s(a, e, r) : s(r)) || r);
2145
+ var Ha = Object.defineProperty, Wa = Object.getOwnPropertyDescriptor, ja = (s, a, e, t) => {
2146
+ for (var r = t > 1 ? void 0 : t ? Wa(a, e) : a, i = s.length - 1, o; i >= 0; i--)
2147
+ (o = s[i]) && (r = (t ? o(a, e, r) : o(r)) || r);
2148
2148
  return t && r && Ha(a, e, r), r;
2149
- }, te = (o, a) => (e, t) => a(e, t, o);
2149
+ }, te = (s, a) => (e, t) => a(e, t, s);
2150
2150
  let Ce = class extends Ft {
2151
- constructor(o, a, e, t, r, i) {
2152
- super(), this._univerInstanceService = o, this._dataValidatorRegistryService = a, this._injector = e, this._selectionManagerService = t, this._sheetInterceptorService = r, this._sheetDataValidationModel = i, this._init();
2151
+ constructor(s, a, e, t, r, i) {
2152
+ super(), this._univerInstanceService = s, this._dataValidatorRegistryService = a, this._injector = e, this._selectionManagerService = t, this._sheetInterceptorService = r, this._sheetDataValidationModel = i, this._init();
2153
2153
  }
2154
2154
  _init() {
2155
2155
  this._registerValidators(), this._initCommandInterceptor();
@@ -2159,27 +2159,27 @@ let Ce = class extends Ft {
2159
2159
  Ba,
2160
2160
  ca,
2161
2161
  $a,
2162
- _a,
2162
+ ga,
2163
2163
  da,
2164
- sa,
2164
+ oa,
2165
2165
  mt,
2166
2166
  Pa,
2167
2167
  Ua
2168
- ].forEach((o) => {
2169
- const a = this._injector.createInstance(o);
2170
- this.disposeWithMe(this._dataValidatorRegistryService.register(a)), this.disposeWithMe(qe(() => this._injector.delete(o)));
2168
+ ].forEach((s) => {
2169
+ const a = this._injector.createInstance(s);
2170
+ this.disposeWithMe(this._dataValidatorRegistryService.register(a)), this.disposeWithMe(qe(() => this._injector.delete(s)));
2171
2171
  });
2172
2172
  }
2173
2173
  _initCommandInterceptor() {
2174
2174
  this._sheetInterceptorService.interceptCommand({
2175
- getMutations: (o) => {
2175
+ getMutations: (s) => {
2176
2176
  var a;
2177
- if (o.id === Ht.id) {
2177
+ if (s.id === Ht.id) {
2178
2178
  const e = this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET), t = e.getUnitId(), r = e.getActiveSheet();
2179
2179
  if (!r)
2180
2180
  throw new Error("No active sheet found");
2181
- const i = r.getSheetId(), s = (a = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : a.map((c) => c.range), n = this._sheetDataValidationModel.getRuleObjectMatrix(t, i).clone();
2182
- s && n.removeRange(s);
2181
+ const i = r.getSheetId(), o = (a = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : a.map((c) => c.range), n = this._sheetDataValidationModel.getRuleObjectMatrix(t, i).clone();
2182
+ o && n.removeRange(o);
2183
2183
  const l = n.diff(this._sheetDataValidationModel.getRules(t, i)), { redoMutations: u, undoMutations: d } = be(t, i, l, this._injector, "patched");
2184
2184
  return {
2185
2185
  undos: d,
@@ -2196,124 +2196,124 @@ let Ce = class extends Ft {
2196
2196
  };
2197
2197
  Ce = ja([
2198
2198
  te(0, O),
2199
- te(1, R(G)),
2200
- te(2, R(Ge)),
2201
- te(3, R(nt)),
2202
- te(4, R(st)),
2203
- te(5, R(F))
2199
+ te(1, S(G)),
2200
+ te(2, S(Ge)),
2201
+ te(3, S(nt)),
2202
+ te(4, S(ot)),
2203
+ te(5, S(F))
2204
2204
  ], Ce);
2205
- var Qa = Object.defineProperty, qa = Object.getOwnPropertyDescriptor, Ga = (o, a, e, t) => {
2206
- for (var r = t > 1 ? void 0 : t ? qa(a, e) : a, i = o.length - 1, s; i >= 0; i--)
2207
- (s = o[i]) && (r = (t ? s(a, e, r) : s(r)) || r);
2205
+ var Qa = Object.defineProperty, qa = Object.getOwnPropertyDescriptor, Ga = (s, a, e, t) => {
2206
+ for (var r = t > 1 ? void 0 : t ? qa(a, e) : a, i = s.length - 1, o; i >= 0; i--)
2207
+ (o = s[i]) && (r = (t ? o(a, e, r) : o(r)) || r);
2208
2208
  return t && r && Qa(a, e, r), r;
2209
- }, ve = (o, a) => (e, t) => a(e, t, o);
2209
+ }, Re = (s, a) => (e, t) => a(e, t, s);
2210
2210
  let Oe = class extends $ {
2211
- constructor(o, a, e, t) {
2212
- super(), this._univerInstanceService = o, this._sheetDataValidationModel = a, this._dataValidationCacheService = e, this._lifecycleService = t, this._initRecalculate();
2211
+ constructor(s, a, e, t) {
2212
+ super(), this._univerInstanceService = s, this._sheetDataValidationModel = a, this._dataValidationCacheService = e, this._lifecycleService = t, this._initRecalculate();
2213
2213
  }
2214
2214
  _initRecalculate() {
2215
- const o = (a) => {
2215
+ const s = (a) => {
2216
2216
  if (a.length === 0)
2217
2217
  return;
2218
2218
  const e = this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET), t = e == null ? void 0 : e.getActiveSheet(), r = {};
2219
2219
  a.flat().forEach((i) => {
2220
2220
  r[i.unitId] || (r[i.unitId] = {}), r[i.unitId][i.subUnitId] || (r[i.unitId][i.subUnitId] = []);
2221
- const s = this._univerInstanceService.getUnit(i.unitId, N.UNIVER_SHEET), n = s == null ? void 0 : s.getSheetBySheetId(i.subUnitId);
2221
+ const o = this._univerInstanceService.getUnit(i.unitId, N.UNIVER_SHEET), n = o == null ? void 0 : o.getSheetBySheetId(i.subUnitId);
2222
2222
  n && r[i.unitId][i.subUnitId].push(...i.ranges.map((l) => b.transformRange(l, n)));
2223
- }), Object.entries(r).forEach(([i, s]) => {
2224
- Object.entries(s).forEach(([n, l]) => {
2223
+ }), Object.entries(r).forEach(([i, o]) => {
2224
+ Object.entries(o).forEach(([n, l]) => {
2225
2225
  (e == null ? void 0 : e.getUnitId()) === i && (t == null ? void 0 : t.getSheetId()) === n ? this.validatorRanges(i, n, l) : requestIdleCallback(() => {
2226
2226
  this.validatorRanges(i, n, l);
2227
2227
  });
2228
2228
  });
2229
2229
  });
2230
2230
  };
2231
- this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(Wt(() => this._lifecycleService.lifecycle$.pipe(Ze((a) => a === ze.Rendered)))).subscribe(o)), this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(Ze(() => this._lifecycleService.stage >= ze.Rendered), Ct(20)).subscribe(o));
2231
+ 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));
2232
2232
  }
2233
- async _validatorByCell(o, a, e, t) {
2234
- const r = o.getUnitId(), i = a.getSheetId();
2233
+ async _validatorByCell(s, a, e, t) {
2234
+ const r = s.getUnitId(), i = a.getSheetId();
2235
2235
  if (!V.isDefine(e) || !V.isDefine(t))
2236
2236
  throw new Error(`row or col is not defined, row: ${e}, col: ${t}`);
2237
- const s = this._sheetDataValidationModel.getRuleByLocation(r, i, e, t);
2238
- return s ? new Promise((n) => {
2239
- this._sheetDataValidationModel.validator(s, { unitId: r, subUnitId: i, row: e, col: t, worksheet: a, workbook: o }, (l) => {
2237
+ const o = this._sheetDataValidationModel.getRuleByLocation(r, i, e, t);
2238
+ return o ? new Promise((n) => {
2239
+ this._sheetDataValidationModel.validator(o, { unitId: r, subUnitId: i, row: e, col: t, worksheet: a, workbook: s }, (l) => {
2240
2240
  n(l);
2241
2241
  });
2242
2242
  }) : D.VALID;
2243
2243
  }
2244
- async validatorCell(o, a, e, t) {
2245
- const r = this._univerInstanceService.getUnit(o, N.UNIVER_SHEET);
2244
+ async validatorCell(s, a, e, t) {
2245
+ const r = this._univerInstanceService.getUnit(s, N.UNIVER_SHEET);
2246
2246
  if (!r)
2247
- throw new Error(`cannot find current workbook, unitId: ${o}`);
2247
+ throw new Error(`cannot find current workbook, unitId: ${s}`);
2248
2248
  const i = r.getSheetBySheetId(a);
2249
2249
  if (!i)
2250
2250
  throw new Error(`cannot find current worksheet, sheetId: ${a}`);
2251
2251
  return this._validatorByCell(r, i, e, t);
2252
2252
  }
2253
- validatorRanges(o, a, e) {
2253
+ validatorRanges(s, a, e) {
2254
2254
  if (!e.length)
2255
2255
  return Promise.resolve([]);
2256
- const t = this._univerInstanceService.getUnit(o, N.UNIVER_SHEET);
2256
+ const t = this._univerInstanceService.getUnit(s, N.UNIVER_SHEET);
2257
2257
  if (!t)
2258
- throw new Error(`cannot find current workbook, unitId: ${o}`);
2258
+ throw new Error(`cannot find current workbook, unitId: ${s}`);
2259
2259
  const r = t.getSheetBySheetId(a);
2260
2260
  if (!r)
2261
2261
  throw new Error(`cannot find current worksheet, sheetId: ${a}`);
2262
2262
  return Promise.all(e.map((i) => {
2263
- const s = [];
2263
+ const o = [];
2264
2264
  return b.foreach(i, (n, l) => {
2265
- s.push(this._validatorByCell(t, r, n, l));
2266
- }), s;
2265
+ o.push(this._validatorByCell(t, r, n, l));
2266
+ }), o;
2267
2267
  }));
2268
2268
  }
2269
- async validatorWorksheet(o, a) {
2270
- const e = this._univerInstanceService.getUnit(o, N.UNIVER_SHEET);
2269
+ async validatorWorksheet(s, a) {
2270
+ const e = this._univerInstanceService.getUnit(s, N.UNIVER_SHEET);
2271
2271
  if (!e)
2272
- throw new Error(`cannot find current workbook, unitId: ${o}`);
2272
+ throw new Error(`cannot find current workbook, unitId: ${s}`);
2273
2273
  const t = e.getSheetBySheetId(a);
2274
2274
  if (!t)
2275
2275
  throw new Error(`cannot find current worksheet, sheetId: ${a}`);
2276
- const r = this._sheetDataValidationModel.getRules(o, a);
2277
- return await Promise.all(r.map((i) => Promise.all(i.ranges.map((s) => {
2276
+ const r = this._sheetDataValidationModel.getRules(s, a);
2277
+ return await Promise.all(r.map((i) => Promise.all(i.ranges.map((o) => {
2278
2278
  const n = [];
2279
- return b.foreach(s, (l, u) => {
2279
+ return b.foreach(o, (l, u) => {
2280
2280
  n.push(this._validatorByCell(e, t, l, u));
2281
2281
  }), n;
2282
- })))), this._dataValidationCacheService.ensureCache(o, a);
2282
+ })))), this._dataValidationCacheService.ensureCache(s, a);
2283
2283
  }
2284
- async validatorWorkbook(o) {
2285
- const a = this._sheetDataValidationModel.getSubUnitIds(o), e = await Promise.all(a.map((r) => this.validatorWorksheet(o, r))), t = {};
2284
+ async validatorWorkbook(s) {
2285
+ const a = this._sheetDataValidationModel.getSubUnitIds(s), e = await Promise.all(a.map((r) => this.validatorWorksheet(s, r))), t = {};
2286
2286
  return e.forEach((r, i) => {
2287
2287
  t[a[i]] = r;
2288
2288
  }), t;
2289
2289
  }
2290
- getDataValidations(o, a, e) {
2291
- const t = this._sheetDataValidationModel.getRuleObjectMatrix(o, a), r = /* @__PURE__ */ new Set();
2292
- return e.forEach((s) => {
2293
- b.foreach(s, (n, l) => {
2290
+ getDataValidations(s, a, e) {
2291
+ const t = this._sheetDataValidationModel.getRuleObjectMatrix(s, a), r = /* @__PURE__ */ new Set();
2292
+ return e.forEach((o) => {
2293
+ b.foreach(o, (n, l) => {
2294
2294
  const u = t.getValue(n, l);
2295
2295
  u && r.add(u);
2296
2296
  });
2297
- }), Array.from(r).map((s) => this._sheetDataValidationModel.getRuleById(o, a, s)).filter(Boolean);
2297
+ }), Array.from(r).map((o) => this._sheetDataValidationModel.getRuleById(s, a, o)).filter(Boolean);
2298
2298
  }
2299
- getDataValidation(o, a, e) {
2300
- return this.getDataValidations(o, a, e)[0];
2299
+ getDataValidation(s, a, e) {
2300
+ return this.getDataValidations(s, a, e)[0];
2301
2301
  }
2302
2302
  };
2303
2303
  Oe = Ga([
2304
- ve(0, O),
2305
- ve(1, R(F)),
2306
- ve(2, R(q)),
2307
- ve(3, R(Nt))
2304
+ Re(0, O),
2305
+ Re(1, S(F)),
2306
+ Re(2, S(q)),
2307
+ Re(3, S(Nt))
2308
2308
  ], Oe);
2309
- var pt = Object.defineProperty, ka = Object.getOwnPropertyDescriptor, Ya = (o, a, e) => a in o ? pt(o, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[a] = e, Xa = (o, a, e, t) => {
2310
- for (var r = t > 1 ? void 0 : t ? ka(a, e) : a, i = o.length - 1, s; i >= 0; i--)
2311
- (s = o[i]) && (r = (t ? s(a, e, r) : s(r)) || r);
2312
- return t && r && pt(a, e, r), r;
2313
- }, je = (o, a) => (e, t) => a(e, t, o), ft = (o, a, e) => Ya(o, typeof a != "symbol" ? a + "" : a, e);
2309
+ var _t = Object.defineProperty, ka = Object.getOwnPropertyDescriptor, Ya = (s, a, e) => a in s ? _t(s, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[a] = e, Xa = (s, a, e, t) => {
2310
+ for (var r = t > 1 ? void 0 : t ? ka(a, e) : a, i = s.length - 1, o; i >= 0; i--)
2311
+ (o = s[i]) && (r = (t ? o(a, e, r) : o(r)) || r);
2312
+ return t && r && _t(a, e, r), r;
2313
+ }, je = (s, a) => (e, t) => a(e, t, s), pt = (s, a, e) => Ya(s, typeof a != "symbol" ? a + "" : a, e);
2314
2314
  let we = class extends wt {
2315
- constructor(o = tt, a, e, t) {
2316
- super(), this._config = o, this._injector = a, this._commandService = e, this._configService = t;
2315
+ constructor(s = tt, a, e, t) {
2316
+ super(), this._config = s, this._injector = a, this._commandService = e, this._configService = t;
2317
2317
  const { ...r } = It(
2318
2318
  {},
2319
2319
  tt,
@@ -2333,18 +2333,18 @@ let we = class extends wt {
2333
2333
  [Ne],
2334
2334
  [Fe],
2335
2335
  [Ee]
2336
- ].forEach((o) => {
2337
- this._injector.add(o);
2336
+ ].forEach((s) => {
2337
+ this._injector.add(s);
2338
2338
  }), [
2339
- fa,
2340
2339
  pa,
2341
- va,
2340
+ _a,
2342
2341
  Ra,
2342
+ Sa,
2343
2343
  ya,
2344
2344
  Va,
2345
- Sa
2346
- ].forEach((o) => {
2347
- this._commandService.registerCommand(o);
2345
+ va
2346
+ ].forEach((s) => {
2347
+ this._commandService.registerCommand(s);
2348
2348
  }), this._injector.get(q), this._injector.get(Oe), this._injector.get(Ee), this._injector.get(Fe);
2349
2349
  }
2350
2350
  onReady() {
@@ -2354,16 +2354,16 @@ let we = class extends wt {
2354
2354
  this._injector.get(Ce), this._injector.get(Te);
2355
2355
  }
2356
2356
  };
2357
- ft(we, "pluginName", kt);
2358
- ft(we, "type", N.UNIVER_SHEET);
2357
+ pt(we, "pluginName", kt);
2358
+ pt(we, "type", N.UNIVER_SHEET);
2359
2359
  we = Xa([
2360
2360
  Ot(xt),
2361
- je(1, R(Ge)),
2361
+ je(1, S(Ge)),
2362
2362
  je(2, x),
2363
2363
  je(3, At)
2364
2364
  ], we);
2365
- function or(o) {
2366
- const e = o.get(nt).getCurrentSelections().map((i) => i.range);
2365
+ function sr(s) {
2366
+ const e = s.get(nt).getCurrentSelections().map((i) => i.range);
2367
2367
  return {
2368
2368
  uid: V.generateRandomId(6),
2369
2369
  type: T.DECIMAL,
@@ -2373,11 +2373,11 @@ function or(o) {
2373
2373
  };
2374
2374
  }
2375
2375
  export {
2376
- fa as AddSheetDataValidationCommand,
2376
+ pa as AddSheetDataValidationCommand,
2377
2377
  Ve as CHECKBOX_FORMULA_1,
2378
2378
  Me as CHECKBOX_FORMULA_2,
2379
- sa as CheckboxValidator,
2380
- Sa as ClearRangeDataValidationCommand,
2379
+ oa as CheckboxValidator,
2380
+ va as ClearRangeDataValidationCommand,
2381
2381
  kt as DATA_VALIDATION_PLUGIN_NAME,
2382
2382
  q as DataValidationCacheService,
2383
2383
  P as DataValidationCustomFormulaService,
@@ -2391,17 +2391,17 @@ export {
2391
2391
  F as SheetDataValidationModel,
2392
2392
  Oe as SheetsDataValidationValidatorService,
2393
2393
  we as UniverSheetsDataValidationPlugin,
2394
- Ra as UpdateSheetDataValidationOptionsCommand,
2395
- pa as UpdateSheetDataValidationRangeCommand,
2396
- va as UpdateSheetDataValidationSettingCommand,
2397
- or as createDefaultNewRule,
2398
- fe as deserializeListOptions,
2394
+ Sa as UpdateSheetDataValidationOptionsCommand,
2395
+ _a as UpdateSheetDataValidationRangeCommand,
2396
+ Ra as UpdateSheetDataValidationSettingCommand,
2397
+ sr as createDefaultNewRule,
2398
+ pe as deserializeListOptions,
2399
2399
  ne as getCellValueOrigin,
2400
2400
  ir as getDataValidationCellValue,
2401
2401
  be as getDataValidationDiffMutations,
2402
- _e as getFormulaCellData,
2403
- oe as getFormulaResult,
2402
+ ge as getFormulaCellData,
2403
+ se as getFormulaResult,
2404
2404
  C as isLegalFormulaResult,
2405
2405
  rr as serializeListOptions,
2406
- pe as transformCheckboxValue
2406
+ _e as transformCheckboxValue
2407
2407
  };