@innosolutions/inno-calendar 1.0.57 → 1.0.59

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 (30) hide show
  1. package/AGENT.md +1721 -1610
  2. package/README.md +235 -235
  3. package/dist/agenda-widget-BxZU4eGL.cjs +2 -0
  4. package/dist/agenda-widget-BxZU4eGL.cjs.map +1 -0
  5. package/dist/{agenda-widget-1kak6FM9.js → agenda-widget-wrZfO67A.js} +1308 -1223
  6. package/dist/agenda-widget-wrZfO67A.js.map +1 -0
  7. package/dist/components/event/event-card.d.ts.map +1 -1
  8. package/dist/components/index.cjs +1 -1
  9. package/dist/components/index.mjs +2 -2
  10. package/dist/components/primitives/scroll-navigator.d.ts +1 -1
  11. package/dist/components/primitives/scroll-navigator.d.ts.map +1 -1
  12. package/dist/index.cjs +1 -1
  13. package/dist/index.mjs +200 -200
  14. package/dist/presets/index.cjs +1 -1
  15. package/dist/presets/index.mjs +1 -1
  16. package/dist/{tailwind-calendar-DjtOowce.js → tailwind-calendar-CVuxWXLY.js} +2 -2
  17. package/dist/{tailwind-calendar-DjtOowce.js.map → tailwind-calendar-CVuxWXLY.js.map} +1 -1
  18. package/dist/{tailwind-calendar-DpEkgg5k.cjs → tailwind-calendar-DoG6s3PJ.cjs} +2 -2
  19. package/dist/{tailwind-calendar-DpEkgg5k.cjs.map → tailwind-calendar-DoG6s3PJ.cjs.map} +1 -1
  20. package/dist/week-view-Bzpbti1B.cjs +11 -0
  21. package/dist/week-view-Bzpbti1B.cjs.map +1 -0
  22. package/dist/{week-view-CKx6bJdJ.js → week-view-C1FxF_nk.js} +880 -867
  23. package/dist/week-view-C1FxF_nk.js.map +1 -0
  24. package/package.json +138 -138
  25. package/dist/agenda-widget-1kak6FM9.js.map +0 -1
  26. package/dist/agenda-widget-C8CFFI1c.cjs +0 -2
  27. package/dist/agenda-widget-C8CFFI1c.cjs.map +0 -1
  28. package/dist/week-view-CKx6bJdJ.js.map +0 -1
  29. package/dist/week-view-DXlwhFjn.cjs +0 -11
  30. package/dist/week-view-DXlwhFjn.cjs.map +0 -1
@@ -1,11 +1,11 @@
1
- import { jsx as e, jsxs as r, Fragment as pe } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as r, Fragment as we } from "react/jsx-runtime";
2
2
  import { g as it, u as pt, C as xt } from "./use-calendar-Clo9DFK4.js";
3
- import { useCallback as $, useState as oe, useEffect as ce, forwardRef as Ae, useRef as ae, useMemo as X, useLayoutEffect as vt, useImperativeHandle as wt } from "react";
4
- import { c as m } from "./index-DtaLkIY8.js";
5
- import { P as lt, p as ct, o as dt, z as ue, I as bt, J as yt, B as ye, K as kt, L as Ue, x as he, F as me, y as fe, k as Nt, C as Dt, M as Ve, A as Ct, W as Mt, c as St, N as Et } from "./week-view-CKx6bJdJ.js";
6
- import { j as Lt, D as Tt, I as Ht, e as It, S as zt } from "./slot-selection-context-BwghpxKA.js";
7
- import { isToday as ie, startOfDay as Pe, endOfDay as ut, getYearMonths as jt, generateMonthGrid as At, getEventsForDay as Pt, addDays as ht, formatDateISO as Wt } from "./utils.mjs";
8
- function $t({ view: t, className: n = "" }) {
3
+ import { useCallback as F, useState as ie, useEffect as de, forwardRef as Ae, useRef as ae, useMemo as Q, useLayoutEffect as vt, useImperativeHandle as wt } from "react";
4
+ import { c as g } from "./index-DtaLkIY8.js";
5
+ import { P as lt, p as ct, o as dt, z as me, I as bt, J as yt, B as Ce, K as kt, L as Ue, x as fe, F as ge, y as pe, k as Nt, C as Ct, M as Ve, A as Dt, W as Mt, c as St, N as Et } from "./week-view-C1FxF_nk.js";
6
+ import { j as Lt, D as Tt, I as Ht, e as zt, S as It } from "./slot-selection-context-BwghpxKA.js";
7
+ import { isToday as ce, startOfDay as Pe, endOfDay as ut, getYearMonths as jt, generateMonthGrid as At, getEventsForDay as Pt, addDays as ht, formatDateISO as Wt } from "./utils.mjs";
8
+ function Ft({ view: t, className: n = "" }) {
9
9
  return /* @__PURE__ */ e(
10
10
  "div",
11
11
  {
@@ -30,48 +30,48 @@ function $t({ view: t, className: n = "" }) {
30
30
  );
31
31
  }
32
32
  function Ye({ view: t, className: n }) {
33
- return /* @__PURE__ */ e($t, { view: t, className: n });
33
+ return /* @__PURE__ */ e(Ft, { view: t, className: n });
34
34
  }
35
35
  function kr(t) {
36
36
  const {
37
37
  events: n,
38
38
  resources: o,
39
- scheduleTypes: s,
40
- initialView: a = "week",
41
- initialDate: i,
42
- initialFilters: f,
39
+ scheduleTypes: a,
40
+ initialView: i = "week",
41
+ initialDate: l,
42
+ initialFilters: p,
43
43
  preferences: h,
44
44
  locale: d,
45
- slots: w,
46
- renderEvent: k,
47
- onViewChange: b,
48
- onDateChange: I,
49
- onEventClick: F,
45
+ slots: v,
46
+ renderEvent: b,
47
+ onViewChange: w,
48
+ onDateChange: A,
49
+ onEventClick: $,
50
50
  onSlotSelect: P,
51
51
  onFiltersChange: W,
52
- className: E,
52
+ className: T,
53
53
  children: y
54
- } = t, A = it();
55
- if (A)
56
- return /* @__PURE__ */ e("div", { className: E, style: { position: "relative" }, children: y ?? /* @__PURE__ */ e(Ye, { view: A.view, className: E }) });
54
+ } = t, z = it();
55
+ if (z)
56
+ return /* @__PURE__ */ e("div", { className: T, style: { position: "relative" }, children: y ?? /* @__PURE__ */ e(Ye, { view: z.view, className: T }) });
57
57
  const O = pt({
58
58
  events: n,
59
59
  resources: o,
60
- scheduleTypes: s,
61
- initialView: a,
62
- initialDate: i,
63
- initialFilters: f,
60
+ scheduleTypes: a,
61
+ initialView: i,
62
+ initialDate: l,
63
+ initialFilters: p,
64
64
  preferences: h,
65
65
  locale: d,
66
- onViewChange: b,
67
- onDateChange: I,
68
- onEventClick: F,
66
+ onViewChange: w,
67
+ onDateChange: A,
68
+ onEventClick: $,
69
69
  onSlotSelect: P,
70
70
  onFiltersChange: W
71
71
  });
72
- return /* @__PURE__ */ e(xt, { value: O, children: /* @__PURE__ */ e("div", { className: E, style: { position: "relative" }, children: y ?? /* @__PURE__ */ e(Ye, { view: O.view, className: E }) }) });
72
+ return /* @__PURE__ */ e(xt, { value: O, children: /* @__PURE__ */ e("div", { className: T, style: { position: "relative" }, children: y ?? /* @__PURE__ */ e(Ye, { view: O.view, className: T }) }) });
73
73
  }
74
- function Ft({ className: t }) {
74
+ function $t({ className: t }) {
75
75
  return /* @__PURE__ */ r(
76
76
  "svg",
77
77
  {
@@ -284,7 +284,7 @@ function Yt({ className: t }) {
284
284
  }
285
285
  );
286
286
  }
287
- function De({ className: t }) {
287
+ function Me({ className: t }) {
288
288
  return /* @__PURE__ */ e(
289
289
  "svg",
290
290
  {
@@ -295,7 +295,7 @@ function De({ className: t }) {
295
295
  strokeWidth: "2",
296
296
  strokeLinecap: "round",
297
297
  strokeLinejoin: "round",
298
- className: m("animate-spin", t),
298
+ className: g("animate-spin", t),
299
299
  children: /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
300
300
  }
301
301
  );
@@ -326,51 +326,51 @@ const Kt = {
326
326
  deleteConfirmTitle: "Delete Event",
327
327
  deleteConfirmDescription: "Are you sure you want to delete this event? This action cannot be undone."
328
328
  }, He = Ae(
329
- ({ onClick: t, label: n, children: o, className: s, variant: a = "ghost", ...i }, f) => /* @__PURE__ */ r(he, { children: [
330
- /* @__PURE__ */ e(me, { asChild: !0, children: /* @__PURE__ */ e(
329
+ ({ onClick: t, label: n, children: o, className: a, variant: i = "ghost", ...l }, p) => /* @__PURE__ */ r(fe, { children: [
330
+ /* @__PURE__ */ e(ge, { asChild: !0, children: /* @__PURE__ */ e(
331
331
  "button",
332
332
  {
333
333
  type: "button",
334
- ref: f,
334
+ ref: p,
335
335
  onClick: t,
336
- className: m(
336
+ className: g(
337
337
  "h-8 w-8 rounded-full flex items-center justify-center transition-colors",
338
- a === "ghost" && "hover:bg-zinc-100 dark:hover:bg-zinc-800 text-zinc-600 dark:text-zinc-400",
339
- a === "destructive" && "hover:bg-red-50 dark:hover:bg-red-950/30 text-zinc-600 dark:text-zinc-400 hover:text-red-600",
340
- s
338
+ i === "ghost" && "hover:bg-zinc-100 dark:hover:bg-zinc-800 text-zinc-600 dark:text-zinc-400",
339
+ i === "destructive" && "hover:bg-red-50 dark:hover:bg-red-950/30 text-zinc-600 dark:text-zinc-400 hover:text-red-600",
340
+ a
341
341
  ),
342
342
  "aria-label": n,
343
- ...i,
343
+ ...l,
344
344
  children: o
345
345
  }
346
346
  ) }),
347
- /* @__PURE__ */ e(fe, { side: "bottom", className: "text-xs", children: n })
347
+ /* @__PURE__ */ e(pe, { side: "bottom", className: "text-xs", children: n })
348
348
  ] })
349
349
  );
350
350
  He.displayName = "IconButton";
351
- function Gt({ src: t, alt: n, initials: o, className: s, isClient: a }) {
352
- const [i, f] = oe(!1);
351
+ function Gt({ src: t, alt: n, initials: o, className: a, isClient: i }) {
352
+ const [l, p] = ie(!1);
353
353
  return /* @__PURE__ */ e(
354
354
  "div",
355
355
  {
356
- className: m(
356
+ className: g(
357
357
  "relative h-7 w-7 rounded-full overflow-hidden shrink-0",
358
- s
358
+ a
359
359
  ),
360
- children: t && !i ? /* @__PURE__ */ e(
360
+ children: t && !l ? /* @__PURE__ */ e(
361
361
  "img",
362
362
  {
363
363
  src: t,
364
364
  alt: n,
365
365
  className: "h-full w-full object-cover",
366
- onError: () => f(!0)
366
+ onError: () => p(!0)
367
367
  }
368
368
  ) : /* @__PURE__ */ e(
369
369
  "div",
370
370
  {
371
- className: m(
371
+ className: g(
372
372
  "h-full w-full flex items-center justify-center text-[10px] font-medium",
373
- a ? "bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300" : "bg-zinc-200 dark:bg-zinc-700 text-zinc-700 dark:text-zinc-300"
373
+ i ? "bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300" : "bg-zinc-200 dark:bg-zinc-700 text-zinc-700 dark:text-zinc-300"
374
374
  ),
375
375
  children: o
376
376
  }
@@ -383,41 +383,41 @@ function Ke({
383
383
  isEventCanceled: n = !1,
384
384
  labels: o
385
385
  }) {
386
- const s = t.name || "Unknown", a = s.split(" ").map((I) => I[0]).join("").toUpperCase().slice(0, 2), i = t.isOrganizer ?? !1, f = t.isConfirmed, h = f === !0, d = f === !1, w = t.isClient ?? !1, k = t.profilePicture || t.avatar, b = n;
386
+ const a = t.name || "Unknown", i = a.split(" ").map((A) => A[0]).join("").toUpperCase().slice(0, 2), l = t.isOrganizer ?? !1, p = t.isConfirmed, h = p === !0, d = p === !1, v = t.isClient ?? !1, b = t.profilePicture || t.avatar, w = n;
387
387
  return /* @__PURE__ */ r(
388
388
  "div",
389
389
  {
390
- className: m(
390
+ className: g(
391
391
  "flex items-center gap-3 py-0",
392
- b && "opacity-60"
392
+ w && "opacity-60"
393
393
  ),
394
394
  children: [
395
395
  /* @__PURE__ */ r("div", { className: "relative", children: [
396
396
  /* @__PURE__ */ e(
397
397
  Gt,
398
398
  {
399
- src: k,
400
- alt: s,
401
- initials: a,
402
- isClient: w,
403
- className: m(b && "grayscale")
399
+ src: b,
400
+ alt: a,
401
+ initials: i,
402
+ isClient: v,
403
+ className: g(w && "grayscale")
404
404
  }
405
405
  ),
406
- b || d ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-red-100 dark:bg-red-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(je, { className: "h-2 w-2 text-red-600 dark:text-red-400 stroke-[3]" }) }) }) : h ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-green-100 dark:bg-green-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(Te, { className: "h-2 w-2 text-green-600 dark:text-green-400 stroke-[3]" }) }) }) : null
406
+ w || d ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-red-100 dark:bg-red-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(je, { className: "h-2 w-2 text-red-600 dark:text-red-400 stroke-[3]" }) }) }) : h ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-green-100 dark:bg-green-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(Te, { className: "h-2 w-2 text-green-600 dark:text-green-400 stroke-[3]" }) }) }) : null
407
407
  ] }),
408
408
  /* @__PURE__ */ r("div", { className: "!h-fit min-w-0 gap-0", children: [
409
409
  /* @__PURE__ */ e("div", { className: "gap-0", children: /* @__PURE__ */ e(
410
410
  "span",
411
411
  {
412
- className: m(
412
+ className: g(
413
413
  "text-sm text-zinc-900 dark:text-zinc-100 truncate",
414
- b && "line-through text-zinc-500 dark:text-zinc-500"
414
+ w && "line-through text-zinc-500 dark:text-zinc-500"
415
415
  ),
416
- children: s
416
+ children: a
417
417
  }
418
418
  ) }),
419
- w && /* @__PURE__ */ e("div", { className: "text-[10px] px-1.5 w-fit py-0.5 rounded bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 font-medium", children: o.client }),
420
- i && !b && /* @__PURE__ */ e("div", { className: "text-xs text-zinc-500", children: o.organizer })
419
+ v && /* @__PURE__ */ e("div", { className: "text-[10px] px-1.5 w-fit py-0.5 rounded bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 font-medium", children: o.client }),
420
+ l && !w && /* @__PURE__ */ e("div", { className: "text-xs text-zinc-500", children: o.organizer })
421
421
  ] })
422
422
  ]
423
423
  }
@@ -427,15 +427,15 @@ function Jt({
427
427
  open: t,
428
428
  onOpenChange: n,
429
429
  title: o,
430
- children: s
430
+ children: a
431
431
  }) {
432
- return ce(() => {
432
+ return de(() => {
433
433
  if (!t) return;
434
- const a = (i) => {
435
- i.key === "Escape" && n(!1);
434
+ const i = (l) => {
435
+ l.key === "Escape" && n(!1);
436
436
  };
437
- return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
438
- }, [t, n]), ce(() => (t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
437
+ return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
438
+ }, [t, n]), de(() => (t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
439
439
  document.body.style.overflow = "";
440
440
  }), [t]), t ? /* @__PURE__ */ r("div", { className: "fixed inset-0 z-50", children: [
441
441
  /* @__PURE__ */ e(
@@ -443,14 +443,14 @@ function Jt({
443
443
  {
444
444
  className: "fixed inset-0 bg-black/50 backdrop-blur-sm",
445
445
  onClick: () => n(!1),
446
- onKeyDown: (a) => {
447
- (a.key === "Enter" || a.key === " ") && n(!1);
446
+ onKeyDown: (i) => {
447
+ (i.key === "Enter" || i.key === " ") && n(!1);
448
448
  }
449
449
  }
450
450
  ),
451
451
  /* @__PURE__ */ e("div", { className: "fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto", children: /* @__PURE__ */ r("div", { className: "bg-white dark:bg-zinc-900 rounded-2xl shadow-xl overflow-hidden", children: [
452
452
  o && /* @__PURE__ */ e("div", { className: "sr-only", children: o }),
453
- s
453
+ a
454
454
  ] }) })
455
455
  ] }) : null;
456
456
  }
@@ -458,10 +458,10 @@ function qt({
458
458
  open: t,
459
459
  onOpenChange: n,
460
460
  title: o,
461
- description: s,
462
- cancelLabel: a,
463
- confirmLabel: i,
464
- onConfirm: f,
461
+ description: a,
462
+ cancelLabel: i,
463
+ confirmLabel: l,
464
+ onConfirm: p,
465
465
  isLoading: h
466
466
  }) {
467
467
  return t ? /* @__PURE__ */ r("div", { className: "fixed inset-0 z-[60]", children: [
@@ -477,28 +477,28 @@ function qt({
477
477
  ),
478
478
  /* @__PURE__ */ e("div", { className: "fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto", children: /* @__PURE__ */ r("div", { className: "bg-white dark:bg-zinc-900 rounded-lg shadow-xl p-6", children: [
479
479
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children: o }),
480
- /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-zinc-600 dark:text-zinc-400", children: s }),
480
+ /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-zinc-600 dark:text-zinc-400", children: a }),
481
481
  /* @__PURE__ */ r("div", { className: "mt-4 flex justify-end gap-3", children: [
482
482
  /* @__PURE__ */ e(
483
- ye,
483
+ Ce,
484
484
  {
485
485
  variant: "outline",
486
486
  size: "sm",
487
487
  onClick: () => n(!1),
488
- children: a
488
+ children: i
489
489
  }
490
490
  ),
491
491
  /* @__PURE__ */ r(
492
- ye,
492
+ Ce,
493
493
  {
494
494
  variant: "destructive",
495
495
  size: "sm",
496
- onClick: f,
496
+ onClick: p,
497
497
  disabled: h,
498
498
  children: [
499
- h && /* @__PURE__ */ e(De, { className: "h-4 w-4 mr-2" }),
499
+ h && /* @__PURE__ */ e(Me, { className: "h-4 w-4 mr-2" }),
500
500
  /* @__PURE__ */ e(mt, { className: "h-4 w-4 mr-2" }),
501
- i
501
+ l
502
502
  ]
503
503
  }
504
504
  )
@@ -531,72 +531,72 @@ function Zt(t) {
531
531
  });
532
532
  }
533
533
  function en(t) {
534
- const [n, o] = oe(() => typeof window < "u" ? window.matchMedia(t).matches : !1);
535
- return ce(() => {
534
+ const [n, o] = ie(() => typeof window < "u" ? window.matchMedia(t).matches : !1);
535
+ return de(() => {
536
536
  if (typeof window > "u") return;
537
- const s = window.matchMedia(t), a = (i) => o(i.matches);
538
- return s.addEventListener("change", a), () => s.removeEventListener("change", a);
537
+ const a = window.matchMedia(t), i = (l) => o(l.matches);
538
+ return a.addEventListener("change", i), () => a.removeEventListener("change", i);
539
539
  }, [t]), n;
540
540
  }
541
541
  function Ge({
542
542
  event: t,
543
543
  labels: n,
544
544
  isLoading: o,
545
- onClose: s,
546
- onEdit: a,
547
- onDelete: i,
548
- onCancel: f,
545
+ onClose: a,
546
+ onEdit: i,
547
+ onDelete: l,
548
+ onCancel: p,
549
549
  onAccept: h,
550
550
  onDecline: d,
551
- onConfirmMeeting: w,
552
- canEdit: k = !0,
553
- canDelete: b = !1,
554
- canCancel: I = !0,
555
- isCurrentUserParticipant: F = !1,
551
+ onConfirmMeeting: v,
552
+ canEdit: b = !0,
553
+ canDelete: w = !1,
554
+ canCancel: A = !0,
555
+ isCurrentUserParticipant: $ = !1,
556
556
  isCurrentUserClient: P = !1,
557
557
  currentUserAcceptStatus: W,
558
- isAcceptLoading: E = !1,
558
+ isAcceptLoading: T = !1,
559
559
  isDeclineLoading: y = !1,
560
- isConfirmLoading: A = !1,
560
+ isConfirmLoading: z = !1,
561
561
  isDeleteLoading: O = !1,
562
- renderParticipant: R,
563
- renderHeaderActions: C,
564
- renderCancelReason: _,
565
- renderDeleteConfirmation: z,
566
- formatDate: j = Xt,
562
+ renderParticipant: _,
563
+ renderHeaderActions: D,
564
+ renderCancelReason: K,
565
+ renderDeleteConfirmation: E,
566
+ formatDate: H = Xt,
567
567
  formatTimeRange: V = Qt
568
568
  }) {
569
- const [K, Y] = oe(!1), x = !(t.isCanceled || t.meetingTookPlace), c = t.isRecurring ?? !1, g = t.participantDetails, L = t.participantsNames || [], B = g && g.length > 0, S = W === !0, re = W === !1, G = F && !P && x, Ce = B ? g.filter((M) => M.isConfirmed).length : t.isAccepted ? L.length : 0, ee = B ? g.length : L.length, Q = t.scheduleTypeColor || t.hexColor || "#039BE5", ke = $(() => t.startDate ? j(t.startDate) : n.noDateProvided, [t.startDate, j, n.noDateProvided]), se = $(() => t.startDate && t.endDate ? V(t.startDate, t.endDate) : null, [t.startDate, t.endDate, V]), le = () => {
570
- s(), a?.(t);
571
- }, Me = () => {
572
- s(), f?.(t);
573
- }, xe = () => {
574
- Y(!0);
575
- }, p = () => {
576
- i?.(t), Y(!1);
569
+ const [J, G] = ie(!1), B = !(t.isCanceled || t.meetingTookPlace), s = t.isRecurring ?? !1, m = t.participantDetails, N = t.participantsNames || [], L = m && m.length > 0, S = W === !0, Y = W === !1, R = $ && !P && B, se = L ? m.filter((M) => M.isConfirmed).length : t.isAccepted ? N.length : 0, ee = L ? m.length : N.length, Z = t.scheduleTypeColor || t.hexColor || "#039BE5", ve = F(() => t.startDate ? H(t.startDate) : n.noDateProvided, [t.startDate, H, n.noDateProvided]), ne = F(() => t.startDate && t.endDate ? V(t.startDate, t.endDate) : null, [t.startDate, t.endDate, V]), le = () => {
570
+ a(), i?.(t);
571
+ }, be = () => {
572
+ a(), p?.(t);
573
+ }, ue = () => {
574
+ G(!0);
575
+ }, f = () => {
576
+ l?.(t), G(!1);
577
577
  };
578
- return o ? /* @__PURE__ */ e("div", { className: "flex h-48 items-center justify-center", children: /* @__PURE__ */ e(De, { className: "h-6 w-6 text-zinc-400" }) }) : /* @__PURE__ */ r(ue, { delayDuration: 300, children: [
578
+ return o ? /* @__PURE__ */ e("div", { className: "flex h-48 items-center justify-center", children: /* @__PURE__ */ e(Me, { className: "h-6 w-6 text-zinc-400" }) }) : /* @__PURE__ */ r(me, { delayDuration: 300, children: [
579
579
  /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5 p-3", children: [
580
- /* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children: C ? C({ onClose: s }) : /* @__PURE__ */ r(pe, { children: [
581
- x && k && a && /* @__PURE__ */ e(He, { onClick: le, label: n.edit, children: /* @__PURE__ */ e(Ft, { className: "h-[18px] w-[18px]" }) }),
582
- x && I && f && /* @__PURE__ */ e(He, { onClick: Me, label: n.cancel, children: /* @__PURE__ */ e(Ot, { className: "h-[18px] w-[18px]" }) }),
583
- b && i && /* @__PURE__ */ e(
580
+ /* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children: D ? D({ onClose: a }) : /* @__PURE__ */ r(we, { children: [
581
+ B && b && i && /* @__PURE__ */ e(He, { onClick: le, label: n.edit, children: /* @__PURE__ */ e($t, { className: "h-[18px] w-[18px]" }) }),
582
+ B && A && p && /* @__PURE__ */ e(He, { onClick: be, label: n.cancel, children: /* @__PURE__ */ e(Ot, { className: "h-[18px] w-[18px]" }) }),
583
+ w && l && /* @__PURE__ */ e(
584
584
  He,
585
585
  {
586
- onClick: xe,
586
+ onClick: ue,
587
587
  label: n.delete,
588
588
  variant: "destructive",
589
589
  children: /* @__PURE__ */ e(mt, { className: "h-[18px] w-[18px]" })
590
590
  }
591
591
  ),
592
- /* @__PURE__ */ e(He, { onClick: s, label: n.close, children: /* @__PURE__ */ e(je, { className: "h-[18px] w-[18px]" }) })
592
+ /* @__PURE__ */ e(He, { onClick: a, label: n.close, children: /* @__PURE__ */ e(je, { className: "h-[18px] w-[18px]" }) })
593
593
  ] }) }),
594
594
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ r("div", { className: "flex items-start gap-2", children: [
595
595
  /* @__PURE__ */ e(
596
596
  "div",
597
597
  {
598
598
  className: "w-4 h-4 rounded mt-1 shrink-0",
599
- style: { backgroundColor: Q }
599
+ style: { backgroundColor: Z }
600
600
  }
601
601
  ),
602
602
  /* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
@@ -604,7 +604,7 @@ function Ge({
604
604
  /* @__PURE__ */ e(
605
605
  "h2",
606
606
  {
607
- className: m(
607
+ className: g(
608
608
  "text-[22px] font-normal text-zinc-900 dark:text-zinc-100 leading-tight",
609
609
  t.isCanceled && "line-through opacity-60"
610
610
  ),
@@ -621,16 +621,16 @@ function Ge({
621
621
  ] })
622
622
  ] }),
623
623
  /* @__PURE__ */ r("div", { className: "mt-1 text-sm text-zinc-600 dark:text-zinc-400", children: [
624
- /* @__PURE__ */ e("span", { children: ke() }),
625
- se() && /* @__PURE__ */ r(pe, { children: [
624
+ /* @__PURE__ */ e("span", { children: ve() }),
625
+ ne() && /* @__PURE__ */ r(we, { children: [
626
626
  /* @__PURE__ */ e("span", { className: "mx-1.5", children: "·" }),
627
- /* @__PURE__ */ e("span", { children: se() })
627
+ /* @__PURE__ */ e("span", { children: ne() })
628
628
  ] })
629
629
  ] }),
630
- c && t.recurrenceSummary && /* @__PURE__ */ e("div", { className: "text-sm text-zinc-500 dark:text-zinc-500", children: t.recurrenceSummary })
630
+ s && t.recurrenceSummary && /* @__PURE__ */ e("div", { className: "text-sm text-zinc-500 dark:text-zinc-500", children: t.recurrenceSummary })
631
631
  ] })
632
632
  ] }) }),
633
- t.isCanceled && /* @__PURE__ */ e("div", { className: "mx-4 p-3 rounded-lg bg-red-50 dark:bg-red-950/30", children: _ ? _(t) : /* @__PURE__ */ e("div", { className: "flex items-start gap-0", children: /* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
633
+ t.isCanceled && /* @__PURE__ */ e("div", { className: "mx-4 p-3 rounded-lg bg-red-50 dark:bg-red-950/30", children: K ? K(t) : /* @__PURE__ */ e("div", { className: "flex items-start gap-0", children: /* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
634
634
  /* @__PURE__ */ e("div", { className: "text-sm font-medium text-red-700 dark:text-red-400", children: n.cancellationNote }),
635
635
  t.cancelReason && /* @__PURE__ */ r("div", { className: "mt-1 text-sm text-red-600/80 dark:text-red-400/80 italic", children: [
636
636
  '"',
@@ -648,7 +648,7 @@ function Ge({
648
648
  /* @__PURE__ */ e(Ut, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
649
649
  /* @__PURE__ */ e("span", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: t.address })
650
650
  ] }),
651
- (B || L.length > 0) && /* @__PURE__ */ r("div", { className: "flex items-start gap-2 py-0", children: [
651
+ (L || N.length > 0) && /* @__PURE__ */ r("div", { className: "flex items-start gap-2 py-0", children: [
652
652
  /* @__PURE__ */ e(Rt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
653
653
  /* @__PURE__ */ r("div", { className: "flex-1", children: [
654
654
  /* @__PURE__ */ r("div", { className: "flex items-center gap-0", children: [
@@ -659,15 +659,15 @@ function Ge({
659
659
  ] }),
660
660
  ee > 0 && /* @__PURE__ */ r("span", { className: "text-xs text-zinc-500", children: [
661
661
  "(",
662
- Ce,
662
+ se,
663
663
  " ",
664
664
  n.confirmed,
665
665
  ")"
666
666
  ] })
667
667
  ] }),
668
668
  /* @__PURE__ */ r("div", { className: "mt-2 space-y-2", children: [
669
- B ? g.slice(0, 6).map(
670
- (M, U) => R ? R(M, U) : /* @__PURE__ */ e(
669
+ L ? m.slice(0, 6).map(
670
+ (M, U) => _ ? _(M, U) : /* @__PURE__ */ e(
671
671
  Ke,
672
672
  {
673
673
  participant: M,
@@ -676,8 +676,8 @@ function Ge({
676
676
  },
677
677
  M.id
678
678
  )
679
- ) : L.slice(0, 6).map((M, U) => {
680
- const te = {
679
+ ) : N.slice(0, 6).map((M, U) => {
680
+ const re = {
681
681
  id: String(U),
682
682
  name: M,
683
683
  email: "",
@@ -685,10 +685,10 @@ function Ge({
685
685
  isOrganizer: U === 0,
686
686
  isClient: !1
687
687
  };
688
- return R ? R(te, U) : /* @__PURE__ */ e(
688
+ return _ ? _(re, U) : /* @__PURE__ */ e(
689
689
  Ke,
690
690
  {
691
- participant: te,
691
+ participant: re,
692
692
  isEventCanceled: t.isCanceled,
693
693
  labels: n
694
694
  },
@@ -710,37 +710,37 @@ function Ge({
710
710
  ] }),
711
711
  /* @__PURE__ */ r("div", { className: "flex items-start gap-2", children: [
712
712
  /* @__PURE__ */ e(Vt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
713
- /* @__PURE__ */ e("div", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: B && g.find((M) => M.isOrganizer)?.name || L[0] || "Calendar" })
713
+ /* @__PURE__ */ e("div", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: L && m.find((M) => M.isOrganizer)?.name || N[0] || "Calendar" })
714
714
  ] })
715
715
  ] }),
716
- G && h && d && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 mt-3 py-3", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
717
- c ? /* @__PURE__ */ r(bt, { children: [
716
+ R && h && d && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 mt-3 py-3", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
717
+ s ? /* @__PURE__ */ r(bt, { children: [
718
718
  /* @__PURE__ */ e(yt, { asChild: !0, children: /* @__PURE__ */ r("div", { className: "flex", children: [
719
719
  /* @__PURE__ */ e(
720
- ye,
720
+ Ce,
721
721
  {
722
722
  size: "sm",
723
723
  variant: "outline",
724
- className: m(
724
+ className: g(
725
725
  "rounded-r-none gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
726
726
  S && "!bg-green-700 !text-white hover:!bg-green-700"
727
727
  ),
728
728
  onClick: (M) => {
729
729
  M.stopPropagation(), S || h(t);
730
730
  },
731
- disabled: E,
732
- children: E ? /* @__PURE__ */ e(De, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(pe, { children: [
731
+ disabled: T,
732
+ children: T ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(we, { children: [
733
733
  S && /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5" }),
734
734
  n.going
735
735
  ] })
736
736
  }
737
737
  ),
738
738
  /* @__PURE__ */ e(
739
- ye,
739
+ Ce,
740
740
  {
741
741
  size: "sm",
742
742
  variant: "outline",
743
- className: m(
743
+ className: g(
744
744
  "rounded-l-none px-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
745
745
  S && "!bg-green-700 !text-white hover:!bg-green-700"
746
746
  ),
@@ -752,7 +752,7 @@ function Ge({
752
752
  /* @__PURE__ */ r(
753
753
  Ue,
754
754
  {
755
- className: m(
755
+ className: g(
756
756
  "gap-1.5 h-8 !border-none !bg-green-50 text-green-800 hover:!bg-green-100",
757
757
  S && "!bg-green-700 !text-white hover:!bg-green-700"
758
758
  ),
@@ -769,73 +769,73 @@ function Ge({
769
769
  ] })
770
770
  ] })
771
771
  ] }) : /* @__PURE__ */ e(
772
- ye,
772
+ Ce,
773
773
  {
774
774
  size: "sm",
775
775
  variant: "outline",
776
- className: m(
776
+ className: g(
777
777
  "gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
778
778
  S && "!bg-green-700 !text-white hover:!bg-green-700"
779
779
  ),
780
780
  onClick: () => {
781
781
  S || h(t);
782
782
  },
783
- disabled: E,
784
- children: E ? /* @__PURE__ */ e(De, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(pe, { children: [
783
+ disabled: T,
784
+ children: T ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(we, { children: [
785
785
  S && /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5" }),
786
786
  n.going
787
787
  ] })
788
788
  }
789
789
  ),
790
790
  /* @__PURE__ */ e(
791
- ye,
791
+ Ce,
792
792
  {
793
793
  size: "sm",
794
794
  variant: "outline",
795
- className: m(
795
+ className: g(
796
796
  "gap-1.5 h-8 !border-none !bg-rose-100 text-rose-800 hover:!bg-rose-200",
797
- re && "!bg-rose-700 !text-white hover:!bg-rose-700"
797
+ Y && "!bg-rose-700 !text-white hover:!bg-rose-700"
798
798
  ),
799
799
  onClick: () => {
800
- re || d(t);
800
+ Y || d(t);
801
801
  },
802
802
  disabled: y,
803
- children: y ? /* @__PURE__ */ e(De, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(pe, { children: [
804
- re && /* @__PURE__ */ e(je, { className: "h-3.5 w-3.5" }),
803
+ children: y ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(we, { children: [
804
+ Y && /* @__PURE__ */ e(je, { className: "h-3.5 w-3.5" }),
805
805
  n.notGoing
806
806
  ] })
807
807
  }
808
808
  )
809
809
  ] }) }),
810
- F && S && !t.meetingTookPlace && !t.isCanceled && w && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 py-3", children: /* @__PURE__ */ r(
811
- ye,
810
+ $ && S && !t.meetingTookPlace && !t.isCanceled && v && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 py-3", children: /* @__PURE__ */ r(
811
+ Ce,
812
812
  {
813
813
  size: "sm",
814
814
  variant: "outline",
815
815
  className: "w-full h-9 hover:!bg-green-100 hover:text-green-700 text-green-700 !bg-green-100 !border-none dark:text-green-400 dark:hover:bg-green-950/30",
816
- onClick: () => w(t),
817
- disabled: A,
816
+ onClick: () => v(t),
817
+ disabled: z,
818
818
  children: [
819
- A && /* @__PURE__ */ e(De, { className: "h-4 w-4 mr-2" }),
819
+ z && /* @__PURE__ */ e(Me, { className: "h-4 w-4 mr-2" }),
820
820
  n.confirmMeeting
821
821
  ]
822
822
  }
823
823
  ) })
824
824
  ] }),
825
- z ? K && z({
826
- onConfirm: p,
827
- onCancel: () => Y(!1),
825
+ E ? J && E({
826
+ onConfirm: f,
827
+ onCancel: () => G(!1),
828
828
  isLoading: O
829
829
  }) : /* @__PURE__ */ e(
830
830
  qt,
831
831
  {
832
- open: K,
833
- onOpenChange: Y,
832
+ open: J,
833
+ onOpenChange: G,
834
834
  title: n.deleteConfirmTitle,
835
835
  description: n.deleteConfirmDescription,
836
836
  cancelLabel: n.cancel,
837
837
  confirmLabel: n.delete,
838
- onConfirm: p,
838
+ onConfirm: f,
839
839
  isLoading: O
840
840
  }
841
841
  )
@@ -845,88 +845,88 @@ function Nr({
845
845
  event: t,
846
846
  children: n,
847
847
  open: o,
848
- onOpenChange: s,
849
- isLoading: a,
850
- labels: i,
851
- onEdit: f,
848
+ onOpenChange: a,
849
+ isLoading: i,
850
+ labels: l,
851
+ onEdit: p,
852
852
  onDelete: h,
853
853
  onCancel: d,
854
- onAccept: w,
855
- onDecline: k,
856
- onConfirmMeeting: b,
857
- canEdit: I = !0,
858
- canDelete: F = !1,
854
+ onAccept: v,
855
+ onDecline: b,
856
+ onConfirmMeeting: w,
857
+ canEdit: A = !0,
858
+ canDelete: $ = !1,
859
859
  canCancel: P = !0,
860
860
  isCurrentUserParticipant: W,
861
- isCurrentUserClient: E,
861
+ isCurrentUserClient: T,
862
862
  currentUserAcceptStatus: y,
863
- isAcceptLoading: A,
863
+ isAcceptLoading: z,
864
864
  isDeclineLoading: O,
865
- isConfirmLoading: R,
866
- isDeleteLoading: C,
867
- renderParticipant: _,
868
- renderHeaderActions: z,
869
- renderCancelReason: j,
865
+ isConfirmLoading: _,
866
+ isDeleteLoading: D,
867
+ renderParticipant: K,
868
+ renderHeaderActions: E,
869
+ renderCancelReason: H,
870
870
  renderDeleteConfirmation: V,
871
- formatDate: K,
872
- formatTimeRange: Y,
873
- className: x,
874
- width: c = 360
871
+ formatDate: J,
872
+ formatTimeRange: G,
873
+ className: B,
874
+ width: s = 360
875
875
  }) {
876
- const g = en("(min-width: 768px)"), L = { ...Kt, ...i }, B = $(() => {
877
- s?.(!1);
878
- }, [s]), S = {
876
+ const m = en("(min-width: 768px)"), N = { ...Kt, ...l }, L = F(() => {
877
+ a?.(!1);
878
+ }, [a]), S = {
879
879
  event: t,
880
- labels: L,
881
- isLoading: a,
882
- onClose: B,
883
- onEdit: f,
880
+ labels: N,
881
+ isLoading: i,
882
+ onClose: L,
883
+ onEdit: p,
884
884
  onDelete: h,
885
885
  onCancel: d,
886
- onAccept: w,
887
- onDecline: k,
888
- onConfirmMeeting: b,
889
- canEdit: I,
890
- canDelete: F,
886
+ onAccept: v,
887
+ onDecline: b,
888
+ onConfirmMeeting: w,
889
+ canEdit: A,
890
+ canDelete: $,
891
891
  canCancel: P,
892
892
  isCurrentUserParticipant: W,
893
- isCurrentUserClient: E,
893
+ isCurrentUserClient: T,
894
894
  currentUserAcceptStatus: y,
895
- isAcceptLoading: A,
895
+ isAcceptLoading: z,
896
896
  isDeclineLoading: O,
897
- isConfirmLoading: R,
898
- isDeleteLoading: C,
899
- renderParticipant: _,
900
- renderHeaderActions: z,
901
- renderCancelReason: j,
897
+ isConfirmLoading: _,
898
+ isDeleteLoading: D,
899
+ renderParticipant: K,
900
+ renderHeaderActions: E,
901
+ renderCancelReason: H,
902
902
  renderDeleteConfirmation: V,
903
- formatDate: K,
904
- formatTimeRange: Y
903
+ formatDate: J,
904
+ formatTimeRange: G
905
905
  };
906
- return g ? /* @__PURE__ */ r(lt, { open: o ?? !1, onOpenChange: s ?? (() => {
906
+ return m ? /* @__PURE__ */ r(lt, { open: o ?? !1, onOpenChange: a ?? (() => {
907
907
  }), children: [
908
908
  /* @__PURE__ */ e(ct, { asChild: !0, children: n }),
909
909
  /* @__PURE__ */ e(
910
910
  dt,
911
911
  {
912
- className: m(
912
+ className: g(
913
913
  "p-0 shadow-lg !rounded-2xl bg-white dark:bg-zinc-900 overflow-hidden border z-50",
914
- x
914
+ B
915
915
  ),
916
- style: { width: c },
916
+ style: { width: s },
917
917
  align: "center",
918
918
  side: "bottom",
919
919
  sideOffset: 4,
920
920
  children: /* @__PURE__ */ e(Ge, { ...S })
921
921
  }
922
922
  )
923
- ] }) : /* @__PURE__ */ r(pe, { children: [
923
+ ] }) : /* @__PURE__ */ r(we, { children: [
924
924
  n,
925
925
  /* @__PURE__ */ e(
926
926
  Jt,
927
927
  {
928
928
  open: o ?? !1,
929
- onOpenChange: s ?? (() => {
929
+ onOpenChange: a ?? (() => {
930
930
  }),
931
931
  title: t.title,
932
932
  children: /* @__PURE__ */ e(Ge, { ...S })
@@ -934,26 +934,26 @@ function Nr({
934
934
  )
935
935
  ] });
936
936
  }
937
- const We = 44, Je = 4, tn = 56, qe = 8, Ie = 80, Ee = 140, Xe = 100, Qe = 2, nn = 8, rn = 18;
937
+ const We = 44, Je = 4, tn = 56, qe = 8, ze = 80, Ee = 140, Xe = 100, Qe = 2, nn = 8, rn = 18;
938
938
  function on(t) {
939
939
  return t.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2);
940
940
  }
941
941
  function sn(t, n) {
942
942
  const o = [];
943
- for (let s = 0; s < n; s++) {
944
- const a = new Date(t);
945
- a.setDate(a.getDate() + s), o.push(a);
943
+ for (let a = 0; a < n; a++) {
944
+ const i = new Date(t);
945
+ i.setDate(i.getDate() + a), o.push(i);
946
946
  }
947
947
  return o;
948
948
  }
949
949
  function an(t, n, o) {
950
- const s = [];
951
- return t.forEach((a, i) => {
952
- for (let f = n; f < o; f++)
953
- s.push({ hour: f, dayIndex: i, date: a });
954
- }), s;
950
+ const a = [];
951
+ return t.forEach((i, l) => {
952
+ for (let p = n; p < o; p++)
953
+ a.push({ hour: p, dayIndex: l, date: i });
954
+ }), a;
955
955
  }
956
- function $e(t) {
956
+ function Fe(t) {
957
957
  return `${t.toString().padStart(2, "0")}:00`;
958
958
  }
959
959
  function ln(t) {
@@ -964,25 +964,25 @@ function ln(t) {
964
964
  });
965
965
  }
966
966
  function Ze(t) {
967
- const n = [...t].sort((a, i) => a.startCol !== i.startCol ? a.startCol - i.startCol : i.spanCols - a.spanCols), o = [], s = [];
968
- for (const a of n) {
969
- let i = 0;
970
- for (; s[i] !== void 0 && s[i] > a.startCol; )
971
- i++;
972
- s[i] = a.startCol + a.spanCols, o.push({
973
- ...a,
974
- stackIndex: i
967
+ const n = [...t].sort((i, l) => i.startCol !== l.startCol ? i.startCol - l.startCol : l.spanCols - i.spanCols), o = [], a = [];
968
+ for (const i of n) {
969
+ let l = 0;
970
+ for (; a[l] !== void 0 && a[l] > i.startCol; )
971
+ l++;
972
+ a[l] = i.startCol + i.spanCols, o.push({
973
+ ...i,
974
+ stackIndex: l
975
975
  });
976
976
  }
977
977
  return o;
978
978
  }
979
- function cn({ src: t, alt: n, fallback: o, className: s }) {
979
+ function cn({ src: t, alt: n, fallback: o, className: a }) {
980
980
  return /* @__PURE__ */ e(
981
981
  "div",
982
982
  {
983
- className: m(
983
+ className: g(
984
984
  "relative flex shrink-0 overflow-hidden rounded-sm border bg-muted",
985
- s
985
+ a
986
986
  ),
987
987
  children: t ? /* @__PURE__ */ e(
988
988
  "img",
@@ -1000,97 +1000,97 @@ function Le({
1000
1000
  daysToShow: t = dn,
1001
1001
  events: n,
1002
1002
  users: o = [],
1003
- selectedDate: s,
1004
- onDateChange: a,
1005
- onEventClick: i,
1006
- onSlotClick: f,
1003
+ selectedDate: a,
1004
+ onDateChange: i,
1005
+ onEventClick: l,
1006
+ onSlotClick: p,
1007
1007
  onSlotSelect: h,
1008
1008
  visibleHours: d,
1009
- className: w,
1010
- getEventUserId: k,
1011
- renderPopover: b,
1012
- slots: I,
1013
- classNames: F,
1009
+ className: v,
1010
+ getEventUserId: b,
1011
+ renderPopover: w,
1012
+ slots: A,
1013
+ classNames: $,
1014
1014
  enableDrag: P = !0
1015
1015
  }) {
1016
- const W = ae(null), E = Lt(), [y, A] = oe(null), O = ae(!1), [R, C] = oe(null), _ = s ?? /* @__PURE__ */ new Date(), z = !0, j = d?.from ?? nn, V = d?.to ?? rn, K = V - j, Y = X(() => {
1017
- const l = new Date(_);
1016
+ const W = ae(null), T = Lt(), [y, z] = ie(null), O = ae(!1), [_, D] = ie(null), K = a ?? /* @__PURE__ */ new Date(), E = !0, H = d?.from ?? nn, V = d?.to ?? rn, J = V - H, G = Q(() => {
1017
+ const c = new Date(K);
1018
1018
  if (t === 1 || t === 3)
1019
- return l.setHours(0, 0, 0, 0), l;
1020
- const u = l.getDay(), v = u === 0 ? -6 : 1 - u;
1021
- return l.setDate(l.getDate() + v), l.setHours(0, 0, 0, 0), l;
1022
- }, [_, t]), x = X(
1023
- () => sn(Y, t),
1024
- [Y, t]
1025
- ), c = X(
1026
- () => an(x, j, V),
1027
- [z, x, j, V]
1028
- ), L = k ?? ((l) => {
1029
- if (l.resourceId) return l.resourceId;
1030
- const u = l.data;
1019
+ return c.setHours(0, 0, 0, 0), c;
1020
+ const u = c.getDay(), x = u === 0 ? -6 : 1 - u;
1021
+ return c.setDate(c.getDate() + x), c.setHours(0, 0, 0, 0), c;
1022
+ }, [K, t]), B = Q(
1023
+ () => sn(G, t),
1024
+ [G, t]
1025
+ ), s = Q(
1026
+ () => an(B, H, V),
1027
+ [E, B, H, V]
1028
+ ), N = b ?? ((c) => {
1029
+ if (c.resourceId) return c.resourceId;
1030
+ const u = c.data;
1031
1031
  if (u?.userId) return String(u.userId);
1032
1032
  if (u?.user && typeof u.user == "object" && u.user.id)
1033
1033
  return String(u.user.id);
1034
- if (l.user?.id) return l.user.id;
1035
- if (l.participants?.[0]?.id) return l.participants[0].id;
1036
- }), B = X(() => {
1037
- const l = /* @__PURE__ */ new Map();
1034
+ if (c.user?.id) return c.user.id;
1035
+ if (c.participants?.[0]?.id) return c.participants[0].id;
1036
+ }), L = Q(() => {
1037
+ const c = /* @__PURE__ */ new Map();
1038
1038
  for (const u of o)
1039
- l.set(u.id, {
1039
+ c.set(u.id, {
1040
1040
  id: u.id,
1041
1041
  name: u.name,
1042
1042
  avatar: u.avatar ?? void 0,
1043
1043
  email: u.email
1044
1044
  });
1045
1045
  for (const u of n) {
1046
- const N = u.data?.user;
1047
- N?.id && !l.has(N.id) && l.set(N.id, {
1048
- id: N.id,
1049
- name: N.name ?? "",
1050
- avatar: N.avatar ?? void 0,
1051
- email: N.email
1052
- }), u.user?.id && !l.has(u.user.id) && l.set(u.user.id, {
1046
+ const k = u.data?.user;
1047
+ k?.id && !c.has(k.id) && c.set(k.id, {
1048
+ id: k.id,
1049
+ name: k.name ?? "",
1050
+ avatar: k.avatar ?? void 0,
1051
+ email: k.email
1052
+ }), u.user?.id && !c.has(u.user.id) && c.set(u.user.id, {
1053
1053
  id: u.user.id,
1054
1054
  name: u.user.name,
1055
1055
  avatar: u.user.avatar ?? void 0,
1056
1056
  email: u.user.email
1057
1057
  });
1058
- for (const D of u.participants || [])
1059
- D.id && !l.has(D.id) && l.set(D.id, {
1060
- id: D.id,
1061
- name: D.name,
1062
- avatar: D.avatar ?? void 0,
1063
- email: D.email
1058
+ for (const C of u.participants || [])
1059
+ C.id && !c.has(C.id) && c.set(C.id, {
1060
+ id: C.id,
1061
+ name: C.name,
1062
+ avatar: C.avatar ?? void 0,
1063
+ email: C.email
1064
1064
  });
1065
1065
  }
1066
- return Array.from(l.values());
1067
- }, [o, n]), S = X(() => {
1068
- const l = [], u = /* @__PURE__ */ new Map();
1069
- for (const D of B)
1070
- u.set(D.id, []);
1066
+ return Array.from(c.values());
1067
+ }, [o, n]), S = Q(() => {
1068
+ const c = [], u = /* @__PURE__ */ new Map();
1069
+ for (const C of L)
1070
+ u.set(C.id, []);
1071
1071
  u.set("unassigned", []);
1072
- for (const D of n) {
1073
- const T = L(D) ?? "unassigned";
1074
- (u.get(T) ?? u.get("unassigned")).push(D);
1072
+ for (const C of n) {
1073
+ const I = N(C) ?? "unassigned";
1074
+ (u.get(I) ?? u.get("unassigned")).push(C);
1075
1075
  }
1076
- const v = (D) => {
1077
- const T = [];
1078
- for (const H of D) {
1079
- const J = H.startDate.getHours() + H.startDate.getMinutes() / 60, Z = H.endDate.getHours() + H.endDate.getMinutes() / 60;
1080
- for (let q = 0; q < x.length; q++) {
1081
- const ne = x[q], ve = Pe(ne), we = ut(ne);
1082
- if (H.startDate <= we && H.endDate >= ve) {
1083
- let be = j, Se = V;
1084
- if (H.startDate >= ve && (be = Math.max(j, J)), H.endDate <= we && (Se = Math.min(V, Z)), be = Math.max(
1085
- j,
1086
- Math.min(V, be)
1076
+ const x = (C) => {
1077
+ const I = [];
1078
+ for (const j of C) {
1079
+ const q = j.startDate.getHours() + j.startDate.getMinutes() / 60, te = j.endDate.getHours() + j.endDate.getMinutes() / 60;
1080
+ for (let X = 0; X < B.length; X++) {
1081
+ const oe = B[X], ye = Pe(oe), ke = ut(oe);
1082
+ if (j.startDate <= ke && j.endDate >= ye) {
1083
+ let Ne = H, Se = V;
1084
+ if (j.startDate >= ye && (Ne = Math.max(H, q)), j.endDate <= ke && (Se = Math.min(V, te)), Ne = Math.max(
1085
+ H,
1086
+ Math.min(V, Ne)
1087
1087
  ), Se = Math.max(
1088
- j,
1088
+ H,
1089
1089
  Math.min(V, Se)
1090
- ), Se > be) {
1091
- const Re = q * K + Math.floor(be - j), gt = q * K + Math.ceil(Se - j);
1092
- T.push({
1093
- event: H,
1090
+ ), Se > Ne) {
1091
+ const Re = X * J + Math.floor(Ne - H), gt = X * J + Math.ceil(Se - H);
1092
+ I.push({
1093
+ event: j,
1094
1094
  startCol: Re,
1095
1095
  spanCols: Math.max(1, gt - Re)
1096
1096
  });
@@ -1098,105 +1098,105 @@ function Le({
1098
1098
  }
1099
1099
  }
1100
1100
  }
1101
- return T;
1101
+ return I;
1102
1102
  };
1103
- for (const D of B) {
1104
- const T = u.get(D.id) ?? [], H = v(T), J = Ze(H), Z = J.reduce(
1105
- (q, ne) => Math.max(q, ne.stackIndex + 1),
1103
+ for (const C of L) {
1104
+ const I = u.get(C.id) ?? [], j = x(I), q = Ze(j), te = q.reduce(
1105
+ (X, oe) => Math.max(X, oe.stackIndex + 1),
1106
1106
  0
1107
1107
  );
1108
- l.push({
1109
- user: D,
1110
- events: J,
1111
- maxStack: Math.max(Z, 1)
1108
+ c.push({
1109
+ user: C,
1110
+ events: q,
1111
+ maxStack: Math.max(te, 1)
1112
1112
  });
1113
1113
  }
1114
- const N = u.get("unassigned") ?? [];
1115
- if (N.length > 0) {
1116
- const D = v(N), T = Ze(D), H = T.reduce(
1117
- (J, Z) => Math.max(J, Z.stackIndex + 1),
1114
+ const k = u.get("unassigned") ?? [];
1115
+ if (k.length > 0) {
1116
+ const C = x(k), I = Ze(C), j = I.reduce(
1117
+ (q, te) => Math.max(q, te.stackIndex + 1),
1118
1118
  0
1119
1119
  );
1120
- l.push({
1120
+ c.push({
1121
1121
  user: {
1122
1122
  id: "unassigned",
1123
1123
  name: "Unassigned",
1124
1124
  avatar: void 0,
1125
1125
  email: void 0
1126
1126
  },
1127
- events: T,
1128
- maxStack: Math.max(H, 1)
1127
+ events: I,
1128
+ maxStack: Math.max(j, 1)
1129
1129
  });
1130
1130
  }
1131
- return l.filter((D) => D.events.length > 0);
1131
+ return c.filter((C) => C.events.length > 0);
1132
1132
  }, [
1133
- B,
1133
+ L,
1134
1134
  n,
1135
- x,
1136
- z,
1137
- K,
1138
- j,
1135
+ B,
1136
+ E,
1137
+ J,
1138
+ H,
1139
1139
  V,
1140
- L
1141
- ]), re = X(() => {
1142
- const l = /* @__PURE__ */ new Map();
1140
+ N
1141
+ ]), Y = Q(() => {
1142
+ const c = /* @__PURE__ */ new Map();
1143
1143
  for (const u of S)
1144
- for (const v of u.events)
1145
- if (v.spanCols === 1) {
1146
- const N = l.get(v.startCol) ?? 0;
1147
- l.set(v.startCol, N + 1);
1144
+ for (const x of u.events)
1145
+ if (x.spanCols === 1) {
1146
+ const k = c.get(x.startCol) ?? 0;
1147
+ c.set(x.startCol, k + 1);
1148
1148
  }
1149
- return l;
1150
- }, [S]), G = X(() => {
1151
- const l = c.length, u = Ie, v = [];
1152
- for (let N = 0; N < l; N++) {
1153
- const D = re.get(N) ?? 0;
1154
- D > Qe ? v.push(
1155
- Xe + (D - Qe) * 20
1156
- ) : D > 0 ? v.push(Math.max(u, Xe)) : v.push(u);
1149
+ return c;
1150
+ }, [S]), R = Q(() => {
1151
+ const c = s.length, u = ze, x = [];
1152
+ for (let k = 0; k < c; k++) {
1153
+ const C = Y.get(k) ?? 0;
1154
+ C > Qe ? x.push(
1155
+ Xe + (C - Qe) * 20
1156
+ ) : C > 0 ? x.push(Math.max(u, Xe)) : x.push(u);
1157
1157
  }
1158
- return v;
1158
+ return x;
1159
1159
  }, [
1160
- z,
1161
- c.length,
1162
- x.length,
1163
- re
1164
- ]), Ce = (l) => Math.max(
1160
+ E,
1161
+ s.length,
1162
+ B.length,
1163
+ Y
1164
+ ]), se = (c) => Math.max(
1165
1165
  tn,
1166
- l * (We + Je) + qe * 2
1167
- ), ee = Ee + G.reduce((l, u) => l + u, 0), Q = X(() => {
1168
- const l = [0];
1169
- for (let u = 0; u < G.length; u++)
1170
- l.push(l[u] + G[u]);
1171
- return l;
1172
- }, [G]);
1166
+ c * (We + Je) + qe * 2
1167
+ ), ee = Ee + R.reduce((c, u) => c + u, 0), Z = Q(() => {
1168
+ const c = [0];
1169
+ for (let u = 0; u < R.length; u++)
1170
+ c.push(c[u] + R[u]);
1171
+ return c;
1172
+ }, [R]);
1173
1173
  vt(() => {
1174
- const l = W.current;
1175
- if (!l) return;
1174
+ const c = W.current;
1175
+ if (!c) return;
1176
1176
  const u = () => {
1177
- let v = -1;
1178
- const D = (/* @__PURE__ */ new Date()).getHours();
1177
+ let x = -1;
1178
+ const C = (/* @__PURE__ */ new Date()).getHours();
1179
1179
  {
1180
- for (let T = 0; T < c.length; T++) {
1181
- const H = c[T];
1182
- if (H && ie(H.date) && H.hour <= D && H.hour + 1 > D) {
1183
- v = T;
1180
+ for (let I = 0; I < s.length; I++) {
1181
+ const j = s[I];
1182
+ if (j && ce(j.date) && j.hour <= C && j.hour + 1 > C) {
1183
+ x = I;
1184
1184
  break;
1185
1185
  }
1186
1186
  }
1187
- if (v === -1)
1188
- for (let T = 0; T < c.length; T++) {
1189
- const H = c[T];
1190
- if (H && ie(H.date)) {
1191
- v = T;
1187
+ if (x === -1)
1188
+ for (let I = 0; I < s.length; I++) {
1189
+ const j = s[I];
1190
+ if (j && ce(j.date)) {
1191
+ x = I;
1192
1192
  break;
1193
1193
  }
1194
1194
  }
1195
1195
  }
1196
- if (v !== -1) {
1197
- const T = (Q[v] ?? 0) + Ee, H = l.clientWidth, J = Math.max(0, T - H / 3);
1198
- l.scrollTo({
1199
- left: J,
1196
+ if (x !== -1) {
1197
+ const I = (Z[x] ?? 0) + Ee, j = c.clientWidth, q = Math.max(0, I - j / 3);
1198
+ c.scrollTo({
1199
+ left: q,
1200
1200
  behavior: "instant"
1201
1201
  });
1202
1202
  }
@@ -1204,104 +1204,104 @@ function Le({
1204
1204
  requestAnimationFrame(() => {
1205
1205
  requestAnimationFrame(u);
1206
1206
  });
1207
- }, [_, c, x, Q, z]);
1208
- const ke = $(
1209
- (l, u) => {
1210
- const v = u.getBoundingClientRect(), N = l - v.left + u.scrollLeft;
1211
- for (let D = 0; D < Q.length - 1; D++) {
1212
- const T = Q[D], H = Q[D + 1];
1213
- if (N >= T && N < H) {
1214
- const J = (N - T) / (H - T), Z = Math.floor(J * 60), q = Math.round(Z / 15) * 15;
1215
- return { colIndex: D, minute: Math.min(q, 45) };
1207
+ }, [K, s, B, Z, E]);
1208
+ const ve = F(
1209
+ (c, u) => {
1210
+ const x = u.getBoundingClientRect(), k = c - x.left + u.scrollLeft;
1211
+ for (let C = 0; C < Z.length - 1; C++) {
1212
+ const I = Z[C], j = Z[C + 1];
1213
+ if (k >= I && k < j) {
1214
+ const q = (k - I) / (j - I), te = Math.floor(q * 60), X = Math.round(te / 15) * 15;
1215
+ return { colIndex: C, minute: Math.min(X, 45) };
1216
1216
  }
1217
1217
  }
1218
1218
  return null;
1219
1219
  },
1220
- [Q]
1221
- ), se = $(
1222
- (l, u) => {
1223
- if (c[l]) {
1224
- const v = c[l], N = new Date(v.date);
1225
- return N.setHours(v.hour, u ?? 0, 0, 0), { date: N, hour: v.hour };
1220
+ [Z]
1221
+ ), ne = F(
1222
+ (c, u) => {
1223
+ if (s[c]) {
1224
+ const x = s[c], k = new Date(x.date);
1225
+ return k.setHours(x.hour, u ?? 0, 0, 0), { date: k, hour: x.hour };
1226
1226
  }
1227
1227
  return { date: /* @__PURE__ */ new Date() };
1228
1228
  },
1229
- [z, c, x]
1230
- ), le = $(
1231
- (l, u) => {
1232
- if (l.preventDefault(), l.dataTransfer.dropEffect = "move", !E?.isDragging || !E.dragState) return;
1233
- const v = l.currentTarget, N = ke(l.clientX, v);
1234
- if (!N) return;
1235
- const { colIndex: D, minute: T } = N, { date: H, hour: J } = se(D, T);
1236
- E.updateDragPreview(H, J, T, u);
1237
- const { originalStartDate: Z, originalEndDate: q } = E.dragState, ne = q.getTime() - Z.getTime(), ve = c.length;
1238
- let we;
1229
+ [E, s, B]
1230
+ ), le = F(
1231
+ (c, u) => {
1232
+ if (c.preventDefault(), c.dataTransfer.dropEffect = "move", !T?.isDragging || !T.dragState) return;
1233
+ const x = c.currentTarget, k = ve(c.clientX, x);
1234
+ if (!k) return;
1235
+ const { colIndex: C, minute: I } = k, { date: j, hour: q } = ne(C, I);
1236
+ T.updateDragPreview(j, q, I, u);
1237
+ const { originalStartDate: te, originalEndDate: X } = T.dragState, oe = X.getTime() - te.getTime(), ye = s.length;
1238
+ let ke;
1239
1239
  {
1240
- const be = ne / 36e5;
1241
- we = Math.max(1, Math.ceil(be));
1240
+ const Ne = oe / 36e5;
1241
+ ke = Math.max(1, Math.ceil(Ne));
1242
1242
  }
1243
- we = Math.min(we, ve - D), C({ resourceId: u, colIndex: D, spanCols: we });
1243
+ ke = Math.min(ke, ye - C), D({ resourceId: u, colIndex: C, spanCols: ke });
1244
1244
  },
1245
- [E, ke, se, z, c.length, x.length]
1246
- ), Me = $(
1247
- (l) => {
1248
- const u = l.relatedTarget;
1249
- l.currentTarget.contains(u) || C(null);
1245
+ [T, ve, ne, E, s.length, B.length]
1246
+ ), be = F(
1247
+ (c) => {
1248
+ const u = c.relatedTarget;
1249
+ c.currentTarget.contains(u) || D(null);
1250
1250
  },
1251
1251
  []
1252
- ), xe = $(
1253
- (l, u) => {
1254
- l.preventDefault(), C(null), E?.isDragging && E.endDrag();
1252
+ ), ue = F(
1253
+ (c, u) => {
1254
+ c.preventDefault(), D(null), T?.isDragging && T.endDrag();
1255
1255
  },
1256
- [E]
1257
- ), p = $(
1258
- (l, u) => {
1259
- if (!y || y.resourceId !== l) return !1;
1260
- const v = Math.min(y.startCol, y.endCol), N = Math.max(y.startCol, y.endCol);
1261
- return u >= v && u <= N;
1256
+ [T]
1257
+ ), f = F(
1258
+ (c, u) => {
1259
+ if (!y || y.resourceId !== c) return !1;
1260
+ const x = Math.min(y.startCol, y.endCol), k = Math.max(y.startCol, y.endCol);
1261
+ return u >= x && u <= k;
1262
1262
  },
1263
1263
  [y]
1264
- ), M = $(
1265
- (l, u) => !R || R.resourceId !== l ? !1 : u >= R.colIndex && u < R.colIndex + R.spanCols,
1266
- [R]
1267
- ), U = $(
1268
- (l, u, v) => {
1269
- v.button !== 0 && v.pointerType === "mouse" || (h || f) && (v.preventDefault(), O.current = !0, A({ resourceId: l, startCol: u, endCol: u, isSelecting: !0 }));
1264
+ ), M = F(
1265
+ (c, u) => !_ || _.resourceId !== c ? !1 : u >= _.colIndex && u < _.colIndex + _.spanCols,
1266
+ [_]
1267
+ ), U = F(
1268
+ (c, u, x) => {
1269
+ x.button !== 0 && x.pointerType === "mouse" || (h || p) && (x.preventDefault(), O.current = !0, z({ resourceId: c, startCol: u, endCol: u, isSelecting: !0 }));
1270
1270
  },
1271
- [h, f]
1272
- ), te = $(
1273
- (l, u, v) => {
1274
- if (O.current && !(!y || y.resourceId !== l)) {
1275
- if (v.buttons === 0) {
1271
+ [h, p]
1272
+ ), re = F(
1273
+ (c, u, x) => {
1274
+ if (O.current && !(!y || y.resourceId !== c)) {
1275
+ if (x.buttons === 0) {
1276
1276
  O.current = !1;
1277
1277
  return;
1278
1278
  }
1279
- A((N) => N ? { ...N, endCol: u } : null);
1279
+ z((k) => k ? { ...k, endCol: u } : null);
1280
1280
  }
1281
1281
  },
1282
1282
  [y]
1283
- ), Ne = $(() => {
1283
+ ), De = F(() => {
1284
1284
  if (!O.current || !y) return;
1285
1285
  O.current = !1;
1286
- const l = Math.min(y.startCol, y.endCol), u = Math.max(y.startCol, y.endCol), v = se(l), N = se(u), D = new Date(v.date), T = new Date(N.date);
1287
- N.hour !== void 0 && T.setHours(N.hour + 1, 0, 0, 0);
1288
- const H = {
1289
- startDate: D,
1290
- endDate: T,
1286
+ const c = Math.min(y.startCol, y.endCol), u = Math.max(y.startCol, y.endCol), x = ne(c), k = ne(u), C = new Date(x.date), I = new Date(k.date);
1287
+ k.hour !== void 0 && I.setHours(k.hour + 1, 0, 0, 0);
1288
+ const j = {
1289
+ startDate: C,
1290
+ endDate: I,
1291
1291
  resourceId: y.resourceId
1292
1292
  };
1293
- l === u && f && f(v.date, v.hour, y.resourceId), h?.(H), A((J) => J ? { ...J, isSelecting: !1 } : null), setTimeout(() => A(null), 150);
1294
- }, [y, se, z, f, h]);
1295
- return ce(() => {
1296
- const l = () => {
1297
- O.current && Ne();
1293
+ c === u && p && p(x.date, x.hour, y.resourceId), h?.(j), z((q) => q ? { ...q, isSelecting: !1 } : null), setTimeout(() => z(null), 150);
1294
+ }, [y, ne, E, p, h]);
1295
+ return de(() => {
1296
+ const c = () => {
1297
+ O.current && De();
1298
1298
  };
1299
- return window.addEventListener("pointerup", l), window.addEventListener("pointercancel", l), () => {
1300
- window.removeEventListener("pointerup", l), window.removeEventListener("pointercancel", l);
1299
+ return window.addEventListener("pointerup", c), window.addEventListener("pointercancel", c), () => {
1300
+ window.removeEventListener("pointerup", c), window.removeEventListener("pointercancel", c);
1301
1301
  };
1302
- }, [Ne]), ce(() => {
1303
- E?.isDragging || C(null);
1304
- }, [E?.isDragging]), /* @__PURE__ */ e("div", { className: m("flex h-full flex-col", w), children: /* @__PURE__ */ e("div", { className: "ic-timeline-scroll-container flex-1", ref: W, children: /* @__PURE__ */ r("div", { className: "relative", style: { minWidth: ee }, children: [
1302
+ }, [De]), de(() => {
1303
+ T?.isDragging || D(null);
1304
+ }, [T?.isDragging]), /* @__PURE__ */ e("div", { className: g("flex h-full flex-col", v), children: /* @__PURE__ */ e("div", { className: "ic-timeline-scroll-container flex-1", ref: W, children: /* @__PURE__ */ r("div", { className: "relative", style: { minWidth: ee }, children: [
1305
1305
  // Hour mode: Day headers + Hour sub-headers - sticky wrapper with flex child (sticky + flex breaks sticky)
1306
1306
  /* @__PURE__ */ e("div", { className: "ic-timeline-header sticky top-0 z-20 border-b bg-background", children: t > 1 ? (
1307
1307
  // Multi-day: Resources cell spans both day-header + hour-header rows
@@ -1315,35 +1315,35 @@ function Le({
1315
1315
  }
1316
1316
  ),
1317
1317
  /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-col", children: [
1318
- /* @__PURE__ */ e("div", { className: "flex border-b", children: x.map((l, u) => {
1319
- const v = ie(l), N = u * K, D = G.slice(N, N + K).reduce((T, H) => T + H, 0);
1318
+ /* @__PURE__ */ e("div", { className: "flex border-b", children: B.map((c, u) => {
1319
+ const x = ce(c), k = u * J, C = R.slice(k, k + J).reduce((I, j) => I + j, 0);
1320
1320
  return /* @__PURE__ */ e(
1321
1321
  "div",
1322
1322
  {
1323
- className: m(
1323
+ className: g(
1324
1324
  "flex shrink-0 items-center justify-center border-r py-1.5 font-medium",
1325
- v ? "bg-primary/10 text-primary" : "bg-muted/30"
1325
+ x ? "bg-primary/10 text-primary" : "bg-muted/30"
1326
1326
  ),
1327
- style: { width: D },
1328
- children: /* @__PURE__ */ e("span", { className: "text-xs", children: ln(l) })
1327
+ style: { width: C },
1328
+ children: /* @__PURE__ */ e("span", { className: "text-xs", children: ln(c) })
1329
1329
  },
1330
- `day-${l.toISOString()}`
1330
+ `day-${c.toISOString()}`
1331
1331
  );
1332
1332
  }) }),
1333
- /* @__PURE__ */ e("div", { className: "flex", children: c.map((l, u) => {
1334
- const v = l.hour === j, N = ie(l.date), D = G[u] ?? Ie;
1333
+ /* @__PURE__ */ e("div", { className: "flex", children: s.map((c, u) => {
1334
+ const x = c.hour === H, k = ce(c.date), C = R[u] ?? ze;
1335
1335
  return /* @__PURE__ */ e(
1336
1336
  "div",
1337
1337
  {
1338
- className: m(
1338
+ className: g(
1339
1339
  "flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",
1340
- v && u > 0 ? "border-l-2 border-l-border" : "border-r border-r-border/50",
1341
- N && "bg-primary/5"
1340
+ x && u > 0 ? "border-l-2 border-l-border" : "border-r border-r-border/50",
1341
+ k && "bg-primary/5"
1342
1342
  ),
1343
- style: { width: D },
1344
- children: $e(l.hour)
1343
+ style: { width: C },
1344
+ children: Fe(c.hour)
1345
1345
  },
1346
- `hour-${l.dayIndex}-${l.hour}`
1346
+ `hour-${c.dayIndex}-${c.hour}`
1347
1347
  );
1348
1348
  }) })
1349
1349
  ] })
@@ -1359,32 +1359,32 @@ function Le({
1359
1359
  children: /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase text-muted-foreground", children: "Resources" })
1360
1360
  }
1361
1361
  ),
1362
- c.map((l, u) => {
1363
- const v = l.hour === j, N = ie(l.date), D = G[u] ?? Ie;
1362
+ s.map((c, u) => {
1363
+ const x = c.hour === H, k = ce(c.date), C = R[u] ?? ze;
1364
1364
  return /* @__PURE__ */ e(
1365
1365
  "div",
1366
1366
  {
1367
- className: m(
1367
+ className: g(
1368
1368
  "flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",
1369
- v && u > 0 ? "border-l-2 border-l-border" : "border-r border-r-border/50",
1370
- N && "bg-primary/5"
1369
+ x && u > 0 ? "border-l-2 border-l-border" : "border-r border-r-border/50",
1370
+ k && "bg-primary/5"
1371
1371
  ),
1372
- style: { width: D },
1373
- children: $e(l.hour)
1372
+ style: { width: C },
1373
+ children: Fe(c.hour)
1374
1374
  },
1375
- `hour-${l.dayIndex}-${l.hour}`
1375
+ `hour-${c.dayIndex}-${c.hour}`
1376
1376
  );
1377
1377
  })
1378
1378
  ] })
1379
1379
  ) }),
1380
- S.map((l) => {
1381
- const u = Ce(l.maxStack);
1380
+ S.map((c) => {
1381
+ const u = se(c.maxStack);
1382
1382
  return /* @__PURE__ */ r(
1383
1383
  "div",
1384
1384
  {
1385
- className: m(
1385
+ className: g(
1386
1386
  "relative flex border-b",
1387
- F?.resourceRow
1387
+ $?.resourceRow
1388
1388
  ),
1389
1389
  style: { height: u },
1390
1390
  children: [
@@ -1396,21 +1396,21 @@ function Le({
1396
1396
  children: /* @__PURE__ */ r(
1397
1397
  "div",
1398
1398
  {
1399
- className: m(
1399
+ className: g(
1400
1400
  "flex h-full items-center gap-2 sm:gap-3 border-r bg-background px-2 sm:px-4",
1401
- F?.resourceHeader
1401
+ $?.resourceHeader
1402
1402
  ),
1403
1403
  children: [
1404
1404
  /* @__PURE__ */ e(
1405
1405
  cn,
1406
1406
  {
1407
1407
  className: "size-7",
1408
- src: l.user.avatar,
1409
- alt: l.user.name,
1410
- fallback: on(l.user.name)
1408
+ src: c.user.avatar,
1409
+ alt: c.user.name,
1410
+ fallback: on(c.user.name)
1411
1411
  }
1412
1412
  ),
1413
- /* @__PURE__ */ e("span", { className: "truncate text-xs sm:text-sm font-medium", children: l.user.name })
1413
+ /* @__PURE__ */ e("span", { className: "truncate text-xs sm:text-sm font-medium", children: c.user.name })
1414
1414
  ]
1415
1415
  }
1416
1416
  )
@@ -1420,82 +1420,82 @@ function Le({
1420
1420
  "div",
1421
1421
  {
1422
1422
  className: "ic-timeline-grid relative flex",
1423
- onDragOver: (v) => le(v, l.user.id),
1424
- onDragLeave: Me,
1425
- onDrop: (v) => xe(v, l.user.id),
1423
+ onDragOver: (x) => le(x, c.user.id),
1424
+ onDragLeave: be,
1425
+ onDrop: (x) => ue(x, c.user.id),
1426
1426
  children: [
1427
1427
  // Hour mode cells — interactive buttons for slot selection
1428
- c.map((v, N) => {
1429
- const D = v.hour === j && N > 0, T = G[N] ?? Ie, H = p(l.user.id, N), J = M(l.user.id, N), Z = !!(h || f);
1428
+ s.map((x, k) => {
1429
+ const C = x.hour === H && k > 0, I = R[k] ?? ze, j = f(c.user.id, k), q = M(c.user.id, k), te = !!(h || p);
1430
1430
  return /* @__PURE__ */ e(
1431
1431
  "div",
1432
1432
  {
1433
- role: Z ? "button" : void 0,
1434
- tabIndex: Z ? 0 : void 0,
1435
- "aria-label": Z ? `Select ${$e(v.hour)} on ${v.date.toLocaleDateString()} for ${l.user.name}` : void 0,
1436
- onPointerDown: (q) => U(l.user.id, N, q),
1437
- onPointerEnter: (q) => te(l.user.id, N, q),
1438
- onPointerUp: Ne,
1439
- onKeyDown: (q) => {
1440
- if (Z && (q.key === "Enter" || q.key === " ")) {
1441
- q.preventDefault();
1442
- const ne = se(N);
1443
- f?.(ne.date, ne.hour, l.user.id), h?.({
1444
- startDate: ne.date,
1433
+ role: te ? "button" : void 0,
1434
+ tabIndex: te ? 0 : void 0,
1435
+ "aria-label": te ? `Select ${Fe(x.hour)} on ${x.date.toLocaleDateString()} for ${c.user.name}` : void 0,
1436
+ onPointerDown: (X) => U(c.user.id, k, X),
1437
+ onPointerEnter: (X) => re(c.user.id, k, X),
1438
+ onPointerUp: De,
1439
+ onKeyDown: (X) => {
1440
+ if (te && (X.key === "Enter" || X.key === " ")) {
1441
+ X.preventDefault();
1442
+ const oe = ne(k);
1443
+ p?.(oe.date, oe.hour, c.user.id), h?.({
1444
+ startDate: oe.date,
1445
1445
  endDate: (() => {
1446
- const ve = new Date(ne.date);
1447
- return ne.hour !== void 0 && ve.setHours(ne.hour + 1, 0, 0, 0), ve;
1446
+ const ye = new Date(oe.date);
1447
+ return oe.hour !== void 0 && ye.setHours(oe.hour + 1, 0, 0, 0), ye;
1448
1448
  })(),
1449
- resourceId: l.user.id
1449
+ resourceId: c.user.id
1450
1450
  });
1451
1451
  }
1452
1452
  },
1453
- className: m(
1453
+ className: g(
1454
1454
  "shrink-0 select-none touch-none transition-colors",
1455
- Z && "cursor-pointer",
1456
- D ? "border-l-2 border-l-border" : "border-r border-r-border/50",
1457
- ie(v.date) && "bg-primary/5",
1455
+ te && "cursor-pointer",
1456
+ C ? "border-l-2 border-l-border" : "border-r border-r-border/50",
1457
+ ce(x.date) && "bg-primary/5",
1458
1458
  // Hover — subtle feedback (only when not selecting or dragging)
1459
- Z && !y?.isSelecting && !E?.isDragging && "hover:bg-blue-50/60",
1459
+ te && !y?.isSelecting && !T?.isDragging && "hover:bg-blue-50/60",
1460
1460
  // Slot selection highlight
1461
- H && "bg-blue-100/70",
1461
+ j && "bg-blue-100/70",
1462
1462
  // Drop target highlight
1463
- J && "bg-primary/20 ring-2 ring-primary ring-inset"
1463
+ q && "bg-primary/20 ring-2 ring-primary ring-inset"
1464
1464
  ),
1465
- style: { width: T }
1465
+ style: { width: I }
1466
1466
  },
1467
- `cell-${v.dayIndex}-${v.hour}`
1467
+ `cell-${x.dayIndex}-${x.hour}`
1468
1468
  );
1469
1469
  }),
1470
- l.events.map((v) => {
1471
- const N = (Q[v.startCol] ?? 0) + 2, D = Q[v.startCol + v.spanCols] ?? Q[Q.length - 1] ?? 0, T = Q[v.startCol] ?? 0, H = D - T - 4, J = qe + v.stackIndex * (We + Je);
1470
+ c.events.map((x) => {
1471
+ const k = (Z[x.startCol] ?? 0) + 2, C = Z[x.startCol + x.spanCols] ?? Z[Z.length - 1] ?? 0, I = Z[x.startCol] ?? 0, j = C - I - 4, q = qe + x.stackIndex * (We + Je);
1472
1472
  return /* @__PURE__ */ e(
1473
1473
  "div",
1474
1474
  {
1475
1475
  className: "absolute",
1476
1476
  style: {
1477
- left: N,
1478
- width: Math.max(H, 0),
1477
+ left: k,
1478
+ width: Math.max(j, 0),
1479
1479
  // No forced minimum - columns are guaranteed wide enough
1480
- top: J,
1480
+ top: q,
1481
1481
  height: We
1482
1482
  },
1483
1483
  children: /* @__PURE__ */ e(
1484
1484
  Nt,
1485
1485
  {
1486
- event: v.event,
1486
+ event: x.event,
1487
1487
  variant: "compact",
1488
1488
  enableDrag: P,
1489
- onClick: i,
1490
- renderPopover: b,
1491
- className: m(
1489
+ onClick: l,
1490
+ renderPopover: w,
1491
+ className: g(
1492
1492
  "h-full w-full",
1493
- F?.eventCardCompact
1493
+ $?.eventCardCompact
1494
1494
  )
1495
1495
  }
1496
1496
  )
1497
1497
  },
1498
- v.event.id
1498
+ x.event.id
1499
1499
  );
1500
1500
  })
1501
1501
  ]
@@ -1503,7 +1503,7 @@ function Le({
1503
1503
  )
1504
1504
  ]
1505
1505
  },
1506
- l.user.id
1506
+ c.user.id
1507
1507
  );
1508
1508
  }),
1509
1509
  S.length === 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-20 text-muted-foreground", children: "No users or events to display" })
@@ -1527,39 +1527,39 @@ function et(t) {
1527
1527
  const n = t.hexColor;
1528
1528
  return n ? { backgroundColor: n } : {};
1529
1529
  }
1530
- function mn({ day: t, date: n, events: o, isCurrentMonth: s, onDayClick: a }) {
1531
- const i = ie(n), f = 3, h = o.length;
1530
+ function mn({ day: t, date: n, events: o, isCurrentMonth: a, onDayClick: i }) {
1531
+ const l = ce(n), p = 3, h = o.length;
1532
1532
  return /* @__PURE__ */ r(
1533
1533
  "button",
1534
1534
  {
1535
1535
  type: "button",
1536
- onClick: () => a?.(n),
1537
- className: m(
1536
+ onClick: () => i?.(n),
1537
+ className: g(
1538
1538
  "flex h-9 sm:h-11 flex-1 flex-col items-center justify-start gap-0.5 rounded-md pt-0.5 sm:pt-1",
1539
1539
  "hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
1540
1540
  "transition-colors",
1541
- !s && "opacity-40"
1541
+ !a && "opacity-40"
1542
1542
  ),
1543
1543
  children: [
1544
1544
  /* @__PURE__ */ e(
1545
1545
  "div",
1546
1546
  {
1547
- className: m(
1547
+ className: g(
1548
1548
  "flex size-5 sm:size-6 items-center justify-center rounded-full text-[10px] sm:text-xs font-medium",
1549
- i && "bg-primary font-semibold text-primary-foreground"
1549
+ l && "bg-primary font-semibold text-primary-foreground"
1550
1550
  ),
1551
1551
  children: t
1552
1552
  }
1553
1553
  ),
1554
- h > 0 && /* @__PURE__ */ e("div", { className: "mt-0.5 flex items-center gap-0.5", children: h <= f ? o.map((d) => /* @__PURE__ */ e(
1554
+ h > 0 && /* @__PURE__ */ e("div", { className: "mt-0.5 flex items-center gap-0.5", children: h <= p ? o.map((d) => /* @__PURE__ */ e(
1555
1555
  "div",
1556
1556
  {
1557
1557
  className: "size-1 sm:size-1.5 rounded-full bg-primary",
1558
1558
  style: et(d)
1559
1559
  },
1560
1560
  d.id
1561
- )) : /* @__PURE__ */ r(pe, { children: [
1562
- o.slice(0, f).map((d) => /* @__PURE__ */ e(
1561
+ )) : /* @__PURE__ */ r(we, { children: [
1562
+ o.slice(0, p).map((d) => /* @__PURE__ */ e(
1563
1563
  "div",
1564
1564
  {
1565
1565
  className: "size-1 sm:size-1.5 rounded-full bg-primary",
@@ -1569,7 +1569,7 @@ function mn({ day: t, date: n, events: o, isCurrentMonth: s, onDayClick: a }) {
1569
1569
  )),
1570
1570
  /* @__PURE__ */ r("span", { className: "text-[6px] sm:text-[7px] font-medium text-muted-foreground", children: [
1571
1571
  "+",
1572
- h - f
1572
+ h - p
1573
1573
  ] })
1574
1574
  ] }) })
1575
1575
  ]
@@ -1580,16 +1580,16 @@ function fn({
1580
1580
  date: t,
1581
1581
  events: n,
1582
1582
  onMonthClick: o,
1583
- onDayClick: s
1583
+ onDayClick: a
1584
1584
  }) {
1585
- const a = X(() => At(t, 0), [t]);
1585
+ const i = Q(() => At(t, 0), [t]);
1586
1586
  return /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
1587
1587
  /* @__PURE__ */ e(
1588
1588
  "button",
1589
1589
  {
1590
1590
  type: "button",
1591
1591
  onClick: () => o?.(t),
1592
- className: m(
1592
+ className: g(
1593
1593
  "w-full rounded-t-lg border px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm font-semibold",
1594
1594
  "hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
1595
1595
  "transition-colors"
@@ -1598,22 +1598,22 @@ function fn({
1598
1598
  }
1599
1599
  ),
1600
1600
  /* @__PURE__ */ r("div", { className: "flex-1 space-y-1.5 sm:space-y-2 rounded-b-lg border border-t-0 p-2 sm:p-3", children: [
1601
- /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children: un.map((i, f) => /* @__PURE__ */ r("div", { className: "text-[9px] sm:text-xs font-medium text-muted-foreground", children: [
1602
- /* @__PURE__ */ e("span", { className: "sm:hidden", children: i[0] }),
1603
- /* @__PURE__ */ e("span", { className: "hidden sm:inline", children: i })
1604
- ] }, f)) }),
1605
- /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children: a.map((i, f) => {
1606
- const h = Pt(n, i.date);
1601
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children: un.map((l, p) => /* @__PURE__ */ r("div", { className: "text-[9px] sm:text-xs font-medium text-muted-foreground", children: [
1602
+ /* @__PURE__ */ e("span", { className: "sm:hidden", children: l[0] }),
1603
+ /* @__PURE__ */ e("span", { className: "hidden sm:inline", children: l })
1604
+ ] }, p)) }),
1605
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children: i.map((l, p) => {
1606
+ const h = Pt(n, l.date);
1607
1607
  return /* @__PURE__ */ e(
1608
1608
  mn,
1609
1609
  {
1610
- day: i.date.getDate(),
1611
- date: i.date,
1610
+ day: l.date.getDate(),
1611
+ date: l.date,
1612
1612
  events: h,
1613
- isCurrentMonth: i.isCurrentMonth,
1614
- onDayClick: s
1613
+ isCurrentMonth: l.isCurrentMonth,
1614
+ onDayClick: a
1615
1615
  },
1616
- `${f + 1}-${i.date.toISOString()}`
1616
+ `${p + 1}-${l.date.toISOString()}`
1617
1617
  );
1618
1618
  }) })
1619
1619
  ] })
@@ -1623,13 +1623,13 @@ function gn({
1623
1623
  events: t,
1624
1624
  year: n,
1625
1625
  onMonthClick: o,
1626
- onDayClick: s,
1627
- className: a,
1628
- slots: i,
1629
- classNames: f
1626
+ onDayClick: a,
1627
+ className: i,
1628
+ slots: l,
1629
+ classNames: p
1630
1630
  }) {
1631
- const h = X(() => jt(n), [n]);
1632
- return /* @__PURE__ */ r("div", { className: m("flex flex-col h-full", a), children: [
1631
+ const h = Q(() => jt(n), [n]);
1632
+ return /* @__PURE__ */ r("div", { className: g("flex flex-col h-full", i), children: [
1633
1633
  /* @__PURE__ */ e("div", { className: "flex items-center justify-center border-b px-4 py-3", children: /* @__PURE__ */ e("h2", { className: "text-lg font-semibold", children: n }) }),
1634
1634
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto p-4", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4", children: h.map((d) => /* @__PURE__ */ e(
1635
1635
  fn,
@@ -1637,155 +1637,240 @@ function gn({
1637
1637
  date: d,
1638
1638
  events: t,
1639
1639
  onMonthClick: o,
1640
- onDayClick: s
1640
+ onDayClick: a
1641
1641
  },
1642
1642
  d.getMonth()
1643
1643
  )) }) })
1644
1644
  ] });
1645
1645
  }
1646
- const ze = 200, pn = 60, xn = 300, vn = 7, tt = 2, Fe = 40, wn = 18;
1646
+ const Ie = 200, pn = 60, xn = 300, vn = 7, tt = 2, $e = 40, wn = 18;
1647
1647
  function bn() {
1648
- return /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ e("path", { d: "m18 15-6-6-6 6" }) });
1648
+ return /* @__PURE__ */ e(
1649
+ "svg",
1650
+ {
1651
+ width: "12",
1652
+ height: "12",
1653
+ viewBox: "0 0 24 24",
1654
+ fill: "none",
1655
+ stroke: "currentColor",
1656
+ strokeWidth: "2.5",
1657
+ strokeLinecap: "round",
1658
+ strokeLinejoin: "round",
1659
+ "aria-hidden": "true",
1660
+ children: /* @__PURE__ */ e("path", { d: "m18 15-6-6-6 6" })
1661
+ }
1662
+ );
1649
1663
  }
1650
1664
  function yn() {
1651
- return /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ e("path", { d: "m6 9 6 6 6-6" }) });
1665
+ return /* @__PURE__ */ e(
1666
+ "svg",
1667
+ {
1668
+ width: "12",
1669
+ height: "12",
1670
+ viewBox: "0 0 24 24",
1671
+ fill: "none",
1672
+ stroke: "currentColor",
1673
+ strokeWidth: "2.5",
1674
+ strokeLinecap: "round",
1675
+ strokeLinejoin: "round",
1676
+ "aria-hidden": "true",
1677
+ children: /* @__PURE__ */ e("path", { d: "m6 9 6 6 6-6" })
1678
+ }
1679
+ );
1652
1680
  }
1653
1681
  function kn() {
1654
- return /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ e("path", { d: "m15 18-6-6 6-6" }) });
1682
+ return /* @__PURE__ */ e(
1683
+ "svg",
1684
+ {
1685
+ width: "12",
1686
+ height: "12",
1687
+ viewBox: "0 0 24 24",
1688
+ fill: "none",
1689
+ stroke: "currentColor",
1690
+ strokeWidth: "2.5",
1691
+ strokeLinecap: "round",
1692
+ strokeLinejoin: "round",
1693
+ "aria-hidden": "true",
1694
+ children: /* @__PURE__ */ e("path", { d: "m15 18-6-6 6-6" })
1695
+ }
1696
+ );
1655
1697
  }
1656
1698
  function Nn() {
1657
- return /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ e("path", { d: "m9 18 6-6-6-6" }) });
1699
+ return /* @__PURE__ */ e(
1700
+ "svg",
1701
+ {
1702
+ width: "12",
1703
+ height: "12",
1704
+ viewBox: "0 0 24 24",
1705
+ fill: "none",
1706
+ stroke: "currentColor",
1707
+ strokeWidth: "2.5",
1708
+ strokeLinecap: "round",
1709
+ strokeLinejoin: "round",
1710
+ "aria-hidden": "true",
1711
+ children: /* @__PURE__ */ e("path", { d: "m9 18 6-6-6-6" })
1712
+ }
1713
+ );
1658
1714
  }
1659
- function Dn({ containerRef: t, className: n }) {
1660
- const [o, s] = oe({
1715
+ function Cn({
1716
+ containerRef: t,
1717
+ className: n
1718
+ }) {
1719
+ const [o, a] = ie({
1661
1720
  canUp: !1,
1662
1721
  canDown: !1,
1663
1722
  canLeft: !1,
1664
1723
  canRight: !1
1665
- }), [a, i] = oe({ x: 0, y: 0 }), [f, h] = oe(!1), d = o.canUp || o.canDown || o.canLeft || o.canRight, w = ae(null), k = ae(null), b = ae(null), I = ae(!1), F = ae({ x: 0, y: 0 }), P = ae({ x: 0, y: 0 }), W = ae(0), E = $(() => {
1666
- const x = t.current;
1667
- if (!x) return;
1668
- const c = 4;
1669
- s({
1670
- canUp: x.scrollTop > c,
1671
- canDown: x.scrollTop + x.clientHeight < x.scrollHeight - c,
1672
- canLeft: x.scrollLeft > c,
1673
- canRight: x.scrollLeft + x.clientWidth < x.scrollWidth - c
1724
+ }), [i, l] = ie({ x: 0, y: 0 }), [p, h] = ie(!1), d = o.canUp || o.canDown || o.canLeft || o.canRight, v = ae(null), b = ae(null), w = ae(null), A = ae(!1), $ = ae({ x: 0, y: 0 }), P = ae({ x: 0, y: 0 }), W = ae(0), T = ae(null), y = F(() => {
1725
+ const s = t.current;
1726
+ if (!s) return;
1727
+ const m = 4;
1728
+ a({
1729
+ canUp: s.scrollTop > m,
1730
+ canDown: s.scrollTop + s.clientHeight < s.scrollHeight - m,
1731
+ canLeft: s.scrollLeft > m,
1732
+ canRight: s.scrollLeft + s.clientWidth < s.scrollWidth - m
1674
1733
  });
1675
1734
  }, [t]);
1676
- ce(() => {
1677
- const x = t.current;
1678
- if (!x) return;
1679
- E(), x.addEventListener("scroll", E, { passive: !0 });
1680
- const c = new ResizeObserver(E);
1681
- c.observe(x);
1682
- const g = new MutationObserver(E);
1683
- return g.observe(x, { childList: !0, subtree: !0 }), () => {
1684
- x.removeEventListener("scroll", E), c.disconnect(), g.disconnect();
1735
+ de(() => {
1736
+ const s = t.current;
1737
+ if (!s) return;
1738
+ y(), s.addEventListener("scroll", y, { passive: !0 });
1739
+ const m = new ResizeObserver(y);
1740
+ m.observe(s);
1741
+ const N = new MutationObserver(y);
1742
+ return N.observe(s, { childList: !0, subtree: !0 }), () => {
1743
+ s.removeEventListener("scroll", y), m.disconnect(), N.disconnect();
1685
1744
  };
1686
- }, [t, E]);
1687
- const y = $(
1688
- (x, c) => {
1689
- t.current?.scrollBy({ left: x, top: c, behavior: "smooth" });
1745
+ }, [t, y]);
1746
+ const z = F(
1747
+ (s, m) => {
1748
+ t.current?.scrollBy({ left: s, top: m, behavior: "smooth" });
1690
1749
  },
1691
1750
  [t]
1692
- ), A = $(() => y(0, -ze), [y]), O = $(() => y(0, ze), [y]), R = $(() => y(-ze, 0), [y]), C = $(() => y(ze, 0), [y]), _ = $(() => {
1693
- w.current && (clearTimeout(w.current), w.current = null), k.current && (clearInterval(k.current), k.current = null);
1694
- }, []), z = $(
1695
- (x) => {
1696
- x(), w.current = setTimeout(() => {
1697
- k.current = setInterval(x, pn);
1698
- }, xn);
1699
- },
1700
- []
1701
- );
1702
- ce(() => _, [_]), ce(() => {
1703
- const x = t.current;
1704
- if (!x) return;
1705
- const c = (g) => {
1706
- if (g.ctrlKey || g.metaKey || g.altKey) return;
1707
- const L = g.target.tagName;
1708
- if (!(L === "INPUT" || L === "TEXTAREA" || g.target.isContentEditable))
1709
- switch (g.key) {
1751
+ ), O = F(() => z(0, -Ie), [z]), _ = F(() => z(0, Ie), [z]), D = F(() => z(-Ie, 0), [z]), K = F(() => z(Ie, 0), [z]), E = F(() => {
1752
+ v.current && (clearTimeout(v.current), v.current = null), b.current && (clearInterval(b.current), b.current = null);
1753
+ }, []), H = F((s) => {
1754
+ s(), v.current = setTimeout(() => {
1755
+ b.current = setInterval(s, pn);
1756
+ }, xn);
1757
+ }, []);
1758
+ de(() => E, [E]), de(() => {
1759
+ const s = t.current;
1760
+ if (!s) return;
1761
+ const m = (N) => {
1762
+ if (N.ctrlKey || N.metaKey || N.altKey) return;
1763
+ const L = N.target.tagName;
1764
+ if (!(L === "INPUT" || L === "TEXTAREA" || N.target.isContentEditable))
1765
+ switch (N.key) {
1710
1766
  case "ArrowUp":
1711
- g.preventDefault(), A();
1767
+ N.preventDefault(), O();
1712
1768
  break;
1713
1769
  case "ArrowDown":
1714
- g.preventDefault(), O();
1770
+ N.preventDefault(), _();
1715
1771
  break;
1716
1772
  case "ArrowLeft":
1717
- g.preventDefault(), R();
1773
+ N.preventDefault(), D();
1718
1774
  break;
1719
1775
  case "ArrowRight":
1720
- g.preventDefault(), C();
1776
+ N.preventDefault(), K();
1721
1777
  break;
1722
1778
  }
1723
1779
  };
1724
- return x.addEventListener("keydown", c), () => x.removeEventListener("keydown", c);
1725
- }, [t, A, O, R, C]);
1726
- const j = $(() => {
1727
- I.current = !1, h(!1), i({ x: 0, y: 0 }), P.current = { x: 0, y: 0 }, W.current && cancelAnimationFrame(W.current);
1728
- }, []), V = $(
1729
- (x) => {
1730
- x.preventDefault(), I.current = !0, h(!0), F.current = { x: x.clientX, y: x.clientY }, P.current = { x: 0, y: 0 }, x.target.setPointerCapture(x.pointerId);
1731
- const c = () => {
1732
- if (!I.current) return;
1733
- const g = t.current;
1734
- if (g) {
1735
- const { x: L, y: B } = P.current, S = Math.sqrt(L * L + B * B);
1736
- if (S > tt) {
1737
- const G = Math.min(S / Fe, 1) * wn;
1738
- g.scrollLeft += L / S * G, g.scrollTop += B / S * G;
1780
+ return s.addEventListener("keydown", m), () => s.removeEventListener("keydown", m);
1781
+ }, [t, O, _, D, K]), de(() => {
1782
+ if (!d) return;
1783
+ const s = T.current;
1784
+ if (!s) return;
1785
+ let m = 0;
1786
+ const N = () => {
1787
+ const R = s.offsetParent;
1788
+ if (!R) return;
1789
+ const se = R.getBoundingClientRect(), ee = window.innerHeight;
1790
+ if (se.height <= ee) {
1791
+ s.style.removeProperty("top"), s.style.removeProperty("bottom");
1792
+ return;
1793
+ }
1794
+ const ve = Math.min(se.bottom, ee) - se.top, ne = s.offsetHeight, le = ve - ne - 12, be = 12, ue = R.clientHeight - ne - 12, f = Math.max(be, Math.min(le, ue));
1795
+ s.style.top = `${f}px`, s.style.bottom = "auto";
1796
+ }, L = () => {
1797
+ cancelAnimationFrame(m), m = requestAnimationFrame(N);
1798
+ }, S = [window];
1799
+ let Y = s.parentElement;
1800
+ for (; Y; ) {
1801
+ const R = getComputedStyle(Y);
1802
+ /(auto|scroll)/.test(R.overflow + R.overflowY) && S.push(Y), Y = Y.parentElement;
1803
+ }
1804
+ for (const R of S)
1805
+ R.addEventListener("scroll", L, { passive: !0 });
1806
+ return window.addEventListener("resize", L, { passive: !0 }), N(), () => {
1807
+ cancelAnimationFrame(m);
1808
+ for (const R of S)
1809
+ R.removeEventListener("scroll", L);
1810
+ window.removeEventListener("resize", L);
1811
+ };
1812
+ }, [d]);
1813
+ const V = F(() => {
1814
+ A.current = !1, h(!1), l({ x: 0, y: 0 }), P.current = { x: 0, y: 0 }, W.current && cancelAnimationFrame(W.current);
1815
+ }, []), J = F(
1816
+ (s) => {
1817
+ s.preventDefault(), A.current = !0, h(!0), $.current = { x: s.clientX, y: s.clientY }, P.current = { x: 0, y: 0 }, s.target.setPointerCapture(s.pointerId);
1818
+ const m = () => {
1819
+ if (!A.current) return;
1820
+ const N = t.current;
1821
+ if (N) {
1822
+ const { x: L, y: S } = P.current, Y = Math.sqrt(L * L + S * S);
1823
+ if (Y > tt) {
1824
+ const se = Math.min(Y / $e, 1) * wn;
1825
+ N.scrollLeft += L / Y * se, N.scrollTop += S / Y * se;
1739
1826
  }
1740
1827
  }
1741
- W.current = requestAnimationFrame(c);
1828
+ W.current = requestAnimationFrame(m);
1742
1829
  };
1743
- W.current = requestAnimationFrame(c);
1830
+ W.current = requestAnimationFrame(m);
1744
1831
  },
1745
1832
  [t]
1746
- ), K = $(
1747
- (x) => {
1748
- if (!I.current) return;
1749
- const c = x.clientX - F.current.x, g = x.clientY - F.current.y;
1750
- P.current = { x: c, y: g };
1751
- const L = Math.sqrt(c * c + g * g);
1752
- if (L < tt)
1753
- i({ x: 0, y: 0 });
1754
- else {
1755
- const S = Math.min(L, Fe) / Fe * vn;
1756
- i({
1757
- x: c / L * S,
1758
- y: g / L * S
1759
- });
1760
- }
1761
- },
1762
- []
1763
- ), Y = $(
1764
- (x) => {
1765
- switch (x.key) {
1833
+ ), G = F((s) => {
1834
+ if (!A.current) return;
1835
+ const m = s.clientX - $.current.x, N = s.clientY - $.current.y;
1836
+ P.current = { x: m, y: N };
1837
+ const L = Math.sqrt(m * m + N * N);
1838
+ if (L < tt)
1839
+ l({ x: 0, y: 0 });
1840
+ else {
1841
+ const Y = Math.min(L, $e) / $e * vn;
1842
+ l({
1843
+ x: m / L * Y,
1844
+ y: N / L * Y
1845
+ });
1846
+ }
1847
+ }, []), B = F(
1848
+ (s) => {
1849
+ switch (s.key) {
1766
1850
  case "ArrowUp":
1767
- x.preventDefault(), A();
1851
+ s.preventDefault(), O();
1768
1852
  break;
1769
1853
  case "ArrowDown":
1770
- x.preventDefault(), O();
1854
+ s.preventDefault(), _();
1771
1855
  break;
1772
1856
  case "ArrowLeft":
1773
- x.preventDefault(), R();
1857
+ s.preventDefault(), D();
1774
1858
  break;
1775
1859
  case "ArrowRight":
1776
- x.preventDefault(), C();
1860
+ s.preventDefault(), K();
1777
1861
  break;
1778
1862
  }
1779
1863
  },
1780
- [A, O, R, C]
1864
+ [O, _, D, K]
1781
1865
  );
1782
1866
  return d ? /* @__PURE__ */ r(
1783
1867
  "div",
1784
1868
  {
1869
+ ref: T,
1785
1870
  className: `inno-scroll-nav ${n ?? ""}`,
1786
1871
  role: "toolbar",
1787
1872
  "aria-label": "Scroll navigation",
1788
- onKeyDown: Y,
1873
+ onKeyDown: B,
1789
1874
  children: [
1790
1875
  /* @__PURE__ */ e(
1791
1876
  "button",
@@ -1794,9 +1879,9 @@ function Dn({ containerRef: t, className: n }) {
1794
1879
  className: `inno-scroll-nav-btn inno-scroll-nav-up ${o.canUp ? "" : "inno-scroll-nav-btn-disabled"}`,
1795
1880
  "aria-label": "Scroll up",
1796
1881
  disabled: !o.canUp,
1797
- onPointerDown: () => z(A),
1798
- onPointerUp: _,
1799
- onPointerLeave: _,
1882
+ onPointerDown: () => H(O),
1883
+ onPointerUp: E,
1884
+ onPointerLeave: E,
1800
1885
  tabIndex: o.canUp ? 0 : -1,
1801
1886
  children: /* @__PURE__ */ e(bn, {})
1802
1887
  }
@@ -1808,9 +1893,9 @@ function Dn({ containerRef: t, className: n }) {
1808
1893
  className: `inno-scroll-nav-btn inno-scroll-nav-left ${o.canLeft ? "" : "inno-scroll-nav-btn-disabled"}`,
1809
1894
  "aria-label": "Scroll left",
1810
1895
  disabled: !o.canLeft,
1811
- onPointerDown: () => z(R),
1812
- onPointerUp: _,
1813
- onPointerLeave: _,
1896
+ onPointerDown: () => H(D),
1897
+ onPointerUp: E,
1898
+ onPointerLeave: E,
1814
1899
  tabIndex: o.canLeft ? 0 : -1,
1815
1900
  children: /* @__PURE__ */ e(kn, {})
1816
1901
  }
@@ -1818,21 +1903,21 @@ function Dn({ containerRef: t, className: n }) {
1818
1903
  /* @__PURE__ */ e(
1819
1904
  "button",
1820
1905
  {
1821
- ref: b,
1906
+ ref: w,
1822
1907
  type: "button",
1823
- className: `inno-scroll-nav-joystick ${f ? "inno-scroll-nav-joystick-active" : ""}`,
1908
+ className: `inno-scroll-nav-joystick ${p ? "inno-scroll-nav-joystick-active" : ""}`,
1824
1909
  "aria-label": "Drag to scroll freely",
1825
- onPointerDown: V,
1826
- onPointerMove: K,
1827
- onPointerUp: j,
1828
- onPointerCancel: j,
1910
+ onPointerDown: J,
1911
+ onPointerMove: G,
1912
+ onPointerUp: V,
1913
+ onPointerCancel: V,
1829
1914
  tabIndex: 0,
1830
1915
  children: /* @__PURE__ */ e(
1831
1916
  "span",
1832
1917
  {
1833
1918
  className: "inno-scroll-nav-joystick-dot",
1834
1919
  style: {
1835
- transform: `translate(${a.x}px, ${a.y}px)`
1920
+ transform: `translate(${i.x}px, ${i.y}px)`
1836
1921
  }
1837
1922
  }
1838
1923
  )
@@ -1845,9 +1930,9 @@ function Dn({ containerRef: t, className: n }) {
1845
1930
  className: `inno-scroll-nav-btn inno-scroll-nav-right ${o.canRight ? "" : "inno-scroll-nav-btn-disabled"}`,
1846
1931
  "aria-label": "Scroll right",
1847
1932
  disabled: !o.canRight,
1848
- onPointerDown: () => z(C),
1849
- onPointerUp: _,
1850
- onPointerLeave: _,
1933
+ onPointerDown: () => H(K),
1934
+ onPointerUp: E,
1935
+ onPointerLeave: E,
1851
1936
  tabIndex: o.canRight ? 0 : -1,
1852
1937
  children: /* @__PURE__ */ e(Nn, {})
1853
1938
  }
@@ -1859,9 +1944,9 @@ function Dn({ containerRef: t, className: n }) {
1859
1944
  className: `inno-scroll-nav-btn inno-scroll-nav-down ${o.canDown ? "" : "inno-scroll-nav-btn-disabled"}`,
1860
1945
  "aria-label": "Scroll down",
1861
1946
  disabled: !o.canDown,
1862
- onPointerDown: () => z(O),
1863
- onPointerUp: _,
1864
- onPointerLeave: _,
1947
+ onPointerDown: () => H(_),
1948
+ onPointerUp: E,
1949
+ onPointerLeave: E,
1865
1950
  tabIndex: o.canDown ? 0 : -1,
1866
1951
  children: /* @__PURE__ */ e(yn, {})
1867
1952
  }
@@ -1870,7 +1955,7 @@ function Dn({ containerRef: t, className: n }) {
1870
1955
  }
1871
1956
  ) : null;
1872
1957
  }
1873
- function Cn(t) {
1958
+ function Dn(t) {
1874
1959
  switch (t) {
1875
1960
  case "day":
1876
1961
  case "week":
@@ -1883,67 +1968,67 @@ function Mn({
1883
1968
  onEventClick: t,
1884
1969
  onSlotClick: n,
1885
1970
  onSlotSelect: o,
1886
- onAddEvent: s,
1887
- className: a,
1888
- showHeader: i = !0,
1889
- minSelectionMinutes: f = 30,
1971
+ onAddEvent: a,
1972
+ className: i,
1973
+ showHeader: l = !0,
1974
+ minSelectionMinutes: p = 30,
1890
1975
  showMoreMode: h,
1891
1976
  showMoreEventsInPopover: d = !1,
1892
- isLoading: w = !1,
1893
- slots: k,
1894
- classNames: b,
1895
- settingsContent: I,
1896
- filterContent: F,
1977
+ isLoading: v = !1,
1978
+ slots: b,
1979
+ classNames: w,
1980
+ settingsContent: A,
1981
+ filterContent: $,
1897
1982
  headerActions: P,
1898
1983
  renderPopover: W,
1899
- calendarRef: E,
1984
+ calendarRef: T,
1900
1985
  headerConfig: y,
1901
- eventDetailMode: A,
1986
+ eventDetailMode: z,
1902
1987
  renderEventDetail: O
1903
1988
  }) {
1904
- const R = h ?? (d ? "popover" : "expand"), {
1905
- view: C,
1906
- setView: _,
1907
- selectedDate: z,
1908
- setSelectedDate: j,
1989
+ const _ = h ?? (d ? "popover" : "expand"), {
1990
+ view: D,
1991
+ setView: K,
1992
+ selectedDate: E,
1993
+ setSelectedDate: H,
1909
1994
  slotDuration: V,
1910
- filteredEvents: K,
1911
- users: Y,
1912
- visibleHours: x,
1913
- workingHours: c,
1914
- badgeVariant: g,
1915
- showWorkingHoursOnly: L,
1916
- clearFocusEventId: B
1917
- } = It(), S = X(() => {
1918
- if (!L || !c)
1995
+ filteredEvents: J,
1996
+ users: G,
1997
+ visibleHours: B,
1998
+ workingHours: s,
1999
+ badgeVariant: m,
2000
+ showWorkingHoursOnly: N,
2001
+ clearFocusEventId: L
2002
+ } = zt(), S = Q(() => {
2003
+ if (!N || !s)
1919
2004
  return {
1920
- startHour: x.start,
1921
- endHour: x.end
2005
+ startHour: B.start,
2006
+ endHour: B.end
1922
2007
  };
1923
- let p = 24, M = 0;
1924
- for (const U of Object.keys(c)) {
1925
- const te = c[Number(U)];
1926
- !te || te.enabled === !1 || (te.from < p && (p = te.from), te.to > M && (M = te.to));
2008
+ let f = 24, M = 0;
2009
+ for (const U of Object.keys(s)) {
2010
+ const re = s[Number(U)];
2011
+ !re || re.enabled === !1 || (re.from < f && (f = re.from), re.to > M && (M = re.to));
1927
2012
  }
1928
- return p >= M ? {
1929
- startHour: x.start,
1930
- endHour: x.end
1931
- } : { startHour: p, endHour: M };
1932
- }, [L, c, x]), re = S, G = ae(null);
2013
+ return f >= M ? {
2014
+ startHour: B.start,
2015
+ endHour: B.end
2016
+ } : { startHour: f, endHour: M };
2017
+ }, [N, s, B]), Y = S, R = ae(null);
1933
2018
  wt(
1934
- E,
2019
+ T,
1935
2020
  () => ({
1936
2021
  scrollToToday: () => {
1937
- const p = /* @__PURE__ */ new Date();
1938
- j(p, C), requestAnimationFrame(() => {
2022
+ const f = /* @__PURE__ */ new Date();
2023
+ H(f, D), requestAnimationFrame(() => {
1939
2024
  requestAnimationFrame(() => {
1940
- const M = G.current?.querySelector(
2025
+ const M = R.current?.querySelector(
1941
2026
  ".ic-timeline-scroll-container, [class*='overflow-auto']"
1942
2027
  );
1943
2028
  if (!M) return;
1944
- const Ne = (p.getHours() - S.startHour) * 96;
1945
- Ne > 0 && M.scrollTo({
1946
- top: Math.max(0, Ne - 100),
2029
+ const De = (f.getHours() - S.startHour) * 96;
2030
+ De > 0 && M.scrollTo({
2031
+ top: Math.max(0, De - 100),
1947
2032
  // Offset to show some context
1948
2033
  behavior: "smooth"
1949
2034
  });
@@ -1951,149 +2036,149 @@ function Mn({
1951
2036
  });
1952
2037
  },
1953
2038
  scrollToWorkingHours: () => {
1954
- let p = 8;
1955
- if (c)
1956
- for (const M of Object.keys(c)) {
1957
- const U = c[Number(M)];
1958
- U?.enabled && U.from < p && (p = Math.max(U.from - 1, 0));
2039
+ let f = 8;
2040
+ if (s)
2041
+ for (const M of Object.keys(s)) {
2042
+ const U = s[Number(M)];
2043
+ U?.enabled && U.from < f && (f = Math.max(U.from - 1, 0));
1959
2044
  }
1960
2045
  requestAnimationFrame(() => {
1961
2046
  requestAnimationFrame(() => {
1962
- const M = G.current?.querySelector(
2047
+ const M = R.current?.querySelector(
1963
2048
  ".ic-timeline-scroll-container, [class*='overflow-auto']"
1964
2049
  );
1965
2050
  if (!M) return;
1966
- const te = (p - S.startHour) * 96;
2051
+ const re = (f - S.startHour) * 96;
1967
2052
  M.scrollTo({
1968
- top: Math.max(0, te),
2053
+ top: Math.max(0, re),
1969
2054
  behavior: "smooth"
1970
2055
  });
1971
2056
  });
1972
2057
  });
1973
2058
  },
1974
- getViewRect: () => G.current?.getBoundingClientRect() ?? null,
1975
- focusEvent: (p) => {
1976
- B(), requestAnimationFrame(() => {
1977
- B();
2059
+ getViewRect: () => R.current?.getBoundingClientRect() ?? null,
2060
+ focusEvent: (f) => {
2061
+ L(), requestAnimationFrame(() => {
2062
+ L();
1978
2063
  });
1979
- const M = G.current?.querySelector(
1980
- `[data-event-id="${p}"]`
2064
+ const M = R.current?.querySelector(
2065
+ `[data-event-id="${f}"]`
1981
2066
  );
1982
2067
  M && setTimeout(() => M.click(), 150);
1983
2068
  }
1984
2069
  }),
1985
2070
  [
1986
- j,
1987
- C,
2071
+ H,
2072
+ D,
1988
2073
  S,
1989
- c,
1990
- B
2074
+ s,
2075
+ L
1991
2076
  ]
1992
2077
  );
1993
- const Ce = X(() => Cn(C), [C]), ee = $(
1994
- (p) => {
2078
+ const se = Q(() => Dn(D), [D]), ee = F(
2079
+ (f) => {
1995
2080
  if (o) {
1996
- o(p);
2081
+ o(f);
1997
2082
  return;
1998
2083
  }
1999
2084
  if (n) {
2000
- const M = p.startDate.getHours();
2001
- n(p.startDate, M);
2085
+ const M = f.startDate.getHours();
2086
+ n(f.startDate, M);
2002
2087
  }
2003
2088
  },
2004
2089
  [o, n]
2005
- ), Q = $(
2006
- (p) => {
2007
- _("day"), j(p, "day");
2090
+ ), Z = F(
2091
+ (f) => {
2092
+ K("day"), H(f, "day");
2008
2093
  },
2009
- [j, _]
2010
- ), ke = $(
2011
- (p) => {
2012
- _("month"), j(p, "month");
2094
+ [H, K]
2095
+ ), ve = F(
2096
+ (f) => {
2097
+ K("month"), H(f, "month");
2013
2098
  },
2014
- [j, _]
2015
- ), se = $(
2016
- (p) => {
2017
- t?.(p);
2099
+ [H, K]
2100
+ ), ne = F(
2101
+ (f) => {
2102
+ t?.(f);
2018
2103
  },
2019
2104
  [t]
2020
- ), le = $(
2021
- (p, M, U) => {
2022
- n?.(p, M);
2105
+ ), le = F(
2106
+ (f, M, U) => {
2107
+ n?.(f, M);
2023
2108
  },
2024
2109
  [n]
2025
- ), Me = () => {
2026
- const p = K, M = se, U = W;
2027
- switch (C) {
2110
+ ), be = () => {
2111
+ const f = J, M = ne, U = W;
2112
+ switch (D) {
2028
2113
  case "day":
2029
2114
  return /* @__PURE__ */ e(
2030
2115
  St,
2031
2116
  {
2032
- events: p,
2033
- date: z,
2034
- visibleHours: re,
2035
- workingHours: c,
2117
+ events: f,
2118
+ date: E,
2119
+ visibleHours: Y,
2120
+ workingHours: s,
2036
2121
  slotDuration: V,
2037
- badgeVariant: g,
2122
+ badgeVariant: m,
2038
2123
  onEventClick: M,
2039
2124
  renderPopover: U,
2040
- ...k && { slots: k },
2041
- ...b && { classNames: b }
2125
+ ...b && { slots: b },
2126
+ ...w && { classNames: w }
2042
2127
  }
2043
2128
  );
2044
2129
  case "week":
2045
2130
  return /* @__PURE__ */ e(
2046
2131
  Mt,
2047
2132
  {
2048
- events: p,
2049
- date: z,
2050
- visibleHours: re,
2051
- workingHours: c,
2133
+ events: f,
2134
+ date: E,
2135
+ visibleHours: Y,
2136
+ workingHours: s,
2052
2137
  slotDuration: V,
2053
- badgeVariant: g,
2138
+ badgeVariant: m,
2054
2139
  onEventClick: M,
2055
2140
  renderPopover: U,
2056
- ...k && { slots: k },
2057
- ...b && { classNames: b }
2141
+ ...b && { slots: b },
2142
+ ...w && { classNames: w }
2058
2143
  }
2059
2144
  );
2060
2145
  case "month":
2061
2146
  return /* @__PURE__ */ e(
2062
2147
  Ve,
2063
2148
  {
2064
- events: p,
2065
- date: z,
2066
- badgeVariant: g,
2149
+ events: f,
2150
+ date: E,
2151
+ badgeVariant: m,
2067
2152
  onEventClick: M,
2068
- onDayClick: Q,
2153
+ onDayClick: Z,
2069
2154
  renderPopover: U,
2070
- showMoreMode: R,
2071
- ...k && { slots: k },
2072
- ...b && { classNames: b }
2155
+ showMoreMode: _,
2156
+ ...b && { slots: b },
2157
+ ...w && { classNames: w }
2073
2158
  }
2074
2159
  );
2075
2160
  case "year":
2076
2161
  return /* @__PURE__ */ e(
2077
2162
  gn,
2078
2163
  {
2079
- events: p,
2080
- year: z.getFullYear(),
2081
- onMonthClick: ke,
2082
- onDayClick: Q,
2083
- ...k && { slots: k },
2084
- ...b && { classNames: b }
2164
+ events: f,
2165
+ year: E.getFullYear(),
2166
+ onMonthClick: ve,
2167
+ onDayClick: Z,
2168
+ ...b && { slots: b },
2169
+ ...w && { classNames: w }
2085
2170
  }
2086
2171
  );
2087
2172
  case "agenda":
2088
2173
  return /* @__PURE__ */ e(
2089
- Ct,
2174
+ Dt,
2090
2175
  {
2091
- events: p,
2092
- date: z,
2176
+ events: f,
2177
+ date: E,
2093
2178
  onEventClick: M,
2094
2179
  renderPopover: U,
2095
- ...k && { slots: k },
2096
- ...b && { classNames: b }
2180
+ ...b && { slots: b },
2181
+ ...w && { classNames: w }
2097
2182
  }
2098
2183
  );
2099
2184
  // Resource views — delegate to TimelineView with matching day count
@@ -2102,9 +2187,9 @@ function Mn({
2102
2187
  Le,
2103
2188
  {
2104
2189
  daysToShow: 1,
2105
- events: p,
2106
- users: Y,
2107
- selectedDate: z,
2190
+ events: f,
2191
+ users: G,
2192
+ selectedDate: E,
2108
2193
  visibleHours: {
2109
2194
  from: S.startHour,
2110
2195
  to: S.endHour
@@ -2113,8 +2198,8 @@ function Mn({
2113
2198
  onSlotSelect: ee,
2114
2199
  onSlotClick: le,
2115
2200
  renderPopover: U,
2116
- ...k && { slots: k },
2117
- ...b && { classNames: b }
2201
+ ...b && { slots: b },
2202
+ ...w && { classNames: w }
2118
2203
  }
2119
2204
  );
2120
2205
  case "resource-week":
@@ -2122,9 +2207,9 @@ function Mn({
2122
2207
  Le,
2123
2208
  {
2124
2209
  daysToShow: 7,
2125
- events: p,
2126
- users: Y,
2127
- selectedDate: z,
2210
+ events: f,
2211
+ users: G,
2212
+ selectedDate: E,
2128
2213
  visibleHours: {
2129
2214
  from: S.startHour,
2130
2215
  to: S.endHour
@@ -2133,8 +2218,8 @@ function Mn({
2133
2218
  onSlotSelect: ee,
2134
2219
  onSlotClick: le,
2135
2220
  renderPopover: U,
2136
- ...k && { slots: k },
2137
- ...b && { classNames: b }
2221
+ ...b && { slots: b },
2222
+ ...w && { classNames: w }
2138
2223
  }
2139
2224
  );
2140
2225
  // Timeline views
@@ -2143,9 +2228,9 @@ function Mn({
2143
2228
  Le,
2144
2229
  {
2145
2230
  daysToShow: 1,
2146
- events: p,
2147
- users: Y,
2148
- selectedDate: z,
2231
+ events: f,
2232
+ users: G,
2233
+ selectedDate: E,
2149
2234
  visibleHours: {
2150
2235
  from: S.startHour,
2151
2236
  to: S.endHour
@@ -2154,8 +2239,8 @@ function Mn({
2154
2239
  onSlotSelect: ee,
2155
2240
  onSlotClick: le,
2156
2241
  renderPopover: U,
2157
- ...k && { slots: k },
2158
- ...b && { classNames: b }
2242
+ ...b && { slots: b },
2243
+ ...w && { classNames: w }
2159
2244
  }
2160
2245
  );
2161
2246
  case "timeline-3day":
@@ -2163,9 +2248,9 @@ function Mn({
2163
2248
  Le,
2164
2249
  {
2165
2250
  daysToShow: 3,
2166
- events: p,
2167
- users: Y,
2168
- selectedDate: z,
2251
+ events: f,
2252
+ users: G,
2253
+ selectedDate: E,
2169
2254
  visibleHours: {
2170
2255
  from: S.startHour,
2171
2256
  to: S.endHour
@@ -2174,8 +2259,8 @@ function Mn({
2174
2259
  onSlotSelect: ee,
2175
2260
  onSlotClick: le,
2176
2261
  renderPopover: U,
2177
- ...k && { slots: k },
2178
- ...b && { classNames: b }
2262
+ ...b && { slots: b },
2263
+ ...w && { classNames: w }
2179
2264
  }
2180
2265
  );
2181
2266
  case "timeline-week":
@@ -2183,9 +2268,9 @@ function Mn({
2183
2268
  Le,
2184
2269
  {
2185
2270
  daysToShow: 7,
2186
- events: p,
2187
- users: Y,
2188
- selectedDate: z,
2271
+ events: f,
2272
+ users: G,
2273
+ selectedDate: E,
2189
2274
  visibleHours: {
2190
2275
  from: S.startHour,
2191
2276
  to: S.endHour
@@ -2194,59 +2279,59 @@ function Mn({
2194
2279
  onSlotSelect: ee,
2195
2280
  onSlotClick: le,
2196
2281
  renderPopover: U,
2197
- ...k && { slots: k },
2198
- ...b && { classNames: b }
2282
+ ...b && { slots: b },
2283
+ ...w && { classNames: w }
2199
2284
  }
2200
2285
  );
2201
2286
  default:
2202
2287
  return /* @__PURE__ */ e(
2203
2288
  Ve,
2204
2289
  {
2205
- events: p,
2206
- date: z,
2207
- badgeVariant: g,
2290
+ events: f,
2291
+ date: E,
2292
+ badgeVariant: m,
2208
2293
  onEventClick: M,
2209
- onDayClick: Q,
2210
- ...k && { slots: k },
2211
- ...b && { classNames: b }
2294
+ onDayClick: Z,
2295
+ ...b && { slots: b },
2296
+ ...w && { classNames: w }
2212
2297
  }
2213
2298
  );
2214
2299
  }
2215
- }, xe = ae(null);
2216
- return ce(() => {
2217
- G.current = xe.current;
2300
+ }, ue = ae(null);
2301
+ return de(() => {
2302
+ R.current = ue.current;
2218
2303
  }), /* @__PURE__ */ e(
2219
- zt,
2304
+ It,
2220
2305
  {
2221
- mode: Ce,
2306
+ mode: se,
2222
2307
  onSelect: ee,
2223
- minDurationMinutes: f,
2308
+ minDurationMinutes: p,
2224
2309
  slotDurationMinutes: V,
2225
2310
  enabled: !!(o || n),
2226
2311
  children: /* @__PURE__ */ r(
2227
2312
  "div",
2228
2313
  {
2229
- className: m(
2314
+ className: g(
2230
2315
  "inno-calendar-root flex flex-col h-full p-4",
2231
- b?.root,
2232
- a
2316
+ w?.root,
2317
+ i
2233
2318
  ),
2234
2319
  children: [
2235
- i && /* @__PURE__ */ e(
2236
- Dt,
2320
+ l && /* @__PURE__ */ e(
2321
+ Ct,
2237
2322
  {
2238
- currentDate: z,
2239
- view: C,
2240
- events: K,
2241
- onViewChange: _,
2242
- onNavigateToday: () => j(/* @__PURE__ */ new Date(), C),
2323
+ currentDate: E,
2324
+ view: D,
2325
+ events: J,
2326
+ onViewChange: K,
2327
+ onNavigateToday: () => H(/* @__PURE__ */ new Date(), D),
2243
2328
  onNavigatePrev: () => {
2244
- const p = new Date(z);
2245
- C === "day" || C === "timeline-day" || C === "resource-day" ? p.setDate(p.getDate() - 1) : C === "timeline-3day" ? p.setDate(p.getDate() - 3) : C === "week" || C === "timeline-week" || C === "resource-week" ? p.setDate(p.getDate() - 7) : C === "month" ? p.setMonth(p.getMonth() - 1) : C === "year" ? p.setFullYear(p.getFullYear() - 1) : p.setDate(p.getDate() - 7), j(p, C);
2329
+ const f = new Date(E);
2330
+ D === "day" || D === "timeline-day" || D === "resource-day" ? f.setDate(f.getDate() - 1) : D === "timeline-3day" ? f.setDate(f.getDate() - 3) : D === "week" || D === "timeline-week" || D === "resource-week" ? f.setDate(f.getDate() - 7) : D === "month" ? f.setMonth(f.getMonth() - 1) : D === "year" ? f.setFullYear(f.getFullYear() - 1) : f.setDate(f.getDate() - 7), H(f, D);
2246
2331
  },
2247
2332
  onNavigateNext: () => {
2248
- const p = new Date(z);
2249
- C === "day" || C === "timeline-day" || C === "resource-day" ? p.setDate(p.getDate() + 1) : C === "timeline-3day" ? p.setDate(p.getDate() + 3) : C === "week" || C === "timeline-week" || C === "resource-week" ? p.setDate(p.getDate() + 7) : C === "month" ? p.setMonth(p.getMonth() + 1) : C === "year" ? p.setFullYear(p.getFullYear() + 1) : p.setDate(p.getDate() + 7), j(p, C);
2333
+ const f = new Date(E);
2334
+ D === "day" || D === "timeline-day" || D === "resource-day" ? f.setDate(f.getDate() + 1) : D === "timeline-3day" ? f.setDate(f.getDate() + 3) : D === "week" || D === "timeline-week" || D === "resource-week" ? f.setDate(f.getDate() + 7) : D === "month" ? f.setMonth(f.getMonth() + 1) : D === "year" ? f.setFullYear(f.getFullYear() + 1) : f.setDate(f.getDate() + 7), H(f, D);
2250
2335
  },
2251
2336
  availableViews: [
2252
2337
  "day",
@@ -2256,11 +2341,11 @@ function Mn({
2256
2341
  "agenda"
2257
2342
  ],
2258
2343
  showTimelineViews: !0,
2259
- showSettings: !!I,
2260
- ...!P && s && { onAddEvent: s },
2344
+ showSettings: !!A,
2345
+ ...!P && a && { onAddEvent: a },
2261
2346
  actions: P,
2262
- settingsContent: I,
2263
- filterContent: F,
2347
+ settingsContent: A,
2348
+ filterContent: $,
2264
2349
  ...y && { headerConfig: y }
2265
2350
  }
2266
2351
  ),
@@ -2268,16 +2353,16 @@ function Mn({
2268
2353
  /* @__PURE__ */ e(
2269
2354
  "div",
2270
2355
  {
2271
- ref: xe,
2272
- className: m(
2356
+ ref: ue,
2357
+ className: g(
2273
2358
  "h-full border rounded-lg bg-white overflow-x-auto",
2274
- b?.viewContainer
2359
+ w?.viewContainer
2275
2360
  ),
2276
- children: Me()
2361
+ children: be()
2277
2362
  }
2278
2363
  ),
2279
- w && /* @__PURE__ */ e("div", { className: "inno-calendar-loading-overlay", children: /* @__PURE__ */ e("div", { className: "inno-calendar-spinner" }) }),
2280
- /* @__PURE__ */ e(Dn, { containerRef: xe })
2364
+ v && /* @__PURE__ */ e("div", { className: "inno-calendar-loading-overlay", children: /* @__PURE__ */ e("div", { className: "inno-calendar-spinner" }) }),
2365
+ /* @__PURE__ */ e(Cn, { containerRef: ue })
2281
2366
  ] })
2282
2367
  ]
2283
2368
  }
@@ -2289,89 +2374,89 @@ function Sn({
2289
2374
  events: t,
2290
2375
  users: n = [],
2291
2376
  scheduleTypes: o = [],
2292
- initialView: s = "week",
2293
- initialDate: a,
2294
- initialSelectedUserId: i,
2295
- initialScheduleTypeIds: f,
2377
+ initialView: a = "week",
2378
+ initialDate: i,
2379
+ initialSelectedUserId: l,
2380
+ initialScheduleTypeIds: p,
2296
2381
  initialParticipantIds: h,
2297
2382
  initialWorkingHoursView: d,
2298
- initialSearchQuery: w,
2299
- preferencesConfig: k,
2300
- onEventClick: b,
2301
- onSlotClick: I,
2302
- onSlotSelect: F,
2383
+ initialSearchQuery: v,
2384
+ preferencesConfig: b,
2385
+ onEventClick: w,
2386
+ onSlotClick: A,
2387
+ onSlotSelect: $,
2303
2388
  onAddEvent: P,
2304
2389
  onEventDrop: W,
2305
- onDateChange: E,
2390
+ onDateChange: T,
2306
2391
  onViewChange: y,
2307
- className: A,
2392
+ className: z,
2308
2393
  showHeader: O = !0,
2309
- minSelectionMinutes: R = 30,
2310
- showMoreMode: C,
2311
- showMoreEventsInPopover: _ = !1,
2312
- isLoading: z = !1,
2313
- renderPopover: j,
2394
+ minSelectionMinutes: _ = 30,
2395
+ showMoreMode: D,
2396
+ showMoreEventsInPopover: K = !1,
2397
+ isLoading: E = !1,
2398
+ renderPopover: H,
2314
2399
  slots: V,
2315
- classNames: K,
2316
- settingsContent: Y,
2317
- filterContent: x,
2318
- headerActions: c,
2319
- focusEventId: g,
2320
- headerConfig: L,
2321
- eventDetailMode: B,
2400
+ classNames: J,
2401
+ settingsContent: G,
2402
+ filterContent: B,
2403
+ headerActions: s,
2404
+ focusEventId: m,
2405
+ headerConfig: N,
2406
+ eventDetailMode: L,
2322
2407
  renderEventDetail: S
2323
- }, re) {
2408
+ }, Y) {
2324
2409
  return /* @__PURE__ */ e(Tt, { ...W && { onEventDrop: W }, children: /* @__PURE__ */ e(
2325
2410
  Ht,
2326
2411
  {
2327
2412
  initialEvents: t,
2328
2413
  initialUsers: n,
2329
2414
  initialScheduleTypes: o,
2330
- initialView: s,
2331
- ...a && { initialDate: a },
2332
- ...i && { initialSelectedUserId: i },
2333
- ...f && { initialScheduleTypeIds: f },
2415
+ initialView: a,
2416
+ ...i && { initialDate: i },
2417
+ ...l && { initialSelectedUserId: l },
2418
+ ...p && { initialScheduleTypeIds: p },
2334
2419
  ...h && { initialParticipantIds: h },
2335
2420
  ...d && { initialWorkingHoursView: d },
2336
- ...w && { initialSearchQuery: w },
2337
- ...k && { preferencesConfig: k },
2338
- ...E && { onDateChange: E },
2421
+ ...v && { initialSearchQuery: v },
2422
+ ...b && { preferencesConfig: b },
2423
+ ...T && { onDateChange: T },
2339
2424
  ...y && { onViewChange: y },
2340
- ...g && { initialFocusEventId: g },
2425
+ ...m && { initialFocusEventId: m },
2341
2426
  children: /* @__PURE__ */ e(
2342
2427
  Mn,
2343
2428
  {
2344
- ...b && { onEventClick: b },
2345
- ...I && { onSlotClick: I },
2346
- ...F && { onSlotSelect: F },
2429
+ ...w && { onEventClick: w },
2430
+ ...A && { onSlotClick: A },
2431
+ ...$ && { onSlotSelect: $ },
2347
2432
  ...P && { onAddEvent: P },
2348
- ...j && { renderPopover: j },
2349
- className: A,
2433
+ ...H && { renderPopover: H },
2434
+ className: z,
2350
2435
  showHeader: O,
2351
- minSelectionMinutes: R,
2352
- ...C && { showMoreMode: C },
2353
- showMoreEventsInPopover: _,
2354
- isLoading: z,
2436
+ minSelectionMinutes: _,
2437
+ ...D && { showMoreMode: D },
2438
+ showMoreEventsInPopover: K,
2439
+ isLoading: E,
2355
2440
  ...V && { slots: V },
2356
- ...K && { classNames: K },
2357
- settingsContent: Y,
2358
- filterContent: x,
2359
- headerActions: c,
2360
- calendarRef: re,
2361
- ...L && { headerConfig: L },
2362
- ...B && { eventDetailMode: B },
2441
+ ...J && { classNames: J },
2442
+ settingsContent: G,
2443
+ filterContent: B,
2444
+ headerActions: s,
2445
+ calendarRef: Y,
2446
+ ...N && { headerConfig: N },
2447
+ ...L && { eventDetailMode: L },
2363
2448
  ...S && { renderEventDetail: S }
2364
2449
  }
2365
2450
  )
2366
2451
  }
2367
2452
  ) });
2368
2453
  }
2369
- const Dr = Ae(Sn), ge = Ae(
2370
- ({ className: t, children: n, ...o }, s) => /* @__PURE__ */ e(
2454
+ const Cr = Ae(Sn), xe = Ae(
2455
+ ({ className: t, children: n, ...o }, a) => /* @__PURE__ */ e(
2371
2456
  "select",
2372
2457
  {
2373
- ref: s,
2374
- className: m(
2458
+ ref: a,
2459
+ className: g(
2375
2460
  "flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm",
2376
2461
  "ring-offset-background",
2377
2462
  "focus:outline-none focus:ring-1 focus:ring-ring",
@@ -2384,19 +2469,19 @@ const Dr = Ae(Sn), ge = Ae(
2384
2469
  }
2385
2470
  )
2386
2471
  );
2387
- ge.displayName = "Select";
2388
- const de = Ae(({ className: t, ...n }, o) => /* @__PURE__ */ e(
2472
+ xe.displayName = "Select";
2473
+ const he = Ae(({ className: t, ...n }, o) => /* @__PURE__ */ e(
2389
2474
  "label",
2390
2475
  {
2391
2476
  ref: o,
2392
- className: m(
2477
+ className: g(
2393
2478
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
2394
2479
  t
2395
2480
  ),
2396
2481
  ...n
2397
2482
  }
2398
2483
  ));
2399
- de.displayName = "Label";
2484
+ he.displayName = "Label";
2400
2485
  function En({ className: t }) {
2401
2486
  return /* @__PURE__ */ r(
2402
2487
  "svg",
@@ -2445,37 +2530,37 @@ const Tn = [
2445
2530
  { value: 30, label: "30 minutes" },
2446
2531
  { value: 60, label: "1 hour" }
2447
2532
  ];
2448
- function Cr({
2533
+ function Dr({
2449
2534
  value: t,
2450
2535
  onChange: n,
2451
2536
  isLocked: o = !1,
2452
- className: s,
2453
- labels: a = {}
2537
+ className: a,
2538
+ labels: i = {}
2454
2539
  }) {
2455
- const i = {
2540
+ const l = {
2456
2541
  title: "Slot duration",
2457
2542
  lockedMessage: "This setting is locked by the administrator",
2458
2543
  infoMessage: "Set the time slot duration for day and week calendar views.",
2459
- ...a
2460
- }, f = (h) => {
2544
+ ...i
2545
+ }, p = (h) => {
2461
2546
  o || n(Number(h.target.value));
2462
2547
  };
2463
- return /* @__PURE__ */ r("div", { className: m("flex flex-col gap-3", s), children: [
2548
+ return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", a), children: [
2464
2549
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
2465
- /* @__PURE__ */ e(de, { className: "text-sm font-semibold", children: i.title }),
2466
- o ? /* @__PURE__ */ e(ue, { delayDuration: 100, children: /* @__PURE__ */ r(he, { children: [
2467
- /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(Ln, { className: "size-3 text-muted-foreground" }) }),
2468
- /* @__PURE__ */ e(fe, { children: /* @__PURE__ */ e("p", { children: i.lockedMessage }) })
2469
- ] }) }) : /* @__PURE__ */ e(ue, { delayDuration: 100, children: /* @__PURE__ */ r(he, { children: [
2470
- /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(En, { className: "size-3 text-muted-foreground" }) }),
2471
- /* @__PURE__ */ e(fe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: i.infoMessage }) })
2550
+ /* @__PURE__ */ e(he, { className: "text-sm font-semibold", children: l.title }),
2551
+ o ? /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
2552
+ /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(Ln, { className: "size-3 text-muted-foreground" }) }),
2553
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
2554
+ ] }) }) : /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
2555
+ /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(En, { className: "size-3 text-muted-foreground" }) }),
2556
+ /* @__PURE__ */ e(pe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: l.infoMessage }) })
2472
2557
  ] }) })
2473
2558
  ] }),
2474
2559
  /* @__PURE__ */ e(
2475
- ge,
2560
+ xe,
2476
2561
  {
2477
2562
  value: t.toString(),
2478
- onChange: f,
2563
+ onChange: p,
2479
2564
  disabled: o,
2480
2565
  className: "h-9 w-[128px] text-sm",
2481
2566
  children: Tn.map((h) => /* @__PURE__ */ e("option", { value: h.value.toString(), children: h.label }, h.value))
@@ -2505,7 +2590,7 @@ function Hn({ className: t }) {
2505
2590
  }
2506
2591
  );
2507
2592
  }
2508
- function In({ className: t }) {
2593
+ function zn({ className: t }) {
2509
2594
  return /* @__PURE__ */ r(
2510
2595
  "svg",
2511
2596
  {
@@ -2526,7 +2611,7 @@ function In({ className: t }) {
2526
2611
  }
2527
2612
  );
2528
2613
  }
2529
- const zn = [
2614
+ const In = [
2530
2615
  { value: "dot", label: "Dot indicator" },
2531
2616
  { value: "colored", label: "Full color" },
2532
2617
  { value: "mixed", label: "Mixed" }
@@ -2535,10 +2620,10 @@ function Mr({
2535
2620
  value: t,
2536
2621
  onChange: n,
2537
2622
  isLocked: o = !1,
2538
- className: s,
2539
- labels: a = {}
2623
+ className: a,
2624
+ labels: i = {}
2540
2625
  }) {
2541
- const i = {
2626
+ const l = {
2542
2627
  title: "Event display",
2543
2628
  lockedMessage: "This setting is locked by the administrator",
2544
2629
  infoMessage: "Choose how events are displayed. Dot shows a small indicator, colored fills the entire event, mixed uses both.",
@@ -2547,29 +2632,29 @@ function Mr({
2547
2632
  colored: "Full color",
2548
2633
  mixed: "Mixed"
2549
2634
  },
2550
- ...a
2551
- }, f = (d) => i.options?.[d] ?? d, h = (d) => {
2635
+ ...i
2636
+ }, p = (d) => l.options?.[d] ?? d, h = (d) => {
2552
2637
  o || n(d.target.value);
2553
2638
  };
2554
- return /* @__PURE__ */ r("div", { className: m("flex flex-col gap-3", s), children: [
2639
+ return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", a), children: [
2555
2640
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
2556
- /* @__PURE__ */ e(de, { className: "text-sm font-semibold", children: i.title }),
2557
- o ? /* @__PURE__ */ e(ue, { delayDuration: 100, children: /* @__PURE__ */ r(he, { children: [
2558
- /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(In, { className: "size-3 text-muted-foreground" }) }),
2559
- /* @__PURE__ */ e(fe, { children: /* @__PURE__ */ e("p", { children: i.lockedMessage }) })
2560
- ] }) }) : /* @__PURE__ */ e(ue, { delayDuration: 100, children: /* @__PURE__ */ r(he, { children: [
2561
- /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(Hn, { className: "size-3 text-muted-foreground" }) }),
2562
- /* @__PURE__ */ e(fe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: i.infoMessage }) })
2641
+ /* @__PURE__ */ e(he, { className: "text-sm font-semibold", children: l.title }),
2642
+ o ? /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
2643
+ /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(zn, { className: "size-3 text-muted-foreground" }) }),
2644
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
2645
+ ] }) }) : /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
2646
+ /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(Hn, { className: "size-3 text-muted-foreground" }) }),
2647
+ /* @__PURE__ */ e(pe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: l.infoMessage }) })
2563
2648
  ] }) })
2564
2649
  ] }),
2565
2650
  /* @__PURE__ */ e(
2566
- ge,
2651
+ xe,
2567
2652
  {
2568
2653
  value: t,
2569
2654
  onChange: h,
2570
2655
  disabled: o,
2571
2656
  className: "h-9 w-[128px] text-sm",
2572
- children: zn.map((d) => /* @__PURE__ */ e("option", { value: d.value, children: f(d.value) }, d.value))
2657
+ children: In.map((d) => /* @__PURE__ */ e("option", { value: d.value, children: p(d.value) }, d.value))
2573
2658
  }
2574
2659
  )
2575
2660
  ] });
@@ -2627,76 +2712,76 @@ function Sr({
2627
2712
  value: t,
2628
2713
  onChange: n,
2629
2714
  isLocked: o = !1,
2630
- className: s,
2631
- labels: a = {}
2715
+ className: a,
2716
+ labels: i = {}
2632
2717
  }) {
2633
- const i = {
2718
+ const l = {
2634
2719
  title: "Visible hours",
2635
2720
  from: "From",
2636
2721
  to: "To",
2637
2722
  lockedMessage: "This setting is locked by the administrator",
2638
2723
  infoMessage: "Set the visible hour range for day and week views. Hours outside this range will be hidden.",
2639
- ...a
2640
- }, f = Pn(), h = (w) => {
2724
+ ...i
2725
+ }, p = Pn(), h = (v) => {
2641
2726
  if (o) return;
2642
- const k = Number(w.target.value);
2643
- k < t.endHour && n({ ...t, startHour: k });
2644
- }, d = (w) => {
2727
+ const b = Number(v.target.value);
2728
+ b < t.endHour && n({ ...t, startHour: b });
2729
+ }, d = (v) => {
2645
2730
  if (o) return;
2646
- const k = Number(w.target.value);
2647
- k > t.startHour && n({ ...t, endHour: k });
2731
+ const b = Number(v.target.value);
2732
+ b > t.startHour && n({ ...t, endHour: b });
2648
2733
  };
2649
- return /* @__PURE__ */ r("div", { className: m("flex flex-col gap-3", s), children: [
2734
+ return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", a), children: [
2650
2735
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
2651
- /* @__PURE__ */ e(de, { className: "text-sm font-semibold", children: i.title }),
2652
- o ? /* @__PURE__ */ e(ue, { delayDuration: 100, children: /* @__PURE__ */ r(he, { children: [
2653
- /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(An, { className: "size-3 text-muted-foreground" }) }),
2654
- /* @__PURE__ */ e(fe, { children: /* @__PURE__ */ e("p", { children: i.lockedMessage }) })
2655
- ] }) }) : /* @__PURE__ */ e(ue, { delayDuration: 100, children: /* @__PURE__ */ r(he, { children: [
2656
- /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(jn, { className: "size-3 text-muted-foreground" }) }),
2657
- /* @__PURE__ */ e(fe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: i.infoMessage }) })
2736
+ /* @__PURE__ */ e(he, { className: "text-sm font-semibold", children: l.title }),
2737
+ o ? /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
2738
+ /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(An, { className: "size-3 text-muted-foreground" }) }),
2739
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
2740
+ ] }) }) : /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
2741
+ /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(jn, { className: "size-3 text-muted-foreground" }) }),
2742
+ /* @__PURE__ */ e(pe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: l.infoMessage }) })
2658
2743
  ] }) })
2659
2744
  ] }),
2660
2745
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
2661
2746
  /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
2662
- /* @__PURE__ */ e(de, { className: "text-xs text-muted-foreground", children: i.from }),
2747
+ /* @__PURE__ */ e(he, { className: "text-xs text-muted-foreground", children: l.from }),
2663
2748
  /* @__PURE__ */ e(
2664
- ge,
2749
+ xe,
2665
2750
  {
2666
2751
  value: t.startHour.toString(),
2667
2752
  onChange: h,
2668
2753
  disabled: o,
2669
2754
  className: "h-9 w-[88px] text-sm",
2670
- children: f.map((w) => /* @__PURE__ */ e(
2755
+ children: p.map((v) => /* @__PURE__ */ e(
2671
2756
  "option",
2672
2757
  {
2673
- value: w.value.toString(),
2674
- disabled: w.value >= t.endHour,
2675
- children: w.label
2758
+ value: v.value.toString(),
2759
+ disabled: v.value >= t.endHour,
2760
+ children: v.label
2676
2761
  },
2677
- w.value
2762
+ v.value
2678
2763
  ))
2679
2764
  }
2680
2765
  )
2681
2766
  ] }),
2682
2767
  /* @__PURE__ */ e("span", { className: "mt-5 text-muted-foreground", children: "—" }),
2683
2768
  /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
2684
- /* @__PURE__ */ e(de, { className: "text-xs text-muted-foreground", children: i.to }),
2769
+ /* @__PURE__ */ e(he, { className: "text-xs text-muted-foreground", children: l.to }),
2685
2770
  /* @__PURE__ */ e(
2686
- ge,
2771
+ xe,
2687
2772
  {
2688
2773
  value: t.endHour.toString(),
2689
2774
  onChange: d,
2690
2775
  disabled: o,
2691
2776
  className: "h-9 w-[88px] text-sm",
2692
- children: f.map((w) => /* @__PURE__ */ e(
2777
+ children: p.map((v) => /* @__PURE__ */ e(
2693
2778
  "option",
2694
2779
  {
2695
- value: w.value.toString(),
2696
- disabled: w.value <= t.startHour,
2697
- children: w.label
2780
+ value: v.value.toString(),
2781
+ disabled: v.value <= t.startHour,
2782
+ children: v.label
2698
2783
  },
2699
- w.value
2784
+ v.value
2700
2785
  ))
2701
2786
  }
2702
2787
  )
@@ -2726,7 +2811,7 @@ function Wn({ className: t }) {
2726
2811
  }
2727
2812
  );
2728
2813
  }
2729
- function $n({ className: t }) {
2814
+ function Fn({ className: t }) {
2730
2815
  return /* @__PURE__ */ r(
2731
2816
  "svg",
2732
2817
  {
@@ -2747,7 +2832,7 @@ function $n({ className: t }) {
2747
2832
  }
2748
2833
  );
2749
2834
  }
2750
- function Fn({ className: t }) {
2835
+ function $n({ className: t }) {
2751
2836
  return /* @__PURE__ */ e(
2752
2837
  "svg",
2753
2838
  {
@@ -2789,17 +2874,17 @@ const nt = {
2789
2874
  friday: "Fri",
2790
2875
  saturday: "Sat"
2791
2876
  };
2792
- function Bn({ dayLabel: t, config: n, onChange: o, disabled: s, hourOptions: a }) {
2793
- const i = () => {
2794
- s || o({ ...n, enabled: !n.enabled });
2795
- }, f = (d) => {
2796
- if (s) return;
2797
- const w = Number(d.target.value);
2798
- w < n.to && o({ ...n, from: w });
2877
+ function Bn({ dayLabel: t, config: n, onChange: o, disabled: a, hourOptions: i }) {
2878
+ const l = () => {
2879
+ a || o({ ...n, enabled: !n.enabled });
2880
+ }, p = (d) => {
2881
+ if (a) return;
2882
+ const v = Number(d.target.value);
2883
+ v < n.to && o({ ...n, from: v });
2799
2884
  }, h = (d) => {
2800
- if (s) return;
2801
- const w = Number(d.target.value);
2802
- w > n.from && o({ ...n, to: w });
2885
+ if (a) return;
2886
+ const v = Number(d.target.value);
2887
+ v > n.from && o({ ...n, to: v });
2803
2888
  };
2804
2889
  return /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
2805
2890
  /* @__PURE__ */ e(
@@ -2809,36 +2894,36 @@ function Bn({ dayLabel: t, config: n, onChange: o, disabled: s, hourOptions: a }
2809
2894
  role: "checkbox",
2810
2895
  "aria-checked": n.enabled,
2811
2896
  "aria-label": `Enable ${t}`,
2812
- onClick: i,
2813
- disabled: s,
2814
- className: m(
2897
+ onClick: l,
2898
+ disabled: a,
2899
+ className: g(
2815
2900
  "flex size-5 shrink-0 items-center justify-center rounded border transition-colors",
2816
2901
  n.enabled ? "border-primary bg-primary text-primary-foreground" : "border-input bg-background",
2817
- s && "cursor-not-allowed opacity-50"
2902
+ a && "cursor-not-allowed opacity-50"
2818
2903
  ),
2819
- children: n.enabled && /* @__PURE__ */ e(Fn, { className: "size-3" })
2904
+ children: n.enabled && /* @__PURE__ */ e($n, { className: "size-3" })
2820
2905
  }
2821
2906
  ),
2822
- /* @__PURE__ */ e("span", { className: m("w-10 text-sm", !n.enabled && "text-muted-foreground"), children: t }),
2907
+ /* @__PURE__ */ e("span", { className: g("w-10 text-sm", !n.enabled && "text-muted-foreground"), children: t }),
2823
2908
  /* @__PURE__ */ e(
2824
- ge,
2909
+ xe,
2825
2910
  {
2826
2911
  value: n.from.toString(),
2827
- onChange: f,
2828
- disabled: s || !n.enabled,
2912
+ onChange: p,
2913
+ disabled: a || !n.enabled,
2829
2914
  className: "h-8 w-[76px] text-xs",
2830
- children: a.map((d) => /* @__PURE__ */ e("option", { value: d.value.toString(), disabled: d.value >= n.to, children: d.label }, d.value))
2915
+ children: i.map((d) => /* @__PURE__ */ e("option", { value: d.value.toString(), disabled: d.value >= n.to, children: d.label }, d.value))
2831
2916
  }
2832
2917
  ),
2833
2918
  /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "—" }),
2834
2919
  /* @__PURE__ */ e(
2835
- ge,
2920
+ xe,
2836
2921
  {
2837
2922
  value: n.to.toString(),
2838
2923
  onChange: h,
2839
- disabled: s || !n.enabled,
2924
+ disabled: a || !n.enabled,
2840
2925
  className: "h-8 w-[76px] text-xs",
2841
- children: a.map((d) => /* @__PURE__ */ e("option", { value: d.value.toString(), disabled: d.value <= n.from, children: d.label }, d.value))
2926
+ children: i.map((d) => /* @__PURE__ */ e("option", { value: d.value.toString(), disabled: d.value <= n.from, children: d.label }, d.value))
2842
2927
  }
2843
2928
  )
2844
2929
  ] });
@@ -2847,37 +2932,37 @@ function Er({
2847
2932
  value: t,
2848
2933
  onChange: n,
2849
2934
  isLocked: o = !1,
2850
- className: s,
2851
- labels: a = {}
2935
+ className: a,
2936
+ labels: i = {}
2852
2937
  }) {
2853
- const i = {
2938
+ const l = {
2854
2939
  title: "Working hours",
2855
2940
  lockedMessage: "This setting is locked by the administrator",
2856
2941
  infoMessage: "Configure working hours for each day of the week. Non-working hours will be grayed out in day and week views.",
2857
2942
  days: nt,
2858
- ...a
2859
- }, f = _n(), h = (d, w) => {
2860
- o || n({ ...t, [d]: w });
2943
+ ...i
2944
+ }, p = _n(), h = (d, v) => {
2945
+ o || n({ ...t, [d]: v });
2861
2946
  };
2862
- return /* @__PURE__ */ r("div", { className: m("flex flex-col gap-3", s), children: [
2947
+ return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", a), children: [
2863
2948
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
2864
- /* @__PURE__ */ e(de, { className: "text-sm font-semibold", children: i.title }),
2865
- o ? /* @__PURE__ */ e(ue, { delayDuration: 100, children: /* @__PURE__ */ r(he, { children: [
2866
- /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e($n, { className: "size-3 text-muted-foreground" }) }),
2867
- /* @__PURE__ */ e(fe, { children: /* @__PURE__ */ e("p", { children: i.lockedMessage }) })
2868
- ] }) }) : /* @__PURE__ */ e(ue, { delayDuration: 100, children: /* @__PURE__ */ r(he, { children: [
2869
- /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(Wn, { className: "size-3 text-muted-foreground" }) }),
2870
- /* @__PURE__ */ e(fe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: i.infoMessage }) })
2949
+ /* @__PURE__ */ e(he, { className: "text-sm font-semibold", children: l.title }),
2950
+ o ? /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
2951
+ /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(Fn, { className: "size-3 text-muted-foreground" }) }),
2952
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
2953
+ ] }) }) : /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
2954
+ /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(Wn, { className: "size-3 text-muted-foreground" }) }),
2955
+ /* @__PURE__ */ e(pe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: l.infoMessage }) })
2871
2956
  ] }) })
2872
2957
  ] }),
2873
2958
  /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: On.map((d) => /* @__PURE__ */ e(
2874
2959
  Bn,
2875
2960
  {
2876
- dayLabel: i.days?.[d] ?? nt[d],
2961
+ dayLabel: l.days?.[d] ?? nt[d],
2877
2962
  config: t[d],
2878
- onChange: (w) => h(d, w),
2963
+ onChange: (v) => h(d, v),
2879
2964
  disabled: o,
2880
- hourOptions: f
2965
+ hourOptions: p
2881
2966
  },
2882
2967
  d
2883
2968
  )) })
@@ -2946,7 +3031,7 @@ function Un({ className: t }) {
2946
3031
  }
2947
3032
  );
2948
3033
  }
2949
- function _e({ checked: t, onCheckedChange: n, className: o, children: s }) {
3034
+ function _e({ checked: t, onCheckedChange: n, className: o, children: a }) {
2950
3035
  return /* @__PURE__ */ e(
2951
3036
  "button",
2952
3037
  {
@@ -2955,18 +3040,18 @@ function _e({ checked: t, onCheckedChange: n, className: o, children: s }) {
2955
3040
  "aria-checked": t,
2956
3041
  onClick: () => n(!t),
2957
3042
  className: o,
2958
- children: s
3043
+ children: a
2959
3044
  }
2960
3045
  );
2961
3046
  }
2962
- function Vn({ src: t, alt: n, fallback: o, className: s }) {
2963
- const [a, i] = oe(!1);
2964
- return !t || a ? /* @__PURE__ */ e(
3047
+ function Vn({ src: t, alt: n, fallback: o, className: a }) {
3048
+ const [i, l] = ie(!1);
3049
+ return !t || i ? /* @__PURE__ */ e(
2965
3050
  "div",
2966
3051
  {
2967
- className: m(
3052
+ className: g(
2968
3053
  "flex items-center justify-center bg-zinc-200 text-zinc-600 font-medium text-sm",
2969
- s
3054
+ a
2970
3055
  ),
2971
3056
  children: o || "?"
2972
3057
  }
@@ -2975,30 +3060,30 @@ function Vn({ src: t, alt: n, fallback: o, className: s }) {
2975
3060
  {
2976
3061
  src: t,
2977
3062
  alt: n || "",
2978
- className: m("object-cover", s),
2979
- onError: () => i(!0)
3063
+ className: g("object-cover", a),
3064
+ onError: () => l(!0)
2980
3065
  }
2981
3066
  );
2982
3067
  }
2983
- function rt({ value: t, onChange: n, placeholder: o, className: s }) {
2984
- return /* @__PURE__ */ r("div", { className: m("relative", s), children: [
3068
+ function rt({ value: t, onChange: n, placeholder: o, className: a }) {
3069
+ return /* @__PURE__ */ r("div", { className: g("relative", a), children: [
2985
3070
  /* @__PURE__ */ e(Rn, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
2986
3071
  /* @__PURE__ */ e(
2987
3072
  "input",
2988
3073
  {
2989
3074
  type: "text",
2990
3075
  value: t,
2991
- onChange: (a) => n(a.target.value),
3076
+ onChange: (i) => n(i.target.value),
2992
3077
  placeholder: o,
2993
3078
  className: "h-9 w-full rounded-lg border border-border bg-white pl-9 pr-3 text-sm placeholder:text-muted-foreground focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"
2994
3079
  }
2995
3080
  )
2996
3081
  ] });
2997
3082
  }
2998
- function ot(t, n, o, s = 0.3) {
3083
+ function ot(t, n, o, a = 0.3) {
2999
3084
  if (!n.trim()) return t;
3000
- const a = n.toLowerCase();
3001
- return t.filter((i) => o(i).some((h) => h ? h.toLowerCase().includes(a) : !1));
3085
+ const i = n.toLowerCase();
3086
+ return t.filter((l) => o(l).some((h) => h ? h.toLowerCase().includes(i) : !1));
3002
3087
  }
3003
3088
  const Yn = {
3004
3089
  title: "Filters",
@@ -3017,69 +3102,69 @@ function Tr({
3017
3102
  scheduleTypes: t,
3018
3103
  users: n,
3019
3104
  selectedScheduleTypeIds: o,
3020
- onScheduleTypeChange: s,
3021
- selectedUserIds: a,
3022
- onUserChange: i,
3023
- onClearAll: f,
3105
+ onScheduleTypeChange: a,
3106
+ selectedUserIds: i,
3107
+ onUserChange: l,
3108
+ onClearAll: p,
3024
3109
  className: h,
3025
3110
  scheduleTypesLoading: d = !1,
3026
- usersLoading: w = !1,
3027
- labels: k,
3028
- getScheduleTypeName: b
3111
+ usersLoading: v = !1,
3112
+ labels: b,
3113
+ getScheduleTypeName: w
3029
3114
  }) {
3030
- const I = { ...Yn, ...k }, [F, P] = oe(""), [W, E] = oe(""), y = X(() => F.trim() ? ot(t, F, (c) => [
3031
- c.name,
3032
- b?.(c) || c.name
3033
- ]) : t, [t, F, b]), A = X(() => W.trim() ? ot(n, W, (c) => [c.name, c.email || ""]) : n, [n, W]), O = y.length > 0 && y.every((c) => o.includes(c.id)), R = A.length > 0 && A.every((c) => a.includes(c.id)), C = o.length + a.length, _ = (c, g) => {
3034
- const L = g ? [...o, c] : o.filter((B) => B !== c);
3035
- s(L);
3036
- }, z = () => {
3115
+ const A = { ...Yn, ...b }, [$, P] = ie(""), [W, T] = ie(""), y = Q(() => $.trim() ? ot(t, $, (s) => [
3116
+ s.name,
3117
+ w?.(s) || s.name
3118
+ ]) : t, [t, $, w]), z = Q(() => W.trim() ? ot(n, W, (s) => [s.name, s.email || ""]) : n, [n, W]), O = y.length > 0 && y.every((s) => o.includes(s.id)), _ = z.length > 0 && z.every((s) => i.includes(s.id)), D = o.length + i.length, K = (s, m) => {
3119
+ const N = m ? [...o, s] : o.filter((L) => L !== s);
3120
+ a(N);
3121
+ }, E = () => {
3037
3122
  if (O) {
3038
- const c = new Set(y.map((g) => g.id));
3039
- s(o.filter((g) => !c.has(g)));
3123
+ const s = new Set(y.map((m) => m.id));
3124
+ a(o.filter((m) => !s.has(m)));
3040
3125
  } else {
3041
- const c = /* @__PURE__ */ new Set([
3126
+ const s = /* @__PURE__ */ new Set([
3042
3127
  ...o,
3043
- ...y.map((g) => g.id)
3128
+ ...y.map((m) => m.id)
3044
3129
  ]);
3045
- s(Array.from(c));
3130
+ a(Array.from(s));
3046
3131
  }
3047
- }, j = (c, g) => {
3048
- const L = g ? [...a, c] : a.filter((B) => B !== c);
3049
- i(L);
3132
+ }, H = (s, m) => {
3133
+ const N = m ? [...i, s] : i.filter((L) => L !== s);
3134
+ l(N);
3050
3135
  }, V = () => {
3051
- if (R) {
3052
- const c = new Set(A.map((g) => g.id));
3053
- i(a.filter((g) => !c.has(g)));
3136
+ if (_) {
3137
+ const s = new Set(z.map((m) => m.id));
3138
+ l(i.filter((m) => !s.has(m)));
3054
3139
  } else {
3055
- const c = /* @__PURE__ */ new Set([...a, ...A.map((g) => g.id)]);
3056
- i(Array.from(c));
3140
+ const s = /* @__PURE__ */ new Set([...i, ...z.map((m) => m.id)]);
3141
+ l(Array.from(s));
3057
3142
  }
3058
- }, K = () => {
3059
- s([]), i([]), f?.();
3060
- }, Y = (c) => b ? b(c) : c.name, x = (c) => c.colorHex || c.color || "#069AD7";
3143
+ }, J = () => {
3144
+ a([]), l([]), p?.();
3145
+ }, G = (s) => w ? w(s) : s.name, B = (s) => s.colorHex || s.color || "#069AD7";
3061
3146
  return /* @__PURE__ */ r(
3062
3147
  "div",
3063
3148
  {
3064
- className: m(
3149
+ className: g(
3065
3150
  "flex min-w-72 max-w-72 flex-col rounded-lg border bg-white shadow-sm",
3066
3151
  h
3067
3152
  ),
3068
3153
  children: [
3069
3154
  /* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-2 px-4 pb-2 pt-4", children: [
3070
3155
  /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
3071
- /* @__PURE__ */ e("h3", { className: "text-base font-semibold text-foreground", children: I.title }),
3072
- /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: I.subtitle })
3156
+ /* @__PURE__ */ e("h3", { className: "text-base font-semibold text-foreground", children: A.title }),
3157
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: A.subtitle })
3073
3158
  ] }),
3074
- C > 0 && /* @__PURE__ */ r(
3159
+ D > 0 && /* @__PURE__ */ r(
3075
3160
  "button",
3076
3161
  {
3077
3162
  type: "button",
3078
- onClick: K,
3163
+ onClick: J,
3079
3164
  className: "flex h-auto items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/10",
3080
3165
  children: [
3081
3166
  /* @__PURE__ */ e(Un, { className: "h-3.5 w-3.5" }),
3082
- I.clearAll
3167
+ A.clearAll
3083
3168
  ]
3084
3169
  }
3085
3170
  )
@@ -3087,29 +3172,29 @@ function Tr({
3087
3172
  /* @__PURE__ */ e("div", { className: "h-px w-full bg-border/60" }),
3088
3173
  /* @__PURE__ */ r("section", { className: "flex flex-col", children: [
3089
3174
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between px-4 py-3", children: [
3090
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children: I.scheduleTypes }),
3175
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children: A.scheduleTypes }),
3091
3176
  /* @__PURE__ */ e(
3092
3177
  "button",
3093
3178
  {
3094
3179
  type: "button",
3095
- onClick: z,
3180
+ onClick: E,
3096
3181
  className: "text-xs font-medium text-primary transition-colors hover:text-primary/80",
3097
- children: O ? I.unselectAll : I.selectAll
3182
+ children: O ? A.unselectAll : A.selectAll
3098
3183
  }
3099
3184
  )
3100
3185
  ] }),
3101
3186
  t.length > 6 && /* @__PURE__ */ e("div", { className: "px-4 pb-3", children: /* @__PURE__ */ e(
3102
3187
  rt,
3103
3188
  {
3104
- value: F,
3189
+ value: $,
3105
3190
  onChange: P,
3106
- placeholder: I.searchScheduleTypes
3191
+ placeholder: A.searchScheduleTypes
3107
3192
  }
3108
3193
  ) }),
3109
3194
  /* @__PURE__ */ r("div", { className: "flex max-h-[220px] flex-col gap-2 overflow-y-auto px-4 pb-2 scrollbar-thin", children: [
3110
3195
  d ? (
3111
3196
  // Loading skeletons
3112
- Array.from({ length: 4 }).map((c, g) => /* @__PURE__ */ r(
3197
+ Array.from({ length: 4 }).map((s, m) => /* @__PURE__ */ r(
3113
3198
  "div",
3114
3199
  {
3115
3200
  className: "flex animate-pulse items-center gap-2 rounded-md border border-border/60 bg-muted/40 p-2",
@@ -3118,65 +3203,65 @@ function Tr({
3118
3203
  /* @__PURE__ */ e("div", { className: "h-3 w-24 rounded bg-muted-foreground/20" })
3119
3204
  ]
3120
3205
  },
3121
- `skeleton-${g}`
3206
+ `skeleton-${m}`
3122
3207
  ))
3123
- ) : y.map((c) => {
3124
- const g = o.includes(c.id), L = x(c);
3208
+ ) : y.map((s) => {
3209
+ const m = o.includes(s.id), N = B(s);
3125
3210
  return /* @__PURE__ */ r(
3126
3211
  _e,
3127
3212
  {
3128
- checked: g,
3129
- onCheckedChange: (B) => _(c.id, B),
3130
- className: m(
3213
+ checked: m,
3214
+ onCheckedChange: (L) => K(s.id, L),
3215
+ className: g(
3131
3216
  "relative flex w-full cursor-pointer items-center justify-between gap-3 rounded-md border border-border bg-white px-3 py-2 transition-colors hover:border-primary/50",
3132
- g && "border-primary bg-primary/5"
3217
+ m && "border-primary bg-primary/5"
3133
3218
  ),
3134
3219
  children: [
3135
3220
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
3136
3221
  /* @__PURE__ */ e(
3137
3222
  "span",
3138
3223
  {
3139
- className: m(
3224
+ className: g(
3140
3225
  "flex h-4 w-4 items-center justify-center rounded border border-border text-xs transition-colors",
3141
- g && "border-primary bg-primary text-primary-foreground"
3226
+ m && "border-primary bg-primary text-primary-foreground"
3142
3227
  ),
3143
- children: g && /* @__PURE__ */ e(Oe, { className: "h-3 w-3" })
3228
+ children: m && /* @__PURE__ */ e(Oe, { className: "h-3 w-3" })
3144
3229
  }
3145
3230
  ),
3146
- /* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: Y(c) })
3231
+ /* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: G(s) })
3147
3232
  ] }),
3148
3233
  /* @__PURE__ */ e(
3149
3234
  "div",
3150
3235
  {
3151
3236
  className: "h-4 w-4 rounded-full border",
3152
3237
  style: {
3153
- backgroundColor: L,
3154
- borderColor: L
3238
+ backgroundColor: N,
3239
+ borderColor: N
3155
3240
  }
3156
3241
  }
3157
3242
  )
3158
3243
  ]
3159
3244
  },
3160
- c.id
3245
+ s.id
3161
3246
  );
3162
3247
  }),
3163
- !d && y.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1 text-xs text-muted-foreground", children: I.noScheduleTypes })
3248
+ !d && y.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1 text-xs text-muted-foreground", children: A.noScheduleTypes })
3164
3249
  ] })
3165
3250
  ] }),
3166
3251
  /* @__PURE__ */ e("div", { className: "h-px w-full bg-border/60" }),
3167
3252
  /* @__PURE__ */ r("section", { className: "flex flex-col", children: [
3168
3253
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between px-4 py-3", children: [
3169
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children: I.participants }),
3254
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children: A.participants }),
3170
3255
  /* @__PURE__ */ e(
3171
3256
  _e,
3172
3257
  {
3173
- checked: R,
3258
+ checked: _,
3174
3259
  onCheckedChange: () => V(),
3175
- className: m(
3260
+ className: g(
3176
3261
  "flex h-5 w-5 items-center justify-center rounded border border-border bg-white transition-colors hover:border-primary/50",
3177
- R && "border-primary bg-primary text-primary-foreground"
3262
+ _ && "border-primary bg-primary text-primary-foreground"
3178
3263
  ),
3179
- children: R && /* @__PURE__ */ e(Oe, { className: "h-3.5 w-3.5" })
3264
+ children: _ && /* @__PURE__ */ e(Oe, { className: "h-3.5 w-3.5" })
3180
3265
  }
3181
3266
  )
3182
3267
  ] }),
@@ -3184,14 +3269,14 @@ function Tr({
3184
3269
  rt,
3185
3270
  {
3186
3271
  value: W,
3187
- onChange: E,
3188
- placeholder: I.searchParticipants
3272
+ onChange: T,
3273
+ placeholder: A.searchParticipants
3189
3274
  }
3190
3275
  ) }),
3191
3276
  /* @__PURE__ */ r("div", { className: "flex max-h-[400px] flex-col gap-2 overflow-y-auto px-4 pb-4 scrollbar-thin", children: [
3192
- w ? (
3277
+ v ? (
3193
3278
  // Loading skeletons
3194
- Array.from({ length: 4 }).map((c, g) => /* @__PURE__ */ r(
3279
+ Array.from({ length: 4 }).map((s, m) => /* @__PURE__ */ r(
3195
3280
  "div",
3196
3281
  {
3197
3282
  className: "flex animate-pulse items-center gap-3 rounded-md border border-border/60 bg-muted/40 p-3",
@@ -3204,58 +3289,58 @@ function Tr({
3204
3289
  ] })
3205
3290
  ]
3206
3291
  },
3207
- `p-skeleton-${g}`
3292
+ `p-skeleton-${m}`
3208
3293
  ))
3209
- ) : A.map((c) => {
3210
- const g = a.includes(c.id);
3294
+ ) : z.map((s) => {
3295
+ const m = i.includes(s.id);
3211
3296
  return /* @__PURE__ */ r(
3212
3297
  _e,
3213
3298
  {
3214
- checked: g,
3215
- onCheckedChange: (L) => j(c.id, L),
3216
- className: m(
3299
+ checked: m,
3300
+ onCheckedChange: (N) => H(s.id, N),
3301
+ className: g(
3217
3302
  "relative flex w-full cursor-pointer items-start gap-2 rounded-lg border border-border bg-white p-2 transition-colors hover:border-primary/50",
3218
- g && "border-primary bg-zinc-50"
3303
+ m && "border-primary bg-zinc-50"
3219
3304
  ),
3220
3305
  children: [
3221
3306
  /* @__PURE__ */ e(
3222
3307
  "span",
3223
3308
  {
3224
- className: m(
3309
+ className: g(
3225
3310
  "flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border border-border transition-colors",
3226
- g && "border-primary bg-primary text-primary-foreground"
3311
+ m && "border-primary bg-primary text-primary-foreground"
3227
3312
  ),
3228
- children: g && /* @__PURE__ */ e(Oe, { className: "h-2.5 w-2.5" })
3313
+ children: m && /* @__PURE__ */ e(Oe, { className: "h-2.5 w-2.5" })
3229
3314
  }
3230
3315
  ),
3231
3316
  /* @__PURE__ */ r("div", { className: "flex flex-1 items-start gap-2", children: [
3232
3317
  /* @__PURE__ */ e(
3233
3318
  Vn,
3234
3319
  {
3235
- src: c.avatar ?? null,
3236
- alt: c.name,
3237
- fallback: c.name?.[0]?.toUpperCase() ?? "?",
3320
+ src: s.avatar ?? null,
3321
+ alt: s.name,
3322
+ fallback: s.name?.[0]?.toUpperCase() ?? "?",
3238
3323
  className: "h-10 w-10 rounded-lg"
3239
3324
  }
3240
3325
  ),
3241
3326
  /* @__PURE__ */ r("div", { className: "flex max-w-[140px] flex-col gap-0.5 overflow-hidden", children: [
3242
- /* @__PURE__ */ e("span", { className: "line-clamp-1 text-sm font-medium text-foreground", children: c.name }),
3327
+ /* @__PURE__ */ e("span", { className: "line-clamp-1 text-sm font-medium text-foreground", children: s.name }),
3243
3328
  /* @__PURE__ */ e(
3244
3329
  "span",
3245
3330
  {
3246
3331
  className: "truncate text-[11px] text-muted-foreground",
3247
- title: c.email,
3248
- children: c.email
3332
+ title: s.email,
3333
+ children: s.email
3249
3334
  }
3250
3335
  )
3251
3336
  ] })
3252
3337
  ] })
3253
3338
  ]
3254
3339
  },
3255
- c.id
3340
+ s.id
3256
3341
  );
3257
3342
  }),
3258
- !w && A.length === 0 && /* @__PURE__ */ e("p", { className: "px-4 text-xs text-muted-foreground", children: I.noParticipants })
3343
+ !v && z.length === 0 && /* @__PURE__ */ e("p", { className: "px-4 text-xs text-muted-foreground", children: A.noParticipants })
3259
3344
  ] })
3260
3345
  ] })
3261
3346
  ]
@@ -3287,15 +3372,15 @@ function Hr({
3287
3372
  scheduleTypes: t,
3288
3373
  value: n,
3289
3374
  onChange: o,
3290
- allLabel: s = "All types",
3291
- className: a,
3292
- label: i
3375
+ allLabel: a = "All types",
3376
+ className: i,
3377
+ label: l
3293
3378
  }) {
3294
- const f = (d) => {
3379
+ const p = (d) => {
3295
3380
  o(d.target.value);
3296
3381
  }, h = t.find((d) => String(d.id) === n);
3297
- return /* @__PURE__ */ r("div", { className: m("flex flex-col gap-1", a), children: [
3298
- i && /* @__PURE__ */ e(de, { className: "text-xs text-muted-foreground", children: i }),
3382
+ return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-1", i), children: [
3383
+ l && /* @__PURE__ */ e(he, { className: "text-xs text-muted-foreground", children: l }),
3299
3384
  /* @__PURE__ */ r("div", { className: "relative", children: [
3300
3385
  h ? /* @__PURE__ */ e(
3301
3386
  "span",
@@ -3305,13 +3390,13 @@ function Hr({
3305
3390
  }
3306
3391
  ) : /* @__PURE__ */ e(Kn, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
3307
3392
  /* @__PURE__ */ r(
3308
- ge,
3393
+ xe,
3309
3394
  {
3310
3395
  value: n,
3311
- onChange: f,
3396
+ onChange: p,
3312
3397
  className: "h-9 w-full min-w-[140px] pl-8 pr-8 text-sm",
3313
3398
  children: [
3314
- /* @__PURE__ */ e("option", { value: "all", children: s }),
3399
+ /* @__PURE__ */ e("option", { value: "all", children: a }),
3315
3400
  t.map((d) => /* @__PURE__ */ e("option", { value: String(d.id), children: d.label }, d.id))
3316
3401
  ]
3317
3402
  }
@@ -3342,29 +3427,29 @@ function Gn({ className: t }) {
3342
3427
  }
3343
3428
  );
3344
3429
  }
3345
- function Ir({
3430
+ function zr({
3346
3431
  users: t,
3347
3432
  value: n,
3348
3433
  onChange: o,
3349
- allLabel: s = "All users",
3350
- className: a,
3351
- label: i
3434
+ allLabel: a = "All users",
3435
+ className: i,
3436
+ label: l
3352
3437
  }) {
3353
- const f = (h) => {
3438
+ const p = (h) => {
3354
3439
  o(h.target.value);
3355
3440
  };
3356
- return /* @__PURE__ */ r("div", { className: m("flex flex-col gap-1", a), children: [
3357
- i && /* @__PURE__ */ e(de, { className: "text-xs text-muted-foreground", children: i }),
3441
+ return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-1", i), children: [
3442
+ l && /* @__PURE__ */ e(he, { className: "text-xs text-muted-foreground", children: l }),
3358
3443
  /* @__PURE__ */ r("div", { className: "relative", children: [
3359
3444
  /* @__PURE__ */ e(Gn, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
3360
3445
  /* @__PURE__ */ r(
3361
- ge,
3446
+ xe,
3362
3447
  {
3363
3448
  value: n,
3364
- onChange: f,
3449
+ onChange: p,
3365
3450
  className: "h-9 w-full min-w-[120px] pl-8 pr-8 text-sm",
3366
3451
  children: [
3367
- /* @__PURE__ */ e("option", { value: "all", children: s }),
3452
+ /* @__PURE__ */ e("option", { value: "all", children: a }),
3368
3453
  t.map((h) => /* @__PURE__ */ e("option", { value: h.id, children: h.name }, h.id))
3369
3454
  ]
3370
3455
  }
@@ -3459,12 +3544,12 @@ function Qn({ className: t }) {
3459
3544
  );
3460
3545
  }
3461
3546
  function Zn(t) {
3462
- const n = t.getFullYear(), o = String(t.getMonth() + 1).padStart(2, "0"), s = String(t.getDate()).padStart(2, "0");
3463
- return `${n}-${o}-${s}`;
3547
+ const n = t.getFullYear(), o = String(t.getMonth() + 1).padStart(2, "0"), a = String(t.getDate()).padStart(2, "0");
3548
+ return `${n}-${o}-${a}`;
3464
3549
  }
3465
3550
  function st(t) {
3466
- const n = t.getHours(), o = t.getMinutes(), s = n >= 12 ? "PM" : "AM", a = n % 12 || 12, i = String(o).padStart(2, "0");
3467
- return `${a}:${i} ${s}`;
3551
+ const n = t.getHours(), o = t.getMinutes(), a = n >= 12 ? "PM" : "AM", i = n % 12 || 12, l = String(o).padStart(2, "0");
3552
+ return `${i}:${l} ${a}`;
3468
3553
  }
3469
3554
  function er(t) {
3470
3555
  const n = st(t.startDate), o = st(t.endDate);
@@ -3475,7 +3560,7 @@ function tr(t) {
3475
3560
  return t.getFullYear() === n.getFullYear() && t.getMonth() === n.getMonth() && t.getDate() === n.getDate();
3476
3561
  }
3477
3562
  function nr(t) {
3478
- if (ie(t)) return "Today";
3563
+ if (ce(t)) return "Today";
3479
3564
  if (tr(t)) return "Tomorrow";
3480
3565
  const n = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], o = [
3481
3566
  "Jan",
@@ -3490,33 +3575,33 @@ function nr(t) {
3490
3575
  "Oct",
3491
3576
  "Nov",
3492
3577
  "Dec"
3493
- ], s = n[t.getDay()], a = o[t.getMonth()], i = t.getDate();
3494
- return `${s}, ${a} ${i}`;
3578
+ ], a = n[t.getDay()], i = o[t.getMonth()], l = t.getDate();
3579
+ return `${a}, ${i} ${l}`;
3495
3580
  }
3496
3581
  function rr(t, n) {
3497
3582
  const o = /* @__PURE__ */ new Map();
3498
- for (const s of t) {
3499
- const a = Zn(s.startDate), i = o.get(a) ?? [];
3500
- i.push(s), o.set(a, i);
3583
+ for (const a of t) {
3584
+ const i = Zn(a.startDate), l = o.get(i) ?? [];
3585
+ l.push(a), o.set(i, l);
3501
3586
  }
3502
- return Array.from(o.entries()).map(([s, a]) => {
3503
- const i = [...a].sort(
3587
+ return Array.from(o.entries()).map(([a, i]) => {
3588
+ const l = [...i].sort(
3504
3589
  (h, d) => h.startDate.getTime() - d.startDate.getTime()
3505
- ), f = n > 0 ? i.slice(0, n) : i;
3590
+ ), p = n > 0 ? l.slice(0, n) : l;
3506
3591
  return {
3507
- date: new Date(s),
3508
- dateKey: s,
3509
- events: f,
3510
- hasMore: n > 0 && i.length > n
3592
+ date: new Date(a),
3593
+ dateKey: a,
3594
+ events: p,
3595
+ hasMore: n > 0 && l.length > n
3511
3596
  };
3512
- }).sort((s, a) => s.date.getTime() - a.date.getTime());
3597
+ }).sort((a, i) => a.date.getTime() - i.date.getTime());
3513
3598
  }
3514
3599
  function or(t) {
3515
3600
  const n = Pe(/* @__PURE__ */ new Date()), o = ut(/* @__PURE__ */ new Date());
3516
- return t.filter((s) => s.startDate >= n && s.startDate <= o).length;
3601
+ return t.filter((a) => a.startDate >= n && a.startDate <= o).length;
3517
3602
  }
3518
3603
  function Be({ className: t }) {
3519
- return /* @__PURE__ */ e("div", { className: m("animate-pulse rounded-md bg-muted", t) });
3604
+ return /* @__PURE__ */ e("div", { className: g("animate-pulse rounded-md bg-muted", t) });
3520
3605
  }
3521
3606
  function sr({ event: t, onClick: n }) {
3522
3607
  return /* @__PURE__ */ r(
@@ -3524,7 +3609,7 @@ function sr({ event: t, onClick: n }) {
3524
3609
  {
3525
3610
  type: "button",
3526
3611
  onClick: () => n?.(t),
3527
- className: m(
3612
+ className: g(
3528
3613
  "w-full text-left rounded-lg transition-colors",
3529
3614
  "hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
3530
3615
  "flex items-start gap-3 p-2"
@@ -3549,7 +3634,7 @@ function sr({ event: t, onClick: n }) {
3549
3634
  function ar({ group: t, onEventClick: n }) {
3550
3635
  return /* @__PURE__ */ r("div", { className: "space-y-1", children: [
3551
3636
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between px-2 py-1.5", children: [
3552
- /* @__PURE__ */ e("h3", { className: m("text-xs font-semibold", ie(t.date) && "text-primary"), children: nr(t.date) }),
3637
+ /* @__PURE__ */ e("h3", { className: g("text-xs font-semibold", ce(t.date) && "text-primary"), children: nr(t.date) }),
3553
3638
  t.hasMore && /* @__PURE__ */ r("span", { className: "text-[10px] text-muted-foreground", children: [
3554
3639
  "+",
3555
3640
  t.events.length,
@@ -3559,42 +3644,42 @@ function ar({ group: t, onEventClick: n }) {
3559
3644
  /* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((o) => /* @__PURE__ */ e(sr, { event: o, onClick: n }, o.id)) })
3560
3645
  ] });
3561
3646
  }
3562
- function zr({
3647
+ function Ir({
3563
3648
  events: t,
3564
3649
  isLoading: n = !1,
3565
3650
  className: o,
3566
- daysAhead: s = 7,
3567
- maxEventsPerDay: a = 3,
3568
- onEventClick: i,
3569
- onNavigateToAgenda: f
3651
+ daysAhead: a = 7,
3652
+ maxEventsPerDay: i = 3,
3653
+ onEventClick: l,
3654
+ onNavigateToAgenda: p
3570
3655
  }) {
3571
- const [h, d] = oe(!1), w = X(() => {
3572
- const P = Pe(/* @__PURE__ */ new Date()), W = ht(P, s);
3573
- return t.filter((E) => E.endDate >= P && E.startDate < W);
3574
- }, [t, s]), k = X(
3575
- () => rr(w, a),
3576
- [w, a]
3577
- ), b = X(() => or(t), [t]), I = (P) => {
3578
- d(!1), i?.(P);
3579
- }, F = () => {
3580
- d(!1), f?.();
3656
+ const [h, d] = ie(!1), v = Q(() => {
3657
+ const P = Pe(/* @__PURE__ */ new Date()), W = ht(P, a);
3658
+ return t.filter((T) => T.endDate >= P && T.startDate < W);
3659
+ }, [t, a]), b = Q(
3660
+ () => rr(v, i),
3661
+ [v, i]
3662
+ ), w = Q(() => or(t), [t]), A = (P) => {
3663
+ d(!1), l?.(P);
3664
+ }, $ = () => {
3665
+ d(!1), p?.();
3581
3666
  };
3582
3667
  return /* @__PURE__ */ r(lt, { open: h, onOpenChange: d, children: [
3583
3668
  /* @__PURE__ */ r(
3584
3669
  ct,
3585
3670
  {
3586
- className: m(
3671
+ className: g(
3587
3672
  "relative rounded-xl hover:text-zinc-700 hover:!bg-zinc-300 !bg-zinc-200 text-zinc-600 shadow-none !px-2.5 p-2 max-h-10",
3588
3673
  o
3589
3674
  ),
3590
3675
  children: [
3591
3676
  /* @__PURE__ */ e(Jn, { className: "h-4 w-4" }),
3592
- b > 0 && /* @__PURE__ */ e(
3677
+ w > 0 && /* @__PURE__ */ e(
3593
3678
  Et,
3594
3679
  {
3595
3680
  variant: "destructive",
3596
3681
  className: "absolute -right-4 -top-4 m-3 flex h-5 w-5 items-center justify-center rounded-full bg-primary p-0 text-[10px] font-medium hover:bg-primary",
3597
- children: b > 99 ? "99+" : b
3682
+ children: w > 99 ? "99+" : w
3598
3683
  }
3599
3684
  )
3600
3685
  ]
@@ -3604,13 +3689,13 @@ function zr({
3604
3689
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between border-b p-4", children: [
3605
3690
  /* @__PURE__ */ r("div", { children: [
3606
3691
  /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Upcoming" }),
3607
- /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: b > 0 ? `${b} event${b > 1 ? "s" : ""} today` : "No events today" })
3692
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: w > 0 ? `${w} event${w > 1 ? "s" : ""} today` : "No events today" })
3608
3693
  ] }),
3609
- f && /* @__PURE__ */ r(
3694
+ p && /* @__PURE__ */ r(
3610
3695
  "button",
3611
3696
  {
3612
3697
  type: "button",
3613
- onClick: F,
3698
+ onClick: $,
3614
3699
  className: "text-xs text-primary hover:underline flex items-center gap-1",
3615
3700
  children: [
3616
3701
  "View all",
@@ -3625,19 +3710,19 @@ function zr({
3625
3710
  /* @__PURE__ */ e(Be, { className: "h-4 w-full" }),
3626
3711
  /* @__PURE__ */ e(Be, { className: "h-3 w-3/4" })
3627
3712
  ] })
3628
- ] }, W)) }) : k.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
3713
+ ] }, W)) }) : b.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
3629
3714
  /* @__PURE__ */ e(qn, { className: "mb-2 h-8 w-8 text-muted-foreground/50" }),
3630
3715
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No upcoming events" }),
3631
3716
  /* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground/70", children: [
3632
3717
  "Your schedule is clear for the next ",
3633
- s,
3718
+ a,
3634
3719
  " days"
3635
3720
  ] })
3636
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children: k.map((P) => /* @__PURE__ */ e(
3721
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children: b.map((P) => /* @__PURE__ */ e(
3637
3722
  ar,
3638
3723
  {
3639
3724
  group: P,
3640
- onEventClick: I
3725
+ onEventClick: A
3641
3726
  },
3642
3727
  P.dateKey
3643
3728
  )) }) })
@@ -3692,8 +3777,8 @@ function lr(t) {
3692
3777
  return n.setDate(n.getDate() + 1), t.getFullYear() === n.getFullYear() && t.getMonth() === n.getMonth() && t.getDate() === n.getDate();
3693
3778
  }
3694
3779
  function at(t) {
3695
- const n = t.getHours(), o = t.getMinutes(), s = n >= 12 ? "PM" : "AM";
3696
- return `${n % 12 || 12}:${o.toString().padStart(2, "0")} ${s}`;
3780
+ const n = t.getHours(), o = t.getMinutes(), a = n >= 12 ? "PM" : "AM";
3781
+ return `${n % 12 || 12}:${o.toString().padStart(2, "0")} ${a}`;
3697
3782
  }
3698
3783
  function cr(t) {
3699
3784
  return new Intl.DateTimeFormat("en-US", {
@@ -3707,25 +3792,25 @@ function dr(t) {
3707
3792
  return `${n} - ${o}`;
3708
3793
  }
3709
3794
  function ur(t) {
3710
- return ie(t) ? "Today" : lr(t) ? "Tomorrow" : cr(t);
3795
+ return ce(t) ? "Today" : lr(t) ? "Tomorrow" : cr(t);
3711
3796
  }
3712
3797
  function hr(t, n) {
3713
3798
  const o = /* @__PURE__ */ new Map();
3714
- for (const s of t) {
3715
- const a = Wt(s.startDate), i = o.get(a) ?? [];
3716
- i.push(s), o.set(a, i);
3799
+ for (const a of t) {
3800
+ const i = Wt(a.startDate), l = o.get(i) ?? [];
3801
+ l.push(a), o.set(i, l);
3717
3802
  }
3718
- return Array.from(o.entries()).map(([s, a]) => {
3719
- const i = [...a].sort(
3803
+ return Array.from(o.entries()).map(([a, i]) => {
3804
+ const l = [...i].sort(
3720
3805
  (h, d) => h.startDate.getTime() - d.startDate.getTime()
3721
- ), f = n > 0 ? i.slice(0, n) : i;
3806
+ ), p = n > 0 ? l.slice(0, n) : l;
3722
3807
  return {
3723
- date: new Date(s),
3724
- dateKey: s,
3725
- events: f,
3726
- hasMore: n > 0 && i.length > n
3808
+ date: new Date(a),
3809
+ dateKey: a,
3810
+ events: p,
3811
+ hasMore: n > 0 && l.length > n
3727
3812
  };
3728
- }).sort((s, a) => s.date.getTime() - a.date.getTime());
3813
+ }).sort((a, i) => a.date.getTime() - i.date.getTime());
3729
3814
  }
3730
3815
  function mr({ event: t, onClick: n, compact: o }) {
3731
3816
  return /* @__PURE__ */ r(
@@ -3733,7 +3818,7 @@ function mr({ event: t, onClick: n, compact: o }) {
3733
3818
  {
3734
3819
  type: "button",
3735
3820
  onClick: () => n?.(t),
3736
- className: m(
3821
+ className: g(
3737
3822
  "w-full text-left rounded-lg transition-colors",
3738
3823
  "hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
3739
3824
  "flex items-start gap-3",
@@ -3743,18 +3828,18 @@ function mr({ event: t, onClick: n, compact: o }) {
3743
3828
  /* @__PURE__ */ e(
3744
3829
  "div",
3745
3830
  {
3746
- className: m("shrink-0 rounded-full mt-1", o ? "size-2" : "size-2.5"),
3831
+ className: g("shrink-0 rounded-full mt-1", o ? "size-2" : "size-2.5"),
3747
3832
  style: { backgroundColor: t.color ?? "#3b82f6" }
3748
3833
  }
3749
3834
  ),
3750
3835
  /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
3751
- /* @__PURE__ */ e("p", { className: m("font-medium truncate", o ? "text-xs" : "text-sm"), children: t.title }),
3752
- /* @__PURE__ */ e("p", { className: m("text-muted-foreground truncate", o ? "text-[10px]" : "text-xs"), children: dr(t) })
3836
+ /* @__PURE__ */ e("p", { className: g("font-medium truncate", o ? "text-xs" : "text-sm"), children: t.title }),
3837
+ /* @__PURE__ */ e("p", { className: g("text-muted-foreground truncate", o ? "text-[10px]" : "text-xs"), children: dr(t) })
3753
3838
  ] }),
3754
3839
  n && /* @__PURE__ */ e(
3755
3840
  ft,
3756
3841
  {
3757
- className: m("shrink-0 text-muted-foreground/50", o ? "size-3" : "size-4")
3842
+ className: g("shrink-0 text-muted-foreground/50", o ? "size-3" : "size-4")
3758
3843
  }
3759
3844
  )
3760
3845
  ]
@@ -3765,17 +3850,17 @@ function fr({
3765
3850
  group: t,
3766
3851
  onEventClick: n,
3767
3852
  onViewMore: o,
3768
- compact: s
3853
+ compact: a
3769
3854
  }) {
3770
3855
  return /* @__PURE__ */ r("div", { className: "space-y-1", children: [
3771
- /* @__PURE__ */ r("div", { className: m("flex items-center justify-between px-2", s ? "py-1" : "py-1.5"), children: [
3856
+ /* @__PURE__ */ r("div", { className: g("flex items-center justify-between px-2", a ? "py-1" : "py-1.5"), children: [
3772
3857
  /* @__PURE__ */ e(
3773
3858
  "h3",
3774
3859
  {
3775
- className: m(
3860
+ className: g(
3776
3861
  "font-semibold",
3777
- s ? "text-xs" : "text-sm",
3778
- ie(t.date) && "text-primary"
3862
+ a ? "text-xs" : "text-sm",
3863
+ ce(t.date) && "text-primary"
3779
3864
  ),
3780
3865
  children: ur(t.date)
3781
3866
  }
@@ -3785,92 +3870,92 @@ function fr({
3785
3870
  {
3786
3871
  type: "button",
3787
3872
  onClick: () => o(t.date),
3788
- className: m("text-primary hover:underline", s ? "text-[10px]" : "text-xs"),
3873
+ className: g("text-primary hover:underline", a ? "text-[10px]" : "text-xs"),
3789
3874
  children: "+more"
3790
3875
  }
3791
3876
  )
3792
3877
  ] }),
3793
- /* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((a) => /* @__PURE__ */ e(mr, { event: a, onClick: n, compact: s }, a.id)) })
3878
+ /* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((i) => /* @__PURE__ */ e(mr, { event: i, onClick: n, compact: a }, i.id)) })
3794
3879
  ] });
3795
3880
  }
3796
3881
  function jr({
3797
3882
  events: t,
3798
3883
  daysAhead: n = 7,
3799
3884
  maxEventsPerDay: o = 3,
3800
- onEventClick: s,
3801
- onViewAll: a,
3802
- className: i,
3803
- emptyState: f,
3885
+ onEventClick: a,
3886
+ onViewAll: i,
3887
+ className: l,
3888
+ emptyState: p,
3804
3889
  title: h = "Upcoming",
3805
3890
  showHeader: d = !0,
3806
- compact: w = !1
3891
+ compact: v = !1
3807
3892
  }) {
3808
- const k = it(), b = k?.filteredEvents, I = k?.currentDate ?? /* @__PURE__ */ new Date(), F = t ?? b ?? [], P = X(() => {
3809
- const y = Pe(I), A = new Date(y);
3810
- return A.setDate(A.getDate() + n), F.filter((O) => O.endDate >= y && O.startDate < A);
3811
- }, [F, n, I]), W = X(
3893
+ const b = it(), w = b?.filteredEvents, A = b?.currentDate ?? /* @__PURE__ */ new Date(), $ = t ?? w ?? [], P = Q(() => {
3894
+ const y = Pe(A), z = new Date(y);
3895
+ return z.setDate(z.getDate() + n), $.filter((O) => O.endDate >= y && O.startDate < z);
3896
+ }, [$, n, A]), W = Q(
3812
3897
  () => hr(P, o),
3813
3898
  [P, o]
3814
- ), E = P.length;
3815
- return W.length === 0 ? /* @__PURE__ */ r("div", { className: m("rounded-lg border bg-card", i), children: [
3899
+ ), T = P.length;
3900
+ return W.length === 0 ? /* @__PURE__ */ r("div", { className: g("rounded-lg border bg-card", l), children: [
3816
3901
  d && /* @__PURE__ */ e(
3817
3902
  "div",
3818
3903
  {
3819
- className: m(
3904
+ className: g(
3820
3905
  "border-b px-4 flex items-center justify-between",
3821
- w ? "py-2" : "py-3"
3906
+ v ? "py-2" : "py-3"
3822
3907
  ),
3823
- children: /* @__PURE__ */ e("h2", { className: m("font-semibold", w ? "text-sm" : "text-base"), children: h })
3908
+ children: /* @__PURE__ */ e("h2", { className: g("font-semibold", v ? "text-sm" : "text-base"), children: h })
3824
3909
  }
3825
3910
  ),
3826
3911
  /* @__PURE__ */ e(
3827
3912
  "div",
3828
3913
  {
3829
- className: m(
3914
+ className: g(
3830
3915
  "flex flex-col items-center justify-center text-center",
3831
- w ? "py-6 px-4" : "py-10 px-6"
3916
+ v ? "py-6 px-4" : "py-10 px-6"
3832
3917
  ),
3833
- children: f ?? /* @__PURE__ */ r(pe, { children: [
3918
+ children: p ?? /* @__PURE__ */ r(we, { children: [
3834
3919
  /* @__PURE__ */ e(
3835
3920
  ir,
3836
3921
  {
3837
- className: m("text-muted-foreground/50 mb-2", w ? "size-8" : "size-10")
3922
+ className: g("text-muted-foreground/50 mb-2", v ? "size-8" : "size-10")
3838
3923
  }
3839
3924
  ),
3840
- /* @__PURE__ */ e("p", { className: m("text-muted-foreground", w ? "text-xs" : "text-sm"), children: "No upcoming events" })
3925
+ /* @__PURE__ */ e("p", { className: g("text-muted-foreground", v ? "text-xs" : "text-sm"), children: "No upcoming events" })
3841
3926
  ] })
3842
3927
  }
3843
3928
  )
3844
- ] }) : /* @__PURE__ */ r("div", { className: m("rounded-lg border bg-card overflow-hidden", i), children: [
3929
+ ] }) : /* @__PURE__ */ r("div", { className: g("rounded-lg border bg-card overflow-hidden", l), children: [
3845
3930
  d && /* @__PURE__ */ r(
3846
3931
  "div",
3847
3932
  {
3848
- className: m(
3933
+ className: g(
3849
3934
  "border-b px-4 flex items-center justify-between",
3850
- w ? "py-2" : "py-3"
3935
+ v ? "py-2" : "py-3"
3851
3936
  ),
3852
3937
  children: [
3853
3938
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
3854
- /* @__PURE__ */ e("h2", { className: m("font-semibold", w ? "text-sm" : "text-base"), children: h }),
3939
+ /* @__PURE__ */ e("h2", { className: g("font-semibold", v ? "text-sm" : "text-base"), children: h }),
3855
3940
  /* @__PURE__ */ e(
3856
3941
  "span",
3857
3942
  {
3858
- className: m(
3943
+ className: g(
3859
3944
  "text-muted-foreground bg-muted rounded-full px-2",
3860
- w ? "text-[10px] py-0" : "text-xs py-0.5"
3945
+ v ? "text-[10px] py-0" : "text-xs py-0.5"
3861
3946
  ),
3862
- children: E
3947
+ children: T
3863
3948
  }
3864
3949
  )
3865
3950
  ] }),
3866
- a && /* @__PURE__ */ r(
3951
+ i && /* @__PURE__ */ r(
3867
3952
  "button",
3868
3953
  {
3869
3954
  type: "button",
3870
- onClick: () => a(),
3871
- className: m(
3955
+ onClick: () => i(),
3956
+ className: g(
3872
3957
  "text-primary hover:underline flex items-center gap-0.5",
3873
- w ? "text-xs" : "text-sm"
3958
+ v ? "text-xs" : "text-sm"
3874
3959
  ),
3875
3960
  children: [
3876
3961
  "View all",
@@ -3884,17 +3969,17 @@ function jr({
3884
3969
  /* @__PURE__ */ e(
3885
3970
  "div",
3886
3971
  {
3887
- className: m(
3972
+ className: g(
3888
3973
  "divide-y overflow-auto",
3889
- w ? "p-2 max-h-[280px]" : "p-3 max-h-[400px]"
3974
+ v ? "p-2 max-h-[280px]" : "p-3 max-h-[400px]"
3890
3975
  ),
3891
3976
  children: W.map((y) => /* @__PURE__ */ e(
3892
3977
  fr,
3893
3978
  {
3894
3979
  group: y,
3895
- onEventClick: s,
3896
- onViewMore: a ? (A) => a(A) : void 0,
3897
- compact: w
3980
+ onEventClick: a,
3981
+ onViewMore: i ? (z) => i(z) : void 0,
3982
+ compact: v
3898
3983
  },
3899
3984
  y.dateKey
3900
3985
  ))
@@ -3903,20 +3988,20 @@ function jr({
3903
3988
  ] });
3904
3989
  }
3905
3990
  export {
3906
- zr as A,
3991
+ Ir as A,
3907
3992
  Mr as B,
3908
3993
  kr as C,
3909
3994
  Lr as D,
3910
3995
  Nr as E,
3911
- Dr as I,
3996
+ Cr as I,
3912
3997
  Hr as S,
3913
3998
  Le as T,
3914
- Ir as U,
3999
+ zr as U,
3915
4000
  Sr as V,
3916
4001
  Er as W,
3917
4002
  gn as Y,
3918
4003
  jr as a,
3919
4004
  Tr as b,
3920
- Cr as c
4005
+ Dr as c
3921
4006
  };
3922
- //# sourceMappingURL=agenda-widget-1kak6FM9.js.map
4007
+ //# sourceMappingURL=agenda-widget-wrZfO67A.js.map