@innosolutions/inno-calendar 1.0.31 → 1.0.33
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-D-tiHHd7.js → agenda-widget-BXcLo1aO.js} +829 -806
- package/dist/agenda-widget-BXcLo1aO.js.map +1 -0
- package/dist/agenda-widget-tZZgBGnS.cjs +2 -0
- package/dist/agenda-widget-tZZgBGnS.cjs.map +1 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/components/inno-calendar.d.ts.map +1 -1
- package/dist/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/styles/index.css +1 -1
- package/dist/{tailwind-calendar-DOUuHppf.cjs → tailwind-calendar-BPGaoVW6.cjs} +2 -2
- package/dist/{tailwind-calendar-DOUuHppf.cjs.map → tailwind-calendar-BPGaoVW6.cjs.map} +1 -1
- package/dist/{tailwind-calendar-D_Tlo3dX.js → tailwind-calendar-D5PKQOjl.js} +2 -2
- package/dist/{tailwind-calendar-D_Tlo3dX.js.map → tailwind-calendar-D5PKQOjl.js.map} +1 -1
- package/dist/{week-view-BSLUyXtw.js → week-view-CJeYvlpO.js} +70 -70
- package/dist/week-view-CJeYvlpO.js.map +1 -0
- package/dist/{week-view-DR2ICq3r.cjs → week-view-DRGXG9E_.cjs} +2 -2
- package/dist/week-view-DRGXG9E_.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/agenda-widget-CvLjBqzQ.cjs +0 -2
- package/dist/agenda-widget-CvLjBqzQ.cjs.map +0 -1
- package/dist/agenda-widget-D-tiHHd7.js.map +0 -1
- package/dist/week-view-BSLUyXtw.js.map +0 -1
- package/dist/week-view-DR2ICq3r.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as n, Fragment as
|
|
2
|
-
import { o as
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { c as
|
|
5
|
-
import { P as
|
|
6
|
-
import { D as
|
|
7
|
-
import { isToday as
|
|
8
|
-
function
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as ie } from "react/jsx-runtime";
|
|
2
|
+
import { o as Pe, c as Ze, C as qe, I as et, j as tt } from "./use-calendar-QYGDcRjd.js";
|
|
3
|
+
import { useCallback as ae, useState as q, useEffect as ge, forwardRef as Ce, useRef as Oe, useMemo as $ } from "react";
|
|
4
|
+
import { c as h } from "./index-DtaLkIY8.js";
|
|
5
|
+
import { P as Re, h as Ve, g as Ue, l as ee, p as rt, q as nt, B as ce, r as st, s as De, j as te, m as re, k as ne, c as ot, C as it, M as Me, A as at, W as lt, b as ct, t as dt } from "./week-view-CJeYvlpO.js";
|
|
6
|
+
import { D as ut, S as ht } from "./slot-selection-context-D2eu2o-7.js";
|
|
7
|
+
import { isToday as le, startOfDay as xe, endOfDay as Ye, getYearMonths as mt, generateMonthGrid as ft, getEventsForDay as gt, addDays as Ge, formatDateISO as xt } from "./utils.mjs";
|
|
8
|
+
function pt({ view: t, className: r = "" }) {
|
|
9
9
|
return /* @__PURE__ */ e(
|
|
10
10
|
"div",
|
|
11
11
|
{
|
|
@@ -29,16 +29,16 @@ function mt({ view: t, className: r = "" }) {
|
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return /* @__PURE__ */ e(
|
|
32
|
+
function Ee({ view: t, className: r }) {
|
|
33
|
+
return /* @__PURE__ */ e(pt, { view: t, className: r });
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Ur(t) {
|
|
36
36
|
const {
|
|
37
37
|
events: r,
|
|
38
38
|
resources: s,
|
|
39
39
|
scheduleTypes: o,
|
|
40
|
-
initialView:
|
|
41
|
-
initialDate:
|
|
40
|
+
initialView: i = "week",
|
|
41
|
+
initialDate: a,
|
|
42
42
|
initialFilters: g,
|
|
43
43
|
preferences: f,
|
|
44
44
|
locale: c,
|
|
@@ -46,32 +46,32 @@ function Pr(t) {
|
|
|
46
46
|
renderEvent: w,
|
|
47
47
|
onViewChange: k,
|
|
48
48
|
onDateChange: M,
|
|
49
|
-
onEventClick:
|
|
50
|
-
onSlotSelect:
|
|
49
|
+
onEventClick: z,
|
|
50
|
+
onSlotSelect: E,
|
|
51
51
|
onFiltersChange: p,
|
|
52
52
|
className: y,
|
|
53
53
|
children: b
|
|
54
|
-
} = t, N =
|
|
54
|
+
} = t, N = Pe();
|
|
55
55
|
if (N)
|
|
56
|
-
return /* @__PURE__ */ e("div", { className: y, style: { position: "relative" }, children: b ?? /* @__PURE__ */ e(
|
|
57
|
-
const S =
|
|
56
|
+
return /* @__PURE__ */ e("div", { className: y, style: { position: "relative" }, children: b ?? /* @__PURE__ */ e(Ee, { view: N.view, className: y }) });
|
|
57
|
+
const S = Ze({
|
|
58
58
|
events: r,
|
|
59
59
|
resources: s,
|
|
60
60
|
scheduleTypes: o,
|
|
61
|
-
initialView:
|
|
62
|
-
initialDate:
|
|
61
|
+
initialView: i,
|
|
62
|
+
initialDate: a,
|
|
63
63
|
initialFilters: g,
|
|
64
64
|
preferences: f,
|
|
65
65
|
locale: c,
|
|
66
66
|
onViewChange: k,
|
|
67
67
|
onDateChange: M,
|
|
68
|
-
onEventClick:
|
|
69
|
-
onSlotSelect:
|
|
68
|
+
onEventClick: z,
|
|
69
|
+
onSlotSelect: E,
|
|
70
70
|
onFiltersChange: p
|
|
71
71
|
});
|
|
72
|
-
return /* @__PURE__ */ e(
|
|
72
|
+
return /* @__PURE__ */ e(qe, { value: S, children: /* @__PURE__ */ e("div", { className: y, style: { position: "relative" }, children: b ?? /* @__PURE__ */ e(Ee, { view: S.view, className: y }) }) });
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function vt({ className: t }) {
|
|
75
75
|
return /* @__PURE__ */ n(
|
|
76
76
|
"svg",
|
|
77
77
|
{
|
|
@@ -90,7 +90,7 @@ function ft({ className: t }) {
|
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function Ke({ className: t }) {
|
|
94
94
|
return /* @__PURE__ */ n(
|
|
95
95
|
"svg",
|
|
96
96
|
{
|
|
@@ -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 he({ className: t }) {
|
|
|
131
131
|
}
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function wt({ className: t }) {
|
|
135
135
|
return /* @__PURE__ */ n(
|
|
136
136
|
"svg",
|
|
137
137
|
{
|
|
@@ -150,7 +150,7 @@ function gt({ className: t }) {
|
|
|
150
150
|
}
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function he({ className: t }) {
|
|
154
154
|
return /* @__PURE__ */ e(
|
|
155
155
|
"svg",
|
|
156
156
|
{
|
|
@@ -166,7 +166,7 @@ function de({ className: t }) {
|
|
|
166
166
|
}
|
|
167
167
|
);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function bt({ className: t }) {
|
|
170
170
|
return /* @__PURE__ */ n(
|
|
171
171
|
"svg",
|
|
172
172
|
{
|
|
@@ -185,7 +185,7 @@ function xt({ className: t }) {
|
|
|
185
185
|
}
|
|
186
186
|
);
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function yt({ className: t }) {
|
|
189
189
|
return /* @__PURE__ */ e(
|
|
190
190
|
"svg",
|
|
191
191
|
{
|
|
@@ -201,7 +201,7 @@ function pt({ className: t }) {
|
|
|
201
201
|
}
|
|
202
202
|
);
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function kt({ className: t }) {
|
|
205
205
|
return /* @__PURE__ */ n(
|
|
206
206
|
"svg",
|
|
207
207
|
{
|
|
@@ -222,7 +222,7 @@ function vt({ className: t }) {
|
|
|
222
222
|
}
|
|
223
223
|
);
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Nt({ className: t }) {
|
|
226
226
|
return /* @__PURE__ */ n(
|
|
227
227
|
"svg",
|
|
228
228
|
{
|
|
@@ -241,7 +241,7 @@ function wt({ className: t }) {
|
|
|
241
241
|
}
|
|
242
242
|
);
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function Ct({ className: t }) {
|
|
245
245
|
return /* @__PURE__ */ n(
|
|
246
246
|
"svg",
|
|
247
247
|
{
|
|
@@ -262,7 +262,7 @@ function bt({ className: t }) {
|
|
|
262
262
|
}
|
|
263
263
|
);
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function Dt({ className: t }) {
|
|
266
266
|
return /* @__PURE__ */ n(
|
|
267
267
|
"svg",
|
|
268
268
|
{
|
|
@@ -284,7 +284,7 @@ function yt({ className: t }) {
|
|
|
284
284
|
}
|
|
285
285
|
);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function de({ className: t }) {
|
|
288
288
|
return /* @__PURE__ */ e(
|
|
289
289
|
"svg",
|
|
290
290
|
{
|
|
@@ -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 Mt = {
|
|
304
304
|
edit: "Edit",
|
|
305
305
|
delete: "Delete",
|
|
306
306
|
cancel: "Cancel Event",
|
|
@@ -325,32 +325,32 @@ const kt = {
|
|
|
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
|
-
},
|
|
329
|
-
({ onClick: t, label: r, children: s, className: o, variant:
|
|
330
|
-
/* @__PURE__ */ e(
|
|
328
|
+
}, me = Ce(
|
|
329
|
+
({ onClick: t, label: r, children: s, className: o, variant: i = "ghost", ...a }, g) => /* @__PURE__ */ n(te, { children: [
|
|
330
|
+
/* @__PURE__ */ e(re, { asChild: !0, children: /* @__PURE__ */ e(
|
|
331
331
|
"button",
|
|
332
332
|
{
|
|
333
333
|
type: "button",
|
|
334
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
|
-
|
|
339
|
-
|
|
338
|
+
i === "ghost" && "hover:bg-zinc-100 dark:hover:bg-zinc-800 text-zinc-600 dark:text-zinc-400",
|
|
339
|
+
i === "destructive" && "hover:bg-red-50 dark:hover:bg-red-950/30 text-zinc-600 dark:text-zinc-400 hover:text-red-600",
|
|
340
340
|
o
|
|
341
341
|
),
|
|
342
342
|
"aria-label": r,
|
|
343
|
-
...
|
|
343
|
+
...a,
|
|
344
344
|
children: s
|
|
345
345
|
}
|
|
346
346
|
) }),
|
|
347
|
-
/* @__PURE__ */ e(
|
|
347
|
+
/* @__PURE__ */ e(ne, { side: "bottom", className: "text-xs", children: r })
|
|
348
348
|
] })
|
|
349
349
|
);
|
|
350
|
-
|
|
351
|
-
function
|
|
352
|
-
const [
|
|
353
|
-
return /* @__PURE__ */ e("div", { className:
|
|
350
|
+
me.displayName = "IconButton";
|
|
351
|
+
function Et({ src: t, alt: r, initials: s, className: o, isClient: i }) {
|
|
352
|
+
const [a, g] = q(!1);
|
|
353
|
+
return /* @__PURE__ */ e("div", { className: h("relative h-7 w-7 rounded-full overflow-hidden shrink-0", o), children: t && !a ? /* @__PURE__ */ e(
|
|
354
354
|
"img",
|
|
355
355
|
{
|
|
356
356
|
src: t,
|
|
@@ -361,35 +361,35 @@ function Nt({ src: t, alt: r, initials: s, className: o, isClient: a }) {
|
|
|
361
361
|
) : /* @__PURE__ */ e(
|
|
362
362
|
"div",
|
|
363
363
|
{
|
|
364
|
-
className:
|
|
364
|
+
className: h(
|
|
365
365
|
"h-full w-full flex items-center justify-center text-[10px] font-medium",
|
|
366
|
-
|
|
366
|
+
i ? "bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300" : "bg-zinc-200 dark:bg-zinc-700 text-zinc-700 dark:text-zinc-300"
|
|
367
367
|
),
|
|
368
368
|
children: s
|
|
369
369
|
}
|
|
370
370
|
) });
|
|
371
371
|
}
|
|
372
|
-
function
|
|
373
|
-
const o = t.name || "Unknown",
|
|
374
|
-
return /* @__PURE__ */ n("div", { className:
|
|
372
|
+
function Se({ participant: t, isEventCanceled: r = !1, labels: s }) {
|
|
373
|
+
const o = t.name || "Unknown", i = o.split(" ").map((M) => M[0]).join("").toUpperCase().slice(0, 2), a = t.isOrganizer ?? !1, g = t.isConfirmed, f = g === !0, c = g === !1, d = t.isClient ?? !1, w = t.profilePicture || t.avatar, k = r;
|
|
374
|
+
return /* @__PURE__ */ n("div", { className: h("flex items-center gap-3 py-0", k && "opacity-60"), children: [
|
|
375
375
|
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
376
376
|
/* @__PURE__ */ e(
|
|
377
|
-
|
|
377
|
+
Et,
|
|
378
378
|
{
|
|
379
379
|
src: w,
|
|
380
380
|
alt: o,
|
|
381
|
-
initials:
|
|
381
|
+
initials: i,
|
|
382
382
|
isClient: d,
|
|
383
|
-
className:
|
|
383
|
+
className: h(k && "grayscale")
|
|
384
384
|
}
|
|
385
385
|
),
|
|
386
|
-
k || 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(
|
|
386
|
+
k || 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(he, { className: "h-2 w-2 text-green-600 dark:text-green-400 stroke-[3]" }) }) }) : null
|
|
387
387
|
] }),
|
|
388
388
|
/* @__PURE__ */ n("div", { className: "!h-fit min-w-0 gap-0", children: [
|
|
389
389
|
/* @__PURE__ */ e("div", { className: "gap-0", children: /* @__PURE__ */ e(
|
|
390
390
|
"span",
|
|
391
391
|
{
|
|
392
|
-
className:
|
|
392
|
+
className: h(
|
|
393
393
|
"text-sm text-zinc-900 dark:text-zinc-100 truncate",
|
|
394
394
|
k && "line-through text-zinc-500 dark:text-zinc-500"
|
|
395
395
|
),
|
|
@@ -397,18 +397,18 @@ function Me({ participant: t, isEventCanceled: r = !1, labels: s }) {
|
|
|
397
397
|
}
|
|
398
398
|
) }),
|
|
399
399
|
d && /* @__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: s.client }),
|
|
400
|
-
|
|
400
|
+
a && !k && /* @__PURE__ */ e("div", { className: "text-xs text-zinc-500", children: s.organizer })
|
|
401
401
|
] })
|
|
402
402
|
] });
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
return
|
|
404
|
+
function St({ open: t, onOpenChange: r, title: s, children: o }) {
|
|
405
|
+
return ge(() => {
|
|
406
406
|
if (!t) return;
|
|
407
|
-
const
|
|
408
|
-
|
|
407
|
+
const i = (a) => {
|
|
408
|
+
a.key === "Escape" && r(!1);
|
|
409
409
|
};
|
|
410
|
-
return document.addEventListener("keydown",
|
|
411
|
-
}, [t, r]),
|
|
410
|
+
return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
|
|
411
|
+
}, [t, r]), ge(() => (t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
412
412
|
document.body.style.overflow = "";
|
|
413
413
|
}), [t]), t ? /* @__PURE__ */ n("div", { className: "fixed inset-0 z-50", children: [
|
|
414
414
|
/* @__PURE__ */ e(
|
|
@@ -416,8 +416,8 @@ function Ct({ open: t, onOpenChange: r, title: s, children: o }) {
|
|
|
416
416
|
{
|
|
417
417
|
className: "fixed inset-0 bg-black/50 backdrop-blur-sm",
|
|
418
418
|
onClick: () => r(!1),
|
|
419
|
-
onKeyDown: (
|
|
420
|
-
(
|
|
419
|
+
onKeyDown: (i) => {
|
|
420
|
+
(i.key === "Enter" || i.key === " ") && r(!1);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
),
|
|
@@ -427,13 +427,13 @@ function Ct({ open: t, onOpenChange: r, title: s, children: o }) {
|
|
|
427
427
|
] }) })
|
|
428
428
|
] }) : null;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function zt({
|
|
431
431
|
open: t,
|
|
432
432
|
onOpenChange: r,
|
|
433
433
|
title: s,
|
|
434
434
|
description: o,
|
|
435
|
-
cancelLabel:
|
|
436
|
-
confirmLabel:
|
|
435
|
+
cancelLabel: i,
|
|
436
|
+
confirmLabel: a,
|
|
437
437
|
onConfirm: g,
|
|
438
438
|
isLoading: f
|
|
439
439
|
}) {
|
|
@@ -452,24 +452,24 @@ function Dt({
|
|
|
452
452
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children: s }),
|
|
453
453
|
/* @__PURE__ */ e("p", { className: "mt-2 text-sm text-zinc-600 dark:text-zinc-400", children: o }),
|
|
454
454
|
/* @__PURE__ */ n("div", { className: "mt-4 flex justify-end gap-3", children: [
|
|
455
|
-
/* @__PURE__ */ e(
|
|
456
|
-
/* @__PURE__ */ n(
|
|
457
|
-
f && /* @__PURE__ */ e(
|
|
458
|
-
/* @__PURE__ */ e(
|
|
459
|
-
|
|
455
|
+
/* @__PURE__ */ e(ce, { variant: "outline", size: "sm", onClick: () => r(!1), children: i }),
|
|
456
|
+
/* @__PURE__ */ n(ce, { variant: "destructive", size: "sm", onClick: g, disabled: f, children: [
|
|
457
|
+
f && /* @__PURE__ */ e(de, { className: "h-4 w-4 mr-2" }),
|
|
458
|
+
/* @__PURE__ */ e(Ke, { className: "h-4 w-4 mr-2" }),
|
|
459
|
+
a
|
|
460
460
|
] })
|
|
461
461
|
] })
|
|
462
462
|
] }) })
|
|
463
463
|
] }) : null;
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function Lt(t, r) {
|
|
466
466
|
return t.toLocaleDateString(void 0, {
|
|
467
467
|
weekday: "long",
|
|
468
468
|
month: "long",
|
|
469
469
|
day: "numeric"
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function Ht(t, r) {
|
|
473
473
|
const s = {
|
|
474
474
|
hour: "2-digit",
|
|
475
475
|
minute: "2-digit",
|
|
@@ -477,7 +477,7 @@ function Et(t, r) {
|
|
|
477
477
|
};
|
|
478
478
|
return `${t.toLocaleTimeString(void 0, s)} – ${r.toLocaleTimeString(void 0, s)}`;
|
|
479
479
|
}
|
|
480
|
-
function
|
|
480
|
+
function Tt(t) {
|
|
481
481
|
return t.toLocaleDateString(void 0, {
|
|
482
482
|
day: "2-digit",
|
|
483
483
|
month: "short",
|
|
@@ -486,21 +486,21 @@ function zt(t) {
|
|
|
486
486
|
minute: "2-digit"
|
|
487
487
|
});
|
|
488
488
|
}
|
|
489
|
-
function
|
|
490
|
-
const [r, s] =
|
|
491
|
-
return
|
|
489
|
+
function jt(t) {
|
|
490
|
+
const [r, s] = q(() => typeof window < "u" ? window.matchMedia(t).matches : !1);
|
|
491
|
+
return ge(() => {
|
|
492
492
|
if (typeof window > "u") return;
|
|
493
|
-
const o = window.matchMedia(t),
|
|
494
|
-
return o.addEventListener("change",
|
|
493
|
+
const o = window.matchMedia(t), i = (a) => s(a.matches);
|
|
494
|
+
return o.addEventListener("change", i), () => o.removeEventListener("change", i);
|
|
495
495
|
}, [t]), r;
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function ze({
|
|
498
498
|
event: t,
|
|
499
499
|
labels: r,
|
|
500
500
|
isLoading: s,
|
|
501
501
|
onClose: o,
|
|
502
|
-
onEdit:
|
|
503
|
-
onDelete:
|
|
502
|
+
onEdit: i,
|
|
503
|
+
onDelete: a,
|
|
504
504
|
onCancel: g,
|
|
505
505
|
onAccept: f,
|
|
506
506
|
onDecline: c,
|
|
@@ -508,43 +508,43 @@ function Ee({
|
|
|
508
508
|
canEdit: w = !0,
|
|
509
509
|
canDelete: k = !1,
|
|
510
510
|
canCancel: M = !0,
|
|
511
|
-
isCurrentUserParticipant:
|
|
512
|
-
isCurrentUserClient:
|
|
511
|
+
isCurrentUserParticipant: z = !1,
|
|
512
|
+
isCurrentUserClient: E = !1,
|
|
513
513
|
currentUserAcceptStatus: p,
|
|
514
514
|
isAcceptLoading: y = !1,
|
|
515
515
|
isDeclineLoading: b = !1,
|
|
516
516
|
isConfirmLoading: N = !1,
|
|
517
517
|
isDeleteLoading: S = !1,
|
|
518
|
-
renderParticipant:
|
|
519
|
-
renderHeaderActions:
|
|
518
|
+
renderParticipant: I,
|
|
519
|
+
renderHeaderActions: Y,
|
|
520
520
|
renderCancelReason: _,
|
|
521
521
|
renderDeleteConfirmation: W,
|
|
522
|
-
formatDate: A =
|
|
523
|
-
formatTimeRange:
|
|
522
|
+
formatDate: A = Lt,
|
|
523
|
+
formatTimeRange: V = Ht
|
|
524
524
|
}) {
|
|
525
|
-
const [
|
|
526
|
-
o(),
|
|
527
|
-
},
|
|
525
|
+
const [L, U] = q(!1), G = !(t.isCanceled || t.meetingTookPlace), x = t.isRecurring ?? !1, l = t.participantDetails, m = t.participantsNames || [], v = l && l.length > 0, C = p === !0, D = p === !1, B = z && !E && G, T = v ? l.filter((j) => j.isConfirmed).length : t.isAccepted ? m.length : 0, P = v ? l.length : m.length, Q = t.scheduleTypeColor || t.hexColor || "#039BE5", J = ae(() => t.startDate ? A(t.startDate) : r.noDateProvided, [t.startDate, A, r.noDateProvided]), u = ae(() => t.startDate && t.endDate ? V(t.startDate, t.endDate) : null, [t.startDate, t.endDate, V]), H = () => {
|
|
526
|
+
o(), i?.(t);
|
|
527
|
+
}, R = () => {
|
|
528
528
|
o(), g?.(t);
|
|
529
|
-
},
|
|
530
|
-
|
|
531
|
-
},
|
|
532
|
-
|
|
529
|
+
}, F = () => {
|
|
530
|
+
U(!0);
|
|
531
|
+
}, K = () => {
|
|
532
|
+
a?.(t), U(!1);
|
|
533
533
|
};
|
|
534
|
-
return s ? /* @__PURE__ */ e("div", { className: "flex h-48 items-center justify-center", children: /* @__PURE__ */ e(
|
|
534
|
+
return s ? /* @__PURE__ */ e("div", { className: "flex h-48 items-center justify-center", children: /* @__PURE__ */ e(de, { className: "h-6 w-6 text-zinc-400" }) }) : /* @__PURE__ */ n(ee, { delayDuration: 300, children: [
|
|
535
535
|
/* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5 p-3", children: [
|
|
536
|
-
/* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children:
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
k &&
|
|
540
|
-
/* @__PURE__ */ e(
|
|
536
|
+
/* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children: Y ? Y({ onClose: o }) : /* @__PURE__ */ n(ie, { children: [
|
|
537
|
+
G && w && i && /* @__PURE__ */ e(me, { onClick: H, label: r.edit, children: /* @__PURE__ */ e(vt, { className: "h-[18px] w-[18px]" }) }),
|
|
538
|
+
G && M && g && /* @__PURE__ */ e(me, { onClick: R, label: r.cancel, children: /* @__PURE__ */ e(wt, { className: "h-[18px] w-[18px]" }) }),
|
|
539
|
+
k && a && /* @__PURE__ */ e(me, { onClick: F, label: r.delete, variant: "destructive", children: /* @__PURE__ */ e(Ke, { className: "h-[18px] w-[18px]" }) }),
|
|
540
|
+
/* @__PURE__ */ e(me, { onClick: o, label: r.close, children: /* @__PURE__ */ e(fe, { className: "h-[18px] w-[18px]" }) })
|
|
541
541
|
] }) }),
|
|
542
542
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
|
|
543
543
|
/* @__PURE__ */ e(
|
|
544
544
|
"div",
|
|
545
545
|
{
|
|
546
546
|
className: "w-4 h-4 rounded mt-1 shrink-0",
|
|
547
|
-
style: { backgroundColor:
|
|
547
|
+
style: { backgroundColor: Q }
|
|
548
548
|
}
|
|
549
549
|
),
|
|
550
550
|
/* @__PURE__ */ n("div", { className: "flex-1 min-w-0", children: [
|
|
@@ -552,7 +552,7 @@ function Ee({
|
|
|
552
552
|
/* @__PURE__ */ e(
|
|
553
553
|
"h2",
|
|
554
554
|
{
|
|
555
|
-
className:
|
|
555
|
+
className: h(
|
|
556
556
|
"text-[22px] font-normal text-zinc-900 dark:text-zinc-100 leading-tight",
|
|
557
557
|
t.isCanceled && "line-through opacity-60"
|
|
558
558
|
),
|
|
@@ -560,19 +560,19 @@ function Ee({
|
|
|
560
560
|
}
|
|
561
561
|
),
|
|
562
562
|
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: [
|
|
563
|
-
/* @__PURE__ */ e(
|
|
563
|
+
/* @__PURE__ */ e(bt, { className: "h-3 w-3" }),
|
|
564
564
|
r.completed
|
|
565
565
|
] }),
|
|
566
566
|
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: [
|
|
567
|
-
/* @__PURE__ */ e(
|
|
567
|
+
/* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
|
|
568
568
|
r.canceled
|
|
569
569
|
] })
|
|
570
570
|
] }),
|
|
571
571
|
/* @__PURE__ */ n("div", { className: "mt-1 text-sm text-zinc-600 dark:text-zinc-400", children: [
|
|
572
|
-
/* @__PURE__ */ e("span", { children:
|
|
573
|
-
|
|
572
|
+
/* @__PURE__ */ e("span", { children: J() }),
|
|
573
|
+
u() && /* @__PURE__ */ n(ie, { children: [
|
|
574
574
|
/* @__PURE__ */ e("span", { className: "mx-1.5", children: "·" }),
|
|
575
|
-
/* @__PURE__ */ e("span", { children:
|
|
575
|
+
/* @__PURE__ */ e("span", { children: u() })
|
|
576
576
|
] })
|
|
577
577
|
] }),
|
|
578
578
|
x && t.recurrenceSummary && /* @__PURE__ */ e("div", { className: "text-sm text-zinc-500 dark:text-zinc-500", children: t.recurrenceSummary })
|
|
@@ -588,26 +588,26 @@ function Ee({
|
|
|
588
588
|
t.canceledDate && /* @__PURE__ */ n("div", { className: "mt-1.5 text-xs text-red-500/70 dark:text-red-400/60", children: [
|
|
589
589
|
r.canceledOn,
|
|
590
590
|
" ",
|
|
591
|
-
|
|
591
|
+
Tt(t.canceledDate)
|
|
592
592
|
] })
|
|
593
593
|
] }) }) }),
|
|
594
594
|
/* @__PURE__ */ n("div", { className: "space-y-0.5", children: [
|
|
595
595
|
t.address && /* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
|
|
596
|
-
/* @__PURE__ */ e(
|
|
596
|
+
/* @__PURE__ */ e(Nt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
597
597
|
/* @__PURE__ */ e("span", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: t.address })
|
|
598
598
|
] }),
|
|
599
|
-
(v ||
|
|
600
|
-
/* @__PURE__ */ e(
|
|
599
|
+
(v || m.length > 0) && /* @__PURE__ */ n("div", { className: "flex items-start gap-2 py-0", children: [
|
|
600
|
+
/* @__PURE__ */ e(kt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
601
601
|
/* @__PURE__ */ n("div", { className: "flex-1", children: [
|
|
602
602
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-0", children: [
|
|
603
603
|
/* @__PURE__ */ n("span", { className: "text-sm text-zinc-900 dark:text-zinc-100 font-medium", children: [
|
|
604
|
-
|
|
604
|
+
P,
|
|
605
605
|
" ",
|
|
606
|
-
|
|
606
|
+
P !== 1 ? r.guests : r.guest
|
|
607
607
|
] }),
|
|
608
|
-
|
|
608
|
+
P > 0 && /* @__PURE__ */ n("span", { className: "text-xs text-zinc-500", children: [
|
|
609
609
|
"(",
|
|
610
|
-
|
|
610
|
+
T,
|
|
611
611
|
" ",
|
|
612
612
|
r.confirmed,
|
|
613
613
|
")"
|
|
@@ -615,37 +615,37 @@ function Ee({
|
|
|
615
615
|
] }),
|
|
616
616
|
/* @__PURE__ */ n("div", { className: "mt-2 space-y-2", children: [
|
|
617
617
|
v ? l.slice(0, 6).map(
|
|
618
|
-
(
|
|
619
|
-
|
|
618
|
+
(j, X) => I ? I(j, X) : /* @__PURE__ */ e(
|
|
619
|
+
Se,
|
|
620
620
|
{
|
|
621
|
-
participant:
|
|
621
|
+
participant: j,
|
|
622
622
|
isEventCanceled: t.isCanceled,
|
|
623
623
|
labels: r
|
|
624
624
|
},
|
|
625
|
-
|
|
625
|
+
j.id
|
|
626
626
|
)
|
|
627
|
-
) :
|
|
628
|
-
const
|
|
629
|
-
id: String(
|
|
630
|
-
name:
|
|
627
|
+
) : m.slice(0, 6).map((j, X) => {
|
|
628
|
+
const O = {
|
|
629
|
+
id: String(X),
|
|
630
|
+
name: j,
|
|
631
631
|
email: "",
|
|
632
632
|
isConfirmed: t.isAccepted,
|
|
633
|
-
isOrganizer:
|
|
633
|
+
isOrganizer: X === 0,
|
|
634
634
|
isClient: !1
|
|
635
635
|
};
|
|
636
|
-
return
|
|
637
|
-
|
|
636
|
+
return I ? I(O, X) : /* @__PURE__ */ e(
|
|
637
|
+
Se,
|
|
638
638
|
{
|
|
639
|
-
participant:
|
|
639
|
+
participant: O,
|
|
640
640
|
isEventCanceled: t.isCanceled,
|
|
641
641
|
labels: r
|
|
642
642
|
},
|
|
643
|
-
|
|
643
|
+
j
|
|
644
644
|
);
|
|
645
645
|
}),
|
|
646
|
-
|
|
646
|
+
P > 6 && /* @__PURE__ */ n("div", { className: "text-xs text-zinc-500 py-1.5 pl-10", children: [
|
|
647
647
|
"+",
|
|
648
|
-
|
|
648
|
+
P - 6,
|
|
649
649
|
" ",
|
|
650
650
|
r.more
|
|
651
651
|
] })
|
|
@@ -653,75 +653,75 @@ function Ee({
|
|
|
653
653
|
] })
|
|
654
654
|
] }),
|
|
655
655
|
t.description && /* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
|
|
656
|
-
/* @__PURE__ */ e(
|
|
656
|
+
/* @__PURE__ */ e(Dt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
657
657
|
/* @__PURE__ */ e("p", { className: "text-sm text-zinc-700 dark:text-zinc-300 whitespace-pre-wrap", children: t.description })
|
|
658
658
|
] }),
|
|
659
659
|
/* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
|
|
660
|
-
/* @__PURE__ */ e(
|
|
661
|
-
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: v && l.find((
|
|
660
|
+
/* @__PURE__ */ e(Ct, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
661
|
+
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: v && l.find((j) => j.isOrganizer)?.name || m[0] || "Calendar" })
|
|
662
662
|
] })
|
|
663
663
|
] }),
|
|
664
|
-
|
|
665
|
-
x ? /* @__PURE__ */ n(
|
|
666
|
-
/* @__PURE__ */ e(
|
|
664
|
+
B && 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: [
|
|
665
|
+
x ? /* @__PURE__ */ n(rt, { children: [
|
|
666
|
+
/* @__PURE__ */ e(nt, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "flex", children: [
|
|
667
667
|
/* @__PURE__ */ e(
|
|
668
|
-
|
|
668
|
+
ce,
|
|
669
669
|
{
|
|
670
670
|
size: "sm",
|
|
671
671
|
variant: "outline",
|
|
672
|
-
className:
|
|
672
|
+
className: h(
|
|
673
673
|
"rounded-r-none gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
674
674
|
C && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
675
675
|
),
|
|
676
|
-
onClick: (
|
|
677
|
-
|
|
676
|
+
onClick: (j) => {
|
|
677
|
+
j.stopPropagation(), C || f(t);
|
|
678
678
|
},
|
|
679
679
|
disabled: y,
|
|
680
|
-
children: y ? /* @__PURE__ */ e(
|
|
681
|
-
C && /* @__PURE__ */ e(
|
|
680
|
+
children: y ? /* @__PURE__ */ e(de, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(ie, { children: [
|
|
681
|
+
C && /* @__PURE__ */ e(he, { className: "h-3.5 w-3.5" }),
|
|
682
682
|
r.going
|
|
683
683
|
] })
|
|
684
684
|
}
|
|
685
685
|
),
|
|
686
686
|
/* @__PURE__ */ e(
|
|
687
|
-
|
|
687
|
+
ce,
|
|
688
688
|
{
|
|
689
689
|
size: "sm",
|
|
690
690
|
variant: "outline",
|
|
691
|
-
className:
|
|
691
|
+
className: h(
|
|
692
692
|
"rounded-l-none px-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
693
693
|
C && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
694
694
|
),
|
|
695
|
-
children: /* @__PURE__ */ e(
|
|
695
|
+
children: /* @__PURE__ */ e(yt, { className: "h-3.5 w-3.5" })
|
|
696
696
|
}
|
|
697
697
|
)
|
|
698
698
|
] }) }),
|
|
699
|
-
/* @__PURE__ */ n(
|
|
699
|
+
/* @__PURE__ */ n(st, { align: "start", children: [
|
|
700
700
|
/* @__PURE__ */ n(
|
|
701
|
-
|
|
701
|
+
De,
|
|
702
702
|
{
|
|
703
|
-
className:
|
|
703
|
+
className: h(
|
|
704
704
|
"gap-1.5 h-8 !border-none !bg-green-50 text-green-800 hover:!bg-green-100",
|
|
705
705
|
C && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
706
706
|
),
|
|
707
707
|
onClick: () => f(t),
|
|
708
708
|
children: [
|
|
709
|
-
/* @__PURE__ */ e(
|
|
709
|
+
/* @__PURE__ */ e(he, { className: "h-3.5 w-3.5 mr-2 text-green-600" }),
|
|
710
710
|
r.acceptThisEvent
|
|
711
711
|
]
|
|
712
712
|
}
|
|
713
713
|
),
|
|
714
|
-
/* @__PURE__ */ n(
|
|
715
|
-
/* @__PURE__ */ e(
|
|
714
|
+
/* @__PURE__ */ n(De, { onClick: () => f(t), children: [
|
|
715
|
+
/* @__PURE__ */ e(he, { className: "h-3.5 w-3.5 mr-2 text-green-600" }),
|
|
716
716
|
r.acceptAllEvents
|
|
717
717
|
] })
|
|
718
718
|
] })
|
|
719
719
|
] }) : /* @__PURE__ */ e(
|
|
720
|
-
|
|
720
|
+
ce,
|
|
721
721
|
{
|
|
722
722
|
size: "sm",
|
|
723
723
|
variant: "outline",
|
|
724
|
-
className:
|
|
724
|
+
className: h(
|
|
725
725
|
"gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
726
726
|
C && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
727
727
|
),
|
|
@@ -729,18 +729,18 @@ function Ee({
|
|
|
729
729
|
C || f(t);
|
|
730
730
|
},
|
|
731
731
|
disabled: y,
|
|
732
|
-
children: y ? /* @__PURE__ */ e(
|
|
733
|
-
C && /* @__PURE__ */ e(
|
|
732
|
+
children: y ? /* @__PURE__ */ e(de, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(ie, { children: [
|
|
733
|
+
C && /* @__PURE__ */ e(he, { className: "h-3.5 w-3.5" }),
|
|
734
734
|
r.going
|
|
735
735
|
] })
|
|
736
736
|
}
|
|
737
737
|
),
|
|
738
738
|
/* @__PURE__ */ e(
|
|
739
|
-
|
|
739
|
+
ce,
|
|
740
740
|
{
|
|
741
741
|
size: "sm",
|
|
742
742
|
variant: "outline",
|
|
743
|
-
className:
|
|
743
|
+
className: h(
|
|
744
744
|
"gap-1.5 h-8 !border-none !bg-rose-100 text-rose-800 hover:!bg-rose-200",
|
|
745
745
|
D && "!bg-rose-700 !text-white hover:!bg-rose-700"
|
|
746
746
|
),
|
|
@@ -748,15 +748,15 @@ function Ee({
|
|
|
748
748
|
D || c(t);
|
|
749
749
|
},
|
|
750
750
|
disabled: b,
|
|
751
|
-
children: b ? /* @__PURE__ */ e(
|
|
752
|
-
D && /* @__PURE__ */ e(
|
|
751
|
+
children: b ? /* @__PURE__ */ e(de, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(ie, { children: [
|
|
752
|
+
D && /* @__PURE__ */ e(fe, { className: "h-3.5 w-3.5" }),
|
|
753
753
|
r.notGoing
|
|
754
754
|
] })
|
|
755
755
|
}
|
|
756
756
|
)
|
|
757
757
|
] }) }),
|
|
758
|
-
|
|
759
|
-
|
|
758
|
+
z && C && !t.meetingTookPlace && !t.isCanceled && d && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 py-3", children: /* @__PURE__ */ n(
|
|
759
|
+
ce,
|
|
760
760
|
{
|
|
761
761
|
size: "sm",
|
|
762
762
|
variant: "outline",
|
|
@@ -764,38 +764,38 @@ function Ee({
|
|
|
764
764
|
onClick: () => d(t),
|
|
765
765
|
disabled: N,
|
|
766
766
|
children: [
|
|
767
|
-
N && /* @__PURE__ */ e(
|
|
767
|
+
N && /* @__PURE__ */ e(de, { className: "h-4 w-4 mr-2" }),
|
|
768
768
|
r.confirmMeeting
|
|
769
769
|
]
|
|
770
770
|
}
|
|
771
771
|
) })
|
|
772
772
|
] }),
|
|
773
|
-
W ?
|
|
774
|
-
onConfirm:
|
|
775
|
-
onCancel: () =>
|
|
773
|
+
W ? L && W({
|
|
774
|
+
onConfirm: K,
|
|
775
|
+
onCancel: () => U(!1),
|
|
776
776
|
isLoading: S
|
|
777
777
|
}) : /* @__PURE__ */ e(
|
|
778
|
-
|
|
778
|
+
zt,
|
|
779
779
|
{
|
|
780
|
-
open:
|
|
781
|
-
onOpenChange:
|
|
780
|
+
open: L,
|
|
781
|
+
onOpenChange: U,
|
|
782
782
|
title: r.deleteConfirmTitle,
|
|
783
783
|
description: r.deleteConfirmDescription,
|
|
784
784
|
cancelLabel: r.cancel,
|
|
785
785
|
confirmLabel: r.delete,
|
|
786
|
-
onConfirm:
|
|
786
|
+
onConfirm: K,
|
|
787
787
|
isLoading: S
|
|
788
788
|
}
|
|
789
789
|
)
|
|
790
790
|
] });
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function Yr({
|
|
793
793
|
event: t,
|
|
794
794
|
children: r,
|
|
795
795
|
open: s,
|
|
796
796
|
onOpenChange: o,
|
|
797
|
-
isLoading:
|
|
798
|
-
labels:
|
|
797
|
+
isLoading: i,
|
|
798
|
+
labels: a,
|
|
799
799
|
onEdit: g,
|
|
800
800
|
onDelete: f,
|
|
801
801
|
onCancel: c,
|
|
@@ -803,30 +803,30 @@ function Or({
|
|
|
803
803
|
onDecline: w,
|
|
804
804
|
onConfirmMeeting: k,
|
|
805
805
|
canEdit: M = !0,
|
|
806
|
-
canDelete:
|
|
807
|
-
canCancel:
|
|
806
|
+
canDelete: z = !1,
|
|
807
|
+
canCancel: E = !0,
|
|
808
808
|
isCurrentUserParticipant: p,
|
|
809
809
|
isCurrentUserClient: y,
|
|
810
810
|
currentUserAcceptStatus: b,
|
|
811
811
|
isAcceptLoading: N,
|
|
812
812
|
isDeclineLoading: S,
|
|
813
|
-
isConfirmLoading:
|
|
814
|
-
isDeleteLoading:
|
|
813
|
+
isConfirmLoading: I,
|
|
814
|
+
isDeleteLoading: Y,
|
|
815
815
|
renderParticipant: _,
|
|
816
816
|
renderHeaderActions: W,
|
|
817
817
|
renderCancelReason: A,
|
|
818
|
-
renderDeleteConfirmation:
|
|
819
|
-
formatDate:
|
|
820
|
-
formatTimeRange:
|
|
821
|
-
className:
|
|
818
|
+
renderDeleteConfirmation: V,
|
|
819
|
+
formatDate: L,
|
|
820
|
+
formatTimeRange: U,
|
|
821
|
+
className: G,
|
|
822
822
|
width: x = 360
|
|
823
823
|
}) {
|
|
824
|
-
const l =
|
|
824
|
+
const l = jt("(min-width: 768px)"), m = { ...Mt, ...a }, v = ae(() => {
|
|
825
825
|
o?.(!1);
|
|
826
826
|
}, [o]), C = {
|
|
827
827
|
event: t,
|
|
828
|
-
labels:
|
|
829
|
-
isLoading:
|
|
828
|
+
labels: m,
|
|
829
|
+
isLoading: i,
|
|
830
830
|
onClose: v,
|
|
831
831
|
onEdit: g,
|
|
832
832
|
onDelete: f,
|
|
@@ -835,112 +835,112 @@ function Or({
|
|
|
835
835
|
onDecline: w,
|
|
836
836
|
onConfirmMeeting: k,
|
|
837
837
|
canEdit: M,
|
|
838
|
-
canDelete:
|
|
839
|
-
canCancel:
|
|
838
|
+
canDelete: z,
|
|
839
|
+
canCancel: E,
|
|
840
840
|
isCurrentUserParticipant: p,
|
|
841
841
|
isCurrentUserClient: y,
|
|
842
842
|
currentUserAcceptStatus: b,
|
|
843
843
|
isAcceptLoading: N,
|
|
844
844
|
isDeclineLoading: S,
|
|
845
|
-
isConfirmLoading:
|
|
846
|
-
isDeleteLoading:
|
|
845
|
+
isConfirmLoading: I,
|
|
846
|
+
isDeleteLoading: Y,
|
|
847
847
|
renderParticipant: _,
|
|
848
848
|
renderHeaderActions: W,
|
|
849
849
|
renderCancelReason: A,
|
|
850
|
-
renderDeleteConfirmation:
|
|
851
|
-
formatDate:
|
|
852
|
-
formatTimeRange:
|
|
850
|
+
renderDeleteConfirmation: V,
|
|
851
|
+
formatDate: L,
|
|
852
|
+
formatTimeRange: U
|
|
853
853
|
};
|
|
854
|
-
return l ? /* @__PURE__ */ n(
|
|
854
|
+
return l ? /* @__PURE__ */ n(Re, { open: s ?? !1, onOpenChange: o ?? (() => {
|
|
855
855
|
}), children: [
|
|
856
|
-
/* @__PURE__ */ e(
|
|
856
|
+
/* @__PURE__ */ e(Ve, { asChild: !0, children: r }),
|
|
857
857
|
/* @__PURE__ */ e(
|
|
858
|
-
|
|
858
|
+
Ue,
|
|
859
859
|
{
|
|
860
|
-
className:
|
|
860
|
+
className: h(
|
|
861
861
|
"p-0 shadow-lg !rounded-2xl bg-white dark:bg-zinc-900 overflow-hidden border z-50",
|
|
862
|
-
|
|
862
|
+
G
|
|
863
863
|
),
|
|
864
864
|
style: { width: x },
|
|
865
865
|
align: "center",
|
|
866
866
|
side: "bottom",
|
|
867
867
|
sideOffset: 4,
|
|
868
|
-
children: /* @__PURE__ */ e(
|
|
868
|
+
children: /* @__PURE__ */ e(ze, { ...C })
|
|
869
869
|
}
|
|
870
870
|
)
|
|
871
|
-
] }) : /* @__PURE__ */ n(
|
|
871
|
+
] }) : /* @__PURE__ */ n(ie, { children: [
|
|
872
872
|
r,
|
|
873
873
|
/* @__PURE__ */ e(
|
|
874
|
-
|
|
874
|
+
St,
|
|
875
875
|
{
|
|
876
876
|
open: s ?? !1,
|
|
877
877
|
onOpenChange: o ?? (() => {
|
|
878
878
|
}),
|
|
879
879
|
title: t.title,
|
|
880
|
-
children: /* @__PURE__ */ e(
|
|
880
|
+
children: /* @__PURE__ */ e(ze, { ...C })
|
|
881
881
|
}
|
|
882
882
|
)
|
|
883
883
|
] });
|
|
884
884
|
}
|
|
885
|
-
const
|
|
886
|
-
function
|
|
885
|
+
const ve = 44, Le = 4, It = 56, He = 8, we = 80, ue = 140, Te = 100, je = 2, Wt = 8, At = 18;
|
|
886
|
+
function Bt(t) {
|
|
887
887
|
return t.split(" ").map((r) => r[0]).join("").toUpperCase().slice(0, 2);
|
|
888
888
|
}
|
|
889
|
-
function
|
|
889
|
+
function $t(t, r) {
|
|
890
890
|
const s = [];
|
|
891
891
|
for (let o = 0; o < r; o++) {
|
|
892
|
-
const
|
|
893
|
-
|
|
892
|
+
const i = new Date(t);
|
|
893
|
+
i.setDate(i.getDate() + o), s.push(i);
|
|
894
894
|
}
|
|
895
895
|
return s;
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function Ft(t, r, s) {
|
|
898
898
|
const o = [];
|
|
899
|
-
return t.forEach((
|
|
899
|
+
return t.forEach((i, a) => {
|
|
900
900
|
for (let g = r; g < s; g++)
|
|
901
|
-
o.push({ hour: g, dayIndex:
|
|
901
|
+
o.push({ hour: g, dayIndex: a, date: i });
|
|
902
902
|
}), o;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function _t(t) {
|
|
905
905
|
return `${t.toString().padStart(2, "0")}:00`;
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function Pt(t) {
|
|
908
908
|
return t.toLocaleDateString("en-US", {
|
|
909
909
|
weekday: "short",
|
|
910
910
|
month: "short",
|
|
911
911
|
day: "numeric"
|
|
912
912
|
});
|
|
913
913
|
}
|
|
914
|
-
function
|
|
915
|
-
const r = [...t].sort((
|
|
916
|
-
for (const
|
|
917
|
-
let
|
|
918
|
-
for (; o[
|
|
919
|
-
|
|
920
|
-
o[
|
|
921
|
-
...
|
|
922
|
-
stackIndex:
|
|
914
|
+
function Ie(t) {
|
|
915
|
+
const r = [...t].sort((i, a) => i.startCol !== a.startCol ? i.startCol - a.startCol : a.spanCols - i.spanCols), s = [], o = [];
|
|
916
|
+
for (const i of r) {
|
|
917
|
+
let a = 0;
|
|
918
|
+
for (; o[a] !== void 0 && o[a] > i.startCol; )
|
|
919
|
+
a++;
|
|
920
|
+
o[a] = i.startCol + i.spanCols, s.push({
|
|
921
|
+
...i,
|
|
922
|
+
stackIndex: a
|
|
923
923
|
});
|
|
924
924
|
}
|
|
925
925
|
return s;
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function Ot({ src: t, alt: r, fallback: s, className: o }) {
|
|
928
928
|
return /* @__PURE__ */ e(
|
|
929
929
|
"div",
|
|
930
930
|
{
|
|
931
|
-
className:
|
|
931
|
+
className: h("relative flex shrink-0 overflow-hidden rounded-sm border bg-muted", o),
|
|
932
932
|
children: t ? /* @__PURE__ */ e("img", { src: t, alt: r, className: "aspect-square h-full w-full object-cover" }) : /* @__PURE__ */ e("div", { className: "flex h-full w-full items-center justify-center bg-muted text-muted-foreground", children: s })
|
|
933
933
|
}
|
|
934
934
|
);
|
|
935
935
|
}
|
|
936
|
-
const
|
|
937
|
-
function
|
|
938
|
-
daysToShow: t =
|
|
936
|
+
const Rt = 7;
|
|
937
|
+
function be({
|
|
938
|
+
daysToShow: t = Rt,
|
|
939
939
|
events: r,
|
|
940
940
|
users: s = [],
|
|
941
941
|
selectedDate: o,
|
|
942
|
-
onDateChange:
|
|
943
|
-
onEventClick:
|
|
942
|
+
onDateChange: i,
|
|
943
|
+
onEventClick: a,
|
|
944
944
|
visibleHours: g,
|
|
945
945
|
className: f,
|
|
946
946
|
getEventUserId: c,
|
|
@@ -948,42 +948,42 @@ function pe({
|
|
|
948
948
|
slots: w,
|
|
949
949
|
classNames: k
|
|
950
950
|
}) {
|
|
951
|
-
const M =
|
|
952
|
-
const l = new Date(
|
|
951
|
+
const M = Oe(null), z = o ?? /* @__PURE__ */ new Date(), E = !0, p = g?.from ?? Wt, y = g?.to ?? At, b = y - p, N = $(() => {
|
|
952
|
+
const l = new Date(z);
|
|
953
953
|
if (t === 1 || t === 3)
|
|
954
954
|
return l.setHours(0, 0, 0, 0), l;
|
|
955
|
-
const
|
|
955
|
+
const m = l.getDay(), v = m === 0 ? -6 : 1 - m;
|
|
956
956
|
return l.setDate(l.getDate() + v), l.setHours(0, 0, 0, 0), l;
|
|
957
|
-
}, [
|
|
958
|
-
() =>
|
|
957
|
+
}, [z, t]), S = $(
|
|
958
|
+
() => $t(N, t),
|
|
959
959
|
[N, t]
|
|
960
|
-
),
|
|
961
|
-
() =>
|
|
962
|
-
[
|
|
960
|
+
), I = $(
|
|
961
|
+
() => Ft(S, p, y),
|
|
962
|
+
[E, S, p, y]
|
|
963
963
|
), _ = c ?? ((l) => {
|
|
964
964
|
if (l.user?.id) return l.user.id;
|
|
965
|
-
const
|
|
966
|
-
if (
|
|
967
|
-
if (
|
|
968
|
-
return String(
|
|
965
|
+
const m = l.data;
|
|
966
|
+
if (m?.userId) return String(m.userId);
|
|
967
|
+
if (m?.user && typeof m.user == "object" && m.user.id)
|
|
968
|
+
return String(m.user.id);
|
|
969
969
|
if (l.participants?.[0]?.id) return l.participants[0].id;
|
|
970
|
-
}), W =
|
|
970
|
+
}), W = $(() => {
|
|
971
971
|
const l = /* @__PURE__ */ new Map();
|
|
972
|
-
for (const
|
|
973
|
-
l.set(
|
|
974
|
-
id:
|
|
975
|
-
name:
|
|
976
|
-
avatar:
|
|
977
|
-
email:
|
|
972
|
+
for (const m of s)
|
|
973
|
+
l.set(m.id, {
|
|
974
|
+
id: m.id,
|
|
975
|
+
name: m.name,
|
|
976
|
+
avatar: m.avatar ?? void 0,
|
|
977
|
+
email: m.email
|
|
978
978
|
});
|
|
979
|
-
for (const
|
|
980
|
-
|
|
981
|
-
id:
|
|
982
|
-
name:
|
|
983
|
-
avatar:
|
|
984
|
-
email:
|
|
979
|
+
for (const m of r) {
|
|
980
|
+
m.user?.id && !l.has(m.user.id) && l.set(m.user.id, {
|
|
981
|
+
id: m.user.id,
|
|
982
|
+
name: m.user.name,
|
|
983
|
+
avatar: m.user.avatar ?? void 0,
|
|
984
|
+
email: m.user.email
|
|
985
985
|
});
|
|
986
|
-
for (const v of
|
|
986
|
+
for (const v of m.participants || [])
|
|
987
987
|
v.id && !l.has(v.id) && l.set(v.id, {
|
|
988
988
|
id: v.id,
|
|
989
989
|
name: v.name,
|
|
@@ -992,47 +992,47 @@ function pe({
|
|
|
992
992
|
});
|
|
993
993
|
}
|
|
994
994
|
return Array.from(l.values());
|
|
995
|
-
}, [s, r]), A =
|
|
996
|
-
const l = [],
|
|
995
|
+
}, [s, r]), A = $(() => {
|
|
996
|
+
const l = [], m = /* @__PURE__ */ new Map();
|
|
997
997
|
for (const D of W)
|
|
998
|
-
|
|
999
|
-
|
|
998
|
+
m.set(D.id, []);
|
|
999
|
+
m.set("unassigned", []);
|
|
1000
1000
|
for (const D of r) {
|
|
1001
|
-
const
|
|
1002
|
-
(
|
|
1001
|
+
const B = _(D) ?? "unassigned";
|
|
1002
|
+
(m.get(B) ?? m.get("unassigned")).push(D);
|
|
1003
1003
|
}
|
|
1004
1004
|
const v = (D) => {
|
|
1005
|
-
const
|
|
1006
|
-
for (const
|
|
1007
|
-
const
|
|
1008
|
-
for (let
|
|
1009
|
-
const
|
|
1010
|
-
if (
|
|
1011
|
-
let
|
|
1012
|
-
if (
|
|
1013
|
-
const
|
|
1014
|
-
|
|
1015
|
-
event:
|
|
1016
|
-
startCol:
|
|
1017
|
-
spanCols: Math.max(1,
|
|
1005
|
+
const B = [];
|
|
1006
|
+
for (const T of D) {
|
|
1007
|
+
const P = T.startDate.getHours() + T.startDate.getMinutes() / 60, Q = T.endDate.getHours() + T.endDate.getMinutes() / 60;
|
|
1008
|
+
for (let J = 0; J < S.length; J++) {
|
|
1009
|
+
const u = S[J], H = xe(u), R = Ye(u);
|
|
1010
|
+
if (T.startDate <= R && T.endDate >= H) {
|
|
1011
|
+
let F = p, K = y;
|
|
1012
|
+
if (T.startDate >= H && (F = Math.max(p, P)), T.endDate <= R && (K = Math.min(y, Q)), F = Math.max(p, Math.min(y, F)), K = Math.max(p, Math.min(y, K)), K > F) {
|
|
1013
|
+
const j = J * b + Math.floor(F - p), X = J * b + Math.ceil(K - p);
|
|
1014
|
+
B.push({
|
|
1015
|
+
event: T,
|
|
1016
|
+
startCol: j,
|
|
1017
|
+
spanCols: Math.max(1, X - j)
|
|
1018
1018
|
});
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
1021
1021
|
}
|
|
1022
1022
|
}
|
|
1023
|
-
return
|
|
1023
|
+
return B;
|
|
1024
1024
|
};
|
|
1025
1025
|
for (const D of W) {
|
|
1026
|
-
const
|
|
1026
|
+
const B = m.get(D.id) ?? [], T = v(B), P = Ie(T), Q = P.reduce((J, u) => Math.max(J, u.stackIndex + 1), 0);
|
|
1027
1027
|
l.push({
|
|
1028
1028
|
user: D,
|
|
1029
|
-
events:
|
|
1030
|
-
maxStack: Math.max(
|
|
1029
|
+
events: P,
|
|
1030
|
+
maxStack: Math.max(Q, 1)
|
|
1031
1031
|
});
|
|
1032
1032
|
}
|
|
1033
|
-
const C =
|
|
1033
|
+
const C = m.get("unassigned") ?? [];
|
|
1034
1034
|
if (C.length > 0) {
|
|
1035
|
-
const D = v(C),
|
|
1035
|
+
const D = v(C), B = Ie(D), T = B.reduce((P, Q) => Math.max(P, Q.stackIndex + 1), 0);
|
|
1036
1036
|
l.push({
|
|
1037
1037
|
user: {
|
|
1038
1038
|
id: "unassigned",
|
|
@@ -1040,8 +1040,8 @@ function pe({
|
|
|
1040
1040
|
avatar: void 0,
|
|
1041
1041
|
email: void 0
|
|
1042
1042
|
},
|
|
1043
|
-
events:
|
|
1044
|
-
maxStack: Math.max(
|
|
1043
|
+
events: B,
|
|
1044
|
+
maxStack: Math.max(T, 1)
|
|
1045
1045
|
});
|
|
1046
1046
|
}
|
|
1047
1047
|
return l.filter((D) => D.events.length > 0);
|
|
@@ -1049,36 +1049,36 @@ function pe({
|
|
|
1049
1049
|
W,
|
|
1050
1050
|
r,
|
|
1051
1051
|
S,
|
|
1052
|
-
|
|
1052
|
+
E,
|
|
1053
1053
|
b,
|
|
1054
1054
|
p,
|
|
1055
1055
|
y,
|
|
1056
1056
|
_
|
|
1057
|
-
]),
|
|
1057
|
+
]), V = $(() => {
|
|
1058
1058
|
const l = /* @__PURE__ */ new Map();
|
|
1059
|
-
for (const
|
|
1060
|
-
for (const v of
|
|
1059
|
+
for (const m of A)
|
|
1060
|
+
for (const v of m.events)
|
|
1061
1061
|
if (v.spanCols === 1) {
|
|
1062
1062
|
const C = l.get(v.startCol) ?? 0;
|
|
1063
1063
|
l.set(v.startCol, C + 1);
|
|
1064
1064
|
}
|
|
1065
1065
|
return l;
|
|
1066
|
-
}, [A]),
|
|
1067
|
-
const l =
|
|
1066
|
+
}, [A]), L = $(() => {
|
|
1067
|
+
const l = I.length, m = we, v = [];
|
|
1068
1068
|
for (let C = 0; C < l; C++) {
|
|
1069
|
-
const D =
|
|
1070
|
-
D >
|
|
1071
|
-
|
|
1072
|
-
) : D > 0 ? v.push(Math.max(
|
|
1069
|
+
const D = V.get(C) ?? 0;
|
|
1070
|
+
D > je ? v.push(
|
|
1071
|
+
Te + (D - je) * 20
|
|
1072
|
+
) : D > 0 ? v.push(Math.max(m, Te)) : v.push(m);
|
|
1073
1073
|
}
|
|
1074
1074
|
return v;
|
|
1075
|
-
}, [
|
|
1075
|
+
}, [E, I.length, S.length, V]), U = (l) => Math.max(It, l * (ve + Le) + He * 2), G = ue + L.reduce((l, m) => l + m, 0), x = $(() => {
|
|
1076
1076
|
const l = [0];
|
|
1077
|
-
for (let
|
|
1078
|
-
l.push(l[
|
|
1077
|
+
for (let m = 0; m < L.length; m++)
|
|
1078
|
+
l.push(l[m] + L[m]);
|
|
1079
1079
|
return l;
|
|
1080
|
-
}, [
|
|
1081
|
-
return /* @__PURE__ */ e("div", { className:
|
|
1080
|
+
}, [L]);
|
|
1081
|
+
return /* @__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: G }, children: [
|
|
1082
1082
|
// Hour mode: Day headers + Hour sub-headers - sticky wrapper with flex child (sticky + flex breaks sticky)
|
|
1083
1083
|
/* @__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: [
|
|
1084
1084
|
t > 1 && /* @__PURE__ */ n("div", { className: "flex border-b", children: [
|
|
@@ -1086,21 +1086,21 @@ function pe({
|
|
|
1086
1086
|
"div",
|
|
1087
1087
|
{
|
|
1088
1088
|
className: "flex shrink-0 items-center border-r bg-background px-2 py-1",
|
|
1089
|
-
style: { width:
|
|
1089
|
+
style: { width: ue },
|
|
1090
1090
|
children: /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase text-muted-foreground", children: "Resources" })
|
|
1091
1091
|
}
|
|
1092
1092
|
),
|
|
1093
|
-
S.map((l,
|
|
1094
|
-
const v =
|
|
1093
|
+
S.map((l, m) => {
|
|
1094
|
+
const v = le(l), C = m * b, D = L.slice(C, C + b).reduce((B, T) => B + T, 0);
|
|
1095
1095
|
return /* @__PURE__ */ e(
|
|
1096
1096
|
"div",
|
|
1097
1097
|
{
|
|
1098
|
-
className:
|
|
1098
|
+
className: h(
|
|
1099
1099
|
"flex shrink-0 items-center justify-center border-r py-1.5 font-medium",
|
|
1100
1100
|
v ? "bg-primary/10 text-primary" : "bg-muted/30"
|
|
1101
1101
|
),
|
|
1102
1102
|
style: { width: D },
|
|
1103
|
-
children: /* @__PURE__ */ e("span", { className: "text-xs", children:
|
|
1103
|
+
children: /* @__PURE__ */ e("span", { className: "text-xs", children: Pt(l) })
|
|
1104
1104
|
},
|
|
1105
1105
|
`day-${l.toISOString()}`
|
|
1106
1106
|
);
|
|
@@ -1111,7 +1111,7 @@ function pe({
|
|
|
1111
1111
|
"div",
|
|
1112
1112
|
{
|
|
1113
1113
|
className: "flex shrink-0 items-center border-r bg-background px-2 py-2",
|
|
1114
|
-
style: { width:
|
|
1114
|
+
style: { width: ue },
|
|
1115
1115
|
children: /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase text-muted-foreground", children: "Resources" })
|
|
1116
1116
|
}
|
|
1117
1117
|
),
|
|
@@ -1119,21 +1119,21 @@ function pe({
|
|
|
1119
1119
|
"div",
|
|
1120
1120
|
{
|
|
1121
1121
|
className: "sticky left-0 z-10 border-r bg-background",
|
|
1122
|
-
style: { width:
|
|
1122
|
+
style: { width: ue }
|
|
1123
1123
|
}
|
|
1124
1124
|
),
|
|
1125
|
-
|
|
1126
|
-
const v = l.hour === p, C =
|
|
1125
|
+
I.map((l, m) => {
|
|
1126
|
+
const v = l.hour === p, C = le(l.date), D = L[m] ?? we;
|
|
1127
1127
|
return /* @__PURE__ */ e(
|
|
1128
1128
|
"div",
|
|
1129
1129
|
{
|
|
1130
|
-
className:
|
|
1130
|
+
className: h(
|
|
1131
1131
|
"flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",
|
|
1132
|
-
v &&
|
|
1132
|
+
v && m > 0 ? "border-l-2 border-l-border" : "border-r border-r-border/50",
|
|
1133
1133
|
C && "bg-primary/5"
|
|
1134
1134
|
),
|
|
1135
1135
|
style: { width: D },
|
|
1136
|
-
children:
|
|
1136
|
+
children: _t(l.hour)
|
|
1137
1137
|
},
|
|
1138
1138
|
`hour-${l.dayIndex}-${l.hour}`
|
|
1139
1139
|
);
|
|
@@ -1141,28 +1141,28 @@ function pe({
|
|
|
1141
1141
|
] })
|
|
1142
1142
|
] }) }),
|
|
1143
1143
|
A.map((l) => {
|
|
1144
|
-
const
|
|
1144
|
+
const m = U(l.maxStack);
|
|
1145
1145
|
return /* @__PURE__ */ n(
|
|
1146
1146
|
"div",
|
|
1147
1147
|
{
|
|
1148
|
-
className:
|
|
1149
|
-
style: { height:
|
|
1148
|
+
className: h("relative flex border-b", k?.resourceRow),
|
|
1149
|
+
style: { height: m },
|
|
1150
1150
|
children: [
|
|
1151
|
-
/* @__PURE__ */ e("div", { className: "sticky left-0 z-10", style: { width:
|
|
1151
|
+
/* @__PURE__ */ e("div", { className: "sticky left-0 z-10", style: { width: ue }, children: /* @__PURE__ */ n(
|
|
1152
1152
|
"div",
|
|
1153
1153
|
{
|
|
1154
|
-
className:
|
|
1154
|
+
className: h(
|
|
1155
1155
|
"flex h-full items-center gap-2 sm:gap-3 border-r bg-background px-2 sm:px-4",
|
|
1156
1156
|
k?.resourceHeader
|
|
1157
1157
|
),
|
|
1158
1158
|
children: [
|
|
1159
1159
|
/* @__PURE__ */ e(
|
|
1160
|
-
|
|
1160
|
+
Ot,
|
|
1161
1161
|
{
|
|
1162
1162
|
className: "size-7",
|
|
1163
1163
|
src: l.user.avatar,
|
|
1164
1164
|
alt: l.user.name,
|
|
1165
|
-
fallback:
|
|
1165
|
+
fallback: Bt(l.user.name)
|
|
1166
1166
|
}
|
|
1167
1167
|
),
|
|
1168
1168
|
/* @__PURE__ */ e("span", { className: "truncate text-xs sm:text-sm font-medium", children: l.user.name })
|
|
@@ -1171,42 +1171,42 @@ function pe({
|
|
|
1171
1171
|
) }),
|
|
1172
1172
|
/* @__PURE__ */ n("div", { className: "relative flex", children: [
|
|
1173
1173
|
// Hour mode cells
|
|
1174
|
-
|
|
1175
|
-
const D = v.hour === p && C > 0,
|
|
1174
|
+
I.map((v, C) => {
|
|
1175
|
+
const D = v.hour === p && C > 0, B = L[C] ?? we;
|
|
1176
1176
|
return /* @__PURE__ */ e(
|
|
1177
1177
|
"div",
|
|
1178
1178
|
{
|
|
1179
|
-
className:
|
|
1179
|
+
className: h(
|
|
1180
1180
|
"shrink-0",
|
|
1181
1181
|
D ? "border-l-2 border-l-border" : "border-r border-r-border/50",
|
|
1182
|
-
|
|
1182
|
+
le(v.date) && "bg-primary/5"
|
|
1183
1183
|
),
|
|
1184
|
-
style: { width:
|
|
1184
|
+
style: { width: B }
|
|
1185
1185
|
},
|
|
1186
1186
|
`cell-${v.dayIndex}-${v.hour}`
|
|
1187
1187
|
);
|
|
1188
1188
|
}),
|
|
1189
1189
|
l.events.map((v) => {
|
|
1190
|
-
const C = (x[v.startCol] ?? 0) + 2, D = x[v.startCol + v.spanCols] ?? x[x.length - 1] ?? 0,
|
|
1190
|
+
const C = (x[v.startCol] ?? 0) + 2, D = x[v.startCol + v.spanCols] ?? x[x.length - 1] ?? 0, B = x[v.startCol] ?? 0, T = D - B - 4, P = He + v.stackIndex * (ve + Le);
|
|
1191
1191
|
return /* @__PURE__ */ e(
|
|
1192
1192
|
"div",
|
|
1193
1193
|
{
|
|
1194
1194
|
className: "absolute",
|
|
1195
1195
|
style: {
|
|
1196
1196
|
left: C,
|
|
1197
|
-
width: Math.max(
|
|
1197
|
+
width: Math.max(T, 0),
|
|
1198
1198
|
// No forced minimum - columns are guaranteed wide enough
|
|
1199
|
-
top:
|
|
1200
|
-
height:
|
|
1199
|
+
top: P,
|
|
1200
|
+
height: ve
|
|
1201
1201
|
},
|
|
1202
1202
|
children: /* @__PURE__ */ e(
|
|
1203
|
-
|
|
1203
|
+
ot,
|
|
1204
1204
|
{
|
|
1205
1205
|
event: v.event,
|
|
1206
1206
|
variant: "compact",
|
|
1207
|
-
onClick:
|
|
1207
|
+
onClick: a,
|
|
1208
1208
|
renderPopover: d,
|
|
1209
|
-
className:
|
|
1209
|
+
className: h("h-full w-full", k?.eventCardCompact)
|
|
1210
1210
|
}
|
|
1211
1211
|
)
|
|
1212
1212
|
},
|
|
@@ -1222,7 +1222,7 @@ function pe({
|
|
|
1222
1222
|
A.length === 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-20 text-muted-foreground", children: "No users or events to display" })
|
|
1223
1223
|
] }) }) });
|
|
1224
1224
|
}
|
|
1225
|
-
const
|
|
1225
|
+
const Vt = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], Ut = [
|
|
1226
1226
|
"January",
|
|
1227
1227
|
"February",
|
|
1228
1228
|
"March",
|
|
@@ -1236,18 +1236,18 @@ const Ft = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], Pt = [
|
|
|
1236
1236
|
"November",
|
|
1237
1237
|
"December"
|
|
1238
1238
|
];
|
|
1239
|
-
function
|
|
1239
|
+
function We(t) {
|
|
1240
1240
|
const r = t.hexColor;
|
|
1241
1241
|
return r ? { backgroundColor: r } : {};
|
|
1242
1242
|
}
|
|
1243
|
-
function
|
|
1244
|
-
const
|
|
1243
|
+
function Yt({ day: t, date: r, events: s, isCurrentMonth: o, onDayClick: i }) {
|
|
1244
|
+
const a = le(r), g = 3, f = s.length;
|
|
1245
1245
|
return /* @__PURE__ */ n(
|
|
1246
1246
|
"button",
|
|
1247
1247
|
{
|
|
1248
1248
|
type: "button",
|
|
1249
|
-
onClick: () =>
|
|
1250
|
-
className:
|
|
1249
|
+
onClick: () => i?.(r),
|
|
1250
|
+
className: h(
|
|
1251
1251
|
"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",
|
|
1252
1252
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1253
1253
|
"transition-colors",
|
|
@@ -1257,9 +1257,9 @@ function Ot({ day: t, date: r, events: s, isCurrentMonth: o, onDayClick: a }) {
|
|
|
1257
1257
|
/* @__PURE__ */ e(
|
|
1258
1258
|
"div",
|
|
1259
1259
|
{
|
|
1260
|
-
className:
|
|
1260
|
+
className: h(
|
|
1261
1261
|
"flex size-5 sm:size-6 items-center justify-center rounded-full text-[10px] sm:text-xs font-medium",
|
|
1262
|
-
|
|
1262
|
+
a && "bg-primary font-semibold text-primary-foreground"
|
|
1263
1263
|
),
|
|
1264
1264
|
children: t
|
|
1265
1265
|
}
|
|
@@ -1268,15 +1268,15 @@ function Ot({ day: t, date: r, events: s, isCurrentMonth: o, onDayClick: a }) {
|
|
|
1268
1268
|
"div",
|
|
1269
1269
|
{
|
|
1270
1270
|
className: "size-1 sm:size-1.5 rounded-full bg-primary",
|
|
1271
|
-
style:
|
|
1271
|
+
style: We(c)
|
|
1272
1272
|
},
|
|
1273
1273
|
c.id
|
|
1274
|
-
)) : /* @__PURE__ */ n(
|
|
1274
|
+
)) : /* @__PURE__ */ n(ie, { children: [
|
|
1275
1275
|
s.slice(0, g).map((c) => /* @__PURE__ */ e(
|
|
1276
1276
|
"div",
|
|
1277
1277
|
{
|
|
1278
1278
|
className: "size-1 sm:size-1.5 rounded-full bg-primary",
|
|
1279
|
-
style:
|
|
1279
|
+
style: We(c)
|
|
1280
1280
|
},
|
|
1281
1281
|
c.id
|
|
1282
1282
|
)),
|
|
@@ -1289,63 +1289,63 @@ function Ot({ day: t, date: r, events: s, isCurrentMonth: o, onDayClick: a }) {
|
|
|
1289
1289
|
}
|
|
1290
1290
|
);
|
|
1291
1291
|
}
|
|
1292
|
-
function
|
|
1292
|
+
function Gt({
|
|
1293
1293
|
date: t,
|
|
1294
1294
|
events: r,
|
|
1295
1295
|
onMonthClick: s,
|
|
1296
1296
|
onDayClick: o
|
|
1297
1297
|
}) {
|
|
1298
|
-
const
|
|
1298
|
+
const i = $(() => ft(t, 0), [t]);
|
|
1299
1299
|
return /* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
1300
1300
|
/* @__PURE__ */ e(
|
|
1301
1301
|
"button",
|
|
1302
1302
|
{
|
|
1303
1303
|
type: "button",
|
|
1304
1304
|
onClick: () => s?.(t),
|
|
1305
|
-
className:
|
|
1305
|
+
className: h(
|
|
1306
1306
|
"w-full rounded-t-lg border px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm font-semibold",
|
|
1307
1307
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1308
1308
|
"transition-colors"
|
|
1309
1309
|
),
|
|
1310
|
-
children:
|
|
1310
|
+
children: Ut[t.getMonth()]
|
|
1311
1311
|
}
|
|
1312
1312
|
),
|
|
1313
1313
|
/* @__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: [
|
|
1314
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children:
|
|
1315
|
-
/* @__PURE__ */ e("span", { className: "sm:hidden", children:
|
|
1316
|
-
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children:
|
|
1314
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children: Vt.map((a, g) => /* @__PURE__ */ n("div", { className: "text-[9px] sm:text-xs font-medium text-muted-foreground", children: [
|
|
1315
|
+
/* @__PURE__ */ e("span", { className: "sm:hidden", children: a[0] }),
|
|
1316
|
+
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children: a })
|
|
1317
1317
|
] }, g)) }),
|
|
1318
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children:
|
|
1319
|
-
const f =
|
|
1318
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children: i.map((a, g) => {
|
|
1319
|
+
const f = gt(r, a.date);
|
|
1320
1320
|
return /* @__PURE__ */ e(
|
|
1321
|
-
|
|
1321
|
+
Yt,
|
|
1322
1322
|
{
|
|
1323
|
-
day:
|
|
1324
|
-
date:
|
|
1323
|
+
day: a.date.getDate(),
|
|
1324
|
+
date: a.date,
|
|
1325
1325
|
events: f,
|
|
1326
|
-
isCurrentMonth:
|
|
1326
|
+
isCurrentMonth: a.isCurrentMonth,
|
|
1327
1327
|
onDayClick: o
|
|
1328
1328
|
},
|
|
1329
|
-
`${g + 1}-${
|
|
1329
|
+
`${g + 1}-${a.date.toISOString()}`
|
|
1330
1330
|
);
|
|
1331
1331
|
}) })
|
|
1332
1332
|
] })
|
|
1333
1333
|
] });
|
|
1334
1334
|
}
|
|
1335
|
-
function
|
|
1335
|
+
function Kt({
|
|
1336
1336
|
events: t,
|
|
1337
1337
|
year: r,
|
|
1338
1338
|
onMonthClick: s,
|
|
1339
1339
|
onDayClick: o,
|
|
1340
|
-
className:
|
|
1341
|
-
slots:
|
|
1340
|
+
className: i,
|
|
1341
|
+
slots: a,
|
|
1342
1342
|
classNames: g
|
|
1343
1343
|
}) {
|
|
1344
|
-
const f =
|
|
1345
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1344
|
+
const f = $(() => mt(r), [r]);
|
|
1345
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col h-full", i), children: [
|
|
1346
1346
|
/* @__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 }) }),
|
|
1347
1347
|
/* @__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(
|
|
1348
|
-
|
|
1348
|
+
Gt,
|
|
1349
1349
|
{
|
|
1350
1350
|
date: c,
|
|
1351
1351
|
events: t,
|
|
@@ -1356,7 +1356,7 @@ function Vt({
|
|
|
1356
1356
|
)) }) })
|
|
1357
1357
|
] });
|
|
1358
1358
|
}
|
|
1359
|
-
function
|
|
1359
|
+
function Jt(t) {
|
|
1360
1360
|
switch (t) {
|
|
1361
1361
|
case "day":
|
|
1362
1362
|
case "week":
|
|
@@ -1365,13 +1365,13 @@ function Ut(t) {
|
|
|
1365
1365
|
return "day";
|
|
1366
1366
|
}
|
|
1367
1367
|
}
|
|
1368
|
-
function
|
|
1368
|
+
function Xt({
|
|
1369
1369
|
onEventClick: t,
|
|
1370
1370
|
onSlotClick: r,
|
|
1371
1371
|
onSlotSelect: s,
|
|
1372
1372
|
onAddEvent: o,
|
|
1373
|
-
className:
|
|
1374
|
-
showHeader:
|
|
1373
|
+
className: i,
|
|
1374
|
+
showHeader: a = !0,
|
|
1375
1375
|
minSelectionMinutes: g = 30,
|
|
1376
1376
|
showMoreEventsInPopover: f = !1,
|
|
1377
1377
|
isLoading: c = !1,
|
|
@@ -1379,8 +1379,8 @@ function Yt({
|
|
|
1379
1379
|
classNames: w,
|
|
1380
1380
|
settingsContent: k,
|
|
1381
1381
|
filterContent: M,
|
|
1382
|
-
headerActions:
|
|
1383
|
-
renderPopover:
|
|
1382
|
+
headerActions: z,
|
|
1383
|
+
renderPopover: E
|
|
1384
1384
|
}) {
|
|
1385
1385
|
const {
|
|
1386
1386
|
view: p,
|
|
@@ -1388,93 +1388,93 @@ function Yt({
|
|
|
1388
1388
|
selectedDate: b,
|
|
1389
1389
|
setSelectedDate: N,
|
|
1390
1390
|
slotDuration: S,
|
|
1391
|
-
filteredEvents:
|
|
1392
|
-
users:
|
|
1391
|
+
filteredEvents: I,
|
|
1392
|
+
users: Y,
|
|
1393
1393
|
visibleHours: _,
|
|
1394
1394
|
workingHours: W,
|
|
1395
1395
|
badgeVariant: A,
|
|
1396
|
-
showWorkingHoursOnly:
|
|
1397
|
-
} =
|
|
1398
|
-
if (!
|
|
1396
|
+
showWorkingHoursOnly: V
|
|
1397
|
+
} = tt(), L = $(() => {
|
|
1398
|
+
if (!V || !W)
|
|
1399
1399
|
return { startHour: _.start, endHour: _.end };
|
|
1400
|
-
let
|
|
1401
|
-
for (const
|
|
1402
|
-
const
|
|
1403
|
-
!
|
|
1400
|
+
let u = 24, H = 0;
|
|
1401
|
+
for (const R of Object.keys(W)) {
|
|
1402
|
+
const F = W[Number(R)];
|
|
1403
|
+
!F || F.enabled === !1 || (F.from < u && (u = F.from), F.to > H && (H = F.to));
|
|
1404
1404
|
}
|
|
1405
|
-
return
|
|
1406
|
-
}, [
|
|
1407
|
-
(
|
|
1405
|
+
return u >= H ? { startHour: _.start, endHour: _.end } : { startHour: u, endHour: H };
|
|
1406
|
+
}, [V, W, _]), U = L, G = $(() => Jt(p), [p]), x = ae(
|
|
1407
|
+
(u) => {
|
|
1408
1408
|
if (s) {
|
|
1409
|
-
s(
|
|
1409
|
+
s(u);
|
|
1410
1410
|
return;
|
|
1411
1411
|
}
|
|
1412
1412
|
if (r) {
|
|
1413
|
-
const
|
|
1414
|
-
r(
|
|
1413
|
+
const H = u.startDate.getHours();
|
|
1414
|
+
r(u.startDate, H);
|
|
1415
1415
|
}
|
|
1416
1416
|
},
|
|
1417
1417
|
[s, r]
|
|
1418
|
-
), l =
|
|
1419
|
-
(
|
|
1420
|
-
y("day"), N(
|
|
1418
|
+
), l = ae(
|
|
1419
|
+
(u) => {
|
|
1420
|
+
y("day"), N(u, "day");
|
|
1421
1421
|
},
|
|
1422
1422
|
[N, y]
|
|
1423
|
-
),
|
|
1424
|
-
(
|
|
1425
|
-
y("month"), N(
|
|
1423
|
+
), m = ae(
|
|
1424
|
+
(u) => {
|
|
1425
|
+
y("month"), N(u, "month");
|
|
1426
1426
|
},
|
|
1427
1427
|
[N, y]
|
|
1428
|
-
), v =
|
|
1429
|
-
(
|
|
1430
|
-
t?.(
|
|
1428
|
+
), v = ae(
|
|
1429
|
+
(u) => {
|
|
1430
|
+
t?.(u);
|
|
1431
1431
|
},
|
|
1432
1432
|
[t]
|
|
1433
1433
|
), C = () => {
|
|
1434
|
-
const
|
|
1434
|
+
const u = I, H = v, R = E;
|
|
1435
1435
|
switch (p) {
|
|
1436
1436
|
case "day":
|
|
1437
1437
|
return /* @__PURE__ */ e(
|
|
1438
|
-
|
|
1438
|
+
ct,
|
|
1439
1439
|
{
|
|
1440
|
-
events:
|
|
1440
|
+
events: u,
|
|
1441
1441
|
date: b,
|
|
1442
|
-
visibleHours:
|
|
1442
|
+
visibleHours: U,
|
|
1443
1443
|
workingHours: W,
|
|
1444
1444
|
slotDuration: S,
|
|
1445
1445
|
badgeVariant: A,
|
|
1446
|
-
onEventClick:
|
|
1447
|
-
renderPopover:
|
|
1446
|
+
onEventClick: H,
|
|
1447
|
+
renderPopover: R,
|
|
1448
1448
|
...d && { slots: d },
|
|
1449
1449
|
...w && { classNames: w }
|
|
1450
1450
|
}
|
|
1451
1451
|
);
|
|
1452
1452
|
case "week":
|
|
1453
1453
|
return /* @__PURE__ */ e(
|
|
1454
|
-
|
|
1454
|
+
lt,
|
|
1455
1455
|
{
|
|
1456
|
-
events:
|
|
1456
|
+
events: u,
|
|
1457
1457
|
date: b,
|
|
1458
|
-
visibleHours:
|
|
1458
|
+
visibleHours: U,
|
|
1459
1459
|
workingHours: W,
|
|
1460
1460
|
slotDuration: S,
|
|
1461
1461
|
badgeVariant: A,
|
|
1462
|
-
onEventClick:
|
|
1463
|
-
renderPopover:
|
|
1462
|
+
onEventClick: H,
|
|
1463
|
+
renderPopover: R,
|
|
1464
1464
|
...d && { slots: d },
|
|
1465
1465
|
...w && { classNames: w }
|
|
1466
1466
|
}
|
|
1467
1467
|
);
|
|
1468
1468
|
case "month":
|
|
1469
1469
|
return /* @__PURE__ */ e(
|
|
1470
|
-
|
|
1470
|
+
Me,
|
|
1471
1471
|
{
|
|
1472
|
-
events:
|
|
1472
|
+
events: u,
|
|
1473
1473
|
date: b,
|
|
1474
1474
|
badgeVariant: A,
|
|
1475
|
-
onEventClick:
|
|
1475
|
+
onEventClick: H,
|
|
1476
1476
|
onDayClick: l,
|
|
1477
|
-
renderPopover:
|
|
1477
|
+
renderPopover: R,
|
|
1478
1478
|
showMoreEventsInPopover: f,
|
|
1479
1479
|
...d && { slots: d },
|
|
1480
1480
|
...w && { classNames: w }
|
|
@@ -1482,11 +1482,11 @@ function Yt({
|
|
|
1482
1482
|
);
|
|
1483
1483
|
case "year":
|
|
1484
1484
|
return /* @__PURE__ */ e(
|
|
1485
|
-
|
|
1485
|
+
Kt,
|
|
1486
1486
|
{
|
|
1487
|
-
events:
|
|
1487
|
+
events: u,
|
|
1488
1488
|
year: b.getFullYear(),
|
|
1489
|
-
onMonthClick:
|
|
1489
|
+
onMonthClick: m,
|
|
1490
1490
|
onDayClick: l,
|
|
1491
1491
|
...d && { slots: d },
|
|
1492
1492
|
...w && { classNames: w }
|
|
@@ -1494,12 +1494,12 @@ function Yt({
|
|
|
1494
1494
|
);
|
|
1495
1495
|
case "agenda":
|
|
1496
1496
|
return /* @__PURE__ */ e(
|
|
1497
|
-
|
|
1497
|
+
at,
|
|
1498
1498
|
{
|
|
1499
|
-
events:
|
|
1499
|
+
events: u,
|
|
1500
1500
|
date: b,
|
|
1501
|
-
onEventClick:
|
|
1502
|
-
renderPopover:
|
|
1501
|
+
onEventClick: H,
|
|
1502
|
+
renderPopover: R,
|
|
1503
1503
|
...d && { slots: d },
|
|
1504
1504
|
...w && { classNames: w }
|
|
1505
1505
|
}
|
|
@@ -1507,116 +1507,136 @@ function Yt({
|
|
|
1507
1507
|
// Timeline views
|
|
1508
1508
|
case "timeline-day":
|
|
1509
1509
|
return /* @__PURE__ */ e(
|
|
1510
|
-
|
|
1510
|
+
be,
|
|
1511
1511
|
{
|
|
1512
1512
|
daysToShow: 1,
|
|
1513
|
-
events:
|
|
1514
|
-
users:
|
|
1513
|
+
events: u,
|
|
1514
|
+
users: Y,
|
|
1515
1515
|
selectedDate: b,
|
|
1516
1516
|
visibleHours: {
|
|
1517
|
-
from:
|
|
1518
|
-
to:
|
|
1517
|
+
from: L.startHour,
|
|
1518
|
+
to: L.endHour
|
|
1519
1519
|
},
|
|
1520
|
-
onEventClick:
|
|
1521
|
-
renderPopover:
|
|
1520
|
+
onEventClick: H,
|
|
1521
|
+
renderPopover: R,
|
|
1522
1522
|
...d && { slots: d },
|
|
1523
1523
|
...w && { classNames: w }
|
|
1524
1524
|
}
|
|
1525
1525
|
);
|
|
1526
1526
|
case "timeline-3day":
|
|
1527
1527
|
return /* @__PURE__ */ e(
|
|
1528
|
-
|
|
1528
|
+
be,
|
|
1529
1529
|
{
|
|
1530
1530
|
daysToShow: 3,
|
|
1531
|
-
events:
|
|
1532
|
-
users:
|
|
1531
|
+
events: u,
|
|
1532
|
+
users: Y,
|
|
1533
1533
|
selectedDate: b,
|
|
1534
1534
|
visibleHours: {
|
|
1535
|
-
from:
|
|
1536
|
-
to:
|
|
1535
|
+
from: L.startHour,
|
|
1536
|
+
to: L.endHour
|
|
1537
1537
|
},
|
|
1538
|
-
onEventClick:
|
|
1539
|
-
renderPopover:
|
|
1538
|
+
onEventClick: H,
|
|
1539
|
+
renderPopover: R,
|
|
1540
1540
|
...d && { slots: d },
|
|
1541
1541
|
...w && { classNames: w }
|
|
1542
1542
|
}
|
|
1543
1543
|
);
|
|
1544
1544
|
case "timeline-week":
|
|
1545
1545
|
return /* @__PURE__ */ e(
|
|
1546
|
-
|
|
1546
|
+
be,
|
|
1547
1547
|
{
|
|
1548
1548
|
daysToShow: 7,
|
|
1549
|
-
events:
|
|
1550
|
-
users:
|
|
1549
|
+
events: u,
|
|
1550
|
+
users: Y,
|
|
1551
1551
|
selectedDate: b,
|
|
1552
1552
|
visibleHours: {
|
|
1553
|
-
from:
|
|
1554
|
-
to:
|
|
1553
|
+
from: L.startHour,
|
|
1554
|
+
to: L.endHour
|
|
1555
1555
|
},
|
|
1556
|
-
onEventClick:
|
|
1557
|
-
renderPopover:
|
|
1556
|
+
onEventClick: H,
|
|
1557
|
+
renderPopover: R,
|
|
1558
1558
|
...d && { slots: d },
|
|
1559
1559
|
...w && { classNames: w }
|
|
1560
1560
|
}
|
|
1561
1561
|
);
|
|
1562
1562
|
default:
|
|
1563
1563
|
return /* @__PURE__ */ e(
|
|
1564
|
-
|
|
1564
|
+
Me,
|
|
1565
1565
|
{
|
|
1566
|
-
events:
|
|
1566
|
+
events: u,
|
|
1567
1567
|
date: b,
|
|
1568
1568
|
badgeVariant: A,
|
|
1569
|
-
onEventClick:
|
|
1569
|
+
onEventClick: H,
|
|
1570
1570
|
onDayClick: l,
|
|
1571
1571
|
...d && { slots: d },
|
|
1572
1572
|
...w && { classNames: w }
|
|
1573
1573
|
}
|
|
1574
1574
|
);
|
|
1575
1575
|
}
|
|
1576
|
-
}, D =
|
|
1577
|
-
|
|
1578
|
-
const
|
|
1579
|
-
if (!
|
|
1580
|
-
const
|
|
1581
|
-
const
|
|
1582
|
-
|
|
1576
|
+
}, D = Oe(null), [B, T] = q(!1), [P, Q] = q(null);
|
|
1577
|
+
ge(() => {
|
|
1578
|
+
const u = D.current;
|
|
1579
|
+
if (!u) return;
|
|
1580
|
+
const H = () => {
|
|
1581
|
+
for (const O of Array.from(u.children))
|
|
1582
|
+
if (O instanceof HTMLElement && O.scrollHeight > O.clientHeight + 2) {
|
|
1583
|
+
for (const oe of Array.from(O.children))
|
|
1584
|
+
if (oe instanceof HTMLElement && oe.scrollHeight > oe.clientHeight + 2)
|
|
1585
|
+
return oe;
|
|
1586
|
+
return O;
|
|
1587
|
+
}
|
|
1588
|
+
return null;
|
|
1589
|
+
}, R = () => {
|
|
1590
|
+
const { scrollLeft: O, scrollWidth: oe, clientWidth: pe } = u;
|
|
1591
|
+
T(O + pe < oe - 2);
|
|
1592
|
+
}, F = () => {
|
|
1593
|
+
const O = u.scrollHeight > u.clientHeight + 2 ? u : H();
|
|
1594
|
+
if (O) {
|
|
1595
|
+
const oe = u.getBoundingClientRect(), pe = O.getBoundingClientRect(), Xe = O.scrollTop + O.clientHeight / 2, Qe = pe.top - oe.top + Xe;
|
|
1596
|
+
Q(Qe);
|
|
1597
|
+
} else
|
|
1598
|
+
Q(null);
|
|
1599
|
+
}, K = () => {
|
|
1600
|
+
R(), F();
|
|
1583
1601
|
};
|
|
1584
|
-
|
|
1585
|
-
const
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1602
|
+
K(), u.addEventListener("scroll", K, { passive: !0 });
|
|
1603
|
+
const j = H();
|
|
1604
|
+
j && j !== u && j.addEventListener("scroll", F, { passive: !0 });
|
|
1605
|
+
const X = new ResizeObserver(K);
|
|
1606
|
+
X.observe(u);
|
|
1607
|
+
for (const O of Array.from(u.children))
|
|
1608
|
+
X.observe(O);
|
|
1589
1609
|
return () => {
|
|
1590
|
-
|
|
1610
|
+
u.removeEventListener("scroll", K), j && j !== u && j.removeEventListener("scroll", F), X.disconnect();
|
|
1591
1611
|
};
|
|
1592
1612
|
}, [p]);
|
|
1593
|
-
const
|
|
1613
|
+
const J = ae(() => {
|
|
1594
1614
|
D.current?.scrollBy({ left: 250, behavior: "smooth" });
|
|
1595
1615
|
}, []);
|
|
1596
1616
|
return /* @__PURE__ */ e(
|
|
1597
|
-
|
|
1617
|
+
ht,
|
|
1598
1618
|
{
|
|
1599
|
-
mode:
|
|
1619
|
+
mode: G,
|
|
1600
1620
|
onSelect: x,
|
|
1601
1621
|
minDurationMinutes: g,
|
|
1602
1622
|
slotDurationMinutes: S,
|
|
1603
1623
|
enabled: !!(s || r),
|
|
1604
|
-
children: /* @__PURE__ */ n("div", { className:
|
|
1605
|
-
|
|
1606
|
-
|
|
1624
|
+
children: /* @__PURE__ */ n("div", { className: h("inno-calendar-root flex flex-col h-full p-4", w?.root, i), children: [
|
|
1625
|
+
a && /* @__PURE__ */ e(
|
|
1626
|
+
it,
|
|
1607
1627
|
{
|
|
1608
1628
|
currentDate: b,
|
|
1609
1629
|
view: p,
|
|
1610
|
-
events:
|
|
1630
|
+
events: I,
|
|
1611
1631
|
onViewChange: y,
|
|
1612
1632
|
onNavigateToday: () => N(/* @__PURE__ */ new Date(), p),
|
|
1613
1633
|
onNavigatePrev: () => {
|
|
1614
|
-
const
|
|
1615
|
-
p === "day" || p === "timeline-day" ?
|
|
1634
|
+
const u = new Date(b);
|
|
1635
|
+
p === "day" || p === "timeline-day" ? u.setDate(u.getDate() - 1) : p === "timeline-3day" ? u.setDate(u.getDate() - 3) : p === "week" || p === "timeline-week" ? u.setDate(u.getDate() - 7) : p === "month" ? u.setMonth(u.getMonth() - 1) : p === "year" ? u.setFullYear(u.getFullYear() - 1) : u.setDate(u.getDate() - 7), N(u, p);
|
|
1616
1636
|
},
|
|
1617
1637
|
onNavigateNext: () => {
|
|
1618
|
-
const
|
|
1619
|
-
p === "day" || p === "timeline-day" ?
|
|
1638
|
+
const u = new Date(b);
|
|
1639
|
+
p === "day" || p === "timeline-day" ? u.setDate(u.getDate() + 1) : p === "timeline-3day" ? u.setDate(u.getDate() + 3) : p === "week" || p === "timeline-week" ? u.setDate(u.getDate() + 7) : p === "month" ? u.setMonth(u.getMonth() + 1) : p === "year" ? u.setFullYear(u.getFullYear() + 1) : u.setDate(u.getDate() + 7), N(u, p);
|
|
1620
1640
|
},
|
|
1621
1641
|
availableViews: [
|
|
1622
1642
|
"day",
|
|
@@ -1627,8 +1647,8 @@ function Yt({
|
|
|
1627
1647
|
],
|
|
1628
1648
|
showTimelineViews: !0,
|
|
1629
1649
|
showSettings: !!k,
|
|
1630
|
-
...!
|
|
1631
|
-
actions:
|
|
1650
|
+
...!z && o && { onAddEvent: o },
|
|
1651
|
+
actions: z,
|
|
1632
1652
|
settingsContent: k,
|
|
1633
1653
|
filterContent: M
|
|
1634
1654
|
}
|
|
@@ -1638,7 +1658,7 @@ function Yt({
|
|
|
1638
1658
|
"div",
|
|
1639
1659
|
{
|
|
1640
1660
|
ref: D,
|
|
1641
|
-
className:
|
|
1661
|
+
className: h(
|
|
1642
1662
|
"h-full border rounded-lg bg-white overflow-x-auto",
|
|
1643
1663
|
w?.viewContainer
|
|
1644
1664
|
),
|
|
@@ -1646,13 +1666,16 @@ function Yt({
|
|
|
1646
1666
|
}
|
|
1647
1667
|
),
|
|
1648
1668
|
c && /* @__PURE__ */ e("div", { className: "inno-calendar-loading-overlay", children: /* @__PURE__ */ e("div", { className: "inno-calendar-spinner" }) }),
|
|
1649
|
-
|
|
1669
|
+
B && /* @__PURE__ */ e(
|
|
1650
1670
|
"button",
|
|
1651
1671
|
{
|
|
1652
1672
|
type: "button",
|
|
1653
|
-
onClick:
|
|
1673
|
+
onClick: J,
|
|
1654
1674
|
className: "inno-scroll-right-btn",
|
|
1655
1675
|
"aria-label": "Scroll right",
|
|
1676
|
+
...P !== null && {
|
|
1677
|
+
style: { top: P, transform: "translateY(-50%)" }
|
|
1678
|
+
},
|
|
1656
1679
|
children: /* @__PURE__ */ e(
|
|
1657
1680
|
"svg",
|
|
1658
1681
|
{
|
|
@@ -1675,13 +1698,13 @@ function Yt({
|
|
|
1675
1698
|
}
|
|
1676
1699
|
);
|
|
1677
1700
|
}
|
|
1678
|
-
function
|
|
1701
|
+
function Gr({
|
|
1679
1702
|
events: t,
|
|
1680
1703
|
users: r = [],
|
|
1681
1704
|
scheduleTypes: s = [],
|
|
1682
1705
|
initialView: o = "week",
|
|
1683
|
-
initialDate:
|
|
1684
|
-
initialSelectedUserId:
|
|
1706
|
+
initialDate: i,
|
|
1707
|
+
initialSelectedUserId: a,
|
|
1685
1708
|
initialScheduleTypeIds: g,
|
|
1686
1709
|
initialParticipantIds: f,
|
|
1687
1710
|
initialWorkingHoursView: c,
|
|
@@ -1689,32 +1712,32 @@ function Rr({
|
|
|
1689
1712
|
preferencesConfig: w,
|
|
1690
1713
|
onEventClick: k,
|
|
1691
1714
|
onSlotClick: M,
|
|
1692
|
-
onSlotSelect:
|
|
1693
|
-
onAddEvent:
|
|
1715
|
+
onSlotSelect: z,
|
|
1716
|
+
onAddEvent: E,
|
|
1694
1717
|
onEventDrop: p,
|
|
1695
1718
|
onDateChange: y,
|
|
1696
1719
|
onViewChange: b,
|
|
1697
1720
|
className: N,
|
|
1698
1721
|
showHeader: S = !0,
|
|
1699
|
-
minSelectionMinutes:
|
|
1700
|
-
showMoreEventsInPopover:
|
|
1722
|
+
minSelectionMinutes: I = 30,
|
|
1723
|
+
showMoreEventsInPopover: Y = !1,
|
|
1701
1724
|
isLoading: _ = !1,
|
|
1702
1725
|
renderPopover: W,
|
|
1703
1726
|
slots: A,
|
|
1704
|
-
classNames:
|
|
1705
|
-
settingsContent:
|
|
1706
|
-
filterContent:
|
|
1707
|
-
headerActions:
|
|
1727
|
+
classNames: V,
|
|
1728
|
+
settingsContent: L,
|
|
1729
|
+
filterContent: U,
|
|
1730
|
+
headerActions: G
|
|
1708
1731
|
}) {
|
|
1709
|
-
return /* @__PURE__ */ e(
|
|
1710
|
-
|
|
1732
|
+
return /* @__PURE__ */ e(ut, { ...p && { onEventDrop: p }, children: /* @__PURE__ */ e(
|
|
1733
|
+
et,
|
|
1711
1734
|
{
|
|
1712
1735
|
initialEvents: t,
|
|
1713
1736
|
initialUsers: r,
|
|
1714
1737
|
initialScheduleTypes: s,
|
|
1715
1738
|
initialView: o,
|
|
1716
|
-
...
|
|
1717
|
-
...
|
|
1739
|
+
...i && { initialDate: i },
|
|
1740
|
+
...a && { initialSelectedUserId: a },
|
|
1718
1741
|
...g && { initialScheduleTypeIds: g },
|
|
1719
1742
|
...f && { initialParticipantIds: f },
|
|
1720
1743
|
...c && { initialWorkingHoursView: c },
|
|
@@ -1723,34 +1746,34 @@ function Rr({
|
|
|
1723
1746
|
...y && { onDateChange: y },
|
|
1724
1747
|
...b && { onViewChange: b },
|
|
1725
1748
|
children: /* @__PURE__ */ e(
|
|
1726
|
-
|
|
1749
|
+
Xt,
|
|
1727
1750
|
{
|
|
1728
1751
|
...k && { onEventClick: k },
|
|
1729
1752
|
...M && { onSlotClick: M },
|
|
1730
|
-
...
|
|
1731
|
-
...
|
|
1753
|
+
...z && { onSlotSelect: z },
|
|
1754
|
+
...E && { onAddEvent: E },
|
|
1732
1755
|
...W && { renderPopover: W },
|
|
1733
1756
|
className: N,
|
|
1734
1757
|
showHeader: S,
|
|
1735
|
-
minSelectionMinutes:
|
|
1736
|
-
showMoreEventsInPopover:
|
|
1758
|
+
minSelectionMinutes: I,
|
|
1759
|
+
showMoreEventsInPopover: Y,
|
|
1737
1760
|
isLoading: _,
|
|
1738
1761
|
...A && { slots: A },
|
|
1739
|
-
...
|
|
1740
|
-
settingsContent:
|
|
1741
|
-
filterContent:
|
|
1742
|
-
headerActions:
|
|
1762
|
+
...V && { classNames: V },
|
|
1763
|
+
settingsContent: L,
|
|
1764
|
+
filterContent: U,
|
|
1765
|
+
headerActions: G
|
|
1743
1766
|
}
|
|
1744
1767
|
)
|
|
1745
1768
|
}
|
|
1746
1769
|
) });
|
|
1747
1770
|
}
|
|
1748
|
-
const
|
|
1771
|
+
const se = Ce(
|
|
1749
1772
|
({ className: t, children: r, ...s }, o) => /* @__PURE__ */ e(
|
|
1750
1773
|
"select",
|
|
1751
1774
|
{
|
|
1752
1775
|
ref: o,
|
|
1753
|
-
className:
|
|
1776
|
+
className: h(
|
|
1754
1777
|
"flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm",
|
|
1755
1778
|
"ring-offset-background",
|
|
1756
1779
|
"focus:outline-none focus:ring-1 focus:ring-ring",
|
|
@@ -1763,20 +1786,20 @@ const q = ye(
|
|
|
1763
1786
|
}
|
|
1764
1787
|
)
|
|
1765
1788
|
);
|
|
1766
|
-
|
|
1767
|
-
const
|
|
1789
|
+
se.displayName = "Select";
|
|
1790
|
+
const Z = Ce(({ className: t, ...r }, s) => /* @__PURE__ */ e(
|
|
1768
1791
|
"label",
|
|
1769
1792
|
{
|
|
1770
1793
|
ref: s,
|
|
1771
|
-
className:
|
|
1794
|
+
className: h(
|
|
1772
1795
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
1773
1796
|
t
|
|
1774
1797
|
),
|
|
1775
1798
|
...r
|
|
1776
1799
|
}
|
|
1777
1800
|
));
|
|
1778
|
-
|
|
1779
|
-
function
|
|
1801
|
+
Z.displayName = "Label";
|
|
1802
|
+
function Qt({ className: t }) {
|
|
1780
1803
|
return /* @__PURE__ */ n(
|
|
1781
1804
|
"svg",
|
|
1782
1805
|
{
|
|
@@ -1798,7 +1821,7 @@ function Gt({ className: t }) {
|
|
|
1798
1821
|
}
|
|
1799
1822
|
);
|
|
1800
1823
|
}
|
|
1801
|
-
function
|
|
1824
|
+
function Zt({ className: t }) {
|
|
1802
1825
|
return /* @__PURE__ */ n(
|
|
1803
1826
|
"svg",
|
|
1804
1827
|
{
|
|
@@ -1819,50 +1842,50 @@ function Kt({ className: t }) {
|
|
|
1819
1842
|
}
|
|
1820
1843
|
);
|
|
1821
1844
|
}
|
|
1822
|
-
const
|
|
1845
|
+
const qt = [
|
|
1823
1846
|
{ value: 15, label: "15 minutes" },
|
|
1824
1847
|
{ value: 30, label: "30 minutes" },
|
|
1825
1848
|
{ value: 60, label: "1 hour" }
|
|
1826
1849
|
];
|
|
1827
|
-
function
|
|
1850
|
+
function Kr({
|
|
1828
1851
|
value: t,
|
|
1829
1852
|
onChange: r,
|
|
1830
1853
|
isLocked: s = !1,
|
|
1831
1854
|
className: o,
|
|
1832
|
-
labels:
|
|
1855
|
+
labels: i = {}
|
|
1833
1856
|
}) {
|
|
1834
|
-
const
|
|
1857
|
+
const a = {
|
|
1835
1858
|
title: "Slot duration",
|
|
1836
1859
|
lockedMessage: "This setting is locked by the administrator",
|
|
1837
1860
|
infoMessage: "Set the time slot duration for day and week calendar views.",
|
|
1838
|
-
...
|
|
1861
|
+
...i
|
|
1839
1862
|
}, g = (f) => {
|
|
1840
1863
|
s || r(Number(f.target.value));
|
|
1841
1864
|
};
|
|
1842
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1865
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-3", o), children: [
|
|
1843
1866
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1844
|
-
/* @__PURE__ */ e(
|
|
1845
|
-
s ? /* @__PURE__ */ e(
|
|
1846
|
-
/* @__PURE__ */ e(
|
|
1847
|
-
/* @__PURE__ */ e(
|
|
1848
|
-
] }) }) : /* @__PURE__ */ e(
|
|
1849
|
-
/* @__PURE__ */ e(
|
|
1850
|
-
/* @__PURE__ */ e(
|
|
1867
|
+
/* @__PURE__ */ e(Z, { className: "text-sm font-semibold", children: a.title }),
|
|
1868
|
+
s ? /* @__PURE__ */ e(ee, { delayDuration: 100, children: /* @__PURE__ */ n(te, { children: [
|
|
1869
|
+
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(Zt, { className: "size-3 text-muted-foreground" }) }),
|
|
1870
|
+
/* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e("p", { children: a.lockedMessage }) })
|
|
1871
|
+
] }) }) : /* @__PURE__ */ e(ee, { delayDuration: 100, children: /* @__PURE__ */ n(te, { children: [
|
|
1872
|
+
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(Qt, { className: "size-3 text-muted-foreground" }) }),
|
|
1873
|
+
/* @__PURE__ */ e(ne, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: a.infoMessage }) })
|
|
1851
1874
|
] }) })
|
|
1852
1875
|
] }),
|
|
1853
1876
|
/* @__PURE__ */ e(
|
|
1854
|
-
|
|
1877
|
+
se,
|
|
1855
1878
|
{
|
|
1856
1879
|
value: t.toString(),
|
|
1857
1880
|
onChange: g,
|
|
1858
1881
|
disabled: s,
|
|
1859
1882
|
className: "h-9 w-[128px] text-sm",
|
|
1860
|
-
children:
|
|
1883
|
+
children: qt.map((f) => /* @__PURE__ */ e("option", { value: f.value.toString(), children: f.label }, f.value))
|
|
1861
1884
|
}
|
|
1862
1885
|
)
|
|
1863
1886
|
] });
|
|
1864
1887
|
}
|
|
1865
|
-
function
|
|
1888
|
+
function er({ className: t }) {
|
|
1866
1889
|
return /* @__PURE__ */ n(
|
|
1867
1890
|
"svg",
|
|
1868
1891
|
{
|
|
@@ -1884,7 +1907,7 @@ function Xt({ className: t }) {
|
|
|
1884
1907
|
}
|
|
1885
1908
|
);
|
|
1886
1909
|
}
|
|
1887
|
-
function
|
|
1910
|
+
function tr({ className: t }) {
|
|
1888
1911
|
return /* @__PURE__ */ n(
|
|
1889
1912
|
"svg",
|
|
1890
1913
|
{
|
|
@@ -1905,19 +1928,19 @@ function Qt({ className: t }) {
|
|
|
1905
1928
|
}
|
|
1906
1929
|
);
|
|
1907
1930
|
}
|
|
1908
|
-
const
|
|
1931
|
+
const rr = [
|
|
1909
1932
|
{ value: "dot", label: "Dot indicator" },
|
|
1910
1933
|
{ value: "colored", label: "Full color" },
|
|
1911
1934
|
{ value: "mixed", label: "Mixed" }
|
|
1912
1935
|
];
|
|
1913
|
-
function
|
|
1936
|
+
function Jr({
|
|
1914
1937
|
value: t,
|
|
1915
1938
|
onChange: r,
|
|
1916
1939
|
isLocked: s = !1,
|
|
1917
1940
|
className: o,
|
|
1918
|
-
labels:
|
|
1941
|
+
labels: i = {}
|
|
1919
1942
|
}) {
|
|
1920
|
-
const
|
|
1943
|
+
const a = {
|
|
1921
1944
|
title: "Event display",
|
|
1922
1945
|
lockedMessage: "This setting is locked by the administrator",
|
|
1923
1946
|
infoMessage: "Choose how events are displayed. Dot shows a small indicator, colored fills the entire event, mixed uses both.",
|
|
@@ -1926,34 +1949,34 @@ function Ur({
|
|
|
1926
1949
|
colored: "Full color",
|
|
1927
1950
|
mixed: "Mixed"
|
|
1928
1951
|
},
|
|
1929
|
-
...
|
|
1930
|
-
}, g = (c) =>
|
|
1952
|
+
...i
|
|
1953
|
+
}, g = (c) => a.options?.[c] ?? c, f = (c) => {
|
|
1931
1954
|
s || r(c.target.value);
|
|
1932
1955
|
};
|
|
1933
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1956
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-3", o), children: [
|
|
1934
1957
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1935
|
-
/* @__PURE__ */ e(
|
|
1936
|
-
s ? /* @__PURE__ */ e(
|
|
1937
|
-
/* @__PURE__ */ e(
|
|
1938
|
-
/* @__PURE__ */ e(
|
|
1939
|
-
] }) }) : /* @__PURE__ */ e(
|
|
1940
|
-
/* @__PURE__ */ e(
|
|
1941
|
-
/* @__PURE__ */ e(
|
|
1958
|
+
/* @__PURE__ */ e(Z, { className: "text-sm font-semibold", children: a.title }),
|
|
1959
|
+
s ? /* @__PURE__ */ e(ee, { delayDuration: 100, children: /* @__PURE__ */ n(te, { children: [
|
|
1960
|
+
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(tr, { className: "size-3 text-muted-foreground" }) }),
|
|
1961
|
+
/* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e("p", { children: a.lockedMessage }) })
|
|
1962
|
+
] }) }) : /* @__PURE__ */ e(ee, { delayDuration: 100, children: /* @__PURE__ */ n(te, { children: [
|
|
1963
|
+
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(er, { className: "size-3 text-muted-foreground" }) }),
|
|
1964
|
+
/* @__PURE__ */ e(ne, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: a.infoMessage }) })
|
|
1942
1965
|
] }) })
|
|
1943
1966
|
] }),
|
|
1944
1967
|
/* @__PURE__ */ e(
|
|
1945
|
-
|
|
1968
|
+
se,
|
|
1946
1969
|
{
|
|
1947
1970
|
value: t,
|
|
1948
1971
|
onChange: f,
|
|
1949
1972
|
disabled: s,
|
|
1950
1973
|
className: "h-9 w-[128px] text-sm",
|
|
1951
|
-
children:
|
|
1974
|
+
children: rr.map((c) => /* @__PURE__ */ e("option", { value: c.value, children: g(c.value) }, c.value))
|
|
1952
1975
|
}
|
|
1953
1976
|
)
|
|
1954
1977
|
] });
|
|
1955
1978
|
}
|
|
1956
|
-
function
|
|
1979
|
+
function nr({ className: t }) {
|
|
1957
1980
|
return /* @__PURE__ */ n(
|
|
1958
1981
|
"svg",
|
|
1959
1982
|
{
|
|
@@ -1975,7 +1998,7 @@ function qt({ className: t }) {
|
|
|
1975
1998
|
}
|
|
1976
1999
|
);
|
|
1977
2000
|
}
|
|
1978
|
-
function
|
|
2001
|
+
function sr({ className: t }) {
|
|
1979
2002
|
return /* @__PURE__ */ n(
|
|
1980
2003
|
"svg",
|
|
1981
2004
|
{
|
|
@@ -1996,27 +2019,27 @@ function er({ className: t }) {
|
|
|
1996
2019
|
}
|
|
1997
2020
|
);
|
|
1998
2021
|
}
|
|
1999
|
-
function
|
|
2022
|
+
function or() {
|
|
2000
2023
|
return Array.from({ length: 25 }, (t, r) => ({
|
|
2001
2024
|
value: r,
|
|
2002
2025
|
label: `${String(r).padStart(2, "0")}:00`
|
|
2003
2026
|
}));
|
|
2004
2027
|
}
|
|
2005
|
-
function
|
|
2028
|
+
function Xr({
|
|
2006
2029
|
value: t,
|
|
2007
2030
|
onChange: r,
|
|
2008
2031
|
isLocked: s = !1,
|
|
2009
2032
|
className: o,
|
|
2010
|
-
labels:
|
|
2033
|
+
labels: i = {}
|
|
2011
2034
|
}) {
|
|
2012
|
-
const
|
|
2035
|
+
const a = {
|
|
2013
2036
|
title: "Visible hours",
|
|
2014
2037
|
from: "From",
|
|
2015
2038
|
to: "To",
|
|
2016
2039
|
lockedMessage: "This setting is locked by the administrator",
|
|
2017
2040
|
infoMessage: "Set the visible hour range for day and week views. Hours outside this range will be hidden.",
|
|
2018
|
-
...
|
|
2019
|
-
}, g =
|
|
2041
|
+
...i
|
|
2042
|
+
}, g = or(), f = (d) => {
|
|
2020
2043
|
if (s) return;
|
|
2021
2044
|
const w = Number(d.target.value);
|
|
2022
2045
|
w < t.endHour && r({ ...t, startHour: w });
|
|
@@ -2025,22 +2048,22 @@ function Yr({
|
|
|
2025
2048
|
const w = Number(d.target.value);
|
|
2026
2049
|
w > t.startHour && r({ ...t, endHour: w });
|
|
2027
2050
|
};
|
|
2028
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2051
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-3", o), children: [
|
|
2029
2052
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2030
|
-
/* @__PURE__ */ e(
|
|
2031
|
-
s ? /* @__PURE__ */ e(
|
|
2032
|
-
/* @__PURE__ */ e(
|
|
2033
|
-
/* @__PURE__ */ e(
|
|
2034
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2035
|
-
/* @__PURE__ */ e(
|
|
2036
|
-
/* @__PURE__ */ e(
|
|
2053
|
+
/* @__PURE__ */ e(Z, { className: "text-sm font-semibold", children: a.title }),
|
|
2054
|
+
s ? /* @__PURE__ */ e(ee, { delayDuration: 100, children: /* @__PURE__ */ n(te, { children: [
|
|
2055
|
+
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(sr, { className: "size-3 text-muted-foreground" }) }),
|
|
2056
|
+
/* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e("p", { children: a.lockedMessage }) })
|
|
2057
|
+
] }) }) : /* @__PURE__ */ e(ee, { delayDuration: 100, children: /* @__PURE__ */ n(te, { children: [
|
|
2058
|
+
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(nr, { className: "size-3 text-muted-foreground" }) }),
|
|
2059
|
+
/* @__PURE__ */ e(ne, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: a.infoMessage }) })
|
|
2037
2060
|
] }) })
|
|
2038
2061
|
] }),
|
|
2039
2062
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2040
2063
|
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
2041
|
-
/* @__PURE__ */ e(
|
|
2064
|
+
/* @__PURE__ */ e(Z, { className: "text-xs text-muted-foreground", children: a.from }),
|
|
2042
2065
|
/* @__PURE__ */ e(
|
|
2043
|
-
|
|
2066
|
+
se,
|
|
2044
2067
|
{
|
|
2045
2068
|
value: t.startHour.toString(),
|
|
2046
2069
|
onChange: f,
|
|
@@ -2060,9 +2083,9 @@ function Yr({
|
|
|
2060
2083
|
] }),
|
|
2061
2084
|
/* @__PURE__ */ e("span", { className: "mt-5 text-muted-foreground", children: "—" }),
|
|
2062
2085
|
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
2063
|
-
/* @__PURE__ */ e(
|
|
2086
|
+
/* @__PURE__ */ e(Z, { className: "text-xs text-muted-foreground", children: a.to }),
|
|
2064
2087
|
/* @__PURE__ */ e(
|
|
2065
|
-
|
|
2088
|
+
se,
|
|
2066
2089
|
{
|
|
2067
2090
|
value: t.endHour.toString(),
|
|
2068
2091
|
onChange: c,
|
|
@@ -2083,7 +2106,7 @@ function Yr({
|
|
|
2083
2106
|
] })
|
|
2084
2107
|
] });
|
|
2085
2108
|
}
|
|
2086
|
-
function
|
|
2109
|
+
function ir({ className: t }) {
|
|
2087
2110
|
return /* @__PURE__ */ n(
|
|
2088
2111
|
"svg",
|
|
2089
2112
|
{
|
|
@@ -2105,7 +2128,7 @@ function rr({ className: t }) {
|
|
|
2105
2128
|
}
|
|
2106
2129
|
);
|
|
2107
2130
|
}
|
|
2108
|
-
function
|
|
2131
|
+
function ar({ className: t }) {
|
|
2109
2132
|
return /* @__PURE__ */ n(
|
|
2110
2133
|
"svg",
|
|
2111
2134
|
{
|
|
@@ -2126,7 +2149,7 @@ function nr({ className: t }) {
|
|
|
2126
2149
|
}
|
|
2127
2150
|
);
|
|
2128
2151
|
}
|
|
2129
|
-
function
|
|
2152
|
+
function lr({ className: t }) {
|
|
2130
2153
|
return /* @__PURE__ */ e(
|
|
2131
2154
|
"svg",
|
|
2132
2155
|
{
|
|
@@ -2144,7 +2167,7 @@ function sr({ className: t }) {
|
|
|
2144
2167
|
}
|
|
2145
2168
|
);
|
|
2146
2169
|
}
|
|
2147
|
-
const
|
|
2170
|
+
const cr = [
|
|
2148
2171
|
"monday",
|
|
2149
2172
|
"tuesday",
|
|
2150
2173
|
"wednesday",
|
|
@@ -2153,13 +2176,13 @@ const or = [
|
|
|
2153
2176
|
"saturday",
|
|
2154
2177
|
"sunday"
|
|
2155
2178
|
];
|
|
2156
|
-
function
|
|
2179
|
+
function dr() {
|
|
2157
2180
|
return Array.from({ length: 25 }, (t, r) => ({
|
|
2158
2181
|
value: r,
|
|
2159
2182
|
label: `${String(r).padStart(2, "0")}:00`
|
|
2160
2183
|
}));
|
|
2161
2184
|
}
|
|
2162
|
-
const
|
|
2185
|
+
const Ae = {
|
|
2163
2186
|
sunday: "Sun",
|
|
2164
2187
|
monday: "Mon",
|
|
2165
2188
|
tuesday: "Tue",
|
|
@@ -2168,8 +2191,8 @@ const Ie = {
|
|
|
2168
2191
|
friday: "Fri",
|
|
2169
2192
|
saturday: "Sat"
|
|
2170
2193
|
};
|
|
2171
|
-
function
|
|
2172
|
-
const
|
|
2194
|
+
function ur({ dayLabel: t, config: r, onChange: s, disabled: o, hourOptions: i }) {
|
|
2195
|
+
const a = () => {
|
|
2173
2196
|
o || s({ ...r, enabled: !r.enabled });
|
|
2174
2197
|
}, g = (c) => {
|
|
2175
2198
|
if (o) return;
|
|
@@ -2188,71 +2211,71 @@ function ir({ dayLabel: t, config: r, onChange: s, disabled: o, hourOptions: a }
|
|
|
2188
2211
|
role: "checkbox",
|
|
2189
2212
|
"aria-checked": r.enabled,
|
|
2190
2213
|
"aria-label": `Enable ${t}`,
|
|
2191
|
-
onClick:
|
|
2214
|
+
onClick: a,
|
|
2192
2215
|
disabled: o,
|
|
2193
|
-
className:
|
|
2216
|
+
className: h(
|
|
2194
2217
|
"flex size-5 shrink-0 items-center justify-center rounded border transition-colors",
|
|
2195
2218
|
r.enabled ? "border-primary bg-primary text-primary-foreground" : "border-input bg-background",
|
|
2196
2219
|
o && "cursor-not-allowed opacity-50"
|
|
2197
2220
|
),
|
|
2198
|
-
children: r.enabled && /* @__PURE__ */ e(
|
|
2221
|
+
children: r.enabled && /* @__PURE__ */ e(lr, { className: "size-3" })
|
|
2199
2222
|
}
|
|
2200
2223
|
),
|
|
2201
|
-
/* @__PURE__ */ e("span", { className:
|
|
2224
|
+
/* @__PURE__ */ e("span", { className: h("w-10 text-sm", !r.enabled && "text-muted-foreground"), children: t }),
|
|
2202
2225
|
/* @__PURE__ */ e(
|
|
2203
|
-
|
|
2226
|
+
se,
|
|
2204
2227
|
{
|
|
2205
2228
|
value: r.from.toString(),
|
|
2206
2229
|
onChange: g,
|
|
2207
2230
|
disabled: o || !r.enabled,
|
|
2208
2231
|
className: "h-8 w-[76px] text-xs",
|
|
2209
|
-
children:
|
|
2232
|
+
children: i.map((c) => /* @__PURE__ */ e("option", { value: c.value.toString(), disabled: c.value >= r.to, children: c.label }, c.value))
|
|
2210
2233
|
}
|
|
2211
2234
|
),
|
|
2212
2235
|
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "—" }),
|
|
2213
2236
|
/* @__PURE__ */ e(
|
|
2214
|
-
|
|
2237
|
+
se,
|
|
2215
2238
|
{
|
|
2216
2239
|
value: r.to.toString(),
|
|
2217
2240
|
onChange: f,
|
|
2218
2241
|
disabled: o || !r.enabled,
|
|
2219
2242
|
className: "h-8 w-[76px] text-xs",
|
|
2220
|
-
children:
|
|
2243
|
+
children: i.map((c) => /* @__PURE__ */ e("option", { value: c.value.toString(), disabled: c.value <= r.from, children: c.label }, c.value))
|
|
2221
2244
|
}
|
|
2222
2245
|
)
|
|
2223
2246
|
] });
|
|
2224
2247
|
}
|
|
2225
|
-
function
|
|
2248
|
+
function Qr({
|
|
2226
2249
|
value: t,
|
|
2227
2250
|
onChange: r,
|
|
2228
2251
|
isLocked: s = !1,
|
|
2229
2252
|
className: o,
|
|
2230
|
-
labels:
|
|
2253
|
+
labels: i = {}
|
|
2231
2254
|
}) {
|
|
2232
|
-
const
|
|
2255
|
+
const a = {
|
|
2233
2256
|
title: "Working hours",
|
|
2234
2257
|
lockedMessage: "This setting is locked by the administrator",
|
|
2235
2258
|
infoMessage: "Configure working hours for each day of the week. Non-working hours will be grayed out in day and week views.",
|
|
2236
|
-
days:
|
|
2237
|
-
...
|
|
2238
|
-
}, g =
|
|
2259
|
+
days: Ae,
|
|
2260
|
+
...i
|
|
2261
|
+
}, g = dr(), f = (c, d) => {
|
|
2239
2262
|
s || r({ ...t, [c]: d });
|
|
2240
2263
|
};
|
|
2241
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2264
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-3", o), children: [
|
|
2242
2265
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2243
|
-
/* @__PURE__ */ e(
|
|
2244
|
-
s ? /* @__PURE__ */ e(
|
|
2245
|
-
/* @__PURE__ */ e(
|
|
2246
|
-
/* @__PURE__ */ e(
|
|
2247
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2248
|
-
/* @__PURE__ */ e(
|
|
2249
|
-
/* @__PURE__ */ e(
|
|
2266
|
+
/* @__PURE__ */ e(Z, { className: "text-sm font-semibold", children: a.title }),
|
|
2267
|
+
s ? /* @__PURE__ */ e(ee, { delayDuration: 100, children: /* @__PURE__ */ n(te, { children: [
|
|
2268
|
+
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(ar, { className: "size-3 text-muted-foreground" }) }),
|
|
2269
|
+
/* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e("p", { children: a.lockedMessage }) })
|
|
2270
|
+
] }) }) : /* @__PURE__ */ e(ee, { delayDuration: 100, children: /* @__PURE__ */ n(te, { children: [
|
|
2271
|
+
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(ir, { className: "size-3 text-muted-foreground" }) }),
|
|
2272
|
+
/* @__PURE__ */ e(ne, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: a.infoMessage }) })
|
|
2250
2273
|
] }) })
|
|
2251
2274
|
] }),
|
|
2252
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children:
|
|
2253
|
-
|
|
2275
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: cr.map((c) => /* @__PURE__ */ e(
|
|
2276
|
+
ur,
|
|
2254
2277
|
{
|
|
2255
|
-
dayLabel:
|
|
2278
|
+
dayLabel: a.days?.[c] ?? Ae[c],
|
|
2256
2279
|
config: t[c],
|
|
2257
2280
|
onChange: (d) => f(c, d),
|
|
2258
2281
|
disabled: s,
|
|
@@ -2262,7 +2285,7 @@ function Gr({
|
|
|
2262
2285
|
)) })
|
|
2263
2286
|
] });
|
|
2264
2287
|
}
|
|
2265
|
-
const
|
|
2288
|
+
const Zr = {
|
|
2266
2289
|
sunday: { enabled: !1, from: 8, to: 18 },
|
|
2267
2290
|
monday: { enabled: !0, from: 8, to: 18 },
|
|
2268
2291
|
tuesday: { enabled: !0, from: 8, to: 18 },
|
|
@@ -2271,7 +2294,7 @@ const Kr = {
|
|
|
2271
2294
|
friday: { enabled: !0, from: 8, to: 18 },
|
|
2272
2295
|
saturday: { enabled: !1, from: 8, to: 18 }
|
|
2273
2296
|
};
|
|
2274
|
-
function
|
|
2297
|
+
function ye({ className: t }) {
|
|
2275
2298
|
return /* @__PURE__ */ e(
|
|
2276
2299
|
"svg",
|
|
2277
2300
|
{
|
|
@@ -2287,7 +2310,7 @@ function ve({ className: t }) {
|
|
|
2287
2310
|
}
|
|
2288
2311
|
);
|
|
2289
2312
|
}
|
|
2290
|
-
function
|
|
2313
|
+
function hr({ className: t }) {
|
|
2291
2314
|
return /* @__PURE__ */ n(
|
|
2292
2315
|
"svg",
|
|
2293
2316
|
{
|
|
@@ -2306,7 +2329,7 @@ function lr({ className: t }) {
|
|
|
2306
2329
|
}
|
|
2307
2330
|
);
|
|
2308
2331
|
}
|
|
2309
|
-
function
|
|
2332
|
+
function mr({ className: t }) {
|
|
2310
2333
|
return /* @__PURE__ */ n(
|
|
2311
2334
|
"svg",
|
|
2312
2335
|
{
|
|
@@ -2325,7 +2348,7 @@ function cr({ className: t }) {
|
|
|
2325
2348
|
}
|
|
2326
2349
|
);
|
|
2327
2350
|
}
|
|
2328
|
-
function
|
|
2351
|
+
function ke({ checked: t, onCheckedChange: r, className: s, children: o }) {
|
|
2329
2352
|
return /* @__PURE__ */ e(
|
|
2330
2353
|
"button",
|
|
2331
2354
|
{
|
|
@@ -2338,12 +2361,12 @@ function we({ checked: t, onCheckedChange: r, className: s, children: o }) {
|
|
|
2338
2361
|
}
|
|
2339
2362
|
);
|
|
2340
2363
|
}
|
|
2341
|
-
function
|
|
2342
|
-
const [
|
|
2343
|
-
return !t ||
|
|
2364
|
+
function fr({ src: t, alt: r, fallback: s, className: o }) {
|
|
2365
|
+
const [i, a] = q(!1);
|
|
2366
|
+
return !t || i ? /* @__PURE__ */ e(
|
|
2344
2367
|
"div",
|
|
2345
2368
|
{
|
|
2346
|
-
className:
|
|
2369
|
+
className: h(
|
|
2347
2370
|
"flex items-center justify-center bg-zinc-200 text-zinc-600 font-medium text-sm",
|
|
2348
2371
|
o
|
|
2349
2372
|
),
|
|
@@ -2354,32 +2377,32 @@ function dr({ src: t, alt: r, fallback: s, className: o }) {
|
|
|
2354
2377
|
{
|
|
2355
2378
|
src: t,
|
|
2356
2379
|
alt: r || "",
|
|
2357
|
-
className:
|
|
2358
|
-
onError: () =>
|
|
2380
|
+
className: h("object-cover", o),
|
|
2381
|
+
onError: () => a(!0)
|
|
2359
2382
|
}
|
|
2360
2383
|
);
|
|
2361
2384
|
}
|
|
2362
|
-
function
|
|
2363
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2364
|
-
/* @__PURE__ */ e(
|
|
2385
|
+
function Be({ value: t, onChange: r, placeholder: s, className: o }) {
|
|
2386
|
+
return /* @__PURE__ */ n("div", { className: h("relative", o), children: [
|
|
2387
|
+
/* @__PURE__ */ e(hr, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
2365
2388
|
/* @__PURE__ */ e(
|
|
2366
2389
|
"input",
|
|
2367
2390
|
{
|
|
2368
2391
|
type: "text",
|
|
2369
2392
|
value: t,
|
|
2370
|
-
onChange: (
|
|
2393
|
+
onChange: (i) => r(i.target.value),
|
|
2371
2394
|
placeholder: s,
|
|
2372
2395
|
className: "h-9 w-full rounded-lg border border-border bg-white pl-9 pr-3 text-sm placeholder:text-muted-foreground focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"
|
|
2373
2396
|
}
|
|
2374
2397
|
)
|
|
2375
2398
|
] });
|
|
2376
2399
|
}
|
|
2377
|
-
function
|
|
2400
|
+
function $e(t, r, s, o = 0.3) {
|
|
2378
2401
|
if (!r.trim()) return t;
|
|
2379
|
-
const
|
|
2380
|
-
return t.filter((
|
|
2402
|
+
const i = r.toLowerCase();
|
|
2403
|
+
return t.filter((a) => s(a).some((f) => f ? f.toLowerCase().includes(i) : !1));
|
|
2381
2404
|
}
|
|
2382
|
-
const
|
|
2405
|
+
const gr = {
|
|
2383
2406
|
title: "Filters",
|
|
2384
2407
|
subtitle: "Filter calendar events",
|
|
2385
2408
|
scheduleTypes: "Event Types",
|
|
@@ -2392,13 +2415,13 @@ const ur = {
|
|
|
2392
2415
|
noScheduleTypes: "No event types found",
|
|
2393
2416
|
noParticipants: "No participants found"
|
|
2394
2417
|
};
|
|
2395
|
-
function
|
|
2418
|
+
function qr({
|
|
2396
2419
|
scheduleTypes: t,
|
|
2397
2420
|
users: r,
|
|
2398
2421
|
selectedScheduleTypeIds: s,
|
|
2399
2422
|
onScheduleTypeChange: o,
|
|
2400
|
-
selectedUserIds:
|
|
2401
|
-
onUserChange:
|
|
2423
|
+
selectedUserIds: i,
|
|
2424
|
+
onUserChange: a,
|
|
2402
2425
|
onClearAll: g,
|
|
2403
2426
|
className: f,
|
|
2404
2427
|
scheduleTypesLoading: c = !1,
|
|
@@ -2406,12 +2429,12 @@ function Jr({
|
|
|
2406
2429
|
labels: w,
|
|
2407
2430
|
getScheduleTypeName: k
|
|
2408
2431
|
}) {
|
|
2409
|
-
const M = { ...
|
|
2432
|
+
const M = { ...gr, ...w }, [z, E] = q(""), [p, y] = q(""), b = $(() => z.trim() ? $e(t, z, (x) => [
|
|
2410
2433
|
x.name,
|
|
2411
2434
|
k?.(x) || x.name
|
|
2412
|
-
]) : t, [t,
|
|
2413
|
-
const
|
|
2414
|
-
o(
|
|
2435
|
+
]) : t, [t, z, k]), N = $(() => p.trim() ? $e(r, p, (x) => [x.name, x.email || ""]) : r, [r, p]), S = b.length > 0 && b.every((x) => s.includes(x.id)), I = N.length > 0 && N.every((x) => i.includes(x.id)), Y = s.length + i.length, _ = (x, l) => {
|
|
2436
|
+
const m = l ? [...s, x] : s.filter((v) => v !== x);
|
|
2437
|
+
o(m);
|
|
2415
2438
|
}, W = () => {
|
|
2416
2439
|
if (S) {
|
|
2417
2440
|
const x = new Set(b.map((l) => l.id));
|
|
@@ -2424,23 +2447,23 @@ function Jr({
|
|
|
2424
2447
|
o(Array.from(x));
|
|
2425
2448
|
}
|
|
2426
2449
|
}, A = (x, l) => {
|
|
2427
|
-
const
|
|
2428
|
-
|
|
2429
|
-
},
|
|
2430
|
-
if (
|
|
2450
|
+
const m = l ? [...i, x] : i.filter((v) => v !== x);
|
|
2451
|
+
a(m);
|
|
2452
|
+
}, V = () => {
|
|
2453
|
+
if (I) {
|
|
2431
2454
|
const x = new Set(N.map((l) => l.id));
|
|
2432
|
-
i
|
|
2455
|
+
a(i.filter((l) => !x.has(l)));
|
|
2433
2456
|
} else {
|
|
2434
|
-
const x = /* @__PURE__ */ new Set([...
|
|
2435
|
-
|
|
2457
|
+
const x = /* @__PURE__ */ new Set([...i, ...N.map((l) => l.id)]);
|
|
2458
|
+
a(Array.from(x));
|
|
2436
2459
|
}
|
|
2437
|
-
},
|
|
2438
|
-
o([]),
|
|
2439
|
-
},
|
|
2460
|
+
}, L = () => {
|
|
2461
|
+
o([]), a([]), g?.();
|
|
2462
|
+
}, U = (x) => k ? k(x) : x.name, G = (x) => x.colorHex || x.color || "#069AD7";
|
|
2440
2463
|
return /* @__PURE__ */ n(
|
|
2441
2464
|
"div",
|
|
2442
2465
|
{
|
|
2443
|
-
className:
|
|
2466
|
+
className: h(
|
|
2444
2467
|
"flex min-w-72 max-w-72 flex-col rounded-lg border bg-white shadow-sm",
|
|
2445
2468
|
f
|
|
2446
2469
|
),
|
|
@@ -2450,14 +2473,14 @@ function Jr({
|
|
|
2450
2473
|
/* @__PURE__ */ e("h3", { className: "text-base font-semibold text-foreground", children: M.title }),
|
|
2451
2474
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: M.subtitle })
|
|
2452
2475
|
] }),
|
|
2453
|
-
|
|
2476
|
+
Y > 0 && /* @__PURE__ */ n(
|
|
2454
2477
|
"button",
|
|
2455
2478
|
{
|
|
2456
2479
|
type: "button",
|
|
2457
|
-
onClick:
|
|
2480
|
+
onClick: L,
|
|
2458
2481
|
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",
|
|
2459
2482
|
children: [
|
|
2460
|
-
/* @__PURE__ */ e(
|
|
2483
|
+
/* @__PURE__ */ e(mr, { className: "h-3.5 w-3.5" }),
|
|
2461
2484
|
M.clearAll
|
|
2462
2485
|
]
|
|
2463
2486
|
}
|
|
@@ -2478,10 +2501,10 @@ function Jr({
|
|
|
2478
2501
|
)
|
|
2479
2502
|
] }),
|
|
2480
2503
|
t.length > 6 && /* @__PURE__ */ e("div", { className: "px-4 pb-3", children: /* @__PURE__ */ e(
|
|
2481
|
-
|
|
2504
|
+
Be,
|
|
2482
2505
|
{
|
|
2483
|
-
value:
|
|
2484
|
-
onChange:
|
|
2506
|
+
value: z,
|
|
2507
|
+
onChange: E,
|
|
2485
2508
|
placeholder: M.searchScheduleTypes
|
|
2486
2509
|
}
|
|
2487
2510
|
) }),
|
|
@@ -2500,13 +2523,13 @@ function Jr({
|
|
|
2500
2523
|
`skeleton-${l}`
|
|
2501
2524
|
))
|
|
2502
2525
|
) : b.map((x) => {
|
|
2503
|
-
const l = s.includes(x.id),
|
|
2526
|
+
const l = s.includes(x.id), m = G(x);
|
|
2504
2527
|
return /* @__PURE__ */ n(
|
|
2505
|
-
|
|
2528
|
+
ke,
|
|
2506
2529
|
{
|
|
2507
2530
|
checked: l,
|
|
2508
2531
|
onCheckedChange: (v) => _(x.id, v),
|
|
2509
|
-
className:
|
|
2532
|
+
className: h(
|
|
2510
2533
|
"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",
|
|
2511
2534
|
l && "border-primary bg-primary/5"
|
|
2512
2535
|
),
|
|
@@ -2515,22 +2538,22 @@ function Jr({
|
|
|
2515
2538
|
/* @__PURE__ */ e(
|
|
2516
2539
|
"span",
|
|
2517
2540
|
{
|
|
2518
|
-
className:
|
|
2541
|
+
className: h(
|
|
2519
2542
|
"flex h-4 w-4 items-center justify-center rounded border border-border text-xs transition-colors",
|
|
2520
2543
|
l && "border-primary bg-primary text-primary-foreground"
|
|
2521
2544
|
),
|
|
2522
|
-
children: l && /* @__PURE__ */ e(
|
|
2545
|
+
children: l && /* @__PURE__ */ e(ye, { className: "h-3 w-3" })
|
|
2523
2546
|
}
|
|
2524
2547
|
),
|
|
2525
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children:
|
|
2548
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: U(x) })
|
|
2526
2549
|
] }),
|
|
2527
2550
|
/* @__PURE__ */ e(
|
|
2528
2551
|
"div",
|
|
2529
2552
|
{
|
|
2530
2553
|
className: "h-4 w-4 rounded-full border",
|
|
2531
2554
|
style: {
|
|
2532
|
-
backgroundColor:
|
|
2533
|
-
borderColor:
|
|
2555
|
+
backgroundColor: m,
|
|
2556
|
+
borderColor: m
|
|
2534
2557
|
}
|
|
2535
2558
|
}
|
|
2536
2559
|
)
|
|
@@ -2547,20 +2570,20 @@ function Jr({
|
|
|
2547
2570
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
2548
2571
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children: M.participants }),
|
|
2549
2572
|
/* @__PURE__ */ e(
|
|
2550
|
-
|
|
2573
|
+
ke,
|
|
2551
2574
|
{
|
|
2552
|
-
checked:
|
|
2553
|
-
onCheckedChange: () =>
|
|
2554
|
-
className:
|
|
2575
|
+
checked: I,
|
|
2576
|
+
onCheckedChange: () => V(),
|
|
2577
|
+
className: h(
|
|
2555
2578
|
"flex h-5 w-5 items-center justify-center rounded border border-border bg-white transition-colors hover:border-primary/50",
|
|
2556
|
-
|
|
2579
|
+
I && "border-primary bg-primary text-primary-foreground"
|
|
2557
2580
|
),
|
|
2558
|
-
children:
|
|
2581
|
+
children: I && /* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5" })
|
|
2559
2582
|
}
|
|
2560
2583
|
)
|
|
2561
2584
|
] }),
|
|
2562
2585
|
/* @__PURE__ */ e("div", { className: "px-4 pb-3", children: /* @__PURE__ */ e(
|
|
2563
|
-
|
|
2586
|
+
Be,
|
|
2564
2587
|
{
|
|
2565
2588
|
value: p,
|
|
2566
2589
|
onChange: y,
|
|
@@ -2586,13 +2609,13 @@ function Jr({
|
|
|
2586
2609
|
`p-skeleton-${l}`
|
|
2587
2610
|
))
|
|
2588
2611
|
) : N.map((x) => {
|
|
2589
|
-
const l =
|
|
2612
|
+
const l = i.includes(x.id);
|
|
2590
2613
|
return /* @__PURE__ */ n(
|
|
2591
|
-
|
|
2614
|
+
ke,
|
|
2592
2615
|
{
|
|
2593
2616
|
checked: l,
|
|
2594
|
-
onCheckedChange: (
|
|
2595
|
-
className:
|
|
2617
|
+
onCheckedChange: (m) => A(x.id, m),
|
|
2618
|
+
className: h(
|
|
2596
2619
|
"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",
|
|
2597
2620
|
l && "border-primary bg-zinc-50"
|
|
2598
2621
|
),
|
|
@@ -2600,16 +2623,16 @@ function Jr({
|
|
|
2600
2623
|
/* @__PURE__ */ e(
|
|
2601
2624
|
"span",
|
|
2602
2625
|
{
|
|
2603
|
-
className:
|
|
2626
|
+
className: h(
|
|
2604
2627
|
"flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border border-border transition-colors",
|
|
2605
2628
|
l && "border-primary bg-primary text-primary-foreground"
|
|
2606
2629
|
),
|
|
2607
|
-
children: l && /* @__PURE__ */ e(
|
|
2630
|
+
children: l && /* @__PURE__ */ e(ye, { className: "h-2.5 w-2.5" })
|
|
2608
2631
|
}
|
|
2609
2632
|
),
|
|
2610
2633
|
/* @__PURE__ */ n("div", { className: "flex flex-1 items-start gap-2", children: [
|
|
2611
2634
|
/* @__PURE__ */ e(
|
|
2612
|
-
|
|
2635
|
+
fr,
|
|
2613
2636
|
{
|
|
2614
2637
|
src: x.avatar ?? null,
|
|
2615
2638
|
alt: x.name,
|
|
@@ -2641,7 +2664,7 @@ function Jr({
|
|
|
2641
2664
|
}
|
|
2642
2665
|
);
|
|
2643
2666
|
}
|
|
2644
|
-
function
|
|
2667
|
+
function xr({ className: t }) {
|
|
2645
2668
|
return /* @__PURE__ */ n(
|
|
2646
2669
|
"svg",
|
|
2647
2670
|
{
|
|
@@ -2662,19 +2685,19 @@ function hr({ className: t }) {
|
|
|
2662
2685
|
}
|
|
2663
2686
|
);
|
|
2664
2687
|
}
|
|
2665
|
-
function
|
|
2688
|
+
function en({
|
|
2666
2689
|
scheduleTypes: t,
|
|
2667
2690
|
value: r,
|
|
2668
2691
|
onChange: s,
|
|
2669
2692
|
allLabel: o = "All types",
|
|
2670
|
-
className:
|
|
2671
|
-
label:
|
|
2693
|
+
className: i,
|
|
2694
|
+
label: a
|
|
2672
2695
|
}) {
|
|
2673
2696
|
const g = (c) => {
|
|
2674
2697
|
s(c.target.value);
|
|
2675
2698
|
}, f = t.find((c) => String(c.id) === r);
|
|
2676
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2677
|
-
|
|
2699
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-1", i), children: [
|
|
2700
|
+
a && /* @__PURE__ */ e(Z, { className: "text-xs text-muted-foreground", children: a }),
|
|
2678
2701
|
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2679
2702
|
f ? /* @__PURE__ */ e(
|
|
2680
2703
|
"span",
|
|
@@ -2682,9 +2705,9 @@ function Xr({
|
|
|
2682
2705
|
className: "pointer-events-none absolute left-2.5 top-1/2 size-3 -translate-y-1/2 rounded-full",
|
|
2683
2706
|
style: { backgroundColor: f.color }
|
|
2684
2707
|
}
|
|
2685
|
-
) : /* @__PURE__ */ e(
|
|
2708
|
+
) : /* @__PURE__ */ e(xr, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
2686
2709
|
/* @__PURE__ */ n(
|
|
2687
|
-
|
|
2710
|
+
se,
|
|
2688
2711
|
{
|
|
2689
2712
|
value: r,
|
|
2690
2713
|
onChange: g,
|
|
@@ -2698,7 +2721,7 @@ function Xr({
|
|
|
2698
2721
|
] })
|
|
2699
2722
|
] });
|
|
2700
2723
|
}
|
|
2701
|
-
function
|
|
2724
|
+
function pr({ className: t }) {
|
|
2702
2725
|
return /* @__PURE__ */ n(
|
|
2703
2726
|
"svg",
|
|
2704
2727
|
{
|
|
@@ -2721,23 +2744,23 @@ function mr({ className: t }) {
|
|
|
2721
2744
|
}
|
|
2722
2745
|
);
|
|
2723
2746
|
}
|
|
2724
|
-
function
|
|
2747
|
+
function tn({
|
|
2725
2748
|
users: t,
|
|
2726
2749
|
value: r,
|
|
2727
2750
|
onChange: s,
|
|
2728
2751
|
allLabel: o = "All users",
|
|
2729
|
-
className:
|
|
2730
|
-
label:
|
|
2752
|
+
className: i,
|
|
2753
|
+
label: a
|
|
2731
2754
|
}) {
|
|
2732
2755
|
const g = (f) => {
|
|
2733
2756
|
s(f.target.value);
|
|
2734
2757
|
};
|
|
2735
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2736
|
-
|
|
2758
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-1", i), children: [
|
|
2759
|
+
a && /* @__PURE__ */ e(Z, { className: "text-xs text-muted-foreground", children: a }),
|
|
2737
2760
|
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2738
|
-
/* @__PURE__ */ e(
|
|
2761
|
+
/* @__PURE__ */ e(pr, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
2739
2762
|
/* @__PURE__ */ n(
|
|
2740
|
-
|
|
2763
|
+
se,
|
|
2741
2764
|
{
|
|
2742
2765
|
value: r,
|
|
2743
2766
|
onChange: g,
|
|
@@ -2751,7 +2774,7 @@ function Qr({
|
|
|
2751
2774
|
] })
|
|
2752
2775
|
] });
|
|
2753
2776
|
}
|
|
2754
|
-
function
|
|
2777
|
+
function vr({ className: t }) {
|
|
2755
2778
|
return /* @__PURE__ */ n(
|
|
2756
2779
|
"svg",
|
|
2757
2780
|
{
|
|
@@ -2778,7 +2801,7 @@ function fr({ className: t }) {
|
|
|
2778
2801
|
}
|
|
2779
2802
|
);
|
|
2780
2803
|
}
|
|
2781
|
-
function
|
|
2804
|
+
function wr({ className: t }) {
|
|
2782
2805
|
return /* @__PURE__ */ n(
|
|
2783
2806
|
"svg",
|
|
2784
2807
|
{
|
|
@@ -2801,7 +2824,7 @@ function gr({ className: t }) {
|
|
|
2801
2824
|
}
|
|
2802
2825
|
);
|
|
2803
2826
|
}
|
|
2804
|
-
function
|
|
2827
|
+
function br({ className: t }) {
|
|
2805
2828
|
return /* @__PURE__ */ e(
|
|
2806
2829
|
"svg",
|
|
2807
2830
|
{
|
|
@@ -2817,7 +2840,7 @@ function xr({ className: t }) {
|
|
|
2817
2840
|
}
|
|
2818
2841
|
);
|
|
2819
2842
|
}
|
|
2820
|
-
function
|
|
2843
|
+
function yr({ className: t }) {
|
|
2821
2844
|
return /* @__PURE__ */ n(
|
|
2822
2845
|
"svg",
|
|
2823
2846
|
{
|
|
@@ -2837,25 +2860,25 @@ function pr({ className: t }) {
|
|
|
2837
2860
|
}
|
|
2838
2861
|
);
|
|
2839
2862
|
}
|
|
2840
|
-
function
|
|
2863
|
+
function kr(t) {
|
|
2841
2864
|
const r = t.getFullYear(), s = String(t.getMonth() + 1).padStart(2, "0"), o = String(t.getDate()).padStart(2, "0");
|
|
2842
2865
|
return `${r}-${s}-${o}`;
|
|
2843
2866
|
}
|
|
2844
|
-
function
|
|
2845
|
-
const r = t.getHours(), s = t.getMinutes(), o = r >= 12 ? "PM" : "AM",
|
|
2846
|
-
return `${
|
|
2867
|
+
function Fe(t) {
|
|
2868
|
+
const r = t.getHours(), s = t.getMinutes(), o = r >= 12 ? "PM" : "AM", i = r % 12 || 12, a = String(s).padStart(2, "0");
|
|
2869
|
+
return `${i}:${a} ${o}`;
|
|
2847
2870
|
}
|
|
2848
|
-
function
|
|
2849
|
-
const r =
|
|
2871
|
+
function Nr(t) {
|
|
2872
|
+
const r = Fe(t.startDate), s = Fe(t.endDate);
|
|
2850
2873
|
return `${r} - ${s}`;
|
|
2851
2874
|
}
|
|
2852
|
-
function
|
|
2853
|
-
const r =
|
|
2875
|
+
function Cr(t) {
|
|
2876
|
+
const r = Ge(/* @__PURE__ */ new Date(), 1);
|
|
2854
2877
|
return t.getFullYear() === r.getFullYear() && t.getMonth() === r.getMonth() && t.getDate() === r.getDate();
|
|
2855
2878
|
}
|
|
2856
|
-
function
|
|
2857
|
-
if (
|
|
2858
|
-
if (
|
|
2879
|
+
function Dr(t) {
|
|
2880
|
+
if (le(t)) return "Today";
|
|
2881
|
+
if (Cr(t)) return "Tomorrow";
|
|
2859
2882
|
const r = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], s = [
|
|
2860
2883
|
"Jan",
|
|
2861
2884
|
"Feb",
|
|
@@ -2869,41 +2892,41 @@ function yr(t) {
|
|
|
2869
2892
|
"Oct",
|
|
2870
2893
|
"Nov",
|
|
2871
2894
|
"Dec"
|
|
2872
|
-
], o = r[t.getDay()],
|
|
2873
|
-
return `${o}, ${
|
|
2895
|
+
], o = r[t.getDay()], i = s[t.getMonth()], a = t.getDate();
|
|
2896
|
+
return `${o}, ${i} ${a}`;
|
|
2874
2897
|
}
|
|
2875
|
-
function
|
|
2898
|
+
function Mr(t, r) {
|
|
2876
2899
|
const s = /* @__PURE__ */ new Map();
|
|
2877
2900
|
for (const o of t) {
|
|
2878
|
-
const
|
|
2879
|
-
|
|
2901
|
+
const i = kr(o.startDate), a = s.get(i) ?? [];
|
|
2902
|
+
a.push(o), s.set(i, a);
|
|
2880
2903
|
}
|
|
2881
|
-
return Array.from(s.entries()).map(([o,
|
|
2882
|
-
const
|
|
2904
|
+
return Array.from(s.entries()).map(([o, i]) => {
|
|
2905
|
+
const a = [...i].sort(
|
|
2883
2906
|
(f, c) => f.startDate.getTime() - c.startDate.getTime()
|
|
2884
|
-
), g = r > 0 ?
|
|
2907
|
+
), g = r > 0 ? a.slice(0, r) : a;
|
|
2885
2908
|
return {
|
|
2886
2909
|
date: new Date(o),
|
|
2887
2910
|
dateKey: o,
|
|
2888
2911
|
events: g,
|
|
2889
|
-
hasMore: r > 0 &&
|
|
2912
|
+
hasMore: r > 0 && a.length > r
|
|
2890
2913
|
};
|
|
2891
|
-
}).sort((o,
|
|
2914
|
+
}).sort((o, i) => o.date.getTime() - i.date.getTime());
|
|
2892
2915
|
}
|
|
2893
|
-
function
|
|
2894
|
-
const r =
|
|
2916
|
+
function Er(t) {
|
|
2917
|
+
const r = xe(/* @__PURE__ */ new Date()), s = Ye(/* @__PURE__ */ new Date());
|
|
2895
2918
|
return t.filter((o) => o.startDate >= r && o.startDate <= s).length;
|
|
2896
2919
|
}
|
|
2897
|
-
function
|
|
2898
|
-
return /* @__PURE__ */ e("div", { className:
|
|
2920
|
+
function Ne({ className: t }) {
|
|
2921
|
+
return /* @__PURE__ */ e("div", { className: h("animate-pulse rounded-md bg-muted", t) });
|
|
2899
2922
|
}
|
|
2900
|
-
function
|
|
2923
|
+
function Sr({ event: t, onClick: r }) {
|
|
2901
2924
|
return /* @__PURE__ */ n(
|
|
2902
2925
|
"button",
|
|
2903
2926
|
{
|
|
2904
2927
|
type: "button",
|
|
2905
2928
|
onClick: () => r?.(t),
|
|
2906
|
-
className:
|
|
2929
|
+
className: h(
|
|
2907
2930
|
"w-full text-left rounded-lg transition-colors",
|
|
2908
2931
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
2909
2932
|
"flex items-start gap-3 p-2"
|
|
@@ -2918,58 +2941,58 @@ function Cr({ event: t, onClick: r }) {
|
|
|
2918
2941
|
),
|
|
2919
2942
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
2920
2943
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium truncate", children: t.title }),
|
|
2921
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children:
|
|
2944
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children: Nr(t) })
|
|
2922
2945
|
] }),
|
|
2923
|
-
r && /* @__PURE__ */ e(
|
|
2946
|
+
r && /* @__PURE__ */ e(br, { className: "shrink-0 size-4 text-muted-foreground/50 mt-1" })
|
|
2924
2947
|
]
|
|
2925
2948
|
}
|
|
2926
2949
|
);
|
|
2927
2950
|
}
|
|
2928
|
-
function
|
|
2951
|
+
function zr({ group: t, onEventClick: r }) {
|
|
2929
2952
|
return /* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
2930
2953
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between px-2 py-1.5", children: [
|
|
2931
|
-
/* @__PURE__ */ e("h3", { className:
|
|
2954
|
+
/* @__PURE__ */ e("h3", { className: h("text-xs font-semibold", le(t.date) && "text-primary"), children: Dr(t.date) }),
|
|
2932
2955
|
t.hasMore && /* @__PURE__ */ n("span", { className: "text-[10px] text-muted-foreground", children: [
|
|
2933
2956
|
"+",
|
|
2934
2957
|
t.events.length,
|
|
2935
2958
|
" more"
|
|
2936
2959
|
] })
|
|
2937
2960
|
] }),
|
|
2938
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((s) => /* @__PURE__ */ e(
|
|
2961
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((s) => /* @__PURE__ */ e(Sr, { event: s, onClick: r }, s.id)) })
|
|
2939
2962
|
] });
|
|
2940
2963
|
}
|
|
2941
|
-
function
|
|
2964
|
+
function rn({
|
|
2942
2965
|
events: t,
|
|
2943
2966
|
isLoading: r = !1,
|
|
2944
2967
|
className: s,
|
|
2945
2968
|
daysAhead: o = 7,
|
|
2946
|
-
maxEventsPerDay:
|
|
2947
|
-
onEventClick:
|
|
2969
|
+
maxEventsPerDay: i = 3,
|
|
2970
|
+
onEventClick: a,
|
|
2948
2971
|
onNavigateToAgenda: g
|
|
2949
2972
|
}) {
|
|
2950
|
-
const [f, c] =
|
|
2951
|
-
const
|
|
2952
|
-
return t.filter((y) => y.endDate >=
|
|
2953
|
-
}, [t, o]), w =
|
|
2954
|
-
() =>
|
|
2955
|
-
[d,
|
|
2956
|
-
), k =
|
|
2957
|
-
c(!1),
|
|
2958
|
-
},
|
|
2973
|
+
const [f, c] = q(!1), d = $(() => {
|
|
2974
|
+
const E = xe(/* @__PURE__ */ new Date()), p = Ge(E, o);
|
|
2975
|
+
return t.filter((y) => y.endDate >= E && y.startDate < p);
|
|
2976
|
+
}, [t, o]), w = $(
|
|
2977
|
+
() => Mr(d, i),
|
|
2978
|
+
[d, i]
|
|
2979
|
+
), k = $(() => Er(t), [t]), M = (E) => {
|
|
2980
|
+
c(!1), a?.(E);
|
|
2981
|
+
}, z = () => {
|
|
2959
2982
|
c(!1), g?.();
|
|
2960
2983
|
};
|
|
2961
|
-
return /* @__PURE__ */ n(
|
|
2984
|
+
return /* @__PURE__ */ n(Re, { open: f, onOpenChange: c, children: [
|
|
2962
2985
|
/* @__PURE__ */ n(
|
|
2963
|
-
|
|
2986
|
+
Ve,
|
|
2964
2987
|
{
|
|
2965
|
-
className:
|
|
2988
|
+
className: h(
|
|
2966
2989
|
"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",
|
|
2967
2990
|
s
|
|
2968
2991
|
),
|
|
2969
2992
|
children: [
|
|
2970
|
-
/* @__PURE__ */ e(
|
|
2993
|
+
/* @__PURE__ */ e(vr, { className: "h-4 w-4" }),
|
|
2971
2994
|
k > 0 && /* @__PURE__ */ e(
|
|
2972
|
-
|
|
2995
|
+
dt,
|
|
2973
2996
|
{
|
|
2974
2997
|
variant: "destructive",
|
|
2975
2998
|
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",
|
|
@@ -2979,7 +3002,7 @@ function Zr({
|
|
|
2979
3002
|
]
|
|
2980
3003
|
}
|
|
2981
3004
|
),
|
|
2982
|
-
/* @__PURE__ */ n(
|
|
3005
|
+
/* @__PURE__ */ n(Ue, { className: "w-80 rounded-xl p-0", align: "end", side: "bottom", sideOffset: 8, children: [
|
|
2983
3006
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between border-b p-4", children: [
|
|
2984
3007
|
/* @__PURE__ */ n("div", { children: [
|
|
2985
3008
|
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Upcoming" }),
|
|
@@ -2989,41 +3012,41 @@ function Zr({
|
|
|
2989
3012
|
"button",
|
|
2990
3013
|
{
|
|
2991
3014
|
type: "button",
|
|
2992
|
-
onClick:
|
|
3015
|
+
onClick: z,
|
|
2993
3016
|
className: "text-xs text-primary hover:underline flex items-center gap-1",
|
|
2994
3017
|
children: [
|
|
2995
3018
|
"View all",
|
|
2996
|
-
/* @__PURE__ */ e(
|
|
3019
|
+
/* @__PURE__ */ e(yr, { className: "size-3" })
|
|
2997
3020
|
]
|
|
2998
3021
|
}
|
|
2999
3022
|
)
|
|
3000
3023
|
] }),
|
|
3001
|
-
/* @__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((
|
|
3002
|
-
/* @__PURE__ */ e(
|
|
3024
|
+
/* @__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((E, p) => /* @__PURE__ */ n("div", { className: "flex space-x-3", children: [
|
|
3025
|
+
/* @__PURE__ */ e(Ne, { className: "h-2 w-2 rounded-full mt-2" }),
|
|
3003
3026
|
/* @__PURE__ */ n("div", { className: "flex-1 space-y-2", children: [
|
|
3004
|
-
/* @__PURE__ */ e(
|
|
3005
|
-
/* @__PURE__ */ e(
|
|
3027
|
+
/* @__PURE__ */ e(Ne, { className: "h-4 w-full" }),
|
|
3028
|
+
/* @__PURE__ */ e(Ne, { className: "h-3 w-3/4" })
|
|
3006
3029
|
] })
|
|
3007
3030
|
] }, p)) }) : w.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
|
|
3008
|
-
/* @__PURE__ */ e(
|
|
3031
|
+
/* @__PURE__ */ e(wr, { className: "mb-2 h-8 w-8 text-muted-foreground/50" }),
|
|
3009
3032
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No upcoming events" }),
|
|
3010
3033
|
/* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground/70", children: [
|
|
3011
3034
|
"Your schedule is clear for the next ",
|
|
3012
3035
|
o,
|
|
3013
3036
|
" days"
|
|
3014
3037
|
] })
|
|
3015
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children: w.map((
|
|
3016
|
-
|
|
3038
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children: w.map((E) => /* @__PURE__ */ e(
|
|
3039
|
+
zr,
|
|
3017
3040
|
{
|
|
3018
|
-
group:
|
|
3041
|
+
group: E,
|
|
3019
3042
|
onEventClick: M
|
|
3020
3043
|
},
|
|
3021
|
-
|
|
3044
|
+
E.dateKey
|
|
3022
3045
|
)) }) })
|
|
3023
3046
|
] })
|
|
3024
3047
|
] });
|
|
3025
3048
|
}
|
|
3026
|
-
function
|
|
3049
|
+
function Lr({ className: t }) {
|
|
3027
3050
|
return /* @__PURE__ */ n(
|
|
3028
3051
|
"svg",
|
|
3029
3052
|
{
|
|
@@ -3048,7 +3071,7 @@ function Mr({ className: t }) {
|
|
|
3048
3071
|
}
|
|
3049
3072
|
);
|
|
3050
3073
|
}
|
|
3051
|
-
function
|
|
3074
|
+
function Je({ className: t }) {
|
|
3052
3075
|
return /* @__PURE__ */ e(
|
|
3053
3076
|
"svg",
|
|
3054
3077
|
{
|
|
@@ -3066,53 +3089,53 @@ function Ge({ className: t }) {
|
|
|
3066
3089
|
}
|
|
3067
3090
|
);
|
|
3068
3091
|
}
|
|
3069
|
-
function
|
|
3092
|
+
function Hr(t) {
|
|
3070
3093
|
const r = /* @__PURE__ */ new Date();
|
|
3071
3094
|
return r.setDate(r.getDate() + 1), t.getFullYear() === r.getFullYear() && t.getMonth() === r.getMonth() && t.getDate() === r.getDate();
|
|
3072
3095
|
}
|
|
3073
|
-
function
|
|
3096
|
+
function _e(t) {
|
|
3074
3097
|
const r = t.getHours(), s = t.getMinutes(), o = r >= 12 ? "PM" : "AM";
|
|
3075
3098
|
return `${r % 12 || 12}:${s.toString().padStart(2, "0")} ${o}`;
|
|
3076
3099
|
}
|
|
3077
|
-
function
|
|
3100
|
+
function Tr(t) {
|
|
3078
3101
|
return new Intl.DateTimeFormat("en-US", {
|
|
3079
3102
|
weekday: "long",
|
|
3080
3103
|
month: "short",
|
|
3081
3104
|
day: "numeric"
|
|
3082
3105
|
}).format(t);
|
|
3083
3106
|
}
|
|
3084
|
-
function
|
|
3085
|
-
const r =
|
|
3107
|
+
function jr(t) {
|
|
3108
|
+
const r = _e(t.startDate), s = _e(t.endDate);
|
|
3086
3109
|
return `${r} - ${s}`;
|
|
3087
3110
|
}
|
|
3088
|
-
function
|
|
3089
|
-
return
|
|
3111
|
+
function Ir(t) {
|
|
3112
|
+
return le(t) ? "Today" : Hr(t) ? "Tomorrow" : Tr(t);
|
|
3090
3113
|
}
|
|
3091
|
-
function
|
|
3114
|
+
function Wr(t, r) {
|
|
3092
3115
|
const s = /* @__PURE__ */ new Map();
|
|
3093
3116
|
for (const o of t) {
|
|
3094
|
-
const
|
|
3095
|
-
|
|
3117
|
+
const i = xt(o.startDate), a = s.get(i) ?? [];
|
|
3118
|
+
a.push(o), s.set(i, a);
|
|
3096
3119
|
}
|
|
3097
|
-
return Array.from(s.entries()).map(([o,
|
|
3098
|
-
const
|
|
3120
|
+
return Array.from(s.entries()).map(([o, i]) => {
|
|
3121
|
+
const a = [...i].sort(
|
|
3099
3122
|
(f, c) => f.startDate.getTime() - c.startDate.getTime()
|
|
3100
|
-
), g = r > 0 ?
|
|
3123
|
+
), g = r > 0 ? a.slice(0, r) : a;
|
|
3101
3124
|
return {
|
|
3102
3125
|
date: new Date(o),
|
|
3103
3126
|
dateKey: o,
|
|
3104
3127
|
events: g,
|
|
3105
|
-
hasMore: r > 0 &&
|
|
3128
|
+
hasMore: r > 0 && a.length > r
|
|
3106
3129
|
};
|
|
3107
|
-
}).sort((o,
|
|
3130
|
+
}).sort((o, i) => o.date.getTime() - i.date.getTime());
|
|
3108
3131
|
}
|
|
3109
|
-
function
|
|
3132
|
+
function Ar({ event: t, onClick: r, compact: s }) {
|
|
3110
3133
|
return /* @__PURE__ */ n(
|
|
3111
3134
|
"button",
|
|
3112
3135
|
{
|
|
3113
3136
|
type: "button",
|
|
3114
3137
|
onClick: () => r?.(t),
|
|
3115
|
-
className:
|
|
3138
|
+
className: h(
|
|
3116
3139
|
"w-full text-left rounded-lg transition-colors",
|
|
3117
3140
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3118
3141
|
"flex items-start gap-3",
|
|
@@ -3122,41 +3145,41 @@ function Hr({ event: t, onClick: r, compact: s }) {
|
|
|
3122
3145
|
/* @__PURE__ */ e(
|
|
3123
3146
|
"div",
|
|
3124
3147
|
{
|
|
3125
|
-
className:
|
|
3148
|
+
className: h("shrink-0 rounded-full mt-1", s ? "size-2" : "size-2.5"),
|
|
3126
3149
|
style: { backgroundColor: t.color ?? "#3b82f6" }
|
|
3127
3150
|
}
|
|
3128
3151
|
),
|
|
3129
3152
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
3130
|
-
/* @__PURE__ */ e("p", { className:
|
|
3131
|
-
/* @__PURE__ */ e("p", { className:
|
|
3153
|
+
/* @__PURE__ */ e("p", { className: h("font-medium truncate", s ? "text-xs" : "text-sm"), children: t.title }),
|
|
3154
|
+
/* @__PURE__ */ e("p", { className: h("text-muted-foreground truncate", s ? "text-[10px]" : "text-xs"), children: jr(t) })
|
|
3132
3155
|
] }),
|
|
3133
3156
|
r && /* @__PURE__ */ e(
|
|
3134
|
-
|
|
3157
|
+
Je,
|
|
3135
3158
|
{
|
|
3136
|
-
className:
|
|
3159
|
+
className: h("shrink-0 text-muted-foreground/50", s ? "size-3" : "size-4")
|
|
3137
3160
|
}
|
|
3138
3161
|
)
|
|
3139
3162
|
]
|
|
3140
3163
|
}
|
|
3141
3164
|
);
|
|
3142
3165
|
}
|
|
3143
|
-
function
|
|
3166
|
+
function Br({
|
|
3144
3167
|
group: t,
|
|
3145
3168
|
onEventClick: r,
|
|
3146
3169
|
onViewMore: s,
|
|
3147
3170
|
compact: o
|
|
3148
3171
|
}) {
|
|
3149
3172
|
return /* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
3150
|
-
/* @__PURE__ */ n("div", { className:
|
|
3173
|
+
/* @__PURE__ */ n("div", { className: h("flex items-center justify-between px-2", o ? "py-1" : "py-1.5"), children: [
|
|
3151
3174
|
/* @__PURE__ */ e(
|
|
3152
3175
|
"h3",
|
|
3153
3176
|
{
|
|
3154
|
-
className:
|
|
3177
|
+
className: h(
|
|
3155
3178
|
"font-semibold",
|
|
3156
3179
|
o ? "text-xs" : "text-sm",
|
|
3157
|
-
|
|
3180
|
+
le(t.date) && "text-primary"
|
|
3158
3181
|
),
|
|
3159
|
-
children:
|
|
3182
|
+
children: Ir(t.date)
|
|
3160
3183
|
}
|
|
3161
3184
|
),
|
|
3162
3185
|
t.hasMore && s && /* @__PURE__ */ e(
|
|
@@ -3164,77 +3187,77 @@ function jr({
|
|
|
3164
3187
|
{
|
|
3165
3188
|
type: "button",
|
|
3166
3189
|
onClick: () => s(t.date),
|
|
3167
|
-
className:
|
|
3190
|
+
className: h("text-primary hover:underline", o ? "text-[10px]" : "text-xs"),
|
|
3168
3191
|
children: "+more"
|
|
3169
3192
|
}
|
|
3170
3193
|
)
|
|
3171
3194
|
] }),
|
|
3172
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((
|
|
3195
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((i) => /* @__PURE__ */ e(Ar, { event: i, onClick: r, compact: o }, i.id)) })
|
|
3173
3196
|
] });
|
|
3174
3197
|
}
|
|
3175
|
-
function
|
|
3198
|
+
function nn({
|
|
3176
3199
|
events: t,
|
|
3177
3200
|
daysAhead: r = 7,
|
|
3178
3201
|
maxEventsPerDay: s = 3,
|
|
3179
3202
|
onEventClick: o,
|
|
3180
|
-
onViewAll:
|
|
3181
|
-
className:
|
|
3203
|
+
onViewAll: i,
|
|
3204
|
+
className: a,
|
|
3182
3205
|
emptyState: g,
|
|
3183
3206
|
title: f = "Upcoming",
|
|
3184
3207
|
showHeader: c = !0,
|
|
3185
3208
|
compact: d = !1
|
|
3186
3209
|
}) {
|
|
3187
|
-
const w =
|
|
3188
|
-
const b =
|
|
3189
|
-
return N.setDate(N.getDate() + r),
|
|
3190
|
-
}, [
|
|
3191
|
-
() =>
|
|
3192
|
-
[
|
|
3193
|
-
), y =
|
|
3194
|
-
return p.length === 0 ? /* @__PURE__ */ n("div", { className:
|
|
3210
|
+
const w = Pe(), k = w?.filteredEvents, M = w?.currentDate ?? /* @__PURE__ */ new Date(), z = t ?? k ?? [], E = $(() => {
|
|
3211
|
+
const b = xe(M), N = new Date(b);
|
|
3212
|
+
return N.setDate(N.getDate() + r), z.filter((S) => S.endDate >= b && S.startDate < N);
|
|
3213
|
+
}, [z, r, M]), p = $(
|
|
3214
|
+
() => Wr(E, s),
|
|
3215
|
+
[E, s]
|
|
3216
|
+
), y = E.length;
|
|
3217
|
+
return p.length === 0 ? /* @__PURE__ */ n("div", { className: h("rounded-lg border bg-card", a), children: [
|
|
3195
3218
|
c && /* @__PURE__ */ e(
|
|
3196
3219
|
"div",
|
|
3197
3220
|
{
|
|
3198
|
-
className:
|
|
3221
|
+
className: h(
|
|
3199
3222
|
"border-b px-4 flex items-center justify-between",
|
|
3200
3223
|
d ? "py-2" : "py-3"
|
|
3201
3224
|
),
|
|
3202
|
-
children: /* @__PURE__ */ e("h2", { className:
|
|
3225
|
+
children: /* @__PURE__ */ e("h2", { className: h("font-semibold", d ? "text-sm" : "text-base"), children: f })
|
|
3203
3226
|
}
|
|
3204
3227
|
),
|
|
3205
3228
|
/* @__PURE__ */ e(
|
|
3206
3229
|
"div",
|
|
3207
3230
|
{
|
|
3208
|
-
className:
|
|
3231
|
+
className: h(
|
|
3209
3232
|
"flex flex-col items-center justify-center text-center",
|
|
3210
3233
|
d ? "py-6 px-4" : "py-10 px-6"
|
|
3211
3234
|
),
|
|
3212
|
-
children: g ?? /* @__PURE__ */ n(
|
|
3235
|
+
children: g ?? /* @__PURE__ */ n(ie, { children: [
|
|
3213
3236
|
/* @__PURE__ */ e(
|
|
3214
|
-
|
|
3237
|
+
Lr,
|
|
3215
3238
|
{
|
|
3216
|
-
className:
|
|
3239
|
+
className: h("text-muted-foreground/50 mb-2", d ? "size-8" : "size-10")
|
|
3217
3240
|
}
|
|
3218
3241
|
),
|
|
3219
|
-
/* @__PURE__ */ e("p", { className:
|
|
3242
|
+
/* @__PURE__ */ e("p", { className: h("text-muted-foreground", d ? "text-xs" : "text-sm"), children: "No upcoming events" })
|
|
3220
3243
|
] })
|
|
3221
3244
|
}
|
|
3222
3245
|
)
|
|
3223
|
-
] }) : /* @__PURE__ */ n("div", { className:
|
|
3246
|
+
] }) : /* @__PURE__ */ n("div", { className: h("rounded-lg border bg-card overflow-hidden", a), children: [
|
|
3224
3247
|
c && /* @__PURE__ */ n(
|
|
3225
3248
|
"div",
|
|
3226
3249
|
{
|
|
3227
|
-
className:
|
|
3250
|
+
className: h(
|
|
3228
3251
|
"border-b px-4 flex items-center justify-between",
|
|
3229
3252
|
d ? "py-2" : "py-3"
|
|
3230
3253
|
),
|
|
3231
3254
|
children: [
|
|
3232
3255
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
3233
|
-
/* @__PURE__ */ e("h2", { className:
|
|
3256
|
+
/* @__PURE__ */ e("h2", { className: h("font-semibold", d ? "text-sm" : "text-base"), children: f }),
|
|
3234
3257
|
/* @__PURE__ */ e(
|
|
3235
3258
|
"span",
|
|
3236
3259
|
{
|
|
3237
|
-
className:
|
|
3260
|
+
className: h(
|
|
3238
3261
|
"text-muted-foreground bg-muted rounded-full px-2",
|
|
3239
3262
|
d ? "text-[10px] py-0" : "text-xs py-0.5"
|
|
3240
3263
|
),
|
|
@@ -3242,18 +3265,18 @@ function qr({
|
|
|
3242
3265
|
}
|
|
3243
3266
|
)
|
|
3244
3267
|
] }),
|
|
3245
|
-
|
|
3268
|
+
i && /* @__PURE__ */ n(
|
|
3246
3269
|
"button",
|
|
3247
3270
|
{
|
|
3248
3271
|
type: "button",
|
|
3249
|
-
onClick: () =>
|
|
3250
|
-
className:
|
|
3272
|
+
onClick: () => i(),
|
|
3273
|
+
className: h(
|
|
3251
3274
|
"text-primary hover:underline flex items-center gap-0.5",
|
|
3252
3275
|
d ? "text-xs" : "text-sm"
|
|
3253
3276
|
),
|
|
3254
3277
|
children: [
|
|
3255
3278
|
"View all",
|
|
3256
|
-
/* @__PURE__ */ e(
|
|
3279
|
+
/* @__PURE__ */ e(Je, { className: "size-3" })
|
|
3257
3280
|
]
|
|
3258
3281
|
}
|
|
3259
3282
|
)
|
|
@@ -3263,16 +3286,16 @@ function qr({
|
|
|
3263
3286
|
/* @__PURE__ */ e(
|
|
3264
3287
|
"div",
|
|
3265
3288
|
{
|
|
3266
|
-
className:
|
|
3289
|
+
className: h(
|
|
3267
3290
|
"divide-y overflow-auto",
|
|
3268
3291
|
d ? "p-2 max-h-[280px]" : "p-3 max-h-[400px]"
|
|
3269
3292
|
),
|
|
3270
3293
|
children: p.map((b) => /* @__PURE__ */ e(
|
|
3271
|
-
|
|
3294
|
+
Br,
|
|
3272
3295
|
{
|
|
3273
3296
|
group: b,
|
|
3274
3297
|
onEventClick: o,
|
|
3275
|
-
onViewMore:
|
|
3298
|
+
onViewMore: i ? (N) => i(N) : void 0,
|
|
3276
3299
|
compact: d
|
|
3277
3300
|
},
|
|
3278
3301
|
b.dateKey
|
|
@@ -3282,20 +3305,20 @@ function qr({
|
|
|
3282
3305
|
] });
|
|
3283
3306
|
}
|
|
3284
3307
|
export {
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3308
|
+
rn as A,
|
|
3309
|
+
Jr as B,
|
|
3310
|
+
Ur as C,
|
|
3311
|
+
Zr as D,
|
|
3312
|
+
Yr as E,
|
|
3313
|
+
Gr as I,
|
|
3314
|
+
en as S,
|
|
3315
|
+
be as T,
|
|
3316
|
+
tn as U,
|
|
3317
|
+
Xr as V,
|
|
3318
|
+
Qr as W,
|
|
3319
|
+
Kt as Y,
|
|
3320
|
+
nn as a,
|
|
3321
|
+
qr as b,
|
|
3322
|
+
Kr as c
|
|
3300
3323
|
};
|
|
3301
|
-
//# sourceMappingURL=agenda-widget-
|
|
3324
|
+
//# sourceMappingURL=agenda-widget-BXcLo1aO.js.map
|