@innosolutions/inno-calendar 1.0.35 → 1.0.38

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 (55) hide show
  1. package/AGENT.md +36 -1
  2. package/dist/agenda-widget-BsRtRyZ3.cjs +2 -0
  3. package/dist/agenda-widget-BsRtRyZ3.cjs.map +1 -0
  4. package/dist/{agenda-widget-CyRPG-1p.js → agenda-widget-CNUXKiQT.js} +723 -745
  5. package/dist/agenda-widget-CNUXKiQT.js.map +1 -0
  6. package/dist/components/event/event-card.d.ts +16 -1
  7. package/dist/components/event/event-card.d.ts.map +1 -1
  8. package/dist/components/event/event-page-transition.d.ts +32 -0
  9. package/dist/components/event/event-page-transition.d.ts.map +1 -0
  10. package/dist/components/index.cjs +1 -1
  11. package/dist/components/index.d.ts +1 -1
  12. package/dist/components/index.d.ts.map +1 -1
  13. package/dist/components/index.mjs +27 -26
  14. package/dist/components/inno-calendar.d.ts.map +1 -1
  15. package/dist/components/primitives/multi-day-banner.d.ts.map +1 -1
  16. package/dist/components/views/day-events-expansion.d.ts +51 -0
  17. package/dist/components/views/day-events-expansion.d.ts.map +1 -0
  18. package/dist/components/views/index.d.ts +1 -0
  19. package/dist/components/views/index.d.ts.map +1 -1
  20. package/dist/components/views/month-view.d.ts +14 -3
  21. package/dist/components/views/month-view.d.ts.map +1 -1
  22. package/dist/components/views/timeline-view.d.ts.map +1 -1
  23. package/dist/core/index.cjs +1 -1
  24. package/dist/core/index.mjs +139 -136
  25. package/dist/core/utils/date-utils.d.ts +31 -1
  26. package/dist/core/utils/date-utils.d.ts.map +1 -1
  27. package/dist/core/utils/event-utils.d.ts +40 -0
  28. package/dist/core/utils/event-utils.d.ts.map +1 -1
  29. package/dist/core/utils/position-utils.d.ts +5 -1
  30. package/dist/core/utils/position-utils.d.ts.map +1 -1
  31. package/dist/index.cjs +1 -1
  32. package/dist/index.mjs +190 -186
  33. package/dist/presets/index.cjs +1 -1
  34. package/dist/presets/index.mjs +1 -1
  35. package/dist/styles/index.css +1 -1
  36. package/dist/{tailwind-calendar-BaJAw6io.cjs → tailwind-calendar-BqhSHRk0.cjs} +2 -2
  37. package/dist/{tailwind-calendar-BaJAw6io.cjs.map → tailwind-calendar-BqhSHRk0.cjs.map} +1 -1
  38. package/dist/{tailwind-calendar-D-8ALvNh.js → tailwind-calendar-BvWm9ry9.js} +16 -16
  39. package/dist/{tailwind-calendar-D-8ALvNh.js.map → tailwind-calendar-BvWm9ry9.js.map} +1 -1
  40. package/dist/utils.cjs +1 -1
  41. package/dist/utils.cjs.map +1 -1
  42. package/dist/utils.mjs +380 -335
  43. package/dist/utils.mjs.map +1 -1
  44. package/dist/week-view-BGthazCB.js +3015 -0
  45. package/dist/week-view-BGthazCB.js.map +1 -0
  46. package/dist/week-view-DOvr2VIq.cjs +11 -0
  47. package/dist/week-view-DOvr2VIq.cjs.map +1 -0
  48. package/package.json +1 -1
  49. package/dist/agenda-widget-CuQxfYVI.cjs +0 -2
  50. package/dist/agenda-widget-CuQxfYVI.cjs.map +0 -1
  51. package/dist/agenda-widget-CyRPG-1p.js.map +0 -1
  52. package/dist/week-view-5nw-Hvod.js +0 -2754
  53. package/dist/week-view-5nw-Hvod.js.map +0 -1
  54. package/dist/week-view-C0iWG7_6.cjs +0 -11
  55. package/dist/week-view-C0iWG7_6.cjs.map +0 -1
@@ -0,0 +1,3015 @@
1
+ import { jsx as e, jsxs as r, Fragment as ct } from "react/jsx-runtime";
2
+ import * as Z from "react";
3
+ import { useState as X, useCallback as W, useRef as ee, forwardRef as Ae, createElement as ze, useMemo as V, useLayoutEffect as Be, useEffect as Le } from "react";
4
+ import { c as s, a as ut } from "./index-DtaLkIY8.js";
5
+ import * as F from "@radix-ui/react-dropdown-menu";
6
+ import { formatEventTimeDisplay as J, getEventsCountInView as mt, getRangeText as ht, groupEventsByDate as pt, isToday as oe, detectAllDayEvent as Ce, isSameDay as se, getEventsForDay as Ie, separateEventsByDuration as Ze, calculateOverlappingPositions as Qe, getVisibleHoursArray as et, isWorkingHour as tt, formatHourLabel as ke, generateMonthGrid as ft, getWeekDays as gt, startOfWeek as xt } from "./utils.mjs";
7
+ import { a as $e, b as He } from "./slot-selection-context-D2eu2o-7.js";
8
+ import * as me from "@radix-ui/react-popover";
9
+ import * as ge from "@radix-ui/react-tooltip";
10
+ const ae = me.Root, ie = me.Trigger, un = me.Anchor, ne = Z.forwardRef(({ className: t, align: n = "center", sideOffset: o = 4, ...a }, l) => /* @__PURE__ */ e(me.Portal, { children: /* @__PURE__ */ e(
11
+ me.Content,
12
+ {
13
+ ref: l,
14
+ align: n,
15
+ sideOffset: o,
16
+ className: s(
17
+ "z-50 w-72 rounded-xl border bg-white text-popover-foreground outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
18
+ t
19
+ ),
20
+ ...a
21
+ }
22
+ ) }));
23
+ ne.displayName = me.Content.displayName;
24
+ const mn = ge.Provider, de = ge.Root, ce = ge.Trigger, re = Z.forwardRef(({ className: t, sideOffset: n = 4, ...o }, a) => /* @__PURE__ */ e(
25
+ ge.Content,
26
+ {
27
+ ref: a,
28
+ sideOffset: n,
29
+ className: s(
30
+ "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
31
+ t
32
+ ),
33
+ ...o
34
+ }
35
+ ));
36
+ re.displayName = ge.Content.displayName;
37
+ function xe(t) {
38
+ return {
39
+ blue: {
40
+ bg: "bg-blue-50 dark:bg-blue-950/30",
41
+ text: "text-blue-700 dark:text-blue-300",
42
+ dot: "bg-blue-500",
43
+ dotFill: "fill-blue-600 dark:fill-blue-500",
44
+ border: "border-blue-400 dark:border-blue-600",
45
+ accentBorder: "border-l-blue-500 dark:border-l-blue-400"
46
+ },
47
+ green: {
48
+ bg: "bg-green-50 dark:bg-green-950/30",
49
+ text: "text-green-700 dark:text-green-300",
50
+ dot: "bg-green-500",
51
+ dotFill: "fill-green-600 dark:fill-green-500",
52
+ border: "border-green-400 dark:border-green-600",
53
+ accentBorder: "border-l-green-500 dark:border-l-green-400"
54
+ },
55
+ red: {
56
+ bg: "bg-red-50 dark:bg-red-950/30",
57
+ text: "text-red-700 dark:text-red-300",
58
+ dot: "bg-red-500",
59
+ dotFill: "fill-red-600 dark:fill-red-500",
60
+ border: "border-red-400 dark:border-red-600",
61
+ accentBorder: "border-l-red-500 dark:border-l-red-400"
62
+ },
63
+ yellow: {
64
+ bg: "bg-yellow-50 dark:bg-yellow-950/30",
65
+ text: "text-yellow-700 dark:text-yellow-300",
66
+ dot: "bg-yellow-500",
67
+ dotFill: "fill-yellow-600 dark:fill-yellow-500",
68
+ border: "border-yellow-400 dark:border-yellow-600",
69
+ accentBorder: "border-l-yellow-500 dark:border-l-yellow-400"
70
+ },
71
+ purple: {
72
+ bg: "bg-purple-50 dark:bg-purple-950/30",
73
+ text: "text-purple-700 dark:text-purple-300",
74
+ dot: "bg-purple-500",
75
+ dotFill: "fill-purple-600 dark:fill-purple-500",
76
+ border: "border-purple-400 dark:border-purple-600",
77
+ accentBorder: "border-l-purple-500 dark:border-l-purple-400"
78
+ },
79
+ orange: {
80
+ bg: "bg-orange-50 dark:bg-orange-950/30",
81
+ text: "text-orange-700 dark:text-orange-300",
82
+ dot: "bg-orange-500",
83
+ dotFill: "fill-orange-600 dark:fill-orange-500",
84
+ border: "border-orange-400 dark:border-orange-600",
85
+ accentBorder: "border-l-orange-500 dark:border-l-orange-400"
86
+ },
87
+ pink: {
88
+ bg: "bg-pink-50 dark:bg-pink-950/30",
89
+ text: "text-pink-700 dark:text-pink-300",
90
+ dot: "bg-pink-500",
91
+ dotFill: "fill-pink-600 dark:fill-pink-500",
92
+ border: "border-pink-400 dark:border-pink-600",
93
+ accentBorder: "border-l-pink-500 dark:border-l-pink-400"
94
+ },
95
+ teal: {
96
+ bg: "bg-teal-50 dark:bg-teal-950/30",
97
+ text: "text-teal-700 dark:text-teal-300",
98
+ dot: "bg-teal-500",
99
+ dotFill: "fill-teal-600 dark:fill-teal-500",
100
+ border: "border-teal-400 dark:border-teal-600",
101
+ accentBorder: "border-l-teal-500 dark:border-l-teal-400"
102
+ },
103
+ gray: {
104
+ bg: "bg-gray-50 dark:bg-gray-950/30",
105
+ text: "text-gray-700 dark:text-gray-300",
106
+ dot: "bg-gray-500",
107
+ dotFill: "fill-gray-600 dark:fill-gray-500",
108
+ border: "border-gray-400 dark:border-gray-600",
109
+ accentBorder: "border-l-gray-500 dark:border-l-gray-400"
110
+ },
111
+ indigo: {
112
+ bg: "bg-indigo-50 dark:bg-indigo-950/30",
113
+ text: "text-indigo-700 dark:text-indigo-300",
114
+ dot: "bg-indigo-500",
115
+ dotFill: "fill-indigo-600 dark:fill-indigo-500",
116
+ border: "border-indigo-400 dark:border-indigo-600",
117
+ accentBorder: "border-l-indigo-500 dark:border-l-indigo-400"
118
+ }
119
+ }[t ?? "blue"];
120
+ }
121
+ function Pe(t) {
122
+ const n = new Date(t);
123
+ return n.setHours(0, 0, 0, 0), n;
124
+ }
125
+ function De({
126
+ event: t,
127
+ variant: n = "full",
128
+ badgeVariant: o = "colored",
129
+ onClick: a,
130
+ className: l,
131
+ showTime: b = !0,
132
+ showDescription: u = !1,
133
+ showParticipants: h = !1,
134
+ style: C,
135
+ disablePopover: f = !1,
136
+ renderPopover: y,
137
+ enableDrag: S = !1,
138
+ enablePageTransition: c = !1,
139
+ pageTransitionDuration: x = 400
140
+ }) {
141
+ const d = xe(t.color), [w, A] = X(!1), [P, z] = X(!1), [L, R] = X(!1), [_, T] = X(null), M = ee(null), $ = $e(), k = t.endDate < Pe(/* @__PURE__ */ new Date()), B = t.isCanceled ?? !1, q = S && $ && !B && !k, p = t.data, g = p?.meetingTookPlace ?? t.meetingTookPlace ?? !1, E = B ? /* @__PURE__ */ e(yt, { className: "h-3 w-3 text-zinc-800 dark:text-zinc-200" }) : g ? /* @__PURE__ */ e(bt, { className: s("h-3 w-3", d.text) }) : null, H = t.scheduleTypeName || p?.scheduleTypeName || p?.typeName, O = p?.productName, v = p?.nrParticipant, i = p?.siteName, m = p?.siteCity, N = [i, m].filter(Boolean).join(", "), I = W(() => {
142
+ if (!P) {
143
+ if (f && a) {
144
+ a(t);
145
+ return;
146
+ }
147
+ if (c && M.current) {
148
+ const U = M.current.getBoundingClientRect();
149
+ T(U), R(!0);
150
+ } else f || A(!0);
151
+ }
152
+ }, [P, f, a, t, c]);
153
+ W(() => {
154
+ R(!1), T(null), f || A(!0);
155
+ }, [f]);
156
+ const D = W(() => {
157
+ A(!1);
158
+ }, []), Y = W(
159
+ (U) => {
160
+ q && (U.dataTransfer.effectAllowed = "move", U.dataTransfer.setData("text/plain", t.id), z(!0), $?.startDrag?.(t));
161
+ },
162
+ [q, t, $]
163
+ ), j = W(() => {
164
+ z(!1), $?.isDragging && $.endDrag?.();
165
+ }, [$]);
166
+ if (n === "dot") {
167
+ const U = /* @__PURE__ */ e(
168
+ "button",
169
+ {
170
+ type: "button",
171
+ onClick: I,
172
+ className: s(
173
+ "size-2 rounded-full cursor-pointer transition-opacity",
174
+ k ? "bg-gray-400" : d.dot,
175
+ t.isCanceled && "opacity-50",
176
+ l
177
+ ),
178
+ style: C,
179
+ "aria-label": t.title
180
+ }
181
+ );
182
+ return f ? /* @__PURE__ */ r(de, { children: [
183
+ /* @__PURE__ */ e(ce, { asChild: !0, children: U }),
184
+ /* @__PURE__ */ e(re, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
185
+ /* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
186
+ /* @__PURE__ */ e("div", { className: "text-xs opacity-80", children: J(t) })
187
+ ] }) })
188
+ ] }) : /* @__PURE__ */ r(ae, { open: w, onOpenChange: A, children: [
189
+ /* @__PURE__ */ e(ie, { asChild: !0, children: /* @__PURE__ */ r(de, { children: [
190
+ /* @__PURE__ */ e(ce, { asChild: !0, children: U }),
191
+ /* @__PURE__ */ e(re, { children: /* @__PURE__ */ e("div", { className: "font-medium", children: t.title }) })
192
+ ] }) }),
193
+ /* @__PURE__ */ e(ne, { className: "w-80", children: y ? y({ event: t, onClose: D }) : /* @__PURE__ */ e(fe, { event: t, onClose: D }) })
194
+ ] });
195
+ }
196
+ if (n === "compact") {
197
+ const U = /* @__PURE__ */ r(
198
+ "div",
199
+ {
200
+ role: "button",
201
+ tabIndex: 0,
202
+ draggable: !!q,
203
+ onDragStart: Y,
204
+ onDragEnd: j,
205
+ onClick: f ? I : void 0,
206
+ onKeyDown: (K) => {
207
+ (K.key === "Enter" || K.key === " ") && (K.preventDefault(), I());
208
+ },
209
+ className: s(
210
+ "group flex w-full relative items-center shadow-[0_0_1px_rgba(0,0,0,0.3)] gap-0 rounded px-1.5 py-1 text-left text-xs transition-colors hover:opacity-80",
211
+ q ? "cursor-grab active:cursor-grabbing" : "cursor-pointer",
212
+ P && "opacity-50",
213
+ // Cancelled events get gray background with strikethrough
214
+ B || // Past events get neutral zinc styling
215
+ k ? "bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 line-through" : [
216
+ o === "colored" && [d.bg, d.text],
217
+ o === "mixed" && [d.bg, d.text],
218
+ o === "dot" && "bg-muted/50"
219
+ ],
220
+ l
221
+ ),
222
+ style: C,
223
+ children: [
224
+ ["dot", "mixed"].includes(o) && !k && /* @__PURE__ */ e(
225
+ "svg",
226
+ {
227
+ width: "8",
228
+ height: "8",
229
+ viewBox: "0 0 8 8",
230
+ className: "event-dot absolute -top-1 -left-1 shrink-0",
231
+ "aria-hidden": "true",
232
+ focusable: "false",
233
+ children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className: d.dotFill })
234
+ }
235
+ ),
236
+ /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 overflow-hidden", children: /* @__PURE__ */ r("span", { className: "", children: [
237
+ /* @__PURE__ */ e(
238
+ "span",
239
+ {
240
+ className: "relative block overflow-hidden whitespace-nowrap text-xs leading-tight",
241
+ style: {
242
+ maskImage: "linear-gradient(to right, transparent 0, black 8px, black calc(100% - 8px), transparent 100%)",
243
+ WebkitMaskImage: "linear-gradient(to right, transparent 0, black 8px, black calc(100% - 8px), transparent 100%)"
244
+ },
245
+ children: /* @__PURE__ */ r("span", { className: "inline-flex event-marquee", children: [
246
+ /* @__PURE__ */ e("span", { className: "shrink-0 px-1", children: t.title }),
247
+ /* @__PURE__ */ e("span", { className: "shrink-0 px-1", children: "•" }),
248
+ /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "shrink-0 px-1", children: t.title }),
249
+ /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "shrink-0 px-1", children: "•" })
250
+ ] })
251
+ }
252
+ ),
253
+ /* @__PURE__ */ e(
254
+ "div",
255
+ {
256
+ className: s(
257
+ "w-fit mt-0.5 text-[10px] px-1 py-0.5 border border-dashed rounded-full font-medium",
258
+ k ? "border-zinc-400 dark:border-zinc-600" : d.border
259
+ ),
260
+ children: J(t)
261
+ }
262
+ )
263
+ ] }) }),
264
+ /* @__PURE__ */ e("div", { className: "flex gap-0.5", children: E })
265
+ ]
266
+ }
267
+ );
268
+ return f ? /* @__PURE__ */ r(de, { children: [
269
+ /* @__PURE__ */ e(ce, { asChild: !0, children: U }),
270
+ /* @__PURE__ */ e(re, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
271
+ /* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
272
+ /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: J(t) })
273
+ ] }) })
274
+ ] }) : /* @__PURE__ */ r(ae, { open: w, onOpenChange: A, children: [
275
+ /* @__PURE__ */ e(ie, { asChild: !0, children: U }),
276
+ /* @__PURE__ */ e(ne, { className: "w-80", children: y ? y({ event: t, onClose: D }) : /* @__PURE__ */ e(fe, { event: t, onClose: D }) })
277
+ ] });
278
+ }
279
+ const G = /* @__PURE__ */ r(
280
+ "button",
281
+ {
282
+ type: "button",
283
+ onClick: I,
284
+ className: s(
285
+ "group relative flex w-full flex-col gap-1 rounded-md border-l-[3px] px-2 py-1.5 text-left transition-all",
286
+ "shadow-[0_1px_3px_rgba(0,0,0,0.08)] hover:shadow-[0_2px_6px_rgba(0,0,0,0.12)]",
287
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
288
+ // Cancelled events get gray background with strikethrough
289
+ B || // Past events get neutral zinc styling with strikethrough
290
+ k ? "bg-zinc-100 dark:bg-zinc-800 border-l-zinc-400 dark:border-l-zinc-600 text-zinc-500 dark:text-zinc-400 line-through" : [
291
+ o === "colored" && [
292
+ d.bg,
293
+ d.accentBorder,
294
+ d.text
295
+ ],
296
+ o === "mixed" && [
297
+ d.bg,
298
+ d.accentBorder,
299
+ d.text
300
+ ],
301
+ o === "dot" && "bg-muted/50 border-l-neutral-400 dark:border-l-neutral-600"
302
+ ],
303
+ l
304
+ ),
305
+ style: C,
306
+ children: [
307
+ /* @__PURE__ */ r("div", { className: "flex items-start justify-between gap-1", children: [
308
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 min-w-0", children: [
309
+ ["dot", "mixed"].includes(o) && !k && !B && /* @__PURE__ */ e(
310
+ "svg",
311
+ {
312
+ width: "8",
313
+ height: "8",
314
+ viewBox: "0 0 8 8",
315
+ className: "event-dot shrink-0",
316
+ "aria-hidden": "true",
317
+ focusable: "false",
318
+ children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className: d.dotFill })
319
+ }
320
+ ),
321
+ /* @__PURE__ */ r(
322
+ "span",
323
+ {
324
+ className: s(
325
+ "text-sm font-medium truncate",
326
+ !k && !B && o !== "dot" && d.text,
327
+ B && "line-through"
328
+ ),
329
+ children: [
330
+ t.title,
331
+ H && /* @__PURE__ */ r("span", { className: "font-normal opacity-75", children: [
332
+ " ",
333
+ "- ",
334
+ H
335
+ ] })
336
+ ]
337
+ }
338
+ )
339
+ ] }),
340
+ E
341
+ ] }),
342
+ O && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children: O }),
343
+ v != null && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
344
+ /* @__PURE__ */ e(We, { className: "h-3 w-3 shrink-0" }),
345
+ /* @__PURE__ */ r("span", { children: [
346
+ v,
347
+ " participant",
348
+ v !== 1 ? "s" : ""
349
+ ] })
350
+ ] }),
351
+ b && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
352
+ /* @__PURE__ */ e(je, { className: "h-3 w-3 shrink-0" }),
353
+ /* @__PURE__ */ e("span", { children: J(t) })
354
+ ] }),
355
+ N && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
356
+ /* @__PURE__ */ e(nt, { className: "h-3 w-3 shrink-0" }),
357
+ /* @__PURE__ */ e("span", { className: "truncate", children: N })
358
+ ] }),
359
+ u && t.description && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground line-clamp-2", children: t.description }),
360
+ h && t.participants && t.participants.length > 0 && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
361
+ /* @__PURE__ */ e(We, { className: "h-3 w-3 shrink-0" }),
362
+ /* @__PURE__ */ e("span", { className: "truncate", children: t.participants.map((U) => U.name).join(", ") })
363
+ ] })
364
+ ]
365
+ }
366
+ );
367
+ return f ? /* @__PURE__ */ r(de, { children: [
368
+ /* @__PURE__ */ e(ce, { asChild: !0, children: G }),
369
+ /* @__PURE__ */ e(re, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
370
+ /* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
371
+ /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: J(t) })
372
+ ] }) })
373
+ ] }) : /* @__PURE__ */ r(ae, { open: w, onOpenChange: A, children: [
374
+ /* @__PURE__ */ e(ie, { asChild: !0, children: G }),
375
+ /* @__PURE__ */ e(ne, { className: "w-80", children: y ? y({ event: t, onClose: D }) : /* @__PURE__ */ e(fe, { event: t, onClose: D }) })
376
+ ] });
377
+ }
378
+ function je({ className: t }) {
379
+ return /* @__PURE__ */ r(
380
+ "svg",
381
+ {
382
+ xmlns: "http://www.w3.org/2000/svg",
383
+ viewBox: "0 0 24 24",
384
+ fill: "none",
385
+ stroke: "currentColor",
386
+ strokeWidth: "2",
387
+ strokeLinecap: "round",
388
+ strokeLinejoin: "round",
389
+ className: t,
390
+ children: [
391
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
392
+ /* @__PURE__ */ e("polyline", { points: "12 6 12 12 16 14" })
393
+ ]
394
+ }
395
+ );
396
+ }
397
+ function bt({ className: t }) {
398
+ return /* @__PURE__ */ e(
399
+ "svg",
400
+ {
401
+ xmlns: "http://www.w3.org/2000/svg",
402
+ viewBox: "0 0 24 24",
403
+ fill: "none",
404
+ stroke: "currentColor",
405
+ strokeWidth: "2",
406
+ strokeLinecap: "round",
407
+ strokeLinejoin: "round",
408
+ className: t,
409
+ children: /* @__PURE__ */ e("path", { d: "M20 6 9 17l-5-5" })
410
+ }
411
+ );
412
+ }
413
+ function yt({ className: t }) {
414
+ return /* @__PURE__ */ r(
415
+ "svg",
416
+ {
417
+ xmlns: "http://www.w3.org/2000/svg",
418
+ viewBox: "0 0 24 24",
419
+ fill: "none",
420
+ stroke: "currentColor",
421
+ strokeWidth: "2",
422
+ strokeLinecap: "round",
423
+ strokeLinejoin: "round",
424
+ className: t,
425
+ children: [
426
+ /* @__PURE__ */ e("path", { d: "M18 6 6 18" }),
427
+ /* @__PURE__ */ e("path", { d: "m6 6 12 12" })
428
+ ]
429
+ }
430
+ );
431
+ }
432
+ function We({ className: t }) {
433
+ return /* @__PURE__ */ r(
434
+ "svg",
435
+ {
436
+ xmlns: "http://www.w3.org/2000/svg",
437
+ viewBox: "0 0 24 24",
438
+ fill: "none",
439
+ stroke: "currentColor",
440
+ strokeWidth: "2",
441
+ strokeLinecap: "round",
442
+ strokeLinejoin: "round",
443
+ className: t,
444
+ children: [
445
+ /* @__PURE__ */ e("path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }),
446
+ /* @__PURE__ */ e("circle", { cx: "9", cy: "7", r: "4" }),
447
+ /* @__PURE__ */ e("path", { d: "M22 21v-2a4 4 0 0 0-3-3.87" }),
448
+ /* @__PURE__ */ e("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
449
+ ]
450
+ }
451
+ );
452
+ }
453
+ function nt({ className: t }) {
454
+ return /* @__PURE__ */ r(
455
+ "svg",
456
+ {
457
+ xmlns: "http://www.w3.org/2000/svg",
458
+ viewBox: "0 0 24 24",
459
+ fill: "none",
460
+ stroke: "currentColor",
461
+ strokeWidth: "2",
462
+ strokeLinecap: "round",
463
+ strokeLinejoin: "round",
464
+ className: t,
465
+ children: [
466
+ /* @__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" }),
467
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "10", r: "3" })
468
+ ]
469
+ }
470
+ );
471
+ }
472
+ function fe({
473
+ event: t,
474
+ onClose: n
475
+ }) {
476
+ const o = xe(t.color), a = t.isCanceled ?? !1;
477
+ return /* @__PURE__ */ r("div", { className: "space-y-3", children: [
478
+ /* @__PURE__ */ r("div", { className: "flex items-start gap-3", children: [
479
+ /* @__PURE__ */ e("div", { className: s("size-4 rounded shrink-0 mt-0.5", o.dot) }),
480
+ /* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
481
+ /* @__PURE__ */ e(
482
+ "h3",
483
+ {
484
+ className: s(
485
+ "font-semibold text-lg",
486
+ a && "line-through opacity-50"
487
+ ),
488
+ children: t.title
489
+ }
490
+ ),
491
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-sm text-muted-foreground mt-1", children: [
492
+ /* @__PURE__ */ e(je, { className: "h-4 w-4 shrink-0" }),
493
+ /* @__PURE__ */ e("span", { className: "tabular-nums", children: J(t) })
494
+ ] })
495
+ ] })
496
+ ] }),
497
+ t.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t.description }),
498
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1.5", children: [
499
+ t.isAllDay && /* @__PURE__ */ e("span", { className: "text-xs bg-muted px-2 py-0.5 rounded-full font-medium", children: "All day" }),
500
+ t.isRecurring && /* @__PURE__ */ e("span", { className: "text-xs bg-muted px-2 py-0.5 rounded-full font-medium", children: "Recurring" }),
501
+ a && /* @__PURE__ */ e("span", { className: "text-xs bg-red-100 dark:bg-red-950/30 text-red-700 dark:text-red-300 px-2 py-0.5 rounded-full font-medium", children: "Canceled" })
502
+ ] }),
503
+ /* @__PURE__ */ e("div", { className: "flex justify-end pt-2 border-t", children: /* @__PURE__ */ e(
504
+ "button",
505
+ {
506
+ type: "button",
507
+ onClick: n,
508
+ className: "text-xs text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md hover:bg-muted transition-colors",
509
+ children: "Close"
510
+ }
511
+ ) })
512
+ ] });
513
+ }
514
+ function rt({
515
+ event: t,
516
+ position: n,
517
+ hourHeight: o = 96,
518
+ badgeVariant: a = "colored",
519
+ onClick: l,
520
+ className: b,
521
+ disablePopover: u = !1,
522
+ renderPopover: h,
523
+ enableDrag: C = !0
524
+ }) {
525
+ const f = xe(t.color), [y, S] = X(!1), [c, x] = X(!1), d = $e(), w = (t.endDate.getTime() - t.startDate.getTime()) / (1e3 * 60), A = w / 60 * o - 8, P = t.endDate < Pe(/* @__PURE__ */ new Date()), z = t.isCanceled ?? !1, L = C && d && !z && !P, R = w < 35, _ = w > 25, T = w >= 45, M = t.data, $ = t.scheduleTypeName || M?.scheduleTypeName || M?.typeName, k = M?.productName, B = M?.nrParticipant, q = M?.siteName, p = M?.siteCity, g = [q, p].filter(Boolean).join(", "), E = a === "dot", H = W(() => {
526
+ c || (u && l ? l(t) : u || S(!0));
527
+ }, [c, u, l, t]), O = W(() => {
528
+ S(!1);
529
+ }, []), v = W(
530
+ (D) => {
531
+ if (!L) return;
532
+ D.dataTransfer.effectAllowed = "move", D.dataTransfer.setData("text/plain", t.id);
533
+ const Y = D.currentTarget, j = Y.getBoundingClientRect();
534
+ D.dataTransfer.setDragImage(
535
+ Y,
536
+ D.clientX - j.left,
537
+ D.clientY - j.top
538
+ ), x(!0), d?.startDrag?.(t);
539
+ },
540
+ [L, t, d]
541
+ ), i = W(() => {
542
+ x(!1), d?.isDragging && d.endDrag?.();
543
+ }, [d]), m = W(
544
+ (D) => {
545
+ (D.key === "Enter" || D.key === " ") && (D.preventDefault(), H());
546
+ },
547
+ [H]
548
+ ), N = /* @__PURE__ */ r(
549
+ "div",
550
+ {
551
+ role: "button",
552
+ tabIndex: 0,
553
+ draggable: !!L,
554
+ onDragStart: v,
555
+ onDragEnd: i,
556
+ onKeyDown: m,
557
+ onClick: c ? void 0 : H,
558
+ className: s(
559
+ "group flex w-full select-none flex-col gap-0.5 overflow-hidden rounded-md border-l-[3px] px-2 py-1.5 text-xs text-left",
560
+ "shadow-[0_1px_3px_rgba(0,0,0,0.08)] hover:shadow-[0_2px_6px_rgba(0,0,0,0.12)]",
561
+ "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
562
+ "transition-all",
563
+ L ? "cursor-grab active:cursor-grabbing" : "cursor-pointer",
564
+ c && "opacity-50",
565
+ // Cancelled events get gray background with strikethrough
566
+ z || // Past events get neutral zinc styling with strikethrough
567
+ P ? "bg-zinc-100 dark:bg-zinc-800 border-l-zinc-400 dark:border-l-zinc-600 text-zinc-500 dark:text-zinc-400 line-through" : [
568
+ // Colored/mixed variants
569
+ !E && [
570
+ f.bg,
571
+ f.accentBorder,
572
+ f.text
573
+ ],
574
+ // Dot variant - neutral background
575
+ E && "bg-neutral-50 dark:bg-neutral-900 border-l-neutral-400 dark:border-l-neutral-600"
576
+ ],
577
+ // Short events center content
578
+ R && "py-0 justify-center",
579
+ b
580
+ ),
581
+ style: { height: `${Math.max(A, 20)}px` },
582
+ children: [
583
+ /* @__PURE__ */ r("div", { className: "flex items-start gap-1.5 min-w-0", children: [
584
+ ["mixed", "dot"].includes(a) && !P && !z && /* @__PURE__ */ e(
585
+ "svg",
586
+ {
587
+ width: "8",
588
+ height: "8",
589
+ viewBox: "0 0 8 8",
590
+ className: "event-dot shrink-0",
591
+ "aria-hidden": "true",
592
+ focusable: "false",
593
+ children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className: f.dotFill })
594
+ }
595
+ ),
596
+ /* @__PURE__ */ e("div", { className: "flex-1 min-w-0 overflow-hidden", children: /* @__PURE__ */ r(
597
+ "p",
598
+ {
599
+ className: s(
600
+ "font-semibold truncate leading-tight",
601
+ !P && !z && E && "text-foreground"
602
+ ),
603
+ children: [
604
+ t.title,
605
+ $ && /* @__PURE__ */ r("span", { className: "font-normal opacity-75", children: [
606
+ " ",
607
+ "- ",
608
+ $
609
+ ] })
610
+ ]
611
+ }
612
+ ) })
613
+ ] }),
614
+ T && k && /* @__PURE__ */ e(
615
+ "p",
616
+ {
617
+ className: s(
618
+ "text-[11px] truncate leading-tight",
619
+ E ? "text-muted-foreground" : "opacity-80"
620
+ ),
621
+ children: k
622
+ }
623
+ ),
624
+ T && B != null && /* @__PURE__ */ r(
625
+ "div",
626
+ {
627
+ className: s(
628
+ "flex items-center gap-1 text-[11px] leading-tight",
629
+ E ? "text-muted-foreground" : "opacity-80"
630
+ ),
631
+ children: [
632
+ /* @__PURE__ */ e(We, { className: "h-3 w-3 shrink-0" }),
633
+ /* @__PURE__ */ r("span", { children: [
634
+ B,
635
+ " participant",
636
+ B !== 1 ? "s" : ""
637
+ ] })
638
+ ]
639
+ }
640
+ ),
641
+ _ && /* @__PURE__ */ r(
642
+ "div",
643
+ {
644
+ className: s(
645
+ "flex items-center gap-1 text-[11px] tabular-nums leading-tight",
646
+ E ? "text-muted-foreground" : "opacity-90"
647
+ ),
648
+ children: [
649
+ /* @__PURE__ */ e(je, { className: "h-3 w-3 shrink-0" }),
650
+ /* @__PURE__ */ e("span", { children: J(t) })
651
+ ]
652
+ }
653
+ ),
654
+ T && g && /* @__PURE__ */ r(
655
+ "div",
656
+ {
657
+ className: s(
658
+ "flex items-center gap-1 text-[11px] truncate leading-tight",
659
+ E ? "text-muted-foreground" : "opacity-80"
660
+ ),
661
+ children: [
662
+ /* @__PURE__ */ e(nt, { className: "h-3 w-3 shrink-0" }),
663
+ /* @__PURE__ */ e("span", { className: "truncate", children: g })
664
+ ]
665
+ }
666
+ )
667
+ ]
668
+ }
669
+ ), I = /* @__PURE__ */ e(re, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
670
+ /* @__PURE__ */ r("div", { className: "font-medium", children: [
671
+ t.title,
672
+ $ && /* @__PURE__ */ r("span", { className: "font-normal opacity-75", children: [
673
+ " ",
674
+ "- ",
675
+ $
676
+ ] })
677
+ ] }),
678
+ k && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: k }),
679
+ B != null && /* @__PURE__ */ r("div", { className: "text-xs text-muted-foreground", children: [
680
+ B,
681
+ " participant",
682
+ B !== 1 ? "s" : ""
683
+ ] }),
684
+ /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: J(t) }),
685
+ g && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: g })
686
+ ] }) });
687
+ return u ? /* @__PURE__ */ e(
688
+ "div",
689
+ {
690
+ className: "absolute p-0.5",
691
+ style: {
692
+ top: `${n.top}px`,
693
+ left: `${n.left}%`,
694
+ width: n.minWidth ? `max(${n.minWidth}px, ${n.width}%)` : `${n.width}%`,
695
+ minWidth: n.minWidth ? `${n.minWidth}px` : void 0
696
+ },
697
+ children: /* @__PURE__ */ r(de, { children: [
698
+ /* @__PURE__ */ e(ce, { asChild: !0, children: N }),
699
+ I
700
+ ] })
701
+ }
702
+ ) : /* @__PURE__ */ e(
703
+ "div",
704
+ {
705
+ className: "absolute p-0.5",
706
+ style: {
707
+ top: `${n.top}px`,
708
+ left: `${n.left}%`,
709
+ width: n.minWidth ? `max(${n.minWidth}px, ${n.width}%)` : `${n.width}%`,
710
+ minWidth: n.minWidth ? `${n.minWidth}px` : void 0
711
+ },
712
+ children: /* @__PURE__ */ r(ae, { open: y, onOpenChange: S, children: [
713
+ /* @__PURE__ */ e(ie, { asChild: !0, children: N }),
714
+ /* @__PURE__ */ e(ne, { className: "w-80", children: h ? h({ event: t, onClose: O }) : /* @__PURE__ */ e(fe, { event: t, onClose: O }) })
715
+ ] })
716
+ }
717
+ );
718
+ }
719
+ function hn({
720
+ event: t,
721
+ spanDays: n,
722
+ isStart: o,
723
+ isEnd: a,
724
+ onClick: l,
725
+ className: b,
726
+ disablePopover: u = !1,
727
+ renderPopover: h
728
+ }) {
729
+ const C = xe(t.color), [f, y] = X(!1), S = t.endDate < Pe(/* @__PURE__ */ new Date()), c = t.isCanceled ?? !1, x = W(() => {
730
+ u && l ? l(t) : u || y(!0);
731
+ }, [u, l, t]), d = W(() => {
732
+ y(!1);
733
+ }, []), w = /* @__PURE__ */ e(
734
+ "button",
735
+ {
736
+ type: "button",
737
+ onClick: x,
738
+ className: s(
739
+ "flex h-5 items-center px-1.5 text-xs font-medium transition-opacity hover:opacity-80",
740
+ // Cancelled events get gray background with strikethrough
741
+ c || // Past events get neutral zinc styling with strikethrough
742
+ S ? "bg-zinc-200 dark:bg-zinc-700 text-zinc-500 dark:text-zinc-400 line-through" : [C.dot, "text-white"],
743
+ o && "rounded-l",
744
+ a && "rounded-r",
745
+ !o && "border-l-0",
746
+ !a && "border-r-0",
747
+ b
748
+ ),
749
+ style: { width: `${n * 100}%` },
750
+ children: o && /* @__PURE__ */ e("span", { className: "truncate", children: t.title })
751
+ }
752
+ ), A = /* @__PURE__ */ e(re, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
753
+ /* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
754
+ /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: J(t) })
755
+ ] }) });
756
+ return u ? /* @__PURE__ */ r(de, { children: [
757
+ /* @__PURE__ */ e(ce, { asChild: !0, children: w }),
758
+ A
759
+ ] }) : /* @__PURE__ */ r(ae, { open: f, onOpenChange: y, children: [
760
+ /* @__PURE__ */ e(ie, { asChild: !0, children: w }),
761
+ /* @__PURE__ */ e(ne, { className: "w-80", children: h ? h({ event: t, onClose: d }) : /* @__PURE__ */ e(fe, { event: t, onClose: d }) })
762
+ ] });
763
+ }
764
+ if (typeof window < "u" && !document.getElementById("inno-calendar-event-marquee-style")) {
765
+ const t = document.createElement("style");
766
+ t.id = "inno-calendar-event-marquee-style", t.innerHTML = `
767
+ @keyframes event-marquee {
768
+ 0% { transform: translateX(0); }
769
+ 100% { transform: translateX(-50%); }
770
+ }
771
+ .event-marquee {
772
+ animation: event-marquee 28s linear infinite;
773
+ will-change: transform;
774
+ }
775
+ `, document.head.appendChild(t);
776
+ }
777
+ const Fe = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, Ve = ut, ot = (t, n) => (o) => {
778
+ var a;
779
+ if (n?.variants == null) return Ve(t, o?.class, o?.className);
780
+ const { variants: l, defaultVariants: b } = n, u = Object.keys(l).map((f) => {
781
+ const y = o?.[f], S = b?.[f];
782
+ if (y === null) return null;
783
+ const c = Fe(y) || Fe(S);
784
+ return l[f][c];
785
+ }), h = o && Object.entries(o).reduce((f, y) => {
786
+ let [S, c] = y;
787
+ return c === void 0 || (f[S] = c), f;
788
+ }, {}), C = n == null || (a = n.compoundVariants) === null || a === void 0 ? void 0 : a.reduce((f, y) => {
789
+ let { class: S, className: c, ...x } = y;
790
+ return Object.entries(x).every((d) => {
791
+ let [w, A] = d;
792
+ return Array.isArray(A) ? A.includes({
793
+ ...b,
794
+ ...h
795
+ }[w]) : {
796
+ ...b,
797
+ ...h
798
+ }[w] === A;
799
+ }) ? [
800
+ ...f,
801
+ S,
802
+ c
803
+ ] : f;
804
+ }, []);
805
+ return Ve(t, u, C, o?.class, o?.className);
806
+ }, wt = ot(
807
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
808
+ {
809
+ variants: {
810
+ variant: {
811
+ default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
812
+ destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
813
+ outline: "border border-input active:!bg-zinc-100 hover:!bg-zinc-50 active:bg-white !bg-white hover:bg-accent hover:text-accent-foreground",
814
+ secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
815
+ ghost: "hover:bg-accent hover:text-accent-foreground",
816
+ link: "text-primary underline-offset-4 hover:underline"
817
+ },
818
+ size: {
819
+ default: "h-9 px-4 py-2",
820
+ sm: "h-8 rounded-md px-3 text-xs",
821
+ lg: "h-10 rounded-md px-8",
822
+ icon: "h-9 w-9"
823
+ }
824
+ },
825
+ defaultVariants: {
826
+ variant: "default",
827
+ size: "default"
828
+ }
829
+ }
830
+ ), ue = Ae(
831
+ ({ className: t, variant: n, size: o, loading: a, disabled: l, children: b, ...u }, h) => /* @__PURE__ */ r(
832
+ "button",
833
+ {
834
+ className: s(wt({ variant: n, size: o, className: t })),
835
+ ref: h,
836
+ disabled: l || a,
837
+ ...u,
838
+ children: [
839
+ a && /* @__PURE__ */ r(
840
+ "svg",
841
+ {
842
+ className: "animate-spin -ml-1 mr-2 size-4",
843
+ xmlns: "http://www.w3.org/2000/svg",
844
+ fill: "none",
845
+ viewBox: "0 0 24 24",
846
+ children: [
847
+ /* @__PURE__ */ e(
848
+ "circle",
849
+ {
850
+ className: "opacity-25",
851
+ cx: "12",
852
+ cy: "12",
853
+ r: "10",
854
+ stroke: "currentColor",
855
+ strokeWidth: "4"
856
+ }
857
+ ),
858
+ /* @__PURE__ */ e(
859
+ "path",
860
+ {
861
+ className: "opacity-75",
862
+ fill: "currentColor",
863
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
864
+ }
865
+ )
866
+ ]
867
+ }
868
+ ),
869
+ b
870
+ ]
871
+ }
872
+ )
873
+ );
874
+ ue.displayName = "Button";
875
+ const at = (...t) => t.filter((n, o, a) => !!n && n.trim() !== "" && a.indexOf(n) === o).join(" ").trim();
876
+ const vt = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
877
+ const Nt = (t) => t.replace(
878
+ /^([A-Z])|[\s-_]+(\w)/g,
879
+ (n, o, a) => a ? a.toUpperCase() : o.toLowerCase()
880
+ );
881
+ const Ge = (t) => {
882
+ const n = Nt(t);
883
+ return n.charAt(0).toUpperCase() + n.slice(1);
884
+ };
885
+ var kt = {
886
+ xmlns: "http://www.w3.org/2000/svg",
887
+ width: 24,
888
+ height: 24,
889
+ viewBox: "0 0 24 24",
890
+ fill: "none",
891
+ stroke: "currentColor",
892
+ strokeWidth: 2,
893
+ strokeLinecap: "round",
894
+ strokeLinejoin: "round"
895
+ };
896
+ const Dt = (t) => {
897
+ for (const n in t)
898
+ if (n.startsWith("aria-") || n === "role" || n === "title")
899
+ return !0;
900
+ return !1;
901
+ };
902
+ const Ct = Ae(
903
+ ({
904
+ color: t = "currentColor",
905
+ size: n = 24,
906
+ strokeWidth: o = 2,
907
+ absoluteStrokeWidth: a,
908
+ className: l = "",
909
+ children: b,
910
+ iconNode: u,
911
+ ...h
912
+ }, C) => ze(
913
+ "svg",
914
+ {
915
+ ref: C,
916
+ ...kt,
917
+ width: n,
918
+ height: n,
919
+ stroke: t,
920
+ strokeWidth: a ? Number(o) * 24 / Number(n) : o,
921
+ className: at("lucide", l),
922
+ ...!b && !Dt(h) && { "aria-hidden": "true" },
923
+ ...h
924
+ },
925
+ [
926
+ ...u.map(([f, y]) => ze(f, y)),
927
+ ...Array.isArray(b) ? b : [b]
928
+ ]
929
+ )
930
+ );
931
+ const Re = (t, n) => {
932
+ const o = Ae(
933
+ ({ className: a, ...l }, b) => ze(Ct, {
934
+ ref: b,
935
+ iconNode: n,
936
+ className: at(
937
+ `lucide-${vt(Ge(t))}`,
938
+ `lucide-${t}`,
939
+ a
940
+ ),
941
+ ...l
942
+ })
943
+ );
944
+ return o.displayName = Ge(t), o;
945
+ };
946
+ const Mt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], St = Re("check", Mt);
947
+ const Tt = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], zt = Re("chevron-right", Tt);
948
+ const Lt = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], Wt = Re("circle", Lt), Ue = F.Root, qe = F.Trigger, _t = Z.forwardRef(({ className: t, inset: n, children: o, ...a }, l) => /* @__PURE__ */ r(
949
+ F.SubTrigger,
950
+ {
951
+ ref: l,
952
+ className: s(
953
+ "flex cursor-default select-none items-center rounded-lg px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
954
+ n && "pl-8",
955
+ t
956
+ ),
957
+ ...a,
958
+ children: [
959
+ o,
960
+ /* @__PURE__ */ e(zt, { className: "ml-auto h-4 w-4" })
961
+ ]
962
+ }
963
+ ));
964
+ _t.displayName = F.SubTrigger.displayName;
965
+ const Et = Z.forwardRef(({ className: t, ...n }, o) => /* @__PURE__ */ e(
966
+ F.SubContent,
967
+ {
968
+ ref: o,
969
+ className: s(
970
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
971
+ t
972
+ ),
973
+ ...n
974
+ }
975
+ ));
976
+ Et.displayName = F.SubContent.displayName;
977
+ const _e = Z.forwardRef(({ className: t, sideOffset: n = 4, ...o }, a) => /* @__PURE__ */ e(F.Portal, { children: /* @__PURE__ */ e(
978
+ F.Content,
979
+ {
980
+ ref: a,
981
+ sideOffset: n,
982
+ className: s(
983
+ "z-50 rounded-xl border bg-popover p-1 text-popover-foreground shadow-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
984
+ t
985
+ ),
986
+ ...o
987
+ }
988
+ ) }));
989
+ _e.displayName = F.Content.displayName;
990
+ const Ee = Z.forwardRef(({ className: t, inset: n, ...o }, a) => /* @__PURE__ */ e(
991
+ F.Item,
992
+ {
993
+ ref: a,
994
+ className: s(
995
+ "relative flex cursor-pointer select-none items-center rounded-lg px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
996
+ n && "pl-8",
997
+ t
998
+ ),
999
+ ...o
1000
+ }
1001
+ ));
1002
+ Ee.displayName = F.Item.displayName;
1003
+ const At = Z.forwardRef(({ className: t, children: n, checked: o = !1, ...a }, l) => /* @__PURE__ */ r(
1004
+ F.CheckboxItem,
1005
+ {
1006
+ ref: l,
1007
+ className: s(
1008
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1009
+ t
1010
+ ),
1011
+ checked: o,
1012
+ ...a,
1013
+ children: [
1014
+ /* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(F.ItemIndicator, { children: /* @__PURE__ */ e(St, { className: "h-4 w-4" }) }) }),
1015
+ n
1016
+ ]
1017
+ }
1018
+ ));
1019
+ At.displayName = F.CheckboxItem.displayName;
1020
+ const Bt = Z.forwardRef(({ className: t, children: n, ...o }, a) => /* @__PURE__ */ r(
1021
+ F.RadioItem,
1022
+ {
1023
+ ref: a,
1024
+ className: s(
1025
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1026
+ t
1027
+ ),
1028
+ ...o,
1029
+ children: [
1030
+ /* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(F.ItemIndicator, { children: /* @__PURE__ */ e(Wt, { className: "h-2 w-2 fill-current" }) }) }),
1031
+ n
1032
+ ]
1033
+ }
1034
+ ));
1035
+ Bt.displayName = F.RadioItem.displayName;
1036
+ const It = Z.forwardRef(({ className: t, inset: n, ...o }, a) => /* @__PURE__ */ e(
1037
+ F.Label,
1038
+ {
1039
+ ref: a,
1040
+ className: s("px-2 py-1.5 text-sm font-semibold", n && "pl-8", t),
1041
+ ...o
1042
+ }
1043
+ ));
1044
+ It.displayName = F.Label.displayName;
1045
+ const $t = Z.forwardRef(({ className: t, ...n }, o) => /* @__PURE__ */ e(
1046
+ F.Separator,
1047
+ {
1048
+ ref: o,
1049
+ className: s("-mx-1 my-1 h-px bg-muted", t),
1050
+ ...n
1051
+ }
1052
+ ));
1053
+ $t.displayName = F.Separator.displayName;
1054
+ const Ht = ot(
1055
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
1056
+ {
1057
+ variants: {
1058
+ variant: {
1059
+ default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
1060
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
1061
+ destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
1062
+ outline: "text-foreground"
1063
+ }
1064
+ },
1065
+ defaultVariants: { variant: "default" }
1066
+ }
1067
+ );
1068
+ function Pt({ className: t, variant: n, ...o }) {
1069
+ return /* @__PURE__ */ e("div", { className: s(Ht({ variant: n }), t), ...o });
1070
+ }
1071
+ function jt({ className: t }) {
1072
+ return /* @__PURE__ */ e(
1073
+ "svg",
1074
+ {
1075
+ className: t,
1076
+ xmlns: "http://www.w3.org/2000/svg",
1077
+ width: "24",
1078
+ height: "24",
1079
+ viewBox: "0 0 24 24",
1080
+ fill: "none",
1081
+ stroke: "currentColor",
1082
+ strokeWidth: "2",
1083
+ strokeLinecap: "round",
1084
+ strokeLinejoin: "round",
1085
+ children: /* @__PURE__ */ e("path", { d: "m15 18-6-6 6-6" })
1086
+ }
1087
+ );
1088
+ }
1089
+ function Rt({ className: t }) {
1090
+ return /* @__PURE__ */ e(
1091
+ "svg",
1092
+ {
1093
+ className: t,
1094
+ xmlns: "http://www.w3.org/2000/svg",
1095
+ width: "24",
1096
+ height: "24",
1097
+ viewBox: "0 0 24 24",
1098
+ fill: "none",
1099
+ stroke: "currentColor",
1100
+ strokeWidth: "2",
1101
+ strokeLinecap: "round",
1102
+ strokeLinejoin: "round",
1103
+ children: /* @__PURE__ */ e("path", { d: "m9 18 6-6-6-6" })
1104
+ }
1105
+ );
1106
+ }
1107
+ const Ot = [
1108
+ "January",
1109
+ "February",
1110
+ "March",
1111
+ "April",
1112
+ "May",
1113
+ "June",
1114
+ "July",
1115
+ "August",
1116
+ "September",
1117
+ "October",
1118
+ "November",
1119
+ "December"
1120
+ ];
1121
+ function Ft({
1122
+ date: t,
1123
+ view: n,
1124
+ events: o = [],
1125
+ onNavigatePrev: a,
1126
+ onNavigateNext: l,
1127
+ weekStartsOn: b = 1,
1128
+ showEventCount: u = !0,
1129
+ className: h
1130
+ }) {
1131
+ const C = Ot[t.getMonth()], f = t.getFullYear(), y = u ? mt(o, t, n, b) : 0, S = ht(t, n);
1132
+ return /* @__PURE__ */ r("div", { className: s("min-w-0 flex-1", h), children: [
1133
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 sm:gap-2 flex-wrap", children: [
1134
+ /* @__PURE__ */ r("span", { className: "text-base sm:text-lg font-semibold truncate", children: [
1135
+ C,
1136
+ " ",
1137
+ f
1138
+ ] }),
1139
+ u && /* @__PURE__ */ e(Pt, { variant: "outline", className: "px-1 sm:px-1.5 text-[10px] sm:text-xs shrink-0", children: y })
1140
+ ] }),
1141
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 sm:gap-2", children: [
1142
+ /* @__PURE__ */ e(
1143
+ ue,
1144
+ {
1145
+ variant: "outline",
1146
+ size: "icon",
1147
+ className: "size-5 sm:size-6 [&_svg]:size-3 sm:[&_svg]:size-4",
1148
+ onClick: a,
1149
+ children: /* @__PURE__ */ e(jt, {})
1150
+ }
1151
+ ),
1152
+ /* @__PURE__ */ e("p", { className: "text-xs sm:text-sm text-muted-foreground truncate", children: S }),
1153
+ /* @__PURE__ */ e(
1154
+ ue,
1155
+ {
1156
+ variant: "outline",
1157
+ size: "icon",
1158
+ className: "size-5 sm:size-6 [&_svg]:size-3 sm:[&_svg]:size-4",
1159
+ onClick: l,
1160
+ children: /* @__PURE__ */ e(Rt, {})
1161
+ }
1162
+ )
1163
+ ] })
1164
+ ] });
1165
+ }
1166
+ const Vt = [
1167
+ "JAN",
1168
+ "FEB",
1169
+ "MAR",
1170
+ "APR",
1171
+ "MAY",
1172
+ "JUN",
1173
+ "JUL",
1174
+ "AUG",
1175
+ "SEP",
1176
+ "OCT",
1177
+ "NOV",
1178
+ "DEC"
1179
+ ];
1180
+ function Gt({ onClick: t, className: n }) {
1181
+ const o = /* @__PURE__ */ new Date();
1182
+ return /* @__PURE__ */ r(
1183
+ "button",
1184
+ {
1185
+ type: "button",
1186
+ className: s(
1187
+ "flex size-11 sm:size-14 flex-col items-start overflow-hidden rounded-lg border shrink-0",
1188
+ "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
1189
+ "hover:bg-accent/50 transition-colors",
1190
+ n
1191
+ ),
1192
+ onClick: t,
1193
+ children: [
1194
+ /* @__PURE__ */ e("p", { className: "flex h-4 sm:h-6 w-full items-center justify-center bg-primary text-center text-[10px] sm:text-xs font-semibold text-primary-foreground", children: Vt[o.getMonth()] }),
1195
+ /* @__PURE__ */ e("p", { className: "flex w-full flex-1 items-center justify-center text-sm sm:text-lg font-bold", children: o.getDate() })
1196
+ ]
1197
+ }
1198
+ );
1199
+ }
1200
+ function Ut({ className: t }) {
1201
+ return /* @__PURE__ */ r(
1202
+ "svg",
1203
+ {
1204
+ className: t,
1205
+ xmlns: "http://www.w3.org/2000/svg",
1206
+ width: "24",
1207
+ height: "24",
1208
+ viewBox: "0 0 24 24",
1209
+ fill: "none",
1210
+ stroke: "currentColor",
1211
+ strokeWidth: "2",
1212
+ strokeLinecap: "round",
1213
+ strokeLinejoin: "round",
1214
+ children: [
1215
+ /* @__PURE__ */ e("path", { d: "M8 2v4" }),
1216
+ /* @__PURE__ */ e("path", { d: "M16 2v4" }),
1217
+ /* @__PURE__ */ e("rect", { width: "18", height: "18", x: "3", y: "4", rx: "2" }),
1218
+ /* @__PURE__ */ e("path", { d: "M3 10h18" }),
1219
+ /* @__PURE__ */ e("path", { d: "M8 14h.01" }),
1220
+ /* @__PURE__ */ e("path", { d: "M12 14h.01" }),
1221
+ /* @__PURE__ */ e("path", { d: "M16 14h.01" }),
1222
+ /* @__PURE__ */ e("path", { d: "M8 18h.01" }),
1223
+ /* @__PURE__ */ e("path", { d: "M12 18h.01" }),
1224
+ /* @__PURE__ */ e("path", { d: "M16 18h.01" })
1225
+ ]
1226
+ }
1227
+ );
1228
+ }
1229
+ function Ne({ className: t }) {
1230
+ return /* @__PURE__ */ r(
1231
+ "svg",
1232
+ {
1233
+ className: t,
1234
+ xmlns: "http://www.w3.org/2000/svg",
1235
+ width: "24",
1236
+ height: "24",
1237
+ viewBox: "0 0 24 24",
1238
+ fill: "none",
1239
+ stroke: "currentColor",
1240
+ strokeWidth: "2",
1241
+ strokeLinecap: "round",
1242
+ strokeLinejoin: "round",
1243
+ children: [
1244
+ /* @__PURE__ */ e("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
1245
+ /* @__PURE__ */ e("path", { d: "M9 8h7" }),
1246
+ /* @__PURE__ */ e("path", { d: "M8 12h6" }),
1247
+ /* @__PURE__ */ e("path", { d: "M11 16h5" })
1248
+ ]
1249
+ }
1250
+ );
1251
+ }
1252
+ function Ke({ className: t }) {
1253
+ return /* @__PURE__ */ e(
1254
+ "svg",
1255
+ {
1256
+ className: t,
1257
+ xmlns: "http://www.w3.org/2000/svg",
1258
+ width: "24",
1259
+ height: "24",
1260
+ viewBox: "0 0 24 24",
1261
+ fill: "none",
1262
+ stroke: "currentColor",
1263
+ strokeWidth: "2",
1264
+ strokeLinecap: "round",
1265
+ strokeLinejoin: "round",
1266
+ children: /* @__PURE__ */ e("path", { d: "m6 9 6 6 6-6" })
1267
+ }
1268
+ );
1269
+ }
1270
+ function qt({ className: t }) {
1271
+ return /* @__PURE__ */ r(
1272
+ "svg",
1273
+ {
1274
+ className: t,
1275
+ xmlns: "http://www.w3.org/2000/svg",
1276
+ width: "24",
1277
+ height: "24",
1278
+ viewBox: "0 0 24 24",
1279
+ fill: "none",
1280
+ stroke: "currentColor",
1281
+ strokeWidth: "2",
1282
+ strokeLinecap: "round",
1283
+ strokeLinejoin: "round",
1284
+ children: [
1285
+ /* @__PURE__ */ e("path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" }),
1286
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" })
1287
+ ]
1288
+ }
1289
+ );
1290
+ }
1291
+ function Ye({ className: t }) {
1292
+ return /* @__PURE__ */ r(
1293
+ "svg",
1294
+ {
1295
+ className: t,
1296
+ xmlns: "http://www.w3.org/2000/svg",
1297
+ width: "24",
1298
+ height: "24",
1299
+ viewBox: "0 0 24 24",
1300
+ fill: "none",
1301
+ stroke: "currentColor",
1302
+ strokeWidth: "2",
1303
+ strokeLinecap: "round",
1304
+ strokeLinejoin: "round",
1305
+ children: [
1306
+ /* @__PURE__ */ e("path", { d: "M5 12h14" }),
1307
+ /* @__PURE__ */ e("path", { d: "M12 5v14" })
1308
+ ]
1309
+ }
1310
+ );
1311
+ }
1312
+ function Kt({ className: t }) {
1313
+ return /* @__PURE__ */ r(
1314
+ "svg",
1315
+ {
1316
+ className: t,
1317
+ xmlns: "http://www.w3.org/2000/svg",
1318
+ width: "24",
1319
+ height: "24",
1320
+ viewBox: "0 0 24 24",
1321
+ fill: "none",
1322
+ stroke: "currentColor",
1323
+ strokeWidth: "2",
1324
+ strokeLinecap: "round",
1325
+ strokeLinejoin: "round",
1326
+ children: [
1327
+ /* @__PURE__ */ e("rect", { width: "7", height: "7", x: "3", y: "3", rx: "1" }),
1328
+ /* @__PURE__ */ e("rect", { width: "7", height: "7", x: "3", y: "14", rx: "1" }),
1329
+ /* @__PURE__ */ e("path", { d: "M14 4h7" }),
1330
+ /* @__PURE__ */ e("path", { d: "M14 9h7" }),
1331
+ /* @__PURE__ */ e("path", { d: "M14 15h7" }),
1332
+ /* @__PURE__ */ e("path", { d: "M14 20h7" })
1333
+ ]
1334
+ }
1335
+ );
1336
+ }
1337
+ function Yt({ className: t }) {
1338
+ return /* @__PURE__ */ r(
1339
+ "svg",
1340
+ {
1341
+ className: t,
1342
+ xmlns: "http://www.w3.org/2000/svg",
1343
+ width: "24",
1344
+ height: "24",
1345
+ viewBox: "0 0 24 24",
1346
+ fill: "none",
1347
+ stroke: "currentColor",
1348
+ strokeWidth: "2",
1349
+ strokeLinecap: "round",
1350
+ strokeLinejoin: "round",
1351
+ children: [
1352
+ /* @__PURE__ */ e("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
1353
+ /* @__PURE__ */ e("path", { d: "M12 3v18" })
1354
+ ]
1355
+ }
1356
+ );
1357
+ }
1358
+ function Xt({ className: t }) {
1359
+ return /* @__PURE__ */ r(
1360
+ "svg",
1361
+ {
1362
+ className: t,
1363
+ xmlns: "http://www.w3.org/2000/svg",
1364
+ width: "24",
1365
+ height: "24",
1366
+ viewBox: "0 0 24 24",
1367
+ fill: "none",
1368
+ stroke: "currentColor",
1369
+ strokeWidth: "2",
1370
+ strokeLinecap: "round",
1371
+ strokeLinejoin: "round",
1372
+ children: [
1373
+ /* @__PURE__ */ e("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
1374
+ /* @__PURE__ */ e("path", { d: "M3 12h18" }),
1375
+ /* @__PURE__ */ e("path", { d: "M12 3v18" })
1376
+ ]
1377
+ }
1378
+ );
1379
+ }
1380
+ function Jt({ className: t }) {
1381
+ return /* @__PURE__ */ r(
1382
+ "svg",
1383
+ {
1384
+ className: t,
1385
+ xmlns: "http://www.w3.org/2000/svg",
1386
+ width: "24",
1387
+ height: "24",
1388
+ viewBox: "0 0 24 24",
1389
+ fill: "none",
1390
+ stroke: "currentColor",
1391
+ strokeWidth: "2",
1392
+ strokeLinecap: "round",
1393
+ strokeLinejoin: "round",
1394
+ children: [
1395
+ /* @__PURE__ */ e("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
1396
+ /* @__PURE__ */ e("path", { d: "M3 9h18" }),
1397
+ /* @__PURE__ */ e("path", { d: "M3 15h18" }),
1398
+ /* @__PURE__ */ e("path", { d: "M9 3v18" }),
1399
+ /* @__PURE__ */ e("path", { d: "M15 3v18" })
1400
+ ]
1401
+ }
1402
+ );
1403
+ }
1404
+ const Zt = [
1405
+ { value: "day", label: "Day", icon: Kt },
1406
+ { value: "week", label: "Week", icon: Yt },
1407
+ { value: "month", label: "Month", icon: Xt },
1408
+ { value: "year", label: "Year", icon: Jt }
1409
+ // { value: 'agenda', label: 'Agenda', icon: ListIcon }, NOTE: Not needed currently
1410
+ ], Xe = [
1411
+ { value: "timeline-day", label: "1 Day", icon: Ne },
1412
+ { value: "timeline-3day", label: "3 Days", icon: Ne },
1413
+ { value: "timeline-week", label: "7 Days", icon: Ne }
1414
+ ];
1415
+ function pn({
1416
+ currentDate: t,
1417
+ view: n,
1418
+ events: o = [],
1419
+ onNavigateToday: a,
1420
+ onNavigatePrev: l,
1421
+ onNavigateNext: b,
1422
+ onNavigate: u,
1423
+ onViewChange: h,
1424
+ onAddEvent: C,
1425
+ availableViews: f = ["day", "week", "month", "agenda"],
1426
+ showTimelineViews: y = !1,
1427
+ timelineViews: S,
1428
+ settingsContent: c,
1429
+ showSettings: x = !1,
1430
+ filterContent: d,
1431
+ actions: w,
1432
+ className: A,
1433
+ weekStartsOn: P = 1,
1434
+ labels: z = {}
1435
+ }) {
1436
+ const L = V(
1437
+ () => ({
1438
+ today: "Today",
1439
+ addEvent: "Add Event",
1440
+ calendarView: "Calendar View",
1441
+ resourceView: "Resource View",
1442
+ ...z
1443
+ }),
1444
+ [z]
1445
+ ), R = () => {
1446
+ a?.(), u?.("today");
1447
+ }, _ = () => {
1448
+ l?.(), u?.("prev");
1449
+ }, T = () => {
1450
+ b?.(), u?.("next");
1451
+ }, M = ["day", "week", "month", "year", "agenda"].includes(
1452
+ n
1453
+ ), $ = n.startsWith("timeline-") || n.startsWith("resource-"), k = Zt.filter(
1454
+ (p) => f.includes(p.value)
1455
+ ), B = M ? k.find((p) => p.value === n) : null, q = $ ? Xe.find((p) => p.value === n) : null;
1456
+ return /* @__PURE__ */ r("div", { className: s("flex flex-col w-full gap-3 mb-2", A), children: [
1457
+ /* @__PURE__ */ r("div", { className: "flex lg:flex-row flex-col w-full justify-between gap-3", children: [
1458
+ /* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-2", children: [
1459
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-2 sm:gap-3 min-w-0", children: [
1460
+ /* @__PURE__ */ e(Gt, { onClick: R }),
1461
+ /* @__PURE__ */ e(
1462
+ Ft,
1463
+ {
1464
+ date: t,
1465
+ view: n,
1466
+ events: o,
1467
+ onNavigatePrev: _,
1468
+ onNavigateNext: T,
1469
+ weekStartsOn: P
1470
+ }
1471
+ )
1472
+ ] }),
1473
+ C && /* @__PURE__ */ e(
1474
+ ue,
1475
+ {
1476
+ size: "icon",
1477
+ className: "shrink-0 lg:hidden",
1478
+ onClick: C,
1479
+ children: /* @__PURE__ */ e(Ye, { className: "size-4" })
1480
+ }
1481
+ )
1482
+ ] }),
1483
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 sm:gap-2 overflow-x-auto pb-1 -mb-1 scrollbar-none", children: [
1484
+ h && k.length > 0 && /* @__PURE__ */ r(Ue, { children: [
1485
+ /* @__PURE__ */ r(
1486
+ qe,
1487
+ {
1488
+ className: s(
1489
+ "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors",
1490
+ "h-10 px-2 sm:px-3 gap-1 sm:gap-1.5 shrink-0",
1491
+ M ? "bg-primary text-primary-foreground hover:bg-primary/90" : "border border-input bg-background hover:bg-accent hover:text-accent-foreground"
1492
+ ),
1493
+ children: [
1494
+ /* @__PURE__ */ e(Ut, { className: "size-4" }),
1495
+ /* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: B?.label ?? L.calendarView }),
1496
+ /* @__PURE__ */ e(Ke, { className: "size-3 opacity-60" })
1497
+ ]
1498
+ }
1499
+ ),
1500
+ /* @__PURE__ */ e(_e, { align: "start", className: "min-w-[120px]", children: k.map((p) => {
1501
+ const g = p.icon;
1502
+ return /* @__PURE__ */ r(
1503
+ Ee,
1504
+ {
1505
+ onClick: () => h(p.value),
1506
+ className: s(
1507
+ "gap-2",
1508
+ n === p.value && "bg-accent"
1509
+ ),
1510
+ children: [
1511
+ /* @__PURE__ */ e(g, { className: "size-4" }),
1512
+ /* @__PURE__ */ e("span", { children: p.label })
1513
+ ]
1514
+ },
1515
+ p.value
1516
+ );
1517
+ }) })
1518
+ ] }),
1519
+ y && h && /* @__PURE__ */ r(Ue, { children: [
1520
+ /* @__PURE__ */ r(
1521
+ qe,
1522
+ {
1523
+ className: s(
1524
+ "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors",
1525
+ "h-10 px-2 sm:px-3 gap-1 sm:gap-1.5 shrink-0",
1526
+ $ ? "bg-primary text-primary-foreground hover:bg-primary/90" : "border border-input bg-white hover:bg-zinc-50 hover:text-accent-foreground"
1527
+ ),
1528
+ children: [
1529
+ /* @__PURE__ */ e(Ne, { className: "size-4" }),
1530
+ /* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: q?.label ?? L.resourceView }),
1531
+ /* @__PURE__ */ e(Ke, { className: "size-3 opacity-60" })
1532
+ ]
1533
+ }
1534
+ ),
1535
+ /* @__PURE__ */ e(_e, { align: "start", className: "min-w-[120px]", children: Xe.map((p) => {
1536
+ const g = p.icon;
1537
+ return /* @__PURE__ */ r(
1538
+ Ee,
1539
+ {
1540
+ onClick: () => h(p.value),
1541
+ className: s(
1542
+ "gap-2",
1543
+ n === p.value && "bg-accent"
1544
+ ),
1545
+ children: [
1546
+ /* @__PURE__ */ e(g, { className: "size-4" }),
1547
+ /* @__PURE__ */ e("span", { children: p.label })
1548
+ ]
1549
+ },
1550
+ p.value
1551
+ );
1552
+ }) })
1553
+ ] }),
1554
+ x && c && /* @__PURE__ */ r(ae, { children: [
1555
+ /* @__PURE__ */ e(ie, { asChild: !0, children: /* @__PURE__ */ e(
1556
+ ue,
1557
+ {
1558
+ variant: "outline",
1559
+ size: "icon",
1560
+ className: "min-w-10 min-h-10 shrink-0 mx-0",
1561
+ children: /* @__PURE__ */ e(qt, { className: "size-4 sm:size-5" })
1562
+ }
1563
+ ) }),
1564
+ /* @__PURE__ */ e(
1565
+ ne,
1566
+ {
1567
+ className: "w-auto min-w-80 p-0",
1568
+ align: "end",
1569
+ sideOffset: 8,
1570
+ children: /* @__PURE__ */ e("div", { className: "max-h-[70vh] overflow-y-auto p-4 space-y-6", children: c })
1571
+ }
1572
+ )
1573
+ ] }),
1574
+ w,
1575
+ C && /* @__PURE__ */ r(
1576
+ ue,
1577
+ {
1578
+ className: "hidden lg:flex shrink-0 max-h-10",
1579
+ onClick: C,
1580
+ children: [
1581
+ /* @__PURE__ */ e(Ye, { className: "size-4" }),
1582
+ L.addEvent
1583
+ ]
1584
+ }
1585
+ )
1586
+ ] })
1587
+ ] }),
1588
+ d && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 pb-1 -mb-1 scrollbar-none", children: d })
1589
+ ] });
1590
+ }
1591
+ function fn({
1592
+ events: t,
1593
+ date: n,
1594
+ daysAhead: o = 60,
1595
+ badgeVariant: a = "colored",
1596
+ onEventClick: l,
1597
+ className: b,
1598
+ renderEvent: u,
1599
+ renderPopover: h,
1600
+ slots: C,
1601
+ classNames: f
1602
+ }) {
1603
+ const y = V(() => {
1604
+ const c = new Date(n);
1605
+ c.setHours(0, 0, 0, 0);
1606
+ const x = new Date(c);
1607
+ return x.setDate(x.getDate() + o), t.filter((d) => d.endDate >= c && d.startDate <= x);
1608
+ }, [t, o, n]), S = V(() => {
1609
+ const c = pt(y), x = [];
1610
+ for (const [d, w] of c)
1611
+ x.push({
1612
+ date: new Date(d),
1613
+ dateKey: d,
1614
+ events: w
1615
+ });
1616
+ return x.sort((d, w) => d.date.getTime() - w.date.getTime()), x;
1617
+ }, [y]);
1618
+ return S.length === 0 ? /* @__PURE__ */ e("div", { className: s("flex flex-col items-center justify-center h-full py-12", b), children: /* @__PURE__ */ r("div", { className: "text-center", children: [
1619
+ /* @__PURE__ */ e("p", { className: "text-muted-foreground", children: "No events found" }),
1620
+ /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground/70", children: "No events scheduled for this period" })
1621
+ ] }) }) : /* @__PURE__ */ r("div", { className: s("flex flex-col h-full overflow-auto", f?.agendaList, b), children: [
1622
+ /* @__PURE__ */ e("div", { className: "sticky top-0 z-10 bg-background border-b px-4 py-3", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
1623
+ /* @__PURE__ */ e("h2", { className: "text-lg font-medium", children: "Schedule" }),
1624
+ /* @__PURE__ */ r("span", { className: "text-sm text-muted-foreground", children: [
1625
+ y.length,
1626
+ " event",
1627
+ y.length !== 1 ? "s" : ""
1628
+ ] })
1629
+ ] }) }),
1630
+ /* @__PURE__ */ e("div", { className: "flex-1", children: S.map(({ date: c, dateKey: x, events: d }) => {
1631
+ const w = oe(c), A = c.toLocaleDateString([], { weekday: "short" }), P = c.getDate(), z = c.toLocaleDateString([], { month: "short" });
1632
+ return /* @__PURE__ */ r("div", { className: s("", f?.agendaDayGroup), children: [
1633
+ /* @__PURE__ */ e(
1634
+ "div",
1635
+ {
1636
+ className: s(
1637
+ "sticky top-[52px] z-10 bg-background px-4 py-3 border-b",
1638
+ f?.agendaDayHeader
1639
+ ),
1640
+ children: /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
1641
+ /* @__PURE__ */ r("div", { className: "flex flex-col items-center min-w-[40px]", children: [
1642
+ /* @__PURE__ */ e(
1643
+ "span",
1644
+ {
1645
+ className: s(
1646
+ "text-[11px] font-medium uppercase tracking-wide",
1647
+ w ? "text-primary" : "text-muted-foreground"
1648
+ ),
1649
+ children: A
1650
+ }
1651
+ ),
1652
+ /* @__PURE__ */ e(
1653
+ "span",
1654
+ {
1655
+ className: s(
1656
+ "flex items-center justify-center rounded-full mt-0.5",
1657
+ "size-10 text-xl font-normal",
1658
+ w ? "bg-primary text-primary-foreground" : "text-foreground"
1659
+ ),
1660
+ children: P
1661
+ }
1662
+ )
1663
+ ] }),
1664
+ /* @__PURE__ */ r("span", { className: "text-sm text-muted-foreground", children: [
1665
+ z,
1666
+ " ",
1667
+ c.getFullYear()
1668
+ ] })
1669
+ ] })
1670
+ }
1671
+ ),
1672
+ /* @__PURE__ */ e("div", { className: "px-4 py-3 space-y-2 border-b last:border-b-0", children: d.map(
1673
+ (L) => u ? /* @__PURE__ */ e("div", { children: u({ event: L, variant: "full" }) }, L.id) : /* @__PURE__ */ e(
1674
+ De,
1675
+ {
1676
+ event: L,
1677
+ variant: "full",
1678
+ badgeVariant: a,
1679
+ onClick: l,
1680
+ disablePopover: !!l && !h,
1681
+ renderPopover: h,
1682
+ showTime: !0,
1683
+ showDescription: !0,
1684
+ showParticipants: !0,
1685
+ ...f?.eventCard && { className: f.eventCard }
1686
+ },
1687
+ L.id
1688
+ )
1689
+ ) })
1690
+ ] }, x);
1691
+ }) })
1692
+ ] });
1693
+ }
1694
+ const be = 360, ye = 480, Me = 280;
1695
+ function Qt({
1696
+ isOpen: t,
1697
+ onClose: n,
1698
+ date: o,
1699
+ events: a,
1700
+ anchorRect: l,
1701
+ badgeVariant: b = "colored",
1702
+ onEventClick: u,
1703
+ renderEvent: h,
1704
+ renderPopover: C,
1705
+ className: f
1706
+ }) {
1707
+ const y = ee(null), S = ee(null), [c, x] = X("closed"), d = V(
1708
+ () => [...a].sort((_, T) => _.startDate.getTime() - T.startDate.getTime()),
1709
+ [a]
1710
+ ), w = V(() => {
1711
+ if (!l) return { top: 0, left: 0, width: be, maxHeight: ye };
1712
+ const _ = typeof window < "u" ? window.innerWidth : 1200, T = typeof window < "u" ? window.innerHeight : 800;
1713
+ let M = l.left + l.width / 2 - be / 2;
1714
+ M = Math.max(16, Math.min(M, _ - be - 16));
1715
+ const $ = Math.min(a.length * 68 + 80, ye);
1716
+ let k = l.top + l.height / 2 - $ / 2;
1717
+ return k = Math.max(16, Math.min(k, T - $ - 16)), { top: k, left: M, width: be, maxHeight: ye };
1718
+ }, [l, a.length]);
1719
+ Be(() => {
1720
+ if (t && l)
1721
+ x("entering"), requestAnimationFrame(() => {
1722
+ requestAnimationFrame(() => {
1723
+ x("open");
1724
+ });
1725
+ });
1726
+ else if (!t && c === "open") {
1727
+ x("exiting");
1728
+ const _ = setTimeout(() => {
1729
+ x("closed");
1730
+ }, Me);
1731
+ return () => clearTimeout(_);
1732
+ }
1733
+ }, [t, l]), Le(() => {
1734
+ if (c === "closed") return;
1735
+ const _ = (T) => {
1736
+ T.key === "Escape" && (T.stopPropagation(), n());
1737
+ };
1738
+ return document.addEventListener("keydown", _), () => document.removeEventListener("keydown", _);
1739
+ }, [c, n]), Le(() => {
1740
+ c === "open" && S.current && S.current.focus();
1741
+ }, [c]);
1742
+ const A = W(
1743
+ (_) => {
1744
+ _.target === y.current && n();
1745
+ },
1746
+ [n]
1747
+ );
1748
+ if (c === "closed") return null;
1749
+ const P = c === "entering" || c === "exiting", z = P && l ? {
1750
+ // Collapsed state: match the day cell exactly
1751
+ position: "fixed",
1752
+ top: l.top,
1753
+ left: l.left,
1754
+ width: l.width,
1755
+ height: l.height,
1756
+ maxHeight: l.height,
1757
+ opacity: c === "entering" ? 0.7 : 0,
1758
+ transform: "scale(1)",
1759
+ borderRadius: "8px"
1760
+ } : {
1761
+ // Expanded state: full panel
1762
+ position: "fixed",
1763
+ top: w.top,
1764
+ left: w.left,
1765
+ width: w.width,
1766
+ maxHeight: w.maxHeight,
1767
+ opacity: 1,
1768
+ transform: "scale(1)",
1769
+ borderRadius: "12px"
1770
+ }, L = P ? 0 : 1, R = o.toLocaleDateString(void 0, {
1771
+ weekday: "long",
1772
+ month: "long",
1773
+ day: "numeric"
1774
+ });
1775
+ return /* @__PURE__ */ r(ct, { children: [
1776
+ /* @__PURE__ */ e(
1777
+ "div",
1778
+ {
1779
+ ref: y,
1780
+ role: "presentation",
1781
+ onClick: A,
1782
+ className: "ic-expansion-backdrop",
1783
+ style: {
1784
+ position: "fixed",
1785
+ inset: 0,
1786
+ zIndex: 50,
1787
+ backgroundColor: "rgba(0, 0, 0, 0.2)",
1788
+ opacity: L,
1789
+ transition: `opacity ${Me}ms cubic-bezier(0.32, 0.72, 0, 1)`
1790
+ }
1791
+ }
1792
+ ),
1793
+ /* @__PURE__ */ r(
1794
+ "div",
1795
+ {
1796
+ ref: S,
1797
+ role: "dialog",
1798
+ "aria-modal": "true",
1799
+ "aria-label": `Events for ${R}`,
1800
+ tabIndex: -1,
1801
+ className: s(
1802
+ "ic-expansion-panel",
1803
+ "bg-background border border-border shadow-2xl overflow-hidden",
1804
+ "focus:outline-none",
1805
+ f
1806
+ ),
1807
+ style: {
1808
+ ...z,
1809
+ zIndex: 51,
1810
+ transition: `all ${Me}ms cubic-bezier(0.32, 0.72, 0, 1)`,
1811
+ willChange: "top, left, width, height, max-height, opacity, border-radius"
1812
+ },
1813
+ children: [
1814
+ /* @__PURE__ */ r("div", { className: "flex items-center justify-between px-4 py-3 border-b bg-muted/30", children: [
1815
+ /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
1816
+ /* @__PURE__ */ e("span", { className: "text-sm font-semibold text-foreground", children: R }),
1817
+ /* @__PURE__ */ r("span", { className: "text-xs text-muted-foreground", children: [
1818
+ a.length,
1819
+ " event",
1820
+ a.length !== 1 ? "s" : ""
1821
+ ] })
1822
+ ] }),
1823
+ /* @__PURE__ */ e(
1824
+ "button",
1825
+ {
1826
+ type: "button",
1827
+ onClick: n,
1828
+ className: "flex items-center justify-center size-7 rounded-full hover:bg-muted transition-colors text-muted-foreground hover:text-foreground",
1829
+ "aria-label": "Close",
1830
+ children: /* @__PURE__ */ r(
1831
+ "svg",
1832
+ {
1833
+ width: "14",
1834
+ height: "14",
1835
+ viewBox: "0 0 24 24",
1836
+ fill: "none",
1837
+ stroke: "currentColor",
1838
+ strokeWidth: "2",
1839
+ strokeLinecap: "round",
1840
+ strokeLinejoin: "round",
1841
+ children: [
1842
+ /* @__PURE__ */ e("path", { d: "M18 6 6 18" }),
1843
+ /* @__PURE__ */ e("path", { d: "m6 6 12 12" })
1844
+ ]
1845
+ }
1846
+ )
1847
+ }
1848
+ )
1849
+ ] }),
1850
+ /* @__PURE__ */ r(
1851
+ "div",
1852
+ {
1853
+ className: "overflow-y-auto px-3 py-2 space-y-1.5",
1854
+ style: { maxHeight: `${ye - 64}px` },
1855
+ children: [
1856
+ d.map((_) => /* @__PURE__ */ e(
1857
+ "div",
1858
+ {
1859
+ onPointerDown: (T) => T.stopPropagation(),
1860
+ children: h ? h({ event: _, variant: "compact" }) : /* @__PURE__ */ e(
1861
+ De,
1862
+ {
1863
+ event: _,
1864
+ variant: "compact",
1865
+ badgeVariant: b,
1866
+ onClick: (T) => {
1867
+ n(), u?.(T);
1868
+ },
1869
+ disablePopover: !!u && !C,
1870
+ renderPopover: C,
1871
+ showTime: !0
1872
+ }
1873
+ )
1874
+ },
1875
+ _.id
1876
+ )),
1877
+ a.length === 0 && /* @__PURE__ */ e("div", { className: "py-6 text-center text-sm text-muted-foreground", children: "No events" })
1878
+ ]
1879
+ }
1880
+ )
1881
+ ]
1882
+ }
1883
+ )
1884
+ ] });
1885
+ }
1886
+ function it({
1887
+ events: t,
1888
+ date: n,
1889
+ onEventClick: o,
1890
+ className: a
1891
+ }) {
1892
+ if (t.length === 0) return null;
1893
+ const l = t.some((h) => Ce(h) && se(h.startDate, h.endDate)), b = t.some(
1894
+ (h) => !se(h.startDate, h.endDate) || Ce(h) && !se(h.startDate, h.endDate)
1895
+ ), u = l && b ? "All day / Multi-day" : l ? "All day" : "Multi-day";
1896
+ return /* @__PURE__ */ r("div", { className: s("border-b bg-muted/20 px-2 py-1.5 space-y-1", "sm:px-4 sm:py-2", a), children: [
1897
+ /* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-muted-foreground sm:text-xs", children: u }),
1898
+ /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: t.map((h) => {
1899
+ const C = xe(h.color), f = Ce(h), y = se(h.startDate, n), S = se(h.endDate, n), c = f && se(h.startDate, h.endDate);
1900
+ return /* @__PURE__ */ r(
1901
+ "button",
1902
+ {
1903
+ type: "button",
1904
+ onClick: () => o?.(h),
1905
+ title: J(h),
1906
+ className: s(
1907
+ "inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium transition-opacity hover:opacity-80",
1908
+ "sm:px-2 sm:py-1 sm:text-xs",
1909
+ C.bg,
1910
+ C.text,
1911
+ h.isCanceled && "opacity-60 line-through"
1912
+ ),
1913
+ children: [
1914
+ !c && y && !S && "→ ",
1915
+ !c && !y && S && " ←",
1916
+ !c && !y && !S && "↔ ",
1917
+ /* @__PURE__ */ e("span", { className: "truncate max-w-24 sm:max-w-32", children: h.title }),
1918
+ c && /* @__PURE__ */ e("span", { className: "text-[9px] opacity-70 sm:text-[10px]", children: "All day" })
1919
+ ]
1920
+ },
1921
+ h.id
1922
+ );
1923
+ }) })
1924
+ ] });
1925
+ }
1926
+ const en = 5;
1927
+ function st({
1928
+ slot: t,
1929
+ onSelectionStart: n,
1930
+ onSelectionMove: o,
1931
+ onSelectionEnd: a,
1932
+ isSelected: l = !1,
1933
+ isSelecting: b = !1,
1934
+ disabled: u = !1,
1935
+ ariaLabel: h,
1936
+ children: C,
1937
+ className: f,
1938
+ height: y,
1939
+ style: S,
1940
+ dataAttributes: c
1941
+ }) {
1942
+ const x = ee(null), d = ee(!1), w = ee(!1), A = ee(null), [P, z] = X(!1), L = $e(), R = W(
1943
+ (p) => {
1944
+ u || p.button !== 0 && p.pointerType === "mouse" || (p.preventDefault(), x.current = { x: p.clientX, y: p.clientY }, d.current = !1, w.current = !0, n?.(t));
1945
+ },
1946
+ [u, t, n]
1947
+ ), _ = W(
1948
+ (p) => {
1949
+ if (!(x.current && w.current && !u)) return;
1950
+ const g = p.clientX - x.current.x, E = p.clientY - x.current.y;
1951
+ Math.sqrt(g * g + E * E) >= en && (d.current = !0);
1952
+ },
1953
+ [u]
1954
+ ), T = W(
1955
+ (p) => {
1956
+ u || (p.buttons > 0 || b) && o?.(t);
1957
+ },
1958
+ [u, b, t, o]
1959
+ ), M = W(() => {
1960
+ u || (a?.(), x.current = null, d.current = !1, w.current = !1);
1961
+ }, [u, a]), $ = W(
1962
+ (p) => {
1963
+ if (!L?.isDragging || u) return;
1964
+ p.preventDefault(), p.dataTransfer.dropEffect = "move", z(!0);
1965
+ const g = /* @__PURE__ */ new Date(), E = t.hour ?? g.getHours(), H = t.minute ?? (g.getMinutes() >= 30 ? 30 : 0);
1966
+ L.updateDragPreview?.(t.date, E, H);
1967
+ },
1968
+ [L, u, t]
1969
+ ), k = W(() => {
1970
+ z(!1);
1971
+ }, []), B = W(
1972
+ (p) => {
1973
+ p.preventDefault(), z(!1), !(!L?.isDragging || u) && L.endDrag?.();
1974
+ },
1975
+ [L, u]
1976
+ );
1977
+ Le(() => {
1978
+ const p = () => {
1979
+ w.current && (w.current = !1, x.current = null, d.current = !1);
1980
+ };
1981
+ return window.addEventListener("pointerup", p), window.addEventListener("pointercancel", p), () => {
1982
+ window.removeEventListener("pointerup", p), window.removeEventListener("pointercancel", p);
1983
+ };
1984
+ }, []);
1985
+ const q = W(
1986
+ (p) => {
1987
+ u || (p.key === "Enter" || p.key === " ") && (p.preventDefault(), n?.(t), a?.());
1988
+ },
1989
+ [u, t, n, a]
1990
+ );
1991
+ return /* @__PURE__ */ e(
1992
+ "button",
1993
+ {
1994
+ ref: A,
1995
+ type: "button",
1996
+ "aria-label": h,
1997
+ "aria-disabled": u,
1998
+ "aria-pressed": l,
1999
+ disabled: u,
2000
+ onPointerDown: R,
2001
+ onPointerMove: _,
2002
+ onPointerUp: M,
2003
+ onPointerEnter: T,
2004
+ onKeyDown: q,
2005
+ onDragOver: $,
2006
+ onDragLeave: k,
2007
+ onDrop: B,
2008
+ className: s(
2009
+ "select-none touch-none cursor-pointer transition-colors",
2010
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
2011
+ // Hover state (only when not in selection)
2012
+ !(b || u) && "hover:bg-blue-50/60",
2013
+ // Selection state — blue tint matching the primary color
2014
+ l && "bg-blue-100/70",
2015
+ // Drag over state - visual feedback when event is dragged over
2016
+ P && "bg-primary/20 ring-2 ring-primary ring-inset",
2017
+ // Disabled state
2018
+ u && "cursor-not-allowed opacity-50",
2019
+ f
2020
+ ),
2021
+ style: { height: y, ...S },
2022
+ ...c,
2023
+ children: C
2024
+ }
2025
+ );
2026
+ }
2027
+ function lt({
2028
+ slot: t,
2029
+ date: n,
2030
+ hour: o,
2031
+ minute: a,
2032
+ ariaLabel: l,
2033
+ ...b
2034
+ }) {
2035
+ const u = t ?? { date: n, hour: o ?? 0, minute: a ?? 0 }, h = l ?? `Add event at ${(u.hour ?? 0).toString().padStart(2, "0")}:${(u.minute ?? 0).toString().padStart(2, "0")} on ${u.date.toLocaleDateString()}`;
2036
+ return /* @__PURE__ */ e(st, { slot: u, ariaLabel: h, ...b });
2037
+ }
2038
+ function tn({ slot: t, date: n, ariaLabel: o, ...a }) {
2039
+ const l = t ?? { date: n }, b = o ?? `Select ${l.date.toLocaleDateString()}`;
2040
+ return /* @__PURE__ */ e(st, { slot: l, ariaLabel: b, ...a });
2041
+ }
2042
+ const he = 96, Se = 72, Te = 80;
2043
+ function gn({
2044
+ events: t,
2045
+ date: n,
2046
+ visibleHours: o = { startHour: 0, endHour: 24 },
2047
+ workingHours: a,
2048
+ slotDuration: l = 30,
2049
+ badgeVariant: b = "colored",
2050
+ onEventClick: u,
2051
+ onSlotSelect: h,
2052
+ className: C,
2053
+ renderEvent: f,
2054
+ renderPopover: y,
2055
+ slots: S,
2056
+ classNames: c
2057
+ }) {
2058
+ const x = 60 / l, d = 100 / x, w = V(() => {
2059
+ const v = [];
2060
+ for (let i = 0; i < x; i++)
2061
+ v.push(i * l);
2062
+ return v;
2063
+ }, [x, l]), A = V(() => Ie(t, n), [t, n]), { singleDay: P, multiDay: z } = V(() => Ze(A), [A]), L = V(() => {
2064
+ const v = Qe(P, n, o, he), i = /* @__PURE__ */ new Map();
2065
+ for (const m of v)
2066
+ i.set(m.event.id, m.position);
2067
+ return i;
2068
+ }, [P, n, o]), R = V(() => et(o), [o]), _ = /* @__PURE__ */ new Date(), T = oe(n), M = V(() => {
2069
+ if (!T) return 0;
2070
+ const v = _.getHours() + _.getMinutes() / 60;
2071
+ return v < o.startHour || v > o.endHour ? -1 : (v - o.startHour) * he;
2072
+ }, [T, o, _]), $ = ee(null);
2073
+ Be(() => {
2074
+ const v = $.current;
2075
+ if (!v) return;
2076
+ const i = () => {
2077
+ let m;
2078
+ if (T) {
2079
+ const I = (/* @__PURE__ */ new Date()).getHours();
2080
+ m = Math.max(I - 1, o.startHour);
2081
+ } else {
2082
+ const I = n.getDay(), D = a?.[I];
2083
+ D?.enabled && D.from > 0 ? m = Math.max(D.from - 1, o.startHour) : m = Math.max(7, o.startHour);
2084
+ }
2085
+ const N = (m - o.startHour) * he;
2086
+ v.scrollTo({
2087
+ top: N,
2088
+ behavior: "instant"
2089
+ });
2090
+ };
2091
+ requestAnimationFrame(() => {
2092
+ requestAnimationFrame(i);
2093
+ });
2094
+ }, [n, a, o, T]);
2095
+ const k = He(), B = W(
2096
+ (v) => {
2097
+ k?.startSelection(v);
2098
+ },
2099
+ [k]
2100
+ ), q = W(
2101
+ (v) => {
2102
+ k?.updateSelection(v);
2103
+ },
2104
+ [k]
2105
+ ), p = W(() => {
2106
+ k?.endSelection();
2107
+ }, [k]), g = W(
2108
+ (v) => {
2109
+ u?.(v);
2110
+ },
2111
+ [u]
2112
+ ), E = n.toLocaleDateString([], { weekday: "short" }), H = n.getDate(), O = oe(n);
2113
+ return /* @__PURE__ */ r("div", { className: s("flex flex-col h-full", C), children: [
2114
+ /* @__PURE__ */ e(
2115
+ "div",
2116
+ {
2117
+ className: s(
2118
+ "flex items-center gap-3 border-b px-4 py-3",
2119
+ c?.columnHeader,
2120
+ O && c?.columnHeaderToday
2121
+ ),
2122
+ children: /* @__PURE__ */ r("div", { className: "flex flex-col items-center", children: [
2123
+ /* @__PURE__ */ e(
2124
+ "span",
2125
+ {
2126
+ className: s(
2127
+ "text-[11px] font-medium uppercase tracking-wide",
2128
+ O ? "text-primary" : "text-muted-foreground"
2129
+ ),
2130
+ children: E
2131
+ }
2132
+ ),
2133
+ /* @__PURE__ */ e(
2134
+ "span",
2135
+ {
2136
+ className: s(
2137
+ "flex items-center justify-center rounded-full mt-0.5",
2138
+ "size-12 text-3xl font-normal",
2139
+ O ? "bg-primary text-primary-foreground" : "text-foreground"
2140
+ ),
2141
+ children: H
2142
+ }
2143
+ )
2144
+ ] })
2145
+ }
2146
+ ),
2147
+ z.length > 0 && /* @__PURE__ */ e(
2148
+ it,
2149
+ {
2150
+ events: z,
2151
+ date: n,
2152
+ onEventClick: g,
2153
+ ...c?.multiDayBanner && { className: c.multiDayBanner }
2154
+ }
2155
+ ),
2156
+ /* @__PURE__ */ e(
2157
+ "div",
2158
+ {
2159
+ ref: $,
2160
+ className: s("flex-1 overflow-auto", c?.scrollContainer),
2161
+ children: /* @__PURE__ */ r("div", { className: "relative min-h-full", children: [
2162
+ R.map((v, i) => {
2163
+ const N = !tt(n, v, a);
2164
+ return /* @__PURE__ */ r(
2165
+ "div",
2166
+ {
2167
+ className: s(
2168
+ "relative flex",
2169
+ N && "bg-calendar-disabled-hour",
2170
+ c?.timeSlot,
2171
+ N ? c?.timeSlotNonWorking : c?.timeSlotWorking
2172
+ ),
2173
+ style: { height: he },
2174
+ children: [
2175
+ /* @__PURE__ */ e(
2176
+ "div",
2177
+ {
2178
+ className: s(
2179
+ "relative flex-shrink-0 border-r border-border/50 bg-zinc-50 dark:bg-zinc-900",
2180
+ c?.timeGutter
2181
+ ),
2182
+ style: { width: Se },
2183
+ children: /* @__PURE__ */ e("div", { className: "absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center", children: i !== 0 && /* @__PURE__ */ e(
2184
+ "span",
2185
+ {
2186
+ className: s(
2187
+ "text-[10px] sm:text-xs text-muted-foreground",
2188
+ c?.timeGutterLabel
2189
+ ),
2190
+ children: ke(v)
2191
+ }
2192
+ ) })
2193
+ }
2194
+ ),
2195
+ /* @__PURE__ */ r("div", { className: "relative flex-1", children: [
2196
+ T && !N && /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-primary/5" }),
2197
+ i !== 0 && /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-x-0 top-0 border-b border-border/50" }),
2198
+ w.slice(1).map((I) => /* @__PURE__ */ e(
2199
+ "div",
2200
+ {
2201
+ className: "pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",
2202
+ style: { top: `${I / 60 * 100}%` }
2203
+ },
2204
+ I
2205
+ )),
2206
+ w.map((I, D) => {
2207
+ const Y = { date: n, hour: v, minute: I };
2208
+ return /* @__PURE__ */ e(
2209
+ lt,
2210
+ {
2211
+ slot: Y,
2212
+ onSelectionStart: B,
2213
+ onSelectionMove: q,
2214
+ onSelectionEnd: p,
2215
+ isSelected: k?.isSlotSelected(Y) ?? !1,
2216
+ isSelecting: k?.isSelecting ?? !1,
2217
+ disabled: N,
2218
+ className: "absolute inset-x-0",
2219
+ style: {
2220
+ top: `${D * d}%`,
2221
+ height: `${d}%`
2222
+ },
2223
+ ariaLabel: `Add event at ${ke(v)}:${String(I).padStart(2, "0")}`
2224
+ },
2225
+ I
2226
+ );
2227
+ })
2228
+ ] })
2229
+ ]
2230
+ },
2231
+ v
2232
+ );
2233
+ }),
2234
+ /* @__PURE__ */ e(
2235
+ "div",
2236
+ {
2237
+ className: "absolute top-0 bottom-0 right-0 pointer-events-none",
2238
+ style: { left: Se },
2239
+ children: P.map((v) => {
2240
+ const i = L.get(v.id);
2241
+ if (!i) return null;
2242
+ const m = `calc(${i.width}% - 2px)`, N = `max(${Te}px, ${m})`;
2243
+ return f ? /* @__PURE__ */ e(
2244
+ "div",
2245
+ {
2246
+ className: "absolute pointer-events-auto p-0.5",
2247
+ style: {
2248
+ top: `${i.top}px`,
2249
+ left: `${i.left}%`,
2250
+ width: N,
2251
+ minWidth: `${Te}px`
2252
+ },
2253
+ children: f({ event: v, position: i })
2254
+ },
2255
+ v.id
2256
+ ) : /* @__PURE__ */ e(
2257
+ rt,
2258
+ {
2259
+ event: v,
2260
+ position: {
2261
+ top: i.top,
2262
+ left: i.left,
2263
+ width: i.width,
2264
+ minWidth: Te
2265
+ },
2266
+ hourHeight: he,
2267
+ badgeVariant: b,
2268
+ onClick: u,
2269
+ disablePopover: !!u && !y,
2270
+ renderPopover: y,
2271
+ className: s("pointer-events-auto", c?.eventCard)
2272
+ },
2273
+ v.id
2274
+ );
2275
+ })
2276
+ }
2277
+ ),
2278
+ T && M >= 0 && /* @__PURE__ */ r(
2279
+ "div",
2280
+ {
2281
+ className: s(
2282
+ "absolute left-0 right-0 z-20 flex items-center pointer-events-none",
2283
+ c?.currentTimeIndicator
2284
+ ),
2285
+ style: {
2286
+ top: M,
2287
+ left: Se
2288
+ },
2289
+ children: [
2290
+ /* @__PURE__ */ e("div", { className: "h-2.5 w-2.5 -ml-1 rounded-full bg-red-500" }),
2291
+ /* @__PURE__ */ e("div", { className: "flex-1 h-0.5 bg-red-500" })
2292
+ ]
2293
+ }
2294
+ )
2295
+ ] })
2296
+ }
2297
+ )
2298
+ ] });
2299
+ }
2300
+ const nn = [
2301
+ { full: "Monday", short: "Mon", tiny: "M" },
2302
+ { full: "Tuesday", short: "Tue", tiny: "T" },
2303
+ { full: "Wednesday", short: "Wed", tiny: "W" },
2304
+ { full: "Thursday", short: "Thu", tiny: "T" },
2305
+ { full: "Friday", short: "Fri", tiny: "F" },
2306
+ { full: "Saturday", short: "Sat", tiny: "S" },
2307
+ { full: "Sunday", short: "Sun", tiny: "S" }
2308
+ ], rn = [
2309
+ { full: "Sunday", short: "Sun", tiny: "S" },
2310
+ { full: "Monday", short: "Mon", tiny: "M" },
2311
+ { full: "Tuesday", short: "Tue", tiny: "T" },
2312
+ { full: "Wednesday", short: "Wed", tiny: "W" },
2313
+ { full: "Thursday", short: "Thu", tiny: "T" },
2314
+ { full: "Friday", short: "Fri", tiny: "F" },
2315
+ { full: "Saturday", short: "Sat", tiny: "S" }
2316
+ ], pe = 3;
2317
+ function xn({
2318
+ events: t,
2319
+ date: n,
2320
+ weekStartsOn: o = 1,
2321
+ badgeVariant: a = "colored",
2322
+ onEventClick: l,
2323
+ onSlotSelect: b,
2324
+ onDayClick: u,
2325
+ className: h,
2326
+ renderEvent: C,
2327
+ renderPopover: f,
2328
+ showMoreMode: y,
2329
+ showMoreEventsInPopover: S = !1,
2330
+ slots: c,
2331
+ classNames: x
2332
+ }) {
2333
+ const d = y ?? (S ? "popover" : "expand"), w = c?.dayCellHeader, A = c?.dayCellFooter, [P, z] = X(null), [L, R] = X(null), _ = V(() => ft(n, o), [n, o]), T = V(() => {
2334
+ const g = /* @__PURE__ */ new Map();
2335
+ for (const E of _) {
2336
+ const H = E.date.toDateString(), O = Ie(t, E.date);
2337
+ O.sort((v, i) => v.startDate.getTime() - i.startDate.getTime()), g.set(H, O);
2338
+ }
2339
+ return g;
2340
+ }, [_, t]), M = He(), $ = W(
2341
+ (g) => {
2342
+ M?.startSelection(g);
2343
+ },
2344
+ [M]
2345
+ ), k = W(
2346
+ (g) => {
2347
+ M?.updateSelection(g);
2348
+ },
2349
+ [M]
2350
+ ), B = W(() => {
2351
+ M?.endSelection();
2352
+ }, [M]), q = W(
2353
+ (g) => {
2354
+ u?.(g);
2355
+ },
2356
+ [u]
2357
+ ), p = o === 0 ? rn : nn;
2358
+ return /* @__PURE__ */ r("div", { className: s("flex flex-col h-full overflow-hidden", h), children: [
2359
+ /* @__PURE__ */ e("div", { className: "flex flex-col flex-1 overflow-auto", children: /* @__PURE__ */ r("div", { className: "flex flex-col flex-1 min-w-[560px] sm:min-w-0", children: [
2360
+ /* @__PURE__ */ e(
2361
+ "div",
2362
+ {
2363
+ className: s(
2364
+ "grid grid-cols-7 border-b !sticky !top-0 bg-background z-10",
2365
+ x?.weekdayHeader
2366
+ ),
2367
+ children: p.map((g, E) => /* @__PURE__ */ r(
2368
+ "div",
2369
+ {
2370
+ className: s(
2371
+ "py-2 sm:py-2.5 text-center text-[11px] uppercase font-medium tracking-wide text-muted-foreground",
2372
+ E >= 5 && "text-muted-foreground/70",
2373
+ // Weekend
2374
+ x?.weekdayLabel
2375
+ ),
2376
+ children: [
2377
+ /* @__PURE__ */ e("span", { className: "sm:hidden", children: g.short }),
2378
+ /* @__PURE__ */ e("span", { className: "hidden sm:inline", children: g.short })
2379
+ ]
2380
+ },
2381
+ g.full
2382
+ ))
2383
+ }
2384
+ ),
2385
+ /* @__PURE__ */ e("div", { className: s("grid grid-cols-7 auto-rows-min", x?.monthGrid), children: _.map((g) => {
2386
+ const E = g.date.toDateString(), H = T.get(E) || [], O = oe(g.date), v = g.date.getDay() === 0 || g.date.getDay() === 6, i = H.length > pe;
2387
+ return /* @__PURE__ */ r(
2388
+ tn,
2389
+ {
2390
+ date: g.date,
2391
+ dataAttributes: { "data-day-key": E },
2392
+ onSelectionStart: $,
2393
+ onSelectionMove: k,
2394
+ onSelectionEnd: B,
2395
+ isSelected: M?.isSlotSelected({ date: g.date }) ?? !1,
2396
+ isSelecting: M?.isSelecting ?? !1,
2397
+ className: s(
2398
+ "relative flex flex-col border-r border-b text-left min-h-[80px] sm:min-h-[100px] overflow-hidden",
2399
+ "[&:nth-child(7n)]:border-r-0",
2400
+ !g.isCurrentMonth && "bg-muted/20",
2401
+ v && g.isCurrentMonth && "bg-muted/10",
2402
+ x?.dayCell,
2403
+ O && x?.dayCellToday,
2404
+ !g.isCurrentMonth && x?.dayCellOutside,
2405
+ v && x?.dayCellWeekend
2406
+ ),
2407
+ ariaLabel: `${g.date.toLocaleDateString()} - ${H.length} events. Click to create event, double-click to view day.`,
2408
+ children: [
2409
+ /* @__PURE__ */ e(
2410
+ "div",
2411
+ {
2412
+ className: s(
2413
+ "flex items-center justify-center p-1",
2414
+ !g.isCurrentMonth && "text-muted-foreground/40",
2415
+ x?.dayCellNumber
2416
+ ),
2417
+ children: /* @__PURE__ */ e(
2418
+ "button",
2419
+ {
2420
+ type: "button",
2421
+ onClick: (m) => {
2422
+ m.stopPropagation(), q(g.date);
2423
+ },
2424
+ className: s(
2425
+ "flex items-center justify-center rounded-full transition-colors",
2426
+ "size-7 text-sm font-normal",
2427
+ O ? "bg-primary text-primary-foreground" : "hover:bg-muted"
2428
+ ),
2429
+ children: g.date.getDate()
2430
+ }
2431
+ )
2432
+ }
2433
+ ),
2434
+ w && /* @__PURE__ */ e(
2435
+ w,
2436
+ {
2437
+ date: g.date,
2438
+ events: H,
2439
+ isToday: O,
2440
+ isCurrentMonth: g.isCurrentMonth,
2441
+ isWeekend: v,
2442
+ view: "month"
2443
+ }
2444
+ ),
2445
+ /* @__PURE__ */ r(
2446
+ "div",
2447
+ {
2448
+ className: s(
2449
+ "flex-1 overflow-hidden px-2 pt-1 pb-1 space-y-1",
2450
+ x?.dayCellContent
2451
+ ),
2452
+ children: [
2453
+ H.slice(0, pe).map((m) => /* @__PURE__ */ e(
2454
+ "div",
2455
+ {
2456
+ onPointerDown: (N) => {
2457
+ N.stopPropagation();
2458
+ },
2459
+ children: C ? C({ event: m, variant: "compact" }) : /* @__PURE__ */ e(
2460
+ De,
2461
+ {
2462
+ event: m,
2463
+ variant: "compact",
2464
+ badgeVariant: a,
2465
+ onClick: l,
2466
+ disablePopover: !!l && !f,
2467
+ renderPopover: f,
2468
+ showTime: !1,
2469
+ enableDrag: !0,
2470
+ ...x?.eventCardCompact && {
2471
+ className: x.eventCardCompact
2472
+ }
2473
+ }
2474
+ )
2475
+ },
2476
+ m.id
2477
+ )),
2478
+ i && d === "expand" && /* @__PURE__ */ r(
2479
+ "button",
2480
+ {
2481
+ type: "button",
2482
+ onPointerDown: (m) => m.stopPropagation(),
2483
+ onClick: (m) => {
2484
+ m.stopPropagation();
2485
+ const N = document.querySelector(`[data-day-key="${E}"]`);
2486
+ R({
2487
+ date: g.date,
2488
+ events: H,
2489
+ rect: N?.getBoundingClientRect() ?? new DOMRect(window.innerWidth / 2 - 180, window.innerHeight / 2 - 240, 0, 0)
2490
+ });
2491
+ },
2492
+ className: s(
2493
+ "w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",
2494
+ x?.moreEventsIndicator
2495
+ ),
2496
+ children: [
2497
+ "+",
2498
+ H.length - pe,
2499
+ " more"
2500
+ ]
2501
+ }
2502
+ ),
2503
+ i && d === "popover" && /* @__PURE__ */ r(
2504
+ ae,
2505
+ {
2506
+ open: P === E,
2507
+ onOpenChange: (m) => z(m ? E : null),
2508
+ children: [
2509
+ /* @__PURE__ */ e(ie, { asChild: !0, children: /* @__PURE__ */ r(
2510
+ "button",
2511
+ {
2512
+ type: "button",
2513
+ onPointerDown: (m) => m.stopPropagation(),
2514
+ onClick: (m) => {
2515
+ m.stopPropagation(), z(E);
2516
+ },
2517
+ className: s(
2518
+ "w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",
2519
+ x?.moreEventsIndicator
2520
+ ),
2521
+ children: [
2522
+ "+",
2523
+ H.length - pe,
2524
+ " more"
2525
+ ]
2526
+ }
2527
+ ) }),
2528
+ /* @__PURE__ */ r(
2529
+ ne,
2530
+ {
2531
+ align: "start",
2532
+ side: "right",
2533
+ sideOffset: 8,
2534
+ className: "w-72 max-h-80 overflow-y-auto p-2",
2535
+ onPointerDown: (m) => m.stopPropagation(),
2536
+ children: [
2537
+ /* @__PURE__ */ r("div", { className: "flex items-center justify-between mb-2 pb-2 border-b", children: [
2538
+ /* @__PURE__ */ e("span", { className: "text-sm font-medium", children: g.date.toLocaleDateString(void 0, {
2539
+ weekday: "short",
2540
+ month: "short",
2541
+ day: "numeric"
2542
+ }) }),
2543
+ /* @__PURE__ */ r("span", { className: "text-xs text-muted-foreground", children: [
2544
+ H.length,
2545
+ " events"
2546
+ ] })
2547
+ ] }),
2548
+ /* @__PURE__ */ e("div", { className: "space-y-1.5", children: H.map((m) => /* @__PURE__ */ e("div", { children: C ? C({ event: m, variant: "compact" }) : /* @__PURE__ */ e(
2549
+ De,
2550
+ {
2551
+ event: m,
2552
+ variant: "compact",
2553
+ badgeVariant: a,
2554
+ onClick: (N) => {
2555
+ z(null), l?.(N);
2556
+ },
2557
+ disablePopover: !!l && !f,
2558
+ renderPopover: f,
2559
+ showTime: !0
2560
+ }
2561
+ ) }, m.id)) })
2562
+ ]
2563
+ }
2564
+ )
2565
+ ]
2566
+ }
2567
+ ),
2568
+ i && d === "dayView" && /* @__PURE__ */ r(
2569
+ "div",
2570
+ {
2571
+ onPointerDown: (m) => {
2572
+ m.stopPropagation(), q(g.date);
2573
+ },
2574
+ className: s(
2575
+ "w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",
2576
+ x?.moreEventsIndicator
2577
+ ),
2578
+ children: [
2579
+ "+",
2580
+ H.length - pe,
2581
+ " more"
2582
+ ]
2583
+ }
2584
+ )
2585
+ ]
2586
+ }
2587
+ ),
2588
+ A && /* @__PURE__ */ e(
2589
+ A,
2590
+ {
2591
+ date: g.date,
2592
+ events: H,
2593
+ isToday: O,
2594
+ isCurrentMonth: g.isCurrentMonth,
2595
+ isWeekend: v,
2596
+ view: "month"
2597
+ }
2598
+ )
2599
+ ]
2600
+ },
2601
+ E
2602
+ );
2603
+ }) })
2604
+ ] }) }),
2605
+ /* @__PURE__ */ e(
2606
+ Qt,
2607
+ {
2608
+ isOpen: L !== null,
2609
+ onClose: () => R(null),
2610
+ date: L?.date ?? /* @__PURE__ */ new Date(),
2611
+ events: L?.events ?? [],
2612
+ anchorRect: L?.rect ?? null,
2613
+ badgeVariant: a,
2614
+ onEventClick: l,
2615
+ renderEvent: C,
2616
+ renderPopover: f
2617
+ }
2618
+ )
2619
+ ] });
2620
+ }
2621
+ const le = 96, we = 56, Je = 72, Q = 120, ve = 100, on = 3;
2622
+ function bn({
2623
+ events: t,
2624
+ date: n,
2625
+ weekStartsOn: o = 1,
2626
+ visibleHours: a = { startHour: 0, endHour: 24 },
2627
+ workingHours: l,
2628
+ slotDuration: b = 30,
2629
+ badgeVariant: u = "colored",
2630
+ onEventClick: h,
2631
+ onSlotSelect: C,
2632
+ onDayClick: f,
2633
+ className: y,
2634
+ renderEvent: S,
2635
+ renderPopover: c,
2636
+ slots: x,
2637
+ classNames: d
2638
+ }) {
2639
+ const w = 60 / b, A = 100 / w, P = V(() => {
2640
+ const i = [];
2641
+ for (let m = 0; m < w; m++)
2642
+ i.push(m * b);
2643
+ return i;
2644
+ }, [w, b]), z = V(
2645
+ () => gt(n, o),
2646
+ [n, o]
2647
+ ), L = V(
2648
+ () => et(a),
2649
+ [a]
2650
+ ), R = V(() => {
2651
+ const i = /* @__PURE__ */ new Map();
2652
+ for (const m of z) {
2653
+ const N = m.toDateString(), I = Ie(t, m), { singleDay: D, multiDay: Y } = Ze(I), j = Qe(
2654
+ D,
2655
+ m,
2656
+ a,
2657
+ le
2658
+ ), G = /* @__PURE__ */ new Map();
2659
+ let U = 1;
2660
+ for (const K of j)
2661
+ if (G.set(K.event.id, K.position), K.position.width > 0) {
2662
+ const te = Math.round(100 / K.position.width);
2663
+ U = Math.max(U, te);
2664
+ }
2665
+ i.set(N, {
2666
+ singleDay: D,
2667
+ multiDay: Y,
2668
+ positions: G,
2669
+ maxOverlapping: U
2670
+ });
2671
+ }
2672
+ return i;
2673
+ }, [z, t, a]), _ = V(() => {
2674
+ const i = /* @__PURE__ */ new Map();
2675
+ for (const { multiDay: m } of R.values())
2676
+ for (const N of m)
2677
+ i.set(N.id, N);
2678
+ return Array.from(i.values());
2679
+ }, [R]), T = /* @__PURE__ */ new Date(), M = z.findIndex((i) => oe(i)), $ = V(() => {
2680
+ if (M < 0) return -1;
2681
+ const i = T.getHours() + T.getMinutes() / 60;
2682
+ return i < a.startHour || i > a.endHour ? -1 : (i - a.startHour) * le;
2683
+ }, [M, a, T]), k = ee(null);
2684
+ Be(() => {
2685
+ const i = k.current;
2686
+ if (!i) return;
2687
+ const m = () => {
2688
+ let N;
2689
+ if (M !== -1) {
2690
+ const D = (/* @__PURE__ */ new Date()).getHours();
2691
+ N = Math.max(D - 1, a.startHour);
2692
+ } else {
2693
+ const Y = (/* @__PURE__ */ new Date()).getDay();
2694
+ let j = l?.[Y];
2695
+ if (!j?.enabled || j.from === 0) {
2696
+ const G = l?.[1];
2697
+ G?.enabled && (j = G);
2698
+ }
2699
+ j?.enabled && j.from > 0 ? N = Math.max(
2700
+ j.from - 1,
2701
+ a.startHour
2702
+ ) : N = Math.max(7, a.startHour);
2703
+ }
2704
+ const I = (N - a.startHour) * le;
2705
+ i.scrollTo({
2706
+ top: I,
2707
+ behavior: "instant"
2708
+ });
2709
+ };
2710
+ requestAnimationFrame(() => {
2711
+ requestAnimationFrame(m);
2712
+ });
2713
+ }, [n, l, a, M]);
2714
+ const B = He(), q = W(
2715
+ (i) => {
2716
+ B?.startSelection(i);
2717
+ },
2718
+ [B]
2719
+ ), p = W(
2720
+ (i) => {
2721
+ B?.updateSelection(i);
2722
+ },
2723
+ [B]
2724
+ ), g = W(() => {
2725
+ B?.endSelection();
2726
+ }, [B]), E = W(
2727
+ (i) => {
2728
+ h?.(i);
2729
+ },
2730
+ [h]
2731
+ ), H = we + 7 * Q, O = V(() => {
2732
+ const i = [];
2733
+ for (const m of z) {
2734
+ const N = m.toDateString(), D = R.get(N)?.maxOverlapping ?? 1;
2735
+ D > on ? i.push(
2736
+ Math.max(Q, D * ve)
2737
+ ) : i.push(Q);
2738
+ }
2739
+ return i;
2740
+ }, [z, R]), v = we + O.reduce((i, m) => i + m, 0);
2741
+ return /* @__PURE__ */ r("div", { className: s("ic-week-view flex flex-col h-full", y), children: [
2742
+ _.length > 0 && /* @__PURE__ */ e(
2743
+ it,
2744
+ {
2745
+ events: _,
2746
+ date: xt(n, o),
2747
+ onEventClick: E,
2748
+ ...d?.multiDayBanner && {
2749
+ className: d.multiDayBanner
2750
+ }
2751
+ }
2752
+ ),
2753
+ /* @__PURE__ */ e(
2754
+ "div",
2755
+ {
2756
+ ref: k,
2757
+ className: s(
2758
+ "ic-week-scroll-container flex-1",
2759
+ d?.scrollContainer
2760
+ ),
2761
+ children: /* @__PURE__ */ r("div", { style: { minWidth: Math.max(H, v) }, children: [
2762
+ /* @__PURE__ */ e("div", { className: "ic-week-header sticky top-0 z-20 border-b bg-background", children: /* @__PURE__ */ r("div", { className: "flex", children: [
2763
+ /* @__PURE__ */ e(
2764
+ "div",
2765
+ {
2766
+ className: "flex-shrink-0 flex items-end justify-center pb-2 text-[10px] text-muted-foreground/70",
2767
+ style: { width: we, height: Je },
2768
+ children: /* @__PURE__ */ r("span", { className: "hidden sm:inline", children: [
2769
+ "GMT",
2770
+ (() => {
2771
+ const i = (/* @__PURE__ */ new Date()).getTimezoneOffset(), m = Math.abs(Math.floor(i / 60)), N = i <= 0 ? "+" : "-";
2772
+ return m > 0 ? `${N}${String(m).padStart(2, "0")}` : "";
2773
+ })()
2774
+ ] })
2775
+ }
2776
+ ),
2777
+ z.map((i, m) => {
2778
+ const N = oe(i), I = O[m] ?? Q, D = I > Q;
2779
+ return /* @__PURE__ */ r(
2780
+ "div",
2781
+ {
2782
+ className: s(
2783
+ "flex-1 flex flex-col items-center justify-center border-r last:border-r-0 py-2",
2784
+ d?.columnHeader,
2785
+ N && d?.columnHeaderToday
2786
+ ),
2787
+ style: {
2788
+ height: Je,
2789
+ minWidth: D ? I : Q
2790
+ },
2791
+ children: [
2792
+ /* @__PURE__ */ e(
2793
+ "span",
2794
+ {
2795
+ className: s(
2796
+ "text-[11px] font-medium uppercase tracking-wide",
2797
+ N ? "text-primary" : "text-muted-foreground"
2798
+ ),
2799
+ children: i.toLocaleDateString([], { weekday: "short" })
2800
+ }
2801
+ ),
2802
+ /* @__PURE__ */ e(
2803
+ "button",
2804
+ {
2805
+ type: "button",
2806
+ onClick: () => f?.(i),
2807
+ className: s(
2808
+ "flex items-center justify-center rounded-full transition-colors mt-0.5",
2809
+ "size-10 text-2xl font-normal",
2810
+ N ? "bg-primary text-primary-foreground" : "text-foreground hover:bg-muted"
2811
+ ),
2812
+ children: i.getDate()
2813
+ }
2814
+ )
2815
+ ]
2816
+ },
2817
+ i.toDateString()
2818
+ );
2819
+ })
2820
+ ] }) }),
2821
+ /* @__PURE__ */ r("div", { className: "relative flex", children: [
2822
+ /* @__PURE__ */ e(
2823
+ "div",
2824
+ {
2825
+ className: s(
2826
+ "ic-hour-column sticky left-0 z-10 bg-zinc-50 border-r",
2827
+ d?.timeGutter
2828
+ ),
2829
+ style: { width: we },
2830
+ children: L.map((i, m) => /* @__PURE__ */ e(
2831
+ "div",
2832
+ {
2833
+ className: "relative",
2834
+ style: { height: le },
2835
+ children: /* @__PURE__ */ e("div", { className: "absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center", children: m !== 0 && /* @__PURE__ */ e(
2836
+ "span",
2837
+ {
2838
+ className: s(
2839
+ "text-[10px] sm:text-xs text-muted-foreground",
2840
+ d?.timeGutterLabel
2841
+ ),
2842
+ children: ke(i)
2843
+ }
2844
+ ) })
2845
+ },
2846
+ i
2847
+ ))
2848
+ }
2849
+ ),
2850
+ /* @__PURE__ */ e("div", { className: "ic-week-grid relative flex-1", children: /* @__PURE__ */ e("div", { className: "flex divide-x", children: z.map((i, m) => {
2851
+ const N = i.toDateString(), I = R.get(N), D = O[m] ?? Q, Y = D > Q;
2852
+ return /* @__PURE__ */ r(
2853
+ "div",
2854
+ {
2855
+ className: "ic-day-column relative flex-1",
2856
+ style: {
2857
+ minWidth: Y ? D : Q
2858
+ },
2859
+ children: [
2860
+ L.map((j, G) => {
2861
+ const K = !tt(
2862
+ i,
2863
+ j,
2864
+ l
2865
+ );
2866
+ return /* @__PURE__ */ r(
2867
+ "div",
2868
+ {
2869
+ className: s(
2870
+ "relative",
2871
+ K && "bg-calendar-disabled-hour",
2872
+ oe(i) && !K && "bg-primary/5",
2873
+ d?.timeSlot,
2874
+ K ? d?.timeSlotNonWorking : d?.timeSlotWorking
2875
+ ),
2876
+ style: { height: le },
2877
+ children: [
2878
+ G !== 0 && /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-x-0 top-0 border-b border-border/50" }),
2879
+ P.slice(1).map((te) => /* @__PURE__ */ e(
2880
+ "div",
2881
+ {
2882
+ className: "pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",
2883
+ style: { top: `${te / 60 * 100}%` }
2884
+ },
2885
+ te
2886
+ )),
2887
+ P.map((te, dt) => {
2888
+ const Oe = {
2889
+ date: i,
2890
+ hour: j,
2891
+ minute: te
2892
+ };
2893
+ return /* @__PURE__ */ e(
2894
+ lt,
2895
+ {
2896
+ slot: Oe,
2897
+ onSelectionStart: q,
2898
+ onSelectionMove: p,
2899
+ onSelectionEnd: g,
2900
+ isSelected: B?.isSlotSelected(Oe) ?? !1,
2901
+ isSelecting: B?.isSelecting ?? !1,
2902
+ disabled: K,
2903
+ className: "absolute inset-x-0",
2904
+ style: {
2905
+ top: `${dt * A}%`,
2906
+ height: `${A}%`
2907
+ },
2908
+ ariaLabel: `Add event on ${i.toLocaleDateString()} at ${ke(j)}:${String(te).padStart(2, "0")}`
2909
+ },
2910
+ te
2911
+ );
2912
+ })
2913
+ ]
2914
+ },
2915
+ j
2916
+ );
2917
+ }),
2918
+ I?.singleDay.map((j) => {
2919
+ const G = I.positions.get(j.id);
2920
+ if (!G) return null;
2921
+ const U = `calc(${G.width}% - 2px)`, K = `max(${ve}px, ${U})`;
2922
+ return S ? /* @__PURE__ */ e(
2923
+ "div",
2924
+ {
2925
+ className: "absolute pointer-events-auto p-0.5",
2926
+ style: {
2927
+ top: `${G.top}px`,
2928
+ left: `${G.left}%`,
2929
+ width: K,
2930
+ minWidth: `${ve}px`
2931
+ },
2932
+ children: S({ event: j, position: G })
2933
+ },
2934
+ j.id
2935
+ ) : /* @__PURE__ */ e(
2936
+ rt,
2937
+ {
2938
+ event: j,
2939
+ position: {
2940
+ top: G.top,
2941
+ left: G.left,
2942
+ width: G.width,
2943
+ minWidth: ve
2944
+ },
2945
+ hourHeight: le,
2946
+ badgeVariant: u,
2947
+ onClick: h,
2948
+ disablePopover: !!h && !c,
2949
+ renderPopover: c,
2950
+ className: s(
2951
+ "pointer-events-auto",
2952
+ d?.eventCard
2953
+ )
2954
+ },
2955
+ j.id
2956
+ );
2957
+ }),
2958
+ m === M && $ >= 0 && /* @__PURE__ */ r(
2959
+ "div",
2960
+ {
2961
+ className: s(
2962
+ "absolute left-0 right-0 z-20 flex items-center pointer-events-none",
2963
+ d?.currentTimeIndicator
2964
+ ),
2965
+ style: { top: $ },
2966
+ children: [
2967
+ /* @__PURE__ */ e("div", { className: "h-2 w-2 -ml-1 rounded-full bg-red-500" }),
2968
+ /* @__PURE__ */ e("div", { className: "flex-1 h-0.5 bg-red-500" })
2969
+ ]
2970
+ }
2971
+ )
2972
+ ]
2973
+ },
2974
+ i.toDateString()
2975
+ );
2976
+ }) }) })
2977
+ ] })
2978
+ ] })
2979
+ }
2980
+ )
2981
+ ] });
2982
+ }
2983
+ export {
2984
+ fn as A,
2985
+ ue as B,
2986
+ pn as C,
2987
+ Ft as D,
2988
+ rt as E,
2989
+ xn as M,
2990
+ ae as P,
2991
+ lt as T,
2992
+ bn as W,
2993
+ Qt as a,
2994
+ tn as b,
2995
+ gn as c,
2996
+ De as d,
2997
+ it as e,
2998
+ hn as f,
2999
+ un as g,
3000
+ ne as h,
3001
+ ie as i,
3002
+ Gt as j,
3003
+ de as k,
3004
+ re as l,
3005
+ mn as m,
3006
+ ce as n,
3007
+ wt as o,
3008
+ xe as p,
3009
+ Ue as q,
3010
+ qe as r,
3011
+ _e as s,
3012
+ Ee as t,
3013
+ Pt as u
3014
+ };
3015
+ //# sourceMappingURL=week-view-BGthazCB.js.map