UNPKG

maz-ui

Version:

A standalone components library for Vue.Js 3 & Nuxt.Js 3

1,374 lines 96.3 kB
import { computed as $, useId as lt, nextTick as ge, openBlock as k, createElementBlock as I, createElementVNode as K, defineComponent as ne, defineAsyncComponent as De, ref as X, onMounted as Xe, useSlots as it, normalizeClass as U, normalizeStyle as Me, unref as N, toDisplayString as re, createCommentVNode as R, renderSlot as ke, createBlock as F, resolveDynamicComponent as we, withDirectives as Ee, mergeProps as Ke, toHandlers as st, vModelDynamic as ut, withModifiers as ye, withCtx as G, createVNode as j, Fragment as le, renderList as ie, useAttrs as dt, useCssVars as ct, watch as pe, TransitionGroup as Be, createTextVNode as $e, Transition as Fe, onBeforeMount as mt, onUnmounted as ft, vShow as vt } from "vue"; import '../assets/MazPicker.DMFpwla9.css';function Pe(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } var Oe = { exports: {} }, ht = Oe.exports, Ze; function yt() { return Ze || (Ze = 1, function(t, a) { (function(e, u) { t.exports = u(); })(ht, function() { var e = 1e3, u = 6e4, s = 36e5, Y = "millisecond", v = "second", d = "minute", h = "hour", p = "day", f = "week", z = "month", x = "quarter", w = "year", b = "date", Q = "Invalid Date", V = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, T = /\[([^\]]+)]|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, A = { 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(M) { var n = ["th", "st", "nd", "rd"], o = M % 100; return "[" + M + (n[(o - 20) % 10] || n[o] || n[0]) + "]"; } }, H = function(M, n, o) { var m = String(M); return !m || m.length >= n ? M : "" + Array(n + 1 - m.length).join(o) + M; }, E = { s: H, z: function(M) { var n = -M.utcOffset(), o = Math.abs(n), m = Math.floor(o / 60), c = o % 60; return (n <= 0 ? "+" : "-") + H(m, 2, "0") + ":" + H(c, 2, "0"); }, m: function M(n, o) { if (n.date() < o.date()) return -M(o, n); var m = 12 * (o.year() - n.year()) + (o.month() - n.month()), c = n.clone().add(m, z), r = o - c < 0, l = n.clone().add(m + (r ? -1 : 1), z); return +(-(m + (o - c) / (r ? c - l : l - c)) || 0); }, a: function(M) { return M < 0 ? Math.ceil(M) || 0 : Math.floor(M); }, p: function(M) { return { M: z, y: w, w: f, d: p, D: b, h, m: d, s: v, ms: Y, Q: x }[M] || String(M || "").toLowerCase().replace(/s$/, ""); }, u: function(M) { return M === void 0; } }, g = "en", S = {}; S[g] = A; var B = "$isDayjsObject", C = function(M) { return M instanceof Z || !(!M || !M[B]); }, L = function M(n, o, m) { var c; if (!n) return g; if (typeof n == "string") { var r = n.toLowerCase(); S[r] && (c = r), o && (S[r] = o, c = r); var l = n.split("-"); if (!c && l.length > 1) return M(l[0]); } else { var y = n.name; S[y] = n, c = y; } return !m && c && (g = c), c || !m && g; }, P = function(M, n) { if (C(M)) return M.clone(); var o = typeof n == "object" ? n : {}; return o.date = M, o.args = arguments, new Z(o); }, q = E; q.l = L, q.i = C, q.w = function(M, n) { return P(M, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset }); }; var Z = function() { function M(o) { this.$L = L(o.locale, null, !0), this.parse(o), this.$x = this.$x || o.x || {}, this[B] = !0; } var n = M.prototype; return n.parse = function(o) { this.$d = function(m) { var c = m.date, r = m.utc; if (c === null) return /* @__PURE__ */ new Date(NaN); if (q.u(c)) return /* @__PURE__ */ new Date(); if (c instanceof Date) return new Date(c); if (typeof c == "string" && !/Z$/i.test(c)) { var l = c.match(V); if (l) { var y = l[2] - 1 || 0, O = (l[7] || "0").substring(0, 3); return r ? new Date(Date.UTC(l[1], y, l[3] || 1, l[4] || 0, l[5] || 0, l[6] || 0, O)) : new Date(l[1], y, l[3] || 1, l[4] || 0, l[5] || 0, l[6] || 0, O); } } return new Date(c); }(o), this.init(); }, n.init = function() { var o = this.$d; this.$y = o.getFullYear(), this.$M = o.getMonth(), this.$D = o.getDate(), this.$W = o.getDay(), this.$H = o.getHours(), this.$m = o.getMinutes(), this.$s = o.getSeconds(), this.$ms = o.getMilliseconds(); }, n.$utils = function() { return q; }, n.isValid = function() { return this.$d.toString() !== Q; }, n.isSame = function(o, m) { var c = P(o); return this.startOf(m) <= c && c <= this.endOf(m); }, n.isAfter = function(o, m) { return P(o) < this.startOf(m); }, n.isBefore = function(o, m) { return this.endOf(m) < P(o); }, n.$g = function(o, m, c) { return q.u(o) ? this[m] : this.set(c, o); }, n.unix = function() { return Math.floor(this.valueOf() / 1e3); }, n.valueOf = function() { return this.$d.getTime(); }, n.startOf = function(o, m) { var c = this, r = !!q.u(m) || m, l = q.p(o), y = function(me, te) { var ue = q.w(c.$u ? Date.UTC(c.$y, te, me) : new Date(c.$y, te, me), c); return r ? ue : ue.endOf(p); }, O = function(me, te) { return q.w(c.toDate()[me].apply(c.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(te)), c); }, W = this.$W, J = this.$M, _ = this.$D, se = "set" + (this.$u ? "UTC" : ""); switch (l) { case w: return r ? y(1, 0) : y(31, 11); case z: return r ? y(1, J) : y(0, J + 1); case f: var ce = this.$locale().weekStart || 0, ve = (W < ce ? W + 7 : W) - ce; return y(r ? _ - ve : _ + (6 - ve), J); case p: case b: return O(se + "Hours", 0); case h: return O(se + "Minutes", 1); case d: return O(se + "Seconds", 2); case v: return O(se + "Milliseconds", 3); default: return this.clone(); } }, n.endOf = function(o) { return this.startOf(o, !1); }, n.$set = function(o, m) { var c, r = q.p(o), l = "set" + (this.$u ? "UTC" : ""), y = (c = {}, c[p] = l + "Date", c[b] = l + "Date", c[z] = l + "Month", c[w] = l + "FullYear", c[h] = l + "Hours", c[d] = l + "Minutes", c[v] = l + "Seconds", c[Y] = l + "Milliseconds", c)[r], O = r === p ? this.$D + (m - this.$W) : m; if (r === z || r === w) { var W = this.clone().set(b, 1); W.$d[y](O), W.init(), this.$d = W.set(b, Math.min(this.$D, W.daysInMonth())).$d; } else y && this.$d[y](O); return this.init(), this; }, n.set = function(o, m) { return this.clone().$set(o, m); }, n.get = function(o) { return this[q.p(o)](); }, n.add = function(o, m) { var c, r = this; o = Number(o); var l = q.p(m), y = function(J) { var _ = P(r); return q.w(_.date(_.date() + Math.round(J * o)), r); }; if (l === z) return this.set(z, this.$M + o); if (l === w) return this.set(w, this.$y + o); if (l === p) return y(1); if (l === f) return y(7); var O = (c = {}, c[d] = u, c[h] = s, c[v] = e, c)[l] || 1, W = this.$d.getTime() + o * O; return q.w(W, this); }, n.subtract = function(o, m) { return this.add(-1 * o, m); }, n.format = function(o) { var m = this, c = this.$locale(); if (!this.isValid()) return c.invalidDate || Q; var r = o || "YYYY-MM-DDTHH:mm:ssZ", l = q.z(this), y = this.$H, O = this.$m, W = this.$M, J = c.weekdays, _ = c.months, se = c.meridiem, ce = function(te, ue, he, be) { return te && (te[ue] || te(m, r)) || he[ue].slice(0, be); }, ve = function(te) { return q.s(y % 12 || 12, te, "0"); }, me = se || function(te, ue, he) { var be = te < 12 ? "AM" : "PM"; return he ? be.toLowerCase() : be; }; return r.replace(T, function(te, ue) { return ue || function(he) { switch (he) { case "YY": return String(m.$y).slice(-2); case "YYYY": return q.s(m.$y, 4, "0"); case "M": return W + 1; case "MM": return q.s(W + 1, 2, "0"); case "MMM": return ce(c.monthsShort, W, _, 3); case "MMMM": return ce(_, W); case "D": return m.$D; case "DD": return q.s(m.$D, 2, "0"); case "d": return String(m.$W); case "dd": return ce(c.weekdaysMin, m.$W, J, 2); case "ddd": return ce(c.weekdaysShort, m.$W, J, 3); case "dddd": return J[m.$W]; case "H": return String(y); case "HH": return q.s(y, 2, "0"); case "h": return ve(1); case "hh": return ve(2); case "a": return me(y, O, !0); case "A": return me(y, O, !1); case "m": return String(O); case "mm": return q.s(O, 2, "0"); case "s": return String(m.$s); case "ss": return q.s(m.$s, 2, "0"); case "SSS": return q.s(m.$ms, 3, "0"); case "Z": return l; } return null; }(te) || l.replace(":", ""); }); }, n.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); }, n.diff = function(o, m, c) { var r, l = this, y = q.p(m), O = P(o), W = (O.utcOffset() - this.utcOffset()) * u, J = this - O, _ = function() { return q.m(l, O); }; switch (y) { case w: r = _() / 12; break; case z: r = _(); break; case x: r = _() / 3; break; case f: r = (J - W) / 6048e5; break; case p: r = (J - W) / 864e5; break; case h: r = J / s; break; case d: r = J / u; break; case v: r = J / e; break; default: r = J; } return c ? r : q.a(r); }, n.daysInMonth = function() { return this.endOf(z).$D; }, n.$locale = function() { return S[this.$L]; }, n.locale = function(o, m) { if (!o) return this.$L; var c = this.clone(), r = L(o, m, !0); return r && (c.$L = r), c; }, n.clone = function() { return q.w(this.$d, this); }, n.toDate = function() { return new Date(this.valueOf()); }, n.toJSON = function() { return this.isValid() ? this.toISOString() : null; }, n.toISOString = function() { return this.$d.toISOString(); }, n.toString = function() { return this.$d.toUTCString(); }, M; }(), i = Z.prototype; return P.prototype = i, [["$ms", Y], ["$s", v], ["$m", d], ["$H", h], ["$W", p], ["$M", z], ["$y", w], ["$D", b]].forEach(function(M) { i[M[1]] = function(n) { return this.$g(n, M[0], M[1]); }; }), P.extend = function(M, n) { return M.$i || (M(n, Z, P), M.$i = !0), P; }, P.locale = L, P.isDayjs = C, P.unix = function(M) { return P(1e3 * M); }, P.en = S[g], P.Ls = S, P.p = {}, P; }); }(Oe)), Oe.exports; } var pt = yt(); const D = /* @__PURE__ */ Pe(pt); var Ce = { exports: {} }, bt = Ce.exports, Re; function Dt() { return Re || (Re = 1, function(t, a) { (function(e, u) { t.exports = u(); })(bt, function() { 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" }, u = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, s = /\d/, Y = /\d\d/, v = /\d\d?/, d = /\d*[^-_:/,()\s\d]+/, h = {}, p = function(V) { return (V = +V) + (V > 68 ? 1900 : 2e3); }, f = function(V) { return function(T) { this[V] = +T; }; }, z = [/[+-]\d\d:?(\d\d)?|Z/, function(V) { (this.zone || (this.zone = {})).offset = function(T) { if (!T || T === "Z") return 0; var A = T.match(/([+-]|\d\d)/g), H = 60 * A[1] + (+A[2] || 0); return H === 0 ? 0 : A[0] === "+" ? -H : H; }(V); }], x = function(V) { var T = h[V]; return T && (T.indexOf ? T : T.s.concat(T.f)); }, w = function(V, T) { var A, H = h.meridiem; if (H) { for (var E = 1; E <= 24; E += 1) if (V.indexOf(H(E, 0, T)) > -1) { A = E > 12; break; } } else A = V === (T ? "pm" : "PM"); return A; }, b = { A: [d, function(V) { this.afternoon = w(V, !1); }], a: [d, function(V) { this.afternoon = w(V, !0); }], Q: [s, function(V) { this.month = 3 * (V - 1) + 1; }], S: [s, function(V) { this.milliseconds = 100 * +V; }], SS: [Y, function(V) { this.milliseconds = 10 * +V; }], SSS: [/\d{3}/, function(V) { this.milliseconds = +V; }], s: [v, f("seconds")], ss: [v, f("seconds")], m: [v, f("minutes")], mm: [v, f("minutes")], H: [v, f("hours")], h: [v, f("hours")], HH: [v, f("hours")], hh: [v, f("hours")], D: [v, f("day")], DD: [Y, f("day")], Do: [d, function(V) { var T = h.ordinal, A = V.match(/\d+/); if (this.day = A[0], T) for (var H = 1; H <= 31; H += 1) T(H).replace(/\[|\]/g, "") === V && (this.day = H); }], w: [v, f("week")], ww: [Y, f("week")], M: [v, f("month")], MM: [Y, f("month")], MMM: [d, function(V) { var T = x("months"), A = (x("monthsShort") || T.map(function(H) { return H.slice(0, 3); })).indexOf(V) + 1; if (A < 1) throw new Error(); this.month = A % 12 || A; }], MMMM: [d, function(V) { var T = x("months").indexOf(V) + 1; if (T < 1) throw new Error(); this.month = T % 12 || T; }], Y: [/[+-]?\d+/, f("year")], YY: [Y, function(V) { this.year = p(V); }], YYYY: [/\d{4}/, f("year")], Z: z, ZZ: z }; function Q(V) { var T, A; T = V, A = h && h.formats; for (var H = (V = T.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(P, q, Z) { var i = Z && Z.toUpperCase(); return q || A[Z] || e[Z] || A[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(M, n, o) { return n || o.slice(1); }); })).match(u), E = H.length, g = 0; g < E; g += 1) { var S = H[g], B = b[S], C = B && B[0], L = B && B[1]; H[g] = L ? { regex: C, parser: L } : S.replace(/^\[|\]$/g, ""); } return function(P) { for (var q = {}, Z = 0, i = 0; Z < E; Z += 1) { var M = H[Z]; if (typeof M == "string") i += M.length; else { var n = M.regex, o = M.parser, m = P.slice(i), c = n.exec(m)[0]; o.call(q, c), P = P.replace(c, ""); } } return function(r) { var l = r.afternoon; if (l !== void 0) { var y = r.hours; l ? y < 12 && (r.hours += 12) : y === 12 && (r.hours = 0), delete r.afternoon; } }(q), q; }; } return function(V, T, A) { A.p.customParseFormat = !0, V && V.parseTwoDigitYear && (p = V.parseTwoDigitYear); var H = T.prototype, E = H.parse; H.parse = function(g) { var S = g.date, B = g.utc, C = g.args; this.$u = B; var L = C[1]; if (typeof L == "string") { var P = C[2] === !0, q = C[3] === !0, Z = P || q, i = C[2]; q && (i = C[2]), h = this.$locale(), !P && i && (h = A.Ls[i]), this.$d = function(m, c, r, l) { try { if (["x", "X"].indexOf(c) > -1) return new Date((c === "X" ? 1e3 : 1) * m); var y = Q(c)(m), O = y.year, W = y.month, J = y.day, _ = y.hours, se = y.minutes, ce = y.seconds, ve = y.milliseconds, me = y.zone, te = y.week, ue = /* @__PURE__ */ new Date(), he = J || (O || W ? 1 : ue.getDate()), be = O || ue.getFullYear(), ze = 0; O && !W || (ze = W > 0 ? W - 1 : ue.getMonth()); var Se, xe = _ || 0, Ae = se || 0, Le = ce || 0, je = ve || 0; return me ? new Date(Date.UTC(be, ze, he, xe, Ae, Le, je + 60 * me.offset * 1e3)) : r ? new Date(Date.UTC(be, ze, he, xe, Ae, Le, je)) : (Se = new Date(be, ze, he, xe, Ae, Le, je), te && (Se = l(Se).week(te).toDate()), Se); } catch { return /* @__PURE__ */ new Date(""); } }(S, L, B, A), this.init(), i && i !== !0 && (this.$L = this.locale(i).$L), Z && S != this.format(L) && (this.$d = /* @__PURE__ */ new Date("")), h = {}; } else if (L instanceof Array) for (var M = L.length, n = 1; n <= M; n += 1) { C[1] = L[n - 1]; var o = A.apply(this, C); if (o.isValid()) { this.$d = o.$d, this.$L = o.$L, this.init(); break; } n === M && (this.$d = /* @__PURE__ */ new Date("")); } else E.call(this, g); }; }; }); }(Ce)), Ce.exports; } var kt = Dt(); const gt = /* @__PURE__ */ Pe(kt); var qe = { exports: {} }, wt = qe.exports, Ge; function $t() { return Ge || (Ge = 1, function(t, a) { (function(e, u) { t.exports = u(); })(wt, function() { return function(e, u, s) { u.prototype.isBetween = function(Y, v, d, h) { var p = s(Y), f = s(v), z = (h = h || "()")[0] === "(", x = h[1] === ")"; return (z ? this.isAfter(p, d) : !this.isBefore(p, d)) && (x ? this.isBefore(f, d) : !this.isAfter(f, d)) || (z ? this.isBefore(p, d) : !this.isAfter(p, d)) && (x ? this.isAfter(f, d) : !this.isBefore(f, d)); }; }; }); }(qe)), qe.exports; } var Mt = $t(); const zt = /* @__PURE__ */ Pe(Mt); function _e({ componentName: t, providedId: a }) { return $(() => a ?? `${t}-${lt().replace(/:/g, "")}`); } const Te = "__maz-click-outside__"; function et() { return document.ontouchstart === null ? "touchstart" : "click"; } async function tt(t, a) { try { at(t); const e = a.instance, u = a.value, s = typeof u == "function"; if (!s) throw new Error("[maz-ui](vClickOutside) the callback should be a function"); await ge(), t[Te] = (v) => { if ((!t || v.target && !t.contains(v.target)) && u && s) return u.call(e, v); }; const Y = et(); document.addEventListener(Y, t[Te], { passive: !0 }); } catch (e) { console.error("[maz-ui](vClickOutside)", e); } } function at(t) { try { const a = et(); document.removeEventListener(a, t[Te], !1), delete t[Te]; } catch (a) { console.error("[maz-ui](vClickOutside)", a); } } function St(t, a) { try { if (a.value === a.oldValue) return; tt(t, a); } catch (e) { console.error("[maz-ui](vClickOutside)", e); } } const Yt = { mounted: tt, updated: St, unmounted: at }, Vt = { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24" }; function Bt(t, a) { return k(), I("svg", Vt, a[0] || (a[0] = [ K( "path", { stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "1.5", d: "m19.5 8.25-7.5 7.5-7.5-7.5" }, null, -1 /* HOISTED */ ) ])); } const Ot = { render: Bt }, Ct = { month: "short", day: "numeric", year: "numeric" }; function ee(t, a, e) { if (a === void 0) throw new TypeError("[maz-ui](FilterDate) The `locale` attribute is required."); if (typeof a != "string") throw new TypeError("[maz-ui](FilterDate) The `locale` attribute must be a string."); const u = e ?? Ct; try { const s = t instanceof Date ? t : new Date(t); return new Intl.DateTimeFormat(a, u).format(s); } catch (s) { throw new Error(`[maz-ui](FilterDate) ${s}`); } } function rt(t, a) { let e; return function(...u) { clearTimeout(e), e = setTimeout(() => { t.apply(this, u); }, a); }; } const qt = ["for"], It = { key: 0, class: "m-input-wrapper-left" }, Tt = ["id", "name", "placeholder", "aria-label", "type", "inputmode", "disabled", "readonly", "autocomplete", "required"], Ht = { key: 1, class: "m-input-wrapper-right" }, Pt = /* @__PURE__ */ ne({ inheritAttrs: !1, __name: "MazInput", props: { style: { default: void 0 }, class: { default: void 0 }, modelValue: { default: void 0 }, placeholder: { default: void 0 }, label: { default: void 0 }, topLabel: {}, assistiveText: {}, name: { default: void 0 }, color: { default: "primary" }, type: { default: "text" }, required: { type: Boolean, default: !1 }, disabled: { type: Boolean, default: !1 }, readonly: { type: Boolean, default: !1 }, id: { default: void 0 }, error: { type: Boolean, default: !1 }, success: { type: Boolean, default: !1 }, warning: { type: Boolean, default: !1 }, hint: { default: void 0 }, inputClasses: { default: void 0 }, noBorder: { type: Boolean, default: !1 }, noRadius: { type: Boolean, default: !1 }, inputmode: { default: "text" }, size: { default: "md" }, debounce: { type: [Boolean, Number], default: !1 }, debounceDelay: { default: 500 }, validButton: { type: Boolean, default: !1 }, validButtonLoading: { type: Boolean, default: !1 }, autoFocus: { type: Boolean, default: !1 }, borderActive: { type: Boolean, default: !1 }, leftIcon: { type: [String, Function, Object], default: void 0 }, rightIcon: { type: [String, Function, Object], default: void 0 }, roundedSize: { default: void 0 }, block: { type: Boolean }, autocomplete: {} }, emits: ["update:model-value", "focus", "blur", "click", "change", "input"], setup(t, { emit: a }) { const e = t, u = a, s = De(() => Promise.resolve().then(() => aa)), Y = De(() => import("./MazIcon.Cq1v4J3r.mjs")), v = De(() => import("./eye-slash.BoO00xzs.mjs")), d = De(() => import("./eye.f8zAUc30.mjs")), h = De(() => import("./check.BmubdHc_.mjs")), p = X(!1), f = X(!1), z = X(), x = _e({ componentName: "MazInput", providedId: e.id }); Xe(() => { var i; e.autoFocus && ((i = z.value) == null || i.focus()); }); const w = $(() => e.type === "password"), b = $(() => p.value ? "text" : e.type), Q = $(() => { if (!e.noBorder) { if (e.error) return "maz-border-danger"; if (e.success) return "maz-border-success"; if (e.warning) return "maz-border-warning"; if (f.value || e.borderActive) { if (e.color === "black") return "maz-border-black"; if (e.color === "danger") return "maz-border-danger"; if (e.color === "info") return "maz-border-info"; if (e.color === "primary") return "maz-border-primary"; if (e.color === "secondary") return "maz-border-secondary"; if (e.color === "success") return "maz-border-success"; if (e.color === "warning") return "maz-border-warning"; if (e.color === "white") return "maz-border-white"; } return "--default-border"; } }), V = it(), T = $(() => E.value !== void 0 && E.value !== ""), A = rt( (i) => { u("update:model-value", i); }, typeof e.debounce == "number" ? e.debounce : e.debounceDelay ?? 500 ); function H(i) { if (e.debounce) return A(i); u("update:model-value", i); } const E = $({ get: () => e.modelValue, set: (i) => H(i) }), g = $(() => (!!e.label || !!e.hint) && (f.value || !!T.value || !!e.placeholder || ["date", "month", "week"].includes(e.type))), S = $(() => !!e.label || !!e.hint); function B() { return !!V["right-icon"] || w.value || !!V["valid-button"] || e.validButton || !!e.rightIcon; } function C() { return !!V["left-icon"] || !!e.leftIcon; } function L(i) { u("focus", i), f.value = !0; } function P(i) { u("blur", i), f.value = !1; } function q(i) { return u("change", i); } function Z(i) { return u("input", i); } return (i, M) => (k(), I( "div", { class: U(["m-input", [ { "--is-focused": f.value || i.borderActive, "--should-up": g.value, "--has-label": S.value, "--is-disabled": i.disabled, "--is-readonly": i.readonly, "--has-z-2": i.error || i.warning || i.success, "--has-state": i.error || i.warning || i.success, "--block": i.block }, e.class, `--${i.color}` ]]), style: Me(i.style) }, [ i.topLabel ? (k(), I("label", { key: 0, for: N(x), class: "m-input-top-label" }, re(i.topLabel), 9, qt)) : R("v-if", !0), K( "div", { class: U(["m-input-wrapper m-reset-css", [ i.inputClasses, Q.value, i.roundedSize ? `--rounded-${i.roundedSize}` : { "maz-rounded": !i.noRadius }, { "--block": i.block } ]]) }, [ C() ? (k(), I("div", It, [ i.$slots["left-icon"] || i.leftIcon ? ke(i.$slots, "left-icon", { key: 0 }, () => [ typeof i.leftIcon == "string" ? (k(), F(N(Y), { key: 0, name: i.leftIcon, class: "maz-text-xl maz-text-muted" }, null, 8, ["name"])) : i.leftIcon ? (k(), F(we(i.leftIcon), { key: 1, class: "maz-text-xl maz-text-muted" })) : R("v-if", !0) ], !0) : R("v-if", !0) ])) : R("v-if", !0), K( "div", { class: U(["m-input-wrapper-input", [`--${i.size}`, { "--top-label": !!i.topLabel }]]) }, [ Ee(K("input", Ke({ id: N(x) }, i.$attrs, { ref_key: "input", ref: z, "onUpdate:modelValue": M[0] || (M[0] = (n) => E.value = n), name: i.name, placeholder: i.placeholder, "aria-label": i.label || i.placeholder, type: b.value, inputmode: i.inputmode, disabled: i.disabled, readonly: i.readonly, autocomplete: i.autocomplete, required: i.required, class: "m-input-input" }, st({ blur: P, focus: L, change: q, input: Z }, !0), { onClick: M[1] || (M[1] = (n) => i.$emit("click", n)) }), null, 16, Tt), [ [ut, E.value] ]), i.label || i.hint ? (k(), I( "span", { key: 0, class: U(["m-input-label", [ { "maz-text-danger-600": i.error, "maz-text-success-600": i.success, "maz-text-warning-600": i.warning } ]]) }, re(i.hint || i.label), 3 /* TEXT, CLASS */ )) : R("v-if", !0) ], 2 /* CLASS */ ), B() ? (k(), I("div", Ht, [ i.$slots["right-icon"] || i.rightIcon ? ke(i.$slots, "right-icon", { key: 0 }, () => [ typeof i.rightIcon == "string" ? (k(), F(N(Y), { key: 0, name: i.rightIcon, class: "maz-text-xl maz-text-muted" }, null, 8, ["name"])) : i.rightIcon ? (k(), F(we(i.rightIcon), { key: 1, class: "maz-text-xl maz-text-muted" })) : R("v-if", !0) ], !0) : R("v-if", !0), w.value ? (k(), F(N(s), { key: 1, color: "transparent", tabindex: "-1", size: "mini", onClick: M[2] || (M[2] = ye((n) => p.value = !p.value, ["stop"])) }, { default: G(() => [ p.value ? (k(), F(N(v), { key: 0, class: "maz-text-xl maz-text-muted" })) : (k(), F(N(d), { key: 1, class: "maz-text-xl maz-text-muted" })) ]), _: 1 /* STABLE */ })) : R("v-if", !0), i.$slots["valid-button"] || i.validButton ? ke(i.$slots, "valid-button", { key: 2 }, () => [ j(N(s), { color: "transparent", disabled: i.disabled, tabindex: "-1", loading: i.validButtonLoading, class: "m-input-valid-button", size: "mini", type: "submit" }, { default: G(() => [ j(N(h), { class: "maz-text-2xl maz-text-normal" }) ]), _: 1 /* STABLE */ }, 8, ["disabled", "loading"]) ], !0) : R("v-if", !0) ])) : R("v-if", !0) ], 2 /* CLASS */ ), i.assistiveText ? (k(), I( "div", { key: 1, class: U(["m-input-bottom-text", [ { "maz-text-danger-600": i.error, "maz-text-success-600": i.success, "maz-text-warning-600": i.warning, "maz-text-muted": !i.error && !i.success && !i.warning } ]]) }, re(i.assistiveText), 3 /* TEXT, CLASS */ )) : R("v-if", !0) ], 6 /* CLASS, STYLE */ )); } }), oe = (t, a) => { const e = t.__vccOpts || t; for (const [u, s] of a) e[u] = s; return e; }, xt = /* @__PURE__ */ oe(Pt, [["__scopeId", "data-v-8def99c5"]]); var Ie = { exports: {} }, At = Ie.exports, Je; function Lt() { return Je || (Je = 1, function(t, a) { (function(e, u) { t.exports = u(); })(At, function() { return function(e, u) { u.prototype.weekday = function(s) { var Y = this.$locale().weekStart || 0, v = this.$W, d = (v < Y ? v + 7 : v) - Y; return this.$utils().u(s) ? d : this.subtract(d, "day").add(s, "day"); }; }; }); }(Ie)), Ie.exports; } var jt = Lt(); const Wt = /* @__PURE__ */ Pe(jt); function fe(t) { return t ? (t = t.toString(), t.charAt(0).toUpperCase() + t.slice(1)) : ""; } D.extend(Wt); function Ue({ value: t, locale: a, options: e }) { return t ? fe(ee(t, a, e)) : void 0; } function Et({ value: t, locale: a, options: e }) { const u = Ue({ value: t.start, locale: a, options: e }), s = Ue({ value: t.end, locale: a, options: e }); return u || s ? `${u || "..."} - ${s || "..."}` : void 0; } function Ft(t) { return D(t).startOf("month").day(); } function Ut(t, a) { const e = D().locale(t), u = []; for (let s = 0; s < 7; s++) { const Y = e.day(s + a).toDate(), v = ee(Y, t, { weekday: "short" }); u.push(v); } return u; } function Nt(t) { return D(t).daysInMonth(); } function Zt(t) { return D().isSame(t, "date"); } function de(t, a, e) { return D(t).isSame(a, e); } function nt(t, a) { return D(t).day() === a; } function Ne(t, a = "YYYY-MM-DD") { if (t) return D(t).format(a); } function Rt(t, a = "YYYY-MM-DD") { return { start: Ne(t.start, a), end: Ne(t.end, a) }; } function We({ value: t, minDate: a, maxDate: e, format: u }) { return a && D(t).isBefore(a) ? { newValue: a, newCurrentDate: D(a, u).format() } : e && D(t).isAfter(e) ? { newValue: e, newCurrentDate: D(e, u).format() } : { newValue: void 0, newCurrentDate: void 0 }; } function Ye({ value: t, disabledWeekly: a }) { return a.some((e) => nt(t, e)); } function Ve({ value: t, disabledDates: a }) { return a.some((e) => D(t).isSame(D(e), "date")); } const Gt = function(t, a, e = 0, u = !0) { t.scrollTo({ top: a.offsetTop - e, behavior: u ? "smooth" : "auto" }); }; function Qe(t, a) { return t.reduce((e, u) => Math.abs(u - a) < Math.abs(e - a) ? u : e); } function Jt() { try { return typeof window > "u" ? void 0 : window.navigator.language; } catch (t) { throw new Error(`[MazPhoneNumberInput] (browserLocale) ${t}`); } } async function Qt() { try { const t = await fetch("https://ipwho.is"), { country_code: a } = await t.json(); return a; } catch (t) { console.error(`[maz-ui](MazPicker)(fetchCountryCode) ${t}`); } } const Xt = { class: "maz-picker-calendar-days" }, Kt = /* @__PURE__ */ ne({ __name: "MazPickerCalendarDays", props: { locale: { type: String, required: !0 }, firstDayOfWeek: { type: Number, required: !0 } }, setup(t) { const a = t, e = $(() => Ut(a.locale, a.firstDayOfWeek)); return (u, s) => (k(), I("div", Xt, [ (k(!0), I( le, null, ie(e.value, (Y) => (k(), I( "span", { key: Y }, re(Y), 1 /* TEXT */ ))), 128 /* KEYED_FRAGMENT */ )) ])); } }), _t = /* @__PURE__ */ oe(Kt, [["__scopeId", "data-v-4315c0cd"]]), ea = { key: 0, class: "m-btn-loader-container" }, ta = /* @__PURE__ */ ne({ __name: "MazBtn", props: { variant: { default: "button" }, size: { default: "md" }, color: { default: "primary" }, type: { default: "button" }, rounded: { type: Boolean }, roundedSize: { default: "lg" }, noRounded: { type: Boolean }, outline: { type: Boolean }, pastel: { type: Boolean }, block: { type: Boolean }, noUnderline: { type: Boolean }, loading: { type: Boolean }, disabled: { type: Boolean }, fab: { type: Boolean }, icon: { type: [String, Function, Object], default: void 0 }, leftIcon: { type: [String, Function, Object], default: void 0 }, rightIcon: { type: [String, Function, Object], default: void 0 }, noPadding: { type: Boolean }, noElevation: { type: Boolean }, justify: { default: "center" } }, setup(t) { const a = t, e = De(() => import("./MazSpinner.BabK9PkN.mjs")), u = De(() => import("./MazIcon.Cq1v4J3r.mjs")), { href: s, to: Y } = dt(), v = $(() => s ? "a" : Y ? "router-link" : "button"), d = $(() => a.pastel ? `--${a.color}-pastel` : a.outline ? `--${a.color}-outline` : `--${a.color}`), h = $( () => (a.loading || a.disabled) && v.value === "button" ), p = $(() => h.value ? "--cursor-default" : "--cursor-pointer"), f = $(() => `--is-${a.variant}`), z = $(() => a.loading && a.variant === "button"), x = $(() => v.value === "button" ? a.type : void 0), w = $(() => a.size === "xl" ? "maz-text-3xl" : a.size === "lg" ? "maz-text-2xl" : a.size === "md" ? "maz-text-xl" : a.size === "sm" ? "maz-text-lg" : a.size === "xs" ? "maz-text-base" : a.size === "mini" ? "maz-text-sm" : "maz-text-xl"); return (b, Q) => (k(), F(we(v.value), { disabled: h.value || void 0, class: U(["m-btn m-reset-css", [ `--${b.size}`, !b.fab && !b.rounded && b.roundedSize && `--rounded-${b.roundedSize}`, d.value, p.value, f.value, { "--block": b.block, "--no-underline": b.noUnderline, "--fab": b.fab, "--loading": b.loading, "--disabled": h.value, "--rounded": b.rounded, "--no-rounded": b.noRounded, "--no-padding": b.noPadding, "--no-elevation": b.noElevation } ]]), style: Me([`--justify: ${b.justify}`]), type: x.value }, { default: G(() => [ ke(b.$slots, "left-icon", {}, () => [ typeof b.leftIcon == "string" ? (k(), F(N(u), { key: 0, name: b.leftIcon, class: U([w.value]) }, null, 8, ["name", "class"])) : b.leftIcon ? (k(), F(we(b.leftIcon), { key: 1, class: U([w.value]) }, null, 8, ["class"])) : R("v-if", !0) ], !0), ke(b.$slots, "icon", {}, () => [ typeof b.icon == "string" ? (k(), F(N(u), { key: 0, name: b.icon, class: U([w.value]) }, null, 8, ["name", "class"])) : b.icon ? (k(), F(we(b.icon), { key: 1, class: U([w.value]) }, null, 8, ["class"])) : R("v-if", !0) ], !0), ke(b.$slots, "default", {}, void 0, !0), ke(b.$slots, "right-icon", {}, () => [ typeof b.rightIcon == "string" ? (k(), F(N(u), { key: 0, name: b.rightIcon, class: U([w.value]) }, null, 8, ["name", "class"])) : b.rightIcon ? (k(), F(we(b.rightIcon), { key: 1, class: U([w.value]) }, null, 8, ["class"])) : R("v-if", !0) ], !0), z.value ? (k(), I("div", ea, [ j(N(e), { size: "2em", color: b.color }, null, 8, ["color"]) ])) : R("v-if", !0) ]), _: 3 /* FORWARDED */ }, 8, ["disabled", "class", "style", "type"])); } }), ae = /* @__PURE__ */ oe(ta, [["__scopeId", "data-v-6b881156"]]), aa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: ae }, Symbol.toStringTag, { value: "Module" })), ra = /* @__PURE__ */ ne({ __name: "MazPickerCalendarGrid", props: { modelValue: { type: [String, Object], default: void 0 }, calendarDate: { type: String, required: !0 }, hasTime: { type: Boolean, required: !0 }, locale: { type: String, required: !0 }, firstDayOfWeek: { type: Number, required: !0 }, color: { type: String, required: !0 }, minDate: { type: String, default: void 0 }, maxDate: { type: String, default: void 0 }, disabledWeekly: { type: Array, required: !0 }, disabledDates: { type: Array, required: !0 }, hoverredDay: { type: Object, default: void 0 }, disabled: { type: Boolean, required: !0 } }, emits: ["update:model-value", "update:hoverred-day"], setup(t, { emit: a }) { ct((n) => ({ "7c5235de": h.value, "2c4cc5ce": f.value, "2df83176": p.value })); const e = t, u = a, s = X(), Y = X("maz-slidenext"), v = $(() => [e.calendarDate]), d = $(() => e.modelValue && typeof e.modelValue == "object"), h = $(() => `var(--maz-color-${e.color}-alpha-20)`), p = $(() => `var(--maz-color-${e.color}-alpha)`), f = $(() => `var(--maz-color-${e.color}-alpha-20)`), z = $({ get: () => e.modelValue, set: (n) => u("update:model-value", n) }), x = $( () => Array.from({ length: Nt(e.calendarDate) }, (n, o) => o + 1).map((n) => ({ label: n, date: D(e.calendarDate).set("date", n) })) ), w = $(() => (Ft(e.calendarDate) - e.firstDayOfWeek + 7) % 7); function b(n) { const o = e.modelValue; o.start && !o.end && n && n.isAfter(o.start) ? u("update:hoverred-day", n) : u("update:hoverred-day"); } function Q(n) { const o = e.modelValue; return !o.start || !e.hoverredDay ? void 0 : D(n).isBetween(o.start, e.hoverredDay, "date", "(]") ? 3 : void 0; } function V(n) { if (e.hoverredDay) return D(n).isSame(e.hoverredDay); } function T(n) { var o; return e.modelValue && e.modelValue && typeof e.modelValue == "object" && (o = e.modelValue) != null && o.start ? de(n, e.modelValue.start, "date") : !1; } function A(n) { var o; return e.modelValue && e.modelValue && typeof e.modelValue == "object" && (o = e.modelValue) != null && o.end ? de(n, e.modelValue.end, "date") : !1; } function H(n) { const o = e.modelValue; return typeof o == "object" ? o.start && de(n, o.start, "date") || o.end && de(n, o.end, "date") || C(n) ? e.color : "transparent" : B(n) ? e.color : "transparent"; } function E(n) { if (e.modelValue && typeof e.modelValue == "object") { if (e.modelValue.start && de(n, e.modelValue.start, "date")) return 1; if (e.modelValue.end) { if (de(n, e.modelValue.end, "date")) return 1; if (C(n)) return 2; } } else if (B(n)) return 1; return 0; } function g(n) { d.value && b(); const o = n.format(); if (typeof z.value == "object") { let m = z.value; m.start && m.end && (m = { start: void 0, end: void 0 }); const c = D(o).isBefore(m.start, "date"); z.value = !m.start || c ? { start: o, end: void 0 } : { start: m.start, end: o }; } else z.value = o; } function S(n) { return Zt(n); } function B(n) { if (!e.modelValue) return !1; const o = e.modelValue; return de(n, o, "date"); } function C(n) { const o = e.modelValue; return !o.start || !o.end ? !1 : D(n).isBetween(o.start, o.end, "date", "()"); } function L(n) { return e.minDate ? D(n).isBefore(e.minDate, "date") : !1; } function P(n) { var o; return (o = e.disabledWeekly) != null && o.length ? e.disabledWeekly.some((m) => nt(n, m)) : !1; } function q(n) { var o; return (o = e.disabledDates) != null && o.length ? e.disabledDates.some((m) => de(n, m, "date")) : !1; } function Z(n) { return e.maxDate ? D(n).isAfter(e.maxDate, "date") : !1; } const i = rt(() => { s.value && (s.value.style.minHeight = ""); }, 400); function M() { var n; s.value && (s.value.style.minHeight = `${((n = s.value) == null ? void 0 : n.clientHeight) || 176}px`, i()); } return pe( () => e.calendarDate, (n, o) => { Y.value = D(n).isAfter(o, "date") ? "maz-slidenext" : "maz-slideprev", M(); } ), (n, o) => (k(), I( "div", { ref_key: "MazPickerGrid", ref: s, class: "maz-picker-calendar-grid" }, [ j(Be, { name: Y.value }, { default: G(() => [ (k(!0), I( le, null, ie([v.value], (m, c) => (k(), I( "div", { key: `${m[c]}`, class: U(["maz-picker-calendar-grid__container", { "--is-range": d.value }]) }, [ (k(!0), I( le, null, ie(w.value, (r) => (k(), I("div", { key: r }))), 128 /* KEYED_FRAGMENT */ )), (k(!0), I( le, null, ie(x.value, ({ label: r, date: l }, y) => (k(), F(ae, { key: y, size: "mini", color: H(l), type: "button", disabled: t.disabled || L(l) || Z(l) || P(l) || q(l), class: U({ "--is-today": S(l), "--is-first": T(l), "--is-last": A(l) || d.value && V(l), "--is-selected": E(l) === 1, "--is-between": E(l) === 2, "--is-between-hoverred": d.value ? Q(l) === 3 : void 0 }), onClick: (O) => g(l), onMouseover: (O) => d.value ? b(l) : void 0, onMouseleave: o[0] || (o[0] = (O) => d.value ? b() : void 0), onFocus: (O) => d.value ? b(l) : void 0, onBlur: o[1] || (o[1] = (O) => d.value ? b() : void 0) }, { default: G(() => [ K( "span", null, re(r), 1 /* TEXT */ ) ]), _: 2 /* DYNAMIC */ }, 1032, ["color", "disabled", "class", "onClick", "onMouseover", "onFocus"]))), 128 /* KEYED_FRAGMENT */ )) ], 2 /* CLASS */ ))), 128 /* KEYED_FRAGMENT */ )) ]), _: 1 /* STABLE */ }, 8, ["name"]) ], 512 /* NEED_PATCH */ )); } }), na = /* @__PURE__ */ oe(ra, [["__scopeId", "data-v-a04fc985"]]), oa = { class: "maz-picker-calendar-month --has-padding" }, la = /* @__PURE__ */ ne({ __name: "MazPickerCalendarMonth", props: { modelValue: { type: [String, Object], default: void 0 }, color: { type: String, required: !0 }, locale: { type: String, required: !0 }, hasTime: { type: Boolean, required: !0 }, firstDayOfWeek: { type: Number, required: !0 }, calendarDate: { type: String, required: !0 }, offsetMonth: { type: Number, default: 0 }, minDate: { type: String, default: void 0 }, maxDate: { type: String, default: void 0 }, disabledWeekly: { type: Array, required: !0 }, disabledDates: { type: Array, required: !0 }, hoverredDay: { type: Object, default: void 0 }, disabled: { type: Boolean, required: !0 } }, emits: ["update:model-value", "update:calendar-date", "update:hoverred-day"], setup(t, { emit: a }) { const e = t, u = a, s = $({ get: () => e.modelValue, set: (h) => u("update:model-value", h) }), Y = $({ get: () => e.hoverredDay, set: (h) => u("update:hoverred-day", h) }); function v(h) { return D(e.calendarDate).add(h, "month").format(); } const d = $({ get: () => v(e.offsetMonth), set: (h) => u("update:calendar-date", h) }); return (h, p) => (k(), I("div", oa, [ j(_t, { locale: t.locale, "first-day-of-week": t.firstDayOfWeek, class: "maz-picker-calendar-month__days" }, null, 8, ["locale", "first-day-of-week"]), j(na, { modelValue: s.value, "onUpdate:modelValue": p[0] || (p[0] = (f) => s.value = f), "hoverred-day": Y.value, "onUpdate:hoverredDay": p[1] || (p[1] = (f) => Y.value = f), locale: t.locale, color: t.color, "has-time": t.hasTime, "calendar-date": d.value, "first-day-of-week": t.firstDayOfWeek, "min-date": t.minDate, "max-date": t.maxDate, "disabled-weekly": t.disabledWeekly, "disabled-dates": t.disabledDates, disabled: t.disabled }, null, 8, ["modelValue", "hoverred-day", "locale", "color", "has-time", "calendar-date", "first-day-of-week", "min-date", "max-date", "disabled-weekly", "disabled-dates", "disabled"]) ])); } }), ia = /* @__PURE__ */ oe(la, [["__scopeId", "data-v-c9ace16d"]]), sa = { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24" }; function ua(t, a) { return k(), I("svg", sa, a[0] || (a[0] = [ K( "path", { stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "1.5", d: "M15.75 19.5 8.25 12l7.5-7.5" }, null, -1 /* HOISTED */ ) ])); } const He = { render: ua }, da = { class: "m-picker-calendar-switcher" }, ca = /* @__PURE__ */ ne({ __name: "MazPickerCalendarSwitcher", props: { calendarDate: { type: String, default: void 0 }, locale: { type: String, required: !0 }, double: