@innosolutions/inno-calendar 1.0.52 → 1.0.54

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