@innosolutions/inno-calendar 1.0.38 → 1.0.40
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-B5Sgvvry.cjs +2 -0
- package/dist/agenda-widget-B5Sgvvry.cjs.map +1 -0
- package/dist/{agenda-widget-CNUXKiQT.js → agenda-widget-C5uR9Raa.js} +1055 -1052
- package/dist/agenda-widget-C5uR9Raa.js.map +1 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/components/inno-calendar.d.ts +11 -0
- package/dist/components/inno-calendar.d.ts.map +1 -1
- package/dist/components/primitives/index.d.ts +1 -0
- package/dist/components/primitives/index.d.ts.map +1 -1
- package/dist/components/primitives/multi-day-banner.d.ts +17 -3
- package/dist/components/primitives/multi-day-banner.d.ts.map +1 -1
- package/dist/components/primitives/week-all-day-row.d.ts +40 -0
- package/dist/components/primitives/week-all-day-row.d.ts.map +1 -0
- package/dist/components/views/day-events-expansion.d.ts.map +1 -1
- package/dist/components/views/day-view.d.ts.map +1 -1
- package/dist/components/views/week-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-BqhSHRk0.cjs → tailwind-calendar-B2vvMCsL.cjs} +2 -2
- package/dist/{tailwind-calendar-BqhSHRk0.cjs.map → tailwind-calendar-B2vvMCsL.cjs.map} +1 -1
- package/dist/{tailwind-calendar-BvWm9ry9.js → tailwind-calendar-C1_6GoL0.js} +2 -2
- package/dist/{tailwind-calendar-BvWm9ry9.js.map → tailwind-calendar-C1_6GoL0.js.map} +1 -1
- package/dist/week-view-DBsCYSce.cjs +11 -0
- package/dist/week-view-DBsCYSce.cjs.map +1 -0
- package/dist/{week-view-BGthazCB.js → week-view-Dh-gHd0m.js} +1486 -1189
- package/dist/week-view-Dh-gHd0m.js.map +1 -0
- package/package.json +2 -2
- package/dist/agenda-widget-BsRtRyZ3.cjs +0 -2
- package/dist/agenda-widget-BsRtRyZ3.cjs.map +0 -1
- package/dist/agenda-widget-CNUXKiQT.js.map +0 -1
- package/dist/week-view-BGthazCB.js.map +0 -1
- package/dist/week-view-DOvr2VIq.cjs +0 -11
- package/dist/week-view-DOvr2VIq.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as n, Fragment as
|
|
2
|
-
import { o as Oe, c as
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { c as
|
|
5
|
-
import { P as _e, i as Pe, h as Re, m as
|
|
6
|
-
import { D as
|
|
7
|
-
import { isToday as q, startOfDay as
|
|
8
|
-
function
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as ne } from "react/jsx-runtime";
|
|
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 he, forwardRef as ge, useRef as Ne, useMemo as B, useLayoutEffect as Ze, useImperativeHandle as et } from "react";
|
|
4
|
+
import { c as h } from "./index-DtaLkIY8.js";
|
|
5
|
+
import { P as _e, i as Pe, 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-Dh-gHd0m.js";
|
|
6
|
+
import { D as dt, S as ut } from "./slot-selection-context-D2eu2o-7.js";
|
|
7
|
+
import { isToday as q, startOfDay as xe, endOfDay as Ve, getYearMonths as ht, generateMonthGrid as mt, getEventsForDay as ft, addDays as Ue, formatDateISO as gt } from "./utils.mjs";
|
|
8
|
+
function xt({ view: t, className: r = "" }) {
|
|
9
9
|
return /* @__PURE__ */ e(
|
|
10
10
|
"div",
|
|
11
11
|
{
|
|
@@ -30,48 +30,48 @@ function gt({ view: t, className: r = "" }) {
|
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
function Me({ view: t, className: r }) {
|
|
33
|
-
return /* @__PURE__ */ e(
|
|
33
|
+
return /* @__PURE__ */ e(xt, { view: t, className: r });
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Ur(t) {
|
|
36
36
|
const {
|
|
37
37
|
events: r,
|
|
38
38
|
resources: o,
|
|
39
39
|
scheduleTypes: s,
|
|
40
40
|
initialView: a = "week",
|
|
41
41
|
initialDate: i,
|
|
42
|
-
initialFilters:
|
|
43
|
-
preferences:
|
|
42
|
+
initialFilters: g,
|
|
43
|
+
preferences: f,
|
|
44
44
|
locale: c,
|
|
45
|
-
slots:
|
|
46
|
-
renderEvent:
|
|
47
|
-
onViewChange:
|
|
48
|
-
onDateChange:
|
|
49
|
-
onEventClick:
|
|
50
|
-
onSlotSelect:
|
|
51
|
-
onFiltersChange:
|
|
52
|
-
className:
|
|
53
|
-
children:
|
|
54
|
-
} = t,
|
|
55
|
-
if (
|
|
56
|
-
return /* @__PURE__ */ e("div", { className:
|
|
57
|
-
const
|
|
45
|
+
slots: x,
|
|
46
|
+
renderEvent: y,
|
|
47
|
+
onViewChange: p,
|
|
48
|
+
onDateChange: M,
|
|
49
|
+
onEventClick: A,
|
|
50
|
+
onSlotSelect: z,
|
|
51
|
+
onFiltersChange: C,
|
|
52
|
+
className: S,
|
|
53
|
+
children: L
|
|
54
|
+
} = t, w = Oe();
|
|
55
|
+
if (w)
|
|
56
|
+
return /* @__PURE__ */ e("div", { className: S, style: { position: "relative" }, children: L ?? /* @__PURE__ */ e(Me, { view: w.view, className: S }) });
|
|
57
|
+
const T = qe({
|
|
58
58
|
events: r,
|
|
59
59
|
resources: o,
|
|
60
60
|
scheduleTypes: s,
|
|
61
61
|
initialView: a,
|
|
62
62
|
initialDate: i,
|
|
63
|
-
initialFilters:
|
|
64
|
-
preferences:
|
|
63
|
+
initialFilters: g,
|
|
64
|
+
preferences: f,
|
|
65
65
|
locale: c,
|
|
66
|
-
onViewChange:
|
|
67
|
-
onDateChange:
|
|
68
|
-
onEventClick:
|
|
69
|
-
onSlotSelect:
|
|
70
|
-
onFiltersChange:
|
|
66
|
+
onViewChange: p,
|
|
67
|
+
onDateChange: M,
|
|
68
|
+
onEventClick: A,
|
|
69
|
+
onSlotSelect: z,
|
|
70
|
+
onFiltersChange: C
|
|
71
71
|
});
|
|
72
|
-
return /* @__PURE__ */ e(
|
|
72
|
+
return /* @__PURE__ */ e(Je, { value: T, children: /* @__PURE__ */ e("div", { className: S, style: { position: "relative" }, children: L ?? /* @__PURE__ */ e(Me, { view: T.view, className: S }) }) });
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function pt({ className: t }) {
|
|
75
75
|
return /* @__PURE__ */ n(
|
|
76
76
|
"svg",
|
|
77
77
|
{
|
|
@@ -112,7 +112,7 @@ function Ye({ className: t }) {
|
|
|
112
112
|
}
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function fe({ className: t }) {
|
|
116
116
|
return /* @__PURE__ */ n(
|
|
117
117
|
"svg",
|
|
118
118
|
{
|
|
@@ -131,7 +131,7 @@ function me({ className: t }) {
|
|
|
131
131
|
}
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function vt({ className: t }) {
|
|
135
135
|
return /* @__PURE__ */ n(
|
|
136
136
|
"svg",
|
|
137
137
|
{
|
|
@@ -166,7 +166,7 @@ function de({ className: t }) {
|
|
|
166
166
|
}
|
|
167
167
|
);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function wt({ className: t }) {
|
|
170
170
|
return /* @__PURE__ */ n(
|
|
171
171
|
"svg",
|
|
172
172
|
{
|
|
@@ -185,7 +185,7 @@ function vt({ className: t }) {
|
|
|
185
185
|
}
|
|
186
186
|
);
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function bt({ className: t }) {
|
|
189
189
|
return /* @__PURE__ */ e(
|
|
190
190
|
"svg",
|
|
191
191
|
{
|
|
@@ -201,7 +201,7 @@ function wt({ className: t }) {
|
|
|
201
201
|
}
|
|
202
202
|
);
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function yt({ className: t }) {
|
|
205
205
|
return /* @__PURE__ */ n(
|
|
206
206
|
"svg",
|
|
207
207
|
{
|
|
@@ -222,7 +222,7 @@ function bt({ className: t }) {
|
|
|
222
222
|
}
|
|
223
223
|
);
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function kt({ className: t }) {
|
|
226
226
|
return /* @__PURE__ */ n(
|
|
227
227
|
"svg",
|
|
228
228
|
{
|
|
@@ -241,7 +241,7 @@ function yt({ className: t }) {
|
|
|
241
241
|
}
|
|
242
242
|
);
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function Nt({ className: t }) {
|
|
245
245
|
return /* @__PURE__ */ n(
|
|
246
246
|
"svg",
|
|
247
247
|
{
|
|
@@ -262,7 +262,7 @@ function kt({ className: t }) {
|
|
|
262
262
|
}
|
|
263
263
|
);
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function Ct({ className: t }) {
|
|
266
266
|
return /* @__PURE__ */ n(
|
|
267
267
|
"svg",
|
|
268
268
|
{
|
|
@@ -295,12 +295,12 @@ function le({ className: t }) {
|
|
|
295
295
|
strokeWidth: "2",
|
|
296
296
|
strokeLinecap: "round",
|
|
297
297
|
strokeLinejoin: "round",
|
|
298
|
-
className:
|
|
298
|
+
className: h("animate-spin", t),
|
|
299
299
|
children: /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
300
300
|
}
|
|
301
301
|
);
|
|
302
302
|
}
|
|
303
|
-
const
|
|
303
|
+
const Dt = {
|
|
304
304
|
edit: "Edit",
|
|
305
305
|
delete: "Delete",
|
|
306
306
|
cancel: "Cancel Event",
|
|
@@ -325,15 +325,15 @@ const Ct = {
|
|
|
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
|
-
}, ue =
|
|
329
|
-
({ onClick: t, label: r, children: o, className: s, variant: a = "ghost", ...i },
|
|
330
|
-
/* @__PURE__ */ e(
|
|
328
|
+
}, ue = ge(
|
|
329
|
+
({ onClick: t, label: r, children: o, className: s, variant: a = "ghost", ...i }, g) => /* @__PURE__ */ n(Z, { children: [
|
|
330
|
+
/* @__PURE__ */ e(ee, { asChild: !0, children: /* @__PURE__ */ e(
|
|
331
331
|
"button",
|
|
332
332
|
{
|
|
333
333
|
type: "button",
|
|
334
|
-
ref:
|
|
334
|
+
ref: g,
|
|
335
335
|
onClick: t,
|
|
336
|
-
className:
|
|
336
|
+
className: h(
|
|
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",
|
|
@@ -344,16 +344,16 @@ const Ct = {
|
|
|
344
344
|
children: o
|
|
345
345
|
}
|
|
346
346
|
) }),
|
|
347
|
-
/* @__PURE__ */ e(
|
|
347
|
+
/* @__PURE__ */ e(te, { side: "bottom", className: "text-xs", children: r })
|
|
348
348
|
] })
|
|
349
349
|
);
|
|
350
350
|
ue.displayName = "IconButton";
|
|
351
|
-
function
|
|
352
|
-
const [i,
|
|
351
|
+
function Mt({ src: t, alt: r, initials: o, className: s, isClient: a }) {
|
|
352
|
+
const [i, g] = se(!1);
|
|
353
353
|
return /* @__PURE__ */ e(
|
|
354
354
|
"div",
|
|
355
355
|
{
|
|
356
|
-
className:
|
|
356
|
+
className: h(
|
|
357
357
|
"relative h-7 w-7 rounded-full overflow-hidden shrink-0",
|
|
358
358
|
s
|
|
359
359
|
),
|
|
@@ -363,12 +363,12 @@ function Dt({ src: t, alt: r, initials: o, className: s, isClient: a }) {
|
|
|
363
363
|
src: t,
|
|
364
364
|
alt: r,
|
|
365
365
|
className: "h-full w-full object-cover",
|
|
366
|
-
onError: () =>
|
|
366
|
+
onError: () => g(!0)
|
|
367
367
|
}
|
|
368
368
|
) : /* @__PURE__ */ e(
|
|
369
369
|
"div",
|
|
370
370
|
{
|
|
371
|
-
className:
|
|
371
|
+
className: h(
|
|
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,47 +383,47 @@ function Se({
|
|
|
383
383
|
isEventCanceled: r = !1,
|
|
384
384
|
labels: o
|
|
385
385
|
}) {
|
|
386
|
-
const s = t.name || "Unknown", a = s.split(" ").map((
|
|
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, y = t.profilePicture || t.avatar, p = r;
|
|
387
387
|
return /* @__PURE__ */ n(
|
|
388
388
|
"div",
|
|
389
389
|
{
|
|
390
|
-
className:
|
|
390
|
+
className: h(
|
|
391
391
|
"flex items-center gap-3 py-0",
|
|
392
|
-
|
|
392
|
+
p && "opacity-60"
|
|
393
393
|
),
|
|
394
394
|
children: [
|
|
395
395
|
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
396
396
|
/* @__PURE__ */ e(
|
|
397
|
-
|
|
397
|
+
Mt,
|
|
398
398
|
{
|
|
399
|
-
src:
|
|
399
|
+
src: y,
|
|
400
400
|
alt: s,
|
|
401
401
|
initials: a,
|
|
402
|
-
isClient:
|
|
403
|
-
className:
|
|
402
|
+
isClient: x,
|
|
403
|
+
className: h(p && "grayscale")
|
|
404
404
|
}
|
|
405
405
|
),
|
|
406
|
-
|
|
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(fe, { 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(de, { 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: h(
|
|
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
|
),
|
|
416
416
|
children: s
|
|
417
417
|
}
|
|
418
418
|
) }),
|
|
419
|
-
|
|
420
|
-
i && !
|
|
419
|
+
x && /* @__PURE__ */ e("div", { className: "text-[10px] px-1.5 w-fit py-0.5 rounded bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 font-medium", children: o.client }),
|
|
420
|
+
i && !p && /* @__PURE__ */ e("div", { className: "text-xs text-zinc-500", children: o.organizer })
|
|
421
421
|
] })
|
|
422
422
|
]
|
|
423
423
|
}
|
|
424
424
|
);
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function St({
|
|
427
427
|
open: t,
|
|
428
428
|
onOpenChange: r,
|
|
429
429
|
title: o,
|
|
@@ -454,15 +454,15 @@ function Mt({
|
|
|
454
454
|
] }) })
|
|
455
455
|
] }) : null;
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function Et({
|
|
458
458
|
open: t,
|
|
459
459
|
onOpenChange: r,
|
|
460
460
|
title: o,
|
|
461
461
|
description: s,
|
|
462
462
|
cancelLabel: a,
|
|
463
463
|
confirmLabel: i,
|
|
464
|
-
onConfirm:
|
|
465
|
-
isLoading:
|
|
464
|
+
onConfirm: g,
|
|
465
|
+
isLoading: f
|
|
466
466
|
}) {
|
|
467
467
|
return t ? /* @__PURE__ */ n("div", { className: "fixed inset-0 z-[60]", children: [
|
|
468
468
|
/* @__PURE__ */ e(
|
|
@@ -480,7 +480,7 @@ function St({
|
|
|
480
480
|
/* @__PURE__ */ e("p", { className: "mt-2 text-sm text-zinc-600 dark:text-zinc-400", children: s }),
|
|
481
481
|
/* @__PURE__ */ n("div", { className: "mt-4 flex justify-end gap-3", children: [
|
|
482
482
|
/* @__PURE__ */ e(
|
|
483
|
-
|
|
483
|
+
ae,
|
|
484
484
|
{
|
|
485
485
|
variant: "outline",
|
|
486
486
|
size: "sm",
|
|
@@ -489,14 +489,14 @@ function St({
|
|
|
489
489
|
}
|
|
490
490
|
),
|
|
491
491
|
/* @__PURE__ */ n(
|
|
492
|
-
|
|
492
|
+
ae,
|
|
493
493
|
{
|
|
494
494
|
variant: "destructive",
|
|
495
495
|
size: "sm",
|
|
496
|
-
onClick:
|
|
497
|
-
disabled:
|
|
496
|
+
onClick: g,
|
|
497
|
+
disabled: f,
|
|
498
498
|
children: [
|
|
499
|
-
|
|
499
|
+
f && /* @__PURE__ */ e(le, { className: "h-4 w-4 mr-2" }),
|
|
500
500
|
/* @__PURE__ */ e(Ye, { className: "h-4 w-4 mr-2" }),
|
|
501
501
|
i
|
|
502
502
|
]
|
|
@@ -506,14 +506,14 @@ function St({
|
|
|
506
506
|
] }) })
|
|
507
507
|
] }) : null;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function zt(t, r) {
|
|
510
510
|
return t.toLocaleDateString(void 0, {
|
|
511
511
|
weekday: "long",
|
|
512
512
|
month: "long",
|
|
513
513
|
day: "numeric"
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function Lt(t, r) {
|
|
517
517
|
const o = {
|
|
518
518
|
hour: "2-digit",
|
|
519
519
|
minute: "2-digit",
|
|
@@ -521,7 +521,7 @@ function zt(t, r) {
|
|
|
521
521
|
};
|
|
522
522
|
return `${t.toLocaleTimeString(void 0, o)} – ${r.toLocaleTimeString(void 0, o)}`;
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function Ht(t) {
|
|
525
525
|
return t.toLocaleDateString(void 0, {
|
|
526
526
|
day: "2-digit",
|
|
527
527
|
month: "short",
|
|
@@ -530,8 +530,8 @@ function Lt(t) {
|
|
|
530
530
|
minute: "2-digit"
|
|
531
531
|
});
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
const [r, o] =
|
|
533
|
+
function Tt(t) {
|
|
534
|
+
const [r, o] = se(() => typeof window < "u" ? window.matchMedia(t).matches : !1);
|
|
535
535
|
return he(() => {
|
|
536
536
|
if (typeof window > "u") return;
|
|
537
537
|
const s = window.matchMedia(t), a = (i) => o(i.matches);
|
|
@@ -545,58 +545,58 @@ function Ee({
|
|
|
545
545
|
onClose: s,
|
|
546
546
|
onEdit: a,
|
|
547
547
|
onDelete: i,
|
|
548
|
-
onCancel:
|
|
549
|
-
onAccept:
|
|
548
|
+
onCancel: g,
|
|
549
|
+
onAccept: f,
|
|
550
550
|
onDecline: c,
|
|
551
|
-
onConfirmMeeting:
|
|
552
|
-
canEdit:
|
|
553
|
-
canDelete:
|
|
554
|
-
canCancel:
|
|
555
|
-
isCurrentUserParticipant:
|
|
556
|
-
isCurrentUserClient:
|
|
557
|
-
currentUserAcceptStatus:
|
|
558
|
-
isAcceptLoading:
|
|
559
|
-
isDeclineLoading:
|
|
560
|
-
isConfirmLoading:
|
|
561
|
-
isDeleteLoading:
|
|
562
|
-
renderParticipant:
|
|
563
|
-
renderHeaderActions:
|
|
564
|
-
renderCancelReason:
|
|
565
|
-
renderDeleteConfirmation:
|
|
566
|
-
formatDate:
|
|
567
|
-
formatTimeRange:
|
|
551
|
+
onConfirmMeeting: x,
|
|
552
|
+
canEdit: y = !0,
|
|
553
|
+
canDelete: p = !1,
|
|
554
|
+
canCancel: M = !0,
|
|
555
|
+
isCurrentUserParticipant: A = !1,
|
|
556
|
+
isCurrentUserClient: z = !1,
|
|
557
|
+
currentUserAcceptStatus: C,
|
|
558
|
+
isAcceptLoading: S = !1,
|
|
559
|
+
isDeclineLoading: L = !1,
|
|
560
|
+
isConfirmLoading: w = !1,
|
|
561
|
+
isDeleteLoading: T = !1,
|
|
562
|
+
renderParticipant: D,
|
|
563
|
+
renderHeaderActions: F,
|
|
564
|
+
renderCancelReason: R,
|
|
565
|
+
renderDeleteConfirmation: V,
|
|
566
|
+
formatDate: $ = zt,
|
|
567
|
+
formatTimeRange: O = Lt
|
|
568
568
|
}) {
|
|
569
|
-
const [
|
|
569
|
+
const [I, P] = se(!1), U = !(t.isCanceled || t.meetingTookPlace), u = t.isRecurring ?? !1, l = t.participantDetails, d = t.participantsNames || [], v = l && l.length > 0, k = C === !0, b = C === !1, H = A && !z && U, E = v ? l.filter((j) => j.isConfirmed).length : t.isAccepted ? d.length : 0, _ = v ? l.length : d.length, Y = t.scheduleTypeColor || t.hexColor || "#039BE5", K = oe(() => t.startDate ? $(t.startDate) : r.noDateProvided, [t.startDate, $, 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
|
-
},
|
|
572
|
-
s(),
|
|
573
|
-
},
|
|
574
|
-
|
|
575
|
-
},
|
|
576
|
-
i?.(t),
|
|
571
|
+
}, m = () => {
|
|
572
|
+
s(), g?.(t);
|
|
573
|
+
}, N = () => {
|
|
574
|
+
P(!0);
|
|
575
|
+
}, W = () => {
|
|
576
|
+
i?.(t), P(!1);
|
|
577
577
|
};
|
|
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(
|
|
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
|
-
/* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children:
|
|
581
|
-
U &&
|
|
582
|
-
U &&
|
|
583
|
-
|
|
580
|
+
/* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children: F ? F({ onClose: s }) : /* @__PURE__ */ n(ne, { children: [
|
|
581
|
+
U && y && a && /* @__PURE__ */ e(ue, { onClick: ie, label: r.edit, children: /* @__PURE__ */ e(pt, { className: "h-[18px] w-[18px]" }) }),
|
|
582
|
+
U && M && g && /* @__PURE__ */ e(ue, { onClick: m, label: r.cancel, children: /* @__PURE__ */ e(vt, { className: "h-[18px] w-[18px]" }) }),
|
|
583
|
+
p && i && /* @__PURE__ */ e(
|
|
584
584
|
ue,
|
|
585
585
|
{
|
|
586
|
-
onClick:
|
|
586
|
+
onClick: N,
|
|
587
587
|
label: r.delete,
|
|
588
588
|
variant: "destructive",
|
|
589
589
|
children: /* @__PURE__ */ e(Ye, { className: "h-[18px] w-[18px]" })
|
|
590
590
|
}
|
|
591
591
|
),
|
|
592
|
-
/* @__PURE__ */ e(ue, { onClick: s, label: r.close, children: /* @__PURE__ */ e(
|
|
592
|
+
/* @__PURE__ */ e(ue, { onClick: s, label: r.close, children: /* @__PURE__ */ e(fe, { 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(
|
|
596
596
|
"div",
|
|
597
597
|
{
|
|
598
598
|
className: "w-4 h-4 rounded mt-1 shrink-0",
|
|
599
|
-
style: { backgroundColor:
|
|
599
|
+
style: { backgroundColor: Y }
|
|
600
600
|
}
|
|
601
601
|
),
|
|
602
602
|
/* @__PURE__ */ n("div", { className: "flex-1 min-w-0", children: [
|
|
@@ -604,7 +604,7 @@ function Ee({
|
|
|
604
604
|
/* @__PURE__ */ e(
|
|
605
605
|
"h2",
|
|
606
606
|
{
|
|
607
|
-
className:
|
|
607
|
+
className: h(
|
|
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
|
),
|
|
@@ -612,25 +612,25 @@ function Ee({
|
|
|
612
612
|
}
|
|
613
613
|
),
|
|
614
614
|
t.meetingTookPlace && /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 text-xs font-medium", children: [
|
|
615
|
-
/* @__PURE__ */ e(
|
|
615
|
+
/* @__PURE__ */ e(wt, { className: "h-3 w-3" }),
|
|
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(fe, { className: "h-3 w-3" }),
|
|
620
620
|
r.canceled
|
|
621
621
|
] })
|
|
622
622
|
] }),
|
|
623
623
|
/* @__PURE__ */ n("div", { className: "mt-1 text-sm text-zinc-600 dark:text-zinc-400", children: [
|
|
624
624
|
/* @__PURE__ */ e("span", { children: K() }),
|
|
625
|
-
|
|
625
|
+
J() && /* @__PURE__ */ n(ne, { children: [
|
|
626
626
|
/* @__PURE__ */ e("span", { className: "mx-1.5", children: "·" }),
|
|
627
|
-
/* @__PURE__ */ e("span", { children:
|
|
627
|
+
/* @__PURE__ */ e("span", { children: J() })
|
|
628
628
|
] })
|
|
629
629
|
] }),
|
|
630
|
-
|
|
630
|
+
u && t.recurrenceSummary && /* @__PURE__ */ e("div", { className: "text-sm text-zinc-500 dark:text-zinc-500", children: t.recurrenceSummary })
|
|
631
631
|
] })
|
|
632
632
|
] }) }),
|
|
633
|
-
t.isCanceled && /* @__PURE__ */ e("div", { className: "mx-4 p-3 rounded-lg bg-red-50 dark:bg-red-950/30", children:
|
|
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: [
|
|
634
634
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-red-700 dark:text-red-400", children: r.cancellationNote }),
|
|
635
635
|
t.cancelReason && /* @__PURE__ */ n("div", { className: "mt-1 text-sm text-red-600/80 dark:text-red-400/80 italic", children: [
|
|
636
636
|
'"',
|
|
@@ -640,16 +640,16 @@ 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
|
+
Ht(t.canceledDate)
|
|
644
644
|
] })
|
|
645
645
|
] }) }) }),
|
|
646
646
|
/* @__PURE__ */ n("div", { className: "space-y-0.5", children: [
|
|
647
647
|
t.address && /* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
|
|
648
|
-
/* @__PURE__ */ e(
|
|
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
|
-
(v ||
|
|
652
|
-
/* @__PURE__ */ e(
|
|
651
|
+
(v || d.length > 0) && /* @__PURE__ */ n("div", { className: "flex items-start gap-2 py-0", children: [
|
|
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: [
|
|
@@ -659,7 +659,7 @@ function Ee({
|
|
|
659
659
|
] }),
|
|
660
660
|
_ > 0 && /* @__PURE__ */ n("span", { className: "text-xs text-zinc-500", children: [
|
|
661
661
|
"(",
|
|
662
|
-
|
|
662
|
+
E,
|
|
663
663
|
" ",
|
|
664
664
|
r.confirmed,
|
|
665
665
|
")"
|
|
@@ -667,32 +667,32 @@ function Ee({
|
|
|
667
667
|
] }),
|
|
668
668
|
/* @__PURE__ */ n("div", { className: "mt-2 space-y-2", children: [
|
|
669
669
|
v ? l.slice(0, 6).map(
|
|
670
|
-
(
|
|
670
|
+
(j, G) => D ? D(j, G) : /* @__PURE__ */ e(
|
|
671
671
|
Se,
|
|
672
672
|
{
|
|
673
|
-
participant:
|
|
673
|
+
participant: j,
|
|
674
674
|
isEventCanceled: t.isCanceled,
|
|
675
675
|
labels: r
|
|
676
676
|
},
|
|
677
|
-
|
|
677
|
+
j.id
|
|
678
678
|
)
|
|
679
|
-
) :
|
|
680
|
-
const
|
|
681
|
-
id: String(
|
|
682
|
-
name:
|
|
679
|
+
) : d.slice(0, 6).map((j, G) => {
|
|
680
|
+
const me = {
|
|
681
|
+
id: String(G),
|
|
682
|
+
name: j,
|
|
683
683
|
email: "",
|
|
684
684
|
isConfirmed: t.isAccepted,
|
|
685
|
-
isOrganizer:
|
|
685
|
+
isOrganizer: G === 0,
|
|
686
686
|
isClient: !1
|
|
687
687
|
};
|
|
688
|
-
return
|
|
688
|
+
return D ? D(me, G) : /* @__PURE__ */ e(
|
|
689
689
|
Se,
|
|
690
690
|
{
|
|
691
|
-
participant:
|
|
691
|
+
participant: me,
|
|
692
692
|
isEventCanceled: t.isCanceled,
|
|
693
693
|
labels: r
|
|
694
694
|
},
|
|
695
|
-
|
|
695
|
+
j
|
|
696
696
|
);
|
|
697
697
|
}),
|
|
698
698
|
_ > 6 && /* @__PURE__ */ n("div", { className: "text-xs text-zinc-500 py-1.5 pl-10", children: [
|
|
@@ -705,203 +705,203 @@ function Ee({
|
|
|
705
705
|
] })
|
|
706
706
|
] }),
|
|
707
707
|
t.description && /* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
|
|
708
|
-
/* @__PURE__ */ e(
|
|
708
|
+
/* @__PURE__ */ e(Ct, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
709
709
|
/* @__PURE__ */ e("p", { className: "text-sm text-zinc-700 dark:text-zinc-300 whitespace-pre-wrap", children: t.description })
|
|
710
710
|
] }),
|
|
711
711
|
/* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
|
|
712
|
-
/* @__PURE__ */ e(
|
|
713
|
-
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: v && l.find((
|
|
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: v && l.find((j) => j.isOrganizer)?.name || d[0] || "Calendar" })
|
|
714
714
|
] })
|
|
715
715
|
] }),
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
/* @__PURE__ */ e(
|
|
716
|
+
H && 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
|
+
u ? /* @__PURE__ */ n(tt, { children: [
|
|
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: h(
|
|
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: (j) => {
|
|
729
|
+
j.stopPropagation(), k || f(t);
|
|
730
730
|
},
|
|
731
|
-
disabled:
|
|
732
|
-
children:
|
|
733
|
-
|
|
731
|
+
disabled: S,
|
|
732
|
+
children: S ? /* @__PURE__ */ e(le, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(ne, { children: [
|
|
733
|
+
k && /* @__PURE__ */ e(de, { className: "h-3.5 w-3.5" }),
|
|
734
734
|
r.going
|
|
735
735
|
] })
|
|
736
736
|
}
|
|
737
737
|
),
|
|
738
738
|
/* @__PURE__ */ e(
|
|
739
|
-
|
|
739
|
+
ae,
|
|
740
740
|
{
|
|
741
741
|
size: "sm",
|
|
742
742
|
variant: "outline",
|
|
743
|
-
className:
|
|
743
|
+
className: h(
|
|
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
|
),
|
|
747
|
-
children: /* @__PURE__ */ e(
|
|
747
|
+
children: /* @__PURE__ */ e(bt, { className: "h-3.5 w-3.5" })
|
|
748
748
|
}
|
|
749
749
|
)
|
|
750
750
|
] }) }),
|
|
751
|
-
/* @__PURE__ */ n(
|
|
751
|
+
/* @__PURE__ */ n(nt, { align: "start", children: [
|
|
752
752
|
/* @__PURE__ */ n(
|
|
753
753
|
Ce,
|
|
754
754
|
{
|
|
755
|
-
className:
|
|
755
|
+
className: h(
|
|
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
|
-
onClick: () =>
|
|
759
|
+
onClick: () => f(t),
|
|
760
760
|
children: [
|
|
761
761
|
/* @__PURE__ */ e(de, { className: "h-3.5 w-3.5 mr-2 text-green-600" }),
|
|
762
762
|
r.acceptThisEvent
|
|
763
763
|
]
|
|
764
764
|
}
|
|
765
765
|
),
|
|
766
|
-
/* @__PURE__ */ n(Ce, { onClick: () =>
|
|
766
|
+
/* @__PURE__ */ n(Ce, { onClick: () => f(t), children: [
|
|
767
767
|
/* @__PURE__ */ e(de, { className: "h-3.5 w-3.5 mr-2 text-green-600" }),
|
|
768
768
|
r.acceptAllEvents
|
|
769
769
|
] })
|
|
770
770
|
] })
|
|
771
771
|
] }) : /* @__PURE__ */ e(
|
|
772
|
-
|
|
772
|
+
ae,
|
|
773
773
|
{
|
|
774
774
|
size: "sm",
|
|
775
775
|
variant: "outline",
|
|
776
|
-
className:
|
|
776
|
+
className: h(
|
|
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
|
),
|
|
780
780
|
onClick: () => {
|
|
781
|
-
|
|
781
|
+
k || f(t);
|
|
782
782
|
},
|
|
783
|
-
disabled:
|
|
784
|
-
children:
|
|
785
|
-
|
|
783
|
+
disabled: S,
|
|
784
|
+
children: S ? /* @__PURE__ */ e(le, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(ne, { children: [
|
|
785
|
+
k && /* @__PURE__ */ e(de, { className: "h-3.5 w-3.5" }),
|
|
786
786
|
r.going
|
|
787
787
|
] })
|
|
788
788
|
}
|
|
789
789
|
),
|
|
790
790
|
/* @__PURE__ */ e(
|
|
791
|
-
|
|
791
|
+
ae,
|
|
792
792
|
{
|
|
793
793
|
size: "sm",
|
|
794
794
|
variant: "outline",
|
|
795
|
-
className:
|
|
795
|
+
className: h(
|
|
796
796
|
"gap-1.5 h-8 !border-none !bg-rose-100 text-rose-800 hover:!bg-rose-200",
|
|
797
|
-
|
|
797
|
+
b && "!bg-rose-700 !text-white hover:!bg-rose-700"
|
|
798
798
|
),
|
|
799
799
|
onClick: () => {
|
|
800
|
-
|
|
800
|
+
b || c(t);
|
|
801
801
|
},
|
|
802
|
-
disabled:
|
|
803
|
-
children:
|
|
804
|
-
|
|
802
|
+
disabled: L,
|
|
803
|
+
children: L ? /* @__PURE__ */ e(le, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(ne, { children: [
|
|
804
|
+
b && /* @__PURE__ */ e(fe, { className: "h-3.5 w-3.5" }),
|
|
805
805
|
r.notGoing
|
|
806
806
|
] })
|
|
807
807
|
}
|
|
808
808
|
)
|
|
809
809
|
] }) }),
|
|
810
|
-
|
|
811
|
-
|
|
810
|
+
A && k && !t.meetingTookPlace && !t.isCanceled && x && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 py-3", children: /* @__PURE__ */ n(
|
|
811
|
+
ae,
|
|
812
812
|
{
|
|
813
813
|
size: "sm",
|
|
814
814
|
variant: "outline",
|
|
815
815
|
className: "w-full h-9 hover:!bg-green-100 hover:text-green-700 text-green-700 !bg-green-100 !border-none dark:text-green-400 dark:hover:bg-green-950/30",
|
|
816
|
-
onClick: () =>
|
|
817
|
-
disabled:
|
|
816
|
+
onClick: () => x(t),
|
|
817
|
+
disabled: w,
|
|
818
818
|
children: [
|
|
819
|
-
|
|
819
|
+
w && /* @__PURE__ */ e(le, { className: "h-4 w-4 mr-2" }),
|
|
820
820
|
r.confirmMeeting
|
|
821
821
|
]
|
|
822
822
|
}
|
|
823
823
|
) })
|
|
824
824
|
] }),
|
|
825
|
-
|
|
826
|
-
onConfirm:
|
|
827
|
-
onCancel: () =>
|
|
828
|
-
isLoading:
|
|
825
|
+
V ? I && V({
|
|
826
|
+
onConfirm: W,
|
|
827
|
+
onCancel: () => P(!1),
|
|
828
|
+
isLoading: T
|
|
829
829
|
}) : /* @__PURE__ */ e(
|
|
830
|
-
|
|
830
|
+
Et,
|
|
831
831
|
{
|
|
832
|
-
open:
|
|
833
|
-
onOpenChange:
|
|
832
|
+
open: I,
|
|
833
|
+
onOpenChange: P,
|
|
834
834
|
title: r.deleteConfirmTitle,
|
|
835
835
|
description: r.deleteConfirmDescription,
|
|
836
836
|
cancelLabel: r.cancel,
|
|
837
837
|
confirmLabel: r.delete,
|
|
838
|
-
onConfirm:
|
|
839
|
-
isLoading:
|
|
838
|
+
onConfirm: W,
|
|
839
|
+
isLoading: T
|
|
840
840
|
}
|
|
841
841
|
)
|
|
842
842
|
] });
|
|
843
843
|
}
|
|
844
|
-
function
|
|
844
|
+
function Yr({
|
|
845
845
|
event: t,
|
|
846
846
|
children: r,
|
|
847
847
|
open: o,
|
|
848
848
|
onOpenChange: s,
|
|
849
849
|
isLoading: a,
|
|
850
850
|
labels: i,
|
|
851
|
-
onEdit:
|
|
852
|
-
onDelete:
|
|
851
|
+
onEdit: g,
|
|
852
|
+
onDelete: f,
|
|
853
853
|
onCancel: c,
|
|
854
|
-
onAccept:
|
|
855
|
-
onDecline:
|
|
856
|
-
onConfirmMeeting:
|
|
857
|
-
canEdit:
|
|
858
|
-
canDelete:
|
|
859
|
-
canCancel:
|
|
860
|
-
isCurrentUserParticipant:
|
|
861
|
-
isCurrentUserClient:
|
|
862
|
-
currentUserAcceptStatus:
|
|
863
|
-
isAcceptLoading:
|
|
864
|
-
isDeclineLoading:
|
|
865
|
-
isConfirmLoading:
|
|
866
|
-
isDeleteLoading:
|
|
867
|
-
renderParticipant:
|
|
868
|
-
renderHeaderActions:
|
|
869
|
-
renderCancelReason:
|
|
870
|
-
renderDeleteConfirmation:
|
|
871
|
-
formatDate:
|
|
872
|
-
formatTimeRange:
|
|
854
|
+
onAccept: x,
|
|
855
|
+
onDecline: y,
|
|
856
|
+
onConfirmMeeting: p,
|
|
857
|
+
canEdit: M = !0,
|
|
858
|
+
canDelete: A = !1,
|
|
859
|
+
canCancel: z = !0,
|
|
860
|
+
isCurrentUserParticipant: C,
|
|
861
|
+
isCurrentUserClient: S,
|
|
862
|
+
currentUserAcceptStatus: L,
|
|
863
|
+
isAcceptLoading: w,
|
|
864
|
+
isDeclineLoading: T,
|
|
865
|
+
isConfirmLoading: D,
|
|
866
|
+
isDeleteLoading: F,
|
|
867
|
+
renderParticipant: R,
|
|
868
|
+
renderHeaderActions: V,
|
|
869
|
+
renderCancelReason: $,
|
|
870
|
+
renderDeleteConfirmation: O,
|
|
871
|
+
formatDate: I,
|
|
872
|
+
formatTimeRange: P,
|
|
873
873
|
className: U,
|
|
874
|
-
width:
|
|
874
|
+
width: u = 360
|
|
875
875
|
}) {
|
|
876
|
-
const l =
|
|
876
|
+
const l = Tt("(min-width: 768px)"), d = { ...Dt, ...i }, v = oe(() => {
|
|
877
877
|
s?.(!1);
|
|
878
|
-
}, [s]),
|
|
878
|
+
}, [s]), k = {
|
|
879
879
|
event: t,
|
|
880
|
-
labels:
|
|
880
|
+
labels: d,
|
|
881
881
|
isLoading: a,
|
|
882
882
|
onClose: v,
|
|
883
|
-
onEdit:
|
|
884
|
-
onDelete:
|
|
883
|
+
onEdit: g,
|
|
884
|
+
onDelete: f,
|
|
885
885
|
onCancel: c,
|
|
886
|
-
onAccept:
|
|
887
|
-
onDecline:
|
|
888
|
-
onConfirmMeeting:
|
|
889
|
-
canEdit:
|
|
890
|
-
canDelete:
|
|
891
|
-
canCancel:
|
|
892
|
-
isCurrentUserParticipant:
|
|
893
|
-
isCurrentUserClient:
|
|
894
|
-
currentUserAcceptStatus:
|
|
895
|
-
isAcceptLoading:
|
|
896
|
-
isDeclineLoading:
|
|
897
|
-
isConfirmLoading:
|
|
898
|
-
isDeleteLoading:
|
|
899
|
-
renderParticipant:
|
|
900
|
-
renderHeaderActions:
|
|
901
|
-
renderCancelReason:
|
|
902
|
-
renderDeleteConfirmation:
|
|
903
|
-
formatDate:
|
|
904
|
-
formatTimeRange:
|
|
886
|
+
onAccept: x,
|
|
887
|
+
onDecline: y,
|
|
888
|
+
onConfirmMeeting: p,
|
|
889
|
+
canEdit: M,
|
|
890
|
+
canDelete: A,
|
|
891
|
+
canCancel: z,
|
|
892
|
+
isCurrentUserParticipant: C,
|
|
893
|
+
isCurrentUserClient: S,
|
|
894
|
+
currentUserAcceptStatus: L,
|
|
895
|
+
isAcceptLoading: w,
|
|
896
|
+
isDeclineLoading: T,
|
|
897
|
+
isConfirmLoading: D,
|
|
898
|
+
isDeleteLoading: F,
|
|
899
|
+
renderParticipant: R,
|
|
900
|
+
renderHeaderActions: V,
|
|
901
|
+
renderCancelReason: $,
|
|
902
|
+
renderDeleteConfirmation: O,
|
|
903
|
+
formatDate: I,
|
|
904
|
+
formatTimeRange: P
|
|
905
905
|
};
|
|
906
906
|
return l ? /* @__PURE__ */ n(_e, { open: o ?? !1, onOpenChange: s ?? (() => {
|
|
907
907
|
}), children: [
|
|
@@ -909,36 +909,36 @@ function Ur({
|
|
|
909
909
|
/* @__PURE__ */ e(
|
|
910
910
|
Re,
|
|
911
911
|
{
|
|
912
|
-
className:
|
|
912
|
+
className: h(
|
|
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: u },
|
|
917
917
|
align: "center",
|
|
918
918
|
side: "bottom",
|
|
919
919
|
sideOffset: 4,
|
|
920
|
-
children: /* @__PURE__ */ e(Ee, { ...
|
|
920
|
+
children: /* @__PURE__ */ e(Ee, { ...k })
|
|
921
921
|
}
|
|
922
922
|
)
|
|
923
|
-
] }) : /* @__PURE__ */ n(
|
|
923
|
+
] }) : /* @__PURE__ */ n(ne, { children: [
|
|
924
924
|
r,
|
|
925
925
|
/* @__PURE__ */ e(
|
|
926
|
-
|
|
926
|
+
St,
|
|
927
927
|
{
|
|
928
928
|
open: o ?? !1,
|
|
929
929
|
onOpenChange: s ?? (() => {
|
|
930
930
|
}),
|
|
931
931
|
title: t.title,
|
|
932
|
-
children: /* @__PURE__ */ e(Ee, { ...
|
|
932
|
+
children: /* @__PURE__ */ e(Ee, { ...k })
|
|
933
933
|
}
|
|
934
934
|
)
|
|
935
935
|
] });
|
|
936
936
|
}
|
|
937
|
-
const
|
|
938
|
-
function
|
|
937
|
+
const pe = 44, ze = 4, It = 56, Le = 8, ve = 80, ce = 140, He = 100, Te = 2, jt = 8, Wt = 18;
|
|
938
|
+
function At(t) {
|
|
939
939
|
return t.split(" ").map((r) => r[0]).join("").toUpperCase().slice(0, 2);
|
|
940
940
|
}
|
|
941
|
-
function
|
|
941
|
+
function Ft(t, r) {
|
|
942
942
|
const o = [];
|
|
943
943
|
for (let s = 0; s < r; s++) {
|
|
944
944
|
const a = new Date(t);
|
|
@@ -946,17 +946,17 @@ function At(t, r) {
|
|
|
946
946
|
}
|
|
947
947
|
return o;
|
|
948
948
|
}
|
|
949
|
-
function
|
|
949
|
+
function Bt(t, r, o) {
|
|
950
950
|
const s = [];
|
|
951
951
|
return t.forEach((a, i) => {
|
|
952
|
-
for (let
|
|
953
|
-
s.push({ hour:
|
|
952
|
+
for (let g = r; g < o; g++)
|
|
953
|
+
s.push({ hour: g, dayIndex: i, date: a });
|
|
954
954
|
}), s;
|
|
955
955
|
}
|
|
956
|
-
function
|
|
956
|
+
function $t(t) {
|
|
957
957
|
return `${t.toString().padStart(2, "0")}:00`;
|
|
958
958
|
}
|
|
959
|
-
function
|
|
959
|
+
function Ot(t) {
|
|
960
960
|
return t.toLocaleDateString("en-US", {
|
|
961
961
|
weekday: "short",
|
|
962
962
|
month: "short",
|
|
@@ -976,11 +976,11 @@ function Ie(t) {
|
|
|
976
976
|
}
|
|
977
977
|
return o;
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function _t({ src: t, alt: r, fallback: o, className: s }) {
|
|
980
980
|
return /* @__PURE__ */ e(
|
|
981
981
|
"div",
|
|
982
982
|
{
|
|
983
|
-
className:
|
|
983
|
+
className: h(
|
|
984
984
|
"relative flex shrink-0 overflow-hidden rounded-sm border bg-muted",
|
|
985
985
|
s
|
|
986
986
|
),
|
|
@@ -995,122 +995,122 @@ function Ot({ src: t, alt: r, fallback: o, className: s }) {
|
|
|
995
995
|
}
|
|
996
996
|
);
|
|
997
997
|
}
|
|
998
|
-
const
|
|
999
|
-
function
|
|
1000
|
-
daysToShow: t =
|
|
998
|
+
const Pt = 7;
|
|
999
|
+
function we({
|
|
1000
|
+
daysToShow: t = Pt,
|
|
1001
1001
|
events: r,
|
|
1002
1002
|
users: o = [],
|
|
1003
1003
|
selectedDate: s,
|
|
1004
1004
|
onDateChange: a,
|
|
1005
1005
|
onEventClick: i,
|
|
1006
|
-
visibleHours:
|
|
1007
|
-
className:
|
|
1006
|
+
visibleHours: g,
|
|
1007
|
+
className: f,
|
|
1008
1008
|
getEventUserId: c,
|
|
1009
|
-
renderPopover:
|
|
1010
|
-
slots:
|
|
1011
|
-
classNames:
|
|
1009
|
+
renderPopover: x,
|
|
1010
|
+
slots: y,
|
|
1011
|
+
classNames: p
|
|
1012
1012
|
}) {
|
|
1013
|
-
const
|
|
1014
|
-
const l = new Date(
|
|
1013
|
+
const M = Ne(null), A = s ?? /* @__PURE__ */ new Date(), z = !0, C = g?.from ?? jt, S = g?.to ?? Wt, L = S - C, w = B(() => {
|
|
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
|
|
1017
|
+
const d = l.getDay(), v = d === 0 ? -6 : 1 - d;
|
|
1018
1018
|
return l.setDate(l.getDate() + v), l.setHours(0, 0, 0, 0), l;
|
|
1019
|
-
}, [
|
|
1020
|
-
() =>
|
|
1021
|
-
[
|
|
1022
|
-
),
|
|
1023
|
-
() =>
|
|
1024
|
-
[
|
|
1025
|
-
),
|
|
1026
|
-
const
|
|
1027
|
-
if (
|
|
1028
|
-
if (
|
|
1029
|
-
return String(
|
|
1019
|
+
}, [A, t]), T = B(
|
|
1020
|
+
() => Ft(w, t),
|
|
1021
|
+
[w, t]
|
|
1022
|
+
), D = B(
|
|
1023
|
+
() => Bt(T, C, S),
|
|
1024
|
+
[z, T, C, S]
|
|
1025
|
+
), R = c ?? ((l) => {
|
|
1026
|
+
const d = l.data;
|
|
1027
|
+
if (d?.userId) return String(d.userId);
|
|
1028
|
+
if (d?.user && typeof d.user == "object" && d.user.id)
|
|
1029
|
+
return String(d.user.id);
|
|
1030
1030
|
if (l.user?.id) return l.user.id;
|
|
1031
1031
|
if (l.participants?.[0]?.id) return l.participants[0].id;
|
|
1032
|
-
}),
|
|
1032
|
+
}), V = B(() => {
|
|
1033
1033
|
const l = /* @__PURE__ */ new Map();
|
|
1034
|
-
for (const
|
|
1035
|
-
l.set(
|
|
1036
|
-
id:
|
|
1037
|
-
name:
|
|
1038
|
-
avatar:
|
|
1039
|
-
email:
|
|
1034
|
+
for (const d of o)
|
|
1035
|
+
l.set(d.id, {
|
|
1036
|
+
id: d.id,
|
|
1037
|
+
name: d.name,
|
|
1038
|
+
avatar: d.avatar ?? void 0,
|
|
1039
|
+
email: d.email
|
|
1040
1040
|
});
|
|
1041
|
-
for (const
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1044
|
-
id:
|
|
1045
|
-
name:
|
|
1046
|
-
avatar:
|
|
1047
|
-
email:
|
|
1048
|
-
}),
|
|
1049
|
-
id:
|
|
1050
|
-
name:
|
|
1051
|
-
avatar:
|
|
1052
|
-
email:
|
|
1041
|
+
for (const d of r) {
|
|
1042
|
+
const k = d.data?.user;
|
|
1043
|
+
k?.id && !l.has(k.id) && l.set(k.id, {
|
|
1044
|
+
id: k.id,
|
|
1045
|
+
name: k.name ?? "",
|
|
1046
|
+
avatar: k.avatar ?? void 0,
|
|
1047
|
+
email: k.email
|
|
1048
|
+
}), d.user?.id && !l.has(d.user.id) && l.set(d.user.id, {
|
|
1049
|
+
id: d.user.id,
|
|
1050
|
+
name: d.user.name,
|
|
1051
|
+
avatar: d.user.avatar ?? void 0,
|
|
1052
|
+
email: d.user.email
|
|
1053
1053
|
});
|
|
1054
|
-
for (const
|
|
1055
|
-
|
|
1056
|
-
id:
|
|
1057
|
-
name:
|
|
1058
|
-
avatar:
|
|
1059
|
-
email:
|
|
1054
|
+
for (const b of d.participants || [])
|
|
1055
|
+
b.id && !l.has(b.id) && l.set(b.id, {
|
|
1056
|
+
id: b.id,
|
|
1057
|
+
name: b.name,
|
|
1058
|
+
avatar: b.avatar ?? void 0,
|
|
1059
|
+
email: b.email
|
|
1060
1060
|
});
|
|
1061
1061
|
}
|
|
1062
1062
|
return Array.from(l.values());
|
|
1063
|
-
}, [o, r]),
|
|
1064
|
-
const l = [],
|
|
1065
|
-
for (const
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
for (const
|
|
1069
|
-
const
|
|
1070
|
-
(
|
|
1063
|
+
}, [o, r]), $ = B(() => {
|
|
1064
|
+
const l = [], d = /* @__PURE__ */ new Map();
|
|
1065
|
+
for (const b of V)
|
|
1066
|
+
d.set(b.id, []);
|
|
1067
|
+
d.set("unassigned", []);
|
|
1068
|
+
for (const b of r) {
|
|
1069
|
+
const H = R(b) ?? "unassigned";
|
|
1070
|
+
(d.get(H) ?? d.get("unassigned")).push(b);
|
|
1071
1071
|
}
|
|
1072
|
-
const v = (
|
|
1073
|
-
const
|
|
1074
|
-
for (const
|
|
1075
|
-
const _ =
|
|
1076
|
-
for (let K = 0; K <
|
|
1077
|
-
const
|
|
1078
|
-
if (
|
|
1079
|
-
let
|
|
1080
|
-
if (
|
|
1081
|
-
|
|
1082
|
-
Math.min(
|
|
1083
|
-
),
|
|
1084
|
-
|
|
1085
|
-
Math.min(
|
|
1086
|
-
),
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1089
|
-
event:
|
|
1090
|
-
startCol:
|
|
1091
|
-
spanCols: Math.max(1,
|
|
1072
|
+
const v = (b) => {
|
|
1073
|
+
const H = [];
|
|
1074
|
+
for (const E of b) {
|
|
1075
|
+
const _ = E.startDate.getHours() + E.startDate.getMinutes() / 60, Y = E.endDate.getHours() + E.endDate.getMinutes() / 60;
|
|
1076
|
+
for (let K = 0; K < T.length; K++) {
|
|
1077
|
+
const J = T[K], ie = xe(J), m = Ve(J);
|
|
1078
|
+
if (E.startDate <= m && E.endDate >= ie) {
|
|
1079
|
+
let N = C, W = S;
|
|
1080
|
+
if (E.startDate >= ie && (N = Math.max(C, _)), E.endDate <= m && (W = Math.min(S, Y)), N = Math.max(
|
|
1081
|
+
C,
|
|
1082
|
+
Math.min(S, N)
|
|
1083
|
+
), W = Math.max(
|
|
1084
|
+
C,
|
|
1085
|
+
Math.min(S, W)
|
|
1086
|
+
), W > N) {
|
|
1087
|
+
const j = K * L + Math.floor(N - C), G = K * L + Math.ceil(W - C);
|
|
1088
|
+
H.push({
|
|
1089
|
+
event: E,
|
|
1090
|
+
startCol: j,
|
|
1091
|
+
spanCols: Math.max(1, G - j)
|
|
1092
1092
|
});
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
1096
|
}
|
|
1097
|
-
return
|
|
1097
|
+
return H;
|
|
1098
1098
|
};
|
|
1099
|
-
for (const
|
|
1100
|
-
const
|
|
1101
|
-
(K,
|
|
1099
|
+
for (const b of V) {
|
|
1100
|
+
const H = d.get(b.id) ?? [], E = v(H), _ = Ie(E), Y = _.reduce(
|
|
1101
|
+
(K, J) => Math.max(K, J.stackIndex + 1),
|
|
1102
1102
|
0
|
|
1103
1103
|
);
|
|
1104
1104
|
l.push({
|
|
1105
|
-
user:
|
|
1105
|
+
user: b,
|
|
1106
1106
|
events: _,
|
|
1107
|
-
maxStack: Math.max(
|
|
1107
|
+
maxStack: Math.max(Y, 1)
|
|
1108
1108
|
});
|
|
1109
1109
|
}
|
|
1110
|
-
const
|
|
1111
|
-
if (
|
|
1112
|
-
const
|
|
1113
|
-
(_,
|
|
1110
|
+
const k = d.get("unassigned") ?? [];
|
|
1111
|
+
if (k.length > 0) {
|
|
1112
|
+
const b = v(k), H = Ie(b), E = H.reduce(
|
|
1113
|
+
(_, Y) => Math.max(_, Y.stackIndex + 1),
|
|
1114
1114
|
0
|
|
1115
1115
|
);
|
|
1116
1116
|
l.push({
|
|
@@ -1120,77 +1120,77 @@ function ve({
|
|
|
1120
1120
|
avatar: void 0,
|
|
1121
1121
|
email: void 0
|
|
1122
1122
|
},
|
|
1123
|
-
events:
|
|
1124
|
-
maxStack: Math.max(
|
|
1123
|
+
events: H,
|
|
1124
|
+
maxStack: Math.max(E, 1)
|
|
1125
1125
|
});
|
|
1126
1126
|
}
|
|
1127
|
-
return l.filter((
|
|
1127
|
+
return l.filter((b) => b.events.length > 0);
|
|
1128
1128
|
}, [
|
|
1129
|
-
|
|
1129
|
+
V,
|
|
1130
1130
|
r,
|
|
1131
|
+
T,
|
|
1132
|
+
z,
|
|
1133
|
+
L,
|
|
1134
|
+
C,
|
|
1131
1135
|
S,
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
N,
|
|
1135
|
-
p,
|
|
1136
|
-
V
|
|
1137
|
-
]), P = O(() => {
|
|
1136
|
+
R
|
|
1137
|
+
]), O = B(() => {
|
|
1138
1138
|
const l = /* @__PURE__ */ new Map();
|
|
1139
|
-
for (const
|
|
1140
|
-
for (const v of
|
|
1139
|
+
for (const d of $)
|
|
1140
|
+
for (const v of d.events)
|
|
1141
1141
|
if (v.spanCols === 1) {
|
|
1142
|
-
const
|
|
1143
|
-
l.set(v.startCol,
|
|
1142
|
+
const k = l.get(v.startCol) ?? 0;
|
|
1143
|
+
l.set(v.startCol, k + 1);
|
|
1144
1144
|
}
|
|
1145
1145
|
return l;
|
|
1146
|
-
}, [
|
|
1147
|
-
const l =
|
|
1148
|
-
for (let
|
|
1149
|
-
const
|
|
1150
|
-
|
|
1151
|
-
He + (
|
|
1152
|
-
) :
|
|
1146
|
+
}, [$]), I = B(() => {
|
|
1147
|
+
const l = D.length, d = ve, v = [];
|
|
1148
|
+
for (let k = 0; k < l; k++) {
|
|
1149
|
+
const b = O.get(k) ?? 0;
|
|
1150
|
+
b > Te ? v.push(
|
|
1151
|
+
He + (b - Te) * 20
|
|
1152
|
+
) : b > 0 ? v.push(Math.max(d, He)) : v.push(d);
|
|
1153
1153
|
}
|
|
1154
1154
|
return v;
|
|
1155
1155
|
}, [
|
|
1156
|
-
|
|
1156
|
+
z,
|
|
1157
|
+
D.length,
|
|
1157
1158
|
T.length,
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
), U = ce + $.reduce((l, h) => l + h, 0), f = O(() => {
|
|
1159
|
+
O
|
|
1160
|
+
]), P = (l) => Math.max(
|
|
1161
|
+
It,
|
|
1162
|
+
l * (pe + ze) + Le * 2
|
|
1163
|
+
), U = ce + I.reduce((l, d) => l + d, 0), u = B(() => {
|
|
1164
1164
|
const l = [0];
|
|
1165
|
-
for (let
|
|
1166
|
-
l.push(l[
|
|
1165
|
+
for (let d = 0; d < I.length; d++)
|
|
1166
|
+
l.push(l[d] + I[d]);
|
|
1167
1167
|
return l;
|
|
1168
|
-
}, [
|
|
1169
|
-
return
|
|
1170
|
-
const l =
|
|
1168
|
+
}, [I]);
|
|
1169
|
+
return Ze(() => {
|
|
1170
|
+
const l = M.current;
|
|
1171
1171
|
if (!l) return;
|
|
1172
|
-
const
|
|
1172
|
+
const d = () => {
|
|
1173
1173
|
let v = -1;
|
|
1174
|
-
const
|
|
1174
|
+
const b = (/* @__PURE__ */ new Date()).getHours();
|
|
1175
1175
|
{
|
|
1176
|
-
for (let
|
|
1177
|
-
const
|
|
1178
|
-
if (
|
|
1179
|
-
v =
|
|
1176
|
+
for (let H = 0; H < D.length; H++) {
|
|
1177
|
+
const E = D[H];
|
|
1178
|
+
if (E && q(E.date) && E.hour <= b && E.hour + 1 > b) {
|
|
1179
|
+
v = H;
|
|
1180
1180
|
break;
|
|
1181
1181
|
}
|
|
1182
1182
|
}
|
|
1183
1183
|
if (v === -1)
|
|
1184
|
-
for (let
|
|
1185
|
-
const
|
|
1186
|
-
if (
|
|
1187
|
-
v =
|
|
1184
|
+
for (let H = 0; H < D.length; H++) {
|
|
1185
|
+
const E = D[H];
|
|
1186
|
+
if (E && q(E.date)) {
|
|
1187
|
+
v = H;
|
|
1188
1188
|
break;
|
|
1189
1189
|
}
|
|
1190
1190
|
}
|
|
1191
1191
|
}
|
|
1192
1192
|
if (v !== -1) {
|
|
1193
|
-
const
|
|
1193
|
+
const H = (u[v] ?? 0) + ce, E = l.clientWidth, _ = Math.max(0, H - E / 3);
|
|
1194
1194
|
l.scrollTo({
|
|
1195
1195
|
left: _,
|
|
1196
1196
|
behavior: "instant"
|
|
@@ -1198,9 +1198,9 @@ function ve({
|
|
|
1198
1198
|
}
|
|
1199
1199
|
};
|
|
1200
1200
|
requestAnimationFrame(() => {
|
|
1201
|
-
requestAnimationFrame(
|
|
1201
|
+
requestAnimationFrame(d);
|
|
1202
1202
|
});
|
|
1203
|
-
}, [
|
|
1203
|
+
}, [A, D, T, u, z]), /* @__PURE__ */ e("div", { className: h("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
1204
|
// Hour mode: Day headers + Hour sub-headers - sticky wrapper with flex child (sticky + flex breaks sticky)
|
|
1205
1205
|
/* @__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
1206
|
t > 1 && /* @__PURE__ */ n("div", { className: "flex border-b", children: [
|
|
@@ -1212,17 +1212,17 @@ function ve({
|
|
|
1212
1212
|
children: /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase text-muted-foreground", children: "Resources" })
|
|
1213
1213
|
}
|
|
1214
1214
|
),
|
|
1215
|
-
|
|
1216
|
-
const v = q(l),
|
|
1215
|
+
T.map((l, d) => {
|
|
1216
|
+
const v = q(l), k = d * L, b = I.slice(k, k + L).reduce((H, E) => H + E, 0);
|
|
1217
1217
|
return /* @__PURE__ */ e(
|
|
1218
1218
|
"div",
|
|
1219
1219
|
{
|
|
1220
|
-
className:
|
|
1220
|
+
className: h(
|
|
1221
1221
|
"flex shrink-0 items-center justify-center border-r py-1.5 font-medium",
|
|
1222
1222
|
v ? "bg-primary/10 text-primary" : "bg-muted/30"
|
|
1223
1223
|
),
|
|
1224
|
-
style: { width:
|
|
1225
|
-
children: /* @__PURE__ */ e("span", { className: "text-xs", children:
|
|
1224
|
+
style: { width: b },
|
|
1225
|
+
children: /* @__PURE__ */ e("span", { className: "text-xs", children: Ot(l) })
|
|
1226
1226
|
},
|
|
1227
1227
|
`day-${l.toISOString()}`
|
|
1228
1228
|
);
|
|
@@ -1232,7 +1232,7 @@ function ve({
|
|
|
1232
1232
|
/* @__PURE__ */ e(
|
|
1233
1233
|
"div",
|
|
1234
1234
|
{
|
|
1235
|
-
className:
|
|
1235
|
+
className: h(
|
|
1236
1236
|
"flex shrink-0 items-center border-r bg-background px-2 py-2",
|
|
1237
1237
|
t > 1 && "sticky left-0 z-10"
|
|
1238
1238
|
),
|
|
@@ -1240,34 +1240,34 @@ function ve({
|
|
|
1240
1240
|
children: t === 1 && /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase text-muted-foreground", children: "Resources" })
|
|
1241
1241
|
}
|
|
1242
1242
|
),
|
|
1243
|
-
|
|
1244
|
-
const v = l.hour ===
|
|
1243
|
+
D.map((l, d) => {
|
|
1244
|
+
const v = l.hour === C, k = q(l.date), b = I[d] ?? ve;
|
|
1245
1245
|
return /* @__PURE__ */ e(
|
|
1246
1246
|
"div",
|
|
1247
1247
|
{
|
|
1248
|
-
className:
|
|
1248
|
+
className: h(
|
|
1249
1249
|
"flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",
|
|
1250
|
-
v &&
|
|
1251
|
-
|
|
1250
|
+
v && d > 0 ? "border-l-2 border-l-border" : "border-r border-r-border/50",
|
|
1251
|
+
k && "bg-primary/5"
|
|
1252
1252
|
),
|
|
1253
|
-
style: { width:
|
|
1254
|
-
children:
|
|
1253
|
+
style: { width: b },
|
|
1254
|
+
children: $t(l.hour)
|
|
1255
1255
|
},
|
|
1256
1256
|
`hour-${l.dayIndex}-${l.hour}`
|
|
1257
1257
|
);
|
|
1258
1258
|
})
|
|
1259
1259
|
] })
|
|
1260
1260
|
] }) }),
|
|
1261
|
-
|
|
1262
|
-
const
|
|
1261
|
+
$.map((l) => {
|
|
1262
|
+
const d = P(l.maxStack);
|
|
1263
1263
|
return /* @__PURE__ */ n(
|
|
1264
1264
|
"div",
|
|
1265
1265
|
{
|
|
1266
|
-
className:
|
|
1266
|
+
className: h(
|
|
1267
1267
|
"relative flex border-b",
|
|
1268
|
-
|
|
1268
|
+
p?.resourceRow
|
|
1269
1269
|
),
|
|
1270
|
-
style: { height:
|
|
1270
|
+
style: { height: d },
|
|
1271
1271
|
children: [
|
|
1272
1272
|
/* @__PURE__ */ e(
|
|
1273
1273
|
"div",
|
|
@@ -1277,18 +1277,18 @@ function ve({
|
|
|
1277
1277
|
children: /* @__PURE__ */ n(
|
|
1278
1278
|
"div",
|
|
1279
1279
|
{
|
|
1280
|
-
className:
|
|
1280
|
+
className: h(
|
|
1281
1281
|
"flex h-full items-center gap-2 sm:gap-3 border-r bg-background px-2 sm:px-4",
|
|
1282
|
-
|
|
1282
|
+
p?.resourceHeader
|
|
1283
1283
|
),
|
|
1284
1284
|
children: [
|
|
1285
1285
|
/* @__PURE__ */ e(
|
|
1286
|
-
|
|
1286
|
+
_t,
|
|
1287
1287
|
{
|
|
1288
1288
|
className: "size-7",
|
|
1289
1289
|
src: l.user.avatar,
|
|
1290
1290
|
alt: l.user.name,
|
|
1291
|
-
fallback:
|
|
1291
|
+
fallback: At(l.user.name)
|
|
1292
1292
|
}
|
|
1293
1293
|
),
|
|
1294
1294
|
/* @__PURE__ */ e("span", { className: "truncate text-xs sm:text-sm font-medium", children: l.user.name })
|
|
@@ -1299,44 +1299,44 @@ function ve({
|
|
|
1299
1299
|
),
|
|
1300
1300
|
/* @__PURE__ */ n("div", { className: "relative flex", children: [
|
|
1301
1301
|
// Hour mode cells
|
|
1302
|
-
|
|
1303
|
-
const
|
|
1302
|
+
D.map((v, k) => {
|
|
1303
|
+
const b = v.hour === C && k > 0, H = I[k] ?? ve;
|
|
1304
1304
|
return /* @__PURE__ */ e(
|
|
1305
1305
|
"div",
|
|
1306
1306
|
{
|
|
1307
|
-
className:
|
|
1307
|
+
className: h(
|
|
1308
1308
|
"shrink-0",
|
|
1309
|
-
|
|
1309
|
+
b ? "border-l-2 border-l-border" : "border-r border-r-border/50",
|
|
1310
1310
|
q(v.date) && "bg-primary/5"
|
|
1311
1311
|
),
|
|
1312
|
-
style: { width:
|
|
1312
|
+
style: { width: H }
|
|
1313
1313
|
},
|
|
1314
1314
|
`cell-${v.dayIndex}-${v.hour}`
|
|
1315
1315
|
);
|
|
1316
1316
|
}),
|
|
1317
1317
|
l.events.map((v) => {
|
|
1318
|
-
const
|
|
1318
|
+
const k = (u[v.startCol] ?? 0) + 2, b = u[v.startCol + v.spanCols] ?? u[u.length - 1] ?? 0, H = u[v.startCol] ?? 0, E = b - H - 4, _ = Le + v.stackIndex * (pe + ze);
|
|
1319
1319
|
return /* @__PURE__ */ e(
|
|
1320
1320
|
"div",
|
|
1321
1321
|
{
|
|
1322
1322
|
className: "absolute",
|
|
1323
1323
|
style: {
|
|
1324
|
-
left:
|
|
1325
|
-
width: Math.max(
|
|
1324
|
+
left: k,
|
|
1325
|
+
width: Math.max(E, 0),
|
|
1326
1326
|
// No forced minimum - columns are guaranteed wide enough
|
|
1327
1327
|
top: _,
|
|
1328
|
-
height:
|
|
1328
|
+
height: pe
|
|
1329
1329
|
},
|
|
1330
1330
|
children: /* @__PURE__ */ e(
|
|
1331
|
-
|
|
1331
|
+
ot,
|
|
1332
1332
|
{
|
|
1333
1333
|
event: v.event,
|
|
1334
1334
|
variant: "compact",
|
|
1335
1335
|
onClick: i,
|
|
1336
|
-
renderPopover:
|
|
1337
|
-
className:
|
|
1336
|
+
renderPopover: x,
|
|
1337
|
+
className: h(
|
|
1338
1338
|
"h-full w-full",
|
|
1339
|
-
|
|
1339
|
+
p?.eventCardCompact
|
|
1340
1340
|
)
|
|
1341
1341
|
}
|
|
1342
1342
|
)
|
|
@@ -1350,10 +1350,10 @@ function ve({
|
|
|
1350
1350
|
l.user.id
|
|
1351
1351
|
);
|
|
1352
1352
|
}),
|
|
1353
|
-
|
|
1353
|
+
$.length === 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-20 text-muted-foreground", children: "No users or events to display" })
|
|
1354
1354
|
] }) }) });
|
|
1355
1355
|
}
|
|
1356
|
-
const
|
|
1356
|
+
const Rt = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], Vt = [
|
|
1357
1357
|
"January",
|
|
1358
1358
|
"February",
|
|
1359
1359
|
"March",
|
|
@@ -1371,14 +1371,14 @@ function je(t) {
|
|
|
1371
1371
|
const r = t.hexColor;
|
|
1372
1372
|
return r ? { backgroundColor: r } : {};
|
|
1373
1373
|
}
|
|
1374
|
-
function
|
|
1375
|
-
const i = q(r),
|
|
1374
|
+
function Ut({ day: t, date: r, events: o, isCurrentMonth: s, onDayClick: a }) {
|
|
1375
|
+
const i = q(r), g = 3, f = o.length;
|
|
1376
1376
|
return /* @__PURE__ */ n(
|
|
1377
1377
|
"button",
|
|
1378
1378
|
{
|
|
1379
1379
|
type: "button",
|
|
1380
1380
|
onClick: () => a?.(r),
|
|
1381
|
-
className:
|
|
1381
|
+
className: h(
|
|
1382
1382
|
"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
1383
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1384
1384
|
"transition-colors",
|
|
@@ -1388,22 +1388,22 @@ function Vt({ day: t, date: r, events: o, isCurrentMonth: s, onDayClick: a }) {
|
|
|
1388
1388
|
/* @__PURE__ */ e(
|
|
1389
1389
|
"div",
|
|
1390
1390
|
{
|
|
1391
|
-
className:
|
|
1391
|
+
className: h(
|
|
1392
1392
|
"flex size-5 sm:size-6 items-center justify-center rounded-full text-[10px] sm:text-xs font-medium",
|
|
1393
1393
|
i && "bg-primary font-semibold text-primary-foreground"
|
|
1394
1394
|
),
|
|
1395
1395
|
children: t
|
|
1396
1396
|
}
|
|
1397
1397
|
),
|
|
1398
|
-
|
|
1398
|
+
f > 0 && /* @__PURE__ */ e("div", { className: "mt-0.5 flex items-center gap-0.5", children: f <= g ? o.map((c) => /* @__PURE__ */ e(
|
|
1399
1399
|
"div",
|
|
1400
1400
|
{
|
|
1401
1401
|
className: "size-1 sm:size-1.5 rounded-full bg-primary",
|
|
1402
1402
|
style: je(c)
|
|
1403
1403
|
},
|
|
1404
1404
|
c.id
|
|
1405
|
-
)) : /* @__PURE__ */ n(
|
|
1406
|
-
o.slice(0,
|
|
1405
|
+
)) : /* @__PURE__ */ n(ne, { children: [
|
|
1406
|
+
o.slice(0, g).map((c) => /* @__PURE__ */ e(
|
|
1407
1407
|
"div",
|
|
1408
1408
|
{
|
|
1409
1409
|
className: "size-1 sm:size-1.5 rounded-full bg-primary",
|
|
@@ -1413,70 +1413,70 @@ function Vt({ day: t, date: r, events: o, isCurrentMonth: s, onDayClick: a }) {
|
|
|
1413
1413
|
)),
|
|
1414
1414
|
/* @__PURE__ */ n("span", { className: "text-[6px] sm:text-[7px] font-medium text-muted-foreground", children: [
|
|
1415
1415
|
"+",
|
|
1416
|
-
|
|
1416
|
+
f - g
|
|
1417
1417
|
] })
|
|
1418
1418
|
] }) })
|
|
1419
1419
|
]
|
|
1420
1420
|
}
|
|
1421
1421
|
);
|
|
1422
1422
|
}
|
|
1423
|
-
function
|
|
1423
|
+
function Yt({
|
|
1424
1424
|
date: t,
|
|
1425
1425
|
events: r,
|
|
1426
1426
|
onMonthClick: o,
|
|
1427
1427
|
onDayClick: s
|
|
1428
1428
|
}) {
|
|
1429
|
-
const a =
|
|
1429
|
+
const a = B(() => mt(t, 0), [t]);
|
|
1430
1430
|
return /* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
1431
1431
|
/* @__PURE__ */ e(
|
|
1432
1432
|
"button",
|
|
1433
1433
|
{
|
|
1434
1434
|
type: "button",
|
|
1435
1435
|
onClick: () => o?.(t),
|
|
1436
|
-
className:
|
|
1436
|
+
className: h(
|
|
1437
1437
|
"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
1438
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1439
1439
|
"transition-colors"
|
|
1440
1440
|
),
|
|
1441
|
-
children:
|
|
1441
|
+
children: Vt[t.getMonth()]
|
|
1442
1442
|
}
|
|
1443
1443
|
),
|
|
1444
1444
|
/* @__PURE__ */ n("div", { className: "flex-1 space-y-1.5 sm:space-y-2 rounded-b-lg border border-t-0 p-2 sm:p-3", children: [
|
|
1445
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children:
|
|
1445
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children: Rt.map((i, g) => /* @__PURE__ */ n("div", { className: "text-[9px] sm:text-xs font-medium text-muted-foreground", children: [
|
|
1446
1446
|
/* @__PURE__ */ e("span", { className: "sm:hidden", children: i[0] }),
|
|
1447
1447
|
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children: i })
|
|
1448
|
-
] },
|
|
1449
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children: a.map((i,
|
|
1450
|
-
const
|
|
1448
|
+
] }, g)) }),
|
|
1449
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children: a.map((i, g) => {
|
|
1450
|
+
const f = ft(r, i.date);
|
|
1451
1451
|
return /* @__PURE__ */ e(
|
|
1452
|
-
|
|
1452
|
+
Ut,
|
|
1453
1453
|
{
|
|
1454
1454
|
day: i.date.getDate(),
|
|
1455
1455
|
date: i.date,
|
|
1456
|
-
events:
|
|
1456
|
+
events: f,
|
|
1457
1457
|
isCurrentMonth: i.isCurrentMonth,
|
|
1458
1458
|
onDayClick: s
|
|
1459
1459
|
},
|
|
1460
|
-
`${
|
|
1460
|
+
`${g + 1}-${i.date.toISOString()}`
|
|
1461
1461
|
);
|
|
1462
1462
|
}) })
|
|
1463
1463
|
] })
|
|
1464
1464
|
] });
|
|
1465
1465
|
}
|
|
1466
|
-
function
|
|
1466
|
+
function Gt({
|
|
1467
1467
|
events: t,
|
|
1468
1468
|
year: r,
|
|
1469
1469
|
onMonthClick: o,
|
|
1470
1470
|
onDayClick: s,
|
|
1471
1471
|
className: a,
|
|
1472
1472
|
slots: i,
|
|
1473
|
-
classNames:
|
|
1473
|
+
classNames: g
|
|
1474
1474
|
}) {
|
|
1475
|
-
const
|
|
1476
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1475
|
+
const f = B(() => ht(r), [r]);
|
|
1476
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col h-full", a), children: [
|
|
1477
1477
|
/* @__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
|
-
/* @__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:
|
|
1479
|
-
|
|
1478
|
+
/* @__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
|
+
Yt,
|
|
1480
1480
|
{
|
|
1481
1481
|
date: c,
|
|
1482
1482
|
events: t,
|
|
@@ -1487,7 +1487,7 @@ function Yt({
|
|
|
1487
1487
|
)) }) })
|
|
1488
1488
|
] });
|
|
1489
1489
|
}
|
|
1490
|
-
function
|
|
1490
|
+
function Kt(t) {
|
|
1491
1491
|
switch (t) {
|
|
1492
1492
|
case "day":
|
|
1493
1493
|
case "week":
|
|
@@ -1496,66 +1496,67 @@ function Gt(t) {
|
|
|
1496
1496
|
return "day";
|
|
1497
1497
|
}
|
|
1498
1498
|
}
|
|
1499
|
-
function
|
|
1499
|
+
function qt({
|
|
1500
1500
|
onEventClick: t,
|
|
1501
1501
|
onSlotClick: r,
|
|
1502
1502
|
onSlotSelect: o,
|
|
1503
1503
|
onAddEvent: s,
|
|
1504
1504
|
className: a,
|
|
1505
1505
|
showHeader: i = !0,
|
|
1506
|
-
minSelectionMinutes:
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1506
|
+
minSelectionMinutes: g = 30,
|
|
1507
|
+
showMoreMode: f,
|
|
1508
|
+
showMoreEventsInPopover: c = !1,
|
|
1509
|
+
isLoading: x = !1,
|
|
1510
|
+
slots: y,
|
|
1511
|
+
classNames: p,
|
|
1512
|
+
settingsContent: M,
|
|
1513
|
+
filterContent: A,
|
|
1514
|
+
headerActions: z,
|
|
1515
|
+
renderPopover: C,
|
|
1516
|
+
calendarRef: S
|
|
1516
1517
|
}) {
|
|
1517
|
-
const {
|
|
1518
|
-
view:
|
|
1519
|
-
setView:
|
|
1520
|
-
selectedDate:
|
|
1521
|
-
setSelectedDate:
|
|
1522
|
-
slotDuration:
|
|
1523
|
-
filteredEvents:
|
|
1524
|
-
users:
|
|
1525
|
-
visibleHours:
|
|
1526
|
-
workingHours:
|
|
1518
|
+
const L = f ?? (c ? "popover" : "expand"), {
|
|
1519
|
+
view: w,
|
|
1520
|
+
setView: T,
|
|
1521
|
+
selectedDate: D,
|
|
1522
|
+
setSelectedDate: F,
|
|
1523
|
+
slotDuration: R,
|
|
1524
|
+
filteredEvents: V,
|
|
1525
|
+
users: $,
|
|
1526
|
+
visibleHours: O,
|
|
1527
|
+
workingHours: I,
|
|
1527
1528
|
badgeVariant: P,
|
|
1528
|
-
showWorkingHoursOnly:
|
|
1529
|
-
} =
|
|
1530
|
-
if (
|
|
1529
|
+
showWorkingHoursOnly: U
|
|
1530
|
+
} = Qe(), u = B(() => {
|
|
1531
|
+
if (!U || !I)
|
|
1531
1532
|
return {
|
|
1532
|
-
startHour:
|
|
1533
|
-
endHour:
|
|
1533
|
+
startHour: O.start,
|
|
1534
|
+
endHour: O.end
|
|
1534
1535
|
};
|
|
1535
|
-
let
|
|
1536
|
-
for (const
|
|
1537
|
-
const
|
|
1538
|
-
!
|
|
1536
|
+
let m = 24, N = 0;
|
|
1537
|
+
for (const W of Object.keys(I)) {
|
|
1538
|
+
const j = I[Number(W)];
|
|
1539
|
+
!j || j.enabled === !1 || (j.from < m && (m = j.from), j.to > N && (N = j.to));
|
|
1539
1540
|
}
|
|
1540
|
-
return
|
|
1541
|
-
startHour:
|
|
1542
|
-
endHour:
|
|
1543
|
-
} : { startHour:
|
|
1544
|
-
}, [
|
|
1545
|
-
|
|
1546
|
-
|
|
1541
|
+
return m >= N ? {
|
|
1542
|
+
startHour: O.start,
|
|
1543
|
+
endHour: O.end
|
|
1544
|
+
} : { startHour: m, endHour: N };
|
|
1545
|
+
}, [U, I, O]), l = u, d = Ne(null);
|
|
1546
|
+
et(
|
|
1547
|
+
S,
|
|
1547
1548
|
() => ({
|
|
1548
1549
|
scrollToToday: () => {
|
|
1549
|
-
const
|
|
1550
|
-
|
|
1550
|
+
const m = /* @__PURE__ */ new Date();
|
|
1551
|
+
F(m, w), requestAnimationFrame(() => {
|
|
1551
1552
|
requestAnimationFrame(() => {
|
|
1552
|
-
const
|
|
1553
|
+
const N = d.current?.querySelector(
|
|
1553
1554
|
".ic-timeline-scroll-container, [class*='overflow-auto']"
|
|
1554
1555
|
);
|
|
1555
|
-
if (!
|
|
1556
|
-
const
|
|
1557
|
-
|
|
1558
|
-
top: Math.max(0,
|
|
1556
|
+
if (!N) return;
|
|
1557
|
+
const G = (m.getHours() - u.startHour) * 96;
|
|
1558
|
+
G > 0 && N.scrollTo({
|
|
1559
|
+
top: Math.max(0, G - 100),
|
|
1559
1560
|
// Offset to show some context
|
|
1560
1561
|
behavior: "smooth"
|
|
1561
1562
|
});
|
|
@@ -1563,253 +1564,253 @@ function Kt({
|
|
|
1563
1564
|
});
|
|
1564
1565
|
},
|
|
1565
1566
|
scrollToWorkingHours: () => {
|
|
1566
|
-
let
|
|
1567
|
-
if (
|
|
1568
|
-
for (const
|
|
1569
|
-
const
|
|
1570
|
-
|
|
1567
|
+
let m = 8;
|
|
1568
|
+
if (I)
|
|
1569
|
+
for (const N of Object.keys(I)) {
|
|
1570
|
+
const W = I[Number(N)];
|
|
1571
|
+
W?.enabled && W.from < m && (m = Math.max(W.from - 1, 0));
|
|
1571
1572
|
}
|
|
1572
1573
|
requestAnimationFrame(() => {
|
|
1573
1574
|
requestAnimationFrame(() => {
|
|
1574
|
-
const
|
|
1575
|
+
const N = d.current?.querySelector(
|
|
1575
1576
|
".ic-timeline-scroll-container, [class*='overflow-auto']"
|
|
1576
1577
|
);
|
|
1577
|
-
if (!
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1580
|
-
top: Math.max(0,
|
|
1578
|
+
if (!N) return;
|
|
1579
|
+
const j = (m - u.startHour) * 96;
|
|
1580
|
+
N.scrollTo({
|
|
1581
|
+
top: Math.max(0, j),
|
|
1581
1582
|
behavior: "smooth"
|
|
1582
1583
|
});
|
|
1583
1584
|
});
|
|
1584
1585
|
});
|
|
1585
1586
|
},
|
|
1586
|
-
getViewRect: () =>
|
|
1587
|
+
getViewRect: () => d.current?.getBoundingClientRect() ?? null
|
|
1587
1588
|
}),
|
|
1588
|
-
[
|
|
1589
|
+
[F, w, u, I]
|
|
1589
1590
|
);
|
|
1590
|
-
const
|
|
1591
|
-
(
|
|
1591
|
+
const v = B(() => Kt(w), [w]), k = oe(
|
|
1592
|
+
(m) => {
|
|
1592
1593
|
if (o) {
|
|
1593
|
-
o(
|
|
1594
|
+
o(m);
|
|
1594
1595
|
return;
|
|
1595
1596
|
}
|
|
1596
1597
|
if (r) {
|
|
1597
|
-
const
|
|
1598
|
-
r(
|
|
1598
|
+
const N = m.startDate.getHours();
|
|
1599
|
+
r(m.startDate, N);
|
|
1599
1600
|
}
|
|
1600
1601
|
},
|
|
1601
1602
|
[o, r]
|
|
1602
|
-
),
|
|
1603
|
-
(
|
|
1604
|
-
|
|
1603
|
+
), b = oe(
|
|
1604
|
+
(m) => {
|
|
1605
|
+
T("day"), F(m, "day");
|
|
1605
1606
|
},
|
|
1606
|
-
[
|
|
1607
|
-
),
|
|
1608
|
-
(
|
|
1609
|
-
|
|
1607
|
+
[F, T]
|
|
1608
|
+
), H = oe(
|
|
1609
|
+
(m) => {
|
|
1610
|
+
T("month"), F(m, "month");
|
|
1610
1611
|
},
|
|
1611
|
-
[
|
|
1612
|
-
),
|
|
1613
|
-
(
|
|
1614
|
-
t?.(
|
|
1612
|
+
[F, T]
|
|
1613
|
+
), E = oe(
|
|
1614
|
+
(m) => {
|
|
1615
|
+
t?.(m);
|
|
1615
1616
|
},
|
|
1616
1617
|
[t]
|
|
1617
|
-
),
|
|
1618
|
-
const
|
|
1619
|
-
switch (
|
|
1618
|
+
), _ = () => {
|
|
1619
|
+
const m = V, N = E, W = C;
|
|
1620
|
+
switch (w) {
|
|
1620
1621
|
case "day":
|
|
1621
1622
|
return /* @__PURE__ */ e(
|
|
1622
|
-
|
|
1623
|
+
lt,
|
|
1623
1624
|
{
|
|
1624
|
-
events:
|
|
1625
|
-
date:
|
|
1626
|
-
visibleHours:
|
|
1627
|
-
workingHours:
|
|
1628
|
-
slotDuration:
|
|
1625
|
+
events: m,
|
|
1626
|
+
date: D,
|
|
1627
|
+
visibleHours: l,
|
|
1628
|
+
workingHours: I,
|
|
1629
|
+
slotDuration: R,
|
|
1629
1630
|
badgeVariant: P,
|
|
1630
|
-
onEventClick:
|
|
1631
|
-
renderPopover:
|
|
1632
|
-
...
|
|
1633
|
-
...
|
|
1631
|
+
onEventClick: N,
|
|
1632
|
+
renderPopover: W,
|
|
1633
|
+
...y && { slots: y },
|
|
1634
|
+
...p && { classNames: p }
|
|
1634
1635
|
}
|
|
1635
1636
|
);
|
|
1636
1637
|
case "week":
|
|
1637
1638
|
return /* @__PURE__ */ e(
|
|
1638
|
-
|
|
1639
|
+
it,
|
|
1639
1640
|
{
|
|
1640
|
-
events:
|
|
1641
|
-
date:
|
|
1642
|
-
visibleHours:
|
|
1643
|
-
workingHours:
|
|
1644
|
-
slotDuration:
|
|
1641
|
+
events: m,
|
|
1642
|
+
date: D,
|
|
1643
|
+
visibleHours: l,
|
|
1644
|
+
workingHours: I,
|
|
1645
|
+
slotDuration: R,
|
|
1645
1646
|
badgeVariant: P,
|
|
1646
|
-
onEventClick:
|
|
1647
|
-
renderPopover:
|
|
1648
|
-
...
|
|
1649
|
-
...
|
|
1647
|
+
onEventClick: N,
|
|
1648
|
+
renderPopover: W,
|
|
1649
|
+
...y && { slots: y },
|
|
1650
|
+
...p && { classNames: p }
|
|
1650
1651
|
}
|
|
1651
1652
|
);
|
|
1652
1653
|
case "month":
|
|
1653
1654
|
return /* @__PURE__ */ e(
|
|
1654
1655
|
De,
|
|
1655
1656
|
{
|
|
1656
|
-
events:
|
|
1657
|
-
date:
|
|
1657
|
+
events: m,
|
|
1658
|
+
date: D,
|
|
1658
1659
|
badgeVariant: P,
|
|
1659
|
-
onEventClick:
|
|
1660
|
-
onDayClick:
|
|
1661
|
-
renderPopover:
|
|
1662
|
-
|
|
1663
|
-
...
|
|
1664
|
-
...
|
|
1660
|
+
onEventClick: N,
|
|
1661
|
+
onDayClick: b,
|
|
1662
|
+
renderPopover: W,
|
|
1663
|
+
showMoreMode: L,
|
|
1664
|
+
...y && { slots: y },
|
|
1665
|
+
...p && { classNames: p }
|
|
1665
1666
|
}
|
|
1666
1667
|
);
|
|
1667
1668
|
case "year":
|
|
1668
1669
|
return /* @__PURE__ */ e(
|
|
1669
|
-
|
|
1670
|
+
Gt,
|
|
1670
1671
|
{
|
|
1671
|
-
events:
|
|
1672
|
-
year:
|
|
1673
|
-
onMonthClick:
|
|
1674
|
-
onDayClick:
|
|
1675
|
-
...
|
|
1676
|
-
...
|
|
1672
|
+
events: m,
|
|
1673
|
+
year: D.getFullYear(),
|
|
1674
|
+
onMonthClick: H,
|
|
1675
|
+
onDayClick: b,
|
|
1676
|
+
...y && { slots: y },
|
|
1677
|
+
...p && { classNames: p }
|
|
1677
1678
|
}
|
|
1678
1679
|
);
|
|
1679
1680
|
case "agenda":
|
|
1680
1681
|
return /* @__PURE__ */ e(
|
|
1681
|
-
|
|
1682
|
+
at,
|
|
1682
1683
|
{
|
|
1683
|
-
events:
|
|
1684
|
-
date:
|
|
1685
|
-
onEventClick:
|
|
1686
|
-
renderPopover:
|
|
1687
|
-
...
|
|
1688
|
-
...
|
|
1684
|
+
events: m,
|
|
1685
|
+
date: D,
|
|
1686
|
+
onEventClick: N,
|
|
1687
|
+
renderPopover: W,
|
|
1688
|
+
...y && { slots: y },
|
|
1689
|
+
...p && { classNames: p }
|
|
1689
1690
|
}
|
|
1690
1691
|
);
|
|
1691
1692
|
// Timeline views
|
|
1692
1693
|
case "timeline-day":
|
|
1693
1694
|
return /* @__PURE__ */ e(
|
|
1694
|
-
|
|
1695
|
+
we,
|
|
1695
1696
|
{
|
|
1696
1697
|
daysToShow: 1,
|
|
1697
|
-
events:
|
|
1698
|
-
users:
|
|
1699
|
-
selectedDate:
|
|
1698
|
+
events: m,
|
|
1699
|
+
users: $,
|
|
1700
|
+
selectedDate: D,
|
|
1700
1701
|
visibleHours: {
|
|
1701
|
-
from:
|
|
1702
|
-
to:
|
|
1702
|
+
from: u.startHour,
|
|
1703
|
+
to: u.endHour
|
|
1703
1704
|
},
|
|
1704
|
-
onEventClick:
|
|
1705
|
-
renderPopover:
|
|
1706
|
-
...
|
|
1707
|
-
...
|
|
1705
|
+
onEventClick: N,
|
|
1706
|
+
renderPopover: W,
|
|
1707
|
+
...y && { slots: y },
|
|
1708
|
+
...p && { classNames: p }
|
|
1708
1709
|
}
|
|
1709
1710
|
);
|
|
1710
1711
|
case "timeline-3day":
|
|
1711
1712
|
return /* @__PURE__ */ e(
|
|
1712
|
-
|
|
1713
|
+
we,
|
|
1713
1714
|
{
|
|
1714
1715
|
daysToShow: 3,
|
|
1715
|
-
events:
|
|
1716
|
-
users:
|
|
1717
|
-
selectedDate:
|
|
1716
|
+
events: m,
|
|
1717
|
+
users: $,
|
|
1718
|
+
selectedDate: D,
|
|
1718
1719
|
visibleHours: {
|
|
1719
|
-
from:
|
|
1720
|
-
to:
|
|
1720
|
+
from: u.startHour,
|
|
1721
|
+
to: u.endHour
|
|
1721
1722
|
},
|
|
1722
|
-
onEventClick:
|
|
1723
|
-
renderPopover:
|
|
1724
|
-
...
|
|
1725
|
-
...
|
|
1723
|
+
onEventClick: N,
|
|
1724
|
+
renderPopover: W,
|
|
1725
|
+
...y && { slots: y },
|
|
1726
|
+
...p && { classNames: p }
|
|
1726
1727
|
}
|
|
1727
1728
|
);
|
|
1728
1729
|
case "timeline-week":
|
|
1729
1730
|
return /* @__PURE__ */ e(
|
|
1730
|
-
|
|
1731
|
+
we,
|
|
1731
1732
|
{
|
|
1732
1733
|
daysToShow: 7,
|
|
1733
|
-
events:
|
|
1734
|
-
users:
|
|
1735
|
-
selectedDate:
|
|
1734
|
+
events: m,
|
|
1735
|
+
users: $,
|
|
1736
|
+
selectedDate: D,
|
|
1736
1737
|
visibleHours: {
|
|
1737
|
-
from:
|
|
1738
|
-
to:
|
|
1738
|
+
from: u.startHour,
|
|
1739
|
+
to: u.endHour
|
|
1739
1740
|
},
|
|
1740
|
-
onEventClick:
|
|
1741
|
-
renderPopover:
|
|
1742
|
-
...
|
|
1743
|
-
...
|
|
1741
|
+
onEventClick: N,
|
|
1742
|
+
renderPopover: W,
|
|
1743
|
+
...y && { slots: y },
|
|
1744
|
+
...p && { classNames: p }
|
|
1744
1745
|
}
|
|
1745
1746
|
);
|
|
1746
1747
|
default:
|
|
1747
1748
|
return /* @__PURE__ */ e(
|
|
1748
1749
|
De,
|
|
1749
1750
|
{
|
|
1750
|
-
events:
|
|
1751
|
-
date:
|
|
1751
|
+
events: m,
|
|
1752
|
+
date: D,
|
|
1752
1753
|
badgeVariant: P,
|
|
1753
|
-
onEventClick:
|
|
1754
|
-
onDayClick:
|
|
1755
|
-
...
|
|
1756
|
-
...
|
|
1754
|
+
onEventClick: N,
|
|
1755
|
+
onDayClick: b,
|
|
1756
|
+
...y && { slots: y },
|
|
1757
|
+
...p && { classNames: p }
|
|
1757
1758
|
}
|
|
1758
1759
|
);
|
|
1759
1760
|
}
|
|
1760
|
-
},
|
|
1761
|
+
}, Y = Ne(null), [K, J] = se(!1);
|
|
1761
1762
|
he(() => {
|
|
1762
|
-
|
|
1763
|
+
d.current = Y.current;
|
|
1763
1764
|
}), he(() => {
|
|
1764
|
-
const
|
|
1765
|
-
if (!
|
|
1766
|
-
const
|
|
1767
|
-
const { scrollLeft:
|
|
1768
|
-
J(
|
|
1765
|
+
const m = Y.current;
|
|
1766
|
+
if (!m) return;
|
|
1767
|
+
const N = () => {
|
|
1768
|
+
const { scrollLeft: G, scrollWidth: me, clientWidth: Ke } = m;
|
|
1769
|
+
J(G + Ke < me - 4);
|
|
1769
1770
|
};
|
|
1770
|
-
|
|
1771
|
-
const
|
|
1772
|
-
|
|
1773
|
-
const
|
|
1774
|
-
return
|
|
1775
|
-
|
|
1771
|
+
N(), m.addEventListener("scroll", N, { passive: !0 });
|
|
1772
|
+
const W = new ResizeObserver(N);
|
|
1773
|
+
W.observe(m);
|
|
1774
|
+
const j = new MutationObserver(N);
|
|
1775
|
+
return j.observe(m, { childList: !0, subtree: !0 }), () => {
|
|
1776
|
+
m.removeEventListener("scroll", N), W.disconnect(), j.disconnect();
|
|
1776
1777
|
};
|
|
1777
|
-
}, [
|
|
1778
|
-
const
|
|
1779
|
-
|
|
1778
|
+
}, [w]);
|
|
1779
|
+
const ie = oe(() => {
|
|
1780
|
+
Y.current?.scrollBy({ left: 300, behavior: "smooth" });
|
|
1780
1781
|
}, []);
|
|
1781
1782
|
return /* @__PURE__ */ e(
|
|
1782
|
-
|
|
1783
|
+
ut,
|
|
1783
1784
|
{
|
|
1784
|
-
mode:
|
|
1785
|
-
onSelect:
|
|
1786
|
-
minDurationMinutes:
|
|
1787
|
-
slotDurationMinutes:
|
|
1785
|
+
mode: v,
|
|
1786
|
+
onSelect: k,
|
|
1787
|
+
minDurationMinutes: g,
|
|
1788
|
+
slotDurationMinutes: R,
|
|
1788
1789
|
enabled: !!(o || r),
|
|
1789
1790
|
children: /* @__PURE__ */ n(
|
|
1790
1791
|
"div",
|
|
1791
1792
|
{
|
|
1792
|
-
className:
|
|
1793
|
+
className: h(
|
|
1793
1794
|
"inno-calendar-root flex flex-col h-full p-4",
|
|
1794
|
-
|
|
1795
|
+
p?.root,
|
|
1795
1796
|
a
|
|
1796
1797
|
),
|
|
1797
1798
|
children: [
|
|
1798
1799
|
i && /* @__PURE__ */ e(
|
|
1799
|
-
|
|
1800
|
+
st,
|
|
1800
1801
|
{
|
|
1801
|
-
currentDate:
|
|
1802
|
-
view:
|
|
1803
|
-
events:
|
|
1804
|
-
onViewChange:
|
|
1805
|
-
onNavigateToday: () =>
|
|
1802
|
+
currentDate: D,
|
|
1803
|
+
view: w,
|
|
1804
|
+
events: V,
|
|
1805
|
+
onViewChange: T,
|
|
1806
|
+
onNavigateToday: () => F(/* @__PURE__ */ new Date(), w),
|
|
1806
1807
|
onNavigatePrev: () => {
|
|
1807
|
-
const
|
|
1808
|
-
|
|
1808
|
+
const m = new Date(D);
|
|
1809
|
+
w === "day" || w === "timeline-day" ? m.setDate(m.getDate() - 1) : w === "timeline-3day" ? m.setDate(m.getDate() - 3) : w === "week" || w === "timeline-week" ? m.setDate(m.getDate() - 7) : w === "month" ? m.setMonth(m.getMonth() - 1) : w === "year" ? m.setFullYear(m.getFullYear() - 1) : m.setDate(m.getDate() - 7), F(m, w);
|
|
1809
1810
|
},
|
|
1810
1811
|
onNavigateNext: () => {
|
|
1811
|
-
const
|
|
1812
|
-
|
|
1812
|
+
const m = new Date(D);
|
|
1813
|
+
w === "day" || w === "timeline-day" ? m.setDate(m.getDate() + 1) : w === "timeline-3day" ? m.setDate(m.getDate() + 3) : w === "week" || w === "timeline-week" ? m.setDate(m.getDate() + 7) : w === "month" ? m.setMonth(m.getMonth() + 1) : w === "year" ? m.setFullYear(m.getFullYear() + 1) : m.setDate(m.getDate() + 7), F(m, w);
|
|
1813
1814
|
},
|
|
1814
1815
|
availableViews: [
|
|
1815
1816
|
"day",
|
|
@@ -1819,31 +1820,31 @@ function Kt({
|
|
|
1819
1820
|
"agenda"
|
|
1820
1821
|
],
|
|
1821
1822
|
showTimelineViews: !0,
|
|
1822
|
-
showSettings: !!
|
|
1823
|
-
...!
|
|
1824
|
-
actions:
|
|
1825
|
-
settingsContent:
|
|
1826
|
-
filterContent:
|
|
1823
|
+
showSettings: !!M,
|
|
1824
|
+
...!z && s && { onAddEvent: s },
|
|
1825
|
+
actions: z,
|
|
1826
|
+
settingsContent: M,
|
|
1827
|
+
filterContent: A
|
|
1827
1828
|
}
|
|
1828
1829
|
),
|
|
1829
1830
|
/* @__PURE__ */ n("div", { className: "relative flex-1 min-h-0", children: [
|
|
1830
1831
|
/* @__PURE__ */ e(
|
|
1831
1832
|
"div",
|
|
1832
1833
|
{
|
|
1833
|
-
ref:
|
|
1834
|
-
className:
|
|
1834
|
+
ref: Y,
|
|
1835
|
+
className: h(
|
|
1835
1836
|
"h-full border rounded-lg bg-white overflow-x-auto",
|
|
1836
|
-
|
|
1837
|
+
p?.viewContainer
|
|
1837
1838
|
),
|
|
1838
|
-
children:
|
|
1839
|
+
children: _()
|
|
1839
1840
|
}
|
|
1840
1841
|
),
|
|
1841
|
-
|
|
1842
|
-
|
|
1842
|
+
x && /* @__PURE__ */ e("div", { className: "inno-calendar-loading-overlay", children: /* @__PURE__ */ e("div", { className: "inno-calendar-spinner" }) }),
|
|
1843
|
+
K && /* @__PURE__ */ e(
|
|
1843
1844
|
"button",
|
|
1844
1845
|
{
|
|
1845
1846
|
type: "button",
|
|
1846
|
-
onClick:
|
|
1847
|
+
onClick: ie,
|
|
1847
1848
|
className: "inno-scroll-right-btn",
|
|
1848
1849
|
"aria-label": "Scroll right",
|
|
1849
1850
|
children: /* @__PURE__ */ n(
|
|
@@ -1874,39 +1875,40 @@ function Kt({
|
|
|
1874
1875
|
}
|
|
1875
1876
|
);
|
|
1876
1877
|
}
|
|
1877
|
-
function
|
|
1878
|
+
function Jt({
|
|
1878
1879
|
events: t,
|
|
1879
1880
|
users: r = [],
|
|
1880
1881
|
scheduleTypes: o = [],
|
|
1881
1882
|
initialView: s = "week",
|
|
1882
1883
|
initialDate: a,
|
|
1883
1884
|
initialSelectedUserId: i,
|
|
1884
|
-
initialScheduleTypeIds:
|
|
1885
|
-
initialParticipantIds:
|
|
1885
|
+
initialScheduleTypeIds: g,
|
|
1886
|
+
initialParticipantIds: f,
|
|
1886
1887
|
initialWorkingHoursView: c,
|
|
1887
|
-
initialSearchQuery:
|
|
1888
|
-
preferencesConfig:
|
|
1889
|
-
onEventClick:
|
|
1890
|
-
onSlotClick:
|
|
1891
|
-
onSlotSelect:
|
|
1892
|
-
onAddEvent:
|
|
1893
|
-
onEventDrop:
|
|
1894
|
-
onDateChange:
|
|
1895
|
-
onViewChange:
|
|
1896
|
-
className:
|
|
1897
|
-
showHeader:
|
|
1898
|
-
minSelectionMinutes:
|
|
1899
|
-
|
|
1888
|
+
initialSearchQuery: x,
|
|
1889
|
+
preferencesConfig: y,
|
|
1890
|
+
onEventClick: p,
|
|
1891
|
+
onSlotClick: M,
|
|
1892
|
+
onSlotSelect: A,
|
|
1893
|
+
onAddEvent: z,
|
|
1894
|
+
onEventDrop: C,
|
|
1895
|
+
onDateChange: S,
|
|
1896
|
+
onViewChange: L,
|
|
1897
|
+
className: w,
|
|
1898
|
+
showHeader: T = !0,
|
|
1899
|
+
minSelectionMinutes: D = 30,
|
|
1900
|
+
showMoreMode: F,
|
|
1901
|
+
showMoreEventsInPopover: R = !1,
|
|
1900
1902
|
isLoading: V = !1,
|
|
1901
|
-
renderPopover:
|
|
1902
|
-
slots:
|
|
1903
|
-
classNames:
|
|
1904
|
-
settingsContent:
|
|
1905
|
-
filterContent:
|
|
1906
|
-
headerActions:
|
|
1907
|
-
},
|
|
1908
|
-
return /* @__PURE__ */ e(
|
|
1909
|
-
|
|
1903
|
+
renderPopover: $,
|
|
1904
|
+
slots: O,
|
|
1905
|
+
classNames: I,
|
|
1906
|
+
settingsContent: P,
|
|
1907
|
+
filterContent: U,
|
|
1908
|
+
headerActions: u
|
|
1909
|
+
}, l) {
|
|
1910
|
+
return /* @__PURE__ */ e(dt, { ...C && { onEventDrop: C }, children: /* @__PURE__ */ e(
|
|
1911
|
+
Xe,
|
|
1910
1912
|
{
|
|
1911
1913
|
initialEvents: t,
|
|
1912
1914
|
initialUsers: r,
|
|
@@ -1914,43 +1916,44 @@ function qt({
|
|
|
1914
1916
|
initialView: s,
|
|
1915
1917
|
...a && { initialDate: a },
|
|
1916
1918
|
...i && { initialSelectedUserId: i },
|
|
1917
|
-
...
|
|
1918
|
-
...
|
|
1919
|
+
...g && { initialScheduleTypeIds: g },
|
|
1920
|
+
...f && { initialParticipantIds: f },
|
|
1919
1921
|
...c && { initialWorkingHoursView: c },
|
|
1920
|
-
...
|
|
1921
|
-
...
|
|
1922
|
-
...
|
|
1923
|
-
...
|
|
1922
|
+
...x && { initialSearchQuery: x },
|
|
1923
|
+
...y && { preferencesConfig: y },
|
|
1924
|
+
...S && { onDateChange: S },
|
|
1925
|
+
...L && { onViewChange: L },
|
|
1924
1926
|
children: /* @__PURE__ */ e(
|
|
1925
|
-
|
|
1927
|
+
qt,
|
|
1926
1928
|
{
|
|
1927
|
-
...
|
|
1928
|
-
...
|
|
1929
|
-
...
|
|
1930
|
-
...
|
|
1931
|
-
|
|
1932
|
-
className:
|
|
1933
|
-
showHeader:
|
|
1934
|
-
minSelectionMinutes:
|
|
1935
|
-
|
|
1929
|
+
...p && { onEventClick: p },
|
|
1930
|
+
...M && { onSlotClick: M },
|
|
1931
|
+
...A && { onSlotSelect: A },
|
|
1932
|
+
...z && { onAddEvent: z },
|
|
1933
|
+
...$ && { renderPopover: $ },
|
|
1934
|
+
className: w,
|
|
1935
|
+
showHeader: T,
|
|
1936
|
+
minSelectionMinutes: D,
|
|
1937
|
+
...F && { showMoreMode: F },
|
|
1938
|
+
showMoreEventsInPopover: R,
|
|
1936
1939
|
isLoading: V,
|
|
1937
|
-
...
|
|
1938
|
-
...
|
|
1939
|
-
settingsContent:
|
|
1940
|
-
filterContent:
|
|
1941
|
-
headerActions:
|
|
1942
|
-
calendarRef:
|
|
1940
|
+
...O && { slots: O },
|
|
1941
|
+
...I && { classNames: I },
|
|
1942
|
+
settingsContent: P,
|
|
1943
|
+
filterContent: U,
|
|
1944
|
+
headerActions: u,
|
|
1945
|
+
calendarRef: l
|
|
1943
1946
|
}
|
|
1944
1947
|
)
|
|
1945
1948
|
}
|
|
1946
1949
|
) });
|
|
1947
1950
|
}
|
|
1948
|
-
const
|
|
1951
|
+
const Gr = ge(Jt), re = ge(
|
|
1949
1952
|
({ className: t, children: r, ...o }, s) => /* @__PURE__ */ e(
|
|
1950
1953
|
"select",
|
|
1951
1954
|
{
|
|
1952
1955
|
ref: s,
|
|
1953
|
-
className:
|
|
1956
|
+
className: h(
|
|
1954
1957
|
"flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm",
|
|
1955
1958
|
"ring-offset-background",
|
|
1956
1959
|
"focus:outline-none focus:ring-1 focus:ring-ring",
|
|
@@ -1963,20 +1966,20 @@ const Yr = fe(qt), ne = fe(
|
|
|
1963
1966
|
}
|
|
1964
1967
|
)
|
|
1965
1968
|
);
|
|
1966
|
-
|
|
1967
|
-
const
|
|
1969
|
+
re.displayName = "Select";
|
|
1970
|
+
const X = ge(({ className: t, ...r }, o) => /* @__PURE__ */ e(
|
|
1968
1971
|
"label",
|
|
1969
1972
|
{
|
|
1970
1973
|
ref: o,
|
|
1971
|
-
className:
|
|
1974
|
+
className: h(
|
|
1972
1975
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
1973
1976
|
t
|
|
1974
1977
|
),
|
|
1975
1978
|
...r
|
|
1976
1979
|
}
|
|
1977
1980
|
));
|
|
1978
|
-
|
|
1979
|
-
function
|
|
1981
|
+
X.displayName = "Label";
|
|
1982
|
+
function Xt({ className: t }) {
|
|
1980
1983
|
return /* @__PURE__ */ n(
|
|
1981
1984
|
"svg",
|
|
1982
1985
|
{
|
|
@@ -1998,7 +2001,7 @@ function Jt({ className: t }) {
|
|
|
1998
2001
|
}
|
|
1999
2002
|
);
|
|
2000
2003
|
}
|
|
2001
|
-
function
|
|
2004
|
+
function Qt({ className: t }) {
|
|
2002
2005
|
return /* @__PURE__ */ n(
|
|
2003
2006
|
"svg",
|
|
2004
2007
|
{
|
|
@@ -2019,12 +2022,12 @@ function Xt({ className: t }) {
|
|
|
2019
2022
|
}
|
|
2020
2023
|
);
|
|
2021
2024
|
}
|
|
2022
|
-
const
|
|
2025
|
+
const Zt = [
|
|
2023
2026
|
{ value: 15, label: "15 minutes" },
|
|
2024
2027
|
{ value: 30, label: "30 minutes" },
|
|
2025
2028
|
{ value: 60, label: "1 hour" }
|
|
2026
2029
|
];
|
|
2027
|
-
function
|
|
2030
|
+
function Kr({
|
|
2028
2031
|
value: t,
|
|
2029
2032
|
onChange: r,
|
|
2030
2033
|
isLocked: o = !1,
|
|
@@ -2036,33 +2039,33 @@ function Gr({
|
|
|
2036
2039
|
lockedMessage: "This setting is locked by the administrator",
|
|
2037
2040
|
infoMessage: "Set the time slot duration for day and week calendar views.",
|
|
2038
2041
|
...a
|
|
2039
|
-
},
|
|
2040
|
-
o || r(Number(
|
|
2042
|
+
}, g = (f) => {
|
|
2043
|
+
o || r(Number(f.target.value));
|
|
2041
2044
|
};
|
|
2042
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2045
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-3", s), children: [
|
|
2043
2046
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2044
|
-
/* @__PURE__ */ e(
|
|
2045
|
-
o ? /* @__PURE__ */ e(
|
|
2046
|
-
/* @__PURE__ */ e(
|
|
2047
|
-
/* @__PURE__ */ e(
|
|
2048
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2049
|
-
/* @__PURE__ */ e(
|
|
2050
|
-
/* @__PURE__ */ e(
|
|
2047
|
+
/* @__PURE__ */ e(X, { className: "text-sm font-semibold", children: i.title }),
|
|
2048
|
+
o ? /* @__PURE__ */ e(Q, { delayDuration: 100, children: /* @__PURE__ */ n(Z, { children: [
|
|
2049
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(Qt, { className: "size-3 text-muted-foreground" }) }),
|
|
2050
|
+
/* @__PURE__ */ e(te, { children: /* @__PURE__ */ e("p", { children: i.lockedMessage }) })
|
|
2051
|
+
] }) }) : /* @__PURE__ */ e(Q, { delayDuration: 100, children: /* @__PURE__ */ n(Z, { children: [
|
|
2052
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(Xt, { className: "size-3 text-muted-foreground" }) }),
|
|
2053
|
+
/* @__PURE__ */ e(te, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: i.infoMessage }) })
|
|
2051
2054
|
] }) })
|
|
2052
2055
|
] }),
|
|
2053
2056
|
/* @__PURE__ */ e(
|
|
2054
|
-
|
|
2057
|
+
re,
|
|
2055
2058
|
{
|
|
2056
2059
|
value: t.toString(),
|
|
2057
|
-
onChange:
|
|
2060
|
+
onChange: g,
|
|
2058
2061
|
disabled: o,
|
|
2059
2062
|
className: "h-9 w-[128px] text-sm",
|
|
2060
|
-
children:
|
|
2063
|
+
children: Zt.map((f) => /* @__PURE__ */ e("option", { value: f.value.toString(), children: f.label }, f.value))
|
|
2061
2064
|
}
|
|
2062
2065
|
)
|
|
2063
2066
|
] });
|
|
2064
2067
|
}
|
|
2065
|
-
function
|
|
2068
|
+
function er({ className: t }) {
|
|
2066
2069
|
return /* @__PURE__ */ n(
|
|
2067
2070
|
"svg",
|
|
2068
2071
|
{
|
|
@@ -2084,7 +2087,7 @@ function Zt({ className: t }) {
|
|
|
2084
2087
|
}
|
|
2085
2088
|
);
|
|
2086
2089
|
}
|
|
2087
|
-
function
|
|
2090
|
+
function tr({ className: t }) {
|
|
2088
2091
|
return /* @__PURE__ */ n(
|
|
2089
2092
|
"svg",
|
|
2090
2093
|
{
|
|
@@ -2105,12 +2108,12 @@ function er({ className: t }) {
|
|
|
2105
2108
|
}
|
|
2106
2109
|
);
|
|
2107
2110
|
}
|
|
2108
|
-
const
|
|
2111
|
+
const rr = [
|
|
2109
2112
|
{ value: "dot", label: "Dot indicator" },
|
|
2110
2113
|
{ value: "colored", label: "Full color" },
|
|
2111
2114
|
{ value: "mixed", label: "Mixed" }
|
|
2112
2115
|
];
|
|
2113
|
-
function
|
|
2116
|
+
function qr({
|
|
2114
2117
|
value: t,
|
|
2115
2118
|
onChange: r,
|
|
2116
2119
|
isLocked: o = !1,
|
|
@@ -2127,33 +2130,33 @@ function Kr({
|
|
|
2127
2130
|
mixed: "Mixed"
|
|
2128
2131
|
},
|
|
2129
2132
|
...a
|
|
2130
|
-
},
|
|
2133
|
+
}, g = (c) => i.options?.[c] ?? c, f = (c) => {
|
|
2131
2134
|
o || r(c.target.value);
|
|
2132
2135
|
};
|
|
2133
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2136
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-3", s), children: [
|
|
2134
2137
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2135
|
-
/* @__PURE__ */ e(
|
|
2136
|
-
o ? /* @__PURE__ */ e(
|
|
2137
|
-
/* @__PURE__ */ e(
|
|
2138
|
-
/* @__PURE__ */ e(
|
|
2139
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2140
|
-
/* @__PURE__ */ e(
|
|
2141
|
-
/* @__PURE__ */ e(
|
|
2138
|
+
/* @__PURE__ */ e(X, { className: "text-sm font-semibold", children: i.title }),
|
|
2139
|
+
o ? /* @__PURE__ */ e(Q, { delayDuration: 100, children: /* @__PURE__ */ n(Z, { children: [
|
|
2140
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(tr, { className: "size-3 text-muted-foreground" }) }),
|
|
2141
|
+
/* @__PURE__ */ e(te, { children: /* @__PURE__ */ e("p", { children: i.lockedMessage }) })
|
|
2142
|
+
] }) }) : /* @__PURE__ */ e(Q, { delayDuration: 100, children: /* @__PURE__ */ n(Z, { children: [
|
|
2143
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(er, { className: "size-3 text-muted-foreground" }) }),
|
|
2144
|
+
/* @__PURE__ */ e(te, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: i.infoMessage }) })
|
|
2142
2145
|
] }) })
|
|
2143
2146
|
] }),
|
|
2144
2147
|
/* @__PURE__ */ e(
|
|
2145
|
-
|
|
2148
|
+
re,
|
|
2146
2149
|
{
|
|
2147
2150
|
value: t,
|
|
2148
|
-
onChange:
|
|
2151
|
+
onChange: f,
|
|
2149
2152
|
disabled: o,
|
|
2150
2153
|
className: "h-9 w-[128px] text-sm",
|
|
2151
|
-
children:
|
|
2154
|
+
children: rr.map((c) => /* @__PURE__ */ e("option", { value: c.value, children: g(c.value) }, c.value))
|
|
2152
2155
|
}
|
|
2153
2156
|
)
|
|
2154
2157
|
] });
|
|
2155
2158
|
}
|
|
2156
|
-
function
|
|
2159
|
+
function nr({ className: t }) {
|
|
2157
2160
|
return /* @__PURE__ */ n(
|
|
2158
2161
|
"svg",
|
|
2159
2162
|
{
|
|
@@ -2175,7 +2178,7 @@ function rr({ className: t }) {
|
|
|
2175
2178
|
}
|
|
2176
2179
|
);
|
|
2177
2180
|
}
|
|
2178
|
-
function
|
|
2181
|
+
function or({ className: t }) {
|
|
2179
2182
|
return /* @__PURE__ */ n(
|
|
2180
2183
|
"svg",
|
|
2181
2184
|
{
|
|
@@ -2196,13 +2199,13 @@ function nr({ className: t }) {
|
|
|
2196
2199
|
}
|
|
2197
2200
|
);
|
|
2198
2201
|
}
|
|
2199
|
-
function
|
|
2202
|
+
function sr() {
|
|
2200
2203
|
return Array.from({ length: 25 }, (t, r) => ({
|
|
2201
2204
|
value: r,
|
|
2202
2205
|
label: `${String(r).padStart(2, "0")}:00`
|
|
2203
2206
|
}));
|
|
2204
2207
|
}
|
|
2205
|
-
function
|
|
2208
|
+
function Jr({
|
|
2206
2209
|
value: t,
|
|
2207
2210
|
onChange: r,
|
|
2208
2211
|
isLocked: o = !1,
|
|
@@ -2216,66 +2219,66 @@ function qr({
|
|
|
2216
2219
|
lockedMessage: "This setting is locked by the administrator",
|
|
2217
2220
|
infoMessage: "Set the visible hour range for day and week views. Hours outside this range will be hidden.",
|
|
2218
2221
|
...a
|
|
2219
|
-
},
|
|
2222
|
+
}, g = sr(), f = (x) => {
|
|
2220
2223
|
if (o) return;
|
|
2221
|
-
const
|
|
2222
|
-
|
|
2223
|
-
}, c = (
|
|
2224
|
+
const y = Number(x.target.value);
|
|
2225
|
+
y < t.endHour && r({ ...t, startHour: y });
|
|
2226
|
+
}, c = (x) => {
|
|
2224
2227
|
if (o) return;
|
|
2225
|
-
const
|
|
2226
|
-
|
|
2228
|
+
const y = Number(x.target.value);
|
|
2229
|
+
y > t.startHour && r({ ...t, endHour: y });
|
|
2227
2230
|
};
|
|
2228
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2231
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-3", s), children: [
|
|
2229
2232
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2230
|
-
/* @__PURE__ */ e(
|
|
2231
|
-
o ? /* @__PURE__ */ e(
|
|
2232
|
-
/* @__PURE__ */ e(
|
|
2233
|
-
/* @__PURE__ */ e(
|
|
2234
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2235
|
-
/* @__PURE__ */ e(
|
|
2236
|
-
/* @__PURE__ */ e(
|
|
2233
|
+
/* @__PURE__ */ e(X, { className: "text-sm font-semibold", children: i.title }),
|
|
2234
|
+
o ? /* @__PURE__ */ e(Q, { delayDuration: 100, children: /* @__PURE__ */ n(Z, { children: [
|
|
2235
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(or, { className: "size-3 text-muted-foreground" }) }),
|
|
2236
|
+
/* @__PURE__ */ e(te, { children: /* @__PURE__ */ e("p", { children: i.lockedMessage }) })
|
|
2237
|
+
] }) }) : /* @__PURE__ */ e(Q, { delayDuration: 100, children: /* @__PURE__ */ n(Z, { children: [
|
|
2238
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(nr, { className: "size-3 text-muted-foreground" }) }),
|
|
2239
|
+
/* @__PURE__ */ e(te, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: i.infoMessage }) })
|
|
2237
2240
|
] }) })
|
|
2238
2241
|
] }),
|
|
2239
2242
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2240
2243
|
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
2241
|
-
/* @__PURE__ */ e(
|
|
2244
|
+
/* @__PURE__ */ e(X, { className: "text-xs text-muted-foreground", children: i.from }),
|
|
2242
2245
|
/* @__PURE__ */ e(
|
|
2243
|
-
|
|
2246
|
+
re,
|
|
2244
2247
|
{
|
|
2245
2248
|
value: t.startHour.toString(),
|
|
2246
|
-
onChange:
|
|
2249
|
+
onChange: f,
|
|
2247
2250
|
disabled: o,
|
|
2248
2251
|
className: "h-9 w-[88px] text-sm",
|
|
2249
|
-
children:
|
|
2252
|
+
children: g.map((x) => /* @__PURE__ */ e(
|
|
2250
2253
|
"option",
|
|
2251
2254
|
{
|
|
2252
|
-
value:
|
|
2253
|
-
disabled:
|
|
2254
|
-
children:
|
|
2255
|
+
value: x.value.toString(),
|
|
2256
|
+
disabled: x.value >= t.endHour,
|
|
2257
|
+
children: x.label
|
|
2255
2258
|
},
|
|
2256
|
-
|
|
2259
|
+
x.value
|
|
2257
2260
|
))
|
|
2258
2261
|
}
|
|
2259
2262
|
)
|
|
2260
2263
|
] }),
|
|
2261
2264
|
/* @__PURE__ */ e("span", { className: "mt-5 text-muted-foreground", children: "—" }),
|
|
2262
2265
|
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
2263
|
-
/* @__PURE__ */ e(
|
|
2266
|
+
/* @__PURE__ */ e(X, { className: "text-xs text-muted-foreground", children: i.to }),
|
|
2264
2267
|
/* @__PURE__ */ e(
|
|
2265
|
-
|
|
2268
|
+
re,
|
|
2266
2269
|
{
|
|
2267
2270
|
value: t.endHour.toString(),
|
|
2268
2271
|
onChange: c,
|
|
2269
2272
|
disabled: o,
|
|
2270
2273
|
className: "h-9 w-[88px] text-sm",
|
|
2271
|
-
children:
|
|
2274
|
+
children: g.map((x) => /* @__PURE__ */ e(
|
|
2272
2275
|
"option",
|
|
2273
2276
|
{
|
|
2274
|
-
value:
|
|
2275
|
-
disabled:
|
|
2276
|
-
children:
|
|
2277
|
+
value: x.value.toString(),
|
|
2278
|
+
disabled: x.value <= t.startHour,
|
|
2279
|
+
children: x.label
|
|
2277
2280
|
},
|
|
2278
|
-
|
|
2281
|
+
x.value
|
|
2279
2282
|
))
|
|
2280
2283
|
}
|
|
2281
2284
|
)
|
|
@@ -2283,7 +2286,7 @@ function qr({
|
|
|
2283
2286
|
] })
|
|
2284
2287
|
] });
|
|
2285
2288
|
}
|
|
2286
|
-
function
|
|
2289
|
+
function ar({ className: t }) {
|
|
2287
2290
|
return /* @__PURE__ */ n(
|
|
2288
2291
|
"svg",
|
|
2289
2292
|
{
|
|
@@ -2305,7 +2308,7 @@ function sr({ className: t }) {
|
|
|
2305
2308
|
}
|
|
2306
2309
|
);
|
|
2307
2310
|
}
|
|
2308
|
-
function
|
|
2311
|
+
function ir({ className: t }) {
|
|
2309
2312
|
return /* @__PURE__ */ n(
|
|
2310
2313
|
"svg",
|
|
2311
2314
|
{
|
|
@@ -2326,7 +2329,7 @@ function ar({ className: t }) {
|
|
|
2326
2329
|
}
|
|
2327
2330
|
);
|
|
2328
2331
|
}
|
|
2329
|
-
function
|
|
2332
|
+
function lr({ className: t }) {
|
|
2330
2333
|
return /* @__PURE__ */ e(
|
|
2331
2334
|
"svg",
|
|
2332
2335
|
{
|
|
@@ -2344,7 +2347,7 @@ function ir({ className: t }) {
|
|
|
2344
2347
|
}
|
|
2345
2348
|
);
|
|
2346
2349
|
}
|
|
2347
|
-
const
|
|
2350
|
+
const cr = [
|
|
2348
2351
|
"monday",
|
|
2349
2352
|
"tuesday",
|
|
2350
2353
|
"wednesday",
|
|
@@ -2353,7 +2356,7 @@ const lr = [
|
|
|
2353
2356
|
"saturday",
|
|
2354
2357
|
"sunday"
|
|
2355
2358
|
];
|
|
2356
|
-
function
|
|
2359
|
+
function dr() {
|
|
2357
2360
|
return Array.from({ length: 25 }, (t, r) => ({
|
|
2358
2361
|
value: r,
|
|
2359
2362
|
label: `${String(r).padStart(2, "0")}:00`
|
|
@@ -2368,17 +2371,17 @@ const We = {
|
|
|
2368
2371
|
friday: "Fri",
|
|
2369
2372
|
saturday: "Sat"
|
|
2370
2373
|
};
|
|
2371
|
-
function
|
|
2374
|
+
function ur({ dayLabel: t, config: r, onChange: o, disabled: s, hourOptions: a }) {
|
|
2372
2375
|
const i = () => {
|
|
2373
2376
|
s || o({ ...r, enabled: !r.enabled });
|
|
2374
|
-
}, x = (c) => {
|
|
2375
|
-
if (s) return;
|
|
2376
|
-
const d = Number(c.target.value);
|
|
2377
|
-
d < r.to && o({ ...r, from: d });
|
|
2378
2377
|
}, g = (c) => {
|
|
2379
2378
|
if (s) return;
|
|
2380
|
-
const
|
|
2381
|
-
|
|
2379
|
+
const x = Number(c.target.value);
|
|
2380
|
+
x < r.to && o({ ...r, from: x });
|
|
2381
|
+
}, f = (c) => {
|
|
2382
|
+
if (s) return;
|
|
2383
|
+
const x = Number(c.target.value);
|
|
2384
|
+
x > r.from && o({ ...r, to: x });
|
|
2382
2385
|
};
|
|
2383
2386
|
return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2384
2387
|
/* @__PURE__ */ e(
|
|
@@ -2390,20 +2393,20 @@ function dr({ dayLabel: t, config: r, onChange: o, disabled: s, hourOptions: a }
|
|
|
2390
2393
|
"aria-label": `Enable ${t}`,
|
|
2391
2394
|
onClick: i,
|
|
2392
2395
|
disabled: s,
|
|
2393
|
-
className:
|
|
2396
|
+
className: h(
|
|
2394
2397
|
"flex size-5 shrink-0 items-center justify-center rounded border transition-colors",
|
|
2395
2398
|
r.enabled ? "border-primary bg-primary text-primary-foreground" : "border-input bg-background",
|
|
2396
2399
|
s && "cursor-not-allowed opacity-50"
|
|
2397
2400
|
),
|
|
2398
|
-
children: r.enabled && /* @__PURE__ */ e(
|
|
2401
|
+
children: r.enabled && /* @__PURE__ */ e(lr, { className: "size-3" })
|
|
2399
2402
|
}
|
|
2400
2403
|
),
|
|
2401
|
-
/* @__PURE__ */ e("span", { className:
|
|
2404
|
+
/* @__PURE__ */ e("span", { className: h("w-10 text-sm", !r.enabled && "text-muted-foreground"), children: t }),
|
|
2402
2405
|
/* @__PURE__ */ e(
|
|
2403
|
-
|
|
2406
|
+
re,
|
|
2404
2407
|
{
|
|
2405
2408
|
value: r.from.toString(),
|
|
2406
|
-
onChange:
|
|
2409
|
+
onChange: g,
|
|
2407
2410
|
disabled: s || !r.enabled,
|
|
2408
2411
|
className: "h-8 w-[76px] text-xs",
|
|
2409
2412
|
children: a.map((c) => /* @__PURE__ */ e("option", { value: c.value.toString(), disabled: c.value >= r.to, children: c.label }, c.value))
|
|
@@ -2411,10 +2414,10 @@ function dr({ dayLabel: t, config: r, onChange: o, disabled: s, hourOptions: a }
|
|
|
2411
2414
|
),
|
|
2412
2415
|
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "—" }),
|
|
2413
2416
|
/* @__PURE__ */ e(
|
|
2414
|
-
|
|
2417
|
+
re,
|
|
2415
2418
|
{
|
|
2416
2419
|
value: r.to.toString(),
|
|
2417
|
-
onChange:
|
|
2420
|
+
onChange: f,
|
|
2418
2421
|
disabled: s || !r.enabled,
|
|
2419
2422
|
className: "h-8 w-[76px] text-xs",
|
|
2420
2423
|
children: a.map((c) => /* @__PURE__ */ e("option", { value: c.value.toString(), disabled: c.value <= r.from, children: c.label }, c.value))
|
|
@@ -2422,7 +2425,7 @@ function dr({ dayLabel: t, config: r, onChange: o, disabled: s, hourOptions: a }
|
|
|
2422
2425
|
)
|
|
2423
2426
|
] });
|
|
2424
2427
|
}
|
|
2425
|
-
function
|
|
2428
|
+
function Xr({
|
|
2426
2429
|
value: t,
|
|
2427
2430
|
onChange: r,
|
|
2428
2431
|
isLocked: o = !1,
|
|
@@ -2435,34 +2438,34 @@ function Jr({
|
|
|
2435
2438
|
infoMessage: "Configure working hours for each day of the week. Non-working hours will be grayed out in day and week views.",
|
|
2436
2439
|
days: We,
|
|
2437
2440
|
...a
|
|
2438
|
-
},
|
|
2439
|
-
o || r({ ...t, [c]:
|
|
2441
|
+
}, g = dr(), f = (c, x) => {
|
|
2442
|
+
o || r({ ...t, [c]: x });
|
|
2440
2443
|
};
|
|
2441
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2444
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-3", s), children: [
|
|
2442
2445
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2443
|
-
/* @__PURE__ */ e(
|
|
2444
|
-
o ? /* @__PURE__ */ e(
|
|
2445
|
-
/* @__PURE__ */ e(
|
|
2446
|
-
/* @__PURE__ */ e(
|
|
2447
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2448
|
-
/* @__PURE__ */ e(
|
|
2449
|
-
/* @__PURE__ */ e(
|
|
2446
|
+
/* @__PURE__ */ e(X, { className: "text-sm font-semibold", children: i.title }),
|
|
2447
|
+
o ? /* @__PURE__ */ e(Q, { delayDuration: 100, children: /* @__PURE__ */ n(Z, { children: [
|
|
2448
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(ir, { className: "size-3 text-muted-foreground" }) }),
|
|
2449
|
+
/* @__PURE__ */ e(te, { children: /* @__PURE__ */ e("p", { children: i.lockedMessage }) })
|
|
2450
|
+
] }) }) : /* @__PURE__ */ e(Q, { delayDuration: 100, children: /* @__PURE__ */ n(Z, { children: [
|
|
2451
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(ar, { className: "size-3 text-muted-foreground" }) }),
|
|
2452
|
+
/* @__PURE__ */ e(te, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: i.infoMessage }) })
|
|
2450
2453
|
] }) })
|
|
2451
2454
|
] }),
|
|
2452
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children:
|
|
2453
|
-
|
|
2455
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: cr.map((c) => /* @__PURE__ */ e(
|
|
2456
|
+
ur,
|
|
2454
2457
|
{
|
|
2455
2458
|
dayLabel: i.days?.[c] ?? We[c],
|
|
2456
2459
|
config: t[c],
|
|
2457
|
-
onChange: (
|
|
2460
|
+
onChange: (x) => f(c, x),
|
|
2458
2461
|
disabled: o,
|
|
2459
|
-
hourOptions:
|
|
2462
|
+
hourOptions: g
|
|
2460
2463
|
},
|
|
2461
2464
|
c
|
|
2462
2465
|
)) })
|
|
2463
2466
|
] });
|
|
2464
2467
|
}
|
|
2465
|
-
const
|
|
2468
|
+
const Qr = {
|
|
2466
2469
|
sunday: { enabled: !1, from: 8, to: 18 },
|
|
2467
2470
|
monday: { enabled: !0, from: 8, to: 18 },
|
|
2468
2471
|
tuesday: { enabled: !0, from: 8, to: 18 },
|
|
@@ -2471,7 +2474,7 @@ const Xr = {
|
|
|
2471
2474
|
friday: { enabled: !0, from: 8, to: 18 },
|
|
2472
2475
|
saturday: { enabled: !1, from: 8, to: 18 }
|
|
2473
2476
|
};
|
|
2474
|
-
function
|
|
2477
|
+
function be({ className: t }) {
|
|
2475
2478
|
return /* @__PURE__ */ e(
|
|
2476
2479
|
"svg",
|
|
2477
2480
|
{
|
|
@@ -2487,7 +2490,7 @@ function we({ className: t }) {
|
|
|
2487
2490
|
}
|
|
2488
2491
|
);
|
|
2489
2492
|
}
|
|
2490
|
-
function
|
|
2493
|
+
function hr({ className: t }) {
|
|
2491
2494
|
return /* @__PURE__ */ n(
|
|
2492
2495
|
"svg",
|
|
2493
2496
|
{
|
|
@@ -2506,7 +2509,7 @@ function ur({ className: t }) {
|
|
|
2506
2509
|
}
|
|
2507
2510
|
);
|
|
2508
2511
|
}
|
|
2509
|
-
function
|
|
2512
|
+
function mr({ className: t }) {
|
|
2510
2513
|
return /* @__PURE__ */ n(
|
|
2511
2514
|
"svg",
|
|
2512
2515
|
{
|
|
@@ -2525,7 +2528,7 @@ function hr({ className: t }) {
|
|
|
2525
2528
|
}
|
|
2526
2529
|
);
|
|
2527
2530
|
}
|
|
2528
|
-
function
|
|
2531
|
+
function ye({ checked: t, onCheckedChange: r, className: o, children: s }) {
|
|
2529
2532
|
return /* @__PURE__ */ e(
|
|
2530
2533
|
"button",
|
|
2531
2534
|
{
|
|
@@ -2538,12 +2541,12 @@ function be({ checked: t, onCheckedChange: r, className: o, children: s }) {
|
|
|
2538
2541
|
}
|
|
2539
2542
|
);
|
|
2540
2543
|
}
|
|
2541
|
-
function
|
|
2542
|
-
const [a, i] =
|
|
2544
|
+
function fr({ src: t, alt: r, fallback: o, className: s }) {
|
|
2545
|
+
const [a, i] = se(!1);
|
|
2543
2546
|
return !t || a ? /* @__PURE__ */ e(
|
|
2544
2547
|
"div",
|
|
2545
2548
|
{
|
|
2546
|
-
className:
|
|
2549
|
+
className: h(
|
|
2547
2550
|
"flex items-center justify-center bg-zinc-200 text-zinc-600 font-medium text-sm",
|
|
2548
2551
|
s
|
|
2549
2552
|
),
|
|
@@ -2554,14 +2557,14 @@ function mr({ src: t, alt: r, fallback: o, className: s }) {
|
|
|
2554
2557
|
{
|
|
2555
2558
|
src: t,
|
|
2556
2559
|
alt: r || "",
|
|
2557
|
-
className:
|
|
2560
|
+
className: h("object-cover", s),
|
|
2558
2561
|
onError: () => i(!0)
|
|
2559
2562
|
}
|
|
2560
2563
|
);
|
|
2561
2564
|
}
|
|
2562
2565
|
function Ae({ value: t, onChange: r, placeholder: o, className: s }) {
|
|
2563
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2564
|
-
/* @__PURE__ */ e(
|
|
2566
|
+
return /* @__PURE__ */ n("div", { className: h("relative", s), children: [
|
|
2567
|
+
/* @__PURE__ */ e(hr, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
2565
2568
|
/* @__PURE__ */ e(
|
|
2566
2569
|
"input",
|
|
2567
2570
|
{
|
|
@@ -2577,9 +2580,9 @@ function Ae({ value: t, onChange: r, placeholder: o, className: s }) {
|
|
|
2577
2580
|
function Fe(t, r, o, s = 0.3) {
|
|
2578
2581
|
if (!r.trim()) return t;
|
|
2579
2582
|
const a = r.toLowerCase();
|
|
2580
|
-
return t.filter((i) => o(i).some((
|
|
2583
|
+
return t.filter((i) => o(i).some((f) => f ? f.toLowerCase().includes(a) : !1));
|
|
2581
2584
|
}
|
|
2582
|
-
const
|
|
2585
|
+
const gr = {
|
|
2583
2586
|
title: "Filters",
|
|
2584
2587
|
subtitle: "Filter calendar events",
|
|
2585
2588
|
scheduleTypes: "Event Types",
|
|
@@ -2592,73 +2595,73 @@ const fr = {
|
|
|
2592
2595
|
noScheduleTypes: "No event types found",
|
|
2593
2596
|
noParticipants: "No participants found"
|
|
2594
2597
|
};
|
|
2595
|
-
function
|
|
2598
|
+
function Zr({
|
|
2596
2599
|
scheduleTypes: t,
|
|
2597
2600
|
users: r,
|
|
2598
2601
|
selectedScheduleTypeIds: o,
|
|
2599
2602
|
onScheduleTypeChange: s,
|
|
2600
2603
|
selectedUserIds: a,
|
|
2601
2604
|
onUserChange: i,
|
|
2602
|
-
onClearAll:
|
|
2603
|
-
className:
|
|
2605
|
+
onClearAll: g,
|
|
2606
|
+
className: f,
|
|
2604
2607
|
scheduleTypesLoading: c = !1,
|
|
2605
|
-
usersLoading:
|
|
2606
|
-
labels:
|
|
2607
|
-
getScheduleTypeName:
|
|
2608
|
+
usersLoading: x = !1,
|
|
2609
|
+
labels: y,
|
|
2610
|
+
getScheduleTypeName: p
|
|
2608
2611
|
}) {
|
|
2609
|
-
const
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
]) : t, [t,
|
|
2613
|
-
const
|
|
2614
|
-
s(
|
|
2615
|
-
},
|
|
2616
|
-
if (
|
|
2617
|
-
const
|
|
2618
|
-
s(o.filter((l) => !
|
|
2612
|
+
const M = { ...gr, ...y }, [A, z] = se(""), [C, S] = se(""), L = B(() => A.trim() ? Fe(t, A, (u) => [
|
|
2613
|
+
u.name,
|
|
2614
|
+
p?.(u) || u.name
|
|
2615
|
+
]) : t, [t, A, p]), w = B(() => C.trim() ? Fe(r, C, (u) => [u.name, u.email || ""]) : r, [r, C]), T = L.length > 0 && L.every((u) => o.includes(u.id)), D = w.length > 0 && w.every((u) => a.includes(u.id)), F = o.length + a.length, R = (u, l) => {
|
|
2616
|
+
const d = l ? [...o, u] : o.filter((v) => v !== u);
|
|
2617
|
+
s(d);
|
|
2618
|
+
}, V = () => {
|
|
2619
|
+
if (T) {
|
|
2620
|
+
const u = new Set(L.map((l) => l.id));
|
|
2621
|
+
s(o.filter((l) => !u.has(l)));
|
|
2619
2622
|
} else {
|
|
2620
|
-
const
|
|
2623
|
+
const u = /* @__PURE__ */ new Set([
|
|
2621
2624
|
...o,
|
|
2622
|
-
...
|
|
2625
|
+
...L.map((l) => l.id)
|
|
2623
2626
|
]);
|
|
2624
|
-
s(Array.from(
|
|
2627
|
+
s(Array.from(u));
|
|
2625
2628
|
}
|
|
2626
|
-
},
|
|
2627
|
-
const
|
|
2628
|
-
i(
|
|
2629
|
-
},
|
|
2630
|
-
if (
|
|
2631
|
-
const
|
|
2632
|
-
i(a.filter((l) => !
|
|
2629
|
+
}, $ = (u, l) => {
|
|
2630
|
+
const d = l ? [...a, u] : a.filter((v) => v !== u);
|
|
2631
|
+
i(d);
|
|
2632
|
+
}, O = () => {
|
|
2633
|
+
if (D) {
|
|
2634
|
+
const u = new Set(w.map((l) => l.id));
|
|
2635
|
+
i(a.filter((l) => !u.has(l)));
|
|
2633
2636
|
} else {
|
|
2634
|
-
const
|
|
2635
|
-
i(Array.from(
|
|
2637
|
+
const u = /* @__PURE__ */ new Set([...a, ...w.map((l) => l.id)]);
|
|
2638
|
+
i(Array.from(u));
|
|
2636
2639
|
}
|
|
2637
|
-
},
|
|
2638
|
-
s([]), i([]),
|
|
2639
|
-
},
|
|
2640
|
+
}, I = () => {
|
|
2641
|
+
s([]), i([]), g?.();
|
|
2642
|
+
}, P = (u) => p ? p(u) : u.name, U = (u) => u.colorHex || u.color || "#069AD7";
|
|
2640
2643
|
return /* @__PURE__ */ n(
|
|
2641
2644
|
"div",
|
|
2642
2645
|
{
|
|
2643
|
-
className:
|
|
2646
|
+
className: h(
|
|
2644
2647
|
"flex min-w-72 max-w-72 flex-col rounded-lg border bg-white shadow-sm",
|
|
2645
|
-
|
|
2648
|
+
f
|
|
2646
2649
|
),
|
|
2647
2650
|
children: [
|
|
2648
2651
|
/* @__PURE__ */ n("header", { className: "flex items-start justify-between gap-2 px-4 pb-2 pt-4", children: [
|
|
2649
2652
|
/* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
2650
|
-
/* @__PURE__ */ e("h3", { className: "text-base font-semibold text-foreground", children:
|
|
2651
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children:
|
|
2653
|
+
/* @__PURE__ */ e("h3", { className: "text-base font-semibold text-foreground", children: M.title }),
|
|
2654
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: M.subtitle })
|
|
2652
2655
|
] }),
|
|
2653
|
-
|
|
2656
|
+
F > 0 && /* @__PURE__ */ n(
|
|
2654
2657
|
"button",
|
|
2655
2658
|
{
|
|
2656
2659
|
type: "button",
|
|
2657
|
-
onClick:
|
|
2660
|
+
onClick: I,
|
|
2658
2661
|
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",
|
|
2659
2662
|
children: [
|
|
2660
|
-
/* @__PURE__ */ e(
|
|
2661
|
-
|
|
2663
|
+
/* @__PURE__ */ e(mr, { className: "h-3.5 w-3.5" }),
|
|
2664
|
+
M.clearAll
|
|
2662
2665
|
]
|
|
2663
2666
|
}
|
|
2664
2667
|
)
|
|
@@ -2666,29 +2669,29 @@ function Qr({
|
|
|
2666
2669
|
/* @__PURE__ */ e("div", { className: "h-px w-full bg-border/60" }),
|
|
2667
2670
|
/* @__PURE__ */ n("section", { className: "flex flex-col", children: [
|
|
2668
2671
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
2669
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children:
|
|
2672
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children: M.scheduleTypes }),
|
|
2670
2673
|
/* @__PURE__ */ e(
|
|
2671
2674
|
"button",
|
|
2672
2675
|
{
|
|
2673
2676
|
type: "button",
|
|
2674
|
-
onClick:
|
|
2677
|
+
onClick: V,
|
|
2675
2678
|
className: "text-xs font-medium text-primary transition-colors hover:text-primary/80",
|
|
2676
|
-
children:
|
|
2679
|
+
children: T ? M.unselectAll : M.selectAll
|
|
2677
2680
|
}
|
|
2678
2681
|
)
|
|
2679
2682
|
] }),
|
|
2680
2683
|
t.length > 6 && /* @__PURE__ */ e("div", { className: "px-4 pb-3", children: /* @__PURE__ */ e(
|
|
2681
2684
|
Ae,
|
|
2682
2685
|
{
|
|
2683
|
-
value:
|
|
2684
|
-
onChange:
|
|
2685
|
-
placeholder:
|
|
2686
|
+
value: A,
|
|
2687
|
+
onChange: z,
|
|
2688
|
+
placeholder: M.searchScheduleTypes
|
|
2686
2689
|
}
|
|
2687
2690
|
) }),
|
|
2688
2691
|
/* @__PURE__ */ n("div", { className: "flex max-h-[220px] flex-col gap-2 overflow-y-auto px-4 pb-2 scrollbar-thin", children: [
|
|
2689
2692
|
c ? (
|
|
2690
2693
|
// Loading skeletons
|
|
2691
|
-
Array.from({ length: 4 }).map((
|
|
2694
|
+
Array.from({ length: 4 }).map((u, l) => /* @__PURE__ */ n(
|
|
2692
2695
|
"div",
|
|
2693
2696
|
{
|
|
2694
2697
|
className: "flex animate-pulse items-center gap-2 rounded-md border border-border/60 bg-muted/40 p-2",
|
|
@@ -2699,14 +2702,14 @@ function Qr({
|
|
|
2699
2702
|
},
|
|
2700
2703
|
`skeleton-${l}`
|
|
2701
2704
|
))
|
|
2702
|
-
) :
|
|
2703
|
-
const l = o.includes(
|
|
2705
|
+
) : L.map((u) => {
|
|
2706
|
+
const l = o.includes(u.id), d = U(u);
|
|
2704
2707
|
return /* @__PURE__ */ n(
|
|
2705
|
-
|
|
2708
|
+
ye,
|
|
2706
2709
|
{
|
|
2707
2710
|
checked: l,
|
|
2708
|
-
onCheckedChange: (v) =>
|
|
2709
|
-
className:
|
|
2711
|
+
onCheckedChange: (v) => R(u.id, v),
|
|
2712
|
+
className: h(
|
|
2710
2713
|
"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",
|
|
2711
2714
|
l && "border-primary bg-primary/5"
|
|
2712
2715
|
),
|
|
@@ -2715,62 +2718,62 @@ function Qr({
|
|
|
2715
2718
|
/* @__PURE__ */ e(
|
|
2716
2719
|
"span",
|
|
2717
2720
|
{
|
|
2718
|
-
className:
|
|
2721
|
+
className: h(
|
|
2719
2722
|
"flex h-4 w-4 items-center justify-center rounded border border-border text-xs transition-colors",
|
|
2720
2723
|
l && "border-primary bg-primary text-primary-foreground"
|
|
2721
2724
|
),
|
|
2722
|
-
children: l && /* @__PURE__ */ e(
|
|
2725
|
+
children: l && /* @__PURE__ */ e(be, { className: "h-3 w-3" })
|
|
2723
2726
|
}
|
|
2724
2727
|
),
|
|
2725
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children:
|
|
2728
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: P(u) })
|
|
2726
2729
|
] }),
|
|
2727
2730
|
/* @__PURE__ */ e(
|
|
2728
2731
|
"div",
|
|
2729
2732
|
{
|
|
2730
2733
|
className: "h-4 w-4 rounded-full border",
|
|
2731
2734
|
style: {
|
|
2732
|
-
backgroundColor:
|
|
2733
|
-
borderColor:
|
|
2735
|
+
backgroundColor: d,
|
|
2736
|
+
borderColor: d
|
|
2734
2737
|
}
|
|
2735
2738
|
}
|
|
2736
2739
|
)
|
|
2737
2740
|
]
|
|
2738
2741
|
},
|
|
2739
|
-
|
|
2742
|
+
u.id
|
|
2740
2743
|
);
|
|
2741
2744
|
}),
|
|
2742
|
-
!c &&
|
|
2745
|
+
!c && L.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1 text-xs text-muted-foreground", children: M.noScheduleTypes })
|
|
2743
2746
|
] })
|
|
2744
2747
|
] }),
|
|
2745
2748
|
/* @__PURE__ */ e("div", { className: "h-px w-full bg-border/60" }),
|
|
2746
2749
|
/* @__PURE__ */ n("section", { className: "flex flex-col", children: [
|
|
2747
2750
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
2748
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children:
|
|
2751
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children: M.participants }),
|
|
2749
2752
|
/* @__PURE__ */ e(
|
|
2750
|
-
|
|
2753
|
+
ye,
|
|
2751
2754
|
{
|
|
2752
|
-
checked:
|
|
2753
|
-
onCheckedChange: () =>
|
|
2754
|
-
className:
|
|
2755
|
+
checked: D,
|
|
2756
|
+
onCheckedChange: () => O(),
|
|
2757
|
+
className: h(
|
|
2755
2758
|
"flex h-5 w-5 items-center justify-center rounded border border-border bg-white transition-colors hover:border-primary/50",
|
|
2756
|
-
|
|
2759
|
+
D && "border-primary bg-primary text-primary-foreground"
|
|
2757
2760
|
),
|
|
2758
|
-
children:
|
|
2761
|
+
children: D && /* @__PURE__ */ e(be, { className: "h-3.5 w-3.5" })
|
|
2759
2762
|
}
|
|
2760
2763
|
)
|
|
2761
2764
|
] }),
|
|
2762
2765
|
/* @__PURE__ */ e("div", { className: "px-4 pb-3", children: /* @__PURE__ */ e(
|
|
2763
2766
|
Ae,
|
|
2764
2767
|
{
|
|
2765
|
-
value:
|
|
2766
|
-
onChange:
|
|
2767
|
-
placeholder:
|
|
2768
|
+
value: C,
|
|
2769
|
+
onChange: S,
|
|
2770
|
+
placeholder: M.searchParticipants
|
|
2768
2771
|
}
|
|
2769
2772
|
) }),
|
|
2770
2773
|
/* @__PURE__ */ n("div", { className: "flex max-h-[400px] flex-col gap-2 overflow-y-auto px-4 pb-4 scrollbar-thin", children: [
|
|
2771
|
-
|
|
2774
|
+
x ? (
|
|
2772
2775
|
// Loading skeletons
|
|
2773
|
-
Array.from({ length: 4 }).map((
|
|
2776
|
+
Array.from({ length: 4 }).map((u, l) => /* @__PURE__ */ n(
|
|
2774
2777
|
"div",
|
|
2775
2778
|
{
|
|
2776
2779
|
className: "flex animate-pulse items-center gap-3 rounded-md border border-border/60 bg-muted/40 p-3",
|
|
@@ -2785,14 +2788,14 @@ function Qr({
|
|
|
2785
2788
|
},
|
|
2786
2789
|
`p-skeleton-${l}`
|
|
2787
2790
|
))
|
|
2788
|
-
) :
|
|
2789
|
-
const l = a.includes(
|
|
2791
|
+
) : w.map((u) => {
|
|
2792
|
+
const l = a.includes(u.id);
|
|
2790
2793
|
return /* @__PURE__ */ n(
|
|
2791
|
-
|
|
2794
|
+
ye,
|
|
2792
2795
|
{
|
|
2793
2796
|
checked: l,
|
|
2794
|
-
onCheckedChange: (
|
|
2795
|
-
className:
|
|
2797
|
+
onCheckedChange: (d) => $(u.id, d),
|
|
2798
|
+
className: h(
|
|
2796
2799
|
"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",
|
|
2797
2800
|
l && "border-primary bg-zinc-50"
|
|
2798
2801
|
),
|
|
@@ -2800,48 +2803,48 @@ function Qr({
|
|
|
2800
2803
|
/* @__PURE__ */ e(
|
|
2801
2804
|
"span",
|
|
2802
2805
|
{
|
|
2803
|
-
className:
|
|
2806
|
+
className: h(
|
|
2804
2807
|
"flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border border-border transition-colors",
|
|
2805
2808
|
l && "border-primary bg-primary text-primary-foreground"
|
|
2806
2809
|
),
|
|
2807
|
-
children: l && /* @__PURE__ */ e(
|
|
2810
|
+
children: l && /* @__PURE__ */ e(be, { className: "h-2.5 w-2.5" })
|
|
2808
2811
|
}
|
|
2809
2812
|
),
|
|
2810
2813
|
/* @__PURE__ */ n("div", { className: "flex flex-1 items-start gap-2", children: [
|
|
2811
2814
|
/* @__PURE__ */ e(
|
|
2812
|
-
|
|
2815
|
+
fr,
|
|
2813
2816
|
{
|
|
2814
|
-
src:
|
|
2815
|
-
alt:
|
|
2816
|
-
fallback:
|
|
2817
|
+
src: u.avatar ?? null,
|
|
2818
|
+
alt: u.name,
|
|
2819
|
+
fallback: u.name?.[0]?.toUpperCase() ?? "?",
|
|
2817
2820
|
className: "h-10 w-10 rounded-lg"
|
|
2818
2821
|
}
|
|
2819
2822
|
),
|
|
2820
2823
|
/* @__PURE__ */ n("div", { className: "flex max-w-[140px] flex-col gap-0.5 overflow-hidden", children: [
|
|
2821
|
-
/* @__PURE__ */ e("span", { className: "line-clamp-1 text-sm font-medium text-foreground", children:
|
|
2824
|
+
/* @__PURE__ */ e("span", { className: "line-clamp-1 text-sm font-medium text-foreground", children: u.name }),
|
|
2822
2825
|
/* @__PURE__ */ e(
|
|
2823
2826
|
"span",
|
|
2824
2827
|
{
|
|
2825
2828
|
className: "truncate text-[11px] text-muted-foreground",
|
|
2826
|
-
title:
|
|
2827
|
-
children:
|
|
2829
|
+
title: u.email,
|
|
2830
|
+
children: u.email
|
|
2828
2831
|
}
|
|
2829
2832
|
)
|
|
2830
2833
|
] })
|
|
2831
2834
|
] })
|
|
2832
2835
|
]
|
|
2833
2836
|
},
|
|
2834
|
-
|
|
2837
|
+
u.id
|
|
2835
2838
|
);
|
|
2836
2839
|
}),
|
|
2837
|
-
!
|
|
2840
|
+
!x && w.length === 0 && /* @__PURE__ */ e("p", { className: "px-4 text-xs text-muted-foreground", children: M.noParticipants })
|
|
2838
2841
|
] })
|
|
2839
2842
|
] })
|
|
2840
2843
|
]
|
|
2841
2844
|
}
|
|
2842
2845
|
);
|
|
2843
2846
|
}
|
|
2844
|
-
function
|
|
2847
|
+
function xr({ className: t }) {
|
|
2845
2848
|
return /* @__PURE__ */ n(
|
|
2846
2849
|
"svg",
|
|
2847
2850
|
{
|
|
@@ -2862,7 +2865,7 @@ function gr({ className: t }) {
|
|
|
2862
2865
|
}
|
|
2863
2866
|
);
|
|
2864
2867
|
}
|
|
2865
|
-
function
|
|
2868
|
+
function en({
|
|
2866
2869
|
scheduleTypes: t,
|
|
2867
2870
|
value: r,
|
|
2868
2871
|
onChange: o,
|
|
@@ -2870,24 +2873,24 @@ function Zr({
|
|
|
2870
2873
|
className: a,
|
|
2871
2874
|
label: i
|
|
2872
2875
|
}) {
|
|
2873
|
-
const
|
|
2876
|
+
const g = (c) => {
|
|
2874
2877
|
o(c.target.value);
|
|
2875
|
-
},
|
|
2876
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2877
|
-
i && /* @__PURE__ */ e(
|
|
2878
|
+
}, f = t.find((c) => String(c.id) === r);
|
|
2879
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-1", a), children: [
|
|
2880
|
+
i && /* @__PURE__ */ e(X, { className: "text-xs text-muted-foreground", children: i }),
|
|
2878
2881
|
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2879
|
-
|
|
2882
|
+
f ? /* @__PURE__ */ e(
|
|
2880
2883
|
"span",
|
|
2881
2884
|
{
|
|
2882
2885
|
className: "pointer-events-none absolute left-2.5 top-1/2 size-3 -translate-y-1/2 rounded-full",
|
|
2883
|
-
style: { backgroundColor:
|
|
2886
|
+
style: { backgroundColor: f.color }
|
|
2884
2887
|
}
|
|
2885
|
-
) : /* @__PURE__ */ e(
|
|
2888
|
+
) : /* @__PURE__ */ e(xr, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
2886
2889
|
/* @__PURE__ */ n(
|
|
2887
|
-
|
|
2890
|
+
re,
|
|
2888
2891
|
{
|
|
2889
2892
|
value: r,
|
|
2890
|
-
onChange:
|
|
2893
|
+
onChange: g,
|
|
2891
2894
|
className: "h-9 w-full min-w-[140px] pl-8 pr-8 text-sm",
|
|
2892
2895
|
children: [
|
|
2893
2896
|
/* @__PURE__ */ e("option", { value: "all", children: s }),
|
|
@@ -2898,7 +2901,7 @@ function Zr({
|
|
|
2898
2901
|
] })
|
|
2899
2902
|
] });
|
|
2900
2903
|
}
|
|
2901
|
-
function
|
|
2904
|
+
function pr({ className: t }) {
|
|
2902
2905
|
return /* @__PURE__ */ n(
|
|
2903
2906
|
"svg",
|
|
2904
2907
|
{
|
|
@@ -2921,7 +2924,7 @@ function xr({ className: t }) {
|
|
|
2921
2924
|
}
|
|
2922
2925
|
);
|
|
2923
2926
|
}
|
|
2924
|
-
function
|
|
2927
|
+
function tn({
|
|
2925
2928
|
users: t,
|
|
2926
2929
|
value: r,
|
|
2927
2930
|
onChange: o,
|
|
@@ -2929,29 +2932,29 @@ function en({
|
|
|
2929
2932
|
className: a,
|
|
2930
2933
|
label: i
|
|
2931
2934
|
}) {
|
|
2932
|
-
const
|
|
2933
|
-
o(
|
|
2935
|
+
const g = (f) => {
|
|
2936
|
+
o(f.target.value);
|
|
2934
2937
|
};
|
|
2935
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2936
|
-
i && /* @__PURE__ */ e(
|
|
2938
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-1", a), children: [
|
|
2939
|
+
i && /* @__PURE__ */ e(X, { className: "text-xs text-muted-foreground", children: i }),
|
|
2937
2940
|
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2938
|
-
/* @__PURE__ */ e(
|
|
2941
|
+
/* @__PURE__ */ e(pr, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
2939
2942
|
/* @__PURE__ */ n(
|
|
2940
|
-
|
|
2943
|
+
re,
|
|
2941
2944
|
{
|
|
2942
2945
|
value: r,
|
|
2943
|
-
onChange:
|
|
2946
|
+
onChange: g,
|
|
2944
2947
|
className: "h-9 w-full min-w-[120px] pl-8 pr-8 text-sm",
|
|
2945
2948
|
children: [
|
|
2946
2949
|
/* @__PURE__ */ e("option", { value: "all", children: s }),
|
|
2947
|
-
t.map((
|
|
2950
|
+
t.map((f) => /* @__PURE__ */ e("option", { value: f.id, children: f.name }, f.id))
|
|
2948
2951
|
]
|
|
2949
2952
|
}
|
|
2950
2953
|
)
|
|
2951
2954
|
] })
|
|
2952
2955
|
] });
|
|
2953
2956
|
}
|
|
2954
|
-
function
|
|
2957
|
+
function vr({ className: t }) {
|
|
2955
2958
|
return /* @__PURE__ */ n(
|
|
2956
2959
|
"svg",
|
|
2957
2960
|
{
|
|
@@ -2978,7 +2981,7 @@ function pr({ className: t }) {
|
|
|
2978
2981
|
}
|
|
2979
2982
|
);
|
|
2980
2983
|
}
|
|
2981
|
-
function
|
|
2984
|
+
function wr({ className: t }) {
|
|
2982
2985
|
return /* @__PURE__ */ n(
|
|
2983
2986
|
"svg",
|
|
2984
2987
|
{
|
|
@@ -3001,7 +3004,7 @@ function vr({ className: t }) {
|
|
|
3001
3004
|
}
|
|
3002
3005
|
);
|
|
3003
3006
|
}
|
|
3004
|
-
function
|
|
3007
|
+
function br({ className: t }) {
|
|
3005
3008
|
return /* @__PURE__ */ e(
|
|
3006
3009
|
"svg",
|
|
3007
3010
|
{
|
|
@@ -3017,7 +3020,7 @@ function wr({ className: t }) {
|
|
|
3017
3020
|
}
|
|
3018
3021
|
);
|
|
3019
3022
|
}
|
|
3020
|
-
function
|
|
3023
|
+
function yr({ className: t }) {
|
|
3021
3024
|
return /* @__PURE__ */ n(
|
|
3022
3025
|
"svg",
|
|
3023
3026
|
{
|
|
@@ -3037,7 +3040,7 @@ function br({ className: t }) {
|
|
|
3037
3040
|
}
|
|
3038
3041
|
);
|
|
3039
3042
|
}
|
|
3040
|
-
function
|
|
3043
|
+
function kr(t) {
|
|
3041
3044
|
const r = t.getFullYear(), o = String(t.getMonth() + 1).padStart(2, "0"), s = String(t.getDate()).padStart(2, "0");
|
|
3042
3045
|
return `${r}-${o}-${s}`;
|
|
3043
3046
|
}
|
|
@@ -3045,17 +3048,17 @@ function Be(t) {
|
|
|
3045
3048
|
const r = t.getHours(), o = t.getMinutes(), s = r >= 12 ? "PM" : "AM", a = r % 12 || 12, i = String(o).padStart(2, "0");
|
|
3046
3049
|
return `${a}:${i} ${s}`;
|
|
3047
3050
|
}
|
|
3048
|
-
function
|
|
3051
|
+
function Nr(t) {
|
|
3049
3052
|
const r = Be(t.startDate), o = Be(t.endDate);
|
|
3050
3053
|
return `${r} - ${o}`;
|
|
3051
3054
|
}
|
|
3052
|
-
function
|
|
3055
|
+
function Cr(t) {
|
|
3053
3056
|
const r = Ue(/* @__PURE__ */ new Date(), 1);
|
|
3054
3057
|
return t.getFullYear() === r.getFullYear() && t.getMonth() === r.getMonth() && t.getDate() === r.getDate();
|
|
3055
3058
|
}
|
|
3056
|
-
function
|
|
3059
|
+
function Dr(t) {
|
|
3057
3060
|
if (q(t)) return "Today";
|
|
3058
|
-
if (
|
|
3061
|
+
if (Cr(t)) return "Tomorrow";
|
|
3059
3062
|
const r = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], o = [
|
|
3060
3063
|
"Jan",
|
|
3061
3064
|
"Feb",
|
|
@@ -3072,38 +3075,38 @@ function Cr(t) {
|
|
|
3072
3075
|
], s = r[t.getDay()], a = o[t.getMonth()], i = t.getDate();
|
|
3073
3076
|
return `${s}, ${a} ${i}`;
|
|
3074
3077
|
}
|
|
3075
|
-
function
|
|
3078
|
+
function Mr(t, r) {
|
|
3076
3079
|
const o = /* @__PURE__ */ new Map();
|
|
3077
3080
|
for (const s of t) {
|
|
3078
|
-
const a =
|
|
3081
|
+
const a = kr(s.startDate), i = o.get(a) ?? [];
|
|
3079
3082
|
i.push(s), o.set(a, i);
|
|
3080
3083
|
}
|
|
3081
3084
|
return Array.from(o.entries()).map(([s, a]) => {
|
|
3082
3085
|
const i = [...a].sort(
|
|
3083
|
-
(
|
|
3084
|
-
),
|
|
3086
|
+
(f, c) => f.startDate.getTime() - c.startDate.getTime()
|
|
3087
|
+
), g = r > 0 ? i.slice(0, r) : i;
|
|
3085
3088
|
return {
|
|
3086
3089
|
date: new Date(s),
|
|
3087
3090
|
dateKey: s,
|
|
3088
|
-
events:
|
|
3091
|
+
events: g,
|
|
3089
3092
|
hasMore: r > 0 && i.length > r
|
|
3090
3093
|
};
|
|
3091
3094
|
}).sort((s, a) => s.date.getTime() - a.date.getTime());
|
|
3092
3095
|
}
|
|
3093
|
-
function
|
|
3094
|
-
const r =
|
|
3096
|
+
function Sr(t) {
|
|
3097
|
+
const r = xe(/* @__PURE__ */ new Date()), o = Ve(/* @__PURE__ */ new Date());
|
|
3095
3098
|
return t.filter((s) => s.startDate >= r && s.startDate <= o).length;
|
|
3096
3099
|
}
|
|
3097
|
-
function
|
|
3098
|
-
return /* @__PURE__ */ e("div", { className:
|
|
3100
|
+
function ke({ className: t }) {
|
|
3101
|
+
return /* @__PURE__ */ e("div", { className: h("animate-pulse rounded-md bg-muted", t) });
|
|
3099
3102
|
}
|
|
3100
|
-
function
|
|
3103
|
+
function Er({ event: t, onClick: r }) {
|
|
3101
3104
|
return /* @__PURE__ */ n(
|
|
3102
3105
|
"button",
|
|
3103
3106
|
{
|
|
3104
3107
|
type: "button",
|
|
3105
3108
|
onClick: () => r?.(t),
|
|
3106
|
-
className:
|
|
3109
|
+
className: h(
|
|
3107
3110
|
"w-full text-left rounded-lg transition-colors",
|
|
3108
3111
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3109
3112
|
"flex items-start gap-3 p-2"
|
|
@@ -3118,62 +3121,62 @@ function Sr({ event: t, onClick: r }) {
|
|
|
3118
3121
|
),
|
|
3119
3122
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
3120
3123
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium truncate", children: t.title }),
|
|
3121
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children:
|
|
3124
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children: Nr(t) })
|
|
3122
3125
|
] }),
|
|
3123
|
-
r && /* @__PURE__ */ e(
|
|
3126
|
+
r && /* @__PURE__ */ e(br, { className: "shrink-0 size-4 text-muted-foreground/50 mt-1" })
|
|
3124
3127
|
]
|
|
3125
3128
|
}
|
|
3126
3129
|
);
|
|
3127
3130
|
}
|
|
3128
|
-
function
|
|
3131
|
+
function zr({ group: t, onEventClick: r }) {
|
|
3129
3132
|
return /* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
3130
3133
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between px-2 py-1.5", children: [
|
|
3131
|
-
/* @__PURE__ */ e("h3", { className:
|
|
3134
|
+
/* @__PURE__ */ e("h3", { className: h("text-xs font-semibold", q(t.date) && "text-primary"), children: Dr(t.date) }),
|
|
3132
3135
|
t.hasMore && /* @__PURE__ */ n("span", { className: "text-[10px] text-muted-foreground", children: [
|
|
3133
3136
|
"+",
|
|
3134
3137
|
t.events.length,
|
|
3135
3138
|
" more"
|
|
3136
3139
|
] })
|
|
3137
3140
|
] }),
|
|
3138
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((o) => /* @__PURE__ */ e(
|
|
3141
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((o) => /* @__PURE__ */ e(Er, { event: o, onClick: r }, o.id)) })
|
|
3139
3142
|
] });
|
|
3140
3143
|
}
|
|
3141
|
-
function
|
|
3144
|
+
function rn({
|
|
3142
3145
|
events: t,
|
|
3143
3146
|
isLoading: r = !1,
|
|
3144
3147
|
className: o,
|
|
3145
3148
|
daysAhead: s = 7,
|
|
3146
3149
|
maxEventsPerDay: a = 3,
|
|
3147
3150
|
onEventClick: i,
|
|
3148
|
-
onNavigateToAgenda:
|
|
3151
|
+
onNavigateToAgenda: g
|
|
3149
3152
|
}) {
|
|
3150
|
-
const [
|
|
3151
|
-
const
|
|
3152
|
-
return t.filter((
|
|
3153
|
-
}, [t, s]),
|
|
3154
|
-
() =>
|
|
3155
|
-
[
|
|
3156
|
-
),
|
|
3157
|
-
c(!1), i?.(
|
|
3158
|
-
},
|
|
3159
|
-
c(!1),
|
|
3153
|
+
const [f, c] = se(!1), x = B(() => {
|
|
3154
|
+
const z = xe(/* @__PURE__ */ new Date()), C = Ue(z, s);
|
|
3155
|
+
return t.filter((S) => S.endDate >= z && S.startDate < C);
|
|
3156
|
+
}, [t, s]), y = B(
|
|
3157
|
+
() => Mr(x, a),
|
|
3158
|
+
[x, a]
|
|
3159
|
+
), p = B(() => Sr(t), [t]), M = (z) => {
|
|
3160
|
+
c(!1), i?.(z);
|
|
3161
|
+
}, A = () => {
|
|
3162
|
+
c(!1), g?.();
|
|
3160
3163
|
};
|
|
3161
|
-
return /* @__PURE__ */ n(_e, { open:
|
|
3164
|
+
return /* @__PURE__ */ n(_e, { open: f, onOpenChange: c, children: [
|
|
3162
3165
|
/* @__PURE__ */ n(
|
|
3163
3166
|
Pe,
|
|
3164
3167
|
{
|
|
3165
|
-
className:
|
|
3168
|
+
className: h(
|
|
3166
3169
|
"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",
|
|
3167
3170
|
o
|
|
3168
3171
|
),
|
|
3169
3172
|
children: [
|
|
3170
|
-
/* @__PURE__ */ e(
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
+
/* @__PURE__ */ e(vr, { className: "h-4 w-4" }),
|
|
3174
|
+
p > 0 && /* @__PURE__ */ e(
|
|
3175
|
+
ct,
|
|
3173
3176
|
{
|
|
3174
3177
|
variant: "destructive",
|
|
3175
3178
|
className: "absolute -right-4 -top-4 m-3 flex h-5 w-5 items-center justify-center rounded-full bg-primary p-0 text-[10px] font-medium hover:bg-primary",
|
|
3176
|
-
children:
|
|
3179
|
+
children: p > 99 ? "99+" : p
|
|
3177
3180
|
}
|
|
3178
3181
|
)
|
|
3179
3182
|
]
|
|
@@ -3183,47 +3186,47 @@ function tn({
|
|
|
3183
3186
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between border-b p-4", children: [
|
|
3184
3187
|
/* @__PURE__ */ n("div", { children: [
|
|
3185
3188
|
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Upcoming" }),
|
|
3186
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children:
|
|
3189
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: p > 0 ? `${p} event${p > 1 ? "s" : ""} today` : "No events today" })
|
|
3187
3190
|
] }),
|
|
3188
|
-
|
|
3191
|
+
g && /* @__PURE__ */ n(
|
|
3189
3192
|
"button",
|
|
3190
3193
|
{
|
|
3191
3194
|
type: "button",
|
|
3192
|
-
onClick:
|
|
3195
|
+
onClick: A,
|
|
3193
3196
|
className: "text-xs text-primary hover:underline flex items-center gap-1",
|
|
3194
3197
|
children: [
|
|
3195
3198
|
"View all",
|
|
3196
|
-
/* @__PURE__ */ e(
|
|
3199
|
+
/* @__PURE__ */ e(yr, { className: "size-3" })
|
|
3197
3200
|
]
|
|
3198
3201
|
}
|
|
3199
3202
|
)
|
|
3200
3203
|
] }),
|
|
3201
|
-
/* @__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((
|
|
3202
|
-
/* @__PURE__ */ e(
|
|
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, C) => /* @__PURE__ */ n("div", { className: "flex space-x-3", children: [
|
|
3205
|
+
/* @__PURE__ */ e(ke, { className: "h-2 w-2 rounded-full mt-2" }),
|
|
3203
3206
|
/* @__PURE__ */ n("div", { className: "flex-1 space-y-2", children: [
|
|
3204
|
-
/* @__PURE__ */ e(
|
|
3205
|
-
/* @__PURE__ */ e(
|
|
3207
|
+
/* @__PURE__ */ e(ke, { className: "h-4 w-full" }),
|
|
3208
|
+
/* @__PURE__ */ e(ke, { className: "h-3 w-3/4" })
|
|
3206
3209
|
] })
|
|
3207
|
-
] },
|
|
3208
|
-
/* @__PURE__ */ e(
|
|
3210
|
+
] }, C)) }) : y.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
|
|
3211
|
+
/* @__PURE__ */ e(wr, { className: "mb-2 h-8 w-8 text-muted-foreground/50" }),
|
|
3209
3212
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No upcoming events" }),
|
|
3210
3213
|
/* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground/70", children: [
|
|
3211
3214
|
"Your schedule is clear for the next ",
|
|
3212
3215
|
s,
|
|
3213
3216
|
" days"
|
|
3214
3217
|
] })
|
|
3215
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children:
|
|
3216
|
-
|
|
3218
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children: y.map((z) => /* @__PURE__ */ e(
|
|
3219
|
+
zr,
|
|
3217
3220
|
{
|
|
3218
|
-
group:
|
|
3219
|
-
onEventClick:
|
|
3221
|
+
group: z,
|
|
3222
|
+
onEventClick: M
|
|
3220
3223
|
},
|
|
3221
|
-
|
|
3224
|
+
z.dateKey
|
|
3222
3225
|
)) }) })
|
|
3223
3226
|
] })
|
|
3224
3227
|
] });
|
|
3225
3228
|
}
|
|
3226
|
-
function
|
|
3229
|
+
function Lr({ className: t }) {
|
|
3227
3230
|
return /* @__PURE__ */ n(
|
|
3228
3231
|
"svg",
|
|
3229
3232
|
{
|
|
@@ -3266,7 +3269,7 @@ function Ge({ className: t }) {
|
|
|
3266
3269
|
}
|
|
3267
3270
|
);
|
|
3268
3271
|
}
|
|
3269
|
-
function
|
|
3272
|
+
function Hr(t) {
|
|
3270
3273
|
const r = /* @__PURE__ */ new Date();
|
|
3271
3274
|
return r.setDate(r.getDate() + 1), t.getFullYear() === r.getFullYear() && t.getMonth() === r.getMonth() && t.getDate() === r.getDate();
|
|
3272
3275
|
}
|
|
@@ -3274,45 +3277,45 @@ function $e(t) {
|
|
|
3274
3277
|
const r = t.getHours(), o = t.getMinutes(), s = r >= 12 ? "PM" : "AM";
|
|
3275
3278
|
return `${r % 12 || 12}:${o.toString().padStart(2, "0")} ${s}`;
|
|
3276
3279
|
}
|
|
3277
|
-
function
|
|
3280
|
+
function Tr(t) {
|
|
3278
3281
|
return new Intl.DateTimeFormat("en-US", {
|
|
3279
3282
|
weekday: "long",
|
|
3280
3283
|
month: "short",
|
|
3281
3284
|
day: "numeric"
|
|
3282
3285
|
}).format(t);
|
|
3283
3286
|
}
|
|
3284
|
-
function
|
|
3287
|
+
function Ir(t) {
|
|
3285
3288
|
const r = $e(t.startDate), o = $e(t.endDate);
|
|
3286
3289
|
return `${r} - ${o}`;
|
|
3287
3290
|
}
|
|
3288
|
-
function
|
|
3289
|
-
return q(t) ? "Today" :
|
|
3291
|
+
function jr(t) {
|
|
3292
|
+
return q(t) ? "Today" : Hr(t) ? "Tomorrow" : Tr(t);
|
|
3290
3293
|
}
|
|
3291
|
-
function
|
|
3294
|
+
function Wr(t, r) {
|
|
3292
3295
|
const o = /* @__PURE__ */ new Map();
|
|
3293
3296
|
for (const s of t) {
|
|
3294
|
-
const a =
|
|
3297
|
+
const a = gt(s.startDate), i = o.get(a) ?? [];
|
|
3295
3298
|
i.push(s), o.set(a, i);
|
|
3296
3299
|
}
|
|
3297
3300
|
return Array.from(o.entries()).map(([s, a]) => {
|
|
3298
3301
|
const i = [...a].sort(
|
|
3299
|
-
(
|
|
3300
|
-
),
|
|
3302
|
+
(f, c) => f.startDate.getTime() - c.startDate.getTime()
|
|
3303
|
+
), g = r > 0 ? i.slice(0, r) : i;
|
|
3301
3304
|
return {
|
|
3302
3305
|
date: new Date(s),
|
|
3303
3306
|
dateKey: s,
|
|
3304
|
-
events:
|
|
3307
|
+
events: g,
|
|
3305
3308
|
hasMore: r > 0 && i.length > r
|
|
3306
3309
|
};
|
|
3307
3310
|
}).sort((s, a) => s.date.getTime() - a.date.getTime());
|
|
3308
3311
|
}
|
|
3309
|
-
function
|
|
3312
|
+
function Ar({ event: t, onClick: r, compact: o }) {
|
|
3310
3313
|
return /* @__PURE__ */ n(
|
|
3311
3314
|
"button",
|
|
3312
3315
|
{
|
|
3313
3316
|
type: "button",
|
|
3314
3317
|
onClick: () => r?.(t),
|
|
3315
|
-
className:
|
|
3318
|
+
className: h(
|
|
3316
3319
|
"w-full text-left rounded-lg transition-colors",
|
|
3317
3320
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3318
3321
|
"flex items-start gap-3",
|
|
@@ -3322,41 +3325,41 @@ function Wr({ event: t, onClick: r, compact: o }) {
|
|
|
3322
3325
|
/* @__PURE__ */ e(
|
|
3323
3326
|
"div",
|
|
3324
3327
|
{
|
|
3325
|
-
className:
|
|
3328
|
+
className: h("shrink-0 rounded-full mt-1", o ? "size-2" : "size-2.5"),
|
|
3326
3329
|
style: { backgroundColor: t.color ?? "#3b82f6" }
|
|
3327
3330
|
}
|
|
3328
3331
|
),
|
|
3329
3332
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
3330
|
-
/* @__PURE__ */ e("p", { className:
|
|
3331
|
-
/* @__PURE__ */ e("p", { className:
|
|
3333
|
+
/* @__PURE__ */ e("p", { className: h("font-medium truncate", o ? "text-xs" : "text-sm"), children: t.title }),
|
|
3334
|
+
/* @__PURE__ */ e("p", { className: h("text-muted-foreground truncate", o ? "text-[10px]" : "text-xs"), children: Ir(t) })
|
|
3332
3335
|
] }),
|
|
3333
3336
|
r && /* @__PURE__ */ e(
|
|
3334
3337
|
Ge,
|
|
3335
3338
|
{
|
|
3336
|
-
className:
|
|
3339
|
+
className: h("shrink-0 text-muted-foreground/50", o ? "size-3" : "size-4")
|
|
3337
3340
|
}
|
|
3338
3341
|
)
|
|
3339
3342
|
]
|
|
3340
3343
|
}
|
|
3341
3344
|
);
|
|
3342
3345
|
}
|
|
3343
|
-
function
|
|
3346
|
+
function Fr({
|
|
3344
3347
|
group: t,
|
|
3345
3348
|
onEventClick: r,
|
|
3346
3349
|
onViewMore: o,
|
|
3347
3350
|
compact: s
|
|
3348
3351
|
}) {
|
|
3349
3352
|
return /* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
3350
|
-
/* @__PURE__ */ n("div", { className:
|
|
3353
|
+
/* @__PURE__ */ n("div", { className: h("flex items-center justify-between px-2", s ? "py-1" : "py-1.5"), children: [
|
|
3351
3354
|
/* @__PURE__ */ e(
|
|
3352
3355
|
"h3",
|
|
3353
3356
|
{
|
|
3354
|
-
className:
|
|
3357
|
+
className: h(
|
|
3355
3358
|
"font-semibold",
|
|
3356
3359
|
s ? "text-xs" : "text-sm",
|
|
3357
3360
|
q(t.date) && "text-primary"
|
|
3358
3361
|
),
|
|
3359
|
-
children:
|
|
3362
|
+
children: jr(t.date)
|
|
3360
3363
|
}
|
|
3361
3364
|
),
|
|
3362
3365
|
t.hasMore && o && /* @__PURE__ */ e(
|
|
@@ -3364,81 +3367,81 @@ function Ar({
|
|
|
3364
3367
|
{
|
|
3365
3368
|
type: "button",
|
|
3366
3369
|
onClick: () => o(t.date),
|
|
3367
|
-
className:
|
|
3370
|
+
className: h("text-primary hover:underline", s ? "text-[10px]" : "text-xs"),
|
|
3368
3371
|
children: "+more"
|
|
3369
3372
|
}
|
|
3370
3373
|
)
|
|
3371
3374
|
] }),
|
|
3372
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((a) => /* @__PURE__ */ e(
|
|
3375
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((a) => /* @__PURE__ */ e(Ar, { event: a, onClick: r, compact: s }, a.id)) })
|
|
3373
3376
|
] });
|
|
3374
3377
|
}
|
|
3375
|
-
function
|
|
3378
|
+
function nn({
|
|
3376
3379
|
events: t,
|
|
3377
3380
|
daysAhead: r = 7,
|
|
3378
3381
|
maxEventsPerDay: o = 3,
|
|
3379
3382
|
onEventClick: s,
|
|
3380
3383
|
onViewAll: a,
|
|
3381
3384
|
className: i,
|
|
3382
|
-
emptyState:
|
|
3383
|
-
title:
|
|
3385
|
+
emptyState: g,
|
|
3386
|
+
title: f = "Upcoming",
|
|
3384
3387
|
showHeader: c = !0,
|
|
3385
|
-
compact:
|
|
3388
|
+
compact: x = !1
|
|
3386
3389
|
}) {
|
|
3387
|
-
const
|
|
3388
|
-
const
|
|
3389
|
-
return
|
|
3390
|
-
}, [
|
|
3391
|
-
() =>
|
|
3392
|
-
[
|
|
3393
|
-
),
|
|
3394
|
-
return
|
|
3390
|
+
const y = Oe(), p = y?.filteredEvents, M = y?.currentDate ?? /* @__PURE__ */ new Date(), A = t ?? p ?? [], z = B(() => {
|
|
3391
|
+
const L = xe(M), w = new Date(L);
|
|
3392
|
+
return w.setDate(w.getDate() + r), A.filter((T) => T.endDate >= L && T.startDate < w);
|
|
3393
|
+
}, [A, r, M]), C = B(
|
|
3394
|
+
() => Wr(z, o),
|
|
3395
|
+
[z, o]
|
|
3396
|
+
), S = z.length;
|
|
3397
|
+
return C.length === 0 ? /* @__PURE__ */ n("div", { className: h("rounded-lg border bg-card", i), children: [
|
|
3395
3398
|
c && /* @__PURE__ */ e(
|
|
3396
3399
|
"div",
|
|
3397
3400
|
{
|
|
3398
|
-
className:
|
|
3401
|
+
className: h(
|
|
3399
3402
|
"border-b px-4 flex items-center justify-between",
|
|
3400
|
-
|
|
3403
|
+
x ? "py-2" : "py-3"
|
|
3401
3404
|
),
|
|
3402
|
-
children: /* @__PURE__ */ e("h2", { className:
|
|
3405
|
+
children: /* @__PURE__ */ e("h2", { className: h("font-semibold", x ? "text-sm" : "text-base"), children: f })
|
|
3403
3406
|
}
|
|
3404
3407
|
),
|
|
3405
3408
|
/* @__PURE__ */ e(
|
|
3406
3409
|
"div",
|
|
3407
3410
|
{
|
|
3408
|
-
className:
|
|
3411
|
+
className: h(
|
|
3409
3412
|
"flex flex-col items-center justify-center text-center",
|
|
3410
|
-
|
|
3413
|
+
x ? "py-6 px-4" : "py-10 px-6"
|
|
3411
3414
|
),
|
|
3412
|
-
children:
|
|
3415
|
+
children: g ?? /* @__PURE__ */ n(ne, { children: [
|
|
3413
3416
|
/* @__PURE__ */ e(
|
|
3414
|
-
|
|
3417
|
+
Lr,
|
|
3415
3418
|
{
|
|
3416
|
-
className:
|
|
3419
|
+
className: h("text-muted-foreground/50 mb-2", x ? "size-8" : "size-10")
|
|
3417
3420
|
}
|
|
3418
3421
|
),
|
|
3419
|
-
/* @__PURE__ */ e("p", { className:
|
|
3422
|
+
/* @__PURE__ */ e("p", { className: h("text-muted-foreground", x ? "text-xs" : "text-sm"), children: "No upcoming events" })
|
|
3420
3423
|
] })
|
|
3421
3424
|
}
|
|
3422
3425
|
)
|
|
3423
|
-
] }) : /* @__PURE__ */ n("div", { className:
|
|
3426
|
+
] }) : /* @__PURE__ */ n("div", { className: h("rounded-lg border bg-card overflow-hidden", i), children: [
|
|
3424
3427
|
c && /* @__PURE__ */ n(
|
|
3425
3428
|
"div",
|
|
3426
3429
|
{
|
|
3427
|
-
className:
|
|
3430
|
+
className: h(
|
|
3428
3431
|
"border-b px-4 flex items-center justify-between",
|
|
3429
|
-
|
|
3432
|
+
x ? "py-2" : "py-3"
|
|
3430
3433
|
),
|
|
3431
3434
|
children: [
|
|
3432
3435
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
3433
|
-
/* @__PURE__ */ e("h2", { className:
|
|
3436
|
+
/* @__PURE__ */ e("h2", { className: h("font-semibold", x ? "text-sm" : "text-base"), children: f }),
|
|
3434
3437
|
/* @__PURE__ */ e(
|
|
3435
3438
|
"span",
|
|
3436
3439
|
{
|
|
3437
|
-
className:
|
|
3440
|
+
className: h(
|
|
3438
3441
|
"text-muted-foreground bg-muted rounded-full px-2",
|
|
3439
|
-
|
|
3442
|
+
x ? "text-[10px] py-0" : "text-xs py-0.5"
|
|
3440
3443
|
),
|
|
3441
|
-
children:
|
|
3444
|
+
children: S
|
|
3442
3445
|
}
|
|
3443
3446
|
)
|
|
3444
3447
|
] }),
|
|
@@ -3447,9 +3450,9 @@ function rn({
|
|
|
3447
3450
|
{
|
|
3448
3451
|
type: "button",
|
|
3449
3452
|
onClick: () => a(),
|
|
3450
|
-
className:
|
|
3453
|
+
className: h(
|
|
3451
3454
|
"text-primary hover:underline flex items-center gap-0.5",
|
|
3452
|
-
|
|
3455
|
+
x ? "text-xs" : "text-sm"
|
|
3453
3456
|
),
|
|
3454
3457
|
children: [
|
|
3455
3458
|
"View all",
|
|
@@ -3463,39 +3466,39 @@ function rn({
|
|
|
3463
3466
|
/* @__PURE__ */ e(
|
|
3464
3467
|
"div",
|
|
3465
3468
|
{
|
|
3466
|
-
className:
|
|
3469
|
+
className: h(
|
|
3467
3470
|
"divide-y overflow-auto",
|
|
3468
|
-
|
|
3471
|
+
x ? "p-2 max-h-[280px]" : "p-3 max-h-[400px]"
|
|
3469
3472
|
),
|
|
3470
|
-
children:
|
|
3471
|
-
|
|
3473
|
+
children: C.map((L) => /* @__PURE__ */ e(
|
|
3474
|
+
Fr,
|
|
3472
3475
|
{
|
|
3473
|
-
group:
|
|
3476
|
+
group: L,
|
|
3474
3477
|
onEventClick: s,
|
|
3475
|
-
onViewMore: a ? (
|
|
3476
|
-
compact:
|
|
3478
|
+
onViewMore: a ? (w) => a(w) : void 0,
|
|
3479
|
+
compact: x
|
|
3477
3480
|
},
|
|
3478
|
-
|
|
3481
|
+
L.dateKey
|
|
3479
3482
|
))
|
|
3480
3483
|
}
|
|
3481
3484
|
)
|
|
3482
3485
|
] });
|
|
3483
3486
|
}
|
|
3484
3487
|
export {
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3488
|
+
rn as A,
|
|
3489
|
+
qr as B,
|
|
3490
|
+
Ur as C,
|
|
3491
|
+
Qr as D,
|
|
3492
|
+
Yr as E,
|
|
3493
|
+
Gr as I,
|
|
3494
|
+
en as S,
|
|
3495
|
+
we as T,
|
|
3496
|
+
tn as U,
|
|
3497
|
+
Jr as V,
|
|
3498
|
+
Xr as W,
|
|
3499
|
+
Gt as Y,
|
|
3500
|
+
nn as a,
|
|
3501
|
+
Zr as b,
|
|
3502
|
+
Kr as c
|
|
3500
3503
|
};
|
|
3501
|
-
//# sourceMappingURL=agenda-widget-
|
|
3504
|
+
//# sourceMappingURL=agenda-widget-C5uR9Raa.js.map
|