@innosolutions/inno-calendar 1.0.34 → 1.0.37

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.
Files changed (43) hide show
  1. package/dist/{agenda-widget-BwL7DItQ.js → agenda-widget-BKIaXFpN.js} +1186 -1128
  2. package/dist/agenda-widget-BKIaXFpN.js.map +1 -0
  3. package/dist/agenda-widget-BtTvMs9i.cjs +2 -0
  4. package/dist/agenda-widget-BtTvMs9i.cjs.map +1 -0
  5. package/dist/components/event/event-card.d.ts +1 -0
  6. package/dist/components/event/event-card.d.ts.map +1 -1
  7. package/dist/components/index.cjs +1 -1
  8. package/dist/components/index.mjs +2 -2
  9. package/dist/components/inno-calendar.d.ts +8 -2
  10. package/dist/components/inno-calendar.d.ts.map +1 -1
  11. package/dist/components/views/day-view.d.ts.map +1 -1
  12. package/dist/components/views/timeline-view.d.ts.map +1 -1
  13. package/dist/components/views/week-view.d.ts.map +1 -1
  14. package/dist/core/index.d.ts +1 -1
  15. package/dist/core/index.d.ts.map +1 -1
  16. package/dist/core/types.d.ts +32 -0
  17. package/dist/core/types.d.ts.map +1 -1
  18. package/dist/core/utils/grid-utils.d.ts.map +1 -1
  19. package/dist/core/utils/position-utils.d.ts +5 -1
  20. package/dist/core/utils/position-utils.d.ts.map +1 -1
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.mjs +3 -3
  23. package/dist/presets/index.cjs +1 -1
  24. package/dist/presets/index.mjs +1 -1
  25. package/dist/{tailwind-calendar-CE6o8RLM.cjs → tailwind-calendar-3IAm_TdP.cjs} +2 -2
  26. package/dist/{tailwind-calendar-CE6o8RLM.cjs.map → tailwind-calendar-3IAm_TdP.cjs.map} +1 -1
  27. package/dist/{tailwind-calendar-BxW1RSkc.js → tailwind-calendar-B3HuJrjX.js} +2 -2
  28. package/dist/{tailwind-calendar-BxW1RSkc.js.map → tailwind-calendar-B3HuJrjX.js.map} +1 -1
  29. package/dist/utils.cjs +1 -1
  30. package/dist/utils.cjs.map +1 -1
  31. package/dist/utils.mjs +315 -303
  32. package/dist/utils.mjs.map +1 -1
  33. package/dist/{week-view-jpcXSE6k.js → week-view-1EUqFIRS.js} +554 -528
  34. package/dist/week-view-1EUqFIRS.js.map +1 -0
  35. package/dist/week-view-DXilsY50.cjs +11 -0
  36. package/dist/week-view-DXilsY50.cjs.map +1 -0
  37. package/package.json +1 -1
  38. package/dist/agenda-widget-B8blZmlr.cjs +0 -2
  39. package/dist/agenda-widget-B8blZmlr.cjs.map +0 -1
  40. package/dist/agenda-widget-BwL7DItQ.js.map +0 -1
  41. package/dist/week-view-DT8XnNbp.cjs +0 -11
  42. package/dist/week-view-DT8XnNbp.cjs.map +0 -1
  43. package/dist/week-view-jpcXSE6k.js.map +0 -1
package/dist/utils.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const K = [
1
+ const Z = [
2
2
  "day",
3
3
  "week",
4
4
  "month",
@@ -8,7 +8,7 @@ const K = [
8
8
  "resource-week",
9
9
  "timeline-day",
10
10
  "timeline-week"
11
- ], X = {
11
+ ], tt = {
12
12
  startHour: 8,
13
13
  endHour: 18,
14
14
  firstDayOfWeek: 1,
@@ -18,13 +18,13 @@ const K = [
18
18
  timeFormat: "24h",
19
19
  badgeVariant: "colored",
20
20
  showCanceledEvents: !1
21
- }, j = {
21
+ }, et = {
22
22
  startHour: 0,
23
23
  endHour: 24
24
- }, q = {
24
+ }, nt = {
25
25
  startHour: 8,
26
26
  endHour: 18
27
- }, Q = {
27
+ }, rt = {
28
28
  day: {
29
29
  type: "day",
30
30
  slotMinTime: "00:00",
@@ -85,7 +85,7 @@ const K = [
85
85
  type: "timeline-week",
86
86
  slotDuration: "01:00:00"
87
87
  }
88
- }, Z = {
88
+ }, ot = {
89
89
  blue: "#3b82f6",
90
90
  green: "#22c55e",
91
91
  red: "#ef4444",
@@ -96,7 +96,7 @@ const K = [
96
96
  teal: "#14b8a6",
97
97
  gray: "#6b7280",
98
98
  indigo: "#6366f1"
99
- }, tt = {
99
+ }, at = {
100
100
  blue: { bg: "bg-blue-100", text: "text-blue-800", border: "border-blue-300" },
101
101
  green: { bg: "bg-green-100", text: "text-green-800", border: "border-green-300" },
102
102
  red: { bg: "bg-red-100", text: "text-red-800", border: "border-red-300" },
@@ -107,7 +107,7 @@ const K = [
107
107
  teal: { bg: "bg-teal-100", text: "text-teal-800", border: "border-teal-300" },
108
108
  gray: { bg: "bg-gray-100", text: "text-gray-800", border: "border-gray-300" },
109
109
  indigo: { bg: "bg-indigo-100", text: "text-indigo-800", border: "border-indigo-300" }
110
- }, et = {
110
+ }, st = {
111
111
  "#3b82f6": "blue",
112
112
  "#22c55e": "green",
113
113
  "#ef4444": "red",
@@ -118,12 +118,12 @@ const K = [
118
118
  "#14b8a6": "teal",
119
119
  "#6b7280": "gray",
120
120
  "#6366f1": "indigo"
121
- }, nt = 24, rt = 60, R = 60 * 1e3, U = 60 * R, ot = 24 * U, S = 64, at = 32, st = 56, ut = 200, W = 20;
122
- function g(t) {
121
+ }, ut = 24, it = 60, L = 60 * 1e3, B = 60 * L, ct = 24 * B, k = 64, lt = 32, ft = 56, gt = 200, N = 20;
122
+ function d(t) {
123
123
  const e = new Date(t);
124
124
  return e.setHours(0, 0, 0, 0), e;
125
125
  }
126
- function y(t) {
126
+ function p(t) {
127
127
  const e = new Date(t);
128
128
  return e.setHours(23, 59, 59, 999), e;
129
129
  }
@@ -131,130 +131,130 @@ function l(t, e) {
131
131
  const n = new Date(t);
132
132
  return n.setDate(n.getDate() + e), n;
133
133
  }
134
- function it(t, e) {
134
+ function dt(t, e) {
135
135
  return l(t, -e);
136
136
  }
137
- function M(t, e) {
137
+ function S(t, e) {
138
138
  return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
139
139
  }
140
- function O(t) {
141
- return M(t, /* @__PURE__ */ new Date());
140
+ function $(t) {
141
+ return S(t, /* @__PURE__ */ new Date());
142
142
  }
143
- function ct(t) {
143
+ function mt(t) {
144
144
  return t.getDay();
145
145
  }
146
- function _(t) {
146
+ function R(t) {
147
147
  const e = t.getDay();
148
148
  return e === 0 || e === 6;
149
149
  }
150
- function d(t, e = 1) {
150
+ function m(t, e = 1) {
151
151
  const n = new Date(t), r = n.getDay(), o = (r < e ? 7 : 0) + r - e;
152
152
  return n.setDate(n.getDate() - o), n.setHours(0, 0, 0, 0), n;
153
153
  }
154
154
  function T(t, e = 1) {
155
- const n = d(t, e);
155
+ const n = m(t, e);
156
156
  return n.setDate(n.getDate() + 6), n.setHours(23, 59, 59, 999), n;
157
157
  }
158
- function b(t, e) {
158
+ function H(t, e) {
159
159
  return l(t, e * 7);
160
160
  }
161
- function lt(t, e) {
161
+ function Dt(t, e) {
162
162
  return l(t, -e * 7);
163
163
  }
164
- function ft(t) {
164
+ function ht(t) {
165
165
  const e = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate())), n = e.getUTCDay() || 7;
166
166
  e.setUTCDate(e.getUTCDate() + 4 - n);
167
167
  const r = new Date(Date.UTC(e.getUTCFullYear(), 0, 1));
168
168
  return Math.ceil(((e.getTime() - r.getTime()) / 864e5 + 1) / 7);
169
169
  }
170
- function gt(t, e, n = 1) {
171
- const r = d(t, n), o = d(e, n);
172
- return M(r, o);
170
+ function yt(t, e, n = 1) {
171
+ const r = m(t, n), o = m(e, n);
172
+ return S(r, o);
173
173
  }
174
- function p(t) {
174
+ function M(t) {
175
175
  const e = new Date(t);
176
176
  return e.setDate(1), e.setHours(0, 0, 0, 0), e;
177
177
  }
178
- function w(t) {
178
+ function E(t) {
179
179
  const e = new Date(t.getFullYear(), t.getMonth() + 1, 0);
180
180
  return e.setHours(23, 59, 59, 999), e;
181
181
  }
182
- function H(t, e) {
182
+ function I(t, e) {
183
183
  const n = new Date(t);
184
184
  return n.setMonth(n.getMonth() + e), n;
185
185
  }
186
- function dt(t, e) {
187
- return H(t, -e);
186
+ function pt(t, e) {
187
+ return I(t, -e);
188
188
  }
189
- function mt(t) {
189
+ function Tt(t) {
190
190
  return new Date(t.getFullYear(), t.getMonth() + 1, 0).getDate();
191
191
  }
192
192
  function F(t, e) {
193
193
  return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth();
194
194
  }
195
- function $(t) {
195
+ function U(t) {
196
196
  return new Date(t.getFullYear(), 0, 1, 0, 0, 0, 0);
197
197
  }
198
- function Y(t) {
198
+ function V(t) {
199
199
  return new Date(t.getFullYear(), 11, 31, 23, 59, 59, 999);
200
200
  }
201
- function x(t, e) {
201
+ function v(t, e) {
202
202
  const n = new Date(t);
203
203
  return n.setFullYear(n.getFullYear() + e), n;
204
204
  }
205
- function Dt(t, e) {
206
- return x(t, -e);
205
+ function wt(t, e) {
206
+ return v(t, -e);
207
207
  }
208
- function ht(t, e) {
208
+ function Mt(t, e) {
209
209
  return t.getFullYear() === e.getFullYear();
210
210
  }
211
- function A(t, e) {
211
+ function P(t, e) {
212
212
  const n = new Date(t);
213
213
  return n.setHours(n.getHours() + e), n;
214
214
  }
215
- function yt(t, e) {
215
+ function Et(t, e) {
216
216
  const n = new Date(t);
217
217
  return n.setMinutes(n.getMinutes() + e), n;
218
218
  }
219
- function Tt(t, e, n = 0, r = 0) {
219
+ function St(t, e, n = 0, r = 0) {
220
220
  const o = new Date(t);
221
221
  return o.setHours(e, n, r, 0), o;
222
222
  }
223
- function pt(t) {
223
+ function bt(t) {
224
224
  return t.getHours() + t.getMinutes() / 60;
225
225
  }
226
- function wt(t, e) {
226
+ function Ht(t, e) {
227
227
  return t.getTime() < e.getTime();
228
228
  }
229
- function Mt(t, e) {
229
+ function kt(t, e) {
230
230
  return t.getTime() > e.getTime();
231
231
  }
232
- function Et(t, e, n) {
232
+ function It(t, e, n) {
233
233
  const r = t.getTime();
234
234
  return r >= e.getTime() && r <= n.getTime();
235
235
  }
236
- function bt(t) {
236
+ function xt(t) {
237
237
  if (t.length !== 0)
238
238
  return t.reduce((e, n) => n < e ? n : e);
239
239
  }
240
- function St(t) {
240
+ function Ft(t) {
241
241
  if (t.length !== 0)
242
242
  return t.reduce((e, n) => n > e ? n : e);
243
243
  }
244
- function v(t, e) {
244
+ function C(t, e) {
245
245
  return t.getTime() - e.getTime();
246
246
  }
247
- function Ht(t, e) {
248
- return Math.floor(v(t, e) / 6e4);
247
+ function vt(t, e) {
248
+ return Math.floor(C(t, e) / 6e4);
249
249
  }
250
- function kt(t, e) {
251
- return Math.floor(v(t, e) / 36e5);
250
+ function Ct(t, e) {
251
+ return Math.floor(C(t, e) / 36e5);
252
252
  }
253
- function It(t, e) {
254
- const n = g(t), r = g(e);
255
- return Math.floor(v(n, r) / 864e5);
253
+ function Ot(t, e) {
254
+ const n = d(t), r = d(e);
255
+ return Math.floor(C(n, r) / 864e5);
256
256
  }
257
- function Ft(t, e = "24h") {
257
+ function _t(t, e = "24h") {
258
258
  const n = t.getHours(), r = t.getMinutes();
259
259
  if (e === "12h") {
260
260
  const o = n >= 12 ? "PM" : "AM";
@@ -262,109 +262,109 @@ function Ft(t, e = "24h") {
262
262
  }
263
263
  return `${n.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}`;
264
264
  }
265
- function xt(t) {
265
+ function $t(t) {
266
266
  const e = t.getFullYear(), n = (t.getMonth() + 1).toString().padStart(2, "0"), r = t.getDate().toString().padStart(2, "0");
267
267
  return `${e}-${n}-${r}`;
268
268
  }
269
- function vt(t) {
269
+ function Rt(t) {
270
270
  return new Date(t);
271
271
  }
272
- function L(t, e) {
272
+ function G(t, e) {
273
273
  const n = [];
274
- let r = g(t);
275
- const o = g(e);
274
+ let r = d(t);
275
+ const o = d(e);
276
276
  for (; r <= o; )
277
277
  n.push(new Date(r)), r = l(r, 1);
278
278
  return n;
279
279
  }
280
- function Ct(t, e) {
280
+ function Ut(t, e) {
281
281
  const n = [];
282
282
  let r = new Date(t);
283
283
  for (; r <= e; )
284
- n.push(new Date(r)), r = A(r, 1);
284
+ n.push(new Date(r)), r = P(r, 1);
285
285
  return n;
286
286
  }
287
- function Ot(t = "en-US", e = "short") {
287
+ function Wt(t = "en-US", e = "short") {
288
288
  const n = new Intl.DateTimeFormat(t, { weekday: e }), r = [], o = new Date(2024, 0, 7);
289
289
  for (let a = 0; a < 7; a++)
290
290
  r.push(n.format(l(o, a)));
291
291
  return r;
292
292
  }
293
- function _t(t = "en-US", e = "long") {
293
+ function Yt(t = "en-US", e = "long") {
294
294
  const n = new Intl.DateTimeFormat(t, { month: e }), r = [];
295
295
  for (let o = 0; o < 12; o++)
296
296
  r.push(n.format(new Date(2024, o, 1)));
297
297
  return r;
298
298
  }
299
- function $t(t) {
299
+ function At(t) {
300
300
  const e = [];
301
301
  for (let n = t.startHour; n <= t.endHour; n++)
302
302
  e.push(n);
303
303
  return e;
304
304
  }
305
- function Rt(t, e = "24h") {
305
+ function Lt(t, e = "24h") {
306
306
  if (e === "12h") {
307
307
  const n = t >= 12 ? "PM" : "AM";
308
308
  return `${t % 12 || 12} ${n}`;
309
309
  }
310
310
  return `${String(t).padStart(2, "0")}:00`;
311
311
  }
312
- function Ut(t, e = 1) {
313
- const n = d(t, e), r = [];
312
+ function Bt(t, e = 1) {
313
+ const n = m(t, e), r = [];
314
314
  for (let o = 0; o < 7; o++)
315
315
  r.push(l(n, o));
316
316
  return r;
317
317
  }
318
- function Wt(t, e = 1) {
319
- const n = p(t), r = w(t), o = d(n, e), a = T(r, e), s = t.getMonth();
320
- return L(o, a).map((c) => ({
318
+ function Nt(t, e = 1) {
319
+ const n = M(t), r = E(t), o = m(n, e), a = T(r, e), s = t.getMonth();
320
+ return G(o, a).map((c) => ({
321
321
  date: c,
322
322
  isCurrentMonth: c.getMonth() === s,
323
323
  isWeekend: c.getDay() === 0 || c.getDay() === 6
324
324
  }));
325
325
  }
326
- function Yt(t) {
326
+ function Vt(t) {
327
327
  const e = [], n = [];
328
328
  for (const r of t)
329
- M(r.startDate, r.endDate) ? e.push(r) : n.push(r);
329
+ S(r.startDate, r.endDate) ? e.push(r) : n.push(r);
330
330
  return { singleDay: e, multiDay: n };
331
331
  }
332
- function At(t, e, n) {
332
+ function Pt(t, e, n) {
333
333
  return t.filter((r) => r.startDate <= n && r.endDate >= e);
334
334
  }
335
- function Lt(t, e, n) {
335
+ function Gt(t, e, n) {
336
336
  if (!n) return !0;
337
337
  const r = t.getDay(), o = n[r];
338
338
  return !o || !(o.enabled !== !1) || o.from === o.to ? !1 : e >= o.from && e < o.to;
339
339
  }
340
- function Bt(t, e) {
340
+ function zt(t, e) {
341
341
  const n = t.getDay(), r = e[n];
342
342
  return !r || !(r.enabled !== !1) || r.from === r.to ? null : { from: r.from, to: r.to };
343
343
  }
344
- function Nt(t) {
344
+ function Jt(t) {
345
345
  const e = [];
346
346
  for (let n = 0; n < 12; n++)
347
347
  e.push(new Date(t, n, 1));
348
348
  return e;
349
349
  }
350
- function B(t, e, n) {
351
- const r = g(e), o = y(n);
350
+ function z(t, e, n) {
351
+ const r = d(e), o = p(n);
352
352
  return t.filter((a) => {
353
353
  const s = a.startDate, u = a.endDate;
354
354
  return s <= o && u >= r;
355
355
  });
356
356
  }
357
- function N(t, e) {
357
+ function J(t, e) {
358
358
  return e.length === 0 ? t : t.filter(
359
359
  (n) => n.scheduleTypeId !== void 0 && e.includes(n.scheduleTypeId)
360
360
  );
361
361
  }
362
- function V(t, e) {
362
+ function K(t, e) {
363
363
  return e.length === 0 ? t : t.filter(
364
364
  (n) => n.resourceId !== void 0 && e.includes(n.resourceId)
365
365
  );
366
366
  }
367
- function P(t, e) {
367
+ function X(t, e) {
368
368
  if (!e.trim()) return t;
369
369
  const n = e.toLowerCase();
370
370
  return t.filter((r) => {
@@ -372,38 +372,38 @@ function P(t, e) {
372
372
  return o || a;
373
373
  });
374
374
  }
375
- function G(t) {
375
+ function j(t) {
376
376
  return t.filter((e) => !e.isCanceled);
377
377
  }
378
- function Vt(t, e) {
378
+ function Kt(t, e) {
379
379
  let n = [...t];
380
- return e.dateRange && (n = B(
380
+ return e.dateRange && (n = z(
381
381
  n,
382
382
  e.dateRange.startDate,
383
383
  e.dateRange.endDate
384
- )), e.scheduleTypeIds && e.scheduleTypeIds.length > 0 && (n = N(n, e.scheduleTypeIds)), e.resourceIds && e.resourceIds.length > 0 && (n = V(n, e.resourceIds)), e.search && (n = P(n, e.search)), e.showCanceled || (n = G(n)), n;
384
+ )), e.scheduleTypeIds && e.scheduleTypeIds.length > 0 && (n = J(n, e.scheduleTypeIds)), e.resourceIds && e.resourceIds.length > 0 && (n = K(n, e.resourceIds)), e.search && (n = X(n, e.search)), e.showCanceled || (n = j(n)), n;
385
385
  }
386
- function Pt(t) {
386
+ function Xt(t) {
387
387
  return [...t].sort((e, n) => e.startDate.getTime() - n.startDate.getTime());
388
388
  }
389
- function Gt(t) {
389
+ function jt(t) {
390
390
  return [...t].sort((e, n) => e.endDate.getTime() - n.endDate.getTime());
391
391
  }
392
- function zt(t) {
392
+ function qt(t) {
393
393
  return [...t].sort((e, n) => {
394
394
  const r = e.endDate.getTime() - e.startDate.getTime();
395
395
  return n.endDate.getTime() - n.startDate.getTime() - r;
396
396
  });
397
397
  }
398
- function Jt(t) {
398
+ function Qt(t) {
399
399
  const e = /* @__PURE__ */ new Map();
400
400
  for (const n of t) {
401
- const r = g(n.startDate).toISOString(), o = e.get(r) ?? [];
401
+ const r = d(n.startDate).toISOString(), o = e.get(r) ?? [];
402
402
  o.push(n), e.set(r, o);
403
403
  }
404
404
  return e;
405
405
  }
406
- function Kt(t) {
406
+ function Zt(t) {
407
407
  const e = /* @__PURE__ */ new Map();
408
408
  for (const n of t) {
409
409
  const r = e.get(n.scheduleTypeId) ?? [];
@@ -411,7 +411,7 @@ function Kt(t) {
411
411
  }
412
412
  return e;
413
413
  }
414
- function Xt(t) {
414
+ function te(t) {
415
415
  const e = /* @__PURE__ */ new Map();
416
416
  for (const n of t) {
417
417
  const r = e.get(n.resourceId) ?? [];
@@ -419,31 +419,31 @@ function Xt(t) {
419
419
  }
420
420
  return e;
421
421
  }
422
- function jt(t, e) {
422
+ function ee(t, e) {
423
423
  return t.filter((n) => {
424
- const r = g(e), o = y(e);
424
+ const r = d(e), o = p(e);
425
425
  return n.startDate <= o && n.endDate >= r;
426
426
  });
427
427
  }
428
- function qt(t) {
428
+ function ne(t) {
429
429
  return t.filter((e) => e.isAllDay);
430
430
  }
431
- function Qt(t) {
431
+ function re(t) {
432
432
  return t.filter((e) => !e.isAllDay);
433
433
  }
434
- function Zt(t) {
435
- return t.filter((e) => e.isMultiDay ? !0 : !M(e.startDate, e.endDate));
434
+ function oe(t) {
435
+ return t.filter((e) => e.isMultiDay ? !0 : !S(e.startDate, e.endDate));
436
436
  }
437
- function te(t) {
438
- return t.isMultiDay ? !0 : !M(t.startDate, t.endDate);
437
+ function ae(t) {
438
+ return t.isMultiDay ? !0 : !S(t.startDate, t.endDate);
439
439
  }
440
- function ee(t) {
440
+ function se(t) {
441
441
  return Math.floor((t.endDate.getTime() - t.startDate.getTime()) / 6e4);
442
442
  }
443
- function ne(t, e = "blue") {
443
+ function ue(t, e = "blue") {
444
444
  return t.color ?? e;
445
445
  }
446
- function re(t, e, n = "blue") {
446
+ function ie(t, e, n = "blue") {
447
447
  if (t.color) return t.color;
448
448
  if (t.scheduleTypeId !== void 0 && e) {
449
449
  const r = e.get(t.scheduleTypeId);
@@ -451,52 +451,52 @@ function re(t, e, n = "blue") {
451
451
  }
452
452
  return n;
453
453
  }
454
- function z(t, e, n = 1) {
454
+ function q(t, e, n = 1) {
455
455
  switch (e) {
456
456
  case "day":
457
457
  case "resource-day":
458
458
  case "timeline-day":
459
459
  return {
460
- startDate: g(t),
461
- endDate: y(t)
460
+ startDate: d(t),
461
+ endDate: p(t)
462
462
  };
463
463
  case "week":
464
464
  case "resource-week":
465
465
  case "timeline-week":
466
466
  return {
467
- startDate: d(t, n),
467
+ startDate: m(t, n),
468
468
  endDate: T(t, n)
469
469
  };
470
470
  case "month": {
471
- const r = p(t), o = w(t);
471
+ const r = M(t), o = E(t);
472
472
  return {
473
- startDate: d(r, n),
473
+ startDate: m(r, n),
474
474
  endDate: T(o, n)
475
475
  };
476
476
  }
477
477
  case "timeline-3day":
478
478
  return {
479
- startDate: g(t),
480
- endDate: y(l(t, 2))
479
+ startDate: d(t),
480
+ endDate: p(l(t, 2))
481
481
  };
482
482
  case "year":
483
483
  return {
484
- startDate: $(t),
485
- endDate: Y(t)
484
+ startDate: U(t),
485
+ endDate: V(t)
486
486
  };
487
487
  case "agenda":
488
488
  return {
489
- startDate: g(t),
490
- endDate: y(l(t, 29))
489
+ startDate: d(t),
490
+ endDate: p(l(t, 29))
491
491
  };
492
492
  default:
493
493
  return {
494
- startDate: g(t),
495
- endDate: y(t)
494
+ startDate: d(t),
495
+ endDate: p(t)
496
496
  };
497
497
  }
498
498
  }
499
- function oe(t, e) {
499
+ function ce(t, e) {
500
500
  switch (e) {
501
501
  case "day":
502
502
  case "resource-day":
@@ -507,18 +507,18 @@ function oe(t, e) {
507
507
  case "week":
508
508
  case "resource-week":
509
509
  case "timeline-week":
510
- return b(t, 1);
511
- case "month":
512
510
  return H(t, 1);
511
+ case "month":
512
+ return I(t, 1);
513
513
  case "year":
514
- return x(t, 1);
514
+ return v(t, 1);
515
515
  case "agenda":
516
- return b(t, 1);
516
+ return H(t, 1);
517
517
  default:
518
518
  return l(t, 1);
519
519
  }
520
520
  }
521
- function ae(t, e) {
521
+ function le(t, e) {
522
522
  switch (e) {
523
523
  case "day":
524
524
  case "resource-day":
@@ -529,51 +529,51 @@ function ae(t, e) {
529
529
  case "week":
530
530
  case "resource-week":
531
531
  case "timeline-week":
532
- return b(t, -1);
533
- case "month":
534
532
  return H(t, -1);
533
+ case "month":
534
+ return I(t, -1);
535
535
  case "year":
536
- return x(t, -1);
536
+ return v(t, -1);
537
537
  case "agenda":
538
- return b(t, -1);
538
+ return H(t, -1);
539
539
  default:
540
540
  return l(t, -1);
541
541
  }
542
542
  }
543
- function se() {
544
- return g(/* @__PURE__ */ new Date());
543
+ function fe() {
544
+ return d(/* @__PURE__ */ new Date());
545
545
  }
546
- function ue(t, e = 1) {
547
- const n = p(t), r = w(t), o = d(n, e), a = T(r, e), s = [];
546
+ function ge(t, e = 1) {
547
+ const n = M(t), r = E(t), o = m(n, e), a = T(r, e), s = [];
548
548
  let u = o;
549
549
  for (; u <= a; )
550
550
  s.push({
551
551
  date: new Date(u),
552
- isToday: O(u),
552
+ isToday: $(u),
553
553
  isCurrentMonth: F(u, t),
554
- isWeekend: _(u),
554
+ isWeekend: R(u),
555
555
  dayOfWeek: u.getDay()
556
556
  }), u = l(u, 1);
557
557
  return s;
558
558
  }
559
- function ie(t, e = 1) {
560
- const n = d(t, e), r = [];
559
+ function de(t, e = 1) {
560
+ const n = m(t, e), r = [];
561
561
  for (let o = 0; o < 7; o++) {
562
562
  const a = l(n, o);
563
563
  r.push({
564
564
  date: a,
565
- isToday: O(a),
565
+ isToday: $(a),
566
566
  isCurrentMonth: F(a, t),
567
- isWeekend: _(a),
567
+ isWeekend: R(a),
568
568
  dayOfWeek: a.getDay()
569
569
  });
570
570
  }
571
571
  return r;
572
572
  }
573
- function ce(t) {
574
- const e = $(t), n = [];
573
+ function me(t) {
574
+ const e = U(t), n = [];
575
575
  for (let r = 0; r < 12; r++) {
576
- const o = H(e, r);
576
+ const o = I(e, r);
577
577
  n.push({
578
578
  date: o,
579
579
  isToday: F(o, /* @__PURE__ */ new Date()),
@@ -584,7 +584,7 @@ function ce(t) {
584
584
  }
585
585
  return n;
586
586
  }
587
- function le(t, e, n = 30) {
587
+ function De(t, e, n = 30) {
588
588
  const r = [], o = 60 / n;
589
589
  for (let a = t; a < e; a++)
590
590
  for (let s = 0; s < o; s++) {
@@ -597,7 +597,7 @@ function le(t, e, n = 30) {
597
597
  }
598
598
  return r;
599
599
  }
600
- function fe(t, e, n = "24h") {
600
+ function he(t, e, n = "24h") {
601
601
  const r = [];
602
602
  for (let o = t; o <= e; o++) {
603
603
  let a;
@@ -610,7 +610,7 @@ function fe(t, e, n = "24h") {
610
610
  }
611
611
  return r;
612
612
  }
613
- function ge(t, e, n = "en-US") {
613
+ function ye(t, e, n = "en-US") {
614
614
  const r = new Intl.DateTimeFormat(n, {
615
615
  weekday: "short",
616
616
  month: "short",
@@ -621,31 +621,35 @@ function ge(t, e, n = "en-US") {
621
621
  case "resource-day":
622
622
  case "timeline-day":
623
623
  return r.format(t);
624
+ case "timeline-3day": {
625
+ const a = d(t), s = l(t, 2);
626
+ return `${o.format(a)} - ${o.format(s)}`;
627
+ }
624
628
  case "week":
625
629
  case "resource-week":
626
630
  case "timeline-week": {
627
- const a = d(t, 1), s = T(t, 1);
631
+ const a = m(t, 1), s = T(t, 1);
628
632
  return `${o.format(a)} - ${o.format(s)}`;
629
633
  }
630
634
  case "month": {
631
- const a = p(t), s = w(t);
635
+ const a = M(t), s = E(t);
632
636
  return `${o.format(a)} - ${o.format(s)}`;
633
637
  }
634
638
  case "year":
635
639
  return `Jan 1 - Dec 31, ${t.getFullYear()}`;
636
640
  case "agenda": {
637
- const a = p(t), s = w(t);
641
+ const a = M(t), s = E(t);
638
642
  return `${o.format(a)} - ${o.format(s)}`;
639
643
  }
640
644
  default:
641
645
  return "";
642
646
  }
643
647
  }
644
- function de(t, e, n, r = 1) {
645
- const o = z(e, n, r);
648
+ function pe(t, e, n, r = 1) {
649
+ const o = q(e, n, r);
646
650
  return t.filter((a) => a.startDate <= o.endDate && a.endDate >= o.startDate).length;
647
651
  }
648
- function me(t, e, n = "en-US") {
652
+ function Te(t, e, n = "en-US") {
649
653
  const r = new Intl.DateTimeFormat(n, { month: "long", year: "numeric" }), o = new Intl.DateTimeFormat(n, {
650
654
  weekday: "long",
651
655
  month: "long",
@@ -660,7 +664,7 @@ function me(t, e, n = "en-US") {
660
664
  case "week":
661
665
  case "resource-week":
662
666
  case "timeline-week": {
663
- const a = d(t, 1), s = T(t, 1), u = new Intl.DateTimeFormat(n, { month: "short" }).format(a), c = new Intl.DateTimeFormat(n, { month: "short" }).format(s), i = a.getFullYear();
667
+ const a = m(t, 1), s = T(t, 1), u = new Intl.DateTimeFormat(n, { month: "short" }).format(a), c = new Intl.DateTimeFormat(n, { month: "short" }).format(s), i = a.getFullYear();
664
668
  return u === c ? `${u} ${a.getDate()} - ${s.getDate()}, ${i}` : `${u} ${a.getDate()} - ${c} ${s.getDate()}, ${i}`;
665
669
  }
666
670
  case "month":
@@ -673,7 +677,7 @@ function me(t, e, n = "en-US") {
673
677
  return r.format(t);
674
678
  }
675
679
  }
676
- function De(t = 1, e = "short", n = "en-US") {
680
+ function we(t = 1, e = "short", n = "en-US") {
677
681
  const r = new Intl.DateTimeFormat(n, { weekday: e }), o = [], a = new Date(2024, 0, 7);
678
682
  for (let s = 0; s < 7; s++) {
679
683
  const u = (t + s) % 7, c = l(a, u);
@@ -684,64 +688,72 @@ function De(t = 1, e = "short", n = "en-US") {
684
688
  }
685
689
  return o;
686
690
  }
687
- function J(t, e, n, r = S) {
688
- const { startHour: o, endHour: a } = n, s = a - o, u = s * r, c = t.startDate.getHours() + t.startDate.getMinutes() / 60, i = t.endDate.getHours() + t.endDate.getMinutes() / 60, D = Math.max(c, o), h = Math.min(i, a), f = (D - o) / s * u, m = (h - o) / s * u, k = Math.max(m - f, W);
691
+ function Q(t, e, n, r = k) {
692
+ const { startHour: o, endHour: a } = n, s = a - o, u = s * r, c = t.startDate.getHours() + t.startDate.getMinutes() / 60, i = t.endDate.getHours() + t.endDate.getMinutes() / 60, g = Math.max(c, o), y = Math.min(i, a), D = (g - o) / s * u, h = (y - o) / s * u, f = Math.max(h - D, N);
689
693
  return {
690
- top: f,
691
- height: k,
694
+ top: D,
695
+ height: f,
692
696
  left: 0,
693
697
  width: 100,
694
698
  zIndex: 1
695
699
  };
696
700
  }
697
- function he(t, e, n, r = S) {
701
+ function Me(t, e, n, r = k) {
698
702
  if (t.length === 0) return [];
699
- const o = [...t].sort((i, D) => {
700
- const h = i.startDate.getTime() - D.startDate.getTime();
701
- if (h !== 0) return h;
702
- const f = i.endDate.getTime() - i.startDate.getTime();
703
- return D.endDate.getTime() - D.startDate.getTime() - f;
704
- }), a = [], s = [];
705
- for (const i of o) {
706
- const D = i.startDate.getTime(), h = i.endDate.getTime();
707
- let f = -1;
708
- for (let E = 0; E < a.length; E++) {
709
- const I = a[E];
710
- if (!I) continue;
711
- const C = I[I.length - 1];
712
- if (C && C.endTime <= D) {
713
- f = E;
714
- break;
703
+ const o = [...t].sort((i, g) => {
704
+ const y = i.startDate.getTime() - g.startDate.getTime();
705
+ if (y !== 0) return y;
706
+ const D = i.endDate.getTime() - i.startDate.getTime();
707
+ return g.endDate.getTime() - g.startDate.getTime() - D;
708
+ }), a = [];
709
+ let s = [], u = 0;
710
+ for (const i of o)
711
+ s.length === 0 || i.startDate.getTime() < u ? (s.push(i), u = Math.max(u, i.endDate.getTime())) : (a.push(s), s = [i], u = i.endDate.getTime());
712
+ s.length > 0 && a.push(s);
713
+ const c = [];
714
+ for (const i of a) {
715
+ const g = [];
716
+ for (const f of i) {
717
+ const W = f.startDate.getTime(), Y = f.endDate.getTime();
718
+ let w = -1;
719
+ for (let b = 0; b < g.length; b++) {
720
+ const x = g[b];
721
+ if (!x) continue;
722
+ const _ = x[x.length - 1];
723
+ if (_ && _.endTime <= W) {
724
+ w = b;
725
+ break;
726
+ }
715
727
  }
728
+ w === -1 && (w = g.length, g.push([]));
729
+ const O = g[w];
730
+ O && O.push({ event: f, endTime: Y });
731
+ const A = Q(f, e, n, r);
732
+ c.push({
733
+ event: f,
734
+ position: A,
735
+ column: w,
736
+ columnSpan: 1
737
+ });
716
738
  }
717
- f === -1 && (f = a.length, a.push([]));
718
- const m = a[f];
719
- m && m.push({ event: i, endTime: h });
720
- const k = J(i, e, n, r);
721
- s.push({
722
- event: i,
723
- position: k,
724
- column: f,
725
- columnSpan: 1
726
- });
739
+ const D = 100 / g.length, h = new Set(i.map((f) => f.id));
740
+ for (const f of c)
741
+ h.has(f.event.id) && (f.position.left = f.column * D, f.position.width = D * f.columnSpan, f.position.zIndex = f.column + 1);
727
742
  }
728
- const c = 100 / a.length;
729
- for (const i of s)
730
- i.position.left = i.column * c, i.position.width = c * i.columnSpan, i.position.zIndex = i.column + 1;
731
- return s;
743
+ return c;
732
744
  }
733
- function ye(t, e, n, r = S, o = 30) {
734
- const { startHour: a, endHour: s } = n, u = s - a, c = u * r, i = t / c * u, h = (a + i) * 60, f = Math.round(h / o) * o, m = new Date(e);
735
- return m.setHours(0, 0, 0, 0), m.setMinutes(f), m;
745
+ function Ee(t, e, n, r = k, o = 30) {
746
+ const { startHour: a, endHour: s } = n, u = s - a, c = u * r, i = t / c * u, y = (a + i) * 60, D = Math.round(y / o) * o, h = new Date(e);
747
+ return h.setHours(0, 0, 0, 0), h.setMinutes(D), h;
736
748
  }
737
- function Te(t, e, n = S) {
749
+ function Se(t, e, n = k) {
738
750
  const { startHour: r, endHour: o } = e, a = o - r, s = a * n, u = t.getHours() + t.getMinutes() / 60;
739
751
  return (Math.max(r, Math.min(u, o)) - r) / a * s;
740
752
  }
741
- function pe(t, e) {
753
+ function be(t, e) {
742
754
  return t.startDate < e.endDate && t.endDate > e.startDate;
743
755
  }
744
- function we(t) {
756
+ function He(t) {
745
757
  if (t.length === 0) return [];
746
758
  const e = [...t].sort((a, s) => a.startDate.getTime() - s.startDate.getTime()), n = [];
747
759
  let r = [], o = 0;
@@ -749,7 +761,7 @@ function we(t) {
749
761
  r.length === 0 || a.startDate.getTime() < o ? (r.push(a), o = Math.max(o, a.endDate.getTime())) : (r.length > 0 && n.push(r), r = [a], o = a.endDate.getTime());
750
762
  return r.length > 0 && n.push(r), n;
751
763
  }
752
- function Me(t, e, n) {
764
+ function ke(t, e, n) {
753
765
  const r = Math.max(0, Math.min(t, e)), o = Math.min(n, Math.max(t, e));
754
766
  return {
755
767
  top: r,
@@ -757,117 +769,117 @@ function Me(t, e, n) {
757
769
  };
758
770
  }
759
771
  export {
760
- K as CALENDAR_VIEWS,
761
- q as DEFAULT_BUSINESS_HOURS,
762
- st as DEFAULT_HEADER_HEIGHT,
763
- S as DEFAULT_HOUR_HEIGHT,
764
- X as DEFAULT_PREFERENCES,
765
- ut as DEFAULT_RESOURCE_WIDTH,
766
- at as DEFAULT_SLOT_HEIGHT,
767
- Q as DEFAULT_VIEW_CONFIGS,
768
- j as DEFAULT_VISIBLE_HOURS,
769
- Z as EVENT_COLORS,
770
- tt as EVENT_COLOR_CLASSES,
771
- et as HEX_TO_EVENT_COLOR,
772
- nt as HOURS_IN_DAY,
773
- rt as MINUTES_IN_HOUR,
774
- W as MIN_EVENT_HEIGHT,
775
- ot as MS_PER_DAY,
776
- U as MS_PER_HOUR,
777
- R as MS_PER_MINUTE,
772
+ Z as CALENDAR_VIEWS,
773
+ nt as DEFAULT_BUSINESS_HOURS,
774
+ ft as DEFAULT_HEADER_HEIGHT,
775
+ k as DEFAULT_HOUR_HEIGHT,
776
+ tt as DEFAULT_PREFERENCES,
777
+ gt as DEFAULT_RESOURCE_WIDTH,
778
+ lt as DEFAULT_SLOT_HEIGHT,
779
+ rt as DEFAULT_VIEW_CONFIGS,
780
+ et as DEFAULT_VISIBLE_HOURS,
781
+ ot as EVENT_COLORS,
782
+ at as EVENT_COLOR_CLASSES,
783
+ st as HEX_TO_EVENT_COLOR,
784
+ ut as HOURS_IN_DAY,
785
+ it as MINUTES_IN_HOUR,
786
+ N as MIN_EVENT_HEIGHT,
787
+ ct as MS_PER_DAY,
788
+ B as MS_PER_HOUR,
789
+ L as MS_PER_MINUTE,
778
790
  l as addDays,
779
- A as addHours,
780
- yt as addMinutes,
781
- H as addMonths,
782
- b as addWeeks,
783
- x as addYears,
784
- Vt as applyEventFilters,
785
- J as calculateEventPosition,
786
- he as calculateOverlappingPositions,
787
- Me as calculateSelectionOverlay,
788
- It as differenceInDays,
789
- kt as differenceInHours,
790
- v as differenceInMilliseconds,
791
- Ht as differenceInMinutes,
792
- L as eachDayOfInterval,
793
- Ct as eachHourOfInterval,
794
- y as endOfDay,
795
- w as endOfMonth,
791
+ P as addHours,
792
+ Et as addMinutes,
793
+ I as addMonths,
794
+ H as addWeeks,
795
+ v as addYears,
796
+ Kt as applyEventFilters,
797
+ Q as calculateEventPosition,
798
+ Me as calculateOverlappingPositions,
799
+ ke as calculateSelectionOverlay,
800
+ Ot as differenceInDays,
801
+ Ct as differenceInHours,
802
+ C as differenceInMilliseconds,
803
+ vt as differenceInMinutes,
804
+ G as eachDayOfInterval,
805
+ Ut as eachHourOfInterval,
806
+ p as endOfDay,
807
+ E as endOfMonth,
796
808
  T as endOfWeek,
797
- Y as endOfYear,
798
- pe as eventsOverlap,
799
- B as filterEventsByDateRange,
800
- V as filterEventsByResource,
801
- N as filterEventsByScheduleType,
802
- P as filterEventsBySearch,
803
- G as filterOutCanceled,
804
- xt as formatDateISO,
805
- Rt as formatHourLabel,
806
- Ft as formatTime,
807
- fe as generateHourLabels,
808
- ue as generateMonthCells,
809
- Wt as generateMonthGrid,
810
- le as generateTimeSlots,
811
- ie as generateWeekCells,
812
- ce as generateYearCells,
813
- qt as getAllDayEvents,
814
- ct as getDayOfWeek,
815
- mt as getDaysInMonth,
816
- pt as getDecimalHours,
817
- ne as getEventColor,
818
- ee as getEventDurationMinutes,
819
- de as getEventsCountInView,
820
- jt as getEventsForDay,
821
- At as getEventsInRange,
822
- _t as getMonthNames,
823
- Zt as getMultiDayEvents,
824
- we as getOverlappingGroups,
825
- ge as getRangeText,
826
- Qt as getTimedEvents,
827
- z as getViewDateRange,
828
- me as getViewTitle,
829
- $t as getVisibleHoursArray,
830
- Ut as getWeekDays,
831
- ft as getWeekNumber,
832
- De as getWeekdayHeaders,
833
- Ot as getWeekdayNames,
834
- Bt as getWorkingHoursForDay,
835
- Nt as getYearMonths,
836
- Jt as groupEventsByDate,
837
- Xt as groupEventsByResource,
838
- Kt as groupEventsByScheduleType,
839
- Mt as isAfter,
840
- wt as isBefore,
841
- Et as isBetween,
842
- te as isMultiDayEvent,
843
- M as isSameDay,
809
+ V as endOfYear,
810
+ be as eventsOverlap,
811
+ z as filterEventsByDateRange,
812
+ K as filterEventsByResource,
813
+ J as filterEventsByScheduleType,
814
+ X as filterEventsBySearch,
815
+ j as filterOutCanceled,
816
+ $t as formatDateISO,
817
+ Lt as formatHourLabel,
818
+ _t as formatTime,
819
+ he as generateHourLabels,
820
+ ge as generateMonthCells,
821
+ Nt as generateMonthGrid,
822
+ De as generateTimeSlots,
823
+ de as generateWeekCells,
824
+ me as generateYearCells,
825
+ ne as getAllDayEvents,
826
+ mt as getDayOfWeek,
827
+ Tt as getDaysInMonth,
828
+ bt as getDecimalHours,
829
+ ue as getEventColor,
830
+ se as getEventDurationMinutes,
831
+ pe as getEventsCountInView,
832
+ ee as getEventsForDay,
833
+ Pt as getEventsInRange,
834
+ Yt as getMonthNames,
835
+ oe as getMultiDayEvents,
836
+ He as getOverlappingGroups,
837
+ ye as getRangeText,
838
+ re as getTimedEvents,
839
+ q as getViewDateRange,
840
+ Te as getViewTitle,
841
+ At as getVisibleHoursArray,
842
+ Bt as getWeekDays,
843
+ ht as getWeekNumber,
844
+ we as getWeekdayHeaders,
845
+ Wt as getWeekdayNames,
846
+ zt as getWorkingHoursForDay,
847
+ Jt as getYearMonths,
848
+ Qt as groupEventsByDate,
849
+ te as groupEventsByResource,
850
+ Zt as groupEventsByScheduleType,
851
+ kt as isAfter,
852
+ Ht as isBefore,
853
+ It as isBetween,
854
+ ae as isMultiDayEvent,
855
+ S as isSameDay,
844
856
  F as isSameMonth,
845
- gt as isSameWeek,
846
- ht as isSameYear,
847
- O as isToday,
848
- _ as isWeekend,
849
- Lt as isWorkingHour,
850
- St as maxDate,
851
- bt as minDate,
852
- oe as navigateNext,
853
- ae as navigatePrev,
854
- se as navigateToday,
855
- vt as parseISO,
856
- re as resolveEventColor,
857
- Yt as separateEventsByDuration,
858
- Tt as setTime,
859
- zt as sortEventsByDuration,
860
- Gt as sortEventsByEnd,
861
- Pt as sortEventsByStart,
862
- g as startOfDay,
863
- p as startOfMonth,
864
- d as startOfWeek,
865
- $ as startOfYear,
866
- it as subDays,
867
- dt as subMonths,
868
- lt as subWeeks,
869
- Dt as subYears,
870
- Te as timeToY,
871
- ye as yToTime
857
+ yt as isSameWeek,
858
+ Mt as isSameYear,
859
+ $ as isToday,
860
+ R as isWeekend,
861
+ Gt as isWorkingHour,
862
+ Ft as maxDate,
863
+ xt as minDate,
864
+ ce as navigateNext,
865
+ le as navigatePrev,
866
+ fe as navigateToday,
867
+ Rt as parseISO,
868
+ ie as resolveEventColor,
869
+ Vt as separateEventsByDuration,
870
+ St as setTime,
871
+ qt as sortEventsByDuration,
872
+ jt as sortEventsByEnd,
873
+ Xt as sortEventsByStart,
874
+ d as startOfDay,
875
+ M as startOfMonth,
876
+ m as startOfWeek,
877
+ U as startOfYear,
878
+ dt as subDays,
879
+ pt as subMonths,
880
+ Dt as subWeeks,
881
+ wt as subYears,
882
+ Se as timeToY,
883
+ Ee as yToTime
872
884
  };
873
885
  //# sourceMappingURL=utils.mjs.map