@innosolutions/inno-calendar 1.0.48 → 1.0.49
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-B-AVTnqM.cjs +2 -0
- package/dist/agenda-widget-B-AVTnqM.cjs.map +1 -0
- package/dist/{agenda-widget-DzXBzBfm.js → agenda-widget-DhCPt2vI.js} +941 -929
- package/dist/agenda-widget-DhCPt2vI.js.map +1 -0
- package/dist/components/event/event-card.d.ts.map +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/components/inno-calendar.d.ts +11 -0
- package/dist/components/inno-calendar.d.ts.map +1 -1
- package/dist/core/context/inno-calendar-provider.d.ts +15 -1
- package/dist/core/context/inno-calendar-provider.d.ts.map +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +43 -43
- package/dist/core/types.d.ts +12 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +62 -62
- package/dist/presets/index.cjs +1 -1
- package/dist/presets/index.mjs +1 -1
- package/dist/slot-selection-context-BCsC7WT7.cjs +2 -0
- package/dist/slot-selection-context-BCsC7WT7.cjs.map +1 -0
- package/dist/slot-selection-context-D1495hEJ.js +595 -0
- package/dist/slot-selection-context-D1495hEJ.js.map +1 -0
- package/dist/{tailwind-calendar-Ba5BO9tj.js → tailwind-calendar-BmJa4HhQ.js} +2 -2
- package/dist/{tailwind-calendar-Ba5BO9tj.js.map → tailwind-calendar-BmJa4HhQ.js.map} +1 -1
- package/dist/{tailwind-calendar-4FkVdxbr.cjs → tailwind-calendar-CJmOutn1.cjs} +2 -2
- package/dist/{tailwind-calendar-4FkVdxbr.cjs.map → tailwind-calendar-CJmOutn1.cjs.map} +1 -1
- package/dist/use-calendar-BEuelmSu.cjs +2 -0
- package/dist/use-calendar-BEuelmSu.cjs.map +1 -0
- package/dist/use-calendar-Clo9DFK4.js +175 -0
- package/dist/use-calendar-Clo9DFK4.js.map +1 -0
- package/dist/{use-slot-selection-BJHlyfxL.js → use-slot-selection-BCZKnZSM.js} +2 -2
- package/dist/{use-slot-selection-BJHlyfxL.js.map → use-slot-selection-BCZKnZSM.js.map} +1 -1
- package/dist/{use-slot-selection-CTFC2-xS.cjs → use-slot-selection-Bwqwjiaq.cjs} +2 -2
- package/dist/{use-slot-selection-CTFC2-xS.cjs.map → use-slot-selection-Bwqwjiaq.cjs.map} +1 -1
- package/dist/week-view-D19YRBQC.cjs +11 -0
- package/dist/week-view-D19YRBQC.cjs.map +1 -0
- package/dist/{week-view-CVbu7Qh2.js → week-view-aRPB2cjn.js} +934 -916
- package/dist/week-view-aRPB2cjn.js.map +1 -0
- package/package.json +1 -1
- package/dist/agenda-widget-D_DbVHjB.cjs +0 -2
- package/dist/agenda-widget-D_DbVHjB.cjs.map +0 -1
- package/dist/agenda-widget-DzXBzBfm.js.map +0 -1
- package/dist/slot-selection-context-Bx3FKJfR.cjs +0 -2
- package/dist/slot-selection-context-Bx3FKJfR.cjs.map +0 -1
- package/dist/slot-selection-context-D2eu2o-7.js +0 -203
- package/dist/slot-selection-context-D2eu2o-7.js.map +0 -1
- package/dist/use-calendar-DR2emWYC.js +0 -555
- package/dist/use-calendar-DR2emWYC.js.map +0 -1
- package/dist/use-calendar-DR89bZu5.cjs +0 -2
- package/dist/use-calendar-DR89bZu5.cjs.map +0 -1
- package/dist/week-view-7r6Vhahg.cjs +0 -11
- package/dist/week-view-7r6Vhahg.cjs.map +0 -1
- package/dist/week-view-CVbu7Qh2.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as n, Fragment as
|
|
2
|
-
import {
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { c as
|
|
5
|
-
import { P as Pe, i as _e, h as Re, m as
|
|
6
|
-
import { D as dt,
|
|
7
|
-
import { isToday as
|
|
8
|
-
function
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as re } from "react/jsx-runtime";
|
|
2
|
+
import { g as Oe, u as Je, C as Xe } from "./use-calendar-Clo9DFK4.js";
|
|
3
|
+
import { useCallback as ne, useState as oe, useEffect as fe, forwardRef as xe, useRef as Ne, useMemo as B, useLayoutEffect as Qe, useImperativeHandle as Ze } from "react";
|
|
4
|
+
import { c as h } from "./index-DtaLkIY8.js";
|
|
5
|
+
import { P as Pe, i as _e, h as Re, m as X, q as et, r as tt, B as ae, s as rt, t as Ce, k as Q, n as Z, l as ee, d as nt, C as ot, M as De, A as st, W as at, c as it, u as lt } from "./week-view-aRPB2cjn.js";
|
|
6
|
+
import { D as ct, I as dt, e as ut, S as ht } from "./slot-selection-context-D1495hEJ.js";
|
|
7
|
+
import { isToday as G, startOfDay as pe, endOfDay as Ve, getYearMonths as mt, generateMonthGrid as ft, getEventsForDay as gt, addDays as Ue, formatDateISO as xt } from "./utils.mjs";
|
|
8
|
+
function pt({ view: t, className: r = "" }) {
|
|
9
9
|
return /* @__PURE__ */ e(
|
|
10
10
|
"div",
|
|
11
11
|
{
|
|
@@ -30,48 +30,48 @@ function xt({ view: t, className: r = "" }) {
|
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
function Me({ view: t, className: r }) {
|
|
33
|
-
return /* @__PURE__ */ e(
|
|
33
|
+
return /* @__PURE__ */ e(pt, { view: t, className: r });
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Yr(t) {
|
|
36
36
|
const {
|
|
37
37
|
events: r,
|
|
38
38
|
resources: o,
|
|
39
39
|
scheduleTypes: s,
|
|
40
|
-
initialView:
|
|
41
|
-
initialDate:
|
|
40
|
+
initialView: i = "week",
|
|
41
|
+
initialDate: l,
|
|
42
42
|
initialFilters: g,
|
|
43
43
|
preferences: f,
|
|
44
44
|
locale: c,
|
|
45
45
|
slots: x,
|
|
46
46
|
renderEvent: b,
|
|
47
47
|
onViewChange: p,
|
|
48
|
-
onDateChange:
|
|
49
|
-
onEventClick:
|
|
50
|
-
onSlotSelect:
|
|
48
|
+
onDateChange: S,
|
|
49
|
+
onEventClick: W,
|
|
50
|
+
onSlotSelect: L,
|
|
51
51
|
onFiltersChange: D,
|
|
52
|
-
className:
|
|
53
|
-
children:
|
|
54
|
-
} = t,
|
|
55
|
-
if (
|
|
56
|
-
return /* @__PURE__ */ e("div", { className:
|
|
57
|
-
const
|
|
52
|
+
className: z,
|
|
53
|
+
children: T
|
|
54
|
+
} = t, w = Oe();
|
|
55
|
+
if (w)
|
|
56
|
+
return /* @__PURE__ */ e("div", { className: z, style: { position: "relative" }, children: T ?? /* @__PURE__ */ e(Me, { view: w.view, className: z }) });
|
|
57
|
+
const I = Je({
|
|
58
58
|
events: r,
|
|
59
59
|
resources: o,
|
|
60
60
|
scheduleTypes: s,
|
|
61
|
-
initialView:
|
|
62
|
-
initialDate:
|
|
61
|
+
initialView: i,
|
|
62
|
+
initialDate: l,
|
|
63
63
|
initialFilters: g,
|
|
64
64
|
preferences: f,
|
|
65
65
|
locale: c,
|
|
66
66
|
onViewChange: p,
|
|
67
|
-
onDateChange:
|
|
68
|
-
onEventClick:
|
|
69
|
-
onSlotSelect:
|
|
67
|
+
onDateChange: S,
|
|
68
|
+
onEventClick: W,
|
|
69
|
+
onSlotSelect: L,
|
|
70
70
|
onFiltersChange: D
|
|
71
71
|
});
|
|
72
|
-
return /* @__PURE__ */ e(
|
|
72
|
+
return /* @__PURE__ */ e(Xe, { value: I, children: /* @__PURE__ */ e("div", { className: z, style: { position: "relative" }, children: T ?? /* @__PURE__ */ e(Me, { view: I.view, className: z }) }) });
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function vt({ className: t }) {
|
|
75
75
|
return /* @__PURE__ */ n(
|
|
76
76
|
"svg",
|
|
77
77
|
{
|
|
@@ -131,7 +131,7 @@ function ge({ 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 vt({ 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 ue({ 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 wt({ 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 bt({ 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 yt({ 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 kt({ 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 Nt({ 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 Ct({ className: t }) {
|
|
|
284
284
|
}
|
|
285
285
|
);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function ce({ 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,39 +325,39 @@ const Dt = {
|
|
|
325
325
|
acceptAllEvents: "Accept all events",
|
|
326
326
|
deleteConfirmTitle: "Delete Event",
|
|
327
327
|
deleteConfirmDescription: "Are you sure you want to delete this event? This action cannot be undone."
|
|
328
|
-
},
|
|
329
|
-
({ onClick: t, label: r, children: o, className: s, variant:
|
|
330
|
-
/* @__PURE__ */ e(
|
|
328
|
+
}, me = xe(
|
|
329
|
+
({ onClick: t, label: r, children: o, className: s, variant: i = "ghost", ...l }, g) => /* @__PURE__ */ n(Q, { children: [
|
|
330
|
+
/* @__PURE__ */ e(Z, { 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
|
s
|
|
341
341
|
),
|
|
342
342
|
"aria-label": r,
|
|
343
|
-
...
|
|
343
|
+
...l,
|
|
344
344
|
children: o
|
|
345
345
|
}
|
|
346
346
|
) }),
|
|
347
|
-
/* @__PURE__ */ e(
|
|
347
|
+
/* @__PURE__ */ e(ee, { side: "bottom", className: "text-xs", children: r })
|
|
348
348
|
] })
|
|
349
349
|
);
|
|
350
|
-
|
|
351
|
-
function
|
|
352
|
-
const [
|
|
350
|
+
me.displayName = "IconButton";
|
|
351
|
+
function St({ src: t, alt: r, initials: o, className: s, isClient: i }) {
|
|
352
|
+
const [l, g] = oe(!1);
|
|
353
353
|
return /* @__PURE__ */ e(
|
|
354
354
|
"div",
|
|
355
355
|
{
|
|
356
|
-
className:
|
|
356
|
+
className: h(
|
|
357
357
|
"relative h-7 w-7 rounded-full overflow-hidden shrink-0",
|
|
358
358
|
s
|
|
359
359
|
),
|
|
360
|
-
children: t && !
|
|
360
|
+
children: t && !l ? /* @__PURE__ */ e(
|
|
361
361
|
"img",
|
|
362
362
|
{
|
|
363
363
|
src: t,
|
|
@@ -368,9 +368,9 @@ function Mt({ src: t, alt: r, initials: o, className: s, isClient: a }) {
|
|
|
368
368
|
) : /* @__PURE__ */ e(
|
|
369
369
|
"div",
|
|
370
370
|
{
|
|
371
|
-
className:
|
|
371
|
+
className: h(
|
|
372
372
|
"h-full w-full flex items-center justify-center text-[10px] font-medium",
|
|
373
|
-
|
|
373
|
+
i ? "bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300" : "bg-zinc-200 dark:bg-zinc-700 text-zinc-700 dark:text-zinc-300"
|
|
374
374
|
),
|
|
375
375
|
children: o
|
|
376
376
|
}
|
|
@@ -383,33 +383,33 @@ function Se({
|
|
|
383
383
|
isEventCanceled: r = !1,
|
|
384
384
|
labels: o
|
|
385
385
|
}) {
|
|
386
|
-
const s = t.name || "Unknown",
|
|
386
|
+
const s = t.name || "Unknown", i = s.split(" ").map((S) => S[0]).join("").toUpperCase().slice(0, 2), l = t.isOrganizer ?? !1, g = t.isConfirmed, f = g === !0, c = g === !1, x = t.isClient ?? !1, b = t.profilePicture || t.avatar, p = r;
|
|
387
387
|
return /* @__PURE__ */ n(
|
|
388
388
|
"div",
|
|
389
389
|
{
|
|
390
|
-
className:
|
|
390
|
+
className: h(
|
|
391
391
|
"flex items-center gap-3 py-0",
|
|
392
392
|
p && "opacity-60"
|
|
393
393
|
),
|
|
394
394
|
children: [
|
|
395
395
|
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
396
396
|
/* @__PURE__ */ e(
|
|
397
|
-
|
|
397
|
+
St,
|
|
398
398
|
{
|
|
399
399
|
src: b,
|
|
400
400
|
alt: s,
|
|
401
|
-
initials:
|
|
401
|
+
initials: i,
|
|
402
402
|
isClient: x,
|
|
403
|
-
className:
|
|
403
|
+
className: h(p && "grayscale")
|
|
404
404
|
}
|
|
405
405
|
),
|
|
406
|
-
p || c ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-red-100 dark:bg-red-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(ge, { className: "h-2 w-2 text-red-600 dark:text-red-400 stroke-[3]" }) }) }) : f ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-green-100 dark:bg-green-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
406
|
+
p || c ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-red-100 dark:bg-red-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(ge, { className: "h-2 w-2 text-red-600 dark:text-red-400 stroke-[3]" }) }) }) : f ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-green-100 dark:bg-green-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(he, { className: "h-2 w-2 text-green-600 dark:text-green-400 stroke-[3]" }) }) }) : null
|
|
407
407
|
] }),
|
|
408
408
|
/* @__PURE__ */ n("div", { className: "!h-fit min-w-0 gap-0", children: [
|
|
409
409
|
/* @__PURE__ */ e("div", { className: "gap-0", children: /* @__PURE__ */ e(
|
|
410
410
|
"span",
|
|
411
411
|
{
|
|
412
|
-
className:
|
|
412
|
+
className: h(
|
|
413
413
|
"text-sm text-zinc-900 dark:text-zinc-100 truncate",
|
|
414
414
|
p && "line-through text-zinc-500 dark:text-zinc-500"
|
|
415
415
|
),
|
|
@@ -417,25 +417,25 @@ function Se({
|
|
|
417
417
|
}
|
|
418
418
|
) }),
|
|
419
419
|
x && /* @__PURE__ */ e("div", { className: "text-[10px] px-1.5 w-fit py-0.5 rounded bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 font-medium", children: o.client }),
|
|
420
|
-
|
|
420
|
+
l && !p && /* @__PURE__ */ e("div", { className: "text-xs text-zinc-500", children: o.organizer })
|
|
421
421
|
] })
|
|
422
422
|
]
|
|
423
423
|
}
|
|
424
424
|
);
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function Et({
|
|
427
427
|
open: t,
|
|
428
428
|
onOpenChange: r,
|
|
429
429
|
title: o,
|
|
430
430
|
children: s
|
|
431
431
|
}) {
|
|
432
|
-
return
|
|
432
|
+
return fe(() => {
|
|
433
433
|
if (!t) return;
|
|
434
|
-
const
|
|
435
|
-
|
|
434
|
+
const i = (l) => {
|
|
435
|
+
l.key === "Escape" && r(!1);
|
|
436
436
|
};
|
|
437
|
-
return document.addEventListener("keydown",
|
|
438
|
-
}, [t, r]),
|
|
437
|
+
return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
|
|
438
|
+
}, [t, r]), fe(() => (t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
439
439
|
document.body.style.overflow = "";
|
|
440
440
|
}), [t]), t ? /* @__PURE__ */ n("div", { className: "fixed inset-0 z-50", children: [
|
|
441
441
|
/* @__PURE__ */ e(
|
|
@@ -443,8 +443,8 @@ function St({
|
|
|
443
443
|
{
|
|
444
444
|
className: "fixed inset-0 bg-black/50 backdrop-blur-sm",
|
|
445
445
|
onClick: () => r(!1),
|
|
446
|
-
onKeyDown: (
|
|
447
|
-
(
|
|
446
|
+
onKeyDown: (i) => {
|
|
447
|
+
(i.key === "Enter" || i.key === " ") && r(!1);
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
),
|
|
@@ -454,13 +454,13 @@ function St({
|
|
|
454
454
|
] }) })
|
|
455
455
|
] }) : null;
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function zt({
|
|
458
458
|
open: t,
|
|
459
459
|
onOpenChange: r,
|
|
460
460
|
title: o,
|
|
461
461
|
description: s,
|
|
462
|
-
cancelLabel:
|
|
463
|
-
confirmLabel:
|
|
462
|
+
cancelLabel: i,
|
|
463
|
+
confirmLabel: l,
|
|
464
464
|
onConfirm: g,
|
|
465
465
|
isLoading: f
|
|
466
466
|
}) {
|
|
@@ -485,7 +485,7 @@ function Et({
|
|
|
485
485
|
variant: "outline",
|
|
486
486
|
size: "sm",
|
|
487
487
|
onClick: () => r(!1),
|
|
488
|
-
children:
|
|
488
|
+
children: i
|
|
489
489
|
}
|
|
490
490
|
),
|
|
491
491
|
/* @__PURE__ */ n(
|
|
@@ -496,9 +496,9 @@ function Et({
|
|
|
496
496
|
onClick: g,
|
|
497
497
|
disabled: f,
|
|
498
498
|
children: [
|
|
499
|
-
f && /* @__PURE__ */ e(
|
|
499
|
+
f && /* @__PURE__ */ e(ce, { className: "h-4 w-4 mr-2" }),
|
|
500
500
|
/* @__PURE__ */ e(Ye, { className: "h-4 w-4 mr-2" }),
|
|
501
|
-
|
|
501
|
+
l
|
|
502
502
|
]
|
|
503
503
|
}
|
|
504
504
|
)
|
|
@@ -506,14 +506,14 @@ function Et({
|
|
|
506
506
|
] }) })
|
|
507
507
|
] }) : null;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function Ht(t, r) {
|
|
510
510
|
return t.toLocaleDateString(void 0, {
|
|
511
511
|
weekday: "long",
|
|
512
512
|
month: "long",
|
|
513
513
|
day: "numeric"
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function Lt(t, r) {
|
|
517
517
|
const o = {
|
|
518
518
|
hour: "2-digit",
|
|
519
519
|
minute: "2-digit",
|
|
@@ -521,7 +521,7 @@ function Ht(t, r) {
|
|
|
521
521
|
};
|
|
522
522
|
return `${t.toLocaleTimeString(void 0, o)} – ${r.toLocaleTimeString(void 0, o)}`;
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function Tt(t) {
|
|
525
525
|
return t.toLocaleDateString(void 0, {
|
|
526
526
|
day: "2-digit",
|
|
527
527
|
month: "short",
|
|
@@ -530,12 +530,12 @@ function Lt(t) {
|
|
|
530
530
|
minute: "2-digit"
|
|
531
531
|
});
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
const [r, o] =
|
|
535
|
-
return
|
|
533
|
+
function It(t) {
|
|
534
|
+
const [r, o] = oe(() => typeof window < "u" ? window.matchMedia(t).matches : !1);
|
|
535
|
+
return fe(() => {
|
|
536
536
|
if (typeof window > "u") return;
|
|
537
|
-
const s = window.matchMedia(t),
|
|
538
|
-
return s.addEventListener("change",
|
|
537
|
+
const s = window.matchMedia(t), i = (l) => o(l.matches);
|
|
538
|
+
return s.addEventListener("change", i), () => s.removeEventListener("change", i);
|
|
539
539
|
}, [t]), r;
|
|
540
540
|
}
|
|
541
541
|
function Ee({
|
|
@@ -543,60 +543,60 @@ function Ee({
|
|
|
543
543
|
labels: r,
|
|
544
544
|
isLoading: o,
|
|
545
545
|
onClose: s,
|
|
546
|
-
onEdit:
|
|
547
|
-
onDelete:
|
|
546
|
+
onEdit: i,
|
|
547
|
+
onDelete: l,
|
|
548
548
|
onCancel: g,
|
|
549
549
|
onAccept: f,
|
|
550
550
|
onDecline: c,
|
|
551
551
|
onConfirmMeeting: x,
|
|
552
552
|
canEdit: b = !0,
|
|
553
553
|
canDelete: p = !1,
|
|
554
|
-
canCancel:
|
|
555
|
-
isCurrentUserParticipant:
|
|
556
|
-
isCurrentUserClient:
|
|
554
|
+
canCancel: S = !0,
|
|
555
|
+
isCurrentUserParticipant: W = !1,
|
|
556
|
+
isCurrentUserClient: L = !1,
|
|
557
557
|
currentUserAcceptStatus: D,
|
|
558
|
-
isAcceptLoading:
|
|
559
|
-
isDeclineLoading:
|
|
560
|
-
isConfirmLoading:
|
|
561
|
-
isDeleteLoading:
|
|
558
|
+
isAcceptLoading: z = !1,
|
|
559
|
+
isDeclineLoading: T = !1,
|
|
560
|
+
isConfirmLoading: w = !1,
|
|
561
|
+
isDeleteLoading: I = !1,
|
|
562
562
|
renderParticipant: C,
|
|
563
|
-
renderHeaderActions:
|
|
563
|
+
renderHeaderActions: A,
|
|
564
564
|
renderCancelReason: R,
|
|
565
565
|
renderDeleteConfirmation: V,
|
|
566
|
-
formatDate:
|
|
567
|
-
formatTimeRange: O =
|
|
566
|
+
formatDate: F = Ht,
|
|
567
|
+
formatTimeRange: O = Lt
|
|
568
568
|
}) {
|
|
569
|
-
const [j, _] =
|
|
570
|
-
s(),
|
|
571
|
-
},
|
|
569
|
+
const [j, _] = oe(!1), U = !(t.isCanceled || t.meetingTookPlace), m = t.isRecurring ?? !1, a = t.participantDetails, u = t.participantsNames || [], v = a && a.length > 0, k = D === !0, N = D === !1, E = W && !L && U, H = v ? a.filter((M) => M.isConfirmed).length : t.isAccepted ? u.length : 0, P = v ? a.length : u.length, K = t.scheduleTypeColor || t.hexColor || "#039BE5", Y = ne(() => t.startDate ? F(t.startDate) : r.noDateProvided, [t.startDate, F, r.noDateProvided]), q = ne(() => t.startDate && t.endDate ? O(t.startDate, t.endDate) : null, [t.startDate, t.endDate, O]), ie = () => {
|
|
570
|
+
s(), i?.(t);
|
|
571
|
+
}, le = () => {
|
|
572
572
|
s(), g?.(t);
|
|
573
|
-
},
|
|
573
|
+
}, d = () => {
|
|
574
574
|
_(!0);
|
|
575
|
-
},
|
|
576
|
-
|
|
575
|
+
}, y = () => {
|
|
576
|
+
l?.(t), _(!1);
|
|
577
577
|
};
|
|
578
|
-
return o ? /* @__PURE__ */ e("div", { className: "flex h-48 items-center justify-center", children: /* @__PURE__ */ e(
|
|
578
|
+
return o ? /* @__PURE__ */ e("div", { className: "flex h-48 items-center justify-center", children: /* @__PURE__ */ e(ce, { className: "h-6 w-6 text-zinc-400" }) }) : /* @__PURE__ */ n(X, { delayDuration: 300, children: [
|
|
579
579
|
/* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5 p-3", children: [
|
|
580
|
-
/* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children:
|
|
581
|
-
U && b &&
|
|
582
|
-
U &&
|
|
583
|
-
p &&
|
|
584
|
-
|
|
580
|
+
/* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children: A ? A({ onClose: s }) : /* @__PURE__ */ n(re, { children: [
|
|
581
|
+
U && b && i && /* @__PURE__ */ e(me, { onClick: ie, label: r.edit, children: /* @__PURE__ */ e(vt, { className: "h-[18px] w-[18px]" }) }),
|
|
582
|
+
U && S && g && /* @__PURE__ */ e(me, { onClick: le, label: r.cancel, children: /* @__PURE__ */ e(wt, { className: "h-[18px] w-[18px]" }) }),
|
|
583
|
+
p && l && /* @__PURE__ */ e(
|
|
584
|
+
me,
|
|
585
585
|
{
|
|
586
|
-
onClick:
|
|
586
|
+
onClick: d,
|
|
587
587
|
label: r.delete,
|
|
588
588
|
variant: "destructive",
|
|
589
589
|
children: /* @__PURE__ */ e(Ye, { className: "h-[18px] w-[18px]" })
|
|
590
590
|
}
|
|
591
591
|
),
|
|
592
|
-
/* @__PURE__ */ e(
|
|
592
|
+
/* @__PURE__ */ e(me, { onClick: s, label: r.close, children: /* @__PURE__ */ e(ge, { className: "h-[18px] w-[18px]" }) })
|
|
593
593
|
] }) }),
|
|
594
594
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
|
|
595
595
|
/* @__PURE__ */ e(
|
|
596
596
|
"div",
|
|
597
597
|
{
|
|
598
598
|
className: "w-4 h-4 rounded mt-1 shrink-0",
|
|
599
|
-
style: { backgroundColor:
|
|
599
|
+
style: { backgroundColor: K }
|
|
600
600
|
}
|
|
601
601
|
),
|
|
602
602
|
/* @__PURE__ */ n("div", { className: "flex-1 min-w-0", children: [
|
|
@@ -604,7 +604,7 @@ function Ee({
|
|
|
604
604
|
/* @__PURE__ */ e(
|
|
605
605
|
"h2",
|
|
606
606
|
{
|
|
607
|
-
className:
|
|
607
|
+
className: h(
|
|
608
608
|
"text-[22px] font-normal text-zinc-900 dark:text-zinc-100 leading-tight",
|
|
609
609
|
t.isCanceled && "line-through opacity-60"
|
|
610
610
|
),
|
|
@@ -612,7 +612,7 @@ function Ee({
|
|
|
612
612
|
}
|
|
613
613
|
),
|
|
614
614
|
t.meetingTookPlace && /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 text-xs font-medium", children: [
|
|
615
|
-
/* @__PURE__ */ e(
|
|
615
|
+
/* @__PURE__ */ e(bt, { className: "h-3 w-3" }),
|
|
616
616
|
r.completed
|
|
617
617
|
] }),
|
|
618
618
|
t.isCanceled && /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400 text-xs font-medium", children: [
|
|
@@ -621,13 +621,13 @@ function Ee({
|
|
|
621
621
|
] })
|
|
622
622
|
] }),
|
|
623
623
|
/* @__PURE__ */ n("div", { className: "mt-1 text-sm text-zinc-600 dark:text-zinc-400", children: [
|
|
624
|
-
/* @__PURE__ */ e("span", { children:
|
|
625
|
-
|
|
624
|
+
/* @__PURE__ */ e("span", { children: Y() }),
|
|
625
|
+
q() && /* @__PURE__ */ n(re, { children: [
|
|
626
626
|
/* @__PURE__ */ e("span", { className: "mx-1.5", children: "·" }),
|
|
627
|
-
/* @__PURE__ */ e("span", { children:
|
|
627
|
+
/* @__PURE__ */ e("span", { children: q() })
|
|
628
628
|
] })
|
|
629
629
|
] }),
|
|
630
|
-
|
|
630
|
+
m && t.recurrenceSummary && /* @__PURE__ */ e("div", { className: "text-sm text-zinc-500 dark:text-zinc-500", children: t.recurrenceSummary })
|
|
631
631
|
] })
|
|
632
632
|
] }) }),
|
|
633
633
|
t.isCanceled && /* @__PURE__ */ e("div", { className: "mx-4 p-3 rounded-lg bg-red-50 dark:bg-red-950/30", children: R ? R(t) : /* @__PURE__ */ e("div", { className: "flex items-start gap-0", children: /* @__PURE__ */ n("div", { className: "flex-1 min-w-0", children: [
|
|
@@ -640,16 +640,16 @@ function Ee({
|
|
|
640
640
|
t.canceledDate && /* @__PURE__ */ n("div", { className: "mt-1.5 text-xs text-red-500/70 dark:text-red-400/60", children: [
|
|
641
641
|
r.canceledOn,
|
|
642
642
|
" ",
|
|
643
|
-
|
|
643
|
+
Tt(t.canceledDate)
|
|
644
644
|
] })
|
|
645
645
|
] }) }) }),
|
|
646
646
|
/* @__PURE__ */ n("div", { className: "space-y-0.5", children: [
|
|
647
647
|
t.address && /* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
|
|
648
|
-
/* @__PURE__ */ e(
|
|
648
|
+
/* @__PURE__ */ e(Nt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
649
649
|
/* @__PURE__ */ e("span", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: t.address })
|
|
650
650
|
] }),
|
|
651
|
-
(
|
|
652
|
-
/* @__PURE__ */ e(
|
|
651
|
+
(v || u.length > 0) && /* @__PURE__ */ n("div", { className: "flex items-start gap-2 py-0", children: [
|
|
652
|
+
/* @__PURE__ */ e(kt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
653
653
|
/* @__PURE__ */ n("div", { className: "flex-1", children: [
|
|
654
654
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-0", children: [
|
|
655
655
|
/* @__PURE__ */ n("span", { className: "text-sm text-zinc-900 dark:text-zinc-100 font-medium", children: [
|
|
@@ -659,40 +659,40 @@ function Ee({
|
|
|
659
659
|
] }),
|
|
660
660
|
P > 0 && /* @__PURE__ */ n("span", { className: "text-xs text-zinc-500", children: [
|
|
661
661
|
"(",
|
|
662
|
-
|
|
662
|
+
H,
|
|
663
663
|
" ",
|
|
664
664
|
r.confirmed,
|
|
665
665
|
")"
|
|
666
666
|
] })
|
|
667
667
|
] }),
|
|
668
668
|
/* @__PURE__ */ n("div", { className: "mt-2 space-y-2", children: [
|
|
669
|
-
|
|
670
|
-
(
|
|
669
|
+
v ? a.slice(0, 6).map(
|
|
670
|
+
(M, $) => C ? C(M, $) : /* @__PURE__ */ e(
|
|
671
671
|
Se,
|
|
672
672
|
{
|
|
673
|
-
participant:
|
|
673
|
+
participant: M,
|
|
674
674
|
isEventCanceled: t.isCanceled,
|
|
675
675
|
labels: r
|
|
676
676
|
},
|
|
677
|
-
|
|
677
|
+
M.id
|
|
678
678
|
)
|
|
679
|
-
) : u.slice(0, 6).map((
|
|
680
|
-
const
|
|
681
|
-
id: String(
|
|
682
|
-
name:
|
|
679
|
+
) : u.slice(0, 6).map((M, $) => {
|
|
680
|
+
const se = {
|
|
681
|
+
id: String($),
|
|
682
|
+
name: M,
|
|
683
683
|
email: "",
|
|
684
684
|
isConfirmed: t.isAccepted,
|
|
685
|
-
isOrganizer:
|
|
685
|
+
isOrganizer: $ === 0,
|
|
686
686
|
isClient: !1
|
|
687
687
|
};
|
|
688
|
-
return C ? C(
|
|
688
|
+
return C ? C(se, $) : /* @__PURE__ */ e(
|
|
689
689
|
Se,
|
|
690
690
|
{
|
|
691
|
-
participant:
|
|
691
|
+
participant: se,
|
|
692
692
|
isEventCanceled: t.isCanceled,
|
|
693
693
|
labels: r
|
|
694
694
|
},
|
|
695
|
-
|
|
695
|
+
M
|
|
696
696
|
);
|
|
697
697
|
}),
|
|
698
698
|
P > 6 && /* @__PURE__ */ n("div", { className: "text-xs text-zinc-500 py-1.5 pl-10", children: [
|
|
@@ -705,32 +705,32 @@ function Ee({
|
|
|
705
705
|
] })
|
|
706
706
|
] }),
|
|
707
707
|
t.description && /* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
|
|
708
|
-
/* @__PURE__ */ e(
|
|
708
|
+
/* @__PURE__ */ e(Dt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
709
709
|
/* @__PURE__ */ e("p", { className: "text-sm text-zinc-700 dark:text-zinc-300 whitespace-pre-wrap", children: t.description })
|
|
710
710
|
] }),
|
|
711
711
|
/* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
|
|
712
|
-
/* @__PURE__ */ e(
|
|
713
|
-
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-700 dark:text-zinc-300", children:
|
|
712
|
+
/* @__PURE__ */ e(Ct, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
713
|
+
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: v && a.find((M) => M.isOrganizer)?.name || u[0] || "Calendar" })
|
|
714
714
|
] })
|
|
715
715
|
] }),
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
/* @__PURE__ */ e(
|
|
716
|
+
E && f && c && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 mt-3 py-3", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
717
|
+
m ? /* @__PURE__ */ n(et, { children: [
|
|
718
|
+
/* @__PURE__ */ e(tt, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "flex", children: [
|
|
719
719
|
/* @__PURE__ */ e(
|
|
720
720
|
ae,
|
|
721
721
|
{
|
|
722
722
|
size: "sm",
|
|
723
723
|
variant: "outline",
|
|
724
|
-
className:
|
|
724
|
+
className: h(
|
|
725
725
|
"rounded-r-none gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
726
726
|
k && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
727
727
|
),
|
|
728
|
-
onClick: (
|
|
729
|
-
|
|
728
|
+
onClick: (M) => {
|
|
729
|
+
M.stopPropagation(), k || f(t);
|
|
730
730
|
},
|
|
731
|
-
disabled:
|
|
732
|
-
children:
|
|
733
|
-
k && /* @__PURE__ */ e(
|
|
731
|
+
disabled: z,
|
|
732
|
+
children: z ? /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(re, { children: [
|
|
733
|
+
k && /* @__PURE__ */ e(he, { className: "h-3.5 w-3.5" }),
|
|
734
734
|
r.going
|
|
735
735
|
] })
|
|
736
736
|
}
|
|
@@ -740,31 +740,31 @@ function Ee({
|
|
|
740
740
|
{
|
|
741
741
|
size: "sm",
|
|
742
742
|
variant: "outline",
|
|
743
|
-
className:
|
|
743
|
+
className: h(
|
|
744
744
|
"rounded-l-none px-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
745
745
|
k && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
746
746
|
),
|
|
747
|
-
children: /* @__PURE__ */ e(
|
|
747
|
+
children: /* @__PURE__ */ e(yt, { className: "h-3.5 w-3.5" })
|
|
748
748
|
}
|
|
749
749
|
)
|
|
750
750
|
] }) }),
|
|
751
|
-
/* @__PURE__ */ n(
|
|
751
|
+
/* @__PURE__ */ n(rt, { align: "start", children: [
|
|
752
752
|
/* @__PURE__ */ n(
|
|
753
753
|
Ce,
|
|
754
754
|
{
|
|
755
|
-
className:
|
|
755
|
+
className: h(
|
|
756
756
|
"gap-1.5 h-8 !border-none !bg-green-50 text-green-800 hover:!bg-green-100",
|
|
757
757
|
k && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
758
758
|
),
|
|
759
759
|
onClick: () => f(t),
|
|
760
760
|
children: [
|
|
761
|
-
/* @__PURE__ */ e(
|
|
761
|
+
/* @__PURE__ */ e(he, { className: "h-3.5 w-3.5 mr-2 text-green-600" }),
|
|
762
762
|
r.acceptThisEvent
|
|
763
763
|
]
|
|
764
764
|
}
|
|
765
765
|
),
|
|
766
766
|
/* @__PURE__ */ n(Ce, { onClick: () => f(t), children: [
|
|
767
|
-
/* @__PURE__ */ e(
|
|
767
|
+
/* @__PURE__ */ e(he, { className: "h-3.5 w-3.5 mr-2 text-green-600" }),
|
|
768
768
|
r.acceptAllEvents
|
|
769
769
|
] })
|
|
770
770
|
] })
|
|
@@ -773,16 +773,16 @@ function Ee({
|
|
|
773
773
|
{
|
|
774
774
|
size: "sm",
|
|
775
775
|
variant: "outline",
|
|
776
|
-
className:
|
|
776
|
+
className: h(
|
|
777
777
|
"gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
778
778
|
k && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
779
779
|
),
|
|
780
780
|
onClick: () => {
|
|
781
781
|
k || f(t);
|
|
782
782
|
},
|
|
783
|
-
disabled:
|
|
784
|
-
children:
|
|
785
|
-
k && /* @__PURE__ */ e(
|
|
783
|
+
disabled: z,
|
|
784
|
+
children: z ? /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(re, { children: [
|
|
785
|
+
k && /* @__PURE__ */ e(he, { className: "h-3.5 w-3.5" }),
|
|
786
786
|
r.going
|
|
787
787
|
] })
|
|
788
788
|
}
|
|
@@ -792,42 +792,42 @@ function Ee({
|
|
|
792
792
|
{
|
|
793
793
|
size: "sm",
|
|
794
794
|
variant: "outline",
|
|
795
|
-
className:
|
|
795
|
+
className: h(
|
|
796
796
|
"gap-1.5 h-8 !border-none !bg-rose-100 text-rose-800 hover:!bg-rose-200",
|
|
797
|
-
|
|
797
|
+
N && "!bg-rose-700 !text-white hover:!bg-rose-700"
|
|
798
798
|
),
|
|
799
799
|
onClick: () => {
|
|
800
|
-
|
|
800
|
+
N || c(t);
|
|
801
801
|
},
|
|
802
|
-
disabled:
|
|
803
|
-
children:
|
|
804
|
-
|
|
802
|
+
disabled: T,
|
|
803
|
+
children: T ? /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(re, { children: [
|
|
804
|
+
N && /* @__PURE__ */ e(ge, { className: "h-3.5 w-3.5" }),
|
|
805
805
|
r.notGoing
|
|
806
806
|
] })
|
|
807
807
|
}
|
|
808
808
|
)
|
|
809
809
|
] }) }),
|
|
810
|
-
|
|
810
|
+
W && k && !t.meetingTookPlace && !t.isCanceled && x && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 py-3", children: /* @__PURE__ */ n(
|
|
811
811
|
ae,
|
|
812
812
|
{
|
|
813
813
|
size: "sm",
|
|
814
814
|
variant: "outline",
|
|
815
815
|
className: "w-full h-9 hover:!bg-green-100 hover:text-green-700 text-green-700 !bg-green-100 !border-none dark:text-green-400 dark:hover:bg-green-950/30",
|
|
816
816
|
onClick: () => x(t),
|
|
817
|
-
disabled:
|
|
817
|
+
disabled: w,
|
|
818
818
|
children: [
|
|
819
|
-
|
|
819
|
+
w && /* @__PURE__ */ e(ce, { className: "h-4 w-4 mr-2" }),
|
|
820
820
|
r.confirmMeeting
|
|
821
821
|
]
|
|
822
822
|
}
|
|
823
823
|
) })
|
|
824
824
|
] }),
|
|
825
825
|
V ? j && V({
|
|
826
|
-
onConfirm:
|
|
826
|
+
onConfirm: y,
|
|
827
827
|
onCancel: () => _(!1),
|
|
828
|
-
isLoading:
|
|
828
|
+
isLoading: I
|
|
829
829
|
}) : /* @__PURE__ */ e(
|
|
830
|
-
|
|
830
|
+
zt,
|
|
831
831
|
{
|
|
832
832
|
open: j,
|
|
833
833
|
onOpenChange: _,
|
|
@@ -835,95 +835,95 @@ function Ee({
|
|
|
835
835
|
description: r.deleteConfirmDescription,
|
|
836
836
|
cancelLabel: r.cancel,
|
|
837
837
|
confirmLabel: r.delete,
|
|
838
|
-
onConfirm:
|
|
839
|
-
isLoading:
|
|
838
|
+
onConfirm: y,
|
|
839
|
+
isLoading: I
|
|
840
840
|
}
|
|
841
841
|
)
|
|
842
842
|
] });
|
|
843
843
|
}
|
|
844
|
-
function
|
|
844
|
+
function Gr({
|
|
845
845
|
event: t,
|
|
846
846
|
children: r,
|
|
847
847
|
open: o,
|
|
848
848
|
onOpenChange: s,
|
|
849
|
-
isLoading:
|
|
850
|
-
labels:
|
|
849
|
+
isLoading: i,
|
|
850
|
+
labels: l,
|
|
851
851
|
onEdit: g,
|
|
852
852
|
onDelete: f,
|
|
853
853
|
onCancel: c,
|
|
854
854
|
onAccept: x,
|
|
855
855
|
onDecline: b,
|
|
856
856
|
onConfirmMeeting: p,
|
|
857
|
-
canEdit:
|
|
858
|
-
canDelete:
|
|
859
|
-
canCancel:
|
|
857
|
+
canEdit: S = !0,
|
|
858
|
+
canDelete: W = !1,
|
|
859
|
+
canCancel: L = !0,
|
|
860
860
|
isCurrentUserParticipant: D,
|
|
861
|
-
isCurrentUserClient:
|
|
862
|
-
currentUserAcceptStatus:
|
|
863
|
-
isAcceptLoading:
|
|
864
|
-
isDeclineLoading:
|
|
861
|
+
isCurrentUserClient: z,
|
|
862
|
+
currentUserAcceptStatus: T,
|
|
863
|
+
isAcceptLoading: w,
|
|
864
|
+
isDeclineLoading: I,
|
|
865
865
|
isConfirmLoading: C,
|
|
866
|
-
isDeleteLoading:
|
|
866
|
+
isDeleteLoading: A,
|
|
867
867
|
renderParticipant: R,
|
|
868
868
|
renderHeaderActions: V,
|
|
869
|
-
renderCancelReason:
|
|
869
|
+
renderCancelReason: F,
|
|
870
870
|
renderDeleteConfirmation: O,
|
|
871
871
|
formatDate: j,
|
|
872
872
|
formatTimeRange: _,
|
|
873
873
|
className: U,
|
|
874
|
-
width:
|
|
874
|
+
width: m = 360
|
|
875
875
|
}) {
|
|
876
|
-
const
|
|
876
|
+
const a = It("(min-width: 768px)"), u = { ...Mt, ...l }, v = ne(() => {
|
|
877
877
|
s?.(!1);
|
|
878
878
|
}, [s]), k = {
|
|
879
879
|
event: t,
|
|
880
880
|
labels: u,
|
|
881
|
-
isLoading:
|
|
882
|
-
onClose:
|
|
881
|
+
isLoading: i,
|
|
882
|
+
onClose: v,
|
|
883
883
|
onEdit: g,
|
|
884
884
|
onDelete: f,
|
|
885
885
|
onCancel: c,
|
|
886
886
|
onAccept: x,
|
|
887
887
|
onDecline: b,
|
|
888
888
|
onConfirmMeeting: p,
|
|
889
|
-
canEdit:
|
|
890
|
-
canDelete:
|
|
891
|
-
canCancel:
|
|
889
|
+
canEdit: S,
|
|
890
|
+
canDelete: W,
|
|
891
|
+
canCancel: L,
|
|
892
892
|
isCurrentUserParticipant: D,
|
|
893
|
-
isCurrentUserClient:
|
|
894
|
-
currentUserAcceptStatus:
|
|
895
|
-
isAcceptLoading:
|
|
896
|
-
isDeclineLoading:
|
|
893
|
+
isCurrentUserClient: z,
|
|
894
|
+
currentUserAcceptStatus: T,
|
|
895
|
+
isAcceptLoading: w,
|
|
896
|
+
isDeclineLoading: I,
|
|
897
897
|
isConfirmLoading: C,
|
|
898
|
-
isDeleteLoading:
|
|
898
|
+
isDeleteLoading: A,
|
|
899
899
|
renderParticipant: R,
|
|
900
900
|
renderHeaderActions: V,
|
|
901
|
-
renderCancelReason:
|
|
901
|
+
renderCancelReason: F,
|
|
902
902
|
renderDeleteConfirmation: O,
|
|
903
903
|
formatDate: j,
|
|
904
904
|
formatTimeRange: _
|
|
905
905
|
};
|
|
906
|
-
return
|
|
906
|
+
return a ? /* @__PURE__ */ n(Pe, { open: o ?? !1, onOpenChange: s ?? (() => {
|
|
907
907
|
}), children: [
|
|
908
908
|
/* @__PURE__ */ e(_e, { asChild: !0, children: r }),
|
|
909
909
|
/* @__PURE__ */ e(
|
|
910
910
|
Re,
|
|
911
911
|
{
|
|
912
|
-
className:
|
|
912
|
+
className: h(
|
|
913
913
|
"p-0 shadow-lg !rounded-2xl bg-white dark:bg-zinc-900 overflow-hidden border z-50",
|
|
914
914
|
U
|
|
915
915
|
),
|
|
916
|
-
style: { width:
|
|
916
|
+
style: { width: m },
|
|
917
917
|
align: "center",
|
|
918
918
|
side: "bottom",
|
|
919
919
|
sideOffset: 4,
|
|
920
920
|
children: /* @__PURE__ */ e(Ee, { ...k })
|
|
921
921
|
}
|
|
922
922
|
)
|
|
923
|
-
] }) : /* @__PURE__ */ n(
|
|
923
|
+
] }) : /* @__PURE__ */ n(re, { children: [
|
|
924
924
|
r,
|
|
925
925
|
/* @__PURE__ */ e(
|
|
926
|
-
|
|
926
|
+
Et,
|
|
927
927
|
{
|
|
928
928
|
open: o ?? !1,
|
|
929
929
|
onOpenChange: s ?? (() => {
|
|
@@ -934,29 +934,29 @@ function Yr({
|
|
|
934
934
|
)
|
|
935
935
|
] });
|
|
936
936
|
}
|
|
937
|
-
const ve = 44, ze = 4,
|
|
938
|
-
function
|
|
937
|
+
const ve = 44, ze = 4, jt = 56, He = 8, we = 80, de = 140, Le = 100, Te = 2, Wt = 8, At = 18;
|
|
938
|
+
function Ft(t) {
|
|
939
939
|
return t.split(" ").map((r) => r[0]).join("").toUpperCase().slice(0, 2);
|
|
940
940
|
}
|
|
941
|
-
function
|
|
941
|
+
function $t(t, r) {
|
|
942
942
|
const o = [];
|
|
943
943
|
for (let s = 0; s < r; s++) {
|
|
944
|
-
const
|
|
945
|
-
|
|
944
|
+
const i = new Date(t);
|
|
945
|
+
i.setDate(i.getDate() + s), o.push(i);
|
|
946
946
|
}
|
|
947
947
|
return o;
|
|
948
948
|
}
|
|
949
949
|
function Bt(t, r, o) {
|
|
950
950
|
const s = [];
|
|
951
|
-
return t.forEach((
|
|
951
|
+
return t.forEach((i, l) => {
|
|
952
952
|
for (let g = r; g < o; g++)
|
|
953
|
-
s.push({ hour: g, dayIndex:
|
|
953
|
+
s.push({ hour: g, dayIndex: l, date: i });
|
|
954
954
|
}), s;
|
|
955
955
|
}
|
|
956
|
-
function
|
|
956
|
+
function Ot(t) {
|
|
957
957
|
return `${t.toString().padStart(2, "0")}:00`;
|
|
958
958
|
}
|
|
959
|
-
function
|
|
959
|
+
function Pt(t) {
|
|
960
960
|
return t.toLocaleDateString("en-US", {
|
|
961
961
|
weekday: "short",
|
|
962
962
|
month: "short",
|
|
@@ -964,23 +964,23 @@ function Ot(t) {
|
|
|
964
964
|
});
|
|
965
965
|
}
|
|
966
966
|
function Ie(t) {
|
|
967
|
-
const r = [...t].sort((
|
|
968
|
-
for (const
|
|
969
|
-
let
|
|
970
|
-
for (; s[
|
|
971
|
-
|
|
972
|
-
s[
|
|
973
|
-
...
|
|
974
|
-
stackIndex:
|
|
967
|
+
const r = [...t].sort((i, l) => i.startCol !== l.startCol ? i.startCol - l.startCol : l.spanCols - i.spanCols), o = [], s = [];
|
|
968
|
+
for (const i of r) {
|
|
969
|
+
let l = 0;
|
|
970
|
+
for (; s[l] !== void 0 && s[l] > i.startCol; )
|
|
971
|
+
l++;
|
|
972
|
+
s[l] = i.startCol + i.spanCols, o.push({
|
|
973
|
+
...i,
|
|
974
|
+
stackIndex: l
|
|
975
975
|
});
|
|
976
976
|
}
|
|
977
977
|
return o;
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function _t({ src: t, alt: r, fallback: o, className: s }) {
|
|
980
980
|
return /* @__PURE__ */ e(
|
|
981
981
|
"div",
|
|
982
982
|
{
|
|
983
|
-
className:
|
|
983
|
+
className: h(
|
|
984
984
|
"relative flex shrink-0 overflow-hidden rounded-sm border bg-muted",
|
|
985
985
|
s
|
|
986
986
|
),
|
|
@@ -995,14 +995,14 @@ function Pt({ src: t, alt: r, fallback: o, className: s }) {
|
|
|
995
995
|
}
|
|
996
996
|
);
|
|
997
997
|
}
|
|
998
|
-
const
|
|
999
|
-
function
|
|
1000
|
-
daysToShow: t =
|
|
998
|
+
const Rt = 7;
|
|
999
|
+
function ue({
|
|
1000
|
+
daysToShow: t = Rt,
|
|
1001
1001
|
events: r,
|
|
1002
1002
|
users: o = [],
|
|
1003
1003
|
selectedDate: s,
|
|
1004
|
-
onDateChange:
|
|
1005
|
-
onEventClick:
|
|
1004
|
+
onDateChange: i,
|
|
1005
|
+
onEventClick: l,
|
|
1006
1006
|
visibleHours: g,
|
|
1007
1007
|
className: f,
|
|
1008
1008
|
getEventUserId: c,
|
|
@@ -1010,30 +1010,30 @@ function de({
|
|
|
1010
1010
|
slots: b,
|
|
1011
1011
|
classNames: p
|
|
1012
1012
|
}) {
|
|
1013
|
-
const
|
|
1014
|
-
const
|
|
1013
|
+
const S = Ne(null), W = s ?? /* @__PURE__ */ new Date(), L = !0, D = g?.from ?? Wt, z = g?.to ?? At, T = z - D, w = B(() => {
|
|
1014
|
+
const a = new Date(W);
|
|
1015
1015
|
if (t === 1 || t === 3)
|
|
1016
|
-
return
|
|
1017
|
-
const u =
|
|
1018
|
-
return
|
|
1019
|
-
}, [
|
|
1020
|
-
() =>
|
|
1021
|
-
[
|
|
1022
|
-
), C =
|
|
1023
|
-
() => Bt(
|
|
1024
|
-
[
|
|
1025
|
-
), R = c ?? ((
|
|
1026
|
-
if (
|
|
1027
|
-
const u =
|
|
1016
|
+
return a.setHours(0, 0, 0, 0), a;
|
|
1017
|
+
const u = a.getDay(), v = u === 0 ? -6 : 1 - u;
|
|
1018
|
+
return a.setDate(a.getDate() + v), a.setHours(0, 0, 0, 0), a;
|
|
1019
|
+
}, [W, t]), I = B(
|
|
1020
|
+
() => $t(w, t),
|
|
1021
|
+
[w, t]
|
|
1022
|
+
), C = B(
|
|
1023
|
+
() => Bt(I, D, z),
|
|
1024
|
+
[L, I, D, z]
|
|
1025
|
+
), R = c ?? ((a) => {
|
|
1026
|
+
if (a.resourceId) return a.resourceId;
|
|
1027
|
+
const u = a.data;
|
|
1028
1028
|
if (u?.userId) return String(u.userId);
|
|
1029
1029
|
if (u?.user && typeof u.user == "object" && u.user.id)
|
|
1030
1030
|
return String(u.user.id);
|
|
1031
|
-
if (
|
|
1032
|
-
if (
|
|
1033
|
-
}), V =
|
|
1034
|
-
const
|
|
1031
|
+
if (a.user?.id) return a.user.id;
|
|
1032
|
+
if (a.participants?.[0]?.id) return a.participants[0].id;
|
|
1033
|
+
}), V = B(() => {
|
|
1034
|
+
const a = /* @__PURE__ */ new Map();
|
|
1035
1035
|
for (const u of o)
|
|
1036
|
-
|
|
1036
|
+
a.set(u.id, {
|
|
1037
1037
|
id: u.id,
|
|
1038
1038
|
name: u.name,
|
|
1039
1039
|
avatar: u.avatar ?? void 0,
|
|
@@ -1041,158 +1041,158 @@ function de({
|
|
|
1041
1041
|
});
|
|
1042
1042
|
for (const u of r) {
|
|
1043
1043
|
const k = u.data?.user;
|
|
1044
|
-
k?.id && !
|
|
1044
|
+
k?.id && !a.has(k.id) && a.set(k.id, {
|
|
1045
1045
|
id: k.id,
|
|
1046
1046
|
name: k.name ?? "",
|
|
1047
1047
|
avatar: k.avatar ?? void 0,
|
|
1048
1048
|
email: k.email
|
|
1049
|
-
}), u.user?.id && !
|
|
1049
|
+
}), u.user?.id && !a.has(u.user.id) && a.set(u.user.id, {
|
|
1050
1050
|
id: u.user.id,
|
|
1051
1051
|
name: u.user.name,
|
|
1052
1052
|
avatar: u.user.avatar ?? void 0,
|
|
1053
1053
|
email: u.user.email
|
|
1054
1054
|
});
|
|
1055
|
-
for (const
|
|
1056
|
-
|
|
1057
|
-
id:
|
|
1058
|
-
name:
|
|
1059
|
-
avatar:
|
|
1060
|
-
email:
|
|
1055
|
+
for (const N of u.participants || [])
|
|
1056
|
+
N.id && !a.has(N.id) && a.set(N.id, {
|
|
1057
|
+
id: N.id,
|
|
1058
|
+
name: N.name,
|
|
1059
|
+
avatar: N.avatar ?? void 0,
|
|
1060
|
+
email: N.email
|
|
1061
1061
|
});
|
|
1062
1062
|
}
|
|
1063
|
-
return Array.from(
|
|
1064
|
-
}, [o, r]),
|
|
1065
|
-
const
|
|
1066
|
-
for (const
|
|
1067
|
-
u.set(
|
|
1063
|
+
return Array.from(a.values());
|
|
1064
|
+
}, [o, r]), F = B(() => {
|
|
1065
|
+
const a = [], u = /* @__PURE__ */ new Map();
|
|
1066
|
+
for (const N of V)
|
|
1067
|
+
u.set(N.id, []);
|
|
1068
1068
|
u.set("unassigned", []);
|
|
1069
|
-
for (const
|
|
1070
|
-
const
|
|
1071
|
-
(u.get(
|
|
1069
|
+
for (const N of r) {
|
|
1070
|
+
const E = R(N) ?? "unassigned";
|
|
1071
|
+
(u.get(E) ?? u.get("unassigned")).push(N);
|
|
1072
1072
|
}
|
|
1073
|
-
const
|
|
1074
|
-
const
|
|
1075
|
-
for (const
|
|
1076
|
-
const P =
|
|
1077
|
-
for (let
|
|
1078
|
-
const
|
|
1079
|
-
if (
|
|
1080
|
-
let
|
|
1081
|
-
if (
|
|
1073
|
+
const v = (N) => {
|
|
1074
|
+
const E = [];
|
|
1075
|
+
for (const H of N) {
|
|
1076
|
+
const P = H.startDate.getHours() + H.startDate.getMinutes() / 60, K = H.endDate.getHours() + H.endDate.getMinutes() / 60;
|
|
1077
|
+
for (let Y = 0; Y < I.length; Y++) {
|
|
1078
|
+
const q = I[Y], ie = pe(q), le = Ve(q);
|
|
1079
|
+
if (H.startDate <= le && H.endDate >= ie) {
|
|
1080
|
+
let d = D, y = z;
|
|
1081
|
+
if (H.startDate >= ie && (d = Math.max(D, P)), H.endDate <= le && (y = Math.min(z, K)), d = Math.max(
|
|
1082
1082
|
D,
|
|
1083
|
-
Math.min(
|
|
1084
|
-
),
|
|
1083
|
+
Math.min(z, d)
|
|
1084
|
+
), y = Math.max(
|
|
1085
1085
|
D,
|
|
1086
|
-
Math.min(
|
|
1087
|
-
),
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1090
|
-
event:
|
|
1091
|
-
startCol:
|
|
1092
|
-
spanCols: Math.max(1,
|
|
1086
|
+
Math.min(z, y)
|
|
1087
|
+
), y > d) {
|
|
1088
|
+
const M = Y * T + Math.floor(d - D), $ = Y * T + Math.ceil(y - D);
|
|
1089
|
+
E.push({
|
|
1090
|
+
event: H,
|
|
1091
|
+
startCol: M,
|
|
1092
|
+
spanCols: Math.max(1, $ - M)
|
|
1093
1093
|
});
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
1096
|
}
|
|
1097
1097
|
}
|
|
1098
|
-
return
|
|
1098
|
+
return E;
|
|
1099
1099
|
};
|
|
1100
|
-
for (const
|
|
1101
|
-
const
|
|
1102
|
-
(
|
|
1100
|
+
for (const N of V) {
|
|
1101
|
+
const E = u.get(N.id) ?? [], H = v(E), P = Ie(H), K = P.reduce(
|
|
1102
|
+
(Y, q) => Math.max(Y, q.stackIndex + 1),
|
|
1103
1103
|
0
|
|
1104
1104
|
);
|
|
1105
|
-
|
|
1106
|
-
user:
|
|
1105
|
+
a.push({
|
|
1106
|
+
user: N,
|
|
1107
1107
|
events: P,
|
|
1108
|
-
maxStack: Math.max(
|
|
1108
|
+
maxStack: Math.max(K, 1)
|
|
1109
1109
|
});
|
|
1110
1110
|
}
|
|
1111
1111
|
const k = u.get("unassigned") ?? [];
|
|
1112
1112
|
if (k.length > 0) {
|
|
1113
|
-
const
|
|
1114
|
-
(P,
|
|
1113
|
+
const N = v(k), E = Ie(N), H = E.reduce(
|
|
1114
|
+
(P, K) => Math.max(P, K.stackIndex + 1),
|
|
1115
1115
|
0
|
|
1116
1116
|
);
|
|
1117
|
-
|
|
1117
|
+
a.push({
|
|
1118
1118
|
user: {
|
|
1119
1119
|
id: "unassigned",
|
|
1120
1120
|
name: "Unassigned",
|
|
1121
1121
|
avatar: void 0,
|
|
1122
1122
|
email: void 0
|
|
1123
1123
|
},
|
|
1124
|
-
events:
|
|
1125
|
-
maxStack: Math.max(
|
|
1124
|
+
events: E,
|
|
1125
|
+
maxStack: Math.max(H, 1)
|
|
1126
1126
|
});
|
|
1127
1127
|
}
|
|
1128
|
-
return
|
|
1128
|
+
return a.filter((N) => N.events.length > 0);
|
|
1129
1129
|
}, [
|
|
1130
1130
|
V,
|
|
1131
1131
|
r,
|
|
1132
|
+
I,
|
|
1133
|
+
L,
|
|
1132
1134
|
T,
|
|
1133
|
-
z,
|
|
1134
|
-
H,
|
|
1135
1135
|
D,
|
|
1136
|
-
|
|
1136
|
+
z,
|
|
1137
1137
|
R
|
|
1138
|
-
]), O =
|
|
1139
|
-
const
|
|
1140
|
-
for (const u of
|
|
1141
|
-
for (const
|
|
1142
|
-
if (
|
|
1143
|
-
const k =
|
|
1144
|
-
|
|
1138
|
+
]), O = B(() => {
|
|
1139
|
+
const a = /* @__PURE__ */ new Map();
|
|
1140
|
+
for (const u of F)
|
|
1141
|
+
for (const v of u.events)
|
|
1142
|
+
if (v.spanCols === 1) {
|
|
1143
|
+
const k = a.get(v.startCol) ?? 0;
|
|
1144
|
+
a.set(v.startCol, k + 1);
|
|
1145
1145
|
}
|
|
1146
|
-
return
|
|
1147
|
-
}, [
|
|
1148
|
-
const
|
|
1149
|
-
for (let k = 0; k <
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1152
|
-
Le + (
|
|
1153
|
-
) :
|
|
1146
|
+
return a;
|
|
1147
|
+
}, [F]), j = B(() => {
|
|
1148
|
+
const a = C.length, u = we, v = [];
|
|
1149
|
+
for (let k = 0; k < a; k++) {
|
|
1150
|
+
const N = O.get(k) ?? 0;
|
|
1151
|
+
N > Te ? v.push(
|
|
1152
|
+
Le + (N - Te) * 20
|
|
1153
|
+
) : N > 0 ? v.push(Math.max(u, Le)) : v.push(u);
|
|
1154
1154
|
}
|
|
1155
|
-
return
|
|
1155
|
+
return v;
|
|
1156
1156
|
}, [
|
|
1157
|
-
|
|
1157
|
+
L,
|
|
1158
1158
|
C.length,
|
|
1159
|
-
|
|
1159
|
+
I.length,
|
|
1160
1160
|
O
|
|
1161
|
-
]), _ = (
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
), U =
|
|
1165
|
-
const
|
|
1161
|
+
]), _ = (a) => Math.max(
|
|
1162
|
+
jt,
|
|
1163
|
+
a * (ve + ze) + He * 2
|
|
1164
|
+
), U = de + j.reduce((a, u) => a + u, 0), m = B(() => {
|
|
1165
|
+
const a = [0];
|
|
1166
1166
|
for (let u = 0; u < j.length; u++)
|
|
1167
|
-
|
|
1168
|
-
return
|
|
1167
|
+
a.push(a[u] + j[u]);
|
|
1168
|
+
return a;
|
|
1169
1169
|
}, [j]);
|
|
1170
|
-
return
|
|
1171
|
-
const
|
|
1172
|
-
if (!
|
|
1170
|
+
return Qe(() => {
|
|
1171
|
+
const a = S.current;
|
|
1172
|
+
if (!a) return;
|
|
1173
1173
|
const u = () => {
|
|
1174
|
-
let
|
|
1175
|
-
const
|
|
1174
|
+
let v = -1;
|
|
1175
|
+
const N = (/* @__PURE__ */ new Date()).getHours();
|
|
1176
1176
|
{
|
|
1177
|
-
for (let
|
|
1178
|
-
const
|
|
1179
|
-
if (
|
|
1180
|
-
|
|
1177
|
+
for (let E = 0; E < C.length; E++) {
|
|
1178
|
+
const H = C[E];
|
|
1179
|
+
if (H && G(H.date) && H.hour <= N && H.hour + 1 > N) {
|
|
1180
|
+
v = E;
|
|
1181
1181
|
break;
|
|
1182
1182
|
}
|
|
1183
1183
|
}
|
|
1184
|
-
if (
|
|
1185
|
-
for (let
|
|
1186
|
-
const
|
|
1187
|
-
if (
|
|
1188
|
-
|
|
1184
|
+
if (v === -1)
|
|
1185
|
+
for (let E = 0; E < C.length; E++) {
|
|
1186
|
+
const H = C[E];
|
|
1187
|
+
if (H && G(H.date)) {
|
|
1188
|
+
v = E;
|
|
1189
1189
|
break;
|
|
1190
1190
|
}
|
|
1191
1191
|
}
|
|
1192
1192
|
}
|
|
1193
|
-
if (
|
|
1194
|
-
const
|
|
1195
|
-
|
|
1193
|
+
if (v !== -1) {
|
|
1194
|
+
const E = (m[v] ?? 0) + de, H = a.clientWidth, P = Math.max(0, E - H / 3);
|
|
1195
|
+
a.scrollTo({
|
|
1196
1196
|
left: P,
|
|
1197
1197
|
behavior: "instant"
|
|
1198
1198
|
});
|
|
@@ -1201,7 +1201,7 @@ function de({
|
|
|
1201
1201
|
requestAnimationFrame(() => {
|
|
1202
1202
|
requestAnimationFrame(u);
|
|
1203
1203
|
});
|
|
1204
|
-
}, [
|
|
1204
|
+
}, [W, C, I, m, L]), /* @__PURE__ */ e("div", { className: h("flex h-full flex-col", f), children: /* @__PURE__ */ e("div", { className: "ic-timeline-scroll-container flex-1", ref: S, children: /* @__PURE__ */ n("div", { className: "relative", style: { minWidth: U }, children: [
|
|
1205
1205
|
// Hour mode: Day headers + Hour sub-headers - sticky wrapper with flex child (sticky + flex breaks sticky)
|
|
1206
1206
|
/* @__PURE__ */ e("div", { className: "ic-timeline-header sticky top-0 z-20 border-b bg-background", children: /* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
1207
1207
|
t > 1 && /* @__PURE__ */ n("div", { className: "flex border-b", children: [
|
|
@@ -1209,23 +1209,23 @@ function de({
|
|
|
1209
1209
|
"div",
|
|
1210
1210
|
{
|
|
1211
1211
|
className: "flex shrink-0 items-center border-r bg-background px-2 py-1",
|
|
1212
|
-
style: { width:
|
|
1212
|
+
style: { width: de },
|
|
1213
1213
|
children: /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase text-muted-foreground", children: "Resources" })
|
|
1214
1214
|
}
|
|
1215
1215
|
),
|
|
1216
|
-
|
|
1217
|
-
const
|
|
1216
|
+
I.map((a, u) => {
|
|
1217
|
+
const v = G(a), k = u * T, N = j.slice(k, k + T).reduce((E, H) => E + H, 0);
|
|
1218
1218
|
return /* @__PURE__ */ e(
|
|
1219
1219
|
"div",
|
|
1220
1220
|
{
|
|
1221
|
-
className:
|
|
1221
|
+
className: h(
|
|
1222
1222
|
"flex shrink-0 items-center justify-center border-r py-1.5 font-medium",
|
|
1223
|
-
|
|
1223
|
+
v ? "bg-primary/10 text-primary" : "bg-muted/30"
|
|
1224
1224
|
),
|
|
1225
|
-
style: { width:
|
|
1226
|
-
children: /* @__PURE__ */ e("span", { className: "text-xs", children:
|
|
1225
|
+
style: { width: N },
|
|
1226
|
+
children: /* @__PURE__ */ e("span", { className: "text-xs", children: Pt(a) })
|
|
1227
1227
|
},
|
|
1228
|
-
`day-${
|
|
1228
|
+
`day-${a.toISOString()}`
|
|
1229
1229
|
);
|
|
1230
1230
|
})
|
|
1231
1231
|
] }),
|
|
@@ -1233,38 +1233,38 @@ function de({
|
|
|
1233
1233
|
/* @__PURE__ */ e(
|
|
1234
1234
|
"div",
|
|
1235
1235
|
{
|
|
1236
|
-
className:
|
|
1236
|
+
className: h(
|
|
1237
1237
|
"flex shrink-0 items-center border-r bg-background px-2 py-2",
|
|
1238
1238
|
t > 1 && "sticky left-0 z-10"
|
|
1239
1239
|
),
|
|
1240
|
-
style: { width:
|
|
1240
|
+
style: { width: de },
|
|
1241
1241
|
children: t === 1 && /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase text-muted-foreground", children: "Resources" })
|
|
1242
1242
|
}
|
|
1243
1243
|
),
|
|
1244
|
-
C.map((
|
|
1245
|
-
const
|
|
1244
|
+
C.map((a, u) => {
|
|
1245
|
+
const v = a.hour === D, k = G(a.date), N = j[u] ?? we;
|
|
1246
1246
|
return /* @__PURE__ */ e(
|
|
1247
1247
|
"div",
|
|
1248
1248
|
{
|
|
1249
|
-
className:
|
|
1249
|
+
className: h(
|
|
1250
1250
|
"flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",
|
|
1251
|
-
|
|
1251
|
+
v && u > 0 ? "border-l-2 border-l-border" : "border-r border-r-border/50",
|
|
1252
1252
|
k && "bg-primary/5"
|
|
1253
1253
|
),
|
|
1254
|
-
style: { width:
|
|
1255
|
-
children:
|
|
1254
|
+
style: { width: N },
|
|
1255
|
+
children: Ot(a.hour)
|
|
1256
1256
|
},
|
|
1257
|
-
`hour-${
|
|
1257
|
+
`hour-${a.dayIndex}-${a.hour}`
|
|
1258
1258
|
);
|
|
1259
1259
|
})
|
|
1260
1260
|
] })
|
|
1261
1261
|
] }) }),
|
|
1262
|
-
|
|
1263
|
-
const u = _(
|
|
1262
|
+
F.map((a) => {
|
|
1263
|
+
const u = _(a.maxStack);
|
|
1264
1264
|
return /* @__PURE__ */ n(
|
|
1265
1265
|
"div",
|
|
1266
1266
|
{
|
|
1267
|
-
className:
|
|
1267
|
+
className: h(
|
|
1268
1268
|
"relative flex border-b",
|
|
1269
1269
|
p?.resourceRow
|
|
1270
1270
|
),
|
|
@@ -1274,25 +1274,25 @@ function de({
|
|
|
1274
1274
|
"div",
|
|
1275
1275
|
{
|
|
1276
1276
|
className: "sticky left-0 z-10",
|
|
1277
|
-
style: { width:
|
|
1277
|
+
style: { width: de },
|
|
1278
1278
|
children: /* @__PURE__ */ n(
|
|
1279
1279
|
"div",
|
|
1280
1280
|
{
|
|
1281
|
-
className:
|
|
1281
|
+
className: h(
|
|
1282
1282
|
"flex h-full items-center gap-2 sm:gap-3 border-r bg-background px-2 sm:px-4",
|
|
1283
1283
|
p?.resourceHeader
|
|
1284
1284
|
),
|
|
1285
1285
|
children: [
|
|
1286
1286
|
/* @__PURE__ */ e(
|
|
1287
|
-
|
|
1287
|
+
_t,
|
|
1288
1288
|
{
|
|
1289
1289
|
className: "size-7",
|
|
1290
|
-
src:
|
|
1291
|
-
alt:
|
|
1292
|
-
fallback:
|
|
1290
|
+
src: a.user.avatar,
|
|
1291
|
+
alt: a.user.name,
|
|
1292
|
+
fallback: Ft(a.user.name)
|
|
1293
1293
|
}
|
|
1294
1294
|
),
|
|
1295
|
-
/* @__PURE__ */ e("span", { className: "truncate text-xs sm:text-sm font-medium", children:
|
|
1295
|
+
/* @__PURE__ */ e("span", { className: "truncate text-xs sm:text-sm font-medium", children: a.user.name })
|
|
1296
1296
|
]
|
|
1297
1297
|
}
|
|
1298
1298
|
)
|
|
@@ -1300,61 +1300,61 @@ function de({
|
|
|
1300
1300
|
),
|
|
1301
1301
|
/* @__PURE__ */ n("div", { className: "relative flex", children: [
|
|
1302
1302
|
// Hour mode cells
|
|
1303
|
-
C.map((
|
|
1304
|
-
const
|
|
1303
|
+
C.map((v, k) => {
|
|
1304
|
+
const N = v.hour === D && k > 0, E = j[k] ?? we;
|
|
1305
1305
|
return /* @__PURE__ */ e(
|
|
1306
1306
|
"div",
|
|
1307
1307
|
{
|
|
1308
|
-
className:
|
|
1308
|
+
className: h(
|
|
1309
1309
|
"shrink-0",
|
|
1310
|
-
|
|
1311
|
-
|
|
1310
|
+
N ? "border-l-2 border-l-border" : "border-r border-r-border/50",
|
|
1311
|
+
G(v.date) && "bg-primary/5"
|
|
1312
1312
|
),
|
|
1313
|
-
style: { width:
|
|
1313
|
+
style: { width: E }
|
|
1314
1314
|
},
|
|
1315
|
-
`cell-${
|
|
1315
|
+
`cell-${v.dayIndex}-${v.hour}`
|
|
1316
1316
|
);
|
|
1317
1317
|
}),
|
|
1318
|
-
|
|
1319
|
-
const k = (
|
|
1318
|
+
a.events.map((v) => {
|
|
1319
|
+
const k = (m[v.startCol] ?? 0) + 2, N = m[v.startCol + v.spanCols] ?? m[m.length - 1] ?? 0, E = m[v.startCol] ?? 0, H = N - E - 4, P = He + v.stackIndex * (ve + ze);
|
|
1320
1320
|
return /* @__PURE__ */ e(
|
|
1321
1321
|
"div",
|
|
1322
1322
|
{
|
|
1323
1323
|
className: "absolute",
|
|
1324
1324
|
style: {
|
|
1325
1325
|
left: k,
|
|
1326
|
-
width: Math.max(
|
|
1326
|
+
width: Math.max(H, 0),
|
|
1327
1327
|
// No forced minimum - columns are guaranteed wide enough
|
|
1328
1328
|
top: P,
|
|
1329
1329
|
height: ve
|
|
1330
1330
|
},
|
|
1331
1331
|
children: /* @__PURE__ */ e(
|
|
1332
|
-
|
|
1332
|
+
nt,
|
|
1333
1333
|
{
|
|
1334
|
-
event:
|
|
1334
|
+
event: v.event,
|
|
1335
1335
|
variant: "compact",
|
|
1336
|
-
onClick:
|
|
1336
|
+
onClick: l,
|
|
1337
1337
|
renderPopover: x,
|
|
1338
|
-
className:
|
|
1338
|
+
className: h(
|
|
1339
1339
|
"h-full w-full",
|
|
1340
1340
|
p?.eventCardCompact
|
|
1341
1341
|
)
|
|
1342
1342
|
}
|
|
1343
1343
|
)
|
|
1344
1344
|
},
|
|
1345
|
-
|
|
1345
|
+
v.event.id
|
|
1346
1346
|
);
|
|
1347
1347
|
})
|
|
1348
1348
|
] })
|
|
1349
1349
|
]
|
|
1350
1350
|
},
|
|
1351
|
-
|
|
1351
|
+
a.user.id
|
|
1352
1352
|
);
|
|
1353
1353
|
}),
|
|
1354
|
-
|
|
1354
|
+
F.length === 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-20 text-muted-foreground", children: "No users or events to display" })
|
|
1355
1355
|
] }) }) });
|
|
1356
1356
|
}
|
|
1357
|
-
const
|
|
1357
|
+
const Vt = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], Ut = [
|
|
1358
1358
|
"January",
|
|
1359
1359
|
"February",
|
|
1360
1360
|
"March",
|
|
@@ -1372,14 +1372,14 @@ function je(t) {
|
|
|
1372
1372
|
const r = t.hexColor;
|
|
1373
1373
|
return r ? { backgroundColor: r } : {};
|
|
1374
1374
|
}
|
|
1375
|
-
function
|
|
1376
|
-
const
|
|
1375
|
+
function Yt({ day: t, date: r, events: o, isCurrentMonth: s, onDayClick: i }) {
|
|
1376
|
+
const l = G(r), g = 3, f = o.length;
|
|
1377
1377
|
return /* @__PURE__ */ n(
|
|
1378
1378
|
"button",
|
|
1379
1379
|
{
|
|
1380
1380
|
type: "button",
|
|
1381
|
-
onClick: () =>
|
|
1382
|
-
className:
|
|
1381
|
+
onClick: () => i?.(r),
|
|
1382
|
+
className: h(
|
|
1383
1383
|
"flex h-9 sm:h-11 flex-1 flex-col items-center justify-start gap-0.5 rounded-md pt-0.5 sm:pt-1",
|
|
1384
1384
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1385
1385
|
"transition-colors",
|
|
@@ -1389,9 +1389,9 @@ function Ut({ day: t, date: r, events: o, isCurrentMonth: s, onDayClick: a }) {
|
|
|
1389
1389
|
/* @__PURE__ */ e(
|
|
1390
1390
|
"div",
|
|
1391
1391
|
{
|
|
1392
|
-
className:
|
|
1392
|
+
className: h(
|
|
1393
1393
|
"flex size-5 sm:size-6 items-center justify-center rounded-full text-[10px] sm:text-xs font-medium",
|
|
1394
|
-
|
|
1394
|
+
l && "bg-primary font-semibold text-primary-foreground"
|
|
1395
1395
|
),
|
|
1396
1396
|
children: t
|
|
1397
1397
|
}
|
|
@@ -1403,7 +1403,7 @@ function Ut({ day: t, date: r, events: o, isCurrentMonth: s, onDayClick: a }) {
|
|
|
1403
1403
|
style: je(c)
|
|
1404
1404
|
},
|
|
1405
1405
|
c.id
|
|
1406
|
-
)) : /* @__PURE__ */ n(
|
|
1406
|
+
)) : /* @__PURE__ */ n(re, { children: [
|
|
1407
1407
|
o.slice(0, g).map((c) => /* @__PURE__ */ e(
|
|
1408
1408
|
"div",
|
|
1409
1409
|
{
|
|
@@ -1421,63 +1421,63 @@ function Ut({ day: t, date: r, events: o, isCurrentMonth: s, onDayClick: a }) {
|
|
|
1421
1421
|
}
|
|
1422
1422
|
);
|
|
1423
1423
|
}
|
|
1424
|
-
function
|
|
1424
|
+
function Gt({
|
|
1425
1425
|
date: t,
|
|
1426
1426
|
events: r,
|
|
1427
1427
|
onMonthClick: o,
|
|
1428
1428
|
onDayClick: s
|
|
1429
1429
|
}) {
|
|
1430
|
-
const
|
|
1430
|
+
const i = B(() => ft(t, 0), [t]);
|
|
1431
1431
|
return /* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
1432
1432
|
/* @__PURE__ */ e(
|
|
1433
1433
|
"button",
|
|
1434
1434
|
{
|
|
1435
1435
|
type: "button",
|
|
1436
1436
|
onClick: () => o?.(t),
|
|
1437
|
-
className:
|
|
1437
|
+
className: h(
|
|
1438
1438
|
"w-full rounded-t-lg border px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm font-semibold",
|
|
1439
1439
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1440
1440
|
"transition-colors"
|
|
1441
1441
|
),
|
|
1442
|
-
children:
|
|
1442
|
+
children: Ut[t.getMonth()]
|
|
1443
1443
|
}
|
|
1444
1444
|
),
|
|
1445
1445
|
/* @__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: [
|
|
1446
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children:
|
|
1447
|
-
/* @__PURE__ */ e("span", { className: "sm:hidden", children:
|
|
1448
|
-
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children:
|
|
1446
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children: Vt.map((l, g) => /* @__PURE__ */ n("div", { className: "text-[9px] sm:text-xs font-medium text-muted-foreground", children: [
|
|
1447
|
+
/* @__PURE__ */ e("span", { className: "sm:hidden", children: l[0] }),
|
|
1448
|
+
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children: l })
|
|
1449
1449
|
] }, g)) }),
|
|
1450
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children:
|
|
1451
|
-
const f =
|
|
1450
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children: i.map((l, g) => {
|
|
1451
|
+
const f = gt(r, l.date);
|
|
1452
1452
|
return /* @__PURE__ */ e(
|
|
1453
|
-
|
|
1453
|
+
Yt,
|
|
1454
1454
|
{
|
|
1455
|
-
day:
|
|
1456
|
-
date:
|
|
1455
|
+
day: l.date.getDate(),
|
|
1456
|
+
date: l.date,
|
|
1457
1457
|
events: f,
|
|
1458
|
-
isCurrentMonth:
|
|
1458
|
+
isCurrentMonth: l.isCurrentMonth,
|
|
1459
1459
|
onDayClick: s
|
|
1460
1460
|
},
|
|
1461
|
-
`${g + 1}-${
|
|
1461
|
+
`${g + 1}-${l.date.toISOString()}`
|
|
1462
1462
|
);
|
|
1463
1463
|
}) })
|
|
1464
1464
|
] })
|
|
1465
1465
|
] });
|
|
1466
1466
|
}
|
|
1467
|
-
function
|
|
1467
|
+
function Kt({
|
|
1468
1468
|
events: t,
|
|
1469
1469
|
year: r,
|
|
1470
1470
|
onMonthClick: o,
|
|
1471
1471
|
onDayClick: s,
|
|
1472
|
-
className:
|
|
1473
|
-
slots:
|
|
1472
|
+
className: i,
|
|
1473
|
+
slots: l,
|
|
1474
1474
|
classNames: g
|
|
1475
1475
|
}) {
|
|
1476
|
-
const f =
|
|
1477
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1476
|
+
const f = B(() => mt(r), [r]);
|
|
1477
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col h-full", i), children: [
|
|
1478
1478
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-center border-b px-4 py-3", children: /* @__PURE__ */ e("h2", { className: "text-lg font-semibold", children: r }) }),
|
|
1479
1479
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto p-4", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4", children: f.map((c) => /* @__PURE__ */ e(
|
|
1480
|
-
|
|
1480
|
+
Gt,
|
|
1481
1481
|
{
|
|
1482
1482
|
date: c,
|
|
1483
1483
|
events: t,
|
|
@@ -1488,7 +1488,7 @@ function Gt({
|
|
|
1488
1488
|
)) }) })
|
|
1489
1489
|
] });
|
|
1490
1490
|
}
|
|
1491
|
-
function
|
|
1491
|
+
function qt(t) {
|
|
1492
1492
|
switch (t) {
|
|
1493
1493
|
case "day":
|
|
1494
1494
|
case "week":
|
|
@@ -1497,67 +1497,68 @@ function Kt(t) {
|
|
|
1497
1497
|
return "day";
|
|
1498
1498
|
}
|
|
1499
1499
|
}
|
|
1500
|
-
function
|
|
1500
|
+
function Jt({
|
|
1501
1501
|
onEventClick: t,
|
|
1502
1502
|
onSlotClick: r,
|
|
1503
1503
|
onSlotSelect: o,
|
|
1504
1504
|
onAddEvent: s,
|
|
1505
|
-
className:
|
|
1506
|
-
showHeader:
|
|
1505
|
+
className: i,
|
|
1506
|
+
showHeader: l = !0,
|
|
1507
1507
|
minSelectionMinutes: g = 30,
|
|
1508
1508
|
showMoreMode: f,
|
|
1509
1509
|
showMoreEventsInPopover: c = !1,
|
|
1510
1510
|
isLoading: x = !1,
|
|
1511
1511
|
slots: b,
|
|
1512
1512
|
classNames: p,
|
|
1513
|
-
settingsContent:
|
|
1514
|
-
filterContent:
|
|
1515
|
-
headerActions:
|
|
1513
|
+
settingsContent: S,
|
|
1514
|
+
filterContent: W,
|
|
1515
|
+
headerActions: L,
|
|
1516
1516
|
renderPopover: D,
|
|
1517
|
-
calendarRef:
|
|
1517
|
+
calendarRef: z
|
|
1518
1518
|
}) {
|
|
1519
|
-
const
|
|
1520
|
-
view:
|
|
1521
|
-
setView:
|
|
1519
|
+
const T = f ?? (c ? "popover" : "expand"), {
|
|
1520
|
+
view: w,
|
|
1521
|
+
setView: I,
|
|
1522
1522
|
selectedDate: C,
|
|
1523
|
-
setSelectedDate:
|
|
1523
|
+
setSelectedDate: A,
|
|
1524
1524
|
slotDuration: R,
|
|
1525
1525
|
filteredEvents: V,
|
|
1526
|
-
users:
|
|
1526
|
+
users: F,
|
|
1527
1527
|
visibleHours: O,
|
|
1528
1528
|
workingHours: j,
|
|
1529
1529
|
badgeVariant: _,
|
|
1530
|
-
showWorkingHoursOnly: U
|
|
1531
|
-
|
|
1530
|
+
showWorkingHoursOnly: U,
|
|
1531
|
+
clearFocusEventId: m
|
|
1532
|
+
} = ut(), a = B(() => {
|
|
1532
1533
|
if (!U || !j)
|
|
1533
1534
|
return {
|
|
1534
1535
|
startHour: O.start,
|
|
1535
1536
|
endHour: O.end
|
|
1536
1537
|
};
|
|
1537
|
-
let
|
|
1538
|
-
for (const
|
|
1539
|
-
const
|
|
1540
|
-
|
|
1538
|
+
let d = 24, y = 0;
|
|
1539
|
+
for (const M of Object.keys(j)) {
|
|
1540
|
+
const $ = j[Number(M)];
|
|
1541
|
+
!$ || $.enabled === !1 || ($.from < d && (d = $.from), $.to > y && (y = $.to));
|
|
1541
1542
|
}
|
|
1542
|
-
return
|
|
1543
|
+
return d >= y ? {
|
|
1543
1544
|
startHour: O.start,
|
|
1544
1545
|
endHour: O.end
|
|
1545
|
-
} : { startHour:
|
|
1546
|
-
}, [U, j, O]),
|
|
1547
|
-
|
|
1548
|
-
|
|
1546
|
+
} : { startHour: d, endHour: y };
|
|
1547
|
+
}, [U, j, O]), u = a, v = Ne(null);
|
|
1548
|
+
Ze(
|
|
1549
|
+
z,
|
|
1549
1550
|
() => ({
|
|
1550
1551
|
scrollToToday: () => {
|
|
1551
|
-
const
|
|
1552
|
-
|
|
1552
|
+
const d = /* @__PURE__ */ new Date();
|
|
1553
|
+
A(d, w), requestAnimationFrame(() => {
|
|
1553
1554
|
requestAnimationFrame(() => {
|
|
1554
|
-
const
|
|
1555
|
+
const y = v.current?.querySelector(
|
|
1555
1556
|
".ic-timeline-scroll-container, [class*='overflow-auto']"
|
|
1556
1557
|
);
|
|
1557
|
-
if (!
|
|
1558
|
-
const
|
|
1559
|
-
|
|
1560
|
-
top: Math.max(0,
|
|
1558
|
+
if (!y) return;
|
|
1559
|
+
const se = (d.getHours() - a.startHour) * 96;
|
|
1560
|
+
se > 0 && y.scrollTo({
|
|
1561
|
+
top: Math.max(0, se - 100),
|
|
1561
1562
|
// Offset to show some context
|
|
1562
1563
|
behavior: "smooth"
|
|
1563
1564
|
});
|
|
@@ -1565,88 +1566,97 @@ function qt({
|
|
|
1565
1566
|
});
|
|
1566
1567
|
},
|
|
1567
1568
|
scrollToWorkingHours: () => {
|
|
1568
|
-
let
|
|
1569
|
+
let d = 8;
|
|
1569
1570
|
if (j)
|
|
1570
|
-
for (const
|
|
1571
|
-
const
|
|
1572
|
-
|
|
1571
|
+
for (const y of Object.keys(j)) {
|
|
1572
|
+
const M = j[Number(y)];
|
|
1573
|
+
M?.enabled && M.from < d && (d = Math.max(M.from - 1, 0));
|
|
1573
1574
|
}
|
|
1574
1575
|
requestAnimationFrame(() => {
|
|
1575
1576
|
requestAnimationFrame(() => {
|
|
1576
|
-
const
|
|
1577
|
+
const y = v.current?.querySelector(
|
|
1577
1578
|
".ic-timeline-scroll-container, [class*='overflow-auto']"
|
|
1578
1579
|
);
|
|
1579
|
-
if (!
|
|
1580
|
-
const
|
|
1581
|
-
|
|
1582
|
-
top: Math.max(0,
|
|
1580
|
+
if (!y) return;
|
|
1581
|
+
const $ = (d - a.startHour) * 96;
|
|
1582
|
+
y.scrollTo({
|
|
1583
|
+
top: Math.max(0, $),
|
|
1583
1584
|
behavior: "smooth"
|
|
1584
1585
|
});
|
|
1585
1586
|
});
|
|
1586
1587
|
});
|
|
1587
1588
|
},
|
|
1588
|
-
getViewRect: () =>
|
|
1589
|
+
getViewRect: () => v.current?.getBoundingClientRect() ?? null,
|
|
1590
|
+
focusEvent: (d) => {
|
|
1591
|
+
m(), requestAnimationFrame(() => {
|
|
1592
|
+
m();
|
|
1593
|
+
});
|
|
1594
|
+
const y = v.current?.querySelector(
|
|
1595
|
+
`[data-event-id="${d}"]`
|
|
1596
|
+
);
|
|
1597
|
+
y && setTimeout(() => y.click(), 150);
|
|
1598
|
+
}
|
|
1589
1599
|
}),
|
|
1590
|
-
[
|
|
1600
|
+
[A, w, a, j, m]
|
|
1591
1601
|
);
|
|
1592
|
-
const
|
|
1593
|
-
(
|
|
1602
|
+
const k = B(() => qt(w), [w]), N = ne(
|
|
1603
|
+
(d) => {
|
|
1594
1604
|
if (o) {
|
|
1595
|
-
o(
|
|
1605
|
+
o(d);
|
|
1596
1606
|
return;
|
|
1597
1607
|
}
|
|
1598
1608
|
if (r) {
|
|
1599
|
-
const
|
|
1600
|
-
r(
|
|
1609
|
+
const y = d.startDate.getHours();
|
|
1610
|
+
r(d.startDate, y);
|
|
1601
1611
|
}
|
|
1602
1612
|
},
|
|
1603
1613
|
[o, r]
|
|
1604
|
-
),
|
|
1605
|
-
(
|
|
1606
|
-
|
|
1614
|
+
), E = ne(
|
|
1615
|
+
(d) => {
|
|
1616
|
+
I("day"), A(d, "day");
|
|
1607
1617
|
},
|
|
1608
|
-
[
|
|
1609
|
-
),
|
|
1610
|
-
(
|
|
1611
|
-
|
|
1618
|
+
[A, I]
|
|
1619
|
+
), H = ne(
|
|
1620
|
+
(d) => {
|
|
1621
|
+
I("month"), A(d, "month");
|
|
1612
1622
|
},
|
|
1613
|
-
[
|
|
1614
|
-
),
|
|
1615
|
-
(
|
|
1616
|
-
t?.(
|
|
1623
|
+
[A, I]
|
|
1624
|
+
), P = ne(
|
|
1625
|
+
(d) => {
|
|
1626
|
+
t?.(d);
|
|
1617
1627
|
},
|
|
1618
1628
|
[t]
|
|
1619
|
-
),
|
|
1620
|
-
const
|
|
1621
|
-
switch (
|
|
1629
|
+
), K = () => {
|
|
1630
|
+
const d = V, y = P, M = D;
|
|
1631
|
+
switch (w) {
|
|
1622
1632
|
case "day":
|
|
1623
1633
|
return /* @__PURE__ */ e(
|
|
1624
|
-
|
|
1634
|
+
it,
|
|
1625
1635
|
{
|
|
1626
|
-
events:
|
|
1636
|
+
events: d,
|
|
1627
1637
|
date: C,
|
|
1628
|
-
visibleHours:
|
|
1638
|
+
visibleHours: u,
|
|
1629
1639
|
workingHours: j,
|
|
1630
1640
|
slotDuration: R,
|
|
1631
1641
|
badgeVariant: _,
|
|
1632
|
-
onEventClick:
|
|
1633
|
-
renderPopover:
|
|
1642
|
+
onEventClick: y,
|
|
1643
|
+
renderPopover: M,
|
|
1634
1644
|
...b && { slots: b },
|
|
1635
1645
|
...p && { classNames: p }
|
|
1636
1646
|
}
|
|
1637
1647
|
);
|
|
1638
1648
|
case "week":
|
|
1639
1649
|
return /* @__PURE__ */ e(
|
|
1640
|
-
|
|
1650
|
+
at,
|
|
1641
1651
|
{
|
|
1642
|
-
events:
|
|
1652
|
+
events: d,
|
|
1643
1653
|
date: C,
|
|
1644
|
-
visibleHours:
|
|
1654
|
+
visibleHours: u,
|
|
1645
1655
|
workingHours: j,
|
|
1646
1656
|
slotDuration: R,
|
|
1647
1657
|
badgeVariant: _,
|
|
1648
|
-
onEventClick:
|
|
1649
|
-
renderPopover:
|
|
1658
|
+
onEventClick: y,
|
|
1659
|
+
renderPopover: M,
|
|
1650
1660
|
...b && { slots: b },
|
|
1651
1661
|
...p && { classNames: p }
|
|
1652
1662
|
}
|
|
@@ -1655,37 +1665,37 @@ function qt({
|
|
|
1655
1665
|
return /* @__PURE__ */ e(
|
|
1656
1666
|
De,
|
|
1657
1667
|
{
|
|
1658
|
-
events:
|
|
1668
|
+
events: d,
|
|
1659
1669
|
date: C,
|
|
1660
1670
|
badgeVariant: _,
|
|
1661
|
-
onEventClick:
|
|
1662
|
-
onDayClick:
|
|
1663
|
-
renderPopover:
|
|
1664
|
-
showMoreMode:
|
|
1671
|
+
onEventClick: y,
|
|
1672
|
+
onDayClick: E,
|
|
1673
|
+
renderPopover: M,
|
|
1674
|
+
showMoreMode: T,
|
|
1665
1675
|
...b && { slots: b },
|
|
1666
1676
|
...p && { classNames: p }
|
|
1667
1677
|
}
|
|
1668
1678
|
);
|
|
1669
1679
|
case "year":
|
|
1670
1680
|
return /* @__PURE__ */ e(
|
|
1671
|
-
|
|
1681
|
+
Kt,
|
|
1672
1682
|
{
|
|
1673
|
-
events:
|
|
1683
|
+
events: d,
|
|
1674
1684
|
year: C.getFullYear(),
|
|
1675
|
-
onMonthClick:
|
|
1676
|
-
onDayClick:
|
|
1685
|
+
onMonthClick: H,
|
|
1686
|
+
onDayClick: E,
|
|
1677
1687
|
...b && { slots: b },
|
|
1678
1688
|
...p && { classNames: p }
|
|
1679
1689
|
}
|
|
1680
1690
|
);
|
|
1681
1691
|
case "agenda":
|
|
1682
1692
|
return /* @__PURE__ */ e(
|
|
1683
|
-
|
|
1693
|
+
st,
|
|
1684
1694
|
{
|
|
1685
|
-
events:
|
|
1695
|
+
events: d,
|
|
1686
1696
|
date: C,
|
|
1687
|
-
onEventClick:
|
|
1688
|
-
renderPopover:
|
|
1697
|
+
onEventClick: y,
|
|
1698
|
+
renderPopover: M,
|
|
1689
1699
|
...b && { slots: b },
|
|
1690
1700
|
...p && { classNames: p }
|
|
1691
1701
|
}
|
|
@@ -1693,36 +1703,36 @@ function qt({
|
|
|
1693
1703
|
// Resource views — delegate to TimelineView with matching day count
|
|
1694
1704
|
case "resource-day":
|
|
1695
1705
|
return /* @__PURE__ */ e(
|
|
1696
|
-
|
|
1706
|
+
ue,
|
|
1697
1707
|
{
|
|
1698
1708
|
daysToShow: 1,
|
|
1699
|
-
events:
|
|
1700
|
-
users:
|
|
1709
|
+
events: d,
|
|
1710
|
+
users: F,
|
|
1701
1711
|
selectedDate: C,
|
|
1702
1712
|
visibleHours: {
|
|
1703
|
-
from:
|
|
1704
|
-
to:
|
|
1713
|
+
from: a.startHour,
|
|
1714
|
+
to: a.endHour
|
|
1705
1715
|
},
|
|
1706
|
-
onEventClick:
|
|
1707
|
-
renderPopover:
|
|
1716
|
+
onEventClick: y,
|
|
1717
|
+
renderPopover: M,
|
|
1708
1718
|
...b && { slots: b },
|
|
1709
1719
|
...p && { classNames: p }
|
|
1710
1720
|
}
|
|
1711
1721
|
);
|
|
1712
1722
|
case "resource-week":
|
|
1713
1723
|
return /* @__PURE__ */ e(
|
|
1714
|
-
|
|
1724
|
+
ue,
|
|
1715
1725
|
{
|
|
1716
1726
|
daysToShow: 7,
|
|
1717
|
-
events:
|
|
1718
|
-
users:
|
|
1727
|
+
events: d,
|
|
1728
|
+
users: F,
|
|
1719
1729
|
selectedDate: C,
|
|
1720
1730
|
visibleHours: {
|
|
1721
|
-
from:
|
|
1722
|
-
to:
|
|
1731
|
+
from: a.startHour,
|
|
1732
|
+
to: a.endHour
|
|
1723
1733
|
},
|
|
1724
|
-
onEventClick:
|
|
1725
|
-
renderPopover:
|
|
1734
|
+
onEventClick: y,
|
|
1735
|
+
renderPopover: M,
|
|
1726
1736
|
...b && { slots: b },
|
|
1727
1737
|
...p && { classNames: p }
|
|
1728
1738
|
}
|
|
@@ -1730,54 +1740,54 @@ function qt({
|
|
|
1730
1740
|
// Timeline views
|
|
1731
1741
|
case "timeline-day":
|
|
1732
1742
|
return /* @__PURE__ */ e(
|
|
1733
|
-
|
|
1743
|
+
ue,
|
|
1734
1744
|
{
|
|
1735
1745
|
daysToShow: 1,
|
|
1736
|
-
events:
|
|
1737
|
-
users:
|
|
1746
|
+
events: d,
|
|
1747
|
+
users: F,
|
|
1738
1748
|
selectedDate: C,
|
|
1739
1749
|
visibleHours: {
|
|
1740
|
-
from:
|
|
1741
|
-
to:
|
|
1750
|
+
from: a.startHour,
|
|
1751
|
+
to: a.endHour
|
|
1742
1752
|
},
|
|
1743
|
-
onEventClick:
|
|
1744
|
-
renderPopover:
|
|
1753
|
+
onEventClick: y,
|
|
1754
|
+
renderPopover: M,
|
|
1745
1755
|
...b && { slots: b },
|
|
1746
1756
|
...p && { classNames: p }
|
|
1747
1757
|
}
|
|
1748
1758
|
);
|
|
1749
1759
|
case "timeline-3day":
|
|
1750
1760
|
return /* @__PURE__ */ e(
|
|
1751
|
-
|
|
1761
|
+
ue,
|
|
1752
1762
|
{
|
|
1753
1763
|
daysToShow: 3,
|
|
1754
|
-
events:
|
|
1755
|
-
users:
|
|
1764
|
+
events: d,
|
|
1765
|
+
users: F,
|
|
1756
1766
|
selectedDate: C,
|
|
1757
1767
|
visibleHours: {
|
|
1758
|
-
from:
|
|
1759
|
-
to:
|
|
1768
|
+
from: a.startHour,
|
|
1769
|
+
to: a.endHour
|
|
1760
1770
|
},
|
|
1761
|
-
onEventClick:
|
|
1762
|
-
renderPopover:
|
|
1771
|
+
onEventClick: y,
|
|
1772
|
+
renderPopover: M,
|
|
1763
1773
|
...b && { slots: b },
|
|
1764
1774
|
...p && { classNames: p }
|
|
1765
1775
|
}
|
|
1766
1776
|
);
|
|
1767
1777
|
case "timeline-week":
|
|
1768
1778
|
return /* @__PURE__ */ e(
|
|
1769
|
-
|
|
1779
|
+
ue,
|
|
1770
1780
|
{
|
|
1771
1781
|
daysToShow: 7,
|
|
1772
|
-
events:
|
|
1773
|
-
users:
|
|
1782
|
+
events: d,
|
|
1783
|
+
users: F,
|
|
1774
1784
|
selectedDate: C,
|
|
1775
1785
|
visibleHours: {
|
|
1776
|
-
from:
|
|
1777
|
-
to:
|
|
1786
|
+
from: a.startHour,
|
|
1787
|
+
to: a.endHour
|
|
1778
1788
|
},
|
|
1779
|
-
onEventClick:
|
|
1780
|
-
renderPopover:
|
|
1789
|
+
onEventClick: y,
|
|
1790
|
+
renderPopover: M,
|
|
1781
1791
|
...b && { slots: b },
|
|
1782
1792
|
...p && { classNames: p }
|
|
1783
1793
|
}
|
|
@@ -1786,69 +1796,69 @@ function qt({
|
|
|
1786
1796
|
return /* @__PURE__ */ e(
|
|
1787
1797
|
De,
|
|
1788
1798
|
{
|
|
1789
|
-
events:
|
|
1799
|
+
events: d,
|
|
1790
1800
|
date: C,
|
|
1791
1801
|
badgeVariant: _,
|
|
1792
|
-
onEventClick:
|
|
1793
|
-
onDayClick:
|
|
1802
|
+
onEventClick: y,
|
|
1803
|
+
onDayClick: E,
|
|
1794
1804
|
...b && { slots: b },
|
|
1795
1805
|
...p && { classNames: p }
|
|
1796
1806
|
}
|
|
1797
1807
|
);
|
|
1798
1808
|
}
|
|
1799
|
-
}, Y = Ne(null), [
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
}),
|
|
1803
|
-
const
|
|
1804
|
-
if (!
|
|
1805
|
-
const
|
|
1806
|
-
const { scrollLeft:
|
|
1807
|
-
|
|
1809
|
+
}, Y = Ne(null), [q, ie] = oe(!1);
|
|
1810
|
+
fe(() => {
|
|
1811
|
+
v.current = Y.current;
|
|
1812
|
+
}), fe(() => {
|
|
1813
|
+
const d = Y.current;
|
|
1814
|
+
if (!d) return;
|
|
1815
|
+
const y = () => {
|
|
1816
|
+
const { scrollLeft: se, scrollWidth: Ke, clientWidth: qe } = d;
|
|
1817
|
+
ie(se + qe < Ke - 4);
|
|
1808
1818
|
};
|
|
1809
|
-
|
|
1810
|
-
const
|
|
1811
|
-
|
|
1812
|
-
const
|
|
1813
|
-
return
|
|
1814
|
-
|
|
1819
|
+
y(), d.addEventListener("scroll", y, { passive: !0 });
|
|
1820
|
+
const M = new ResizeObserver(y);
|
|
1821
|
+
M.observe(d);
|
|
1822
|
+
const $ = new MutationObserver(y);
|
|
1823
|
+
return $.observe(d, { childList: !0, subtree: !0 }), () => {
|
|
1824
|
+
d.removeEventListener("scroll", y), M.disconnect(), $.disconnect();
|
|
1815
1825
|
};
|
|
1816
|
-
}, [
|
|
1817
|
-
const
|
|
1826
|
+
}, [w]);
|
|
1827
|
+
const le = ne(() => {
|
|
1818
1828
|
Y.current?.scrollBy({ left: 300, behavior: "smooth" });
|
|
1819
1829
|
}, []);
|
|
1820
1830
|
return /* @__PURE__ */ e(
|
|
1821
|
-
|
|
1831
|
+
ht,
|
|
1822
1832
|
{
|
|
1823
|
-
mode:
|
|
1824
|
-
onSelect:
|
|
1833
|
+
mode: k,
|
|
1834
|
+
onSelect: N,
|
|
1825
1835
|
minDurationMinutes: g,
|
|
1826
1836
|
slotDurationMinutes: R,
|
|
1827
1837
|
enabled: !!(o || r),
|
|
1828
1838
|
children: /* @__PURE__ */ n(
|
|
1829
1839
|
"div",
|
|
1830
1840
|
{
|
|
1831
|
-
className:
|
|
1841
|
+
className: h(
|
|
1832
1842
|
"inno-calendar-root flex flex-col h-full p-4",
|
|
1833
1843
|
p?.root,
|
|
1834
|
-
|
|
1844
|
+
i
|
|
1835
1845
|
),
|
|
1836
1846
|
children: [
|
|
1837
|
-
|
|
1838
|
-
|
|
1847
|
+
l && /* @__PURE__ */ e(
|
|
1848
|
+
ot,
|
|
1839
1849
|
{
|
|
1840
1850
|
currentDate: C,
|
|
1841
|
-
view:
|
|
1851
|
+
view: w,
|
|
1842
1852
|
events: V,
|
|
1843
|
-
onViewChange:
|
|
1844
|
-
onNavigateToday: () =>
|
|
1853
|
+
onViewChange: I,
|
|
1854
|
+
onNavigateToday: () => A(/* @__PURE__ */ new Date(), w),
|
|
1845
1855
|
onNavigatePrev: () => {
|
|
1846
|
-
const
|
|
1847
|
-
|
|
1856
|
+
const d = new Date(C);
|
|
1857
|
+
w === "day" || w === "timeline-day" || w === "resource-day" ? d.setDate(d.getDate() - 1) : w === "timeline-3day" ? d.setDate(d.getDate() - 3) : w === "week" || w === "timeline-week" || w === "resource-week" ? d.setDate(d.getDate() - 7) : w === "month" ? d.setMonth(d.getMonth() - 1) : w === "year" ? d.setFullYear(d.getFullYear() - 1) : d.setDate(d.getDate() - 7), A(d, w);
|
|
1848
1858
|
},
|
|
1849
1859
|
onNavigateNext: () => {
|
|
1850
|
-
const
|
|
1851
|
-
|
|
1860
|
+
const d = new Date(C);
|
|
1861
|
+
w === "day" || w === "timeline-day" || w === "resource-day" ? d.setDate(d.getDate() + 1) : w === "timeline-3day" ? d.setDate(d.getDate() + 3) : w === "week" || w === "timeline-week" || w === "resource-week" ? d.setDate(d.getDate() + 7) : w === "month" ? d.setMonth(d.getMonth() + 1) : w === "year" ? d.setFullYear(d.getFullYear() + 1) : d.setDate(d.getDate() + 7), A(d, w);
|
|
1852
1862
|
},
|
|
1853
1863
|
availableViews: [
|
|
1854
1864
|
"day",
|
|
@@ -1858,11 +1868,11 @@ function qt({
|
|
|
1858
1868
|
"agenda"
|
|
1859
1869
|
],
|
|
1860
1870
|
showTimelineViews: !0,
|
|
1861
|
-
showSettings: !!
|
|
1862
|
-
...!
|
|
1863
|
-
actions:
|
|
1864
|
-
settingsContent:
|
|
1865
|
-
filterContent:
|
|
1871
|
+
showSettings: !!S,
|
|
1872
|
+
...!L && s && { onAddEvent: s },
|
|
1873
|
+
actions: L,
|
|
1874
|
+
settingsContent: S,
|
|
1875
|
+
filterContent: W
|
|
1866
1876
|
}
|
|
1867
1877
|
),
|
|
1868
1878
|
/* @__PURE__ */ n("div", { className: "relative flex-1 min-h-0", children: [
|
|
@@ -1870,19 +1880,19 @@ function qt({
|
|
|
1870
1880
|
"div",
|
|
1871
1881
|
{
|
|
1872
1882
|
ref: Y,
|
|
1873
|
-
className:
|
|
1883
|
+
className: h(
|
|
1874
1884
|
"h-full border rounded-lg bg-white overflow-x-auto",
|
|
1875
1885
|
p?.viewContainer
|
|
1876
1886
|
),
|
|
1877
|
-
children:
|
|
1887
|
+
children: K()
|
|
1878
1888
|
}
|
|
1879
1889
|
),
|
|
1880
1890
|
x && /* @__PURE__ */ e("div", { className: "inno-calendar-loading-overlay", children: /* @__PURE__ */ e("div", { className: "inno-calendar-spinner" }) }),
|
|
1881
|
-
|
|
1891
|
+
q && /* @__PURE__ */ e(
|
|
1882
1892
|
"button",
|
|
1883
1893
|
{
|
|
1884
1894
|
type: "button",
|
|
1885
|
-
onClick:
|
|
1895
|
+
onClick: le,
|
|
1886
1896
|
className: "inno-scroll-right-btn",
|
|
1887
1897
|
"aria-label": "Scroll right",
|
|
1888
1898
|
children: /* @__PURE__ */ n(
|
|
@@ -1913,85 +1923,87 @@ function qt({
|
|
|
1913
1923
|
}
|
|
1914
1924
|
);
|
|
1915
1925
|
}
|
|
1916
|
-
function
|
|
1926
|
+
function Xt({
|
|
1917
1927
|
events: t,
|
|
1918
1928
|
users: r = [],
|
|
1919
1929
|
scheduleTypes: o = [],
|
|
1920
1930
|
initialView: s = "week",
|
|
1921
|
-
initialDate:
|
|
1922
|
-
initialSelectedUserId:
|
|
1931
|
+
initialDate: i,
|
|
1932
|
+
initialSelectedUserId: l,
|
|
1923
1933
|
initialScheduleTypeIds: g,
|
|
1924
1934
|
initialParticipantIds: f,
|
|
1925
1935
|
initialWorkingHoursView: c,
|
|
1926
1936
|
initialSearchQuery: x,
|
|
1927
1937
|
preferencesConfig: b,
|
|
1928
1938
|
onEventClick: p,
|
|
1929
|
-
onSlotClick:
|
|
1930
|
-
onSlotSelect:
|
|
1931
|
-
onAddEvent:
|
|
1939
|
+
onSlotClick: S,
|
|
1940
|
+
onSlotSelect: W,
|
|
1941
|
+
onAddEvent: L,
|
|
1932
1942
|
onEventDrop: D,
|
|
1933
|
-
onDateChange:
|
|
1934
|
-
onViewChange:
|
|
1935
|
-
className:
|
|
1936
|
-
showHeader:
|
|
1943
|
+
onDateChange: z,
|
|
1944
|
+
onViewChange: T,
|
|
1945
|
+
className: w,
|
|
1946
|
+
showHeader: I = !0,
|
|
1937
1947
|
minSelectionMinutes: C = 30,
|
|
1938
|
-
showMoreMode:
|
|
1948
|
+
showMoreMode: A,
|
|
1939
1949
|
showMoreEventsInPopover: R = !1,
|
|
1940
1950
|
isLoading: V = !1,
|
|
1941
|
-
renderPopover:
|
|
1951
|
+
renderPopover: F,
|
|
1942
1952
|
slots: O,
|
|
1943
1953
|
classNames: j,
|
|
1944
1954
|
settingsContent: _,
|
|
1945
1955
|
filterContent: U,
|
|
1946
|
-
headerActions:
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1956
|
+
headerActions: m,
|
|
1957
|
+
focusEventId: a
|
|
1958
|
+
}, u) {
|
|
1959
|
+
return /* @__PURE__ */ e(ct, { ...D && { onEventDrop: D }, children: /* @__PURE__ */ e(
|
|
1960
|
+
dt,
|
|
1950
1961
|
{
|
|
1951
1962
|
initialEvents: t,
|
|
1952
1963
|
initialUsers: r,
|
|
1953
1964
|
initialScheduleTypes: o,
|
|
1954
1965
|
initialView: s,
|
|
1955
|
-
...
|
|
1956
|
-
...
|
|
1966
|
+
...i && { initialDate: i },
|
|
1967
|
+
...l && { initialSelectedUserId: l },
|
|
1957
1968
|
...g && { initialScheduleTypeIds: g },
|
|
1958
1969
|
...f && { initialParticipantIds: f },
|
|
1959
1970
|
...c && { initialWorkingHoursView: c },
|
|
1960
1971
|
...x && { initialSearchQuery: x },
|
|
1961
1972
|
...b && { preferencesConfig: b },
|
|
1962
|
-
...
|
|
1963
|
-
...
|
|
1973
|
+
...z && { onDateChange: z },
|
|
1974
|
+
...T && { onViewChange: T },
|
|
1975
|
+
...a && { initialFocusEventId: a },
|
|
1964
1976
|
children: /* @__PURE__ */ e(
|
|
1965
|
-
|
|
1977
|
+
Jt,
|
|
1966
1978
|
{
|
|
1967
1979
|
...p && { onEventClick: p },
|
|
1968
|
-
...
|
|
1969
|
-
...
|
|
1970
|
-
...
|
|
1971
|
-
...
|
|
1972
|
-
className:
|
|
1973
|
-
showHeader:
|
|
1980
|
+
...S && { onSlotClick: S },
|
|
1981
|
+
...W && { onSlotSelect: W },
|
|
1982
|
+
...L && { onAddEvent: L },
|
|
1983
|
+
...F && { renderPopover: F },
|
|
1984
|
+
className: w,
|
|
1985
|
+
showHeader: I,
|
|
1974
1986
|
minSelectionMinutes: C,
|
|
1975
|
-
...
|
|
1987
|
+
...A && { showMoreMode: A },
|
|
1976
1988
|
showMoreEventsInPopover: R,
|
|
1977
1989
|
isLoading: V,
|
|
1978
1990
|
...O && { slots: O },
|
|
1979
1991
|
...j && { classNames: j },
|
|
1980
1992
|
settingsContent: _,
|
|
1981
1993
|
filterContent: U,
|
|
1982
|
-
headerActions:
|
|
1983
|
-
calendarRef:
|
|
1994
|
+
headerActions: m,
|
|
1995
|
+
calendarRef: u
|
|
1984
1996
|
}
|
|
1985
1997
|
)
|
|
1986
1998
|
}
|
|
1987
1999
|
) });
|
|
1988
2000
|
}
|
|
1989
|
-
const
|
|
2001
|
+
const Kr = xe(Xt), te = xe(
|
|
1990
2002
|
({ className: t, children: r, ...o }, s) => /* @__PURE__ */ e(
|
|
1991
2003
|
"select",
|
|
1992
2004
|
{
|
|
1993
2005
|
ref: s,
|
|
1994
|
-
className:
|
|
2006
|
+
className: h(
|
|
1995
2007
|
"flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm",
|
|
1996
2008
|
"ring-offset-background",
|
|
1997
2009
|
"focus:outline-none focus:ring-1 focus:ring-ring",
|
|
@@ -2004,20 +2016,20 @@ const Gr = xe(Jt), re = xe(
|
|
|
2004
2016
|
}
|
|
2005
2017
|
)
|
|
2006
2018
|
);
|
|
2007
|
-
|
|
2008
|
-
const
|
|
2019
|
+
te.displayName = "Select";
|
|
2020
|
+
const J = xe(({ className: t, ...r }, o) => /* @__PURE__ */ e(
|
|
2009
2021
|
"label",
|
|
2010
2022
|
{
|
|
2011
2023
|
ref: o,
|
|
2012
|
-
className:
|
|
2024
|
+
className: h(
|
|
2013
2025
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
2014
2026
|
t
|
|
2015
2027
|
),
|
|
2016
2028
|
...r
|
|
2017
2029
|
}
|
|
2018
2030
|
));
|
|
2019
|
-
|
|
2020
|
-
function
|
|
2031
|
+
J.displayName = "Label";
|
|
2032
|
+
function Qt({ className: t }) {
|
|
2021
2033
|
return /* @__PURE__ */ n(
|
|
2022
2034
|
"svg",
|
|
2023
2035
|
{
|
|
@@ -2039,7 +2051,7 @@ function Xt({ className: t }) {
|
|
|
2039
2051
|
}
|
|
2040
2052
|
);
|
|
2041
2053
|
}
|
|
2042
|
-
function
|
|
2054
|
+
function Zt({ className: t }) {
|
|
2043
2055
|
return /* @__PURE__ */ n(
|
|
2044
2056
|
"svg",
|
|
2045
2057
|
{
|
|
@@ -2060,50 +2072,50 @@ function Qt({ className: t }) {
|
|
|
2060
2072
|
}
|
|
2061
2073
|
);
|
|
2062
2074
|
}
|
|
2063
|
-
const
|
|
2075
|
+
const er = [
|
|
2064
2076
|
{ value: 15, label: "15 minutes" },
|
|
2065
2077
|
{ value: 30, label: "30 minutes" },
|
|
2066
2078
|
{ value: 60, label: "1 hour" }
|
|
2067
2079
|
];
|
|
2068
|
-
function
|
|
2080
|
+
function qr({
|
|
2069
2081
|
value: t,
|
|
2070
2082
|
onChange: r,
|
|
2071
2083
|
isLocked: o = !1,
|
|
2072
2084
|
className: s,
|
|
2073
|
-
labels:
|
|
2085
|
+
labels: i = {}
|
|
2074
2086
|
}) {
|
|
2075
|
-
const
|
|
2087
|
+
const l = {
|
|
2076
2088
|
title: "Slot duration",
|
|
2077
2089
|
lockedMessage: "This setting is locked by the administrator",
|
|
2078
2090
|
infoMessage: "Set the time slot duration for day and week calendar views.",
|
|
2079
|
-
...
|
|
2091
|
+
...i
|
|
2080
2092
|
}, g = (f) => {
|
|
2081
2093
|
o || r(Number(f.target.value));
|
|
2082
2094
|
};
|
|
2083
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2095
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-3", s), children: [
|
|
2084
2096
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2085
|
-
/* @__PURE__ */ e(
|
|
2086
|
-
o ? /* @__PURE__ */ e(
|
|
2087
|
-
/* @__PURE__ */ e(
|
|
2088
|
-
/* @__PURE__ */ e(
|
|
2089
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2090
|
-
/* @__PURE__ */ e(
|
|
2091
|
-
/* @__PURE__ */ e(
|
|
2097
|
+
/* @__PURE__ */ e(J, { className: "text-sm font-semibold", children: l.title }),
|
|
2098
|
+
o ? /* @__PURE__ */ e(X, { delayDuration: 100, children: /* @__PURE__ */ n(Q, { children: [
|
|
2099
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(Zt, { className: "size-3 text-muted-foreground" }) }),
|
|
2100
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
|
|
2101
|
+
] }) }) : /* @__PURE__ */ e(X, { delayDuration: 100, children: /* @__PURE__ */ n(Q, { children: [
|
|
2102
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(Qt, { className: "size-3 text-muted-foreground" }) }),
|
|
2103
|
+
/* @__PURE__ */ e(ee, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: l.infoMessage }) })
|
|
2092
2104
|
] }) })
|
|
2093
2105
|
] }),
|
|
2094
2106
|
/* @__PURE__ */ e(
|
|
2095
|
-
|
|
2107
|
+
te,
|
|
2096
2108
|
{
|
|
2097
2109
|
value: t.toString(),
|
|
2098
2110
|
onChange: g,
|
|
2099
2111
|
disabled: o,
|
|
2100
2112
|
className: "h-9 w-[128px] text-sm",
|
|
2101
|
-
children:
|
|
2113
|
+
children: er.map((f) => /* @__PURE__ */ e("option", { value: f.value.toString(), children: f.label }, f.value))
|
|
2102
2114
|
}
|
|
2103
2115
|
)
|
|
2104
2116
|
] });
|
|
2105
2117
|
}
|
|
2106
|
-
function
|
|
2118
|
+
function tr({ className: t }) {
|
|
2107
2119
|
return /* @__PURE__ */ n(
|
|
2108
2120
|
"svg",
|
|
2109
2121
|
{
|
|
@@ -2125,7 +2137,7 @@ function er({ className: t }) {
|
|
|
2125
2137
|
}
|
|
2126
2138
|
);
|
|
2127
2139
|
}
|
|
2128
|
-
function
|
|
2140
|
+
function rr({ className: t }) {
|
|
2129
2141
|
return /* @__PURE__ */ n(
|
|
2130
2142
|
"svg",
|
|
2131
2143
|
{
|
|
@@ -2146,19 +2158,19 @@ function tr({ className: t }) {
|
|
|
2146
2158
|
}
|
|
2147
2159
|
);
|
|
2148
2160
|
}
|
|
2149
|
-
const
|
|
2161
|
+
const nr = [
|
|
2150
2162
|
{ value: "dot", label: "Dot indicator" },
|
|
2151
2163
|
{ value: "colored", label: "Full color" },
|
|
2152
2164
|
{ value: "mixed", label: "Mixed" }
|
|
2153
2165
|
];
|
|
2154
|
-
function
|
|
2166
|
+
function Jr({
|
|
2155
2167
|
value: t,
|
|
2156
2168
|
onChange: r,
|
|
2157
2169
|
isLocked: o = !1,
|
|
2158
2170
|
className: s,
|
|
2159
|
-
labels:
|
|
2171
|
+
labels: i = {}
|
|
2160
2172
|
}) {
|
|
2161
|
-
const
|
|
2173
|
+
const l = {
|
|
2162
2174
|
title: "Event display",
|
|
2163
2175
|
lockedMessage: "This setting is locked by the administrator",
|
|
2164
2176
|
infoMessage: "Choose how events are displayed. Dot shows a small indicator, colored fills the entire event, mixed uses both.",
|
|
@@ -2167,34 +2179,34 @@ function qr({
|
|
|
2167
2179
|
colored: "Full color",
|
|
2168
2180
|
mixed: "Mixed"
|
|
2169
2181
|
},
|
|
2170
|
-
...
|
|
2171
|
-
}, g = (c) =>
|
|
2182
|
+
...i
|
|
2183
|
+
}, g = (c) => l.options?.[c] ?? c, f = (c) => {
|
|
2172
2184
|
o || r(c.target.value);
|
|
2173
2185
|
};
|
|
2174
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2186
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-3", s), children: [
|
|
2175
2187
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2176
|
-
/* @__PURE__ */ e(
|
|
2177
|
-
o ? /* @__PURE__ */ e(
|
|
2178
|
-
/* @__PURE__ */ e(
|
|
2179
|
-
/* @__PURE__ */ e(
|
|
2180
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2181
|
-
/* @__PURE__ */ e(
|
|
2182
|
-
/* @__PURE__ */ e(
|
|
2188
|
+
/* @__PURE__ */ e(J, { className: "text-sm font-semibold", children: l.title }),
|
|
2189
|
+
o ? /* @__PURE__ */ e(X, { delayDuration: 100, children: /* @__PURE__ */ n(Q, { children: [
|
|
2190
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(rr, { className: "size-3 text-muted-foreground" }) }),
|
|
2191
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
|
|
2192
|
+
] }) }) : /* @__PURE__ */ e(X, { delayDuration: 100, children: /* @__PURE__ */ n(Q, { children: [
|
|
2193
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(tr, { className: "size-3 text-muted-foreground" }) }),
|
|
2194
|
+
/* @__PURE__ */ e(ee, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: l.infoMessage }) })
|
|
2183
2195
|
] }) })
|
|
2184
2196
|
] }),
|
|
2185
2197
|
/* @__PURE__ */ e(
|
|
2186
|
-
|
|
2198
|
+
te,
|
|
2187
2199
|
{
|
|
2188
2200
|
value: t,
|
|
2189
2201
|
onChange: f,
|
|
2190
2202
|
disabled: o,
|
|
2191
2203
|
className: "h-9 w-[128px] text-sm",
|
|
2192
|
-
children:
|
|
2204
|
+
children: nr.map((c) => /* @__PURE__ */ e("option", { value: c.value, children: g(c.value) }, c.value))
|
|
2193
2205
|
}
|
|
2194
2206
|
)
|
|
2195
2207
|
] });
|
|
2196
2208
|
}
|
|
2197
|
-
function
|
|
2209
|
+
function or({ className: t }) {
|
|
2198
2210
|
return /* @__PURE__ */ n(
|
|
2199
2211
|
"svg",
|
|
2200
2212
|
{
|
|
@@ -2216,7 +2228,7 @@ function nr({ className: t }) {
|
|
|
2216
2228
|
}
|
|
2217
2229
|
);
|
|
2218
2230
|
}
|
|
2219
|
-
function
|
|
2231
|
+
function sr({ className: t }) {
|
|
2220
2232
|
return /* @__PURE__ */ n(
|
|
2221
2233
|
"svg",
|
|
2222
2234
|
{
|
|
@@ -2237,27 +2249,27 @@ function or({ className: t }) {
|
|
|
2237
2249
|
}
|
|
2238
2250
|
);
|
|
2239
2251
|
}
|
|
2240
|
-
function
|
|
2252
|
+
function ar() {
|
|
2241
2253
|
return Array.from({ length: 25 }, (t, r) => ({
|
|
2242
2254
|
value: r,
|
|
2243
2255
|
label: `${String(r).padStart(2, "0")}:00`
|
|
2244
2256
|
}));
|
|
2245
2257
|
}
|
|
2246
|
-
function
|
|
2258
|
+
function Xr({
|
|
2247
2259
|
value: t,
|
|
2248
2260
|
onChange: r,
|
|
2249
2261
|
isLocked: o = !1,
|
|
2250
2262
|
className: s,
|
|
2251
|
-
labels:
|
|
2263
|
+
labels: i = {}
|
|
2252
2264
|
}) {
|
|
2253
|
-
const
|
|
2265
|
+
const l = {
|
|
2254
2266
|
title: "Visible hours",
|
|
2255
2267
|
from: "From",
|
|
2256
2268
|
to: "To",
|
|
2257
2269
|
lockedMessage: "This setting is locked by the administrator",
|
|
2258
2270
|
infoMessage: "Set the visible hour range for day and week views. Hours outside this range will be hidden.",
|
|
2259
|
-
...
|
|
2260
|
-
}, g =
|
|
2271
|
+
...i
|
|
2272
|
+
}, g = ar(), f = (x) => {
|
|
2261
2273
|
if (o) return;
|
|
2262
2274
|
const b = Number(x.target.value);
|
|
2263
2275
|
b < t.endHour && r({ ...t, startHour: b });
|
|
@@ -2266,22 +2278,22 @@ function Jr({
|
|
|
2266
2278
|
const b = Number(x.target.value);
|
|
2267
2279
|
b > t.startHour && r({ ...t, endHour: b });
|
|
2268
2280
|
};
|
|
2269
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2281
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-3", s), children: [
|
|
2270
2282
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2271
|
-
/* @__PURE__ */ e(
|
|
2272
|
-
o ? /* @__PURE__ */ e(
|
|
2273
|
-
/* @__PURE__ */ e(
|
|
2274
|
-
/* @__PURE__ */ e(
|
|
2275
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2276
|
-
/* @__PURE__ */ e(
|
|
2277
|
-
/* @__PURE__ */ e(
|
|
2283
|
+
/* @__PURE__ */ e(J, { className: "text-sm font-semibold", children: l.title }),
|
|
2284
|
+
o ? /* @__PURE__ */ e(X, { delayDuration: 100, children: /* @__PURE__ */ n(Q, { children: [
|
|
2285
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(sr, { className: "size-3 text-muted-foreground" }) }),
|
|
2286
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
|
|
2287
|
+
] }) }) : /* @__PURE__ */ e(X, { delayDuration: 100, children: /* @__PURE__ */ n(Q, { children: [
|
|
2288
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(or, { className: "size-3 text-muted-foreground" }) }),
|
|
2289
|
+
/* @__PURE__ */ e(ee, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: l.infoMessage }) })
|
|
2278
2290
|
] }) })
|
|
2279
2291
|
] }),
|
|
2280
2292
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2281
2293
|
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
2282
|
-
/* @__PURE__ */ e(
|
|
2294
|
+
/* @__PURE__ */ e(J, { className: "text-xs text-muted-foreground", children: l.from }),
|
|
2283
2295
|
/* @__PURE__ */ e(
|
|
2284
|
-
|
|
2296
|
+
te,
|
|
2285
2297
|
{
|
|
2286
2298
|
value: t.startHour.toString(),
|
|
2287
2299
|
onChange: f,
|
|
@@ -2301,9 +2313,9 @@ function Jr({
|
|
|
2301
2313
|
] }),
|
|
2302
2314
|
/* @__PURE__ */ e("span", { className: "mt-5 text-muted-foreground", children: "—" }),
|
|
2303
2315
|
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
2304
|
-
/* @__PURE__ */ e(
|
|
2316
|
+
/* @__PURE__ */ e(J, { className: "text-xs text-muted-foreground", children: l.to }),
|
|
2305
2317
|
/* @__PURE__ */ e(
|
|
2306
|
-
|
|
2318
|
+
te,
|
|
2307
2319
|
{
|
|
2308
2320
|
value: t.endHour.toString(),
|
|
2309
2321
|
onChange: c,
|
|
@@ -2324,7 +2336,7 @@ function Jr({
|
|
|
2324
2336
|
] })
|
|
2325
2337
|
] });
|
|
2326
2338
|
}
|
|
2327
|
-
function
|
|
2339
|
+
function ir({ className: t }) {
|
|
2328
2340
|
return /* @__PURE__ */ n(
|
|
2329
2341
|
"svg",
|
|
2330
2342
|
{
|
|
@@ -2346,7 +2358,7 @@ function ar({ className: t }) {
|
|
|
2346
2358
|
}
|
|
2347
2359
|
);
|
|
2348
2360
|
}
|
|
2349
|
-
function
|
|
2361
|
+
function lr({ className: t }) {
|
|
2350
2362
|
return /* @__PURE__ */ n(
|
|
2351
2363
|
"svg",
|
|
2352
2364
|
{
|
|
@@ -2367,7 +2379,7 @@ function ir({ className: t }) {
|
|
|
2367
2379
|
}
|
|
2368
2380
|
);
|
|
2369
2381
|
}
|
|
2370
|
-
function
|
|
2382
|
+
function cr({ className: t }) {
|
|
2371
2383
|
return /* @__PURE__ */ e(
|
|
2372
2384
|
"svg",
|
|
2373
2385
|
{
|
|
@@ -2385,7 +2397,7 @@ function lr({ className: t }) {
|
|
|
2385
2397
|
}
|
|
2386
2398
|
);
|
|
2387
2399
|
}
|
|
2388
|
-
const
|
|
2400
|
+
const dr = [
|
|
2389
2401
|
"monday",
|
|
2390
2402
|
"tuesday",
|
|
2391
2403
|
"wednesday",
|
|
@@ -2394,7 +2406,7 @@ const cr = [
|
|
|
2394
2406
|
"saturday",
|
|
2395
2407
|
"sunday"
|
|
2396
2408
|
];
|
|
2397
|
-
function
|
|
2409
|
+
function ur() {
|
|
2398
2410
|
return Array.from({ length: 25 }, (t, r) => ({
|
|
2399
2411
|
value: r,
|
|
2400
2412
|
label: `${String(r).padStart(2, "0")}:00`
|
|
@@ -2409,8 +2421,8 @@ const We = {
|
|
|
2409
2421
|
friday: "Fri",
|
|
2410
2422
|
saturday: "Sat"
|
|
2411
2423
|
};
|
|
2412
|
-
function
|
|
2413
|
-
const
|
|
2424
|
+
function hr({ dayLabel: t, config: r, onChange: o, disabled: s, hourOptions: i }) {
|
|
2425
|
+
const l = () => {
|
|
2414
2426
|
s || o({ ...r, enabled: !r.enabled });
|
|
2415
2427
|
}, g = (c) => {
|
|
2416
2428
|
if (s) return;
|
|
@@ -2429,71 +2441,71 @@ function ur({ dayLabel: t, config: r, onChange: o, disabled: s, hourOptions: a }
|
|
|
2429
2441
|
role: "checkbox",
|
|
2430
2442
|
"aria-checked": r.enabled,
|
|
2431
2443
|
"aria-label": `Enable ${t}`,
|
|
2432
|
-
onClick:
|
|
2444
|
+
onClick: l,
|
|
2433
2445
|
disabled: s,
|
|
2434
|
-
className:
|
|
2446
|
+
className: h(
|
|
2435
2447
|
"flex size-5 shrink-0 items-center justify-center rounded border transition-colors",
|
|
2436
2448
|
r.enabled ? "border-primary bg-primary text-primary-foreground" : "border-input bg-background",
|
|
2437
2449
|
s && "cursor-not-allowed opacity-50"
|
|
2438
2450
|
),
|
|
2439
|
-
children: r.enabled && /* @__PURE__ */ e(
|
|
2451
|
+
children: r.enabled && /* @__PURE__ */ e(cr, { className: "size-3" })
|
|
2440
2452
|
}
|
|
2441
2453
|
),
|
|
2442
|
-
/* @__PURE__ */ e("span", { className:
|
|
2454
|
+
/* @__PURE__ */ e("span", { className: h("w-10 text-sm", !r.enabled && "text-muted-foreground"), children: t }),
|
|
2443
2455
|
/* @__PURE__ */ e(
|
|
2444
|
-
|
|
2456
|
+
te,
|
|
2445
2457
|
{
|
|
2446
2458
|
value: r.from.toString(),
|
|
2447
2459
|
onChange: g,
|
|
2448
2460
|
disabled: s || !r.enabled,
|
|
2449
2461
|
className: "h-8 w-[76px] text-xs",
|
|
2450
|
-
children:
|
|
2462
|
+
children: i.map((c) => /* @__PURE__ */ e("option", { value: c.value.toString(), disabled: c.value >= r.to, children: c.label }, c.value))
|
|
2451
2463
|
}
|
|
2452
2464
|
),
|
|
2453
2465
|
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "—" }),
|
|
2454
2466
|
/* @__PURE__ */ e(
|
|
2455
|
-
|
|
2467
|
+
te,
|
|
2456
2468
|
{
|
|
2457
2469
|
value: r.to.toString(),
|
|
2458
2470
|
onChange: f,
|
|
2459
2471
|
disabled: s || !r.enabled,
|
|
2460
2472
|
className: "h-8 w-[76px] text-xs",
|
|
2461
|
-
children:
|
|
2473
|
+
children: i.map((c) => /* @__PURE__ */ e("option", { value: c.value.toString(), disabled: c.value <= r.from, children: c.label }, c.value))
|
|
2462
2474
|
}
|
|
2463
2475
|
)
|
|
2464
2476
|
] });
|
|
2465
2477
|
}
|
|
2466
|
-
function
|
|
2478
|
+
function Qr({
|
|
2467
2479
|
value: t,
|
|
2468
2480
|
onChange: r,
|
|
2469
2481
|
isLocked: o = !1,
|
|
2470
2482
|
className: s,
|
|
2471
|
-
labels:
|
|
2483
|
+
labels: i = {}
|
|
2472
2484
|
}) {
|
|
2473
|
-
const
|
|
2485
|
+
const l = {
|
|
2474
2486
|
title: "Working hours",
|
|
2475
2487
|
lockedMessage: "This setting is locked by the administrator",
|
|
2476
2488
|
infoMessage: "Configure working hours for each day of the week. Non-working hours will be grayed out in day and week views.",
|
|
2477
2489
|
days: We,
|
|
2478
|
-
...
|
|
2479
|
-
}, g =
|
|
2490
|
+
...i
|
|
2491
|
+
}, g = ur(), f = (c, x) => {
|
|
2480
2492
|
o || r({ ...t, [c]: x });
|
|
2481
2493
|
};
|
|
2482
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2494
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-3", s), children: [
|
|
2483
2495
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2484
|
-
/* @__PURE__ */ e(
|
|
2485
|
-
o ? /* @__PURE__ */ e(
|
|
2486
|
-
/* @__PURE__ */ e(
|
|
2487
|
-
/* @__PURE__ */ e(
|
|
2488
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2489
|
-
/* @__PURE__ */ e(
|
|
2490
|
-
/* @__PURE__ */ e(
|
|
2496
|
+
/* @__PURE__ */ e(J, { className: "text-sm font-semibold", children: l.title }),
|
|
2497
|
+
o ? /* @__PURE__ */ e(X, { delayDuration: 100, children: /* @__PURE__ */ n(Q, { children: [
|
|
2498
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(lr, { className: "size-3 text-muted-foreground" }) }),
|
|
2499
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
|
|
2500
|
+
] }) }) : /* @__PURE__ */ e(X, { delayDuration: 100, children: /* @__PURE__ */ n(Q, { children: [
|
|
2501
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(ir, { className: "size-3 text-muted-foreground" }) }),
|
|
2502
|
+
/* @__PURE__ */ e(ee, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: l.infoMessage }) })
|
|
2491
2503
|
] }) })
|
|
2492
2504
|
] }),
|
|
2493
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children:
|
|
2494
|
-
|
|
2505
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: dr.map((c) => /* @__PURE__ */ e(
|
|
2506
|
+
hr,
|
|
2495
2507
|
{
|
|
2496
|
-
dayLabel:
|
|
2508
|
+
dayLabel: l.days?.[c] ?? We[c],
|
|
2497
2509
|
config: t[c],
|
|
2498
2510
|
onChange: (x) => f(c, x),
|
|
2499
2511
|
disabled: o,
|
|
@@ -2503,7 +2515,7 @@ function Xr({
|
|
|
2503
2515
|
)) })
|
|
2504
2516
|
] });
|
|
2505
2517
|
}
|
|
2506
|
-
const
|
|
2518
|
+
const Zr = {
|
|
2507
2519
|
sunday: { enabled: !1, from: 8, to: 18 },
|
|
2508
2520
|
monday: { enabled: !0, from: 8, to: 18 },
|
|
2509
2521
|
tuesday: { enabled: !0, from: 8, to: 18 },
|
|
@@ -2528,7 +2540,7 @@ function be({ className: t }) {
|
|
|
2528
2540
|
}
|
|
2529
2541
|
);
|
|
2530
2542
|
}
|
|
2531
|
-
function
|
|
2543
|
+
function mr({ className: t }) {
|
|
2532
2544
|
return /* @__PURE__ */ n(
|
|
2533
2545
|
"svg",
|
|
2534
2546
|
{
|
|
@@ -2547,7 +2559,7 @@ function hr({ className: t }) {
|
|
|
2547
2559
|
}
|
|
2548
2560
|
);
|
|
2549
2561
|
}
|
|
2550
|
-
function
|
|
2562
|
+
function fr({ className: t }) {
|
|
2551
2563
|
return /* @__PURE__ */ n(
|
|
2552
2564
|
"svg",
|
|
2553
2565
|
{
|
|
@@ -2579,12 +2591,12 @@ function ye({ checked: t, onCheckedChange: r, className: o, children: s }) {
|
|
|
2579
2591
|
}
|
|
2580
2592
|
);
|
|
2581
2593
|
}
|
|
2582
|
-
function
|
|
2583
|
-
const [
|
|
2584
|
-
return !t ||
|
|
2594
|
+
function gr({ src: t, alt: r, fallback: o, className: s }) {
|
|
2595
|
+
const [i, l] = oe(!1);
|
|
2596
|
+
return !t || i ? /* @__PURE__ */ e(
|
|
2585
2597
|
"div",
|
|
2586
2598
|
{
|
|
2587
|
-
className:
|
|
2599
|
+
className: h(
|
|
2588
2600
|
"flex items-center justify-center bg-zinc-200 text-zinc-600 font-medium text-sm",
|
|
2589
2601
|
s
|
|
2590
2602
|
),
|
|
@@ -2595,20 +2607,20 @@ function fr({ src: t, alt: r, fallback: o, className: s }) {
|
|
|
2595
2607
|
{
|
|
2596
2608
|
src: t,
|
|
2597
2609
|
alt: r || "",
|
|
2598
|
-
className:
|
|
2599
|
-
onError: () =>
|
|
2610
|
+
className: h("object-cover", s),
|
|
2611
|
+
onError: () => l(!0)
|
|
2600
2612
|
}
|
|
2601
2613
|
);
|
|
2602
2614
|
}
|
|
2603
2615
|
function Ae({ value: t, onChange: r, placeholder: o, className: s }) {
|
|
2604
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2605
|
-
/* @__PURE__ */ e(
|
|
2616
|
+
return /* @__PURE__ */ n("div", { className: h("relative", s), children: [
|
|
2617
|
+
/* @__PURE__ */ e(mr, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
2606
2618
|
/* @__PURE__ */ e(
|
|
2607
2619
|
"input",
|
|
2608
2620
|
{
|
|
2609
2621
|
type: "text",
|
|
2610
2622
|
value: t,
|
|
2611
|
-
onChange: (
|
|
2623
|
+
onChange: (i) => r(i.target.value),
|
|
2612
2624
|
placeholder: o,
|
|
2613
2625
|
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"
|
|
2614
2626
|
}
|
|
@@ -2617,10 +2629,10 @@ function Ae({ value: t, onChange: r, placeholder: o, className: s }) {
|
|
|
2617
2629
|
}
|
|
2618
2630
|
function Fe(t, r, o, s = 0.3) {
|
|
2619
2631
|
if (!r.trim()) return t;
|
|
2620
|
-
const
|
|
2621
|
-
return t.filter((
|
|
2632
|
+
const i = r.toLowerCase();
|
|
2633
|
+
return t.filter((l) => o(l).some((f) => f ? f.toLowerCase().includes(i) : !1));
|
|
2622
2634
|
}
|
|
2623
|
-
const
|
|
2635
|
+
const xr = {
|
|
2624
2636
|
title: "Filters",
|
|
2625
2637
|
subtitle: "Filter calendar events",
|
|
2626
2638
|
scheduleTypes: "Event Types",
|
|
@@ -2633,13 +2645,13 @@ const gr = {
|
|
|
2633
2645
|
noScheduleTypes: "No event types found",
|
|
2634
2646
|
noParticipants: "No participants found"
|
|
2635
2647
|
};
|
|
2636
|
-
function
|
|
2648
|
+
function en({
|
|
2637
2649
|
scheduleTypes: t,
|
|
2638
2650
|
users: r,
|
|
2639
2651
|
selectedScheduleTypeIds: o,
|
|
2640
2652
|
onScheduleTypeChange: s,
|
|
2641
|
-
selectedUserIds:
|
|
2642
|
-
onUserChange:
|
|
2653
|
+
selectedUserIds: i,
|
|
2654
|
+
onUserChange: l,
|
|
2643
2655
|
onClearAll: g,
|
|
2644
2656
|
className: f,
|
|
2645
2657
|
scheduleTypesLoading: c = !1,
|
|
@@ -2647,59 +2659,59 @@ function Zr({
|
|
|
2647
2659
|
labels: b,
|
|
2648
2660
|
getScheduleTypeName: p
|
|
2649
2661
|
}) {
|
|
2650
|
-
const
|
|
2651
|
-
|
|
2652
|
-
p?.(
|
|
2653
|
-
]) : t, [t,
|
|
2654
|
-
const u =
|
|
2662
|
+
const S = { ...xr, ...b }, [W, L] = oe(""), [D, z] = oe(""), T = B(() => W.trim() ? Fe(t, W, (m) => [
|
|
2663
|
+
m.name,
|
|
2664
|
+
p?.(m) || m.name
|
|
2665
|
+
]) : t, [t, W, p]), w = B(() => D.trim() ? Fe(r, D, (m) => [m.name, m.email || ""]) : r, [r, D]), I = T.length > 0 && T.every((m) => o.includes(m.id)), C = w.length > 0 && w.every((m) => i.includes(m.id)), A = o.length + i.length, R = (m, a) => {
|
|
2666
|
+
const u = a ? [...o, m] : o.filter((v) => v !== m);
|
|
2655
2667
|
s(u);
|
|
2656
2668
|
}, V = () => {
|
|
2657
|
-
if (
|
|
2658
|
-
const
|
|
2659
|
-
s(o.filter((
|
|
2669
|
+
if (I) {
|
|
2670
|
+
const m = new Set(T.map((a) => a.id));
|
|
2671
|
+
s(o.filter((a) => !m.has(a)));
|
|
2660
2672
|
} else {
|
|
2661
|
-
const
|
|
2673
|
+
const m = /* @__PURE__ */ new Set([
|
|
2662
2674
|
...o,
|
|
2663
|
-
...
|
|
2675
|
+
...T.map((a) => a.id)
|
|
2664
2676
|
]);
|
|
2665
|
-
s(Array.from(
|
|
2677
|
+
s(Array.from(m));
|
|
2666
2678
|
}
|
|
2667
|
-
},
|
|
2668
|
-
const u =
|
|
2669
|
-
|
|
2679
|
+
}, F = (m, a) => {
|
|
2680
|
+
const u = a ? [...i, m] : i.filter((v) => v !== m);
|
|
2681
|
+
l(u);
|
|
2670
2682
|
}, O = () => {
|
|
2671
2683
|
if (C) {
|
|
2672
|
-
const
|
|
2673
|
-
i
|
|
2684
|
+
const m = new Set(w.map((a) => a.id));
|
|
2685
|
+
l(i.filter((a) => !m.has(a)));
|
|
2674
2686
|
} else {
|
|
2675
|
-
const
|
|
2676
|
-
|
|
2687
|
+
const m = /* @__PURE__ */ new Set([...i, ...w.map((a) => a.id)]);
|
|
2688
|
+
l(Array.from(m));
|
|
2677
2689
|
}
|
|
2678
2690
|
}, j = () => {
|
|
2679
|
-
s([]),
|
|
2680
|
-
}, _ = (
|
|
2691
|
+
s([]), l([]), g?.();
|
|
2692
|
+
}, _ = (m) => p ? p(m) : m.name, U = (m) => m.colorHex || m.color || "#069AD7";
|
|
2681
2693
|
return /* @__PURE__ */ n(
|
|
2682
2694
|
"div",
|
|
2683
2695
|
{
|
|
2684
|
-
className:
|
|
2696
|
+
className: h(
|
|
2685
2697
|
"flex min-w-72 max-w-72 flex-col rounded-lg border bg-white shadow-sm",
|
|
2686
2698
|
f
|
|
2687
2699
|
),
|
|
2688
2700
|
children: [
|
|
2689
2701
|
/* @__PURE__ */ n("header", { className: "flex items-start justify-between gap-2 px-4 pb-2 pt-4", children: [
|
|
2690
2702
|
/* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
2691
|
-
/* @__PURE__ */ e("h3", { className: "text-base font-semibold text-foreground", children:
|
|
2692
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children:
|
|
2703
|
+
/* @__PURE__ */ e("h3", { className: "text-base font-semibold text-foreground", children: S.title }),
|
|
2704
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: S.subtitle })
|
|
2693
2705
|
] }),
|
|
2694
|
-
|
|
2706
|
+
A > 0 && /* @__PURE__ */ n(
|
|
2695
2707
|
"button",
|
|
2696
2708
|
{
|
|
2697
2709
|
type: "button",
|
|
2698
2710
|
onClick: j,
|
|
2699
2711
|
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",
|
|
2700
2712
|
children: [
|
|
2701
|
-
/* @__PURE__ */ e(
|
|
2702
|
-
|
|
2713
|
+
/* @__PURE__ */ e(fr, { className: "h-3.5 w-3.5" }),
|
|
2714
|
+
S.clearAll
|
|
2703
2715
|
]
|
|
2704
2716
|
}
|
|
2705
2717
|
)
|
|
@@ -2707,29 +2719,29 @@ function Zr({
|
|
|
2707
2719
|
/* @__PURE__ */ e("div", { className: "h-px w-full bg-border/60" }),
|
|
2708
2720
|
/* @__PURE__ */ n("section", { className: "flex flex-col", children: [
|
|
2709
2721
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
2710
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children:
|
|
2722
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children: S.scheduleTypes }),
|
|
2711
2723
|
/* @__PURE__ */ e(
|
|
2712
2724
|
"button",
|
|
2713
2725
|
{
|
|
2714
2726
|
type: "button",
|
|
2715
2727
|
onClick: V,
|
|
2716
2728
|
className: "text-xs font-medium text-primary transition-colors hover:text-primary/80",
|
|
2717
|
-
children:
|
|
2729
|
+
children: I ? S.unselectAll : S.selectAll
|
|
2718
2730
|
}
|
|
2719
2731
|
)
|
|
2720
2732
|
] }),
|
|
2721
2733
|
t.length > 6 && /* @__PURE__ */ e("div", { className: "px-4 pb-3", children: /* @__PURE__ */ e(
|
|
2722
2734
|
Ae,
|
|
2723
2735
|
{
|
|
2724
|
-
value:
|
|
2725
|
-
onChange:
|
|
2726
|
-
placeholder:
|
|
2736
|
+
value: W,
|
|
2737
|
+
onChange: L,
|
|
2738
|
+
placeholder: S.searchScheduleTypes
|
|
2727
2739
|
}
|
|
2728
2740
|
) }),
|
|
2729
2741
|
/* @__PURE__ */ n("div", { className: "flex max-h-[220px] flex-col gap-2 overflow-y-auto px-4 pb-2 scrollbar-thin", children: [
|
|
2730
2742
|
c ? (
|
|
2731
2743
|
// Loading skeletons
|
|
2732
|
-
Array.from({ length: 4 }).map((
|
|
2744
|
+
Array.from({ length: 4 }).map((m, a) => /* @__PURE__ */ n(
|
|
2733
2745
|
"div",
|
|
2734
2746
|
{
|
|
2735
2747
|
className: "flex animate-pulse items-center gap-2 rounded-md border border-border/60 bg-muted/40 p-2",
|
|
@@ -2738,32 +2750,32 @@ function Zr({
|
|
|
2738
2750
|
/* @__PURE__ */ e("div", { className: "h-3 w-24 rounded bg-muted-foreground/20" })
|
|
2739
2751
|
]
|
|
2740
2752
|
},
|
|
2741
|
-
`skeleton-${
|
|
2753
|
+
`skeleton-${a}`
|
|
2742
2754
|
))
|
|
2743
|
-
) :
|
|
2744
|
-
const
|
|
2755
|
+
) : T.map((m) => {
|
|
2756
|
+
const a = o.includes(m.id), u = U(m);
|
|
2745
2757
|
return /* @__PURE__ */ n(
|
|
2746
2758
|
ye,
|
|
2747
2759
|
{
|
|
2748
|
-
checked:
|
|
2749
|
-
onCheckedChange: (
|
|
2750
|
-
className:
|
|
2760
|
+
checked: a,
|
|
2761
|
+
onCheckedChange: (v) => R(m.id, v),
|
|
2762
|
+
className: h(
|
|
2751
2763
|
"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",
|
|
2752
|
-
|
|
2764
|
+
a && "border-primary bg-primary/5"
|
|
2753
2765
|
),
|
|
2754
2766
|
children: [
|
|
2755
2767
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2756
2768
|
/* @__PURE__ */ e(
|
|
2757
2769
|
"span",
|
|
2758
2770
|
{
|
|
2759
|
-
className:
|
|
2771
|
+
className: h(
|
|
2760
2772
|
"flex h-4 w-4 items-center justify-center rounded border border-border text-xs transition-colors",
|
|
2761
|
-
|
|
2773
|
+
a && "border-primary bg-primary text-primary-foreground"
|
|
2762
2774
|
),
|
|
2763
|
-
children:
|
|
2775
|
+
children: a && /* @__PURE__ */ e(be, { className: "h-3 w-3" })
|
|
2764
2776
|
}
|
|
2765
2777
|
),
|
|
2766
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: _(
|
|
2778
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: _(m) })
|
|
2767
2779
|
] }),
|
|
2768
2780
|
/* @__PURE__ */ e(
|
|
2769
2781
|
"div",
|
|
@@ -2777,22 +2789,22 @@ function Zr({
|
|
|
2777
2789
|
)
|
|
2778
2790
|
]
|
|
2779
2791
|
},
|
|
2780
|
-
|
|
2792
|
+
m.id
|
|
2781
2793
|
);
|
|
2782
2794
|
}),
|
|
2783
|
-
!c &&
|
|
2795
|
+
!c && T.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1 text-xs text-muted-foreground", children: S.noScheduleTypes })
|
|
2784
2796
|
] })
|
|
2785
2797
|
] }),
|
|
2786
2798
|
/* @__PURE__ */ e("div", { className: "h-px w-full bg-border/60" }),
|
|
2787
2799
|
/* @__PURE__ */ n("section", { className: "flex flex-col", children: [
|
|
2788
2800
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
2789
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children:
|
|
2801
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children: S.participants }),
|
|
2790
2802
|
/* @__PURE__ */ e(
|
|
2791
2803
|
ye,
|
|
2792
2804
|
{
|
|
2793
2805
|
checked: C,
|
|
2794
2806
|
onCheckedChange: () => O(),
|
|
2795
|
-
className:
|
|
2807
|
+
className: h(
|
|
2796
2808
|
"flex h-5 w-5 items-center justify-center rounded border border-border bg-white transition-colors hover:border-primary/50",
|
|
2797
2809
|
C && "border-primary bg-primary text-primary-foreground"
|
|
2798
2810
|
),
|
|
@@ -2804,14 +2816,14 @@ function Zr({
|
|
|
2804
2816
|
Ae,
|
|
2805
2817
|
{
|
|
2806
2818
|
value: D,
|
|
2807
|
-
onChange:
|
|
2808
|
-
placeholder:
|
|
2819
|
+
onChange: z,
|
|
2820
|
+
placeholder: S.searchParticipants
|
|
2809
2821
|
}
|
|
2810
2822
|
) }),
|
|
2811
2823
|
/* @__PURE__ */ n("div", { className: "flex max-h-[400px] flex-col gap-2 overflow-y-auto px-4 pb-4 scrollbar-thin", children: [
|
|
2812
2824
|
x ? (
|
|
2813
2825
|
// Loading skeletons
|
|
2814
|
-
Array.from({ length: 4 }).map((
|
|
2826
|
+
Array.from({ length: 4 }).map((m, a) => /* @__PURE__ */ n(
|
|
2815
2827
|
"div",
|
|
2816
2828
|
{
|
|
2817
2829
|
className: "flex animate-pulse items-center gap-3 rounded-md border border-border/60 bg-muted/40 p-3",
|
|
@@ -2824,65 +2836,65 @@ function Zr({
|
|
|
2824
2836
|
] })
|
|
2825
2837
|
]
|
|
2826
2838
|
},
|
|
2827
|
-
`p-skeleton-${
|
|
2839
|
+
`p-skeleton-${a}`
|
|
2828
2840
|
))
|
|
2829
|
-
) :
|
|
2830
|
-
const
|
|
2841
|
+
) : w.map((m) => {
|
|
2842
|
+
const a = i.includes(m.id);
|
|
2831
2843
|
return /* @__PURE__ */ n(
|
|
2832
2844
|
ye,
|
|
2833
2845
|
{
|
|
2834
|
-
checked:
|
|
2835
|
-
onCheckedChange: (u) =>
|
|
2836
|
-
className:
|
|
2846
|
+
checked: a,
|
|
2847
|
+
onCheckedChange: (u) => F(m.id, u),
|
|
2848
|
+
className: h(
|
|
2837
2849
|
"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",
|
|
2838
|
-
|
|
2850
|
+
a && "border-primary bg-zinc-50"
|
|
2839
2851
|
),
|
|
2840
2852
|
children: [
|
|
2841
2853
|
/* @__PURE__ */ e(
|
|
2842
2854
|
"span",
|
|
2843
2855
|
{
|
|
2844
|
-
className:
|
|
2856
|
+
className: h(
|
|
2845
2857
|
"flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border border-border transition-colors",
|
|
2846
|
-
|
|
2858
|
+
a && "border-primary bg-primary text-primary-foreground"
|
|
2847
2859
|
),
|
|
2848
|
-
children:
|
|
2860
|
+
children: a && /* @__PURE__ */ e(be, { className: "h-2.5 w-2.5" })
|
|
2849
2861
|
}
|
|
2850
2862
|
),
|
|
2851
2863
|
/* @__PURE__ */ n("div", { className: "flex flex-1 items-start gap-2", children: [
|
|
2852
2864
|
/* @__PURE__ */ e(
|
|
2853
|
-
|
|
2865
|
+
gr,
|
|
2854
2866
|
{
|
|
2855
|
-
src:
|
|
2856
|
-
alt:
|
|
2857
|
-
fallback:
|
|
2867
|
+
src: m.avatar ?? null,
|
|
2868
|
+
alt: m.name,
|
|
2869
|
+
fallback: m.name?.[0]?.toUpperCase() ?? "?",
|
|
2858
2870
|
className: "h-10 w-10 rounded-lg"
|
|
2859
2871
|
}
|
|
2860
2872
|
),
|
|
2861
2873
|
/* @__PURE__ */ n("div", { className: "flex max-w-[140px] flex-col gap-0.5 overflow-hidden", children: [
|
|
2862
|
-
/* @__PURE__ */ e("span", { className: "line-clamp-1 text-sm font-medium text-foreground", children:
|
|
2874
|
+
/* @__PURE__ */ e("span", { className: "line-clamp-1 text-sm font-medium text-foreground", children: m.name }),
|
|
2863
2875
|
/* @__PURE__ */ e(
|
|
2864
2876
|
"span",
|
|
2865
2877
|
{
|
|
2866
2878
|
className: "truncate text-[11px] text-muted-foreground",
|
|
2867
|
-
title:
|
|
2868
|
-
children:
|
|
2879
|
+
title: m.email,
|
|
2880
|
+
children: m.email
|
|
2869
2881
|
}
|
|
2870
2882
|
)
|
|
2871
2883
|
] })
|
|
2872
2884
|
] })
|
|
2873
2885
|
]
|
|
2874
2886
|
},
|
|
2875
|
-
|
|
2887
|
+
m.id
|
|
2876
2888
|
);
|
|
2877
2889
|
}),
|
|
2878
|
-
!x &&
|
|
2890
|
+
!x && w.length === 0 && /* @__PURE__ */ e("p", { className: "px-4 text-xs text-muted-foreground", children: S.noParticipants })
|
|
2879
2891
|
] })
|
|
2880
2892
|
] })
|
|
2881
2893
|
]
|
|
2882
2894
|
}
|
|
2883
2895
|
);
|
|
2884
2896
|
}
|
|
2885
|
-
function
|
|
2897
|
+
function pr({ className: t }) {
|
|
2886
2898
|
return /* @__PURE__ */ n(
|
|
2887
2899
|
"svg",
|
|
2888
2900
|
{
|
|
@@ -2903,19 +2915,19 @@ function xr({ className: t }) {
|
|
|
2903
2915
|
}
|
|
2904
2916
|
);
|
|
2905
2917
|
}
|
|
2906
|
-
function
|
|
2918
|
+
function tn({
|
|
2907
2919
|
scheduleTypes: t,
|
|
2908
2920
|
value: r,
|
|
2909
2921
|
onChange: o,
|
|
2910
2922
|
allLabel: s = "All types",
|
|
2911
|
-
className:
|
|
2912
|
-
label:
|
|
2923
|
+
className: i,
|
|
2924
|
+
label: l
|
|
2913
2925
|
}) {
|
|
2914
2926
|
const g = (c) => {
|
|
2915
2927
|
o(c.target.value);
|
|
2916
2928
|
}, f = t.find((c) => String(c.id) === r);
|
|
2917
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2918
|
-
|
|
2929
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-1", i), children: [
|
|
2930
|
+
l && /* @__PURE__ */ e(J, { className: "text-xs text-muted-foreground", children: l }),
|
|
2919
2931
|
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2920
2932
|
f ? /* @__PURE__ */ e(
|
|
2921
2933
|
"span",
|
|
@@ -2923,9 +2935,9 @@ function en({
|
|
|
2923
2935
|
className: "pointer-events-none absolute left-2.5 top-1/2 size-3 -translate-y-1/2 rounded-full",
|
|
2924
2936
|
style: { backgroundColor: f.color }
|
|
2925
2937
|
}
|
|
2926
|
-
) : /* @__PURE__ */ e(
|
|
2938
|
+
) : /* @__PURE__ */ e(pr, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
2927
2939
|
/* @__PURE__ */ n(
|
|
2928
|
-
|
|
2940
|
+
te,
|
|
2929
2941
|
{
|
|
2930
2942
|
value: r,
|
|
2931
2943
|
onChange: g,
|
|
@@ -2939,7 +2951,7 @@ function en({
|
|
|
2939
2951
|
] })
|
|
2940
2952
|
] });
|
|
2941
2953
|
}
|
|
2942
|
-
function
|
|
2954
|
+
function vr({ className: t }) {
|
|
2943
2955
|
return /* @__PURE__ */ n(
|
|
2944
2956
|
"svg",
|
|
2945
2957
|
{
|
|
@@ -2962,23 +2974,23 @@ function pr({ className: t }) {
|
|
|
2962
2974
|
}
|
|
2963
2975
|
);
|
|
2964
2976
|
}
|
|
2965
|
-
function
|
|
2977
|
+
function rn({
|
|
2966
2978
|
users: t,
|
|
2967
2979
|
value: r,
|
|
2968
2980
|
onChange: o,
|
|
2969
2981
|
allLabel: s = "All users",
|
|
2970
|
-
className:
|
|
2971
|
-
label:
|
|
2982
|
+
className: i,
|
|
2983
|
+
label: l
|
|
2972
2984
|
}) {
|
|
2973
2985
|
const g = (f) => {
|
|
2974
2986
|
o(f.target.value);
|
|
2975
2987
|
};
|
|
2976
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2977
|
-
|
|
2988
|
+
return /* @__PURE__ */ n("div", { className: h("flex flex-col gap-1", i), children: [
|
|
2989
|
+
l && /* @__PURE__ */ e(J, { className: "text-xs text-muted-foreground", children: l }),
|
|
2978
2990
|
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2979
|
-
/* @__PURE__ */ e(
|
|
2991
|
+
/* @__PURE__ */ e(vr, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
2980
2992
|
/* @__PURE__ */ n(
|
|
2981
|
-
|
|
2993
|
+
te,
|
|
2982
2994
|
{
|
|
2983
2995
|
value: r,
|
|
2984
2996
|
onChange: g,
|
|
@@ -2992,7 +3004,7 @@ function tn({
|
|
|
2992
3004
|
] })
|
|
2993
3005
|
] });
|
|
2994
3006
|
}
|
|
2995
|
-
function
|
|
3007
|
+
function wr({ className: t }) {
|
|
2996
3008
|
return /* @__PURE__ */ n(
|
|
2997
3009
|
"svg",
|
|
2998
3010
|
{
|
|
@@ -3019,7 +3031,7 @@ function vr({ className: t }) {
|
|
|
3019
3031
|
}
|
|
3020
3032
|
);
|
|
3021
3033
|
}
|
|
3022
|
-
function
|
|
3034
|
+
function br({ className: t }) {
|
|
3023
3035
|
return /* @__PURE__ */ n(
|
|
3024
3036
|
"svg",
|
|
3025
3037
|
{
|
|
@@ -3042,7 +3054,7 @@ function wr({ className: t }) {
|
|
|
3042
3054
|
}
|
|
3043
3055
|
);
|
|
3044
3056
|
}
|
|
3045
|
-
function
|
|
3057
|
+
function yr({ className: t }) {
|
|
3046
3058
|
return /* @__PURE__ */ e(
|
|
3047
3059
|
"svg",
|
|
3048
3060
|
{
|
|
@@ -3058,7 +3070,7 @@ function br({ className: t }) {
|
|
|
3058
3070
|
}
|
|
3059
3071
|
);
|
|
3060
3072
|
}
|
|
3061
|
-
function
|
|
3073
|
+
function kr({ className: t }) {
|
|
3062
3074
|
return /* @__PURE__ */ n(
|
|
3063
3075
|
"svg",
|
|
3064
3076
|
{
|
|
@@ -3078,25 +3090,25 @@ function yr({ className: t }) {
|
|
|
3078
3090
|
}
|
|
3079
3091
|
);
|
|
3080
3092
|
}
|
|
3081
|
-
function
|
|
3093
|
+
function Nr(t) {
|
|
3082
3094
|
const r = t.getFullYear(), o = String(t.getMonth() + 1).padStart(2, "0"), s = String(t.getDate()).padStart(2, "0");
|
|
3083
3095
|
return `${r}-${o}-${s}`;
|
|
3084
3096
|
}
|
|
3085
|
-
function
|
|
3086
|
-
const r = t.getHours(), o = t.getMinutes(), s = r >= 12 ? "PM" : "AM",
|
|
3087
|
-
return `${
|
|
3097
|
+
function $e(t) {
|
|
3098
|
+
const r = t.getHours(), o = t.getMinutes(), s = r >= 12 ? "PM" : "AM", i = r % 12 || 12, l = String(o).padStart(2, "0");
|
|
3099
|
+
return `${i}:${l} ${s}`;
|
|
3088
3100
|
}
|
|
3089
|
-
function
|
|
3090
|
-
const r =
|
|
3101
|
+
function Cr(t) {
|
|
3102
|
+
const r = $e(t.startDate), o = $e(t.endDate);
|
|
3091
3103
|
return `${r} - ${o}`;
|
|
3092
3104
|
}
|
|
3093
|
-
function
|
|
3105
|
+
function Dr(t) {
|
|
3094
3106
|
const r = Ue(/* @__PURE__ */ new Date(), 1);
|
|
3095
3107
|
return t.getFullYear() === r.getFullYear() && t.getMonth() === r.getMonth() && t.getDate() === r.getDate();
|
|
3096
3108
|
}
|
|
3097
|
-
function
|
|
3098
|
-
if (
|
|
3099
|
-
if (
|
|
3109
|
+
function Mr(t) {
|
|
3110
|
+
if (G(t)) return "Today";
|
|
3111
|
+
if (Dr(t)) return "Tomorrow";
|
|
3100
3112
|
const r = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], o = [
|
|
3101
3113
|
"Jan",
|
|
3102
3114
|
"Feb",
|
|
@@ -3110,41 +3122,41 @@ function Dr(t) {
|
|
|
3110
3122
|
"Oct",
|
|
3111
3123
|
"Nov",
|
|
3112
3124
|
"Dec"
|
|
3113
|
-
], s = r[t.getDay()],
|
|
3114
|
-
return `${s}, ${
|
|
3125
|
+
], s = r[t.getDay()], i = o[t.getMonth()], l = t.getDate();
|
|
3126
|
+
return `${s}, ${i} ${l}`;
|
|
3115
3127
|
}
|
|
3116
|
-
function
|
|
3128
|
+
function Sr(t, r) {
|
|
3117
3129
|
const o = /* @__PURE__ */ new Map();
|
|
3118
3130
|
for (const s of t) {
|
|
3119
|
-
const
|
|
3120
|
-
|
|
3131
|
+
const i = Nr(s.startDate), l = o.get(i) ?? [];
|
|
3132
|
+
l.push(s), o.set(i, l);
|
|
3121
3133
|
}
|
|
3122
|
-
return Array.from(o.entries()).map(([s,
|
|
3123
|
-
const
|
|
3134
|
+
return Array.from(o.entries()).map(([s, i]) => {
|
|
3135
|
+
const l = [...i].sort(
|
|
3124
3136
|
(f, c) => f.startDate.getTime() - c.startDate.getTime()
|
|
3125
|
-
), g = r > 0 ?
|
|
3137
|
+
), g = r > 0 ? l.slice(0, r) : l;
|
|
3126
3138
|
return {
|
|
3127
3139
|
date: new Date(s),
|
|
3128
3140
|
dateKey: s,
|
|
3129
3141
|
events: g,
|
|
3130
|
-
hasMore: r > 0 &&
|
|
3142
|
+
hasMore: r > 0 && l.length > r
|
|
3131
3143
|
};
|
|
3132
|
-
}).sort((s,
|
|
3144
|
+
}).sort((s, i) => s.date.getTime() - i.date.getTime());
|
|
3133
3145
|
}
|
|
3134
|
-
function
|
|
3146
|
+
function Er(t) {
|
|
3135
3147
|
const r = pe(/* @__PURE__ */ new Date()), o = Ve(/* @__PURE__ */ new Date());
|
|
3136
3148
|
return t.filter((s) => s.startDate >= r && s.startDate <= o).length;
|
|
3137
3149
|
}
|
|
3138
3150
|
function ke({ className: t }) {
|
|
3139
|
-
return /* @__PURE__ */ e("div", { className:
|
|
3151
|
+
return /* @__PURE__ */ e("div", { className: h("animate-pulse rounded-md bg-muted", t) });
|
|
3140
3152
|
}
|
|
3141
|
-
function
|
|
3153
|
+
function zr({ event: t, onClick: r }) {
|
|
3142
3154
|
return /* @__PURE__ */ n(
|
|
3143
3155
|
"button",
|
|
3144
3156
|
{
|
|
3145
3157
|
type: "button",
|
|
3146
3158
|
onClick: () => r?.(t),
|
|
3147
|
-
className:
|
|
3159
|
+
className: h(
|
|
3148
3160
|
"w-full text-left rounded-lg transition-colors",
|
|
3149
3161
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3150
3162
|
"flex items-start gap-3 p-2"
|
|
@@ -3159,58 +3171,58 @@ function Er({ event: t, onClick: r }) {
|
|
|
3159
3171
|
),
|
|
3160
3172
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
3161
3173
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium truncate", children: t.title }),
|
|
3162
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children:
|
|
3174
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children: Cr(t) })
|
|
3163
3175
|
] }),
|
|
3164
|
-
r && /* @__PURE__ */ e(
|
|
3176
|
+
r && /* @__PURE__ */ e(yr, { className: "shrink-0 size-4 text-muted-foreground/50 mt-1" })
|
|
3165
3177
|
]
|
|
3166
3178
|
}
|
|
3167
3179
|
);
|
|
3168
3180
|
}
|
|
3169
|
-
function
|
|
3181
|
+
function Hr({ group: t, onEventClick: r }) {
|
|
3170
3182
|
return /* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
3171
3183
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between px-2 py-1.5", children: [
|
|
3172
|
-
/* @__PURE__ */ e("h3", { className:
|
|
3184
|
+
/* @__PURE__ */ e("h3", { className: h("text-xs font-semibold", G(t.date) && "text-primary"), children: Mr(t.date) }),
|
|
3173
3185
|
t.hasMore && /* @__PURE__ */ n("span", { className: "text-[10px] text-muted-foreground", children: [
|
|
3174
3186
|
"+",
|
|
3175
3187
|
t.events.length,
|
|
3176
3188
|
" more"
|
|
3177
3189
|
] })
|
|
3178
3190
|
] }),
|
|
3179
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((o) => /* @__PURE__ */ e(
|
|
3191
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((o) => /* @__PURE__ */ e(zr, { event: o, onClick: r }, o.id)) })
|
|
3180
3192
|
] });
|
|
3181
3193
|
}
|
|
3182
|
-
function
|
|
3194
|
+
function nn({
|
|
3183
3195
|
events: t,
|
|
3184
3196
|
isLoading: r = !1,
|
|
3185
3197
|
className: o,
|
|
3186
3198
|
daysAhead: s = 7,
|
|
3187
|
-
maxEventsPerDay:
|
|
3188
|
-
onEventClick:
|
|
3199
|
+
maxEventsPerDay: i = 3,
|
|
3200
|
+
onEventClick: l,
|
|
3189
3201
|
onNavigateToAgenda: g
|
|
3190
3202
|
}) {
|
|
3191
|
-
const [f, c] =
|
|
3192
|
-
const
|
|
3193
|
-
return t.filter((
|
|
3194
|
-
}, [t, s]), b =
|
|
3195
|
-
() =>
|
|
3196
|
-
[x,
|
|
3197
|
-
), p =
|
|
3198
|
-
c(!1),
|
|
3199
|
-
},
|
|
3203
|
+
const [f, c] = oe(!1), x = B(() => {
|
|
3204
|
+
const L = pe(/* @__PURE__ */ new Date()), D = Ue(L, s);
|
|
3205
|
+
return t.filter((z) => z.endDate >= L && z.startDate < D);
|
|
3206
|
+
}, [t, s]), b = B(
|
|
3207
|
+
() => Sr(x, i),
|
|
3208
|
+
[x, i]
|
|
3209
|
+
), p = B(() => Er(t), [t]), S = (L) => {
|
|
3210
|
+
c(!1), l?.(L);
|
|
3211
|
+
}, W = () => {
|
|
3200
3212
|
c(!1), g?.();
|
|
3201
3213
|
};
|
|
3202
3214
|
return /* @__PURE__ */ n(Pe, { open: f, onOpenChange: c, children: [
|
|
3203
3215
|
/* @__PURE__ */ n(
|
|
3204
3216
|
_e,
|
|
3205
3217
|
{
|
|
3206
|
-
className:
|
|
3218
|
+
className: h(
|
|
3207
3219
|
"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",
|
|
3208
3220
|
o
|
|
3209
3221
|
),
|
|
3210
3222
|
children: [
|
|
3211
|
-
/* @__PURE__ */ e(
|
|
3223
|
+
/* @__PURE__ */ e(wr, { className: "h-4 w-4" }),
|
|
3212
3224
|
p > 0 && /* @__PURE__ */ e(
|
|
3213
|
-
|
|
3225
|
+
lt,
|
|
3214
3226
|
{
|
|
3215
3227
|
variant: "destructive",
|
|
3216
3228
|
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",
|
|
@@ -3230,41 +3242,41 @@ function rn({
|
|
|
3230
3242
|
"button",
|
|
3231
3243
|
{
|
|
3232
3244
|
type: "button",
|
|
3233
|
-
onClick:
|
|
3245
|
+
onClick: W,
|
|
3234
3246
|
className: "text-xs text-primary hover:underline flex items-center gap-1",
|
|
3235
3247
|
children: [
|
|
3236
3248
|
"View all",
|
|
3237
|
-
/* @__PURE__ */ e(
|
|
3249
|
+
/* @__PURE__ */ e(kr, { className: "size-3" })
|
|
3238
3250
|
]
|
|
3239
3251
|
}
|
|
3240
3252
|
)
|
|
3241
3253
|
] }),
|
|
3242
|
-
/* @__PURE__ */ e("div", { className: "max-h-80 overflow-y-auto p-2", children: r ? /* @__PURE__ */ e("div", { className: "space-y-2 p-2", children: Array.from({ length: 3 }).map((
|
|
3254
|
+
/* @__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((L, D) => /* @__PURE__ */ n("div", { className: "flex space-x-3", children: [
|
|
3243
3255
|
/* @__PURE__ */ e(ke, { className: "h-2 w-2 rounded-full mt-2" }),
|
|
3244
3256
|
/* @__PURE__ */ n("div", { className: "flex-1 space-y-2", children: [
|
|
3245
3257
|
/* @__PURE__ */ e(ke, { className: "h-4 w-full" }),
|
|
3246
3258
|
/* @__PURE__ */ e(ke, { className: "h-3 w-3/4" })
|
|
3247
3259
|
] })
|
|
3248
3260
|
] }, D)) }) : b.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
|
|
3249
|
-
/* @__PURE__ */ e(
|
|
3261
|
+
/* @__PURE__ */ e(br, { className: "mb-2 h-8 w-8 text-muted-foreground/50" }),
|
|
3250
3262
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No upcoming events" }),
|
|
3251
3263
|
/* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground/70", children: [
|
|
3252
3264
|
"Your schedule is clear for the next ",
|
|
3253
3265
|
s,
|
|
3254
3266
|
" days"
|
|
3255
3267
|
] })
|
|
3256
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children: b.map((
|
|
3257
|
-
|
|
3268
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children: b.map((L) => /* @__PURE__ */ e(
|
|
3269
|
+
Hr,
|
|
3258
3270
|
{
|
|
3259
|
-
group:
|
|
3260
|
-
onEventClick:
|
|
3271
|
+
group: L,
|
|
3272
|
+
onEventClick: S
|
|
3261
3273
|
},
|
|
3262
|
-
|
|
3274
|
+
L.dateKey
|
|
3263
3275
|
)) }) })
|
|
3264
3276
|
] })
|
|
3265
3277
|
] });
|
|
3266
3278
|
}
|
|
3267
|
-
function
|
|
3279
|
+
function Lr({ className: t }) {
|
|
3268
3280
|
return /* @__PURE__ */ n(
|
|
3269
3281
|
"svg",
|
|
3270
3282
|
{
|
|
@@ -3307,53 +3319,53 @@ function Ge({ className: t }) {
|
|
|
3307
3319
|
}
|
|
3308
3320
|
);
|
|
3309
3321
|
}
|
|
3310
|
-
function
|
|
3322
|
+
function Tr(t) {
|
|
3311
3323
|
const r = /* @__PURE__ */ new Date();
|
|
3312
3324
|
return r.setDate(r.getDate() + 1), t.getFullYear() === r.getFullYear() && t.getMonth() === r.getMonth() && t.getDate() === r.getDate();
|
|
3313
3325
|
}
|
|
3314
|
-
function
|
|
3326
|
+
function Be(t) {
|
|
3315
3327
|
const r = t.getHours(), o = t.getMinutes(), s = r >= 12 ? "PM" : "AM";
|
|
3316
3328
|
return `${r % 12 || 12}:${o.toString().padStart(2, "0")} ${s}`;
|
|
3317
3329
|
}
|
|
3318
|
-
function
|
|
3330
|
+
function Ir(t) {
|
|
3319
3331
|
return new Intl.DateTimeFormat("en-US", {
|
|
3320
3332
|
weekday: "long",
|
|
3321
3333
|
month: "short",
|
|
3322
3334
|
day: "numeric"
|
|
3323
3335
|
}).format(t);
|
|
3324
3336
|
}
|
|
3325
|
-
function
|
|
3326
|
-
const r =
|
|
3337
|
+
function jr(t) {
|
|
3338
|
+
const r = Be(t.startDate), o = Be(t.endDate);
|
|
3327
3339
|
return `${r} - ${o}`;
|
|
3328
3340
|
}
|
|
3329
|
-
function
|
|
3330
|
-
return
|
|
3341
|
+
function Wr(t) {
|
|
3342
|
+
return G(t) ? "Today" : Tr(t) ? "Tomorrow" : Ir(t);
|
|
3331
3343
|
}
|
|
3332
|
-
function
|
|
3344
|
+
function Ar(t, r) {
|
|
3333
3345
|
const o = /* @__PURE__ */ new Map();
|
|
3334
3346
|
for (const s of t) {
|
|
3335
|
-
const
|
|
3336
|
-
|
|
3347
|
+
const i = xt(s.startDate), l = o.get(i) ?? [];
|
|
3348
|
+
l.push(s), o.set(i, l);
|
|
3337
3349
|
}
|
|
3338
|
-
return Array.from(o.entries()).map(([s,
|
|
3339
|
-
const
|
|
3350
|
+
return Array.from(o.entries()).map(([s, i]) => {
|
|
3351
|
+
const l = [...i].sort(
|
|
3340
3352
|
(f, c) => f.startDate.getTime() - c.startDate.getTime()
|
|
3341
|
-
), g = r > 0 ?
|
|
3353
|
+
), g = r > 0 ? l.slice(0, r) : l;
|
|
3342
3354
|
return {
|
|
3343
3355
|
date: new Date(s),
|
|
3344
3356
|
dateKey: s,
|
|
3345
3357
|
events: g,
|
|
3346
|
-
hasMore: r > 0 &&
|
|
3358
|
+
hasMore: r > 0 && l.length > r
|
|
3347
3359
|
};
|
|
3348
|
-
}).sort((s,
|
|
3360
|
+
}).sort((s, i) => s.date.getTime() - i.date.getTime());
|
|
3349
3361
|
}
|
|
3350
|
-
function
|
|
3362
|
+
function Fr({ event: t, onClick: r, compact: o }) {
|
|
3351
3363
|
return /* @__PURE__ */ n(
|
|
3352
3364
|
"button",
|
|
3353
3365
|
{
|
|
3354
3366
|
type: "button",
|
|
3355
3367
|
onClick: () => r?.(t),
|
|
3356
|
-
className:
|
|
3368
|
+
className: h(
|
|
3357
3369
|
"w-full text-left rounded-lg transition-colors",
|
|
3358
3370
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3359
3371
|
"flex items-start gap-3",
|
|
@@ -3363,41 +3375,41 @@ function Ar({ event: t, onClick: r, compact: o }) {
|
|
|
3363
3375
|
/* @__PURE__ */ e(
|
|
3364
3376
|
"div",
|
|
3365
3377
|
{
|
|
3366
|
-
className:
|
|
3378
|
+
className: h("shrink-0 rounded-full mt-1", o ? "size-2" : "size-2.5"),
|
|
3367
3379
|
style: { backgroundColor: t.color ?? "#3b82f6" }
|
|
3368
3380
|
}
|
|
3369
3381
|
),
|
|
3370
3382
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
3371
|
-
/* @__PURE__ */ e("p", { className:
|
|
3372
|
-
/* @__PURE__ */ e("p", { className:
|
|
3383
|
+
/* @__PURE__ */ e("p", { className: h("font-medium truncate", o ? "text-xs" : "text-sm"), children: t.title }),
|
|
3384
|
+
/* @__PURE__ */ e("p", { className: h("text-muted-foreground truncate", o ? "text-[10px]" : "text-xs"), children: jr(t) })
|
|
3373
3385
|
] }),
|
|
3374
3386
|
r && /* @__PURE__ */ e(
|
|
3375
3387
|
Ge,
|
|
3376
3388
|
{
|
|
3377
|
-
className:
|
|
3389
|
+
className: h("shrink-0 text-muted-foreground/50", o ? "size-3" : "size-4")
|
|
3378
3390
|
}
|
|
3379
3391
|
)
|
|
3380
3392
|
]
|
|
3381
3393
|
}
|
|
3382
3394
|
);
|
|
3383
3395
|
}
|
|
3384
|
-
function
|
|
3396
|
+
function $r({
|
|
3385
3397
|
group: t,
|
|
3386
3398
|
onEventClick: r,
|
|
3387
3399
|
onViewMore: o,
|
|
3388
3400
|
compact: s
|
|
3389
3401
|
}) {
|
|
3390
3402
|
return /* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
3391
|
-
/* @__PURE__ */ n("div", { className:
|
|
3403
|
+
/* @__PURE__ */ n("div", { className: h("flex items-center justify-between px-2", s ? "py-1" : "py-1.5"), children: [
|
|
3392
3404
|
/* @__PURE__ */ e(
|
|
3393
3405
|
"h3",
|
|
3394
3406
|
{
|
|
3395
|
-
className:
|
|
3407
|
+
className: h(
|
|
3396
3408
|
"font-semibold",
|
|
3397
3409
|
s ? "text-xs" : "text-sm",
|
|
3398
|
-
|
|
3410
|
+
G(t.date) && "text-primary"
|
|
3399
3411
|
),
|
|
3400
|
-
children:
|
|
3412
|
+
children: Wr(t.date)
|
|
3401
3413
|
}
|
|
3402
3414
|
),
|
|
3403
3415
|
t.hasMore && o && /* @__PURE__ */ e(
|
|
@@ -3405,90 +3417,90 @@ function Fr({
|
|
|
3405
3417
|
{
|
|
3406
3418
|
type: "button",
|
|
3407
3419
|
onClick: () => o(t.date),
|
|
3408
|
-
className:
|
|
3420
|
+
className: h("text-primary hover:underline", s ? "text-[10px]" : "text-xs"),
|
|
3409
3421
|
children: "+more"
|
|
3410
3422
|
}
|
|
3411
3423
|
)
|
|
3412
3424
|
] }),
|
|
3413
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((
|
|
3425
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((i) => /* @__PURE__ */ e(Fr, { event: i, onClick: r, compact: s }, i.id)) })
|
|
3414
3426
|
] });
|
|
3415
3427
|
}
|
|
3416
|
-
function
|
|
3428
|
+
function on({
|
|
3417
3429
|
events: t,
|
|
3418
3430
|
daysAhead: r = 7,
|
|
3419
3431
|
maxEventsPerDay: o = 3,
|
|
3420
3432
|
onEventClick: s,
|
|
3421
|
-
onViewAll:
|
|
3422
|
-
className:
|
|
3433
|
+
onViewAll: i,
|
|
3434
|
+
className: l,
|
|
3423
3435
|
emptyState: g,
|
|
3424
3436
|
title: f = "Upcoming",
|
|
3425
3437
|
showHeader: c = !0,
|
|
3426
3438
|
compact: x = !1
|
|
3427
3439
|
}) {
|
|
3428
|
-
const b = Oe(), p = b?.filteredEvents,
|
|
3429
|
-
const
|
|
3430
|
-
return
|
|
3431
|
-
}, [
|
|
3432
|
-
() =>
|
|
3433
|
-
[
|
|
3434
|
-
),
|
|
3435
|
-
return D.length === 0 ? /* @__PURE__ */ n("div", { className:
|
|
3440
|
+
const b = Oe(), p = b?.filteredEvents, S = b?.currentDate ?? /* @__PURE__ */ new Date(), W = t ?? p ?? [], L = B(() => {
|
|
3441
|
+
const T = pe(S), w = new Date(T);
|
|
3442
|
+
return w.setDate(w.getDate() + r), W.filter((I) => I.endDate >= T && I.startDate < w);
|
|
3443
|
+
}, [W, r, S]), D = B(
|
|
3444
|
+
() => Ar(L, o),
|
|
3445
|
+
[L, o]
|
|
3446
|
+
), z = L.length;
|
|
3447
|
+
return D.length === 0 ? /* @__PURE__ */ n("div", { className: h("rounded-lg border bg-card", l), children: [
|
|
3436
3448
|
c && /* @__PURE__ */ e(
|
|
3437
3449
|
"div",
|
|
3438
3450
|
{
|
|
3439
|
-
className:
|
|
3451
|
+
className: h(
|
|
3440
3452
|
"border-b px-4 flex items-center justify-between",
|
|
3441
3453
|
x ? "py-2" : "py-3"
|
|
3442
3454
|
),
|
|
3443
|
-
children: /* @__PURE__ */ e("h2", { className:
|
|
3455
|
+
children: /* @__PURE__ */ e("h2", { className: h("font-semibold", x ? "text-sm" : "text-base"), children: f })
|
|
3444
3456
|
}
|
|
3445
3457
|
),
|
|
3446
3458
|
/* @__PURE__ */ e(
|
|
3447
3459
|
"div",
|
|
3448
3460
|
{
|
|
3449
|
-
className:
|
|
3461
|
+
className: h(
|
|
3450
3462
|
"flex flex-col items-center justify-center text-center",
|
|
3451
3463
|
x ? "py-6 px-4" : "py-10 px-6"
|
|
3452
3464
|
),
|
|
3453
|
-
children: g ?? /* @__PURE__ */ n(
|
|
3465
|
+
children: g ?? /* @__PURE__ */ n(re, { children: [
|
|
3454
3466
|
/* @__PURE__ */ e(
|
|
3455
|
-
|
|
3467
|
+
Lr,
|
|
3456
3468
|
{
|
|
3457
|
-
className:
|
|
3469
|
+
className: h("text-muted-foreground/50 mb-2", x ? "size-8" : "size-10")
|
|
3458
3470
|
}
|
|
3459
3471
|
),
|
|
3460
|
-
/* @__PURE__ */ e("p", { className:
|
|
3472
|
+
/* @__PURE__ */ e("p", { className: h("text-muted-foreground", x ? "text-xs" : "text-sm"), children: "No upcoming events" })
|
|
3461
3473
|
] })
|
|
3462
3474
|
}
|
|
3463
3475
|
)
|
|
3464
|
-
] }) : /* @__PURE__ */ n("div", { className:
|
|
3476
|
+
] }) : /* @__PURE__ */ n("div", { className: h("rounded-lg border bg-card overflow-hidden", l), children: [
|
|
3465
3477
|
c && /* @__PURE__ */ n(
|
|
3466
3478
|
"div",
|
|
3467
3479
|
{
|
|
3468
|
-
className:
|
|
3480
|
+
className: h(
|
|
3469
3481
|
"border-b px-4 flex items-center justify-between",
|
|
3470
3482
|
x ? "py-2" : "py-3"
|
|
3471
3483
|
),
|
|
3472
3484
|
children: [
|
|
3473
3485
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
3474
|
-
/* @__PURE__ */ e("h2", { className:
|
|
3486
|
+
/* @__PURE__ */ e("h2", { className: h("font-semibold", x ? "text-sm" : "text-base"), children: f }),
|
|
3475
3487
|
/* @__PURE__ */ e(
|
|
3476
3488
|
"span",
|
|
3477
3489
|
{
|
|
3478
|
-
className:
|
|
3490
|
+
className: h(
|
|
3479
3491
|
"text-muted-foreground bg-muted rounded-full px-2",
|
|
3480
3492
|
x ? "text-[10px] py-0" : "text-xs py-0.5"
|
|
3481
3493
|
),
|
|
3482
|
-
children:
|
|
3494
|
+
children: z
|
|
3483
3495
|
}
|
|
3484
3496
|
)
|
|
3485
3497
|
] }),
|
|
3486
|
-
|
|
3498
|
+
i && /* @__PURE__ */ n(
|
|
3487
3499
|
"button",
|
|
3488
3500
|
{
|
|
3489
3501
|
type: "button",
|
|
3490
|
-
onClick: () =>
|
|
3491
|
-
className:
|
|
3502
|
+
onClick: () => i(),
|
|
3503
|
+
className: h(
|
|
3492
3504
|
"text-primary hover:underline flex items-center gap-0.5",
|
|
3493
3505
|
x ? "text-xs" : "text-sm"
|
|
3494
3506
|
),
|
|
@@ -3504,39 +3516,39 @@ function nn({
|
|
|
3504
3516
|
/* @__PURE__ */ e(
|
|
3505
3517
|
"div",
|
|
3506
3518
|
{
|
|
3507
|
-
className:
|
|
3519
|
+
className: h(
|
|
3508
3520
|
"divide-y overflow-auto",
|
|
3509
3521
|
x ? "p-2 max-h-[280px]" : "p-3 max-h-[400px]"
|
|
3510
3522
|
),
|
|
3511
|
-
children: D.map((
|
|
3512
|
-
|
|
3523
|
+
children: D.map((T) => /* @__PURE__ */ e(
|
|
3524
|
+
$r,
|
|
3513
3525
|
{
|
|
3514
|
-
group:
|
|
3526
|
+
group: T,
|
|
3515
3527
|
onEventClick: s,
|
|
3516
|
-
onViewMore:
|
|
3528
|
+
onViewMore: i ? (w) => i(w) : void 0,
|
|
3517
3529
|
compact: x
|
|
3518
3530
|
},
|
|
3519
|
-
|
|
3531
|
+
T.dateKey
|
|
3520
3532
|
))
|
|
3521
3533
|
}
|
|
3522
3534
|
)
|
|
3523
3535
|
] });
|
|
3524
3536
|
}
|
|
3525
3537
|
export {
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3538
|
+
nn as A,
|
|
3539
|
+
Jr as B,
|
|
3540
|
+
Yr as C,
|
|
3541
|
+
Zr as D,
|
|
3542
|
+
Gr as E,
|
|
3543
|
+
Kr as I,
|
|
3544
|
+
tn as S,
|
|
3545
|
+
ue as T,
|
|
3546
|
+
rn as U,
|
|
3547
|
+
Xr as V,
|
|
3548
|
+
Qr as W,
|
|
3549
|
+
Kt as Y,
|
|
3550
|
+
on as a,
|
|
3551
|
+
en as b,
|
|
3552
|
+
qr as c
|
|
3541
3553
|
};
|
|
3542
|
-
//# sourceMappingURL=agenda-widget-
|
|
3554
|
+
//# sourceMappingURL=agenda-widget-DhCPt2vI.js.map
|