@innosolutions/inno-calendar 1.0.43 → 1.0.46
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.
- package/dist/agenda-widget-DDOkgI_F.cjs +2 -0
- package/dist/agenda-widget-DDOkgI_F.cjs.map +1 -0
- package/dist/{agenda-widget-berMFJOV.js → agenda-widget-DfS-16x0.js} +576 -538
- package/dist/agenda-widget-DfS-16x0.js.map +1 -0
- package/dist/components/header/calendar-header.d.ts.map +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/components/inno-calendar.d.ts.map +1 -1
- package/dist/components/views/day-view.d.ts.map +1 -1
- package/dist/components/views/timeline-view.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +3 -3
- package/dist/presets/index.cjs +1 -1
- package/dist/presets/index.mjs +1 -1
- package/dist/{tailwind-calendar-ayfrJLXl.js → tailwind-calendar-C3pTnlko.js} +2 -2
- package/dist/{tailwind-calendar-ayfrJLXl.js.map → tailwind-calendar-C3pTnlko.js.map} +1 -1
- package/dist/{tailwind-calendar-BvRVRpnC.cjs → tailwind-calendar-e6gekmW5.cjs} +2 -2
- package/dist/{tailwind-calendar-BvRVRpnC.cjs.map → tailwind-calendar-e6gekmW5.cjs.map} +1 -1
- package/dist/week-view-DYhRfubT.cjs +11 -0
- package/dist/week-view-DYhRfubT.cjs.map +1 -0
- package/dist/{week-view-BvwBOdd6.js → week-view-DbktCaJh.js} +659 -665
- package/dist/week-view-DbktCaJh.js.map +1 -0
- package/package.json +1 -1
- package/dist/agenda-widget-6s0aP1-t.cjs +0 -2
- package/dist/agenda-widget-6s0aP1-t.cjs.map +0 -1
- package/dist/agenda-widget-berMFJOV.js.map +0 -1
- package/dist/week-view-BvwBOdd6.js.map +0 -1
- package/dist/week-view-COv7gU-n.cjs +0 -11
- package/dist/week-view-COv7gU-n.cjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n, Fragment as ne } from "react/jsx-runtime";
|
|
2
2
|
import { o as Oe, c as qe, C as Je, I as Xe, j as Qe } from "./use-calendar-DR2emWYC.js";
|
|
3
|
-
import { useCallback as oe, useState as se, useEffect as
|
|
4
|
-
import { c as
|
|
5
|
-
import { P as
|
|
3
|
+
import { useCallback as oe, useState as se, useEffect as me, forwardRef as xe, useRef as Ne, useMemo as $, useLayoutEffect as Ze, useImperativeHandle as et } from "react";
|
|
4
|
+
import { c as m } from "./index-DtaLkIY8.js";
|
|
5
|
+
import { P as Pe, i as _e, h as Re, m as Q, q as tt, r as rt, B as ae, s as nt, t as Ce, k as Z, n as ee, l as te, d as ot, C as st, M as De, A as at, W as it, c as lt, u as ct } from "./week-view-DbktCaJh.js";
|
|
6
6
|
import { D as dt, S as ut } from "./slot-selection-context-D2eu2o-7.js";
|
|
7
|
-
import { isToday as q, startOfDay as
|
|
7
|
+
import { isToday as q, startOfDay as pe, endOfDay as Ve, getYearMonths as ht, generateMonthGrid as mt, getEventsForDay as ft, addDays as Ue, formatDateISO as gt } from "./utils.mjs";
|
|
8
8
|
function xt({ view: t, className: r = "" }) {
|
|
9
9
|
return /* @__PURE__ */ e(
|
|
10
10
|
"div",
|
|
@@ -43,17 +43,17 @@ function Ur(t) {
|
|
|
43
43
|
preferences: f,
|
|
44
44
|
locale: c,
|
|
45
45
|
slots: x,
|
|
46
|
-
renderEvent:
|
|
46
|
+
renderEvent: b,
|
|
47
47
|
onViewChange: p,
|
|
48
48
|
onDateChange: M,
|
|
49
49
|
onEventClick: A,
|
|
50
50
|
onSlotSelect: z,
|
|
51
|
-
onFiltersChange:
|
|
51
|
+
onFiltersChange: D,
|
|
52
52
|
className: S,
|
|
53
|
-
children:
|
|
54
|
-
} = t,
|
|
55
|
-
if (
|
|
56
|
-
return /* @__PURE__ */ e("div", { className: S, style: { position: "relative" }, children:
|
|
53
|
+
children: H
|
|
54
|
+
} = t, v = Oe();
|
|
55
|
+
if (v)
|
|
56
|
+
return /* @__PURE__ */ e("div", { className: S, style: { position: "relative" }, children: H ?? /* @__PURE__ */ e(Me, { view: v.view, className: S }) });
|
|
57
57
|
const T = qe({
|
|
58
58
|
events: r,
|
|
59
59
|
resources: o,
|
|
@@ -67,9 +67,9 @@ function Ur(t) {
|
|
|
67
67
|
onDateChange: M,
|
|
68
68
|
onEventClick: A,
|
|
69
69
|
onSlotSelect: z,
|
|
70
|
-
onFiltersChange:
|
|
70
|
+
onFiltersChange: D
|
|
71
71
|
});
|
|
72
|
-
return /* @__PURE__ */ e(Je, { value: T, children: /* @__PURE__ */ e("div", { className: S, style: { position: "relative" }, children:
|
|
72
|
+
return /* @__PURE__ */ e(Je, { value: T, children: /* @__PURE__ */ e("div", { className: S, style: { position: "relative" }, children: H ?? /* @__PURE__ */ e(Me, { view: T.view, className: S }) }) });
|
|
73
73
|
}
|
|
74
74
|
function pt({ className: t }) {
|
|
75
75
|
return /* @__PURE__ */ n(
|
|
@@ -112,7 +112,7 @@ function Ye({ className: t }) {
|
|
|
112
112
|
}
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function ge({ className: t }) {
|
|
116
116
|
return /* @__PURE__ */ n(
|
|
117
117
|
"svg",
|
|
118
118
|
{
|
|
@@ -150,7 +150,7 @@ function vt({ className: t }) {
|
|
|
150
150
|
}
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function ue({ className: t }) {
|
|
154
154
|
return /* @__PURE__ */ e(
|
|
155
155
|
"svg",
|
|
156
156
|
{
|
|
@@ -295,7 +295,7 @@ function le({ className: t }) {
|
|
|
295
295
|
strokeWidth: "2",
|
|
296
296
|
strokeLinecap: "round",
|
|
297
297
|
strokeLinejoin: "round",
|
|
298
|
-
className:
|
|
298
|
+
className: m("animate-spin", t),
|
|
299
299
|
children: /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
300
300
|
}
|
|
301
301
|
);
|
|
@@ -325,7 +325,7 @@ const Dt = {
|
|
|
325
325
|
acceptAllEvents: "Accept all events",
|
|
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 = xe(
|
|
329
329
|
({ onClick: t, label: r, children: o, className: s, variant: a = "ghost", ...i }, g) => /* @__PURE__ */ n(Z, { children: [
|
|
330
330
|
/* @__PURE__ */ e(ee, { asChild: !0, children: /* @__PURE__ */ e(
|
|
331
331
|
"button",
|
|
@@ -333,7 +333,7 @@ const Dt = {
|
|
|
333
333
|
type: "button",
|
|
334
334
|
ref: g,
|
|
335
335
|
onClick: t,
|
|
336
|
-
className:
|
|
336
|
+
className: m(
|
|
337
337
|
"h-8 w-8 rounded-full flex items-center justify-center transition-colors",
|
|
338
338
|
a === "ghost" && "hover:bg-zinc-100 dark:hover:bg-zinc-800 text-zinc-600 dark:text-zinc-400",
|
|
339
339
|
a === "destructive" && "hover:bg-red-50 dark:hover:bg-red-950/30 text-zinc-600 dark:text-zinc-400 hover:text-red-600",
|
|
@@ -347,13 +347,13 @@ const Dt = {
|
|
|
347
347
|
/* @__PURE__ */ e(te, { side: "bottom", className: "text-xs", children: r })
|
|
348
348
|
] })
|
|
349
349
|
);
|
|
350
|
-
|
|
350
|
+
he.displayName = "IconButton";
|
|
351
351
|
function Mt({ src: t, alt: r, initials: o, className: s, isClient: a }) {
|
|
352
352
|
const [i, g] = se(!1);
|
|
353
353
|
return /* @__PURE__ */ e(
|
|
354
354
|
"div",
|
|
355
355
|
{
|
|
356
|
-
className:
|
|
356
|
+
className: m(
|
|
357
357
|
"relative h-7 w-7 rounded-full overflow-hidden shrink-0",
|
|
358
358
|
s
|
|
359
359
|
),
|
|
@@ -368,7 +368,7 @@ function Mt({ src: t, alt: r, initials: o, className: s, isClient: a }) {
|
|
|
368
368
|
) : /* @__PURE__ */ e(
|
|
369
369
|
"div",
|
|
370
370
|
{
|
|
371
|
-
className:
|
|
371
|
+
className: m(
|
|
372
372
|
"h-full w-full flex items-center justify-center text-[10px] font-medium",
|
|
373
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"
|
|
374
374
|
),
|
|
@@ -383,11 +383,11 @@ function Se({
|
|
|
383
383
|
isEventCanceled: r = !1,
|
|
384
384
|
labels: o
|
|
385
385
|
}) {
|
|
386
|
-
const s = t.name || "Unknown", a = s.split(" ").map((M) => M[0]).join("").toUpperCase().slice(0, 2), i = t.isOrganizer ?? !1, g = t.isConfirmed, f = g === !0, c = g === !1, x = t.isClient ?? !1,
|
|
386
|
+
const s = t.name || "Unknown", a = s.split(" ").map((M) => M[0]).join("").toUpperCase().slice(0, 2), i = t.isOrganizer ?? !1, g = t.isConfirmed, f = g === !0, c = g === !1, x = t.isClient ?? !1, b = t.profilePicture || t.avatar, p = r;
|
|
387
387
|
return /* @__PURE__ */ n(
|
|
388
388
|
"div",
|
|
389
389
|
{
|
|
390
|
-
className:
|
|
390
|
+
className: m(
|
|
391
391
|
"flex items-center gap-3 py-0",
|
|
392
392
|
p && "opacity-60"
|
|
393
393
|
),
|
|
@@ -396,20 +396,20 @@ function Se({
|
|
|
396
396
|
/* @__PURE__ */ e(
|
|
397
397
|
Mt,
|
|
398
398
|
{
|
|
399
|
-
src:
|
|
399
|
+
src: b,
|
|
400
400
|
alt: s,
|
|
401
401
|
initials: a,
|
|
402
402
|
isClient: x,
|
|
403
|
-
className:
|
|
403
|
+
className: m(p && "grayscale")
|
|
404
404
|
}
|
|
405
405
|
),
|
|
406
|
-
p || c ? /* @__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(
|
|
406
|
+
p || c ? /* @__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(ge, { className: "h-2 w-2 text-red-600 dark:text-red-400 stroke-[3]" }) }) }) : f ? /* @__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(ue, { className: "h-2 w-2 text-green-600 dark:text-green-400 stroke-[3]" }) }) }) : null
|
|
407
407
|
] }),
|
|
408
408
|
/* @__PURE__ */ n("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:
|
|
412
|
+
className: m(
|
|
413
413
|
"text-sm text-zinc-900 dark:text-zinc-100 truncate",
|
|
414
414
|
p && "line-through text-zinc-500 dark:text-zinc-500"
|
|
415
415
|
),
|
|
@@ -429,13 +429,13 @@ function St({
|
|
|
429
429
|
title: o,
|
|
430
430
|
children: s
|
|
431
431
|
}) {
|
|
432
|
-
return
|
|
432
|
+
return me(() => {
|
|
433
433
|
if (!t) return;
|
|
434
434
|
const a = (i) => {
|
|
435
435
|
i.key === "Escape" && r(!1);
|
|
436
436
|
};
|
|
437
437
|
return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
|
|
438
|
-
}, [t, r]),
|
|
438
|
+
}, [t, r]), me(() => (t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
439
439
|
document.body.style.overflow = "";
|
|
440
440
|
}), [t]), t ? /* @__PURE__ */ n("div", { className: "fixed inset-0 z-50", children: [
|
|
441
441
|
/* @__PURE__ */ e(
|
|
@@ -513,7 +513,7 @@ function zt(t, r) {
|
|
|
513
513
|
day: "numeric"
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function Ht(t, r) {
|
|
517
517
|
const o = {
|
|
518
518
|
hour: "2-digit",
|
|
519
519
|
minute: "2-digit",
|
|
@@ -521,7 +521,7 @@ function Lt(t, r) {
|
|
|
521
521
|
};
|
|
522
522
|
return `${t.toLocaleTimeString(void 0, o)} – ${r.toLocaleTimeString(void 0, o)}`;
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function Lt(t) {
|
|
525
525
|
return t.toLocaleDateString(void 0, {
|
|
526
526
|
day: "2-digit",
|
|
527
527
|
month: "short",
|
|
@@ -532,7 +532,7 @@ function Ht(t) {
|
|
|
532
532
|
}
|
|
533
533
|
function Tt(t) {
|
|
534
534
|
const [r, o] = se(() => typeof window < "u" ? window.matchMedia(t).matches : !1);
|
|
535
|
-
return
|
|
535
|
+
return me(() => {
|
|
536
536
|
if (typeof window > "u") return;
|
|
537
537
|
const s = window.matchMedia(t), a = (i) => o(i.matches);
|
|
538
538
|
return s.addEventListener("change", a), () => s.removeEventListener("change", a);
|
|
@@ -549,39 +549,39 @@ function Ee({
|
|
|
549
549
|
onAccept: f,
|
|
550
550
|
onDecline: c,
|
|
551
551
|
onConfirmMeeting: x,
|
|
552
|
-
canEdit:
|
|
552
|
+
canEdit: b = !0,
|
|
553
553
|
canDelete: p = !1,
|
|
554
554
|
canCancel: M = !0,
|
|
555
555
|
isCurrentUserParticipant: A = !1,
|
|
556
556
|
isCurrentUserClient: z = !1,
|
|
557
|
-
currentUserAcceptStatus:
|
|
557
|
+
currentUserAcceptStatus: D,
|
|
558
558
|
isAcceptLoading: S = !1,
|
|
559
|
-
isDeclineLoading:
|
|
560
|
-
isConfirmLoading:
|
|
559
|
+
isDeclineLoading: H = !1,
|
|
560
|
+
isConfirmLoading: v = !1,
|
|
561
561
|
isDeleteLoading: T = !1,
|
|
562
|
-
renderParticipant:
|
|
562
|
+
renderParticipant: C,
|
|
563
563
|
renderHeaderActions: F,
|
|
564
564
|
renderCancelReason: R,
|
|
565
565
|
renderDeleteConfirmation: V,
|
|
566
|
-
formatDate:
|
|
567
|
-
formatTimeRange: O =
|
|
566
|
+
formatDate: B = zt,
|
|
567
|
+
formatTimeRange: O = Ht
|
|
568
568
|
}) {
|
|
569
|
-
const [
|
|
569
|
+
const [j, _] = se(!1), U = !(t.isCanceled || t.meetingTookPlace), d = t.isRecurring ?? !1, l = t.participantDetails, u = t.participantsNames || [], w = l && l.length > 0, k = D === !0, y = D === !1, L = A && !z && U, E = w ? l.filter((W) => W.isConfirmed).length : t.isAccepted ? u.length : 0, P = w ? l.length : u.length, Y = t.scheduleTypeColor || t.hexColor || "#039BE5", K = oe(() => t.startDate ? B(t.startDate) : r.noDateProvided, [t.startDate, B, r.noDateProvided]), J = oe(() => t.startDate && t.endDate ? O(t.startDate, t.endDate) : null, [t.startDate, t.endDate, O]), ie = () => {
|
|
570
570
|
s(), a?.(t);
|
|
571
|
-
},
|
|
571
|
+
}, h = () => {
|
|
572
572
|
s(), g?.(t);
|
|
573
573
|
}, N = () => {
|
|
574
|
-
|
|
575
|
-
},
|
|
576
|
-
i?.(t),
|
|
574
|
+
_(!0);
|
|
575
|
+
}, I = () => {
|
|
576
|
+
i?.(t), _(!1);
|
|
577
577
|
};
|
|
578
578
|
return o ? /* @__PURE__ */ e("div", { className: "flex h-48 items-center justify-center", children: /* @__PURE__ */ e(le, { className: "h-6 w-6 text-zinc-400" }) }) : /* @__PURE__ */ n(Q, { delayDuration: 300, children: [
|
|
579
579
|
/* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5 p-3", children: [
|
|
580
580
|
/* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children: F ? F({ onClose: s }) : /* @__PURE__ */ n(ne, { children: [
|
|
581
|
-
U &&
|
|
582
|
-
U && M && g && /* @__PURE__ */ e(
|
|
581
|
+
U && b && a && /* @__PURE__ */ e(he, { onClick: ie, label: r.edit, children: /* @__PURE__ */ e(pt, { className: "h-[18px] w-[18px]" }) }),
|
|
582
|
+
U && M && g && /* @__PURE__ */ e(he, { onClick: h, label: r.cancel, children: /* @__PURE__ */ e(vt, { className: "h-[18px] w-[18px]" }) }),
|
|
583
583
|
p && i && /* @__PURE__ */ e(
|
|
584
|
-
|
|
584
|
+
he,
|
|
585
585
|
{
|
|
586
586
|
onClick: N,
|
|
587
587
|
label: r.delete,
|
|
@@ -589,7 +589,7 @@ function Ee({
|
|
|
589
589
|
children: /* @__PURE__ */ e(Ye, { className: "h-[18px] w-[18px]" })
|
|
590
590
|
}
|
|
591
591
|
),
|
|
592
|
-
/* @__PURE__ */ e(
|
|
592
|
+
/* @__PURE__ */ e(he, { onClick: s, label: r.close, children: /* @__PURE__ */ e(ge, { className: "h-[18px] w-[18px]" }) })
|
|
593
593
|
] }) }),
|
|
594
594
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
|
|
595
595
|
/* @__PURE__ */ e(
|
|
@@ -604,7 +604,7 @@ function Ee({
|
|
|
604
604
|
/* @__PURE__ */ e(
|
|
605
605
|
"h2",
|
|
606
606
|
{
|
|
607
|
-
className:
|
|
607
|
+
className: m(
|
|
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
|
),
|
|
@@ -616,7 +616,7 @@ function Ee({
|
|
|
616
616
|
r.completed
|
|
617
617
|
] }),
|
|
618
618
|
t.isCanceled && /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400 text-xs font-medium", children: [
|
|
619
|
-
/* @__PURE__ */ e(
|
|
619
|
+
/* @__PURE__ */ e(ge, { className: "h-3 w-3" }),
|
|
620
620
|
r.canceled
|
|
621
621
|
] })
|
|
622
622
|
] }),
|
|
@@ -627,7 +627,7 @@ function Ee({
|
|
|
627
627
|
/* @__PURE__ */ e("span", { children: J() })
|
|
628
628
|
] })
|
|
629
629
|
] }),
|
|
630
|
-
|
|
630
|
+
d && t.recurrenceSummary && /* @__PURE__ */ e("div", { className: "text-sm text-zinc-500 dark:text-zinc-500", children: t.recurrenceSummary })
|
|
631
631
|
] })
|
|
632
632
|
] }) }),
|
|
633
633
|
t.isCanceled && /* @__PURE__ */ e("div", { className: "mx-4 p-3 rounded-lg bg-red-50 dark:bg-red-950/30", children: R ? R(t) : /* @__PURE__ */ e("div", { className: "flex items-start gap-0", children: /* @__PURE__ */ n("div", { className: "flex-1 min-w-0", children: [
|
|
@@ -640,7 +640,7 @@ function Ee({
|
|
|
640
640
|
t.canceledDate && /* @__PURE__ */ n("div", { className: "mt-1.5 text-xs text-red-500/70 dark:text-red-400/60", children: [
|
|
641
641
|
r.canceledOn,
|
|
642
642
|
" ",
|
|
643
|
-
|
|
643
|
+
Lt(t.canceledDate)
|
|
644
644
|
] })
|
|
645
645
|
] }) }) }),
|
|
646
646
|
/* @__PURE__ */ n("div", { className: "space-y-0.5", children: [
|
|
@@ -648,16 +648,16 @@ function Ee({
|
|
|
648
648
|
/* @__PURE__ */ e(kt, { 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
|
-
(
|
|
651
|
+
(w || u.length > 0) && /* @__PURE__ */ n("div", { className: "flex items-start gap-2 py-0", children: [
|
|
652
652
|
/* @__PURE__ */ e(yt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
653
653
|
/* @__PURE__ */ n("div", { className: "flex-1", children: [
|
|
654
654
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-0", children: [
|
|
655
655
|
/* @__PURE__ */ n("span", { className: "text-sm text-zinc-900 dark:text-zinc-100 font-medium", children: [
|
|
656
|
-
|
|
656
|
+
P,
|
|
657
657
|
" ",
|
|
658
|
-
|
|
658
|
+
P !== 1 ? r.guests : r.guest
|
|
659
659
|
] }),
|
|
660
|
-
|
|
660
|
+
P > 0 && /* @__PURE__ */ n("span", { className: "text-xs text-zinc-500", children: [
|
|
661
661
|
"(",
|
|
662
662
|
E,
|
|
663
663
|
" ",
|
|
@@ -666,38 +666,38 @@ function Ee({
|
|
|
666
666
|
] })
|
|
667
667
|
] }),
|
|
668
668
|
/* @__PURE__ */ n("div", { className: "mt-2 space-y-2", children: [
|
|
669
|
-
|
|
670
|
-
(
|
|
669
|
+
w ? l.slice(0, 6).map(
|
|
670
|
+
(W, G) => C ? C(W, G) : /* @__PURE__ */ e(
|
|
671
671
|
Se,
|
|
672
672
|
{
|
|
673
|
-
participant:
|
|
673
|
+
participant: W,
|
|
674
674
|
isEventCanceled: t.isCanceled,
|
|
675
675
|
labels: r
|
|
676
676
|
},
|
|
677
|
-
|
|
677
|
+
W.id
|
|
678
678
|
)
|
|
679
|
-
) :
|
|
680
|
-
const
|
|
679
|
+
) : u.slice(0, 6).map((W, G) => {
|
|
680
|
+
const fe = {
|
|
681
681
|
id: String(G),
|
|
682
|
-
name:
|
|
682
|
+
name: W,
|
|
683
683
|
email: "",
|
|
684
684
|
isConfirmed: t.isAccepted,
|
|
685
685
|
isOrganizer: G === 0,
|
|
686
686
|
isClient: !1
|
|
687
687
|
};
|
|
688
|
-
return
|
|
688
|
+
return C ? C(fe, G) : /* @__PURE__ */ e(
|
|
689
689
|
Se,
|
|
690
690
|
{
|
|
691
|
-
participant:
|
|
691
|
+
participant: fe,
|
|
692
692
|
isEventCanceled: t.isCanceled,
|
|
693
693
|
labels: r
|
|
694
694
|
},
|
|
695
|
-
|
|
695
|
+
W
|
|
696
696
|
);
|
|
697
697
|
}),
|
|
698
|
-
|
|
698
|
+
P > 6 && /* @__PURE__ */ n("div", { className: "text-xs text-zinc-500 py-1.5 pl-10", children: [
|
|
699
699
|
"+",
|
|
700
|
-
|
|
700
|
+
P - 6,
|
|
701
701
|
" ",
|
|
702
702
|
r.more
|
|
703
703
|
] })
|
|
@@ -710,27 +710,27 @@ function Ee({
|
|
|
710
710
|
] }),
|
|
711
711
|
/* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
|
|
712
712
|
/* @__PURE__ */ e(Nt, { 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:
|
|
713
|
+
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: w && l.find((W) => W.isOrganizer)?.name || u[0] || "Calendar" })
|
|
714
714
|
] })
|
|
715
715
|
] }),
|
|
716
|
-
|
|
717
|
-
|
|
716
|
+
L && f && c && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 mt-3 py-3", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
717
|
+
d ? /* @__PURE__ */ n(tt, { children: [
|
|
718
718
|
/* @__PURE__ */ e(rt, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "flex", children: [
|
|
719
719
|
/* @__PURE__ */ e(
|
|
720
720
|
ae,
|
|
721
721
|
{
|
|
722
722
|
size: "sm",
|
|
723
723
|
variant: "outline",
|
|
724
|
-
className:
|
|
724
|
+
className: m(
|
|
725
725
|
"rounded-r-none gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
726
726
|
k && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
727
727
|
),
|
|
728
|
-
onClick: (
|
|
729
|
-
|
|
728
|
+
onClick: (W) => {
|
|
729
|
+
W.stopPropagation(), k || f(t);
|
|
730
730
|
},
|
|
731
731
|
disabled: S,
|
|
732
732
|
children: S ? /* @__PURE__ */ e(le, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(ne, { children: [
|
|
733
|
-
k && /* @__PURE__ */ e(
|
|
733
|
+
k && /* @__PURE__ */ e(ue, { className: "h-3.5 w-3.5" }),
|
|
734
734
|
r.going
|
|
735
735
|
] })
|
|
736
736
|
}
|
|
@@ -740,7 +740,7 @@ function Ee({
|
|
|
740
740
|
{
|
|
741
741
|
size: "sm",
|
|
742
742
|
variant: "outline",
|
|
743
|
-
className:
|
|
743
|
+
className: m(
|
|
744
744
|
"rounded-l-none px-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
745
745
|
k && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
746
746
|
),
|
|
@@ -752,19 +752,19 @@ function Ee({
|
|
|
752
752
|
/* @__PURE__ */ n(
|
|
753
753
|
Ce,
|
|
754
754
|
{
|
|
755
|
-
className:
|
|
755
|
+
className: m(
|
|
756
756
|
"gap-1.5 h-8 !border-none !bg-green-50 text-green-800 hover:!bg-green-100",
|
|
757
757
|
k && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
758
758
|
),
|
|
759
759
|
onClick: () => f(t),
|
|
760
760
|
children: [
|
|
761
|
-
/* @__PURE__ */ e(
|
|
761
|
+
/* @__PURE__ */ e(ue, { className: "h-3.5 w-3.5 mr-2 text-green-600" }),
|
|
762
762
|
r.acceptThisEvent
|
|
763
763
|
]
|
|
764
764
|
}
|
|
765
765
|
),
|
|
766
766
|
/* @__PURE__ */ n(Ce, { onClick: () => f(t), children: [
|
|
767
|
-
/* @__PURE__ */ e(
|
|
767
|
+
/* @__PURE__ */ e(ue, { className: "h-3.5 w-3.5 mr-2 text-green-600" }),
|
|
768
768
|
r.acceptAllEvents
|
|
769
769
|
] })
|
|
770
770
|
] })
|
|
@@ -773,7 +773,7 @@ function Ee({
|
|
|
773
773
|
{
|
|
774
774
|
size: "sm",
|
|
775
775
|
variant: "outline",
|
|
776
|
-
className:
|
|
776
|
+
className: m(
|
|
777
777
|
"gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
778
778
|
k && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
779
779
|
),
|
|
@@ -782,7 +782,7 @@ function Ee({
|
|
|
782
782
|
},
|
|
783
783
|
disabled: S,
|
|
784
784
|
children: S ? /* @__PURE__ */ e(le, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(ne, { children: [
|
|
785
|
-
k && /* @__PURE__ */ e(
|
|
785
|
+
k && /* @__PURE__ */ e(ue, { className: "h-3.5 w-3.5" }),
|
|
786
786
|
r.going
|
|
787
787
|
] })
|
|
788
788
|
}
|
|
@@ -792,16 +792,16 @@ function Ee({
|
|
|
792
792
|
{
|
|
793
793
|
size: "sm",
|
|
794
794
|
variant: "outline",
|
|
795
|
-
className:
|
|
795
|
+
className: m(
|
|
796
796
|
"gap-1.5 h-8 !border-none !bg-rose-100 text-rose-800 hover:!bg-rose-200",
|
|
797
|
-
|
|
797
|
+
y && "!bg-rose-700 !text-white hover:!bg-rose-700"
|
|
798
798
|
),
|
|
799
799
|
onClick: () => {
|
|
800
|
-
|
|
800
|
+
y || c(t);
|
|
801
801
|
},
|
|
802
|
-
disabled:
|
|
803
|
-
children:
|
|
804
|
-
|
|
802
|
+
disabled: H,
|
|
803
|
+
children: H ? /* @__PURE__ */ e(le, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(ne, { children: [
|
|
804
|
+
y && /* @__PURE__ */ e(ge, { className: "h-3.5 w-3.5" }),
|
|
805
805
|
r.notGoing
|
|
806
806
|
] })
|
|
807
807
|
}
|
|
@@ -814,28 +814,28 @@ function Ee({
|
|
|
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
816
|
onClick: () => x(t),
|
|
817
|
-
disabled:
|
|
817
|
+
disabled: v,
|
|
818
818
|
children: [
|
|
819
|
-
|
|
819
|
+
v && /* @__PURE__ */ e(le, { className: "h-4 w-4 mr-2" }),
|
|
820
820
|
r.confirmMeeting
|
|
821
821
|
]
|
|
822
822
|
}
|
|
823
823
|
) })
|
|
824
824
|
] }),
|
|
825
|
-
V ?
|
|
826
|
-
onConfirm:
|
|
827
|
-
onCancel: () =>
|
|
825
|
+
V ? j && V({
|
|
826
|
+
onConfirm: I,
|
|
827
|
+
onCancel: () => _(!1),
|
|
828
828
|
isLoading: T
|
|
829
829
|
}) : /* @__PURE__ */ e(
|
|
830
830
|
Et,
|
|
831
831
|
{
|
|
832
|
-
open:
|
|
833
|
-
onOpenChange:
|
|
832
|
+
open: j,
|
|
833
|
+
onOpenChange: _,
|
|
834
834
|
title: r.deleteConfirmTitle,
|
|
835
835
|
description: r.deleteConfirmDescription,
|
|
836
836
|
cancelLabel: r.cancel,
|
|
837
837
|
confirmLabel: r.delete,
|
|
838
|
-
onConfirm:
|
|
838
|
+
onConfirm: I,
|
|
839
839
|
isLoading: T
|
|
840
840
|
}
|
|
841
841
|
)
|
|
@@ -852,68 +852,68 @@ function Yr({
|
|
|
852
852
|
onDelete: f,
|
|
853
853
|
onCancel: c,
|
|
854
854
|
onAccept: x,
|
|
855
|
-
onDecline:
|
|
855
|
+
onDecline: b,
|
|
856
856
|
onConfirmMeeting: p,
|
|
857
857
|
canEdit: M = !0,
|
|
858
858
|
canDelete: A = !1,
|
|
859
859
|
canCancel: z = !0,
|
|
860
|
-
isCurrentUserParticipant:
|
|
860
|
+
isCurrentUserParticipant: D,
|
|
861
861
|
isCurrentUserClient: S,
|
|
862
|
-
currentUserAcceptStatus:
|
|
863
|
-
isAcceptLoading:
|
|
862
|
+
currentUserAcceptStatus: H,
|
|
863
|
+
isAcceptLoading: v,
|
|
864
864
|
isDeclineLoading: T,
|
|
865
|
-
isConfirmLoading:
|
|
865
|
+
isConfirmLoading: C,
|
|
866
866
|
isDeleteLoading: F,
|
|
867
867
|
renderParticipant: R,
|
|
868
868
|
renderHeaderActions: V,
|
|
869
|
-
renderCancelReason:
|
|
869
|
+
renderCancelReason: B,
|
|
870
870
|
renderDeleteConfirmation: O,
|
|
871
|
-
formatDate:
|
|
872
|
-
formatTimeRange:
|
|
871
|
+
formatDate: j,
|
|
872
|
+
formatTimeRange: _,
|
|
873
873
|
className: U,
|
|
874
|
-
width:
|
|
874
|
+
width: d = 360
|
|
875
875
|
}) {
|
|
876
|
-
const l = Tt("(min-width: 768px)"),
|
|
876
|
+
const l = Tt("(min-width: 768px)"), u = { ...Dt, ...i }, w = oe(() => {
|
|
877
877
|
s?.(!1);
|
|
878
878
|
}, [s]), k = {
|
|
879
879
|
event: t,
|
|
880
|
-
labels:
|
|
880
|
+
labels: u,
|
|
881
881
|
isLoading: a,
|
|
882
|
-
onClose:
|
|
882
|
+
onClose: w,
|
|
883
883
|
onEdit: g,
|
|
884
884
|
onDelete: f,
|
|
885
885
|
onCancel: c,
|
|
886
886
|
onAccept: x,
|
|
887
|
-
onDecline:
|
|
887
|
+
onDecline: b,
|
|
888
888
|
onConfirmMeeting: p,
|
|
889
889
|
canEdit: M,
|
|
890
890
|
canDelete: A,
|
|
891
891
|
canCancel: z,
|
|
892
|
-
isCurrentUserParticipant:
|
|
892
|
+
isCurrentUserParticipant: D,
|
|
893
893
|
isCurrentUserClient: S,
|
|
894
|
-
currentUserAcceptStatus:
|
|
895
|
-
isAcceptLoading:
|
|
894
|
+
currentUserAcceptStatus: H,
|
|
895
|
+
isAcceptLoading: v,
|
|
896
896
|
isDeclineLoading: T,
|
|
897
|
-
isConfirmLoading:
|
|
897
|
+
isConfirmLoading: C,
|
|
898
898
|
isDeleteLoading: F,
|
|
899
899
|
renderParticipant: R,
|
|
900
900
|
renderHeaderActions: V,
|
|
901
|
-
renderCancelReason:
|
|
901
|
+
renderCancelReason: B,
|
|
902
902
|
renderDeleteConfirmation: O,
|
|
903
|
-
formatDate:
|
|
904
|
-
formatTimeRange:
|
|
903
|
+
formatDate: j,
|
|
904
|
+
formatTimeRange: _
|
|
905
905
|
};
|
|
906
|
-
return l ? /* @__PURE__ */ n(
|
|
906
|
+
return l ? /* @__PURE__ */ n(Pe, { open: o ?? !1, onOpenChange: s ?? (() => {
|
|
907
907
|
}), children: [
|
|
908
|
-
/* @__PURE__ */ e(
|
|
908
|
+
/* @__PURE__ */ e(_e, { asChild: !0, children: r }),
|
|
909
909
|
/* @__PURE__ */ e(
|
|
910
910
|
Re,
|
|
911
911
|
{
|
|
912
|
-
className:
|
|
912
|
+
className: m(
|
|
913
913
|
"p-0 shadow-lg !rounded-2xl bg-white dark:bg-zinc-900 overflow-hidden border z-50",
|
|
914
914
|
U
|
|
915
915
|
),
|
|
916
|
-
style: { width:
|
|
916
|
+
style: { width: d },
|
|
917
917
|
align: "center",
|
|
918
918
|
side: "bottom",
|
|
919
919
|
sideOffset: 4,
|
|
@@ -934,7 +934,7 @@ function Yr({
|
|
|
934
934
|
)
|
|
935
935
|
] });
|
|
936
936
|
}
|
|
937
|
-
const
|
|
937
|
+
const ve = 44, ze = 4, It = 56, He = 8, we = 80, ce = 140, Le = 100, Te = 2, jt = 8, Wt = 18;
|
|
938
938
|
function At(t) {
|
|
939
939
|
return t.split(" ").map((r) => r[0]).join("").toUpperCase().slice(0, 2);
|
|
940
940
|
}
|
|
@@ -976,11 +976,11 @@ function Ie(t) {
|
|
|
976
976
|
}
|
|
977
977
|
return o;
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function Pt({ src: t, alt: r, fallback: o, className: s }) {
|
|
980
980
|
return /* @__PURE__ */ e(
|
|
981
981
|
"div",
|
|
982
982
|
{
|
|
983
|
-
className:
|
|
983
|
+
className: m(
|
|
984
984
|
"relative flex shrink-0 overflow-hidden rounded-sm border bg-muted",
|
|
985
985
|
s
|
|
986
986
|
),
|
|
@@ -995,9 +995,9 @@ function _t({ src: t, alt: r, fallback: o, className: s }) {
|
|
|
995
995
|
}
|
|
996
996
|
);
|
|
997
997
|
}
|
|
998
|
-
const
|
|
999
|
-
function
|
|
1000
|
-
daysToShow: t =
|
|
998
|
+
const _t = 7;
|
|
999
|
+
function de({
|
|
1000
|
+
daysToShow: t = _t,
|
|
1001
1001
|
events: r,
|
|
1002
1002
|
users: o = [],
|
|
1003
1003
|
selectedDate: s,
|
|
@@ -1007,110 +1007,111 @@ function we({
|
|
|
1007
1007
|
className: f,
|
|
1008
1008
|
getEventUserId: c,
|
|
1009
1009
|
renderPopover: x,
|
|
1010
|
-
slots:
|
|
1010
|
+
slots: b,
|
|
1011
1011
|
classNames: p
|
|
1012
1012
|
}) {
|
|
1013
|
-
const M = Ne(null), A = s ?? /* @__PURE__ */ new Date(), z = !0,
|
|
1013
|
+
const M = Ne(null), A = s ?? /* @__PURE__ */ new Date(), z = !0, D = g?.from ?? jt, S = g?.to ?? Wt, H = S - D, v = $(() => {
|
|
1014
1014
|
const l = new Date(A);
|
|
1015
1015
|
if (t === 1 || t === 3)
|
|
1016
1016
|
return l.setHours(0, 0, 0, 0), l;
|
|
1017
|
-
const
|
|
1018
|
-
return l.setDate(l.getDate() +
|
|
1019
|
-
}, [A, t]), T =
|
|
1020
|
-
() => Ft(
|
|
1021
|
-
[
|
|
1022
|
-
),
|
|
1023
|
-
() => Bt(T,
|
|
1024
|
-
[z, T,
|
|
1017
|
+
const u = l.getDay(), w = u === 0 ? -6 : 1 - u;
|
|
1018
|
+
return l.setDate(l.getDate() + w), l.setHours(0, 0, 0, 0), l;
|
|
1019
|
+
}, [A, t]), T = $(
|
|
1020
|
+
() => Ft(v, t),
|
|
1021
|
+
[v, t]
|
|
1022
|
+
), C = $(
|
|
1023
|
+
() => Bt(T, D, S),
|
|
1024
|
+
[z, T, D, S]
|
|
1025
1025
|
), R = c ?? ((l) => {
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
if (
|
|
1029
|
-
|
|
1026
|
+
if (l.resourceId) return l.resourceId;
|
|
1027
|
+
const u = l.data;
|
|
1028
|
+
if (u?.userId) return String(u.userId);
|
|
1029
|
+
if (u?.user && typeof u.user == "object" && u.user.id)
|
|
1030
|
+
return String(u.user.id);
|
|
1030
1031
|
if (l.user?.id) return l.user.id;
|
|
1031
1032
|
if (l.participants?.[0]?.id) return l.participants[0].id;
|
|
1032
|
-
}), V =
|
|
1033
|
+
}), V = $(() => {
|
|
1033
1034
|
const l = /* @__PURE__ */ new Map();
|
|
1034
|
-
for (const
|
|
1035
|
-
l.set(
|
|
1036
|
-
id:
|
|
1037
|
-
name:
|
|
1038
|
-
avatar:
|
|
1039
|
-
email:
|
|
1035
|
+
for (const u of o)
|
|
1036
|
+
l.set(u.id, {
|
|
1037
|
+
id: u.id,
|
|
1038
|
+
name: u.name,
|
|
1039
|
+
avatar: u.avatar ?? void 0,
|
|
1040
|
+
email: u.email
|
|
1040
1041
|
});
|
|
1041
|
-
for (const
|
|
1042
|
-
const k =
|
|
1042
|
+
for (const u of r) {
|
|
1043
|
+
const k = u.data?.user;
|
|
1043
1044
|
k?.id && !l.has(k.id) && l.set(k.id, {
|
|
1044
1045
|
id: k.id,
|
|
1045
1046
|
name: k.name ?? "",
|
|
1046
1047
|
avatar: k.avatar ?? void 0,
|
|
1047
1048
|
email: k.email
|
|
1048
|
-
}),
|
|
1049
|
-
id:
|
|
1050
|
-
name:
|
|
1051
|
-
avatar:
|
|
1052
|
-
email:
|
|
1049
|
+
}), u.user?.id && !l.has(u.user.id) && l.set(u.user.id, {
|
|
1050
|
+
id: u.user.id,
|
|
1051
|
+
name: u.user.name,
|
|
1052
|
+
avatar: u.user.avatar ?? void 0,
|
|
1053
|
+
email: u.user.email
|
|
1053
1054
|
});
|
|
1054
|
-
for (const
|
|
1055
|
-
|
|
1056
|
-
id:
|
|
1057
|
-
name:
|
|
1058
|
-
avatar:
|
|
1059
|
-
email:
|
|
1055
|
+
for (const y of u.participants || [])
|
|
1056
|
+
y.id && !l.has(y.id) && l.set(y.id, {
|
|
1057
|
+
id: y.id,
|
|
1058
|
+
name: y.name,
|
|
1059
|
+
avatar: y.avatar ?? void 0,
|
|
1060
|
+
email: y.email
|
|
1060
1061
|
});
|
|
1061
1062
|
}
|
|
1062
1063
|
return Array.from(l.values());
|
|
1063
|
-
}, [o, r]),
|
|
1064
|
-
const l = [],
|
|
1065
|
-
for (const
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
for (const
|
|
1069
|
-
const
|
|
1070
|
-
(
|
|
1064
|
+
}, [o, r]), B = $(() => {
|
|
1065
|
+
const l = [], u = /* @__PURE__ */ new Map();
|
|
1066
|
+
for (const y of V)
|
|
1067
|
+
u.set(y.id, []);
|
|
1068
|
+
u.set("unassigned", []);
|
|
1069
|
+
for (const y of r) {
|
|
1070
|
+
const L = R(y) ?? "unassigned";
|
|
1071
|
+
(u.get(L) ?? u.get("unassigned")).push(y);
|
|
1071
1072
|
}
|
|
1072
|
-
const
|
|
1073
|
-
const
|
|
1074
|
-
for (const E of
|
|
1075
|
-
const
|
|
1073
|
+
const w = (y) => {
|
|
1074
|
+
const L = [];
|
|
1075
|
+
for (const E of y) {
|
|
1076
|
+
const P = E.startDate.getHours() + E.startDate.getMinutes() / 60, Y = E.endDate.getHours() + E.endDate.getMinutes() / 60;
|
|
1076
1077
|
for (let K = 0; K < T.length; K++) {
|
|
1077
|
-
const J = T[K], ie =
|
|
1078
|
-
if (E.startDate <=
|
|
1079
|
-
let N =
|
|
1080
|
-
if (E.startDate >= ie && (N = Math.max(
|
|
1081
|
-
|
|
1078
|
+
const J = T[K], ie = pe(J), h = Ve(J);
|
|
1079
|
+
if (E.startDate <= h && E.endDate >= ie) {
|
|
1080
|
+
let N = D, I = S;
|
|
1081
|
+
if (E.startDate >= ie && (N = Math.max(D, P)), E.endDate <= h && (I = Math.min(S, Y)), N = Math.max(
|
|
1082
|
+
D,
|
|
1082
1083
|
Math.min(S, N)
|
|
1083
|
-
),
|
|
1084
|
-
|
|
1085
|
-
Math.min(S,
|
|
1086
|
-
),
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1084
|
+
), I = Math.max(
|
|
1085
|
+
D,
|
|
1086
|
+
Math.min(S, I)
|
|
1087
|
+
), I > N) {
|
|
1088
|
+
const W = K * H + Math.floor(N - D), G = K * H + Math.ceil(I - D);
|
|
1089
|
+
L.push({
|
|
1089
1090
|
event: E,
|
|
1090
|
-
startCol:
|
|
1091
|
-
spanCols: Math.max(1, G -
|
|
1091
|
+
startCol: W,
|
|
1092
|
+
spanCols: Math.max(1, G - W)
|
|
1092
1093
|
});
|
|
1093
1094
|
}
|
|
1094
1095
|
}
|
|
1095
1096
|
}
|
|
1096
1097
|
}
|
|
1097
|
-
return
|
|
1098
|
+
return L;
|
|
1098
1099
|
};
|
|
1099
|
-
for (const
|
|
1100
|
-
const
|
|
1100
|
+
for (const y of V) {
|
|
1101
|
+
const L = u.get(y.id) ?? [], E = w(L), P = Ie(E), Y = P.reduce(
|
|
1101
1102
|
(K, J) => Math.max(K, J.stackIndex + 1),
|
|
1102
1103
|
0
|
|
1103
1104
|
);
|
|
1104
1105
|
l.push({
|
|
1105
|
-
user:
|
|
1106
|
-
events:
|
|
1106
|
+
user: y,
|
|
1107
|
+
events: P,
|
|
1107
1108
|
maxStack: Math.max(Y, 1)
|
|
1108
1109
|
});
|
|
1109
1110
|
}
|
|
1110
|
-
const k =
|
|
1111
|
+
const k = u.get("unassigned") ?? [];
|
|
1111
1112
|
if (k.length > 0) {
|
|
1112
|
-
const
|
|
1113
|
-
(
|
|
1113
|
+
const y = w(k), L = Ie(y), E = L.reduce(
|
|
1114
|
+
(P, Y) => Math.max(P, Y.stackIndex + 1),
|
|
1114
1115
|
0
|
|
1115
1116
|
);
|
|
1116
1117
|
l.push({
|
|
@@ -1120,87 +1121,87 @@ function we({
|
|
|
1120
1121
|
avatar: void 0,
|
|
1121
1122
|
email: void 0
|
|
1122
1123
|
},
|
|
1123
|
-
events:
|
|
1124
|
+
events: L,
|
|
1124
1125
|
maxStack: Math.max(E, 1)
|
|
1125
1126
|
});
|
|
1126
1127
|
}
|
|
1127
|
-
return l.filter((
|
|
1128
|
+
return l.filter((y) => y.events.length > 0);
|
|
1128
1129
|
}, [
|
|
1129
1130
|
V,
|
|
1130
1131
|
r,
|
|
1131
1132
|
T,
|
|
1132
1133
|
z,
|
|
1133
|
-
|
|
1134
|
-
|
|
1134
|
+
H,
|
|
1135
|
+
D,
|
|
1135
1136
|
S,
|
|
1136
1137
|
R
|
|
1137
|
-
]), O =
|
|
1138
|
+
]), O = $(() => {
|
|
1138
1139
|
const l = /* @__PURE__ */ new Map();
|
|
1139
|
-
for (const
|
|
1140
|
-
for (const
|
|
1141
|
-
if (
|
|
1142
|
-
const k = l.get(
|
|
1143
|
-
l.set(
|
|
1140
|
+
for (const u of B)
|
|
1141
|
+
for (const w of u.events)
|
|
1142
|
+
if (w.spanCols === 1) {
|
|
1143
|
+
const k = l.get(w.startCol) ?? 0;
|
|
1144
|
+
l.set(w.startCol, k + 1);
|
|
1144
1145
|
}
|
|
1145
1146
|
return l;
|
|
1146
|
-
}, [
|
|
1147
|
-
const l =
|
|
1147
|
+
}, [B]), j = $(() => {
|
|
1148
|
+
const l = C.length, u = we, w = [];
|
|
1148
1149
|
for (let k = 0; k < l; k++) {
|
|
1149
|
-
const
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
) :
|
|
1150
|
+
const y = O.get(k) ?? 0;
|
|
1151
|
+
y > Te ? w.push(
|
|
1152
|
+
Le + (y - Te) * 20
|
|
1153
|
+
) : y > 0 ? w.push(Math.max(u, Le)) : w.push(u);
|
|
1153
1154
|
}
|
|
1154
|
-
return
|
|
1155
|
+
return w;
|
|
1155
1156
|
}, [
|
|
1156
1157
|
z,
|
|
1157
|
-
|
|
1158
|
+
C.length,
|
|
1158
1159
|
T.length,
|
|
1159
1160
|
O
|
|
1160
|
-
]),
|
|
1161
|
+
]), _ = (l) => Math.max(
|
|
1161
1162
|
It,
|
|
1162
|
-
l * (
|
|
1163
|
-
), U = ce +
|
|
1163
|
+
l * (ve + ze) + He * 2
|
|
1164
|
+
), U = ce + j.reduce((l, u) => l + u, 0), d = $(() => {
|
|
1164
1165
|
const l = [0];
|
|
1165
|
-
for (let
|
|
1166
|
-
l.push(l[
|
|
1166
|
+
for (let u = 0; u < j.length; u++)
|
|
1167
|
+
l.push(l[u] + j[u]);
|
|
1167
1168
|
return l;
|
|
1168
|
-
}, [
|
|
1169
|
+
}, [j]);
|
|
1169
1170
|
return Ze(() => {
|
|
1170
1171
|
const l = M.current;
|
|
1171
1172
|
if (!l) return;
|
|
1172
|
-
const
|
|
1173
|
-
let
|
|
1174
|
-
const
|
|
1173
|
+
const u = () => {
|
|
1174
|
+
let w = -1;
|
|
1175
|
+
const y = (/* @__PURE__ */ new Date()).getHours();
|
|
1175
1176
|
{
|
|
1176
|
-
for (let
|
|
1177
|
-
const E =
|
|
1178
|
-
if (E && q(E.date) && E.hour <=
|
|
1179
|
-
|
|
1177
|
+
for (let L = 0; L < C.length; L++) {
|
|
1178
|
+
const E = C[L];
|
|
1179
|
+
if (E && q(E.date) && E.hour <= y && E.hour + 1 > y) {
|
|
1180
|
+
w = L;
|
|
1180
1181
|
break;
|
|
1181
1182
|
}
|
|
1182
1183
|
}
|
|
1183
|
-
if (
|
|
1184
|
-
for (let
|
|
1185
|
-
const E =
|
|
1184
|
+
if (w === -1)
|
|
1185
|
+
for (let L = 0; L < C.length; L++) {
|
|
1186
|
+
const E = C[L];
|
|
1186
1187
|
if (E && q(E.date)) {
|
|
1187
|
-
|
|
1188
|
+
w = L;
|
|
1188
1189
|
break;
|
|
1189
1190
|
}
|
|
1190
1191
|
}
|
|
1191
1192
|
}
|
|
1192
|
-
if (
|
|
1193
|
-
const
|
|
1193
|
+
if (w !== -1) {
|
|
1194
|
+
const L = (d[w] ?? 0) + ce, E = l.clientWidth, P = Math.max(0, L - E / 3);
|
|
1194
1195
|
l.scrollTo({
|
|
1195
|
-
left:
|
|
1196
|
+
left: P,
|
|
1196
1197
|
behavior: "instant"
|
|
1197
1198
|
});
|
|
1198
1199
|
}
|
|
1199
1200
|
};
|
|
1200
1201
|
requestAnimationFrame(() => {
|
|
1201
|
-
requestAnimationFrame(
|
|
1202
|
+
requestAnimationFrame(u);
|
|
1202
1203
|
});
|
|
1203
|
-
}, [A,
|
|
1204
|
+
}, [A, C, T, d, z]), /* @__PURE__ */ e("div", { className: m("flex h-full flex-col", f), children: /* @__PURE__ */ e("div", { className: "ic-timeline-scroll-container flex-1", ref: M, children: /* @__PURE__ */ n("div", { className: "relative", style: { minWidth: U }, children: [
|
|
1204
1205
|
// Hour mode: Day headers + Hour sub-headers - sticky wrapper with flex child (sticky + flex breaks sticky)
|
|
1205
1206
|
/* @__PURE__ */ e("div", { className: "ic-timeline-header sticky top-0 z-20 border-b bg-background", children: /* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
1206
1207
|
t > 1 && /* @__PURE__ */ n("div", { className: "flex border-b", children: [
|
|
@@ -1212,16 +1213,16 @@ function we({
|
|
|
1212
1213
|
children: /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase text-muted-foreground", children: "Resources" })
|
|
1213
1214
|
}
|
|
1214
1215
|
),
|
|
1215
|
-
T.map((l,
|
|
1216
|
-
const
|
|
1216
|
+
T.map((l, u) => {
|
|
1217
|
+
const w = q(l), k = u * H, y = j.slice(k, k + H).reduce((L, E) => L + E, 0);
|
|
1217
1218
|
return /* @__PURE__ */ e(
|
|
1218
1219
|
"div",
|
|
1219
1220
|
{
|
|
1220
|
-
className:
|
|
1221
|
+
className: m(
|
|
1221
1222
|
"flex shrink-0 items-center justify-center border-r py-1.5 font-medium",
|
|
1222
|
-
|
|
1223
|
+
w ? "bg-primary/10 text-primary" : "bg-muted/30"
|
|
1223
1224
|
),
|
|
1224
|
-
style: { width:
|
|
1225
|
+
style: { width: y },
|
|
1225
1226
|
children: /* @__PURE__ */ e("span", { className: "text-xs", children: Ot(l) })
|
|
1226
1227
|
},
|
|
1227
1228
|
`day-${l.toISOString()}`
|
|
@@ -1232,7 +1233,7 @@ function we({
|
|
|
1232
1233
|
/* @__PURE__ */ e(
|
|
1233
1234
|
"div",
|
|
1234
1235
|
{
|
|
1235
|
-
className:
|
|
1236
|
+
className: m(
|
|
1236
1237
|
"flex shrink-0 items-center border-r bg-background px-2 py-2",
|
|
1237
1238
|
t > 1 && "sticky left-0 z-10"
|
|
1238
1239
|
),
|
|
@@ -1240,17 +1241,17 @@ function we({
|
|
|
1240
1241
|
children: t === 1 && /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase text-muted-foreground", children: "Resources" })
|
|
1241
1242
|
}
|
|
1242
1243
|
),
|
|
1243
|
-
|
|
1244
|
-
const
|
|
1244
|
+
C.map((l, u) => {
|
|
1245
|
+
const w = l.hour === D, k = q(l.date), y = j[u] ?? we;
|
|
1245
1246
|
return /* @__PURE__ */ e(
|
|
1246
1247
|
"div",
|
|
1247
1248
|
{
|
|
1248
|
-
className:
|
|
1249
|
+
className: m(
|
|
1249
1250
|
"flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",
|
|
1250
|
-
|
|
1251
|
+
w && u > 0 ? "border-l-2 border-l-border" : "border-r border-r-border/50",
|
|
1251
1252
|
k && "bg-primary/5"
|
|
1252
1253
|
),
|
|
1253
|
-
style: { width:
|
|
1254
|
+
style: { width: y },
|
|
1254
1255
|
children: $t(l.hour)
|
|
1255
1256
|
},
|
|
1256
1257
|
`hour-${l.dayIndex}-${l.hour}`
|
|
@@ -1258,16 +1259,16 @@ function we({
|
|
|
1258
1259
|
})
|
|
1259
1260
|
] })
|
|
1260
1261
|
] }) }),
|
|
1261
|
-
|
|
1262
|
-
const
|
|
1262
|
+
B.map((l) => {
|
|
1263
|
+
const u = _(l.maxStack);
|
|
1263
1264
|
return /* @__PURE__ */ n(
|
|
1264
1265
|
"div",
|
|
1265
1266
|
{
|
|
1266
|
-
className:
|
|
1267
|
+
className: m(
|
|
1267
1268
|
"relative flex border-b",
|
|
1268
1269
|
p?.resourceRow
|
|
1269
1270
|
),
|
|
1270
|
-
style: { height:
|
|
1271
|
+
style: { height: u },
|
|
1271
1272
|
children: [
|
|
1272
1273
|
/* @__PURE__ */ e(
|
|
1273
1274
|
"div",
|
|
@@ -1277,13 +1278,13 @@ function we({
|
|
|
1277
1278
|
children: /* @__PURE__ */ n(
|
|
1278
1279
|
"div",
|
|
1279
1280
|
{
|
|
1280
|
-
className:
|
|
1281
|
+
className: m(
|
|
1281
1282
|
"flex h-full items-center gap-2 sm:gap-3 border-r bg-background px-2 sm:px-4",
|
|
1282
1283
|
p?.resourceHeader
|
|
1283
1284
|
),
|
|
1284
1285
|
children: [
|
|
1285
1286
|
/* @__PURE__ */ e(
|
|
1286
|
-
|
|
1287
|
+
Pt,
|
|
1287
1288
|
{
|
|
1288
1289
|
className: "size-7",
|
|
1289
1290
|
src: l.user.avatar,
|
|
@@ -1299,23 +1300,23 @@ function we({
|
|
|
1299
1300
|
),
|
|
1300
1301
|
/* @__PURE__ */ n("div", { className: "relative flex", children: [
|
|
1301
1302
|
// Hour mode cells
|
|
1302
|
-
|
|
1303
|
-
const
|
|
1303
|
+
C.map((w, k) => {
|
|
1304
|
+
const y = w.hour === D && k > 0, L = j[k] ?? we;
|
|
1304
1305
|
return /* @__PURE__ */ e(
|
|
1305
1306
|
"div",
|
|
1306
1307
|
{
|
|
1307
|
-
className:
|
|
1308
|
+
className: m(
|
|
1308
1309
|
"shrink-0",
|
|
1309
|
-
|
|
1310
|
-
q(
|
|
1310
|
+
y ? "border-l-2 border-l-border" : "border-r border-r-border/50",
|
|
1311
|
+
q(w.date) && "bg-primary/5"
|
|
1311
1312
|
),
|
|
1312
|
-
style: { width:
|
|
1313
|
+
style: { width: L }
|
|
1313
1314
|
},
|
|
1314
|
-
`cell-${
|
|
1315
|
+
`cell-${w.dayIndex}-${w.hour}`
|
|
1315
1316
|
);
|
|
1316
1317
|
}),
|
|
1317
|
-
l.events.map((
|
|
1318
|
-
const k = (
|
|
1318
|
+
l.events.map((w) => {
|
|
1319
|
+
const k = (d[w.startCol] ?? 0) + 2, y = d[w.startCol + w.spanCols] ?? d[d.length - 1] ?? 0, L = d[w.startCol] ?? 0, E = y - L - 4, P = He + w.stackIndex * (ve + ze);
|
|
1319
1320
|
return /* @__PURE__ */ e(
|
|
1320
1321
|
"div",
|
|
1321
1322
|
{
|
|
@@ -1324,24 +1325,24 @@ function we({
|
|
|
1324
1325
|
left: k,
|
|
1325
1326
|
width: Math.max(E, 0),
|
|
1326
1327
|
// No forced minimum - columns are guaranteed wide enough
|
|
1327
|
-
top:
|
|
1328
|
-
height:
|
|
1328
|
+
top: P,
|
|
1329
|
+
height: ve
|
|
1329
1330
|
},
|
|
1330
1331
|
children: /* @__PURE__ */ e(
|
|
1331
1332
|
ot,
|
|
1332
1333
|
{
|
|
1333
|
-
event:
|
|
1334
|
+
event: w.event,
|
|
1334
1335
|
variant: "compact",
|
|
1335
1336
|
onClick: i,
|
|
1336
1337
|
renderPopover: x,
|
|
1337
|
-
className:
|
|
1338
|
+
className: m(
|
|
1338
1339
|
"h-full w-full",
|
|
1339
1340
|
p?.eventCardCompact
|
|
1340
1341
|
)
|
|
1341
1342
|
}
|
|
1342
1343
|
)
|
|
1343
1344
|
},
|
|
1344
|
-
|
|
1345
|
+
w.event.id
|
|
1345
1346
|
);
|
|
1346
1347
|
})
|
|
1347
1348
|
] })
|
|
@@ -1350,7 +1351,7 @@ function we({
|
|
|
1350
1351
|
l.user.id
|
|
1351
1352
|
);
|
|
1352
1353
|
}),
|
|
1353
|
-
|
|
1354
|
+
B.length === 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-20 text-muted-foreground", children: "No users or events to display" })
|
|
1354
1355
|
] }) }) });
|
|
1355
1356
|
}
|
|
1356
1357
|
const Rt = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], Vt = [
|
|
@@ -1378,7 +1379,7 @@ function Ut({ day: t, date: r, events: o, isCurrentMonth: s, onDayClick: a }) {
|
|
|
1378
1379
|
{
|
|
1379
1380
|
type: "button",
|
|
1380
1381
|
onClick: () => a?.(r),
|
|
1381
|
-
className:
|
|
1382
|
+
className: m(
|
|
1382
1383
|
"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",
|
|
1383
1384
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1384
1385
|
"transition-colors",
|
|
@@ -1388,7 +1389,7 @@ function Ut({ day: t, date: r, events: o, isCurrentMonth: s, onDayClick: a }) {
|
|
|
1388
1389
|
/* @__PURE__ */ e(
|
|
1389
1390
|
"div",
|
|
1390
1391
|
{
|
|
1391
|
-
className:
|
|
1392
|
+
className: m(
|
|
1392
1393
|
"flex size-5 sm:size-6 items-center justify-center rounded-full text-[10px] sm:text-xs font-medium",
|
|
1393
1394
|
i && "bg-primary font-semibold text-primary-foreground"
|
|
1394
1395
|
),
|
|
@@ -1426,14 +1427,14 @@ function Yt({
|
|
|
1426
1427
|
onMonthClick: o,
|
|
1427
1428
|
onDayClick: s
|
|
1428
1429
|
}) {
|
|
1429
|
-
const a =
|
|
1430
|
+
const a = $(() => mt(t, 0), [t]);
|
|
1430
1431
|
return /* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
1431
1432
|
/* @__PURE__ */ e(
|
|
1432
1433
|
"button",
|
|
1433
1434
|
{
|
|
1434
1435
|
type: "button",
|
|
1435
1436
|
onClick: () => o?.(t),
|
|
1436
|
-
className:
|
|
1437
|
+
className: m(
|
|
1437
1438
|
"w-full rounded-t-lg border px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm font-semibold",
|
|
1438
1439
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1439
1440
|
"transition-colors"
|
|
@@ -1472,8 +1473,8 @@ function Gt({
|
|
|
1472
1473
|
slots: i,
|
|
1473
1474
|
classNames: g
|
|
1474
1475
|
}) {
|
|
1475
|
-
const f =
|
|
1476
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1476
|
+
const f = $(() => ht(r), [r]);
|
|
1477
|
+
return /* @__PURE__ */ n("div", { className: m("flex flex-col h-full", a), children: [
|
|
1477
1478
|
/* @__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: r }) }),
|
|
1478
1479
|
/* @__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: f.map((c) => /* @__PURE__ */ e(
|
|
1479
1480
|
Yt,
|
|
@@ -1507,54 +1508,54 @@ function qt({
|
|
|
1507
1508
|
showMoreMode: f,
|
|
1508
1509
|
showMoreEventsInPopover: c = !1,
|
|
1509
1510
|
isLoading: x = !1,
|
|
1510
|
-
slots:
|
|
1511
|
+
slots: b,
|
|
1511
1512
|
classNames: p,
|
|
1512
1513
|
settingsContent: M,
|
|
1513
1514
|
filterContent: A,
|
|
1514
1515
|
headerActions: z,
|
|
1515
|
-
renderPopover:
|
|
1516
|
+
renderPopover: D,
|
|
1516
1517
|
calendarRef: S
|
|
1517
1518
|
}) {
|
|
1518
|
-
const
|
|
1519
|
-
view:
|
|
1519
|
+
const H = f ?? (c ? "popover" : "expand"), {
|
|
1520
|
+
view: v,
|
|
1520
1521
|
setView: T,
|
|
1521
|
-
selectedDate:
|
|
1522
|
+
selectedDate: C,
|
|
1522
1523
|
setSelectedDate: F,
|
|
1523
1524
|
slotDuration: R,
|
|
1524
1525
|
filteredEvents: V,
|
|
1525
|
-
users:
|
|
1526
|
+
users: B,
|
|
1526
1527
|
visibleHours: O,
|
|
1527
|
-
workingHours:
|
|
1528
|
-
badgeVariant:
|
|
1528
|
+
workingHours: j,
|
|
1529
|
+
badgeVariant: _,
|
|
1529
1530
|
showWorkingHoursOnly: U
|
|
1530
|
-
} = Qe(),
|
|
1531
|
-
if (!U || !
|
|
1531
|
+
} = Qe(), d = $(() => {
|
|
1532
|
+
if (!U || !j)
|
|
1532
1533
|
return {
|
|
1533
1534
|
startHour: O.start,
|
|
1534
1535
|
endHour: O.end
|
|
1535
1536
|
};
|
|
1536
|
-
let
|
|
1537
|
-
for (const
|
|
1538
|
-
const
|
|
1539
|
-
!
|
|
1537
|
+
let h = 24, N = 0;
|
|
1538
|
+
for (const I of Object.keys(j)) {
|
|
1539
|
+
const W = j[Number(I)];
|
|
1540
|
+
!W || W.enabled === !1 || (W.from < h && (h = W.from), W.to > N && (N = W.to));
|
|
1540
1541
|
}
|
|
1541
|
-
return
|
|
1542
|
+
return h >= N ? {
|
|
1542
1543
|
startHour: O.start,
|
|
1543
1544
|
endHour: O.end
|
|
1544
|
-
} : { startHour:
|
|
1545
|
-
}, [U,
|
|
1545
|
+
} : { startHour: h, endHour: N };
|
|
1546
|
+
}, [U, j, O]), l = d, u = Ne(null);
|
|
1546
1547
|
et(
|
|
1547
1548
|
S,
|
|
1548
1549
|
() => ({
|
|
1549
1550
|
scrollToToday: () => {
|
|
1550
|
-
const
|
|
1551
|
-
F(
|
|
1551
|
+
const h = /* @__PURE__ */ new Date();
|
|
1552
|
+
F(h, v), requestAnimationFrame(() => {
|
|
1552
1553
|
requestAnimationFrame(() => {
|
|
1553
|
-
const N =
|
|
1554
|
+
const N = u.current?.querySelector(
|
|
1554
1555
|
".ic-timeline-scroll-container, [class*='overflow-auto']"
|
|
1555
1556
|
);
|
|
1556
1557
|
if (!N) return;
|
|
1557
|
-
const G = (
|
|
1558
|
+
const G = (h.getHours() - d.startHour) * 96;
|
|
1558
1559
|
G > 0 && N.scrollTo({
|
|
1559
1560
|
top: Math.max(0, G - 100),
|
|
1560
1561
|
// Offset to show some context
|
|
@@ -1564,73 +1565,73 @@ function qt({
|
|
|
1564
1565
|
});
|
|
1565
1566
|
},
|
|
1566
1567
|
scrollToWorkingHours: () => {
|
|
1567
|
-
let
|
|
1568
|
-
if (
|
|
1569
|
-
for (const N of Object.keys(
|
|
1570
|
-
const
|
|
1571
|
-
|
|
1568
|
+
let h = 8;
|
|
1569
|
+
if (j)
|
|
1570
|
+
for (const N of Object.keys(j)) {
|
|
1571
|
+
const I = j[Number(N)];
|
|
1572
|
+
I?.enabled && I.from < h && (h = Math.max(I.from - 1, 0));
|
|
1572
1573
|
}
|
|
1573
1574
|
requestAnimationFrame(() => {
|
|
1574
1575
|
requestAnimationFrame(() => {
|
|
1575
|
-
const N =
|
|
1576
|
+
const N = u.current?.querySelector(
|
|
1576
1577
|
".ic-timeline-scroll-container, [class*='overflow-auto']"
|
|
1577
1578
|
);
|
|
1578
1579
|
if (!N) return;
|
|
1579
|
-
const
|
|
1580
|
+
const W = (h - d.startHour) * 96;
|
|
1580
1581
|
N.scrollTo({
|
|
1581
|
-
top: Math.max(0,
|
|
1582
|
+
top: Math.max(0, W),
|
|
1582
1583
|
behavior: "smooth"
|
|
1583
1584
|
});
|
|
1584
1585
|
});
|
|
1585
1586
|
});
|
|
1586
1587
|
},
|
|
1587
|
-
getViewRect: () =>
|
|
1588
|
+
getViewRect: () => u.current?.getBoundingClientRect() ?? null
|
|
1588
1589
|
}),
|
|
1589
|
-
[F,
|
|
1590
|
+
[F, v, d, j]
|
|
1590
1591
|
);
|
|
1591
|
-
const
|
|
1592
|
-
(
|
|
1592
|
+
const w = $(() => Kt(v), [v]), k = oe(
|
|
1593
|
+
(h) => {
|
|
1593
1594
|
if (o) {
|
|
1594
|
-
o(
|
|
1595
|
+
o(h);
|
|
1595
1596
|
return;
|
|
1596
1597
|
}
|
|
1597
1598
|
if (r) {
|
|
1598
|
-
const N =
|
|
1599
|
-
r(
|
|
1599
|
+
const N = h.startDate.getHours();
|
|
1600
|
+
r(h.startDate, N);
|
|
1600
1601
|
}
|
|
1601
1602
|
},
|
|
1602
1603
|
[o, r]
|
|
1603
|
-
),
|
|
1604
|
-
(
|
|
1605
|
-
T("day"), F(
|
|
1604
|
+
), y = oe(
|
|
1605
|
+
(h) => {
|
|
1606
|
+
T("day"), F(h, "day");
|
|
1606
1607
|
},
|
|
1607
1608
|
[F, T]
|
|
1608
|
-
),
|
|
1609
|
-
(
|
|
1610
|
-
T("month"), F(
|
|
1609
|
+
), L = oe(
|
|
1610
|
+
(h) => {
|
|
1611
|
+
T("month"), F(h, "month");
|
|
1611
1612
|
},
|
|
1612
1613
|
[F, T]
|
|
1613
1614
|
), E = oe(
|
|
1614
|
-
(
|
|
1615
|
-
t?.(
|
|
1615
|
+
(h) => {
|
|
1616
|
+
t?.(h);
|
|
1616
1617
|
},
|
|
1617
1618
|
[t]
|
|
1618
|
-
),
|
|
1619
|
-
const
|
|
1620
|
-
switch (
|
|
1619
|
+
), P = () => {
|
|
1620
|
+
const h = V, N = E, I = D;
|
|
1621
|
+
switch (v) {
|
|
1621
1622
|
case "day":
|
|
1622
1623
|
return /* @__PURE__ */ e(
|
|
1623
1624
|
lt,
|
|
1624
1625
|
{
|
|
1625
|
-
events:
|
|
1626
|
-
date:
|
|
1626
|
+
events: h,
|
|
1627
|
+
date: C,
|
|
1627
1628
|
visibleHours: l,
|
|
1628
|
-
workingHours:
|
|
1629
|
+
workingHours: j,
|
|
1629
1630
|
slotDuration: R,
|
|
1630
|
-
badgeVariant:
|
|
1631
|
+
badgeVariant: _,
|
|
1631
1632
|
onEventClick: N,
|
|
1632
|
-
renderPopover:
|
|
1633
|
-
...
|
|
1633
|
+
renderPopover: I,
|
|
1634
|
+
...b && { slots: b },
|
|
1634
1635
|
...p && { classNames: p }
|
|
1635
1636
|
}
|
|
1636
1637
|
);
|
|
@@ -1638,15 +1639,15 @@ function qt({
|
|
|
1638
1639
|
return /* @__PURE__ */ e(
|
|
1639
1640
|
it,
|
|
1640
1641
|
{
|
|
1641
|
-
events:
|
|
1642
|
-
date:
|
|
1642
|
+
events: h,
|
|
1643
|
+
date: C,
|
|
1643
1644
|
visibleHours: l,
|
|
1644
|
-
workingHours:
|
|
1645
|
+
workingHours: j,
|
|
1645
1646
|
slotDuration: R,
|
|
1646
|
-
badgeVariant:
|
|
1647
|
+
badgeVariant: _,
|
|
1647
1648
|
onEventClick: N,
|
|
1648
|
-
renderPopover:
|
|
1649
|
-
...
|
|
1649
|
+
renderPopover: I,
|
|
1650
|
+
...b && { slots: b },
|
|
1650
1651
|
...p && { classNames: p }
|
|
1651
1652
|
}
|
|
1652
1653
|
);
|
|
@@ -1654,14 +1655,14 @@ function qt({
|
|
|
1654
1655
|
return /* @__PURE__ */ e(
|
|
1655
1656
|
De,
|
|
1656
1657
|
{
|
|
1657
|
-
events:
|
|
1658
|
-
date:
|
|
1659
|
-
badgeVariant:
|
|
1658
|
+
events: h,
|
|
1659
|
+
date: C,
|
|
1660
|
+
badgeVariant: _,
|
|
1660
1661
|
onEventClick: N,
|
|
1661
|
-
onDayClick:
|
|
1662
|
-
renderPopover:
|
|
1663
|
-
showMoreMode:
|
|
1664
|
-
...
|
|
1662
|
+
onDayClick: y,
|
|
1663
|
+
renderPopover: I,
|
|
1664
|
+
showMoreMode: H,
|
|
1665
|
+
...b && { slots: b },
|
|
1665
1666
|
...p && { classNames: p }
|
|
1666
1667
|
}
|
|
1667
1668
|
);
|
|
@@ -1669,11 +1670,11 @@ function qt({
|
|
|
1669
1670
|
return /* @__PURE__ */ e(
|
|
1670
1671
|
Gt,
|
|
1671
1672
|
{
|
|
1672
|
-
events:
|
|
1673
|
-
year:
|
|
1674
|
-
onMonthClick:
|
|
1675
|
-
onDayClick:
|
|
1676
|
-
...
|
|
1673
|
+
events: h,
|
|
1674
|
+
year: C.getFullYear(),
|
|
1675
|
+
onMonthClick: L,
|
|
1676
|
+
onDayClick: y,
|
|
1677
|
+
...b && { slots: b },
|
|
1677
1678
|
...p && { classNames: p }
|
|
1678
1679
|
}
|
|
1679
1680
|
);
|
|
@@ -1681,66 +1682,103 @@ function qt({
|
|
|
1681
1682
|
return /* @__PURE__ */ e(
|
|
1682
1683
|
at,
|
|
1683
1684
|
{
|
|
1684
|
-
events:
|
|
1685
|
-
date:
|
|
1685
|
+
events: h,
|
|
1686
|
+
date: C,
|
|
1687
|
+
onEventClick: N,
|
|
1688
|
+
renderPopover: I,
|
|
1689
|
+
...b && { slots: b },
|
|
1690
|
+
...p && { classNames: p }
|
|
1691
|
+
}
|
|
1692
|
+
);
|
|
1693
|
+
// Resource views — delegate to TimelineView with matching day count
|
|
1694
|
+
case "resource-day":
|
|
1695
|
+
return /* @__PURE__ */ e(
|
|
1696
|
+
de,
|
|
1697
|
+
{
|
|
1698
|
+
daysToShow: 1,
|
|
1699
|
+
events: h,
|
|
1700
|
+
users: B,
|
|
1701
|
+
selectedDate: C,
|
|
1702
|
+
visibleHours: {
|
|
1703
|
+
from: d.startHour,
|
|
1704
|
+
to: d.endHour
|
|
1705
|
+
},
|
|
1706
|
+
onEventClick: N,
|
|
1707
|
+
renderPopover: I,
|
|
1708
|
+
...b && { slots: b },
|
|
1709
|
+
...p && { classNames: p }
|
|
1710
|
+
}
|
|
1711
|
+
);
|
|
1712
|
+
case "resource-week":
|
|
1713
|
+
return /* @__PURE__ */ e(
|
|
1714
|
+
de,
|
|
1715
|
+
{
|
|
1716
|
+
daysToShow: 7,
|
|
1717
|
+
events: h,
|
|
1718
|
+
users: B,
|
|
1719
|
+
selectedDate: C,
|
|
1720
|
+
visibleHours: {
|
|
1721
|
+
from: d.startHour,
|
|
1722
|
+
to: d.endHour
|
|
1723
|
+
},
|
|
1686
1724
|
onEventClick: N,
|
|
1687
|
-
renderPopover:
|
|
1688
|
-
...
|
|
1725
|
+
renderPopover: I,
|
|
1726
|
+
...b && { slots: b },
|
|
1689
1727
|
...p && { classNames: p }
|
|
1690
1728
|
}
|
|
1691
1729
|
);
|
|
1692
1730
|
// Timeline views
|
|
1693
1731
|
case "timeline-day":
|
|
1694
1732
|
return /* @__PURE__ */ e(
|
|
1695
|
-
|
|
1733
|
+
de,
|
|
1696
1734
|
{
|
|
1697
1735
|
daysToShow: 1,
|
|
1698
|
-
events:
|
|
1699
|
-
users:
|
|
1700
|
-
selectedDate:
|
|
1736
|
+
events: h,
|
|
1737
|
+
users: B,
|
|
1738
|
+
selectedDate: C,
|
|
1701
1739
|
visibleHours: {
|
|
1702
|
-
from:
|
|
1703
|
-
to:
|
|
1740
|
+
from: d.startHour,
|
|
1741
|
+
to: d.endHour
|
|
1704
1742
|
},
|
|
1705
1743
|
onEventClick: N,
|
|
1706
|
-
renderPopover:
|
|
1707
|
-
...
|
|
1744
|
+
renderPopover: I,
|
|
1745
|
+
...b && { slots: b },
|
|
1708
1746
|
...p && { classNames: p }
|
|
1709
1747
|
}
|
|
1710
1748
|
);
|
|
1711
1749
|
case "timeline-3day":
|
|
1712
1750
|
return /* @__PURE__ */ e(
|
|
1713
|
-
|
|
1751
|
+
de,
|
|
1714
1752
|
{
|
|
1715
1753
|
daysToShow: 3,
|
|
1716
|
-
events:
|
|
1717
|
-
users:
|
|
1718
|
-
selectedDate:
|
|
1754
|
+
events: h,
|
|
1755
|
+
users: B,
|
|
1756
|
+
selectedDate: C,
|
|
1719
1757
|
visibleHours: {
|
|
1720
|
-
from:
|
|
1721
|
-
to:
|
|
1758
|
+
from: d.startHour,
|
|
1759
|
+
to: d.endHour
|
|
1722
1760
|
},
|
|
1723
1761
|
onEventClick: N,
|
|
1724
|
-
renderPopover:
|
|
1725
|
-
...
|
|
1762
|
+
renderPopover: I,
|
|
1763
|
+
...b && { slots: b },
|
|
1726
1764
|
...p && { classNames: p }
|
|
1727
1765
|
}
|
|
1728
1766
|
);
|
|
1729
1767
|
case "timeline-week":
|
|
1730
1768
|
return /* @__PURE__ */ e(
|
|
1731
|
-
|
|
1769
|
+
de,
|
|
1732
1770
|
{
|
|
1733
1771
|
daysToShow: 7,
|
|
1734
|
-
events:
|
|
1735
|
-
users:
|
|
1736
|
-
selectedDate:
|
|
1772
|
+
events: h,
|
|
1773
|
+
users: B,
|
|
1774
|
+
selectedDate: C,
|
|
1737
1775
|
visibleHours: {
|
|
1738
|
-
from:
|
|
1739
|
-
to:
|
|
1776
|
+
from: d.startHour,
|
|
1777
|
+
to: d.endHour
|
|
1740
1778
|
},
|
|
1741
1779
|
onEventClick: N,
|
|
1742
|
-
renderPopover:
|
|
1743
|
-
...
|
|
1780
|
+
renderPopover: I,
|
|
1781
|
+
...b && { slots: b },
|
|
1744
1782
|
...p && { classNames: p }
|
|
1745
1783
|
}
|
|
1746
1784
|
);
|
|
@@ -1748,41 +1786,41 @@ function qt({
|
|
|
1748
1786
|
return /* @__PURE__ */ e(
|
|
1749
1787
|
De,
|
|
1750
1788
|
{
|
|
1751
|
-
events:
|
|
1752
|
-
date:
|
|
1753
|
-
badgeVariant:
|
|
1789
|
+
events: h,
|
|
1790
|
+
date: C,
|
|
1791
|
+
badgeVariant: _,
|
|
1754
1792
|
onEventClick: N,
|
|
1755
|
-
onDayClick:
|
|
1756
|
-
...
|
|
1793
|
+
onDayClick: y,
|
|
1794
|
+
...b && { slots: b },
|
|
1757
1795
|
...p && { classNames: p }
|
|
1758
1796
|
}
|
|
1759
1797
|
);
|
|
1760
1798
|
}
|
|
1761
1799
|
}, Y = Ne(null), [K, J] = se(!1);
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
}),
|
|
1765
|
-
const
|
|
1766
|
-
if (!
|
|
1800
|
+
me(() => {
|
|
1801
|
+
u.current = Y.current;
|
|
1802
|
+
}), me(() => {
|
|
1803
|
+
const h = Y.current;
|
|
1804
|
+
if (!h) return;
|
|
1767
1805
|
const N = () => {
|
|
1768
|
-
const { scrollLeft: G, scrollWidth:
|
|
1769
|
-
J(G + Ke <
|
|
1806
|
+
const { scrollLeft: G, scrollWidth: fe, clientWidth: Ke } = h;
|
|
1807
|
+
J(G + Ke < fe - 4);
|
|
1770
1808
|
};
|
|
1771
|
-
N(),
|
|
1772
|
-
const
|
|
1773
|
-
|
|
1774
|
-
const
|
|
1775
|
-
return
|
|
1776
|
-
|
|
1809
|
+
N(), h.addEventListener("scroll", N, { passive: !0 });
|
|
1810
|
+
const I = new ResizeObserver(N);
|
|
1811
|
+
I.observe(h);
|
|
1812
|
+
const W = new MutationObserver(N);
|
|
1813
|
+
return W.observe(h, { childList: !0, subtree: !0 }), () => {
|
|
1814
|
+
h.removeEventListener("scroll", N), I.disconnect(), W.disconnect();
|
|
1777
1815
|
};
|
|
1778
|
-
}, [
|
|
1816
|
+
}, [v]);
|
|
1779
1817
|
const ie = oe(() => {
|
|
1780
1818
|
Y.current?.scrollBy({ left: 300, behavior: "smooth" });
|
|
1781
1819
|
}, []);
|
|
1782
1820
|
return /* @__PURE__ */ e(
|
|
1783
1821
|
ut,
|
|
1784
1822
|
{
|
|
1785
|
-
mode:
|
|
1823
|
+
mode: w,
|
|
1786
1824
|
onSelect: k,
|
|
1787
1825
|
minDurationMinutes: g,
|
|
1788
1826
|
slotDurationMinutes: R,
|
|
@@ -1790,7 +1828,7 @@ function qt({
|
|
|
1790
1828
|
children: /* @__PURE__ */ n(
|
|
1791
1829
|
"div",
|
|
1792
1830
|
{
|
|
1793
|
-
className:
|
|
1831
|
+
className: m(
|
|
1794
1832
|
"inno-calendar-root flex flex-col h-full p-4",
|
|
1795
1833
|
p?.root,
|
|
1796
1834
|
a
|
|
@@ -1799,18 +1837,18 @@ function qt({
|
|
|
1799
1837
|
i && /* @__PURE__ */ e(
|
|
1800
1838
|
st,
|
|
1801
1839
|
{
|
|
1802
|
-
currentDate:
|
|
1803
|
-
view:
|
|
1840
|
+
currentDate: C,
|
|
1841
|
+
view: v,
|
|
1804
1842
|
events: V,
|
|
1805
1843
|
onViewChange: T,
|
|
1806
|
-
onNavigateToday: () => F(/* @__PURE__ */ new Date(),
|
|
1844
|
+
onNavigateToday: () => F(/* @__PURE__ */ new Date(), v),
|
|
1807
1845
|
onNavigatePrev: () => {
|
|
1808
|
-
const
|
|
1809
|
-
|
|
1846
|
+
const h = new Date(C);
|
|
1847
|
+
v === "day" || v === "timeline-day" || v === "resource-day" ? h.setDate(h.getDate() - 1) : v === "timeline-3day" ? h.setDate(h.getDate() - 3) : v === "week" || v === "timeline-week" || v === "resource-week" ? h.setDate(h.getDate() - 7) : v === "month" ? h.setMonth(h.getMonth() - 1) : v === "year" ? h.setFullYear(h.getFullYear() - 1) : h.setDate(h.getDate() - 7), F(h, v);
|
|
1810
1848
|
},
|
|
1811
1849
|
onNavigateNext: () => {
|
|
1812
|
-
const
|
|
1813
|
-
|
|
1850
|
+
const h = new Date(C);
|
|
1851
|
+
v === "day" || v === "timeline-day" || v === "resource-day" ? h.setDate(h.getDate() + 1) : v === "timeline-3day" ? h.setDate(h.getDate() + 3) : v === "week" || v === "timeline-week" || v === "resource-week" ? h.setDate(h.getDate() + 7) : v === "month" ? h.setMonth(h.getMonth() + 1) : v === "year" ? h.setFullYear(h.getFullYear() + 1) : h.setDate(h.getDate() + 7), F(h, v);
|
|
1814
1852
|
},
|
|
1815
1853
|
availableViews: [
|
|
1816
1854
|
"day",
|
|
@@ -1832,11 +1870,11 @@ function qt({
|
|
|
1832
1870
|
"div",
|
|
1833
1871
|
{
|
|
1834
1872
|
ref: Y,
|
|
1835
|
-
className:
|
|
1873
|
+
className: m(
|
|
1836
1874
|
"h-full border rounded-lg bg-white overflow-x-auto",
|
|
1837
1875
|
p?.viewContainer
|
|
1838
1876
|
),
|
|
1839
|
-
children:
|
|
1877
|
+
children: P()
|
|
1840
1878
|
}
|
|
1841
1879
|
),
|
|
1842
1880
|
x && /* @__PURE__ */ e("div", { className: "inno-calendar-loading-overlay", children: /* @__PURE__ */ e("div", { className: "inno-calendar-spinner" }) }),
|
|
@@ -1886,28 +1924,28 @@ function Jt({
|
|
|
1886
1924
|
initialParticipantIds: f,
|
|
1887
1925
|
initialWorkingHoursView: c,
|
|
1888
1926
|
initialSearchQuery: x,
|
|
1889
|
-
preferencesConfig:
|
|
1927
|
+
preferencesConfig: b,
|
|
1890
1928
|
onEventClick: p,
|
|
1891
1929
|
onSlotClick: M,
|
|
1892
1930
|
onSlotSelect: A,
|
|
1893
1931
|
onAddEvent: z,
|
|
1894
|
-
onEventDrop:
|
|
1932
|
+
onEventDrop: D,
|
|
1895
1933
|
onDateChange: S,
|
|
1896
|
-
onViewChange:
|
|
1897
|
-
className:
|
|
1934
|
+
onViewChange: H,
|
|
1935
|
+
className: v,
|
|
1898
1936
|
showHeader: T = !0,
|
|
1899
|
-
minSelectionMinutes:
|
|
1937
|
+
minSelectionMinutes: C = 30,
|
|
1900
1938
|
showMoreMode: F,
|
|
1901
1939
|
showMoreEventsInPopover: R = !1,
|
|
1902
1940
|
isLoading: V = !1,
|
|
1903
|
-
renderPopover:
|
|
1941
|
+
renderPopover: B,
|
|
1904
1942
|
slots: O,
|
|
1905
|
-
classNames:
|
|
1906
|
-
settingsContent:
|
|
1943
|
+
classNames: j,
|
|
1944
|
+
settingsContent: _,
|
|
1907
1945
|
filterContent: U,
|
|
1908
|
-
headerActions:
|
|
1946
|
+
headerActions: d
|
|
1909
1947
|
}, l) {
|
|
1910
|
-
return /* @__PURE__ */ e(dt, { ...
|
|
1948
|
+
return /* @__PURE__ */ e(dt, { ...D && { onEventDrop: D }, children: /* @__PURE__ */ e(
|
|
1911
1949
|
Xe,
|
|
1912
1950
|
{
|
|
1913
1951
|
initialEvents: t,
|
|
@@ -1920,9 +1958,9 @@ function Jt({
|
|
|
1920
1958
|
...f && { initialParticipantIds: f },
|
|
1921
1959
|
...c && { initialWorkingHoursView: c },
|
|
1922
1960
|
...x && { initialSearchQuery: x },
|
|
1923
|
-
...
|
|
1961
|
+
...b && { preferencesConfig: b },
|
|
1924
1962
|
...S && { onDateChange: S },
|
|
1925
|
-
...
|
|
1963
|
+
...H && { onViewChange: H },
|
|
1926
1964
|
children: /* @__PURE__ */ e(
|
|
1927
1965
|
qt,
|
|
1928
1966
|
{
|
|
@@ -1930,30 +1968,30 @@ function Jt({
|
|
|
1930
1968
|
...M && { onSlotClick: M },
|
|
1931
1969
|
...A && { onSlotSelect: A },
|
|
1932
1970
|
...z && { onAddEvent: z },
|
|
1933
|
-
|
|
1934
|
-
className:
|
|
1971
|
+
...B && { renderPopover: B },
|
|
1972
|
+
className: v,
|
|
1935
1973
|
showHeader: T,
|
|
1936
|
-
minSelectionMinutes:
|
|
1974
|
+
minSelectionMinutes: C,
|
|
1937
1975
|
...F && { showMoreMode: F },
|
|
1938
1976
|
showMoreEventsInPopover: R,
|
|
1939
1977
|
isLoading: V,
|
|
1940
1978
|
...O && { slots: O },
|
|
1941
|
-
...
|
|
1942
|
-
settingsContent:
|
|
1979
|
+
...j && { classNames: j },
|
|
1980
|
+
settingsContent: _,
|
|
1943
1981
|
filterContent: U,
|
|
1944
|
-
headerActions:
|
|
1982
|
+
headerActions: d,
|
|
1945
1983
|
calendarRef: l
|
|
1946
1984
|
}
|
|
1947
1985
|
)
|
|
1948
1986
|
}
|
|
1949
1987
|
) });
|
|
1950
1988
|
}
|
|
1951
|
-
const Gr =
|
|
1989
|
+
const Gr = xe(Jt), re = xe(
|
|
1952
1990
|
({ className: t, children: r, ...o }, s) => /* @__PURE__ */ e(
|
|
1953
1991
|
"select",
|
|
1954
1992
|
{
|
|
1955
1993
|
ref: s,
|
|
1956
|
-
className:
|
|
1994
|
+
className: m(
|
|
1957
1995
|
"flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm",
|
|
1958
1996
|
"ring-offset-background",
|
|
1959
1997
|
"focus:outline-none focus:ring-1 focus:ring-ring",
|
|
@@ -1967,11 +2005,11 @@ const Gr = ge(Jt), re = ge(
|
|
|
1967
2005
|
)
|
|
1968
2006
|
);
|
|
1969
2007
|
re.displayName = "Select";
|
|
1970
|
-
const X =
|
|
2008
|
+
const X = xe(({ className: t, ...r }, o) => /* @__PURE__ */ e(
|
|
1971
2009
|
"label",
|
|
1972
2010
|
{
|
|
1973
2011
|
ref: o,
|
|
1974
|
-
className:
|
|
2012
|
+
className: m(
|
|
1975
2013
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
1976
2014
|
t
|
|
1977
2015
|
),
|
|
@@ -2042,7 +2080,7 @@ function Kr({
|
|
|
2042
2080
|
}, g = (f) => {
|
|
2043
2081
|
o || r(Number(f.target.value));
|
|
2044
2082
|
};
|
|
2045
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2083
|
+
return /* @__PURE__ */ n("div", { className: m("flex flex-col gap-3", s), children: [
|
|
2046
2084
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2047
2085
|
/* @__PURE__ */ e(X, { className: "text-sm font-semibold", children: i.title }),
|
|
2048
2086
|
o ? /* @__PURE__ */ e(Q, { delayDuration: 100, children: /* @__PURE__ */ n(Z, { children: [
|
|
@@ -2133,7 +2171,7 @@ function qr({
|
|
|
2133
2171
|
}, g = (c) => i.options?.[c] ?? c, f = (c) => {
|
|
2134
2172
|
o || r(c.target.value);
|
|
2135
2173
|
};
|
|
2136
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2174
|
+
return /* @__PURE__ */ n("div", { className: m("flex flex-col gap-3", s), children: [
|
|
2137
2175
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2138
2176
|
/* @__PURE__ */ e(X, { className: "text-sm font-semibold", children: i.title }),
|
|
2139
2177
|
o ? /* @__PURE__ */ e(Q, { delayDuration: 100, children: /* @__PURE__ */ n(Z, { children: [
|
|
@@ -2221,14 +2259,14 @@ function Jr({
|
|
|
2221
2259
|
...a
|
|
2222
2260
|
}, g = sr(), f = (x) => {
|
|
2223
2261
|
if (o) return;
|
|
2224
|
-
const
|
|
2225
|
-
|
|
2262
|
+
const b = Number(x.target.value);
|
|
2263
|
+
b < t.endHour && r({ ...t, startHour: b });
|
|
2226
2264
|
}, c = (x) => {
|
|
2227
2265
|
if (o) return;
|
|
2228
|
-
const
|
|
2229
|
-
|
|
2266
|
+
const b = Number(x.target.value);
|
|
2267
|
+
b > t.startHour && r({ ...t, endHour: b });
|
|
2230
2268
|
};
|
|
2231
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2269
|
+
return /* @__PURE__ */ n("div", { className: m("flex flex-col gap-3", s), children: [
|
|
2232
2270
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2233
2271
|
/* @__PURE__ */ e(X, { className: "text-sm font-semibold", children: i.title }),
|
|
2234
2272
|
o ? /* @__PURE__ */ e(Q, { delayDuration: 100, children: /* @__PURE__ */ n(Z, { children: [
|
|
@@ -2393,7 +2431,7 @@ function ur({ dayLabel: t, config: r, onChange: o, disabled: s, hourOptions: a }
|
|
|
2393
2431
|
"aria-label": `Enable ${t}`,
|
|
2394
2432
|
onClick: i,
|
|
2395
2433
|
disabled: s,
|
|
2396
|
-
className:
|
|
2434
|
+
className: m(
|
|
2397
2435
|
"flex size-5 shrink-0 items-center justify-center rounded border transition-colors",
|
|
2398
2436
|
r.enabled ? "border-primary bg-primary text-primary-foreground" : "border-input bg-background",
|
|
2399
2437
|
s && "cursor-not-allowed opacity-50"
|
|
@@ -2401,7 +2439,7 @@ function ur({ dayLabel: t, config: r, onChange: o, disabled: s, hourOptions: a }
|
|
|
2401
2439
|
children: r.enabled && /* @__PURE__ */ e(lr, { className: "size-3" })
|
|
2402
2440
|
}
|
|
2403
2441
|
),
|
|
2404
|
-
/* @__PURE__ */ e("span", { className:
|
|
2442
|
+
/* @__PURE__ */ e("span", { className: m("w-10 text-sm", !r.enabled && "text-muted-foreground"), children: t }),
|
|
2405
2443
|
/* @__PURE__ */ e(
|
|
2406
2444
|
re,
|
|
2407
2445
|
{
|
|
@@ -2441,7 +2479,7 @@ function Xr({
|
|
|
2441
2479
|
}, g = dr(), f = (c, x) => {
|
|
2442
2480
|
o || r({ ...t, [c]: x });
|
|
2443
2481
|
};
|
|
2444
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2482
|
+
return /* @__PURE__ */ n("div", { className: m("flex flex-col gap-3", s), children: [
|
|
2445
2483
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2446
2484
|
/* @__PURE__ */ e(X, { className: "text-sm font-semibold", children: i.title }),
|
|
2447
2485
|
o ? /* @__PURE__ */ e(Q, { delayDuration: 100, children: /* @__PURE__ */ n(Z, { children: [
|
|
@@ -2546,7 +2584,7 @@ function fr({ src: t, alt: r, fallback: o, className: s }) {
|
|
|
2546
2584
|
return !t || a ? /* @__PURE__ */ e(
|
|
2547
2585
|
"div",
|
|
2548
2586
|
{
|
|
2549
|
-
className:
|
|
2587
|
+
className: m(
|
|
2550
2588
|
"flex items-center justify-center bg-zinc-200 text-zinc-600 font-medium text-sm",
|
|
2551
2589
|
s
|
|
2552
2590
|
),
|
|
@@ -2557,13 +2595,13 @@ function fr({ src: t, alt: r, fallback: o, className: s }) {
|
|
|
2557
2595
|
{
|
|
2558
2596
|
src: t,
|
|
2559
2597
|
alt: r || "",
|
|
2560
|
-
className:
|
|
2598
|
+
className: m("object-cover", s),
|
|
2561
2599
|
onError: () => i(!0)
|
|
2562
2600
|
}
|
|
2563
2601
|
);
|
|
2564
2602
|
}
|
|
2565
2603
|
function Ae({ value: t, onChange: r, placeholder: o, className: s }) {
|
|
2566
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2604
|
+
return /* @__PURE__ */ n("div", { className: m("relative", s), children: [
|
|
2567
2605
|
/* @__PURE__ */ e(hr, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
2568
2606
|
/* @__PURE__ */ e(
|
|
2569
2607
|
"input",
|
|
@@ -2606,44 +2644,44 @@ function Zr({
|
|
|
2606
2644
|
className: f,
|
|
2607
2645
|
scheduleTypesLoading: c = !1,
|
|
2608
2646
|
usersLoading: x = !1,
|
|
2609
|
-
labels:
|
|
2647
|
+
labels: b,
|
|
2610
2648
|
getScheduleTypeName: p
|
|
2611
2649
|
}) {
|
|
2612
|
-
const M = { ...gr, ...
|
|
2613
|
-
|
|
2614
|
-
p?.(
|
|
2615
|
-
]) : t, [t, A, p]),
|
|
2616
|
-
const
|
|
2617
|
-
s(
|
|
2650
|
+
const M = { ...gr, ...b }, [A, z] = se(""), [D, S] = se(""), H = $(() => A.trim() ? Fe(t, A, (d) => [
|
|
2651
|
+
d.name,
|
|
2652
|
+
p?.(d) || d.name
|
|
2653
|
+
]) : t, [t, A, p]), v = $(() => D.trim() ? Fe(r, D, (d) => [d.name, d.email || ""]) : r, [r, D]), T = H.length > 0 && H.every((d) => o.includes(d.id)), C = v.length > 0 && v.every((d) => a.includes(d.id)), F = o.length + a.length, R = (d, l) => {
|
|
2654
|
+
const u = l ? [...o, d] : o.filter((w) => w !== d);
|
|
2655
|
+
s(u);
|
|
2618
2656
|
}, V = () => {
|
|
2619
2657
|
if (T) {
|
|
2620
|
-
const
|
|
2621
|
-
s(o.filter((l) => !
|
|
2658
|
+
const d = new Set(H.map((l) => l.id));
|
|
2659
|
+
s(o.filter((l) => !d.has(l)));
|
|
2622
2660
|
} else {
|
|
2623
|
-
const
|
|
2661
|
+
const d = /* @__PURE__ */ new Set([
|
|
2624
2662
|
...o,
|
|
2625
|
-
...
|
|
2663
|
+
...H.map((l) => l.id)
|
|
2626
2664
|
]);
|
|
2627
|
-
s(Array.from(
|
|
2665
|
+
s(Array.from(d));
|
|
2628
2666
|
}
|
|
2629
|
-
},
|
|
2630
|
-
const
|
|
2631
|
-
i(
|
|
2667
|
+
}, B = (d, l) => {
|
|
2668
|
+
const u = l ? [...a, d] : a.filter((w) => w !== d);
|
|
2669
|
+
i(u);
|
|
2632
2670
|
}, O = () => {
|
|
2633
|
-
if (
|
|
2634
|
-
const
|
|
2635
|
-
i(a.filter((l) => !
|
|
2671
|
+
if (C) {
|
|
2672
|
+
const d = new Set(v.map((l) => l.id));
|
|
2673
|
+
i(a.filter((l) => !d.has(l)));
|
|
2636
2674
|
} else {
|
|
2637
|
-
const
|
|
2638
|
-
i(Array.from(
|
|
2675
|
+
const d = /* @__PURE__ */ new Set([...a, ...v.map((l) => l.id)]);
|
|
2676
|
+
i(Array.from(d));
|
|
2639
2677
|
}
|
|
2640
|
-
},
|
|
2678
|
+
}, j = () => {
|
|
2641
2679
|
s([]), i([]), g?.();
|
|
2642
|
-
},
|
|
2680
|
+
}, _ = (d) => p ? p(d) : d.name, U = (d) => d.colorHex || d.color || "#069AD7";
|
|
2643
2681
|
return /* @__PURE__ */ n(
|
|
2644
2682
|
"div",
|
|
2645
2683
|
{
|
|
2646
|
-
className:
|
|
2684
|
+
className: m(
|
|
2647
2685
|
"flex min-w-72 max-w-72 flex-col rounded-lg border bg-white shadow-sm",
|
|
2648
2686
|
f
|
|
2649
2687
|
),
|
|
@@ -2657,7 +2695,7 @@ function Zr({
|
|
|
2657
2695
|
"button",
|
|
2658
2696
|
{
|
|
2659
2697
|
type: "button",
|
|
2660
|
-
onClick:
|
|
2698
|
+
onClick: j,
|
|
2661
2699
|
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",
|
|
2662
2700
|
children: [
|
|
2663
2701
|
/* @__PURE__ */ e(mr, { className: "h-3.5 w-3.5" }),
|
|
@@ -2691,7 +2729,7 @@ function Zr({
|
|
|
2691
2729
|
/* @__PURE__ */ n("div", { className: "flex max-h-[220px] flex-col gap-2 overflow-y-auto px-4 pb-2 scrollbar-thin", children: [
|
|
2692
2730
|
c ? (
|
|
2693
2731
|
// Loading skeletons
|
|
2694
|
-
Array.from({ length: 4 }).map((
|
|
2732
|
+
Array.from({ length: 4 }).map((d, l) => /* @__PURE__ */ n(
|
|
2695
2733
|
"div",
|
|
2696
2734
|
{
|
|
2697
2735
|
className: "flex animate-pulse items-center gap-2 rounded-md border border-border/60 bg-muted/40 p-2",
|
|
@@ -2702,14 +2740,14 @@ function Zr({
|
|
|
2702
2740
|
},
|
|
2703
2741
|
`skeleton-${l}`
|
|
2704
2742
|
))
|
|
2705
|
-
) :
|
|
2706
|
-
const l = o.includes(
|
|
2743
|
+
) : H.map((d) => {
|
|
2744
|
+
const l = o.includes(d.id), u = U(d);
|
|
2707
2745
|
return /* @__PURE__ */ n(
|
|
2708
2746
|
ye,
|
|
2709
2747
|
{
|
|
2710
2748
|
checked: l,
|
|
2711
|
-
onCheckedChange: (
|
|
2712
|
-
className:
|
|
2749
|
+
onCheckedChange: (w) => R(d.id, w),
|
|
2750
|
+
className: m(
|
|
2713
2751
|
"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",
|
|
2714
2752
|
l && "border-primary bg-primary/5"
|
|
2715
2753
|
),
|
|
@@ -2718,31 +2756,31 @@ function Zr({
|
|
|
2718
2756
|
/* @__PURE__ */ e(
|
|
2719
2757
|
"span",
|
|
2720
2758
|
{
|
|
2721
|
-
className:
|
|
2759
|
+
className: m(
|
|
2722
2760
|
"flex h-4 w-4 items-center justify-center rounded border border-border text-xs transition-colors",
|
|
2723
2761
|
l && "border-primary bg-primary text-primary-foreground"
|
|
2724
2762
|
),
|
|
2725
2763
|
children: l && /* @__PURE__ */ e(be, { className: "h-3 w-3" })
|
|
2726
2764
|
}
|
|
2727
2765
|
),
|
|
2728
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children:
|
|
2766
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: _(d) })
|
|
2729
2767
|
] }),
|
|
2730
2768
|
/* @__PURE__ */ e(
|
|
2731
2769
|
"div",
|
|
2732
2770
|
{
|
|
2733
2771
|
className: "h-4 w-4 rounded-full border",
|
|
2734
2772
|
style: {
|
|
2735
|
-
backgroundColor:
|
|
2736
|
-
borderColor:
|
|
2773
|
+
backgroundColor: u,
|
|
2774
|
+
borderColor: u
|
|
2737
2775
|
}
|
|
2738
2776
|
}
|
|
2739
2777
|
)
|
|
2740
2778
|
]
|
|
2741
2779
|
},
|
|
2742
|
-
|
|
2780
|
+
d.id
|
|
2743
2781
|
);
|
|
2744
2782
|
}),
|
|
2745
|
-
!c &&
|
|
2783
|
+
!c && H.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1 text-xs text-muted-foreground", children: M.noScheduleTypes })
|
|
2746
2784
|
] })
|
|
2747
2785
|
] }),
|
|
2748
2786
|
/* @__PURE__ */ e("div", { className: "h-px w-full bg-border/60" }),
|
|
@@ -2752,20 +2790,20 @@ function Zr({
|
|
|
2752
2790
|
/* @__PURE__ */ e(
|
|
2753
2791
|
ye,
|
|
2754
2792
|
{
|
|
2755
|
-
checked:
|
|
2793
|
+
checked: C,
|
|
2756
2794
|
onCheckedChange: () => O(),
|
|
2757
|
-
className:
|
|
2795
|
+
className: m(
|
|
2758
2796
|
"flex h-5 w-5 items-center justify-center rounded border border-border bg-white transition-colors hover:border-primary/50",
|
|
2759
|
-
|
|
2797
|
+
C && "border-primary bg-primary text-primary-foreground"
|
|
2760
2798
|
),
|
|
2761
|
-
children:
|
|
2799
|
+
children: C && /* @__PURE__ */ e(be, { className: "h-3.5 w-3.5" })
|
|
2762
2800
|
}
|
|
2763
2801
|
)
|
|
2764
2802
|
] }),
|
|
2765
2803
|
/* @__PURE__ */ e("div", { className: "px-4 pb-3", children: /* @__PURE__ */ e(
|
|
2766
2804
|
Ae,
|
|
2767
2805
|
{
|
|
2768
|
-
value:
|
|
2806
|
+
value: D,
|
|
2769
2807
|
onChange: S,
|
|
2770
2808
|
placeholder: M.searchParticipants
|
|
2771
2809
|
}
|
|
@@ -2773,7 +2811,7 @@ function Zr({
|
|
|
2773
2811
|
/* @__PURE__ */ n("div", { className: "flex max-h-[400px] flex-col gap-2 overflow-y-auto px-4 pb-4 scrollbar-thin", children: [
|
|
2774
2812
|
x ? (
|
|
2775
2813
|
// Loading skeletons
|
|
2776
|
-
Array.from({ length: 4 }).map((
|
|
2814
|
+
Array.from({ length: 4 }).map((d, l) => /* @__PURE__ */ n(
|
|
2777
2815
|
"div",
|
|
2778
2816
|
{
|
|
2779
2817
|
className: "flex animate-pulse items-center gap-3 rounded-md border border-border/60 bg-muted/40 p-3",
|
|
@@ -2788,14 +2826,14 @@ function Zr({
|
|
|
2788
2826
|
},
|
|
2789
2827
|
`p-skeleton-${l}`
|
|
2790
2828
|
))
|
|
2791
|
-
) :
|
|
2792
|
-
const l = a.includes(
|
|
2829
|
+
) : v.map((d) => {
|
|
2830
|
+
const l = a.includes(d.id);
|
|
2793
2831
|
return /* @__PURE__ */ n(
|
|
2794
2832
|
ye,
|
|
2795
2833
|
{
|
|
2796
2834
|
checked: l,
|
|
2797
|
-
onCheckedChange: (
|
|
2798
|
-
className:
|
|
2835
|
+
onCheckedChange: (u) => B(d.id, u),
|
|
2836
|
+
className: m(
|
|
2799
2837
|
"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",
|
|
2800
2838
|
l && "border-primary bg-zinc-50"
|
|
2801
2839
|
),
|
|
@@ -2803,7 +2841,7 @@ function Zr({
|
|
|
2803
2841
|
/* @__PURE__ */ e(
|
|
2804
2842
|
"span",
|
|
2805
2843
|
{
|
|
2806
|
-
className:
|
|
2844
|
+
className: m(
|
|
2807
2845
|
"flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border border-border transition-colors",
|
|
2808
2846
|
l && "border-primary bg-primary text-primary-foreground"
|
|
2809
2847
|
),
|
|
@@ -2814,30 +2852,30 @@ function Zr({
|
|
|
2814
2852
|
/* @__PURE__ */ e(
|
|
2815
2853
|
fr,
|
|
2816
2854
|
{
|
|
2817
|
-
src:
|
|
2818
|
-
alt:
|
|
2819
|
-
fallback:
|
|
2855
|
+
src: d.avatar ?? null,
|
|
2856
|
+
alt: d.name,
|
|
2857
|
+
fallback: d.name?.[0]?.toUpperCase() ?? "?",
|
|
2820
2858
|
className: "h-10 w-10 rounded-lg"
|
|
2821
2859
|
}
|
|
2822
2860
|
),
|
|
2823
2861
|
/* @__PURE__ */ n("div", { className: "flex max-w-[140px] flex-col gap-0.5 overflow-hidden", children: [
|
|
2824
|
-
/* @__PURE__ */ e("span", { className: "line-clamp-1 text-sm font-medium text-foreground", children:
|
|
2862
|
+
/* @__PURE__ */ e("span", { className: "line-clamp-1 text-sm font-medium text-foreground", children: d.name }),
|
|
2825
2863
|
/* @__PURE__ */ e(
|
|
2826
2864
|
"span",
|
|
2827
2865
|
{
|
|
2828
2866
|
className: "truncate text-[11px] text-muted-foreground",
|
|
2829
|
-
title:
|
|
2830
|
-
children:
|
|
2867
|
+
title: d.email,
|
|
2868
|
+
children: d.email
|
|
2831
2869
|
}
|
|
2832
2870
|
)
|
|
2833
2871
|
] })
|
|
2834
2872
|
] })
|
|
2835
2873
|
]
|
|
2836
2874
|
},
|
|
2837
|
-
|
|
2875
|
+
d.id
|
|
2838
2876
|
);
|
|
2839
2877
|
}),
|
|
2840
|
-
!x &&
|
|
2878
|
+
!x && v.length === 0 && /* @__PURE__ */ e("p", { className: "px-4 text-xs text-muted-foreground", children: M.noParticipants })
|
|
2841
2879
|
] })
|
|
2842
2880
|
] })
|
|
2843
2881
|
]
|
|
@@ -2876,7 +2914,7 @@ function en({
|
|
|
2876
2914
|
const g = (c) => {
|
|
2877
2915
|
o(c.target.value);
|
|
2878
2916
|
}, f = t.find((c) => String(c.id) === r);
|
|
2879
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2917
|
+
return /* @__PURE__ */ n("div", { className: m("flex flex-col gap-1", a), children: [
|
|
2880
2918
|
i && /* @__PURE__ */ e(X, { className: "text-xs text-muted-foreground", children: i }),
|
|
2881
2919
|
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2882
2920
|
f ? /* @__PURE__ */ e(
|
|
@@ -2935,7 +2973,7 @@ function tn({
|
|
|
2935
2973
|
const g = (f) => {
|
|
2936
2974
|
o(f.target.value);
|
|
2937
2975
|
};
|
|
2938
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2976
|
+
return /* @__PURE__ */ n("div", { className: m("flex flex-col gap-1", a), children: [
|
|
2939
2977
|
i && /* @__PURE__ */ e(X, { className: "text-xs text-muted-foreground", children: i }),
|
|
2940
2978
|
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2941
2979
|
/* @__PURE__ */ e(pr, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
@@ -3094,11 +3132,11 @@ function Mr(t, r) {
|
|
|
3094
3132
|
}).sort((s, a) => s.date.getTime() - a.date.getTime());
|
|
3095
3133
|
}
|
|
3096
3134
|
function Sr(t) {
|
|
3097
|
-
const r =
|
|
3135
|
+
const r = pe(/* @__PURE__ */ new Date()), o = Ve(/* @__PURE__ */ new Date());
|
|
3098
3136
|
return t.filter((s) => s.startDate >= r && s.startDate <= o).length;
|
|
3099
3137
|
}
|
|
3100
3138
|
function ke({ className: t }) {
|
|
3101
|
-
return /* @__PURE__ */ e("div", { className:
|
|
3139
|
+
return /* @__PURE__ */ e("div", { className: m("animate-pulse rounded-md bg-muted", t) });
|
|
3102
3140
|
}
|
|
3103
3141
|
function Er({ event: t, onClick: r }) {
|
|
3104
3142
|
return /* @__PURE__ */ n(
|
|
@@ -3106,7 +3144,7 @@ function Er({ event: t, onClick: r }) {
|
|
|
3106
3144
|
{
|
|
3107
3145
|
type: "button",
|
|
3108
3146
|
onClick: () => r?.(t),
|
|
3109
|
-
className:
|
|
3147
|
+
className: m(
|
|
3110
3148
|
"w-full text-left rounded-lg transition-colors",
|
|
3111
3149
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3112
3150
|
"flex items-start gap-3 p-2"
|
|
@@ -3131,7 +3169,7 @@ function Er({ event: t, onClick: r }) {
|
|
|
3131
3169
|
function zr({ group: t, onEventClick: r }) {
|
|
3132
3170
|
return /* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
3133
3171
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between px-2 py-1.5", children: [
|
|
3134
|
-
/* @__PURE__ */ e("h3", { className:
|
|
3172
|
+
/* @__PURE__ */ e("h3", { className: m("text-xs font-semibold", q(t.date) && "text-primary"), children: Dr(t.date) }),
|
|
3135
3173
|
t.hasMore && /* @__PURE__ */ n("span", { className: "text-[10px] text-muted-foreground", children: [
|
|
3136
3174
|
"+",
|
|
3137
3175
|
t.events.length,
|
|
@@ -3150,22 +3188,22 @@ function rn({
|
|
|
3150
3188
|
onEventClick: i,
|
|
3151
3189
|
onNavigateToAgenda: g
|
|
3152
3190
|
}) {
|
|
3153
|
-
const [f, c] = se(!1), x =
|
|
3154
|
-
const z =
|
|
3155
|
-
return t.filter((S) => S.endDate >= z && S.startDate <
|
|
3156
|
-
}, [t, s]),
|
|
3191
|
+
const [f, c] = se(!1), x = $(() => {
|
|
3192
|
+
const z = pe(/* @__PURE__ */ new Date()), D = Ue(z, s);
|
|
3193
|
+
return t.filter((S) => S.endDate >= z && S.startDate < D);
|
|
3194
|
+
}, [t, s]), b = $(
|
|
3157
3195
|
() => Mr(x, a),
|
|
3158
3196
|
[x, a]
|
|
3159
|
-
), p =
|
|
3197
|
+
), p = $(() => Sr(t), [t]), M = (z) => {
|
|
3160
3198
|
c(!1), i?.(z);
|
|
3161
3199
|
}, A = () => {
|
|
3162
3200
|
c(!1), g?.();
|
|
3163
3201
|
};
|
|
3164
|
-
return /* @__PURE__ */ n(
|
|
3202
|
+
return /* @__PURE__ */ n(Pe, { open: f, onOpenChange: c, children: [
|
|
3165
3203
|
/* @__PURE__ */ n(
|
|
3166
|
-
|
|
3204
|
+
_e,
|
|
3167
3205
|
{
|
|
3168
|
-
className:
|
|
3206
|
+
className: m(
|
|
3169
3207
|
"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",
|
|
3170
3208
|
o
|
|
3171
3209
|
),
|
|
@@ -3201,13 +3239,13 @@ function rn({
|
|
|
3201
3239
|
}
|
|
3202
3240
|
)
|
|
3203
3241
|
] }),
|
|
3204
|
-
/* @__PURE__ */ e("div", { className: "max-h-80 overflow-y-auto p-2", children: r ? /* @__PURE__ */ e("div", { className: "space-y-2 p-2", children: Array.from({ length: 3 }).map((z,
|
|
3242
|
+
/* @__PURE__ */ e("div", { className: "max-h-80 overflow-y-auto p-2", children: r ? /* @__PURE__ */ e("div", { className: "space-y-2 p-2", children: Array.from({ length: 3 }).map((z, D) => /* @__PURE__ */ n("div", { className: "flex space-x-3", children: [
|
|
3205
3243
|
/* @__PURE__ */ e(ke, { className: "h-2 w-2 rounded-full mt-2" }),
|
|
3206
3244
|
/* @__PURE__ */ n("div", { className: "flex-1 space-y-2", children: [
|
|
3207
3245
|
/* @__PURE__ */ e(ke, { className: "h-4 w-full" }),
|
|
3208
3246
|
/* @__PURE__ */ e(ke, { className: "h-3 w-3/4" })
|
|
3209
3247
|
] })
|
|
3210
|
-
] },
|
|
3248
|
+
] }, D)) }) : b.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
|
|
3211
3249
|
/* @__PURE__ */ e(wr, { className: "mb-2 h-8 w-8 text-muted-foreground/50" }),
|
|
3212
3250
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No upcoming events" }),
|
|
3213
3251
|
/* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground/70", children: [
|
|
@@ -3215,7 +3253,7 @@ function rn({
|
|
|
3215
3253
|
s,
|
|
3216
3254
|
" days"
|
|
3217
3255
|
] })
|
|
3218
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children:
|
|
3256
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children: b.map((z) => /* @__PURE__ */ e(
|
|
3219
3257
|
zr,
|
|
3220
3258
|
{
|
|
3221
3259
|
group: z,
|
|
@@ -3226,7 +3264,7 @@ function rn({
|
|
|
3226
3264
|
] })
|
|
3227
3265
|
] });
|
|
3228
3266
|
}
|
|
3229
|
-
function
|
|
3267
|
+
function Hr({ className: t }) {
|
|
3230
3268
|
return /* @__PURE__ */ n(
|
|
3231
3269
|
"svg",
|
|
3232
3270
|
{
|
|
@@ -3269,7 +3307,7 @@ function Ge({ className: t }) {
|
|
|
3269
3307
|
}
|
|
3270
3308
|
);
|
|
3271
3309
|
}
|
|
3272
|
-
function
|
|
3310
|
+
function Lr(t) {
|
|
3273
3311
|
const r = /* @__PURE__ */ new Date();
|
|
3274
3312
|
return r.setDate(r.getDate() + 1), t.getFullYear() === r.getFullYear() && t.getMonth() === r.getMonth() && t.getDate() === r.getDate();
|
|
3275
3313
|
}
|
|
@@ -3289,7 +3327,7 @@ function Ir(t) {
|
|
|
3289
3327
|
return `${r} - ${o}`;
|
|
3290
3328
|
}
|
|
3291
3329
|
function jr(t) {
|
|
3292
|
-
return q(t) ? "Today" :
|
|
3330
|
+
return q(t) ? "Today" : Lr(t) ? "Tomorrow" : Tr(t);
|
|
3293
3331
|
}
|
|
3294
3332
|
function Wr(t, r) {
|
|
3295
3333
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -3315,7 +3353,7 @@ function Ar({ event: t, onClick: r, compact: o }) {
|
|
|
3315
3353
|
{
|
|
3316
3354
|
type: "button",
|
|
3317
3355
|
onClick: () => r?.(t),
|
|
3318
|
-
className:
|
|
3356
|
+
className: m(
|
|
3319
3357
|
"w-full text-left rounded-lg transition-colors",
|
|
3320
3358
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3321
3359
|
"flex items-start gap-3",
|
|
@@ -3325,18 +3363,18 @@ function Ar({ event: t, onClick: r, compact: o }) {
|
|
|
3325
3363
|
/* @__PURE__ */ e(
|
|
3326
3364
|
"div",
|
|
3327
3365
|
{
|
|
3328
|
-
className:
|
|
3366
|
+
className: m("shrink-0 rounded-full mt-1", o ? "size-2" : "size-2.5"),
|
|
3329
3367
|
style: { backgroundColor: t.color ?? "#3b82f6" }
|
|
3330
3368
|
}
|
|
3331
3369
|
),
|
|
3332
3370
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
3333
|
-
/* @__PURE__ */ e("p", { className:
|
|
3334
|
-
/* @__PURE__ */ e("p", { className:
|
|
3371
|
+
/* @__PURE__ */ e("p", { className: m("font-medium truncate", o ? "text-xs" : "text-sm"), children: t.title }),
|
|
3372
|
+
/* @__PURE__ */ e("p", { className: m("text-muted-foreground truncate", o ? "text-[10px]" : "text-xs"), children: Ir(t) })
|
|
3335
3373
|
] }),
|
|
3336
3374
|
r && /* @__PURE__ */ e(
|
|
3337
3375
|
Ge,
|
|
3338
3376
|
{
|
|
3339
|
-
className:
|
|
3377
|
+
className: m("shrink-0 text-muted-foreground/50", o ? "size-3" : "size-4")
|
|
3340
3378
|
}
|
|
3341
3379
|
)
|
|
3342
3380
|
]
|
|
@@ -3350,11 +3388,11 @@ function Fr({
|
|
|
3350
3388
|
compact: s
|
|
3351
3389
|
}) {
|
|
3352
3390
|
return /* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
3353
|
-
/* @__PURE__ */ n("div", { className:
|
|
3391
|
+
/* @__PURE__ */ n("div", { className: m("flex items-center justify-between px-2", s ? "py-1" : "py-1.5"), children: [
|
|
3354
3392
|
/* @__PURE__ */ e(
|
|
3355
3393
|
"h3",
|
|
3356
3394
|
{
|
|
3357
|
-
className:
|
|
3395
|
+
className: m(
|
|
3358
3396
|
"font-semibold",
|
|
3359
3397
|
s ? "text-xs" : "text-sm",
|
|
3360
3398
|
q(t.date) && "text-primary"
|
|
@@ -3367,7 +3405,7 @@ function Fr({
|
|
|
3367
3405
|
{
|
|
3368
3406
|
type: "button",
|
|
3369
3407
|
onClick: () => o(t.date),
|
|
3370
|
-
className:
|
|
3408
|
+
className: m("text-primary hover:underline", s ? "text-[10px]" : "text-xs"),
|
|
3371
3409
|
children: "+more"
|
|
3372
3410
|
}
|
|
3373
3411
|
)
|
|
@@ -3387,57 +3425,57 @@ function nn({
|
|
|
3387
3425
|
showHeader: c = !0,
|
|
3388
3426
|
compact: x = !1
|
|
3389
3427
|
}) {
|
|
3390
|
-
const
|
|
3391
|
-
const
|
|
3392
|
-
return
|
|
3393
|
-
}, [A, r, M]),
|
|
3428
|
+
const b = Oe(), p = b?.filteredEvents, M = b?.currentDate ?? /* @__PURE__ */ new Date(), A = t ?? p ?? [], z = $(() => {
|
|
3429
|
+
const H = pe(M), v = new Date(H);
|
|
3430
|
+
return v.setDate(v.getDate() + r), A.filter((T) => T.endDate >= H && T.startDate < v);
|
|
3431
|
+
}, [A, r, M]), D = $(
|
|
3394
3432
|
() => Wr(z, o),
|
|
3395
3433
|
[z, o]
|
|
3396
3434
|
), S = z.length;
|
|
3397
|
-
return
|
|
3435
|
+
return D.length === 0 ? /* @__PURE__ */ n("div", { className: m("rounded-lg border bg-card", i), children: [
|
|
3398
3436
|
c && /* @__PURE__ */ e(
|
|
3399
3437
|
"div",
|
|
3400
3438
|
{
|
|
3401
|
-
className:
|
|
3439
|
+
className: m(
|
|
3402
3440
|
"border-b px-4 flex items-center justify-between",
|
|
3403
3441
|
x ? "py-2" : "py-3"
|
|
3404
3442
|
),
|
|
3405
|
-
children: /* @__PURE__ */ e("h2", { className:
|
|
3443
|
+
children: /* @__PURE__ */ e("h2", { className: m("font-semibold", x ? "text-sm" : "text-base"), children: f })
|
|
3406
3444
|
}
|
|
3407
3445
|
),
|
|
3408
3446
|
/* @__PURE__ */ e(
|
|
3409
3447
|
"div",
|
|
3410
3448
|
{
|
|
3411
|
-
className:
|
|
3449
|
+
className: m(
|
|
3412
3450
|
"flex flex-col items-center justify-center text-center",
|
|
3413
3451
|
x ? "py-6 px-4" : "py-10 px-6"
|
|
3414
3452
|
),
|
|
3415
3453
|
children: g ?? /* @__PURE__ */ n(ne, { children: [
|
|
3416
3454
|
/* @__PURE__ */ e(
|
|
3417
|
-
|
|
3455
|
+
Hr,
|
|
3418
3456
|
{
|
|
3419
|
-
className:
|
|
3457
|
+
className: m("text-muted-foreground/50 mb-2", x ? "size-8" : "size-10")
|
|
3420
3458
|
}
|
|
3421
3459
|
),
|
|
3422
|
-
/* @__PURE__ */ e("p", { className:
|
|
3460
|
+
/* @__PURE__ */ e("p", { className: m("text-muted-foreground", x ? "text-xs" : "text-sm"), children: "No upcoming events" })
|
|
3423
3461
|
] })
|
|
3424
3462
|
}
|
|
3425
3463
|
)
|
|
3426
|
-
] }) : /* @__PURE__ */ n("div", { className:
|
|
3464
|
+
] }) : /* @__PURE__ */ n("div", { className: m("rounded-lg border bg-card overflow-hidden", i), children: [
|
|
3427
3465
|
c && /* @__PURE__ */ n(
|
|
3428
3466
|
"div",
|
|
3429
3467
|
{
|
|
3430
|
-
className:
|
|
3468
|
+
className: m(
|
|
3431
3469
|
"border-b px-4 flex items-center justify-between",
|
|
3432
3470
|
x ? "py-2" : "py-3"
|
|
3433
3471
|
),
|
|
3434
3472
|
children: [
|
|
3435
3473
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
3436
|
-
/* @__PURE__ */ e("h2", { className:
|
|
3474
|
+
/* @__PURE__ */ e("h2", { className: m("font-semibold", x ? "text-sm" : "text-base"), children: f }),
|
|
3437
3475
|
/* @__PURE__ */ e(
|
|
3438
3476
|
"span",
|
|
3439
3477
|
{
|
|
3440
|
-
className:
|
|
3478
|
+
className: m(
|
|
3441
3479
|
"text-muted-foreground bg-muted rounded-full px-2",
|
|
3442
3480
|
x ? "text-[10px] py-0" : "text-xs py-0.5"
|
|
3443
3481
|
),
|
|
@@ -3450,7 +3488,7 @@ function nn({
|
|
|
3450
3488
|
{
|
|
3451
3489
|
type: "button",
|
|
3452
3490
|
onClick: () => a(),
|
|
3453
|
-
className:
|
|
3491
|
+
className: m(
|
|
3454
3492
|
"text-primary hover:underline flex items-center gap-0.5",
|
|
3455
3493
|
x ? "text-xs" : "text-sm"
|
|
3456
3494
|
),
|
|
@@ -3466,19 +3504,19 @@ function nn({
|
|
|
3466
3504
|
/* @__PURE__ */ e(
|
|
3467
3505
|
"div",
|
|
3468
3506
|
{
|
|
3469
|
-
className:
|
|
3507
|
+
className: m(
|
|
3470
3508
|
"divide-y overflow-auto",
|
|
3471
3509
|
x ? "p-2 max-h-[280px]" : "p-3 max-h-[400px]"
|
|
3472
3510
|
),
|
|
3473
|
-
children:
|
|
3511
|
+
children: D.map((H) => /* @__PURE__ */ e(
|
|
3474
3512
|
Fr,
|
|
3475
3513
|
{
|
|
3476
|
-
group:
|
|
3514
|
+
group: H,
|
|
3477
3515
|
onEventClick: s,
|
|
3478
|
-
onViewMore: a ? (
|
|
3516
|
+
onViewMore: a ? (v) => a(v) : void 0,
|
|
3479
3517
|
compact: x
|
|
3480
3518
|
},
|
|
3481
|
-
|
|
3519
|
+
H.dateKey
|
|
3482
3520
|
))
|
|
3483
3521
|
}
|
|
3484
3522
|
)
|
|
@@ -3492,7 +3530,7 @@ export {
|
|
|
3492
3530
|
Yr as E,
|
|
3493
3531
|
Gr as I,
|
|
3494
3532
|
en as S,
|
|
3495
|
-
|
|
3533
|
+
de as T,
|
|
3496
3534
|
tn as U,
|
|
3497
3535
|
Jr as V,
|
|
3498
3536
|
Xr as W,
|
|
@@ -3501,4 +3539,4 @@ export {
|
|
|
3501
3539
|
Zr as b,
|
|
3502
3540
|
Kr as c
|
|
3503
3541
|
};
|
|
3504
|
-
//# sourceMappingURL=agenda-widget-
|
|
3542
|
+
//# sourceMappingURL=agenda-widget-DfS-16x0.js.map
|