@fileverse-dev/dsheet 3.0.0 → 3.0.1-yjs

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.
Files changed (27) hide show
  1. package/dist/{constants-yStXQJiK.js → constants-Cdz6oSCq.js} +5 -7
  2. package/dist/constants.js +1 -1
  3. package/dist/editor/components/editor-workbook-sync.d.ts +1 -1
  4. package/dist/editor/constants/shared-constants.d.ts +0 -2
  5. package/dist/editor/utils/config-ydoc-update.d.ts +20 -0
  6. package/dist/{executeStringFunction-C5hEkx9z.js → executeStringFunction-CPkwRrkE.js} +13676 -9322
  7. package/dist/formula.js +1 -1
  8. package/dist/{index-CBzFxleP.js → index-Xk62PVvQ.js} +21295 -24592
  9. package/dist/index.es.js +42 -42
  10. package/dist/sheet-engine/core/api/cell.d.ts +0 -20
  11. package/dist/sheet-engine/core/api/common.d.ts +2 -1
  12. package/dist/sheet-engine/core/api/index.d.ts +1 -0
  13. package/dist/sheet-engine/core/api/sheet-flowdata-lifecycle.d.ts +17 -0
  14. package/dist/sheet-engine/core/api/sheet.d.ts +5 -0
  15. package/dist/sheet-engine/core/modules/formula-worker-bridge.d.ts +1 -0
  16. package/dist/sheet-engine/core/paste/paste-border-utils.d.ts +23 -0
  17. package/dist/sheet-engine/core/settings.d.ts +1 -1
  18. package/dist/sheet-engine/core/types.d.ts +3 -0
  19. package/dist/sheet-engine/core/utils/border-config-utils.d.ts +10 -0
  20. package/dist/sheet-engine/core/utils/cell-persist-utils.d.ts +8 -0
  21. package/dist/sheet-engine/core/utils/range-format.d.ts +43 -0
  22. package/dist/sheet-engine/core/utils/ydoc-celldata-changes.d.ts +40 -0
  23. package/dist/sheet-engine/react/components/Workbook/api.d.ts +8 -1
  24. package/dist/sheet-engine/react/components/Workbook/index.d.ts +5 -1
  25. package/dist/{use-xlsx-import-impl-C_npga_I.js → use-xlsx-import-impl-SfcyQhgd.js} +491 -477
  26. package/dist/{xlsx-export-impl-C2cU3lhm.js → xlsx-export-impl-DteWYmg0.js} +1106 -1106
  27. package/package.json +2 -2
@@ -1,11 +1,11 @@
1
- import { g as Ze } from "./executeStringFunction-C5hEkx9z.js";
2
- import * as Je from "yjs";
3
- import { m as Qe, y as Ke, r as et } from "./index-CBzFxleP.js";
4
- import { n as tt } from "./xlsx-hyperlink-inline-DzewAypN.js";
5
- import { toast as Ie } from "@fileverse/ui";
6
- var ze = { exports: {} };
7
- (function(y) {
8
- var u = {}, g = function(p) {
1
+ import { g as Qe } from "./executeStringFunction-CPkwRrkE.js";
2
+ import * as Ke from "yjs";
3
+ import { m as et, y as tt, r as rt } from "./index-Xk62PVvQ.js";
4
+ import { n as nt } from "./xlsx-hyperlink-inline-DzewAypN.js";
5
+ import { toast as Ye } from "@fileverse/ui";
6
+ var Xe = { exports: {} };
7
+ (function(k) {
8
+ var s = {}, g = function(p) {
9
9
  p.version = "0.11.2";
10
10
  function v(t) {
11
11
  for (var r = "", n = t.length - 1; n >= 0; ) r += t.charAt(n--);
@@ -15,11 +15,11 @@ var ze = { exports: {} };
15
15
  for (var n = ""; n.length < r; ) n += t;
16
16
  return n;
17
17
  }
18
- function N(t, r) {
18
+ function T(t, r) {
19
19
  var n = "" + t;
20
20
  return n.length >= r ? n : $("0", r - n.length) + n;
21
21
  }
22
- function R(t, r) {
22
+ function D(t, r) {
23
23
  var n = "" + t;
24
24
  return n.length >= r ? n : $(" ", r - n.length) + n;
25
25
  }
@@ -31,7 +31,7 @@ var ze = { exports: {} };
31
31
  var n = "" + Math.round(t);
32
32
  return n.length >= r ? n : $("0", r - n.length) + n;
33
33
  }
34
- function F(t, r) {
34
+ function V(t, r) {
35
35
  var n = "" + t;
36
36
  return n.length >= r ? n : $("0", r - n.length) + n;
37
37
  }
@@ -39,7 +39,7 @@ var ze = { exports: {} };
39
39
  function re(t, r) {
40
40
  if (t > ie || t < -ie) return J(t, r);
41
41
  var n = Math.round(t);
42
- return F(n, r);
42
+ return V(n, r);
43
43
  }
44
44
  function fe(t, r) {
45
45
  return r = r || 0, t.length >= 7 + r && (t.charCodeAt(r) | 32) === 103 && (t.charCodeAt(r + 1) | 32) === 101 && (t.charCodeAt(r + 2) | 32) === 110 && (t.charCodeAt(r + 3) | 32) === 101 && (t.charCodeAt(r + 4) | 32) === 114 && (t.charCodeAt(r + 5) | 32) === 97 && (t.charCodeAt(r + 6) | 32) === 108;
@@ -85,25 +85,25 @@ var ze = { exports: {} };
85
85
  var G = [];
86
86
  G[5] = G[63] = '"$"#,##0_);\\("$"#,##0\\)', G[6] = G[64] = '"$"#,##0_);[Red]\\("$"#,##0\\)', G[7] = G[65] = '"$"#,##0.00_);\\("$"#,##0.00\\)', G[8] = G[66] = '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)', G[41] = '_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)', G[42] = '_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)', G[43] = '_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)', G[44] = '_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)';
87
87
  function we(t, r, n) {
88
- for (var m = t < 0 ? -1 : 1, e = t * m, d = 0, a = 1, f = 0, C = 1, l = 0, _ = 0, A = Math.floor(e); l < r && (A = Math.floor(e), f = A * a + d, _ = A * l + C, !(e - A < 5e-8)); )
89
- e = 1 / (e - A), d = a, a = f, C = l, l = _;
90
- if (_ > r && (l > r ? (_ = C, f = d) : (_ = l, f = a)), !n) return [0, m * f, _];
91
- var D = Math.floor(m * f / _);
92
- return [D, m * f - D * _, _];
88
+ for (var m = t < 0 ? -1 : 1, e = t * m, b = 0, a = 1, f = 0, C = 1, u = 0, y = 0, _ = Math.floor(e); u < r && (_ = Math.floor(e), f = _ * a + b, y = _ * u + C, !(e - _ < 5e-8)); )
89
+ e = 1 / (e - _), b = a, a = f, C = u, u = y;
90
+ if (y > r && (u > r ? (y = C, f = b) : (y = u, f = a)), !n) return [0, m * f, y];
91
+ var H = Math.floor(m * f / y);
92
+ return [H, m * f - H * y, y];
93
93
  }
94
94
  function ye(t, r, n) {
95
95
  if (t > 2958465 || t < 0) return null;
96
- var m = t | 0, e = Math.floor(86400 * (t - m)), d = 0, a = [], f = { D: m, T: e, u: 86400 * (t - m) - e, y: 0, m: 0, d: 0, H: 0, M: 0, S: 0, q: 0 };
96
+ var m = t | 0, e = Math.floor(86400 * (t - m)), b = 0, a = [], f = { D: m, T: e, u: 86400 * (t - m) - e, y: 0, m: 0, d: 0, H: 0, M: 0, S: 0, q: 0 };
97
97
  if (Math.abs(f.u) < 1e-6 && (f.u = 0), r && r.date1904 && (m += 1462), f.u > 0.9999 && (f.u = 0, ++e == 86400 && (f.T = e = 0, ++m, ++f.D)), m === 60)
98
- a = n ? [1317, 10, 29] : [1900, 2, 29], d = 3;
98
+ a = n ? [1317, 10, 29] : [1900, 2, 29], b = 3;
99
99
  else if (m === 0)
100
- a = n ? [1317, 8, 29] : [1900, 1, 0], d = 6;
100
+ a = n ? [1317, 8, 29] : [1900, 1, 0], b = 6;
101
101
  else {
102
102
  m > 60 && --m;
103
103
  var C = new Date(1900, 0, 1);
104
- C.setDate(C.getDate() + m - 1), a = [C.getFullYear(), C.getMonth() + 1, C.getDate()], d = C.getDay(), m < 60 && (d = (d + 6) % 7), n && (d = Fe(C, a));
104
+ C.setDate(C.getDate() + m - 1), a = [C.getFullYear(), C.getMonth() + 1, C.getDate()], b = C.getDay(), m < 60 && (b = (b + 6) % 7), n && (b = Fe(C, a));
105
105
  }
106
- return f.y = a[0], f.m = a[1], f.d = a[2], f.S = e % 60, e = Math.floor(e / 60), f.M = e % 60, e = Math.floor(e / 60), f.H = e, f.q = d, f;
106
+ return f.y = a[0], f.m = a[1], f.d = a[2], f.S = e % 60, e = Math.floor(e / 60), f.M = e % 60, e = Math.floor(e / 60), f.H = e, f.q = b, f;
107
107
  }
108
108
  p.parse_date_code = ye;
109
109
  var Se = new Date(1899, 11, 31, 0, 0, 0), Re = Se.getTime(), Le = new Date(1900, 2, 1, 0, 0, 0);
@@ -117,24 +117,24 @@ var ze = { exports: {} };
117
117
  p._general_int = He;
118
118
  var Te = /* @__PURE__ */ function() {
119
119
  var r = /(?:\.0*|(\.\d*[1-9])0+)$/;
120
- function n(l) {
121
- return l.indexOf(".") == -1 ? l : l.replace(r, "$1");
120
+ function n(u) {
121
+ return u.indexOf(".") == -1 ? u : u.replace(r, "$1");
122
122
  }
123
123
  var m = /(?:\.0*|(\.\d*[1-9])0+)[Ee]/, e = /(E[+-])(\d)$/;
124
- function d(l) {
125
- return l.indexOf("E") == -1 ? l : l.replace(m, "$1E").replace(e, "$10$2");
124
+ function b(u) {
125
+ return u.indexOf("E") == -1 ? u : u.replace(m, "$1E").replace(e, "$10$2");
126
126
  }
127
- function a(l) {
128
- var _ = l < 0 ? 12 : 11, A = n(l.toFixed(12));
129
- return A.length <= _ || (A = l.toPrecision(10), A.length <= _) ? A : l.toExponential(5);
127
+ function a(u) {
128
+ var y = u < 0 ? 12 : 11, _ = n(u.toFixed(12));
129
+ return _.length <= y || (_ = u.toPrecision(10), _.length <= y) ? _ : u.toExponential(5);
130
130
  }
131
- function f(l) {
132
- var _ = n(l.toFixed(11));
133
- return _.length > (l < 0 ? 12 : 11) || _ === "0" || _ === "-0" ? l.toPrecision(6) : _;
131
+ function f(u) {
132
+ var y = n(u.toFixed(11));
133
+ return y.length > (u < 0 ? 12 : 11) || y === "0" || y === "-0" ? u.toPrecision(6) : y;
134
134
  }
135
- function C(l) {
136
- var _ = Math.floor(Math.log(Math.abs(l)) * Math.LOG10E), A;
137
- return _ >= -4 && _ <= -1 ? A = l.toPrecision(10 + _) : Math.abs(_) <= 9 ? A = a(l) : _ === 10 ? A = l.toFixed(10).substr(0, 12) : A = f(l), n(d(A.toUpperCase()));
135
+ function C(u) {
136
+ var y = Math.floor(Math.log(Math.abs(u)) * Math.LOG10E), _;
137
+ return y >= -4 && y <= -1 ? _ = u.toPrecision(10 + y) : Math.abs(y) <= 9 ? _ = a(u) : y === 10 ? _ = u.toFixed(10).substr(0, 12) : _ = f(u), n(b(_.toUpperCase()));
138
138
  }
139
139
  return C;
140
140
  }();
@@ -162,7 +162,7 @@ var ze = { exports: {} };
162
162
  return t < 60 && (n = (n + 6) % 7), n;
163
163
  }
164
164
  function Ve(t, r, n, m) {
165
- var e = "", d = 0, a = 0, f = n.y, C, l = 0;
165
+ var e = "", b = 0, a = 0, f = n.y, C, u = 0;
166
166
  switch (t) {
167
167
  case 98:
168
168
  f = n.y + 543;
@@ -170,10 +170,10 @@ var ze = { exports: {} };
170
170
  switch (r.length) {
171
171
  case 1:
172
172
  case 2:
173
- C = f % 100, l = 2;
173
+ C = f % 100, u = 2;
174
174
  break;
175
175
  default:
176
- C = f % 1e4, l = 4;
176
+ C = f % 1e4, u = 4;
177
177
  break;
178
178
  }
179
179
  break;
@@ -181,7 +181,7 @@ var ze = { exports: {} };
181
181
  switch (r.length) {
182
182
  case 1:
183
183
  case 2:
184
- C = n.m, l = r.length;
184
+ C = n.m, u = r.length;
185
185
  break;
186
186
  case 3:
187
187
  return Ae[n.m - 1][1];
@@ -195,7 +195,7 @@ var ze = { exports: {} };
195
195
  switch (r.length) {
196
196
  case 1:
197
197
  case 2:
198
- C = n.d, l = r.length;
198
+ C = n.d, u = r.length;
199
199
  break;
200
200
  case 3:
201
201
  return Ce[n.q][0];
@@ -207,7 +207,7 @@ var ze = { exports: {} };
207
207
  switch (r.length) {
208
208
  case 1:
209
209
  case 2:
210
- C = 1 + (n.H + 11) % 12, l = r.length;
210
+ C = 1 + (n.H + 11) % 12, u = r.length;
211
211
  break;
212
212
  default:
213
213
  throw "bad hour format: " + r;
@@ -217,7 +217,7 @@ var ze = { exports: {} };
217
217
  switch (r.length) {
218
218
  case 1:
219
219
  case 2:
220
- C = n.H, l = r.length;
220
+ C = n.H, u = r.length;
221
221
  break;
222
222
  default:
223
223
  throw "bad hour format: " + r;
@@ -227,7 +227,7 @@ var ze = { exports: {} };
227
227
  switch (r.length) {
228
228
  case 1:
229
229
  case 2:
230
- C = n.M, l = r.length;
230
+ C = n.M, u = r.length;
231
231
  break;
232
232
  default:
233
233
  throw "bad minute format: " + r;
@@ -235,7 +235,7 @@ var ze = { exports: {} };
235
235
  break;
236
236
  case 115:
237
237
  if (r != "s" && r != "ss" && r != ".0" && r != ".00" && r != ".000") throw "bad second format: " + r;
238
- return n.u === 0 && (r == "s" || r == "ss") ? N(n.S, r.length) : (m >= 2 ? a = m === 3 ? 1e3 : 100 : a = m === 1 ? 10 : 1, d = Math.round(a * (n.S + n.u)), d >= 60 * a && (d = 0), r === "s" ? d === 0 ? "0" : "" + d / a : (e = N(d, 2 + m), r === "ss" ? e.substr(0, 2) : "." + e.substr(2, r.length - 1)));
238
+ return n.u === 0 && (r == "s" || r == "ss") ? T(n.S, r.length) : (m >= 2 ? a = m === 3 ? 1e3 : 100 : a = m === 1 ? 10 : 1, b = Math.round(a * (n.S + n.u)), b >= 60 * a && (b = 0), r === "s" ? b === 0 ? "0" : "" + b / a : (e = T(b, 2 + m), r === "ss" ? e.substr(0, 2) : "." + e.substr(2, r.length - 1)));
239
239
  case 90:
240
240
  switch (r) {
241
241
  case "[h]":
@@ -253,14 +253,14 @@ var ze = { exports: {} };
253
253
  default:
254
254
  throw "bad abstime format: " + r;
255
255
  }
256
- l = r.length === 3 ? 1 : 2;
256
+ u = r.length === 3 ? 1 : 2;
257
257
  break;
258
258
  case 101:
259
- C = f, l = 1;
259
+ C = f, u = 1;
260
260
  break;
261
261
  }
262
- var _ = l > 0 ? N(C, l) : "";
263
- return _;
262
+ var y = u > 0 ? T(C, u) : "";
263
+ return y;
264
264
  }
265
265
  function oe(t) {
266
266
  var r = 3;
@@ -271,44 +271,44 @@ var ze = { exports: {} };
271
271
  var ne = /* @__PURE__ */ function() {
272
272
  var r = /%/g;
273
273
  function n(h, i, c) {
274
- var k = i.replace(r, ""), o = i.length - k.length;
275
- return ne(h, k, c * Math.pow(10, 2 * o)) + $("%", o);
274
+ var A = i.replace(r, ""), o = i.length - A.length;
275
+ return ne(h, A, c * Math.pow(10, 2 * o)) + $("%", o);
276
276
  }
277
277
  function m(h, i, c) {
278
- for (var k = i.length - 1; i.charCodeAt(k - 1) === 44; ) --k;
279
- return ne(h, i.substr(0, k), c / Math.pow(10, 3 * (i.length - k)));
278
+ for (var A = i.length - 1; i.charCodeAt(A - 1) === 44; ) --A;
279
+ return ne(h, i.substr(0, A), c / Math.pow(10, 3 * (i.length - A)));
280
280
  }
281
281
  function e(h, i) {
282
- var c, k = h.indexOf("E") - h.indexOf(".") - 1;
282
+ var c, A = h.indexOf("E") - h.indexOf(".") - 1;
283
283
  if (h.match(/^#+0.0E\+0$/)) {
284
284
  if (i == 0) return "0.0E+0";
285
285
  if (i < 0) return "-" + e(h, -i);
286
286
  var o = h.indexOf(".");
287
287
  o === -1 && (o = h.indexOf("E"));
288
- var s = Math.floor(Math.log(i) * Math.LOG10E) % o;
289
- if (s < 0 && (s += o), c = (i / Math.pow(10, s)).toPrecision(k + 1 + (o + s) % o), c.indexOf("e") === -1) {
288
+ var l = Math.floor(Math.log(i) * Math.LOG10E) % o;
289
+ if (l < 0 && (l += o), c = (i / Math.pow(10, l)).toPrecision(A + 1 + (o + l) % o), c.indexOf("e") === -1) {
290
290
  var E = Math.floor(Math.log(i) * Math.LOG10E);
291
- for (c.indexOf(".") === -1 ? c = c.charAt(0) + "." + c.substr(1) + "E+" + (E - c.length + s) : c += "E+" + (E - s); c.substr(0, 2) === "0."; )
291
+ for (c.indexOf(".") === -1 ? c = c.charAt(0) + "." + c.substr(1) + "E+" + (E - c.length + l) : c += "E+" + (E - l); c.substr(0, 2) === "0."; )
292
292
  c = c.charAt(0) + c.substr(2, o) + "." + c.substr(2 + o), c = c.replace(/^0+([1-9])/, "$1").replace(/^0+\./, "0.");
293
293
  c = c.replace(/\+-/, "-");
294
294
  }
295
- c = c.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function(H, j, W, S) {
296
- return j + W + S.substr(0, (o + s) % o) + "." + S.substr(s) + "E";
295
+ c = c.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function(L, B, W, N) {
296
+ return B + W + N.substr(0, (o + l) % o) + "." + N.substr(l) + "E";
297
297
  });
298
- } else c = i.toExponential(k);
298
+ } else c = i.toExponential(A);
299
299
  return h.match(/E\+00$/) && c.match(/e[+-]\d$/) && (c = c.substr(0, c.length - 1) + "0" + c.charAt(c.length - 1)), h.match(/E\-/) && c.match(/e\+/) && (c = c.replace(/e\+/, "e")), c.replace("e", "E");
300
300
  }
301
- var d = /# (\?+)( ?)\/( ?)(\d+)/;
301
+ var b = /# (\?+)( ?)\/( ?)(\d+)/;
302
302
  function a(h, i, c) {
303
- var k = parseInt(h[4], 10), o = Math.round(i * k), s = Math.floor(o / k), E = o - s * k, H = k;
304
- return c + (s === 0 ? "" : "" + s) + " " + (E === 0 ? $(" ", h[1].length + 1 + h[4].length) : R(E, h[1].length) + h[2] + "/" + h[3] + N(H, h[4].length));
303
+ var A = parseInt(h[4], 10), o = Math.round(i * A), l = Math.floor(o / A), E = o - l * A, L = A;
304
+ return c + (l === 0 ? "" : "" + l) + " " + (E === 0 ? $(" ", h[1].length + 1 + h[4].length) : D(E, h[1].length) + h[2] + "/" + h[3] + T(L, h[4].length));
305
305
  }
306
306
  function f(h, i, c) {
307
307
  return c + (i === 0 ? "" : "" + i) + $(" ", h[1].length + 2 + h[4].length);
308
308
  }
309
- var C = /^#*0*\.([0#]+)/, l = /\).*[0#]/, _ = /\(###\) ###\\?-####/;
310
- function A(h) {
311
- for (var i = "", c, k = 0; k != h.length; ++k) switch (c = h.charCodeAt(k)) {
309
+ var C = /^#*0*\.([0#]+)/, u = /\).*[0#]/, y = /\(###\) ###\\?-####/;
310
+ function _(h) {
311
+ for (var i = "", c, A = 0; A != h.length; ++A) switch (c = h.charCodeAt(A)) {
312
312
  case 35:
313
313
  break;
314
314
  case 63:
@@ -322,74 +322,74 @@ var ze = { exports: {} };
322
322
  }
323
323
  return i;
324
324
  }
325
- function D(h, i) {
325
+ function H(h, i) {
326
326
  var c = Math.pow(10, i);
327
327
  return "" + Math.round(h * c) / c;
328
328
  }
329
329
  function U(h, i) {
330
- var c = h - Math.floor(h), k = Math.pow(10, i);
331
- return i < ("" + Math.round(c * k)).length ? 0 : Math.round(c * k);
330
+ var c = h - Math.floor(h), A = Math.pow(10, i);
331
+ return i < ("" + Math.round(c * A)).length ? 0 : Math.round(c * A);
332
332
  }
333
- function T(h, i) {
333
+ function S(h, i) {
334
334
  return i < ("" + Math.round((h - Math.floor(h)) * Math.pow(10, i))).length ? 1 : 0;
335
335
  }
336
- function L(h) {
336
+ function R(h) {
337
337
  return h < 2147483647 && h > -2147483648 ? "" + (h >= 0 ? h | 0 : h - 1 | 0) : "" + Math.floor(h);
338
338
  }
339
339
  function O(h, i, c) {
340
- if (h.charCodeAt(0) === 40 && !i.match(l)) {
341
- var k = i.replace(/\( */, "").replace(/ \)/, "").replace(/\)/, "");
342
- return c >= 0 ? O("n", k, c) : "(" + O("n", k, -c) + ")";
340
+ if (h.charCodeAt(0) === 40 && !i.match(u)) {
341
+ var A = i.replace(/\( */, "").replace(/ \)/, "").replace(/\)/, "");
342
+ return c >= 0 ? O("n", A, c) : "(" + O("n", A, -c) + ")";
343
343
  }
344
344
  if (i.charCodeAt(i.length - 1) === 44) return m(h, i, c);
345
345
  if (i.indexOf("%") !== -1) return n(h, i, c);
346
346
  if (i.indexOf("E") !== -1) return e(i, c);
347
347
  if (i.charCodeAt(0) === 36) return "$" + O(h, i.substr(i.charAt(1) == " " ? 2 : 1), c);
348
- var o, s, E, H, j = Math.abs(c), W = c < 0 ? "-" : "";
349
- if (i.match(/^00+$/)) return W + re(j, i.length);
348
+ var o, l, E, L, B = Math.abs(c), W = c < 0 ? "-" : "";
349
+ if (i.match(/^00+$/)) return W + re(B, i.length);
350
350
  if (i.match(/^[#?]+$/))
351
- return o = re(c, 0), o === "0" && (o = ""), o.length > i.length ? o : A(i.substr(0, i.length - o.length)) + o;
352
- if (s = i.match(d)) return a(s, j, W);
353
- if (i.match(/^#+0+$/)) return W + re(j, i.length - i.indexOf("0"));
354
- if (s = i.match(C))
355
- return o = D(c, s[1].length).replace(/^([^\.]+)$/, "$1." + A(s[1])).replace(/\.$/, "." + A(s[1])).replace(/\.(\d*)$/, function(z, pe) {
356
- return "." + pe + $("0", A(s[1]).length - pe.length);
351
+ return o = re(c, 0), o === "0" && (o = ""), o.length > i.length ? o : _(i.substr(0, i.length - o.length)) + o;
352
+ if (l = i.match(b)) return a(l, B, W);
353
+ if (i.match(/^#+0+$/)) return W + re(B, i.length - i.indexOf("0"));
354
+ if (l = i.match(C))
355
+ return o = H(c, l[1].length).replace(/^([^\.]+)$/, "$1." + _(l[1])).replace(/\.$/, "." + _(l[1])).replace(/\.(\d*)$/, function(z, pe) {
356
+ return "." + pe + $("0", _(l[1]).length - pe.length);
357
357
  }), i.indexOf("0.") !== -1 ? o : o.replace(/^0\./, ".");
358
- if (i = i.replace(/^#+([0.])/, "$1"), s = i.match(/^(0*)\.(#*)$/))
359
- return W + D(j, s[2].length).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, s[1].length ? "0." : ".");
360
- if (s = i.match(/^#{1,3},##0(\.?)$/)) return W + oe(re(j, 0));
361
- if (s = i.match(/^#,##0\.([#0]*0)$/))
362
- return c < 0 ? "-" + O(h, i, -c) : oe("" + (Math.floor(c) + T(c, s[1].length))) + "." + N(U(c, s[1].length), s[1].length);
363
- if (s = i.match(/^#,#*,#0/)) return O(h, i.replace(/^#,#*,/, ""), c);
364
- if (s = i.match(/^([0#]+)(\\?-([0#]+))+$/))
358
+ if (i = i.replace(/^#+([0.])/, "$1"), l = i.match(/^(0*)\.(#*)$/))
359
+ return W + H(B, l[2].length).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, l[1].length ? "0." : ".");
360
+ if (l = i.match(/^#{1,3},##0(\.?)$/)) return W + oe(re(B, 0));
361
+ if (l = i.match(/^#,##0\.([#0]*0)$/))
362
+ return c < 0 ? "-" + O(h, i, -c) : oe("" + (Math.floor(c) + S(c, l[1].length))) + "." + T(U(c, l[1].length), l[1].length);
363
+ if (l = i.match(/^#,#*,#0/)) return O(h, i.replace(/^#,#*,/, ""), c);
364
+ if (l = i.match(/^([0#]+)(\\?-([0#]+))+$/))
365
365
  return o = v(O(h, i.replace(/[\\-]/g, ""), c)), E = 0, v(v(i.replace(/\\/g, "")).replace(/[0#]/g, function(z) {
366
366
  return E < o.length ? o.charAt(E++) : z === "0" ? "0" : "";
367
367
  }));
368
- if (i.match(_))
368
+ if (i.match(y))
369
369
  return o = O(h, "##########", c), "(" + o.substr(0, 3) + ") " + o.substr(3, 3) + "-" + o.substr(6);
370
- var S = "";
371
- if (s = i.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))
372
- return E = Math.min(s[4].length, 7), H = we(j, Math.pow(10, E) - 1, !1), o = "" + W, S = ne("n", s[1], H[1]), S.charAt(S.length - 1) == " " && (S = S.substr(0, S.length - 1) + "0"), o += S + s[2] + "/" + s[3], S = I(H[2], E), S.length < s[4].length && (S = A(s[4].substr(s[4].length - S.length)) + S), o += S, o;
373
- if (s = i.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))
374
- return E = Math.min(Math.max(s[1].length, s[4].length), 7), H = we(j, Math.pow(10, E) - 1, !0), W + (H[0] || (H[1] ? "" : "0")) + " " + (H[1] ? R(H[1], E) + s[2] + "/" + s[3] + I(H[2], E) : $(" ", 2 * E + 1 + s[2].length + s[3].length));
375
- if (s = i.match(/^[#0?]+$/))
376
- return o = re(c, 0), i.length <= o.length ? o : A(i.substr(0, i.length - o.length)) + o;
377
- if (s = i.match(/^([#0?]+)\.([#0]+)$/)) {
378
- o = "" + c.toFixed(Math.min(s[2].length, 10)).replace(/([^0])0+$/, "$1"), E = o.indexOf(".");
370
+ var N = "";
371
+ if (l = i.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))
372
+ return E = Math.min(l[4].length, 7), L = we(B, Math.pow(10, E) - 1, !1), o = "" + W, N = ne("n", l[1], L[1]), N.charAt(N.length - 1) == " " && (N = N.substr(0, N.length - 1) + "0"), o += N + l[2] + "/" + l[3], N = I(L[2], E), N.length < l[4].length && (N = _(l[4].substr(l[4].length - N.length)) + N), o += N, o;
373
+ if (l = i.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))
374
+ return E = Math.min(Math.max(l[1].length, l[4].length), 7), L = we(B, Math.pow(10, E) - 1, !0), W + (L[0] || (L[1] ? "" : "0")) + " " + (L[1] ? D(L[1], E) + l[2] + "/" + l[3] + I(L[2], E) : $(" ", 2 * E + 1 + l[2].length + l[3].length));
375
+ if (l = i.match(/^[#0?]+$/))
376
+ return o = re(c, 0), i.length <= o.length ? o : _(i.substr(0, i.length - o.length)) + o;
377
+ if (l = i.match(/^([#0?]+)\.([#0]+)$/)) {
378
+ o = "" + c.toFixed(Math.min(l[2].length, 10)).replace(/([^0])0+$/, "$1"), E = o.indexOf(".");
379
379
  var be = i.indexOf(".") - E, ve = i.length - o.length - be;
380
- return A(i.substr(0, be) + o + i.substr(i.length - ve));
380
+ return _(i.substr(0, be) + o + i.substr(i.length - ve));
381
381
  }
382
- if (s = i.match(/^00,000\.([#0]*0)$/))
383
- return E = U(c, s[1].length), c < 0 ? "-" + O(h, i, -c) : oe(L(c)).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function(z) {
384
- return "00," + (z.length < 3 ? N(0, 3 - z.length) : "") + z;
385
- }) + "." + N(E, s[1].length);
382
+ if (l = i.match(/^00,000\.([#0]*0)$/))
383
+ return E = U(c, l[1].length), c < 0 ? "-" + O(h, i, -c) : oe(R(c)).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function(z) {
384
+ return "00," + (z.length < 3 ? T(0, 3 - z.length) : "") + z;
385
+ }) + "." + T(E, l[1].length);
386
386
  switch (i) {
387
387
  case "###,##0.00":
388
388
  return O(h, "#,##0.00", c);
389
389
  case "###,###":
390
390
  case "##,###":
391
391
  case "#,###":
392
- var me = oe(re(j, 0));
392
+ var me = oe(re(B, 0));
393
393
  return me !== "0" ? W + me : "";
394
394
  case "###,###.00":
395
395
  return O(h, "###,##0.00", c).replace(/^0\./, ".");
@@ -399,91 +399,91 @@ var ze = { exports: {} };
399
399
  throw new Error("unsupported format |" + i + "|");
400
400
  }
401
401
  function se(h, i, c) {
402
- for (var k = i.length - 1; i.charCodeAt(k - 1) === 44; ) --k;
403
- return ne(h, i.substr(0, k), c / Math.pow(10, 3 * (i.length - k)));
402
+ for (var A = i.length - 1; i.charCodeAt(A - 1) === 44; ) --A;
403
+ return ne(h, i.substr(0, A), c / Math.pow(10, 3 * (i.length - A)));
404
404
  }
405
405
  function ue(h, i, c) {
406
- var k = i.replace(r, ""), o = i.length - k.length;
407
- return ne(h, k, c * Math.pow(10, 2 * o)) + $("%", o);
406
+ var A = i.replace(r, ""), o = i.length - A.length;
407
+ return ne(h, A, c * Math.pow(10, 2 * o)) + $("%", o);
408
408
  }
409
409
  function Z(h, i) {
410
- var c, k = h.indexOf("E") - h.indexOf(".") - 1;
410
+ var c, A = h.indexOf("E") - h.indexOf(".") - 1;
411
411
  if (h.match(/^#+0.0E\+0$/)) {
412
412
  if (i == 0) return "0.0E+0";
413
413
  if (i < 0) return "-" + Z(h, -i);
414
414
  var o = h.indexOf(".");
415
415
  o === -1 && (o = h.indexOf("E"));
416
- var s = Math.floor(Math.log(i) * Math.LOG10E) % o;
417
- if (s < 0 && (s += o), c = (i / Math.pow(10, s)).toPrecision(k + 1 + (o + s) % o), !c.match(/[Ee]/)) {
416
+ var l = Math.floor(Math.log(i) * Math.LOG10E) % o;
417
+ if (l < 0 && (l += o), c = (i / Math.pow(10, l)).toPrecision(A + 1 + (o + l) % o), !c.match(/[Ee]/)) {
418
418
  var E = Math.floor(Math.log(i) * Math.LOG10E);
419
- c.indexOf(".") === -1 ? c = c.charAt(0) + "." + c.substr(1) + "E+" + (E - c.length + s) : c += "E+" + (E - s), c = c.replace(/\+-/, "-");
419
+ c.indexOf(".") === -1 ? c = c.charAt(0) + "." + c.substr(1) + "E+" + (E - c.length + l) : c += "E+" + (E - l), c = c.replace(/\+-/, "-");
420
420
  }
421
- c = c.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function(H, j, W, S) {
422
- return j + W + S.substr(0, (o + s) % o) + "." + S.substr(s) + "E";
421
+ c = c.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function(L, B, W, N) {
422
+ return B + W + N.substr(0, (o + l) % o) + "." + N.substr(l) + "E";
423
423
  });
424
- } else c = i.toExponential(k);
424
+ } else c = i.toExponential(A);
425
425
  return h.match(/E\+00$/) && c.match(/e[+-]\d$/) && (c = c.substr(0, c.length - 1) + "0" + c.charAt(c.length - 1)), h.match(/E\-/) && c.match(/e\+/) && (c = c.replace(/e\+/, "e")), c.replace("e", "E");
426
426
  }
427
427
  function x(h, i, c) {
428
- if (h.charCodeAt(0) === 40 && !i.match(l)) {
429
- var k = i.replace(/\( */, "").replace(/ \)/, "").replace(/\)/, "");
430
- return c >= 0 ? x("n", k, c) : "(" + x("n", k, -c) + ")";
428
+ if (h.charCodeAt(0) === 40 && !i.match(u)) {
429
+ var A = i.replace(/\( */, "").replace(/ \)/, "").replace(/\)/, "");
430
+ return c >= 0 ? x("n", A, c) : "(" + x("n", A, -c) + ")";
431
431
  }
432
432
  if (i.charCodeAt(i.length - 1) === 44) return se(h, i, c);
433
433
  if (i.indexOf("%") !== -1) return ue(h, i, c);
434
434
  if (i.indexOf("E") !== -1) return Z(i, c);
435
435
  if (i.charCodeAt(0) === 36) return "$" + x(h, i.substr(i.charAt(1) == " " ? 2 : 1), c);
436
- var o, s, E, H, j = Math.abs(c), W = c < 0 ? "-" : "";
437
- if (i.match(/^00+$/)) return W + N(j, i.length);
436
+ var o, l, E, L, B = Math.abs(c), W = c < 0 ? "-" : "";
437
+ if (i.match(/^00+$/)) return W + T(B, i.length);
438
438
  if (i.match(/^[#?]+$/))
439
- return o = "" + c, c === 0 && (o = ""), o.length > i.length ? o : A(i.substr(0, i.length - o.length)) + o;
440
- if (s = i.match(d)) return f(s, j, W);
441
- if (i.match(/^#+0+$/)) return W + N(j, i.length - i.indexOf("0"));
442
- if (s = i.match(C))
443
- return o = ("" + c).replace(/^([^\.]+)$/, "$1." + A(s[1])).replace(/\.$/, "." + A(s[1])), o = o.replace(/\.(\d*)$/, function(z, pe) {
444
- return "." + pe + $("0", A(s[1]).length - pe.length);
439
+ return o = "" + c, c === 0 && (o = ""), o.length > i.length ? o : _(i.substr(0, i.length - o.length)) + o;
440
+ if (l = i.match(b)) return f(l, B, W);
441
+ if (i.match(/^#+0+$/)) return W + T(B, i.length - i.indexOf("0"));
442
+ if (l = i.match(C))
443
+ return o = ("" + c).replace(/^([^\.]+)$/, "$1." + _(l[1])).replace(/\.$/, "." + _(l[1])), o = o.replace(/\.(\d*)$/, function(z, pe) {
444
+ return "." + pe + $("0", _(l[1]).length - pe.length);
445
445
  }), i.indexOf("0.") !== -1 ? o : o.replace(/^0\./, ".");
446
- if (i = i.replace(/^#+([0.])/, "$1"), s = i.match(/^(0*)\.(#*)$/))
447
- return W + ("" + j).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, s[1].length ? "0." : ".");
448
- if (s = i.match(/^#{1,3},##0(\.?)$/)) return W + oe("" + j);
449
- if (s = i.match(/^#,##0\.([#0]*0)$/))
450
- return c < 0 ? "-" + x(h, i, -c) : oe("" + c) + "." + $("0", s[1].length);
451
- if (s = i.match(/^#,#*,#0/)) return x(h, i.replace(/^#,#*,/, ""), c);
452
- if (s = i.match(/^([0#]+)(\\?-([0#]+))+$/))
446
+ if (i = i.replace(/^#+([0.])/, "$1"), l = i.match(/^(0*)\.(#*)$/))
447
+ return W + ("" + B).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, l[1].length ? "0." : ".");
448
+ if (l = i.match(/^#{1,3},##0(\.?)$/)) return W + oe("" + B);
449
+ if (l = i.match(/^#,##0\.([#0]*0)$/))
450
+ return c < 0 ? "-" + x(h, i, -c) : oe("" + c) + "." + $("0", l[1].length);
451
+ if (l = i.match(/^#,#*,#0/)) return x(h, i.replace(/^#,#*,/, ""), c);
452
+ if (l = i.match(/^([0#]+)(\\?-([0#]+))+$/))
453
453
  return o = v(x(h, i.replace(/[\\-]/g, ""), c)), E = 0, v(v(i.replace(/\\/g, "")).replace(/[0#]/g, function(z) {
454
454
  return E < o.length ? o.charAt(E++) : z === "0" ? "0" : "";
455
455
  }));
456
- if (i.match(_))
456
+ if (i.match(y))
457
457
  return o = x(h, "##########", c), "(" + o.substr(0, 3) + ") " + o.substr(3, 3) + "-" + o.substr(6);
458
- var S = "";
459
- if (s = i.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))
460
- return E = Math.min(s[4].length, 7), H = we(j, Math.pow(10, E) - 1, !1), o = "" + W, S = ne("n", s[1], H[1]), S.charAt(S.length - 1) == " " && (S = S.substr(0, S.length - 1) + "0"), o += S + s[2] + "/" + s[3], S = I(H[2], E), S.length < s[4].length && (S = A(s[4].substr(s[4].length - S.length)) + S), o += S, o;
461
- if (s = i.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))
462
- return E = Math.min(Math.max(s[1].length, s[4].length), 7), H = we(j, Math.pow(10, E) - 1, !0), W + (H[0] || (H[1] ? "" : "0")) + " " + (H[1] ? R(H[1], E) + s[2] + "/" + s[3] + I(H[2], E) : $(" ", 2 * E + 1 + s[2].length + s[3].length));
463
- if (s = i.match(/^[#0?]+$/))
464
- return o = "" + c, i.length <= o.length ? o : A(i.substr(0, i.length - o.length)) + o;
465
- if (s = i.match(/^([#0]+)\.([#0]+)$/)) {
466
- o = "" + c.toFixed(Math.min(s[2].length, 10)).replace(/([^0])0+$/, "$1"), E = o.indexOf(".");
458
+ var N = "";
459
+ if (l = i.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))
460
+ return E = Math.min(l[4].length, 7), L = we(B, Math.pow(10, E) - 1, !1), o = "" + W, N = ne("n", l[1], L[1]), N.charAt(N.length - 1) == " " && (N = N.substr(0, N.length - 1) + "0"), o += N + l[2] + "/" + l[3], N = I(L[2], E), N.length < l[4].length && (N = _(l[4].substr(l[4].length - N.length)) + N), o += N, o;
461
+ if (l = i.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))
462
+ return E = Math.min(Math.max(l[1].length, l[4].length), 7), L = we(B, Math.pow(10, E) - 1, !0), W + (L[0] || (L[1] ? "" : "0")) + " " + (L[1] ? D(L[1], E) + l[2] + "/" + l[3] + I(L[2], E) : $(" ", 2 * E + 1 + l[2].length + l[3].length));
463
+ if (l = i.match(/^[#0?]+$/))
464
+ return o = "" + c, i.length <= o.length ? o : _(i.substr(0, i.length - o.length)) + o;
465
+ if (l = i.match(/^([#0]+)\.([#0]+)$/)) {
466
+ o = "" + c.toFixed(Math.min(l[2].length, 10)).replace(/([^0])0+$/, "$1"), E = o.indexOf(".");
467
467
  var be = i.indexOf(".") - E, ve = i.length - o.length - be;
468
- return A(i.substr(0, be) + o + i.substr(i.length - ve));
468
+ return _(i.substr(0, be) + o + i.substr(i.length - ve));
469
469
  }
470
- if (s = i.match(/^00,000\.([#0]*0)$/))
470
+ if (l = i.match(/^00,000\.([#0]*0)$/))
471
471
  return c < 0 ? "-" + x(h, i, -c) : oe("" + c).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function(z) {
472
- return "00," + (z.length < 3 ? N(0, 3 - z.length) : "") + z;
473
- }) + "." + N(0, s[1].length);
472
+ return "00," + (z.length < 3 ? T(0, 3 - z.length) : "") + z;
473
+ }) + "." + T(0, l[1].length);
474
474
  switch (i) {
475
475
  case "###,###":
476
476
  case "##,###":
477
477
  case "#,###":
478
- var me = oe("" + j);
478
+ var me = oe("" + B);
479
479
  return me !== "0" ? W + me : "";
480
480
  default:
481
- if (i.match(/\.[0#?]*$/)) return x(h, i.slice(0, i.lastIndexOf(".")), c) + A(i.slice(i.lastIndexOf(".")));
481
+ if (i.match(/\.[0#?]*$/)) return x(h, i.slice(0, i.lastIndexOf(".")), c) + _(i.slice(i.lastIndexOf(".")));
482
482
  }
483
483
  throw new Error("unsupported format |" + i + "|");
484
484
  }
485
- return function(i, c, k) {
486
- return (k | 0) === k ? x(i, c, k) : O(i, c, k);
485
+ return function(i, c, A) {
486
+ return (A | 0) === A ? x(i, c, A) : O(i, c, A);
487
487
  };
488
488
  }();
489
489
  function ke(t) {
@@ -598,19 +598,19 @@ var ze = { exports: {} };
598
598
  }
599
599
  p.is_date = xe;
600
600
  function $e(t, r, n, m) {
601
- for (var e = [], d = "", a = 0, f = "", C = "t", l, _, A, D = "H"; a < t.length; )
601
+ for (var e = [], b = "", a = 0, f = "", C = "t", u, y, _, H = "H"; a < t.length; )
602
602
  switch (f = t.charAt(a)) {
603
603
  case "G":
604
604
  if (!fe(t, a)) throw new Error("unrecognized character " + f + " in " + t);
605
605
  e[e.length] = { t: "G", v: "General" }, a += 7;
606
606
  break;
607
607
  case '"':
608
- for (d = ""; (A = t.charCodeAt(++a)) !== 34 && a < t.length; ) d += String.fromCharCode(A);
609
- e[e.length] = { t: "t", v: d }, ++a;
608
+ for (b = ""; (_ = t.charCodeAt(++a)) !== 34 && a < t.length; ) b += String.fromCharCode(_);
609
+ e[e.length] = { t: "t", v: b }, ++a;
610
610
  break;
611
611
  case "\\":
612
- var U = t.charAt(++a), T = U === "(" || U === ")" ? U : "t";
613
- e[e.length] = { t: T, v: U }, ++a;
612
+ var U = t.charAt(++a), S = U === "(" || U === ")" ? U : "t";
613
+ e[e.length] = { t: S, v: U }, ++a;
614
614
  break;
615
615
  case "_":
616
616
  e[e.length] = { t: "t", v: " " }, a += 2;
@@ -621,7 +621,7 @@ var ze = { exports: {} };
621
621
  case "B":
622
622
  case "b":
623
623
  if (t.charAt(a + 1) === "1" || t.charAt(a + 1) === "2") {
624
- if (l == null && (l = ye(r, n, t.charAt(a + 1) === "2"), l == null))
624
+ if (u == null && (u = ye(r, n, t.charAt(a + 1) === "2"), u == null))
625
625
  return "";
626
626
  e[e.length] = { t: "X", v: t.substr(a, 2) }, C = f, a += 2;
627
627
  break;
@@ -640,41 +640,41 @@ var ze = { exports: {} };
640
640
  case "s":
641
641
  case "e":
642
642
  case "g":
643
- if (r < 0 || l == null && (l = ye(r, n), l == null))
643
+ if (r < 0 || u == null && (u = ye(r, n), u == null))
644
644
  return "";
645
- for (d = f; ++a < t.length && t.charAt(a).toLowerCase() === f; ) d += f;
646
- f === "m" && C.toLowerCase() === "h" && (f = "M"), f === "h" && (f = D), e[e.length] = { t: f, v: d }, C = f;
645
+ for (b = f; ++a < t.length && t.charAt(a).toLowerCase() === f; ) b += f;
646
+ f === "m" && C.toLowerCase() === "h" && (f = "M"), f === "h" && (f = H), e[e.length] = { t: f, v: b }, C = f;
647
647
  break;
648
648
  case "A":
649
649
  case "a":
650
650
  case "上":
651
- var L = { t: f, v: f };
652
- if (l == null && (l = ye(r, n)), t.substr(a, 3).toUpperCase() === "A/P" ? (l != null && (L.v = l.H >= 12 ? "P" : "A"), L.t = "T", D = "h", a += 3) : t.substr(a, 5).toUpperCase() === "AM/PM" ? (l != null && (L.v = l.H >= 12 ? "PM" : "AM"), L.t = "T", a += 5, D = "h") : t.substr(a, 5).toUpperCase() === "上午/下午" ? (l != null && (L.v = l.H >= 12 ? "下午" : "上午"), L.t = "T", a += 5, D = "h") : (L.t = "t", ++a), l == null && L.t === "T") return "";
653
- e[e.length] = L, C = f;
651
+ var R = { t: f, v: f };
652
+ if (u == null && (u = ye(r, n)), t.substr(a, 3).toUpperCase() === "A/P" ? (u != null && (R.v = u.H >= 12 ? "P" : "A"), R.t = "T", H = "h", a += 3) : t.substr(a, 5).toUpperCase() === "AM/PM" ? (u != null && (R.v = u.H >= 12 ? "PM" : "AM"), R.t = "T", a += 5, H = "h") : t.substr(a, 5).toUpperCase() === "上午/下午" ? (u != null && (R.v = u.H >= 12 ? "下午" : "上午"), R.t = "T", a += 5, H = "h") : (R.t = "t", ++a), u == null && R.t === "T") return "";
653
+ e[e.length] = R, C = f;
654
654
  break;
655
655
  case "[":
656
- for (d = f; t.charAt(a++) !== "]" && a < t.length; ) d += t.charAt(a);
657
- if (d.slice(-1) !== "]") throw 'unterminated "[" block: |' + d + "|";
658
- if (d.match(_e)) {
659
- if (l == null && (l = ye(r, n), l == null))
656
+ for (b = f; t.charAt(a++) !== "]" && a < t.length; ) b += t.charAt(a);
657
+ if (b.slice(-1) !== "]") throw 'unterminated "[" block: |' + b + "|";
658
+ if (b.match(_e)) {
659
+ if (u == null && (u = ye(r, n), u == null))
660
660
  return "";
661
- e[e.length] = { t: "Z", v: d.toLowerCase() }, C = d.charAt(1);
662
- } else d.indexOf("$") > -1 && (d = (d.match(/\$([^-\[\]]*)/) || [])[1] || "$", xe(t) || (e[e.length] = { t: "t", v: d }));
661
+ e[e.length] = { t: "Z", v: b.toLowerCase() }, C = b.charAt(1);
662
+ } else b.indexOf("$") > -1 && (b = (b.match(/\$([^-\[\]]*)/) || [])[1] || "$", xe(t) || (e[e.length] = { t: "t", v: b }));
663
663
  break;
664
664
  case ".":
665
- if (l != null) {
666
- for (d = f; ++a < t.length && (f = t.charAt(a)) === "0"; ) d += f;
667
- e[e.length] = { t: "s", v: d };
665
+ if (u != null) {
666
+ for (b = f; ++a < t.length && (f = t.charAt(a)) === "0"; ) b += f;
667
+ e[e.length] = { t: "s", v: b };
668
668
  break;
669
669
  }
670
670
  case "0":
671
671
  case "#":
672
- for (d = f; ++a < t.length && "0#?.,E+-%".indexOf(f = t.charAt(a)) > -1; ) d += f;
673
- e[e.length] = { t: "n", v: d };
672
+ for (b = f; ++a < t.length && "0#?.,E+-%".indexOf(f = t.charAt(a)) > -1; ) b += f;
673
+ e[e.length] = { t: "n", v: b };
674
674
  break;
675
675
  case "?":
676
- for (d = f; t.charAt(++a) === f; ) d += f;
677
- e[e.length] = { t: f, v: d }, C = f;
676
+ for (b = f; t.charAt(++a) === f; ) b += f;
677
+ e[e.length] = { t: f, v: b }, C = f;
678
678
  break;
679
679
  case "*":
680
680
  ++a, (t.charAt(a) == " " || t.charAt(a) == "*") && ++a;
@@ -692,8 +692,8 @@ var ze = { exports: {} };
692
692
  case "7":
693
693
  case "8":
694
694
  case "9":
695
- for (d = f; a < t.length && "0123456789".indexOf(t.charAt(++a)) > -1; ) d += t.charAt(a);
696
- e[e.length] = { t: "D", v: d };
695
+ for (b = f; a < t.length && "0123456789".indexOf(t.charAt(++a)) > -1; ) b += t.charAt(a);
696
+ e[e.length] = { t: "D", v: b };
697
697
  break;
698
698
  case " ":
699
699
  e[e.length] = { t: f, v: f }, ++a;
@@ -711,7 +711,7 @@ var ze = { exports: {} };
711
711
  switch (e[a].t) {
712
712
  case "h":
713
713
  case "H":
714
- e[a].t = D, C = "h", O < 1 && (O = 1);
714
+ e[a].t = H, C = "h", O < 1 && (O = 1);
715
715
  break;
716
716
  case "s":
717
717
  (ue = e[a].v.match(/\.0+$/)) && (se = Math.max(se, ue[0].length - 1)), O < 3 && (O = 3);
@@ -733,10 +733,10 @@ var ze = { exports: {} };
733
733
  case 0:
734
734
  break;
735
735
  case 1:
736
- l.u >= 0.5 && (l.u = 0, ++l.S), l.S >= 60 && (l.S = 0, ++l.M), l.M >= 60 && (l.M = 0, ++l.H);
736
+ u.u >= 0.5 && (u.u = 0, ++u.S), u.S >= 60 && (u.S = 0, ++u.M), u.M >= 60 && (u.M = 0, ++u.H);
737
737
  break;
738
738
  case 2:
739
- l.u >= 0.5 && (l.u = 0, ++l.S), l.S >= 60 && (l.S = 0, ++l.M);
739
+ u.u >= 0.5 && (u.u = 0, ++u.S), u.S >= 60 && (u.S = 0, ++u.M);
740
740
  break;
741
741
  }
742
742
  var Z = "", x;
@@ -760,7 +760,7 @@ var ze = { exports: {} };
760
760
  case "e":
761
761
  case "b":
762
762
  case "Z":
763
- e[a].v = Ve(e[a].t.charCodeAt(0), e[a].v, l, se), e[a].t = "t";
763
+ e[a].v = Ve(e[a].t.charCodeAt(0), e[a].v, u, se), e[a].t = "t";
764
764
  break;
765
765
  case "n":
766
766
  case "?":
@@ -775,35 +775,35 @@ var ze = { exports: {} };
775
775
  var h = "", i, c;
776
776
  if (Z.length > 0) {
777
777
  Z.charCodeAt(0) == 40 ? (i = r < 0 && Z.charCodeAt(0) === 45 ? -r : r, c = ne("n", Z, i)) : (i = r < 0 && m > 1 ? -r : r, c = ne("n", Z, i), i < 0 && e[0] && e[0].t == "t" && (c = c.substr(1), e[0].v = "-" + e[0].v)), x = c.length - 1;
778
- var k = e.length;
778
+ var A = e.length;
779
779
  for (a = 0; a < e.length; ++a) if (e[a] != null && e[a].t != "t" && e[a].v.indexOf(".") > -1) {
780
- k = a;
780
+ A = a;
781
781
  break;
782
782
  }
783
783
  var o = e.length;
784
- if (k === e.length && c.indexOf("E") === -1) {
784
+ if (A === e.length && c.indexOf("E") === -1) {
785
785
  for (a = e.length - 1; a >= 0; --a)
786
786
  e[a] == null || "n?".indexOf(e[a].t) === -1 || (x >= e[a].v.length - 1 ? (x -= e[a].v.length, e[a].v = c.substr(x + 1, e[a].v.length)) : x < 0 ? e[a].v = "" : (e[a].v = c.substr(0, x + 1), x = -1), e[a].t = "t", o = a);
787
787
  x >= 0 && o < e.length && (e[o].v = c.substr(0, x + 1) + e[o].v);
788
- } else if (k !== e.length && c.indexOf("E") === -1) {
789
- for (x = c.indexOf(".") - 1, a = k; a >= 0; --a)
788
+ } else if (A !== e.length && c.indexOf("E") === -1) {
789
+ for (x = c.indexOf(".") - 1, a = A; a >= 0; --a)
790
790
  if (!(e[a] == null || "n?".indexOf(e[a].t) === -1)) {
791
- for (_ = e[a].v.indexOf(".") > -1 && a === k ? e[a].v.indexOf(".") - 1 : e[a].v.length - 1, h = e[a].v.substr(_ + 1); _ >= 0; --_)
792
- x >= 0 && (e[a].v.charAt(_) === "0" || e[a].v.charAt(_) === "#") && (h = c.charAt(x--) + h);
791
+ for (y = e[a].v.indexOf(".") > -1 && a === A ? e[a].v.indexOf(".") - 1 : e[a].v.length - 1, h = e[a].v.substr(y + 1); y >= 0; --y)
792
+ x >= 0 && (e[a].v.charAt(y) === "0" || e[a].v.charAt(y) === "#") && (h = c.charAt(x--) + h);
793
793
  e[a].v = h, e[a].t = "t", o = a;
794
794
  }
795
- for (x >= 0 && o < e.length && (e[o].v = c.substr(0, x + 1) + e[o].v), x = c.indexOf(".") + 1, a = k; a < e.length; ++a)
796
- if (!(e[a] == null || "n?(".indexOf(e[a].t) === -1 && a !== k)) {
797
- for (_ = e[a].v.indexOf(".") > -1 && a === k ? e[a].v.indexOf(".") + 1 : 0, h = e[a].v.substr(0, _); _ < e[a].v.length; ++_)
795
+ for (x >= 0 && o < e.length && (e[o].v = c.substr(0, x + 1) + e[o].v), x = c.indexOf(".") + 1, a = A; a < e.length; ++a)
796
+ if (!(e[a] == null || "n?(".indexOf(e[a].t) === -1 && a !== A)) {
797
+ for (y = e[a].v.indexOf(".") > -1 && a === A ? e[a].v.indexOf(".") + 1 : 0, h = e[a].v.substr(0, y); y < e[a].v.length; ++y)
798
798
  x < c.length && (h += c.charAt(x++));
799
799
  e[a].v = h, e[a].t = "t", o = a;
800
800
  }
801
801
  }
802
802
  }
803
803
  for (a = 0; a < e.length; ++a) e[a] != null && "n?".indexOf(e[a].t) > -1 && (i = m > 1 && r < 0 && a > 0 && e[a - 1].v === "-" ? -r : r, e[a].v = ne(e[a].t, e[a].v, i), e[a].t = "t");
804
- var s = "";
805
- for (a = 0; a !== e.length; ++a) e[a] != null && (s += e[a].v);
806
- return s;
804
+ var l = "";
805
+ for (a = 0; a !== e.length; ++a) e[a] != null && (l += e[a].v);
806
+ return l;
807
807
  }
808
808
  p._eval = $e;
809
809
  var Me = /\[[=<>]/, X = /\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;
@@ -832,7 +832,7 @@ var ze = { exports: {} };
832
832
  }
833
833
  return !1;
834
834
  }
835
- function ee(t, r) {
835
+ function te(t, r) {
836
836
  var n = ke(t), m = n.length, e = n[m - 1].indexOf("@");
837
837
  if (m < 4 && e > -1 && --m, n.length > 4) throw new Error("cannot find right format for |" + n.join("|") + "|");
838
838
  if (typeof r != "number") return [4, n.length === 4 || e > -1 ? n[n.length - 1] : "@"];
@@ -847,13 +847,13 @@ var ze = { exports: {} };
847
847
  n = e > -1 ? [n[0], n[1], n[0], n[2]] : [n[0], n[1], n[2], "@"];
848
848
  break;
849
849
  }
850
- var d = r > 0 ? n[0] : r < 0 ? n[1] : n[2];
851
- if (n[0].indexOf("[") === -1 && n[1].indexOf("[") === -1) return [m, d];
850
+ var b = r > 0 ? n[0] : r < 0 ? n[1] : n[2];
851
+ if (n[0].indexOf("[") === -1 && n[1].indexOf("[") === -1) return [m, b];
852
852
  if (n[0].match(Me) != null || n[1].match(Me) != null) {
853
853
  var a = n[0].match(X), f = n[1].match(X);
854
854
  return ae(r, a) ? [m, n[0]] : ae(r, f) ? [m, n[1]] : [m, n[a != null && f != null ? 2 : 1]];
855
855
  }
856
- return [m, d];
856
+ return [m, b];
857
857
  }
858
858
  function de(t, r, n) {
859
859
  n == null && (n = {});
@@ -868,7 +868,7 @@ var ze = { exports: {} };
868
868
  }
869
869
  if (fe(m, 0)) return ge(r, n);
870
870
  r instanceof Date && (r = Ne(r, n.date1904));
871
- var e = ee(m, r);
871
+ var e = te(m, r);
872
872
  if (fe(e[1])) return ge(r, n);
873
873
  if (r === !0) r = "TRUE";
874
874
  else if (r === !1) r = "FALSE";
@@ -899,10 +899,10 @@ var ze = { exports: {} };
899
899
  r[n] !== void 0 && le(r[n], n);
900
900
  }, p.init_table = Ee, p.format = de;
901
901
  };
902
- g(u), typeof DO_NOT_EXPORT_SSF > "u" && (y.exports = u);
903
- })(ze);
904
- var rt = ze.exports;
905
- const Pe = /* @__PURE__ */ Ze(rt), Be = [
902
+ g(s), typeof DO_NOT_EXPORT_SSF > "u" && (k.exports = s);
903
+ })(Xe);
904
+ var at = Xe.exports;
905
+ const Pe = /* @__PURE__ */ Qe(at), je = [
906
906
  "228, 232, 237",
907
907
  // Light Gray
908
908
  "219, 233, 236",
@@ -927,99 +927,99 @@ const Pe = /* @__PURE__ */ Ze(rt), Be = [
927
927
  // Cyan
928
928
  "244, 239, 234"
929
929
  // Cream
930
- ], Ue = Be[0], nt = [
930
+ ], Ge = je[0], it = [
931
931
  ["true", "false"],
932
932
  ["yes", "no"],
933
933
  ["1", "0"]
934
934
  ];
935
- function at(y, u) {
936
- const g = y.toLowerCase(), w = u.toLowerCase();
937
- return nt.some(([p, v]) => g === p && w === v);
935
+ function ct(k, s) {
936
+ const g = k.toLowerCase(), w = s.toLowerCase();
937
+ return it.some(([p, v]) => g === p && w === v);
938
938
  }
939
- const it = 200;
940
- function ct() {
939
+ const ot = 200;
940
+ function lt() {
941
941
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `sheet-${Date.now()}-${Math.random().toString(36).slice(2)}`;
942
942
  }
943
- function ot(y) {
944
- if (!Array.isArray(y) || y.length === 0) return null;
945
- const u = y.map((w) => String((w == null ? void 0 : w.v) ?? "")).join("");
946
- return u.trim() ? u : null;
943
+ function st(k) {
944
+ if (!Array.isArray(k) || k.length === 0) return null;
945
+ const s = k.map((w) => String((w == null ? void 0 : w.v) ?? "")).join("");
946
+ return s.trim() ? s : null;
947
947
  }
948
- function lt(y) {
949
- return y ? "TRUE" : "FALSE";
948
+ function ut(k) {
949
+ return k ? "TRUE" : "FALSE";
950
950
  }
951
- function st(y) {
952
- let u = !1, g = 0;
951
+ function ht(k) {
952
+ let s = !1, g = 0;
953
953
  const w = () => {
954
- if (u) return !0;
955
- const v = y.current;
954
+ if (s) return !0;
955
+ const v = k.current;
956
956
  if (!(v != null && v.getWorkbookContext) || !v.recalculateAllFormulas) return !1;
957
- const $ = v.getWorkbookContext(), N = $ == null ? void 0 : $.luckysheetfile;
958
- return !(N != null && N.length) || !N.some(
957
+ const $ = v.getWorkbookContext(), T = $ == null ? void 0 : $.luckysheetfile;
958
+ return !(T != null && T.length) || !T.some(
959
959
  (I) => Array.isArray(I.data) && I.data.length > 0
960
- ) ? !1 : (v.recalculateAllFormulas(), u = !0, !0);
960
+ ) ? !1 : (v.recalculateAllFormulas(), s = !0, !0);
961
961
  }, p = () => {
962
962
  var v, $;
963
- w() || (g += 1, g < it ? requestAnimationFrame(p) : (($ = (v = y.current) == null ? void 0 : v.recalculateAllFormulas) == null || $.call(v), u = !0));
963
+ w() || (g += 1, g < ot ? requestAnimationFrame(p) : (($ = (v = k.current) == null ? void 0 : v.recalculateAllFormulas) == null || $.call(v), s = !0));
964
964
  };
965
965
  requestAnimationFrame(() => requestAnimationFrame(p));
966
966
  for (const v of [120, 400, 1200])
967
967
  window.setTimeout(() => {
968
- u || w();
968
+ s || w();
969
969
  }, v);
970
970
  }
971
- function ut(y) {
972
- return y <= 0 ? Ue : y > Be.length ? Array(y).fill(Ue).join(", ") : Be.slice(0, y).join(", ");
971
+ function ft(k) {
972
+ return k <= 0 ? Ge : k > je.length ? Array(k).fill(Ge).join(", ") : je.slice(0, k).join(", ");
973
973
  }
974
- function je(y) {
975
- const u = y.match(/^([A-Z]+)(\d+)$/i);
976
- if (!u) return null;
977
- const g = u[1].toUpperCase(), w = u[2];
974
+ function Be(k) {
975
+ const s = k.match(/^([A-Z]+)(\d+)$/i);
976
+ if (!s) return null;
977
+ const g = s[1].toUpperCase(), w = s[2];
978
978
  let p = 0;
979
- for (let N = 0; N < g.length; N++)
980
- p = p * 26 + (g.charCodeAt(N) - 64);
979
+ for (let T = 0; T < g.length; T++)
980
+ p = p * 26 + (g.charCodeAt(T) - 64);
981
981
  const v = parseInt(w, 10) - 1, $ = p - 1;
982
982
  return { row: v, col: $ };
983
983
  }
984
- function ht(y, u) {
985
- const g = je(y);
984
+ function gt(k, s) {
985
+ const g = Be(k);
986
986
  if (!g) return null;
987
- const { row: w, col: p } = g, v = `${w}_${p}`, $ = Array.isArray(u.formulae) && u.formulae.length > 0 ? String(u.formulae[0]).replace(/^["']|["']$/g, "").replace(/["']/g, "") : "", N = $.split(",").map((fe) => fe.trim()).filter(Boolean);
988
- let R = u.type === "list" ? "dropdown" : u.type || "dropdown", I = $, J = "";
989
- u.type === "list" && N.length === 2 && at(N[0], N[1]) && (R = "checkbox", I = N[0], J = N[1]);
990
- const F = R === "checkbox" ? 1 : I ? I.split(",").length : 0, ie = ut(F || 1), re = {
991
- type: R,
987
+ const { row: w, col: p } = g, v = `${w}_${p}`, $ = Array.isArray(s.formulae) && s.formulae.length > 0 ? String(s.formulae[0]).replace(/^["']|["']$/g, "").replace(/["']/g, "") : "", T = $.split(",").map((fe) => fe.trim()).filter(Boolean);
988
+ let D = s.type === "list" ? "dropdown" : s.type || "dropdown", I = $, J = "";
989
+ s.type === "list" && T.length === 2 && ct(T[0], T[1]) && (D = "checkbox", I = T[0], J = T[1]);
990
+ const V = D === "checkbox" ? 1 : I ? I.split(",").length : 0, ie = ft(V || 1), re = {
991
+ type: D,
992
992
  type2: "",
993
- rangeTxt: y,
993
+ rangeTxt: k,
994
994
  value1: I,
995
995
  value2: J,
996
996
  validity: "",
997
997
  remote: !1,
998
- prohibitInput: u.type === "list",
999
- hintShow: !!u.showInputMessage,
1000
- hintValue: u.prompt ?? "",
998
+ prohibitInput: s.type === "list",
999
+ hintShow: !!s.showInputMessage,
1000
+ hintValue: s.prompt ?? "",
1001
1001
  color: ie,
1002
1002
  checked: !1
1003
1003
  };
1004
1004
  return { rowColKey: v, entry: re };
1005
1005
  }
1006
- function ft(y) {
1007
- const u = y.split(":"), g = je(u[0].trim());
1006
+ function dt(k) {
1007
+ const s = k.split(":"), g = Be(s[0].trim());
1008
1008
  if (!g) return null;
1009
- const w = u.length > 1 ? je(u[1].trim()) : g;
1009
+ const w = s.length > 1 ? Be(s[1].trim()) : g;
1010
1010
  return w ? {
1011
1011
  row: [Math.min(g.row, w.row), Math.max(g.row, w.row)],
1012
1012
  column: [Math.min(g.col, w.col), Math.max(g.col, w.col)]
1013
1013
  } : null;
1014
1014
  }
1015
- function gt(y) {
1016
- return String(y || "").split(/[,\s]+/).map((u) => u.trim()).filter(Boolean).map((u) => ft(u)).filter(
1017
- (u) => !!u
1015
+ function bt(k) {
1016
+ return String(k || "").split(/[,\s]+/).map((s) => s.trim()).filter(Boolean).map((s) => dt(s)).filter(
1017
+ (s) => !!s
1018
1018
  );
1019
1019
  }
1020
- function Ye(y) {
1021
- const u = gt(y);
1022
- return u.length ? u.map((g) => {
1020
+ function ze(k) {
1021
+ const s = bt(k);
1022
+ return s.length ? s.map((g) => {
1023
1023
  const [w, p] = g.row, [v, $] = g.column;
1024
1024
  return {
1025
1025
  left: 0,
@@ -1038,9 +1038,9 @@ function Ye(y) {
1038
1038
  };
1039
1039
  }) : null;
1040
1040
  }
1041
- function Ge(y) {
1042
- var $, N;
1043
- const u = {
1041
+ function qe(k) {
1042
+ var $, T;
1043
+ const s = {
1044
1044
  textColor: "#000000",
1045
1045
  cellColor: "#ffffff",
1046
1046
  bold: !1,
@@ -1048,16 +1048,16 @@ function Ge(y) {
1048
1048
  underline: !1,
1049
1049
  strikethrough: !1
1050
1050
  };
1051
- if (!y) return u;
1052
- const g = y.font, w = y.fill;
1053
- let p = u.textColor, v = u.cellColor;
1051
+ if (!k) return s;
1052
+ const g = k.font, w = k.fill;
1053
+ let p = s.textColor, v = s.cellColor;
1054
1054
  if (($ = g == null ? void 0 : g.color) != null && $.argb) {
1055
- const R = g.color.argb;
1056
- p = "#" + (R.length >= 6 ? R.slice(-6) : R);
1055
+ const D = g.color.argb;
1056
+ p = "#" + (D.length >= 6 ? D.slice(-6) : D);
1057
1057
  }
1058
- if ((w == null ? void 0 : w.type) === "pattern" && w.pattern === "solid" && ((N = w.fgColor) != null && N.argb)) {
1059
- const R = w.fgColor.argb;
1060
- v = "#" + (R.length >= 6 ? R.slice(-6) : R);
1058
+ if ((w == null ? void 0 : w.type) === "pattern" && w.pattern === "solid" && ((T = w.fgColor) != null && T.argb)) {
1059
+ const D = w.fgColor.argb;
1060
+ v = "#" + (D.length >= 6 ? D.slice(-6) : D);
1061
1061
  }
1062
1062
  return {
1063
1063
  textColor: p,
@@ -1068,33 +1068,33 @@ function Ge(y) {
1068
1068
  strikethrough: !1
1069
1069
  };
1070
1070
  }
1071
- function qe(y) {
1072
- if (!y || typeof y != "string") return "";
1073
- const u = y.trim().replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&amp;/g, "&").replace(/^=/, ""), g = u.match(/(?:^|[^A-Z])SEARCH\s*\([\s(]*"((?:[^"]|"")*)"/i);
1071
+ function Ze(k) {
1072
+ if (!k || typeof k != "string") return "";
1073
+ const s = k.trim().replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&amp;/g, "&").replace(/^=/, ""), g = s.match(/(?:^|[^A-Z])SEARCH\s*\([\s(]*"((?:[^"]|"")*)"/i);
1074
1074
  if (g) return (g[1] ?? "").replace(/""/g, '"');
1075
- const w = u.match(/(?:^|[^A-Z])SEARCH\s*\([\s(]*'([^']*)'/i);
1075
+ const w = s.match(/(?:^|[^A-Z])SEARCH\s*\([\s(]*'([^']*)'/i);
1076
1076
  return w ? w[1] ?? "" : "";
1077
1077
  }
1078
- function De(y) {
1079
- if (!y || typeof y != "string") return "";
1080
- const u = y.trim().replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/^=/, ""), g = u.match(/"((?:[^"]|"")*)"/);
1078
+ function De(k) {
1079
+ if (!k || typeof k != "string") return "";
1080
+ const s = k.trim().replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/^=/, ""), g = s.match(/"((?:[^"]|"")*)"/);
1081
1081
  if (g) return (g[1] ?? "").replace(/""/g, '"');
1082
- const w = u.match(/'([^']*)'/);
1082
+ const w = s.match(/'([^']*)'/);
1083
1083
  return w ? w[1] ?? "" : "";
1084
1084
  }
1085
- function dt(y) {
1086
- if (!y || typeof y != "string") return null;
1087
- const u = y.trim().toUpperCase(), g = qe(y) || De(y);
1088
- return g ? u.includes("SEARCH(") ? u.includes("ISERROR(SEARCH(") || u.includes("NOTNUMBER(SEARCH(") ? { conditionName: "textDoesNotContain", conditionValue: [g] } : { conditionName: "textContains", conditionValue: [g] } : u.includes("LEFT(") ? { conditionName: "textStartsWith", conditionValue: [g] } : u.includes("RIGHT(") ? { conditionName: "textEndsWith", conditionValue: [g] } : u.includes("EXACT(") || u.includes('="') ? { conditionName: "textExactly", conditionValue: [g] } : null : null;
1085
+ function mt(k) {
1086
+ if (!k || typeof k != "string") return null;
1087
+ const s = k.trim().toUpperCase(), g = Ze(k) || De(k);
1088
+ return g ? s.includes("SEARCH(") ? s.includes("ISERROR(SEARCH(") || s.includes("NOTNUMBER(SEARCH(") ? { conditionName: "textDoesNotContain", conditionValue: [g] } : { conditionName: "textContains", conditionValue: [g] } : s.includes("LEFT(") ? { conditionName: "textStartsWith", conditionValue: [g] } : s.includes("RIGHT(") ? { conditionName: "textEndsWith", conditionValue: [g] } : s.includes("EXACT(") || s.includes('="') ? { conditionName: "textExactly", conditionValue: [g] } : null : null;
1089
1089
  }
1090
- function bt(y, u, g) {
1091
- const w = (y || "").toLowerCase();
1090
+ function pt(k, s, g) {
1091
+ const w = (k || "").toLowerCase();
1092
1092
  if (w === "cellis") {
1093
- const p = (u || "").toLowerCase();
1093
+ const p = (s || "").toLowerCase();
1094
1094
  return p === "greaterthan" ? { conditionName: "greaterThan", conditionValue: [] } : p === "greaterthanorequal" ? { conditionName: "greaterThanOrEqual", conditionValue: [] } : p === "lessthan" ? { conditionName: "lessThan", conditionValue: [] } : p === "lessthanorequal" ? { conditionName: "lessThanOrEqual", conditionValue: [] } : p === "equal" ? { conditionName: "equal", conditionValue: [] } : p === "notequal" ? { conditionName: "notEqual", conditionValue: [] } : p === "between" ? { conditionName: "between", conditionValue: [] } : p === "notbetween" ? { conditionName: "notBetween", conditionValue: [] } : null;
1095
1095
  }
1096
1096
  if (w === "containstext" || w === "notcontainstext" || w === "beginswith" || w === "endswith" || w === "containsblanks" || w === "notcontainsblanks") {
1097
- const p = (u ?? "").toLowerCase();
1097
+ const p = (s ?? "").toLowerCase();
1098
1098
  if (w === "containsblanks" || p === "containsblanks")
1099
1099
  return { conditionName: "empty", conditionValue: [""] };
1100
1100
  if (w === "notcontainsblanks" || p === "notcontainsblanks")
@@ -1144,14 +1144,14 @@ function bt(y, u, g) {
1144
1144
  }
1145
1145
  return null;
1146
1146
  }
1147
- function mt(y, u) {
1148
- if (!u.type) return null;
1149
- let g = (u.text ?? "").trim();
1150
- const w = Array.isArray(u.formulae) && u.formulae[0] ? String(u.formulae[0]) : void 0, p = (u.type.toLowerCase() === "expression" || u.type.toLowerCase() === "customformula") && dt(w);
1147
+ function wt(k, s) {
1148
+ if (!s.type) return null;
1149
+ let g = (s.text ?? "").trim();
1150
+ const w = Array.isArray(s.formulae) && s.formulae[0] ? String(s.formulae[0]) : void 0, p = (s.type.toLowerCase() === "expression" || s.type.toLowerCase() === "customformula") && mt(w);
1151
1151
  if (p) {
1152
- const I = Ye(y);
1152
+ const I = ze(k);
1153
1153
  if (!I) return null;
1154
- const J = Ge(u.style);
1154
+ const J = qe(s.style);
1155
1155
  return {
1156
1156
  type: "default",
1157
1157
  cellrange: I,
@@ -1168,51 +1168,51 @@ function mt(y, u) {
1168
1168
  conditionValue: p.conditionValue
1169
1169
  };
1170
1170
  }
1171
- (u.type === "containsText" || u.type === "notContainsText" || u.type === "beginsWith" || u.type === "endsWith") && !g && (g = qe(w), g || (g = De(w)));
1172
- const v = bt(u.type, u.operator, {
1173
- percent: u.percent,
1174
- bottom: u.bottom,
1175
- rank: u.rank,
1176
- aboveAverage: u.aboveAverage,
1177
- text: g || u.text,
1178
- timePeriod: u.timePeriod
1171
+ (s.type === "containsText" || s.type === "notContainsText" || s.type === "beginsWith" || s.type === "endsWith") && !g && (g = Ze(w), g || (g = De(w)));
1172
+ const v = pt(s.type, s.operator, {
1173
+ percent: s.percent,
1174
+ bottom: s.bottom,
1175
+ rank: s.rank,
1176
+ aboveAverage: s.aboveAverage,
1177
+ text: g || s.text,
1178
+ timePeriod: s.timePeriod
1179
1179
  });
1180
1180
  if (!v) return null;
1181
1181
  let $;
1182
- u.type === "cellIs" && Array.isArray(u.formulae) && u.formulae.length > 0 ? $ = u.formulae.map((I) => String(I ?? "")) : v.conditionName === "empty" || v.conditionName === "notEmpty" ? $ = [""] : u.type === "containsText" || u.type === "notContainsText" || u.type === "beginsWith" || u.type === "endsWith" ? $ = g ? [g] : De(w) ? [De(w)] : [] : $ = v.conditionValue.map(
1182
+ s.type === "cellIs" && Array.isArray(s.formulae) && s.formulae.length > 0 ? $ = s.formulae.map((I) => String(I ?? "")) : v.conditionName === "empty" || v.conditionName === "notEmpty" ? $ = [""] : s.type === "containsText" || s.type === "notContainsText" || s.type === "beginsWith" || s.type === "endsWith" ? $ = g ? [g] : De(w) ? [De(w)] : [] : $ = v.conditionValue.map(
1183
1183
  (I) => I == null ? "" : String(I)
1184
1184
  );
1185
- const N = Ye(y);
1186
- if (!N) return null;
1187
- const R = Ge(u.style);
1185
+ const T = ze(k);
1186
+ if (!T) return null;
1187
+ const D = qe(s.style);
1188
1188
  return {
1189
1189
  type: "default",
1190
- cellrange: N,
1190
+ cellrange: T,
1191
1191
  format: {
1192
- textColor: R.textColor,
1193
- cellColor: R.cellColor,
1194
- bold: R.bold,
1195
- italic: R.italic,
1196
- underline: R.underline,
1197
- strikethrough: R.strikethrough
1192
+ textColor: D.textColor,
1193
+ cellColor: D.cellColor,
1194
+ bold: D.bold,
1195
+ italic: D.italic,
1196
+ underline: D.underline,
1197
+ strikethrough: D.strikethrough
1198
1198
  },
1199
1199
  conditionName: v.conditionName,
1200
1200
  conditionRange: [],
1201
1201
  conditionValue: $
1202
1202
  };
1203
1203
  }
1204
- async function _t({
1205
- sheetEditorRef: y,
1206
- ydocRef: u,
1204
+ async function xt({
1205
+ sheetEditorRef: k,
1206
+ ydocRef: s,
1207
1207
  setForceSheetRender: g,
1208
1208
  dsheetId: w,
1209
1209
  currentDataRef: p,
1210
1210
  updateDocumentTitle: v,
1211
1211
  filterToastShown: $,
1212
- setFilterToastShown: N
1213
- }, R, I, J, F) {
1212
+ setFilterToastShown: T
1213
+ }, D, I, J, V) {
1214
1214
  var Ee, ce;
1215
- const ie = R == null ? void 0 : R.target;
1215
+ const ie = D == null ? void 0 : D.target;
1216
1216
  if (!((Ee = ie == null ? void 0 : ie.files) != null && Ee.length) && !I)
1217
1217
  return Promise.resolve();
1218
1218
  const re = ((ce = ie == null ? void 0 : ie.files) == null ? void 0 : ce[0]) || I, fe = {}, Ce = {};
@@ -1236,55 +1236,55 @@ async function _t({
1236
1236
  const ke = (ne = (oe = (Ve = (Fe = ge.model) == null ? void 0 : Fe.styles) == null ? void 0 : Ve.fonts) == null ? void 0 : oe[0]) == null ? void 0 : ne.size, _e = {}, xe = {}, $e = {}, Me = {};
1237
1237
  ge.eachSheet((X, ae) => {
1238
1238
  var a, f, C;
1239
- const ee = ae - 1, de = {}, le = X.views;
1239
+ const te = ae - 1, de = {}, le = X.views;
1240
1240
  if (le && le.length > 0) {
1241
- const l = le[0];
1242
- if (l.state === "frozen") {
1243
- const _ = l.xSplit || 0, A = l.ySplit || 0;
1244
- let D = null;
1245
- _ > 0 && A > 0 ? D = "rangeBoth" : A > 0 ? D = "rangeRow" : _ > 0 && (D = "rangeColumn"), D && (xe[ee] = {
1246
- type: D,
1241
+ const u = le[0];
1242
+ if (u.state === "frozen") {
1243
+ const y = u.xSplit || 0, _ = u.ySplit || 0;
1244
+ let H = null;
1245
+ y > 0 && _ > 0 ? H = "rangeBoth" : _ > 0 ? H = "rangeRow" : y > 0 && (H = "rangeColumn"), H && (xe[te] = {
1246
+ type: H,
1247
1247
  range: {
1248
- row_focus: A - 1,
1249
- column_focus: _ - 1
1248
+ row_focus: _ - 1,
1249
+ column_focus: y - 1
1250
1250
  }
1251
1251
  });
1252
1252
  }
1253
1253
  }
1254
1254
  const t = {};
1255
- X.eachRow({ includeEmpty: !1 }, (l, _) => {
1256
- l.eachCell({ includeEmpty: !1 }, (A, D) => {
1255
+ X.eachRow({ includeEmpty: !1 }, (u, y) => {
1256
+ u.eachCell({ includeEmpty: !1 }, (_, H) => {
1257
1257
  var se, ue, Z;
1258
- const U = `${_ - 1}_${D - 1}`;
1259
- A.hyperlink && (de[U] = [
1258
+ const U = `${y - 1}_${H - 1}`;
1259
+ _.hyperlink && (de[U] = [
1260
1260
  {
1261
1261
  linkType: "webpage",
1262
- linkAddress: A.hyperlink
1262
+ linkAddress: _.hyperlink
1263
1263
  }
1264
1264
  ]);
1265
- const T = (se = A.style) == null ? void 0 : se.font, L = (ue = A.style) == null ? void 0 : ue.fill, O = {};
1266
- if (T) {
1267
- T.bold && (O.bl = 1), T.italic && (O.it = 1), T.underline && (O.un = 1);
1268
- const x = T.size ?? ke;
1269
- if (x && (O.fs = x), T.name && (O.ff = T.name), (Z = T.color) != null && Z.argb) {
1270
- const h = T.color.argb, i = "#" + h.substring(h.length - 6);
1265
+ const S = (se = _.style) == null ? void 0 : se.font, R = (ue = _.style) == null ? void 0 : ue.fill, O = {};
1266
+ if (S) {
1267
+ S.bold && (O.bl = 1), S.italic && (O.it = 1), S.underline && (O.un = 1);
1268
+ const x = S.size ?? ke;
1269
+ if (x && (O.fs = x), S.name && (O.ff = S.name), (Z = S.color) != null && Z.argb) {
1270
+ const h = S.color.argb, i = "#" + h.substring(h.length - 6);
1271
1271
  O.fc = i;
1272
1272
  }
1273
1273
  }
1274
- if ((L == null ? void 0 : L.type) === "pattern" && L.pattern === "solid" && L.fgColor && L.fgColor.argb) {
1275
- const x = L.fgColor.argb, h = "#" + x.substring(x.length - 6);
1274
+ if ((R == null ? void 0 : R.type) === "pattern" && R.pattern === "solid" && R.fgColor && R.fgColor.argb) {
1275
+ const x = R.fgColor.argb, h = "#" + x.substring(x.length - 6);
1276
1276
  O.bg = h;
1277
1277
  }
1278
1278
  Object.keys(O).length > 0 && (t[U] = O);
1279
1279
  });
1280
- }), Object.keys(de).length > 0 && (_e[ee] = de), Object.keys(t).length > 0 && ($e[ee] = t);
1280
+ }), Object.keys(de).length > 0 && (_e[te] = de), Object.keys(t).length > 0 && ($e[te] = t);
1281
1281
  const r = He(X, ge);
1282
- r.length > 0 && (Me[ee] = r);
1282
+ r.length > 0 && (Me[te] = r);
1283
1283
  const n = X.tables;
1284
- n && Object.keys(n).length > 0 && ((a = F == null ? void 0 : F.onWarning) == null || a.call(
1285
- F,
1284
+ n && Object.keys(n).length > 0 && ((a = V == null ? void 0 : V.onWarning) == null || a.call(
1285
+ V,
1286
1286
  "Tables are not fully supported. Table styles will not be applied."
1287
- ), F != null && F.suppressUiWarnings || Ie({
1287
+ ), V != null && V.suppressUiWarnings || Ye({
1288
1288
  title: "Tables are not fully supported",
1289
1289
  description: "Table styles will not be applied",
1290
1290
  variant: "warning",
@@ -1293,48 +1293,48 @@ async function _t({
1293
1293
  }));
1294
1294
  const m = (f = X.dataValidations) == null ? void 0 : f.model;
1295
1295
  if (m && typeof m == "object") {
1296
- const l = {};
1297
- for (const [_, A] of Object.entries(m)) {
1298
- const U = ht(_, A);
1299
- U && (l[U.rowColKey] = U.entry);
1296
+ const u = {};
1297
+ for (const [y, _] of Object.entries(m)) {
1298
+ const U = gt(y, _);
1299
+ U && (u[U.rowColKey] = U.entry);
1300
1300
  }
1301
- Object.keys(l).length > 0 && (fe[ee] = l);
1301
+ Object.keys(u).length > 0 && (fe[te] = u);
1302
1302
  }
1303
1303
  const e = X.conditionalFormattings;
1304
1304
  if (Array.isArray(e) && e.length > 0) {
1305
- const l = [];
1306
- for (const _ of e) {
1307
- const A = _.ref, D = _.rules || [];
1308
- for (const U of D) {
1309
- const T = U;
1305
+ const u = [];
1306
+ for (const y of e) {
1307
+ const _ = y.ref, H = y.rules || [];
1308
+ for (const U of H) {
1309
+ const S = U;
1310
1310
  console.log("[XLSX CF RAW]", {
1311
- ref: A,
1312
- type: T.type,
1313
- operator: T.operator,
1314
- formulae: T.formulae,
1315
- text: T.text,
1316
- timePeriod: T.timePeriod,
1317
- percent: T.percent,
1318
- bottom: T.bottom,
1319
- rank: T.rank,
1320
- aboveAverage: T.aboveAverage
1311
+ ref: _,
1312
+ type: S.type,
1313
+ operator: S.operator,
1314
+ formulae: S.formulae,
1315
+ text: S.text,
1316
+ timePeriod: S.timePeriod,
1317
+ percent: S.percent,
1318
+ bottom: S.bottom,
1319
+ rank: S.rank,
1320
+ aboveAverage: S.aboveAverage
1321
1321
  });
1322
- const L = T.type ? mt(A, T) : null;
1323
- L ? console.log("[XLSX CF MAPPED] accepted", L) : console.log("[XLSX CF MAPPED] skipped", {
1324
- ref: A,
1325
- type: T.type,
1326
- operator: T.operator,
1327
- formulae: T.formulae,
1328
- text: T.text
1329
- }), L && l.push(L);
1322
+ const R = S.type ? wt(_, S) : null;
1323
+ R ? console.log("[XLSX CF MAPPED] accepted", R) : console.log("[XLSX CF MAPPED] skipped", {
1324
+ ref: _,
1325
+ type: S.type,
1326
+ operator: S.operator,
1327
+ formulae: S.formulae,
1328
+ text: S.text
1329
+ }), R && u.push(R);
1330
1330
  }
1331
1331
  }
1332
- l.length > 0 && (Ce[ee] = l);
1332
+ u.length > 0 && (Ce[te] = u);
1333
1333
  }
1334
- X.autoFilter && (Ae || (Ae = !0, (C = F == null ? void 0 : F.onWarning) == null || C.call(
1335
- F,
1334
+ X.autoFilter && (Ae || (Ae = !0, (C = V == null ? void 0 : V.onWarning) == null || C.call(
1335
+ V,
1336
1336
  "Filters are not supported in imported files."
1337
- )), $ || (N(!0), F != null && F.suppressUiWarnings || Ie({
1337
+ )), $ || (T(!0), V != null && V.suppressUiWarnings || Ye({
1338
1338
  title: "Filters are not supported in imported files",
1339
1339
  variant: "warning",
1340
1340
  showCloseButton: !0,
@@ -1345,161 +1345,175 @@ async function _t({
1345
1345
  function(X) {
1346
1346
  var m;
1347
1347
  let ae = X.sheets;
1348
- if (ae.forEach((e, d) => {
1349
- const a = fe[d];
1348
+ if (ae.forEach((e, b) => {
1349
+ const a = fe[b];
1350
1350
  a && Object.keys(a).length > 0 && (e.dataVerification = a);
1351
- const f = Ce[d];
1351
+ const f = Ce[b];
1352
1352
  e.luckysheet_conditionformat_save = Array.isArray(f) && f.length > 0 ? f : [];
1353
- }), !u.current) {
1353
+ }), !s.current) {
1354
1354
  console.error("ydocRef.current is null");
1355
1355
  return;
1356
1356
  }
1357
- const ee = u.current.getArray(w), de = Array.from(ee), le = /* @__PURE__ */ new Map();
1358
- ae = ae.map((e, d) => {
1359
- var T, L, O, se, ue, Z, x, h, i, c, k, o, s, E, H, j, W, S, be, ve, me, z, pe, We;
1360
- const a = (T = e == null ? void 0 : e.celldata) == null ? void 0 : T[e.celldata.length - 1], f = (a == null ? void 0 : a.r) ?? 0, C = (a == null ? void 0 : a.c) ?? 0;
1361
- if (e.row = Math.max(f, 500), e.column = Math.max(C, 36), e.id || (e.id = ((L = F == null ? void 0 : F.generateSheetId) == null ? void 0 : L.call(F)) ?? ((O = y.current) == null ? void 0 : O.getSettings().generateSheetId()) ?? ct()), xe[d] && (e.frozen = xe[d]), _e[d] && (e.hyperlink = {
1357
+ const te = s.current.getArray(w), de = Array.from(te), le = /* @__PURE__ */ new Map();
1358
+ ae = ae.map((e, b) => {
1359
+ var R, O, se, ue, Z, x, h, i, c, A, o, l, E, L, B, W, N, be, ve, me, z, pe, We, Ie, Ue;
1360
+ const a = (R = e == null ? void 0 : e.celldata) == null ? void 0 : R[e.celldata.length - 1], f = (a == null ? void 0 : a.r) ?? 0, C = (a == null ? void 0 : a.c) ?? 0;
1361
+ if (e.row = Math.max(f, 500), e.column = Math.max(C, 36), e.id || (e.id = ((O = V == null ? void 0 : V.generateSheetId) == null ? void 0 : O.call(V)) ?? ((se = k.current) == null ? void 0 : se.getSettings().generateSheetId()) ?? lt()), xe[b] && (e.frozen = xe[b]), _e[b] && (e.hyperlink = {
1362
1362
  ...e.hyperlink || {},
1363
- ..._e[d]
1364
- }), (se = e.config) != null && se.columnlen) {
1365
- const b = {};
1363
+ ..._e[b]
1364
+ }), (ue = e.config) != null && ue.columnlen) {
1365
+ const d = {};
1366
1366
  Object.entries(e.config.columnlen).forEach(
1367
- ([P, V]) => {
1368
- const Y = (Number(V) - 5) / 8 + 0.83;
1369
- b[P] = Math.round(Y * 7 + 5);
1367
+ ([P, F]) => {
1368
+ const Y = (Number(F) - 5) / 8 + 0.83;
1369
+ d[P] = Math.round(Y * 7 + 5);
1370
1370
  }
1371
- ), e.config.columnlen = b;
1371
+ ), e.config.columnlen = d;
1372
1372
  }
1373
- if ((ue = e.config) != null && ue.rowlen) {
1374
- const b = Math.round(
1373
+ const u = Math.round(
1374
+ Number(e.defaultColWidth) || 73
1375
+ );
1376
+ if ((Z = e.config) != null && Z.columnlen) {
1377
+ const d = {};
1378
+ Object.entries(e.config.columnlen).forEach(([P, F]) => {
1379
+ Math.abs(Math.round(Number(F)) - u) > 1 && (d[P] = Number(F));
1380
+ }), e.config.columnlen = d;
1381
+ }
1382
+ if ((x = e.config) != null && x.rowlen) {
1383
+ const d = Math.round(
1375
1384
  Number(e.defaultRowHeight) || 21
1376
1385
  ), P = {};
1377
- Object.entries(e.config.rowlen).forEach(([V, Y]) => {
1378
- Math.abs(Math.round(Number(Y)) - b) > 1 && (P[V] = Number(Y));
1386
+ Object.entries(e.config.rowlen).forEach(([F, Y]) => {
1387
+ Math.abs(Math.round(Number(Y)) - d) > 1 && (P[F] = Number(Y));
1379
1388
  }), e.config.rowlen = P;
1380
1389
  }
1381
- if ((Z = e.config) != null && Z.customHeight) {
1382
- const b = new Set(
1390
+ if ((h = e.config) != null && h.customHeight) {
1391
+ const d = new Set(
1383
1392
  Object.keys(e.config.rowlen || {})
1384
1393
  ), P = {};
1385
1394
  Object.entries(e.config.customHeight).forEach(
1386
- ([V, Y]) => {
1387
- b.has(V) && Number(Y) === 1 && (P[V] = 1);
1395
+ ([F, Y]) => {
1396
+ d.has(F) && Number(Y) === 1 && (P[F] = 1);
1388
1397
  }
1389
1398
  ), e.config.customHeight = P;
1390
1399
  }
1391
- if (Me[d]) {
1392
- const b = Number(e.defaultColWidth) || Number(
1393
- (i = (h = (x = y.current) == null ? void 0 : x.getSettings) == null ? void 0 : h.call(x)) == null ? void 0 : i.defaultColWidth
1400
+ if (Me[b]) {
1401
+ const d = Number(e.defaultColWidth) || Number(
1402
+ (A = (c = (i = k.current) == null ? void 0 : i.getSettings) == null ? void 0 : c.call(i)) == null ? void 0 : A.defaultColWidth
1394
1403
  ) || 99, P = Number(e.defaultRowHeight) || Number(
1395
- (o = (k = (c = y.current) == null ? void 0 : c.getSettings) == null ? void 0 : k.call(c)) == null ? void 0 : o.defaultRowHeight
1404
+ (E = (l = (o = k.current) == null ? void 0 : o.getSettings) == null ? void 0 : l.call(o)) == null ? void 0 : E.defaultRowHeight
1396
1405
  ) || 21;
1397
1406
  e.images = Te(
1398
- Me[d],
1407
+ Me[b],
1399
1408
  e,
1400
- b,
1409
+ d,
1401
1410
  P
1402
1411
  );
1403
1412
  }
1404
- const l = _e[d], _ = $e[d], A = [], D = (b, P) => {
1405
- const V = `${b}_${P}`;
1406
- D._seen == null && (D._seen = /* @__PURE__ */ new Set());
1407
- const Y = D._seen;
1408
- Y.has(V) || (Y.add(V), A.push({ r: b, c: P, id: e.id }));
1409
- }, U = (s = e.config) != null && s.merge ? /* @__PURE__ */ new Map() : null;
1413
+ const y = _e[b], _ = $e[b], H = [], U = (d, P) => {
1414
+ const F = `${d}_${P}`;
1415
+ U._seen == null && (U._seen = /* @__PURE__ */ new Set());
1416
+ const Y = U._seen;
1417
+ Y.has(F) || (Y.add(F), H.push({ r: d, c: P, id: e.id }));
1418
+ }, S = (L = e.config) != null && L.merge ? /* @__PURE__ */ new Map() : null;
1410
1419
  if (e.celldata)
1411
- for (const b of e.celldata) {
1412
- const P = `${b.r}_${b.c}`;
1413
- if (U == null || U.set(
1420
+ for (const d of e.celldata) {
1421
+ const P = `${d.r}_${d.c}`;
1422
+ if (S == null || S.set(
1414
1423
  P,
1415
- b
1416
- ), b.v) {
1417
- if (b.v.f) {
1418
- const B = String(b.v.f);
1419
- B.startsWith("=") || (b.v.f = `=${B}`);
1424
+ d
1425
+ ), d.v) {
1426
+ if (d.v.f) {
1427
+ const j = String(d.v.f);
1428
+ j.startsWith("=") || (d.v.f = `=${j}`);
1420
1429
  }
1421
- if (b.v.f && ((E = b.v.ct) == null ? void 0 : E.t) !== "d" && (b.v.ct = { ...b.v.ct ?? {}, t: "str" }, D(b.r, b.c)), _ != null && _[P]) {
1422
- const B = _[P];
1423
- if (!!(l != null && l[P])) {
1424
- const { fc: K, un: Oe, ...Xe } = B;
1425
- Object.assign(b.v, Xe);
1430
+ if (d.v.f && ((B = d.v.ct) == null ? void 0 : B.t) !== "d" && (d.v.ct = { ...d.v.ct ?? {}, t: "str" }, U(d.r, d.c)), _ != null && _[P]) {
1431
+ const j = _[P];
1432
+ if (!!(y != null && y[P])) {
1433
+ const { fc: ee, un: Oe, ...Je } = j;
1434
+ Object.assign(d.v, Je);
1426
1435
  } else
1427
- Object.assign(b.v, B);
1436
+ Object.assign(d.v, j);
1428
1437
  }
1429
- if (l != null && l[P] && !b.v.f) {
1430
- const B = l[P][0];
1431
- B && tt(
1432
- b.v,
1433
- B
1438
+ if (y != null && y[P] && !d.v.f) {
1439
+ const j = y[P][0];
1440
+ j && nt(
1441
+ d.v,
1442
+ j
1434
1443
  );
1435
1444
  }
1436
- const V = (H = b.v.ct) == null ? void 0 : H.fa, Y = typeof V == "string" ? V.trim().toLowerCase() : "", te = Y === "general" || ((j = b.v.ct) == null ? void 0 : j.t) === "g", he = Y === "@" || ((W = b.v.ct) == null ? void 0 : W.t) === "s";
1437
- if (V && !le.has(V) && le.set(V, Pe.is_date(V)), !b.v.f && V && le.get(V)) {
1438
- const B = typeof b.v.v == "string" ? parseFloat(b.v.v) : b.v.v;
1439
- if (typeof B == "number" && !isNaN(B))
1445
+ const F = (W = d.v.ct) == null ? void 0 : W.fa, Y = typeof F == "string" ? F.trim().toLowerCase() : "", K = Y === "general" || ((N = d.v.ct) == null ? void 0 : N.t) === "g", he = Y === "@" || ((be = d.v.ct) == null ? void 0 : be.t) === "s";
1446
+ if (F && !le.has(F) && le.set(F, Pe.is_date(F)), !d.v.f && F && le.get(F)) {
1447
+ const j = typeof d.v.v == "string" ? parseFloat(d.v.v) : d.v.v;
1448
+ if (typeof j == "number" && !isNaN(j))
1440
1449
  try {
1441
- b.v.v = B, b.v.m = Pe.format(V, B), b.v.ct = { ...b.v.ct, t: "d" };
1450
+ d.v.v = j, d.v.m = Pe.format(F, j), d.v.ct = { ...d.v.ct, t: "d" };
1442
1451
  } catch {
1443
1452
  }
1444
- } else if (!b.v.f && typeof b.v.v == "string" && !he && !te) {
1445
- const B = b.v.v.trim();
1453
+ } else if (!d.v.f && typeof d.v.v == "string" && !he && !K) {
1454
+ const j = d.v.v.trim();
1446
1455
  if (/^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?$/.test(
1447
- B
1456
+ j
1448
1457
  )) {
1449
- const K = Number(B);
1450
- if (!isFinite(K))
1458
+ const ee = Number(j);
1459
+ if (!isFinite(ee))
1451
1460
  continue;
1452
- if (b.v.v = K, b.v.ht == null && (b.v.ht = 2), !V)
1453
- b.v.m = String(K);
1461
+ if (d.v.v = ee, d.v.ht == null && (d.v.ht = 2), !F)
1462
+ d.v.m = String(ee);
1454
1463
  else
1455
1464
  try {
1456
- b.v.m = Pe.format(V, K);
1465
+ d.v.m = Pe.format(F, ee);
1457
1466
  } catch {
1458
1467
  }
1459
1468
  }
1460
- } else !b.v.f && typeof b.v.v == "number" && isFinite(b.v.v) && ((S = b.v.ct) == null ? void 0 : S.t) !== "s" && ((be = b.v.ct) == null ? void 0 : be.t) !== "d" && b.v.ht == null && (b.v.ht = 2);
1461
- if (!b.v.f && (b.v.m === void 0 || b.v.m === null) && ((ve = b.v.ct) == null ? void 0 : ve.t) !== "d") {
1462
- const B = ot((me = b.v.ct) == null ? void 0 : me.s), q = b.v.v;
1469
+ } else !d.v.f && typeof d.v.v == "number" && isFinite(d.v.v) && ((ve = d.v.ct) == null ? void 0 : ve.t) !== "s" && ((me = d.v.ct) == null ? void 0 : me.t) !== "d" && d.v.ht == null && (d.v.ht = 2);
1470
+ if (!d.v.f && (d.v.m === void 0 || d.v.m === null) && ((z = d.v.ct) == null ? void 0 : z.t) !== "d") {
1471
+ const j = st((pe = d.v.ct) == null ? void 0 : pe.s), q = d.v.v;
1463
1472
  if (!(q == null || String(q).trim() === ""))
1464
- if (B != null)
1465
- b.v.m = B;
1473
+ if (j != null)
1474
+ d.v.m = j;
1466
1475
  else if (typeof q == "boolean")
1467
- b.v.m = lt(q);
1476
+ d.v.m = ut(q);
1468
1477
  else if (typeof q == "number" && isFinite(q)) {
1469
- const Oe = (z = b.v.ct) == null ? void 0 : z.fa;
1478
+ const Oe = (We = d.v.ct) == null ? void 0 : We.fa;
1470
1479
  if (typeof Oe == "string" && Oe && le.get(Oe) === !1)
1471
1480
  try {
1472
- b.v.m = Pe.format(Oe, q);
1481
+ d.v.m = Pe.format(Oe, q);
1473
1482
  } catch {
1474
- b.v.m = String(q);
1483
+ d.v.m = String(q);
1475
1484
  }
1476
1485
  else
1477
- b.v.m = String(q);
1478
- } else typeof q == "object" || (b.v.m = String(q));
1486
+ d.v.m = String(q);
1487
+ } else typeof q == "object" || (d.v.m = String(q));
1479
1488
  }
1480
1489
  }
1481
1490
  }
1482
1491
  if (Array.isArray(e.data)) {
1483
- const b = e.data;
1484
- for (let P = 0; P < b.length; P++) {
1485
- const V = b[P];
1486
- if (Array.isArray(V))
1487
- for (let Y = 0; Y < V.length; Y++) {
1488
- const te = V[Y];
1489
- if (!te || typeof te != "object" || !te.f) continue;
1490
- const he = String(te.f);
1491
- he.startsWith("=") || (te.f = `=${he}`), ((pe = te.ct) == null ? void 0 : pe.t) !== "d" && (te.ct = { ...te.ct ?? {}, t: "str" }, D(P, Y));
1492
+ const d = e.data;
1493
+ for (let P = 0; P < d.length; P++) {
1494
+ const F = d[P];
1495
+ if (Array.isArray(F))
1496
+ for (let Y = 0; Y < F.length; Y++) {
1497
+ const K = F[Y];
1498
+ if (!K || typeof K != "object" || !K.f) continue;
1499
+ const he = String(K.f);
1500
+ he.startsWith("=") || (K.f = `=${he}`), ((Ie = K.ct) == null ? void 0 : Ie.t) !== "d" && (K.ct = { ...K.ct ?? {}, t: "str" }, U(P, Y));
1492
1501
  }
1493
1502
  }
1494
1503
  }
1495
- if (e.calcChain = A, U && ((We = e.config) != null && We.merge) && e.celldata)
1496
- for (const b of Object.values(e.config.merge)) {
1497
- const { r: P, c: V, rs: Y, cs: te } = b;
1504
+ if (e.calcChain = H, S && ((Ue = e.config) != null && Ue.merge) && e.celldata)
1505
+ for (const d of Object.values(e.config.merge)) {
1506
+ const { r: P, c: F, rs: Y, cs: K } = d;
1498
1507
  for (let he = 0; he < Y; he++)
1499
- for (let B = 0; B < te; B++) {
1500
- const q = `${P + he}_${V + B}`;
1501
- let K = U.get(q);
1502
- K || (K = { r: P + he, c: V + B, v: {} }, e.celldata.push(K), U.set(q, K)), K.v || (K.v = {}), K.v.mc = he === 0 && B === 0 ? { r: P, c: V, rs: Y, cs: te } : { r: P, c: V };
1508
+ for (let j = 0; j < K; j++) {
1509
+ const q = `${P + he}_${F + j}`;
1510
+ if (he !== 0 || j !== 0) continue;
1511
+ let ee = S.get(q);
1512
+ ee ? (ee.v || (ee.v = {}), ee.v.mc = { r: P, c: F, rs: Y, cs: K }) : (ee = {
1513
+ r: P + he,
1514
+ c: F + j,
1515
+ v: { mc: { r: P, c: F, rs: Y, cs: K } }
1516
+ }, e.celldata.push(ee), S.set(q, ee));
1503
1517
  }
1504
1518
  }
1505
1519
  return e;
@@ -1509,23 +1523,23 @@ async function _t({
1509
1523
  sheets: ae
1510
1524
  });
1511
1525
  let t;
1512
- if (J === "merge-current-dsheet" ? t = [...de, ...ae] : t = [...ae], t = t.map((e, d) => (e.order = d, e)), u.current.transact(() => {
1513
- J !== "merge-current-dsheet" && ee.delete(0, ee.length), t.forEach((e) => {
1514
- if (e instanceof Je.Map) return;
1515
- const d = Qe(e);
1516
- ee.push([d()]);
1526
+ if (J === "merge-current-dsheet" ? t = [...de, ...ae] : t = [...ae], t = t.map((e, b) => (e.order = b, e)), s.current.transact(() => {
1527
+ J !== "merge-current-dsheet" && te.delete(0, te.length), t.forEach((e) => {
1528
+ if (e instanceof Ke.Map) return;
1529
+ const b = et(e);
1530
+ te.push([b()]);
1517
1531
  });
1518
- }), u != null && u.current) {
1519
- const e = u.current.getArray(w), d = Ke(e);
1520
- p.current = d, g((a) => a + 1);
1532
+ }), s != null && s.current) {
1533
+ const e = s.current.getArray(w), b = tt(e);
1534
+ p.current = b, g((a) => a + 1);
1521
1535
  }
1522
- F != null && F.headless || st(y);
1523
- const n = et((m = X == null ? void 0 : X.info) == null ? void 0 : m.name);
1536
+ V != null && V.headless || ht(k);
1537
+ const n = rt((m = X == null ? void 0 : X.info) == null ? void 0 : m.name);
1524
1538
  v == null || v(n), Q();
1525
1539
  }
1526
1540
  );
1527
1541
  } catch (ke) {
1528
- console.error("Error loading the workbook", ke), !(F != null && F.suppressUiWarnings) && typeof alert < "u" && alert(
1542
+ console.error("Error loading the workbook", ke), !(V != null && V.suppressUiWarnings) && typeof alert < "u" && alert(
1529
1543
  "Error loading the workbook. Please ensure it is a valid .xlsx file."
1530
1544
  ), M(ke);
1531
1545
  }
@@ -1533,5 +1547,5 @@ async function _t({
1533
1547
  });
1534
1548
  }
1535
1549
  export {
1536
- _t as runXlsxFileUpload
1550
+ xt as runXlsxFileUpload
1537
1551
  };