UNPKG

vue3-calendar-component

Version:

A comprehensive Vue 3 Calendar component with Vuetify 3, TypeScript, and advanced features

1,312 lines 80.3 kB
import W from "dayjs"; import { ref as K, computed as C, defineComponent as B, createBlock as Z, openBlock as D, unref as m, withCtx as H, createVNode as z, createElementVNode as V, createCommentVNode as I, createTextVNode as P, toDisplayString as x, resolveComponent as Pe, createElementBlock as M, renderSlot as le, Fragment as U, renderList as J, normalizeStyle as ne, normalizeClass as G, withModifiers as X, mergeProps as Oe, mergeModels as Je, inject as kt, useModel as xe, getCurrentInstance as $t, watch as ve, onMounted as Mt, onUnmounted as wt, resolveDynamicComponent as _t, createSlots as bt, normalizeProps as St, guardReactiveProps as Tt } from "vue"; import { VProgressLinear as Ue, VBtnToggle as Ge, VSpacer as ae, VToolbar as je, VIcon as Q, VBtn as j, VChip as re, VCardActions as Re, VCard as Se, VMenu as se, VSelect as Ze, VTextField as Ke, VCol as he, VRow as Qe } from "vuetify/components"; import { VIcon as me } from "vuetify/components/VIcon"; import { useDisplay as Yt } from "vuetify"; function oe(n) { return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n; } var ge = { exports: {} }, Ot = ge.exports, Xe; function Ct() { return Xe || (Xe = 1, function(n, i) { (function(t, e) { n.exports = e(); })(Ot, function() { var t = "day"; return function(e, s, v) { var d = function(f) { return f.add(4 - f.isoWeekday(), t); }, k = s.prototype; k.isoWeekYear = function() { return d(this).year(); }, k.isoWeek = function(f) { if (!this.$utils().u(f)) return this.add(7 * (f - this.isoWeek()), t); var y, w, p, b, g = d(this), a = (y = this.isoWeekYear(), w = this.$u, p = (w ? v.utc : v)().year(y).startOf("year"), b = 4 - p.isoWeekday(), p.isoWeekday() > 4 && (b += 7), p.add(b, t)); return g.diff(a, "week") + 1; }, k.isoWeekday = function(f) { return this.$utils().u(f) ? this.day() || 7 : this.day(this.day() % 7 ? f : f - 7); }; var o = k.startOf; k.startOf = function(f, y) { var w = this.$utils(), p = !!w.u(y) || y; return w.p(f) === "isoweek" ? p ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") : o.bind(this)(f, y); }; }; }); }(ge)), ge.exports; } var Et = Ct(); const dt = /* @__PURE__ */ oe(Et); var ye = { exports: {} }, Lt = ye.exports, et; function xt() { return et || (et = 1, function(n, i) { (function(t, e) { n.exports = e(W); })(Lt, function(t) { function e(o) { return o && typeof o == "object" && "default" in o ? o : { default: o }; } var s = e(t), v = { s: "ein paar Sekunden", m: ["eine Minute", "einer Minute"], mm: "%d Minuten", h: ["eine Stunde", "einer Stunde"], hh: "%d Stunden", d: ["ein Tag", "einem Tag"], dd: ["%d Tage", "%d Tagen"], M: ["ein Monat", "einem Monat"], MM: ["%d Monate", "%d Monaten"], y: ["ein Jahr", "einem Jahr"], yy: ["%d Jahre", "%d Jahren"] }; function d(o, f, y) { var w = v[y]; return Array.isArray(w) && (w = w[f ? 0 : 1]), w.replace("%d", o); } var k = { name: "de", weekdays: "Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"), weekdaysShort: "So._Mo._Di._Mi._Do._Fr._Sa.".split("_"), weekdaysMin: "So_Mo_Di_Mi_Do_Fr_Sa".split("_"), months: "Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"), monthsShort: "Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"), ordinal: function(o) { return o + "."; }, weekStart: 1, yearStart: 4, formats: { LTS: "HH:mm:ss", LT: "HH:mm", L: "DD.MM.YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY HH:mm", LLLL: "dddd, D. MMMM YYYY HH:mm" }, relativeTime: { future: "in %s", past: "vor %s", s: d, m: d, mm: d, h: d, hh: d, d, dd: d, M: d, MM: d, y: d, yy: d } }; return s.default.locale(k, null, !0), k; }); }(ye)), ye.exports; } xt(); var pe = { exports: {} }, zt = pe.exports, tt; function Vt() { return tt || (tt = 1, function(n, i) { (function(t, e) { n.exports = e(); })(zt, function() { return { 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(t) { var e = ["th", "st", "nd", "rd"], s = t % 100; return "[" + t + (e[(s - 20) % 10] || e[s] || e[0]) + "]"; } }; }); }(pe)), pe.exports; } Vt(); const ft = { dayJsLocale: "en", status: { open: "Open", planned: "Planned", overdue: "Overdue", completed: "Completed", cancelled: "Cancelled" }, views: { agenda: { noEvents: "No events scheduled for this day", buttons: { markEventCompleted: "Mark as Completed", cancelEvent: "Cancel Event" } } }, toolbar: { buttons: { month: "Month", week: "Week", day: "Day", agenda: "Agenda", today: "Today", previous: "Previous", next: "Next" }, filters: { statusLabel: "Filter by status", filterByCategory: "Filter by category" }, searchPlaceholder: "Search events...", clearFilters: "Clear Filters", activeFilters: function(n) { return `${n} filter${n > 1 ? "s" : ""} active`; } }, formats: { date: "MM/DD/YYYY", time: "HH:mm", day: "dddd, MMMM D, YYYY", startOfWeek: "MMM D", endOfWeek: "MMM D, YYYY", month: "MMMM YYYY", duration(n, i, t) { const e = []; return n > 0 && e.push(`${n} d`), i > 0 && e.push(`${i} h`), t > 0 && e.push(`${t} m`), e.join(", "); } } }, ie = K(ft); function ce() { const n = (e) => { ie.value = e, e.dayJsLocale ? W.locale(e.dayJsLocale) : W.locale("en"), console.log(W().format("MMMM D, YYYY")); }, i = (e) => { const s = e ? W(e) : W(); return ie.value.dayJsLocale ? s.locale(ie.value.dayJsLocale) : s; }, t = C(() => (e) => { const s = e ? W(e) : W(); return ie.value.dayJsLocale ? s.locale(ie.value.dayJsLocale) : s; }); return { current: ie, setLocale: n, createLocalizedDayjs: i, localizedDayjs: t }; } const Ht = { class: "calendar-title" }, Ft = { class: "text-h6" }, Wt = /* @__PURE__ */ B({ components: { VBtn: j, VIcon: Q, VToolbar: je, VSpacer: ae, VBtnToggle: Ge, VProgressLinear: Ue }, __name: "CalendarToolbarButtons", props: { currentDate: {}, currentView: {}, loading: { type: Boolean, default: !1 } }, emits: ["view-change", "date-change", "navigate-previous", "navigate-next", "navigate-today"], setup(n, { emit: i }) { const t = ce(), { localizedDayjs: e } = t, s = n, v = i, d = C(() => { const o = e.value(s.currentDate); switch (s.currentView) { case "week": { const f = e.value(o.startOf("week")).format(t.current.value.formats.startOfWeek ?? "MMM D"), y = e.value(o.endOf("week")).format(t.current.value.formats.endOfWeek ?? "MMM D, YYYY"); return `${f} - ${y}`; } case "day": case "agenda": return o.format(t.current.value.formats.day ?? "dddd, MMMM D, YYYY"); case "month": default: return o.format(t.current.value.formats.month ?? "MMMM YYYY"); } }), k = (o) => { o && o !== s.currentView && v("view-change", { oldView: s.currentView, newView: o, currentDate: s.currentDate }); }; return (o, f) => (D(), Z(m(je), { density: "compact", class: "calendar-toolbar" }, { default: H(() => [ z(m(j), { title: m(t).current.value.toolbar.buttons.previous || "Previous", icon: "", disabled: o.loading, onClick: f[0] || (f[0] = (y) => o.$emit("navigate-previous")) }, { default: H(() => [ z(m(Q), null, { default: H(() => f[3] || (f[3] = [ P("mdi-chevron-left") ])), _: 1, __: [3] }) ]), _: 1 }, 8, ["title", "disabled"]), z(m(j), { title: m(t).current.value.toolbar.buttons.next || "Next", icon: "", disabled: o.loading, onClick: f[1] || (f[1] = (y) => o.$emit("navigate-next")) }, { default: H(() => [ z(m(Q), null, { default: H(() => f[4] || (f[4] = [ P("mdi-chevron-right") ])), _: 1, __: [4] }) ]), _: 1 }, 8, ["title", "disabled"]), z(m(j), { variant: "text", disabled: o.loading, class: "mx-2", onClick: f[2] || (f[2] = (y) => o.$emit("navigate-today")) }, { default: H(() => [ P(x(m(t).current.value.toolbar.buttons.today || "Today"), 1) ]), _: 1 }, 8, ["disabled"]), z(m(ae)), V("div", Ht, [ V("h2", Ft, x(d.value), 1) ]), z(m(ae)), z(m(Ge), { "model-value": o.currentView, mandatory: "", variant: "outlined", divided: "", class: "view-toggle", "onUpdate:modelValue": k }, { default: H(() => [ z(m(j), { value: "month", size: "small" }, { default: H(() => [ P(x(m(t).current.value.toolbar.buttons.month || "Month"), 1) ]), _: 1 }), z(m(j), { value: "week", size: "small" }, { default: H(() => [ P(x(m(t).current.value.toolbar.buttons.week || "Week"), 1) ]), _: 1 }), z(m(j), { value: "day", size: "small" }, { default: H(() => [ P(x(m(t).current.value.toolbar.buttons.day || "Day"), 1) ]), _: 1 }), z(m(j), { value: "agenda", size: "small" }, { default: H(() => [ P(x(m(t).current.value.toolbar.buttons.agenda || "Agenda"), 1) ]), _: 1 }) ]), _: 1 }, 8, ["model-value"]), o.loading ? (D(), Z(m(Ue), { key: 0, indeterminate: "", color: "primary", class: "position-absolute", style: { bottom: "0", left: "0", right: "0" } })) : I("", !0) ]), _: 1 })); } }), ee = (n, i) => { const t = n.__vccOpts || n; for (const [e, s] of i) t[e] = s; return t; }, He = /* @__PURE__ */ ee(Wt, [["__scopeId", "data-v-ce23c6f9"]]); var De = { exports: {} }, At = De.exports, nt; function It() { return nt || (nt = 1, function(n, i) { (function(t, e) { n.exports = e(); })(At, function() { var t, e, s = 1e3, v = 6e4, d = 36e5, k = 864e5, o = /\[([^\]]+)]|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, f = 31536e6, y = 2628e6, w = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, p = { years: f, months: y, days: k, hours: d, minutes: v, seconds: s, milliseconds: 1, weeks: 6048e5 }, b = function(O) { return O instanceof L; }, g = function(O, r, l) { return new L(O, l, r.$l); }, a = function(O) { return e.p(O) + "s"; }, $ = function(O) { return O < 0; }, _ = function(O) { return $(O) ? Math.ceil(O) : Math.floor(O); }, E = function(O) { return Math.abs(O); }, c = function(O, r) { return O ? $(O) ? { negative: !0, format: "" + E(O) + r } : { negative: !1, format: "" + O + r } : { negative: !1, format: "" }; }, L = function() { function O(l, u, Y) { var T = this; if (this.$d = {}, this.$l = Y, l === void 0 && (this.$ms = 0, this.parseFromMilliseconds()), u) return g(l * p[a(u)], this); if (typeof l == "number") return this.$ms = l, this.parseFromMilliseconds(), this; if (typeof l == "object") return Object.keys(l).forEach(function(R) { T.$d[a(R)] = l[R]; }), this.calMilliseconds(), this; if (typeof l == "string") { var F = l.match(w); if (F) { var N = F.slice(2).map(function(R) { return R != null ? Number(R) : 0; }); return this.$d.years = N[0], this.$d.months = N[1], this.$d.weeks = N[2], this.$d.days = N[3], this.$d.hours = N[4], this.$d.minutes = N[5], this.$d.seconds = N[6], this.calMilliseconds(), this; } } return this; } var r = O.prototype; return r.calMilliseconds = function() { var l = this; this.$ms = Object.keys(this.$d).reduce(function(u, Y) { return u + (l.$d[Y] || 0) * p[Y]; }, 0); }, r.parseFromMilliseconds = function() { var l = this.$ms; this.$d.years = _(l / f), l %= f, this.$d.months = _(l / y), l %= y, this.$d.days = _(l / k), l %= k, this.$d.hours = _(l / d), l %= d, this.$d.minutes = _(l / v), l %= v, this.$d.seconds = _(l / s), l %= s, this.$d.milliseconds = l; }, r.toISOString = function() { var l = c(this.$d.years, "Y"), u = c(this.$d.months, "M"), Y = +this.$d.days || 0; this.$d.weeks && (Y += 7 * this.$d.weeks); var T = c(Y, "D"), F = c(this.$d.hours, "H"), N = c(this.$d.minutes, "M"), R = this.$d.seconds || 0; this.$d.milliseconds && (R += this.$d.milliseconds / 1e3, R = Math.round(1e3 * R) / 1e3); var de = c(R, "S"), Ee = l.negative || u.negative || T.negative || F.negative || N.negative || de.negative, Le = F.format || N.format || de.format ? "T" : "", fe = (Ee ? "-" : "") + "P" + l.format + u.format + T.format + Le + F.format + N.format + de.format; return fe === "P" || fe === "-P" ? "P0D" : fe; }, r.toJSON = function() { return this.toISOString(); }, r.format = function(l) { var u = l || "YYYY-MM-DDTHH:mm:ss", Y = { Y: this.$d.years, YY: e.s(this.$d.years, 2, "0"), YYYY: e.s(this.$d.years, 4, "0"), M: this.$d.months, MM: e.s(this.$d.months, 2, "0"), D: this.$d.days, DD: e.s(this.$d.days, 2, "0"), H: this.$d.hours, HH: e.s(this.$d.hours, 2, "0"), m: this.$d.minutes, mm: e.s(this.$d.minutes, 2, "0"), s: this.$d.seconds, ss: e.s(this.$d.seconds, 2, "0"), SSS: e.s(this.$d.milliseconds, 3, "0") }; return u.replace(o, function(T, F) { return F || String(Y[T]); }); }, r.as = function(l) { return this.$ms / p[a(l)]; }, r.get = function(l) { var u = this.$ms, Y = a(l); return Y === "milliseconds" ? u %= 1e3 : u = Y === "weeks" ? _(u / p[Y]) : this.$d[Y], u || 0; }, r.add = function(l, u, Y) { var T; return T = u ? l * p[a(u)] : b(l) ? l.$ms : g(l, this).$ms, g(this.$ms + T * (Y ? -1 : 1), this); }, r.subtract = function(l, u) { return this.add(l, u, !0); }, r.locale = function(l) { var u = this.clone(); return u.$l = l, u; }, r.clone = function() { return g(this.$ms, this); }, r.humanize = function(l) { return t().add(this.$ms, "ms").locale(this.$l).fromNow(!l); }, r.valueOf = function() { return this.asMilliseconds(); }, r.milliseconds = function() { return this.get("milliseconds"); }, r.asMilliseconds = function() { return this.as("milliseconds"); }, r.seconds = function() { return this.get("seconds"); }, r.asSeconds = function() { return this.as("seconds"); }, r.minutes = function() { return this.get("minutes"); }, r.asMinutes = function() { return this.as("minutes"); }, r.hours = function() { return this.get("hours"); }, r.asHours = function() { return this.as("hours"); }, r.days = function() { return this.get("days"); }, r.asDays = function() { return this.as("days"); }, r.weeks = function() { return this.get("weeks"); }, r.asWeeks = function() { return this.as("weeks"); }, r.months = function() { return this.get("months"); }, r.asMonths = function() { return this.as("months"); }, r.years = function() { return this.get("years"); }, r.asYears = function() { return this.as("years"); }, O; }(), S = function(O, r, l) { return O.add(r.years() * l, "y").add(r.months() * l, "M").add(r.days() * l, "d").add(r.hours() * l, "h").add(r.minutes() * l, "m").add(r.seconds() * l, "s").add(r.milliseconds() * l, "ms"); }; return function(O, r, l) { t = l, e = l().$utils(), l.duration = function(T, F) { var N = l.locale(); return g(T, { $l: N }, F); }, l.isDuration = b; var u = r.prototype.add, Y = r.prototype.subtract; r.prototype.add = function(T, F) { return b(T) ? S(this, T, 1) : u.bind(this)(T, F); }, r.prototype.subtract = function(T, F) { return b(T) ? S(this, T, -1) : Y.bind(this)(T, F); }; }; }); }(De)), De.exports; } var Nt = It(); const Bt = /* @__PURE__ */ oe(Nt); var ke = { exports: {} }, qt = ke.exports, rt; function Pt() { return rt || (rt = 1, function(n, i) { (function(t, e) { n.exports = e(); })(qt, function() { var t = { 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" }; return function(e, s, v) { var d = s.prototype, k = d.format; v.en.formats = t, d.format = function(o) { o === void 0 && (o = "YYYY-MM-DDTHH:mm:ssZ"); var f = this.$locale().formats, y = function(w, p) { return w.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(b, g, a) { var $ = a && a.toUpperCase(); return g || p[a] || t[a] || p[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(_, E, c) { return E || c.slice(1); }); }); }(o, f === void 0 ? {} : f); return k.call(this, y); }; }; }); }(ke)), ke.exports; } var Jt = Pt(); const Ut = /* @__PURE__ */ oe(Jt); var $e = { exports: {} }, Gt = $e.exports, at; function jt() { return at || (at = 1, function(n, i) { (function(t, e) { n.exports = e(); })(Gt, function() { return function(t, e, s) { t = t || {}; var v = e.prototype, d = { 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 k(f, y, w, p) { return v.fromToBase(f, y, w, p); } s.en.relativeTime = d, v.fromToBase = function(f, y, w, p, b) { for (var g, a, $, _ = w.$locale().relativeTime || d, E = t.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" }], c = E.length, L = 0; L < c; L += 1) { var S = E[L]; S.d && (g = p ? s(f).diff(w, S.d, !0) : w.diff(f, S.d, !0)); var O = (t.rounding || Math.round)(Math.abs(g)); if ($ = g > 0, O <= S.r || !S.r) { O <= 1 && L > 0 && (S = E[L - 1]); var r = _[S.l]; b && (O = b("" + O)), a = typeof r == "string" ? r.replace("%d", O) : r(O, y, S.l, $); break; } } if (y) return a; var l = $ ? _.future : _.past; return typeof l == "function" ? l(a) : l.replace("%s", a); }, v.to = function(f, y) { return k(f, y, this, !0); }, v.from = function(f, y) { return k(f, y, this); }; var o = function(f) { return f.$u ? s.utc() : s(); }; v.toNow = function(f) { return this.to(o(this), f); }, v.fromNow = function(f) { return this.from(o(this), f); }; }; }); }($e)), $e.exports; } var Rt = jt(); const Zt = /* @__PURE__ */ oe(Rt); var Me = { exports: {} }, Kt = Me.exports, st; function Qt() { return st || (st = 1, function(n, i) { (function(t, e) { n.exports = e(); })(Kt, function() { var t = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, e = {}; return function(s, v, d) { var k, o = function(p, b, g) { g === void 0 && (g = {}); var a = new Date(p), $ = function(_, E) { E === void 0 && (E = {}); var c = E.timeZoneName || "short", L = _ + "|" + c, S = e[L]; return S || (S = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: _, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: c }), e[L] = S), S; }(b, g); return $.formatToParts(a); }, f = function(p, b) { for (var g = o(p, b), a = [], $ = 0; $ < g.length; $ += 1) { var _ = g[$], E = _.type, c = _.value, L = t[E]; L >= 0 && (a[L] = parseInt(c, 10)); } var S = a[3], O = S === 24 ? 0 : S, r = a[0] + "-" + a[1] + "-" + a[2] + " " + O + ":" + a[4] + ":" + a[5] + ":000", l = +p; return (d.utc(r).valueOf() - (l -= l % 1e3)) / 6e4; }, y = v.prototype; y.tz = function(p, b) { p === void 0 && (p = k); var g, a = this.utcOffset(), $ = this.toDate(), _ = $.toLocaleString("en-US", { timeZone: p }), E = Math.round(($ - new Date(_)) / 1e3 / 60), c = 15 * -Math.round($.getTimezoneOffset() / 15) - E; if (!Number(c)) g = this.utcOffset(0, b); else if (g = d(_, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(c, !0), b) { var L = g.utcOffset(); g = g.add(a - L, "minute"); } return g.$x.$timezone = p, g; }, y.offsetName = function(p) { var b = this.$x.$timezone || d.tz.guess(), g = o(this.valueOf(), b, { timeZoneName: p }).find(function(a) { return a.type.toLowerCase() === "timezonename"; }); return g && g.value; }; var w = y.startOf; y.startOf = function(p, b) { if (!this.$x || !this.$x.$timezone) return w.call(this, p, b); var g = d(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L }); return w.call(g, p, b).tz(this.$x.$timezone, !0); }, d.tz = function(p, b, g) { var a = g && b, $ = g || b || k, _ = f(+d(), $); if (typeof p != "string") return d(p).tz($); var E = function(O, r, l) { var u = O - 60 * r * 1e3, Y = f(u, l); if (r === Y) return [u, r]; var T = f(u -= 60 * (Y - r) * 1e3, l); return Y === T ? [u, Y] : [O - 60 * Math.min(Y, T) * 1e3, Math.max(Y, T)]; }(d.utc(p, a).valueOf(), _, $), c = E[0], L = E[1], S = d(c).utcOffset(L); return S.$x.$timezone = $, S; }, d.tz.guess = function() { return Intl.DateTimeFormat().resolvedOptions().timeZone; }, d.tz.setDefault = function(p) { k = p; }; }; }); }(Me)), Me.exports; } var Xt = Qt(); const en = /* @__PURE__ */ oe(Xt); var we = { exports: {} }, tn = we.exports, ot; function nn() { return ot || (ot = 1, function(n, i) { (function(t, e) { n.exports = e(); })(tn, function() { var t = "minute", e = /[+-]\d\d(?::?\d\d)?/g, s = /([+-]|\d\d)/g; return function(v, d, k) { var o = d.prototype; k.utc = function(a) { var $ = { date: a, utc: !0, args: arguments }; return new d($); }, o.utc = function(a) { var $ = k(this.toDate(), { locale: this.$L, utc: !0 }); return a ? $.add(this.utcOffset(), t) : $; }, o.local = function() { return k(this.toDate(), { locale: this.$L, utc: !1 }); }; var f = o.parse; o.parse = function(a) { a.utc && (this.$u = !0), this.$utils().u(a.$offset) || (this.$offset = a.$offset), f.call(this, a); }; var y = o.init; o.init = function() { if (this.$u) { var a = this.$d; this.$y = a.getUTCFullYear(), this.$M = a.getUTCMonth(), this.$D = a.getUTCDate(), this.$W = a.getUTCDay(), this.$H = a.getUTCHours(), this.$m = a.getUTCMinutes(), this.$s = a.getUTCSeconds(), this.$ms = a.getUTCMilliseconds(); } else y.call(this); }; var w = o.utcOffset; o.utcOffset = function(a, $) { var _ = this.$utils().u; if (_(a)) return this.$u ? 0 : _(this.$offset) ? w.call(this) : this.$offset; if (typeof a == "string" && (a = function(S) { S === void 0 && (S = ""); var O = S.match(e); if (!O) return null; var r = ("" + O[0]).match(s) || ["-", 0, 0], l = r[0], u = 60 * +r[1] + +r[2]; return u === 0 ? 0 : l === "+" ? u : -u; }(a), a === null)) return this; var E = Math.abs(a) <= 16 ? 60 * a : a, c = this; if ($) return c.$offset = E, c.$u = a === 0, c; if (a !== 0) { var L = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset(); (c = this.local().add(E + L, t)).$offset = E, c.$x.$localOffset = L; } else c = this.utc(); return c; }; var p = o.format; o.format = function(a) { var $ = a || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : ""); return p.call(this, $); }, o.valueOf = function() { var a = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset()); return this.$d.valueOf() - 6e4 * a; }, o.isUTC = function() { return !!this.$u; }, o.toISOString = function() { return this.toDate().toISOString(); }, o.toString = function() { return this.toDate().toUTCString(); }; var b = o.toDate; o.toDate = function(a) { return a === "s" && this.$offset ? k(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : b.call(this); }; var g = o.diff; o.diff = function(a, $, _) { if (a && this.$u === a.$u) return g.call(this, a, $, _); var E = this.local(), c = k(a).local(); return g.call(E, c, $, _); }; }; }); }(we)), we.exports; } var rn = nn(); const an = /* @__PURE__ */ oe(rn); var _e = { exports: {} }, sn = _e.exports, it; function on() { return it || (it = 1, function(n, i) { (function(t, e) { n.exports = e(); })(sn, function() { var t = "week", e = "year"; return function(s, v, d) { var k = v.prototype; k.week = function(o) { if (o === void 0 && (o = null), o !== null) return this.add(7 * (o - this.week()), "day"); var f = this.$locale().yearStart || 1; if (this.month() === 11 && this.date() > 25) { var y = d(this).startOf(e).add(1, e).date(f), w = d(this).endOf(t); if (y.isBefore(w)) return 1; } var p = d(this).startOf(e).date(f).startOf(t).subtract(1, "millisecond"), b = this.diff(p, t, !0); return b < 0 ? d(this).startOf("week").week() : Math.ceil(b); }, k.weeks = function(o) { return o === void 0 && (o = null), this.week(o); }; }; }); }(_e)), _e.exports; } var ln = on(); const un = /* @__PURE__ */ oe(ln); W.extend(an); W.extend(en); W.extend(dt); W.extend(un); W.extend(Bt); W.extend(Zt); W.extend(Ut); function cn(n) { const i = W(n.start), t = n.end ? W(n.end) : i.add(1, "hour"); return { ...n, startDate: i, endDate: t, isAllDay: n.allDay || !1 }; } function lt(n) { return n.map(cn); } function mt(n, i, t) { return n.filter((e) => e.startDate.isBefore(t) && e.endDate.isAfter(i)); } function Ce(n, i) { const t = i.startOf("day"), e = i.endOf("day"); return mt(n, t, e); } function vt(n = "00:00", i = "24:00", t = 60) { const e = [], [s, v] = n.split(":").map(Number), [d, k] = i.split(":").map(Number); let o = W().hour(s).minute(v).second(0); const f = W().hour(d).minute(k).second(0); for (; o.isBefore(f); ) e.push({ hour: o.hour(), minute: o.minute(), label: o.format("HH:mm") }), o = o.add(t, "minute"); return e; } function ht(n, i = "monday") { let t = n.startOf("isoWeek").isoWeekday(gt(i)); i !== "monday" && (t = t.subtract(1, "week")); const e = []; for (let s = 0; s < 7; s++) e.push(t.add(s, "day")); return e; } function dn(n, i = "monday") { const t = n.startOf("month"); let e = t.isoWeekday(gt(i)); e.isAfter(t) && (e = e.subtract(1, "week")); const s = n.endOf("month"), v = []; let d = e; for (; d.isBefore(s) || d.isSame(s, "day"); ) { const k = []; for (let o = 0; o < 7; o++) k.push(d.add(o, "day")); v.push(k), d = d.add(7, "day"); } return v; } function Ne(n, i) { if (n.isAllDay) return "All day"; const t = i || "HH:mm", e = n.startDate.format(t), s = n.endDate.format(t); return `${e} - ${s}`; } function fn(n) { return n.endDate.diff(n.startDate, "minute"); } function Rr(n, i) { return n.startDate.isBefore(i.endDate) && n.endDate.isAfter(i.startDate); } function mn(n) { return [...n].sort((i, t) => i.startDate.valueOf() - t.startDate.valueOf()); } function ue(n) { if (n.color) return n.color; if (n.backgroundColor) return n.backgroundColor; switch (n.status) { case "completed": return "#4caf50"; case "cancelled": return "#f44336"; case "overdue": return "#ff5722"; case "planned": return "#2196f3"; case "open": default: return "#9e9e9e"; } } function Be(n) { if (n.textColor) return n.textColor; const t = ue(n).replace("#", ""), e = parseInt(t.substr(0, 2), 16), s = parseInt(t.substr(2, 2), 16), v = parseInt(t.substr(4, 2), 16); return (e * 299 + s * 587 + v * 114) / 1e3 > 128 ? "#000000" : "#ffffff"; } function Te(n) { return n.isSame(W(), "day"); } function Ye(n) { const i = n.isoWeekday(); return i === 6 || i === 7; } function gt(n) { switch (n) { case "monday": return 1; case "tuesday": return 2; case "wednesday": return 3; case "thursday": return 4; case "friday": return 5; case "saturday": return 6; case "sunday": return 7; default: return -1; } } function vn(n) { switch (n) { case "sunday": return 0; case "monday": return 1; case "tuesday": return 2; case "wednesday": return 3; case "thursday": return 4; case "friday": return 5; case "saturday": return 6; default: return -1; } } function hn(n, i) { let t = [...n]; if (i.search) { const e = i.search.toLowerCase(); t = t.filter( (s) => s.title.toLowerCase().indexOf(e) !== -1 || s.subtitle && s.subtitle.toLowerCase().indexOf(e) !== -1 || s.description && s.description.toLowerCase().indexOf(e) !== -1 ); } if (i.statuses && i.statuses.length > 0 && (t = t.filter((e) => i.statuses.indexOf(e.status || "open") !== -1)), i.dateRange) { const { start: e, end: s } = i.dateRange; t = t.filter((v) => v.startDate.isBefore(s) && v.endDate.isAfter(e)); } return i.customFilter && (t = t.filter(i.customFilter)), t; } function gn(n, i) { let t = null; return (...e) => { t && clearTimeout(t), t = setTimeout(() => n(...e), i); }; } function Zr(n, i) { let t; return (...e) => { t || (n(...e), t = !0, setTimeout(() => t = !1, i)); }; } function Kr() { return Math.random().toString(36).substring(2) + Date.now().toString(36); } function ut(n) { if (n === null || typeof n != "object") return n; if (n instanceof Date) return new Date(n.getTime()); if (Array.isArray(n)) return n.map(ut); const i = {}; for (const t in n) Object.prototype.hasOwnProperty.call(n, t) && (i[t] = ut(n[t])); return i; } const yn = { class: "agenda-view" }, pn = { class: "agenda-header" }, Dn = { class: "text-h6" }, kn = { class: "agenda-content" }, $n = { key: 0, class: "no-events" }, Mn = { class: "text-body-1 text-grey" }, wn = { key: 1, class: "events-list" }, _n = { class: "event-header d-flex align-center mb-2" }, bn = { class: "event-title text-h6 flex-grow-1" }, Sn = { key: 0, class: "event-subtitle text-subtitle-1 mb-2" }, Tn = { class: "event-time d-flex align-center mb-2" }, Yn = { class: "text-body-2" }, On = { key: 0, class: "ml-2 text-caption text-grey" }, Cn = { key: 1, class: "event-location d-flex align-center mb-2" }, En = { class: "text-body-2" }, Ln = { key: 2, class: "event-description" }, xn = { class: "text-body-2 mb-0" }, zn = { key: 3, class: "event-metadata mt-3" }, Vn = { class: "d-flex flex-wrap gap-2" }, Hn = /* @__PURE__ */ B({ components: { VIcon: me, VCard: Se, VCardActions: Re, VChip: re, VSpacer: ae, VBtn: j }, __name: "AgendaView", props: { events: {}, currentDate: {}, containerHeight: {}, config: {}, readOnly: { type: Boolean } }, emits: ["event-click", "event-update"], setup(n, { emit: i }) { const t = ce(), e = n, s = i, v = C(() => Ce(e.events, e.currentDate)), d = C(() => mn(v.value)), k = C(() => t.localizedDayjs.value(e.currentDate).format(t.current.value.formats.day)), o = (a) => { switch (a) { case "completed": return "success"; case "cancelled": return "error"; case "overdue": return "warning"; case "planned": return "info"; case "open": default: return "default"; } }, f = (a) => { switch (a) { case "completed": return t.current.value.status.completed; case "cancelled": return t.current.value.status.cancelled; case "overdue": return t.current.value.status.overdue; case "planned": return t.current.value.status.planned; case "open": default: return t.current.value.status.open; } }, y = (a) => { const $ = fn(a), _ = Math.floor($ / (24 * 60)), E = Math.floor($ / 60), c = $ % 60; return t.current.value.formats.duration(_, E, c); }, w = (a) => a.endDate.isBefore(W()) && a.status !== "completed" && a.status !== "cancelled", p = (a) => { s("event-click", a); }, b = (a) => { s("event-update", a.id, { status: "completed" }); }, g = (a) => { s("event-update", a.id, { status: "cancelled" }); }; return (a, $) => { const _ = Pe("v-divider"), E = Pe("v-card-text"); return D(), M("div", yn, [ V("div", pn, [ V("h3", Dn, x(k.value), 1), v.value.length > 0 ? (D(), Z(m(re), { key: 0, color: "primary", size: "small" }, { default: H(() => [ P(x(v.value.length) + " event" + x(v.value.length > 1 ? "s" : ""), 1) ]), _: 1 })) : I("", !0) ]), V("div", kn, [ v.value.length === 0 ? (D(), M("div", $n, [ le(a.$slots, "no-events", { date: a.currentDate }, () => [ z(m(me), { icon: "mdi-calendar-blank", size: "64", color: "grey-lighten-2", class: "mb-4" }), V("p", Mn, x(m(t).current.value.views.agenda.noEvents), 1) ], !0) ])) : (D(), M("div", wn, [ (D(!0), M(U, null, J(d.value, (c) => (D(), M("div", { key: c.id }, [ le(a.$slots, "event-content", { event: c, date: a.currentDate, handleEventClick: p }, () => [ z(m(Se), { class: G(["agenda-event mb-4", { "event-completed": c.status === "completed", "event-cancelled": c.status === "cancelled", "event-overdue": w(c) }]), style: ne({ borderLeft: `4px solid ${m(ue)(c)}` }), elevation: "2", onClick: (L) => p({ event: c, nativeEvent: L }) }, { default: H(() => [ z(E, { class: "pa-4" }, { default: H(() => [ V("div", _n, [ c.icon ? (D(), Z(m(me), { key: 0, icon: c.icon, color: m(ue)(c), class: "mr-2" }, null, 8, ["icon", "color"])) : I("", !0), V("h4", bn, x(c.title), 1), z(m(re), { color: o(c.status || "open"), size: "small", variant: "outlined" }, { default: H(() => [ P(x(f(c.status || "open")), 1) ]), _: 2 }, 1032, ["color"]) ]), c.subtitle ? (D(), M("div", Sn, x(c.subtitle), 1)) : I("", !0), V("div", Tn, [ z(m(me), { icon: "mdi-clock-outline", size: "small", class: "mr-2" }), V("span", Yn, x(m(Ne)(c)), 1), c.isAllDay ? I("", !0) : (D(), M("span", On, " (" + x(y(c)) + ") ", 1)) ]), c.location ? (D(), M("div", Cn, [ z(m(me), { icon: "mdi-map-marker", size: "small", class: "mr-2" }), V("span", En, x(c.location), 1) ])) : I("", !0), c.description ? (D(), M("div", Ln, [ V("p", xn, x(c.description), 1) ])) : I("", !0), c.data && Object.keys(c.data).length > 0 ? (D(), M("div", zn, [ z(_, { class: "mb-2" }), V("div", Vn, [ (D(!0), M(U, null, J(c.data, (L, S) => (D(), Z(m(re), { key: S, size: "x-small", variant: "outlined" }, { default: H(() => [ P(x(S) + ": " + x(L), 1) ]), _: 2 }, 1024))), 128)) ]) ])) : I("", !0) ]), _: 2 }, 1024), z(m(Re), { class: "pa-4 pt-0" }, { default: H(() => [ z(m(ae)), c.status !== "completed" && c.status !== "cancelled" ? (D(), Z(m(j), { key: 0, disabled: a.readOnly, variant: "text", size: "small", color: "success", onClick: X((L) => b(c), ["stop"]) }, { default: H(() => [ P(x(m(t).current.value.views.agenda.buttons.markEventCompleted), 1) ]), _: 2 }, 1032, ["disabled", "onClick"])) : I("", !0), c.status !== "cancelled" ? (D(), Z(m(j), { key: 1, disabled: a.readOnly, variant: "text", size: "small", color: "error", onClick: X((L) => g(c), ["stop"]) }, { default: H(() => [ P(x(m(t).current.value.views.agenda.buttons.cancelEvent), 1) ]), _: 2 }, 1032, ["disabled", "onClick"])) : I("", !0) ]), _: 2 }, 1024) ]), _: 2 }, 1032, ["style", "class", "onClick"]) ], !0) ]))), 128)) ])) ]) ]); }; } }), Fe = /* @__PURE__ */ ee(Hn, [["__scopeId", "data-v-fde84cc6"]]); function qe(n) { const i = K(null), t = K(null), e = K(!1), s = K(null), v = (y, w) => { i.value = y, t.value = w, e.value = !0, w.style.opacity = "0.5", w.style.cursor = "grabbing"; }, d = () => { t.value && (t.value.style.opacity = "1", t.value.style.cursor = "grab"), i.value = null, t.value = null, e.value = !1, s.value = null; }, k = async (y, w) => { if (!i.value) return; const p = i.value, b = p.startDate, g = p.endDate, a = w || y.add(g.diff(b, "minute"), "minute"), $ = { event: p, newStart: y.toDate(), newEnd: a.toDate(), oldStart: b.toDate(), oldEnd: g.toDate() }; try { n && await n($); } catch (_) { console.error("Failed to drop event:", _); } finally { d(); } }, o = (y) => { s.value = y, y.style.backgroundColor = "rgba(25, 118, 210, 0.1)"; }, f = (y) => { s.value === y && (y.style.backgroundColor = "", s.value = null); }; return { draggedEvent: C(() => i.value), isDragging: C(() => e.value), handleDragStart: v, handleDragEnd: d, handleDrop: k, handleDragOver: o, handleDragLeave: f }; } function We(n) { return C(() => { const [t, e] = n.value.split(":").map(Number); return t * 60 + e; }); } function yt(n, i, t, e, s = 60) { return C(() => { const d = We(i), k = We(t), o = C(() => { const w = k.value - d.value; return Math.ceil(w / e.value); }), f = n.value - s; return { height: C(() => f <= 0 ? 30 : Math.max(30, Math.floor(f / o.value))).value, numberOfSlots: o.value, minTime: d.value, maxTime: k.value }; }); } function Qr() { const { mobile: n, width: i, sm: t, md: e, lg: s, xl: v, xxl: d } = Yt(), k = C(() => t.value || e.value), o = C(() => s.value || v.value || d.value), f = C(() => n.value ? "agenda" : k.value ? "week" : "month"), y = C(() => n.value ? "compact" : k.value ? "normal" : "detailed"), w = C(() => o.value), p = C(() => n.value ? 40 : k.value ? 50 : i.value > 1920 ? 80 : 60), b = C(() => i.value > 1920); return { mobile: n, tablet: k, desktop: o, isWideScreen: b, recommendedView: f, eventDisplayMode: y, showSidebar: w, timeSlotHeight: p }; } const Fn = ["draggable"], Wn = { class: "event-content" }, An = { class: "event-header" }, In = { class: "event-title" }, Nn = { key: 0, class: "event-subtitle" }, Bn = { class: "event-time" }, qn = { key: 1, class: "event-location" }, Pn = { key: 2, class: "event-description" }, Jn = /* @__PURE__ */ B({ __name: "DayEventView", props: { event: {}, day: {}, dynamicTimeSlots: {}, handleEventClick: { type: Function }, handleDragStart: { type: Function }, config: {}, readOnly: { type: Boolean } }, setup(n) { B({ components: { VIcon: Q } }); const i = n, t = (e) => { const [s, v] = (i.config.minTime || "00:00").split(":").map(Number), [d, k] = (i.config.maxTime || "24:00").split(":").map(Number), o = i.day.hour(s).minute(v).second(0), f = i.day.hour(d).minute(k).second(0), y = e.startDate.isBefore(o) ? o : e.startDate, w = e.endDate.isAfter(f) ? f : e.endDate; if (e.endDate.isBefore(o) || e.startDate.isAfter(f)) return { display: "none" }; const p = y.diff(o, "minute"), b = w.diff(y, "minute"), g = i.config.timeSlotDuration || 60, a = i.dynamicTimeSlots.height, $ = Math.max(0, p / g * a), _ = Math.max(b / g * a, 20); return { position: "absolute", top: `${$}px`, height: `${_}px`, left: "8px", right: "8px", backgroundColor: ue(e), color: Be(e), zIndex: 10 }; }; return (e, s) => (D(), M("div", { class: G(["day-event", { "event-completed": e.event.status === "completed" }]), style: ne(t(e.event)), draggable: !e.readOnly, onClick: s[0] || (s[0] = X((v) => e.handleEventClick({ event: e.event, nativeEvent: v }), ["stop"])), onDragstart: s[1] || (s[1] = (v) => e.handleDragStart(e.event, v.target)) }, [ V("div", Wn, [ V("div", An, [ e.event.icon ? (D(), Z(m(Q), { key: 0, icon: e.event.icon, size: "small", class: "mr-2" }, null, 8, ["icon"])) : I("", !0), V("div", In, x(e.event.title), 1) ]), e.event.subtitle ? (D(), M("div", Nn, x(e.event.subtitle), 1)) : I("", !0), V("div", Bn, x(m(Ne)(e.event)), 1), e.event.location ? (D(), M("div", qn, [ z(m(Q), { icon: "mdi-map-marker", size: "x-small", class: "mr-1" }), P(" " + x(e.event.location), 1) ])) : I("", !0), e.event.description ? (D(), M("div", Pn, x(e.event.description), 1)) : I("", !0) ]) ], 46, Fn)); } }), ct = /* @__PURE__ */ ee(Jn, [["__scopeId", "data-v-69ba6863"]]), Un = { class: "day-view" }, Gn = { key: 0, class: "time-column-header" }, jn = { class: "day-name" }, Rn = { key: 0, class: "time-column" }, Zn = { class: "time-label" }, Kn = ["onClick", "onDrop"], Qn = { key: 0 }, Xn = { key: 1 }, er = /* @__PURE__ */ B({ __name: "DayView", props: { events: {}, currentDate: {}, containerHeight: {}, config: {}, readOnly: { type: Boolean } }, emits: ["time-slot-click", "event-click", "event-drop", "date-click"], setup(n, { emit: i }) { B({ components: { VMenu: se } }); const t = n, e = i, s = C(() => !t.readOnly), v = C(() => t.containerHeight || 500), d = C(() => t.config.timeSlotDuration ?? 60), k = C(() => t.config.minTime || "00:00"), o = C(() => t.config.maxTime || "24:00"), f = yt(v, k, o, d, 60), { handleDragStart: y, handleDrop: w } = qe(async (r) => { e("event-drop", { event: r.event, date: r.date, newEnd: r.newEnd, newStart: r.newStart, oldEnd: r.oldEnd, oldStart: r.oldStart }); }), p = C(() => vt(t.config.minTime, t.config.maxTime, t.config.timeSlotDuration)), b = C(() => Ce(t.events, t.currentDate)), g = (r) => { e("event-click", r); }, a = (r) => { e("date-click", r); }, $ = (r) => { const l = t.currentDate.hour(r.hour).minute(r.minute); e("time-slot-click", { date: l, slot: r }); }, _ = (r, l) => { s.value && l instanceof HTMLElement && (l.style.opacity = "0.5", l.style.transform = "rotate(3deg)", y(r, l)); }, E = (r) => { s.value && (document.querySelectorAll(".drag-highlight").forEach((l) => { l.classList.remove("drag-highlight"); }), document.querySelectorAll('[style*="opacity: 0.5"]').forEach((l) => { const u = l; u.style.opacity = "", u.style.transform = ""; }), w(r)); }, c = (r) => { if (r.preventDefault(), !s.value) return; r.currentTarget.classList.add("drag-highlight"); }, L = (r) => { r.currentTarget.classList.remove("drag-highlight"); }, S = (r) => { if (r.preventDefault(), !s.value) return; r.currentTarget.classList.add("drag-highlight-slot"); }, O = (r) => { r.currentTarget.classList.remove("drag-highlight-slot"); }; return (r, l) => (D(), M("div", Un, [ V("div", { class: G(["day-header", { "show-time-grid": r.config.showTimeGrid, "hide-time-grid": !r.config.showTimeGrid }]) }, [ r.config.showTimeGrid ? (D(), M("div", Gn)) : I("", !0), V("div", { class: G(["day-header-content", { today: m(Te)(r.currentDate), weekend: m(Ye)(r.currentDate) }]), onClick: l[0] || (l[0] = (u) => a({ date: r.currentDate, nativeEvent: u })) }, [ V("div", jn, x(r.currentDate.format("dddd")), 1) ], 2) ], 2), V("div", { class: G(["day-body", { "show-time-grid": r.config.showTimeGrid, "hide-time-grid": !r.config.showTimeGrid }]), onDrop: l[1] || (l[1] = (u) => E(r.currentDate.s