@univerjs/sheets-numfmt 0.1.15 → 0.1.16

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,6 +1,6 @@
1
1
  var mt = Object.defineProperty;
2
- var dt = (e, t, n) => t in e ? mt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var ie = (e, t, n) => (dt(e, typeof t != "symbol" ? t + "" : t, n), n);
2
+ var dt = (e, t, s) => t in e ? mt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
+ var ie = (e, t, s) => dt(e, typeof t != "symbol" ? t + "" : t, s);
4
4
  import { CommandType as w, ICommandService as O, IUniverInstanceService as D, IUndoRedoService as ft, sequenceExecute as ht, LocaleType as pt, Disposable as z, ObjectMatrix as vt, CellValueType as V, Range as R, UniverInstanceType as T, OnLifecycle as K, LifecycleStages as B, ThemeService as He, LocaleService as E, runOnLifecycle as _t, ILocalStorageService as gt, toDisposable as Ie, DisposableCollection as St, Plugin as bt, Tools as yt, DependentOn as Ct } from "@univerjs/core";
5
5
  import { getSheetCommandTarget as Me, transformCellsToRange as Fe, rangeMerge as Le, SetNumfmtMutation as Y, factorySetNumfmtUndoMutation as We, RemoveNumfmtMutation as pe, factoryRemoveNumfmtUndoMutation as ke, INTERCEPTOR_POINT as Ge, SheetInterceptorService as Pe, INumfmtService as H, SelectionManagerService as U, SetRangeValuesCommand as Tt, WorkbookEditablePermission as q, WorksheetEditPermission as J, WorksheetSetCellStylePermission as Z, RangeProtectionPermissionEditPoint as Q, UniverSheetsPlugin as It } from "@univerjs/sheets";
6
6
  import { Inject as S, createIdentifier as Et, Injector as Re } from "@wendellhu/redi";
@@ -19,47 +19,46 @@ const $ = {
19
19
  handler: (e, t) => {
20
20
  if (!t)
21
21
  return !1;
22
- const n = e.get(O), s = e.get(D), r = e.get(ft), i = Me(s, t);
23
- if (!i)
24
- return !1;
25
- const { unitId: o, subUnitId: a } = i, l = t.values.filter((f) => !!f.pattern), u = t.values.filter((f) => !f.pattern), m = Fe(o, a, l), c = {
22
+ const s = e.get(O), n = e.get(D), r = e.get(ft), i = Me(n, t);
23
+ if (!i) return !1;
24
+ const { unitId: o, subUnitId: c } = i, a = t.values.filter((h) => !!h.pattern), f = t.values.filter((h) => !h.pattern), m = Fe(o, c, a), l = {
26
25
  unitId: o,
27
- subUnitId: a,
28
- ranges: u.map((f) => ({
29
- startColumn: f.col,
30
- startRow: f.row,
31
- endColumn: f.col,
32
- endRow: f.row
26
+ subUnitId: c,
27
+ ranges: f.map((h) => ({
28
+ startColumn: h.col,
29
+ startRow: h.row,
30
+ endColumn: h.col,
31
+ endRow: h.row
33
32
  }))
34
- }, h = [], g = [];
35
- if (l.length) {
36
- Object.keys(m.values).forEach((p) => {
37
- const _ = m.values[p];
38
- _.ranges = Le(_.ranges);
39
- }), h.push({
33
+ }, u = [], p = [];
34
+ if (a.length) {
35
+ Object.keys(m.values).forEach((v) => {
36
+ const g = m.values[v];
37
+ g.ranges = Le(g.ranges);
38
+ }), u.push({
40
39
  id: Y.id,
41
40
  params: m
42
41
  });
43
- const f = We(e, m);
44
- g.push(...f);
42
+ const h = We(e, m);
43
+ p.push(...h);
45
44
  }
46
- if (u.length) {
47
- c.ranges = Le(c.ranges), h.push({
45
+ if (f.length) {
46
+ l.ranges = Le(l.ranges), u.push({
48
47
  id: pe.id,
49
- params: c
48
+ params: l
50
49
  });
51
- const f = ke(e, c);
52
- g.push(...f);
50
+ const h = ke(e, l);
51
+ p.push(...h);
53
52
  }
54
- const v = ht(h, n).result;
55
- return v && r.pushUndoRedo({
53
+ const _ = ht(u, s).result;
54
+ return _ && r.pushUndoRedo({
56
55
  unitID: o,
57
- undoMutations: g,
58
- redoMutations: h
59
- }), v;
56
+ undoMutations: p,
57
+ redoMutations: u
58
+ }), _;
60
59
  }
61
- }, Ee = "SHEET_NUMFMT_PLUGIN", me = (e) => x.getInfo(e).type || "unknown", we = (e, t, n) => {
62
- const s = x.getInfo(e), r = n === pt.ZH_CN ? "zh-CN" : "en", i = s._partitions[1], o = x.format(e, t, { locale: r });
60
+ }, Ee = "SHEET_NUMFMT_PLUGIN", me = (e) => x.getInfo(e).type || "unknown", we = (e, t, s) => {
61
+ const n = x.getInfo(e), r = s === pt.ZH_CN ? "zh-CN" : "en", i = n._partitions[1], o = x.format(e, t, { locale: r });
63
62
  return t < 0 ? {
64
63
  result: o,
65
64
  color: i.color
@@ -67,50 +66,50 @@ const $ = {
67
66
  result: o
68
67
  };
69
68
  };
70
- var Kt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, qt = (e, t, n, s) => {
71
- for (var r = s > 1 ? void 0 : s ? Yt(t, n) : t, i = e.length - 1, o; i >= 0; i--)
72
- (o = e[i]) && (r = (s ? o(t, n, r) : o(r)) || r);
73
- return s && r && Kt(t, n, r), r;
74
- }, A = (e, t) => (n, s) => t(n, s, e);
69
+ var Kt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, qt = (e, t, s, n) => {
70
+ for (var r = n > 1 ? void 0 : n ? Yt(t, s) : t, i = e.length - 1, o; i >= 0; i--)
71
+ (o = e[i]) && (r = (n ? o(t, s, r) : o(r)) || r);
72
+ return n && r && Kt(t, s, r), r;
73
+ }, A = (e, t) => (s, n) => t(s, n, e);
75
74
  let oe = class extends z {
76
- constructor(e, t, n, s, r, i) {
77
- super(), this._instanceService = e, this._sheetInterceptorService = t, this._themeService = n, this._commandService = s, this._numfmtService = r, this._localeService = i, this._initInterceptorCellContent();
75
+ constructor(e, t, s, n, r, i) {
76
+ super(), this._instanceService = e, this._sheetInterceptorService = t, this._themeService = s, this._commandService = n, this._numfmtService = r, this._localeService = i, this._initInterceptorCellContent();
78
77
  }
79
78
  _initInterceptorCellContent() {
80
79
  const e = new vt();
81
80
  this.disposeWithMe(this._sheetInterceptorService.intercept(Ge.CELL_CONTENT, {
82
- handler: (t, n, s) => {
83
- const r = n.unitId, i = n.subUnitId, o = this._numfmtService.getValue(r, i, n.row, n.col);
81
+ handler: (t, s, n) => {
82
+ const r = s.unitId, i = s.subUnitId, o = this._numfmtService.getValue(r, i, s.row, s.col);
84
83
  if (!o)
85
- return s(t);
86
- const a = t;
87
- if (!a || a.t !== V.NUMBER)
88
- return s(t);
89
- let l = "";
90
- const u = e.getValue(n.row, n.col);
91
- if (u && u.parameters === a.v)
92
- return s({ ...t, ...u.result });
93
- const m = we(o.pattern, Number(a.v), this._localeService.getCurrentLocale());
94
- if (l = m.result, !l)
95
- return s(t);
96
- const c = { v: l };
84
+ return n(t);
85
+ const c = t;
86
+ if (!c || c.t !== V.NUMBER)
87
+ return n(t);
88
+ let a = "";
89
+ const f = e.getValue(s.row, s.col);
90
+ if (f && f.parameters === c.v)
91
+ return n({ ...t, ...f.result });
92
+ const m = we(o.pattern, Number(c.v), this._localeService.getCurrentLocale());
93
+ if (a = m.result, !a)
94
+ return n(t);
95
+ const l = { v: a };
97
96
  if (m.color) {
98
- const h = this._themeService.getCurrentTheme()[`${m.color}500`];
99
- h && (c.interceptorStyle = { cl: { rgb: h } });
97
+ const u = this._themeService.getCurrentTheme()[`${m.color}500`];
98
+ u && (l.interceptorStyle = { cl: { rgb: u } });
100
99
  }
101
- return e.setValue(n.row, n.col, {
102
- result: c,
103
- parameters: a.v
104
- }), s({ ...t, ...c });
100
+ return e.setValue(s.row, s.col, {
101
+ result: l,
102
+ parameters: c.v
103
+ }), n({ ...t, ...l });
105
104
  },
106
105
  priority: 10
107
106
  })), this.disposeWithMe(this._commandService.onCommandExecuted((t) => {
108
107
  if (t.id === Y.id) {
109
- const n = t.params;
110
- Object.keys(n.values).forEach((s) => {
111
- n.values[s].ranges.forEach((i) => {
112
- R.foreach(i, (o, a) => {
113
- e.realDeleteValue(o, a);
108
+ const s = t.params;
109
+ Object.keys(s.values).forEach((n) => {
110
+ s.values[n].ranges.forEach((i) => {
111
+ R.foreach(i, (o, c) => {
112
+ e.realDeleteValue(o, c);
114
113
  });
115
114
  });
116
115
  });
@@ -118,8 +117,8 @@ let oe = class extends z {
118
117
  })), this.disposeWithMe(
119
118
  this._instanceService.getCurrentTypeOfUnit$(T.UNIVER_SHEET).pipe(
120
119
  xt((t) => {
121
- var n;
122
- return (n = t == null ? void 0 : t.activeSheet$) != null ? n : Ot(null);
120
+ var s;
121
+ return (s = t == null ? void 0 : t.activeSheet$) != null ? s : Ot(null);
123
122
  }),
124
123
  jt(1)
125
124
  ).subscribe(() => e.reset())
@@ -136,68 +135,67 @@ oe = qt([
136
135
  A(5, S(E))
137
136
  ], oe);
138
137
  const j = (e, t = 0) => {
139
- var s;
140
- return e && (s = x.getInfo(e).maxDecimals) != null ? s : t;
138
+ var n;
139
+ return e && (n = x.getInfo(e).maxDecimals) != null ? n : t;
141
140
  }, ve = (e, t) => {
142
141
  if (e && !t || !e && t)
143
142
  return !1;
144
- const n = (u) => u.reduce(
145
- (m, c) => {
143
+ const s = (f) => f.reduce(
144
+ (m, l) => {
146
145
  if (m.isEnd)
147
146
  return m;
148
- const h = c.value || c.num;
149
- return c.type === "point" ? (m.isEnd = !0, m) : { ...m, result: m.result + h };
147
+ const u = l.value || l.num;
148
+ return l.type === "point" ? (m.isEnd = !0, m) : { ...m, result: m.result + u };
150
149
  },
151
150
  { isEnd: !1, result: "" }
152
- ).result, s = x.getInfo(e)._partitions, r = x.getInfo(t)._partitions, i = n(s[0].tokens), o = n(r[0].tokens), a = n(s[1].tokens), l = n(r[1].tokens);
153
- return i === o && a === l && s[1].color === r[1].color;
154
- }, Ve = (e) => new Array(Math.min(Math.max(0, Number(e)), 30)).fill(0).join(""), C = (e, t) => e.split(";").map((s) => /\.0?/.test(s) ? s.replace(
151
+ ).result, n = x.getInfo(e)._partitions, r = x.getInfo(t)._partitions, i = s(n[0].tokens), o = s(r[0].tokens), c = s(n[1].tokens), a = s(r[1].tokens);
152
+ return i === o && c === a && n[1].color === r[1].color;
153
+ }, Ve = (e) => new Array(Math.min(Math.max(0, Number(e)), 30)).fill(0).join(""), C = (e, t) => e.split(";").map((n) => /\.0?/.test(n) ? n.replace(
155
154
  /\.0*/g,
156
155
  `${t > 0 ? "." : ""}${Ve(Number(t || 0))}`
157
- ) : /0([^0]?)|0$/.test(s) ? s.replace(
156
+ ) : /0([^0]?)|0$/.test(n) ? n.replace(
158
157
  /0([^0]+)|0$/,
159
158
  `0${t > 0 ? "." : ""}${Ve(Number(t || 0))}$1`
160
- ) : s).join(";"), Jt = (e) => /\.0?/.test(e) || /0([^0]?)|0$/.test(e), qe = {
159
+ ) : n).join(";"), Jt = (e) => /\.0?/.test(e) || /0([^0]?)|0$/.test(e), qe = {
161
160
  id: "sheet.command.numfmt.add.decimal.command",
162
161
  type: w.COMMAND,
163
162
  handler: async (e) => {
164
- const t = e.get(O), n = e.get(U), s = e.get(H), r = e.get(D), i = n.getSelections();
163
+ const t = e.get(O), s = e.get(U), n = e.get(H), r = e.get(D), i = s.getSelections();
165
164
  if (!i || !i.length)
166
165
  return !1;
167
166
  const o = Me(r);
168
- if (!o)
169
- return !1;
170
- const { unitId: a, subUnitId: l } = o;
171
- let u = 0;
172
- i.forEach((g) => {
173
- R.foreach(g.range, (v, f) => {
174
- const p = s.getValue(a, l, v, f);
175
- if (!p)
167
+ if (!o) return !1;
168
+ const { unitId: c, subUnitId: a } = o;
169
+ let f = 0;
170
+ i.forEach((p) => {
171
+ R.foreach(p.range, (_, h) => {
172
+ const v = n.getValue(c, a, _, h);
173
+ if (!v)
176
174
  return;
177
- const _ = j(p.pattern);
178
- u = _ > u ? _ : u;
175
+ const g = j(v.pattern);
176
+ f = g > f ? g : f;
179
177
  });
180
178
  });
181
- const m = u + 1, c = C(`0${m > 0 ? ".0" : ""}`, m), h = [];
182
- return i.forEach((g) => {
183
- R.foreach(g.range, (v, f) => {
184
- const p = s.getValue(a, l, v, f);
185
- if (!p)
186
- h.push({
187
- row: v,
188
- col: f,
189
- pattern: c
179
+ const m = f + 1, l = C(`0${m > 0 ? ".0" : ""}`, m), u = [];
180
+ return i.forEach((p) => {
181
+ R.foreach(p.range, (_, h) => {
182
+ const v = n.getValue(c, a, _, h);
183
+ if (!v)
184
+ u.push({
185
+ row: _,
186
+ col: h,
187
+ pattern: l
190
188
  });
191
189
  else {
192
- const _ = j(p.pattern), b = C(p.pattern, _ + 1);
193
- b !== p.pattern && h.push({
194
- row: v,
195
- col: f,
190
+ const g = j(v.pattern), b = C(v.pattern, g + 1);
191
+ b !== v.pattern && u.push({
192
+ row: _,
193
+ col: h,
196
194
  pattern: b
197
195
  });
198
196
  }
199
197
  });
200
- }), h.length ? await t.executeCommand($.id, { values: h }) : !1;
198
+ }), u.length ? await t.executeCommand($.id, { values: u }) : !1;
201
199
  }
202
200
  }, Zt = [
203
201
  {
@@ -304,13 +302,13 @@ const j = (e, t = 0) => {
304
302
  id: "sheet.command.numfmt.set.currency",
305
303
  type: w.COMMAND,
306
304
  handler: async (e) => {
307
- const t = e.get(O), s = e.get(U).getSelections();
308
- if (!s || !s.length)
305
+ const t = e.get(O), n = e.get(U).getSelections();
306
+ if (!n || !n.length)
309
307
  return !1;
310
308
  const r = [], i = Je[0].suffix("¥");
311
- return s.forEach((a) => {
312
- R.foreach(a.range, (l, u) => {
313
- r.push({ row: l, col: u, pattern: i, type: "currency" });
309
+ return n.forEach((c) => {
310
+ R.foreach(c.range, (a, f) => {
311
+ r.push({ row: a, col: f, pattern: i, type: "currency" });
314
312
  });
315
313
  }), await t.executeCommand($.id, { values: r });
316
314
  }
@@ -318,43 +316,42 @@ const j = (e, t = 0) => {
318
316
  id: "sheet.command.numfmt.subtract.decimal.command",
319
317
  type: w.COMMAND,
320
318
  handler: async (e) => {
321
- const t = e.get(O), n = e.get(U), s = e.get(H), r = e.get(D), i = n.getSelections();
319
+ const t = e.get(O), s = e.get(U), n = e.get(H), r = e.get(D), i = s.getSelections();
322
320
  if (!i || !i.length)
323
321
  return !1;
324
322
  const o = Me(r);
325
- if (!o)
326
- return !1;
327
- const { unitId: a, subUnitId: l } = o;
328
- let u = 0;
329
- i.forEach((v) => {
330
- R.foreach(v.range, (f, p) => {
331
- const _ = s.getValue(a, l, f, p);
332
- if (!_)
323
+ if (!o) return !1;
324
+ const { unitId: c, subUnitId: a } = o;
325
+ let f = 0;
326
+ i.forEach((_) => {
327
+ R.foreach(_.range, (h, v) => {
328
+ const g = n.getValue(c, a, h, v);
329
+ if (!g)
333
330
  return;
334
- const b = j(_.pattern);
335
- u = b > u ? b : u;
331
+ const b = j(g.pattern);
332
+ f = b > f ? b : f;
336
333
  });
337
334
  });
338
- const m = u - 1, c = C(`0${m > 0 ? ".0" : "."}`, m), h = [];
339
- return i.forEach((v) => {
340
- R.foreach(v.range, (f, p) => {
341
- const _ = s.getValue(a, l, f, p);
342
- if (!_)
343
- h.push({
344
- row: f,
345
- col: p,
346
- pattern: c
335
+ const m = f - 1, l = C(`0${m > 0 ? ".0" : "."}`, m), u = [];
336
+ return i.forEach((_) => {
337
+ R.foreach(_.range, (h, v) => {
338
+ const g = n.getValue(c, a, h, v);
339
+ if (!g)
340
+ u.push({
341
+ row: h,
342
+ col: v,
343
+ pattern: l
347
344
  });
348
345
  else {
349
- const b = j(_.pattern);
350
- h.push({
351
- row: f,
352
- col: p,
353
- pattern: C(_.pattern, b - 1)
346
+ const b = j(g.pattern);
347
+ u.push({
348
+ row: h,
349
+ col: v,
350
+ pattern: C(g.pattern, b - 1)
354
351
  });
355
352
  }
356
353
  });
357
- }), await t.executeCommand($.id, { values: h });
354
+ }), await t.executeCommand($.id, { values: u });
358
355
  }
359
356
  }, ye = {
360
357
  id: "sheet.operation.close.numfmt.panel",
@@ -381,14 +378,11 @@ var Xe = { exports: {} }, _e = {};
381
378
  * LICENSE file in the root directory of this source tree.
382
379
  */
383
380
  var Xt = Wt, en = Symbol.for("react.element"), tn = Symbol.for("react.fragment"), nn = Object.prototype.hasOwnProperty, sn = Xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, rn = { key: !0, ref: !0, __self: !0, __source: !0 };
384
- function et(e, t, n) {
385
- var s, r = {}, i = null, o = null;
386
- n !== void 0 && (i = "" + n), t.key !== void 0 && (i = "" + t.key), t.ref !== void 0 && (o = t.ref);
387
- for (s in t)
388
- nn.call(t, s) && !rn.hasOwnProperty(s) && (r[s] = t[s]);
389
- if (e && e.defaultProps)
390
- for (s in t = e.defaultProps, t)
391
- r[s] === void 0 && (r[s] = t[s]);
381
+ function et(e, t, s) {
382
+ var n, r = {}, i = null, o = null;
383
+ s !== void 0 && (i = "" + s), t.key !== void 0 && (i = "" + t.key), t.ref !== void 0 && (o = t.ref);
384
+ for (n in t) nn.call(t, n) && !rn.hasOwnProperty(n) && (r[n] = t[n]);
385
+ if (e && e.defaultProps) for (n in t = e.defaultProps, t) r[n] === void 0 && (r[n] = t[n]);
392
386
  return { $$typeof: en, type: e, key: i, ref: o, props: r, _owner: sn.current };
393
387
  }
394
388
  _e.Fragment = tn;
@@ -425,11 +419,11 @@ const Ue = kt([]), Ne = [
425
419
  "₾",
426
420
  "₿"
427
421
  ];
428
- var on = Object.defineProperty, cn = Object.getOwnPropertyDescriptor, an = (e, t, n, s) => {
429
- for (var r = s > 1 ? void 0 : s ? cn(t, n) : t, i = e.length - 1, o; i >= 0; i--)
430
- (o = e[i]) && (r = (s ? o(t, n, r) : o(r)) || r);
431
- return s && r && on(t, n, r), r;
432
- }, ln = (e, t) => (n, s) => t(n, s, e);
422
+ var on = Object.defineProperty, cn = Object.getOwnPropertyDescriptor, an = (e, t, s, n) => {
423
+ for (var r = n > 1 ? void 0 : n ? cn(t, s) : t, i = e.length - 1, o; i >= 0; i--)
424
+ (o = e[i]) && (r = (n ? o(t, s, r) : o(r)) || r);
425
+ return n && r && on(t, s, r), r;
426
+ }, ln = (e, t) => (s, n) => t(s, n, e);
433
427
  let fe = class {
434
428
  constructor(e) {
435
429
  this._localStorageService = e;
@@ -438,37 +432,37 @@ let fe = class {
438
432
  return `userHabitController_${e}`;
439
433
  }
440
434
  async addHabit(e, t) {
441
- const n = this._getKey(e);
442
- return this._localStorageService.getItem(n).then((s) => {
443
- s || this._localStorageService.setItem(n, t);
435
+ const s = this._getKey(e);
436
+ return this._localStorageService.getItem(s).then((n) => {
437
+ n || this._localStorageService.setItem(s, t);
444
438
  });
445
439
  }
446
440
  markHabit(e, t) {
447
- const n = this._getKey(e);
448
- this._localStorageService.getItem(n).then((s) => {
449
- if (s) {
450
- const r = s.findIndex((i) => i === t);
451
- r > -1 && s.splice(r, 1), s.unshift(t), this._localStorageService.setItem(n, s);
441
+ const s = this._getKey(e);
442
+ this._localStorageService.getItem(s).then((n) => {
443
+ if (n) {
444
+ const r = n.findIndex((i) => i === t);
445
+ r > -1 && n.splice(r, 1), n.unshift(t), this._localStorageService.setItem(s, n);
452
446
  }
453
447
  });
454
448
  }
455
449
  async getHabit(e, t) {
456
- const n = this._getKey(e), s = await this._localStorageService.getItem(n);
457
- if (t && s) {
458
- const r = s.map((i, o, a) => {
459
- const l = a.length;
450
+ const s = this._getKey(e), n = await this._localStorageService.getItem(s);
451
+ if (t && n) {
452
+ const r = n.map((i, o, c) => {
453
+ const a = c.length;
460
454
  return {
461
455
  value: i,
462
- priority: l - o
456
+ priority: a - o
463
457
  };
464
458
  });
465
459
  return t.sort((i, o) => {
466
- var u, m;
467
- const a = ((u = r.find((c) => c.value === i)) == null ? void 0 : u.priority) || -1;
468
- return (((m = r.find((c) => c.value === o)) == null ? void 0 : m.priority) || -1) - a;
460
+ var f, m;
461
+ const c = ((f = r.find((l) => l.value === i)) == null ? void 0 : f.priority) || -1;
462
+ return (((m = r.find((l) => l.value === o)) == null ? void 0 : m.priority) || -1) - c;
469
463
  });
470
464
  }
471
- return s || [];
465
+ return n || [];
472
466
  }
473
467
  deleteHabit(e) {
474
468
  this._localStorageService.removeItem(e);
@@ -478,204 +472,204 @@ fe = an([
478
472
  ln(0, S(gt))
479
473
  ], fe);
480
474
  const Be = "numfmtCurrency", un = (e) => {
481
- const t = N(fe), [n, s] = I(Ne);
475
+ const t = N(fe), [s, n] = I(Ne);
482
476
  return xe(() => {
483
477
  t.addHabit("numfmtCurrency", []).then(() => {
484
478
  t.getHabit(Be, [...Ne]).then((i) => {
485
- s(i), e && e(i);
479
+ n(i), e && e(i);
486
480
  });
487
481
  });
488
- }, []), { userHabitCurrency: n, mark: (i) => {
482
+ }, []), { userHabitCurrency: s, mark: (i) => {
489
483
  t.markHabit(Be, i);
490
484
  } };
491
485
  }, mn = () => {
492
- const e = Ke([]), [t, n] = I({});
486
+ const e = Ke([]), [t, s] = I({});
493
487
  return xe(() => {
494
488
  e.current.forEach((r) => {
495
489
  r();
496
490
  }), e.current = [];
497
491
  }, [t]), (r) => {
498
- e.current.push(r), n({});
492
+ e.current.push(r), s({});
499
493
  };
500
- }, re = (e) => Ne.find((n) => e.includes(n)), dn = (e) => !!re(e) && e.startsWith("_("), fn = (e) => {
501
- const [t, n] = I(() => j(e.defaultPattern || "", 2)), s = Ye(Ue), [r, i] = I(() => re(e.defaultPattern) || s[0]), o = P(() => s.map((c) => ({ label: c, value: c })), []), l = N(E).t;
494
+ }, re = (e) => Ne.find((s) => e.includes(s)), dn = (e) => !!re(e) && e.startsWith("_("), fn = (e) => {
495
+ const [t, s] = I(() => j(e.defaultPattern || "", 2)), n = Ye(Ue), [r, i] = I(() => re(e.defaultPattern) || n[0]), o = P(() => n.map((l) => ({ label: l, value: l })), []), a = N(E).t;
502
496
  e.action.current = () => C(`_("${r}"* #,##0${t > 0 ? ".0" : ""}_)`, t);
503
- const u = (c) => {
504
- i(c), e.onChange(C(`_("${c}"* #,##0${t > 0 ? ".0" : ""}_)`, t));
505
- }, m = (c) => {
506
- const h = c || 0;
507
- n(h), e.onChange(C(`_("${r}"* #,##0${h > 0 ? ".0" : ""}_)`, h));
497
+ const f = (l) => {
498
+ i(l), e.onChange(C(`_("${l}"* #,##0${t > 0 ? ".0" : ""}_)`, t));
499
+ }, m = (l) => {
500
+ const u = l || 0;
501
+ s(u), e.onChange(C(`_("${r}"* #,##0${u > 0 ? ".0" : ""}_)`, u));
508
502
  };
509
503
  return /* @__PURE__ */ d.jsxs("div", { children: [
510
504
  /* @__PURE__ */ d.jsxs("div", { className: "m-t-16 options ", children: [
511
505
  /* @__PURE__ */ d.jsxs("div", { className: "option", children: [
512
- /* @__PURE__ */ d.jsx("div", { className: "label", children: l("sheet.numfmt.decimalLength") }),
506
+ /* @__PURE__ */ d.jsx("div", { className: "label", children: a("sheet.numfmt.decimalLength") }),
513
507
  /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ d.jsx(Oe, { value: t, max: 20, min: 0, onChange: m }) })
514
508
  ] }),
515
509
  /* @__PURE__ */ d.jsxs("div", { className: "option", children: [
516
- /* @__PURE__ */ d.jsx("div", { className: "label", children: l("sheet.numfmt.currencyType") }),
517
- /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ d.jsx(je, { onChange: u, options: o, value: r }) })
510
+ /* @__PURE__ */ d.jsx("div", { className: "label", children: a("sheet.numfmt.currencyType") }),
511
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ d.jsx(je, { onChange: f, options: o, value: r }) })
518
512
  ] })
519
513
  ] }),
520
- /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: l("sheet.numfmt.accountingDes") })
514
+ /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: a("sheet.numfmt.accountingDes") })
521
515
  ] });
522
516
  }, Ce = (e) => Je.map((t) => ({
523
517
  label: t.label(e),
524
518
  value: t.suffix(e),
525
519
  color: t.color
526
520
  })), tt = () => Zt.map((e) => ({ label: e.label, value: e.suffix })), nt = () => Qt.map((e) => ({ label: e.label, value: e.suffix, color: e.color })), hn = (e) => !!re(e) && !e.startsWith("_("), pn = (e) => {
527
- const n = N(E).t, s = Ye(Ue), [r, i] = I(() => re(e.defaultPattern) || s[0]), [o, a] = I(() => j(e.defaultPattern || "", 2)), [l, u] = I(() => {
528
- var _;
529
- const f = Ce(r);
530
- return ((_ = f.find((b) => ve(b.value, e.defaultPattern))) == null ? void 0 : _.value) || f[0].value;
531
- }), m = P(() => Ce(r), [r]), c = P(() => s.map((f) => ({ label: f, value: f })), [s]);
532
- e.action.current = () => C(l, o);
533
- const h = (f) => {
534
- i(f);
535
- const p = Ce(f)[0].value;
536
- u(p), e.onChange(C(p, o));
537
- }, g = (f) => {
538
- u(f), e.onChange(C(f, o));
539
- }, v = (f) => {
540
- a(f || 0), e.onChange(C(l, f || 0));
521
+ const s = N(E).t, n = Ye(Ue), [r, i] = I(() => re(e.defaultPattern) || n[0]), [o, c] = I(() => j(e.defaultPattern || "", 2)), [a, f] = I(() => {
522
+ var g;
523
+ const h = Ce(r);
524
+ return ((g = h.find((b) => ve(b.value, e.defaultPattern))) == null ? void 0 : g.value) || h[0].value;
525
+ }), m = P(() => Ce(r), [r]), l = P(() => n.map((h) => ({ label: h, value: h })), [n]);
526
+ e.action.current = () => C(a, o);
527
+ const u = (h) => {
528
+ i(h);
529
+ const v = Ce(h)[0].value;
530
+ f(v), e.onChange(C(v, o));
531
+ }, p = (h) => {
532
+ f(h), e.onChange(C(h, o));
533
+ }, _ = (h) => {
534
+ c(h || 0), e.onChange(C(a, h || 0));
541
535
  };
542
536
  return /* @__PURE__ */ d.jsxs("div", { children: [
543
537
  /* @__PURE__ */ d.jsxs("div", { className: "m-t-16 options ", children: [
544
538
  /* @__PURE__ */ d.jsxs("div", { className: "option", children: [
545
- /* @__PURE__ */ d.jsx("div", { className: "label", children: n("sheet.numfmt.decimalLength") }),
546
- /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ d.jsx(Oe, { value: o, max: 20, min: 0, onChange: v }) })
539
+ /* @__PURE__ */ d.jsx("div", { className: "label", children: s("sheet.numfmt.decimalLength") }),
540
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ d.jsx(Oe, { value: o, max: 20, min: 0, onChange: _ }) })
547
541
  ] }),
548
542
  /* @__PURE__ */ d.jsxs("div", { className: "option", children: [
549
- /* @__PURE__ */ d.jsx("div", { className: "label", children: n("sheet.numfmt.currencyType") }),
550
- /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ d.jsx(je, { onChange: h, options: c, value: r }) })
543
+ /* @__PURE__ */ d.jsx("div", { className: "label", children: s("sheet.numfmt.currencyType") }),
544
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ d.jsx(je, { onChange: u, options: l, value: r }) })
551
545
  ] })
552
546
  ] }),
553
- /* @__PURE__ */ d.jsx("div", { className: "m-t-16 label", children: n("sheet.numfmt.negType") }),
554
- /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx($e, { onChange: g, options: m, value: l }) }),
555
- /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: n("sheet.numfmt.currencyDes") })
547
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-16 label", children: s("sheet.numfmt.negType") }),
548
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx($e, { onChange: p, options: m, value: a }) }),
549
+ /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: s("sheet.numfmt.currencyDes") })
556
550
  ] });
557
551
  }, vn = (e) => {
558
552
  const t = x.getInfo(e);
559
- return tt().map((n) => n.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
553
+ return tt().map((s) => s.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
560
554
  }, _n = (e) => {
561
- const t = P(tt, []), s = N(E).t, [r, i] = I(() => {
555
+ const t = P(tt, []), n = N(E).t, [r, i] = I(() => {
562
556
  if (e.defaultPattern) {
563
- const a = t.find((l) => l.value === e.defaultPattern);
564
- if (a)
565
- return a.value;
557
+ const c = t.find((a) => a.value === e.defaultPattern);
558
+ if (c)
559
+ return c.value;
566
560
  }
567
561
  return t[0].value;
568
562
  });
569
563
  e.action.current = () => r;
570
- const o = (a) => {
571
- i(a), e.onChange(a);
564
+ const o = (c) => {
565
+ i(c), e.onChange(c);
572
566
  };
573
567
  return /* @__PURE__ */ d.jsxs("div", { children: [
574
- /* @__PURE__ */ d.jsx("div", { className: "m-t-16 label", children: s("sheet.numfmt.dateType") }),
568
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-16 label", children: n("sheet.numfmt.dateType") }),
575
569
  /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx($e, { value: r, options: t, onChange: o }) }),
576
- /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: s("sheet.numfmt.dateDes") })
570
+ /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: n("sheet.numfmt.dateDes") })
577
571
  ] });
578
572
  }, gn = (e) => !e, Sn = (e) => {
579
- const n = N(E).t;
580
- return e.action.current = () => "", /* @__PURE__ */ d.jsx("div", { children: /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: n("sheet.numfmt.generalDes") }) });
573
+ const s = N(E).t;
574
+ return e.action.current = () => "", /* @__PURE__ */ d.jsx("div", { children: /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: s("sheet.numfmt.generalDes") }) });
581
575
  }, bn = (e) => nt().some((t) => ve(t.value, e)), yn = (e) => {
582
- const t = N(E), n = P(nt, []), [s, r] = I(() => j(e.defaultPattern || "", 0)), [i, o] = I(() => {
583
- const c = n.find((h) => ve(h.value, e.defaultPattern || ""));
584
- return (c == null ? void 0 : c.value) || n[0].value;
585
- }), a = P(() => C(i, Number(s || 0)), [i, s]), l = P(() => !Jt(i), [i]), u = (c) => {
586
- r(c || 0), e.onChange(C(i, Number(c || 0)));
587
- }, m = (c) => {
588
- r(j(c, 0)), o(c), e.onChange(c);
576
+ const t = N(E), s = P(nt, []), [n, r] = I(() => j(e.defaultPattern || "", 0)), [i, o] = I(() => {
577
+ const l = s.find((u) => ve(u.value, e.defaultPattern || ""));
578
+ return (l == null ? void 0 : l.value) || s[0].value;
579
+ }), c = P(() => C(i, Number(n || 0)), [i, n]), a = P(() => !Jt(i), [i]), f = (l) => {
580
+ r(l || 0), e.onChange(C(i, Number(l || 0)));
581
+ }, m = (l) => {
582
+ r(j(l, 0)), o(l), e.onChange(l);
589
583
  };
590
- return e.action.current = () => a, /* @__PURE__ */ d.jsxs("div", { children: [
584
+ return e.action.current = () => c, /* @__PURE__ */ d.jsxs("div", { children: [
591
585
  /* @__PURE__ */ d.jsx("div", { className: "m-t-16 label", children: t.t("sheet.numfmt.decimalLength") }),
592
586
  /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx(
593
587
  Oe,
594
588
  {
595
- disabled: l,
596
- value: s,
589
+ disabled: a,
590
+ value: n,
597
591
  max: 20,
598
592
  min: 0,
599
- onChange: u
593
+ onChange: f
600
594
  }
601
595
  ) }),
602
596
  /* @__PURE__ */ d.jsxs("div", { className: "m-t-16 label", children: [
603
597
  " ",
604
598
  t.t("sheet.numfmt.negType")
605
599
  ] }),
606
- /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx($e, { onChange: m, options: n, value: i }) }),
600
+ /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx($e, { onChange: m, options: s, value: i }) }),
607
601
  /* @__PURE__ */ d.jsx("div", { className: "describe m-t-14", children: t.t("sheet.numfmt.thousandthPercentileDes") })
608
602
  ] });
609
603
  }, Cn = (e) => {
610
- const { defaultValue: t, defaultPattern: n, row: s, col: r } = e.value, i = N(E), o = Ke(() => ""), a = i.t, l = mn(), u = P(
604
+ const { defaultValue: t, defaultPattern: s, row: n, col: r } = e.value, i = N(E), o = Ke(() => ""), c = i.t, a = mn(), f = P(
611
605
  () => [
612
606
  { label: "sheet.numfmt.general", component: Sn },
613
607
  { label: "sheet.numfmt.accounting", component: fn },
614
608
  { label: "sheet.numfmt.currency", component: pn },
615
609
  { label: "sheet.numfmt.date", component: _n },
616
610
  { label: "sheet.numfmt.thousandthPercentile", component: yn }
617
- ].map((y) => ({ ...y, label: a(y.label) })),
611
+ ].map((y) => ({ ...y, label: c(y.label) })),
618
612
  []
619
- ), [m, c] = I(_), [h, g] = I(() => `${s}_${r}`), { mark: v, userHabitCurrency: f } = un(() => g(`${s}_${r}_userCurrency'`)), p = P(() => {
613
+ ), [m, l] = I(g), [u, p] = I(() => `${n}_${r}`), { mark: _, userHabitCurrency: h } = un(() => p(`${n}_${r}_userCurrency'`)), v = P(() => {
620
614
  var y;
621
- return (y = u.find((L) => L.label === m)) == null ? void 0 : y.component;
615
+ return (y = f.find((L) => L.label === m)) == null ? void 0 : y.component;
622
616
  }, [m]);
623
- function _() {
624
- return [gn, dn, hn, vn, bn].reduce((L, lt, ut) => L || (lt(n) ? u[ut].label : ""), "") || u[0].label;
617
+ function g() {
618
+ return [gn, dn, hn, vn, bn].reduce((L, lt, ut) => L || (lt(s) ? f[ut].label : ""), "") || f[0].label;
625
619
  }
626
- const b = u.map((y) => ({
620
+ const b = f.map((y) => ({
627
621
  label: y.label,
628
622
  value: y.label
629
623
  })), F = (y) => {
630
- c(y), l(() => e.onChange({ type: "change", value: o.current() || "" }));
624
+ l(y), a(() => e.onChange({ type: "change", value: o.current() || "" }));
631
625
  }, ge = (y) => {
632
626
  e.onChange({ type: "change", value: y });
633
627
  }, Se = () => {
634
628
  const y = o.current() || "", L = re(y);
635
- L && v(L), e.onChange({ type: "confirm", value: y });
629
+ L && _(L), e.onChange({ type: "confirm", value: y });
636
630
  }, be = () => {
637
631
  e.onChange({ type: "cancel", value: "" });
638
632
  }, at = {
639
633
  onChange: ge,
640
634
  defaultValue: t,
641
- defaultPattern: n,
635
+ defaultPattern: s,
642
636
  action: o
643
637
  };
644
638
  return xe(() => {
645
- c(_()), g(`${s}_${r}`);
646
- }, [s, r]), /* @__PURE__ */ d.jsxs("div", { className: "numfmt-panel p-b-20", children: [
639
+ l(g()), p(`${n}_${r}`);
640
+ }, [n, r]), /* @__PURE__ */ d.jsxs("div", { className: "numfmt-panel p-b-20", children: [
647
641
  /* @__PURE__ */ d.jsxs("div", { children: [
648
- /* @__PURE__ */ d.jsx("div", { className: "label m-t-14", children: a("sheet.numfmt.numfmtType") }),
642
+ /* @__PURE__ */ d.jsx("div", { className: "label m-t-14", children: c("sheet.numfmt.numfmtType") }),
649
643
  /* @__PURE__ */ d.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ d.jsx(je, { onChange: F, options: b, value: m }) }),
650
- /* @__PURE__ */ d.jsx("div", { children: p && /* @__PURE__ */ d.jsx(Ue.Provider, { value: f, children: /* @__PURE__ */ Gt(p, { ...at, key: h }) }) })
644
+ /* @__PURE__ */ d.jsx("div", { children: v && /* @__PURE__ */ d.jsx(Ue.Provider, { value: h, children: /* @__PURE__ */ Gt(v, { ...at, key: u }) }) })
651
645
  ] }),
652
646
  /* @__PURE__ */ d.jsxs("div", { className: "btn-list m-t-14 m-b-20", children: [
653
- /* @__PURE__ */ d.jsx(Ae, { size: "small", onClick: be, className: "m-r-12", children: a("sheet.numfmt.cancel") }),
654
- /* @__PURE__ */ d.jsx(Ae, { type: "primary", size: "small", onClick: Se, children: a("sheet.numfmt.confirm") })
647
+ /* @__PURE__ */ d.jsx(Ae, { size: "small", onClick: be, className: "m-r-12", children: c("sheet.numfmt.cancel") }),
648
+ /* @__PURE__ */ d.jsx(Ae, { type: "primary", size: "small", onClick: Se, children: c("sheet.numfmt.confirm") })
655
649
  ] })
656
650
  ] });
657
651
  }, st = {
658
652
  id: "sheet.command.numfmt.set.percent",
659
653
  type: w.COMMAND,
660
654
  handler: async (e) => {
661
- const t = e.get(O), s = e.get(U).getSelections();
662
- if (!s || !s.length)
655
+ const t = e.get(O), n = e.get(U).getSelections();
656
+ if (!n || !n.length)
663
657
  return !1;
664
658
  const r = [], i = "0%";
665
- return s.forEach((a) => {
666
- R.foreach(a.range, (l, u) => {
667
- r.push({ row: l, col: u, pattern: i, type: "percent" });
659
+ return n.forEach((c) => {
660
+ R.foreach(c.range, (a, f) => {
661
+ r.push({ row: a, col: f, pattern: i, type: "percent" });
668
662
  });
669
663
  }), await t.executeCommand($.id, { values: r });
670
664
  }
671
665
  };
672
- var Tn = Object.defineProperty, In = Object.getOwnPropertyDescriptor, En = (e, t, n, s) => {
673
- for (var r = s > 1 ? void 0 : s ? In(t, n) : t, i = e.length - 1, o; i >= 0; i--)
674
- (o = e[i]) && (r = (s ? o(t, n, r) : o(r)) || r);
675
- return s && r && Tn(t, n, r), r;
676
- }, M = (e, t) => (n, s) => t(n, s, e);
666
+ var Tn = Object.defineProperty, In = Object.getOwnPropertyDescriptor, En = (e, t, s, n) => {
667
+ for (var r = n > 1 ? void 0 : n ? In(t, s) : t, i = e.length - 1, o; i >= 0; i--)
668
+ (o = e[i]) && (r = (n ? o(t, s, r) : o(r)) || r);
669
+ return n && r && Tn(t, s, r), r;
670
+ }, M = (e, t) => (s, n) => t(s, n, e);
677
671
  let ce = class extends z {
678
- constructor(t, n, s, r, i, o, a, l, u, m) {
672
+ constructor(t, s, n, r, i, o, c, a, f, m) {
679
673
  super();
680
674
  /**
681
675
  * If _previewPattern is null ,the realTimeRenderingInterceptor will skip and if it is '',realTimeRenderingInterceptor will clear numfmt.
@@ -685,59 +679,61 @@ let ce = class extends z {
685
679
  */
686
680
  ie(this, "_previewPattern", "");
687
681
  ie(this, "_sidebarDisposable", null);
688
- this._sheetInterceptorService = t, this._themeService = n, this._univerInstanceService = s, this._commandService = r, this._selectionManagerService = i, this._renderManagerService = o, this._numfmtService = a, this._componentManager = l, this._sidebarService = u, this._localeService = m, this._initRealTimeRenderingInterceptor(), this._initPanel(), this._initCommands(), this._initCloseListener(), this._commandExecutedListener();
682
+ this._sheetInterceptorService = t, this._themeService = s, this._univerInstanceService = n, this._commandService = r, this._selectionManagerService = i, this._renderManagerService = o, this._numfmtService = c, this._componentManager = a, this._sidebarService = f, this._localeService = m, this._initRealTimeRenderingInterceptor(), this._initPanel(), this._initCommands(), this._initCloseListener(), this._commandExecutedListener();
689
683
  }
690
684
  openPanel() {
691
- const t = this._sidebarService, n = this._selectionManagerService, s = this._commandService, r = this._univerInstanceService, i = this._numfmtService, o = this._localeService, l = (n.getSelectionRanges() || [])[0];
692
- if (!l)
685
+ const t = this._sidebarService, s = this._selectionManagerService, n = this._commandService, r = this._univerInstanceService, i = this._numfmtService, o = this._localeService, a = (s.getSelectionRanges() || [])[0];
686
+ if (!a)
687
+ return !1;
688
+ const f = r.getCurrentUnitForType(T.UNIVER_SHEET), m = f.getActiveSheet();
689
+ if (!m)
693
690
  return !1;
694
- const u = r.getCurrentUnitForType(T.UNIVER_SHEET), m = u.getActiveSheet(), c = m.getCellRaw(l.startRow, l.startColumn), h = i.getValue(
695
- u.getUnitId(),
691
+ const l = m.getCellRaw(a.startRow, a.startColumn), u = i.getValue(
692
+ f.getUnitId(),
696
693
  m.getSheetId(),
697
- l.startRow,
698
- l.startColumn
694
+ a.startRow,
695
+ a.startColumn
699
696
  );
700
- let g = "";
701
- h && (g = h.pattern);
702
- const v = (c == null ? void 0 : c.t) === V.NUMBER ? c.v : 12345678, f = {
703
- onChange: (p) => {
704
- if (p.type === "change")
705
- this._previewPattern = p.value, this._forceUpdate();
706
- else if (p.type === "confirm") {
707
- const _ = n.getSelectionRanges() || [], b = { values: [] }, F = me(p.value);
708
- _.forEach((ge) => {
697
+ let p = "";
698
+ u && (p = u.pattern);
699
+ const _ = (l == null ? void 0 : l.t) === V.NUMBER ? l.v : 12345678, h = {
700
+ onChange: (v) => {
701
+ if (v.type === "change")
702
+ this._previewPattern = v.value, this._forceUpdate();
703
+ else if (v.type === "confirm") {
704
+ const g = s.getSelectionRanges() || [], b = { values: [] }, F = me(v.value);
705
+ g.forEach((ge) => {
709
706
  R.foreach(ge, (Se, be) => {
710
707
  b.values.push({
711
708
  row: Se,
712
709
  col: be,
713
- pattern: p.value,
710
+ pattern: v.value,
714
711
  type: F
715
712
  });
716
713
  });
717
- }), s.executeCommand($.id, b), t.close();
718
- } else
719
- p.type === "cancel" && t.close();
714
+ }), n.executeCommand($.id, b), t.close();
715
+ } else v.type === "cancel" && t.close();
720
716
  },
721
- value: { defaultPattern: g, defaultValue: v, row: l.startRow, col: l.startColumn }
717
+ value: { defaultPattern: p, defaultValue: _, row: a.startRow, col: a.startColumn }
722
718
  };
723
719
  return this._sidebarDisposable = t.open({
724
720
  header: { title: o.t("sheet.numfmt.title") },
725
721
  children: {
726
722
  label: Ee,
727
- ...f
723
+ ...h
728
724
  // need passthrough to react props.
729
725
  },
730
726
  onClose: () => {
731
- this._forceUpdate(), s.executeCommand(ye.id);
727
+ this._forceUpdate(), n.executeCommand(ye.id);
732
728
  }
733
729
  }), !0;
734
730
  }
735
731
  _forceUpdate(t) {
736
- var s;
737
- const n = this._renderManagerService.getRenderById(
732
+ var n;
733
+ const s = this._renderManagerService.getRenderById(
738
734
  t != null ? t : this._univerInstanceService.getCurrentUnitForType(T.UNIVER_SHEET).getUnitId()
739
735
  );
740
- n == null || n.with(Nt).reCalculate(), (s = n == null ? void 0 : n.mainComponent) == null || s.makeDirty();
736
+ s == null || s.with(Nt).reCalculate(), (n = s == null ? void 0 : s.mainComponent) == null || n.makeDirty();
741
737
  }
742
738
  _initCommands() {
743
739
  [
@@ -756,23 +752,23 @@ let ce = class extends z {
756
752
  this._componentManager.register(Ee, Cn);
757
753
  }
758
754
  _initRealTimeRenderingInterceptor() {
759
- const t = new k((s) => {
755
+ const t = new k((n) => {
760
756
  this._commandService.onCommandExecuted((r) => {
761
- r.id === de.id && s.next(!0), r.id === ye.id && s.next(!1);
757
+ r.id === de.id && n.next(!0), r.id === ye.id && n.next(!1);
762
758
  });
763
- }), n = $t([
759
+ }), s = $t([
764
760
  t,
765
761
  this._selectionManagerService.selectionMoveEnd$.pipe(
766
- Vt((s) => s ? s.map((r) => r.range) : [])
762
+ Vt((n) => n ? n.map((r) => r.range) : [])
767
763
  )
768
764
  ]);
769
765
  this.disposeWithMe(
770
766
  Ie(
771
- n.pipe(
767
+ s.pipe(
772
768
  Bt(
773
- ([s, r]) => new k((i) => {
769
+ ([n, r]) => new k((i) => {
774
770
  const o = new St();
775
- return s && r.length && i.next({ selectionRanges: r, disposableCollection: o }), () => {
771
+ return n && r.length && i.next({ selectionRanges: r, disposableCollection: o }), () => {
776
772
  o.dispose();
777
773
  };
778
774
  })
@@ -780,40 +776,40 @@ let ce = class extends z {
780
776
  Ht(() => {
781
777
  this._previewPattern = null;
782
778
  })
783
- ).subscribe(({ disposableCollection: s, selectionRanges: r }) => {
784
- var o, a;
779
+ ).subscribe(({ disposableCollection: n, selectionRanges: r }) => {
780
+ var o, c;
785
781
  const i = this._univerInstanceService.getCurrentUnitForType(T.UNIVER_SHEET);
786
- this.openPanel(), s.add(
782
+ this.openPanel(), n.add(
787
783
  this._sheetInterceptorService.intercept(Ge.CELL_CONTENT, {
788
784
  priority: 99,
789
- handler: (l, u, m) => {
790
- const { row: c, col: h } = u, g = m(l) || {};
785
+ handler: (a, f, m) => {
786
+ const { row: l, col: u } = f, p = m(a) || {};
791
787
  if (r.find(
792
- (v) => v.startColumn <= h && v.endColumn >= h && v.startRow <= c && v.endRow >= c
788
+ (_) => _.startColumn <= u && _.endColumn >= u && _.startRow <= l && _.endRow >= l
793
789
  )) {
794
- const v = u.worksheet.getCellRaw(c, h), f = v == null ? void 0 : v.v, p = v == null ? void 0 : v.t;
795
- if (f == null || p !== V.NUMBER || this._previewPattern === null)
796
- return g;
797
- const _ = we(this._previewPattern, f, this._localeService.getCurrentLocale());
798
- if (_.color) {
799
- const F = this._themeService.getCurrentTheme()[`${_.color}500`];
790
+ const _ = f.worksheet.getCellRaw(l, u), h = _ == null ? void 0 : _.v, v = _ == null ? void 0 : _.t;
791
+ if (h == null || v !== V.NUMBER || this._previewPattern === null)
792
+ return p;
793
+ const g = we(this._previewPattern, h, this._localeService.getCurrentLocale());
794
+ if (g.color) {
795
+ const F = this._themeService.getCurrentTheme()[`${g.color}500`];
800
796
  return {
801
- ...g,
802
- v: _.result,
797
+ ...p,
798
+ v: g.result,
803
799
  t: V.STRING,
804
800
  s: { cl: { rgb: F } }
805
801
  };
806
802
  }
807
803
  return {
808
- ...g,
809
- v: _.result,
804
+ ...p,
805
+ v: g.result,
810
806
  t: V.STRING
811
807
  };
812
808
  }
813
- return g;
809
+ return p;
814
810
  }
815
811
  })
816
- ), (a = (o = this._renderManagerService.getRenderById(i.getUnitId())) == null ? void 0 : o.mainComponent) == null || a.makeDirty();
812
+ ), (c = (o = this._renderManagerService.getRenderById(i.getUnitId())) == null ? void 0 : o.mainComponent) == null || c.makeDirty();
817
813
  })
818
814
  )
819
815
  );
@@ -821,21 +817,21 @@ let ce = class extends z {
821
817
  _commandExecutedListener() {
822
818
  const t = [pe.id, Y.id];
823
819
  this.disposeWithMe(
824
- new k((n) => {
825
- const s = this._commandService.onCommandExecuted((r) => {
820
+ new k((s) => {
821
+ const n = this._commandService.onCommandExecuted((r) => {
826
822
  if (t.includes(r.id)) {
827
823
  const i = r.params;
828
- n.next(i.unitId);
824
+ s.next(i.unitId);
829
825
  }
830
826
  });
831
- return () => s.dispose();
832
- }).pipe(Ft(16)).subscribe((n) => this._forceUpdate(n))
827
+ return () => n.dispose();
828
+ }).pipe(Ft(16)).subscribe((s) => this._forceUpdate(s))
833
829
  );
834
830
  }
835
831
  _initCloseListener() {
836
832
  this._univerInstanceService.getCurrentTypeOfUnit$(T.UNIVER_SHEET).subscribe((t) => {
837
- var n;
838
- t || ((n = this._sidebarDisposable) == null || n.dispose(), this._sidebarDisposable = null);
833
+ var s;
834
+ t || ((s = this._sidebarDisposable) == null || s.dispose(), this._sidebarDisposable = null);
839
835
  });
840
836
  }
841
837
  };
@@ -852,15 +848,15 @@ ce = En([
852
848
  M(8, Lt),
853
849
  M(9, S(E))
854
850
  ], ce);
855
- var Nn = Object.defineProperty, Mn = Object.getOwnPropertyDescriptor, Pn = (e, t, n, s) => {
856
- for (var r = s > 1 ? void 0 : s ? Mn(t, n) : t, i = e.length - 1, o; i >= 0; i--)
857
- (o = e[i]) && (r = (s ? o(t, n, r) : o(r)) || r);
858
- return s && r && Nn(t, n, r), r;
859
- }, W = (e, t) => (n, s) => t(n, s, e);
851
+ var Nn = Object.defineProperty, Mn = Object.getOwnPropertyDescriptor, Pn = (e, t, s, n) => {
852
+ for (var r = n > 1 ? void 0 : n ? Mn(t, s) : t, i = e.length - 1, o; i >= 0; i--)
853
+ (o = e[i]) && (r = (n ? o(t, s, r) : o(r)) || r);
854
+ return n && r && Nn(t, s, r), r;
855
+ }, W = (e, t) => (s, n) => t(s, n, e);
860
856
  const Rn = () => {
861
857
  let e = [];
862
858
  return {
863
- add: (r, i, o, a, l) => e.push({ unitId: r, subUnitId: i, row: o, col: a, value: l }),
859
+ add: (r, i, o, c, a) => e.push({ unitId: r, subUnitId: i, row: o, col: c, value: a }),
864
860
  getEffects: () => e,
865
861
  clean: () => {
866
862
  e = [];
@@ -868,11 +864,11 @@ const Rn = () => {
868
864
  };
869
865
  };
870
866
  let ae = class extends z {
871
- constructor(t, n, s, r, i) {
867
+ constructor(t, s, n, r, i) {
872
868
  super();
873
869
  // collect effect mutations when edit end and push this to commands stack in next commands progress
874
870
  ie(this, "_collectEffectMutation", Rn());
875
- this._sheetInterceptorService = t, this._numfmtService = n, this._univerInstanceService = s, this._injector = r, this._editorBridgeService = i, this._initInterceptorEditorStart(), this._initInterceptorEditorEnd(), this._initInterceptorCommands();
871
+ this._sheetInterceptorService = t, this._numfmtService = s, this._univerInstanceService = n, this._injector = r, this._editorBridgeService = i, this._initInterceptorEditorStart(), this._initInterceptorEditorEnd(), this._initInterceptorCommands();
876
872
  }
877
873
  _initInterceptorEditorStart() {
878
874
  this.disposeWithMe(
@@ -880,10 +876,10 @@ let ae = class extends z {
880
876
  this._editorBridgeService.interceptor.intercept(
881
877
  this._editorBridgeService.interceptor.getInterceptPoints().BEFORE_CELL_EDIT,
882
878
  {
883
- handler: (t, n, s) => {
884
- const r = n.row, i = n.col, o = this._numfmtService.getValue(
885
- n.unitId,
886
- n.subUnitId,
879
+ handler: (t, s, n) => {
880
+ const r = s.row, i = s.col, o = this._numfmtService.getValue(
881
+ s.unitId,
882
+ s.subUnitId,
887
883
  r,
888
884
  i
889
885
  );
@@ -894,14 +890,14 @@ let ae = class extends z {
894
890
  case "currency":
895
891
  case "grouped":
896
892
  case "number":
897
- return n.worksheet.getCellRaw(r, i);
893
+ return s.worksheet.getCellRaw(r, i);
898
894
  case "date":
899
895
  case "time":
900
896
  case "datetime":
901
897
  default:
902
- return s && s(t);
898
+ return n && n(t);
903
899
  }
904
- return s(t);
900
+ return n(t);
905
901
  }
906
902
  }
907
903
  )
@@ -919,42 +915,41 @@ let ae = class extends z {
919
915
  this._editorBridgeService.interceptor.intercept(
920
916
  this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT,
921
917
  {
922
- handler: (t, n, s) => {
918
+ handler: (t, s, n) => {
923
919
  var m;
924
920
  this._collectEffectMutation.clean();
925
921
  const r = this._numfmtService.getValue(
926
- n.unitId,
927
- n.subUnitId,
928
- n.row,
929
- n.col
922
+ s.unitId,
923
+ s.subUnitId,
924
+ s.row,
925
+ s.col
930
926
  ), i = (m = r && me(r.pattern)) != null ? m : "", o = () => {
931
927
  r && this._collectEffectMutation.add(
932
- n.unitId,
933
- n.subUnitId,
934
- n.row,
935
- n.col,
928
+ s.unitId,
929
+ s.subUnitId,
930
+ s.row,
931
+ s.col,
936
932
  null
937
933
  );
938
934
  };
939
935
  if (!(t != null && t.v))
940
- return s(t);
941
- const a = String(t.v), l = x.parseDate(a) || x.parseTime(a);
942
- if (!!l) {
943
- if (l && l.z) {
944
- const c = Number(l.v);
936
+ return n(t);
937
+ const c = String(t.v), a = x.parseDate(c) || x.parseTime(c);
938
+ if (!!a) {
939
+ if (a && a.z) {
940
+ const l = Number(a.v);
945
941
  return this._collectEffectMutation.add(
946
- n.unitId,
947
- n.subUnitId,
948
- n.row,
949
- n.col,
942
+ s.unitId,
943
+ s.subUnitId,
944
+ s.row,
945
+ s.col,
950
946
  {
951
- pattern: l.z
947
+ pattern: a.z
952
948
  }
953
- ), { ...t, v: c, t: V.NUMBER };
949
+ ), { ...t, v: l, t: V.NUMBER };
954
950
  }
955
- } else
956
- (["date", "time", "datetime"].includes(i) || !xn(a)) && o();
957
- return s(t);
951
+ } else (["date", "time", "datetime"].includes(i) || !xn(c)) && o();
952
+ return n(t);
958
953
  }
959
954
  }
960
955
  )
@@ -965,52 +960,59 @@ let ae = class extends z {
965
960
  const t = this;
966
961
  this.disposeWithMe(
967
962
  this._sheetInterceptorService.interceptCommand({
968
- getMutations(n) {
969
- switch (n.id) {
963
+ getMutations(s) {
964
+ var n;
965
+ switch (s.id) {
970
966
  case Tt.id: {
971
- const s = t._univerInstanceService.getCurrentUnitForType(T.UNIVER_SHEET), r = s.getUnitId(), i = s.getActiveSheet().getSheetId(), o = t._collectEffectMutation.getEffects();
972
- if (!o.length)
967
+ const r = t._univerInstanceService.getCurrentUnitForType(T.UNIVER_SHEET), i = r.getUnitId(), o = (n = r.getActiveSheet()) == null ? void 0 : n.getSheetId();
968
+ if (!o)
969
+ return {
970
+ redos: [],
971
+ undos: []
972
+ };
973
+ const c = t._collectEffectMutation.getEffects();
974
+ if (!c.length)
973
975
  return {
974
976
  redos: [],
975
977
  undos: []
976
978
  };
977
- const a = o.filter((c) => {
978
- var h;
979
- return !!((h = c.value) != null && h.pattern);
980
- }).map((c) => ({
981
- row: c.row,
982
- col: c.col,
983
- pattern: c.value.pattern
984
- })), l = o.filter((c) => {
985
- var h;
986
- return !((h = c.value) != null && h.pattern);
987
- }).map((c) => ({
988
- startRow: c.row,
989
- endColumn: c.col,
990
- startColumn: c.col,
991
- endRow: c.row
992
- })), u = [], m = [];
979
+ const a = c.filter((u) => {
980
+ var p;
981
+ return !!((p = u.value) != null && p.pattern);
982
+ }).map((u) => ({
983
+ row: u.row,
984
+ col: u.col,
985
+ pattern: u.value.pattern
986
+ })), f = c.filter((u) => {
987
+ var p;
988
+ return !((p = u.value) != null && p.pattern);
989
+ }).map((u) => ({
990
+ startRow: u.row,
991
+ endColumn: u.col,
992
+ startColumn: u.col,
993
+ endRow: u.row
994
+ })), m = [], l = [];
993
995
  if (a) {
994
- const c = {
996
+ const u = {
995
997
  id: Y.id,
996
- params: Fe(r, i, a)
998
+ params: Fe(i, o, a)
997
999
  };
998
- u.push(c), m.push(...We(t._injector, c.params));
1000
+ m.push(u), l.push(...We(t._injector, u.params));
999
1001
  }
1000
- if (l) {
1001
- const c = {
1002
+ if (f) {
1003
+ const u = {
1002
1004
  id: pe.id,
1003
1005
  params: {
1004
- unitId: r,
1005
- subUnitId: i,
1006
- ranges: l
1006
+ unitId: i,
1007
+ subUnitId: o,
1008
+ ranges: f
1007
1009
  }
1008
1010
  };
1009
- u.push(c), m.push(...ke(t._injector, c.params));
1011
+ m.push(u), l.push(...ke(t._injector, u.params));
1010
1012
  }
1011
1013
  return {
1012
- redos: u,
1013
- undos: m.reverse()
1014
+ redos: m,
1015
+ undos: l.reverse()
1014
1016
  };
1015
1017
  }
1016
1018
  }
@@ -1034,11 +1036,11 @@ ae = Pn([
1034
1036
  function xn(e) {
1035
1037
  return /^-?\d+(\.\d+)?$/.test(e);
1036
1038
  }
1037
- var On = Object.defineProperty, jn = Object.getOwnPropertyDescriptor, $n = (e, t, n, s) => {
1038
- for (var r = s > 1 ? void 0 : s ? jn(t, n) : t, i = e.length - 1, o; i >= 0; i--)
1039
- (o = e[i]) && (r = (s ? o(t, n, r) : o(r)) || r);
1040
- return s && r && On(t, n, r), r;
1041
- }, wn = (e, t) => (n, s) => t(n, s, e);
1039
+ var On = Object.defineProperty, jn = Object.getOwnPropertyDescriptor, $n = (e, t, s, n) => {
1040
+ for (var r = n > 1 ? void 0 : n ? jn(t, s) : t, i = e.length - 1, o; i >= 0; i--)
1041
+ (o = e[i]) && (r = (n ? o(t, s, r) : o(r)) || r);
1042
+ return n && r && On(t, s, r), r;
1043
+ }, wn = (e, t) => (s, n) => t(s, n, e);
1042
1044
  let le = class extends z {
1043
1045
  constructor(e) {
1044
1046
  super(), this._localeService = e;
@@ -1102,41 +1104,41 @@ const ue = [
1102
1104
  pattern: ""
1103
1105
  }
1104
1106
  ], rt = "sheet.numfmt.moreNumfmtType", it = "sheet.numfmt.moreNumfmtType.options", Dn = (e) => {
1105
- var s;
1106
- const t = N(E), n = (s = e.value) != null ? s : t.t("sheet.numfmt.general");
1107
- return /* @__PURE__ */ d.jsx("span", { className: "more-numfmt-type", children: n });
1107
+ var n;
1108
+ const t = N(E), s = (n = e.value) != null ? n : t.t("sheet.numfmt.general");
1109
+ return /* @__PURE__ */ d.jsx("span", { className: "more-numfmt-type", children: s });
1108
1110
  }, Un = () => {
1109
- const e = N(O), t = N(E), n = zt(), s = N(U), r = (a) => {
1110
- const l = s.getLast();
1111
- if (!l)
1111
+ const e = N(O), t = N(E), s = zt(), n = N(U), r = (c) => {
1112
+ const a = n.getLast();
1113
+ if (!a)
1112
1114
  return;
1113
- const u = n.get(Ut), m = l.range, c = [];
1114
- R.foreach(m, (h, g) => {
1115
- a ? c.push({ row: h, col: g, pattern: a, type: me(a) }) : c.push({ row: h, col: g });
1116
- }), e.executeCommand($.id, { values: c }), u.focus();
1117
- }, i = (a) => {
1118
- if (a === 0)
1115
+ const f = s.get(Ut), m = a.range, l = [];
1116
+ R.foreach(m, (u, p) => {
1117
+ c ? l.push({ row: u, col: p, pattern: c, type: me(c) }) : l.push({ row: u, col: p });
1118
+ }), e.executeCommand($.id, { values: l }), f.focus();
1119
+ }, i = (c) => {
1120
+ if (c === 0)
1119
1121
  r(null);
1120
- else if (a === ue.length - 1)
1122
+ else if (c === ue.length - 1)
1121
1123
  e.executeCommand(de.id);
1122
1124
  else {
1123
- const l = ue[a];
1124
- l.pattern && r(l.pattern);
1125
+ const a = ue[c];
1126
+ a.pattern && r(a.pattern);
1125
1127
  }
1126
1128
  }, o = 1220;
1127
- return /* @__PURE__ */ d.jsx("div", { className: "more-numfmt-type-options", children: ue.map((a, l) => a === "|" ? /* @__PURE__ */ d.jsx("div", { className: "line m-t-4", onClick: (u) => u.stopPropagation() }, l) : /* @__PURE__ */ d.jsxs(
1129
+ return /* @__PURE__ */ d.jsx("div", { className: "more-numfmt-type-options", children: ue.map((c, a) => c === "|" ? /* @__PURE__ */ d.jsx("div", { className: "line m-t-4", onClick: (f) => f.stopPropagation() }, a) : /* @__PURE__ */ d.jsxs(
1128
1130
  "div",
1129
1131
  {
1130
1132
  className: "option-item m-t-4",
1131
1133
  onClick: () => {
1132
- i(l);
1134
+ i(a);
1133
1135
  },
1134
1136
  children: [
1135
- /* @__PURE__ */ d.jsx("div", { children: t.t(a.label) }),
1136
- /* @__PURE__ */ d.jsx("div", { className: "m-l-26", children: a.pattern ? we(a.pattern || "", o, t.getCurrentLocale()).result : "" })
1137
+ /* @__PURE__ */ d.jsx("div", { children: t.t(c.label) }),
1138
+ /* @__PURE__ */ d.jsx("div", { className: "m-l-26", children: c.pattern ? we(c.pattern || "", o, t.getCurrentLocale()).result : "" })
1137
1139
  ]
1138
1140
  },
1139
- l
1141
+ a
1140
1142
  )) });
1141
1143
  }, Ln = (e) => ({
1142
1144
  icon: "RmbSingle",
@@ -1179,27 +1181,27 @@ const ue = [
1179
1181
  hidden$: se(e, T.UNIVER_SHEET),
1180
1182
  disabled$: X(e, { workbookTypes: [q], worksheetTypes: [J, Z], rangeTypes: [Q] })
1181
1183
  }), Hn = (e) => {
1182
- const t = e.get(H), n = e.get(D), s = e.get(O), r = e.get(E), i = e.get(U), o = Pt(n, "", ({ workbook: a, worksheet: l }) => new k(
1183
- (u) => wt(
1184
+ const t = e.get(H), s = e.get(D), n = e.get(O), r = e.get(E), i = e.get(U), o = Pt(s, "", ({ workbook: c, worksheet: a }) => new k(
1185
+ (f) => wt(
1184
1186
  i.selectionMoveEnd$,
1185
1187
  new k((m) => {
1186
- const c = [pe.id, Y.id], h = s.onCommandExecuted((g) => {
1187
- c.includes(g.id) && m.next(null);
1188
+ const l = [pe.id, Y.id], u = n.onCommandExecuted((p) => {
1189
+ l.includes(p.id) && m.next(null);
1188
1190
  });
1189
- return () => h.dispose();
1191
+ return () => u.dispose();
1190
1192
  })
1191
1193
  ).subscribe(() => {
1192
1194
  const m = i.getSelections();
1193
1195
  if (m && m[0]) {
1194
- const c = m[0].range, h = c.startRow, g = c.startColumn, v = t.getValue(a.getUnitId(), l.getSheetId(), h, g), f = v == null ? void 0 : v.pattern;
1195
- let p = r.t("sheet.numfmt.general");
1196
- if (f) {
1197
- const _ = ue.filter((b) => typeof b == "object" && b.pattern).find(
1198
- (b) => ve(f, b.pattern)
1196
+ const l = m[0].range, u = l.startRow, p = l.startColumn, _ = t.getValue(c.getUnitId(), a.getSheetId(), u, p), h = _ == null ? void 0 : _.pattern;
1197
+ let v = r.t("sheet.numfmt.general");
1198
+ if (h) {
1199
+ const g = ue.filter((b) => typeof b == "object" && b.pattern).find(
1200
+ (b) => ve(h, b.pattern)
1199
1201
  );
1200
- _ && typeof _ == "object" && _.pattern ? p = r.t(_.label) : p = r.t("sheet.numfmt.moreFmt");
1202
+ g && typeof g == "object" && g.pattern ? v = r.t(g.label) : v = r.t("sheet.numfmt.moreFmt");
1201
1203
  }
1202
- u.next(p);
1204
+ f.next(v);
1203
1205
  }
1204
1206
  })
1205
1207
  ));
@@ -1223,15 +1225,15 @@ const ue = [
1223
1225
  disabled$: X(e, { workbookTypes: [q], worksheetTypes: [Z, J], rangeTypes: [Q] })
1224
1226
  };
1225
1227
  };
1226
- var Fn = Object.defineProperty, Wn = Object.getOwnPropertyDescriptor, kn = (e, t, n, s) => {
1227
- for (var r = s > 1 ? void 0 : s ? Wn(t, n) : t, i = e.length - 1, o; i >= 0; i--)
1228
- (o = e[i]) && (r = (s ? o(t, n, r) : o(r)) || r);
1229
- return s && r && Fn(t, n, r), r;
1230
- }, Te = (e, t) => (n, s) => t(n, s, e);
1228
+ var Fn = Object.defineProperty, Wn = Object.getOwnPropertyDescriptor, kn = (e, t, s, n) => {
1229
+ for (var r = n > 1 ? void 0 : n ? Wn(t, s) : t, i = e.length - 1, o; i >= 0; i--)
1230
+ (o = e[i]) && (r = (n ? o(t, s, r) : o(r)) || r);
1231
+ return n && r && Fn(t, s, r), r;
1232
+ }, Te = (e, t) => (s, n) => t(s, n, e);
1231
1233
  const Gn = {};
1232
1234
  let G = class extends z {
1233
- constructor(e, t, n, s) {
1234
- super(), this._config = e, this._injector = t, this._componentManager = n, this._menuService = s, this._initMenu();
1235
+ constructor(e, t, s, n) {
1236
+ super(), this._config = e, this._injector = t, this._componentManager = s, this._menuService = n, this._initMenu();
1235
1237
  }
1236
1238
  _initMenu() {
1237
1239
  const { menu: e = {} } = this._config;
@@ -1246,11 +1248,11 @@ G = kn([
1246
1248
  Te(2, S(ze)),
1247
1249
  Te(3, S(At))
1248
1250
  ], G);
1249
- var ot = Object.defineProperty, zn = Object.getOwnPropertyDescriptor, Kn = (e, t, n) => t in e ? ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Yn = (e, t, n, s) => {
1250
- for (var r = s > 1 ? void 0 : s ? zn(t, n) : t, i = e.length - 1, o; i >= 0; i--)
1251
- (o = e[i]) && (r = (s ? o(t, n, r) : o(r)) || r);
1252
- return s && r && ot(t, n, r), r;
1253
- }, qn = (e, t) => (n, s) => t(n, s, e), ct = (e, t, n) => (Kn(e, typeof t != "symbol" ? t + "" : t, n), n);
1251
+ var ot = Object.defineProperty, zn = Object.getOwnPropertyDescriptor, Kn = (e, t, s) => t in e ? ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, Yn = (e, t, s, n) => {
1252
+ for (var r = n > 1 ? void 0 : n ? zn(t, s) : t, i = e.length - 1, o; i >= 0; i--)
1253
+ (o = e[i]) && (r = (n ? o(t, s, r) : o(r)) || r);
1254
+ return n && r && ot(t, s, r), r;
1255
+ }, qn = (e, t) => (s, n) => t(s, n, e), ct = (e, t, s) => Kn(e, typeof t != "symbol" ? t + "" : t, s);
1254
1256
  let he = class extends bt {
1255
1257
  constructor(e = {}, t) {
1256
1258
  super(), this._config = e, this._injector = t, this._config = yt.deepMerge({}, Gn, this._config);