@innosolutions/inno-calendar 1.0.39 → 1.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agenda-widget-KlPk6TpL.cjs → agenda-widget-B5Sgvvry.cjs} +2 -2
- package/dist/{agenda-widget-KlPk6TpL.cjs.map → agenda-widget-B5Sgvvry.cjs.map} +1 -1
- package/dist/{agenda-widget-Yj5oCSdd.js → agenda-widget-C5uR9Raa.js} +2 -2
- package/dist/{agenda-widget-Yj5oCSdd.js.map → agenda-widget-C5uR9Raa.js.map} +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/components/primitives/index.d.ts +1 -0
- package/dist/components/primitives/index.d.ts.map +1 -1
- package/dist/components/primitives/multi-day-banner.d.ts +17 -3
- package/dist/components/primitives/multi-day-banner.d.ts.map +1 -1
- package/dist/components/primitives/week-all-day-row.d.ts +40 -0
- package/dist/components/primitives/week-all-day-row.d.ts.map +1 -0
- package/dist/components/views/day-view.d.ts.map +1 -1
- package/dist/components/views/week-view.d.ts.map +1 -1
- package/dist/core/utils/date-utils.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +3 -3
- package/dist/presets/index.cjs +1 -1
- package/dist/presets/index.mjs +1 -1
- package/dist/{tailwind-calendar-BqhSHRk0.cjs → tailwind-calendar-B2vvMCsL.cjs} +2 -2
- package/dist/{tailwind-calendar-BqhSHRk0.cjs.map → tailwind-calendar-B2vvMCsL.cjs.map} +1 -1
- package/dist/{tailwind-calendar-BvWm9ry9.js → tailwind-calendar-C1_6GoL0.js} +2 -2
- package/dist/{tailwind-calendar-BvWm9ry9.js.map → tailwind-calendar-C1_6GoL0.js.map} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.mjs +12 -11
- package/dist/utils.mjs.map +1 -1
- package/dist/week-view-DBsCYSce.cjs +11 -0
- package/dist/week-view-DBsCYSce.cjs.map +1 -0
- package/dist/{week-view-BGthazCB.js → week-view-Dh-gHd0m.js} +1486 -1189
- package/dist/week-view-Dh-gHd0m.js.map +1 -0
- package/package.json +1 -1
- package/dist/week-view-BGthazCB.js.map +0 -1
- package/dist/week-view-DOvr2VIq.cjs +0 -11
- package/dist/week-view-DOvr2VIq.cjs.map +0 -1
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { jsx as e, jsxs as r, Fragment as
|
|
2
|
-
import * as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { c as
|
|
5
|
-
import * as
|
|
6
|
-
import { formatEventTimeDisplay as
|
|
7
|
-
import { a as
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
const
|
|
11
|
-
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as pt } from "react/jsx-runtime";
|
|
2
|
+
import * as ee from "react";
|
|
3
|
+
import { useState as J, useCallback as L, useRef as te, forwardRef as $e, createElement as We, useMemo as F, useLayoutEffect as Ie, useEffect as Ae } from "react";
|
|
4
|
+
import { c as d, a as ft } from "./index-DtaLkIY8.js";
|
|
5
|
+
import * as V from "@radix-ui/react-dropdown-menu";
|
|
6
|
+
import { formatEventTimeDisplay as X, getEventsCountInView as gt, getRangeText as xt, groupEventsByDate as yt, isToday as ce, detectAllDayEvent as De, isSameDay as le, getEventsForDay as He, separateEventsByDuration as rt, calculateOverlappingPositions as ot, getVisibleHoursArray as at, isWorkingHour as it, formatHourLabel as Ce, generateMonthGrid as bt, startOfDay as Ge, getWeekDays as wt } from "./utils.mjs";
|
|
7
|
+
import { a as Re, b as je } from "./slot-selection-context-D2eu2o-7.js";
|
|
8
|
+
import * as he from "@radix-ui/react-popover";
|
|
9
|
+
import * as ye from "@radix-ui/react-tooltip";
|
|
10
|
+
const re = he.Root, oe = he.Trigger, vn = he.Anchor, Q = ee.forwardRef(({ className: t, align: n = "center", sideOffset: o = 4, ...a }, i) => /* @__PURE__ */ e(he.Portal, { children: /* @__PURE__ */ e(
|
|
11
|
+
he.Content,
|
|
12
12
|
{
|
|
13
|
-
ref:
|
|
13
|
+
ref: i,
|
|
14
14
|
align: n,
|
|
15
15
|
sideOffset: o,
|
|
16
|
-
className:
|
|
16
|
+
className: d(
|
|
17
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
18
|
t
|
|
19
19
|
),
|
|
20
20
|
...a
|
|
21
21
|
}
|
|
22
22
|
) }));
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
Q.displayName = he.Content.displayName;
|
|
24
|
+
const Nn = ye.Provider, ie = ye.Root, se = ye.Trigger, ne = ee.forwardRef(({ className: t, sideOffset: n = 4, ...o }, a) => /* @__PURE__ */ e(
|
|
25
|
+
ye.Content,
|
|
26
26
|
{
|
|
27
27
|
ref: a,
|
|
28
28
|
sideOffset: n,
|
|
29
|
-
className:
|
|
29
|
+
className: d(
|
|
30
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
31
|
t
|
|
32
32
|
),
|
|
33
33
|
...o
|
|
34
34
|
}
|
|
35
35
|
));
|
|
36
|
-
|
|
37
|
-
function
|
|
36
|
+
ne.displayName = ye.Content.displayName;
|
|
37
|
+
function de(t) {
|
|
38
38
|
return {
|
|
39
39
|
blue: {
|
|
40
40
|
bg: "bg-blue-50 dark:bg-blue-950/30",
|
|
@@ -118,79 +118,79 @@ function xe(t) {
|
|
|
118
118
|
}
|
|
119
119
|
}[t ?? "blue"];
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function Oe(t) {
|
|
122
122
|
const n = new Date(t);
|
|
123
123
|
return n.setHours(0, 0, 0, 0), n;
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Se({
|
|
126
126
|
event: t,
|
|
127
127
|
variant: n = "full",
|
|
128
128
|
badgeVariant: o = "colored",
|
|
129
129
|
onClick: a,
|
|
130
|
-
className:
|
|
131
|
-
showTime:
|
|
132
|
-
showDescription:
|
|
133
|
-
showParticipants:
|
|
134
|
-
style:
|
|
135
|
-
disablePopover:
|
|
136
|
-
renderPopover:
|
|
137
|
-
enableDrag:
|
|
138
|
-
enablePageTransition:
|
|
139
|
-
pageTransitionDuration:
|
|
130
|
+
className: i,
|
|
131
|
+
showTime: p = !0,
|
|
132
|
+
showDescription: s = !1,
|
|
133
|
+
showParticipants: y = !1,
|
|
134
|
+
style: k,
|
|
135
|
+
disablePopover: l = !1,
|
|
136
|
+
renderPopover: b,
|
|
137
|
+
enableDrag: N = !1,
|
|
138
|
+
enablePageTransition: m = !1,
|
|
139
|
+
pageTransitionDuration: g = 400
|
|
140
140
|
}) {
|
|
141
|
-
const
|
|
142
|
-
if (!
|
|
143
|
-
if (
|
|
141
|
+
const u = de(t.color), [w, v] = J(!1), [W, T] = J(!1), [A, j] = J(!1), [E, _] = J(null), M = te(null), I = Re(), S = t.endDate < Oe(/* @__PURE__ */ new Date()), $ = t.isCanceled ?? !1, q = N && I && !$ && !S, f = t.data, x = f?.meetingTookPlace ?? t.meetingTookPlace ?? !1, B = $ ? /* @__PURE__ */ e(Nt, { className: "h-3 w-3 text-zinc-800 dark:text-zinc-200" }) : x ? /* @__PURE__ */ e(vt, { className: d("h-3 w-3", u.text) }) : null, R = t.scheduleTypeName || f?.scheduleTypeName || f?.typeName, P = f?.productName, D = f?.nrParticipant, c = f?.siteName, h = f?.siteCity, C = [c, h].filter(Boolean).join(", "), H = L(() => {
|
|
142
|
+
if (!W) {
|
|
143
|
+
if (l && a) {
|
|
144
144
|
a(t);
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
if (
|
|
147
|
+
if (m && M.current) {
|
|
148
148
|
const U = M.current.getBoundingClientRect();
|
|
149
|
-
|
|
150
|
-
} else
|
|
149
|
+
_(U), j(!0);
|
|
150
|
+
} else l || v(!0);
|
|
151
151
|
}
|
|
152
|
-
}, [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}, [
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
}, []), Y =
|
|
152
|
+
}, [W, l, a, t, m]);
|
|
153
|
+
L(() => {
|
|
154
|
+
j(!1), _(null), l || v(!0);
|
|
155
|
+
}, [l]);
|
|
156
|
+
const z = L(() => {
|
|
157
|
+
v(!1);
|
|
158
|
+
}, []), Y = L(
|
|
159
159
|
(U) => {
|
|
160
|
-
q && (U.dataTransfer.effectAllowed = "move", U.dataTransfer.setData("text/plain", t.id),
|
|
160
|
+
q && (U.dataTransfer.effectAllowed = "move", U.dataTransfer.setData("text/plain", t.id), T(!0), I?.startDrag?.(t));
|
|
161
161
|
},
|
|
162
|
-
[q, t,
|
|
163
|
-
),
|
|
164
|
-
|
|
165
|
-
}, [
|
|
162
|
+
[q, t, I]
|
|
163
|
+
), O = L(() => {
|
|
164
|
+
T(!1), I?.isDragging && I.endDrag?.();
|
|
165
|
+
}, [I]);
|
|
166
166
|
if (n === "dot") {
|
|
167
167
|
const U = /* @__PURE__ */ e(
|
|
168
168
|
"button",
|
|
169
169
|
{
|
|
170
170
|
type: "button",
|
|
171
|
-
onClick:
|
|
172
|
-
className:
|
|
171
|
+
onClick: H,
|
|
172
|
+
className: d(
|
|
173
173
|
"size-2 rounded-full cursor-pointer transition-opacity",
|
|
174
|
-
|
|
174
|
+
S ? "bg-gray-400" : u.dot,
|
|
175
175
|
t.isCanceled && "opacity-50",
|
|
176
|
-
|
|
176
|
+
i
|
|
177
177
|
),
|
|
178
|
-
style:
|
|
178
|
+
style: k,
|
|
179
179
|
"aria-label": t.title
|
|
180
180
|
}
|
|
181
181
|
);
|
|
182
|
-
return
|
|
183
|
-
/* @__PURE__ */ e(
|
|
184
|
-
/* @__PURE__ */ e(
|
|
182
|
+
return l ? /* @__PURE__ */ r(ie, { children: [
|
|
183
|
+
/* @__PURE__ */ e(se, { asChild: !0, children: U }),
|
|
184
|
+
/* @__PURE__ */ e(ne, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
|
|
185
185
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
186
|
-
/* @__PURE__ */ e("div", { className: "text-xs opacity-80", children:
|
|
186
|
+
/* @__PURE__ */ e("div", { className: "text-xs opacity-80", children: X(t) })
|
|
187
187
|
] }) })
|
|
188
|
-
] }) : /* @__PURE__ */ r(
|
|
189
|
-
/* @__PURE__ */ e(
|
|
190
|
-
/* @__PURE__ */ e(
|
|
191
|
-
/* @__PURE__ */ e(
|
|
188
|
+
] }) : /* @__PURE__ */ r(re, { open: w, onOpenChange: v, children: [
|
|
189
|
+
/* @__PURE__ */ e(oe, { asChild: !0, children: /* @__PURE__ */ r(ie, { children: [
|
|
190
|
+
/* @__PURE__ */ e(se, { asChild: !0, children: U }),
|
|
191
|
+
/* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e("div", { className: "font-medium", children: t.title }) })
|
|
192
192
|
] }) }),
|
|
193
|
-
/* @__PURE__ */ e(
|
|
193
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: b ? b({ event: t, onClose: z }) : /* @__PURE__ */ e(xe, { event: t, onClose: z }) })
|
|
194
194
|
] });
|
|
195
195
|
}
|
|
196
196
|
if (n === "compact") {
|
|
@@ -201,27 +201,27 @@ function De({
|
|
|
201
201
|
tabIndex: 0,
|
|
202
202
|
draggable: !!q,
|
|
203
203
|
onDragStart: Y,
|
|
204
|
-
onDragEnd:
|
|
205
|
-
onClick:
|
|
204
|
+
onDragEnd: O,
|
|
205
|
+
onClick: l ? H : void 0,
|
|
206
206
|
onKeyDown: (K) => {
|
|
207
|
-
(K.key === "Enter" || K.key === " ") && (K.preventDefault(),
|
|
207
|
+
(K.key === "Enter" || K.key === " ") && (K.preventDefault(), H());
|
|
208
208
|
},
|
|
209
|
-
className:
|
|
209
|
+
className: d(
|
|
210
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
211
|
q ? "cursor-grab active:cursor-grabbing" : "cursor-pointer",
|
|
212
|
-
|
|
212
|
+
W && "opacity-50",
|
|
213
213
|
// Cancelled events get gray background with strikethrough
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
o === "colored" && [
|
|
217
|
-
o === "mixed" && [
|
|
214
|
+
$ || // Past events get neutral zinc styling
|
|
215
|
+
S ? "bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 line-through" : [
|
|
216
|
+
o === "colored" && [u.bg, u.text],
|
|
217
|
+
o === "mixed" && [u.bg, u.text],
|
|
218
218
|
o === "dot" && "bg-muted/50"
|
|
219
219
|
],
|
|
220
|
-
|
|
220
|
+
i
|
|
221
221
|
),
|
|
222
|
-
style:
|
|
222
|
+
style: k,
|
|
223
223
|
children: [
|
|
224
|
-
["dot", "mixed"].includes(o) && !
|
|
224
|
+
["dot", "mixed"].includes(o) && !S && /* @__PURE__ */ e(
|
|
225
225
|
"svg",
|
|
226
226
|
{
|
|
227
227
|
width: "8",
|
|
@@ -230,7 +230,7 @@ function De({
|
|
|
230
230
|
className: "event-dot absolute -top-1 -left-1 shrink-0",
|
|
231
231
|
"aria-hidden": "true",
|
|
232
232
|
focusable: "false",
|
|
233
|
-
children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className:
|
|
233
|
+
children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className: u.dotFill })
|
|
234
234
|
}
|
|
235
235
|
),
|
|
236
236
|
/* @__PURE__ */ e("span", { className: "flex-1 min-w-0 overflow-hidden", children: /* @__PURE__ */ r("span", { className: "", children: [
|
|
@@ -253,60 +253,60 @@ function De({
|
|
|
253
253
|
/* @__PURE__ */ e(
|
|
254
254
|
"div",
|
|
255
255
|
{
|
|
256
|
-
className:
|
|
256
|
+
className: d(
|
|
257
257
|
"w-fit mt-0.5 text-[10px] px-1 py-0.5 border border-dashed rounded-full font-medium",
|
|
258
|
-
|
|
258
|
+
S ? "border-zinc-400 dark:border-zinc-600" : u.border
|
|
259
259
|
),
|
|
260
|
-
children:
|
|
260
|
+
children: X(t)
|
|
261
261
|
}
|
|
262
262
|
)
|
|
263
263
|
] }) }),
|
|
264
|
-
/* @__PURE__ */ e("div", { className: "flex gap-0.5", children:
|
|
264
|
+
/* @__PURE__ */ e("div", { className: "flex gap-0.5", children: B })
|
|
265
265
|
]
|
|
266
266
|
}
|
|
267
267
|
);
|
|
268
|
-
return
|
|
269
|
-
/* @__PURE__ */ e(
|
|
270
|
-
/* @__PURE__ */ e(
|
|
268
|
+
return l ? /* @__PURE__ */ r(ie, { children: [
|
|
269
|
+
/* @__PURE__ */ e(se, { asChild: !0, children: U }),
|
|
270
|
+
/* @__PURE__ */ e(ne, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
|
|
271
271
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
272
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children:
|
|
272
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: X(t) })
|
|
273
273
|
] }) })
|
|
274
|
-
] }) : /* @__PURE__ */ r(
|
|
275
|
-
/* @__PURE__ */ e(
|
|
276
|
-
/* @__PURE__ */ e(
|
|
274
|
+
] }) : /* @__PURE__ */ r(re, { open: w, onOpenChange: v, children: [
|
|
275
|
+
/* @__PURE__ */ e(oe, { asChild: !0, children: U }),
|
|
276
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: b ? b({ event: t, onClose: z }) : /* @__PURE__ */ e(xe, { event: t, onClose: z }) })
|
|
277
277
|
] });
|
|
278
278
|
}
|
|
279
279
|
const G = /* @__PURE__ */ r(
|
|
280
280
|
"button",
|
|
281
281
|
{
|
|
282
282
|
type: "button",
|
|
283
|
-
onClick:
|
|
284
|
-
className:
|
|
283
|
+
onClick: H,
|
|
284
|
+
className: d(
|
|
285
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
286
|
"shadow-[0_1px_3px_rgba(0,0,0,0.08)] hover:shadow-[0_2px_6px_rgba(0,0,0,0.12)]",
|
|
287
287
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
288
288
|
// Cancelled events get gray background with strikethrough
|
|
289
|
-
|
|
290
|
-
|
|
289
|
+
$ || // Past events get neutral zinc styling with strikethrough
|
|
290
|
+
S ? "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
291
|
o === "colored" && [
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
292
|
+
u.bg,
|
|
293
|
+
u.accentBorder,
|
|
294
|
+
u.text
|
|
295
295
|
],
|
|
296
296
|
o === "mixed" && [
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
297
|
+
u.bg,
|
|
298
|
+
u.accentBorder,
|
|
299
|
+
u.text
|
|
300
300
|
],
|
|
301
301
|
o === "dot" && "bg-muted/50 border-l-neutral-400 dark:border-l-neutral-600"
|
|
302
302
|
],
|
|
303
|
-
|
|
303
|
+
i
|
|
304
304
|
),
|
|
305
|
-
style:
|
|
305
|
+
style: k,
|
|
306
306
|
children: [
|
|
307
307
|
/* @__PURE__ */ r("div", { className: "flex items-start justify-between gap-1", children: [
|
|
308
308
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 min-w-0", children: [
|
|
309
|
-
["dot", "mixed"].includes(o) && !
|
|
309
|
+
["dot", "mixed"].includes(o) && !S && !$ && /* @__PURE__ */ e(
|
|
310
310
|
"svg",
|
|
311
311
|
{
|
|
312
312
|
width: "8",
|
|
@@ -315,67 +315,67 @@ function De({
|
|
|
315
315
|
className: "event-dot shrink-0",
|
|
316
316
|
"aria-hidden": "true",
|
|
317
317
|
focusable: "false",
|
|
318
|
-
children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className:
|
|
318
|
+
children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className: u.dotFill })
|
|
319
319
|
}
|
|
320
320
|
),
|
|
321
321
|
/* @__PURE__ */ r(
|
|
322
322
|
"span",
|
|
323
323
|
{
|
|
324
|
-
className:
|
|
324
|
+
className: d(
|
|
325
325
|
"text-sm font-medium truncate",
|
|
326
|
-
!
|
|
327
|
-
|
|
326
|
+
!S && !$ && o !== "dot" && u.text,
|
|
327
|
+
$ && "line-through"
|
|
328
328
|
),
|
|
329
329
|
children: [
|
|
330
330
|
t.title,
|
|
331
|
-
|
|
331
|
+
R && /* @__PURE__ */ r("span", { className: "font-normal opacity-75", children: [
|
|
332
332
|
" ",
|
|
333
333
|
"- ",
|
|
334
|
-
|
|
334
|
+
R
|
|
335
335
|
] })
|
|
336
336
|
]
|
|
337
337
|
}
|
|
338
338
|
)
|
|
339
339
|
] }),
|
|
340
|
-
|
|
340
|
+
B
|
|
341
341
|
] }),
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
/* @__PURE__ */ e(
|
|
342
|
+
P && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children: P }),
|
|
343
|
+
D != null && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
344
|
+
/* @__PURE__ */ e(_e, { className: "h-3 w-3 shrink-0" }),
|
|
345
345
|
/* @__PURE__ */ r("span", { children: [
|
|
346
|
-
|
|
346
|
+
D,
|
|
347
347
|
" participant",
|
|
348
|
-
|
|
348
|
+
D !== 1 ? "s" : ""
|
|
349
349
|
] })
|
|
350
350
|
] }),
|
|
351
|
-
|
|
352
|
-
/* @__PURE__ */ e(
|
|
353
|
-
/* @__PURE__ */ e("span", { children:
|
|
351
|
+
p && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
352
|
+
/* @__PURE__ */ e(Pe, { className: "h-3 w-3 shrink-0" }),
|
|
353
|
+
/* @__PURE__ */ e("span", { children: X(t) })
|
|
354
354
|
] }),
|
|
355
|
-
|
|
356
|
-
/* @__PURE__ */ e(
|
|
357
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
355
|
+
C && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
356
|
+
/* @__PURE__ */ e(st, { className: "h-3 w-3 shrink-0" }),
|
|
357
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: C })
|
|
358
358
|
] }),
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
/* @__PURE__ */ e(
|
|
359
|
+
s && t.description && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground line-clamp-2", children: t.description }),
|
|
360
|
+
y && t.participants && t.participants.length > 0 && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
361
|
+
/* @__PURE__ */ e(_e, { className: "h-3 w-3 shrink-0" }),
|
|
362
362
|
/* @__PURE__ */ e("span", { className: "truncate", children: t.participants.map((U) => U.name).join(", ") })
|
|
363
363
|
] })
|
|
364
364
|
]
|
|
365
365
|
}
|
|
366
366
|
);
|
|
367
|
-
return
|
|
368
|
-
/* @__PURE__ */ e(
|
|
369
|
-
/* @__PURE__ */ e(
|
|
367
|
+
return l ? /* @__PURE__ */ r(ie, { children: [
|
|
368
|
+
/* @__PURE__ */ e(se, { asChild: !0, children: G }),
|
|
369
|
+
/* @__PURE__ */ e(ne, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
|
|
370
370
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
371
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children:
|
|
371
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: X(t) })
|
|
372
372
|
] }) })
|
|
373
|
-
] }) : /* @__PURE__ */ r(
|
|
374
|
-
/* @__PURE__ */ e(
|
|
375
|
-
/* @__PURE__ */ e(
|
|
373
|
+
] }) : /* @__PURE__ */ r(re, { open: w, onOpenChange: v, children: [
|
|
374
|
+
/* @__PURE__ */ e(oe, { asChild: !0, children: G }),
|
|
375
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: b ? b({ event: t, onClose: z }) : /* @__PURE__ */ e(xe, { event: t, onClose: z }) })
|
|
376
376
|
] });
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function Pe({ className: t }) {
|
|
379
379
|
return /* @__PURE__ */ r(
|
|
380
380
|
"svg",
|
|
381
381
|
{
|
|
@@ -394,7 +394,7 @@ function je({ className: t }) {
|
|
|
394
394
|
}
|
|
395
395
|
);
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function vt({ className: t }) {
|
|
398
398
|
return /* @__PURE__ */ e(
|
|
399
399
|
"svg",
|
|
400
400
|
{
|
|
@@ -410,7 +410,7 @@ function bt({ className: t }) {
|
|
|
410
410
|
}
|
|
411
411
|
);
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function Nt({ className: t }) {
|
|
414
414
|
return /* @__PURE__ */ r(
|
|
415
415
|
"svg",
|
|
416
416
|
{
|
|
@@ -429,7 +429,7 @@ function yt({ className: t }) {
|
|
|
429
429
|
}
|
|
430
430
|
);
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function _e({ className: t }) {
|
|
433
433
|
return /* @__PURE__ */ r(
|
|
434
434
|
"svg",
|
|
435
435
|
{
|
|
@@ -450,7 +450,7 @@ function We({ className: t }) {
|
|
|
450
450
|
}
|
|
451
451
|
);
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function st({ className: t }) {
|
|
454
454
|
return /* @__PURE__ */ r(
|
|
455
455
|
"svg",
|
|
456
456
|
{
|
|
@@ -469,19 +469,19 @@ function nt({ className: t }) {
|
|
|
469
469
|
}
|
|
470
470
|
);
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function xe({
|
|
473
473
|
event: t,
|
|
474
474
|
onClose: n
|
|
475
475
|
}) {
|
|
476
|
-
const o =
|
|
476
|
+
const o = de(t.color), a = t.isCanceled ?? !1;
|
|
477
477
|
return /* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
478
478
|
/* @__PURE__ */ r("div", { className: "flex items-start gap-3", children: [
|
|
479
|
-
/* @__PURE__ */ e("div", { className:
|
|
479
|
+
/* @__PURE__ */ e("div", { className: d("size-4 rounded shrink-0 mt-0.5", o.dot) }),
|
|
480
480
|
/* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
|
|
481
481
|
/* @__PURE__ */ e(
|
|
482
482
|
"h3",
|
|
483
483
|
{
|
|
484
|
-
className:
|
|
484
|
+
className: d(
|
|
485
485
|
"font-semibold text-lg",
|
|
486
486
|
a && "line-through opacity-50"
|
|
487
487
|
),
|
|
@@ -489,8 +489,8 @@ function fe({
|
|
|
489
489
|
}
|
|
490
490
|
),
|
|
491
491
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-sm text-muted-foreground mt-1", children: [
|
|
492
|
-
/* @__PURE__ */ e(
|
|
493
|
-
/* @__PURE__ */ e("span", { className: "tabular-nums", children:
|
|
492
|
+
/* @__PURE__ */ e(Pe, { className: "h-4 w-4 shrink-0" }),
|
|
493
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums", children: X(t) })
|
|
494
494
|
] })
|
|
495
495
|
] })
|
|
496
496
|
] }),
|
|
@@ -511,77 +511,77 @@ function fe({
|
|
|
511
511
|
) })
|
|
512
512
|
] });
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function lt({
|
|
515
515
|
event: t,
|
|
516
516
|
position: n,
|
|
517
517
|
hourHeight: o = 96,
|
|
518
518
|
badgeVariant: a = "colored",
|
|
519
|
-
onClick:
|
|
520
|
-
className:
|
|
521
|
-
disablePopover:
|
|
522
|
-
renderPopover:
|
|
523
|
-
enableDrag:
|
|
519
|
+
onClick: i,
|
|
520
|
+
className: p,
|
|
521
|
+
disablePopover: s = !1,
|
|
522
|
+
renderPopover: y,
|
|
523
|
+
enableDrag: k = !0
|
|
524
524
|
}) {
|
|
525
|
-
const
|
|
526
|
-
|
|
527
|
-
}, [
|
|
528
|
-
|
|
529
|
-
}, []),
|
|
530
|
-
(
|
|
531
|
-
if (!
|
|
532
|
-
|
|
533
|
-
const Y =
|
|
534
|
-
|
|
525
|
+
const l = de(t.color), [b, N] = J(!1), [m, g] = J(!1), u = Re(), w = (t.endDate.getTime() - t.startDate.getTime()) / (1e3 * 60), v = w / 60 * o - 8, W = t.endDate < Oe(/* @__PURE__ */ new Date()), T = t.isCanceled ?? !1, A = k && u && !T && !W, j = w < 35, E = w > 25, _ = w >= 45, M = t.data, I = t.scheduleTypeName || M?.scheduleTypeName || M?.typeName, S = M?.productName, $ = M?.nrParticipant, q = M?.siteName, f = M?.siteCity, x = [q, f].filter(Boolean).join(", "), B = a === "dot", R = L(() => {
|
|
526
|
+
m || (s && i ? i(t) : s || N(!0));
|
|
527
|
+
}, [m, s, i, t]), P = L(() => {
|
|
528
|
+
N(!1);
|
|
529
|
+
}, []), D = L(
|
|
530
|
+
(z) => {
|
|
531
|
+
if (!A) return;
|
|
532
|
+
z.dataTransfer.effectAllowed = "move", z.dataTransfer.setData("text/plain", t.id);
|
|
533
|
+
const Y = z.currentTarget, O = Y.getBoundingClientRect();
|
|
534
|
+
z.dataTransfer.setDragImage(
|
|
535
535
|
Y,
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
),
|
|
536
|
+
z.clientX - O.left,
|
|
537
|
+
z.clientY - O.top
|
|
538
|
+
), g(!0), u?.startDrag?.(t);
|
|
539
539
|
},
|
|
540
|
-
[
|
|
541
|
-
),
|
|
542
|
-
|
|
543
|
-
}, [
|
|
544
|
-
(
|
|
545
|
-
(
|
|
540
|
+
[A, t, u]
|
|
541
|
+
), c = L(() => {
|
|
542
|
+
g(!1), u?.isDragging && u.endDrag?.();
|
|
543
|
+
}, [u]), h = L(
|
|
544
|
+
(z) => {
|
|
545
|
+
(z.key === "Enter" || z.key === " ") && (z.preventDefault(), R());
|
|
546
546
|
},
|
|
547
|
-
[
|
|
548
|
-
),
|
|
547
|
+
[R]
|
|
548
|
+
), C = /* @__PURE__ */ r(
|
|
549
549
|
"div",
|
|
550
550
|
{
|
|
551
551
|
role: "button",
|
|
552
552
|
tabIndex: 0,
|
|
553
|
-
draggable: !!
|
|
554
|
-
onDragStart:
|
|
555
|
-
onDragEnd:
|
|
556
|
-
onKeyDown:
|
|
557
|
-
onClick:
|
|
558
|
-
className:
|
|
553
|
+
draggable: !!A,
|
|
554
|
+
onDragStart: D,
|
|
555
|
+
onDragEnd: c,
|
|
556
|
+
onKeyDown: h,
|
|
557
|
+
onClick: m ? void 0 : R,
|
|
558
|
+
className: d(
|
|
559
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
560
|
"shadow-[0_1px_3px_rgba(0,0,0,0.08)] hover:shadow-[0_2px_6px_rgba(0,0,0,0.12)]",
|
|
561
561
|
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
562
562
|
"transition-all",
|
|
563
|
-
|
|
564
|
-
|
|
563
|
+
A ? "cursor-grab active:cursor-grabbing" : "cursor-pointer",
|
|
564
|
+
m && "opacity-50",
|
|
565
565
|
// Cancelled events get gray background with strikethrough
|
|
566
|
-
|
|
567
|
-
|
|
566
|
+
T || // Past events get neutral zinc styling with strikethrough
|
|
567
|
+
W ? "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
568
|
// Colored/mixed variants
|
|
569
|
-
!
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
569
|
+
!B && [
|
|
570
|
+
l.bg,
|
|
571
|
+
l.accentBorder,
|
|
572
|
+
l.text
|
|
573
573
|
],
|
|
574
574
|
// Dot variant - neutral background
|
|
575
|
-
|
|
575
|
+
B && "bg-neutral-50 dark:bg-neutral-900 border-l-neutral-400 dark:border-l-neutral-600"
|
|
576
576
|
],
|
|
577
577
|
// Short events center content
|
|
578
|
-
|
|
579
|
-
|
|
578
|
+
j && "py-0 justify-center",
|
|
579
|
+
p
|
|
580
580
|
),
|
|
581
|
-
style: { height: `${Math.max(
|
|
581
|
+
style: { height: `${Math.max(v, 20)}px` },
|
|
582
582
|
children: [
|
|
583
583
|
/* @__PURE__ */ r("div", { className: "flex items-start gap-1.5 min-w-0", children: [
|
|
584
|
-
["mixed", "dot"].includes(a) && !
|
|
584
|
+
["mixed", "dot"].includes(a) && !W && !T && /* @__PURE__ */ e(
|
|
585
585
|
"svg",
|
|
586
586
|
{
|
|
587
587
|
width: "8",
|
|
@@ -590,101 +590,101 @@ function rt({
|
|
|
590
590
|
className: "event-dot shrink-0",
|
|
591
591
|
"aria-hidden": "true",
|
|
592
592
|
focusable: "false",
|
|
593
|
-
children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className:
|
|
593
|
+
children: /* @__PURE__ */ e("circle", { cx: "4", cy: "4", r: "4", className: l.dotFill })
|
|
594
594
|
}
|
|
595
595
|
),
|
|
596
596
|
/* @__PURE__ */ e("div", { className: "flex-1 min-w-0 overflow-hidden", children: /* @__PURE__ */ r(
|
|
597
597
|
"p",
|
|
598
598
|
{
|
|
599
|
-
className:
|
|
599
|
+
className: d(
|
|
600
600
|
"font-semibold truncate leading-tight",
|
|
601
|
-
!
|
|
601
|
+
!W && !T && B && "text-foreground"
|
|
602
602
|
),
|
|
603
603
|
children: [
|
|
604
604
|
t.title,
|
|
605
|
-
|
|
605
|
+
I && /* @__PURE__ */ r("span", { className: "font-normal opacity-75", children: [
|
|
606
606
|
" ",
|
|
607
607
|
"- ",
|
|
608
|
-
|
|
608
|
+
I
|
|
609
609
|
] })
|
|
610
610
|
]
|
|
611
611
|
}
|
|
612
612
|
) })
|
|
613
613
|
] }),
|
|
614
|
-
|
|
614
|
+
_ && S && /* @__PURE__ */ e(
|
|
615
615
|
"p",
|
|
616
616
|
{
|
|
617
|
-
className:
|
|
617
|
+
className: d(
|
|
618
618
|
"text-[11px] truncate leading-tight",
|
|
619
|
-
|
|
619
|
+
B ? "text-muted-foreground" : "opacity-80"
|
|
620
620
|
),
|
|
621
|
-
children:
|
|
621
|
+
children: S
|
|
622
622
|
}
|
|
623
623
|
),
|
|
624
|
-
|
|
624
|
+
_ && $ != null && /* @__PURE__ */ r(
|
|
625
625
|
"div",
|
|
626
626
|
{
|
|
627
|
-
className:
|
|
627
|
+
className: d(
|
|
628
628
|
"flex items-center gap-1 text-[11px] leading-tight",
|
|
629
|
-
|
|
629
|
+
B ? "text-muted-foreground" : "opacity-80"
|
|
630
630
|
),
|
|
631
631
|
children: [
|
|
632
|
-
/* @__PURE__ */ e(
|
|
632
|
+
/* @__PURE__ */ e(_e, { className: "h-3 w-3 shrink-0" }),
|
|
633
633
|
/* @__PURE__ */ r("span", { children: [
|
|
634
|
-
|
|
634
|
+
$,
|
|
635
635
|
" participant",
|
|
636
|
-
|
|
636
|
+
$ !== 1 ? "s" : ""
|
|
637
637
|
] })
|
|
638
638
|
]
|
|
639
639
|
}
|
|
640
640
|
),
|
|
641
|
-
|
|
641
|
+
E && /* @__PURE__ */ r(
|
|
642
642
|
"div",
|
|
643
643
|
{
|
|
644
|
-
className:
|
|
644
|
+
className: d(
|
|
645
645
|
"flex items-center gap-1 text-[11px] tabular-nums leading-tight",
|
|
646
|
-
|
|
646
|
+
B ? "text-muted-foreground" : "opacity-90"
|
|
647
647
|
),
|
|
648
648
|
children: [
|
|
649
|
-
/* @__PURE__ */ e(
|
|
650
|
-
/* @__PURE__ */ e("span", { children:
|
|
649
|
+
/* @__PURE__ */ e(Pe, { className: "h-3 w-3 shrink-0" }),
|
|
650
|
+
/* @__PURE__ */ e("span", { children: X(t) })
|
|
651
651
|
]
|
|
652
652
|
}
|
|
653
653
|
),
|
|
654
|
-
|
|
654
|
+
_ && x && /* @__PURE__ */ r(
|
|
655
655
|
"div",
|
|
656
656
|
{
|
|
657
|
-
className:
|
|
657
|
+
className: d(
|
|
658
658
|
"flex items-center gap-1 text-[11px] truncate leading-tight",
|
|
659
|
-
|
|
659
|
+
B ? "text-muted-foreground" : "opacity-80"
|
|
660
660
|
),
|
|
661
661
|
children: [
|
|
662
|
-
/* @__PURE__ */ e(
|
|
663
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
662
|
+
/* @__PURE__ */ e(st, { className: "h-3 w-3 shrink-0" }),
|
|
663
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: x })
|
|
664
664
|
]
|
|
665
665
|
}
|
|
666
666
|
)
|
|
667
667
|
]
|
|
668
668
|
}
|
|
669
|
-
),
|
|
669
|
+
), H = /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
|
|
670
670
|
/* @__PURE__ */ r("div", { className: "font-medium", children: [
|
|
671
671
|
t.title,
|
|
672
|
-
|
|
672
|
+
I && /* @__PURE__ */ r("span", { className: "font-normal opacity-75", children: [
|
|
673
673
|
" ",
|
|
674
674
|
"- ",
|
|
675
|
-
|
|
675
|
+
I
|
|
676
676
|
] })
|
|
677
677
|
] }),
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
678
|
+
S && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: S }),
|
|
679
|
+
$ != null && /* @__PURE__ */ r("div", { className: "text-xs text-muted-foreground", children: [
|
|
680
|
+
$,
|
|
681
681
|
" participant",
|
|
682
|
-
|
|
682
|
+
$ !== 1 ? "s" : ""
|
|
683
683
|
] }),
|
|
684
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children:
|
|
685
|
-
|
|
684
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: X(t) }),
|
|
685
|
+
x && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: x })
|
|
686
686
|
] }) });
|
|
687
|
-
return
|
|
687
|
+
return s ? /* @__PURE__ */ e(
|
|
688
688
|
"div",
|
|
689
689
|
{
|
|
690
690
|
className: "absolute p-0.5",
|
|
@@ -694,9 +694,9 @@ function rt({
|
|
|
694
694
|
width: n.minWidth ? `max(${n.minWidth}px, ${n.width}%)` : `${n.width}%`,
|
|
695
695
|
minWidth: n.minWidth ? `${n.minWidth}px` : void 0
|
|
696
696
|
},
|
|
697
|
-
children: /* @__PURE__ */ r(
|
|
698
|
-
/* @__PURE__ */ e(
|
|
699
|
-
|
|
697
|
+
children: /* @__PURE__ */ r(ie, { children: [
|
|
698
|
+
/* @__PURE__ */ e(se, { asChild: !0, children: C }),
|
|
699
|
+
H
|
|
700
700
|
] })
|
|
701
701
|
}
|
|
702
702
|
) : /* @__PURE__ */ e(
|
|
@@ -709,56 +709,56 @@ function rt({
|
|
|
709
709
|
width: n.minWidth ? `max(${n.minWidth}px, ${n.width}%)` : `${n.width}%`,
|
|
710
710
|
minWidth: n.minWidth ? `${n.minWidth}px` : void 0
|
|
711
711
|
},
|
|
712
|
-
children: /* @__PURE__ */ r(
|
|
713
|
-
/* @__PURE__ */ e(
|
|
714
|
-
/* @__PURE__ */ e(
|
|
712
|
+
children: /* @__PURE__ */ r(re, { open: b, onOpenChange: N, children: [
|
|
713
|
+
/* @__PURE__ */ e(oe, { asChild: !0, children: C }),
|
|
714
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: y ? y({ event: t, onClose: P }) : /* @__PURE__ */ e(xe, { event: t, onClose: P }) })
|
|
715
715
|
] })
|
|
716
716
|
}
|
|
717
717
|
);
|
|
718
718
|
}
|
|
719
|
-
function
|
|
719
|
+
function kn({
|
|
720
720
|
event: t,
|
|
721
721
|
spanDays: n,
|
|
722
722
|
isStart: o,
|
|
723
723
|
isEnd: a,
|
|
724
|
-
onClick:
|
|
725
|
-
className:
|
|
726
|
-
disablePopover:
|
|
727
|
-
renderPopover:
|
|
724
|
+
onClick: i,
|
|
725
|
+
className: p,
|
|
726
|
+
disablePopover: s = !1,
|
|
727
|
+
renderPopover: y
|
|
728
728
|
}) {
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
}, [
|
|
732
|
-
|
|
729
|
+
const k = de(t.color), [l, b] = J(!1), N = t.endDate < Oe(/* @__PURE__ */ new Date()), m = t.isCanceled ?? !1, g = L(() => {
|
|
730
|
+
s && i ? i(t) : s || b(!0);
|
|
731
|
+
}, [s, i, t]), u = L(() => {
|
|
732
|
+
b(!1);
|
|
733
733
|
}, []), w = /* @__PURE__ */ e(
|
|
734
734
|
"button",
|
|
735
735
|
{
|
|
736
736
|
type: "button",
|
|
737
|
-
onClick:
|
|
738
|
-
className:
|
|
737
|
+
onClick: g,
|
|
738
|
+
className: d(
|
|
739
739
|
"flex h-5 items-center px-1.5 text-xs font-medium transition-opacity hover:opacity-80",
|
|
740
740
|
// Cancelled events get gray background with strikethrough
|
|
741
|
-
|
|
742
|
-
|
|
741
|
+
m || // Past events get neutral zinc styling with strikethrough
|
|
742
|
+
N ? "bg-zinc-200 dark:bg-zinc-700 text-zinc-500 dark:text-zinc-400 line-through" : [k.dot, "text-white"],
|
|
743
743
|
o && "rounded-l",
|
|
744
744
|
a && "rounded-r",
|
|
745
745
|
!o && "border-l-0",
|
|
746
746
|
!a && "border-r-0",
|
|
747
|
-
|
|
747
|
+
p
|
|
748
748
|
),
|
|
749
749
|
style: { width: `${n * 100}%` },
|
|
750
750
|
children: o && /* @__PURE__ */ e("span", { className: "truncate", children: t.title })
|
|
751
751
|
}
|
|
752
|
-
),
|
|
752
|
+
), v = /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
|
|
753
753
|
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
754
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children:
|
|
754
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: X(t) })
|
|
755
755
|
] }) });
|
|
756
|
-
return
|
|
757
|
-
/* @__PURE__ */ e(
|
|
758
|
-
|
|
759
|
-
] }) : /* @__PURE__ */ r(
|
|
760
|
-
/* @__PURE__ */ e(
|
|
761
|
-
/* @__PURE__ */ e(
|
|
756
|
+
return s ? /* @__PURE__ */ r(ie, { children: [
|
|
757
|
+
/* @__PURE__ */ e(se, { asChild: !0, children: w }),
|
|
758
|
+
v
|
|
759
|
+
] }) : /* @__PURE__ */ r(re, { open: l, onOpenChange: b, children: [
|
|
760
|
+
/* @__PURE__ */ e(oe, { asChild: !0, children: w }),
|
|
761
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: y ? y({ event: t, onClose: u }) : /* @__PURE__ */ e(xe, { event: t, onClose: u }) })
|
|
762
762
|
] });
|
|
763
763
|
}
|
|
764
764
|
if (typeof window < "u" && !document.getElementById("inno-calendar-event-marquee-style")) {
|
|
@@ -774,36 +774,36 @@ if (typeof window < "u" && !document.getElementById("inno-calendar-event-marquee
|
|
|
774
774
|
}
|
|
775
775
|
`, document.head.appendChild(t);
|
|
776
776
|
}
|
|
777
|
-
const
|
|
777
|
+
const Ue = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, qe = ft, dt = (t, n) => (o) => {
|
|
778
778
|
var a;
|
|
779
|
-
if (n?.variants == null) return
|
|
780
|
-
const { variants:
|
|
781
|
-
const
|
|
782
|
-
if (
|
|
783
|
-
const
|
|
784
|
-
return l
|
|
785
|
-
}),
|
|
786
|
-
let [
|
|
787
|
-
return
|
|
788
|
-
}, {}),
|
|
789
|
-
let { class:
|
|
790
|
-
return Object.entries(
|
|
791
|
-
let [w,
|
|
792
|
-
return Array.isArray(
|
|
793
|
-
...
|
|
794
|
-
...
|
|
779
|
+
if (n?.variants == null) return qe(t, o?.class, o?.className);
|
|
780
|
+
const { variants: i, defaultVariants: p } = n, s = Object.keys(i).map((l) => {
|
|
781
|
+
const b = o?.[l], N = p?.[l];
|
|
782
|
+
if (b === null) return null;
|
|
783
|
+
const m = Ue(b) || Ue(N);
|
|
784
|
+
return i[l][m];
|
|
785
|
+
}), y = o && Object.entries(o).reduce((l, b) => {
|
|
786
|
+
let [N, m] = b;
|
|
787
|
+
return m === void 0 || (l[N] = m), l;
|
|
788
|
+
}, {}), k = n == null || (a = n.compoundVariants) === null || a === void 0 ? void 0 : a.reduce((l, b) => {
|
|
789
|
+
let { class: N, className: m, ...g } = b;
|
|
790
|
+
return Object.entries(g).every((u) => {
|
|
791
|
+
let [w, v] = u;
|
|
792
|
+
return Array.isArray(v) ? v.includes({
|
|
793
|
+
...p,
|
|
794
|
+
...y
|
|
795
795
|
}[w]) : {
|
|
796
|
-
...
|
|
797
|
-
...
|
|
798
|
-
}[w] ===
|
|
796
|
+
...p,
|
|
797
|
+
...y
|
|
798
|
+
}[w] === v;
|
|
799
799
|
}) ? [
|
|
800
|
-
...
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
] :
|
|
800
|
+
...l,
|
|
801
|
+
N,
|
|
802
|
+
m
|
|
803
|
+
] : l;
|
|
804
804
|
}, []);
|
|
805
|
-
return
|
|
806
|
-
},
|
|
805
|
+
return qe(t, s, k, o?.class, o?.className);
|
|
806
|
+
}, kt = dt(
|
|
807
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
808
|
{
|
|
809
809
|
variants: {
|
|
@@ -827,14 +827,14 @@ const Fe = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, Ve = ut, o
|
|
|
827
827
|
size: "default"
|
|
828
828
|
}
|
|
829
829
|
}
|
|
830
|
-
),
|
|
831
|
-
({ className: t, variant: n, size: o, loading: a, disabled:
|
|
830
|
+
), me = $e(
|
|
831
|
+
({ className: t, variant: n, size: o, loading: a, disabled: i, children: p, ...s }, y) => /* @__PURE__ */ r(
|
|
832
832
|
"button",
|
|
833
833
|
{
|
|
834
|
-
className:
|
|
835
|
-
ref:
|
|
836
|
-
disabled:
|
|
837
|
-
...
|
|
834
|
+
className: d(kt({ variant: n, size: o, className: t })),
|
|
835
|
+
ref: y,
|
|
836
|
+
disabled: i || a,
|
|
837
|
+
...s,
|
|
838
838
|
children: [
|
|
839
839
|
a && /* @__PURE__ */ r(
|
|
840
840
|
"svg",
|
|
@@ -866,23 +866,23 @@ const Fe = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, Ve = ut, o
|
|
|
866
866
|
]
|
|
867
867
|
}
|
|
868
868
|
),
|
|
869
|
-
|
|
869
|
+
p
|
|
870
870
|
]
|
|
871
871
|
}
|
|
872
872
|
)
|
|
873
873
|
);
|
|
874
|
-
|
|
875
|
-
const
|
|
876
|
-
const
|
|
877
|
-
const
|
|
874
|
+
me.displayName = "Button";
|
|
875
|
+
const ct = (...t) => t.filter((n, o, a) => !!n && n.trim() !== "" && a.indexOf(n) === o).join(" ").trim();
|
|
876
|
+
const Dt = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
877
|
+
const Ct = (t) => t.replace(
|
|
878
878
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
879
879
|
(n, o, a) => a ? a.toUpperCase() : o.toLowerCase()
|
|
880
880
|
);
|
|
881
|
-
const
|
|
882
|
-
const n =
|
|
881
|
+
const Ke = (t) => {
|
|
882
|
+
const n = Ct(t);
|
|
883
883
|
return n.charAt(0).toUpperCase() + n.slice(1);
|
|
884
884
|
};
|
|
885
|
-
var
|
|
885
|
+
var St = {
|
|
886
886
|
xmlns: "http://www.w3.org/2000/svg",
|
|
887
887
|
width: 24,
|
|
888
888
|
height: 24,
|
|
@@ -893,63 +893,63 @@ var kt = {
|
|
|
893
893
|
strokeLinecap: "round",
|
|
894
894
|
strokeLinejoin: "round"
|
|
895
895
|
};
|
|
896
|
-
const
|
|
896
|
+
const Mt = (t) => {
|
|
897
897
|
for (const n in t)
|
|
898
898
|
if (n.startsWith("aria-") || n === "role" || n === "title")
|
|
899
899
|
return !0;
|
|
900
900
|
return !1;
|
|
901
901
|
};
|
|
902
|
-
const
|
|
902
|
+
const Tt = $e(
|
|
903
903
|
({
|
|
904
904
|
color: t = "currentColor",
|
|
905
905
|
size: n = 24,
|
|
906
906
|
strokeWidth: o = 2,
|
|
907
907
|
absoluteStrokeWidth: a,
|
|
908
|
-
className:
|
|
909
|
-
children:
|
|
910
|
-
iconNode:
|
|
911
|
-
...
|
|
912
|
-
},
|
|
908
|
+
className: i = "",
|
|
909
|
+
children: p,
|
|
910
|
+
iconNode: s,
|
|
911
|
+
...y
|
|
912
|
+
}, k) => We(
|
|
913
913
|
"svg",
|
|
914
914
|
{
|
|
915
|
-
ref:
|
|
916
|
-
...
|
|
915
|
+
ref: k,
|
|
916
|
+
...St,
|
|
917
917
|
width: n,
|
|
918
918
|
height: n,
|
|
919
919
|
stroke: t,
|
|
920
920
|
strokeWidth: a ? Number(o) * 24 / Number(n) : o,
|
|
921
|
-
className:
|
|
922
|
-
...!
|
|
923
|
-
...
|
|
921
|
+
className: ct("lucide", i),
|
|
922
|
+
...!p && !Mt(y) && { "aria-hidden": "true" },
|
|
923
|
+
...y
|
|
924
924
|
},
|
|
925
925
|
[
|
|
926
|
-
...
|
|
927
|
-
...Array.isArray(
|
|
926
|
+
...s.map(([l, b]) => We(l, b)),
|
|
927
|
+
...Array.isArray(p) ? p : [p]
|
|
928
928
|
]
|
|
929
929
|
)
|
|
930
930
|
);
|
|
931
|
-
const
|
|
932
|
-
const o =
|
|
933
|
-
({ className: a, ...
|
|
934
|
-
ref:
|
|
931
|
+
const Fe = (t, n) => {
|
|
932
|
+
const o = $e(
|
|
933
|
+
({ className: a, ...i }, p) => We(Tt, {
|
|
934
|
+
ref: p,
|
|
935
935
|
iconNode: n,
|
|
936
|
-
className:
|
|
937
|
-
`lucide-${
|
|
936
|
+
className: ct(
|
|
937
|
+
`lucide-${Dt(Ke(t))}`,
|
|
938
938
|
`lucide-${t}`,
|
|
939
939
|
a
|
|
940
940
|
),
|
|
941
|
-
...
|
|
941
|
+
...i
|
|
942
942
|
})
|
|
943
943
|
);
|
|
944
|
-
return o.displayName =
|
|
944
|
+
return o.displayName = Ke(t), o;
|
|
945
945
|
};
|
|
946
|
-
const
|
|
947
|
-
const
|
|
948
|
-
const
|
|
949
|
-
|
|
946
|
+
const zt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Lt = Fe("check", zt);
|
|
947
|
+
const Wt = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], At = Fe("chevron-right", Wt);
|
|
948
|
+
const _t = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], Et = Fe("circle", _t), Xe = V.Root, Ye = V.Trigger, Bt = ee.forwardRef(({ className: t, inset: n, children: o, ...a }, i) => /* @__PURE__ */ r(
|
|
949
|
+
V.SubTrigger,
|
|
950
950
|
{
|
|
951
|
-
ref:
|
|
952
|
-
className:
|
|
951
|
+
ref: i,
|
|
952
|
+
className: d(
|
|
953
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
954
|
n && "pl-8",
|
|
955
955
|
t
|
|
@@ -957,41 +957,41 @@ const Lt = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], Wt = Re
|
|
|
957
957
|
...a,
|
|
958
958
|
children: [
|
|
959
959
|
o,
|
|
960
|
-
/* @__PURE__ */ e(
|
|
960
|
+
/* @__PURE__ */ e(At, { className: "ml-auto h-4 w-4" })
|
|
961
961
|
]
|
|
962
962
|
}
|
|
963
963
|
));
|
|
964
|
-
|
|
965
|
-
const
|
|
966
|
-
|
|
964
|
+
Bt.displayName = V.SubTrigger.displayName;
|
|
965
|
+
const $t = ee.forwardRef(({ className: t, ...n }, o) => /* @__PURE__ */ e(
|
|
966
|
+
V.SubContent,
|
|
967
967
|
{
|
|
968
968
|
ref: o,
|
|
969
|
-
className:
|
|
969
|
+
className: d(
|
|
970
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
971
|
t
|
|
972
972
|
),
|
|
973
973
|
...n
|
|
974
974
|
}
|
|
975
975
|
));
|
|
976
|
-
|
|
977
|
-
const
|
|
978
|
-
|
|
976
|
+
$t.displayName = V.SubContent.displayName;
|
|
977
|
+
const Ee = ee.forwardRef(({ className: t, sideOffset: n = 4, ...o }, a) => /* @__PURE__ */ e(V.Portal, { children: /* @__PURE__ */ e(
|
|
978
|
+
V.Content,
|
|
979
979
|
{
|
|
980
980
|
ref: a,
|
|
981
981
|
sideOffset: n,
|
|
982
|
-
className:
|
|
982
|
+
className: d(
|
|
983
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
984
|
t
|
|
985
985
|
),
|
|
986
986
|
...o
|
|
987
987
|
}
|
|
988
988
|
) }));
|
|
989
|
-
|
|
990
|
-
const
|
|
991
|
-
|
|
989
|
+
Ee.displayName = V.Content.displayName;
|
|
990
|
+
const Be = ee.forwardRef(({ className: t, inset: n, ...o }, a) => /* @__PURE__ */ e(
|
|
991
|
+
V.Item,
|
|
992
992
|
{
|
|
993
993
|
ref: a,
|
|
994
|
-
className:
|
|
994
|
+
className: d(
|
|
995
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
996
|
n && "pl-8",
|
|
997
997
|
t
|
|
@@ -999,59 +999,59 @@ const Ee = Z.forwardRef(({ className: t, inset: n, ...o }, a) => /* @__PURE__ */
|
|
|
999
999
|
...o
|
|
1000
1000
|
}
|
|
1001
1001
|
));
|
|
1002
|
-
|
|
1003
|
-
const
|
|
1004
|
-
|
|
1002
|
+
Be.displayName = V.Item.displayName;
|
|
1003
|
+
const It = ee.forwardRef(({ className: t, children: n, checked: o = !1, ...a }, i) => /* @__PURE__ */ r(
|
|
1004
|
+
V.CheckboxItem,
|
|
1005
1005
|
{
|
|
1006
|
-
ref:
|
|
1007
|
-
className:
|
|
1006
|
+
ref: i,
|
|
1007
|
+
className: d(
|
|
1008
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
1009
|
t
|
|
1010
1010
|
),
|
|
1011
1011
|
checked: o,
|
|
1012
1012
|
...a,
|
|
1013
1013
|
children: [
|
|
1014
|
-
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(
|
|
1014
|
+
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(V.ItemIndicator, { children: /* @__PURE__ */ e(Lt, { className: "h-4 w-4" }) }) }),
|
|
1015
1015
|
n
|
|
1016
1016
|
]
|
|
1017
1017
|
}
|
|
1018
1018
|
));
|
|
1019
|
-
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1019
|
+
It.displayName = V.CheckboxItem.displayName;
|
|
1020
|
+
const Ht = ee.forwardRef(({ className: t, children: n, ...o }, a) => /* @__PURE__ */ r(
|
|
1021
|
+
V.RadioItem,
|
|
1022
1022
|
{
|
|
1023
1023
|
ref: a,
|
|
1024
|
-
className:
|
|
1024
|
+
className: d(
|
|
1025
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
1026
|
t
|
|
1027
1027
|
),
|
|
1028
1028
|
...o,
|
|
1029
1029
|
children: [
|
|
1030
|
-
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(
|
|
1030
|
+
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(V.ItemIndicator, { children: /* @__PURE__ */ e(Et, { className: "h-2 w-2 fill-current" }) }) }),
|
|
1031
1031
|
n
|
|
1032
1032
|
]
|
|
1033
1033
|
}
|
|
1034
1034
|
));
|
|
1035
|
-
|
|
1036
|
-
const
|
|
1037
|
-
|
|
1035
|
+
Ht.displayName = V.RadioItem.displayName;
|
|
1036
|
+
const Rt = ee.forwardRef(({ className: t, inset: n, ...o }, a) => /* @__PURE__ */ e(
|
|
1037
|
+
V.Label,
|
|
1038
1038
|
{
|
|
1039
1039
|
ref: a,
|
|
1040
|
-
className:
|
|
1040
|
+
className: d("px-2 py-1.5 text-sm font-semibold", n && "pl-8", t),
|
|
1041
1041
|
...o
|
|
1042
1042
|
}
|
|
1043
1043
|
));
|
|
1044
|
-
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1044
|
+
Rt.displayName = V.Label.displayName;
|
|
1045
|
+
const jt = ee.forwardRef(({ className: t, ...n }, o) => /* @__PURE__ */ e(
|
|
1046
|
+
V.Separator,
|
|
1047
1047
|
{
|
|
1048
1048
|
ref: o,
|
|
1049
|
-
className:
|
|
1049
|
+
className: d("-mx-1 my-1 h-px bg-muted", t),
|
|
1050
1050
|
...n
|
|
1051
1051
|
}
|
|
1052
1052
|
));
|
|
1053
|
-
|
|
1054
|
-
const
|
|
1053
|
+
jt.displayName = V.Separator.displayName;
|
|
1054
|
+
const Ot = dt(
|
|
1055
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
1056
|
{
|
|
1057
1057
|
variants: {
|
|
@@ -1066,9 +1066,9 @@ const Ht = ot(
|
|
|
1066
1066
|
}
|
|
1067
1067
|
);
|
|
1068
1068
|
function Pt({ className: t, variant: n, ...o }) {
|
|
1069
|
-
return /* @__PURE__ */ e("div", { className:
|
|
1069
|
+
return /* @__PURE__ */ e("div", { className: d(Ot({ variant: n }), t), ...o });
|
|
1070
1070
|
}
|
|
1071
|
-
function
|
|
1071
|
+
function Ft({ className: t }) {
|
|
1072
1072
|
return /* @__PURE__ */ e(
|
|
1073
1073
|
"svg",
|
|
1074
1074
|
{
|
|
@@ -1086,7 +1086,7 @@ function jt({ className: t }) {
|
|
|
1086
1086
|
}
|
|
1087
1087
|
);
|
|
1088
1088
|
}
|
|
1089
|
-
function
|
|
1089
|
+
function Vt({ className: t }) {
|
|
1090
1090
|
return /* @__PURE__ */ e(
|
|
1091
1091
|
"svg",
|
|
1092
1092
|
{
|
|
@@ -1104,7 +1104,7 @@ function Rt({ className: t }) {
|
|
|
1104
1104
|
}
|
|
1105
1105
|
);
|
|
1106
1106
|
}
|
|
1107
|
-
const
|
|
1107
|
+
const Gt = [
|
|
1108
1108
|
"January",
|
|
1109
1109
|
"February",
|
|
1110
1110
|
"March",
|
|
@@ -1118,52 +1118,52 @@ const Ot = [
|
|
|
1118
1118
|
"November",
|
|
1119
1119
|
"December"
|
|
1120
1120
|
];
|
|
1121
|
-
function
|
|
1121
|
+
function Ut({
|
|
1122
1122
|
date: t,
|
|
1123
1123
|
view: n,
|
|
1124
1124
|
events: o = [],
|
|
1125
1125
|
onNavigatePrev: a,
|
|
1126
|
-
onNavigateNext:
|
|
1127
|
-
weekStartsOn:
|
|
1128
|
-
showEventCount:
|
|
1129
|
-
className:
|
|
1126
|
+
onNavigateNext: i,
|
|
1127
|
+
weekStartsOn: p = 1,
|
|
1128
|
+
showEventCount: s = !0,
|
|
1129
|
+
className: y
|
|
1130
1130
|
}) {
|
|
1131
|
-
const
|
|
1132
|
-
return /* @__PURE__ */ r("div", { className:
|
|
1131
|
+
const k = Gt[t.getMonth()], l = t.getFullYear(), b = s ? gt(o, t, n, p) : 0, N = xt(t, n);
|
|
1132
|
+
return /* @__PURE__ */ r("div", { className: d("min-w-0 flex-1", y), children: [
|
|
1133
1133
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 sm:gap-2 flex-wrap", children: [
|
|
1134
1134
|
/* @__PURE__ */ r("span", { className: "text-base sm:text-lg font-semibold truncate", children: [
|
|
1135
|
-
|
|
1135
|
+
k,
|
|
1136
1136
|
" ",
|
|
1137
|
-
|
|
1137
|
+
l
|
|
1138
1138
|
] }),
|
|
1139
|
-
|
|
1139
|
+
s && /* @__PURE__ */ e(Pt, { variant: "outline", className: "px-1 sm:px-1.5 text-[10px] sm:text-xs shrink-0", children: b })
|
|
1140
1140
|
] }),
|
|
1141
1141
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 sm:gap-2", children: [
|
|
1142
1142
|
/* @__PURE__ */ e(
|
|
1143
|
-
|
|
1143
|
+
me,
|
|
1144
1144
|
{
|
|
1145
1145
|
variant: "outline",
|
|
1146
1146
|
size: "icon",
|
|
1147
1147
|
className: "size-5 sm:size-6 [&_svg]:size-3 sm:[&_svg]:size-4",
|
|
1148
1148
|
onClick: a,
|
|
1149
|
-
children: /* @__PURE__ */ e(
|
|
1149
|
+
children: /* @__PURE__ */ e(Ft, {})
|
|
1150
1150
|
}
|
|
1151
1151
|
),
|
|
1152
|
-
/* @__PURE__ */ e("p", { className: "text-xs sm:text-sm text-muted-foreground truncate", children:
|
|
1152
|
+
/* @__PURE__ */ e("p", { className: "text-xs sm:text-sm text-muted-foreground truncate", children: N }),
|
|
1153
1153
|
/* @__PURE__ */ e(
|
|
1154
|
-
|
|
1154
|
+
me,
|
|
1155
1155
|
{
|
|
1156
1156
|
variant: "outline",
|
|
1157
1157
|
size: "icon",
|
|
1158
1158
|
className: "size-5 sm:size-6 [&_svg]:size-3 sm:[&_svg]:size-4",
|
|
1159
|
-
onClick:
|
|
1160
|
-
children: /* @__PURE__ */ e(
|
|
1159
|
+
onClick: i,
|
|
1160
|
+
children: /* @__PURE__ */ e(Vt, {})
|
|
1161
1161
|
}
|
|
1162
1162
|
)
|
|
1163
1163
|
] })
|
|
1164
1164
|
] });
|
|
1165
1165
|
}
|
|
1166
|
-
const
|
|
1166
|
+
const qt = [
|
|
1167
1167
|
"JAN",
|
|
1168
1168
|
"FEB",
|
|
1169
1169
|
"MAR",
|
|
@@ -1177,13 +1177,13 @@ const Vt = [
|
|
|
1177
1177
|
"NOV",
|
|
1178
1178
|
"DEC"
|
|
1179
1179
|
];
|
|
1180
|
-
function
|
|
1180
|
+
function Kt({ onClick: t, className: n }) {
|
|
1181
1181
|
const o = /* @__PURE__ */ new Date();
|
|
1182
1182
|
return /* @__PURE__ */ r(
|
|
1183
1183
|
"button",
|
|
1184
1184
|
{
|
|
1185
1185
|
type: "button",
|
|
1186
|
-
className:
|
|
1186
|
+
className: d(
|
|
1187
1187
|
"flex size-11 sm:size-14 flex-col items-start overflow-hidden rounded-lg border shrink-0",
|
|
1188
1188
|
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1189
1189
|
"hover:bg-accent/50 transition-colors",
|
|
@@ -1191,13 +1191,13 @@ function Gt({ onClick: t, className: n }) {
|
|
|
1191
1191
|
),
|
|
1192
1192
|
onClick: t,
|
|
1193
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:
|
|
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: qt[o.getMonth()] }),
|
|
1195
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
1196
|
]
|
|
1197
1197
|
}
|
|
1198
1198
|
);
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1200
|
+
function Xt({ className: t }) {
|
|
1201
1201
|
return /* @__PURE__ */ r(
|
|
1202
1202
|
"svg",
|
|
1203
1203
|
{
|
|
@@ -1226,7 +1226,7 @@ function Ut({ className: t }) {
|
|
|
1226
1226
|
}
|
|
1227
1227
|
);
|
|
1228
1228
|
}
|
|
1229
|
-
function
|
|
1229
|
+
function ke({ className: t }) {
|
|
1230
1230
|
return /* @__PURE__ */ r(
|
|
1231
1231
|
"svg",
|
|
1232
1232
|
{
|
|
@@ -1249,7 +1249,7 @@ function Ne({ className: t }) {
|
|
|
1249
1249
|
}
|
|
1250
1250
|
);
|
|
1251
1251
|
}
|
|
1252
|
-
function
|
|
1252
|
+
function Je({ className: t }) {
|
|
1253
1253
|
return /* @__PURE__ */ e(
|
|
1254
1254
|
"svg",
|
|
1255
1255
|
{
|
|
@@ -1267,7 +1267,7 @@ function Ke({ className: t }) {
|
|
|
1267
1267
|
}
|
|
1268
1268
|
);
|
|
1269
1269
|
}
|
|
1270
|
-
function
|
|
1270
|
+
function Yt({ className: t }) {
|
|
1271
1271
|
return /* @__PURE__ */ r(
|
|
1272
1272
|
"svg",
|
|
1273
1273
|
{
|
|
@@ -1288,7 +1288,7 @@ function qt({ className: t }) {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
);
|
|
1290
1290
|
}
|
|
1291
|
-
function
|
|
1291
|
+
function Ze({ className: t }) {
|
|
1292
1292
|
return /* @__PURE__ */ r(
|
|
1293
1293
|
"svg",
|
|
1294
1294
|
{
|
|
@@ -1309,7 +1309,7 @@ function Ye({ className: t }) {
|
|
|
1309
1309
|
}
|
|
1310
1310
|
);
|
|
1311
1311
|
}
|
|
1312
|
-
function
|
|
1312
|
+
function Jt({ className: t }) {
|
|
1313
1313
|
return /* @__PURE__ */ r(
|
|
1314
1314
|
"svg",
|
|
1315
1315
|
{
|
|
@@ -1334,7 +1334,7 @@ function Kt({ className: t }) {
|
|
|
1334
1334
|
}
|
|
1335
1335
|
);
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function Zt({ className: t }) {
|
|
1338
1338
|
return /* @__PURE__ */ r(
|
|
1339
1339
|
"svg",
|
|
1340
1340
|
{
|
|
@@ -1355,7 +1355,7 @@ function Yt({ className: t }) {
|
|
|
1355
1355
|
}
|
|
1356
1356
|
);
|
|
1357
1357
|
}
|
|
1358
|
-
function
|
|
1358
|
+
function Qt({ className: t }) {
|
|
1359
1359
|
return /* @__PURE__ */ r(
|
|
1360
1360
|
"svg",
|
|
1361
1361
|
{
|
|
@@ -1377,7 +1377,7 @@ function Xt({ className: t }) {
|
|
|
1377
1377
|
}
|
|
1378
1378
|
);
|
|
1379
1379
|
}
|
|
1380
|
-
function
|
|
1380
|
+
function en({ className: t }) {
|
|
1381
1381
|
return /* @__PURE__ */ r(
|
|
1382
1382
|
"svg",
|
|
1383
1383
|
{
|
|
@@ -1401,360 +1401,360 @@ function Jt({ className: t }) {
|
|
|
1401
1401
|
}
|
|
1402
1402
|
);
|
|
1403
1403
|
}
|
|
1404
|
-
const
|
|
1405
|
-
{ value: "day", label: "Day", icon:
|
|
1406
|
-
{ value: "week", label: "Week", icon:
|
|
1407
|
-
{ value: "month", label: "Month", icon:
|
|
1408
|
-
{ value: "year", label: "Year", icon:
|
|
1404
|
+
const tn = [
|
|
1405
|
+
{ value: "day", label: "Day", icon: Jt },
|
|
1406
|
+
{ value: "week", label: "Week", icon: Zt },
|
|
1407
|
+
{ value: "month", label: "Month", icon: Qt },
|
|
1408
|
+
{ value: "year", label: "Year", icon: en }
|
|
1409
1409
|
// { value: 'agenda', label: 'Agenda', icon: ListIcon }, NOTE: Not needed currently
|
|
1410
|
-
],
|
|
1411
|
-
{ value: "timeline-day", label: "1 Day", icon:
|
|
1412
|
-
{ value: "timeline-3day", label: "3 Days", icon:
|
|
1413
|
-
{ value: "timeline-week", label: "7 Days", icon:
|
|
1410
|
+
], Qe = [
|
|
1411
|
+
{ value: "timeline-day", label: "1 Day", icon: ke },
|
|
1412
|
+
{ value: "timeline-3day", label: "3 Days", icon: ke },
|
|
1413
|
+
{ value: "timeline-week", label: "7 Days", icon: ke }
|
|
1414
1414
|
];
|
|
1415
|
-
function
|
|
1415
|
+
function Dn({
|
|
1416
1416
|
currentDate: t,
|
|
1417
1417
|
view: n,
|
|
1418
1418
|
events: o = [],
|
|
1419
1419
|
onNavigateToday: a,
|
|
1420
|
-
onNavigatePrev:
|
|
1421
|
-
onNavigateNext:
|
|
1422
|
-
onNavigate:
|
|
1423
|
-
onViewChange:
|
|
1424
|
-
onAddEvent:
|
|
1425
|
-
availableViews:
|
|
1426
|
-
showTimelineViews:
|
|
1427
|
-
timelineViews:
|
|
1428
|
-
settingsContent:
|
|
1429
|
-
showSettings:
|
|
1430
|
-
filterContent:
|
|
1420
|
+
onNavigatePrev: i,
|
|
1421
|
+
onNavigateNext: p,
|
|
1422
|
+
onNavigate: s,
|
|
1423
|
+
onViewChange: y,
|
|
1424
|
+
onAddEvent: k,
|
|
1425
|
+
availableViews: l = ["day", "week", "month", "agenda"],
|
|
1426
|
+
showTimelineViews: b = !1,
|
|
1427
|
+
timelineViews: N,
|
|
1428
|
+
settingsContent: m,
|
|
1429
|
+
showSettings: g = !1,
|
|
1430
|
+
filterContent: u,
|
|
1431
1431
|
actions: w,
|
|
1432
|
-
className:
|
|
1433
|
-
weekStartsOn:
|
|
1434
|
-
labels:
|
|
1432
|
+
className: v,
|
|
1433
|
+
weekStartsOn: W = 1,
|
|
1434
|
+
labels: T = {}
|
|
1435
1435
|
}) {
|
|
1436
|
-
const
|
|
1436
|
+
const A = F(
|
|
1437
1437
|
() => ({
|
|
1438
1438
|
today: "Today",
|
|
1439
1439
|
addEvent: "Add Event",
|
|
1440
1440
|
calendarView: "Calendar View",
|
|
1441
1441
|
resourceView: "Resource View",
|
|
1442
|
-
...
|
|
1442
|
+
...T
|
|
1443
1443
|
}),
|
|
1444
|
-
[
|
|
1445
|
-
),
|
|
1446
|
-
a?.(),
|
|
1444
|
+
[T]
|
|
1445
|
+
), j = () => {
|
|
1446
|
+
a?.(), s?.("today");
|
|
1447
|
+
}, E = () => {
|
|
1448
|
+
i?.(), s?.("prev");
|
|
1447
1449
|
}, _ = () => {
|
|
1448
|
-
|
|
1449
|
-
}, T = () => {
|
|
1450
|
-
b?.(), u?.("next");
|
|
1450
|
+
p?.(), s?.("next");
|
|
1451
1451
|
}, M = ["day", "week", "month", "year", "agenda"].includes(
|
|
1452
1452
|
n
|
|
1453
|
-
),
|
|
1454
|
-
(
|
|
1455
|
-
),
|
|
1456
|
-
return /* @__PURE__ */ r("div", { className:
|
|
1453
|
+
), I = n.startsWith("timeline-") || n.startsWith("resource-"), S = tn.filter(
|
|
1454
|
+
(f) => l.includes(f.value)
|
|
1455
|
+
), $ = M ? S.find((f) => f.value === n) : null, q = I ? Qe.find((f) => f.value === n) : null;
|
|
1456
|
+
return /* @__PURE__ */ r("div", { className: d("flex flex-col w-full gap-3 mb-2", v), children: [
|
|
1457
1457
|
/* @__PURE__ */ r("div", { className: "flex lg:flex-row flex-col w-full justify-between gap-3", children: [
|
|
1458
1458
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1459
1459
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 sm:gap-3 min-w-0", children: [
|
|
1460
|
-
/* @__PURE__ */ e(
|
|
1460
|
+
/* @__PURE__ */ e(Kt, { onClick: j }),
|
|
1461
1461
|
/* @__PURE__ */ e(
|
|
1462
|
-
|
|
1462
|
+
Ut,
|
|
1463
1463
|
{
|
|
1464
1464
|
date: t,
|
|
1465
1465
|
view: n,
|
|
1466
1466
|
events: o,
|
|
1467
|
-
onNavigatePrev:
|
|
1468
|
-
onNavigateNext:
|
|
1469
|
-
weekStartsOn:
|
|
1467
|
+
onNavigatePrev: E,
|
|
1468
|
+
onNavigateNext: _,
|
|
1469
|
+
weekStartsOn: W
|
|
1470
1470
|
}
|
|
1471
1471
|
)
|
|
1472
1472
|
] }),
|
|
1473
|
-
|
|
1474
|
-
|
|
1473
|
+
k && /* @__PURE__ */ e(
|
|
1474
|
+
me,
|
|
1475
1475
|
{
|
|
1476
1476
|
size: "icon",
|
|
1477
1477
|
className: "shrink-0 lg:hidden",
|
|
1478
|
-
onClick:
|
|
1479
|
-
children: /* @__PURE__ */ e(
|
|
1478
|
+
onClick: k,
|
|
1479
|
+
children: /* @__PURE__ */ e(Ze, { className: "size-4" })
|
|
1480
1480
|
}
|
|
1481
1481
|
)
|
|
1482
1482
|
] }),
|
|
1483
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
|
-
|
|
1484
|
+
y && S.length > 0 && /* @__PURE__ */ r(Xe, { children: [
|
|
1485
1485
|
/* @__PURE__ */ r(
|
|
1486
|
-
|
|
1486
|
+
Ye,
|
|
1487
1487
|
{
|
|
1488
|
-
className:
|
|
1488
|
+
className: d(
|
|
1489
1489
|
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors",
|
|
1490
1490
|
"h-10 px-2 sm:px-3 gap-1 sm:gap-1.5 shrink-0",
|
|
1491
1491
|
M ? "bg-primary text-primary-foreground hover:bg-primary/90" : "border border-input bg-background hover:bg-accent hover:text-accent-foreground"
|
|
1492
1492
|
),
|
|
1493
1493
|
children: [
|
|
1494
|
-
/* @__PURE__ */ e(
|
|
1495
|
-
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children:
|
|
1496
|
-
/* @__PURE__ */ e(
|
|
1494
|
+
/* @__PURE__ */ e(Xt, { className: "size-4" }),
|
|
1495
|
+
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: $?.label ?? A.calendarView }),
|
|
1496
|
+
/* @__PURE__ */ e(Je, { className: "size-3 opacity-60" })
|
|
1497
1497
|
]
|
|
1498
1498
|
}
|
|
1499
1499
|
),
|
|
1500
|
-
/* @__PURE__ */ e(
|
|
1501
|
-
const
|
|
1500
|
+
/* @__PURE__ */ e(Ee, { align: "start", className: "min-w-[120px]", children: S.map((f) => {
|
|
1501
|
+
const x = f.icon;
|
|
1502
1502
|
return /* @__PURE__ */ r(
|
|
1503
|
-
|
|
1503
|
+
Be,
|
|
1504
1504
|
{
|
|
1505
|
-
onClick: () =>
|
|
1506
|
-
className:
|
|
1505
|
+
onClick: () => y(f.value),
|
|
1506
|
+
className: d(
|
|
1507
1507
|
"gap-2",
|
|
1508
|
-
n ===
|
|
1508
|
+
n === f.value && "bg-accent"
|
|
1509
1509
|
),
|
|
1510
1510
|
children: [
|
|
1511
|
-
/* @__PURE__ */ e(
|
|
1512
|
-
/* @__PURE__ */ e("span", { children:
|
|
1511
|
+
/* @__PURE__ */ e(x, { className: "size-4" }),
|
|
1512
|
+
/* @__PURE__ */ e("span", { children: f.label })
|
|
1513
1513
|
]
|
|
1514
1514
|
},
|
|
1515
|
-
|
|
1515
|
+
f.value
|
|
1516
1516
|
);
|
|
1517
1517
|
}) })
|
|
1518
1518
|
] }),
|
|
1519
|
-
|
|
1519
|
+
b && y && /* @__PURE__ */ r(Xe, { children: [
|
|
1520
1520
|
/* @__PURE__ */ r(
|
|
1521
|
-
|
|
1521
|
+
Ye,
|
|
1522
1522
|
{
|
|
1523
|
-
className:
|
|
1523
|
+
className: d(
|
|
1524
1524
|
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors",
|
|
1525
1525
|
"h-10 px-2 sm:px-3 gap-1 sm:gap-1.5 shrink-0",
|
|
1526
|
-
|
|
1526
|
+
I ? "bg-primary text-primary-foreground hover:bg-primary/90" : "border border-input bg-white hover:bg-zinc-50 hover:text-accent-foreground"
|
|
1527
1527
|
),
|
|
1528
1528
|
children: [
|
|
1529
|
-
/* @__PURE__ */ e(
|
|
1530
|
-
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: q?.label ??
|
|
1531
|
-
/* @__PURE__ */ e(
|
|
1529
|
+
/* @__PURE__ */ e(ke, { className: "size-4" }),
|
|
1530
|
+
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: q?.label ?? A.resourceView }),
|
|
1531
|
+
/* @__PURE__ */ e(Je, { className: "size-3 opacity-60" })
|
|
1532
1532
|
]
|
|
1533
1533
|
}
|
|
1534
1534
|
),
|
|
1535
|
-
/* @__PURE__ */ e(
|
|
1536
|
-
const
|
|
1535
|
+
/* @__PURE__ */ e(Ee, { align: "start", className: "min-w-[120px]", children: Qe.map((f) => {
|
|
1536
|
+
const x = f.icon;
|
|
1537
1537
|
return /* @__PURE__ */ r(
|
|
1538
|
-
|
|
1538
|
+
Be,
|
|
1539
1539
|
{
|
|
1540
|
-
onClick: () =>
|
|
1541
|
-
className:
|
|
1540
|
+
onClick: () => y(f.value),
|
|
1541
|
+
className: d(
|
|
1542
1542
|
"gap-2",
|
|
1543
|
-
n ===
|
|
1543
|
+
n === f.value && "bg-accent"
|
|
1544
1544
|
),
|
|
1545
1545
|
children: [
|
|
1546
|
-
/* @__PURE__ */ e(
|
|
1547
|
-
/* @__PURE__ */ e("span", { children:
|
|
1546
|
+
/* @__PURE__ */ e(x, { className: "size-4" }),
|
|
1547
|
+
/* @__PURE__ */ e("span", { children: f.label })
|
|
1548
1548
|
]
|
|
1549
1549
|
},
|
|
1550
|
-
|
|
1550
|
+
f.value
|
|
1551
1551
|
);
|
|
1552
1552
|
}) })
|
|
1553
1553
|
] }),
|
|
1554
|
-
|
|
1555
|
-
/* @__PURE__ */ e(
|
|
1556
|
-
|
|
1554
|
+
g && m && /* @__PURE__ */ r(re, { children: [
|
|
1555
|
+
/* @__PURE__ */ e(oe, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1556
|
+
me,
|
|
1557
1557
|
{
|
|
1558
1558
|
variant: "outline",
|
|
1559
1559
|
size: "icon",
|
|
1560
1560
|
className: "min-w-10 min-h-10 shrink-0 mx-0",
|
|
1561
|
-
children: /* @__PURE__ */ e(
|
|
1561
|
+
children: /* @__PURE__ */ e(Yt, { className: "size-4 sm:size-5" })
|
|
1562
1562
|
}
|
|
1563
1563
|
) }),
|
|
1564
1564
|
/* @__PURE__ */ e(
|
|
1565
|
-
|
|
1565
|
+
Q,
|
|
1566
1566
|
{
|
|
1567
1567
|
className: "w-auto min-w-80 p-0",
|
|
1568
1568
|
align: "end",
|
|
1569
1569
|
sideOffset: 8,
|
|
1570
|
-
children: /* @__PURE__ */ e("div", { className: "max-h-[70vh] overflow-y-auto p-4 space-y-6", children:
|
|
1570
|
+
children: /* @__PURE__ */ e("div", { className: "max-h-[70vh] overflow-y-auto p-4 space-y-6", children: m })
|
|
1571
1571
|
}
|
|
1572
1572
|
)
|
|
1573
1573
|
] }),
|
|
1574
1574
|
w,
|
|
1575
|
-
|
|
1576
|
-
|
|
1575
|
+
k && /* @__PURE__ */ r(
|
|
1576
|
+
me,
|
|
1577
1577
|
{
|
|
1578
1578
|
className: "hidden lg:flex shrink-0 max-h-10",
|
|
1579
|
-
onClick:
|
|
1579
|
+
onClick: k,
|
|
1580
1580
|
children: [
|
|
1581
|
-
/* @__PURE__ */ e(
|
|
1582
|
-
|
|
1581
|
+
/* @__PURE__ */ e(Ze, { className: "size-4" }),
|
|
1582
|
+
A.addEvent
|
|
1583
1583
|
]
|
|
1584
1584
|
}
|
|
1585
1585
|
)
|
|
1586
1586
|
] })
|
|
1587
1587
|
] }),
|
|
1588
|
-
|
|
1588
|
+
u && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 pb-1 -mb-1 scrollbar-none", children: u })
|
|
1589
1589
|
] });
|
|
1590
1590
|
}
|
|
1591
|
-
function
|
|
1591
|
+
function Cn({
|
|
1592
1592
|
events: t,
|
|
1593
1593
|
date: n,
|
|
1594
1594
|
daysAhead: o = 60,
|
|
1595
1595
|
badgeVariant: a = "colored",
|
|
1596
|
-
onEventClick:
|
|
1597
|
-
className:
|
|
1598
|
-
renderEvent:
|
|
1599
|
-
renderPopover:
|
|
1600
|
-
slots:
|
|
1601
|
-
classNames:
|
|
1596
|
+
onEventClick: i,
|
|
1597
|
+
className: p,
|
|
1598
|
+
renderEvent: s,
|
|
1599
|
+
renderPopover: y,
|
|
1600
|
+
slots: k,
|
|
1601
|
+
classNames: l
|
|
1602
1602
|
}) {
|
|
1603
|
-
const
|
|
1604
|
-
const
|
|
1605
|
-
|
|
1606
|
-
const
|
|
1607
|
-
return
|
|
1608
|
-
}, [t, o, n]),
|
|
1609
|
-
const
|
|
1610
|
-
for (const [
|
|
1611
|
-
|
|
1612
|
-
date: new Date(
|
|
1613
|
-
dateKey:
|
|
1603
|
+
const b = F(() => {
|
|
1604
|
+
const m = new Date(n);
|
|
1605
|
+
m.setHours(0, 0, 0, 0);
|
|
1606
|
+
const g = new Date(m);
|
|
1607
|
+
return g.setDate(g.getDate() + o), t.filter((u) => u.endDate >= m && u.startDate <= g);
|
|
1608
|
+
}, [t, o, n]), N = F(() => {
|
|
1609
|
+
const m = yt(b), g = [];
|
|
1610
|
+
for (const [u, w] of m)
|
|
1611
|
+
g.push({
|
|
1612
|
+
date: new Date(u),
|
|
1613
|
+
dateKey: u,
|
|
1614
1614
|
events: w
|
|
1615
1615
|
});
|
|
1616
|
-
return
|
|
1617
|
-
}, [
|
|
1618
|
-
return
|
|
1616
|
+
return g.sort((u, w) => u.date.getTime() - w.date.getTime()), g;
|
|
1617
|
+
}, [b]);
|
|
1618
|
+
return N.length === 0 ? /* @__PURE__ */ e("div", { className: d("flex flex-col items-center justify-center h-full py-12", p), children: /* @__PURE__ */ r("div", { className: "text-center", children: [
|
|
1619
1619
|
/* @__PURE__ */ e("p", { className: "text-muted-foreground", children: "No events found" }),
|
|
1620
1620
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground/70", children: "No events scheduled for this period" })
|
|
1621
|
-
] }) }) : /* @__PURE__ */ r("div", { className:
|
|
1621
|
+
] }) }) : /* @__PURE__ */ r("div", { className: d("flex flex-col h-full overflow-auto", l?.agendaList, p), children: [
|
|
1622
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
1623
|
/* @__PURE__ */ e("h2", { className: "text-lg font-medium", children: "Schedule" }),
|
|
1624
1624
|
/* @__PURE__ */ r("span", { className: "text-sm text-muted-foreground", children: [
|
|
1625
|
-
|
|
1625
|
+
b.length,
|
|
1626
1626
|
" event",
|
|
1627
|
-
|
|
1627
|
+
b.length !== 1 ? "s" : ""
|
|
1628
1628
|
] })
|
|
1629
1629
|
] }) }),
|
|
1630
|
-
/* @__PURE__ */ e("div", { className: "flex-1", children:
|
|
1631
|
-
const w =
|
|
1632
|
-
return /* @__PURE__ */ r("div", { className:
|
|
1630
|
+
/* @__PURE__ */ e("div", { className: "flex-1", children: N.map(({ date: m, dateKey: g, events: u }) => {
|
|
1631
|
+
const w = ce(m), v = m.toLocaleDateString([], { weekday: "short" }), W = m.getDate(), T = m.toLocaleDateString([], { month: "short" });
|
|
1632
|
+
return /* @__PURE__ */ r("div", { className: d("", l?.agendaDayGroup), children: [
|
|
1633
1633
|
/* @__PURE__ */ e(
|
|
1634
1634
|
"div",
|
|
1635
1635
|
{
|
|
1636
|
-
className:
|
|
1636
|
+
className: d(
|
|
1637
1637
|
"sticky top-[52px] z-10 bg-background px-4 py-3 border-b",
|
|
1638
|
-
|
|
1638
|
+
l?.agendaDayHeader
|
|
1639
1639
|
),
|
|
1640
1640
|
children: /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
|
|
1641
1641
|
/* @__PURE__ */ r("div", { className: "flex flex-col items-center min-w-[40px]", children: [
|
|
1642
1642
|
/* @__PURE__ */ e(
|
|
1643
1643
|
"span",
|
|
1644
1644
|
{
|
|
1645
|
-
className:
|
|
1645
|
+
className: d(
|
|
1646
1646
|
"text-[11px] font-medium uppercase tracking-wide",
|
|
1647
1647
|
w ? "text-primary" : "text-muted-foreground"
|
|
1648
1648
|
),
|
|
1649
|
-
children:
|
|
1649
|
+
children: v
|
|
1650
1650
|
}
|
|
1651
1651
|
),
|
|
1652
1652
|
/* @__PURE__ */ e(
|
|
1653
1653
|
"span",
|
|
1654
1654
|
{
|
|
1655
|
-
className:
|
|
1655
|
+
className: d(
|
|
1656
1656
|
"flex items-center justify-center rounded-full mt-0.5",
|
|
1657
1657
|
"size-10 text-xl font-normal",
|
|
1658
1658
|
w ? "bg-primary text-primary-foreground" : "text-foreground"
|
|
1659
1659
|
),
|
|
1660
|
-
children:
|
|
1660
|
+
children: W
|
|
1661
1661
|
}
|
|
1662
1662
|
)
|
|
1663
1663
|
] }),
|
|
1664
1664
|
/* @__PURE__ */ r("span", { className: "text-sm text-muted-foreground", children: [
|
|
1665
|
-
|
|
1665
|
+
T,
|
|
1666
1666
|
" ",
|
|
1667
|
-
|
|
1667
|
+
m.getFullYear()
|
|
1668
1668
|
] })
|
|
1669
1669
|
] })
|
|
1670
1670
|
}
|
|
1671
1671
|
),
|
|
1672
|
-
/* @__PURE__ */ e("div", { className: "px-4 py-3 space-y-2 border-b last:border-b-0", children:
|
|
1673
|
-
(
|
|
1674
|
-
|
|
1672
|
+
/* @__PURE__ */ e("div", { className: "px-4 py-3 space-y-2 border-b last:border-b-0", children: u.map(
|
|
1673
|
+
(A) => s ? /* @__PURE__ */ e("div", { children: s({ event: A, variant: "full" }) }, A.id) : /* @__PURE__ */ e(
|
|
1674
|
+
Se,
|
|
1675
1675
|
{
|
|
1676
|
-
event:
|
|
1676
|
+
event: A,
|
|
1677
1677
|
variant: "full",
|
|
1678
1678
|
badgeVariant: a,
|
|
1679
|
-
onClick:
|
|
1680
|
-
disablePopover: !!
|
|
1681
|
-
renderPopover:
|
|
1679
|
+
onClick: i,
|
|
1680
|
+
disablePopover: !!i && !y,
|
|
1681
|
+
renderPopover: y,
|
|
1682
1682
|
showTime: !0,
|
|
1683
1683
|
showDescription: !0,
|
|
1684
1684
|
showParticipants: !0,
|
|
1685
|
-
...
|
|
1685
|
+
...l?.eventCard && { className: l.eventCard }
|
|
1686
1686
|
},
|
|
1687
|
-
|
|
1687
|
+
A.id
|
|
1688
1688
|
)
|
|
1689
1689
|
) })
|
|
1690
|
-
] },
|
|
1690
|
+
] }, g);
|
|
1691
1691
|
}) })
|
|
1692
1692
|
] });
|
|
1693
1693
|
}
|
|
1694
|
-
const be = 360,
|
|
1695
|
-
function
|
|
1694
|
+
const be = 360, we = 480, Te = 280;
|
|
1695
|
+
function nn({
|
|
1696
1696
|
isOpen: t,
|
|
1697
1697
|
onClose: n,
|
|
1698
1698
|
date: o,
|
|
1699
1699
|
events: a,
|
|
1700
|
-
anchorRect:
|
|
1701
|
-
badgeVariant:
|
|
1702
|
-
onEventClick:
|
|
1703
|
-
renderEvent:
|
|
1704
|
-
renderPopover:
|
|
1705
|
-
className:
|
|
1700
|
+
anchorRect: i,
|
|
1701
|
+
badgeVariant: p = "colored",
|
|
1702
|
+
onEventClick: s,
|
|
1703
|
+
renderEvent: y,
|
|
1704
|
+
renderPopover: k,
|
|
1705
|
+
className: l
|
|
1706
1706
|
}) {
|
|
1707
|
-
const
|
|
1708
|
-
() => [...a].sort((
|
|
1707
|
+
const b = te(null), N = te(null), [m, g] = J("closed"), u = F(
|
|
1708
|
+
() => [...a].sort((E, _) => E.startDate.getTime() - _.startDate.getTime()),
|
|
1709
1709
|
[a]
|
|
1710
|
-
), w =
|
|
1711
|
-
if (!
|
|
1712
|
-
const
|
|
1713
|
-
let M =
|
|
1714
|
-
M = Math.max(16, Math.min(M,
|
|
1715
|
-
const
|
|
1716
|
-
let
|
|
1717
|
-
return
|
|
1718
|
-
}, [
|
|
1719
|
-
|
|
1720
|
-
if (t &&
|
|
1721
|
-
|
|
1710
|
+
), w = F(() => {
|
|
1711
|
+
if (!i) return { top: 0, left: 0, width: be, maxHeight: we };
|
|
1712
|
+
const E = typeof window < "u" ? window.innerWidth : 1200, _ = typeof window < "u" ? window.innerHeight : 800;
|
|
1713
|
+
let M = i.left + i.width / 2 - be / 2;
|
|
1714
|
+
M = Math.max(16, Math.min(M, E - be - 16));
|
|
1715
|
+
const I = Math.min(a.length * 68 + 80, we);
|
|
1716
|
+
let S = i.top + i.height / 2 - I / 2;
|
|
1717
|
+
return S = Math.max(16, Math.min(S, _ - I - 16)), { top: S, left: M, width: be, maxHeight: we };
|
|
1718
|
+
}, [i, a.length]);
|
|
1719
|
+
Ie(() => {
|
|
1720
|
+
if (t && i)
|
|
1721
|
+
g("entering"), requestAnimationFrame(() => {
|
|
1722
1722
|
requestAnimationFrame(() => {
|
|
1723
|
-
|
|
1723
|
+
g("open");
|
|
1724
1724
|
});
|
|
1725
1725
|
});
|
|
1726
|
-
else if (!t &&
|
|
1727
|
-
|
|
1728
|
-
const
|
|
1729
|
-
|
|
1730
|
-
},
|
|
1731
|
-
return () => clearTimeout(
|
|
1726
|
+
else if (!t && m === "open") {
|
|
1727
|
+
g("exiting");
|
|
1728
|
+
const E = setTimeout(() => {
|
|
1729
|
+
g("closed");
|
|
1730
|
+
}, Te);
|
|
1731
|
+
return () => clearTimeout(E);
|
|
1732
1732
|
}
|
|
1733
|
-
}, [t,
|
|
1734
|
-
if (
|
|
1735
|
-
const
|
|
1736
|
-
|
|
1733
|
+
}, [t, i]), Ae(() => {
|
|
1734
|
+
if (m === "closed") return;
|
|
1735
|
+
const E = (_) => {
|
|
1736
|
+
_.key === "Escape" && (_.stopPropagation(), n());
|
|
1737
1737
|
};
|
|
1738
|
-
return document.addEventListener("keydown",
|
|
1739
|
-
}, [
|
|
1740
|
-
|
|
1741
|
-
}, [
|
|
1742
|
-
const
|
|
1743
|
-
(
|
|
1744
|
-
|
|
1738
|
+
return document.addEventListener("keydown", E), () => document.removeEventListener("keydown", E);
|
|
1739
|
+
}, [m, n]), Ae(() => {
|
|
1740
|
+
m === "open" && N.current && N.current.focus();
|
|
1741
|
+
}, [m]);
|
|
1742
|
+
const v = L(
|
|
1743
|
+
(E) => {
|
|
1744
|
+
E.target === b.current && n();
|
|
1745
1745
|
},
|
|
1746
1746
|
[n]
|
|
1747
1747
|
);
|
|
1748
|
-
if (
|
|
1749
|
-
const
|
|
1748
|
+
if (m === "closed") return null;
|
|
1749
|
+
const W = m === "entering" || m === "exiting", T = W && i ? {
|
|
1750
1750
|
// Collapsed state: match the day cell exactly
|
|
1751
1751
|
position: "fixed",
|
|
1752
|
-
top:
|
|
1753
|
-
left:
|
|
1754
|
-
width:
|
|
1755
|
-
height:
|
|
1756
|
-
maxHeight:
|
|
1757
|
-
opacity:
|
|
1752
|
+
top: i.top,
|
|
1753
|
+
left: i.left,
|
|
1754
|
+
width: i.width,
|
|
1755
|
+
height: i.height,
|
|
1756
|
+
maxHeight: i.height,
|
|
1757
|
+
opacity: m === "entering" ? 0.7 : 0,
|
|
1758
1758
|
transform: "scale(1)",
|
|
1759
1759
|
borderRadius: "8px"
|
|
1760
1760
|
} : {
|
|
@@ -1767,53 +1767,53 @@ function Qt({
|
|
|
1767
1767
|
opacity: 1,
|
|
1768
1768
|
transform: "scale(1)",
|
|
1769
1769
|
borderRadius: "12px"
|
|
1770
|
-
},
|
|
1770
|
+
}, A = W ? 0 : 1, j = o.toLocaleDateString(void 0, {
|
|
1771
1771
|
weekday: "long",
|
|
1772
1772
|
month: "long",
|
|
1773
1773
|
day: "numeric"
|
|
1774
1774
|
});
|
|
1775
|
-
return /* @__PURE__ */ r(
|
|
1775
|
+
return /* @__PURE__ */ r(pt, { children: [
|
|
1776
1776
|
/* @__PURE__ */ e(
|
|
1777
1777
|
"div",
|
|
1778
1778
|
{
|
|
1779
|
-
ref:
|
|
1779
|
+
ref: b,
|
|
1780
1780
|
role: "presentation",
|
|
1781
|
-
onClick:
|
|
1781
|
+
onClick: v,
|
|
1782
1782
|
className: "ic-expansion-backdrop",
|
|
1783
1783
|
style: {
|
|
1784
1784
|
position: "fixed",
|
|
1785
1785
|
inset: 0,
|
|
1786
1786
|
zIndex: 50,
|
|
1787
1787
|
backgroundColor: "rgba(0, 0, 0, 0.2)",
|
|
1788
|
-
opacity:
|
|
1789
|
-
transition: `opacity ${
|
|
1788
|
+
opacity: A,
|
|
1789
|
+
transition: `opacity ${Te}ms cubic-bezier(0.32, 0.72, 0, 1)`
|
|
1790
1790
|
}
|
|
1791
1791
|
}
|
|
1792
1792
|
),
|
|
1793
1793
|
/* @__PURE__ */ r(
|
|
1794
1794
|
"div",
|
|
1795
1795
|
{
|
|
1796
|
-
ref:
|
|
1796
|
+
ref: N,
|
|
1797
1797
|
role: "dialog",
|
|
1798
1798
|
"aria-modal": "true",
|
|
1799
|
-
"aria-label": `Events for ${
|
|
1799
|
+
"aria-label": `Events for ${j}`,
|
|
1800
1800
|
tabIndex: -1,
|
|
1801
|
-
className:
|
|
1801
|
+
className: d(
|
|
1802
1802
|
"ic-expansion-panel",
|
|
1803
1803
|
"bg-background border border-border shadow-2xl overflow-hidden",
|
|
1804
1804
|
"focus:outline-none",
|
|
1805
|
-
|
|
1805
|
+
l
|
|
1806
1806
|
),
|
|
1807
1807
|
style: {
|
|
1808
|
-
...
|
|
1808
|
+
...T,
|
|
1809
1809
|
zIndex: 51,
|
|
1810
|
-
transition: `all ${
|
|
1810
|
+
transition: `all ${Te}ms cubic-bezier(0.32, 0.72, 0, 1)`,
|
|
1811
1811
|
willChange: "top, left, width, height, max-height, opacity, border-radius"
|
|
1812
1812
|
},
|
|
1813
1813
|
children: [
|
|
1814
1814
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between px-4 py-3 border-b bg-muted/30", children: [
|
|
1815
1815
|
/* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
1816
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-semibold text-foreground", children:
|
|
1816
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-semibold text-foreground", children: j }),
|
|
1817
1817
|
/* @__PURE__ */ r("span", { className: "text-xs text-muted-foreground", children: [
|
|
1818
1818
|
a.length,
|
|
1819
1819
|
" event",
|
|
@@ -1851,28 +1851,28 @@ function Qt({
|
|
|
1851
1851
|
"div",
|
|
1852
1852
|
{
|
|
1853
1853
|
className: "overflow-y-auto px-3 py-2 space-y-1.5",
|
|
1854
|
-
style: { maxHeight: `${
|
|
1854
|
+
style: { maxHeight: `${we - 64}px` },
|
|
1855
1855
|
children: [
|
|
1856
|
-
|
|
1856
|
+
u.map((E) => /* @__PURE__ */ e(
|
|
1857
1857
|
"div",
|
|
1858
1858
|
{
|
|
1859
|
-
onPointerDown: (
|
|
1860
|
-
children:
|
|
1861
|
-
|
|
1859
|
+
onPointerDown: (_) => _.stopPropagation(),
|
|
1860
|
+
children: y ? y({ event: E, variant: "compact" }) : /* @__PURE__ */ e(
|
|
1861
|
+
Se,
|
|
1862
1862
|
{
|
|
1863
|
-
event:
|
|
1863
|
+
event: E,
|
|
1864
1864
|
variant: "compact",
|
|
1865
|
-
badgeVariant:
|
|
1866
|
-
onClick: (
|
|
1867
|
-
n(),
|
|
1865
|
+
badgeVariant: p,
|
|
1866
|
+
onClick: (_) => {
|
|
1867
|
+
n(), s?.(_);
|
|
1868
1868
|
},
|
|
1869
|
-
disablePopover: !!
|
|
1870
|
-
renderPopover:
|
|
1869
|
+
disablePopover: !!s && !k,
|
|
1870
|
+
renderPopover: k,
|
|
1871
1871
|
showTime: !0
|
|
1872
1872
|
}
|
|
1873
1873
|
)
|
|
1874
1874
|
},
|
|
1875
|
-
|
|
1875
|
+
E.id
|
|
1876
1876
|
)),
|
|
1877
1877
|
a.length === 0 && /* @__PURE__ */ e("div", { className: "py-6 text-center text-sm text-muted-foreground", children: "No events" })
|
|
1878
1878
|
]
|
|
@@ -1883,408 +1883,470 @@ function Qt({
|
|
|
1883
1883
|
)
|
|
1884
1884
|
] });
|
|
1885
1885
|
}
|
|
1886
|
-
function
|
|
1886
|
+
function rn({
|
|
1887
|
+
event: t,
|
|
1888
|
+
date: n,
|
|
1889
|
+
onEventClick: o,
|
|
1890
|
+
disablePopover: a,
|
|
1891
|
+
renderPopover: i
|
|
1892
|
+
}) {
|
|
1893
|
+
const [p, s] = J(!1), y = de(t.color), k = De(t), l = le(t.startDate, n), b = le(t.endDate, n), N = k && le(t.startDate, t.endDate), m = L(() => {
|
|
1894
|
+
a && o ? o(t) : a || s(!0);
|
|
1895
|
+
}, [a, o, t]), g = L(() => {
|
|
1896
|
+
s(!1);
|
|
1897
|
+
}, []), u = /* @__PURE__ */ r(
|
|
1898
|
+
"button",
|
|
1899
|
+
{
|
|
1900
|
+
type: "button",
|
|
1901
|
+
onClick: m,
|
|
1902
|
+
title: X(t),
|
|
1903
|
+
className: d(
|
|
1904
|
+
"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium transition-opacity hover:opacity-80",
|
|
1905
|
+
"sm:px-2 sm:py-1 sm:text-xs",
|
|
1906
|
+
y.bg,
|
|
1907
|
+
y.text,
|
|
1908
|
+
t.isCanceled && "opacity-60 line-through"
|
|
1909
|
+
),
|
|
1910
|
+
children: [
|
|
1911
|
+
!N && l && !b && "→ ",
|
|
1912
|
+
!N && !l && b && " ←",
|
|
1913
|
+
!N && !l && !b && "↔ ",
|
|
1914
|
+
/* @__PURE__ */ e("span", { className: "truncate max-w-24 sm:max-w-32", children: t.title }),
|
|
1915
|
+
N && /* @__PURE__ */ e("span", { className: "text-[9px] opacity-70 sm:text-[10px]", children: "All day" })
|
|
1916
|
+
]
|
|
1917
|
+
}
|
|
1918
|
+
), w = /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
|
|
1919
|
+
/* @__PURE__ */ e("div", { className: "font-medium", children: t.title }),
|
|
1920
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: X(t) })
|
|
1921
|
+
] }) });
|
|
1922
|
+
return a ? /* @__PURE__ */ r(ie, { children: [
|
|
1923
|
+
/* @__PURE__ */ e(se, { asChild: !0, children: u }),
|
|
1924
|
+
w
|
|
1925
|
+
] }) : /* @__PURE__ */ r(re, { open: p, onOpenChange: s, children: [
|
|
1926
|
+
/* @__PURE__ */ e(oe, { asChild: !0, children: u }),
|
|
1927
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: i ? i({ event: t, onClose: g }) : /* @__PURE__ */ e(on, { event: t, onClose: g }) })
|
|
1928
|
+
] });
|
|
1929
|
+
}
|
|
1930
|
+
function on({
|
|
1931
|
+
event: t,
|
|
1932
|
+
onClose: n
|
|
1933
|
+
}) {
|
|
1934
|
+
const o = de(t.color), a = t.isCanceled ?? !1;
|
|
1935
|
+
return /* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
1936
|
+
/* @__PURE__ */ r("div", { className: "flex items-start gap-3", children: [
|
|
1937
|
+
/* @__PURE__ */ e("div", { className: d("size-4 rounded shrink-0 mt-0.5", o.dot) }),
|
|
1938
|
+
/* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
|
|
1939
|
+
/* @__PURE__ */ e("h3", { className: d("font-semibold text-lg", a && "line-through opacity-50"), children: t.title }),
|
|
1940
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-sm text-muted-foreground mt-1 tabular-nums", children: X(t) })
|
|
1941
|
+
] })
|
|
1942
|
+
] }),
|
|
1943
|
+
t.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t.description }),
|
|
1944
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1.5", children: [
|
|
1945
|
+
t.isAllDay && /* @__PURE__ */ e("span", { className: "text-xs bg-muted px-2 py-0.5 rounded-full font-medium", children: "All day" }),
|
|
1946
|
+
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" })
|
|
1947
|
+
] }),
|
|
1948
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end pt-2 border-t", children: /* @__PURE__ */ e(
|
|
1949
|
+
"button",
|
|
1950
|
+
{
|
|
1951
|
+
type: "button",
|
|
1952
|
+
onClick: n,
|
|
1953
|
+
className: "text-xs text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md hover:bg-muted transition-colors",
|
|
1954
|
+
children: "Close"
|
|
1955
|
+
}
|
|
1956
|
+
) })
|
|
1957
|
+
] });
|
|
1958
|
+
}
|
|
1959
|
+
function an({
|
|
1887
1960
|
events: t,
|
|
1888
1961
|
date: n,
|
|
1889
1962
|
onEventClick: o,
|
|
1890
|
-
|
|
1963
|
+
disablePopover: a = !1,
|
|
1964
|
+
renderPopover: i,
|
|
1965
|
+
className: p
|
|
1891
1966
|
}) {
|
|
1892
1967
|
if (t.length === 0) return null;
|
|
1893
|
-
const
|
|
1894
|
-
(
|
|
1895
|
-
),
|
|
1896
|
-
return /* @__PURE__ */ r("div", { className:
|
|
1897
|
-
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-muted-foreground sm:text-xs", children:
|
|
1898
|
-
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: t.map((
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
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
|
-
}) })
|
|
1968
|
+
const s = t.some((l) => De(l) && le(l.startDate, l.endDate)), y = t.some(
|
|
1969
|
+
(l) => !le(l.startDate, l.endDate) || De(l) && !le(l.startDate, l.endDate)
|
|
1970
|
+
), k = s && y ? "All day / Multi-day" : s ? "All day" : "Multi-day";
|
|
1971
|
+
return /* @__PURE__ */ r("div", { className: d("border-b bg-muted/20 px-2 py-1.5 space-y-1", "sm:px-4 sm:py-2", p), children: [
|
|
1972
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-muted-foreground sm:text-xs", children: k }),
|
|
1973
|
+
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: t.map((l) => /* @__PURE__ */ e(
|
|
1974
|
+
rn,
|
|
1975
|
+
{
|
|
1976
|
+
event: l,
|
|
1977
|
+
date: n,
|
|
1978
|
+
onEventClick: o,
|
|
1979
|
+
disablePopover: a,
|
|
1980
|
+
renderPopover: i
|
|
1981
|
+
},
|
|
1982
|
+
l.id
|
|
1983
|
+
)) })
|
|
1924
1984
|
] });
|
|
1925
1985
|
}
|
|
1926
|
-
const
|
|
1927
|
-
function
|
|
1986
|
+
const sn = 5;
|
|
1987
|
+
function ut({
|
|
1928
1988
|
slot: t,
|
|
1929
1989
|
onSelectionStart: n,
|
|
1930
1990
|
onSelectionMove: o,
|
|
1931
1991
|
onSelectionEnd: a,
|
|
1932
|
-
isSelected:
|
|
1933
|
-
isSelecting:
|
|
1934
|
-
disabled:
|
|
1935
|
-
ariaLabel:
|
|
1936
|
-
children:
|
|
1937
|
-
className:
|
|
1938
|
-
height:
|
|
1939
|
-
style:
|
|
1940
|
-
dataAttributes:
|
|
1992
|
+
isSelected: i = !1,
|
|
1993
|
+
isSelecting: p = !1,
|
|
1994
|
+
disabled: s = !1,
|
|
1995
|
+
ariaLabel: y,
|
|
1996
|
+
children: k,
|
|
1997
|
+
className: l,
|
|
1998
|
+
height: b,
|
|
1999
|
+
style: N,
|
|
2000
|
+
dataAttributes: m
|
|
1941
2001
|
}) {
|
|
1942
|
-
const
|
|
1943
|
-
(
|
|
1944
|
-
|
|
2002
|
+
const g = te(null), u = te(!1), w = te(!1), v = te(null), [W, T] = J(!1), A = Re(), j = L(
|
|
2003
|
+
(f) => {
|
|
2004
|
+
s || f.button !== 0 && f.pointerType === "mouse" || (f.preventDefault(), g.current = { x: f.clientX, y: f.clientY }, u.current = !1, w.current = !0, n?.(t));
|
|
1945
2005
|
},
|
|
1946
|
-
[
|
|
1947
|
-
),
|
|
1948
|
-
(
|
|
1949
|
-
if (!(
|
|
1950
|
-
const
|
|
1951
|
-
Math.sqrt(
|
|
2006
|
+
[s, t, n]
|
|
2007
|
+
), E = L(
|
|
2008
|
+
(f) => {
|
|
2009
|
+
if (!(g.current && w.current && !s)) return;
|
|
2010
|
+
const x = f.clientX - g.current.x, B = f.clientY - g.current.y;
|
|
2011
|
+
Math.sqrt(x * x + B * B) >= sn && (u.current = !0);
|
|
1952
2012
|
},
|
|
1953
|
-
[
|
|
1954
|
-
),
|
|
1955
|
-
(
|
|
1956
|
-
|
|
2013
|
+
[s]
|
|
2014
|
+
), _ = L(
|
|
2015
|
+
(f) => {
|
|
2016
|
+
s || (f.buttons > 0 || p) && o?.(t);
|
|
1957
2017
|
},
|
|
1958
|
-
[
|
|
1959
|
-
), M =
|
|
1960
|
-
|
|
1961
|
-
}, [
|
|
1962
|
-
(
|
|
1963
|
-
if (!
|
|
1964
|
-
|
|
1965
|
-
const
|
|
1966
|
-
|
|
2018
|
+
[s, p, t, o]
|
|
2019
|
+
), M = L(() => {
|
|
2020
|
+
s || (a?.(), g.current = null, u.current = !1, w.current = !1);
|
|
2021
|
+
}, [s, a]), I = L(
|
|
2022
|
+
(f) => {
|
|
2023
|
+
if (!A?.isDragging || s) return;
|
|
2024
|
+
f.preventDefault(), f.dataTransfer.dropEffect = "move", T(!0);
|
|
2025
|
+
const x = /* @__PURE__ */ new Date(), B = t.hour ?? x.getHours(), R = t.minute ?? (x.getMinutes() >= 30 ? 30 : 0);
|
|
2026
|
+
A.updateDragPreview?.(t.date, B, R);
|
|
1967
2027
|
},
|
|
1968
|
-
[
|
|
1969
|
-
),
|
|
1970
|
-
|
|
1971
|
-
}, []),
|
|
1972
|
-
(
|
|
1973
|
-
|
|
2028
|
+
[A, s, t]
|
|
2029
|
+
), S = L(() => {
|
|
2030
|
+
T(!1);
|
|
2031
|
+
}, []), $ = L(
|
|
2032
|
+
(f) => {
|
|
2033
|
+
f.preventDefault(), T(!1), !(!A?.isDragging || s) && A.endDrag?.();
|
|
1974
2034
|
},
|
|
1975
|
-
[
|
|
2035
|
+
[A, s]
|
|
1976
2036
|
);
|
|
1977
|
-
|
|
1978
|
-
const
|
|
1979
|
-
w.current && (w.current = !1,
|
|
2037
|
+
Ae(() => {
|
|
2038
|
+
const f = () => {
|
|
2039
|
+
w.current && (w.current = !1, g.current = null, u.current = !1);
|
|
1980
2040
|
};
|
|
1981
|
-
return window.addEventListener("pointerup",
|
|
1982
|
-
window.removeEventListener("pointerup",
|
|
2041
|
+
return window.addEventListener("pointerup", f), window.addEventListener("pointercancel", f), () => {
|
|
2042
|
+
window.removeEventListener("pointerup", f), window.removeEventListener("pointercancel", f);
|
|
1983
2043
|
};
|
|
1984
2044
|
}, []);
|
|
1985
|
-
const q =
|
|
1986
|
-
(
|
|
1987
|
-
|
|
2045
|
+
const q = L(
|
|
2046
|
+
(f) => {
|
|
2047
|
+
s || (f.key === "Enter" || f.key === " ") && (f.preventDefault(), n?.(t), a?.());
|
|
1988
2048
|
},
|
|
1989
|
-
[
|
|
2049
|
+
[s, t, n, a]
|
|
1990
2050
|
);
|
|
1991
2051
|
return /* @__PURE__ */ e(
|
|
1992
2052
|
"button",
|
|
1993
2053
|
{
|
|
1994
|
-
ref:
|
|
2054
|
+
ref: v,
|
|
1995
2055
|
type: "button",
|
|
1996
|
-
"aria-label":
|
|
1997
|
-
"aria-disabled":
|
|
1998
|
-
"aria-pressed":
|
|
1999
|
-
disabled:
|
|
2000
|
-
onPointerDown:
|
|
2001
|
-
onPointerMove:
|
|
2056
|
+
"aria-label": y,
|
|
2057
|
+
"aria-disabled": s,
|
|
2058
|
+
"aria-pressed": i,
|
|
2059
|
+
disabled: s,
|
|
2060
|
+
onPointerDown: j,
|
|
2061
|
+
onPointerMove: E,
|
|
2002
2062
|
onPointerUp: M,
|
|
2003
|
-
onPointerEnter:
|
|
2063
|
+
onPointerEnter: _,
|
|
2004
2064
|
onKeyDown: q,
|
|
2005
|
-
onDragOver:
|
|
2006
|
-
onDragLeave:
|
|
2007
|
-
onDrop:
|
|
2008
|
-
className:
|
|
2065
|
+
onDragOver: I,
|
|
2066
|
+
onDragLeave: S,
|
|
2067
|
+
onDrop: $,
|
|
2068
|
+
className: d(
|
|
2009
2069
|
"select-none touch-none cursor-pointer transition-colors",
|
|
2010
2070
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
|
|
2011
2071
|
// Hover state (only when not in selection)
|
|
2012
|
-
!(
|
|
2072
|
+
!(p || s) && "hover:bg-blue-50/60",
|
|
2013
2073
|
// Selection state — blue tint matching the primary color
|
|
2014
|
-
|
|
2074
|
+
i && "bg-blue-100/70",
|
|
2015
2075
|
// Drag over state - visual feedback when event is dragged over
|
|
2016
|
-
|
|
2076
|
+
W && "bg-primary/20 ring-2 ring-primary ring-inset",
|
|
2017
2077
|
// Disabled state
|
|
2018
|
-
|
|
2019
|
-
|
|
2078
|
+
s && "cursor-not-allowed opacity-50",
|
|
2079
|
+
l
|
|
2020
2080
|
),
|
|
2021
|
-
style: { height:
|
|
2022
|
-
...
|
|
2023
|
-
children:
|
|
2081
|
+
style: { height: b, ...N },
|
|
2082
|
+
...m,
|
|
2083
|
+
children: k
|
|
2024
2084
|
}
|
|
2025
2085
|
);
|
|
2026
2086
|
}
|
|
2027
|
-
function
|
|
2087
|
+
function mt({
|
|
2028
2088
|
slot: t,
|
|
2029
2089
|
date: n,
|
|
2030
2090
|
hour: o,
|
|
2031
2091
|
minute: a,
|
|
2032
|
-
ariaLabel:
|
|
2033
|
-
...
|
|
2092
|
+
ariaLabel: i,
|
|
2093
|
+
...p
|
|
2034
2094
|
}) {
|
|
2035
|
-
const
|
|
2036
|
-
return /* @__PURE__ */ e(
|
|
2095
|
+
const s = t ?? { date: n, hour: o ?? 0, minute: a ?? 0 }, y = i ?? `Add event at ${(s.hour ?? 0).toString().padStart(2, "0")}:${(s.minute ?? 0).toString().padStart(2, "0")} on ${s.date.toLocaleDateString()}`;
|
|
2096
|
+
return /* @__PURE__ */ e(ut, { slot: s, ariaLabel: y, ...p });
|
|
2037
2097
|
}
|
|
2038
|
-
function
|
|
2039
|
-
const
|
|
2040
|
-
return /* @__PURE__ */ e(
|
|
2098
|
+
function ln({ slot: t, date: n, ariaLabel: o, ...a }) {
|
|
2099
|
+
const i = t ?? { date: n }, p = o ?? `Select ${i.date.toLocaleDateString()}`;
|
|
2100
|
+
return /* @__PURE__ */ e(ut, { slot: i, ariaLabel: p, ...a });
|
|
2041
2101
|
}
|
|
2042
|
-
const
|
|
2043
|
-
function
|
|
2102
|
+
const pe = 96, ze = 72, Le = 80;
|
|
2103
|
+
function Sn({
|
|
2044
2104
|
events: t,
|
|
2045
2105
|
date: n,
|
|
2046
2106
|
visibleHours: o = { startHour: 0, endHour: 24 },
|
|
2047
2107
|
workingHours: a,
|
|
2048
|
-
slotDuration:
|
|
2049
|
-
badgeVariant:
|
|
2050
|
-
onEventClick:
|
|
2051
|
-
onSlotSelect:
|
|
2052
|
-
className:
|
|
2053
|
-
renderEvent:
|
|
2054
|
-
renderPopover:
|
|
2055
|
-
slots:
|
|
2056
|
-
classNames:
|
|
2108
|
+
slotDuration: i = 30,
|
|
2109
|
+
badgeVariant: p = "colored",
|
|
2110
|
+
onEventClick: s,
|
|
2111
|
+
onSlotSelect: y,
|
|
2112
|
+
className: k,
|
|
2113
|
+
renderEvent: l,
|
|
2114
|
+
renderPopover: b,
|
|
2115
|
+
slots: N,
|
|
2116
|
+
classNames: m
|
|
2057
2117
|
}) {
|
|
2058
|
-
const
|
|
2059
|
-
const
|
|
2060
|
-
for (let
|
|
2061
|
-
|
|
2062
|
-
return
|
|
2063
|
-
}, [
|
|
2064
|
-
const
|
|
2065
|
-
for (const
|
|
2066
|
-
|
|
2067
|
-
return
|
|
2068
|
-
}, [
|
|
2069
|
-
if (!
|
|
2070
|
-
const
|
|
2071
|
-
return
|
|
2072
|
-
}, [
|
|
2073
|
-
|
|
2074
|
-
const
|
|
2075
|
-
if (!
|
|
2076
|
-
const
|
|
2077
|
-
let
|
|
2078
|
-
if (
|
|
2079
|
-
const
|
|
2080
|
-
|
|
2118
|
+
const g = 60 / i, u = 100 / g, w = F(() => {
|
|
2119
|
+
const D = [];
|
|
2120
|
+
for (let c = 0; c < g; c++)
|
|
2121
|
+
D.push(c * i);
|
|
2122
|
+
return D;
|
|
2123
|
+
}, [g, i]), v = F(() => He(t, n), [t, n]), { singleDay: W, multiDay: T } = F(() => rt(v), [v]), A = F(() => {
|
|
2124
|
+
const D = ot(W, n, o, pe), c = /* @__PURE__ */ new Map();
|
|
2125
|
+
for (const h of D)
|
|
2126
|
+
c.set(h.event.id, h.position);
|
|
2127
|
+
return c;
|
|
2128
|
+
}, [W, n, o]), j = F(() => at(o), [o]), E = /* @__PURE__ */ new Date(), _ = ce(n), M = F(() => {
|
|
2129
|
+
if (!_) return 0;
|
|
2130
|
+
const D = E.getHours() + E.getMinutes() / 60;
|
|
2131
|
+
return D < o.startHour || D > o.endHour ? -1 : (D - o.startHour) * pe;
|
|
2132
|
+
}, [_, o, E]), I = te(null);
|
|
2133
|
+
Ie(() => {
|
|
2134
|
+
const D = I.current;
|
|
2135
|
+
if (!D) return;
|
|
2136
|
+
const c = () => {
|
|
2137
|
+
let h;
|
|
2138
|
+
if (_) {
|
|
2139
|
+
const H = (/* @__PURE__ */ new Date()).getHours();
|
|
2140
|
+
h = Math.max(H - 1, o.startHour);
|
|
2081
2141
|
} else {
|
|
2082
|
-
const
|
|
2083
|
-
|
|
2142
|
+
const H = n.getDay(), z = a?.[H];
|
|
2143
|
+
z?.enabled && z.from > 0 ? h = Math.max(z.from - 1, o.startHour) : h = Math.max(7, o.startHour);
|
|
2084
2144
|
}
|
|
2085
|
-
const
|
|
2086
|
-
|
|
2087
|
-
top:
|
|
2145
|
+
const C = (h - o.startHour) * pe;
|
|
2146
|
+
D.scrollTo({
|
|
2147
|
+
top: C,
|
|
2088
2148
|
behavior: "instant"
|
|
2089
2149
|
});
|
|
2090
2150
|
};
|
|
2091
2151
|
requestAnimationFrame(() => {
|
|
2092
|
-
requestAnimationFrame(
|
|
2152
|
+
requestAnimationFrame(c);
|
|
2093
2153
|
});
|
|
2094
|
-
}, [n, a, o,
|
|
2095
|
-
const
|
|
2096
|
-
(
|
|
2097
|
-
|
|
2154
|
+
}, [n, a, o, _]);
|
|
2155
|
+
const S = je(), $ = L(
|
|
2156
|
+
(D) => {
|
|
2157
|
+
S?.startSelection(D);
|
|
2098
2158
|
},
|
|
2099
|
-
[
|
|
2100
|
-
), q =
|
|
2101
|
-
(
|
|
2102
|
-
|
|
2159
|
+
[S]
|
|
2160
|
+
), q = L(
|
|
2161
|
+
(D) => {
|
|
2162
|
+
S?.updateSelection(D);
|
|
2103
2163
|
},
|
|
2104
|
-
[
|
|
2105
|
-
),
|
|
2106
|
-
|
|
2107
|
-
}, [
|
|
2108
|
-
(
|
|
2109
|
-
|
|
2164
|
+
[S]
|
|
2165
|
+
), f = L(() => {
|
|
2166
|
+
S?.endSelection();
|
|
2167
|
+
}, [S]), x = L(
|
|
2168
|
+
(D) => {
|
|
2169
|
+
s?.(D);
|
|
2110
2170
|
},
|
|
2111
|
-
[
|
|
2112
|
-
),
|
|
2113
|
-
return /* @__PURE__ */ r("div", { className:
|
|
2171
|
+
[s]
|
|
2172
|
+
), B = n.toLocaleDateString([], { weekday: "short" }), R = n.getDate(), P = ce(n);
|
|
2173
|
+
return /* @__PURE__ */ r("div", { className: d("flex flex-col h-full", k), children: [
|
|
2114
2174
|
/* @__PURE__ */ e(
|
|
2115
2175
|
"div",
|
|
2116
2176
|
{
|
|
2117
|
-
className:
|
|
2177
|
+
className: d(
|
|
2118
2178
|
"flex items-center gap-3 border-b px-4 py-3",
|
|
2119
|
-
|
|
2120
|
-
|
|
2179
|
+
m?.columnHeader,
|
|
2180
|
+
P && m?.columnHeaderToday
|
|
2121
2181
|
),
|
|
2122
2182
|
children: /* @__PURE__ */ r("div", { className: "flex flex-col items-center", children: [
|
|
2123
2183
|
/* @__PURE__ */ e(
|
|
2124
2184
|
"span",
|
|
2125
2185
|
{
|
|
2126
|
-
className:
|
|
2186
|
+
className: d(
|
|
2127
2187
|
"text-[11px] font-medium uppercase tracking-wide",
|
|
2128
|
-
|
|
2188
|
+
P ? "text-primary" : "text-muted-foreground"
|
|
2129
2189
|
),
|
|
2130
|
-
children:
|
|
2190
|
+
children: B
|
|
2131
2191
|
}
|
|
2132
2192
|
),
|
|
2133
2193
|
/* @__PURE__ */ e(
|
|
2134
2194
|
"span",
|
|
2135
2195
|
{
|
|
2136
|
-
className:
|
|
2196
|
+
className: d(
|
|
2137
2197
|
"flex items-center justify-center rounded-full mt-0.5",
|
|
2138
2198
|
"size-12 text-3xl font-normal",
|
|
2139
|
-
|
|
2199
|
+
P ? "bg-primary text-primary-foreground" : "text-foreground"
|
|
2140
2200
|
),
|
|
2141
|
-
children:
|
|
2201
|
+
children: R
|
|
2142
2202
|
}
|
|
2143
2203
|
)
|
|
2144
2204
|
] })
|
|
2145
2205
|
}
|
|
2146
2206
|
),
|
|
2147
|
-
|
|
2148
|
-
|
|
2207
|
+
T.length > 0 && /* @__PURE__ */ e(
|
|
2208
|
+
an,
|
|
2149
2209
|
{
|
|
2150
|
-
events:
|
|
2210
|
+
events: T,
|
|
2151
2211
|
date: n,
|
|
2152
|
-
onEventClick:
|
|
2153
|
-
|
|
2212
|
+
onEventClick: x,
|
|
2213
|
+
disablePopover: !!s && !b,
|
|
2214
|
+
renderPopover: b,
|
|
2215
|
+
...m?.multiDayBanner && { className: m.multiDayBanner }
|
|
2154
2216
|
}
|
|
2155
2217
|
),
|
|
2156
2218
|
/* @__PURE__ */ e(
|
|
2157
2219
|
"div",
|
|
2158
2220
|
{
|
|
2159
|
-
ref:
|
|
2160
|
-
className:
|
|
2221
|
+
ref: I,
|
|
2222
|
+
className: d("flex-1 overflow-auto", m?.scrollContainer),
|
|
2161
2223
|
children: /* @__PURE__ */ r("div", { className: "relative min-h-full", children: [
|
|
2162
|
-
|
|
2163
|
-
const
|
|
2224
|
+
j.map((D, c) => {
|
|
2225
|
+
const C = !it(n, D, a);
|
|
2164
2226
|
return /* @__PURE__ */ r(
|
|
2165
2227
|
"div",
|
|
2166
2228
|
{
|
|
2167
|
-
className:
|
|
2229
|
+
className: d(
|
|
2168
2230
|
"relative flex",
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2231
|
+
C && "bg-calendar-disabled-hour",
|
|
2232
|
+
m?.timeSlot,
|
|
2233
|
+
C ? m?.timeSlotNonWorking : m?.timeSlotWorking
|
|
2172
2234
|
),
|
|
2173
|
-
style: { height:
|
|
2235
|
+
style: { height: pe },
|
|
2174
2236
|
children: [
|
|
2175
2237
|
/* @__PURE__ */ e(
|
|
2176
2238
|
"div",
|
|
2177
2239
|
{
|
|
2178
|
-
className:
|
|
2240
|
+
className: d(
|
|
2179
2241
|
"relative flex-shrink-0 border-r border-border/50 bg-zinc-50 dark:bg-zinc-900",
|
|
2180
|
-
|
|
2242
|
+
m?.timeGutter
|
|
2181
2243
|
),
|
|
2182
|
-
style: { width:
|
|
2183
|
-
children: /* @__PURE__ */ e("div", { className: "absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center", children:
|
|
2244
|
+
style: { width: ze },
|
|
2245
|
+
children: /* @__PURE__ */ e("div", { className: "absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center", children: c !== 0 && /* @__PURE__ */ e(
|
|
2184
2246
|
"span",
|
|
2185
2247
|
{
|
|
2186
|
-
className:
|
|
2248
|
+
className: d(
|
|
2187
2249
|
"text-[10px] sm:text-xs text-muted-foreground",
|
|
2188
|
-
|
|
2250
|
+
m?.timeGutterLabel
|
|
2189
2251
|
),
|
|
2190
|
-
children:
|
|
2252
|
+
children: Ce(D)
|
|
2191
2253
|
}
|
|
2192
2254
|
) })
|
|
2193
2255
|
}
|
|
2194
2256
|
),
|
|
2195
2257
|
/* @__PURE__ */ r("div", { className: "relative flex-1", children: [
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
w.slice(1).map((
|
|
2258
|
+
_ && !C && /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-primary/5" }),
|
|
2259
|
+
c !== 0 && /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-x-0 top-0 border-b border-border/50" }),
|
|
2260
|
+
w.slice(1).map((H) => /* @__PURE__ */ e(
|
|
2199
2261
|
"div",
|
|
2200
2262
|
{
|
|
2201
2263
|
className: "pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",
|
|
2202
|
-
style: { top: `${
|
|
2264
|
+
style: { top: `${H / 60 * 100}%` }
|
|
2203
2265
|
},
|
|
2204
|
-
|
|
2266
|
+
H
|
|
2205
2267
|
)),
|
|
2206
|
-
w.map((
|
|
2207
|
-
const Y = { date: n, hour:
|
|
2268
|
+
w.map((H, z) => {
|
|
2269
|
+
const Y = { date: n, hour: D, minute: H };
|
|
2208
2270
|
return /* @__PURE__ */ e(
|
|
2209
|
-
|
|
2271
|
+
mt,
|
|
2210
2272
|
{
|
|
2211
2273
|
slot: Y,
|
|
2212
|
-
onSelectionStart:
|
|
2274
|
+
onSelectionStart: $,
|
|
2213
2275
|
onSelectionMove: q,
|
|
2214
|
-
onSelectionEnd:
|
|
2215
|
-
isSelected:
|
|
2216
|
-
isSelecting:
|
|
2217
|
-
disabled:
|
|
2276
|
+
onSelectionEnd: f,
|
|
2277
|
+
isSelected: S?.isSlotSelected(Y) ?? !1,
|
|
2278
|
+
isSelecting: S?.isSelecting ?? !1,
|
|
2279
|
+
disabled: C,
|
|
2218
2280
|
className: "absolute inset-x-0",
|
|
2219
2281
|
style: {
|
|
2220
|
-
top: `${
|
|
2221
|
-
height: `${
|
|
2282
|
+
top: `${z * u}%`,
|
|
2283
|
+
height: `${u}%`
|
|
2222
2284
|
},
|
|
2223
|
-
ariaLabel: `Add event at ${
|
|
2285
|
+
ariaLabel: `Add event at ${Ce(D)}:${String(H).padStart(2, "0")}`
|
|
2224
2286
|
},
|
|
2225
|
-
|
|
2287
|
+
H
|
|
2226
2288
|
);
|
|
2227
2289
|
})
|
|
2228
2290
|
] })
|
|
2229
2291
|
]
|
|
2230
2292
|
},
|
|
2231
|
-
|
|
2293
|
+
D
|
|
2232
2294
|
);
|
|
2233
2295
|
}),
|
|
2234
2296
|
/* @__PURE__ */ e(
|
|
2235
2297
|
"div",
|
|
2236
2298
|
{
|
|
2237
2299
|
className: "absolute top-0 bottom-0 right-0 pointer-events-none",
|
|
2238
|
-
style: { left:
|
|
2239
|
-
children:
|
|
2240
|
-
const
|
|
2241
|
-
if (!
|
|
2242
|
-
const
|
|
2243
|
-
return
|
|
2300
|
+
style: { left: ze },
|
|
2301
|
+
children: W.map((D) => {
|
|
2302
|
+
const c = A.get(D.id);
|
|
2303
|
+
if (!c) return null;
|
|
2304
|
+
const h = `calc(${c.width}% - 2px)`, C = `max(${Le}px, ${h})`;
|
|
2305
|
+
return l ? /* @__PURE__ */ e(
|
|
2244
2306
|
"div",
|
|
2245
2307
|
{
|
|
2246
2308
|
className: "absolute pointer-events-auto p-0.5",
|
|
2247
2309
|
style: {
|
|
2248
|
-
top: `${
|
|
2249
|
-
left: `${
|
|
2250
|
-
width:
|
|
2251
|
-
minWidth: `${
|
|
2310
|
+
top: `${c.top}px`,
|
|
2311
|
+
left: `${c.left}%`,
|
|
2312
|
+
width: C,
|
|
2313
|
+
minWidth: `${Le}px`
|
|
2252
2314
|
},
|
|
2253
|
-
children:
|
|
2315
|
+
children: l({ event: D, position: c })
|
|
2254
2316
|
},
|
|
2255
|
-
|
|
2317
|
+
D.id
|
|
2256
2318
|
) : /* @__PURE__ */ e(
|
|
2257
|
-
|
|
2319
|
+
lt,
|
|
2258
2320
|
{
|
|
2259
|
-
event:
|
|
2321
|
+
event: D,
|
|
2260
2322
|
position: {
|
|
2261
|
-
top:
|
|
2262
|
-
left:
|
|
2263
|
-
width:
|
|
2264
|
-
minWidth:
|
|
2323
|
+
top: c.top,
|
|
2324
|
+
left: c.left,
|
|
2325
|
+
width: c.width,
|
|
2326
|
+
minWidth: Le
|
|
2265
2327
|
},
|
|
2266
|
-
hourHeight:
|
|
2267
|
-
badgeVariant:
|
|
2268
|
-
onClick:
|
|
2269
|
-
disablePopover: !!
|
|
2270
|
-
renderPopover:
|
|
2271
|
-
className:
|
|
2328
|
+
hourHeight: pe,
|
|
2329
|
+
badgeVariant: p,
|
|
2330
|
+
onClick: s,
|
|
2331
|
+
disablePopover: !!s && !b,
|
|
2332
|
+
renderPopover: b,
|
|
2333
|
+
className: d("pointer-events-auto", m?.eventCard)
|
|
2272
2334
|
},
|
|
2273
|
-
|
|
2335
|
+
D.id
|
|
2274
2336
|
);
|
|
2275
2337
|
})
|
|
2276
2338
|
}
|
|
2277
2339
|
),
|
|
2278
|
-
|
|
2340
|
+
_ && M >= 0 && /* @__PURE__ */ r(
|
|
2279
2341
|
"div",
|
|
2280
2342
|
{
|
|
2281
|
-
className:
|
|
2343
|
+
className: d(
|
|
2282
2344
|
"absolute left-0 right-0 z-20 flex items-center pointer-events-none",
|
|
2283
|
-
|
|
2345
|
+
m?.currentTimeIndicator
|
|
2284
2346
|
),
|
|
2285
2347
|
style: {
|
|
2286
2348
|
top: M,
|
|
2287
|
-
left:
|
|
2349
|
+
left: ze
|
|
2288
2350
|
},
|
|
2289
2351
|
children: [
|
|
2290
2352
|
/* @__PURE__ */ e("div", { className: "h-2.5 w-2.5 -ml-1 rounded-full bg-red-500" }),
|
|
@@ -2297,7 +2359,7 @@ function gn({
|
|
|
2297
2359
|
)
|
|
2298
2360
|
] });
|
|
2299
2361
|
}
|
|
2300
|
-
const
|
|
2362
|
+
const dn = [
|
|
2301
2363
|
{ full: "Monday", short: "Mon", tiny: "M" },
|
|
2302
2364
|
{ full: "Tuesday", short: "Tue", tiny: "T" },
|
|
2303
2365
|
{ full: "Wednesday", short: "Wed", tiny: "W" },
|
|
@@ -2305,7 +2367,7 @@ const nn = [
|
|
|
2305
2367
|
{ full: "Friday", short: "Fri", tiny: "F" },
|
|
2306
2368
|
{ full: "Saturday", short: "Sat", tiny: "S" },
|
|
2307
2369
|
{ full: "Sunday", short: "Sun", tiny: "S" }
|
|
2308
|
-
],
|
|
2370
|
+
], cn = [
|
|
2309
2371
|
{ full: "Sunday", short: "Sun", tiny: "S" },
|
|
2310
2372
|
{ full: "Monday", short: "Mon", tiny: "M" },
|
|
2311
2373
|
{ full: "Tuesday", short: "Tue", tiny: "T" },
|
|
@@ -2313,120 +2375,120 @@ const nn = [
|
|
|
2313
2375
|
{ full: "Thursday", short: "Thu", tiny: "T" },
|
|
2314
2376
|
{ full: "Friday", short: "Fri", tiny: "F" },
|
|
2315
2377
|
{ full: "Saturday", short: "Sat", tiny: "S" }
|
|
2316
|
-
],
|
|
2317
|
-
function
|
|
2378
|
+
], fe = 3;
|
|
2379
|
+
function Mn({
|
|
2318
2380
|
events: t,
|
|
2319
2381
|
date: n,
|
|
2320
2382
|
weekStartsOn: o = 1,
|
|
2321
2383
|
badgeVariant: a = "colored",
|
|
2322
|
-
onEventClick:
|
|
2323
|
-
onSlotSelect:
|
|
2324
|
-
onDayClick:
|
|
2325
|
-
className:
|
|
2326
|
-
renderEvent:
|
|
2327
|
-
renderPopover:
|
|
2328
|
-
showMoreMode:
|
|
2329
|
-
showMoreEventsInPopover:
|
|
2330
|
-
slots:
|
|
2331
|
-
classNames:
|
|
2384
|
+
onEventClick: i,
|
|
2385
|
+
onSlotSelect: p,
|
|
2386
|
+
onDayClick: s,
|
|
2387
|
+
className: y,
|
|
2388
|
+
renderEvent: k,
|
|
2389
|
+
renderPopover: l,
|
|
2390
|
+
showMoreMode: b,
|
|
2391
|
+
showMoreEventsInPopover: N = !1,
|
|
2392
|
+
slots: m,
|
|
2393
|
+
classNames: g
|
|
2332
2394
|
}) {
|
|
2333
|
-
const
|
|
2334
|
-
const
|
|
2335
|
-
for (const
|
|
2336
|
-
const
|
|
2337
|
-
|
|
2395
|
+
const u = b ?? (N ? "popover" : "expand"), w = m?.dayCellHeader, v = m?.dayCellFooter, [W, T] = J(null), [A, j] = J(null), E = F(() => bt(n, o), [n, o]), _ = F(() => {
|
|
2396
|
+
const x = /* @__PURE__ */ new Map();
|
|
2397
|
+
for (const B of E) {
|
|
2398
|
+
const R = B.date.toDateString(), P = He(t, B.date);
|
|
2399
|
+
P.sort((D, c) => D.startDate.getTime() - c.startDate.getTime()), x.set(R, P);
|
|
2338
2400
|
}
|
|
2339
|
-
return
|
|
2340
|
-
}, [
|
|
2341
|
-
(
|
|
2342
|
-
M?.startSelection(
|
|
2401
|
+
return x;
|
|
2402
|
+
}, [E, t]), M = je(), I = L(
|
|
2403
|
+
(x) => {
|
|
2404
|
+
M?.startSelection(x);
|
|
2343
2405
|
},
|
|
2344
2406
|
[M]
|
|
2345
|
-
),
|
|
2346
|
-
(
|
|
2347
|
-
M?.updateSelection(
|
|
2407
|
+
), S = L(
|
|
2408
|
+
(x) => {
|
|
2409
|
+
M?.updateSelection(x);
|
|
2348
2410
|
},
|
|
2349
2411
|
[M]
|
|
2350
|
-
),
|
|
2412
|
+
), $ = L(() => {
|
|
2351
2413
|
M?.endSelection();
|
|
2352
|
-
}, [M]), q =
|
|
2353
|
-
(
|
|
2354
|
-
|
|
2414
|
+
}, [M]), q = L(
|
|
2415
|
+
(x) => {
|
|
2416
|
+
s?.(x);
|
|
2355
2417
|
},
|
|
2356
|
-
[
|
|
2357
|
-
),
|
|
2358
|
-
return /* @__PURE__ */ r("div", { className:
|
|
2418
|
+
[s]
|
|
2419
|
+
), f = o === 0 ? cn : dn;
|
|
2420
|
+
return /* @__PURE__ */ r("div", { className: d("flex flex-col h-full overflow-hidden", y), children: [
|
|
2359
2421
|
/* @__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
2422
|
/* @__PURE__ */ e(
|
|
2361
2423
|
"div",
|
|
2362
2424
|
{
|
|
2363
|
-
className:
|
|
2425
|
+
className: d(
|
|
2364
2426
|
"grid grid-cols-7 border-b !sticky !top-0 bg-background z-10",
|
|
2365
|
-
|
|
2427
|
+
g?.weekdayHeader
|
|
2366
2428
|
),
|
|
2367
|
-
children:
|
|
2429
|
+
children: f.map((x, B) => /* @__PURE__ */ r(
|
|
2368
2430
|
"div",
|
|
2369
2431
|
{
|
|
2370
|
-
className:
|
|
2432
|
+
className: d(
|
|
2371
2433
|
"py-2 sm:py-2.5 text-center text-[11px] uppercase font-medium tracking-wide text-muted-foreground",
|
|
2372
|
-
|
|
2434
|
+
B >= 5 && "text-muted-foreground/70",
|
|
2373
2435
|
// Weekend
|
|
2374
|
-
|
|
2436
|
+
g?.weekdayLabel
|
|
2375
2437
|
),
|
|
2376
2438
|
children: [
|
|
2377
|
-
/* @__PURE__ */ e("span", { className: "sm:hidden", children:
|
|
2378
|
-
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children:
|
|
2439
|
+
/* @__PURE__ */ e("span", { className: "sm:hidden", children: x.short }),
|
|
2440
|
+
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children: x.short })
|
|
2379
2441
|
]
|
|
2380
2442
|
},
|
|
2381
|
-
|
|
2443
|
+
x.full
|
|
2382
2444
|
))
|
|
2383
2445
|
}
|
|
2384
2446
|
),
|
|
2385
|
-
/* @__PURE__ */ e("div", { className:
|
|
2386
|
-
const
|
|
2447
|
+
/* @__PURE__ */ e("div", { className: d("grid grid-cols-7 auto-rows-min", g?.monthGrid), children: E.map((x) => {
|
|
2448
|
+
const B = x.date.toDateString(), R = _.get(B) || [], P = ce(x.date), D = x.date.getDay() === 0 || x.date.getDay() === 6, c = R.length > fe;
|
|
2387
2449
|
return /* @__PURE__ */ r(
|
|
2388
|
-
|
|
2450
|
+
ln,
|
|
2389
2451
|
{
|
|
2390
|
-
date:
|
|
2391
|
-
dataAttributes: { "data-day-key":
|
|
2392
|
-
onSelectionStart:
|
|
2393
|
-
onSelectionMove:
|
|
2394
|
-
onSelectionEnd:
|
|
2395
|
-
isSelected: M?.isSlotSelected({ date:
|
|
2452
|
+
date: x.date,
|
|
2453
|
+
dataAttributes: { "data-day-key": B },
|
|
2454
|
+
onSelectionStart: I,
|
|
2455
|
+
onSelectionMove: S,
|
|
2456
|
+
onSelectionEnd: $,
|
|
2457
|
+
isSelected: M?.isSlotSelected({ date: x.date }) ?? !1,
|
|
2396
2458
|
isSelecting: M?.isSelecting ?? !1,
|
|
2397
|
-
className:
|
|
2459
|
+
className: d(
|
|
2398
2460
|
"relative flex flex-col border-r border-b text-left min-h-[80px] sm:min-h-[100px] overflow-hidden",
|
|
2399
2461
|
"[&:nth-child(7n)]:border-r-0",
|
|
2400
|
-
!
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
!
|
|
2405
|
-
|
|
2462
|
+
!x.isCurrentMonth && "bg-muted/20",
|
|
2463
|
+
D && x.isCurrentMonth && "bg-muted/10",
|
|
2464
|
+
g?.dayCell,
|
|
2465
|
+
P && g?.dayCellToday,
|
|
2466
|
+
!x.isCurrentMonth && g?.dayCellOutside,
|
|
2467
|
+
D && g?.dayCellWeekend
|
|
2406
2468
|
),
|
|
2407
|
-
ariaLabel: `${
|
|
2469
|
+
ariaLabel: `${x.date.toLocaleDateString()} - ${R.length} events. Click to create event, double-click to view day.`,
|
|
2408
2470
|
children: [
|
|
2409
2471
|
/* @__PURE__ */ e(
|
|
2410
2472
|
"div",
|
|
2411
2473
|
{
|
|
2412
|
-
className:
|
|
2474
|
+
className: d(
|
|
2413
2475
|
"flex items-center justify-center p-1",
|
|
2414
|
-
!
|
|
2415
|
-
|
|
2476
|
+
!x.isCurrentMonth && "text-muted-foreground/40",
|
|
2477
|
+
g?.dayCellNumber
|
|
2416
2478
|
),
|
|
2417
2479
|
children: /* @__PURE__ */ e(
|
|
2418
2480
|
"button",
|
|
2419
2481
|
{
|
|
2420
2482
|
type: "button",
|
|
2421
|
-
onClick: (
|
|
2422
|
-
|
|
2483
|
+
onClick: (h) => {
|
|
2484
|
+
h.stopPropagation(), q(x.date);
|
|
2423
2485
|
},
|
|
2424
|
-
className:
|
|
2486
|
+
className: d(
|
|
2425
2487
|
"flex items-center justify-center rounded-full transition-colors",
|
|
2426
2488
|
"size-7 text-sm font-normal",
|
|
2427
|
-
|
|
2489
|
+
P ? "bg-primary text-primary-foreground" : "hover:bg-muted"
|
|
2428
2490
|
),
|
|
2429
|
-
children:
|
|
2491
|
+
children: x.date.getDate()
|
|
2430
2492
|
}
|
|
2431
2493
|
)
|
|
2432
2494
|
}
|
|
@@ -2434,150 +2496,150 @@ function xn({
|
|
|
2434
2496
|
w && /* @__PURE__ */ e(
|
|
2435
2497
|
w,
|
|
2436
2498
|
{
|
|
2437
|
-
date:
|
|
2438
|
-
events:
|
|
2439
|
-
isToday:
|
|
2440
|
-
isCurrentMonth:
|
|
2441
|
-
isWeekend:
|
|
2499
|
+
date: x.date,
|
|
2500
|
+
events: R,
|
|
2501
|
+
isToday: P,
|
|
2502
|
+
isCurrentMonth: x.isCurrentMonth,
|
|
2503
|
+
isWeekend: D,
|
|
2442
2504
|
view: "month"
|
|
2443
2505
|
}
|
|
2444
2506
|
),
|
|
2445
2507
|
/* @__PURE__ */ r(
|
|
2446
2508
|
"div",
|
|
2447
2509
|
{
|
|
2448
|
-
className:
|
|
2510
|
+
className: d(
|
|
2449
2511
|
"flex-1 overflow-hidden px-2 pt-1 pb-1 space-y-1",
|
|
2450
|
-
|
|
2512
|
+
g?.dayCellContent
|
|
2451
2513
|
),
|
|
2452
2514
|
children: [
|
|
2453
|
-
|
|
2515
|
+
R.slice(0, fe).map((h) => /* @__PURE__ */ e(
|
|
2454
2516
|
"div",
|
|
2455
2517
|
{
|
|
2456
|
-
onPointerDown: (
|
|
2457
|
-
|
|
2518
|
+
onPointerDown: (C) => {
|
|
2519
|
+
C.stopPropagation();
|
|
2458
2520
|
},
|
|
2459
|
-
children:
|
|
2460
|
-
|
|
2521
|
+
children: k ? k({ event: h, variant: "compact" }) : /* @__PURE__ */ e(
|
|
2522
|
+
Se,
|
|
2461
2523
|
{
|
|
2462
|
-
event:
|
|
2524
|
+
event: h,
|
|
2463
2525
|
variant: "compact",
|
|
2464
2526
|
badgeVariant: a,
|
|
2465
|
-
onClick:
|
|
2466
|
-
disablePopover: !!
|
|
2467
|
-
renderPopover:
|
|
2527
|
+
onClick: i,
|
|
2528
|
+
disablePopover: !!i && !l,
|
|
2529
|
+
renderPopover: l,
|
|
2468
2530
|
showTime: !1,
|
|
2469
2531
|
enableDrag: !0,
|
|
2470
|
-
...
|
|
2471
|
-
className:
|
|
2532
|
+
...g?.eventCardCompact && {
|
|
2533
|
+
className: g.eventCardCompact
|
|
2472
2534
|
}
|
|
2473
2535
|
}
|
|
2474
2536
|
)
|
|
2475
2537
|
},
|
|
2476
|
-
|
|
2538
|
+
h.id
|
|
2477
2539
|
)),
|
|
2478
|
-
|
|
2540
|
+
c && u === "expand" && /* @__PURE__ */ r(
|
|
2479
2541
|
"button",
|
|
2480
2542
|
{
|
|
2481
2543
|
type: "button",
|
|
2482
|
-
onPointerDown: (
|
|
2483
|
-
onClick: (
|
|
2484
|
-
|
|
2485
|
-
const
|
|
2486
|
-
|
|
2487
|
-
date:
|
|
2488
|
-
events:
|
|
2489
|
-
rect:
|
|
2544
|
+
onPointerDown: (h) => h.stopPropagation(),
|
|
2545
|
+
onClick: (h) => {
|
|
2546
|
+
h.stopPropagation();
|
|
2547
|
+
const C = document.querySelector(`[data-day-key="${B}"]`);
|
|
2548
|
+
j({
|
|
2549
|
+
date: x.date,
|
|
2550
|
+
events: R,
|
|
2551
|
+
rect: C?.getBoundingClientRect() ?? new DOMRect(window.innerWidth / 2 - 180, window.innerHeight / 2 - 240, 0, 0)
|
|
2490
2552
|
});
|
|
2491
2553
|
},
|
|
2492
|
-
className:
|
|
2554
|
+
className: d(
|
|
2493
2555
|
"w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",
|
|
2494
|
-
|
|
2556
|
+
g?.moreEventsIndicator
|
|
2495
2557
|
),
|
|
2496
2558
|
children: [
|
|
2497
2559
|
"+",
|
|
2498
|
-
|
|
2560
|
+
R.length - fe,
|
|
2499
2561
|
" more"
|
|
2500
2562
|
]
|
|
2501
2563
|
}
|
|
2502
2564
|
),
|
|
2503
|
-
|
|
2504
|
-
|
|
2565
|
+
c && u === "popover" && /* @__PURE__ */ r(
|
|
2566
|
+
re,
|
|
2505
2567
|
{
|
|
2506
|
-
open:
|
|
2507
|
-
onOpenChange: (
|
|
2568
|
+
open: W === B,
|
|
2569
|
+
onOpenChange: (h) => T(h ? B : null),
|
|
2508
2570
|
children: [
|
|
2509
|
-
/* @__PURE__ */ e(
|
|
2571
|
+
/* @__PURE__ */ e(oe, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2510
2572
|
"button",
|
|
2511
2573
|
{
|
|
2512
2574
|
type: "button",
|
|
2513
|
-
onPointerDown: (
|
|
2514
|
-
onClick: (
|
|
2515
|
-
|
|
2575
|
+
onPointerDown: (h) => h.stopPropagation(),
|
|
2576
|
+
onClick: (h) => {
|
|
2577
|
+
h.stopPropagation(), T(B);
|
|
2516
2578
|
},
|
|
2517
|
-
className:
|
|
2579
|
+
className: d(
|
|
2518
2580
|
"w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",
|
|
2519
|
-
|
|
2581
|
+
g?.moreEventsIndicator
|
|
2520
2582
|
),
|
|
2521
2583
|
children: [
|
|
2522
2584
|
"+",
|
|
2523
|
-
|
|
2585
|
+
R.length - fe,
|
|
2524
2586
|
" more"
|
|
2525
2587
|
]
|
|
2526
2588
|
}
|
|
2527
2589
|
) }),
|
|
2528
2590
|
/* @__PURE__ */ r(
|
|
2529
|
-
|
|
2591
|
+
Q,
|
|
2530
2592
|
{
|
|
2531
2593
|
align: "start",
|
|
2532
2594
|
side: "right",
|
|
2533
2595
|
sideOffset: 8,
|
|
2534
2596
|
className: "w-72 max-h-80 overflow-y-auto p-2",
|
|
2535
|
-
onPointerDown: (
|
|
2597
|
+
onPointerDown: (h) => h.stopPropagation(),
|
|
2536
2598
|
children: [
|
|
2537
2599
|
/* @__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:
|
|
2600
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-medium", children: x.date.toLocaleDateString(void 0, {
|
|
2539
2601
|
weekday: "short",
|
|
2540
2602
|
month: "short",
|
|
2541
2603
|
day: "numeric"
|
|
2542
2604
|
}) }),
|
|
2543
2605
|
/* @__PURE__ */ r("span", { className: "text-xs text-muted-foreground", children: [
|
|
2544
|
-
|
|
2606
|
+
R.length,
|
|
2545
2607
|
" events"
|
|
2546
2608
|
] })
|
|
2547
2609
|
] }),
|
|
2548
|
-
/* @__PURE__ */ e("div", { className: "space-y-1.5", children:
|
|
2549
|
-
|
|
2610
|
+
/* @__PURE__ */ e("div", { className: "space-y-1.5", children: R.map((h) => /* @__PURE__ */ e("div", { children: k ? k({ event: h, variant: "compact" }) : /* @__PURE__ */ e(
|
|
2611
|
+
Se,
|
|
2550
2612
|
{
|
|
2551
|
-
event:
|
|
2613
|
+
event: h,
|
|
2552
2614
|
variant: "compact",
|
|
2553
2615
|
badgeVariant: a,
|
|
2554
|
-
onClick: (
|
|
2555
|
-
|
|
2616
|
+
onClick: (C) => {
|
|
2617
|
+
T(null), i?.(C);
|
|
2556
2618
|
},
|
|
2557
|
-
disablePopover: !!
|
|
2558
|
-
renderPopover:
|
|
2619
|
+
disablePopover: !!i && !l,
|
|
2620
|
+
renderPopover: l,
|
|
2559
2621
|
showTime: !0
|
|
2560
2622
|
}
|
|
2561
|
-
) },
|
|
2623
|
+
) }, h.id)) })
|
|
2562
2624
|
]
|
|
2563
2625
|
}
|
|
2564
2626
|
)
|
|
2565
2627
|
]
|
|
2566
2628
|
}
|
|
2567
2629
|
),
|
|
2568
|
-
|
|
2630
|
+
c && u === "dayView" && /* @__PURE__ */ r(
|
|
2569
2631
|
"div",
|
|
2570
2632
|
{
|
|
2571
|
-
onPointerDown: (
|
|
2572
|
-
|
|
2633
|
+
onPointerDown: (h) => {
|
|
2634
|
+
h.stopPropagation(), q(x.date);
|
|
2573
2635
|
},
|
|
2574
|
-
className:
|
|
2636
|
+
className: d(
|
|
2575
2637
|
"w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",
|
|
2576
|
-
|
|
2638
|
+
g?.moreEventsIndicator
|
|
2577
2639
|
),
|
|
2578
2640
|
children: [
|
|
2579
2641
|
"+",
|
|
2580
|
-
|
|
2642
|
+
R.length - fe,
|
|
2581
2643
|
" more"
|
|
2582
2644
|
]
|
|
2583
2645
|
}
|
|
@@ -2585,236 +2647,471 @@ function xn({
|
|
|
2585
2647
|
]
|
|
2586
2648
|
}
|
|
2587
2649
|
),
|
|
2588
|
-
|
|
2589
|
-
|
|
2650
|
+
v && /* @__PURE__ */ e(
|
|
2651
|
+
v,
|
|
2590
2652
|
{
|
|
2591
|
-
date:
|
|
2592
|
-
events:
|
|
2593
|
-
isToday:
|
|
2594
|
-
isCurrentMonth:
|
|
2595
|
-
isWeekend:
|
|
2653
|
+
date: x.date,
|
|
2654
|
+
events: R,
|
|
2655
|
+
isToday: P,
|
|
2656
|
+
isCurrentMonth: x.isCurrentMonth,
|
|
2657
|
+
isWeekend: D,
|
|
2596
2658
|
view: "month"
|
|
2597
2659
|
}
|
|
2598
2660
|
)
|
|
2599
2661
|
]
|
|
2600
2662
|
},
|
|
2601
|
-
|
|
2663
|
+
B
|
|
2602
2664
|
);
|
|
2603
2665
|
}) })
|
|
2604
2666
|
] }) }),
|
|
2605
2667
|
/* @__PURE__ */ e(
|
|
2606
|
-
|
|
2668
|
+
nn,
|
|
2607
2669
|
{
|
|
2608
|
-
isOpen:
|
|
2609
|
-
onClose: () =>
|
|
2610
|
-
date:
|
|
2611
|
-
events:
|
|
2612
|
-
anchorRect:
|
|
2670
|
+
isOpen: A !== null,
|
|
2671
|
+
onClose: () => j(null),
|
|
2672
|
+
date: A?.date ?? /* @__PURE__ */ new Date(),
|
|
2673
|
+
events: A?.events ?? [],
|
|
2674
|
+
anchorRect: A?.rect ?? null,
|
|
2613
2675
|
badgeVariant: a,
|
|
2614
|
-
onEventClick:
|
|
2615
|
-
renderEvent:
|
|
2616
|
-
renderPopover:
|
|
2676
|
+
onEventClick: i,
|
|
2677
|
+
renderEvent: k,
|
|
2678
|
+
renderPopover: l
|
|
2617
2679
|
}
|
|
2618
2680
|
)
|
|
2619
2681
|
] });
|
|
2620
2682
|
}
|
|
2621
|
-
const
|
|
2622
|
-
function
|
|
2683
|
+
const Me = 26, et = 2, ve = 4;
|
|
2684
|
+
function tt(t, n) {
|
|
2685
|
+
const o = Ge(t);
|
|
2686
|
+
for (let i = 0; i < n.length; i++) {
|
|
2687
|
+
const p = n[i];
|
|
2688
|
+
if (p && le(o, p)) return i;
|
|
2689
|
+
}
|
|
2690
|
+
const a = n[0];
|
|
2691
|
+
return a && o < Ge(a) ? -1 : 7;
|
|
2692
|
+
}
|
|
2693
|
+
function un(t) {
|
|
2694
|
+
const n = [...t].sort((a, i) => {
|
|
2695
|
+
const p = a.endCol - a.startCol, s = i.endCol - i.startCol;
|
|
2696
|
+
return s !== p ? s - p : a.startCol - i.startCol;
|
|
2697
|
+
}), o = [];
|
|
2698
|
+
return n.map((a) => {
|
|
2699
|
+
let i = -1;
|
|
2700
|
+
for (let s = 0; s < o.length; s++) {
|
|
2701
|
+
const y = o[s];
|
|
2702
|
+
if (!y) continue;
|
|
2703
|
+
let k = !0;
|
|
2704
|
+
for (let l = a.startCol; l <= a.endCol; l++)
|
|
2705
|
+
if (y[l]) {
|
|
2706
|
+
k = !1;
|
|
2707
|
+
break;
|
|
2708
|
+
}
|
|
2709
|
+
if (k) {
|
|
2710
|
+
i = s;
|
|
2711
|
+
break;
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
i === -1 && (i = o.length, o.push(new Array(7).fill(!1)));
|
|
2715
|
+
const p = o[i];
|
|
2716
|
+
if (p)
|
|
2717
|
+
for (let s = a.startCol; s <= a.endCol; s++)
|
|
2718
|
+
p[s] = !0;
|
|
2719
|
+
return { ...a, row: i };
|
|
2720
|
+
});
|
|
2721
|
+
}
|
|
2722
|
+
function mn({
|
|
2723
|
+
pe: t,
|
|
2724
|
+
onEventClick: n,
|
|
2725
|
+
disablePopover: o,
|
|
2726
|
+
renderPopover: a
|
|
2727
|
+
}) {
|
|
2728
|
+
const [i, p] = J(!1), s = de(t.event.color), y = L(() => {
|
|
2729
|
+
o && n ? n(t.event) : o || p(!0);
|
|
2730
|
+
}, [o, n, t.event]), k = L(() => {
|
|
2731
|
+
p(!1);
|
|
2732
|
+
}, []), l = /* @__PURE__ */ r(
|
|
2733
|
+
"button",
|
|
2734
|
+
{
|
|
2735
|
+
type: "button",
|
|
2736
|
+
onClick: y,
|
|
2737
|
+
className: d(
|
|
2738
|
+
"inline-flex items-center gap-1 rounded text-[10px] font-medium transition-opacity hover:opacity-80 mx-0.5 overflow-hidden w-full",
|
|
2739
|
+
"sm:text-xs",
|
|
2740
|
+
s.bg,
|
|
2741
|
+
s.text,
|
|
2742
|
+
t.event.isCanceled && "opacity-60 line-through",
|
|
2743
|
+
t.continuesBefore && "rounded-l-none -ml-0.5 pl-1",
|
|
2744
|
+
t.continuesAfter && "rounded-r-none -mr-0.5 pr-1"
|
|
2745
|
+
),
|
|
2746
|
+
style: {
|
|
2747
|
+
height: Me,
|
|
2748
|
+
lineHeight: `${Me}px`,
|
|
2749
|
+
paddingLeft: t.continuesBefore ? 4 : 6,
|
|
2750
|
+
paddingRight: t.continuesAfter ? 4 : 6
|
|
2751
|
+
},
|
|
2752
|
+
children: [
|
|
2753
|
+
t.continuesBefore && /* @__PURE__ */ e("span", { className: "text-[9px] opacity-60 flex-shrink-0", children: "◂" }),
|
|
2754
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: t.event.title }),
|
|
2755
|
+
t.isSingleDayAllDay && /* @__PURE__ */ e("span", { className: "text-[9px] opacity-70 flex-shrink-0 hidden sm:inline", children: "All day" }),
|
|
2756
|
+
t.continuesAfter && /* @__PURE__ */ e("span", { className: "text-[9px] opacity-60 flex-shrink-0", children: "▸" })
|
|
2757
|
+
]
|
|
2758
|
+
}
|
|
2759
|
+
), b = /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
|
|
2760
|
+
/* @__PURE__ */ e("div", { className: "font-medium", children: t.event.title }),
|
|
2761
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground tabular-nums", children: X(t.event) })
|
|
2762
|
+
] }) }), N = {
|
|
2763
|
+
gridColumn: `${t.startCol + 2} / ${t.endCol + 3}`,
|
|
2764
|
+
gridRow: t.row + 1
|
|
2765
|
+
};
|
|
2766
|
+
return o ? /* @__PURE__ */ e("div", { style: N, children: /* @__PURE__ */ r(ie, { children: [
|
|
2767
|
+
/* @__PURE__ */ e(se, { asChild: !0, children: l }),
|
|
2768
|
+
b
|
|
2769
|
+
] }) }) : /* @__PURE__ */ e("div", { style: N, children: /* @__PURE__ */ r(re, { open: i, onOpenChange: p, children: [
|
|
2770
|
+
/* @__PURE__ */ e(oe, { asChild: !0, children: l }),
|
|
2771
|
+
/* @__PURE__ */ e(Q, { className: "w-80", children: a ? a({ event: t.event, onClose: k }) : /* @__PURE__ */ e(hn, { event: t.event, onClose: k }) })
|
|
2772
|
+
] }) });
|
|
2773
|
+
}
|
|
2774
|
+
function hn({
|
|
2775
|
+
event: t,
|
|
2776
|
+
onClose: n
|
|
2777
|
+
}) {
|
|
2778
|
+
const o = de(t.color), a = t.isCanceled ?? !1;
|
|
2779
|
+
return /* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
2780
|
+
/* @__PURE__ */ r("div", { className: "flex items-start gap-3", children: [
|
|
2781
|
+
/* @__PURE__ */ e("div", { className: d("size-4 rounded shrink-0 mt-0.5", o.dot) }),
|
|
2782
|
+
/* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
|
|
2783
|
+
/* @__PURE__ */ e(
|
|
2784
|
+
"h3",
|
|
2785
|
+
{
|
|
2786
|
+
className: d(
|
|
2787
|
+
"font-semibold text-lg",
|
|
2788
|
+
a && "line-through opacity-50"
|
|
2789
|
+
),
|
|
2790
|
+
children: t.title
|
|
2791
|
+
}
|
|
2792
|
+
),
|
|
2793
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-sm text-muted-foreground mt-1 tabular-nums", children: X(t) })
|
|
2794
|
+
] })
|
|
2795
|
+
] }),
|
|
2796
|
+
t.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t.description }),
|
|
2797
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1.5", children: [
|
|
2798
|
+
t.isAllDay && /* @__PURE__ */ e("span", { className: "text-xs bg-muted px-2 py-0.5 rounded-full font-medium", children: "All day" }),
|
|
2799
|
+
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" })
|
|
2800
|
+
] }),
|
|
2801
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end pt-2 border-t", children: /* @__PURE__ */ e(
|
|
2802
|
+
"button",
|
|
2803
|
+
{
|
|
2804
|
+
type: "button",
|
|
2805
|
+
onClick: n,
|
|
2806
|
+
className: "text-xs text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md hover:bg-muted transition-colors",
|
|
2807
|
+
children: "Close"
|
|
2808
|
+
}
|
|
2809
|
+
) })
|
|
2810
|
+
] });
|
|
2811
|
+
}
|
|
2812
|
+
function pn({
|
|
2813
|
+
events: t,
|
|
2814
|
+
weekDays: n,
|
|
2815
|
+
hourColumnWidth: o,
|
|
2816
|
+
minDayColumnWidth: a,
|
|
2817
|
+
dayColumnWidths: i,
|
|
2818
|
+
onEventClick: p,
|
|
2819
|
+
disablePopover: s = !1,
|
|
2820
|
+
renderPopover: y,
|
|
2821
|
+
className: k
|
|
2822
|
+
}) {
|
|
2823
|
+
const l = F(() => {
|
|
2824
|
+
if (t.length === 0) return [];
|
|
2825
|
+
const v = t.map((W) => {
|
|
2826
|
+
const T = tt(W.startDate, n), A = tt(W.endDate, n), j = Math.max(0, T), E = Math.min(6, A);
|
|
2827
|
+
if (j > 6 || E < 0) return null;
|
|
2828
|
+
const _ = T < 0, M = A > 6, S = De(W) && le(W.startDate, W.endDate);
|
|
2829
|
+
return {
|
|
2830
|
+
event: W,
|
|
2831
|
+
startCol: j,
|
|
2832
|
+
endCol: E,
|
|
2833
|
+
continuesBefore: _,
|
|
2834
|
+
continuesAfter: M,
|
|
2835
|
+
isSingleDayAllDay: S
|
|
2836
|
+
};
|
|
2837
|
+
}).filter(Boolean);
|
|
2838
|
+
return un(v);
|
|
2839
|
+
}, [t, n]);
|
|
2840
|
+
if (l.length === 0) return null;
|
|
2841
|
+
const b = Math.max(...l.map((v) => v.row)) + 1, N = Math.min(b, ve), m = b > ve, g = m ? l.filter((v) => v.row >= ve).length : 0, u = [
|
|
2842
|
+
`${o}px`,
|
|
2843
|
+
...i.map((v) => v > a ? `${v}px` : `minmax(${a}px, 1fr)`)
|
|
2844
|
+
].join(" "), w = N * Me + (N - 1) * et + 8;
|
|
2845
|
+
return /* @__PURE__ */ r(
|
|
2846
|
+
"div",
|
|
2847
|
+
{
|
|
2848
|
+
className: d(
|
|
2849
|
+
"ic-all-day-row border-b bg-muted/20 relative",
|
|
2850
|
+
k
|
|
2851
|
+
),
|
|
2852
|
+
style: {
|
|
2853
|
+
display: "grid",
|
|
2854
|
+
gridTemplateColumns: u,
|
|
2855
|
+
gridTemplateRows: `repeat(${N}, ${Me}px)`,
|
|
2856
|
+
gap: `${et}px 0`,
|
|
2857
|
+
paddingTop: 4,
|
|
2858
|
+
paddingBottom: 4,
|
|
2859
|
+
minHeight: w
|
|
2860
|
+
},
|
|
2861
|
+
children: [
|
|
2862
|
+
/* @__PURE__ */ e(
|
|
2863
|
+
"div",
|
|
2864
|
+
{
|
|
2865
|
+
className: "flex items-start justify-center pt-1 text-[10px] font-medium text-muted-foreground",
|
|
2866
|
+
style: {
|
|
2867
|
+
gridColumn: 1,
|
|
2868
|
+
gridRow: `1 / span ${N}`
|
|
2869
|
+
},
|
|
2870
|
+
children: /* @__PURE__ */ e("span", { className: "hidden sm:inline", children: "All day" })
|
|
2871
|
+
}
|
|
2872
|
+
),
|
|
2873
|
+
n.map((v, W) => /* @__PURE__ */ e(
|
|
2874
|
+
"div",
|
|
2875
|
+
{
|
|
2876
|
+
className: "pointer-events-none border-r last:border-r-0",
|
|
2877
|
+
style: {
|
|
2878
|
+
gridColumn: W + 2,
|
|
2879
|
+
gridRow: `1 / span ${N}`
|
|
2880
|
+
}
|
|
2881
|
+
},
|
|
2882
|
+
v.toDateString()
|
|
2883
|
+
)),
|
|
2884
|
+
l.filter((v) => v.row < ve).map((v) => /* @__PURE__ */ e(
|
|
2885
|
+
mn,
|
|
2886
|
+
{
|
|
2887
|
+
pe: v,
|
|
2888
|
+
onEventClick: p,
|
|
2889
|
+
disablePopover: s,
|
|
2890
|
+
renderPopover: y
|
|
2891
|
+
},
|
|
2892
|
+
v.event.id
|
|
2893
|
+
)),
|
|
2894
|
+
m && /* @__PURE__ */ r(
|
|
2895
|
+
"div",
|
|
2896
|
+
{
|
|
2897
|
+
className: "text-[10px] text-muted-foreground font-medium px-2 flex items-center",
|
|
2898
|
+
style: {
|
|
2899
|
+
gridColumn: `2 / ${n.length + 2}`,
|
|
2900
|
+
gridRow: N
|
|
2901
|
+
},
|
|
2902
|
+
children: [
|
|
2903
|
+
"+",
|
|
2904
|
+
g,
|
|
2905
|
+
" more"
|
|
2906
|
+
]
|
|
2907
|
+
}
|
|
2908
|
+
)
|
|
2909
|
+
]
|
|
2910
|
+
}
|
|
2911
|
+
);
|
|
2912
|
+
}
|
|
2913
|
+
const ue = 96, ge = 56, nt = 72, Z = 120, Ne = 100, fn = 3;
|
|
2914
|
+
function Tn({
|
|
2623
2915
|
events: t,
|
|
2624
2916
|
date: n,
|
|
2625
2917
|
weekStartsOn: o = 1,
|
|
2626
2918
|
visibleHours: a = { startHour: 0, endHour: 24 },
|
|
2627
|
-
workingHours:
|
|
2628
|
-
slotDuration:
|
|
2629
|
-
badgeVariant:
|
|
2630
|
-
onEventClick:
|
|
2631
|
-
onSlotSelect:
|
|
2632
|
-
onDayClick:
|
|
2633
|
-
className:
|
|
2634
|
-
renderEvent:
|
|
2635
|
-
renderPopover:
|
|
2636
|
-
slots:
|
|
2637
|
-
classNames:
|
|
2919
|
+
workingHours: i,
|
|
2920
|
+
slotDuration: p = 30,
|
|
2921
|
+
badgeVariant: s = "colored",
|
|
2922
|
+
onEventClick: y,
|
|
2923
|
+
onSlotSelect: k,
|
|
2924
|
+
onDayClick: l,
|
|
2925
|
+
className: b,
|
|
2926
|
+
renderEvent: N,
|
|
2927
|
+
renderPopover: m,
|
|
2928
|
+
slots: g,
|
|
2929
|
+
classNames: u
|
|
2638
2930
|
}) {
|
|
2639
|
-
const w = 60 /
|
|
2640
|
-
const
|
|
2641
|
-
for (let
|
|
2642
|
-
|
|
2643
|
-
return
|
|
2644
|
-
}, [w,
|
|
2645
|
-
() =>
|
|
2931
|
+
const w = 60 / p, v = 100 / w, W = F(() => {
|
|
2932
|
+
const c = [];
|
|
2933
|
+
for (let h = 0; h < w; h++)
|
|
2934
|
+
c.push(h * p);
|
|
2935
|
+
return c;
|
|
2936
|
+
}, [w, p]), T = F(
|
|
2937
|
+
() => wt(n, o),
|
|
2646
2938
|
[n, o]
|
|
2647
|
-
),
|
|
2648
|
-
() =>
|
|
2939
|
+
), A = F(
|
|
2940
|
+
() => at(a),
|
|
2649
2941
|
[a]
|
|
2650
|
-
),
|
|
2651
|
-
const
|
|
2652
|
-
for (const
|
|
2653
|
-
const
|
|
2654
|
-
|
|
2655
|
-
|
|
2942
|
+
), j = F(() => {
|
|
2943
|
+
const c = /* @__PURE__ */ new Map();
|
|
2944
|
+
for (const h of T) {
|
|
2945
|
+
const C = h.toDateString(), H = He(t, h), { singleDay: z, multiDay: Y } = rt(H), O = ot(
|
|
2946
|
+
z,
|
|
2947
|
+
h,
|
|
2656
2948
|
a,
|
|
2657
|
-
|
|
2949
|
+
ue
|
|
2658
2950
|
), G = /* @__PURE__ */ new Map();
|
|
2659
2951
|
let U = 1;
|
|
2660
|
-
for (const K of
|
|
2952
|
+
for (const K of O)
|
|
2661
2953
|
if (G.set(K.event.id, K.position), K.position.width > 0) {
|
|
2662
|
-
const
|
|
2663
|
-
U = Math.max(U,
|
|
2954
|
+
const ae = Math.round(100 / K.position.width);
|
|
2955
|
+
U = Math.max(U, ae);
|
|
2664
2956
|
}
|
|
2665
|
-
|
|
2666
|
-
singleDay:
|
|
2957
|
+
c.set(C, {
|
|
2958
|
+
singleDay: z,
|
|
2667
2959
|
multiDay: Y,
|
|
2668
2960
|
positions: G,
|
|
2669
2961
|
maxOverlapping: U
|
|
2670
2962
|
});
|
|
2671
2963
|
}
|
|
2672
|
-
return
|
|
2673
|
-
}, [
|
|
2674
|
-
const
|
|
2675
|
-
for (const { multiDay:
|
|
2676
|
-
for (const
|
|
2677
|
-
|
|
2678
|
-
return Array.from(
|
|
2679
|
-
}, [
|
|
2964
|
+
return c;
|
|
2965
|
+
}, [T, t, a]), E = F(() => {
|
|
2966
|
+
const c = /* @__PURE__ */ new Map();
|
|
2967
|
+
for (const { multiDay: h } of j.values())
|
|
2968
|
+
for (const C of h)
|
|
2969
|
+
c.set(C.id, C);
|
|
2970
|
+
return Array.from(c.values());
|
|
2971
|
+
}, [j]), _ = /* @__PURE__ */ new Date(), M = T.findIndex((c) => ce(c)), I = F(() => {
|
|
2680
2972
|
if (M < 0) return -1;
|
|
2681
|
-
const
|
|
2682
|
-
return
|
|
2683
|
-
}, [M, a,
|
|
2684
|
-
|
|
2685
|
-
const
|
|
2686
|
-
if (!
|
|
2687
|
-
const
|
|
2688
|
-
let
|
|
2973
|
+
const c = _.getHours() + _.getMinutes() / 60;
|
|
2974
|
+
return c < a.startHour || c > a.endHour ? -1 : (c - a.startHour) * ue;
|
|
2975
|
+
}, [M, a, _]), S = te(null);
|
|
2976
|
+
Ie(() => {
|
|
2977
|
+
const c = S.current;
|
|
2978
|
+
if (!c) return;
|
|
2979
|
+
const h = () => {
|
|
2980
|
+
let C;
|
|
2689
2981
|
if (M !== -1) {
|
|
2690
|
-
const
|
|
2691
|
-
|
|
2982
|
+
const z = (/* @__PURE__ */ new Date()).getHours();
|
|
2983
|
+
C = Math.max(z - 1, a.startHour);
|
|
2692
2984
|
} else {
|
|
2693
2985
|
const Y = (/* @__PURE__ */ new Date()).getDay();
|
|
2694
|
-
let
|
|
2695
|
-
if (!
|
|
2696
|
-
const G =
|
|
2697
|
-
G?.enabled && (
|
|
2986
|
+
let O = i?.[Y];
|
|
2987
|
+
if (!O?.enabled || O.from === 0) {
|
|
2988
|
+
const G = i?.[1];
|
|
2989
|
+
G?.enabled && (O = G);
|
|
2698
2990
|
}
|
|
2699
|
-
|
|
2700
|
-
|
|
2991
|
+
O?.enabled && O.from > 0 ? C = Math.max(
|
|
2992
|
+
O.from - 1,
|
|
2701
2993
|
a.startHour
|
|
2702
|
-
) :
|
|
2994
|
+
) : C = Math.max(7, a.startHour);
|
|
2703
2995
|
}
|
|
2704
|
-
const
|
|
2705
|
-
|
|
2706
|
-
top:
|
|
2996
|
+
const H = (C - a.startHour) * ue;
|
|
2997
|
+
c.scrollTo({
|
|
2998
|
+
top: H,
|
|
2707
2999
|
behavior: "instant"
|
|
2708
3000
|
});
|
|
2709
3001
|
};
|
|
2710
3002
|
requestAnimationFrame(() => {
|
|
2711
|
-
requestAnimationFrame(
|
|
3003
|
+
requestAnimationFrame(h);
|
|
2712
3004
|
});
|
|
2713
|
-
}, [n,
|
|
2714
|
-
const
|
|
2715
|
-
(
|
|
2716
|
-
|
|
3005
|
+
}, [n, i, a, M]);
|
|
3006
|
+
const $ = je(), q = L(
|
|
3007
|
+
(c) => {
|
|
3008
|
+
$?.startSelection(c);
|
|
2717
3009
|
},
|
|
2718
|
-
[
|
|
2719
|
-
),
|
|
2720
|
-
(
|
|
2721
|
-
|
|
3010
|
+
[$]
|
|
3011
|
+
), f = L(
|
|
3012
|
+
(c) => {
|
|
3013
|
+
$?.updateSelection(c);
|
|
2722
3014
|
},
|
|
2723
|
-
[
|
|
2724
|
-
),
|
|
2725
|
-
|
|
2726
|
-
}, [
|
|
2727
|
-
(
|
|
2728
|
-
|
|
3015
|
+
[$]
|
|
3016
|
+
), x = L(() => {
|
|
3017
|
+
$?.endSelection();
|
|
3018
|
+
}, [$]), B = L(
|
|
3019
|
+
(c) => {
|
|
3020
|
+
y?.(c);
|
|
2729
3021
|
},
|
|
2730
|
-
[
|
|
2731
|
-
),
|
|
2732
|
-
const
|
|
2733
|
-
for (const
|
|
2734
|
-
const
|
|
2735
|
-
|
|
2736
|
-
Math.max(
|
|
2737
|
-
) :
|
|
3022
|
+
[y]
|
|
3023
|
+
), R = ge + 7 * Z, P = F(() => {
|
|
3024
|
+
const c = [];
|
|
3025
|
+
for (const h of T) {
|
|
3026
|
+
const C = h.toDateString(), z = j.get(C)?.maxOverlapping ?? 1;
|
|
3027
|
+
z > fn ? c.push(
|
|
3028
|
+
Math.max(Z, z * Ne)
|
|
3029
|
+
) : c.push(Z);
|
|
2738
3030
|
}
|
|
2739
|
-
return
|
|
2740
|
-
}, [
|
|
2741
|
-
return /* @__PURE__ */ r("div", { className:
|
|
2742
|
-
|
|
2743
|
-
|
|
3031
|
+
return c;
|
|
3032
|
+
}, [T, j]), D = ge + P.reduce((c, h) => c + h, 0);
|
|
3033
|
+
return /* @__PURE__ */ r("div", { className: d("ic-week-view flex flex-col h-full", b), children: [
|
|
3034
|
+
E.length > 0 && /* @__PURE__ */ e(
|
|
3035
|
+
pn,
|
|
2744
3036
|
{
|
|
2745
|
-
events:
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
3037
|
+
events: E,
|
|
3038
|
+
weekDays: T,
|
|
3039
|
+
hourColumnWidth: ge,
|
|
3040
|
+
minDayColumnWidth: Z,
|
|
3041
|
+
dayColumnWidths: P,
|
|
3042
|
+
onEventClick: B,
|
|
3043
|
+
disablePopover: !!y && !m,
|
|
3044
|
+
renderPopover: m,
|
|
3045
|
+
...u?.multiDayBanner && {
|
|
3046
|
+
className: u.multiDayBanner
|
|
2750
3047
|
}
|
|
2751
3048
|
}
|
|
2752
3049
|
),
|
|
2753
3050
|
/* @__PURE__ */ e(
|
|
2754
3051
|
"div",
|
|
2755
3052
|
{
|
|
2756
|
-
ref:
|
|
2757
|
-
className:
|
|
3053
|
+
ref: S,
|
|
3054
|
+
className: d(
|
|
2758
3055
|
"ic-week-scroll-container flex-1",
|
|
2759
|
-
|
|
3056
|
+
u?.scrollContainer
|
|
2760
3057
|
),
|
|
2761
|
-
children: /* @__PURE__ */ r("div", { style: { minWidth: Math.max(
|
|
3058
|
+
children: /* @__PURE__ */ r("div", { style: { minWidth: Math.max(R, D) }, children: [
|
|
2762
3059
|
/* @__PURE__ */ e("div", { className: "ic-week-header sticky top-0 z-20 border-b bg-background", children: /* @__PURE__ */ r("div", { className: "flex", children: [
|
|
2763
3060
|
/* @__PURE__ */ e(
|
|
2764
3061
|
"div",
|
|
2765
3062
|
{
|
|
2766
3063
|
className: "flex-shrink-0 flex items-end justify-center pb-2 text-[10px] text-muted-foreground/70",
|
|
2767
|
-
style: { width:
|
|
3064
|
+
style: { width: ge, height: nt },
|
|
2768
3065
|
children: /* @__PURE__ */ r("span", { className: "hidden sm:inline", children: [
|
|
2769
3066
|
"GMT",
|
|
2770
3067
|
(() => {
|
|
2771
|
-
const
|
|
2772
|
-
return
|
|
3068
|
+
const c = (/* @__PURE__ */ new Date()).getTimezoneOffset(), h = Math.abs(Math.floor(c / 60)), C = c <= 0 ? "+" : "-";
|
|
3069
|
+
return h > 0 ? `${C}${String(h).padStart(2, "0")}` : "";
|
|
2773
3070
|
})()
|
|
2774
3071
|
] })
|
|
2775
3072
|
}
|
|
2776
3073
|
),
|
|
2777
|
-
|
|
2778
|
-
const
|
|
3074
|
+
T.map((c, h) => {
|
|
3075
|
+
const C = ce(c), H = P[h] ?? Z, z = H > Z;
|
|
2779
3076
|
return /* @__PURE__ */ r(
|
|
2780
3077
|
"div",
|
|
2781
3078
|
{
|
|
2782
|
-
className:
|
|
3079
|
+
className: d(
|
|
2783
3080
|
"flex-1 flex flex-col items-center justify-center border-r last:border-r-0 py-2",
|
|
2784
|
-
|
|
2785
|
-
|
|
3081
|
+
u?.columnHeader,
|
|
3082
|
+
C && u?.columnHeaderToday
|
|
2786
3083
|
),
|
|
2787
3084
|
style: {
|
|
2788
|
-
height:
|
|
2789
|
-
minWidth:
|
|
3085
|
+
height: nt,
|
|
3086
|
+
minWidth: z ? H : Z
|
|
2790
3087
|
},
|
|
2791
3088
|
children: [
|
|
2792
3089
|
/* @__PURE__ */ e(
|
|
2793
3090
|
"span",
|
|
2794
3091
|
{
|
|
2795
|
-
className:
|
|
3092
|
+
className: d(
|
|
2796
3093
|
"text-[11px] font-medium uppercase tracking-wide",
|
|
2797
|
-
|
|
3094
|
+
C ? "text-primary" : "text-muted-foreground"
|
|
2798
3095
|
),
|
|
2799
|
-
children:
|
|
3096
|
+
children: c.toLocaleDateString([], { weekday: "short" })
|
|
2800
3097
|
}
|
|
2801
3098
|
),
|
|
2802
3099
|
/* @__PURE__ */ e(
|
|
2803
3100
|
"button",
|
|
2804
3101
|
{
|
|
2805
3102
|
type: "button",
|
|
2806
|
-
onClick: () =>
|
|
2807
|
-
className:
|
|
3103
|
+
onClick: () => l?.(c),
|
|
3104
|
+
className: d(
|
|
2808
3105
|
"flex items-center justify-center rounded-full transition-colors mt-0.5",
|
|
2809
3106
|
"size-10 text-2xl font-normal",
|
|
2810
|
-
|
|
3107
|
+
C ? "bg-primary text-primary-foreground" : "text-foreground hover:bg-muted"
|
|
2811
3108
|
),
|
|
2812
|
-
children:
|
|
3109
|
+
children: c.getDate()
|
|
2813
3110
|
}
|
|
2814
3111
|
)
|
|
2815
3112
|
]
|
|
2816
3113
|
},
|
|
2817
|
-
|
|
3114
|
+
c.toDateString()
|
|
2818
3115
|
);
|
|
2819
3116
|
})
|
|
2820
3117
|
] }) }),
|
|
@@ -2822,104 +3119,104 @@ function bn({
|
|
|
2822
3119
|
/* @__PURE__ */ e(
|
|
2823
3120
|
"div",
|
|
2824
3121
|
{
|
|
2825
|
-
className:
|
|
3122
|
+
className: d(
|
|
2826
3123
|
"ic-hour-column sticky left-0 z-10 bg-zinc-50 border-r",
|
|
2827
|
-
|
|
3124
|
+
u?.timeGutter
|
|
2828
3125
|
),
|
|
2829
|
-
style: { width:
|
|
2830
|
-
children:
|
|
3126
|
+
style: { width: ge },
|
|
3127
|
+
children: A.map((c, h) => /* @__PURE__ */ e(
|
|
2831
3128
|
"div",
|
|
2832
3129
|
{
|
|
2833
3130
|
className: "relative",
|
|
2834
|
-
style: { height:
|
|
2835
|
-
children: /* @__PURE__ */ e("div", { className: "absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center", children:
|
|
3131
|
+
style: { height: ue },
|
|
3132
|
+
children: /* @__PURE__ */ e("div", { className: "absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center", children: h !== 0 && /* @__PURE__ */ e(
|
|
2836
3133
|
"span",
|
|
2837
3134
|
{
|
|
2838
|
-
className:
|
|
3135
|
+
className: d(
|
|
2839
3136
|
"text-[10px] sm:text-xs text-muted-foreground",
|
|
2840
|
-
|
|
3137
|
+
u?.timeGutterLabel
|
|
2841
3138
|
),
|
|
2842
|
-
children:
|
|
3139
|
+
children: Ce(c)
|
|
2843
3140
|
}
|
|
2844
3141
|
) })
|
|
2845
3142
|
},
|
|
2846
|
-
|
|
3143
|
+
c
|
|
2847
3144
|
))
|
|
2848
3145
|
}
|
|
2849
3146
|
),
|
|
2850
|
-
/* @__PURE__ */ e("div", { className: "ic-week-grid relative flex-1", children: /* @__PURE__ */ e("div", { className: "flex divide-x", children:
|
|
2851
|
-
const
|
|
3147
|
+
/* @__PURE__ */ e("div", { className: "ic-week-grid relative flex-1", children: /* @__PURE__ */ e("div", { className: "flex divide-x", children: T.map((c, h) => {
|
|
3148
|
+
const C = c.toDateString(), H = j.get(C), z = P[h] ?? Z, Y = z > Z;
|
|
2852
3149
|
return /* @__PURE__ */ r(
|
|
2853
3150
|
"div",
|
|
2854
3151
|
{
|
|
2855
3152
|
className: "ic-day-column relative flex-1",
|
|
2856
3153
|
style: {
|
|
2857
|
-
minWidth: Y ?
|
|
3154
|
+
minWidth: Y ? z : Z
|
|
2858
3155
|
},
|
|
2859
3156
|
children: [
|
|
2860
|
-
|
|
2861
|
-
const K = !
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
3157
|
+
A.map((O, G) => {
|
|
3158
|
+
const K = !it(
|
|
3159
|
+
c,
|
|
3160
|
+
O,
|
|
3161
|
+
i
|
|
2865
3162
|
);
|
|
2866
3163
|
return /* @__PURE__ */ r(
|
|
2867
3164
|
"div",
|
|
2868
3165
|
{
|
|
2869
|
-
className:
|
|
3166
|
+
className: d(
|
|
2870
3167
|
"relative",
|
|
2871
3168
|
K && "bg-calendar-disabled-hour",
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
K ?
|
|
3169
|
+
ce(c) && !K && "bg-primary/5",
|
|
3170
|
+
u?.timeSlot,
|
|
3171
|
+
K ? u?.timeSlotNonWorking : u?.timeSlotWorking
|
|
2875
3172
|
),
|
|
2876
|
-
style: { height:
|
|
3173
|
+
style: { height: ue },
|
|
2877
3174
|
children: [
|
|
2878
3175
|
G !== 0 && /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-x-0 top-0 border-b border-border/50" }),
|
|
2879
|
-
|
|
3176
|
+
W.slice(1).map((ae) => /* @__PURE__ */ e(
|
|
2880
3177
|
"div",
|
|
2881
3178
|
{
|
|
2882
3179
|
className: "pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",
|
|
2883
|
-
style: { top: `${
|
|
3180
|
+
style: { top: `${ae / 60 * 100}%` }
|
|
2884
3181
|
},
|
|
2885
|
-
|
|
3182
|
+
ae
|
|
2886
3183
|
)),
|
|
2887
|
-
|
|
2888
|
-
const
|
|
2889
|
-
date:
|
|
2890
|
-
hour:
|
|
2891
|
-
minute:
|
|
3184
|
+
W.map((ae, ht) => {
|
|
3185
|
+
const Ve = {
|
|
3186
|
+
date: c,
|
|
3187
|
+
hour: O,
|
|
3188
|
+
minute: ae
|
|
2892
3189
|
};
|
|
2893
3190
|
return /* @__PURE__ */ e(
|
|
2894
|
-
|
|
3191
|
+
mt,
|
|
2895
3192
|
{
|
|
2896
|
-
slot:
|
|
3193
|
+
slot: Ve,
|
|
2897
3194
|
onSelectionStart: q,
|
|
2898
|
-
onSelectionMove:
|
|
2899
|
-
onSelectionEnd:
|
|
2900
|
-
isSelected:
|
|
2901
|
-
isSelecting:
|
|
3195
|
+
onSelectionMove: f,
|
|
3196
|
+
onSelectionEnd: x,
|
|
3197
|
+
isSelected: $?.isSlotSelected(Ve) ?? !1,
|
|
3198
|
+
isSelecting: $?.isSelecting ?? !1,
|
|
2902
3199
|
disabled: K,
|
|
2903
3200
|
className: "absolute inset-x-0",
|
|
2904
3201
|
style: {
|
|
2905
|
-
top: `${
|
|
2906
|
-
height: `${
|
|
3202
|
+
top: `${ht * v}%`,
|
|
3203
|
+
height: `${v}%`
|
|
2907
3204
|
},
|
|
2908
|
-
ariaLabel: `Add event on ${
|
|
3205
|
+
ariaLabel: `Add event on ${c.toLocaleDateString()} at ${Ce(O)}:${String(ae).padStart(2, "0")}`
|
|
2909
3206
|
},
|
|
2910
|
-
|
|
3207
|
+
ae
|
|
2911
3208
|
);
|
|
2912
3209
|
})
|
|
2913
3210
|
]
|
|
2914
3211
|
},
|
|
2915
|
-
|
|
3212
|
+
O
|
|
2916
3213
|
);
|
|
2917
3214
|
}),
|
|
2918
|
-
|
|
2919
|
-
const G =
|
|
3215
|
+
H?.singleDay.map((O) => {
|
|
3216
|
+
const G = H.positions.get(O.id);
|
|
2920
3217
|
if (!G) return null;
|
|
2921
|
-
const U = `calc(${G.width}% - 2px)`, K = `max(${
|
|
2922
|
-
return
|
|
3218
|
+
const U = `calc(${G.width}% - 2px)`, K = `max(${Ne}px, ${U})`;
|
|
3219
|
+
return N ? /* @__PURE__ */ e(
|
|
2923
3220
|
"div",
|
|
2924
3221
|
{
|
|
2925
3222
|
className: "absolute pointer-events-auto p-0.5",
|
|
@@ -2927,42 +3224,42 @@ function bn({
|
|
|
2927
3224
|
top: `${G.top}px`,
|
|
2928
3225
|
left: `${G.left}%`,
|
|
2929
3226
|
width: K,
|
|
2930
|
-
minWidth: `${
|
|
3227
|
+
minWidth: `${Ne}px`
|
|
2931
3228
|
},
|
|
2932
|
-
children:
|
|
3229
|
+
children: N({ event: O, position: G })
|
|
2933
3230
|
},
|
|
2934
|
-
|
|
3231
|
+
O.id
|
|
2935
3232
|
) : /* @__PURE__ */ e(
|
|
2936
|
-
|
|
3233
|
+
lt,
|
|
2937
3234
|
{
|
|
2938
|
-
event:
|
|
3235
|
+
event: O,
|
|
2939
3236
|
position: {
|
|
2940
3237
|
top: G.top,
|
|
2941
3238
|
left: G.left,
|
|
2942
3239
|
width: G.width,
|
|
2943
|
-
minWidth:
|
|
3240
|
+
minWidth: Ne
|
|
2944
3241
|
},
|
|
2945
|
-
hourHeight:
|
|
2946
|
-
badgeVariant:
|
|
2947
|
-
onClick:
|
|
2948
|
-
disablePopover: !!
|
|
2949
|
-
renderPopover:
|
|
2950
|
-
className:
|
|
3242
|
+
hourHeight: ue,
|
|
3243
|
+
badgeVariant: s,
|
|
3244
|
+
onClick: y,
|
|
3245
|
+
disablePopover: !!y && !m,
|
|
3246
|
+
renderPopover: m,
|
|
3247
|
+
className: d(
|
|
2951
3248
|
"pointer-events-auto",
|
|
2952
|
-
|
|
3249
|
+
u?.eventCard
|
|
2953
3250
|
)
|
|
2954
3251
|
},
|
|
2955
|
-
|
|
3252
|
+
O.id
|
|
2956
3253
|
);
|
|
2957
3254
|
}),
|
|
2958
|
-
|
|
3255
|
+
h === M && I >= 0 && /* @__PURE__ */ r(
|
|
2959
3256
|
"div",
|
|
2960
3257
|
{
|
|
2961
|
-
className:
|
|
3258
|
+
className: d(
|
|
2962
3259
|
"absolute left-0 right-0 z-20 flex items-center pointer-events-none",
|
|
2963
|
-
|
|
3260
|
+
u?.currentTimeIndicator
|
|
2964
3261
|
),
|
|
2965
|
-
style: { top:
|
|
3262
|
+
style: { top: I },
|
|
2966
3263
|
children: [
|
|
2967
3264
|
/* @__PURE__ */ e("div", { className: "h-2 w-2 -ml-1 rounded-full bg-red-500" }),
|
|
2968
3265
|
/* @__PURE__ */ e("div", { className: "flex-1 h-0.5 bg-red-500" })
|
|
@@ -2971,7 +3268,7 @@ function bn({
|
|
|
2971
3268
|
)
|
|
2972
3269
|
]
|
|
2973
3270
|
},
|
|
2974
|
-
|
|
3271
|
+
c.toDateString()
|
|
2975
3272
|
);
|
|
2976
3273
|
}) }) })
|
|
2977
3274
|
] })
|
|
@@ -2981,35 +3278,35 @@ function bn({
|
|
|
2981
3278
|
] });
|
|
2982
3279
|
}
|
|
2983
3280
|
export {
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3281
|
+
Cn as A,
|
|
3282
|
+
me as B,
|
|
3283
|
+
Dn as C,
|
|
3284
|
+
Ut as D,
|
|
3285
|
+
lt as E,
|
|
3286
|
+
Mn as M,
|
|
3287
|
+
re as P,
|
|
3288
|
+
mt as T,
|
|
3289
|
+
Tn as W,
|
|
3290
|
+
nn as a,
|
|
3291
|
+
ln as b,
|
|
3292
|
+
Sn as c,
|
|
3293
|
+
Se as d,
|
|
3294
|
+
an as e,
|
|
3295
|
+
kn as f,
|
|
3296
|
+
vn as g,
|
|
3297
|
+
Q as h,
|
|
3298
|
+
oe as i,
|
|
3299
|
+
Kt as j,
|
|
3300
|
+
ie as k,
|
|
3301
|
+
ne as l,
|
|
3302
|
+
Nn as m,
|
|
3303
|
+
se as n,
|
|
3304
|
+
kt as o,
|
|
3305
|
+
de as p,
|
|
3306
|
+
Xe as q,
|
|
3307
|
+
Ye as r,
|
|
3308
|
+
Ee as s,
|
|
3309
|
+
Be as t,
|
|
3013
3310
|
Pt as u
|
|
3014
3311
|
};
|
|
3015
|
-
//# sourceMappingURL=week-view-
|
|
3312
|
+
//# sourceMappingURL=week-view-Dh-gHd0m.js.map
|