@innosolutions/inno-calendar 1.0.35 → 1.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/AGENT.md +36 -1
  2. package/dist/agenda-widget-BsRtRyZ3.cjs +2 -0
  3. package/dist/agenda-widget-BsRtRyZ3.cjs.map +1 -0
  4. package/dist/{agenda-widget-CyRPG-1p.js → agenda-widget-CNUXKiQT.js} +723 -745
  5. package/dist/agenda-widget-CNUXKiQT.js.map +1 -0
  6. package/dist/components/event/event-card.d.ts +16 -1
  7. package/dist/components/event/event-card.d.ts.map +1 -1
  8. package/dist/components/event/event-page-transition.d.ts +32 -0
  9. package/dist/components/event/event-page-transition.d.ts.map +1 -0
  10. package/dist/components/index.cjs +1 -1
  11. package/dist/components/index.d.ts +1 -1
  12. package/dist/components/index.d.ts.map +1 -1
  13. package/dist/components/index.mjs +27 -26
  14. package/dist/components/inno-calendar.d.ts.map +1 -1
  15. package/dist/components/primitives/multi-day-banner.d.ts.map +1 -1
  16. package/dist/components/views/day-events-expansion.d.ts +51 -0
  17. package/dist/components/views/day-events-expansion.d.ts.map +1 -0
  18. package/dist/components/views/index.d.ts +1 -0
  19. package/dist/components/views/index.d.ts.map +1 -1
  20. package/dist/components/views/month-view.d.ts +14 -3
  21. package/dist/components/views/month-view.d.ts.map +1 -1
  22. package/dist/components/views/timeline-view.d.ts.map +1 -1
  23. package/dist/core/index.cjs +1 -1
  24. package/dist/core/index.mjs +139 -136
  25. package/dist/core/utils/date-utils.d.ts +31 -1
  26. package/dist/core/utils/date-utils.d.ts.map +1 -1
  27. package/dist/core/utils/event-utils.d.ts +40 -0
  28. package/dist/core/utils/event-utils.d.ts.map +1 -1
  29. package/dist/core/utils/position-utils.d.ts +5 -1
  30. package/dist/core/utils/position-utils.d.ts.map +1 -1
  31. package/dist/index.cjs +1 -1
  32. package/dist/index.mjs +190 -186
  33. package/dist/presets/index.cjs +1 -1
  34. package/dist/presets/index.mjs +1 -1
  35. package/dist/styles/index.css +1 -1
  36. package/dist/{tailwind-calendar-BaJAw6io.cjs → tailwind-calendar-BqhSHRk0.cjs} +2 -2
  37. package/dist/{tailwind-calendar-BaJAw6io.cjs.map → tailwind-calendar-BqhSHRk0.cjs.map} +1 -1
  38. package/dist/{tailwind-calendar-D-8ALvNh.js → tailwind-calendar-BvWm9ry9.js} +16 -16
  39. package/dist/{tailwind-calendar-D-8ALvNh.js.map → tailwind-calendar-BvWm9ry9.js.map} +1 -1
  40. package/dist/utils.cjs +1 -1
  41. package/dist/utils.cjs.map +1 -1
  42. package/dist/utils.mjs +380 -335
  43. package/dist/utils.mjs.map +1 -1
  44. package/dist/week-view-BGthazCB.js +3015 -0
  45. package/dist/week-view-BGthazCB.js.map +1 -0
  46. package/dist/week-view-DOvr2VIq.cjs +11 -0
  47. package/dist/week-view-DOvr2VIq.cjs.map +1 -0
  48. package/package.json +1 -1
  49. package/dist/agenda-widget-CuQxfYVI.cjs +0 -2
  50. package/dist/agenda-widget-CuQxfYVI.cjs.map +0 -1
  51. package/dist/agenda-widget-CyRPG-1p.js.map +0 -1
  52. package/dist/week-view-5nw-Hvod.js +0 -2754
  53. package/dist/week-view-5nw-Hvod.js.map +0 -1
  54. package/dist/week-view-C0iWG7_6.cjs +0 -11
  55. package/dist/week-view-C0iWG7_6.cjs.map +0 -1
@@ -1,11 +0,0 @@
1
- "use strict";const e=require("react/jsx-runtime"),l=require("react"),i=require("./index-D2U2F80P.cjs"),Je=require("@radix-ui/react-dropdown-menu"),M=require("./utils.cjs"),le=require("./slot-selection-context-Bx3FKJfR.cjs"),Ze=require("@radix-ui/react-popover"),Qe=require("@radix-ui/react-tooltip");function we(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(n,s,r.get?r:{enumerable:!0,get:()=>t[s]})}}return n.default=t,Object.freeze(n)}const K=we(l),H=we(Je),ie=we(Ze),xe=we(Qe),ee=ie.Root,te=ie.Trigger,et=ie.Anchor,X=K.forwardRef(({className:t,align:n="center",sideOffset:s=4,...r},c)=>e.jsx(ie.Portal,{children:e.jsx(ie.Content,{ref:c,align:n,sideOffset:s,className:i.cn("z-50 w-72 rounded-xl border bg-white text-popover-foreground outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));X.displayName=ie.Content.displayName;const tt=xe.Provider,ne=xe.Root,se=xe.Trigger,Q=K.forwardRef(({className:t,sideOffset:n=4,...s},r)=>e.jsx(xe.Content,{ref:r,sideOffset:n,className:i.cn("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s}));Q.displayName=xe.Content.displayName;function ce(t){return{blue:{bg:"bg-blue-50 dark:bg-blue-950/30",text:"text-blue-700 dark:text-blue-300",dot:"bg-blue-500",dotFill:"fill-blue-600 dark:fill-blue-500",border:"border-blue-400 dark:border-blue-600"},green:{bg:"bg-green-50 dark:bg-green-950/30",text:"text-green-700 dark:text-green-300",dot:"bg-green-500",dotFill:"fill-green-600 dark:fill-green-500",border:"border-green-400 dark:border-green-600"},red:{bg:"bg-red-50 dark:bg-red-950/30",text:"text-red-700 dark:text-red-300",dot:"bg-red-500",dotFill:"fill-red-600 dark:fill-red-500",border:"border-red-400 dark:border-red-600"},yellow:{bg:"bg-yellow-50 dark:bg-yellow-950/30",text:"text-yellow-700 dark:text-yellow-300",dot:"bg-yellow-500",dotFill:"fill-yellow-600 dark:fill-yellow-500",border:"border-yellow-400 dark:border-yellow-600"},purple:{bg:"bg-purple-50 dark:bg-purple-950/30",text:"text-purple-700 dark:text-purple-300",dot:"bg-purple-500",dotFill:"fill-purple-600 dark:fill-purple-500",border:"border-purple-400 dark:border-purple-600"},orange:{bg:"bg-orange-50 dark:bg-orange-950/30",text:"text-orange-700 dark:text-orange-300",dot:"bg-orange-500",dotFill:"fill-orange-600 dark:fill-orange-500",border:"border-orange-400 dark:border-orange-600"},pink:{bg:"bg-pink-50 dark:bg-pink-950/30",text:"text-pink-700 dark:text-pink-300",dot:"bg-pink-500",dotFill:"fill-pink-600 dark:fill-pink-500",border:"border-pink-400 dark:border-pink-600"},teal:{bg:"bg-teal-50 dark:bg-teal-950/30",text:"text-teal-700 dark:text-teal-300",dot:"bg-teal-500",dotFill:"fill-teal-600 dark:fill-teal-500",border:"border-teal-400 dark:border-teal-600"},gray:{bg:"bg-gray-50 dark:bg-gray-950/30",text:"text-gray-700 dark:text-gray-300",dot:"bg-gray-500",dotFill:"fill-gray-600 dark:fill-gray-500",border:"border-gray-400 dark:border-gray-600"},indigo:{bg:"bg-indigo-50 dark:bg-indigo-950/30",text:"text-indigo-700 dark:text-indigo-300",dot:"bg-indigo-500",dotFill:"fill-indigo-600 dark:fill-indigo-500",border:"border-indigo-400 dark:border-indigo-600"}}[t??"blue"]}function ge(t){return t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}function Z(t,n){return`${ge(t)} - ${ge(n)}`}function Se(t){const n=new Date(t);return n.setHours(0,0,0,0),n}function be({event:t,variant:n="full",badgeVariant:s="colored",onClick:r,className:c,showTime:f=!0,showDescription:d=!1,showParticipants:b=!1,style:T,disablePopover:h=!1,renderPopover:y,enableDrag:z=!1}){const o=ce(t.color),[w,m]=l.useState(!1),[j,E]=l.useState(!1),L=le.useOptionalDragDrop(),N=t.endDate<Se(new Date),g=t.isCanceled??!1,O=z&&L&&!g&&!N,A=t.data,I=A?.meetingTookPlace??t.meetingTookPlace??!1,_=g?e.jsx(st,{className:"h-3 w-3 text-zinc-800 dark:text-zinc-200"}):I?e.jsx(nt,{className:i.cn("h-3 w-3",o.text)}):null,V=t.scheduleTypeName||A?.scheduleTypeName||A?.typeName,u=A?.productName,k=A?.nrParticipant,$=A?.siteName,x=A?.siteCity,W=[$,x].filter(Boolean).join(", "),P=l.useCallback(()=>{j||(h&&r?r(t):h||m(!0))},[j,h,r,t]),v=l.useCallback(()=>{m(!1)},[]),F=l.useCallback(p=>{O&&(p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",t.id),E(!0),L?.startDrag?.(t))},[O,t,L]),D=l.useCallback(()=>{E(!1),L?.isDragging&&L.endDrag?.()},[L]);if(n==="dot"){const p=e.jsx("button",{type:"button",onClick:P,className:i.cn("size-2 rounded-full cursor-pointer transition-opacity",N?"bg-gray-400":o.dot,t.isCanceled&&"opacity-50",c),style:T,"aria-label":t.title});return h?e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:p}),e.jsx(Q,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"font-medium",children:t.title}),e.jsx("div",{className:"text-xs opacity-80",children:Z(t.startDate,t.endDate)})]})})]}):e.jsxs(ee,{open:w,onOpenChange:m,children:[e.jsx(te,{asChild:!0,children:e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:p}),e.jsx(Q,{children:e.jsx("div",{className:"font-medium",children:t.title})})]})}),e.jsx(X,{className:"w-80",children:y?y({event:t,onClose:v}):e.jsx(ue,{event:t,onClose:v})})]})}if(n==="compact"){const p=e.jsxs("div",{role:"button",tabIndex:0,draggable:!!O,onDragStart:F,onDragEnd:D,onClick:h?P:void 0,onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),P())},className:i.cn("group flex w-full relative items-center shadow-[0_0_1px_rgba(0,0,0,0.3)] gap-0 rounded px-1.5 py-1 text-left text-xs transition-colors hover:opacity-80",O?"cursor-grab active:cursor-grabbing":"cursor-pointer",j&&"opacity-50",g||N?"bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 line-through":[s==="colored"&&[o.bg,o.text],s==="mixed"&&[o.bg,o.text],s==="dot"&&"bg-muted/50"],c),style:T,children:[["dot","mixed"].includes(s)&&!N&&e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",className:"event-dot absolute -top-1 -left-1 shrink-0","aria-hidden":"true",focusable:"false",children:e.jsx("circle",{cx:"4",cy:"4",r:"4",className:o.dotFill})}),e.jsx("span",{className:"flex-1 min-w-0 overflow-hidden",children:e.jsxs("span",{className:"",children:[e.jsx("span",{className:"relative block overflow-hidden whitespace-nowrap text-xs leading-tight",style:{maskImage:"linear-gradient(to right, transparent 0, black 8px, black calc(100% - 8px), transparent 100%)",WebkitMaskImage:"linear-gradient(to right, transparent 0, black 8px, black calc(100% - 8px), transparent 100%)"},children:e.jsxs("span",{className:"inline-flex event-marquee",children:[e.jsx("span",{className:"shrink-0 px-1",children:t.title}),e.jsx("span",{className:"shrink-0 px-1",children:"•"}),e.jsx("span",{"aria-hidden":"true",className:"shrink-0 px-1",children:t.title}),e.jsx("span",{"aria-hidden":"true",className:"shrink-0 px-1",children:"•"})]})}),e.jsx("div",{className:i.cn("w-fit mt-0.5 text-[10px] px-1 py-0.5 border border-dashed rounded-full font-medium",N?"border-zinc-400 dark:border-zinc-600":o.border),children:Z(t.startDate,t.endDate)})]})}),e.jsx("div",{className:"flex gap-0.5",children:_})]});return h?e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:p}),e.jsx(Q,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"font-medium",children:t.title}),e.jsx("div",{className:"text-xs text-muted-foreground tabular-nums",children:Z(t.startDate,t.endDate)})]})})]}):e.jsxs(ee,{open:w,onOpenChange:m,children:[e.jsx(te,{asChild:!0,children:p}),e.jsx(X,{className:"w-80",children:y?y({event:t,onClose:v}):e.jsx(ue,{event:t,onClose:v})})]})}const a=e.jsxs("button",{type:"button",onClick:P,className:i.cn("group relative flex w-full flex-col gap-1 rounded-md border px-2 py-1.5 text-left transition-all hover:shadow-md","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",g||N?"bg-zinc-100 dark:bg-zinc-800 border-zinc-300 dark:border-zinc-700 text-zinc-500 dark:text-zinc-400 line-through":[s==="colored"&&[o.bg,o.border,o.text],s==="mixed"&&[o.bg,o.border,o.text],s==="dot"&&"bg-muted/50 border-border"],c),style:T,children:[e.jsxs("div",{className:"flex items-start justify-between gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[["dot","mixed"].includes(s)&&!N&&!g&&e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",className:"event-dot shrink-0","aria-hidden":"true",focusable:"false",children:e.jsx("circle",{cx:"4",cy:"4",r:"4",className:o.dotFill})}),e.jsxs("span",{className:i.cn("text-sm font-medium truncate",!N&&!g&&s!=="dot"&&o.text,g&&"line-through"),children:[t.title,V&&e.jsxs("span",{className:"font-normal opacity-75",children:[" ","- ",V]})]})]}),_]}),u&&e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:u}),k!=null&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(Ne,{className:"h-3 w-3 shrink-0"}),e.jsxs("span",{children:[k," participant",k!==1?"s":""]})]}),f&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(Me,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{children:Z(t.startDate,t.endDate)})]}),W&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(He,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate",children:W})]}),d&&t.description&&e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:t.description}),b&&t.participants&&t.participants.length>0&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(Ne,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate",children:t.participants.map(p=>p.name).join(", ")})]})]});return h?e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:a}),e.jsx(Q,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"font-medium",children:t.title}),e.jsx("div",{className:"text-xs text-muted-foreground tabular-nums",children:Z(t.startDate,t.endDate)})]})})]}):e.jsxs(ee,{open:w,onOpenChange:m,children:[e.jsx(te,{asChild:!0,children:a}),e.jsx(X,{className:"w-80",children:y?y({event:t,onClose:v}):e.jsx(ue,{event:t,onClose:v})})]})}function Me({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("polyline",{points:"12 6 12 12 16 14"})]})}function nt({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 st({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 Ne({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 He({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 ue({event:t,onClose:n}){const s=ce(t.color),r=t.isCanceled??!1;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:i.cn("size-4 rounded shrink-0 mt-0.5",s.dot)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:i.cn("font-semibold text-lg",r&&"line-through opacity-50"),children:t.title}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground mt-1",children:[e.jsx(Me,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"tabular-nums",children:Z(t.startDate,t.endDate)})]})]})]}),t.description&&e.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.isAllDay&&e.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded-full font-medium",children:"All day"}),t.isRecurring&&e.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded-full font-medium",children:"Recurring"}),r&&e.jsx("span",{className:"text-xs bg-red-100 dark:bg-red-950/30 text-red-700 dark:text-red-300 px-2 py-0.5 rounded-full font-medium",children:"Canceled"})]}),e.jsx("div",{className:"flex justify-end pt-2 border-t",children:e.jsx("button",{type:"button",onClick:n,className:"text-xs text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md hover:bg-muted transition-colors",children:"Close"})})]})}function Te({event:t,position:n,hourHeight:s=96,badgeVariant:r="colored",onClick:c,className:f,disablePopover:d=!1,renderPopover:b,enableDrag:T=!0}){const h=ce(t.color),[y,z]=l.useState(!1),[o,w]=l.useState(!1),m=le.useOptionalDragDrop(),j=(t.endDate.getTime()-t.startDate.getTime())/(1e3*60),E=j/60*s-8,L=t.endDate<Se(new Date),N=t.isCanceled??!1,g=T&&m&&!N&&!L,O=j<35,A=j>25,I=j>=45,_=t.data,V=t.scheduleTypeName||_?.scheduleTypeName||_?.typeName,u=_?.productName,k=_?.nrParticipant,$=_?.siteName,x=_?.siteCity,W=[$,x].filter(Boolean).join(", "),P=r==="dot",v=l.useCallback(()=>{o||(d&&c?c(t):d||z(!0))},[o,d,c,t]),F=l.useCallback(()=>{z(!1)},[]),D=l.useCallback(S=>{if(!g)return;S.dataTransfer.effectAllowed="move",S.dataTransfer.setData("text/plain",t.id);const G=S.currentTarget,B=G.getBoundingClientRect();S.dataTransfer.setDragImage(G,S.clientX-B.left,S.clientY-B.top),w(!0),m?.startDrag?.(t)},[g,t,m]),a=l.useCallback(()=>{w(!1),m?.isDragging&&m.endDrag?.()},[m]),p=l.useCallback(S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),v())},[v]),C=e.jsxs("div",{role:"button",tabIndex:0,draggable:!!g,onDragStart:D,onDragEnd:a,onKeyDown:p,onClick:o?void 0:v,className:i.cn("group flex w-full select-none flex-col gap-0.5 overflow-hidden rounded-md border px-2 py-1.5 text-xs text-left","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","transition-opacity",g?"cursor-grab active:cursor-grabbing":"cursor-pointer",o&&"opacity-50",N||L?"bg-zinc-100 dark:bg-zinc-800 border-zinc-300 dark:border-zinc-700 text-zinc-500 dark:text-zinc-400 line-through":[!P&&[h.bg,h.border,h.text],P&&"bg-neutral-50 dark:bg-neutral-900 border-neutral-200 dark:border-neutral-700"],O&&"py-0 justify-center",f),style:{height:`${Math.max(E,20)}px`},children:[e.jsxs("div",{className:"flex items-start gap-1.5 min-w-0",children:[["mixed","dot"].includes(r)&&!L&&!N&&e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",className:"event-dot shrink-0","aria-hidden":"true",focusable:"false",children:e.jsx("circle",{cx:"4",cy:"4",r:"4",className:h.dotFill})}),e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:e.jsxs("p",{className:i.cn("font-semibold truncate leading-tight",!L&&!N&&P&&"text-foreground"),children:[t.title,V&&e.jsxs("span",{className:"font-normal opacity-75",children:[" ","- ",V]})]})})]}),I&&u&&e.jsx("p",{className:i.cn("text-[11px] truncate leading-tight",P?"text-muted-foreground":"opacity-80"),children:u}),I&&k!=null&&e.jsxs("div",{className:i.cn("flex items-center gap-1 text-[11px] leading-tight",P?"text-muted-foreground":"opacity-80"),children:[e.jsx(Ne,{className:"h-3 w-3 shrink-0"}),e.jsxs("span",{children:[k," participant",k!==1?"s":""]})]}),A&&e.jsxs("div",{className:i.cn("flex items-center gap-1 text-[11px] tabular-nums leading-tight",P?"text-muted-foreground":"opacity-90"),children:[e.jsx(Me,{className:"h-3 w-3 shrink-0"}),e.jsxs("span",{children:[ge(t.startDate)," - ",ge(t.endDate)]})]}),I&&W&&e.jsxs("div",{className:i.cn("flex items-center gap-1 text-[11px] truncate leading-tight",P?"text-muted-foreground":"opacity-80"),children:[e.jsx(He,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate",children:W})]})]}),R=e.jsx(Q,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("div",{className:"font-medium",children:[t.title,V&&e.jsxs("span",{className:"font-normal opacity-75",children:[" ","- ",V]})]}),u&&e.jsx("div",{className:"text-xs text-muted-foreground",children:u}),k!=null&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:[k," participant",k!==1?"s":""]}),e.jsx("div",{className:"text-xs text-muted-foreground tabular-nums",children:Z(t.startDate,t.endDate)}),W&&e.jsx("div",{className:"text-xs text-muted-foreground",children:W})]})});return d?e.jsx("div",{className:"absolute p-0.5",style:{top:`${n.top}px`,left:`${n.left}%`,width:n.minWidth?`max(${n.minWidth}px, ${n.width}%)`:`${n.width}%`,minWidth:n.minWidth?`${n.minWidth}px`:void 0},children:e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:C}),R]})}):e.jsx("div",{className:"absolute p-0.5",style:{top:`${n.top}px`,left:`${n.left}%`,width:n.minWidth?`max(${n.minWidth}px, ${n.width}%)`:`${n.width}%`,minWidth:n.minWidth?`${n.minWidth}px`:void 0},children:e.jsxs(ee,{open:y,onOpenChange:z,children:[e.jsx(te,{asChild:!0,children:C}),e.jsx(X,{className:"w-80",children:b?b({event:t,onClose:F}):e.jsx(ue,{event:t,onClose:F})})]})})}function rt({event:t,spanDays:n,isStart:s,isEnd:r,onClick:c,className:f,disablePopover:d=!1,renderPopover:b}){const T=ce(t.color),[h,y]=l.useState(!1),z=t.endDate<Se(new Date),o=t.isCanceled??!1,w=l.useCallback(()=>{d&&c?c(t):d||y(!0)},[d,c,t]),m=l.useCallback(()=>{y(!1)},[]),j=e.jsx("button",{type:"button",onClick:w,className:i.cn("flex h-5 items-center px-1.5 text-xs font-medium transition-opacity hover:opacity-80",o||z?"bg-zinc-200 dark:bg-zinc-700 text-zinc-500 dark:text-zinc-400 line-through":[T.dot,"text-white"],s&&"rounded-l",r&&"rounded-r",!s&&"border-l-0",!r&&"border-r-0",f),style:{width:`${n*100}%`},children:s&&e.jsx("span",{className:"truncate",children:t.title})}),E=e.jsx(Q,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"font-medium",children:t.title}),e.jsx("div",{className:"text-xs text-muted-foreground tabular-nums",children:Z(t.startDate,t.endDate)})]})});return d?e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:j}),E]}):e.jsxs(ee,{open:h,onOpenChange:y,children:[e.jsx(te,{asChild:!0,children:j}),e.jsx(X,{className:"w-80",children:b?b({event:t,onClose:m}):e.jsx(ue,{event:t,onClose:m})})]})}if(typeof window<"u"&&!document.getElementById("inno-calendar-event-marquee-style")){const t=document.createElement("style");t.id="inno-calendar-event-marquee-style",t.innerHTML=`
2
- @keyframes event-marquee {
3
- 0% { transform: translateX(0); }
4
- 100% { transform: translateX(-50%); }
5
- }
6
- .event-marquee {
7
- animation: event-marquee 28s linear infinite;
8
- will-change: transform;
9
- }
10
- `,document.head.appendChild(t)}const _e=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Pe=i.clsx,Oe=(t,n)=>s=>{var r;if(n?.variants==null)return Pe(t,s?.class,s?.className);const{variants:c,defaultVariants:f}=n,d=Object.keys(c).map(h=>{const y=s?.[h],z=f?.[h];if(y===null)return null;const o=_e(y)||_e(z);return c[h][o]}),b=s&&Object.entries(s).reduce((h,y)=>{let[z,o]=y;return o===void 0||(h[z]=o),h},{}),T=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((h,y)=>{let{class:z,className:o,...w}=y;return Object.entries(w).every(m=>{let[j,E]=m;return Array.isArray(E)?E.includes({...f,...b}[j]):{...f,...b}[j]===E})?[...h,z,o]:h},[]);return Pe(t,d,T,s?.class,s?.className)},Ve=Oe("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input active:!bg-zinc-100 hover:!bg-zinc-50 active:bg-white !bg-white hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),re=l.forwardRef(({className:t,variant:n,size:s,loading:r,disabled:c,children:f,...d},b)=>e.jsxs("button",{className:i.cn(Ve({variant:n,size:s,className:t})),ref:b,disabled:c||r,...d,children:[r&&e.jsxs("svg",{className:"animate-spin -ml-1 mr-2 size-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),f]}));re.displayName="Button";const Fe=(...t)=>t.filter((n,s,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===s).join(" ").trim();const ot=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const at=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,s,r)=>r?r.toUpperCase():s.toLowerCase());const $e=t=>{const n=at(t);return n.charAt(0).toUpperCase()+n.slice(1)};var it={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"};const lt=t=>{for(const n in t)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};const ct=l.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:c="",children:f,iconNode:d,...b},T)=>l.createElement("svg",{ref:T,...it,width:n,height:n,stroke:t,strokeWidth:r?Number(s)*24/Number(n):s,className:Fe("lucide",c),...!f&&!lt(b)&&{"aria-hidden":"true"},...b},[...d.map(([h,y])=>l.createElement(h,y)),...Array.isArray(f)?f:[f]]));const ze=(t,n)=>{const s=l.forwardRef(({className:r,...c},f)=>l.createElement(ct,{ref:f,iconNode:n,className:Fe(`lucide-${ot($e(t))}`,`lucide-${t}`,r),...c}));return s.displayName=$e(t),s};const dt=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ut=ze("check",dt);const xt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],mt=ze("chevron-right",xt);const ht=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],pt=ze("circle",ht),De=H.Root,Ce=H.Trigger,ft=K.forwardRef(({className:t,inset:n,children:s,...r},c)=>e.jsxs(H.SubTrigger,{ref:c,className:i.cn("flex cursor-default select-none items-center rounded-lg px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",n&&"pl-8",t),...r,children:[s,e.jsx(mt,{className:"ml-auto h-4 w-4"})]}));ft.displayName=H.SubTrigger.displayName;const gt=K.forwardRef(({className:t,...n},s)=>e.jsx(H.SubContent,{ref:s,className:i.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));gt.displayName=H.SubContent.displayName;const ye=K.forwardRef(({className:t,sideOffset:n=4,...s},r)=>e.jsx(H.Portal,{children:e.jsx(H.Content,{ref:r,sideOffset:n,className:i.cn("z-50 rounded-xl border bg-popover p-1 text-popover-foreground shadow-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s})}));ye.displayName=H.Content.displayName;const je=K.forwardRef(({className:t,inset:n,...s},r)=>e.jsx(H.Item,{ref:r,className:i.cn("relative flex cursor-pointer select-none items-center rounded-lg px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",t),...s}));je.displayName=H.Item.displayName;const bt=K.forwardRef(({className:t,children:n,checked:s=!1,...r},c)=>e.jsxs(H.CheckboxItem,{ref:c,className:i.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:s,...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(H.ItemIndicator,{children:e.jsx(ut,{className:"h-4 w-4"})})}),n]}));bt.displayName=H.CheckboxItem.displayName;const yt=K.forwardRef(({className:t,children:n,...s},r)=>e.jsxs(H.RadioItem,{ref:r,className:i.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...s,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(H.ItemIndicator,{children:e.jsx(pt,{className:"h-2 w-2 fill-current"})})}),n]}));yt.displayName=H.RadioItem.displayName;const jt=K.forwardRef(({className:t,inset:n,...s},r)=>e.jsx(H.Label,{ref:r,className:i.cn("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",t),...s}));jt.displayName=H.Label.displayName;const wt=K.forwardRef(({className:t,...n},s)=>e.jsx(H.Separator,{ref:s,className:i.cn("-mx-1 my-1 h-px bg-muted",t),...n}));wt.displayName=H.Separator.displayName;const vt=Oe("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function qe({className:t,variant:n,...s}){return e.jsx("div",{className:i.cn(vt({variant:n}),t),...s})}function kt({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:"m15 18-6-6 6-6"})})}function Nt({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:"m9 18 6-6-6-6"})})}const Dt=["January","February","March","April","May","June","July","August","September","October","November","December"];function Ge({date:t,view:n,events:s=[],onNavigatePrev:r,onNavigateNext:c,weekStartsOn:f=1,showEventCount:d=!0,className:b}){const T=Dt[t.getMonth()],h=t.getFullYear(),y=d?M.getEventsCountInView(s,t,n,f):0,z=M.getRangeText(t,n);return e.jsxs("div",{className:i.cn("min-w-0 flex-1",b),children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 flex-wrap",children:[e.jsxs("span",{className:"text-base sm:text-lg font-semibold truncate",children:[T," ",h]}),d&&e.jsx(qe,{variant:"outline",className:"px-1 sm:px-1.5 text-[10px] sm:text-xs shrink-0",children:y})]}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[e.jsx(re,{variant:"outline",size:"icon",className:"size-5 sm:size-6 [&_svg]:size-3 sm:[&_svg]:size-4",onClick:r,children:e.jsx(kt,{})}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground truncate",children:z}),e.jsx(re,{variant:"outline",size:"icon",className:"size-5 sm:size-6 [&_svg]:size-3 sm:[&_svg]:size-4",onClick:c,children:e.jsx(Nt,{})})]})]})}const Ct=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"];function Ue({onClick:t,className:n}){const s=new Date;return e.jsxs("button",{type:"button",className:i.cn("flex size-11 sm:size-14 flex-col items-start overflow-hidden rounded-lg border shrink-0","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","hover:bg-accent/50 transition-colors",n),onClick:t,children:[e.jsx("p",{className:"flex h-4 sm:h-6 w-full items-center justify-center bg-primary text-center text-[10px] sm:text-xs font-semibold text-primary-foreground",children:Ct[s.getMonth()]}),e.jsx("p",{className:"flex w-full flex-1 items-center justify-center text-sm sm:text-lg font-bold",children:s.getDate()})]})}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("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 fe({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:"18",x:"3",y:"3",rx:"2"}),e.jsx("path",{d:"M9 8h7"}),e.jsx("path",{d:"M8 12h6"}),e.jsx("path",{d:"M11 16h5"})]})}function Re({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:"m6 9 6 6 6-6"})})}function Mt({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.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function Ae({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:"M5 12h14"}),e.jsx("path",{d:"M12 5v14"})]})}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("rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}),e.jsx("rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"}),e.jsx("path",{d:"M14 4h7"}),e.jsx("path",{d:"M14 9h7"}),e.jsx("path",{d:"M14 15h7"}),e.jsx("path",{d:"M14 20h7"})]})}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("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),e.jsx("path",{d:"M12 3v18"})]})}function Lt({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:"18",x:"3",y:"3",rx:"2"}),e.jsx("path",{d:"M3 12h18"}),e.jsx("path",{d:"M12 3v18"})]})}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("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),e.jsx("path",{d:"M3 9h18"}),e.jsx("path",{d:"M3 15h18"}),e.jsx("path",{d:"M9 3v18"}),e.jsx("path",{d:"M15 3v18"})]})}const Et=[{value:"day",label:"Day",icon:Tt},{value:"week",label:"Week",icon:zt},{value:"month",label:"Month",icon:Lt},{value:"year",label:"Year",icon:Wt}],Ie=[{value:"timeline-day",label:"1 Day",icon:fe},{value:"timeline-3day",label:"3 Days",icon:fe},{value:"timeline-week",label:"7 Days",icon:fe}];function _t({currentDate:t,view:n,events:s=[],onNavigateToday:r,onNavigatePrev:c,onNavigateNext:f,onNavigate:d,onViewChange:b,onAddEvent:T,availableViews:h=["day","week","month","agenda"],showTimelineViews:y=!1,timelineViews:z,settingsContent:o,showSettings:w=!1,filterContent:m,actions:j,className:E,weekStartsOn:L=1,labels:N={}}){const g=l.useMemo(()=>({today:"Today",addEvent:"Add Event",calendarView:"Calendar View",resourceView:"Resource View",...N}),[N]),O=()=>{r?.(),d?.("today")},A=()=>{c?.(),d?.("prev")},I=()=>{f?.(),d?.("next")},_=["day","week","month","year","agenda"].includes(n),V=n.startsWith("timeline-")||n.startsWith("resource-"),u=Et.filter(x=>h.includes(x.value)),k=_?u.find(x=>x.value===n):null,$=V?Ie.find(x=>x.value===n):null;return e.jsxs("div",{className:i.cn("flex flex-col w-full gap-3 mb-2",E),children:[e.jsxs("div",{className:"flex lg:flex-row flex-col w-full justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[e.jsx(Ue,{onClick:O}),e.jsx(Ge,{date:t,view:n,events:s,onNavigatePrev:A,onNavigateNext:I,weekStartsOn:L})]}),T&&e.jsx(re,{size:"icon",className:"shrink-0 lg:hidden",onClick:T,children:e.jsx(Ae,{className:"size-4"})})]}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 overflow-x-auto pb-1 -mb-1 scrollbar-none",children:[b&&u.length>0&&e.jsxs(De,{children:[e.jsxs(Ce,{className:i.cn("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors","h-10 px-2 sm:px-3 gap-1 sm:gap-1.5 shrink-0",_?"bg-primary text-primary-foreground hover:bg-primary/90":"border border-input bg-background hover:bg-accent hover:text-accent-foreground"),children:[e.jsx(St,{className:"size-4"}),e.jsx("span",{className:"text-xs sm:text-sm font-medium",children:k?.label??g.calendarView}),e.jsx(Re,{className:"size-3 opacity-60"})]}),e.jsx(ye,{align:"start",className:"min-w-[120px]",children:u.map(x=>{const W=x.icon;return e.jsxs(je,{onClick:()=>b(x.value),className:i.cn("gap-2",n===x.value&&"bg-accent"),children:[e.jsx(W,{className:"size-4"}),e.jsx("span",{children:x.label})]},x.value)})})]}),y&&b&&e.jsxs(De,{children:[e.jsxs(Ce,{className:i.cn("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors","h-10 px-2 sm:px-3 gap-1 sm:gap-1.5 shrink-0",V?"bg-primary text-primary-foreground hover:bg-primary/90":"border border-input bg-white hover:bg-zinc-50 hover:text-accent-foreground"),children:[e.jsx(fe,{className:"size-4"}),e.jsx("span",{className:"text-xs sm:text-sm font-medium",children:$?.label??g.resourceView}),e.jsx(Re,{className:"size-3 opacity-60"})]}),e.jsx(ye,{align:"start",className:"min-w-[120px]",children:Ie.map(x=>{const W=x.icon;return e.jsxs(je,{onClick:()=>b(x.value),className:i.cn("gap-2",n===x.value&&"bg-accent"),children:[e.jsx(W,{className:"size-4"}),e.jsx("span",{children:x.label})]},x.value)})})]}),w&&o&&e.jsxs(ee,{children:[e.jsx(te,{asChild:!0,children:e.jsx(re,{variant:"outline",size:"icon",className:"min-w-10 min-h-10 shrink-0 mx-0",children:e.jsx(Mt,{className:"size-4 sm:size-5"})})}),e.jsx(X,{className:"w-auto min-w-80 p-0",align:"end",sideOffset:8,children:e.jsx("div",{className:"max-h-[70vh] overflow-y-auto p-4 space-y-6",children:o})})]}),j,T&&e.jsxs(re,{className:"hidden lg:flex shrink-0 max-h-10",onClick:T,children:[e.jsx(Ae,{className:"size-4"}),g.addEvent]})]})]}),m&&e.jsx("div",{className:"flex items-center gap-2 pb-1 -mb-1 scrollbar-none",children:m})]})}function Pt({events:t,date:n,daysAhead:s=60,badgeVariant:r="colored",onEventClick:c,className:f,renderEvent:d,renderPopover:b,slots:T,classNames:h}){const y=l.useMemo(()=>{const o=new Date(n);o.setHours(0,0,0,0);const w=new Date(o);return w.setDate(w.getDate()+s),t.filter(m=>m.endDate>=o&&m.startDate<=w)},[t,s,n]),z=l.useMemo(()=>{const o=M.groupEventsByDate(y),w=[];for(const[m,j]of o)w.push({date:new Date(m),dateKey:m,events:j});return w.sort((m,j)=>m.date.getTime()-j.date.getTime()),w},[y]);return z.length===0?e.jsx("div",{className:i.cn("flex flex-col items-center justify-center h-full py-12",f),children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-muted-foreground",children:"No events found"}),e.jsx("p",{className:"text-sm text-muted-foreground/70",children:"No events scheduled for this period"})]})}):e.jsxs("div",{className:i.cn("flex flex-col h-full overflow-auto",h?.agendaList,f),children:[e.jsx("div",{className:"sticky top-0 z-10 bg-background border-b px-4 py-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-medium",children:"Schedule"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[y.length," event",y.length!==1?"s":""]})]})}),e.jsx("div",{className:"flex-1",children:z.map(({date:o,dateKey:w,events:m})=>{const j=M.isToday(o),E=o.toLocaleDateString([],{weekday:"short"}),L=o.getDate(),N=o.toLocaleDateString([],{month:"short"});return e.jsxs("div",{className:i.cn("",h?.agendaDayGroup),children:[e.jsx("div",{className:i.cn("sticky top-[52px] z-10 bg-background px-4 py-3 border-b",h?.agendaDayHeader),children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex flex-col items-center min-w-[40px]",children:[e.jsx("span",{className:i.cn("text-[11px] font-medium uppercase tracking-wide",j?"text-primary":"text-muted-foreground"),children:E}),e.jsx("span",{className:i.cn("flex items-center justify-center rounded-full mt-0.5","size-10 text-xl font-normal",j?"bg-primary text-primary-foreground":"text-foreground"),children:L})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[N," ",o.getFullYear()]})]})}),e.jsx("div",{className:"px-4 py-3 space-y-2 border-b last:border-b-0",children:m.map(g=>d?e.jsx("div",{children:d({event:g,variant:"full"})},g.id):e.jsx(be,{event:g,variant:"full",badgeVariant:r,onClick:c,disablePopover:!!c&&!b,renderPopover:b,showTime:!0,showDescription:!0,showParticipants:!0,...h?.eventCard&&{className:h.eventCard}},g.id))})]},w)})})]})}function Le({events:t,date:n,onEventClick:s,className:r}){return t.length===0?null:e.jsxs("div",{className:i.cn("border-b bg-muted/20 px-2 py-1.5 space-y-1","sm:px-4 sm:py-2",r),children:[e.jsx("span",{className:"text-[10px] font-medium text-muted-foreground sm:text-xs",children:"All day / Multi-day"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:t.map(c=>{const f=ce(c.color),d=M.isSameDay(c.startDate,n),b=M.isSameDay(c.endDate,n);return e.jsxs("button",{type:"button",onClick:()=>s?.(c),className:i.cn("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium transition-opacity hover:opacity-80","sm:px-2 sm:py-1 sm:text-xs",f.bg,f.text,c.isCanceled&&"opacity-60 line-through"),children:[d&&"→ ",e.jsx("span",{className:"truncate max-w-24 sm:max-w-32",children:c.title}),b&&" →"]},c.id)})})]})}const $t=5;function Ke({slot:t,onSelectionStart:n,onSelectionMove:s,onSelectionEnd:r,isSelected:c=!1,isSelecting:f=!1,disabled:d=!1,ariaLabel:b,children:T,className:h,height:y,style:z,dataAttributes:o}){const w=l.useRef(null),m=l.useRef(!1),j=l.useRef(!1),E=l.useRef(null),[L,N]=l.useState(!1),g=le.useOptionalDragDrop(),O=l.useCallback(x=>{d||x.button!==0&&x.pointerType==="mouse"||(x.preventDefault(),w.current={x:x.clientX,y:x.clientY},m.current=!1,j.current=!0,n?.(t))},[d,t,n]),A=l.useCallback(x=>{if(!(w.current&&j.current&&!d))return;const W=x.clientX-w.current.x,P=x.clientY-w.current.y;Math.sqrt(W*W+P*P)>=$t&&(m.current=!0)},[d]),I=l.useCallback(x=>{d||(x.buttons>0||f)&&s?.(t)},[d,f,t,s]),_=l.useCallback(()=>{d||(r?.(),w.current=null,m.current=!1,j.current=!1)},[d,r]),V=l.useCallback(x=>{if(!g?.isDragging||d)return;x.preventDefault(),x.dataTransfer.dropEffect="move",N(!0);const W=new Date,P=t.hour??W.getHours(),v=t.minute??(W.getMinutes()>=30?30:0);g.updateDragPreview?.(t.date,P,v)},[g,d,t]),u=l.useCallback(()=>{N(!1)},[]),k=l.useCallback(x=>{x.preventDefault(),N(!1),!(!g?.isDragging||d)&&g.endDrag?.()},[g,d]);l.useEffect(()=>{const x=()=>{j.current&&(j.current=!1,w.current=null,m.current=!1)};return window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x),()=>{window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x)}},[]);const $=l.useCallback(x=>{d||(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),n?.(t),r?.())},[d,t,n,r]);return e.jsx("button",{ref:E,type:"button","aria-label":b,"aria-disabled":d,"aria-pressed":c,disabled:d,onPointerDown:O,onPointerMove:A,onPointerUp:_,onPointerEnter:I,onKeyDown:$,onDragOver:V,onDragLeave:u,onDrop:k,className:i.cn("select-none touch-none cursor-pointer transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",!(f||d)&&"hover:bg-blue-50/60",c&&"bg-blue-100/70",L&&"bg-primary/20 ring-2 ring-primary ring-inset",d&&"cursor-not-allowed opacity-50",h),style:{height:y,...z},...o,children:T})}function We({slot:t,date:n,hour:s,minute:r,ariaLabel:c,...f}){const d=t??{date:n,hour:s??0,minute:r??0},b=c??`Add event at ${(d.hour??0).toString().padStart(2,"0")}:${(d.minute??0).toString().padStart(2,"0")} on ${d.date.toLocaleDateString()}`;return e.jsx(Ke,{slot:d,ariaLabel:b,...f})}function Ye({slot:t,date:n,ariaLabel:s,...r}){const c=t??{date:n},f=s??`Select ${c.date.toLocaleDateString()}`;return e.jsx(Ke,{slot:c,ariaLabel:f,...r})}const de=96,ve=72,ke=80;function Rt({events:t,date:n,visibleHours:s={startHour:0,endHour:24},workingHours:r,slotDuration:c=30,badgeVariant:f="colored",onEventClick:d,onSlotSelect:b,className:T,renderEvent:h,renderPopover:y,slots:z,classNames:o}){const w=60/c,m=100/w,j=l.useMemo(()=>{const D=[];for(let a=0;a<w;a++)D.push(a*c);return D},[w,c]),E=l.useMemo(()=>M.getEventsForDay(t,n),[t,n]),{singleDay:L,multiDay:N}=l.useMemo(()=>M.separateEventsByDuration(E),[E]),g=l.useMemo(()=>{const D=M.calculateOverlappingPositions(L,n,s,de),a=new Map;for(const p of D)a.set(p.event.id,p.position);return a},[L,n,s]),O=l.useMemo(()=>M.getVisibleHoursArray(s),[s]),A=new Date,I=M.isToday(n),_=l.useMemo(()=>{if(!I)return 0;const D=A.getHours()+A.getMinutes()/60;return D<s.startHour||D>s.endHour?-1:(D-s.startHour)*de},[I,s,A]),V=l.useRef(null);l.useLayoutEffect(()=>{const D=V.current;if(!D)return;const a=()=>{let p;if(I){const R=new Date().getHours();p=Math.max(R-1,s.startHour)}else{const R=n.getDay(),S=r?.[R];S?.enabled&&S.from>0?p=Math.max(S.from-1,s.startHour):p=Math.max(7,s.startHour)}const C=(p-s.startHour)*de;D.scrollTo({top:C,behavior:"instant"})};requestAnimationFrame(()=>{requestAnimationFrame(a)})},[n,r,s,I]);const u=le.useOptionalSlotSelection(),k=l.useCallback(D=>{u?.startSelection(D)},[u]),$=l.useCallback(D=>{u?.updateSelection(D)},[u]),x=l.useCallback(()=>{u?.endSelection()},[u]),W=l.useCallback(D=>{d?.(D)},[d]),P=n.toLocaleDateString([],{weekday:"short"}),v=n.getDate(),F=M.isToday(n);return e.jsxs("div",{className:i.cn("flex flex-col h-full",T),children:[e.jsx("div",{className:i.cn("flex items-center gap-3 border-b px-4 py-3",o?.columnHeader,F&&o?.columnHeaderToday),children:e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("span",{className:i.cn("text-[11px] font-medium uppercase tracking-wide",F?"text-primary":"text-muted-foreground"),children:P}),e.jsx("span",{className:i.cn("flex items-center justify-center rounded-full mt-0.5","size-12 text-3xl font-normal",F?"bg-primary text-primary-foreground":"text-foreground"),children:v})]})}),N.length>0&&e.jsx(Le,{events:N,date:n,onEventClick:W,...o?.multiDayBanner&&{className:o.multiDayBanner}}),e.jsx("div",{ref:V,className:i.cn("flex-1 overflow-auto",o?.scrollContainer),children:e.jsxs("div",{className:"relative min-h-full",children:[O.map((D,a)=>{const C=!M.isWorkingHour(n,D,r);return e.jsxs("div",{className:i.cn("relative flex",C&&"bg-calendar-disabled-hour",o?.timeSlot,C?o?.timeSlotNonWorking:o?.timeSlotWorking),style:{height:de},children:[e.jsx("div",{className:i.cn("relative flex-shrink-0 border-r border-border/50 bg-zinc-50 dark:bg-zinc-900",o?.timeGutter),style:{width:ve},children:e.jsx("div",{className:"absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center",children:a!==0&&e.jsx("span",{className:i.cn("text-[10px] sm:text-xs text-muted-foreground",o?.timeGutterLabel),children:M.formatHourLabel(D)})})}),e.jsxs("div",{className:"relative flex-1",children:[I&&!C&&e.jsx("div",{className:"absolute inset-0 bg-primary/5"}),a!==0&&e.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 border-b border-border/50"}),j.slice(1).map(R=>e.jsx("div",{className:"pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",style:{top:`${R/60*100}%`}},R)),j.map((R,S)=>{const G={date:n,hour:D,minute:R};return e.jsx(We,{slot:G,onSelectionStart:k,onSelectionMove:$,onSelectionEnd:x,isSelected:u?.isSlotSelected(G)??!1,isSelecting:u?.isSelecting??!1,disabled:C,className:"absolute inset-x-0",style:{top:`${S*m}%`,height:`${m}%`},ariaLabel:`Add event at ${M.formatHourLabel(D)}:${String(R).padStart(2,"0")}`},R)})]})]},D)}),e.jsx("div",{className:"absolute top-0 bottom-0 right-0 pointer-events-none",style:{left:ve},children:L.map(D=>{const a=g.get(D.id);if(!a)return null;const p=`calc(${a.width}% - 2px)`,C=`max(${ke}px, ${p})`;return h?e.jsx("div",{className:"absolute pointer-events-auto p-0.5",style:{top:`${a.top}px`,left:`${a.left}%`,width:C,minWidth:`${ke}px`},children:h({event:D,position:a})},D.id):e.jsx(Te,{event:D,position:{top:a.top,left:a.left,width:a.width,minWidth:ke},hourHeight:de,badgeVariant:f,onClick:d,disablePopover:!!d&&!y,renderPopover:y,className:i.cn("pointer-events-auto",o?.eventCard)},D.id)})}),I&&_>=0&&e.jsxs("div",{className:i.cn("absolute left-0 right-0 z-20 flex items-center pointer-events-none",o?.currentTimeIndicator),style:{top:_,left:ve},children:[e.jsx("div",{className:"h-2.5 w-2.5 -ml-1 rounded-full bg-red-500"}),e.jsx("div",{className:"flex-1 h-0.5 bg-red-500"})]})]})})]})}const At=[{full:"Monday",short:"Mon",tiny:"M"},{full:"Tuesday",short:"Tue",tiny:"T"},{full:"Wednesday",short:"Wed",tiny:"W"},{full:"Thursday",short:"Thu",tiny:"T"},{full:"Friday",short:"Fri",tiny:"F"},{full:"Saturday",short:"Sat",tiny:"S"},{full:"Sunday",short:"Sun",tiny:"S"}],It=[{full:"Sunday",short:"Sun",tiny:"S"},{full:"Monday",short:"Mon",tiny:"M"},{full:"Tuesday",short:"Tue",tiny:"T"},{full:"Wednesday",short:"Wed",tiny:"W"},{full:"Thursday",short:"Thu",tiny:"T"},{full:"Friday",short:"Fri",tiny:"F"},{full:"Saturday",short:"Sat",tiny:"S"}],me=3;function Bt({events:t,date:n,weekStartsOn:s=1,badgeVariant:r="colored",onEventClick:c,onSlotSelect:f,onDayClick:d,className:b,renderEvent:T,renderPopover:h,showMoreEventsInPopover:y=!1,slots:z,classNames:o}){const w=z?.dayCellHeader,m=z?.dayCellFooter,[j,E]=l.useState(null),L=l.useMemo(()=>M.generateMonthGrid(n,s),[n,s]),N=l.useMemo(()=>{const u=new Map;for(const k of L){const $=k.date.toDateString(),x=M.getEventsForDay(t,k.date);x.sort((W,P)=>W.startDate.getTime()-P.startDate.getTime()),u.set($,x)}return u},[L,t]),g=le.useOptionalSlotSelection(),O=l.useCallback(u=>{g?.startSelection(u)},[g]),A=l.useCallback(u=>{g?.updateSelection(u)},[g]),I=l.useCallback(()=>{g?.endSelection()},[g]),_=l.useCallback(u=>{d?.(u)},[d]),V=s===0?It:At;return e.jsx("div",{className:i.cn("flex flex-col h-full overflow-hidden",b),children:e.jsx("div",{className:"flex flex-col flex-1 overflow-auto",children:e.jsxs("div",{className:"flex flex-col flex-1 min-w-[560px] sm:min-w-0",children:[e.jsx("div",{className:i.cn("grid grid-cols-7 border-b !sticky !top-0 bg-background z-10",o?.weekdayHeader),children:V.map((u,k)=>e.jsxs("div",{className:i.cn("py-2 sm:py-2.5 text-center text-[11px] uppercase font-medium tracking-wide text-muted-foreground",k>=5&&"text-muted-foreground/70",o?.weekdayLabel),children:[e.jsx("span",{className:"sm:hidden",children:u.short}),e.jsx("span",{className:"hidden sm:inline",children:u.short})]},u.full))}),e.jsx("div",{className:i.cn("grid grid-cols-7 auto-rows-min",o?.monthGrid),children:L.map(u=>{const k=u.date.toDateString(),$=N.get(k)||[],x=M.isToday(u.date),W=u.date.getDay()===0||u.date.getDay()===6,P=$.length>me;return e.jsxs(Ye,{date:u.date,onSelectionStart:O,onSelectionMove:A,onSelectionEnd:I,isSelected:g?.isSlotSelected({date:u.date})??!1,isSelecting:g?.isSelecting??!1,className:i.cn("relative flex flex-col border-r border-b text-left min-h-[80px] sm:min-h-[100px] overflow-hidden","[&:nth-child(7n)]:border-r-0",!u.isCurrentMonth&&"bg-muted/20",W&&u.isCurrentMonth&&"bg-muted/10",o?.dayCell,x&&o?.dayCellToday,!u.isCurrentMonth&&o?.dayCellOutside,W&&o?.dayCellWeekend),ariaLabel:`${u.date.toLocaleDateString()} - ${$.length} events. Click to create event, double-click to view day.`,children:[e.jsx("div",{className:i.cn("flex items-center justify-center p-1",!u.isCurrentMonth&&"text-muted-foreground/40",o?.dayCellNumber),children:e.jsx("button",{type:"button",onClick:v=>{v.stopPropagation(),_(u.date)},className:i.cn("flex items-center justify-center rounded-full transition-colors","size-7 text-sm font-normal",x?"bg-primary text-primary-foreground":"hover:bg-muted"),children:u.date.getDate()})}),w&&e.jsx(w,{date:u.date,events:$,isToday:x,isCurrentMonth:u.isCurrentMonth,isWeekend:W,view:"month"}),e.jsxs("div",{className:i.cn("flex-1 overflow-hidden px-2 pt-1 pb-1 space-y-1",o?.dayCellContent),children:[$.slice(0,me).map(v=>e.jsx("div",{onPointerDown:F=>{F.stopPropagation()},children:T?T({event:v,variant:"compact"}):e.jsx(be,{event:v,variant:"compact",badgeVariant:r,onClick:c,disablePopover:!!c&&!h,renderPopover:h,showTime:!1,enableDrag:!0,...o?.eventCardCompact&&{className:o.eventCardCompact}})},v.id)),P&&(y?e.jsxs(ee,{open:j===k,onOpenChange:v=>E(v?k:null),children:[e.jsx(te,{asChild:!0,children:e.jsxs("button",{type:"button",onPointerDown:v=>v.stopPropagation(),onClick:v=>{v.stopPropagation(),E(k)},className:i.cn("w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",o?.moreEventsIndicator),children:["+",$.length-me," more"]})}),e.jsxs(X,{align:"start",side:"right",sideOffset:8,className:"w-72 max-h-80 overflow-y-auto p-2",onPointerDown:v=>v.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 pb-2 border-b",children:[e.jsx("span",{className:"text-sm font-medium",children:u.date.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"})}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[$.length," events"]})]}),e.jsx("div",{className:"space-y-1.5",children:$.map(v=>e.jsx("div",{children:T?T({event:v,variant:"compact"}):e.jsx(be,{event:v,variant:"compact",badgeVariant:r,onClick:F=>{E(null),c?.(F)},disablePopover:!!c&&!h,renderPopover:h,showTime:!0})},v.id))})]})]}):e.jsxs("div",{onPointerDown:v=>{v.stopPropagation(),_(u.date)},className:i.cn("w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",o?.moreEventsIndicator),children:["+",$.length-me," more"]}))]}),m&&e.jsx(m,{date:u.date,events:$,isToday:x,isCurrentMonth:u.isCurrentMonth,isWeekend:W,view:"month"})]},k)})})]})})})}const ae=96,he=56,Be=72,Y=120,pe=100,Ht=3;function Ot({events:t,date:n,weekStartsOn:s=1,visibleHours:r={startHour:0,endHour:24},workingHours:c,slotDuration:f=30,badgeVariant:d="colored",onEventClick:b,onSlotSelect:T,onDayClick:h,className:y,renderEvent:z,renderPopover:o,slots:w,classNames:m}){const j=60/f,E=100/j,L=l.useMemo(()=>{const a=[];for(let p=0;p<j;p++)a.push(p*f);return a},[j,f]),N=l.useMemo(()=>M.getWeekDays(n,s),[n,s]),g=l.useMemo(()=>M.getVisibleHoursArray(r),[r]),O=l.useMemo(()=>{const a=new Map;for(const p of N){const C=p.toDateString(),R=M.getEventsForDay(t,p),{singleDay:S,multiDay:G}=M.separateEventsByDuration(R),B=M.calculateOverlappingPositions(S,p,r,ae),q=new Map;let oe=1;for(const U of B)if(q.set(U.event.id,U.position),U.position.width>0){const J=Math.round(100/U.position.width);oe=Math.max(oe,J)}a.set(C,{singleDay:S,multiDay:G,positions:q,maxOverlapping:oe})}return a},[N,t,r]),A=l.useMemo(()=>{const a=new Map;for(const{multiDay:p}of O.values())for(const C of p)a.set(C.id,C);return Array.from(a.values())},[O]),I=new Date,_=N.findIndex(a=>M.isToday(a)),V=l.useMemo(()=>{if(_<0)return-1;const a=I.getHours()+I.getMinutes()/60;return a<r.startHour||a>r.endHour?-1:(a-r.startHour)*ae},[_,r,I]),u=l.useRef(null);l.useLayoutEffect(()=>{const a=u.current;if(!a)return;const p=()=>{let C;if(_!==-1){const S=new Date().getHours();C=Math.max(S-1,r.startHour)}else{const G=new Date().getDay();let B=c?.[G];if(!B?.enabled||B.from===0){const q=c?.[1];q?.enabled&&(B=q)}B?.enabled&&B.from>0?C=Math.max(B.from-1,r.startHour):C=Math.max(7,r.startHour)}const R=(C-r.startHour)*ae;a.scrollTo({top:R,behavior:"instant"})};requestAnimationFrame(()=>{requestAnimationFrame(p)})},[n,c,r,_]);const k=le.useOptionalSlotSelection(),$=l.useCallback(a=>{k?.startSelection(a)},[k]),x=l.useCallback(a=>{k?.updateSelection(a)},[k]),W=l.useCallback(()=>{k?.endSelection()},[k]),P=l.useCallback(a=>{b?.(a)},[b]),v=he+7*Y,F=l.useMemo(()=>{const a=[];for(const p of N){const C=p.toDateString(),S=O.get(C)?.maxOverlapping??1;S>Ht?a.push(Math.max(Y,S*pe)):a.push(Y)}return a},[N,O]),D=he+F.reduce((a,p)=>a+p,0);return e.jsxs("div",{className:i.cn("ic-week-view flex flex-col h-full",y),children:[A.length>0&&e.jsx(Le,{events:A,date:M.startOfWeek(n,s),onEventClick:P,...m?.multiDayBanner&&{className:m.multiDayBanner}}),e.jsx("div",{ref:u,className:i.cn("ic-week-scroll-container flex-1",m?.scrollContainer),children:e.jsxs("div",{style:{minWidth:Math.max(v,D)},children:[e.jsx("div",{className:"ic-week-header sticky top-0 z-20 border-b bg-background",children:e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"flex-shrink-0 flex items-end justify-center pb-2 text-[10px] text-muted-foreground/70",style:{width:he,height:Be},children:e.jsxs("span",{className:"hidden sm:inline",children:["GMT",(()=>{const a=new Date().getTimezoneOffset(),p=Math.abs(Math.floor(a/60)),C=a<=0?"+":"-";return p>0?`${C}${String(p).padStart(2,"0")}`:""})()]})}),N.map((a,p)=>{const C=M.isToday(a),R=F[p]??Y,S=R>Y;return e.jsxs("div",{className:i.cn("flex-1 flex flex-col items-center justify-center border-r last:border-r-0 py-2",m?.columnHeader,C&&m?.columnHeaderToday),style:{height:Be,minWidth:S?R:Y},children:[e.jsx("span",{className:i.cn("text-[11px] font-medium uppercase tracking-wide",C?"text-primary":"text-muted-foreground"),children:a.toLocaleDateString([],{weekday:"short"})}),e.jsx("button",{type:"button",onClick:()=>h?.(a),className:i.cn("flex items-center justify-center rounded-full transition-colors mt-0.5","size-10 text-2xl font-normal",C?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"),children:a.getDate()})]},a.toDateString())})]})}),e.jsxs("div",{className:"relative flex",children:[e.jsx("div",{className:i.cn("ic-hour-column sticky left-0 z-10 bg-zinc-50 border-r",m?.timeGutter),style:{width:he},children:g.map((a,p)=>e.jsx("div",{className:"relative",style:{height:ae},children:e.jsx("div",{className:"absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center",children:p!==0&&e.jsx("span",{className:i.cn("text-[10px] sm:text-xs text-muted-foreground",m?.timeGutterLabel),children:M.formatHourLabel(a)})})},a))}),e.jsx("div",{className:"ic-week-grid relative flex-1",children:e.jsx("div",{className:"flex divide-x",children:N.map((a,p)=>{const C=a.toDateString(),R=O.get(C),S=F[p]??Y,G=S>Y;return e.jsxs("div",{className:"ic-day-column relative flex-1",style:{minWidth:G?S:Y},children:[g.map((B,q)=>{const U=!M.isWorkingHour(a,B,c);return e.jsxs("div",{className:i.cn("relative",U&&"bg-calendar-disabled-hour",M.isToday(a)&&!U&&"bg-primary/5",m?.timeSlot,U?m?.timeSlotNonWorking:m?.timeSlotWorking),style:{height:ae},children:[q!==0&&e.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 border-b border-border/50"}),L.slice(1).map(J=>e.jsx("div",{className:"pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",style:{top:`${J/60*100}%`}},J)),L.map((J,Xe)=>{const Ee={date:a,hour:B,minute:J};return e.jsx(We,{slot:Ee,onSelectionStart:$,onSelectionMove:x,onSelectionEnd:W,isSelected:k?.isSlotSelected(Ee)??!1,isSelecting:k?.isSelecting??!1,disabled:U,className:"absolute inset-x-0",style:{top:`${Xe*E}%`,height:`${E}%`},ariaLabel:`Add event on ${a.toLocaleDateString()} at ${M.formatHourLabel(B)}:${String(J).padStart(2,"0")}`},J)})]},B)}),R?.singleDay.map(B=>{const q=R.positions.get(B.id);if(!q)return null;const oe=`calc(${q.width}% - 2px)`,U=`max(${pe}px, ${oe})`;return z?e.jsx("div",{className:"absolute pointer-events-auto p-0.5",style:{top:`${q.top}px`,left:`${q.left}%`,width:U,minWidth:`${pe}px`},children:z({event:B,position:q})},B.id):e.jsx(Te,{event:B,position:{top:q.top,left:q.left,width:q.width,minWidth:pe},hourHeight:ae,badgeVariant:d,onClick:b,disablePopover:!!b&&!o,renderPopover:o,className:i.cn("pointer-events-auto",m?.eventCard)},B.id)}),p===_&&V>=0&&e.jsxs("div",{className:i.cn("absolute left-0 right-0 z-20 flex items-center pointer-events-none",m?.currentTimeIndicator),style:{top:V},children:[e.jsx("div",{className:"h-2 w-2 -ml-1 rounded-full bg-red-500"}),e.jsx("div",{className:"flex-1 h-0.5 bg-red-500"})]})]},a.toDateString())})})})]})]})})]})}exports.AgendaView=Pt;exports.Badge=qe;exports.Button=re;exports.CalendarHeader=_t;exports.DateNavigator=Ge;exports.DaySlot=Ye;exports.DayView=Rt;exports.DropdownMenu=De;exports.DropdownMenuContent=ye;exports.DropdownMenuItem=je;exports.DropdownMenuTrigger=Ce;exports.EventBlock=Te;exports.EventCard=be;exports.MonthView=Bt;exports.MultiDayBanner=Le;exports.MultiDayEventBar=rt;exports.Popover=ee;exports.PopoverAnchor=et;exports.PopoverContent=X;exports.PopoverTrigger=te;exports.TimeSlot=We;exports.TodayButton=Ue;exports.Tooltip=ne;exports.TooltipContent=Q;exports.TooltipProvider=tt;exports.TooltipTrigger=se;exports.WeekView=Ot;exports.buttonVariants=Ve;exports.getEventColorClasses=ce;
11
- //# sourceMappingURL=week-view-C0iWG7_6.cjs.map