@ehubbell/serializers
Version:
A collection of data serializers for various projects.
1,334 lines (1,333 loc) • 49 kB
JavaScript
"use strict";
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getDefaultExportFromCjs(x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
}
var dayjs_min = { exports: {} };
(function(module2, exports2) {
!function(t, e) {
module2.exports = e();
}(commonjsGlobal, function() {
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) {
var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
} }, m = function(t2, e2, n2) {
var r2 = String(t2);
return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
}, v = { s: m, z: function(t2) {
var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
}, m: function t2(e2, n2) {
if (e2.date() < n2.date())
return -t2(n2, e2);
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);
return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
}, a: function(t2) {
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
}, p: function(t2) {
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$/, "");
}, u: function(t2) {
return void 0 === t2;
} }, g = "en", D = {};
D[g] = M;
var p = "$isDayjsObject", S = function(t2) {
return t2 instanceof _ || !(!t2 || !t2[p]);
}, w = function t2(e2, n2, r2) {
var i2;
if (!e2)
return g;
if ("string" == typeof e2) {
var s2 = e2.toLowerCase();
D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
var u2 = e2.split("-");
if (!i2 && u2.length > 1)
return t2(u2[0]);
} else {
var a2 = e2.name;
D[a2] = e2, i2 = a2;
}
return !r2 && i2 && (g = i2), i2 || !r2 && g;
}, O = function(t2, e2) {
if (S(t2))
return t2.clone();
var n2 = "object" == typeof e2 ? e2 : {};
return n2.date = t2, n2.args = arguments, new _(n2);
}, b = v;
b.l = w, b.i = S, b.w = function(t2, e2) {
return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
};
var _ = function() {
function M2(t2) {
this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
}
var m2 = M2.prototype;
return m2.parse = function(t2) {
this.$d = function(t3) {
var e2 = t3.date, n2 = t3.utc;
if (null === e2)
return /* @__PURE__ */ new Date(NaN);
if (b.u(e2))
return /* @__PURE__ */ new Date();
if (e2 instanceof Date)
return new Date(e2);
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
var r2 = e2.match($);
if (r2) {
var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
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);
}
}
return new Date(e2);
}(t2), this.init();
}, m2.init = function() {
var t2 = this.$d;
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();
}, m2.$utils = function() {
return b;
}, m2.isValid = function() {
return !(this.$d.toString() === l);
}, m2.isSame = function(t2, e2) {
var n2 = O(t2);
return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
}, m2.isAfter = function(t2, e2) {
return O(t2) < this.startOf(e2);
}, m2.isBefore = function(t2, e2) {
return this.endOf(e2) < O(t2);
}, m2.$g = function(t2, e2, n2) {
return b.u(t2) ? this[e2] : this.set(n2, t2);
}, m2.unix = function() {
return Math.floor(this.valueOf() / 1e3);
}, m2.valueOf = function() {
return this.$d.getTime();
}, m2.startOf = function(t2, e2) {
var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
return r2 ? i2 : i2.endOf(a);
}, $2 = function(t3, e3) {
return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
switch (f2) {
case h:
return r2 ? l2(1, 0) : l2(31, 11);
case c:
return r2 ? l2(1, M3) : l2(0, M3 + 1);
case o:
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
case a:
case d:
return $2(v2 + "Hours", 0);
case u:
return $2(v2 + "Minutes", 1);
case s:
return $2(v2 + "Seconds", 2);
case i:
return $2(v2 + "Milliseconds", 3);
default:
return this.clone();
}
}, m2.endOf = function(t2) {
return this.startOf(t2, false);
}, m2.$set = function(t2, e2) {
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;
if (o2 === c || o2 === h) {
var y2 = this.clone().set(d, 1);
y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
} else
l2 && this.$d[l2]($2);
return this.init(), this;
}, m2.set = function(t2, e2) {
return this.clone().$set(t2, e2);
}, m2.get = function(t2) {
return this[b.p(t2)]();
}, m2.add = function(r2, f2) {
var d2, l2 = this;
r2 = Number(r2);
var $2 = b.p(f2), y2 = function(t2) {
var e2 = O(l2);
return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
};
if ($2 === c)
return this.set(c, this.$M + r2);
if ($2 === h)
return this.set(h, this.$y + r2);
if ($2 === a)
return y2(1);
if ($2 === o)
return y2(7);
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
return b.w(m3, this);
}, m2.subtract = function(t2, e2) {
return this.add(-1 * t2, e2);
}, m2.format = function(t2) {
var e2 = this, n2 = this.$locale();
if (!this.isValid())
return n2.invalidDate || l;
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) {
return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
}, d2 = function(t3) {
return b.s(s2 % 12 || 12, t3, "0");
}, $2 = f2 || function(t3, e3, n3) {
var r3 = t3 < 12 ? "AM" : "PM";
return n3 ? r3.toLowerCase() : r3;
};
return r2.replace(y, function(t3, r3) {
return r3 || function(t4) {
switch (t4) {
case "YY":
return String(e2.$y).slice(-2);
case "YYYY":
return b.s(e2.$y, 4, "0");
case "M":
return a2 + 1;
case "MM":
return b.s(a2 + 1, 2, "0");
case "MMM":
return h2(n2.monthsShort, a2, c2, 3);
case "MMMM":
return h2(c2, a2);
case "D":
return e2.$D;
case "DD":
return b.s(e2.$D, 2, "0");
case "d":
return String(e2.$W);
case "dd":
return h2(n2.weekdaysMin, e2.$W, o2, 2);
case "ddd":
return h2(n2.weekdaysShort, e2.$W, o2, 3);
case "dddd":
return o2[e2.$W];
case "H":
return String(s2);
case "HH":
return b.s(s2, 2, "0");
case "h":
return d2(1);
case "hh":
return d2(2);
case "a":
return $2(s2, u2, true);
case "A":
return $2(s2, u2, false);
case "m":
return String(u2);
case "mm":
return b.s(u2, 2, "0");
case "s":
return String(e2.$s);
case "ss":
return b.s(e2.$s, 2, "0");
case "SSS":
return b.s(e2.$ms, 3, "0");
case "Z":
return i2;
}
return null;
}(t3) || i2.replace(":", "");
});
}, m2.utcOffset = function() {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
}, m2.diff = function(r2, d2, l2) {
var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
return b.m(y2, m3);
};
switch (M3) {
case h:
$2 = D2() / 12;
break;
case c:
$2 = D2();
break;
case f:
$2 = D2() / 3;
break;
case o:
$2 = (g2 - v2) / 6048e5;
break;
case a:
$2 = (g2 - v2) / 864e5;
break;
case u:
$2 = g2 / n;
break;
case s:
$2 = g2 / e;
break;
case i:
$2 = g2 / t;
break;
default:
$2 = g2;
}
return l2 ? $2 : b.a($2);
}, m2.daysInMonth = function() {
return this.endOf(c).$D;
}, m2.$locale = function() {
return D[this.$L];
}, m2.locale = function(t2, e2) {
if (!t2)
return this.$L;
var n2 = this.clone(), r2 = w(t2, e2, true);
return r2 && (n2.$L = r2), n2;
}, m2.clone = function() {
return b.w(this.$d, this);
}, m2.toDate = function() {
return new Date(this.valueOf());
}, m2.toJSON = function() {
return this.isValid() ? this.toISOString() : null;
}, m2.toISOString = function() {
return this.$d.toISOString();
}, m2.toString = function() {
return this.$d.toUTCString();
}, M2;
}(), k = _.prototype;
return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
k[t2[1]] = function(e2) {
return this.$g(e2, t2[0], t2[1]);
};
}), O.extend = function(t2, e2) {
return t2.$i || (t2(e2, _, O), t2.$i = true), O;
}, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
return O(1e3 * t2);
}, O.en = D[g], O.Ls = D, O.p = {}, O;
});
})(dayjs_min);
var dayjs_minExports = dayjs_min.exports;
const Dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
var advancedFormat = { exports: {} };
(function(module2, exports2) {
!function(e, t) {
module2.exports = t();
}(commonjsGlobal, function() {
return function(e, t) {
var r = t.prototype, n = r.format;
r.format = function(e2) {
var t2 = this, r2 = this.$locale();
if (!this.isValid())
return n.bind(this)(e2);
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) {
switch (e3) {
case "Q":
return Math.ceil((t2.$M + 1) / 3);
case "Do":
return r2.ordinal(t2.$D);
case "gggg":
return t2.weekYear();
case "GGGG":
return t2.isoWeekYear();
case "wo":
return r2.ordinal(t2.week(), "W");
case "w":
case "ww":
return s.s(t2.week(), "w" === e3 ? 1 : 2, "0");
case "W":
case "WW":
return s.s(t2.isoWeek(), "W" === e3 ? 1 : 2, "0");
case "k":
case "kk":
return s.s(String(0 === t2.$H ? 24 : t2.$H), "k" === e3 ? 1 : 2, "0");
case "X":
return Math.floor(t2.$d.getTime() / 1e3);
case "x":
return t2.$d.getTime();
case "z":
return "[" + t2.offsetName() + "]";
case "zzz":
return "[" + t2.offsetName("long") + "]";
default:
return e3;
}
});
return n.bind(this)(a);
};
};
});
})(advancedFormat);
var advancedFormatExports = advancedFormat.exports;
const AdvancedFormat = /* @__PURE__ */ getDefaultExportFromCjs(advancedFormatExports);
var quarterOfYear = { exports: {} };
(function(module2, exports2) {
!function(t, n) {
module2.exports = n();
}(commonjsGlobal, function() {
var t = "month", n = "quarter";
return function(e, i) {
var r = i.prototype;
r.quarter = function(t2) {
return this.$utils().u(t2) ? Math.ceil((this.month() + 1) / 3) : this.month(this.month() % 3 + 3 * (t2 - 1));
};
var s = r.add;
r.add = function(e2, i2) {
return e2 = Number(e2), this.$utils().p(i2) === n ? this.add(3 * e2, t) : s.bind(this)(e2, i2);
};
var u = r.startOf;
r.startOf = function(e2, i2) {
var r2 = this.$utils(), s2 = !!r2.u(i2) || i2;
if (r2.p(e2) === n) {
var o = this.quarter() - 1;
return s2 ? this.month(3 * o).startOf(t).startOf("day") : this.month(3 * o + 2).endOf(t).endOf("day");
}
return u.bind(this)(e2, i2);
};
};
});
})(quarterOfYear);
var quarterOfYearExports = quarterOfYear.exports;
const QuarterOfYear = /* @__PURE__ */ getDefaultExportFromCjs(quarterOfYearExports);
var relativeTime = { exports: {} };
(function(module2, exports2) {
!function(r, e) {
module2.exports = e();
}(commonjsGlobal, function() {
return function(r, e, t) {
r = r || {};
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" };
function i(r2, e2, t2, o2) {
return n.fromToBase(r2, e2, t2, o2);
}
t.en.relativeTime = o, n.fromToBase = function(e2, n2, i2, d2, u) {
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) {
var y = h[c];
y.d && (f = d2 ? t(e2).diff(i2, y.d, true) : i2.diff(e2, y.d, true));
var p = (r.rounding || Math.round)(Math.abs(f));
if (s = f > 0, p <= y.r || !y.r) {
p <= 1 && c > 0 && (y = h[c - 1]);
var v = l[y.l];
u && (p = u("" + p)), a = "string" == typeof v ? v.replace("%d", p) : v(p, n2, y.l, s);
break;
}
}
if (n2)
return a;
var M = s ? l.future : l.past;
return "function" == typeof M ? M(a) : M.replace("%s", a);
}, n.to = function(r2, e2) {
return i(r2, e2, this, true);
}, n.from = function(r2, e2) {
return i(r2, e2, this);
};
var d = function(r2) {
return r2.$u ? t.utc() : t();
};
n.toNow = function(r2) {
return this.to(d(this), r2);
}, n.fromNow = function(r2) {
return this.from(d(this), r2);
};
};
});
})(relativeTime);
var relativeTimeExports = relativeTime.exports;
const RelativeTime = /* @__PURE__ */ getDefaultExportFromCjs(relativeTimeExports);
var timezone = { exports: {} };
(function(module2, exports2) {
!function(t, e) {
module2.exports = e();
}(commonjsGlobal, function() {
var t = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, e = {};
return function(n, i, o) {
var r, a = function(t2, n2, i2) {
void 0 === i2 && (i2 = {});
var o2 = new Date(t2), r2 = function(t3, n3) {
void 0 === n3 && (n3 = {});
var i3 = n3.timeZoneName || "short", o3 = t3 + "|" + i3, r3 = e[o3];
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;
}(n2, i2);
return r2.formatToParts(o2);
}, u = function(e2, n2) {
for (var i2 = a(e2, n2), r2 = [], u2 = 0; u2 < i2.length; u2 += 1) {
var f2 = i2[u2], s2 = f2.type, m = f2.value, c = t[s2];
c >= 0 && (r2[c] = parseInt(m, 10));
}
var d = r2[3], l = 24 === d ? 0 : d, h = r2[0] + "-" + r2[1] + "-" + r2[2] + " " + l + ":" + r2[4] + ":" + r2[5] + ":000", v = +e2;
return (o.utc(h).valueOf() - (v -= v % 1e3)) / 6e4;
}, f = i.prototype;
f.tz = function(t2, e2) {
void 0 === t2 && (t2 = r);
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;
if (!Number(s2))
n2 = this.utcOffset(0, e2);
else if (n2 = o(u2, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(s2, true), e2) {
var m = n2.utcOffset();
n2 = n2.add(i2 - m, "minute");
}
return n2.$x.$timezone = t2, n2;
}, f.offsetName = function(t2) {
var e2 = this.$x.$timezone || o.tz.guess(), n2 = a(this.valueOf(), e2, { timeZoneName: t2 }).find(function(t3) {
return "timezonename" === t3.type.toLowerCase();
});
return n2 && n2.value;
};
var s = f.startOf;
f.startOf = function(t2, e2) {
if (!this.$x || !this.$x.$timezone)
return s.call(this, t2, e2);
var n2 = o(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
return s.call(n2, t2, e2).tz(this.$x.$timezone, true);
}, o.tz = function(t2, e2, n2) {
var i2 = n2 && e2, a2 = n2 || e2 || r, f2 = u(+o(), a2);
if ("string" != typeof t2)
return o(t2).tz(a2);
var s2 = function(t3, e3, n3) {
var i3 = t3 - 60 * e3 * 1e3, o2 = u(i3, n3);
if (e3 === o2)
return [i3, e3];
var r2 = u(i3 -= 60 * (o2 - e3) * 1e3, n3);
return o2 === r2 ? [i3, o2] : [t3 - 60 * Math.min(o2, r2) * 1e3, Math.max(o2, r2)];
}(o.utc(t2, i2).valueOf(), f2, a2), m = s2[0], c = s2[1], d = o(m).utcOffset(c);
return d.$x.$timezone = a2, d;
}, o.tz.guess = function() {
return Intl.DateTimeFormat().resolvedOptions().timeZone;
}, o.tz.setDefault = function(t2) {
r = t2;
};
};
});
})(timezone);
var timezoneExports = timezone.exports;
const Timezone = /* @__PURE__ */ getDefaultExportFromCjs(timezoneExports);
var utc = { exports: {} };
(function(module2, exports2) {
!function(t, i) {
module2.exports = i();
}(commonjsGlobal, function() {
var t = "minute", i = /[+-]\d\d(?::?\d\d)?/g, e = /([+-]|\d\d)/g;
return function(s, f, n) {
var u = f.prototype;
n.utc = function(t2) {
var i2 = { date: t2, utc: true, args: arguments };
return new f(i2);
}, u.utc = function(i2) {
var e2 = n(this.toDate(), { locale: this.$L, utc: true });
return i2 ? e2.add(this.utcOffset(), t) : e2;
}, u.local = function() {
return n(this.toDate(), { locale: this.$L, utc: false });
};
var o = u.parse;
u.parse = function(t2) {
t2.utc && (this.$u = true), this.$utils().u(t2.$offset) || (this.$offset = t2.$offset), o.call(this, t2);
};
var r = u.init;
u.init = function() {
if (this.$u) {
var t2 = this.$d;
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();
} else
r.call(this);
};
var a = u.utcOffset;
u.utcOffset = function(s2, f2) {
var n2 = this.$utils().u;
if (n2(s2))
return this.$u ? 0 : n2(this.$offset) ? a.call(this) : this.$offset;
if ("string" == typeof s2 && (s2 = function(t2) {
void 0 === t2 && (t2 = "");
var s3 = t2.match(i);
if (!s3)
return null;
var f3 = ("" + s3[0]).match(e) || ["-", 0, 0], n3 = f3[0], u3 = 60 * +f3[1] + +f3[2];
return 0 === u3 ? 0 : "+" === n3 ? u3 : -u3;
}(s2), null === s2))
return this;
var u2 = Math.abs(s2) <= 16 ? 60 * s2 : s2, o2 = this;
if (f2)
return o2.$offset = u2, o2.$u = 0 === s2, o2;
if (0 !== s2) {
var r2 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
(o2 = this.local().add(u2 + r2, t)).$offset = u2, o2.$x.$localOffset = r2;
} else
o2 = this.utc();
return o2;
};
var h = u.format;
u.format = function(t2) {
var i2 = t2 || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
return h.call(this, i2);
}, u.valueOf = function() {
var t2 = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
return this.$d.valueOf() - 6e4 * t2;
}, u.isUTC = function() {
return !!this.$u;
}, u.toISOString = function() {
return this.toDate().toISOString();
}, u.toString = function() {
return this.toDate().toUTCString();
};
var l = u.toDate;
u.toDate = function(t2) {
return "s" === t2 && this.$offset ? n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : l.call(this);
};
var c = u.diff;
u.diff = function(t2, i2, e2) {
if (t2 && this.$u === t2.$u)
return c.call(this, t2, i2, e2);
var s2 = this.local(), f2 = n(t2).local();
return c.call(s2, f2, i2, e2);
};
};
});
})(utc);
var utcExports = utc.exports;
const UTC = /* @__PURE__ */ getDefaultExportFromCjs(utcExports);
Dayjs.extend(AdvancedFormat);
Dayjs.extend(QuarterOfYear);
Dayjs.extend(RelativeTime);
Dayjs.extend(Timezone);
Dayjs.extend(UTC);
process.env.NEXT_PUBLIC_NODE_ENV || process.env.NODE_ENV;
function getAugmentedNamespace(n) {
if (n.__esModule)
return n;
var f = n.default;
if (typeof f == "function") {
var a = function a2() {
if (this instanceof a2) {
return Reflect.construct(f, arguments, this.constructor);
}
return f.apply(this, arguments);
};
a.prototype = f.prototype;
} else
a = {};
Object.defineProperty(a, "__esModule", { value: true });
Object.keys(n).forEach(function(k) {
var d = Object.getOwnPropertyDescriptor(n, k);
Object.defineProperty(a, k, d.get ? d : {
enumerable: true,
get: function() {
return n[k];
}
});
});
return a;
}
function commonjsRequire$1(path) {
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var uniqid = { exports: {} };
const __viteBrowserExternal = {};
const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: __viteBrowserExternal
}, Symbol.toStringTag, { value: "Module" }));
const require$$0 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);
var pid = typeof process !== "undefined" && process.pid ? process.pid.toString(36) : "";
var address = "";
if (typeof __webpack_require__ !== "function" && typeof commonjsRequire$1 !== "undefined") {
var mac = "", os = require$$0;
if (os.networkInterfaces)
var networkInterfaces = os.networkInterfaces();
if (networkInterfaces) {
loop:
for (let interface_key in networkInterfaces) {
const networkInterface = networkInterfaces[interface_key];
const length = networkInterface.length;
for (var i = 0; i < length; i++) {
if (networkInterface[i] !== void 0 && networkInterface[i].mac && networkInterface[i].mac != "00:00:00:00:00:00") {
mac = networkInterface[i].mac;
break loop;
}
}
}
address = mac ? parseInt(mac.replace(/\:|\D+/gi, "")).toString(36) : "";
}
}
uniqid.exports = uniqid.exports.default = function(prefix, suffix) {
return (prefix ? prefix : "") + address + pid + now().toString(36) + (suffix ? suffix : "");
};
uniqid.exports.process = function(prefix, suffix) {
return (prefix ? prefix : "") + pid + now().toString(36) + (suffix ? suffix : "");
};
uniqid.exports.time = function(prefix, suffix) {
return (prefix ? prefix : "") + now().toString(36) + (suffix ? suffix : "");
};
function now() {
var time = Date.now();
var last = now.last || time;
return now.last = time > last ? time : last + 1;
}
function commonjsRequire(path) {
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var pluralize$1 = { exports: {} };
(function(module2, exports2) {
(function(root, pluralize2) {
if (typeof commonjsRequire === "function" && true && true) {
module2.exports = pluralize2();
} else {
root.pluralize = pluralize2();
}
})(commonjsGlobal, function() {
var pluralRules = [];
var singularRules = [];
var uncountables = {};
var irregularPlurals = {};
var irregularSingles = {};
function sanitizeRule(rule) {
if (typeof rule === "string") {
return new RegExp("^" + rule + "$", "i");
}
return rule;
}
function restoreCase(word, token) {
if (word === token)
return token;
if (word === word.toLowerCase())
return token.toLowerCase();
if (word === word.toUpperCase())
return token.toUpperCase();
if (word[0] === word[0].toUpperCase()) {
return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();
}
return token.toLowerCase();
}
function interpolate(str, args) {
return str.replace(/\$(\d{1,2})/g, function(match, index) {
return args[index] || "";
});
}
function replace(word, rule) {
return word.replace(rule[0], function(match, index) {
var result = interpolate(rule[1], arguments);
if (match === "") {
return restoreCase(word[index - 1], result);
}
return restoreCase(match, result);
});
}
function sanitizeWord(token, word, rules) {
if (!token.length || uncountables.hasOwnProperty(token)) {
return word;
}
var len = rules.length;
while (len--) {
var rule = rules[len];
if (rule[0].test(word))
return replace(word, rule);
}
return word;
}
function replaceWord(replaceMap, keepMap, rules) {
return function(word) {
var token = word.toLowerCase();
if (keepMap.hasOwnProperty(token)) {
return restoreCase(word, token);
}
if (replaceMap.hasOwnProperty(token)) {
return restoreCase(word, replaceMap[token]);
}
return sanitizeWord(token, word, rules);
};
}
function checkWord(replaceMap, keepMap, rules, bool) {
return function(word) {
var token = word.toLowerCase();
if (keepMap.hasOwnProperty(token))
return true;
if (replaceMap.hasOwnProperty(token))
return false;
return sanitizeWord(token, token, rules) === token;
};
}
function pluralize2(word, count, inclusive) {
var pluralized = count === 1 ? pluralize2.singular(word) : pluralize2.plural(word);
return (inclusive ? count + " " : "") + pluralized;
}
pluralize2.plural = replaceWord(
irregularSingles,
irregularPlurals,
pluralRules
);
pluralize2.isPlural = checkWord(
irregularSingles,
irregularPlurals,
pluralRules
);
pluralize2.singular = replaceWord(
irregularPlurals,
irregularSingles,
singularRules
);
pluralize2.isSingular = checkWord(
irregularPlurals,
irregularSingles,
singularRules
);
pluralize2.addPluralRule = function(rule, replacement) {
pluralRules.push([sanitizeRule(rule), replacement]);
};
pluralize2.addSingularRule = function(rule, replacement) {
singularRules.push([sanitizeRule(rule), replacement]);
};
pluralize2.addUncountableRule = function(word) {
if (typeof word === "string") {
uncountables[word.toLowerCase()] = true;
return;
}
pluralize2.addPluralRule(word, "$0");
pluralize2.addSingularRule(word, "$0");
};
pluralize2.addIrregularRule = function(single, plural) {
plural = plural.toLowerCase();
single = single.toLowerCase();
irregularSingles[single] = plural;
irregularPlurals[plural] = single;
};
[
// Pronouns.
["I", "we"],
["me", "us"],
["he", "they"],
["she", "they"],
["them", "them"],
["myself", "ourselves"],
["yourself", "yourselves"],
["itself", "themselves"],
["herself", "themselves"],
["himself", "themselves"],
["themself", "themselves"],
["is", "are"],
["was", "were"],
["has", "have"],
["this", "these"],
["that", "those"],
// Words ending in with a consonant and `o`.
["echo", "echoes"],
["dingo", "dingoes"],
["volcano", "volcanoes"],
["tornado", "tornadoes"],
["torpedo", "torpedoes"],
// Ends with `us`.
["genus", "genera"],
["viscus", "viscera"],
// Ends with `ma`.
["stigma", "stigmata"],
["stoma", "stomata"],
["dogma", "dogmata"],
["lemma", "lemmata"],
["schema", "schemata"],
["anathema", "anathemata"],
// Other irregular rules.
["ox", "oxen"],
["axe", "axes"],
["die", "dice"],
["yes", "yeses"],
["foot", "feet"],
["eave", "eaves"],
["goose", "geese"],
["tooth", "teeth"],
["quiz", "quizzes"],
["human", "humans"],
["proof", "proofs"],
["carve", "carves"],
["valve", "valves"],
["looey", "looies"],
["thief", "thieves"],
["groove", "grooves"],
["pickaxe", "pickaxes"],
["passerby", "passersby"]
].forEach(function(rule) {
return pluralize2.addIrregularRule(rule[0], rule[1]);
});
[
[/s?$/i, "s"],
[/[^\u0000-\u007F]$/i, "$0"],
[/([^aeiou]ese)$/i, "$1"],
[/(ax|test)is$/i, "$1es"],
[/(alias|[^aou]us|t[lm]as|gas|ris)$/i, "$1es"],
[/(e[mn]u)s?$/i, "$1s"],
[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, "$1"],
[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1i"],
[/(alumn|alg|vertebr)(?:a|ae)$/i, "$1ae"],
[/(seraph|cherub)(?:im)?$/i, "$1im"],
[/(her|at|gr)o$/i, "$1oes"],
[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, "$1a"],
[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, "$1a"],
[/sis$/i, "ses"],
[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, "$1$2ves"],
[/([^aeiouy]|qu)y$/i, "$1ies"],
[/([^ch][ieo][ln])ey$/i, "$1ies"],
[/(x|ch|ss|sh|zz)$/i, "$1es"],
[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, "$1ices"],
[/\b((?:tit)?m|l)(?:ice|ouse)$/i, "$1ice"],
[/(pe)(?:rson|ople)$/i, "$1ople"],
[/(child)(?:ren)?$/i, "$1ren"],
[/eaux$/i, "$0"],
[/m[ae]n$/i, "men"],
["thou", "you"]
].forEach(function(rule) {
return pluralize2.addPluralRule(rule[0], rule[1]);
});
[
[/s$/i, ""],
[/(ss)$/i, "$1"],
[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, "$1fe"],
[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, "$1f"],
[/ies$/i, "y"],
[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, "$1ie"],
[/\b(mon|smil)ies$/i, "$1ey"],
[/\b((?:tit)?m|l)ice$/i, "$1ouse"],
[/(seraph|cherub)im$/i, "$1"],
[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, "$1"],
[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, "$1sis"],
[/(movie|twelve|abuse|e[mn]u)s$/i, "$1"],
[/(test)(?:is|es)$/i, "$1is"],
[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1us"],
[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, "$1um"],
[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, "$1on"],
[/(alumn|alg|vertebr)ae$/i, "$1a"],
[/(cod|mur|sil|vert|ind)ices$/i, "$1ex"],
[/(matr|append)ices$/i, "$1ix"],
[/(pe)(rson|ople)$/i, "$1rson"],
[/(child)ren$/i, "$1"],
[/(eau)x?$/i, "$1"],
[/men$/i, "man"]
].forEach(function(rule) {
return pluralize2.addSingularRule(rule[0], rule[1]);
});
[
// Singular words with no plurals.
"adulthood",
"advice",
"agenda",
"aid",
"aircraft",
"alcohol",
"ammo",
"analytics",
"anime",
"athletics",
"audio",
"bison",
"blood",
"bream",
"buffalo",
"butter",
"carp",
"cash",
"chassis",
"chess",
"clothing",
"cod",
"commerce",
"cooperation",
"corps",
"debris",
"diabetes",
"digestion",
"elk",
"energy",
"equipment",
"excretion",
"expertise",
"firmware",
"flounder",
"fun",
"gallows",
"garbage",
"graffiti",
"hardware",
"headquarters",
"health",
"herpes",
"highjinks",
"homework",
"housework",
"information",
"jeans",
"justice",
"kudos",
"labour",
"literature",
"machinery",
"mackerel",
"mail",
"media",
"mews",
"moose",
"music",
"mud",
"manga",
"news",
"only",
"personnel",
"pike",
"plankton",
"pliers",
"police",
"pollution",
"premises",
"rain",
"research",
"rice",
"salmon",
"scissors",
"series",
"sewage",
"shambles",
"shrimp",
"software",
"species",
"staff",
"swine",
"tennis",
"traffic",
"transportation",
"trout",
"tuna",
"wealth",
"welfare",
"whiting",
"wildebeest",
"wildlife",
"you",
/pok[eé]mon$/i,
// Regexes.
/[^aeiou]ese$/i,
// "chinese", "japanese"
/deer$/i,
// "deer", "reindeer"
/fish$/i,
// "fish", "blowfish", "angelfish"
/measles$/i,
/o[iu]s$/i,
// "carnivorous"
/pox$/i,
// "chickpox", "smallpox"
/sheep$/i
].forEach(pluralize2.addUncountableRule);
return pluralize2;
});
})(pluralize$1);
const isArray = (data) => {
return Array.isArray(data);
};
const isObject = (data) => {
return data !== null && data && typeof data === "object";
};
const isEmpty = (data) => {
if (data === null || data === void 0 || data === "undefined")
return true;
if (isArray(data))
return data.length === 0 ? true : false;
if (isObject(data))
return Object.keys(data).length === 0 ? true : false;
return data.length === 0 ? true : false;
};
var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
const errorStyles = "color: crimson";
const infoStyles = "color: cadetblue";
const warningStyles = "color: amber";
const successStyles = "color: aquamarine";
class logger {
}
__publicField(logger, "log", (title, ...data) => {
return console.log(title, ...data);
});
__publicField(logger, "error", (title, ...data) => {
return console.error(`%c${title}`, errorStyles, ...data);
});
__publicField(logger, "warn", (title, ...data) => {
return console.warn(`%c${title}`, warningStyles, ...data);
});
__publicField(logger, "info", (title, ...data) => {
return console.info(`%c${title}`, infoStyles, ...data);
});
__publicField(logger, "success", (title, ...data) => {
return console.info(`%c${title}`, successStyles, ...data);
});
__publicField(logger, "debug", (title, ...data) => {
return console.debug(`%c${title}`, infoStyles, ...data);
});
var accounting = { exports: {} };
/*!
* accounting.js v0.4.1
* Copyright 2014 Open Exchange Rates
*
* Freely distributable under the MIT license.
* Portions of accounting.js are inspired or borrowed from underscore.js
*
* Full details and documentation:
* http://openexchangerates.github.io/accounting.js/
*/
(function(module2, exports2) {
(function(root, undefined$1) {
var lib = {};
lib.version = "0.4.1";
lib.settings = {
currency: {
symbol: "$",
// default currency symbol is '$'
format: "%s%v",
// controls output: %s = symbol, %v = value (can be object, see docs)
decimal: ".",
// decimal point separator
thousand: ",",
// thousands separator
precision: 2,
// decimal places
grouping: 3
// digit grouping (not implemented yet)
},
number: {
precision: 0,
// default precision on numbers is 0
grouping: 3,
// digit grouping (not implemented yet)
thousand: ",",
decimal: "."
}
};
var nativeMap = Array.prototype.map, nativeIsArray = Array.isArray, toString = Object.prototype.toString;
function isString(obj) {
return !!(obj === "" || obj && obj.charCodeAt && obj.substr);
}
function isArray2(obj) {
return nativeIsArray ? nativeIsArray(obj) : toString.call(obj) === "[object Array]";
}
function isObject2(obj) {
return obj && toString.call(obj) === "[object Object]";
}
function defaults(object, defs) {
var key;
object = object || {};
defs = defs || {};
for (key in defs) {
if (defs.hasOwnProperty(key)) {
if (object[key] == null)
object[key] = defs[key];
}
}
return object;
}
function map(obj, iterator, context) {
var results = [], i, j;
if (!obj)
return results;
if (nativeMap && obj.map === nativeMap)
return obj.map(iterator, context);
for (i = 0, j = obj.length; i < j; i++) {
results[i] = iterator.call(context, obj[i], i, obj);
}
return results;
}
function checkPrecision(val, base) {
val = Math.round(Math.abs(val));
return isNaN(val) ? base : val;
}
function checkCurrencyFormat(format) {
var defaults2 = lib.settings.currency.format;
if (typeof format === "function")
format = format();
if (isString(format) && format.match("%v")) {
return {
pos: format,
neg: format.replace("-", "").replace("%v", "-%v"),
zero: format
};
} else if (!format || !format.pos || !format.pos.match("%v")) {
return !isString(defaults2) ? defaults2 : lib.settings.currency.format = {
pos: defaults2,
neg: defaults2.replace("%v", "-%v"),
zero: defaults2
};
}
return format;
}
var unformat = lib.unformat = lib.parse = function(value, decimal) {
if (isArray2(value)) {
return map(value, function(val) {
return unformat(val, decimal);
});
}
value = value || 0;
if (typeof value === "number")
return value;
decimal = decimal || lib.settings.number.decimal;
var regex = new RegExp("[^0-9-" + decimal + "]", ["g"]), unformatted = parseFloat(
("" + value).replace(/\((.*)\)/, "-$1").replace(regex, "").replace(decimal, ".")
// make sure decimal point is standard
);
return !isNaN(unformatted) ? unformatted : 0;
};
var toFixed = lib.toFixed = function(value, precision) {
precision = checkPrecision(precision, lib.settings.number.precision);
var power = Math.pow(10, precision);
return (Math.round(lib.unformat(value) * power) / power).toFixed(precision);
};
var formatNumber = lib.formatNumber = lib.format = function(number, precision, thousand, decimal) {
if (isArray2(number)) {
return map(number, function(val) {
return formatNumber(val, precision, thousand, decimal);
});
}
number = unformat(number);
var opts = defaults(
isObject2(precision) ? precision : {
precision,
thousand,
decimal
},
lib.settings.number
), usePrecision = checkPrecision(opts.precision), negative = number < 0 ? "-" : "", base = parseInt(toFixed(Math.abs(number || 0), usePrecision), 10) + "", mod = base.length > 3 ? base.length % 3 : 0;
return negative + (mod ? base.substr(0, mod) + opts.thousand : "") + base.substr(mod).replace(/(\d{3})(?=\d)/g, "$1" + opts.thousand) + (usePrecision ? opts.decimal + toFixed(Math.abs(number), usePrecision).split(".")[1] : "");
};
var formatMoney = lib.formatMoney = function(number, symbol, precision, thousand, decimal, format) {
if (isArray2(number)) {
return map(number, function(val) {
return formatMoney(val, symbol, precision, thousand, decimal, format);
});
}
number = unformat(number);
var opts = defaults(
isObject2(symbol) ? symbol : {
symbol,
precision,
thousand,
decimal,
format
},
lib.settings.currency
), formats = checkCurrencyFormat(opts.format), useFormat = number > 0 ? formats.pos : number < 0 ? formats.neg : formats.zero;
return useFormat.replace("%s", opts.symbol).replace("%v", formatNumber(Math.abs(number), checkPrecision(opts.precision), opts.thousand, opts.decimal));
};
lib.formatColumn = function(list, symbol, precision, thousand, decimal, format) {
if (!list)
return [];
var opts = defaults(
isObject2(symbol) ? symbol : {
symbol,
precision,
thousand,
decimal,
format
},
lib.settings.currency
), formats = checkCurrencyFormat(opts.format), padAfterSymbol = formats.pos.indexOf("%s") < formats.pos.indexOf("%v") ? true : false, maxLength = 0, formatted = map(list, function(val, i) {
if (isArray2(val)) {
return lib.formatColumn(val, opts);
} else {
val = unformat(val);
var useFormat = val > 0 ? formats.pos : val < 0 ? formats.neg : formats.zero, fVal = useFormat.replace("%s", opts.symbol).replace("%v", formatNumber(Math.abs(val), checkPrecision(opts.precision), opts.thousand, opts.decimal));
if (fVal.length > maxLength)
maxLength = fVal.length;
return fVal;
}
});
return map(formatted, function(val, i) {
if (isString(val) && val.length < maxLength) {
return padAfterSymbol ? val.replace(opts.symbol, opts.symbol + new Array(maxLength - val.length + 1).join(" ")) : new Array(maxLength - val.length + 1).join(" ") + val;
}
return val;
});
};
{
if (module2.exports) {
exports2 = module2.exports = lib;
}
exports2.accounting = lib;
}
})();
})(accounting, accounting.exports);
var dist = {};
var abbreviateNumber$1 = {};
var _const = {};
Object.defineProperty(_const, "__esModule", { value: true });
_const.defaultSymbols = ["", "k", "M", "G", "T", "P", "E"];
Object.defineProperty(abbreviateNumber$1, "__esModule", { value: true });
var const_1$1 = _const;
var defaultOptions = {
padding: true,
symbols: const_1$1.defaultSymbols
};
function abbreviateNumber(num, digit, options) {
if (digit === void 0) {
digit = 1;
}
if (Array.isArray(options)) {
options = { symbols: options };
}
var _a = Object.assign({}, defaultOptions, options), symbols = _a.symbols, padding = _a.padding;
var sign = Math.sign(num) >= 0;
num = Math.abs(num);
var tier = Math.log10(num) / 3 | 0;
if (tier == 0)
return (!sign ? "-" : "") + num.toString();
var suffix = symbols[tier];
if (!suffix)
throw new RangeError();
var scale = Math.pow(10, tier * 3);
var scaled = num / scale;
var rounded = scaled.toFixed(digit);
if (!padding) {
rounded = String(Number(rounded));
}
return (!sign ? "-" : "") + rounded + suffix;
}
abbreviateNumber$1.abbreviateNumber = abbreviateNumber;
var unabbreviateNumber$1 = {};
var utils = {};
Object.defineProperty(utils, "__esModule", { value: true });
utils.symbolPow = function(index) {
if (index === void 0) {
index = 0;
}
return Math.pow(10, index * 3);
};
Object.defineProperty(unabbreviateNumber$1, "__esModule", { value: true });
var const_1 = _const;
var utils_1 = utils;
function unabbreviateNumber(num, symbols) {
if (symbols === void 0) {
symbols = const_1.defaultSymbols;
}
var numberPattern = "[+-]?([0-9]*[.])?[0-9]+";
var symbolPattern = "" + symbols.join("|");
var pattern = "^(" + numberPattern + ")(" + symbolPattern + ")$";
var regex = new RegExp(pattern);
var match = num.match(pattern) || [];
if (regex.test(num) && match.length > 3) {
var symbol = match[3];
var symbolValue = utils_1.symbolPow(symbols.indexOf(symbol));
var pureNum = Number(match[1]);
return pureNum * symbolValue;
} else {
throw Error("This is not a valid input");
}
}
unabbreviateNumber$1.unabbreviateNumber = unabbreviateNumber;
(function(exports2) {
function __export(m) {
for (var p in m)
if (!exports2.hasOwnProperty(p))
exports2[p] = m[p];
}
Object.defineProperty(exports2, "__esModule", { value: true });
__export(abbreviateNumber$1);
__export(unabbreviateNumber$1);
})(dist);
const camelToUnderscore = (data = "") => {
return data.replace(/([A-Z])/g, "_$1").toLowerCase();
};
const camelToDash = (data = "") => {
return data.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
};
const dashToCamel = (data = "") => {
return data.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
};
const dashToUnderscore = (data = "") => {
return data.replace(/-([a-z])/g, "_$1").toLowerCase();
};
exports.camelToDash = camelToDash;
exports.camelToUnderscore = camelToUnderscore;
exports.dashToCamel = dashToCamel;
exports.dashToUnderscore = dashToUnderscore;
exports.isArray = isArray;
exports.isEmpty = isEmpty;
exports.isObject = isObject;