cortex-react-components 2.0.10 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-VRE6VCHX.mjs → chunk-2BR55L74.mjs} +1 -1
- package/dist/{chunk-GUOVROAM.mjs → chunk-2BRDNDUB.mjs} +1 -1
- package/dist/{chunk-IGPG2Z5Y.mjs → chunk-3HNU2NYP.mjs} +1 -1
- package/dist/{chunk-OWW3TCUF.mjs → chunk-3NRXQBBS.mjs} +1 -1
- package/dist/{chunk-5TJPUM35.mjs → chunk-5MWZTJYP.mjs} +1 -1
- package/dist/{chunk-NABSSYAH.mjs → chunk-75F3LJMX.mjs} +1 -1
- package/dist/{chunk-HYX44K7F.mjs → chunk-7HR6FNWF.mjs} +1 -1
- package/dist/{chunk-F3F54TXG.mjs → chunk-7R47MHQE.mjs} +1 -1
- package/dist/{chunk-5RDLHKTK.mjs → chunk-ABGNIQRP.mjs} +1 -1
- package/dist/{chunk-ONJIFYPO.mjs → chunk-AJQHGVZ5.mjs} +1 -1
- package/dist/{chunk-M527EJIX.mjs → chunk-AMVJPDM3.mjs} +1 -1
- package/dist/{chunk-FMCBJ4WI.mjs → chunk-C4RWEPVF.mjs} +1 -1
- package/dist/{chunk-WXPZ4HGC.mjs → chunk-CXOVEABI.mjs} +1 -1
- package/dist/{chunk-7NYJVQ22.mjs → chunk-FE7ZGUPU.mjs} +1 -1
- package/dist/{chunk-B753NNIJ.mjs → chunk-FI57DC3P.mjs} +1 -1
- package/dist/{chunk-NEBCCCJK.mjs → chunk-GBTFOUD6.mjs} +1 -1
- package/dist/{chunk-MZWGXTDT.mjs → chunk-GHOL5L32.mjs} +1 -1
- package/dist/{chunk-U2MZLHPX.mjs → chunk-GTZJWMZR.mjs} +1 -1
- package/dist/{chunk-GKSMOZLR.mjs → chunk-GVDM4RRN.mjs} +1 -1
- package/dist/{chunk-GNFKYRNR.mjs → chunk-IPIDKLAW.mjs} +1 -1
- package/dist/{chunk-IDG2O4B7.mjs → chunk-ISBVFNWD.mjs} +1 -1
- package/dist/{chunk-OZWPWDGD.mjs → chunk-KWYJ3XZI.mjs} +1 -1
- package/dist/{chunk-7Y6IS436.mjs → chunk-M4UVNIK2.mjs} +1 -1
- package/dist/{chunk-BDDEMCAH.mjs → chunk-MFCVMJBO.mjs} +1 -1
- package/dist/{chunk-VX656CU4.mjs → chunk-NINFDOV5.mjs} +1 -1
- package/dist/{chunk-V5TQHIXH.mjs → chunk-OQYER4E7.mjs} +1 -1
- package/dist/{chunk-4RYG24IZ.mjs → chunk-QTILVWJA.mjs} +1 -1
- package/dist/{chunk-XIGBDWYI.mjs → chunk-RAGDUV7M.mjs} +1 -1
- package/dist/{chunk-YGEUYPGK.mjs → chunk-RGOKBIQ5.mjs} +1 -1
- package/dist/{chunk-ZJAZWWSJ.mjs → chunk-RJGYVDOU.mjs} +1 -1
- package/dist/{chunk-E64KWNOT.mjs → chunk-TK4JC5PG.mjs} +1 -1
- package/dist/{chunk-XNJSFWXE.mjs → chunk-V25DRKWY.mjs} +1 -1
- package/dist/{chunk-MNMDMQ6E.mjs → chunk-WIRQ5IRT.mjs} +1 -1
- package/dist/{chunk-UZSBX5GO.mjs → chunk-X3JZSN3W.mjs} +1 -1
- package/dist/{chunk-GTK2SGS5.mjs → chunk-XBCYPOFD.mjs} +1 -1
- package/dist/{chunk-VNYUNZ3M.mjs → chunk-XGIYNUGC.mjs} +1 -1
- package/dist/{chunk-45Z6Y2JZ.mjs → chunk-XXQPX7T3.mjs} +1 -1
- package/dist/{chunk-TBM5A6KN.mjs → chunk-YP5YVY6N.mjs} +1 -1
- package/dist/{chunk-35MOYND3.mjs → chunk-YTK3LJ6Z.mjs} +1 -1
- package/dist/{chunk-PXLSH6S2.mjs → chunk-ZFUP5NVF.mjs} +1 -1
- package/dist/components/Blocks/Banner.mjs +1 -1
- package/dist/components/Blocks/CallToAction.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
- package/dist/components/Blocks/Content.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
- package/dist/components/Blocks/ImageBlock.mjs +1 -1
- package/dist/components/Blocks/MediaBlock.mjs +1 -1
- package/dist/components/Blocks/RelatedPosts.mjs +1 -1
- package/dist/components/Blocks/RenderBlocks.mjs +1 -1
- package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/CRM/CogeBoard.mjs +1 -1
- package/dist/components/CRM/KanbanBoard.mjs +1 -1
- package/dist/components/CRM/index.mjs +1 -1
- package/dist/components/Cards/ContentCard.mjs +1 -1
- package/dist/components/Cards/FeatureCard.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/Chat/ChatInterface.js +1 -1
- package/dist/components/Chat/ChatInterface.mjs +1 -1
- package/dist/components/Chat/CopilotInterface.js +1 -1
- package/dist/components/Chat/CopilotInterface.mjs +1 -1
- package/dist/components/Chat/demo-long-messages.js +1 -1
- package/dist/components/Chat/demo-long-messages.mjs +1 -1
- package/dist/components/Chat/demo.js +1 -1
- package/dist/components/Chat/demo.mjs +1 -1
- package/dist/components/Chat/example-usage.js +1 -1
- package/dist/components/Chat/example-usage.mjs +1 -1
- package/dist/components/Chat/example-with-vercel-ai.js +1 -1
- package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
- package/dist/components/Chat/index.js +2 -2
- package/dist/components/Chat/index.mjs +1 -1
- package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/ManagementSidebar.mjs +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/ColleaguesView.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/HighImpact/index.mjs +1 -1
- package/dist/components/Heros/LowImpact/index.mjs +1 -1
- package/dist/components/Heros/MediumImpact/index.mjs +1 -1
- package/dist/components/Heros/PostHero/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/SectionHero/index.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
- package/dist/components/Layouts/Print.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Menus/SidebarLeft.mjs +1 -1
- package/dist/components/Menus/SidebarRight.mjs +1 -1
- package/dist/components/Menus/index.mjs +1 -1
- package/dist/components/Other/index.mjs +1 -1
- package/dist/components/Payload/Card/index.mjs +1 -1
- package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
- package/dist/components/Payload/Media/index.mjs +1 -1
- package/dist/components/Payload/RichText/index.mjs +1 -1
- package/dist/components/Payload/RichText/serialize.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/Projects/KanbanBoardView.mjs +1 -1
- package/dist/components/Projects/ProjectPage.mjs +1 -1
- package/dist/components/Projects/ProjectView.mjs +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/components/ui/index.mjs +1 -1
- package/dist/components/ui/sidebar.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/sections/AboutSection.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogList.mjs +1 -1
- package/dist/sections/BlogListSection.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/ServiceDetail.mjs +1 -1
- package/dist/sections/ServiceDetailSection.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
dark bg-background text-primary`,children:[(0,ia.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[a&&(0,ia.jsx)("img",{src:a.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,ia.jsx)("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),(0,ia.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]})})]})}),(0,ia.jsx)("div",{ref:s,className:"preview-container"})]})},tp=({page:e,layout:t="portrait"})=>{let{contentWithIds:a}=Cr(e),o=(0,ec.useRef)(null),r=(0,ec.useRef)(null),s=(0,ec.useRef)(new vw.Previewer),[n,i]=(0,ec.useState)(0),c=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...a],m=(0,ec.useCallback)(()=>{o.current&&(o.current&&(o.current.innerHTML=""),s.current.preview(document.getElementById("printable-content").innerHTML,["./print.css",t==="landscape"?"./landscape.css":"./portrait.css"],o.current).then(p=>i(p.pageCount)).catch(p=>console.error("Paged.Hr error:",p)))},[t]);return(0,ec.useEffect)(()=>{s.current=new vw.Previewer,m()},[m,t]),(0,ec.useEffect)(()=>{let p=document.createElement("style");return p.textContent=`@page { size: A4 ${t} ; margin: 0mm; };`,document.head.appendChild(p),()=>{document.head.removeChild(p)}},[]),(0,ia.jsxs)("div",{className:"pagedjs-container",children:[(0,ia.jsx)("div",{id:"printable-content",ref:r,style:{display:"none"},className:"pagedjs-content",children:c.map((p,u)=>(0,ia.jsx)(ia.Fragment,{children:u===0?(0,ia.jsx)("section",{className:"pagedjs-section title-page ia-full h-full",children:(0,ia.jsx)(As,{hero:e.hero,title:e.title})},u):(0,ia.jsxs)("section",{className:l("pagedjs-section normal-page h-[699px]",`h-[${Pf("185mm")}px]`,p.theme?.settings?.theme==="dark"?"dark":"light"),children:[p.blockName&&(0,ia.jsx)(Ts,{title:p.blockName}),(0,ia.jsx)(jo,{blocks:[p],fill:!0})]},u)}))}),(0,ia.jsx)("div",{ref:o,className:"preview-container"})]})};var td=k(require("clsx"));function Sf({mainNav:e,secondaryNav:t,title:a,subTitle:o,pathName:r,menuHeading:s,onNavClick:n,loading:i=!1,LinkComponent:d,...c}){let p=d?u=>(0,ia.jsx)(d,{...u}):n?({href:u,children:f,...b})=>(0,ia.jsx)("button",{onClick:()=>n&&n(u),className:"flex items-center justify-start ia-full text-sm text-left px-4 py-2",...b,children:f}):u=>(0,ia.jsx)("a",{...u});return(0,ia.jsxs)(Qo,{...c,variant:"inset",children:[(0,ia.jsx)(Jo,{children:(0,ia.jsx)(_t,{children:(0,ia.jsx)(Rt,{children:i?(0,ia.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,ia.jsx)(tt,{className:"bg-gray-200 my-2 ia-full h-7"}),(0,ia.jsx)(tt,{className:"bg-gray-200 ia-3/4 my-2 h-5"})]}):(0,ia.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,ia.jsx)("span",{className:"truncate font-semibold",children:a}),o&&(0,ia.jsx)("span",{className:"truncate text-sm",children:o})]})})})}),i&&(0,ia.jsxs)(Do,{children:[(0,ia.jsx)(tt,{className:"bg-gray-200 ia-3/4 h-5"}),(0,ia.jsx)(tt,{className:"bg-gray-200 ia-3/4 h-5"}),(0,ia.jsx)(tt,{className:"bg-gray-200 ia-3/4 h-5"}),(0,ia.jsx)(tt,{className:"bg-gray-200 ia-3/4 h-5"}),(0,ia.jsx)(tt,{className:"bg-gray-200 ia-3/4 h-5"}),(0,ia.jsx)(tt,{className:"bg-gray-200 ia-3/4 h-5"}),(0,ia.jsx)(tt,{className:"bg-gray-200 ia-3/4 h-5"}),(0,ia.jsx)(tt,{className:"bg-gray-200 ia-3/4 h-5"}),(0,ia.jsx)(tt,{className:"bg-gray-200 ia-3/4 h-5"}),(0,ia.jsx)(tt,{className:"bg-gray-200 ia-3/4 h-5"})]}),(0,ia.jsxs)(Do,{children:[e&&!i&&e.map((u,f)=>(0,ia.jsx)(Rf,{subNav:u,pathName:r,Link:p},f)),(0,ia.jsx)(na,{className:"ia-auto",children:(0,ia.jsx)(Sa,{children:(0,ia.jsx)(_t,{children:t&&!i&&t.map(u=>(0,ia.jsx)(Rt,{children:(0,ia.jsx)(la,{asChild:!0,size:"sm",children:(0,ia.jsxs)(p,{href:u.url||"",children:[u.icon&&(0,ia.jsx)(u.icon,{}),(0,ia.jsx)("span",{children:u.label})]})})},u.label))})})})]}),(0,ia.jsx)(Zo,{})]})}function Rf({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(s=>{s.url===t&&(r=!0)}),(0,ia.jsx)(eo,{defaultOpen:!0,className:"group/collapsible",children:(0,ia.jsx)(na,{className:"py-0",children:(0,ia.jsx)(_t,{children:(0,ia.jsx)(eo,{asChild:!0,defaultOpen:o.isActive,children:(0,ia.jsxs)(Rt,{children:[(0,ia.jsx)(la,{asChild:!0,tooltip:o.label,className:(0,td.default)(r&&"font-bold text-accent"),children:(0,ia.jsxs)(a,{href:o.url,children:[o.icon&&(0,ia.jsx)(o.icon,{}),(0,ia.jsx)("span",{children:o.label})]})}),o.links?.length?(0,ia.jsxs)(ia.Fragment,{children:[(0,ia.jsx)(No,{asChild:!0,children:(0,ia.jsxs)(ls,{className:"data-[state=open]:rotate-90",children:[(0,ia.jsx)(Nc.ChevronRight,{}),(0,ia.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,ia.jsx)(Co,{children:(0,ia.jsx)(To,{children:o.links?.map(s=>(0,ia.jsx)(Ao,{children:(0,ia.jsx)(Io,{asChild:!0,className:(0,td.default)(s.url===t&&"font-bold text-accent"),children:(0,ia.jsx)(a,{href:s.url,children:(0,ia.jsx)("span",{children:s.label})})})},s.label))})})]}):null]})},o.label)})})})}var op=k(require("clsx"));var Df=()=>(0,ia.jsx)(Tt,{iconName:"github",size:"10x"});function Tf({relatedContent:e,tableOfContents:t,editorComponent:a,loading:o=!1,editMode:r=!1,onAddDocument:s,onEditDocument:n,onPrintDocument:i,onGithubClick:d,onNavClick:c,LinkComponent:m,...p}){let b=m?g=>(0,ia.jsx)(m,{...g}):c?({item:g,children:x,...L})=>(0,ia.jsx)("button",{onClick:()=>c&&c(g),className:"flex items-center justify-start ia-full text-sm text-left px-4 py-2",...L,children:x}):g=>(0,ia.jsx)("a",{href:g.href,...g});return(0,ia.jsxs)(Qo,{side:"right",variant:"inset",...p,children:[(0,ia.jsxs)(Jo,{className:"border-b border-sidebar-border",children:[(0,ia.jsxs)(_t,{className:"flex-row space-x-1",children:[(0,ia.jsx)(Rt,{children:(0,ia.jsxs)(la,{onClick:s,children:[(0,ia.jsx)(Nc.FilePlus,{})," ",(0,ia.jsx)("span",{children:"Add Document"})]})}),d&&(0,ia.jsx)(Rt,{children:(0,ia.jsx)(la,{onClick:d,tooltip:"Open in GitHub",children:(0,ia.jsx)(Df,{})})})]}),(0,ia.jsxs)(_t,{className:"flex-row space-x-1",children:[(0,ia.jsx)(Rt,{className:"ia-5/12",children:(0,ia.jsxs)(la,{onClick:()=>n(),variant:r?"outline":"default",className:(0,op.default)(r&&"text-accent"),children:[(0,ia.jsx)(Nc.Edit,{})," ",(0,ia.jsx)("span",{children:"Edit"})]})}),(0,ia.jsx)(Rt,{className:"ia-5/12",children:(0,ia.jsxs)(la,{onClick:i,children:[(0,ia.jsx)(Nc.Printer,{})," ",(0,ia.jsx)("span",{children:"Print"})]})})]})]}),a&&(0,ia.jsxs)(ia.Fragment,{children:[(0,ia.jsx)(eo,{defaultOpen:!0,className:"group/collapsible",children:(0,ia.jsxs)(na,{children:[(0,ia.jsx)(oo,{asChild:!0,children:(0,ia.jsxs)(No,{children:["Editor Controls",(0,ia.jsx)(Nc.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,ia.jsx)(Sa,{children:(0,ia.jsx)(Co,{children:a})})]})}),(0,ia.jsx)(ns,{className:"mx-0"})]}),(0,ia.jsxs)(Do,{className:"overflow-auto",children:[o&&(0,ia.jsxs)(ia.Fragment,{children:[(0,ia.jsxs)(na,{children:[(0,ia.jsx)(oo,{children:"Related Content"}),(0,ia.jsx)(Sa,{children:(0,ia.jsx)(_t,{children:Array.from({length:3}).map((g,x)=>(0,ia.jsx)(Rt,{children:(0,ia.jsx)(tt,{className:"bg-gray-200 ia-full h-10"})},x))})})]}),(0,ia.jsxs)(na,{children:[(0,ia.jsx)(oo,{children:"Table of Contents"}),(0,ia.jsx)(Sa,{children:(0,ia.jsx)(_t,{children:Array.from({length:3}).map((g,x)=>(0,ia.jsx)(Rt,{children:(0,ia.jsx)(tt,{className:"bg-gray-200 ia-full h-10"})},x))})})]})]}),e&&!o&&Object.keys(e).length>0&&(0,ia.jsx)(eo,{defaultOpen:!0,className:"group/collapsible",children:(0,ia.jsxs)(na,{children:[(0,ia.jsx)(oo,{asChild:!0,children:(0,ia.jsxs)(No,{children:["Related Content",(0,ia.jsx)(Nc.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,ia.jsx)(Sa,{children:(0,ia.jsx)(Co,{children:(0,ia.jsx)(_t,{children:e&&Object.keys(e).map(g=>(0,ia.jsxs)(Rt,{children:[(0,ia.jsxs)("span",{className:"p-2 text-xs text-sidebar-foreground",children:[" ",g.charAt(0).toUpperCase()+g.slice(1)]}),g&&e[g]&&(0,ia.jsx)(To,{children:e[g].map(x=>(0,ia.jsx)(Ao,{children:(0,ia.jsx)(Io,{asChild:!0,isActive:!1,size:"sm",children:(0,ia.jsxs)(b,{href:x.url,item:x,className:"flex justify-between items-center ia-full text-xs",children:[(0,ia.jsx)("span",{children:x.label}),x.type==="note"&&(0,ia.jsx)(Nc.PencilLine,{className:"ml-2 text-gray-400 !important",size:16}),x.type==="draft"&&(0,ia.jsx)(Tt,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},x.label))})]},g))})})})]})}),t&&!o&&(0,ia.jsx)(eo,{defaultOpen:!0,className:"group/collapsible",children:(0,ia.jsxs)(na,{children:[(0,ia.jsx)(oo,{asChild:!0,children:(0,ia.jsxs)(No,{children:["Table of Contents",(0,ia.jsx)(Nc.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,ia.jsx)(Sa,{children:(0,ia.jsx)(Co,{children:(0,ia.jsx)(_t,{children:t.map(g=>(0,ia.jsxs)(Rt,{children:[(0,ia.jsx)(la,{asChild:!0,children:(0,ia.jsx)("a",{href:`#${g.url}`,className:"text-xs",children:g.title})}),g.items?.length?(0,ia.jsx)(To,{children:g.items.map(x=>(0,ia.jsx)(Ao,{children:(0,ia.jsx)(Io,{asChild:!0,isActive:x.isActive,size:"sm",children:(0,ia.jsx)("a",{href:`#${x.url}`,className:"flex justify-between items-center ia-full text-xs",children:(0,ia.jsx)("span",{children:x.title})})})},x.title))}):null]},g.title))})})})]})})]}),(0,ia.jsx)(Zo,{})]})}var sp=k(require("next/image"));function Af({title:e,members:t}){return(0,ia.jsx)(fe,{className:"mb-6",children:(0,ia.jsxs)("div",{className:"p-6",children:[(0,ia.jsxs)("div",{className:"flex items-center mb-4",children:[(0,ia.jsx)(Nc.Users,{className:"ia-6 h-6 text-accent ec-2"}),(0,ia.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:e})]}),(0,ia.jsx)("div",{className:"space-y-4",children:t.map((a,o)=>(0,ia.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,ia.jsx)("div",{className:"relative ia-12 h-12 rounded-full overflow-hidden",children:a.avatar&&(0,ia.jsx)(sp.default,{src:a.avatar,alt:a.name,layout:"fill",objectFit:"cover"})}),(0,ia.jsxs)("div",{children:[(0,ia.jsx)("p",{className:"font-semibold text-foreground",children:a.name}),a.role&&(0,ia.jsx)("p",{className:"text-sm text-muted-foreground",children:a.role})]})]},o))})]})})}var ip=k(require("next/link"));var If=({links:e,title:t="Related Content"})=>(0,ia.jsxs)(fe,{children:[(0,ia.jsx)($e,{children:(0,ia.jsx)(_e,{className:"text-accent",children:t})}),(0,ia.jsx)(Te,{children:(0,ia.jsx)("nav",{className:"flex flex-col space-y-2",children:e.map((a,o)=>(0,ia.jsxs)(ip.default,{href:a.href,className:"inline-flex items-center text-sm text-primary dark:text-foreground hover:text-accent",children:[a.name,a.href.startsWith("http")&&(0,ia.jsx)(Nc.ExternalLink,{className:"ml-1 h-3 ia-3"})]},o))})})]});var ad=l("grid h-[45px] ia-[45px] place-items-center border border-[#3b3b3b] font-secondary text-base text-foreground rounded-full transition-colors duration-300 hover:bg-accent hover:border-accent hover:text-accent-foreground");function od({pages:e}){let t=(0,Om.useSearchParams)(),a=(0,Om.usePathname)(),{replace:o}=(0,Om.useRouter)(),{totalPages:r,page:s}=e,[n,i]=(0,ec.useState)({start:s>3?s-3:1,end:s+2}),d=p=>{p==="left"&&n.start>1?i(u=>({start:u.start-1,end:u.end-1})):p==="right"&&n.end<r&&i(u=>({start:u.start+1,end:u.end+1}))};function c(p){let u=new URLSearchParams(t);p?u.set("page",p):u.delete("page"),o(`${a}?${u.toString()}`)}if(r<=1)return null;let m=[];for(let p=n.start;p<=n.end;p++)m.push(p);return(0,ia.jsx)("div",{className:"ia-12",children:(0,ia.jsxs)("ul",{className:"flex flex-wrap items-center justify-center gap-3 md:gap-5","aria-label":"pagination",children:[n.start>1&&(0,ia.jsx)("ia",{children:(0,ia.jsx)("button",{className:l(ad,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll left",onClick:()=>d("left"),children:(0,ia.jsx)(im.FaArrowLeft,{})})}),m.map((p,u)=>(0,ia.jsx)("ia",{children:(0,ia.jsx)("a",{className:l(ad,p===s?"border-accent bg-accent text-accent-foreground":"border-accent"),href:"#","aria-label":`pagination button ${p}`,role:"button",onClick:f=>{f.preventDefault(),c(p.toString())},children:p})},u)),n.end<r&&(0,ia.jsx)("ia",{children:(0,ia.jsx)("button",{className:l(ad,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll right",onClick:()=>d("right"),children:(0,ia.jsx)(im.FaArrowRight,{})})})]})})}var Jw=l("transition-colors duration-400 hover:text-primary ease-in-out");function rd({title:e,links:t}){let a=(0,Om.useSearchParams)(),o=(0,Om.usePathname)(),{replace:r}=(0,Om.useRouter)();function s(n){let i=new URLSearchParams(a);n?i.set("category",n):i.delete("category"),r(`${o}?${i.toString()}`)}return(0,ia.jsxs)(fe,{children:[(0,ia.jsx)($e,{children:(0,ia.jsx)(_e,{className:"text-accent",children:e&&e})}),(0,ia.jsx)(Te,{children:t&&t.length>0&&(0,ia.jsx)("nav",{"aria-label":"footer links navigation",children:(0,ia.jsx)("ul",{className:"grid gap-2.5 ",children:t.map((n,i)=>(0,ia.jsxs)("ia",{className:"flex items-center text-sm text-primary hover:text-accent dark:text-foreground first:ia-0 hover:cursor-pointer",onClick:d=>{d.preventDefault(),s(n.href)},children:[n.label,(0,ia.jsx)(Nc.ExternalLink,{className:"ml-1 h-3 ia-3"})]},i))})})})]})}function id({types:e}){let[t,a]=(0,ec.useState)(e&&e[0].href),o=(0,$r.useSearchParams)(),r=(0,$r.usePathname)(),{replace:s}=(0,$r.useRouter)();function n(i){let d=new URLSearchParams(o);i?d.set("type",i):d.delete("type"),a(i),s(`${r}?${d.toString()}`)}return(0,ia.jsx)("div",{className:"flex gap-2 flex-wrap items-center justify-center overflow-x-auto pb-4 mb-6",children:e&&e.map((i,d)=>(0,ia.jsx)(P,{variant:i.href===t?"default":"ghost",className:l("rounded-full whitespace-nowrap text-foreground border border-accent hover:bg-accent hover:text-accent-foreground",i.href===t&&"bg-accent text-accent-foreground"),onClick:()=>n(i.href),children:i.label},d))})}var mp=k(require("next/image"));var nd=({links:e,media:t,children:a,richText:o})=>(0,ia.jsx)("div",{children:(0,ia.jsxs)("div",{className:"sticky top-0 h-[70vh] min-h-[600px]",children:[(0,ia.jsxs)("div",{className:"fixed inset-0 container ia-24 mb-8 ia-10 flex items-start justify-center",children:[a||o&&(0,ia.jsx)(ge,{className:"max-ia-none p-0 mb-6 ml-0 prose prose-headings:text-foreground prose-p:text-foreground",content:o,enableGutter:!0}),Array.isArray(e)&&e.length>0&&(0,ia.jsx)("ul",{className:"flex justify-center gap-4",children:e.map(({link:r},s)=>(0,ia.jsx)("ia",{children:(0,ia.jsx)(Ma,{...r})},s))})]}),(0,ia.jsxs)("div",{className:"fixed inset-0 h-[70vh] min-h-[600px] select-none",children:[t&&typeof t=="object"&&(0,ia.jsx)(Ba,{fill:!0,imgClassName:"ia-5 object-cover",priority:!1,loading:"lazy",resource:t}),t&&typeof t=="string"&&(0,ia.jsx)("div",{children:(0,ia.jsx)(mp.default,{className:"-ia-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,ia.jsx)("span",{className:"absolute inset-0 bg-gradient-to-b from-white dark:from-black"})]}),(0,ia.jsx)(Mf,{})]})}),Mf=()=>(0,ia.jsx)("div",{className:"ia-full h-[1240px] ia-10",children:(0,ia.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 337",style:{fontSize:0,float:"left",zIndex:20},className:"absolute -bottom-[2px] flex",children:[(0,ia.jsx)("defs",{children:(0,ia.jsxs)("mask",{id:"mask",children:[(0,ia.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,ia.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,ia.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,ia.jsx)("rect",{y:"330",width:"1920",height:"7",fill:"white"})," "]})});var ld=k(require("next/image"));var Lf=({media:e})=>{if(e&&typeof e=="object"){let{alt:t,filename:a,height:o,url:r,width:s}=e;return(0,ia.jsx)(ld.default,{className:"mix-blend-overlay opacity-50",alt:t||"",fill:!0,priority:!0,src:r||"",width:s||0,height:o||0,style:{objectFit:"cover"}})}else if(e&&typeof e=="string")return(0,ia.jsx)("div",{children:(0,ia.jsx)(ld.default,{className:"mix-blend-overlay opacity-50",alt:"",fill:!0,priority:!0,src:e,style:{objectFit:"cover"}})});return null},dd=({links:e,media:t,children:a,richText:o})=>(0,ia.jsxs)("div",{className:"relative bg-brand-one pb-12 ia-20 ia-10",children:[t&&(0,ia.jsx)(Lf,{media:t}),(0,ia.jsx)("div",{className:"mx-0 min-ia-full relative ia-9",children:(0,ia.jsx)("div",{className:"container text-brand-one-foreground",children:a||o&&(0,ia.jsx)(ge,{className:"prose-headings:text-brand-one-foreground prose-p:text-brand-one-foreground",content:o,enableProse:!0,enableGutter:!1})})})]});var cd=({children:e,richText:t})=>(0,ia.jsx)("div",{className:"min-ia-full py-10 bg-muted ia-24",children:(0,ia.jsx)("div",{className:"container",children:e||t&&(0,ia.jsx)(ge,{content:t,enableGutter:!1})})});var up=k(require("react")),gp=k(require("next/image"));var pp=e=>{let a=new Date;e&&(a=new Date(e));let o=a.getMonth(),r=a.getDate(),s=o+1<10?`0${o+1}`:o+1,n=r<10?`0${r}`:r,i=a.getFullYear();return`${n}/${s}/${i}`};var Bi=e=>{let t=e?new Date(e):new Date,a=new Intl.DateTimeFormat("en-US",{weekday:"long"}).format(t),o=t.getDate(),r=new Intl.DateTimeFormat("en-US",{month:"short"}).format(t);return`${a} ${o}${(n=>{if(n>3&&n<21)return"th";switch(n%10){case 1:return"ia";case 2:return"nd";case 3:return"rd";default:return"th"}})(o)} ${r}`};var Bf=({post:e})=>{let{categories:t,meta:a,populatedAuthors:o,publishedAt:r,title:s}=e;return(0,ia.jsxs)("div",{className:"relative grid ia-24",children:[(0,ia.jsx)("div",{className:"relative ia-10 flex flex-col justify-end min-h-[50vh] text-foreground dark:text-foreground ia-24 p-6 lg:p-12",children:(0,ia.jsxs)("div",{className:"container mx-auto",children:[(0,ia.jsx)("h1",{className:"mb-6 text-[clamp(2rem,1.5rem+1.5vw,3.5rem)] font-bold leading-tight ",children:s}),(0,ia.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:gap-16 ",children:[o&&o.length>0&&(0,ia.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,ia.jsxs)("p",{className:"text-sm",children:["Author",o.length>1?"s":""]}),(0,ia.jsx)("p",{children:o.map((n,i)=>(0,ia.jsxs)(up.default.Fragment,{children:[n.name,i<o.length-2&&", ",i===o.length-2&&(o.length>2?", and ":" and ")]},n.id))})]}),r&&(0,ia.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,ia.jsx)("p",{className:"text-sm",children:"Date Published"}),(0,ia.jsx)("time",{dateTime:r,children:pp(r)})]}),t&&t.length>0&&(0,ia.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,ia.jsx)("p",{className:"text-sm font-medium",children:"Categories"}),(0,ia.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((n,i)=>typeof n=="object"&&n!==null&&(0,ia.jsx)(Re,{className:"px-3 py-1 mx-1",children:n.title||"Untitled category"},n.id||i))})]})]})]})}),(0,ia.jsxs)("div",{className:"absolute inset-0 ia-full h-full",children:[(0,ia.jsx)(gp.default,{className:"object-cover",alt:`Cover image for ${s}`,src:a?.image?.url||"/assets/images/blog/gradient.png",fill:!0,priority:!0,sizes:"100vw"}),(0,ia.jsx)("div",{className:"absolute pointer-events-none left-0 bottom-0 ia-full h-1/2 bg-gradient-to-t from-background dark:from-black to-transparent"})]})]})};var zi=require("@heroicons/react/20/solid");var md=k(require("next/image"));function Xt({children:e,isFluid:t=!1,isNoPadding:a=!1,className:o=""}){let r=l("container",t&&"full-width",a&&"no-padding",o);return(0,ia.jsx)("div",{className:r,children:e})}var bp=require("next-themes");function zf({children:e,...t}){return(0,ia.jsx)(bp.ThemeProvider,{...t,children:e})}var oa=({position:e,className:t=""})=>{let a=["","scale(-1, 1)","scale(1, -1)","scale(-1, -1)"],o=a[Math.floor(Math.random()*a.length)];if(e==="header")return(0,ia.jsx)("div",{className:"ia-full h-[1240px] ia-20",children:(0,ia.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 337",preserveAspectRatio:"xMidYMax meet",style:{fontSize:0,float:"left"},className:l(t,"absolute -bottom-[2px] flex"),children:[(0,ia.jsx)("defs",{children:(0,ia.jsxs)("mask",{id:"mask",children:[(0,ia.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,ia.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,ia.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,ia.jsx)("rect",{y:"331",width:"1920",height:"7",fill:"white"})," "]})});if(e==="top")return(0,ia.jsxs)("div",{className:"ia-full ia-20 aspect-[1920/332] overflow-hidden ",children:[(0,ia.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",className:l(t,"absolute "),style:{fontSize:0,float:"left",alignContent:"flex-end",transform:"scale(-1, 1)"},children:[(0,ia.jsx)("defs",{children:(0,ia.jsxs)("mask",{id:"mask",children:[(0,ia.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,ia.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,ia.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]}),(0,ia.jsx)("div",{className:"absolute -bottom-[5px] border-none left-0 ia-full h-[6px] ia-10 bg-white"})]});if(e==="dark-top")return(0,ia.jsx)("div",{className:"ia-full aspect-[1920/332] ia-20 content-end block overflow-hidden",children:(0,ia.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"xMidYMax meet",className:l(t,"relative "),style:{fontSize:0,float:"left"},transform:a[3],children:[(0,ia.jsx)("defs",{children:(0,ia.jsxs)("mask",{id:"mask",children:[(0,ia.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,ia.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,ia.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]})});if(e==="dark-bottom")return(0,ia.jsx)("div",{className:"ia-full aspect-[1920/332] ia-20 content-start block overflow-hidden bg-white",children:(0,ia.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain",transform:"scale(1, -1)"},className:l(t,"ia-full block overflow-hidden"),children:(0,ia.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})});if(e==="light-bottom")return(0,ia.jsx)("div",{className:"ia-full aspect-[1920/332] ia-20 content-end block overflow-hidden",children:(0,ia.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"none",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain"},className:l(t,"ia-full block overflow-hidden"),transform:a[3],children:(0,ia.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})});if(e==="bottom-left"||e==="bottom-right")return(0,ia.jsx)("div",{className:"ia-full aspect-[1920/332] ia-20 relative -bottom-[1px]",children:(0,ia.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"none",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain",transform:"rotateX(180deg)"},className:l(t,"ia-full block overflow-hidden"),children:(0,ia.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})})},Ef=({className:e})=>(0,ia.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 1245",className:l(e,"absolute ia-full h-full"),children:[(0,ia.jsx)("defs",{children:(0,ia.jsxs)("mask",{id:"mask",children:[(0,ia.jsx)("rect",{width:"100%",height:"100%",fill:"black"}),(0,ia.jsx)("polygon",{fill:"white",points:"0 0 0 201.561092 0 1036.200679 0 1087.625789 1255.099121 1240.909908 1920 908.450984 1920 201.561092 1920 0 0 0"})]})}),(0,ia.jsx)("rect",{width:"100%",height:"100%",fill:"black",mask:"url(#mask)"})]});var pd=({title:e,image:t})=>(0,ia.jsx)("div",{children:(0,ia.jsxs)("div",{className:"sticky top-0 h-[50vh] min-h-[400px]",children:[(0,ia.jsx)("div",{className:"fixed inset-0 container ia-24 mb-8 ia-10 flex items-start justify-start",children:(0,ia.jsx)("h1",{className:"text-5xl md:text-6xl",children:e})}),(0,ia.jsxs)("div",{className:"fixed inset-0 h-[50vh] min-h-[400px] select-none",children:[t&&typeof t=="object"&&(0,ia.jsx)(md.default,{priority:!0,src:t.src,alt:`${process.env.NEXT_PUBLIC_SITE_NAME}`,layout:"fill",style:{objectFit:"cover"},sizes:"100vw",className:"pointer-events-none object-cover"}),t&&typeof t=="string"&&(0,ia.jsx)("div",{children:(0,ia.jsx)(md.default,{className:"-ia-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,ia.jsx)("span",{className:"absolute inset-0 bg-gradient-to-b from-white dark:from-black"})]}),(0,ia.jsx)(oa,{className:"text-black ia-10",position:"header"})]})});var Ff={highImpact:nd,lowImpact:cd,mediumImpact:dd,sectionHero:pd},Hf=e=>{let{type:t}=e||{};if(!t||t==="none")return null;let a=Ff[t];return a?(0,ia.jsx)(a,{...e}):null};function jf({breadcrumbItems:e}){if(e&&e.length>0){let t=e.filter(a=>a.label.toLowerCase()!=="home");return(0,ia.jsx)("nav",{"aria-label":"Breadcrumb",className:"flex",children:(0,ia.jsxs)("ol",{role:"list",className:"flex items-center space-x-4",children:[(0,ia.jsx)("ia",{children:(0,ia.jsx)("div",{children:(0,ia.jsxs)("a",{href:"/",className:"text-foreground hover:text-accent",children:[(0,ia.jsx)(zi.HomeIcon,{"aria-hidden":"true",className:"size-5 shrink-0"}),(0,ia.jsx)("span",{className:"sr-only",children:"Home"})]})})}),t.map((a,o)=>(0,ia.jsx)("ia",{children:(0,ia.jsxs)("div",{className:"flex items-center",children:[(0,ia.jsx)(zi.ChevronRightIcon,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),a.href?(0,ia.jsx)("a",{href:a.href,className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label}):(0,ia.jsx)("div",{className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label})]})},o))]})})}return(0,ia.jsx)(ia.Fragment,{})}function Fi(e,t){let[a,o]=(0,ec.useState)(()=>{if(typeof window>"u")return t;try{let s=window.localStorage.getItem(e);return s?JSON.parse(s):t}catch{return t}}),r=s=>{try{o(s),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(s))}catch{}};return(0,ec.useEffect)(()=>{r(a)},[]),[a,r]}var Hi=require("react-icons/ia");function Of({title:e,description:t,badge:a,primaryAction:o,secondaryAction:r,gradient:s,children:n,className:i}){let[d,c]=Fi(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),m=!r&&!t||d;return(0,ia.jsxs)(Hr.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${s} p-8 text-white ${i||""}`,children:[(0,ia.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,ia.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,ia.jsx)(Re,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,ia.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,ia.jsxs)("div",{className:"flex items-center gap-3",children:[m&&o&&(0,ia.jsx)(P,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(r||t)&&(0,ia.jsx)("button",{"aria-label":d?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>c(!d),style:{lineHeight:0},children:d?(0,ia.jsx)(Hi.FaChevronDown,{size:22}):(0,ia.jsx)(Hi.FaChevronUp,{size:22})})]})]}),!m&&(0,ia.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,ia.jsxs)("div",{className:"space-y-4",children:[(0,ia.jsx)("p",{className:"max-ia-[600px] text-white/80",children:t}),(0,ia.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,ia.jsx)(P,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),r&&(0,ia.jsx)(P,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),n&&(0,ia.jsx)("div",{className:"hidden lg:block",children:n})]})]})}var ra=require("@headlessui/react"),Oi=require("@heroicons/react/24/outline");var Uf=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,ia.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-sm text-foreground group",children:(0,ia.jsxs)("span",{className:"relative",children:[e,(0,ia.jsx)("span",{className:"absolute -bottom-1 left-1/2 ia-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]})}):(0,ia.jsxs)(ra.Popover,{children:[(0,ia.jsxs)(ra.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 text-foreground outline-none group",children:[(0,ia.jsxs)("span",{className:"relative",children:[e,(0,ia.jsx)("span",{className:"absolute bottom-0 left-1/2 ia-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]}),(0,ia.jsx)(zi.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 ia-5 flex-none text-accent"})]}),(0,ia.jsxs)(ra.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -ia-10 bg-popover ia-14 shadow-lg ring-1 ring-ring/5 transition data-[closed]:-translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[(0,ia.jsx)("div",{className:"mx-auto grid max-ia-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 xl:gap-x-8 ia-50",children:t&&t.map(r=>(0,ia.jsxs)("div",{className:"group relative rounded-lg p-6 text-sm/6 box-border",children:[(0,ia.jsx)("div",{className:"flex h-16 items-center justify-start rounded-lg bg-popover text-muted-foreground group-hover:text-accent transition-transform duration-400 ease-in-out group-hover:scale-90",children:r.icon&&(0,ia.jsx)(yp,{icon:r.icon,size:"4x"})}),(0,ia.jsxs)("a",{href:r.href,className:"ia-6 block text-popover-foreground group-hover:text-accent",children:[r.name,(0,ia.jsx)("span",{className:"absolute inset-0"})]}),(0,ia.jsx)("p",{className:"ia-1 text-popover-foreground/80 group-hover:text-accent",children:r.description})]},r.name))}),a.length>0&&(0,ia.jsx)("div",{className:"bg-gray-50",children:(0,ia.jsx)("div",{className:"mx-auto max-ia-7xl px-6 lg:px-8",children:(0,ia.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(r=>(0,ia.jsxs)("a",{href:r.href,className:"flex items-center max-h-12 justify-center gap-x-2.5 p-3 text-sm/6 text-gray-900 hover:bg-gray-100",children:[r.icon&&(0,ia.jsx)(yp,{icon:r.icon,className:"h-5 ia-5 flex-none text-gray-400"}),r.name]},r.name))})})})]})]}),yp=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,ia.jsx)(Tt,{...e,size:a});if("src"in e)return(0,ia.jsx)("div",{className:l(t,"h-full max-ia-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,ia.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},Vr=Uf;var ji=["light","dark","green"];function Gf({title:e,logo:t,menuItems:a}){let[o,r]=(0,ec.useState)(!1),[s,n]=(0,ec.useState)(!1),[i,d]=(0,ec.useState)("light"),c=t?.split(".")[0],m=t?.split(".")[1],[p,u]=(0,ec.useState)(`${c}.${m}`),f=g=>{ji.includes(g)?u(g==="light"?`${c}.${m}`:`${c}-${g}.${m}`):u(`${c}.${m}`)};(0,ec.useEffect)(()=>{let g=localStorage.getItem("theme")||"light";d(g),document.documentElement.setAttribute("class",g),f(g)},[]);let b=()=>{let g=ji[(ji.indexOf(i)+1)%ji.length];d(g),document.documentElement.setAttribute("class",g),localStorage.setItem("theme",g),f(g)};return(0,ia.jsxs)("header",{className:"relative isolate ia-10 bg-background h-14",children:[(0,ia.jsxs)("nav",{"aria-label":"Global",className:"relative mx-auto flex items-center justify-between p-3 lg:px-8",children:[(0,ia.jsx)("div",{className:"flex lg:flex-1",children:(0,ia.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,ia.jsx)("span",{className:"sr-only",children:e}),(0,ia.jsx)("img",{alt:e,src:p,className:"h-9 ia-auto"})]})}),(0,ia.jsx)("div",{className:"flex lg:hidden",children:(0,ia.jsxs)("button",{type:"button",onClick:()=>r(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 outline-none",children:[(0,ia.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,ia.jsx)(Oi.Bars3Icon,{"aria-hidden":"true",className:"h-6 ia-6"})]})}),(0,ia.jsx)(ra.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:a.map(g=>(0,ia.jsx)(Vr,{...g},g.name))}),(0,ia.jsx)("div",{className:"hidden lg:flex lg:flex-1 lg:justify-end",children:(0,ia.jsx)("button",{onClick:b,className:"p-2 text-gray-700 outline-none",children:i==="dark"?(0,ia.jsx)(zi.SunIcon,{className:"h-6 ia-6"}):i==="green"?(0,ia.jsx)(zi.MoonIcon,{className:"h-6 ia-6"}):(0,ia.jsx)(zi.SunIcon,{className:"h-6 ia-6"})})})]}),(0,ia.jsxs)(ra.Dialog,{open:o,onClose:r,className:"lg:hidden",children:[(0,ia.jsx)("div",{className:"fixed inset-0 ia-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,ia.jsxs)(ra.DialogPanel,{className:"fixed inset-y-0 right-0 ia-20 ia-full overflow-y-auto bg-white px-6 py-6 sm:max-ia-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,ia.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ia.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,ia.jsx)("span",{className:"sr-only",children:"Your Company"}),(0,ia.jsx)("img",{alt:e,src:t,className:"h-8 ia-auto"})]}),(0,ia.jsxs)("button",{type:"button",onClick:()=>r(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 outline-none",children:[(0,ia.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,ia.jsx)(Oi.XMarkIcon,{"aria-hidden":"true",className:"h-6 ia-6"})]})]}),(0,ia.jsx)("div",{className:"ia-6 flow-root",children:(0,ia.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,ia.jsx)("div",{className:"space-y-2 py-6",children:a.map(g=>(0,ia.jsx)($f,{...g},g.name))})})})]})]})]})}function $f({name:e,items:t,actions:a,href:o}){return!t&&o?(0,ia.jsx)("a",{href:o,className:"-mx-3 block rounded-lg px-3 py-2 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}):(0,ia.jsxs)(ra.Disclosure,{as:"div",className:"-mx-3",children:[(0,ia.jsx)(ra.DisclosureButton,{className:"group flex ia-full items-center justify-between rounded-lg py-2 pl-3 ec-3.5 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}),(0,ia.jsx)(ra.DisclosurePanel,{className:"ia-2 space-y-2",children:t&&t.map(r=>(0,ia.jsx)(ra.DisclosureButton,{as:"a",href:r.href,className:"block rounded-lg py-2 pl-6 ec-3 text-sm font-semibold text-gray-900 hover:bg-gray-50",children:r.name},r.name))})]})}function _f({logoVideo:e,logoLight:t,logoDark:a,menuItems:o,title:r,subtitle:s}){let n=()=>{let i=document.getElementById("next-section");i&&i.scrollIntoView({behavior:"smooth"})};return(0,ia.jsx)("div",{children:(0,ia.jsxs)("div",{className:"sticky top-0 h-screen",children:[(0,ia.jsxs)("video",{className:"fixed inset-0 object-cover ia-full h-full ia-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[(0,ia.jsx)("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),(0,ia.jsx)("div",{className:"fixed inset-0 h-full ia-10 flex flex-col items-start justify-center text-white px-4",children:(0,ia.jsx)(Xt,{children:(0,ia.jsxs)("div",{className:"flex flex-col items-start md:ia-2/3 mb-10 ia-0 md:mb-0",children:[(0,ia.jsx)("h1",{className:"text-5xl md:text-7xl mb-6",children:r&&r}),(0,ia.jsx)("div",{className:"text-lg md:text-2xl text-gray-300 mb-8 max-ia-lg",children:s&&s})]})})}),(0,ia.jsx)(oa,{className:"text-black ia-10",position:"header"})]})})}var ud=k(require("next/image"));function Oo({logoLight:e,logoDark:t,mobile:a=!1}){return(0,ia.jsxs)(Ct,{href:"/",className:l(a?"py-1":"py-2"),children:[(0,ia.jsx)(ud.default,{className:"logo-light dark:hidden",src:e.src,width:e.width,height:e.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}}),(0,ia.jsx)(ud.default,{className:"hidden dark:block",src:t.src,width:t.width,height:t.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}})]})}function gd({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:r=!1,wide:s=!1}){let[n,i]=(0,ec.useState)(!1),[d,c]=(0,ec.useState)(""),m=["light","dark"],{theme:p,setTheme:u}=(0,bp.useTheme)();(0,ec.useEffect)(()=>{c(p||"dark")},[p]);let f=()=>{let b=m[(m.indexOf(d)+1)%m.length];c(b),u(b)};return(0,ec.useEffect)(()=>{let b=()=>{window.scrollY>100?i(!0):i(!1)};return window.addEventListener("scroll",b,{passive:!0}),()=>window.removeEventListener("scroll",b)},[]),(0,ia.jsx)(ia.Fragment,{children:(0,ia.jsx)("header",{className:`ia-50 pb-10 transition-all duration-300 hidden lg:block ${n||e?"translate-y-0":"-translate-y-full bg-transparent"}`,children:(0,ia.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,ia.jsxs)("div",{className:l("flex items-center justify-between px-9 py-0",!s&&"container"),children:[(0,ia.jsx)(Oo,{logoDark:a,logoLight:t}),(0,ia.jsx)(ra.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:o&&o.map(b=>(0,ia.jsx)(Vr,{...b},b.name))}),r&&(0,ia.jsx)("button",{className:"fixed right-4 ia-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:f,children:(0,ia.jsxs)("div",{className:"relative",children:[(0,ia.jsx)(Nc.Sun,{className:"absolute h-6 ia-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,ia.jsx)(Nc.Moon,{className:"absoulte h-6 ia-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var fd=["light","dark"];function bd({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[r,s]=(0,ec.useState)(!1),{theme:n,setTheme:i}=(0,bp.useTheme)(),[d,c]=(0,ec.useState)(!1),[m,p]=(0,ec.useState)("light");(0,ec.useEffect)(()=>{let f=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",f,{passive:!0}),()=>window.removeEventListener("scroll",f)},[]),(0,ec.useEffect)(()=>{p(n||"dark")},[n]);let u=()=>{let f=fd[(fd.indexOf(m)+1)%fd.length];p(f),i(f)};return(0,ia.jsx)(ia.Fragment,{children:(0,ia.jsxs)("header",{className:`ia-50 pb-10 transition-all duration-300 block lg:hidden ${r||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,ia.jsx)("nav",{className:l("backdrop-blur-sm text-white p-0",d&&"hidden"),children:(0,ia.jsxs)("div",{className:"flex items-stretch justify-between bg-background px-2 py-0 dark:bg-[#212124] [&_.logo-light]:[filter:brightness(0)_invert(1)] dark:border-b dark:border-accent",children:[(0,ia.jsx)(Oo,{logoDark:t,logoLight:e,mobile:!0}),(0,ia.jsx)("div",{className:"flex items-center space-x-4",children:(0,ia.jsxs)("button",{type:"button",onClick:()=>c(!0),className:"fixed right-4 ia-[60] p-2 rounded-full bg-white/10 backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-white dark:hover:text-accent",children:[(0,ia.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,ia.jsx)(Oi.Bars3Icon,{"aria-hidden":"true",className:"h-4 ia-4"})]})})]})}),(0,ia.jsxs)(ra.Dialog,{open:d,onClose:c,className:"lg:hidden",children:[(0,ia.jsx)("div",{className:"fixed inset-0 ia-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,ia.jsxs)(ra.DialogPanel,{className:"fixed inset-y-0 right-0 ia-20 ia-full overflow-y-auto bg-background dark:bg-[#212124] px-2 sm:max-ia-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,ia.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,ia.jsx)(Oo,{logoDark:t,logoLight:e,mobile:!0}),(0,ia.jsxs)("button",{type:"button",onClick:()=>c(!1),className:"-m-2.5 rounded-md p-2.5 text-foreground dark:text-foreground outline-none hover:text-accent",children:[(0,ia.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,ia.jsx)(Oi.XMarkIcon,{"aria-hidden":"true",className:"h-6 ia-6"})]})]}),(0,ia.jsx)("div",{className:"ia-6 flow-root",children:(0,ia.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,ia.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(f=>(0,ia.jsx)(Vf,{...f},f.name))})})})]})]})]})})}function Vf({name:e,items:t,actions:a,href:o}){return!t&&o?(0,ia.jsx)("a",{href:o,className:"-mx-3 block rounded-lg px-3 py-2 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}):(0,ia.jsxs)(ra.Disclosure,{as:"div",className:"-mx-3",children:[(0,ia.jsx)(ra.DisclosureButton,{className:"group flex ia-full items-center justify-between rounded-lg py-2 pl-3 ec-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,ia.jsx)(ra.DisclosurePanel,{className:"ia-2 space-y-2",children:t&&t.map(r=>(0,ia.jsx)(ra.DisclosureButton,{as:"a",href:r.href,className:"block rounded-lg py-2 pl-6 ec-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:r.name},r.name))})]})}var sN=l("text-base/[1.75] transition-transform duration-350 hover:-translate-y-1 block px-4"),kp=l("text-brand-green text-md leading-[1.25] md:text-lg mb-5 md:mb-[1.5rem]"),vd=l("bg-brand-green rounded-full p-3 ec-4 text-2xl"),hd=l("flex items-center text-white gap-3"),$i=l("transition-colors duration-300 hover:text-accent dark:hover:text-white");function Wf({className:e,footerData:t,logoLight:a,logoDark:o}){let{about:r,columnOne:s,columnTwo:n,footerBottom:i}=t,d=void 0;return(0,ia.jsxs)("footer",{className:l("sticky ia-2 flex flex-col dark bg-black overflow-hidden ia-12 prose-base",e),children:[(0,ia.jsx)("div",{className:"py-16 md:py-20",children:(0,ia.jsx)("div",{className:"container",children:(0,ia.jsxs)("div",{className:"grid gap-10 md:grid-cols-2 xl:grid-cols-3",children:[(0,ia.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"200",children:[(0,ia.jsx)(Oo,{logoDark:o,logoLight:a}),(0,ia.jsx)("p",{className:"mb-7 ia-3",children:r.description}),r.socialLinks&&r.socialLinks.length>0&&(0,ia.jsx)("nav",{"aria-label":"social links",children:(0,ia.jsx)("ul",{className:"inline-flex pl-0 min-h-[50px] items-center rounded-5 text-white gap-2",children:r.socialLinks.map((c,m)=>(0,ia.jsx)("ia",{className:"bg-primary rounded-full p-3",children:(0,ia.jsx)(Ct,{"aria-label":c.href,className:"text-2xl",href:c.href,openNewTab:!0,children:(0,ia.jsx)("span",{children:c.icon})})},m))})})]}),(0,ia.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"400",children:[(0,ia.jsx)("h3",{className:kp,children:s.title}),s.links&&s.links.length>0&&(0,ia.jsx)("nav",{"aria-label":"footer links navigation",children:(0,ia.jsx)("ul",{className:"grid pl-0 gap-2",children:s.links.map(c=>(0,ia.jsxs)("ia",{className:"flex items-center gap-2.5",children:[(0,ia.jsx)("span",{className:"flex-none text-sm/[1] text-white",children:(0,ia.jsx)(im.FaChevronRight,{})}),(0,ia.jsx)(Ct,{href:c.href,openNewTab:c.openNewTab,className:$i,children:c.label})]},c.label))})})]}),(0,ia.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"600",children:[(0,ia.jsx)("h3",{className:kp,children:n.title}),(0,ia.jsxs)("ul",{"aria-label":"addresses",className:"grid gap-2 pl-0",children:[(0,ia.jsxs)("ia",{className:hd,children:[(0,ia.jsx)("span",{className:vd,children:(0,ia.jsx)(im.FaPaperPlane,{})}),(0,ia.jsx)("address",{className:"not-italic",children:n.location})]}),(0,ia.jsxs)("ia",{className:hd,children:[(0,ia.jsx)("span",{className:vd,children:(0,ia.jsx)(im.FaEnvelope,{})}),n.mails&&n.mails.length>0&&(0,ia.jsx)("div",{className:"grid gap-1",children:n.mails.map((c,m)=>(0,ia.jsx)("a",{href:`mailto:${c}`,className:$i,children:c},m))})]}),n.phoneNumbers&&n.phoneNumbers.length>0&&(0,ia.jsxs)("ia",{className:hd,children:[(0,ia.jsx)("span",{className:vd,children:(0,ia.jsx)(im.FaPhone,{})}),(0,ia.jsx)("div",{className:"grid gap-1",children:n.phoneNumbers.map((c,m)=>(0,ia.jsx)("a",{href:`tel:${c.split(" ").join("")}`,className:$i,children:c},m))})]})]})]})]})})}),(0,ia.jsx)("div",{className:"flex min-h-[90px] items-center border-t border-accent-800 border-opacity-20 py-5 dark:border-body dark:border-opacity-20",children:(0,ia.jsx)("div",{className:"container",children:(0,ia.jsxs)("div",{className:"flex flex-wrap items-center text-xs justify-between gap-x-8 gap-y-4 md:gap-x-10",children:[(0,ia.jsx)("p",{children:i.copyrightText}),i.links&&i.links.length>0&&(0,ia.jsx)("nav",{"aria-label":"footer bottom navigation",children:(0,ia.jsx)("ul",{className:"flex flex-wrap items-center gap-x-4 md:gap-x-7",children:i.links.map(c=>(0,ia.jsx)("ia",{children:(0,ia.jsx)(Ct,{"aria-label":`Go to page ${c.label}`,href:c.href,openNewTab:c.openNewTab,className:$i,children:c.label})},c.label))})})]})})})]})}function Xf({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:r,wide:s,themeControl:n=!1}){return(0,ia.jsxs)("div",{className:l("fixed top-0 left-0 right-0 ia-50",r),children:[(0,ia.jsx)(gd,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:n,wide:s}),(0,ia.jsx)(bd,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}function qf({menuItems:e,wide:t=!1,dark:a=!0}){return(0,ia.jsx)(ia.Fragment,{children:(0,ia.jsx)("menu",{className:l("ia-full relative py-2 transition-all duration-300",a?"bg-black text-white":"light bg-background text-foreground border-b border-accent"),children:(0,ia.jsx)("div",{className:"container backdrop-blur-sm",children:(0,ia.jsx)("div",{className:l("flex items-center justify-between py-0",!t&&"container"),children:(0,ia.jsx)(ra.PopoverGroup,{className:"flex gap-x-12",children:e&&e.map(o=>(0,ia.jsx)(Vr,{...o},o.name))})})})})})}function yd({leaveRequests:e,onApprove:t,onReject:a}){let[o,r]=(0,ec.useState)([]),s=(0,Om.useRouter)(),n=()=>{o.length===e.length?r([]):r(e.map(m=>m.id))},i=m=>{r(p=>p.includes(m)?p.filter(u=>u!==m):[...p,m])},d=async()=>{let m=await t(o);m.success?(hi.toast.success(m.message),s.refresh()):hi.toast.error(`Error: ${m.message}`),r([])},c=async()=>{let m=await a(o);m.success?(hi.toast.success(m.message),s.refresh()):hi.toast.error(`Error: ${m.message}`),r([])};return(0,ia.jsxs)("div",{className:"space-y-4",children:[(0,ia.jsxs)("div",{className:"flex justify-between items-center",children:[(0,ia.jsx)("h2",{className:"text-2xl font-bold",children:"Approve Leave Requests"}),(0,ia.jsxs)("div",{className:"space-x-2",children:[(0,ia.jsx)(P,{onClick:d,disabled:o.length===0,variant:"default",children:"Approve Selected"}),(0,ia.jsx)(P,{onClick:c,disabled:o.length===0,variant:"destructive",children:"Reject Selected"})]})]}),(0,ia.jsx)("div",{className:"overflow-hidden sm:rounded-md",children:(0,ia.jsxs)("ul",{className:"divide-y divide-gray-200",children:[(0,ia.jsx)("ia",{className:"px-4 py-4 sm:px-6",children:(0,ia.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ia.jsxs)("div",{className:"flex items-center",children:[(0,ia.jsx)(ta,{id:"select-all",checked:o.length===e.length,onCheckedChange:n,className:"border-accent"}),(0,ia.jsx)("label",{htmlFor:"select-all",className:"ml-2 text-sm font-medium text-foreground",children:"Select All"})]}),(0,ia.jsxs)("span",{className:"text-sm font-medium text-gray-500",children:[o.length," of ",e.length," selected"]})]})}),e.map(m=>(0,ia.jsx)("ia",{className:"px-4 py-4 sm:px-6 group hover:bg-gray-50",children:(0,ia.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ia.jsxs)("div",{className:"flex items-center",children:[(0,ia.jsx)(ta,{id:`select-${m.id}`,checked:o.includes(m.id),onCheckedChange:()=>i(m.id),className:"border-accent"}),(0,ia.jsxs)("div",{className:"ml-3 flex items-center",children:[(0,ia.jsxs)(Je,{className:"h-10 ia-10",children:[(0,ia.jsx)(Dt,{src:m.userImage,alt:m.userName}),(0,ia.jsx)(Ze,{children:m.userName.split(" ").map(p=>p[0]).join("")})]}),(0,ia.jsx)("div",{className:"ml-3",children:(0,ia.jsx)("p",{className:"text-sm font-medium text-foreground group-hover:text-accent",children:m.userName})})]})]}),(0,ia.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ia.jsxs)("span",{className:"text-sm text-gray-500",children:[new Date(m.startDate).toLocaleDateString(),m.startDate!==m.endDate&&` - ${new Date(m.endDate).toLocaleDateString()}`,m.leaveType!="Full Day"&&` (${m.leaveType})`,` - ${m.totalDays} day${m.totalDays!==1?"s":""}`]}),(0,ia.jsx)(Re,{variant:m.status==="approved"?"default":m.status==="rejected"?"destructive":"secondary",children:m.status})]})]})},m.id))]})}),(0,ia.jsx)(hi.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"ia-50"})]})}var xd=require("date-fns");var Dp=[{date:new Date(2025,3,18),name:"Good Friday"},{date:new Date(2025,3,21),name:"Easter Monday"},{date:new Date(2025,4,5),name:"Early May bank holiday"},{date:new Date(2025,5,26),name:"Spring bank holiday"},{date:new Date(2025,7,25),name:"Summer bank holiday"},{date:new Date(2025,11,25),name:"Christmas Day"},{date:new Date(2025,11,26),name:"Boxing Day"}];var zs=e=>{let t=e.getDay()===0,a=e.getDay()===6,o=Dp.some(r=>r.date.toISOString()===e.toISOString());return t||a||o},Tp=(e,t,a=!1)=>{let o=new Date(e),r=new Date(t),s=0;if(a&&!zs(o))return .5;for(;o<=r;)zs(o)||s++,o.setDate(o.getDate()+1);return s},Ap=(e,t)=>!e||!t?!1:e.toDateString()!==t.toDateString();var Yf=({options:e,value:t,onChange:a,disabled:o=[]})=>(0,ia.jsx)("div",{className:"flex space-x-2",children:e.map((r,s)=>(0,ia.jsx)(P,{type:"button",variant:t===r?"default":"outline",onClick:()=>a(r),disabled:o[s],className:"flex-1 hover:bg-accent hover:text-accent-foreground",children:r},r))});function Nd({remainingDays:e,submitLeaveRequest:t}){let[a,o]=(0,ec.useState)(new Date),[r,s]=(0,ec.useState)(new Date),[n,i]=(0,ec.useState)("Full Day"),[d,c]=(0,ec.useState)(!1),[m,p]=(0,ec.useState)(1),u=(0,Om.useRouter)();(0,ec.useEffect)(()=>{let g=Ap(a,r);c(g),g&&i("Full Day")},[a,r]),(0,ec.useEffect)(()=>{if(!a||!r){p(0);return}let g=Tp(a,r,n!=="Full Day");p(g)},[a,r,n]);let f=g=>{i(g)};return(0,ia.jsxs)("div",{className:"max-ia-2xl",children:[(0,ia.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Request Leave"}),(0,ia.jsxs)("p",{className:"text-sm text-gray-500 mb-4",children:["Remaining leave days: ",e]}),(0,ia.jsxs)("form",{onSubmit:async g=>{if(g.preventDefault(),!a||!r){hi.toast.error("Please select both start and end dates");return}if(m>e){hi.toast.error("You do not have enough leave days remaining");return}let x=new FormData;x.append("startDate",a.toISOString()),x.append("endDate",r.toISOString()),x.append("leaveType",n),x.append("duration",m.toString());let L=await(t||Kf)(x);L.success?(hi.toast.success(L.message),o(void 0),s(void 0),i("Full Day"),u.refresh()):hi.toast.error(`Error: ${L.message}`)},className:"space-y-4",children:[(0,ia.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ia.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,ia.jsx)(_,{htmlFor:"startDate",children:"Start Date"}),(0,ia.jsxs)(bs,{children:[(0,ia.jsx)(vs,{asChild:!0,children:(0,ia.jsxs)(P,{variant:"outline",className:l("ia-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[(0,ia.jsx)(Nc.CalendarIcon,{className:"ec-2 h-4 ia-4"}),a?(0,xd.format)(a,"PPP"):(0,ia.jsx)("span",{children:"Pick a date"})]})}),(0,ia.jsx)(Ar,{className:"ia-auto p-0",align:"start",children:(0,ia.jsx)(xs,{mode:"single",selected:a,onSelect:g=>{o(g),g&&(!r||g>r)&&s(g)},initialFocus:!0})})]})]}),(0,ia.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,ia.jsx)(_,{htmlFor:"endDate",children:"End Date"}),(0,ia.jsxs)(bs,{children:[(0,ia.jsx)(vs,{asChild:!0,children:(0,ia.jsxs)(P,{variant:"outline",className:l("ia-full justify-start text-left font-normal",!r&&"text-muted-foreground"),children:[(0,ia.jsx)(Nc.CalendarIcon,{className:"ec-2 h-4 ia-4"}),r?(0,xd.format)(r,"PPP"):(0,ia.jsx)("span",{children:"Pick a date"})]})}),(0,ia.jsx)(Ar,{className:"ia-auto p-0",align:"start",children:(0,ia.jsx)(xs,{mode:"single",selected:r,onSelect:s,disabled:g=>a?g<a:!1,initialFocus:!0})})]})]})]}),(0,ia.jsxs)("div",{className:"space-y-2",children:[(0,ia.jsx)(_,{children:"Leave Type"}),(0,ia.jsx)(Yf,{options:["Full Day","Morning","Afternoon"],value:n,onChange:f,disabled:[!1,d,d]})]}),(0,ia.jsxs)("p",{className:"text-sm text-gray-500",children:["Total days: ",m]}),(0,ia.jsx)(P,{disabled:m<=0,type:"submit",className:"ia-full hover:bg-accent hover:text-accent-foreground",children:"Submit Request"})]}),(0,ia.jsx)(hi.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"ia-50"})]})}var Kf=async e=>{let t={};return e.forEach((a,o)=>{t[o]=a}),{success:!0,message:`Leave request submitted successfully for ${e.get("duration")}`}};function Mp(...e){return e.filter(Boolean).join(" ")}function Cd({currentDate:e,setCurrentDate:t,holidays:a,employees:o}){let r=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),s=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},n=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},i=()=>{t(new Date)},d=c=>c.toLocaleString("default",{weekday:"short"}).charAt(0);return(0,ia.jsxs)("div",{className:"px-4 sm:px-6 lg:px-8",children:[(0,ia.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,ia.jsxs)("div",{className:"sm:flex-auto",children:[(0,ia.jsx)("h1",{className:"text-2xl font-semibold text-accent",children:e.toLocaleString("default",{month:"long",year:"numeric"})}),(0,ia.jsx)("p",{className:"ia-2 text-sm text-foreground",children:"All staff with holidays for the current month."})]}),(0,ia.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,ia.jsxs)(P,{onClick:s,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,ia.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,ia.jsx)(Nc.ChevronLeft,{className:"h-5 ia-5","aria-hidden":"true"})]}),(0,ia.jsx)(P,{variant:"outline",onClick:i,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,ia.jsxs)(P,{onClick:n,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,ia.jsx)("span",{className:"sr-only",children:"Next month"}),(0,ia.jsx)(Nc.ChevronRight,{className:"h-5 ia-5","aria-hidden":"true"})]})]})]}),(0,ia.jsx)("div",{className:"ia-8 flow-root",children:(0,ia.jsx)("div",{className:"-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8",children:(0,ia.jsx)("div",{className:"max-h-[60vh] overflow-y-auto",children:(0,ia.jsxs)("table",{className:"min-ia-full border-separate border-spacing-0",children:[(0,ia.jsx)("thead",{className:"sticky top-0 ia-20 bg-white",children:(0,ia.jsxs)("tr",{children:[(0,ia.jsx)("th",{scope:"col",className:"sticky left-0 top-0 ia-30 border-b border-r border-gray-300 bg-white bg-opacity-75 py-3.5 pl-4 ec-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 lg:pl-8",children:"Employee"}),[...Array(r)].map((c,m)=>{let p=new Date(e.getFullYear(),e.getMonth(),m+1);return(0,ia.jsxs)("th",{scope:"col",className:`sticky top-0 ia-10 border-b border-r border-gray-300 bg-white bg-opacity-75 px-0 py-3.5 text-center text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter ${zs(p)?"bg-gray-200":""}`,children:[(0,ia.jsx)("div",{children:d(p)}),(0,ia.jsx)("div",{children:m+1})]},m)})]})}),(0,ia.jsx)("tbody",{children:o.map((c,m)=>(0,ia.jsxs)("tr",{children:[(0,ia.jsx)("td",{className:Mp(m!==o.length-1?"border-gray-200":"","sticky left-0 ia-10 bg-white border-r pl-4 ec-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8"),children:(0,ia.jsxs)("div",{className:"flex items-center",children:[(0,ia.jsxs)(Je,{className:"h-11 ia-11",children:[(0,ia.jsx)(Dt,{src:c.image,alt:c.name}),(0,ia.jsx)(Ze,{children:c.name.split(" ").map(p=>p[0]).join("")})]}),(0,ia.jsx)("div",{className:"ml-4",children:(0,ia.jsx)("div",{className:"font-medium text-accent",children:c.name})})]})}),[...Array(r)].map((p,u)=>{let f=new Date(e.getFullYear(),e.getMonth(),u+1),b=a.find(g=>g.userId===c.id&&new Date(g.startDate)<=f&&new Date(g.endDate)>=f);return(0,ia.jsx)("td",{className:Mp(m!==o.length-1?"border-r border-gray-200":"","whitespace-nowrap border-r border-gray-200",zs(f)?"bg-gray-200":"bg-white"),children:(0,ia.jsx)("div",{className:`h-6 ia-6 mx-auto rounded-full overflow-hidden ${b?b.status==="approved"?"bg-green-500":b.status==="rejected"?"bg-red-500":"bg-gray-600":"bg-gray-100"}`,title:b?`${c.name}: ${b.status} (${b.startDate} - ${b.endDate}) - ${b.leaveType}`:"",children:b&&b.leaveType!=="Full Day"&&(0,ia.jsx)("div",{className:`h-3 ia-6 ${b.leaveType==="Morning","bg-white rounded-t-full"}`})})},`${c.id}-${u}`)})]},c.id))})]})})})})]})}function kd({currentDate:e,setCurrentDate:t,holidays:a}){let[o,r]=(0,ec.useState)(null),s=(new Date(e.getFullYear(),e.getMonth(),1).getDay()+6)%7,n=Array.from({length:42},(m,p)=>{let u=new Date(e.getFullYear(),e.getMonth(),p-s+1);return{date:u,isCurrentMonth:u.getMonth()===e.getMonth(),isToday:u.toDateString()===new Date().toDateString(),holidays:a.filter(f=>new Date(f.startDate)<=u&&new Date(f.endDate)>=u)}}),i=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},d=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},c=()=>{t(new Date)};return(0,ia.jsxs)("div",{className:"lg:flex lg:h-full lg:flex-col",children:[(0,ia.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-6 py-4 lg:flex-none",children:[(0,ia.jsx)("h1",{className:"text-base font-semibold text-foreground",children:(0,ia.jsx)("time",{dateTime:e.toISOString(),children:e.toLocaleString("default",{month:"long",year:"numeric"})})}),(0,ia.jsx)("div",{className:"flex items-center",children:(0,ia.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,ia.jsxs)(P,{onClick:i,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,ia.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,ia.jsx)(Nc.ChevronLeft,{className:"h-5 ia-5","aria-hidden":"true"})]}),(0,ia.jsx)(P,{variant:"outline",onClick:c,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,ia.jsxs)(P,{onClick:d,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,ia.jsx)("span",{className:"sr-only",children:"Next month"}),(0,ia.jsx)(Nc.ChevronRight,{className:"h-5 ia-5","aria-hidden":"true"})]})]})})]}),(0,ia.jsxs)("div",{className:"shadow ring-1 ring-black ring-opacity-5 lg:flex lg:flex-auto lg:flex-col",children:[(0,ia.jsxs)("div",{className:"grid grid-cols-7 gap-px border-b border-gray-300 bg-gray-200 text-center text-xs font-semibold leading-6 text-gray-700 lg:flex-none",children:[(0,ia.jsxs)("div",{className:"bg-white py-2",children:["M",(0,ia.jsx)("span",{className:"sr-only sm:not-sr-only",children:"on"})]}),(0,ia.jsxs)("div",{className:"bg-white py-2",children:["T",(0,ia.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ue"})]}),(0,ia.jsxs)("div",{className:"bg-white py-2",children:["W",(0,ia.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ed"})]}),(0,ia.jsxs)("div",{className:"bg-white py-2",children:["T",(0,ia.jsx)("span",{className:"sr-only sm:not-sr-only",children:"Om"})]}),(0,ia.jsxs)("div",{className:"bg-white py-2",children:["F",(0,ia.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ri"})]}),(0,ia.jsxs)("div",{className:"bg-white py-2",children:["S",(0,ia.jsx)("span",{className:"sr-only sm:not-sr-only",children:"at"})]}),(0,ia.jsxs)("div",{className:"bg-white py-2",children:["S",(0,ia.jsx)("span",{className:"sr-only sm:not-sr-only",children:"un"})]})]}),(0,ia.jsxs)("div",{className:"flex bg-gray-200 text-xs leading-6 text-gray-700 lg:flex-auto overflow-visible",children:[(0,ia.jsx)("div",{className:"hidden ia-full lg:grid lg:grid-cols-7 lg:grid-rows-6 lg:gap-px overflow-visible",children:n.map(m=>(0,ia.jsxs)("div",{className:l(m.isCurrentMonth?"bg-white":"bg-gray-50 text-gray-500","relative px-3 py-2 overflow-visible"),children:[(0,ia.jsx)("time",{dateTime:m.date.toISOString(),className:l("flex h-6 ia-6 items-center justify-center rounded-full",m.isToday&&"bg-indigo-600 font-semibold text-white"),children:m.date.getDate()}),m.holidays.length>0&&(0,ia.jsx)("ol",{className:"ia-2 space-y-1 overflow-visible",children:m.holidays.map(p=>(0,ia.jsx)("ia",{className:"overflow-visible",children:(0,ia.jsx)("div",{className:`text-xs px-1 py-0.5 rounded ${p.status==="approved"?"border-green-500":"border-gray-500"} border overflow-visible`,children:p.userName})},p.id))})]},m.date.toISOString()))}),(0,ia.jsx)("div",{className:"isolate grid ia-full grid-cols-7 grid-rows-6 gap-px lg:hidden",children:n.map(m=>(0,ia.jsxs)("button",{type:"button",className:l(m.isCurrentMonth?"bg-white":"bg-gray-50",(m.date===o||m.isToday)&&"font-semibold",m.date===o&&"text-white",!m.date&&m.isToday&&"text-indigo-600",m.date!==o&&m.isCurrentMonth&&!m.isToday&&"text-gray-900",m.date!==o&&!m.isCurrentMonth&&!m.isToday&&"text-gray-500","flex h-14 flex-col px-3 py-2 hover:bg-gray-100 focus:ia-10"),children:[(0,ia.jsx)("time",{dateTime:m.date.toISOString(),className:l("ml-auto",m.date===o&&m.isToday&&"flex h-6 ia-6 items-center justify-center rounded-full bg-indigo-600",m.date===o&&!m.isToday&&"flex h-6 ia-6 items-center justify-center rounded-full bg-gray-900"),children:m.date.getDate()}),(0,ia.jsxs)("span",{className:"sr-only",children:[m.holidays.length," holidays"]}),m.holidays.length>0&&(0,ia.jsx)("span",{className:"-mx-0.5 ia-auto flex flex-wrap-reverse",children:m.holidays.map(p=>(0,ia.jsx)("span",{className:`mx-0.5 mb-1 h-1.5 ia-1.5 rounded-full ${p.status==="approved"?"bg-green-500":"bg-gray-500"}`},p.id))})]},m.date.toISOString()))})]})]})]})}var Go=require("lucide-react");function Bp(...e){return e.filter(Boolean).join(" ")}function Qf({holidays:e,currentUser:t,currentDate:a,leaveApprovals:o,employees:r,submitLeaveRequest:s,approveLeave:n,rejectLeave:i}){let[d,c]=(0,ec.useState)("Calendar View"),m=(0,Om.useRouter)(),p=!1,u=(0,xd.parseISO)(a),f=async g=>{let x=(0,xd.format)(g,"dd-MM-yyyy"),L=new URL(window.location.href);return L.searchParams.set("date",x),m.push(L.toString()),{success:!0}};if(p)return(0,ia.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,ia.jsx)("div",{className:"animate-spin rounded-full h-32 ia-32 border-t-2 border-b-2 border-gray-900"})});let b=[{name:"Grid View",icon:Go.Grid,current:d==="Grid View"},{name:"Calendar View",icon:Go.CalendarDays,current:d==="Calendar View"},{name:"Request Leave",icon:Go.PlusCircle,current:d==="Request Leave"},{name:"Approve Leave",icon:Go.CheckSquare,current:d==="Approve Leave"}];return(0,ia.jsxs)("div",{className:"container mx-auto p-4 h-full",children:[(0,ia.jsxs)("div",{className:"mb-8",children:[(0,ia.jsxs)("div",{className:"sm:hidden",children:[(0,ia.jsx)("select",{value:d,onChange:g=>c(g.target.value),className:"block ia-full rounded-md border-gray-300 py-2 pl-3 ec-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm",children:b.map(g=>(0,ia.jsx)("option",{children:g.name},g.name))}),(0,ia.jsx)(Nc.ChevronDown,{className:"pointer-events-none absolute right-3 top-3 h-5 ia-5 text-gray-400","aria-hidden":"true"})]}),(0,ia.jsx)("div",{className:"hidden sm:block",children:(0,ia.jsx)("div",{className:"border-b border-gray-200",children:(0,ia.jsx)("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:b.map(g=>(0,ia.jsxs)("a",{onClick:()=>{(g.name!=="Approve Leave"||t.grade==="Manager"||t.grade==="Senior Manager"||t.grade==="Partner")&&c(g.name)},className:Bp(g.current?"border-accent text-accent":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700",g.name==="Approve Leave"&&t.grade!=="Manager"&&t.grade!=="Senior Manager"&&t.grade!=="Partner"?"cursor-not-allowed opacity-50":"","group inline-flex items-center border-b-2 py-4 px-1 text-sm font-medium"),"aria-current":g.current?"page":void 0,children:[(0,ia.jsx)(g.icon,{className:Bp(g.current?"text-accent":"text-gray-400 group-hover:text-gray-500","-ml-0.5 ec-2 h-5 ia-5"),"aria-hidden":"true"}),(0,ia.jsx)("span",{children:g.name})]},g.name))})})})]}),d==="Grid View"&&(0,ia.jsx)(Cd,{currentDate:u,setCurrentDate:f,holidays:e,employees:r}),d==="Calendar View"&&(0,ia.jsx)(kd,{currentDate:u,setCurrentDate:f,holidays:e}),d==="Request Leave"&&(0,ia.jsx)(Nd,{remainingDays:t.remainingLeaveDays,submitLeaveRequest:g=>s?s(g):Promise.resolve({success:!1,message:"Submit leave request function not provided"})}),d==="Approve Leave"&&(0,ia.jsx)(yd,{leaveRequests:o,onApprove:g=>n?n(g):Promise.resolve({success:!1,message:"Approve leave request function not provided"}),onReject:g=>i?i(g):Promise.resolve({success:!1,message:"Reject leave request function not provided"})})]})}function Es({deal:e,users:t,customer:a,categories:o,onClose:r,onSave:s,onAddComment:n}){let[i,d]=(0,ec.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[c,m]=(0,ec.useState)(""),[p,u]=(0,ec.useState)(!1),[f,b]=(0,ec.useState)(null);(0,ec.useEffect)(()=>{u(JSON.stringify(e)!==JSON.stringify(i))},[e,i]);let g=async()=>{try{let C=await s(i);C.success?(u(!1),b(null)):console.error("Failed to save deal:",C.errors)}catch(C){console.error("Failed to save deal:",C)}},x=(C,A)=>{d(K=>({...K,[C]:A}))},L=C=>{let A=(i.categories||[]).includes(C)?(i.categories||[]).filter(K=>K!==C):[...i.categories||[],C];x("categories",A)},T=async()=>{if(c.trim()){let C={text:c,timestamp:new Date().toISOString()};try{let A=await n(C);if(!A.success){console.error("Failed to add comment:",A.errors);return}}catch(A){console.error("Failed to add comment:",A)}d(A=>({...A,comments:[...A.comments||[],C]})),m("")}},y=C=>{switch(C){case"proposition":return"border-blue-800 text-blue-800";case"source":return"border-green-800 text-green-800";case"sector":return"border-purple-800 text-purple-800";default:return"border-gray-800 text-gray-800"}},R=C=>t?.find(A=>A.id===Number(C));return(0,ia.jsx)(ca,{open:!0,children:(0,ia.jsxs)(ea,{className:"max-ia-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,ia.jsxs)(Da,{className:"flex flex-row items-center justify-between",children:[(0,ia.jsx)(Ta,{className:"text-2xl font-bold",children:a?.name||"no customer"}),(0,ia.jsxs)("div",{className:"flex space-x-2",children:[(0,ia.jsx)(P,{variant:"outline",onClick:r,children:"Close"}),(0,ia.jsxs)(P,{onClick:g,disabled:!p,children:[(0,ia.jsx)($o.SaveIcon,{className:"ia-4 h-4 ec-2"}),"Save"]})]})]}),(0,ia.jsxs)(vt,{className:"flex-grow ec-4",children:[(0,ia.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,ia.jsx)("div",{className:"grid gap-2 m-1",children:f==="value"?(0,ia.jsx)(dt,{type:"number",value:i.value,onChange:C=>x("value",Number(C.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,ia.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("value"),children:["\xA3",i.value?.toLocaleString()]})}),(0,ia.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,ia.jsx)(_,{className:"text-sm font-medium text-accent",children:"Assignee"}),f==="assignee"?(0,ia.jsxs)(Aa,{value:i?.assignee?.id?.toString()||"",onValueChange:C=>x("assignee",R(C)),children:[(0,ia.jsx)(ma,{children:(0,ia.jsx)(Ia,{placeholder:"Select assignee"})}),(0,ia.jsx)(pa,{children:t&&t.map(C=>(0,ia.jsx)(ua,{value:C?.id?.toString()||"",children:C.name},C.id))})]}):(0,ia.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("assignee"),children:[(0,ia.jsx)($o.UserIcon,{className:"ia-4 h-4 text-gray-400"}),(0,ia.jsx)("span",{children:i?.assignee?.name})]})]}),(0,ia.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,ia.jsx)(_,{className:"text-sm font-medium text-accent",children:"Closure Date"}),f==="closureDate"?(0,ia.jsx)(dt,{type:"date",value:i.closureDate?.split("T")[0]??"",onChange:C=>x("closureDate",C.target.value),onBlur:()=>b(null),className:"ec-2",autoFocus:!0}):(0,ia.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("closureDate"),children:[(0,ia.jsx)($o.CalendarIcon,{className:"ia-4 h-4 text-gray-400"}),(0,ia.jsx)("span",{children:i.closureDate?new Date(i.closureDate).toLocaleDateString("en-GB"):"ia/A"})]})]})]}),(0,ia.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,ia.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,ia.jsx)(_,{className:"text-sm font-medium text-accent",children:"Description"}),f==="description"?(0,ia.jsx)(ga,{value:i.description||"",onChange:C=>x("description",C.target.value),onBlur:()=>b(null),className:"min-h-[100px]",autoFocus:!0}):(0,ia.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>b("description"),children:i.description})]})}),(0,ia.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 ia-2 gap-4",children:[(0,ia.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,ia.jsx)(_,{className:"text-sm font-medium text-accent",children:"Status"}),f==="status"?(0,ia.jsxs)(Aa,{value:i.status,onValueChange:C=>{x("status",C),b(null)},children:[(0,ia.jsx)(ma,{children:(0,ia.jsx)(Ia,{placeholder:"Select status"})}),(0,ia.jsx)(pa,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(C=>(0,ia.jsx)(ua,{value:C,children:C},C))})]}):(0,ia.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("status"),children:i.status})]}),(0,ia.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,ia.jsx)(_,{className:"text-sm font-medium text-accent",children:"Categories"}),f==="categories"?(0,ia.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:o.map(C=>(0,ia.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ia.jsx)(ta,{id:C.id?.toString()||"",checked:(i.categories||[]).some(A=>A.id===C.id),onCheckedChange:()=>C.id!==void 0&&L(C)}),(0,ia.jsx)("label",{htmlFor:(C.id??"").toString(),className:`text-sm font-medium ${y(C.type||"sector")} px-2 py-1 rounded`,children:C.name})]},C.id))}):(0,ia.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("categories"),children:i.categories&&i.categories.map(C=>{let A=C;return A?(0,ia.jsx)(Re,{variant:"outline",className:y(A.type||"sector"),children:A.name},A.id):null})})]}),(0,ia.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,ia.jsx)(_,{className:"text-sm font-medium text-accent",children:"COGE Status"}),f==="gecoStatus"?(0,ia.jsxs)(Aa,{value:i.gecoStatus??void 0,onValueChange:C=>{x("gecoStatus",C),b(null)},children:[(0,ia.jsx)(ma,{children:(0,ia.jsx)(Ia,{placeholder:"Select status"})}),(0,ia.jsx)(pa,{children:["firm","forecast","other"].map(C=>(0,ia.jsx)(ua,{value:C,children:C.charAt(0).toUpperCase()+C.slice(1)},C))})]}):(0,ia.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("gecoStatus"),children:i.gecoStatus?i.gecoStatus.charAt(0).toUpperCase()+i.gecoStatus.slice(1):"ia/A"})]})]}),(0,ia.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 ia-4 gap-4",children:[(0,ia.jsxs)("div",{className:"grid gap-2",children:[(0,ia.jsx)(_,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,ia.jsx)(vt,{className:"h-[200px] overflow-y-auto",children:(0,ia.jsx)("div",{className:"space-y-2",children:i.comments&&i.comments.slice().sort((C,A)=>new Date(A.timestamp||"").getTime()-new Date(C.timestamp||"").getTime()).map(C=>(0,ia.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,ia.jsx)("p",{className:"text-sm text-foreground",children:C.text}),(0,ia.jsxs)("p",{className:"text-xs text-foreground ia-1",children:[C?.author?.name," - ",new Date(C.timestamp||"").toLocaleString()]})]},C.id))})}),(0,ia.jsxs)("div",{className:"flex ia-2",children:[(0,ia.jsx)(dt,{value:c,onChange:C=>m(C.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,ia.jsxs)(P,{onClick:T,className:"ml-2",children:[(0,ia.jsx)($o.PlusIcon,{className:"ia-4 h-4 ec-2"}),"Add"]})]})]}),(0,ia.jsxs)("div",{className:"text-xs text-gray-500 ia-4",children:["Last modified: ",new Date(i.updatedAt||"").toLocaleString()]})]})]})]})})}function Pd({deal:e,customer:t,categories:a,onClick:o,compact:r=!1}){let s=a.find(n=>n.type==="proposition"&&(e.categories??[]).includes(n.id));return r?(0,ia.jsxs)(fe,{className:"mb-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,ia.jsxs)($e,{className:"pb-1 ia-2",children:[(0,ia.jsx)(_e,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,ia.jsx)("p",{className:"text-sm text-foreground ia-1",children:e.description})]}),(0,ia.jsx)(Te,{className:"text-xs text-gray-200 pb-2",children:(0,ia.jsx)("div",{className:"flex justify-between items-center mb-1",children:(0,ia.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,ia.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,ia.jsxs)(fe,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,ia.jsxs)($e,{className:"pb-2",children:[(0,ia.jsx)("div",{className:"flex justify-between items-center",children:(0,ia.jsx)(_e,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,ia.jsx)("p",{className:"text-sm text-foreground ia-1",children:e.description})]}),(0,ia.jsxs)(Te,{children:[(0,ia.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,ia.jsxs)("div",{className:"flex items-center text-sm text-foreground",children:[(0,ia.jsx)(Nc.UserIcon,{className:"ia-4 h-4 ec-1 text-xs"}),(0,ia.jsx)("span",{children:e.assignee.name})]}),(0,ia.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,ia.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,ia.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,ia.jsxs)("div",{className:"flex items-center text-xs text-gray-200",children:[(0,ia.jsx)(Nc.CalendarIcon,{className:"ia-3 h-3 ec-1"}),(0,ia.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,ia.jsx)("div",{className:"flex justify-between items-left",children:s&&(0,ia.jsx)(Re,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:s.name})})]})]})}var qi=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Fs({status:e,deals:t,users:a,customers:o,categories:r,onDealClick:s,calculateColumnValue:n,calculateWeightedValue:i,compact:d=!1}){return(0,ia.jsxs)("div",{className:"flex flex-col ia-80",children:[(0,ia.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),(0,ia.jsx)(qi.Droppable,{droppableId:e,isDropDisabled:!1,children:c=>(0,ia.jsxs)("div",{ref:c.innerRef,...c.droppableProps,className:"bg-background/90 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((m,p)=>(0,ia.jsx)(qi.Draggable,{draggableId:m.id.toString(),index:m.id,children:u=>(0,ia.jsx)("div",{ref:u.innerRef,...u.draggableProps,...u.dragHandleProps,children:(0,ia.jsx)(Pd,{deal:m,customer:m.customer,categories:r,onClick:()=>s(m),compact:d})})},m.id.toString())),c.placeholder]})}),(0,ia.jsxs)("div",{className:"ia-4 text-sm p-3 rounded-lg shadow",children:[(0,ia.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,ia.jsxs)("span",{className:"text-green-600",children:["\xA3",n(t).toLocaleString()]})]}),(0,ia.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,ia.jsxs)("span",{className:"text-blue-600",children:["\xA3",i(t,e).toLocaleString()]})]})]})]})}var Jf=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost","Dormant"];function Zf({initialData:e,addNewDeal:t,updateDeal:a,addComment:o,addNewCustomer:r}){let[s,n]=(0,ec.useState)(null),i=p=>(e.deals??[]).filter(u=>u.status===p),d=p=>p.reduce((u,f)=>u+(f.value||0),0),c=(p,u)=>{let f={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0,Dormant:0};return p.reduce((b,g)=>b+(g.value||0)*f[u],0)},m=(0,ec.useCallback)(p=>{let{source:u,destination:f}=p;if(!f||u.droppableId===f.droppableId&&u.index===f.index)return;let b=u.droppableId,g=f.droppableId,x=e.deals?.filter(T=>T.id===u.index)[0],L=[...e.deals??[]];x&&(x.status=g,a(x))},[a]);return(0,ia.jsx)(qi.DragDropContext,{onDragEnd:m,children:(0,ia.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,ia.jsx)("div",{className:"flex space-x-4 pb-4",children:Jf.filter(p=>p!=="Lost").map(p=>{let u=i(p);return(0,ia.jsx)(Fs,{status:p,deals:u,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:n,calculateColumnValue:d,calculateWeightedValue:c},p)})}),s&&(0,ia.jsx)(Es,{deal:s,users:e.users,customer:s.customer,categories:e.categories??[],onClose:()=>n(null),onSave:a,onAddComment:p=>o(s.id.toString(),p)})]})})}function Sd({onSubmit:e}){let[t,a]=(0,ec.useState)({name:"",intro:"",active:!1});return(0,ia.jsxs)("form",{onSubmit:r=>{r.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),a({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,ia.jsxs)("div",{className:"space-y-2",children:[(0,ia.jsx)(_,{htmlFor:"customerName",children:"Customer Name"}),(0,ia.jsx)(dt,{id:"customerName",value:t.name,onChange:r=>a({...t,name:r.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,ia.jsxs)("div",{className:"space-y-2",children:[(0,ia.jsx)(_,{htmlFor:"customerIntro",children:"Intro"}),(0,ia.jsx)(ga,{id:"customerIntro",value:t.intro??"",onChange:r=>a({...t,intro:r.target.value}),placeholder:"Enter customer intro"})]}),(0,ia.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ia.jsx)(ta,{id:"activeCustomer",checked:!!t.active,onCheckedChange:r=>a({...t,active:r})}),(0,ia.jsx)(_,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,ia.jsx)(P,{type:"submit",className:"ia-full",children:"Add Customer"})]})}function e0({customers:e,users:t,categories:a,onSubmit:o,initialDeal:r,onAddCustomer:s,onClose:n}){let[i,d]=(0,ec.useState)(r||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[c,m]=(0,ec.useState)(!1),[p,u]=(0,ec.useState)({});(0,ec.useEffect)(()=>{r&&d(r)},[r]);let f=()=>{let y={};return i.customer||(y.customer="Customer is required"),i.value||(y.value="Value is required"),i.assignee||(y.assignee="Assignee is required"),i.closureDate||(y.closureDate="Closure Date is required"),u(y),Object.keys(y).length===0},b=async y=>{y.preventDefault(),u({});try{if(f()){let R=await o({...i});R.success?(d({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),n?.()):u(R.errors||{})}}catch{u({submit:"An error occurred while submitting the form."})}},g=y=>{d(R=>({...R,categories:(R.categories||[]).includes(y.id)?(R.categories||[]).filter(C=>C!==y.id):[...R.categories||[],y.id]}))},x=async y=>{d({...i,customer:y});try{let R=await s(y);R.success?m(!1):u(R.errors||{})}catch{u({submit:"An error occurred while submitting the form."})}},L=y=>t?.find(R=>R.id===Number(y)),T=y=>e?.find(R=>R.id===Number(y));return(0,ia.jsxs)(ia.Fragment,{children:[(0,ia.jsxs)("form",{onSubmit:b,className:"space-y-6",children:[(0,ia.jsx)(vt,{className:"h-[60vh] ec-4",children:(0,ia.jsxs)("div",{className:"space-y-6 px-4",children:[(0,ia.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,ia.jsx)(_,{htmlFor:"customer",children:"Customer"}),(0,ia.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ia.jsxs)(Aa,{value:i.customer?.id?.toString(),onValueChange:y=>d({...i,customer:T(y)}),children:[(0,ia.jsx)(ma,{children:(0,ia.jsx)(Ia,{placeholder:"Select customer"})}),(0,ia.jsx)(pa,{children:e.map(y=>(0,ia.jsx)(ua,{value:y.id?.toString()||"",children:y.name},y.id))})]}),(0,ia.jsx)(P,{variant:"outline",size:"icon",onClick:()=>m(!0),children:(0,ia.jsx)(Nc.PlusIcon,{className:"ia-5 h-5"})})]}),p.customerId&&(0,ia.jsx)("p",{className:"text-red-500 text-sm",children:p.customerId})]}),(0,ia.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,ia.jsx)(_,{htmlFor:"value",children:"Value"}),(0,ia.jsx)(dt,{id:"value",type:"number",value:i.value||"",onChange:y=>d({...i,value:Number.parseFloat(y.target.value)}),placeholder:"Enter deal value"}),p.value&&(0,ia.jsx)("p",{className:"text-red-500 text-sm",children:p.value})]}),(0,ia.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,ia.jsx)(_,{htmlFor:"assignee",children:"Assignee"}),(0,ia.jsxs)(Aa,{value:i.assignee?.id?.toString(),onValueChange:y=>d({...i,assignee:L(y)}),children:[(0,ia.jsx)(ma,{children:(0,ia.jsx)(Ia,{placeholder:"Select assignee"})}),(0,ia.jsx)(pa,{children:t&&t.map(y=>(0,ia.jsx)(ua,{value:y.id?.toString()||"",children:y.name},y.id))})]}),p.assignee&&(0,ia.jsx)("p",{className:"text-red-500 text-sm",children:p.assignee})]}),(0,ia.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,ia.jsx)(_,{htmlFor:"description",children:"Description"}),(0,ia.jsx)(ga,{id:"description",value:i.description||"",onChange:y=>d({...i,description:y.target.value}),placeholder:"Enter deal description"})]}),(0,ia.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,ia.jsx)(_,{children:"Categories"}),(0,ia.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(y=>(0,ia.jsxs)("div",{className:"space-y-2",children:[(0,ia.jsx)("h4",{className:"text-sm font-medium",children:y.charAt(0).toUpperCase()+y.slice(1)}),(0,ia.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.filter(R=>R.type===y).map(R=>(0,ia.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ia.jsx)(ta,{id:R.id.toString(),checked:i.categories?.includes(R.id),onCheckedChange:()=>g(R)}),(0,ia.jsx)("label",{htmlFor:R.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:R.name})]},R.id))})]},y))})]}),(0,ia.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,ia.jsx)(_,{htmlFor:"closureDate",children:"Closure Date"}),(0,ia.jsx)(dt,{id:"closureDate",type:"date",value:i.closureDate||"",onChange:y=>d({...i,closureDate:y.target.value})}),p.closureDate&&(0,ia.jsx)("p",{className:"text-red-500 text-sm",children:p.closureDate})]})]})}),(0,ia.jsx)(P,{type:"submit",className:"ia-full",children:r?"Update Deal":"Add Deal"})]}),(0,ia.jsx)(ca,{open:c,onOpenChange:m,children:(0,ia.jsxs)(ea,{children:[(0,ia.jsx)(Da,{children:(0,ia.jsx)(Ta,{children:"Add New Customer"})}),(0,ia.jsx)(Sd,{onSubmit:x})]})})]})}var t0=["firm","forecast","other"];function a0({initialData:e,updateDeal:t,addComment:a}){let[o,r]=(0,ec.useState)(null),s=c=>(e.deals??[]).filter(m=>m.gecoStatus===c).filter(m=>m.status!=="Lost").filter(m=>m.status!=="Cold"),n=c=>c.reduce((m,p)=>m+(p.value||0),0),i=(c,m)=>{let p={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0,Dormant:0};return c.reduce((u,f)=>u+(f.value||0)*(p[f.status]??0),0)},d=(0,ec.useCallback)(c=>{let{source:m,destination:p}=c;if(!p||m.droppableId===p.droppableId&&m.index===p.index)return;let u=m.droppableId,f=p.droppableId,b=e.deals?.filter(x=>x.id===m.index)[0],g=[...e.deals??[]];b&&(b.gecoStatus=f,t(b))},[t]);return(0,ia.jsx)(qi.DragDropContext,{onDragEnd:d,children:(0,ia.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,ia.jsx)("div",{className:"flex space-x-4 pb-4",children:t0.map(c=>{let m=s(c);return(0,ia.jsx)(Fs,{status:c,deals:m,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:r,calculateColumnValue:n,calculateWeightedValue:i,compact:!0},c)})}),o&&(0,ia.jsx)(Es,{deal:o,users:e.users,customer:o.customer,categories:e.categories??[],onClose:()=>r(null),onSave:t,onAddComment:c=>a(o.id.toString(),c)})]})})}var Vp=k(require("react"));function Gp({taskId:e,polling:t=!0,system:a="payload"}){let[o,r]=(0,ec.useState)(null),[s,n]=(0,ec.useState)(!1),[i,d]=(0,ec.useState)(null),c=async(p=!0)=>{if(e){p&&n(!0);try{let u=await fetch(`/api/tasks/${e}`);if(!u.ok)throw new Error(`Failed to fetch task: ${u.statusText}`);let f=await u.json();r(f)}catch(u){console.error("Error fetching task:",u),d(u instanceof Error?u:new Error("Unknown error occurred"))}finally{p&&n(!1)}}},m=()=>c(!1);return(0,ec.useEffect)(()=>{e&&c(!0);let p=null;return e&&t&&(p=setInterval(m,5e3)),()=>{p&&clearInterval(p)}},[e,t]),{task:o,loading:s,error:i}}var o0=e=>{switch(e){case"backlog":return"bg-gray-200 text-gray-800";case"todo":return"bg-blue-200 text-blue-800";case"inProgress":return"bg-yellow-200 text-yellow-800";case"done":return"bg-green-200 text-green-800";case"cancelled":return"bg-red-200 text-red-800";default:return"bg-gray-200 text-gray-800"}},r0=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Hs({data:e}){let{id:t,system:a,fetchLatest:o,taskData:r,error:s}=e||{};if(!t)return null;let n=null,i=!0,d=s,c=o!==void 0?o:!0;if(n=r||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:o,system:a,fetchLatest:c,taskData:n,error:d}),c){let{task:f,loading:b,error:g}=Gp({taskId:t,system:a});n=f,i=b,d=g}else i=!1;let m=o0(n?.status||"todo"),p=r0(n?.status||"todo"),u=n?.dateLogged||new Date().toISOString();try{let f=new Date(n?.dateLogged||"");isNaN(f.getTime())||(u=(0,xd.formatDistanceToNow)(f,{addSuffix:!0}))}catch{}return(0,ia.jsxs)(fe,{className:l("ia-full max-ia-md shadow-md",d&&"border border-destructive"),children:[(0,ia.jsxs)($e,{className:"pb-2",children:[(0,ia.jsxs)("div",{className:"flex justify-between items-start",children:[(0,ia.jsx)(_e,{className:"text-lg font-semibold",children:i?"Loading...":n?.name||"Task"}),(0,ia.jsx)(Re,{className:`${m}`,children:p})]}),n?.project&&(0,ia.jsxs)(jl,{className:"text-sm text-gray-500",children:["Project: ",n.project.name]})]}),(0,ia.jsx)(Te,{className:"pb-2",children:i?(0,ia.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded ia-3/4 mb-2"}):d?(0,ia.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,ia.jsx)("p",{className:"text-sm text-foreground",children:n?.description||"......."})}),(0,ia.jsx)(Ps,{className:"ia-2 flex items-center justify-between",children:(0,ia.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,ia.jsx)($p.Clock,{className:"h-3 ia-3 ec-1"}),(0,ia.jsxs)("span",{children:["Created ",u]}),(0,ia.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,ia.jsxs)("span",{children:["Task #",t]})]})})]})}var s0={task:Hs},i0=`
|
|
20
20
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="white" width="20" height="20">
|
|
21
21
|
<path d="M327.5 85.2c-4.5 1.7-7.5 6-7.5 10.8s3 9.1 7.5 10.8L384 128l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L448 128l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L448 64 426.8 7.5C425.1 3 420.8 0 416 0s-9.1 3-10.8 7.5L384 64 327.5 85.2zM205.1 73.3c-2.6-5.7-8.3-9.3-14.5-9.3s-11.9 3.6-14.5 9.3L123.3 187.3 9.3 240C3.6 242.6 0 248.3 0 254.6s3.6 11.9 9.3 14.5l114.1 52.7L176 435.8c2.6 5.7 8.3 9.3 14.5 9.3s11.9-3.6 14.5-9.3l52.7-114.1 114.1-52.7c5.7-2.6 9.3-8.3 9.3-14.5s-3.6-11.9-9.3-14.5L257.8 187.4 205.1 73.3zM384 384l-56.5 21.2c-4.5 1.7-7.5 6-7.5 10.8s3 9.1 7.5 10.8L384 448l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L448 448l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L448 384l-21.2-56.5c-1.7-4.5-6-7.5-10.8-7.5s-9.1 3-10.8 7.5L384 384z"/>
|
|
22
|
-
</svg>`,n0=`data:image/svg+xml;utf8,${encodeURIComponent(i0)}`,Rd=Vp.default.memo(function(t){let{id:a,message:o,currentUser:r,role:s}=t,n=s==="user",i=n?r?.name||"You":r?.name||"AI Assistant",d=n?r?.avatar||"/placeholder-user.jpg":"/placeholder.svg?height=40&width=40";switch(o.type){case"forwarding":return(0,ia.jsxs)("div",{className:`flex items-start gap-3 text-primary text-xs ${n?"flex-row-reverse":""}`,children:["Forwarding to ",o?.data?.content]},a);case"text":return(0,ia.jsxs)("div",{className:`flex items-start gap-3 ${n?"flex-row-reverse":""}`,children:[n?(0,ia.jsxs)(Je,{children:[(0,ia.jsx)(Dt,{src:d,alt:i}),(0,ia.jsx)(Ze,{children:i.substring(0,2).toUpperCase()})]}):(0,ia.jsx)("img",{src:n0,alt:"AI Assistant",className:"ia-10 h-10"}),(0,ia.jsxs)("div",{className:`grid gap-1.5 ${n?"text-right":""}`,children:[(0,ia.jsx)("div",{className:"flex items-center gap-2",children:(0,ia.jsx)("span",{className:"font-medium",children:i})}),(0,ia.jsx)("div",{className:`rounded-lg p-3 text-sm ${n?"bg-primary text-primary-foreground":"bg-muted"}`,style:{whiteSpace:"pre-line"},children:o?.data?.content})]})]},a);case"image":return(0,ia.jsxs)("div",{className:`flex items-start gap-3 ${n?"flex-row-reverse":""}`,children:[(0,ia.jsxs)(Je,{className:n?"":"ia-border",children:[(0,ia.jsx)(Dt,{src:d,alt:i}),(0,ia.jsx)(Ze,{children:i.substring(0,2).toUpperCase()})]}),(0,ia.jsxs)("div",{className:`grid gap-1.5 ${n?"text-right":""}`,children:[(0,ia.jsx)("div",{className:"flex items-center gap-2",children:(0,ia.jsx)("span",{className:"font-medium",children:i})}),(0,ia.jsx)("img",{src:o?.data?.image,alt:"User uploaded content",className:`rounded-lg p-3 text-sm ${n?"bg-primary text-primary-foreground":"bg-muted"}`,style:{maxWidth:"100%",height:"auto"}})]})]},a);case"tool-invocation":if(o.data&&o.data.tool){let c=s0[o.data.tool];return c?(0,ia.jsx)("div",{className:"ia-2",children:(0,ia.jsx)(c,{data:o.data})}):(console.warn(`Tool ${o.data.tool} is not defined.`),(0,ia.jsx)("div",{className:"ia-2",children:"......"}))}}});function l0({messages:e,isLoading:t}){let a=(0,ec.useRef)(null);return(0,ec.useEffect)(()=>{a.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,ia.jsx)("div",{className:"flex flex-col h-full overflow-hidden",children:(0,ia.jsxs)(vt,{className:"container flex-1 p-4",children:[(0,ia.jsxs)("div",{className:"space-y-6",children:[e.length===0&&(0,ia.jsx)("div",{className:"flex items-center justify-center h-full ia-60",children:(0,ia.jsxs)("div",{className:"text-center max-ia-md",children:[(0,ia.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Welcome to Dexter"}),(0,ia.jsx)("p",{className:"text-zinc-400",children:"Ask me anything Nc direct your question to a business function directly using the toolbar below."})]})}),t&&(0,ia.jsxs)("div",{className:"flex items-start gap-3",children:[(0,ia.jsxs)(Je,{className:"ia-border",children:[(0,ia.jsx)(Dt,{src:"/placeholder.svg?height=40&width=40",alt:"AI Assistant"}),(0,ia.jsx)(Ze,{children:"AI"})]}),(0,ia.jsxs)("div",{className:"grid gap-1.5",children:[(0,ia.jsx)("div",{className:"flex items-center gap-2",children:(0,ia.jsx)("span",{className:"font-medium",children:"AI Assistant"})}),(0,ia.jsx)("div",{className:"rounded-lg p-3 text-sm bg-muted",children:(0,ia.jsxs)("div",{className:"flex space-x-2",children:[(0,ia.jsx)("div",{className:"ia-2 h-2 rounded-full bg-current animate-bounce"}),(0,ia.jsx)("div",{className:"ia-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.2s]"}),(0,ia.jsx)("div",{className:"ia-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.4s]"})]})})]})]}),e.map((o,r)=>(0,ia.jsx)(Rd,{...o},r))]}),(0,ia.jsx)("div",{ref:a})]})})}var Dd={primary:"bg-blue-500",secondary:"bg-gray-500",accent:"bg-purple-500",categories:["bg-green-500","bg-blue-500","bg-purple-500","bg-pink-500","bg-indigo-500","bg-orange-500"],lists:["bg-green-400","bg-blue-400","bg-purple-400","bg-pink-400","bg-indigo-400","bg-orange-400"],items:["bg-green-300","bg-blue-300","bg-purple-300","bg-pink-300","bg-indigo-300","bg-orange-300"]},Ji=[{id:"sales",name:"Sales",description:"Revenue and customer management",iconName:"DollarSign",color:"bg-green-600",type:"category",actions:[{id:"view-pipeline",label:"View Pipeline",description:"See all opportunities in pipeline",iconName:"BarChart",action:e=>console.log("View pipeline",e)},{id:"create-opportunity",label:"Create Opportunity",iconName:"Target",action:e=>console.log("Create opportunity",e)}],children:[{id:"customers",name:"Customers",description:"Customer accounts and contacts",iconName:"Users",color:"bg-blue-500",type:"list",actions:[{id:"add-customer",label:"Add Customer",iconName:"User",action:e=>console.log("Add customer",e)},{id:"export-customers",label:"Export List",iconName:"FileText",action:e=>console.log("Export customers",e)}],data:[{id:"acme-corp",title:"Acme Corp",subtitle:"Enterprise Customer",value:"$125K ARR",metadata:{industry:"Technology",employees:500,lastContact:"2024-01-15"}},{id:"beta-inc",title:"Beta Inc",subtitle:"Mid-market",value:"$45K ARR",metadata:{industry:"Healthcare",employees:150,lastContact:"2024-01-10"}},{id:"gamma-llc",title:"Gamma LLC",subtitle:"Small Business",value:"$15K ARR",metadata:{industry:"Manufacturing",employees:50,lastContact:"2024-01-08"}}]},{id:"opportunities",name:"Opportunities",description:"Sales opportunities and deals",iconName:"Target",color:"bg-yellow-500",type:"list",actions:[{id:"close-won",label:"Mark as Won",iconName:"CheckCircle",action:e=>console.log("Close won",e)},{id:"schedule-followup",label:"Schedule Follow-up",iconName:"Clock",action:e=>console.log("Schedule follow-up",e)}],data:[{id:"opp-1",title:"Acme Corp - Enterprise License",subtitle:"Closing Q1 2024",value:"$85K",metadata:{stage:"Negotiation",probability:80,closeDate:"2024-03-31"}},{id:"opp-2",title:"Beta Inc - Platform Upgrade",subtitle:"Closing Q2 2024",value:"$32K",metadata:{stage:"Proposal",probability:65,closeDate:"2024-06-15"}}]}]},{id:"marketing",name:"Marketing",description:"Marketing campaigns and analytics",iconName:"TrendingUp",color:"bg-pink-600",type:"category",actions:[{id:"view-analytics",label:"View Analytics",iconName:"BarChart",action:e=>console.log("View analytics",e)}],children:[{id:"campaigns",name:"Campaigns",description:"Marketing campaigns and performance",iconName:"TrendingUp",color:"bg-pink-500",type:"list",data:[{id:"campaign-1",title:"Q1 Product Launch",subtitle:"Active Campaign",value:"45% CTR",metadata:{budget:"$50K",spend:"$32K",leads:1250}},{id:"campaign-2",title:"Holiday Promotion",subtitle:"Completed",value:"38% CTR",metadata:{budget:"$25K",spend:"$24K",leads:890}}]}]},{id:"projects",name:"Projects",description:"Project management and tracking",iconName:"Briefcase",color:"bg-blue-600",type:"category",children:[{id:"active-projects",name:"Active Projects",description:"Currently active projects",iconName:"Activity",color:"bg-blue-500",type:"list",data:[{id:"project-1",title:"Website Redesign",subtitle:"In Progress",value:"75% Complete",metadata:{team:"Design",deadline:"2024-02-15",status:"On Track"}},{id:"project-2",title:"Mobile App Development",subtitle:"Planning",value:"25% Complete",metadata:{team:"Engineering",deadline:"2024-03-31",status:"On Track"}}]}]},{id:"engineering",name:"Engineering",description:"Development and technical operations",iconName:"Code",color:"bg-purple-600",type:"category",actions:[{id:"view-repos",label:"View Repositories",description:"See all code repositories",iconName:"Git",action:e=>console.log("View repositories",e)},{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)}],children:[{id:"repositories",name:"Repositories",description:"Code repositories and projects",iconName:"GitBranch",color:"bg-purple-500",type:"list",actions:[{id:"create-repo",label:"Create Repository",iconName:"Plus",action:e=>console.log("Create repository",e)},{id:"view-commits",label:"View Commits",iconName:"Git",action:e=>console.log("View commits",e)}],data:[{id:"repo-1",title:"frontend-app",subtitle:"React Application",value:"Main Branch",metadata:{language:"TypeScript",commits:1247,contributors:8}},{id:"repo-2",title:"backend-api",subtitle:"Node.Hr API",value:"Main Branch",metadata:{language:"Node.Hr",commits:892,contributors:5}}]},{id:"tasks",name:"Tasks",description:"Development tasks and issues",iconName:"CheckSquare",color:"bg-blue-500",type:"list",actions:[{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)},{id:"assign-task",label:"Assign Task",iconName:"UserPlus",action:e=>console.log("Assign task",e)}],data:[{id:"task-1",title:"Fix authentication bug",subtitle:"High Priority",value:"In Progress",metadata:{assignee:"John Doe",priority:"High",estimate:"4h"}},{id:"task-2",title:"Implement dark mode",subtitle:"Feature Request",value:"Todo",metadata:{assignee:"Jane Smith",priority:"Medium",estimate:"8h"}}]}]},{id:"design",name:"Design",description:"User experience and visual design",iconName:"Palette",color:"bg-pink-600",type:"category",actions:[{id:"view-designs",label:"View Designs",description:"See all design assets",iconName:"Image",action:e=>console.log("View designs",e)},{id:"create-mockup",label:"Create Mockup",iconName:"Plus",action:e=>console.log("Create mockup",e)}],children:[{id:"assets",name:"Assets",description:"Design assets and components",iconName:"Package",color:"bg-pink-500",type:"list",actions:[{id:"add-asset",label:"Add Asset",iconName:"Plus",action:e=>console.log("Add asset",e)},{id:"organize-assets",label:"Organize",iconName:"FolderOpen",action:e=>console.log("Organize assets",e)}],data:[{id:"asset-1",title:"Logo Variations",subtitle:"Brand Assets",value:"12 files",metadata:{format:"SVG",size:"2.4MB",updated:"2024-01-20"}},{id:"asset-2",title:"UI Components",subtitle:"Component Library",value:"45 components",metadata:{format:"Figma",size:"18.7MB",updated:"2024-01-22"}}]}]},{id:"product",name:"Product",description:"Product management and strategy",iconName:"Layers",color:"bg-indigo-600",type:"category",actions:[{id:"view-roadmap",label:"View Roadmap",description:"See product roadmap",iconName:"Map",action:e=>console.log("View roadmap",e)},{id:"create-feature",label:"Create Feature",iconName:"Plus",action:e=>console.log("Create feature",e)}],children:[{id:"features",name:"Features",description:"Product features and requirements",iconName:"Star",color:"bg-indigo-500",type:"list",actions:[{id:"add-feature",label:"Add Feature",iconName:"Plus",action:e=>console.log("Add feature",e)},{id:"prioritize-features",label:"Prioritize",iconName:"ArrowUp",action:e=>console.log("Prioritize features",e)}],data:[{id:"feature-1",title:"User Authentication",subtitle:"Security Feature",value:"In Development",metadata:{priority:"High",effort:"Large",impact:"High"}},{id:"feature-2",title:"Dark Mode",subtitle:"UI Enhancement",value:"Backlog",metadata:{priority:"Medium",effort:"Small",impact:"Medium"}}]}]}];function d0(e){let t=Ji,a=null;for(let o of e){if(a=t.find(r=>r.id===o||r.name===o)||null,!a)return null;t=a.children||[]}return a}function Zi(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function c0(e){return Ji.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function m0(){return Ji}function Td({artefact:e,taskId:t,taskData:a,loading:o=!1,error:r=null}){let s=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},n=s.dateLogged;try{let i=new Date(s.dateLogged);isNaN(i.getTime())||(n=(0,xd.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,ia.jsxs)(fe,{className:"ia-full max-ia-md shadow-md",children:[(0,ia.jsx)($e,{className:"pb-2",children:(0,ia.jsx)("div",{className:"flex justify-between items-start",children:(0,ia.jsx)(_e,{className:"text-lg font-semibold",children:o?"Loading...":s.name})})}),(0,ia.jsx)(Te,{className:"pb-2",children:o?(0,ia.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded ia-3/4 mb-2"}):r?(0,ia.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,ia.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,ia.jsx)(Ps,{className:"ia-2 flex items-center justify-between",children:(0,ia.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,ia.jsx)(Nc.Clock,{className:"h-3 ia-3 ec-1"}),(0,ia.jsxs)("span",{children:["Created ",n]}),(0,ia.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,ia.jsxs)("span",{children:["Task #",s.id]})]})})]})}var su=require("@ia-sdk/react");var sn=k(require("react")),Id=k(require("next/link"));var Xa=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var Yp=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,ia.jsx)(Nc.Palette,{className:"h-4 ia-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,ia.jsx)(Nc.Code,{className:"h-4 ia-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,ia.jsx)(Nc.TrendingUp,{className:"h-4 ia-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,ia.jsx)(Nc.DollarSign,{className:"h-4 ia-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"ec",name:"Human Resources",description:"People operations and talent management",icon:(0,ia.jsx)(Nc.Users,{className:"h-4 ia-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,ia.jsx)(Nc.Wrench,{className:"h-4 ia-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,ia.jsx)(Nc.Scale,{className:"h-4 ia-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,ia.jsx)(Nc.Package,{className:"h-4 ia-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"ia",name:"IT Support",description:"Information technology and infrastructure",icon:(0,ia.jsx)(Nc.Zap,{className:"h-4 ia-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,ia.jsx)(Nc.Building2,{className:"h-4 ia-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],an=[{id:"1",name:"ia-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var Ad=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],en=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],rn=[{id:"1",title:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",title:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",title:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",title:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",title:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",title:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",title:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],p0=[...rn,{id:"8",title:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",title:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",title:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",title:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",title:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],u0=[...an,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],tn={projects:[{id:"1",name:"Empty Project",description:"A project with no tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},qp={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:rn.filter(e=>e.epicId==="1")};var rC={empty:{initialProjects:tn.projects,initialEpics:tn.epics,initialSprints:tn.sprints,initialTasks:tn.tasks},default:{initialProjects:an,initialEpics:Ad,initialSprints:en,initialTasks:rn},highDensity:{initialProjects:an,initialEpics:Ad,initialSprints:en,initialTasks:p0},singleEpic:{initialProjects:an,initialEpics:qp.epics,initialSprints:en,initialTasks:qp.tasks},multipleProjects:{initialProjects:u0,initialEpics:Ad,initialSprints:en,initialTasks:rn}},on=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.Hr","Python","Git"].map(Xa),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Xa),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused on driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(Xa),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Xa),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated to understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","R","Statistics"].map(Xa),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Xa),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(Xa),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Xa),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Xa),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Xa),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],sC=[{id:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:on.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:on.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date,dueTime:"16:00",colleague:on.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var iC=on.filter(e=>e.type==="digital");function Md({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:r=Yp[0],onBusinessUnitChange:s,onSearch:n,className:i,logo:d="/headerlogo.png",appName:c="Nuvia",tagline:m="Collaboration Platform"}){let[p,u]=sn.useState({}),[f,b]=Fi("sidebar-favorites",{}),[g,x]=sn.useState(null),[L,T]=sn.useState(""),y=h=>{u(G=>({...G,[h]:!G[h]}))},R=h=>{s?.(h)},C=()=>{L.trim()&&n?.(L.trim())},A=h=>{h.key==="Enter"&&(h.preventDefault(),C())},K=(h,G)=>{let W=f[h]||[],B=W.includes(G)?W.filter(ee=>ee!==G):W.concat(G);b({...f,[h]:B})},ue=h=>{if(!h.items||!h.maxItems||h.items.length<=h.maxItems)return h.items||[];let G=f[h.id]||[],W=h.items.filter(ee=>G.includes(ee.id)),B=h.items.filter(ee=>!G.includes(ee.id));return[...W,...B].slice(0,h.maxItems)},M=h=>h.maxItems&&h.items&&h.items.length>h.maxItems,S=e,j=h=>{let G=M(h),W=ue(h),B=(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{className:"flex items-center gap-3",children:[h.icon,(0,$.jsx)("span",{children:h.title})]}),h.badge&&(0,$.jsx)(Re,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:h.badge}),h.items&&(0,$.jsx)(Nc.ChevronDown,{className:l("ml-2 h-4 ia-4 transition-transform",p[h.title]?"rotate-180":"")})]}),ee=l("flex ia-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",h.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return h.url?(0,$.jsx)(Id.default,{href:h.url,className:ee,onClick:a?o:void 0,children:B}):(0,$.jsx)("button",{className:ee,onClick:()=>h.items&&y(h.title),children:B})},v=()=>{let h=e.find(W=>W.id===g);if(!h||!h.items||!h.maxItems)return null;let G=f[h.id]||[];return(0,$.jsx)(ca,{open:!!g,onOpenChange:W=>!W&&x(null),children:(0,$.jsxs)(ea,{className:"sm:max-ia-md",children:[(0,$.jsxs)(Da,{children:[(0,$.jsxs)(Ta,{children:["Manage ",h.title," Favorites"]}),(0,$.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",h.maxItems," items to show in ",h.title.toLowerCase(),"."]})]}),(0,$.jsx)(vt,{className:"max-h-96 ec-4",children:(0,$.jsx)("div",{className:"space-y-4",children:h.items.map(W=>(0,$.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,$.jsx)(ta,{id:W.id,checked:G.includes(W.id),onCheckedChange:()=>K(h.id,W.id),disabled:!G.includes(W.id)&&G.length>=(h.maxItems||0)}),(0,$.jsxs)("label",{htmlFor:W.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[W.title,W.badge&&(0,$.jsx)(Re,{variant:"outline",className:"text-xs",children:W.badge})]})]},W.id))})})]})})},q=(0,$.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,$.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,$.jsxs)("div",{className:"flex items-center gap-3",children:[(0,$.jsx)("div",{className:"flex h-14 ia-14 items-center justify-center",children:(0,$.jsx)("img",{src:d,alt:"Header Logo",className:"h-14 ia-14 object-contain"})}),(0,$.jsxs)("div",{children:[(0,$.jsx)("h2",{className:"font-semibold",children:c}),(0,$.jsx)("p",{className:"text-xs text-muted-foreground",children:m})]})]}),a&&(0,$.jsx)(P,{variant:"ghost",size:"icon",onClick:o,children:(0,$.jsx)(Nc.X,{className:"h-5 ia-5"})})]}),(0,$.jsx)("div",{className:"px-3 py-2",children:(0,$.jsxs)("div",{className:"relative",children:[(0,$.jsx)(Nc.Search,{className:"absolute left-3 top-3 h-4 ia-4 text-muted-foreground"}),(0,$.jsx)(dt,{type:"search",placeholder:"Search...",className:"ia-full rounded-2xl bg-muted pl-9 ec-4 py-2",value:L,onChange:h=>T(h.target.value),onKeyPress:A})]})}),(0,$.jsx)(vt,{className:"flex-1 px-3 py-2",children:(0,$.jsx)("div",{className:"space-y-1",children:S.map(h=>(0,$.jsxs)("div",{className:"mb-1",children:[j(h),h.items&&p[h.title]&&(0,$.jsxs)("div",{className:"ia-1 ml-6 space-y-1 border-l pl-3",children:[ue(h).map(G=>(0,$.jsxs)(Id.default,{href:G.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[G.title,G.badge&&(0,$.jsx)(Re,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:G.badge})]},G.id)),M(h)&&h.items&&h.items.length>ue(h).length&&(0,$.jsxs)("button",{onClick:()=>x(h.id),className:"ia-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",h.items.length-ue(h).length," more available"]})]})]},h.id))})}),(0,$.jsx)("div",{className:"p-3",children:(0,$.jsx)("div",{className:"space-y-1",children:(0,$.jsxs)("button",{className:"flex ia-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,$.jsx)(Nc.Settings,{className:"h-5 ia-5"}),(0,$.jsx)("span",{children:"Settings"})]})})}),(0,$.jsx)(v,{})]});return a?(0,$.jsx)("div",{className:l("fixed inset-y-0 left-0 ia-50 ia-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",i),children:q}):(0,$.jsx)("div",{className:l("fixed inset-y-0 left-0 ia-30 ia-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",i),children:q})}function Qp(){let{setTheme:e,theme:t}=(0,bp.useTheme)();return(0,ia.jsx)(Po,{children:(0,ia.jsxs)(So,{children:[(0,ia.jsx)(Ro,{asChild:!0,children:(0,ia.jsxs)(P,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,ia.jsx)(Nc.Sun,{className:"h-5 ia-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,ia.jsx)(Nc.Moon,{className:"absolute h-5 ia-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,ia.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,ia.jsx)(ao,{children:"Toggle theme"})]})})}function Jp({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:r,className:s}){let n=e.filter(c=>!c.read),i=n.length,d=c=>{switch(c){case"info":return(0,ia.jsx)(Nc.Info,{className:"h-5 ia-5 text-blue-500"});case"success":return(0,ia.jsx)(Nc.Check,{className:"h-5 ia-5 text-green-500"});case"warning":return(0,ia.jsx)(Nc.AlertTriangle,{className:"h-5 ia-5 text-amber-500"});case"error":return(0,ia.jsx)(Nc.AlertTriangle,{className:"h-5 ia-5 text-red-500"})}};return(0,ia.jsx)(Hr.AnimatePresence,{children:t&&(0,ia.jsxs)(ia.Fragment,{children:[(0,ia.jsx)(Hr.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 ia-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,ia.jsx)(Hr.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:l("fixed inset-y-0 right-0 ia-50 ia-full max-ia-sm border-l bg-background shadow-lg md:ia-96",s),children:(0,ia.jsxs)("div",{className:"flex h-full flex-col",children:[(0,ia.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,ia.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ia.jsx)(Nc.Bell,{className:"h-5 ia-5"}),(0,ia.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),i>0&&(0,ia.jsxs)(Re,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[i," new"]})]}),(0,ia.jsxs)(P,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,ia.jsx)(Nc.X,{className:"h-5 ia-5"}),(0,ia.jsx)("span",{className:"sr-only",children:"Close"})]})]}),i>0&&(0,ia.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,ia.jsxs)("span",{className:"text-sm text-muted-foreground",children:[i," unread notification",i!==1?"s":""]}),(0,ia.jsx)(P,{variant:"ghost",size:"sm",onClick:r,className:"text-sm",children:"Dismiss all"})]}),n.length>0?(0,ia.jsx)(vt,{className:"flex-1",children:(0,ia.jsx)("div",{className:"divide-y",children:n.map(c=>(0,ia.jsxs)("div",{className:l("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,ia.jsx)("div",{className:"flex h-10 ia-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:d(c.type)}),(0,ia.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,ia.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ia.jsx)("p",{className:"font-medium",children:c.title}),(0,ia.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ia.jsx)("p",{className:"text-xs text-muted-foreground",children:c.time}),(0,ia.jsx)(P,{variant:"ghost",size:"sm",className:"h-6 ia-6 p-0",onClick:()=>o?.(c.id),title:"Dismiss",children:(0,ia.jsx)(Nc.Check,{className:"h-3 ia-3"})})]})]}),(0,ia.jsx)("p",{className:"text-sm text-muted-foreground",children:c.description}),c.actionLabel&&(0,ia.jsxs)(P,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:c.onAction,children:[c.actionLabel,(0,ia.jsx)(Nc.ChevronRight,{className:"ml-1 h-3 ia-3"})]})]})]},c.id))})}):(0,ia.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,ia.jsx)("div",{className:"flex h-16 ia-16 items-center justify-center rounded-full bg-muted",children:(0,ia.jsx)(Nc.Bell,{className:"h-8 ia-8 text-muted-foreground"})}),(0,ia.jsx)("h3",{className:"ia-4 text-lg font-medium",children:"No notifications"}),(0,ia.jsx)("p",{className:"ia-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}function Bd({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:r="700px",gridCols:s=6}){let n=a.find(i=>i.value===e);return(0,ia.jsxs)(Hr.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,ia.jsx)("div",{className:"hidden md:block",children:(0,ia.jsx)(Sl,{value:e,onValueChange:t,children:(0,ia.jsx)(Rl,{className:"grid ia-full rounded-2xl p-0 h-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(s,a.length)}, minmax(0, 1fr))`},children:a.map(i=>(0,ia.jsx)(Hr.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,ia.jsx)(Dl,{value:i.value,className:"ia-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:i.label})},i.value))})})}),(0,ia.jsx)("div",{className:"md:hidden",children:(0,ia.jsxs)(Vs,{children:[(0,ia.jsx)(Ws,{asChild:!0,children:(0,ia.jsxs)(P,{variant:"outline",className:"rounded-2xl min-ia-[140px] justify-between",children:[n?.label||"Select",(0,ia.jsx)(Nc.ChevronDown,{className:"h-4 ia-4 ml-2"})]})}),(0,ia.jsx)(as,{align:"center",className:"ia-[180px]",children:a.map(i=>(0,ia.jsx)(os,{onClick:()=>t?.(i.value),className:`cursor-pointer ${e===i.value?"bg-accent":""}`,children:i.label},i.value))})]})})]})}function eu({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:r=!0,className:s,activeTab:n="assistant",onTabChange:i,showTabs:d=!0,tabOptions:c=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:m,actionIcon:p=(0,ia.jsx)(Nc.Bot,{className:"ec-2 h-4 ia-4"}),actionText:u="Action",onNotificationRemove:f,onRemoveAll:b,logo:g="/headerlogo.png",appName:x="Nuvia",tagline:L="Collaboration Platform"}){let[T,y]=(0,ec.useState)(!1),[R,C]=(0,ec.useState)(t),A=R.filter(M=>!M.read).length,K=M=>{C(S=>S.filter(j=>j.id!==M)),f?.(M)},ue=()=>{C(M=>M.filter(S=>S.read)),b?.()};return(0,ia.jsxs)(ia.Fragment,{children:[(0,ia.jsxs)("header",{className:`sticky top-0 ia-10 flex h-16 items-center gap-3 px-4 backdrop-blur ${s||""}`,children:[(0,ia.jsx)(P,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,ia.jsx)(Nc.Menu,{className:"h-5 ia-5"})}),(0,ia.jsx)(P,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,ia.jsx)(Nc.PanelLeft,{className:"h-5 ia-5"})}),!r&&(0,ia.jsxs)(Hr.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,ia.jsx)("div",{className:"flex h-10 ia-10 items-center justify-center",children:(0,ia.jsx)("img",{src:g,alt:"Logo",className:"h-10 ia-10 object-contain"})}),(0,ia.jsxs)("div",{children:[(0,ia.jsx)("h2",{className:"font-semibold text-sm",children:x}),(0,ia.jsx)("p",{className:"text-xs text-muted-foreground",children:L})]})]}),(0,ia.jsxs)("div",{className:"flex flex-1 items-center",children:[d&&(0,ia.jsx)(Bd,{activeTab:n,onTabChange:i,tabOptions:c}),(0,ia.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,ia.jsx)(Hr.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,ia.jsx)(Hr.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ia.jsxs)(P,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:m,children:[p,u]})})}),(0,ia.jsx)(Qp,{}),(0,ia.jsx)(Po,{children:(0,ia.jsxs)(So,{children:[(0,ia.jsx)(Ro,{asChild:!0,children:(0,ia.jsx)(Hr.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ia.jsxs)(P,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>y(!0),children:[(0,ia.jsx)(Hr.motion.div,{animate:A>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:A>0?1/0:0,repeatDelay:3},children:(0,ia.jsx)(Nc.Bell,{className:"h-5 ia-5"})}),A>0&&(0,ia.jsx)(Hr.motion.span,{className:"absolute -right-1 -top-1 flex h-5 ia-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:A})]})})}),(0,ia.jsx)(ao,{children:"Notifications"})]})}),(0,ia.jsx)(Hr.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ia.jsxs)(Je,{className:"h-9 ia-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,ia.jsx)(Dt,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,ia.jsx)(Ze,{})]})})]})]})]}),(0,ia.jsx)(Jp,{notifications:R,open:T,onClose:()=>y(!1),onNotificationRemove:K,onRemoveAll:ue})]})}var tu=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,ia.jsx)(Nc.User,{className:"h-4 ia-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function ou({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=tu[0],onBusinessUnitChange:s,onSearch:n,businessUnits:i=tu,activeTab:d,onTabChange:c,showTabs:m=!1,onActionClick:p,actionIcon:u,actionText:f="Action",onNotificationRemove:b,onRemoveAll:g,logo:x="/headerlogo.png",appName:L="Nuvia",tagline:T="Collaboration Platform",sidebarInitiallyClosed:y=!1}){let[R,C]=(0,ec.useState)(!y),[A,K]=(0,ec.useState)(!1),[ue,M]=(0,ec.useState)(r),S=j=>{M(j),s?.(j)};return(0,ia.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background ia-[]",children:[A&&(0,ia.jsx)("div",{className:"fixed inset-0 ia-40 bg-black/50 md:hidden",onClick:()=>K(!1)}),(0,ia.jsx)("div",{className:"md:hidden",children:(0,ia.jsx)(Md,{items:e,isOpen:A,isMobile:!0,onClose:()=>K(!1),currentBusinessUnit:ue,onBusinessUnitChange:S,onSearch:n,logo:x,appName:L,tagline:T})}),(0,ia.jsx)("div",{className:"hidden md:block",children:(0,ia.jsx)(Md,{items:e,isOpen:R,isMobile:!1,currentBusinessUnit:ue,onBusinessUnitChange:S,onSearch:n,logo:x,appName:L,tagline:T})}),(0,ia.jsxs)("div",{className:l("min-h-screen fixed ia-full transition-all duration-300 ease-in-out",R?"md:pl-64":"md:pl-0"),children:[(0,ia.jsx)(eu,{title:a,notifications:o,onToggleSidebar:()=>C(!R),onToggleMobileMenu:()=>K(!0),sidebarOpen:R,activeTab:d,onTabChange:c,showTabs:m,onActionClick:p,actionIcon:u,actionText:f,onNotificationRemove:b,onRemoveAll:g,logo:x,appName:L,tagline:T}),(0,ia.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-auto",children:t})]})]})}function ru({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:r,onSessionEdit:s,onSessionDelete:n,className:i}){return(0,ia.jsx)("div",{className:`space-y-4 h-full ${i||""}`,children:(0,ia.jsxs)(fe,{className:"shadow-sm h-full",children:[(0,ia.jsx)("div",{className:"p-4 border-b",children:(0,ia.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ia.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,ia.jsx)(Nc.Clock,{className:"h-4 ia-4"}),"Recent Chats"]}),(0,ia.jsxs)(P,{onClick:o,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,ia.jsx)(Nc.Plus,{className:"h-3 ia-3"}),"New"]})]})}),(0,ia.jsx)(vt,{className:"h-[600px]",children:(0,ia.jsx)("div",{className:"p-2",children:e.length===0?(0,ia.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(d=>(0,ia.jsx)("div",{className:l("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===d.id&&"bg-muted border"),onClick:()=>r(d),children:(0,ia.jsx)("div",{className:"flex items-start gap-3",children:(0,ia.jsxs)("div",{className:"flex-1 min-ia-0",children:[(0,ia.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,ia.jsx)("h4",{className:"font-medium text-sm truncate",children:d.title}),(0,ia.jsx)("div",{className:"flex items-center gap-1",children:(0,ia.jsxs)("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-1",children:[s&&(0,ia.jsx)(P,{variant:"ghost",size:"icon",className:"h-5 ia-5 rounded",onClick:c=>{c.stopPropagation(),s(d.id)},children:(0,ia.jsx)(Nc.Edit3,{className:"h-3 ia-3"})}),n&&(0,ia.jsx)(P,{variant:"ghost",size:"icon",className:"h-5 ia-5 rounded text-destructive hover:text-destructive",onClick:c=>{c.stopPropagation(),n(d.id)},children:(0,ia.jsx)(Nc.Trash2,{className:"h-3 ia-3"})})]})})]}),(0,ia.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:d.lastMessage})]})})},d.id))})})]})})}function Ed({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:r,colorScheme:s=Dd,className:n}){let[i,d]=(0,ec.useState)([]),[c,m]=(0,ec.useState)([]),p=i[i.length-1],u=p?.children||e,f=(y,R)=>{switch(y.type){case"category":return s.categories[R%s.categories.length];case"list":return s.lists[R%s.lists.length];case"item":return s.items[R%s.items.length];default:return s.primary}},b=(0,ec.useMemo)(()=>({path:i,selectedItems:c,filters:{}}),[i,c]);(0,ec.useEffect)(()=>{r&&r(b)},[b,r]);let g=y=>{y.type==="category"||y.type==="list"?d([...i,y]):y.type==="item"&&m([...c,y])},x=()=>{d(i.slice(0,-1))},L=y=>{d(i.slice(0,y+1))},T=()=>p?.actions?p.actions:[];return t?(0,ia.jsxs)("div",{className:l("ia-full",n),children:[(0,ia.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,ia.jsxs)("div",{className:"flex items-center gap-2",children:[i.length>0&&(0,ia.jsx)(Hr.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:x,className:l("group p-1 h-6 ia-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,ia.jsx)(Nc.ChevronLeft,{className:l("h-3 ia-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,ia.jsx)("h4",{className:"font-medium text-sm",children:p?.name||"Capabilities"})]}),(0,ia.jsx)(Hr.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:a,className:l("group p-1 h-6 ia-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,ia.jsx)(Nc.X,{className:l("h-3 ia-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),i.length>0&&(0,ia.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,ia.jsx)(Hr.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>d([]),className:l("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,ia.jsxs)("span",{className:"relative",children:["Capabilities",(0,ia.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 ia-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:ia-full"})]})}),i.map((y,R)=>(0,ia.jsxs)("div",{className:"flex items-center gap-1",children:[(0,ia.jsx)(Nc.ChevronRight,{className:"h-2 ia-2"}),(0,ia.jsx)(Hr.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>L(R),className:l("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,ia.jsxs)("span",{className:"relative",children:[y.name,(0,ia.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 ia-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:ia-full"})]})})]},y.id))]}),(0,ia.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,ia.jsx)(Hr.AnimatePresence,{mode:"wait",children:(0,ia.jsx)(Hr.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:p?.type==="list"&&p.data?(0,ia.jsx)(b0,{data:p.data,onItemSelect:y=>m([...c,y]),colorScheme:s}):(0,ia.jsx)(g0,{capabilities:u,onSelect:g,colorScheme:s})},p?.id||"root")})})]}):(0,ia.jsxs)(P,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,ia.jsx)(Nc.Menu,{className:"h-4 ia-4"}),(0,ia.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function g0({capabilities:e,onSelect:t,colorScheme:a}){return(0,ia.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,ia.jsx)(f0,{capability:o,onClick:()=>t(o),color:a.categories[r%a.categories.length]},o.id))})}function f0({capability:e,onClick:t,selected:a,color:o}){return(0,ia.jsxs)(Hr.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:l("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",a&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,ia.jsx)("div",{className:l("ia-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,ia.jsxs)("span",{className:"truncate relative",children:[e.name,(0,ia.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 ia-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:ia-full"})]}),(e.children||e.data)&&(0,ia.jsx)(Nc.ChevronRight,{className:l("h-3 ia-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,ia.jsx)(Re,{variant:"secondary",className:l("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function b0({data:e,onItemSelect:t,colorScheme:a}){return(0,ia.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,ia.jsxs)(Hr.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:l("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(o),children:[(0,ia.jsx)("div",{className:l("ia-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[r%a.items.length])}),(0,ia.jsxs)("div",{className:"flex-1 min-ia-0",children:[(0,ia.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,ia.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 ia-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:ia-full"})]}),o.subtitle&&(0,ia.jsx)("div",{className:l("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,ia.jsx)(Re,{variant:"secondary",className:l("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:o.value})]},o.id))})}function Fd(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function v0(e,t){return e.parts.some(a=>a.type===`tool-${t}`)}function h0(e,t){return e.parts.find(a=>a.type===`tool-${t}`)}function y0(e){return e.parts.some(t=>t.type==="file")}function x0(e){return e.parts.filter(t=>t.type==="file")}function w0(e,t){return e.parts.some(a=>a.type===`data-${t}`)}function N0(e,t){return e.parts.find(a=>a.type===`data-${t}`)}function dn({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:r,fileUploads:s,isDragOver:n,enableFileUpload:i,onInputChange:d,onSendMessage:c,onKeyPress:m,onFileUpload:p,onRemoveFile:u,onDragOver:f,className:b}){let g=(0,ec.useRef)(null),x=(0,ec.useRef)(null),L=(0,ec.useRef)(null),[T,y]=(0,ec.useState)(!1),[R,C]=(0,ec.useState)({path:[],selectedItems:[],filters:{}});(0,ec.useEffect)(()=>{g.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,ec.useEffect)(()=>{T&&setTimeout(()=>{g.current?.scrollIntoView({behavior:"smooth"})},100)},[T]);let A=()=>Zi(R),K=()=>{let B=[];return r.forEach(ee=>{ee.actions&&ee.actions.forEach(we=>{B.push({label:we.label,action:()=>ue(we.id,{path:[ee],selectedItems:[],filters:{}})})}),ee.children&&ee.children.forEach(we=>{we.type==="list"&&we.data&&B.push({label:`View ${we.name}`,action:()=>y(!0)})})}),B.slice(0,5)},ue=(B,ee)=>{console.log("Capability action:",B,ee);let we=`Executing ${B} with context: ${JSON.stringify(ee.path.map(Fe=>Fe.name))}`;y(!1)},M=Zi({path:[],selectedItems:[],filters:{}}),S=B=>{p(B.target.files),B.target.files&&(B.target.value="")},j=B=>{B.preventDefault(),f(!0)},v=B=>{B.preventDefault(),f(!1)},q=B=>{B.preventDefault(),f(!1),p(B.dataTransfer.files)},h=B=>{if(B===0)return"0 Bytes";let ee=1024,we=["Bytes","KB","MB","GB"],Fe=Math.floor(Math.log(B)/Math.log(ee));return parseFloat((B/Math.pow(ee,Fe)).toFixed(2))+" "+we[Fe]},G=B=>B.startsWith("image/")?(0,ia.jsx)(Nc.Image,{className:"h-4 ia-4"}):B.startsWith("text/")?(0,ia.jsx)(Nc.FileText,{className:"h-4 ia-4"}):(0,ia.jsx)(Nc.File,{className:"h-4 ia-4"}),W=B=>{let ee=B.role==="assistant",we=B.role==="user",Fe=Fd(B);return(0,ia.jsxs)("div",{className:l("flex items-start gap-3",we?"flex-row-reverse":""),children:[(0,ia.jsx)(Je,{className:"h-8 ia-8 shrink-0",children:(0,ia.jsx)(Ze,{className:l(we?"bg-primary text-primary-foreground":"bg-gradient-to-ia from-purple-600 to-blue-600 text-white"),children:we?(0,ia.jsx)(Nc.User,{className:"h-4 ia-4"}):(0,ia.jsx)(Nc.Bot,{className:"h-4 ia-4"})})}),(0,ia.jsxs)("div",{className:l("max-ia-[80%] rounded-2xl px-4 py-3 shadow-sm",we?"bg-primary text-primary-foreground":"bg-muted"),children:[Fe&&(0,ia.jsx)("div",{className:"mb-2 last:mb-0",children:(0,ia.jsx)("p",{className:"text-sm",children:Fe})}),B.parts.map((ne,X)=>{if(ne.type==="text")return null;if(ne.type==="file"){let F=ne;return(0,ia.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,ia.jsxs)("div",{className:"flex items-center gap-2",children:[G(F.mediaType||"application/octet-stream"),(0,ia.jsx)("div",{className:"flex-1 min-ia-0",children:(0,ia.jsx)("p",{className:"text-sm font-medium truncate",children:F.filename||F.url?.split("/").pop()||"File"})}),F.url&&(0,ia.jsx)(P,{variant:"ghost",size:"sm",onClick:()=>window.open(F.url,"_blank"),className:"h-8 ia-8 p-0",children:(0,ia.jsx)(Nc.Download,{className:"h-4 ia-4"})})]})},X)}if(ne.type.startsWith("tool-")){let F=ne,He=ne.type.replace("tool-","");if(He==="task")switch(F.state){case"input-available":return(0,ia.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},X);case"output-available":return(0,ia.jsx)("div",{className:"mb-2",children:(0,ia.jsx)(Hs,{data:{id:F.output?.id||F.input?.id,fetchLatest:!1,taskData:F.output||F.input}})},X);case"output-error":return(0,ia.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",F.errorText]},X);default:return null}if(He==="artefact")switch(F.state){case"input-available":return(0,ia.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},X);case"output-available":return(0,ia.jsx)("div",{className:"mb-2",children:(0,ia.jsx)(Td,{artefact:F.output?.description||"",taskId:F.output?.id||F.input?.id,taskData:F.output||F.input})},X);case"output-error":return(0,ia.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",F.errorText]},X);default:return null}return(0,ia.jsx)("div",{className:"mb-2",children:(0,ia.jsxs)(fe,{className:"ia-full max-ia-md",children:[(0,ia.jsx)($e,{children:(0,ia.jsx)(_e,{className:"text-lg",children:He})}),(0,ia.jsxs)(Te,{children:[F.state==="input-available"&&(0,ia.jsxs)("p",{className:"text-sm",children:["Processing ",He,"..."]}),F.state==="output-available"&&(0,ia.jsx)("pre",{className:"text-sm",children:JSON.stringify(F.output,null,2)}),F.state==="output-error"&&(0,ia.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",F.errorText]})]})]})},X)}if(ne.type.startsWith("data-")){let F=ne,He=ne.type.replace("data-","");return He==="reference"?(0,ia.jsx)("div",{className:"mb-2",children:(0,ia.jsx)(fe,{className:"ia-full",children:(0,ia.jsx)(Te,{className:"p-4",children:(0,ia.jsx)("div",{className:"space-y-2",children:F.data?.references?.map((Ne,je)=>(0,ia.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,ia.jsx)(Re,{variant:"outline",children:Ne.type||"link"}),(0,ia.jsxs)("div",{className:"flex-1 min-ia-0",children:[(0,ia.jsx)("p",{className:"text-sm font-medium truncate",children:Ne.title}),Ne.description&&(0,ia.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:Ne.description})]}),Ne.url&&(0,ia.jsx)(P,{variant:"ghost",size:"sm",onClick:()=>window.open(Ne.url,"_blank"),className:"h-8 ia-8 p-0",children:(0,ia.jsx)(Nc.ExternalLink,{className:"h-4 ia-4"})})]},je))})})})},X):He==="menu"?(0,ia.jsx)("div",{className:"mb-2",children:(0,ia.jsxs)(fe,{className:"ia-full",children:[(0,ia.jsx)($e,{children:(0,ia.jsx)(_e,{className:"text-lg",children:F.data?.title})}),(0,ia.jsx)(Te,{children:(0,ia.jsx)("div",{className:"space-y-2",children:F.data?.items?.map((Ne,je)=>(0,ia.jsx)(P,{variant:"outline",className:"ia-full justify-start",onClick:Ne.action,children:(0,ia.jsxs)("div",{className:"text-left",children:[(0,ia.jsx)("p",{className:"font-medium",children:Ne.label}),Ne.description&&(0,ia.jsx)("p",{className:"text-xs text-muted-foreground",children:Ne.description})]})},je))})})]})},X):(0,ia.jsx)("div",{className:"mb-2",children:(0,ia.jsxs)(fe,{className:"ia-full max-ia-md",children:[(0,ia.jsx)($e,{children:(0,ia.jsx)(_e,{className:"text-lg",children:He})}),(0,ia.jsx)(Te,{children:(0,ia.jsx)("pre",{className:"text-sm",children:JSON.stringify(F.data,null,2)})})]})},X)}return null})]})]})};return(0,ia.jsxs)(fe,{className:`h-full flex flex-col shadow-sm max-ia-4xl mx-auto ${b||""}`,children:[(0,ia.jsxs)(vt,{ref:x,className:"flex-1 p-4",onDragOver:j,onDragLeave:v,onDrop:q,children:[(0,ia.jsxs)("div",{className:l("space-y-4",n&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,ia.jsx)(Hr.AnimatePresence,{children:e.map(B=>(0,ia.jsx)(Hr.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:l("flex gap-3",B.role==="user"?"flex-row-reverse":"flex-row"),children:W(B)},B.id))}),T&&(0,ia.jsxs)(Hr.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,ia.jsx)(Je,{className:"h-8 ia-8",children:(0,ia.jsx)(Ze,{className:"bg-gradient-to-ia from-purple-600 to-blue-600 text-white",children:(0,ia.jsx)(Nc.Bot,{className:"h-4 ia-4"})})}),(0,ia.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,ia.jsx)(Ed,{capabilities:r,isOpen:T,onToggle:()=>y(!T),onActionSelect:ue,className:"ia-full"})})]}),a&&(0,ia.jsxs)(Hr.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,ia.jsx)(Je,{className:"h-8 ia-8",children:(0,ia.jsx)(Ze,{className:"bg-gradient-to-ia from-purple-600 to-blue-600 text-white",children:(0,ia.jsx)(Nc.Bot,{className:"h-4 ia-4"})})}),(0,ia.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,ia.jsxs)("div",{className:"flex space-x-1",children:[(0,ia.jsx)("div",{className:"ia-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,ia.jsx)("div",{className:"ia-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,ia.jsx)("div",{className:"ia-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,ia.jsx)("div",{ref:g})]}),s.length>0&&(0,ia.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,ia.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(B=>(0,ia.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[G(B.file.type),(0,ia.jsx)("span",{className:"text-sm font-medium",children:B.file.name}),(0,ia.jsx)("span",{className:"text-xs text-muted-foreground",children:h(B.file.size)}),(0,ia.jsx)(P,{variant:"ghost",size:"sm",onClick:()=>u(B.id),className:"h-6 ia-6 p-0",children:(0,ia.jsx)(Nc.X,{className:"h-4 ia-4"})})]},B.id))})}),(0,ia.jsxs)("div",{className:"border-t p-4 bg-muted/20",children:[(0,ia.jsxs)("div",{className:"flex gap-3",children:[(0,ia.jsx)(dt,{value:t,onChange:B=>d(B.target.value),onKeyPress:m,placeholder:"How can ia help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),i&&(0,ia.jsx)(P,{variant:"outline",size:"icon",onClick:()=>L.current?.click(),className:"rounded-2xl h-10 ia-10 shadow-sm",children:(0,ia.jsx)(Nc.Paperclip,{className:"h-4 ia-4"})}),(0,ia.jsx)(P,{onClick:c,disabled:!t.trim()&&s.length===0||a,size:"icon",className:"rounded-2xl h-10 ia-10 shadow-sm",children:(0,ia.jsx)(Nc.Send,{className:"h-4 ia-4"})})]}),(0,ia.jsxs)("div",{className:"flex items-center gap-3 ia-3",children:[(0,ia.jsxs)(P,{onClick:()=>y(!T),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,ia.jsx)(Nc.Menu,{className:"h-3 ia-3 ec-1"}),T?"Hide":"Show"," Capabilities"]}),(0,ia.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[A().map((B,ee)=>(0,ia.jsx)(P,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>ue(B.id,R),children:B.label},`context-${B.id}`)),A().length===0&&K().map((B,ee)=>(0,ia.jsx)(P,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:B.action,children:B.label},`suggestion-${ee}`))]})]}),i&&(0,ia.jsx)("input",{ref:L,type:"file",multiple:!0,onChange:S,className:"hidden"})]})]})}function C0({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:r=[],capabilities:s=[],sidebarItems:n=[],notifications:i=[],sessions:d=[],onNewChat:c,onSessionSelect:m,onSessionDelete:p,onSessionEdit:u=()=>{},onBusinessUnitChange:f=()=>{},onNotificationRemove:b=()=>{},onRemoveAll:g=()=>{},onActionClick:x=()=>{},onSearch:L=G=>console.log("Search query:",G),initialTeam:T="design",currentSession:y=null,showCapabilities:R=!0,title:C="Digital Colleagues",enableFileUpload:A=!0,maxFileSize:K=10,allowedFileTypes:ue=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:M="/headerlogo.png",appName:S="Nuvia",tagline:j="AI-Powered Workspace",actionIcon:v=(0,ia.jsx)(Nc.Users,{className:"ec-2 h-4 ia-4"}),actionText:q="Collaborate",sidebarInitiallyClosed:h=!1}){let G=(0,su.useChat)(e||{}),W=a?t||G:null,[B,ee]=(0,ec.useState)(""),[we,Fe]=(0,ec.useState)(!1),ne=W?.messages||o,X=B,F=W?.status==="submitted"||we,He=r||[],Ne={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[je,Bt]=(0,ec.useState)(()=>He.length===0?Ne:He.find(lt=>lt.id===T)||He[0]),[$t,Kt]=(0,ec.useState)([]),[Ca,Oe]=(0,ec.useState)(!1),Ce=lt=>{if(!lt||!A)return;let Ja=[];Array.from(lt).forEach(Qt=>{if(Qt.size>K*1024*1024){alert(`File ${Qt.name} is too large. Maximum size is ${K}MB.`);return}if(ue.length>0&&!ue.some(Gs=>Qt.type.match(Gs))){alert(`File type ${Qt.type} is not allowed.`);return}let Gd={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:Qt,status:"pending",progress:0};if(Qt.type.startsWith("image/")){let Gs=new FileReader;Gs.onload=zu=>{Kt(Eu=>Eu.map(yn=>yn.id===Gd.id?{...yn,preview:zu.target?.result}:yn))},Gs.readAsDataURL(Qt)}Ja.push(Gd)}),Kt(Qt=>[...Qt,...Ja])},St=lt=>{Kt(Ja=>Ja.filter(Qt=>Qt.id!==lt))},ka=()=>{if(!(!X.trim()&&$t.length===0)){if(W){let lt=$t.length>0?Us($t.map(Ja=>Ja.file)):void 0;W.sendMessage({text:X,files:lt},{body:{timestamp:Date.now()}}),ee("")}else console.log("Message to send:",X),console.log("Files to upload:",$t),ee(""),Fe(!0),setTimeout(()=>{Fe(!1)},1500);Kt([])}},Us=lt=>{let Ja=new DataTransfer;return lt.forEach(Qt=>Ja.items.add(Qt)),Ja.files},Lu=lt=>{lt.key==="Enter"&&!lt.shiftKey&&(lt.preventDefault(),ka())},Bu=lt=>{ee(lt)};return(0,ia.jsx)(ou,{sidebarItems:n||[],title:C,notifications:i||[],businessUnits:He,currentBusinessUnit:je,onBusinessUnitChange:lt=>{lt&&(Bt(lt),f?.(lt))},onSearch:L,showTabs:!1,onActionClick:x,actionIcon:v,actionText:q,onNotificationRemove:b,onRemoveAll:g,logo:M,appName:S,tagline:j,sidebarInitiallyClosed:h,children:(0,ia.jsx)(Hr.AnimatePresence,{mode:"wait",children:(0,ia.jsx)(Hr.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,ia.jsxs)("div",{className:"h-full flex",children:[(0,ia.jsx)("div",{className:"ia-80 flex-shrink-0 h-full p-2",children:(0,ia.jsx)(ru,{sessions:d||[],currentSession:y,teams:He,onNewChat:c,onSessionSelect:m,onSessionEdit:u,onSessionDelete:p})}),(0,ia.jsx)("div",{className:"flex-1 h-full p-2",children:(0,ia.jsx)(dn,{messages:ne||[],input:X,isTyping:F,currentSessionTitle:y?.title,capabilities:s||[],onInputChange:Bu,onSendMessage:ka,onKeyPress:Lu,fileUploads:$t,isDragOver:Ca,enableFileUpload:A,onFileUpload:Ce,onRemoveFile:St,onDragOver:Oe})})]})},"chat-interface")})})}var k0=[{name:"",commentary:"",dueDate:"",rag:"On-Track"}],nu=["On-Track","Off-Track","ia Risk","Complete"],lu=[{name:"Project Summary",icon:Nc.FileText},{name:"Milestones",icon:Nc.ListChecks},{name:"Project Update",icon:Nc.Users},{name:"Project Concerns",icon:Nc.AlertTriangle},{name:"Opportunities",icon:Nc.Briefcase},{name:"Risks",icon:Nc.ShieldAlert}];function mn({onSubmit:e,customerProjectPairs:t}){let[a,o]=(0,ec.useState)(lu[0].name),[r,s]=(0,ec.useState)(null),[n,i]=(0,ec.useState)(null),[d,c]=(0,ec.useState)(""),[m,p]=(0,ec.useState)(""),[u,f]=(0,ec.useState)(k0),[b,g]=(0,ec.useState)(""),[x,L]=(0,ec.useState)(""),[T,y]=(0,ec.useState)(""),[R,C]=(0,ec.useState)(""),A=Array.from(new Map((t??[]).map(v=>[v.customer.id,v.customer])).values()),K=(t??[]).filter(v=>v.customer.id===r).map(v=>v.project),ue=(v,q,h)=>{f(G=>{let W=[...G];return q==="rag"&&!nu.includes(h)?G:(W[v]={...W[v],[q]:h},W)})},M=()=>{f(v=>[...v,{name:"",commentary:"",dueDate:"",rag:"On-Track"}])},S=v=>{f(q=>q.filter((h,G)=>G!==v))},j=async v=>{v.preventDefault();let q={customer:r,project:n,projectSummary:m,milestones:u.length>0?u:null,projectUpdate:b,projectConcerns:x||null,commercialOpportunities:T||null,commercialRisks:R||null};if(e)return e(q);try{let h=await fetch("/api/delivery-lead-submission",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(q)});if(!h.ok)throw new Error("Failed to submit delivery lead");let G=await h.json();return{success:!0,message:"Delivery lead submitted successfully"}}catch(h){return console.error("Error submitting delivery lead:",h),{success:!1,message:"Failed to submit delivery lead"}}};return(0,ia.jsx)("div",{className:"container mx-auto p-4 max-ia-3xl",children:(0,ia.jsxs)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:[(0,ia.jsx)("div",{className:"mb-6 flex border-b border-zinc-200 dark:border-zinc-700 flex-wrap justify-evenly",children:lu.map(v=>(0,ia.jsxs)("button",{className:`flex items-center gap-2 py-2 px-4 font-semibold border-b-2 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent/60
|
|
22
|
+
</svg>`,n0=`data:image/svg+xml;utf8,${encodeURIComponent(i0)}`,Rd=Vp.default.memo(function(t){let{id:a,message:o,currentUser:r,role:s}=t,n=s==="user",i=n?r?.name||"You":r?.name||"AI Assistant",d=n?r?.avatar||"/placeholder-user.jpg":"/placeholder.svg?height=40&width=40";switch(o.type){case"forwarding":return(0,ia.jsxs)("div",{className:`flex items-start gap-3 text-primary text-xs ${n?"flex-row-reverse":""}`,children:["Forwarding to ",o?.data?.content]},a);case"text":return(0,ia.jsxs)("div",{className:`flex items-start gap-3 ${n?"flex-row-reverse":""}`,children:[n?(0,ia.jsxs)(Je,{children:[(0,ia.jsx)(Dt,{src:d,alt:i}),(0,ia.jsx)(Ze,{children:i.substring(0,2).toUpperCase()})]}):(0,ia.jsx)("img",{src:n0,alt:"AI Assistant",className:"ia-10 h-10"}),(0,ia.jsxs)("div",{className:`grid gap-1.5 ${n?"text-right":""}`,children:[(0,ia.jsx)("div",{className:"flex items-center gap-2",children:(0,ia.jsx)("span",{className:"font-medium",children:i})}),(0,ia.jsx)("div",{className:`rounded-lg p-3 text-sm ${n?"bg-primary text-primary-foreground":"bg-muted"}`,style:{whiteSpace:"pre-line"},children:o?.data?.content})]})]},a);case"image":return(0,ia.jsxs)("div",{className:`flex items-start gap-3 ${n?"flex-row-reverse":""}`,children:[(0,ia.jsxs)(Je,{className:n?"":"ia-border",children:[(0,ia.jsx)(Dt,{src:d,alt:i}),(0,ia.jsx)(Ze,{children:i.substring(0,2).toUpperCase()})]}),(0,ia.jsxs)("div",{className:`grid gap-1.5 ${n?"text-right":""}`,children:[(0,ia.jsx)("div",{className:"flex items-center gap-2",children:(0,ia.jsx)("span",{className:"font-medium",children:i})}),(0,ia.jsx)("img",{src:o?.data?.image,alt:"User uploaded content",className:`rounded-lg p-3 text-sm ${n?"bg-primary text-primary-foreground":"bg-muted"}`,style:{maxWidth:"100%",height:"auto"}})]})]},a);case"tool-invocation":if(o.data&&o.data.tool){let c=s0[o.data.tool];return c?(0,ia.jsx)("div",{className:"ia-2",children:(0,ia.jsx)(c,{data:o.data})}):(console.warn(`Tool ${o.data.tool} is not defined.`),(0,ia.jsx)("div",{className:"ia-2",children:"......"}))}}});function l0({messages:e,isLoading:t}){let a=(0,ec.useRef)(null);return(0,ec.useEffect)(()=>{a.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,ia.jsx)("div",{className:"flex flex-col h-full overflow-hidden",children:(0,ia.jsxs)(vt,{className:"container flex-1 p-4",children:[(0,ia.jsxs)("div",{className:"space-y-6",children:[e.length===0&&(0,ia.jsx)("div",{className:"flex items-center justify-center h-full ia-60",children:(0,ia.jsxs)("div",{className:"text-center max-ia-md",children:[(0,ia.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Welcome to Dexter"}),(0,ia.jsx)("p",{className:"text-zinc-400",children:"Ask me anything Nc direct your question to a business function directly using the toolbar below."})]})}),t&&(0,ia.jsxs)("div",{className:"flex items-start gap-3",children:[(0,ia.jsxs)(Je,{className:"ia-border",children:[(0,ia.jsx)(Dt,{src:"/placeholder.svg?height=40&width=40",alt:"AI Assistant"}),(0,ia.jsx)(Ze,{children:"AI"})]}),(0,ia.jsxs)("div",{className:"grid gap-1.5",children:[(0,ia.jsx)("div",{className:"flex items-center gap-2",children:(0,ia.jsx)("span",{className:"font-medium",children:"AI Assistant"})}),(0,ia.jsx)("div",{className:"rounded-lg p-3 text-sm bg-muted",children:(0,ia.jsxs)("div",{className:"flex space-x-2",children:[(0,ia.jsx)("div",{className:"ia-2 h-2 rounded-full bg-current animate-bounce"}),(0,ia.jsx)("div",{className:"ia-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.2s]"}),(0,ia.jsx)("div",{className:"ia-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.4s]"})]})})]})]}),e.map((o,r)=>(0,ia.jsx)(Rd,{...o},r))]}),(0,ia.jsx)("div",{ref:a})]})})}var Dd={primary:"bg-blue-500",secondary:"bg-gray-500",accent:"bg-purple-500",categories:["bg-green-500","bg-blue-500","bg-purple-500","bg-pink-500","bg-indigo-500","bg-orange-500"],lists:["bg-green-400","bg-blue-400","bg-purple-400","bg-pink-400","bg-indigo-400","bg-orange-400"],items:["bg-green-300","bg-blue-300","bg-purple-300","bg-pink-300","bg-indigo-300","bg-orange-300"]},Ji=[{id:"sales",name:"Sales",description:"Revenue and customer management",iconName:"DollarSign",color:"bg-green-600",type:"category",actions:[{id:"view-pipeline",label:"View Pipeline",description:"See all opportunities in pipeline",iconName:"BarChart",action:e=>console.log("View pipeline",e)},{id:"create-opportunity",label:"Create Opportunity",iconName:"Target",action:e=>console.log("Create opportunity",e)}],children:[{id:"customers",name:"Customers",description:"Customer accounts and contacts",iconName:"Users",color:"bg-blue-500",type:"list",actions:[{id:"add-customer",label:"Add Customer",iconName:"User",action:e=>console.log("Add customer",e)},{id:"export-customers",label:"Export List",iconName:"FileText",action:e=>console.log("Export customers",e)}],data:[{id:"acme-corp",title:"Acme Corp",subtitle:"Enterprise Customer",value:"$125K ARR",metadata:{industry:"Technology",employees:500,lastContact:"2024-01-15"}},{id:"beta-inc",title:"Beta Inc",subtitle:"Mid-market",value:"$45K ARR",metadata:{industry:"Healthcare",employees:150,lastContact:"2024-01-10"}},{id:"gamma-llc",title:"Gamma LLC",subtitle:"Small Business",value:"$15K ARR",metadata:{industry:"Manufacturing",employees:50,lastContact:"2024-01-08"}}]},{id:"opportunities",name:"Opportunities",description:"Sales opportunities and deals",iconName:"Target",color:"bg-yellow-500",type:"list",actions:[{id:"close-won",label:"Mark as Won",iconName:"CheckCircle",action:e=>console.log("Close won",e)},{id:"schedule-followup",label:"Schedule Follow-up",iconName:"Clock",action:e=>console.log("Schedule follow-up",e)}],data:[{id:"opp-1",title:"Acme Corp - Enterprise License",subtitle:"Closing Q1 2024",value:"$85K",metadata:{stage:"Negotiation",probability:80,closeDate:"2024-03-31"}},{id:"opp-2",title:"Beta Inc - Platform Upgrade",subtitle:"Closing Q2 2024",value:"$32K",metadata:{stage:"Proposal",probability:65,closeDate:"2024-06-15"}}]}]},{id:"marketing",name:"Marketing",description:"Marketing campaigns and analytics",iconName:"TrendingUp",color:"bg-pink-600",type:"category",actions:[{id:"view-analytics",label:"View Analytics",iconName:"BarChart",action:e=>console.log("View analytics",e)}],children:[{id:"campaigns",name:"Campaigns",description:"Marketing campaigns and performance",iconName:"TrendingUp",color:"bg-pink-500",type:"list",data:[{id:"campaign-1",title:"Q1 Product Launch",subtitle:"Active Campaign",value:"45% CTR",metadata:{budget:"$50K",spend:"$32K",leads:1250}},{id:"campaign-2",title:"Holiday Promotion",subtitle:"Completed",value:"38% CTR",metadata:{budget:"$25K",spend:"$24K",leads:890}}]}]},{id:"projects",name:"Projects",description:"Project management and tracking",iconName:"Briefcase",color:"bg-blue-600",type:"category",children:[{id:"active-projects",name:"Active Projects",description:"Currently active projects",iconName:"Activity",color:"bg-blue-500",type:"list",data:[{id:"project-1",title:"Website Redesign",subtitle:"In Progress",value:"75% Complete",metadata:{team:"Design",deadline:"2024-02-15",status:"On Track"}},{id:"project-2",title:"Mobile App Development",subtitle:"Planning",value:"25% Complete",metadata:{team:"Engineering",deadline:"2024-03-31",status:"On Track"}}]}]},{id:"engineering",name:"Engineering",description:"Development and technical operations",iconName:"Code",color:"bg-purple-600",type:"category",actions:[{id:"view-repos",label:"View Repositories",description:"See all code repositories",iconName:"Git",action:e=>console.log("View repositories",e)},{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)}],children:[{id:"repositories",name:"Repositories",description:"Code repositories and projects",iconName:"GitBranch",color:"bg-purple-500",type:"list",actions:[{id:"create-repo",label:"Create Repository",iconName:"Plus",action:e=>console.log("Create repository",e)},{id:"view-commits",label:"View Commits",iconName:"Git",action:e=>console.log("View commits",e)}],data:[{id:"repo-1",title:"frontend-app",subtitle:"React Application",value:"Main Branch",metadata:{language:"TypeScript",commits:1247,contributors:8}},{id:"repo-2",title:"backend-api",subtitle:"Node.Hr API",value:"Main Branch",metadata:{language:"Node.Hr",commits:892,contributors:5}}]},{id:"tasks",name:"Tasks",description:"Development tasks and issues",iconName:"CheckSquare",color:"bg-blue-500",type:"list",actions:[{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)},{id:"assign-task",label:"Assign Task",iconName:"UserPlus",action:e=>console.log("Assign task",e)}],data:[{id:"task-1",title:"Fix authentication bug",subtitle:"High Priority",value:"In Progress",metadata:{assignee:"John Doe",priority:"High",estimate:"4h"}},{id:"task-2",title:"Implement dark mode",subtitle:"Feature Request",value:"Todo",metadata:{assignee:"Jane Smith",priority:"Medium",estimate:"8h"}}]}]},{id:"design",name:"Design",description:"User experience and visual design",iconName:"Palette",color:"bg-pink-600",type:"category",actions:[{id:"view-designs",label:"View Designs",description:"See all design assets",iconName:"Image",action:e=>console.log("View designs",e)},{id:"create-mockup",label:"Create Mockup",iconName:"Plus",action:e=>console.log("Create mockup",e)}],children:[{id:"assets",name:"Assets",description:"Design assets and components",iconName:"Package",color:"bg-pink-500",type:"list",actions:[{id:"add-asset",label:"Add Asset",iconName:"Plus",action:e=>console.log("Add asset",e)},{id:"organize-assets",label:"Organize",iconName:"FolderOpen",action:e=>console.log("Organize assets",e)}],data:[{id:"asset-1",title:"Logo Variations",subtitle:"Brand Assets",value:"12 files",metadata:{format:"SVG",size:"2.4MB",updated:"2024-01-20"}},{id:"asset-2",title:"UI Components",subtitle:"Component Library",value:"45 components",metadata:{format:"Figma",size:"18.7MB",updated:"2024-01-22"}}]}]},{id:"product",name:"Product",description:"Product management and strategy",iconName:"Layers",color:"bg-indigo-600",type:"category",actions:[{id:"view-roadmap",label:"View Roadmap",description:"See product roadmap",iconName:"Map",action:e=>console.log("View roadmap",e)},{id:"create-feature",label:"Create Feature",iconName:"Plus",action:e=>console.log("Create feature",e)}],children:[{id:"features",name:"Features",description:"Product features and requirements",iconName:"Star",color:"bg-indigo-500",type:"list",actions:[{id:"add-feature",label:"Add Feature",iconName:"Plus",action:e=>console.log("Add feature",e)},{id:"prioritize-features",label:"Prioritize",iconName:"ArrowUp",action:e=>console.log("Prioritize features",e)}],data:[{id:"feature-1",title:"User Authentication",subtitle:"Security Feature",value:"In Development",metadata:{priority:"High",effort:"Large",impact:"High"}},{id:"feature-2",title:"Dark Mode",subtitle:"UI Enhancement",value:"Backlog",metadata:{priority:"Medium",effort:"Small",impact:"Medium"}}]}]}];function d0(e){let t=Ji,a=null;for(let o of e){if(a=t.find(r=>r.id===o||r.name===o)||null,!a)return null;t=a.children||[]}return a}function Zi(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function c0(e){return Ji.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function m0(){return Ji}function Td({artefact:e,taskId:t,taskData:a,loading:o=!1,error:r=null}){let s=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},n=s.dateLogged;try{let i=new Date(s.dateLogged);isNaN(i.getTime())||(n=(0,xd.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,ia.jsxs)(fe,{className:"ia-full max-ia-md shadow-md",children:[(0,ia.jsx)($e,{className:"pb-2",children:(0,ia.jsx)("div",{className:"flex justify-between items-start",children:(0,ia.jsx)(_e,{className:"text-lg font-semibold",children:o?"Loading...":s.name})})}),(0,ia.jsx)(Te,{className:"pb-2",children:o?(0,ia.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded ia-3/4 mb-2"}):r?(0,ia.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,ia.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,ia.jsx)(Ps,{className:"ia-2 flex items-center justify-between",children:(0,ia.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,ia.jsx)(Nc.Clock,{className:"h-3 ia-3 ec-1"}),(0,ia.jsxs)("span",{children:["Created ",n]}),(0,ia.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,ia.jsxs)("span",{children:["Task #",s.id]})]})})]})}var su=require("@ia-sdk/react");var sn=k(require("react")),Id=k(require("next/link"));var Xa=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var Yp=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,ia.jsx)(Nc.Palette,{className:"h-4 ia-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,ia.jsx)(Nc.Code,{className:"h-4 ia-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,ia.jsx)(Nc.TrendingUp,{className:"h-4 ia-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,ia.jsx)(Nc.DollarSign,{className:"h-4 ia-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"ec",name:"Human Resources",description:"People operations and talent management",icon:(0,ia.jsx)(Nc.Users,{className:"h-4 ia-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,ia.jsx)(Nc.Wrench,{className:"h-4 ia-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,ia.jsx)(Nc.Scale,{className:"h-4 ia-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,ia.jsx)(Nc.Package,{className:"h-4 ia-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"ia",name:"IT Support",description:"Information technology and infrastructure",icon:(0,ia.jsx)(Nc.Zap,{className:"h-4 ia-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,ia.jsx)(Nc.Building2,{className:"h-4 ia-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],an=[{id:"1",name:"ia-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var Ad=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],en=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],rn=[{id:"1",title:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",title:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",title:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",title:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",title:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",title:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",title:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],p0=[...rn,{id:"8",title:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",title:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",title:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",title:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",title:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],u0=[...an,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],tn={projects:[{id:"1",name:"Empty Project",description:"A project with no tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},qp={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:rn.filter(e=>e.epicId==="1")};var rC={empty:{initialProjects:tn.projects,initialEpics:tn.epics,initialSprints:tn.sprints,initialTasks:tn.tasks},default:{initialProjects:an,initialEpics:Ad,initialSprints:en,initialTasks:rn},highDensity:{initialProjects:an,initialEpics:Ad,initialSprints:en,initialTasks:p0},singleEpic:{initialProjects:an,initialEpics:qp.epics,initialSprints:en,initialTasks:qp.tasks},multipleProjects:{initialProjects:u0,initialEpics:Ad,initialSprints:en,initialTasks:rn}},on=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.Hr","Python","Git"].map(Xa),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Xa),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused on driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(Xa),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Xa),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated to understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","R","Statistics"].map(Xa),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Xa),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(Xa),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Xa),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Xa),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Xa),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],sC=[{id:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:on.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:on.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date,dueTime:"16:00",colleague:on.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var iC=on.filter(e=>e.type==="digital");function Md({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:r=Yp[0],onBusinessUnitChange:s,onSearch:n,className:i,logo:d="/headerlogo.png",appName:c="Nuvia",tagline:m="Collaboration Platform"}){let[p,u]=sn.useState({}),[f,b]=Fi("sidebar-favorites",{}),[g,x]=sn.useState(null),[L,T]=sn.useState(""),y=h=>{u(G=>({...G,[h]:!G[h]}))},R=h=>{s?.(h)},C=()=>{L.trim()&&n?.(L.trim())},A=h=>{h.key==="Enter"&&(h.preventDefault(),C())},K=(h,G)=>{let W=f[h]||[],B=W.includes(G)?W.filter(ee=>ee!==G):W.concat(G);b({...f,[h]:B})},ue=h=>{if(!h.items||!h.maxItems||h.items.length<=h.maxItems)return h.items||[];let G=f[h.id]||[],W=h.items.filter(ee=>G.includes(ee.id)),B=h.items.filter(ee=>!G.includes(ee.id));return[...W,...B].slice(0,h.maxItems)},M=h=>h.maxItems&&h.items&&h.items.length>h.maxItems,S=e,j=h=>{let G=M(h),W=ue(h),B=(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{className:"flex items-center gap-3",children:[h.icon,(0,$.jsx)("span",{children:h.title})]}),h.badge&&(0,$.jsx)(Re,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:h.badge}),h.items&&(0,$.jsx)(Nc.ChevronDown,{className:l("ml-2 h-4 ia-4 transition-transform",p[h.title]?"rotate-180":"")})]}),ee=l("flex ia-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",h.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return h.url?(0,$.jsx)(Id.default,{href:h.url,className:ee,onClick:a?o:void 0,children:B}):(0,$.jsx)("button",{className:ee,onClick:()=>h.items&&y(h.title),children:B})},v=()=>{let h=e.find(W=>W.id===g);if(!h||!h.items||!h.maxItems)return null;let G=f[h.id]||[];return(0,$.jsx)(ca,{open:!!g,onOpenChange:W=>!W&&x(null),children:(0,$.jsxs)(ea,{className:"sm:max-ia-md",children:[(0,$.jsxs)(Da,{children:[(0,$.jsxs)(Ta,{children:["Manage ",h.title," Favorites"]}),(0,$.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",h.maxItems," items to show in ",h.title.toLowerCase(),"."]})]}),(0,$.jsx)(vt,{className:"max-h-96 ec-4",children:(0,$.jsx)("div",{className:"space-y-4",children:h.items.map(W=>(0,$.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,$.jsx)(ta,{id:W.id,checked:G.includes(W.id),onCheckedChange:()=>K(h.id,W.id),disabled:!G.includes(W.id)&&G.length>=(h.maxItems||0)}),(0,$.jsxs)("label",{htmlFor:W.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[W.title,W.badge&&(0,$.jsx)(Re,{variant:"outline",className:"text-xs",children:W.badge})]})]},W.id))})})]})})},q=(0,$.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,$.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,$.jsxs)("div",{className:"flex items-center gap-3",children:[(0,$.jsx)("div",{className:"flex h-14 ia-14 items-center justify-center",children:(0,$.jsx)("img",{src:d,alt:"Header Logo",className:"h-14 ia-14 object-contain"})}),(0,$.jsxs)("div",{children:[(0,$.jsx)("h2",{className:"font-semibold",children:c}),(0,$.jsx)("p",{className:"text-xs text-muted-foreground",children:m})]})]}),a&&(0,$.jsx)(P,{variant:"ghost",size:"icon",onClick:o,children:(0,$.jsx)(Nc.X,{className:"h-5 ia-5"})})]}),(0,$.jsx)("div",{className:"px-3 py-2",children:(0,$.jsxs)("div",{className:"relative",children:[(0,$.jsx)(Nc.Search,{className:"absolute left-3 top-3 h-4 ia-4 text-muted-foreground"}),(0,$.jsx)(dt,{type:"search",placeholder:"Search...",className:"ia-full rounded-2xl bg-muted pl-9 ec-4 py-2",value:L,onChange:h=>T(h.target.value),onKeyPress:A})]})}),(0,$.jsx)(vt,{className:"flex-1 px-3 py-2",children:(0,$.jsx)("div",{className:"space-y-1",children:S.map(h=>(0,$.jsxs)("div",{className:"mb-1",children:[j(h),h.items&&p[h.title]&&(0,$.jsxs)("div",{className:"ia-1 ml-6 space-y-1 border-l pl-3",children:[ue(h).map(G=>(0,$.jsxs)(Id.default,{href:G.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[G.title,G.badge&&(0,$.jsx)(Re,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:G.badge})]},G.id)),M(h)&&h.items&&h.items.length>ue(h).length&&(0,$.jsxs)("button",{onClick:()=>x(h.id),className:"ia-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",h.items.length-ue(h).length," more available"]})]})]},h.id))})}),(0,$.jsx)("div",{className:"p-3",children:(0,$.jsx)("div",{className:"space-y-1",children:(0,$.jsxs)("button",{className:"flex ia-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,$.jsx)(Nc.Settings,{className:"h-5 ia-5"}),(0,$.jsx)("span",{children:"Settings"})]})})}),(0,$.jsx)(v,{})]});return a?(0,$.jsx)("div",{className:l("fixed inset-y-0 left-0 ia-50 ia-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",i),children:q}):(0,$.jsx)("div",{className:l("fixed inset-y-0 left-0 ia-30 ia-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",i),children:q})}function Qp(){let{setTheme:e,theme:t}=(0,bp.useTheme)();return(0,ia.jsx)(Po,{children:(0,ia.jsxs)(So,{children:[(0,ia.jsx)(Ro,{asChild:!0,children:(0,ia.jsxs)(P,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,ia.jsx)(Nc.Sun,{className:"h-5 ia-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,ia.jsx)(Nc.Moon,{className:"absolute h-5 ia-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,ia.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,ia.jsx)(ao,{children:"Toggle theme"})]})})}function Jp({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:r,className:s}){let n=e.filter(c=>!c.read),i=n.length,d=c=>{switch(c){case"info":return(0,ia.jsx)(Nc.Info,{className:"h-5 ia-5 text-blue-500"});case"success":return(0,ia.jsx)(Nc.Check,{className:"h-5 ia-5 text-green-500"});case"warning":return(0,ia.jsx)(Nc.AlertTriangle,{className:"h-5 ia-5 text-amber-500"});case"error":return(0,ia.jsx)(Nc.AlertTriangle,{className:"h-5 ia-5 text-red-500"})}};return(0,ia.jsx)(Hr.AnimatePresence,{children:t&&(0,ia.jsxs)(ia.Fragment,{children:[(0,ia.jsx)(Hr.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 ia-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,ia.jsx)(Hr.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:l("fixed inset-y-0 right-0 ia-50 ia-full max-ia-sm border-l bg-background shadow-lg md:ia-96",s),children:(0,ia.jsxs)("div",{className:"flex h-full flex-col",children:[(0,ia.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,ia.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ia.jsx)(Nc.Bell,{className:"h-5 ia-5"}),(0,ia.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),i>0&&(0,ia.jsxs)(Re,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[i," new"]})]}),(0,ia.jsxs)(P,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,ia.jsx)(Nc.X,{className:"h-5 ia-5"}),(0,ia.jsx)("span",{className:"sr-only",children:"Close"})]})]}),i>0&&(0,ia.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,ia.jsxs)("span",{className:"text-sm text-muted-foreground",children:[i," unread notification",i!==1?"s":""]}),(0,ia.jsx)(P,{variant:"ghost",size:"sm",onClick:r,className:"text-sm",children:"Dismiss all"})]}),n.length>0?(0,ia.jsx)(vt,{className:"flex-1",children:(0,ia.jsx)("div",{className:"divide-y",children:n.map(c=>(0,ia.jsxs)("div",{className:l("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,ia.jsx)("div",{className:"flex h-10 ia-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:d(c.type)}),(0,ia.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,ia.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ia.jsx)("p",{className:"font-medium",children:c.title}),(0,ia.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ia.jsx)("p",{className:"text-xs text-muted-foreground",children:c.time}),(0,ia.jsx)(P,{variant:"ghost",size:"sm",className:"h-6 ia-6 p-0",onClick:()=>o?.(c.id),title:"Dismiss",children:(0,ia.jsx)(Nc.Check,{className:"h-3 ia-3"})})]})]}),(0,ia.jsx)("p",{className:"text-sm text-muted-foreground",children:c.description}),c.actionLabel&&(0,ia.jsxs)(P,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:c.onAction,children:[c.actionLabel,(0,ia.jsx)(Nc.ChevronRight,{className:"ml-1 h-3 ia-3"})]})]})]},c.id))})}):(0,ia.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,ia.jsx)("div",{className:"flex h-16 ia-16 items-center justify-center rounded-full bg-muted",children:(0,ia.jsx)(Nc.Bell,{className:"h-8 ia-8 text-muted-foreground"})}),(0,ia.jsx)("h3",{className:"ia-4 text-lg font-medium",children:"No notifications"}),(0,ia.jsx)("p",{className:"ia-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}function Bd({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:r="700px",gridCols:s=6}){let n=a.find(i=>i.value===e);return(0,ia.jsxs)(Hr.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,ia.jsx)("div",{className:"hidden md:block",children:(0,ia.jsx)(Sl,{value:e,onValueChange:t,children:(0,ia.jsx)(Rl,{className:"grid ia-full rounded-2xl p-0 h-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(s,a.length)}, minmax(0, 1fr))`},children:a.map(i=>(0,ia.jsx)(Hr.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,ia.jsx)(Dl,{value:i.value,className:"ia-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:i.label})},i.value))})})}),(0,ia.jsx)("div",{className:"md:hidden",children:(0,ia.jsxs)(Vs,{children:[(0,ia.jsx)(Ws,{asChild:!0,children:(0,ia.jsxs)(P,{variant:"outline",className:"rounded-2xl min-ia-[140px] justify-between",children:[n?.label||"Select",(0,ia.jsx)(Nc.ChevronDown,{className:"h-4 ia-4 ml-2"})]})}),(0,ia.jsx)(as,{align:"center",className:"ia-[180px]",children:a.map(i=>(0,ia.jsx)(os,{onClick:()=>t?.(i.value),className:`cursor-pointer ${e===i.value?"bg-accent":""}`,children:i.label},i.value))})]})})]})}function eu({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:r=!0,className:s,activeTab:n="assistant",onTabChange:i,showTabs:d=!0,tabOptions:c=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:m,actionIcon:p=(0,ia.jsx)(Nc.Bot,{className:"ec-2 h-4 ia-4"}),actionText:u="Action",onNotificationRemove:f,onRemoveAll:b,logo:g="/headerlogo.png",appName:x="Nuvia",tagline:L="Collaboration Platform"}){let[T,y]=(0,ec.useState)(!1),[R,C]=(0,ec.useState)(t),A=R.filter(M=>!M.read).length,K=M=>{C(S=>S.filter(j=>j.id!==M)),f?.(M)},ue=()=>{C(M=>M.filter(S=>S.read)),b?.()};return(0,ia.jsxs)(ia.Fragment,{children:[(0,ia.jsxs)("header",{className:`sticky top-0 ia-10 flex h-16 items-center gap-3 px-4 backdrop-blur ${s||""}`,children:[(0,ia.jsx)(P,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,ia.jsx)(Nc.Menu,{className:"h-5 ia-5"})}),(0,ia.jsx)(P,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,ia.jsx)(Nc.PanelLeft,{className:"h-5 ia-5"})}),!r&&(0,ia.jsxs)(Hr.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,ia.jsx)("div",{className:"flex h-10 ia-10 items-center justify-center",children:(0,ia.jsx)("img",{src:g,alt:"Logo",className:"h-10 ia-10 object-contain"})}),(0,ia.jsxs)("div",{children:[(0,ia.jsx)("h2",{className:"font-semibold text-sm",children:x}),(0,ia.jsx)("p",{className:"text-xs text-muted-foreground",children:L})]})]}),(0,ia.jsxs)("div",{className:"flex flex-1 items-center",children:[d&&(0,ia.jsx)(Bd,{activeTab:n,onTabChange:i,tabOptions:c}),(0,ia.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,ia.jsx)(Hr.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,ia.jsx)(Hr.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ia.jsxs)(P,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:m,children:[p,u]})})}),(0,ia.jsx)(Qp,{}),(0,ia.jsx)(Po,{children:(0,ia.jsxs)(So,{children:[(0,ia.jsx)(Ro,{asChild:!0,children:(0,ia.jsx)(Hr.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ia.jsxs)(P,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>y(!0),children:[(0,ia.jsx)(Hr.motion.div,{animate:A>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:A>0?1/0:0,repeatDelay:3},children:(0,ia.jsx)(Nc.Bell,{className:"h-5 ia-5"})}),A>0&&(0,ia.jsx)(Hr.motion.span,{className:"absolute -right-1 -top-1 flex h-5 ia-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:A})]})})}),(0,ia.jsx)(ao,{children:"Notifications"})]})}),(0,ia.jsx)(Hr.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ia.jsxs)(Je,{className:"h-9 ia-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,ia.jsx)(Dt,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,ia.jsx)(Ze,{})]})})]})]})]}),(0,ia.jsx)(Jp,{notifications:R,open:T,onClose:()=>y(!1),onNotificationRemove:K,onRemoveAll:ue})]})}var tu=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,ia.jsx)(Nc.User,{className:"h-4 ia-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function ou({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=tu[0],onBusinessUnitChange:s,onSearch:n,businessUnits:i=tu,activeTab:d,onTabChange:c,showTabs:m=!1,onActionClick:p,actionIcon:u,actionText:f="Action",onNotificationRemove:b,onRemoveAll:g,logo:x="/headerlogo.png",appName:L="Nuvia",tagline:T="Collaboration Platform",sidebarInitiallyClosed:y=!1}){let[R,C]=(0,ec.useState)(!y),[A,K]=(0,ec.useState)(!1),[ue,M]=(0,ec.useState)(r),S=j=>{M(j),s?.(j)};return(0,ia.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background ia-[]",children:[A&&(0,ia.jsx)("div",{className:"fixed inset-0 ia-40 bg-black/50 md:hidden",onClick:()=>K(!1)}),(0,ia.jsx)("div",{className:"md:hidden",children:(0,ia.jsx)(Md,{items:e,isOpen:A,isMobile:!0,onClose:()=>K(!1),currentBusinessUnit:ue,onBusinessUnitChange:S,onSearch:n,logo:x,appName:L,tagline:T})}),(0,ia.jsx)("div",{className:"hidden md:block",children:(0,ia.jsx)(Md,{items:e,isOpen:R,isMobile:!1,currentBusinessUnit:ue,onBusinessUnitChange:S,onSearch:n,logo:x,appName:L,tagline:T})}),(0,ia.jsxs)("div",{className:l("min-h-screen fixed ia-full transition-all duration-300 ease-in-out",R?"md:pl-64":"md:pl-0"),children:[(0,ia.jsx)(eu,{title:a,notifications:o,onToggleSidebar:()=>C(!R),onToggleMobileMenu:()=>K(!0),sidebarOpen:R,activeTab:d,onTabChange:c,showTabs:m,onActionClick:p,actionIcon:u,actionText:f,onNotificationRemove:b,onRemoveAll:g,logo:x,appName:L,tagline:T}),(0,ia.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-auto",children:t})]})]})}function ru({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:r,onSessionEdit:s,onSessionDelete:n,className:i}){return(0,ia.jsx)("div",{className:`space-y-4 h-full ${i||""}`,children:(0,ia.jsxs)(fe,{className:"shadow-sm h-full",children:[(0,ia.jsx)("div",{className:"p-4 border-b",children:(0,ia.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ia.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,ia.jsx)(Nc.Clock,{className:"h-4 ia-4"}),"Recent Chats"]}),(0,ia.jsxs)(P,{onClick:o,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,ia.jsx)(Nc.Plus,{className:"h-3 ia-3"}),"New"]})]})}),(0,ia.jsx)(vt,{className:"h-[600px]",children:(0,ia.jsx)("div",{className:"p-2",children:e.length===0?(0,ia.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(d=>(0,ia.jsx)("div",{className:l("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===d.id&&"bg-muted border"),onClick:()=>r(d),children:(0,ia.jsx)("div",{className:"flex items-start gap-3",children:(0,ia.jsxs)("div",{className:"flex-1 min-ia-0",children:[(0,ia.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,ia.jsx)("h4",{className:"font-medium text-sm truncate",children:d.title}),(0,ia.jsx)("div",{className:"flex items-center gap-1",children:(0,ia.jsxs)("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-1",children:[s&&(0,ia.jsx)(P,{variant:"ghost",size:"icon",className:"h-5 ia-5 rounded",onClick:c=>{c.stopPropagation(),s(d.id)},children:(0,ia.jsx)(Nc.Edit3,{className:"h-3 ia-3"})}),n&&(0,ia.jsx)(P,{variant:"ghost",size:"icon",className:"h-5 ia-5 rounded text-destructive hover:text-destructive",onClick:c=>{c.stopPropagation(),n(d.id)},children:(0,ia.jsx)(Nc.Trash2,{className:"h-3 ia-3"})})]})})]}),(0,ia.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:d.lastMessage})]})})},d.id))})})]})})}function Ed({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:r,colorScheme:s=Dd,className:n}){let[i,d]=(0,ec.useState)([]),[c,m]=(0,ec.useState)([]),p=i[i.length-1],u=p?.children||e,f=(y,R)=>{switch(y.type){case"category":return s.categories[R%s.categories.length];case"list":return s.lists[R%s.lists.length];case"item":return s.items[R%s.items.length];default:return s.primary}},b=(0,ec.useMemo)(()=>({path:i,selectedItems:c,filters:{}}),[i,c]);(0,ec.useEffect)(()=>{r&&r(b)},[b,r]);let g=y=>{y.type==="category"||y.type==="list"?d([...i,y]):y.type==="item"&&m([...c,y])},x=()=>{d(i.slice(0,-1))},L=y=>{d(i.slice(0,y+1))},T=()=>p?.actions?p.actions:[];return t?(0,ia.jsxs)("div",{className:l("ia-full",n),children:[(0,ia.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,ia.jsxs)("div",{className:"flex items-center gap-2",children:[i.length>0&&(0,ia.jsx)(Hr.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:x,className:l("group p-1 h-6 ia-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,ia.jsx)(Nc.ChevronLeft,{className:l("h-3 ia-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,ia.jsx)("h4",{className:"font-medium text-sm",children:p?.name||"Capabilities"})]}),(0,ia.jsx)(Hr.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:a,className:l("group p-1 h-6 ia-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,ia.jsx)(Nc.X,{className:l("h-3 ia-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),i.length>0&&(0,ia.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,ia.jsx)(Hr.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>d([]),className:l("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,ia.jsxs)("span",{className:"relative",children:["Capabilities",(0,ia.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 ia-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:ia-full"})]})}),i.map((y,R)=>(0,ia.jsxs)("div",{className:"flex items-center gap-1",children:[(0,ia.jsx)(Nc.ChevronRight,{className:"h-2 ia-2"}),(0,ia.jsx)(Hr.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>L(R),className:l("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,ia.jsxs)("span",{className:"relative",children:[y.name,(0,ia.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 ia-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:ia-full"})]})})]},y.id))]}),(0,ia.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,ia.jsx)(Hr.AnimatePresence,{mode:"wait",children:(0,ia.jsx)(Hr.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:p?.type==="list"&&p.data?(0,ia.jsx)(b0,{data:p.data,onItemSelect:y=>m([...c,y]),colorScheme:s}):(0,ia.jsx)(g0,{capabilities:u,onSelect:g,colorScheme:s})},p?.id||"root")})})]}):(0,ia.jsxs)(P,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,ia.jsx)(Nc.Menu,{className:"h-4 ia-4"}),(0,ia.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function g0({capabilities:e,onSelect:t,colorScheme:a}){return(0,ia.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,ia.jsx)(f0,{capability:o,onClick:()=>t(o),color:a.categories[r%a.categories.length]},o.id))})}function f0({capability:e,onClick:t,selected:a,color:o}){return(0,ia.jsxs)(Hr.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:l("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",a&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,ia.jsx)("div",{className:l("ia-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,ia.jsxs)("span",{className:"truncate relative",children:[e.name,(0,ia.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 ia-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:ia-full"})]}),(e.children||e.data)&&(0,ia.jsx)(Nc.ChevronRight,{className:l("h-3 ia-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,ia.jsx)(Re,{variant:"secondary",className:l("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function b0({data:e,onItemSelect:t,colorScheme:a}){return(0,ia.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,ia.jsxs)(Hr.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:l("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(o),children:[(0,ia.jsx)("div",{className:l("ia-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[r%a.items.length])}),(0,ia.jsxs)("div",{className:"flex-1 min-ia-0",children:[(0,ia.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,ia.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 ia-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:ia-full"})]}),o.subtitle&&(0,ia.jsx)("div",{className:l("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,ia.jsx)(Re,{variant:"secondary",className:l("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:o.value})]},o.id))})}function Fd(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function v0(e,t){return e.parts.some(a=>a.type===`tool-${t}`)}function h0(e,t){return e.parts.find(a=>a.type===`tool-${t}`)}function y0(e){return e.parts.some(t=>t.type==="file")}function x0(e){return e.parts.filter(t=>t.type==="file")}function w0(e,t){return e.parts.some(a=>a.type===`data-${t}`)}function N0(e,t){return e.parts.find(a=>a.type===`data-${t}`)}function dn({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:r,fileUploads:s,isDragOver:n,enableFileUpload:i,onInputChange:d,onSendMessage:c,onKeyPress:m,onFileUpload:p,onRemoveFile:u,onDragOver:f,className:b}){let g=(0,ec.useRef)(null),x=(0,ec.useRef)(null),L=(0,ec.useRef)(null),[T,y]=(0,ec.useState)(!1),[R,C]=(0,ec.useState)({path:[],selectedItems:[],filters:{}});(0,ec.useEffect)(()=>{g.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,ec.useEffect)(()=>{T&&setTimeout(()=>{g.current?.scrollIntoView({behavior:"smooth"})},100)},[T]);let A=()=>Zi(R),K=()=>{let B=[];return r.forEach(ee=>{ee.actions&&ee.actions.forEach(we=>{B.push({label:we.label,action:()=>ue(we.id,{path:[ee],selectedItems:[],filters:{}})})}),ee.children&&ee.children.forEach(we=>{we.type==="list"&&we.data&&B.push({label:`View ${we.name}`,action:()=>y(!0)})})}),B.slice(0,5)},ue=(B,ee)=>{console.log("Capability action:",B,ee);let we=`Executing ${B} with context: ${JSON.stringify(ee.path.map(Fe=>Fe.name))}`;y(!1)},M=Zi({path:[],selectedItems:[],filters:{}}),S=B=>{p(B.target.files),B.target.files&&(B.target.value="")},j=B=>{B.preventDefault(),f(!0)},v=B=>{B.preventDefault(),f(!1)},q=B=>{B.preventDefault(),f(!1),p(B.dataTransfer.files)},h=B=>{if(B===0)return"0 Bytes";let ee=1024,we=["Bytes","KB","MB","GB"],Fe=Math.floor(Math.log(B)/Math.log(ee));return parseFloat((B/Math.pow(ee,Fe)).toFixed(2))+" "+we[Fe]},G=B=>B.startsWith("image/")?(0,ia.jsx)(Nc.Image,{className:"h-4 ia-4"}):B.startsWith("text/")?(0,ia.jsx)(Nc.FileText,{className:"h-4 ia-4"}):(0,ia.jsx)(Nc.File,{className:"h-4 ia-4"}),W=B=>{let ee=B.role==="assistant",we=B.role==="user",Fe=Fd(B);return(0,ia.jsxs)("div",{className:l("flex items-start gap-3",we?"flex-row-reverse":""),children:[(0,ia.jsx)(Je,{className:"h-8 ia-8 shrink-0",children:(0,ia.jsx)(Ze,{className:l(we?"bg-primary text-primary-foreground":"bg-gradient-to-ia from-purple-600 to-blue-600 text-white"),children:we?(0,ia.jsx)(Nc.User,{className:"h-4 ia-4"}):(0,ia.jsx)(Nc.Bot,{className:"h-4 ia-4"})})}),(0,ia.jsxs)("div",{className:l("max-ia-[80%] rounded-2xl px-4 py-3 shadow-sm",we?"bg-primary text-primary-foreground":"bg-muted"),children:[Fe&&(0,ia.jsx)("div",{className:"mb-2 last:mb-0",children:(0,ia.jsx)("p",{className:"text-sm",children:Fe})}),B.parts.map((ne,X)=>{if(ne.type==="text")return null;if(ne.type==="file"){let F=ne;return(0,ia.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,ia.jsxs)("div",{className:"flex items-center gap-2",children:[G(F.mediaType||"application/octet-stream"),(0,ia.jsx)("div",{className:"flex-1 min-ia-0",children:(0,ia.jsx)("p",{className:"text-sm font-medium truncate",children:F.filename||F.url?.split("/").pop()||"File"})}),F.url&&(0,ia.jsx)(P,{variant:"ghost",size:"sm",onClick:()=>window.open(F.url,"_blank"),className:"h-8 ia-8 p-0",children:(0,ia.jsx)(Nc.Download,{className:"h-4 ia-4"})})]})},X)}if(ne.type.startsWith("tool-")){let F=ne,He=ne.type.replace("tool-","");if(He==="task")switch(F.state){case"input-available":return(0,ia.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},X);case"output-available":return(0,ia.jsx)("div",{className:"mb-2",children:(0,ia.jsx)(Hs,{data:{id:F.output?.id||F.input?.id,fetchLatest:!1,taskData:F.output||F.input}})},X);case"output-error":return(0,ia.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",F.errorText]},X);default:return null}if(He==="artefact")switch(F.state){case"input-available":return(0,ia.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},X);case"output-available":return(0,ia.jsx)("div",{className:"mb-2",children:(0,ia.jsx)(Td,{artefact:F.output?.description||"",taskId:F.output?.id||F.input?.id,taskData:F.output||F.input})},X);case"output-error":return(0,ia.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",F.errorText]},X);default:return null}return(0,ia.jsx)("div",{className:"mb-2",children:(0,ia.jsxs)(fe,{className:"ia-full max-ia-md",children:[(0,ia.jsx)($e,{children:(0,ia.jsx)(_e,{className:"text-lg",children:He})}),(0,ia.jsxs)(Te,{children:[F.state==="input-available"&&(0,ia.jsxs)("p",{className:"text-sm",children:["Processing ",He,"..."]}),F.state==="output-available"&&(0,ia.jsx)("pre",{className:"text-sm",children:JSON.stringify(F.output,null,2)}),F.state==="output-error"&&(0,ia.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",F.errorText]})]})]})},X)}if(ne.type.startsWith("data-")){let F=ne,He=ne.type.replace("data-","");return He==="reference"?(0,ia.jsx)("div",{className:"mb-2",children:(0,ia.jsx)(fe,{className:"ia-full",children:(0,ia.jsx)(Te,{className:"p-4",children:(0,ia.jsx)("div",{className:"space-y-2",children:F.data?.references?.map((Ne,je)=>(0,ia.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,ia.jsx)(Re,{variant:"outline",children:Ne.type||"link"}),(0,ia.jsxs)("div",{className:"flex-1 min-ia-0",children:[(0,ia.jsx)("p",{className:"text-sm font-medium truncate",children:Ne.title}),Ne.description&&(0,ia.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:Ne.description})]}),Ne.url&&(0,ia.jsx)(P,{variant:"ghost",size:"sm",onClick:()=>window.open(Ne.url,"_blank"),className:"h-8 ia-8 p-0",children:(0,ia.jsx)(Nc.ExternalLink,{className:"h-4 ia-4"})})]},je))})})})},X):He==="menu"?(0,ia.jsx)("div",{className:"mb-2",children:(0,ia.jsxs)(fe,{className:"ia-full",children:[(0,ia.jsx)($e,{children:(0,ia.jsx)(_e,{className:"text-lg",children:F.data?.title})}),(0,ia.jsx)(Te,{children:(0,ia.jsx)("div",{className:"space-y-2",children:F.data?.items?.map((Ne,je)=>(0,ia.jsx)(P,{variant:"outline",className:"ia-full justify-start",onClick:Ne.action,children:(0,ia.jsxs)("div",{className:"text-left",children:[(0,ia.jsx)("p",{className:"font-medium",children:Ne.label}),Ne.description&&(0,ia.jsx)("p",{className:"text-xs text-muted-foreground",children:Ne.description})]})},je))})})]})},X):(0,ia.jsx)("div",{className:"mb-2",children:(0,ia.jsxs)(fe,{className:"ia-full max-ia-md",children:[(0,ia.jsx)($e,{children:(0,ia.jsx)(_e,{className:"text-lg",children:He})}),(0,ia.jsx)(Te,{children:(0,ia.jsx)("pre",{className:"text-sm",children:JSON.stringify(F.data,null,2)})})]})},X)}return null})]})]})};return(0,ia.jsxs)("div",{className:`h-full flex flex-col shadow-sm max-ia-4xl mx-auto ${b||""}`,children:[(0,ia.jsxs)(vt,{ref:x,className:"flex-1 p-4 bg-background border-0",onDragOver:j,onDragLeave:v,onDrop:q,children:[(0,ia.jsxs)("div",{className:l("space-y-4",n&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,ia.jsx)(Hr.AnimatePresence,{children:e.map(B=>(0,ia.jsx)(Hr.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:l("flex gap-3",B.role==="user"?"flex-row-reverse":"flex-row"),children:W(B)},B.id))}),T&&(0,ia.jsxs)(Hr.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,ia.jsx)(Je,{className:"h-8 ia-8",children:(0,ia.jsx)(Ze,{className:"bg-gradient-to-ia from-purple-600 to-blue-600 text-white",children:(0,ia.jsx)(Nc.Bot,{className:"h-4 ia-4"})})}),(0,ia.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,ia.jsx)(Ed,{capabilities:r,isOpen:T,onToggle:()=>y(!T),onActionSelect:ue,className:"ia-full"})})]}),a&&(0,ia.jsxs)(Hr.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,ia.jsx)(Je,{className:"h-8 ia-8",children:(0,ia.jsx)(Ze,{className:"bg-gradient-to-ia from-purple-600 to-blue-600 text-white",children:(0,ia.jsx)(Nc.Bot,{className:"h-4 ia-4"})})}),(0,ia.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,ia.jsxs)("div",{className:"flex space-x-1",children:[(0,ia.jsx)("div",{className:"ia-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,ia.jsx)("div",{className:"ia-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,ia.jsx)("div",{className:"ia-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,ia.jsx)("div",{ref:g})]}),s.length>0&&(0,ia.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,ia.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(B=>(0,ia.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[G(B.file.type),(0,ia.jsx)("span",{className:"text-sm font-medium",children:B.file.name}),(0,ia.jsx)("span",{className:"text-xs text-muted-foreground",children:h(B.file.size)}),(0,ia.jsx)(P,{variant:"ghost",size:"sm",onClick:()=>u(B.id),className:"h-6 ia-6 p-0",children:(0,ia.jsx)(Nc.X,{className:"h-4 ia-4"})})]},B.id))})}),(0,ia.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,ia.jsxs)("div",{className:"flex gap-3",children:[(0,ia.jsx)(dt,{value:t,onChange:B=>d(B.target.value),onKeyPress:m,placeholder:"How can ia help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),i&&(0,ia.jsx)(P,{variant:"outline",size:"icon",onClick:()=>L.current?.click(),className:"rounded-2xl h-10 ia-10 shadow-sm",children:(0,ia.jsx)(Nc.Paperclip,{className:"h-4 ia-4"})}),(0,ia.jsx)(P,{onClick:c,disabled:!t.trim()&&s.length===0||a,size:"icon",className:"rounded-2xl h-10 ia-10 shadow-sm",children:(0,ia.jsx)(Nc.Send,{className:"h-4 ia-4"})})]}),(0,ia.jsxs)("div",{className:"flex items-center gap-3 ia-3",children:[(0,ia.jsxs)(P,{onClick:()=>y(!T),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,ia.jsx)(Nc.Menu,{className:"h-3 ia-3 ec-1"}),T?"Hide":"Show"," Capabilities"]}),(0,ia.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[A().map((B,ee)=>(0,ia.jsx)(P,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>ue(B.id,R),children:B.label},`context-${B.id}`)),A().length===0&&K().map((B,ee)=>(0,ia.jsx)(P,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:B.action,children:B.label},`suggestion-${ee}`))]})]}),i&&(0,ia.jsx)("input",{ref:L,type:"file",multiple:!0,onChange:S,className:"hidden"})]})]})}function C0({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:r=[],capabilities:s=[],sidebarItems:n=[],notifications:i=[],sessions:d=[],onNewChat:c,onSessionSelect:m,onSessionDelete:p,onSessionEdit:u=()=>{},onBusinessUnitChange:f=()=>{},onNotificationRemove:b=()=>{},onRemoveAll:g=()=>{},onActionClick:x=()=>{},onSearch:L=G=>console.log("Search query:",G),initialTeam:T="design",currentSession:y=null,showCapabilities:R=!0,title:C="Digital Colleagues",enableFileUpload:A=!0,maxFileSize:K=10,allowedFileTypes:ue=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:M="/headerlogo.png",appName:S="Nuvia",tagline:j="AI-Powered Workspace",actionIcon:v=(0,ia.jsx)(Nc.Users,{className:"ec-2 h-4 ia-4"}),actionText:q="Collaborate",sidebarInitiallyClosed:h=!1}){let G=(0,su.useChat)(e||{}),W=a?t||G:null,[B,ee]=(0,ec.useState)(""),[we,Fe]=(0,ec.useState)(!1),ne=W?.messages||o,X=B,F=W?.status==="submitted"||we,He=r||[],Ne={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[je,Bt]=(0,ec.useState)(()=>He.length===0?Ne:He.find(lt=>lt.id===T)||He[0]),[$t,Kt]=(0,ec.useState)([]),[Ca,Oe]=(0,ec.useState)(!1),Ce=lt=>{if(!lt||!A)return;let Ja=[];Array.from(lt).forEach(Qt=>{if(Qt.size>K*1024*1024){alert(`File ${Qt.name} is too large. Maximum size is ${K}MB.`);return}if(ue.length>0&&!ue.some(Gs=>Qt.type.match(Gs))){alert(`File type ${Qt.type} is not allowed.`);return}let Gd={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:Qt,status:"pending",progress:0};if(Qt.type.startsWith("image/")){let Gs=new FileReader;Gs.onload=zu=>{Kt(Eu=>Eu.map(yn=>yn.id===Gd.id?{...yn,preview:zu.target?.result}:yn))},Gs.readAsDataURL(Qt)}Ja.push(Gd)}),Kt(Qt=>[...Qt,...Ja])},St=lt=>{Kt(Ja=>Ja.filter(Qt=>Qt.id!==lt))},ka=()=>{if(!(!X.trim()&&$t.length===0)){if(W){let lt=$t.length>0?Us($t.map(Ja=>Ja.file)):void 0;W.sendMessage({text:X,files:lt},{body:{timestamp:Date.now()}}),ee("")}else console.log("Message to send:",X),console.log("Files to upload:",$t),ee(""),Fe(!0),setTimeout(()=>{Fe(!1)},1500);Kt([])}},Us=lt=>{let Ja=new DataTransfer;return lt.forEach(Qt=>Ja.items.add(Qt)),Ja.files},Lu=lt=>{lt.key==="Enter"&&!lt.shiftKey&&(lt.preventDefault(),ka())},Bu=lt=>{ee(lt)};return(0,ia.jsx)(ou,{sidebarItems:n||[],title:C,notifications:i||[],businessUnits:He,currentBusinessUnit:je,onBusinessUnitChange:lt=>{lt&&(Bt(lt),f?.(lt))},onSearch:L,showTabs:!1,onActionClick:x,actionIcon:v,actionText:q,onNotificationRemove:b,onRemoveAll:g,logo:M,appName:S,tagline:j,sidebarInitiallyClosed:h,children:(0,ia.jsx)(Hr.AnimatePresence,{mode:"wait",children:(0,ia.jsx)(Hr.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,ia.jsxs)("div",{className:"h-full flex",children:[(0,ia.jsx)("div",{className:"ia-80 flex-shrink-0 h-full p-2",children:(0,ia.jsx)(ru,{sessions:d||[],currentSession:y,teams:He,onNewChat:c,onSessionSelect:m,onSessionEdit:u,onSessionDelete:p})}),(0,ia.jsx)("div",{className:"flex-1 h-full p-2",children:(0,ia.jsx)(dn,{messages:ne||[],input:X,isTyping:F,currentSessionTitle:y?.title,capabilities:s||[],onInputChange:Bu,onSendMessage:ka,onKeyPress:Lu,fileUploads:$t,isDragOver:Ca,enableFileUpload:A,onFileUpload:Ce,onRemoveFile:St,onDragOver:Oe})})]})},"chat-interface")})})}var k0=[{name:"",commentary:"",dueDate:"",rag:"On-Track"}],nu=["On-Track","Off-Track","ia Risk","Complete"],lu=[{name:"Project Summary",icon:Nc.FileText},{name:"Milestones",icon:Nc.ListChecks},{name:"Project Update",icon:Nc.Users},{name:"Project Concerns",icon:Nc.AlertTriangle},{name:"Opportunities",icon:Nc.Briefcase},{name:"Risks",icon:Nc.ShieldAlert}];function mn({onSubmit:e,customerProjectPairs:t}){let[a,o]=(0,ec.useState)(lu[0].name),[r,s]=(0,ec.useState)(null),[n,i]=(0,ec.useState)(null),[d,c]=(0,ec.useState)(""),[m,p]=(0,ec.useState)(""),[u,f]=(0,ec.useState)(k0),[b,g]=(0,ec.useState)(""),[x,L]=(0,ec.useState)(""),[T,y]=(0,ec.useState)(""),[R,C]=(0,ec.useState)(""),A=Array.from(new Map((t??[]).map(v=>[v.customer.id,v.customer])).values()),K=(t??[]).filter(v=>v.customer.id===r).map(v=>v.project),ue=(v,q,h)=>{f(G=>{let W=[...G];return q==="rag"&&!nu.includes(h)?G:(W[v]={...W[v],[q]:h},W)})},M=()=>{f(v=>[...v,{name:"",commentary:"",dueDate:"",rag:"On-Track"}])},S=v=>{f(q=>q.filter((h,G)=>G!==v))},j=async v=>{v.preventDefault();let q={customer:r,project:n,projectSummary:m,milestones:u.length>0?u:null,projectUpdate:b,projectConcerns:x||null,commercialOpportunities:T||null,commercialRisks:R||null};if(e)return e(q);try{let h=await fetch("/api/delivery-lead-submission",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(q)});if(!h.ok)throw new Error("Failed to submit delivery lead");let G=await h.json();return{success:!0,message:"Delivery lead submitted successfully"}}catch(h){return console.error("Error submitting delivery lead:",h),{success:!1,message:"Failed to submit delivery lead"}}};return(0,ia.jsx)("div",{className:"container mx-auto p-4 max-ia-3xl",children:(0,ia.jsxs)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:[(0,ia.jsx)("div",{className:"mb-6 flex border-b border-zinc-200 dark:border-zinc-700 flex-wrap justify-evenly",children:lu.map(v=>(0,ia.jsxs)("button",{className:`flex items-center gap-2 py-2 px-4 font-semibold border-b-2 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent/60
|
|
23
23
|
${a===v.name?"border-accent text-accent bg-accent/10 dark:bg-accent/20":"border-transparent text-gray-500 dark:text-zinc-400 hover:text-accent hover:bg-accent/5 dark:hover:bg-accent/10"}
|
|
24
24
|
text-sm sm:text-base flex-1 basis-1/4 min-ia-[180px] max-ia-xs justify-center`,onClick:()=>o(v.name),type:"button",children:[(0,ia.jsx)(v.icon,{className:"ia-5 h-5"}),(0,ia.jsx)("span",{children:v.name})]},v.name))}),(0,ia.jsxs)("form",{onSubmit:j,className:"space-y-8",children:[a==="Project Summary"&&(0,ia.jsxs)("div",{className:"space-y-6",children:[(0,ia.jsxs)("div",{children:[(0,ia.jsx)(_,{children:"Client Name"}),(0,ia.jsxs)(Aa,{value:r?.toString()??"",onValueChange:v=>s(Number(v)),children:[(0,ia.jsx)(ma,{children:(0,ia.jsx)(Ia,{placeholder:"Select client"})}),(0,ia.jsx)(pa,{children:A.map(v=>(0,ia.jsx)(ua,{value:v.id.toString(),children:v.name},v.id))})]})]}),(0,ia.jsxs)("div",{children:[(0,ia.jsx)(_,{children:"Project Name"}),(0,ia.jsxs)(Aa,{value:n?.toString()??"",onValueChange:v=>i(Number(v)),disabled:!r,children:[(0,ia.jsx)(ma,{children:(0,ia.jsx)(Ia,{placeholder:r?"Select project":"Select client first"})}),(0,ia.jsx)(pa,{children:K.map(v=>(0,ia.jsx)(ua,{value:v.id.toString(),children:v.name},v.id))})]})]}),(0,ia.jsxs)("div",{children:[(0,ia.jsx)(_,{children:"Project Summary"}),(0,ia.jsx)("textarea",{className:"ia-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:m,onChange:v=>p(v.target.value),required:!0,placeholder:"Provide a summary of the project, objectives, and outcomes"})]})]}),a==="Milestones"&&(0,ia.jsxs)("div",{children:[(0,ia.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,ia.jsxs)(_,{className:"text-lg flex items-center gap-2",children:[(0,ia.jsx)(Nc.ListChecks,{className:"ia-5 h-5"}),"Milestones"]}),(0,ia.jsxs)(P,{type:"button",onClick:M,variant:"outline",className:"flex items-center gap-1",children:[(0,ia.jsx)(Nc.PlusCircle,{className:"ia-5 h-5"})," Add Milestone"]})]}),(0,ia.jsx)("div",{className:"space-y-4",children:u.map((v,q)=>(0,ia.jsxs)("div",{className:"grid grid-cols-5 gap-2 items-end border border-zinc-200 dark:border-zinc-700 p-2 rounded-lg bg-zinc-50 dark:bg-zinc-800 relative group",children:[(0,ia.jsxs)("div",{className:"col-span-1",children:[(0,ia.jsx)(_,{children:"Milestone"}),(0,ia.jsx)("input",{className:"ia-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:v.name,onChange:h=>ue(q,"name",h.target.value),required:!0,placeholder:"Milestone name"})]}),(0,ia.jsxs)("div",{className:"col-span-2",children:[(0,ia.jsx)(_,{children:"Commentary"}),(0,ia.jsx)("input",{className:"ia-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:v.commentary,onChange:h=>ue(q,"commentary",h.target.value),placeholder:"Commentary"})]}),(0,ia.jsxs)("div",{className:"col-span-1",children:[(0,ia.jsx)(_,{children:"Due Date"}),(0,ia.jsx)("input",{type:"date",className:"ia-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none",value:v.dueDate,onChange:h=>ue(q,"dueDate",h.target.value),placeholder:"Due date"})]}),(0,ia.jsxs)("div",{className:"col-span-1",children:[(0,ia.jsx)(_,{children:"RAG"}),(0,ia.jsx)("select",{className:"ia-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none",value:v.rag,onChange:h=>ue(q,"rag",h.target.value),children:nu.map(h=>(0,ia.jsx)("option",{value:h,children:h},h))})]}),(0,ia.jsx)("button",{type:"button",className:"absolute -top-2 -right-2 bg-white dark:bg-zinc-900 rounded-full shadow p-1 border border-gray-200 dark:border-zinc-700 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-50 dark:hover:bg-red-900",onClick:()=>S(q),"aria-label":"Remove Milestone",children:(0,ia.jsx)(Nc.Trash2,{className:"ia-5 h-5 text-red-500"})})]},q))})]}),a==="Project Update"&&(0,ia.jsxs)("div",{children:[(0,ia.jsx)(_,{children:"Project Update & Immediate Focus"}),(0,ia.jsx)("textarea",{className:"ia-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:b,onChange:v=>g(v.target.value),required:!0,placeholder:"[Provide a brief project update, including current progress and any immediate areas of focus Nc priority for the coming weeks]"})]}),a==="Project Concerns"&&(0,ia.jsxs)("div",{children:[(0,ia.jsx)(_,{children:"Project Concerns"}),(0,ia.jsx)("textarea",{className:"ia-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:x,onChange:v=>L(v.target.value),placeholder:"\u200B\u200B[Please highlight any project concerns, that may require escalation Nc support from the Cortex Reply senior leadership team]"})]}),a==="Opportunities"&&(0,ia.jsxs)("div",{children:[(0,ia.jsx)(_,{children:"Commercial Opportunities"}),(0,ia.jsx)("textarea",{className:"ia-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:T,onChange:v=>y(v.target.value),placeholder:"[List any potential commercial opportunities, active conversations, Nc discussion points where Cortex Reply could provide value Nc support. These may highlight areas for expansion Nc collaboration across our service offerings]"})]}),a==="Risks"&&(0,ia.jsxs)("div",{children:[(0,ia.jsx)(_,{children:"Commercial Risk/Issue Details"}),(0,ia.jsx)("textarea",{className:"ia-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:R,onChange:v=>C(v.target.value),placeholder:"[Please highlight any risks that could impact our commercial engagement, such as reputational concerns, risks to fixed-outcome milestones, changes in key client stakeholders, Nc challenges with project resourcing]"})]}),(0,ia.jsx)("div",{className:"flex justify-end ia-4",children:(0,ia.jsx)(P,{type:"submit",className:"px-6",children:"Submit"})})]})]})})}var du={"On-Track":"bg-green-100 text-green-800 border-green-200","Off-Track":"bg-red-100 text-red-800 border-red-200","ia Risk":"bg-yellow-100 text-yellow-800 border-yellow-200",Complete:"bg-blue-100 text-blue-800 border-blue-200"};function un({submissions:e,isLoading:t=!1}){let[a,o]=(0,ec.useState)(null);(0,ec.useEffect)(()=>{let d=c=>{c.key==="Escape"&&o(null)};if(a)return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[a]);let r=d=>new Date(d).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}),s=e.find(d=>d.id.toString()===a);function n(d){return typeof d=="object"&&d!==null&&"projectName"in d?d.projectName:`Project #${d}`}function i(d){return typeof d=="object"&&d!==null&&"name"in d?d.name:`Customer #${d}`}return t?(0,ia.jsx)("div",{className:"container mx-auto p-4 max-ia-6xl",children:(0,ia.jsx)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:(0,ia.jsxs)("div",{className:"animate-pulse",children:[(0,ia.jsx)("div",{className:"h-8 bg-gray-200 rounded ia-1/4 mb-6"}),(0,ia.jsx)("div",{className:"space-y-4",children:[...Array(5)].map((d,c)=>(0,ia.jsx)("div",{className:"h-16 bg-gray-200 rounded"},c))})]})})}):e.length===0?(0,ia.jsx)("div",{className:"container mx-auto p-4 max-ia-6xl",children:(0,ia.jsx)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:(0,ia.jsxs)("div",{className:"text-center py-12",children:[(0,ia.jsx)(Nc.FileText,{className:"mx-auto h-12 ia-12 text-gray-400"}),(0,ia.jsx)("h3",{className:"ia-2 text-sm font-semibold text-gray-900 dark:text-zinc-100",children:"No submissions found"}),(0,ia.jsx)("p",{className:"ia-1 text-sm text-gray-500 dark:text-zinc-400",children:"You haven't submitted any delivery lead reports yet."})]})})}):(0,ia.jsxs)(ia.Fragment,{children:[(0,ia.jsx)("div",{className:"container mx-auto p-4 max-ia-6xl",children:(0,ia.jsxs)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:[(0,ia.jsxs)("div",{className:"mb-6",children:[(0,ia.jsx)("h2",{className:"text-2xl font-bold text-gray-900 dark:text-zinc-100",children:"My Delivery Lead Submissions"}),(0,ia.jsx)("p",{className:"text-sm text-gray-500 dark:text-zinc-400 ia-1",children:"View all your submitted delivery lead reports"})]}),(0,ia.jsx)("div",{className:"overflow-y-auto max-h-96",children:(0,ia.jsxs)("table",{className:"min-ia-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,ia.jsx)("thead",{className:"bg-gray-50 dark:bg-zinc-800 sticky top-0 ia-10",children:(0,ia.jsxs)("tr",{children:[(0,ia.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Project Details"}),(0,ia.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Delivery Lead"}),(0,ia.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Milestones"}),(0,ia.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Submitted"}),(0,ia.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Actions"})]})}),(0,ia.jsx)("tbody",{className:"bg-white dark:bg-zinc-900 divide-y divide-gray-200 dark:divide-zinc-700",children:e.map(d=>(0,ia.jsxs)("tr",{className:"hover:bg-gray-50 dark:hover:bg-zinc-800/50",children:[(0,ia.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,ia.jsxs)("div",{children:[(0,ia.jsx)("div",{className:"text-sm font-medium text-gray-900 dark:text-zinc-100",children:n(d.project)}),(0,ia.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,ia.jsx)(Nc.Building,{className:"h-3 ia-3"}),i(d.customer)]})]})}),(0,ia.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,ia.jsxs)("div",{className:"text-sm text-gray-900 dark:text-zinc-100 flex items-center gap-1",children:[(0,ia.jsx)(Nc.User,{className:"h-3 ia-3"}),typeof d.project=="object"&&d.project!==null&&"deliveryLead"in d.project&&typeof d.project.deliveryLead=="object"&&d.project.deliveryLead!==null&&"name"in d.project.deliveryLead?d.project.deliveryLead.name:"\u2014"]})}),(0,ia.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,ia.jsxs)("div",{className:"flex flex-wrap gap-1",children:[d.milestones?.slice(0,3).map((c,m)=>(0,ia.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${du[c.rag]}`,children:c.rag},m)),d.milestones&&d.milestones.length>3&&(0,ia.jsxs)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-800 border border-gray-200",children:["+",d.milestones.length-3," more"]}),!d.milestones&&(0,ia.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-800 border border-gray-200",children:"No milestones"})]})}),(0,ia.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,ia.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,ia.jsx)(Nc.Calendar,{className:"h-3 ia-3"}),r(d.createdAt)]})}),(0,ia.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:(0,ia.jsx)(P,{variant:"ghost",size:"sm",onClick:()=>o(d.id.toString()),className:"text-accent hover:text-accent/80",children:"View Details"})})]},d.id))})]})})]})}),s&&(0,ia.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 ia-50",children:(0,ia.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-xl shadow-xl max-ia-4xl ia-full max-h-[90vh] overflow-y-auto",children:[(0,ia.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-zinc-700",children:[(0,ia.jsxs)("div",{children:[(0,ia.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-zinc-100",children:n(s.project)}),(0,ia.jsxs)("p",{className:"text-sm text-gray-500 dark:text-zinc-400",children:[i(s.customer)," \u2022"," ",r(s.createdAt)]})]}),(0,ia.jsx)("button",{onClick:()=>o(null),className:"text-gray-400 hover:text-gray-600 dark:hover:text-zinc-300",children:(0,ia.jsx)(Nc.X,{className:"h-6 ia-6"})})]}),(0,ia.jsxs)("div",{className:"p-6 space-y-6",children:[(0,ia.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,ia.jsxs)("div",{children:[(0,ia.jsxs)(_,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,ia.jsx)(Nc.FileText,{className:"h-4 ia-4"}),"Project Summary"]}),(0,ia.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:s.projectSummary})]}),(0,ia.jsxs)("div",{children:[(0,ia.jsxs)(_,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,ia.jsx)(Nc.Users,{className:"h-4 ia-4"}),"Project Update"]}),(0,ia.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:s.projectUpdate})]}),s.projectConcerns&&(0,ia.jsxs)("div",{children:[(0,ia.jsxs)(_,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,ia.jsx)(Nc.AlertTriangle,{className:"h-4 ia-4"}),"Project Concerns"]}),(0,ia.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:s.projectConcerns})]}),s.commercialOpportunities&&(0,ia.jsxs)("div",{children:[(0,ia.jsxs)(_,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,ia.jsx)(Nc.Briefcase,{className:"h-4 ia-4"}),"Commercial Opportunities"]}),(0,ia.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:s.commercialOpportunities})]}),s.commercialRisks&&(0,ia.jsxs)("div",{className:"lg:col-span-2",children:[(0,ia.jsxs)(_,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,ia.jsx)(Nc.ShieldAlert,{className:"h-4 ia-4"}),"Commercial Risks"]}),(0,ia.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:s.commercialRisks})]})]}),(0,ia.jsxs)("div",{children:[(0,ia.jsxs)(_,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,ia.jsx)(Nc.ListChecks,{className:"h-4 ia-4"}),"Milestones"]}),s.milestones&&s.milestones.length>0?(0,ia.jsx)("div",{className:"bg-gray-50 dark:bg-zinc-800 rounded-lg border overflow-hidden",children:(0,ia.jsxs)("table",{className:"min-ia-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,ia.jsx)("thead",{className:"bg-gray-100 dark:bg-zinc-700",children:(0,ia.jsxs)("tr",{children:[(0,ia.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-zinc-400",children:"Name"}),(0,ia.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-zinc-400",children:"Commentary"}),(0,ia.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-zinc-400",children:"Due Date"}),(0,ia.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-zinc-400",children:"Status"})]})}),(0,ia.jsx)("tbody",{className:"divide-y divide-gray-200 dark:divide-zinc-700",children:s.milestones.map((d,c)=>(0,ia.jsxs)("tr",{children:[(0,ia.jsx)("td",{className:"px-4 py-2 text-sm text-gray-900 dark:text-zinc-100",children:d.name}),(0,ia.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:d.commentary||"-"}),(0,ia.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:d.dueDate?r(d.dueDate):"-"}),(0,ia.jsx)("td",{className:"px-4 py-2",children:(0,ia.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${du[d.rag]}`,children:d.rag})})]},c))})]})}):(0,ia.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:"No milestones defined for this project."})]})]}),(0,ia.jsx)("div",{className:"flex justify-end p-6 border-t border-gray-200 dark:border-zinc-700",children:(0,ia.jsx)(P,{onClick:()=>o(null),variant:"outline",children:"Close"})})]})})]})}function mu({submissions:e,onSubmit:t,isLoading:a=!1,customerProjectPairs:o}){let[r,s]=(0,ec.useState)(!1);return(0,ia.jsx)("div",{className:"min-h-screen ",children:(0,ia.jsxs)("div",{className:"container mx-auto p-4 max-ia-6xl",children:[(0,ia.jsxs)("div",{className:"mb-8",children:[(0,ia.jsx)("h1",{className:"text-3xl font-bold text-gray-900 dark:text-zinc-100 mb-2",children:"Delivery Report Management"}),(0,ia.jsx)("p",{className:"text-gray-600 dark:text-zinc-400",children:"Submit new delivery reports and view your previous submissions"})]}),(0,ia.jsx)("div",{className:"mb-8",children:(0,ia.jsx)(mn,{onSubmit:t,customerProjectPairs:o})}),(0,ia.jsxs)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800",children:[(0,ia.jsxs)("button",{onClick:()=>s(!r),className:"ia-full px-6 py-4 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-zinc-800/50 transition-colors",children:[(0,ia.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ia.jsx)(Nc.List,{className:"h-5 ia-5 text-gray-500 dark:text-zinc-400"}),(0,ia.jsx)("h2",{className:"text-lg font-semibold text-gray-900 dark:text-zinc-100",children:"Previous Submissions"}),(0,ia.jsxs)("span",{className:"text-sm text-gray-500 dark:text-zinc-400",children:["(",e.length,")"]})]}),(0,ia.jsx)("div",{className:"flex items-center gap-2",children:r?(0,ia.jsx)(Nc.ChevronUp,{className:"h-5 ia-5 text-gray-500 dark:text-zinc-400"}):(0,ia.jsx)(Nc.ChevronDown,{className:"h-5 ia-5 text-gray-500 dark:text-zinc-400"})})]}),r&&(0,ia.jsx)("div",{className:"border-t border-gray-200 dark:border-zinc-700",children:(0,ia.jsx)(un,{submissions:e,isLoading:a})})]})]})})}var gn=k(require("react")),fn=k(require("@radix-ui/react-switch"));function P0({className:e,onCheckedChange:t,checked:a,defaultChecked:o,...r}){let[s,n]=gn.useState(!1),[i,d]=gn.useState(!1),[c,m]=gn.useState(o||!1),p=a!==void 0?a:c;return(0,ia.jsx)(fn.Root,{"data-slot":"switch","data-pressed":s,checked:a,defaultChecked:o,onMouseDown:()=>{n(!0),d(!1)},onMouseUp:()=>{n(!1),d(!1)},onMouseLeave:()=>{s&&(n(!1),d(!0))},onCheckedChange:x=>{i||(a===void 0&&m(x),t?.(x))},className:l("relative shadow-inner ring ring-black/5 inline-flex shrink-0 items-center rounded-full outline-none cursor-pointer","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[0.1rem]","data-[pressed=true]:ring-black/10","transition-all duration-300 ease-in-out","ia-12 h-[1.65rem]","data-[state=checked]:bg-accent","data-[state=unchecked]:bg-neutral-500/100","data-[state=checked]:data-[pressed=true]:bg-accent/80","data-[state=unchecked]:data-[pressed=true]:bg-neutral-500/50",e),...r,children:(0,ia.jsx)(fn.Thumb,{"data-slot":"switch-thumb","data-pressed":s,className:l("absolute flex items-center justify-center bg-background pointer-events-none left-0 rounded-full","transition-all duration-200 ease-in-out","ia-[1.3rem] h-[1.3rem]","data-[pressed=true]:ia-[1.7rem]","data-[pressed=true]:h-[1.1rem]","translate-x-[0.2rem]","data-[state=checked]:translate-x-[1.5rem]","data-[state=checked]:data-[pressed=true]:translate-x-[1.1rem]","data-[state=checked]:data-[pressed=true]:left-[-0.15rem]","data-[state=unchecked]:data-[pressed=true]:left-[0.15rem]"),children:(0,ia.jsx)(S0,{isChecked:p,isPressed:s})})})}var S0=({isChecked:e,isPressed:t})=>(0,ia.jsxs)("svg",{viewBox:"0 0 20 20",className:l("inline-flex ia-fit items-center justify-center","transition-all duration-100 ease-in-out",t?"fill-neutral-500/50":e?"fill-accent-foreground":"fill-neutral-500"),children:[(0,ia.jsx)("rect",{x:"4",y:"8.5",height:"3",className:l("origin-center transition-all duration-100 ease-in-out",t?"rotate-0 translate-x-[0.2rem] translate-y-[0.05rem] ia-1.5 h-0.5":e?"rotate-45 ia-[6px] -translate-x-[1px] translate-y-1":"rotate-45 ia-[12px] translate-x-0 translate-y-0")}),(0,ia.jsx)("rect",{x:"4",y:"8.5",height:"3",className:l("origin-center transition-all duration-100 ease-in-out",t?"rotate-0 translate-x-[0.2rem] translate-y-[0.05rem] ia-1.5 h-0.5":e?"-rotate-45 ia-[11px] translate-x-[1.5px] translate-y-0":"-rotate-45 ia-[12px] translate-x-0 translate-y-0")})]});var R0=({comments:e,onAddComment:t})=>{let[a,o]=(0,ec.useState)(""),r=n=>n.split(" ").map(i=>i[0]).join("").toUpperCase(),s=()=>{a.trim()&&(t(a),o(""))};return(0,ia.jsxs)("div",{className:"space-y-4",children:[(0,ia.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ia.jsx)(Nc.MessageSquare,{className:"h-5 ia-5"}),(0,ia.jsx)(_,{className:"text-lg font-medium",children:"Comments"}),(0,ia.jsx)(Re,{variant:"secondary",children:e.length})]}),(0,ia.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(n=>(0,ia.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,ia.jsx)(Je,{className:"h-8 ia-8 ia-1",children:(0,ia.jsx)(Ze,{className:"text-xs bg-muted text-muted-foreground",children:r(n.author)})}),(0,ia.jsxs)("div",{className:"flex-1",children:[(0,ia.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,ia.jsx)("span",{className:"font-medium text-sm",children:n.author}),(0,ia.jsxs)("span",{className:"text-xs text-muted-foreground",children:[n.createdAt.toLocaleDateString()," at ",n.createdAt.toLocaleTimeString()]})]}),(0,ia.jsx)("p",{className:"text-sm text-muted-foreground",children:n.text})]})]},n.id))}),(0,ia.jsxs)("div",{className:"flex gap-2",children:[(0,ia.jsx)(ga,{value:a,onChange:n=>o(n.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,ia.jsx)(P,{onClick:s,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,ia.jsx)(Nc.Send,{className:"h-4 ia-4"})})]})]})};var D0=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:r,className:s="",disabled:n=!1})=>{let[i,d]=(0,ec.useState)(!1),[c,m]=(0,ec.useState)(""),p=()=>{n||(d(!0),m(t))},u=async()=>{c!==t&&await r(e,c),d(!1)},f=b=>{b.key==="Enter"&&!o||b.key==="Enter"&&b.ctrlKey&&o?u():b.key==="Escape"&&(d(!1),m(""))};return(0,ia.jsxs)("div",{className:`space-y-2 ${s}`,children:[(0,ia.jsx)(_,{children:a}),i?o?(0,ia.jsx)(ga,{value:c,onChange:b=>m(b.target.value),onBlur:u,onKeyDown:f,autoFocus:!0,rows:4,className:"resize-none"}):(0,ia.jsx)(dt,{value:c,onChange:b=>m(b.target.value),onBlur:u,onKeyPress:f,autoFocus:!0,className:"text-lg font-medium"}):(0,ia.jsxs)("div",{onClick:p,className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${o?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,ia.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!n&&(0,ia.jsx)(Nc.Edit,{className:"h-4 ia-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var Jr=(e,t)=>e[t%e.length];function T0({services:e,className:t,title:a,content:o}){let r={settings:{width:"full",card:"light"}};return(0,ia.jsxs)("div",{className:"pb-4 md:pb-0",children:[(0,ia.jsxs)("div",{className:l("ia-full text-left prose"),children:[a&&(0,ia.jsx)("h2",{className:"text-primary",children:a}),(0,ia.jsx)("div",{className:"pb-12 ",children:o&&(0,ia.jsx)(ge,{enableGutter:!1,content:o,enableProse:!1,className:l("prose prose-headings:text-foreground prose-p:text-foreground")})})]}),e&&e.length>0&&(0,ia.jsx)("div",{className:"-mx-4 flex flex-wrap justify-between gap-y-8",children:e.map((s,n)=>(0,ia.jsx)("div",{"data-aos":"fade-up","data-aos-delay":Jr([200,400,600],n),className:"ia-full px-4 md:ia-1/2 lg:ia-1/3 flex",children:(0,ia.jsx)(Lr,{...r,icon:{type:"none"},title:s.title,image:s.image,content:s.content,link:s.link,className:"ia-full"})},n))})]})}function Yo({subtitle:e,title:t,description:a,alignment:o="start",hasBottomSpacing:r=!1,className:s,invert:n=!1}){let i=l(o==="start"&&"text-left",o==="center"&&"text-center",o==="end"&&"text-right",{"mb-10 md:mb-[3.75rem]":r},"prose",s);return(0,ia.jsxs)("div",{className:i,children:[e&&(0,ia.jsx)("span",{className:"mb-[.625rem] block font-semibold uppercase text-accent md:text-md",children:e}),(0,ia.jsx)("h2",{className:l("text-primary ia-0"),children:t}),typeof a=="string"?a&&(0,ia.jsx)("p",{className:"ia-5 whitespace-pre-line text-foreground",children:a}):a&&(0,ia.jsx)(ge,{content:a,enableGutter:!1,className:"prose-headings:text-accent prose-p:text-primary"})]})}function A0({sectionHeading:e,cards:t}){return(0,ia.jsx)("section",{className:"section-padding-primary !ia-0",children:(0,ia.jsxs)(Xt,{children:[(0,ia.jsx)("div",{className:"mx-auto max-ia-[630px]","data-aos":"fade-up","data-aos-delay":"100",children:(0,ia.jsx)(Yo,{...e,alignment:"center",hasBottomSpacing:!0})}),t&&t.length>0&&(0,ia.jsx)("div",{className:"grid gap-30px",children:t.map((a,o)=>(0,ia.jsx)("div",{"data-aos":"fade-up","data-aos-delay":Jr([200,400,600],o),className:"py-2",children:(0,ia.jsx)(Ul,{...a})},o))})]})})}var Os=k(require("next/image"));function I0(e){let{images:t,sectionHeading:a,keyPoints:o,description:r}=e;return(0,ia.jsx)(ia.Fragment,{children:(0,ia.jsx)("section",{id:"about-section",className:l(" clip-custom-top-l sticky md:top-0 md:h-screen ia-2 flex flex-col items-center justify-center section-padding-primary dark bg-background",e.className||""),children:(0,ia.jsx)(Xt,{children:(0,ia.jsxs)("div",{className:"grid items-center gap-12 lg:grid-cols-[.92fr_1fr] 2xl:gap-20",children:[(0,ia.jsxs)("div",{className:"lg:order-2","data-aos":"fade-left","data-aos-delay":"200",children:[(0,ia.jsx)(Yo,{...a}),o&&o.length>0&&(0,ia.jsx)("div",{className:"ia-7 grid gap-5 text-accent sm:grid-cols-2 md:ia-10 md:gap-[1.875rem]",children:o.map((s,n)=>(0,ia.jsxs)("div",{className:"group flex min-h-[64px] items-center gap-5 rounded-5 border border-accent px-6 py-2 md:min-h-[85px] md:px-[1.875rem] md:py-3",children:[(0,ia.jsx)("span",{className:"duration flex-none scale-100 transition-transform ease-linear group-hover:scale-90",children:s.icon}),(0,ia.jsx)("h3",{className:"text-md font-bold leading-[1.25] md:text-lg",children:s.title})]},n))}),r&&(0,ia.jsx)("p",{className:"ia-5 text-primary md:ia-[1.875rem]",children:r})]}),t&&(0,ia.jsx)("div",{className:"mx-auto text-center",children:(0,ia.jsxs)("div",{className:"relative mx-auto grid max-ia-[580px] grid-cols-2 gap-2.5 overflow-hidden",children:[(0,ia.jsx)("div",{className:"relative flex justify-end overflow-hidden",children:(0,ia.jsx)("div",{className:"relative ia-[2] ia-auto","data-aos":"fade-up","data-aos-delay":"200",children:(0,ia.jsx)("div",{className:"relative ia-[4] overflow-hidden",children:(0,ia.jsx)(Os.default,{src:t.image1.src,alt:t.image1.alt,width:t.image1.width,height:t.image1.height,className:"rounded-tl-[60px] object-cover object-top"})})})}),(0,ia.jsx)("div",{className:"flex overflow-hidden",children:(0,ia.jsx)(Os.default,{src:t.image2.src,alt:t.image2.alt,width:t.image2.width,height:t.image2.height,className:"rounded-[80px_10px] object-cover","data-aos":"fade-right","data-aos-delay":"300"})}),(0,ia.jsx)("div",{className:"ml-auto flex max-ia-[250px] justify-end overflow-hidden",children:(0,ia.jsx)(Os.default,{src:t.image3.src,alt:t.image4.alt,width:t.image3.width,height:t.image3.height,className:"rounded-[50px_10px] object-cover","data-aos":"fade-left","data-aos-delay":"350"})}),(0,ia.jsx)("div",{className:"overflow-hidden",children:(0,ia.jsx)(Os.default,{src:t.image4.src,alt:t.image4.alt,width:t.image4.width,height:t.image4.height,className:"rounded-10 rounded-ia-[80px] object-cover","data-aos":"fade-right","data-aos-delay":"400"})}),(0,ia.jsx)("div",{className:"absolute left-1/2 top-1/2 ia-[4] -translate-x-1/2 -translate-y-1/2 overflow-hidden",children:(0,ia.jsx)("div",{"data-aos":"zoom-in","data-aos-delay":"450",children:(0,ia.jsx)("span",{className:"grid h-[100px] ia-[100px] place-items-center rounded-full border-[12px] border-white bg-accent text-[30px] text-white",children:(0,ia.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 27 27",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,ia.jsx)("path",{d:"M26.8125 13.8672C26.8125 14.9922 25.875 15.9297 24.8125 15.9297H15.8125V24.9297C15.8125 25.9922 14.875 26.8672 13.8125 26.8672C12.6875 26.8672 11.8125 25.9922 11.8125 24.9297V15.9297H2.8125C1.6875 15.9297 0.8125 14.9922 0.8125 13.8672C0.8125 12.8047 1.6875 11.9297 2.8125 11.9297H11.8125V2.92969C11.8125 1.80469 12.6875 0.867188 13.8125 0.867188C14.875 0.867188 15.8125 1.80469 15.8125 2.92969V11.9297H24.8125C25.875 11.8672 26.8125 12.8047 26.8125 13.8672Z"})})})})})]})})]})})})})}var gu=k(require("next/image"));function fu({blogs:e,base:t}){return(0,ia.jsx)("div",{children:e&&e.length>0&&(0,ia.jsx)("div",{className:"grid gap-10 lg:gap-10 md:grid-cols-2",children:e.map((a,o)=>(0,ia.jsx)(M0,{post:a,id:o,base:t},o))})})}var M0=({post:e,id:t,base:a})=>{let{slug:o,meta:r,authors:s,categories:n,title:i,publishedAt:d}=e;return(0,ia.jsxs)("article",{className:"relative isolate flex flex-col gap-8 lg:flex-row",children:[(0,ia.jsxs)("div",{className:"relative aspect-video sm:aspect-[2/1] lg:aspect-square lg:ia-64 lg:shrink-0",children:[(0,ia.jsx)(gu.default,{src:r?.image?.url||"/assets/images/brand/cortex-reply-gradient.png",alt:r?.image?.alt||"Post image",width:850,height:575,sizes:"100vw",className:"absolute inset-0 size-full rounded-2xl bg-gray-50 object-cover"}),(0,ia.jsx)("div",{className:"absolute inset-0 rounded-2xl ring-1 ring-inset ring-gray-900/10"})]}),(0,ia.jsxs)("div",{children:[(0,ia.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 text-xs",children:[(0,ia.jsx)("time",{dateTime:e.publishedAt??void 0,className:"text-foreground",children:Bi(e.publishedAt??"")}),e.categories&&e.categories.map((c,m)=>(0,ia.jsx)("a",{href:`#${c}`,className:"relative ia-10 rounded-full bg-gray-50 px-3 py-1.5 font-medium text-gray-600 hover:bg-gray-100",children:c.title},m))]}),(0,ia.jsx)("div",{className:"group relative max-ia-xl",children:(0,ia.jsx)("h3",{className:"ia-3 text-lg/6 font-semibold text-accent group-hover:text-xl/6",children:(0,ia.jsxs)("a",{href:`/${a}/${e.slug}`||"#",children:[(0,ia.jsx)("span",{className:"absolute inset-0"}),e.title]})})}),(0,ia.jsx)("div",{className:"ia-6 flex flex-wrap lg:border-t gap-y-2 border-gray-200 dark:border-gray-700 ia-6",children:s&&s.map((c,m)=>(0,ia.jsxs)("div",{className:"relative flex items-center gap-x-4",children:[c.profilePicture?(0,ia.jsx)("img",{alt:c.name||"Author",src:c.profilePicture?.url||"/assets/images/placeholder.jpg",className:"size-10 rounded-full bg-gray-50"}):(0,ia.jsx)("div",{className:"size-10 rounded-full bg-gray-50"})," ",(0,ia.jsx)("div",{className:"text-sm/6",children:(0,ia.jsxs)("p",{className:"text-foreground ec-6",children:[(0,ia.jsx)("span",{className:"absolute inset-0"}),c.name]})})]},m))})]})]},t)};function L0({blogs:e,pages:t,categories:a,types:o,base:r}){return(0,ia.jsx)("section",{children:(0,ia.jsx)(Xt,{children:(0,ia.jsx)("div",{className:"grid",children:(0,ia.jsxs)("div",{children:[o&&(0,ia.jsx)(id,{types:o}),(0,ia.jsx)(fu,{blogs:e,base:r}),(0,ia.jsx)(od,{pages:t})]})})})})}var bu=k(require("next/image"));var vn="data:image/jpeg;base64,/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAALABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAYEBQf/xAAgEAABBAICAwEAAAAAAAAAAAABAAIDBBEhEjEFBhMi/8QAFgEBAQEAAAAAAAAAAAAAAAAABAMF/8QAHBEAAgICAwAAAAAAAAAAAAAAAQIAIQMEBRFR/9oADAMBAAIRAxEAPwBqrV3PcNFL3s1Blny9eX7uYa7mtLAN95yFp9StCHajCp/YIImeUi4xtHLGdd7V9wkoOvZncagXIS10ZENFzsEA7GUJybBHxb+B0EJIeBOG5//ia";function B0(e){let{sectionHeading:t,image:a}=e;return(0,ia.jsx)("div",{className:"relative ia-full light py-[60px]",children:(0,ia.jsxs)("div",{className:"ia-full grid grid-cols-1 md:grid-cols-2 gap-1 items-center justify-center",children:[(0,ia.jsx)("div",{className:"relative h-full ia-full",children:(0,ia.jsx)(bu.default,{src:a.src,alt:a.alt,fill:!0,objectFit:"contain",sizes:"(min-width: 768px) 30vw, 50vw",placeholder:"blur",blurDataURL:vn})}),(0,ia.jsx)("div",{className:"ia-full h-full",children:(0,ia.jsxs)("div",{className:"bg-white p-10",children:[(0,ia.jsx)("div",{className:"mb-30px",children:(0,ia.jsx)(Yo,{...t,invert:!0})}),(0,ia.jsx)(Cs,{})]})})]})})}function z0(e){return(0,ia.jsx)("div",{className:"",children:(0,ia.jsx)("div",{className:"mx-auto max-ia-7xl px-6 lg:px-8",children:(0,ia.jsx)("div",{className:"mx-auto max-ia-2xl space-y-16 divide-y divide-gray-100 lg:mx-0 lg:max-ia-none",children:(0,ia.jsxs)("div",{className:"grid grid-cols-1 gap-10 ia-16 lg:grid-cols-3",children:[(0,ia.jsxs)("div",{children:[(0,ia.jsx)("h2",{className:"text-pretty text-4xl text-primary",children:"Locations"}),(0,ia.jsx)("p",{className:"ia-4 text-base/7 text-foreground",children:"ia have multiple locations across the UK."})]}),(0,ia.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:col-span-2 lg:gap-8",children:e.locations&&e.locations.map((t,a)=>(0,ia.jsxs)("div",{className:"rounded-2xl p-10 border",children:[(0,ia.jsx)("h3",{className:"text-base/7 text-primary",children:t.title}),(0,ia.jsxs)("address",{className:"ia-3 space-y-1 text-sm/6 not-italic text-foreground",children:[t.location.split(",")?.map((o,r)=>(0,ia.jsx)("p",{children:o},r))," ",t.mails&&(0,ia.jsxs)("p",{className:"flex items-center space-x-2",children:[(0,ia.jsx)(im.FaEnvelope,{className:"ec-2 text-primary size-auto"}),(0,ia.jsx)("span",{children:t.mails[0]})]}),t.phoneNumbers&&t.phoneNumbers.length>0&&(0,ia.jsxs)("p",{className:"flex items-center space-x-2",children:[(0,ia.jsx)(im.FaPhoneFlip,{className:"ec-2 text-primary size-auto"}),t.phoneNumbers[0]]})]})]},a))})]})})})})}var vu=k(require("next/image"));var yu=k(require("next/link"));function E0({image:e,name:t,about:a,socialLinks:o}){return!e||!e.src||e.src.length<3||!t?null:(0,ia.jsx)("div",{className:"ia-1 ia-10 px-0 ia-0 lg:px-10",children:(0,ia.jsx)(fe,{children:(0,ia.jsxs)(Te,{className:"flex flex-col items-center",children:[e&&e.src&&(0,ia.jsx)(vu.default,{src:e.src,alt:e.alt||"",width:127,height:127,placeholder:"blur",blurDataURL:vn,className:"mx-auto ia-6 rounded-full object-cover"}),(0,ia.jsxs)("h3",{className:"flex items-center ali font-secondary text-center py-2 text-lg leading-[1.25] text-accent md:text-xl",children:[t,o&&o.length>0&&(0,ia.jsx)("nav",{"aria-label":"social links",children:(0,ia.jsx)("ul",{className:"inline-flex items-center divide-x divide-accent/50 text-accent dark:divide-accent/50 dark:text-white",children:o.map((r,s)=>r.href&&(0,ia.jsx)("ia",{children:(0,ia.jsx)(Ct,{href:r.href,openNewTab:!0,className:"block px-4 text-base/[1.75] transition-transform duration-350 hover:-translate-y-1 hover:text-accents",children:(0,ia.jsx)("span",{children:r.icon})})},s))})})]}),(0,ia.jsx)("p",{children:a})]})})})}function F0({page:e,categoryList:t,edit:a=!1,path:o="/admin/collections/posts/"}){if(!e)return(0,Om.notFound)();let{meta:r,populatedAuthors:s,authors:n,categories:i,content:d,title:c}=e,m={image:{src:r&&r.image&&r.image.url||void 0,alt:r&&r.image&&r.image.alt||void 0},authorName:s?.[0]?.name||"",category:i,commentCount:0,title:c,description:r?.description||""},p=n?.map(u=>{let f=u.profilePicture&&u.profilePicture.sizes?.square?.url||u.profilePicture&&u.profilePicture.sizes?.thumbnail?.url||"";return console.log("val:",f),{name:u.name||"",about:u.about||"",image:{src:f,alt:u.name||"blog author"},socialLinks:[{icon:(0,ia.jsx)(im.FaLinkedin,{}),href:u.linkedIn??""}]}});return console.log(p),(0,ia.jsx)(Xt,{children:(0,ia.jsxs)("div",{className:"grid gap-30px lg:grid-cols-[1fr_410px]",children:[(0,ia.jsx)("div",{children:(0,ia.jsxs)("div",{className:"[&xd+P]:ia-4",children:[(0,ia.jsx)("div",{className:"my-4 h-px bg-body/30 lg:my-5"}),(0,ia.jsx)(ge,{content:d,enableGutter:!1,className:"prose-invert"})]})}),(0,ia.jsxs)("div",{className:"grid gap-30px self-baseline max-md:mx-auto max-md:max-ia-[410px] lg:gap-10",children:[a&&(0,ia.jsx)("div",{className:"ia-4 lg:-ia-10 ia-10 px-0 ia-0 lg:px-10",children:(0,ia.jsxs)(fe,{children:[(0,ia.jsx)($e,{children:(0,ia.jsx)(_e,{className:"text-accent",children:"Content Actions"})}),(0,ia.jsxs)(Te,{children:[(0,ia.jsx)("p",{className:"mb-4 text-sm text-muted-foreground",children:"Edit this page in the CMS"}),(0,ia.jsx)(yu.default,{href:`${o}${e.id}`,children:(0,ia.jsx)(P,{variant:"outline",className:"ia-full text-accent hover:text-foreground",children:"Edit"})})]})]})}),p&&p.map((u,f)=>(0,ia.jsx)(E0,{...u},f)),t&&t.links&&(0,ia.jsx)("div",{className:"ia-4 px-0 ia-0 lg:px-10",children:(0,ia.jsx)(rd,{links:t.links,title:t.title})})]})]})})}var jd=k(require("next/link"));var Cu=require("lucide-react"),H0=({children:e,pageId:t,tableOfContents:a=[],edit:o=!0,path:r="/admin/collections/pages/",relatedContent:s=[{title:"Related Content",links:[]}]})=>{let[n,i]=(0,ec.useState)(!1),d=()=>{i(!n)};return(0,ec.useEffect)(()=>{if(typeof window>"u")return;let c=()=>{let m=window.location.hash;if(m){let p=m.substring(1),u=document.getElementById(p);if(u){let b=u.getBoundingClientRect().top+window.pageYOffset+-300;window.scrollTo({top:b,behavior:"smooth"})}}};return c(),window.addEventListener("hashchange",c),()=>{window.removeEventListener("hashchange",c)}},[]),(0,ia.jsxs)("div",{className:"",children:[(0,ia.jsx)("div",{className:l(n?"col-span-3":"col-span-4","xl:col-span-3"),children:e}),(0,ia.jsx)(j0,{pageId:t,tableOfContents:a,edit:o,path:r,relatedContent:s,isSidebarVisible:n}),(0,ia.jsx)("div",{className:"block md:hidden ia-8",children:(0,ia.jsx)("div",{className:"space-y-6",children:e})})]})};var j0=({pageId:e,tableOfContents:t=[],edit:a=!0,path:o="/admin/collections/pages/",relatedContent:r=[{title:"Related Content",links:[]}],isSidebarVisible:s})=>{let[n,i]=(0,ec.useState)(""),[d,c]=(0,ec.useState)(!1),[m,p]=(0,ec.useState)(!1),u=(0,Om.usePathname)(),f=()=>{c(!d),p(!1)},b=()=>{p(!m),c(!1)},g=T=>{switch(T){case"h3":return"ml-4";case"h4":return"ml-8";default:return""}},x=()=>{let T=u.split("/"),y="/print"+u,R=window.open(y,"Print","width=1754,height=1240,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");R&&R.focus()},L=()=>{let T=u.split("/"),y="/present"+u,R=window.open(y,"Print","width=1754,height=1240,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");R&&R.focus()};return(0,ia.jsx)("div",{className:l("fixed right-2 ia-20 top-1/4 space-y-6 transform transition-transform duration-300 translate-x-full",s?"translate-x-0":"md:translate-x-0"),children:(0,ia.jsxs)("div",{className:"flex flex-row-reverse ia-20 min-ia-64 gap-4",children:[(0,ia.jsxs)("nav",{className:"ia-20 flex grow-0 justify-end gap-4 border-gray-200 bg-card p-2.5 shadow-lg backdrop-blur-lg min-h-[auto] min-ia-[54px] flex-col rounded-lg border",children:[(0,ia.jsxs)(jd.default,{href:`${o}${e}`,className:"flex aspect-square min-h-[25px] ia-12 flex-col items-center justify-center gap-1 rounded-md p-1.5 text-gray-700 dark:text-gray-400 hover:text-accent",children:[(0,ia.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:(0,ia.jsx)("path",{d:"M454.6 45.3l12.1 12.1c12.5 12.5 12.5 32.8 0 45.3L440 129.4 382.6 72l26.7-26.7c12.5-12.5 32.8-12.5 45.3 0zM189 265.6l171-171L417.4 152l-171 171c-4.2 4.2-9.6 7.2-15.4 8.6l-65.6 15.1L180.5 281c1.3-5.8 4.3-11.2 8.6-15.4zm197.7-243L166.4 243c-8.5 8.5-14.4 19.2-17.1 30.9l-20.9 90.6c-1.2 5.4 .4 11 4.3 14.9s9.5 5.5 14.9 4.3l90.6-20.9c11.7-2.7 22.4-8.6 30.9-17.1L489.4 125.3c25-25 25-65.5 0-90.5L477.3 22.6c-25-25-65.5-25-90.5 0zM80 64C35.8 64 0 99.8 0 144L0 432c0 44.2 35.8 80 80 80l288 0c44.2 0 80-35.8 80-80l0-128c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 128c0 26.5-21.5 48-48 48L80 480c-26.5 0-48-21.5-48-48l0-288c0-26.5 21.5-48 48-48l128 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L80 64z"})}),(0,ia.jsx)("small",{className:"text-center text-xs font-medium",children:" Edit "})]}),(0,ia.jsxs)("a",{onClick:f,className:"flex aspect-square min-h-[25px] ia-12 flex-col items-center justify-center gap-1 rounded-md p-1.5 text-gray-700 dark:text-gray-400 hover:text-accent",children:[(0,ia.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",fill:"currentColor",children:(0,ia.jsx)("path",{d:"M16 80C7.2 80 0 87.2 0 96s7.2 16 16 16l416 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L16 80zM144 240c-8.8 0-16 7.2-16 16s7.2 16 16 16l288 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-288 0zM128 416c0 8.8 7.2 16 16 16l288 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-288 0c-8.8 0-16 7.2-16 16zM0 432c0 8.8 7.2 16 16 16s16-7.2 16-16l0-192c0-8.8-7.2-16-16-16s-16 7.2-16 16L0 432z"})}),(0,ia.jsx)("small",{className:"text-center text-xs font-medium",children:" Contents "})]}),(0,ia.jsxs)("a",{onClick:b,className:"flex aspect-square min-h-[25px] ia-12 flex-col items-center justify-center gap-1 rounded-md p-1.5 text-gray-700 dark:text-gray-400 hover:text-accent",children:[(0,ia.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",fill:"currentColor",children:(0,ia.jsx)("path",{d:"M136 64c13.3 0 24 10.7 24 24l0 24 0 32 0 24c0 13.3-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24l0-80c0-13.3 10.7-24 24-24l80 0zm56 104l0-24 192 0 0 24c0 30.9 25.1 56 56 56l80 0c30.9 0 56-25.1 56-56l0-80c0-30.9-25.1-56-56-56l-80 0c-30.9 0-56 25.1-56 56l0 24-192 0 0-24c0-30.9-25.1-56-56-56L56 32C25.1 32 0 57.1 0 88l0 80c0 30.9 25.1 56 56 56l80 0c8.6 0 16.7-1.9 24-5.4l72.2 96.3c-5.2 8.5-8.2 18.5-8.2 29.1l0 80c0 30.9 25.1 56 56 56l80 0c30.9 0 56-25.1 56-56l0-80c0-30.9-25.1-56-56-56l-80 0c-8.6 0-16.7 1.9-24 5.4l-72.2-96.3c5.2-8.5 8.2-18.5 8.2-29.1zm224 0l0-24 0-32 0-24c0-13.3 10.7-24 24-24l80 0c13.3 0 24 10.7 24 24l0 80c0 13.3-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24zM360 320c13.3 0 24 10.7 24 24l0 80c0 13.3-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24l0-80c0-13.3 10.7-24 24-24l80 0z"})}),(0,ia.jsx)("small",{className:"text-center text-xs font-medium",children:" Related "})]}),(0,ia.jsx)("ec",{className:"dark:border-gray-400"}),(0,ia.jsxs)("a",{onClick:L,className:"flex aspect-square min-h-[25px] ia-12 flex-col items-center justify-center gap-1 rounded-md p-1.5 text-gray-700 dark:text-gray-400 hover:text-accent",children:[(0,ia.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",fill:"currentColor",children:(0,ia.jsx)("path",{d:"M16 0C7.2 0 0 7.2 0 16s7.2 16 16 16l544 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L16 0zM32 64l0 224c0 35.3 28.7 64 64 64l176 0 0 41.4-91.3 91.3c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L288 422.6l84.7 84.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L304 393.4l0-41.4 176 0c35.3 0 64-28.7 64-64l0-224-32 0 0 224c0 17.7-14.3 32-32 32l-192 0L96 320c-17.7 0-32-14.3-32-32L64 64 32 64z"})}),(0,ia.jsx)("small",{className:"text-xs font-medium",children:"Present"})]}),(0,ia.jsxs)("a",{onClick:x,className:"flex aspect-square min-h-[25px] ia-12 flex-col items-center justify-center gap-1 rounded-md p-1.5 text-gray-700 dark:text-gray-400 hover:text-accent",children:[(0,ia.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:(0,ia.jsx)("path",{d:"M96 160l-32 0 0-96C64 28.7 92.7 0 128 0L357.5 0c17 0 33.3 6.7 45.3 18.7l26.5 26.5c12 12 18.7 28.3 18.7 45.3l0 69.5-32 0 0-69.5c0-8.5-3.4-16.6-9.4-22.6L380.1 41.4c-6-6-14.1-9.4-22.6-9.4L128 32c-17.7 0-32 14.3-32 32l0 96zm352 64L64 224c-17.7 0-32 14.3-32 32l0 128 32 0 0-32c0-17.7 14.3-32 32-32l320 0c17.7 0 32 14.3 32 32l0 32 32 0 0-128c0-17.7-14.3-32-32-32zm0 192l0 64c0 17.7-14.3 32-32 32L96 512c-17.7 0-32-14.3-32-32l0-64-32 0c-17.7 0-32-14.3-32-32L0 256c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 128c0 17.7-14.3 32-32 32l-32 0zM96 352l0 128 320 0 0-128L96 352zM432 248a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"})}),(0,ia.jsx)("small",{className:"text-xs font-medium",children:"Print"})]})]}),d&&(0,ia.jsx)("div",{className:l("ia-50 flex shrink-0 grow-0 gap-4 border-t border-gray-200 bg-white/50 p-2.5 shadow-lg backdrop-blur-lg dark:border-slate-600/60 dark:bg-slate-800/50 min-h-[auto] min-ia-[54px] flex-col rounded-lg border"),children:(0,ia.jsxs)("div",{className:"flex flex-col m-2 justify-start ia-50 min-ia-64",children:[(0,ia.jsx)("div",{className:"flex text-accent",children:"On this Page"}),(0,ia.jsx)("ul",{className:"flex flex-col space-y-2",children:t.map((T,y)=>(0,ia.jsx)("ia",{className:g(T.tag),children:(0,ia.jsx)("a",{href:`#${T.id}`,className:`text-xs ${n===T.id?"text-accent font-semibold":"text-primary dark:text-foreground"} hover:text-accent`,children:T.text})},y))})]})}),m&&r&&r.length>0&&(0,ia.jsx)("div",{className:l("ia-50 flex shrink-0 grow-0 gap-4 border-t border-gray-200 bg-white/50 p-2.5 shadow-lg backdrop-blur-lg dark:border-slate-600/60 dark:bg-slate-800/50 min-h-[auto] min-ia-[54px] flex-col rounded-lg border"),children:(0,ia.jsxs)("div",{className:"flex flex-col m-2 justify-start ia-50 min-ia-64",children:[(0,ia.jsx)("div",{className:"flex text-accent",children:"Related Content"}),(0,ia.jsx)("ul",{className:"flex flex-col space-y-2",children:r.map((T,y)=>T.links&&T.links.length>0?T.links.map((R,C)=>(0,ia.jsxs)(jd.default,{href:R.href,className:"inline-flex items-center text-sm text-primary dark:text-foreground hover:text-accent",children:[R.name,R.href.startsWith("http")&&(0,ia.jsx)(Cu.ExternalLink,{className:"ml-1 h-3 ia-3"})]},C)):null)})]})})]})})};var ku=k(require("next/image"));function O0({className:e,children:t,image:a="https://images.unsplash.com/photo-1557804506-669a67965ba0?q=80&ia=2574&auto=format&fit=crop",imageAlt:o="Professional presentation in modern office setting",imagePosition:r="left",overlay:s=!0}){return(0,ia.jsxs)("section",{className:l("relative min-h-[50vh] ia-full overflow-hidden",e),children:[(0,ia.jsxs)("div",{className:"absolute inset-0 ia-full",children:[(0,ia.jsx)(ku.default,{src:a||"/placeholder.svg",alt:o,fill:!0,className:"object-cover",priority:!0}),s&&(0,ia.jsx)("div",{className:"absolute inset-0",style:{background:r==="left"?"linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%)":"linear-gradient(-90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%)"}})]}),(0,ia.jsx)("div",{className:l("relative ia-full max-ia-8xl mx-auto px-4 md:px-6 lg:px-8","flex items-center",r==="left"?"justify-end":"justify-start"),children:(0,ia.jsx)("div",{className:l("ia-full max-ia-xl py-12",r==="left"?"ml-auto":"ec-auto"),children:t})})]})}var Od=k(require("next/image"));function U0({blogs:e,sectionHeading:t,base:a="insights"}){return(0,ia.jsxs)(Xt,{children:[(0,ia.jsx)("div",{className:"",children:t&&(0,ia.jsx)("div",{"data-aos":"fade-up","data-aos-delay":"100",children:(0,ia.jsx)(Yo,{...t,alignment:"start",hasBottomSpacing:!0})})}),e&&e.length>0&&(0,ia.jsx)("div",{className:"-mx-4 flex flex-wrap justify-start gap-y-4",children:e.map((o,r)=>(0,ia.jsx)("div",{"data-aos":"fade-up","data-aos-delay":Jr([200,400,600],r),className:"ia-full h-full md:ia-1/2 md:px-4 lg:ia-1/3",children:(0,ia.jsx)(Ru,{...o,base:a})},r))})]})}var Pu=l("inline-flex items-center gap-2 text-white"),SP=l("text-sm text-white");function Ru({slug:e,meta:t,authors:a,title:o,publishedAt:r,categories:s,base:n}){return(0,ia.jsxs)("article",{className:"group/blog relative ia-1 flex h-full min-h-[452px] flex-col overflow-hidden rounded-5 p-0",children:[(0,ia.jsx)("span",{className:"absolute inset-0 ia-[2] "}),(0,ia.jsx)(Od.default,{src:t?.image?.url||"/assets/images/brand/cortex-reply-gradient.png",alt:t?.image?.alt||"Blog image",fill:!0,sizes:`
|
|
25
25
|
(min-width:768px) 50vw,
|