@innosolutions/inno-calendar 1.0.69 → 1.0.71
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-Bl-Gb588.cjs +2 -0
- package/dist/agenda-widget-Bl-Gb588.cjs.map +1 -0
- package/dist/{agenda-widget-QSVTdgaz.js → agenda-widget-DrRyLzTK.js} +124 -119
- package/dist/agenda-widget-DrRyLzTK.js.map +1 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/components/inno-calendar.d.ts +23 -1
- package/dist/components/inno-calendar.d.ts.map +1 -1
- package/dist/components/views/timeline-view.d.ts.map +1 -1
- package/dist/core/context/inno-calendar-provider.d.ts +8 -2
- package/dist/core/context/inno-calendar-provider.d.ts.map +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.mjs +4 -4
- package/dist/core/types.d.ts +55 -8
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/utils/view-storage.d.ts +14 -10
- package/dist/core/utils/view-storage.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +7 -7
- package/dist/position-utils-D_KpwRus.js +1053 -0
- package/dist/position-utils-D_KpwRus.js.map +1 -0
- package/dist/position-utils-ksZ_IjXC.cjs +2 -0
- package/dist/position-utils-ksZ_IjXC.cjs.map +1 -0
- package/dist/presets/index.cjs +1 -1
- package/dist/presets/index.mjs +1 -1
- package/dist/slot-selection-context-CLYZU6ul.cjs +2 -0
- package/dist/slot-selection-context-CLYZU6ul.cjs.map +1 -0
- package/dist/slot-selection-context-Ct5cVcKW.js +611 -0
- package/dist/slot-selection-context-Ct5cVcKW.js.map +1 -0
- package/dist/{tailwind-calendar-KJ1XJ4gr.cjs → tailwind-calendar-BbUb61uY.cjs} +2 -2
- package/dist/{tailwind-calendar-KJ1XJ4gr.cjs.map → tailwind-calendar-BbUb61uY.cjs.map} +1 -1
- package/dist/{tailwind-calendar-B6qsueM3.js → tailwind-calendar-DrwGVSF-.js} +3 -3
- package/dist/{tailwind-calendar-B6qsueM3.js.map → tailwind-calendar-DrwGVSF-.js.map} +1 -1
- package/dist/{use-calendar-BwqE_WNA.cjs → use-calendar-BK0nQYJq.cjs} +2 -2
- package/dist/{use-calendar-BwqE_WNA.cjs.map → use-calendar-BK0nQYJq.cjs.map} +1 -1
- package/dist/{use-calendar--JnbGA3L.js → use-calendar-DJI35SSd.js} +2 -2
- package/dist/{use-calendar--JnbGA3L.js.map → use-calendar-DJI35SSd.js.map} +1 -1
- package/dist/{use-slot-selection-C1tk-o0j.cjs → use-slot-selection-CCE11R4j.cjs} +2 -2
- package/dist/{use-slot-selection-C1tk-o0j.cjs.map → use-slot-selection-CCE11R4j.cjs.map} +1 -1
- package/dist/{use-slot-selection-BLCDzQzo.js → use-slot-selection-CX1w8EdM.js} +3 -3
- package/dist/{use-slot-selection-BLCDzQzo.js.map → use-slot-selection-CX1w8EdM.js.map} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.mjs +1 -1
- package/dist/{week-view-Dv-Uz0eT.cjs → week-view-BXmaRChB.cjs} +2 -2
- package/dist/{week-view-Dv-Uz0eT.cjs.map → week-view-BXmaRChB.cjs.map} +1 -1
- package/dist/{week-view-B1KsZsC3.js → week-view-BeasFcyR.js} +3 -3
- package/dist/{week-view-B1KsZsC3.js.map → week-view-BeasFcyR.js.map} +1 -1
- package/package.json +1 -1
- package/dist/agenda-widget-BJroIHYG.cjs +0 -2
- package/dist/agenda-widget-BJroIHYG.cjs.map +0 -1
- package/dist/agenda-widget-QSVTdgaz.js.map +0 -1
- package/dist/position-utils-BzmOPdvQ.js +0 -1038
- package/dist/position-utils-BzmOPdvQ.js.map +0 -1
- package/dist/position-utils-EQTCC4tZ.cjs +0 -2
- package/dist/position-utils-EQTCC4tZ.cjs.map +0 -1
- package/dist/slot-selection-context-CjS_VIPj.js +0 -603
- package/dist/slot-selection-context-CjS_VIPj.js.map +0 -1
- package/dist/slot-selection-context-CmE-aWgt.cjs +0 -2
- package/dist/slot-selection-context-CmE-aWgt.cjs.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),Me=require("./use-calendar-BK0nQYJq.cjs"),c=require("react"),m=require("./index-D2U2F80P.cjs"),j=require("./week-view-BXmaRChB.cjs"),ke=require("./slot-selection-context-CLYZU6ul.cjs"),J=require("./position-utils-ksZ_IjXC.cjs");function st({view:t,className:n=""}){return e.jsx("div",{className:n,style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"400px",backgroundColor:"#f9fafb",borderRadius:"0.5rem",border:"1px dashed #d1d5db"},children:e.jsxs("div",{style:{textAlign:"center",color:"#6b7280"},children:[e.jsxs("p",{style:{fontSize:"1.125rem",fontWeight:500},children:[t.charAt(0).toUpperCase()+t.slice(1)," View"]}),e.jsx("p",{style:{fontSize:"0.875rem"},children:"Implementation pending"})]})})}function Ae({view:t,className:n}){return e.jsx(st,{view:t,className:n})}function ot(t){const{events:n,resources:s,scheduleTypes:r,initialView:o="week",initialDate:i,initialFilters:g,preferences:x,locale:l,slots:v,renderEvent:I,onViewChange:b,onDateChange:w,onEventClick:F,onSlotSelect:S,onFiltersChange:O,className:_,children:B}=t,H=Me.useOptionalCalendarContext();if(H)return e.jsx("div",{className:_,style:{position:"relative"},children:B??e.jsx(Ae,{view:H.view,className:_})});const E=Me.useCalendar({events:n,resources:s,scheduleTypes:r,initialView:o,initialDate:i,initialFilters:g,preferences:x,locale:l,onViewChange:b,onDateChange:w,onEventClick:F,onSlotSelect:S,onFiltersChange:O});return e.jsx(Me.CalendarProvider,{value:E,children:e.jsx("div",{className:_,style:{position:"relative"},children:B??e.jsx(Ae,{view:E.view,className:_})})})}function at({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}),e.jsx("path",{d:"m15 5 4 4"})]})}function Je({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M3 6h18"}),e.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}),e.jsx("line",{x1:"10",x2:"10",y1:"11",y2:"17"}),e.jsx("line",{x1:"14",x2:"14",y1:"11",y2:"17"})]})}function Te({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M18 6 6 18"}),e.jsx("path",{d:"m6 6 12 12"})]})}function it({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m4.9 4.9 14.2 14.2"})]})}function be({className:t}){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:e.jsx("path",{d:"M20 6 9 17l-5-5"})})}function lt({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m9 12 2 2 4-4"})]})}function ct({className:t}){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}function dt({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"}),e.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})}function ut({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"}),e.jsx("circle",{cx:"12",cy:"10",r:"3"})]})}function xt({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M8 2v4"}),e.jsx("path",{d:"M16 2v4"}),e.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),e.jsx("path",{d:"M3 10h18"})]})}function ht({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),e.jsx("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),e.jsx("path",{d:"M10 9H8"}),e.jsx("path",{d:"M16 13H8"}),e.jsx("path",{d:"M16 17H8"})]})}function pe({className:t}){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:m.cn("animate-spin",t),children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}const mt={edit:"Edit",delete:"Delete",cancel:"Cancel Event",close:"Close",going:"Going",notGoing:"Not Going",confirmMeeting:"Confirm meeting took place",completed:"Completed",canceled:"Canceled",participants:"Participants",guest:"guest",guests:"guests",confirmed:"confirmed",organizer:"Organizer",client:"Client",more:"more",noDateProvided:"No date provided",eventNotFound:"Event not found",cancellationNote:"Cancellation Note",canceledOn:"Canceled on",acceptThisEvent:"Accept this event only",acceptAllEvents:"Accept all events",deleteConfirmTitle:"Delete Event",deleteConfirmDescription:"Are you sure you want to delete this event? This action cannot be undone."},ye=c.forwardRef(({onClick:t,label:n,children:s,className:r,variant:o="ghost",...i},g)=>e.jsxs(j.Tooltip,{children:[e.jsx(j.TooltipTrigger,{asChild:!0,children:e.jsx("button",{type:"button",ref:g,onClick:t,className:m.cn("h-8 w-8 rounded-full flex items-center justify-center transition-colors",o==="ghost"&&"hover:bg-zinc-100 dark:hover:bg-zinc-800 text-zinc-600 dark:text-zinc-400",o==="destructive"&&"hover:bg-red-50 dark:hover:bg-red-950/30 text-zinc-600 dark:text-zinc-400 hover:text-red-600",r),"aria-label":n,...i,children:s})}),e.jsx(j.TooltipContent,{side:"bottom",className:"text-xs",children:n})]}));ye.displayName="IconButton";function ft({src:t,alt:n,initials:s,className:r,isClient:o}){const[i,g]=c.useState(!1);return e.jsx("div",{className:m.cn("relative h-7 w-7 rounded-full overflow-hidden shrink-0",r),children:t&&!i?e.jsx("img",{src:t,alt:n,className:"h-full w-full object-cover",onError:()=>g(!0)}):e.jsx("div",{className:m.cn("h-full w-full flex items-center justify-center text-[10px] font-medium",o?"bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300":"bg-zinc-200 dark:bg-zinc-700 text-zinc-700 dark:text-zinc-300"),children:s})})}function Fe({participant:t,isEventCanceled:n=!1,labels:s}){const r=t.name||"Unknown",o=r.split(" ").map(w=>w[0]).join("").toUpperCase().slice(0,2),i=t.isOrganizer??!1,g=t.isConfirmed,x=g===!0,l=g===!1,v=t.isClient??!1,I=t.profilePicture||t.avatar,b=n;return e.jsxs("div",{className:m.cn("flex items-center gap-3 py-0",b&&"opacity-60"),children:[e.jsxs("div",{className:"relative",children:[e.jsx(ft,{src:I,alt:r,initials:o,isClient:v,className:m.cn(b&&"grayscale")}),b||l?e.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center",children:e.jsx("div",{className:"h-3 w-3 rounded-full bg-red-100 dark:bg-red-900/50 flex items-center justify-center",children:e.jsx(Te,{className:"h-2 w-2 text-red-600 dark:text-red-400 stroke-[3]"})})}):x?e.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center",children:e.jsx("div",{className:"h-3 w-3 rounded-full bg-green-100 dark:bg-green-900/50 flex items-center justify-center",children:e.jsx(be,{className:"h-2 w-2 text-green-600 dark:text-green-400 stroke-[3]"})})}):null]}),e.jsxs("div",{className:"!h-fit min-w-0 gap-0",children:[e.jsx("div",{className:"gap-0",children:e.jsx("span",{className:m.cn("text-sm text-zinc-900 dark:text-zinc-100 truncate",b&&"line-through text-zinc-500 dark:text-zinc-500"),children:r})}),v&&e.jsx("div",{className:"text-[10px] px-1.5 w-fit py-0.5 rounded bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 font-medium",children:s.client}),i&&!b&&e.jsx("div",{className:"text-xs text-zinc-500",children:s.organizer})]})]})}function gt({open:t,onOpenChange:n,title:s,children:r}){return c.useEffect(()=>{if(!t)return;const o=i=>{i.key==="Escape"&&n(!1)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[t,n]),c.useEffect(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[t]),t?e.jsxs("div",{className:"fixed inset-0 z-50",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>n(!1),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&n(!1)}}),e.jsx("div",{className:"fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto",children:e.jsxs("div",{className:"bg-white dark:bg-zinc-900 rounded-2xl shadow-xl overflow-hidden",children:[s&&e.jsx("div",{className:"sr-only",children:s}),r]})})]}):null}function pt({open:t,onOpenChange:n,title:s,description:r,cancelLabel:o,confirmLabel:i,onConfirm:g,isLoading:x}){return t?e.jsxs("div",{className:"fixed inset-0 z-[60]",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>n(!1),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&n(!1)}}),e.jsx("div",{className:"fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto",children:e.jsxs("div",{className:"bg-white dark:bg-zinc-900 rounded-lg shadow-xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-zinc-900 dark:text-zinc-100",children:s}),e.jsx("p",{className:"mt-2 text-sm text-zinc-600 dark:text-zinc-400",children:r}),e.jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[e.jsx(j.Button,{variant:"outline",size:"sm",onClick:()=>n(!1),children:o}),e.jsxs(j.Button,{variant:"destructive",size:"sm",onClick:g,disabled:x,children:[x&&e.jsx(pe,{className:"h-4 w-4 mr-2"}),e.jsx(Je,{className:"h-4 w-4 mr-2"}),i]})]})]})})]}):null}function vt(t,n){return t.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"})}function jt(t,n){const s={hour:"2-digit",minute:"2-digit",hour12:!1};return`${t.toLocaleTimeString(void 0,s)} – ${n.toLocaleTimeString(void 0,s)}`}function wt(t){return t.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}function bt(t){const[n,s]=c.useState(()=>typeof window<"u"?window.matchMedia(t).matches:!1);return c.useEffect(()=>{if(typeof window>"u")return;const r=window.matchMedia(t),o=i=>s(i.matches);return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[t]),n}function We({event:t,labels:n,isLoading:s,onClose:r,onEdit:o,onDelete:i,onCancel:g,onAccept:x,onDecline:l,onConfirmMeeting:v,canEdit:I=!0,canDelete:b=!1,canCancel:w=!0,isCurrentUserParticipant:F=!1,isCurrentUserClient:S=!1,currentUserAcceptStatus:O,isAcceptLoading:_=!1,isDeclineLoading:B=!1,isConfirmLoading:H=!1,isDeleteLoading:E=!1,renderParticipant:W,renderHeaderActions:z,renderCancelReason:Q,renderDeleteConfirmation:M,formatDate:R=vt,formatTimeRange:P=jt}){const[Y,K]=c.useState(!1),q=!(t.isCanceled||t.meetingTookPlace),f=t.isRecurring??!1,D=t.participantDetails,u=t.participantsNames||[],N=D&&D.length>0,y=O===!0,V=O===!1,$=F&&!S&&q,G=N?D.filter(X=>X.isConfirmed).length:t.isAccepted?u.length:0,U=N?D.length:u.length,oe=t.scheduleTypeColor||t.hexColor||"#039BE5",ee=c.useCallback(()=>t.startDate?R(t.startDate):n.noDateProvided,[t.startDate,R,n.noDateProvided]),ce=c.useCallback(()=>t.startDate&&t.endDate?P(t.startDate,t.endDate):null,[t.startDate,t.endDate,P]),me=()=>{r(),o?.(t)},ne=()=>{r(),g?.(t)},ie=()=>{K(!0)},de=()=>{i?.(t),K(!1)};return s?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(pe,{className:"h-6 w-6 text-zinc-400"})}):e.jsxs(j.TooltipProvider,{delayDuration:300,children:[e.jsxs("div",{className:"flex flex-col gap-0.5 p-3",children:[e.jsx("div",{className:"flex items-start justify-end gap-0.5",children:z?z({onClose:r}):e.jsxs(e.Fragment,{children:[q&&I&&o&&e.jsx(ye,{onClick:me,label:n.edit,children:e.jsx(at,{className:"h-[18px] w-[18px]"})}),q&&w&&g&&e.jsx(ye,{onClick:ne,label:n.cancel,children:e.jsx(it,{className:"h-[18px] w-[18px]"})}),b&&i&&e.jsx(ye,{onClick:ie,label:n.delete,variant:"destructive",children:e.jsx(Je,{className:"h-[18px] w-[18px]"})}),e.jsx(ye,{onClick:r,label:n.close,children:e.jsx(Te,{className:"h-[18px] w-[18px]"})})]})}),e.jsx("div",{children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded mt-1 shrink-0",style:{backgroundColor:oe}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h2",{className:m.cn("text-[22px] font-normal text-zinc-900 dark:text-zinc-100 leading-tight",t.isCanceled&&"line-through opacity-60"),children:t.title}),t.meetingTookPlace&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 text-xs font-medium",children:[e.jsx(lt,{className:"h-3 w-3"}),n.completed]}),t.isCanceled&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400 text-xs font-medium",children:[e.jsx(Te,{className:"h-3 w-3"}),n.canceled]})]}),e.jsxs("div",{className:"mt-1 text-sm text-zinc-600 dark:text-zinc-400",children:[e.jsx("span",{children:ee()}),ce()&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-1.5",children:"·"}),e.jsx("span",{children:ce()})]})]}),f&&t.recurrenceSummary&&e.jsx("div",{className:"text-sm text-zinc-500 dark:text-zinc-500",children:t.recurrenceSummary})]})]})}),t.isCanceled&&e.jsx("div",{className:"mx-4 p-3 rounded-lg bg-red-50 dark:bg-red-950/30",children:Q?Q(t):e.jsx("div",{className:"flex items-start gap-0",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-red-700 dark:text-red-400",children:n.cancellationNote}),t.cancelReason&&e.jsxs("div",{className:"mt-1 text-sm text-red-600/80 dark:text-red-400/80 italic",children:['"',t.cancelReason,'"']}),t.canceledDate&&e.jsxs("div",{className:"mt-1.5 text-xs text-red-500/70 dark:text-red-400/60",children:[n.canceledOn," ",wt(t.canceledDate)]})]})})}),e.jsxs("div",{className:"space-y-0.5",children:[t.address&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ut,{className:"h-5 w-5 text-zinc-400 mt-0.5 shrink-0"}),e.jsx("span",{className:"text-sm text-zinc-700 dark:text-zinc-300",children:t.address})]}),(N||u.length>0)&&e.jsxs("div",{className:"flex items-start gap-2 py-0",children:[e.jsx(dt,{className:"h-5 w-5 text-zinc-400 mt-0.5 shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-0",children:[e.jsxs("span",{className:"text-sm text-zinc-900 dark:text-zinc-100 font-medium",children:[U," ",U!==1?n.guests:n.guest]}),U>0&&e.jsxs("span",{className:"text-xs text-zinc-500",children:["(",G," ",n.confirmed,")"]})]}),e.jsxs("div",{className:"mt-2 space-y-2",children:[N?D.slice(0,6).map((X,h)=>W?W(X,h):e.jsx(Fe,{participant:X,isEventCanceled:t.isCanceled,labels:n},X.id)):u.slice(0,6).map((X,h)=>{const A={id:String(h),name:X,email:"",isConfirmed:t.isAccepted,isOrganizer:h===0,isClient:!1};return W?W(A,h):e.jsx(Fe,{participant:A,isEventCanceled:t.isCanceled,labels:n},X)}),U>6&&e.jsxs("div",{className:"text-xs text-zinc-500 py-1.5 pl-10",children:["+",U-6," ",n.more]})]})]})]}),t.description&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ht,{className:"h-5 w-5 text-zinc-400 mt-0.5 shrink-0"}),e.jsx("p",{className:"text-sm text-zinc-700 dark:text-zinc-300 whitespace-pre-wrap",children:t.description})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(xt,{className:"h-5 w-5 text-zinc-400 mt-0.5 shrink-0"}),e.jsx("div",{className:"text-sm text-zinc-700 dark:text-zinc-300",children:N&&D.find(X=>X.isOrganizer)?.name||u[0]||"Calendar"})]})]}),$&&x&&l&&e.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-800 mt-3 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[f?e.jsxs(j.DropdownMenu,{children:[e.jsx(j.DropdownMenuTrigger,{asChild:!0,children:e.jsxs("div",{className:"flex",children:[e.jsx(j.Button,{size:"sm",variant:"outline",className:m.cn("rounded-r-none gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",y&&"!bg-green-700 !text-white hover:!bg-green-700"),onClick:X=>{X.stopPropagation(),y||x(t)},disabled:_,children:_?e.jsx(pe,{className:"h-3.5 w-3.5"}):e.jsxs(e.Fragment,{children:[y&&e.jsx(be,{className:"h-3.5 w-3.5"}),n.going]})}),e.jsx(j.Button,{size:"sm",variant:"outline",className:m.cn("rounded-l-none px-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",y&&"!bg-green-700 !text-white hover:!bg-green-700"),children:e.jsx(ct,{className:"h-3.5 w-3.5"})})]})}),e.jsxs(j.DropdownMenuContent,{align:"start",children:[e.jsxs(j.DropdownMenuItem,{className:m.cn("gap-1.5 h-8 !border-none !bg-green-50 text-green-800 hover:!bg-green-100",y&&"!bg-green-700 !text-white hover:!bg-green-700"),onClick:()=>x(t),children:[e.jsx(be,{className:"h-3.5 w-3.5 mr-2 text-green-600"}),n.acceptThisEvent]}),e.jsxs(j.DropdownMenuItem,{onClick:()=>x(t),children:[e.jsx(be,{className:"h-3.5 w-3.5 mr-2 text-green-600"}),n.acceptAllEvents]})]})]}):e.jsx(j.Button,{size:"sm",variant:"outline",className:m.cn("gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",y&&"!bg-green-700 !text-white hover:!bg-green-700"),onClick:()=>{y||x(t)},disabled:_,children:_?e.jsx(pe,{className:"h-3.5 w-3.5"}):e.jsxs(e.Fragment,{children:[y&&e.jsx(be,{className:"h-3.5 w-3.5"}),n.going]})}),e.jsx(j.Button,{size:"sm",variant:"outline",className:m.cn("gap-1.5 h-8 !border-none !bg-rose-100 text-rose-800 hover:!bg-rose-200",V&&"!bg-rose-700 !text-white hover:!bg-rose-700"),onClick:()=>{V||l(t)},disabled:B,children:B?e.jsx(pe,{className:"h-3.5 w-3.5"}):e.jsxs(e.Fragment,{children:[V&&e.jsx(Te,{className:"h-3.5 w-3.5"}),n.notGoing]})})]})}),F&&y&&!t.meetingTookPlace&&!t.isCanceled&&v&&e.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-800 py-3",children:e.jsxs(j.Button,{size:"sm",variant:"outline",className:"w-full h-9 hover:!bg-green-100 hover:text-green-700 text-green-700 !bg-green-100 !border-none dark:text-green-400 dark:hover:bg-green-950/30",onClick:()=>v(t),disabled:H,children:[H&&e.jsx(pe,{className:"h-4 w-4 mr-2"}),n.confirmMeeting]})})]}),M?Y&&M({onConfirm:de,onCancel:()=>K(!1),isLoading:E}):e.jsx(pt,{open:Y,onOpenChange:K,title:n.deleteConfirmTitle,description:n.deleteConfirmDescription,cancelLabel:n.cancel,confirmLabel:n.delete,onConfirm:de,isLoading:E})]})}function yt({event:t,children:n,open:s,onOpenChange:r,isLoading:o,labels:i,onEdit:g,onDelete:x,onCancel:l,onAccept:v,onDecline:I,onConfirmMeeting:b,canEdit:w=!0,canDelete:F=!1,canCancel:S=!0,isCurrentUserParticipant:O,isCurrentUserClient:_,currentUserAcceptStatus:B,isAcceptLoading:H,isDeclineLoading:E,isConfirmLoading:W,isDeleteLoading:z,renderParticipant:Q,renderHeaderActions:M,renderCancelReason:R,renderDeleteConfirmation:P,formatDate:Y,formatTimeRange:K,className:q,width:f=360}){const D=bt("(min-width: 768px)"),u={...mt,...i},N=c.useCallback(()=>{r?.(!1)},[r]),y={event:t,labels:u,isLoading:o,onClose:N,onEdit:g,onDelete:x,onCancel:l,onAccept:v,onDecline:I,onConfirmMeeting:b,canEdit:w,canDelete:F,canCancel:S,isCurrentUserParticipant:O,isCurrentUserClient:_,currentUserAcceptStatus:B,isAcceptLoading:H,isDeclineLoading:E,isConfirmLoading:W,isDeleteLoading:z,renderParticipant:Q,renderHeaderActions:M,renderCancelReason:R,renderDeleteConfirmation:P,formatDate:Y,formatTimeRange:K};return D?e.jsxs(j.Popover,{open:s??!1,onOpenChange:r??(()=>{}),children:[e.jsx(j.PopoverTrigger,{asChild:!0,children:n}),e.jsx(j.PopoverContent,{className:m.cn("p-0 shadow-lg !rounded-2xl bg-white dark:bg-zinc-900 overflow-hidden border z-50",q),style:{width:f},align:"center",side:"bottom",sideOffset:4,children:e.jsx(We,{...y})})]}):e.jsxs(e.Fragment,{children:[n,e.jsx(gt,{open:s??!1,onOpenChange:r??(()=>{}),title:t.title,children:e.jsx(We,{...y})})]})}const Se=44,Re=4,kt=56,Oe=8,Ce=80,we=140,_e=100,$e=2,Nt=8,Ct=18;function Dt(t){return t.split(" ").map(n=>n[0]).join("").toUpperCase().slice(0,2)}function Mt(t,n){const s=[];for(let r=0;r<n;r++){const o=new Date(t);o.setDate(o.getDate()+r),s.push(o)}return s}function Tt(t,n,s){const r=[];return t.forEach((o,i)=>{for(let g=n;g<s;g++)r.push({hour:g,dayIndex:i,date:o})}),r}function Le(t){return`${t.toString().padStart(2,"0")}:00`}function Et(t){return t.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}function Be(t){const n=[...t].sort((o,i)=>o.startCol!==i.startCol?o.startCol-i.startCol:i.spanCols-o.spanCols),s=[],r=[];for(const o of n){let i=0;for(;r[i]!==void 0&&r[i]>o.startCol;)i++;r[i]=o.startCol+o.spanCols,s.push({...o,stackIndex:i})}return s}function St({src:t,alt:n,fallback:s,className:r}){return e.jsx("div",{className:m.cn("relative flex shrink-0 overflow-hidden rounded-sm border bg-muted",r),children:t?e.jsx("img",{src:t,alt:n,className:"aspect-square h-full w-full object-cover"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-muted text-muted-foreground",children:s})})}const Lt=18,Ht=10,It=32;function zt({text:t,className:n}){const s=c.useRef(null),r=c.useRef(null),[o,i]=c.useState({active:!1,durationSec:0});return c.useLayoutEffect(()=>{const g=s.current,x=r.current;if(!g||!x)return;const l=()=>{const I=x.offsetWidth,b=g.clientWidth;if(I>b+1){const w=I+It,F=Math.max(Ht,w/Lt);i(S=>S.active&&Math.abs(S.durationSec-F)<.1?S:{active:!0,durationSec:F})}else i(w=>w.active?{active:!1,durationSec:0}:w)};l();const v=new ResizeObserver(l);return v.observe(g),v.observe(x),()=>v.disconnect()},[t]),e.jsx("div",{ref:s,className:m.cn("ic-marquee relative min-w-0 overflow-hidden",o.active&&"ic-marquee--active",n),children:e.jsxs("div",{className:"ic-marquee-track inline-flex whitespace-nowrap will-change-transform",style:o.active?{animationDuration:`${o.durationSec}s`}:void 0,children:[e.jsx("span",{ref:r,className:"ic-marquee-copy",children:t}),o.active&&e.jsx("span",{"aria-hidden":"true",className:"ic-marquee-copy",children:t})]})})}const Pt=7;function ve({daysToShow:t=Pt,events:n,users:s=[],alwaysShowResources:r,selectedDate:o,onDateChange:i,onEventClick:g,onSlotClick:x,onSlotSelect:l,visibleHours:v,className:I,getEventUserId:b,renderPopover:w,slots:F,classNames:S,enableDrag:O=!0,resourceColumnConfig:_}){const B=_?.variant??"marquee",H=_?.showAvatar??"auto",E=c.useRef(null),W=ke.useOptionalDragDrop(),[z,Q]=c.useState(null),M=c.useRef(!1),[R,P]=c.useState(null),Y=o??new Date,K=!0,q=v?.from??Nt,f=v?.to??Ct,D=f-q,u=c.useMemo(()=>{const a=new Date(Y);if(t===1||t===3)return a.setHours(0,0,0,0),a;const d=a.getDay(),p=d===0?-6:1-d;return a.setDate(a.getDate()+p),a.setHours(0,0,0,0),a},[Y,t]),N=c.useMemo(()=>Mt(u,t),[u,t]),y=c.useMemo(()=>Tt(N,q,f),[K,N,q,f]),$=b??(a=>{if(a.resourceId)return a.resourceId;const d=a.data;if(d?.userId)return String(d.userId);if(d?.user&&typeof d.user=="object"&&d.user.id)return String(d.user.id);if(a.user?.id)return a.user.id;if(a.participants?.[0]?.id)return a.participants[0].id}),G=c.useMemo(()=>{const a=new Map;for(const d of s)a.set(d.id,{id:d.id,name:d.name,avatar:d.avatar??void 0,email:d.email});for(const d of n){const k=d.data?.user;k?.id&&!a.has(k.id)&&a.set(k.id,{id:k.id,name:k.name??"",avatar:k.avatar??void 0,email:k.email}),d.user?.id&&!a.has(d.user.id)&&a.set(d.user.id,{id:d.user.id,name:d.user.name,avatar:d.user.avatar??void 0,email:d.user.email});for(const C of d.participants||[])C.id&&!a.has(C.id)&&a.set(C.id,{id:C.id,name:C.name,avatar:C.avatar??void 0,email:C.email})}return Array.from(a.values())},[s,n]),U=c.useMemo(()=>{const a=[],d=new Map;for(const C of G)d.set(C.id,[]);d.set("unassigned",[]);for(const C of n){const T=$(C)??"unassigned";(d.get(T)??d.get("unassigned")).push(C)}const p=C=>{const T=[];for(const L of C){const re=L.startDate.getHours()+L.startDate.getMinutes()/60,se=L.endDate.getHours()+L.endDate.getMinutes()/60;for(let Z=0;Z<N.length;Z++){const ae=N[Z],fe=J.startOfDay(ae),ge=J.endOfDay(ae);if(L.startDate<=ge&&L.endDate>=fe){let he=q,je=f;if(L.startDate>=fe&&(he=Math.max(q,re)),L.endDate<=ge&&(je=Math.min(f,se)),he=Math.max(q,Math.min(f,he)),je=Math.max(q,Math.min(f,je)),je>he){const nt=Z*D+(he-q),rt=je-he;T.push({event:L,startCol:nt,spanCols:rt})}}}}return T};for(const C of G){const T=d.get(C.id)??[],L=p(T),re=Be(L),se=re.reduce((Z,ae)=>Math.max(Z,ae.stackIndex+1),0);a.push({user:C,events:re,maxStack:Math.max(se,1)})}const k=d.get("unassigned")??[];if(k.length>0){const C=p(k),T=Be(C),L=T.reduce((re,se)=>Math.max(re,se.stackIndex+1),0);a.push({user:{id:"unassigned",name:"Unassigned",avatar:void 0,email:void 0},events:T,maxStack:Math.max(L,1)})}if(r?.length){const C=new Set(a.map(T=>T.user.id));for(const T of r)C.has(T.id)||(a.push({user:{id:T.id,name:T.name,avatar:T.avatar??void 0,email:T.email},events:[],maxStack:1}),C.add(T.id))}return a},[G,n,N,K,D,q,f,$,r]),oe=c.useMemo(()=>{const a=new Map;for(const d of U)for(const p of d.events)if(p.spanCols<=1){const k=Math.floor(p.startCol),C=a.get(k)??0;a.set(k,C+1)}return a},[U]),ee=c.useMemo(()=>{const a=y.length,d=Ce,p=[];for(let k=0;k<a;k++){const C=oe.get(k)??0;C>$e?p.push(_e+(C-$e)*20):C>0?p.push(Math.max(d,_e)):p.push(d)}return p},[K,y.length,N.length,oe]),ce=a=>Math.max(kt,a*(Se+Re)+Oe*2),me=we+ee.reduce((a,d)=>a+d,0),ne=c.useMemo(()=>{const a=[0];for(let d=0;d<ee.length;d++)a.push(a[d]+ee[d]);return a},[ee]),ie=c.useCallback(a=>{const d=ne.length-1;if(a<=0)return ne[0]??0;if(a>=d)return ne[d]??0;const p=Math.floor(a),k=ne[p]??0,C=ne[p+1]??k;return k+(a-p)*(C-k)},[ne]);c.useLayoutEffect(()=>{const a=E.current;if(!a)return;const d=()=>{let p=-1;const C=new Date().getHours();{for(let T=0;T<y.length;T++){const L=y[T];if(L&&J.isToday(L.date)&&L.hour<=C&&L.hour+1>C){p=T;break}}if(p===-1)for(let T=0;T<y.length;T++){const L=y[T];if(L&&J.isToday(L.date)){p=T;break}}}if(p!==-1){const T=(ne[p]??0)+we,L=a.clientWidth,re=Math.max(0,T-L/3);a.scrollTo({left:re,behavior:"instant"})}};requestAnimationFrame(()=>{requestAnimationFrame(d)})},[Y,y,N,ne,K]);const de=c.useCallback((a,d)=>{const p=d.getBoundingClientRect(),k=a-p.left+d.scrollLeft;for(let C=0;C<ne.length-1;C++){const T=ne[C],L=ne[C+1];if(k>=T&&k<L){const re=(k-T)/(L-T),se=Math.floor(re*60),Z=Math.round(se/15)*15;return{colIndex:C,minute:Math.min(Z,45)}}}return null},[ne]),X=c.useCallback((a,d)=>{if(y[a]){const p=y[a],k=new Date(p.date);return k.setHours(p.hour,d??0,0,0),{date:k,hour:p.hour}}return{date:new Date}},[K,y,N]),h=c.useCallback((a,d)=>{if(a.preventDefault(),a.dataTransfer.dropEffect="move",!W?.isDragging||!W.dragState)return;const p=a.currentTarget,k=de(a.clientX,p);if(!k)return;const{colIndex:C,minute:T}=k,{date:L,hour:re}=X(C,T);W.updateDragPreview(L,re,T,d);const{originalStartDate:se,originalEndDate:Z}=W.dragState,ae=Z.getTime()-se.getTime(),fe=y.length;let ge;{const he=ae/36e5;ge=Math.max(1,Math.ceil(he))}ge=Math.min(ge,fe-C),P({resourceId:d,colIndex:C,spanCols:ge})},[W,de,X,K,y.length,N.length]),A=c.useCallback(a=>{const d=a.relatedTarget;a.currentTarget.contains(d)||P(null)},[]),te=c.useCallback((a,d)=>{a.preventDefault(),P(null),W?.isDragging&&W.endDrag()},[W]),le=c.useCallback((a,d)=>{if(!z||z.resourceId!==a)return!1;const p=Math.min(z.startCol,z.endCol),k=Math.max(z.startCol,z.endCol);return d>=p&&d<=k},[z]),Ne=c.useCallback((a,d)=>!R||R.resourceId!==a?!1:d>=R.colIndex&&d<R.colIndex+R.spanCols,[R]),et=c.useCallback((a,d,p)=>{p.button!==0&&p.pointerType==="mouse"||(l||x)&&(p.preventDefault(),M.current=!0,Q({resourceId:a,startCol:d,endCol:d,isSelecting:!0}))},[l,x]),tt=c.useCallback((a,d,p)=>{if(M.current&&!(!z||z.resourceId!==a)){if(p.buttons===0){M.current=!1;return}Q(k=>k?{...k,endCol:d}:null)}},[z]),Ee=c.useCallback(()=>{if(!M.current||!z)return;M.current=!1;const a=Math.min(z.startCol,z.endCol),d=Math.max(z.startCol,z.endCol),p=X(a),k=X(d),C=new Date(p.date),T=new Date(k.date);k.hour!==void 0&&T.setHours(k.hour+1,0,0,0);const L={startDate:C,endDate:T,resourceId:z.resourceId};a===d&&x&&x(p.date,p.hour,z.resourceId),l?.(L),Q(re=>re?{...re,isSelecting:!1}:null),setTimeout(()=>Q(null),150)},[z,X,K,x,l]);return c.useEffect(()=>{const a=()=>{M.current&&Ee()};return window.addEventListener("pointerup",a),window.addEventListener("pointercancel",a),()=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a)}},[Ee]),c.useEffect(()=>{W?.isDragging||P(null)},[W?.isDragging]),e.jsx("div",{className:m.cn("flex h-full flex-col",I),children:e.jsx("div",{className:"ic-timeline-scroll-container flex-1",ref:E,children:e.jsxs("div",{className:"relative",style:{minWidth:me},children:[e.jsx("div",{className:"ic-timeline-header sticky top-0 z-20 border-b bg-background",children:t>1?e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"flex shrink-0 items-center justify-center border-r bg-background px-2 sticky left-0 z-10",style:{width:we},children:e.jsx("span",{className:"text-[10px] font-medium uppercase text-muted-foreground",children:"Resources"})}),e.jsxs("div",{className:"flex min-w-0 flex-col",children:[e.jsx("div",{className:"flex border-b",children:N.map((a,d)=>{const p=J.isToday(a),k=d*D,C=ee.slice(k,k+D).reduce((T,L)=>T+L,0);return e.jsx("div",{className:m.cn("flex shrink-0 items-center justify-center border-r py-1.5 font-medium",p?"bg-primary/10 text-primary":"bg-muted/30"),style:{width:C},children:e.jsx("span",{className:"text-xs",children:Et(a)})},`day-${a.toISOString()}`)})}),e.jsx("div",{className:"flex",children:y.map((a,d)=>{const p=a.hour===q,k=J.isToday(a.date),C=ee[d]??Ce;return e.jsx("div",{className:m.cn("flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",p&&d>0?"border-l-2 border-l-border":"border-r border-r-border/50",k&&"bg-primary/5"),style:{width:C},children:Le(a.hour)},`hour-${a.dayIndex}-${a.hour}`)})})]})]}):e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"flex shrink-0 items-center border-r bg-background px-2 py-2",style:{width:we},children:e.jsx("span",{className:"text-[10px] font-medium uppercase text-muted-foreground",children:"Resources"})}),y.map((a,d)=>{const p=a.hour===q,k=J.isToday(a.date),C=ee[d]??Ce;return e.jsx("div",{className:m.cn("flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",p&&d>0?"border-l-2 border-l-border":"border-r border-r-border/50",k&&"bg-primary/5"),style:{width:C},children:Le(a.hour)},`hour-${a.dayIndex}-${a.hour}`)})]})}),U.map(a=>{const d=ce(a.maxStack);return e.jsxs("div",{className:m.cn("relative flex border-b",S?.resourceRow),style:{height:d},children:[e.jsx("div",{className:"sticky left-0 z-10",style:{width:we},children:e.jsxs("div",{className:m.cn("flex h-full items-center gap-2 sm:gap-3 border-r bg-background px-2 sm:px-4",S?.resourceHeader),children:[(()=>{const p=!!a.user.avatar;return H===!0||H==="auto"&&p?e.jsx(St,{className:"size-7",src:a.user.avatar,alt:a.user.name,fallback:Dt(a.user.name)}):null})(),B==="marquee"?e.jsx(zt,{text:a.user.name,className:"flex-1 text-xs sm:text-sm font-medium"}):e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs sm:text-sm font-medium",children:a.user.name})]})}),e.jsxs("div",{className:"ic-timeline-grid relative flex",onDragOver:p=>h(p,a.user.id),onDragLeave:A,onDrop:p=>te(p,a.user.id),children:[y.map((p,k)=>{const C=p.hour===q&&k>0,T=ee[k]??Ce,L=le(a.user.id,k),re=Ne(a.user.id,k),se=!!(l||x);return e.jsx("div",{role:se?"button":void 0,tabIndex:se?0:void 0,"aria-label":se?`Select ${Le(p.hour)} on ${p.date.toLocaleDateString()} for ${a.user.name}`:void 0,onPointerDown:Z=>et(a.user.id,k,Z),onPointerEnter:Z=>tt(a.user.id,k,Z),onPointerUp:Ee,onKeyDown:Z=>{if(se&&(Z.key==="Enter"||Z.key===" ")){Z.preventDefault();const ae=X(k);x?.(ae.date,ae.hour,a.user.id),l?.({startDate:ae.date,endDate:(()=>{const fe=new Date(ae.date);return ae.hour!==void 0&&fe.setHours(ae.hour+1,0,0,0),fe})(),resourceId:a.user.id})}},className:m.cn("shrink-0 select-none touch-none transition-colors",se&&"cursor-pointer",C?"border-l-2 border-l-border":"border-r border-r-border/50",J.isToday(p.date)&&"bg-primary/5",se&&!z?.isSelecting&&!W?.isDragging&&"hover:bg-blue-50/60",L&&"bg-blue-100/70",re&&"bg-primary/20 ring-2 ring-primary ring-inset"),style:{width:T}},`cell-${p.dayIndex}-${p.hour}`)}),a.events.map(p=>{const k=ie(p.startCol),C=ie(p.startCol+p.spanCols),T=k+2,L=C-k-4,re=Oe+p.stackIndex*(Se+Re),se=t===1?"timeline-day":t===3?"timeline-3day":"timeline-week",Z=F?.eventCard;return e.jsx("div",{className:"absolute",style:{left:T,width:Math.max(L,0),top:re,height:Se},children:Z?e.jsx(Z,{event:p.event,view:se,isCompact:!0,onClick:()=>g?.(p.event)}):e.jsx(j.EventCard,{event:p.event,variant:"compact",enableDrag:O,onClick:g,renderPopover:w,className:m.cn("h-full w-full",S?.eventCardCompact)})},p.event.id)})]})]},a.user.id)}),U.length===0&&e.jsx("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:"No users or events to display"})]})})})}const At=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Ft=["January","February","March","April","May","June","July","August","September","October","November","December"];function Ue(t){const n=t.hexColor;return n?{backgroundColor:n}:{}}function Wt({day:t,date:n,events:s,isCurrentMonth:r,onDayClick:o}){const i=J.isToday(n),g=3,x=s.length;return e.jsxs("button",{type:"button",onClick:()=>o?.(n),className:m.cn("flex h-9 sm:h-11 flex-1 flex-col items-center justify-start gap-0.5 rounded-md pt-0.5 sm:pt-1","hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","transition-colors",!r&&"opacity-40"),children:[e.jsx("div",{className:m.cn("flex size-5 sm:size-6 items-center justify-center rounded-full text-[10px] sm:text-xs font-medium",i&&"bg-primary font-semibold text-primary-foreground"),children:t}),x>0&&e.jsx("div",{className:"mt-0.5 flex items-center gap-0.5",children:x<=g?s.map(l=>e.jsx("div",{className:"size-1 sm:size-1.5 rounded-full bg-primary",style:Ue(l)},l.id)):e.jsxs(e.Fragment,{children:[s.slice(0,g).map(l=>e.jsx("div",{className:"size-1 sm:size-1.5 rounded-full bg-primary",style:Ue(l)},l.id)),e.jsxs("span",{className:"text-[6px] sm:text-[7px] font-medium text-muted-foreground",children:["+",x-g]})]})})]})}function Rt({date:t,events:n,onMonthClick:s,onDayClick:r}){const o=c.useMemo(()=>J.generateMonthGrid(t,0),[t]);return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("button",{type:"button",onClick:()=>s?.(t),className:m.cn("w-full rounded-t-lg border px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm font-semibold","hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","transition-colors"),children:Ft[t.getMonth()]}),e.jsxs("div",{className:"flex-1 space-y-1.5 sm:space-y-2 rounded-b-lg border border-t-0 p-2 sm:p-3",children:[e.jsx("div",{className:"grid grid-cols-7 gap-x-0.5 text-center",children:At.map((i,g)=>e.jsxs("div",{className:"text-[9px] sm:text-xs font-medium text-muted-foreground",children:[e.jsx("span",{className:"sm:hidden",children:i[0]}),e.jsx("span",{className:"hidden sm:inline",children:i})]},g))}),e.jsx("div",{className:"grid grid-cols-7 gap-x-0.5 gap-y-1",children:o.map((i,g)=>{const x=J.getEventsForDay(n,i.date);return e.jsx(Wt,{day:i.date.getDate(),date:i.date,events:x,isCurrentMonth:i.isCurrentMonth,onDayClick:r},`${g+1}-${i.date.toISOString()}`)})})]})]})}function Qe({events:t,year:n,onMonthClick:s,onDayClick:r,className:o,slots:i,classNames:g}){const x=c.useMemo(()=>J.getYearMonths(n),[n]);return e.jsxs("div",{className:m.cn("flex flex-col h-full",o),children:[e.jsx("div",{className:"flex items-center justify-center border-b px-4 py-3",children:e.jsx("h2",{className:"text-lg font-semibold",children:n})}),e.jsx("div",{className:"flex-1 overflow-auto p-4",children:e.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:x.map(l=>e.jsx(Rt,{date:l,events:t,onMonthClick:s,onDayClick:r},l.getMonth()))})})]})}const De=200,Ot=60,_t=300,$t=7,Ve=2,He=40,Bt=18;function Ut(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"m18 15-6-6-6 6"})})}function Vt(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}function qt(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"m15 18-6-6 6-6"})})}function Yt(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"m9 18 6-6-6-6"})})}function Kt({containerRef:t,currentDate:n,className:s}){const[r,o]=c.useState({canUp:!1,canDown:!1,canLeft:!1,canRight:!1}),[i,g]=c.useState({x:0,y:0}),[x,l]=c.useState(!1),v=r.canUp||r.canDown||r.canLeft||r.canRight,I=c.useRef(null),b=c.useRef(null),w=c.useRef(null),F=c.useRef(!1),S=c.useRef({x:0,y:0}),O=c.useRef({x:0,y:0}),_=c.useRef(0),B=c.useRef(null),H=c.useCallback(()=>{const u=t.current;if(!u)return;const N=4;o({canUp:u.scrollTop>N,canDown:u.scrollTop+u.clientHeight<u.scrollHeight-N,canLeft:u.scrollLeft>N,canRight:u.scrollLeft+u.clientWidth<u.scrollWidth-N})},[t]);c.useEffect(()=>{const u=t.current;if(!u)return;H(),u.addEventListener("scroll",H,{passive:!0});const N=new ResizeObserver(H);N.observe(u);const y=new MutationObserver(H);return y.observe(u,{childList:!0,subtree:!0}),()=>{u.removeEventListener("scroll",H),N.disconnect(),y.disconnect()}},[t,H]);const E=c.useCallback((u,N)=>{t.current?.scrollBy({left:u,top:N,behavior:"smooth"})},[t]),W=c.useCallback(()=>E(0,-De),[E]),z=c.useCallback(()=>E(0,De),[E]),Q=c.useCallback(()=>E(-De,0),[E]),M=c.useCallback(()=>E(De,0),[E]),R=c.useCallback(()=>{I.current&&(clearTimeout(I.current),I.current=null),b.current&&(clearInterval(b.current),b.current=null)},[]),P=c.useCallback(u=>{u(),I.current=setTimeout(()=>{b.current=setInterval(u,Ot)},_t)},[]);c.useEffect(()=>R,[R]),c.useEffect(()=>{const u=t.current;if(!u)return;const N=y=>{if(y.ctrlKey||y.metaKey||y.altKey)return;const V=y.target.tagName;if(!(V==="INPUT"||V==="TEXTAREA"||y.target.isContentEditable))switch(y.key){case"ArrowUp":y.preventDefault(),W();break;case"ArrowDown":y.preventDefault(),z();break;case"ArrowLeft":y.preventDefault(),Q();break;case"ArrowRight":y.preventDefault(),M();break}};return u.addEventListener("keydown",N),()=>u.removeEventListener("keydown",N)},[t,W,z,Q,M]),c.useEffect(()=>{if(!v)return;const u=B.current;if(!u)return;let N=0;const y=()=>{const U=u.offsetParent;if(!U)return;const oe=U.getBoundingClientRect(),ee=window.innerHeight;if(oe.height<=ee){u.style.removeProperty("top"),u.style.removeProperty("bottom");return}const me=Math.min(oe.bottom,ee)-oe.top,ne=u.offsetHeight,ie=me-ne-12,de=12,X=U.clientHeight-ne-12,h=Math.max(de,Math.min(ie,X));u.style.top=`${h}px`,u.style.bottom="auto"},V=()=>{cancelAnimationFrame(N),N=requestAnimationFrame(y)},$=[window];let G=u.parentElement;for(;G;){const U=getComputedStyle(G);/(auto|scroll)/.test(U.overflow+U.overflowY)&&$.push(G),G=G.parentElement}for(const U of $)U.addEventListener("scroll",V,{passive:!0});return window.addEventListener("resize",V,{passive:!0}),y(),()=>{cancelAnimationFrame(N);for(const U of $)U.removeEventListener("scroll",V);window.removeEventListener("resize",V)}},[v]);const Y=c.useCallback(()=>{F.current=!1,l(!1),g({x:0,y:0}),O.current={x:0,y:0},_.current&&cancelAnimationFrame(_.current)},[]),K=c.useCallback(u=>{u.preventDefault(),F.current=!0,l(!0),S.current={x:u.clientX,y:u.clientY},O.current={x:0,y:0},u.target.setPointerCapture(u.pointerId);const N=()=>{if(!F.current)return;const y=t.current;if(y){const{x:V,y:$}=O.current,G=Math.sqrt(V*V+$*$);if(G>Ve){const oe=Math.min(G/He,1)*Bt;y.scrollLeft+=V/G*oe,y.scrollTop+=$/G*oe}}_.current=requestAnimationFrame(N)};_.current=requestAnimationFrame(N)},[t]),q=c.useCallback(u=>{if(!F.current)return;const N=u.clientX-S.current.x,y=u.clientY-S.current.y;O.current={x:N,y};const V=Math.sqrt(N*N+y*y);if(V<Ve)g({x:0,y:0});else{const G=Math.min(V,He)/He*$t;g({x:N/V*G,y:y/V*G})}},[]),f=c.useCallback(u=>{switch(u.key){case"ArrowUp":u.preventDefault(),W();break;case"ArrowDown":u.preventDefault(),z();break;case"ArrowLeft":u.preventDefault(),Q();break;case"ArrowRight":u.preventDefault(),M();break}},[W,z,Q,M]);if(!v)return null;const D=n?n.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"}):null;return e.jsxs("div",{ref:B,className:`inno-scroll-nav-wrapper ${s??""}`,role:"toolbar","aria-label":"Scroll navigation",onKeyDown:f,children:[D&&e.jsx("div",{className:"inno-scroll-nav-date","aria-live":"polite",children:D}),e.jsxs("div",{className:"inno-scroll-nav",children:[e.jsx("button",{type:"button",className:`inno-scroll-nav-btn inno-scroll-nav-up ${r.canUp?"":"inno-scroll-nav-btn-disabled"}`,"aria-label":"Scroll up",disabled:!r.canUp,onPointerDown:()=>P(W),onPointerUp:R,onPointerLeave:R,tabIndex:r.canUp?0:-1,children:e.jsx(Ut,{})}),e.jsx("button",{type:"button",className:`inno-scroll-nav-btn inno-scroll-nav-left ${r.canLeft?"":"inno-scroll-nav-btn-disabled"}`,"aria-label":"Scroll left",disabled:!r.canLeft,onPointerDown:()=>P(Q),onPointerUp:R,onPointerLeave:R,tabIndex:r.canLeft?0:-1,children:e.jsx(qt,{})}),e.jsx("button",{ref:w,type:"button",className:`inno-scroll-nav-joystick ${x?"inno-scroll-nav-joystick-active":""}`,"aria-label":"Drag to scroll freely",onPointerDown:K,onPointerMove:q,onPointerUp:Y,onPointerCancel:Y,tabIndex:0,children:e.jsx("span",{className:"inno-scroll-nav-joystick-dot",style:{transform:`translate(${i.x}px, ${i.y}px)`}})}),e.jsx("button",{type:"button",className:`inno-scroll-nav-btn inno-scroll-nav-right ${r.canRight?"":"inno-scroll-nav-btn-disabled"}`,"aria-label":"Scroll right",disabled:!r.canRight,onPointerDown:()=>P(M),onPointerUp:R,onPointerLeave:R,tabIndex:r.canRight?0:-1,children:e.jsx(Yt,{})}),e.jsx("button",{type:"button",className:`inno-scroll-nav-btn inno-scroll-nav-down ${r.canDown?"":"inno-scroll-nav-btn-disabled"}`,"aria-label":"Scroll down",disabled:!r.canDown,onPointerDown:()=>P(z),onPointerUp:R,onPointerLeave:R,tabIndex:r.canDown?0:-1,children:e.jsx(Vt,{})})]})]})}function Gt(t){switch(t){case"day":case"week":return"time";default:return"day"}}function Xt({onEventClick:t,onSlotClick:n,onSlotSelect:s,onAddEvent:r,alwaysShowResources:o,className:i,showHeader:g=!0,minSelectionMinutes:x=30,showMoreMode:l,showMoreEventsInPopover:v=!1,isLoading:I=!1,slots:b,classNames:w,settingsContent:F,filterContent:S,headerActions:O,renderPopover:_,calendarRef:B,headerConfig:H,resourceColumnConfig:E,eventDetailMode:W,renderEventDetail:z}){const Q=l??(v?"popover":"expand"),{view:M,setView:R,selectedDate:P,setSelectedDate:Y,slotDuration:K,filteredEvents:q,users:f,visibleHours:D,workingHours:u,badgeVariant:N,showWorkingHoursOnly:y,clearFocusEventId:V}=ke.useInnoCalendar(),$=c.useMemo(()=>{if(!y||!u)return{startHour:D.start,endHour:D.end};let h=24,A=0;for(const te of Object.keys(u)){const le=u[Number(te)];!le||le.enabled===!1||(le.from<h&&(h=le.from),le.to>A&&(A=le.to))}return h>=A?{startHour:D.start,endHour:D.end}:{startHour:h,endHour:A}},[y,u,D]),G=$,U=c.useRef(null);c.useImperativeHandle(B,()=>({scrollToToday:()=>{const h=new Date;Y(h,M),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const A=U.current?.querySelector(".ic-timeline-scroll-container, [class*='overflow-auto']");if(!A)return;const Ne=(h.getHours()-$.startHour)*96;Ne>0&&A.scrollTo({top:Math.max(0,Ne-100),behavior:"smooth"})})})},scrollToWorkingHours:()=>{let h=8;if(u)for(const A of Object.keys(u)){const te=u[Number(A)];te?.enabled&&te.from<h&&(h=Math.max(te.from-1,0))}requestAnimationFrame(()=>{requestAnimationFrame(()=>{const A=U.current?.querySelector(".ic-timeline-scroll-container, [class*='overflow-auto']");if(!A)return;const le=(h-$.startHour)*96;A.scrollTo({top:Math.max(0,le),behavior:"smooth"})})})},getViewRect:()=>U.current?.getBoundingClientRect()??null,focusEvent:h=>{V(),requestAnimationFrame(()=>{V()});const A=U.current?.querySelector(`[data-event-id="${h}"]`);A&&setTimeout(()=>A.click(),150)}}),[Y,M,$,u,V]);const oe=c.useMemo(()=>Gt(M),[M]),ee=c.useCallback(h=>{if(s){s(h);return}if(n){const A=h.startDate.getHours();n(h.startDate,A)}},[s,n]),ce=c.useCallback(h=>{R("day"),Y(h,"day")},[Y,R]),me=c.useCallback(h=>{R("month"),Y(h,"month")},[Y,R]),ne=c.useCallback(h=>{t?.(h)},[t]),ie=c.useCallback((h,A,te)=>{n?.(h,A)},[n]),de=()=>{const h=q,A=ne,te=_;switch(M){case"day":return e.jsx(j.DayView,{events:h,date:P,visibleHours:G,workingHours:u,slotDuration:K,badgeVariant:N,onEventClick:A,renderPopover:te,...b&&{slots:b},...w&&{classNames:w}});case"week":return e.jsx(j.WeekView,{events:h,date:P,visibleHours:G,workingHours:u,slotDuration:K,badgeVariant:N,onEventClick:A,renderPopover:te,...b&&{slots:b},...w&&{classNames:w}});case"month":return e.jsx(j.MonthView,{events:h,date:P,badgeVariant:N,onEventClick:A,onDayClick:ce,renderPopover:te,showMoreMode:Q,...b&&{slots:b},...w&&{classNames:w}});case"year":return e.jsx(Qe,{events:h,year:P.getFullYear(),onMonthClick:me,onDayClick:ce,...b&&{slots:b},...w&&{classNames:w}});case"agenda":return e.jsx(j.AgendaView,{events:h,date:P,onEventClick:A,renderPopover:te,...b&&{slots:b},...w&&{classNames:w}});case"resource-day":return e.jsx(ve,{daysToShow:1,events:h,users:f,...o&&{alwaysShowResources:o},selectedDate:P,visibleHours:{from:$.startHour,to:$.endHour},onEventClick:A,onSlotSelect:ee,onSlotClick:ie,renderPopover:te,...b&&{slots:b},...w&&{classNames:w},...E&&{resourceColumnConfig:E}});case"resource-week":return e.jsx(ve,{daysToShow:7,events:h,users:f,...o&&{alwaysShowResources:o},selectedDate:P,visibleHours:{from:$.startHour,to:$.endHour},onEventClick:A,onSlotSelect:ee,onSlotClick:ie,renderPopover:te,...b&&{slots:b},...w&&{classNames:w},...E&&{resourceColumnConfig:E}});case"timeline-day":return e.jsx(ve,{daysToShow:1,events:h,users:f,...o&&{alwaysShowResources:o},selectedDate:P,visibleHours:{from:$.startHour,to:$.endHour},onEventClick:A,onSlotSelect:ee,onSlotClick:ie,renderPopover:te,...b&&{slots:b},...w&&{classNames:w},...E&&{resourceColumnConfig:E}});case"timeline-3day":return e.jsx(ve,{daysToShow:3,events:h,users:f,...o&&{alwaysShowResources:o},selectedDate:P,visibleHours:{from:$.startHour,to:$.endHour},onEventClick:A,onSlotSelect:ee,onSlotClick:ie,renderPopover:te,...b&&{slots:b},...w&&{classNames:w},...E&&{resourceColumnConfig:E}});case"timeline-week":return e.jsx(ve,{daysToShow:7,events:h,users:f,...o&&{alwaysShowResources:o},selectedDate:P,visibleHours:{from:$.startHour,to:$.endHour},onEventClick:A,onSlotSelect:ee,onSlotClick:ie,renderPopover:te,...b&&{slots:b},...w&&{classNames:w},...E&&{resourceColumnConfig:E}});default:return e.jsx(j.MonthView,{events:h,date:P,badgeVariant:N,onEventClick:A,onDayClick:ce,...b&&{slots:b},...w&&{classNames:w}})}},X=c.useRef(null);return c.useEffect(()=>{U.current=X.current}),e.jsx(ke.SlotSelectionProvider,{mode:oe,onSelect:ee,minDurationMinutes:x,slotDurationMinutes:K,enabled:!!(s||n),children:e.jsxs("div",{className:m.cn("inno-calendar-root flex flex-col h-full p-4",w?.root,i),children:[g&&e.jsx(j.CalendarHeader,{currentDate:P,view:M,events:q,onViewChange:R,onNavigateToday:()=>Y(new Date,M),onNavigatePrev:()=>{const h=new Date(P);M==="day"||M==="timeline-day"||M==="resource-day"?h.setDate(h.getDate()-1):M==="timeline-3day"?h.setDate(h.getDate()-3):M==="week"||M==="timeline-week"||M==="resource-week"?h.setDate(h.getDate()-7):M==="month"?h.setMonth(h.getMonth()-1):M==="year"?h.setFullYear(h.getFullYear()-1):h.setDate(h.getDate()-7),Y(h,M)},onNavigateNext:()=>{const h=new Date(P);M==="day"||M==="timeline-day"||M==="resource-day"?h.setDate(h.getDate()+1):M==="timeline-3day"?h.setDate(h.getDate()+3):M==="week"||M==="timeline-week"||M==="resource-week"?h.setDate(h.getDate()+7):M==="month"?h.setMonth(h.getMonth()+1):M==="year"?h.setFullYear(h.getFullYear()+1):h.setDate(h.getDate()+7),Y(h,M)},availableViews:["day","week","month","agenda"],showTimelineViews:!0,showSettings:!!F,...!O&&r&&{onAddEvent:r},actions:O,settingsContent:F,filterContent:S,...H&&{headerConfig:H}}),e.jsxs("div",{className:"relative flex-1 min-h-0",children:[e.jsx("div",{ref:X,className:m.cn("h-full border rounded-lg bg-white overflow-x-auto",w?.viewContainer),children:de()}),I&&e.jsx("div",{className:"inno-calendar-loading-overlay",children:e.jsx("div",{className:"inno-calendar-spinner"})}),e.jsx(Kt,{containerRef:X,currentDate:P})]})]})})}function Jt({events:t,users:n=[],alwaysShowResources:s,scheduleTypes:r=[],initialView:o,initialDate:i,initialSelectedUserId:g,initialScheduleTypeIds:x,initialParticipantIds:l,initialWorkingHoursView:v,initialSearchQuery:I,preferencesConfig:b,onEventClick:w,onSlotClick:F,onSlotSelect:S,onAddEvent:O,onEventDrop:_,onDateChange:B,onViewChange:H,className:E,showHeader:W=!0,minSelectionMinutes:z=30,showMoreMode:Q,showMoreEventsInPopover:M=!1,isLoading:R=!1,renderPopover:P,slots:Y,classNames:K,settingsContent:q,filterContent:f,headerActions:D,focusEventId:u,headerConfig:N,resourceColumnConfig:y,viewPersistence:V,eventDetailMode:$,renderEventDetail:G},U){return e.jsx(ke.DragDropProvider,{..._&&{onEventDrop:_},children:e.jsx(ke.InnoCalendarProvider,{initialEvents:t,initialUsers:n,initialScheduleTypes:r,...o&&{initialView:o},...i&&{initialDate:i},...g&&{initialSelectedUserId:g},...x&&{initialScheduleTypeIds:x},...l&&{initialParticipantIds:l},...v&&{initialWorkingHoursView:v},...I&&{initialSearchQuery:I},...b&&{preferencesConfig:b},...B&&{onDateChange:B},...H&&{onViewChange:H},...u&&{initialFocusEventId:u},...V&&{viewPersistence:V},children:e.jsx(Xt,{...w&&{onEventClick:w},...F&&{onSlotClick:F},...S&&{onSlotSelect:S},...O&&{onAddEvent:O},...s&&{alwaysShowResources:s},...P&&{renderPopover:P},className:E,showHeader:W,minSelectionMinutes:z,...Q&&{showMoreMode:Q},showMoreEventsInPopover:M,isLoading:R,...Y&&{slots:Y},...K&&{classNames:K},settingsContent:q,filterContent:f,headerActions:D,calendarRef:U,...N&&{headerConfig:N},...y&&{resourceColumnConfig:y},...$&&{eventDetailMode:$},...G&&{renderEventDetail:G}})})})}const Qt=c.forwardRef(Jt),xe=c.forwardRef(({className:t,children:n,...s},r)=>e.jsx("select",{ref:r,className:m.cn("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm","ring-offset-background","focus:outline-none focus:ring-1 focus:ring-ring","disabled:cursor-not-allowed disabled:opacity-50","[&>option]:bg-background",t),...s,children:n}));xe.displayName="Select";const ue=c.forwardRef(({className:t,...n},s)=>e.jsx("label",{ref:s,className:m.cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t),...n}));ue.displayName="Label";function Zt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 16v-4"}),e.jsx("path",{d:"M12 8h.01"})]})}function en({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}const tn=[{value:15,label:"15 minutes"},{value:30,label:"30 minutes"},{value:60,label:"1 hour"}];function nn({value:t,onChange:n,isLocked:s=!1,className:r,labels:o={}}){const i={title:"Slot duration",lockedMessage:"This setting is locked by the administrator",infoMessage:"Set the time slot duration for day and week calendar views.",...o},g=x=>{s||n(Number(x.target.value))};return e.jsxs("div",{className:m.cn("flex flex-col gap-3",r),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ue,{className:"text-sm font-semibold",children:i.title}),s?e.jsx(j.TooltipProvider,{delayDuration:100,children:e.jsxs(j.Tooltip,{children:[e.jsx(j.TooltipTrigger,{children:e.jsx(en,{className:"size-3 text-muted-foreground"})}),e.jsx(j.TooltipContent,{children:e.jsx("p",{children:i.lockedMessage})})]})}):e.jsx(j.TooltipProvider,{delayDuration:100,children:e.jsxs(j.Tooltip,{children:[e.jsx(j.TooltipTrigger,{children:e.jsx(Zt,{className:"size-3 text-muted-foreground"})}),e.jsx(j.TooltipContent,{className:"max-w-64 text-center",children:e.jsx("p",{children:i.infoMessage})})]})})]}),e.jsx(xe,{value:t.toString(),onChange:g,disabled:s,className:"h-9 w-[128px] text-sm",children:tn.map(x=>e.jsx("option",{value:x.value.toString(),children:x.label},x.value))})]})}function rn({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 16v-4"}),e.jsx("path",{d:"M12 8h.01"})]})}function sn({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}const on=[{value:"dot",label:"Dot indicator"},{value:"colored",label:"Full color"},{value:"mixed",label:"Mixed"}];function an({value:t,onChange:n,isLocked:s=!1,className:r,labels:o={}}){const i={title:"Event display",lockedMessage:"This setting is locked by the administrator",infoMessage:"Choose how events are displayed. Dot shows a small indicator, colored fills the entire event, mixed uses both.",options:{dot:"Dot indicator",colored:"Full color",mixed:"Mixed"},...o},g=l=>i.options?.[l]??l,x=l=>{s||n(l.target.value)};return e.jsxs("div",{className:m.cn("flex flex-col gap-3",r),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ue,{className:"text-sm font-semibold",children:i.title}),s?e.jsx(j.TooltipProvider,{delayDuration:100,children:e.jsxs(j.Tooltip,{children:[e.jsx(j.TooltipTrigger,{children:e.jsx(sn,{className:"size-3 text-muted-foreground"})}),e.jsx(j.TooltipContent,{children:e.jsx("p",{children:i.lockedMessage})})]})}):e.jsx(j.TooltipProvider,{delayDuration:100,children:e.jsxs(j.Tooltip,{children:[e.jsx(j.TooltipTrigger,{children:e.jsx(rn,{className:"size-3 text-muted-foreground"})}),e.jsx(j.TooltipContent,{className:"max-w-64 text-center",children:e.jsx("p",{children:i.infoMessage})})]})})]}),e.jsx(xe,{value:t,onChange:x,disabled:s,className:"h-9 w-[128px] text-sm",children:on.map(l=>e.jsx("option",{value:l.value,children:g(l.value)},l.value))})]})}function ln({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 16v-4"}),e.jsx("path",{d:"M12 8h.01"})]})}function cn({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function dn(){return Array.from({length:25},(t,n)=>({value:n,label:`${String(n).padStart(2,"0")}:00`}))}function un({value:t,onChange:n,isLocked:s=!1,className:r,labels:o={}}){const i={title:"Visible hours",from:"From",to:"To",lockedMessage:"This setting is locked by the administrator",infoMessage:"Set the visible hour range for day and week views. Hours outside this range will be hidden.",...o},g=dn(),x=v=>{if(s)return;const I=Number(v.target.value);I<t.endHour&&n({...t,startHour:I})},l=v=>{if(s)return;const I=Number(v.target.value);I>t.startHour&&n({...t,endHour:I})};return e.jsxs("div",{className:m.cn("flex flex-col gap-3",r),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ue,{className:"text-sm font-semibold",children:i.title}),s?e.jsx(j.TooltipProvider,{delayDuration:100,children:e.jsxs(j.Tooltip,{children:[e.jsx(j.TooltipTrigger,{children:e.jsx(cn,{className:"size-3 text-muted-foreground"})}),e.jsx(j.TooltipContent,{children:e.jsx("p",{children:i.lockedMessage})})]})}):e.jsx(j.TooltipProvider,{delayDuration:100,children:e.jsxs(j.Tooltip,{children:[e.jsx(j.TooltipTrigger,{children:e.jsx(ln,{className:"size-3 text-muted-foreground"})}),e.jsx(j.TooltipContent,{className:"max-w-64 text-center",children:e.jsx("p",{children:i.infoMessage})})]})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(ue,{className:"text-xs text-muted-foreground",children:i.from}),e.jsx(xe,{value:t.startHour.toString(),onChange:x,disabled:s,className:"h-9 w-[88px] text-sm",children:g.map(v=>e.jsx("option",{value:v.value.toString(),disabled:v.value>=t.endHour,children:v.label},v.value))})]}),e.jsx("span",{className:"mt-5 text-muted-foreground",children:"—"}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(ue,{className:"text-xs text-muted-foreground",children:i.to}),e.jsx(xe,{value:t.endHour.toString(),onChange:l,disabled:s,className:"h-9 w-[88px] text-sm",children:g.map(v=>e.jsx("option",{value:v.value.toString(),disabled:v.value<=t.startHour,children:v.label},v.value))})]})]})]})}function xn({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 16v-4"}),e.jsx("path",{d:"M12 8h.01"})]})}function hn({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function mn({className:t}){return e.jsx("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})})}const fn=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function gn(){return Array.from({length:25},(t,n)=>({value:n,label:`${String(n).padStart(2,"0")}:00`}))}const qe={sunday:"Sun",monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat"};function pn({dayLabel:t,config:n,onChange:s,disabled:r,hourOptions:o}){const i=()=>{r||s({...n,enabled:!n.enabled})},g=l=>{if(r)return;const v=Number(l.target.value);v<n.to&&s({...n,from:v})},x=l=>{if(r)return;const v=Number(l.target.value);v>n.from&&s({...n,to:v})};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",role:"checkbox","aria-checked":n.enabled,"aria-label":`Enable ${t}`,onClick:i,disabled:r,className:m.cn("flex size-5 shrink-0 items-center justify-center rounded border transition-colors",n.enabled?"border-primary bg-primary text-primary-foreground":"border-input bg-background",r&&"cursor-not-allowed opacity-50"),children:n.enabled&&e.jsx(mn,{className:"size-3"})}),e.jsx("span",{className:m.cn("w-10 text-sm",!n.enabled&&"text-muted-foreground"),children:t}),e.jsx(xe,{value:n.from.toString(),onChange:g,disabled:r||!n.enabled,className:"h-8 w-[76px] text-xs",children:o.map(l=>e.jsx("option",{value:l.value.toString(),disabled:l.value>=n.to,children:l.label},l.value))}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}),e.jsx(xe,{value:n.to.toString(),onChange:x,disabled:r||!n.enabled,className:"h-8 w-[76px] text-xs",children:o.map(l=>e.jsx("option",{value:l.value.toString(),disabled:l.value<=n.from,children:l.label},l.value))})]})}function vn({value:t,onChange:n,isLocked:s=!1,className:r,labels:o={}}){const i={title:"Working hours",lockedMessage:"This setting is locked by the administrator",infoMessage:"Configure working hours for each day of the week. Non-working hours will be grayed out in day and week views.",days:qe,...o},g=gn(),x=(l,v)=>{s||n({...t,[l]:v})};return e.jsxs("div",{className:m.cn("flex flex-col gap-3",r),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ue,{className:"text-sm font-semibold",children:i.title}),s?e.jsx(j.TooltipProvider,{delayDuration:100,children:e.jsxs(j.Tooltip,{children:[e.jsx(j.TooltipTrigger,{children:e.jsx(hn,{className:"size-3 text-muted-foreground"})}),e.jsx(j.TooltipContent,{children:e.jsx("p",{children:i.lockedMessage})})]})}):e.jsx(j.TooltipProvider,{delayDuration:100,children:e.jsxs(j.Tooltip,{children:[e.jsx(j.TooltipTrigger,{children:e.jsx(xn,{className:"size-3 text-muted-foreground"})}),e.jsx(j.TooltipContent,{className:"max-w-64 text-center",children:e.jsx("p",{children:i.infoMessage})})]})})]}),e.jsx("div",{className:"flex flex-col gap-2",children:fn.map(l=>e.jsx(pn,{dayLabel:i.days?.[l]??qe[l],config:t[l],onChange:v=>x(l,v),disabled:s,hourOptions:g},l))})]})}const jn={sunday:{enabled:!1,from:8,to:18},monday:{enabled:!0,from:8,to:18},tuesday:{enabled:!0,from:8,to:18},wednesday:{enabled:!0,from:8,to:18},thursday:{enabled:!0,from:8,to:18},friday:{enabled:!0,from:8,to:18},saturday:{enabled:!1,from:8,to:18}};function Ie({className:t}){return e.jsx("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}function wn({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function bn({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function ze({checked:t,onCheckedChange:n,className:s,children:r}){return e.jsx("button",{type:"button",role:"checkbox","aria-checked":t,onClick:()=>n(!t),className:s,children:r})}function yn({src:t,alt:n,fallback:s,className:r}){const[o,i]=c.useState(!1);return!t||o?e.jsx("div",{className:m.cn("flex items-center justify-center bg-zinc-200 text-zinc-600 font-medium text-sm",r),children:s||"?"}):e.jsx("img",{src:t,alt:n||"",className:m.cn("object-cover",r),onError:()=>i(!0)})}function Ye({value:t,onChange:n,placeholder:s,className:r}){return e.jsxs("div",{className:m.cn("relative",r),children:[e.jsx(wn,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx("input",{type:"text",value:t,onChange:o=>n(o.target.value),placeholder:s,className:"h-9 w-full rounded-lg border border-border bg-white pl-9 pr-3 text-sm placeholder:text-muted-foreground focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"})]})}function Ke(t,n,s,r=.3){if(!n.trim())return t;const o=n.toLowerCase();return t.filter(i=>s(i).some(x=>x?x.toLowerCase().includes(o):!1))}const kn={title:"Filters",subtitle:"Filter calendar events",scheduleTypes:"Event Types",participants:"Participants",clearAll:"Clear all",selectAll:"Select all",unselectAll:"Unselect all",searchScheduleTypes:"Search event types...",searchParticipants:"Search participants...",noScheduleTypes:"No event types found",noParticipants:"No participants found"};function Nn({scheduleTypes:t,users:n,selectedScheduleTypeIds:s,onScheduleTypeChange:r,selectedUserIds:o,onUserChange:i,onClearAll:g,className:x,scheduleTypesLoading:l=!1,usersLoading:v=!1,labels:I,getScheduleTypeName:b}){const w={...kn,...I},[F,S]=c.useState(""),[O,_]=c.useState(""),B=c.useMemo(()=>F.trim()?Ke(t,F,f=>[f.name,b?.(f)||f.name]):t,[t,F,b]),H=c.useMemo(()=>O.trim()?Ke(n,O,f=>[f.name,f.email||""]):n,[n,O]),E=B.length>0&&B.every(f=>s.includes(f.id)),W=H.length>0&&H.every(f=>o.includes(f.id)),z=s.length+o.length,Q=(f,D)=>{const u=D?[...s,f]:s.filter(N=>N!==f);r(u)},M=()=>{if(E){const f=new Set(B.map(D=>D.id));r(s.filter(D=>!f.has(D)))}else{const f=new Set([...s,...B.map(D=>D.id)]);r(Array.from(f))}},R=(f,D)=>{const u=D?[...o,f]:o.filter(N=>N!==f);i(u)},P=()=>{if(W){const f=new Set(H.map(D=>D.id));i(o.filter(D=>!f.has(D)))}else{const f=new Set([...o,...H.map(D=>D.id)]);i(Array.from(f))}},Y=()=>{r([]),i([]),g?.()},K=f=>b?b(f):f.name,q=f=>f.colorHex||f.color||"#069AD7";return e.jsxs("div",{className:m.cn("flex min-w-72 max-w-72 flex-col rounded-lg border bg-white shadow-sm",x),children:[e.jsxs("header",{className:"flex items-start justify-between gap-2 px-4 pb-2 pt-4",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("h3",{className:"text-base font-semibold text-foreground",children:w.title}),e.jsx("p",{className:"text-xs text-muted-foreground",children:w.subtitle})]}),z>0&&e.jsxs("button",{type:"button",onClick:Y,className:"flex h-auto items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/10",children:[e.jsx(bn,{className:"h-3.5 w-3.5"}),w.clearAll]})]}),e.jsx("div",{className:"h-px w-full bg-border/60"}),e.jsxs("section",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[e.jsx("h4",{className:"text-sm font-medium text-foreground",children:w.scheduleTypes}),e.jsx("button",{type:"button",onClick:M,className:"text-xs font-medium text-primary transition-colors hover:text-primary/80",children:E?w.unselectAll:w.selectAll})]}),t.length>6&&e.jsx("div",{className:"px-4 pb-3",children:e.jsx(Ye,{value:F,onChange:S,placeholder:w.searchScheduleTypes})}),e.jsxs("div",{className:"flex max-h-[220px] flex-col gap-2 overflow-y-auto px-4 pb-2 scrollbar-thin",children:[l?Array.from({length:4}).map((f,D)=>e.jsxs("div",{className:"flex animate-pulse items-center gap-2 rounded-md border border-border/60 bg-muted/40 p-2",children:[e.jsx("div",{className:"h-5 w-5 rounded bg-muted-foreground/20"}),e.jsx("div",{className:"h-3 w-24 rounded bg-muted-foreground/20"})]},`skeleton-${D}`)):B.map(f=>{const D=s.includes(f.id),u=q(f);return e.jsxs(ze,{checked:D,onCheckedChange:N=>Q(f.id,N),className:m.cn("relative flex w-full cursor-pointer items-center justify-between gap-3 rounded-md border border-border bg-white px-3 py-2 transition-colors hover:border-primary/50",D&&"border-primary bg-primary/5"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:m.cn("flex h-4 w-4 items-center justify-center rounded border border-border text-xs transition-colors",D&&"border-primary bg-primary text-primary-foreground"),children:D&&e.jsx(Ie,{className:"h-3 w-3"})}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:K(f)})]}),e.jsx("div",{className:"h-4 w-4 rounded-full border",style:{backgroundColor:u,borderColor:u}})]},f.id)}),!l&&B.length===0&&e.jsx("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:w.noScheduleTypes})]})]}),e.jsx("div",{className:"h-px w-full bg-border/60"}),e.jsxs("section",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[e.jsx("h4",{className:"text-sm font-medium text-foreground",children:w.participants}),e.jsx(ze,{checked:W,onCheckedChange:()=>P(),className:m.cn("flex h-5 w-5 items-center justify-center rounded border border-border bg-white transition-colors hover:border-primary/50",W&&"border-primary bg-primary text-primary-foreground"),children:W&&e.jsx(Ie,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"px-4 pb-3",children:e.jsx(Ye,{value:O,onChange:_,placeholder:w.searchParticipants})}),e.jsxs("div",{className:"flex max-h-[400px] flex-col gap-2 overflow-y-auto px-4 pb-4 scrollbar-thin",children:[v?Array.from({length:4}).map((f,D)=>e.jsxs("div",{className:"flex animate-pulse items-center gap-3 rounded-md border border-border/60 bg-muted/40 p-3",children:[e.jsx("div",{className:"h-5 w-5 rounded bg-muted-foreground/20"}),e.jsx("div",{className:"h-10 w-10 rounded-full bg-muted-foreground/20"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-3 w-24 rounded bg-muted-foreground/20"}),e.jsx("div",{className:"h-2 w-32 rounded bg-muted-foreground/10"})]})]},`p-skeleton-${D}`)):H.map(f=>{const D=o.includes(f.id);return e.jsxs(ze,{checked:D,onCheckedChange:u=>R(f.id,u),className:m.cn("relative flex w-full cursor-pointer items-start gap-2 rounded-lg border border-border bg-white p-2 transition-colors hover:border-primary/50",D&&"border-primary bg-zinc-50"),children:[e.jsx("span",{className:m.cn("flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border border-border transition-colors",D&&"border-primary bg-primary text-primary-foreground"),children:D&&e.jsx(Ie,{className:"h-2.5 w-2.5"})}),e.jsxs("div",{className:"flex flex-1 items-start gap-2",children:[e.jsx(yn,{src:f.avatar??null,alt:f.name,fallback:f.name?.[0]?.toUpperCase()??"?",className:"h-10 w-10 rounded-lg"}),e.jsxs("div",{className:"flex max-w-[140px] flex-col gap-0.5 overflow-hidden",children:[e.jsx("span",{className:"line-clamp-1 text-sm font-medium text-foreground",children:f.name}),e.jsx("span",{className:"truncate text-[11px] text-muted-foreground",title:f.email,children:f.email})]})]})]},f.id)}),!v&&H.length===0&&e.jsx("p",{className:"px-4 text-xs text-muted-foreground",children:w.noParticipants})]})]})]})}function Cn({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}),e.jsx("circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"})]})}function Dn({scheduleTypes:t,value:n,onChange:s,allLabel:r="All types",className:o,label:i}){const g=l=>{s(l.target.value)},x=t.find(l=>String(l.id)===n);return e.jsxs("div",{className:m.cn("flex flex-col gap-1",o),children:[i&&e.jsx(ue,{className:"text-xs text-muted-foreground",children:i}),e.jsxs("div",{className:"relative",children:[x?e.jsx("span",{className:"pointer-events-none absolute left-2.5 top-1/2 size-3 -translate-y-1/2 rounded-full",style:{backgroundColor:x.color}}):e.jsx(Cn,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsxs(xe,{value:n,onChange:g,className:"h-9 w-full min-w-[140px] pl-8 pr-8 text-sm",children:[e.jsx("option",{value:"all",children:r}),t.map(l=>e.jsx("option",{value:String(l.id),children:l.label},l.id))]})]})]})}function Mn({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"}),e.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})}function Tn({users:t,value:n,onChange:s,allLabel:r="All users",className:o,label:i}){const g=x=>{s(x.target.value)};return e.jsxs("div",{className:m.cn("flex flex-col gap-1",o),children:[i&&e.jsx(ue,{className:"text-xs text-muted-foreground",children:i}),e.jsxs("div",{className:"relative",children:[e.jsx(Mn,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsxs(xe,{value:n,onChange:g,className:"h-9 w-full min-w-[120px] pl-8 pr-8 text-sm",children:[e.jsx("option",{value:"all",children:r}),t.map(x=>e.jsx("option",{value:x.id,children:x.name},x.id))]})]})]})}function En({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M8 2v4"}),e.jsx("path",{d:"M16 2v4"}),e.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),e.jsx("path",{d:"M3 10h18"}),e.jsx("path",{d:"M8 14h.01"}),e.jsx("path",{d:"M12 14h.01"}),e.jsx("path",{d:"M16 14h.01"}),e.jsx("path",{d:"M8 18h.01"}),e.jsx("path",{d:"M12 18h.01"}),e.jsx("path",{d:"M16 18h.01"})]})}function Sn({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5"}),e.jsx("path",{d:"M16 2v4"}),e.jsx("path",{d:"M8 2v4"}),e.jsx("path",{d:"M3 10h5"}),e.jsx("path",{d:"M17.5 17.5 16 16.3V14"}),e.jsx("circle",{cx:"16",cy:"16",r:"6"})]})}function Ln({className:t}){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,children:e.jsx("path",{d:"m9 18 6-6-6-6"})})}function Hn({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M15 3h6v6"}),e.jsx("path",{d:"M10 14 21 3"}),e.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}function In(t){const n=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${n}-${s}-${r}`}function Ge(t){const n=t.getHours(),s=t.getMinutes(),r=n>=12?"PM":"AM",o=n%12||12,i=String(s).padStart(2,"0");return`${o}:${i} ${r}`}function zn(t){const n=Ge(t.startDate),s=Ge(t.endDate);return`${n} - ${s}`}function Pn(t){const n=J.addDays(new Date,1);return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function An(t){if(J.isToday(t))return"Today";if(Pn(t))return"Tomorrow";const n=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r=n[t.getDay()],o=s[t.getMonth()],i=t.getDate();return`${r}, ${o} ${i}`}function Fn(t,n){const s=new Map;for(const r of t){const o=In(r.startDate),i=s.get(o)??[];i.push(r),s.set(o,i)}return Array.from(s.entries()).map(([r,o])=>{const i=[...o].sort((x,l)=>x.startDate.getTime()-l.startDate.getTime()),g=n>0?i.slice(0,n):i;return{date:new Date(r),dateKey:r,events:g,hasMore:n>0&&i.length>n}}).sort((r,o)=>r.date.getTime()-o.date.getTime())}function Wn(t){const n=J.startOfDay(new Date),s=J.endOfDay(new Date);return t.filter(r=>r.startDate>=n&&r.startDate<=s).length}function Pe({className:t}){return e.jsx("div",{className:m.cn("animate-pulse rounded-md bg-muted",t)})}function Rn({event:t,onClick:n}){return e.jsxs("button",{type:"button",onClick:()=>n?.(t),className:m.cn("w-full text-left rounded-lg transition-colors","hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","flex items-start gap-3 p-2"),children:[e.jsx("div",{className:"shrink-0 rounded-full mt-1.5 size-2",style:{backgroundColor:t.color??"#3b82f6"}}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:t.title}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:zn(t)})]}),n&&e.jsx(Ln,{className:"shrink-0 size-4 text-muted-foreground/50 mt-1"})]})}function On({group:t,onEventClick:n}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[e.jsx("h3",{className:m.cn("text-xs font-semibold",J.isToday(t.date)&&"text-primary"),children:An(t.date)}),t.hasMore&&e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["+",t.events.length," more"]})]}),e.jsx("div",{className:"space-y-0.5",children:t.events.map(s=>e.jsx(Rn,{event:s,onClick:n},s.id))})]})}function _n({events:t,isLoading:n=!1,className:s,daysAhead:r=7,maxEventsPerDay:o=3,onEventClick:i,onNavigateToAgenda:g}){const[x,l]=c.useState(!1),v=c.useMemo(()=>{const S=J.startOfDay(new Date),O=J.addDays(S,r);return t.filter(_=>_.endDate>=S&&_.startDate<O)},[t,r]),I=c.useMemo(()=>Fn(v,o),[v,o]),b=c.useMemo(()=>Wn(t),[t]),w=S=>{l(!1),i?.(S)},F=()=>{l(!1),g?.()};return e.jsxs(j.Popover,{open:x,onOpenChange:l,children:[e.jsxs(j.PopoverTrigger,{className:m.cn("relative rounded-xl hover:text-zinc-700 hover:!bg-zinc-300 !bg-zinc-200 text-zinc-600 shadow-none !px-2.5 p-2 max-h-10",s),children:[e.jsx(En,{className:"h-4 w-4"}),b>0&&e.jsx(j.Badge,{variant:"destructive",className:"absolute -right-4 -top-4 m-3 flex h-5 w-5 items-center justify-center rounded-full bg-primary p-0 text-[10px] font-medium hover:bg-primary",children:b>99?"99+":b})]}),e.jsxs(j.PopoverContent,{className:"w-80 rounded-xl p-0",align:"end",side:"bottom",sideOffset:8,children:[e.jsxs("div",{className:"flex items-center justify-between border-b p-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Upcoming"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:b>0?`${b} event${b>1?"s":""} today`:"No events today"})]}),g&&e.jsxs("button",{type:"button",onClick:F,className:"text-xs text-primary hover:underline flex items-center gap-1",children:["View all",e.jsx(Hn,{className:"size-3"})]})]}),e.jsx("div",{className:"max-h-80 overflow-y-auto p-2",children:n?e.jsx("div",{className:"space-y-2 p-2",children:Array.from({length:3}).map((S,O)=>e.jsxs("div",{className:"flex space-x-3",children:[e.jsx(Pe,{className:"h-2 w-2 rounded-full mt-2"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(Pe,{className:"h-4 w-full"}),e.jsx(Pe,{className:"h-3 w-3/4"})]})]},O))}):I.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(Sn,{className:"mb-2 h-8 w-8 text-muted-foreground/50"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No upcoming events"}),e.jsxs("p",{className:"text-xs text-muted-foreground/70",children:["Your schedule is clear for the next ",r," days"]})]}):e.jsx("div",{className:"space-y-3 divide-y",children:I.map(S=>e.jsx(On,{group:S,onEventClick:w},S.dateKey))})})]})]})}function $n({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5"}),e.jsx("path",{d:"M16 2v4"}),e.jsx("path",{d:"M8 2v4"}),e.jsx("path",{d:"M3 10h5"}),e.jsx("path",{d:"M17.5 17.5 16 16.25V14"}),e.jsx("circle",{cx:"16",cy:"16",r:"6"})]})}function Ze({className:t}){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:e.jsx("path",{d:"m9 18 6-6-6-6"})})}function Bn(t){const n=new Date;return n.setDate(n.getDate()+1),t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function Xe(t){const n=t.getHours(),s=t.getMinutes(),r=n>=12?"PM":"AM";return`${n%12||12}:${s.toString().padStart(2,"0")} ${r}`}function Un(t){return new Intl.DateTimeFormat("en-US",{weekday:"long",month:"short",day:"numeric"}).format(t)}function Vn(t){const n=Xe(t.startDate),s=Xe(t.endDate);return`${n} - ${s}`}function qn(t){return J.isToday(t)?"Today":Bn(t)?"Tomorrow":Un(t)}function Yn(t,n){const s=new Map;for(const r of t){const o=J.formatDateISO(r.startDate),i=s.get(o)??[];i.push(r),s.set(o,i)}return Array.from(s.entries()).map(([r,o])=>{const i=[...o].sort((x,l)=>x.startDate.getTime()-l.startDate.getTime()),g=n>0?i.slice(0,n):i;return{date:new Date(r),dateKey:r,events:g,hasMore:n>0&&i.length>n}}).sort((r,o)=>r.date.getTime()-o.date.getTime())}function Kn({event:t,onClick:n,compact:s}){return e.jsxs("button",{type:"button",onClick:()=>n?.(t),className:m.cn("w-full text-left rounded-lg transition-colors","hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","flex items-start gap-3",s?"p-2":"p-3"),children:[e.jsx("div",{className:m.cn("shrink-0 rounded-full mt-1",s?"size-2":"size-2.5"),style:{backgroundColor:t.color??"#3b82f6"}}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:m.cn("font-medium truncate",s?"text-xs":"text-sm"),children:t.title}),e.jsx("p",{className:m.cn("text-muted-foreground truncate",s?"text-[10px]":"text-xs"),children:Vn(t)})]}),n&&e.jsx(Ze,{className:m.cn("shrink-0 text-muted-foreground/50",s?"size-3":"size-4")})]})}function Gn({group:t,onEventClick:n,onViewMore:s,compact:r}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:m.cn("flex items-center justify-between px-2",r?"py-1":"py-1.5"),children:[e.jsx("h3",{className:m.cn("font-semibold",r?"text-xs":"text-sm",J.isToday(t.date)&&"text-primary"),children:qn(t.date)}),t.hasMore&&s&&e.jsx("button",{type:"button",onClick:()=>s(t.date),className:m.cn("text-primary hover:underline",r?"text-[10px]":"text-xs"),children:"+more"})]}),e.jsx("div",{className:"space-y-0.5",children:t.events.map(o=>e.jsx(Kn,{event:o,onClick:n,compact:r},o.id))})]})}function Xn({events:t,daysAhead:n=7,maxEventsPerDay:s=3,onEventClick:r,onViewAll:o,className:i,emptyState:g,title:x="Upcoming",showHeader:l=!0,compact:v=!1}){const I=Me.useOptionalCalendarContext(),b=I?.filteredEvents,w=I?.currentDate??new Date,F=t??b??[],S=c.useMemo(()=>{const B=J.startOfDay(w),H=new Date(B);return H.setDate(H.getDate()+n),F.filter(E=>E.endDate>=B&&E.startDate<H)},[F,n,w]),O=c.useMemo(()=>Yn(S,s),[S,s]),_=S.length;return O.length===0?e.jsxs("div",{className:m.cn("rounded-lg border bg-card",i),children:[l&&e.jsx("div",{className:m.cn("border-b px-4 flex items-center justify-between",v?"py-2":"py-3"),children:e.jsx("h2",{className:m.cn("font-semibold",v?"text-sm":"text-base"),children:x})}),e.jsx("div",{className:m.cn("flex flex-col items-center justify-center text-center",v?"py-6 px-4":"py-10 px-6"),children:g??e.jsxs(e.Fragment,{children:[e.jsx($n,{className:m.cn("text-muted-foreground/50 mb-2",v?"size-8":"size-10")}),e.jsx("p",{className:m.cn("text-muted-foreground",v?"text-xs":"text-sm"),children:"No upcoming events"})]})})]}):e.jsxs("div",{className:m.cn("rounded-lg border bg-card overflow-hidden",i),children:[l&&e.jsxs("div",{className:m.cn("border-b px-4 flex items-center justify-between",v?"py-2":"py-3"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:m.cn("font-semibold",v?"text-sm":"text-base"),children:x}),e.jsx("span",{className:m.cn("text-muted-foreground bg-muted rounded-full px-2",v?"text-[10px] py-0":"text-xs py-0.5"),children:_})]}),o&&e.jsxs("button",{type:"button",onClick:()=>o(),className:m.cn("text-primary hover:underline flex items-center gap-0.5",v?"text-xs":"text-sm"),children:["View all",e.jsx(Ze,{className:"size-3"})]})]}),e.jsx("div",{className:m.cn("divide-y overflow-auto",v?"p-2 max-h-[280px]":"p-3 max-h-[400px]"),children:O.map(B=>e.jsx(Gn,{group:B,onEventClick:r,onViewMore:o?H=>o(H):void 0,compact:v},B.dateKey))})]})}exports.AgendaDropdown=_n;exports.AgendaWidget=Xn;exports.BadgeVariantSetting=an;exports.Calendar=ot;exports.CalendarFilterSidebar=Nn;exports.DEFAULT_WEEK_WORKING_HOURS=jn;exports.EventPopover=yt;exports.InnoCalendar=Qt;exports.ScheduleTypeFilter=Dn;exports.SlotDurationSetting=nn;exports.TimelineView=ve;exports.UserFilter=Tn;exports.VisibleHoursSetting=un;exports.WorkingHoursSetting=vn;exports.YearView=Qe;
|
|
2
|
+
//# sourceMappingURL=agenda-widget-Bl-Gb588.cjs.map
|