UNPKG

dgz-ui-shared

Version:

Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library

305 lines (304 loc) 12.4 kB
import { g as X } from "./index-Br4MVOGV-CUrOsbmR.js"; function tt(Y, U) { for (var D = 0; D < U.length; D++) { const m = U[D]; if (typeof m != "string" && !Array.isArray(m)) { for (const M in m) if (M !== "default" && !(M in Y)) { const S = Object.getOwnPropertyDescriptor(m, M); S && Object.defineProperty(Y, M, S.get ? S : { enumerable: !0, get: () => m[M] }); } } } return Object.freeze(Object.defineProperty(Y, Symbol.toStringTag, { value: "Module" })); } var F = { exports: {} }, et = F.exports, V; function rt() { return V || (V = 1, function(Y, U) { (function(D, m) { Y.exports = m(); })(et, function() { var D = 1e3, m = 6e4, M = 36e5, S = "millisecond", b = "second", j = "minute", x = "hour", g = "day", L = "week", y = "month", P = "quarter", v = "year", k = "date", Z = "Invalid Date", Q = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, R = /\[([^\]]+)]|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, G = { 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(s) { var r = ["th", "st", "nd", "rd"], t = s % 100; return "[" + s + (r[(t - 20) % 10] || r[t] || r[0]) + "]"; } }, z = function(s, r, t) { var n = String(s); return !n || n.length >= r ? s : "" + Array(r + 1 - n.length).join(t) + s; }, K = { s: z, z: function(s) { var r = -s.utcOffset(), t = Math.abs(r), n = Math.floor(t / 60), e = t % 60; return (r <= 0 ? "+" : "-") + z(n, 2, "0") + ":" + z(e, 2, "0"); }, m: function s(r, t) { if (r.date() < t.date()) return -s(t, r); var n = 12 * (t.year() - r.year()) + (t.month() - r.month()), e = r.clone().add(n, y), i = t - e < 0, u = r.clone().add(n + (i ? -1 : 1), y); return +(-(n + (t - e) / (i ? e - u : u - e)) || 0); }, a: function(s) { return s < 0 ? Math.ceil(s) || 0 : Math.floor(s); }, p: function(s) { return { M: y, y: v, w: L, d: g, D: k, h: x, m: j, s: b, ms: S, Q: P }[s] || String(s || "").toLowerCase().replace(/s$/, ""); }, u: function(s) { return s === void 0; } }, H = "en", w = {}; w[H] = G; var q = "$isDayjsObject", J = function(s) { return s instanceof I || !(!s || !s[q]); }, W = function s(r, t, n) { var e; if (!r) return H; if (typeof r == "string") { var i = r.toLowerCase(); w[i] && (e = i), t && (w[i] = t, e = i); var u = r.split("-"); if (!e && u.length > 1) return s(u[0]); } else { var o = r.name; w[o] = r, e = o; } return !n && e && (H = e), e || !n && H; }, f = function(s, r) { if (J(s)) return s.clone(); var t = typeof r == "object" ? r : {}; return t.date = s, t.args = arguments, new I(t); }, a = K; a.l = W, a.i = J, a.w = function(s, r) { return f(s, { locale: r.$L, utc: r.$u, x: r.$x, $offset: r.$offset }); }; var I = function() { function s(t) { this.$L = W(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[q] = !0; } var r = s.prototype; return r.parse = function(t) { this.$d = function(n) { var e = n.date, i = n.utc; if (e === null) return /* @__PURE__ */ new Date(NaN); if (a.u(e)) return /* @__PURE__ */ new Date(); if (e instanceof Date) return new Date(e); if (typeof e == "string" && !/Z$/i.test(e)) { var u = e.match(Q); if (u) { var o = u[2] - 1 || 0, c = (u[7] || "0").substring(0, 3); return i ? new Date(Date.UTC(u[1], o, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, c)) : new Date(u[1], o, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, c); } } return new Date(e); }(t), this.init(); }, r.init = function() { var t = this.$d; this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds(); }, r.$utils = function() { return a; }, r.isValid = function() { return this.$d.toString() !== Z; }, r.isSame = function(t, n) { var e = f(t); return this.startOf(n) <= e && e <= this.endOf(n); }, r.isAfter = function(t, n) { return f(t) < this.startOf(n); }, r.isBefore = function(t, n) { return this.endOf(n) < f(t); }, r.$g = function(t, n, e) { return a.u(t) ? this[n] : this.set(e, t); }, r.unix = function() { return Math.floor(this.valueOf() / 1e3); }, r.valueOf = function() { return this.$d.getTime(); }, r.startOf = function(t, n) { var e = this, i = !!a.u(n) || n, u = a.p(t), o = function(O, l) { var p = a.w(e.$u ? Date.UTC(e.$y, l, O) : new Date(e.$y, l, O), e); return i ? p : p.endOf(g); }, c = function(O, l) { return a.w(e.toDate()[O].apply(e.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(l)), e); }, h = this.$W, d = this.$M, $ = this.$D, T = "set" + (this.$u ? "UTC" : ""); switch (u) { case v: return i ? o(1, 0) : o(31, 11); case y: return i ? o(1, d) : o(0, d + 1); case L: var _ = this.$locale().weekStart || 0, A = (h < _ ? h + 7 : h) - _; return o(i ? $ - A : $ + (6 - A), d); case g: case k: return c(T + "Hours", 0); case x: return c(T + "Minutes", 1); case j: return c(T + "Seconds", 2); case b: return c(T + "Milliseconds", 3); default: return this.clone(); } }, r.endOf = function(t) { return this.startOf(t, !1); }, r.$set = function(t, n) { var e, i = a.p(t), u = "set" + (this.$u ? "UTC" : ""), o = (e = {}, e[g] = u + "Date", e[k] = u + "Date", e[y] = u + "Month", e[v] = u + "FullYear", e[x] = u + "Hours", e[j] = u + "Minutes", e[b] = u + "Seconds", e[S] = u + "Milliseconds", e)[i], c = i === g ? this.$D + (n - this.$W) : n; if (i === y || i === v) { var h = this.clone().set(k, 1); h.$d[o](c), h.init(), this.$d = h.set(k, Math.min(this.$D, h.daysInMonth())).$d; } else o && this.$d[o](c); return this.init(), this; }, r.set = function(t, n) { return this.clone().$set(t, n); }, r.get = function(t) { return this[a.p(t)](); }, r.add = function(t, n) { var e, i = this; t = Number(t); var u = a.p(n), o = function(d) { var $ = f(i); return a.w($.date($.date() + Math.round(d * t)), i); }; if (u === y) return this.set(y, this.$M + t); if (u === v) return this.set(v, this.$y + t); if (u === g) return o(1); if (u === L) return o(7); var c = (e = {}, e[j] = m, e[x] = M, e[b] = D, e)[u] || 1, h = this.$d.getTime() + t * c; return a.w(h, this); }, r.subtract = function(t, n) { return this.add(-1 * t, n); }, r.format = function(t) { var n = this, e = this.$locale(); if (!this.isValid()) return e.invalidDate || Z; var i = t || "YYYY-MM-DDTHH:mm:ssZ", u = a.z(this), o = this.$H, c = this.$m, h = this.$M, d = e.weekdays, $ = e.months, T = e.meridiem, _ = function(l, p, C, N) { return l && (l[p] || l(n, i)) || C[p].slice(0, N); }, A = function(l) { return a.s(o % 12 || 12, l, "0"); }, O = T || function(l, p, C) { var N = l < 12 ? "AM" : "PM"; return C ? N.toLowerCase() : N; }; return i.replace(R, function(l, p) { return p || function(C) { switch (C) { case "YY": return String(n.$y).slice(-2); case "YYYY": return a.s(n.$y, 4, "0"); case "M": return h + 1; case "MM": return a.s(h + 1, 2, "0"); case "MMM": return _(e.monthsShort, h, $, 3); case "MMMM": return _($, h); case "D": return n.$D; case "DD": return a.s(n.$D, 2, "0"); case "d": return String(n.$W); case "dd": return _(e.weekdaysMin, n.$W, d, 2); case "ddd": return _(e.weekdaysShort, n.$W, d, 3); case "dddd": return d[n.$W]; case "H": return String(o); case "HH": return a.s(o, 2, "0"); case "h": return A(1); case "hh": return A(2); case "a": return O(o, c, !0); case "A": return O(o, c, !1); case "m": return String(c); case "mm": return a.s(c, 2, "0"); case "s": return String(n.$s); case "ss": return a.s(n.$s, 2, "0"); case "SSS": return a.s(n.$ms, 3, "0"); case "Z": return u; } return null; }(l) || u.replace(":", ""); }); }, r.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); }, r.diff = function(t, n, e) { var i, u = this, o = a.p(n), c = f(t), h = (c.utcOffset() - this.utcOffset()) * m, d = this - c, $ = function() { return a.m(u, c); }; switch (o) { case v: i = $() / 12; break; case y: i = $(); break; case P: i = $() / 3; break; case L: i = (d - h) / 6048e5; break; case g: i = (d - h) / 864e5; break; case x: i = d / M; break; case j: i = d / m; break; case b: i = d / D; break; default: i = d; } return e ? i : a.a(i); }, r.daysInMonth = function() { return this.endOf(y).$D; }, r.$locale = function() { return w[this.$L]; }, r.locale = function(t, n) { if (!t) return this.$L; var e = this.clone(), i = W(t, n, !0); return i && (e.$L = i), e; }, r.clone = function() { return a.w(this.$d, this); }, r.toDate = function() { return new Date(this.valueOf()); }, r.toJSON = function() { return this.isValid() ? this.toISOString() : null; }, r.toISOString = function() { return this.$d.toISOString(); }, r.toString = function() { return this.$d.toUTCString(); }, s; }(), E = I.prototype; return f.prototype = E, [["$ms", S], ["$s", b], ["$m", j], ["$H", x], ["$W", g], ["$M", y], ["$y", v], ["$D", k]].forEach(function(s) { E[s[1]] = function(r) { return this.$g(r, s[0], s[1]); }; }), f.extend = function(s, r) { return s.$i || (s(r, I, f), s.$i = !0), f; }, f.locale = W, f.isDayjs = J, f.unix = function(s) { return f(1e3 * s); }, f.en = w[H], f.Ls = w, f.p = {}, f; }); }(F)), F.exports; } var B = rt(); const nt = /* @__PURE__ */ X(B), it = /* @__PURE__ */ tt({ __proto__: null, default: nt }, [B]); export { it as a, nt as d };