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