vue-cal 5.0.1-rc.1 → 5.0.1-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- import { computed as $, reactive as _e, watch as oe, toRefs as xe, ref as ie, onBeforeUnmount as Ne, inject as Se, createElementBlock as j, openBlock as Y, renderSlot as F, createCommentVNode as Z, unref as V, Fragment as ae, renderList as he, normalizeClass as ye, createElementVNode as de, createVNode as Me, Transition as ze, withCtx as q, createBlock as ke, resolveDynamicComponent as Re, mergeProps as me, toHandlers as je, normalizeProps as ne, guardReactiveProps as se, toDisplayString as le, onMounted as We, onUnmounted as et, withModifiers as Xe, nextTick as Ue, normalizeStyle as pe, createTextVNode as Ge, TransitionGroup as Ze, createSlots as $e, useTemplateRef as tt, useId as at, useAttrs as nt, provide as st } from "vue";
1
+ import { computed as M, reactive as _e, watch as de, toRefs as xe, ref as ue, onBeforeUnmount as ze, inject as Se, createElementBlock as j, openBlock as Y, renderSlot as F, createCommentVNode as Z, unref as C, Fragment as se, renderList as De, normalizeClass as we, createElementVNode as me, createVNode as Me, Transition as He, withCtx as q, createBlock as be, resolveDynamicComponent as Xe, mergeProps as ge, toHandlers as je, normalizeProps as ne, guardReactiveProps as le, toDisplayString as re, onMounted as Ae, withModifiers as Ge, nextTick as We, normalizeStyle as ke, createTextVNode as Ze, TransitionGroup as qe, createSlots as $e, useTemplateRef as et, useId as tt, useAttrs as at, provide as st } from "vue";
2
2
  /**
3
- * vue-cal v5.0.1-rc.1
3
+ * vue-cal v5.0.1-rc.3
4
4
  * (c) 2024-2025 Antoni Andre <antoniandre.web@gmail.com>
5
5
  * @license MIT
6
6
  */
7
- const ce = {
7
+ const ve = {
8
8
  texts: {
9
9
  weekDays: Array(7).fill(""),
10
10
  weekDaysShort: [],
@@ -33,348 +33,348 @@ const ce = {
33
33
  years: { cols: 5, rows: 5 }
34
34
  // Arbitrary range of quarters of century (25y).
35
35
  }
36
- }, lt = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], Pe = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"], rt = Pe.reduce((c, a, r) => (c[a] = r || 7, c), {}), it = (c, a, r) => {
37
- const { dateUtils: h } = c, w = !1, _ = $(() => {
38
- if (W.value[a.view]) return a.view;
36
+ }, nt = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], Pe = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"], lt = Pe.reduce((c, s, i) => (c[s] = i || 7, c), {}), rt = (c, s, i) => {
37
+ const { dateUtils: D } = c, w = !1, _ = M(() => {
38
+ if (W.value[s.view]) return s.view;
39
39
  {
40
- const s = a.datePicker ? "month" : "week", y = a.view || s;
41
- return W.value[y] ? y : (console.warn(
42
- `Vue Cal: the provided or default view \`${y}\` is either invalid or not in the list of available views. The first available view will be chosen: \`${Object.keys(W.value)[0]}\`.`
40
+ const l = s.datePicker ? "month" : "week", n = s.view || l;
41
+ return W.value[n] ? n : (console.warn(
42
+ `Vue Cal: the provided or default view \`${n}\` is either invalid or not in the list of available views. The first available view will be chosen: \`${Object.keys(W.value)[0]}\`.`
43
43
  ), Object.keys(W.value)[0]);
44
44
  }
45
- }), L = $(() => a.sm && !a.xs), f = $(() => a.xs || a.datePicker), O = $(() => a.clickToNavigate || a.datePicker && a.clickToNavigate !== !1), o = $(() => {
46
- const s = {
45
+ }), L = M(() => s.sm && !s.xs), g = M(() => s.xs || s.datePicker), V = M(() => s.clickToNavigate || s.datePicker && s.clickToNavigate !== !1), o = M(() => {
46
+ const l = {
47
47
  cell: {},
48
48
  // All possible event listeners to attach to cells.
49
49
  event: {}
50
50
  // All possible event listeners to attach to calendar events.
51
- }, y = (T) => T.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
52
- return Object.entries(r).forEach(([T, t]) => {
53
- const [P, A, J] = T.match(/^on(Cell|Event)(.+)$/) || [];
54
- P && (s[A.toLowerCase()][y(J).replace(/^-+|-+$/g, "")] = t);
55
- }), s;
56
- }), m = $(() => {
57
- var y;
58
- const s = {};
59
- return a.hideWeekends && (s[6] = !0) && (s[7] = !0), (y = a.hideWeekdays) != null && y.length && a.hideWeekdays.forEach((T) => s[rt[T]] = !0), s;
60
- }), b = $(() => a.hideWeekends || m.value[6] && m.value[7]), W = $(() => {
61
- const s = a.datePicker;
62
- let y = 0, T = {};
63
- const t = a.views;
64
- return s && !t ? {
65
- month: { ...ce.availableViews.month },
66
- year: { ...ce.availableViews.year },
67
- years: { ...ce.availableViews.years }
68
- } : (t ? (Array.isArray(t) ? T = t.reduce((P, A) => (typeof A == "string" && ce.availableViews[A] ? P[A] = ce.availableViews[A] : y++, P), {}) : typeof t == "object" && (T = Object.entries(t).reduce((P, [A, J]) => {
69
- const { cols: re, rows: x } = ce.availableViews[A];
70
- return P[A] = { cols: J.cols || re, rows: J.rows || x }, P;
71
- }, {})), y && console.warn("Vue Cal: the provided `views` prop contains invalid views that will be ignored."), Object.keys(T).length || (console.warn("Vue Cal: No valid view in the provided `views` prop. Falling back to default views."), T = { ...ce.availableViews })) : T = { ...ce.availableViews }, T);
72
- }), R = $(() => a.datePicker ? "month" : W.value.week ? "week" : Object.keys(W.value)[0]), u = $(() => {
73
- if (typeof a.selectedDate == "string") return h.stringToDate(a.selectedDate);
74
- if (a.selectedDate instanceof Date) return a.selectedDate;
75
- a.selectedDate ? console.warn("Vue Cal: The provided selected date is invalid:", a.selectedDate) : console.log("Vue Cal: Info - The provided selected date is undefined.");
76
- }), d = $(() => {
77
- if (!a.disableDays) return [];
78
- const s = [];
79
- return Array.isArray(a.disableDays) ? a.disableDays.forEach((y) => {
80
- let T = y;
81
- if (typeof y == "string" ? T = h.stringToDate(y) : y instanceof Date && (y = h.formatDate(y, "YYYY-MM-DD")), T instanceof Date && !isNaN(T.getTime())) {
82
- s.push(y);
51
+ }, n = (k) => k.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
52
+ return Object.entries(i).forEach(([k, t]) => {
53
+ const [O, z, R] = k.match(/^on(Cell|Event)(.+)$/) || [];
54
+ O && (l[z.toLowerCase()][n(R).replace(/^-+|-+$/g, "")] = t);
55
+ }), l;
56
+ }), f = M(() => {
57
+ var n;
58
+ const l = {};
59
+ return s.hideWeekends && (l[6] = !0) && (l[7] = !0), (n = s.hideWeekdays) != null && n.length && s.hideWeekdays.forEach((k) => l[lt[k]] = !0), l;
60
+ }), b = M(() => s.hideWeekends || f.value[6] && f.value[7]), W = M(() => {
61
+ const l = s.datePicker;
62
+ let n = 0, k = {};
63
+ const t = s.views;
64
+ return l && !t ? {
65
+ month: { ...ve.availableViews.month },
66
+ year: { ...ve.availableViews.year },
67
+ years: { ...ve.availableViews.years }
68
+ } : (t ? (Array.isArray(t) ? k = t.reduce((O, z) => (typeof z == "string" && ve.availableViews[z] ? O[z] = ve.availableViews[z] : n++, O), {}) : typeof t == "object" && (k = Object.entries(t).reduce((O, [z, R]) => {
69
+ const { cols: Q, rows: ee } = ve.availableViews[z];
70
+ return O[z] = { cols: R.cols || Q, rows: R.rows || ee }, O;
71
+ }, {})), n && console.warn("Vue Cal: the provided `views` prop contains invalid views that will be ignored."), Object.keys(k).length || (console.warn("Vue Cal: No valid view in the provided `views` prop. Falling back to default views."), k = { ...ve.availableViews })) : k = { ...ve.availableViews }, k);
72
+ }), X = M(() => s.datePicker ? "month" : W.value.week ? "week" : Object.keys(W.value)[0]), u = M(() => {
73
+ if (typeof s.selectedDate == "string") return D.stringToDate(s.selectedDate);
74
+ if (s.selectedDate instanceof Date) return s.selectedDate;
75
+ s.selectedDate ? console.warn("Vue Cal: The provided selected date is invalid:", s.selectedDate) : console.log("Vue Cal: Info - The provided selected date is undefined.");
76
+ }), d = M(() => {
77
+ if (!s.disableDays) return [];
78
+ const l = [];
79
+ return Array.isArray(s.disableDays) ? s.disableDays.forEach((n) => {
80
+ let k = n;
81
+ if (typeof n == "string" ? k = D.stringToDate(n) : n instanceof Date && (n = D.formatDate(n, "YYYY-MM-DD")), k instanceof Date && !isNaN(k.getTime())) {
82
+ l.push(n);
83
83
  return;
84
- } else console.warn("Vue Cal: The provided `disableDays` prop contains an invalid date:", y);
85
- }) : console.warn("Vue Cal: The provided `disableDays` prop is invalid:", a.disableDays), s;
86
- }), e = $(() => {
87
- let s = null;
88
- return a.minDate && typeof a.minDate == "string" ? s = h.stringToDate(a.minDate) : a.minDate && a.minDate instanceof Date && (s = a.minDate), (s == null ? void 0 : s.getTime()) || null;
89
- }), i = $(() => {
90
- let s = null;
91
- return a.maxDate && typeof a.maxDate == "string" ? s = h.stringToDate(a.maxDate) : a.maxDate && a.maxDate instanceof Date && (s = a.maxDate), (s == null ? void 0 : s.getTime()) || null;
92
- }), D = $(() => {
93
- var T;
94
- const { view: s } = c;
95
- return a.schedules.length && (s.isDay || s.isDays || s.isWeek) && ((T = a.schedules) == null ? void 0 : T.map((t, P) => ({ ...t, id: t.id ?? P + 1 }))) || void 0;
96
- }), S = $(() => {
97
- const s = {
84
+ } else console.warn("Vue Cal: The provided `disableDays` prop contains an invalid date:", n);
85
+ }) : console.warn("Vue Cal: The provided `disableDays` prop is invalid:", s.disableDays), l;
86
+ }), e = M(() => {
87
+ let l = null;
88
+ return s.minDate && typeof s.minDate == "string" ? l = D.stringToDate(s.minDate) : s.minDate && s.minDate instanceof Date && (l = s.minDate), (l == null ? void 0 : l.getTime()) || null;
89
+ }), v = M(() => {
90
+ let l = null;
91
+ return s.maxDate && typeof s.maxDate == "string" ? l = D.stringToDate(s.maxDate) : s.maxDate && s.maxDate instanceof Date && (l = s.maxDate), (l == null ? void 0 : l.getTime()) || null;
92
+ }), y = M(() => {
93
+ var k;
94
+ const { view: l } = c;
95
+ return s.schedules.length && (l.isDay || l.isDays || l.isWeek) && ((k = s.schedules) == null ? void 0 : k.map((t, O) => ({ ...t, id: t.id ?? O + 1 }))) || void 0;
96
+ }), E = M(() => {
97
+ const l = {
98
98
  drag: !0,
99
99
  resize: !0,
100
100
  delete: !0,
101
101
  create: !0
102
102
  };
103
- return a.editableEvents === !0 ? s : a.editableEvents === !1 ? Object.keys(s).map((y) => s[y] = !1) : { ...s, ...a.editableEvents };
104
- }), H = async (s) => {
105
- var T;
106
- let y = /* @__PURE__ */ Object.assign({ "../i18n/ar.json": () => import("./i18n/ar.json").then((t) => t.default), "../i18n/bg.json": () => import("./i18n/bg.json").then((t) => t.default), "../i18n/bn.json": () => import("./i18n/bn.json").then((t) => t.default), "../i18n/bs.json": () => import("./i18n/bs.json").then((t) => t.default), "../i18n/ca.json": () => import("./i18n/ca.json").then((t) => t.default), "../i18n/cs.json": () => import("./i18n/cs.json").then((t) => t.default), "../i18n/da.json": () => import("./i18n/da.json").then((t) => t.default), "../i18n/de.json": () => import("./i18n/de.json").then((t) => t.default), "../i18n/el.json": () => import("./i18n/el.json").then((t) => t.default), "../i18n/en-gb.json": () => import("./i18n/en-gb.json").then((t) => t.default), "../i18n/en-us.json": () => import("./i18n/en-us.json").then((t) => t.default), "../i18n/es.json": () => import("./i18n/es.json").then((t) => t.default), "../i18n/et.json": () => import("./i18n/et.json").then((t) => t.default), "../i18n/fa.json": () => import("./i18n/fa.json").then((t) => t.default), "../i18n/fi.json": () => import("./i18n/fi.json").then((t) => t.default), "../i18n/fr.json": () => import("./i18n/fr.json").then((t) => t.default), "../i18n/he.json": () => import("./i18n/he.json").then((t) => t.default), "../i18n/hr.json": () => import("./i18n/hr.json").then((t) => t.default), "../i18n/hu.json": () => import("./i18n/hu.json").then((t) => t.default), "../i18n/id.json": () => import("./i18n/id.json").then((t) => t.default), "../i18n/is.json": () => import("./i18n/is.json").then((t) => t.default), "../i18n/it.json": () => import("./i18n/it.json").then((t) => t.default), "../i18n/ja.json": () => import("./i18n/ja.json").then((t) => t.default), "../i18n/ka.json": () => import("./i18n/ka.json").then((t) => t.default), "../i18n/ko.json": () => import("./i18n/ko.json").then((t) => t.default), "../i18n/lt.json": () => import("./i18n/lt.json").then((t) => t.default), "../i18n/mn.json": () => import("./i18n/mn.json").then((t) => t.default), "../i18n/nl.json": () => import("./i18n/nl.json").then((t) => t.default), "../i18n/no.json": () => import("./i18n/no.json").then((t) => t.default), "../i18n/pl.json": () => import("./i18n/pl.json").then((t) => t.default), "../i18n/pt-br.json": () => import("./i18n/pt-br.json").then((t) => t.default), "../i18n/pt-pt.json": () => import("./i18n/pt-pt.json").then((t) => t.default), "../i18n/ro.json": () => import("./i18n/ro.json").then((t) => t.default), "../i18n/ru.json": () => import("./i18n/ru.json").then((t) => t.default), "../i18n/sk.json": () => import("./i18n/sk.json").then((t) => t.default), "../i18n/sl.json": () => import("./i18n/sl.json").then((t) => t.default), "../i18n/sq.json": () => import("./i18n/sq.json").then((t) => t.default), "../i18n/sr.json": () => import("./i18n/sr.json").then((t) => t.default), "../i18n/sv.json": () => import("./i18n/sv.json").then((t) => t.default), "../i18n/tr.json": () => import("./i18n/tr.json").then((t) => t.default), "../i18n/uk.json": () => import("./i18n/uk.json").then((t) => t.default), "../i18n/vi.json": () => import("./i18n/vi.json").then((t) => t.default), "../i18n/zh-cn.json": () => import("./i18n/zh-cn.json").then((t) => t.default), "../i18n/zh-hk.json": () => import("./i18n/zh-hk.json").then((t) => t.default) });
103
+ return s.editableEvents === !0 ? l : s.editableEvents === !1 ? Object.keys(l).map((n) => l[n] = !1) : { ...l, ...s.editableEvents };
104
+ }), H = async (l) => {
105
+ var k;
106
+ let n = /* @__PURE__ */ Object.assign({ "../i18n/ar.json": () => import("./i18n/ar.json").then((t) => t.default), "../i18n/bg.json": () => import("./i18n/bg.json").then((t) => t.default), "../i18n/bn.json": () => import("./i18n/bn.json").then((t) => t.default), "../i18n/bs.json": () => import("./i18n/bs.json").then((t) => t.default), "../i18n/ca.json": () => import("./i18n/ca.json").then((t) => t.default), "../i18n/cs.json": () => import("./i18n/cs.json").then((t) => t.default), "../i18n/da.json": () => import("./i18n/da.json").then((t) => t.default), "../i18n/de.json": () => import("./i18n/de.json").then((t) => t.default), "../i18n/el.json": () => import("./i18n/el.json").then((t) => t.default), "../i18n/en-gb.json": () => import("./i18n/en-gb.json").then((t) => t.default), "../i18n/en-us.json": () => import("./i18n/en-us.json").then((t) => t.default), "../i18n/es.json": () => import("./i18n/es.json").then((t) => t.default), "../i18n/et.json": () => import("./i18n/et.json").then((t) => t.default), "../i18n/fa.json": () => import("./i18n/fa.json").then((t) => t.default), "../i18n/fi.json": () => import("./i18n/fi.json").then((t) => t.default), "../i18n/fr.json": () => import("./i18n/fr.json").then((t) => t.default), "../i18n/he.json": () => import("./i18n/he.json").then((t) => t.default), "../i18n/hr.json": () => import("./i18n/hr.json").then((t) => t.default), "../i18n/hu.json": () => import("./i18n/hu.json").then((t) => t.default), "../i18n/id.json": () => import("./i18n/id.json").then((t) => t.default), "../i18n/is.json": () => import("./i18n/is.json").then((t) => t.default), "../i18n/it.json": () => import("./i18n/it.json").then((t) => t.default), "../i18n/ja.json": () => import("./i18n/ja.json").then((t) => t.default), "../i18n/ka.json": () => import("./i18n/ka.json").then((t) => t.default), "../i18n/ko.json": () => import("./i18n/ko.json").then((t) => t.default), "../i18n/lt.json": () => import("./i18n/lt.json").then((t) => t.default), "../i18n/mn.json": () => import("./i18n/mn.json").then((t) => t.default), "../i18n/nl.json": () => import("./i18n/nl.json").then((t) => t.default), "../i18n/no.json": () => import("./i18n/no.json").then((t) => t.default), "../i18n/pl.json": () => import("./i18n/pl.json").then((t) => t.default), "../i18n/pt-br.json": () => import("./i18n/pt-br.json").then((t) => t.default), "../i18n/pt-pt.json": () => import("./i18n/pt-pt.json").then((t) => t.default), "../i18n/ro.json": () => import("./i18n/ro.json").then((t) => t.default), "../i18n/ru.json": () => import("./i18n/ru.json").then((t) => t.default), "../i18n/sk.json": () => import("./i18n/sk.json").then((t) => t.default), "../i18n/sl.json": () => import("./i18n/sl.json").then((t) => t.default), "../i18n/sq.json": () => import("./i18n/sq.json").then((t) => t.default), "../i18n/sr.json": () => import("./i18n/sr.json").then((t) => t.default), "../i18n/sv.json": () => import("./i18n/sv.json").then((t) => t.default), "../i18n/tr.json": () => import("./i18n/tr.json").then((t) => t.default), "../i18n/uk.json": () => import("./i18n/uk.json").then((t) => t.default), "../i18n/vi.json": () => import("./i18n/vi.json").then((t) => t.default), "../i18n/zh-cn.json": () => import("./i18n/zh-cn.json").then((t) => t.default), "../i18n/zh-hk.json": () => import("./i18n/zh-hk.json").then((t) => t.default) });
107
107
  {
108
- if (!y[`../i18n/${s}.json`]) {
109
- console.warn(`Vue Cal: the locale \`${s}\` does not exist. Falling back to \`en-us\`.`), s = "en-us";
108
+ if (!n[`../i18n/${l}.json`]) {
109
+ console.warn(`Vue Cal: the locale \`${l}\` does not exist. Falling back to \`en-us\`.`), l = "en-us";
110
110
  return;
111
111
  }
112
- y = await ((T = y[`../i18n/${s}.json`]) == null ? void 0 : T.call(y));
112
+ n = await ((k = n[`../i18n/${l}.json`]) == null ? void 0 : k.call(n));
113
113
  }
114
- c.texts = Object.assign(c.texts, Object.assign({ ...ce.texts }, y)), h.updateTexts(c.texts);
114
+ c.texts = Object.assign(c.texts, Object.assign({ ...ve.texts }, n)), D.updateTexts(c.texts);
115
115
  };
116
- let k = _e(a.events || []);
117
- return oe(() => a.events, (s) => k.splice(0, k.length, ...s)), (a.locale || !c.texts.today) && H(a.locale || "en-us"), {
118
- ...xe(a),
119
- events: k,
116
+ let B = _e(s.events || []);
117
+ return de(() => s.events, (l) => B.splice(0, B.length, ...l)), (s.locale || !c.texts.today) && H(s.locale || "en-us"), {
118
+ ...xe(s),
119
+ events: B,
120
120
  // All the events listeners for cells and events that the end user may have attached to vue-cal.
121
121
  eventListeners: o,
122
- defaultView: R,
122
+ defaultView: X,
123
123
  availableViews: W,
124
124
  disableDays: d,
125
125
  ready: w,
126
126
  sm: L,
127
- xs: f,
128
- clickToNavigate: O,
129
- hideWeekdays: m,
127
+ xs: g,
128
+ clickToNavigate: V,
129
+ hideWeekdays: f,
130
130
  hideWeekends: b,
131
131
  minTimestamp: e,
132
- maxTimestamp: i,
133
- schedules: D,
132
+ maxTimestamp: v,
133
+ schedules: y,
134
134
  selectedDate: u,
135
- editableEvents: S,
135
+ editableEvents: E,
136
136
  view: _,
137
137
  // Getters.
138
138
  get hasHiddenDays() {
139
- return Object.keys(m.value).length;
139
+ return Object.keys(f.value).length;
140
140
  },
141
141
  get size() {
142
- return f.value ? "xs" : L.value ? "sm" : "lg";
142
+ return g.value ? "xs" : L.value ? "sm" : "lg";
143
143
  },
144
144
  loadTexts: H
145
145
  };
146
- }, Te = (c, a) => {
147
- const r = a.timeTo - a.timeFrom;
148
- return (c - a.timeFrom) * 100 / r;
149
- }, Ee = (c, a) => {
150
- const r = a.timeTo - a.timeFrom;
151
- return ~~(c * r / 100 + a.timeFrom);
152
- }, Ae = (c, a) => {
153
- const r = a.clientHeight;
154
- return c * 100 / r;
146
+ }, Te = (c, s) => {
147
+ const i = s.timeTo - s.timeFrom;
148
+ return (c - s.timeFrom) * 100 / i;
149
+ }, Ee = (c, s) => {
150
+ const i = s.timeTo - s.timeFrom;
151
+ return ~~(c * i / 100 + s.timeFrom);
152
+ }, Be = (c, s) => {
153
+ const i = s.clientHeight;
154
+ return c * 100 / i;
155
155
  }, Oe = _e({ id: null, date: null });
156
- let qe = !1, Fe = !0;
157
- const ge = _e({ el: null, cell: null, timeout: null }), we = _e({
156
+ let Je = !1, Ne = !0;
157
+ const ye = _e({ el: null, cell: null, timeout: null }), pe = _e({
158
158
  eventId: null,
159
159
  fromVueCal: null,
160
160
  toVueCal: null
161
161
  });
162
- function ot(c) {
163
- const { config: a, view: r, eventsManager: h, emit: w, uid: _, dateUtils: L } = c, f = (e) => {
164
- var y;
165
- const { timeStep: i, timeCellHeight: D, timeFrom: S } = a, H = (((y = e.touches) == null ? void 0 : y[0]) || e).clientY, { top: k } = e.currentTarget.getBoundingClientRect(), s = H - k - ~~e.dataTransfer.getData("cursor-grab-at");
166
- return Ee(Ae(s, e.currentTarget), a);
167
- }, O = (e, i, D) => {
168
- const S = i.duration || o(i.start, i.end) || a.timeStep;
169
- let H = Math.max(f(e), 0);
170
- if (a.snapToInterval) {
171
- const T = H + a.snapToInterval / 2;
172
- H = T - T % a.snapToInterval;
162
+ function it(c) {
163
+ const { config: s, view: i, eventsManager: D, emit: w, uid: _, dateUtils: L } = c, g = (e) => {
164
+ var n;
165
+ const { timeStep: v, timeCellHeight: y, timeFrom: E } = s, H = (((n = e.touches) == null ? void 0 : n[0]) || e).clientY, { top: B } = e.currentTarget.getBoundingClientRect(), l = H - B - ~~e.dataTransfer.getData("cursor-grab-at");
166
+ return Ee(Be(l, e.currentTarget), s);
167
+ }, V = (e, v, y) => {
168
+ const E = v.duration || o(v.start, v.end) || s.timeStep;
169
+ let H = Math.max(g(e), 0);
170
+ if (s.snapToInterval) {
171
+ const k = H + s.snapToInterval / 2;
172
+ H = k - k % s.snapToInterval;
173
173
  }
174
- const k = new Date(new Date(D).setMinutes(H)), s = Math.min(H + S, 24 * 60), y = new Date(new Date(D).setMinutes(s));
175
- return { start: k, end: y };
176
- }, o = (e, i) => Math.round((i - e) / 6e4);
174
+ const B = new Date(new Date(y).setMinutes(H)), l = Math.min(H + E, 24 * 60), n = new Date(new Date(y).setMinutes(l));
175
+ return { start: B, end: n };
176
+ }, o = (e, v) => Math.round((v - e) / 6e4);
177
177
  return {
178
- eventDragStart: (e, i) => {
178
+ eventDragStart: (e, v) => {
179
179
  if (e.target.nodeType === 3 || c.touch.isResizingEvent) return e.preventDefault();
180
180
  e.dataTransfer.dropEffect = "move";
181
- const D = { ...i, _: { id: i._.id, duration: o(i.start, i.end) } };
182
- e.dataTransfer.setData("event", JSON.stringify(D)), e.dataTransfer.setData("cursor-grab-at", e.offsetY), we.eventId = i._.id, we.fromVueCal = _;
183
- const S = e.target.closest(".vuecal__event");
184
- S.classList.add("vuecal__event--dragging-ghost"), setTimeout(() => {
185
- S.classList.add("vuecal__event--dragging-original"), S.classList.remove("vuecal__event--dragging-ghost");
186
- }, 0), qe = !1, Object.assign(Oe, { id: r.id, date: r.firstCellDate }), Fe = !0, c.touch.isDraggingEvent = !0;
181
+ const y = { ...v, _: { id: v._.id, duration: o(v.start, v.end) } };
182
+ e.dataTransfer.setData("event", JSON.stringify(y)), e.dataTransfer.setData("cursor-grab-at", e.offsetY), pe.eventId = v._.id, pe.fromVueCal = _;
183
+ const E = e.target.closest(".vuecal__event");
184
+ E.classList.add("vuecal__event--dragging-ghost"), setTimeout(() => {
185
+ E.classList.add("vuecal__event--dragging-original"), E.classList.remove("vuecal__event--dragging-ghost");
186
+ }, 0), Je = !1, Object.assign(Oe, { id: i.id, date: i.firstCellDate }), Ne = !0, c.touch.isDraggingEvent = !0;
187
187
  },
188
- eventDragEnd: (e, i) => {
189
- we.eventId = null, e.target.closest(".vuecal__event").classList.remove("vuecal__event--dragging-original");
190
- const { fromVueCal: D, toVueCal: S } = we;
191
- S && D !== S && h.deleteEvent(i._.id, 3), we.fromVueCal = null, we.toVueCal = null, qe && Fe && Oe.id && r.switchView(Oe.id, Oe.date, !0), c.touch.isDraggingEvent = !1;
188
+ eventDragEnd: (e, v) => {
189
+ pe.eventId = null, e.target.closest(".vuecal__event").classList.remove("vuecal__event--dragging-original");
190
+ const { fromVueCal: y, toVueCal: E } = pe;
191
+ E && y !== E && D.deleteEvent(v._.id, 3), pe.fromVueCal = null, pe.toVueCal = null, Je && Ne && Oe.id && i.switchView(Oe.id, Oe.date, !0), c.touch.isDraggingEvent = !1;
192
192
  },
193
- cellDragEnter: (e, i) => {
194
- const { start: D } = i, S = e.currentTarget;
193
+ cellDragEnter: (e, v) => {
194
+ const { start: y } = v, E = e.currentTarget;
195
195
  if (!e.currentTarget.contains(e.relatedTarget)) {
196
- if (S === ge.el || !S.className.includes("vuecal__cell-content")) return !1;
197
- ge.el && (ge.cell.highlighted = !1), Object.assign(ge, { el: S, cell: i, timeout: clearTimeout(ge.timeout) }), i.highlighted = !0, ["years", "year", "month"].includes(r.id) && (ge.timeout = setTimeout(() => c.switchToNarrowerView(D), 2e3));
196
+ if (E === ye.el || !E.className.includes("vuecal__cell-content")) return !1;
197
+ ye.el && (ye.cell.highlighted = !1), Object.assign(ye, { el: E, cell: v, timeout: clearTimeout(ye.timeout) }), v.highlighted = !0, ["years", "year", "month"].includes(i.id) && (ye.timeout = setTimeout(() => c.switchToNarrowerView(y), 2e3));
198
198
  }
199
199
  },
200
- cellDragOver: (e, i) => {
201
- const { start: D, schedule: S } = i;
202
- e.preventDefault(), i.highlighted = !0, (S || S === 0) && (i.highlightedSchedule = S);
200
+ cellDragOver: (e, v) => {
201
+ const { start: y, schedule: E } = v;
202
+ e.preventDefault(), v.highlighted = !0, (E || E === 0) && (v.highlightedSchedule = E);
203
203
  },
204
- cellDragLeave: (e, i) => {
205
- e.preventDefault(), !e.currentTarget.contains(e.relatedTarget) && (i.highlightedSchedule = !1, ge.cell === i && (clearTimeout(ge.timeout), Object.assign(ge, { el: null, cell: null, timeout: null }), i.highlighted = !1));
204
+ cellDragLeave: (e, v) => {
205
+ e.preventDefault(), !e.currentTarget.contains(e.relatedTarget) && (v.highlightedSchedule = !1, ye.cell === v && (clearTimeout(ye.timeout), Object.assign(ye, { el: null, cell: null, timeout: null }), v.highlighted = !1));
206
206
  },
207
- cellDragDrop: async (e, i) => {
208
- var P, A, J;
209
- e.preventDefault(), clearTimeout(ge.timeout), Object.assign(ge, { el: null, cell: null, timeout: null });
210
- const D = JSON.parse(e.dataTransfer.getData("event") || "{}");
211
- D.start && (D.start = new Date(D.start)), D.end && (D.end = new Date(D.end));
212
- let S;
213
- const { start: H, end: k } = O(e, D, i.start), { schedule: s } = ((P = e.target.closest("[data-schedule]")) == null ? void 0 : P.dataset) || {};
214
- let y = () => {
207
+ cellDragDrop: async (e, v) => {
208
+ var O, z, R;
209
+ e.preventDefault(), clearTimeout(ye.timeout), Object.assign(ye, { el: null, cell: null, timeout: null });
210
+ const y = JSON.parse(e.dataTransfer.getData("event") || "{}");
211
+ y.start && (y.start = new Date(y.start)), y.end && (y.end = new Date(y.end));
212
+ let E;
213
+ const { start: H, end: B } = V(e, y, v.start), { schedule: l } = ((O = e.target.closest("[data-schedule]")) == null ? void 0 : O.dataset) || {};
214
+ let n = () => {
215
215
  };
216
- we.fromVueCal === _ ? (S = h.getEvent(D._.id), S && (S._.dragging = !1, y = () => {
217
- S.start = H, S.end = k, s !== void 0 && (S.schedule = ~~s);
218
- })) : (S = {
219
- ...D,
216
+ pe.fromVueCal === _ ? (E = D.getEvent(y._.id), E && (E._.dragging = !1, n = () => {
217
+ E.start = H, E.end = B, l !== void 0 && (E.schedule = ~~l);
218
+ })) : (E = {
219
+ ...y,
220
220
  start: H,
221
- end: k,
222
- ...s !== void 0 && { schedule: ~~s },
223
- _: { id: ((A = D._) == null ? void 0 : A.id) || D.id, duration: o(H, k) },
224
- getOverlappingEvents: () => h.getEventsInRange(
225
- h.getEventsByDate(L.formatDate(H), !0),
226
- { start: H, end: k },
227
- { schedule: ~~s }
221
+ end: B,
222
+ ...l !== void 0 && { schedule: ~~l },
223
+ _: { id: ((z = y._) == null ? void 0 : z.id) || y.id, duration: o(H, B) },
224
+ getOverlappingEvents: () => D.getEventsInRange(
225
+ D.getEventsByDate(L.formatDate(H), !0),
226
+ { start: H, end: B },
227
+ { schedule: ~~l }
228
228
  )
229
- }, y = () => {
230
- S = h.createEvent(S);
229
+ }, n = () => {
230
+ E = D.createEvent(E);
231
231
  });
232
- let T = !0;
233
- const { drop: t } = (J = a.eventListeners) == null ? void 0 : J.event;
234
- t && (T = await t({
232
+ let k = !0;
233
+ const { drop: t } = (R = s.eventListeners) == null ? void 0 : R.event;
234
+ t && (k = await t({
235
235
  e,
236
- event: { ...S, start: H, end: k, schedule: ~~s },
237
- overlaps: S.getOverlappingEvents({ start: H, end: k, schedule: ~~s }),
238
- cell: i,
239
- external: we.fromVueCal !== _
240
- })), T !== !1 && y(), i.highlighted = !1, i.highlightedSchedule = null, Fe = !1, we.toVueCal = _, w("event-dropped", { event: S, originalEvent: D, external: we.fromVueCal !== _ }), w("event-change", { event: S, originalEvent: D });
236
+ event: { ...E, start: H, end: B, schedule: ~~l },
237
+ overlaps: E.getOverlappingEvents({ start: H, end: B, schedule: ~~l }),
238
+ cell: v,
239
+ external: pe.fromVueCal !== _
240
+ })), k !== !1 && n(), v.highlighted = !1, v.highlightedSchedule = null, Ne = !1, pe.toVueCal = _, w("event-dropped", { event: E, originalEvent: y, external: pe.fromVueCal !== _ }), w("event-change", { event: E, originalEvent: y });
241
241
  }
242
242
  };
243
243
  }
244
244
  const Ke = (c) => {
245
- let a, r, h, w = {}, _ = {};
246
- const L = ie(c), f = () => {
247
- Date.prototype.addDays = function(n) {
248
- return b(this, n || 0);
249
- }, Date.prototype.subtractDays = function(n) {
250
- return W(this, n || 0);
251
- }, Date.prototype.addHours = function(n) {
252
- return R(this, n || 0);
253
- }, Date.prototype.subtractHours = function(n) {
254
- return u(this, n || 0);
255
- }, Date.prototype.addMinutes = function(n) {
256
- return d(this, n || 0);
257
- }, Date.prototype.subtractMinutes = function(n) {
258
- return e(this, n || 0);
245
+ let s, i, D, w = {}, _ = {};
246
+ const L = ue(c), g = () => {
247
+ Date.prototype.addDays = function(a) {
248
+ return b(this, a || 0);
249
+ }, Date.prototype.subtractDays = function(a) {
250
+ return W(this, a || 0);
251
+ }, Date.prototype.addHours = function(a) {
252
+ return X(this, a || 0);
253
+ }, Date.prototype.subtractHours = function(a) {
254
+ return u(this, a || 0);
255
+ }, Date.prototype.addMinutes = function(a) {
256
+ return d(this, a || 0);
257
+ }, Date.prototype.subtractMinutes = function(a) {
258
+ return e(this, a || 0);
259
259
  }, Date.prototype.getWeek = function() {
260
- return D(this);
260
+ return y(this);
261
261
  }, Date.prototype.isToday = function() {
262
- return S(this);
262
+ return E(this);
263
263
  }, Date.prototype.isLeapYear = function() {
264
- return s(this);
265
- }, Date.prototype.format = function(n = "YYYY-MM-DD") {
266
- return re(this, n);
267
- }, Date.prototype.formatTime = function(n = "HH:mm") {
268
- return be(this, n);
264
+ return l(this);
265
+ }, Date.prototype.format = function(a = "YYYY-MM-DD") {
266
+ return Q(this, a);
267
+ }, Date.prototype.formatTime = function(a = "HH:mm") {
268
+ return ie(this, a);
269
269
  };
270
- }, O = () => {
270
+ }, V = () => {
271
271
  delete Date.prototype.addDays, delete Date.prototype.subtractDays, delete Date.prototype.addHours, delete Date.prototype.subtractHours, delete Date.prototype.addMinutes, delete Date.prototype.subtractMinutes, delete Date.prototype.getWeek, delete Date.prototype.isToday, delete Date.prototype.isLeapYear, delete Date.prototype.format, delete Date.prototype.formatTime;
272
- }, o = (n) => L.value = n, m = () => (r !== (/* @__PURE__ */ new Date()).getDate() && (a = /* @__PURE__ */ new Date(), r = a.getDate(), h = `${a.getFullYear()}-${a.getMonth()}-${a.getDate()}`), h), b = (n, p) => {
273
- const v = new Date(n.valueOf());
274
- return v.setDate(v.getDate() + p), v;
275
- }, W = (n, p) => {
276
- const v = new Date(n.valueOf());
277
- return v.setDate(v.getDate() - p), v;
278
- }, R = (n, p) => {
279
- const v = new Date(n.valueOf());
280
- return v.setHours(v.getHours() + p), v;
281
- }, u = (n, p) => {
282
- const v = new Date(n.valueOf());
283
- return v.setHours(v.getHours() - p), v;
284
- }, d = (n, p) => {
285
- const v = new Date(n.valueOf());
286
- return v.setMinutes(v.getMinutes() + p), v;
287
- }, e = (n, p) => {
288
- const v = new Date(n.valueOf());
289
- return v.setMinutes(v.getMinutes() - p), v;
290
- }, i = (n, p) => {
291
- const v = (G) => {
292
- const K = G % p;
293
- return K !== 0 && (G += K >= p / 2 ? p - K : -K), G;
272
+ }, o = (a) => L.value = a, f = () => (i !== (/* @__PURE__ */ new Date()).getDate() && (s = /* @__PURE__ */ new Date(), i = s.getDate(), D = `${s.getFullYear()}-${s.getMonth()}-${s.getDate()}`), D), b = (a, p) => {
273
+ const m = new Date(a.valueOf());
274
+ return m.setDate(m.getDate() + p), m;
275
+ }, W = (a, p) => {
276
+ const m = new Date(a.valueOf());
277
+ return m.setDate(m.getDate() - p), m;
278
+ }, X = (a, p) => {
279
+ const m = new Date(a.valueOf());
280
+ return m.setHours(m.getHours() + p), m;
281
+ }, u = (a, p) => {
282
+ const m = new Date(a.valueOf());
283
+ return m.setHours(m.getHours() - p), m;
284
+ }, d = (a, p) => {
285
+ const m = new Date(a.valueOf());
286
+ return m.setMinutes(m.getMinutes() + p), m;
287
+ }, e = (a, p) => {
288
+ const m = new Date(a.valueOf());
289
+ return m.setMinutes(m.getMinutes() - p), m;
290
+ }, v = (a, p) => {
291
+ const m = (G) => {
292
+ const U = G % p;
293
+ return U !== 0 && (G += U >= p / 2 ? p - U : -U), G;
294
294
  };
295
- if (typeof n == "number") return v(n);
296
- if (n instanceof Date) {
297
- let G = v(n.getMinutes());
298
- G >= 60 && (n.setHours(n.getHours() + 1), G = 0), n.setMinutes(G, 0, 0);
295
+ if (typeof a == "number") return m(a);
296
+ if (a instanceof Date) {
297
+ let G = m(a.getMinutes());
298
+ G >= 60 && (a.setHours(a.getHours() + 1), G = 0), a.setMinutes(G, 0, 0);
299
299
  }
300
- }, D = (n, p = !1) => {
301
- const v = new Date(Date.UTC(n.getFullYear(), n.getMonth(), n.getDate())), G = v.getUTCDay() || 7;
302
- v.setUTCDate(v.getUTCDate() + 4 - G);
303
- const K = new Date(Date.UTC(v.getUTCFullYear(), 0, 1));
304
- return Math.ceil(((v - K) / 864e5 + 1) / 7) + (p ? 1 : 0);
305
- }, S = (n) => `${n.getFullYear()}-${n.getMonth()}-${n.getDate()}` === m(), H = (n, p) => {
306
- if (!n || !p) return console.warn(`Vue Cal: missing date${n ? "2" : "1"} parameter for comparison with \`isSameDate(date1, date2)\`.`);
307
- if (J(n)) {
308
- if (!J(p)) return console.warn(`Vue Cal: invalid date2 provided for comparison with \`isSameDate(date1, date2)\`: \`${p}\`.`);
309
- } else return console.warn(`Vue Cal: invalid date1 provided for comparison with \`isSameDate(date1, date2)\`: \`${n}\`.`);
310
- return n.getFullYear() === p.getFullYear() && n.getMonth() === p.getMonth() && n.getDate() === p.getDate();
311
- }, k = (n, p, v) => J(n) ? n.getTime() >= p && n.getTime() <= v : console.warn(`Vue Cal: invalid date provided to \`isInRange(date, rangeStart, rangeEnd)\`: \`${n}\`.`), s = (n) => {
312
- const p = n.getFullYear();
300
+ }, y = (a, p = !1) => {
301
+ const m = new Date(Date.UTC(a.getFullYear(), a.getMonth(), a.getDate())), G = m.getUTCDay() || 7;
302
+ m.setUTCDate(m.getUTCDate() + 4 - G);
303
+ const U = new Date(Date.UTC(m.getUTCFullYear(), 0, 1));
304
+ return Math.ceil(((m - U) / 864e5 + 1) / 7) + (p ? 1 : 0);
305
+ }, E = (a) => `${a.getFullYear()}-${a.getMonth()}-${a.getDate()}` === f(), H = (a, p) => {
306
+ if (!a || !p) return console.warn(`Vue Cal: missing date${a ? "2" : "1"} parameter for comparison with \`isSameDate(date1, date2)\`.`);
307
+ if (R(a)) {
308
+ if (!R(p)) return console.warn(`Vue Cal: invalid date2 provided for comparison with \`isSameDate(date1, date2)\`: \`${p}\`.`);
309
+ } else return console.warn(`Vue Cal: invalid date1 provided for comparison with \`isSameDate(date1, date2)\`: \`${a}\`.`);
310
+ return a.getFullYear() === p.getFullYear() && a.getMonth() === p.getMonth() && a.getDate() === p.getDate();
311
+ }, B = (a, p, m) => R(a) ? a.getTime() >= p && a.getTime() <= m : console.warn(`Vue Cal: invalid date provided to \`isInRange(date, rangeStart, rangeEnd)\`: \`${a}\`.`), l = (a) => {
312
+ const p = a.getFullYear();
313
313
  return !(p % 400) || p % 100 && !(p % 4);
314
- }, y = (n = null, p) => {
315
- const v = n && new Date(n.valueOf()) || /* @__PURE__ */ new Date(), G = p ? 7 : 6;
316
- return v.setDate(v.getDate() - (v.getDay() + G) % 7), v;
317
- }, T = (n) => n instanceof Date ? n : (n.length === 10 && (n += " 00:00"), new Date(n.replace(/-/g, "/"))), t = (n) => n.getHours() * 60 + n.getMinutes(), P = (n, p) => {
318
- typeof n == "string" && (n = n.replace(/-/g, "/")), typeof p == "string" && (p = p.replace(/-/g, "/")), n = new Date(n).setHours(0, 0, 0, 0), p = new Date(p).setHours(0, 0, 1, 0);
319
- const v = (new Date(p).getTimezoneOffset() - new Date(n).getTimezoneOffset()) * 60 * 1e3;
320
- return Math.ceil((p - n - v) / (24 * 3600 * 1e3));
321
- }, A = (n, p, v) => Math.abs(n.getTime() - p.getTime()) <= v * 60 * 1e3, J = (n) => n && n instanceof Date && !isNaN(n), re = (n, p = "YYYY-MM-DD", v = null) => {
322
- if (v || (v = L.value), p || (p = "YYYY-MM-DD"), p === "YYYY-MM-DD") return x(n);
314
+ }, n = (a = null, p) => {
315
+ const m = a && new Date(a.valueOf()) || /* @__PURE__ */ new Date(), G = p ? 7 : 6;
316
+ return m.setDate(m.getDate() - (m.getDay() + G) % 7), m;
317
+ }, k = (a) => a instanceof Date ? a : (a.length === 10 && (a += " 00:00"), new Date(a.replace(/-/g, "/"))), t = (a) => a.getHours() * 60 + a.getMinutes(), O = (a, p) => {
318
+ typeof a == "string" && (a = a.replace(/-/g, "/")), typeof p == "string" && (p = p.replace(/-/g, "/")), a = new Date(a).setHours(0, 0, 0, 0), p = new Date(p).setHours(0, 0, 1, 0);
319
+ const m = (new Date(p).getTimezoneOffset() - new Date(a).getTimezoneOffset()) * 60 * 1e3;
320
+ return Math.ceil((p - a - m) / (24 * 3600 * 1e3));
321
+ }, z = (a, p, m) => Math.abs(a.getTime() - p.getTime()) <= m * 60 * 1e3, R = (a) => a && a instanceof Date && !isNaN(a), Q = (a, p = "YYYY-MM-DD", m = null) => {
322
+ if (m || (m = L.value), p || (p = "YYYY-MM-DD"), p === "YYYY-MM-DD") return ee(a);
323
323
  w = {}, _ = {};
324
324
  const G = {
325
- YYYY: () => X(n, v).YYYY,
326
- YY: () => X(n, v).YY(),
327
- M: () => X(n, v).M,
328
- MM: () => X(n, v).MM(),
329
- MMM: () => X(n, v).MMM(),
330
- MMMM: () => X(n, v).MMMM(),
331
- MMMMG: () => X(n, v).MMMMG(),
332
- D: () => X(n, v).D,
333
- DD: () => X(n, v).DD(),
334
- S: () => X(n, v).S(),
335
- d: () => X(n, v).d,
336
- dd: () => X(n, v).dd(),
337
- ddd: () => X(n, v).ddd(),
338
- dddd: () => X(n, v).dddd(),
339
- HH: () => U(n, v).HH,
340
- H: () => U(n, v).H,
341
- hh: () => U(n, v).hh,
342
- h: () => U(n, v).h,
343
- am: () => U(n, v).am,
344
- AM: () => U(n, v).AM,
345
- mm: () => U(n, v).mm,
346
- m: () => U(n, v).m,
347
- s: () => U(n, v).s
325
+ YYYY: () => J(a, m).YYYY,
326
+ YY: () => J(a, m).YY(),
327
+ M: () => J(a, m).M,
328
+ MM: () => J(a, m).MM(),
329
+ MMM: () => J(a, m).MMM(),
330
+ MMMM: () => J(a, m).MMMM(),
331
+ MMMMG: () => J(a, m).MMMMG(),
332
+ D: () => J(a, m).D,
333
+ DD: () => J(a, m).DD(),
334
+ S: () => J(a, m).S(),
335
+ d: () => J(a, m).d,
336
+ dd: () => J(a, m).dd(),
337
+ ddd: () => J(a, m).ddd(),
338
+ dddd: () => J(a, m).dddd(),
339
+ HH: () => ce(a, m).HH,
340
+ H: () => ce(a, m).H,
341
+ hh: () => ce(a, m).hh,
342
+ h: () => ce(a, m).h,
343
+ am: () => ce(a, m).am,
344
+ AM: () => ce(a, m).AM,
345
+ mm: () => ce(a, m).mm,
346
+ m: () => ce(a, m).m,
347
+ s: () => ce(a, m).s
348
348
  };
349
- return p.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (K, ve) => {
350
- const l = G[ve.replace(/\{|\}/g, "")];
351
- return l !== void 0 ? l() : ve;
349
+ return p.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (U, fe) => {
350
+ const r = G[fe.replace(/\{|\}/g, "")];
351
+ return r !== void 0 ? r() : fe;
352
352
  });
353
- }, x = (n) => {
354
- const p = n.getMonth() + 1, v = n.getDate();
355
- return `${n.getFullYear()}-${p < 10 ? "0" : ""}${p}-${v < 10 ? "0" : ""}${v}`;
356
- }, be = (n, p = "HH:mm", v = null, G = !1) => {
357
- let K = !1;
353
+ }, ee = (a) => {
354
+ const p = a.getMonth() + 1, m = a.getDate();
355
+ return `${a.getFullYear()}-${p < 10 ? "0" : ""}${p}-${m < 10 ? "0" : ""}${m}`;
356
+ }, ie = (a, p = "HH:mm", m = null, G = !1) => {
357
+ let U = !1;
358
358
  if (G) {
359
- const [M, C, E] = [n.getHours(), n.getMinutes(), n.getSeconds()];
360
- M + C + E === 141 && (K = !0);
359
+ const [T, S, $] = [a.getHours(), a.getMinutes(), a.getSeconds()];
360
+ T + S + $ === 141 && (U = !0);
361
361
  }
362
- if (n instanceof Date && p === "HH:mm") return K ? "24:00" : ue(n);
363
- _ = {}, v || (v = L.value);
364
- const ve = U(n, v), l = p.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (M, C) => {
365
- const E = ve[C.replace(/\{|\}/g, "")];
366
- return E !== void 0 ? E : C;
362
+ if (a instanceof Date && p === "HH:mm") return U ? "24:00" : oe(a);
363
+ _ = {}, m || (m = L.value);
364
+ const fe = ce(a, m), r = p.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (T, S) => {
365
+ const $ = fe[S.replace(/\{|\}/g, "")];
366
+ return $ !== void 0 ? $ : S;
367
367
  });
368
- return K ? l.replace("23:59", "24:00") : l;
369
- }, ue = (n) => {
370
- const p = n.getHours(), v = n.getMinutes();
371
- return `${(p < 10 ? "0" : "") + p}:${(v < 10 ? "0" : "") + v}`;
372
- }, De = (n) => {
373
- const p = Math.floor(n / 60).toString().padStart(2, 0), v = (n % 60).toString().padStart(2, 0);
374
- return `${p}:${v}`;
375
- }, fe = (n) => {
376
- if (n > 3 && n < 21) return "th";
377
- switch (n % 10) {
368
+ return U ? r.replace("23:59", "24:00") : r;
369
+ }, oe = (a) => {
370
+ const p = a.getHours(), m = a.getMinutes();
371
+ return `${(p < 10 ? "0" : "") + p}:${(m < 10 ? "0" : "") + m}`;
372
+ }, he = (a) => {
373
+ const p = Math.floor(a / 60).toString().padStart(2, 0), m = (a % 60).toString().padStart(2, 0);
374
+ return `${p}:${m}`;
375
+ }, x = (a) => {
376
+ if (a > 3 && a < 21) return "th";
377
+ switch (a % 10) {
378
378
  case 1:
379
379
  return "st";
380
380
  case 2:
@@ -384,14 +384,14 @@ const Ke = (c) => {
384
384
  default:
385
385
  return "th";
386
386
  }
387
- }, X = (n, p) => {
387
+ }, J = (a, p) => {
388
388
  if (w.D) return w;
389
- const v = n.getFullYear(), G = n.getMonth() + 1, K = n.getDate(), l = (n.getDay() - 1 + 7) % 7;
389
+ const m = a.getFullYear(), G = a.getMonth() + 1, U = a.getDate(), r = (a.getDay() - 1 + 7) % 7;
390
390
  return w = {
391
391
  // Year.
392
- YYYY: v,
392
+ YYYY: m,
393
393
  // 2024.
394
- YY: () => v.toString().substring(2),
394
+ YY: () => m.toString().substring(2),
395
395
  // 24.
396
396
  // Month.
397
397
  M: G,
@@ -405,72 +405,72 @@ const Ke = (c) => {
405
405
  MMMMG: () => (p.monthsGenitive || p.months)[G - 1],
406
406
  // January to December in genitive form (Greek...)
407
407
  // Day.
408
- D: K,
408
+ D: U,
409
409
  // 1 to 31.
410
- DD: () => K.toString().padStart(2, 0),
410
+ DD: () => U.toString().padStart(2, 0),
411
411
  // 01 to 31.
412
- S: () => fe(K),
412
+ S: () => x(U),
413
413
  // st, nd, rd, th.
414
414
  // Day of the week.
415
- d: l + 1,
415
+ d: r + 1,
416
416
  // 1 to 7 with 7 = Sunday.
417
417
  // Some locales have same start for all the days, so they have specific abbrev in weekDaysShort.
418
- dd: () => p.weekDaysShort.length ? p.weekDaysShort[l] : p.weekDays[l][0],
418
+ dd: () => p.weekDaysShort.length ? p.weekDaysShort[r] : p.weekDays[r][0],
419
419
  // M to S.
420
- ddd: () => p.weekDaysShort.length ? p.weekDaysShort[l] : p.weekDays[l].substr(0, 3),
420
+ ddd: () => p.weekDaysShort.length ? p.weekDaysShort[r] : p.weekDays[r].substr(0, 3),
421
421
  // Mon to Sun.
422
- dddd: () => p.weekDays[l]
422
+ dddd: () => p.weekDays[r]
423
423
  // Monday to Sunday.
424
424
  }, w;
425
- }, U = (n, p) => {
425
+ }, ce = (a, p) => {
426
426
  if (_.am) return _;
427
- let v, G, K;
428
- n instanceof Date ? (v = n.getHours(), G = n.getMinutes(), K = n.getSeconds()) : (v = Math.floor(n / 60), G = Math.floor(n % 60));
429
- const ve = v % 12 ? v % 12 : 12, l = (p || { am: "am", pm: "pm" })[v === 24 || v < 12 ? "am" : "pm"];
427
+ let m, G, U;
428
+ a instanceof Date ? (m = a.getHours(), G = a.getMinutes(), U = a.getSeconds()) : (m = Math.floor(a / 60), G = Math.floor(a % 60));
429
+ const fe = m % 12 ? m % 12 : 12, r = (p || { am: "am", pm: "pm" })[m === 24 || m < 12 ? "am" : "pm"];
430
430
  return _ = {
431
- H: v,
432
- h: ve,
433
- HH: v.toString().padStart(2, 0),
434
- hh: ve.toString().padStart(2, 0),
435
- am: l,
436
- AM: l.toUpperCase(),
431
+ H: m,
432
+ h: fe,
433
+ HH: m.toString().padStart(2, 0),
434
+ hh: fe.toString().padStart(2, 0),
435
+ am: r,
436
+ AM: r.toUpperCase(),
437
437
  m: G,
438
438
  mm: G.toString().padStart(2, 0),
439
- s: K
439
+ s: U
440
440
  }, _;
441
441
  };
442
442
  return {
443
- addDatePrototypes: f,
444
- removeDatePrototypes: O,
443
+ addDatePrototypes: g,
444
+ removeDatePrototypes: V,
445
445
  updateTexts: o,
446
446
  addDays: b,
447
447
  subtractDays: W,
448
- addHours: R,
448
+ addHours: X,
449
449
  subtractHours: u,
450
450
  addMinutes: d,
451
451
  subtractMinutes: e,
452
- snapToInterval: i,
453
- getWeek: D,
454
- isToday: S,
452
+ snapToInterval: v,
453
+ getWeek: y,
454
+ isToday: E,
455
455
  isSameDate: H,
456
- isInRange: k,
457
- isLeapYear: s,
458
- getPreviousFirstDayOfWeek: y,
459
- stringToDate: T,
456
+ isInRange: B,
457
+ isLeapYear: l,
458
+ getPreviousFirstDayOfWeek: n,
459
+ stringToDate: k,
460
460
  dateToMinutes: t,
461
- countDays: P,
462
- datesInSameTimeStep: A,
463
- isValid: J,
464
- formatDate: re,
465
- formatDateLite: x,
466
- formatTime: be,
467
- formatTimeLite: ue,
468
- formatMinutes: De
461
+ countDays: O,
462
+ datesInSameTimeStep: z,
463
+ isValid: R,
464
+ formatDate: Q,
465
+ formatDateLite: ee,
466
+ formatTime: ie,
467
+ formatTimeLite: oe,
468
+ formatMinutes: he
469
469
  };
470
- }, ut = (c) => {
471
- const { dateUtils: a, config: r } = c;
472
- let h = 0;
473
- const w = $(() => {
470
+ }, ot = (c) => {
471
+ const { dateUtils: s, config: i } = c;
472
+ let D = 0;
473
+ const w = M(() => {
474
474
  const u = {
475
475
  byDate: {},
476
476
  // A map of single-day events indexed by date.
@@ -481,235 +481,240 @@ const Ke = (c) => {
481
481
  byId: {}
482
482
  // A map of all the events indexed by ID for fast lookup.
483
483
  };
484
- return r.events.sort((e, i) => e.start - i.start < 0 ? -1 : 1).forEach((e) => {
485
- _(e), e._ || (e._ = {}), e._.id = e._.id || ++h, e.delete || (e.delete = (i) => m(e._.id, i)), e._.deleting = !1, e._.deleted = !1, e.isOverlapping = (i = null) => e.getOverlappingEvents(i).length, e.getOverlappingEvents = (i = null) => {
486
- var D;
484
+ return i.events.sort((e, v) => e.start - v.start < 0 ? -1 : 1).forEach((e) => {
485
+ _(e), e._ || (e._ = {}), e._.id = e._.id || ++D, e.delete || (e.delete = (v) => f(e._.id, v)), e._.deleting = !1, e._.deleted = !1, e.isOverlapping = (v = null) => e.getOverlappingEvents(v).length, e.getOverlappingEvents = (v = null) => {
486
+ var y;
487
487
  return W(
488
- f(a.formatDate((i == null ? void 0 : i.start) || e.start), !0),
489
- { start: (i == null ? void 0 : i.start) || e.start, end: (i == null ? void 0 : i.end) || e.end },
490
- { excludeIds: [e._.id], schedule: (D = r.schedules) != null && D.length ? ~~((i == null ? void 0 : i.schedule) || e.schedule) : null }
488
+ g(s.formatDate((v == null ? void 0 : v.start) || e.start), !0),
489
+ { start: (v == null ? void 0 : v.start) || e.start, end: (v == null ? void 0 : v.end) || e.end },
490
+ { excludeIds: [e._.id], schedule: (y = i.schedules) != null && y.length ? ~~((v == null ? void 0 : v.schedule) || e.schedule) : null }
491
491
  );
492
- }, e._.register = (i) => {
493
- e._.$el = i, e._.fireCreated && (c.emit("event-created", e), delete e._.fireCreated);
494
- }, e._.unregister = () => e._.$el = null, u.byId[e._.id] = e, e.recurring ? u.recurring.push(e._.id) : e._.multiday ? (u.multiday.push(e._.id), u.byDate[e._.startFormatted] || (u.byDate[e._.startFormatted] = []), u.byDate[e._.startFormatted].push(e._.id)) : (u.byDate[e._.startFormatted] || (u.byDate[e._.startFormatted] = []), u.byDate[e._.startFormatted].push(e._.id));
492
+ }, e._.register = (v) => {
493
+ e._.$el = v, e._.fireCreated && (c.emit("event-created", e), delete e._.fireCreated);
494
+ }, e._.unregister = () => {
495
+ e._.$el = null, e._.register = null, e.isOverlapping = null, e.getOverlappingEvents = null, e.delete = null;
496
+ }, u.byId[e._.id] = e, e.recurring ? u.recurring.push(e._.id) : e._.multiday ? (u.multiday.push(e._.id), u.byDate[e._.startFormatted] || (u.byDate[e._.startFormatted] = []), u.byDate[e._.startFormatted].push(e._.id)) : (u.byDate[e._.startFormatted] || (u.byDate[e._.startFormatted] = []), u.byDate[e._.startFormatted].push(e._.id));
495
497
  }), u;
496
498
  }), _ = (u) => {
497
- if (typeof u.start == "string" && (u.start = a.stringToDate(u.start)), typeof u.end == "string" && (u.end = a.stringToDate(u.end)), u.start.setSeconds(0, 0), u.end.setSeconds(0, 0), isNaN(u.start) || isNaN(u.end)) {
499
+ if (typeof u.start == "string" && (u.start = s.stringToDate(u.start)), typeof u.end == "string" && (u.end = s.stringToDate(u.end)), u.start.setSeconds(0, 0), u.end.setSeconds(0, 0), isNaN(u.start) || isNaN(u.end)) {
498
500
  isNaN(u.start) ? console.error(`Vue Cal: invalid start date for event "${u.title}".`, u.start) : console.error(`Vue Cal: invalid end date for event "${u.title}".`, u.end);
499
501
  return;
500
502
  } else u.end.getTime() < u.start.getTime() && console.error(`Vue Cal: invalid event dates for event "${u.title}". The event ends before it starts.`, u.start, u.end);
501
- u._ || (u._ = {}), u._.multiday = !a.isSameDate(u.start, new Date(u.end.getTime() - 1)), u._.startFormatted = a.formatDate(u.start), u._.startMinutes = ~~a.dateToMinutes(u.start), u._.endMinutes = ~~a.dateToMinutes(u.end);
502
- const d = u.start.getHours(), e = u.start.getMinutes().toString().padStart(2, 0), i = u.end.getHours(), D = u.end.getMinutes().toString().padStart(2, 0);
503
- u._.startTimeFormatted24 = `${d.toString().padStart(2, 0)}:${e}`, u._.startTimeFormatted12 = `${d % 12 || 12}${e ? `:${e}` : ""} ${d < 12 ? "AM" : "PM"}`, u._.endTimeFormatted24 = `${i.toString().padStart(2, 0)}:${D}`, u._.endTimeFormatted12 = `${i % 12 || 12}${D ? `:${D}` : ""} ${i < 12 ? "AM" : "PM"}`, u._.duration = Math.abs(~~((u.end - u.start) / 6e4));
504
- }, L = (u) => w.value.byId[u], f = (u, d = !1, e = !1) => {
505
- let i = w.value.byDate[u] || [];
506
- return i = d || e ? i.map(L) : i, e || (i = i.filter((D) => !D.background), d || (i = i.map((D) => D._.id))), i;
507
- }, O = (u) => {
503
+ u._ || (u._ = {}), u._.multiday = !s.isSameDate(u.start, new Date(u.end.getTime() - 1)), u._.startFormatted = s.formatDate(u.start), u._.startMinutes = ~~s.dateToMinutes(u.start), u._.endMinutes = ~~s.dateToMinutes(u.end);
504
+ const d = u.start.getHours(), e = u.start.getMinutes().toString().padStart(2, 0), v = u.end.getHours(), y = u.end.getMinutes().toString().padStart(2, 0);
505
+ u._.startTimeFormatted24 = `${d.toString().padStart(2, 0)}:${e}`, u._.startTimeFormatted12 = `${d % 12 || 12}${e ? `:${e}` : ""} ${d < 12 ? "AM" : "PM"}`, u._.endTimeFormatted24 = `${v.toString().padStart(2, 0)}:${y}`, u._.endTimeFormatted12 = `${v % 12 || 12}${y ? `:${y}` : ""} ${v < 12 ? "AM" : "PM"}`, u._.duration = Math.abs(~~((u.end - u.start) / 6e4));
506
+ }, L = (u) => w.value.byId[u], g = (u, d = !1, e = !1) => {
507
+ let v = w.value.byDate[u] || [];
508
+ return v = d || e ? v.map(L) : v, e || (v = v.filter((y) => !y.background), d || (v = v.map((y) => y._.id))), v;
509
+ }, V = (u) => {
508
510
  const d = {};
509
511
  return u.forEach(({ startFormatted: e }) => {
510
512
  d[e] = [];
511
- const i = f(e, !1, !0);
512
- i.length && d[e].push(...i);
513
+ const v = g(e, !1, !0);
514
+ v.length && d[e].push(...v);
513
515
  }), d;
514
516
  }, o = (u) => {
515
517
  if (!u.start || !u.end) {
516
518
  console.error("Vue Cal: Cannot create an event without valid start and end dates.");
517
519
  return;
518
520
  }
519
- return r.snapToInterval && (a.snapToInterval(u.start, r.snapToInterval), a.snapToInterval(u.end, r.snapToInterval)), u._ || (u._ = {}), u._.id = ++h, u._.fireCreated = !0, r.events.push(u), u;
520
- }, m = (u, d = 0) => {
521
- var D;
522
- if (!r.editableEvents.delete) return;
523
- if (!u) return console.warn(`Vue Cal: Cannot delete unknown event \`${u}\`.`);
524
- const e = r.events.findIndex((S) => S._.id === u);
521
+ return i.snapToInterval && (s.snapToInterval(u.start, i.snapToInterval), s.snapToInterval(u.end, i.snapToInterval)), u = { ...u }, u._ || (u._ = {}), u._.id = ++D, u._.fireCreated = !0, i.events.push(u), u;
522
+ }, f = (u, d = 0) => {
523
+ var y;
524
+ if (!i.editableEvents.delete)
525
+ return console.info("Vue Cal: Event deletion is disabled. Enable it with the `editable-events` props.");
526
+ if (!u) return console.warn("Vue Cal: Cannot delete event without its ID.");
527
+ const e = i.events.findIndex((E) => E._.id === u);
525
528
  if (e === -1) return console.warn(`Vue Cal: Cannot delete unknown event \`${u}\`.`);
526
- const i = r.events[e];
527
- if (i.deletable === !1) return console.warn(`Vue Cal: Can't delete event \`${u}\` since it was explicitely set to \`delete: false\`.`);
529
+ const v = i.events[e];
530
+ if (v.deletable === !1) return console.warn(`Vue Cal: Can't delete event \`${u}\` since it was explicitely set to \`delete: false\`.`);
528
531
  switch (d) {
529
532
  case 0:
530
- i._.deleting ? i._.deleted ? r.events.splice(e, 1) : i._.deleted = !0 : i._.deleting = !0;
533
+ v._.deleting ? i.events.splice(e, 1) : v._.deleting = !0;
531
534
  break;
532
535
  // Display the delete button.
533
536
  case 1:
534
- i._.deleting = !0, r.events[e]._.deleting = !0;
537
+ v._.deleting = !0;
535
538
  break;
536
539
  // Visual deletion + external DOM event firing.
540
+ // When explicitly using this stage, the event will be visually deleted but still present in the
541
+ // source of truth until the cell is unmounted (by navigating away).
537
542
  case 2:
538
- i._.deleted = !0, r.events[e]._.deleted = !0, (D = i._.$el) == null || D.dispatchEvent(new CustomEvent("event-deleted", { detail: i._.id }));
543
+ v._.deleted = !0, i.events[e]._.deleted = !0, (y = v._.$el) == null || y.dispatchEvent(new CustomEvent("event-deleted", { detail: v._.id }));
539
544
  break;
540
545
  // Effective deletion from the source of truth (by default, when unmounting the cell).
541
546
  case 3:
542
- r.events.splice(e, 1), c.emit("update:events", r.events), c.emit("event-delete", i);
547
+ i.events.splice(e, 1), c.emit("update:events", i.events), c.emit("event-delete", v);
543
548
  break;
544
549
  }
545
550
  return !0;
546
551
  }, b = (u) => {
547
- const d = f(u, !0);
552
+ const d = g(u, !0);
548
553
  if (!d.length) return { cellOverlaps: {}, longestStreak: 0 };
549
- let e = {}, i = [], D = 0;
550
- d.sort((S, H) => S.start - H.start || S.end - S.start - (H.end - H.start));
551
- for (const S of d) {
552
- const H = S._.id;
553
- e[H] || (e[H] = { overlaps: /* @__PURE__ */ new Set(), maxConcurrent: 1, position: 0 }), i = i.filter((t) => t.end > S.start);
554
- let k = i.filter((t) => {
555
- var A;
556
- return (!((A = r.schedules) != null && A.length) || S.schedule === t.schedule) && t.start < S.end;
557
- }), s = new Set(k.map((t) => {
558
- var P;
559
- return ((P = e[t._.id]) == null ? void 0 : P.position) ?? 0;
560
- })), y = 0;
561
- for (; s.has(y); ) y++;
562
- e[H].position = y, i.push(S);
563
- let T = Math.max(1, ...k.map((t) => {
564
- var P;
565
- return ((P = e[t._.id]) == null ? void 0 : P.maxConcurrent) ?? 1;
554
+ let e = {}, v = [], y = 0;
555
+ d.sort((E, H) => E.start - H.start || E.end - E.start - (H.end - H.start));
556
+ for (const E of d) {
557
+ const H = E._.id;
558
+ e[H] || (e[H] = { overlaps: /* @__PURE__ */ new Set(), maxConcurrent: 1, position: 0 }), v = v.filter((t) => t.end > E.start);
559
+ let B = v.filter((t) => {
560
+ var z;
561
+ return (!((z = i.schedules) != null && z.length) || E.schedule === t.schedule) && t.start < E.end;
562
+ }), l = new Set(B.map((t) => {
563
+ var O;
564
+ return ((O = e[t._.id]) == null ? void 0 : O.position) ?? 0;
565
+ })), n = 0;
566
+ for (; l.has(n); ) n++;
567
+ e[H].position = n, v.push(E);
568
+ let k = Math.max(1, ...B.map((t) => {
569
+ var O;
570
+ return ((O = e[t._.id]) == null ? void 0 : O.maxConcurrent) ?? 1;
566
571
  }));
567
- e[H].maxConcurrent = Math.max(k.length + 1, T);
568
- for (const t of k)
572
+ e[H].maxConcurrent = Math.max(B.length + 1, k);
573
+ for (const t of B)
569
574
  e[t._.id].overlaps.add(H), e[H].overlaps.add(t._.id), e[t._.id].maxConcurrent = e[H].maxConcurrent;
570
- D = Math.max(D, e[H].maxConcurrent);
575
+ y = Math.max(y, e[H].maxConcurrent);
571
576
  }
572
- for (const S in e) e[S].overlaps = [...e[S].overlaps];
573
- return { cellOverlaps: e, longestStreak: D };
574
- }, W = (u = [], { start: d, end: e }, { excludeIds: i = [], schedule: D = null }) => {
575
- var k;
576
- const S = new Set(i), H = [];
577
- for (const s of u)
578
- !S.has((k = s._) == null ? void 0 : k.id) && (D === null || D === s.schedule) && R(s, d, e) && H.push(s);
577
+ for (const E in e) e[E].overlaps = [...e[E].overlaps];
578
+ return { cellOverlaps: e, longestStreak: y };
579
+ }, W = (u = [], { start: d, end: e }, { excludeIds: v = [], schedule: y = null }) => {
580
+ var B;
581
+ const E = new Set(v), H = [];
582
+ for (const l of u)
583
+ !E.has((B = l._) == null ? void 0 : B.id) && (y === null || y === l.schedule) && X(l, d, e) && H.push(l);
579
584
  return H;
580
- }, R = (u, d, e) => {
581
- const i = u.allDay || !r.time, D = i ? new Date(u.start).setHours(0, 0, 0, 0) : u.start.getTime(), S = i ? new Date(u.end).setHours(23, 59, 59, 999) : u.end.getTime(), H = i ? new Date(d).setHours(0, 0, 0, 0) : d.getTime(), k = i ? new Date(e).setHours(23, 59, 59, 999) : e.getTime();
582
- return S > H && D < k;
585
+ }, X = (u, d, e) => {
586
+ const v = u.allDay || !i.time, y = v ? new Date(u.start).setHours(0, 0, 0, 0) : u.start.getTime(), E = v ? new Date(u.end).setHours(23, 59, 59, 999) : u.end.getTime(), H = v ? new Date(d).setHours(0, 0, 0, 0) : d.getTime(), B = v ? new Date(e).setHours(23, 59, 59, 999) : e.getTime();
587
+ return E > H && y < B;
583
588
  };
584
589
  return {
585
590
  events: w,
586
591
  getEvent: L,
587
- getEventsByDate: f,
588
- getViewEvents: O,
592
+ getEventsByDate: g,
593
+ getViewEvents: V,
589
594
  getCellOverlappingEvents: b,
590
595
  getEventsInRange: W,
591
596
  createEvent: o,
592
- deleteEvent: m,
593
- isEventInRange: R
597
+ deleteEvent: f,
598
+ isEventInRange: X
594
599
  };
595
- }, ct = ({ config: c, dateUtils: a, emit: r, texts: h, eventsManager: w }, _) => {
596
- const { availableViews: L } = c, f = ie(c.view && L[c.view] ? c.view : c.defaultView), O = ie(c.selectedDate || null);
597
- let o = ie(/* @__PURE__ */ new Date());
598
- const m = ie(new Date(c.viewDate || o.value));
599
- m.value.setHours(0, 0, 0, 0);
600
- const b = ie(new Date(m));
600
+ }, ut = ({ config: c, dateUtils: s, emit: i, texts: D, eventsManager: w }, _) => {
601
+ const { availableViews: L } = c, g = ue(c.view && L[c.view] ? c.view : c.defaultView), V = ue(c.selectedDate || null);
602
+ let o = ue(/* @__PURE__ */ new Date());
603
+ const f = ue(new Date(c.viewDate || o.value));
604
+ f.value.setHours(0, 0, 0, 0);
605
+ const b = ue(new Date(f));
601
606
  let W = null;
602
- const R = $(() => f.value === "month" ? b.value : y.value), u = $(() => f.value === "month" ? new Date(b.value.getFullYear(), b.value.getMonth() + 1, 0, 23, 59, 59, 999) : t.value), d = $(() => f.value === "week" ? a.getPreviousFirstDayOfWeek(y.value, c.startWeekOnSunday) : f.value === "month" ? y.value : R.value), e = $(() => {
603
- if (f.value === "week") {
604
- const g = a.addDays(d.value, 7);
605
- return g.setMilliseconds(-1), g;
606
- } else if (f.value === "month") return t.value;
607
+ const X = M(() => g.value === "month" ? b.value : n.value), u = M(() => g.value === "month" ? new Date(b.value.getFullYear(), b.value.getMonth() + 1, 0, 23, 59, 59, 999) : t.value), d = M(() => g.value === "week" ? s.getPreviousFirstDayOfWeek(n.value, c.startWeekOnSunday) : g.value === "month" ? n.value : X.value), e = M(() => {
608
+ if (g.value === "week") {
609
+ const h = s.addDays(d.value, 7);
610
+ return h.setMilliseconds(-1), h;
611
+ } else if (g.value === "month") return t.value;
607
612
  return u.value;
608
- }), i = $(() => {
609
- const g = o.value.getTime();
610
- if (f.value === "week")
611
- return d.value.getTime() <= g && g <= e.value.getTime();
612
- const z = y.value.getTime(), N = t.value.getTime();
613
- return z <= g && g <= N;
613
+ }), v = M(() => {
614
+ const h = o.value.getTime();
615
+ if (g.value === "week")
616
+ return d.value.getTime() <= h && h <= e.value.getTime();
617
+ const P = n.value.getTime(), N = t.value.getTime();
618
+ return P <= h && h <= N;
614
619
  });
615
- function D() {
616
- o.value = /* @__PURE__ */ new Date(), W = setTimeout(D, 60 * 1e3);
620
+ function y() {
621
+ o.value = /* @__PURE__ */ new Date(), W = setTimeout(y, 60 * 1e3);
617
622
  }
618
- function S() {
619
- W = setTimeout(D, (60 - (/* @__PURE__ */ new Date()).getSeconds()) * 1e3), D();
623
+ function E() {
624
+ W = setTimeout(y, (60 - (/* @__PURE__ */ new Date()).getSeconds()) * 1e3), y();
620
625
  }
621
- const H = $(() => {
622
- if (!c.availableViews[f.value]) return 1;
623
- let g = c.availableViews[f.value].cols;
624
- return c.hasHiddenDays && ["week", "month"].includes(f.value) && (g -= c.hasHiddenDays), g;
625
- }), k = $(() => {
626
- var g;
627
- return ((g = c.availableViews[f.value]) == null ? void 0 : g.rows) || 1;
628
- }), s = $(() => H.value * k.value), y = $(() => {
629
- if (f.value === "month") {
630
- let g = b.value.getDay() || 7;
631
- return c.startWeekOnSunday && !c.hideWeekdays[7] && (g += 1), c.viewDayOffset && (g -= c.viewDayOffset), a.subtractDays(b.value, g - 1);
632
- } else if (f.value === "week") {
633
- const g = "1234567".split("").filter((N) => !Object.keys(c.hideWeekdays).includes(N));
634
- let z = Math.min(...g);
635
- return c.startWeekOnSunday && !c.hideWeekdays[7] && (z = 1), c.viewDayOffset && (z += c.viewDayOffset), a.addDays(b.value, z - 1);
626
+ const H = M(() => {
627
+ if (!c.availableViews[g.value]) return 1;
628
+ let h = c.availableViews[g.value].cols;
629
+ return c.hasHiddenDays && ["week", "month"].includes(g.value) && (h -= c.hasHiddenDays), h;
630
+ }), B = M(() => {
631
+ var h;
632
+ return ((h = c.availableViews[g.value]) == null ? void 0 : h.rows) || 1;
633
+ }), l = M(() => H.value * B.value), n = M(() => {
634
+ if (g.value === "month") {
635
+ let h = b.value.getDay() || 7;
636
+ return c.startWeekOnSunday && !c.hideWeekdays[7] && (h += 1), c.viewDayOffset && (h -= c.viewDayOffset), s.subtractDays(b.value, h - 1);
637
+ } else if (g.value === "week") {
638
+ const h = "1234567".split("").filter((N) => !Object.keys(c.hideWeekdays).includes(N));
639
+ let P = Math.min(...h);
640
+ return c.startWeekOnSunday && !c.hideWeekdays[7] && (P = 1), c.viewDayOffset && (P += c.viewDayOffset), s.addDays(b.value, P - 1);
636
641
  } else return b.value;
637
- }), T = $(() => {
638
- const g = [], z = ["days", "week", "month"].includes(f.value);
642
+ }), k = M(() => {
643
+ const h = [], P = ["days", "week", "month"].includes(g.value);
639
644
  let N = 0;
640
- for (let Q = 0; Q < s.value + N; Q++)
641
- switch (f.value) {
645
+ for (let K = 0; K < l.value + N; K++)
646
+ switch (g.value) {
642
647
  case "day":
643
648
  case "days":
644
649
  case "week":
645
650
  case "month": {
646
- const te = a.addDays(y.value, Q), Ve = te.getDay() || 7;
647
- if (z && c.hasHiddenDays && c.hideWeekdays[Ve]) {
651
+ const ae = s.addDays(n.value, K), Ve = ae.getDay() || 7;
652
+ if (P && c.hasHiddenDays && c.hideWeekdays[Ve]) {
648
653
  N++;
649
654
  continue;
650
655
  }
651
- const Ce = new Date(te);
652
- Ce.setHours(23, 59, 59, 999), g.push({ start: te, startFormatted: a.formatDate(te), end: Ce });
656
+ const Ce = new Date(ae);
657
+ Ce.setHours(23, 59, 59, 999), h.push({ start: ae, startFormatted: s.formatDate(ae), end: Ce });
653
658
  break;
654
659
  }
655
660
  case "year":
656
- g.push({
657
- start: new Date(y.value.getFullYear(), Q, 1, 0, 0, 0, 0),
658
- end: new Date(y.value.getFullYear(), Q + 1, 0, 23, 59, 59, 999)
661
+ h.push({
662
+ start: new Date(n.value.getFullYear(), K, 1, 0, 0, 0, 0),
663
+ end: new Date(n.value.getFullYear(), K + 1, 0, 23, 59, 59, 999)
659
664
  });
660
665
  break;
661
666
  case "years":
662
- g.push({
663
- start: new Date(y.value.getFullYear() + Q, 0, 1, 0, 0, 0, 0),
664
- end: new Date(y.value.getFullYear() + Q + 1, 0, 0, 23, 59, 59, 999)
667
+ h.push({
668
+ start: new Date(n.value.getFullYear() + K, 0, 1, 0, 0, 0, 0),
669
+ end: new Date(n.value.getFullYear() + K + 1, 0, 0, 23, 59, 59, 999)
665
670
  });
666
671
  break;
667
672
  }
668
- return g;
669
- }), t = $(() => T.value[T.value.length - 1].end), P = ie("right"), A = $(() => {
670
- const g = Object.keys(c.availableViews);
671
- return g[g.indexOf(f.value) + 1];
672
- }), J = $(() => {
673
- const g = Object.keys(c.availableViews);
674
- return g[g.indexOf(f.value) - 1];
675
- }), re = $(() => {
676
- const { dateFormat: g, truncations: z } = h;
677
- switch (f.value) {
673
+ return h;
674
+ }), t = M(() => k.value[k.value.length - 1].end), O = ue("right"), z = M(() => {
675
+ const h = Object.keys(c.availableViews);
676
+ return h[h.indexOf(g.value) + 1];
677
+ }), R = M(() => {
678
+ const h = Object.keys(c.availableViews);
679
+ return h[h.indexOf(g.value) - 1];
680
+ }), Q = M(() => {
681
+ const { dateFormat: h, truncations: P } = D;
682
+ switch (g.value) {
678
683
  case "day":
679
- return a.formatDate(y.value, g);
684
+ return s.formatDate(n.value, h);
680
685
  case "days": {
681
- let N = g.replace(/(\s|^)[^a-zA-Z]*?d{2,4}[^a-zA-Z]*?(\s|$)/, "");
682
- z !== !1 && (N = N.replace("MMMM", "MMM"));
683
- const Q = a.formatDate(y.value, N), te = a.formatDate(t.value, N);
684
- return `${Q} - ${te}`;
686
+ let N = h.replace(/(\s|^)[^a-zA-Z]*?d{2,4}[^a-zA-Z]*?(\s|$)/, "");
687
+ P !== !1 && (N = N.replace("MMMM", "MMM"));
688
+ const K = s.formatDate(n.value, N), ae = s.formatDate(t.value, N);
689
+ return `${K} - ${ae}`;
685
690
  }
686
691
  case "week": {
687
- let N = a.getWeek(y.value, c.startWeekOnSunday && !c.hideWeekdays[7]);
688
- N = ` <small>${h.week} ${N}</small>`;
689
- const Q = y.value.getMonth(), te = y.value.getFullYear(), Ve = t.value.getMonth(), Ce = t.value.getFullYear(), He = Q !== Ve, Qe = He && te !== Ce, Be = z !== !1 && (c.xs || He), Le = h.months[Q][Be ? "substring" : "toString"](0, 3);
690
- if (He) {
691
- const Ie = h.months[Ve][Be ? "substring" : "toString"](0, 3);
692
- return Qe ? `${Le} ${te} - ${Ie} ${Ce} ${N}` : `${Le} - ${Ie} ${te} ${N}`;
693
- } else return `${Le} ${te} ${N}`;
692
+ let N = s.getWeek(n.value, c.startWeekOnSunday && !c.hideWeekdays[7]);
693
+ N = ` <small>${D.week} ${N}</small>`;
694
+ const K = n.value.getMonth(), ae = n.value.getFullYear(), Ve = t.value.getMonth(), Ce = t.value.getFullYear(), Le = K !== Ve, Qe = Le && ae !== Ce, Ie = P !== !1 && (c.xs || Le), Fe = D.months[K][Ie ? "substring" : "toString"](0, 3);
695
+ if (Le) {
696
+ const Re = D.months[Ve][Ie ? "substring" : "toString"](0, 3);
697
+ return Qe ? `${Fe} ${ae} - ${Re} ${Ce} ${N}` : `${Fe} - ${Re} ${ae} ${N}`;
698
+ } else return `${Fe} ${ae} ${N}`;
694
699
  }
695
700
  case "month": {
696
- const N = `${c.xs && z !== !1 ? "MMM" : "MMMM"} YYYY`;
697
- return a.formatDate(R.value, N);
701
+ const N = `${c.xs && P !== !1 ? "MMM" : "MMMM"} YYYY`;
702
+ return s.formatDate(X.value, N);
698
703
  }
699
704
  case "year":
700
- return y.value.getFullYear();
705
+ return n.value.getFullYear();
701
706
  case "years":
702
- return `${y.value.getFullYear()} - ${u.value.getFullYear()}`;
707
+ return `${n.value.getFullYear()} - ${u.value.getFullYear()}`;
703
708
  }
704
709
  });
705
- function x() {
706
- switch (b.value = new Date(m.value || o.value), b.value.setHours(0, 0, 0, 0), f.value) {
710
+ function ee() {
711
+ switch (b.value = new Date(f.value || o.value), b.value.setHours(0, 0, 0, 0), g.value) {
707
712
  case "day":
708
713
  break;
709
714
  case "days":
710
715
  break;
711
716
  case "week":
712
- b.value = a.getPreviousFirstDayOfWeek(b.value, c.startWeekOnSunday && !c.hideWeekdays[7]);
717
+ b.value = s.getPreviousFirstDayOfWeek(b.value, c.startWeekOnSunday && !c.hideWeekdays[7]);
713
718
  break;
714
719
  case "month":
715
720
  b.value = new Date(b.value.getFullYear(), b.value.getMonth(), 1, 0, 0, 0, 0);
@@ -718,180 +723,180 @@ const Ke = (c) => {
718
723
  b.value = new Date(b.value.getFullYear(), 0, 1, 0, 0, 0, 0);
719
724
  break;
720
725
  case "years":
721
- b.value = new Date(b.value.getFullYear() - b.value.getFullYear() % s.value, 0, 1, 0, 0, 0, 0);
726
+ b.value = new Date(b.value.getFullYear() - b.value.getFullYear() % l.value, 0, 1, 0, 0, 0, 0);
722
727
  break;
723
728
  }
724
- r("view-change", {
725
- id: f.value,
726
- title: re.value,
727
- start: R.value,
729
+ i("view-change", {
730
+ id: g.value,
731
+ title: Q.value,
732
+ start: X.value,
728
733
  end: u.value,
729
734
  extendedStart: d.value,
730
735
  extendedEnd: e.value,
731
- cellDates: T.value,
732
- containsToday: i.value,
733
- events: B.value
736
+ cellDates: k.value,
737
+ containsToday: v.value,
738
+ events: A.value
734
739
  }), o.value = /* @__PURE__ */ new Date();
735
740
  }
736
- function be(g) {
737
- const z = f.value, N = c.availableViews[z];
738
- g[z] && JSON.stringify(g[z]) === JSON.stringify(N) || x();
741
+ function ie(h) {
742
+ const P = g.value, N = c.availableViews[P];
743
+ h[P] && JSON.stringify(h[P]) === JSON.stringify(N) || ee();
739
744
  }
740
- function ue(g, z = !0) {
745
+ function oe(h, P = !0) {
741
746
  const N = Object.keys(c.availableViews);
742
- f.value !== g && (N.includes(g) ? (P.value = N.indexOf(g) < N.indexOf(f.value) ? "left" : "right", f.value = g, r("update:view", g), x()) : console.warn(`Vue Cal: the \`${g}\` view is not available.`));
747
+ g.value !== h && (N.includes(h) ? (O.value = N.indexOf(h) < N.indexOf(g.value) ? "left" : "right", g.value = h, i("update:view", h), ee()) : console.warn(`Vue Cal: the \`${h}\` view is not available.`));
743
748
  }
744
- function De() {
745
- A.value ? ue(A.value) : console.warn("Vue Cal: no broader view is available.");
749
+ function he() {
750
+ z.value ? oe(z.value) : console.warn("Vue Cal: no broader view is available.");
746
751
  }
747
- function fe() {
748
- J.value ? ue(J.value) : console.warn("Vue Cal: no narrower view is available.");
752
+ function x() {
753
+ R.value ? oe(R.value) : console.warn("Vue Cal: no narrower view is available.");
749
754
  }
750
- function X() {
751
- n(!1);
755
+ function J() {
756
+ a(!1);
752
757
  }
753
- function U() {
754
- n(!0);
758
+ function ce() {
759
+ a(!0);
755
760
  }
756
- function n(g = !0) {
757
- let z = new Date(m.value);
758
- switch (f.value) {
761
+ function a(h = !0) {
762
+ let P = new Date(f.value);
763
+ switch (g.value) {
759
764
  case "day":
760
765
  case "days":
761
- g ? z = a.addDays(t.value, 1) : z = a.subtractDays(y.value, s.value);
766
+ h ? P = s.addDays(t.value, 1) : P = s.subtractDays(n.value, l.value);
762
767
  break;
763
768
  case "week": {
764
- g ? (z = a.addDays(e.value, 1), z.setHours(0, 0, 0, 0)) : z = a.subtractDays(d.value, s.value);
769
+ h ? (P = s.addDays(e.value, 1), P.setHours(0, 0, 0, 0)) : P = s.subtractDays(d.value, l.value);
765
770
  break;
766
771
  }
767
772
  case "month": {
768
- const N = g ? 1 : -1;
769
- z = new Date(z.getFullYear(), z.getMonth() + N, 1, 0, 0, 0, 0);
773
+ const N = h ? 1 : -1;
774
+ P = new Date(P.getFullYear(), P.getMonth() + N, 1, 0, 0, 0, 0);
770
775
  break;
771
776
  }
772
777
  case "year": {
773
- const N = g ? 1 : -1;
774
- z = new Date(z.getFullYear() + N, 1, 1, 0, 0, 0, 0);
778
+ const N = h ? 1 : -1;
779
+ P = new Date(P.getFullYear() + N, 1, 1, 0, 0, 0, 0);
775
780
  break;
776
781
  }
777
782
  case "years": {
778
- const N = g ? s.value : -s.value;
779
- z = new Date(z.getFullYear() + N, 1, 1, 0, 0, 0, 0);
783
+ const N = h ? l.value : -l.value;
784
+ P = new Date(P.getFullYear() + N, 1, 1, 0, 0, 0, 0);
780
785
  break;
781
786
  }
782
787
  }
783
- v(z);
788
+ m(P);
784
789
  }
785
790
  function p() {
786
- const g = /* @__PURE__ */ new Date();
787
- g.setHours(0, 0, 0, 0), v(g);
791
+ const h = /* @__PURE__ */ new Date();
792
+ h.setHours(0, 0, 0, 0), m(h);
788
793
  }
789
- function v(g, z = !0, N = !1) {
790
- if (!a.isValid(g)) return console.warn("Vue Cal: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.");
791
- let [Q, te] = [y.value, t.value];
792
- f.value === "month" && ([Q, te] = [R.value, u.value]), (!a.isInRange(g, Q, te) || N) && (g.setHours(0, 0, 0, 0), P.value = g.getTime() < Q.getTime() ? "left" : "right", m.value = g, z && r("update:viewDate", g), x());
794
+ function m(h, P = !0, N = !1) {
795
+ if (!s.isValid(h)) return console.warn("Vue Cal: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.");
796
+ let [K, ae] = [n.value, t.value];
797
+ g.value === "month" && ([K, ae] = [X.value, u.value]), (!s.isInRange(h, K, ae) || N) && (h.setHours(0, 0, 0, 0), O.value = h.getTime() < K.getTime() ? "left" : "right", f.value = h, P && i("update:viewDate", h), ee());
793
798
  }
794
- function G(g, z = !0) {
795
- if (a.isValid(g)) {
796
- const { isValid: N, isSameDate: Q } = a;
797
- (!O.value || !N(O.value) || !Q(g, O.value)) && (g.setHours(0, 0, 0, 0), O.value = g, z && r("update:selectedDate", g));
799
+ function G(h, P = !0) {
800
+ if (s.isValid(h)) {
801
+ const { isValid: N, isSameDate: K } = s;
802
+ (!V.value || !N(V.value) || !K(h, V.value)) && (h.setHours(0, 0, 0, 0), V.value = h, P && i("update:selectedDate", h));
798
803
  } else
799
804
  return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.");
800
805
  }
801
- function K(g) {
802
- !g && !b.value.getDay() ? v(a.addDays(b.value, 1), !0, !0) : (P.value = "left", x());
806
+ function U(h) {
807
+ !h && !b.value.getDay() ? m(s.addDays(b.value, 1), !0, !0) : (O.value = "left", ee());
803
808
  }
804
- function ve(g) {
805
- g && c.startWeekOnSunday && !b.value.getDay() ? v(a.addDays(b.value, 1), !0, !0) : !g && c.startWeekOnSunday && b.value.getDay() === 1 && v(a.subtractDays(b.value, 1), !0, !0);
809
+ function fe(h) {
810
+ h && c.startWeekOnSunday && !b.value.getDay() ? m(s.addDays(b.value, 1), !0, !0) : !h && c.startWeekOnSunday && b.value.getDay() === 1 && m(s.subtractDays(b.value, 1), !0, !0);
806
811
  }
807
- function l() {
812
+ function r() {
808
813
  console.log("toggling weekdays", c.hideWeekdays);
809
814
  }
810
- function M(g) {
811
- const z = _.value.querySelector(".vuecal__scrollable"), N = g ? g * c.timeCellHeight / c.timeStep : 0;
812
- z == null || z.scrollTo({ top: N, behavior: "smooth" });
815
+ function T(h) {
816
+ const P = _.value.querySelector(".vuecal__scrollable"), N = h ? h * c.timeCellHeight / c.timeStep : 0;
817
+ P == null || P.scrollTo({ top: N, behavior: "smooth" });
813
818
  }
814
- function C() {
815
- const g = /* @__PURE__ */ new Date();
816
- M(g.getHours() * 60 + g.getMinutes());
819
+ function S() {
820
+ const h = /* @__PURE__ */ new Date();
821
+ T(h.getHours() * 60 + h.getMinutes());
817
822
  }
818
- function E() {
819
- M(0);
823
+ function $() {
824
+ T(0);
820
825
  }
821
- const B = $(() => w.getViewEvents(T.value)), I = w.createEvent, ee = w.deleteEvent;
822
- return oe(() => c.view, (g) => ue(g, !1)), oe(() => c.availableViews, be), oe(() => c.datePicker, () => ue("month", !1)), oe(() => c.viewDate, (g) => v(g, !1)), oe(() => c.selectedDate, (g) => G(g, !1)), oe(() => c.startWeekOnSunday, (g) => K(g)), oe(() => c.hideWeekends, (g) => ve(g)), oe(() => c.hideWeekdays, l), oe(() => s.value, () => {
823
- s.value > 90 && console.warn("Vue Cal: high cell count detected. Performance may degrade when interactions are enabled.");
824
- }), oe(() => c.watchRealTime, (g) => {
825
- g && c.time ? S() : W = clearTimeout(W);
826
- }), x(), c.time && c.watchRealTime && S(), Ne(() => W = clearTimeout(W)), {
826
+ const A = M(() => w.getViewEvents(k.value)), I = w.createEvent, te = w.deleteEvent;
827
+ return de(() => c.view, (h) => oe(h, !1)), de(() => c.availableViews, ie), de(() => c.datePicker, () => oe("month", !1)), de(() => c.viewDate, (h) => m(h, !1)), de(() => c.selectedDate, (h) => G(h, !1)), de(() => c.startWeekOnSunday, (h) => U(h)), de(() => c.hideWeekends, (h) => fe(h)), de(() => c.hideWeekdays, r), de(() => l.value, () => {
828
+ l.value > 90 && console.warn("Vue Cal: high cell count detected. Performance may degrade when interactions are enabled.");
829
+ }), de(() => c.watchRealTime, (h) => {
830
+ h && c.time ? E() : W = clearTimeout(W);
831
+ }), ee(), c.time && c.watchRealTime && E(), ze(() => W = clearTimeout(W)), {
827
832
  now: o,
828
- id: f,
829
- broaderView: A,
830
- narrowerView: J,
831
- title: re,
832
- viewDate: m,
833
- start: R,
833
+ id: g,
834
+ broaderView: z,
835
+ narrowerView: R,
836
+ title: Q,
837
+ viewDate: f,
838
+ start: X,
834
839
  end: u,
835
840
  extendedStart: d,
836
841
  // Full range, including out of scope month days, and hidden leading/trailing days.
837
842
  extendedEnd: e,
838
843
  // Full range, including out of scope month days, and hidden leading/trailing days.
839
- firstCellDate: y,
844
+ firstCellDate: n,
840
845
  lastCellDate: t,
841
- containsToday: i,
842
- selectedDate: O,
843
- cellDates: T,
846
+ containsToday: v,
847
+ selectedDate: V,
848
+ cellDates: k,
844
849
  cols: H,
845
- rows: k,
850
+ rows: B,
846
851
  // All the events are stored and indexed in the events object of the eventsManager.
847
852
  // The following events array is only a subset of visible ones, plus any potential recurring
848
853
  // and multi-day events.
849
- events: B,
850
- transitionDirection: P,
851
- switch: ue,
852
- broader: De,
853
- narrower: fe,
854
- previous: X,
855
- next: U,
856
- navigate: n,
854
+ events: A,
855
+ transitionDirection: O,
856
+ switch: oe,
857
+ broader: he,
858
+ narrower: x,
859
+ previous: J,
860
+ next: ce,
861
+ navigate: a,
857
862
  goToToday: p,
858
- updateViewDate: v,
863
+ updateViewDate: m,
859
864
  updateSelectedDate: G,
860
- scrollToCurrentTime: C,
861
- scrollToTime: M,
862
- scrollTop: E,
865
+ scrollToCurrentTime: S,
866
+ scrollToTime: T,
867
+ scrollTop: $,
863
868
  createEvent: I,
864
- deleteEvent: ee,
869
+ deleteEvent: te,
865
870
  // Getters.
866
871
  get isDay() {
867
- return f.value === "day";
872
+ return g.value === "day";
868
873
  },
869
874
  get isDays() {
870
- return f.value === "days";
875
+ return g.value === "days";
871
876
  },
872
877
  get isWeek() {
873
- return f.value === "week";
878
+ return g.value === "week";
874
879
  },
875
880
  get isMonth() {
876
- return f.value === "month";
881
+ return g.value === "month";
877
882
  },
878
883
  get isYear() {
879
- return f.value === "year";
884
+ return g.value === "year";
880
885
  },
881
886
  get isYears() {
882
- return f.value === "years";
887
+ return g.value === "years";
883
888
  }
884
889
  };
885
890
  }, Ye = _e({
886
- texts: { ...ce.texts },
891
+ texts: { ...ve.texts },
887
892
  // Make texts reactive before a locale is loaded.
888
- dateUtils: Ke(ce.texts)
893
+ dateUtils: Ke(ve.texts)
889
894
  // Some Date utils functions need localized texts.
890
- }), dt = ({ props: c, emit: a, attrs: r, vuecalEl: h, uid: w }) => {
895
+ }), ct = ({ props: c, emit: s, attrs: i, vuecalEl: D, uid: w }) => {
891
896
  const _ = _e({
892
897
  uid: w,
893
898
  // The Vuecal instance unique ID, used for dnd source-target identification.
894
- emit: a,
899
+ emit: s,
895
900
  texts: { ...Ye.texts },
896
901
  // Make texts reactive before a locale is loaded.
897
902
  // The date utils composable.
@@ -912,8 +917,8 @@ const Ke = (c) => {
912
917
  isResizingEvent: !1
913
918
  }
914
919
  });
915
- return _.dateUtils = Ke(Object.assign(ce.texts, _.texts)), _.config = it(_, c, r), _.eventsManager = ut(_), _.view = ct(_, h), _.dnd = ot(_), _;
916
- }, vt = 24 * 60, mt = {
920
+ return _.dateUtils = Ke(Object.assign(ve.texts, _.texts)), _.config = rt(_, c, i), _.eventsManager = ot(_), _.view = ut(_, D), _.dnd = it(_), _;
921
+ }, dt = 24 * 60, vt = {
917
922
  allDayEvents: { type: [Boolean, String], default: !1 },
918
923
  // Coming soon.
919
924
  // avoidEventOverlap: { type: Boolean, default: undefined }, // Coming soon.
@@ -977,14 +982,12 @@ const Ke = (c) => {
977
982
  // Start time of the time column, in minutes.
978
983
  timeStep: { type: Number, default: 60 },
979
984
  // Step amount for the time in the time column, in minutes.
980
- timeTo: { type: Number, default: vt },
985
+ timeTo: { type: Number, default: dt },
981
986
  // End time of the time column, in minutes.
982
987
  titleBar: { type: Boolean, default: !0 },
983
988
  // Show or hide the header title bar.
984
989
  todayButton: { type: Boolean, default: !0 },
985
990
  // Show or hide the header today button.
986
- transitions: { type: Boolean, default: !0 },
987
- // Enables/disables the navigation transitions.
988
991
  twelveHour: { type: Boolean, default: !1 },
989
992
  // 12 or 24 hour format are respectively written like 1pm and 13:00.
990
993
  // Sets the calendar view to one of: 'day', 'days', 'week', 'month', 'year', 'years'. Default 'week' or 'month' if datePicker.
@@ -995,12 +998,14 @@ const Ke = (c) => {
995
998
  // Only available for month and day views, this will shift the start of the view (left or right) by x days (signed integer).
996
999
  viewDayOffset: { type: Number, default: 0 },
997
1000
  // The list of all the view that will be available in this calendar.
998
- views: { type: [Array, Object], default: ["day", "days", "week", "month", "year", "years"] },
1001
+ // Default for normal layout: ['day', 'days', 'week', 'month', 'year', 'years'] }.
1002
+ // Default for date picker layout: ['month', 'year', 'years'].
1003
+ views: { type: [Array, Object] },
999
1004
  viewsBar: { type: Boolean, default: !0 },
1000
1005
  // Show or hide the headers view selection bar.
1001
1006
  watchRealTime: { type: Boolean, default: !1 },
1002
1007
  // More expensive, so only trigger on demand.
1003
- weekNumbers: { type: [Boolean, String], default: !1 },
1008
+ weekNumbers: { type: Boolean, default: !1 },
1004
1009
  // Show the weeks numbers in a column on month view.
1005
1010
  xs: { type: Boolean, default: !1 }
1006
1011
  // Extra small size for date pickers (truncates texts + specific styles).
@@ -1009,85 +1014,85 @@ const Ke = (c) => {
1009
1014
  // minScheduleWidth: { type: Number, default: 0 },
1010
1015
  // overlapsPerTimeStep: { type: Boolean, default: false },
1011
1016
  // resizeX: { type: Boolean, default: false },
1012
- }, ft = { class: "vuecal__header" }, gt = {
1017
+ }, mt = { class: "vuecal__header" }, ft = {
1013
1018
  key: 0,
1014
1019
  class: "vuecal__views-bar"
1015
- }, ht = ["onClick", "innerHTML"], yt = {
1020
+ }, gt = ["onClick", "innerHTML"], ht = {
1016
1021
  key: 1,
1017
1022
  class: "vuecal__title-bar"
1018
- }, Dt = { class: "vuecal__transition-wrap" }, wt = ["disabled", "innerHTML"], pt = {
1023
+ }, yt = { class: "vuecal__transition-wrap" }, Dt = ["disabled", "innerHTML"], wt = {
1019
1024
  __name: "header",
1020
1025
  setup(c) {
1021
- const a = Se("vuecal"), { view: r, config: h } = a, w = () => {
1022
- h.clickToNavigate && r.broader();
1023
- }, _ = $(() => h.clickToNavigate ? { click: w } : {});
1024
- return (L, f) => (Y(), j("div", ft, [
1026
+ const s = Se("vuecal"), { view: i, config: D } = s, w = () => {
1027
+ D.clickToNavigate && i.broader();
1028
+ }, _ = M(() => D.clickToNavigate ? { click: w } : {});
1029
+ return (L, g) => (Y(), j("div", mt, [
1025
1030
  F(L.$slots, "header", {
1026
- view: V(r),
1027
- availableViews: V(h).availableViews,
1028
- vuecal: V(a)
1031
+ view: C(i),
1032
+ availableViews: C(D).availableViews,
1033
+ vuecal: C(s)
1029
1034
  }),
1030
- L.$slots.header ? Z("", !0) : (Y(), j(ae, { key: 0 }, [
1031
- V(h).viewsBar ? (Y(), j("div", gt, [
1032
- (Y(!0), j(ae, null, he(V(h).availableViews, (O, o) => (Y(), j("button", {
1033
- class: ye(["vuecal__view-button", { "vuecal__view-button--active": V(r).id === o }]),
1034
- onClick: (m) => V(r).switch(o),
1035
- innerHTML: V(a).texts[o],
1035
+ L.$slots.header ? Z("", !0) : (Y(), j(se, { key: 0 }, [
1036
+ C(D).viewsBar ? (Y(), j("div", ft, [
1037
+ (Y(!0), j(se, null, De(C(D).availableViews, (V, o) => (Y(), j("button", {
1038
+ class: we(["vuecal__view-button", { "vuecal__view-button--active": C(i).id === o }]),
1039
+ onClick: (f) => C(i).switch(o),
1040
+ innerHTML: C(s).texts[o],
1036
1041
  type: "button"
1037
- }, null, 10, ht))), 256))
1042
+ }, null, 10, gt))), 256))
1038
1043
  ])) : Z("", !0),
1039
- V(h).titleBar ? (Y(), j("nav", yt, [
1040
- de("button", {
1041
- class: ye(["vuecal__nav vuecal__nav--prev", { "vuecal__nav--default": !L.$slots["previous-button"] }]),
1042
- onClick: f[0] || (f[0] = (...O) => V(r).previous && V(r).previous(...O)),
1044
+ C(D).titleBar ? (Y(), j("nav", ht, [
1045
+ me("button", {
1046
+ class: we(["vuecal__nav vuecal__nav--prev", { "vuecal__nav--default": !L.$slots["previous-button"] }]),
1047
+ onClick: g[0] || (g[0] = (...V) => C(i).previous && C(i).previous(...V)),
1043
1048
  type: "button"
1044
1049
  }, [
1045
1050
  F(L.$slots, "previous-button")
1046
1051
  ], 2),
1047
- de("div", Dt, [
1048
- Me(ze, {
1049
- name: `vuecal-slide-fade--${V(r).transitionDirection}`
1052
+ me("div", yt, [
1053
+ Me(He, {
1054
+ name: `vuecal-slide-fade--${C(i).transitionDirection}`
1050
1055
  }, {
1051
1056
  default: q(() => [
1052
1057
  (Y(), j("div", {
1053
- key: V(r).id + V(r).start.getTime()
1058
+ key: C(i).id + C(i).start.getTime()
1054
1059
  }, [
1055
- L.$slots.title ? (Y(), ke(Re(V(h).clickToNavigate && V(r).broaderView ? "button" : "div"), me({
1060
+ L.$slots.title ? (Y(), be(Xe(C(D).clickToNavigate && C(i).broaderView ? "button" : "div"), ge({
1056
1061
  key: 0,
1057
1062
  class: "vuecal__title"
1058
1063
  }, je(_.value)), {
1059
1064
  default: q(() => [
1060
- F(L.$slots, "title", ne(se(V(r))))
1065
+ F(L.$slots, "title", ne(le(C(i))))
1061
1066
  ]),
1062
1067
  _: 3
1063
- }, 16)) : (Y(), ke(Re(V(h).clickToNavigate && V(r).broaderView ? "button" : "div"), me({
1068
+ }, 16)) : (Y(), be(Xe(C(D).clickToNavigate && C(i).broaderView ? "button" : "div"), ge({
1064
1069
  key: 1,
1065
1070
  class: "vuecal__title"
1066
1071
  }, je(_.value), {
1067
- innerHTML: V(r).title
1072
+ innerHTML: C(i).title
1068
1073
  }), null, 16, ["innerHTML"]))
1069
1074
  ]))
1070
1075
  ]),
1071
1076
  _: 3
1072
1077
  }, 8, ["name"])
1073
1078
  ]),
1074
- V(h).todayButton ? (Y(), j(ae, { key: 0 }, [
1079
+ C(D).todayButton ? (Y(), j(se, { key: 0 }, [
1075
1080
  L.$slots["today-button"] ? F(L.$slots, "today-button", {
1076
1081
  key: 0,
1077
- navigate: () => !V(r).containsToday && V(r).goToToday(),
1078
- active: V(r).containsToday
1082
+ navigate: () => !C(i).containsToday && C(i).goToToday(),
1083
+ active: C(i).containsToday
1079
1084
  }) : (Y(), j("button", {
1080
1085
  key: 1,
1081
- class: ye(["vuecal__nav vuecal__nav--today vuecal__nav--default", { "vuecal__nav--active": V(r).containsToday }]),
1082
- onClick: f[1] || (f[1] = (O) => !V(r).containsToday && V(r).goToToday()),
1083
- disabled: !!V(r).containsToday,
1086
+ class: we(["vuecal__nav vuecal__nav--today vuecal__nav--default", { "vuecal__nav--active": C(i).containsToday }]),
1087
+ onClick: g[1] || (g[1] = (V) => !C(i).containsToday && C(i).goToToday()),
1088
+ disabled: !!C(i).containsToday,
1084
1089
  type: "button",
1085
- innerHTML: V(a).texts.today
1086
- }, null, 10, wt))
1090
+ innerHTML: C(s).texts.today
1091
+ }, null, 10, Dt))
1087
1092
  ], 64)) : Z("", !0),
1088
- de("button", {
1089
- class: ye(["vuecal__nav vuecal__nav--next", { "vuecal__nav--default": !L.$slots["next-button"] }]),
1090
- onClick: f[2] || (f[2] = (...O) => V(r).next && V(r).next(...O)),
1093
+ me("button", {
1094
+ class: we(["vuecal__nav vuecal__nav--next", { "vuecal__nav--default": !L.$slots["next-button"] }]),
1095
+ onClick: g[2] || (g[2] = (...V) => C(i).next && C(i).next(...V)),
1091
1096
  type: "button"
1092
1097
  }, [
1093
1098
  F(L.$slots, "next-button")
@@ -1096,22 +1101,22 @@ const Ke = (c) => {
1096
1101
  ], 64))
1097
1102
  ]));
1098
1103
  }
1099
- }, _t = {
1104
+ }, pt = {
1100
1105
  key: 0,
1101
1106
  class: "vuecal__headings"
1102
1107
  }, kt = {
1103
1108
  key: 0,
1104
1109
  class: "vuecal__weekdays-headings"
1105
- }, bt = ["onClick"], Tt = { class: "vuecal__weekday-day" }, Mt = {
1110
+ }, _t = ["onClick"], bt = { class: "vuecal__weekday-day" }, Tt = {
1106
1111
  key: 0,
1107
1112
  class: "vuecal__weekday-date"
1108
- }, $t = {
1113
+ }, Mt = {
1109
1114
  key: 1,
1110
1115
  class: "vuecal__schedules-headings w-flex grow"
1111
- }, Et = ["innerHTML"], Yt = {
1116
+ }, $t = ["innerHTML"], Et = {
1112
1117
  __name: "headings-bar",
1113
1118
  setup(c) {
1114
- const a = Se("vuecal"), { view: r, config: h, dateUtils: w } = a, _ = $(() => h.xs ? "day-xs" : h.sm || r.isDays || r.isMonth ? "day-sm" : "day"), L = $(() => (r.isDay || r.isDays || r.isWeek || r.isMonth) && !(r.isDay && !h.schedules)), f = $(() => r.cellDates.slice(0, r.cols).map(({ start: o }) => ({
1119
+ const s = Se("vuecal"), { view: i, config: D, dateUtils: w } = s, _ = M(() => D.xs ? "day-xs" : D.sm || i.isDays || i.isMonth ? "day-sm" : "day"), L = M(() => (i.isDay || i.isDays || i.isWeek || i.isMonth) && !(i.isDay && !D.schedules)), g = M(() => i.cellDates.slice(0, i.cols).map(({ start: o }) => ({
1115
1120
  id: Pe[o.getDay()],
1116
1121
  date: o,
1117
1122
  dateNumber: o.getDate(),
@@ -1119,96 +1124,96 @@ const Ke = (c) => {
1119
1124
  "day-sm": w.formatDate(o, "ddd"),
1120
1125
  "day-xs": w.formatDate(o, "dd"),
1121
1126
  isToday: w.isToday(o)
1122
- }))), O = {
1127
+ }))), V = {
1123
1128
  click: (o) => {
1124
- (r.isDays || r.isWeek) && r.updateSelectedDate(o);
1129
+ (i.isDays || i.isWeek) && i.updateSelectedDate(o);
1125
1130
  }
1126
1131
  };
1127
- return (o, m) => L.value ? (Y(), j("div", _t, [
1128
- V(r).isDay ? Z("", !0) : (Y(), j("div", kt, [
1129
- (Y(!0), j(ae, null, he(f.value, (b, W) => (Y(), j("div", {
1130
- class: ye(["vuecal__weekday", { "vuecal__weekday--today": b.isToday }]),
1132
+ return (o, f) => L.value ? (Y(), j("div", pt, [
1133
+ C(i).isDay ? Z("", !0) : (Y(), j("div", kt, [
1134
+ (Y(!0), j(se, null, De(g.value, (b, W) => (Y(), j("div", {
1135
+ class: we(["vuecal__weekday", { "vuecal__weekday--today": b.isToday }]),
1131
1136
  key: W,
1132
- onClick: (R) => O.click(b.date)
1137
+ onClick: (X) => V.click(b.date)
1133
1138
  }, [
1134
1139
  F(o.$slots, "weekday-heading", {
1135
1140
  label: b[_.value],
1136
1141
  id: b.id,
1137
1142
  date: b.date
1138
1143
  }, () => [
1139
- de("span", Tt, le(b[_.value]), 1),
1140
- V(r).isMonth ? Z("", !0) : (Y(), j("strong", Mt, le(b.dateNumber), 1))
1144
+ me("span", bt, re(b[_.value]), 1),
1145
+ C(i).isMonth ? Z("", !0) : (Y(), j("strong", Tt, re(b.dateNumber), 1))
1141
1146
  ])
1142
- ], 10, bt))), 128))
1147
+ ], 10, _t))), 128))
1143
1148
  ])),
1144
- V(h).schedules ? (Y(), j("div", $t, [
1145
- (Y(!0), j(ae, null, he(f.value, (b, W) => (Y(), j(ae, { key: W }, [
1146
- (Y(!0), j(ae, null, he(V(h).schedules, (R, u) => (Y(), j(ae, { key: u }, [
1149
+ C(D).schedules ? (Y(), j("div", Mt, [
1150
+ (Y(!0), j(se, null, De(g.value, (b, W) => (Y(), j(se, { key: W }, [
1151
+ (Y(!0), j(se, null, De(C(D).schedules, (X, u) => (Y(), j(se, { key: u }, [
1147
1152
  o.$slots["schedule-heading"] ? (Y(), j("div", {
1148
1153
  key: 0,
1149
- class: ye(["vuecal__schedule vuecal__schedule--heading", R.class])
1154
+ class: we(["vuecal__schedule vuecal__schedule--heading", X.class])
1150
1155
  }, [
1151
1156
  F(o.$slots, "schedule-heading", {
1152
- schedule: R,
1153
- view: V(r)
1157
+ schedule: X,
1158
+ view: C(i)
1154
1159
  })
1155
1160
  ], 2)) : (Y(), j("div", {
1156
1161
  key: 1,
1157
- class: ye(["vuecal__schedule vuecal__schedule--heading", R.class]),
1158
- innerHTML: R.label
1159
- }, null, 10, Et))
1162
+ class: we(["vuecal__schedule vuecal__schedule--heading", X.class]),
1163
+ innerHTML: X.label
1164
+ }, null, 10, $t))
1160
1165
  ], 64))), 128))
1161
1166
  ], 64))), 128))
1162
1167
  ])) : Z("", !0)
1163
1168
  ])) : Z("", !0);
1164
1169
  }
1165
- }, St = { class: "vuecal__time-column" }, Ct = {
1170
+ }, Yt = { class: "vuecal__time-column" }, St = {
1166
1171
  __name: "time-column",
1167
1172
  setup(c) {
1168
- const a = Se("vuecal"), { config: r, texts: h } = a, w = $(() => {
1173
+ const s = Se("vuecal"), { config: i, texts: D } = s, w = M(() => {
1169
1174
  const _ = [];
1170
- for (let f = r.timeFrom; f < r.timeTo; f += r.timeStep) {
1171
- const O = ~~(f / 60), o = f % 60, m = h[f < 720 ? "am" : "pm"];
1175
+ for (let g = i.timeFrom; g < i.timeTo; g += i.timeStep) {
1176
+ const V = ~~(g / 60), o = g % 60, f = D[g < 720 ? "am" : "pm"];
1172
1177
  _.push({
1173
- minutesSum: f,
1178
+ minutesSum: g,
1174
1179
  // The sum of hours + minutes in minutes.
1175
- hours: O,
1180
+ hours: V,
1176
1181
  minutes: o,
1177
- formatted12: `${O % 12 ? O % 12 : 12}${o ? ":" + o.toString().padStart(2, 0) : ""}${m}`,
1178
- formatted24: `${O.toString().padStart(2, 0)}:${o.toString().padStart(2, 0)}`
1182
+ formatted12: `${V % 12 ? V % 12 : 12}${o ? ":" + o.toString().padStart(2, 0) : ""}${f}`,
1183
+ formatted24: `${V.toString().padStart(2, 0)}:${o.toString().padStart(2, 0)}`
1179
1184
  });
1180
1185
  }
1181
1186
  return _;
1182
1187
  });
1183
- return (_, L) => (Y(), j("div", St, [
1184
- (Y(!0), j(ae, null, he(w.value, (f, O) => (Y(), j("div", {
1188
+ return (_, L) => (Y(), j("div", Yt, [
1189
+ (Y(!0), j(se, null, De(w.value, (g, V) => (Y(), j("div", {
1185
1190
  class: "vuecal__time-cell",
1186
- key: O
1191
+ key: V
1187
1192
  }, [
1188
1193
  F(_.$slots, "time-cell", {
1189
- index: O,
1190
- minutes: f.minutes,
1191
- hours: f.hours,
1192
- minutesSum: f.minutesSum,
1193
- format12: f.formatted12,
1194
- format24: f.formatted24
1194
+ index: V,
1195
+ minutes: g.minutes,
1196
+ hours: g.hours,
1197
+ minutesSum: g.minutesSum,
1198
+ format12: g.formatted12,
1199
+ format24: g.formatted24
1195
1200
  }, () => [
1196
- de("label", null, le(V(r).twelveHour ? f.formatted12 : f.formatted24), 1)
1201
+ me("label", null, re(C(i).twelveHour ? g.formatted12 : g.formatted24), 1)
1197
1202
  ])
1198
1203
  ]))), 128))
1199
1204
  ]));
1200
1205
  }
1201
- }, Vt = ["draggable"], Ot = { class: "vuecal__event-details" }, jt = { class: "vuecal__event-title" }, Pt = {
1206
+ }, Ct = ["draggable"], Vt = { class: "vuecal__event-details" }, Ot = { class: "vuecal__event-title" }, jt = {
1202
1207
  key: 0,
1203
1208
  class: "vuecal__event-time"
1204
- }, zt = ["innerHTML"], Je = {
1209
+ }, Pt = ["innerHTML"], Ue = {
1205
1210
  __name: "event",
1206
1211
  props: {
1207
1212
  event: { type: Object, required: !0 }
1208
1213
  },
1209
1214
  emits: ["event-drag-start", "event-drag-end", "event-resize-start", "event-resize-end"],
1210
- setup(c, { emit: a }) {
1211
- const { config: r, view: h, dnd: w, touch: _, dateUtils: L } = Se("vuecal"), f = c, O = ie(null), o = _e(f.event), m = _e({
1215
+ setup(c, { emit: s }) {
1216
+ const { config: i, view: D, dnd: w, touch: _, dateUtils: L } = Se("vuecal"), g = c, V = ue(null), o = _e(g.event), f = _e({
1212
1217
  dragging: !1,
1213
1218
  resizing: !1,
1214
1219
  fromResizer: !1,
@@ -1242,18 +1247,18 @@ const Ke = (c) => {
1242
1247
  cellEl: null,
1243
1248
  // Store the cell DOM node for a more efficient resizing calc in mousemove/touchmove.
1244
1249
  schedule: null
1245
- }), b = $(() => r.editableEvents.drag && o.draggable !== !1 && !o.background), W = $(() => r.time && r.editableEvents.resize && o.resizable !== !1 && !o.background);
1246
- $(() => r.editableEvents.delete && o.deletable !== !1 && !o.background);
1247
- const R = $(() => {
1248
- var k, s, y;
1250
+ }), b = M(() => i.editableEvents.drag && o.draggable !== !1 && !o.background), W = M(() => i.time && i.editableEvents.resize && o.resizable !== !1 && !o.background);
1251
+ M(() => i.editableEvents.delete && o.deletable !== !1 && !o.background);
1252
+ const X = M(() => {
1253
+ var l, n, k;
1249
1254
  return {
1250
1255
  [`vuecal__event--${o._.id}`]: !0,
1251
1256
  [o.class]: !!o.class,
1252
1257
  "vuecal__event--recurring": !!o.recurring,
1253
1258
  "vuecal__event--background": !!o.background,
1254
- "vuecal__event--multiday": !!((k = o._) != null && k.multiday),
1255
- "vuecal__event--cut-top": ((s = o._) == null ? void 0 : s.startMinutes) < r.timeFrom,
1256
- "vuecal__event--cut-bottom": ((y = o._) == null ? void 0 : y.endMinutes) > r.timeTo || o.end.getDate() !== o.start.getDate(),
1259
+ "vuecal__event--multiday": !!((l = o._) != null && l.multiday),
1260
+ "vuecal__event--cut-top": ((n = o._) == null ? void 0 : n.startMinutes) < i.timeFrom,
1261
+ "vuecal__event--cut-bottom": ((k = o._) == null ? void 0 : k.endMinutes) > i.timeTo || o.end.getDate() !== o.start.getDate(),
1257
1262
  // Only apply the dragging class on the event copy that is being dragged.
1258
1263
  "vuecal__event--dragging": !o._.draggingGhost && o._.dragging,
1259
1264
  // Only apply the dragging-ghost class on the event original that remains fixed while a copy is being
@@ -1263,159 +1268,165 @@ const Ke = (c) => {
1263
1268
  // after event deletion (event._.dragging is already false) so the event ghost does not flash in before
1264
1269
  // deletion.
1265
1270
  "vuecal__event--dragging-ghost": o._.draggingGhost,
1266
- "vuecal__event--resizing": m.resizing
1271
+ "vuecal__event--resizing": f.resizing
1267
1272
  };
1268
- }), u = $(() => {
1269
- const k = (h.isDay || h.isDays || h.isWeek) && r.time;
1270
- if (!k && !o.backgroundColor && !o.color) return !1;
1271
- const s = {
1273
+ }), u = M(() => {
1274
+ const l = (D.isDay || D.isDays || D.isWeek) && i.time;
1275
+ if (!l && !o.backgroundColor && !o.color) return !1;
1276
+ const n = {
1272
1277
  backgroundColor: o.backgroundColor || null,
1273
1278
  color: o.color || null
1274
1279
  };
1275
- if (k) {
1276
- const y = Math.max(r.timeFrom, o._.startMinutes), T = Math.min(r.timeTo, o._.endMinutes), t = Te(y, r), P = Te(T, r) - t;
1277
- s.top = `${t}%`, s.height = `${P}%`;
1280
+ if (l) {
1281
+ const k = Math.max(i.timeFrom, o._.startMinutes), t = Math.min(i.timeTo, o._.endMinutes), O = Te(k, i), z = Te(t, i) - O;
1282
+ n.top = `${O}%`, n.height = `${z}%`;
1278
1283
  }
1279
- return s;
1280
- }), d = $(() => {
1281
- const k = { ...r.eventListeners.event };
1282
- Object.entries(k).forEach(([T, t]) => {
1283
- ["resize-end"].includes(T) || (k[T] = (P) => {
1284
- P.type !== "drop" && t(P.type ? { e: P, event: o } : P);
1284
+ return n;
1285
+ }), d = M(() => {
1286
+ const l = { ...i.eventListeners.event };
1287
+ Object.entries(l).forEach(([t, O]) => {
1288
+ ["resize-end"].includes(t) || (l[t] = (z) => {
1289
+ z.type !== "drop" && O(z.type ? { e: z, event: o } : z);
1285
1290
  });
1286
1291
  });
1287
- const s = { ...k };
1288
- k.touchstart = (T) => {
1289
- var t;
1290
- T.stopPropagation(), (t = s.touchstart) == null || t.call(s, { e: T, event: o });
1291
- }, k.mousedown = (T) => {
1292
- var t;
1293
- T.stopPropagation(), e(T), (t = s.mousedown) == null || t.call(s, { e: T, event: o });
1292
+ const n = { ...l };
1293
+ l.touchstart = (t) => {
1294
+ var O;
1295
+ t.stopPropagation(), (O = n.touchstart) == null || O.call(n, { e: t, event: o });
1296
+ }, l.mousedown = (t) => {
1297
+ var O;
1298
+ t.stopPropagation(), e(t), (O = n.mousedown) == null || O.call(n, { e: t, event: o });
1294
1299
  };
1295
- let y = null;
1296
- return k.click = (T) => {
1297
- var t;
1298
- (t = s.click) == null || t.call(s, { e: T, event: o }), y ? y = clearTimeout(y) : y = setTimeout(() => {
1299
- var P;
1300
- y = null, (P = s["delayed-click"]) == null || P.call(s, { e: T, event: o });
1300
+ let k = null;
1301
+ return l.click = (t) => {
1302
+ var O;
1303
+ (O = n.click) == null || O.call(n, { e: t, event: o }), k ? k = clearTimeout(k) : k = setTimeout(() => {
1304
+ var z;
1305
+ k = null, (z = n["delayed-click"]) == null || z.call(n, { e: t, event: o });
1301
1306
  }, 400);
1302
- }, k.dblclick = (T) => {
1303
- s.dblclick ? s.dblclick({ e: T, event: o }) : o.delete(1);
1304
- }, k;
1305
- }), e = (k) => {
1306
- var T, t, P;
1307
- const s = ((T = k.touches) == null ? void 0 : T[0]) || k;
1308
- m.fromResizer = s.target.matches(".vuecal__event-resizer, .vuecal__event-resizer *");
1309
- const y = O.value.getBoundingClientRect();
1310
- m.startX = (((t = k.touches) == null ? void 0 : t[0]) || k).clientX - y.left, m.startY = (((P = k.touches) == null ? void 0 : P[0]) || k).clientY - y.top, m.startPercentageX = m.startX * 100 / y.width, m.startPercentageY = m.startY * 100 / y.height, m.cellEl = O.value.closest(".vuecal__cell"), m.resizeStartDate = o.start, document.addEventListener(k.type === "touchstart" ? "touchmove" : "mousemove", i), document.addEventListener(k.type === "touchstart" ? "touchend" : "mouseup", D, { once: !0 }), m.holdTimer = setTimeout(() => {
1311
- var A, J;
1312
- m.holding = !0, (J = (A = d.value).hold) == null || J.call(A, { e: k, event: o });
1307
+ }, l.dblclick = (t) => {
1308
+ n.dblclick ? n.dblclick({ e: t, event: o }) : o.delete(1);
1309
+ }, l;
1310
+ }), e = (l) => {
1311
+ var t, O, z;
1312
+ const n = ((t = l.touches) == null ? void 0 : t[0]) || l;
1313
+ f.fromResizer = n.target.matches(".vuecal__event-resizer, .vuecal__event-resizer *");
1314
+ const k = V.value.getBoundingClientRect();
1315
+ f.startX = (((O = l.touches) == null ? void 0 : O[0]) || l).clientX - k.left, f.startY = (((z = l.touches) == null ? void 0 : z[0]) || l).clientY - k.top, f.startPercentageX = f.startX * 100 / k.width, f.startPercentageY = f.startY * 100 / k.height, f.cellEl = V.value.closest(".vuecal__cell"), f.resizeStartDate = o.start, B(l.type === "touchstart" ? "touchmove" : "mousemove", v), B(l.type === "touchstart" ? "touchend" : "mouseup", y, { once: !0 }), f.holdTimer = setTimeout(() => {
1316
+ var R, Q;
1317
+ f.holding = !0, (Q = (R = d.value).hold) == null || Q.call(R, { e: l, event: o });
1313
1318
  }, 1e3);
1314
- }, i = async (k) => {
1315
- var y, T, t, P;
1316
- const s = ((y = k.touches) == null ? void 0 : y[0]) || k;
1317
- if (m.fromResizer && !m.resizing && (m.resizing = !0, m.resizingOriginalEvent = { ...o, _: { ...o._ } }, _.isResizingEvent = !0, (t = (T = d.value).resizeStart) == null || t.call(T, { e: k, event: o })), m.holdTimer = clearTimeout(m.holdTimer), m.holding = !1, m.cellEl) {
1318
- const { top: A, left: J, width: re, height: x } = m.cellEl.getBoundingClientRect();
1319
- m.moveX = s.clientX - J, m.moveY = s.clientY - A, m.movePercentageX = m.moveX * 100 / re, m.movePercentageY = m.moveY * 100 / x;
1319
+ }, v = async (l) => {
1320
+ var k, t, O, z;
1321
+ const n = ((k = l.touches) == null ? void 0 : k[0]) || l;
1322
+ if (f.fromResizer && !f.resizing && (f.resizing = !0, f.resizingOriginalEvent = { ...o, _: { ...o._ } }, _.isResizingEvent = !0, (O = (t = d.value).resizeStart) == null || O.call(t, { e: l, event: o })), f.holdTimer = clearTimeout(f.holdTimer), f.holding = !1, f.cellEl) {
1323
+ const { top: R, left: Q, width: ee, height: ie } = f.cellEl.getBoundingClientRect();
1324
+ f.moveX = n.clientX - Q, f.moveY = n.clientY - R, f.movePercentageX = f.moveX * 100 / ee, f.movePercentageY = f.moveY * 100 / ie;
1320
1325
  }
1321
- if (m.fromResizer) {
1322
- const { newStart: A, newEnd: J } = H(o);
1323
- let re = !0;
1324
- const { resize: x } = (P = r.eventListeners) == null ? void 0 : P.event;
1325
- x && (re = await x({
1326
- e: k,
1327
- event: { ...o, start: A, end: J },
1328
- overlaps: o.getOverlappingEvents({ start: A, end: J })
1329
- })), re !== !1 ? (o.start = A, o.end = J, m.resizingLastAcceptedEvent && (m.resizingLastAcceptedEvent = null)) : x && (m.resizingLastAcceptedEvent = { ...o, _: { ...o._ } });
1326
+ if (f.fromResizer) {
1327
+ const { newStart: R, newEnd: Q } = E(o);
1328
+ let ee = !0;
1329
+ const { resize: ie } = (z = i.eventListeners) == null ? void 0 : z.event;
1330
+ ie && (ee = await ie({
1331
+ e: l,
1332
+ event: { ...o, start: R, end: Q },
1333
+ overlaps: o.getOverlappingEvents({ start: R, end: Q })
1334
+ })), ee !== !1 ? (o.start = R, o.end = Q, f.resizingLastAcceptedEvent && (f.resizingLastAcceptedEvent = null)) : ie && (f.resizingLastAcceptedEvent = { ...o, _: { ...o._ } });
1330
1335
  }
1331
- }, D = async (k) => {
1332
- var s, y;
1333
- if (m.holdTimer = clearTimeout(m.holdTimer), m.holding = !1, m.resizing) {
1334
- const { newStart: T, newEnd: t } = H(o);
1335
- let P = !0;
1336
- const A = d.value["resize-end"];
1337
- A && (P = await A({
1338
- e: k,
1336
+ }, y = async (l) => {
1337
+ var n, k;
1338
+ if (f.holdTimer = clearTimeout(f.holdTimer), f.holding = !1, f.resizing) {
1339
+ const { newStart: t, newEnd: O } = E(o);
1340
+ let z = !0;
1341
+ const R = d.value["resize-end"];
1342
+ R && (z = await R({
1343
+ e: l,
1339
1344
  event: o,
1340
- original: m.resizingOriginalEvent,
1345
+ original: f.resizingOriginalEvent,
1341
1346
  // Original event details before resizing.
1342
- overlaps: o.getOverlappingEvents({ start: T, end: t })
1343
- })), o.start = P === !1 ? (m.resizingLastAcceptedEvent || m.resizingOriginalEvent).start : ((s = m.resizingLastAcceptedEvent) == null ? void 0 : s.start) || T, o.end = P === !1 ? (m.resizingLastAcceptedEvent || m.resizingOriginalEvent).end : ((y = m.resizingLastAcceptedEvent) == null ? void 0 : y.end) || t, o._.duration < 1 && (o.start = m.resizingOriginalEvent.start, o.end = m.resizingOriginalEvent.end), _.isResizingEvent = !1;
1347
+ overlaps: o.getOverlappingEvents({ start: t, end: O })
1348
+ })), o.start = z === !1 ? (f.resizingLastAcceptedEvent || f.resizingOriginalEvent).start : ((n = f.resizingLastAcceptedEvent) == null ? void 0 : n.start) || t, o.end = z === !1 ? (f.resizingLastAcceptedEvent || f.resizingOriginalEvent).end : ((k = f.resizingLastAcceptedEvent) == null ? void 0 : k.end) || O, o._.duration < 1 && (o.start = f.resizingOriginalEvent.start, o.end = f.resizingOriginalEvent.end), _.isResizingEvent = !1;
1344
1349
  }
1345
- document.removeEventListener(k.type === "touchmove" ? "touchmove" : "mousemove", i), m.resizing = !1, m.fromResizer = !1, m.dragging = !1, m.startX = 0, m.startY = 0, m.moveX = 0, m.moveY = 0, m.startPercentageX = 0, m.startPercentageY = 0, m.movePercentageX = 0, m.movePercentageY = 0, m.cellEl = null, m.resizeStartDate = null, m.resizingOriginalEvent = null, m.resizingLastAcceptedEvent = null, m.schedule = null;
1346
- }, S = () => {
1347
- O.value.dispatchEvent(new CustomEvent("event-deleted", { detail: o._.id }));
1348
- }, H = (k) => {
1349
- const s = new Date(k.start.getFullYear(), k.start.getMonth(), k.start.getDate());
1350
- new Date(s).setDate(s.getDate() + 1);
1351
- let T = Ee(m.movePercentageY, r);
1352
- if (T = Math.max(0, Math.min(T, 24 * 60)), r.snapToInterval) {
1353
- const A = T + r.snapToInterval / 2;
1354
- T = A - A % r.snapToInterval;
1350
+ document.removeEventListener(l.type === "touchend" ? "touchmove" : "mousemove", v), f.resizing = !1, f.fromResizer = !1, f.dragging = !1, f.startX = 0, f.startY = 0, f.moveX = 0, f.moveY = 0, f.startPercentageX = 0, f.startPercentageY = 0, f.movePercentageX = 0, f.movePercentageY = 0, f.cellEl = null, f.resizeStartDate = null, f.resizingOriginalEvent = null, f.resizingLastAcceptedEvent = null, f.schedule = null;
1351
+ }, E = (l) => {
1352
+ const n = new Date(l.start.getFullYear(), l.start.getMonth(), l.start.getDate());
1353
+ new Date(n).setDate(n.getDate() + 1);
1354
+ let t = Ee(f.movePercentageY, i);
1355
+ if (t = Math.max(0, Math.min(t, 24 * 60)), i.snapToInterval) {
1356
+ const R = t + i.snapToInterval / 2;
1357
+ t = R - R % i.snapToInterval;
1355
1358
  }
1356
- let t = k.start, P = new Date(s.getTime() + T * 6e4);
1357
- return P < m.resizeStartDate && (t = P, P = m.resizeStartDate), { newStart: t, newEnd: P };
1359
+ let O = l.start, z = new Date(n.getTime() + t * 6e4);
1360
+ return z < f.resizeStartDate && (O = z, z = f.resizeStartDate), { newStart: O, newEnd: z };
1358
1361
  };
1359
- return We(() => o._.register(O.value)), et(() => o._.unregister()), (k, s) => (Y(), j("div", me({ class: "vuecal__event" }, je(d.value, !0), {
1362
+ Ae(() => o._.register(V.value));
1363
+ const H = [], B = (l, n, k) => {
1364
+ document.addEventListener(l, n, k), H.push({ event: l, handler: n, options: k });
1365
+ };
1366
+ return ze(() => {
1367
+ o._.unregister(), H.forEach(({ event: l, handler: n, options: k }) => {
1368
+ document.removeEventListener(l, n, k);
1369
+ });
1370
+ }), (l, n) => (Y(), j("div", ge({ class: "vuecal__event" }, je(d.value, !0), {
1360
1371
  ref_key: "eventEl",
1361
- ref: O,
1362
- class: R.value,
1372
+ ref: V,
1373
+ class: X.value,
1363
1374
  style: u.value,
1364
- draggable: b.value,
1365
- onDragstart: s[1] || (s[1] = (y) => b.value && V(w).eventDragStart(y, o)),
1366
- onDragend: s[2] || (s[2] = (y) => b.value && V(w).eventDragEnd(y, o))
1375
+ draggable: b.value ? "true" : void 0,
1376
+ onDragstart: n[2] || (n[2] = (k) => b.value && C(w).eventDragStart(k, o)),
1377
+ onDragend: n[3] || (n[3] = (k) => b.value && C(w).eventDragEnd(k, o))
1367
1378
  }), [
1368
- de("div", Ot, [
1369
- F(k.$slots, "event", { event: o }, () => [
1370
- de("div", jt, le(o.title), 1),
1371
- V(r).time ? (Y(), j("div", Pt, le(o._[`startTimeFormatted${V(r).twelveHour ? 12 : 24}`]) + `
1372
- - ` + le(o._[`endTimeFormatted${V(r).twelveHour ? 12 : 24}`]), 1)) : Z("", !0),
1373
- de("div", {
1379
+ me("div", Vt, [
1380
+ F(l.$slots, "event", { event: o }, () => [
1381
+ me("div", Ot, re(o.title), 1),
1382
+ C(i).time ? (Y(), j("div", jt, re(o._[`startTimeFormatted${C(i).twelveHour ? 12 : 24}`]) + `
1383
+ - ` + re(o._[`endTimeFormatted${C(i).twelveHour ? 12 : 24}`]), 1)) : Z("", !0),
1384
+ me("div", {
1374
1385
  class: "vuecal__event-content",
1375
1386
  innerHTML: o.content
1376
- }, null, 8, zt)
1387
+ }, null, 8, Pt)
1377
1388
  ])
1378
1389
  ]),
1379
1390
  W.value ? (Y(), j("div", {
1380
1391
  key: 0,
1381
1392
  class: "vuecal__event-resizer",
1382
- onDragstart: s[0] || (s[0] = Xe(() => {
1393
+ onDragstart: n[0] || (n[0] = Ge(() => {
1383
1394
  }, ["prevent", "stop"]))
1384
1395
  }, null, 32)) : Z("", !0),
1385
- Me(ze, { name: "vuecal-delete-btn" }, {
1396
+ Me(He, { name: "vuecal-delete-btn" }, {
1386
1397
  default: q(() => [
1387
1398
  o._.deleting ? (Y(), j("div", {
1388
1399
  key: 0,
1389
1400
  class: "vuecal__event-delete",
1390
- onClick: Xe(S, ["stop"])
1401
+ onClick: n[1] || (n[1] = Ge((k) => o.delete(3), ["stop"]))
1391
1402
  }, "Delete")) : Z("", !0)
1392
1403
  ]),
1393
1404
  _: 1
1394
1405
  })
1395
- ], 16, Vt));
1406
+ ], 16, Ct));
1396
1407
  }
1397
- }, Ht = ["innerHTML"], Lt = ["data-schedule"], Ft = {
1408
+ }, zt = ["innerHTML"], Ht = ["data-schedule"], Lt = {
1398
1409
  key: 1,
1399
1410
  class: "vuecal__cell-date"
1400
- }, Nt = {
1411
+ }, Ft = {
1401
1412
  key: 2,
1402
1413
  class: "vuecal__cell-content"
1403
- }, Wt = {
1414
+ }, Nt = {
1404
1415
  key: 3,
1405
1416
  class: "vuecal__cell-events"
1406
- }, At = {
1417
+ }, Wt = {
1407
1418
  key: 1,
1408
1419
  class: "vuecal__cell-date"
1409
- }, Bt = {
1420
+ }, At = {
1410
1421
  key: 2,
1411
1422
  class: "vuecal__cell-content"
1412
- }, It = {
1423
+ }, Bt = {
1413
1424
  key: 3,
1414
1425
  class: "vuecal__cell-events"
1415
- }, Rt = {
1426
+ }, It = {
1416
1427
  key: 5,
1417
1428
  class: "vuecal__cell-events-count"
1418
- }, Xt = ["title"], Gt = {
1429
+ }, Rt = ["title"], Xt = {
1419
1430
  __name: "cell",
1420
1431
  props: {
1421
1432
  // Even with time=false, the date of the cell will still be provided in order to attach
@@ -1425,8 +1436,8 @@ const Ke = (c) => {
1425
1436
  index: { type: Number, required: !0 }
1426
1437
  },
1427
1438
  setup(c) {
1428
- const a = c, r = Se("vuecal"), { view: h, config: w, dateUtils: _, eventsManager: L, dnd: f, touch: O } = r, o = $(() => _.isToday(a.start)), m = ie(null), b = ie([]), W = ie(!1), R = (l) => {
1429
- b.value.push(l.detail), W.value = !0;
1439
+ const s = c, i = Se("vuecal"), { view: D, config: w, dateUtils: _, eventsManager: L, dnd: g, touch: V } = i, o = M(() => _.isToday(s.start)), f = ue(null), b = ue([]), W = ue(!1), X = (r) => {
1440
+ b.value.push(r.detail), W.value = !0;
1430
1441
  }, u = () => setTimeout(() => W.value = !1, 300), d = _e({
1431
1442
  dragging: !1,
1432
1443
  holding: !1,
@@ -1448,260 +1459,261 @@ const Ke = (c) => {
1448
1459
  movePercentageX: 0,
1449
1460
  movePercentageY: 0,
1450
1461
  schedule: null
1451
- }), e = ie(!1), i = $(() => {
1452
- let l = Math.min(d.startPercentageY, d.movePercentageY), M = Math.max(d.startPercentageY, d.movePercentageY), C = Ee(l, w), E = Ee(M, w);
1453
- return w.snapToInterval && (C = _.snapToInterval(C, w.snapToInterval), E = _.snapToInterval(E, w.snapToInterval), l = Te(C, w), M = Te(E, w)), {
1462
+ }), e = ue(!1), v = ue({ cellOverlaps: {}, longestStreak: 0 }), y = M(() => {
1463
+ let r = Math.min(d.startPercentageY, d.movePercentageY), T = Math.max(d.startPercentageY, d.movePercentageY), S = Ee(r, w), $ = Ee(T, w);
1464
+ return w.snapToInterval && (S = _.snapToInterval(S, w.snapToInterval), $ = _.snapToInterval($, w.snapToInterval), r = Te(S, w), T = Te($, w)), {
1454
1465
  style: {
1455
- top: l + "%",
1456
- height: Math.abs(M - l) + "%"
1466
+ top: r + "%",
1467
+ height: Math.abs(T - r) + "%"
1457
1468
  },
1458
- startMinutes: C,
1459
- endMinutes: E,
1460
- start: _.formatMinutes(C),
1461
- end: _.formatMinutes(E),
1469
+ startMinutes: S,
1470
+ endMinutes: $,
1471
+ start: _.formatMinutes(S),
1472
+ end: _.formatMinutes($),
1462
1473
  ...d.schedule ? { schedule: d.schedule } : {}
1463
1474
  };
1464
- }), D = $(() => {
1465
- const l = w.editableEvents.create && (d.dragging || e.value), M = w.eventCreateMinDrag && d.thresholdPassed || !w.eventCreateMinDrag;
1466
- return l && M;
1467
- }), S = $(() => {
1468
- var ee;
1469
- const l = /* @__PURE__ */ new Date(), M = h.start.getFullYear(), C = h.start.getMonth(), E = a.start.getFullYear(), B = a.start.getMonth();
1475
+ }), E = M(() => {
1476
+ const r = w.editableEvents.create && (d.dragging || e.value), T = w.eventCreateMinDrag && d.thresholdPassed || !w.eventCreateMinDrag;
1477
+ return r && T;
1478
+ }), H = M(() => {
1479
+ var te;
1480
+ const r = /* @__PURE__ */ new Date(), T = D.start.getFullYear(), S = D.start.getMonth(), $ = s.start.getFullYear(), A = s.start.getMonth();
1470
1481
  return {
1471
- [`vuecal__cell--${Pe[a.start.getDay()]}`]: h.isDay || h.isDays || h.isWeek || h.isMonth,
1472
- [`vuecal__cell--${lt[B]}`]: h.isYear,
1473
- [`vuecal__cell--${E}`]: h.isYears,
1482
+ [`vuecal__cell--${Pe[s.start.getDay()]}`]: D.isDay || D.isDays || D.isWeek || D.isMonth,
1483
+ [`vuecal__cell--${nt[A]}`]: D.isYear,
1484
+ [`vuecal__cell--${$}`]: D.isYears,
1474
1485
  "vuecal__cell--today": o.value,
1475
- "vuecal__cell--current-month": h.isYear && E === l.getFullYear() && B === l.getMonth(),
1476
- "vuecal__cell--current-year": h.isYears && E === l.getFullYear(),
1477
- "vuecal__cell--out-of-range": h.isMonth && (E !== M || B !== C),
1478
- "vuecal__cell--before-min": ue.value && x.value,
1479
- "vuecal__cell--after-max": ue.value && be.value,
1480
- "vuecal__cell--disabled": ue.value,
1481
- "vuecal__cell--selected": h.selectedDate && h.selectedDate.getTime() >= a.start.getTime() && h.selectedDate.getTime() <= a.end.getTime(),
1482
- "vuecal__cell--has-schedules": (ee = w.schedules) == null ? void 0 : ee.length,
1486
+ "vuecal__cell--current-month": D.isYear && $ === r.getFullYear() && A === r.getMonth(),
1487
+ "vuecal__cell--current-year": D.isYears && $ === r.getFullYear(),
1488
+ "vuecal__cell--out-of-range": D.isMonth && ($ !== T || A !== S),
1489
+ "vuecal__cell--before-min": ie.value && Q.value,
1490
+ "vuecal__cell--after-max": ie.value && ee.value,
1491
+ "vuecal__cell--disabled": ie.value,
1492
+ "vuecal__cell--selected": D.selectedDate && D.selectedDate.getTime() >= s.start.getTime() && D.selectedDate.getTime() <= s.end.getTime(),
1493
+ "vuecal__cell--has-schedules": (te = w.schedules) == null ? void 0 : te.length,
1483
1494
  "vuecal__cell--dragging": d.dragging,
1484
- "vuecal__cell--has-events": s.value.length
1495
+ "vuecal__cell--has-events": n.value.length
1485
1496
  };
1486
- }), H = $(() => _.formatDate(a.start)), k = $(() => {
1487
- switch (h.id) {
1497
+ }), B = M(() => _.formatDate(s.start)), l = M(() => {
1498
+ switch (D.id) {
1488
1499
  case "day":
1489
1500
  return "";
1490
1501
  case "days":
1491
- return w.availableViews.days.rows > 1 && _.formatDate(a.start, "D"), "";
1502
+ return w.availableViews.days.rows > 1 && _.formatDate(s.start, "D"), "";
1492
1503
  case "week":
1493
1504
  return "";
1494
1505
  case "month":
1495
- return _.formatDate(a.start, "D");
1506
+ return _.formatDate(s.start, "D");
1496
1507
  case "year":
1497
- return _.formatDate(a.start, w.xs ? "MMM" : "MMMM");
1508
+ return _.formatDate(s.start, w.xs ? "MMM" : "MMMM");
1498
1509
  case "years":
1499
- return _.formatDate(a.start, "YYYY");
1510
+ return _.formatDate(s.start, "YYYY");
1500
1511
  }
1501
- }), s = $(() => w.datePicker ? [] : L.getEventsByDate(H.value, !0, !0).filter((l) => !b.value.includes(l._.id))), y = $(() => s.value.filter((l) => !l.background)), T = $(() => {
1502
- var l;
1503
- return (l = w.schedules) == null ? void 0 : l.reduce((M, C) => (M[C.id] = s.value.filter((E) => E.schedule === C.id), M), {});
1504
- }), t = ie({ cellOverlaps: {}, longestStreak: 0 });
1505
- oe(
1506
- // Watch event IDs and start/end dates (only) to detect event resizing/dnd.
1507
- () => y.value.map((l) => `${l._.id} ${l.start.getTime()} ${l.end.getTime()}`).join(),
1508
- () => {
1509
- t.value = L.getCellOverlappingEvents(H.value);
1510
- },
1511
- { immediate: !0 }
1512
- );
1513
- const P = $(() => {
1514
- const l = {};
1515
- for (const M of s.value) {
1516
- const C = M._.id, { maxConcurrent: E = 1, position: B = 0 } = t.value.cellOverlaps[C] || {};
1517
- l[C] = {
1518
- width: `${100 / E}%`,
1519
- left: `${100 / E * B}%`
1512
+ }), n = M(() => w.datePicker ? [] : L.getEventsByDate(B.value, !0, !0).filter((r) => !b.value.includes(r._.id))), k = M(() => n.value.filter((r) => !r.background)), t = M(() => {
1513
+ var r;
1514
+ return (r = w.schedules) == null ? void 0 : r.reduce((T, S) => (T[S.id] = n.value.filter(($) => $.schedule === S.id), T), {});
1515
+ }), O = M(() => {
1516
+ const r = {};
1517
+ for (const T of n.value) {
1518
+ const S = T._.id, { maxConcurrent: $ = 1, position: A = 0 } = v.value.cellOverlaps[S] || {};
1519
+ r[S] = {
1520
+ width: `${100 / $}%`,
1521
+ left: `${100 / $ * A}%`
1520
1522
  };
1521
1523
  }
1522
- return l;
1523
- }), A = () => {
1524
- t.value = L.getCellOverlappingEvents(H.value);
1525
- }, J = $(() => h.isMonth && w.eventCount && !w.eventsOnMonthView && y.value.length), re = $(() => {
1526
- var C;
1527
- if (!w.specialHours || h.isMonth || h.isYear || h.isYears) return;
1528
- const l = Pe[a.start.getDay()];
1529
- let M = (C = w.specialHours) == null ? void 0 : C[l];
1530
- if (M)
1531
- return Array.isArray(M) || (M = [M]), M.map((E) => {
1532
- let { from: B, to: I, class: ee, label: g } = E;
1533
- if (isNaN(B) || isNaN(I) || w.timeFrom >= I || w.timeTo <= B) return;
1534
- B = Math.max(w.timeFrom, B), I = Math.min(w.timeTo, I);
1535
- const z = Te(B, w), N = Te(I, w) - z;
1524
+ return r;
1525
+ }), z = M(() => D.isMonth && w.eventCount && !w.eventsOnMonthView && k.value.length), R = M(() => {
1526
+ var S;
1527
+ if (!w.specialHours || D.isMonth || D.isYear || D.isYears) return;
1528
+ const r = Pe[s.start.getDay()];
1529
+ let T = (S = w.specialHours) == null ? void 0 : S[r];
1530
+ if (T)
1531
+ return Array.isArray(T) || (T = [T]), T.map(($) => {
1532
+ let { from: A, to: I, class: te, label: h } = $;
1533
+ if (isNaN(A) || isNaN(I) || w.timeFrom >= I || w.timeTo <= A) return;
1534
+ A = Math.max(w.timeFrom, A), I = Math.min(w.timeTo, I);
1535
+ const P = Te(A, w), N = Te(I, w) - P;
1536
1536
  return {
1537
- style: { top: `${z}%`, height: `${N}%` },
1538
- label: g,
1539
- class: ee
1537
+ style: { top: `${P}%`, height: `${N}%` },
1538
+ label: h,
1539
+ class: te
1540
1540
  };
1541
- }).filter((E) => !!E);
1542
- }), x = $(() => w.minTimestamp !== null && w.minTimestamp > a.end.getTime()), be = $(() => w.maxTimestamp && w.maxTimestamp < a.start.getTime()), ue = $(() => {
1543
- const { disableDays: l } = w, M = h.isYear || h.isYears;
1544
- return l.length && l.includes(_.formatDate(a.start)) && !M ? !0 : x.value || be.value;
1545
- }), De = _e({
1546
- show: $(() => {
1547
- if (!(!h.isDay && !h.isDays && !h.isWeek) && !(!o.value || !w.time) && !(w.timeFrom > _.dateToMinutes(h.now)) && !(_.dateToMinutes(h.now) > w.timeTo))
1541
+ }).filter(($) => !!$);
1542
+ }), Q = M(() => w.minTimestamp !== null && w.minTimestamp > s.end.getTime()), ee = M(() => w.maxTimestamp && w.maxTimestamp < s.start.getTime()), ie = M(() => {
1543
+ const { disableDays: r } = w, T = D.isYear || D.isYears;
1544
+ return r.length && r.includes(_.formatDate(s.start)) && !T ? !0 : Q.value || ee.value;
1545
+ }), oe = _e({
1546
+ show: M(() => {
1547
+ if (!(!D.isDay && !D.isDays && !D.isWeek) && !(!o.value || !w.time) && !(w.timeFrom > _.dateToMinutes(D.now)) && !(_.dateToMinutes(D.now) > w.timeTo))
1548
1548
  return !0;
1549
1549
  }),
1550
- nowInMinutes: $(() => _.dateToMinutes(h.now)),
1551
- todaysTimePosition: $(() => Te(De.nowInMinutes, w)),
1552
- style: $(() => `top: ${De.todaysTimePosition}%`),
1553
- currentTime: $(() => _.formatTime(h.now))
1554
- }), fe = $(() => {
1555
- if (ue.value) return {};
1556
- const l = { ...w.eventListeners.cell };
1557
- Object.entries(l).forEach(([E, B]) => {
1558
- l[E] = (I) => {
1559
- var ee, g, z;
1560
- (z = (g = I.target || ((ee = I.e) == null ? void 0 : ee.target)).closest) != null && z.call(g, ".vuecal__event") || B(I.type ? { e: I, cell: X.value, cursor: U.value } : I);
1550
+ nowInMinutes: M(() => _.dateToMinutes(D.now)),
1551
+ todaysTimePosition: M(() => Te(oe.nowInMinutes, w)),
1552
+ style: M(() => `top: ${oe.todaysTimePosition}%`),
1553
+ currentTime: M(() => _.formatTime(D.now))
1554
+ }), he = M(() => {
1555
+ if (ie.value) return {};
1556
+ const r = { ...w.eventListeners.cell };
1557
+ Object.entries(r).forEach(([$, A]) => {
1558
+ r[$] = (I) => {
1559
+ var te, h, P;
1560
+ (P = (h = I.target || ((te = I.e) == null ? void 0 : te.target)).closest) != null && P.call(h, ".vuecal__event") || A(I.type ? { e: I, cell: x.value, cursor: J.value } : I);
1561
1561
  };
1562
1562
  });
1563
- const M = { ...l };
1564
- let C = null;
1565
- return l.click = (E) => {
1566
- var B;
1567
- n(), (B = M.click) == null || B.call(M, { e: E, cell: X.value, cursor: U.value }), C ? C = clearTimeout(C) : C = setTimeout(() => {
1563
+ const T = { ...r };
1564
+ let S = null;
1565
+ return r.click = ($) => {
1566
+ var A;
1567
+ ce(), (A = T.click) == null || A.call(T, { e: $, cell: x.value, cursor: J.value }), S ? S = clearTimeout(S) : S = setTimeout(() => {
1568
1568
  var I;
1569
- C = null, (I = M["delayed-click"]) == null || I.call(M, { e: E, cell: X.value, cursor: U.value });
1569
+ S = null, (I = T["delayed-click"]) == null || I.call(T, { e: $, cell: x.value, cursor: J.value });
1570
1570
  }, 400);
1571
- }, (w.time && h.isDay || h.isDays || h.isWeek) && (l.touchstart = (E) => {
1572
- var B;
1573
- p(E.e || E), (B = M.touchstart) == null || B.call(M, { e: E, cell: X.value, cursor: U.value });
1574
- }, l.mousedown = (E) => {
1575
- var B;
1576
- p(E.e || E), (B = M.mousedown) == null || B.call(M, { e: E, cell: X.value, cursor: U.value });
1577
- }), M.dblclick && (l.dblclick = (E) => {
1578
- var Q, te;
1579
- const B = (((Q = E.touches) == null ? void 0 : Q[0]) || E).clientY, { top: I } = m.value.getBoundingClientRect(), ee = Ae(B - I, m.value), g = Ee(ee, w), z = new Date(a.start);
1580
- z.setMinutes(g);
1571
+ }, (w.time && D.isDay || D.isDays || D.isWeek) && (r.touchstart = ($) => {
1572
+ var A;
1573
+ a($.e || $), (A = T.touchstart) == null || A.call(T, { e: $, cell: x.value, cursor: J.value });
1574
+ }, r.mousedown = ($) => {
1575
+ var A;
1576
+ a($.e || $), (A = T.mousedown) == null || A.call(T, { e: $, cell: x.value, cursor: J.value });
1577
+ }), T.dblclick && (r.dblclick = ($) => {
1578
+ var K, ae;
1579
+ const A = (((K = $.touches) == null ? void 0 : K[0]) || $).clientY, { top: I } = f.value.getBoundingClientRect(), te = Be(A - I, f.value), h = Ee(te, w), P = new Date(s.start);
1580
+ P.setMinutes(h);
1581
1581
  const N = {
1582
- y: ee,
1583
- date: z
1582
+ y: te,
1583
+ date: P
1584
1584
  };
1585
- (te = M.dblclick) == null || te.call(M, { e: E, cell: X.value, cursor: N });
1586
- }), w.editableEvents.drag && (l.dragenter = (E) => f.cellDragEnter(E, X.value), l.dragover = (E) => f.cellDragOver(E, X.value), l.dragleave = (E) => f.cellDragLeave(E, X.value), l.drop = (E) => f.cellDragDrop(E, X.value)), l;
1587
- }), X = $(() => ({
1588
- start: a.start,
1589
- end: a.end,
1590
- events: s,
1585
+ (ae = T.dblclick) == null || ae.call(T, { e: $, cell: x.value, cursor: N });
1586
+ }), w.editableEvents.drag && (r.dragenter = ($) => g.cellDragEnter($, x.value), r.dragover = ($) => {
1587
+ $.preventDefault(), g.cellDragOver($, x.value);
1588
+ }, r.dragleave = ($) => g.cellDragLeave($, x.value), r.drop = ($) => g.cellDragDrop($, x.value)), r;
1589
+ }), x = M(() => ({
1590
+ start: s.start,
1591
+ end: s.end,
1592
+ events: n,
1591
1593
  ...d.schedule ? { schedule: d.schedule } : {}
1592
- })), U = $(() => {
1593
- const l = Ee(d.movePercentageY || d.startPercentageY, w), M = new Date(a.start);
1594
- return M.setMinutes(l), {
1594
+ })), J = M(() => {
1595
+ const r = Ee(d.movePercentageY || d.startPercentageY, w), T = new Date(s.start);
1596
+ return T.setMinutes(r), {
1595
1597
  x: d.movePercentageX || d.startPercentageX,
1596
1598
  y: d.movePercentageY || d.startPercentageY,
1597
- date: M
1599
+ date: T
1598
1600
  };
1599
- }), n = () => {
1600
- h.updateSelectedDate(a.start), w.clickToNavigate && ((h.isMonth || h.isDays || h.isWeek) && w.availableViews.day ? h.switch("day") : h.isYear && w.availableViews.month ? h.switch("month") : h.isYears && w.availableViews.year && h.switch("year")), h.updateViewDate(a.start);
1601
- }, p = (l) => {
1602
- var C, E;
1603
- d.schedule = ~~l.target.dataset.schedule;
1604
- const M = m.value.getBoundingClientRect();
1605
- d.startX = (((C = l.touches) == null ? void 0 : C[0]) || l).clientX - M.left, d.startY = (((E = l.touches) == null ? void 0 : E[0]) || l).clientY - M.top, d.startPercentageX = d.startX * 100 / M.width, d.startPercentageY = d.startY * 100 / M.height, d.thresholdPassed = !1, document.addEventListener(l.type === "touchstart" ? "touchmove" : "mousemove", v), document.addEventListener(l.type === "touchstart" ? "touchend" : "mouseup", G, { once: !0 }), d.holdTimer = setTimeout(() => {
1606
- var B, I;
1607
- d.holding = !0, (I = (B = fe.value).hold) == null || I.call(B, { e: l, cell: X.value, cursor: U.value });
1601
+ }), ce = () => {
1602
+ D.updateSelectedDate(s.start), w.clickToNavigate && ((D.isMonth || D.isDays || D.isWeek) && w.availableViews.day ? D.switch("day") : D.isYear && w.availableViews.month ? D.switch("month") : D.isYears && w.availableViews.year && D.switch("year")), D.updateViewDate(s.start);
1603
+ }, a = (r) => {
1604
+ var S, $;
1605
+ d.schedule = ~~r.target.dataset.schedule;
1606
+ const T = f.value.getBoundingClientRect();
1607
+ d.startX = (((S = r.touches) == null ? void 0 : S[0]) || r).clientX - T.left, d.startY = ((($ = r.touches) == null ? void 0 : $[0]) || r).clientY - T.top, d.startPercentageX = d.startX * 100 / T.width, d.startPercentageY = d.startY * 100 / T.height, d.thresholdPassed = !1, document.addEventListener(r.type === "touchstart" ? "touchmove" : "mousemove", p), document.addEventListener(r.type === "touchstart" ? "touchend" : "mouseup", m, { once: !0 }), d.holdTimer = setTimeout(() => {
1608
+ var A, I;
1609
+ d.holding = !0, (I = (A = he.value).hold) == null || I.call(A, { e: r, cell: x.value, cursor: J.value });
1608
1610
  }, 1e3);
1609
- }, v = (l) => {
1610
- var C, E, B, I, ee, g;
1611
- d.dragging || (O.isDraggingCell = !0, (E = (C = fe.value).dragStart) == null || E.call(C, { e: l, cell: X.value, cursor: U.value })), d.dragging = !0, d.holdTimer = clearTimeout(d.holdTimer), d.holding = !1;
1612
- const M = m.value.getBoundingClientRect();
1613
- d.moveX = (((B = l.touches) == null ? void 0 : B[0]) || l).clientX - M.left, d.moveY = (((I = l.touches) == null ? void 0 : I[0]) || l).clientY - M.top, d.movePercentageX = d.moveX * 100 / M.width, d.movePercentageY = d.moveY * 100 / M.height, w.eventCreateMinDrag && Math.abs(d.startY - d.moveY) > w.eventCreateMinDrag && (d.thresholdPassed = !0), (g = (ee = fe.value).drag) == null || g.call(ee, { e: l, cell: X.value, cursor: U.value });
1614
- }, G = async (l) => {
1615
- var M, C;
1616
- document.removeEventListener(l.type === "touchend" ? "touchmove" : "mousemove", v, { passive: !1 }), d.dragging && ((C = (M = fe.value).dragEnd) == null || C.call(M, { e: l, cell: X.value, cursor: U.value }), O.isDraggingCell = !1, w.editableEvents.create && (e.value = !0, await K(l), e.value = !1)), d.holdTimer = clearTimeout(d.holdTimer), d.holding = !1, d.dragging = !1, d.startX = 0, d.startY = 0, d.moveX = 0, d.moveY = 0, d.startPercentageX = 0, d.startPercentageY = 0, d.movePercentageX = 0, d.movePercentageY = 0, d.thresholdPassed = !1, d.schedule = null;
1617
- }, K = async (l) => {
1618
- if (!D.value) return;
1619
- let { start: M, end: C, startMinutes: E, endMinutes: B } = i.value;
1620
- M = new Date(a.start), M.setMinutes(E), C = new Date(a.start), C.setMinutes(B);
1621
- let I = { ...i.value, start: M, end: C };
1622
- const { create: ee } = w.eventListeners.event;
1623
- if (typeof ee == "function") {
1624
- const g = I;
1625
- I = await new Promise((z) => ee({ e: l, event: I, cell: X.value, resolve: z, cursor: U.value })), I && typeof I == "object" && h.createEvent(I), I && typeof I == "boolean" && h.createEvent(g);
1626
- } else h.createEvent(I);
1627
- }, ve = () => {
1628
- Object.keys(fe.value).forEach((l) => {
1629
- var M;
1630
- (M = m.value) == null || M.removeEventListener(l, fe.value[l]);
1611
+ }, p = (r) => {
1612
+ var S, $, A, I, te, h;
1613
+ d.dragging || (V.isDraggingCell = !0, ($ = (S = he.value).dragStart) == null || $.call(S, { e: r, cell: x.value, cursor: J.value })), d.dragging = !0, d.holdTimer = clearTimeout(d.holdTimer), d.holding = !1;
1614
+ const T = f.value.getBoundingClientRect();
1615
+ d.moveX = (((A = r.touches) == null ? void 0 : A[0]) || r).clientX - T.left, d.moveY = (((I = r.touches) == null ? void 0 : I[0]) || r).clientY - T.top, d.movePercentageX = d.moveX * 100 / T.width, d.movePercentageY = d.moveY * 100 / T.height, w.eventCreateMinDrag && Math.abs(d.startY - d.moveY) > w.eventCreateMinDrag && (d.thresholdPassed = !0), (h = (te = he.value).drag) == null || h.call(te, { e: r, cell: x.value, cursor: J.value });
1616
+ }, m = async (r) => {
1617
+ var T, S;
1618
+ document.removeEventListener(r.type === "touchend" ? "touchmove" : "mousemove", p, { passive: !1 }), d.dragging && ((S = (T = he.value).dragEnd) == null || S.call(T, { e: r, cell: x.value, cursor: J.value }), V.isDraggingCell = !1, w.editableEvents.create && (e.value = !0, await G(r), e.value = !1)), d.holdTimer = clearTimeout(d.holdTimer), d.holding = !1, d.dragging = !1, d.startX = 0, d.startY = 0, d.moveX = 0, d.moveY = 0, d.startPercentageX = 0, d.startPercentageY = 0, d.movePercentageX = 0, d.movePercentageY = 0, d.thresholdPassed = !1, d.schedule = null;
1619
+ }, G = async (r) => {
1620
+ if (!E.value) return;
1621
+ let { start: T, end: S, startMinutes: $, endMinutes: A } = y.value;
1622
+ T = new Date(s.start), T.setMinutes($), S = new Date(s.start), S.setMinutes(A);
1623
+ let I = { ...y.value, start: T, end: S };
1624
+ const { create: te } = w.eventListeners.event;
1625
+ if (typeof te == "function") {
1626
+ const h = I;
1627
+ I = await new Promise((P) => te({ e: r, event: I, cell: x.value, resolve: P, cursor: J.value })), I && typeof I == "object" && D.createEvent(I), I && typeof I == "boolean" && D.createEvent(h);
1628
+ } else D.createEvent(I);
1629
+ }, U = () => {
1630
+ Object.keys(he.value).forEach((r) => {
1631
+ var T;
1632
+ (T = f.value) == null || T.removeEventListener(r, he.value[r]);
1631
1633
  });
1634
+ }, fe = () => {
1635
+ v.value = L.getCellOverlappingEvents(B.value);
1632
1636
  };
1633
- return oe(y.value, A, { deep: !0 }), Ne(async () => {
1634
- b.value.forEach((l) => L.deleteEvent(l, 3)), ve(), await Ue();
1635
- }), (l, M) => (Y(), j("div", me({
1636
- class: ["vuecal__cell", S.value],
1637
+ return de(
1638
+ // Watch event IDs and start/end dates (only) to detect event resizing/dnd.
1639
+ () => k.value.map((r) => `${r._.id}${r.start.getTime()}${r.end.getTime()}`).join(),
1640
+ async () => {
1641
+ await We(), fe();
1642
+ },
1643
+ { immediate: !0, flush: "post" }
1644
+ // Use flush: 'post' to prevent infinite updates.
1645
+ ), ze(async () => {
1646
+ b.value.forEach((r) => L.deleteEvent(r, 3)), U(), await We();
1647
+ }), (r, T) => (Y(), j("div", ge({
1648
+ class: ["vuecal__cell", H.value],
1637
1649
  ref_key: "cellEl",
1638
- ref: m
1639
- }, je(fe.value, !0)), [
1640
- l.$slots.cell ? F(l.$slots, "cell", {
1650
+ ref: f
1651
+ }, je(he.value, !0)), [
1652
+ r.$slots.cell ? F(r.$slots, "cell", {
1641
1653
  key: 0,
1642
1654
  start: c.start,
1643
1655
  end: c.end,
1644
1656
  index: c.index,
1645
- events: s.value
1657
+ events: n.value
1646
1658
  }) : Z("", !0),
1647
- re.value ? (Y(!0), j(ae, { key: 1 }, he(re.value, (C, E) => (Y(), j("div", {
1648
- class: ye(["vuecal__special-hours", C.class]),
1649
- style: pe(C.style),
1650
- innerHTML: C.label || ""
1651
- }, null, 14, Ht))), 256)) : Z("", !0),
1652
- !l.$slots.cell && V(w).schedules ? (Y(!0), j(ae, { key: 2 }, he(V(w).schedules, (C) => (Y(), j("div", {
1653
- class: ye(["vuecal__schedule vuecal__schedule--cell", C.class]),
1654
- key: C.id,
1655
- style: pe(C.style || null),
1656
- "data-schedule": C.id
1659
+ R.value ? (Y(!0), j(se, { key: 1 }, De(R.value, (S, $) => (Y(), j("div", {
1660
+ class: we(["vuecal__special-hours", S.class]),
1661
+ style: ke(S.style),
1662
+ innerHTML: S.label || ""
1663
+ }, null, 14, zt))), 256)) : Z("", !0),
1664
+ !r.$slots.cell && C(w).schedules ? (Y(!0), j(se, { key: 2 }, De(C(w).schedules, (S) => (Y(), j("div", {
1665
+ class: we(["vuecal__schedule vuecal__schedule--cell", S.class]),
1666
+ key: S.id,
1667
+ style: ke(S.style || null),
1668
+ "data-schedule": S.id
1657
1669
  }, [
1658
- l.$slots["cell-events"] ? F(l.$slots, "cell-events", {
1670
+ r.$slots["cell-events"] ? F(r.$slots, "cell-events", {
1659
1671
  key: 0,
1660
1672
  start: c.start,
1661
1673
  end: c.end,
1662
- events: s.value
1674
+ events: n.value
1663
1675
  }) : Z("", !0),
1664
- k.value || l.$slots["cell-date"] ? (Y(), j("div", Ft, [
1665
- F(l.$slots, "cell-date", {
1676
+ l.value || r.$slots["cell-date"] ? (Y(), j("div", Lt, [
1677
+ F(r.$slots, "cell-date", {
1666
1678
  start: c.start,
1667
1679
  end: c.end,
1668
- events: s.value
1680
+ events: n.value
1669
1681
  }, () => [
1670
- Ge(le(k.value), 1)
1682
+ Ze(re(l.value), 1)
1671
1683
  ])
1672
1684
  ])) : Z("", !0),
1673
- l.$slots["cell-content"] ? (Y(), j("div", Nt, [
1674
- F(l.$slots, "cell-content", {
1685
+ r.$slots["cell-content"] ? (Y(), j("div", Ft, [
1686
+ F(r.$slots, "cell-content", {
1675
1687
  start: c.start,
1676
1688
  end: c.end,
1677
- events: s.value
1689
+ events: n.value
1678
1690
  })
1679
1691
  ])) : Z("", !0),
1680
- l.$slots["cell-events"] && s.value.length ? (Y(), j("div", Wt, [
1681
- F(l.$slots, "cell-events", {
1692
+ r.$slots["cell-events"] && n.value.length ? (Y(), j("div", Nt, [
1693
+ F(r.$slots, "cell-events", {
1682
1694
  start: c.start,
1683
1695
  end: c.end,
1684
- events: s.value
1696
+ events: n.value
1685
1697
  })
1686
- ])) : s.value.length || W.value ? (Y(), ke(Ze, {
1698
+ ])) : n.value.length || W.value ? (Y(), be(qe, {
1687
1699
  key: 4,
1688
1700
  class: "vuecal__cell-events",
1689
1701
  name: "vuecal-event-delete",
1690
- onBeforeLeave: M[0] || (M[0] = (E) => W.value = !0),
1702
+ onBeforeLeave: T[0] || (T[0] = ($) => W.value = !0),
1691
1703
  onAfterLeave: u,
1692
1704
  tag: "div"
1693
1705
  }, {
1694
1706
  default: q(() => [
1695
- (Y(!0), j(ae, null, he(T.value[C.id], (E) => (Y(), ke(Je, {
1696
- key: E._.id,
1697
- event: E,
1698
- onEventDeleted: R,
1699
- style: pe(P.value[E._.id])
1707
+ (Y(!0), j(se, null, De(t.value[S.id], ($) => (Y(), be(Ue, {
1708
+ key: $._.id,
1709
+ event: $,
1710
+ onEventDeleted: X,
1711
+ style: ke(O.value[$._.id])
1700
1712
  }, $e({ _: 2 }, [
1701
- l.$slots.event ? {
1713
+ r.$slots.event ? {
1702
1714
  name: "event",
1703
- fn: q((B) => [
1704
- F(l.$slots, "event", me({ ref_for: !0 }, B))
1715
+ fn: q((A) => [
1716
+ F(r.$slots, "event", ge({ ref_for: !0 }, A))
1705
1717
  ]),
1706
1718
  key: "0"
1707
1719
  } : void 0
@@ -1709,55 +1721,55 @@ const Ke = (c) => {
1709
1721
  ]),
1710
1722
  _: 2
1711
1723
  }, 1024)) : Z("", !0),
1712
- D.value && d.schedule === C.id ? (Y(), j("div", {
1724
+ E.value && d.schedule === S.id ? (Y(), j("div", {
1713
1725
  key: 5,
1714
1726
  class: "vuecal__event-placeholder",
1715
- style: pe(i.value.style)
1716
- }, le(i.value.start) + " - " + le(i.value.end), 5)) : Z("", !0)
1717
- ], 14, Lt))), 128)) : Z("", !0),
1718
- !l.$slots.cell && !V(w).schedules ? (Y(), j(ae, { key: 3 }, [
1719
- l.$slots["cell-events"] ? F(l.$slots, "cell-events", { key: 0 }) : Z("", !0),
1720
- k.value || l.$slots["cell-date"] ? (Y(), j("div", At, [
1721
- F(l.$slots, "cell-date", {
1727
+ style: ke(y.value.style)
1728
+ }, re(y.value.start) + " - " + re(y.value.end), 5)) : Z("", !0)
1729
+ ], 14, Ht))), 128)) : Z("", !0),
1730
+ !r.$slots.cell && !C(w).schedules ? (Y(), j(se, { key: 3 }, [
1731
+ r.$slots["cell-events"] ? F(r.$slots, "cell-events", { key: 0 }) : Z("", !0),
1732
+ l.value || r.$slots["cell-date"] ? (Y(), j("div", Wt, [
1733
+ F(r.$slots, "cell-date", {
1722
1734
  start: c.start,
1723
1735
  end: c.end,
1724
- events: s.value
1736
+ events: n.value
1725
1737
  }, () => [
1726
- Ge(le(k.value), 1)
1738
+ Ze(re(l.value), 1)
1727
1739
  ])
1728
1740
  ])) : Z("", !0),
1729
- l.$slots["cell-content"] ? (Y(), j("div", Bt, [
1730
- F(l.$slots, "cell-content", {
1741
+ r.$slots["cell-content"] ? (Y(), j("div", At, [
1742
+ F(r.$slots, "cell-content", {
1731
1743
  start: c.start,
1732
1744
  end: c.end,
1733
- events: s.value
1745
+ events: n.value
1734
1746
  })
1735
1747
  ])) : Z("", !0),
1736
- l.$slots["cell-events"] && s.value.length ? (Y(), j("div", It, [
1737
- F(l.$slots, "cell-events", {
1748
+ r.$slots["cell-events"] && n.value.length ? (Y(), j("div", Bt, [
1749
+ F(r.$slots, "cell-events", {
1738
1750
  start: c.start,
1739
1751
  end: c.end,
1740
- events: s.value
1752
+ events: n.value
1741
1753
  })
1742
- ])) : (s.value.length || W.value) && !(V(h).isMonth && !V(w).eventsOnMonthView) ? (Y(), ke(Ze, {
1754
+ ])) : (n.value.length || W.value) && !(C(D).isMonth && !C(w).eventsOnMonthView) ? (Y(), be(qe, {
1743
1755
  key: 4,
1744
1756
  class: "vuecal__cell-events",
1745
1757
  name: "vuecal-event-delete",
1746
- onBeforeLeave: M[1] || (M[1] = (C) => W.value = !0),
1758
+ onBeforeLeave: T[1] || (T[1] = (S) => W.value = !0),
1747
1759
  onAfterLeave: u,
1748
1760
  tag: "div"
1749
1761
  }, {
1750
1762
  default: q(() => [
1751
- (Y(!0), j(ae, null, he(s.value, (C) => (Y(), ke(Je, {
1752
- key: C._.id,
1753
- event: C,
1754
- onEventDeleted: R,
1755
- style: pe(P.value[C._.id])
1763
+ (Y(!0), j(se, null, De(n.value, (S) => (Y(), be(Ue, {
1764
+ key: S._.id,
1765
+ event: S,
1766
+ onEventDeleted: X,
1767
+ style: ke(O.value[S._.id])
1756
1768
  }, $e({ _: 2 }, [
1757
- l.$slots.event ? {
1769
+ r.$slots.event ? {
1758
1770
  name: "event",
1759
- fn: q((E) => [
1760
- F(l.$slots, "event", me({ ref_for: !0 }, E))
1771
+ fn: q(($) => [
1772
+ F(r.$slots, "event", ge({ ref_for: !0 }, $))
1761
1773
  ]),
1762
1774
  key: "0"
1763
1775
  } : void 0
@@ -1765,125 +1777,125 @@ const Ke = (c) => {
1765
1777
  ]),
1766
1778
  _: 3
1767
1779
  })) : Z("", !0),
1768
- D.value ? (Y(), j("div", {
1780
+ E.value ? (Y(), j("div", {
1769
1781
  key: 5,
1770
1782
  class: "vuecal__event-placeholder",
1771
- style: pe(i.value.style)
1772
- }, le(i.value.start) + " - " + le(i.value.end), 5)) : Z("", !0)
1783
+ style: ke(y.value.style)
1784
+ }, re(y.value.start) + " - " + re(y.value.end), 5)) : Z("", !0)
1773
1785
  ], 64)) : Z("", !0),
1774
- l.$slots["event-count"] ? F(l.$slots, "event-count", {
1786
+ r.$slots["event-count"] ? F(r.$slots, "event-count", {
1775
1787
  key: 4,
1776
- events: y.value
1777
- }) : J.value ? (Y(), j("div", Rt, le(y.value.length), 1)) : Z("", !0),
1778
- De.show ? (Y(), j("div", {
1788
+ events: k.value
1789
+ }) : z.value ? (Y(), j("div", It, re(k.value.length), 1)) : Z("", !0),
1790
+ oe.show ? (Y(), j("div", {
1779
1791
  key: 6,
1780
1792
  class: "vuecal__now-line",
1781
- style: pe(De.style),
1782
- title: De.currentTime
1793
+ style: ke(oe.style),
1794
+ title: oe.currentTime
1783
1795
  }, [
1784
- de("span", null, le(De.currentTime), 1)
1785
- ], 12, Xt)) : Z("", !0)
1796
+ me("span", null, re(oe.currentTime), 1)
1797
+ ], 12, Rt)) : Z("", !0)
1786
1798
  ], 16));
1787
1799
  }
1788
- }, Zt = {
1800
+ }, Gt = {
1789
1801
  __name: "body",
1790
1802
  setup(c) {
1791
- const a = Se("vuecal");
1792
- let { view: r, config: h, dateUtils: w } = a;
1793
- const _ = ie(null), L = ie(null), f = $(() => ({
1794
- "--vuecal-grid-columns": r.cols,
1795
- "--vuecal-grid-rows": r.rows
1796
- })), O = $(() => {
1797
- const b = w.formatTime(Ee(L.value, h));
1803
+ const s = Se("vuecal");
1804
+ let { view: i, config: D, dateUtils: w } = s;
1805
+ const _ = ue(null), L = ue(null), g = M(() => ({
1806
+ "--vuecal-grid-columns": i.cols,
1807
+ "--vuecal-grid-rows": i.rows
1808
+ })), V = M(() => {
1809
+ const b = w.formatTime(Ee(L.value, D));
1798
1810
  return {
1799
1811
  style: { top: L.value + "%" },
1800
1812
  time: b
1801
1813
  };
1802
1814
  }), o = (b) => {
1803
1815
  var u;
1804
- if (r.isMonth || r.isYear || r.isYears) return;
1805
- const W = (((u = b.touches) == null ? void 0 : u[0]) || b).clientY, { top: R } = _.value.getBoundingClientRect();
1806
- L.value = Ae(W - R, _.value);
1807
- }, m = () => {
1816
+ if (i.isMonth || i.isYear || i.isYears) return;
1817
+ const W = (((u = b.touches) == null ? void 0 : u[0]) || b).clientY, { top: X } = _.value.getBoundingClientRect();
1818
+ L.value = Be(W - X, _.value);
1819
+ }, f = () => {
1808
1820
  L.value = null;
1809
1821
  };
1810
- return We(() => {
1811
- _.value.addEventListener("mousemove", o), _.value.addEventListener("touchmove", o), _.value.addEventListener("mouseleave", m), _.value.addEventListener("touchend", m);
1812
- }), Ne(() => {
1813
- _.value && (_.value.removeEventListener("mousemove", o), _.value.removeEventListener("touchmove", o), _.value.removeEventListener("mouseleave", m), _.value.removeEventListener("touchend", m));
1822
+ return Ae(() => {
1823
+ _.value.addEventListener("mousemove", o), _.value.addEventListener("touchmove", o), _.value.addEventListener("mouseleave", f), _.value.addEventListener("touchend", f);
1824
+ }), ze(() => {
1825
+ _.value && (_.value.removeEventListener("mousemove", o), _.value.removeEventListener("touchmove", o), _.value.removeEventListener("mouseleave", f), _.value.removeEventListener("touchend", f));
1814
1826
  }), (b, W) => (Y(), j("div", {
1815
1827
  class: "vuecal__body",
1816
1828
  ref_key: "bodyEl",
1817
1829
  ref: _,
1818
- style: pe(f.value)
1830
+ style: ke(g.value)
1819
1831
  }, [
1820
- Me(ze, { name: "vuecal-shrink" }, {
1832
+ Me(He, { name: "vuecal-shrink" }, {
1821
1833
  default: q(() => [
1822
- V(h).timeAtCursor && L.value !== null ? (Y(), j("div", {
1834
+ C(D).timeAtCursor && L.value !== null ? (Y(), j("div", {
1823
1835
  key: 0,
1824
1836
  class: "vuecal__time-at-cursor",
1825
- style: pe(O.value.style)
1837
+ style: ke(V.value.style)
1826
1838
  }, [
1827
- de("label", null, le(O.value.time), 1)
1839
+ me("label", null, re(V.value.time), 1)
1828
1840
  ], 4)) : Z("", !0)
1829
1841
  ]),
1830
1842
  _: 1
1831
1843
  }),
1832
- (Y(!0), j(ae, null, he(V(r).cellDates, (R, u) => (Y(), ke(Gt, {
1844
+ (Y(!0), j(se, null, De(C(i).cellDates, (X, u) => (Y(), be(Xt, {
1833
1845
  key: u,
1834
- start: R.start,
1835
- end: R.end,
1846
+ start: X.start,
1847
+ end: X.end,
1836
1848
  index: u
1837
1849
  }, $e({ _: 2 }, [
1838
1850
  b.$slots.cell ? {
1839
1851
  name: "cell",
1840
1852
  fn: q((d) => [
1841
- F(b.$slots, "cell", me({ ref_for: !0 }, d))
1853
+ F(b.$slots, "cell", ge({ ref_for: !0 }, d))
1842
1854
  ]),
1843
1855
  key: "0"
1844
1856
  } : void 0,
1845
1857
  b.$slots["cell-date"] ? {
1846
1858
  name: "cell-date",
1847
1859
  fn: q((d) => [
1848
- F(b.$slots, "cell-date", me({ ref_for: !0 }, d))
1860
+ F(b.$slots, "cell-date", ge({ ref_for: !0 }, d))
1849
1861
  ]),
1850
1862
  key: "1"
1851
1863
  } : void 0,
1852
1864
  b.$slots["cell-content"] ? {
1853
1865
  name: "cell-content",
1854
1866
  fn: q((d) => [
1855
- F(b.$slots, "cell-content", me({ ref_for: !0 }, d))
1867
+ F(b.$slots, "cell-content", ge({ ref_for: !0 }, d))
1856
1868
  ]),
1857
1869
  key: "2"
1858
1870
  } : void 0,
1859
1871
  b.$slots["cell-events"] ? {
1860
1872
  name: "cell-events",
1861
1873
  fn: q((d) => [
1862
- F(b.$slots, "cell-events", me({ ref_for: !0 }, d))
1874
+ F(b.$slots, "cell-events", ge({ ref_for: !0 }, d))
1863
1875
  ]),
1864
1876
  key: "3"
1865
1877
  } : b.$slots.event ? {
1866
1878
  name: "event",
1867
1879
  fn: q((d) => [
1868
- F(b.$slots, "event", me({ ref_for: !0 }, d))
1880
+ F(b.$slots, "event", ge({ ref_for: !0 }, d))
1869
1881
  ]),
1870
1882
  key: "4"
1871
1883
  } : b.$slots["event-count"] ? {
1872
1884
  name: "event-count",
1873
1885
  fn: q((d) => [
1874
- F(b.$slots, "event-count", me({ ref_for: !0 }, d))
1886
+ F(b.$slots, "event-count", ge({ ref_for: !0 }, d))
1875
1887
  ]),
1876
1888
  key: "5"
1877
1889
  } : void 0
1878
1890
  ]), 1032, ["start", "end", "index"]))), 128))
1879
1891
  ], 4));
1880
1892
  }
1881
- }, qt = ["data-locale"], Jt = { class: "vuecal__scrollable-wrap" }, Ut = {
1893
+ }, Zt = ["data-locale"], qt = { class: "vuecal__scrollable-wrap" }, Jt = {
1882
1894
  key: 1,
1883
1895
  class: "vuecal__week-numbers"
1884
- }, Kt = { class: "vuecal__week-number" }, Qt = { class: "vuecal__body-wrap" }, ea = {
1896
+ }, Ut = { class: "vuecal__week-number" }, Kt = { class: "vuecal__body-wrap" }, xt = {
1885
1897
  __name: "index",
1886
- props: mt,
1898
+ props: vt,
1887
1899
  emits: [
1888
1900
  "ready",
1889
1901
  "view-change",
@@ -1896,176 +1908,176 @@ const Ke = (c) => {
1896
1908
  "event-dropped",
1897
1909
  "event-change"
1898
1910
  ],
1899
- setup(c, { expose: a, emit: r }) {
1900
- const h = c, w = r, _ = tt("vuecal-el"), L = dt({ props: h, emit: w, attrs: nt(), vuecalEl: _, uid: at() }), { config: f, view: O, dateUtils: o, touch: m } = L, b = $(() => f.time && (O.isDay || O.isDays || O.isWeek)), W = $(() => Array(O.rows).fill().map((e, i) => o.getWeek(o.addDays(O.firstCellDate, 7 * i)))), R = $(() => {
1911
+ setup(c, { expose: s, emit: i }) {
1912
+ const D = c, w = i, _ = et("vuecal-el"), L = ct({ props: D, emit: w, attrs: at(), vuecalEl: _, uid: tt() }), { config: g, view: V, dateUtils: o, touch: f } = L, b = M(() => g.time && (V.isDay || V.isDays || V.isWeek)), W = M(() => Array(V.rows).fill().map((e, v) => o.getWeek(o.addDays(V.firstCellDate, 7 * v)))), X = M(() => {
1901
1913
  var e;
1902
1914
  return {
1903
- "vuecal--ready": f.ready,
1904
- [`vuecal--${f.theme}-theme`]: f.theme,
1905
- [`vuecal--${f.size}`]: !0,
1906
- "vuecal--date-picker": f.datePicker,
1907
- "vuecal--dark": f.dark,
1908
- "vuecal--light": !f.dark,
1909
- [`vuecal--${O.id}-view`]: !0,
1915
+ "vuecal--ready": g.ready,
1916
+ [`vuecal--${g.theme}-theme`]: g.theme,
1917
+ [`vuecal--${g.size}`]: !0,
1918
+ "vuecal--date-picker": g.datePicker,
1919
+ "vuecal--dark": g.dark,
1920
+ "vuecal--light": !g.dark,
1921
+ [`vuecal--${V.id}-view`]: !0,
1910
1922
  "vuecal--view-has-time": b.value,
1911
- "vuecal--timeless": !f.time,
1912
- "vuecal--dragging-cell": m.isDraggingCell,
1913
- "vuecal--dragging-event": m.isDraggingEvent,
1914
- "vuecal--resizing-event": m.isResizingEvent,
1915
- "vuecal--has-schedules": (e = f.schedules) == null ? void 0 : e.length
1923
+ "vuecal--timeless": !g.time,
1924
+ "vuecal--dragging-cell": f.isDraggingCell,
1925
+ "vuecal--dragging-event": f.isDraggingEvent,
1926
+ "vuecal--resizing-event": f.isResizingEvent,
1927
+ "vuecal--has-schedules": (e = g.schedules) == null ? void 0 : e.length
1916
1928
  };
1917
- }), u = $(() => ({
1918
- "--vuecal-time-cell-height": f.timeCellHeight && `${f.timeCellHeight}px`
1919
- })), d = $(() => {
1920
- var e, i;
1929
+ }), u = M(() => ({
1930
+ "--vuecal-time-cell-height": g.timeCellHeight && `${g.timeCellHeight}px`
1931
+ })), d = M(() => {
1932
+ var e, v;
1921
1933
  return {
1922
- "vuecal__scrollable--row": b.value || f.weekNumbers && O.isMonth,
1934
+ "vuecal__scrollable--row": b.value || g.weekNumbers && V.isMonth,
1923
1935
  // Keep the states inside the Vue transition wrapper for smooth CSS transitions.
1924
- [`vuecal__scrollable--${O.id}-view`]: !0,
1925
- "vuecal__scrollable--has-schedules": (e = f.schedules) == null ? void 0 : e.length,
1926
- "vuecal__scrollable--no-schedules": !((i = f.schedules) != null && i.length)
1936
+ [`vuecal__scrollable--${V.id}-view`]: !0,
1937
+ "vuecal__scrollable--has-schedules": (e = g.schedules) == null ? void 0 : e.length,
1938
+ "vuecal__scrollable--no-schedules": !((v = g.schedules) != null && v.length)
1927
1939
  };
1928
1940
  });
1929
- return We(async () => {
1930
- await Ue(), w("ready", { config: f, view: O });
1931
- }), oe(() => f.locale, (e) => f.loadTexts(e)), st("vuecal", L), a({ view: L.view }), (e, i) => (Y(), j("div", {
1932
- class: ye(["vuecal", R.value]),
1941
+ return Ae(async () => {
1942
+ await We(), w("ready", { config: g, view: V });
1943
+ }), de(() => g.locale, (e) => g.loadTexts(e)), st("vuecal", L), s({ view: L.view }), (e, v) => (Y(), j("div", {
1944
+ class: we(["vuecal", X.value]),
1933
1945
  ref: "vuecal-el",
1934
1946
  "data-locale": e.locale,
1935
- style: pe(u.value)
1947
+ style: ke(u.value)
1936
1948
  }, [
1937
1949
  e.$slots.diy ? F(e.$slots, "diy", {
1938
1950
  key: 0,
1939
- vuecal: V(L),
1940
- view: V(O),
1941
- availableViews: V(f).availableViews
1942
- }) : (Y(), j(ae, { key: 1 }, [
1943
- Me(pt, null, $e({ _: 2 }, [
1951
+ vuecal: C(L),
1952
+ view: C(V),
1953
+ availableViews: C(g).availableViews
1954
+ }) : (Y(), j(se, { key: 1 }, [
1955
+ Me(wt, null, $e({ _: 2 }, [
1944
1956
  e.$slots.header ? {
1945
1957
  name: "header",
1946
- fn: q((D) => [
1947
- F(e.$slots, "header", ne(se(D)))
1958
+ fn: q((y) => [
1959
+ F(e.$slots, "header", ne(le(y)))
1948
1960
  ]),
1949
1961
  key: "0"
1950
1962
  } : void 0,
1951
1963
  !e.$slots.header && e.$slots["previous-button"] ? {
1952
1964
  name: "previous-button",
1953
- fn: q((D) => [
1954
- F(e.$slots, "previous-button", ne(se(D)))
1965
+ fn: q((y) => [
1966
+ F(e.$slots, "previous-button", ne(le(y)))
1955
1967
  ]),
1956
1968
  key: "1"
1957
1969
  } : void 0,
1958
1970
  !e.$slots.header && e.$slots["next-button"] ? {
1959
1971
  name: "next-button",
1960
- fn: q((D) => [
1961
- F(e.$slots, "next-button", ne(se(D)))
1972
+ fn: q((y) => [
1973
+ F(e.$slots, "next-button", ne(le(y)))
1962
1974
  ]),
1963
1975
  key: "2"
1964
1976
  } : void 0,
1965
1977
  !e.$slots.header && e.$slots["today-button"] ? {
1966
1978
  name: "today-button",
1967
- fn: q((D) => [
1968
- F(e.$slots, "today-button", ne(se(D)))
1979
+ fn: q((y) => [
1980
+ F(e.$slots, "today-button", ne(le(y)))
1969
1981
  ]),
1970
1982
  key: "3"
1971
1983
  } : void 0,
1972
1984
  !e.$slots.header && e.$slots.title ? {
1973
1985
  name: "title",
1974
- fn: q((D) => [
1975
- F(e.$slots, "title", ne(se(D)))
1986
+ fn: q((y) => [
1987
+ F(e.$slots, "title", ne(le(y)))
1976
1988
  ]),
1977
1989
  key: "4"
1978
1990
  } : void 0,
1979
1991
  !e.$slots.header && e.$slots["schedule-heading"] ? {
1980
1992
  name: "schedule-heading",
1981
- fn: q((D) => [
1982
- F(e.$slots, "schedule-heading", ne(se(D)))
1993
+ fn: q((y) => [
1994
+ F(e.$slots, "schedule-heading", ne(le(y)))
1983
1995
  ]),
1984
1996
  key: "5"
1985
1997
  } : void 0
1986
1998
  ]), 1024),
1987
- de("div", Jt, [
1988
- Me(ze, {
1989
- name: `vuecal-slide-fade--${V(O).transitionDirection}`
1999
+ me("div", qt, [
2000
+ Me(He, {
2001
+ name: `vuecal-slide-fade--${C(V).transitionDirection}`
1990
2002
  }, {
1991
2003
  default: q(() => [
1992
2004
  (Y(), j("div", {
1993
- class: ye(["vuecal__scrollable", d.value]),
1994
- key: V(O).id + V(O).start.getTime()
2005
+ class: we(["vuecal__scrollable", d.value]),
2006
+ key: C(V).id + C(V).start.getTime()
1995
2007
  }, [
1996
- b.value ? (Y(), ke(Ct, { key: 0 }, $e({ _: 2 }, [
2008
+ b.value ? (Y(), be(St, { key: 0 }, $e({ _: 2 }, [
1997
2009
  e.$slots["time-cell"] ? {
1998
2010
  name: "time-cell",
1999
- fn: q((D) => [
2000
- F(e.$slots, "time-cell", ne(se(D)))
2011
+ fn: q((y) => [
2012
+ F(e.$slots, "time-cell", ne(le(y)))
2001
2013
  ]),
2002
2014
  key: "0"
2003
2015
  } : void 0
2004
2016
  ]), 1024)) : Z("", !0),
2005
- V(f).weekNumbers && V(O).isMonth ? (Y(), j("div", Ut, [
2006
- (Y(!0), j(ae, null, he(W.value, (D) => (Y(), j("div", Kt, [
2017
+ C(g).weekNumbers && C(V).isMonth ? (Y(), j("div", Jt, [
2018
+ (Y(!0), j(se, null, De(W.value, (y) => (Y(), j("div", Ut, [
2007
2019
  F(e.$slots, "week-number", {}, () => [
2008
- de("small", null, le(D), 1)
2020
+ me("small", null, re(y), 1)
2009
2021
  ])
2010
2022
  ]))), 256))
2011
2023
  ])) : Z("", !0),
2012
- de("div", Qt, [
2013
- Me(Yt, null, $e({ _: 2 }, [
2024
+ me("div", Kt, [
2025
+ Me(Et, null, $e({ _: 2 }, [
2014
2026
  e.$slots["weekday-heading"] ? {
2015
2027
  name: "weekday-heading",
2016
- fn: q((D) => [
2017
- F(e.$slots, "weekday-heading", ne(se(D)))
2028
+ fn: q((y) => [
2029
+ F(e.$slots, "weekday-heading", ne(le(y)))
2018
2030
  ]),
2019
2031
  key: "0"
2020
2032
  } : void 0,
2021
2033
  e.$slots["schedule-heading"] ? {
2022
2034
  name: "schedule-heading",
2023
- fn: q((D) => [
2024
- F(e.$slots, "schedule-heading", ne(se(D)))
2035
+ fn: q((y) => [
2036
+ F(e.$slots, "schedule-heading", ne(le(y)))
2025
2037
  ]),
2026
2038
  key: "1"
2027
2039
  } : void 0
2028
2040
  ]), 1024),
2029
- Me(Zt, null, $e({ _: 2 }, [
2041
+ Me(Gt, null, $e({ _: 2 }, [
2030
2042
  e.$slots.cell ? {
2031
2043
  name: "cell",
2032
- fn: q((D) => [
2033
- F(e.$slots, "cell", ne(se(D)))
2044
+ fn: q((y) => [
2045
+ F(e.$slots, "cell", ne(le(y)))
2034
2046
  ]),
2035
2047
  key: "0"
2036
2048
  } : void 0,
2037
2049
  !e.$slots.cell && e.$slots["cell-date"] ? {
2038
2050
  name: "cell-date",
2039
- fn: q((D) => [
2040
- F(e.$slots, "cell-date", ne(se(D)))
2051
+ fn: q((y) => [
2052
+ F(e.$slots, "cell-date", ne(le(y)))
2041
2053
  ]),
2042
2054
  key: "1"
2043
2055
  } : void 0,
2044
2056
  !e.$slots.cell && e.$slots["cell-content"] ? {
2045
2057
  name: "cell-content",
2046
- fn: q((D) => [
2047
- F(e.$slots, "cell-content", ne(se(D)))
2058
+ fn: q((y) => [
2059
+ F(e.$slots, "cell-content", ne(le(y)))
2048
2060
  ]),
2049
2061
  key: "2"
2050
2062
  } : void 0,
2051
2063
  !e.$slots.cell && e.$slots["cell-events"] ? {
2052
2064
  name: "cell-events",
2053
- fn: q((D) => [
2054
- F(e.$slots, "cell-events", ne(se(D)))
2065
+ fn: q((y) => [
2066
+ F(e.$slots, "cell-events", ne(le(y)))
2055
2067
  ]),
2056
2068
  key: "3"
2057
2069
  } : void 0,
2058
2070
  !e.$slots.cell && e.$slots.event ? {
2059
2071
  name: "event",
2060
- fn: q((D) => [
2061
- F(e.$slots, "event", ne(se(D)))
2072
+ fn: q((y) => [
2073
+ F(e.$slots, "event", ne(le(y)))
2062
2074
  ]),
2063
2075
  key: "4"
2064
2076
  } : void 0,
2065
2077
  !e.$slots.cell && e.$slots["event-count"] ? {
2066
2078
  name: "event-count",
2067
- fn: q((D) => [
2068
- F(e.$slots, "event-count", ne(se(D)))
2079
+ fn: q((y) => [
2080
+ F(e.$slots, "event-count", ne(le(y)))
2069
2081
  ]),
2070
2082
  key: "5"
2071
2083
  } : void 0
@@ -2077,63 +2089,63 @@ const Ke = (c) => {
2077
2089
  }, 8, ["name"])
2078
2090
  ])
2079
2091
  ], 64))
2080
- ], 14, qt));
2092
+ ], 14, Zt));
2081
2093
  }
2082
- }, ta = (c) => {
2083
- Ye.texts = { ...ce.texts, ...c }, Ye.dateUtils.updateTexts(Ye.texts);
2094
+ }, ea = (c) => {
2095
+ Ye.texts = { ...ve.texts, ...c }, Ye.dateUtils.updateTexts(Ye.texts);
2084
2096
  }, {
2085
- addDatePrototypes: aa,
2086
- removeDatePrototypes: na,
2097
+ addDatePrototypes: ta,
2098
+ removeDatePrototypes: aa,
2087
2099
  updateTexts: sa,
2088
- addDays: la,
2089
- subtractDays: ra,
2090
- addHours: ia,
2091
- subtractHours: oa,
2092
- addMinutes: ua,
2093
- subtractMinutes: ca,
2094
- getWeek: da,
2095
- isToday: va,
2096
- isSameDate: ma,
2097
- isInRange: fa,
2098
- isLeapYear: ga,
2099
- getPreviousFirstDayOfWeek: ha,
2100
- stringToDate: ya,
2101
- dateToMinutes: Da,
2102
- countDays: wa,
2103
- datesInSameTimeStep: pa,
2104
- isValid: _a,
2100
+ addDays: na,
2101
+ subtractDays: la,
2102
+ addHours: ra,
2103
+ subtractHours: ia,
2104
+ addMinutes: oa,
2105
+ subtractMinutes: ua,
2106
+ getWeek: ca,
2107
+ isToday: da,
2108
+ isSameDate: va,
2109
+ isInRange: ma,
2110
+ isLeapYear: fa,
2111
+ getPreviousFirstDayOfWeek: ga,
2112
+ stringToDate: ha,
2113
+ dateToMinutes: ya,
2114
+ countDays: Da,
2115
+ datesInSameTimeStep: wa,
2116
+ isValid: pa,
2105
2117
  formatDate: ka,
2106
- formatDateLite: ba,
2107
- formatTime: Ta,
2108
- formatTimeLite: Ma,
2109
- formatMinutes: $a
2118
+ formatDateLite: _a,
2119
+ formatTime: ba,
2120
+ formatTimeLite: Ta,
2121
+ formatMinutes: Ma
2110
2122
  } = Ye.dateUtils;
2111
2123
  export {
2112
- ea as VueCal,
2113
- aa as addDatePrototypes,
2114
- la as addDays,
2115
- ia as addHours,
2116
- ua as addMinutes,
2117
- wa as countDays,
2118
- Da as dateToMinutes,
2119
- pa as datesInSameTimeStep,
2124
+ xt as VueCal,
2125
+ ta as addDatePrototypes,
2126
+ na as addDays,
2127
+ ra as addHours,
2128
+ oa as addMinutes,
2129
+ Da as countDays,
2130
+ ya as dateToMinutes,
2131
+ wa as datesInSameTimeStep,
2120
2132
  ka as formatDate,
2121
- ba as formatDateLite,
2122
- $a as formatMinutes,
2123
- Ta as formatTime,
2124
- Ma as formatTimeLite,
2125
- ha as getPreviousFirstDayOfWeek,
2126
- da as getWeek,
2127
- fa as isInRange,
2128
- ga as isLeapYear,
2129
- ma as isSameDate,
2130
- va as isToday,
2131
- _a as isValidDate,
2132
- na as removeDatePrototypes,
2133
- ya as stringToDate,
2134
- ra as subtractDays,
2135
- oa as subtractHours,
2136
- ca as subtractMinutes,
2133
+ _a as formatDateLite,
2134
+ Ma as formatMinutes,
2135
+ ba as formatTime,
2136
+ Ta as formatTimeLite,
2137
+ ga as getPreviousFirstDayOfWeek,
2138
+ ca as getWeek,
2139
+ ma as isInRange,
2140
+ fa as isLeapYear,
2141
+ va as isSameDate,
2142
+ da as isToday,
2143
+ pa as isValidDate,
2144
+ aa as removeDatePrototypes,
2145
+ ha as stringToDate,
2146
+ la as subtractDays,
2147
+ ia as subtractHours,
2148
+ ua as subtractMinutes,
2137
2149
  sa as updateTexts,
2138
- ta as useLocale
2150
+ ea as useLocale
2139
2151
  };