@innosolutions/inno-calendar 1.0.48 → 1.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/agenda-widget-B-AVTnqM.cjs +2 -0
  2. package/dist/agenda-widget-B-AVTnqM.cjs.map +1 -0
  3. package/dist/{agenda-widget-DzXBzBfm.js → agenda-widget-DhCPt2vI.js} +941 -929
  4. package/dist/agenda-widget-DhCPt2vI.js.map +1 -0
  5. package/dist/components/event/event-card.d.ts.map +1 -1
  6. package/dist/components/index.cjs +1 -1
  7. package/dist/components/index.mjs +2 -2
  8. package/dist/components/inno-calendar.d.ts +11 -0
  9. package/dist/components/inno-calendar.d.ts.map +1 -1
  10. package/dist/core/context/inno-calendar-provider.d.ts +15 -1
  11. package/dist/core/context/inno-calendar-provider.d.ts.map +1 -1
  12. package/dist/core/index.cjs +1 -1
  13. package/dist/core/index.mjs +43 -43
  14. package/dist/core/types.d.ts +12 -0
  15. package/dist/core/types.d.ts.map +1 -1
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.mjs +62 -62
  18. package/dist/presets/index.cjs +1 -1
  19. package/dist/presets/index.mjs +1 -1
  20. package/dist/slot-selection-context-BCsC7WT7.cjs +2 -0
  21. package/dist/slot-selection-context-BCsC7WT7.cjs.map +1 -0
  22. package/dist/slot-selection-context-D1495hEJ.js +595 -0
  23. package/dist/slot-selection-context-D1495hEJ.js.map +1 -0
  24. package/dist/{tailwind-calendar-Ba5BO9tj.js → tailwind-calendar-BmJa4HhQ.js} +2 -2
  25. package/dist/{tailwind-calendar-Ba5BO9tj.js.map → tailwind-calendar-BmJa4HhQ.js.map} +1 -1
  26. package/dist/{tailwind-calendar-4FkVdxbr.cjs → tailwind-calendar-CJmOutn1.cjs} +2 -2
  27. package/dist/{tailwind-calendar-4FkVdxbr.cjs.map → tailwind-calendar-CJmOutn1.cjs.map} +1 -1
  28. package/dist/use-calendar-BEuelmSu.cjs +2 -0
  29. package/dist/use-calendar-BEuelmSu.cjs.map +1 -0
  30. package/dist/use-calendar-Clo9DFK4.js +175 -0
  31. package/dist/use-calendar-Clo9DFK4.js.map +1 -0
  32. package/dist/{use-slot-selection-BJHlyfxL.js → use-slot-selection-BCZKnZSM.js} +2 -2
  33. package/dist/{use-slot-selection-BJHlyfxL.js.map → use-slot-selection-BCZKnZSM.js.map} +1 -1
  34. package/dist/{use-slot-selection-CTFC2-xS.cjs → use-slot-selection-Bwqwjiaq.cjs} +2 -2
  35. package/dist/{use-slot-selection-CTFC2-xS.cjs.map → use-slot-selection-Bwqwjiaq.cjs.map} +1 -1
  36. package/dist/week-view-D19YRBQC.cjs +11 -0
  37. package/dist/week-view-D19YRBQC.cjs.map +1 -0
  38. package/dist/{week-view-CVbu7Qh2.js → week-view-aRPB2cjn.js} +934 -916
  39. package/dist/week-view-aRPB2cjn.js.map +1 -0
  40. package/package.json +1 -1
  41. package/dist/agenda-widget-D_DbVHjB.cjs +0 -2
  42. package/dist/agenda-widget-D_DbVHjB.cjs.map +0 -1
  43. package/dist/agenda-widget-DzXBzBfm.js.map +0 -1
  44. package/dist/slot-selection-context-Bx3FKJfR.cjs +0 -2
  45. package/dist/slot-selection-context-Bx3FKJfR.cjs.map +0 -1
  46. package/dist/slot-selection-context-D2eu2o-7.js +0 -203
  47. package/dist/slot-selection-context-D2eu2o-7.js.map +0 -1
  48. package/dist/use-calendar-DR2emWYC.js +0 -555
  49. package/dist/use-calendar-DR2emWYC.js.map +0 -1
  50. package/dist/use-calendar-DR89bZu5.cjs +0 -2
  51. package/dist/use-calendar-DR89bZu5.cjs.map +0 -1
  52. package/dist/week-view-7r6Vhahg.cjs +0 -11
  53. package/dist/week-view-7r6Vhahg.cjs.map +0 -1
  54. package/dist/week-view-CVbu7Qh2.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("react/jsx-runtime"),ie=require("./use-calendar-BEuelmSu.cjs"),w=require("react"),u=require("./index-D2U2F80P.cjs"),f=require("./week-view-D19YRBQC.cjs"),le=require("./slot-selection-context-BCsC7WT7.cjs"),A=require("./utils.cjs");function Le({view:t,className:s=""}){return e.jsx("div",{className:s,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 me({view:t,className:s}){return e.jsx(Le,{view:t,className:s})}function Ie(t){const{events:s,resources:n,scheduleTypes:r,initialView:i="week",initialDate:a,initialFilters:m,preferences:h,locale:l,slots:g,renderEvent:b,onViewChange:p,onDateChange:T,onEventClick:F,onSlotSelect:H,onFiltersChange:D,className:E,children:L}=t,v=ie.useOptionalCalendarContext();if(v)return e.jsx("div",{className:E,style:{position:"relative"},children:L??e.jsx(me,{view:v.view,className:E})});const I=ie.useCalendar({events:s,resources:n,scheduleTypes:r,initialView:i,initialDate:a,initialFilters:m,preferences:h,locale:l,onViewChange:p,onDateChange:T,onEventClick:F,onSlotSelect:H,onFiltersChange:D});return e.jsx(ie.CalendarProvider,{value:I,children:e.jsx("div",{className:E,style:{position:"relative"},children:L??e.jsx(me,{view:I.view,className:E})})})}function We({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 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:"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 ae({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 Fe({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 re({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 Ae({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 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:t,children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}function Be({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 Oe({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 _e({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 $e({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 te({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:u.cn("animate-spin",t),children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}const Re={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."},oe=w.forwardRef(({onClick:t,label:s,children:n,className:r,variant:i="ghost",...a},m)=>e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{asChild:!0,children:e.jsx("button",{type:"button",ref:m,onClick:t,className:u.cn("h-8 w-8 rounded-full flex items-center justify-center transition-colors",i==="ghost"&&"hover:bg-zinc-100 dark:hover:bg-zinc-800 text-zinc-600 dark:text-zinc-400",i==="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":s,...a,children:n})}),e.jsx(f.TooltipContent,{side:"bottom",className:"text-xs",children:s})]}));oe.displayName="IconButton";function Ve({src:t,alt:s,initials:n,className:r,isClient:i}){const[a,m]=w.useState(!1);return e.jsx("div",{className:u.cn("relative h-7 w-7 rounded-full overflow-hidden shrink-0",r),children:t&&!a?e.jsx("img",{src:t,alt:s,className:"h-full w-full object-cover",onError:()=>m(!0)}):e.jsx("div",{className:u.cn("h-full w-full flex items-center justify-center text-[10px] font-medium",i?"bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300":"bg-zinc-200 dark:bg-zinc-700 text-zinc-700 dark:text-zinc-300"),children:n})})}function fe({participant:t,isEventCanceled:s=!1,labels:n}){const r=t.name||"Unknown",i=r.split(" ").map(T=>T[0]).join("").toUpperCase().slice(0,2),a=t.isOrganizer??!1,m=t.isConfirmed,h=m===!0,l=m===!1,g=t.isClient??!1,b=t.profilePicture||t.avatar,p=s;return e.jsxs("div",{className:u.cn("flex items-center gap-3 py-0",p&&"opacity-60"),children:[e.jsxs("div",{className:"relative",children:[e.jsx(Ve,{src:b,alt:r,initials:i,isClient:g,className:u.cn(p&&"grayscale")}),p||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(ae,{className:"h-2 w-2 text-red-600 dark:text-red-400 stroke-[3]"})})}):h?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(re,{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:u.cn("text-sm text-zinc-900 dark:text-zinc-100 truncate",p&&"line-through text-zinc-500 dark:text-zinc-500"),children:r})}),g&&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:n.client}),a&&!p&&e.jsx("div",{className:"text-xs text-zinc-500",children:n.organizer})]})]})}function Ue({open:t,onOpenChange:s,title:n,children:r}){return w.useEffect(()=>{if(!t)return;const i=a=>{a.key==="Escape"&&s(!1)};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[t,s]),w.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:()=>s(!1),onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&s(!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:[n&&e.jsx("div",{className:"sr-only",children:n}),r]})})]}):null}function Ye({open:t,onOpenChange:s,title:n,description:r,cancelLabel:i,confirmLabel:a,onConfirm:m,isLoading:h}){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:()=>s(!1),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&s(!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:n}),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(f.Button,{variant:"outline",size:"sm",onClick:()=>s(!1),children:i}),e.jsxs(f.Button,{variant:"destructive",size:"sm",onClick:m,disabled:h,children:[h&&e.jsx(te,{className:"h-4 w-4 mr-2"}),e.jsx(Te,{className:"h-4 w-4 mr-2"}),a]})]})]})})]}):null}function Ge(t,s){return t.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"})}function qe(t,s){const n={hour:"2-digit",minute:"2-digit",hour12:!1};return`${t.toLocaleTimeString(void 0,n)} – ${s.toLocaleTimeString(void 0,n)}`}function Ke(t){return t.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}function Je(t){const[s,n]=w.useState(()=>typeof window<"u"?window.matchMedia(t).matches:!1);return w.useEffect(()=>{if(typeof window>"u")return;const r=window.matchMedia(t),i=a=>n(a.matches);return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[t]),s}function ge({event:t,labels:s,isLoading:n,onClose:r,onEdit:i,onDelete:a,onCancel:m,onAccept:h,onDecline:l,onConfirmMeeting:g,canEdit:b=!0,canDelete:p=!1,canCancel:T=!0,isCurrentUserParticipant:F=!1,isCurrentUserClient:H=!1,currentUserAcceptStatus:D,isAcceptLoading:E=!1,isDeclineLoading:L=!1,isConfirmLoading:v=!1,isDeleteLoading:I=!1,renderParticipant:C,renderHeaderActions:P,renderCancelReason:V,renderDeleteConfirmation:U,formatDate:B=Ge,formatTimeRange:_=qe}){const[W,R]=w.useState(!1),Y=!(t.isCanceled||t.meetingTookPlace),x=t.isRecurring??!1,o=t.participantDetails,d=t.participantsNames||[],j=o&&o.length>0,k=D===!0,N=D===!1,S=F&&!H&&Y,z=j?o.filter(M=>M.isConfirmed).length:t.isAccepted?d.length:0,$=j?o.length:d.length,q=t.scheduleTypeColor||t.hexColor||"#039BE5",G=w.useCallback(()=>t.startDate?B(t.startDate):s.noDateProvided,[t.startDate,B,s.noDateProvided]),K=w.useCallback(()=>t.startDate&&t.endDate?_(t.startDate,t.endDate):null,[t.startDate,t.endDate,_]),Z=()=>{r(),i?.(t)},ee=()=>{r(),m?.(t)},c=()=>{R(!0)},y=()=>{a?.(t),R(!1)};return n?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(te,{className:"h-6 w-6 text-zinc-400"})}):e.jsxs(f.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:P?P({onClose:r}):e.jsxs(e.Fragment,{children:[Y&&b&&i&&e.jsx(oe,{onClick:Z,label:s.edit,children:e.jsx(We,{className:"h-[18px] w-[18px]"})}),Y&&T&&m&&e.jsx(oe,{onClick:ee,label:s.cancel,children:e.jsx(Fe,{className:"h-[18px] w-[18px]"})}),p&&a&&e.jsx(oe,{onClick:c,label:s.delete,variant:"destructive",children:e.jsx(Te,{className:"h-[18px] w-[18px]"})}),e.jsx(oe,{onClick:r,label:s.close,children:e.jsx(ae,{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:q}}),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:u.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(Ae,{className:"h-3 w-3"}),s.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(ae,{className:"h-3 w-3"}),s.canceled]})]}),e.jsxs("div",{className:"mt-1 text-sm text-zinc-600 dark:text-zinc-400",children:[e.jsx("span",{children:G()}),K()&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-1.5",children:"·"}),e.jsx("span",{children:K()})]})]}),x&&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:V?V(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:s.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:[s.canceledOn," ",Ke(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(Oe,{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})]}),(j||d.length>0)&&e.jsxs("div",{className:"flex items-start gap-2 py-0",children:[e.jsx(Be,{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:[$," ",$!==1?s.guests:s.guest]}),$>0&&e.jsxs("span",{className:"text-xs text-zinc-500",children:["(",z," ",s.confirmed,")"]})]}),e.jsxs("div",{className:"mt-2 space-y-2",children:[j?o.slice(0,6).map((M,O)=>C?C(M,O):e.jsx(fe,{participant:M,isEventCanceled:t.isCanceled,labels:s},M.id)):d.slice(0,6).map((M,O)=>{const Q={id:String(O),name:M,email:"",isConfirmed:t.isAccepted,isOrganizer:O===0,isClient:!1};return C?C(Q,O):e.jsx(fe,{participant:Q,isEventCanceled:t.isCanceled,labels:s},M)}),$>6&&e.jsxs("div",{className:"text-xs text-zinc-500 py-1.5 pl-10",children:["+",$-6," ",s.more]})]})]})]}),t.description&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx($e,{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(_e,{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:j&&o.find(M=>M.isOrganizer)?.name||d[0]||"Calendar"})]})]}),S&&h&&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:[x?e.jsxs(f.DropdownMenu,{children:[e.jsx(f.DropdownMenuTrigger,{asChild:!0,children:e.jsxs("div",{className:"flex",children:[e.jsx(f.Button,{size:"sm",variant:"outline",className:u.cn("rounded-r-none gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",k&&"!bg-green-700 !text-white hover:!bg-green-700"),onClick:M=>{M.stopPropagation(),k||h(t)},disabled:E,children:E?e.jsx(te,{className:"h-3.5 w-3.5"}):e.jsxs(e.Fragment,{children:[k&&e.jsx(re,{className:"h-3.5 w-3.5"}),s.going]})}),e.jsx(f.Button,{size:"sm",variant:"outline",className:u.cn("rounded-l-none px-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",k&&"!bg-green-700 !text-white hover:!bg-green-700"),children:e.jsx(Pe,{className:"h-3.5 w-3.5"})})]})}),e.jsxs(f.DropdownMenuContent,{align:"start",children:[e.jsxs(f.DropdownMenuItem,{className:u.cn("gap-1.5 h-8 !border-none !bg-green-50 text-green-800 hover:!bg-green-100",k&&"!bg-green-700 !text-white hover:!bg-green-700"),onClick:()=>h(t),children:[e.jsx(re,{className:"h-3.5 w-3.5 mr-2 text-green-600"}),s.acceptThisEvent]}),e.jsxs(f.DropdownMenuItem,{onClick:()=>h(t),children:[e.jsx(re,{className:"h-3.5 w-3.5 mr-2 text-green-600"}),s.acceptAllEvents]})]})]}):e.jsx(f.Button,{size:"sm",variant:"outline",className:u.cn("gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",k&&"!bg-green-700 !text-white hover:!bg-green-700"),onClick:()=>{k||h(t)},disabled:E,children:E?e.jsx(te,{className:"h-3.5 w-3.5"}):e.jsxs(e.Fragment,{children:[k&&e.jsx(re,{className:"h-3.5 w-3.5"}),s.going]})}),e.jsx(f.Button,{size:"sm",variant:"outline",className:u.cn("gap-1.5 h-8 !border-none !bg-rose-100 text-rose-800 hover:!bg-rose-200",N&&"!bg-rose-700 !text-white hover:!bg-rose-700"),onClick:()=>{N||l(t)},disabled:L,children:L?e.jsx(te,{className:"h-3.5 w-3.5"}):e.jsxs(e.Fragment,{children:[N&&e.jsx(ae,{className:"h-3.5 w-3.5"}),s.notGoing]})})]})}),F&&k&&!t.meetingTookPlace&&!t.isCanceled&&g&&e.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-800 py-3",children:e.jsxs(f.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:()=>g(t),disabled:v,children:[v&&e.jsx(te,{className:"h-4 w-4 mr-2"}),s.confirmMeeting]})})]}),U?W&&U({onConfirm:y,onCancel:()=>R(!1),isLoading:I}):e.jsx(Ye,{open:W,onOpenChange:R,title:s.deleteConfirmTitle,description:s.deleteConfirmDescription,cancelLabel:s.cancel,confirmLabel:s.delete,onConfirm:y,isLoading:I})]})}function Xe({event:t,children:s,open:n,onOpenChange:r,isLoading:i,labels:a,onEdit:m,onDelete:h,onCancel:l,onAccept:g,onDecline:b,onConfirmMeeting:p,canEdit:T=!0,canDelete:F=!1,canCancel:H=!0,isCurrentUserParticipant:D,isCurrentUserClient:E,currentUserAcceptStatus:L,isAcceptLoading:v,isDeclineLoading:I,isConfirmLoading:C,isDeleteLoading:P,renderParticipant:V,renderHeaderActions:U,renderCancelReason:B,renderDeleteConfirmation:_,formatDate:W,formatTimeRange:R,className:Y,width:x=360}){const o=Je("(min-width: 768px)"),d={...Re,...a},j=w.useCallback(()=>{r?.(!1)},[r]),k={event:t,labels:d,isLoading:i,onClose:j,onEdit:m,onDelete:h,onCancel:l,onAccept:g,onDecline:b,onConfirmMeeting:p,canEdit:T,canDelete:F,canCancel:H,isCurrentUserParticipant:D,isCurrentUserClient:E,currentUserAcceptStatus:L,isAcceptLoading:v,isDeclineLoading:I,isConfirmLoading:C,isDeleteLoading:P,renderParticipant:V,renderHeaderActions:U,renderCancelReason:B,renderDeleteConfirmation:_,formatDate:W,formatTimeRange:R};return o?e.jsxs(f.Popover,{open:n??!1,onOpenChange:r??(()=>{}),children:[e.jsx(f.PopoverTrigger,{asChild:!0,children:s}),e.jsx(f.PopoverContent,{className:u.cn("p-0 shadow-lg !rounded-2xl bg-white dark:bg-zinc-900 overflow-hidden border z-50",Y),style:{width:x},align:"center",side:"bottom",sideOffset:4,children:e.jsx(ge,{...k})})]}):e.jsxs(e.Fragment,{children:[s,e.jsx(Ue,{open:n??!1,onOpenChange:r??(()=>{}),title:t.title,children:e.jsx(ge,{...k})})]})}const ce=44,pe=4,Qe=56,je=8,de=80,ne=140,ve=100,we=2,Ze=8,et=18;function tt(t){return t.split(" ").map(s=>s[0]).join("").toUpperCase().slice(0,2)}function st(t,s){const n=[];for(let r=0;r<s;r++){const i=new Date(t);i.setDate(i.getDate()+r),n.push(i)}return n}function nt(t,s,n){const r=[];return t.forEach((i,a)=>{for(let m=s;m<n;m++)r.push({hour:m,dayIndex:a,date:i})}),r}function rt(t){return`${t.toString().padStart(2,"0")}:00`}function ot(t){return t.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}function be(t){const s=[...t].sort((i,a)=>i.startCol!==a.startCol?i.startCol-a.startCol:a.spanCols-i.spanCols),n=[],r=[];for(const i of s){let a=0;for(;r[a]!==void 0&&r[a]>i.startCol;)a++;r[a]=i.startCol+i.spanCols,n.push({...i,stackIndex:a})}return n}function it({src:t,alt:s,fallback:n,className:r}){return e.jsx("div",{className:u.cn("relative flex shrink-0 overflow-hidden rounded-sm border bg-muted",r),children:t?e.jsx("img",{src:t,alt:s,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:n})})}const at=7;function se({daysToShow:t=at,events:s,users:n=[],selectedDate:r,onDateChange:i,onEventClick:a,visibleHours:m,className:h,getEventUserId:l,renderPopover:g,slots:b,classNames:p}){const T=w.useRef(null),F=r??new Date,H=!0,D=m?.from??Ze,E=m?.to??et,L=E-D,v=w.useMemo(()=>{const o=new Date(F);if(t===1||t===3)return o.setHours(0,0,0,0),o;const d=o.getDay(),j=d===0?-6:1-d;return o.setDate(o.getDate()+j),o.setHours(0,0,0,0),o},[F,t]),I=w.useMemo(()=>st(v,t),[v,t]),C=w.useMemo(()=>nt(I,D,E),[H,I,D,E]),V=l??(o=>{if(o.resourceId)return o.resourceId;const d=o.data;if(d?.userId)return String(d.userId);if(d?.user&&typeof d.user=="object"&&d.user.id)return String(d.user.id);if(o.user?.id)return o.user.id;if(o.participants?.[0]?.id)return o.participants[0].id}),U=w.useMemo(()=>{const o=new Map;for(const d of n)o.set(d.id,{id:d.id,name:d.name,avatar:d.avatar??void 0,email:d.email});for(const d of s){const k=d.data?.user;k?.id&&!o.has(k.id)&&o.set(k.id,{id:k.id,name:k.name??"",avatar:k.avatar??void 0,email:k.email}),d.user?.id&&!o.has(d.user.id)&&o.set(d.user.id,{id:d.user.id,name:d.user.name,avatar:d.user.avatar??void 0,email:d.user.email});for(const N of d.participants||[])N.id&&!o.has(N.id)&&o.set(N.id,{id:N.id,name:N.name,avatar:N.avatar??void 0,email:N.email})}return Array.from(o.values())},[n,s]),B=w.useMemo(()=>{const o=[],d=new Map;for(const N of U)d.set(N.id,[]);d.set("unassigned",[]);for(const N of s){const S=V(N)??"unassigned";(d.get(S)??d.get("unassigned")).push(N)}const j=N=>{const S=[];for(const z of N){const $=z.startDate.getHours()+z.startDate.getMinutes()/60,q=z.endDate.getHours()+z.endDate.getMinutes()/60;for(let G=0;G<I.length;G++){const K=I[G],Z=A.startOfDay(K),ee=A.endOfDay(K);if(z.startDate<=ee&&z.endDate>=Z){let c=D,y=E;if(z.startDate>=Z&&(c=Math.max(D,$)),z.endDate<=ee&&(y=Math.min(E,q)),c=Math.max(D,Math.min(E,c)),y=Math.max(D,Math.min(E,y)),y>c){const M=G*L+Math.floor(c-D),O=G*L+Math.ceil(y-D);S.push({event:z,startCol:M,spanCols:Math.max(1,O-M)})}}}}return S};for(const N of U){const S=d.get(N.id)??[],z=j(S),$=be(z),q=$.reduce((G,K)=>Math.max(G,K.stackIndex+1),0);o.push({user:N,events:$,maxStack:Math.max(q,1)})}const k=d.get("unassigned")??[];if(k.length>0){const N=j(k),S=be(N),z=S.reduce(($,q)=>Math.max($,q.stackIndex+1),0);o.push({user:{id:"unassigned",name:"Unassigned",avatar:void 0,email:void 0},events:S,maxStack:Math.max(z,1)})}return o.filter(N=>N.events.length>0)},[U,s,I,H,L,D,E,V]),_=w.useMemo(()=>{const o=new Map;for(const d of B)for(const j of d.events)if(j.spanCols===1){const k=o.get(j.startCol)??0;o.set(j.startCol,k+1)}return o},[B]),W=w.useMemo(()=>{const o=C.length,d=de,j=[];for(let k=0;k<o;k++){const N=_.get(k)??0;N>we?j.push(ve+(N-we)*20):N>0?j.push(Math.max(d,ve)):j.push(d)}return j},[H,C.length,I.length,_]),R=o=>Math.max(Qe,o*(ce+pe)+je*2),Y=ne+W.reduce((o,d)=>o+d,0),x=w.useMemo(()=>{const o=[0];for(let d=0;d<W.length;d++)o.push(o[d]+W[d]);return o},[W]);return w.useLayoutEffect(()=>{const o=T.current;if(!o)return;const d=()=>{let j=-1;const N=new Date().getHours();{for(let S=0;S<C.length;S++){const z=C[S];if(z&&A.isToday(z.date)&&z.hour<=N&&z.hour+1>N){j=S;break}}if(j===-1)for(let S=0;S<C.length;S++){const z=C[S];if(z&&A.isToday(z.date)){j=S;break}}}if(j!==-1){const S=(x[j]??0)+ne,z=o.clientWidth,$=Math.max(0,S-z/3);o.scrollTo({left:$,behavior:"instant"})}};requestAnimationFrame(()=>{requestAnimationFrame(d)})},[F,C,I,x,H]),e.jsx("div",{className:u.cn("flex h-full flex-col",h),children:e.jsx("div",{className:"ic-timeline-scroll-container flex-1",ref:T,children:e.jsxs("div",{className:"relative",style:{minWidth:Y},children:[e.jsx("div",{className:"ic-timeline-header sticky top-0 z-20 border-b bg-background",children:e.jsxs("div",{className:"flex flex-col",children:[t>1&&e.jsxs("div",{className:"flex border-b",children:[e.jsx("div",{className:"flex shrink-0 items-center border-r bg-background px-2 py-1",style:{width:ne},children:e.jsx("span",{className:"text-[10px] font-medium uppercase text-muted-foreground",children:"Resources"})}),I.map((o,d)=>{const j=A.isToday(o),k=d*L,N=W.slice(k,k+L).reduce((S,z)=>S+z,0);return e.jsx("div",{className:u.cn("flex shrink-0 items-center justify-center border-r py-1.5 font-medium",j?"bg-primary/10 text-primary":"bg-muted/30"),style:{width:N},children:e.jsx("span",{className:"text-xs",children:ot(o)})},`day-${o.toISOString()}`)})]}),e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:u.cn("flex shrink-0 items-center border-r bg-background px-2 py-2",t>1&&"sticky left-0 z-10"),style:{width:ne},children:t===1&&e.jsx("span",{className:"text-[10px] font-medium uppercase text-muted-foreground",children:"Resources"})}),C.map((o,d)=>{const j=o.hour===D,k=A.isToday(o.date),N=W[d]??de;return e.jsx("div",{className:u.cn("flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",j&&d>0?"border-l-2 border-l-border":"border-r border-r-border/50",k&&"bg-primary/5"),style:{width:N},children:rt(o.hour)},`hour-${o.dayIndex}-${o.hour}`)})]})]})}),B.map(o=>{const d=R(o.maxStack);return e.jsxs("div",{className:u.cn("relative flex border-b",p?.resourceRow),style:{height:d},children:[e.jsx("div",{className:"sticky left-0 z-10",style:{width:ne},children:e.jsxs("div",{className:u.cn("flex h-full items-center gap-2 sm:gap-3 border-r bg-background px-2 sm:px-4",p?.resourceHeader),children:[e.jsx(it,{className:"size-7",src:o.user.avatar,alt:o.user.name,fallback:tt(o.user.name)}),e.jsx("span",{className:"truncate text-xs sm:text-sm font-medium",children:o.user.name})]})}),e.jsxs("div",{className:"relative flex",children:[C.map((j,k)=>{const N=j.hour===D&&k>0,S=W[k]??de;return e.jsx("div",{className:u.cn("shrink-0",N?"border-l-2 border-l-border":"border-r border-r-border/50",A.isToday(j.date)&&"bg-primary/5"),style:{width:S}},`cell-${j.dayIndex}-${j.hour}`)}),o.events.map(j=>{const k=(x[j.startCol]??0)+2,N=x[j.startCol+j.spanCols]??x[x.length-1]??0,S=x[j.startCol]??0,z=N-S-4,$=je+j.stackIndex*(ce+pe);return e.jsx("div",{className:"absolute",style:{left:k,width:Math.max(z,0),top:$,height:ce},children:e.jsx(f.EventCard,{event:j.event,variant:"compact",onClick:a,renderPopover:g,className:u.cn("h-full w-full",p?.eventCardCompact)})},j.event.id)})]})]},o.user.id)}),B.length===0&&e.jsx("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:"No users or events to display"})]})})})}const lt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ct=["January","February","March","April","May","June","July","August","September","October","November","December"];function ye(t){const s=t.hexColor;return s?{backgroundColor:s}:{}}function dt({day:t,date:s,events:n,isCurrentMonth:r,onDayClick:i}){const a=A.isToday(s),m=3,h=n.length;return e.jsxs("button",{type:"button",onClick:()=>i?.(s),className:u.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:u.cn("flex size-5 sm:size-6 items-center justify-center rounded-full text-[10px] sm:text-xs font-medium",a&&"bg-primary font-semibold text-primary-foreground"),children:t}),h>0&&e.jsx("div",{className:"mt-0.5 flex items-center gap-0.5",children:h<=m?n.map(l=>e.jsx("div",{className:"size-1 sm:size-1.5 rounded-full bg-primary",style:ye(l)},l.id)):e.jsxs(e.Fragment,{children:[n.slice(0,m).map(l=>e.jsx("div",{className:"size-1 sm:size-1.5 rounded-full bg-primary",style:ye(l)},l.id)),e.jsxs("span",{className:"text-[6px] sm:text-[7px] font-medium text-muted-foreground",children:["+",h-m]})]})})]})}function ut({date:t,events:s,onMonthClick:n,onDayClick:r}){const i=w.useMemo(()=>A.generateMonthGrid(t,0),[t]);return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("button",{type:"button",onClick:()=>n?.(t),className:u.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:ct[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:lt.map((a,m)=>e.jsxs("div",{className:"text-[9px] sm:text-xs font-medium text-muted-foreground",children:[e.jsx("span",{className:"sm:hidden",children:a[0]}),e.jsx("span",{className:"hidden sm:inline",children:a})]},m))}),e.jsx("div",{className:"grid grid-cols-7 gap-x-0.5 gap-y-1",children:i.map((a,m)=>{const h=A.getEventsForDay(s,a.date);return e.jsx(dt,{day:a.date.getDate(),date:a.date,events:h,isCurrentMonth:a.isCurrentMonth,onDayClick:r},`${m+1}-${a.date.toISOString()}`)})})]})]})}function Se({events:t,year:s,onMonthClick:n,onDayClick:r,className:i,slots:a,classNames:m}){const h=w.useMemo(()=>A.getYearMonths(s),[s]);return e.jsxs("div",{className:u.cn("flex flex-col h-full",i),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:s})}),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:h.map(l=>e.jsx(ut,{date:l,events:t,onMonthClick:n,onDayClick:r},l.getMonth()))})})]})}function xt(t){switch(t){case"day":case"week":return"time";default:return"day"}}function ht({onEventClick:t,onSlotClick:s,onSlotSelect:n,onAddEvent:r,className:i,showHeader:a=!0,minSelectionMinutes:m=30,showMoreMode:h,showMoreEventsInPopover:l=!1,isLoading:g=!1,slots:b,classNames:p,settingsContent:T,filterContent:F,headerActions:H,renderPopover:D,calendarRef:E}){const L=h??(l?"popover":"expand"),{view:v,setView:I,selectedDate:C,setSelectedDate:P,slotDuration:V,filteredEvents:U,users:B,visibleHours:_,workingHours:W,badgeVariant:R,showWorkingHoursOnly:Y,clearFocusEventId:x}=le.useInnoCalendar(),o=w.useMemo(()=>{if(!Y||!W)return{startHour:_.start,endHour:_.end};let c=24,y=0;for(const M of Object.keys(W)){const O=W[Number(M)];!O||O.enabled===!1||(O.from<c&&(c=O.from),O.to>y&&(y=O.to))}return c>=y?{startHour:_.start,endHour:_.end}:{startHour:c,endHour:y}},[Y,W,_]),d=o,j=w.useRef(null);w.useImperativeHandle(E,()=>({scrollToToday:()=>{const c=new Date;P(c,v),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const y=j.current?.querySelector(".ic-timeline-scroll-container, [class*='overflow-auto']");if(!y)return;const Q=(c.getHours()-o.startHour)*96;Q>0&&y.scrollTo({top:Math.max(0,Q-100),behavior:"smooth"})})})},scrollToWorkingHours:()=>{let c=8;if(W)for(const y of Object.keys(W)){const M=W[Number(y)];M?.enabled&&M.from<c&&(c=Math.max(M.from-1,0))}requestAnimationFrame(()=>{requestAnimationFrame(()=>{const y=j.current?.querySelector(".ic-timeline-scroll-container, [class*='overflow-auto']");if(!y)return;const O=(c-o.startHour)*96;y.scrollTo({top:Math.max(0,O),behavior:"smooth"})})})},getViewRect:()=>j.current?.getBoundingClientRect()??null,focusEvent:c=>{x(),requestAnimationFrame(()=>{x()});const y=j.current?.querySelector(`[data-event-id="${c}"]`);y&&setTimeout(()=>y.click(),150)}}),[P,v,o,W,x]);const k=w.useMemo(()=>xt(v),[v]),N=w.useCallback(c=>{if(n){n(c);return}if(s){const y=c.startDate.getHours();s(c.startDate,y)}},[n,s]),S=w.useCallback(c=>{I("day"),P(c,"day")},[P,I]),z=w.useCallback(c=>{I("month"),P(c,"month")},[P,I]),$=w.useCallback(c=>{t?.(c)},[t]),q=()=>{const c=U,y=$,M=D;switch(v){case"day":return e.jsx(f.DayView,{events:c,date:C,visibleHours:d,workingHours:W,slotDuration:V,badgeVariant:R,onEventClick:y,renderPopover:M,...b&&{slots:b},...p&&{classNames:p}});case"week":return e.jsx(f.WeekView,{events:c,date:C,visibleHours:d,workingHours:W,slotDuration:V,badgeVariant:R,onEventClick:y,renderPopover:M,...b&&{slots:b},...p&&{classNames:p}});case"month":return e.jsx(f.MonthView,{events:c,date:C,badgeVariant:R,onEventClick:y,onDayClick:S,renderPopover:M,showMoreMode:L,...b&&{slots:b},...p&&{classNames:p}});case"year":return e.jsx(Se,{events:c,year:C.getFullYear(),onMonthClick:z,onDayClick:S,...b&&{slots:b},...p&&{classNames:p}});case"agenda":return e.jsx(f.AgendaView,{events:c,date:C,onEventClick:y,renderPopover:M,...b&&{slots:b},...p&&{classNames:p}});case"resource-day":return e.jsx(se,{daysToShow:1,events:c,users:B,selectedDate:C,visibleHours:{from:o.startHour,to:o.endHour},onEventClick:y,renderPopover:M,...b&&{slots:b},...p&&{classNames:p}});case"resource-week":return e.jsx(se,{daysToShow:7,events:c,users:B,selectedDate:C,visibleHours:{from:o.startHour,to:o.endHour},onEventClick:y,renderPopover:M,...b&&{slots:b},...p&&{classNames:p}});case"timeline-day":return e.jsx(se,{daysToShow:1,events:c,users:B,selectedDate:C,visibleHours:{from:o.startHour,to:o.endHour},onEventClick:y,renderPopover:M,...b&&{slots:b},...p&&{classNames:p}});case"timeline-3day":return e.jsx(se,{daysToShow:3,events:c,users:B,selectedDate:C,visibleHours:{from:o.startHour,to:o.endHour},onEventClick:y,renderPopover:M,...b&&{slots:b},...p&&{classNames:p}});case"timeline-week":return e.jsx(se,{daysToShow:7,events:c,users:B,selectedDate:C,visibleHours:{from:o.startHour,to:o.endHour},onEventClick:y,renderPopover:M,...b&&{slots:b},...p&&{classNames:p}});default:return e.jsx(f.MonthView,{events:c,date:C,badgeVariant:R,onEventClick:y,onDayClick:S,...b&&{slots:b},...p&&{classNames:p}})}},G=w.useRef(null),[K,Z]=w.useState(!1);w.useEffect(()=>{j.current=G.current}),w.useEffect(()=>{const c=G.current;if(!c)return;const y=()=>{const{scrollLeft:Q,scrollWidth:ze,clientWidth:He}=c;Z(Q+He<ze-4)};y(),c.addEventListener("scroll",y,{passive:!0});const M=new ResizeObserver(y);M.observe(c);const O=new MutationObserver(y);return O.observe(c,{childList:!0,subtree:!0}),()=>{c.removeEventListener("scroll",y),M.disconnect(),O.disconnect()}},[v]);const ee=w.useCallback(()=>{G.current?.scrollBy({left:300,behavior:"smooth"})},[]);return e.jsx(le.SlotSelectionProvider,{mode:k,onSelect:N,minDurationMinutes:m,slotDurationMinutes:V,enabled:!!(n||s),children:e.jsxs("div",{className:u.cn("inno-calendar-root flex flex-col h-full p-4",p?.root,i),children:[a&&e.jsx(f.CalendarHeader,{currentDate:C,view:v,events:U,onViewChange:I,onNavigateToday:()=>P(new Date,v),onNavigatePrev:()=>{const c=new Date(C);v==="day"||v==="timeline-day"||v==="resource-day"?c.setDate(c.getDate()-1):v==="timeline-3day"?c.setDate(c.getDate()-3):v==="week"||v==="timeline-week"||v==="resource-week"?c.setDate(c.getDate()-7):v==="month"?c.setMonth(c.getMonth()-1):v==="year"?c.setFullYear(c.getFullYear()-1):c.setDate(c.getDate()-7),P(c,v)},onNavigateNext:()=>{const c=new Date(C);v==="day"||v==="timeline-day"||v==="resource-day"?c.setDate(c.getDate()+1):v==="timeline-3day"?c.setDate(c.getDate()+3):v==="week"||v==="timeline-week"||v==="resource-week"?c.setDate(c.getDate()+7):v==="month"?c.setMonth(c.getMonth()+1):v==="year"?c.setFullYear(c.getFullYear()+1):c.setDate(c.getDate()+7),P(c,v)},availableViews:["day","week","month","agenda"],showTimelineViews:!0,showSettings:!!T,...!H&&r&&{onAddEvent:r},actions:H,settingsContent:T,filterContent:F}),e.jsxs("div",{className:"relative flex-1 min-h-0",children:[e.jsx("div",{ref:G,className:u.cn("h-full border rounded-lg bg-white overflow-x-auto",p?.viewContainer),children:q()}),g&&e.jsx("div",{className:"inno-calendar-loading-overlay",children:e.jsx("div",{className:"inno-calendar-spinner"})}),K&&e.jsx("button",{type:"button",onClick:ee,className:"inno-scroll-right-btn","aria-label":"Scroll right",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("title",{children:"Scroll right"}),e.jsx("path",{d:"m9 18 6-6-6-6"})]})})]})]})})}function mt({events:t,users:s=[],scheduleTypes:n=[],initialView:r="week",initialDate:i,initialSelectedUserId:a,initialScheduleTypeIds:m,initialParticipantIds:h,initialWorkingHoursView:l,initialSearchQuery:g,preferencesConfig:b,onEventClick:p,onSlotClick:T,onSlotSelect:F,onAddEvent:H,onEventDrop:D,onDateChange:E,onViewChange:L,className:v,showHeader:I=!0,minSelectionMinutes:C=30,showMoreMode:P,showMoreEventsInPopover:V=!1,isLoading:U=!1,renderPopover:B,slots:_,classNames:W,settingsContent:R,filterContent:Y,headerActions:x,focusEventId:o},d){return e.jsx(le.DragDropProvider,{...D&&{onEventDrop:D},children:e.jsx(le.InnoCalendarProvider,{initialEvents:t,initialUsers:s,initialScheduleTypes:n,initialView:r,...i&&{initialDate:i},...a&&{initialSelectedUserId:a},...m&&{initialScheduleTypeIds:m},...h&&{initialParticipantIds:h},...l&&{initialWorkingHoursView:l},...g&&{initialSearchQuery:g},...b&&{preferencesConfig:b},...E&&{onDateChange:E},...L&&{onViewChange:L},...o&&{initialFocusEventId:o},children:e.jsx(ht,{...p&&{onEventClick:p},...T&&{onSlotClick:T},...F&&{onSlotSelect:F},...H&&{onAddEvent:H},...B&&{renderPopover:B},className:v,showHeader:I,minSelectionMinutes:C,...P&&{showMoreMode:P},showMoreEventsInPopover:V,isLoading:U,..._&&{slots:_},...W&&{classNames:W},settingsContent:R,filterContent:Y,headerActions:x,calendarRef:d})})})}const ft=w.forwardRef(mt),X=w.forwardRef(({className:t,children:s,...n},r)=>e.jsx("select",{ref:r,className:u.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),...n,children:s}));X.displayName="Select";const J=w.forwardRef(({className:t,...s},n)=>e.jsx("label",{ref:n,className:u.cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t),...s}));J.displayName="Label";function gt({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 pt({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 jt=[{value:15,label:"15 minutes"},{value:30,label:"30 minutes"},{value:60,label:"1 hour"}];function vt({value:t,onChange:s,isLocked:n=!1,className:r,labels:i={}}){const a={title:"Slot duration",lockedMessage:"This setting is locked by the administrator",infoMessage:"Set the time slot duration for day and week calendar views.",...i},m=h=>{n||s(Number(h.target.value))};return e.jsxs("div",{className:u.cn("flex flex-col gap-3",r),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"text-sm font-semibold",children:a.title}),n?e.jsx(f.TooltipProvider,{delayDuration:100,children:e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{children:e.jsx(pt,{className:"size-3 text-muted-foreground"})}),e.jsx(f.TooltipContent,{children:e.jsx("p",{children:a.lockedMessage})})]})}):e.jsx(f.TooltipProvider,{delayDuration:100,children:e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{children:e.jsx(gt,{className:"size-3 text-muted-foreground"})}),e.jsx(f.TooltipContent,{className:"max-w-64 text-center",children:e.jsx("p",{children:a.infoMessage})})]})})]}),e.jsx(X,{value:t.toString(),onChange:m,disabled:n,className:"h-9 w-[128px] text-sm",children:jt.map(h=>e.jsx("option",{value:h.value.toString(),children:h.label},h.value))})]})}function wt({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 bt({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 yt=[{value:"dot",label:"Dot indicator"},{value:"colored",label:"Full color"},{value:"mixed",label:"Mixed"}];function kt({value:t,onChange:s,isLocked:n=!1,className:r,labels:i={}}){const a={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"},...i},m=l=>a.options?.[l]??l,h=l=>{n||s(l.target.value)};return e.jsxs("div",{className:u.cn("flex flex-col gap-3",r),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"text-sm font-semibold",children:a.title}),n?e.jsx(f.TooltipProvider,{delayDuration:100,children:e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{children:e.jsx(bt,{className:"size-3 text-muted-foreground"})}),e.jsx(f.TooltipContent,{children:e.jsx("p",{children:a.lockedMessage})})]})}):e.jsx(f.TooltipProvider,{delayDuration:100,children:e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{children:e.jsx(wt,{className:"size-3 text-muted-foreground"})}),e.jsx(f.TooltipContent,{className:"max-w-64 text-center",children:e.jsx("p",{children:a.infoMessage})})]})})]}),e.jsx(X,{value:t,onChange:h,disabled:n,className:"h-9 w-[128px] text-sm",children:yt.map(l=>e.jsx("option",{value:l.value,children:m(l.value)},l.value))})]})}function Nt({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 Ct({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 Dt(){return Array.from({length:25},(t,s)=>({value:s,label:`${String(s).padStart(2,"0")}:00`}))}function Mt({value:t,onChange:s,isLocked:n=!1,className:r,labels:i={}}){const a={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.",...i},m=Dt(),h=g=>{if(n)return;const b=Number(g.target.value);b<t.endHour&&s({...t,startHour:b})},l=g=>{if(n)return;const b=Number(g.target.value);b>t.startHour&&s({...t,endHour:b})};return e.jsxs("div",{className:u.cn("flex flex-col gap-3",r),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"text-sm font-semibold",children:a.title}),n?e.jsx(f.TooltipProvider,{delayDuration:100,children:e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{children:e.jsx(Ct,{className:"size-3 text-muted-foreground"})}),e.jsx(f.TooltipContent,{children:e.jsx("p",{children:a.lockedMessage})})]})}):e.jsx(f.TooltipProvider,{delayDuration:100,children:e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{children:e.jsx(Nt,{className:"size-3 text-muted-foreground"})}),e.jsx(f.TooltipContent,{className:"max-w-64 text-center",children:e.jsx("p",{children:a.infoMessage})})]})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(J,{className:"text-xs text-muted-foreground",children:a.from}),e.jsx(X,{value:t.startHour.toString(),onChange:h,disabled:n,className:"h-9 w-[88px] text-sm",children:m.map(g=>e.jsx("option",{value:g.value.toString(),disabled:g.value>=t.endHour,children:g.label},g.value))})]}),e.jsx("span",{className:"mt-5 text-muted-foreground",children:"—"}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(J,{className:"text-xs text-muted-foreground",children:a.to}),e.jsx(X,{value:t.endHour.toString(),onChange:l,disabled:n,className:"h-9 w-[88px] text-sm",children:m.map(g=>e.jsx("option",{value:g.value.toString(),disabled:g.value<=t.startHour,children:g.label},g.value))})]})]})]})}function Tt({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 St({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 Et({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 zt=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function Ht(){return Array.from({length:25},(t,s)=>({value:s,label:`${String(s).padStart(2,"0")}:00`}))}const ke={sunday:"Sun",monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat"};function Lt({dayLabel:t,config:s,onChange:n,disabled:r,hourOptions:i}){const a=()=>{r||n({...s,enabled:!s.enabled})},m=l=>{if(r)return;const g=Number(l.target.value);g<s.to&&n({...s,from:g})},h=l=>{if(r)return;const g=Number(l.target.value);g>s.from&&n({...s,to:g})};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",role:"checkbox","aria-checked":s.enabled,"aria-label":`Enable ${t}`,onClick:a,disabled:r,className:u.cn("flex size-5 shrink-0 items-center justify-center rounded border transition-colors",s.enabled?"border-primary bg-primary text-primary-foreground":"border-input bg-background",r&&"cursor-not-allowed opacity-50"),children:s.enabled&&e.jsx(Et,{className:"size-3"})}),e.jsx("span",{className:u.cn("w-10 text-sm",!s.enabled&&"text-muted-foreground"),children:t}),e.jsx(X,{value:s.from.toString(),onChange:m,disabled:r||!s.enabled,className:"h-8 w-[76px] text-xs",children:i.map(l=>e.jsx("option",{value:l.value.toString(),disabled:l.value>=s.to,children:l.label},l.value))}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}),e.jsx(X,{value:s.to.toString(),onChange:h,disabled:r||!s.enabled,className:"h-8 w-[76px] text-xs",children:i.map(l=>e.jsx("option",{value:l.value.toString(),disabled:l.value<=s.from,children:l.label},l.value))})]})}function It({value:t,onChange:s,isLocked:n=!1,className:r,labels:i={}}){const a={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:ke,...i},m=Ht(),h=(l,g)=>{n||s({...t,[l]:g})};return e.jsxs("div",{className:u.cn("flex flex-col gap-3",r),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"text-sm font-semibold",children:a.title}),n?e.jsx(f.TooltipProvider,{delayDuration:100,children:e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{children:e.jsx(St,{className:"size-3 text-muted-foreground"})}),e.jsx(f.TooltipContent,{children:e.jsx("p",{children:a.lockedMessage})})]})}):e.jsx(f.TooltipProvider,{delayDuration:100,children:e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{children:e.jsx(Tt,{className:"size-3 text-muted-foreground"})}),e.jsx(f.TooltipContent,{className:"max-w-64 text-center",children:e.jsx("p",{children:a.infoMessage})})]})})]}),e.jsx("div",{className:"flex flex-col gap-2",children:zt.map(l=>e.jsx(Lt,{dayLabel:a.days?.[l]??ke[l],config:t[l],onChange:g=>h(l,g),disabled:n,hourOptions:m},l))})]})}const Wt={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 ue({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 Ft({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 At({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 xe({checked:t,onCheckedChange:s,className:n,children:r}){return e.jsx("button",{type:"button",role:"checkbox","aria-checked":t,onClick:()=>s(!t),className:n,children:r})}function Pt({src:t,alt:s,fallback:n,className:r}){const[i,a]=w.useState(!1);return!t||i?e.jsx("div",{className:u.cn("flex items-center justify-center bg-zinc-200 text-zinc-600 font-medium text-sm",r),children:n||"?"}):e.jsx("img",{src:t,alt:s||"",className:u.cn("object-cover",r),onError:()=>a(!0)})}function Ne({value:t,onChange:s,placeholder:n,className:r}){return e.jsxs("div",{className:u.cn("relative",r),children:[e.jsx(Ft,{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:i=>s(i.target.value),placeholder:n,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 Ce(t,s,n,r=.3){if(!s.trim())return t;const i=s.toLowerCase();return t.filter(a=>n(a).some(h=>h?h.toLowerCase().includes(i):!1))}const Bt={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 Ot({scheduleTypes:t,users:s,selectedScheduleTypeIds:n,onScheduleTypeChange:r,selectedUserIds:i,onUserChange:a,onClearAll:m,className:h,scheduleTypesLoading:l=!1,usersLoading:g=!1,labels:b,getScheduleTypeName:p}){const T={...Bt,...b},[F,H]=w.useState(""),[D,E]=w.useState(""),L=w.useMemo(()=>F.trim()?Ce(t,F,x=>[x.name,p?.(x)||x.name]):t,[t,F,p]),v=w.useMemo(()=>D.trim()?Ce(s,D,x=>[x.name,x.email||""]):s,[s,D]),I=L.length>0&&L.every(x=>n.includes(x.id)),C=v.length>0&&v.every(x=>i.includes(x.id)),P=n.length+i.length,V=(x,o)=>{const d=o?[...n,x]:n.filter(j=>j!==x);r(d)},U=()=>{if(I){const x=new Set(L.map(o=>o.id));r(n.filter(o=>!x.has(o)))}else{const x=new Set([...n,...L.map(o=>o.id)]);r(Array.from(x))}},B=(x,o)=>{const d=o?[...i,x]:i.filter(j=>j!==x);a(d)},_=()=>{if(C){const x=new Set(v.map(o=>o.id));a(i.filter(o=>!x.has(o)))}else{const x=new Set([...i,...v.map(o=>o.id)]);a(Array.from(x))}},W=()=>{r([]),a([]),m?.()},R=x=>p?p(x):x.name,Y=x=>x.colorHex||x.color||"#069AD7";return e.jsxs("div",{className:u.cn("flex min-w-72 max-w-72 flex-col rounded-lg border bg-white shadow-sm",h),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:T.title}),e.jsx("p",{className:"text-xs text-muted-foreground",children:T.subtitle})]}),P>0&&e.jsxs("button",{type:"button",onClick:W,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(At,{className:"h-3.5 w-3.5"}),T.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:T.scheduleTypes}),e.jsx("button",{type:"button",onClick:U,className:"text-xs font-medium text-primary transition-colors hover:text-primary/80",children:I?T.unselectAll:T.selectAll})]}),t.length>6&&e.jsx("div",{className:"px-4 pb-3",children:e.jsx(Ne,{value:F,onChange:H,placeholder:T.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((x,o)=>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-${o}`)):L.map(x=>{const o=n.includes(x.id),d=Y(x);return e.jsxs(xe,{checked:o,onCheckedChange:j=>V(x.id,j),className:u.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",o&&"border-primary bg-primary/5"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:u.cn("flex h-4 w-4 items-center justify-center rounded border border-border text-xs transition-colors",o&&"border-primary bg-primary text-primary-foreground"),children:o&&e.jsx(ue,{className:"h-3 w-3"})}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:R(x)})]}),e.jsx("div",{className:"h-4 w-4 rounded-full border",style:{backgroundColor:d,borderColor:d}})]},x.id)}),!l&&L.length===0&&e.jsx("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:T.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:T.participants}),e.jsx(xe,{checked:C,onCheckedChange:()=>_(),className:u.cn("flex h-5 w-5 items-center justify-center rounded border border-border bg-white transition-colors hover:border-primary/50",C&&"border-primary bg-primary text-primary-foreground"),children:C&&e.jsx(ue,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"px-4 pb-3",children:e.jsx(Ne,{value:D,onChange:E,placeholder:T.searchParticipants})}),e.jsxs("div",{className:"flex max-h-[400px] flex-col gap-2 overflow-y-auto px-4 pb-4 scrollbar-thin",children:[g?Array.from({length:4}).map((x,o)=>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-${o}`)):v.map(x=>{const o=i.includes(x.id);return e.jsxs(xe,{checked:o,onCheckedChange:d=>B(x.id,d),className:u.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",o&&"border-primary bg-zinc-50"),children:[e.jsx("span",{className:u.cn("flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border border-border transition-colors",o&&"border-primary bg-primary text-primary-foreground"),children:o&&e.jsx(ue,{className:"h-2.5 w-2.5"})}),e.jsxs("div",{className:"flex flex-1 items-start gap-2",children:[e.jsx(Pt,{src:x.avatar??null,alt:x.name,fallback:x.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:x.name}),e.jsx("span",{className:"truncate text-[11px] text-muted-foreground",title:x.email,children:x.email})]})]})]},x.id)}),!g&&v.length===0&&e.jsx("p",{className:"px-4 text-xs text-muted-foreground",children:T.noParticipants})]})]})]})}function _t({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 $t({scheduleTypes:t,value:s,onChange:n,allLabel:r="All types",className:i,label:a}){const m=l=>{n(l.target.value)},h=t.find(l=>String(l.id)===s);return e.jsxs("div",{className:u.cn("flex flex-col gap-1",i),children:[a&&e.jsx(J,{className:"text-xs text-muted-foreground",children:a}),e.jsxs("div",{className:"relative",children:[h?e.jsx("span",{className:"pointer-events-none absolute left-2.5 top-1/2 size-3 -translate-y-1/2 rounded-full",style:{backgroundColor:h.color}}):e.jsx(_t,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsxs(X,{value:s,onChange:m,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 Rt({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 Vt({users:t,value:s,onChange:n,allLabel:r="All users",className:i,label:a}){const m=h=>{n(h.target.value)};return e.jsxs("div",{className:u.cn("flex flex-col gap-1",i),children:[a&&e.jsx(J,{className:"text-xs text-muted-foreground",children:a}),e.jsxs("div",{className:"relative",children:[e.jsx(Rt,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsxs(X,{value:s,onChange:m,className:"h-9 w-full min-w-[120px] pl-8 pr-8 text-sm",children:[e.jsx("option",{value:"all",children:r}),t.map(h=>e.jsx("option",{value:h.id,children:h.name},h.id))]})]})]})}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: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 Yt({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 Gt({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 qt({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 Kt(t){const s=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${s}-${n}-${r}`}function De(t){const s=t.getHours(),n=t.getMinutes(),r=s>=12?"PM":"AM",i=s%12||12,a=String(n).padStart(2,"0");return`${i}:${a} ${r}`}function Jt(t){const s=De(t.startDate),n=De(t.endDate);return`${s} - ${n}`}function Xt(t){const s=A.addDays(new Date,1);return t.getFullYear()===s.getFullYear()&&t.getMonth()===s.getMonth()&&t.getDate()===s.getDate()}function Qt(t){if(A.isToday(t))return"Today";if(Xt(t))return"Tomorrow";const s=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r=s[t.getDay()],i=n[t.getMonth()],a=t.getDate();return`${r}, ${i} ${a}`}function Zt(t,s){const n=new Map;for(const r of t){const i=Kt(r.startDate),a=n.get(i)??[];a.push(r),n.set(i,a)}return Array.from(n.entries()).map(([r,i])=>{const a=[...i].sort((h,l)=>h.startDate.getTime()-l.startDate.getTime()),m=s>0?a.slice(0,s):a;return{date:new Date(r),dateKey:r,events:m,hasMore:s>0&&a.length>s}}).sort((r,i)=>r.date.getTime()-i.date.getTime())}function es(t){const s=A.startOfDay(new Date),n=A.endOfDay(new Date);return t.filter(r=>r.startDate>=s&&r.startDate<=n).length}function he({className:t}){return e.jsx("div",{className:u.cn("animate-pulse rounded-md bg-muted",t)})}function ts({event:t,onClick:s}){return e.jsxs("button",{type:"button",onClick:()=>s?.(t),className:u.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:Jt(t)})]}),s&&e.jsx(Gt,{className:"shrink-0 size-4 text-muted-foreground/50 mt-1"})]})}function ss({group:t,onEventClick:s}){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:u.cn("text-xs font-semibold",A.isToday(t.date)&&"text-primary"),children:Qt(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(n=>e.jsx(ts,{event:n,onClick:s},n.id))})]})}function ns({events:t,isLoading:s=!1,className:n,daysAhead:r=7,maxEventsPerDay:i=3,onEventClick:a,onNavigateToAgenda:m}){const[h,l]=w.useState(!1),g=w.useMemo(()=>{const H=A.startOfDay(new Date),D=A.addDays(H,r);return t.filter(E=>E.endDate>=H&&E.startDate<D)},[t,r]),b=w.useMemo(()=>Zt(g,i),[g,i]),p=w.useMemo(()=>es(t),[t]),T=H=>{l(!1),a?.(H)},F=()=>{l(!1),m?.()};return e.jsxs(f.Popover,{open:h,onOpenChange:l,children:[e.jsxs(f.PopoverTrigger,{className:u.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",n),children:[e.jsx(Ut,{className:"h-4 w-4"}),p>0&&e.jsx(f.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:p>99?"99+":p})]}),e.jsxs(f.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:p>0?`${p} event${p>1?"s":""} today`:"No events today"})]}),m&&e.jsxs("button",{type:"button",onClick:F,className:"text-xs text-primary hover:underline flex items-center gap-1",children:["View all",e.jsx(qt,{className:"size-3"})]})]}),e.jsx("div",{className:"max-h-80 overflow-y-auto p-2",children:s?e.jsx("div",{className:"space-y-2 p-2",children:Array.from({length:3}).map((H,D)=>e.jsxs("div",{className:"flex space-x-3",children:[e.jsx(he,{className:"h-2 w-2 rounded-full mt-2"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(he,{className:"h-4 w-full"}),e.jsx(he,{className:"h-3 w-3/4"})]})]},D))}):b.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(Yt,{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:b.map(H=>e.jsx(ss,{group:H,onEventClick:T},H.dateKey))})})]})]})}function rs({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 Ee({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 os(t){const s=new Date;return s.setDate(s.getDate()+1),t.getFullYear()===s.getFullYear()&&t.getMonth()===s.getMonth()&&t.getDate()===s.getDate()}function Me(t){const s=t.getHours(),n=t.getMinutes(),r=s>=12?"PM":"AM";return`${s%12||12}:${n.toString().padStart(2,"0")} ${r}`}function is(t){return new Intl.DateTimeFormat("en-US",{weekday:"long",month:"short",day:"numeric"}).format(t)}function as(t){const s=Me(t.startDate),n=Me(t.endDate);return`${s} - ${n}`}function ls(t){return A.isToday(t)?"Today":os(t)?"Tomorrow":is(t)}function cs(t,s){const n=new Map;for(const r of t){const i=A.formatDateISO(r.startDate),a=n.get(i)??[];a.push(r),n.set(i,a)}return Array.from(n.entries()).map(([r,i])=>{const a=[...i].sort((h,l)=>h.startDate.getTime()-l.startDate.getTime()),m=s>0?a.slice(0,s):a;return{date:new Date(r),dateKey:r,events:m,hasMore:s>0&&a.length>s}}).sort((r,i)=>r.date.getTime()-i.date.getTime())}function ds({event:t,onClick:s,compact:n}){return e.jsxs("button",{type:"button",onClick:()=>s?.(t),className:u.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",n?"p-2":"p-3"),children:[e.jsx("div",{className:u.cn("shrink-0 rounded-full mt-1",n?"size-2":"size-2.5"),style:{backgroundColor:t.color??"#3b82f6"}}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:u.cn("font-medium truncate",n?"text-xs":"text-sm"),children:t.title}),e.jsx("p",{className:u.cn("text-muted-foreground truncate",n?"text-[10px]":"text-xs"),children:as(t)})]}),s&&e.jsx(Ee,{className:u.cn("shrink-0 text-muted-foreground/50",n?"size-3":"size-4")})]})}function us({group:t,onEventClick:s,onViewMore:n,compact:r}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:u.cn("flex items-center justify-between px-2",r?"py-1":"py-1.5"),children:[e.jsx("h3",{className:u.cn("font-semibold",r?"text-xs":"text-sm",A.isToday(t.date)&&"text-primary"),children:ls(t.date)}),t.hasMore&&n&&e.jsx("button",{type:"button",onClick:()=>n(t.date),className:u.cn("text-primary hover:underline",r?"text-[10px]":"text-xs"),children:"+more"})]}),e.jsx("div",{className:"space-y-0.5",children:t.events.map(i=>e.jsx(ds,{event:i,onClick:s,compact:r},i.id))})]})}function xs({events:t,daysAhead:s=7,maxEventsPerDay:n=3,onEventClick:r,onViewAll:i,className:a,emptyState:m,title:h="Upcoming",showHeader:l=!0,compact:g=!1}){const b=ie.useOptionalCalendarContext(),p=b?.filteredEvents,T=b?.currentDate??new Date,F=t??p??[],H=w.useMemo(()=>{const L=A.startOfDay(T),v=new Date(L);return v.setDate(v.getDate()+s),F.filter(I=>I.endDate>=L&&I.startDate<v)},[F,s,T]),D=w.useMemo(()=>cs(H,n),[H,n]),E=H.length;return D.length===0?e.jsxs("div",{className:u.cn("rounded-lg border bg-card",a),children:[l&&e.jsx("div",{className:u.cn("border-b px-4 flex items-center justify-between",g?"py-2":"py-3"),children:e.jsx("h2",{className:u.cn("font-semibold",g?"text-sm":"text-base"),children:h})}),e.jsx("div",{className:u.cn("flex flex-col items-center justify-center text-center",g?"py-6 px-4":"py-10 px-6"),children:m??e.jsxs(e.Fragment,{children:[e.jsx(rs,{className:u.cn("text-muted-foreground/50 mb-2",g?"size-8":"size-10")}),e.jsx("p",{className:u.cn("text-muted-foreground",g?"text-xs":"text-sm"),children:"No upcoming events"})]})})]}):e.jsxs("div",{className:u.cn("rounded-lg border bg-card overflow-hidden",a),children:[l&&e.jsxs("div",{className:u.cn("border-b px-4 flex items-center justify-between",g?"py-2":"py-3"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:u.cn("font-semibold",g?"text-sm":"text-base"),children:h}),e.jsx("span",{className:u.cn("text-muted-foreground bg-muted rounded-full px-2",g?"text-[10px] py-0":"text-xs py-0.5"),children:E})]}),i&&e.jsxs("button",{type:"button",onClick:()=>i(),className:u.cn("text-primary hover:underline flex items-center gap-0.5",g?"text-xs":"text-sm"),children:["View all",e.jsx(Ee,{className:"size-3"})]})]}),e.jsx("div",{className:u.cn("divide-y overflow-auto",g?"p-2 max-h-[280px]":"p-3 max-h-[400px]"),children:D.map(L=>e.jsx(us,{group:L,onEventClick:r,onViewMore:i?v=>i(v):void 0,compact:g},L.dateKey))})]})}exports.AgendaDropdown=ns;exports.AgendaWidget=xs;exports.BadgeVariantSetting=kt;exports.Calendar=Ie;exports.CalendarFilterSidebar=Ot;exports.DEFAULT_WEEK_WORKING_HOURS=Wt;exports.EventPopover=Xe;exports.InnoCalendar=ft;exports.ScheduleTypeFilter=$t;exports.SlotDurationSetting=vt;exports.TimelineView=se;exports.UserFilter=Vt;exports.VisibleHoursSetting=Mt;exports.WorkingHoursSetting=It;exports.YearView=Se;
2
+ //# sourceMappingURL=agenda-widget-B-AVTnqM.cjs.map