@base-web-kits/base-tools-ts 1.3.12 → 1.3.15

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/dist/index.cjs CHANGED
@@ -20,6 +20,9 @@ var __spreadValues = (a, b) => {
20
20
  }
21
21
  return a;
22
22
  };
23
+ var __commonJS = (cb, mod) => function __require() {
24
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
25
+ };
23
26
  var __export = (target, all) => {
24
27
  for (var name in all)
25
28
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -63,11 +66,686 @@ var __async = (__this, __arguments, generator) => {
63
66
  });
64
67
  };
65
68
 
69
+ // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/dayjs.min.js
70
+ var require_dayjs_min = __commonJS({
71
+ "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/dayjs.min.js"(exports2, module2) {
72
+ "use strict";
73
+ !(function(t, e) {
74
+ "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
75
+ })(exports2, (function() {
76
+ "use strict";
77
+ var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
78
+ var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
79
+ return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
80
+ } }, m = function(t2, e2, n2) {
81
+ var r2 = String(t2);
82
+ return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
83
+ }, v = { s: m, z: function(t2) {
84
+ var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
85
+ return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
86
+ }, m: function t2(e2, n2) {
87
+ if (e2.date() < n2.date()) return -t2(n2, e2);
88
+ var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
89
+ return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
90
+ }, a: function(t2) {
91
+ return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
92
+ }, p: function(t2) {
93
+ return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
94
+ }, u: function(t2) {
95
+ return void 0 === t2;
96
+ } }, g = "en", D = {};
97
+ D[g] = M;
98
+ var p = "$isDayjsObject", S = function(t2) {
99
+ return t2 instanceof _ || !(!t2 || !t2[p]);
100
+ }, w = function t2(e2, n2, r2) {
101
+ var i2;
102
+ if (!e2) return g;
103
+ if ("string" == typeof e2) {
104
+ var s2 = e2.toLowerCase();
105
+ D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
106
+ var u2 = e2.split("-");
107
+ if (!i2 && u2.length > 1) return t2(u2[0]);
108
+ } else {
109
+ var a2 = e2.name;
110
+ D[a2] = e2, i2 = a2;
111
+ }
112
+ return !r2 && i2 && (g = i2), i2 || !r2 && g;
113
+ }, O = function(t2, e2) {
114
+ if (S(t2)) return t2.clone();
115
+ var n2 = "object" == typeof e2 ? e2 : {};
116
+ return n2.date = t2, n2.args = arguments, new _(n2);
117
+ }, b = v;
118
+ b.l = w, b.i = S, b.w = function(t2, e2) {
119
+ return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
120
+ };
121
+ var _ = (function() {
122
+ function M2(t2) {
123
+ this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
124
+ }
125
+ var m2 = M2.prototype;
126
+ return m2.parse = function(t2) {
127
+ this.$d = (function(t3) {
128
+ var e2 = t3.date, n2 = t3.utc;
129
+ if (null === e2) return /* @__PURE__ */ new Date(NaN);
130
+ if (b.u(e2)) return /* @__PURE__ */ new Date();
131
+ if (e2 instanceof Date) return new Date(e2);
132
+ if ("string" == typeof e2 && !/Z$/i.test(e2)) {
133
+ var r2 = e2.match($);
134
+ if (r2) {
135
+ var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
136
+ return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
137
+ }
138
+ }
139
+ return new Date(e2);
140
+ })(t2), this.init();
141
+ }, m2.init = function() {
142
+ var t2 = this.$d;
143
+ this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
144
+ }, m2.$utils = function() {
145
+ return b;
146
+ }, m2.isValid = function() {
147
+ return !(this.$d.toString() === l);
148
+ }, m2.isSame = function(t2, e2) {
149
+ var n2 = O(t2);
150
+ return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
151
+ }, m2.isAfter = function(t2, e2) {
152
+ return O(t2) < this.startOf(e2);
153
+ }, m2.isBefore = function(t2, e2) {
154
+ return this.endOf(e2) < O(t2);
155
+ }, m2.$g = function(t2, e2, n2) {
156
+ return b.u(t2) ? this[e2] : this.set(n2, t2);
157
+ }, m2.unix = function() {
158
+ return Math.floor(this.valueOf() / 1e3);
159
+ }, m2.valueOf = function() {
160
+ return this.$d.getTime();
161
+ }, m2.startOf = function(t2, e2) {
162
+ var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
163
+ var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
164
+ return r2 ? i2 : i2.endOf(a);
165
+ }, $2 = function(t3, e3) {
166
+ return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
167
+ }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
168
+ switch (f2) {
169
+ case h:
170
+ return r2 ? l2(1, 0) : l2(31, 11);
171
+ case c:
172
+ return r2 ? l2(1, M3) : l2(0, M3 + 1);
173
+ case o:
174
+ var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
175
+ return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
176
+ case a:
177
+ case d:
178
+ return $2(v2 + "Hours", 0);
179
+ case u:
180
+ return $2(v2 + "Minutes", 1);
181
+ case s:
182
+ return $2(v2 + "Seconds", 2);
183
+ case i:
184
+ return $2(v2 + "Milliseconds", 3);
185
+ default:
186
+ return this.clone();
187
+ }
188
+ }, m2.endOf = function(t2) {
189
+ return this.startOf(t2, false);
190
+ }, m2.$set = function(t2, e2) {
191
+ var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
192
+ if (o2 === c || o2 === h) {
193
+ var y2 = this.clone().set(d, 1);
194
+ y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
195
+ } else l2 && this.$d[l2]($2);
196
+ return this.init(), this;
197
+ }, m2.set = function(t2, e2) {
198
+ return this.clone().$set(t2, e2);
199
+ }, m2.get = function(t2) {
200
+ return this[b.p(t2)]();
201
+ }, m2.add = function(r2, f2) {
202
+ var d2, l2 = this;
203
+ r2 = Number(r2);
204
+ var $2 = b.p(f2), y2 = function(t2) {
205
+ var e2 = O(l2);
206
+ return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
207
+ };
208
+ if ($2 === c) return this.set(c, this.$M + r2);
209
+ if ($2 === h) return this.set(h, this.$y + r2);
210
+ if ($2 === a) return y2(1);
211
+ if ($2 === o) return y2(7);
212
+ var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
213
+ return b.w(m3, this);
214
+ }, m2.subtract = function(t2, e2) {
215
+ return this.add(-1 * t2, e2);
216
+ }, m2.format = function(t2) {
217
+ var e2 = this, n2 = this.$locale();
218
+ if (!this.isValid()) return n2.invalidDate || l;
219
+ var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
220
+ return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
221
+ }, d2 = function(t3) {
222
+ return b.s(s2 % 12 || 12, t3, "0");
223
+ }, $2 = f2 || function(t3, e3, n3) {
224
+ var r3 = t3 < 12 ? "AM" : "PM";
225
+ return n3 ? r3.toLowerCase() : r3;
226
+ };
227
+ return r2.replace(y, (function(t3, r3) {
228
+ return r3 || (function(t4) {
229
+ switch (t4) {
230
+ case "YY":
231
+ return String(e2.$y).slice(-2);
232
+ case "YYYY":
233
+ return b.s(e2.$y, 4, "0");
234
+ case "M":
235
+ return a2 + 1;
236
+ case "MM":
237
+ return b.s(a2 + 1, 2, "0");
238
+ case "MMM":
239
+ return h2(n2.monthsShort, a2, c2, 3);
240
+ case "MMMM":
241
+ return h2(c2, a2);
242
+ case "D":
243
+ return e2.$D;
244
+ case "DD":
245
+ return b.s(e2.$D, 2, "0");
246
+ case "d":
247
+ return String(e2.$W);
248
+ case "dd":
249
+ return h2(n2.weekdaysMin, e2.$W, o2, 2);
250
+ case "ddd":
251
+ return h2(n2.weekdaysShort, e2.$W, o2, 3);
252
+ case "dddd":
253
+ return o2[e2.$W];
254
+ case "H":
255
+ return String(s2);
256
+ case "HH":
257
+ return b.s(s2, 2, "0");
258
+ case "h":
259
+ return d2(1);
260
+ case "hh":
261
+ return d2(2);
262
+ case "a":
263
+ return $2(s2, u2, true);
264
+ case "A":
265
+ return $2(s2, u2, false);
266
+ case "m":
267
+ return String(u2);
268
+ case "mm":
269
+ return b.s(u2, 2, "0");
270
+ case "s":
271
+ return String(e2.$s);
272
+ case "ss":
273
+ return b.s(e2.$s, 2, "0");
274
+ case "SSS":
275
+ return b.s(e2.$ms, 3, "0");
276
+ case "Z":
277
+ return i2;
278
+ }
279
+ return null;
280
+ })(t3) || i2.replace(":", "");
281
+ }));
282
+ }, m2.utcOffset = function() {
283
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
284
+ }, m2.diff = function(r2, d2, l2) {
285
+ var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
286
+ return b.m(y2, m3);
287
+ };
288
+ switch (M3) {
289
+ case h:
290
+ $2 = D2() / 12;
291
+ break;
292
+ case c:
293
+ $2 = D2();
294
+ break;
295
+ case f:
296
+ $2 = D2() / 3;
297
+ break;
298
+ case o:
299
+ $2 = (g2 - v2) / 6048e5;
300
+ break;
301
+ case a:
302
+ $2 = (g2 - v2) / 864e5;
303
+ break;
304
+ case u:
305
+ $2 = g2 / n;
306
+ break;
307
+ case s:
308
+ $2 = g2 / e;
309
+ break;
310
+ case i:
311
+ $2 = g2 / t;
312
+ break;
313
+ default:
314
+ $2 = g2;
315
+ }
316
+ return l2 ? $2 : b.a($2);
317
+ }, m2.daysInMonth = function() {
318
+ return this.endOf(c).$D;
319
+ }, m2.$locale = function() {
320
+ return D[this.$L];
321
+ }, m2.locale = function(t2, e2) {
322
+ if (!t2) return this.$L;
323
+ var n2 = this.clone(), r2 = w(t2, e2, true);
324
+ return r2 && (n2.$L = r2), n2;
325
+ }, m2.clone = function() {
326
+ return b.w(this.$d, this);
327
+ }, m2.toDate = function() {
328
+ return new Date(this.valueOf());
329
+ }, m2.toJSON = function() {
330
+ return this.isValid() ? this.toISOString() : null;
331
+ }, m2.toISOString = function() {
332
+ return this.$d.toISOString();
333
+ }, m2.toString = function() {
334
+ return this.$d.toUTCString();
335
+ }, M2;
336
+ })(), k = _.prototype;
337
+ return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach((function(t2) {
338
+ k[t2[1]] = function(e2) {
339
+ return this.$g(e2, t2[0], t2[1]);
340
+ };
341
+ })), O.extend = function(t2, e2) {
342
+ return t2.$i || (t2(e2, _, O), t2.$i = true), O;
343
+ }, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
344
+ return O(1e3 * t2);
345
+ }, O.en = D[g], O.Ls = D, O.p = {}, O;
346
+ }));
347
+ }
348
+ });
349
+
350
+ // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/customParseFormat.js
351
+ var require_customParseFormat = __commonJS({
352
+ "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/customParseFormat.js"(exports2, module2) {
353
+ "use strict";
354
+ !(function(e, t) {
355
+ "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_customParseFormat = t();
356
+ })(exports2, (function() {
357
+ "use strict";
358
+ var e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d/, r = /\d\d/, i = /\d\d?/, o = /\d*[^-_:/,()\s\d]+/, s = {}, a = function(e2) {
359
+ return (e2 = +e2) + (e2 > 68 ? 1900 : 2e3);
360
+ };
361
+ var f = function(e2) {
362
+ return function(t2) {
363
+ this[e2] = +t2;
364
+ };
365
+ }, h = [/[+-]\d\d:?(\d\d)?|Z/, function(e2) {
366
+ (this.zone || (this.zone = {})).offset = (function(e3) {
367
+ if (!e3) return 0;
368
+ if ("Z" === e3) return 0;
369
+ var t2 = e3.match(/([+-]|\d\d)/g), n2 = 60 * t2[1] + (+t2[2] || 0);
370
+ return 0 === n2 ? 0 : "+" === t2[0] ? -n2 : n2;
371
+ })(e2);
372
+ }], u = function(e2) {
373
+ var t2 = s[e2];
374
+ return t2 && (t2.indexOf ? t2 : t2.s.concat(t2.f));
375
+ }, d = function(e2, t2) {
376
+ var n2, r2 = s.meridiem;
377
+ if (r2) {
378
+ for (var i2 = 1; i2 <= 24; i2 += 1) if (e2.indexOf(r2(i2, 0, t2)) > -1) {
379
+ n2 = i2 > 12;
380
+ break;
381
+ }
382
+ } else n2 = e2 === (t2 ? "pm" : "PM");
383
+ return n2;
384
+ }, c = { A: [o, function(e2) {
385
+ this.afternoon = d(e2, false);
386
+ }], a: [o, function(e2) {
387
+ this.afternoon = d(e2, true);
388
+ }], Q: [n, function(e2) {
389
+ this.month = 3 * (e2 - 1) + 1;
390
+ }], S: [n, function(e2) {
391
+ this.milliseconds = 100 * +e2;
392
+ }], SS: [r, function(e2) {
393
+ this.milliseconds = 10 * +e2;
394
+ }], SSS: [/\d{3}/, function(e2) {
395
+ this.milliseconds = +e2;
396
+ }], s: [i, f("seconds")], ss: [i, f("seconds")], m: [i, f("minutes")], mm: [i, f("minutes")], H: [i, f("hours")], h: [i, f("hours")], HH: [i, f("hours")], hh: [i, f("hours")], D: [i, f("day")], DD: [r, f("day")], Do: [o, function(e2) {
397
+ var t2 = s.ordinal, n2 = e2.match(/\d+/);
398
+ if (this.day = n2[0], t2) for (var r2 = 1; r2 <= 31; r2 += 1) t2(r2).replace(/\[|\]/g, "") === e2 && (this.day = r2);
399
+ }], w: [i, f("week")], ww: [r, f("week")], M: [i, f("month")], MM: [r, f("month")], MMM: [o, function(e2) {
400
+ var t2 = u("months"), n2 = (u("monthsShort") || t2.map((function(e3) {
401
+ return e3.slice(0, 3);
402
+ }))).indexOf(e2) + 1;
403
+ if (n2 < 1) throw new Error();
404
+ this.month = n2 % 12 || n2;
405
+ }], MMMM: [o, function(e2) {
406
+ var t2 = u("months").indexOf(e2) + 1;
407
+ if (t2 < 1) throw new Error();
408
+ this.month = t2 % 12 || t2;
409
+ }], Y: [/[+-]?\d+/, f("year")], YY: [r, function(e2) {
410
+ this.year = a(e2);
411
+ }], YYYY: [/\d{4}/, f("year")], Z: h, ZZ: h };
412
+ function l(n2) {
413
+ var r2, i2;
414
+ r2 = n2, i2 = s && s.formats;
415
+ for (var o2 = (n2 = r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(t2, n3, r3) {
416
+ var o3 = r3 && r3.toUpperCase();
417
+ return n3 || i2[r3] || e[r3] || i2[o3].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(e2, t3, n4) {
418
+ return t3 || n4.slice(1);
419
+ }));
420
+ }))).match(t), a2 = o2.length, f2 = 0; f2 < a2; f2 += 1) {
421
+ var h2 = o2[f2], u2 = c[h2], d2 = u2 && u2[0], l2 = u2 && u2[1];
422
+ o2[f2] = l2 ? { regex: d2, parser: l2 } : h2.replace(/^\[|\]$/g, "");
423
+ }
424
+ return function(e2) {
425
+ for (var t2 = {}, n3 = 0, r3 = 0; n3 < a2; n3 += 1) {
426
+ var i3 = o2[n3];
427
+ if ("string" == typeof i3) r3 += i3.length;
428
+ else {
429
+ var s2 = i3.regex, f3 = i3.parser, h3 = e2.slice(r3), u3 = s2.exec(h3)[0];
430
+ f3.call(t2, u3), e2 = e2.replace(u3, "");
431
+ }
432
+ }
433
+ return (function(e3) {
434
+ var t3 = e3.afternoon;
435
+ if (void 0 !== t3) {
436
+ var n4 = e3.hours;
437
+ t3 ? n4 < 12 && (e3.hours += 12) : 12 === n4 && (e3.hours = 0), delete e3.afternoon;
438
+ }
439
+ })(t2), t2;
440
+ };
441
+ }
442
+ return function(e2, t2, n2) {
443
+ n2.p.customParseFormat = true, e2 && e2.parseTwoDigitYear && (a = e2.parseTwoDigitYear);
444
+ var r2 = t2.prototype, i2 = r2.parse;
445
+ r2.parse = function(e3) {
446
+ var t3 = e3.date, r3 = e3.utc, o2 = e3.args;
447
+ this.$u = r3;
448
+ var a2 = o2[1];
449
+ if ("string" == typeof a2) {
450
+ var f2 = true === o2[2], h2 = true === o2[3], u2 = f2 || h2, d2 = o2[2];
451
+ h2 && (d2 = o2[2]), s = this.$locale(), !f2 && d2 && (s = n2.Ls[d2]), this.$d = (function(e4, t4, n3, r4) {
452
+ try {
453
+ if (["x", "X"].indexOf(t4) > -1) return new Date(("X" === t4 ? 1e3 : 1) * e4);
454
+ var i3 = l(t4)(e4), o3 = i3.year, s2 = i3.month, a3 = i3.day, f3 = i3.hours, h3 = i3.minutes, u3 = i3.seconds, d3 = i3.milliseconds, c3 = i3.zone, m2 = i3.week, M2 = /* @__PURE__ */ new Date(), Y = a3 || (o3 || s2 ? 1 : M2.getDate()), p = o3 || M2.getFullYear(), v = 0;
455
+ o3 && !s2 || (v = s2 > 0 ? s2 - 1 : M2.getMonth());
456
+ var D, w = f3 || 0, g = h3 || 0, y = u3 || 0, L = d3 || 0;
457
+ return c3 ? new Date(Date.UTC(p, v, Y, w, g, y, L + 60 * c3.offset * 1e3)) : n3 ? new Date(Date.UTC(p, v, Y, w, g, y, L)) : (D = new Date(p, v, Y, w, g, y, L), m2 && (D = r4(D).week(m2).toDate()), D);
458
+ } catch (e5) {
459
+ return /* @__PURE__ */ new Date("");
460
+ }
461
+ })(t3, a2, r3, n2), this.init(), d2 && true !== d2 && (this.$L = this.locale(d2).$L), u2 && t3 != this.format(a2) && (this.$d = /* @__PURE__ */ new Date("")), s = {};
462
+ } else if (a2 instanceof Array) for (var c2 = a2.length, m = 1; m <= c2; m += 1) {
463
+ o2[1] = a2[m - 1];
464
+ var M = n2.apply(this, o2);
465
+ if (M.isValid()) {
466
+ this.$d = M.$d, this.$L = M.$L, this.init();
467
+ break;
468
+ }
469
+ m === c2 && (this.$d = /* @__PURE__ */ new Date(""));
470
+ }
471
+ else i2.call(this, e3);
472
+ };
473
+ };
474
+ }));
475
+ }
476
+ });
477
+
478
+ // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/utc.js
479
+ var require_utc = __commonJS({
480
+ "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/utc.js"(exports2, module2) {
481
+ "use strict";
482
+ !(function(t, i) {
483
+ "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = i() : "function" == typeof define && define.amd ? define(i) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_utc = i();
484
+ })(exports2, (function() {
485
+ "use strict";
486
+ var t = "minute", i = /[+-]\d\d(?::?\d\d)?/g, e = /([+-]|\d\d)/g;
487
+ return function(s, f, n) {
488
+ var u = f.prototype;
489
+ n.utc = function(t2) {
490
+ var i2 = { date: t2, utc: true, args: arguments };
491
+ return new f(i2);
492
+ }, u.utc = function(i2) {
493
+ var e2 = n(this.toDate(), { locale: this.$L, utc: true });
494
+ return i2 ? e2.add(this.utcOffset(), t) : e2;
495
+ }, u.local = function() {
496
+ return n(this.toDate(), { locale: this.$L, utc: false });
497
+ };
498
+ var r = u.parse;
499
+ u.parse = function(t2) {
500
+ t2.utc && (this.$u = true), this.$utils().u(t2.$offset) || (this.$offset = t2.$offset), r.call(this, t2);
501
+ };
502
+ var o = u.init;
503
+ u.init = function() {
504
+ if (this.$u) {
505
+ var t2 = this.$d;
506
+ this.$y = t2.getUTCFullYear(), this.$M = t2.getUTCMonth(), this.$D = t2.getUTCDate(), this.$W = t2.getUTCDay(), this.$H = t2.getUTCHours(), this.$m = t2.getUTCMinutes(), this.$s = t2.getUTCSeconds(), this.$ms = t2.getUTCMilliseconds();
507
+ } else o.call(this);
508
+ };
509
+ var a = u.utcOffset;
510
+ u.utcOffset = function(s2, f2) {
511
+ var n2 = this.$utils().u;
512
+ if (n2(s2)) return this.$u ? 0 : n2(this.$offset) ? a.call(this) : this.$offset;
513
+ if ("string" == typeof s2 && (s2 = (function(t2) {
514
+ void 0 === t2 && (t2 = "");
515
+ var s3 = t2.match(i);
516
+ if (!s3) return null;
517
+ var f3 = ("" + s3[0]).match(e) || ["-", 0, 0], n3 = f3[0], u3 = 60 * +f3[1] + +f3[2];
518
+ return 0 === u3 ? 0 : "+" === n3 ? u3 : -u3;
519
+ })(s2), null === s2)) return this;
520
+ var u2 = Math.abs(s2) <= 16 ? 60 * s2 : s2;
521
+ if (0 === u2) return this.utc(f2);
522
+ var r2 = this.clone();
523
+ if (f2) return r2.$offset = u2, r2.$u = false, r2;
524
+ var o2 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
525
+ return (r2 = this.local().add(u2 + o2, t)).$offset = u2, r2.$x.$localOffset = o2, r2;
526
+ };
527
+ var h = u.format;
528
+ u.format = function(t2) {
529
+ var i2 = t2 || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
530
+ return h.call(this, i2);
531
+ }, u.valueOf = function() {
532
+ var t2 = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
533
+ return this.$d.valueOf() - 6e4 * t2;
534
+ }, u.isUTC = function() {
535
+ return !!this.$u;
536
+ }, u.toISOString = function() {
537
+ return this.toDate().toISOString();
538
+ }, u.toString = function() {
539
+ return this.toDate().toUTCString();
540
+ };
541
+ var l = u.toDate;
542
+ u.toDate = function(t2) {
543
+ return "s" === t2 && this.$offset ? n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : l.call(this);
544
+ };
545
+ var c = u.diff;
546
+ u.diff = function(t2, i2, e2) {
547
+ if (t2 && this.$u === t2.$u) return c.call(this, t2, i2, e2);
548
+ var s2 = this.local(), f2 = n(t2).local();
549
+ return c.call(s2, f2, i2, e2);
550
+ };
551
+ };
552
+ }));
553
+ }
554
+ });
555
+
556
+ // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/timezone.js
557
+ var require_timezone = __commonJS({
558
+ "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/timezone.js"(exports2, module2) {
559
+ "use strict";
560
+ !(function(t, e) {
561
+ "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_timezone = e();
562
+ })(exports2, (function() {
563
+ "use strict";
564
+ var t = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, e = {};
565
+ return function(n, i, o) {
566
+ var r, a = function(t2, n2, i2) {
567
+ void 0 === i2 && (i2 = {});
568
+ var o2 = new Date(t2), r2 = (function(t3, n3) {
569
+ void 0 === n3 && (n3 = {});
570
+ var i3 = n3.timeZoneName || "short", o3 = t3 + "|" + i3, r3 = e[o3];
571
+ return r3 || (r3 = new Intl.DateTimeFormat("en-US", { hour12: false, timeZone: t3, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: i3 }), e[o3] = r3), r3;
572
+ })(n2, i2);
573
+ return r2.formatToParts(o2);
574
+ }, u = function(e2, n2) {
575
+ for (var i2 = a(e2, n2), r2 = [], u2 = 0; u2 < i2.length; u2 += 1) {
576
+ var f2 = i2[u2], s2 = f2.type, m = f2.value, c = t[s2];
577
+ c >= 0 && (r2[c] = parseInt(m, 10));
578
+ }
579
+ var d = r2[3], l = 24 === d ? 0 : d, h = r2[0] + "-" + r2[1] + "-" + r2[2] + " " + l + ":" + r2[4] + ":" + r2[5] + ":000", v = +e2;
580
+ return (o.utc(h).valueOf() - (v -= v % 1e3)) / 6e4;
581
+ }, f = i.prototype;
582
+ f.tz = function(t2, e2) {
583
+ void 0 === t2 && (t2 = r);
584
+ var n2, i2 = this.utcOffset(), a2 = this.toDate(), u2 = a2.toLocaleString("en-US", { timeZone: t2 }), f2 = Math.round((a2 - new Date(u2)) / 1e3 / 60), s2 = 15 * -Math.round(a2.getTimezoneOffset() / 15) - f2;
585
+ if (!Number(s2)) n2 = this.utcOffset(0, e2);
586
+ else if (n2 = o(u2, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(s2, true), e2) {
587
+ var m = n2.utcOffset();
588
+ n2 = n2.add(i2 - m, "minute");
589
+ }
590
+ return n2.$x.$timezone = t2, n2;
591
+ }, f.offsetName = function(t2) {
592
+ var e2 = this.$x.$timezone || o.tz.guess(), n2 = a(this.valueOf(), e2, { timeZoneName: t2 }).find((function(t3) {
593
+ return "timezonename" === t3.type.toLowerCase();
594
+ }));
595
+ return n2 && n2.value;
596
+ };
597
+ var s = f.startOf;
598
+ f.startOf = function(t2, e2) {
599
+ if (!this.$x || !this.$x.$timezone) return s.call(this, t2, e2);
600
+ var n2 = o(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
601
+ return s.call(n2, t2, e2).tz(this.$x.$timezone, true);
602
+ }, o.tz = function(t2, e2, n2) {
603
+ var i2 = n2 && e2, a2 = n2 || e2 || r, f2 = u(+o(), a2);
604
+ if ("string" != typeof t2) return o(t2).tz(a2);
605
+ var s2 = (function(t3, e3, n3) {
606
+ var i3 = t3 - 60 * e3 * 1e3, o2 = u(i3, n3);
607
+ if (e3 === o2) return [i3, e3];
608
+ var r2 = u(i3 -= 60 * (o2 - e3) * 1e3, n3);
609
+ return o2 === r2 ? [i3, o2] : [t3 - 60 * Math.min(o2, r2) * 1e3, Math.max(o2, r2)];
610
+ })(o.utc(t2, i2).valueOf(), f2, a2), m = s2[0], c = s2[1], d = o(m).utcOffset(c);
611
+ return d.$x.$timezone = a2, d;
612
+ }, o.tz.guess = function() {
613
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
614
+ }, o.tz.setDefault = function(t2) {
615
+ r = t2;
616
+ };
617
+ };
618
+ }));
619
+ }
620
+ });
621
+
622
+ // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/relativeTime.js
623
+ var require_relativeTime = __commonJS({
624
+ "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/relativeTime.js"(exports2, module2) {
625
+ "use strict";
626
+ !(function(r, e) {
627
+ "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = e() : "function" == typeof define && define.amd ? define(e) : (r = "undefined" != typeof globalThis ? globalThis : r || self).dayjs_plugin_relativeTime = e();
628
+ })(exports2, (function() {
629
+ "use strict";
630
+ return function(r, e, t) {
631
+ r = r || {};
632
+ var n = e.prototype, o = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
633
+ function i(r2, e2, t2, o2) {
634
+ return n.fromToBase(r2, e2, t2, o2);
635
+ }
636
+ t.en.relativeTime = o, n.fromToBase = function(e2, n2, i2, d2, u) {
637
+ for (var f, a, s, l = i2.$locale().relativeTime || o, h = r.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], m = h.length, c = 0; c < m; c += 1) {
638
+ var y = h[c];
639
+ y.d && (f = d2 ? t(e2).diff(i2, y.d, true) : i2.diff(e2, y.d, true));
640
+ var p = (r.rounding || Math.round)(Math.abs(f));
641
+ if (s = f > 0, p <= y.r || !y.r) {
642
+ p <= 1 && c > 0 && (y = h[c - 1]);
643
+ var v = l[y.l];
644
+ u && (p = u("" + p)), a = "string" == typeof v ? v.replace("%d", p) : v(p, n2, y.l, s);
645
+ break;
646
+ }
647
+ }
648
+ if (n2) return a;
649
+ var M = s ? l.future : l.past;
650
+ return "function" == typeof M ? M(a) : M.replace("%s", a);
651
+ }, n.to = function(r2, e2) {
652
+ return i(r2, e2, this, true);
653
+ }, n.from = function(r2, e2) {
654
+ return i(r2, e2, this);
655
+ };
656
+ var d = function(r2) {
657
+ return r2.$u ? t.utc() : t();
658
+ };
659
+ n.toNow = function(r2) {
660
+ return this.to(d(this), r2);
661
+ }, n.fromNow = function(r2) {
662
+ return this.from(d(this), r2);
663
+ };
664
+ };
665
+ }));
666
+ }
667
+ });
668
+
669
+ // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/advancedFormat.js
670
+ var require_advancedFormat = __commonJS({
671
+ "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/advancedFormat.js"(exports2, module2) {
672
+ "use strict";
673
+ !(function(e, t) {
674
+ "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_advancedFormat = t();
675
+ })(exports2, (function() {
676
+ "use strict";
677
+ return function(e, t) {
678
+ var r = t.prototype, n = r.format;
679
+ r.format = function(e2) {
680
+ var t2 = this, r2 = this.$locale();
681
+ if (!this.isValid()) return n.bind(this)(e2);
682
+ var s = this.$utils(), a = (e2 || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, (function(e3) {
683
+ switch (e3) {
684
+ case "Q":
685
+ return Math.ceil((t2.$M + 1) / 3);
686
+ case "Do":
687
+ return r2.ordinal(t2.$D);
688
+ case "gggg":
689
+ return t2.weekYear();
690
+ case "GGGG":
691
+ return t2.isoWeekYear();
692
+ case "wo":
693
+ return r2.ordinal(t2.week(), "W");
694
+ case "w":
695
+ case "ww":
696
+ return s.s(t2.week(), "w" === e3 ? 1 : 2, "0");
697
+ case "W":
698
+ case "WW":
699
+ return s.s(t2.isoWeek(), "W" === e3 ? 1 : 2, "0");
700
+ case "k":
701
+ case "kk":
702
+ return s.s(String(0 === t2.$H ? 24 : t2.$H), "k" === e3 ? 1 : 2, "0");
703
+ case "X":
704
+ return Math.floor(t2.$d.getTime() / 1e3);
705
+ case "x":
706
+ return t2.$d.getTime();
707
+ case "z":
708
+ return "[" + t2.offsetName() + "]";
709
+ case "zzz":
710
+ return "[" + t2.offsetName("long") + "]";
711
+ default:
712
+ return e3;
713
+ }
714
+ }));
715
+ return n.bind(this)(a);
716
+ };
717
+ };
718
+ }));
719
+ }
720
+ });
721
+
722
+ // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/locale/zh-cn.js
723
+ var require_zh_cn = __commonJS({
724
+ "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/locale/zh-cn.js"(exports2, module2) {
725
+ "use strict";
726
+ !(function(e, _) {
727
+ "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = _(require_dayjs_min()) : "function" == typeof define && define.amd ? define(["dayjs"], _) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_locale_zh_cn = _(e.dayjs);
728
+ })(exports2, (function(e) {
729
+ "use strict";
730
+ function _(e2) {
731
+ return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
732
+ }
733
+ var t = _(e), d = { name: "zh-cn", weekdays: "\u661F\u671F\u65E5_\u661F\u671F\u4E00_\u661F\u671F\u4E8C_\u661F\u671F\u4E09_\u661F\u671F\u56DB_\u661F\u671F\u4E94_\u661F\u671F\u516D".split("_"), weekdaysShort: "\u5468\u65E5_\u5468\u4E00_\u5468\u4E8C_\u5468\u4E09_\u5468\u56DB_\u5468\u4E94_\u5468\u516D".split("_"), weekdaysMin: "\u65E5_\u4E00_\u4E8C_\u4E09_\u56DB_\u4E94_\u516D".split("_"), months: "\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u56DB\u6708_\u4E94\u6708_\u516D\u6708_\u4E03\u6708_\u516B\u6708_\u4E5D\u6708_\u5341\u6708_\u5341\u4E00\u6708_\u5341\u4E8C\u6708".split("_"), monthsShort: "1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"), ordinal: function(e2, _2) {
734
+ return "W" === _2 ? e2 + "\u5468" : e2 + "\u65E5";
735
+ }, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY\u5E74M\u6708D\u65E5", LLL: "YYYY\u5E74M\u6708D\u65E5Ah\u70B9mm\u5206", LLLL: "YYYY\u5E74M\u6708D\u65E5ddddAh\u70B9mm\u5206", l: "YYYY/M/D", ll: "YYYY\u5E74M\u6708D\u65E5", lll: "YYYY\u5E74M\u6708D\u65E5 HH:mm", llll: "YYYY\u5E74M\u6708D\u65E5dddd HH:mm" }, relativeTime: { future: "%s\u5185", past: "%s\u524D", s: "\u51E0\u79D2", m: "1 \u5206\u949F", mm: "%d \u5206\u949F", h: "1 \u5C0F\u65F6", hh: "%d \u5C0F\u65F6", d: "1 \u5929", dd: "%d \u5929", M: "1 \u4E2A\u6708", MM: "%d \u4E2A\u6708", y: "1 \u5E74", yy: "%d \u5E74" }, meridiem: function(e2, _2) {
736
+ var t2 = 100 * e2 + _2;
737
+ return t2 < 600 ? "\u51CC\u6668" : t2 < 900 ? "\u65E9\u4E0A" : t2 < 1100 ? "\u4E0A\u5348" : t2 < 1300 ? "\u4E2D\u5348" : t2 < 1800 ? "\u4E0B\u5348" : "\u665A\u4E0A";
738
+ } };
739
+ return t.default.locale(d, null, true), d;
740
+ }));
741
+ }
742
+ });
743
+
66
744
  // src/ts/index.ts
67
745
  var index_exports = {};
68
746
  __export(index_exports, {
69
747
  AbortError: () => AbortError,
70
- BigNumber: () => import_bignumber.default,
748
+ BigNumber: () => bignumber_default,
71
749
  EventBus: () => EventBus,
72
750
  Mutex: () => Mutex,
73
751
  SSEParser: () => SSEParser,
@@ -194,7 +872,7 @@ __export(index_exports, {
194
872
  isNotNil: () => isNotNil,
195
873
  isNull: () => isNull,
196
874
  isNumber: () => isNumber,
197
- isNumeric: () => isNumeric,
875
+ isNumeric: () => isNumeric2,
198
876
  isOfficerId: () => isOfficerId,
199
877
  isPassport: () => isPassport,
200
878
  isPhone: () => isPhone,
@@ -354,11 +1032,28 @@ function toAsync(p) {
354
1032
  });
355
1033
  }
356
1034
 
1035
+ // node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.mjs
1036
+ function mitt_default(n) {
1037
+ return { all: n = n || /* @__PURE__ */ new Map(), on: function(t, e) {
1038
+ var i = n.get(t);
1039
+ i ? i.push(e) : n.set(t, [e]);
1040
+ }, off: function(t, e) {
1041
+ var i = n.get(t);
1042
+ i && (e ? i.splice(i.indexOf(e) >>> 0, 1) : n.set(t, []));
1043
+ }, emit: function(t, e) {
1044
+ var i = n.get(t);
1045
+ i && i.slice().map(function(n2) {
1046
+ n2(e);
1047
+ }), (i = n.get("*")) && i.slice().map(function(n2) {
1048
+ n2(t, e);
1049
+ });
1050
+ } };
1051
+ }
1052
+
357
1053
  // src/ts/bean/EventBus.ts
358
- var import_mitt = __toESM(require("mitt"), 1);
359
1054
  var EventBus = class {
360
1055
  constructor() {
361
- __publicField(this, "_emitter", (0, import_mitt.default)());
1056
+ __publicField(this, "_emitter", mitt_default());
362
1057
  }
363
1058
  /** 订阅 */
364
1059
  on(type, fn) {
@@ -3126,18 +3821,1361 @@ var SSEParser = class {
3126
3821
  };
3127
3822
 
3128
3823
  // src/ts/day/index.ts
3129
- var import_dayjs = __toESM(require("dayjs"), 1);
3130
- var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat.js"), 1);
3131
- var import_utc = __toESM(require("dayjs/plugin/utc.js"), 1);
3132
- var import_timezone = __toESM(require("dayjs/plugin/timezone.js"), 1);
3133
- var import_relativeTime = __toESM(require("dayjs/plugin/relativeTime.js"), 1);
3134
- var import_advancedFormat = __toESM(require("dayjs/plugin/advancedFormat.js"), 1);
3135
- var import_zh_cn = require("dayjs/locale/zh-cn.js");
3824
+ var import_dayjs = __toESM(require_dayjs_min(), 1);
3825
+ var import_customParseFormat = __toESM(require_customParseFormat(), 1);
3826
+ var import_utc = __toESM(require_utc(), 1);
3827
+ var import_timezone = __toESM(require_timezone(), 1);
3828
+ var import_relativeTime = __toESM(require_relativeTime(), 1);
3829
+ var import_advancedFormat = __toESM(require_advancedFormat(), 1);
3830
+ var import_zh_cn = __toESM(require_zh_cn(), 1);
3831
+
3832
+ // node_modules/.pnpm/bignumber.js@9.3.1/node_modules/bignumber.js/bignumber.mjs
3833
+ var isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;
3834
+ var mathceil = Math.ceil;
3835
+ var mathfloor = Math.floor;
3836
+ var bignumberError = "[BigNumber Error] ";
3837
+ var tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ";
3838
+ var BASE = 1e14;
3839
+ var LOG_BASE = 14;
3840
+ var MAX_SAFE_INTEGER = 9007199254740991;
3841
+ var POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13];
3842
+ var SQRT_BASE = 1e7;
3843
+ var MAX = 1e9;
3844
+ function clone2(configObject) {
3845
+ var div, convertBase, parseNumeric, P = BigNumber2.prototype = { constructor: BigNumber2, toString: null, valueOf: null }, ONE = new BigNumber2(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
3846
+ prefix: "",
3847
+ groupSize: 3,
3848
+ secondaryGroupSize: 0,
3849
+ groupSeparator: ",",
3850
+ decimalSeparator: ".",
3851
+ fractionGroupSize: 0,
3852
+ fractionGroupSeparator: "\xA0",
3853
+ // non-breaking space
3854
+ suffix: ""
3855
+ }, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true;
3856
+ function BigNumber2(v, b) {
3857
+ var alphabet, c, caseChanged, e, i, isNum, len, str, x = this;
3858
+ if (!(x instanceof BigNumber2)) return new BigNumber2(v, b);
3859
+ if (b == null) {
3860
+ if (v && v._isBigNumber === true) {
3861
+ x.s = v.s;
3862
+ if (!v.c || v.e > MAX_EXP) {
3863
+ x.c = x.e = null;
3864
+ } else if (v.e < MIN_EXP) {
3865
+ x.c = [x.e = 0];
3866
+ } else {
3867
+ x.e = v.e;
3868
+ x.c = v.c.slice();
3869
+ }
3870
+ return;
3871
+ }
3872
+ if ((isNum = typeof v == "number") && v * 0 == 0) {
3873
+ x.s = 1 / v < 0 ? (v = -v, -1) : 1;
3874
+ if (v === ~~v) {
3875
+ for (e = 0, i = v; i >= 10; i /= 10, e++) ;
3876
+ if (e > MAX_EXP) {
3877
+ x.c = x.e = null;
3878
+ } else {
3879
+ x.e = e;
3880
+ x.c = [v];
3881
+ }
3882
+ return;
3883
+ }
3884
+ str = String(v);
3885
+ } else {
3886
+ if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);
3887
+ x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
3888
+ }
3889
+ if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
3890
+ if ((i = str.search(/e/i)) > 0) {
3891
+ if (e < 0) e = i;
3892
+ e += +str.slice(i + 1);
3893
+ str = str.substring(0, i);
3894
+ } else if (e < 0) {
3895
+ e = str.length;
3896
+ }
3897
+ } else {
3898
+ intCheck(b, 2, ALPHABET.length, "Base");
3899
+ if (b == 10 && alphabetHasNormalDecimalDigits) {
3900
+ x = new BigNumber2(v);
3901
+ return round2(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
3902
+ }
3903
+ str = String(v);
3904
+ if (isNum = typeof v == "number") {
3905
+ if (v * 0 != 0) return parseNumeric(x, str, isNum, b);
3906
+ x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;
3907
+ if (BigNumber2.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
3908
+ throw Error(tooManyDigits + v);
3909
+ }
3910
+ } else {
3911
+ x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
3912
+ }
3913
+ alphabet = ALPHABET.slice(0, b);
3914
+ e = i = 0;
3915
+ for (len = str.length; i < len; i++) {
3916
+ if (alphabet.indexOf(c = str.charAt(i)) < 0) {
3917
+ if (c == ".") {
3918
+ if (i > e) {
3919
+ e = len;
3920
+ continue;
3921
+ }
3922
+ } else if (!caseChanged) {
3923
+ if (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase())) {
3924
+ caseChanged = true;
3925
+ i = -1;
3926
+ e = 0;
3927
+ continue;
3928
+ }
3929
+ }
3930
+ return parseNumeric(x, String(v), isNum, b);
3931
+ }
3932
+ }
3933
+ isNum = false;
3934
+ str = convertBase(str, b, 10, x.s);
3935
+ if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
3936
+ else e = str.length;
3937
+ }
3938
+ for (i = 0; str.charCodeAt(i) === 48; i++) ;
3939
+ for (len = str.length; str.charCodeAt(--len) === 48; ) ;
3940
+ if (str = str.slice(i, ++len)) {
3941
+ len -= i;
3942
+ if (isNum && BigNumber2.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
3943
+ throw Error(tooManyDigits + x.s * v);
3944
+ }
3945
+ if ((e = e - i - 1) > MAX_EXP) {
3946
+ x.c = x.e = null;
3947
+ } else if (e < MIN_EXP) {
3948
+ x.c = [x.e = 0];
3949
+ } else {
3950
+ x.e = e;
3951
+ x.c = [];
3952
+ i = (e + 1) % LOG_BASE;
3953
+ if (e < 0) i += LOG_BASE;
3954
+ if (i < len) {
3955
+ if (i) x.c.push(+str.slice(0, i));
3956
+ for (len -= LOG_BASE; i < len; ) {
3957
+ x.c.push(+str.slice(i, i += LOG_BASE));
3958
+ }
3959
+ i = LOG_BASE - (str = str.slice(i)).length;
3960
+ } else {
3961
+ i -= len;
3962
+ }
3963
+ for (; i--; str += "0") ;
3964
+ x.c.push(+str);
3965
+ }
3966
+ } else {
3967
+ x.c = [x.e = 0];
3968
+ }
3969
+ }
3970
+ BigNumber2.clone = clone2;
3971
+ BigNumber2.ROUND_UP = 0;
3972
+ BigNumber2.ROUND_DOWN = 1;
3973
+ BigNumber2.ROUND_CEIL = 2;
3974
+ BigNumber2.ROUND_FLOOR = 3;
3975
+ BigNumber2.ROUND_HALF_UP = 4;
3976
+ BigNumber2.ROUND_HALF_DOWN = 5;
3977
+ BigNumber2.ROUND_HALF_EVEN = 6;
3978
+ BigNumber2.ROUND_HALF_CEIL = 7;
3979
+ BigNumber2.ROUND_HALF_FLOOR = 8;
3980
+ BigNumber2.EUCLID = 9;
3981
+ BigNumber2.config = BigNumber2.set = function(obj) {
3982
+ var p, v;
3983
+ if (obj != null) {
3984
+ if (typeof obj == "object") {
3985
+ if (obj.hasOwnProperty(p = "DECIMAL_PLACES")) {
3986
+ v = obj[p];
3987
+ intCheck(v, 0, MAX, p);
3988
+ DECIMAL_PLACES = v;
3989
+ }
3990
+ if (obj.hasOwnProperty(p = "ROUNDING_MODE")) {
3991
+ v = obj[p];
3992
+ intCheck(v, 0, 8, p);
3993
+ ROUNDING_MODE = v;
3994
+ }
3995
+ if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
3996
+ v = obj[p];
3997
+ if (v && v.pop) {
3998
+ intCheck(v[0], -MAX, 0, p);
3999
+ intCheck(v[1], 0, MAX, p);
4000
+ TO_EXP_NEG = v[0];
4001
+ TO_EXP_POS = v[1];
4002
+ } else {
4003
+ intCheck(v, -MAX, MAX, p);
4004
+ TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
4005
+ }
4006
+ }
4007
+ if (obj.hasOwnProperty(p = "RANGE")) {
4008
+ v = obj[p];
4009
+ if (v && v.pop) {
4010
+ intCheck(v[0], -MAX, -1, p);
4011
+ intCheck(v[1], 1, MAX, p);
4012
+ MIN_EXP = v[0];
4013
+ MAX_EXP = v[1];
4014
+ } else {
4015
+ intCheck(v, -MAX, MAX, p);
4016
+ if (v) {
4017
+ MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
4018
+ } else {
4019
+ throw Error(bignumberError + p + " cannot be zero: " + v);
4020
+ }
4021
+ }
4022
+ }
4023
+ if (obj.hasOwnProperty(p = "CRYPTO")) {
4024
+ v = obj[p];
4025
+ if (v === !!v) {
4026
+ if (v) {
4027
+ if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) {
4028
+ CRYPTO = v;
4029
+ } else {
4030
+ CRYPTO = !v;
4031
+ throw Error(bignumberError + "crypto unavailable");
4032
+ }
4033
+ } else {
4034
+ CRYPTO = v;
4035
+ }
4036
+ } else {
4037
+ throw Error(bignumberError + p + " not true or false: " + v);
4038
+ }
4039
+ }
4040
+ if (obj.hasOwnProperty(p = "MODULO_MODE")) {
4041
+ v = obj[p];
4042
+ intCheck(v, 0, 9, p);
4043
+ MODULO_MODE = v;
4044
+ }
4045
+ if (obj.hasOwnProperty(p = "POW_PRECISION")) {
4046
+ v = obj[p];
4047
+ intCheck(v, 0, MAX, p);
4048
+ POW_PRECISION = v;
4049
+ }
4050
+ if (obj.hasOwnProperty(p = "FORMAT")) {
4051
+ v = obj[p];
4052
+ if (typeof v == "object") FORMAT = v;
4053
+ else throw Error(bignumberError + p + " not an object: " + v);
4054
+ }
4055
+ if (obj.hasOwnProperty(p = "ALPHABET")) {
4056
+ v = obj[p];
4057
+ if (typeof v == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(v)) {
4058
+ alphabetHasNormalDecimalDigits = v.slice(0, 10) == "0123456789";
4059
+ ALPHABET = v;
4060
+ } else {
4061
+ throw Error(bignumberError + p + " invalid: " + v);
4062
+ }
4063
+ }
4064
+ } else {
4065
+ throw Error(bignumberError + "Object expected: " + obj);
4066
+ }
4067
+ }
4068
+ return {
4069
+ DECIMAL_PLACES,
4070
+ ROUNDING_MODE,
4071
+ EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],
4072
+ RANGE: [MIN_EXP, MAX_EXP],
4073
+ CRYPTO,
4074
+ MODULO_MODE,
4075
+ POW_PRECISION,
4076
+ FORMAT,
4077
+ ALPHABET
4078
+ };
4079
+ };
4080
+ BigNumber2.isBigNumber = function(v) {
4081
+ if (!v || v._isBigNumber !== true) return false;
4082
+ if (!BigNumber2.DEBUG) return true;
4083
+ var i, n, c = v.c, e = v.e, s = v.s;
4084
+ out: if ({}.toString.call(c) == "[object Array]") {
4085
+ if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
4086
+ if (c[0] === 0) {
4087
+ if (e === 0 && c.length === 1) return true;
4088
+ break out;
4089
+ }
4090
+ i = (e + 1) % LOG_BASE;
4091
+ if (i < 1) i += LOG_BASE;
4092
+ if (String(c[0]).length == i) {
4093
+ for (i = 0; i < c.length; i++) {
4094
+ n = c[i];
4095
+ if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;
4096
+ }
4097
+ if (n !== 0) return true;
4098
+ }
4099
+ }
4100
+ } else if (c === null && e === null && (s === null || s === 1 || s === -1)) {
4101
+ return true;
4102
+ }
4103
+ throw Error(bignumberError + "Invalid BigNumber: " + v);
4104
+ };
4105
+ BigNumber2.maximum = BigNumber2.max = function() {
4106
+ return maxOrMin(arguments, -1);
4107
+ };
4108
+ BigNumber2.minimum = BigNumber2.min = function() {
4109
+ return maxOrMin(arguments, 1);
4110
+ };
4111
+ BigNumber2.random = (function() {
4112
+ var pow2_53 = 9007199254740992;
4113
+ var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
4114
+ return mathfloor(Math.random() * pow2_53);
4115
+ } : function() {
4116
+ return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
4117
+ };
4118
+ return function(dp) {
4119
+ var a, b, e, k, v, i = 0, c = [], rand = new BigNumber2(ONE);
4120
+ if (dp == null) dp = DECIMAL_PLACES;
4121
+ else intCheck(dp, 0, MAX);
4122
+ k = mathceil(dp / LOG_BASE);
4123
+ if (CRYPTO) {
4124
+ if (crypto.getRandomValues) {
4125
+ a = crypto.getRandomValues(new Uint32Array(k *= 2));
4126
+ for (; i < k; ) {
4127
+ v = a[i] * 131072 + (a[i + 1] >>> 11);
4128
+ if (v >= 9e15) {
4129
+ b = crypto.getRandomValues(new Uint32Array(2));
4130
+ a[i] = b[0];
4131
+ a[i + 1] = b[1];
4132
+ } else {
4133
+ c.push(v % 1e14);
4134
+ i += 2;
4135
+ }
4136
+ }
4137
+ i = k / 2;
4138
+ } else if (crypto.randomBytes) {
4139
+ a = crypto.randomBytes(k *= 7);
4140
+ for (; i < k; ) {
4141
+ v = (a[i] & 31) * 281474976710656 + a[i + 1] * 1099511627776 + a[i + 2] * 4294967296 + a[i + 3] * 16777216 + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6];
4142
+ if (v >= 9e15) {
4143
+ crypto.randomBytes(7).copy(a, i);
4144
+ } else {
4145
+ c.push(v % 1e14);
4146
+ i += 7;
4147
+ }
4148
+ }
4149
+ i = k / 7;
4150
+ } else {
4151
+ CRYPTO = false;
4152
+ throw Error(bignumberError + "crypto unavailable");
4153
+ }
4154
+ }
4155
+ if (!CRYPTO) {
4156
+ for (; i < k; ) {
4157
+ v = random53bitInt();
4158
+ if (v < 9e15) c[i++] = v % 1e14;
4159
+ }
4160
+ }
4161
+ k = c[--i];
4162
+ dp %= LOG_BASE;
4163
+ if (k && dp) {
4164
+ v = POWS_TEN[LOG_BASE - dp];
4165
+ c[i] = mathfloor(k / v) * v;
4166
+ }
4167
+ for (; c[i] === 0; c.pop(), i--) ;
4168
+ if (i < 0) {
4169
+ c = [e = 0];
4170
+ } else {
4171
+ for (e = -1; c[0] === 0; c.splice(0, 1), e -= LOG_BASE) ;
4172
+ for (i = 1, v = c[0]; v >= 10; v /= 10, i++) ;
4173
+ if (i < LOG_BASE) e -= LOG_BASE - i;
4174
+ }
4175
+ rand.e = e;
4176
+ rand.c = c;
4177
+ return rand;
4178
+ };
4179
+ })();
4180
+ BigNumber2.sum = function() {
4181
+ var i = 1, args = arguments, sum2 = new BigNumber2(args[0]);
4182
+ for (; i < args.length; ) sum2 = sum2.plus(args[i++]);
4183
+ return sum2;
4184
+ };
4185
+ convertBase = /* @__PURE__ */ (function() {
4186
+ var decimal = "0123456789";
4187
+ function toBaseOut(str, baseIn, baseOut, alphabet) {
4188
+ var j, arr = [0], arrL, i = 0, len = str.length;
4189
+ for (; i < len; ) {
4190
+ for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) ;
4191
+ arr[0] += alphabet.indexOf(str.charAt(i++));
4192
+ for (j = 0; j < arr.length; j++) {
4193
+ if (arr[j] > baseOut - 1) {
4194
+ if (arr[j + 1] == null) arr[j + 1] = 0;
4195
+ arr[j + 1] += arr[j] / baseOut | 0;
4196
+ arr[j] %= baseOut;
4197
+ }
4198
+ }
4199
+ }
4200
+ return arr.reverse();
4201
+ }
4202
+ return function(str, baseIn, baseOut, sign, callerIsToString) {
4203
+ var alphabet, d, e, k, r, x, xc, y, i = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE;
4204
+ if (i >= 0) {
4205
+ k = POW_PRECISION;
4206
+ POW_PRECISION = 0;
4207
+ str = str.replace(".", "");
4208
+ y = new BigNumber2(baseIn);
4209
+ x = y.pow(str.length - i);
4210
+ POW_PRECISION = k;
4211
+ y.c = toBaseOut(
4212
+ toFixedPoint(coeffToString(x.c), x.e, "0"),
4213
+ 10,
4214
+ baseOut,
4215
+ decimal
4216
+ );
4217
+ y.e = y.c.length;
4218
+ }
4219
+ xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET, decimal) : (alphabet = decimal, ALPHABET));
4220
+ e = k = xc.length;
4221
+ for (; xc[--k] == 0; xc.pop()) ;
4222
+ if (!xc[0]) return alphabet.charAt(0);
4223
+ if (i < 0) {
4224
+ --e;
4225
+ } else {
4226
+ x.c = xc;
4227
+ x.e = e;
4228
+ x.s = sign;
4229
+ x = div(x, y, dp, rm, baseOut);
4230
+ xc = x.c;
4231
+ r = x.r;
4232
+ e = x.e;
4233
+ }
4234
+ d = e + dp + 1;
4235
+ i = xc[d];
4236
+ k = baseOut / 2;
4237
+ r = r || d < 0 || xc[d + 1] != null;
4238
+ r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i > k || i == k && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7));
4239
+ if (d < 1 || !xc[0]) {
4240
+ str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
4241
+ } else {
4242
+ xc.length = d;
4243
+ if (r) {
4244
+ for (--baseOut; ++xc[--d] > baseOut; ) {
4245
+ xc[d] = 0;
4246
+ if (!d) {
4247
+ ++e;
4248
+ xc = [1].concat(xc);
4249
+ }
4250
+ }
4251
+ }
4252
+ for (k = xc.length; !xc[--k]; ) ;
4253
+ for (i = 0, str = ""; i <= k; str += alphabet.charAt(xc[i++])) ;
4254
+ str = toFixedPoint(str, e, alphabet.charAt(0));
4255
+ }
4256
+ return str;
4257
+ };
4258
+ })();
4259
+ div = /* @__PURE__ */ (function() {
4260
+ function multiply(x, k, base) {
4261
+ var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0;
4262
+ for (x = x.slice(); i--; ) {
4263
+ xlo = x[i] % SQRT_BASE;
4264
+ xhi = x[i] / SQRT_BASE | 0;
4265
+ m = khi * xlo + xhi * klo;
4266
+ temp = klo * xlo + m % SQRT_BASE * SQRT_BASE + carry;
4267
+ carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;
4268
+ x[i] = temp % base;
4269
+ }
4270
+ if (carry) x = [carry].concat(x);
4271
+ return x;
4272
+ }
4273
+ function compare2(a, b, aL, bL) {
4274
+ var i, cmp;
4275
+ if (aL != bL) {
4276
+ cmp = aL > bL ? 1 : -1;
4277
+ } else {
4278
+ for (i = cmp = 0; i < aL; i++) {
4279
+ if (a[i] != b[i]) {
4280
+ cmp = a[i] > b[i] ? 1 : -1;
4281
+ break;
4282
+ }
4283
+ }
4284
+ }
4285
+ return cmp;
4286
+ }
4287
+ function subtract(a, b, aL, base) {
4288
+ var i = 0;
4289
+ for (; aL--; ) {
4290
+ a[aL] -= i;
4291
+ i = a[aL] < b[aL] ? 1 : 0;
4292
+ a[aL] = i * base + a[aL] - b[aL];
4293
+ }
4294
+ for (; !a[0] && a.length > 1; a.splice(0, 1)) ;
4295
+ }
4296
+ return function(x, y, dp, rm, base) {
4297
+ var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, yL, yz, s = x.s == y.s ? 1 : -1, xc = x.c, yc = y.c;
4298
+ if (!xc || !xc[0] || !yc || !yc[0]) {
4299
+ return new BigNumber2(
4300
+ // Return NaN if either NaN, or both Infinity or 0.
4301
+ !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
4302
+ // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
4303
+ xc && xc[0] == 0 || !yc ? s * 0 : s / 0
4304
+ )
4305
+ );
4306
+ }
4307
+ q = new BigNumber2(s);
4308
+ qc = q.c = [];
4309
+ e = x.e - y.e;
4310
+ s = dp + e + 1;
4311
+ if (!base) {
4312
+ base = BASE;
4313
+ e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);
4314
+ s = s / LOG_BASE | 0;
4315
+ }
4316
+ for (i = 0; yc[i] == (xc[i] || 0); i++) ;
4317
+ if (yc[i] > (xc[i] || 0)) e--;
4318
+ if (s < 0) {
4319
+ qc.push(1);
4320
+ more = true;
4321
+ } else {
4322
+ xL = xc.length;
4323
+ yL = yc.length;
4324
+ i = 0;
4325
+ s += 2;
4326
+ n = mathfloor(base / (yc[0] + 1));
4327
+ if (n > 1) {
4328
+ yc = multiply(yc, n, base);
4329
+ xc = multiply(xc, n, base);
4330
+ yL = yc.length;
4331
+ xL = xc.length;
4332
+ }
4333
+ xi = yL;
4334
+ rem = xc.slice(0, yL);
4335
+ remL = rem.length;
4336
+ for (; remL < yL; rem[remL++] = 0) ;
4337
+ yz = yc.slice();
4338
+ yz = [0].concat(yz);
4339
+ yc0 = yc[0];
4340
+ if (yc[1] >= base / 2) yc0++;
4341
+ do {
4342
+ n = 0;
4343
+ cmp = compare2(yc, rem, yL, remL);
4344
+ if (cmp < 0) {
4345
+ rem0 = rem[0];
4346
+ if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
4347
+ n = mathfloor(rem0 / yc0);
4348
+ if (n > 1) {
4349
+ if (n >= base) n = base - 1;
4350
+ prod = multiply(yc, n, base);
4351
+ prodL = prod.length;
4352
+ remL = rem.length;
4353
+ while (compare2(prod, rem, prodL, remL) == 1) {
4354
+ n--;
4355
+ subtract(prod, yL < prodL ? yz : yc, prodL, base);
4356
+ prodL = prod.length;
4357
+ cmp = 1;
4358
+ }
4359
+ } else {
4360
+ if (n == 0) {
4361
+ cmp = n = 1;
4362
+ }
4363
+ prod = yc.slice();
4364
+ prodL = prod.length;
4365
+ }
4366
+ if (prodL < remL) prod = [0].concat(prod);
4367
+ subtract(rem, prod, remL, base);
4368
+ remL = rem.length;
4369
+ if (cmp == -1) {
4370
+ while (compare2(yc, rem, yL, remL) < 1) {
4371
+ n++;
4372
+ subtract(rem, yL < remL ? yz : yc, remL, base);
4373
+ remL = rem.length;
4374
+ }
4375
+ }
4376
+ } else if (cmp === 0) {
4377
+ n++;
4378
+ rem = [0];
4379
+ }
4380
+ qc[i++] = n;
4381
+ if (rem[0]) {
4382
+ rem[remL++] = xc[xi] || 0;
4383
+ } else {
4384
+ rem = [xc[xi]];
4385
+ remL = 1;
4386
+ }
4387
+ } while ((xi++ < xL || rem[0] != null) && s--);
4388
+ more = rem[0] != null;
4389
+ if (!qc[0]) qc.splice(0, 1);
4390
+ }
4391
+ if (base == BASE) {
4392
+ for (i = 1, s = qc[0]; s >= 10; s /= 10, i++) ;
4393
+ round2(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);
4394
+ } else {
4395
+ q.e = e;
4396
+ q.r = +more;
4397
+ }
4398
+ return q;
4399
+ };
4400
+ })();
4401
+ function format(n, i, rm, id) {
4402
+ var c0, e, ne, len, str;
4403
+ if (rm == null) rm = ROUNDING_MODE;
4404
+ else intCheck(rm, 0, 8);
4405
+ if (!n.c) return n.toString();
4406
+ c0 = n.c[0];
4407
+ ne = n.e;
4408
+ if (i == null) {
4409
+ str = coeffToString(n.c);
4410
+ str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0");
4411
+ } else {
4412
+ n = round2(new BigNumber2(n), i, rm);
4413
+ e = n.e;
4414
+ str = coeffToString(n.c);
4415
+ len = str.length;
4416
+ if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {
4417
+ for (; len < i; str += "0", len++) ;
4418
+ str = toExponential(str, e);
4419
+ } else {
4420
+ i -= ne + (id === 2 && e > ne);
4421
+ str = toFixedPoint(str, e, "0");
4422
+ if (e + 1 > len) {
4423
+ if (--i > 0) for (str += "."; i--; str += "0") ;
4424
+ } else {
4425
+ i += e - len;
4426
+ if (i > 0) {
4427
+ if (e + 1 == len) str += ".";
4428
+ for (; i--; str += "0") ;
4429
+ }
4430
+ }
4431
+ }
4432
+ }
4433
+ return n.s < 0 && c0 ? "-" + str : str;
4434
+ }
4435
+ function maxOrMin(args, n) {
4436
+ var k, y, i = 1, x = new BigNumber2(args[0]);
4437
+ for (; i < args.length; i++) {
4438
+ y = new BigNumber2(args[i]);
4439
+ if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {
4440
+ x = y;
4441
+ }
4442
+ }
4443
+ return x;
4444
+ }
4445
+ function normalise(n, c, e) {
4446
+ var i = 1, j = c.length;
4447
+ for (; !c[--j]; c.pop()) ;
4448
+ for (j = c[0]; j >= 10; j /= 10, i++) ;
4449
+ if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {
4450
+ n.c = n.e = null;
4451
+ } else if (e < MIN_EXP) {
4452
+ n.c = [n.e = 0];
4453
+ } else {
4454
+ n.e = e;
4455
+ n.c = c;
4456
+ }
4457
+ return n;
4458
+ }
4459
+ parseNumeric = /* @__PURE__ */ (function() {
4460
+ var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
4461
+ return function(x, str, isNum, b) {
4462
+ var base, s = isNum ? str : str.replace(whitespaceOrPlus, "");
4463
+ if (isInfinityOrNaN.test(s)) {
4464
+ x.s = isNaN(s) ? null : s < 0 ? -1 : 1;
4465
+ } else {
4466
+ if (!isNum) {
4467
+ s = s.replace(basePrefix, function(m, p1, p2) {
4468
+ base = (p2 = p2.toLowerCase()) == "x" ? 16 : p2 == "b" ? 2 : 8;
4469
+ return !b || b == base ? p1 : m;
4470
+ });
4471
+ if (b) {
4472
+ base = b;
4473
+ s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
4474
+ }
4475
+ if (str != s) return new BigNumber2(s, base);
4476
+ }
4477
+ if (BigNumber2.DEBUG) {
4478
+ throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str);
4479
+ }
4480
+ x.s = null;
4481
+ }
4482
+ x.c = x.e = null;
4483
+ };
4484
+ })();
4485
+ function round2(x, sd, rm, r) {
4486
+ var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN;
4487
+ if (xc) {
4488
+ out: {
4489
+ for (d = 1, k = xc[0]; k >= 10; k /= 10, d++) ;
4490
+ i = sd - d;
4491
+ if (i < 0) {
4492
+ i += LOG_BASE;
4493
+ j = sd;
4494
+ n = xc[ni = 0];
4495
+ rd = mathfloor(n / pows10[d - j - 1] % 10);
4496
+ } else {
4497
+ ni = mathceil((i + 1) / LOG_BASE);
4498
+ if (ni >= xc.length) {
4499
+ if (r) {
4500
+ for (; xc.length <= ni; xc.push(0)) ;
4501
+ n = rd = 0;
4502
+ d = 1;
4503
+ i %= LOG_BASE;
4504
+ j = i - LOG_BASE + 1;
4505
+ } else {
4506
+ break out;
4507
+ }
4508
+ } else {
4509
+ n = k = xc[ni];
4510
+ for (d = 1; k >= 10; k /= 10, d++) ;
4511
+ i %= LOG_BASE;
4512
+ j = i - LOG_BASE + d;
4513
+ rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);
4514
+ }
4515
+ }
4516
+ r = r || sd < 0 || // Are there any non-zero digits after the rounding digit?
4517
+ // The expression n % pows10[d - j - 1] returns all digits of n to the right
4518
+ // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
4519
+ xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);
4520
+ r = rm < 4 ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && // Check whether the digit to the left of the rounding digit is odd.
4521
+ (i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7));
4522
+ if (sd < 1 || !xc[0]) {
4523
+ xc.length = 0;
4524
+ if (r) {
4525
+ sd -= x.e + 1;
4526
+ xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];
4527
+ x.e = -sd || 0;
4528
+ } else {
4529
+ xc[0] = x.e = 0;
4530
+ }
4531
+ return x;
4532
+ }
4533
+ if (i == 0) {
4534
+ xc.length = ni;
4535
+ k = 1;
4536
+ ni--;
4537
+ } else {
4538
+ xc.length = ni + 1;
4539
+ k = pows10[LOG_BASE - i];
4540
+ xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;
4541
+ }
4542
+ if (r) {
4543
+ for (; ; ) {
4544
+ if (ni == 0) {
4545
+ for (i = 1, j = xc[0]; j >= 10; j /= 10, i++) ;
4546
+ j = xc[0] += k;
4547
+ for (k = 1; j >= 10; j /= 10, k++) ;
4548
+ if (i != k) {
4549
+ x.e++;
4550
+ if (xc[0] == BASE) xc[0] = 1;
4551
+ }
4552
+ break;
4553
+ } else {
4554
+ xc[ni] += k;
4555
+ if (xc[ni] != BASE) break;
4556
+ xc[ni--] = 0;
4557
+ k = 1;
4558
+ }
4559
+ }
4560
+ }
4561
+ for (i = xc.length; xc[--i] === 0; xc.pop()) ;
4562
+ }
4563
+ if (x.e > MAX_EXP) {
4564
+ x.c = x.e = null;
4565
+ } else if (x.e < MIN_EXP) {
4566
+ x.c = [x.e = 0];
4567
+ }
4568
+ }
4569
+ return x;
4570
+ }
4571
+ function valueOf(n) {
4572
+ var str, e = n.e;
4573
+ if (e === null) return n.toString();
4574
+ str = coeffToString(n.c);
4575
+ str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(str, e) : toFixedPoint(str, e, "0");
4576
+ return n.s < 0 ? "-" + str : str;
4577
+ }
4578
+ P.absoluteValue = P.abs = function() {
4579
+ var x = new BigNumber2(this);
4580
+ if (x.s < 0) x.s = 1;
4581
+ return x;
4582
+ };
4583
+ P.comparedTo = function(y, b) {
4584
+ return compare(this, new BigNumber2(y, b));
4585
+ };
4586
+ P.decimalPlaces = P.dp = function(dp, rm) {
4587
+ var c, n, v, x = this;
4588
+ if (dp != null) {
4589
+ intCheck(dp, 0, MAX);
4590
+ if (rm == null) rm = ROUNDING_MODE;
4591
+ else intCheck(rm, 0, 8);
4592
+ return round2(new BigNumber2(x), dp + x.e + 1, rm);
4593
+ }
4594
+ if (!(c = x.c)) return null;
4595
+ n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
4596
+ if (v = c[v]) for (; v % 10 == 0; v /= 10, n--) ;
4597
+ if (n < 0) n = 0;
4598
+ return n;
4599
+ };
4600
+ P.dividedBy = P.div = function(y, b) {
4601
+ return div(this, new BigNumber2(y, b), DECIMAL_PLACES, ROUNDING_MODE);
4602
+ };
4603
+ P.dividedToIntegerBy = P.idiv = function(y, b) {
4604
+ return div(this, new BigNumber2(y, b), 0, 1);
4605
+ };
4606
+ P.exponentiatedBy = P.pow = function(n, m) {
4607
+ var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this;
4608
+ n = new BigNumber2(n);
4609
+ if (n.c && !n.isInteger()) {
4610
+ throw Error(bignumberError + "Exponent not an integer: " + valueOf(n));
4611
+ }
4612
+ if (m != null) m = new BigNumber2(m);
4613
+ nIsBig = n.e > 14;
4614
+ if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {
4615
+ y = new BigNumber2(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));
4616
+ return m ? y.mod(m) : y;
4617
+ }
4618
+ nIsNeg = n.s < 0;
4619
+ if (m) {
4620
+ if (m.c ? !m.c[0] : !m.s) return new BigNumber2(NaN);
4621
+ isModExp = !nIsNeg && x.isInteger() && m.isInteger();
4622
+ if (isModExp) x = x.mod(m);
4623
+ } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {
4624
+ k = x.s < 0 && isOdd(n) ? -0 : 0;
4625
+ if (x.e > -1) k = 1 / k;
4626
+ return new BigNumber2(nIsNeg ? 1 / k : k);
4627
+ } else if (POW_PRECISION) {
4628
+ k = mathceil(POW_PRECISION / LOG_BASE + 2);
4629
+ }
4630
+ if (nIsBig) {
4631
+ half = new BigNumber2(0.5);
4632
+ if (nIsNeg) n.s = 1;
4633
+ nIsOdd = isOdd(n);
4634
+ } else {
4635
+ i = Math.abs(+valueOf(n));
4636
+ nIsOdd = i % 2;
4637
+ }
4638
+ y = new BigNumber2(ONE);
4639
+ for (; ; ) {
4640
+ if (nIsOdd) {
4641
+ y = y.times(x);
4642
+ if (!y.c) break;
4643
+ if (k) {
4644
+ if (y.c.length > k) y.c.length = k;
4645
+ } else if (isModExp) {
4646
+ y = y.mod(m);
4647
+ }
4648
+ }
4649
+ if (i) {
4650
+ i = mathfloor(i / 2);
4651
+ if (i === 0) break;
4652
+ nIsOdd = i % 2;
4653
+ } else {
4654
+ n = n.times(half);
4655
+ round2(n, n.e + 1, 1);
4656
+ if (n.e > 14) {
4657
+ nIsOdd = isOdd(n);
4658
+ } else {
4659
+ i = +valueOf(n);
4660
+ if (i === 0) break;
4661
+ nIsOdd = i % 2;
4662
+ }
4663
+ }
4664
+ x = x.times(x);
4665
+ if (k) {
4666
+ if (x.c && x.c.length > k) x.c.length = k;
4667
+ } else if (isModExp) {
4668
+ x = x.mod(m);
4669
+ }
4670
+ }
4671
+ if (isModExp) return y;
4672
+ if (nIsNeg) y = ONE.div(y);
4673
+ return m ? y.mod(m) : k ? round2(y, POW_PRECISION, ROUNDING_MODE, more) : y;
4674
+ };
4675
+ P.integerValue = function(rm) {
4676
+ var n = new BigNumber2(this);
4677
+ if (rm == null) rm = ROUNDING_MODE;
4678
+ else intCheck(rm, 0, 8);
4679
+ return round2(n, n.e + 1, rm);
4680
+ };
4681
+ P.isEqualTo = P.eq = function(y, b) {
4682
+ return compare(this, new BigNumber2(y, b)) === 0;
4683
+ };
4684
+ P.isFinite = function() {
4685
+ return !!this.c;
4686
+ };
4687
+ P.isGreaterThan = P.gt = function(y, b) {
4688
+ return compare(this, new BigNumber2(y, b)) > 0;
4689
+ };
4690
+ P.isGreaterThanOrEqualTo = P.gte = function(y, b) {
4691
+ return (b = compare(this, new BigNumber2(y, b))) === 1 || b === 0;
4692
+ };
4693
+ P.isInteger = function() {
4694
+ return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
4695
+ };
4696
+ P.isLessThan = P.lt = function(y, b) {
4697
+ return compare(this, new BigNumber2(y, b)) < 0;
4698
+ };
4699
+ P.isLessThanOrEqualTo = P.lte = function(y, b) {
4700
+ return (b = compare(this, new BigNumber2(y, b))) === -1 || b === 0;
4701
+ };
4702
+ P.isNaN = function() {
4703
+ return !this.s;
4704
+ };
4705
+ P.isNegative = function() {
4706
+ return this.s < 0;
4707
+ };
4708
+ P.isPositive = function() {
4709
+ return this.s > 0;
4710
+ };
4711
+ P.isZero = function() {
4712
+ return !!this.c && this.c[0] == 0;
4713
+ };
4714
+ P.minus = function(y, b) {
4715
+ var i, j, t, xLTy, x = this, a = x.s;
4716
+ y = new BigNumber2(y, b);
4717
+ b = y.s;
4718
+ if (!a || !b) return new BigNumber2(NaN);
4719
+ if (a != b) {
4720
+ y.s = -b;
4721
+ return x.plus(y);
4722
+ }
4723
+ var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
4724
+ if (!xe || !ye) {
4725
+ if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber2(yc ? x : NaN);
4726
+ if (!xc[0] || !yc[0]) {
4727
+ return yc[0] ? (y.s = -b, y) : new BigNumber2(xc[0] ? x : (
4728
+ // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
4729
+ ROUNDING_MODE == 3 ? -0 : 0
4730
+ ));
4731
+ }
4732
+ }
4733
+ xe = bitFloor(xe);
4734
+ ye = bitFloor(ye);
4735
+ xc = xc.slice();
4736
+ if (a = xe - ye) {
4737
+ if (xLTy = a < 0) {
4738
+ a = -a;
4739
+ t = xc;
4740
+ } else {
4741
+ ye = xe;
4742
+ t = yc;
4743
+ }
4744
+ t.reverse();
4745
+ for (b = a; b--; t.push(0)) ;
4746
+ t.reverse();
4747
+ } else {
4748
+ j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;
4749
+ for (a = b = 0; b < j; b++) {
4750
+ if (xc[b] != yc[b]) {
4751
+ xLTy = xc[b] < yc[b];
4752
+ break;
4753
+ }
4754
+ }
4755
+ }
4756
+ if (xLTy) {
4757
+ t = xc;
4758
+ xc = yc;
4759
+ yc = t;
4760
+ y.s = -y.s;
4761
+ }
4762
+ b = (j = yc.length) - (i = xc.length);
4763
+ if (b > 0) for (; b--; xc[i++] = 0) ;
4764
+ b = BASE - 1;
4765
+ for (; j > a; ) {
4766
+ if (xc[--j] < yc[j]) {
4767
+ for (i = j; i && !xc[--i]; xc[i] = b) ;
4768
+ --xc[i];
4769
+ xc[j] += BASE;
4770
+ }
4771
+ xc[j] -= yc[j];
4772
+ }
4773
+ for (; xc[0] == 0; xc.splice(0, 1), --ye) ;
4774
+ if (!xc[0]) {
4775
+ y.s = ROUNDING_MODE == 3 ? -1 : 1;
4776
+ y.c = [y.e = 0];
4777
+ return y;
4778
+ }
4779
+ return normalise(y, xc, ye);
4780
+ };
4781
+ P.modulo = P.mod = function(y, b) {
4782
+ var q, s, x = this;
4783
+ y = new BigNumber2(y, b);
4784
+ if (!x.c || !y.s || y.c && !y.c[0]) {
4785
+ return new BigNumber2(NaN);
4786
+ } else if (!y.c || x.c && !x.c[0]) {
4787
+ return new BigNumber2(x);
4788
+ }
4789
+ if (MODULO_MODE == 9) {
4790
+ s = y.s;
4791
+ y.s = 1;
4792
+ q = div(x, y, 0, 3);
4793
+ y.s = s;
4794
+ q.s *= s;
4795
+ } else {
4796
+ q = div(x, y, 0, MODULO_MODE);
4797
+ }
4798
+ y = x.minus(q.times(y));
4799
+ if (!y.c[0] && MODULO_MODE == 1) y.s = x.s;
4800
+ return y;
4801
+ };
4802
+ P.multipliedBy = P.times = function(y, b) {
4803
+ var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new BigNumber2(y, b)).c;
4804
+ if (!xc || !yc || !xc[0] || !yc[0]) {
4805
+ if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
4806
+ y.c = y.e = y.s = null;
4807
+ } else {
4808
+ y.s *= x.s;
4809
+ if (!xc || !yc) {
4810
+ y.c = y.e = null;
4811
+ } else {
4812
+ y.c = [0];
4813
+ y.e = 0;
4814
+ }
4815
+ }
4816
+ return y;
4817
+ }
4818
+ e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);
4819
+ y.s *= x.s;
4820
+ xcL = xc.length;
4821
+ ycL = yc.length;
4822
+ if (xcL < ycL) {
4823
+ zc = xc;
4824
+ xc = yc;
4825
+ yc = zc;
4826
+ i = xcL;
4827
+ xcL = ycL;
4828
+ ycL = i;
4829
+ }
4830
+ for (i = xcL + ycL, zc = []; i--; zc.push(0)) ;
4831
+ base = BASE;
4832
+ sqrtBase = SQRT_BASE;
4833
+ for (i = ycL; --i >= 0; ) {
4834
+ c = 0;
4835
+ ylo = yc[i] % sqrtBase;
4836
+ yhi = yc[i] / sqrtBase | 0;
4837
+ for (k = xcL, j = i + k; j > i; ) {
4838
+ xlo = xc[--k] % sqrtBase;
4839
+ xhi = xc[k] / sqrtBase | 0;
4840
+ m = yhi * xlo + xhi * ylo;
4841
+ xlo = ylo * xlo + m % sqrtBase * sqrtBase + zc[j] + c;
4842
+ c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;
4843
+ zc[j--] = xlo % base;
4844
+ }
4845
+ zc[j] = c;
4846
+ }
4847
+ if (c) {
4848
+ ++e;
4849
+ } else {
4850
+ zc.splice(0, 1);
4851
+ }
4852
+ return normalise(y, zc, e);
4853
+ };
4854
+ P.negated = function() {
4855
+ var x = new BigNumber2(this);
4856
+ x.s = -x.s || null;
4857
+ return x;
4858
+ };
4859
+ P.plus = function(y, b) {
4860
+ var t, x = this, a = x.s;
4861
+ y = new BigNumber2(y, b);
4862
+ b = y.s;
4863
+ if (!a || !b) return new BigNumber2(NaN);
4864
+ if (a != b) {
4865
+ y.s = -b;
4866
+ return x.minus(y);
4867
+ }
4868
+ var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
4869
+ if (!xe || !ye) {
4870
+ if (!xc || !yc) return new BigNumber2(a / 0);
4871
+ if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber2(xc[0] ? x : a * 0);
4872
+ }
4873
+ xe = bitFloor(xe);
4874
+ ye = bitFloor(ye);
4875
+ xc = xc.slice();
4876
+ if (a = xe - ye) {
4877
+ if (a > 0) {
4878
+ ye = xe;
4879
+ t = yc;
4880
+ } else {
4881
+ a = -a;
4882
+ t = xc;
4883
+ }
4884
+ t.reverse();
4885
+ for (; a--; t.push(0)) ;
4886
+ t.reverse();
4887
+ }
4888
+ a = xc.length;
4889
+ b = yc.length;
4890
+ if (a - b < 0) {
4891
+ t = yc;
4892
+ yc = xc;
4893
+ xc = t;
4894
+ b = a;
4895
+ }
4896
+ for (a = 0; b; ) {
4897
+ a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
4898
+ xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
4899
+ }
4900
+ if (a) {
4901
+ xc = [a].concat(xc);
4902
+ ++ye;
4903
+ }
4904
+ return normalise(y, xc, ye);
4905
+ };
4906
+ P.precision = P.sd = function(sd, rm) {
4907
+ var c, n, v, x = this;
4908
+ if (sd != null && sd !== !!sd) {
4909
+ intCheck(sd, 1, MAX);
4910
+ if (rm == null) rm = ROUNDING_MODE;
4911
+ else intCheck(rm, 0, 8);
4912
+ return round2(new BigNumber2(x), sd, rm);
4913
+ }
4914
+ if (!(c = x.c)) return null;
4915
+ v = c.length - 1;
4916
+ n = v * LOG_BASE + 1;
4917
+ if (v = c[v]) {
4918
+ for (; v % 10 == 0; v /= 10, n--) ;
4919
+ for (v = c[0]; v >= 10; v /= 10, n++) ;
4920
+ }
4921
+ if (sd && x.e + 1 > n) n = x.e + 1;
4922
+ return n;
4923
+ };
4924
+ P.shiftedBy = function(k) {
4925
+ intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
4926
+ return this.times("1e" + k);
4927
+ };
4928
+ P.squareRoot = P.sqrt = function() {
4929
+ var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new BigNumber2("0.5");
4930
+ if (s !== 1 || !c || !c[0]) {
4931
+ return new BigNumber2(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
4932
+ }
4933
+ s = Math.sqrt(+valueOf(x));
4934
+ if (s == 0 || s == 1 / 0) {
4935
+ n = coeffToString(c);
4936
+ if ((n.length + e) % 2 == 0) n += "0";
4937
+ s = Math.sqrt(+n);
4938
+ e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);
4939
+ if (s == 1 / 0) {
4940
+ n = "5e" + e;
4941
+ } else {
4942
+ n = s.toExponential();
4943
+ n = n.slice(0, n.indexOf("e") + 1) + e;
4944
+ }
4945
+ r = new BigNumber2(n);
4946
+ } else {
4947
+ r = new BigNumber2(s + "");
4948
+ }
4949
+ if (r.c[0]) {
4950
+ e = r.e;
4951
+ s = e + dp;
4952
+ if (s < 3) s = 0;
4953
+ for (; ; ) {
4954
+ t = r;
4955
+ r = half.times(t.plus(div(x, t, dp, 1)));
4956
+ if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {
4957
+ if (r.e < e) --s;
4958
+ n = n.slice(s - 3, s + 1);
4959
+ if (n == "9999" || !rep && n == "4999") {
4960
+ if (!rep) {
4961
+ round2(t, t.e + DECIMAL_PLACES + 2, 0);
4962
+ if (t.times(t).eq(x)) {
4963
+ r = t;
4964
+ break;
4965
+ }
4966
+ }
4967
+ dp += 4;
4968
+ s += 4;
4969
+ rep = 1;
4970
+ } else {
4971
+ if (!+n || !+n.slice(1) && n.charAt(0) == "5") {
4972
+ round2(r, r.e + DECIMAL_PLACES + 2, 1);
4973
+ m = !r.times(r).eq(x);
4974
+ }
4975
+ break;
4976
+ }
4977
+ }
4978
+ }
4979
+ }
4980
+ return round2(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);
4981
+ };
4982
+ P.toExponential = function(dp, rm) {
4983
+ if (dp != null) {
4984
+ intCheck(dp, 0, MAX);
4985
+ dp++;
4986
+ }
4987
+ return format(this, dp, rm, 1);
4988
+ };
4989
+ P.toFixed = function(dp, rm) {
4990
+ if (dp != null) {
4991
+ intCheck(dp, 0, MAX);
4992
+ dp = dp + this.e + 1;
4993
+ }
4994
+ return format(this, dp, rm);
4995
+ };
4996
+ P.toFormat = function(dp, rm, format2) {
4997
+ var str, x = this;
4998
+ if (format2 == null) {
4999
+ if (dp != null && rm && typeof rm == "object") {
5000
+ format2 = rm;
5001
+ rm = null;
5002
+ } else if (dp && typeof dp == "object") {
5003
+ format2 = dp;
5004
+ dp = rm = null;
5005
+ } else {
5006
+ format2 = FORMAT;
5007
+ }
5008
+ } else if (typeof format2 != "object") {
5009
+ throw Error(bignumberError + "Argument not an object: " + format2);
5010
+ }
5011
+ str = x.toFixed(dp, rm);
5012
+ if (x.c) {
5013
+ var i, arr = str.split("."), g1 = +format2.groupSize, g2 = +format2.secondaryGroupSize, groupSeparator = format2.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length;
5014
+ if (g2) {
5015
+ i = g1;
5016
+ g1 = g2;
5017
+ g2 = i;
5018
+ len -= i;
5019
+ }
5020
+ if (g1 > 0 && len > 0) {
5021
+ i = len % g1 || g1;
5022
+ intPart = intDigits.substr(0, i);
5023
+ for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);
5024
+ if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);
5025
+ if (isNeg) intPart = "-" + intPart;
5026
+ }
5027
+ str = fractionPart ? intPart + (format2.decimalSeparator || "") + ((g2 = +format2.fractionGroupSize) ? fractionPart.replace(
5028
+ new RegExp("\\d{" + g2 + "}\\B", "g"),
5029
+ "$&" + (format2.fractionGroupSeparator || "")
5030
+ ) : fractionPart) : intPart;
5031
+ }
5032
+ return (format2.prefix || "") + str + (format2.suffix || "");
5033
+ };
5034
+ P.toFraction = function(md) {
5035
+ var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c;
5036
+ if (md != null) {
5037
+ n = new BigNumber2(md);
5038
+ if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
5039
+ throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
5040
+ }
5041
+ }
5042
+ if (!xc) return new BigNumber2(x);
5043
+ d = new BigNumber2(ONE);
5044
+ n1 = d0 = new BigNumber2(ONE);
5045
+ d1 = n0 = new BigNumber2(ONE);
5046
+ s = coeffToString(xc);
5047
+ e = d.e = s.length - x.e - 1;
5048
+ d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
5049
+ md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n;
5050
+ exp = MAX_EXP;
5051
+ MAX_EXP = 1 / 0;
5052
+ n = new BigNumber2(s);
5053
+ n0.c[0] = 0;
5054
+ for (; ; ) {
5055
+ q = div(n, d, 0, 1);
5056
+ d2 = d0.plus(q.times(d1));
5057
+ if (d2.comparedTo(md) == 1) break;
5058
+ d0 = d1;
5059
+ d1 = d2;
5060
+ n1 = n0.plus(q.times(d2 = n1));
5061
+ n0 = d2;
5062
+ d = n.minus(q.times(d2 = d));
5063
+ n = d2;
5064
+ }
5065
+ d2 = div(md.minus(d0), d1, 0, 1);
5066
+ n0 = n0.plus(d2.times(n1));
5067
+ d0 = d0.plus(d2.times(d1));
5068
+ n0.s = n1.s = x.s;
5069
+ e = e * 2;
5070
+ r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(
5071
+ div(n0, d0, e, ROUNDING_MODE).minus(x).abs()
5072
+ ) < 1 ? [n1, d1] : [n0, d0];
5073
+ MAX_EXP = exp;
5074
+ return r;
5075
+ };
5076
+ P.toNumber = function() {
5077
+ return +valueOf(this);
5078
+ };
5079
+ P.toPrecision = function(sd, rm) {
5080
+ if (sd != null) intCheck(sd, 1, MAX);
5081
+ return format(this, sd, rm, 2);
5082
+ };
5083
+ P.toString = function(b) {
5084
+ var str, n = this, s = n.s, e = n.e;
5085
+ if (e === null) {
5086
+ if (s) {
5087
+ str = "Infinity";
5088
+ if (s < 0) str = "-" + str;
5089
+ } else {
5090
+ str = "NaN";
5091
+ }
5092
+ } else {
5093
+ if (b == null) {
5094
+ str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, "0");
5095
+ } else if (b === 10 && alphabetHasNormalDecimalDigits) {
5096
+ n = round2(new BigNumber2(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
5097
+ str = toFixedPoint(coeffToString(n.c), n.e, "0");
5098
+ } else {
5099
+ intCheck(b, 2, ALPHABET.length, "Base");
5100
+ str = convertBase(toFixedPoint(coeffToString(n.c), e, "0"), 10, b, s, true);
5101
+ }
5102
+ if (s < 0 && n.c[0]) str = "-" + str;
5103
+ }
5104
+ return str;
5105
+ };
5106
+ P.valueOf = P.toJSON = function() {
5107
+ return valueOf(this);
5108
+ };
5109
+ P._isBigNumber = true;
5110
+ P[Symbol.toStringTag] = "BigNumber";
5111
+ P[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = P.valueOf;
5112
+ if (configObject != null) BigNumber2.set(configObject);
5113
+ return BigNumber2;
5114
+ }
5115
+ function bitFloor(n) {
5116
+ var i = n | 0;
5117
+ return n > 0 || n === i ? i : i - 1;
5118
+ }
5119
+ function coeffToString(a) {
5120
+ var s, z, i = 1, j = a.length, r = a[0] + "";
5121
+ for (; i < j; ) {
5122
+ s = a[i++] + "";
5123
+ z = LOG_BASE - s.length;
5124
+ for (; z--; s = "0" + s) ;
5125
+ r += s;
5126
+ }
5127
+ for (j = r.length; r.charCodeAt(--j) === 48; ) ;
5128
+ return r.slice(0, j + 1 || 1);
5129
+ }
5130
+ function compare(x, y) {
5131
+ var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;
5132
+ if (!i || !j) return null;
5133
+ a = xc && !xc[0];
5134
+ b = yc && !yc[0];
5135
+ if (a || b) return a ? b ? 0 : -j : i;
5136
+ if (i != j) return i;
5137
+ a = i < 0;
5138
+ b = k == l;
5139
+ if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;
5140
+ if (!b) return k > l ^ a ? 1 : -1;
5141
+ j = (k = xc.length) < (l = yc.length) ? k : l;
5142
+ for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
5143
+ return k == l ? 0 : k > l ^ a ? 1 : -1;
5144
+ }
5145
+ function intCheck(n, min, max, name) {
5146
+ if (n < min || n > max || n !== mathfloor(n)) {
5147
+ throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min || n > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
5148
+ }
5149
+ }
5150
+ function isOdd(n) {
5151
+ var k = n.c.length - 1;
5152
+ return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;
5153
+ }
5154
+ function toExponential(str, e) {
5155
+ return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e < 0 ? "e" : "e+") + e;
5156
+ }
5157
+ function toFixedPoint(str, e, z) {
5158
+ var len, zs;
5159
+ if (e < 0) {
5160
+ for (zs = z + "."; ++e; zs += z) ;
5161
+ str = zs + str;
5162
+ } else {
5163
+ len = str.length;
5164
+ if (++e > len) {
5165
+ for (zs = z, e -= len; --e; zs += z) ;
5166
+ str += zs;
5167
+ } else if (e < len) {
5168
+ str = str.slice(0, e) + "." + str.slice(e);
5169
+ }
5170
+ }
5171
+ return str;
5172
+ }
5173
+ var BigNumber = clone2();
5174
+ var bignumber_default = BigNumber;
3136
5175
 
3137
5176
  // src/ts/number/big.ts
3138
- var import_bignumber = __toESM(require("bignumber.js"), 1);
3139
5177
  function big(x) {
3140
- return x instanceof import_bignumber.default ? x : new import_bignumber.default(x);
5178
+ return x instanceof bignumber_default ? x : new bignumber_default(x);
3141
5179
  }
3142
5180
  function mathPlus(...rest2) {
3143
5181
  let acc = big(rest2[0]);
@@ -3162,10 +5200,10 @@ function mathDiv(...rest2) {
3162
5200
  function mathPow(x, y) {
3163
5201
  return big(x).pow(big(y)).toNumber();
3164
5202
  }
3165
- function mathRound(x, dp = 0, rm = import_bignumber.default.ROUND_HALF_UP) {
5203
+ function mathRound(x, dp = 0, rm = bignumber_default.ROUND_HALF_UP) {
3166
5204
  return big(x).decimalPlaces(dp, rm).toNumber();
3167
5205
  }
3168
- function mathFixed(x, dp = 2, rm = import_bignumber.default.ROUND_HALF_UP) {
5206
+ function mathFixed(x, dp = 2, rm = bignumber_default.ROUND_HALF_UP) {
3169
5207
  return big(x).toFixed(dp, rm);
3170
5208
  }
3171
5209
  function mathCompare(a, b) {
@@ -3260,10 +5298,10 @@ function toChineseNum(num) {
3260
5298
  function toChineseCurrency(amount, opts = {}) {
3261
5299
  var _a, _b, _c;
3262
5300
  const dp = (_a = opts.precision) != null ? _a : 2;
3263
- const rm = (_b = opts.rm) != null ? _b : import_bignumber.default.ROUND_HALF_UP;
5301
+ const rm = (_b = opts.rm) != null ? _b : bignumber_default.ROUND_HALF_UP;
3264
5302
  const yuan = (_c = opts.yuanChar) != null ? _c : "\u5143";
3265
5303
  if (amount === null || amount === void 0) return "";
3266
- const bn = new import_bignumber.default(amount);
5304
+ const bn = new bignumber_default(amount);
3267
5305
  if (!bn.isFinite()) return "";
3268
5306
  const s = bn.toFixed(dp, rm);
3269
5307
  const sign = s.startsWith("-") ? "\u8D1F" : "";
@@ -3288,7 +5326,7 @@ function toChineseCurrency(amount, opts = {}) {
3288
5326
  }
3289
5327
  return str.replace(/零+$/g, "");
3290
5328
  };
3291
- const intNum = new import_bignumber.default(intStr);
5329
+ const intNum = new bignumber_default(intStr);
3292
5330
  let res = "";
3293
5331
  if (intNum.isZero()) {
3294
5332
  res = digit[0];
@@ -3797,7 +5835,7 @@ function getOSSSegs(type, option) {
3797
5835
  if (!option && option !== 0) return "";
3798
5836
  if (option === true) return type;
3799
5837
  if (typeof option === "number" || typeof option === "string") return `${type},${option}`;
3800
- const segs = Object.entries(option).map(([k, v]) => `${k}_${v}`).join(",");
5838
+ const segs = Object.entries(option).filter(([, v]) => v !== null && v !== void 0).map(([k, v]) => `${k}_${v}`).join(",");
3801
5839
  return segs ? `${type},${segs}` : "";
3802
5840
  }
3803
5841
  function getWatermark(w) {
@@ -4007,7 +6045,7 @@ function isChinese(s) {
4007
6045
  function isDigits(s) {
4008
6046
  return /^[0-9]+$/.test(s);
4009
6047
  }
4010
- function isNumeric(value, options) {
6048
+ function isNumeric2(value, options) {
4011
6049
  const { negative = false, decimal = 2, thousands = false, leadZero = false } = options || {};
4012
6050
  if (value === null || value === void 0 || value === "") return false;
4013
6051
  const str = String(value).trim();