@univerjs/engine-formula 0.6.7 → 0.6.8

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,7 +1,7 @@
1
1
  var Gu = Object.defineProperty;
2
2
  var Qu = (i, a, e) => a in i ? Gu(i, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[a] = e;
3
3
  var A = (i, a, e) => Qu(i, typeof a != "symbol" ? a + "" : a, e);
4
- import { ObjectMatrix as Ce, CommandType as Ie, RANGE_TYPE as Ze, AbsoluteRefType as we, Tools as ze, createIdentifier as et, Disposable as Ne, IUniverInstanceService as aa, LRUMap as Wu, hashAlgorithm as qu, moveRangeByOffset as ia, isValidRange as Ku, isFormulaString as yt, isFormulaId as Pt, Rectangle as Xa, cellToRange as Xu, Inject as ye, UniverInstanceType as Lr, BooleanNumber as Gi, LocaleService as Zu, LocaleType as wr, numfmt as gt, BuildTextUtils as zu, isRealNum as Q, CellValueType as Rt, toDisposable as Ju, Injector as Qi, sortRules as ec, RTree as Vs, IConfigService as oa, requestImmediateMacroTask as tc, ICommandService as sr, DataStreamTreeTokenType as ve, DisposableCollection as rc, Optional as nc, Plugin as sc, merge as ac, touchDependencies as os } from "@univerjs/core";
4
+ import { ObjectMatrix as Ce, CommandType as Ie, RANGE_TYPE as Ze, AbsoluteRefType as we, Tools as ze, createIdentifier as et, Disposable as Ne, IUniverInstanceService as sa, LRUMap as Wu, hashAlgorithm as qu, moveRangeByOffset as aa, isValidRange as Ku, isFormulaString as yt, isFormulaId as Pt, Rectangle as Xa, cellToRange as Xu, Inject as ye, UniverInstanceType as Lr, BooleanNumber as Gi, LocaleService as Zu, LocaleType as wr, numfmt as gt, BuildTextUtils as zu, isRealNum as Q, CellValueType as Rt, toDisposable as Ju, Injector as Qi, sortRules as ec, RTree as ps, IConfigService as ia, requestImmediateMacroTask as tc, ICommandService as sr, DataStreamTreeTokenType as ve, DisposableCollection as rc, Optional as nc, Plugin as sc, merge as ac, touchDependencies as is } from "@univerjs/core";
5
5
  import { Subject as ur, BehaviorSubject as Wi, distinctUntilChanged as qi, combineLatest as ic, map as oc, Observable as uc, shareReplay as cc } from "rxjs";
6
6
  import { isTextFormat as lc } from "@univerjs/engine-numfmt";
7
7
  import { DataSyncPrimaryController as fc } from "@univerjs/rpc";
@@ -59,7 +59,7 @@ const nn = /* @__PURE__ */ new Map([
59
59
  /* LESS_THAN_OR_EQUAL */
60
60
  ]);
61
61
  var K = /* @__PURE__ */ ((i) => (i.OPEN_BRACKET = "(", i.CLOSE_BRACKET = ")", i.COMMA = ",", i.SINGLE_QUOTATION = "'", i.DOUBLE_QUOTATION = '"', i.OPEN_BRACES = "{", i.CLOSE_BRACES = "}", i.COLON = ":", i.OPEN_SQUARE_BRACKET = "[", i.CLOSE_SQUARE_BRACKET = "]", i))(K || {}), Je = /* @__PURE__ */ ((i) => (i.PERCENTAGE = "%", i.POUND = "#", i))(Je || {});
62
- const us = /* @__PURE__ */ new Set([
62
+ const os = /* @__PURE__ */ new Set([
63
63
  "%",
64
64
  "#"
65
65
  /* POUND */
@@ -161,7 +161,7 @@ function pc(i) {
161
161
  }
162
162
  return a;
163
163
  }
164
- const Xi = '\\[([^\\[\\]\\/?:"<>|*\\\\]+)\\]', Ja = new RegExp(Xi), Vc = "((?![\\[\\]\\/?*\\\\]).)*!", Tt = "$", ua = "\\s*?:\\s*?", mn = "[A-Za-z]+", gn = "[1-9][0-9]*", Rr = `'?(${Xi})?(${Vc})?'?`, Ns = `\\${Tt}?${mn}\\${Tt}?${gn}`, Nc = `^(${Me.AT})?${Rr}${Ns}${ua}${Ns}$`, ei = new RegExp(Nc), Oc = `^${Rr}\\s*?${Ns}(${Je.POUND})?$`, ti = new RegExp(Oc), Mc = `^${Rr}\\${Tt}?${gn}${ua}\\${Tt}?${gn}$`, ri = new RegExp(Mc), wc = `^${Rr}\\${Tt}?${mn}${ua}\\${Tt}?${mn}$`, ni = new RegExp(wc), Sc = `^${Rr}\\s*?\\${Tt}?${gn}$`, si = new RegExp(Sc), Dc = `^${Rr}\\s*?\\${Tt}?${mn}$`, ai = new RegExp(Dc), Lc = "{.*?}", ii = new RegExp(Lc, "g");
164
+ const Xi = '\\[([^\\[\\]\\/?:"<>|*\\\\]+)\\]', Ja = new RegExp(Xi), Vc = "((?![\\[\\]\\/?*\\\\]).)*!", Tt = "$", oa = "\\s*?:\\s*?", mn = "[A-Za-z]+", gn = "[1-9][0-9]*", Rr = `'?(${Xi})?(${Vc})?'?`, Vs = `\\${Tt}?${mn}\\${Tt}?${gn}`, Nc = `^(${Me.AT})?${Rr}${Vs}${oa}${Vs}$`, ei = new RegExp(Nc), Oc = `^${Rr}\\s*?${Vs}(${Je.POUND})?$`, ti = new RegExp(Oc), Mc = `^${Rr}\\${Tt}?${gn}${oa}\\${Tt}?${gn}$`, ri = new RegExp(Mc), wc = `^${Rr}\\${Tt}?${mn}${oa}\\${Tt}?${mn}$`, ni = new RegExp(wc), Sc = `^${Rr}\\s*?\\${Tt}?${gn}$`, si = new RegExp(Sc), Dc = `^${Rr}\\s*?\\${Tt}?${mn}$`, ai = new RegExp(Dc), Lc = "{.*?}", ii = new RegExp(Lc, "g");
165
165
  function Br(i) {
166
166
  return ti.lastIndex = 0, ti.test(i);
167
167
  }
@@ -190,7 +190,7 @@ const Uc = {
190
190
  id: "formula.mutation.register-function",
191
191
  type: Ie.MUTATION,
192
192
  handler: () => !0
193
- }, Os = {
193
+ }, Ns = {
194
194
  id: "formula.mutation.set-array-formula-data",
195
195
  type: Ie.MUTATION,
196
196
  handler: (i, a) => !0
@@ -242,13 +242,13 @@ function Bc(i, a) {
242
242
  return `${ro(i)}!${fr(a)}`;
243
243
  }
244
244
  function Ic(i, a, e) {
245
- return ws(i) || ws(a) ? `'[${Ss(i)}]${Ss(a)}'!${fr(e)}` : `[${i}]${a}!${fr(e)}`;
245
+ return Ms(i) || Ms(a) ? `'[${ws(i)}]${ws(a)}'!${fr(e)}` : `[${i}]${a}!${fr(e)}`;
246
246
  }
247
- function Ms(i) {
247
+ function Os(i) {
248
248
  const { unitId: a, sheetName: e, range: t } = i;
249
249
  return a != null && a.length > 0 && e != null && e.length > 0 ? Ic(a, e, t) : e != null && e.length > 0 ? Bc(e, t) : fr(t);
250
250
  }
251
- function cs(i) {
251
+ function us(i) {
252
252
  const a = Number.parseInt(i.replace(vc, "")) - 1, e = ze.ABCatNum(i.replace(Tc, "")), t = an(i);
253
253
  return {
254
254
  row: a,
@@ -256,7 +256,7 @@ function cs(i) {
256
256
  absoluteRefType: t
257
257
  };
258
258
  }
259
- function ca(i) {
259
+ function ua(i) {
260
260
  const a = Ja.exec(i);
261
261
  let e = "";
262
262
  a != null && (e = a[0].trim(), e = ui(e.slice(1, e.length - 1)), i = i.replace(Ja, ""));
@@ -269,9 +269,9 @@ function ca(i) {
269
269
  };
270
270
  }
271
271
  function dn(i) {
272
- const { refBody: a, sheetName: e, unitId: t } = ca(i), r = a.indexOf(":");
272
+ const { refBody: a, sheetName: e, unitId: t } = ua(i), r = a.indexOf(":");
273
273
  if (r === -1) {
274
- const _ = cs(a), C = _.row, E = _.column, b = _.absoluteRefType;
274
+ const _ = us(a), C = _.row, E = _.column, b = _.absoluteRefType;
275
275
  return {
276
276
  unitId: t,
277
277
  sheetName: e,
@@ -285,7 +285,7 @@ function dn(i) {
285
285
  }
286
286
  };
287
287
  }
288
- const n = a.substring(0, r), s = a.substring(r + 1), o = cs(n), u = cs(s), c = o.row > u.row ? u.row : o.row, l = o.column > u.column ? u.column : o.column, f = o.row > u.row ? o.row : u.row, h = o.column > u.column ? o.column : u.column;
288
+ const n = a.substring(0, r), s = a.substring(r + 1), o = us(n), u = us(s), c = o.row > u.row ? u.row : o.row, l = o.column > u.column ? u.column : o.column, f = o.row > u.row ? o.row : u.row, h = o.column > u.column ? o.column : u.column;
289
289
  let d = Ze.NORMAL;
290
290
  return Number.isNaN(c) && Number.isNaN(f) ? d = Ze.COLUMN : Number.isNaN(l) && Number.isNaN(h) && (d = Ze.ROW), {
291
291
  unitId: t,
@@ -339,13 +339,13 @@ function $b(i, a) {
339
339
  function kc(i) {
340
340
  return ((i == null ? void 0 : i.split(",")) || []).every((e) => on(e.trim()));
341
341
  }
342
- function ws(i) {
342
+ function Ms(i) {
343
343
  return i.length === 0 ? !1 : !!(_c(i) || $c(i) || Yc(i) || Hc(i) || /[\s!$%^&*()+\-=\[\]{};':"\\|,.<>\/?()]/.test(i));
344
344
  }
345
345
  function ro(i) {
346
- return ws(i) ? `'${Ss(i)}'` : i;
346
+ return Ms(i) ? `'${ws(i)}'` : i;
347
347
  }
348
- function Ss(i) {
348
+ function ws(i) {
349
349
  return i.replace(/'/g, "''");
350
350
  }
351
351
  function ui(i) {
@@ -366,7 +366,7 @@ var Gc = Object.getOwnPropertyDescriptor, Qc = (i, a, e, t) => {
366
366
  (s = i[n]) && (r = s(r) || r);
367
367
  return r;
368
368
  }, Wc = (i, a) => (e, t) => a(e, t, i);
369
- let Ds = class extends Ne {
369
+ let Ss = class extends Ne {
370
370
  constructor(a) {
371
371
  super();
372
372
  // 18.2.6 definedNames (Defined Names)
@@ -396,7 +396,7 @@ let Ds = class extends Ne {
396
396
  }
397
397
  getWorksheetByRef(a, e) {
398
398
  var r;
399
- const { sheetName: t } = ca(e);
399
+ const { sheetName: t } = ua(e);
400
400
  return (r = this._univerInstanceService.getUnit(a)) == null ? void 0 : r.getSheetBySheetName(t);
401
401
  }
402
402
  focusRange(a, e) {
@@ -464,16 +464,16 @@ let Ds = class extends Ne {
464
464
  this._nameCacheMap[a][t.name] = t;
465
465
  }
466
466
  };
467
- Ds = Qc([
468
- Wc(0, aa)
469
- ], Ds);
467
+ Ss = Qc([
468
+ Wc(0, sa)
469
+ ], Ss);
470
470
  const pr = et("univer.formula.defined-names.service"), Yb = (i, a) => {
471
471
  const { unitId: e, id: t } = a;
472
472
  return {
473
473
  ...i.get(pr).getValueById(e, t),
474
474
  unitId: e
475
475
  };
476
- }, la = {
476
+ }, ca = {
477
477
  id: "formula.mutation.set-defined-name",
478
478
  type: Ie.MUTATION,
479
479
  handler: (i, a) => {
@@ -498,11 +498,11 @@ const pr = et("univer.formula.defined-names.service"), Yb = (i, a) => {
498
498
  const e = i.get(pr), { unitId: t, id: r } = a;
499
499
  return e.removeDefinedName(t, r), !0;
500
500
  }
501
- }, fa = {
501
+ }, la = {
502
502
  id: "formula.mutation.set-feature-calculation",
503
503
  type: Ie.MUTATION,
504
504
  handler: () => !0
505
- }, ha = {
505
+ }, fa = {
506
506
  id: "formula.mutation.remove-feature-calculation",
507
507
  type: Ie.MUTATION,
508
508
  handler: () => !0
@@ -526,11 +526,11 @@ const pr = et("univer.formula.defined-names.service"), Yb = (i, a) => {
526
526
  id: "formula.mutation.set-formula-data",
527
527
  type: Ie.MUTATION,
528
528
  handler: (i, a) => !0
529
- }, ma = {
529
+ }, ha = {
530
530
  id: "formula.mutation.set-other-formula",
531
531
  type: Ie.MUTATION,
532
532
  handler: () => !0
533
- }, ga = {
533
+ }, ma = {
534
534
  id: "formula.mutation.remove-other-formula",
535
535
  type: Ie.MUTATION,
536
536
  handler: () => !0
@@ -573,16 +573,16 @@ class Nt {
573
573
  return a.length <= 64 ? a : qu(a).toString();
574
574
  }
575
575
  }
576
- const ht = "P_1", Ut = "R_1", hr = "L_1", Ir = "LR_1", co = "LO_1", Xc = "LET", Pr = "LAMBDA", Zc = "CUBE", zc = /* @__PURE__ */ new Set(["RAND", "RANDBETWEEN", "NOW", "TODAY"]), Ls = new Nt(1e5);
576
+ const ht = "P_1", Ut = "R_1", hr = "L_1", Ir = "LR_1", co = "LO_1", Xc = "LET", Pr = "LAMBDA", Zc = "CUBE", zc = /* @__PURE__ */ new Set(["RAND", "RANDBETWEEN", "NOW", "TODAY"]), Ds = new Nt(1e5);
577
577
  function mr(i) {
578
- const a = Ls.get(i);
578
+ const a = Ds.get(i);
579
579
  if (a)
580
580
  return a;
581
581
  const e = dn(i);
582
- return Ls.set(i, e), dn(i);
582
+ return Ds.set(i, e), dn(i);
583
583
  }
584
584
  function Jc() {
585
- Ls.clear();
585
+ Ds.clear();
586
586
  }
587
587
  var $e = /* @__PURE__ */ ((i) => (i[i.NORMAL = 0] = "NORMAL", i[i.NUMBER = 1] = "NUMBER", i[i.STRING = 2] = "STRING", i[i.FUNCTION = 3] = "FUNCTION", i[i.REFERENCE = 4] = "REFERENCE", i[i.ARRAY = 5] = "ARRAY", i[i.DEFINED_NAME = 6] = "DEFINED_NAME", i))($e || {});
588
588
  function ci(i) {
@@ -698,8 +698,8 @@ class ae {
698
698
  return r;
699
699
  }
700
700
  }
701
- const lo = 2e3, ls = new Nt(lo), fs = new Nt(lo);
702
- class da extends Ne {
701
+ const lo = 2e3, cs = new Nt(lo), ls = new Nt(lo);
702
+ class ga extends Ne {
703
703
  constructor() {
704
704
  super(...arguments);
705
705
  A(this, "_currentLexerNode", new ae());
@@ -723,7 +723,7 @@ class da extends Ne {
723
723
  }
724
724
  // Table3[[#All],[Column1]:[Column2]]
725
725
  dispose() {
726
- this._resetTemp(), this._currentLexerNode.dispose(), ls.clear(), fs.clear();
726
+ this._resetTemp(), this._currentLexerNode.dispose(), cs.clear(), ls.clear();
727
727
  }
728
728
  getUpLevel() {
729
729
  return this._upLevel;
@@ -800,14 +800,14 @@ class da extends Ne {
800
800
  return c;
801
801
  }
802
802
  sequenceNodesBuilder(e) {
803
- const t = fs.get(e);
803
+ const t = ls.get(e);
804
804
  if (t)
805
805
  return [...t];
806
806
  const r = this._getSequenceArray(e);
807
807
  if (r.length === 0)
808
808
  return;
809
809
  const n = this.getSequenceNode(r);
810
- return fs.set(e, [...n]), n;
810
+ return ls.set(e, [...n]), n;
811
811
  }
812
812
  convertRefersToAbsolute(e, t, r, n = "") {
813
813
  const s = this.sequenceNodesBuilder(e);
@@ -825,7 +825,7 @@ class da extends Ne {
825
825
  ..._,
826
826
  startAbsoluteRefType: t,
827
827
  endAbsoluteRefType: r
828
- }, R = Ms({
828
+ }, R = Os({
829
829
  range: b,
830
830
  unitId: E,
831
831
  sheetName: C || n
@@ -860,9 +860,9 @@ class da extends Ne {
860
860
  o.push(l);
861
861
  continue;
862
862
  } else
863
- C = ia(C, t, r, n);
863
+ C = aa(C, t, r, n);
864
864
  let E = "";
865
- Ku(C) ? E = Ms({
865
+ Ku(C) ? E = Os({
866
866
  range: C,
867
867
  unitId: _,
868
868
  sheetName: d
@@ -881,7 +881,7 @@ class da extends Ne {
881
881
  if (this._currentLexerNode.getChildren().length === 0)
882
882
  return !0;
883
883
  const e = this._currentLexerNode.getChildren()[0];
884
- return !!(e instanceof ae || Dt.has(e) || us.has(e) || e === Me.AT || e === K.COMMA || e === K.COLON || e === K.OPEN_BRACKET);
884
+ return !!(e instanceof ae || Dt.has(e) || os.has(e) || e === Me.AT || e === K.COMMA || e === K.COLON || e === K.OPEN_BRACKET);
885
885
  }
886
886
  // eslint-disable-next-line complexity
887
887
  getSequenceNode(e) {
@@ -989,7 +989,7 @@ class da extends Ne {
989
989
  }
990
990
  treeBuilder(e, t = !0, r, n) {
991
991
  if (t === !0) {
992
- const h = ls.get(e), d = n == null ? void 0 : n(e);
992
+ const h = cs.get(e), d = n == null ? void 0 : n(e);
993
993
  if (h && !d)
994
994
  return h;
995
995
  }
@@ -1009,7 +1009,7 @@ class da extends Ne {
1009
1009
  if (f && (this._currentLexerNode = f), t) {
1010
1010
  if (!this._suffixExpressionHandler(this._currentLexerNode))
1011
1011
  return m.VALUE;
1012
- ls.set(e, this._currentLexerNode);
1012
+ cs.set(e, this._currentLexerNode);
1013
1013
  }
1014
1014
  return u && this._currentLexerNode.setDefinedNames(l), this._currentLexerNode;
1015
1015
  }
@@ -1255,7 +1255,7 @@ class da extends Ne {
1255
1255
  const r = this._findPreviousToken(e, t) || "", n = e.length - 1 === t;
1256
1256
  if (!n && this._isOperatorToken(r) || n && Ec(r))
1257
1257
  return !0;
1258
- if (us.has(r)) {
1258
+ if (os.has(r)) {
1259
1259
  const s = this._findSecondLastNonSpaceToken(e, t);
1260
1260
  if (s == null || yc(s))
1261
1261
  return !0;
@@ -1465,7 +1465,7 @@ class da extends Ne {
1465
1465
  C && C.changeToParent(f);
1466
1466
  }
1467
1467
  this._setCurrentLexerNode(d), this._currentLexerNode = h, this._openColon(_);
1468
- } else if (us.has(c) && this._checkSimilarErrorToken(c, u, s) && this.isSingleQuotationClose() && this.isDoubleQuotationClose() && this.isSquareBracketClose() && this.isBracesClose()) {
1468
+ } else if (os.has(c) && this._checkSimilarErrorToken(c, u, s) && this.isSingleQuotationClose() && this.isDoubleQuotationClose() && this.isSquareBracketClose() && this.isBracesClose()) {
1469
1469
  this._pushNodeToChildren(this._segment);
1470
1470
  const l = new ae();
1471
1471
  l.setToken(c);
@@ -1869,8 +1869,8 @@ let gr = class extends Ne {
1869
1869
  }
1870
1870
  };
1871
1871
  gr = nl([
1872
- li(0, aa),
1873
- li(1, ye(da))
1872
+ li(0, sa),
1873
+ li(1, ye(ga))
1874
1874
  ], gr);
1875
1875
  function fi(i, a, e, t) {
1876
1876
  i[a] || (i[a] = {}), i[a][e] || (i[a][e] = {});
@@ -1904,7 +1904,7 @@ function fi(i, a, e, t) {
1904
1904
  }
1905
1905
  };
1906
1906
  }
1907
- const sl = class Ps {
1907
+ const sl = class Ls {
1908
1908
  /**
1909
1909
  * Accept two comparable values and creates new instance of interval
1910
1910
  * Predicate Interval.comparable_less(low, high) supposed to return true on these values
@@ -1919,7 +1919,7 @@ const sl = class Ps {
1919
1919
  * @returns {Interval}
1920
1920
  */
1921
1921
  clone() {
1922
- return new Ps(this.low, this.high);
1922
+ return new Ls(this.low, this.high);
1923
1923
  }
1924
1924
  /**
1925
1925
  * Propery max returns clone of this interval
@@ -1966,7 +1966,7 @@ const sl = class Ps {
1966
1966
  * @returns {Interval}
1967
1967
  */
1968
1968
  merge(a) {
1969
- return new Ps(
1969
+ return new Ls(
1970
1970
  this.low === void 0 ? a.low : this.low < a.low ? this.low : a.low,
1971
1971
  this.high === void 0 ? a.high : this.high > a.high ? this.high : a.high
1972
1972
  );
@@ -2048,7 +2048,7 @@ class Ht {
2048
2048
  return e(a.item.key.high, t);
2049
2049
  }
2050
2050
  }
2051
- class Ca {
2051
+ class da {
2052
2052
  /**
2053
2053
  * Construct new empty instance of IntervalTree
2054
2054
  */
@@ -2169,7 +2169,7 @@ class Ca {
2169
2169
  * @param callback(value,key) - function to be called for each tree item
2170
2170
  */
2171
2171
  map(a) {
2172
- const e = new Ca();
2172
+ const e = new da();
2173
2173
  return this.tree_walk(this.root, (t) => e.insert(t.item.key, a(t.item.value, t.item.key))), e;
2174
2174
  }
2175
2175
  /**
@@ -2339,7 +2339,7 @@ class al {
2339
2339
  o == null && (o = /* @__PURE__ */ new Map(), s.set(e, o));
2340
2340
  let u = o.get(t);
2341
2341
  if (u == null) {
2342
- u = new Ca(), u.insert([r, n]), o.set(t, u);
2342
+ u = new da(), u.insert([r, n]), o.set(t, u);
2343
2343
  return;
2344
2344
  }
2345
2345
  this._handleNewInterval(u, r, n);
@@ -2407,7 +2407,7 @@ class al {
2407
2407
  a.insert([n, s]);
2408
2408
  }
2409
2409
  }
2410
- const bt = new al(), _a = "engine-formula.config", fo = 1, Hb = "CYCLE_REFERENCE_COUNT", hi = {};
2410
+ const bt = new al(), Ca = "engine-formula.config", fo = 1, Hb = "CYCLE_REFERENCE_COUNT", hi = {};
2411
2411
  class il extends Ne {
2412
2412
  constructor() {
2413
2413
  super(...arguments);
@@ -2429,7 +2429,7 @@ var ol = Object.getOwnPropertyDescriptor, ul = (i, a, e, t) => {
2429
2429
  (s = i[n]) && (r = s(r) || r);
2430
2430
  return r;
2431
2431
  }, Kr = (i, a) => (e, t) => a(e, t, i);
2432
- let xs = class extends Ne {
2432
+ let Ps = class extends Ne {
2433
2433
  constructor(a, e, t, r) {
2434
2434
  super();
2435
2435
  A(this, "_unitData", {});
@@ -2652,12 +2652,12 @@ let xs = class extends Ne {
2652
2652
  }), this._unitData[e][t].rowData = a[e][t]);
2653
2653
  }
2654
2654
  };
2655
- xs = ul([
2656
- Kr(0, aa),
2655
+ Ps = ul([
2656
+ Kr(0, sa),
2657
2657
  Kr(1, ye(Zu)),
2658
2658
  Kr(2, ye(gr)),
2659
2659
  Kr(3, ye(ho))
2660
- ], xs);
2660
+ ], Ps);
2661
2661
  const Ft = et(
2662
2662
  "univer.formula.current-data.service"
2663
2663
  );
@@ -2665,7 +2665,7 @@ var cl = Object.getOwnPropertyDescriptor, ll = (i, a, e, t) => {
2665
2665
  for (var r = t > 1 ? void 0 : t ? cl(a, e) : a, n = i.length - 1, s; n >= 0; n--)
2666
2666
  (s = i[n]) && (r = s(r) || r);
2667
2667
  return r;
2668
- }, hs = (i, a) => (e, t) => a(e, t, i);
2668
+ }, fs = (i, a) => (e, t) => a(e, t, i);
2669
2669
  let dr = class extends Ne {
2670
2670
  constructor(i, a, e) {
2671
2671
  super(), this._definedNamesService = i, this._lexerTreeBuilder = a, this._formulaCurrentConfigService = e;
@@ -2730,9 +2730,9 @@ let dr = class extends Ne {
2730
2730
  }
2731
2731
  };
2732
2732
  dr = ll([
2733
- hs(0, pr),
2734
- hs(1, ye(da)),
2735
- hs(2, Ft)
2733
+ fs(0, pr),
2734
+ fs(1, ye(ga)),
2735
+ fs(2, Ft)
2736
2736
  ], dr);
2737
2737
  function un(i) {
2738
2738
  if (i == null)
@@ -2809,16 +2809,16 @@ function Gb(i, a, e) {
2809
2809
  const o = n || s;
2810
2810
  return r.n.pattern = o, a;
2811
2811
  }
2812
- const js = new Nt(1e5);
2812
+ const xs = new Nt(1e5);
2813
2813
  function mi(i) {
2814
- const a = js.get(i);
2814
+ const a = xs.get(i);
2815
2815
  if (a !== void 0)
2816
2816
  return a;
2817
2817
  const e = gl(i);
2818
- return js.set(i, e), e;
2818
+ return xs.set(i, e), e;
2819
2819
  }
2820
2820
  function ml() {
2821
- js.clear();
2821
+ xs.clear();
2822
2822
  }
2823
2823
  function gl(i) {
2824
2824
  if (dl(i))
@@ -2857,11 +2857,11 @@ function Ke(i, a = 2) {
2857
2857
  function _l(i, a, e = 2) {
2858
2858
  return gt.format(Ke(i, e), a);
2859
2859
  }
2860
- const Aa = new Nt(1e5);
2860
+ const _a = new Nt(1e5);
2861
2861
  function Al(i) {
2862
2862
  let a = i;
2863
2863
  a.startsWith('"') && a.endsWith('"') && (a = a.slice(1, -1));
2864
- const e = Aa.get(a);
2864
+ const e = _a.get(a);
2865
2865
  if (e)
2866
2866
  return {
2867
2867
  isNumberPattern: !0,
@@ -2870,17 +2870,17 @@ function Al(i) {
2870
2870
  };
2871
2871
  const t = gt.parseNumber(a);
2872
2872
  if (t && t.z)
2873
- return ms(a, t.v, t.z);
2873
+ return hs(a, t.v, t.z);
2874
2874
  const r = gt.parseDate(a);
2875
2875
  if (r && r.z)
2876
- return ms(a, r.v, r.z);
2876
+ return hs(a, r.v, r.z);
2877
2877
  const n = gt.parseTime(a);
2878
- return n && n.z ? ms(a, n.v, n.z) : {
2878
+ return n && n.z ? hs(a, n.v, n.z) : {
2879
2879
  isNumberPattern: !1
2880
2880
  };
2881
2881
  }
2882
- function ms(i, a, e) {
2883
- return Aa.set(i, {
2882
+ function hs(i, a, e) {
2883
+ return _a.set(i, {
2884
2884
  value: a,
2885
2885
  pattern: e
2886
2886
  }), {
@@ -2890,7 +2890,7 @@ function ms(i, a, e) {
2890
2890
  };
2891
2891
  }
2892
2892
  function El() {
2893
- Aa.clear();
2893
+ _a.clear();
2894
2894
  }
2895
2895
  class Fn {
2896
2896
  constructor() {
@@ -3225,17 +3225,17 @@ class kt extends Fn {
3225
3225
  return g.create(m.VALUE);
3226
3226
  }
3227
3227
  }
3228
- const bl = 1e3, Us = new Nt(bl);
3228
+ const bl = 1e3, js = new Nt(bl);
3229
3229
  class g extends kt {
3230
3230
  constructor(a, e = "") {
3231
3231
  super(a), this._errorType = a, this._errorContent = e;
3232
3232
  }
3233
3233
  static create(a, e = "") {
3234
- const t = `${a}-${e}`, r = Us.get(t);
3234
+ const t = `${a}-${e}`, r = js.get(t);
3235
3235
  if (r)
3236
3236
  return r;
3237
3237
  const n = new g(a, e);
3238
- return Us.set(t, n), n;
3238
+ return js.set(t, n), n;
3239
3239
  }
3240
3240
  getValue() {
3241
3241
  return this._errorType;
@@ -3254,16 +3254,17 @@ class g extends kt {
3254
3254
  }
3255
3255
  }
3256
3256
  function yl(i) {
3257
+ var a;
3257
3258
  if (i === null)
3258
3259
  return 0;
3259
3260
  if (i != null && i.p) {
3260
- const a = i == null ? void 0 : i.p.body;
3261
- if (a == null)
3261
+ const e = i == null ? void 0 : i.p.body;
3262
+ if (e == null)
3262
3263
  return 0;
3263
- const e = a.dataStream;
3264
- return zu.transform.getPlainText(e);
3264
+ const t = e.dataStream;
3265
+ return zu.transform.getPlainText(t);
3265
3266
  }
3266
- return (i == null ? void 0 : i.v) || 0;
3267
+ return (a = i == null ? void 0 : i.v) != null ? a : 0;
3267
3268
  }
3268
3269
  var Wt = /* @__PURE__ */ ((i) => (i[i.MIN = 0] = "MIN", i[i.MAX = 1] = "MAX", i))(Wt || {}), Le = /* @__PURE__ */ ((i) => (i[i.NORMAL = 0] = "NORMAL", i[i.MIN = 1] = "MIN", i[i.MAX = 2] = "MAX", i))(Le || {});
3269
3270
  function _n() {
@@ -3272,7 +3273,7 @@ function _n() {
3272
3273
  function Rl(i) {
3273
3274
  return i.indexOf("*") > -1 || i.indexOf("?") > -1;
3274
3275
  }
3275
- function gs(i, a) {
3276
+ function ms(i, a) {
3276
3277
  const e = Vl(a).replace(/~?[*?]/g, (r) => r.startsWith("~") ? `\\${r.substring(1)}` : r === "*" ? ".*" : r === "?" ? "." : r);
3277
3278
  return new RegExp(`^${e}$`).test(i);
3278
3279
  }
@@ -3283,14 +3284,14 @@ function pl(i, a, e) {
3283
3284
  let t = !1;
3284
3285
  switch (e) {
3285
3286
  case $.EQUALS:
3286
- t = gs(i, a);
3287
+ t = ms(i, a);
3287
3288
  break;
3288
3289
  case $.NOT_EQUAL:
3289
- t = !gs(i, a);
3290
+ t = !ms(i, a);
3290
3291
  break;
3291
3292
  case $.GREATER_THAN:
3292
3293
  case $.GREATER_THAN_OR_EQUAL:
3293
- t = gs(i, a) || i > di(a);
3294
+ t = ms(i, a) || i > di(a);
3294
3295
  break;
3295
3296
  case $.LESS_THAN:
3296
3297
  case $.LESS_THAN_OR_EQUAL:
@@ -3302,7 +3303,7 @@ function pl(i, a, e) {
3302
3303
  function Vl(i) {
3303
3304
  return i.replace(/[.+^${}()|[\]\\]/g, "\\$&");
3304
3305
  }
3305
- function vs(i) {
3306
+ function Us(i) {
3306
3307
  switch (i) {
3307
3308
  case 1:
3308
3309
  return 2;
@@ -3314,10 +3315,10 @@ function vs(i) {
3314
3315
  return 0;
3315
3316
  }
3316
3317
  }
3317
- function Ts(i) {
3318
+ function vs(i) {
3318
3319
  return i === -2 ? 1 : 0;
3319
3320
  }
3320
- function Ea(i) {
3321
+ function Aa(i) {
3321
3322
  let a;
3322
3323
  switch (i) {
3323
3324
  case $.EQUALS:
@@ -3348,7 +3349,7 @@ function Ea(i) {
3348
3349
  * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
3349
3350
  * MIT Licence
3350
3351
  */
3351
- var Bs = 9e15, $t = 1e9, Is = "0123456789abcdef", An = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", En = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", Fs = {
3352
+ var Ts = 9e15, $t = 1e9, Bs = "0123456789abcdef", An = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", En = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", Is = {
3352
3353
  // These values must be integers within the stated ranges (inclusive).
3353
3354
  // Most of these values can be changed at run-time using the `Decimal.config` method.
3354
3355
  // The maximum number of significant digits of the result of a calculation or base conversion.
@@ -3401,12 +3402,12 @@ var Bs = 9e15, $t = 1e9, Is = "0123456789abcdef", An = "2.3025850929940456840179
3401
3402
  // -1 to -EXP_LIMIT
3402
3403
  // The maximum exponent value, above which overflow to Infinity occurs.
3403
3404
  // JavaScript numbers: 308 (1.7976931348623157e+308)
3404
- maxE: Bs,
3405
+ maxE: Ts,
3405
3406
  // 1 to EXP_LIMIT
3406
3407
  // Whether to use cryptographically-secure random number generation, if available.
3407
3408
  crypto: !1
3408
3409
  // true/false
3409
- }, go, pt, ue = !0, kn = "[DecimalError] ", Bt = kn + "Invalid argument: ", Co = kn + "Precision limit exceeded", _o = kn + "crypto unavailable", Ao = "[object Decimal]", Be = Math.floor, Pe = Math.pow, Nl = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, Ol = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, Ml = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, Eo = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, lt = 1e7, te = 7, wl = 9007199254740991, Sl = An.length - 1, ks = En.length - 1, B = { toStringTag: Ao };
3410
+ }, go, pt, ue = !0, kn = "[DecimalError] ", Bt = kn + "Invalid argument: ", Co = kn + "Precision limit exceeded", _o = kn + "crypto unavailable", Ao = "[object Decimal]", Be = Math.floor, Pe = Math.pow, Nl = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, Ol = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, Ml = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, Eo = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, lt = 1e7, te = 7, wl = 9007199254740991, Sl = An.length - 1, Fs = En.length - 1, B = { toStringTag: Ao };
3410
3411
  B.absoluteValue = B.abs = function() {
3411
3412
  var i = new this.constructor(this);
3412
3413
  return i.s < 0 && (i.s = 1), J(i);
@@ -3530,11 +3531,11 @@ B.inverseTangent = B.atan = function() {
3530
3531
  if (c.isFinite()) {
3531
3532
  if (c.isZero())
3532
3533
  return new l(c);
3533
- if (c.abs().eq(1) && f + 4 <= ks)
3534
+ if (c.abs().eq(1) && f + 4 <= Fs)
3534
3535
  return s = ct(l, f + 4, h).times(0.25), s.s = c.s, s;
3535
3536
  } else {
3536
3537
  if (!c.s) return new l(NaN);
3537
- if (f + 4 <= ks)
3538
+ if (f + 4 <= Fs)
3538
3539
  return s = ct(l, f + 4, h).times(0.5), s.s = c.s, s;
3539
3540
  }
3540
3541
  for (l.precision = o = f + 10, l.rounding = 1, e = Math.min(28, o / te + 2 | 0), i = e; i; --i) c = c.div(c.times(c).plus(1).sqrt().plus(1));
@@ -3632,7 +3633,7 @@ B.modulo = B.mod = function(i) {
3632
3633
  return i = new t(i), !e.d || !i.s || i.d && !i.d[0] ? new t(NaN) : !i.d || e.d && !e.d[0] ? J(new t(e), t.precision, t.rounding) : (ue = !1, t.modulo == 9 ? (a = Ve(e, i.abs(), 0, 3, 1), a.s *= i.s) : a = Ve(e, i, 0, t.modulo, 1), a = a.times(i), ue = !0, e.minus(a));
3633
3634
  };
3634
3635
  B.naturalExponential = B.exp = function() {
3635
- return $s(this);
3636
+ return ks(this);
3636
3637
  };
3637
3638
  B.naturalLogarithm = B.ln = function() {
3638
3639
  return jt(this);
@@ -3707,7 +3708,7 @@ B.times = B.mul = function(i) {
3707
3708
  return a ? ++e : n.shift(), i.d = n, i.e = $n(n, e), ue ? J(i, f.precision, f.rounding) : i;
3708
3709
  };
3709
3710
  B.toBinary = function(i, a) {
3710
- return ba(this, 2, i, a);
3711
+ return Ea(this, 2, i, a);
3711
3712
  };
3712
3713
  B.toDecimalPlaces = B.toDP = function(i, a) {
3713
3714
  var e = this, t = e.constructor;
@@ -3735,7 +3736,7 @@ B.toFraction = function(i) {
3735
3736
  return r = Ve(i.minus(e), t, 0, 1, 1), u = u.plus(r.times(c)), e = e.plus(r.times(t)), u.s = c.s = d.s, h = Ve(c, t, n, 1).minus(d).abs().cmp(Ve(u, e, n, 1).minus(d).abs()) < 1 ? [c, t] : [u, e], C.precision = l, ue = !0, h;
3736
3737
  };
3737
3738
  B.toHexadecimal = B.toHex = function(i, a) {
3738
- return ba(this, 16, i, a);
3739
+ return Ea(this, 16, i, a);
3739
3740
  };
3740
3741
  B.toNearest = function(i, a) {
3741
3742
  var e = this, t = e.constructor;
@@ -3753,7 +3754,7 @@ B.toNumber = function() {
3753
3754
  return +this;
3754
3755
  };
3755
3756
  B.toOctal = function(i, a) {
3756
- return ba(this, 8, i, a);
3757
+ return Ea(this, 8, i, a);
3757
3758
  };
3758
3759
  B.toPower = B.pow = function(i) {
3759
3760
  var a, e, t, r, n, s, o = this, u = o.constructor, c = +(i = new u(i));
@@ -3767,7 +3768,7 @@ B.toPower = B.pow = function(i) {
3767
3768
  if ((i.d[a] & 1) == 0 && (s = 1), o.e == 0 && o.d[0] == 1 && o.d.length == 1)
3768
3769
  return o.s = s, o;
3769
3770
  }
3770
- return e = Pe(+o, c), a = e == 0 || !isFinite(e) ? Be(c * (Math.log("0." + Ue(o.d)) / Math.LN10 + o.e + 1)) : new u(e + "").e, a > u.maxE + 1 || a < u.minE - 1 ? new u(a > 0 ? s / 0 : 0) : (ue = !1, u.rounding = o.s = 1, e = Math.min(12, (a + "").length), r = $s(i.times(jt(o, t + e)), t), r.d && (r = J(r, t + 5, 1), xr(r.d, t, n) && (a = t + 10, r = J($s(i.times(jt(o, a + e)), a), a + 5, 1), +Ue(r.d).slice(t + 1, t + 15) + 1 == 1e14 && (r = J(r, t + 1, 0)))), r.s = s, ue = !0, u.rounding = n, J(r, t, n));
3771
+ return e = Pe(+o, c), a = e == 0 || !isFinite(e) ? Be(c * (Math.log("0." + Ue(o.d)) / Math.LN10 + o.e + 1)) : new u(e + "").e, a > u.maxE + 1 || a < u.minE - 1 ? new u(a > 0 ? s / 0 : 0) : (ue = !1, u.rounding = o.s = 1, e = Math.min(12, (a + "").length), r = ks(i.times(jt(o, t + e)), t), r.d && (r = J(r, t + 5, 1), xr(r.d, t, n) && (a = t + 10, r = J(ks(i.times(jt(o, a + e)), a), a + 5, 1), +Ue(r.d).slice(t + 1, t + 15) + 1 == 1e14 && (r = J(r, t + 1, 0)))), r.s = s, ue = !0, u.rounding = n, J(r, t, n));
3771
3772
  };
3772
3773
  B.toPrecision = function(i, a) {
3773
3774
  var e, t = this, r = t.constructor;
@@ -3811,7 +3812,7 @@ function xr(i, a, e, t) {
3811
3812
  function cn(i, a, e) {
3812
3813
  for (var t, r = [0], n, s = 0, o = i.length; s < o; ) {
3813
3814
  for (n = r.length; n--; ) r[n] *= a;
3814
- for (r[0] += Is.indexOf(i.charAt(s++)), t = 0; t < r.length; t++)
3815
+ for (r[0] += Bs.indexOf(i.charAt(s++)), t = 0; t < r.length; t++)
3815
3816
  r[t] > e - 1 && (r[t + 1] === void 0 && (r[t + 1] = 0), r[t + 1] += r[t] / e | 0, r[t] %= e);
3816
3817
  }
3817
3818
  return r.reverse();
@@ -3938,7 +3939,7 @@ function bn(i, a, e) {
3938
3939
  return J(new i(An), a, 1, !0);
3939
3940
  }
3940
3941
  function ct(i, a, e) {
3941
- if (a > ks) throw Error(Co);
3942
+ if (a > Fs) throw Error(Co);
3942
3943
  return J(new i(En), a, e, !0);
3943
3944
  }
3944
3945
  function bo(i) {
@@ -3977,7 +3978,7 @@ function Ro(i, a, e) {
3977
3978
  }
3978
3979
  return r;
3979
3980
  }
3980
- function $s(i, a) {
3981
+ function ks(i, a) {
3981
3982
  var e, t, r, n, s, o, u, c = 0, l = 0, f = 0, h = i.constructor, d = h.rounding, _ = h.precision;
3982
3983
  if (!i.d || !i.d[0] || i.e > 17)
3983
3984
  return new h(i.d ? i.d[0] ? i.s < 0 ? 0 : 1 / 0 : 1 : i.s ? i.s < 0 ? 0 : i : NaN);
@@ -4022,7 +4023,7 @@ function jt(i, a) {
4022
4023
  function po(i) {
4023
4024
  return String(i.s * i.s / 0);
4024
4025
  }
4025
- function Ys(i, a) {
4026
+ function $s(i, a) {
4026
4027
  var e, t, r;
4027
4028
  for ((e = a.indexOf(".")) > -1 && (a = a.replace(".", "")), (t = a.search(/e/i)) > 0 ? (e < 0 && (e = t), e += +a.slice(t + 1), a = a.substring(0, t)) : e < 0 && (e = a.length), t = 0; a.charCodeAt(t) === 48; t++) ;
4028
4029
  for (r = a.length; a.charCodeAt(r - 1) === 48; --r) ;
@@ -4041,7 +4042,7 @@ function Ys(i, a) {
4041
4042
  function Ll(i, a) {
4042
4043
  var e, t, r, n, s, o, u, c, l;
4043
4044
  if (a.indexOf("_") > -1) {
4044
- if (a = a.replace(/(\d)_(?=\d)/g, "$1"), Eo.test(a)) return Ys(i, a);
4045
+ if (a = a.replace(/(\d)_(?=\d)/g, "$1"), Eo.test(a)) return $s(i, a);
4045
4046
  } else if (a === "Infinity" || a === "NaN")
4046
4047
  return +a || (i.s = NaN), i.e = NaN, i.d = null, i;
4047
4048
  if (Ol.test(a))
@@ -4092,7 +4093,7 @@ function Vo(i, a) {
4092
4093
  }
4093
4094
  return a.minus(r).abs();
4094
4095
  }
4095
- function ba(i, a, e, t) {
4096
+ function Ea(i, a, e, t) {
4096
4097
  var r, n, s, o, u, c, l, f, h, d = i.constructor, _ = e !== void 0;
4097
4098
  if (_ ? (He(e, 1, $t), t === void 0 ? t = d.rounding : He(t, 0, 8)) : (e = d.precision, t = d.rounding), !i.isFinite())
4098
4099
  l = po(i);
@@ -4105,13 +4106,13 @@ function ba(i, a, e, t) {
4105
4106
  for (; ++f[--e] > r - 1; )
4106
4107
  f[e] = 0, e || (++n, f.unshift(1));
4107
4108
  for (u = f.length; !f[u - 1]; --u) ;
4108
- for (s = 0, l = ""; s < u; s++) l += Is.charAt(f[s]);
4109
+ for (s = 0, l = ""; s < u; s++) l += Bs.charAt(f[s]);
4109
4110
  if (_) {
4110
4111
  if (u > 1)
4111
4112
  if (a == 16 || a == 8) {
4112
4113
  for (s = a == 16 ? 4 : 3, --u; u % s; u++) l += "0";
4113
4114
  for (f = cn(l, r, a), u = f.length; !f[u - 1]; --u) ;
4114
- for (s = 1, l = "1."; s < u; s++) l += Is.charAt(f[s]);
4115
+ for (s = 1, l = "1."; s < u; s++) l += Bs.charAt(f[s]);
4115
4116
  } else
4116
4117
  l = l.charAt(0) + "." + l.slice(1);
4117
4118
  l = l + (n < 0 ? "p" : "p+") + n;
@@ -4181,10 +4182,10 @@ function Gl(i) {
4181
4182
  0,
4182
4183
  "toExpPos",
4183
4184
  0,
4184
- Bs,
4185
+ Ts,
4185
4186
  "maxE",
4186
4187
  0,
4187
- Bs,
4188
+ Ts,
4188
4189
  "minE",
4189
4190
  -9e15,
4190
4191
  0,
@@ -4193,10 +4194,10 @@ function Gl(i) {
4193
4194
  9
4194
4195
  ];
4195
4196
  for (a = 0; a < n.length; a += 3)
4196
- if (e = n[a], r && (this[e] = Fs[e]), (t = i[e]) !== void 0)
4197
+ if (e = n[a], r && (this[e] = Is[e]), (t = i[e]) !== void 0)
4197
4198
  if (Be(t) === t && t >= n[a + 1] && t <= n[a + 2]) this[e] = t;
4198
4199
  else throw Error(Bt + e + ": " + t);
4199
- if (e = "crypto", r && (this[e] = Fs[e]), (t = i[e]) !== void 0)
4200
+ if (e = "crypto", r && (this[e] = Is[e]), (t = i[e]) !== void 0)
4200
4201
  if (t === !0 || t === !1 || t === 0 || t === 1)
4201
4202
  if (t)
4202
4203
  if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
@@ -4237,10 +4238,10 @@ function No(i) {
4237
4238
  n || (c.s = NaN), c.e = NaN, c.d = null;
4238
4239
  return;
4239
4240
  }
4240
- return Ys(c, n.toString());
4241
+ return $s(c, n.toString());
4241
4242
  } else if (u !== "string")
4242
4243
  throw Error(Bt + n);
4243
- return (o = n.charCodeAt(0)) === 45 ? (n = n.slice(1), c.s = -1) : (o === 43 && (n = n.slice(1)), c.s = 1), Eo.test(n) ? Ys(c, n) : Ll(c, n);
4244
+ return (o = n.charCodeAt(0)) === 45 ? (n = n.slice(1), c.s = -1) : (o === 43 && (n = n.slice(1)), c.s = 1), Eo.test(n) ? $s(c, n) : Ll(c, n);
4244
4245
  }
4245
4246
  if (r.prototype = B, r.ROUND_UP = 0, r.ROUND_DOWN = 1, r.ROUND_CEIL = 2, r.ROUND_FLOOR = 3, r.ROUND_HALF_UP = 4, r.ROUND_HALF_DOWN = 5, r.ROUND_HALF_EVEN = 6, r.ROUND_HALF_CEIL = 7, r.ROUND_HALF_FLOOR = 8, r.EUCLID = 9, r.config = r.set = Gl, r.clone = No, r.isDecimal = Ai, r.abs = xl, r.acos = jl, r.acosh = Ul, r.add = vl, r.asin = Tl, r.asinh = Bl, r.atan = Il, r.atanh = Fl, r.atan2 = kl, r.cbrt = $l, r.ceil = Yl, r.clamp = Hl, r.cos = Ql, r.cosh = Wl, r.div = ql, r.exp = Kl, r.floor = Xl, r.hypot = Zl, r.ln = zl, r.log = Jl, r.log10 = tf, r.log2 = ef, r.max = rf, r.min = nf, r.mod = sf, r.mul = af, r.pow = of, r.random = uf, r.round = cf, r.sign = lf, r.sin = ff, r.sinh = hf, r.sqrt = mf, r.sub = gf, r.sum = df, r.tan = Cf, r.tanh = _f, r.trunc = Af, i === void 0 && (i = {}), i && i.defaults !== !0)
4246
4247
  for (t = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"], a = 0; a < t.length; ) i.hasOwnProperty(e = t[a++]) || (i[e] = this[e]);
@@ -4354,7 +4355,7 @@ function Af(i) {
4354
4355
  }
4355
4356
  B[Symbol.for("nodejs.util.inspect.custom")] = B.toString;
4356
4357
  B[Symbol.toStringTag] = "Decimal";
4357
- var P = B.constructor = No(Fs);
4358
+ var P = B.constructor = No(Is);
4358
4359
  An = new P(An);
4359
4360
  En = new P(En);
4360
4361
  function Ef(i, a) {
@@ -4588,7 +4589,7 @@ const qt = class qt extends kt {
4588
4589
  return this._convertToNumber().mod(e);
4589
4590
  }
4590
4591
  compare(e, t) {
4591
- return e.isArray() ? e.compare(this, Ea(t)) : e.isNull() ? this._convertToNumber().compare(e, t) : this.compareBy(e.getValue(), t);
4592
+ return e.isArray() ? e.compare(this, Aa(t)) : e.isNull() ? this._convertToNumber().compare(e, t) : this.compareBy(e.getValue(), t);
4592
4593
  }
4593
4594
  compareBy(e, t) {
4594
4595
  let r = !1;
@@ -4798,9 +4799,11 @@ class y extends kt {
4798
4799
  return e.isArray() ? e.concatenateFront(this) : j.create(this.concatenate(e.getValue(), ut.BACK));
4799
4800
  }
4800
4801
  compare(e, t) {
4801
- return e.isArray() ? e.compare(this, Ea(t)) : this.compareBy(e.getValue(), t);
4802
+ return e.isArray() ? e.compare(this, Aa(t)) : this.compareBy(e.getValue(), t);
4802
4803
  }
4803
4804
  plusBy(e) {
4805
+ if (typeof e == "string" && e.trim() === "")
4806
+ return g.create(m.VALUE);
4804
4807
  const t = +this.getValue(), r = +e;
4805
4808
  if (Number.isNaN(t) || Number.isNaN(r))
4806
4809
  return g.create(m.VALUE);
@@ -4810,6 +4813,8 @@ class y extends kt {
4810
4813
  return Number.isFinite(n) ? y.create(n) : g.create(m.NUM);
4811
4814
  }
4812
4815
  minusBy(e) {
4816
+ if (typeof e == "string" && e.trim() === "")
4817
+ return g.create(m.VALUE);
4813
4818
  const t = +this.getValue(), r = +e;
4814
4819
  if (Number.isNaN(t) || Number.isNaN(r))
4815
4820
  return g.create(m.VALUE);
@@ -4819,6 +4824,8 @@ class y extends kt {
4819
4824
  return Number.isFinite(n) ? y.create(n) : g.create(m.NUM);
4820
4825
  }
4821
4826
  multiplyBy(e) {
4827
+ if (typeof e == "string" && e.trim() === "")
4828
+ return g.create(m.VALUE);
4822
4829
  const t = +this.getValue(), r = +e;
4823
4830
  if (Number.isNaN(t) || Number.isNaN(r))
4824
4831
  return g.create(m.VALUE);
@@ -4828,6 +4835,8 @@ class y extends kt {
4828
4835
  return Number.isFinite(n) ? y.create(n) : g.create(m.NUM);
4829
4836
  }
4830
4837
  dividedBy(e) {
4838
+ if (typeof e == "string" && e.trim() === "")
4839
+ return g.create(m.VALUE);
4831
4840
  const t = +this.getValue(), r = +e;
4832
4841
  if (Number.isNaN(t) || Number.isNaN(r))
4833
4842
  return g.create(m.VALUE);
@@ -5120,7 +5129,7 @@ class y extends kt {
5120
5129
  return n;
5121
5130
  }
5122
5131
  }
5123
- const Lf = 1e5, Hs = new Nt(Lf);
5132
+ const Lf = 1e5, Ys = new Nt(Lf);
5124
5133
  class j extends kt {
5125
5134
  constructor(e) {
5126
5135
  super(e);
@@ -5128,11 +5137,11 @@ class j extends kt {
5128
5137
  this._value = e;
5129
5138
  }
5130
5139
  static create(e) {
5131
- const t = Hs.get(e);
5140
+ const t = Ys.get(e);
5132
5141
  if (t)
5133
5142
  return t;
5134
5143
  const r = new j(e);
5135
- return Hs.set(e, r), r;
5144
+ return Ys.set(e, r), r;
5136
5145
  }
5137
5146
  getValue() {
5138
5147
  return this._value;
@@ -5159,7 +5168,7 @@ class j extends kt {
5159
5168
  return this.convertToNumberObjectValue().divided(e);
5160
5169
  }
5161
5170
  compare(e, t, r) {
5162
- return e.isArray() ? e.compare(this, Ea(t), r) : this.compareBy(e.getValue(), t, r);
5171
+ return e.isArray() ? e.compare(this, Aa(t), r) : this.compareBy(e.getValue(), t, r);
5163
5172
  }
5164
5173
  compareBy(e, t, r = !1) {
5165
5174
  let n = this.getValue(), s = !1;
@@ -6319,7 +6328,7 @@ class Wn extends Fn {
6319
6328
  };
6320
6329
  }
6321
6330
  getRangePosition() {
6322
- let { startRow: e, startColumn: t, endRow: r, endColumn: n } = ia(this._rangeData, this._refOffsetX, this._refOffsetY);
6331
+ let { startRow: e, startColumn: t, endRow: r, endColumn: n } = aa(this._rangeData, this._refOffsetX, this._refOffsetY);
6323
6332
  return Number.isNaN(e) && (e = 0), Number.isNaN(t) && (t = 0), Number.isNaN(r) && (r = this.getActiveSheetRowCount() - 1), Number.isNaN(n) && (n = this.getActiveSheetColumnCount() - 1), {
6324
6333
  ...this._rangeData,
6325
6334
  startRow: e,
@@ -6676,7 +6685,7 @@ class Rn extends Wn {
6676
6685
  return !0;
6677
6686
  }
6678
6687
  }
6679
- class ya extends Wn {
6688
+ class ba extends Wn {
6680
6689
  constructor(a) {
6681
6690
  super(a);
6682
6691
  const e = mr(a);
@@ -6715,7 +6724,7 @@ class ya extends Wn {
6715
6724
  return s && e.setForcedUnitIdDirect(s), e;
6716
6725
  }
6717
6726
  }
6718
- class Ra extends Wn {
6727
+ class ya extends Wn {
6719
6728
  constructor(a) {
6720
6729
  super(a);
6721
6730
  const e = mr(a);
@@ -6746,7 +6755,7 @@ class Ra extends Wn {
6746
6755
  return n > s ? t.endColumn = n : (t.startColumn = n, t.endColumn = s), r.startAbsoluteRefType && (t.endAbsoluteRefType = r.startAbsoluteRefType), t.rangeType = Ze.COLUMN, this.setToken(`${this.getToken()}${K.COLON}${e.getToken()}`), this;
6747
6756
  }
6748
6757
  }
6749
- class pa extends Wn {
6758
+ class Ra extends Wn {
6750
6759
  constructor(a) {
6751
6760
  super(a);
6752
6761
  const e = mr(a);
@@ -6820,7 +6829,7 @@ function Nr(i, a, e, t = "", r = "") {
6820
6829
  };
6821
6830
  return q.create(n);
6822
6831
  }
6823
- function Va(i) {
6832
+ function pa(i) {
6824
6833
  const a = [
6825
6834
  $.EQUALS,
6826
6835
  $.NOT_EQUAL,
@@ -6839,7 +6848,7 @@ function Va(i) {
6839
6848
  function qn(i, a, e, t) {
6840
6849
  if (!e)
6841
6850
  if (a.isString()) {
6842
- const r = `${a.getValue()}`, [n, s] = Va(r);
6851
+ const r = `${a.getValue()}`, [n, s] = pa(r);
6843
6852
  e = n, a = s;
6844
6853
  } else
6845
6854
  e = $.EQUALS;
@@ -6952,7 +6961,7 @@ function kr(i, a, e, t = !1) {
6952
6961
  return r;
6953
6962
  }
6954
6963
  function Kn(i, a, e) {
6955
- const [t, r] = Va(`${e.getValue()}`);
6964
+ const [t, r] = pa(`${e.getValue()}`);
6956
6965
  return i.mapValue((n, s, o) => {
6957
6966
  const u = a.get(s, o);
6958
6967
  if (u && kf(u, r))
@@ -6985,13 +6994,13 @@ function $f(i, a) {
6985
6994
  let e;
6986
6995
  switch (a) {
6987
6996
  case 0:
6988
- e = new ya(i);
6997
+ e = new ba(i);
6989
6998
  break;
6990
6999
  case 1:
6991
- e = new Ra(i);
7000
+ e = new ya(i);
6992
7001
  break;
6993
7002
  case 2:
6994
- e = new pa(i);
7003
+ e = new Ra(i);
6995
7004
  break;
6996
7005
  default:
6997
7006
  throw new Error("Unknown reference object type");
@@ -7007,7 +7016,7 @@ var Hf = Object.getOwnPropertyDescriptor, Gf = (i, a, e, t) => {
7007
7016
  (s = i[n]) && (r = s(r) || r);
7008
7017
  return r;
7009
7018
  }, Qf = (i, a) => (e, t) => a(e, t, i), Xe = /* @__PURE__ */ ((i) => (i[i.IDLE = 0] = "IDLE", i[i.START = 1] = "START", i[i.START_DEPENDENCY = 2] = "START_DEPENDENCY", i[i.START_CALCULATION = 3] = "START_CALCULATION", i[i.CURRENTLY_CALCULATING = 4] = "CURRENTLY_CALCULATING", i[i.START_DEPENDENCY_ARRAY_FORMULA = 5] = "START_DEPENDENCY_ARRAY_FORMULA", i[i.START_CALCULATION_ARRAY_FORMULA = 6] = "START_CALCULATION_ARRAY_FORMULA", i[i.CURRENTLY_CALCULATING_ARRAY_FORMULA = 7] = "CURRENTLY_CALCULATING_ARRAY_FORMULA", i[i.CALCULATION_COMPLETED = 8] = "CALCULATION_COMPLETED", i))(Xe || {}), Dr = /* @__PURE__ */ ((i) => (i[i.INITIAL = 0] = "INITIAL", i[i.STOP_EXECUTION = 1] = "STOP_EXECUTION", i[i.NOT_EXECUTED = 2] = "NOT_EXECUTED", i[i.SUCCESS = 3] = "SUCCESS", i))(Dr || {});
7010
- let Gs = class extends Ne {
7019
+ let Hs = class extends Ne {
7011
7020
  constructor(a) {
7012
7021
  super();
7013
7022
  A(this, "_formulaExecuteStage", 0);
@@ -7335,9 +7344,9 @@ let Gs = class extends Ne {
7335
7344
  return n.length === 0 ? !0 : mc(n, a, e, t, r);
7336
7345
  }
7337
7346
  };
7338
- Gs = Gf([
7347
+ Hs = Gf([
7339
7348
  Qf(0, Ft)
7340
- ], Gs);
7349
+ ], Hs);
7341
7350
  const Ot = et("univer.formula.runtime.service");
7342
7351
  var oe = /* @__PURE__ */ ((i) => (i[i.REFERENCE = 1] = "REFERENCE", i[i.VALUE = 2] = "VALUE", i[i.OPERATOR = 3] = "OPERATOR", i[i.FUNCTION = 4] = "FUNCTION", i[i.LAMBDA = 5] = "LAMBDA", i[i.LAMBDA_PARAMETER = 6] = "LAMBDA_PARAMETER", i[i.ERROR = 7] = "ERROR", i[i.BASE = 8] = "BASE", i[i.ROOT = 9] = "ROOT", i[i.UNION = 10] = "UNION", i[i.PREFIX = 11] = "PREFIX", i[i.SUFFIX = 12] = "SUFFIX", i[i.NULL = 13] = "NULL", i))(oe || {});
7343
7352
  const _t = /* @__PURE__ */ new Map([
@@ -7476,7 +7485,7 @@ class Et {
7476
7485
  return a instanceof ae ? r = a.getToken() : r = a, new Ge(r);
7477
7486
  }
7478
7487
  }
7479
- class Qs extends Ge {
7488
+ class Gs extends Ge {
7480
7489
  get nodeType() {
7481
7490
  return oe.ROOT;
7482
7491
  }
@@ -7498,7 +7507,7 @@ class Mo extends Et {
7498
7507
  if (!(a instanceof ae))
7499
7508
  return;
7500
7509
  if (a.getToken() === Ut)
7501
- return new Qs(Ut);
7510
+ return new Gs(Ut);
7502
7511
  }
7503
7512
  }
7504
7513
  const Wf = 5e3, jr = new Nt(Wf);
@@ -7952,13 +7961,13 @@ function Do(i) {
7952
7961
  function ah(i) {
7953
7962
  return i instanceof ae ? i.getToken() === co : !1;
7954
7963
  }
7955
- function Na(i, a, e) {
7964
+ function Va(i, a, e) {
7956
7965
  const t = i.getChildren(), r = t.length, n = t[0];
7957
7966
  for (let s = 0; s < r; s++) {
7958
7967
  const o = t[s];
7959
7968
  if (!(Do(n) && s !== 0))
7960
7969
  if (o instanceof ae)
7961
- Na(o, a, e);
7970
+ Va(o, a, e);
7962
7971
  else {
7963
7972
  const u = o.trim();
7964
7973
  if (e.has(u)) {
@@ -7979,14 +7988,14 @@ function Lo(i) {
7979
7988
  const r = e.get(t);
7980
7989
  return r == null && i.getValue() ? i : Lo(r);
7981
7990
  }
7982
- class Oa extends kt {
7991
+ class Na extends kt {
7983
7992
  constructor(e, t, r) {
7984
7993
  super(0);
7985
7994
  A(this, "_lambdaPrivacyValueMap", /* @__PURE__ */ new Map());
7986
7995
  this._lambdaNode = e, this._interpreter = t, this._lambdaPrivacyVarKeys = r, this._lambdaPrivacyValueMap.clear();
7987
7996
  }
7988
7997
  static create(e, t, r) {
7989
- return new Oa(e, t, r);
7998
+ return new Na(e, t, r);
7990
7999
  }
7991
8000
  dispose() {
7992
8001
  this._lambdaPrivacyValueMap.clear(), this._lambdaPrivacyValueMap = /* @__PURE__ */ new Map(), this._lambdaNode = null, this._interpreter = null, this._lambdaPrivacyVarKeys = [];
@@ -8073,7 +8082,7 @@ class uh extends Ge {
8073
8082
  }
8074
8083
  execute() {
8075
8084
  if (this.isEmptyParamFunction())
8076
- this.setValue(Oa.create(this, this._interpreter, this._lambdaPrivacyVarKeys));
8085
+ this.setValue(Na.create(this, this._interpreter, this._lambdaPrivacyVarKeys));
8077
8086
  else {
8078
8087
  const e = this.getChildren(), t = e.length;
8079
8088
  this.setValue(e[t - 1].getValue());
@@ -8125,7 +8134,7 @@ let On = class extends Et {
8125
8134
  return this.create(i);
8126
8135
  }
8127
8136
  _updateLambdaStatement(i, a, e) {
8128
- Na(i, a, e);
8137
+ Va(i, a, e);
8129
8138
  }
8130
8139
  };
8131
8140
  On = oh([
@@ -8247,8 +8256,8 @@ var dh = Object.getOwnPropertyDescriptor, Ch = (i, a, e, t) => {
8247
8256
  for (var r = t > 1 ? void 0 : t ? dh(a, e) : a, n = i.length - 1, s; n >= 0; n--)
8248
8257
  (s = i[n]) && (r = s(r) || r);
8249
8258
  return r;
8250
- }, ds = (i, a) => (e, t) => a(e, t, i);
8251
- class Cs extends Ge {
8259
+ }, gs = (i, a) => (e, t) => a(e, t, i);
8260
+ class ds extends Ge {
8252
8261
  constructor(e, t, r, n, s = !1) {
8253
8262
  super(r);
8254
8263
  A(this, "_refOffsetX", 0);
@@ -8289,7 +8298,7 @@ let wn = class extends Et {
8289
8298
  if (!a && s.charAt(0) === '"' && s.charAt(s.length - 1) === '"')
8290
8299
  return;
8291
8300
  let c;
8292
- if (Br(s) ? c = new Cs(r, n, s, ln.CELL, t) : a && this._checkParentIsUnionOperator(i) && (Ji(s) ? c = new Cs(r, n, s, ln.ROW, t) : eo(s) && (c = new Cs(r, n, s, ln.COLUMN, t))), c)
8301
+ if (Br(s) ? c = new ds(r, n, s, ln.CELL, t) : a && this._checkParentIsUnionOperator(i) && (Ji(s) ? c = new ds(r, n, s, ln.ROW, t) : eo(s) && (c = new ds(r, n, s, ln.COLUMN, t))), c)
8293
8302
  return u ? c.setParent(u) : o && c.setParent(o), c;
8294
8303
  }
8295
8304
  _checkParentIsUnionOperator(i) {
@@ -8298,15 +8307,15 @@ let wn = class extends Et {
8298
8307
  }
8299
8308
  };
8300
8309
  wn = Ch([
8301
- ds(0, Ft),
8302
- ds(1, Ot),
8303
- ds(2, Yt)
8310
+ gs(0, Ft),
8311
+ gs(1, Ot),
8312
+ gs(2, Yt)
8304
8313
  ], wn);
8305
8314
  var _h = Object.getOwnPropertyDescriptor, Ah = (i, a, e, t) => {
8306
8315
  for (var r = t > 1 ? void 0 : t ? _h(a, e) : a, n = i.length - 1, s; n >= 0; n--)
8307
8316
  (s = i[n]) && (r = s(r) || r);
8308
8317
  return r;
8309
- }, _s = (i, a) => (e, t) => a(e, t, i);
8318
+ }, Cs = (i, a) => (e, t) => a(e, t, i);
8310
8319
  class Oi extends Ge {
8311
8320
  constructor(a, e, t, r) {
8312
8321
  super(t), this._currentConfigService = a, this._lexer = e, this._operatorString = t, this._functionExecutor = r;
@@ -8359,9 +8368,9 @@ let Sn = class extends Et {
8359
8368
  }
8360
8369
  };
8361
8370
  Sn = Ah([
8362
- _s(0, Yt),
8363
- _s(1, ye(dr)),
8364
- _s(2, Ft)
8371
+ Cs(0, Yt),
8372
+ Cs(1, ye(dr)),
8373
+ Cs(2, Ft)
8365
8374
  ], Sn);
8366
8375
  var Eh = Object.getOwnPropertyDescriptor, bh = (i, a, e, t) => {
8367
8376
  for (var r = t > 1 ? void 0 : t ? Eh(a, e) : a, n = i.length - 1, s; n >= 0; n--)
@@ -8462,20 +8471,20 @@ let Ur = class extends Ne {
8462
8471
  }), this._astNodeFactoryList = [];
8463
8472
  }
8464
8473
  parse(a) {
8465
- const e = new Qs(Ut), t = this._parse(a, e);
8474
+ const e = new Gs(Ut), t = this._parse(a, e);
8466
8475
  return a.hasDefinedNames() && (t == null || t.setDefinedNames(a.getDefinedNames())), t;
8467
8476
  }
8468
8477
  _lambdaParameterHandler(a, e) {
8469
8478
  if (e.getLambdaId == null)
8470
8479
  return xe.create(m.VALUE);
8471
- const t = e.getLambdaId(), r = new Qs(Ut), n = this._runtimeService.getFunctionDefinitionPrivacyVar(t);
8480
+ const t = e.getLambdaId(), r = new Gs(Ut), n = this._runtimeService.getFunctionDefinitionPrivacyVar(t);
8472
8481
  if (!n)
8473
8482
  return !1;
8474
8483
  const s = [...n.keys()], o = a.getChildren(), u = o.length;
8475
8484
  for (let c = 0; c < u; c++) {
8476
8485
  const l = o[c];
8477
8486
  if (l instanceof ae) {
8478
- Na(l, t, n), this._parse(l, r);
8487
+ Va(l, t, n), this._parse(l, r);
8479
8488
  const h = r.getChildren()[c];
8480
8489
  h != null && n.set(s[c], h);
8481
8490
  } else
@@ -8647,7 +8656,7 @@ class Oh extends Ne {
8647
8656
  A(this, "_definedNameMap", /* @__PURE__ */ new Map());
8648
8657
  // unitId -> definedName -> treeId
8649
8658
  A(this, "_otherFormulaDataMainData", /* @__PURE__ */ new Set());
8650
- A(this, "_dependencyRTreeCache", new Vs());
8659
+ A(this, "_dependencyRTreeCache", new ps());
8651
8660
  A(this, "_dependencyTreeIdLast", 0);
8652
8661
  }
8653
8662
  buildDependencyTree(e, t) {
@@ -9101,10 +9110,10 @@ class Sh extends Ne {
9101
9110
  return this._otherFormulaData;
9102
9111
  }
9103
9112
  }
9104
- const Ma = et(
9113
+ const Oa = et(
9105
9114
  "univer.formula.other-formula-manager.service"
9106
9115
  );
9107
- var Ws = /* @__PURE__ */ ((i) => (i[i.NORMAL_FORMULA = 0] = "NORMAL_FORMULA", i[i.OTHER_FORMULA = 1] = "OTHER_FORMULA", i[i.FEATURE_FORMULA = 2] = "FEATURE_FORMULA", i))(Ws || {});
9116
+ var Qs = /* @__PURE__ */ ((i) => (i[i.NORMAL_FORMULA = 0] = "NORMAL_FORMULA", i[i.OTHER_FORMULA = 1] = "OTHER_FORMULA", i[i.FEATURE_FORMULA = 2] = "FEATURE_FORMULA", i))(Qs || {});
9108
9117
  class Uo {
9109
9118
  constructor() {
9110
9119
  A(this, "_state", 0);
@@ -9197,7 +9206,7 @@ class Mi extends Uo {
9197
9206
  e.push({
9198
9207
  unitId: r.unitId,
9199
9208
  sheetId: r.sheetId,
9200
- range: ia(r.range, this.refOffsetX, this.refOffsetY)
9209
+ range: aa(r.range, this.refOffsetX, this.refOffsetY)
9201
9210
  });
9202
9211
  }
9203
9212
  return e;
@@ -9244,7 +9253,7 @@ class Mi extends Uo {
9244
9253
  return this.refTree == null ? "" : this.refTree.formulaId;
9245
9254
  }
9246
9255
  }
9247
- class As extends Uo {
9256
+ class _s extends Uo {
9248
9257
  constructor(e) {
9249
9258
  super();
9250
9259
  A(this, "isCache", !1);
@@ -9389,12 +9398,12 @@ var Dh = Object.getOwnPropertyDescriptor, Lh = (i, a, e, t) => {
9389
9398
  function or(i) {
9390
9399
  return i.getLastTreeId() || 0;
9391
9400
  }
9392
- const qs = et("engine-formula.dependency-generator");
9393
- let Ks = class extends Ne {
9401
+ const Ws = et("engine-formula.dependency-generator");
9402
+ let qs = class extends Ne {
9394
9403
  constructor(a, e, t, r, n, s, o, u) {
9395
9404
  super();
9396
9405
  A(this, "_updateRangeFlattenCache", /* @__PURE__ */ new Map());
9397
- A(this, "_dependencyRTreeCacheForAddressFunction", new Vs());
9406
+ A(this, "_dependencyRTreeCacheForAddressFunction", new ps());
9398
9407
  A(this, "_executedAddressFunctionNodeIds", /* @__PURE__ */ new Set());
9399
9408
  this._currentConfigService = a, this._runtimeService = e, this._otherFormulaManagerService = t, this._featureCalculationManagerService = r, this._interpreter = n, this._astTreeBuilder = s, this._lexer = o, this._dependencyManagerService = u;
9400
9409
  }
@@ -9575,10 +9584,10 @@ let Ks = class extends Ne {
9575
9584
  });
9576
9585
  }
9577
9586
  _getFeatureFormulaTree(a, e, t) {
9578
- const { unitId: r, subUnitId: n, dependencyRanges: s, getDirtyData: o } = t, u = e || or(this._dependencyManagerService), c = new As(u);
9587
+ const { unitId: r, subUnitId: n, dependencyRanges: s, getDirtyData: o } = t, u = e || or(this._dependencyManagerService), c = new _s(u);
9579
9588
  c.unitId = r, c.subUnitId = n, c.rangeList = s, c.getDirtyData = o;
9580
9589
  const l = o(this._currentConfigService.getDirtyData(), this._runtimeService.getAllRuntimeData()), f = this._convertDirtyRangesToUnitRange(l.dirtyRanges);
9581
- return c.featureDirtyRanges = f, c.featureId = a, c.type = Ws.FEATURE_FORMULA, this._dependencyManagerService.addFeatureFormulaDependency(r, n, a, c), this._dependencyManagerService.getFeatureFormulaDependency(t.unitId, t.subUnitId, a) && (c.isCache = !0), c;
9590
+ return c.featureDirtyRanges = f, c.featureId = a, c.type = Qs.FEATURE_FORMULA, this._dependencyManagerService.addFeatureFormulaDependency(r, n, a, c), this._dependencyManagerService.getFeatureFormulaDependency(t.unitId, t.subUnitId, a) && (c.isCache = !0), c;
9582
9591
  }
9583
9592
  _registerOtherFormulas(a, e, t) {
9584
9593
  for (const r of e) {
@@ -9595,14 +9604,14 @@ let Ks = class extends Ne {
9595
9604
  const f = this._dependencyManagerService.hasOtherFormulaDataMainData(l), h = u[l], { f: d, ranges: _ } = h;
9596
9605
  let C = !1;
9597
9606
  f && (C = !0);
9598
- const E = pi(r, d, this._lexer, this._astTreeBuilder, this._currentConfigService), { firstRow: b, firstColumn: R } = this._getFirstCellOfRange(_), p = this._dependencyManagerService.getOtherFormulaDependency(r, o, l), N = (p == null ? void 0 : p.getValue(0, 0)) || or(this._dependencyManagerService), M = new As(N);
9607
+ const E = pi(r, d, this._lexer, this._astTreeBuilder, this._currentConfigService), { firstRow: b, firstColumn: R } = this._getFirstCellOfRange(_), p = this._dependencyManagerService.getOtherFormulaDependency(r, o, l), N = (p == null ? void 0 : p.getValue(0, 0)) || or(this._dependencyManagerService), M = new _s(N);
9599
9608
  for (let w = 0; w < _.length; w++) {
9600
9609
  const S = _[w], { startRow: D, startColumn: L, endRow: U, endColumn: x } = S;
9601
9610
  for (let F = D; F <= U; F++)
9602
9611
  for (let W = L; W <= x; W++) {
9603
9612
  const ne = W - R, z = F - b;
9604
9613
  if (ne === 0 && z === 0) {
9605
- M.node = E, M.formula = d, M.unitId = r, M.subUnitId = o, M.formulaId = l, M.type = Ws.OTHER_FORMULA, M.isCache = C, t.push(M), this._dependencyManagerService.addOtherFormulaDependency(r, o, l, M), this._dependencyManagerService.addFormulaDependencyByDefinedName(M);
9614
+ M.node = E, M.formula = d, M.unitId = r, M.subUnitId = o, M.formulaId = l, M.type = Qs.OTHER_FORMULA, M.isCache = C, t.push(M), this._dependencyManagerService.addOtherFormulaDependency(r, o, l, M), this._dependencyManagerService.addFormulaDependencyByDefinedName(M);
9606
9615
  continue;
9607
9616
  }
9608
9617
  const G = new Mi();
@@ -9656,7 +9665,7 @@ let Ks = class extends Ne {
9656
9665
  }
9657
9666
  }
9658
9667
  _createFDtree(a, e, t, r, n, s) {
9659
- const { f: o, x: u = 0, y: c = 0 } = s, l = new As(or(this._dependencyManagerService)), f = n[a][e], h = pi(a, o, this._lexer, this._astTreeBuilder, this._currentConfigService);
9668
+ const { f: o, x: u = 0, y: c = 0 } = s, l = new _s(or(this._dependencyManagerService)), f = n[a][e], h = pi(a, o, this._lexer, this._astTreeBuilder, this._currentConfigService);
9660
9669
  return l.node = h, l.formula = o, l.unitId = a, l.subUnitId = e, l.row = t, l.column = r, l.rowCount = f.rowCount, l.columnCount = f.columnCount, l;
9661
9670
  }
9662
9671
  _createVirtualFDtree(a, e) {
@@ -9752,7 +9761,7 @@ let Ks = class extends Ne {
9752
9761
  u.length !== 0 && await this._calculateAddressFunctionRuntimeData(a, u);
9753
9762
  }
9754
9763
  async _calculateListByFunctionRefNode(a) {
9755
- const e = new Vs();
9764
+ const e = new ps();
9756
9765
  for (let t = 0, r = a.length; t < r; t++) {
9757
9766
  const n = a[t];
9758
9767
  e.insert({
@@ -9980,23 +9989,23 @@ let Ks = class extends Ne {
9980
9989
  return t;
9981
9990
  }
9982
9991
  };
9983
- Ks = Lh([
9992
+ qs = Lh([
9984
9993
  St(0, Ft),
9985
9994
  St(1, Ot),
9986
- St(2, Ma),
9995
+ St(2, Oa),
9987
9996
  St(3, vr),
9988
9997
  St(4, ye(_r)),
9989
9998
  St(5, ye(Ur)),
9990
9999
  St(6, ye(dr)),
9991
10000
  St(7, Xn)
9992
- ], Ks);
10001
+ ], qs);
9993
10002
  var Ph = Object.getOwnPropertyDescriptor, xh = (i, a, e, t) => {
9994
10003
  for (var r = t > 1 ? void 0 : t ? Ph(a, e) : a, n = i.length - 1, s; n >= 0; n--)
9995
10004
  (s = i[n]) && (r = s(r) || r);
9996
10005
  return r;
9997
10006
  }, Qt = (i, a) => (e, t) => a(e, t, i);
9998
- const jh = 500, Xs = et("engine-formula.calculate-formula.service");
9999
- let Zs = class extends Ne {
10007
+ const jh = 500, Ks = et("engine-formula.calculate-formula.service");
10008
+ let Xs = class extends Ne {
10000
10009
  constructor(a, e, t, r, n, s, o) {
10001
10010
  super();
10002
10011
  A(this, "_executionInProgressListener$", new ur());
@@ -10006,7 +10015,7 @@ let Zs = class extends Ne {
10006
10015
  this._configService = a, this._lexer = e, this._currentConfigService = t, this._runtimeService = r, this._formulaDependencyGenerator = n, this._interpreter = s, this._astTreeBuilder = o;
10007
10016
  }
10008
10017
  dispose() {
10009
- super.dispose(), this._executionInProgressListener$.complete(), this._executionCompleteListener$.complete(), yn.clear(), bt.clear(), Us.clear(), Hs.clear();
10018
+ super.dispose(), this._executionInProgressListener$.complete(), this._executionCompleteListener$.complete(), yn.clear(), bt.clear(), js.clear(), Ys.clear();
10010
10019
  }
10011
10020
  /**
10012
10021
  * Stop the execution of the formula.
@@ -10081,7 +10090,7 @@ let Zs = class extends Ne {
10081
10090
  const e = (await this._formulaDependencyGenerator.generate()).reverse(), t = this._interpreter;
10082
10091
  a ? (this._runtimeService.setFormulaExecuteStage(Xe.START_CALCULATION_ARRAY_FORMULA), this._runtimeService.setTotalArrayFormulasToCalculate(e.length)) : (this._runtimeService.setFormulaExecuteStage(Xe.START_CALCULATION), this._runtimeService.setTotalFormulasToCalculate(e.length)), this._executionInProgressListener$.next(this._runtimeService.getRuntimeState());
10083
10092
  let r = [];
10084
- const n = this._configService.getConfig(_a), s = (n == null ? void 0 : n.intervalCount) || jh, o = e.length;
10093
+ const n = this._configService.getConfig(Ca), s = (n == null ? void 0 : n.intervalCount) || jh, o = e.length;
10085
10094
  for (let u = 0; u < o; u++) {
10086
10095
  const c = e[u], l = c.nodeData, f = c.getDirtyData;
10087
10096
  if (u % s === 0 && (await new Promise((d) => {
@@ -10117,20 +10126,20 @@ let Zs = class extends Ne {
10117
10126
  r == null || r.serialize();
10118
10127
  }
10119
10128
  };
10120
- Zs = xh([
10121
- Qt(0, oa),
10129
+ Xs = xh([
10130
+ Qt(0, ia),
10122
10131
  Qt(1, ye(dr)),
10123
10132
  Qt(2, Ft),
10124
10133
  Qt(3, Ot),
10125
- Qt(4, qs),
10134
+ Qt(4, Ws),
10126
10135
  Qt(5, ye(_r)),
10127
10136
  Qt(6, ye(Ur))
10128
- ], Zs);
10137
+ ], Xs);
10129
10138
  var Uh = Object.getOwnPropertyDescriptor, vh = (i, a, e, t) => {
10130
10139
  for (var r = t > 1 ? void 0 : t ? Uh(a, e) : a, n = i.length - 1, s; n >= 0; n--)
10131
10140
  (s = i[n]) && (r = s(r) || r);
10132
10141
  return r;
10133
- }, Es = (i, a) => (e, t) => a(e, t, i);
10142
+ }, As = (i, a) => (e, t) => a(e, t, i);
10134
10143
  let Ln = class extends Ne {
10135
10144
  constructor(i, a, e) {
10136
10145
  super(), this._commandService = i, this._calculateFormulaService = a, this._formulaDataModel = e, this._initialize();
@@ -10146,7 +10155,7 @@ let Ln = class extends Ne {
10146
10155
  else if (i.id === so.id) {
10147
10156
  const a = i.params;
10148
10157
  this._calculate(a);
10149
- } else if (i.id === Os.id) {
10158
+ } else if (i.id === Ns.id) {
10150
10159
  const a = i.params;
10151
10160
  if (a == null)
10152
10161
  return;
@@ -10216,7 +10225,7 @@ let Ln = class extends Ne {
10216
10225
  return;
10217
10226
  }
10218
10227
  t && (this._formulaDataModel.clearPreviousArrayFormulaCellData(n), this._formulaDataModel.mergeArrayFormulaCellData(r), this._formulaDataModel.mergeArrayFormulaRange(t), this._commandService.executeCommand(
10219
- Os.id,
10228
+ Ns.id,
10220
10229
  {
10221
10230
  arrayFormulaRange: this._formulaDataModel.getArrayFormulaRange(),
10222
10231
  arrayFormulaCellData: this._formulaDataModel.getArrayFormulaCellData()
@@ -10237,9 +10246,9 @@ let Ln = class extends Ne {
10237
10246
  }
10238
10247
  };
10239
10248
  Ln = vh([
10240
- Es(0, sr),
10241
- Es(1, Xs),
10242
- Es(2, ye(gr))
10249
+ As(0, sr),
10250
+ As(1, Ks),
10251
+ As(2, ye(gr))
10243
10252
  ], Ln);
10244
10253
  const wi = /[\[\]]/g;
10245
10254
  function Si(i, a) {
@@ -10249,7 +10258,7 @@ function Si(i, a) {
10249
10258
  }
10250
10259
  return Number(i) - 1;
10251
10260
  }
10252
- function bs(i, a = 0, e = 0) {
10261
+ function Es(i, a = 0, e = 0) {
10253
10262
  i = i.toLocaleUpperCase();
10254
10263
  const t = i.split(/[RC]/), r = t[1], n = t[2], s = Si(r, a), o = Si(n, e);
10255
10264
  return {
@@ -10259,9 +10268,9 @@ function bs(i, a = 0, e = 0) {
10259
10268
  };
10260
10269
  }
10261
10270
  function Th(i, a = 0, e = 0) {
10262
- const { refBody: t, sheetName: r, unitId: n } = ca(i), s = t.indexOf(":");
10271
+ const { refBody: t, sheetName: r, unitId: n } = ua(i), s = t.indexOf(":");
10263
10272
  if (s === -1) {
10264
- const C = bs(t, a, e), E = C.row, b = C.column, R = C.absoluteRefType;
10273
+ const C = Es(t, a, e), E = C.row, b = C.column, R = C.absoluteRefType;
10265
10274
  return {
10266
10275
  unitId: n,
10267
10276
  sheetName: r,
@@ -10275,7 +10284,7 @@ function Th(i, a = 0, e = 0) {
10275
10284
  }
10276
10285
  };
10277
10286
  }
10278
- const o = t.substring(0, s), u = t.substring(s + 1), c = bs(o, a, e), l = bs(u, a, e), f = c.row, h = c.column, d = l.row, _ = l.column;
10287
+ const o = t.substring(0, s), u = t.substring(s + 1), c = Es(o, a, e), l = Es(u, a, e), f = c.row, h = c.column, d = l.row, _ = l.column;
10279
10288
  return {
10280
10289
  unitId: n,
10281
10290
  sheetName: r,
@@ -10661,13 +10670,13 @@ class V {
10661
10670
  return a;
10662
10671
  }
10663
10672
  createReferenceObject(a, e) {
10664
- const t = a.getForcedUnitId(), r = a.getForcedSheetId() || "", n = a.getForcedSheetName(), o = Ms({
10673
+ const t = a.getForcedUnitId(), r = a.getForcedSheetId() || "", n = a.getForcedSheetName(), o = Os({
10665
10674
  unitId: t,
10666
10675
  sheetName: n,
10667
10676
  range: e
10668
10677
  });
10669
10678
  let u;
10670
- return Br(o) ? u = new ya(o) : Ji(o) ? u = new pa(o) : eo(o) ? u = new Ra(o) : u = new Rn(e, r, t), this._setReferenceDefault(a, u);
10679
+ return Br(o) ? u = new ba(o) : Ji(o) ? u = new Ra(o) : eo(o) ? u = new ya(o) : u = new Rn(e, r, t), this._setReferenceDefault(a, u);
10671
10680
  }
10672
10681
  _setReferenceDefault(a, e) {
10673
10682
  return this.unitId == null || this.subUnitId == null ? g.create(m.REF) : (e.setDefaultUnitId(this.unitId), e.setDefaultSheetId(this.subUnitId), e.setUnitData(a.getUnitData()), e.setRuntimeData(a.getRuntimeData()), e.setArrayFormulaCellData(a.getArrayFormulaCellData()), e.setRuntimeArrayFormulaCellData(a.getRuntimeArrayFormulaCellData()), e);
@@ -10727,10 +10736,10 @@ class Fh extends V {
10727
10736
  });
10728
10737
  }
10729
10738
  }
10730
- var zs = /* @__PURE__ */ ((i) => (i.ARRAY_CONSTRAIN = "ARRAY_CONSTRAIN", i.FLATTEN = "FLATTEN", i))(zs || {});
10739
+ var Zs = /* @__PURE__ */ ((i) => (i.ARRAY_CONSTRAIN = "ARRAY_CONSTRAIN", i.FLATTEN = "FLATTEN", i))(Zs || {});
10731
10740
  const kh = [
10732
- [Ih, zs.ARRAY_CONSTRAIN],
10733
- [Fh, zs.FLATTEN]
10741
+ [Ih, Zs.ARRAY_CONSTRAIN],
10742
+ [Fh, Zs.FLATTEN]
10734
10743
  ];
10735
10744
  var Ar;
10736
10745
  ((i) => {
@@ -10872,13 +10881,13 @@ var Ar;
10872
10881
  return r(o, l, 2, 1);
10873
10882
  })();
10874
10883
  })(Ar || (Ar = {}));
10875
- function wa(i) {
10884
+ function Ma(i) {
10876
10885
  return /^[01]{1,10}$/.test(i);
10877
10886
  }
10878
- function Sa(i) {
10887
+ function wa(i) {
10879
10888
  return /^[0-7]{1,10}$/.test(i);
10880
10889
  }
10881
- function Da(i) {
10890
+ function Sa(i) {
10882
10891
  return /^[0-9A-Fa-f]{1,10}$/.test(i);
10883
10892
  }
10884
10893
  function Zt(i) {
@@ -10924,7 +10933,7 @@ function Zt(i) {
10924
10933
  const c = r * Math.exp(-e * e + 0.5 * (a[0] + n * s) - o);
10925
10934
  return t ? c - 1 : 1 - c;
10926
10935
  }
10927
- function La(i) {
10936
+ function Da(i) {
10928
10937
  return 1 - Zt(i);
10929
10938
  }
10930
10939
  function $h(i) {
@@ -10935,7 +10944,7 @@ function $h(i) {
10935
10944
  const a = i < 1 ? i : 2 - i, e = Math.sqrt(-2 * Math.log(a / 2));
10936
10945
  let t = -0.70711 * ((2.30753 + e * 0.27061) / (1 + e * (0.99229 + e * 0.04481)) - e);
10937
10946
  for (let r = 0; r < 2; r++) {
10938
- const n = La(t) - a;
10947
+ const n = Da(t) - a;
10939
10948
  t += n / (1.1283791670955126 * Math.exp(-t * t) - t * n);
10940
10949
  }
10941
10950
  return i < 1 ? t : -t;
@@ -10956,7 +10965,7 @@ function zt(i, a) {
10956
10965
  t *= i - r + 1, t /= r;
10957
10966
  return t;
10958
10967
  }
10959
- function Js(i, a) {
10968
+ function zs(i, a) {
10960
10969
  let e = Math.floor(i), t = Math.floor(a);
10961
10970
  for (; t !== 0; ) {
10962
10971
  const r = t;
@@ -10965,33 +10974,36 @@ function Js(i, a) {
10965
10974
  return e;
10966
10975
  }
10967
10976
  function Di(i, a) {
10968
- const e = Js(i, a);
10977
+ const e = zs(i, a);
10969
10978
  return e === 0 ? 0 : Math.abs(i * a) / e;
10970
10979
  }
10971
- function Zn(i) {
10980
+ function La(i) {
10972
10981
  const a = i.length;
10973
10982
  if (a === 1)
10974
10983
  return i[0][0];
10975
10984
  if (a === 2)
10976
10985
  return i[0][0] * i[1][1] - i[0][1] * i[1][0];
10977
- let e = 0;
10978
- for (let t = 0; t < a; t++)
10979
- e += (t % 2 === 0 ? 1 : -1) * i[0][t] * Zn(vo(i, 0, t));
10980
- return e;
10986
+ const { rowSwap: e, smallPivotDetected: t, luMatrix: r, permutation: n } = vo(i);
10987
+ if (t)
10988
+ return 0;
10989
+ let s = e ? 1 : -1;
10990
+ for (let o = 0; o < n.length; o++)
10991
+ s *= r[o][o];
10992
+ return s === 0 ? 0 : s;
10981
10993
  }
10982
10994
  function Yh(i) {
10983
- const a = Zn(i);
10984
- return a === 0 ? null : i.length === 1 ? [[1 / a]] : Hh(i).map((r) => r.map((n) => n / a));
10995
+ const a = La(i);
10996
+ return a === 0 ? null : i.length === 1 ? [[1 / a]] : Gh(i).map((r) => r.map((n) => n / a));
10985
10997
  }
10986
- function vo(i, a, e) {
10998
+ function Hh(i, a, e) {
10987
10999
  return i.filter((t, r) => r !== a).map((t) => t.filter((r, n) => n !== e));
10988
11000
  }
10989
- function Hh(i) {
11001
+ function Gh(i) {
10990
11002
  const a = i.length, e = Array.from({ length: a }, () => new Array(a).fill(0));
10991
11003
  for (let t = 0; t < a; t++)
10992
11004
  for (let r = 0; r < a; r++) {
10993
- const n = (t + r) % 2 === 0 ? 1 : -1;
10994
- e[r][t] = n * Zn(vo(i, t, r));
11005
+ const s = ((t + r) % 2 === 0 ? 1 : -1) * La(Hh(i, t, r));
11006
+ e[r][t] = s === 0 ? 0 : s;
10995
11007
  }
10996
11008
  return e;
10997
11009
  }
@@ -11003,14 +11015,14 @@ function lr(i, a) {
11003
11015
  function mt(i) {
11004
11016
  return i[0].map((a, e) => i.map((t) => t[e]));
11005
11017
  }
11006
- function Gh(i) {
11007
- const { smallPivotDetected: a, luMatrix: e, permutation: t } = Qh(i);
11018
+ function Qh(i) {
11019
+ const { smallPivotDetected: a, luMatrix: e, permutation: t } = vo(i);
11008
11020
  return a ? null : Wh(e, t);
11009
11021
  }
11010
- function Qh(i) {
11022
+ function vo(i) {
11011
11023
  const a = mt(i), e = a.length, t = a[0].length;
11012
11024
  let r = !0, n = !1;
11013
- const s = ea(e, t, 0), o = new Array(t).fill(0).map((u, c) => c);
11025
+ const s = Js(e, t, 0), o = new Array(t).fill(0).map((u, c) => c);
11014
11026
  for (let u = 0; u < t; u++) {
11015
11027
  for (let h = 0; h < u; h++) {
11016
11028
  let d = a[h][u];
@@ -11044,10 +11056,10 @@ function Qh(i) {
11044
11056
  };
11045
11057
  }
11046
11058
  function Wh(i, a) {
11047
- const e = a.length, t = ea(e, e, 0);
11059
+ const e = a.length, t = Js(e, e, 0);
11048
11060
  for (let n = 0; n < e; n++)
11049
11061
  t[n][n] = 1;
11050
- const r = ea(e, e, 0);
11062
+ const r = Js(e, e, 0);
11051
11063
  for (let n = 0; n < e; n++) {
11052
11064
  const s = a[n];
11053
11065
  for (let o = 0; o < e; o++)
@@ -11073,7 +11085,7 @@ function Wh(i, a) {
11073
11085
  }
11074
11086
  return r;
11075
11087
  }
11076
- function ea(i, a, e) {
11088
+ function Js(i, a, e) {
11077
11089
  const t = [];
11078
11090
  for (let r = 0; r < i; r++) {
11079
11091
  t[r] = [];
@@ -11098,14 +11110,14 @@ function Kh(i) {
11098
11110
  const r = new Array(t).fill(0), n = new Array(t).fill(0), s = Array.from({ length: t }, () => new Array(t).fill(0));
11099
11111
  let o = Number.EPSILON, u = 0, c = 0, l = 0;
11100
11112
  for (let C = 0; C < t; C++) {
11101
- if (r[C] = u, c = ys(a, C, e, C, C), c <= 1e-64 / o)
11113
+ if (r[C] = u, c = bs(a, C, e, C, C), c <= 1e-64 / o)
11102
11114
  u = 0;
11103
11115
  else {
11104
11116
  u = Math.sqrt(c), a[C][C] >= 0 && (u = -u);
11105
11117
  const b = a[C][C] * u - c;
11106
11118
  a[C][C] -= u;
11107
11119
  for (let R = C + 1; R < t; R++) {
11108
- c = ys(a, C, e, C, R);
11120
+ c = bs(a, C, e, C, R);
11109
11121
  for (let p = C; p < e; p++)
11110
11122
  a[p][R] += c / b * a[p][C];
11111
11123
  }
@@ -11150,7 +11162,7 @@ function Kh(i) {
11150
11162
  a[C][E] = 0;
11151
11163
  if (u !== 0) {
11152
11164
  for (let E = C + 1; E < t; E++) {
11153
- c = ys(a, C + 1, e, C, E);
11165
+ c = bs(a, C + 1, e, C, E);
11154
11166
  for (let b = C; b < e; b++)
11155
11167
  a[b][E] += c / (a[C][C] * u) * a[b][C];
11156
11168
  }
@@ -11239,7 +11251,7 @@ function zr(i, a) {
11239
11251
  let e = 0;
11240
11252
  return Math.abs(i) > Math.abs(a) ? (e = a / i, Math.abs(i) * Math.sqrt(1 + e * e)) : a !== 0 ? (e = i / a, Math.abs(a) * Math.sqrt(1 + e * e)) : 0;
11241
11253
  }
11242
- function ys(i, a, e, t, r) {
11254
+ function bs(i, a, e, t, r) {
11243
11255
  let n = 0;
11244
11256
  for (let s = a; s < e; s++)
11245
11257
  n += i[s][t] * i[s][r];
@@ -11293,7 +11305,7 @@ const Jr = /* @__PURE__ */ new Map([
11293
11305
  [1, 4, 5, 9, 10, 40, 45, 49, 50, 90, 95, 99, 100, 400, 450, 490, 495, 499, 500, 900, 950, 990, 995, 999, 1e3, 4e3]
11294
11306
  ];
11295
11307
  function To(i, a, e) {
11296
- return i <= 0 ? 0 : i >= 1 ? 1 : zn(i, a, e);
11308
+ return i <= 0 ? 0 : i >= 1 ? 1 : Zn(i, a, e);
11297
11309
  }
11298
11310
  function zh(i, a, e) {
11299
11311
  return i <= 0 || i >= 1 ? 0 : a === 1 && e === 1 ? 1 : a < 512 && e < 512 ? i ** (a - 1) * (1 - i) ** (e - 1) / xa(a, e) : Math.exp((a - 1) * Math.log(i) + (e - 1) * Math.log(1 - i) - ja(a, e));
@@ -11319,12 +11331,12 @@ function Pa(i, a, e) {
11319
11331
  for (let c = 0; c < 10; c++) {
11320
11332
  if (r === 0 || r === 1)
11321
11333
  return r;
11322
- if (s = zn(r, a, e) - i, o = Math.exp((a - 1) * Math.log(r) + (e - 1) * Math.log(1 - r) + n), u = s / o, r -= o = u / (1 - 0.5 * Math.min(1, u * ((a - 1) / r - (e - 1) / (1 - r)))), r <= 0 && (r = 0.5 * (r + o)), r >= 1 && (r = 0.5 * (r + o + 1)), Math.abs(o) < t * r && c > 0)
11334
+ if (s = Zn(r, a, e) - i, o = Math.exp((a - 1) * Math.log(r) + (e - 1) * Math.log(1 - r) + n), u = s / o, r -= o = u / (1 - 0.5 * Math.min(1, u * ((a - 1) / r - (e - 1) / (1 - r)))), r <= 0 && (r = 0.5 * (r + o)), r >= 1 && (r = 0.5 * (r + o + 1)), Math.abs(o) < t * r && c > 0)
11323
11335
  break;
11324
11336
  }
11325
11337
  return r;
11326
11338
  }
11327
- function zn(i, a, e) {
11339
+ function Zn(i, a, e) {
11328
11340
  const t = i === 0 || i === 1 ? 0 : Math.exp(ft(a + e) - ft(a) - ft(e) + a * Math.log(i) + e * Math.log(1 - i));
11329
11341
  return i < (a + 1) / (a + e + 2) ? t * Pi(i, a, e) / a : 1 - t * Pi(1 - i, e, a) / e;
11330
11342
  }
@@ -11370,7 +11382,7 @@ function Io(i, a) {
11370
11382
  return i <= 0 ? 0 : i >= 1 ? 1 / 0 : 2 * $o(i, a / 2);
11371
11383
  }
11372
11384
  function Ta(i, a, e) {
11373
- return i < 0 ? 0 : zn(a * i / (a * i + e), a / 2, e / 2);
11385
+ return i < 0 ? 0 : Zn(a * i / (a * i + e), a / 2, e / 2);
11374
11386
  }
11375
11387
  function em(i, a, e) {
11376
11388
  if (i < 0)
@@ -11538,7 +11550,7 @@ function om(i, a, e) {
11538
11550
  return i <= 0 ? 0 : Math.exp(-Math.log(i) - 0.5 * Math.log(2 * Math.PI) - Math.log(e) - (Math.log(i) - a) ** 2 / (2 * e * e));
11539
11551
  }
11540
11552
  function um(i, a, e) {
11541
- return Math.exp(Jn(i, a, e));
11553
+ return Math.exp(zn(i, a, e));
11542
11554
  }
11543
11555
  function cm(i, a, e) {
11544
11556
  if (i < 0)
@@ -11557,7 +11569,7 @@ function Yr(i, a, e) {
11557
11569
  function Ho(i, a, e) {
11558
11570
  return Math.exp(-0.5 * Math.log(2 * Math.PI) - Math.log(e) - (i - a) ** 2 / (2 * e * e));
11559
11571
  }
11560
- function Jn(i, a, e) {
11572
+ function zn(i, a, e) {
11561
11573
  return -1.4142135623730951 * e * $h(2 * i) + a;
11562
11574
  }
11563
11575
  function lm(i, a) {
@@ -11570,14 +11582,14 @@ function Go(i, a) {
11570
11582
  return Math.exp(-a) * a ** i / cr(i);
11571
11583
  }
11572
11584
  function Hr(i, a) {
11573
- const e = 0.5 * zn(a / (i ** 2 + a), a / 2, 0.5);
11585
+ const e = 0.5 * Zn(a / (i ** 2 + a), a / 2, 0.5);
11574
11586
  return i < 0 ? e : 1 - e;
11575
11587
  }
11576
11588
  function fm(i, a) {
11577
11589
  const e = (1 + i ** 2 / a) ** (-(a + 1) / 2);
11578
11590
  return 1 / (Math.sqrt(a) * xa(0.5, a / 2)) * e;
11579
11591
  }
11580
- function es(i, a) {
11592
+ function Jn(i, a) {
11581
11593
  let e = Pa(2 * Math.min(i, 1 - i), 0.5 * a, 0.5);
11582
11594
  return e = Math.sqrt(a * (1 - e) / e), i > 0.5 ? e : -e;
11583
11595
  }
@@ -11615,7 +11627,7 @@ function tt(i, a, e, t, r) {
11615
11627
  noCalculate: o
11616
11628
  };
11617
11629
  }
11618
- function ts(i, a, e) {
11630
+ function es(i, a, e) {
11619
11631
  const t = i.isArray() ? i.getRowCount() : 1, r = i.isArray() ? i.getColumnCount() : 1;
11620
11632
  let n = t, s = r;
11621
11633
  if (a && !a.isNull() && (n = a.isArray() ? a.getRowCount() : 1, s = a.isArray() ? a.getColumnCount() : 1, t === 1 && s !== r || r === 1 && n !== t || t !== 1 && r !== 1 && (n !== t || s !== r)))
@@ -11649,7 +11661,7 @@ function dt(i) {
11649
11661
  }
11650
11662
  return t;
11651
11663
  }
11652
- function rs(i, a) {
11664
+ function ts(i, a) {
11653
11665
  const e = [];
11654
11666
  let t = 1;
11655
11667
  for (let r = 0; r < i; r++) {
@@ -11659,7 +11671,7 @@ function rs(i, a) {
11659
11671
  }
11660
11672
  return e;
11661
11673
  }
11662
- function ns(i, a, e, t) {
11674
+ function rs(i, a, e, t) {
11663
11675
  let r = a;
11664
11676
  t && (r = a.map((o) => Math.log(o)));
11665
11677
  let n, s;
@@ -11721,14 +11733,14 @@ function mm(i, a) {
11721
11733
  intercept: 0
11722
11734
  };
11723
11735
  }
11724
- function ss(i, a, e, t, r) {
11736
+ function ns(i, a, e, t, r) {
11725
11737
  const n = i.length === 1 && i[0].length > 1;
11726
11738
  let s = i;
11727
11739
  r && (s = i.map((C) => C.map((E) => Math.log(E))));
11728
11740
  let o = a, u = e;
11729
11741
  n && (s = mt(s), o = mt(o), u = mt(u)), t && (o = o.map((C) => [...C, 1]));
11730
11742
  const c = mt(o), l = lr(c, o), f = lr(c, s);
11731
- let h = Gh(l);
11743
+ let h = Qh(l);
11732
11744
  if (!h && (h = qh(l), !h))
11733
11745
  return g.create(m.NA);
11734
11746
  let d = lr(h, f);
@@ -11996,7 +12008,7 @@ class zo extends V {
11996
12008
  const [p, N, M] = R, w = +p.getValue(), S = +N.getValue(), D = Math.floor(+M.getValue());
11997
12009
  if (w <= 0 || w >= 1 || S <= 0 || D < 1)
11998
12010
  return g.create(m.NUM);
11999
- const L = Math.abs(Jn(w / 2, 0, 1) * S / Math.sqrt(D));
12011
+ const L = Math.abs(zn(w / 2, 0, 1) * S / Math.sqrt(D));
12000
12012
  return y.create(L);
12001
12013
  });
12002
12014
  return n === 1 && s === 1 ? l.get(0, 0) : l;
@@ -12434,7 +12446,7 @@ class cu extends V {
12434
12446
  const [u, c, l] = o, f = +u.getValue(), h = +c.getValue(), d = +l.getValue();
12435
12447
  if (f <= 0 || f >= 1 || d <= 0)
12436
12448
  return g.create(m.NUM);
12437
- const _ = Jn(f, h, d);
12449
+ const _ = zn(f, h, d);
12438
12450
  return y.create(_);
12439
12451
  }
12440
12452
  }
@@ -12458,7 +12470,7 @@ class lu extends V {
12458
12470
  const [s] = n, o = +s.getValue();
12459
12471
  if (o <= 0 || o >= 1)
12460
12472
  return g.create(m.NUM);
12461
- const u = Jn(o, 0, 1);
12473
+ const u = zn(o, 0, 1);
12462
12474
  return y.create(u);
12463
12475
  }
12464
12476
  }
@@ -12683,7 +12695,7 @@ class _u extends V {
12683
12695
  const [o, u] = s, c = +o.getValue(), l = Math.floor(+u.getValue());
12684
12696
  if (c <= 0 || c > 1 || l < 1 || l > 10 ** 10)
12685
12697
  return g.create(m.NUM);
12686
- const f = Math.abs(es(c / 2, l));
12698
+ const f = Math.abs(Jn(c / 2, l));
12687
12699
  return Number.isNaN(f) || !Number.isFinite(f) ? g.create(m.NUM) : y.create(f);
12688
12700
  }
12689
12701
  }
@@ -13451,7 +13463,7 @@ function at(i, a, e) {
13451
13463
  u = !1;
13452
13464
  break;
13453
13465
  }
13454
- const [d, _] = Va(`${l}`);
13466
+ const [d, _] = pa(`${l}`);
13455
13467
  if (!Vt.create(`${h}`).compare(_, d).getValue()) {
13456
13468
  u = !1;
13457
13469
  break;
@@ -13827,13 +13839,13 @@ function Ya(i) {
13827
13839
  const r = t.getFullYear(), n = (t.getMonth() + 1).toString().padStart(2, "0"), s = t.getDate().toString().padStart(2, "0"), o = `${r}-${n}-${s}`;
13828
13840
  return i.replace(/\//g, "-").split("-").map((c) => c.padStart(2, "0")).join("-") === o;
13829
13841
  }
13830
- function ta(i) {
13842
+ function ea(i) {
13831
13843
  return gt.parseDate(i);
13832
13844
  }
13833
13845
  function pu(i) {
13834
13846
  return gt.parseValue(i);
13835
13847
  }
13836
- function ra(i) {
13848
+ function ta(i) {
13837
13849
  return gt.parseTime(i);
13838
13850
  }
13839
13851
  function Ha(i) {
@@ -13922,10 +13934,10 @@ function k(i) {
13922
13934
  const a = i.getValue();
13923
13935
  if (i.isString()) {
13924
13936
  let e;
13925
- if (ta(`${a}`))
13937
+ if (ea(`${a}`))
13938
+ e = ea(`${a}`).v;
13939
+ else if (ta(`${a}`))
13926
13940
  e = ta(`${a}`).v;
13927
- else if (ra(`${a}`))
13928
- e = ra(`${a}`).v;
13929
13941
  else if (Q(a))
13930
13942
  e = +a;
13931
13943
  else
@@ -14014,7 +14026,7 @@ const Gm = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Qm = [31, 28, 31, 3
14014
14026
  function Qr(i, a) {
14015
14027
  return Ym(i) ? Gm[a] : Qm[a];
14016
14028
  }
14017
- function as(i) {
14029
+ function ss(i) {
14018
14030
  return Hm(i) ? 366 : 365;
14019
14031
  }
14020
14032
  function Ou(i, a) {
@@ -14024,7 +14036,7 @@ function Ou(i, a) {
14024
14036
  case 4:
14025
14037
  return 360;
14026
14038
  case 1:
14027
- return as(re(i).getUTCFullYear());
14039
+ return ss(re(i).getUTCFullYear());
14028
14040
  case 3:
14029
14041
  return 365;
14030
14042
  default:
@@ -15192,7 +15204,7 @@ class Ng extends V {
15192
15204
  if (t)
15193
15205
  return r;
15194
15206
  const [s] = n, o = `${s.getValue()}`;
15195
- if (!wa(o))
15207
+ if (!Ma(o))
15196
15208
  return g.create(m.NUM);
15197
15209
  let u;
15198
15210
  return o.length === 10 && o.substring(0, 1) === "1" ? u = Number.parseInt(o.substring(1), 2) - 512 : u = Number.parseInt(o, 2), y.create(u);
@@ -15222,7 +15234,7 @@ class Og extends V {
15222
15234
  if (n)
15223
15235
  return s;
15224
15236
  const [u] = o, c = `${u.getValue()}`;
15225
- if (!wa(c))
15237
+ if (!Ma(c))
15226
15238
  return g.create(m.NUM);
15227
15239
  let l;
15228
15240
  if (c.length === 10 && c.substring(0, 1) === "1")
@@ -15259,7 +15271,7 @@ class Mg extends V {
15259
15271
  if (n)
15260
15272
  return s;
15261
15273
  const [u] = o, c = `${u.getValue()}`;
15262
- if (!wa(c))
15274
+ if (!Ma(c))
15263
15275
  return g.create(m.NUM);
15264
15276
  let l;
15265
15277
  if (c.length === 10 && c.substring(0, 1) === "1")
@@ -16275,7 +16287,7 @@ class kg extends V {
16275
16287
  const [s] = n, o = +s.getValue();
16276
16288
  if (Number.isNaN(o))
16277
16289
  return g.create(m.VALUE);
16278
- const u = La(o);
16290
+ const u = Da(o);
16279
16291
  return y.create(u);
16280
16292
  }
16281
16293
  }
@@ -16292,7 +16304,7 @@ class $g extends V {
16292
16304
  const [s] = n, o = +s.getValue();
16293
16305
  if (Number.isNaN(o))
16294
16306
  return g.create(m.VALUE);
16295
- const u = La(o);
16307
+ const u = Da(o);
16296
16308
  return y.create(u);
16297
16309
  }
16298
16310
  }
@@ -16340,7 +16352,7 @@ class Hg extends V {
16340
16352
  if (n)
16341
16353
  return s;
16342
16354
  const [u] = o, c = `${u.getValue()}`;
16343
- if (!Da(c))
16355
+ if (!Sa(c))
16344
16356
  return g.create(m.NUM);
16345
16357
  const l = c.length === 10 && c.substring(0, 1).toLocaleUpperCase() === "F", f = l ? Number.parseInt(c, 16) - 1099511627776 : Number.parseInt(c, 16);
16346
16358
  if (f < -512 || f > 511)
@@ -16368,7 +16380,7 @@ class Gg extends V {
16368
16380
  if (t)
16369
16381
  return r;
16370
16382
  const [s] = n, o = `${s.getValue()}`;
16371
- if (!Da(o))
16383
+ if (!Sa(o))
16372
16384
  return g.create(m.NUM);
16373
16385
  let u = Number.parseInt(o, 16);
16374
16386
  return u >= 549755813888 && (u -= 1099511627776), y.create(u);
@@ -16398,7 +16410,7 @@ class Qg extends V {
16398
16410
  if (n)
16399
16411
  return s;
16400
16412
  const [u] = o, c = `${u.getValue()}`;
16401
- if (!Da(c))
16413
+ if (!Sa(c))
16402
16414
  return g.create(m.NUM);
16403
16415
  const l = Number.parseInt(c, 16);
16404
16416
  if (l > 536870911 && l < 1098974756864)
@@ -16998,7 +17010,7 @@ class y1 extends V {
16998
17010
  if (n)
16999
17011
  return s;
17000
17012
  const [u] = o, c = `${u.getValue()}`;
17001
- if (!Sa(c))
17013
+ if (!wa(c))
17002
17014
  return g.create(m.NUM);
17003
17015
  const l = c.length === 10 && c.substring(0, 1) === "7", f = l ? Number.parseInt(c, 8) - 1073741824 : Number.parseInt(c, 8);
17004
17016
  if (f < -512 || f > 511)
@@ -17026,7 +17038,7 @@ class R1 extends V {
17026
17038
  if (t)
17027
17039
  return r;
17028
17040
  const [s] = n, o = `${s.getValue()}`;
17029
- if (!Sa(o))
17041
+ if (!wa(o))
17030
17042
  return g.create(m.NUM);
17031
17043
  let u = Number.parseInt(o, 8);
17032
17044
  return u >= 536870912 && (u -= 1073741824), y.create(u);
@@ -17056,7 +17068,7 @@ class p1 extends V {
17056
17068
  if (n)
17057
17069
  return s;
17058
17070
  const [u] = o, c = `${u.getValue()}`;
17059
- if (!Sa(c))
17071
+ if (!wa(c))
17060
17072
  return g.create(m.NUM);
17061
17073
  const l = Number.parseInt(c, 8);
17062
17074
  let f;
@@ -17130,7 +17142,7 @@ const V1 = [
17130
17142
  [p1, Z.OCT2HEX]
17131
17143
  ];
17132
17144
  var ee = /* @__PURE__ */ ((i) => (i.ACCRINT = "ACCRINT", i.ACCRINTM = "ACCRINTM", i.AMORDEGRC = "AMORDEGRC", i.AMORLINC = "AMORLINC", i.COUPDAYBS = "COUPDAYBS", i.COUPDAYS = "COUPDAYS", i.COUPDAYSNC = "COUPDAYSNC", i.COUPNCD = "COUPNCD", i.COUPNUM = "COUPNUM", i.COUPPCD = "COUPPCD", i.CUMIPMT = "CUMIPMT", i.CUMPRINC = "CUMPRINC", i.DB = "DB", i.DDB = "DDB", i.DISC = "DISC", i.DOLLARDE = "DOLLARDE", i.DOLLARFR = "DOLLARFR", i.DURATION = "DURATION", i.EFFECT = "EFFECT", i.FV = "FV", i.FVSCHEDULE = "FVSCHEDULE", i.INTRATE = "INTRATE", i.IPMT = "IPMT", i.IRR = "IRR", i.ISPMT = "ISPMT", i.MDURATION = "MDURATION", i.MIRR = "MIRR", i.NOMINAL = "NOMINAL", i.NPER = "NPER", i.NPV = "NPV", i.ODDFPRICE = "ODDFPRICE", i.ODDFYIELD = "ODDFYIELD", i.ODDLPRICE = "ODDLPRICE", i.ODDLYIELD = "ODDLYIELD", i.PDURATION = "PDURATION", i.PMT = "PMT", i.PPMT = "PPMT", i.PRICE = "PRICE", i.PRICEDISC = "PRICEDISC", i.PRICEMAT = "PRICEMAT", i.PV = "PV", i.RATE = "RATE", i.RECEIVED = "RECEIVED", i.RRI = "RRI", i.SLN = "SLN", i.SYD = "SYD", i.TBILLEQ = "TBILLEQ", i.TBILLPRICE = "TBILLPRICE", i.TBILLYIELD = "TBILLYIELD", i.VDB = "VDB", i.XIRR = "XIRR", i.XNPV = "XNPV", i.YIELD = "YIELD", i.YIELDDISC = "YIELDDISC", i.YIELDMAT = "YIELDMAT", i))(ee || {});
17133
- function is(i, a, e, t) {
17145
+ function as(i, a, e, t) {
17134
17146
  const r = It(i, a, e), { days: n } = _e(r, i, t);
17135
17147
  return n;
17136
17148
  }
@@ -17168,7 +17180,7 @@ function It(i, a, e) {
17168
17180
  return Re(r);
17169
17181
  }
17170
17182
  function wu(i, a, e, t, r, n) {
17171
- const s = is(i, a, r, n), o = qe(i, a, r, n), u = rr(i, a, r), c = (o - s) / o - 1, l = t / r + 1, f = e * 100 / r;
17183
+ const s = as(i, a, r, n), o = qe(i, a, r, n), u = rr(i, a, r), c = (o - s) / o - 1, l = t / r + 1, f = e * 100 / r;
17172
17184
  let h = 0, d = 0;
17173
17185
  for (let E = 1; E <= u; E++) {
17174
17186
  const b = E + c, R = f / l ** b;
@@ -17333,7 +17345,7 @@ function w1(i, a) {
17333
17345
  return C;
17334
17346
  }
17335
17347
  function hn(i, a, e, t, r, n, s) {
17336
- const o = rr(i, a, n), u = qe(i, a, n, s), c = is(i, a, n, s);
17348
+ const o = rr(i, a, n), u = qe(i, a, n, s), c = as(i, a, n, s);
17337
17349
  if (o === 1) {
17338
17350
  const h = u - c, d = 100 * e / n + r, _ = t / n * h / u + 1, C = 100 * e / n * c / u;
17339
17351
  return d / _ - C;
@@ -17344,7 +17356,7 @@ function hn(i, a, e, t, r, n, s) {
17344
17356
  f += 100 * e / n / (1 + t / n) ** (h - 1 + l / u);
17345
17357
  return f -= 100 * e / n * c / u, f;
17346
17358
  }
17347
- function na(i, a, e, t, r) {
17359
+ function ra(i, a, e, t, r) {
17348
17360
  let n = 0, s = r / e;
17349
17361
  s >= 1 ? (s = 1, n = t === 1 ? i : 0) : n = i * (1 - s) ** (t - 1);
17350
17362
  const o = i * (1 - s) ** t;
@@ -17484,7 +17496,7 @@ class P1 extends V {
17484
17496
  return g.create(m.VALUE);
17485
17497
  if (![1, 2, 4].includes(E) || b < 0 || b > 4 || Math.floor(_) >= Math.floor(C))
17486
17498
  return g.create(m.NUM);
17487
- const R = is(_, C, E, b);
17499
+ const R = as(_, C, E, b);
17488
17500
  return y.create(R);
17489
17501
  }
17490
17502
  }
@@ -17740,7 +17752,7 @@ class k1 extends V {
17740
17752
  const [U, x, F, W, ne] = L, z = +U.getValue(), G = +x.getValue(), ge = +F.getValue(), de = +W.getValue(), Ee = +ne.getValue();
17741
17753
  if (z < 0 || G < 0 || ge <= 0 || de <= 0 || de > ge || Ee <= 0)
17742
17754
  return g.create(m.NUM);
17743
- const pe = na(z, G, ge, de, Ee);
17755
+ const pe = ra(z, G, ge, de, Ee);
17744
17756
  return Number.isNaN(pe) || !Number.isFinite(pe) ? g.create(m.NUM) : b === 0 && R === 0 ? y.create(pe, Ke(this.getLocale())) : y.create(pe);
17745
17757
  });
17746
17758
  return u === 1 && c === 1 ? C.get(0, 0) : C;
@@ -18946,7 +18958,7 @@ class b0 extends V {
18946
18958
  return g.create(m.VALUE);
18947
18959
  if (d <= 0 || f >= h)
18948
18960
  return g.create(m.NUM);
18949
- const _ = Math.floor(h) - Math.floor(f), E = re(f).getUTCFullYear(), b = as(E);
18961
+ const _ = Math.floor(h) - Math.floor(f), E = re(f).getUTCFullYear(), b = ss(E);
18950
18962
  if (_ > b)
18951
18963
  return g.create(m.NUM);
18952
18964
  let R = 365 * d / (360 - d * _);
@@ -18980,7 +18992,7 @@ class y0 extends V {
18980
18992
  return g.create(m.VALUE);
18981
18993
  if (d <= 0 || f >= h)
18982
18994
  return g.create(m.NUM);
18983
- const _ = Math.floor(h) - Math.floor(f), E = re(f).getUTCFullYear(), b = as(E);
18995
+ const _ = Math.floor(h) - Math.floor(f), E = re(f).getUTCFullYear(), b = ss(E);
18984
18996
  if (_ > b)
18985
18997
  return g.create(m.NUM);
18986
18998
  const R = 100 * (1 - d * _ / 360);
@@ -19008,7 +19020,7 @@ class R0 extends V {
19008
19020
  return g.create(m.VALUE);
19009
19021
  if (d <= 0 || f >= h)
19010
19022
  return g.create(m.NUM);
19011
- const _ = Math.floor(h) - Math.floor(f), E = re(f).getUTCFullYear(), b = as(E);
19023
+ const _ = Math.floor(h) - Math.floor(f), E = re(f).getUTCFullYear(), b = ss(E);
19012
19024
  if (_ > b)
19013
19025
  return g.create(m.NUM);
19014
19026
  const R = (100 - d) / d * 360 / _;
@@ -19082,7 +19094,7 @@ class p0 extends V {
19082
19094
  }
19083
19095
  if (u)
19084
19096
  for (let h = c + 1; h <= l; h++) {
19085
- let d = na(e, t, r, h, o);
19097
+ let d = ra(e, t, r, h, o);
19086
19098
  h === c + 1 ? d *= Math.min(s, c + 1) - n : h === l && (d *= s + 1 - l), f += d;
19087
19099
  }
19088
19100
  else {
@@ -19098,7 +19110,7 @@ class p0 extends V {
19098
19110
  if (d)
19099
19111
  h = f;
19100
19112
  else {
19101
- const C = na(e, t, r, _, o);
19113
+ const C = ra(e, t, r, _, o);
19102
19114
  f = l / (n - (_ - 1)), f > C ? (h = f, d = !0) : (h = C, l -= C);
19103
19115
  }
19104
19116
  _ === u && (h *= s + 1 - u), c += h;
@@ -19410,7 +19422,7 @@ class O0 extends V {
19410
19422
  b = hn(e, t, r, 1.01 * E, s, o, u), E += -R / (b - n - R) * E * 0.01, R = hn(e, t, r, E, s, o, u) - n;
19411
19423
  return E;
19412
19424
  }
19413
- const l = is(e, t, o, u), f = qe(e, t, o, u), { days: h } = _e(e, t, u), d = n / 100 + l / f * r / o;
19425
+ const l = as(e, t, o, u), f = qe(e, t, o, u), { days: h } = _e(e, t, u), d = n / 100 + l / f * r / o;
19414
19426
  return (s / 100 + r / o - d) / d * o * f / h;
19415
19427
  }
19416
19428
  }
@@ -19671,7 +19683,7 @@ class j0 extends V {
19671
19683
  return g.create(m.VALUE);
19672
19684
  t = t.get(0, 0);
19673
19685
  }
19674
- return t.isError() ? t : t.isNumber() && t.getPattern() !== "" ? T.create(Ha(t.getPattern())) : t.isString() && (ta(`${t.getValue()}`) || ra(`${t.getValue()}`)) ? T.create(!0) : T.create(!1);
19686
+ return t.isError() ? t : t.isNumber() && t.getPattern() !== "" ? T.create(Ha(t.getPattern())) : t.isString() && (ea(`${t.getValue()}`) || ta(`${t.getValue()}`)) ? T.create(!0) : T.create(!1);
19675
19687
  }
19676
19688
  }
19677
19689
  class U0 extends V {
@@ -21376,11 +21388,11 @@ class Ud extends V {
21376
21388
  return C.setForcedUnitIdDirect(_), C.setForcedSheetName(d), this._setDefault(C);
21377
21389
  }
21378
21390
  if (Br(n))
21379
- return this._setDefault(new ya(n));
21391
+ return this._setDefault(new ba(n));
21380
21392
  if (Zi(n))
21381
- return this._setDefault(new pa(n));
21382
- if (zi(n))
21383
21393
  return this._setDefault(new Ra(n));
21394
+ if (zi(n))
21395
+ return this._setDefault(new ya(n));
21384
21396
  const s = mr(n), { range: o, sheetName: u, unitId: c } = s;
21385
21397
  if (Number.isNaN(o.startRow) || o.endRow + 1 > 1048576 || Number.isNaN(o.startColumn) || o.endColumn + 1 > 16384)
21386
21398
  return g.create(m.REF);
@@ -22510,7 +22522,7 @@ class zd extends V {
22510
22522
  }
22511
22523
  _handleExpandObject(e, t, r, n, s, o = 0) {
22512
22524
  if ((s === 2 || s === -2) && n !== 2) {
22513
- const u = Ts(s), c = vs(n);
22525
+ const u = vs(s), c = Us(n);
22514
22526
  return this.binarySearchExpand(
22515
22527
  e,
22516
22528
  t,
@@ -22531,7 +22543,7 @@ class zd extends V {
22531
22543
  }
22532
22544
  _handleSingleObject(e, t, r, n, s) {
22533
22545
  if ((s === 2 || s === -2) && n !== 2) {
22534
- const o = Ts(s), u = vs(n);
22546
+ const o = vs(s), u = Us(n);
22535
22547
  return this.binarySearch(e, t, r, o, u);
22536
22548
  }
22537
22549
  return n === 2 ? this.fuzzySearch(e, t, r, s !== -1) : n === -1 || n === 1 ? this.orderSearch(
@@ -22589,7 +22601,7 @@ class Jd extends V {
22589
22601
  _handleSingleObject(e, t, r, n) {
22590
22602
  let s;
22591
22603
  if ((n === 2 || n === -2) && r !== 2) {
22592
- const o = Ts(n), u = vs(r);
22604
+ const o = vs(n), u = Us(r);
22593
22605
  s = t.binarySearch(e, o, u);
22594
22606
  } else if (r === 2) {
22595
22607
  const o = t.compare(e, $.EQUALS);
@@ -23363,14 +23375,14 @@ class xC extends V {
23363
23375
  const { isError: c, errorObject: l, number: f } = this._handleSingleObject(u);
23364
23376
  if (c)
23365
23377
  return s = !0, o = l, !1;
23366
- t = Js(t, f);
23378
+ t = zs(t, f);
23367
23379
  }), s)
23368
23380
  return o;
23369
23381
  } else {
23370
23382
  const { isError: s, errorObject: o, number: u } = this._handleSingleObject(n);
23371
23383
  if (s)
23372
23384
  return o;
23373
- t = Js(t, u);
23385
+ t = zs(t, u);
23374
23386
  }
23375
23387
  }
23376
23388
  return y.create(t);
@@ -23558,7 +23570,7 @@ class IC extends V {
23558
23570
  }
23559
23571
  if (t !== r)
23560
23572
  return g.create(m.VALUE);
23561
- const s = Zn(n);
23573
+ const s = La(n);
23562
23574
  return y.create(s);
23563
23575
  }
23564
23576
  }
@@ -25644,7 +25656,7 @@ class Q_ extends V {
25644
25656
  return g.create(m.NUM);
25645
25657
  if (D === 1)
25646
25658
  return g.create(m.DIV_BY_ZERO);
25647
- const L = Math.abs(es(w / 2, D - 1) * S / Math.sqrt(D));
25659
+ const L = Math.abs(Jn(w / 2, D - 1) * S / Math.sqrt(D));
25648
25660
  return y.create(L);
25649
25661
  });
25650
25662
  return n === 1 && s === 1 ? l.get(0, 0) : l;
@@ -26246,7 +26258,7 @@ class lA extends V {
26246
26258
  A(this, "maxParams", 4);
26247
26259
  }
26248
26260
  calculate(e, t, r, n) {
26249
- const { isError: s, errorObject: o } = ts(e, t, r);
26261
+ const { isError: s, errorObject: o } = es(e, t, r);
26250
26262
  if (s)
26251
26263
  return o;
26252
26264
  const u = dt(e);
@@ -26268,7 +26280,7 @@ class lA extends V {
26268
26280
  return e.length === 1 && t.length > 1 || e[0].length === 1 && t[0].length > 1 ? e.length === 1 && t.length > 1 && (n ? t.length + 1 : t.length) > e[0].length || e[0].length === 1 && t[0].length > 1 && (n ? t[0].length + 1 : t[0].length) > e.length ? g.create(m.NA) : this._getResultByMultipleVariables(e, t, r, n) : this._getResultBySimpleVariables(e, t, r, n);
26269
26281
  }
26270
26282
  _getResultByMultipleVariables(e, t, r, n) {
26271
- const s = e.length === 1 && e[0].length > 1, o = ss(e, t, r, n, !0);
26283
+ const s = e.length === 1 && e[0].length > 1, o = ns(e, t, r, n, !0);
26272
26284
  if (o instanceof g)
26273
26285
  return o;
26274
26286
  const { coefficients: u, newX: c } = o, l = u[0].length, f = u[0][l - 1];
@@ -26283,11 +26295,11 @@ class lA extends V {
26283
26295
  return s && (h = mt(h)), q.createByArray(h);
26284
26296
  }
26285
26297
  _getResultBySimpleVariables(e, t, r, n) {
26286
- const s = e.flat(), o = t.flat(), { slope: u, intercept: c } = ns(o, s, n, !0), l = r.map((f) => f.map((h) => c * u ** h));
26298
+ const s = e.flat(), o = t.flat(), { slope: u, intercept: c } = rs(o, s, n, !0), l = r.map((f) => f.map((h) => c * u ** h));
26287
26299
  return q.createByArray(l);
26288
26300
  }
26289
26301
  _getKnownXsValues(e, t) {
26290
- return !t || t.isNull() ? rs(e.length, e[0].length) : dt(t);
26302
+ return !t || t.isNull() ? ts(e.length, e[0].length) : dt(t);
26291
26303
  }
26292
26304
  _getNewXsValues(e, t) {
26293
26305
  return !t || t.isNull() ? e : dt(t);
@@ -26507,7 +26519,7 @@ class CA extends V {
26507
26519
  A(this, "maxParams", 4);
26508
26520
  }
26509
26521
  calculate(e, t, r, n) {
26510
- const { isError: s, errorObject: o } = ts(e, t);
26522
+ const { isError: s, errorObject: o } = es(e, t);
26511
26523
  if (s)
26512
26524
  return o;
26513
26525
  const u = dt(e);
@@ -26530,7 +26542,7 @@ class CA extends V {
26530
26542
  return e.length === 1 && t.length > 1 || e[0].length === 1 && t[0].length > 1 ? e.length === 1 && t.length > 1 && (r ? t.length + 1 : t.length) > e[0].length || e[0].length === 1 && t[0].length > 1 && (r ? t[0].length + 1 : t[0].length) > e.length ? g.create(m.NA) : this._getResultByMultipleVariables(e, t, r, n) : this._getResultBySimpleVariables(e, t, r, n);
26531
26543
  }
26532
26544
  _getResultByMultipleVariables(e, t, r, n) {
26533
- const s = ss(e, t, t, r, !1);
26545
+ const s = ns(e, t, t, r, !1);
26534
26546
  if (s instanceof g)
26535
26547
  return s;
26536
26548
  const { coefficients: o, X: u, XTXInverse: c } = s;
@@ -26577,7 +26589,7 @@ class CA extends V {
26577
26589
  return q.createByArray(l);
26578
26590
  }
26579
26591
  _getResultBySimpleVariables(e, t, r, n) {
26580
- const s = e.flat(), o = t.flat(), { slope: u, intercept: c } = ns(o, s, r, !1);
26592
+ const s = e.flat(), o = t.flat(), { slope: u, intercept: c } = rs(o, s, r, !1);
26581
26593
  if (Number.isNaN(u))
26582
26594
  return g.create(m.NA);
26583
26595
  let l = [];
@@ -26617,7 +26629,7 @@ class CA extends V {
26617
26629
  return q.createByArray(l);
26618
26630
  }
26619
26631
  _getKnownXsValues(e, t) {
26620
- return !t || t.isNull() ? rs(e.length, e[0].length) : dt(t);
26632
+ return !t || t.isNull() ? ts(e.length, e[0].length) : dt(t);
26621
26633
  }
26622
26634
  }
26623
26635
  class _A extends V {
@@ -26627,7 +26639,7 @@ class _A extends V {
26627
26639
  A(this, "maxParams", 4);
26628
26640
  }
26629
26641
  calculate(e, t, r, n) {
26630
- const { isError: s, errorObject: o } = ts(e, t);
26642
+ const { isError: s, errorObject: o } = es(e, t);
26631
26643
  if (s)
26632
26644
  return o;
26633
26645
  const u = dt(e);
@@ -26651,7 +26663,7 @@ class _A extends V {
26651
26663
  }
26652
26664
  // eslint-disable-next-line max-lines-per-function
26653
26665
  _getResultByMultipleVariables(e, t, r, n) {
26654
- const s = ss(e, t, t, r, !0);
26666
+ const s = ns(e, t, t, r, !0);
26655
26667
  if (s instanceof g)
26656
26668
  return s;
26657
26669
  const { coefficients: o, Y: u, X: c, XTXInverse: l } = s;
@@ -26699,7 +26711,7 @@ class _A extends V {
26699
26711
  return q.createByArray(f);
26700
26712
  }
26701
26713
  _getResultBySimpleVariables(e, t, r, n) {
26702
- const s = e.flat(), o = t.flat(), { slope: u, intercept: c, Y: l } = ns(o, s, r, !0);
26714
+ const s = e.flat(), o = t.flat(), { slope: u, intercept: c, Y: l } = rs(o, s, r, !0);
26703
26715
  if (Number.isNaN(u))
26704
26716
  return g.create(m.NA);
26705
26717
  let f = [];
@@ -26737,7 +26749,7 @@ class _A extends V {
26737
26749
  return q.createByArray(f);
26738
26750
  }
26739
26751
  _getKnownXsValues(e, t) {
26740
- return !t || t.isNull() ? rs(e.length, e[0].length) : dt(t);
26752
+ return !t || t.isNull() ? ts(e.length, e[0].length) : dt(t);
26741
26753
  }
26742
26754
  }
26743
26755
  class AA extends V {
@@ -26798,7 +26810,7 @@ class EA extends V {
26798
26810
  const f = 1 - l, h = r.length, d = r.reduce((b, R) => b + R, 0) / h, _ = r.reduce((b, R) => b + (R - d) ** 2, 0) / (h - 1), C = Math.sqrt(_);
26799
26811
  if (C <= 0)
26800
26812
  return g.create(m.NUM);
26801
- const E = Math.abs(es(f / 2, h - 1) * C / Math.sqrt(h));
26813
+ const E = Math.abs(Jn(f / 2, h - 1) * C / Math.sqrt(h));
26802
26814
  return y.create(E);
26803
26815
  }
26804
26816
  _getRangeValues(e) {
@@ -28098,7 +28110,7 @@ class zA extends V {
28098
28110
  const [o, u] = s, c = +o.getValue(), l = Math.floor(+u.getValue());
28099
28111
  if (c <= 0 || c > 1 || l < 1 || l > 10 ** 10)
28100
28112
  return g.create(m.NUM);
28101
- const f = es(c, l);
28113
+ const f = Jn(c, l);
28102
28114
  return Number.isNaN(f) || !Number.isFinite(f) ? g.create(m.NUM) : y.create(f);
28103
28115
  }
28104
28116
  }
@@ -28109,7 +28121,7 @@ class JA extends V {
28109
28121
  A(this, "maxParams", 4);
28110
28122
  }
28111
28123
  calculate(e, t, r, n) {
28112
- const { isError: s, errorObject: o } = ts(e, t, r);
28124
+ const { isError: s, errorObject: o } = es(e, t, r);
28113
28125
  if (s)
28114
28126
  return o;
28115
28127
  const u = dt(e);
@@ -28131,7 +28143,7 @@ class JA extends V {
28131
28143
  return e.length === 1 && t.length > 1 || e[0].length === 1 && t[0].length > 1 ? e.length === 1 && t.length > 1 && (n ? t.length + 1 : t.length) > e[0].length || e[0].length === 1 && t[0].length > 1 && (n ? t[0].length + 1 : t[0].length) > e.length ? g.create(m.NA) : this._getResultByMultipleVariables(e, t, r, n) : this._getResultBySimpleVariables(e, t, r, n);
28132
28144
  }
28133
28145
  _getResultByMultipleVariables(e, t, r, n) {
28134
- const s = e.length === 1 && e[0].length > 1, o = ss(e, t, r, n, !1);
28146
+ const s = e.length === 1 && e[0].length > 1, o = ns(e, t, r, n, !1);
28135
28147
  if (o instanceof g)
28136
28148
  return o;
28137
28149
  const { coefficients: u, newX: c } = o, l = u[0].length, f = u[0][l - 1];
@@ -28146,14 +28158,14 @@ class JA extends V {
28146
28158
  return s && (h = mt(h)), q.createByArray(h);
28147
28159
  }
28148
28160
  _getResultBySimpleVariables(e, t, r, n) {
28149
- const s = e.flat(), o = t.flat(), { slope: u, intercept: c } = ns(o, s, n, !1);
28161
+ const s = e.flat(), o = t.flat(), { slope: u, intercept: c } = rs(o, s, n, !1);
28150
28162
  if (Number.isNaN(u))
28151
28163
  return g.create(m.NA);
28152
28164
  const l = r.map((f) => f.map((h) => u * h + c));
28153
28165
  return q.createByArray(l);
28154
28166
  }
28155
28167
  _getKnownXsValues(e, t) {
28156
- return !t || t.isNull() ? rs(e.length, e[0].length) : dt(t);
28168
+ return !t || t.isNull() ? ts(e.length, e[0].length) : dt(t);
28157
28169
  }
28158
28170
  _getNewXsValues(e, t) {
28159
28171
  return !t || t.isNull() ? e : dt(t);
@@ -30706,7 +30718,7 @@ var db = Object.getOwnPropertyDescriptor, Cb = (i, a, e, t) => {
30706
30718
  (s = i[n]) && (r = s(r) || r);
30707
30719
  return r;
30708
30720
  }, Fi = (i, a) => (e, t) => a(e, t, i);
30709
- let sa = class extends Ne {
30721
+ let na = class extends Ne {
30710
30722
  constructor(a, e) {
30711
30723
  super();
30712
30724
  A(this, "_computingCompleted$", new uc((a) => {
@@ -30727,10 +30739,10 @@ let sa = class extends Ne {
30727
30739
  t.add(this._globalComputingSrv.pushComputingStatusSubject(r)), t.add(this._computingCompleted$.subscribe((n) => r.next(n))), t.add(() => r.complete()), this.disposeWithMe(t);
30728
30740
  }
30729
30741
  };
30730
- sa = Cb([
30742
+ na = Cb([
30731
30743
  Fi(0, sr),
30732
30744
  Fi(1, ye(Yu))
30733
- ], sa);
30745
+ ], na);
30734
30746
  var _b = Object.getOwnPropertyDescriptor, Ab = (i, a, e, t) => {
30735
30747
  for (var r = t > 1 ? void 0 : t ? _b(a, e) : a, n = i.length - 1, s; n >= 0; n--)
30736
30748
  (s = i[n]) && (r = s(r) || r);
@@ -30746,17 +30758,17 @@ let jn = class extends Ne {
30746
30758
  _registerCommands() {
30747
30759
  [
30748
30760
  oo,
30749
- Os,
30761
+ Ns,
30750
30762
  so,
30751
30763
  ao,
30752
30764
  Cn,
30753
30765
  io,
30754
- la,
30766
+ ca,
30755
30767
  no,
30768
+ la,
30756
30769
  fa,
30757
30770
  ha,
30758
30771
  ma,
30759
- ga,
30760
30772
  qc,
30761
30773
  Kc,
30762
30774
  uo,
@@ -30768,7 +30780,7 @@ let jn = class extends Ne {
30768
30780
  }
30769
30781
  _registerFunctions() {
30770
30782
  var e;
30771
- const i = this._configService.getConfig(_a), a = [
30783
+ const i = this._configService.getConfig(Ca), a = [
30772
30784
  ...kh,
30773
30785
  ...ym,
30774
30786
  ...Rm,
@@ -30795,7 +30807,7 @@ let jn = class extends Ne {
30795
30807
  jn = Ab([
30796
30808
  tn(0, sr),
30797
30809
  tn(1, Yt),
30798
- tn(2, oa),
30810
+ tn(2, ia),
30799
30811
  tn(3, nc(fc))
30800
30812
  ], jn);
30801
30813
  var Eb = Object.getOwnPropertyDescriptor, bb = (i, a, e, t) => {
@@ -30821,24 +30833,24 @@ let Un = class extends Ne {
30821
30833
  _commandExecutedListener() {
30822
30834
  this.disposeWithMe(
30823
30835
  this._commandService.onCommandExecuted((i) => {
30824
- if (i.id === ha.id) {
30836
+ if (i.id === fa.id) {
30825
30837
  const a = i.params;
30826
30838
  if (a == null)
30827
30839
  return;
30828
30840
  const { featureIds: e, unitId: t, subUnitId: r } = a;
30829
30841
  this._dependencyManagerService.removeFeatureFormulaDependency(t, r, e);
30830
- } else if (i.id === fa.id) {
30842
+ } else if (i.id === la.id) {
30831
30843
  const a = i.params;
30832
30844
  if (a == null)
30833
30845
  return;
30834
30846
  const { featureId: e, calculationParam: t } = a, { unitId: r, subUnitId: n } = t;
30835
30847
  this._dependencyManagerService.removeFeatureFormulaDependency(r, n, [e]);
30836
- } else if (i.id === ga.id) {
30848
+ } else if (i.id === ma.id) {
30837
30849
  const a = i.params;
30838
30850
  if (a == null)
30839
30851
  return;
30840
30852
  this._dependencyManagerService.removeOtherFormulaDependency(a.unitId, a.subUnitId, a.formulaIdList);
30841
- } else if (i.id === ma.id) {
30853
+ } else if (i.id === ha.id) {
30842
30854
  const a = i.params;
30843
30855
  if (a == null)
30844
30856
  return;
@@ -30867,7 +30879,7 @@ let Un = class extends Ne {
30867
30879
  });
30868
30880
  }
30869
30881
  });
30870
- } else i.id === la.id && this._handleSetDefinedName(i);
30882
+ } else i.id === ca.id && this._handleSetDefinedName(i);
30871
30883
  })
30872
30884
  );
30873
30885
  }
@@ -30900,13 +30912,13 @@ let vn = class extends Ne {
30900
30912
  _commandExecutedListener() {
30901
30913
  this.disposeWithMe(
30902
30914
  this._commandService.onCommandExecuted((i) => {
30903
- if (i.id === fa.id) {
30915
+ if (i.id === la.id) {
30904
30916
  const a = i.params;
30905
30917
  if (a == null)
30906
30918
  return;
30907
30919
  const { featureId: e, calculationParam: t } = a, { unitId: r, subUnitId: n } = t;
30908
30920
  this._featureCalculationManagerService.register(r, n, e, t);
30909
- } else if (i.id === ha.id) {
30921
+ } else if (i.id === fa.id) {
30910
30922
  const a = i.params;
30911
30923
  if (a == null)
30912
30924
  return;
@@ -30925,7 +30937,7 @@ var pb = Object.getOwnPropertyDescriptor, Vb = (i, a, e, t) => {
30925
30937
  for (var r = t > 1 ? void 0 : t ? pb(a, e) : a, n = i.length - 1, s; n >= 0; n--)
30926
30938
  (s = i[n]) && (r = s(r) || r);
30927
30939
  return r;
30928
- }, Rs = (i, a) => (e, t) => a(e, t, i);
30940
+ }, ys = (i, a) => (e, t) => a(e, t, i);
30929
30941
  let Tn = class extends Ne {
30930
30942
  constructor(i, a, e) {
30931
30943
  super(), this._commandService = i, this._otherFormulaManagerService = a, this._dependencyManagerService = e, this._initialize();
@@ -30936,13 +30948,13 @@ let Tn = class extends Ne {
30936
30948
  _commandExecutedListener() {
30937
30949
  this.disposeWithMe(
30938
30950
  this._commandService.onCommandExecuted((i) => {
30939
- if (i.id === ma.id) {
30951
+ if (i.id === ha.id) {
30940
30952
  const a = i.params;
30941
30953
  if (a == null)
30942
30954
  return;
30943
30955
  const e = { [a.unitId]: { [a.subUnitId]: a.formulaMap } };
30944
30956
  this._otherFormulaManagerService.batchRegister(e);
30945
- } else if (i.id === ga.id) {
30957
+ } else if (i.id === ma.id) {
30946
30958
  const a = i.params;
30947
30959
  if (a == null)
30948
30960
  return;
@@ -30956,9 +30968,9 @@ let Tn = class extends Ne {
30956
30968
  }
30957
30969
  };
30958
30970
  Tn = Vb([
30959
- Rs(0, sr),
30960
- Rs(1, Ma),
30961
- Rs(2, Xn)
30971
+ ys(0, sr),
30972
+ ys(1, Oa),
30973
+ ys(2, Xn)
30962
30974
  ], Tn);
30963
30975
  class Nb extends Ne {
30964
30976
  constructor() {
@@ -31005,7 +31017,7 @@ let Bn = class extends Ne {
31005
31017
  _commandExecutedListener() {
31006
31018
  this.disposeWithMe(
31007
31019
  this._commandService.onCommandExecuted((i) => {
31008
- if (i.id === la.id) {
31020
+ if (i.id === ca.id) {
31009
31021
  const a = i.params;
31010
31022
  if (a == null)
31011
31023
  return;
@@ -31065,8 +31077,8 @@ var Db = Object.getOwnPropertyDescriptor, Lb = (i, a, e, t) => {
31065
31077
  return r;
31066
31078
  }, Yi = (i, a) => (e, t) => a(e, t, i);
31067
31079
  const Pb = "UNIVER_ENGINE_FORMULA_PLUGIN";
31068
- var ps;
31069
- let Hi = (ps = class extends sc {
31080
+ var Rs;
31081
+ let Hi = (Rs = class extends sc {
31070
31082
  constructor(i = hi, a, e) {
31071
31083
  super(), this._config = i, this._injector = a, this._configService = e;
31072
31084
  const { ...t } = ac(
@@ -31074,17 +31086,17 @@ let Hi = (ps = class extends sc {
31074
31086
  hi,
31075
31087
  this._config
31076
31088
  );
31077
- this._configService.setConfig(_a, t);
31089
+ this._configService.setConfig(Ca, t);
31078
31090
  }
31079
31091
  onStarting() {
31080
31092
  this._initialize(), this._initializeWithOverride();
31081
31093
  }
31082
31094
  onReady() {
31083
31095
  var i;
31084
- os(this._injector, [
31096
+ is(this._injector, [
31085
31097
  [jn],
31086
31098
  [Bn]
31087
- ]), (i = this._config) != null && i.notExecuteFormula || os(this._injector, [
31099
+ ]), (i = this._config) != null && i.notExecuteFormula || is(this._injector, [
31088
31100
  [Tn],
31089
31101
  [vn],
31090
31102
  [Un],
@@ -31093,16 +31105,16 @@ let Hi = (ps = class extends sc {
31093
31105
  }
31094
31106
  onRendered() {
31095
31107
  var i;
31096
- (i = this._config) != null && i.notExecuteFormula || os(this._injector, [
31097
- [Xs],
31098
- [qs]
31108
+ (i = this._config) != null && i.notExecuteFormula || is(this._injector, [
31109
+ [Ks],
31110
+ [Ws]
31099
31111
  ]);
31100
31112
  }
31101
31113
  _initialize() {
31102
31114
  const i = !this._config.notExecuteFormula, a = [
31103
31115
  // Services
31104
31116
  [Yt, { useClass: Kf }],
31105
- [pr, { useClass: Ds }],
31117
+ [pr, { useClass: Ss }],
31106
31118
  [Sb, { useClass: wb }],
31107
31119
  [ho, { useClass: il }],
31108
31120
  [Hu, { useClass: Nb }],
@@ -31110,17 +31122,17 @@ let Hi = (ps = class extends sc {
31110
31122
  // Models
31111
31123
  [gr],
31112
31124
  // Engine
31113
- [da],
31125
+ [ga],
31114
31126
  //Controllers
31115
31127
  [jn],
31116
31128
  [Bn],
31117
- [sa]
31129
+ [na]
31118
31130
  ];
31119
31131
  i && a.push(
31120
31132
  // Services
31121
- [Ma, { useClass: Sh }],
31122
- [Ot, { useClass: Gs }],
31123
- [Ft, { useClass: xs }],
31133
+ [Oa, { useClass: Sh }],
31134
+ [Ot, { useClass: Hs }],
31135
+ [Ft, { useClass: Ps }],
31124
31136
  [vr, { useClass: wh }],
31125
31137
  //Controller
31126
31138
  [Ln],
@@ -31147,15 +31159,15 @@ let Hi = (ps = class extends sc {
31147
31159
  _initializeWithOverride() {
31148
31160
  var i;
31149
31161
  (i = this._config) != null && i.notExecuteFormula || [
31150
- [Xs, { useClass: Zs }],
31162
+ [Ks, { useClass: Xs }],
31151
31163
  [Xn, { useClass: Mh }],
31152
- [qs, { useClass: Ks }]
31164
+ [Ws, { useClass: qs }]
31153
31165
  ].forEach((e) => this._injector.add(e));
31154
31166
  }
31155
- }, A(ps, "pluginName", Pb), ps);
31167
+ }, A(Rs, "pluginName", Pb), Rs);
31156
31168
  Hi = Lb([
31157
31169
  Yi(1, ye(Qi)),
31158
- Yi(2, oa)
31170
+ Yi(2, ia)
31159
31171
  ], Hi);
31160
31172
  export {
31161
31173
  wb as ActiveDirtyManagerService,
@@ -31171,18 +31183,18 @@ export {
31171
31183
  er as BooleanValue,
31172
31184
  T as BooleanValueObject,
31173
31185
  Ln as CalculateController,
31174
- Zs as CalculateFormulaService,
31186
+ Xs as CalculateFormulaService,
31175
31187
  Vm as CustomFunction,
31176
31188
  jh as DEFAULT_INTERVAL_COUNT,
31177
- Ds as DefinedNamesService,
31189
+ Ss as DefinedNamesService,
31178
31190
  Oh as DependencyManagerBaseService,
31179
31191
  Mh as DependencyManagerService,
31180
31192
  Hb as ENGINE_FORMULA_CYCLE_REFERENCE_COUNT,
31181
- _a as ENGINE_FORMULA_PLUGIN_CONFIG_KEY,
31193
+ Ca as ENGINE_FORMULA_PLUGIN_CONFIG_KEY,
31182
31194
  yr as ERROR_TYPE_SET,
31183
31195
  m as ErrorType,
31184
31196
  g as ErrorValueObject,
31185
- zs as FUNCTION_NAMES_ARRAY,
31197
+ Zs as FUNCTION_NAMES_ARRAY,
31186
31198
  le as FUNCTION_NAMES_COMPATIBILITY,
31187
31199
  pm as FUNCTION_NAMES_CUBE,
31188
31200
  Qe as FUNCTION_NAMES_DATABASE,
@@ -31198,38 +31210,38 @@ export {
31198
31210
  hb as FUNCTION_NAMES_UNIVER,
31199
31211
  $u as FUNCTION_NAMES_WEB,
31200
31212
  wh as FeatureCalculationManagerService,
31201
- xs as FormulaCurrentConfigService,
31213
+ Ps as FormulaCurrentConfigService,
31202
31214
  gr as FormulaDataModel,
31203
- Ks as FormulaDependencyGenerator,
31204
- As as FormulaDependencyTree,
31205
- Ws as FormulaDependencyTreeType,
31215
+ qs as FormulaDependencyGenerator,
31216
+ _s as FormulaDependencyTree,
31217
+ Qs as FormulaDependencyTreeType,
31206
31218
  Mi as FormulaDependencyTreeVirtual,
31207
31219
  Xe as FormulaExecuteStageType,
31208
31220
  Dr as FormulaExecutedStateType,
31209
- Gs as FormulaRuntimeService,
31221
+ Hs as FormulaRuntimeService,
31210
31222
  Nn as FunctionNodeFactory,
31211
31223
  Kf as FunctionService,
31212
31224
  gc as FunctionType,
31213
31225
  Yu as GlobalComputingStatusService,
31214
31226
  Sb as IActiveDirtyManagerService,
31215
- Xs as ICalculateFormulaService,
31227
+ Ks as ICalculateFormulaService,
31216
31228
  pr as IDefinedNamesService,
31217
31229
  Xn as IDependencyManagerService,
31218
31230
  vr as IFeatureCalculationManagerService,
31219
31231
  Ft as IFormulaCurrentConfigService,
31220
- qs as IFormulaDependencyGenerator,
31232
+ Ws as IFormulaDependencyGenerator,
31221
31233
  Ot as IFormulaRuntimeService,
31222
31234
  Yt as IFunctionService,
31223
- Ma as IOtherFormulaManagerService,
31235
+ Oa as IOtherFormulaManagerService,
31224
31236
  ho as ISheetRowFilteredService,
31225
31237
  Hu as ISuperTableService,
31226
31238
  _r as Interpreter,
31227
31239
  On as LambdaNodeFactory,
31228
31240
  xo as LambdaParameterNodeFactory,
31229
- Oa as LambdaValueObjectObject,
31241
+ Na as LambdaValueObjectObject,
31230
31242
  dr as Lexer,
31231
31243
  ae as LexerNode,
31232
- da as LexerTreeBuilder,
31244
+ ga as LexerTreeBuilder,
31233
31245
  ie as NullValueObject,
31234
31246
  y as NumberValueObject,
31235
31247
  Mn as OperatorNodeFactory,
@@ -31239,19 +31251,19 @@ export {
31239
31251
  wn as ReferenceNodeFactory,
31240
31252
  Uc as RegisterFunctionMutation,
31241
31253
  no as RemoveDefinedNameMutation,
31242
- ha as RemoveFeatureCalculationMutation,
31243
- ga as RemoveOtherFormulaMutation,
31254
+ fa as RemoveFeatureCalculationMutation,
31255
+ ma as RemoveOtherFormulaMutation,
31244
31256
  Kc as RemoveSuperTableMutation,
31245
- Os as SetArrayFormulaDataMutation,
31246
- la as SetDefinedNameMutation,
31257
+ Ns as SetArrayFormulaDataMutation,
31258
+ ca as SetDefinedNameMutation,
31247
31259
  Yb as SetDefinedNameMutationFactory,
31248
- fa as SetFeatureCalculationMutation,
31260
+ la as SetFeatureCalculationMutation,
31249
31261
  Cn as SetFormulaCalculationNotificationMutation,
31250
31262
  io as SetFormulaCalculationResultMutation,
31251
31263
  so as SetFormulaCalculationStartMutation,
31252
31264
  ao as SetFormulaCalculationStopMutation,
31253
31265
  oo as SetFormulaDataMutation,
31254
- ma as SetOtherFormulaMutation,
31266
+ ha as SetOtherFormulaMutation,
31255
31267
  qc as SetSuperTableMutation,
31256
31268
  uo as SetSuperTableOptionMutation,
31257
31269
  il as SheetRowFilteredService,
@@ -31292,7 +31304,7 @@ export {
31292
31304
  Bb as getObjectValue,
31293
31305
  $b as getRangeWithRefsString,
31294
31306
  Gb as handleNumfmtInCell,
31295
- ca as handleRefStringInfo,
31307
+ ua as handleRefStringInfo,
31296
31308
  _c as includeFormulaLexerToken,
31297
31309
  fi as initSheetFormulaData,
31298
31310
  sn as isFormulaLexerToken,
@@ -31306,10 +31318,10 @@ export {
31306
31318
  X as operatorToken,
31307
31319
  $e as sequenceNodeType,
31308
31320
  fr as serializeRange,
31309
- Ms as serializeRangeToRefString,
31321
+ Os as serializeRangeToRefString,
31310
31322
  Bc as serializeRangeWithSheet,
31311
31323
  Ic as serializeRangeWithSpreadsheet,
31312
- cs as singleReferenceToGrid,
31324
+ us as singleReferenceToGrid,
31313
31325
  yi as strip,
31314
31326
  Sf as stripErrorMargin
31315
31327
  };