vue-cal 5.0.1-rc.6 → 5.0.1-rc.7

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