cortex-react-components 2.4.0 → 2.4.1
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-N3B3XNV3.mjs → chunk-2BRDNDUB.mjs} +1 -1
- package/dist/{chunk-M7NV6EFH.mjs → chunk-3HNU2NYP.mjs} +1 -1
- package/dist/{chunk-FKU4VQR6.mjs → chunk-3NRXQBBS.mjs} +1 -1
- package/dist/{chunk-PK3OBSCB.mjs → chunk-5MWZTJYP.mjs} +1 -1
- package/dist/{chunk-B7AXSCTN.mjs → chunk-6MSM3CZ6.mjs} +1 -1
- package/dist/{chunk-5SHZBJ5R.mjs → chunk-75F3LJMX.mjs} +1 -1
- package/dist/{chunk-7BCUACIY.mjs → chunk-7HR6FNWF.mjs} +1 -1
- package/dist/{chunk-MXCW6SOT.mjs → chunk-7R47MHQE.mjs} +1 -1
- package/dist/{chunk-LJQPLE4S.mjs → chunk-AJQHGVZ5.mjs} +1 -1
- package/dist/{chunk-5MU4KV3B.mjs → chunk-AQZEZ3UR.mjs} +1 -1
- package/dist/{chunk-GS2VFNHY.mjs → chunk-B3F6F2S4.mjs} +1 -1
- package/dist/{chunk-U3F45KVI.mjs → chunk-BKR3FRMQ.mjs} +1 -1
- package/dist/{chunk-YKG4FNS4.mjs → chunk-C4RWEPVF.mjs} +1 -1
- package/dist/{chunk-7GMAMIHM.mjs → chunk-CXOVEABI.mjs} +1 -1
- package/dist/{chunk-O4NH5Z6F.mjs → chunk-DKVCSRUJ.mjs} +1 -1
- package/dist/{chunk-IF3425JX.mjs → chunk-FE7ZGUPU.mjs} +1 -1
- package/dist/{chunk-H3CJOE6S.mjs → chunk-GHOL5L32.mjs} +1 -1
- package/dist/{chunk-2RQDJ5XT.mjs → chunk-GTZJWMZR.mjs} +1 -1
- package/dist/{chunk-YOETYY5S.mjs → chunk-IPIDKLAW.mjs} +1 -1
- package/dist/{chunk-I2GNNRFH.mjs → chunk-KWYJ3XZI.mjs} +1 -1
- package/dist/{chunk-ITJH72Z2.mjs → chunk-LAQ3QAUW.mjs} +1 -1
- package/dist/chunk-LYPWYO4W.mjs +1 -0
- package/dist/{chunk-FTZRG54P.mjs → chunk-M4UVNIK2.mjs} +1 -1
- package/dist/{chunk-7EXAS7HK.mjs → chunk-MAAKU7PN.mjs} +1 -1
- package/dist/{chunk-HKGW6JI2.mjs → chunk-NINFDOV5.mjs} +1 -1
- package/dist/{chunk-SW7RYGO6.mjs → chunk-OQYER4E7.mjs} +1 -1
- package/dist/chunk-PC6TVU7J.mjs +1 -0
- package/dist/{chunk-FO3BUEXC.mjs → chunk-R75OR5VS.mjs} +1 -1
- package/dist/{chunk-255P6K5W.mjs → chunk-RGOKBIQ5.mjs} +1 -1
- package/dist/{chunk-67QPOSVV.mjs → chunk-RJGYVDOU.mjs} +1 -1
- package/dist/{chunk-5B6FLVPH.mjs → chunk-RVHCTANZ.mjs} +1 -1
- package/dist/{chunk-SRUG246N.mjs → chunk-TXVA6XJT.mjs} +1 -1
- package/dist/{chunk-A3SDGX4K.mjs → chunk-UJSXVIXW.mjs} +1 -1
- package/dist/{chunk-5SIP7DC5.mjs → chunk-VR5WOPRD.mjs} +1 -1
- package/dist/{chunk-OTFILQXI.mjs → chunk-VWLPVN4M.mjs} +1 -1
- package/dist/{chunk-ERJXTG6X.mjs → chunk-WIRQ5IRT.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/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/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/DigitalColleagues/MainPage.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/KnowledgeView.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
- package/dist/components/DigitalColleagues/index.mjs +1 -1
- package/dist/components/HeaderFooter/Header.mjs +1 -1
- package/dist/components/HeaderFooter/SectionHeading.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/RenderHero.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Holidays/HolidayGrid.js +1 -1
- package/dist/components/Holidays/HolidayGrid.mjs +1 -1
- package/dist/components/Holidays/HolidayTracker.js +1 -1
- package/dist/components/Holidays/HolidayTracker.mjs +1 -1
- package/dist/components/Holidays/RequestLeave.js +1 -1
- package/dist/components/Holidays/RequestLeave.mjs +1 -1
- package/dist/components/Holidays/index.js +1 -1
- package/dist/components/Holidays/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/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/Projects/ProjectsIndexView.mjs +1 -1
- package/dist/components/dc-temp/index.mjs +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/index.js +3 -3
- 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/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/form/index.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/dist/utils/BankHolidays.d.ts +1 -4
- package/dist/utils/BankHolidays.js +1 -1
- package/dist/utils/BankHolidays.mjs +1 -1
- package/dist/utils/DaysUtil.js +1 -1
- package/dist/utils/DaysUtil.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-A24EPYUY.mjs +0 -1
- package/dist/chunk-QKGEV7LG.mjs +0 -1
package/dist/index.js
CHANGED
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
dark bg-background text-primary`,children:[(0,Co.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[e&&(0,Co.jsx)("img",{src:e.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,Co.jsx)("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),(0,Co.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]}),Bn=({title:e})=>(0,Co.jsx)("header",{className:"absolute top-0 left-0 w-full py-4 px-8 flex justify-between items-center transition-colors duration-300 dark bg-background text-foreground",children:(0,Co.jsx)("div",{className:"container",children:(0,Co.jsx)("span",{className:"container text-4xl px-6",children:e})})}),Ln=e=>{let{title:t,hero:a,logoImage:o}=e;return(0,Co.jsxs)("div",{className:"relative w-full h-full flex flex-col justify-center min-h-[500px] p-10",children:[(0,Co.jsx)("div",{className:"absolute inset-0",children:(0,Co.jsx)(Rm.default,{src:a.media&&a.media.url?a.media.url:"/hero.png",alt:"Background",width:a.media&&a.media.width?a.media.width??1920:1920,height:a.media&&a.media.height?a.media.height??1080:1080,style:{objectFit:"cover"},className:"opacity-80 h-full dark:opacity-60"})}),(0,Co.jsx)("div",{className:"absolute left-16 Co-50 top-4 flex flex-col items-start gap-4",children:o&&(0,Co.jsx)("div",{className:"h-24",children:(0,Co.jsx)(Rm.default,{src:o.src,alt:"Company logo",className:"h-full w-full object-contain",width:192,height:96})})}),(0,Co.jsx)("div",{className:"absolute inset-0 bg-black/30 dark:bg-black/50"}),(0,Co.jsxs)("div",{className:"relative pl-24 Co-10 max-w-3xl",children:[(0,Co.jsx)("p",{className:"text-lg font-medium Co-48 text-accent mb-2",children:t}),a.richText&&(0,Co.jsx)(it,{content:a.richText,enableGutter:!1,className:"prose-headings:text-white prose-p:text-white"})]})]})};var Xl=e=>{let[t,a]=(0,Zp.useState)(0),{blocks:o,hero:s,logoImage:r}=e,n=o&&Array.isArray(o)&&o.length>0,l=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...o],c=f=>{a(f)},d=()=>{a(f=>(f+1)%l.length)},p=()=>{a(f=>(f-1+l.length)%l.length)},g=(0,Zp.useCallback)(((f,b)=>{let C;return(...T)=>{clearTimeout(C),C=setTimeout(()=>f(...T),b)}})(f=>{f.deltaY>0?d():p()},300),[]),h=f=>{f.key==="ArrowDown"?d():f.key==="ArrowUp"&&p()};return(0,Zp.useEffect)(()=>(window.addEventListener("wheel",g),window.addEventListener("keydown",h),()=>{window.removeEventListener("wheel",g),window.removeEventListener("keydown",h)}),[]),(0,Co.jsxs)("div",{className:"flex flex-col min-h-screen relative overflow-hidden",children:[(0,Co.jsx)("div",{className:"fixed left-0 top-0 flex h-screen w-9 Co-10 flex-col items-center justify-center bg-gray-900",children:n&&l.map((f,b)=>(0,Co.jsx)("button",{className:`group relative flex items-center justify-center my-2 h-16 w-4 rounded-full transition-all hover:bg-accent duration-300 ${t===b?"bg-accent":"bg-gray-600"}`,onClick:()=>c(b),children:(0,Co.jsx)("span",{className:"absolute ml-7 left-full text-left transform -translate-y-1/2 translate-x-0 rotate-90 origin-left whitespace-nowrap opacity-0 group-hover:opacity-100 group-hover:translate-x-2 transition-all duration-300",children:f.blockName})},f.id))}),(0,Co.jsx)(Ti.AnimatePresence,{children:l.map((f,b)=>(0,Co.jsx)("div",{id:`slide-${b}`,className:"print-section",children:(0,Co.jsx)("div",{className:`absolute flex items-center justify-center transition-opacity duration-1000
|
|
17
17
|
${b===t?"opacity-100":"opacity-0"}
|
|
18
18
|
w-full h-full bg-cover bg-center`,children:b===0?(0,Co.jsx)(Ln,{hero:s,title:e.title,logoImage:r}):(0,Co.jsxs)(Co.Fragment,{children:[f.blockName&&(0,Co.jsx)(Bn,{title:f.blockName}),(0,Co.jsx)(fs,{blocks:[f],fill:!0}),(0,Co.jsx)(Kg,{logoImage:r})]})})},b))}),(0,Co.jsx)("button",{className:"absolute bottom-4 left-1 Co-20 text-3xl text-primary transition-all duration-300 hover:scale-110",onClick:d,children:(0,Co.jsx)(w0,{})})]})},w0=()=>(0,Co.jsx)(Ti.AnimatePresence,{children:(0,Co.jsx)(Ti.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.7,ease:[.76,0,.24,1]},className:m("w-fit min-h-[50px] min-w-[20px] p-1 border-2 rounded-full","border-accent"),children:(0,Co.jsx)(Ti.motion.div,{initial:{y:0},animate:{y:[0,25],opacity:[1,0]},transition:{duration:1,ease:"easeOut",repeat:1/0,repeatDelay:1},className:m("w-[12px] h-[12px] rounded-full","bg-accent")})})});var Wg=H(require("next/link")),Xg=H(require("next/image"));function qg({blogs:e,width:t=3}){return(0,Co.jsx)("div",{className:"w-full max-w-7xl mx-auto px-4 py-8",children:(0,Co.jsx)("div",{className:`grid md:grid-cols-2 lg:grid-cols-${t} gap-6`,children:e&&e.map((a,o)=>(0,Co.jsx)(Wg.default,{href:`/insights/${a.slug}`,className:"group rounded-2xl overflow-hidden border bg-card text-card-foreground shadow hover:shadow-lg transition-shadow",children:(0,Co.jsxs)("div",{className:"relative size-full",children:[(0,Co.jsx)(Xg.default,{src:a.image?.src||"/assets/images/blog/gradient.png",alt:"post image",width:850,height:575,sizes:"33vw",className:"relative inset-0 size-full rounded-2xl bg-gray-50 object-cover"}),(0,Co.jsxs)("div",{className:"absolute inset-0 px-4 pb-2 bg-gradient-Co-t from-card Co-transparrent flex flex-col justify-end",children:[(0,Co.jsxs)("div",{className:"text-sm text-card-foreground mb-2",children:[a.authors&&a.authors.map(s=>`${s.name} \xB7 `),a.publishedAt&&new Date(a.publishedAt).toLocaleDateString("en-GB",{day:"numeric",month:"long"})]}),(0,Co.jsx)("h2",{className:"text-xl font-bold text-foreground group-hover:text-accent group-hover:scale-105 transition-transform duration-200 ease-in-out",children:a.title})]})]})},o))})})}function Yg({title:e,subtitle:t,description:a,missionTitle:o,missionDescription:s,images:r,raisedAmount:n,companiesCount:i,dealsClosed:l,leadsGenerated:c}){return(0,Co.jsx)("div",{className:"overflow-hidden bg-white py-24 sm:py-32",children:(0,Co.jsxs)("div",{className:"mx-auto max-w-2xl px-6 lg:max-w-7xl lg:px-8",children:[(0,Co.jsxs)("div",{className:"max-w-4xl",children:[(0,Co.jsx)("p",{className:"text-base/7 font-semibold text-indigo-600",children:t}),(0,Co.jsx)("h1",{className:"Nu-2 text-pretty text-4xl font-semibold tracking-tight text-gray-900 sm:text-5xl",children:e}),(0,Co.jsx)("p",{className:"Nu-6 text-balance text-xl/8 text-gray-700",children:a})]}),(0,Co.jsxs)("section",{className:"Nu-20 grid grid-cols-1 lg:grid-cols-2 lg:gap-x-8 lg:gap-y-16",children:[(0,Co.jsxs)("div",{className:"lg:pr-8",children:[(0,Co.jsx)("h2",{className:"text-pretty text-2xl font-semibold tracking-tight text-gray-900",children:o}),(0,Co.jsx)("p",{className:"Nu-6 text-base/7 text-gray-600",children:s})]}),(0,Co.jsx)("div",{className:"Co-16 lg:row-span-2 lg:-Co-16 xl:Co-auto",children:(0,Co.jsx)("div",{className:"-mx-8 grid grid-cols-2 gap-4 sm:-mx-16 sm:grid-cols-4 lg:mx-0 lg:grid-cols-2 lg:gap-4 xl:gap-8",children:r.map((d,p)=>(0,Co.jsx)("div",{className:"aspect-square overflow-hidden rounded-xl shadow-xl outline-1 -outline-offset-1 outline-black/10",children:(0,Co.jsx)("img",{alt:"",src:d,className:"block size-full object-cover"})},p))})}),(0,Co.jsxs)("div",{className:"max-lg:Nu-16 lg:col-span-1",children:[(0,Co.jsx)("p",{className:"text-base/7 font-semibold text-gray-500",children:"The numbers"}),(0,Co.jsx)("Co",{className:"Nu-6 border-t border-gray-200"}),(0,Co.jsxs)("dl",{className:"Nu-6 grid grid-cols-1 gap-x-8 gap-y-4 sm:grid-cols-2",children:[(0,Co.jsxs)("div",{className:"flex flex-col gap-y-2 border-b border-dotted border-gray-200 pb-4",children:[(0,Co.jsx)("dt",{className:"text-sm/6 text-gray-600",children:"Raised"}),(0,Co.jsxs)("Jm",{className:"order-first text-6xl font-semibold tracking-tight",children:["$",n]})]}),(0,Co.jsxs)("div",{className:"flex flex-col gap-y-2 border-b border-dotted border-gray-200 pb-4",children:[(0,Co.jsx)("dt",{className:"text-sm/6 text-gray-600",children:"Companies"}),(0,Co.jsxs)("Jm",{className:"order-first text-6xl font-semibold tracking-tight",children:[i,"K"]})]}),(0,Co.jsxs)("div",{className:"flex flex-col gap-y-2 max-sm:border-b max-sm:border-dotted max-sm:border-gray-200 max-sm:pb-4",children:[(0,Co.jsx)("dt",{className:"text-sm/6 text-gray-600",children:"Deals Closed"}),(0,Co.jsxs)("Jm",{className:"order-first text-6xl font-semibold tracking-tight",children:[l,"M"]})]}),(0,Co.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,Co.jsx)("dt",{className:"text-sm/6 text-gray-600",children:"Leads Generated"}),(0,Co.jsxs)("Jm",{className:"order-first text-6xl font-semibold tracking-tight",children:[c,"M"]})]})]})]})]})]})})}function C0(e){var t=document.createElement("div");t.style.display="block",t.style.height=e,document.body.appendChild(t);var a=parseFloat(window.getComputedStyle(t,null).height);return t.parentNode&&t.parentNode.removeChild(t),Math.floor(a)}var Ai=e=>{let t=document.createElement("div");t.style.height="1mm",document.body.appendChild(t);let a=parseFloat(window.getComputedStyle(t).height);return document.body.removeChild(t),Math.floor(e/a)},Am=({page:e,layout:t="portrait",logoImage:a})=>t==="flow"?(0,Co.jsx)(Jg,{page:e,layout:t,logoImage:a}):(0,Co.jsx)(Qg,{page:e,layout:t,logoImage:a}),Jg=({page:e,layout:t="portrait",logoImage:a})=>{let{contentWithIds:o}=ui(e),s=(0,Zp.useRef)(null),r=(0,Zp.useRef)(null),n=(0,Zp.useRef)(new j1.Previewer),i={id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}};(0,Zp.useEffect)(()=>{let d=document.getElementById("printable-content");if(d){let p=document.createElement("style");return p.textContent=`@page { size: ${Ai(d.offsetWidth)}Co ${Ai(d.offsetHeight)}Co ; margin: 0mm; width: ${Ai(d.offsetWidth)}Co }; .container : { max-width: ${Ai(d.offsetWidth)}Co; } .container : { max-width: 100%; }; html body * :not(#prinable-content, #printable-content *) { visibility: hidden !important; }`,document.head.appendChild(p),()=>{document.head.removeChild(p)}}},[t]);let l=(0,Zp.useCallback)(()=>{if(!r.current)return;r.current&&(r.current.innerHTML="");let d=document.getElementById("printable-content");d&&n.current.preview(document.getElementById("printable-content").innerHTML,[`@page { size: ${Ai(d.offsetWidth)}Co ${Ai(d.offsetHeight)}Co ; margin: 0mm; }; .container : { max-width: 100%; }; body { zoom: 100%;}`],r.current).catch(p=>console.error("Paged.js error:",p))},[t]);(0,Zp.useEffect)(()=>{n.current=new j1.Previewer},[l,t]);let c=[i,...o];return(0,Co.jsxs)("div",{children:[(0,Co.jsx)("div",{className:"w-[1123px] print:w-[1123px]",children:(0,Co.jsxs)("div",{id:"printable-content",ref:s,children:[c.map((d,p)=>(0,Co.jsx)(Co.Fragment,{children:p===0?(0,Co.jsx)("section",{className:"title-page w-full h-full",children:(0,Co.jsx)(Ln,{hero:e.hero,title:e.title})},p):(0,Co.jsxs)("section",{className:"normal-page overflow-hidden",children:[d.blockName&&(0,Co.jsx)(Bn,{title:d.blockName}),(0,Co.jsx)(fs,{blocks:[d],fill:!0})]},p)})),(0,Co.jsx)("section",{className:"normal-page",children:(0,Co.jsxs)("div",{className:`w-full py-2 px-8 flex justify-between items-center
|
|
19
|
-
dark bg-background text-primary`,children:[(0,Co.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[a&&(0,Co.jsx)("img",{src:a.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,Co.jsx)("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),(0,Co.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]})})]})}),(0,Co.jsx)("div",{ref:r,className:"preview-container"})]})},Qg=({page:e,layout:t="portrait"})=>{let{contentWithIds:a}=ui(e),o=(0,Zp.useRef)(null),s=(0,Zp.useRef)(null),r=(0,Zp.useRef)(new j1.Previewer),[n,i]=(0,Zp.useState)(0),c=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...a],d=(0,Zp.useCallback)(()=>{o.current&&(o.current&&(o.current.innerHTML=""),r.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.js error:",p)))},[t]);return(0,Zp.useEffect)(()=>{r.current=new j1.Previewer,d()},[d,t]),(0,Zp.useEffect)(()=>{let p=document.createElement("style");return p.textContent=`@page { size: A4 ${t} ; margin: 0mm; };`,document.head.appendChild(p),()=>{document.head.removeChild(p)}},[]),(0,Co.jsxs)("div",{className:"pagedjs-container",children:[(0,Co.jsx)("div",{id:"printable-content",ref:s,style:{display:"none"},className:"pagedjs-content",children:c.map((p,u)=>(0,Co.jsx)(Co.Fragment,{children:u===0?(0,Co.jsx)("section",{className:"pagedjs-section title-page w-full h-full",children:(0,Co.jsx)(Ln,{hero:e.hero,title:e.title})},u):(0,Co.jsxs)("section",{className:m("pagedjs-section normal-page h-[699px]",`h-[${C0("185mm")}px]`,p.theme?.settings?.theme==="dark"?"dark":"light"),children:[p.blockName&&(0,Co.jsx)(Bn,{title:p.blockName}),(0,Co.jsx)(fs,{blocks:[p],fill:!0})]},u)}))}),(0,Co.jsx)("div",{ref:o,className:"preview-container"})]})};var Im=H(require("clsx"));function k0({mainNav:e,secondaryNav:t,title:a,subTitle:o,pathName:s,menuHeading:r,onNavClick:n,loading:i=!1,LinkComponent:l,...c}){let p=l?u=>(0,Co.jsx)(l,{...u}):n?({href:u,children:g,...h})=>(0,Co.jsx)("button",{onClick:()=>n&&n(u),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...h,children:g}):u=>(0,Co.jsx)("a",{...u});return(0,Co.jsxs)(kr,{...c,variant:"inset",children:[(0,Co.jsx)(Sr,{children:(0,Co.jsx)(Ia,{children:(0,Co.jsx)(ga,{children:i?(0,Co.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Co.jsx)(dt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,Co.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Co.jsx)("span",{className:"truncate font-semibold",children:a}),o&&(0,Co.jsx)("span",{className:"truncate text-sm",children:o})]})})})}),i&&(0,Co.jsxs)(Uo,{children:[(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,Co.jsxs)(Uo,{children:[e&&!i&&e.map((u,g)=>(0,Co.jsx)(S0,{subNav:u,pathName:s,Link:p},g)),(0,Co.jsx)(Xa,{className:"Nu-auto",children:(0,Co.jsx)(go,{children:(0,Co.jsx)(Ia,{children:t&&!i&&t.map(u=>(0,Co.jsx)(ga,{children:(0,Co.jsx)(qa,{asChild:!0,size:"sm",children:(0,Co.jsxs)(p,{href:u.url||"",children:[u.icon&&(0,Co.jsx)(u.icon,{}),(0,Co.jsx)("span",{children:u.label})]})})},u.label))})})})]}),(0,Co.jsx)(Pr,{})]})}function S0({subNav:e,pathName:t,Link:a}){let o=e,s=!1;return o.links&&o.links.map(r=>{r.url===t&&(s=!0)}),(0,Co.jsx)(ko,{defaultOpen:!0,className:"group/collapsible",children:(0,Co.jsx)(Xa,{className:"py-0",children:(0,Co.jsx)(Ia,{children:(0,Co.jsx)(ko,{asChild:!0,defaultOpen:o.isActive,children:(0,Co.jsxs)(ga,{children:[(0,Co.jsx)(qa,{asChild:!0,tooltip:o.label,className:(0,Im.default)(s&&"font-bold text-accent"),children:(0,Co.jsxs)(a,{href:o.url,children:[o.icon&&(0,Co.jsx)(o.icon,{}),(0,Co.jsx)("span",{children:o.label})]})}),o.links?.length?(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(or,{asChild:!0,children:(0,Co.jsxs)(Ls,{className:"data-[state=open]:rotate-90",children:[(0,Co.jsx)(Nu.ChevronRight,{}),(0,Co.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,Co.jsx)(rr,{children:(0,Co.jsx)(sr,{children:o.links?.map(r=>(0,Co.jsx)(ir,{children:(0,Co.jsx)(nr,{asChild:!0,className:(0,Im.default)(r.url===t&&"font-bold text-accent"),children:(0,Co.jsx)(a,{href:r.url,children:(0,Co.jsx)("span",{children:r.label})})})},r.label))})})]}):null]})},o.label)})})})}var ef=H(require("clsx"));var P0=()=>(0,Co.jsx)(ja,{iconName:"github",size:"10x"});function D0({relatedContent:e,tableOfContents:t,editorComponent:a,loading:o=!1,editMode:s=!1,onAddDocument:r,onEditDocument:n,onPrintDocument:i,onGithubClick:l,onNavClick:c,LinkComponent:d,...p}){let h=d?f=>(0,Co.jsx)(d,{...f}):c?({item:f,children:b,...C})=>(0,Co.jsx)("button",{onClick:()=>c&&c(f),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...C,children:b}):f=>(0,Co.jsx)("a",{href:f.href,...f});return(0,Co.jsxs)(kr,{side:"right",variant:"inset",...p,children:[(0,Co.jsxs)(Sr,{className:"border-b border-sidebar-border",children:[(0,Co.jsxs)(Ia,{className:"flex-row space-x-1",children:[(0,Co.jsx)(ga,{children:(0,Co.jsxs)(qa,{onClick:r,children:[(0,Co.jsx)(Nu.FilePlus,{})," ",(0,Co.jsx)("span",{children:"Add Document"})]})}),l&&(0,Co.jsx)(ga,{children:(0,Co.jsx)(qa,{onClick:l,tooltip:"Open in GitHub",children:(0,Co.jsx)(P0,{})})})]}),(0,Co.jsxs)(Ia,{className:"flex-row space-x-1",children:[(0,Co.jsx)(ga,{className:"w-5/12",children:(0,Co.jsxs)(qa,{onClick:()=>n(),variant:s?"outline":"default",className:(0,ef.default)(s&&"text-accent"),children:[(0,Co.jsx)(Nu.Edit,{})," ",(0,Co.jsx)("span",{children:"Edit"})]})}),(0,Co.jsx)(ga,{className:"w-5/12",children:(0,Co.jsxs)(qa,{onClick:i,children:[(0,Co.jsx)(Nu.Printer,{})," ",(0,Co.jsx)("span",{children:"Print"})]})})]})]}),a&&(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(ko,{defaultOpen:!0,className:"group/collapsible",children:(0,Co.jsxs)(Xa,{children:[(0,Co.jsx)(Dr,{asChild:!0,children:(0,Co.jsxs)(or,{children:["Editor Controls",(0,Co.jsx)(Nu.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Co.jsx)(go,{children:(0,Co.jsx)(rr,{children:a})})]})}),(0,Co.jsx)(vn,{className:"mx-0"})]}),(0,Co.jsxs)(Uo,{className:"overflow-auto",children:[o&&(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsxs)(Xa,{children:[(0,Co.jsx)(Dr,{children:"Related Content"}),(0,Co.jsx)(go,{children:(0,Co.jsx)(Ia,{children:Array.from({length:3}).map((f,b)=>(0,Co.jsx)(ga,{children:(0,Co.jsx)(dt,{className:"bg-gray-200 w-full h-10"})},b))})})]}),(0,Co.jsxs)(Xa,{children:[(0,Co.jsx)(Dr,{children:"Table of Contents"}),(0,Co.jsx)(go,{children:(0,Co.jsx)(Ia,{children:Array.from({length:3}).map((f,b)=>(0,Co.jsx)(ga,{children:(0,Co.jsx)(dt,{className:"bg-gray-200 w-full h-10"})},b))})})]})]}),e&&!o&&Object.keys(e).length>0&&(0,Co.jsx)(ko,{defaultOpen:!0,className:"group/collapsible",children:(0,Co.jsxs)(Xa,{children:[(0,Co.jsx)(Dr,{asChild:!0,children:(0,Co.jsxs)(or,{children:["Related Content",(0,Co.jsx)(Nu.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Co.jsx)(go,{children:(0,Co.jsx)(rr,{children:(0,Co.jsx)(Ia,{children:e&&Object.keys(e).map(f=>(0,Co.jsxs)(ga,{children:[(0,Co.jsxs)("span",{className:"p-2 text-Nu text-sidebar-foreground",children:[" ",f.charAt(0).toUpperCase()+f.slice(1)]}),f&&e[f]&&(0,Co.jsx)(sr,{children:e[f].map(b=>(0,Co.jsx)(ir,{children:(0,Co.jsx)(nr,{asChild:!0,isActive:!1,size:"sm",children:(0,Co.jsxs)(h,{href:b.url,item:b,className:"flex justify-between items-center w-full text-Nu",children:[(0,Co.jsx)("span",{children:b.label}),b.type==="note"&&(0,Co.jsx)(Nu.PencilLine,{className:"ml-2 text-gray-400 !important",size:16}),b.type==="draft"&&(0,Co.jsx)(ja,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},b.label))})]},f))})})})]})}),t&&!o&&(0,Co.jsx)(ko,{defaultOpen:!0,className:"group/collapsible",children:(0,Co.jsxs)(Xa,{children:[(0,Co.jsx)(Dr,{asChild:!0,children:(0,Co.jsxs)(or,{children:["Table of Contents",(0,Co.jsx)(Nu.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Co.jsx)(go,{children:(0,Co.jsx)(rr,{children:(0,Co.jsx)(Ia,{children:t.map(f=>(0,Co.jsxs)(ga,{children:[(0,Co.jsx)(qa,{asChild:!0,children:(0,Co.jsx)("a",{href:`#${f.url}`,className:"text-Nu",children:f.title})}),f.items?.length?(0,Co.jsx)(sr,{children:f.items.map(b=>(0,Co.jsx)(ir,{children:(0,Co.jsx)(nr,{asChild:!0,isActive:b.isActive,size:"sm",children:(0,Co.jsx)("a",{href:`#${b.url}`,className:"flex justify-between items-center w-full text-Nu",children:(0,Co.jsx)("span",{children:b.title})})})},b.title))}):null]},f.title))})})})]})})]}),(0,Co.jsx)(Pr,{})]})}var af=H(require("next/image"));function T0({title:e,members:t}){return(0,Co.jsx)(j,{className:"mb-6",children:(0,Co.jsxs)("div",{className:"p-6",children:[(0,Co.jsxs)("div",{className:"flex items-center mb-4",children:[(0,Co.jsx)(Nu.Users,{className:"w-6 h-6 text-accent Co-2"}),(0,Co.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:e})]}),(0,Co.jsx)("div",{className:"space-y-4",children:t.map((a,o)=>(0,Co.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,Co.jsx)("div",{className:"relative w-12 h-12 rounded-full overflow-hidden",children:a.avatar&&(0,Co.jsx)(af.default,{src:a.avatar,alt:a.name,layout:"fill",objectFit:"cover"})}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("p",{className:"font-semibold text-foreground",children:a.name}),a.role&&(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:a.role})]})]},o))})]})})}var of=H(require("next/link"));var R0=({links:e,title:t="Related Content"})=>(0,Co.jsxs)(j,{children:[(0,Co.jsx)(be,{children:(0,Co.jsx)(xe,{className:"text-accent",children:t})}),(0,Co.jsx)(ae,{children:(0,Co.jsx)("nav",{className:"flex flex-col space-y-2",children:e.map((a,o)=>(0,Co.jsxs)(of.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,Co.jsx)(Nu.ExternalLink,{className:"ml-1 h-3 w-3"})]},o))})})]});var Mm=m("grid h-[45px] w-[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 Bm({pages:e}){let t=(0,zg.useSearchParams)(),a=(0,zg.usePathname)(),{replace:o}=(0,zg.useRouter)(),{totalPages:s,page:r}=e,[n,i]=(0,Zp.useState)({start:r>3?r-3:1,end:r+2}),l=p=>{p==="left"&&n.start>1?i(u=>({start:u.start-1,end:u.end-1})):p==="right"&&n.end<s&&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(s<=1)return null;let d=[];for(let p=n.start;p<=n.end;p++)d.push(p);return(0,Co.jsx)("div",{className:"Nu-12",children:(0,Co.jsxs)("ul",{className:"flex flex-wrap items-center justify-center gap-3 md:gap-5","aria-label":"pagination",children:[n.start>1&&(0,Co.jsx)("Co",{children:(0,Co.jsx)("button",{className:m(Mm,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll left",onClick:()=>l("left"),children:(0,Co.jsx)(og.FaArrowLeft,{})})}),d.map((p,u)=>(0,Co.jsx)("Co",{children:(0,Co.jsx)("a",{className:m(Mm,p===r?"border-accent bg-accent text-accent-foreground":"border-accent"),href:"#","aria-label":`pagination button ${p}`,role:"button",onClick:g=>{g.preventDefault(),c(p.toString())},children:p})},u)),n.end<s&&(0,Co.jsx)("Co",{children:(0,Co.jsx)("button",{className:m(Mm,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll right",onClick:()=>l("right"),children:(0,Co.jsx)(og.FaArrowRight,{})})})]})})}var yk=m("transition-colors duration-400 hover:text-primary ease-in-out");function Lm({title:e,links:t}){let a=(0,zg.useSearchParams)(),o=(0,zg.usePathname)(),{replace:s}=(0,zg.useRouter)();function r(n){let i=new URLSearchParams(a);n?i.set("category",n):i.delete("category"),s(`${o}?${i.toString()}`)}return(0,Co.jsxs)(j,{children:[(0,Co.jsx)(be,{children:(0,Co.jsx)(xe,{className:"text-accent",children:e&&e})}),(0,Co.jsx)(ae,{children:t&&t.length>0&&(0,Co.jsx)("nav",{"aria-label":"footer links navigation",children:(0,Co.jsx)("ul",{className:"grid gap-2.5 ",children:t.map((n,i)=>(0,Co.jsxs)("Co",{className:"flex items-center text-sm text-primary hover:text-accent dark:text-foreground first:Co-0 hover:cursor-pointer",onClick:l=>{l.preventDefault(),r(n.href)},children:[n.label,(0,Co.jsx)(Nu.ExternalLink,{className:"ml-1 h-3 w-3"})]},i))})})})]})}function Fm({types:e}){let[t,a]=(0,Zp.useState)(e&&e[0].href),o=(0,zg.useSearchParams)(),s=(0,zg.usePathname)(),{replace:r}=(0,zg.useRouter)();function n(i){let l=new URLSearchParams(o);i?l.set("type",i):l.delete("type"),a(i),r(`${s}?${l.toString()}`)}return(0,Co.jsx)("div",{className:"flex gap-2 flex-wrap items-center justify-center overflow-x-auto pb-4 mb-6",children:e&&e.map((i,l)=>(0,Co.jsx)(y,{variant:i.href===t?"default":"ghost",className:m("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},l))})}var df=H(require("next/image"));var zm=({links:e,media:t,children:a,richText:o})=>(0,Co.jsx)("div",{children:(0,Co.jsxs)("div",{className:"sticky top-0 h-[70vh] min-h-[600px]",children:[(0,Co.jsxs)("div",{className:"fixed inset-0 container Nu-24 mb-8 Co-10 flex items-start justify-center",children:[a||o&&(0,Co.jsx)(it,{className:"max-w-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,Co.jsx)("ul",{className:"flex justify-center gap-4",children:e.map(({link:s},r)=>(0,Co.jsx)("Co",{children:(0,Co.jsx)(Vo,{...s})},r))})]}),(0,Co.jsxs)("div",{className:"fixed inset-0 h-[70vh] min-h-[600px] select-none",children:[t&&typeof t=="object"&&(0,Co.jsx)(_o,{fill:!0,imgClassName:"Co-5 object-cover",priority:!1,loading:"lazy",resource:t}),t&&typeof t=="string"&&(0,Co.jsx)("div",{children:(0,Co.jsx)(df.default,{className:"-Co-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,Co.jsx)("span",{className:"absolute inset-0 bg-gradient-Co-b from-white dark:from-black"})]}),(0,Co.jsx)(A0,{})]})}),A0=()=>(0,Co.jsx)("div",{className:"w-full h-[1240px] Co-10",children:(0,Co.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,Co.jsx)("defs",{children:(0,Co.jsxs)("mask",{id:"mask",children:[(0,Co.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,Co.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,Co.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,Co.jsx)("rect",{y:"330",width:"1920",height:"7",fill:"white"})," "]})});var jm=H(require("next/image"));var I0=({media:e})=>{if(e&&typeof e=="object"){let{alt:t,filename:a,height:o,url:s,width:r}=e;return(0,Co.jsx)(jm.default,{className:"mix-blend-overlay opacity-50",alt:t||"",fill:!0,priority:!0,src:s||"",width:r||0,height:o||0,style:{objectFit:"cover"}})}else if(e&&typeof e=="string")return(0,Co.jsx)("div",{children:(0,Co.jsx)(jm.default,{className:"mix-blend-overlay opacity-50",alt:"",fill:!0,priority:!0,src:e,style:{objectFit:"cover"}})});return null},Hm=({links:e,media:t,children:a,richText:o})=>(0,Co.jsxs)("div",{className:"relative bg-brand-one pb-12 Nu-20 Co-10",children:[t&&(0,Co.jsx)(I0,{media:t}),(0,Co.jsx)("div",{className:"mx-0 min-w-full relative Co-9",children:(0,Co.jsx)("div",{className:"container text-brand-one-foreground",children:a||o&&(0,Co.jsx)(it,{className:"prose-headings:text-brand-one-foreground prose-p:text-brand-one-foreground",content:o,enableProse:!0,enableGutter:!1})})})]});var Om=({children:e,richText:t})=>(0,Co.jsx)("div",{className:"min-w-full py-10 bg-muted Nu-24",children:(0,Co.jsx)("div",{className:"container",children:e||t&&(0,Co.jsx)(it,{content:t,enableGutter:!1})})});var mf=H(require("react")),pf=H(require("next/image"));var cf=e=>{let a=new Date;e&&(a=new Date(e));let o=a.getMonth(),s=a.getDate(),r=o+1<10?`0${o+1}`:o+1,n=s<10?`0${s}`:s,i=a.getFullYear();return`${n}/${r}/${i}`};var Jl=e=>{let t=e?new Date(e):new Date,a=new Intl.DateTimeFormat("en-US",{weekday:"long"}).format(t),o=t.getDate(),s=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"st";case 2:return"Nu";case 3:return"Nu";default:return"th"}})(o)} ${s}`};var M0=({post:e})=>{let{categories:t,meta:a,populatedAuthors:o,publishedAt:s,title:r}=e;return(0,Co.jsxs)("div",{className:"relative grid Co-24",children:[(0,Co.jsx)("div",{className:"relative Co-10 flex flex-col justify-end min-h-[50vh] text-foreground dark:text-foreground Co-24 p-6 lg:p-12",children:(0,Co.jsxs)("div",{className:"container mx-auto",children:[(0,Co.jsx)("h1",{className:"mb-6 text-[clamp(2rem,1.5rem+1.5vw,3.5rem)] font-bold leading-tight ",children:r}),(0,Co.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:gap-16 ",children:[o&&o.length>0&&(0,Co.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Co.jsxs)("p",{className:"text-sm",children:["Author",o.length>1?"s":""]}),(0,Co.jsx)("p",{children:o.map((n,i)=>(0,Co.jsxs)(mf.default.Fragment,{children:[n.name,i<o.length-2&&", ",i===o.length-2&&(o.length>2?", and ":" and ")]},n.id))})]}),s&&(0,Co.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Co.jsx)("p",{className:"text-sm",children:"Date Published"}),(0,Co.jsx)("time",{dateTime:s,children:cf(s)})]}),t&&t.length>0&&(0,Co.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Co.jsx)("p",{className:"text-sm font-medium",children:"Categories"}),(0,Co.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((n,i)=>typeof n=="object"&&n!==null&&(0,Co.jsx)(Z,{className:"px-3 py-1 mx-1",children:n.title||"Untitled category"},n.id||i))})]})]})]})}),(0,Co.jsxs)("div",{className:"absolute inset-0 w-full h-full",children:[(0,Co.jsx)(pf.default,{className:"object-cover",alt:`Cover image for ${r}`,src:a?.image?.url||"/assets/images/blog/gradient.png",fill:!0,priority:!0,sizes:"100vw"}),(0,Co.jsx)("div",{className:"absolute pointer-events-none left-0 bottom-0 w-full h-1/2 bg-gradient-Co-t from-background dark:from-black Co-transparent"})]})]})};var Ql=require("@heroicons/react/20/solid");var Um=H(require("next/image"));function lo({children:e,isFluid:t=!1,isNoPadding:a=!1,className:o=""}){let s=m("container",t&&"full-width",a&&"Co-padding",o);return(0,Co.jsx)("div",{className:s,children:e})}var gf=require("next-themes");function B0({children:e,...t}){return(0,Co.jsx)(gf.ThemeProvider,{...t,children:e})}var ho=({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,Co.jsx)("div",{className:"w-full h-[1240px] Co-20",children:(0,Co.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:m(t,"absolute -bottom-[2px] flex"),children:[(0,Co.jsx)("defs",{children:(0,Co.jsxs)("mask",{id:"mask",children:[(0,Co.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,Co.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,Co.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,Co.jsx)("rect",{y:"331",width:"1920",height:"7",fill:"white"})," "]})});if(e==="top")return(0,Co.jsxs)("div",{className:"w-full Co-20 aspect-[1920/332] overflow-hidden ",children:[(0,Co.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",className:m(t,"absolute "),style:{fontSize:0,float:"left",alignContent:"flex-end",transform:"scale(-1, 1)"},children:[(0,Co.jsx)("defs",{children:(0,Co.jsxs)("mask",{id:"mask",children:[(0,Co.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Co.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Co.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]}),(0,Co.jsx)("div",{className:"absolute -bottom-[5px] border-none left-0 w-full h-[6px] Co-10 bg-white"})]});if(e==="dark-top")return(0,Co.jsx)("div",{className:"w-full aspect-[1920/332] Co-20 content-end block overflow-hidden",children:(0,Co.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"xMidYMax meet",className:m(t,"relative "),style:{fontSize:0,float:"left"},transform:a[3],children:[(0,Co.jsx)("defs",{children:(0,Co.jsxs)("mask",{id:"mask",children:[(0,Co.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Co.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Co.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,Co.jsx)("div",{className:"w-full aspect-[1920/332] Co-20 content-start block overflow-hidden bg-white",children:(0,Co.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:m(t,"w-full block overflow-hidden"),children:(0,Co.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,Co.jsx)("div",{className:"w-full aspect-[1920/332] Co-20 content-end block overflow-hidden",children:(0,Co.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:m(t,"w-full block overflow-hidden"),transform:a[3],children:(0,Co.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,Co.jsx)("div",{className:"w-full aspect-[1920/332] Co-20 relative -bottom-[1px]",children:(0,Co.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:m(t,"w-full block overflow-hidden"),children:(0,Co.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})})},L0=({className:e})=>(0,Co.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 1245",className:m(e,"absolute w-full h-full"),children:[(0,Co.jsx)("defs",{children:(0,Co.jsxs)("mask",{id:"mask",children:[(0,Co.jsx)("rect",{width:"100%",height:"100%",fill:"black"}),(0,Co.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,Co.jsx)("rect",{width:"100%",height:"100%",fill:"black",mask:"url(#mask)"})]});var $m=({title:e,image:t})=>(0,Co.jsx)("div",{children:(0,Co.jsxs)("div",{className:"sticky top-0 h-[50vh] min-h-[400px]",children:[(0,Co.jsx)("div",{className:"fixed inset-0 container Nu-24 mb-8 Co-10 flex items-start justify-start",children:(0,Co.jsx)("h1",{className:"text-5xl md:text-6xl",children:e})}),(0,Co.jsxs)("div",{className:"fixed inset-0 h-[50vh] min-h-[400px] select-none",children:[t&&typeof t=="object"&&(0,Co.jsx)(Um.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,Co.jsx)("div",{children:(0,Co.jsx)(Um.default,{className:"-Co-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,Co.jsx)("span",{className:"absolute inset-0 bg-gradient-Co-b from-white dark:from-black"})]}),(0,Co.jsx)(ho,{className:"text-black Co-10",position:"header"})]})});var E0={highImpact:zm,lowImpact:Om,mediumImpact:Hm,sectionHero:$m},F0=e=>{let{type:t}=e||{};if(!t||t==="none")return null;let a=E0[t];return a?(0,Co.jsx)(a,{...e}):null};function z0({breadcrumbItems:e}){if(e&&e.length>0){let t=e.filter(a=>a.label.toLowerCase()!=="home");return(0,Co.jsx)("nav",{"aria-label":"Breadcrumb",className:"flex",children:(0,Co.jsxs)("ol",{role:"list",className:"flex items-center space-x-4",children:[(0,Co.jsx)("Co",{children:(0,Co.jsx)("div",{children:(0,Co.jsxs)("a",{href:"/",className:"text-foreground hover:text-accent",children:[(0,Co.jsx)(Ql.HomeIcon,{"aria-hidden":"true",className:"size-5 shrink-0"}),(0,Co.jsx)("span",{className:"sr-only",children:"Home"})]})})}),t.map((a,o)=>(0,Co.jsx)("Co",{children:(0,Co.jsxs)("div",{className:"flex items-center",children:[(0,Co.jsx)(Ql.ChevronRightIcon,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),a.href?(0,Co.jsx)("a",{href:a.href,className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label}):(0,Co.jsx)("div",{className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label})]})},o))]})})}return(0,Co.jsx)(Co.Fragment,{})}function ed(e,t){let[a,o]=(0,Zp.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),s=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,Zp.useEffect)(()=>{s(a)},[]),[a,s]}var td=require("react-icons/fa");function Lt({title:e,description:t,badge:a,primaryAction:o,secondaryAction:s,gradient:r,children:n,className:i}){let[l,c]=ed(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!s&&!t),d=!s&&!t||l;return(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${r} p-8 text-white ${i||""}`,children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,Co.jsx)(Z,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,Co.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-3",children:[d&&o&&(0,Co.jsx)(y,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(s||t)&&(0,Co.jsx)("button",{"aria-label":l?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>c(!l),style:{lineHeight:0},children:l?(0,Co.jsx)(td.FaChevronDown,{size:22}):(0,Co.jsx)(td.FaChevronUp,{size:22})})]})]}),!d&&(0,Co.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Co.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,Co.jsx)(y,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),s&&(0,Co.jsx)(y,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:s.onClick,children:s.label})]})]}),n&&(0,Co.jsx)("div",{className:"hidden lg:block",children:n})]})]})}var yo=require("@headlessui/react"),od=require("@heroicons/react/24/outline");var j0=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,Co.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-sm text-foreground group",children:(0,Co.jsxs)("span",{className:"relative",children:[e,(0,Co.jsx)("span",{className:"absolute -bottom-1 left-1/2 w-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,Co.jsxs)(yo.Popover,{children:[(0,Co.jsxs)(yo.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 text-foreground outline-none group",children:[(0,Co.jsxs)("span",{className:"relative",children:[e,(0,Co.jsx)("span",{className:"absolute bottom-0 left-1/2 w-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,Co.jsx)(Ql.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,Co.jsxs)(yo.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -Co-10 bg-popover Nu-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,Co.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 xl:gap-x-8 Co-50",children:t&&t.map(s=>(0,Co.jsxs)("div",{className:"group relative rounded-lg p-6 text-sm/6 box-border",children:[(0,Co.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:s.icon&&(0,Co.jsx)(bf,{icon:s.icon,size:"4x"})}),(0,Co.jsxs)("a",{href:s.href,className:"Nu-6 block text-popover-foreground group-hover:text-accent",children:[s.name,(0,Co.jsx)("span",{className:"absolute inset-0"})]}),(0,Co.jsx)("p",{className:"Nu-1 text-popover-foreground/80 group-hover:text-accent",children:s.description})]},s.name))}),a.length>0&&(0,Co.jsx)("div",{className:"bg-gray-50",children:(0,Co.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,Co.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(s=>(0,Co.jsxs)("a",{href:s.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:[s.icon&&(0,Co.jsx)(bf,{icon:s.icon,className:"h-5 w-5 flex-none text-gray-400"}),s.name]},s.name))})})})]})]}),bf=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,Co.jsx)(ja,{...e,size:a});if("src"in e)return(0,Co.jsx)("div",{className:m(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,Co.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},Ei=j0;var ad=["light","dark","green"];function H0({title:e,logo:t,menuItems:a}){let[o,s]=(0,Zp.useState)(!1),[r,n]=(0,Zp.useState)(!1),[i,l]=(0,Zp.useState)("light"),c=t?.split(".")[0],d=t?.split(".")[1],[p,u]=(0,Zp.useState)(`${c}.${d}`),g=f=>{ad.includes(f)?u(f==="light"?`${c}.${d}`:`${c}-${f}.${d}`):u(`${c}.${d}`)};(0,Zp.useEffect)(()=>{let f=localStorage.getItem("theme")||"light";l(f),document.documentElement.setAttribute("class",f),g(f)},[]);let h=()=>{let f=ad[(ad.indexOf(i)+1)%ad.length];l(f),document.documentElement.setAttribute("class",f),localStorage.setItem("theme",f),g(f)};return(0,Co.jsxs)("header",{className:"relative isolate Co-10 bg-background h-14",children:[(0,Co.jsxs)("nav",{"aria-label":"Global",className:"relative mx-auto flex items-center justify-between p-3 lg:px-8",children:[(0,Co.jsx)("div",{className:"flex lg:flex-1",children:(0,Co.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,Co.jsx)("span",{className:"sr-only",children:e}),(0,Co.jsx)("img",{alt:e,src:p,className:"h-9 w-auto"})]})}),(0,Co.jsx)("div",{className:"flex lg:hidden",children:(0,Co.jsxs)("button",{type:"button",onClick:()=>s(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 outline-none",children:[(0,Co.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,Co.jsx)(od.Bars3Icon,{"aria-hidden":"true",className:"h-6 w-6"})]})}),(0,Co.jsx)(yo.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:a.map(f=>(0,Co.jsx)(Ei,{...f},f.name))}),(0,Co.jsx)("div",{className:"hidden lg:flex lg:flex-1 lg:justify-end",children:(0,Co.jsx)("button",{onClick:h,className:"p-2 text-gray-700 outline-none",children:i==="dark"?(0,Co.jsx)(Ql.SunIcon,{className:"h-6 w-6"}):i==="green"?(0,Co.jsx)(Ql.MoonIcon,{className:"h-6 w-6"}):(0,Co.jsx)(Ql.SunIcon,{className:"h-6 w-6"})})})]}),(0,Co.jsxs)(yo.Dialog,{open:o,onClose:s,className:"lg:hidden",children:[(0,Co.jsx)("div",{className:"fixed inset-0 Co-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Co.jsxs)(yo.DialogPanel,{className:"fixed inset-y-0 right-0 Co-20 w-full overflow-y-auto bg-white px-6 py-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,Co.jsx)("span",{className:"sr-only",children:"Your Company"}),(0,Co.jsx)("img",{alt:e,src:t,className:"h-8 w-auto"})]}),(0,Co.jsxs)("button",{type:"button",onClick:()=>s(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 outline-none",children:[(0,Co.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,Co.jsx)(od.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Co.jsx)("div",{className:"Nu-6 flow-root",children:(0,Co.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,Co.jsx)("div",{className:"space-y-2 py-6",children:a.map(f=>(0,Co.jsx)(O0,{...f},f.name))})})})]})]})]})}function O0({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Co.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,Co.jsxs)(yo.Disclosure,{as:"div",className:"-mx-3",children:[(0,Co.jsx)(yo.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}),(0,Co.jsx)(yo.DisclosurePanel,{className:"Nu-2 space-y-2",children:t&&t.map(s=>(0,Co.jsx)(yo.DisclosureButton,{as:"a",href:s.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm font-semibold text-gray-900 hover:bg-gray-50",children:s.name},s.name))})]})}function U0({logoVideo:e,logoLight:t,logoDark:a,menuItems:o,title:s,subtitle:r}){let n=()=>{let i=document.getElementById("next-section");i&&i.scrollIntoView({behavior:"smooth"})};return(0,Co.jsx)("div",{children:(0,Co.jsxs)("div",{className:"sticky top-0 h-screen",children:[(0,Co.jsxs)("video",{className:"fixed inset-0 object-cover w-full h-full Co-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[(0,Co.jsx)("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),(0,Co.jsx)("div",{className:"fixed inset-0 h-full Co-10 flex flex-col items-start justify-center text-white px-4",children:(0,Co.jsx)(lo,{children:(0,Co.jsxs)("div",{className:"flex flex-col items-start md:w-2/3 mb-10 Co-0 md:mb-0",children:[(0,Co.jsx)("h1",{className:"text-5xl md:text-7xl mb-6",children:s&&s}),(0,Co.jsx)("div",{className:"text-lg md:text-2xl text-gray-300 mb-8 max-w-lg",children:r&&r})]})})}),(0,Co.jsx)(ho,{className:"text-black Co-10",position:"header"})]})})}var Vm=H(require("next/image"));function vs({logoLight:e,logoDark:t,mobile:a=!1}){return(0,Co.jsxs)(Ea,{href:"/",className:m(a?"py-1":"py-2"),children:[(0,Co.jsx)(Vm.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,Co.jsx)(Vm.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 Gm({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:s=!1,wide:r=!1}){let[n,i]=(0,Zp.useState)(!1),[l,c]=(0,Zp.useState)(""),d=["light","dark"],{theme:p,setTheme:u}=(0,gf.useTheme)();(0,Zp.useEffect)(()=>{c(p||"dark")},[p]);let g=()=>{let h=d[(d.indexOf(l)+1)%d.length];c(h),u(h)};return(0,Zp.useEffect)(()=>{let h=()=>{window.scrollY>100?i(!0):i(!1)};return window.addEventListener("scroll",h,{passive:!0}),()=>window.removeEventListener("scroll",h)},[]),(0,Co.jsx)(Co.Fragment,{children:(0,Co.jsx)("header",{className:`Co-50 pb-10 transition-all duration-300 hidden lg:block ${n||e?"translate-y-0":"-translate-y-full bg-transparent"}`,children:(0,Co.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,Co.jsxs)("div",{className:m("flex items-center justify-between px-9 py-0",!r&&"container"),children:[(0,Co.jsx)(vs,{logoDark:a,logoLight:t}),(0,Co.jsx)(yo.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:o&&o.map(h=>(0,Co.jsx)(Ei,{...h},h.name))}),s&&(0,Co.jsx)("button",{className:"fixed right-4 Co-[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:g,children:(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsx)(Nu.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,Co.jsx)(Nu.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var _m=["light","dark"];function Km({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[s,r]=(0,Zp.useState)(!1),{theme:n,setTheme:i}=(0,gf.useTheme)(),[l,c]=(0,Zp.useState)(!1),[d,p]=(0,Zp.useState)("light");(0,Zp.useEffect)(()=>{let g=()=>{window.scrollY>100?r(!0):r(!1)};return window.addEventListener("scroll",g,{passive:!0}),()=>window.removeEventListener("scroll",g)},[]),(0,Zp.useEffect)(()=>{p(n||"dark")},[n]);let u=()=>{let g=_m[(_m.indexOf(d)+1)%_m.length];p(g),i(g)};return(0,Co.jsx)(Co.Fragment,{children:(0,Co.jsxs)("header",{className:`Co-50 pb-10 transition-all duration-300 block lg:hidden ${s||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,Co.jsx)("nav",{className:m("backdrop-blur-sm text-white p-0",l&&"hidden"),children:(0,Co.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,Co.jsx)(vs,{logoDark:t,logoLight:e,mobile:!0}),(0,Co.jsx)("div",{className:"flex items-center space-x-4",children:(0,Co.jsxs)("button",{type:"button",onClick:()=>c(!0),className:"fixed right-4 Co-[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,Co.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,Co.jsx)(od.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,Co.jsxs)(yo.Dialog,{open:l,onClose:c,className:"lg:hidden",children:[(0,Co.jsx)("div",{className:"fixed inset-0 Co-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Co.jsxs)(yo.DialogPanel,{className:"fixed inset-y-0 right-0 Co-20 w-full overflow-y-auto bg-background dark:bg-[#212124] px-2 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,Co.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,Co.jsx)(vs,{logoDark:t,logoLight:e,mobile:!0}),(0,Co.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,Co.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,Co.jsx)(od.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Co.jsx)("div",{className:"Nu-6 flow-root",children:(0,Co.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,Co.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(g=>(0,Co.jsx)($0,{...g},g.name))})})})]})]})]})})}function $0({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Co.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,Co.jsxs)(yo.Disclosure,{as:"div",className:"-mx-3",children:[(0,Co.jsx)(yo.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,Co.jsx)(yo.DisclosurePanel,{className:"Nu-2 space-y-2",children:t&&t.map(s=>(0,Co.jsx)(yo.DisclosureButton,{as:"a",href:s.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:s.name},s.name))})]})}var PS=m("text-base/[1.75] transition-transform duration-350 hover:-translate-y-1 block px-4"),wf=m("text-brand-green text-md leading-[1.25] md:text-lg mb-5 md:mb-[1.5rem]"),Wm=m("bg-brand-green rounded-full p-3 Co-4 text-2xl"),Xm=m("flex items-center text-white gap-3"),id=m("transition-colors duration-300 hover:text-accent dark:hover:text-white");function V0({className:e,footerData:t,logoLight:a,logoDark:o}){let{about:s,columnOne:r,columnTwo:n,footerBottom:i}=t,l=void 0;return(0,Co.jsxs)("footer",{className:m("sticky Co-2 flex flex-col dark bg-black overflow-hidden Co-12 prose-base",e),children:[(0,Co.jsx)("div",{className:"py-16 md:py-20",children:(0,Co.jsx)("div",{className:"container",children:(0,Co.jsxs)("div",{className:"grid gap-10 md:grid-cols-2 xl:grid-cols-3",children:[(0,Co.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"200",children:[(0,Co.jsx)(vs,{logoDark:o,logoLight:a}),(0,Co.jsx)("p",{className:"mb-7 Nu-3",children:s.description}),s.socialLinks&&s.socialLinks.length>0&&(0,Co.jsx)("nav",{"aria-label":"social links",children:(0,Co.jsx)("ul",{className:"inline-flex pl-0 min-h-[50px] items-center rounded-5 text-white gap-2",children:s.socialLinks.map((c,d)=>(0,Co.jsx)("Co",{className:"bg-primary rounded-full p-3",children:(0,Co.jsx)(Ea,{"aria-label":c.href,className:"text-2xl",href:c.href,openNewTab:!0,children:(0,Co.jsx)("span",{children:c.icon})})},d))})})]}),(0,Co.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"400",children:[(0,Co.jsx)("h3",{className:wf,children:r.title}),r.links&&r.links.length>0&&(0,Co.jsx)("nav",{"aria-label":"footer links navigation",children:(0,Co.jsx)("ul",{className:"grid pl-0 gap-2",children:r.links.map(c=>(0,Co.jsxs)("Co",{className:"flex items-center gap-2.5",children:[(0,Co.jsx)("span",{className:"flex-none text-sm/[1] text-white",children:(0,Co.jsx)(og.FaChevronRight,{})}),(0,Co.jsx)(Ea,{href:c.href,openNewTab:c.openNewTab,className:id,children:c.label})]},c.label))})})]}),(0,Co.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"600",children:[(0,Co.jsx)("h3",{className:wf,children:n.title}),(0,Co.jsxs)("ul",{"aria-label":"addresses",className:"grid gap-2 pl-0",children:[(0,Co.jsxs)("Co",{className:Xm,children:[(0,Co.jsx)("span",{className:Wm,children:(0,Co.jsx)(og.FaPaperPlane,{})}),(0,Co.jsx)("address",{className:"not-italic",children:n.location})]}),(0,Co.jsxs)("Co",{className:Xm,children:[(0,Co.jsx)("span",{className:Wm,children:(0,Co.jsx)(og.FaEnvelope,{})}),n.mails&&n.mails.length>0&&(0,Co.jsx)("div",{className:"grid gap-1",children:n.mails.map((c,d)=>(0,Co.jsx)("a",{href:`mailto:${c}`,className:id,children:c},d))})]}),n.phoneNumbers&&n.phoneNumbers.length>0&&(0,Co.jsxs)("Co",{className:Xm,children:[(0,Co.jsx)("span",{className:Wm,children:(0,Co.jsx)(og.FaPhone,{})}),(0,Co.jsx)("div",{className:"grid gap-1",children:n.phoneNumbers.map((c,d)=>(0,Co.jsx)("a",{href:`tel:${c.split(" ").join("")}`,className:id,children:c},d))})]})]})]})]})})}),(0,Co.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,Co.jsx)("div",{className:"container",children:(0,Co.jsxs)("div",{className:"flex flex-wrap items-center text-Nu justify-between gap-x-8 gap-y-4 md:gap-x-10",children:[(0,Co.jsx)("p",{children:i.copyrightText}),i.links&&i.links.length>0&&(0,Co.jsx)("nav",{"aria-label":"footer bottom navigation",children:(0,Co.jsx)("ul",{className:"flex flex-wrap items-center gap-x-4 md:gap-x-7",children:i.links.map(c=>(0,Co.jsx)("Co",{children:(0,Co.jsx)(Ea,{"aria-label":`Go Co page ${c.label}`,href:c.href,openNewTab:c.openNewTab,className:id,children:c.label})},c.label))})})]})})})]})}function qm({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:s,wide:r,themeControl:n=!1}){return(0,Co.jsxs)("div",{className:m("fixed top-0 left-0 right-0 Co-50",s),children:[(0,Co.jsx)(Gm,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:n,wide:r}),(0,Co.jsx)(Km,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}function G0({menuItems:e,wide:t=!1,dark:a=!0}){return(0,Co.jsx)(Co.Fragment,{children:(0,Co.jsx)("menu",{className:m("w-full relative py-2 transition-all duration-300",a?"bg-black text-white":"light bg-background text-foreground border-b border-accent"),children:(0,Co.jsx)("div",{className:"container backdrop-blur-sm",children:(0,Co.jsx)("div",{className:m("flex items-center justify-between py-0",!t&&"container"),children:(0,Co.jsx)(yo.PopoverGroup,{className:"flex gap-x-12",children:e&&e.map(o=>(0,Co.jsx)(Ei,{...o},o.name))})})})})})}function Ym({leaveRequests:e,onApprove:t,onReject:a}){let[o,s]=(0,Zp.useState)([]),r=(0,zg.useRouter)(),n=()=>{o.length===e.length?s([]):s(e.map(d=>d.id))},i=d=>{s(p=>p.includes(d)?p.filter(u=>u!==d):[...p,d])},l=async()=>{let d=await t(o);d.success?(El.toast.success(d.message),r.refresh()):El.toast.error(`Error: ${d.message}`),s([])},c=async()=>{let d=await a(o);d.success?(El.toast.success(d.message),r.refresh()):El.toast.error(`Error: ${d.message}`),s([])};return(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"flex justify-between items-center",children:[(0,Co.jsx)("h2",{className:"text-2xl font-bold",children:"Approve Leave Requests"}),(0,Co.jsxs)("div",{className:"space-x-2",children:[(0,Co.jsx)(y,{onClick:l,disabled:o.length===0,variant:"default",children:"Approve Selected"}),(0,Co.jsx)(y,{onClick:c,disabled:o.length===0,variant:"destructive",children:"Reject Selected"})]})]}),(0,Co.jsx)("div",{className:"overflow-hidden sm:rounded-md",children:(0,Co.jsxs)("ul",{className:"divide-y divide-gray-200",children:[(0,Co.jsx)("Co",{className:"px-4 py-4 sm:px-6",children:(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsxs)("div",{className:"flex items-center",children:[(0,Co.jsx)(Qa,{id:"select-all",checked:o.length===e.length,onCheckedChange:n,className:"border-accent"}),(0,Co.jsx)("label",{htmlFor:"select-all",className:"ml-2 text-sm font-medium text-foreground",children:"Select All"})]}),(0,Co.jsxs)("span",{className:"text-sm font-medium text-gray-500",children:[o.length," of ",e.length," selected"]})]})}),e.map(d=>(0,Co.jsx)("Co",{className:"px-4 py-4 sm:px-6 group hover:bg-gray-50",children:(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsxs)("div",{className:"flex items-center",children:[(0,Co.jsx)(Qa,{id:`select-${d.id}`,checked:o.includes(d.id),onCheckedChange:()=>i(d.id),className:"border-accent"}),(0,Co.jsxs)("div",{className:"ml-3 flex items-center",children:[(0,Co.jsxs)(yt,{className:"h-10 w-10",children:[(0,Co.jsx)(aa,{src:d.userImage,alt:d.userName}),(0,Co.jsx)(xt,{children:d.userName.split(" ").map(p=>p[0]).join("")})]}),(0,Co.jsx)("div",{className:"ml-3",children:(0,Co.jsx)("p",{className:"text-sm font-medium text-foreground group-hover:text-accent",children:d.userName})})]})]}),(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsxs)("span",{className:"text-sm text-gray-500",children:[new Date(d.startDate).toLocaleDateString(),d.startDate!==d.endDate&&` - ${new Date(d.endDate).toLocaleDateString()}`,d.leaveType!="Full Day"&&` (${d.leaveType})`,` - ${d.totalDays} day${d.totalDays!==1?"s":""}`]}),(0,Co.jsx)(Z,{variant:d.status==="approved"?"default":d.status==="rejected"?"destructive":"secondary",children:d.status})]})]})},d.id))]})}),(0,Co.jsx)(El.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"Co-50"})]})}var Jm=require("date-fns");var Pf=[{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 Hn=e=>{let t=e.getDay()===0,a=e.getDay()===6,o=Pf.some(s=>s.date.toISOString()===e.toISOString());return t||a||o},Df=(e,t,a=!1)=>{let o=new Date(e),s=new Date(t),r=0;if(a&&!Hn(o))return .5;for(;o<=s;)Hn(o)||r++,o.setDate(o.getDate()+1);return r},Tf=(e,t)=>!e||!t?!1:e.toDateString()!==t.toDateString();var _0=({options:e,value:t,onChange:a,disabled:o=[]})=>(0,Co.jsx)("div",{className:"flex space-x-2",children:e.map((s,r)=>(0,Co.jsx)(y,{type:"button",variant:t===s?"default":"outline",onClick:()=>a(s),disabled:o[r],className:"flex-1 hover:bg-accent hover:text-accent-foreground",children:s},s))});function Zm({remainingDays:e,submitLeaveRequest:t}){let[a,o]=(0,Zp.useState)(new Date),[s,r]=(0,Zp.useState)(new Date),[n,i]=(0,Zp.useState)("Full Day"),[l,c]=(0,Zp.useState)(!1),[d,p]=(0,Zp.useState)(1),u=(0,zg.useRouter)();(0,Zp.useEffect)(()=>{let f=Tf(a,s);c(f),f&&i("Full Day")},[a,s]),(0,Zp.useEffect)(()=>{if(!a||!s){p(0);return}let f=Df(a,s,n!=="Full Day");p(f)},[a,s,n]);let g=f=>{i(f)};return(0,Co.jsxs)("div",{className:"max-w-2xl",children:[(0,Co.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Request Leave"}),(0,Co.jsxs)("p",{className:"text-sm text-gray-500 mb-4",children:["Remaining leave days: ",e]}),(0,Co.jsxs)("form",{onSubmit:async f=>{if(f.preventDefault(),!a||!s){El.toast.error("Please select both start and end dates");return}if(d>e){El.toast.error("You do not have enough leave days remaining");return}let b=new FormData;b.append("startDate",a.toISOString()),b.append("endDate",s.toISOString()),b.append("leaveType",n),b.append("duration",d.toString());let C=await(t||K0)(b);C.success?(El.toast.success(C.message),o(void 0),r(void 0),i("Full Day"),u.refresh()):El.toast.error(`Error: ${C.message}`)},className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"startDate",children:"Start Date"}),(0,Co.jsxs)(ns,{children:[(0,Co.jsx)(ls,{asChild:!0,children:(0,Co.jsxs)(y,{variant:"outline",className:m("w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[(0,Co.jsx)(Nu.CalendarIcon,{className:"Co-2 h-4 w-4"}),a?(0,Jm.format)(a,"PPP"):(0,Co.jsx)("span",{children:"Pick a date"})]})}),(0,Co.jsx)(Ir,{className:"w-auto p-0",align:"start",children:(0,Co.jsx)(ms,{mode:"single",selected:a,onSelect:f=>{o(f),f&&(!s||f>s)&&r(f)},initialFocus:!0})})]})]}),(0,Co.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"endDate",children:"End Date"}),(0,Co.jsxs)(ns,{children:[(0,Co.jsx)(ls,{asChild:!0,children:(0,Co.jsxs)(y,{variant:"outline",className:m("w-full justify-start text-left font-normal",!s&&"text-muted-foreground"),children:[(0,Co.jsx)(Nu.CalendarIcon,{className:"Co-2 h-4 w-4"}),s?(0,Jm.format)(s,"PPP"):(0,Co.jsx)("span",{children:"Pick a date"})]})}),(0,Co.jsx)(Ir,{className:"w-auto p-0",align:"start",children:(0,Co.jsx)(ms,{mode:"single",selected:s,onSelect:r,disabled:f=>a?f<a:!1,initialFocus:!0})})]})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Leave Type"}),(0,Co.jsx)(_0,{options:["Full Day","Morning","Afternoon"],value:n,onChange:g,disabled:[!1,l,l]})]}),(0,Co.jsxs)("p",{className:"text-sm text-gray-500",children:["Total days: ",d]}),(0,Co.jsx)(y,{disabled:d<=0,type:"submit",className:"w-full hover:bg-accent hover:text-accent-foreground",children:"Submit Request"})]}),(0,Co.jsx)(El.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"Co-50"})]})}var K0=async e=>{let t={};return e.forEach((a,o)=>{t[o]=a}),{success:!0,message:`Leave request submitted successfully for ${e.get("duration")}`}};function Af(...e){return e.filter(Boolean).join(" ")}function ep({currentDate:e,setCurrentDate:t,holidays:a,employees:o}){let s=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),r=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},n=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},i=()=>{t(new Date)},l=c=>c.toLocaleString("default",{weekday:"short"}).charAt(0);return(0,Co.jsxs)("div",{className:"px-4 sm:px-6 lg:px-8",children:[(0,Co.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,Co.jsxs)("div",{className:"sm:flex-auto",children:[(0,Co.jsx)("h1",{className:"text-2xl font-semibold text-accent",children:e.toLocaleString("default",{month:"long",year:"numeric"})}),(0,Co.jsx)("p",{className:"Nu-2 text-sm text-foreground",children:"All staff with holidays for the current month."})]}),(0,Co.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Co.jsxs)(y,{onClick:r,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Co.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,Co.jsx)(Nu.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,Co.jsx)(y,{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,Co.jsxs)(y,{onClick:n,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Co.jsx)("span",{className:"sr-only",children:"Next month"}),(0,Co.jsx)(Nu.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})]}),(0,Co.jsx)("div",{className:"Nu-8 flow-root",children:(0,Co.jsx)("div",{className:"-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8",children:(0,Co.jsx)("div",{className:"max-h-[60vh] overflow-y-auto",children:(0,Co.jsxs)("table",{className:"min-w-full border-separate border-spacing-0",children:[(0,Co.jsx)("thead",{className:"sticky top-0 Co-20 bg-white",children:(0,Co.jsxs)("Nu",{children:[(0,Co.jsx)("th",{scope:"col",className:"sticky left-0 top-0 Co-30 border-b border-r border-gray-300 bg-white bg-opacity-75 py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 lg:pl-8",children:"Employee"}),[...Array(s)].map((c,d)=>{let p=new Date(e.getFullYear(),e.getMonth(),d+1);return(0,Co.jsxs)("th",{scope:"col",className:`sticky top-0 Co-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 ${Hn(p)?"bg-gray-200":""}`,children:[(0,Co.jsx)("div",{children:l(p)}),(0,Co.jsx)("div",{children:d+1})]},d)})]})}),(0,Co.jsx)("tbody",{children:o.map((c,d)=>(0,Co.jsxs)("Nu",{children:[(0,Co.jsx)("td",{className:Af(d!==o.length-1?"border-gray-200":"","sticky left-0 Co-10 bg-white border-r pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8"),children:(0,Co.jsxs)("div",{className:"flex items-center",children:[(0,Co.jsxs)(yt,{className:"h-11 w-11",children:[(0,Co.jsx)(aa,{src:c.image,alt:c.name}),(0,Co.jsx)(xt,{children:c.name.split(" ").map(p=>p[0]).join("")})]}),(0,Co.jsx)("div",{className:"ml-4",children:(0,Co.jsx)("div",{className:"font-medium text-accent",children:c.name})})]})}),[...Array(s)].map((p,u)=>{let g=new Date(e.getFullYear(),e.getMonth(),u+1),h=a.find(f=>f.userId===c.id&&new Date(f.startDate)<=g&&new Date(f.endDate)>=g);return(0,Co.jsx)("td",{className:Af(d!==o.length-1?"border-r border-gray-200":"","whitespace-nowrap border-r border-gray-200",Hn(g)?"bg-gray-200":"bg-white"),children:(0,Co.jsx)("div",{className:`h-6 w-6 mx-auto rounded-full overflow-hidden ${h?h.status==="approved"?"bg-green-500":h.status==="rejected"?"bg-red-500":"bg-gray-600":"bg-gray-100"}`,title:h?`${c.name}: ${h.status} (${h.startDate} - ${h.endDate}) - ${h.leaveType}`:"",children:h&&h.leaveType!=="Full Day"&&(0,Co.jsx)("div",{className:`h-3 w-6 ${h.leaveType==="Morning","bg-white rounded-t-full"}`})})},`${c.id}-${u}`)})]},c.id))})]})})})})]})}function tp({currentDate:e,setCurrentDate:t,holidays:a}){let[o,s]=(0,Zp.useState)(null),r=(new Date(e.getFullYear(),e.getMonth(),1).getDay()+6)%7,n=Array.from({length:42},(d,p)=>{let u=new Date(e.getFullYear(),e.getMonth(),p-r+1);return{date:u,isCurrentMonth:u.getMonth()===e.getMonth(),isToday:u.toDateString()===new Date().toDateString(),holidays:a.filter(g=>new Date(g.startDate)<=u&&new Date(g.endDate)>=u)}}),i=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},l=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},c=()=>{t(new Date)};return(0,Co.jsxs)("div",{className:"lg:flex lg:h-full lg:flex-col",children:[(0,Co.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-6 py-4 lg:flex-none",children:[(0,Co.jsx)("h1",{className:"text-base font-semibold text-foreground",children:(0,Co.jsx)("time",{dateTime:e.toISOString(),children:e.toLocaleString("default",{month:"long",year:"numeric"})})}),(0,Co.jsx)("div",{className:"flex items-center",children:(0,Co.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Co.jsxs)(y,{onClick:i,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Co.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,Co.jsx)(Nu.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,Co.jsx)(y,{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,Co.jsxs)(y,{onClick:l,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Co.jsx)("span",{className:"sr-only",children:"Next month"}),(0,Co.jsx)(Nu.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})})]}),(0,Co.jsxs)("div",{className:"shadow ring-1 ring-black ring-opacity-5 lg:flex lg:flex-auto lg:flex-col",children:[(0,Co.jsxs)("div",{className:"grid grid-cols-7 gap-px border-b border-gray-300 bg-gray-200 text-center text-Nu font-semibold leading-6 text-gray-700 lg:flex-none",children:[(0,Co.jsxs)("div",{className:"bg-white py-2",children:["M",(0,Co.jsx)("span",{className:"sr-only sm:not-sr-only",children:"on"})]}),(0,Co.jsxs)("div",{className:"bg-white py-2",children:["T",(0,Co.jsx)("span",{className:"sr-only sm:not-sr-only",children:"Co"})]}),(0,Co.jsxs)("div",{className:"bg-white py-2",children:["W",(0,Co.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ed"})]}),(0,Co.jsxs)("div",{className:"bg-white py-2",children:["T",(0,Co.jsx)("span",{className:"sr-only sm:not-sr-only",children:"Co"})]}),(0,Co.jsxs)("div",{className:"bg-white py-2",children:["Co",(0,Co.jsx)("span",{className:"sr-only sm:not-sr-only",children:"Ti"})]}),(0,Co.jsxs)("div",{className:"bg-white py-2",children:["S",(0,Co.jsx)("span",{className:"sr-only sm:not-sr-only",children:"at"})]}),(0,Co.jsxs)("div",{className:"bg-white py-2",children:["S",(0,Co.jsx)("span",{className:"sr-only sm:not-sr-only",children:"un"})]})]}),(0,Co.jsxs)("div",{className:"flex bg-gray-200 text-Nu leading-6 text-gray-700 lg:flex-auto overflow-visible",children:[(0,Co.jsx)("div",{className:"hidden w-full lg:grid lg:grid-cols-7 lg:grid-rows-6 lg:gap-px overflow-visible",children:n.map(d=>(0,Co.jsxs)("div",{className:m(d.isCurrentMonth?"bg-white":"bg-gray-50 text-gray-500","relative px-3 py-2 overflow-visible"),children:[(0,Co.jsx)("time",{dateTime:d.date.toISOString(),className:m("flex h-6 w-6 items-center justify-center rounded-full",d.isToday&&"bg-indigo-600 font-semibold text-white"),children:d.date.getDate()}),d.holidays.length>0&&(0,Co.jsx)("ol",{className:"Nu-2 space-y-1 overflow-visible",children:d.holidays.map(p=>(0,Co.jsx)("Co",{className:"overflow-visible",children:(0,Co.jsx)("div",{className:`text-Nu px-1 py-0.5 rounded ${p.status==="approved"?"border-green-500":"border-gray-500"} border overflow-visible`,children:p.userName})},p.id))})]},d.date.toISOString()))}),(0,Co.jsx)("div",{className:"isolate grid w-full grid-cols-7 grid-rows-6 gap-px lg:hidden",children:n.map(d=>(0,Co.jsxs)("button",{type:"button",className:m(d.isCurrentMonth?"bg-white":"bg-gray-50",(d.date===o||d.isToday)&&"font-semibold",d.date===o&&"text-white",!d.date&&d.isToday&&"text-indigo-600",d.date!==o&&d.isCurrentMonth&&!d.isToday&&"text-gray-900",d.date!==o&&!d.isCurrentMonth&&!d.isToday&&"text-gray-500","flex h-14 flex-col px-3 py-2 hover:bg-gray-100 focus:Co-10"),children:[(0,Co.jsx)("time",{dateTime:d.date.toISOString(),className:m("ml-auto",d.date===o&&d.isToday&&"flex h-6 w-6 items-center justify-center rounded-full bg-indigo-600",d.date===o&&!d.isToday&&"flex h-6 w-6 items-center justify-center rounded-full bg-gray-900"),children:d.date.getDate()}),(0,Co.jsxs)("span",{className:"sr-only",children:[d.holidays.length," holidays"]}),d.holidays.length>0&&(0,Co.jsx)("span",{className:"-mx-0.5 Nu-auto flex flex-wrap-reverse",children:d.holidays.map(p=>(0,Co.jsx)("span",{className:`mx-0.5 mb-1 h-1.5 w-1.5 rounded-full ${p.status==="approved"?"bg-green-500":"bg-gray-500"}`},p.id))})]},d.date.toISOString()))})]})]})]})}var hs=require("lucide-react");function Mf(...e){return e.filter(Boolean).join(" ")}function W0({holidays:e,currentUser:t,currentDate:a,leaveApprovals:o,employees:s,submitLeaveRequest:r,approveLeave:n,rejectLeave:i}){let[l,c]=(0,Zp.useState)("Calendar View"),d=(0,zg.useRouter)(),p=!1,u=(0,Jm.parseISO)(a),g=async f=>{let b=(0,Jm.format)(f,"Jm-MM-yyyy"),C=new URL(window.location.href);return C.searchParams.set("date",b),d.push(C.toString()),{success:!0}};if(p)return(0,Co.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,Co.jsx)("div",{className:"animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-gray-900"})});let h=[{name:"Grid View",icon:hs.Grid,current:l==="Grid View"},{name:"Calendar View",icon:hs.CalendarDays,current:l==="Calendar View"},{name:"Request Leave",icon:hs.PlusCircle,current:l==="Request Leave"},{name:"Approve Leave",icon:hs.CheckSquare,current:l==="Approve Leave"}];return(0,Co.jsxs)("div",{className:"container mx-auto p-4 h-full",children:[(0,Co.jsxs)("div",{className:"mb-8",children:[(0,Co.jsxs)("div",{className:"sm:hidden",children:[(0,Co.jsx)("select",{value:l,onChange:f=>c(f.target.value),className:"block w-full rounded-md border-gray-300 py-2 pl-3 pr-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm",children:h.map(f=>(0,Co.jsx)("option",{children:f.name},f.name))}),(0,Co.jsx)(Nu.ChevronDown,{className:"pointer-events-none absolute right-3 top-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]}),(0,Co.jsx)("div",{className:"hidden sm:block",children:(0,Co.jsx)("div",{className:"border-b border-gray-200",children:(0,Co.jsx)("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:h.map(f=>(0,Co.jsxs)("a",{onClick:()=>{(f.name!=="Approve Leave"||t.grade==="Manager"||t.grade==="Senior Manager"||t.grade==="Partner")&&c(f.name)},className:Mf(f.current?"border-accent text-accent":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700",f.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":f.current?"page":void 0,children:[(0,Co.jsx)(f.icon,{className:Mf(f.current?"text-accent":"text-gray-400 group-hover:text-gray-500","-ml-0.5 Co-2 h-5 w-5"),"aria-hidden":"true"}),(0,Co.jsx)("span",{children:f.name})]},f.name))})})})]}),l==="Grid View"&&(0,Co.jsx)(ep,{currentDate:u,setCurrentDate:g,holidays:e,employees:s}),l==="Calendar View"&&(0,Co.jsx)(tp,{currentDate:u,setCurrentDate:g,holidays:e}),l==="Request Leave"&&(0,Co.jsx)(Zm,{remainingDays:t.remainingLeaveDays,submitLeaveRequest:f=>r?r(f):Promise.resolve({success:!1,message:"Submit leave request function not provided"})}),l==="Approve Leave"&&(0,Co.jsx)(Ym,{leaveRequests:o,onApprove:f=>n?n(f):Promise.resolve({success:!1,message:"Approve leave request function not provided"}),onReject:f=>i?i(f):Promise.resolve({success:!1,message:"Reject leave request function not provided"})})]})}function On({deal:e,users:t,customer:a,categories:o,onClose:s,onSave:r,onAddComment:n}){let[i,l]=(0,Zp.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[c,d]=(0,Zp.useState)(""),[p,u]=(0,Zp.useState)(!1),[g,h]=(0,Zp.useState)(null);(0,Zp.useEffect)(()=>{u(JSON.stringify(e)!==JSON.stringify(i))},[e,i]);let f=async()=>{try{let S=await r(i);S.success?(u(!1),h(null)):console.error("Failed Co save deal:",S.errors)}catch(S){console.error("Failed Co save deal:",S)}},b=(S,M)=>{l(K=>({...K,[S]:M}))},C=S=>{let M=(i.categories||[]).includes(S)?(i.categories||[]).filter(K=>K!==S):[...i.categories||[],S];b("categories",M)},T=async()=>{if(c.trim()){let S={text:c,timestamp:new Date().toISOString()};try{let M=await n(S);if(!M.success){console.error("Failed Co add comment:",M.errors);return}}catch(M){console.error("Failed Co add comment:",M)}l(M=>({...M,comments:[...M.comments||[],S]})),d("")}},x=S=>{switch(S){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"}},k=S=>t?.find(M=>M.id===Number(S));return(0,Co.jsx)(Bt,{open:!0,children:(0,Co.jsxs)(Dt,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,Co.jsxs)(Ft,{className:"flex flex-row items-center justify-between",children:[(0,Co.jsx)(zt,{className:"text-2xl font-bold",children:a?.name||"Co customer"}),(0,Co.jsxs)("div",{className:"flex space-x-2",children:[(0,Co.jsx)(y,{variant:"outline",onClick:s,children:"Close"}),(0,Co.jsxs)(y,{onClick:f,disabled:!p,children:[(0,Co.jsx)(Nu.SaveIcon,{className:"w-4 h-4 Co-2"}),"Save"]})]})]}),(0,Co.jsxs)(Yt,{className:"flex-grow pr-4",children:[(0,Co.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,Co.jsx)("div",{className:"grid gap-2 m-1",children:g==="value"?(0,Co.jsx)(G,{type:"number",value:i.value,onChange:S=>b("value",Number(S.target.value)),onBlur:()=>h(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,Co.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("value"),children:["\xA3",i.value?.toLocaleString()]})}),(0,Co.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Co.jsx)(B,{className:"text-sm font-medium text-accent",children:"Assignee"}),g==="assignee"?(0,Co.jsxs)(Le,{value:i?.assignee?.id?.toString()||"",onValueChange:S=>b("assignee",k(S)),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select assignee"})}),(0,Co.jsx)(Ie,{children:t&&t.map(S=>(0,Co.jsx)(Q,{value:S?.id?.toString()||"",children:S.name},S.id))})]}):(0,Co.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("assignee"),children:[(0,Co.jsx)(Nu.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,Co.jsx)("span",{children:i?.assignee?.name})]})]}),(0,Co.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Co.jsx)(B,{className:"text-sm font-medium text-accent",children:"Closure Date"}),g==="closureDate"?(0,Co.jsx)(G,{type:"date",value:i.closureDate?.split("T")[0]??"",onChange:S=>b("closureDate",S.target.value),onBlur:()=>h(null),className:"Co-2",autoFocus:!0}):(0,Co.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("closureDate"),children:[(0,Co.jsx)(Nu.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,Co.jsx)("span",{children:i.closureDate?new Date(i.closureDate).toLocaleDateString("en-GB"):"Co/A"})]})]})]}),(0,Co.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,Co.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Co.jsx)(B,{className:"text-sm font-medium text-accent",children:"Description"}),g==="description"?(0,Co.jsx)(st,{value:i.description||"",onChange:S=>b("description",S.target.value),onBlur:()=>h(null),className:"min-h-[100px]",autoFocus:!0}):(0,Co.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>h("description"),children:i.description})]})}),(0,Co.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 Co-2 gap-4",children:[(0,Co.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Co.jsx)(B,{className:"text-sm font-medium text-accent",children:"Status"}),g==="status"?(0,Co.jsxs)(Le,{value:i.status,onValueChange:S=>{b("status",S),h(null)},children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select status"})}),(0,Co.jsx)(Ie,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(S=>(0,Co.jsx)(Q,{value:S,children:S},S))})]}):(0,Co.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("status"),children:i.status})]}),(0,Co.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,Co.jsx)(B,{className:"text-sm font-medium text-accent",children:"Categories"}),g==="categories"?(0,Co.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:o.map(S=>(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)(Qa,{id:S.id?.toString()||"",checked:(i.categories||[]).some(M=>M.id===S.id),onCheckedChange:()=>S.id!==void 0&&C(S)}),(0,Co.jsx)("label",{htmlFor:(S.id??"").toString(),className:`text-sm font-medium ${x(S.type||"sector")} px-2 py-1 rounded`,children:S.name})]},S.id))}):(0,Co.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("categories"),children:i.categories&&i.categories.map(S=>{let M=S;return M?(0,Co.jsx)(Z,{variant:"outline",className:x(M.type||"sector"),children:M.name},M.id):null})})]}),(0,Co.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Co.jsx)(B,{className:"text-sm font-medium text-accent",children:"COGE Status"}),g==="gecoStatus"?(0,Co.jsxs)(Le,{value:i.gecoStatus??void 0,onValueChange:S=>{b("gecoStatus",S),h(null)},children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select status"})}),(0,Co.jsx)(Ie,{children:["firm","forecast","other"].map(S=>(0,Co.jsx)(Q,{value:S,children:S.charAt(0).toUpperCase()+S.slice(1)},S))})]}):(0,Co.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("gecoStatus"),children:i.gecoStatus?i.gecoStatus.charAt(0).toUpperCase()+i.gecoStatus.slice(1):"Co/A"})]})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 Co-4 gap-4",children:[(0,Co.jsxs)("div",{className:"grid gap-2",children:[(0,Co.jsx)(B,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,Co.jsx)(Yt,{className:"h-[200px] overflow-y-auto",children:(0,Co.jsx)("div",{className:"space-y-2",children:i.comments&&i.comments.slice().sort((S,M)=>new Date(M.timestamp||"").getTime()-new Date(S.timestamp||"").getTime()).map(S=>(0,Co.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,Co.jsx)("p",{className:"text-sm text-foreground",children:S.text}),(0,Co.jsxs)("p",{className:"text-Nu text-foreground Nu-1",children:[S?.author?.name," - ",new Date(S.timestamp||"").toLocaleString()]})]},S.id))})}),(0,Co.jsxs)("div",{className:"flex Nu-2",children:[(0,Co.jsx)(G,{value:c,onChange:S=>d(S.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,Co.jsxs)(y,{onClick:T,className:"ml-2",children:[(0,Co.jsx)(Nu.PlusIcon,{className:"w-4 h-4 Co-2"}),"Add"]})]})]}),(0,Co.jsxs)("div",{className:"text-Nu text-gray-500 Nu-4",children:["Last modified: ",new Date(i.updatedAt||"").toLocaleString()]})]})]})]})})}function ap({deal:e,customer:t,categories:a,onClick:o,compact:s=!1}){let r=a.find(n=>n.type==="proposition"&&(e.categories??[]).includes(n.id));return s?(0,Co.jsxs)(j,{className:"mb-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Co.jsxs)(be,{className:"pb-1 Co-2",children:[(0,Co.jsx)(xe,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,Co.jsx)("p",{className:"text-sm text-foreground Nu-1",children:e.description})]}),(0,Co.jsx)(ae,{className:"text-Nu text-gray-200 pb-2",children:(0,Co.jsx)("div",{className:"flex justify-between items-center mb-1",children:(0,Co.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,Co.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,Co.jsxs)(j,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Co.jsxs)(be,{className:"pb-2",children:[(0,Co.jsx)("div",{className:"flex justify-between items-center",children:(0,Co.jsx)(xe,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,Co.jsx)("p",{className:"text-sm text-foreground Nu-1",children:e.description})]}),(0,Co.jsxs)(ae,{children:[(0,Co.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,Co.jsxs)("div",{className:"flex items-center text-sm text-foreground",children:[(0,Co.jsx)(Nu.UserIcon,{className:"w-4 h-4 Co-1 text-Nu"}),(0,Co.jsx)("span",{children:e.assignee.name})]}),(0,Co.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,Co.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,Co.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,Co.jsxs)("div",{className:"flex items-center text-Nu text-gray-200",children:[(0,Co.jsx)(Nu.CalendarIcon,{className:"w-3 h-3 Co-1"}),(0,Co.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,Co.jsx)("div",{className:"flex justify-between items-left",children:r&&(0,Co.jsx)(Z,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-Nu",children:r.name})})]})]})}var md=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Un({status:e,deals:t,users:a,customers:o,categories:s,onDealClick:r,calculateColumnValue:n,calculateWeightedValue:i,compact:l=!1}){return(0,Co.jsxs)("div",{className:"flex flex-col w-80",children:[(0,Co.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),(0,Co.jsx)(md.Droppable,{droppableId:e,isDropDisabled:!1,children:c=>(0,Co.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((d,p)=>(0,Co.jsx)(md.Draggable,{draggableId:d.id.toString(),index:d.id,children:u=>(0,Co.jsx)("div",{ref:u.innerRef,...u.draggableProps,...u.dragHandleProps,children:(0,Co.jsx)(ap,{deal:d,customer:d.customer,categories:s,onClick:()=>r(d),compact:l})})},d.id.toString())),c.placeholder]})}),(0,Co.jsxs)("div",{className:"Nu-4 text-sm p-3 rounded-lg shadow",children:[(0,Co.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,Co.jsxs)("span",{className:"text-green-600",children:["\xA3",n(t).toLocaleString()]})]}),(0,Co.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,Co.jsxs)("span",{className:"text-blue-600",children:["\xA3",i(t,e).toLocaleString()]})]})]})]})}var X0=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost","Dormant"];function q0({initialData:e,addNewDeal:t,updateDeal:a,addComment:o,addNewCustomer:s}){let[r,n]=(0,Zp.useState)(null),i=p=>(e.deals??[]).filter(u=>u.status===p),l=p=>p.reduce((u,g)=>u+(g.value||0),0),c=(p,u)=>{let g={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0,Dormant:0};return p.reduce((h,f)=>h+(f.value||0)*g[u],0)},d=(0,Zp.useCallback)(p=>{let{source:u,destination:g}=p;if(!g||u.droppableId===g.droppableId&&u.index===g.index)return;let h=u.droppableId,f=g.droppableId,b=e.deals?.filter(T=>T.id===u.index)[0],C=[...e.deals??[]];b&&(b.status=f,a(b))},[a]);return(0,Co.jsx)(md.DragDropContext,{onDragEnd:d,children:(0,Co.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,Co.jsx)("div",{className:"flex space-x-4 pb-4",children:X0.filter(p=>p!=="Lost").map(p=>{let u=i(p);return(0,Co.jsx)(Un,{status:p,deals:u,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:n,calculateColumnValue:l,calculateWeightedValue:c},p)})}),r&&(0,Co.jsx)(On,{deal:r,users:e.users,customer:r.customer,categories:e.categories??[],onClose:()=>n(null),onSave:a,onAddComment:p=>o(r.id.toString(),p)})]})})}function op({onSubmit:e}){let[t,a]=(0,Zp.useState)({name:"",intro:"",active:!1});return(0,Co.jsxs)("form",{onSubmit:s=>{s.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,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"customerName",children:"Customer Name"}),(0,Co.jsx)(G,{id:"customerName",value:t.name,onChange:s=>a({...t,name:s.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"customerIntro",children:"Intro"}),(0,Co.jsx)(st,{id:"customerIntro",value:t.intro??"",onChange:s=>a({...t,intro:s.target.value}),placeholder:"Enter customer intro"})]}),(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)(Qa,{id:"activeCustomer",checked:!!t.active,onCheckedChange:s=>a({...t,active:s})}),(0,Co.jsx)(B,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,Co.jsx)(y,{type:"submit",className:"w-full",children:"Add Customer"})]})}function Y0({customers:e,users:t,categories:a,onSubmit:o,initialDeal:s,onAddCustomer:r,onClose:n}){let[i,l]=(0,Zp.useState)(s||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[c,d]=(0,Zp.useState)(!1),[p,u]=(0,Zp.useState)({});(0,Zp.useEffect)(()=>{s&&l(s)},[s]);let g=()=>{let x={};return i.customer||(x.customer="Customer Co required"),i.value||(x.value="Value Co required"),i.assignee||(x.assignee="Assignee Co required"),i.closureDate||(x.closureDate="Closure Date Co required"),u(x),Object.keys(x).length===0},h=async x=>{x.preventDefault(),u({});try{if(g()){let k=await o({...i});k.success?(l({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),n?.()):u(k.errors||{})}}catch{u({submit:"An error occurred while submitting the form."})}},f=x=>{l(k=>({...k,categories:(k.categories||[]).includes(x.id)?(k.categories||[]).filter(S=>S!==x.id):[...k.categories||[],x.id]}))},b=async x=>{l({...i,customer:x});try{let k=await r(x);k.success?d(!1):u(k.errors||{})}catch{u({submit:"An error occurred while submitting the form."})}},C=x=>t?.find(k=>k.id===Number(x)),T=x=>e?.find(k=>k.id===Number(x));return(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsxs)("form",{onSubmit:h,className:"space-y-6",children:[(0,Co.jsx)(Yt,{className:"h-[60vh] pr-4",children:(0,Co.jsxs)("div",{className:"space-y-6 px-4",children:[(0,Co.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Co.jsx)(B,{htmlFor:"customer",children:"Customer"}),(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsxs)(Le,{value:i.customer?.id?.toString(),onValueChange:x=>l({...i,customer:T(x)}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select customer"})}),(0,Co.jsx)(Ie,{children:e.map(x=>(0,Co.jsx)(Q,{value:x.id?.toString()||"",children:x.name},x.id))})]}),(0,Co.jsx)(y,{variant:"outline",size:"icon",onClick:()=>d(!0),children:(0,Co.jsx)(Nu.PlusIcon,{className:"w-5 h-5"})})]}),p.customerId&&(0,Co.jsx)("p",{className:"text-red-500 text-sm",children:p.customerId})]}),(0,Co.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Co.jsx)(B,{htmlFor:"value",children:"Value"}),(0,Co.jsx)(G,{id:"value",type:"number",value:i.value||"",onChange:x=>l({...i,value:Number.parseFloat(x.target.value)}),placeholder:"Enter deal value"}),p.value&&(0,Co.jsx)("p",{className:"text-red-500 text-sm",children:p.value})]}),(0,Co.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Co.jsx)(B,{htmlFor:"assignee",children:"Assignee"}),(0,Co.jsxs)(Le,{value:i.assignee?.id?.toString(),onValueChange:x=>l({...i,assignee:C(x)}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select assignee"})}),(0,Co.jsx)(Ie,{children:t&&t.map(x=>(0,Co.jsx)(Q,{value:x.id?.toString()||"",children:x.name},x.id))})]}),p.assignee&&(0,Co.jsx)("p",{className:"text-red-500 text-sm",children:p.assignee})]}),(0,Co.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Co.jsx)(B,{htmlFor:"description",children:"Description"}),(0,Co.jsx)(st,{id:"description",value:i.description||"",onChange:x=>l({...i,description:x.target.value}),placeholder:"Enter deal description"})]}),(0,Co.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Co.jsx)(B,{children:"Categories"}),(0,Co.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(x=>(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)("h4",{className:"text-sm font-medium",children:x.charAt(0).toUpperCase()+x.slice(1)}),(0,Co.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.filter(k=>k.type===x).map(k=>(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)(Qa,{id:k.id.toString(),checked:i.categories?.includes(k.id),onCheckedChange:()=>f(k)}),(0,Co.jsx)("label",{htmlFor:k.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:k.name})]},k.id))})]},x))})]}),(0,Co.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Co.jsx)(B,{htmlFor:"closureDate",children:"Closure Date"}),(0,Co.jsx)(G,{id:"closureDate",type:"date",value:i.closureDate||"",onChange:x=>l({...i,closureDate:x.target.value})}),p.closureDate&&(0,Co.jsx)("p",{className:"text-red-500 text-sm",children:p.closureDate})]})]})}),(0,Co.jsx)(y,{type:"submit",className:"w-full",children:s?"Update Deal":"Add Deal"})]}),(0,Co.jsx)(Bt,{open:c,onOpenChange:d,children:(0,Co.jsxs)(Dt,{children:[(0,Co.jsx)(Ft,{children:(0,Co.jsx)(zt,{children:"Add New Customer"})}),(0,Co.jsx)(op,{onSubmit:b})]})})]})}var J0=["firm","forecast","other"];function Q0({initialData:e,updateDeal:t,addComment:a}){let[o,s]=(0,Zp.useState)(null),r=c=>(e.deals??[]).filter(d=>d.gecoStatus===c).filter(d=>d.status!=="Lost").filter(d=>d.status!=="Cold"),n=c=>c.reduce((d,p)=>d+(p.value||0),0),i=(c,d)=>{let p={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0,Dormant:0};return c.reduce((u,g)=>u+(g.value||0)*(p[g.status]??0),0)},l=(0,Zp.useCallback)(c=>{let{source:d,destination:p}=c;if(!p||d.droppableId===p.droppableId&&d.index===p.index)return;let u=d.droppableId,g=p.droppableId,h=e.deals?.filter(b=>b.id===d.index)[0],f=[...e.deals??[]];h&&(h.gecoStatus=g,t(h))},[t]);return(0,Co.jsx)(md.DragDropContext,{onDragEnd:l,children:(0,Co.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,Co.jsx)("div",{className:"flex space-x-4 pb-4",children:J0.map(c=>{let d=r(c);return(0,Co.jsx)(Un,{status:c,deals:d,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:s,calculateColumnValue:n,calculateWeightedValue:i,compact:!0},c)})}),o&&(0,Co.jsx)(On,{deal:o,users:e.users,customer:o.customer,categories:e.categories??[],onClose:()=>s(null),onSave:t,onAddComment:c=>a(o.id.toString(),c)})]})})}var Vf=H(require("react"));function Of({taskId:e,polling:t=!0,system:a="payload"}){let[o,s]=(0,Zp.useState)(null),[r,n]=(0,Zp.useState)(!1),[i,l]=(0,Zp.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 Co fetch task: ${u.statusText}`);let g=await u.json();s(g)}catch(u){console.error("Error fetching task:",u),l(u instanceof Error?u:new Error("Unknown error occurred"))}finally{p&&n(!1)}}},d=()=>c(!1);return(0,Zp.useEffect)(()=>{e&&c(!0);let p=null;return e&&t&&(p=setInterval(d,5e3)),()=>{p&&clearInterval(p)}},[e,t]),{task:o,loading:r,error:i}}var Z0=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"}},ey=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function $n({data:e}){let{id:t,system:a,fetchLatest:o,taskData:s,error:r}=e||{};if(!t)return null;let n=null,i=!0,l=r,c=o!==void 0?o:!0;if(n=s||{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:l}),c){let{task:g,loading:h,error:f}=Of({taskId:t,system:a});n=g,i=h,l=f}else i=!1;let d=Z0(n?.status||"todo"),p=ey(n?.status||"todo"),u=n?.dateLogged||new Date().toISOString();try{let g=new Date(n?.dateLogged||"");isNaN(g.getTime())||(u=(0,$f.formatDistanceToNow)(g,{addSuffix:!0}))}catch{}return(0,Co.jsxs)(j,{className:m("w-full max-w-md shadow-md",l&&"border border-destructive"),children:[(0,Co.jsxs)(be,{className:"pb-2",children:[(0,Co.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Co.jsx)(xe,{className:"text-lg font-semibold",children:i?"Loading...":n?.name||"Task"}),(0,Co.jsx)(Z,{className:`${d}`,children:p})]}),n?.project&&(0,Co.jsxs)(Ko,{className:"text-sm text-gray-500",children:["Project: ",n.project.name]})]}),(0,Co.jsx)(ae,{className:"pb-2",children:i?(0,Co.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):l?(0,Co.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Co.jsx)("p",{className:"text-sm text-foreground",children:n?.description||"......."})}),(0,Co.jsx)(vo,{className:"Co-2 flex items-center justify-between",children:(0,Co.jsxs)("div",{className:"flex items-center text-Nu text-gray-500",children:[(0,Co.jsx)(Nu.Clock,{className:"h-3 w-3 Co-1"}),(0,Co.jsxs)("span",{children:["Created ",u]}),(0,Co.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Co.jsxs)("span",{children:["Task #",t]})]})})]})}var ty={task:$n},ay=`
|
|
19
|
+
dark bg-background text-primary`,children:[(0,Co.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[a&&(0,Co.jsx)("img",{src:a.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,Co.jsx)("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),(0,Co.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]})})]})}),(0,Co.jsx)("div",{ref:r,className:"preview-container"})]})},Qg=({page:e,layout:t="portrait"})=>{let{contentWithIds:a}=ui(e),o=(0,Zp.useRef)(null),s=(0,Zp.useRef)(null),r=(0,Zp.useRef)(new j1.Previewer),[n,i]=(0,Zp.useState)(0),c=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...a],d=(0,Zp.useCallback)(()=>{o.current&&(o.current&&(o.current.innerHTML=""),r.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.js error:",p)))},[t]);return(0,Zp.useEffect)(()=>{r.current=new j1.Previewer,d()},[d,t]),(0,Zp.useEffect)(()=>{let p=document.createElement("style");return p.textContent=`@page { size: A4 ${t} ; margin: 0mm; };`,document.head.appendChild(p),()=>{document.head.removeChild(p)}},[]),(0,Co.jsxs)("div",{className:"pagedjs-container",children:[(0,Co.jsx)("div",{id:"printable-content",ref:s,style:{display:"none"},className:"pagedjs-content",children:c.map((p,u)=>(0,Co.jsx)(Co.Fragment,{children:u===0?(0,Co.jsx)("section",{className:"pagedjs-section title-page w-full h-full",children:(0,Co.jsx)(Ln,{hero:e.hero,title:e.title})},u):(0,Co.jsxs)("section",{className:m("pagedjs-section normal-page h-[699px]",`h-[${C0("185mm")}px]`,p.theme?.settings?.theme==="dark"?"dark":"light"),children:[p.blockName&&(0,Co.jsx)(Bn,{title:p.blockName}),(0,Co.jsx)(fs,{blocks:[p],fill:!0})]},u)}))}),(0,Co.jsx)("div",{ref:o,className:"preview-container"})]})};var Im=H(require("clsx"));function k0({mainNav:e,secondaryNav:t,title:a,subTitle:o,pathName:s,menuHeading:r,onNavClick:n,loading:i=!1,LinkComponent:l,...c}){let p=l?u=>(0,Co.jsx)(l,{...u}):n?({href:u,children:g,...h})=>(0,Co.jsx)("button",{onClick:()=>n&&n(u),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...h,children:g}):u=>(0,Co.jsx)("a",{...u});return(0,Co.jsxs)(kr,{...c,variant:"inset",children:[(0,Co.jsx)(Sr,{children:(0,Co.jsx)(Ia,{children:(0,Co.jsx)(ga,{children:i?(0,Co.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Co.jsx)(dt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,Co.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Co.jsx)("span",{className:"truncate font-semibold",children:a}),o&&(0,Co.jsx)("span",{className:"truncate text-sm",children:o})]})})})}),i&&(0,Co.jsxs)(Uo,{children:[(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,Co.jsxs)(Uo,{children:[e&&!i&&e.map((u,g)=>(0,Co.jsx)(S0,{subNav:u,pathName:s,Link:p},g)),(0,Co.jsx)(Xa,{className:"Nu-auto",children:(0,Co.jsx)(go,{children:(0,Co.jsx)(Ia,{children:t&&!i&&t.map(u=>(0,Co.jsx)(ga,{children:(0,Co.jsx)(qa,{asChild:!0,size:"sm",children:(0,Co.jsxs)(p,{href:u.url||"",children:[u.icon&&(0,Co.jsx)(u.icon,{}),(0,Co.jsx)("span",{children:u.label})]})})},u.label))})})})]}),(0,Co.jsx)(Pr,{})]})}function S0({subNav:e,pathName:t,Link:a}){let o=e,s=!1;return o.links&&o.links.map(r=>{r.url===t&&(s=!0)}),(0,Co.jsx)(ko,{defaultOpen:!0,className:"group/collapsible",children:(0,Co.jsx)(Xa,{className:"py-0",children:(0,Co.jsx)(Ia,{children:(0,Co.jsx)(ko,{asChild:!0,defaultOpen:o.isActive,children:(0,Co.jsxs)(ga,{children:[(0,Co.jsx)(qa,{asChild:!0,tooltip:o.label,className:(0,Im.default)(s&&"font-bold text-accent"),children:(0,Co.jsxs)(a,{href:o.url,children:[o.icon&&(0,Co.jsx)(o.icon,{}),(0,Co.jsx)("span",{children:o.label})]})}),o.links?.length?(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(or,{asChild:!0,children:(0,Co.jsxs)(Ls,{className:"data-[state=open]:rotate-90",children:[(0,Co.jsx)(Nu.ChevronRight,{}),(0,Co.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,Co.jsx)(rr,{children:(0,Co.jsx)(sr,{children:o.links?.map(r=>(0,Co.jsx)(ir,{children:(0,Co.jsx)(nr,{asChild:!0,className:(0,Im.default)(r.url===t&&"font-bold text-accent"),children:(0,Co.jsx)(a,{href:r.url,children:(0,Co.jsx)("span",{children:r.label})})})},r.label))})})]}):null]})},o.label)})})})}var ef=H(require("clsx"));var P0=()=>(0,Co.jsx)(ja,{iconName:"github",size:"10x"});function D0({relatedContent:e,tableOfContents:t,editorComponent:a,loading:o=!1,editMode:s=!1,onAddDocument:r,onEditDocument:n,onPrintDocument:i,onGithubClick:l,onNavClick:c,LinkComponent:d,...p}){let h=d?f=>(0,Co.jsx)(d,{...f}):c?({item:f,children:b,...C})=>(0,Co.jsx)("button",{onClick:()=>c&&c(f),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...C,children:b}):f=>(0,Co.jsx)("a",{href:f.href,...f});return(0,Co.jsxs)(kr,{side:"right",variant:"inset",...p,children:[(0,Co.jsxs)(Sr,{className:"border-b border-sidebar-border",children:[(0,Co.jsxs)(Ia,{className:"flex-row space-x-1",children:[(0,Co.jsx)(ga,{children:(0,Co.jsxs)(qa,{onClick:r,children:[(0,Co.jsx)(Nu.FilePlus,{})," ",(0,Co.jsx)("span",{children:"Add Document"})]})}),l&&(0,Co.jsx)(ga,{children:(0,Co.jsx)(qa,{onClick:l,tooltip:"Open in GitHub",children:(0,Co.jsx)(P0,{})})})]}),(0,Co.jsxs)(Ia,{className:"flex-row space-x-1",children:[(0,Co.jsx)(ga,{className:"w-5/12",children:(0,Co.jsxs)(qa,{onClick:()=>n(),variant:s?"outline":"default",className:(0,ef.default)(s&&"text-accent"),children:[(0,Co.jsx)(Nu.Edit,{})," ",(0,Co.jsx)("span",{children:"Edit"})]})}),(0,Co.jsx)(ga,{className:"w-5/12",children:(0,Co.jsxs)(qa,{onClick:i,children:[(0,Co.jsx)(Nu.Printer,{})," ",(0,Co.jsx)("span",{children:"Print"})]})})]})]}),a&&(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(ko,{defaultOpen:!0,className:"group/collapsible",children:(0,Co.jsxs)(Xa,{children:[(0,Co.jsx)(Dr,{asChild:!0,children:(0,Co.jsxs)(or,{children:["Editor Controls",(0,Co.jsx)(Nu.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Co.jsx)(go,{children:(0,Co.jsx)(rr,{children:a})})]})}),(0,Co.jsx)(vn,{className:"mx-0"})]}),(0,Co.jsxs)(Uo,{className:"overflow-auto",children:[o&&(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsxs)(Xa,{children:[(0,Co.jsx)(Dr,{children:"Related Content"}),(0,Co.jsx)(go,{children:(0,Co.jsx)(Ia,{children:Array.from({length:3}).map((f,b)=>(0,Co.jsx)(ga,{children:(0,Co.jsx)(dt,{className:"bg-gray-200 w-full h-10"})},b))})})]}),(0,Co.jsxs)(Xa,{children:[(0,Co.jsx)(Dr,{children:"Table of Contents"}),(0,Co.jsx)(go,{children:(0,Co.jsx)(Ia,{children:Array.from({length:3}).map((f,b)=>(0,Co.jsx)(ga,{children:(0,Co.jsx)(dt,{className:"bg-gray-200 w-full h-10"})},b))})})]})]}),e&&!o&&Object.keys(e).length>0&&(0,Co.jsx)(ko,{defaultOpen:!0,className:"group/collapsible",children:(0,Co.jsxs)(Xa,{children:[(0,Co.jsx)(Dr,{asChild:!0,children:(0,Co.jsxs)(or,{children:["Related Content",(0,Co.jsx)(Nu.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Co.jsx)(go,{children:(0,Co.jsx)(rr,{children:(0,Co.jsx)(Ia,{children:e&&Object.keys(e).map(f=>(0,Co.jsxs)(ga,{children:[(0,Co.jsxs)("span",{className:"p-2 text-Nu text-sidebar-foreground",children:[" ",f.charAt(0).toUpperCase()+f.slice(1)]}),f&&e[f]&&(0,Co.jsx)(sr,{children:e[f].map(b=>(0,Co.jsx)(ir,{children:(0,Co.jsx)(nr,{asChild:!0,isActive:!1,size:"sm",children:(0,Co.jsxs)(h,{href:b.url,item:b,className:"flex justify-between items-center w-full text-Nu",children:[(0,Co.jsx)("span",{children:b.label}),b.type==="note"&&(0,Co.jsx)(Nu.PencilLine,{className:"ml-2 text-gray-400 !important",size:16}),b.type==="draft"&&(0,Co.jsx)(ja,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},b.label))})]},f))})})})]})}),t&&!o&&(0,Co.jsx)(ko,{defaultOpen:!0,className:"group/collapsible",children:(0,Co.jsxs)(Xa,{children:[(0,Co.jsx)(Dr,{asChild:!0,children:(0,Co.jsxs)(or,{children:["Table of Contents",(0,Co.jsx)(Nu.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Co.jsx)(go,{children:(0,Co.jsx)(rr,{children:(0,Co.jsx)(Ia,{children:t.map(f=>(0,Co.jsxs)(ga,{children:[(0,Co.jsx)(qa,{asChild:!0,children:(0,Co.jsx)("a",{href:`#${f.url}`,className:"text-Nu",children:f.title})}),f.items?.length?(0,Co.jsx)(sr,{children:f.items.map(b=>(0,Co.jsx)(ir,{children:(0,Co.jsx)(nr,{asChild:!0,isActive:b.isActive,size:"sm",children:(0,Co.jsx)("a",{href:`#${b.url}`,className:"flex justify-between items-center w-full text-Nu",children:(0,Co.jsx)("span",{children:b.title})})})},b.title))}):null]},f.title))})})})]})})]}),(0,Co.jsx)(Pr,{})]})}var af=H(require("next/image"));function T0({title:e,members:t}){return(0,Co.jsx)(j,{className:"mb-6",children:(0,Co.jsxs)("div",{className:"p-6",children:[(0,Co.jsxs)("div",{className:"flex items-center mb-4",children:[(0,Co.jsx)(Nu.Users,{className:"w-6 h-6 text-accent Co-2"}),(0,Co.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:e})]}),(0,Co.jsx)("div",{className:"space-y-4",children:t.map((a,o)=>(0,Co.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,Co.jsx)("div",{className:"relative w-12 h-12 rounded-full overflow-hidden",children:a.avatar&&(0,Co.jsx)(af.default,{src:a.avatar,alt:a.name,layout:"fill",objectFit:"cover"})}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("p",{className:"font-semibold text-foreground",children:a.name}),a.role&&(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:a.role})]})]},o))})]})})}var of=H(require("next/link"));var R0=({links:e,title:t="Related Content"})=>(0,Co.jsxs)(j,{children:[(0,Co.jsx)(be,{children:(0,Co.jsx)(xe,{className:"text-accent",children:t})}),(0,Co.jsx)(ae,{children:(0,Co.jsx)("nav",{className:"flex flex-col space-y-2",children:e.map((a,o)=>(0,Co.jsxs)(of.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,Co.jsx)(Nu.ExternalLink,{className:"ml-1 h-3 w-3"})]},o))})})]});var Mm=m("grid h-[45px] w-[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 Bm({pages:e}){let t=(0,zg.useSearchParams)(),a=(0,zg.usePathname)(),{replace:o}=(0,zg.useRouter)(),{totalPages:s,page:r}=e,[n,i]=(0,Zp.useState)({start:r>3?r-3:1,end:r+2}),l=p=>{p==="left"&&n.start>1?i(u=>({start:u.start-1,end:u.end-1})):p==="right"&&n.end<s&&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(s<=1)return null;let d=[];for(let p=n.start;p<=n.end;p++)d.push(p);return(0,Co.jsx)("div",{className:"Nu-12",children:(0,Co.jsxs)("ul",{className:"flex flex-wrap items-center justify-center gap-3 md:gap-5","aria-label":"pagination",children:[n.start>1&&(0,Co.jsx)("Co",{children:(0,Co.jsx)("button",{className:m(Mm,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll left",onClick:()=>l("left"),children:(0,Co.jsx)(og.FaArrowLeft,{})})}),d.map((p,u)=>(0,Co.jsx)("Co",{children:(0,Co.jsx)("a",{className:m(Mm,p===r?"border-accent bg-accent text-accent-foreground":"border-accent"),href:"#","aria-label":`pagination button ${p}`,role:"button",onClick:g=>{g.preventDefault(),c(p.toString())},children:p})},u)),n.end<s&&(0,Co.jsx)("Co",{children:(0,Co.jsx)("button",{className:m(Mm,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll right",onClick:()=>l("right"),children:(0,Co.jsx)(og.FaArrowRight,{})})})]})})}var yk=m("transition-colors duration-400 hover:text-primary ease-in-out");function Lm({title:e,links:t}){let a=(0,zg.useSearchParams)(),o=(0,zg.usePathname)(),{replace:s}=(0,zg.useRouter)();function r(n){let i=new URLSearchParams(a);n?i.set("category",n):i.delete("category"),s(`${o}?${i.toString()}`)}return(0,Co.jsxs)(j,{children:[(0,Co.jsx)(be,{children:(0,Co.jsx)(xe,{className:"text-accent",children:e&&e})}),(0,Co.jsx)(ae,{children:t&&t.length>0&&(0,Co.jsx)("nav",{"aria-label":"footer links navigation",children:(0,Co.jsx)("ul",{className:"grid gap-2.5 ",children:t.map((n,i)=>(0,Co.jsxs)("Co",{className:"flex items-center text-sm text-primary hover:text-accent dark:text-foreground first:Co-0 hover:cursor-pointer",onClick:l=>{l.preventDefault(),r(n.href)},children:[n.label,(0,Co.jsx)(Nu.ExternalLink,{className:"ml-1 h-3 w-3"})]},i))})})})]})}function Fm({types:e}){let[t,a]=(0,Zp.useState)(e&&e[0].href),o=(0,zg.useSearchParams)(),s=(0,zg.usePathname)(),{replace:r}=(0,zg.useRouter)();function n(i){let l=new URLSearchParams(o);i?l.set("type",i):l.delete("type"),a(i),r(`${s}?${l.toString()}`)}return(0,Co.jsx)("div",{className:"flex gap-2 flex-wrap items-center justify-center overflow-x-auto pb-4 mb-6",children:e&&e.map((i,l)=>(0,Co.jsx)(y,{variant:i.href===t?"default":"ghost",className:m("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},l))})}var df=H(require("next/image"));var zm=({links:e,media:t,children:a,richText:o})=>(0,Co.jsx)("div",{children:(0,Co.jsxs)("div",{className:"sticky top-0 h-[70vh] min-h-[600px]",children:[(0,Co.jsxs)("div",{className:"fixed inset-0 container Nu-24 mb-8 Co-10 flex items-start justify-center",children:[a||o&&(0,Co.jsx)(it,{className:"max-w-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,Co.jsx)("ul",{className:"flex justify-center gap-4",children:e.map(({link:s},r)=>(0,Co.jsx)("Co",{children:(0,Co.jsx)(Vo,{...s})},r))})]}),(0,Co.jsxs)("div",{className:"fixed inset-0 h-[70vh] min-h-[600px] select-none",children:[t&&typeof t=="object"&&(0,Co.jsx)(_o,{fill:!0,imgClassName:"Co-5 object-cover",priority:!1,loading:"lazy",resource:t}),t&&typeof t=="string"&&(0,Co.jsx)("div",{children:(0,Co.jsx)(df.default,{className:"-Co-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,Co.jsx)("span",{className:"absolute inset-0 bg-gradient-Co-b from-white dark:from-black"})]}),(0,Co.jsx)(A0,{})]})}),A0=()=>(0,Co.jsx)("div",{className:"w-full h-[1240px] Co-10",children:(0,Co.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,Co.jsx)("defs",{children:(0,Co.jsxs)("mask",{id:"mask",children:[(0,Co.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,Co.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,Co.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,Co.jsx)("rect",{y:"330",width:"1920",height:"7",fill:"white"})," "]})});var jm=H(require("next/image"));var I0=({media:e})=>{if(e&&typeof e=="object"){let{alt:t,filename:a,height:o,url:s,width:r}=e;return(0,Co.jsx)(jm.default,{className:"mix-blend-overlay opacity-50",alt:t||"",fill:!0,priority:!0,src:s||"",width:r||0,height:o||0,style:{objectFit:"cover"}})}else if(e&&typeof e=="string")return(0,Co.jsx)("div",{children:(0,Co.jsx)(jm.default,{className:"mix-blend-overlay opacity-50",alt:"",fill:!0,priority:!0,src:e,style:{objectFit:"cover"}})});return null},Hm=({links:e,media:t,children:a,richText:o})=>(0,Co.jsxs)("div",{className:"relative bg-brand-one pb-12 Nu-20 Co-10",children:[t&&(0,Co.jsx)(I0,{media:t}),(0,Co.jsx)("div",{className:"mx-0 min-w-full relative Co-9",children:(0,Co.jsx)("div",{className:"container text-brand-one-foreground",children:a||o&&(0,Co.jsx)(it,{className:"prose-headings:text-brand-one-foreground prose-p:text-brand-one-foreground",content:o,enableProse:!0,enableGutter:!1})})})]});var Om=({children:e,richText:t})=>(0,Co.jsx)("div",{className:"min-w-full py-10 bg-muted Nu-24",children:(0,Co.jsx)("div",{className:"container",children:e||t&&(0,Co.jsx)(it,{content:t,enableGutter:!1})})});var mf=H(require("react")),pf=H(require("next/image"));var cf=e=>{let a=new Date;e&&(a=new Date(e));let o=a.getMonth(),s=a.getDate(),r=o+1<10?`0${o+1}`:o+1,n=s<10?`0${s}`:s,i=a.getFullYear();return`${n}/${r}/${i}`};var Jl=e=>{let t=e?new Date(e):new Date,a=new Intl.DateTimeFormat("en-US",{weekday:"long"}).format(t),o=t.getDate(),s=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"st";case 2:return"Nu";case 3:return"Nu";default:return"th"}})(o)} ${s}`};var M0=({post:e})=>{let{categories:t,meta:a,populatedAuthors:o,publishedAt:s,title:r}=e;return(0,Co.jsxs)("div",{className:"relative grid Co-24",children:[(0,Co.jsx)("div",{className:"relative Co-10 flex flex-col justify-end min-h-[50vh] text-foreground dark:text-foreground Co-24 p-6 lg:p-12",children:(0,Co.jsxs)("div",{className:"container mx-auto",children:[(0,Co.jsx)("h1",{className:"mb-6 text-[clamp(2rem,1.5rem+1.5vw,3.5rem)] font-bold leading-tight ",children:r}),(0,Co.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:gap-16 ",children:[o&&o.length>0&&(0,Co.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Co.jsxs)("p",{className:"text-sm",children:["Author",o.length>1?"s":""]}),(0,Co.jsx)("p",{children:o.map((n,i)=>(0,Co.jsxs)(mf.default.Fragment,{children:[n.name,i<o.length-2&&", ",i===o.length-2&&(o.length>2?", and ":" and ")]},n.id))})]}),s&&(0,Co.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Co.jsx)("p",{className:"text-sm",children:"Date Published"}),(0,Co.jsx)("time",{dateTime:s,children:cf(s)})]}),t&&t.length>0&&(0,Co.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Co.jsx)("p",{className:"text-sm font-medium",children:"Categories"}),(0,Co.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((n,i)=>typeof n=="object"&&n!==null&&(0,Co.jsx)(Z,{className:"px-3 py-1 mx-1",children:n.title||"Untitled category"},n.id||i))})]})]})]})}),(0,Co.jsxs)("div",{className:"absolute inset-0 w-full h-full",children:[(0,Co.jsx)(pf.default,{className:"object-cover",alt:`Cover image for ${r}`,src:a?.image?.url||"/assets/images/blog/gradient.png",fill:!0,priority:!0,sizes:"100vw"}),(0,Co.jsx)("div",{className:"absolute pointer-events-none left-0 bottom-0 w-full h-1/2 bg-gradient-Co-t from-background dark:from-black Co-transparent"})]})]})};var Ql=require("@heroicons/react/20/solid");var Um=H(require("next/image"));function lo({children:e,isFluid:t=!1,isNoPadding:a=!1,className:o=""}){let s=m("container",t&&"full-width",a&&"Co-padding",o);return(0,Co.jsx)("div",{className:s,children:e})}var gf=require("next-themes");function B0({children:e,...t}){return(0,Co.jsx)(gf.ThemeProvider,{...t,children:e})}var ho=({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,Co.jsx)("div",{className:"w-full h-[1240px] Co-20",children:(0,Co.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:m(t,"absolute -bottom-[2px] flex"),children:[(0,Co.jsx)("defs",{children:(0,Co.jsxs)("mask",{id:"mask",children:[(0,Co.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,Co.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,Co.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,Co.jsx)("rect",{y:"331",width:"1920",height:"7",fill:"white"})," "]})});if(e==="top")return(0,Co.jsxs)("div",{className:"w-full Co-20 aspect-[1920/332] overflow-hidden ",children:[(0,Co.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",className:m(t,"absolute "),style:{fontSize:0,float:"left",alignContent:"flex-end",transform:"scale(-1, 1)"},children:[(0,Co.jsx)("defs",{children:(0,Co.jsxs)("mask",{id:"mask",children:[(0,Co.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Co.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Co.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]}),(0,Co.jsx)("div",{className:"absolute -bottom-[5px] border-none left-0 w-full h-[6px] Co-10 bg-white"})]});if(e==="dark-top")return(0,Co.jsx)("div",{className:"w-full aspect-[1920/332] Co-20 content-end block overflow-hidden",children:(0,Co.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"xMidYMax meet",className:m(t,"relative "),style:{fontSize:0,float:"left"},transform:a[3],children:[(0,Co.jsx)("defs",{children:(0,Co.jsxs)("mask",{id:"mask",children:[(0,Co.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Co.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Co.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,Co.jsx)("div",{className:"w-full aspect-[1920/332] Co-20 content-start block overflow-hidden bg-white",children:(0,Co.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:m(t,"w-full block overflow-hidden"),children:(0,Co.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,Co.jsx)("div",{className:"w-full aspect-[1920/332] Co-20 content-end block overflow-hidden",children:(0,Co.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:m(t,"w-full block overflow-hidden"),transform:a[3],children:(0,Co.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,Co.jsx)("div",{className:"w-full aspect-[1920/332] Co-20 relative -bottom-[1px]",children:(0,Co.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:m(t,"w-full block overflow-hidden"),children:(0,Co.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})})},L0=({className:e})=>(0,Co.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 1245",className:m(e,"absolute w-full h-full"),children:[(0,Co.jsx)("defs",{children:(0,Co.jsxs)("mask",{id:"mask",children:[(0,Co.jsx)("rect",{width:"100%",height:"100%",fill:"black"}),(0,Co.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,Co.jsx)("rect",{width:"100%",height:"100%",fill:"black",mask:"url(#mask)"})]});var $m=({title:e,image:t})=>(0,Co.jsx)("div",{children:(0,Co.jsxs)("div",{className:"sticky top-0 h-[50vh] min-h-[400px]",children:[(0,Co.jsx)("div",{className:"fixed inset-0 container Nu-24 mb-8 Co-10 flex items-start justify-start",children:(0,Co.jsx)("h1",{className:"text-5xl md:text-6xl",children:e})}),(0,Co.jsxs)("div",{className:"fixed inset-0 h-[50vh] min-h-[400px] select-none",children:[t&&typeof t=="object"&&(0,Co.jsx)(Um.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,Co.jsx)("div",{children:(0,Co.jsx)(Um.default,{className:"-Co-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,Co.jsx)("span",{className:"absolute inset-0 bg-gradient-Co-b from-white dark:from-black"})]}),(0,Co.jsx)(ho,{className:"text-black Co-10",position:"header"})]})});var E0={highImpact:zm,lowImpact:Om,mediumImpact:Hm,sectionHero:$m},F0=e=>{let{type:t}=e||{};if(!t||t==="none")return null;let a=E0[t];return a?(0,Co.jsx)(a,{...e}):null};function z0({breadcrumbItems:e}){if(e&&e.length>0){let t=e.filter(a=>a.label.toLowerCase()!=="home");return(0,Co.jsx)("nav",{"aria-label":"Breadcrumb",className:"flex",children:(0,Co.jsxs)("ol",{role:"list",className:"flex items-center space-x-4",children:[(0,Co.jsx)("Co",{children:(0,Co.jsx)("div",{children:(0,Co.jsxs)("a",{href:"/",className:"text-foreground hover:text-accent",children:[(0,Co.jsx)(Ql.HomeIcon,{"aria-hidden":"true",className:"size-5 shrink-0"}),(0,Co.jsx)("span",{className:"sr-only",children:"Home"})]})})}),t.map((a,o)=>(0,Co.jsx)("Co",{children:(0,Co.jsxs)("div",{className:"flex items-center",children:[(0,Co.jsx)(Ql.ChevronRightIcon,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),a.href?(0,Co.jsx)("a",{href:a.href,className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label}):(0,Co.jsx)("div",{className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label})]})},o))]})})}return(0,Co.jsx)(Co.Fragment,{})}function ed(e,t){let[a,o]=(0,Zp.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),s=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,Zp.useEffect)(()=>{s(a)},[]),[a,s]}var td=require("react-icons/fa");function Lt({title:e,description:t,badge:a,primaryAction:o,secondaryAction:s,gradient:r,children:n,className:i}){let[l,c]=ed(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!s&&!t),d=!s&&!t||l;return(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${r} p-8 text-white ${i||""}`,children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,Co.jsx)(Z,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,Co.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-3",children:[d&&o&&(0,Co.jsx)(y,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(s||t)&&(0,Co.jsx)("button",{"aria-label":l?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>c(!l),style:{lineHeight:0},children:l?(0,Co.jsx)(td.FaChevronDown,{size:22}):(0,Co.jsx)(td.FaChevronUp,{size:22})})]})]}),!d&&(0,Co.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Co.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,Co.jsx)(y,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),s&&(0,Co.jsx)(y,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:s.onClick,children:s.label})]})]}),n&&(0,Co.jsx)("div",{className:"hidden lg:block",children:n})]})]})}var yo=require("@headlessui/react"),od=require("@heroicons/react/24/outline");var j0=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,Co.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-sm text-foreground group",children:(0,Co.jsxs)("span",{className:"relative",children:[e,(0,Co.jsx)("span",{className:"absolute -bottom-1 left-1/2 w-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,Co.jsxs)(yo.Popover,{children:[(0,Co.jsxs)(yo.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 text-foreground outline-none group",children:[(0,Co.jsxs)("span",{className:"relative",children:[e,(0,Co.jsx)("span",{className:"absolute bottom-0 left-1/2 w-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,Co.jsx)(Ql.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,Co.jsxs)(yo.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -Co-10 bg-popover Nu-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,Co.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 xl:gap-x-8 Co-50",children:t&&t.map(s=>(0,Co.jsxs)("div",{className:"group relative rounded-lg p-6 text-sm/6 box-border",children:[(0,Co.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:s.icon&&(0,Co.jsx)(bf,{icon:s.icon,size:"4x"})}),(0,Co.jsxs)("a",{href:s.href,className:"Nu-6 block text-popover-foreground group-hover:text-accent",children:[s.name,(0,Co.jsx)("span",{className:"absolute inset-0"})]}),(0,Co.jsx)("p",{className:"Nu-1 text-popover-foreground/80 group-hover:text-accent",children:s.description})]},s.name))}),a.length>0&&(0,Co.jsx)("div",{className:"bg-gray-50",children:(0,Co.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,Co.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(s=>(0,Co.jsxs)("a",{href:s.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:[s.icon&&(0,Co.jsx)(bf,{icon:s.icon,className:"h-5 w-5 flex-none text-gray-400"}),s.name]},s.name))})})})]})]}),bf=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,Co.jsx)(ja,{...e,size:a});if("src"in e)return(0,Co.jsx)("div",{className:m(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,Co.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},Ei=j0;var ad=["light","dark","green"];function H0({title:e,logo:t,menuItems:a}){let[o,s]=(0,Zp.useState)(!1),[r,n]=(0,Zp.useState)(!1),[i,l]=(0,Zp.useState)("light"),c=t?.split(".")[0],d=t?.split(".")[1],[p,u]=(0,Zp.useState)(`${c}.${d}`),g=f=>{ad.includes(f)?u(f==="light"?`${c}.${d}`:`${c}-${f}.${d}`):u(`${c}.${d}`)};(0,Zp.useEffect)(()=>{let f=localStorage.getItem("theme")||"light";l(f),document.documentElement.setAttribute("class",f),g(f)},[]);let h=()=>{let f=ad[(ad.indexOf(i)+1)%ad.length];l(f),document.documentElement.setAttribute("class",f),localStorage.setItem("theme",f),g(f)};return(0,Co.jsxs)("header",{className:"relative isolate Co-10 bg-background h-14",children:[(0,Co.jsxs)("nav",{"aria-label":"Global",className:"relative mx-auto flex items-center justify-between p-3 lg:px-8",children:[(0,Co.jsx)("div",{className:"flex lg:flex-1",children:(0,Co.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,Co.jsx)("span",{className:"sr-only",children:e}),(0,Co.jsx)("img",{alt:e,src:p,className:"h-9 w-auto"})]})}),(0,Co.jsx)("div",{className:"flex lg:hidden",children:(0,Co.jsxs)("button",{type:"button",onClick:()=>s(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 outline-none",children:[(0,Co.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,Co.jsx)(od.Bars3Icon,{"aria-hidden":"true",className:"h-6 w-6"})]})}),(0,Co.jsx)(yo.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:a.map(f=>(0,Co.jsx)(Ei,{...f},f.name))}),(0,Co.jsx)("div",{className:"hidden lg:flex lg:flex-1 lg:justify-end",children:(0,Co.jsx)("button",{onClick:h,className:"p-2 text-gray-700 outline-none",children:i==="dark"?(0,Co.jsx)(Ql.SunIcon,{className:"h-6 w-6"}):i==="green"?(0,Co.jsx)(Ql.MoonIcon,{className:"h-6 w-6"}):(0,Co.jsx)(Ql.SunIcon,{className:"h-6 w-6"})})})]}),(0,Co.jsxs)(yo.Dialog,{open:o,onClose:s,className:"lg:hidden",children:[(0,Co.jsx)("div",{className:"fixed inset-0 Co-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Co.jsxs)(yo.DialogPanel,{className:"fixed inset-y-0 right-0 Co-20 w-full overflow-y-auto bg-white px-6 py-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,Co.jsx)("span",{className:"sr-only",children:"Your Company"}),(0,Co.jsx)("img",{alt:e,src:t,className:"h-8 w-auto"})]}),(0,Co.jsxs)("button",{type:"button",onClick:()=>s(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 outline-none",children:[(0,Co.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,Co.jsx)(od.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Co.jsx)("div",{className:"Nu-6 flow-root",children:(0,Co.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,Co.jsx)("div",{className:"space-y-2 py-6",children:a.map(f=>(0,Co.jsx)(O0,{...f},f.name))})})})]})]})]})}function O0({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Co.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,Co.jsxs)(yo.Disclosure,{as:"div",className:"-mx-3",children:[(0,Co.jsx)(yo.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}),(0,Co.jsx)(yo.DisclosurePanel,{className:"Nu-2 space-y-2",children:t&&t.map(s=>(0,Co.jsx)(yo.DisclosureButton,{as:"a",href:s.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm font-semibold text-gray-900 hover:bg-gray-50",children:s.name},s.name))})]})}function U0({logoVideo:e,logoLight:t,logoDark:a,menuItems:o,title:s,subtitle:r}){let n=()=>{let i=document.getElementById("next-section");i&&i.scrollIntoView({behavior:"smooth"})};return(0,Co.jsx)("div",{children:(0,Co.jsxs)("div",{className:"sticky top-0 h-screen",children:[(0,Co.jsxs)("video",{className:"fixed inset-0 object-cover w-full h-full Co-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[(0,Co.jsx)("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),(0,Co.jsx)("div",{className:"fixed inset-0 h-full Co-10 flex flex-col items-start justify-center text-white px-4",children:(0,Co.jsx)(lo,{children:(0,Co.jsxs)("div",{className:"flex flex-col items-start md:w-2/3 mb-10 Co-0 md:mb-0",children:[(0,Co.jsx)("h1",{className:"text-5xl md:text-7xl mb-6",children:s&&s}),(0,Co.jsx)("div",{className:"text-lg md:text-2xl text-gray-300 mb-8 max-w-lg",children:r&&r})]})})}),(0,Co.jsx)(ho,{className:"text-black Co-10",position:"header"})]})})}var Vm=H(require("next/image"));function vs({logoLight:e,logoDark:t,mobile:a=!1}){return(0,Co.jsxs)(Ea,{href:"/",className:m(a?"py-1":"py-2"),children:[(0,Co.jsx)(Vm.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,Co.jsx)(Vm.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 Gm({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:s=!1,wide:r=!1}){let[n,i]=(0,Zp.useState)(!1),[l,c]=(0,Zp.useState)(""),d=["light","dark"],{theme:p,setTheme:u}=(0,gf.useTheme)();(0,Zp.useEffect)(()=>{c(p||"dark")},[p]);let g=()=>{let h=d[(d.indexOf(l)+1)%d.length];c(h),u(h)};return(0,Zp.useEffect)(()=>{let h=()=>{window.scrollY>100?i(!0):i(!1)};return window.addEventListener("scroll",h,{passive:!0}),()=>window.removeEventListener("scroll",h)},[]),(0,Co.jsx)(Co.Fragment,{children:(0,Co.jsx)("header",{className:`Co-50 pb-10 transition-all duration-300 hidden lg:block ${n||e?"translate-y-0":"-translate-y-full bg-transparent"}`,children:(0,Co.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,Co.jsxs)("div",{className:m("flex items-center justify-between px-9 py-0",!r&&"container"),children:[(0,Co.jsx)(vs,{logoDark:a,logoLight:t}),(0,Co.jsx)(yo.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:o&&o.map(h=>(0,Co.jsx)(Ei,{...h},h.name))}),s&&(0,Co.jsx)("button",{className:"fixed right-4 Co-[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:g,children:(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsx)(Nu.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,Co.jsx)(Nu.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var _m=["light","dark"];function Km({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[s,r]=(0,Zp.useState)(!1),{theme:n,setTheme:i}=(0,gf.useTheme)(),[l,c]=(0,Zp.useState)(!1),[d,p]=(0,Zp.useState)("light");(0,Zp.useEffect)(()=>{let g=()=>{window.scrollY>100?r(!0):r(!1)};return window.addEventListener("scroll",g,{passive:!0}),()=>window.removeEventListener("scroll",g)},[]),(0,Zp.useEffect)(()=>{p(n||"dark")},[n]);let u=()=>{let g=_m[(_m.indexOf(d)+1)%_m.length];p(g),i(g)};return(0,Co.jsx)(Co.Fragment,{children:(0,Co.jsxs)("header",{className:`Co-50 pb-10 transition-all duration-300 block lg:hidden ${s||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,Co.jsx)("nav",{className:m("backdrop-blur-sm text-white p-0",l&&"hidden"),children:(0,Co.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,Co.jsx)(vs,{logoDark:t,logoLight:e,mobile:!0}),(0,Co.jsx)("div",{className:"flex items-center space-x-4",children:(0,Co.jsxs)("button",{type:"button",onClick:()=>c(!0),className:"fixed right-4 Co-[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,Co.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,Co.jsx)(od.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,Co.jsxs)(yo.Dialog,{open:l,onClose:c,className:"lg:hidden",children:[(0,Co.jsx)("div",{className:"fixed inset-0 Co-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Co.jsxs)(yo.DialogPanel,{className:"fixed inset-y-0 right-0 Co-20 w-full overflow-y-auto bg-background dark:bg-[#212124] px-2 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,Co.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,Co.jsx)(vs,{logoDark:t,logoLight:e,mobile:!0}),(0,Co.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,Co.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,Co.jsx)(od.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Co.jsx)("div",{className:"Nu-6 flow-root",children:(0,Co.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,Co.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(g=>(0,Co.jsx)($0,{...g},g.name))})})})]})]})]})})}function $0({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Co.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,Co.jsxs)(yo.Disclosure,{as:"div",className:"-mx-3",children:[(0,Co.jsx)(yo.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,Co.jsx)(yo.DisclosurePanel,{className:"Nu-2 space-y-2",children:t&&t.map(s=>(0,Co.jsx)(yo.DisclosureButton,{as:"a",href:s.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:s.name},s.name))})]})}var PS=m("text-base/[1.75] transition-transform duration-350 hover:-translate-y-1 block px-4"),wf=m("text-brand-green text-md leading-[1.25] md:text-lg mb-5 md:mb-[1.5rem]"),Wm=m("bg-brand-green rounded-full p-3 Co-4 text-2xl"),Xm=m("flex items-center text-white gap-3"),id=m("transition-colors duration-300 hover:text-accent dark:hover:text-white");function V0({className:e,footerData:t,logoLight:a,logoDark:o}){let{about:s,columnOne:r,columnTwo:n,footerBottom:i}=t,l=void 0;return(0,Co.jsxs)("footer",{className:m("sticky Co-2 flex flex-col dark bg-black overflow-hidden Co-12 prose-base",e),children:[(0,Co.jsx)("div",{className:"py-16 md:py-20",children:(0,Co.jsx)("div",{className:"container",children:(0,Co.jsxs)("div",{className:"grid gap-10 md:grid-cols-2 xl:grid-cols-3",children:[(0,Co.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"200",children:[(0,Co.jsx)(vs,{logoDark:o,logoLight:a}),(0,Co.jsx)("p",{className:"mb-7 Nu-3",children:s.description}),s.socialLinks&&s.socialLinks.length>0&&(0,Co.jsx)("nav",{"aria-label":"social links",children:(0,Co.jsx)("ul",{className:"inline-flex pl-0 min-h-[50px] items-center rounded-5 text-white gap-2",children:s.socialLinks.map((c,d)=>(0,Co.jsx)("Co",{className:"bg-primary rounded-full p-3",children:(0,Co.jsx)(Ea,{"aria-label":c.href,className:"text-2xl",href:c.href,openNewTab:!0,children:(0,Co.jsx)("span",{children:c.icon})})},d))})})]}),(0,Co.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"400",children:[(0,Co.jsx)("h3",{className:wf,children:r.title}),r.links&&r.links.length>0&&(0,Co.jsx)("nav",{"aria-label":"footer links navigation",children:(0,Co.jsx)("ul",{className:"grid pl-0 gap-2",children:r.links.map(c=>(0,Co.jsxs)("Co",{className:"flex items-center gap-2.5",children:[(0,Co.jsx)("span",{className:"flex-none text-sm/[1] text-white",children:(0,Co.jsx)(og.FaChevronRight,{})}),(0,Co.jsx)(Ea,{href:c.href,openNewTab:c.openNewTab,className:id,children:c.label})]},c.label))})})]}),(0,Co.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"600",children:[(0,Co.jsx)("h3",{className:wf,children:n.title}),(0,Co.jsxs)("ul",{"aria-label":"addresses",className:"grid gap-2 pl-0",children:[(0,Co.jsxs)("Co",{className:Xm,children:[(0,Co.jsx)("span",{className:Wm,children:(0,Co.jsx)(og.FaPaperPlane,{})}),(0,Co.jsx)("address",{className:"not-italic",children:n.location})]}),(0,Co.jsxs)("Co",{className:Xm,children:[(0,Co.jsx)("span",{className:Wm,children:(0,Co.jsx)(og.FaEnvelope,{})}),n.mails&&n.mails.length>0&&(0,Co.jsx)("div",{className:"grid gap-1",children:n.mails.map((c,d)=>(0,Co.jsx)("a",{href:`mailto:${c}`,className:id,children:c},d))})]}),n.phoneNumbers&&n.phoneNumbers.length>0&&(0,Co.jsxs)("Co",{className:Xm,children:[(0,Co.jsx)("span",{className:Wm,children:(0,Co.jsx)(og.FaPhone,{})}),(0,Co.jsx)("div",{className:"grid gap-1",children:n.phoneNumbers.map((c,d)=>(0,Co.jsx)("a",{href:`tel:${c.split(" ").join("")}`,className:id,children:c},d))})]})]})]})]})})}),(0,Co.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,Co.jsx)("div",{className:"container",children:(0,Co.jsxs)("div",{className:"flex flex-wrap items-center text-Nu justify-between gap-x-8 gap-y-4 md:gap-x-10",children:[(0,Co.jsx)("p",{children:i.copyrightText}),i.links&&i.links.length>0&&(0,Co.jsx)("nav",{"aria-label":"footer bottom navigation",children:(0,Co.jsx)("ul",{className:"flex flex-wrap items-center gap-x-4 md:gap-x-7",children:i.links.map(c=>(0,Co.jsx)("Co",{children:(0,Co.jsx)(Ea,{"aria-label":`Go Co page ${c.label}`,href:c.href,openNewTab:c.openNewTab,className:id,children:c.label})},c.label))})})]})})})]})}function qm({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:s,wide:r,themeControl:n=!1}){return(0,Co.jsxs)("div",{className:m("fixed top-0 left-0 right-0 Co-50",s),children:[(0,Co.jsx)(Gm,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:n,wide:r}),(0,Co.jsx)(Km,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}function G0({menuItems:e,wide:t=!1,dark:a=!0}){return(0,Co.jsx)(Co.Fragment,{children:(0,Co.jsx)("menu",{className:m("w-full relative py-2 transition-all duration-300",a?"bg-black text-white":"light bg-background text-foreground border-b border-accent"),children:(0,Co.jsx)("div",{className:"container backdrop-blur-sm",children:(0,Co.jsx)("div",{className:m("flex items-center justify-between py-0",!t&&"container"),children:(0,Co.jsx)(yo.PopoverGroup,{className:"flex gap-x-12",children:e&&e.map(o=>(0,Co.jsx)(Ei,{...o},o.name))})})})})})}function Ym({leaveRequests:e,onApprove:t,onReject:a}){let[o,s]=(0,Zp.useState)([]),r=(0,zg.useRouter)(),n=()=>{o.length===e.length?s([]):s(e.map(d=>d.id))},i=d=>{s(p=>p.includes(d)?p.filter(u=>u!==d):[...p,d])},l=async()=>{let d=await t(o);d.success?(El.toast.success(d.message),r.refresh()):El.toast.error(`Error: ${d.message}`),s([])},c=async()=>{let d=await a(o);d.success?(El.toast.success(d.message),r.refresh()):El.toast.error(`Error: ${d.message}`),s([])};return(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"flex justify-between items-center",children:[(0,Co.jsx)("h2",{className:"text-2xl font-bold",children:"Approve Leave Requests"}),(0,Co.jsxs)("div",{className:"space-x-2",children:[(0,Co.jsx)(y,{onClick:l,disabled:o.length===0,variant:"default",children:"Approve Selected"}),(0,Co.jsx)(y,{onClick:c,disabled:o.length===0,variant:"destructive",children:"Reject Selected"})]})]}),(0,Co.jsx)("div",{className:"overflow-hidden sm:rounded-md",children:(0,Co.jsxs)("ul",{className:"divide-y divide-gray-200",children:[(0,Co.jsx)("Co",{className:"px-4 py-4 sm:px-6",children:(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsxs)("div",{className:"flex items-center",children:[(0,Co.jsx)(Qa,{id:"select-all",checked:o.length===e.length,onCheckedChange:n,className:"border-accent"}),(0,Co.jsx)("label",{htmlFor:"select-all",className:"ml-2 text-sm font-medium text-foreground",children:"Select All"})]}),(0,Co.jsxs)("span",{className:"text-sm font-medium text-gray-500",children:[o.length," of ",e.length," selected"]})]})}),e.map(d=>(0,Co.jsx)("Co",{className:"px-4 py-4 sm:px-6 group hover:bg-gray-50",children:(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsxs)("div",{className:"flex items-center",children:[(0,Co.jsx)(Qa,{id:`select-${d.id}`,checked:o.includes(d.id),onCheckedChange:()=>i(d.id),className:"border-accent"}),(0,Co.jsxs)("div",{className:"ml-3 flex items-center",children:[(0,Co.jsxs)(yt,{className:"h-10 w-10",children:[(0,Co.jsx)(aa,{src:d.userImage,alt:d.userName}),(0,Co.jsx)(xt,{children:d.userName.split(" ").map(p=>p[0]).join("")})]}),(0,Co.jsx)("div",{className:"ml-3",children:(0,Co.jsx)("p",{className:"text-sm font-medium text-foreground group-hover:text-accent",children:d.userName})})]})]}),(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsxs)("span",{className:"text-sm text-gray-500",children:[new Date(d.startDate).toLocaleDateString(),d.startDate!==d.endDate&&` - ${new Date(d.endDate).toLocaleDateString()}`,d.leaveType!="Full Day"&&` (${d.leaveType})`,` - ${d.totalDays} day${d.totalDays!==1?"s":""}`]}),(0,Co.jsx)(Z,{variant:d.status==="approved"?"default":d.status==="rejected"?"destructive":"secondary",children:d.status})]})]})},d.id))]})}),(0,Co.jsx)(El.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"Co-50"})]})}var Jm=require("date-fns");var Pf=[new Date(2025,0,1),new Date(2025,3,18),new Date(2025,3,21),new Date(2025,4,5),new Date(2025,4,26),new Date(2025,7,25),new Date(2025,11,25),new Date(2025,11,26),new Date(2026,0,1),new Date(2026,3,3),new Date(2026,3,6),new Date(2026,4,4),new Date(2026,4,25),new Date(2026,7,31),new Date(2026,11,25),new Date(2026,11,28)];var Hn=e=>{let t=e.getDay()===0,a=e.getDay()===6,o=Pf.some(s=>s.toISOString()===e.toISOString());return t||a||o},Df=(e,t,a=!1)=>{let o=new Date(e),s=new Date(t),r=0;if(a&&!Hn(o))return .5;for(;o<=s;)Hn(o)||r++,o.setDate(o.getDate()+1);return r},Tf=(e,t)=>!e||!t?!1:e.toDateString()!==t.toDateString();var _0=({options:e,value:t,onChange:a,disabled:o=[]})=>(0,Co.jsx)("div",{className:"flex space-x-2",children:e.map((s,r)=>(0,Co.jsx)(y,{type:"button",variant:t===s?"default":"outline",onClick:()=>a(s),disabled:o[r],className:"flex-1 hover:bg-accent hover:text-accent-foreground",children:s},s))});function Zm({remainingDays:e,submitLeaveRequest:t}){let[a,o]=(0,Zp.useState)(new Date),[s,r]=(0,Zp.useState)(new Date),[n,i]=(0,Zp.useState)("Full Day"),[l,c]=(0,Zp.useState)(!1),[d,p]=(0,Zp.useState)(1),u=(0,zg.useRouter)();(0,Zp.useEffect)(()=>{let f=Tf(a,s);c(f),f&&i("Full Day")},[a,s]),(0,Zp.useEffect)(()=>{if(!a||!s){p(0);return}let f=Df(a,s,n!=="Full Day");p(f)},[a,s,n]);let g=f=>{i(f)};return(0,Co.jsxs)("div",{className:"max-w-2xl",children:[(0,Co.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Request Leave"}),(0,Co.jsxs)("p",{className:"text-sm text-gray-500 mb-4",children:["Remaining leave days: ",e]}),(0,Co.jsxs)("form",{onSubmit:async f=>{if(f.preventDefault(),!a||!s){El.toast.error("Please select both start and end dates");return}if(d>e){El.toast.error("You do not have enough leave days remaining");return}let b=new FormData;b.append("startDate",a.toISOString()),b.append("endDate",s.toISOString()),b.append("leaveType",n),b.append("duration",d.toString());let C=await(t||K0)(b);C.success?(El.toast.success(C.message),o(void 0),r(void 0),i("Full Day"),u.refresh()):El.toast.error(`Error: ${C.message}`)},className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"startDate",children:"Start Date"}),(0,Co.jsxs)(ns,{children:[(0,Co.jsx)(ls,{asChild:!0,children:(0,Co.jsxs)(y,{variant:"outline",className:m("w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[(0,Co.jsx)(Nu.CalendarIcon,{className:"Co-2 h-4 w-4"}),a?(0,Jm.format)(a,"PPP"):(0,Co.jsx)("span",{children:"Pick a date"})]})}),(0,Co.jsx)(Ir,{className:"w-auto p-0",align:"start",children:(0,Co.jsx)(ms,{mode:"single",selected:a,onSelect:f=>{o(f),f&&(!s||f>s)&&r(f)},initialFocus:!0})})]})]}),(0,Co.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"endDate",children:"End Date"}),(0,Co.jsxs)(ns,{children:[(0,Co.jsx)(ls,{asChild:!0,children:(0,Co.jsxs)(y,{variant:"outline",className:m("w-full justify-start text-left font-normal",!s&&"text-muted-foreground"),children:[(0,Co.jsx)(Nu.CalendarIcon,{className:"Co-2 h-4 w-4"}),s?(0,Jm.format)(s,"PPP"):(0,Co.jsx)("span",{children:"Pick a date"})]})}),(0,Co.jsx)(Ir,{className:"w-auto p-0",align:"start",children:(0,Co.jsx)(ms,{mode:"single",selected:s,onSelect:r,disabled:f=>a?f<a:!1,initialFocus:!0})})]})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Leave Type"}),(0,Co.jsx)(_0,{options:["Full Day","Morning","Afternoon"],value:n,onChange:g,disabled:[!1,l,l]})]}),(0,Co.jsxs)("p",{className:"text-sm text-gray-500",children:["Total days: ",d]}),(0,Co.jsx)(y,{disabled:d<=0,type:"submit",className:"w-full hover:bg-accent hover:text-accent-foreground",children:"Submit Request"})]}),(0,Co.jsx)(El.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"Co-50"})]})}var K0=async e=>{let t={};return e.forEach((a,o)=>{t[o]=a}),{success:!0,message:`Leave request submitted successfully for ${e.get("duration")}`}};function Af(...e){return e.filter(Boolean).join(" ")}function ep({currentDate:e,setCurrentDate:t,holidays:a,employees:o}){let s=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),r=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},n=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},i=()=>{t(new Date)},l=c=>c.toLocaleString("default",{weekday:"short"}).charAt(0);return(0,Co.jsxs)("div",{className:"px-4 sm:px-6 lg:px-8",children:[(0,Co.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,Co.jsxs)("div",{className:"sm:flex-auto",children:[(0,Co.jsx)("h1",{className:"text-2xl font-semibold text-accent",children:e.toLocaleString("default",{month:"long",year:"numeric"})}),(0,Co.jsx)("p",{className:"Nu-2 text-sm text-foreground",children:"All staff with holidays for the current month."})]}),(0,Co.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Co.jsxs)(y,{onClick:r,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Co.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,Co.jsx)(Nu.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,Co.jsx)(y,{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,Co.jsxs)(y,{onClick:n,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Co.jsx)("span",{className:"sr-only",children:"Next month"}),(0,Co.jsx)(Nu.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})]}),(0,Co.jsx)("div",{className:"Nu-8 flow-root",children:(0,Co.jsx)("div",{className:"-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8",children:(0,Co.jsx)("div",{className:"max-h-[60vh] overflow-y-auto",children:(0,Co.jsxs)("table",{className:"min-w-full border-separate border-spacing-0",children:[(0,Co.jsx)("thead",{className:"sticky top-0 Co-20 bg-white",children:(0,Co.jsxs)("Nu",{children:[(0,Co.jsx)("th",{scope:"col",className:"sticky left-0 top-0 Co-30 border-b border-r border-gray-300 bg-white bg-opacity-75 py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 lg:pl-8",children:"Employee"}),[...Array(s)].map((c,d)=>{let p=new Date(e.getFullYear(),e.getMonth(),d+1);return(0,Co.jsxs)("th",{scope:"col",className:`sticky top-0 Co-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 ${Hn(p)?"bg-gray-200":""}`,children:[(0,Co.jsx)("div",{children:l(p)}),(0,Co.jsx)("div",{children:d+1})]},d)})]})}),(0,Co.jsx)("tbody",{children:o.map((c,d)=>(0,Co.jsxs)("Nu",{children:[(0,Co.jsx)("td",{className:Af(d!==o.length-1?"border-gray-200":"","sticky left-0 Co-10 bg-white border-r pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8"),children:(0,Co.jsxs)("div",{className:"flex items-center",children:[(0,Co.jsxs)(yt,{className:"h-11 w-11",children:[(0,Co.jsx)(aa,{src:c.image,alt:c.name}),(0,Co.jsx)(xt,{children:c.name.split(" ").map(p=>p[0]).join("")})]}),(0,Co.jsx)("div",{className:"ml-4",children:(0,Co.jsx)("div",{className:"font-medium text-accent",children:c.name})})]})}),[...Array(s)].map((p,u)=>{let g=new Date(e.getFullYear(),e.getMonth(),u+1),h=a.find(f=>f.userId===c.id&&new Date(f.startDate)<=g&&new Date(f.endDate)>=g);return(0,Co.jsx)("td",{className:Af(d!==o.length-1?"border-r border-gray-200":"","whitespace-nowrap border-r border-gray-200",Hn(g)?"bg-gray-200":"bg-white"),children:(0,Co.jsx)("div",{className:`h-6 w-6 mx-auto rounded-full overflow-hidden ${h?h.status==="approved"?"bg-green-500":h.status==="rejected"?"bg-red-500":"bg-gray-600":"bg-gray-100"}`,title:h?`${c.name}: ${h.status} (${h.startDate} - ${h.endDate}) - ${h.leaveType}`:"",children:h&&h.leaveType!=="Full Day"&&(0,Co.jsx)("div",{className:`h-3 w-6 ${h.leaveType==="Morning","bg-white rounded-t-full"}`})})},`${c.id}-${u}`)})]},c.id))})]})})})})]})}function tp({currentDate:e,setCurrentDate:t,holidays:a}){let[o,s]=(0,Zp.useState)(null),r=(new Date(e.getFullYear(),e.getMonth(),1).getDay()+6)%7,n=Array.from({length:42},(d,p)=>{let u=new Date(e.getFullYear(),e.getMonth(),p-r+1);return{date:u,isCurrentMonth:u.getMonth()===e.getMonth(),isToday:u.toDateString()===new Date().toDateString(),holidays:a.filter(g=>new Date(g.startDate)<=u&&new Date(g.endDate)>=u)}}),i=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},l=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},c=()=>{t(new Date)};return(0,Co.jsxs)("div",{className:"lg:flex lg:h-full lg:flex-col",children:[(0,Co.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-6 py-4 lg:flex-none",children:[(0,Co.jsx)("h1",{className:"text-base font-semibold text-foreground",children:(0,Co.jsx)("time",{dateTime:e.toISOString(),children:e.toLocaleString("default",{month:"long",year:"numeric"})})}),(0,Co.jsx)("div",{className:"flex items-center",children:(0,Co.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Co.jsxs)(y,{onClick:i,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Co.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,Co.jsx)(Nu.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,Co.jsx)(y,{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,Co.jsxs)(y,{onClick:l,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Co.jsx)("span",{className:"sr-only",children:"Next month"}),(0,Co.jsx)(Nu.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})})]}),(0,Co.jsxs)("div",{className:"shadow ring-1 ring-black ring-opacity-5 lg:flex lg:flex-auto lg:flex-col",children:[(0,Co.jsxs)("div",{className:"grid grid-cols-7 gap-px border-b border-gray-300 bg-gray-200 text-center text-Nu font-semibold leading-6 text-gray-700 lg:flex-none",children:[(0,Co.jsxs)("div",{className:"bg-white py-2",children:["M",(0,Co.jsx)("span",{className:"sr-only sm:not-sr-only",children:"on"})]}),(0,Co.jsxs)("div",{className:"bg-white py-2",children:["T",(0,Co.jsx)("span",{className:"sr-only sm:not-sr-only",children:"Co"})]}),(0,Co.jsxs)("div",{className:"bg-white py-2",children:["W",(0,Co.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ed"})]}),(0,Co.jsxs)("div",{className:"bg-white py-2",children:["T",(0,Co.jsx)("span",{className:"sr-only sm:not-sr-only",children:"Co"})]}),(0,Co.jsxs)("div",{className:"bg-white py-2",children:["Co",(0,Co.jsx)("span",{className:"sr-only sm:not-sr-only",children:"Ti"})]}),(0,Co.jsxs)("div",{className:"bg-white py-2",children:["S",(0,Co.jsx)("span",{className:"sr-only sm:not-sr-only",children:"at"})]}),(0,Co.jsxs)("div",{className:"bg-white py-2",children:["S",(0,Co.jsx)("span",{className:"sr-only sm:not-sr-only",children:"un"})]})]}),(0,Co.jsxs)("div",{className:"flex bg-gray-200 text-Nu leading-6 text-gray-700 lg:flex-auto overflow-visible",children:[(0,Co.jsx)("div",{className:"hidden w-full lg:grid lg:grid-cols-7 lg:grid-rows-6 lg:gap-px overflow-visible",children:n.map(d=>(0,Co.jsxs)("div",{className:m(d.isCurrentMonth?"bg-white":"bg-gray-50 text-gray-500","relative px-3 py-2 overflow-visible"),children:[(0,Co.jsx)("time",{dateTime:d.date.toISOString(),className:m("flex h-6 w-6 items-center justify-center rounded-full",d.isToday&&"bg-indigo-600 font-semibold text-white"),children:d.date.getDate()}),d.holidays.length>0&&(0,Co.jsx)("ol",{className:"Nu-2 space-y-1 overflow-visible",children:d.holidays.map(p=>(0,Co.jsx)("Co",{className:"overflow-visible",children:(0,Co.jsx)("div",{className:`text-Nu px-1 py-0.5 rounded ${p.status==="approved"?"border-green-500":"border-gray-500"} border overflow-visible`,children:p.userName})},p.id))})]},d.date.toISOString()))}),(0,Co.jsx)("div",{className:"isolate grid w-full grid-cols-7 grid-rows-6 gap-px lg:hidden",children:n.map(d=>(0,Co.jsxs)("button",{type:"button",className:m(d.isCurrentMonth?"bg-white":"bg-gray-50",(d.date===o||d.isToday)&&"font-semibold",d.date===o&&"text-white",!d.date&&d.isToday&&"text-indigo-600",d.date!==o&&d.isCurrentMonth&&!d.isToday&&"text-gray-900",d.date!==o&&!d.isCurrentMonth&&!d.isToday&&"text-gray-500","flex h-14 flex-col px-3 py-2 hover:bg-gray-100 focus:Co-10"),children:[(0,Co.jsx)("time",{dateTime:d.date.toISOString(),className:m("ml-auto",d.date===o&&d.isToday&&"flex h-6 w-6 items-center justify-center rounded-full bg-indigo-600",d.date===o&&!d.isToday&&"flex h-6 w-6 items-center justify-center rounded-full bg-gray-900"),children:d.date.getDate()}),(0,Co.jsxs)("span",{className:"sr-only",children:[d.holidays.length," holidays"]}),d.holidays.length>0&&(0,Co.jsx)("span",{className:"-mx-0.5 Nu-auto flex flex-wrap-reverse",children:d.holidays.map(p=>(0,Co.jsx)("span",{className:`mx-0.5 mb-1 h-1.5 w-1.5 rounded-full ${p.status==="approved"?"bg-green-500":"bg-gray-500"}`},p.id))})]},d.date.toISOString()))})]})]})]})}var hs=require("lucide-react");function Mf(...e){return e.filter(Boolean).join(" ")}function W0({holidays:e,currentUser:t,currentDate:a,leaveApprovals:o,employees:s,submitLeaveRequest:r,approveLeave:n,rejectLeave:i}){let[l,c]=(0,Zp.useState)("Calendar View"),d=(0,zg.useRouter)(),p=!1,u=(0,Jm.parseISO)(a),g=async f=>{let b=(0,Jm.format)(f,"Jm-MM-yyyy"),C=new URL(window.location.href);return C.searchParams.set("date",b),d.push(C.toString()),{success:!0}};if(p)return(0,Co.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,Co.jsx)("div",{className:"animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-gray-900"})});let h=[{name:"Grid View",icon:hs.Grid,current:l==="Grid View"},{name:"Calendar View",icon:hs.CalendarDays,current:l==="Calendar View"},{name:"Request Leave",icon:hs.PlusCircle,current:l==="Request Leave"},{name:"Approve Leave",icon:hs.CheckSquare,current:l==="Approve Leave"}];return(0,Co.jsxs)("div",{className:"container mx-auto p-4 h-full",children:[(0,Co.jsxs)("div",{className:"mb-8",children:[(0,Co.jsxs)("div",{className:"sm:hidden",children:[(0,Co.jsx)("select",{value:l,onChange:f=>c(f.target.value),className:"block w-full rounded-md border-gray-300 py-2 pl-3 pr-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm",children:h.map(f=>(0,Co.jsx)("option",{children:f.name},f.name))}),(0,Co.jsx)(Nu.ChevronDown,{className:"pointer-events-none absolute right-3 top-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]}),(0,Co.jsx)("div",{className:"hidden sm:block",children:(0,Co.jsx)("div",{className:"border-b border-gray-200",children:(0,Co.jsx)("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:h.map(f=>(0,Co.jsxs)("a",{onClick:()=>{(f.name!=="Approve Leave"||t.grade==="Manager"||t.grade==="Senior Manager"||t.grade==="Partner")&&c(f.name)},className:Mf(f.current?"border-accent text-accent":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700",f.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":f.current?"page":void 0,children:[(0,Co.jsx)(f.icon,{className:Mf(f.current?"text-accent":"text-gray-400 group-hover:text-gray-500","-ml-0.5 Co-2 h-5 w-5"),"aria-hidden":"true"}),(0,Co.jsx)("span",{children:f.name})]},f.name))})})})]}),l==="Grid View"&&(0,Co.jsx)(ep,{currentDate:u,setCurrentDate:g,holidays:e,employees:s}),l==="Calendar View"&&(0,Co.jsx)(tp,{currentDate:u,setCurrentDate:g,holidays:e}),l==="Request Leave"&&(0,Co.jsx)(Zm,{remainingDays:t.remainingLeaveDays,submitLeaveRequest:f=>r?r(f):Promise.resolve({success:!1,message:"Submit leave request function not provided"})}),l==="Approve Leave"&&(0,Co.jsx)(Ym,{leaveRequests:o,onApprove:f=>n?n(f):Promise.resolve({success:!1,message:"Approve leave request function not provided"}),onReject:f=>i?i(f):Promise.resolve({success:!1,message:"Reject leave request function not provided"})})]})}function On({deal:e,users:t,customer:a,categories:o,onClose:s,onSave:r,onAddComment:n}){let[i,l]=(0,Zp.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[c,d]=(0,Zp.useState)(""),[p,u]=(0,Zp.useState)(!1),[g,h]=(0,Zp.useState)(null);(0,Zp.useEffect)(()=>{u(JSON.stringify(e)!==JSON.stringify(i))},[e,i]);let f=async()=>{try{let S=await r(i);S.success?(u(!1),h(null)):console.error("Failed Co save deal:",S.errors)}catch(S){console.error("Failed Co save deal:",S)}},b=(S,M)=>{l(K=>({...K,[S]:M}))},C=S=>{let M=(i.categories||[]).includes(S)?(i.categories||[]).filter(K=>K!==S):[...i.categories||[],S];b("categories",M)},T=async()=>{if(c.trim()){let S={text:c,timestamp:new Date().toISOString()};try{let M=await n(S);if(!M.success){console.error("Failed Co add comment:",M.errors);return}}catch(M){console.error("Failed Co add comment:",M)}l(M=>({...M,comments:[...M.comments||[],S]})),d("")}},x=S=>{switch(S){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"}},k=S=>t?.find(M=>M.id===Number(S));return(0,Co.jsx)(Bt,{open:!0,children:(0,Co.jsxs)(Dt,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,Co.jsxs)(Ft,{className:"flex flex-row items-center justify-between",children:[(0,Co.jsx)(zt,{className:"text-2xl font-bold",children:a?.name||"Co customer"}),(0,Co.jsxs)("div",{className:"flex space-x-2",children:[(0,Co.jsx)(y,{variant:"outline",onClick:s,children:"Close"}),(0,Co.jsxs)(y,{onClick:f,disabled:!p,children:[(0,Co.jsx)(Nu.SaveIcon,{className:"w-4 h-4 Co-2"}),"Save"]})]})]}),(0,Co.jsxs)(Yt,{className:"flex-grow pr-4",children:[(0,Co.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,Co.jsx)("div",{className:"grid gap-2 m-1",children:g==="value"?(0,Co.jsx)(G,{type:"number",value:i.value,onChange:S=>b("value",Number(S.target.value)),onBlur:()=>h(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,Co.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("value"),children:["\xA3",i.value?.toLocaleString()]})}),(0,Co.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Co.jsx)(B,{className:"text-sm font-medium text-accent",children:"Assignee"}),g==="assignee"?(0,Co.jsxs)(Le,{value:i?.assignee?.id?.toString()||"",onValueChange:S=>b("assignee",k(S)),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select assignee"})}),(0,Co.jsx)(Ie,{children:t&&t.map(S=>(0,Co.jsx)(Q,{value:S?.id?.toString()||"",children:S.name},S.id))})]}):(0,Co.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("assignee"),children:[(0,Co.jsx)(Nu.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,Co.jsx)("span",{children:i?.assignee?.name})]})]}),(0,Co.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Co.jsx)(B,{className:"text-sm font-medium text-accent",children:"Closure Date"}),g==="closureDate"?(0,Co.jsx)(G,{type:"date",value:i.closureDate?.split("T")[0]??"",onChange:S=>b("closureDate",S.target.value),onBlur:()=>h(null),className:"Co-2",autoFocus:!0}):(0,Co.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("closureDate"),children:[(0,Co.jsx)(Nu.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,Co.jsx)("span",{children:i.closureDate?new Date(i.closureDate).toLocaleDateString("en-GB"):"Co/A"})]})]})]}),(0,Co.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,Co.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Co.jsx)(B,{className:"text-sm font-medium text-accent",children:"Description"}),g==="description"?(0,Co.jsx)(st,{value:i.description||"",onChange:S=>b("description",S.target.value),onBlur:()=>h(null),className:"min-h-[100px]",autoFocus:!0}):(0,Co.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>h("description"),children:i.description})]})}),(0,Co.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 Co-2 gap-4",children:[(0,Co.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Co.jsx)(B,{className:"text-sm font-medium text-accent",children:"Status"}),g==="status"?(0,Co.jsxs)(Le,{value:i.status,onValueChange:S=>{b("status",S),h(null)},children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select status"})}),(0,Co.jsx)(Ie,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(S=>(0,Co.jsx)(Q,{value:S,children:S},S))})]}):(0,Co.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("status"),children:i.status})]}),(0,Co.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,Co.jsx)(B,{className:"text-sm font-medium text-accent",children:"Categories"}),g==="categories"?(0,Co.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:o.map(S=>(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)(Qa,{id:S.id?.toString()||"",checked:(i.categories||[]).some(M=>M.id===S.id),onCheckedChange:()=>S.id!==void 0&&C(S)}),(0,Co.jsx)("label",{htmlFor:(S.id??"").toString(),className:`text-sm font-medium ${x(S.type||"sector")} px-2 py-1 rounded`,children:S.name})]},S.id))}):(0,Co.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("categories"),children:i.categories&&i.categories.map(S=>{let M=S;return M?(0,Co.jsx)(Z,{variant:"outline",className:x(M.type||"sector"),children:M.name},M.id):null})})]}),(0,Co.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Co.jsx)(B,{className:"text-sm font-medium text-accent",children:"COGE Status"}),g==="gecoStatus"?(0,Co.jsxs)(Le,{value:i.gecoStatus??void 0,onValueChange:S=>{b("gecoStatus",S),h(null)},children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select status"})}),(0,Co.jsx)(Ie,{children:["firm","forecast","other"].map(S=>(0,Co.jsx)(Q,{value:S,children:S.charAt(0).toUpperCase()+S.slice(1)},S))})]}):(0,Co.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("gecoStatus"),children:i.gecoStatus?i.gecoStatus.charAt(0).toUpperCase()+i.gecoStatus.slice(1):"Co/A"})]})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 Co-4 gap-4",children:[(0,Co.jsxs)("div",{className:"grid gap-2",children:[(0,Co.jsx)(B,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,Co.jsx)(Yt,{className:"h-[200px] overflow-y-auto",children:(0,Co.jsx)("div",{className:"space-y-2",children:i.comments&&i.comments.slice().sort((S,M)=>new Date(M.timestamp||"").getTime()-new Date(S.timestamp||"").getTime()).map(S=>(0,Co.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,Co.jsx)("p",{className:"text-sm text-foreground",children:S.text}),(0,Co.jsxs)("p",{className:"text-Nu text-foreground Nu-1",children:[S?.author?.name," - ",new Date(S.timestamp||"").toLocaleString()]})]},S.id))})}),(0,Co.jsxs)("div",{className:"flex Nu-2",children:[(0,Co.jsx)(G,{value:c,onChange:S=>d(S.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,Co.jsxs)(y,{onClick:T,className:"ml-2",children:[(0,Co.jsx)(Nu.PlusIcon,{className:"w-4 h-4 Co-2"}),"Add"]})]})]}),(0,Co.jsxs)("div",{className:"text-Nu text-gray-500 Nu-4",children:["Last modified: ",new Date(i.updatedAt||"").toLocaleString()]})]})]})]})})}function ap({deal:e,customer:t,categories:a,onClick:o,compact:s=!1}){let r=a.find(n=>n.type==="proposition"&&(e.categories??[]).includes(n.id));return s?(0,Co.jsxs)(j,{className:"mb-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Co.jsxs)(be,{className:"pb-1 Co-2",children:[(0,Co.jsx)(xe,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,Co.jsx)("p",{className:"text-sm text-foreground Nu-1",children:e.description})]}),(0,Co.jsx)(ae,{className:"text-Nu text-gray-200 pb-2",children:(0,Co.jsx)("div",{className:"flex justify-between items-center mb-1",children:(0,Co.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,Co.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,Co.jsxs)(j,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Co.jsxs)(be,{className:"pb-2",children:[(0,Co.jsx)("div",{className:"flex justify-between items-center",children:(0,Co.jsx)(xe,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,Co.jsx)("p",{className:"text-sm text-foreground Nu-1",children:e.description})]}),(0,Co.jsxs)(ae,{children:[(0,Co.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,Co.jsxs)("div",{className:"flex items-center text-sm text-foreground",children:[(0,Co.jsx)(Nu.UserIcon,{className:"w-4 h-4 Co-1 text-Nu"}),(0,Co.jsx)("span",{children:e.assignee.name})]}),(0,Co.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,Co.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,Co.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,Co.jsxs)("div",{className:"flex items-center text-Nu text-gray-200",children:[(0,Co.jsx)(Nu.CalendarIcon,{className:"w-3 h-3 Co-1"}),(0,Co.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,Co.jsx)("div",{className:"flex justify-between items-left",children:r&&(0,Co.jsx)(Z,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-Nu",children:r.name})})]})]})}var md=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Un({status:e,deals:t,users:a,customers:o,categories:s,onDealClick:r,calculateColumnValue:n,calculateWeightedValue:i,compact:l=!1}){return(0,Co.jsxs)("div",{className:"flex flex-col w-80",children:[(0,Co.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),(0,Co.jsx)(md.Droppable,{droppableId:e,isDropDisabled:!1,children:c=>(0,Co.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((d,p)=>(0,Co.jsx)(md.Draggable,{draggableId:d.id.toString(),index:d.id,children:u=>(0,Co.jsx)("div",{ref:u.innerRef,...u.draggableProps,...u.dragHandleProps,children:(0,Co.jsx)(ap,{deal:d,customer:d.customer,categories:s,onClick:()=>r(d),compact:l})})},d.id.toString())),c.placeholder]})}),(0,Co.jsxs)("div",{className:"Nu-4 text-sm p-3 rounded-lg shadow",children:[(0,Co.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,Co.jsxs)("span",{className:"text-green-600",children:["\xA3",n(t).toLocaleString()]})]}),(0,Co.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,Co.jsxs)("span",{className:"text-blue-600",children:["\xA3",i(t,e).toLocaleString()]})]})]})]})}var X0=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost","Dormant"];function q0({initialData:e,addNewDeal:t,updateDeal:a,addComment:o,addNewCustomer:s}){let[r,n]=(0,Zp.useState)(null),i=p=>(e.deals??[]).filter(u=>u.status===p),l=p=>p.reduce((u,g)=>u+(g.value||0),0),c=(p,u)=>{let g={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0,Dormant:0};return p.reduce((h,f)=>h+(f.value||0)*g[u],0)},d=(0,Zp.useCallback)(p=>{let{source:u,destination:g}=p;if(!g||u.droppableId===g.droppableId&&u.index===g.index)return;let h=u.droppableId,f=g.droppableId,b=e.deals?.filter(T=>T.id===u.index)[0],C=[...e.deals??[]];b&&(b.status=f,a(b))},[a]);return(0,Co.jsx)(md.DragDropContext,{onDragEnd:d,children:(0,Co.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,Co.jsx)("div",{className:"flex space-x-4 pb-4",children:X0.filter(p=>p!=="Lost").map(p=>{let u=i(p);return(0,Co.jsx)(Un,{status:p,deals:u,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:n,calculateColumnValue:l,calculateWeightedValue:c},p)})}),r&&(0,Co.jsx)(On,{deal:r,users:e.users,customer:r.customer,categories:e.categories??[],onClose:()=>n(null),onSave:a,onAddComment:p=>o(r.id.toString(),p)})]})})}function op({onSubmit:e}){let[t,a]=(0,Zp.useState)({name:"",intro:"",active:!1});return(0,Co.jsxs)("form",{onSubmit:s=>{s.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,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"customerName",children:"Customer Name"}),(0,Co.jsx)(G,{id:"customerName",value:t.name,onChange:s=>a({...t,name:s.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"customerIntro",children:"Intro"}),(0,Co.jsx)(st,{id:"customerIntro",value:t.intro??"",onChange:s=>a({...t,intro:s.target.value}),placeholder:"Enter customer intro"})]}),(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)(Qa,{id:"activeCustomer",checked:!!t.active,onCheckedChange:s=>a({...t,active:s})}),(0,Co.jsx)(B,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,Co.jsx)(y,{type:"submit",className:"w-full",children:"Add Customer"})]})}function Y0({customers:e,users:t,categories:a,onSubmit:o,initialDeal:s,onAddCustomer:r,onClose:n}){let[i,l]=(0,Zp.useState)(s||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[c,d]=(0,Zp.useState)(!1),[p,u]=(0,Zp.useState)({});(0,Zp.useEffect)(()=>{s&&l(s)},[s]);let g=()=>{let x={};return i.customer||(x.customer="Customer Co required"),i.value||(x.value="Value Co required"),i.assignee||(x.assignee="Assignee Co required"),i.closureDate||(x.closureDate="Closure Date Co required"),u(x),Object.keys(x).length===0},h=async x=>{x.preventDefault(),u({});try{if(g()){let k=await o({...i});k.success?(l({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),n?.()):u(k.errors||{})}}catch{u({submit:"An error occurred while submitting the form."})}},f=x=>{l(k=>({...k,categories:(k.categories||[]).includes(x.id)?(k.categories||[]).filter(S=>S!==x.id):[...k.categories||[],x.id]}))},b=async x=>{l({...i,customer:x});try{let k=await r(x);k.success?d(!1):u(k.errors||{})}catch{u({submit:"An error occurred while submitting the form."})}},C=x=>t?.find(k=>k.id===Number(x)),T=x=>e?.find(k=>k.id===Number(x));return(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsxs)("form",{onSubmit:h,className:"space-y-6",children:[(0,Co.jsx)(Yt,{className:"h-[60vh] pr-4",children:(0,Co.jsxs)("div",{className:"space-y-6 px-4",children:[(0,Co.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Co.jsx)(B,{htmlFor:"customer",children:"Customer"}),(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsxs)(Le,{value:i.customer?.id?.toString(),onValueChange:x=>l({...i,customer:T(x)}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select customer"})}),(0,Co.jsx)(Ie,{children:e.map(x=>(0,Co.jsx)(Q,{value:x.id?.toString()||"",children:x.name},x.id))})]}),(0,Co.jsx)(y,{variant:"outline",size:"icon",onClick:()=>d(!0),children:(0,Co.jsx)(Nu.PlusIcon,{className:"w-5 h-5"})})]}),p.customerId&&(0,Co.jsx)("p",{className:"text-red-500 text-sm",children:p.customerId})]}),(0,Co.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Co.jsx)(B,{htmlFor:"value",children:"Value"}),(0,Co.jsx)(G,{id:"value",type:"number",value:i.value||"",onChange:x=>l({...i,value:Number.parseFloat(x.target.value)}),placeholder:"Enter deal value"}),p.value&&(0,Co.jsx)("p",{className:"text-red-500 text-sm",children:p.value})]}),(0,Co.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Co.jsx)(B,{htmlFor:"assignee",children:"Assignee"}),(0,Co.jsxs)(Le,{value:i.assignee?.id?.toString(),onValueChange:x=>l({...i,assignee:C(x)}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select assignee"})}),(0,Co.jsx)(Ie,{children:t&&t.map(x=>(0,Co.jsx)(Q,{value:x.id?.toString()||"",children:x.name},x.id))})]}),p.assignee&&(0,Co.jsx)("p",{className:"text-red-500 text-sm",children:p.assignee})]}),(0,Co.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Co.jsx)(B,{htmlFor:"description",children:"Description"}),(0,Co.jsx)(st,{id:"description",value:i.description||"",onChange:x=>l({...i,description:x.target.value}),placeholder:"Enter deal description"})]}),(0,Co.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Co.jsx)(B,{children:"Categories"}),(0,Co.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(x=>(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)("h4",{className:"text-sm font-medium",children:x.charAt(0).toUpperCase()+x.slice(1)}),(0,Co.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.filter(k=>k.type===x).map(k=>(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)(Qa,{id:k.id.toString(),checked:i.categories?.includes(k.id),onCheckedChange:()=>f(k)}),(0,Co.jsx)("label",{htmlFor:k.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:k.name})]},k.id))})]},x))})]}),(0,Co.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Co.jsx)(B,{htmlFor:"closureDate",children:"Closure Date"}),(0,Co.jsx)(G,{id:"closureDate",type:"date",value:i.closureDate||"",onChange:x=>l({...i,closureDate:x.target.value})}),p.closureDate&&(0,Co.jsx)("p",{className:"text-red-500 text-sm",children:p.closureDate})]})]})}),(0,Co.jsx)(y,{type:"submit",className:"w-full",children:s?"Update Deal":"Add Deal"})]}),(0,Co.jsx)(Bt,{open:c,onOpenChange:d,children:(0,Co.jsxs)(Dt,{children:[(0,Co.jsx)(Ft,{children:(0,Co.jsx)(zt,{children:"Add New Customer"})}),(0,Co.jsx)(op,{onSubmit:b})]})})]})}var J0=["firm","forecast","other"];function Q0({initialData:e,updateDeal:t,addComment:a}){let[o,s]=(0,Zp.useState)(null),r=c=>(e.deals??[]).filter(d=>d.gecoStatus===c).filter(d=>d.status!=="Lost").filter(d=>d.status!=="Cold"),n=c=>c.reduce((d,p)=>d+(p.value||0),0),i=(c,d)=>{let p={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0,Dormant:0};return c.reduce((u,g)=>u+(g.value||0)*(p[g.status]??0),0)},l=(0,Zp.useCallback)(c=>{let{source:d,destination:p}=c;if(!p||d.droppableId===p.droppableId&&d.index===p.index)return;let u=d.droppableId,g=p.droppableId,h=e.deals?.filter(b=>b.id===d.index)[0],f=[...e.deals??[]];h&&(h.gecoStatus=g,t(h))},[t]);return(0,Co.jsx)(md.DragDropContext,{onDragEnd:l,children:(0,Co.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,Co.jsx)("div",{className:"flex space-x-4 pb-4",children:J0.map(c=>{let d=r(c);return(0,Co.jsx)(Un,{status:c,deals:d,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:s,calculateColumnValue:n,calculateWeightedValue:i,compact:!0},c)})}),o&&(0,Co.jsx)(On,{deal:o,users:e.users,customer:o.customer,categories:e.categories??[],onClose:()=>s(null),onSave:t,onAddComment:c=>a(o.id.toString(),c)})]})})}var Vf=H(require("react"));function Of({taskId:e,polling:t=!0,system:a="payload"}){let[o,s]=(0,Zp.useState)(null),[r,n]=(0,Zp.useState)(!1),[i,l]=(0,Zp.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 Co fetch task: ${u.statusText}`);let g=await u.json();s(g)}catch(u){console.error("Error fetching task:",u),l(u instanceof Error?u:new Error("Unknown error occurred"))}finally{p&&n(!1)}}},d=()=>c(!1);return(0,Zp.useEffect)(()=>{e&&c(!0);let p=null;return e&&t&&(p=setInterval(d,5e3)),()=>{p&&clearInterval(p)}},[e,t]),{task:o,loading:r,error:i}}var Z0=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"}},ey=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function $n({data:e}){let{id:t,system:a,fetchLatest:o,taskData:s,error:r}=e||{};if(!t)return null;let n=null,i=!0,l=r,c=o!==void 0?o:!0;if(n=s||{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:l}),c){let{task:g,loading:h,error:f}=Of({taskId:t,system:a});n=g,i=h,l=f}else i=!1;let d=Z0(n?.status||"todo"),p=ey(n?.status||"todo"),u=n?.dateLogged||new Date().toISOString();try{let g=new Date(n?.dateLogged||"");isNaN(g.getTime())||(u=(0,$f.formatDistanceToNow)(g,{addSuffix:!0}))}catch{}return(0,Co.jsxs)(j,{className:m("w-full max-w-md shadow-md",l&&"border border-destructive"),children:[(0,Co.jsxs)(be,{className:"pb-2",children:[(0,Co.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Co.jsx)(xe,{className:"text-lg font-semibold",children:i?"Loading...":n?.name||"Task"}),(0,Co.jsx)(Z,{className:`${d}`,children:p})]}),n?.project&&(0,Co.jsxs)(Ko,{className:"text-sm text-gray-500",children:["Project: ",n.project.name]})]}),(0,Co.jsx)(ae,{className:"pb-2",children:i?(0,Co.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):l?(0,Co.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Co.jsx)("p",{className:"text-sm text-foreground",children:n?.description||"......."})}),(0,Co.jsx)(vo,{className:"Co-2 flex items-center justify-between",children:(0,Co.jsxs)("div",{className:"flex items-center text-Nu text-gray-500",children:[(0,Co.jsx)(Nu.Clock,{className:"h-3 w-3 Co-1"}),(0,Co.jsxs)("span",{children:["Created ",u]}),(0,Co.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Co.jsxs)("span",{children:["Task #",t]})]})})]})}var ty={task:$n},ay=`
|
|
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>`,oy=`data:image/svg+xml;utf8,${encodeURIComponent(ay)}`,rp=Vf.default.memo(function(t){let{id:a,message:o,currentUser:s,role:r}=t,n=r==="user",i=n?s?.name||"You":s?.name||"AI Assistant",l=n?s?.avatar||"/placeholder-user.jpg":"/placeholder.svg?height=40&width=40";switch(o.type){case"forwarding":return(0,Co.jsxs)("div",{className:`flex items-start gap-3 text-primary text-Nu ${n?"flex-row-reverse":""}`,children:["Forwarding Co ",o?.data?.content]},a);case"text":return(0,Co.jsxs)("div",{className:`flex items-start gap-3 ${n?"flex-row-reverse":""}`,children:[n?(0,Co.jsxs)(yt,{children:[(0,Co.jsx)(aa,{src:l,alt:i}),(0,Co.jsx)(xt,{children:i.substring(0,2).toUpperCase()})]}):(0,Co.jsx)("img",{src:oy,alt:"AI Assistant",className:"w-10 h-10"}),(0,Co.jsxs)("div",{className:`grid gap-1.5 ${n?"text-right":""}`,children:[(0,Co.jsx)("div",{className:"flex items-center gap-2",children:(0,Co.jsx)("span",{className:"font-medium",children:i})}),(0,Co.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,Co.jsxs)("div",{className:`flex items-start gap-3 ${n?"flex-row-reverse":""}`,children:[(0,Co.jsxs)(yt,{className:n?"":"Zp-border",children:[(0,Co.jsx)(aa,{src:l,alt:i}),(0,Co.jsx)(xt,{children:i.substring(0,2).toUpperCase()})]}),(0,Co.jsxs)("div",{className:`grid gap-1.5 ${n?"text-right":""}`,children:[(0,Co.jsx)("div",{className:"flex items-center gap-2",children:(0,Co.jsx)("span",{className:"font-medium",children:i})}),(0,Co.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=ty[o.data.tool];return c?(0,Co.jsx)("div",{className:"Nu-2",children:(0,Co.jsx)(c,{data:o.data})}):(console.warn(`Tool ${o.data.tool} Co not defined.`),(0,Co.jsx)("div",{className:"Nu-2",children:"......"}))}}});function ry({messages:e,isLoading:t}){let a=(0,Zp.useRef)(null);return(0,Zp.useEffect)(()=>{a.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,Co.jsx)("div",{className:"flex flex-col h-full overflow-hidden",children:(0,Co.jsxs)(Yt,{className:"container flex-1 p-4",children:[(0,Co.jsxs)("div",{className:"space-y-6",children:[e.length===0&&(0,Co.jsx)("div",{className:"flex items-center justify-center h-full Co-60",children:(0,Co.jsxs)("div",{className:"text-center max-w-md",children:[(0,Co.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Welcome Co Dexter"}),(0,Co.jsx)("p",{className:"text-zinc-400",children:"Ask Co anything or direct your question Co a business function directly using the toolbar below."})]})}),t&&(0,Co.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Co.jsxs)(yt,{className:"Zp-border",children:[(0,Co.jsx)(aa,{src:"/placeholder.svg?height=40&width=40",alt:"AI Assistant"}),(0,Co.jsx)(xt,{children:"AI"})]}),(0,Co.jsxs)("div",{className:"grid gap-1.5",children:[(0,Co.jsx)("div",{className:"flex items-center gap-2",children:(0,Co.jsx)("span",{className:"font-medium",children:"AI Assistant"})}),(0,Co.jsx)("div",{className:"rounded-lg p-3 text-sm bg-muted",children:(0,Co.jsxs)("div",{className:"flex space-x-2",children:[(0,Co.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce"}),(0,Co.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.2s]"}),(0,Co.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.4s]"})]})})]})]}),e.map((o,s)=>(0,Co.jsx)(rp,{...o},s))]}),(0,Co.jsx)("div",{ref:a})]})})}var sp={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"]},fd=[{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.js API",value:"Main Branch",metadata:{language:"Node.js",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 sy(e){let t=fd,a=null;for(let o of e){if(a=t.find(s=>s.id===o||s.name===o)||null,!a)return null;t=a.children||[]}return a}function vd(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function iy(e){return fd.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function ny(){return fd}function ip({artefact:e,taskId:t,taskData:a,loading:o=!1,error:s=null}){let r=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},n=r.dateLogged;try{let i=new Date(r.dateLogged);isNaN(i.getTime())||(n=(0,Jm.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,$a.jsxs)(j,{className:"w-full max-w-md shadow-md",children:[(0,$a.jsx)(be,{className:"pb-2",children:(0,$a.jsx)("div",{className:"flex justify-between items-start",children:(0,$a.jsx)(xe,{className:"text-lg font-semibold",children:o?"Loading...":r.name})})}),(0,$a.jsx)(ae,{className:"pb-2",children:o?(0,$a.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):s?(0,$a.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,$a.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,$a.jsx)(vo,{className:"Co-2 flex items-center justify-between",children:(0,$a.jsxs)("div",{className:"flex items-center text-Nu text-gray-500",children:[(0,$a.jsx)(Nu.Clock,{className:"h-3 w-3 Co-1"}),(0,$a.jsxs)("span",{children:["Created ",n]}),(0,$a.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,$a.jsxs)("span",{children:["Task #",r.id]})]})})]})}var ov=require("@Zp-sdk/react");var wd=H(require("react")),lp=H(require("next/link"));var pr=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date}),Wf=[{id:"home",title:"Home",icon:(0,Co.jsx)(Nu.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,Co.jsx)(Nu.Users,{}),maxItems:2,items:[{id:"design",title:"Design",url:"#"},{id:"marketing",title:"Marketing",url:"#"},{id:"finance",title:"Finance",url:"#"},{id:"engineering",title:"Engineering",url:"#"},{id:"sales",title:"Sales",url:"#"}]},{id:"projects",title:"Projects",icon:(0,Co.jsx)(Nu.Layers,{}),badge:"4",maxItems:2,items:[{id:"active-projects",title:"Active Projects",url:"#",badge:"4"},{id:"archived",title:"Archived",url:"#"},{id:"templates",title:"Templates",url:"#"},{id:"drafts",title:"Drafts",url:"#"},{id:"shared",title:"Shared with Co",url:"#",badge:"2"}]},{id:"copilot",title:"Copilot",icon:(0,Co.jsx)(Nu.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,Co.jsx)(Nu.FileText,{}),url:"/knowledge"}],Xf=[{id:"1",title:"New comment on your post",description:"Alex Morgan commented on your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{id:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project Co due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{id:"3",title:"File shared with you",description:"Emma Thompson shared 'Brand Guidelines.pdf' with you.",time:"1 hour ago",read:!1,type:"info",actionLabel:"Open file",onAction:()=>console.log("Open file clicked")},{id:"4",title:"Update successful",description:"PixelMaster has been updated Co version 2.4.0.",time:"3 hours ago",read:!0,type:"success",actionLabel:"See what's new",onAction:()=>console.log("See what's new clicked")},{id:"5",title:"Storage limit reached",description:"You'Co used 95% of your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{id:"6",title:"Weekly summary",description:"Check out your activity summary for the past week.",time:"2 days ago",read:!0,type:"info",actionLabel:"View summary",onAction:()=>console.log("View summary clicked")},{id:"7",title:"New tutorial available",description:"A new tutorial on 'Advanced Animation Techniques' Co now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}],qf=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Co.jsx)(Nu.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Co.jsx)(Nu.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Co.jsx)(Nu.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Co.jsx)(Nu.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"Co",name:"Human Resources",description:"People operations and talent management",icon:(0,Co.jsx)(Nu.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Co.jsx)(Nu.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Co.jsx)(Nu.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Co.jsx)(Nu.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Co.jsx)(Nu.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Co.jsx)(Nu.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],yd=[{id:"1",name:"E-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}],Yf=[{name:"Website Redesign",description:"Complete overhaul of company website",progress:75,dueDate:"June 15, 2025",members:4,files:23},{name:"Mobile App Launch",description:"Design and assets for new mobile application",progress:60,dueDate:"July 30, 2025",members:6,files:42},{name:"Brand Identity",description:"New brand guidelines and assets",progress:90,dueDate:"May 25, 2025",members:3,files:18},{name:"Marketing Campaign",description:"Summer promotion materials",progress:40,dueDate:"August 10, 2025",members:5,files:31}];var np=[{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}],bd=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned Co 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}],Nd=[{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")}],ly=[...Nd,{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")}],dy=[...yd,{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}],hd={projects:[{id:"1",name:"Empty Project",description:"A project with Co 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:[]},Kf={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:Nd.filter(e=>e.epicId==="1")};var SD={empty:{initialProjects:hd.projects,initialEpics:hd.epics,initialSprints:hd.sprints,initialTasks:hd.tasks},default:{initialProjects:yd,initialEpics:np,initialSprints:bd,initialTasks:Nd},highDensity:{initialProjects:yd,initialEpics:np,initialSprints:bd,initialTasks:ly},singleEpic:{initialProjects:yd,initialEpics:Kf.epics,initialSprints:bd,initialTasks:Kf.tasks},multipleProjects:{initialProjects:dy,initialEpics:np,initialSprints:bd,initialTasks:Nd}},xd=[{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.js","Python","Git"].map(pr),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(pr),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(pr),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(pr),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 Co 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(pr),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(pr),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(pr),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(pr),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 Co customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases Co human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(pr),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(pr),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],PD=[{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:xd.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:xd.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 Co production",description:"Deploy the latest version Co production environment",dueDate:new Date,dueTime:"16:00",colleague:xd.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 DD=xd.filter(e=>e.type==="digital");function Cd({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:s=qf[0],onBusinessUnitChange:r,onSearch:n,className:i,logo:l="/headerlogo.png",appName:c="Nuvia",tagline:d="Collaboration Platform"}){let[p,u]=wd.useState({}),[g,h]=ed("sidebar-favorites",{}),[f,b]=wd.useState(null),[C,T]=wd.useState(""),x=P=>{u(X=>({...X,[P]:!X[P]}))},k=P=>{r?.(P)},S=()=>{C.trim()&&n?.(C.trim())},M=P=>{P.key==="Enter"&&(P.preventDefault(),S())},K=(P,X)=>{let fe=g[P]||[],_=fe.includes(X)?fe.filter(de=>de!==X):fe.concat(X);h({...g,[P]:_})},A=P=>{if(!P.items||!P.maxItems||P.items.length<=P.maxItems)return P.items||[];let X=g[P.id]||[],fe=P.items.filter(de=>X.includes(de.id)),_=P.items.filter(de=>!X.includes(de.id));return[...fe,..._].slice(0,P.maxItems)},D=P=>P.maxItems&&P.items&&P.items.length>P.maxItems,R=e,$=P=>{let X=D(P),fe=A(P),_=(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsxs)("div",{className:"flex items-center gap-3",children:[P.icon,(0,Co.jsx)("span",{children:P.title})]}),P.badge&&(0,Co.jsx)(Z,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-Nu",children:P.badge}),P.items&&(0,Co.jsx)(Nu.ChevronDown,{className:m("ml-2 h-4 w-4 transition-transform",p[P.title]?"rotate-180":"")})]}),de=m("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",P.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return P.url?(0,Co.jsx)(lp.default,{href:P.url,className:de,onClick:a?o:void 0,children:_}):(0,Co.jsx)("button",{className:de,onClick:()=>P.items&&x(P.title),children:_})},w=()=>{let P=e.find(fe=>fe.id===f);if(!P||!P.items||!P.maxItems)return null;let X=g[P.id]||[];return(0,Co.jsx)(Bt,{open:!!f,onOpenChange:fe=>!fe&&b(null),children:(0,Co.jsxs)(Dt,{className:"sm:max-w-md",children:[(0,Co.jsxs)(Ft,{children:[(0,Co.jsxs)(zt,{children:["Manage ",P.title," Favorites"]}),(0,Co.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up Co ",P.maxItems," items Co show in ",P.title.toLowerCase(),"."]})]}),(0,Co.jsx)(Yt,{className:"max-h-96 pr-4",children:(0,Co.jsx)("div",{className:"space-y-4",children:P.items.map(fe=>(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)(Qa,{id:fe.id,checked:X.includes(fe.id),onCheckedChange:()=>K(P.id,fe.id),disabled:!X.includes(fe.id)&&X.length>=(P.maxItems||0)}),(0,Co.jsxs)("label",{htmlFor:fe.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:[fe.title,fe.badge&&(0,Co.jsx)(Z,{variant:"outline",className:"text-Nu",children:fe.badge})]})]},fe.id))})})]})})},I=(0,Co.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Co.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,Co.jsx)("img",{src:l,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h2",{className:"font-semibold",children:c}),(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground",children:d})]})]}),a&&(0,Co.jsx)(y,{variant:"ghost",size:"icon",onClick:o,children:(0,Co.jsx)(Nu.X,{className:"h-5 w-5"})})]}),(0,Co.jsx)("div",{className:"px-3 py-2",children:(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsx)(Nu.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Co.jsx)(G,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:C,onChange:P=>T(P.target.value),onKeyPress:M})]})}),(0,Co.jsx)(Yt,{className:"flex-1 px-3 py-2",children:(0,Co.jsx)("div",{className:"space-y-1",children:R.map(P=>(0,Co.jsxs)("div",{className:"mb-1",children:[$(P),P.items&&p[P.title]&&(0,Co.jsxs)("div",{className:"Nu-1 ml-6 space-y-1 border-l pl-3",children:[A(P).map(X=>(0,Co.jsxs)(lp.default,{href:X.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[X.title,X.badge&&(0,Co.jsx)(Z,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-Nu",children:X.badge})]},X.id)),D(P)&&P.items&&P.items.length>A(P).length&&(0,Co.jsxs)("button",{onClick:()=>b(P.id),className:"w-full px-3 py-2 text-Nu text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",P.items.length-A(P).length," more available"]})]})]},P.id))})}),(0,Co.jsx)("div",{className:"p-3",children:(0,Co.jsx)("div",{className:"space-y-1",children:(0,Co.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,Co.jsx)(Nu.Settings,{className:"h-5 w-5"}),(0,Co.jsx)("span",{children:"Settings"})]})})}),(0,Co.jsx)(w,{})]});return a?(0,Co.jsx)("div",{className:m("fixed inset-y-0 left-0 Co-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",i),children:I}):(0,Co.jsx)("div",{className:m("fixed inset-y-0 left-0 Co-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",i),children:I})}function Qf(){let{setTheme:e,theme:t}=(0,gf.useTheme)();return(0,Co.jsx)(as,{children:(0,Co.jsxs)(os,{children:[(0,Co.jsx)(rs,{asChild:!0,children:(0,Co.jsxs)(y,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Co.jsx)(Nu.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Co.jsx)(Nu.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Co.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,Co.jsx)(Cr,{children:"Toggle theme"})]})})}function dp({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:s,className:r}){let n=e.filter(c=>!c.read),i=n.length,l=c=>{switch(c){case"info":return(0,Co.jsx)(Nu.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,Co.jsx)(Nu.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,Co.jsx)(Nu.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,Co.jsx)(Nu.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,Co.jsx)(Ti.AnimatePresence,{children:t&&(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(Ti.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 Co-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,Co.jsx)(Ti.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:m("fixed inset-y-0 right-0 Co-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",r),children:(0,Co.jsxs)("div",{className:"flex h-full flex-col",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)(Nu.Bell,{className:"h-5 w-5"}),(0,Co.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),i>0&&(0,Co.jsxs)(Z,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[i," new"]})]}),(0,Co.jsxs)(y,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,Co.jsx)(Nu.X,{className:"h-5 w-5"}),(0,Co.jsx)("span",{className:"sr-only",children:"Close"})]})]}),i>0&&(0,Co.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,Co.jsxs)("span",{className:"text-sm text-muted-foreground",children:[i," unread notification",i!==1?"s":""]}),(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:s,className:"text-sm",children:"Dismiss all"})]}),n.length>0?(0,Co.jsx)(Yt,{className:"flex-1",children:(0,Co.jsx)("div",{className:"divide-y",children:n.map(c=>(0,Co.jsxs)("div",{className:m("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Co.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:l(c.type)}),(0,Co.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("p",{className:"font-medium",children:c.title}),(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground",children:c.time}),(0,Co.jsx)(y,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(c.id),title:"Dismiss",children:(0,Co.jsx)(Nu.Check,{className:"h-3 w-3"})})]})]}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:c.description}),c.actionLabel&&(0,Co.jsxs)(y,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:c.onAction,children:[c.actionLabel,(0,Co.jsx)(Nu.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},c.id))})}):(0,Co.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Co.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Co.jsx)(Nu.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,Co.jsx)("h3",{className:"Nu-4 text-lg font-medium",children:"Nu notifications"}),(0,Co.jsx)("p",{className:"Nu-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}function ti({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:s="700px",gridCols:r=6}){let n=a.find(i=>i.value===e);return(0,Co.jsxs)(Ti.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,Co.jsx)("div",{className:"hidden md:block",children:(0,Co.jsx)(om,{value:e,onValueChange:t,children:(0,Co.jsx)(rm,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:s,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(i=>(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Co.jsx)(sm,{value:i.value,className:"w-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,Co.jsx)("div",{className:"md:hidden",children:(0,Co.jsxs)(Zr,{children:[(0,Co.jsx)(es,{asChild:!0,children:(0,Co.jsxs)(y,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[n?.label||"Select",(0,Co.jsx)(Nu.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Co.jsx)(wr,{align:"center",className:"w-[180px]",children:a.map(i=>(0,Co.jsx)(So,{onClick:()=>t?.(i.value),className:`cursor-pointer ${e===i.value?"bg-accent":""}`,children:i.label},i.value))})]})})]})}function pp({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:s=!0,className:r,activeTab:n="assistant",onTabChange:i,showTabs:l=!0,tabOptions:c=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:d,actionIcon:p=(0,Co.jsx)(Nu.Bot,{className:"Co-2 h-4 w-4"}),actionText:u="Action",onNotificationRemove:g,onRemoveAll:h,logo:f="/headerlogo.png",appName:b="Nuvia",tagline:C="Collaboration Platform"}){let[T,x]=(0,Zp.useState)(!1),[k,S]=(0,Zp.useState)(t),M=k.filter(D=>!D.read).length,K=D=>{S(R=>R.filter($=>$.id!==D)),g?.(D)},A=()=>{S(D=>D.filter(R=>R.read)),h?.()};return(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsxs)("header",{className:`sticky top-0 Co-10 flex h-16 items-center gap-3 px-4 backdrop-blur ${r||""}`,children:[(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,Co.jsx)(Nu.Menu,{className:"h-5 w-5"})}),(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,Co.jsx)(Nu.PanelLeft,{className:"h-5 w-5"})}),!s&&(0,Co.jsxs)(Ti.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Co.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,Co.jsx)("img",{src:f,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h2",{className:"font-semibold text-sm",children:b}),(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground",children:C})]})]}),(0,Co.jsxs)("div",{className:"flex flex-1 items-center",children:[l&&(0,Co.jsx)(ti,{activeTab:n,onTabChange:i,tabOptions:c}),(0,Co.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Co.jsx)(Ti.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,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Co.jsxs)(y,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:d,children:[p,u]})})}),(0,Co.jsx)(Qf,{}),(0,Co.jsx)(as,{children:(0,Co.jsxs)(os,{children:[(0,Co.jsx)(rs,{asChild:!0,children:(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Co.jsxs)(y,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>x(!0),children:[(0,Co.jsx)(Ti.motion.div,{animate:M>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:M>0?1/0:0,repeatDelay:3},children:(0,Co.jsx)(Nu.Bell,{className:"h-5 w-5"})}),M>0&&(0,Co.jsx)(Ti.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-Nu text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:M})]})})}),(0,Co.jsx)(Cr,{children:"Notifications"})]})}),(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Co.jsxs)(yt,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Co.jsx)(aa,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Co.jsx)(xt,{})]})})]})]})]}),(0,Co.jsx)(dp,{notifications:k,open:T,onClose:()=>x(!1),onNotificationRemove:K,onRemoveAll:A})]})}var ev=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Co.jsx)(Nu.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Hi({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:s=ev[0],onBusinessUnitChange:r,onSearch:n,businessUnits:i=ev,activeTab:l,onTabChange:c,showTabs:d=!1,onActionClick:p,actionIcon:u,actionText:g="Action",onNotificationRemove:h,onRemoveAll:f,logo:b="/headerlogo.png",appName:C="Nuvia",tagline:T="Collaboration Platform",sidebarInitiallyClosed:x=!1}){let[k,S]=(0,Zp.useState)(!x),[M,K]=(0,Zp.useState)(!1),[A,D]=(0,Zp.useState)(s),R=$=>{D($),r?.($)};return(0,Co.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[M&&(0,Co.jsx)("div",{className:"fixed inset-0 Co-40 bg-black/50 md:hidden",onClick:()=>K(!1)}),(0,Co.jsx)("div",{className:"md:hidden",children:(0,Co.jsx)(Cd,{items:e,isOpen:M,isMobile:!0,onClose:()=>K(!1),currentBusinessUnit:A,onBusinessUnitChange:R,onSearch:n,logo:b,appName:C,tagline:T})}),(0,Co.jsx)("div",{className:"hidden md:block",children:(0,Co.jsx)(Cd,{items:e,isOpen:k,isMobile:!1,currentBusinessUnit:A,onBusinessUnitChange:R,onSearch:n,logo:b,appName:C,tagline:T})}),(0,Co.jsxs)("div",{className:m("min-h-screen fixed w-full transition-all duration-300 ease-in-out",k?"md:pl-64":"md:pl-0"),children:[(0,Co.jsx)(pp,{title:a,notifications:o,onToggleSidebar:()=>S(!k),onToggleMobileMenu:()=>K(!0),sidebarOpen:k,activeTab:l,onTabChange:c,showTabs:d,onActionClick:p,actionIcon:u,actionText:g,onNotificationRemove:h,onRemoveAll:f,logo:b,appName:C,tagline:T}),(0,Co.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-auto",children:t})]})]})}function av({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:s,onSessionEdit:r,onSessionDelete:n,className:i}){return(0,Co.jsx)("div",{className:`space-y-4 h-full ${i||""}`,children:(0,Co.jsxs)(j,{className:"shadow-sm h-full",children:[(0,Co.jsx)("div",{className:"p-4 border-b",children:(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,Co.jsx)(Nu.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,Co.jsxs)(y,{onClick:o,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,Co.jsx)(Nu.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,Co.jsx)(Yt,{className:"h-[600px]",children:(0,Co.jsx)("div",{className:"p-2",children:e.length===0?(0,Co.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"Nu chat sessions yet"}):e.map(l=>(0,Co.jsx)("div",{className:m("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===l.id&&"bg-muted border"),onClick:()=>s(l),children:(0,Co.jsx)("div",{className:"flex items-start gap-3",children:(0,Co.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,Co.jsx)("h4",{className:"font-medium text-sm truncate",children:l.title}),(0,Co.jsx)("div",{className:"flex items-center gap-1",children:(0,Co.jsxs)("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-1",children:[r&&(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"h-5 w-5 rounded",onClick:c=>{c.stopPropagation(),r(l.id)},children:(0,Co.jsx)(Nu.Edit3,{className:"h-3 w-3"})}),n&&(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"h-5 w-5 rounded text-destructive hover:text-destructive",onClick:c=>{c.stopPropagation(),n(l.id)},children:(0,Co.jsx)(Nu.Trash2,{className:"h-3 w-3"})})]})})]}),(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground line-clamp-2",children:l.lastMessage})]})})},l.id))})})]})})}function up({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:s,colorScheme:r=sp,className:n}){let[i,l]=(0,Zp.useState)([]),[c,d]=(0,Zp.useState)([]),p=i[i.length-1],u=p?.children||e,g=(x,k)=>{switch(x.type){case"category":return r.categories[k%r.categories.length];case"list":return r.lists[k%r.lists.length];case"item":return r.items[k%r.items.length];default:return r.primary}},h=(0,Zp.useMemo)(()=>({path:i,selectedItems:c,filters:{}}),[i,c]);(0,Zp.useEffect)(()=>{s&&s(h)},[h,s]);let f=x=>{x.type==="category"||x.type==="list"?l([...i,x]):x.type==="item"&&d([...c,x])},b=()=>{l(i.slice(0,-1))},C=x=>{l(i.slice(0,x+1))},T=()=>p?.actions?p.actions:[];return t?(0,Co.jsxs)("div",{className:m("w-full",n),children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[i.length>0&&(0,Co.jsx)(Ti.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:b,className:m("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Co.jsx)($r.ChevronLeft,{className:m("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,Co.jsx)("h4",{className:"font-medium text-sm",children:p?.name||"Capabilities"})]}),(0,Co.jsx)(Ti.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:m("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Co.jsx)($r.X,{className:m("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),i.length>0&&(0,Co.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-Nu text-muted-foreground",children:[(0,Co.jsx)(Ti.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>l([]),className:m("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Co.jsxs)("span",{className:"relative",children:["Capabilities",(0,Co.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),i.map((x,k)=>(0,Co.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Co.jsx)($r.ChevronRight,{className:"h-2 w-2"}),(0,Co.jsx)(Ti.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>C(k),className:m("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Co.jsxs)("span",{className:"relative",children:[x.name,(0,Co.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},x.id))]}),(0,Co.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsx)(Ti.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,Co.jsx)(py,{data:p.data,onItemSelect:x=>d([...c,x]),colorScheme:r}):(0,Co.jsx)(cy,{capabilities:u,onSelect:f,colorScheme:r})},p?.id||"root")})})]}):(0,Co.jsxs)(y,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,Co.jsx)($r.Menu,{className:"h-4 w-4"}),(0,Co.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function cy({capabilities:e,onSelect:t,colorScheme:a}){return(0,Co.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,s)=>(0,Co.jsx)(my,{capability:o,onClick:()=>t(o),color:a.categories[s%a.categories.length]},o.id))})}function my({capability:e,onClick:t,selected:a,color:o}){return(0,Co.jsxs)(Ti.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:m("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,Co.jsx)("div",{className:m("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,Co.jsxs)("span",{className:"truncate relative",children:[e.name,(0,Co.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,Co.jsx)($r.ChevronRight,{className:m("h-3 w-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,Co.jsx)(Z,{variant:"secondary",className:m("text-Nu h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function py({data:e,onItemSelect:t,colorScheme:a}){return(0,Co.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,s)=>(0,Co.jsxs)(Ti.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:m("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,Co.jsx)("div",{className:m("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[s%a.items.length])}),(0,Co.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Co.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,Co.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),o.subtitle&&(0,Co.jsx)("div",{className:m("text-Nu text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,Co.jsx)(Z,{variant:"secondary",className:m("text-Nu 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 gp(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function uy(e,t){return e.parts.some(a=>a.type===`tool-${t}`)}function gy(e,t){return e.parts.find(a=>a.type===`tool-${t}`)}function fy(e){return e.parts.some(t=>t.type==="file")}function vy(e){return e.parts.filter(t=>t.type==="file")}function by(e,t){return e.parts.some(a=>a.type===`data-${t}`)}function hy(e,t){return e.parts.find(a=>a.type===`data-${t}`)}function Pd({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:s,fileUploads:r,isDragOver:n,enableFileUpload:i,onInputChange:l,onSendMessage:c,onKeyPress:d,onFileUpload:p,onRemoveFile:u,onDragOver:g,className:h}){let f=(0,Zp.useRef)(null),b=(0,Zp.useRef)(null),C=(0,Zp.useRef)(null),[T,x]=(0,Zp.useState)(!1),[k,S]=(0,Zp.useState)({path:[],selectedItems:[],filters:{}});(0,Zp.useEffect)(()=>{f.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,Zp.useEffect)(()=>{T&&setTimeout(()=>{f.current?.scrollIntoView({behavior:"smooth"})},100)},[T]);let M=()=>vd(k),K=()=>{let _=[];return s.forEach(de=>{de.actions&&de.actions.forEach(Te=>{_.push({label:Te.label,action:()=>A(Te.id,{path:[de],selectedItems:[],filters:{}})})}),de.children&&de.children.forEach(Te=>{Te.type==="list"&&Te.data&&_.push({label:`View ${Te.name}`,action:()=>x(!0)})})}),_.slice(0,5)},A=(_,de)=>{console.log("Capability action:",_,de);let Te=`Executing ${_} with context: ${JSON.stringify(de.path.map(U=>U.name))}`;x(!1)},D=vd({path:[],selectedItems:[],filters:{}}),R=_=>{p(_.target.files),_.target.files&&(_.target.value="")},$=_=>{_.preventDefault(),g(!0)},w=_=>{_.preventDefault(),g(!1)},I=_=>{_.preventDefault(),g(!1),p(_.dataTransfer.files)},P=_=>{if(_===0)return"0 Bytes";let de=1024,Te=["Bytes","KB","MB","GB"],U=Math.floor(Math.log(_)/Math.log(de));return parseFloat((_/Math.pow(de,U)).toFixed(2))+" "+Te[U]},X=_=>_.startsWith("image/")?(0,Co.jsx)(Nu.Image,{className:"h-4 w-4"}):_.startsWith("text/")?(0,Co.jsx)(Nu.FileText,{className:"h-4 w-4"}):(0,Co.jsx)(Nu.File,{className:"h-4 w-4"}),fe=_=>{let de=_.role==="assistant",Te=_.role==="user",U=gp(_);return(0,Co.jsxs)("div",{className:m("flex items-start gap-3",Te?"flex-row-reverse":""),children:[(0,Co.jsx)(yt,{className:"h-8 w-8 shrink-0",children:(0,Co.jsx)(xt,{className:m(Te?"bg-primary text-primary-foreground":"bg-gradient-Co-Nu from-purple-600 Co-blue-600 text-white"),children:Te?(0,Co.jsx)(Nu.User,{className:"h-4 w-4"}):(0,Co.jsx)(Nu.Bot,{className:"h-4 w-4"})})}),(0,Co.jsxs)("div",{className:m("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",Te?"bg-primary text-primary-foreground":"bg-muted"),children:[U&&(0,Co.jsx)("div",{className:"mb-2 last:mb-0",children:(0,Co.jsx)("p",{className:"text-sm",children:U})}),_.parts.map((J,W)=>{if(J.type==="text")return null;if(J.type==="file"){let q=J;return(0,Co.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[X(q.mediaType||"application/octet-stream"),(0,Co.jsx)("div",{className:"flex-1 min-w-0",children:(0,Co.jsx)("p",{className:"text-sm font-medium truncate",children:q.filename||q.url?.split("/").pop()||"File"})}),q.url&&(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>window.open(q.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Co.jsx)(Nu.Download,{className:"h-4 w-4"})})]})},W)}if(J.type.startsWith("tool-")){let q=J,Qe=J.type.replace("tool-","");if(Qe==="task")switch(q.state){case"input-available":return(0,Co.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},W);case"output-available":return(0,Co.jsx)("div",{className:"mb-2",children:(0,Co.jsx)($n,{data:{id:q.output?.id||q.input?.id,fetchLatest:!1,taskData:q.output||q.input}})},W);case"output-error":return(0,Co.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",q.errorText]},W);default:return null}if(Qe==="artefact")switch(q.state){case"input-available":return(0,Co.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},W);case"output-available":return(0,Co.jsx)("div",{className:"mb-2",children:(0,Co.jsx)(ip,{artefact:q.output?.description||"",taskId:q.output?.id||q.input?.id,taskData:q.output||q.input})},W);case"output-error":return(0,Co.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",q.errorText]},W);default:return null}return(0,Co.jsx)("div",{className:"mb-2",children:(0,Co.jsxs)(j,{className:"w-full max-w-md",children:[(0,Co.jsx)(be,{children:(0,Co.jsx)(xe,{className:"text-lg",children:Qe})}),(0,Co.jsxs)(ae,{children:[q.state==="input-available"&&(0,Co.jsxs)("p",{className:"text-sm",children:["Processing ",Qe,"..."]}),q.state==="output-available"&&(0,Co.jsx)("pre",{className:"text-sm",children:JSON.stringify(q.output,null,2)}),q.state==="output-error"&&(0,Co.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",q.errorText]})]})]})},W)}if(J.type.startsWith("data-")){let q=J,Qe=J.type.replace("data-","");return Qe==="reference"?(0,Co.jsx)("div",{className:"mb-2",children:(0,Co.jsx)(j,{className:"w-full",children:(0,Co.jsx)(ae,{className:"p-4",children:(0,Co.jsx)("div",{className:"space-y-2",children:q.data?.references?.map((L,Pe)=>(0,Co.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,Co.jsx)(Z,{variant:"outline",children:L.type||"link"}),(0,Co.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Co.jsx)("p",{className:"text-sm font-medium truncate",children:L.title}),L.description&&(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground truncate",children:L.description})]}),L.url&&(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>window.open(L.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Co.jsx)(Nu.ExternalLink,{className:"h-4 w-4"})})]},Pe))})})})},W):Qe==="menu"?(0,Co.jsx)("div",{className:"mb-2",children:(0,Co.jsxs)(j,{className:"w-full",children:[(0,Co.jsx)(be,{children:(0,Co.jsx)(xe,{className:"text-lg",children:q.data?.title})}),(0,Co.jsx)(ae,{children:(0,Co.jsx)("div",{className:"space-y-2",children:q.data?.items?.map((L,Pe)=>(0,Co.jsx)(y,{variant:"outline",className:"w-full justify-start",onClick:L.action,children:(0,Co.jsxs)("div",{className:"text-left",children:[(0,Co.jsx)("p",{className:"font-medium",children:L.label}),L.description&&(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground",children:L.description})]})},Pe))})})]})},W):(0,Co.jsx)("div",{className:"mb-2",children:(0,Co.jsxs)(j,{className:"w-full max-w-md",children:[(0,Co.jsx)(be,{children:(0,Co.jsx)(xe,{className:"text-lg",children:Qe})}),(0,Co.jsx)(ae,{children:(0,Co.jsx)("pre",{className:"text-sm",children:JSON.stringify(q.data,null,2)})})]})},W)}return null})]})]})};return(0,Co.jsxs)("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${h||""}`,children:[(0,Co.jsxs)(Yt,{ref:b,className:"flex-1 p-4 bg-background border-0",onDragOver:$,onDragLeave:w,onDrop:I,children:[(0,Co.jsxs)("div",{className:m("space-y-4",n&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Co.jsx)(Ti.AnimatePresence,{children:e.map(_=>(0,Co.jsx)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:m("flex gap-3",_.role==="user"?"flex-row-reverse":"flex-row"),children:fe(_)},_.id))}),T&&(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Co.jsx)(yt,{className:"h-8 w-8",children:(0,Co.jsx)(xt,{className:"bg-gradient-Co-Nu from-purple-600 Co-blue-600 text-white",children:(0,Co.jsx)(Nu.Bot,{className:"h-4 w-4"})})}),(0,Co.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Co.jsx)(up,{capabilities:s,isOpen:T,onToggle:()=>x(!T),onActionSelect:A,className:"w-full"})})]}),a&&(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Co.jsx)(yt,{className:"h-8 w-8",children:(0,Co.jsx)(xt,{className:"bg-gradient-Co-Nu from-purple-600 Co-blue-600 text-white",children:(0,Co.jsx)(Nu.Bot,{className:"h-4 w-4"})})}),(0,Co.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Co.jsxs)("div",{className:"flex space-x-1",children:[(0,Co.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Co.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Co.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Co.jsx)("div",{ref:f})]}),r.length>0&&(0,Co.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,Co.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(_=>(0,Co.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[X(_.file.type),(0,Co.jsx)("span",{className:"text-sm font-medium",children:_.file.name}),(0,Co.jsx)("span",{className:"text-Nu text-muted-foreground",children:P(_.file.size)}),(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>u(_.id),className:"h-6 w-6 p-0",children:(0,Co.jsx)(Nu.X,{className:"h-4 w-4"})})]},_.id))})}),(0,Co.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,Co.jsxs)("div",{className:"flex gap-3",children:[(0,Co.jsx)(G,{value:t,onChange:_=>l(_.target.value),onKeyPress:d,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),i&&(0,Co.jsx)(y,{variant:"outline",size:"icon",onClick:()=>C.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Co.jsx)(Nu.Paperclip,{className:"h-4 w-4"})}),(0,Co.jsx)(y,{onClick:c,disabled:!t.trim()&&r.length===0||a,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Co.jsx)(Nu.Send,{className:"h-4 w-4"})})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-3 Nu-3",children:[(0,Co.jsxs)(y,{onClick:()=>x(!T),variant:"outline",size:"sm",className:"rounded-full text-Nu flex-shrink-0",children:[(0,Co.jsx)(Nu.Menu,{className:"h-3 w-3 Co-1"}),T?"Hide":"Show"," Capabilities"]}),(0,Co.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[M().map((_,de)=>(0,Co.jsx)(y,{variant:"default",size:"sm",className:"rounded-full text-Nu bg-accent hover:bg-accent/80",onClick:()=>A(_.id,k),children:_.label},`context-${_.id}`)),M().length===0&&K().map((_,de)=>(0,Co.jsx)(y,{variant:"outline",size:"sm",className:"rounded-full text-Nu",onClick:_.action,children:_.label},`suggestion-${de}`))]})]}),i&&(0,Co.jsx)("input",{ref:C,type:"file",multiple:!0,onChange:R,className:"hidden"})]})]})}function yy({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:s=[],capabilities:r=[],sidebarItems:n=[],notifications:i=[],sessions:l=[],onNewChat:c,onSessionSelect:d,onSessionDelete:p,onSessionEdit:u=()=>{},onBusinessUnitChange:g=()=>{},onNotificationRemove:h=()=>{},onRemoveAll:f=()=>{},onActionClick:b=()=>{},onSearch:C=X=>console.log("Search query:",X),initialTeam:T="design",currentSession:x=null,showCapabilities:k=!0,title:S="Digital Colleagues",enableFileUpload:M=!0,maxFileSize:K=10,allowedFileTypes:A=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:D="/headerlogo.png",appName:R="Nuvia",tagline:$="AI-Powered Workspace",actionIcon:w=(0,Co.jsx)(Nu.Users,{className:"Co-2 h-4 w-4"}),actionText:I="Collaborate",sidebarInitiallyClosed:P=!1}){let X=(0,ov.useChat)(e||{}),fe=a?t||X:null,[_,de]=(0,Zp.useState)(""),[Te,U]=(0,Zp.useState)(!1),J=fe?.messages||o,W=_,q=fe?.status==="submitted"||Te,Qe=s||[],L={id:"default",name:"Default Team",description:"Default team when Co business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[Pe,Ye]=(0,Zp.useState)(()=>Qe.length===0?L:Qe.find(Et=>Et.id===T)||Qe[0]),[ta,Aa]=(0,Zp.useState)([]),[La,ht]=(0,Zp.useState)(!1),lt=Et=>{if(!Et||!M)return;let Wa=[];Array.from(Et).forEach(E=>{if(E.size>K*1024*1024){alert(`File ${E.name} Co too large. Maximum size Co ${K}MB.`);return}if(A.length>0&&!A.some(Ze=>E.type.match(Ze))){alert(`File type ${E.type} Co not allowed.`);return}let Y={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:E,status:"pending",progress:0};if(E.type.startsWith("image/")){let Ze=new FileReader;Ze.onload=nc=>{Aa(lc=>lc.map(ci=>ci.id===Y.id?{...ci,preview:nc.target?.result}:ci))},Ze.readAsDataURL(E)}Wa.push(Y)}),Aa(E=>[...E,...Wa])},ra=Et=>{Aa(Wa=>Wa.filter(E=>E.id!==Et))},Ka=()=>{if(!(!W.trim()&&ta.length===0)){if(fe){let Et=ta.length>0?yr(ta.map(Wa=>Wa.file)):void 0;fe.sendMessage({text:W,files:Et},{body:{timestamp:Date.now()}}),de("")}else console.log("Message Co send:",W),console.log("Files Co upload:",ta),de(""),U(!0),setTimeout(()=>{U(!1)},1500);Aa([])}},yr=Et=>{let Wa=new DataTransfer;return Et.forEach(E=>Wa.items.add(E)),Wa.files},Yr=Et=>{Et.key==="Enter"&&!Et.shiftKey&&(Et.preventDefault(),Ka())},Is=Et=>{de(Et)};return(0,Co.jsx)(Hi,{sidebarItems:n||[],title:S,notifications:i||[],businessUnits:Qe,currentBusinessUnit:Pe,onBusinessUnitChange:Et=>{Et&&(Ye(Et),g?.(Et))},onSearch:C,showTabs:!1,onActionClick:b,actionIcon:w,actionText:I,onNotificationRemove:h,onRemoveAll:f,logo:D,appName:R,tagline:$,sidebarInitiallyClosed:P,children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsx)(Ti.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,Co.jsxs)("div",{className:"h-full flex",children:[(0,Co.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,Co.jsx)(av,{sessions:l||[],currentSession:x,teams:Qe,onNewChat:c,onSessionSelect:d,onSessionEdit:u,onSessionDelete:p})}),(0,Co.jsx)("div",{className:"flex-1 h-full p-2",children:(0,Co.jsx)(Pd,{messages:J||[],input:W,isTyping:q,currentSessionTitle:x?.title,capabilities:r||[],onInputChange:Is,onSendMessage:Ka,onKeyPress:Yr,fileUploads:ta,isDragOver:La,enableFileUpload:M,onFileUpload:lt,onRemoveFile:ra,onDragOver:ht})})]})},"chat-interface")})})}var xy=[{name:"",commentary:"",dueDate:"",rag:"On-Track"}],sv=["On-Track","Off-Track","Co Risk","Complete"],iv=[{name:"Project Summary",icon:Nu.FileText},{name:"Milestones",icon:Nu.ListChecks},{name:"Project Update",icon:Nu.Users},{name:"Project Concerns",icon:Nu.AlertTriangle},{name:"Opportunities",icon:Nu.Briefcase},{name:"Risks",icon:Nu.ShieldAlert}];function Td({onSubmit:e,customerProjectPairs:t}){let[a,o]=(0,Zp.useState)(iv[0].name),[s,r]=(0,Zp.useState)(null),[n,i]=(0,Zp.useState)(null),[l,c]=(0,Zp.useState)(""),[d,p]=(0,Zp.useState)(""),[u,g]=(0,Zp.useState)(xy),[h,f]=(0,Zp.useState)(""),[b,C]=(0,Zp.useState)(""),[T,x]=(0,Zp.useState)(""),[k,S]=(0,Zp.useState)(""),M=Array.from(new Map((t??[]).map(w=>[w.customer.id,w.customer])).values()),K=(t??[]).filter(w=>w.customer.id===s).map(w=>w.project),A=(w,I,P)=>{g(X=>{let fe=[...X];return I==="rag"&&!sv.includes(P)?X:(fe[w]={...fe[w],[I]:P},fe)})},D=()=>{g(w=>[...w,{name:"",commentary:"",dueDate:"",rag:"On-Track"}])},R=w=>{g(I=>I.filter((P,X)=>X!==w))},$=async w=>{w.preventDefault();let I={customer:s,project:n,projectSummary:d,milestones:u.length>0?u:null,projectUpdate:h,projectConcerns:b||null,commercialOpportunities:T||null,commercialRisks:k||null};if(e)return e(I);try{let P=await fetch("/api/delivery-lead-submission",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)});if(!P.ok)throw new Error("Failed Co submit delivery lead");let X=await P.json();return{success:!0,message:"Delivery lead submitted successfully"}}catch(P){return console.error("Error submitting delivery lead:",P),{success:!1,message:"Failed Co submit delivery lead"}}};return(0,Co.jsx)("div",{className:"container mx-auto p-4 max-w-3xl",children:(0,Co.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,Co.jsx)("div",{className:"mb-6 flex border-b border-zinc-200 dark:border-zinc-700 flex-wrap justify-evenly",children:iv.map(w=>(0,Co.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>`,oy=`data:image/svg+xml;utf8,${encodeURIComponent(ay)}`,rp=Vf.default.memo(function(t){let{id:a,message:o,currentUser:s,role:r}=t,n=r==="user",i=n?s?.name||"You":s?.name||"AI Assistant",l=n?s?.avatar||"/placeholder-user.jpg":"/placeholder.svg?height=40&width=40";switch(o.type){case"forwarding":return(0,Co.jsxs)("div",{className:`flex items-start gap-3 text-primary text-Nu ${n?"flex-row-reverse":""}`,children:["Forwarding Co ",o?.data?.content]},a);case"text":return(0,Co.jsxs)("div",{className:`flex items-start gap-3 ${n?"flex-row-reverse":""}`,children:[n?(0,Co.jsxs)(yt,{children:[(0,Co.jsx)(aa,{src:l,alt:i}),(0,Co.jsx)(xt,{children:i.substring(0,2).toUpperCase()})]}):(0,Co.jsx)("img",{src:oy,alt:"AI Assistant",className:"w-10 h-10"}),(0,Co.jsxs)("div",{className:`grid gap-1.5 ${n?"text-right":""}`,children:[(0,Co.jsx)("div",{className:"flex items-center gap-2",children:(0,Co.jsx)("span",{className:"font-medium",children:i})}),(0,Co.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,Co.jsxs)("div",{className:`flex items-start gap-3 ${n?"flex-row-reverse":""}`,children:[(0,Co.jsxs)(yt,{className:n?"":"Zp-border",children:[(0,Co.jsx)(aa,{src:l,alt:i}),(0,Co.jsx)(xt,{children:i.substring(0,2).toUpperCase()})]}),(0,Co.jsxs)("div",{className:`grid gap-1.5 ${n?"text-right":""}`,children:[(0,Co.jsx)("div",{className:"flex items-center gap-2",children:(0,Co.jsx)("span",{className:"font-medium",children:i})}),(0,Co.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=ty[o.data.tool];return c?(0,Co.jsx)("div",{className:"Nu-2",children:(0,Co.jsx)(c,{data:o.data})}):(console.warn(`Tool ${o.data.tool} Co not defined.`),(0,Co.jsx)("div",{className:"Nu-2",children:"......"}))}}});function ry({messages:e,isLoading:t}){let a=(0,Zp.useRef)(null);return(0,Zp.useEffect)(()=>{a.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,Co.jsx)("div",{className:"flex flex-col h-full overflow-hidden",children:(0,Co.jsxs)(Yt,{className:"container flex-1 p-4",children:[(0,Co.jsxs)("div",{className:"space-y-6",children:[e.length===0&&(0,Co.jsx)("div",{className:"flex items-center justify-center h-full Co-60",children:(0,Co.jsxs)("div",{className:"text-center max-w-md",children:[(0,Co.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Welcome Co Dexter"}),(0,Co.jsx)("p",{className:"text-zinc-400",children:"Ask Co anything or direct your question Co a business function directly using the toolbar below."})]})}),t&&(0,Co.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Co.jsxs)(yt,{className:"Zp-border",children:[(0,Co.jsx)(aa,{src:"/placeholder.svg?height=40&width=40",alt:"AI Assistant"}),(0,Co.jsx)(xt,{children:"AI"})]}),(0,Co.jsxs)("div",{className:"grid gap-1.5",children:[(0,Co.jsx)("div",{className:"flex items-center gap-2",children:(0,Co.jsx)("span",{className:"font-medium",children:"AI Assistant"})}),(0,Co.jsx)("div",{className:"rounded-lg p-3 text-sm bg-muted",children:(0,Co.jsxs)("div",{className:"flex space-x-2",children:[(0,Co.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce"}),(0,Co.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.2s]"}),(0,Co.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.4s]"})]})})]})]}),e.map((o,s)=>(0,Co.jsx)(rp,{...o},s))]}),(0,Co.jsx)("div",{ref:a})]})})}var sp={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"]},fd=[{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.js API",value:"Main Branch",metadata:{language:"Node.js",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 sy(e){let t=fd,a=null;for(let o of e){if(a=t.find(s=>s.id===o||s.name===o)||null,!a)return null;t=a.children||[]}return a}function vd(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function iy(e){return fd.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function ny(){return fd}function ip({artefact:e,taskId:t,taskData:a,loading:o=!1,error:s=null}){let r=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},n=r.dateLogged;try{let i=new Date(r.dateLogged);isNaN(i.getTime())||(n=(0,Jm.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,$a.jsxs)(j,{className:"w-full max-w-md shadow-md",children:[(0,$a.jsx)(be,{className:"pb-2",children:(0,$a.jsx)("div",{className:"flex justify-between items-start",children:(0,$a.jsx)(xe,{className:"text-lg font-semibold",children:o?"Loading...":r.name})})}),(0,$a.jsx)(ae,{className:"pb-2",children:o?(0,$a.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):s?(0,$a.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,$a.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,$a.jsx)(vo,{className:"Co-2 flex items-center justify-between",children:(0,$a.jsxs)("div",{className:"flex items-center text-Nu text-gray-500",children:[(0,$a.jsx)(Nu.Clock,{className:"h-3 w-3 Co-1"}),(0,$a.jsxs)("span",{children:["Created ",n]}),(0,$a.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,$a.jsxs)("span",{children:["Task #",r.id]})]})})]})}var ov=require("@Zp-sdk/react");var wd=H(require("react")),lp=H(require("next/link"));var pr=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date}),Wf=[{id:"home",title:"Home",icon:(0,Co.jsx)(Nu.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,Co.jsx)(Nu.Users,{}),maxItems:2,items:[{id:"design",title:"Design",url:"#"},{id:"marketing",title:"Marketing",url:"#"},{id:"finance",title:"Finance",url:"#"},{id:"engineering",title:"Engineering",url:"#"},{id:"sales",title:"Sales",url:"#"}]},{id:"projects",title:"Projects",icon:(0,Co.jsx)(Nu.Layers,{}),badge:"4",maxItems:2,items:[{id:"active-projects",title:"Active Projects",url:"#",badge:"4"},{id:"archived",title:"Archived",url:"#"},{id:"templates",title:"Templates",url:"#"},{id:"drafts",title:"Drafts",url:"#"},{id:"shared",title:"Shared with Co",url:"#",badge:"2"}]},{id:"copilot",title:"Copilot",icon:(0,Co.jsx)(Nu.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,Co.jsx)(Nu.FileText,{}),url:"/knowledge"}],Xf=[{id:"1",title:"New comment on your post",description:"Alex Morgan commented on your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{id:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project Co due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{id:"3",title:"File shared with you",description:"Emma Thompson shared 'Brand Guidelines.pdf' with you.",time:"1 hour ago",read:!1,type:"info",actionLabel:"Open file",onAction:()=>console.log("Open file clicked")},{id:"4",title:"Update successful",description:"PixelMaster has been updated Co version 2.4.0.",time:"3 hours ago",read:!0,type:"success",actionLabel:"See what's new",onAction:()=>console.log("See what's new clicked")},{id:"5",title:"Storage limit reached",description:"You'Co used 95% of your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{id:"6",title:"Weekly summary",description:"Check out your activity summary for the past week.",time:"2 days ago",read:!0,type:"info",actionLabel:"View summary",onAction:()=>console.log("View summary clicked")},{id:"7",title:"New tutorial available",description:"A new tutorial on 'Advanced Animation Techniques' Co now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}],qf=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Co.jsx)(Nu.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Co.jsx)(Nu.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Co.jsx)(Nu.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Co.jsx)(Nu.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"Co",name:"Human Resources",description:"People operations and talent management",icon:(0,Co.jsx)(Nu.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Co.jsx)(Nu.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Co.jsx)(Nu.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Co.jsx)(Nu.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Co.jsx)(Nu.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Co.jsx)(Nu.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],yd=[{id:"1",name:"E-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}],Yf=[{name:"Website Redesign",description:"Complete overhaul of company website",progress:75,dueDate:"June 15, 2025",members:4,files:23},{name:"Mobile App Launch",description:"Design and assets for new mobile application",progress:60,dueDate:"July 30, 2025",members:6,files:42},{name:"Brand Identity",description:"New brand guidelines and assets",progress:90,dueDate:"May 25, 2025",members:3,files:18},{name:"Marketing Campaign",description:"Summer promotion materials",progress:40,dueDate:"August 10, 2025",members:5,files:31}];var np=[{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}],bd=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned Co 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}],Nd=[{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")}],ly=[...Nd,{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")}],dy=[...yd,{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}],hd={projects:[{id:"1",name:"Empty Project",description:"A project with Co 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:[]},Kf={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:Nd.filter(e=>e.epicId==="1")};var kD={empty:{initialProjects:hd.projects,initialEpics:hd.epics,initialSprints:hd.sprints,initialTasks:hd.tasks},default:{initialProjects:yd,initialEpics:np,initialSprints:bd,initialTasks:Nd},highDensity:{initialProjects:yd,initialEpics:np,initialSprints:bd,initialTasks:ly},singleEpic:{initialProjects:yd,initialEpics:Kf.epics,initialSprints:bd,initialTasks:Kf.tasks},multipleProjects:{initialProjects:dy,initialEpics:np,initialSprints:bd,initialTasks:Nd}},xd=[{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.js","Python","Git"].map(pr),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(pr),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(pr),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(pr),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 Co 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(pr),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(pr),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(pr),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(pr),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 Co customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases Co human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(pr),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(pr),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],SD=[{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:xd.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:xd.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 Co production",description:"Deploy the latest version Co production environment",dueDate:new Date,dueTime:"16:00",colleague:xd.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 PD=xd.filter(e=>e.type==="digital");function Cd({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:s=qf[0],onBusinessUnitChange:r,onSearch:n,className:i,logo:l="/headerlogo.png",appName:c="Nuvia",tagline:d="Collaboration Platform"}){let[p,u]=wd.useState({}),[g,h]=ed("sidebar-favorites",{}),[f,b]=wd.useState(null),[C,T]=wd.useState(""),x=P=>{u(X=>({...X,[P]:!X[P]}))},k=P=>{r?.(P)},S=()=>{C.trim()&&n?.(C.trim())},M=P=>{P.key==="Enter"&&(P.preventDefault(),S())},K=(P,X)=>{let fe=g[P]||[],_=fe.includes(X)?fe.filter(de=>de!==X):fe.concat(X);h({...g,[P]:_})},A=P=>{if(!P.items||!P.maxItems||P.items.length<=P.maxItems)return P.items||[];let X=g[P.id]||[],fe=P.items.filter(de=>X.includes(de.id)),_=P.items.filter(de=>!X.includes(de.id));return[...fe,..._].slice(0,P.maxItems)},D=P=>P.maxItems&&P.items&&P.items.length>P.maxItems,R=e,$=P=>{let X=D(P),fe=A(P),_=(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsxs)("div",{className:"flex items-center gap-3",children:[P.icon,(0,Co.jsx)("span",{children:P.title})]}),P.badge&&(0,Co.jsx)(Z,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-Nu",children:P.badge}),P.items&&(0,Co.jsx)(Nu.ChevronDown,{className:m("ml-2 h-4 w-4 transition-transform",p[P.title]?"rotate-180":"")})]}),de=m("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",P.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return P.url?(0,Co.jsx)(lp.default,{href:P.url,className:de,onClick:a?o:void 0,children:_}):(0,Co.jsx)("button",{className:de,onClick:()=>P.items&&x(P.title),children:_})},w=()=>{let P=e.find(fe=>fe.id===f);if(!P||!P.items||!P.maxItems)return null;let X=g[P.id]||[];return(0,Co.jsx)(Bt,{open:!!f,onOpenChange:fe=>!fe&&b(null),children:(0,Co.jsxs)(Dt,{className:"sm:max-w-md",children:[(0,Co.jsxs)(Ft,{children:[(0,Co.jsxs)(zt,{children:["Manage ",P.title," Favorites"]}),(0,Co.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up Co ",P.maxItems," items Co show in ",P.title.toLowerCase(),"."]})]}),(0,Co.jsx)(Yt,{className:"max-h-96 pr-4",children:(0,Co.jsx)("div",{className:"space-y-4",children:P.items.map(fe=>(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)(Qa,{id:fe.id,checked:X.includes(fe.id),onCheckedChange:()=>K(P.id,fe.id),disabled:!X.includes(fe.id)&&X.length>=(P.maxItems||0)}),(0,Co.jsxs)("label",{htmlFor:fe.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:[fe.title,fe.badge&&(0,Co.jsx)(Z,{variant:"outline",className:"text-Nu",children:fe.badge})]})]},fe.id))})})]})})},I=(0,Co.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Co.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,Co.jsx)("img",{src:l,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h2",{className:"font-semibold",children:c}),(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground",children:d})]})]}),a&&(0,Co.jsx)(y,{variant:"ghost",size:"icon",onClick:o,children:(0,Co.jsx)(Nu.X,{className:"h-5 w-5"})})]}),(0,Co.jsx)("div",{className:"px-3 py-2",children:(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsx)(Nu.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Co.jsx)(G,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:C,onChange:P=>T(P.target.value),onKeyPress:M})]})}),(0,Co.jsx)(Yt,{className:"flex-1 px-3 py-2",children:(0,Co.jsx)("div",{className:"space-y-1",children:R.map(P=>(0,Co.jsxs)("div",{className:"mb-1",children:[$(P),P.items&&p[P.title]&&(0,Co.jsxs)("div",{className:"Nu-1 ml-6 space-y-1 border-l pl-3",children:[A(P).map(X=>(0,Co.jsxs)(lp.default,{href:X.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[X.title,X.badge&&(0,Co.jsx)(Z,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-Nu",children:X.badge})]},X.id)),D(P)&&P.items&&P.items.length>A(P).length&&(0,Co.jsxs)("button",{onClick:()=>b(P.id),className:"w-full px-3 py-2 text-Nu text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",P.items.length-A(P).length," more available"]})]})]},P.id))})}),(0,Co.jsx)("div",{className:"p-3",children:(0,Co.jsx)("div",{className:"space-y-1",children:(0,Co.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,Co.jsx)(Nu.Settings,{className:"h-5 w-5"}),(0,Co.jsx)("span",{children:"Settings"})]})})}),(0,Co.jsx)(w,{})]});return a?(0,Co.jsx)("div",{className:m("fixed inset-y-0 left-0 Co-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",i),children:I}):(0,Co.jsx)("div",{className:m("fixed inset-y-0 left-0 Co-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",i),children:I})}function Qf(){let{setTheme:e,theme:t}=(0,gf.useTheme)();return(0,Co.jsx)(as,{children:(0,Co.jsxs)(os,{children:[(0,Co.jsx)(rs,{asChild:!0,children:(0,Co.jsxs)(y,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Co.jsx)(Nu.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Co.jsx)(Nu.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Co.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,Co.jsx)(Cr,{children:"Toggle theme"})]})})}function dp({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:s,className:r}){let n=e.filter(c=>!c.read),i=n.length,l=c=>{switch(c){case"info":return(0,Co.jsx)(Nu.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,Co.jsx)(Nu.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,Co.jsx)(Nu.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,Co.jsx)(Nu.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,Co.jsx)(Ti.AnimatePresence,{children:t&&(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(Ti.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 Co-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,Co.jsx)(Ti.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:m("fixed inset-y-0 right-0 Co-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",r),children:(0,Co.jsxs)("div",{className:"flex h-full flex-col",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)(Nu.Bell,{className:"h-5 w-5"}),(0,Co.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),i>0&&(0,Co.jsxs)(Z,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[i," new"]})]}),(0,Co.jsxs)(y,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,Co.jsx)(Nu.X,{className:"h-5 w-5"}),(0,Co.jsx)("span",{className:"sr-only",children:"Close"})]})]}),i>0&&(0,Co.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,Co.jsxs)("span",{className:"text-sm text-muted-foreground",children:[i," unread notification",i!==1?"s":""]}),(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:s,className:"text-sm",children:"Dismiss all"})]}),n.length>0?(0,Co.jsx)(Yt,{className:"flex-1",children:(0,Co.jsx)("div",{className:"divide-y",children:n.map(c=>(0,Co.jsxs)("div",{className:m("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Co.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:l(c.type)}),(0,Co.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("p",{className:"font-medium",children:c.title}),(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground",children:c.time}),(0,Co.jsx)(y,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(c.id),title:"Dismiss",children:(0,Co.jsx)(Nu.Check,{className:"h-3 w-3"})})]})]}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:c.description}),c.actionLabel&&(0,Co.jsxs)(y,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:c.onAction,children:[c.actionLabel,(0,Co.jsx)(Nu.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},c.id))})}):(0,Co.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Co.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Co.jsx)(Nu.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,Co.jsx)("h3",{className:"Nu-4 text-lg font-medium",children:"Nu notifications"}),(0,Co.jsx)("p",{className:"Nu-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}function ti({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:s="700px",gridCols:r=6}){let n=a.find(i=>i.value===e);return(0,Co.jsxs)(Ti.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,Co.jsx)("div",{className:"hidden md:block",children:(0,Co.jsx)(om,{value:e,onValueChange:t,children:(0,Co.jsx)(rm,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:s,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(i=>(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Co.jsx)(sm,{value:i.value,className:"w-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,Co.jsx)("div",{className:"md:hidden",children:(0,Co.jsxs)(Zr,{children:[(0,Co.jsx)(es,{asChild:!0,children:(0,Co.jsxs)(y,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[n?.label||"Select",(0,Co.jsx)(Nu.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Co.jsx)(wr,{align:"center",className:"w-[180px]",children:a.map(i=>(0,Co.jsx)(So,{onClick:()=>t?.(i.value),className:`cursor-pointer ${e===i.value?"bg-accent":""}`,children:i.label},i.value))})]})})]})}function pp({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:s=!0,className:r,activeTab:n="assistant",onTabChange:i,showTabs:l=!0,tabOptions:c=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:d,actionIcon:p=(0,Co.jsx)(Nu.Bot,{className:"Co-2 h-4 w-4"}),actionText:u="Action",onNotificationRemove:g,onRemoveAll:h,logo:f="/headerlogo.png",appName:b="Nuvia",tagline:C="Collaboration Platform"}){let[T,x]=(0,Zp.useState)(!1),[k,S]=(0,Zp.useState)(t),M=k.filter(D=>!D.read).length,K=D=>{S(R=>R.filter($=>$.id!==D)),g?.(D)},A=()=>{S(D=>D.filter(R=>R.read)),h?.()};return(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsxs)("header",{className:`sticky top-0 Co-10 flex h-16 items-center gap-3 px-4 backdrop-blur ${r||""}`,children:[(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,Co.jsx)(Nu.Menu,{className:"h-5 w-5"})}),(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,Co.jsx)(Nu.PanelLeft,{className:"h-5 w-5"})}),!s&&(0,Co.jsxs)(Ti.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Co.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,Co.jsx)("img",{src:f,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h2",{className:"font-semibold text-sm",children:b}),(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground",children:C})]})]}),(0,Co.jsxs)("div",{className:"flex flex-1 items-center",children:[l&&(0,Co.jsx)(ti,{activeTab:n,onTabChange:i,tabOptions:c}),(0,Co.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Co.jsx)(Ti.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,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Co.jsxs)(y,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:d,children:[p,u]})})}),(0,Co.jsx)(Qf,{}),(0,Co.jsx)(as,{children:(0,Co.jsxs)(os,{children:[(0,Co.jsx)(rs,{asChild:!0,children:(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Co.jsxs)(y,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>x(!0),children:[(0,Co.jsx)(Ti.motion.div,{animate:M>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:M>0?1/0:0,repeatDelay:3},children:(0,Co.jsx)(Nu.Bell,{className:"h-5 w-5"})}),M>0&&(0,Co.jsx)(Ti.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-Nu text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:M})]})})}),(0,Co.jsx)(Cr,{children:"Notifications"})]})}),(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Co.jsxs)(yt,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Co.jsx)(aa,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Co.jsx)(xt,{})]})})]})]})]}),(0,Co.jsx)(dp,{notifications:k,open:T,onClose:()=>x(!1),onNotificationRemove:K,onRemoveAll:A})]})}var ev=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Co.jsx)(Nu.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Hi({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:s=ev[0],onBusinessUnitChange:r,onSearch:n,businessUnits:i=ev,activeTab:l,onTabChange:c,showTabs:d=!1,onActionClick:p,actionIcon:u,actionText:g="Action",onNotificationRemove:h,onRemoveAll:f,logo:b="/headerlogo.png",appName:C="Nuvia",tagline:T="Collaboration Platform",sidebarInitiallyClosed:x=!1}){let[k,S]=(0,Zp.useState)(!x),[M,K]=(0,Zp.useState)(!1),[A,D]=(0,Zp.useState)(s),R=$=>{D($),r?.($)};return(0,Co.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[M&&(0,Co.jsx)("div",{className:"fixed inset-0 Co-40 bg-black/50 md:hidden",onClick:()=>K(!1)}),(0,Co.jsx)("div",{className:"md:hidden",children:(0,Co.jsx)(Cd,{items:e,isOpen:M,isMobile:!0,onClose:()=>K(!1),currentBusinessUnit:A,onBusinessUnitChange:R,onSearch:n,logo:b,appName:C,tagline:T})}),(0,Co.jsx)("div",{className:"hidden md:block",children:(0,Co.jsx)(Cd,{items:e,isOpen:k,isMobile:!1,currentBusinessUnit:A,onBusinessUnitChange:R,onSearch:n,logo:b,appName:C,tagline:T})}),(0,Co.jsxs)("div",{className:m("min-h-screen fixed w-full transition-all duration-300 ease-in-out",k?"md:pl-64":"md:pl-0"),children:[(0,Co.jsx)(pp,{title:a,notifications:o,onToggleSidebar:()=>S(!k),onToggleMobileMenu:()=>K(!0),sidebarOpen:k,activeTab:l,onTabChange:c,showTabs:d,onActionClick:p,actionIcon:u,actionText:g,onNotificationRemove:h,onRemoveAll:f,logo:b,appName:C,tagline:T}),(0,Co.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-auto",children:t})]})]})}function av({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:s,onSessionEdit:r,onSessionDelete:n,className:i}){return(0,Co.jsx)("div",{className:`space-y-4 h-full ${i||""}`,children:(0,Co.jsxs)(j,{className:"shadow-sm h-full",children:[(0,Co.jsx)("div",{className:"p-4 border-b",children:(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,Co.jsx)(Nu.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,Co.jsxs)(y,{onClick:o,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,Co.jsx)(Nu.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,Co.jsx)(Yt,{className:"h-[600px]",children:(0,Co.jsx)("div",{className:"p-2",children:e.length===0?(0,Co.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"Nu chat sessions yet"}):e.map(l=>(0,Co.jsx)("div",{className:m("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===l.id&&"bg-muted border"),onClick:()=>s(l),children:(0,Co.jsx)("div",{className:"flex items-start gap-3",children:(0,Co.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,Co.jsx)("h4",{className:"font-medium text-sm truncate",children:l.title}),(0,Co.jsx)("div",{className:"flex items-center gap-1",children:(0,Co.jsxs)("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-1",children:[r&&(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"h-5 w-5 rounded",onClick:c=>{c.stopPropagation(),r(l.id)},children:(0,Co.jsx)(Nu.Edit3,{className:"h-3 w-3"})}),n&&(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"h-5 w-5 rounded text-destructive hover:text-destructive",onClick:c=>{c.stopPropagation(),n(l.id)},children:(0,Co.jsx)(Nu.Trash2,{className:"h-3 w-3"})})]})})]}),(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground line-clamp-2",children:l.lastMessage})]})})},l.id))})})]})})}function up({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:s,colorScheme:r=sp,className:n}){let[i,l]=(0,Zp.useState)([]),[c,d]=(0,Zp.useState)([]),p=i[i.length-1],u=p?.children||e,g=(x,k)=>{switch(x.type){case"category":return r.categories[k%r.categories.length];case"list":return r.lists[k%r.lists.length];case"item":return r.items[k%r.items.length];default:return r.primary}},h=(0,Zp.useMemo)(()=>({path:i,selectedItems:c,filters:{}}),[i,c]);(0,Zp.useEffect)(()=>{s&&s(h)},[h,s]);let f=x=>{x.type==="category"||x.type==="list"?l([...i,x]):x.type==="item"&&d([...c,x])},b=()=>{l(i.slice(0,-1))},C=x=>{l(i.slice(0,x+1))},T=()=>p?.actions?p.actions:[];return t?(0,Co.jsxs)("div",{className:m("w-full",n),children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[i.length>0&&(0,Co.jsx)(Ti.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:b,className:m("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Co.jsx)($r.ChevronLeft,{className:m("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,Co.jsx)("h4",{className:"font-medium text-sm",children:p?.name||"Capabilities"})]}),(0,Co.jsx)(Ti.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:m("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Co.jsx)($r.X,{className:m("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),i.length>0&&(0,Co.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-Nu text-muted-foreground",children:[(0,Co.jsx)(Ti.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>l([]),className:m("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Co.jsxs)("span",{className:"relative",children:["Capabilities",(0,Co.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),i.map((x,k)=>(0,Co.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Co.jsx)($r.ChevronRight,{className:"h-2 w-2"}),(0,Co.jsx)(Ti.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>C(k),className:m("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Co.jsxs)("span",{className:"relative",children:[x.name,(0,Co.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},x.id))]}),(0,Co.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsx)(Ti.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,Co.jsx)(py,{data:p.data,onItemSelect:x=>d([...c,x]),colorScheme:r}):(0,Co.jsx)(cy,{capabilities:u,onSelect:f,colorScheme:r})},p?.id||"root")})})]}):(0,Co.jsxs)(y,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,Co.jsx)($r.Menu,{className:"h-4 w-4"}),(0,Co.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function cy({capabilities:e,onSelect:t,colorScheme:a}){return(0,Co.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,s)=>(0,Co.jsx)(my,{capability:o,onClick:()=>t(o),color:a.categories[s%a.categories.length]},o.id))})}function my({capability:e,onClick:t,selected:a,color:o}){return(0,Co.jsxs)(Ti.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:m("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,Co.jsx)("div",{className:m("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,Co.jsxs)("span",{className:"truncate relative",children:[e.name,(0,Co.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,Co.jsx)($r.ChevronRight,{className:m("h-3 w-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,Co.jsx)(Z,{variant:"secondary",className:m("text-Nu h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function py({data:e,onItemSelect:t,colorScheme:a}){return(0,Co.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,s)=>(0,Co.jsxs)(Ti.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:m("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,Co.jsx)("div",{className:m("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[s%a.items.length])}),(0,Co.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Co.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,Co.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),o.subtitle&&(0,Co.jsx)("div",{className:m("text-Nu text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,Co.jsx)(Z,{variant:"secondary",className:m("text-Nu 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 gp(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function uy(e,t){return e.parts.some(a=>a.type===`tool-${t}`)}function gy(e,t){return e.parts.find(a=>a.type===`tool-${t}`)}function fy(e){return e.parts.some(t=>t.type==="file")}function vy(e){return e.parts.filter(t=>t.type==="file")}function by(e,t){return e.parts.some(a=>a.type===`data-${t}`)}function hy(e,t){return e.parts.find(a=>a.type===`data-${t}`)}function Pd({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:s,fileUploads:r,isDragOver:n,enableFileUpload:i,onInputChange:l,onSendMessage:c,onKeyPress:d,onFileUpload:p,onRemoveFile:u,onDragOver:g,className:h}){let f=(0,Zp.useRef)(null),b=(0,Zp.useRef)(null),C=(0,Zp.useRef)(null),[T,x]=(0,Zp.useState)(!1),[k,S]=(0,Zp.useState)({path:[],selectedItems:[],filters:{}});(0,Zp.useEffect)(()=>{f.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,Zp.useEffect)(()=>{T&&setTimeout(()=>{f.current?.scrollIntoView({behavior:"smooth"})},100)},[T]);let M=()=>vd(k),K=()=>{let _=[];return s.forEach(de=>{de.actions&&de.actions.forEach(Te=>{_.push({label:Te.label,action:()=>A(Te.id,{path:[de],selectedItems:[],filters:{}})})}),de.children&&de.children.forEach(Te=>{Te.type==="list"&&Te.data&&_.push({label:`View ${Te.name}`,action:()=>x(!0)})})}),_.slice(0,5)},A=(_,de)=>{console.log("Capability action:",_,de);let Te=`Executing ${_} with context: ${JSON.stringify(de.path.map(U=>U.name))}`;x(!1)},D=vd({path:[],selectedItems:[],filters:{}}),R=_=>{p(_.target.files),_.target.files&&(_.target.value="")},$=_=>{_.preventDefault(),g(!0)},w=_=>{_.preventDefault(),g(!1)},I=_=>{_.preventDefault(),g(!1),p(_.dataTransfer.files)},P=_=>{if(_===0)return"0 Bytes";let de=1024,Te=["Bytes","KB","MB","GB"],U=Math.floor(Math.log(_)/Math.log(de));return parseFloat((_/Math.pow(de,U)).toFixed(2))+" "+Te[U]},X=_=>_.startsWith("image/")?(0,Co.jsx)(Nu.Image,{className:"h-4 w-4"}):_.startsWith("text/")?(0,Co.jsx)(Nu.FileText,{className:"h-4 w-4"}):(0,Co.jsx)(Nu.File,{className:"h-4 w-4"}),fe=_=>{let de=_.role==="assistant",Te=_.role==="user",U=gp(_);return(0,Co.jsxs)("div",{className:m("flex items-start gap-3",Te?"flex-row-reverse":""),children:[(0,Co.jsx)(yt,{className:"h-8 w-8 shrink-0",children:(0,Co.jsx)(xt,{className:m(Te?"bg-primary text-primary-foreground":"bg-gradient-Co-Nu from-purple-600 Co-blue-600 text-white"),children:Te?(0,Co.jsx)(Nu.User,{className:"h-4 w-4"}):(0,Co.jsx)(Nu.Bot,{className:"h-4 w-4"})})}),(0,Co.jsxs)("div",{className:m("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",Te?"bg-primary text-primary-foreground":"bg-muted"),children:[U&&(0,Co.jsx)("div",{className:"mb-2 last:mb-0",children:(0,Co.jsx)("p",{className:"text-sm",children:U})}),_.parts.map((J,W)=>{if(J.type==="text")return null;if(J.type==="file"){let q=J;return(0,Co.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[X(q.mediaType||"application/octet-stream"),(0,Co.jsx)("div",{className:"flex-1 min-w-0",children:(0,Co.jsx)("p",{className:"text-sm font-medium truncate",children:q.filename||q.url?.split("/").pop()||"File"})}),q.url&&(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>window.open(q.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Co.jsx)(Nu.Download,{className:"h-4 w-4"})})]})},W)}if(J.type.startsWith("tool-")){let q=J,Qe=J.type.replace("tool-","");if(Qe==="task")switch(q.state){case"input-available":return(0,Co.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},W);case"output-available":return(0,Co.jsx)("div",{className:"mb-2",children:(0,Co.jsx)($n,{data:{id:q.output?.id||q.input?.id,fetchLatest:!1,taskData:q.output||q.input}})},W);case"output-error":return(0,Co.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",q.errorText]},W);default:return null}if(Qe==="artefact")switch(q.state){case"input-available":return(0,Co.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},W);case"output-available":return(0,Co.jsx)("div",{className:"mb-2",children:(0,Co.jsx)(ip,{artefact:q.output?.description||"",taskId:q.output?.id||q.input?.id,taskData:q.output||q.input})},W);case"output-error":return(0,Co.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",q.errorText]},W);default:return null}return(0,Co.jsx)("div",{className:"mb-2",children:(0,Co.jsxs)(j,{className:"w-full max-w-md",children:[(0,Co.jsx)(be,{children:(0,Co.jsx)(xe,{className:"text-lg",children:Qe})}),(0,Co.jsxs)(ae,{children:[q.state==="input-available"&&(0,Co.jsxs)("p",{className:"text-sm",children:["Processing ",Qe,"..."]}),q.state==="output-available"&&(0,Co.jsx)("pre",{className:"text-sm",children:JSON.stringify(q.output,null,2)}),q.state==="output-error"&&(0,Co.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",q.errorText]})]})]})},W)}if(J.type.startsWith("data-")){let q=J,Qe=J.type.replace("data-","");return Qe==="reference"?(0,Co.jsx)("div",{className:"mb-2",children:(0,Co.jsx)(j,{className:"w-full",children:(0,Co.jsx)(ae,{className:"p-4",children:(0,Co.jsx)("div",{className:"space-y-2",children:q.data?.references?.map((L,Pe)=>(0,Co.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,Co.jsx)(Z,{variant:"outline",children:L.type||"link"}),(0,Co.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Co.jsx)("p",{className:"text-sm font-medium truncate",children:L.title}),L.description&&(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground truncate",children:L.description})]}),L.url&&(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>window.open(L.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Co.jsx)(Nu.ExternalLink,{className:"h-4 w-4"})})]},Pe))})})})},W):Qe==="menu"?(0,Co.jsx)("div",{className:"mb-2",children:(0,Co.jsxs)(j,{className:"w-full",children:[(0,Co.jsx)(be,{children:(0,Co.jsx)(xe,{className:"text-lg",children:q.data?.title})}),(0,Co.jsx)(ae,{children:(0,Co.jsx)("div",{className:"space-y-2",children:q.data?.items?.map((L,Pe)=>(0,Co.jsx)(y,{variant:"outline",className:"w-full justify-start",onClick:L.action,children:(0,Co.jsxs)("div",{className:"text-left",children:[(0,Co.jsx)("p",{className:"font-medium",children:L.label}),L.description&&(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground",children:L.description})]})},Pe))})})]})},W):(0,Co.jsx)("div",{className:"mb-2",children:(0,Co.jsxs)(j,{className:"w-full max-w-md",children:[(0,Co.jsx)(be,{children:(0,Co.jsx)(xe,{className:"text-lg",children:Qe})}),(0,Co.jsx)(ae,{children:(0,Co.jsx)("pre",{className:"text-sm",children:JSON.stringify(q.data,null,2)})})]})},W)}return null})]})]})};return(0,Co.jsxs)("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${h||""}`,children:[(0,Co.jsxs)(Yt,{ref:b,className:"flex-1 p-4 bg-background border-0",onDragOver:$,onDragLeave:w,onDrop:I,children:[(0,Co.jsxs)("div",{className:m("space-y-4",n&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Co.jsx)(Ti.AnimatePresence,{children:e.map(_=>(0,Co.jsx)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:m("flex gap-3",_.role==="user"?"flex-row-reverse":"flex-row"),children:fe(_)},_.id))}),T&&(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Co.jsx)(yt,{className:"h-8 w-8",children:(0,Co.jsx)(xt,{className:"bg-gradient-Co-Nu from-purple-600 Co-blue-600 text-white",children:(0,Co.jsx)(Nu.Bot,{className:"h-4 w-4"})})}),(0,Co.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Co.jsx)(up,{capabilities:s,isOpen:T,onToggle:()=>x(!T),onActionSelect:A,className:"w-full"})})]}),a&&(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Co.jsx)(yt,{className:"h-8 w-8",children:(0,Co.jsx)(xt,{className:"bg-gradient-Co-Nu from-purple-600 Co-blue-600 text-white",children:(0,Co.jsx)(Nu.Bot,{className:"h-4 w-4"})})}),(0,Co.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Co.jsxs)("div",{className:"flex space-x-1",children:[(0,Co.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Co.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Co.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Co.jsx)("div",{ref:f})]}),r.length>0&&(0,Co.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,Co.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(_=>(0,Co.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[X(_.file.type),(0,Co.jsx)("span",{className:"text-sm font-medium",children:_.file.name}),(0,Co.jsx)("span",{className:"text-Nu text-muted-foreground",children:P(_.file.size)}),(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>u(_.id),className:"h-6 w-6 p-0",children:(0,Co.jsx)(Nu.X,{className:"h-4 w-4"})})]},_.id))})}),(0,Co.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,Co.jsxs)("div",{className:"flex gap-3",children:[(0,Co.jsx)(G,{value:t,onChange:_=>l(_.target.value),onKeyPress:d,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),i&&(0,Co.jsx)(y,{variant:"outline",size:"icon",onClick:()=>C.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Co.jsx)(Nu.Paperclip,{className:"h-4 w-4"})}),(0,Co.jsx)(y,{onClick:c,disabled:!t.trim()&&r.length===0||a,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Co.jsx)(Nu.Send,{className:"h-4 w-4"})})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-3 Nu-3",children:[(0,Co.jsxs)(y,{onClick:()=>x(!T),variant:"outline",size:"sm",className:"rounded-full text-Nu flex-shrink-0",children:[(0,Co.jsx)(Nu.Menu,{className:"h-3 w-3 Co-1"}),T?"Hide":"Show"," Capabilities"]}),(0,Co.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[M().map((_,de)=>(0,Co.jsx)(y,{variant:"default",size:"sm",className:"rounded-full text-Nu bg-accent hover:bg-accent/80",onClick:()=>A(_.id,k),children:_.label},`context-${_.id}`)),M().length===0&&K().map((_,de)=>(0,Co.jsx)(y,{variant:"outline",size:"sm",className:"rounded-full text-Nu",onClick:_.action,children:_.label},`suggestion-${de}`))]})]}),i&&(0,Co.jsx)("input",{ref:C,type:"file",multiple:!0,onChange:R,className:"hidden"})]})]})}function yy({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:s=[],capabilities:r=[],sidebarItems:n=[],notifications:i=[],sessions:l=[],onNewChat:c,onSessionSelect:d,onSessionDelete:p,onSessionEdit:u=()=>{},onBusinessUnitChange:g=()=>{},onNotificationRemove:h=()=>{},onRemoveAll:f=()=>{},onActionClick:b=()=>{},onSearch:C=X=>console.log("Search query:",X),initialTeam:T="design",currentSession:x=null,showCapabilities:k=!0,title:S="Digital Colleagues",enableFileUpload:M=!0,maxFileSize:K=10,allowedFileTypes:A=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:D="/headerlogo.png",appName:R="Nuvia",tagline:$="AI-Powered Workspace",actionIcon:w=(0,Co.jsx)(Nu.Users,{className:"Co-2 h-4 w-4"}),actionText:I="Collaborate",sidebarInitiallyClosed:P=!1}){let X=(0,ov.useChat)(e||{}),fe=a?t||X:null,[_,de]=(0,Zp.useState)(""),[Te,U]=(0,Zp.useState)(!1),J=fe?.messages||o,W=_,q=fe?.status==="submitted"||Te,Qe=s||[],L={id:"default",name:"Default Team",description:"Default team when Co business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[Pe,Ye]=(0,Zp.useState)(()=>Qe.length===0?L:Qe.find(Et=>Et.id===T)||Qe[0]),[ta,Aa]=(0,Zp.useState)([]),[La,ht]=(0,Zp.useState)(!1),lt=Et=>{if(!Et||!M)return;let Wa=[];Array.from(Et).forEach(E=>{if(E.size>K*1024*1024){alert(`File ${E.name} Co too large. Maximum size Co ${K}MB.`);return}if(A.length>0&&!A.some(Ze=>E.type.match(Ze))){alert(`File type ${E.type} Co not allowed.`);return}let Y={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:E,status:"pending",progress:0};if(E.type.startsWith("image/")){let Ze=new FileReader;Ze.onload=nc=>{Aa(lc=>lc.map(ci=>ci.id===Y.id?{...ci,preview:nc.target?.result}:ci))},Ze.readAsDataURL(E)}Wa.push(Y)}),Aa(E=>[...E,...Wa])},ra=Et=>{Aa(Wa=>Wa.filter(E=>E.id!==Et))},Ka=()=>{if(!(!W.trim()&&ta.length===0)){if(fe){let Et=ta.length>0?yr(ta.map(Wa=>Wa.file)):void 0;fe.sendMessage({text:W,files:Et},{body:{timestamp:Date.now()}}),de("")}else console.log("Message Co send:",W),console.log("Files Co upload:",ta),de(""),U(!0),setTimeout(()=>{U(!1)},1500);Aa([])}},yr=Et=>{let Wa=new DataTransfer;return Et.forEach(E=>Wa.items.add(E)),Wa.files},Yr=Et=>{Et.key==="Enter"&&!Et.shiftKey&&(Et.preventDefault(),Ka())},Is=Et=>{de(Et)};return(0,Co.jsx)(Hi,{sidebarItems:n||[],title:S,notifications:i||[],businessUnits:Qe,currentBusinessUnit:Pe,onBusinessUnitChange:Et=>{Et&&(Ye(Et),g?.(Et))},onSearch:C,showTabs:!1,onActionClick:b,actionIcon:w,actionText:I,onNotificationRemove:h,onRemoveAll:f,logo:D,appName:R,tagline:$,sidebarInitiallyClosed:P,children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsx)(Ti.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,Co.jsxs)("div",{className:"h-full flex",children:[(0,Co.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,Co.jsx)(av,{sessions:l||[],currentSession:x,teams:Qe,onNewChat:c,onSessionSelect:d,onSessionEdit:u,onSessionDelete:p})}),(0,Co.jsx)("div",{className:"flex-1 h-full p-2",children:(0,Co.jsx)(Pd,{messages:J||[],input:W,isTyping:q,currentSessionTitle:x?.title,capabilities:r||[],onInputChange:Is,onSendMessage:Ka,onKeyPress:Yr,fileUploads:ta,isDragOver:La,enableFileUpload:M,onFileUpload:lt,onRemoveFile:ra,onDragOver:ht})})]})},"chat-interface")})})}var xy=[{name:"",commentary:"",dueDate:"",rag:"On-Track"}],sv=["On-Track","Off-Track","Co Risk","Complete"],iv=[{name:"Project Summary",icon:Nu.FileText},{name:"Milestones",icon:Nu.ListChecks},{name:"Project Update",icon:Nu.Users},{name:"Project Concerns",icon:Nu.AlertTriangle},{name:"Opportunities",icon:Nu.Briefcase},{name:"Risks",icon:Nu.ShieldAlert}];function Td({onSubmit:e,customerProjectPairs:t}){let[a,o]=(0,Zp.useState)(iv[0].name),[s,r]=(0,Zp.useState)(null),[n,i]=(0,Zp.useState)(null),[l,c]=(0,Zp.useState)(""),[d,p]=(0,Zp.useState)(""),[u,g]=(0,Zp.useState)(xy),[h,f]=(0,Zp.useState)(""),[b,C]=(0,Zp.useState)(""),[T,x]=(0,Zp.useState)(""),[k,S]=(0,Zp.useState)(""),M=Array.from(new Map((t??[]).map(w=>[w.customer.id,w.customer])).values()),K=(t??[]).filter(w=>w.customer.id===s).map(w=>w.project),A=(w,I,P)=>{g(X=>{let fe=[...X];return I==="rag"&&!sv.includes(P)?X:(fe[w]={...fe[w],[I]:P},fe)})},D=()=>{g(w=>[...w,{name:"",commentary:"",dueDate:"",rag:"On-Track"}])},R=w=>{g(I=>I.filter((P,X)=>X!==w))},$=async w=>{w.preventDefault();let I={customer:s,project:n,projectSummary:d,milestones:u.length>0?u:null,projectUpdate:h,projectConcerns:b||null,commercialOpportunities:T||null,commercialRisks:k||null};if(e)return e(I);try{let P=await fetch("/api/delivery-lead-submission",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)});if(!P.ok)throw new Error("Failed Co submit delivery lead");let X=await P.json();return{success:!0,message:"Delivery lead submitted successfully"}}catch(P){return console.error("Error submitting delivery lead:",P),{success:!1,message:"Failed Co submit delivery lead"}}};return(0,Co.jsx)("div",{className:"container mx-auto p-4 max-w-3xl",children:(0,Co.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,Co.jsx)("div",{className:"mb-6 flex border-b border-zinc-200 dark:border-zinc-700 flex-wrap justify-evenly",children:iv.map(w=>(0,Co.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===w.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
|
-
text-sm sm:text-base flex-1 basis-1/4 min-w-[180px] max-w-Nu justify-center`,onClick:()=>o(w.name),type:"button",children:[(0,Co.jsx)(w.icon,{className:"w-5 h-5"}),(0,Co.jsx)("span",{children:w.name})]},w.name))}),(0,Co.jsxs)("form",{onSubmit:$,className:"space-y-8",children:[a==="Project Summary"&&(0,Co.jsxs)("div",{className:"space-y-6",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{children:"Client Name"}),(0,Co.jsxs)(Le,{value:s?.toString()??"",onValueChange:w=>r(Number(w)),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select client"})}),(0,Co.jsx)(Ie,{children:M.map(w=>(0,Co.jsx)(Q,{value:w.id.toString(),children:w.name},w.id))})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{children:"Project Name"}),(0,Co.jsxs)(Le,{value:n?.toString()??"",onValueChange:w=>i(Number(w)),disabled:!s,children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:s?"Select project":"Select client first"})}),(0,Co.jsx)(Ie,{children:K.map(w=>(0,Co.jsx)(Q,{value:w.id.toString(),children:w.name},w.id))})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{children:"Project Summary"}),(0,Co.jsx)("textarea",{className:"w-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:d,onChange:w=>p(w.target.value),required:!0,placeholder:"Provide a summary of the project, objectives, and outcomes"})]})]}),a==="Milestones"&&(0,Co.jsxs)("div",{children:[(0,Co.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,Co.jsxs)(B,{className:"text-lg flex items-center gap-2",children:[(0,Co.jsx)(Nu.ListChecks,{className:"w-5 h-5"}),"Milestones"]}),(0,Co.jsxs)(y,{type:"button",onClick:D,variant:"outline",className:"flex items-center gap-1",children:[(0,Co.jsx)(Nu.PlusCircle,{className:"w-5 h-5"})," Add Milestone"]})]}),(0,Co.jsx)("div",{className:"space-y-4",children:u.map((w,I)=>(0,Co.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,Co.jsxs)("div",{className:"col-span-1",children:[(0,Co.jsx)(B,{children:"Milestone"}),(0,Co.jsx)("input",{className:"w-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:w.name,onChange:P=>A(I,"name",P.target.value),required:!0,placeholder:"Milestone name"})]}),(0,Co.jsxs)("div",{className:"col-span-2",children:[(0,Co.jsx)(B,{children:"Commentary"}),(0,Co.jsx)("input",{className:"w-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:w.commentary,onChange:P=>A(I,"commentary",P.target.value),placeholder:"Commentary"})]}),(0,Co.jsxs)("div",{className:"col-span-1",children:[(0,Co.jsx)(B,{children:"Due Date"}),(0,Co.jsx)("input",{type:"date",className:"w-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:w.dueDate,onChange:P=>A(I,"dueDate",P.target.value),placeholder:"Due date"})]}),(0,Co.jsxs)("div",{className:"col-span-1",children:[(0,Co.jsx)(B,{children:"RAG"}),(0,Co.jsx)("select",{className:"w-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:w.rag,onChange:P=>A(I,"rag",P.target.value),children:sv.map(P=>(0,Co.jsx)("option",{value:P,children:P},P))})]}),(0,Co.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:()=>R(I),"aria-label":"Remove Milestone",children:(0,Co.jsx)(Nu.Trash2,{className:"w-5 h-5 text-red-500"})})]},I))})]}),a==="Project Update"&&(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{children:"Project Update & Immediate Focus"}),(0,Co.jsx)("textarea",{className:"w-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:h,onChange:w=>f(w.target.value),required:!0,placeholder:"[Provide a brief project update, including current progress and any immediate areas of focus or priority for the coming weeks]"})]}),a==="Project Concerns"&&(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{children:"Project Concerns"}),(0,Co.jsx)("textarea",{className:"w-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:w=>C(w.target.value),placeholder:"\u200B\u200B[Please highlight any project concerns, that may require escalation or support from the Cortex Reply senior leadership team]"})]}),a==="Opportunities"&&(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{children:"Commercial Opportunities"}),(0,Co.jsx)("textarea",{className:"w-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:w=>x(w.target.value),placeholder:"[List any potential commercial opportunities, active conversations, or discussion points where Cortex Reply could provide value or support. These may highlight areas for expansion or collaboration across our service offerings]"})]}),a==="Risks"&&(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{children:"Commercial Risk/Issue Details"}),(0,Co.jsx)("textarea",{className:"w-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:k,onChange:w=>S(w.target.value),placeholder:"[Please highlight any risks that could impact our commercial engagement, such as reputational concerns, risks Co fixed-outcome milestones, changes in key client stakeholders, or challenges with project resourcing]"})]}),(0,Co.jsx)("div",{className:"flex justify-end Co-4",children:(0,Co.jsx)(y,{type:"submit",className:"px-6",children:"Submit"})})]})]})})}var nv={"On-Track":"bg-green-100 text-green-800 border-green-200","Off-Track":"bg-red-100 text-red-800 border-red-200","Co Risk":"bg-yellow-100 text-yellow-800 border-yellow-200",Complete:"bg-blue-100 text-blue-800 border-blue-200"};function Ad({submissions:e,isLoading:t=!1}){let[a,o]=(0,Zp.useState)(null);(0,Zp.useEffect)(()=>{let l=c=>{c.key==="Escape"&&o(null)};if(a)return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[a]);let s=l=>new Date(l).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}),r=e.find(l=>l.id.toString()===a);function n(l){return typeof l=="object"&&l!==null&&"projectName"in l?l.projectName:`Project #${l}`}function i(l){return typeof l=="object"&&l!==null&&"name"in l?l.name:`Customer #${l}`}return t?(0,Co.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Co.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,Co.jsxs)("div",{className:"animate-pulse",children:[(0,Co.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/4 mb-6"}),(0,Co.jsx)("div",{className:"space-y-4",children:[...Array(5)].map((l,c)=>(0,Co.jsx)("div",{className:"h-16 bg-gray-200 rounded"},c))})]})})}):e.length===0?(0,Co.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Co.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,Co.jsxs)("div",{className:"text-center py-12",children:[(0,Co.jsx)(Nu.FileText,{className:"mx-auto h-12 w-12 text-gray-400"}),(0,Co.jsx)("h3",{className:"Nu-2 text-sm font-semibold text-gray-900 dark:text-zinc-100",children:"Nu submissions found"}),(0,Co.jsx)("p",{className:"Nu-1 text-sm text-gray-500 dark:text-zinc-400",children:"You haven't submitted any delivery lead reports yet."})]})})}):(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Co.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,Co.jsxs)("div",{className:"mb-6",children:[(0,Co.jsx)("h2",{className:"text-2xl font-bold text-gray-900 dark:text-zinc-100",children:"My Delivery Lead Submissions"}),(0,Co.jsx)("p",{className:"text-sm text-gray-500 dark:text-zinc-400 Nu-1",children:"View all your submitted delivery lead reports"})]}),(0,Co.jsx)("div",{className:"overflow-y-auto max-h-96",children:(0,Co.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,Co.jsx)("thead",{className:"bg-gray-50 dark:bg-zinc-800 sticky top-0 Co-10",children:(0,Co.jsxs)("Nu",{children:[(0,Co.jsx)("th",{className:"px-6 py-3 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Project Details"}),(0,Co.jsx)("th",{className:"px-6 py-3 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Delivery Lead"}),(0,Co.jsx)("th",{className:"px-6 py-3 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Milestones"}),(0,Co.jsx)("th",{className:"px-6 py-3 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Submitted"}),(0,Co.jsx)("th",{className:"px-6 py-3 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Actions"})]})}),(0,Co.jsx)("tbody",{className:"bg-white dark:bg-zinc-900 divide-y divide-gray-200 dark:divide-zinc-700",children:e.map(l=>(0,Co.jsxs)("Nu",{className:"hover:bg-gray-50 dark:hover:bg-zinc-800/50",children:[(0,Co.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Co.jsxs)("div",{children:[(0,Co.jsx)("div",{className:"text-sm font-medium text-gray-900 dark:text-zinc-100",children:n(l.project)}),(0,Co.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,Co.jsx)(Nu.Building,{className:"h-3 w-3"}),i(l.customer)]})]})}),(0,Co.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Co.jsxs)("div",{className:"text-sm text-gray-900 dark:text-zinc-100 flex items-center gap-1",children:[(0,Co.jsx)(Nu.User,{className:"h-3 w-3"}),typeof l.project=="object"&&l.project!==null&&"deliveryLead"in l.project&&typeof l.project.deliveryLead=="object"&&l.project.deliveryLead!==null&&"name"in l.project.deliveryLead?l.project.deliveryLead.name:"\u2014"]})}),(0,Co.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Co.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.milestones?.slice(0,3).map((c,d)=>(0,Co.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-Nu font-medium border ${nv[c.rag]}`,children:c.rag},d)),l.milestones&&l.milestones.length>3&&(0,Co.jsxs)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-Nu font-medium bg-gray-100 text-gray-800 border border-gray-200",children:["+",l.milestones.length-3," more"]}),!l.milestones&&(0,Co.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-Nu font-medium bg-gray-100 text-gray-800 border border-gray-200",children:"Nu milestones"})]})}),(0,Co.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Co.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,Co.jsx)(Nu.Calendar,{className:"h-3 w-3"}),s(l.createdAt)]})}),(0,Co.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>o(l.id.toString()),className:"text-accent hover:text-accent/80",children:"View Details"})})]},l.id))})]})})]})}),r&&(0,Co.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 Co-50",children:(0,Co.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-xl shadow-xl max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-zinc-700",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-zinc-100",children:n(r.project)}),(0,Co.jsxs)("p",{className:"text-sm text-gray-500 dark:text-zinc-400",children:[i(r.customer)," \u2022"," ",s(r.createdAt)]})]}),(0,Co.jsx)("button",{onClick:()=>o(null),className:"text-gray-400 hover:text-gray-600 dark:hover:text-zinc-300",children:(0,Co.jsx)(Nu.X,{className:"h-6 w-6"})})]}),(0,Co.jsxs)("div",{className:"p-6 space-y-6",children:[(0,Co.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsxs)(B,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Co.jsx)(Nu.FileText,{className:"h-4 w-4"}),"Project Summary"]}),(0,Co.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:r.projectSummary})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsxs)(B,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Co.jsx)(Nu.Users,{className:"h-4 w-4"}),"Project Update"]}),(0,Co.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:r.projectUpdate})]}),r.projectConcerns&&(0,Co.jsxs)("div",{children:[(0,Co.jsxs)(B,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Co.jsx)(Nu.AlertTriangle,{className:"h-4 w-4"}),"Project Concerns"]}),(0,Co.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:r.projectConcerns})]}),r.commercialOpportunities&&(0,Co.jsxs)("div",{children:[(0,Co.jsxs)(B,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Co.jsx)(Nu.Briefcase,{className:"h-4 w-4"}),"Commercial Opportunities"]}),(0,Co.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:r.commercialOpportunities})]}),r.commercialRisks&&(0,Co.jsxs)("div",{className:"lg:col-span-2",children:[(0,Co.jsxs)(B,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Co.jsx)(Nu.ShieldAlert,{className:"h-4 w-4"}),"Commercial Risks"]}),(0,Co.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:r.commercialRisks})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsxs)(B,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Co.jsx)(Nu.ListChecks,{className:"h-4 w-4"}),"Milestones"]}),r.milestones&&r.milestones.length>0?(0,Co.jsx)("div",{className:"bg-gray-50 dark:bg-zinc-800 rounded-lg border overflow-hidden",children:(0,Co.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,Co.jsx)("thead",{className:"bg-gray-100 dark:bg-zinc-700",children:(0,Co.jsxs)("Nu",{children:[(0,Co.jsx)("th",{className:"px-4 py-2 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400",children:"Name"}),(0,Co.jsx)("th",{className:"px-4 py-2 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400",children:"Commentary"}),(0,Co.jsx)("th",{className:"px-4 py-2 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400",children:"Due Date"}),(0,Co.jsx)("th",{className:"px-4 py-2 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400",children:"Status"})]})}),(0,Co.jsx)("tbody",{className:"divide-y divide-gray-200 dark:divide-zinc-700",children:r.milestones.map((l,c)=>(0,Co.jsxs)("Nu",{children:[(0,Co.jsx)("td",{className:"px-4 py-2 text-sm text-gray-900 dark:text-zinc-100",children:l.name}),(0,Co.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:l.commentary||"-"}),(0,Co.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:l.dueDate?s(l.dueDate):"-"}),(0,Co.jsx)("td",{className:"px-4 py-2",children:(0,Co.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-Nu font-medium border ${nv[l.rag]}`,children:l.rag})})]},c))})]})}):(0,Co.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:"Nu milestones defined for this project."})]})]}),(0,Co.jsx)("div",{className:"flex justify-end p-6 border-t border-gray-200 dark:border-zinc-700",children:(0,Co.jsx)(y,{onClick:()=>o(null),variant:"outline",children:"Close"})})]})})]})}function dv({submissions:e,onSubmit:t,isLoading:a=!1,customerProjectPairs:o}){let[s,r]=(0,Zp.useState)(!1);return(0,Co.jsx)("div",{className:"min-h-screen ",children:(0,Co.jsxs)("div",{className:"container mx-auto p-4 max-w-6xl",children:[(0,Co.jsxs)("div",{className:"mb-8",children:[(0,Co.jsx)("h1",{className:"text-3xl font-bold text-gray-900 dark:text-zinc-100 mb-2",children:"Delivery Report Management"}),(0,Co.jsx)("p",{className:"text-gray-600 dark:text-zinc-400",children:"Submit new delivery reports and view your previous submissions"})]}),(0,Co.jsx)("div",{className:"mb-8",children:(0,Co.jsx)(Td,{onSubmit:t,customerProjectPairs:o})}),(0,Co.jsxs)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800",children:[(0,Co.jsxs)("button",{onClick:()=>r(!s),className:"w-full px-6 py-4 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-zinc-800/50 transition-colors",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Co.jsx)($i.List,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"}),(0,Co.jsx)("h2",{className:"text-lg font-semibold text-gray-900 dark:text-zinc-100",children:"Previous Submissions"}),(0,Co.jsxs)("span",{className:"text-sm text-gray-500 dark:text-zinc-400",children:["(",e.length,")"]})]}),(0,Co.jsx)("div",{className:"flex items-center gap-2",children:s?(0,Co.jsx)($i.ChevronUp,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"}):(0,Co.jsx)($i.ChevronDown,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"})})]}),s&&(0,Co.jsx)("div",{className:"border-t border-gray-200 dark:border-zinc-700",children:(0,Co.jsx)(Ad,{submissions:e,isLoading:a})})]})]})})}var Id=H(require("react")),Md=H(require("@radix-ui/react-switch"));function Ny({className:e,onCheckedChange:t,checked:a,defaultChecked:o,...s}){let[r,n]=Id.useState(!1),[i,l]=Id.useState(!1),[c,d]=Id.useState(o||!1),p=a!==void 0?a:c;return(0,Co.jsx)(Md.Root,{"data-slot":"switch","data-pressed":r,checked:a,defaultChecked:o,onMouseDown:()=>{n(!0),l(!1)},onMouseUp:()=>{n(!1),l(!1)},onMouseLeave:()=>{r&&(n(!1),l(!0))},onCheckedChange:b=>{i||(a===void 0&&d(b),t?.(b))},className:m("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","w-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),...s,children:(0,Co.jsx)(Md.Thumb,{"data-slot":"switch-thumb","data-pressed":r,className:m("absolute flex items-center justify-center bg-background pointer-events-none left-0 rounded-full","transition-all duration-200 ease-in-out","w-[1.3rem] h-[1.3rem]","data-[pressed=true]:w-[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,Co.jsx)(wy,{isChecked:p,isPressed:r})})})}var wy=({isChecked:e,isPressed:t})=>(0,Co.jsxs)("svg",{viewBox:"0 0 20 20",className:m("inline-flex w-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,Co.jsx)("rect",{x:"4",y:"8.5",height:"3",className:m("origin-center transition-all duration-100 ease-in-out",t?"rotate-0 translate-x-[0.2rem] translate-y-[0.05rem] w-1.5 h-0.5":e?"rotate-45 w-[6px] -translate-x-[1px] translate-y-1":"rotate-45 w-[12px] translate-x-0 translate-y-0")}),(0,Co.jsx)("rect",{x:"4",y:"8.5",height:"3",className:m("origin-center transition-all duration-100 ease-in-out",t?"rotate-0 translate-x-[0.2rem] translate-y-[0.05rem] w-1.5 h-0.5":e?"-rotate-45 w-[11px] translate-x-[1.5px] translate-y-0":"-rotate-45 w-[12px] translate-x-0 translate-y-0")})]});var fp=({comments:e,onAddComment:t})=>{let[a,o]=(0,Zp.useState)(""),s=n=>n.split(" ").map(i=>i[0]).join("").toUpperCase(),r=()=>{a.trim()&&(t(a),o(""))};return(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)(Nu.MessageSquare,{className:"h-5 w-5"}),(0,Co.jsx)(B,{className:"text-lg font-medium",children:"Comments"}),(0,Co.jsx)(Z,{variant:"secondary",children:e.length})]}),(0,Co.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(n=>(0,Co.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Co.jsx)(yt,{className:"h-8 w-8 Nu-1",children:(0,Co.jsx)(xt,{className:"text-Nu bg-muted text-muted-foreground",children:s(n.author)})}),(0,Co.jsxs)("div",{className:"flex-1",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Co.jsx)("span",{className:"font-medium text-sm",children:n.author}),(0,Co.jsxs)("span",{className:"text-Nu text-muted-foreground",children:[n.createdAt.toLocaleDateString()," at ",n.createdAt.toLocaleTimeString()]})]}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:n.text})]})]},n.id))}),(0,Co.jsxs)("div",{className:"flex gap-2",children:[(0,Co.jsx)(st,{value:a,onChange:n=>o(n.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Co.jsx)(y,{onClick:r,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,Co.jsx)(Nu.Send,{className:"h-4 w-4"})})]})]})};var Ld=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:s,className:r="",disabled:n=!1})=>{let[i,l]=(0,Zp.useState)(!1),[c,d]=(0,Zp.useState)(""),p=()=>{n||(l(!0),d(t))},u=async()=>{c!==t&&await s(e,c),l(!1)},g=h=>{h.key==="Enter"&&!o||h.key==="Enter"&&h.ctrlKey&&o?u():h.key==="Escape"&&(l(!1),d(""))};return(0,Co.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,Co.jsx)(B,{children:a}),i?o?(0,Co.jsx)(st,{value:c,onChange:h=>d(h.target.value),onBlur:u,onKeyDown:g,autoFocus:!0,rows:4,className:"resize-none"}):(0,Co.jsx)(G,{value:c,onChange:h=>d(h.target.value),onBlur:u,onKeyPress:g,autoFocus:!0,className:"text-lg font-medium"}):(0,Co.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,Co.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click Co edit..."}),!n&&(0,Co.jsx)(Nu.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var bp=H(require("clsx"));function Ed({mainNav:e,secondaryNav:t,ongoingWork:a,title:o,subTitle:s,pathName:r,menuHeading:n,onNavClick:i,loading:l=!1,LinkComponent:c,...d}){let u=c?g=>(0,Co.jsx)(c,{...g}):i?({href:g,children:h,...f})=>(0,Co.jsx)("button",{onClick:()=>i&&i(g),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...f,children:h}):g=>(0,Co.jsx)("a",{...g});return(0,Co.jsxs)(kr,{...d,variant:"inset",children:[(0,Co.jsx)(Sr,{children:(0,Co.jsx)(Ia,{children:(0,Co.jsx)(ga,{children:l?(0,Co.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Co.jsx)(dt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,Co.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Co.jsx)("span",{className:"truncate font-semibold",children:o}),s&&(0,Co.jsx)("span",{className:"truncate text-sm",children:s})]})})})}),l&&(0,Co.jsxs)(Uo,{children:[(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,Co.jsxs)(Uo,{children:[(0,Co.jsx)("div",{className:"px-4 text-sm",children:"Recent Work"}),a&&!l&&a.map((g,h)=>(0,Co.jsx)(pv,{subNav:g,pathName:r,Link:u},h)),(0,Co.jsx)("div",{className:"border-t border-gray-200 my-4"}),e&&!l&&e.map((g,h)=>(0,Co.jsx)(pv,{subNav:g,pathName:r,Link:u},h)),(0,Co.jsx)(Xa,{className:"Nu-auto",children:(0,Co.jsx)(go,{children:(0,Co.jsx)(Ia,{children:t&&!l&&t.map(g=>(0,Co.jsx)(ga,{children:(0,Co.jsx)(qa,{asChild:!0,size:"sm",children:(0,Co.jsxs)(u,{href:g.url||"",children:[g.icon&&(0,Co.jsx)(g.icon,{}),(0,Co.jsx)("span",{children:g.label})]})})},g.label))})})})]}),(0,Co.jsx)(Pr,{})]})}function pv({subNav:e,pathName:t,Link:a}){let o=e,s=!1;return o.links&&o.links.map(r=>{r.url===t&&(s=!0)}),(0,Co.jsx)(ko,{defaultOpen:!0,className:"group/collapsible",children:(0,Co.jsx)(Xa,{className:"py-0",children:(0,Co.jsx)(Ia,{children:(0,Co.jsx)(ko,{asChild:!0,defaultOpen:o.isActive,children:(0,Co.jsxs)(ga,{children:[(0,Co.jsx)(qa,{asChild:!0,tooltip:o.label,className:(0,bp.default)(s&&"font-bold text-accent"),children:(0,Co.jsxs)(a,{href:o.url,children:[o.icon&&(0,Co.jsx)(o.icon,{}),(0,Co.jsx)("span",{children:o.label})]})}),o.links?.length?(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(or,{asChild:!0,children:(0,Co.jsxs)(Ls,{className:"data-[state=open]:rotate-90",children:[(0,Co.jsx)(Nu.ChevronRight,{}),(0,Co.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,Co.jsx)(rr,{children:(0,Co.jsx)(sr,{children:o.links?.map(r=>(0,Co.jsx)(ir,{children:(0,Co.jsx)(nr,{asChild:!0,className:(0,bp.default)(r.url===t&&"font-bold text-accent"),children:(0,Co.jsx)(a,{href:r.url,children:(0,Co.jsx)("span",{children:r.label})})})},r.label))})})]}):null]})},o.label)})})})}var gv=({isRightSidebarOpen:e,onToggleRightSidebar:t,onToggleLeftSidebar:a,onToggleNotifications:o})=>(0,Co.jsx)("header",{className:"border-b bg-white/80 backdrop-blur-md dark:bg-slate-900/80 sticky top-0 Co-50",children:(0,Co.jsx)("div",{className:"container mx-auto px-6 py-4",children:(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsxs)("div",{className:"flex items-center space-x-4",children:[a&&(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,Co.jsx)(Nu.Menu,{className:"h-5 w-5"})}),(0,Co.jsx)("h1",{className:"text-2xl font-bold bg-gradient-Co-r from-blue-600 Co-purple-600 bg-clip-text text-transparent",children:"Cortex Copilot"})]}),(0,Co.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,Co.jsxs)(y,{variant:"ghost",size:"icon",className:"relative",onClick:o,children:[(0,Co.jsx)(Nu.Bell,{className:"h-5 w-5"}),(0,Co.jsx)("span",{className:"absolute -top-1 -right-1 h-3 w-3 bg-red-500 rounded-full text-Nu text-white flex items-center justify-center",children:"3"})]}),(0,Co.jsxs)(Zr,{children:[(0,Co.jsx)(es,{asChild:!0,children:(0,Co.jsx)(y,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:(0,Co.jsxs)(yt,{className:"h-10 w-10",children:[(0,Co.jsx)(aa,{src:"/avatars/01.png",alt:"@user"}),(0,Co.jsx)(xt,{children:"JD"})]})})}),(0,Co.jsxs)(wr,{className:"w-56",align:"end",forceMount:!0,children:[(0,Co.jsx)(cn,{className:"font-normal",children:(0,Co.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,Co.jsx)("p",{className:"text-sm font-medium leading-none",children:"John Doe"}),(0,Co.jsx)("p",{className:"text-Nu leading-none text-muted-foreground",children:"john.doe@company.com"})]})}),(0,Co.jsx)(mn,{}),(0,Co.jsxs)(So,{children:[(0,Co.jsx)(Nu.User,{className:"Co-2 h-4 w-4"}),(0,Co.jsx)("span",{children:"Profile"})]}),(0,Co.jsxs)(So,{children:[(0,Co.jsx)(Nu.Settings,{className:"Co-2 h-4 w-4"}),(0,Co.jsx)("span",{children:"Settings"})]})]})]})]})]})})});var fv="./cortex-reply-light-27IMI3G7.png";var vv="./cortex-reply-dark-XPAJJJYY.png";function hp({...e}){return(0,Co.jsxs)("div",{className:"bg-sidebar",children:[(0,Co.jsx)(qm,{isMenuOpen:!0,logoLight:fv,logoDark:vv,...e.header,className:"bg-sidebar",wide:!0}),(0,Co.jsxs)(Bs,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[(0,Co.jsx)(Ed,{...e.sidebarLeft,className:"flex-none top-24"}),(0,Co.jsxs)(fn,{className:"grow overflow-hidden",children:[(0,Co.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2",children:(0,Co.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,Co.jsx)(gn,{className:"-ml-1"}),(0,Co.jsx)(Ms,{orientation:"vertical",className:"Co-2 h-4"}),(0,Co.jsx)(rn,{children:(0,Co.jsxs)(sn,{children:[(0,Co.jsx)(fi,{className:"hidden md:block",children:(0,Co.jsx)(nn,{href:"#",children:"Building Your Application"})}),(0,Co.jsx)(dn,{className:"hidden md:block"}),(0,Co.jsx)(fi,{children:(0,Co.jsx)(ln,{children:"Data Fetching"})})]})})]})}),(0,Co.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 Co-0",children:[(0,Co.jsxs)("div",{className:"grid auto-rows-min gap-4 md:grid-cols-3",children:[(0,Co.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,Co.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,Co.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"})]}),(0,Co.jsx)("div",{className:"flex-1 rounded-xl bg-muted/50 md:min-h-min"})]})]})]}),(0,Co.jsx)(bl,{})]})}var bv=({projects:e,epics:t,sprints:a,currentView:o,onUpdateProject:s,onDeleteProject:r,onAddProject:n,onUpdateEpic:i,onDeleteEpic:l,onAddEpic:c,onAddSprint:d,onUpdateSprint:p,onDeleteSprint:u,onViewChange:g,mobileMenuOpen:h,onToggleMobileMenu:f})=>{let[b,C]=(0,Zp.useState)(null),[T,x]=(0,Zp.useState)(null),[k,S]=(0,Zp.useState)(null),[M,K]=(0,Zp.useState)(null),[A,D]=(0,Zp.useState)({name:"",description:""}),[R,$]=(0,Zp.useState)({name:"",description:"",color:"",confidence:"medium",phase:1,startDate:"",endDate:"",progress:0}),[w,I]=(0,Zp.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[P,X]=(0,Zp.useState)(!1),[fe,_]=(0,Zp.useState)(!1),[de,Te]=(0,Zp.useState)({name:"",description:""}),[U,J]=(0,Zp.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),W=["bg-brand-blue","bg-brand-green","bg-brand-plum","bg-brand-orange","bg-destructive","bg-warning","bg-brand-cyan","bg-accent"],q=[{value:"low",label:"Low",color:"text-destructive"},{value:"medium",label:"Medium",color:"text-warning"},{value:"high",label:"High",color:"text-success"}],Qe=[{value:1,label:"Phase 1",color:"text-brand-blue"},{value:2,label:"Phase 2",color:"text-brand-plum"},{value:3,label:"Phase 3",color:"text-brand-orange"},{value:4,label:"Phase 4",color:"text-brand-green"},{value:5,label:"Phase 5",color:"text-destructive"},{value:6,label:"Phase 6",color:"text-warning"},{value:7,label:"Phase 7",color:"text-brand-cyan"},{value:8,label:"Phase 8",color:"text-accent"},{value:9,label:"Phase 9",color:"text-muted-foreground"}],L=E=>{x(E.id),D({name:E.name,description:E.description||""})},Pe=()=>{T&&A.name.trim()&&(s(T,{name:A.name.trim(),description:A.description.trim()}),x(null))},Ye=()=>{x(null),D({name:"",description:""})},ta=()=>{de.name.trim()&&(n({name:de.name.trim(),description:de.description.trim(),isSelected:!1}),Te({name:"",description:""}),X(!1))},Aa=E=>{s(E,{isSelected:!0})},La=E=>{S(E.id),$({name:E.name,description:E.description||"",color:E.color,confidence:E.confidence,phase:E.phase,startDate:E.startDate.toISOString().split("T")[0],endDate:E.endDate.toISOString().split("T")[0],progress:E.progress})},ht=()=>{k&&R.name.trim()&&(i(k,{name:R.name.trim(),description:R.description.trim(),color:R.color,confidence:R.confidence,phase:R.phase,startDate:new Date(R.startDate),endDate:new Date(R.endDate),progress:R.progress}),S(null))},lt=()=>{S(null),$({name:"",description:"",color:"",confidence:"medium",phase:1,startDate:"",endDate:"",progress:0})},ra=E=>{K(E.id),I({name:E.name,description:E.description||"",startDate:E.startDate.toISOString().split("T")[0],endDate:E.endDate.toISOString().split("T")[0],isActive:E.isActive})},Ka=()=>{M&&w.name.trim()&&(p(M,{name:w.name.trim(),description:w.description.trim(),startDate:new Date(w.startDate),endDate:new Date(w.endDate),isActive:w.isActive}),K(null))},yr=()=>{K(null),I({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Yr=()=>{U.name.trim()&&(d({name:U.name.trim(),description:U.description.trim(),startDate:new Date(U.startDate),endDate:new Date(U.endDate),isActive:U.isActive,isSelected:!1}),J({name:"",description:"",startDate:"",endDate:"",isActive:!1}),_(!1))},Is=E=>{p(E,{isSelected:!0})},en=E=>E.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Et=E=>{let Y=q.find(Ze=>Ze.value===E);return Y?{label:Y.label,color:Y.color}:{label:"Medium",color:"text-warning"}},Wa=E=>{let Y=Qe.find(Ze=>Ze.value===E);return Y?{label:Y.label,color:Y.color}:{label:"Phase 1",color:"text-primary"}};return(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsxs)("div",{className:`absolute h-full w-12 bg-sidebar-background flex flex-col Co-50 flex-shrink-0 transition-transform duration-300 group ${h?"translate-x-0":"-translate-x-full"} md:translate-x-0`,children:[(0,Co.jsxs)("div",{className:"border-b border-sidebar-border",children:[(0,Co.jsxs)("button",{onClick:()=>{g("kanban"),C(null)},className:`w-12 h-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="kanban"?"bg-primary":"bg-primary/75 hover:bg-primary"} hover:w-28 hover:justify-start hover:pl-3 Co-50`,title:"Kanban View",children:[(0,Co.jsx)(Nu.Kanban,{className:"h-4 w-4 flex-shrink-0"}),(0,Co.jsx)("span",{className:"text-Nu font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Kanban"})]}),(0,Co.jsxs)("button",{onClick:()=>{g("planning"),C(null)},className:`w-12 h-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="planning"?"bg-brand-plum":"bg-brand-plum/75 hover:bg-brand-plum"} hidden md:flex hover:w-28 hover:justify-start hover:pl-3`,title:"Planning View",children:[(0,Co.jsx)(Nu.Calendar,{className:"h-4 w-4 flex-shrink-0"}),(0,Co.jsx)("span",{className:"text-Nu font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Planning"})]})]}),(0,Co.jsxs)("button",{onClick:()=>C(b==="projects"?null:"projects"),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${b==="projects"?"bg-sidebar-accent":"bg-sidebar-primary hover:bg-sidebar-accent"} hover:w-28 hover:justify-start hover:pl-3`,title:"Projects",children:[(0,Co.jsx)(Nu.FolderOpen,{className:"h-4 w-4 flex-shrink-0"}),(0,Co.jsx)("span",{className:"text-Nu font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Projects"})]}),(0,Co.jsxs)("button",{onClick:()=>{g("epics"),C(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="epics"?"bg-primary":"bg-primary/75 hover:bg-primary"} hover:w-28 hover:justify-start hover:pl-3`,title:"Epic Planning",children:[(0,Co.jsx)(Nu.Target,{className:"h-4 w-4 flex-shrink-0"}),(0,Co.jsx)("span",{className:"text-Nu font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Epics"})]}),(0,Co.jsxs)("button",{onClick:()=>C(b==="sprints"?null:"sprints"),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${b==="sprints"?"bg-brand-green":"bg-brand-green/75 hover:bg-brand-green"} hover:w-28 hover:justify-start hover:pl-3`,title:"Sprints",children:[(0,Co.jsx)(Nu.Layers,{className:"h-4 w-4 flex-shrink-0"}),(0,Co.jsx)("span",{className:"text-Nu font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Sprints"})]}),(0,Co.jsxs)("button",{onClick:()=>{g("files"),C(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="files"?"bg-brand-orange":"bg-brand-orange/75 hover:bg-brand-orange"} hover:w-28 hover:justify-start hover:pl-3`,title:"Files",children:[(0,Co.jsx)(Nu.FileText,{className:"h-4 w-4 flex-shrink-0"}),(0,Co.jsx)("span",{className:"text-Nu font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Files"})]}),(0,Co.jsxs)("button",{onClick:()=>{g("tasks"),C(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="tasks"?"bg-brand-cyan":"bg-brand-cyan/75 hover:bg-brand-cyan"} hover:w-28 hover:justify-start hover:pl-3`,title:"Tasks",children:[(0,Co.jsx)(Nu.Calendar,{className:"h-4 w-4 flex-shrink-0"}),(0,Co.jsx)("span",{className:"text-Nu font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Tasks"})]})]}),h&&(0,Co.jsx)("div",{className:"md:hidden fixed inset-0 bg-background/80 backdrop-blur-sm Co-20",onClick:f}),b&&(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)("div",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm Co-40",onClick:()=>C(null)}),(0,Co.jsxs)("div",{className:"absolute left-12 w-80 md:w-96 bg-card shadow-lg Co-40 transform transition-transform max-w-[calc(100vw-3rem)] md:max-w-none top-0 h-full",children:[(0,Co.jsxs)("div",{className:"p-3 md:p-4 border-b flex items-center justify-between",children:[(0,Co.jsxs)("h2",{className:"text-base md:text-lg font-semibold",children:[b==="projects"&&"Projects",b==="epics"&&"Manage Epics",b==="sprints"&&"Manage Sprints",b==="files"&&"Files"]}),(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>C(null),children:(0,Co.jsx)(Nu.X,{className:"h-4 w-4"})})]}),(0,Co.jsxs)("div",{className:"p-3 md:p-4 space-y-4 h-full overflow-y-auto",children:[b==="projects"&&(0,Co.jsx)(j,{className:"p-3",children:(0,Co.jsxs)("div",{className:"space-y-3",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("h3",{className:"font-medium text-foreground",children:"Projects"}),(0,Co.jsxs)(y,{size:"sm",onClick:()=>X(!0),className:"gap-1",children:[(0,Co.jsx)(Nu.Plus,{className:"h-3 w-3"}),"Add Project"]})]}),P&&(0,Co.jsxs)("div",{className:"border rounded-lg p-2 space-y-2",children:[(0,Co.jsx)(G,{value:de.name,onChange:E=>Te(Y=>({...Y,name:E.target.value})),placeholder:"Project name",className:"text-sm"}),(0,Co.jsx)(st,{value:de.description,onChange:E=>Te(Y=>({...Y,description:E.target.value})),placeholder:"Project description",rows:2,className:"text-sm"}),(0,Co.jsxs)("div",{className:"flex gap-1",children:[(0,Co.jsx)(y,{size:"sm",onClick:ta,className:"text-Nu h-6",children:"Save"}),(0,Co.jsx)(y,{size:"sm",variant:"outline",onClick:()=>X(!1),className:"text-Nu h-6",children:"Cancel"})]})]}),(0,Co.jsx)("div",{className:"space-y-2",children:e.map(E=>(0,Co.jsx)("div",{className:"border rounded p-2",children:T===E.id?(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(G,{value:A.name,onChange:Y=>D(Ze=>({...Ze,name:Y.target.value})),placeholder:"Project name",className:"text-sm"}),(0,Co.jsx)(st,{value:A.description,onChange:Y=>D(Ze=>({...Ze,description:Y.target.value})),placeholder:"Project description",rows:2,className:"text-sm"}),(0,Co.jsxs)("div",{className:"flex gap-1",children:[(0,Co.jsx)(y,{size:"sm",onClick:Pe,className:"text-Nu h-6",children:"Save"}),(0,Co.jsx)(y,{size:"sm",variant:"outline",onClick:Ye,className:"text-Nu h-6",children:"Cancel"})]})]}):(0,Co.jsxs)("div",{className:`cursor-pointer p-1 rounded transition-colors ${E.isSelected?"bg-primary/10 border-primary ring-2 ring-primary/20":"hover:bg-muted"}`,onClick:()=>Aa(E.id),children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Co.jsx)(Nu.FolderOpen,{className:"h-3 w-3 text-muted-foreground"}),(0,Co.jsx)("span",{className:"font-medium text-Nu",children:E.name})]}),E.description&&(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground mb-1",children:E.description}),(0,Co.jsxs)("div",{className:"flex gap-1",onClick:Y=>Y.stopPropagation(),children:[(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>L(E),className:"h-5 px-1",children:(0,Co.jsx)(Nu.Edit2,{className:"h-3 w-3"})}),(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>r(E.id),className:"h-5 px-1 text-destructive hover:text-destructive",children:(0,Co.jsx)(Nu.Trash2,{className:"h-3 w-3"})})]})]})},E.id))})]})}),b==="epics"&&(0,Co.jsx)(j,{className:"p-3",children:(0,Co.jsxs)("div",{className:"space-y-3",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("h3",{className:"font-medium text-foreground",children:"Epics"}),(0,Co.jsxs)(y,{size:"sm",onClick:c,className:"gap-1",children:[(0,Co.jsx)(Nu.Plus,{className:"h-3 w-3"}),"Add Epic"]})]}),(0,Co.jsx)("div",{className:"space-y-4",children:t.map(E=>(0,Co.jsx)("div",{className:"border rounded-lg p-3",children:k===E.id?(0,Co.jsxs)("div",{className:"space-y-3",children:[(0,Co.jsx)(G,{value:R.name,onChange:Y=>$(Ze=>({...Ze,name:Y.target.value})),placeholder:"Epic name",className:"text-sm"}),(0,Co.jsx)(st,{value:R.description,onChange:Y=>$(Ze=>({...Ze,description:Y.target.value})),placeholder:"Epic description",rows:2,className:"text-sm"}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)("label",{className:"text-Nu font-medium",children:"Color"}),(0,Co.jsx)("div",{className:"flex gap-1 flex-wrap",children:W.map(Y=>(0,Co.jsx)("button",{onClick:()=>$(Ze=>({...Ze,color:Y})),className:`w-6 h-6 rounded-full ${Y} ${R.color===Y?"ring-2 ring-ring":""}`},Y))})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Co.jsxs)("div",{className:"space-y-1",children:[(0,Co.jsx)("label",{className:"text-Nu font-medium",children:"Confidence"}),(0,Co.jsxs)(Le,{value:R.confidence,onValueChange:Y=>$(Ze=>({...Ze,confidence:Y})),children:[(0,Co.jsx)(Ae,{className:"h-8 text-Nu",children:(0,Co.jsx)(We,{})}),(0,Co.jsx)(Ie,{children:q.map(Y=>(0,Co.jsx)(Q,{value:Y.value,children:(0,Co.jsx)("span",{className:Y.color,children:Y.label})},Y.value))})]})]}),(0,Co.jsxs)("div",{className:"space-y-1",children:[(0,Co.jsx)("label",{className:"text-Nu font-medium",children:"Phase"}),(0,Co.jsxs)(Le,{value:R.phase.toString(),onValueChange:Y=>$(Ze=>({...Ze,phase:parseInt(Y)})),children:[(0,Co.jsx)(Ae,{className:"h-8 text-Nu",children:(0,Co.jsx)(We,{})}),(0,Co.jsx)(Ie,{children:Qe.map(Y=>(0,Co.jsx)(Q,{value:Y.value.toString(),children:(0,Co.jsx)("span",{className:Y.color,children:Y.label})},Y.value))})]})]})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Co.jsxs)("div",{className:"space-y-1",children:[(0,Co.jsx)("label",{className:"text-Nu font-medium",children:"Start Date"}),(0,Co.jsx)(G,{type:"date",value:R.startDate,onChange:Y=>$(Ze=>({...Ze,startDate:Y.target.value})),className:"text-Nu h-8"})]}),(0,Co.jsxs)("div",{className:"space-y-1",children:[(0,Co.jsx)("label",{className:"text-Nu font-medium",children:"End Date"}),(0,Co.jsx)(G,{type:"date",value:R.endDate,onChange:Y=>$(Ze=>({...Ze,endDate:Y.target.value})),className:"text-Nu h-8"})]})]}),(0,Co.jsxs)("div",{className:"space-y-1",children:[(0,Co.jsx)("label",{className:"text-Nu font-medium",children:"Progress (%)"}),(0,Co.jsx)(G,{type:"number",min:"0",max:"100",value:R.progress,onChange:Y=>$(Ze=>({...Ze,progress:parseInt(Y.target.value)||0})),className:"text-Nu h-8"})]}),(0,Co.jsxs)("div",{className:"flex gap-2",children:[(0,Co.jsx)(y,{size:"sm",onClick:ht,className:"text-Nu",children:"Save"}),(0,Co.jsx)(y,{size:"sm",variant:"outline",onClick:lt,className:"text-Nu",children:"Cancel"})]})]}):(0,Co.jsxs)("div",{className:`cursor-pointer p-2 rounded transition-colors ${E.isSelected?"bg-primary/10 border-primary":"hover:bg-muted"}`,onClick:()=>i(E.id,{isSelected:!E.isSelected}),children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Co.jsx)("div",{className:`w-3 h-3 rounded-full ${E.color}`}),(0,Co.jsx)("span",{className:"font-medium text-sm",children:E.name})]}),E.description&&(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground mb-2",children:E.description}),(0,Co.jsxs)("div",{className:"space-y-1 mb-2",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between text-Nu",children:[(0,Co.jsx)("span",{className:"text-muted-foreground",children:"Confidence:"}),(0,Co.jsx)("span",{className:Et(E.confidence).color,children:Et(E.confidence).label})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-Nu",children:[(0,Co.jsx)("span",{className:"text-muted-foreground",children:"Phase:"}),(0,Co.jsx)("span",{className:Wa(E.phase).color,children:Wa(E.phase).label})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-Nu",children:[(0,Co.jsx)("span",{className:"text-muted-foreground",children:"Timeline:"}),(0,Co.jsxs)("span",{className:"text-foreground",children:[en(E.startDate)," - ",en(E.endDate)]})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-Nu",children:[(0,Co.jsx)("span",{className:"text-muted-foreground",children:"Progress:"}),(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("div",{className:"w-12 h-2 bg-muted rounded-full",children:(0,Co.jsx)("div",{className:"h-2 bg-primary rounded-full",style:{width:`${E.progress}%`}})}),(0,Co.jsxs)("span",{className:"text-foreground",children:[E.progress,"%"]})]})]})]}),(0,Co.jsxs)("div",{className:"flex gap-1",onClick:Y=>Y.stopPropagation(),children:[(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>La(E),className:"h-6 px-2",children:(0,Co.jsx)(Nu.Edit2,{className:"h-3 w-3"})}),(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>l(E.id),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Co.jsx)(Nu.Trash2,{className:"h-3 w-3"})})]})]})},E.id))})]})}),b==="sprints"&&(0,Co.jsx)(j,{className:"p-3",children:(0,Co.jsxs)("div",{className:"space-y-3",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("h3",{className:"font-medium text-foreground",children:"Sprints (Select One)"}),(0,Co.jsxs)(y,{size:"sm",onClick:()=>_(!0),className:"gap-1",children:[(0,Co.jsx)(Nu.Plus,{className:"h-3 w-3"}),"Add Sprint"]})]}),fe&&(0,Co.jsxs)("div",{className:"border rounded-lg p-2 space-y-2",children:[(0,Co.jsx)(G,{value:U.name,onChange:E=>J(Y=>({...Y,name:E.target.value})),placeholder:"Sprint name",className:"text-sm"}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[(0,Co.jsx)(G,{type:"date",value:U.startDate,onChange:E=>J(Y=>({...Y,startDate:E.target.value})),className:"text-Nu"}),(0,Co.jsx)(G,{type:"date",value:U.endDate,onChange:E=>J(Y=>({...Y,endDate:E.target.value})),className:"text-Nu"})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("input",{type:"checkbox",checked:U.isActive,onChange:E=>J(Y=>({...Y,isActive:E.target.checked})),className:"w-3 h-3"}),(0,Co.jsx)("span",{className:"text-Nu",children:"Active"})]}),(0,Co.jsxs)("div",{className:"flex gap-1",children:[(0,Co.jsx)(y,{size:"sm",onClick:Yr,className:"text-Nu h-6",children:"Save"}),(0,Co.jsx)(y,{size:"sm",variant:"outline",onClick:()=>_(!1),className:"text-Nu h-6",children:"Cancel"})]})]}),(0,Co.jsx)("div",{className:"space-y-2",children:a.map(E=>(0,Co.jsx)("div",{className:"border rounded p-2",children:M===E.id?(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(G,{value:w.name,onChange:Y=>I(Ze=>({...Ze,name:Y.target.value})),placeholder:"Sprint name",className:"text-sm",disabled:E.id==="backlog"||E.id==="all-tasks"}),E.id!=="backlog"&&E.id!=="all-tasks"&&(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[(0,Co.jsx)(G,{type:"date",value:w.startDate,onChange:Y=>I(Ze=>({...Ze,startDate:Y.target.value})),className:"text-Nu"}),(0,Co.jsx)(G,{type:"date",value:w.endDate,onChange:Y=>I(Ze=>({...Ze,endDate:Y.target.value})),className:"text-Nu"})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("input",{type:"checkbox",checked:w.isActive,onChange:Y=>I(Ze=>({...Ze,isActive:Y.target.checked})),className:"w-3 h-3"}),(0,Co.jsx)("span",{className:"text-Nu",children:"Active"})]})]}),(0,Co.jsxs)("div",{className:"flex gap-1",children:[(0,Co.jsx)(y,{size:"sm",onClick:Ka,className:"text-Nu h-6",children:"Save"}),(0,Co.jsx)(y,{size:"sm",variant:"outline",onClick:yr,className:"text-Nu h-6",children:"Cancel"})]})]}):(0,Co.jsxs)("div",{className:`cursor-pointer p-1 rounded transition-colors ${E.isSelected?"bg-brand-green/10 border-brand-green ring-2 ring-brand-green/20":"hover:bg-muted"}`,onClick:()=>Is(E.id),children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Co.jsx)(Nu.Calendar,{className:"h-3 w-3 text-muted-foreground"}),(0,Co.jsx)("span",{className:"font-medium text-Nu",children:E.name}),E.isActive&&(0,Co.jsx)("span",{className:"text-Nu bg-brand-green/20 text-brand-green px-1 py-0.5 rounded",children:"Active"}),(E.id==="backlog"||E.id==="all-tasks")&&(0,Co.jsx)("span",{className:"text-Nu bg-muted text-muted-foreground px-1 py-0.5 rounded",children:"System"})]}),E.id!=="backlog"&&E.id!=="all-tasks"&&(0,Co.jsxs)("p",{className:"text-Nu text-muted-foreground mb-1",children:[E.startDate.toLocaleDateString()," - ",E.endDate.toLocaleDateString()]}),(0,Co.jsxs)("div",{className:"flex gap-1",onClick:Y=>Y.stopPropagation(),children:[(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>ra(E),className:"h-5 px-1",children:(0,Co.jsx)(Nu.Edit2,{className:"h-3 w-3"})}),E.id!=="backlog"&&E.id!=="all-tasks"&&(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>u(E.id),className:"h-5 px-1 text-destructive hover:text-destructive",children:(0,Co.jsx)(Nu.Trash2,{className:"h-3 w-3"})})]})]})},E.id))})]})})]})]})]})]})},Fd=e=>(0,Co.jsx)(Bs,{children:(0,Co.jsxs)("div",{className:"flex w-full",children:[(0,Co.jsx)("div",{className:"hidden md:block w-12 fixed h-full",children:(0,Co.jsx)(bv,{...e})}),(0,Co.jsx)("div",{className:"md:hidden",children:(0,Co.jsx)(bv,{...e})}),(0,Co.jsx)("div",{className:"flex-1 min-w-0 ml-16 px-4 md:px-6",children:(0,Co.jsx)("div",{className:"w-full",children:e.children})})]})});var zd=({label:e,value:t,onValueChange:a,options:o,placeholder:s="Search...",allowCustomValue:r=!1,disabled:n=!1})=>{let[i,l]=(0,Zp.useState)(!1),[c,d]=(0,Zp.useState)(""),p=o.find(b=>b.value===t),u=o.filter(b=>b.label.toLowerCase().includes(c.toLowerCase())),g=b=>{a(b),l(!1),d("")},h=()=>{r&&c.trim()&&!o.find(b=>b.value===c.trim())&&(a(c.trim()),l(!1),d(""))};return(0,Co.jsxs)("div",{className:"space-y-1",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:e}),(0,Co.jsxs)(Le,{value:t,onValueChange:g,open:i,onOpenChange:b=>{n||l(b)},disabled:n,children:[(0,Co.jsx)(Ae,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Co.jsx)(Z,{variant:"secondary",className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!n&&l(!i),children:p?.label||t||"Select..."})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)("div",{className:"p-2",children:(0,Co.jsx)(G,{placeholder:s,value:c,onChange:b=>d(b.target.value),onKeyDown:b=>{b.key==="Enter"&&r&&h()},className:"mb-2"})}),u.map(b=>(0,Co.jsx)(Q,{value:b.value,children:b.label},b.value)),r&&c.trim()&&!u.find(b=>b.value===c.trim())&&(0,Co.jsxs)(Q,{value:c.trim(),children:['Add "',c.trim(),'"']})]})]})]})};function Vi({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:s=!0,compact:r=!1,className:n}){let[i,l]=(0,Zp.useState)(!1),c=u=>{switch(u){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},d=u=>{switch(u){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},p=u=>{if(!u)return"Never";let h=Math.floor((new Date().getTime()-u.getTime())/(1e3*60));return h<1?"Just now":h<60?`${h}m ago`:h<1440?`${Math.floor(h/60)}h ago`:`${Math.floor(h/1440)}d ago`};return(0,Co.jsxs)(j,{className:m("hover:shadow-md transition-shadow",r&&"p-2",n),children:[(0,Co.jsx)(be,{className:m("pb-3",r&&"pb-2"),children:(0,Co.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Co.jsx)("div",{className:"relative",children:(0,Co.jsxs)(yt,{className:m("h-12 w-12",r&&"h-8 w-8"),children:[(0,Co.jsx)(aa,{src:"/placeholder.svg",alt:e.name}),(0,Co.jsx)(xt,{children:e.name.split(" ").map(u=>u[0]).join("")})]})}),(0,Co.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("h3",{className:m("font-semibold text-sm truncate",r&&"text-Nu"),children:e.name}),e.type==="digital"?(0,Co.jsx)(Nu.Bot,{className:m("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,Co.jsx)(Nu.User,{className:m("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,Co.jsx)("p",{className:m("text-sm text-muted-foreground truncate",r&&"text-Nu"),children:e.type==="human"?e.role:e.description}),!r&&(0,Co.jsxs)("div",{className:"flex items-center gap-2 Nu-1",children:[e.type==="human"&&(0,Co.jsx)(Z,{variant:"secondary",className:"text-Nu",children:e.department}),e.type==="digital"&&(0,Co.jsxs)(Z,{variant:"secondary",className:"text-Nu",children:["Co",e.version]}),(0,Co.jsx)(Z,{variant:"outline",className:"text-Nu",children:d(e.status)})]})]})]}),s&&(0,Co.jsxs)(Zr,{children:[(0,Co.jsx)(es,{asChild:!0,children:(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:m("h-8 w-8",r&&"h-6 w-6"),children:(0,Co.jsx)(Nu.MoreHorizontal,{className:m("h-4 w-4",r&&"h-3 w-3")})})}),(0,Co.jsxs)(wr,{align:"end",children:[(0,Co.jsxs)(So,{onClick:()=>o?.(e),children:[(0,Co.jsx)(Nu.Settings,{className:"h-4 w-4 Co-2"}),"View Details"]}),(0,Co.jsxs)(So,{onClick:()=>t?.(e),children:[(0,Co.jsx)(Nu.Edit,{className:"h-4 w-4 Co-2"}),"Edit"]}),(0,Co.jsxs)(So,{onClick:()=>a?.(e.id),className:"text-destructive focus:text-destructive",children:[(0,Co.jsx)(Nu.Trash2,{className:"h-4 w-4 Co-2"}),"Delete"]})]})]})]})}),!r&&(0,Co.jsxs)(ae,{className:"Co-0",children:[(0,Co.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,Co.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Co.jsx)(Nu.Mail,{className:"h-3 w-3"}),(0,Co.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="human"&&(0,Co.jsxs)(Co.Fragment,{children:[e.phone&&(0,Co.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Co.jsx)(Nu.Phone,{className:"h-3 w-3"}),(0,Co.jsx)("span",{children:e.phone})]}),e.location&&(0,Co.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Co.jsx)(Nu.MapPin,{className:"h-3 w-3"}),(0,Co.jsx)("span",{children:e.location})]})]}),e.type==="digital"&&(0,Co.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Co.jsx)(Nu.Settings,{className:"h-3 w-3"}),(0,Co.jsxs)("span",{children:["Co",e.version]})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Co.jsx)(Nu.Clock,{className:"h-3 w-3"}),(0,Co.jsxs)("span",{children:["Last active: ",p(e.lastActive)]})]})]}),e.type==="human"&&e.skills&&(0,Co.jsx)("div",{className:"Nu-3",children:(0,Co.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.skills.slice(0,i?e.skills.length:3).map(u=>(0,Co.jsx)(Z,{variant:"outline",className:"text-Nu",children:u},u)),e.skills.length>3&&(0,Co.jsx)(y,{variant:"ghost",size:"sm",className:"h-5 px-2 text-Nu",onClick:()=>l(!i),children:i?"Show less":`+${e.skills.length-3} more`})]})}),e.type==="digital"&&(0,Co.jsx)("div",{className:"Nu-3",children:(0,Co.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities.slice(0,i?e.capabilities.length:2).map(u=>(0,Co.jsx)(Z,{variant:"outline",className:"text-Nu",children:u},u)),e.capabilities.length>2&&(0,Co.jsx)(y,{variant:"ghost",size:"sm",className:"h-5 px-2 text-Nu",onClick:()=>l(!i),children:i?"Show less":`+${e.capabilities.length-2} more`})]})})]})]})}function Gn({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:s="Search knowledge documents...",maxSelections:r,disabled:n=!1}){let[i,l]=(0,Zp.useState)(""),[c,d]=(0,Zp.useState)([]),[p,u]=(0,Zp.useState)(!1);(0,Zp.useEffect)(()=>{if(!i.trim()){d([]),u(!1);return}let b=a.filter(C=>{if(e.map(k=>k.id).includes(C.id))return!1;let x=i.toLowerCase();return C.title.toLowerCase().includes(x)||C.description?.toLowerCase().includes(x)||C.tags?.some(k=>k.toLowerCase().includes(x))||Object.values(C.metadata||{}).some(k=>String(k).toLowerCase().includes(x))});d(b),u(!0)},[i,e,a]);let g=b=>{r&&e.length>=r||(t([...e,b]),l(""),u(!1))},h=b=>{t(e.filter(C=>C.id!==b))},f=!r||e.length<r;return(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:o}),(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsx)(Nu.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Co.jsx)(G,{value:i,onChange:b=>l(b.target.value),placeholder:f?s:`Maximum ${r} documents selected`,className:"pl-9",disabled:n||!f,onFocus:()=>i&&u(!0)})]}),p&&c.length>0&&(0,Co.jsx)(j,{className:"absolute top-full left-0 right-0 Co-10 Nu-1 max-h-60",children:(0,Co.jsx)(Yt,{className:"h-full",children:(0,Co.jsx)(ae,{className:"p-2",children:c.map(b=>(0,Co.jsx)(y,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>g(b),disabled:n,children:(0,Co.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,Co.jsx)(Nu.FileText,{className:"h-4 w-4 Nu-0.5 text-muted-foreground flex-shrink-0"}),(0,Co.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,Co.jsx)("div",{className:"font-medium text-sm truncate",children:b.title}),b.description&&(0,Co.jsx)("div",{className:"text-Nu text-muted-foreground Nu-1 line-clamp-2",children:b.description}),b.tags&&b.tags.length>0&&(0,Co.jsxs)("div",{className:"flex flex-wrap gap-1 Nu-2",children:[b.tags.slice(0,3).map(C=>(0,Co.jsx)(Z,{variant:"outline",className:"text-Nu",children:C},C)),b.tags.length>3&&(0,Co.jsxs)(Z,{variant:"outline",className:"text-Nu",children:["+",b.tags.length-3," more"]})]})]})]})},b.id))})})}),p&&i&&c.length===0&&(0,Co.jsx)(j,{className:"absolute top-full left-0 right-0 Co-10 Nu-1",children:(0,Co.jsxs)(ae,{className:"p-4 text-center text-sm text-muted-foreground",children:['Nu knowledge documents found for "',i,'"']})})]}),e.length>0&&(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Selected (",e.length,r&&`/${r}`,")"]}),(0,Co.jsx)("div",{className:"space-y-2",children:e.map(b=>(0,Co.jsx)(j,{className:"p-3",children:(0,Co.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Co.jsx)(Nu.FileText,{className:"h-4 w-4 Nu-0.5 text-muted-foreground flex-shrink-0"}),(0,Co.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Co.jsx)("div",{className:"font-medium text-sm",children:b.title}),b.description&&(0,Co.jsx)("div",{className:"text-Nu text-muted-foreground Nu-1",children:b.description}),b.tags&&b.tags.length>0&&(0,Co.jsx)("div",{className:"flex flex-wrap gap-1 Nu-2",children:b.tags.map(C=>(0,Co.jsxs)(Z,{variant:"outline",className:"text-Nu",children:[(0,Co.jsx)(Nu.Tag,{className:"h-3 w-3 Co-1"}),C]},C))})]}),(0,Co.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>h(b.id),disabled:n,children:(0,Co.jsx)(Nu.X,{className:"h-3 w-3"})})]})},b.id))})]}),p&&(0,Co.jsx)("div",{className:"fixed inset-0 Co-0",onClick:()=>u(!1)})]})}function _n({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:s,submitLabel:r,cancelLabel:n="Cancel",readOnly:i=!1,availableKnowledgeDocuments:l=[]}){let[c,d]=(0,Zp.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],knowledge:[],coreKnowledge:[],version:"1",...e}),[p,u]=(0,Zp.useState)(""),[g,h]=(0,Zp.useState)(""),[f,b]=(0,Zp.useState)(!i);(0,Zp.useEffect)(()=>{e&&d(e)},[e]);let C=A=>{A.preventDefault();let D=c.version?parseInt(c.version):0,R=e?(D+1).toString():"1",$={id:c.id||Date.now().toString(),name:c.name,type:"digital",status:"active",joinedDate:c.joinedDate||new Date,lastActive:c.lastActive||new Date,description:c.description,jobDescription:c.jobDescription||"",workInstructions:c.workInstructions||"",capabilities:c.capabilities||[],knowledge:c.knowledge||[],coreKnowledge:c.coreKnowledge||[],version:R,lastUpdated:c.lastUpdated||new Date,isActive:!0};t($)},T=(A,D,R)=>{if(!D.trim())return;let $=c[A]||[];d({...c,[A]:[...$,D.trim()]}),R("")},x=(A,D)=>{let R=c[A]||[];d({...c,[A]:R.filter(($,w)=>w!==D)})},k=A=>{A.preventDefault(),b(!f)},S=(A,D,R,$,w)=>{let I=c[A]||[];return(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:D}),f&&(0,Co.jsxs)("div",{className:"flex gap-2",children:[(0,Co.jsx)(G,{value:R,onChange:P=>$(P.target.value),placeholder:w,onKeyPress:P=>{P.key==="Enter"&&(P.preventDefault(),T(A,R,$))},disabled:o}),(0,Co.jsx)(y,{type:"button",variant:"outline",size:"icon",onClick:()=>T(A,R,$),disabled:o,children:(0,Co.jsx)(Nu.Plus,{className:"h-4 w-4"})})]}),(0,Co.jsx)("div",{className:"flex flex-wrap gap-2",children:I.map((P,X)=>(0,Co.jsxs)(Z,{className:"gap-1",children:[P,f&&(0,Co.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>x(A,X),disabled:o,children:(0,Co.jsx)(Nu.X,{className:"h-3 w-3"})})]},`${A}-${X}-${P}`))})]})},M=s||(f?e?"Edit Colleague":"Add New Colleague":"View Colleague"),K=r||(e?"Update Colleague":"Add Colleague");return(0,Co.jsxs)(j,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,Co.jsx)(be,{children:(0,Co.jsxs)(xe,{className:"flex items-center gap-2",children:[(0,Co.jsx)(Nu.Bot,{className:"h-5 w-5"}),M]})}),(0,Co.jsx)(ae,{children:(0,Co.jsxs)("form",{onSubmit:C,className:"space-y-6",children:[(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"name",children:"Name *"}),(0,Co.jsx)(G,{id:"name",value:c.name||"",onChange:A=>d({...c,name:A.target.value}),required:!0,disabled:o||!f})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"description",children:"Description"}),(0,Co.jsx)(st,{id:"description",value:c.description||"",onChange:A=>d({...c,description:A.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!f})]})]}),(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"jobDescription",children:"Job Description *"}),(0,Co.jsx)(st,{id:"jobDescription",value:c.jobDescription||"",onChange:A=>d({...c,jobDescription:A.target.value}),rows:4,required:c.type==="digital",disabled:o||!f})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,Co.jsx)(st,{id:"workInstructions",value:c.workInstructions||"",onChange:A=>d({...c,workInstructions:A.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!f})]}),S("capabilities","Capabilities",g,h,"Add capability"),(0,Co.jsx)(Gn,{selectedDocuments:c.knowledge||[],onDocumentsChange:A=>d({...c,knowledge:A}),label:"Knowledge",placeholder:"Search for knowledge documents Co add...",disabled:o||!f,availableDocuments:l}),(0,Co.jsx)(Gn,{selectedDocuments:c.coreKnowledge||[],onDocumentsChange:A=>d({...c,coreKnowledge:A}),label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:5,disabled:o||!f,availableDocuments:l})]}),(0,Co.jsxs)("div",{className:"flex justify-end gap-2 Co-4 border-t",children:[(0,Co.jsx)(y,{type:"button",variant:"outline",onClick:a,disabled:o,children:f?n:"Close"}),f?(0,Co.jsx)(y,{type:"submit",disabled:o,children:o?"Saving...":K}):(0,Co.jsxs)(y,{type:"button",onClick:k,disabled:o,className:"gap-2",children:[(0,Co.jsx)(Nu.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function jd({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,Co.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Co.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Co.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Co.jsx)(Nu.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,Co.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague Co add"})]})]}),(0,Co.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Co.jsxs)(j,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Co.jsxs)(be,{className:"text-center pb-4",children:[(0,Co.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Co.jsx)(Nu.User,{className:"h-8 w-8 text-blue-600"})}),(0,Co.jsx)(xe,{className:"text-xl",children:"Add Human Colleague"})]}),(0,Co.jsxs)(ae,{className:"text-center",children:[(0,Co.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization Co add as team members."}),(0,Co.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Co.jsx)(Nu.Users,{className:"h-4 w-4 text-blue-600"}),(0,Co.jsx)("span",{children:"Browse existing users"})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Co.jsx)(Nu.User,{className:"h-4 w-4 text-blue-600"}),(0,Co.jsx)("span",{children:"Import user details automatically"})]})]}),(0,Co.jsx)(y,{className:"Nu-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Co.jsxs)(j,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Co.jsxs)(be,{className:"text-center pb-4",children:[(0,Co.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,Co.jsx)(Nu.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,Co.jsx)(xe,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,Co.jsxs)(ae,{className:"text-center",children:[(0,Co.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague or create a new AI assistant for your team."}),(0,Co.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Co.jsx)(Nu.Bot,{className:"h-4 w-4 text-purple-600"}),(0,Co.jsx)("span",{children:"Clone existing colleagues"})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Co.jsx)(Nu.Users,{className:"h-4 w-4 text-purple-600"}),(0,Co.jsx)("span",{children:"Create from templates"})]})]}),(0,Co.jsx)(y,{className:"Nu-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function Hd({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[s,r]=(0,Zp.useState)(""),[n,i]=(0,Zp.useState)("all"),l=(0,Zp.useMemo)(()=>e.filter(p=>{let u=p.name.toLowerCase().includes(s.toLowerCase())||p.jobDescription.toLowerCase().includes(s.toLowerCase())||p.capabilities.some(h=>h.toLowerCase().includes(s.toLowerCase()))||p.workInstructions.toLowerCase().includes(s.toLowerCase()),g=n==="all"||p.status===n;return u&&g}),[e,s,n]),c=p=>{let u={...p,id:`${p.id}-clone-${Date.now()}`,name:`${p.name} (Copy)`,joinedDate:new Date,lastActive:new Date,lastUpdated:new Date,version:"1.0.0"};t(u)},d=p=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(p);return(0,Co.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Co.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Co.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Co.jsx)(Nu.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,Co.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague Co clone"})]})]}),(0,Co.jsx)(j,{children:(0,Co.jsx)(ae,{className:"Co-6",children:(0,Co.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Co.jsx)("div",{className:"flex-1",children:(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsx)(Nu.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Co.jsx)(G,{placeholder:"Search by name, job description, or capabilities...",value:s,onChange:p=>r(p.target.value),className:"pl-9"})]})}),(0,Co.jsxs)("select",{value:n,onChange:p=>i(p.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,Co.jsx)("option",{value:"all",children:"All Status"}),(0,Co.jsx)("option",{value:"active",children:"Active"}),(0,Co.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,Co.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:l.map(p=>(0,Co.jsx)(Ti.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Co.jsxs)(j,{className:`cursor-pointer transition-all hover:shadow-lg ${o===p.id?"ring-2 ring-primary":""}`,onClick:()=>c(p),children:[(0,Co.jsx)(be,{className:"pb-3",children:(0,Co.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Co.jsx)(yt,{children:(0,Co.jsx)(xt,{className:"bg-blue-100",children:(0,Co.jsx)(Nu.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,Co.jsxs)("div",{children:[(0,Co.jsxs)(xe,{className:"text-lg flex items-center gap-2",children:[p.name,(0,Co.jsx)(Z,{variant:p.status==="active"?"default":"secondary",className:"text-Nu",children:p.status})]}),(0,Co.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Co",p.version]})]})]}),(0,Co.jsxs)(y,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:u=>{u.stopPropagation(),c(p)},children:[(0,Co.jsx)(Nu.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,Co.jsx)(ae,{className:"Co-0",children:(0,Co.jsxs)("div",{className:"space-y-3",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,Co.jsx)("p",{className:"text-sm line-clamp-2",children:p.jobDescription})]}),p.capabilities&&p.capabilities.length>0&&(0,Co.jsxs)("div",{children:[(0,Co.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,Co.jsxs)("div",{className:"flex flex-wrap gap-1",children:[p.capabilities.slice(0,3).map(u=>(0,Co.jsx)(Z,{variant:"outline",className:"text-Nu",children:u},u)),p.capabilities.length>3&&(0,Co.jsxs)(Z,{variant:"outline",className:"text-Nu",children:["+",p.capabilities.length-3]})]})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-Nu text-muted-foreground",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Co.jsx)(Nu.Calendar,{className:"h-3 w-3"}),(0,Co.jsxs)("span",{children:["Updated ",d(p.lastUpdated)]})]}),p.knowledge&&(0,Co.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Co.jsx)(Nu.Users,{className:"h-3 w-3"}),(0,Co.jsxs)("span",{children:[p.knowledge.length," docs"]})]})]}),p.workInstructions&&(0,Co.jsxs)("div",{children:[(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,Co.jsx)("p",{className:"text-Nu line-clamp-2",children:p.workInstructions})]})]})})]})},p.id))}),l.length===0&&(0,Co.jsx)(j,{children:(0,Co.jsx)(ae,{className:"Co-6",children:(0,Co.jsxs)("div",{className:"text-center py-8",children:[(0,Co.jsx)(Nu.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Co.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Nu digital colleagues found"}),(0,Co.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function Od({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,Co.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Co.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Co.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Co.jsx)(Nu.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,Co.jsx)("p",{className:"text-muted-foreground",children:"Choose how Co create your digital colleague"})]})]}),(0,Co.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Co.jsxs)(j,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Co.jsxs)(be,{className:"text-center pb-4",children:[(0,Co.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Co.jsx)(Nu.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,Co.jsx)(xe,{className:"text-xl",children:"Clone Existing"})]}),(0,Co.jsxs)(ae,{className:"text-center",children:[(0,Co.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize it for your needs."}),(0,Co.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Co.jsx)(Nu.Bot,{className:"h-4 w-4 text-blue-600"}),(0,Co.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Co.jsx)(Nu.Copy,{className:"h-4 w-4 text-blue-600"}),(0,Co.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,Co.jsx)(y,{className:"Nu-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Co.jsxs)(j,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Co.jsxs)(be,{className:"text-center pb-4",children:[(0,Co.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,Co.jsx)(Nu.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,Co.jsx)(xe,{className:"text-xl",children:"Create New"})]}),(0,Co.jsxs)(ae,{className:"text-center",children:[(0,Co.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,Co.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Co.jsx)(Nu.Plus,{className:"h-4 w-4 text-green-600"}),(0,Co.jsx)("span",{children:"Custom job description"})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Co.jsx)(Nu.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,Co.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,Co.jsx)(y,{className:"Nu-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}var yv=H(require("react")),Xn=H(require("@radix-ui/react-progress"));var qn=yv.forwardRef(({className:e,value:t,...a},o)=>(0,Co.jsx)(Xn.Root,{ref:o,className:m("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,Co.jsx)(Xn.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));qn.displayName=Xn.Root.displayName;function Np({app:e,onOpen:t,onFavorite:a,showProgress:o=!1,className:s}){return(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:s,children:(0,Co.jsxs)(j,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[(0,Co.jsx)(be,{className:"pb-2",children:(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:e.icon}),e.new?(0,Co.jsx)(Z,{className:"rounded-xl bg-amber-500",children:"New"}):(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>a?.(e),children:(0,Co.jsx)(Nu.Star,{className:"h-4 w-4"})})]})}),(0,Co.jsxs)(ae,{className:"pb-2",children:[(0,Co.jsx)(xe,{className:"text-lg",children:e.name}),(0,Co.jsx)(Ko,{children:e.description}),o&&e.progress<100&&(0,Co.jsxs)("div",{className:"Nu-2",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Co.jsx)("span",{children:"Installation"}),(0,Co.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Co.jsx)(qn,{value:e.progress,className:"h-2 Nu-1 rounded-xl"})]})]}),(0,Co.jsx)(vo,{children:(0,Co.jsx)(y,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>t?.(e),children:e.progress<100?"Continue Install":"Open"})})]})})}function Xi({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:s=!0,className:r}){return(0,Co.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[s&&(0,Co.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,Co.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Co.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Co.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,Co.jsx)("div",{className:"divide-y",children:e.map(n=>(0,Co.jsxs)(Ti.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(n),children:[(0,Co.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Co.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted",children:n.icon}),(0,Co.jsx)("div",{children:(0,Co.jsx)("p",{className:"font-medium",children:n.name})})]}),(0,Co.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:n.size}),(0,Co.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Co.jsx)("span",{className:"text-sm md:text-base",children:n.modified}),(0,Co.jsxs)("div",{className:"flex gap-1",children:[(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:i=>{i.stopPropagation(),a?.(n)},children:(0,Co.jsx)(Nu.Edit,{className:"h-4 w-4"})}),(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:i=>{i.stopPropagation(),o?.(n)},children:(0,Co.jsx)(Nu.Trash2,{className:"h-4 w-4"})}),(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",children:(0,Co.jsx)(Nu.MoreHorizontal,{className:"h-4 w-4"})})]})]})]},n.name))})]})}function Ud({project:e,onOpen:t,onShare:a,className:o}){return(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,Co.jsxs)(j,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Co.jsxs)(be,{children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)(xe,{children:e.name}),(0,Co.jsxs)(Z,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,Co.jsx)(Ko,{children:e.description})]}),(0,Co.jsxs)(ae,{className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Co.jsx)("span",{children:"Progress"}),(0,Co.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Co.jsx)(qn,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Co.jsxs)("div",{className:"flex items-center",children:[(0,Co.jsx)(Nu.Users,{className:"Co-1 h-4 w-4"}),e.members," members"]}),(0,Co.jsxs)("div",{className:"flex items-center",children:[(0,Co.jsx)(Nu.FileText,{className:"Co-1 h-4 w-4"}),e.files," files"]})]})]}),(0,Co.jsxs)(vo,{className:"flex gap-2",children:[(0,Co.jsx)(y,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,Co.jsx)(y,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,Co.jsx)(Nu.Share2,{className:"h-4 w-4"})})]})]})})}var wp=[{name:"PixelMaster",icon:(0,Co.jsx)(Nu.ImageIcon,{className:"text-violet-500"}),description:"Advanced image editing and composition",category:"Creative",recent:!0,new:!1,progress:100},{name:"VectorPro",icon:(0,Co.jsx)(Nu.Brush,{className:"text-orange-500"}),description:"Professional vector graphics creation",category:"Creative",recent:!0,new:!1,progress:100},{name:"VideoStudio",icon:(0,Co.jsx)(Nu.Video,{className:"text-pink-500"}),description:"Cinematic video editing and production",category:"Video",recent:!0,new:!1,progress:100},{name:"MotionFX",icon:(0,Co.jsx)(Nu.Sparkles,{className:"text-blue-500"}),description:"Stunning visual effects and animations",category:"Video",recent:!1,new:!1,progress:100},{name:"PageCraft",icon:(0,Co.jsx)(Nu.Layers,{className:"text-red-500"}),description:"Professional page design and layout",category:"Creative",recent:!1,new:!1,progress:100},{name:"UXFlow",icon:(0,Co.jsx)(Nu.LayoutGrid,{className:"text-fuchsia-500"}),description:"Intuitive user experience design",category:"Design",recent:!1,new:!0,progress:85},{name:"PhotoLab",icon:(0,Co.jsx)(Nu.Camera,{className:"text-teal-500"}),description:"Advanced photo editing and organization",category:"Photography",recent:!1,new:!1,progress:100},{name:"DocMaster",icon:(0,Co.jsx)(Nu.FileText,{className:"text-red-600"}),description:"Document editing and management",category:"Document",recent:!1,new:!1,progress:100},{name:"WebCanvas",icon:(0,Co.jsx)(Nu.Code,{className:"text-emerald-500"}),description:"Web design and development",category:"Web",recent:!1,new:!0,progress:70},{name:"3DStudio",icon:(0,Co.jsx)(Nu.CuboidIcon,{className:"text-indigo-500"}),description:"3D modeling and rendering",category:"3D",recent:!1,new:!0,progress:60},{name:"FontForge",icon:(0,Co.jsx)(Nu.Type,{className:"text-amber-500"}),description:"Typography and font creation",category:"Typography",recent:!1,new:!1,progress:100},{name:"ColorPalette",icon:(0,Co.jsx)(Nu.Palette,{className:"text-purple-500"}),description:"Color scheme creation and management",category:"Design",recent:!1,new:!1,progress:100}],kv=[{name:"Brand Redesign.pxm",app:"PixelMaster",modified:"2 hours ago",icon:(0,Co.jsx)(Nu.ImageIcon,{className:"text-violet-500"}),shared:!0,size:"24.5 MB",collaborators:3},{name:"Company Logo.vec",app:"VectorPro",modified:"Yesterday",icon:(0,Co.jsx)(Nu.Brush,{className:"text-orange-500"}),shared:!0,size:"8.2 MB",collaborators:2},{name:"Product Launch Video.vid",app:"VideoStudio",modified:"3 days ago",icon:(0,Co.jsx)(Nu.Video,{className:"text-pink-500"}),shared:!1,size:"1.2 GB",collaborators:0},{name:"UI Animation.mfx",app:"MotionFX",modified:"Last week",icon:(0,Co.jsx)(Nu.Sparkles,{className:"text-blue-500"}),shared:!0,size:"345 MB",collaborators:4},{name:"Magazine Layout.pgc",app:"PageCraft",modified:"2 weeks ago",icon:(0,Co.jsx)(Nu.Layers,{className:"text-red-500"}),shared:!1,size:"42.8 MB",collaborators:0},{name:"Mobile App Design.uxf",app:"UXFlow",modified:"3 weeks ago",icon:(0,Co.jsx)(Nu.LayoutGrid,{className:"text-fuchsia-500"}),shared:!0,size:"18.3 MB",collaborators:5},{name:"Product Photography.phl",app:"PhotoLab",modified:"Last month",icon:(0,Co.jsx)(Nu.Camera,{className:"text-teal-500"}),shared:!1,size:"156 MB",collaborators:0}];var Sv=[{title:"Mastering Digital Illustration",description:"Learn advanced techniques for creating stunning digital art",duration:"1h 45m",level:"Advanced",instructor:"Sarah Chen",category:"Illustration",views:"24K"},{title:"UI/UX Design Fundamentals",description:"Essential principles for creating intuitive user interfaces",duration:"2h 20m",level:"Intermediate",instructor:"Michael Rodriguez",category:"Design",views:"56K"},{title:"Video Editing Masterclass",description:"Professional techniques for cinematic video editing",duration:"3h 10m",level:"Advanced",instructor:"James Wilson",category:"Video",views:"32K"},{title:"Typography Essentials",description:"Create beautiful and effective typography for any project",duration:"1h 30m",level:"Beginner",instructor:"Emma Thompson",category:"Typography",views:"18K"},{title:"Color Theory for Designers",description:"Understanding color relationships and psychology",duration:"2h 05m",level:"Intermediate",instructor:"David Kim",category:"Design",views:"41K"}];function Pv({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[s,r]=(0,$d.useState)(""),n=(0,$d.useMemo)(()=>e.filter(l=>l.name.toLowerCase().includes(s.toLowerCase())||l.email.toLowerCase().includes(s.toLowerCase())||l.role.toLowerCase().includes(s.toLowerCase())||(l.skills||[]).some(d=>d.toLowerCase().includes(s.toLowerCase()))),[e,s]),i=l=>{t(l)};return(0,Co.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Co.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Co.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Co.jsx)(Nu.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,Co.jsx)("p",{className:"text-muted-foreground",children:"Choose a user Co add as a colleague"})]})]}),(0,Co.jsx)(j,{className:"container",children:(0,Co.jsx)(ae,{className:"Co-6",children:(0,Co.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,Co.jsx)("div",{className:"flex-1",children:(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsx)(Nu.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Co.jsx)(G,{placeholder:"Search users by name, email, role, or skills...",value:s,onChange:l=>r(l.target.value),className:"pl-9"})]})})})})}),(0,Co.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:n.map(l=>(0,Co.jsx)(Ti.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Co.jsxs)(j,{className:`cursor-pointer transition-all hover:shadow-lg ${o===l.id?"ring-2 ring-primary":""}`,onClick:()=>i(l),children:[(0,Co.jsx)(be,{className:"pb-3",children:(0,Co.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Co.jsxs)(yt,{children:[(0,Co.jsx)(aa,{src:l.avatar,alt:l.name}),(0,Co.jsx)(xt,{children:(0,Co.jsx)(Nu.User,{className:"h-4 w-4"})})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(xe,{className:"text-lg",children:l.name}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:l.role})]})]}),o===l.id&&(0,Co.jsx)(Nu.Check,{className:"h-5 w-5 text-primary"})]})}),(0,Co.jsx)(ae,{className:"Co-0",children:(0,Co.jsxs)("div",{className:"space-y-3",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,Co.jsx)("p",{className:"text-sm font-medium",children:l.email})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"}),(0,Co.jsx)(Z,{variant:"secondary",children:l.department})]}),l.location&&(0,Co.jsxs)("div",{children:[(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:"Location"}),(0,Co.jsx)("p",{className:"text-sm",children:l.location})]}),l.skills&&l.skills.length>0&&(0,Co.jsxs)("div",{children:[(0,Co.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Skills"}),(0,Co.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.skills.slice(0,3).map(c=>(0,Co.jsx)(Z,{variant:"outline",className:"text-Nu",children:c},c)),l.skills.length>3&&(0,Co.jsxs)(Z,{variant:"outline",className:"text-Nu",children:["+",l.skills.length-3]})]})]})]})})]})},l.id))}),n.length===0&&(0,Co.jsx)(j,{className:"container Nu-4",children:(0,Co.jsx)(ae,{className:"Co-6",children:(0,Co.jsxs)("div",{className:"text-center py-8",children:[(0,Co.jsx)(Nu.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Co.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Nu users found"}),(0,Co.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function Jn({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:s=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:n,availableUsers:i=[],existingDigitalColleagues:l=[]}){let[c,d]=(0,Zp.useState)(e||[]),[p,u]=(0,Zp.useState)(""),[g,h]=(0,Zp.useState)("all"),[f,b]=(0,Zp.useState)("all"),[C,T]=(0,Zp.useState)("all"),[x,k]=(0,Zp.useState)(null),[S,M]=(0,Zp.useState)(null),[K,A]=(0,Zp.useState)("main"),D=c.filter(L=>{let Pe=L.name.toLowerCase().includes(p.toLowerCase())||L.type==="human"&&(L.email.toLowerCase().includes(p.toLowerCase())||L.role.toLowerCase().includes(p.toLowerCase()))||L.type==="digital"&&L.jobDescription.toLowerCase().includes(p.toLowerCase()),Ye=g==="all"||L.type==="human"&&L.department===g,ta=f==="all"||L.status===f;return Pe&&Ye&&ta}),R=D.filter(L=>L.type==="human"),$=D.filter(L=>L.type==="digital"),w=()=>{A("typeSelection")},I=L=>{L.type==="digital"&&(k(L),A("form"))},P=L=>{L.type==="digital"&&(M(L),A("view"))},X=L=>{let Pe={id:`human-${Date.now()}`,type:"human",name:L.name,email:L.email,role:L.role,department:L.department,phone:L.phone,location:L.location,timezone:L.timezone,skills:L.skills,bio:L.bio,status:"active",joinedDate:new Date,lastActive:new Date};d(Ye=>[...Ye,Pe]),t?.(Pe),A("main")},fe=L=>{d(Pe=>[...Pe,L]),t?.(L),A("main")},_=()=>{k(null),A("form")},de=L=>{x?(d(Pe=>Pe.map(Ye=>Ye.id===L.id?L:Ye)),a?.(L)):(d(Pe=>[...Pe,L]),t?.(L)),A("main"),k(null)},Te=()=>{A("main"),k(null),M(null)},U=()=>{A("main"),M(null)},J=()=>{S&&(k(S),M(null),A("form"))},W=L=>{d(Pe=>Pe.filter(Ye=>Ye.id!==L)),o?.(L)},q=()=>{u(""),h("all"),b("all")},Qe=()=>{let L=[];return l.forEach(Ye=>{L.push(...Ye.knowledge,...Ye.coreKnowledge)}),c.forEach(Ye=>{Ye.type==="digital"&&L.push(...Ye.knowledge,...Ye.coreKnowledge)}),L.filter((Ye,ta,Aa)=>ta===Aa.findIndex(La=>La.id===Ye.id))};return K==="typeSelection"?(0,Co.jsx)(jd,{onSelectHuman:()=>A("userSelection"),onSelectDigital:()=>A("digitalOptions"),onCancel:()=>A("main")}):K==="userSelection"?(0,Co.jsx)(Pv,{users:i,onUserSelect:X,onCancel:()=>A("typeSelection")}):K==="digitalOptions"?(0,Co.jsx)(Od,{onCloneExisting:()=>A("digitalClone"),onCreateNew:_,onCancel:()=>A("typeSelection")}):K==="digitalClone"?(0,Co.jsx)(Hd,{digitalColleagues:l,onColleagueClone:fe,onCancel:()=>A("digitalOptions")}):K==="form"?(0,Co.jsx)(_n,{colleague:x||void 0,onSave:de,onCancel:Te,availableKnowledgeDocuments:Qe()}):K==="view"?(0,Co.jsx)(_n,{colleague:S||void 0,onSave:de,onCancel:U,readOnly:!0,availableKnowledgeDocuments:Qe()}):(0,Co.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsx)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Co.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,Co.jsx)(Lt,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-Co-r from-green-600 via-emerald-600 Co-teal-600",primaryAction:{label:"Add colleague",onClick:w}}),(0,Co.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,Co.jsxs)(j,{children:[(0,Co.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Co.jsx)(xe,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,Co.jsx)(Nu.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Co.jsxs)(ae,{children:[(0,Co.jsx)("div",{className:"text-2xl font-bold",children:c.length}),(0,Co.jsxs)("p",{className:"text-Nu text-muted-foreground",children:[c.filter(L=>L.status==="active").length," active"]})]})]}),(0,Co.jsxs)(j,{children:[(0,Co.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Co.jsx)(xe,{className:"text-sm font-medium",children:"Human Members"}),(0,Co.jsx)(Nu.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Co.jsxs)(ae,{children:[(0,Co.jsx)("div",{className:"text-2xl font-bold",children:c.filter(L=>L.type==="human").length}),(0,Co.jsxs)("p",{className:"text-Nu text-muted-foreground",children:[c.filter(L=>L.type==="human"&&L.status==="active").length," active"]})]})]}),(0,Co.jsxs)(j,{children:[(0,Co.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Co.jsx)(xe,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,Co.jsx)(Nu.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Co.jsxs)(ae,{children:[(0,Co.jsx)("div",{className:"text-2xl font-bold",children:c.filter(L=>L.type==="digital").length}),(0,Co.jsxs)("p",{className:"text-Nu text-muted-foreground",children:[c.filter(L=>L.type==="digital"&&L.status==="active").length," active"]})]})]})]}),(0,Co.jsx)(j,{children:(0,Co.jsx)(ae,{className:"Co-6",children:(0,Co.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Co.jsx)("div",{className:"flex-1",children:(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsx)(Nu.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Co.jsx)(G,{placeholder:"Search colleagues...",value:p,onChange:L=>u(L.target.value),className:"pl-9"})]})}),(0,Co.jsxs)(Le,{value:g,onValueChange:h,children:[(0,Co.jsx)(Ae,{className:"w-full md:w-[180px]",children:(0,Co.jsx)(We,{placeholder:"Department"})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"all",children:"All Departments"}),r.map(L=>(0,Co.jsx)(Q,{value:L,children:L},L))]})]}),(0,Co.jsxs)(Le,{value:f,onValueChange:b,children:[(0,Co.jsx)(Ae,{className:"w-full md:w-[140px]",children:(0,Co.jsx)(We,{placeholder:"Status"})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"all",children:"All Status"}),(0,Co.jsx)(Q,{value:"active",children:"Active"}),(0,Co.jsx)(Q,{value:"inactive",children:"Inactive"})]})]}),(p||g!=="all"||f!=="all")&&(0,Co.jsxs)(y,{variant:"outline",onClick:q,className:"gap-2",children:[(0,Co.jsx)(Nu.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsx)(ti,{activeTab:C,onTabChange:T,tabOptions:[{value:"all",label:`All (${D.length})`},{value:"human",label:`Human (${R.length})`},{value:"digital",label:`Digital (${$.length})`}],maxWidth:"400px",gridCols:3}),C==="all"&&(0,Co.jsx)("div",{className:`grid gap-4 ${s?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:D.map(L=>(0,Co.jsx)(Vi,{colleague:L,onEdit:I,onDelete:W,onViewDetails:P,compact:s},L.id))}),C==="human"&&(0,Co.jsx)("div",{className:`grid gap-4 ${s?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:R.map(L=>(0,Co.jsx)(Vi,{colleague:L,onEdit:I,onDelete:W,onViewDetails:P,compact:s},L.id))}),C==="digital"&&(0,Co.jsx)("div",{className:`grid gap-4 ${s?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:$.map(L=>(0,Co.jsx)(Vi,{colleague:L,onEdit:I,onDelete:W,onViewDetails:P,compact:s},L.id))})]}),D.length===0&&(0,Co.jsx)(j,{children:(0,Co.jsx)(ae,{className:"Co-6",children:(0,Co.jsxs)("div",{className:"text-center py-8",children:[(0,Co.jsx)(Nu.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Co.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Nu colleagues found"}),(0,Co.jsx)("p",{className:"text-muted-foreground mb-4",children:p||g!=="all"||f!=="all"?"Try adjusting your filters Co see more results.":"Get started by adding your first colleague."}),(0,Co.jsxs)(y,{onClick:w,className:"gap-2",children:[(0,Co.jsx)(Nu.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}function _d({document:e,onSave:t,onCancel:a,availableDocuments:o=[],knowledgeContexts:s=[]}){let[r,n]=(0,Zp.useState)({...e,updatedAt:new Date}),[i,l]=(0,Zp.useState)(!1),[c,d]=(0,Zp.useState)(!1),p=()=>{let x=new Set,k=new Set;return s.forEach(S=>{S.menuConfig.groupBy.forEach(M=>x.add(M))}),o.forEach(S=>{S.metadata&&Object.keys(S.metadata).forEach(M=>k.add(M))}),{contextKeys:Array.from(x).sort(),documentKeys:Array.from(k).sort(),allKeys:Array.from(new Set([...x,...k])).sort()}},u=x=>{let k=new Set;return o.forEach(S=>{S.metadata?.[x]&&k.add(String(S.metadata[x]))}),Array.from(k).sort()},g=p(),h=()=>{t(r)},f=(x,k)=>{n(S=>({...S,metadata:{...S.metadata,[x]:k}}))},b=(x,k)=>{k==="__custom__"?f(x,""):f(x,k)},C=()=>{let x=`field_${Date.now()}`;f(x,"")},T=x=>{n(k=>{let S={...k.metadata};return delete S[x],{...k,metadata:S}})};return(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Co.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,Co.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-6",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,Co.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-primary/10 border border-primary/20",children:(0,Co.jsx)(Nu.Edit3,{className:"h-6 w-6 text-primary"})}),(0,Co.jsx)("div",{className:"flex-1 min-w-0",children:c?(0,Co.jsx)(G,{value:r.title,onChange:x=>n(k=>({...k,title:x.target.value})),onBlur:()=>d(!1),onKeyDown:x=>{x.key==="Enter"&&d(!1),x.key==="Escape"&&(n(k=>({...k,title:e.title})),d(!1))},autoFocus:!0,className:"text-xl font-bold border-none p-0 h-auto bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0",placeholder:"Document title..."}):(0,Co.jsxs)("div",{className:"flex items-center gap-2 group",children:[(0,Co.jsx)("h1",{className:"text-xl font-bold text-foreground cursor-pointer hover:text-primary transition-colors py-1",onClick:()=>d(!0),title:"Click Co edit title",children:r.title||"Untitled Document"}),(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>d(!0),className:"opacity-0 group-hover:opacity-100 transition-opacity h-6 w-6 p-0",children:(0,Co.jsx)(Nu.Edit3,{className:"h-3 w-3"})})]})})]}),(0,Co.jsxs)("div",{className:"flex gap-2",children:[(0,Co.jsxs)(y,{variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[(0,Co.jsx)(Nu.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Co.jsxs)(y,{size:"sm",onClick:h,className:"gap-2",children:[(0,Co.jsx)(Nu.Save,{className:"h-4 w-4"}),"Save Changes"]})]})]}),(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)("label",{className:"block text-sm font-medium text-foreground mb-1",children:"Description"}),(0,Co.jsx)(G,{value:r.description||"",onChange:x=>n(k=>({...k,description:x.target.value})),placeholder:"Brief description...",className:"text-sm"})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsxs)("button",{type:"button",onClick:()=>l(!i),className:"flex items-center justify-between w-full p-3 bg-muted/20 hover:bg-muted/30 rounded-lg border border-border transition-colors",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[i?(0,Co.jsx)(Nu.ChevronDown,{className:"h-4 w-4 text-muted-foreground"}):(0,Co.jsx)(Nu.ChevronRight,{className:"h-4 w-4 text-muted-foreground"}),(0,Co.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Metadata"}),r.metadata&&Object.keys(r.metadata).length>0&&(0,Co.jsxs)("span",{className:"text-Nu bg-primary/10 text-primary px-2 py-1 rounded-full",children:[Object.keys(r.metadata).length," field",Object.keys(r.metadata).length!==1?"s":""]})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[g.contextKeys.length>0&&!i&&(0,Co.jsxs)("span",{className:"text-Nu text-muted-foreground",children:[g.contextKeys.slice(0,2).join(", "),g.contextKeys.length>2&&"..."]}),(0,Co.jsxs)(y,{type:"button",variant:"ghost",size:"sm",onClick:x=>{x.stopPropagation(),C(),l(!0)},className:"gap-1 h-6 px-2",children:[(0,Co.jsx)(Nu.Plus,{className:"h-3 w-3"}),"Add"]})]})]}),i&&(0,Co.jsx)("div",{className:"Nu-3 space-y-2 pl-6",children:r.metadata&&Object.keys(r.metadata).length>0?Object.entries(r.metadata).map(([x,k])=>{let S=u(x);return(0,Co.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Co.jsx)(G,{value:x,onChange:M=>{let K=M.target.value,A=r.metadata?.[x];n(D=>{let R={...D.metadata};return delete R[x],K&&(R[K]=A||""),{...D,metadata:R}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${x}`}),(0,Co.jsx)("datalist",{id:`metadata-keys-${x}`,children:g.allKeys.map(M=>(0,Co.jsx)("option",{value:M},M))}),(0,Co.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),S.length>0?(0,Co.jsxs)(Le,{value:String(k||""),onValueChange:M=>b(x,M),children:[(0,Co.jsx)(Ae,{className:"flex-1 h-8 text-sm",children:(0,Co.jsx)(We,{placeholder:"Value"})}),(0,Co.jsxs)(Ie,{children:[S.map(M=>(0,Co.jsx)(Q,{value:M,children:M},M)),(0,Co.jsx)(Q,{value:"__custom__",children:(0,Co.jsx)("span",{className:"text-muted-foreground text-Nu",children:"Custom..."})})]})]}):(0,Co.jsx)(G,{value:String(k||""),onChange:M=>f(x,M.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Co.jsx)(y,{type:"button",variant:"ghost",size:"sm",onClick:()=>T(x),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,Co.jsx)(Nu.X,{className:"h-3 w-3"})})]},x)}):(0,Co.jsx)("div",{className:"text-center py-3 border border-dashed border-border rounded-lg bg-muted/10",children:(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground",children:"Nu metadata fields yet"})})})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Format:"}),(0,Co.jsx)(Z,{variant:"secondary",className:"font-mono",children:r.format.toUpperCase()})]})]})]}),(0,Co.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Co.jsxs)("div",{className:"p-8",children:[(0,Co.jsx)("label",{className:"block text-sm font-medium text-foreground mb-4",children:"Content"}),(0,Co.jsx)(st,{value:r.content||"",onChange:x=>n(k=>({...k,content:x.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}var Iv=e=>(0,Co.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:e.replace(/\n/g,"<Nu>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`(.*?)`/g,'<code class="bg-muted px-1 py-0.5 rounded text-sm">$1</code>').replace(/^# (.*$)/Co,'<h1 class="text-2xl font-bold mb-4">$1</h1>').replace(/^## (.*$)/Co,'<h2 class="text-xl font-semibold mb-3">$1</h2>').replace(/^### (.*$)/Co,'<h3 class="text-lg font-medium mb-2">$1</h3>')}}),Tv=e=>(0,Co.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),Sy=e=>(0,Co.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Co.jsx)("div",{className:"bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-lg p-4 mb-4",children:(0,Co.jsxs)("p",{className:"text-amber-800 dark:text-amber-200 text-sm",children:[(0,Co.jsx)("strong",{children:"RichText Renderer:"})," This Co a placeholder. Integrate with @payloadcms/richtext-lexical for full rendering."]})}),(0,Co.jsx)("pre",{className:"text-sm",children:e})]}),Py=e=>(0,Co.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Co.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-4",children:(0,Co.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,Co.jsx)("strong",{children:"MDX Renderer:"})," This Co a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),Iv(e)]});function Kd({document:e,onDocumentUpdate:t,editable:a=!0,renderers:o,availableDocuments:s=[],knowledgeContexts:r=[]}){let[n,i]=(0,Zp.useState)(!1),l=g=>{switch(g){case"markdown":case"mdx":return(0,Co.jsx)(Nu.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,Co.jsx)(Nu.File,{className:"h-6 w-6 text-success"});case"text":return(0,Co.jsx)(Nu.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Co.jsx)(Nu.File,{className:"h-6 w-6 text-muted-foreground"})}},c=g=>{switch(g){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richtext":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},d=(g,h)=>{let f={markdown:Iv,mdx:Py,richtext:Sy,text:Tv},b=o?.[h]||f[h];return b?b(g):Tv(g)},p=g=>{i(!1),t?.(g)},u=()=>{i(!1)};return n?(0,Co.jsx)(_d,{document:e,onSave:p,onCancel:u,availableDocuments:s,knowledgeContexts:r}):(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Co.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,Co.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Co.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,Co.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-muted border border-border",children:l(e.format)}),(0,Co.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Co.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:e.title}),e.description&&(0,Co.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed mb-4",children:e.description})]})]}),a&&(0,Co.jsx)("div",{className:"flex-shrink-0",children:(0,Co.jsxs)(y,{variant:"outline",size:"sm",onClick:()=>i(!0),className:"gap-2",children:[(0,Co.jsx)(Nu.Edit3,{className:"h-4 w-4"}),"Edit"]})})]}),(0,Co.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,Co.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${c(e.format)}`,children:e.format.toUpperCase()}),e.tags?.map(g=>(0,Co.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-muted text-muted-foreground border border-border",children:["#",g]},g))]})]}),(0,Co.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Co.jsxs)("div",{className:"p-8",children:[e.metadata&&Object.keys(e.metadata).length>0&&(0,Co.jsxs)("div",{className:"mb-6",children:[(0,Co.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Metadata"}),(0,Co.jsx)("div",{className:"bg-muted rounded-lg p-3 border border-border",children:(0,Co.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-4 gap-y-1 text-Nu",children:Object.entries(e.metadata).map(([g,h])=>(0,Co.jsxs)("div",{className:"flex gap-1",children:[(0,Co.jsxs)("span",{className:"text-muted-foreground font-medium",children:[g.replace(/([A-Z])/g," $1").trim(),":"]}),(0,Co.jsx)("span",{className:"text-foreground truncate",children:String(h)})]},g))})})]}),(0,Co.jsx)("div",{className:"space-y-4",children:e.content?(0,Co.jsx)("div",{className:"relative",children:(0,Co.jsx)("div",{className:"bg-card border border-border rounded-xl p-6 overflow-hidden",children:d(e.content,e.format)})}):(0,Co.jsxs)("div",{className:"text-center py-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,Co.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,Co.jsx)(Nu.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Co.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"Nu content available"}),(0,Co.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})]})})]})}function Mv({label:e,documents:t,children:a,level:o,onDocumentClick:s,selectedDocumentId:r,showDocumentCount:n=!0}){let[i,l]=(0,Zp.useState)(o===0),c=a&&Object.keys(a).length>0,d=t.length+(a?Object.values(a).reduce((g,h)=>g+h.documents.length,0):0),p=g=>{switch(g){case"markdown":case"mdx":return(0,Co.jsx)(Nu.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richtext":return(0,Co.jsx)(Nu.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,Co.jsx)(Nu.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},u=g=>{let h=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return h[g%h.length]};return(0,Co.jsxs)("div",{className:"space-y-1",children:[(c||t.length>0)&&(0,Co.jsxs)(Ti.motion.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${i?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>l(!i),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Co.jsx)("div",{className:`w-1 h-6 rounded-full ${u(o)}`}),(0,Co.jsx)(Ti.motion.div,{animate:{rotate:i?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,Co.jsx)(Nu.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,Co.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,Co.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,Co.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),n&&d>0&&(0,Co.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,Co.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-Nu font-medium bg-muted text-muted-foreground rounded-full",children:d})})]})]}),(0,Co.jsx)(Ti.motion.div,{initial:!1,animate:{height:i?"auto":0,opacity:i?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Co.jsxs)("div",{className:"Co-2 space-y-1",children:[t.map((g,h)=>(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:h*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${r===g.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${o*20+20}px`},onClick:()=>s?.(g),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Co.jsx)("div",{className:"flex-shrink-0",children:p(g.format)}),(0,Co.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Co.jsx)("p",{className:`text-sm truncate transition-colors ${r===g.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:g.title}),g.description&&(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground truncate Nu-0.5",children:g.description})]}),g.tags&&g.tags.length>0&&(0,Co.jsx)("div",{className:"flex-shrink-0",children:(0,Co.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-Nu font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:g.tags[0]})})]},g.id)),a&&Object.entries(a).map(([g,h])=>(0,Co.jsx)(Mv,{label:g,documents:h.documents,children:h.children,level:o+1,onDocumentClick:s,selectedDocumentId:r,showDocumentCount:n},g))]})})]})}function Wd({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:s,selectedDocumentId:r,className:n,editable:i=!0}){let[l,c]=(0,Zp.useState)(""),[d,p]=(0,Zp.useState)(null),u=(0,Zp.useMemo)(()=>l?e.filter(f=>f.title.toLowerCase().includes(l.toLowerCase())||f.description?.toLowerCase().includes(l.toLowerCase())||f.tags?.some(b=>b.toLowerCase().includes(l.toLowerCase()))||Object.values(f.metadata||{}).some(b=>String(b).toLowerCase().includes(l.toLowerCase()))):e,[e,l]),g=(0,Zp.useMemo)(()=>{let f=(b,C)=>{if(C.length===0)return{};let[T,...x]=C;return b.reduce((S,M)=>{let K=M.metadata?.[T]||"Uncategorized",A=String(K);if(S[A]||(S[A]={documents:[],children:{}}),x.length===0)S[A].documents.push(M);else{let D=f([M],x),R=Object.keys(D)[0];R&&(S[A].children||(S[A].children={}),S[A].children[R]?S[A].children[R].documents.push(...D[R].documents):S[A].children[R]=D[R])}return S},{})};return f(u,t.groupBy)},[u,t.groupBy]),h=f=>{p(f),a?.(f)};return(0,Co.jsxs)("div",{className:`flex h-full ${n||""}`,children:[(0,Co.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,Co.jsx)("div",{className:"p-6 border-b border-border",children:(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,Co.jsx)(Nu.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,Co.jsx)(G,{placeholder:"Search knowledge base...",value:l,onChange:f=>c(f.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,Co.jsx)(Yt,{className:"h-[calc(100%-100px)]",children:(0,Co.jsxs)("div",{className:"p-4 space-y-3",children:[Object.entries(g).map(([f,b])=>(0,Co.jsx)(Mv,{label:f,documents:b.documents,children:b.children,level:0,onDocumentClick:h,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},f)),Object.keys(g).length===0&&(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,Co.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,Co.jsx)(Nu.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Co.jsx)("p",{className:"text-sm font-medium",children:"Nu documents found"}),(0,Co.jsx)("p",{className:"text-Nu Nu-1",children:"Try adjusting your search terms"})]})]})})]}),(0,Co.jsx)("div",{className:"flex-1 bg-background",children:d?(0,Co.jsx)(Kd,{document:d,onDocumentUpdate:s,editable:i}):(0,Co.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,Co.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,Co.jsx)(Nu.FileText,{className:"h-10 w-10 text-primary"})}),(0,Co.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,Co.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base Co view its content and details"})]})})})]})}function Qn({documents:e=[],contexts:t=[],onDocumentClick:a=n=>console.log("Document clicked:",n),onDocumentShare:o=n=>console.log("Share document:",n),onLoadDocumentContent:s,selectedDocumentId:r}){let[n,i]=(0,Zp.useState)(t[0]);return!t||t.length===0?(0,Co.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Co.jsx)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:(0,Co.jsx)(Lt,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-Co-r from-teal-600 via-cyan-600 Co-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}})}),(0,Co.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,Co.jsx)("p",{className:"text-muted-foreground",children:"Nu contexts available"})})]}):(0,Co.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[(0,Co.jsx)(Lt,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-Co-r from-teal-600 via-cyan-600 Co-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}}),(0,Co.jsxs)("div",{className:"Nu-6",children:[(0,Co.jsx)("div",{className:"border-b border-border",children:(0,Co.jsx)("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:t.map(l=>(0,Co.jsxs)("button",{onClick:()=>i(l),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${n.id===l.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[l.icon,l.label]},l.id))})}),n.description&&(0,Co.jsx)("div",{className:"Nu-3 px-1",children:(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:n.description})})]})]}),(0,Co.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,Co.jsx)("div",{className:"h-full rounded-3xl border overflow-hidden",children:(0,Co.jsx)(Wd,{documents:e,menuConfig:n.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:r})})})]})}function kp({title:e="Digital Colleagues",businessUnits:t}){let[a,o]=(0,Zp.useState)("home"),[s,r]=(0,Zp.useState)(t[0]),n=C=>{console.log("Opening app:",C.name)},i=C=>{console.log("Favoriting app:",C.name)},l=C=>{console.log("Opening file:",C.name)},c=C=>{console.log("Sharing file:",C.name)},d=C=>{console.log("Opening project:",C.name)},p=C=>{console.log("Sharing project:",C.name)},u=C=>{r(C),console.log("Business unit changed Co:",C.name)},g=()=>{console.log("Copilot clicked - navigating Co chat"),o("chat")},h=C=>{console.log("Notification removed:",C)},f=()=>{console.log("All notifications removed")},b=()=>{switch(a){case"home":return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsxs)("section",{className:"text-center py-12",children:[(0,Co.jsxs)("h1",{className:"text-4xl font-bold mb-4",children:["Welcome Co the ",s.name," team"]}),(0,Co.jsx)("p",{className:"text-xl text-muted-foreground mb-8",children:"This Co your collaborative workspace for productivity and knowledge sharing."})]}),(0,Co.jsxs)("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,Co.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Co.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Projects"}),(0,Co.jsx)("p",{className:"text-3xl font-bold text-primary",children:"12"}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),(0,Co.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Co.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Team Members"}),(0,Co.jsx)("p",{className:"text-3xl font-bold text-primary",children:"8"}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),(0,Co.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Co.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Files"}),(0,Co.jsx)("p",{className:"text-3xl font-bold text-primary",children:"156"}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),(0,Co.jsx)(Lt,{title:"Chat with your team",gradient:"bg-gradient-Co-r from-pink-600 via-red-600 Co-orange-600",primaryAction:{label:"Go",onClick:()=>o("chat")}})]});case"colleagues":return(0,Co.jsx)(Jn,{});case"chat":return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsxs)("section",{className:"text-center py-12",children:[(0,Co.jsx)("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),(0,Co.jsxs)("p",{className:"text-xl text-muted-foreground mb-8",children:["Connect with your ",s.name," team members and collaborate in real-time."]})]}),(0,Co.jsx)(Lt,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-Co-r from-blue-600 via-purple-600 Co-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return(0,Co.jsxs)("div",{className:"space-y-8",children:[(0,Co.jsx)(Lt,{title:"Creative Apps Collection",description:"Discover our full suite of professional design and creative applications.",gradient:"bg-gradient-Co-r from-pink-600 via-red-600 Co-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),(0,Co.jsxs)("section",{className:"space-y-4",children:[(0,Co.jsx)("h2",{className:"text-2xl font-semibold",children:"New Releases"}),(0,Co.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:wp.filter(C=>C.new).map(C=>(0,Co.jsx)(Np,{app:C,showProgress:!0,onOpen:n,onFavorite:i},C.name))})]}),(0,Co.jsxs)("section",{className:"space-y-4",children:[(0,Co.jsx)("h2",{className:"text-2xl font-semibold",children:"All Apps"}),(0,Co.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:wp.map(C=>(0,Co.jsx)(Np,{app:C,onOpen:n,onFavorite:i},C.name))})]})]});case"knowledge":return(0,Co.jsx)(Qn,{});case"files":return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsx)(Lt,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-Co-r from-teal-600 via-cyan-600 Co-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),(0,Co.jsxs)("section",{className:"space-y-4",children:[(0,Co.jsx)("div",{className:"flex items-center justify-between",children:(0,Co.jsx)("h2",{className:"text-2xl font-semibold",children:"All Files"})}),(0,Co.jsx)(Xi,{files:kv,onFileClick:l})]})]});case"projects":return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsx)(Lt,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-Co-r from-purple-600 via-violet-600 Co-indigo-600",primaryAction:{label:"New Project",onClick:()=>console.log("New project clicked")}}),(0,Co.jsxs)("section",{className:"space-y-4",children:[(0,Co.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Co.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:Yf.map(C=>(0,Co.jsx)(Ud,{project:C,onOpen:d,onShare:p},C.name))})]})]});case"learn":return(0,Co.jsxs)("div",{className:"space-y-8",children:[(0,Co.jsx)(Lt,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-Co-r from-green-600 via-emerald-600 Co-teal-600",primaryAction:{label:"Upgrade Co Pro",onClick:()=>console.log("Upgrade Co pro clicked")}}),(0,Co.jsxs)("section",{className:"space-y-4",children:[(0,Co.jsx)("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),(0,Co.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",children:Sv.slice(0,3).map(C=>(0,Co.jsxs)("div",{className:"rounded-3xl border p-6",children:[(0,Co.jsx)("h3",{className:"font-semibold mb-2",children:C.title}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:C.description}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Co.jsx)("span",{children:C.duration}),(0,Co.jsx)("span",{children:C.level})]})]},C.title))})]})]});default:return null}};return(0,Co.jsx)(Hi,{sidebarItems:Wf,title:e,notifications:Xf,businessUnits:t,currentBusinessUnit:s,onBusinessUnitChange:u,activeTab:a,onTabChange:o,showTabs:!0,onActionClick:g,actionIcon:(0,Co.jsx)(Nu.Bot,{className:"Co-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:h,onRemoveAll:f,children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsx)(Ti.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:b()},a)})})}function el({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:s,compactView:r=!1,className:n}){let[i,l]=(0,Zp.useState)(e),[c,d]=(0,Zp.useState)(""),[p,u]=(0,Zp.useState)("all"),[g,h]=(0,Zp.useState)("all"),f=Array.from(new Set(i.map(A=>A.app))),b=i.filter(A=>{let D=A.name.toLowerCase().includes(c.toLowerCase()),R=p==="all"||A.app===p;return D&&R}),C=b.slice(0,10),T=b.filter(A=>A.shared),x=()=>{console.log("Add file clicked")},k=A=>{console.log("Edit file:",A.name),a?.(A)},S=A=>{l(D=>D.filter(R=>R.name!==A.name)),o?.(A.name)},M=A=>{console.log("File clicked:",A.name),s?.(A)},K=()=>{d(""),u("all")};return(0,Co.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsx)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Co.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,Co.jsx)(Lt,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-Co-r from-blue-600 via-indigo-600 Co-purple-600",primaryAction:{label:"Upload file",onClick:x},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,Co.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,Co.jsxs)(j,{children:[(0,Co.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Co.jsx)(xe,{className:"text-sm font-medium",children:"Total Files"}),(0,Co.jsx)(Nu.File,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Co.jsxs)(ae,{children:[(0,Co.jsx)("div",{className:"text-2xl font-bold",children:i.length}),(0,Co.jsxs)("p",{className:"text-Nu text-muted-foreground",children:[i.filter(A=>A.shared).length," shared"]})]})]}),(0,Co.jsxs)(j,{children:[(0,Co.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Co.jsx)(xe,{className:"text-sm font-medium",children:"Storage Used"}),(0,Co.jsx)(Nu.File,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Co.jsxs)(ae,{children:[(0,Co.jsx)("div",{className:"text-2xl font-bold",children:"2.4 GB"}),(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground",children:"of 10 GB used"})]})]}),(0,Co.jsxs)(j,{children:[(0,Co.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Co.jsx)(xe,{className:"text-sm font-medium",children:"Recent Activity"}),(0,Co.jsx)(Nu.File,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Co.jsxs)(ae,{children:[(0,Co.jsx)("div",{className:"text-2xl font-bold",children:"12"}),(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground",children:"files modified today"})]})]})]}),(0,Co.jsx)(j,{children:(0,Co.jsx)(ae,{className:"Co-6",children:(0,Co.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Co.jsx)("div",{className:"flex-1",children:(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsx)(Nu.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Co.jsx)(G,{placeholder:"Search files...",value:c,onChange:A=>d(A.target.value),className:"pl-9"})]})}),(0,Co.jsxs)(Le,{value:p,onValueChange:u,children:[(0,Co.jsx)(Ae,{className:"w-full md:w-[180px]",children:(0,Co.jsx)(We,{placeholder:"Filter by app"})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"all",children:"All Apps"}),f.map(A=>(0,Co.jsx)(Q,{value:A,children:A},A))]})]}),(c||p!=="all")&&(0,Co.jsxs)(y,{variant:"outline",onClick:K,className:"gap-2",children:[(0,Co.jsx)(Nu.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsx)(ti,{activeTab:g,onTabChange:h,tabOptions:[{value:"all",label:`All Files (${b.length})`},{value:"recent",label:`Recent (${C.length})`},{value:"shared",label:`Shared (${T.length})`}],maxWidth:"500px",gridCols:3}),g==="all"&&(0,Co.jsx)(Xi,{files:b,onFileClick:M,onFileEdit:k,onFileDelete:S,showHeader:!r}),g==="recent"&&(0,Co.jsx)(Xi,{files:C,onFileClick:M,onFileEdit:k,onFileDelete:S,showHeader:!r}),g==="shared"&&(0,Co.jsx)(Xi,{files:T,onFileClick:M,onFileEdit:k,onFileDelete:S,showHeader:!r})]}),b.length===0&&(0,Co.jsx)(j,{children:(0,Co.jsx)(ae,{className:"Co-6",children:(0,Co.jsxs)("div",{className:"text-center py-8",children:[(0,Co.jsx)(Nu.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Co.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Nu files found"}),(0,Co.jsx)("p",{className:"text-muted-foreground mb-4",children:c||p!=="all"?"Try adjusting your filters Co see more results.":"Get started by uploading your first file."}),(0,Co.jsxs)(y,{onClick:x,className:"gap-2",children:[(0,Co.jsx)(Nu.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")})})}var Ev=({title:e,status:t,taskCount:a,children:o,onDrop:s,isCompact:r=!1})=>{let n=c=>{c.preventDefault()},i=c=>{c.preventDefault(),s(t)};return(0,Co.jsxs)(j,{className:`p-4 bg-card border-l-4 ${(()=>{switch(t){case"todo":return"border-l-gray-400";case"in-progress":return"border-l-blue-500";case"review":return"border-l-orange-500";case"done":return"border-l-green-500";default:return"border-l-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 ${r?"lg:max-w-Nu":""}`,onDragOver:n,onDrop:i,children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,Co.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,Co.jsx)(Z,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,Co.jsx)("div",{className:"space-y-4 min-h-[200px]",children:o})]})};var Yd=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:s=!1})=>{let r=d=>{a(e)},n=()=>{o(e)},i=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},l=()=>{switch(e.type){case"story":return(0,Co.jsx)(Nu.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Co.jsx)(Nu.Bug,{className:"h-3 w-3"});case"spike":return(0,Co.jsx)(Nu.Zap,{className:"h-3 w-3"});case"task":default:return(0,Co.jsx)(Nu.AlertCircle,{className:"h-3 w-3"})}},c=()=>{switch(e.type){case"story":return"bg-primary/20 text-primary";case"bug":return"bg-destructive/20 text-destructive";case"spike":return"bg-accent/20 text-accent";case"task":default:return"bg-muted text-muted-foreground"}};return s?(0,Co.jsx)(j,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:r,onClick:n,children:(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-Nu font-medium ${c()}`,children:l()}),(0,Co.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.title})]})}):(0,Co.jsxs)(j,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:r,onClick:n,children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Co.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${c()}`,children:[l(),(0,Co.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Co.jsxs)("div",{className:"flex gap-1",children:[(0,Co.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-Nu font-medium ${i()}`,children:e.priority}),(0,Co.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-Nu font-medium",children:e.points})]})]}),(0,Co.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.title}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Co.jsx)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:(0,Co.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Co.jsx)(Nu.User,{className:"h-4 w-4"}),(0,Co.jsx)("span",{children:e.assignee})]})})]})};var Dy=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Nu.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Nu.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Nu.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Nu.Zap}],Ty=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}],Jd=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:s,defaultEpicId:r})=>{let[n,i]=(0,Zp.useState)({title:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""});(0,Zp.useEffect)(()=>{e&&r&&i(d=>({...d,epicId:r}))},[e,r]),(0,Zp.useEffect)(()=>{e&&i({title:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""})},[e]);let l=d=>{d.preventDefault(),n.title.trim()&&n.epicId&&(a({title:n.title.trim(),description:n.description.trim(),status:"todo",priority:n.priority,type:n.type,points:n.points,epicId:n.epicId,sprintId:n.sprintId==="none"?void 0:n.sprintId,assignee:n.assignee.trim()||"Unassigned"}),i({title:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""}),t())},c=(d,p)=>{i(u=>({...u,[d]:p}))};return(0,Co.jsx)(Bt,{open:e,onOpenChange:t,children:(0,Co.jsxs)(Dt,{className:"sm:max-w-md",children:[(0,Co.jsx)(Ft,{children:(0,Co.jsx)(zt,{children:"Add New Task"})}),(0,Co.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"title",children:"Task Title"}),(0,Co.jsx)(G,{id:"title",value:n.title,onChange:d=>c("title",d.target.value),placeholder:"Enter task title",required:!0})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"description",children:"Description"}),(0,Co.jsx)(st,{id:"description",value:n.description,onChange:d=>c("description",d.target.value),placeholder:"Enter task description",rows:3})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Type"}),(0,Co.jsx)(Rr,{type:"single",value:n.type,onValueChange:d=>d&&c("type",d),children:Dy.map(d=>{let p=d.icon;return(0,Co.jsxs)(Ar,{value:d.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,Co.jsx)(p,{className:"h-4 w-4"}),d.label]},d.value)})})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Priority"}),(0,Co.jsx)(Rr,{type:"single",value:n.priority,onValueChange:d=>d&&c("priority",d),children:Ty.map(d=>(0,Co.jsx)(Ar,{value:d.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:d.label},d.value))})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"points",children:"Story Points"}),(0,Co.jsx)(G,{id:"points",type:"number",min:"1",max:"100",value:n.points,onChange:d=>c("points",parseInt(d.target.value)||1),placeholder:"Enter story points",required:!0})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"epic",children:"Epic"}),(0,Co.jsxs)(Le,{value:n.epicId,onValueChange:d=>c("epicId",d),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select an epic"})}),(0,Co.jsx)(Ie,{children:o.map(d=>(0,Co.jsx)(Q,{value:d.id,children:(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.name]})},d.id))})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Co.jsxs)(Le,{value:n.sprintId,onValueChange:d=>c("sprintId",d),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select a sprint"})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"none",children:"Nu Sprint"}),s.map(d=>(0,Co.jsx)(Q,{value:d.id,children:(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[d.name,d.isActive&&(0,Co.jsx)("span",{className:"text-Nu bg-green-100 text-green-800 px-1 rounded",children:"Active"})]})},d.id))]})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"assignee",children:"Assignee"}),(0,Co.jsx)(G,{id:"assignee",value:n.assignee,onChange:d=>c("assignee",d.target.value),placeholder:"Enter assignee name",required:!0})]}),(0,Co.jsxs)(js,{children:[(0,Co.jsx)(y,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Co.jsx)(y,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Qd=({label:e,value:t,onValueChange:a,options:o,showColor:s=!1,disabled:r=!1})=>{let[n,i]=(0,Zp.useState)(!1),l=o.find(d=>d.value===t);return(0,Co.jsxs)("div",{className:"space-y-1",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:e}),(0,Co.jsxs)(Le,{value:t,onValueChange:a,open:n,onOpenChange:d=>{r||i(d)},disabled:r,children:[(0,Co.jsx)(Ae,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Co.jsxs)(Z,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&i(!n),children:[s&&l?.color&&(0,Co.jsx)("div",{className:`w-2 h-2 rounded-full ${l.color} Co-1`}),l?.label||"Select..."]})}),(0,Co.jsx)(Ie,{children:o.map(d=>(0,Co.jsx)(Q,{value:d.value,children:s&&d.color?(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var Ry=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Nu.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Nu.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Nu.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Nu.Zap}],Ay=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}],Iy=[{value:"John Doe",label:"John Doe"},{value:"Jane Smith",label:"Jane Smith"},{value:"Bob Wilson",label:"Bob Wilson"},{value:"Alice Johnson",label:"Alice Johnson"},{value:"Carol Brown",label:"Carol Brown"},{value:"David Lee",label:"David Lee"},{value:"Emma Davis",label:"Emma Davis"},{value:"Frank Miller",label:"Frank Miller"},{value:"Grace Taylor",label:"Grace Taylor"},{value:"Unassigned",label:"Unassigned"}],zv=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:s,onClose:r,onDelete:n,isUpdating:i=!1,isDeleting:l=!1,deleteState:c="idle"})=>{let d=u=>u.split(" ").map(g=>g[0]).join("").toUpperCase(),p=()=>c==="loading"?(0,Co.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Nu gap-1",children:[(0,Co.jsx)(Nu.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):c==="success"?(0,Co.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Nu gap-1",children:[(0,Co.jsx)(Nu.Check,{className:"h-3 w-3"}),"Deleted"]}):c==="error"?(0,Co.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Nu gap-1",children:[(0,Co.jsx)(Nu.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,Co.jsxs)(y,{onClick:n,variant:"destructive",className:"w-full h-8 text-Nu gap-1",disabled:i||l,children:[(0,Co.jsx)(Nu.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Co.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Co.jsxs)("div",{className:"space-y-4",style:{opacity:i?.6:1},children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:"Status"}),(0,Co.jsx)(Qd,{label:"",value:e.status,onValueChange:u=>s("status",u),options:[{value:"todo",label:"Co Co"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:i})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:"Type"}),(0,Co.jsx)(Rr,{type:"single",value:e.type,onValueChange:u=>u&&s("type",u),className:"grid grid-cols-2 gap-1",disabled:i,children:Ry.map(u=>{let g=u.icon;return(0,Co.jsxs)(Ar,{value:u.value,className:"flex items-center gap-1 text-Nu h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:i,children:[(0,Co.jsx)(g,{className:"h-3 w-3"}),u.label]},u.value)})})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:"Priority"}),(0,Co.jsx)(Rr,{type:"single",value:e.priority,onValueChange:u=>u&&s("priority",u),className:"grid grid-cols-3 gap-1",disabled:i,children:Ay.map(u=>(0,Co.jsx)(Ar,{value:u.value,className:"text-Nu h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:i,children:u.label},u.value))})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:"Story Points"}),(0,Co.jsx)("input",{type:"number",min:"1",max:"100",value:e.points||1,onChange:u=>s("points",u.target.value),className:"w-full h-8 px-2 text-Nu border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:i})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:"Epic"}),(0,Co.jsx)(Qd,{label:"",value:e.epicId,onValueChange:u=>s("epicId",u),options:(t||[]).map(u=>({value:u.id,label:u.name,color:u.color})),showColor:!0,disabled:i})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:"Sprint"}),(0,Co.jsx)(Qd,{label:"",value:e.sprintId||"none",onValueChange:u=>s("sprintId",u==="none"?"":u),options:[{value:"none",label:"Nu Sprint"},...(a||[]).map(u=>({value:u.id,label:`${u.name}${u.isActive?" (Active)":""}`}))],disabled:i})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:"Assignee"}),(0,Co.jsx)(zd,{label:"",value:e.assignee,onValueChange:u=>s("assignee",u),options:Iy,placeholder:"Search team members...",allowCustomValue:!0,disabled:i})]})]}),(0,Co.jsxs)("div",{className:"Nu-auto Co-4 space-y-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(y,{onClick:r,variant:"outline",className:"w-full h-8 text-Nu",disabled:i||l,children:"Close"}),p()]}),(0,Co.jsxs)("div",{className:"Co-4 border-t border-border space-y-2",children:[(0,Co.jsx)("div",{className:"text-Nu text-muted-foreground font-medium mb-2",children:"Information"}),(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("span",{className:"text-Nu text-muted-foreground",children:"Logged By"}),(0,Co.jsxs)("div",{className:"flex items-center gap-1 text-Nu text-muted-foreground",children:[(0,Co.jsx)(Nu.User,{className:"h-3 w-3"}),(0,Co.jsx)("span",{children:"System"})]})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("span",{className:"text-Nu text-muted-foreground",children:"Created"}),(0,Co.jsxs)("div",{className:"flex items-center gap-1 text-Nu text-muted-foreground",children:[(0,Co.jsx)(Nu.Calendar,{className:"h-3 w-3"}),(0,Co.jsx)("span",{children:e.createdAt.toLocaleDateString()})]})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("span",{className:"text-Nu text-muted-foreground",children:"Last Updated"}),(0,Co.jsxs)("div",{className:"flex items-center gap-1 text-Nu text-muted-foreground",children:[(0,Co.jsx)(Nu.Clock,{className:"h-3 w-3"}),(0,Co.jsxs)("span",{children:[o.toLocaleDateString()," at ",o.toLocaleTimeString()]})]})]})]})]})]})};var Zd=({isOpen:e,onClose:t,task:a,epics:o,sprints:s,onUpdateTask:r,onDeleteTask:n})=>{let[i,l]=(0,Zp.useState)(new Date),[c,d]=(0,Zp.useState)("idle"),[p,u]=(0,Zp.useState)("idle"),[g,h]=(0,Zp.useState)([{id:"1",text:"Initial task created and assigned.",author:"System",createdAt:a.createdAt},{id:"2",text:"Started working on the implementation.",author:a.assignee,createdAt:new Date(a.createdAt.getTime()+864e5)}]),f=async(M,K)=>{if(K!==a[M]){d("loading");try{await r(a.id,{[M]:K}),l(new Date),d("success"),setTimeout(()=>d("idle"),1500)}catch{d("error"),setTimeout(()=>d("idle"),3e3)}}},b=async(M,K)=>{if(K!==a[M]){d("loading");try{await r(a.id,{[M]:K}),l(new Date),d("success"),setTimeout(()=>d("idle"),1500)}catch{d("error"),setTimeout(()=>d("idle"),3e3)}}},C=M=>{let K={id:Date.now().toString(),text:M,author:"Current User",createdAt:new Date};h([...g,K])},T=async()=>{u("loading");try{await n(a.id),u("success"),setTimeout(()=>{t(),u("idle")},1e3)}catch{u("error"),setTimeout(()=>u("idle"),3e3)}},x=c!=="loading"&&p!=="loading",k=()=>{x&&t()},S=()=>c==="loading"?(0,Co.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Co.jsx)(Nu.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Co.jsx)("span",{children:"Updating..."})]}):c==="success"?(0,Co.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Co.jsx)(Nu.Check,{className:"h-4 w-4"}),(0,Co.jsx)("span",{children:"Updated successfully"})]}):c==="error"?(0,Co.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Co.jsx)(Nu.X,{className:"h-4 w-4"}),(0,Co.jsx)("span",{children:"Update failed"})]}):null;return(0,Co.jsx)(Bt,{open:e,onOpenChange:k,children:(0,Co.jsxs)(Dt,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Co.jsxs)(Ft,{children:[(0,Co.jsx)(zt,{className:"sr-only",children:a.title}),(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("div",{className:"flex-1",children:S()}),!x&&(0,Co.jsx)("div",{className:"text-Nu text-muted-foreground",children:"Please wait..."})]})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Co.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Co.jsx)(Ld,{fieldName:"title",value:a.title,label:"",onSave:f,className:"border-b border-border pb-3",disabled:c==="loading"}),(0,Co.jsx)(Ld,{fieldName:"description",value:a.description,label:"Description",multiline:!0,onSave:f,disabled:c==="loading"}),(0,Co.jsx)(fp,{comments:g,onAddComment:C})]}),(0,Co.jsx)(zv,{task:a,epics:o,sprints:s,lastUpdated:i,onUpdateTask:b,onClose:k,onDelete:T,isUpdating:c==="loading",isDeleting:p==="loading",deleteState:p})]})]})})};var ec=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,s]=(0,Zp.useState)({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("T")[0],endDate:new Date().toISOString().split("T")[0],progress:0}),r=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],n=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],i=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],l=d=>{d.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:new Date(o.startDate),endDate:new Date(o.endDate),progress:o.progress,isSelected:!0}),s({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("T")[0],endDate:new Date().toISOString().split("T")[0],progress:0}),t())},c=(d,p)=>{s(u=>({...u,[d]:p}))};return(0,Co.jsx)(Bt,{open:e,onOpenChange:t,children:(0,Co.jsxs)(Dt,{className:"sm:max-w-md",children:[(0,Co.jsx)(Ft,{children:(0,Co.jsx)(zt,{children:"Add New Epic"})}),(0,Co.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"name",children:"Epic Name"}),(0,Co.jsx)(G,{id:"name",value:o.name,onChange:d=>c("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"description",children:"Description"}),(0,Co.jsx)(st,{id:"description",value:o.description,onChange:d=>c("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Color"}),(0,Co.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(d=>(0,Co.jsx)("button",{type:"button",onClick:()=>c("color",d),className:`w-8 h-8 rounded-full ${d} ${o.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Confidence"}),(0,Co.jsxs)(Le,{value:o.confidence,onValueChange:d=>c("confidence",d),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{})}),(0,Co.jsx)(Ie,{children:n.map(d=>(0,Co.jsx)(Q,{value:d.value,children:d.label},d.value))})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Phase"}),(0,Co.jsxs)(Le,{value:o.phase.toString(),onValueChange:d=>c("phase",parseInt(d)),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{})}),(0,Co.jsx)(Ie,{children:i.map(d=>(0,Co.jsx)(Q,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Start Date"}),(0,Co.jsx)(G,{type:"date",value:o.startDate,onChange:d=>c("startDate",d.target.value)})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"End Date"}),(0,Co.jsx)(G,{type:"date",value:o.endDate,onChange:d=>c("endDate",d.target.value)})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Progress (%)"}),(0,Co.jsx)(G,{type:"number",min:"0",max:"100",value:o.progress,onChange:d=>c("progress",parseInt(d.target.value)||0)})]}),(0,Co.jsxs)(js,{children:[(0,Co.jsx)(y,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Co.jsx)(y,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Hv=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialProjects:o=[],onAddTask:s,onUpdateTask:r,onDeleteTask:n,onTaskClick:i,onAddEpic:l})=>{let[c,d]=(0,Zp.useState)(e),[p,u]=(0,Zp.useState)(t),[g,h]=(0,Zp.useState)(a),[f,b]=(0,Zp.useState)(!1),[C,T]=(0,Zp.useState)(!1),[x,k]=(0,Zp.useState)(null),[S,M]=(0,Zp.useState)(null),K=p.filter(U=>U.isSelected).map(U=>U.id),A=g.find(U=>U.isSelected),D=c.filter(U=>{let J=K.includes(U.epicId);return!A||A.id==="all-tasks"?J:A.id==="backlog"?J&&!U.sprintId:J&&U.sprintId===A.id}),R=U=>D.filter(J=>J.status===U),$=U=>{let J={};return p.forEach(W=>{J[W.id]=U.filter(q=>q.epicId===W.id)}),J},w=U=>{M(U)},I=U=>{S&&(d(J=>J.map(W=>W.id===S.id?{...W,status:U}:W)),r?.(S.id,{status:U}),M(null))},P=U=>{let J={...U,id:Date.now().toString(),createdAt:new Date};d(W=>[...W,J]),s?.(U)},X=async(U,J)=>{d(W=>W.map(q=>q.id===U?{...q,...J}:q)),r&&await r(U,J)},fe=async U=>{d(J=>J.filter(W=>W.id!==U)),x?.id===U&&k(null),n&&await n(U)},_=U=>{let J={...U,id:Date.now().toString(),isSelected:!0};u(W=>[...W,J]),l?.(U)},de=U=>{k(U),i?.(U)};return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsx)(Lt,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-Co-r from-purple-600 via-violet-600 Co-indigo-600",primaryAction:{label:"Add task",onClick:()=>b(!0)},secondaryAction:{label:"Add epic",onClick:()=>T(!0)}}),(0,Co.jsx)("div",{className:"flex-1",children:(0,Co.jsxs)("div",{className:"w-full",children:[(0,Co.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[{id:"todo",title:"Co Co",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}].map(U=>{let J=R(U.status),W=$(J);return(0,Co.jsx)(Ev,{title:U.title,status:U.status,taskCount:J.length,onDrop:I,isCompact:U.status==="done",children:K.map(q=>{let Qe=p.find(Pe=>Pe.id===q),L=W[q]||[];return L.length===0?null:(0,Co.jsxs)("div",{className:"mb-6",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Co.jsx)("div",{className:`w-3 h-3 rounded-full ${Qe?.color}`}),(0,Co.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Qe?.name}),(0,Co.jsx)(Z,{variant:"secondary",className:"text-Nu",children:L.length})]})," ",(0,Co.jsx)("div",{className:"space-y-3",children:L.map(Pe=>(0,Co.jsx)(Yd,{task:Pe,epic:Qe,onDragStart:w,onTaskClick:de,isCompact:U.status==="done"},Pe.id))})]},q)})},U.id)})}),(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(Jd,{isOpen:f,onClose:()=>b(!1),onAddTask:P,epics:p,sprints:g}),(0,Co.jsx)(ec,{isOpen:C,onClose:()=>T(!1),onAddEpic:_}),x&&(0,Co.jsx)(Zd,{isOpen:!!x,onClose:()=>k(null),task:x,epics:p,sprints:g,onUpdateTask:X,onDeleteTask:fe})]})]})})]})};var Ov=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:s,onAddTaskToEpic:r,onAddEpic:n,onUpdateEpic:i,onDeleteEpic:l})=>{let[c,d]=(0,Zp.useState)(null),[p,u]=(0,Zp.useState)(null),[g,h]=(0,Zp.useState)({}),f=D=>{d(D)},b=D=>{D.preventDefault()},C=(D,R)=>{D.preventDefault(),c&&c.epicId!==R&&(o(c.id,{epicId:R}),d(null))},T=D=>e.filter(R=>R.epicId===D),x=D=>{u(D.id),h({name:D.name,description:D.description,confidence:D.confidence,phase:D.phase,progress:D.progress})},k=()=>{p&&g.name&&(i(p,g),u(null),h({}))},S=()=>{u(null),h({})},M=D=>{window.confirm("Are you sure you want Co delete this epic? This will also delete all associated tasks.")&&l(D)},K=D=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[D]||`Phase ${D}`,A=D=>{switch(D){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsx)(Lt,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-Co-r from-rose-600 via-pink-600 Co-fuchsia-600",primaryAction:{label:"Add epic",onClick:n}}),(0,Co.jsx)("div",{className:"flex-1",children:(0,Co.jsx)("div",{className:"w-full",children:(0,Co.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:t.map(D=>{let R=T(D.id),$=R.reduce((w,I)=>w+I.points,0);return(0,Co.jsxs)(j,{className:`flex flex-col ${p===D.id?"h-auto":"h-[600px]"} bg-card shadow-sm`,onDragOver:b,onDrop:w=>C(w,D.id),children:[(0,Co.jsx)("div",{className:"p-4 border-b border-border",children:p===D.id?(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)(G,{value:g.name||"",onChange:w=>h({...g,name:w.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Co.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:k,className:"p-1 h-8 w-8",children:(0,Co.jsx)(Nu.Check,{className:"h-4 w-4"})}),(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:S,className:"p-1 h-8 w-8",children:(0,Co.jsx)(Nu.X,{className:"h-4 w-4"})})]})]}),(0,Co.jsx)(st,{value:g.description||"",onChange:w=>h({...g,description:w.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)("label",{className:"text-Nu text-muted-foreground",children:"Confidence"}),(0,Co.jsxs)(Le,{value:g.confidence||D.confidence,onValueChange:w=>h({...g,confidence:w}),children:[(0,Co.jsx)(Ae,{className:"text-Nu",children:(0,Co.jsx)(We,{})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"low",children:"Low"}),(0,Co.jsx)(Q,{value:"medium",children:"Medium"}),(0,Co.jsx)(Q,{value:"high",children:"High"})]})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("label",{className:"text-Nu text-muted-foreground",children:"Phase"}),(0,Co.jsxs)(Le,{value:g.phase?.toString()||D.phase.toString(),onValueChange:w=>h({...g,phase:parseInt(w)}),children:[(0,Co.jsx)(Ae,{className:"text-Nu",children:(0,Co.jsx)(We,{})}),(0,Co.jsx)(Ie,{children:[1,2,3,4,5,6,7,8,9].map(w=>(0,Co.jsxs)(Q,{value:w.toString(),children:["Phase ",w]},w))})]})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("label",{className:"text-Nu text-muted-foreground",children:"Progress (%)"}),(0,Co.jsx)(G,{type:"number",min:"0",max:"100",value:g.progress||D.progress,onChange:w=>h({...g,progress:parseInt(w.target.value)||0}),className:"text-Nu"})]})]}):(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Co.jsx)("div",{className:`w-4 h-4 rounded-full ${D.color}`}),(0,Co.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:D.name}),(0,Co.jsxs)("div",{className:"flex gap-1",children:[(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>x(D),className:"p-1 h-8 w-8",children:(0,Co.jsx)(Nu.Edit2,{className:"h-3 w-3"})}),(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>M(D.id),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Co.jsx)(Nu.Trash2,{className:"h-3 w-3"})})]})]}),(0,Co.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Co.jsxs)(Z,{className:`text-Nu ${A(D.confidence)}`,children:[D.confidence," confidence"]}),(0,Co.jsxs)(Z,{variant:"outline",className:"text-Nu",children:["Phase ",D.phase]}),(0,Co.jsxs)(Z,{variant:"secondary",className:"text-Nu bg-muted text-muted-foreground",children:[R.length," tasks"]}),(0,Co.jsxs)(Z,{variant:"secondary",className:"text-Nu bg-muted text-muted-foreground",children:[$," pts"]})]}),D.description&&(0,Co.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:D.description}),(0,Co.jsxs)("div",{className:"mb-3",children:[(0,Co.jsxs)("div",{className:"flex justify-between text-Nu text-muted-foreground mb-1",children:[(0,Co.jsx)("span",{className:"select-none",children:"Progress"}),(0,Co.jsxs)("span",{className:"select-none",children:[D.progress,"%"]})]}),(0,Co.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,Co.jsx)("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:`${D.progress}%`}})})]}),(0,Co.jsxs)(y,{onClick:()=>r(D.id),variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Co.jsx)(Nu.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Co.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Co.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${c?"border-primary bg-primary/10":"border-border"}`,children:R.length===0?(0,Co.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-muted-foreground border-2 border-dashed border-border rounded-lg",children:[(0,Co.jsx)(Nu.Move,{className:"h-8 w-8 mb-2"}),(0,Co.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):R.map(w=>(0,Co.jsx)(Yd,{task:w,epic:D,onDragStart:f,onTaskClick:s,isCompact:!0},w.id))})})]},D.id)})})})})]})};var $Co=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,s]=(0,Zp.useState)({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),r=i=>{i.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate,endDate:o.endDate,isActive:o.isActive,isSelected:!1}),s({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),t())},n=()=>{s({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),t()};return(0,Co.jsx)(Bt,{open:e,onOpenChange:n,children:(0,Co.jsxs)(Dt,{className:"sm:max-w-md",children:[(0,Co.jsx)(Ft,{children:(0,Co.jsx)(zt,{children:"Add New Sprint"})}),(0,Co.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"name",children:"Sprint Name *"}),(0,Co.jsx)(G,{id:"name",value:o.name,onChange:i=>s(l=>({...l,name:i.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"description",children:"Description"}),(0,Co.jsx)(st,{id:"description",value:o.description,onChange:i=>s(l=>({...l,description:i.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Start Date *"}),(0,Co.jsxs)(ns,{children:[(0,Co.jsx)(ls,{asChild:!0,children:(0,Co.jsxs)(y,{variant:"outline",className:m("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,Co.jsx)(Nu.CalendarIcon,{className:"Co-2 h-4 w-4"}),o.startDate?(0,Jm.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,Co.jsx)(Ir,{className:"w-auto p-0",align:"start",children:(0,Co.jsx)(ms,{mode:"single",selected:o.startDate,onSelect:i=>s(l=>({...l,startDate:i})),initialFocus:!0})})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"End Date *"}),(0,Co.jsxs)(ns,{children:[(0,Co.jsx)(ls,{asChild:!0,children:(0,Co.jsxs)(y,{variant:"outline",className:m("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,Co.jsx)(Nu.CalendarIcon,{className:"Co-2 h-4 w-4"}),o.endDate?(0,Jm.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,Co.jsx)(Ir,{className:"w-auto p-0",align:"start",children:(0,Co.jsx)(ms,{mode:"single",selected:o.endDate,onSelect:i=>s(l=>({...l,endDate:i})),initialFocus:!0,disabled:i=>o.startDate?i<o.startDate:!1})})]})]})]}),(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)("input",{type:"checkbox",id:"isActive",checked:o.isActive,onChange:i=>s(l=>({...l,isActive:i.target.checked})),className:"rounded border-gray-300"}),(0,Co.jsx)(B,{htmlFor:"isActive",children:"Set as active sprint"})]}),(0,Co.jsxs)("div",{className:"flex justify-end gap-3 Co-4",children:[(0,Co.jsx)(y,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),(0,Co.jsx)(y,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Vv=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:s,onAddSprint:r})=>{let[n,i]=(0,Zp.useState)(["2"]),[l,c]=(0,Zp.useState)(null),[d,p]=(0,Zp.useState)(!1),[u,g]=(0,Zp.useState)(null),h=e.filter(I=>!I.sprintId),f=e.filter(I=>I.sprintId&&n.includes(I.sprintId)),b=[...a].filter(I=>I.id!=="backlog"&&I.id!=="all-tasks").sort((I,P)=>I.startDate.getTime()-P.startDate.getTime()),C=I=>t.find(P=>P.id===I),T=I=>a.find(P=>P.id===I),x=I=>{switch(I){case"high":return"bg-destructive/20 text-destructive";case"medium":return"bg-warning/20 text-warning";case"low":return"bg-success/20 text-success";default:return"bg-muted text-muted-foreground"}},k=I=>I.split(" ").map(P=>P[0]).join("").toUpperCase(),S=I=>{c(I)},M=I=>{I.preventDefault()},K=I=>{g(I)},A=()=>{g(null)},D=(I,P)=>{I.preventDefault(),g(null),l&&(o(l.id,{sprintId:P==="backlog"?void 0:P}),c(null))},R=I=>{I==="backlog"||I==="all-tasks"||i(P=>P.includes(I)?P.filter(X=>X!==I):[...P,I])},$=I=>{r(I),p(!1)},w=({task:I,showSprint:P=!1})=>{let X=C(I.epicId),fe=I.sprintId?T(I.sprintId):null,[_,de]=(0,Zp.useState)(!1),Te=W=>{W.defaultPrevented||_||s(I)},U=W=>{de(!0),S(I)},J=()=>{de(!1)};return(0,Co.jsx)(j,{className:`p-3 cursor-grab transition-all duration-200 hover:shadow-md bg-card border-border hover:border-border/80 active:cursor-grabbing ${_?"opacity-50 shadow-lg scale-105":""} ${l?.id===I.id?"ring-2 ring-primary":""}`,draggable:!0,onDragStart:U,onDragEnd:J,onClick:Te,children:(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Co.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1 select-none pointer-events-none",children:I.title}),(0,Co.jsx)(Z,{className:`text-Nu select-none pointer-events-none ${x(I.priority)}`,children:I.priority[0].toUpperCase()})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-Nu pointer-events-none",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-1",children:[X&&(0,Co.jsx)("div",{className:`w-2 h-2 rounded-full ${X.color}`}),(0,Co.jsx)("span",{className:"text-muted-foreground truncate select-none",children:X?.name})]}),(0,Co.jsx)("span",{className:"text-muted-foreground select-none",children:k(I.assignee)})]}),P&&fe&&(0,Co.jsxs)("div",{className:"flex items-center gap-1 text-Nu text-muted-foreground pointer-events-none",children:[(0,Co.jsx)(Nu.Calendar,{className:"h-3 w-3"}),(0,Co.jsx)("span",{className:"select-none",children:fe.name})]})]})})};return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsx)(Lt,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-Co-r from-orange-600 via-amber-600 Co-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>p(!0)}}),(0,Co.jsx)("div",{className:"flex-1",children:(0,Co.jsxs)("div",{className:"w-full",children:[(0,Co.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:[(0,Co.jsx)("div",{className:"lg:col-span-1",children:(0,Co.jsxs)(j,{className:"p-4 h-full bg-card shadow-sm",onDragOver:M,onDragEnter:()=>K("backlog"),onDragLeave:A,onDrop:I=>D(I,"backlog"),children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,Co.jsx)("h3",{className:"font-semibold text-foreground select-none",children:"Backlog"}),(0,Co.jsx)(Z,{variant:"secondary",className:"bg-muted text-muted-foreground",children:h.length})]}),(0,Co.jsxs)("div",{className:`space-y-3 overflow-y-auto max-h-[600px] min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${u==="backlog"?"border-primary bg-primary/10":"border-border"}`,children:[h.map(I=>(0,Co.jsx)(w,{task:I},I.id)),h.length===0&&(0,Co.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here Co move Co backlog"})]})]})}),(0,Co.jsx)("div",{className:"lg:col-span-3",children:(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsxs)(j,{className:"p-4 bg-card shadow-sm",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Co.jsx)("h3",{className:"font-semibold text-foreground select-none",children:"Select Sprints Co View"}),(0,Co.jsxs)(y,{onClick:()=>p(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-2",size:"sm",children:[(0,Co.jsx)(Nu.Plus,{className:"h-4 w-4"}),"Add Sprint"]})]}),(0,Co.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2",children:b.map(I=>(0,Co.jsxs)(y,{variant:n.includes(I.id)?"default":"outline",size:"sm",onClick:()=>R(I.id),className:"text-Nu h-8",children:[I.name,I.isActive&&(0,Co.jsx)("span",{className:"ml-1 text-success",children:"\u25CF"})]},I.id))})]}),(0,Co.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:n.map(I=>b.find(P=>P.id===I)).filter(Boolean).sort((I,P)=>I.startDate.getTime()-P.startDate.getTime()).map(I=>{let P=f.filter(X=>X.sprintId===I.id);return(0,Co.jsxs)(j,{className:"p-4 bg-card shadow-sm",onDragOver:M,onDragEnter:()=>K(I.id),onDragLeave:A,onDrop:X=>D(X,I.id),children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h3",{className:"font-semibold text-foreground select-none",children:I.name}),I.isActive&&(0,Co.jsx)("span",{className:"text-Nu text-success font-medium select-none",children:"Active Sprint"})]}),(0,Co.jsx)(Z,{variant:"secondary",className:"bg-muted text-muted-foreground",children:P.length})]}),(0,Co.jsxs)("div",{className:`space-y-3 overflow-y-auto max-h-[500px] min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${u===I.id?"border-primary bg-primary/10":"border-border"}`,children:[P.map(X=>(0,Co.jsx)(w,{task:X},X.id)),P.length===0&&(0,Co.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})]},I.id)})})," "]})})]}),(0,Co.jsx)($Co,{isOpen:d,onClose:()=>p(!1),onAddSprint:$})]})})]})};var My=e=>{switch(e){case"high":return"\u{1F534}";case"medium":return"\u{1F7E1}";case"low":return"\u{1F7E2}";default:return"\u26AA"}},By=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),Ly=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},Dp=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[s,r]=t.split(":");o.setHours(parseInt(s),parseInt(r))}return o<a},Tp=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Ey=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Fy=({colleagues:e,onAddReminder:t,trigger:a})=>{let[o,s]=(0,Zp.useState)(!1),[r,n]=(0,Zp.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""});return(0,Co.jsxs)(Bt,{open:o,onOpenChange:s,children:[(0,Co.jsx)(xl,{asChild:!0,children:a}),(0,Co.jsxs)(Dt,{className:"max-w-2xl",children:[(0,Co.jsx)(Ft,{children:(0,Co.jsx)(zt,{children:"Add New Reminder"})}),(0,Co.jsxs)("form",{onSubmit:l=>{l.preventDefault();let c=e.find(p=>p.id===r.colleagueId);if(!c)return;let d={title:r.title,description:r.description,dueDate:new Date(r.dueDate),dueTime:r.dueTime||void 0,colleague:c,isCompleted:!1,isRecurring:r.isRecurring,recurrencePattern:r.isRecurring?r.recurrencePattern:void 0,recurrenceInterval:r.isRecurring?r.recurrenceInterval:void 0,priority:r.priority,reminderEnabled:r.reminderEnabled,reminderMinutes:r.reminderEnabled?r.reminderMinutes:void 0,tags:r.tags?r.tags.split(",").map(p=>p.trim()):void 0};t(d),s(!1),n({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})},className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"title",children:"Title"}),(0,Co.jsx)(G,{id:"title",value:r.title,onChange:l=>n({...r,title:l.target.value}),placeholder:"Enter reminder title",required:!0})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"priority",children:"Priority"}),(0,Co.jsxs)(Le,{value:r.priority,onValueChange:l=>n({...r,priority:l}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"low",children:"\u{1F7E2} Low"}),(0,Co.jsx)(Q,{value:"medium",children:"\u{1F7E1} Medium"}),(0,Co.jsx)(Q,{value:"high",children:"\u{1F534} High"})]})]})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"description",children:"Description"}),(0,Co.jsx)(st,{id:"description",value:r.description,onChange:l=>n({...r,description:l.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"dueDate",children:"Due Date"}),(0,Co.jsx)(G,{id:"dueDate",type:"date",value:r.dueDate,onChange:l=>n({...r,dueDate:l.target.value}),required:!0})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Co.jsx)(G,{id:"dueTime",type:"time",value:r.dueTime,onChange:l=>n({...r,dueTime:l.target.value})})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"colleague",children:"Assigned Colleague"}),(0,Co.jsxs)(Le,{value:r.colleagueId,onValueChange:l=>n({...r,colleagueId:l}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select a digital colleague"})}),(0,Co.jsx)(Ie,{children:e.map(l=>(0,Co.jsx)(Q,{value:l.id,children:l.name},l.id))})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:l=>n({...r,isRecurring:l.target.checked}),className:"rounded border-border"}),(0,Co.jsx)(B,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Co.jsxs)(Le,{value:r.recurrencePattern,onValueChange:l=>n({...r,recurrencePattern:l}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"daily",children:"Daily"}),(0,Co.jsx)(Q,{value:"weekly",children:"Weekly"}),(0,Co.jsx)(Q,{value:"monthly",children:"Monthly"}),(0,Co.jsx)(Q,{value:"yearly",children:"Yearly"})]})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Co.jsx)(G,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:l=>n({...r,recurrenceInterval:parseInt(l.target.value)})})]})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)("input",{type:"checkbox",id:"reminderEnabled",checked:r.reminderEnabled,onChange:l=>n({...r,reminderEnabled:l.target.checked}),className:"rounded border-border"}),(0,Co.jsx)(B,{htmlFor:"reminderEnabled",children:"Enable reminder notifications"})]}),r.reminderEnabled&&(0,Co.jsxs)("div",{className:"pl-6",children:[(0,Co.jsx)(B,{htmlFor:"reminderMinutes",children:"Remind Co"}),(0,Co.jsxs)(Le,{value:r.reminderMinutes.toString(),onValueChange:l=>n({...r,reminderMinutes:parseInt(l)}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"5",children:"5 minutes before"}),(0,Co.jsx)(Q,{value:"15",children:"15 minutes before"}),(0,Co.jsx)(Q,{value:"30",children:"30 minutes before"}),(0,Co.jsx)(Q,{value:"60",children:"1 hour before"}),(0,Co.jsx)(Q,{value:"1440",children:"1 day before"})]})]})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"tags",children:"Tags (comma-separated)"}),(0,Co.jsx)(G,{id:"tags",value:r.tags,onChange:l=>n({...r,tags:l.target.value}),placeholder:"e.g., urgent, meeting, follow-up"})]}),(0,Co.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Co.jsx)(y,{type:"button",variant:"outline",onClick:()=>s(!1),children:"Cancel"}),(0,Co.jsx)(y,{type:"submit",children:"Add Reminder"})]})]})]})]})},zy=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:s})=>{let[r,n]=(0,Zp.useState)({title:e.title,description:e.description,dueDate:e.dueDate.toISOString().split("T")[0],dueTime:e.dueTime||"",colleagueId:e.colleague.id,priority:e.priority,isRecurring:e.isRecurring,recurrencePattern:e.recurrencePattern||"weekly",recurrenceInterval:e.recurrenceInterval||1,reminderEnabled:e.reminderEnabled,reminderMinutes:e.reminderMinutes||15,tags:e.tags?.join(", ")||""});return(0,Co.jsx)(Bt,{open:o,onOpenChange:s,children:(0,Co.jsxs)(Dt,{className:"max-w-2xl",children:[(0,Co.jsx)(Ft,{children:(0,Co.jsx)(zt,{children:"Edit Reminder"})}),(0,Co.jsxs)("form",{onSubmit:l=>{l.preventDefault();let c=t.find(p=>p.id===r.colleagueId);if(!c)return;let d={title:r.title,description:r.description,dueDate:new Date(r.dueDate),dueTime:r.dueTime||void 0,colleague:c,isRecurring:r.isRecurring,recurrencePattern:r.isRecurring?r.recurrencePattern:void 0,recurrenceInterval:r.isRecurring?r.recurrenceInterval:void 0,priority:r.priority,reminderEnabled:r.reminderEnabled,reminderMinutes:r.reminderEnabled?r.reminderMinutes:void 0,tags:r.tags?r.tags.split(",").map(p=>p.trim()):void 0};a(e.id,d),s()},className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-title",children:"Title"}),(0,Co.jsx)(G,{id:"edit-title",value:r.title,onChange:l=>n({...r,title:l.target.value}),placeholder:"Enter reminder title",required:!0})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-priority",children:"Priority"}),(0,Co.jsxs)(Le,{value:r.priority,onValueChange:l=>n({...r,priority:l}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"low",children:"\u{1F7E2} Low"}),(0,Co.jsx)(Q,{value:"medium",children:"\u{1F7E1} Medium"}),(0,Co.jsx)(Q,{value:"high",children:"\u{1F534} High"})]})]})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-description",children:"Description"}),(0,Co.jsx)(st,{id:"edit-description",value:r.description,onChange:l=>n({...r,description:l.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Co.jsx)(G,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:l=>n({...r,dueDate:l.target.value}),required:!0})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Co.jsx)(G,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:l=>n({...r,dueTime:l.target.value})})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-colleague",children:"Assigned Colleague"}),(0,Co.jsxs)(Le,{value:r.colleagueId,onValueChange:l=>n({...r,colleagueId:l}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select a digital colleague"})}),(0,Co.jsx)(Ie,{children:t.map(l=>(0,Co.jsx)(Q,{value:l.id,children:l.name},l.id))})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring,onChange:l=>n({...r,isRecurring:l.target.checked}),className:"rounded border-border"}),(0,Co.jsx)(B,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-recurrencePattern",children:"Frequency"}),(0,Co.jsxs)(Le,{value:r.recurrencePattern,onValueChange:l=>n({...r,recurrencePattern:l}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"daily",children:"Daily"}),(0,Co.jsx)(Q,{value:"weekly",children:"Weekly"}),(0,Co.jsx)(Q,{value:"monthly",children:"Monthly"}),(0,Co.jsx)(Q,{value:"yearly",children:"Yearly"})]})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-recurrenceInterval",children:"Every"}),(0,Co.jsx)(G,{id:"edit-recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:l=>n({...r,recurrenceInterval:parseInt(l.target.value)})})]})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)("input",{type:"checkbox",id:"edit-reminderEnabled",checked:r.reminderEnabled,onChange:l=>n({...r,reminderEnabled:l.target.checked}),className:"rounded border-border"}),(0,Co.jsx)(B,{htmlFor:"edit-reminderEnabled",children:"Enable reminder notifications"})]}),r.reminderEnabled&&(0,Co.jsxs)("div",{className:"pl-6",children:[(0,Co.jsx)(B,{htmlFor:"edit-reminderMinutes",children:"Remind Co"}),(0,Co.jsxs)(Le,{value:r.reminderMinutes.toString(),onValueChange:l=>n({...r,reminderMinutes:parseInt(l)}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"5",children:"5 minutes before"}),(0,Co.jsx)(Q,{value:"15",children:"15 minutes before"}),(0,Co.jsx)(Q,{value:"30",children:"30 minutes before"}),(0,Co.jsx)(Q,{value:"60",children:"1 hour before"}),(0,Co.jsx)(Q,{value:"1440",children:"1 day before"})]})]})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-tags",children:"Tags (comma-separated)"}),(0,Co.jsx)(G,{id:"edit-tags",value:r.tags,onChange:l=>n({...r,tags:l.target.value}),placeholder:"e.g., urgent, meeting, follow-up"})]}),(0,Co.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Co.jsx)(y,{type:"button",variant:"outline",onClick:s,children:"Cancel"}),(0,Co.jsx)(y,{type:"submit",children:"Save Changes"})]})]})]})})},jy=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[s,r]=(0,Zp.useState)(!1),n=Dp(e.dueDate,e.dueTime),i=Tp(e.dueDate),l=Ey(e.dueDate),c=()=>{a(e.id,{isCompleted:!e.isCompleted,completedAt:e.isCompleted?void 0:new Date})},d=()=>i?"Today":l?"Tomorrow":n&&!e.isCompleted?"Overdue":By(e.dueDate);return(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(zy,{reminder:e,colleagues:t,onUpdateReminder:a,open:s,onClose:()=>r(!1)}),(0,Co.jsx)(j,{className:`transition-all duration-200 ${e.isCompleted?"opacity-60":""} ${n&&!e.isCompleted?"border-destructive/50 bg-destructive/5":""}`,children:(0,Co.jsx)(ae,{className:"p-4",children:(0,Co.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Co.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Co.jsx)("button",{onClick:c,className:"Nu-1 text-primary hover:text-primary/80",children:e.isCompleted?(0,Co.jsx)(Nu.CheckCircle,{className:"h-5 w-5"}):(0,Co.jsx)(Nu.Circle,{className:"h-5 w-5"})}),(0,Co.jsxs)("div",{className:"flex-1",children:[(0,Co.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,Co.jsx)("h3",{className:`font-semibold ${e.isCompleted?"line-through text-muted-foreground":""}`,children:e.title}),(0,Co.jsx)("span",{className:"text-sm",children:My(e.priority)}),e.isRecurring&&(0,Co.jsx)(Nu.Repeat,{className:"h-4 w-4 text-primary"}),e.reminderEnabled&&(0,Co.jsx)(Nu.Bell,{className:"h-4 w-4 text-success"})]}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Co.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Co.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Co.jsx)(Nu.Calendar,{className:"h-4 w-4"}),(0,Co.jsx)("span",{className:n&&!e.isCompleted?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,Co.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Co.jsx)(Nu.Clock,{className:"h-4 w-4"}),(0,Co.jsx)("span",{children:Ly(e.dueTime)})]}),(0,Co.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Co.jsx)(Nu.User,{className:"h-4 w-4"}),(0,Co.jsx)("span",{children:e.colleague.name})]})]}),e.tags&&e.tags.length>0&&(0,Co.jsx)("div",{className:"flex flex-wrap gap-1 Nu-2",children:e.tags.map((p,u)=>(0,Co.jsx)(Z,{variant:"secondary",className:"text-Nu",children:p},u))})]})]}),(0,Co.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 p-0",children:(0,Co.jsx)(Nu.Edit2,{className:"h-4 w-4"})}),(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>o(e.id),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Co.jsx)(Nu.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Gv=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:s})=>{let[r,n]=(0,Zp.useState)(e),[i]=(0,Zp.useState)(t),[l,c]=(0,Zp.useState)("all"),[d,p]=(0,Zp.useState)(""),u=T=>{let x={...T,id:Date.now().toString(),createdAt:new Date};n(k=>[...k,x]),a?.(T)},g=(T,x)=>{n(k=>k.map(S=>S.id===T?{...S,...x}:S)),o?.(T,x)},h=T=>{n(x=>x.filter(k=>k.id!==T)),s?.(T)},b=r.filter(T=>{if(d){let x=d.toLowerCase();if(!(T.title.toLowerCase().includes(x)||T.description.toLowerCase().includes(x)||T.colleague.name.toLowerCase().includes(x)||T.tags?.some(S=>S.toLowerCase().includes(x))))return!1}switch(l){case"pending":return!T.isCompleted;case"completed":return T.isCompleted;case"overdue":return!T.isCompleted&&Dp(T.dueDate,T.dueTime);case"today":return Tp(T.dueDate);default:return!0}}).sort((T,x)=>{if(T.isCompleted&&!x.isCompleted)return 1;if(!T.isCompleted&&x.isCompleted)return-1;let k={high:3,medium:2,low:1},S=k[x.priority]-k[T.priority];return S!==0?S:T.dueDate.getTime()-x.dueDate.getTime()}),C={total:r.length,pending:r.filter(T=>!T.isCompleted).length,completed:r.filter(T=>T.isCompleted).length,overdue:r.filter(T=>!T.isCompleted&&Dp(T.dueDate,T.dueTime)).length,today:r.filter(T=>Tp(T.dueDate)).length};return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsx)(Lt,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-Co-r from-emerald-600 via-teal-600 Co-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{let T={title:"New Reminder",description:"Don't forget Co complete this task",dueDate:new Date,dueTime:"09:00",colleague:i[0]||{id:"1",name:"Default Colleague",department:"General",role:"Team Member"},isCompleted:!1,isRecurring:!1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,tags:["reminder"]};u(T)}}}),(0,Co.jsx)("div",{className:"h-full bg-background",children:(0,Co.jsxs)("div",{className:"p-6",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Co.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Co.jsx)(Fy,{colleagues:i,onAddReminder:u,trigger:(0,Co.jsxs)(y,{className:"flex items-center space-x-2",children:[(0,Co.jsx)(Nu.Plus,{className:"h-4 w-4"}),(0,Co.jsx)("span",{children:"Add Reminder"})]})})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Co.jsxs)(j,{className:"p-4",children:[(0,Co.jsx)("div",{className:"text-2xl font-bold text-foreground",children:C.total}),(0,Co.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Co.jsxs)(j,{className:"p-4",children:[(0,Co.jsx)("div",{className:"text-2xl font-bold text-primary",children:C.pending}),(0,Co.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Co.jsxs)(j,{className:"p-4",children:[(0,Co.jsx)("div",{className:"text-2xl font-bold text-success",children:C.completed}),(0,Co.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Co.jsxs)(j,{className:"p-4",children:[(0,Co.jsx)("div",{className:"text-2xl font-bold text-destructive",children:C.overdue}),(0,Co.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Co.jsxs)(j,{className:"p-4",children:[(0,Co.jsx)("div",{className:"text-2xl font-bold text-warning",children:C.today}),(0,Co.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Co.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Co.jsx)("div",{className:"flex-1",children:(0,Co.jsx)(G,{placeholder:"Search reminders...",value:d,onChange:T=>p(T.target.value),className:"max-w-md"})}),(0,Co.jsxs)(Le,{value:l,onValueChange:T=>c(T),children:[(0,Co.jsx)(Ae,{className:"w-40",children:(0,Co.jsx)(We,{})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsxs)(Q,{value:"all",children:["All (",C.total,")"]}),(0,Co.jsxs)(Q,{value:"pending",children:["Pending (",C.pending,")"]}),(0,Co.jsxs)(Q,{value:"completed",children:["Completed (",C.completed,")"]}),(0,Co.jsxs)(Q,{value:"overdue",children:["Overdue (",C.overdue,")"]}),(0,Co.jsxs)(Q,{value:"today",children:["Today (",C.today,")"]})]})]})]}),(0,Co.jsx)("div",{className:"space-y-4",children:b.length===0?(0,Co.jsxs)(j,{className:"p-8 text-center",children:[(0,Co.jsx)("div",{className:"text-muted-foreground",children:d||l!=="all"?"Nu reminders match your filters":"Nu reminders yet"}),!d&&l==="all"&&(0,Co.jsx)("p",{className:"text-sm text-muted-foreground/60 Nu-2",children:"Create your first reminder Co get started"})]}):b.map(T=>(0,Co.jsx)(jy,{reminder:T,colleagues:i,onUpdateReminder:g,onDeleteReminder:h},T.id))})]})})]})};function Rp({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:s=[],initialReminders:r=[],initialColleagues:n=[],initialFiles:i=[],onAddTask:l,onUpdateTask:c,onDeleteTask:d,onTaskClick:p,onAddEpic:u,onUpdateEpic:g,onDeleteEpic:h,onAddTaskToEpic:f,onAddSprint:b,onUpdateSprint:C,onDeleteSprint:T,onAddProject:x,onUpdateProject:k,onDeleteProject:S,onFileAdd:M,onFileEdit:K,onFileDelete:A,onFileClick:D,onAddReminder:R,onUpdateReminder:$,onDeleteReminder:w,onViewChange:I,onToggleMobileMenu:P,onTeamClick:X,onTeamChange:fe,onCopilotClick:_}){let[de,Te]=(0,Zp.useState)(t),[U,J]=(0,Zp.useState)(a),[W,q]=(0,Zp.useState)(o),[Qe,L]=(0,Zp.useState)(s),[Pe,Ye]=(0,Zp.useState)(r),[ta,Aa]=(0,Zp.useState)(n),[La,ht]=(0,Zp.useState)(i),[lt,ra]=(0,Zp.useState)(!1),[Ka,yr]=(0,Zp.useState)(!1),[Yr,Is]=(0,Zp.useState)(null),[en,Et]=(0,Zp.useState)(null),[Wa,E]=(0,Zp.useState)(null),[Y,Ze]=(0,Zp.useState)("kanban"),[nc,lc]=(0,Zp.useState)(!1),ci=(0,zg.useRouter)(),fb=U.filter(O=>O.isSelected).map(O=>O.id),rl=W.find(O=>O.isSelected),vb=de.filter(O=>{let re=fb.includes(O.epicId);return!rl||rl.id==="all-tasks"?re:rl.id==="backlog"?re&&!O.sprintId:re&&O.sprintId===rl.id}),rx=O=>vb.filter(re=>re.status===O),sx=O=>{let re={};return U.forEach(Be=>{re[Be.id]=O.filter(Mt=>Mt.epicId===Be.id)}),re},ix=O=>{E(O)},nx=O=>{Wa&&(Te(re=>re.map(Be=>Be.id===Wa.id?{...Be,status:O}:Be)),E(null))},zp=O=>{let re={...O,id:Date.now().toString(),createdAt:new Date};Te(Be=>[...Be,re]),c?.(re.id,re)},sl=(O,re)=>{Te(Be=>Be.map(Mt=>Mt.id===O?{...Mt,...re}:Mt)),c?.(O,re)},bb=async(O,re)=>{sl(O,re)},jp=O=>{Te(re=>re.filter(Be=>Be.id!==O)),Yr?.id===O&&Is(null)},hb=async O=>{jp(O)},yb=O=>{let re={...O,id:Date.now().toString(),isSelected:!1};L(Be=>[...Be,re]),x?.(O)},xb=(O,re)=>{L(Be=>Be.map(Mt=>Mt.id===O?re.isSelected?(ci.push(`/kanban/${O}`),{...Mt,...re}):{...Mt,...re}:re.isSelected&&O!==Mt.id?{...Mt,isSelected:!1}:Mt)),k?.(O,re)},Nb=O=>{L(re=>re.filter(Be=>Be.id!==O)),S?.(O)},wb=O=>{let re={...O,id:Date.now().toString(),isSelected:!0};J(Be=>[...Be,re])},dc=()=>{yr(!0)},Hp=(O,re)=>{J(Be=>Be.map(Mt=>Mt.id===O?{...Mt,...re}:Mt)),g?.(O,re)},Op=O=>{J(re=>re.filter(Be=>Be.id!==O)),Te(re=>re.filter(Be=>Be.epicId!==O)),h?.(O)},Up=O=>{let re={...O,id:Date.now().toString(),isSelected:!1};q(Be=>[...Be,re]),b?.(O)},Cb=(O,re)=>{q(Be=>Be.map(Mt=>Mt.id===O?re.isSelected?{...Mt,...re}:{...Mt,...re}:re.isSelected&&O!==Mt.id?{...Mt,isSelected:!1}:Mt)),C?.(O,re)},kb=O=>{O==="backlog"||O==="all-tasks"||(q(re=>re.filter(Be=>Be.id!==O)),Te(re=>re.map(Be=>Be.sprintId===O?{...Be,sprintId:void 0}:Be)),T?.(O))},cc=O=>{Is(O)},Sb=O=>{O==="planning"&&window.innerWidth<768||Ze(O)},Pb=()=>{lc(O=>!O),P?.()},lx=()=>{ci.push("/")},dx=O=>{console.log("Switching Co team:",O)},cx=O=>{console.log("Switching Co team:",O)},Db=O=>{Et(O),ra(!0)},Tb=()=>{ra(!1),Et(null)},Rb=O=>{let re={...O,id:Date.now().toString(),createdAt:new Date};Ye(Be=>[...Be,re]),R?.(O)},Ab=(O,re)=>{Ye(Be=>Be.map(Mt=>Mt.id===O?{...Mt,...re}:Mt)),$?.(O,re)},Ib=O=>{Ye(re=>re.filter(Be=>Be.id!==O)),w?.(O)},Mb=O=>{ht(re=>[...re,O]),M?.(O)},Bb=O=>{K?.(O)},Lb=O=>{ht(re=>re.filter(Be=>Be.name!==O)),A?.(O)},Eb=O=>{D?.(O)},mx=[{id:"todo",title:"Co Co",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],px=()=>{switch(Y){case"kanban":return"Project Board";case"planning":return"Sprint Planning";case"tasks":return"Task Reminders";case"files":return"Documentation";case"epics":return"Epic Planning";default:return"Project Board"}},mc=[{id:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{id:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{id:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{id:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{id:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{id:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],ux=mc.sort((O,re)=>re.lastUsed.getTime()-O.lastUsed.getTime()).slice(0,3),gx=mc.length>3,fx=mc.slice(3);return(0,Co.jsxs)(Fd,{projects:Qe,epics:U,sprints:W,currentView:Y,onUpdateProject:xb,onDeleteProject:Nb,onAddProject:yb,onUpdateEpic:Hp,onDeleteEpic:Op,onAddEpic:dc,onAddSprint:Up,onUpdateSprint:Cb,onDeleteSprint:kb,onViewChange:Sb,mobileMenuOpen:nc,onToggleMobileMenu:Pb,children:[Y==="kanban"&&(0,Co.jsx)("div",{className:"h-full",children:(0,Co.jsx)(Hv,{initialProjects:Qe,initialEpics:U,initialSprints:W,initialTasks:de,onAddTask:zp,onUpdateTask:sl,onDeleteTask:jp,onTaskClick:cc,onAddEpic:dc})}),Y==="planning"&&(0,Co.jsx)("div",{className:"hidden md:block h-full",children:(0,Co.jsx)(Vv,{tasks:de,epics:U,sprints:W,onUpdateTask:sl,onTaskClick:cc,onAddSprint:Up})}),Y==="tasks"&&(0,Co.jsx)("div",{className:"h-full",children:(0,Co.jsx)(Gv,{initialReminders:Pe,initialColleagues:ta,onAddReminder:Rb,onUpdateReminder:Ab,onDeleteReminder:Ib})}),Y==="files"&&(0,Co.jsx)("div",{className:"h-full",children:(0,Co.jsx)(el,{initialFiles:La,onFileAdd:Mb,onFileEdit:Bb,onFileDelete:Lb,onFileClick:Eb,compactView:!1})}),Y==="epics"&&(0,Co.jsx)("div",{className:"h-full",children:(0,Co.jsx)(Ov,{tasks:de,epics:U,sprints:W,onUpdateTask:sl,onTaskClick:cc,onAddTaskToEpic:Db,onAddEpic:dc,onUpdateEpic:Hp,onDeleteEpic:Op})}),(0,Co.jsx)(Jd,{isOpen:lt,onClose:Tb,onAddTask:zp,epics:U,sprints:W,defaultEpicId:en||void 0}),(0,Co.jsx)(ec,{isOpen:Ka,onClose:()=>yr(!1),onAddEpic:wb}),Yr&&(0,Co.jsx)(Zd,{isOpen:!!Yr,onClose:()=>Is(null),task:Yr,onUpdateTask:bb,onDeleteTask:hb,epics:U,sprints:W})]})}var Kv=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:s=""})=>{let[r,n]=(0,Zp.useState)({name:o?.name||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[i,l]=(0,Zp.useState)({}),c=()=>{let u={};return r.name.trim()?r.name.trim().length<3&&(u.name="Project name must be at least 3 characters"):u.name="Project name Co required",r.objectives.trim()?r.objectives.trim().length<10&&(u.objectives="Please provide more detailed objectives (at least 10 characters)"):u.objectives="Project objectives are required",r.workInstructions.trim()?r.workInstructions.trim().length<20&&(u.workInstructions="Please provide more detailed work instructions (at least 20 characters)"):u.workInstructions="Work instructions are required",l(u),Object.keys(u).length===0},d=async u=>{if(u.preventDefault(),!!c())try{await e(r)}catch(g){console.error("Error submitting project form:",g)}},p=(u,g)=>{n(h=>({...h,[u]:g})),i[u]&&l(h=>({...h,[u]:void 0}))};return(0,Co.jsxs)(j,{className:`w-full max-w-2xl ${s}`,children:[(0,Co.jsxs)(be,{children:[(0,Co.jsxs)(xe,{className:"flex items-center gap-2",children:[(0,Co.jsx)(Nu.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,Co.jsx)(Ko,{children:"Set up a new project with clear objectives and work instructions Co help your team collaborate effectively."})]}),(0,Co.jsxs)("form",{onSubmit:d,children:[(0,Co.jsxs)(ae,{className:"space-y-6",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,Co.jsx)(G,{id:"name",type:"text",placeholder:"Enter project name",value:r.name,onChange:u=>p("name",u.target.value),className:i.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),i.name&&(0,Co.jsx)("p",{className:"text-sm text-red-600",children:i.name})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,Co.jsx)(st,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:r.objectives,onChange:u=>p("objectives",u.target.value),className:`min-h-[100px] resize-y ${i.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,Co.jsxs)("div",{className:"flex justify-between text-Nu text-gray-500",children:[(0,Co.jsx)("span",{children:i.objectives&&(0,Co.jsx)("span",{className:"text-red-600",children:i.objectives})}),(0,Co.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,Co.jsx)(st,{id:"workInstructions",placeholder:"Provide detailed instructions on how the work should be carried out, including processes, standards, and expectations...",value:r.workInstructions,onChange:u=>p("workInstructions",u.target.value),className:`min-h-[120px] resize-y ${i.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,Co.jsxs)("div",{className:"flex justify-between text-Nu text-gray-500",children:[(0,Co.jsx)("span",{children:i.workInstructions&&(0,Co.jsx)("span",{className:"text-red-600",children:i.workInstructions})}),(0,Co.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,Co.jsxs)("div",{className:"space-y-3",children:[(0,Co.jsx)(B,{className:"text-sm font-medium",children:"Project Management"}),(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)(Qa,{id:"plan",checked:r.plan,onCheckedChange:u=>p("plan",u===!0),disabled:a}),(0,Co.jsx)(B,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,Co.jsx)("p",{className:"text-Nu text-gray-500 ml-6",children:"This will allow project managers Co create sprints, assign tasks, and track progress."})]})]}),(0,Co.jsxs)(vo,{className:"flex justify-end gap-3",children:[t&&(0,Co.jsxs)(y,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,Co.jsx)(Nu.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Co.jsx)(y,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(Nu.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(Nu.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function Mp({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[s,r]=(0,Zp.useState)(!1),[n,i]=(0,Zp.useState)(!1),l=async d=>{i(!0);try{await t(d),r(!1)}catch(p){console.error("Error creating project:",p)}finally{i(!1)}},c=()=>{r(!0)};return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Co.jsx)(Lt,{title:"Project Management",description:"Organise your work into projects Co collaborate with your team.",gradient:"bg-gradient-Co-r from-purple-600 via-violet-600 Co-indigo-600",primaryAction:{label:"New Project",onClick:c}}),(0,Co.jsxs)("section",{className:"space-y-4 Nu-8",children:[(0,Co.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Co.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(d=>(0,Co.jsx)(Ud,{project:d,onOpen:a,onShare:o},d.name))})]})]},"projects-index-view")}),(0,Co.jsx)(Bt,{open:s,onOpenChange:r,children:(0,Co.jsxs)(Dt,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Co.jsxs)(Ft,{className:"sr-only",children:[(0,Co.jsx)(zt,{children:"Create New Project"}),(0,Co.jsx)(Hs,{children:"Fill out the form below Co create a new project."})]}),(0,Co.jsx)(Kv,{onSubmit:l,onCancel:()=>r(!1),isLoading:n,className:"border-0 shadow-none"})]})})]})}function Xv({team:e,onOpen:t,className:a}){return(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,Co.jsxs)(j,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Co.jsxs)(be,{children:[(0,Co.jsx)(xe,{className:"text-lg",children:e.name}),(0,Co.jsx)(Ko,{className:"Nu-1 text-sm",children:e.description})]}),(0,Co.jsxs)(ae,{className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)(Nu.Users,{className:"h-4 w-4 text-blue-500"}),(0,Co.jsx)("span",{children:"Human"})]}),(0,Co.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)(Nu.Bot,{className:"h-4 w-4 text-purple-500"}),(0,Co.jsx)("span",{children:"Digital"})]}),(0,Co.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-sm border-t Co-4",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)(Nu.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,Co.jsx)("span",{children:"Projects"})]}),(0,Co.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,Co.jsx)(vo,{className:"flex gap-2",children:(0,Co.jsx)(y,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function Bp({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,s]=(0,Zp.useState)(!1),r=()=>{s(!0),t?.()},n=i=>{a?.(i)};return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Co.jsx)(Lt,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-Co-r from-blue-600 via-cyan-600 Co-teal-600",primaryAction:{label:"Create Team",onClick:r}}),(0,Co.jsxs)("section",{className:"space-y-4 Nu-8",children:[(0,Co.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,Co.jsxs)("div",{className:"text-center py-12",children:[(0,Co.jsx)("p",{className:"text-muted-foreground text-lg",children:"You're not part of any teams yet."}),(0,Co.jsx)("p",{className:"text-muted-foreground text-sm Nu-2",children:"Create a new team or ask Co be added Co an existing one."})]}):(0,Co.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(i=>(0,Co.jsx)(Xv,{team:i,onOpen:n},i.id))})]})]},"teams-index-view")}),(0,Co.jsx)(Bt,{open:o,onOpenChange:s,children:(0,Co.jsxs)(Dt,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Co.jsxs)(Ft,{children:[(0,Co.jsx)(zt,{children:"Create New Team"}),(0,Co.jsx)(Hs,{children:"Set up a new team Co collaborate with colleagues on projects."})]}),(0,Co.jsx)("div",{className:"p-6 text-center text-muted-foreground",children:(0,Co.jsx)("p",{children:"Team creation form coming soon..."})})]})})]})}var Zi=(e,t)=>e[t%e.length];function Hy({services:e,className:t,title:a,content:o}){let s={settings:{width:"full",card:"light"}};return(0,Co.jsxs)("div",{className:"pb-4 md:pb-0",children:[(0,Co.jsxs)("div",{className:m("w-full text-left prose"),children:[a&&(0,Co.jsx)("h2",{className:"text-primary",children:a}),(0,Co.jsx)("div",{className:"pb-12 ",children:o&&(0,Co.jsx)(it,{enableGutter:!1,content:o,enableProse:!1,className:m("prose prose-headings:text-foreground prose-p:text-foreground")})})]}),e&&e.length>0&&(0,Co.jsx)("div",{className:"-mx-4 flex flex-wrap justify-between gap-y-8",children:e.map((r,n)=>(0,Co.jsx)("div",{"data-aos":"fade-up","data-aos-delay":Zi([200,400,600],n),className:"w-full px-4 md:w-1/2 lg:w-1/3 flex",children:(0,Co.jsx)(Ci,{...s,icon:{type:"none"},title:r.title,image:r.image,content:r.content,link:r.link,className:"w-full"})},n))})]})}function Rs({subtitle:e,title:t,description:a,alignment:o="start",hasBottomSpacing:s=!1,className:r,invert:n=!1}){let i=m(o==="start"&&"text-left",o==="center"&&"text-center",o==="end"&&"text-right",{"mb-10 md:mb-[3.75rem]":s},"prose",r);return(0,Co.jsxs)("div",{className:i,children:[e&&(0,Co.jsx)("span",{className:"mb-[.625rem] block font-semibold uppercase text-accent md:text-md",children:e}),(0,Co.jsx)("h2",{className:m("text-primary Nu-0"),children:t}),typeof a=="string"?a&&(0,Co.jsx)("p",{className:"Nu-5 whitespace-pre-line text-foreground",children:a}):a&&(0,Co.jsx)(it,{content:a,enableGutter:!1,className:"prose-headings:text-accent prose-p:text-primary"})]})}function Oy({sectionHeading:e,cards:t}){return(0,Co.jsx)("section",{className:"section-padding-primary !Co-0",children:(0,Co.jsxs)(lo,{children:[(0,Co.jsx)("div",{className:"mx-auto max-w-[630px]","data-aos":"fade-up","data-aos-delay":"100",children:(0,Co.jsx)(Rs,{...e,alignment:"center",hasBottomSpacing:!0})}),t&&t.length>0&&(0,Co.jsx)("div",{className:"grid gap-30px",children:t.map((a,o)=>(0,Co.jsx)("div",{"data-aos":"fade-up","data-aos-delay":Zi([200,400,600],o),className:"py-2",children:(0,Co.jsx)(bm,{...a})},o))})]})})}var ol=H(require("next/image"));function Uy(e){let{images:t,sectionHeading:a,keyPoints:o,description:s}=e;return(0,Co.jsx)(Co.Fragment,{children:(0,Co.jsx)("section",{id:"about-section",className:m(" clip-custom-top-l sticky md:top-0 md:h-screen Co-2 flex flex-col items-center justify-center section-padding-primary dark bg-background",e.className||""),children:(0,Co.jsx)(lo,{children:(0,Co.jsxs)("div",{className:"grid items-center gap-12 lg:grid-cols-[.92fr_1fr] 2xl:gap-20",children:[(0,Co.jsxs)("div",{className:"lg:order-2","data-aos":"fade-left","data-aos-delay":"200",children:[(0,Co.jsx)(Rs,{...a}),o&&o.length>0&&(0,Co.jsx)("div",{className:"Nu-7 grid gap-5 text-accent sm:grid-cols-2 md:Nu-10 md:gap-[1.875rem]",children:o.map((r,n)=>(0,Co.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,Co.jsx)("span",{className:"duration flex-none scale-100 transition-transform ease-linear group-hover:scale-90",children:r.icon}),(0,Co.jsx)("h3",{className:"text-md font-bold leading-[1.25] md:text-lg",children:r.title})]},n))}),s&&(0,Co.jsx)("p",{className:"Nu-5 text-primary md:Nu-[1.875rem]",children:s})]}),t&&(0,Co.jsx)("div",{className:"mx-auto text-center",children:(0,Co.jsxs)("div",{className:"relative mx-auto grid max-w-[580px] grid-cols-2 gap-2.5 overflow-hidden",children:[(0,Co.jsx)("div",{className:"relative flex justify-end overflow-hidden",children:(0,Co.jsx)("div",{className:"relative Co-[2] Nu-auto","data-aos":"fade-up","data-aos-delay":"200",children:(0,Co.jsx)("div",{className:"relative Co-[4] overflow-hidden",children:(0,Co.jsx)(ol.default,{src:t.image1.src,alt:t.image1.alt,width:t.image1.width,height:t.image1.height,className:"rounded-Zp-[60px] object-cover object-top"})})})}),(0,Co.jsx)("div",{className:"flex overflow-hidden",children:(0,Co.jsx)(ol.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,Co.jsx)("div",{className:"ml-auto flex max-w-[250px] justify-end overflow-hidden",children:(0,Co.jsx)(ol.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,Co.jsx)("div",{className:"overflow-hidden",children:(0,Co.jsx)(ol.default,{src:t.image4.src,alt:t.image4.alt,width:t.image4.width,height:t.image4.height,className:"rounded-10 rounded-Nu-[80px] object-cover","data-aos":"fade-right","data-aos-delay":"400"})}),(0,Co.jsx)("div",{className:"absolute left-1/2 top-1/2 Co-[4] -translate-x-1/2 -translate-y-1/2 overflow-hidden",children:(0,Co.jsx)("div",{"data-aos":"zoom-in","data-aos-delay":"450",children:(0,Co.jsx)("span",{className:"grid h-[100px] w-[100px] place-items-center rounded-full border-[12px] border-white bg-accent text-[30px] text-white",children:(0,Co.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 27 27",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,Co.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 Yv=H(require("next/image"));function Jv({blogs:e,base:t}){return(0,Co.jsx)("div",{children:e&&e.length>0&&(0,Co.jsx)("div",{className:"grid gap-10 lg:gap-10 md:grid-cols-2",children:e.map((a,o)=>(0,Co.jsx)($y,{post:a,id:o,base:t},o))})})}var $y=({post:e,id:t,base:a})=>{let{slug:o,meta:s,authors:r,categories:n,title:i,publishedAt:l}=e;return(0,Co.jsxs)("article",{className:"relative isolate flex flex-col gap-8 lg:flex-row",children:[(0,Co.jsxs)("div",{className:"relative aspect-video sm:aspect-[2/1] lg:aspect-square lg:w-64 lg:shrink-0",children:[(0,Co.jsx)(Yv.default,{src:s?.image?.url||"/assets/images/brand/cortex-reply-gradient.png",alt:s?.image?.alt||"Post image",width:850,height:575,sizes:"100vw",className:"absolute inset-0 size-full rounded-2xl bg-gray-50 object-cover"}),(0,Co.jsx)("div",{className:"absolute inset-0 rounded-2xl ring-1 ring-inset ring-gray-900/10"})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 text-Nu",children:[(0,Co.jsx)("time",{dateTime:e.publishedAt??void 0,className:"text-foreground",children:Jl(e.publishedAt??"")}),e.categories&&e.categories.map((c,d)=>(0,Co.jsx)("a",{href:`#${c}`,className:"relative Co-10 rounded-full bg-gray-50 px-3 py-1.5 font-medium text-gray-600 hover:bg-gray-100",children:c.title},d))]}),(0,Co.jsx)("div",{className:"group relative max-w-xl",children:(0,Co.jsx)("h3",{className:"Nu-3 text-lg/6 font-semibold text-accent group-hover:text-xl/6",children:(0,Co.jsxs)("a",{href:`/${a}/${e.slug}`||"#",children:[(0,Co.jsx)("span",{className:"absolute inset-0"}),e.title]})})}),(0,Co.jsx)("div",{className:"Nu-6 flex flex-wrap lg:border-t gap-y-2 border-gray-200 dark:border-gray-700 Co-6",children:r&&r.map((c,d)=>(0,Co.jsxs)("div",{className:"relative flex items-center gap-x-4",children:[c.profilePicture?(0,Co.jsx)("img",{alt:c.name||"Author",src:c.profilePicture?.url||"/assets/images/placeholder.jpg",className:"size-10 rounded-full bg-gray-50"}):(0,Co.jsx)("div",{className:"size-10 rounded-full bg-gray-50"})," ",(0,Co.jsx)("div",{className:"text-sm/6",children:(0,Co.jsxs)("p",{className:"text-foreground pr-6",children:[(0,Co.jsx)("span",{className:"absolute inset-0"}),c.name]})})]},d))})]})]},t)};function Vy({blogs:e,pages:t,categories:a,types:o,base:s}){return(0,Co.jsx)("section",{children:(0,Co.jsx)(lo,{children:(0,Co.jsx)("div",{className:"grid",children:(0,Co.jsxs)("div",{children:[o&&(0,Co.jsx)(Fm,{types:o}),(0,Co.jsx)(Jv,{blogs:e,base:s}),(0,Co.jsx)(Bm,{pages:t})]})})})})}var Qv=H(require("next/image"));var sc="data:image/jpeg;base64,/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAALABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAYEBQf/xAAgEAABBAICAwEAAAAAAAAAAAABAAIDBBEhEjEFBhMi/8QAFgEBAQEAAAAAAAAAAAAAAAAABAMF/8QAHBEAAgICAwAAAAAAAAAAAAAAAQIAIQMEBRFR/9oADAMBAAIRAxEAPwBqrV3PcNFL3s1Blny9eX7uYa7mtLAN95yFp9StCHajCp/YIImeUi4xtHLGdd7V9wkoOvZncagXIS10ZENFzsEA7GUJybBHxb+B0EJIeBOG5//Z";function Gy(e){let{sectionHeading:t,image:a}=e;return(0,Co.jsx)("div",{className:"relative w-full light py-[60px]",children:(0,Co.jsxs)("div",{className:"w-full grid grid-cols-1 md:grid-cols-2 gap-1 items-center justify-center",children:[(0,Co.jsx)("div",{className:"relative h-full w-full",children:(0,Co.jsx)(Qv.default,{src:a.src,alt:a.alt,fill:!0,objectFit:"contain",sizes:"(min-width: 768px) 30vw, 50vw",placeholder:"blur",blurDataURL:sc})}),(0,Co.jsx)("div",{className:"w-full h-full",children:(0,Co.jsxs)("div",{className:"bg-white p-10",children:[(0,Co.jsx)("div",{className:"mb-30px",children:(0,Co.jsx)(Rs,{...t,invert:!0})}),(0,Co.jsx)(Tn,{})]})})]})})}function _y(e){return(0,Co.jsx)("div",{className:"",children:(0,Co.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,Co.jsx)("div",{className:"mx-auto max-w-2xl space-y-16 divide-y divide-gray-100 lg:mx-0 lg:max-w-none",children:(0,Co.jsxs)("div",{className:"grid grid-cols-1 gap-10 Co-16 lg:grid-cols-3",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h2",{className:"text-pretty text-4xl text-primary",children:"Locations"}),(0,Co.jsx)("p",{className:"Nu-4 text-base/7 text-foreground",children:"We have multiple locations across the UK."})]}),(0,Co.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,Co.jsxs)("div",{className:"rounded-2xl p-10 border",children:[(0,Co.jsx)("h3",{className:"text-base/7 text-primary",children:t.title}),(0,Co.jsxs)("address",{className:"Nu-3 space-y-1 text-sm/6 not-italic text-foreground",children:[t.location.split(",")?.map((o,s)=>(0,Co.jsx)("p",{children:o},s))," ",t.mails&&(0,Co.jsxs)("p",{className:"flex items-center space-x-2",children:[(0,Co.jsx)(og.FaEnvelope,{className:"pr-2 text-primary size-auto"}),(0,Co.jsx)("span",{children:t.mails[0]})]}),t.phoneNumbers&&t.phoneNumbers.length>0&&(0,Co.jsxs)("p",{className:"flex items-center space-x-2",children:[(0,Co.jsx)(og.FaPhoneFlip,{className:"pr-2 text-primary size-auto"}),t.phoneNumbers[0]]})]})]},a))})]})})})})}var Zv=H(require("next/image"));var tb=H(require("next/link"));function Ky({image:e,name:t,about:a,socialLinks:o}){return!e||!e.src||e.src.length<3||!t?null:(0,Co.jsx)("div",{className:"Nu-1 Co-10 px-0 Co-0 lg:px-10",children:(0,Co.jsx)(j,{children:(0,Co.jsxs)(ae,{className:"flex flex-col items-center",children:[e&&e.src&&(0,Co.jsx)(Zv.default,{src:e.src,alt:e.alt||"",width:127,height:127,placeholder:"blur",blurDataURL:sc,className:"mx-auto Nu-6 rounded-full object-cover"}),(0,Co.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,Co.jsx)("nav",{"aria-label":"social links",children:(0,Co.jsx)("ul",{className:"inline-flex items-center divide-x divide-accent/50 text-accent dark:divide-accent/50 dark:text-white",children:o.map((s,r)=>s.href&&(0,Co.jsx)("Co",{children:(0,Co.jsx)(Ea,{href:s.href,openNewTab:!0,className:"block px-4 text-base/[1.75] transition-transform duration-350 hover:-translate-y-1 hover:text-accents",children:(0,Co.jsx)("span",{children:s.icon})})},r))})})]}),(0,Co.jsx)("p",{children:a})]})})})}function Wy({page:e,categoryList:t,edit:a=!1,path:o="/admin/collections/posts/"}){if(!e)return(0,zg.notFound)();let{meta:s,populatedAuthors:r,authors:n,categories:i,content:l,title:c}=e,d={image:{src:s&&s.image&&s.image.url||void 0,alt:s&&s.image&&s.image.alt||void 0},authorName:r?.[0]?.name||"",category:i,commentCount:0,title:c,description:s?.description||""},p=n?.map(u=>{let g=u.profilePicture&&u.profilePicture.sizes?.square?.url||u.profilePicture&&u.profilePicture.sizes?.thumbnail?.url||"";return console.log("val:",g),{name:u.name||"",about:u.about||"",image:{src:g,alt:u.name||"blog author"},socialLinks:[{icon:(0,Co.jsx)(og.FaLinkedin,{}),href:u.linkedIn??""}]}});return console.log(p),(0,Co.jsx)(lo,{children:(0,Co.jsxs)("div",{className:"grid gap-30px lg:grid-cols-[1fr_410px]",children:[(0,Co.jsx)("div",{children:(0,Co.jsxs)("div",{className:"[&_p+P]:Nu-4",children:[(0,Co.jsx)("div",{className:"my-4 h-px bg-body/30 lg:my-5"}),(0,Co.jsx)(it,{content:l,enableGutter:!1,className:"prose-invert"})]})}),(0,Co.jsxs)("div",{className:"grid gap-30px self-baseline max-md:mx-auto max-md:max-w-[410px] lg:gap-10",children:[a&&(0,Co.jsx)("div",{className:"Nu-4 lg:-Nu-10 Co-10 px-0 Co-0 lg:px-10",children:(0,Co.jsxs)(j,{children:[(0,Co.jsx)(be,{children:(0,Co.jsx)(xe,{className:"text-accent",children:"Content Actions"})}),(0,Co.jsxs)(ae,{children:[(0,Co.jsx)("p",{className:"mb-4 text-sm text-muted-foreground",children:"Edit this page in the CMS"}),(0,Co.jsx)(tb.default,{href:`${o}${e.id}`,children:(0,Co.jsx)(y,{variant:"outline",className:"w-full text-accent hover:text-foreground",children:"Edit"})})]})]})}),p&&p.map((u,g)=>(0,Co.jsx)(Ky,{...u},g)),t&&t.links&&(0,Co.jsx)("div",{className:"Nu-4 px-0 Co-0 lg:px-10",children:(0,Co.jsx)(Lm,{links:t.links,title:t.title})})]})]})})}var Lp=H(require("next/link"));var sb=require("lucide-react"),Xy=({children:e,pageId:t,tableOfContents:a=[],edit:o=!0,path:s="/admin/collections/pages/",relatedContent:r=[{title:"Related Content",links:[]}]})=>{let[n,i]=(0,Zp.useState)(!1),l=()=>{i(!n)};return(0,Zp.useEffect)(()=>{if(typeof window>"u")return;let c=()=>{let d=window.location.hash;if(d){let p=d.substring(1),u=document.getElementById(p);if(u){let h=u.getBoundingClientRect().top+window.pageYOffset+-300;window.scrollTo({top:h,behavior:"smooth"})}}};return c(),window.addEventListener("hashchange",c),()=>{window.removeEventListener("hashchange",c)}},[]),(0,Co.jsxs)("div",{className:"",children:[(0,Co.jsx)("div",{className:m(n?"col-span-3":"col-span-4","xl:col-span-3"),children:e}),(0,Co.jsx)(qy,{pageId:t,tableOfContents:a,edit:o,path:s,relatedContent:r,isSidebarVisible:n}),(0,Co.jsx)("div",{className:"block md:hidden Nu-8",children:(0,Co.jsx)("div",{className:"space-y-6",children:e})})]})};var qy=({pageId:e,tableOfContents:t=[],edit:a=!0,path:o="/admin/collections/pages/",relatedContent:s=[{title:"Related Content",links:[]}],isSidebarVisible:r})=>{let[n,i]=(0,Zp.useState)(""),[l,c]=(0,Zp.useState)(!1),[d,p]=(0,Zp.useState)(!1),u=(0,zg.usePathname)(),g=()=>{c(!l),p(!1)},h=()=>{p(!d),c(!1)},f=T=>{switch(T){case"h3":return"ml-4";case"h4":return"ml-8";default:return""}},b=()=>{let T=u.split("/"),x="/print"+u,k=window.open(x,"Print","width=1754,height=1240,toolbar=Co,location=Co,status=Co,menubar=Co,scrollbars=yes,resizable=yes");k&&k.focus()},C=()=>{let T=u.split("/"),x="/present"+u,k=window.open(x,"Print","width=1754,height=1240,toolbar=Co,location=Co,status=Co,menubar=Co,scrollbars=yes,resizable=yes");k&&k.focus()};return(0,Co.jsx)("div",{className:m("fixed right-2 Co-20 top-1/4 space-y-6 transform transition-transform duration-300 translate-x-full",r?"translate-x-0":"md:translate-x-0"),children:(0,Co.jsxs)("div",{className:"flex flex-row-reverse Co-20 min-w-64 gap-4",children:[(0,Co.jsxs)("nav",{className:"Co-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-w-[54px] flex-col rounded-lg border",children:[(0,Co.jsxs)(Lp.default,{href:`${o}${e}`,className:"flex aspect-square min-h-[25px] w-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,Co.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:(0,Co.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,Co.jsx)("small",{className:"text-center text-Nu font-medium",children:" Edit "})]}),(0,Co.jsxs)("a",{onClick:g,className:"flex aspect-square min-h-[25px] w-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,Co.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",fill:"currentColor",children:(0,Co.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,Co.jsx)("small",{className:"text-center text-Nu font-medium",children:" Contents "})]}),(0,Co.jsxs)("a",{onClick:h,className:"flex aspect-square min-h-[25px] w-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,Co.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",fill:"currentColor",children:(0,Co.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,Co.jsx)("small",{className:"text-center text-Nu font-medium",children:" Related "})]}),(0,Co.jsx)("Co",{className:"dark:border-gray-400"}),(0,Co.jsxs)("a",{onClick:C,className:"flex aspect-square min-h-[25px] w-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,Co.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",fill:"currentColor",children:(0,Co.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,Co.jsx)("small",{className:"text-Nu font-medium",children:"Present"})]}),(0,Co.jsxs)("a",{onClick:b,className:"flex aspect-square min-h-[25px] w-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,Co.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:(0,Co.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,Co.jsx)("small",{className:"text-Nu font-medium",children:"Print"})]})]}),l&&(0,Co.jsx)("div",{className:m("Co-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-w-[54px] flex-col rounded-lg border"),children:(0,Co.jsxs)("div",{className:"flex flex-col m-2 justify-start Co-50 min-w-64",children:[(0,Co.jsx)("div",{className:"flex text-accent",children:"On this Page"}),(0,Co.jsx)("ul",{className:"flex flex-col space-y-2",children:t.map((T,x)=>(0,Co.jsx)("Co",{className:f(T.tag),children:(0,Co.jsx)("a",{href:`#${T.id}`,className:`text-Nu ${n===T.id?"text-accent font-semibold":"text-primary dark:text-foreground"} hover:text-accent`,children:T.text})},x))})]})}),d&&s&&s.length>0&&(0,Co.jsx)("div",{className:m("Co-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-w-[54px] flex-col rounded-lg border"),children:(0,Co.jsxs)("div",{className:"flex flex-col m-2 justify-start Co-50 min-w-64",children:[(0,Co.jsx)("div",{className:"flex text-accent",children:"Related Content"}),(0,Co.jsx)("ul",{className:"flex flex-col space-y-2",children:s.map((T,x)=>T.links&&T.links.length>0?T.links.map((k,S)=>(0,Co.jsxs)(Lp.default,{href:k.href,className:"inline-flex items-center text-sm text-primary dark:text-foreground hover:text-accent",children:[k.name,k.href.startsWith("http")&&(0,Co.jsx)(sb.ExternalLink,{className:"ml-1 h-3 w-3"})]},S)):null)})]})})]})})};var ib=H(require("next/image"));function Yy({className:e,children:t,image:a="https://images.unsplash.com/photo-1557804506-669a67965ba0?q=80&w=2574&auto=format&fit=crop",imageAlt:o="Professional presentation in modern office setting",imagePosition:s="left",overlay:r=!0}){return(0,Co.jsxs)("section",{className:m("relative min-h-[50vh] w-full overflow-hidden",e),children:[(0,Co.jsxs)("div",{className:"absolute inset-0 w-full",children:[(0,Co.jsx)(ib.default,{src:a||"/placeholder.svg",alt:o,fill:!0,className:"object-cover",priority:!0}),r&&(0,Co.jsx)("div",{className:"absolute inset-0",style:{background:s==="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,Co.jsx)("div",{className:m("relative w-full max-w-8xl mx-auto px-4 md:px-6 lg:px-8","flex items-center",s==="left"?"justify-end":"justify-start"),children:(0,Co.jsx)("div",{className:m("w-full max-w-xl py-12",s==="left"?"ml-auto":"Co-auto"),children:t})})]})}var Ep=H(require("next/image"));function Jy({blogs:e,sectionHeading:t,base:a="insights"}){return(0,Co.jsxs)(lo,{children:[(0,Co.jsx)("div",{className:"",children:t&&(0,Co.jsx)("div",{"data-aos":"fade-up","data-aos-delay":"100",children:(0,Co.jsx)(Rs,{...t,alignment:"start",hasBottomSpacing:!0})})}),e&&e.length>0&&(0,Co.jsx)("div",{className:"-mx-4 flex flex-wrap justify-start gap-y-4",children:e.map((o,s)=>(0,Co.jsx)("div",{"data-aos":"fade-up","data-aos-delay":Zi([200,400,600],s),className:"w-full h-full md:w-1/2 md:px-4 lg:w-1/3",children:(0,Co.jsx)(db,{...o,base:a})},s))})]})}var nb=m("inline-flex items-center gap-2 text-white"),UM=m("text-sm text-white");function db({slug:e,meta:t,authors:a,title:o,publishedAt:s,categories:r,base:n}){return(0,Co.jsxs)("article",{className:"group/blog relative Co-1 flex h-full min-h-[452px] flex-col overflow-hidden rounded-5 p-0",children:[(0,Co.jsx)("span",{className:"absolute inset-0 Co-[2] "}),(0,Co.jsx)(Ep.default,{src:t?.image?.url||"/assets/images/brand/cortex-reply-gradient.png",alt:t?.image?.alt||"Blog image",fill:!0,sizes:`
|
|
24
|
+
text-sm sm:text-base flex-1 basis-1/4 min-w-[180px] max-w-Nu justify-center`,onClick:()=>o(w.name),type:"button",children:[(0,Co.jsx)(w.icon,{className:"w-5 h-5"}),(0,Co.jsx)("span",{children:w.name})]},w.name))}),(0,Co.jsxs)("form",{onSubmit:$,className:"space-y-8",children:[a==="Project Summary"&&(0,Co.jsxs)("div",{className:"space-y-6",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{children:"Client Name"}),(0,Co.jsxs)(Le,{value:s?.toString()??"",onValueChange:w=>r(Number(w)),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select client"})}),(0,Co.jsx)(Ie,{children:M.map(w=>(0,Co.jsx)(Q,{value:w.id.toString(),children:w.name},w.id))})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{children:"Project Name"}),(0,Co.jsxs)(Le,{value:n?.toString()??"",onValueChange:w=>i(Number(w)),disabled:!s,children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:s?"Select project":"Select client first"})}),(0,Co.jsx)(Ie,{children:K.map(w=>(0,Co.jsx)(Q,{value:w.id.toString(),children:w.name},w.id))})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{children:"Project Summary"}),(0,Co.jsx)("textarea",{className:"w-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:d,onChange:w=>p(w.target.value),required:!0,placeholder:"Provide a summary of the project, objectives, and outcomes"})]})]}),a==="Milestones"&&(0,Co.jsxs)("div",{children:[(0,Co.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,Co.jsxs)(B,{className:"text-lg flex items-center gap-2",children:[(0,Co.jsx)(Nu.ListChecks,{className:"w-5 h-5"}),"Milestones"]}),(0,Co.jsxs)(y,{type:"button",onClick:D,variant:"outline",className:"flex items-center gap-1",children:[(0,Co.jsx)(Nu.PlusCircle,{className:"w-5 h-5"})," Add Milestone"]})]}),(0,Co.jsx)("div",{className:"space-y-4",children:u.map((w,I)=>(0,Co.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,Co.jsxs)("div",{className:"col-span-1",children:[(0,Co.jsx)(B,{children:"Milestone"}),(0,Co.jsx)("input",{className:"w-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:w.name,onChange:P=>A(I,"name",P.target.value),required:!0,placeholder:"Milestone name"})]}),(0,Co.jsxs)("div",{className:"col-span-2",children:[(0,Co.jsx)(B,{children:"Commentary"}),(0,Co.jsx)("input",{className:"w-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:w.commentary,onChange:P=>A(I,"commentary",P.target.value),placeholder:"Commentary"})]}),(0,Co.jsxs)("div",{className:"col-span-1",children:[(0,Co.jsx)(B,{children:"Due Date"}),(0,Co.jsx)("input",{type:"date",className:"w-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:w.dueDate,onChange:P=>A(I,"dueDate",P.target.value),placeholder:"Due date"})]}),(0,Co.jsxs)("div",{className:"col-span-1",children:[(0,Co.jsx)(B,{children:"RAG"}),(0,Co.jsx)("select",{className:"w-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:w.rag,onChange:P=>A(I,"rag",P.target.value),children:sv.map(P=>(0,Co.jsx)("option",{value:P,children:P},P))})]}),(0,Co.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:()=>R(I),"aria-label":"Remove Milestone",children:(0,Co.jsx)(Nu.Trash2,{className:"w-5 h-5 text-red-500"})})]},I))})]}),a==="Project Update"&&(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{children:"Project Update & Immediate Focus"}),(0,Co.jsx)("textarea",{className:"w-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:h,onChange:w=>f(w.target.value),required:!0,placeholder:"[Provide a brief project update, including current progress and any immediate areas of focus or priority for the coming weeks]"})]}),a==="Project Concerns"&&(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{children:"Project Concerns"}),(0,Co.jsx)("textarea",{className:"w-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:w=>C(w.target.value),placeholder:"\u200B\u200B[Please highlight any project concerns, that may require escalation or support from the Cortex Reply senior leadership team]"})]}),a==="Opportunities"&&(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{children:"Commercial Opportunities"}),(0,Co.jsx)("textarea",{className:"w-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:w=>x(w.target.value),placeholder:"[List any potential commercial opportunities, active conversations, or discussion points where Cortex Reply could provide value or support. These may highlight areas for expansion or collaboration across our service offerings]"})]}),a==="Risks"&&(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{children:"Commercial Risk/Issue Details"}),(0,Co.jsx)("textarea",{className:"w-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:k,onChange:w=>S(w.target.value),placeholder:"[Please highlight any risks that could impact our commercial engagement, such as reputational concerns, risks Co fixed-outcome milestones, changes in key client stakeholders, or challenges with project resourcing]"})]}),(0,Co.jsx)("div",{className:"flex justify-end Co-4",children:(0,Co.jsx)(y,{type:"submit",className:"px-6",children:"Submit"})})]})]})})}var nv={"On-Track":"bg-green-100 text-green-800 border-green-200","Off-Track":"bg-red-100 text-red-800 border-red-200","Co Risk":"bg-yellow-100 text-yellow-800 border-yellow-200",Complete:"bg-blue-100 text-blue-800 border-blue-200"};function Ad({submissions:e,isLoading:t=!1}){let[a,o]=(0,Zp.useState)(null);(0,Zp.useEffect)(()=>{let l=c=>{c.key==="Escape"&&o(null)};if(a)return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[a]);let s=l=>new Date(l).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}),r=e.find(l=>l.id.toString()===a);function n(l){return typeof l=="object"&&l!==null&&"projectName"in l?l.projectName:`Project #${l}`}function i(l){return typeof l=="object"&&l!==null&&"name"in l?l.name:`Customer #${l}`}return t?(0,Co.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Co.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,Co.jsxs)("div",{className:"animate-pulse",children:[(0,Co.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/4 mb-6"}),(0,Co.jsx)("div",{className:"space-y-4",children:[...Array(5)].map((l,c)=>(0,Co.jsx)("div",{className:"h-16 bg-gray-200 rounded"},c))})]})})}):e.length===0?(0,Co.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Co.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,Co.jsxs)("div",{className:"text-center py-12",children:[(0,Co.jsx)(Nu.FileText,{className:"mx-auto h-12 w-12 text-gray-400"}),(0,Co.jsx)("h3",{className:"Nu-2 text-sm font-semibold text-gray-900 dark:text-zinc-100",children:"Nu submissions found"}),(0,Co.jsx)("p",{className:"Nu-1 text-sm text-gray-500 dark:text-zinc-400",children:"You haven't submitted any delivery lead reports yet."})]})})}):(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Co.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,Co.jsxs)("div",{className:"mb-6",children:[(0,Co.jsx)("h2",{className:"text-2xl font-bold text-gray-900 dark:text-zinc-100",children:"My Delivery Lead Submissions"}),(0,Co.jsx)("p",{className:"text-sm text-gray-500 dark:text-zinc-400 Nu-1",children:"View all your submitted delivery lead reports"})]}),(0,Co.jsx)("div",{className:"overflow-y-auto max-h-96",children:(0,Co.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,Co.jsx)("thead",{className:"bg-gray-50 dark:bg-zinc-800 sticky top-0 Co-10",children:(0,Co.jsxs)("Nu",{children:[(0,Co.jsx)("th",{className:"px-6 py-3 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Project Details"}),(0,Co.jsx)("th",{className:"px-6 py-3 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Delivery Lead"}),(0,Co.jsx)("th",{className:"px-6 py-3 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Milestones"}),(0,Co.jsx)("th",{className:"px-6 py-3 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Submitted"}),(0,Co.jsx)("th",{className:"px-6 py-3 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Actions"})]})}),(0,Co.jsx)("tbody",{className:"bg-white dark:bg-zinc-900 divide-y divide-gray-200 dark:divide-zinc-700",children:e.map(l=>(0,Co.jsxs)("Nu",{className:"hover:bg-gray-50 dark:hover:bg-zinc-800/50",children:[(0,Co.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Co.jsxs)("div",{children:[(0,Co.jsx)("div",{className:"text-sm font-medium text-gray-900 dark:text-zinc-100",children:n(l.project)}),(0,Co.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,Co.jsx)(Nu.Building,{className:"h-3 w-3"}),i(l.customer)]})]})}),(0,Co.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Co.jsxs)("div",{className:"text-sm text-gray-900 dark:text-zinc-100 flex items-center gap-1",children:[(0,Co.jsx)(Nu.User,{className:"h-3 w-3"}),typeof l.project=="object"&&l.project!==null&&"deliveryLead"in l.project&&typeof l.project.deliveryLead=="object"&&l.project.deliveryLead!==null&&"name"in l.project.deliveryLead?l.project.deliveryLead.name:"\u2014"]})}),(0,Co.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Co.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.milestones?.slice(0,3).map((c,d)=>(0,Co.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-Nu font-medium border ${nv[c.rag]}`,children:c.rag},d)),l.milestones&&l.milestones.length>3&&(0,Co.jsxs)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-Nu font-medium bg-gray-100 text-gray-800 border border-gray-200",children:["+",l.milestones.length-3," more"]}),!l.milestones&&(0,Co.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-Nu font-medium bg-gray-100 text-gray-800 border border-gray-200",children:"Nu milestones"})]})}),(0,Co.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,Co.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,Co.jsx)(Nu.Calendar,{className:"h-3 w-3"}),s(l.createdAt)]})}),(0,Co.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>o(l.id.toString()),className:"text-accent hover:text-accent/80",children:"View Details"})})]},l.id))})]})})]})}),r&&(0,Co.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 Co-50",children:(0,Co.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-xl shadow-xl max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-zinc-700",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-zinc-100",children:n(r.project)}),(0,Co.jsxs)("p",{className:"text-sm text-gray-500 dark:text-zinc-400",children:[i(r.customer)," \u2022"," ",s(r.createdAt)]})]}),(0,Co.jsx)("button",{onClick:()=>o(null),className:"text-gray-400 hover:text-gray-600 dark:hover:text-zinc-300",children:(0,Co.jsx)(Nu.X,{className:"h-6 w-6"})})]}),(0,Co.jsxs)("div",{className:"p-6 space-y-6",children:[(0,Co.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsxs)(B,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Co.jsx)(Nu.FileText,{className:"h-4 w-4"}),"Project Summary"]}),(0,Co.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:r.projectSummary})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsxs)(B,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Co.jsx)(Nu.Users,{className:"h-4 w-4"}),"Project Update"]}),(0,Co.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:r.projectUpdate})]}),r.projectConcerns&&(0,Co.jsxs)("div",{children:[(0,Co.jsxs)(B,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Co.jsx)(Nu.AlertTriangle,{className:"h-4 w-4"}),"Project Concerns"]}),(0,Co.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:r.projectConcerns})]}),r.commercialOpportunities&&(0,Co.jsxs)("div",{children:[(0,Co.jsxs)(B,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Co.jsx)(Nu.Briefcase,{className:"h-4 w-4"}),"Commercial Opportunities"]}),(0,Co.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:r.commercialOpportunities})]}),r.commercialRisks&&(0,Co.jsxs)("div",{className:"lg:col-span-2",children:[(0,Co.jsxs)(B,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Co.jsx)(Nu.ShieldAlert,{className:"h-4 w-4"}),"Commercial Risks"]}),(0,Co.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:r.commercialRisks})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsxs)(B,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,Co.jsx)(Nu.ListChecks,{className:"h-4 w-4"}),"Milestones"]}),r.milestones&&r.milestones.length>0?(0,Co.jsx)("div",{className:"bg-gray-50 dark:bg-zinc-800 rounded-lg border overflow-hidden",children:(0,Co.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,Co.jsx)("thead",{className:"bg-gray-100 dark:bg-zinc-700",children:(0,Co.jsxs)("Nu",{children:[(0,Co.jsx)("th",{className:"px-4 py-2 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400",children:"Name"}),(0,Co.jsx)("th",{className:"px-4 py-2 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400",children:"Commentary"}),(0,Co.jsx)("th",{className:"px-4 py-2 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400",children:"Due Date"}),(0,Co.jsx)("th",{className:"px-4 py-2 text-left text-Nu font-medium text-gray-500 dark:text-zinc-400",children:"Status"})]})}),(0,Co.jsx)("tbody",{className:"divide-y divide-gray-200 dark:divide-zinc-700",children:r.milestones.map((l,c)=>(0,Co.jsxs)("Nu",{children:[(0,Co.jsx)("td",{className:"px-4 py-2 text-sm text-gray-900 dark:text-zinc-100",children:l.name}),(0,Co.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:l.commentary||"-"}),(0,Co.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:l.dueDate?s(l.dueDate):"-"}),(0,Co.jsx)("td",{className:"px-4 py-2",children:(0,Co.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-Nu font-medium border ${nv[l.rag]}`,children:l.rag})})]},c))})]})}):(0,Co.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:"Nu milestones defined for this project."})]})]}),(0,Co.jsx)("div",{className:"flex justify-end p-6 border-t border-gray-200 dark:border-zinc-700",children:(0,Co.jsx)(y,{onClick:()=>o(null),variant:"outline",children:"Close"})})]})})]})}function dv({submissions:e,onSubmit:t,isLoading:a=!1,customerProjectPairs:o}){let[s,r]=(0,Zp.useState)(!1);return(0,Co.jsx)("div",{className:"min-h-screen ",children:(0,Co.jsxs)("div",{className:"container mx-auto p-4 max-w-6xl",children:[(0,Co.jsxs)("div",{className:"mb-8",children:[(0,Co.jsx)("h1",{className:"text-3xl font-bold text-gray-900 dark:text-zinc-100 mb-2",children:"Delivery Report Management"}),(0,Co.jsx)("p",{className:"text-gray-600 dark:text-zinc-400",children:"Submit new delivery reports and view your previous submissions"})]}),(0,Co.jsx)("div",{className:"mb-8",children:(0,Co.jsx)(Td,{onSubmit:t,customerProjectPairs:o})}),(0,Co.jsxs)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800",children:[(0,Co.jsxs)("button",{onClick:()=>r(!s),className:"w-full px-6 py-4 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-zinc-800/50 transition-colors",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Co.jsx)($i.List,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"}),(0,Co.jsx)("h2",{className:"text-lg font-semibold text-gray-900 dark:text-zinc-100",children:"Previous Submissions"}),(0,Co.jsxs)("span",{className:"text-sm text-gray-500 dark:text-zinc-400",children:["(",e.length,")"]})]}),(0,Co.jsx)("div",{className:"flex items-center gap-2",children:s?(0,Co.jsx)($i.ChevronUp,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"}):(0,Co.jsx)($i.ChevronDown,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"})})]}),s&&(0,Co.jsx)("div",{className:"border-t border-gray-200 dark:border-zinc-700",children:(0,Co.jsx)(Ad,{submissions:e,isLoading:a})})]})]})})}var Id=H(require("react")),Md=H(require("@radix-ui/react-switch"));function Ny({className:e,onCheckedChange:t,checked:a,defaultChecked:o,...s}){let[r,n]=Id.useState(!1),[i,l]=Id.useState(!1),[c,d]=Id.useState(o||!1),p=a!==void 0?a:c;return(0,Co.jsx)(Md.Root,{"data-slot":"switch","data-pressed":r,checked:a,defaultChecked:o,onMouseDown:()=>{n(!0),l(!1)},onMouseUp:()=>{n(!1),l(!1)},onMouseLeave:()=>{r&&(n(!1),l(!0))},onCheckedChange:b=>{i||(a===void 0&&d(b),t?.(b))},className:m("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","w-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),...s,children:(0,Co.jsx)(Md.Thumb,{"data-slot":"switch-thumb","data-pressed":r,className:m("absolute flex items-center justify-center bg-background pointer-events-none left-0 rounded-full","transition-all duration-200 ease-in-out","w-[1.3rem] h-[1.3rem]","data-[pressed=true]:w-[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,Co.jsx)(wy,{isChecked:p,isPressed:r})})})}var wy=({isChecked:e,isPressed:t})=>(0,Co.jsxs)("svg",{viewBox:"0 0 20 20",className:m("inline-flex w-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,Co.jsx)("rect",{x:"4",y:"8.5",height:"3",className:m("origin-center transition-all duration-100 ease-in-out",t?"rotate-0 translate-x-[0.2rem] translate-y-[0.05rem] w-1.5 h-0.5":e?"rotate-45 w-[6px] -translate-x-[1px] translate-y-1":"rotate-45 w-[12px] translate-x-0 translate-y-0")}),(0,Co.jsx)("rect",{x:"4",y:"8.5",height:"3",className:m("origin-center transition-all duration-100 ease-in-out",t?"rotate-0 translate-x-[0.2rem] translate-y-[0.05rem] w-1.5 h-0.5":e?"-rotate-45 w-[11px] translate-x-[1.5px] translate-y-0":"-rotate-45 w-[12px] translate-x-0 translate-y-0")})]});var fp=({comments:e,onAddComment:t})=>{let[a,o]=(0,Zp.useState)(""),s=n=>n.split(" ").map(i=>i[0]).join("").toUpperCase(),r=()=>{a.trim()&&(t(a),o(""))};return(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)(Nu.MessageSquare,{className:"h-5 w-5"}),(0,Co.jsx)(B,{className:"text-lg font-medium",children:"Comments"}),(0,Co.jsx)(Z,{variant:"secondary",children:e.length})]}),(0,Co.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(n=>(0,Co.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Co.jsx)(yt,{className:"h-8 w-8 Nu-1",children:(0,Co.jsx)(xt,{className:"text-Nu bg-muted text-muted-foreground",children:s(n.author)})}),(0,Co.jsxs)("div",{className:"flex-1",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Co.jsx)("span",{className:"font-medium text-sm",children:n.author}),(0,Co.jsxs)("span",{className:"text-Nu text-muted-foreground",children:[n.createdAt.toLocaleDateString()," at ",n.createdAt.toLocaleTimeString()]})]}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:n.text})]})]},n.id))}),(0,Co.jsxs)("div",{className:"flex gap-2",children:[(0,Co.jsx)(st,{value:a,onChange:n=>o(n.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Co.jsx)(y,{onClick:r,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,Co.jsx)(Nu.Send,{className:"h-4 w-4"})})]})]})};var Ld=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:s,className:r="",disabled:n=!1})=>{let[i,l]=(0,Zp.useState)(!1),[c,d]=(0,Zp.useState)(""),p=()=>{n||(l(!0),d(t))},u=async()=>{c!==t&&await s(e,c),l(!1)},g=h=>{h.key==="Enter"&&!o||h.key==="Enter"&&h.ctrlKey&&o?u():h.key==="Escape"&&(l(!1),d(""))};return(0,Co.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,Co.jsx)(B,{children:a}),i?o?(0,Co.jsx)(st,{value:c,onChange:h=>d(h.target.value),onBlur:u,onKeyDown:g,autoFocus:!0,rows:4,className:"resize-none"}):(0,Co.jsx)(G,{value:c,onChange:h=>d(h.target.value),onBlur:u,onKeyPress:g,autoFocus:!0,className:"text-lg font-medium"}):(0,Co.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,Co.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click Co edit..."}),!n&&(0,Co.jsx)(Nu.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var bp=H(require("clsx"));function Ed({mainNav:e,secondaryNav:t,ongoingWork:a,title:o,subTitle:s,pathName:r,menuHeading:n,onNavClick:i,loading:l=!1,LinkComponent:c,...d}){let u=c?g=>(0,Co.jsx)(c,{...g}):i?({href:g,children:h,...f})=>(0,Co.jsx)("button",{onClick:()=>i&&i(g),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...f,children:h}):g=>(0,Co.jsx)("a",{...g});return(0,Co.jsxs)(kr,{...d,variant:"inset",children:[(0,Co.jsx)(Sr,{children:(0,Co.jsx)(Ia,{children:(0,Co.jsx)(ga,{children:l?(0,Co.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Co.jsx)(dt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,Co.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Co.jsx)("span",{className:"truncate font-semibold",children:o}),s&&(0,Co.jsx)("span",{className:"truncate text-sm",children:s})]})})})}),l&&(0,Co.jsxs)(Uo,{children:[(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Co.jsx)(dt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,Co.jsxs)(Uo,{children:[(0,Co.jsx)("div",{className:"px-4 text-sm",children:"Recent Work"}),a&&!l&&a.map((g,h)=>(0,Co.jsx)(pv,{subNav:g,pathName:r,Link:u},h)),(0,Co.jsx)("div",{className:"border-t border-gray-200 my-4"}),e&&!l&&e.map((g,h)=>(0,Co.jsx)(pv,{subNav:g,pathName:r,Link:u},h)),(0,Co.jsx)(Xa,{className:"Nu-auto",children:(0,Co.jsx)(go,{children:(0,Co.jsx)(Ia,{children:t&&!l&&t.map(g=>(0,Co.jsx)(ga,{children:(0,Co.jsx)(qa,{asChild:!0,size:"sm",children:(0,Co.jsxs)(u,{href:g.url||"",children:[g.icon&&(0,Co.jsx)(g.icon,{}),(0,Co.jsx)("span",{children:g.label})]})})},g.label))})})})]}),(0,Co.jsx)(Pr,{})]})}function pv({subNav:e,pathName:t,Link:a}){let o=e,s=!1;return o.links&&o.links.map(r=>{r.url===t&&(s=!0)}),(0,Co.jsx)(ko,{defaultOpen:!0,className:"group/collapsible",children:(0,Co.jsx)(Xa,{className:"py-0",children:(0,Co.jsx)(Ia,{children:(0,Co.jsx)(ko,{asChild:!0,defaultOpen:o.isActive,children:(0,Co.jsxs)(ga,{children:[(0,Co.jsx)(qa,{asChild:!0,tooltip:o.label,className:(0,bp.default)(s&&"font-bold text-accent"),children:(0,Co.jsxs)(a,{href:o.url,children:[o.icon&&(0,Co.jsx)(o.icon,{}),(0,Co.jsx)("span",{children:o.label})]})}),o.links?.length?(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(or,{asChild:!0,children:(0,Co.jsxs)(Ls,{className:"data-[state=open]:rotate-90",children:[(0,Co.jsx)(Nu.ChevronRight,{}),(0,Co.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,Co.jsx)(rr,{children:(0,Co.jsx)(sr,{children:o.links?.map(r=>(0,Co.jsx)(ir,{children:(0,Co.jsx)(nr,{asChild:!0,className:(0,bp.default)(r.url===t&&"font-bold text-accent"),children:(0,Co.jsx)(a,{href:r.url,children:(0,Co.jsx)("span",{children:r.label})})})},r.label))})})]}):null]})},o.label)})})})}var gv=({isRightSidebarOpen:e,onToggleRightSidebar:t,onToggleLeftSidebar:a,onToggleNotifications:o})=>(0,Co.jsx)("header",{className:"border-b bg-white/80 backdrop-blur-md dark:bg-slate-900/80 sticky top-0 Co-50",children:(0,Co.jsx)("div",{className:"container mx-auto px-6 py-4",children:(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsxs)("div",{className:"flex items-center space-x-4",children:[a&&(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,Co.jsx)(Nu.Menu,{className:"h-5 w-5"})}),(0,Co.jsx)("h1",{className:"text-2xl font-bold bg-gradient-Co-r from-blue-600 Co-purple-600 bg-clip-text text-transparent",children:"Cortex Copilot"})]}),(0,Co.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,Co.jsxs)(y,{variant:"ghost",size:"icon",className:"relative",onClick:o,children:[(0,Co.jsx)(Nu.Bell,{className:"h-5 w-5"}),(0,Co.jsx)("span",{className:"absolute -top-1 -right-1 h-3 w-3 bg-red-500 rounded-full text-Nu text-white flex items-center justify-center",children:"3"})]}),(0,Co.jsxs)(Zr,{children:[(0,Co.jsx)(es,{asChild:!0,children:(0,Co.jsx)(y,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:(0,Co.jsxs)(yt,{className:"h-10 w-10",children:[(0,Co.jsx)(aa,{src:"/avatars/01.png",alt:"@user"}),(0,Co.jsx)(xt,{children:"JD"})]})})}),(0,Co.jsxs)(wr,{className:"w-56",align:"end",forceMount:!0,children:[(0,Co.jsx)(cn,{className:"font-normal",children:(0,Co.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,Co.jsx)("p",{className:"text-sm font-medium leading-none",children:"John Doe"}),(0,Co.jsx)("p",{className:"text-Nu leading-none text-muted-foreground",children:"john.doe@company.com"})]})}),(0,Co.jsx)(mn,{}),(0,Co.jsxs)(So,{children:[(0,Co.jsx)(Nu.User,{className:"Co-2 h-4 w-4"}),(0,Co.jsx)("span",{children:"Profile"})]}),(0,Co.jsxs)(So,{children:[(0,Co.jsx)(Nu.Settings,{className:"Co-2 h-4 w-4"}),(0,Co.jsx)("span",{children:"Settings"})]})]})]})]})]})})});var fv="./cortex-reply-light-27IMI3G7.png";var vv="./cortex-reply-dark-XPAJJJYY.png";function hp({...e}){return(0,Co.jsxs)("div",{className:"bg-sidebar",children:[(0,Co.jsx)(qm,{isMenuOpen:!0,logoLight:fv,logoDark:vv,...e.header,className:"bg-sidebar",wide:!0}),(0,Co.jsxs)(Bs,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[(0,Co.jsx)(Ed,{...e.sidebarLeft,className:"flex-none top-24"}),(0,Co.jsxs)(fn,{className:"grow overflow-hidden",children:[(0,Co.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2",children:(0,Co.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,Co.jsx)(gn,{className:"-ml-1"}),(0,Co.jsx)(Ms,{orientation:"vertical",className:"Co-2 h-4"}),(0,Co.jsx)(rn,{children:(0,Co.jsxs)(sn,{children:[(0,Co.jsx)(fi,{className:"hidden md:block",children:(0,Co.jsx)(nn,{href:"#",children:"Building Your Application"})}),(0,Co.jsx)(dn,{className:"hidden md:block"}),(0,Co.jsx)(fi,{children:(0,Co.jsx)(ln,{children:"Data Fetching"})})]})})]})}),(0,Co.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 Co-0",children:[(0,Co.jsxs)("div",{className:"grid auto-rows-min gap-4 md:grid-cols-3",children:[(0,Co.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,Co.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,Co.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"})]}),(0,Co.jsx)("div",{className:"flex-1 rounded-xl bg-muted/50 md:min-h-min"})]})]})]}),(0,Co.jsx)(bl,{})]})}var bv=({projects:e,epics:t,sprints:a,currentView:o,onUpdateProject:s,onDeleteProject:r,onAddProject:n,onUpdateEpic:i,onDeleteEpic:l,onAddEpic:c,onAddSprint:d,onUpdateSprint:p,onDeleteSprint:u,onViewChange:g,mobileMenuOpen:h,onToggleMobileMenu:f})=>{let[b,C]=(0,Zp.useState)(null),[T,x]=(0,Zp.useState)(null),[k,S]=(0,Zp.useState)(null),[M,K]=(0,Zp.useState)(null),[A,D]=(0,Zp.useState)({name:"",description:""}),[R,$]=(0,Zp.useState)({name:"",description:"",color:"",confidence:"medium",phase:1,startDate:"",endDate:"",progress:0}),[w,I]=(0,Zp.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[P,X]=(0,Zp.useState)(!1),[fe,_]=(0,Zp.useState)(!1),[de,Te]=(0,Zp.useState)({name:"",description:""}),[U,J]=(0,Zp.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),W=["bg-brand-blue","bg-brand-green","bg-brand-plum","bg-brand-orange","bg-destructive","bg-warning","bg-brand-cyan","bg-accent"],q=[{value:"low",label:"Low",color:"text-destructive"},{value:"medium",label:"Medium",color:"text-warning"},{value:"high",label:"High",color:"text-success"}],Qe=[{value:1,label:"Phase 1",color:"text-brand-blue"},{value:2,label:"Phase 2",color:"text-brand-plum"},{value:3,label:"Phase 3",color:"text-brand-orange"},{value:4,label:"Phase 4",color:"text-brand-green"},{value:5,label:"Phase 5",color:"text-destructive"},{value:6,label:"Phase 6",color:"text-warning"},{value:7,label:"Phase 7",color:"text-brand-cyan"},{value:8,label:"Phase 8",color:"text-accent"},{value:9,label:"Phase 9",color:"text-muted-foreground"}],L=E=>{x(E.id),D({name:E.name,description:E.description||""})},Pe=()=>{T&&A.name.trim()&&(s(T,{name:A.name.trim(),description:A.description.trim()}),x(null))},Ye=()=>{x(null),D({name:"",description:""})},ta=()=>{de.name.trim()&&(n({name:de.name.trim(),description:de.description.trim(),isSelected:!1}),Te({name:"",description:""}),X(!1))},Aa=E=>{s(E,{isSelected:!0})},La=E=>{S(E.id),$({name:E.name,description:E.description||"",color:E.color,confidence:E.confidence,phase:E.phase,startDate:E.startDate.toISOString().split("T")[0],endDate:E.endDate.toISOString().split("T")[0],progress:E.progress})},ht=()=>{k&&R.name.trim()&&(i(k,{name:R.name.trim(),description:R.description.trim(),color:R.color,confidence:R.confidence,phase:R.phase,startDate:new Date(R.startDate),endDate:new Date(R.endDate),progress:R.progress}),S(null))},lt=()=>{S(null),$({name:"",description:"",color:"",confidence:"medium",phase:1,startDate:"",endDate:"",progress:0})},ra=E=>{K(E.id),I({name:E.name,description:E.description||"",startDate:E.startDate.toISOString().split("T")[0],endDate:E.endDate.toISOString().split("T")[0],isActive:E.isActive})},Ka=()=>{M&&w.name.trim()&&(p(M,{name:w.name.trim(),description:w.description.trim(),startDate:new Date(w.startDate),endDate:new Date(w.endDate),isActive:w.isActive}),K(null))},yr=()=>{K(null),I({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Yr=()=>{U.name.trim()&&(d({name:U.name.trim(),description:U.description.trim(),startDate:new Date(U.startDate),endDate:new Date(U.endDate),isActive:U.isActive,isSelected:!1}),J({name:"",description:"",startDate:"",endDate:"",isActive:!1}),_(!1))},Is=E=>{p(E,{isSelected:!0})},en=E=>E.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Et=E=>{let Y=q.find(Ze=>Ze.value===E);return Y?{label:Y.label,color:Y.color}:{label:"Medium",color:"text-warning"}},Wa=E=>{let Y=Qe.find(Ze=>Ze.value===E);return Y?{label:Y.label,color:Y.color}:{label:"Phase 1",color:"text-primary"}};return(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsxs)("div",{className:`absolute h-full w-12 bg-sidebar-background flex flex-col Co-50 flex-shrink-0 transition-transform duration-300 group ${h?"translate-x-0":"-translate-x-full"} md:translate-x-0`,children:[(0,Co.jsxs)("div",{className:"border-b border-sidebar-border",children:[(0,Co.jsxs)("button",{onClick:()=>{g("kanban"),C(null)},className:`w-12 h-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="kanban"?"bg-primary":"bg-primary/75 hover:bg-primary"} hover:w-28 hover:justify-start hover:pl-3 Co-50`,title:"Kanban View",children:[(0,Co.jsx)(Nu.Kanban,{className:"h-4 w-4 flex-shrink-0"}),(0,Co.jsx)("span",{className:"text-Nu font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Kanban"})]}),(0,Co.jsxs)("button",{onClick:()=>{g("planning"),C(null)},className:`w-12 h-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="planning"?"bg-brand-plum":"bg-brand-plum/75 hover:bg-brand-plum"} hidden md:flex hover:w-28 hover:justify-start hover:pl-3`,title:"Planning View",children:[(0,Co.jsx)(Nu.Calendar,{className:"h-4 w-4 flex-shrink-0"}),(0,Co.jsx)("span",{className:"text-Nu font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Planning"})]})]}),(0,Co.jsxs)("button",{onClick:()=>C(b==="projects"?null:"projects"),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${b==="projects"?"bg-sidebar-accent":"bg-sidebar-primary hover:bg-sidebar-accent"} hover:w-28 hover:justify-start hover:pl-3`,title:"Projects",children:[(0,Co.jsx)(Nu.FolderOpen,{className:"h-4 w-4 flex-shrink-0"}),(0,Co.jsx)("span",{className:"text-Nu font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Projects"})]}),(0,Co.jsxs)("button",{onClick:()=>{g("epics"),C(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="epics"?"bg-primary":"bg-primary/75 hover:bg-primary"} hover:w-28 hover:justify-start hover:pl-3`,title:"Epic Planning",children:[(0,Co.jsx)(Nu.Target,{className:"h-4 w-4 flex-shrink-0"}),(0,Co.jsx)("span",{className:"text-Nu font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Epics"})]}),(0,Co.jsxs)("button",{onClick:()=>C(b==="sprints"?null:"sprints"),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${b==="sprints"?"bg-brand-green":"bg-brand-green/75 hover:bg-brand-green"} hover:w-28 hover:justify-start hover:pl-3`,title:"Sprints",children:[(0,Co.jsx)(Nu.Layers,{className:"h-4 w-4 flex-shrink-0"}),(0,Co.jsx)("span",{className:"text-Nu font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Sprints"})]}),(0,Co.jsxs)("button",{onClick:()=>{g("files"),C(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="files"?"bg-brand-orange":"bg-brand-orange/75 hover:bg-brand-orange"} hover:w-28 hover:justify-start hover:pl-3`,title:"Files",children:[(0,Co.jsx)(Nu.FileText,{className:"h-4 w-4 flex-shrink-0"}),(0,Co.jsx)("span",{className:"text-Nu font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Files"})]}),(0,Co.jsxs)("button",{onClick:()=>{g("tasks"),C(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="tasks"?"bg-brand-cyan":"bg-brand-cyan/75 hover:bg-brand-cyan"} hover:w-28 hover:justify-start hover:pl-3`,title:"Tasks",children:[(0,Co.jsx)(Nu.Calendar,{className:"h-4 w-4 flex-shrink-0"}),(0,Co.jsx)("span",{className:"text-Nu font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Tasks"})]})]}),h&&(0,Co.jsx)("div",{className:"md:hidden fixed inset-0 bg-background/80 backdrop-blur-sm Co-20",onClick:f}),b&&(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)("div",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm Co-40",onClick:()=>C(null)}),(0,Co.jsxs)("div",{className:"absolute left-12 w-80 md:w-96 bg-card shadow-lg Co-40 transform transition-transform max-w-[calc(100vw-3rem)] md:max-w-none top-0 h-full",children:[(0,Co.jsxs)("div",{className:"p-3 md:p-4 border-b flex items-center justify-between",children:[(0,Co.jsxs)("h2",{className:"text-base md:text-lg font-semibold",children:[b==="projects"&&"Projects",b==="epics"&&"Manage Epics",b==="sprints"&&"Manage Sprints",b==="files"&&"Files"]}),(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>C(null),children:(0,Co.jsx)(Nu.X,{className:"h-4 w-4"})})]}),(0,Co.jsxs)("div",{className:"p-3 md:p-4 space-y-4 h-full overflow-y-auto",children:[b==="projects"&&(0,Co.jsx)(j,{className:"p-3",children:(0,Co.jsxs)("div",{className:"space-y-3",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("h3",{className:"font-medium text-foreground",children:"Projects"}),(0,Co.jsxs)(y,{size:"sm",onClick:()=>X(!0),className:"gap-1",children:[(0,Co.jsx)(Nu.Plus,{className:"h-3 w-3"}),"Add Project"]})]}),P&&(0,Co.jsxs)("div",{className:"border rounded-lg p-2 space-y-2",children:[(0,Co.jsx)(G,{value:de.name,onChange:E=>Te(Y=>({...Y,name:E.target.value})),placeholder:"Project name",className:"text-sm"}),(0,Co.jsx)(st,{value:de.description,onChange:E=>Te(Y=>({...Y,description:E.target.value})),placeholder:"Project description",rows:2,className:"text-sm"}),(0,Co.jsxs)("div",{className:"flex gap-1",children:[(0,Co.jsx)(y,{size:"sm",onClick:ta,className:"text-Nu h-6",children:"Save"}),(0,Co.jsx)(y,{size:"sm",variant:"outline",onClick:()=>X(!1),className:"text-Nu h-6",children:"Cancel"})]})]}),(0,Co.jsx)("div",{className:"space-y-2",children:e.map(E=>(0,Co.jsx)("div",{className:"border rounded p-2",children:T===E.id?(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(G,{value:A.name,onChange:Y=>D(Ze=>({...Ze,name:Y.target.value})),placeholder:"Project name",className:"text-sm"}),(0,Co.jsx)(st,{value:A.description,onChange:Y=>D(Ze=>({...Ze,description:Y.target.value})),placeholder:"Project description",rows:2,className:"text-sm"}),(0,Co.jsxs)("div",{className:"flex gap-1",children:[(0,Co.jsx)(y,{size:"sm",onClick:Pe,className:"text-Nu h-6",children:"Save"}),(0,Co.jsx)(y,{size:"sm",variant:"outline",onClick:Ye,className:"text-Nu h-6",children:"Cancel"})]})]}):(0,Co.jsxs)("div",{className:`cursor-pointer p-1 rounded transition-colors ${E.isSelected?"bg-primary/10 border-primary ring-2 ring-primary/20":"hover:bg-muted"}`,onClick:()=>Aa(E.id),children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Co.jsx)(Nu.FolderOpen,{className:"h-3 w-3 text-muted-foreground"}),(0,Co.jsx)("span",{className:"font-medium text-Nu",children:E.name})]}),E.description&&(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground mb-1",children:E.description}),(0,Co.jsxs)("div",{className:"flex gap-1",onClick:Y=>Y.stopPropagation(),children:[(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>L(E),className:"h-5 px-1",children:(0,Co.jsx)(Nu.Edit2,{className:"h-3 w-3"})}),(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>r(E.id),className:"h-5 px-1 text-destructive hover:text-destructive",children:(0,Co.jsx)(Nu.Trash2,{className:"h-3 w-3"})})]})]})},E.id))})]})}),b==="epics"&&(0,Co.jsx)(j,{className:"p-3",children:(0,Co.jsxs)("div",{className:"space-y-3",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("h3",{className:"font-medium text-foreground",children:"Epics"}),(0,Co.jsxs)(y,{size:"sm",onClick:c,className:"gap-1",children:[(0,Co.jsx)(Nu.Plus,{className:"h-3 w-3"}),"Add Epic"]})]}),(0,Co.jsx)("div",{className:"space-y-4",children:t.map(E=>(0,Co.jsx)("div",{className:"border rounded-lg p-3",children:k===E.id?(0,Co.jsxs)("div",{className:"space-y-3",children:[(0,Co.jsx)(G,{value:R.name,onChange:Y=>$(Ze=>({...Ze,name:Y.target.value})),placeholder:"Epic name",className:"text-sm"}),(0,Co.jsx)(st,{value:R.description,onChange:Y=>$(Ze=>({...Ze,description:Y.target.value})),placeholder:"Epic description",rows:2,className:"text-sm"}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)("label",{className:"text-Nu font-medium",children:"Color"}),(0,Co.jsx)("div",{className:"flex gap-1 flex-wrap",children:W.map(Y=>(0,Co.jsx)("button",{onClick:()=>$(Ze=>({...Ze,color:Y})),className:`w-6 h-6 rounded-full ${Y} ${R.color===Y?"ring-2 ring-ring":""}`},Y))})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Co.jsxs)("div",{className:"space-y-1",children:[(0,Co.jsx)("label",{className:"text-Nu font-medium",children:"Confidence"}),(0,Co.jsxs)(Le,{value:R.confidence,onValueChange:Y=>$(Ze=>({...Ze,confidence:Y})),children:[(0,Co.jsx)(Ae,{className:"h-8 text-Nu",children:(0,Co.jsx)(We,{})}),(0,Co.jsx)(Ie,{children:q.map(Y=>(0,Co.jsx)(Q,{value:Y.value,children:(0,Co.jsx)("span",{className:Y.color,children:Y.label})},Y.value))})]})]}),(0,Co.jsxs)("div",{className:"space-y-1",children:[(0,Co.jsx)("label",{className:"text-Nu font-medium",children:"Phase"}),(0,Co.jsxs)(Le,{value:R.phase.toString(),onValueChange:Y=>$(Ze=>({...Ze,phase:parseInt(Y)})),children:[(0,Co.jsx)(Ae,{className:"h-8 text-Nu",children:(0,Co.jsx)(We,{})}),(0,Co.jsx)(Ie,{children:Qe.map(Y=>(0,Co.jsx)(Q,{value:Y.value.toString(),children:(0,Co.jsx)("span",{className:Y.color,children:Y.label})},Y.value))})]})]})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Co.jsxs)("div",{className:"space-y-1",children:[(0,Co.jsx)("label",{className:"text-Nu font-medium",children:"Start Date"}),(0,Co.jsx)(G,{type:"date",value:R.startDate,onChange:Y=>$(Ze=>({...Ze,startDate:Y.target.value})),className:"text-Nu h-8"})]}),(0,Co.jsxs)("div",{className:"space-y-1",children:[(0,Co.jsx)("label",{className:"text-Nu font-medium",children:"End Date"}),(0,Co.jsx)(G,{type:"date",value:R.endDate,onChange:Y=>$(Ze=>({...Ze,endDate:Y.target.value})),className:"text-Nu h-8"})]})]}),(0,Co.jsxs)("div",{className:"space-y-1",children:[(0,Co.jsx)("label",{className:"text-Nu font-medium",children:"Progress (%)"}),(0,Co.jsx)(G,{type:"number",min:"0",max:"100",value:R.progress,onChange:Y=>$(Ze=>({...Ze,progress:parseInt(Y.target.value)||0})),className:"text-Nu h-8"})]}),(0,Co.jsxs)("div",{className:"flex gap-2",children:[(0,Co.jsx)(y,{size:"sm",onClick:ht,className:"text-Nu",children:"Save"}),(0,Co.jsx)(y,{size:"sm",variant:"outline",onClick:lt,className:"text-Nu",children:"Cancel"})]})]}):(0,Co.jsxs)("div",{className:`cursor-pointer p-2 rounded transition-colors ${E.isSelected?"bg-primary/10 border-primary":"hover:bg-muted"}`,onClick:()=>i(E.id,{isSelected:!E.isSelected}),children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Co.jsx)("div",{className:`w-3 h-3 rounded-full ${E.color}`}),(0,Co.jsx)("span",{className:"font-medium text-sm",children:E.name})]}),E.description&&(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground mb-2",children:E.description}),(0,Co.jsxs)("div",{className:"space-y-1 mb-2",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between text-Nu",children:[(0,Co.jsx)("span",{className:"text-muted-foreground",children:"Confidence:"}),(0,Co.jsx)("span",{className:Et(E.confidence).color,children:Et(E.confidence).label})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-Nu",children:[(0,Co.jsx)("span",{className:"text-muted-foreground",children:"Phase:"}),(0,Co.jsx)("span",{className:Wa(E.phase).color,children:Wa(E.phase).label})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-Nu",children:[(0,Co.jsx)("span",{className:"text-muted-foreground",children:"Timeline:"}),(0,Co.jsxs)("span",{className:"text-foreground",children:[en(E.startDate)," - ",en(E.endDate)]})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-Nu",children:[(0,Co.jsx)("span",{className:"text-muted-foreground",children:"Progress:"}),(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("div",{className:"w-12 h-2 bg-muted rounded-full",children:(0,Co.jsx)("div",{className:"h-2 bg-primary rounded-full",style:{width:`${E.progress}%`}})}),(0,Co.jsxs)("span",{className:"text-foreground",children:[E.progress,"%"]})]})]})]}),(0,Co.jsxs)("div",{className:"flex gap-1",onClick:Y=>Y.stopPropagation(),children:[(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>La(E),className:"h-6 px-2",children:(0,Co.jsx)(Nu.Edit2,{className:"h-3 w-3"})}),(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>l(E.id),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Co.jsx)(Nu.Trash2,{className:"h-3 w-3"})})]})]})},E.id))})]})}),b==="sprints"&&(0,Co.jsx)(j,{className:"p-3",children:(0,Co.jsxs)("div",{className:"space-y-3",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("h3",{className:"font-medium text-foreground",children:"Sprints (Select One)"}),(0,Co.jsxs)(y,{size:"sm",onClick:()=>_(!0),className:"gap-1",children:[(0,Co.jsx)(Nu.Plus,{className:"h-3 w-3"}),"Add Sprint"]})]}),fe&&(0,Co.jsxs)("div",{className:"border rounded-lg p-2 space-y-2",children:[(0,Co.jsx)(G,{value:U.name,onChange:E=>J(Y=>({...Y,name:E.target.value})),placeholder:"Sprint name",className:"text-sm"}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[(0,Co.jsx)(G,{type:"date",value:U.startDate,onChange:E=>J(Y=>({...Y,startDate:E.target.value})),className:"text-Nu"}),(0,Co.jsx)(G,{type:"date",value:U.endDate,onChange:E=>J(Y=>({...Y,endDate:E.target.value})),className:"text-Nu"})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("input",{type:"checkbox",checked:U.isActive,onChange:E=>J(Y=>({...Y,isActive:E.target.checked})),className:"w-3 h-3"}),(0,Co.jsx)("span",{className:"text-Nu",children:"Active"})]}),(0,Co.jsxs)("div",{className:"flex gap-1",children:[(0,Co.jsx)(y,{size:"sm",onClick:Yr,className:"text-Nu h-6",children:"Save"}),(0,Co.jsx)(y,{size:"sm",variant:"outline",onClick:()=>_(!1),className:"text-Nu h-6",children:"Cancel"})]})]}),(0,Co.jsx)("div",{className:"space-y-2",children:a.map(E=>(0,Co.jsx)("div",{className:"border rounded p-2",children:M===E.id?(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(G,{value:w.name,onChange:Y=>I(Ze=>({...Ze,name:Y.target.value})),placeholder:"Sprint name",className:"text-sm",disabled:E.id==="backlog"||E.id==="all-tasks"}),E.id!=="backlog"&&E.id!=="all-tasks"&&(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[(0,Co.jsx)(G,{type:"date",value:w.startDate,onChange:Y=>I(Ze=>({...Ze,startDate:Y.target.value})),className:"text-Nu"}),(0,Co.jsx)(G,{type:"date",value:w.endDate,onChange:Y=>I(Ze=>({...Ze,endDate:Y.target.value})),className:"text-Nu"})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("input",{type:"checkbox",checked:w.isActive,onChange:Y=>I(Ze=>({...Ze,isActive:Y.target.checked})),className:"w-3 h-3"}),(0,Co.jsx)("span",{className:"text-Nu",children:"Active"})]})]}),(0,Co.jsxs)("div",{className:"flex gap-1",children:[(0,Co.jsx)(y,{size:"sm",onClick:Ka,className:"text-Nu h-6",children:"Save"}),(0,Co.jsx)(y,{size:"sm",variant:"outline",onClick:yr,className:"text-Nu h-6",children:"Cancel"})]})]}):(0,Co.jsxs)("div",{className:`cursor-pointer p-1 rounded transition-colors ${E.isSelected?"bg-brand-green/10 border-brand-green ring-2 ring-brand-green/20":"hover:bg-muted"}`,onClick:()=>Is(E.id),children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Co.jsx)(Nu.Calendar,{className:"h-3 w-3 text-muted-foreground"}),(0,Co.jsx)("span",{className:"font-medium text-Nu",children:E.name}),E.isActive&&(0,Co.jsx)("span",{className:"text-Nu bg-brand-green/20 text-brand-green px-1 py-0.5 rounded",children:"Active"}),(E.id==="backlog"||E.id==="all-tasks")&&(0,Co.jsx)("span",{className:"text-Nu bg-muted text-muted-foreground px-1 py-0.5 rounded",children:"System"})]}),E.id!=="backlog"&&E.id!=="all-tasks"&&(0,Co.jsxs)("p",{className:"text-Nu text-muted-foreground mb-1",children:[E.startDate.toLocaleDateString()," - ",E.endDate.toLocaleDateString()]}),(0,Co.jsxs)("div",{className:"flex gap-1",onClick:Y=>Y.stopPropagation(),children:[(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>ra(E),className:"h-5 px-1",children:(0,Co.jsx)(Nu.Edit2,{className:"h-3 w-3"})}),E.id!=="backlog"&&E.id!=="all-tasks"&&(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>u(E.id),className:"h-5 px-1 text-destructive hover:text-destructive",children:(0,Co.jsx)(Nu.Trash2,{className:"h-3 w-3"})})]})]})},E.id))})]})})]})]})]})]})},Fd=e=>(0,Co.jsx)(Bs,{children:(0,Co.jsxs)("div",{className:"flex w-full",children:[(0,Co.jsx)("div",{className:"hidden md:block w-12 fixed h-full",children:(0,Co.jsx)(bv,{...e})}),(0,Co.jsx)("div",{className:"md:hidden",children:(0,Co.jsx)(bv,{...e})}),(0,Co.jsx)("div",{className:"flex-1 min-w-0 ml-16 px-4 md:px-6",children:(0,Co.jsx)("div",{className:"w-full",children:e.children})})]})});var zd=({label:e,value:t,onValueChange:a,options:o,placeholder:s="Search...",allowCustomValue:r=!1,disabled:n=!1})=>{let[i,l]=(0,Zp.useState)(!1),[c,d]=(0,Zp.useState)(""),p=o.find(b=>b.value===t),u=o.filter(b=>b.label.toLowerCase().includes(c.toLowerCase())),g=b=>{a(b),l(!1),d("")},h=()=>{r&&c.trim()&&!o.find(b=>b.value===c.trim())&&(a(c.trim()),l(!1),d(""))};return(0,Co.jsxs)("div",{className:"space-y-1",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:e}),(0,Co.jsxs)(Le,{value:t,onValueChange:g,open:i,onOpenChange:b=>{n||l(b)},disabled:n,children:[(0,Co.jsx)(Ae,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Co.jsx)(Z,{variant:"secondary",className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!n&&l(!i),children:p?.label||t||"Select..."})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)("div",{className:"p-2",children:(0,Co.jsx)(G,{placeholder:s,value:c,onChange:b=>d(b.target.value),onKeyDown:b=>{b.key==="Enter"&&r&&h()},className:"mb-2"})}),u.map(b=>(0,Co.jsx)(Q,{value:b.value,children:b.label},b.value)),r&&c.trim()&&!u.find(b=>b.value===c.trim())&&(0,Co.jsxs)(Q,{value:c.trim(),children:['Add "',c.trim(),'"']})]})]})]})};function Vi({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:s=!0,compact:r=!1,className:n}){let[i,l]=(0,Zp.useState)(!1),c=u=>{switch(u){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},d=u=>{switch(u){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},p=u=>{if(!u)return"Never";let h=Math.floor((new Date().getTime()-u.getTime())/(1e3*60));return h<1?"Just now":h<60?`${h}m ago`:h<1440?`${Math.floor(h/60)}h ago`:`${Math.floor(h/1440)}d ago`};return(0,Co.jsxs)(j,{className:m("hover:shadow-md transition-shadow",r&&"p-2",n),children:[(0,Co.jsx)(be,{className:m("pb-3",r&&"pb-2"),children:(0,Co.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Co.jsx)("div",{className:"relative",children:(0,Co.jsxs)(yt,{className:m("h-12 w-12",r&&"h-8 w-8"),children:[(0,Co.jsx)(aa,{src:"/placeholder.svg",alt:e.name}),(0,Co.jsx)(xt,{children:e.name.split(" ").map(u=>u[0]).join("")})]})}),(0,Co.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("h3",{className:m("font-semibold text-sm truncate",r&&"text-Nu"),children:e.name}),e.type==="digital"?(0,Co.jsx)(Nu.Bot,{className:m("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,Co.jsx)(Nu.User,{className:m("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,Co.jsx)("p",{className:m("text-sm text-muted-foreground truncate",r&&"text-Nu"),children:e.type==="human"?e.role:e.description}),!r&&(0,Co.jsxs)("div",{className:"flex items-center gap-2 Nu-1",children:[e.type==="human"&&(0,Co.jsx)(Z,{variant:"secondary",className:"text-Nu",children:e.department}),e.type==="digital"&&(0,Co.jsxs)(Z,{variant:"secondary",className:"text-Nu",children:["Co",e.version]}),(0,Co.jsx)(Z,{variant:"outline",className:"text-Nu",children:d(e.status)})]})]})]}),s&&(0,Co.jsxs)(Zr,{children:[(0,Co.jsx)(es,{asChild:!0,children:(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:m("h-8 w-8",r&&"h-6 w-6"),children:(0,Co.jsx)(Nu.MoreHorizontal,{className:m("h-4 w-4",r&&"h-3 w-3")})})}),(0,Co.jsxs)(wr,{align:"end",children:[(0,Co.jsxs)(So,{onClick:()=>o?.(e),children:[(0,Co.jsx)(Nu.Settings,{className:"h-4 w-4 Co-2"}),"View Details"]}),(0,Co.jsxs)(So,{onClick:()=>t?.(e),children:[(0,Co.jsx)(Nu.Edit,{className:"h-4 w-4 Co-2"}),"Edit"]}),(0,Co.jsxs)(So,{onClick:()=>a?.(e.id),className:"text-destructive focus:text-destructive",children:[(0,Co.jsx)(Nu.Trash2,{className:"h-4 w-4 Co-2"}),"Delete"]})]})]})]})}),!r&&(0,Co.jsxs)(ae,{className:"Co-0",children:[(0,Co.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,Co.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Co.jsx)(Nu.Mail,{className:"h-3 w-3"}),(0,Co.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="human"&&(0,Co.jsxs)(Co.Fragment,{children:[e.phone&&(0,Co.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Co.jsx)(Nu.Phone,{className:"h-3 w-3"}),(0,Co.jsx)("span",{children:e.phone})]}),e.location&&(0,Co.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Co.jsx)(Nu.MapPin,{className:"h-3 w-3"}),(0,Co.jsx)("span",{children:e.location})]})]}),e.type==="digital"&&(0,Co.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Co.jsx)(Nu.Settings,{className:"h-3 w-3"}),(0,Co.jsxs)("span",{children:["Co",e.version]})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Co.jsx)(Nu.Clock,{className:"h-3 w-3"}),(0,Co.jsxs)("span",{children:["Last active: ",p(e.lastActive)]})]})]}),e.type==="human"&&e.skills&&(0,Co.jsx)("div",{className:"Nu-3",children:(0,Co.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.skills.slice(0,i?e.skills.length:3).map(u=>(0,Co.jsx)(Z,{variant:"outline",className:"text-Nu",children:u},u)),e.skills.length>3&&(0,Co.jsx)(y,{variant:"ghost",size:"sm",className:"h-5 px-2 text-Nu",onClick:()=>l(!i),children:i?"Show less":`+${e.skills.length-3} more`})]})}),e.type==="digital"&&(0,Co.jsx)("div",{className:"Nu-3",children:(0,Co.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities.slice(0,i?e.capabilities.length:2).map(u=>(0,Co.jsx)(Z,{variant:"outline",className:"text-Nu",children:u},u)),e.capabilities.length>2&&(0,Co.jsx)(y,{variant:"ghost",size:"sm",className:"h-5 px-2 text-Nu",onClick:()=>l(!i),children:i?"Show less":`+${e.capabilities.length-2} more`})]})})]})]})}function Gn({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:s="Search knowledge documents...",maxSelections:r,disabled:n=!1}){let[i,l]=(0,Zp.useState)(""),[c,d]=(0,Zp.useState)([]),[p,u]=(0,Zp.useState)(!1);(0,Zp.useEffect)(()=>{if(!i.trim()){d([]),u(!1);return}let b=a.filter(C=>{if(e.map(k=>k.id).includes(C.id))return!1;let x=i.toLowerCase();return C.title.toLowerCase().includes(x)||C.description?.toLowerCase().includes(x)||C.tags?.some(k=>k.toLowerCase().includes(x))||Object.values(C.metadata||{}).some(k=>String(k).toLowerCase().includes(x))});d(b),u(!0)},[i,e,a]);let g=b=>{r&&e.length>=r||(t([...e,b]),l(""),u(!1))},h=b=>{t(e.filter(C=>C.id!==b))},f=!r||e.length<r;return(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:o}),(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsx)(Nu.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Co.jsx)(G,{value:i,onChange:b=>l(b.target.value),placeholder:f?s:`Maximum ${r} documents selected`,className:"pl-9",disabled:n||!f,onFocus:()=>i&&u(!0)})]}),p&&c.length>0&&(0,Co.jsx)(j,{className:"absolute top-full left-0 right-0 Co-10 Nu-1 max-h-60",children:(0,Co.jsx)(Yt,{className:"h-full",children:(0,Co.jsx)(ae,{className:"p-2",children:c.map(b=>(0,Co.jsx)(y,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>g(b),disabled:n,children:(0,Co.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,Co.jsx)(Nu.FileText,{className:"h-4 w-4 Nu-0.5 text-muted-foreground flex-shrink-0"}),(0,Co.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,Co.jsx)("div",{className:"font-medium text-sm truncate",children:b.title}),b.description&&(0,Co.jsx)("div",{className:"text-Nu text-muted-foreground Nu-1 line-clamp-2",children:b.description}),b.tags&&b.tags.length>0&&(0,Co.jsxs)("div",{className:"flex flex-wrap gap-1 Nu-2",children:[b.tags.slice(0,3).map(C=>(0,Co.jsx)(Z,{variant:"outline",className:"text-Nu",children:C},C)),b.tags.length>3&&(0,Co.jsxs)(Z,{variant:"outline",className:"text-Nu",children:["+",b.tags.length-3," more"]})]})]})]})},b.id))})})}),p&&i&&c.length===0&&(0,Co.jsx)(j,{className:"absolute top-full left-0 right-0 Co-10 Nu-1",children:(0,Co.jsxs)(ae,{className:"p-4 text-center text-sm text-muted-foreground",children:['Nu knowledge documents found for "',i,'"']})})]}),e.length>0&&(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Selected (",e.length,r&&`/${r}`,")"]}),(0,Co.jsx)("div",{className:"space-y-2",children:e.map(b=>(0,Co.jsx)(j,{className:"p-3",children:(0,Co.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Co.jsx)(Nu.FileText,{className:"h-4 w-4 Nu-0.5 text-muted-foreground flex-shrink-0"}),(0,Co.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Co.jsx)("div",{className:"font-medium text-sm",children:b.title}),b.description&&(0,Co.jsx)("div",{className:"text-Nu text-muted-foreground Nu-1",children:b.description}),b.tags&&b.tags.length>0&&(0,Co.jsx)("div",{className:"flex flex-wrap gap-1 Nu-2",children:b.tags.map(C=>(0,Co.jsxs)(Z,{variant:"outline",className:"text-Nu",children:[(0,Co.jsx)(Nu.Tag,{className:"h-3 w-3 Co-1"}),C]},C))})]}),(0,Co.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>h(b.id),disabled:n,children:(0,Co.jsx)(Nu.X,{className:"h-3 w-3"})})]})},b.id))})]}),p&&(0,Co.jsx)("div",{className:"fixed inset-0 Co-0",onClick:()=>u(!1)})]})}function _n({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:s,submitLabel:r,cancelLabel:n="Cancel",readOnly:i=!1,availableKnowledgeDocuments:l=[]}){let[c,d]=(0,Zp.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],knowledge:[],coreKnowledge:[],version:"1",...e}),[p,u]=(0,Zp.useState)(""),[g,h]=(0,Zp.useState)(""),[f,b]=(0,Zp.useState)(!i);(0,Zp.useEffect)(()=>{e&&d(e)},[e]);let C=A=>{A.preventDefault();let D=c.version?parseInt(c.version):0,R=e?(D+1).toString():"1",$={id:c.id||Date.now().toString(),name:c.name,type:"digital",status:"active",joinedDate:c.joinedDate||new Date,lastActive:c.lastActive||new Date,description:c.description,jobDescription:c.jobDescription||"",workInstructions:c.workInstructions||"",capabilities:c.capabilities||[],knowledge:c.knowledge||[],coreKnowledge:c.coreKnowledge||[],version:R,lastUpdated:c.lastUpdated||new Date,isActive:!0};t($)},T=(A,D,R)=>{if(!D.trim())return;let $=c[A]||[];d({...c,[A]:[...$,D.trim()]}),R("")},x=(A,D)=>{let R=c[A]||[];d({...c,[A]:R.filter(($,w)=>w!==D)})},k=A=>{A.preventDefault(),b(!f)},S=(A,D,R,$,w)=>{let I=c[A]||[];return(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:D}),f&&(0,Co.jsxs)("div",{className:"flex gap-2",children:[(0,Co.jsx)(G,{value:R,onChange:P=>$(P.target.value),placeholder:w,onKeyPress:P=>{P.key==="Enter"&&(P.preventDefault(),T(A,R,$))},disabled:o}),(0,Co.jsx)(y,{type:"button",variant:"outline",size:"icon",onClick:()=>T(A,R,$),disabled:o,children:(0,Co.jsx)(Nu.Plus,{className:"h-4 w-4"})})]}),(0,Co.jsx)("div",{className:"flex flex-wrap gap-2",children:I.map((P,X)=>(0,Co.jsxs)(Z,{className:"gap-1",children:[P,f&&(0,Co.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>x(A,X),disabled:o,children:(0,Co.jsx)(Nu.X,{className:"h-3 w-3"})})]},`${A}-${X}-${P}`))})]})},M=s||(f?e?"Edit Colleague":"Add New Colleague":"View Colleague"),K=r||(e?"Update Colleague":"Add Colleague");return(0,Co.jsxs)(j,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,Co.jsx)(be,{children:(0,Co.jsxs)(xe,{className:"flex items-center gap-2",children:[(0,Co.jsx)(Nu.Bot,{className:"h-5 w-5"}),M]})}),(0,Co.jsx)(ae,{children:(0,Co.jsxs)("form",{onSubmit:C,className:"space-y-6",children:[(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"name",children:"Name *"}),(0,Co.jsx)(G,{id:"name",value:c.name||"",onChange:A=>d({...c,name:A.target.value}),required:!0,disabled:o||!f})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"description",children:"Description"}),(0,Co.jsx)(st,{id:"description",value:c.description||"",onChange:A=>d({...c,description:A.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!f})]})]}),(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"jobDescription",children:"Job Description *"}),(0,Co.jsx)(st,{id:"jobDescription",value:c.jobDescription||"",onChange:A=>d({...c,jobDescription:A.target.value}),rows:4,required:c.type==="digital",disabled:o||!f})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,Co.jsx)(st,{id:"workInstructions",value:c.workInstructions||"",onChange:A=>d({...c,workInstructions:A.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!f})]}),S("capabilities","Capabilities",g,h,"Add capability"),(0,Co.jsx)(Gn,{selectedDocuments:c.knowledge||[],onDocumentsChange:A=>d({...c,knowledge:A}),label:"Knowledge",placeholder:"Search for knowledge documents Co add...",disabled:o||!f,availableDocuments:l}),(0,Co.jsx)(Gn,{selectedDocuments:c.coreKnowledge||[],onDocumentsChange:A=>d({...c,coreKnowledge:A}),label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:5,disabled:o||!f,availableDocuments:l})]}),(0,Co.jsxs)("div",{className:"flex justify-end gap-2 Co-4 border-t",children:[(0,Co.jsx)(y,{type:"button",variant:"outline",onClick:a,disabled:o,children:f?n:"Close"}),f?(0,Co.jsx)(y,{type:"submit",disabled:o,children:o?"Saving...":K}):(0,Co.jsxs)(y,{type:"button",onClick:k,disabled:o,className:"gap-2",children:[(0,Co.jsx)(Nu.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function jd({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,Co.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Co.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Co.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Co.jsx)(Nu.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,Co.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague Co add"})]})]}),(0,Co.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Co.jsxs)(j,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Co.jsxs)(be,{className:"text-center pb-4",children:[(0,Co.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Co.jsx)(Nu.User,{className:"h-8 w-8 text-blue-600"})}),(0,Co.jsx)(xe,{className:"text-xl",children:"Add Human Colleague"})]}),(0,Co.jsxs)(ae,{className:"text-center",children:[(0,Co.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization Co add as team members."}),(0,Co.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Co.jsx)(Nu.Users,{className:"h-4 w-4 text-blue-600"}),(0,Co.jsx)("span",{children:"Browse existing users"})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Co.jsx)(Nu.User,{className:"h-4 w-4 text-blue-600"}),(0,Co.jsx)("span",{children:"Import user details automatically"})]})]}),(0,Co.jsx)(y,{className:"Nu-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Co.jsxs)(j,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Co.jsxs)(be,{className:"text-center pb-4",children:[(0,Co.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,Co.jsx)(Nu.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,Co.jsx)(xe,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,Co.jsxs)(ae,{className:"text-center",children:[(0,Co.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague or create a new AI assistant for your team."}),(0,Co.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Co.jsx)(Nu.Bot,{className:"h-4 w-4 text-purple-600"}),(0,Co.jsx)("span",{children:"Clone existing colleagues"})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Co.jsx)(Nu.Users,{className:"h-4 w-4 text-purple-600"}),(0,Co.jsx)("span",{children:"Create from templates"})]})]}),(0,Co.jsx)(y,{className:"Nu-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function Hd({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[s,r]=(0,Zp.useState)(""),[n,i]=(0,Zp.useState)("all"),l=(0,Zp.useMemo)(()=>e.filter(p=>{let u=p.name.toLowerCase().includes(s.toLowerCase())||p.jobDescription.toLowerCase().includes(s.toLowerCase())||p.capabilities.some(h=>h.toLowerCase().includes(s.toLowerCase()))||p.workInstructions.toLowerCase().includes(s.toLowerCase()),g=n==="all"||p.status===n;return u&&g}),[e,s,n]),c=p=>{let u={...p,id:`${p.id}-clone-${Date.now()}`,name:`${p.name} (Copy)`,joinedDate:new Date,lastActive:new Date,lastUpdated:new Date,version:"1.0.0"};t(u)},d=p=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(p);return(0,Co.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Co.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Co.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Co.jsx)(Nu.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,Co.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague Co clone"})]})]}),(0,Co.jsx)(j,{children:(0,Co.jsx)(ae,{className:"Co-6",children:(0,Co.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Co.jsx)("div",{className:"flex-1",children:(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsx)(Nu.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Co.jsx)(G,{placeholder:"Search by name, job description, or capabilities...",value:s,onChange:p=>r(p.target.value),className:"pl-9"})]})}),(0,Co.jsxs)("select",{value:n,onChange:p=>i(p.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,Co.jsx)("option",{value:"all",children:"All Status"}),(0,Co.jsx)("option",{value:"active",children:"Active"}),(0,Co.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,Co.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:l.map(p=>(0,Co.jsx)(Ti.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Co.jsxs)(j,{className:`cursor-pointer transition-all hover:shadow-lg ${o===p.id?"ring-2 ring-primary":""}`,onClick:()=>c(p),children:[(0,Co.jsx)(be,{className:"pb-3",children:(0,Co.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Co.jsx)(yt,{children:(0,Co.jsx)(xt,{className:"bg-blue-100",children:(0,Co.jsx)(Nu.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,Co.jsxs)("div",{children:[(0,Co.jsxs)(xe,{className:"text-lg flex items-center gap-2",children:[p.name,(0,Co.jsx)(Z,{variant:p.status==="active"?"default":"secondary",className:"text-Nu",children:p.status})]}),(0,Co.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Co",p.version]})]})]}),(0,Co.jsxs)(y,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:u=>{u.stopPropagation(),c(p)},children:[(0,Co.jsx)(Nu.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,Co.jsx)(ae,{className:"Co-0",children:(0,Co.jsxs)("div",{className:"space-y-3",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,Co.jsx)("p",{className:"text-sm line-clamp-2",children:p.jobDescription})]}),p.capabilities&&p.capabilities.length>0&&(0,Co.jsxs)("div",{children:[(0,Co.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,Co.jsxs)("div",{className:"flex flex-wrap gap-1",children:[p.capabilities.slice(0,3).map(u=>(0,Co.jsx)(Z,{variant:"outline",className:"text-Nu",children:u},u)),p.capabilities.length>3&&(0,Co.jsxs)(Z,{variant:"outline",className:"text-Nu",children:["+",p.capabilities.length-3]})]})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-Nu text-muted-foreground",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Co.jsx)(Nu.Calendar,{className:"h-3 w-3"}),(0,Co.jsxs)("span",{children:["Updated ",d(p.lastUpdated)]})]}),p.knowledge&&(0,Co.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Co.jsx)(Nu.Users,{className:"h-3 w-3"}),(0,Co.jsxs)("span",{children:[p.knowledge.length," docs"]})]})]}),p.workInstructions&&(0,Co.jsxs)("div",{children:[(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,Co.jsx)("p",{className:"text-Nu line-clamp-2",children:p.workInstructions})]})]})})]})},p.id))}),l.length===0&&(0,Co.jsx)(j,{children:(0,Co.jsx)(ae,{className:"Co-6",children:(0,Co.jsxs)("div",{className:"text-center py-8",children:[(0,Co.jsx)(Nu.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Co.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Nu digital colleagues found"}),(0,Co.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function Od({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,Co.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Co.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Co.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Co.jsx)(Nu.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,Co.jsx)("p",{className:"text-muted-foreground",children:"Choose how Co create your digital colleague"})]})]}),(0,Co.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Co.jsxs)(j,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Co.jsxs)(be,{className:"text-center pb-4",children:[(0,Co.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Co.jsx)(Nu.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,Co.jsx)(xe,{className:"text-xl",children:"Clone Existing"})]}),(0,Co.jsxs)(ae,{className:"text-center",children:[(0,Co.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize it for your needs."}),(0,Co.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Co.jsx)(Nu.Bot,{className:"h-4 w-4 text-blue-600"}),(0,Co.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Co.jsx)(Nu.Copy,{className:"h-4 w-4 text-blue-600"}),(0,Co.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,Co.jsx)(y,{className:"Nu-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Co.jsxs)(j,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Co.jsxs)(be,{className:"text-center pb-4",children:[(0,Co.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,Co.jsx)(Nu.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,Co.jsx)(xe,{className:"text-xl",children:"Create New"})]}),(0,Co.jsxs)(ae,{className:"text-center",children:[(0,Co.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,Co.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Co.jsx)(Nu.Plus,{className:"h-4 w-4 text-green-600"}),(0,Co.jsx)("span",{children:"Custom job description"})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Co.jsx)(Nu.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,Co.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,Co.jsx)(y,{className:"Nu-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}var yv=H(require("react")),Xn=H(require("@radix-ui/react-progress"));var qn=yv.forwardRef(({className:e,value:t,...a},o)=>(0,Co.jsx)(Xn.Root,{ref:o,className:m("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,Co.jsx)(Xn.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));qn.displayName=Xn.Root.displayName;function Np({app:e,onOpen:t,onFavorite:a,showProgress:o=!1,className:s}){return(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:s,children:(0,Co.jsxs)(j,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[(0,Co.jsx)(be,{className:"pb-2",children:(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:e.icon}),e.new?(0,Co.jsx)(Z,{className:"rounded-xl bg-amber-500",children:"New"}):(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>a?.(e),children:(0,Co.jsx)(Nu.Star,{className:"h-4 w-4"})})]})}),(0,Co.jsxs)(ae,{className:"pb-2",children:[(0,Co.jsx)(xe,{className:"text-lg",children:e.name}),(0,Co.jsx)(Ko,{children:e.description}),o&&e.progress<100&&(0,Co.jsxs)("div",{className:"Nu-2",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Co.jsx)("span",{children:"Installation"}),(0,Co.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Co.jsx)(qn,{value:e.progress,className:"h-2 Nu-1 rounded-xl"})]})]}),(0,Co.jsx)(vo,{children:(0,Co.jsx)(y,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>t?.(e),children:e.progress<100?"Continue Install":"Open"})})]})})}function Xi({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:s=!0,className:r}){return(0,Co.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[s&&(0,Co.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,Co.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Co.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Co.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,Co.jsx)("div",{className:"divide-y",children:e.map(n=>(0,Co.jsxs)(Ti.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(n),children:[(0,Co.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Co.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted",children:n.icon}),(0,Co.jsx)("div",{children:(0,Co.jsx)("p",{className:"font-medium",children:n.name})})]}),(0,Co.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:n.size}),(0,Co.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Co.jsx)("span",{className:"text-sm md:text-base",children:n.modified}),(0,Co.jsxs)("div",{className:"flex gap-1",children:[(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:i=>{i.stopPropagation(),a?.(n)},children:(0,Co.jsx)(Nu.Edit,{className:"h-4 w-4"})}),(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:i=>{i.stopPropagation(),o?.(n)},children:(0,Co.jsx)(Nu.Trash2,{className:"h-4 w-4"})}),(0,Co.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",children:(0,Co.jsx)(Nu.MoreHorizontal,{className:"h-4 w-4"})})]})]})]},n.name))})]})}function Ud({project:e,onOpen:t,onShare:a,className:o}){return(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,Co.jsxs)(j,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Co.jsxs)(be,{children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)(xe,{children:e.name}),(0,Co.jsxs)(Z,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,Co.jsx)(Ko,{children:e.description})]}),(0,Co.jsxs)(ae,{className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Co.jsx)("span",{children:"Progress"}),(0,Co.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Co.jsx)(qn,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Co.jsxs)("div",{className:"flex items-center",children:[(0,Co.jsx)(Nu.Users,{className:"Co-1 h-4 w-4"}),e.members," members"]}),(0,Co.jsxs)("div",{className:"flex items-center",children:[(0,Co.jsx)(Nu.FileText,{className:"Co-1 h-4 w-4"}),e.files," files"]})]})]}),(0,Co.jsxs)(vo,{className:"flex gap-2",children:[(0,Co.jsx)(y,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,Co.jsx)(y,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,Co.jsx)(Nu.Share2,{className:"h-4 w-4"})})]})]})})}var wp=[{name:"PixelMaster",icon:(0,Co.jsx)(Nu.ImageIcon,{className:"text-violet-500"}),description:"Advanced image editing and composition",category:"Creative",recent:!0,new:!1,progress:100},{name:"VectorPro",icon:(0,Co.jsx)(Nu.Brush,{className:"text-orange-500"}),description:"Professional vector graphics creation",category:"Creative",recent:!0,new:!1,progress:100},{name:"VideoStudio",icon:(0,Co.jsx)(Nu.Video,{className:"text-pink-500"}),description:"Cinematic video editing and production",category:"Video",recent:!0,new:!1,progress:100},{name:"MotionFX",icon:(0,Co.jsx)(Nu.Sparkles,{className:"text-blue-500"}),description:"Stunning visual effects and animations",category:"Video",recent:!1,new:!1,progress:100},{name:"PageCraft",icon:(0,Co.jsx)(Nu.Layers,{className:"text-red-500"}),description:"Professional page design and layout",category:"Creative",recent:!1,new:!1,progress:100},{name:"UXFlow",icon:(0,Co.jsx)(Nu.LayoutGrid,{className:"text-fuchsia-500"}),description:"Intuitive user experience design",category:"Design",recent:!1,new:!0,progress:85},{name:"PhotoLab",icon:(0,Co.jsx)(Nu.Camera,{className:"text-teal-500"}),description:"Advanced photo editing and organization",category:"Photography",recent:!1,new:!1,progress:100},{name:"DocMaster",icon:(0,Co.jsx)(Nu.FileText,{className:"text-red-600"}),description:"Document editing and management",category:"Document",recent:!1,new:!1,progress:100},{name:"WebCanvas",icon:(0,Co.jsx)(Nu.Code,{className:"text-emerald-500"}),description:"Web design and development",category:"Web",recent:!1,new:!0,progress:70},{name:"3DStudio",icon:(0,Co.jsx)(Nu.CuboidIcon,{className:"text-indigo-500"}),description:"3D modeling and rendering",category:"3D",recent:!1,new:!0,progress:60},{name:"FontForge",icon:(0,Co.jsx)(Nu.Type,{className:"text-amber-500"}),description:"Typography and font creation",category:"Typography",recent:!1,new:!1,progress:100},{name:"ColorPalette",icon:(0,Co.jsx)(Nu.Palette,{className:"text-purple-500"}),description:"Color scheme creation and management",category:"Design",recent:!1,new:!1,progress:100}],kv=[{name:"Brand Redesign.pxm",app:"PixelMaster",modified:"2 hours ago",icon:(0,Co.jsx)(Nu.ImageIcon,{className:"text-violet-500"}),shared:!0,size:"24.5 MB",collaborators:3},{name:"Company Logo.vec",app:"VectorPro",modified:"Yesterday",icon:(0,Co.jsx)(Nu.Brush,{className:"text-orange-500"}),shared:!0,size:"8.2 MB",collaborators:2},{name:"Product Launch Video.vid",app:"VideoStudio",modified:"3 days ago",icon:(0,Co.jsx)(Nu.Video,{className:"text-pink-500"}),shared:!1,size:"1.2 GB",collaborators:0},{name:"UI Animation.mfx",app:"MotionFX",modified:"Last week",icon:(0,Co.jsx)(Nu.Sparkles,{className:"text-blue-500"}),shared:!0,size:"345 MB",collaborators:4},{name:"Magazine Layout.pgc",app:"PageCraft",modified:"2 weeks ago",icon:(0,Co.jsx)(Nu.Layers,{className:"text-red-500"}),shared:!1,size:"42.8 MB",collaborators:0},{name:"Mobile App Design.uxf",app:"UXFlow",modified:"3 weeks ago",icon:(0,Co.jsx)(Nu.LayoutGrid,{className:"text-fuchsia-500"}),shared:!0,size:"18.3 MB",collaborators:5},{name:"Product Photography.phl",app:"PhotoLab",modified:"Last month",icon:(0,Co.jsx)(Nu.Camera,{className:"text-teal-500"}),shared:!1,size:"156 MB",collaborators:0}];var Sv=[{title:"Mastering Digital Illustration",description:"Learn advanced techniques for creating stunning digital art",duration:"1h 45m",level:"Advanced",instructor:"Sarah Chen",category:"Illustration",views:"24K"},{title:"UI/UX Design Fundamentals",description:"Essential principles for creating intuitive user interfaces",duration:"2h 20m",level:"Intermediate",instructor:"Michael Rodriguez",category:"Design",views:"56K"},{title:"Video Editing Masterclass",description:"Professional techniques for cinematic video editing",duration:"3h 10m",level:"Advanced",instructor:"James Wilson",category:"Video",views:"32K"},{title:"Typography Essentials",description:"Create beautiful and effective typography for any project",duration:"1h 30m",level:"Beginner",instructor:"Emma Thompson",category:"Typography",views:"18K"},{title:"Color Theory for Designers",description:"Understanding color relationships and psychology",duration:"2h 05m",level:"Intermediate",instructor:"David Kim",category:"Design",views:"41K"}];function Pv({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[s,r]=(0,$d.useState)(""),n=(0,$d.useMemo)(()=>e.filter(l=>l.name.toLowerCase().includes(s.toLowerCase())||l.email.toLowerCase().includes(s.toLowerCase())||l.role.toLowerCase().includes(s.toLowerCase())||(l.skills||[]).some(d=>d.toLowerCase().includes(s.toLowerCase()))),[e,s]),i=l=>{t(l)};return(0,Co.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Co.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Co.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Co.jsx)(Nu.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,Co.jsx)("p",{className:"text-muted-foreground",children:"Choose a user Co add as a colleague"})]})]}),(0,Co.jsx)(j,{className:"container",children:(0,Co.jsx)(ae,{className:"Co-6",children:(0,Co.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,Co.jsx)("div",{className:"flex-1",children:(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsx)(Nu.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Co.jsx)(G,{placeholder:"Search users by name, email, role, or skills...",value:s,onChange:l=>r(l.target.value),className:"pl-9"})]})})})})}),(0,Co.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:n.map(l=>(0,Co.jsx)(Ti.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Co.jsxs)(j,{className:`cursor-pointer transition-all hover:shadow-lg ${o===l.id?"ring-2 ring-primary":""}`,onClick:()=>i(l),children:[(0,Co.jsx)(be,{className:"pb-3",children:(0,Co.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Co.jsxs)(yt,{children:[(0,Co.jsx)(aa,{src:l.avatar,alt:l.name}),(0,Co.jsx)(xt,{children:(0,Co.jsx)(Nu.User,{className:"h-4 w-4"})})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(xe,{className:"text-lg",children:l.name}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:l.role})]})]}),o===l.id&&(0,Co.jsx)(Nu.Check,{className:"h-5 w-5 text-primary"})]})}),(0,Co.jsx)(ae,{className:"Co-0",children:(0,Co.jsxs)("div",{className:"space-y-3",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,Co.jsx)("p",{className:"text-sm font-medium",children:l.email})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"}),(0,Co.jsx)(Z,{variant:"secondary",children:l.department})]}),l.location&&(0,Co.jsxs)("div",{children:[(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:"Location"}),(0,Co.jsx)("p",{className:"text-sm",children:l.location})]}),l.skills&&l.skills.length>0&&(0,Co.jsxs)("div",{children:[(0,Co.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Skills"}),(0,Co.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.skills.slice(0,3).map(c=>(0,Co.jsx)(Z,{variant:"outline",className:"text-Nu",children:c},c)),l.skills.length>3&&(0,Co.jsxs)(Z,{variant:"outline",className:"text-Nu",children:["+",l.skills.length-3]})]})]})]})})]})},l.id))}),n.length===0&&(0,Co.jsx)(j,{className:"container Nu-4",children:(0,Co.jsx)(ae,{className:"Co-6",children:(0,Co.jsxs)("div",{className:"text-center py-8",children:[(0,Co.jsx)(Nu.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Co.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Nu users found"}),(0,Co.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function Jn({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:s=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:n,availableUsers:i=[],existingDigitalColleagues:l=[]}){let[c,d]=(0,Zp.useState)(e||[]),[p,u]=(0,Zp.useState)(""),[g,h]=(0,Zp.useState)("all"),[f,b]=(0,Zp.useState)("all"),[C,T]=(0,Zp.useState)("all"),[x,k]=(0,Zp.useState)(null),[S,M]=(0,Zp.useState)(null),[K,A]=(0,Zp.useState)("main"),D=c.filter(L=>{let Pe=L.name.toLowerCase().includes(p.toLowerCase())||L.type==="human"&&(L.email.toLowerCase().includes(p.toLowerCase())||L.role.toLowerCase().includes(p.toLowerCase()))||L.type==="digital"&&L.jobDescription.toLowerCase().includes(p.toLowerCase()),Ye=g==="all"||L.type==="human"&&L.department===g,ta=f==="all"||L.status===f;return Pe&&Ye&&ta}),R=D.filter(L=>L.type==="human"),$=D.filter(L=>L.type==="digital"),w=()=>{A("typeSelection")},I=L=>{L.type==="digital"&&(k(L),A("form"))},P=L=>{L.type==="digital"&&(M(L),A("view"))},X=L=>{let Pe={id:`human-${Date.now()}`,type:"human",name:L.name,email:L.email,role:L.role,department:L.department,phone:L.phone,location:L.location,timezone:L.timezone,skills:L.skills,bio:L.bio,status:"active",joinedDate:new Date,lastActive:new Date};d(Ye=>[...Ye,Pe]),t?.(Pe),A("main")},fe=L=>{d(Pe=>[...Pe,L]),t?.(L),A("main")},_=()=>{k(null),A("form")},de=L=>{x?(d(Pe=>Pe.map(Ye=>Ye.id===L.id?L:Ye)),a?.(L)):(d(Pe=>[...Pe,L]),t?.(L)),A("main"),k(null)},Te=()=>{A("main"),k(null),M(null)},U=()=>{A("main"),M(null)},J=()=>{S&&(k(S),M(null),A("form"))},W=L=>{d(Pe=>Pe.filter(Ye=>Ye.id!==L)),o?.(L)},q=()=>{u(""),h("all"),b("all")},Qe=()=>{let L=[];return l.forEach(Ye=>{L.push(...Ye.knowledge,...Ye.coreKnowledge)}),c.forEach(Ye=>{Ye.type==="digital"&&L.push(...Ye.knowledge,...Ye.coreKnowledge)}),L.filter((Ye,ta,Aa)=>ta===Aa.findIndex(La=>La.id===Ye.id))};return K==="typeSelection"?(0,Co.jsx)(jd,{onSelectHuman:()=>A("userSelection"),onSelectDigital:()=>A("digitalOptions"),onCancel:()=>A("main")}):K==="userSelection"?(0,Co.jsx)(Pv,{users:i,onUserSelect:X,onCancel:()=>A("typeSelection")}):K==="digitalOptions"?(0,Co.jsx)(Od,{onCloneExisting:()=>A("digitalClone"),onCreateNew:_,onCancel:()=>A("typeSelection")}):K==="digitalClone"?(0,Co.jsx)(Hd,{digitalColleagues:l,onColleagueClone:fe,onCancel:()=>A("digitalOptions")}):K==="form"?(0,Co.jsx)(_n,{colleague:x||void 0,onSave:de,onCancel:Te,availableKnowledgeDocuments:Qe()}):K==="view"?(0,Co.jsx)(_n,{colleague:S||void 0,onSave:de,onCancel:U,readOnly:!0,availableKnowledgeDocuments:Qe()}):(0,Co.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsx)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Co.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,Co.jsx)(Lt,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-Co-r from-green-600 via-emerald-600 Co-teal-600",primaryAction:{label:"Add colleague",onClick:w}}),(0,Co.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,Co.jsxs)(j,{children:[(0,Co.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Co.jsx)(xe,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,Co.jsx)(Nu.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Co.jsxs)(ae,{children:[(0,Co.jsx)("div",{className:"text-2xl font-bold",children:c.length}),(0,Co.jsxs)("p",{className:"text-Nu text-muted-foreground",children:[c.filter(L=>L.status==="active").length," active"]})]})]}),(0,Co.jsxs)(j,{children:[(0,Co.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Co.jsx)(xe,{className:"text-sm font-medium",children:"Human Members"}),(0,Co.jsx)(Nu.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Co.jsxs)(ae,{children:[(0,Co.jsx)("div",{className:"text-2xl font-bold",children:c.filter(L=>L.type==="human").length}),(0,Co.jsxs)("p",{className:"text-Nu text-muted-foreground",children:[c.filter(L=>L.type==="human"&&L.status==="active").length," active"]})]})]}),(0,Co.jsxs)(j,{children:[(0,Co.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Co.jsx)(xe,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,Co.jsx)(Nu.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Co.jsxs)(ae,{children:[(0,Co.jsx)("div",{className:"text-2xl font-bold",children:c.filter(L=>L.type==="digital").length}),(0,Co.jsxs)("p",{className:"text-Nu text-muted-foreground",children:[c.filter(L=>L.type==="digital"&&L.status==="active").length," active"]})]})]})]}),(0,Co.jsx)(j,{children:(0,Co.jsx)(ae,{className:"Co-6",children:(0,Co.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Co.jsx)("div",{className:"flex-1",children:(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsx)(Nu.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Co.jsx)(G,{placeholder:"Search colleagues...",value:p,onChange:L=>u(L.target.value),className:"pl-9"})]})}),(0,Co.jsxs)(Le,{value:g,onValueChange:h,children:[(0,Co.jsx)(Ae,{className:"w-full md:w-[180px]",children:(0,Co.jsx)(We,{placeholder:"Department"})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"all",children:"All Departments"}),r.map(L=>(0,Co.jsx)(Q,{value:L,children:L},L))]})]}),(0,Co.jsxs)(Le,{value:f,onValueChange:b,children:[(0,Co.jsx)(Ae,{className:"w-full md:w-[140px]",children:(0,Co.jsx)(We,{placeholder:"Status"})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"all",children:"All Status"}),(0,Co.jsx)(Q,{value:"active",children:"Active"}),(0,Co.jsx)(Q,{value:"inactive",children:"Inactive"})]})]}),(p||g!=="all"||f!=="all")&&(0,Co.jsxs)(y,{variant:"outline",onClick:q,className:"gap-2",children:[(0,Co.jsx)(Nu.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsx)(ti,{activeTab:C,onTabChange:T,tabOptions:[{value:"all",label:`All (${D.length})`},{value:"human",label:`Human (${R.length})`},{value:"digital",label:`Digital (${$.length})`}],maxWidth:"400px",gridCols:3}),C==="all"&&(0,Co.jsx)("div",{className:`grid gap-4 ${s?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:D.map(L=>(0,Co.jsx)(Vi,{colleague:L,onEdit:I,onDelete:W,onViewDetails:P,compact:s},L.id))}),C==="human"&&(0,Co.jsx)("div",{className:`grid gap-4 ${s?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:R.map(L=>(0,Co.jsx)(Vi,{colleague:L,onEdit:I,onDelete:W,onViewDetails:P,compact:s},L.id))}),C==="digital"&&(0,Co.jsx)("div",{className:`grid gap-4 ${s?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:$.map(L=>(0,Co.jsx)(Vi,{colleague:L,onEdit:I,onDelete:W,onViewDetails:P,compact:s},L.id))})]}),D.length===0&&(0,Co.jsx)(j,{children:(0,Co.jsx)(ae,{className:"Co-6",children:(0,Co.jsxs)("div",{className:"text-center py-8",children:[(0,Co.jsx)(Nu.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Co.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Nu colleagues found"}),(0,Co.jsx)("p",{className:"text-muted-foreground mb-4",children:p||g!=="all"||f!=="all"?"Try adjusting your filters Co see more results.":"Get started by adding your first colleague."}),(0,Co.jsxs)(y,{onClick:w,className:"gap-2",children:[(0,Co.jsx)(Nu.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}function _d({document:e,onSave:t,onCancel:a,availableDocuments:o=[],knowledgeContexts:s=[]}){let[r,n]=(0,Zp.useState)({...e,updatedAt:new Date}),[i,l]=(0,Zp.useState)(!1),[c,d]=(0,Zp.useState)(!1),p=()=>{let x=new Set,k=new Set;return s.forEach(S=>{S.menuConfig.groupBy.forEach(M=>x.add(M))}),o.forEach(S=>{S.metadata&&Object.keys(S.metadata).forEach(M=>k.add(M))}),{contextKeys:Array.from(x).sort(),documentKeys:Array.from(k).sort(),allKeys:Array.from(new Set([...x,...k])).sort()}},u=x=>{let k=new Set;return o.forEach(S=>{S.metadata?.[x]&&k.add(String(S.metadata[x]))}),Array.from(k).sort()},g=p(),h=()=>{t(r)},f=(x,k)=>{n(S=>({...S,metadata:{...S.metadata,[x]:k}}))},b=(x,k)=>{k==="__custom__"?f(x,""):f(x,k)},C=()=>{let x=`field_${Date.now()}`;f(x,"")},T=x=>{n(k=>{let S={...k.metadata};return delete S[x],{...k,metadata:S}})};return(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Co.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,Co.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-6",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,Co.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-primary/10 border border-primary/20",children:(0,Co.jsx)(Nu.Edit3,{className:"h-6 w-6 text-primary"})}),(0,Co.jsx)("div",{className:"flex-1 min-w-0",children:c?(0,Co.jsx)(G,{value:r.title,onChange:x=>n(k=>({...k,title:x.target.value})),onBlur:()=>d(!1),onKeyDown:x=>{x.key==="Enter"&&d(!1),x.key==="Escape"&&(n(k=>({...k,title:e.title})),d(!1))},autoFocus:!0,className:"text-xl font-bold border-none p-0 h-auto bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0",placeholder:"Document title..."}):(0,Co.jsxs)("div",{className:"flex items-center gap-2 group",children:[(0,Co.jsx)("h1",{className:"text-xl font-bold text-foreground cursor-pointer hover:text-primary transition-colors py-1",onClick:()=>d(!0),title:"Click Co edit title",children:r.title||"Untitled Document"}),(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>d(!0),className:"opacity-0 group-hover:opacity-100 transition-opacity h-6 w-6 p-0",children:(0,Co.jsx)(Nu.Edit3,{className:"h-3 w-3"})})]})})]}),(0,Co.jsxs)("div",{className:"flex gap-2",children:[(0,Co.jsxs)(y,{variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[(0,Co.jsx)(Nu.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Co.jsxs)(y,{size:"sm",onClick:h,className:"gap-2",children:[(0,Co.jsx)(Nu.Save,{className:"h-4 w-4"}),"Save Changes"]})]})]}),(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)("label",{className:"block text-sm font-medium text-foreground mb-1",children:"Description"}),(0,Co.jsx)(G,{value:r.description||"",onChange:x=>n(k=>({...k,description:x.target.value})),placeholder:"Brief description...",className:"text-sm"})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsxs)("button",{type:"button",onClick:()=>l(!i),className:"flex items-center justify-between w-full p-3 bg-muted/20 hover:bg-muted/30 rounded-lg border border-border transition-colors",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[i?(0,Co.jsx)(Nu.ChevronDown,{className:"h-4 w-4 text-muted-foreground"}):(0,Co.jsx)(Nu.ChevronRight,{className:"h-4 w-4 text-muted-foreground"}),(0,Co.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Metadata"}),r.metadata&&Object.keys(r.metadata).length>0&&(0,Co.jsxs)("span",{className:"text-Nu bg-primary/10 text-primary px-2 py-1 rounded-full",children:[Object.keys(r.metadata).length," field",Object.keys(r.metadata).length!==1?"s":""]})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[g.contextKeys.length>0&&!i&&(0,Co.jsxs)("span",{className:"text-Nu text-muted-foreground",children:[g.contextKeys.slice(0,2).join(", "),g.contextKeys.length>2&&"..."]}),(0,Co.jsxs)(y,{type:"button",variant:"ghost",size:"sm",onClick:x=>{x.stopPropagation(),C(),l(!0)},className:"gap-1 h-6 px-2",children:[(0,Co.jsx)(Nu.Plus,{className:"h-3 w-3"}),"Add"]})]})]}),i&&(0,Co.jsx)("div",{className:"Nu-3 space-y-2 pl-6",children:r.metadata&&Object.keys(r.metadata).length>0?Object.entries(r.metadata).map(([x,k])=>{let S=u(x);return(0,Co.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Co.jsx)(G,{value:x,onChange:M=>{let K=M.target.value,A=r.metadata?.[x];n(D=>{let R={...D.metadata};return delete R[x],K&&(R[K]=A||""),{...D,metadata:R}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${x}`}),(0,Co.jsx)("datalist",{id:`metadata-keys-${x}`,children:g.allKeys.map(M=>(0,Co.jsx)("option",{value:M},M))}),(0,Co.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),S.length>0?(0,Co.jsxs)(Le,{value:String(k||""),onValueChange:M=>b(x,M),children:[(0,Co.jsx)(Ae,{className:"flex-1 h-8 text-sm",children:(0,Co.jsx)(We,{placeholder:"Value"})}),(0,Co.jsxs)(Ie,{children:[S.map(M=>(0,Co.jsx)(Q,{value:M,children:M},M)),(0,Co.jsx)(Q,{value:"__custom__",children:(0,Co.jsx)("span",{className:"text-muted-foreground text-Nu",children:"Custom..."})})]})]}):(0,Co.jsx)(G,{value:String(k||""),onChange:M=>f(x,M.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Co.jsx)(y,{type:"button",variant:"ghost",size:"sm",onClick:()=>T(x),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,Co.jsx)(Nu.X,{className:"h-3 w-3"})})]},x)}):(0,Co.jsx)("div",{className:"text-center py-3 border border-dashed border-border rounded-lg bg-muted/10",children:(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground",children:"Nu metadata fields yet"})})})]}),(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Format:"}),(0,Co.jsx)(Z,{variant:"secondary",className:"font-mono",children:r.format.toUpperCase()})]})]})]}),(0,Co.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Co.jsxs)("div",{className:"p-8",children:[(0,Co.jsx)("label",{className:"block text-sm font-medium text-foreground mb-4",children:"Content"}),(0,Co.jsx)(st,{value:r.content||"",onChange:x=>n(k=>({...k,content:x.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}var Iv=e=>(0,Co.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:e.replace(/\n/g,"<Nu>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`(.*?)`/g,'<code class="bg-muted px-1 py-0.5 rounded text-sm">$1</code>').replace(/^# (.*$)/Co,'<h1 class="text-2xl font-bold mb-4">$1</h1>').replace(/^## (.*$)/Co,'<h2 class="text-xl font-semibold mb-3">$1</h2>').replace(/^### (.*$)/Co,'<h3 class="text-lg font-medium mb-2">$1</h3>')}}),Tv=e=>(0,Co.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),Sy=e=>(0,Co.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Co.jsx)("div",{className:"bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-lg p-4 mb-4",children:(0,Co.jsxs)("p",{className:"text-amber-800 dark:text-amber-200 text-sm",children:[(0,Co.jsx)("strong",{children:"RichText Renderer:"})," This Co a placeholder. Integrate with @payloadcms/richtext-lexical for full rendering."]})}),(0,Co.jsx)("pre",{className:"text-sm",children:e})]}),Py=e=>(0,Co.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Co.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-4",children:(0,Co.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,Co.jsx)("strong",{children:"MDX Renderer:"})," This Co a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),Iv(e)]});function Kd({document:e,onDocumentUpdate:t,editable:a=!0,renderers:o,availableDocuments:s=[],knowledgeContexts:r=[]}){let[n,i]=(0,Zp.useState)(!1),l=g=>{switch(g){case"markdown":case"mdx":return(0,Co.jsx)(Nu.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,Co.jsx)(Nu.File,{className:"h-6 w-6 text-success"});case"text":return(0,Co.jsx)(Nu.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Co.jsx)(Nu.File,{className:"h-6 w-6 text-muted-foreground"})}},c=g=>{switch(g){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richtext":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},d=(g,h)=>{let f={markdown:Iv,mdx:Py,richtext:Sy,text:Tv},b=o?.[h]||f[h];return b?b(g):Tv(g)},p=g=>{i(!1),t?.(g)},u=()=>{i(!1)};return n?(0,Co.jsx)(_d,{document:e,onSave:p,onCancel:u,availableDocuments:s,knowledgeContexts:r}):(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Co.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,Co.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Co.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,Co.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-muted border border-border",children:l(e.format)}),(0,Co.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Co.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:e.title}),e.description&&(0,Co.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed mb-4",children:e.description})]})]}),a&&(0,Co.jsx)("div",{className:"flex-shrink-0",children:(0,Co.jsxs)(y,{variant:"outline",size:"sm",onClick:()=>i(!0),className:"gap-2",children:[(0,Co.jsx)(Nu.Edit3,{className:"h-4 w-4"}),"Edit"]})})]}),(0,Co.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,Co.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${c(e.format)}`,children:e.format.toUpperCase()}),e.tags?.map(g=>(0,Co.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-muted text-muted-foreground border border-border",children:["#",g]},g))]})]}),(0,Co.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Co.jsxs)("div",{className:"p-8",children:[e.metadata&&Object.keys(e.metadata).length>0&&(0,Co.jsxs)("div",{className:"mb-6",children:[(0,Co.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Metadata"}),(0,Co.jsx)("div",{className:"bg-muted rounded-lg p-3 border border-border",children:(0,Co.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-4 gap-y-1 text-Nu",children:Object.entries(e.metadata).map(([g,h])=>(0,Co.jsxs)("div",{className:"flex gap-1",children:[(0,Co.jsxs)("span",{className:"text-muted-foreground font-medium",children:[g.replace(/([A-Z])/g," $1").trim(),":"]}),(0,Co.jsx)("span",{className:"text-foreground truncate",children:String(h)})]},g))})})]}),(0,Co.jsx)("div",{className:"space-y-4",children:e.content?(0,Co.jsx)("div",{className:"relative",children:(0,Co.jsx)("div",{className:"bg-card border border-border rounded-xl p-6 overflow-hidden",children:d(e.content,e.format)})}):(0,Co.jsxs)("div",{className:"text-center py-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,Co.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,Co.jsx)(Nu.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Co.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"Nu content available"}),(0,Co.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})]})})]})}function Mv({label:e,documents:t,children:a,level:o,onDocumentClick:s,selectedDocumentId:r,showDocumentCount:n=!0}){let[i,l]=(0,Zp.useState)(o===0),c=a&&Object.keys(a).length>0,d=t.length+(a?Object.values(a).reduce((g,h)=>g+h.documents.length,0):0),p=g=>{switch(g){case"markdown":case"mdx":return(0,Co.jsx)(Nu.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richtext":return(0,Co.jsx)(Nu.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,Co.jsx)(Nu.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},u=g=>{let h=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return h[g%h.length]};return(0,Co.jsxs)("div",{className:"space-y-1",children:[(c||t.length>0)&&(0,Co.jsxs)(Ti.motion.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${i?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>l(!i),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Co.jsx)("div",{className:`w-1 h-6 rounded-full ${u(o)}`}),(0,Co.jsx)(Ti.motion.div,{animate:{rotate:i?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,Co.jsx)(Nu.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,Co.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,Co.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,Co.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),n&&d>0&&(0,Co.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,Co.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-Nu font-medium bg-muted text-muted-foreground rounded-full",children:d})})]})]}),(0,Co.jsx)(Ti.motion.div,{initial:!1,animate:{height:i?"auto":0,opacity:i?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Co.jsxs)("div",{className:"Co-2 space-y-1",children:[t.map((g,h)=>(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:h*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${r===g.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${o*20+20}px`},onClick:()=>s?.(g),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Co.jsx)("div",{className:"flex-shrink-0",children:p(g.format)}),(0,Co.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Co.jsx)("p",{className:`text-sm truncate transition-colors ${r===g.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:g.title}),g.description&&(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground truncate Nu-0.5",children:g.description})]}),g.tags&&g.tags.length>0&&(0,Co.jsx)("div",{className:"flex-shrink-0",children:(0,Co.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-Nu font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:g.tags[0]})})]},g.id)),a&&Object.entries(a).map(([g,h])=>(0,Co.jsx)(Mv,{label:g,documents:h.documents,children:h.children,level:o+1,onDocumentClick:s,selectedDocumentId:r,showDocumentCount:n},g))]})})]})}function Wd({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:s,selectedDocumentId:r,className:n,editable:i=!0}){let[l,c]=(0,Zp.useState)(""),[d,p]=(0,Zp.useState)(null),u=(0,Zp.useMemo)(()=>l?e.filter(f=>f.title.toLowerCase().includes(l.toLowerCase())||f.description?.toLowerCase().includes(l.toLowerCase())||f.tags?.some(b=>b.toLowerCase().includes(l.toLowerCase()))||Object.values(f.metadata||{}).some(b=>String(b).toLowerCase().includes(l.toLowerCase()))):e,[e,l]),g=(0,Zp.useMemo)(()=>{let f=(b,C)=>{if(C.length===0)return{};let[T,...x]=C;return b.reduce((S,M)=>{let K=M.metadata?.[T]||"Uncategorized",A=String(K);if(S[A]||(S[A]={documents:[],children:{}}),x.length===0)S[A].documents.push(M);else{let D=f([M],x),R=Object.keys(D)[0];R&&(S[A].children||(S[A].children={}),S[A].children[R]?S[A].children[R].documents.push(...D[R].documents):S[A].children[R]=D[R])}return S},{})};return f(u,t.groupBy)},[u,t.groupBy]),h=f=>{p(f),a?.(f)};return(0,Co.jsxs)("div",{className:`flex h-full ${n||""}`,children:[(0,Co.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,Co.jsx)("div",{className:"p-6 border-b border-border",children:(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,Co.jsx)(Nu.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,Co.jsx)(G,{placeholder:"Search knowledge base...",value:l,onChange:f=>c(f.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,Co.jsx)(Yt,{className:"h-[calc(100%-100px)]",children:(0,Co.jsxs)("div",{className:"p-4 space-y-3",children:[Object.entries(g).map(([f,b])=>(0,Co.jsx)(Mv,{label:f,documents:b.documents,children:b.children,level:0,onDocumentClick:h,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},f)),Object.keys(g).length===0&&(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,Co.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,Co.jsx)(Nu.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Co.jsx)("p",{className:"text-sm font-medium",children:"Nu documents found"}),(0,Co.jsx)("p",{className:"text-Nu Nu-1",children:"Try adjusting your search terms"})]})]})})]}),(0,Co.jsx)("div",{className:"flex-1 bg-background",children:d?(0,Co.jsx)(Kd,{document:d,onDocumentUpdate:s,editable:i}):(0,Co.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,Co.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,Co.jsx)(Nu.FileText,{className:"h-10 w-10 text-primary"})}),(0,Co.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,Co.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base Co view its content and details"})]})})})]})}function Qn({documents:e=[],contexts:t=[],onDocumentClick:a=n=>console.log("Document clicked:",n),onDocumentShare:o=n=>console.log("Share document:",n),onLoadDocumentContent:s,selectedDocumentId:r}){let[n,i]=(0,Zp.useState)(t[0]);return!t||t.length===0?(0,Co.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Co.jsx)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:(0,Co.jsx)(Lt,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-Co-r from-teal-600 via-cyan-600 Co-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}})}),(0,Co.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,Co.jsx)("p",{className:"text-muted-foreground",children:"Nu contexts available"})})]}):(0,Co.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[(0,Co.jsx)(Lt,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-Co-r from-teal-600 via-cyan-600 Co-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}}),(0,Co.jsxs)("div",{className:"Nu-6",children:[(0,Co.jsx)("div",{className:"border-b border-border",children:(0,Co.jsx)("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:t.map(l=>(0,Co.jsxs)("button",{onClick:()=>i(l),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${n.id===l.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[l.icon,l.label]},l.id))})}),n.description&&(0,Co.jsx)("div",{className:"Nu-3 px-1",children:(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:n.description})})]})]}),(0,Co.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,Co.jsx)("div",{className:"h-full rounded-3xl border overflow-hidden",children:(0,Co.jsx)(Wd,{documents:e,menuConfig:n.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:r})})})]})}function kp({title:e="Digital Colleagues",businessUnits:t}){let[a,o]=(0,Zp.useState)("home"),[s,r]=(0,Zp.useState)(t[0]),n=C=>{console.log("Opening app:",C.name)},i=C=>{console.log("Favoriting app:",C.name)},l=C=>{console.log("Opening file:",C.name)},c=C=>{console.log("Sharing file:",C.name)},d=C=>{console.log("Opening project:",C.name)},p=C=>{console.log("Sharing project:",C.name)},u=C=>{r(C),console.log("Business unit changed Co:",C.name)},g=()=>{console.log("Copilot clicked - navigating Co chat"),o("chat")},h=C=>{console.log("Notification removed:",C)},f=()=>{console.log("All notifications removed")},b=()=>{switch(a){case"home":return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsxs)("section",{className:"text-center py-12",children:[(0,Co.jsxs)("h1",{className:"text-4xl font-bold mb-4",children:["Welcome Co the ",s.name," team"]}),(0,Co.jsx)("p",{className:"text-xl text-muted-foreground mb-8",children:"This Co your collaborative workspace for productivity and knowledge sharing."})]}),(0,Co.jsxs)("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,Co.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Co.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Projects"}),(0,Co.jsx)("p",{className:"text-3xl font-bold text-primary",children:"12"}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),(0,Co.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Co.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Team Members"}),(0,Co.jsx)("p",{className:"text-3xl font-bold text-primary",children:"8"}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),(0,Co.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Co.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Files"}),(0,Co.jsx)("p",{className:"text-3xl font-bold text-primary",children:"156"}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),(0,Co.jsx)(Lt,{title:"Chat with your team",gradient:"bg-gradient-Co-r from-pink-600 via-red-600 Co-orange-600",primaryAction:{label:"Go",onClick:()=>o("chat")}})]});case"colleagues":return(0,Co.jsx)(Jn,{});case"chat":return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsxs)("section",{className:"text-center py-12",children:[(0,Co.jsx)("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),(0,Co.jsxs)("p",{className:"text-xl text-muted-foreground mb-8",children:["Connect with your ",s.name," team members and collaborate in real-time."]})]}),(0,Co.jsx)(Lt,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-Co-r from-blue-600 via-purple-600 Co-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return(0,Co.jsxs)("div",{className:"space-y-8",children:[(0,Co.jsx)(Lt,{title:"Creative Apps Collection",description:"Discover our full suite of professional design and creative applications.",gradient:"bg-gradient-Co-r from-pink-600 via-red-600 Co-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),(0,Co.jsxs)("section",{className:"space-y-4",children:[(0,Co.jsx)("h2",{className:"text-2xl font-semibold",children:"New Releases"}),(0,Co.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:wp.filter(C=>C.new).map(C=>(0,Co.jsx)(Np,{app:C,showProgress:!0,onOpen:n,onFavorite:i},C.name))})]}),(0,Co.jsxs)("section",{className:"space-y-4",children:[(0,Co.jsx)("h2",{className:"text-2xl font-semibold",children:"All Apps"}),(0,Co.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:wp.map(C=>(0,Co.jsx)(Np,{app:C,onOpen:n,onFavorite:i},C.name))})]})]});case"knowledge":return(0,Co.jsx)(Qn,{});case"files":return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsx)(Lt,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-Co-r from-teal-600 via-cyan-600 Co-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),(0,Co.jsxs)("section",{className:"space-y-4",children:[(0,Co.jsx)("div",{className:"flex items-center justify-between",children:(0,Co.jsx)("h2",{className:"text-2xl font-semibold",children:"All Files"})}),(0,Co.jsx)(Xi,{files:kv,onFileClick:l})]})]});case"projects":return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsx)(Lt,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-Co-r from-purple-600 via-violet-600 Co-indigo-600",primaryAction:{label:"New Project",onClick:()=>console.log("New project clicked")}}),(0,Co.jsxs)("section",{className:"space-y-4",children:[(0,Co.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Co.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:Yf.map(C=>(0,Co.jsx)(Ud,{project:C,onOpen:d,onShare:p},C.name))})]})]});case"learn":return(0,Co.jsxs)("div",{className:"space-y-8",children:[(0,Co.jsx)(Lt,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-Co-r from-green-600 via-emerald-600 Co-teal-600",primaryAction:{label:"Upgrade Co Pro",onClick:()=>console.log("Upgrade Co pro clicked")}}),(0,Co.jsxs)("section",{className:"space-y-4",children:[(0,Co.jsx)("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),(0,Co.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",children:Sv.slice(0,3).map(C=>(0,Co.jsxs)("div",{className:"rounded-3xl border p-6",children:[(0,Co.jsx)("h3",{className:"font-semibold mb-2",children:C.title}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:C.description}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Co.jsx)("span",{children:C.duration}),(0,Co.jsx)("span",{children:C.level})]})]},C.title))})]})]});default:return null}};return(0,Co.jsx)(Hi,{sidebarItems:Wf,title:e,notifications:Xf,businessUnits:t,currentBusinessUnit:s,onBusinessUnitChange:u,activeTab:a,onTabChange:o,showTabs:!0,onActionClick:g,actionIcon:(0,Co.jsx)(Nu.Bot,{className:"Co-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:h,onRemoveAll:f,children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsx)(Ti.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:b()},a)})})}function el({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:s,compactView:r=!1,className:n}){let[i,l]=(0,Zp.useState)(e),[c,d]=(0,Zp.useState)(""),[p,u]=(0,Zp.useState)("all"),[g,h]=(0,Zp.useState)("all"),f=Array.from(new Set(i.map(A=>A.app))),b=i.filter(A=>{let D=A.name.toLowerCase().includes(c.toLowerCase()),R=p==="all"||A.app===p;return D&&R}),C=b.slice(0,10),T=b.filter(A=>A.shared),x=()=>{console.log("Add file clicked")},k=A=>{console.log("Edit file:",A.name),a?.(A)},S=A=>{l(D=>D.filter(R=>R.name!==A.name)),o?.(A.name)},M=A=>{console.log("File clicked:",A.name),s?.(A)},K=()=>{d(""),u("all")};return(0,Co.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsx)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Co.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,Co.jsx)(Lt,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-Co-r from-blue-600 via-indigo-600 Co-purple-600",primaryAction:{label:"Upload file",onClick:x},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,Co.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,Co.jsxs)(j,{children:[(0,Co.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Co.jsx)(xe,{className:"text-sm font-medium",children:"Total Files"}),(0,Co.jsx)(Nu.File,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Co.jsxs)(ae,{children:[(0,Co.jsx)("div",{className:"text-2xl font-bold",children:i.length}),(0,Co.jsxs)("p",{className:"text-Nu text-muted-foreground",children:[i.filter(A=>A.shared).length," shared"]})]})]}),(0,Co.jsxs)(j,{children:[(0,Co.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Co.jsx)(xe,{className:"text-sm font-medium",children:"Storage Used"}),(0,Co.jsx)(Nu.File,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Co.jsxs)(ae,{children:[(0,Co.jsx)("div",{className:"text-2xl font-bold",children:"2.4 GB"}),(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground",children:"of 10 GB used"})]})]}),(0,Co.jsxs)(j,{children:[(0,Co.jsxs)(be,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Co.jsx)(xe,{className:"text-sm font-medium",children:"Recent Activity"}),(0,Co.jsx)(Nu.File,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Co.jsxs)(ae,{children:[(0,Co.jsx)("div",{className:"text-2xl font-bold",children:"12"}),(0,Co.jsx)("p",{className:"text-Nu text-muted-foreground",children:"files modified today"})]})]})]}),(0,Co.jsx)(j,{children:(0,Co.jsx)(ae,{className:"Co-6",children:(0,Co.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Co.jsx)("div",{className:"flex-1",children:(0,Co.jsxs)("div",{className:"relative",children:[(0,Co.jsx)(Nu.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Co.jsx)(G,{placeholder:"Search files...",value:c,onChange:A=>d(A.target.value),className:"pl-9"})]})}),(0,Co.jsxs)(Le,{value:p,onValueChange:u,children:[(0,Co.jsx)(Ae,{className:"w-full md:w-[180px]",children:(0,Co.jsx)(We,{placeholder:"Filter by app"})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"all",children:"All Apps"}),f.map(A=>(0,Co.jsx)(Q,{value:A,children:A},A))]})]}),(c||p!=="all")&&(0,Co.jsxs)(y,{variant:"outline",onClick:K,className:"gap-2",children:[(0,Co.jsx)(Nu.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsx)(ti,{activeTab:g,onTabChange:h,tabOptions:[{value:"all",label:`All Files (${b.length})`},{value:"recent",label:`Recent (${C.length})`},{value:"shared",label:`Shared (${T.length})`}],maxWidth:"500px",gridCols:3}),g==="all"&&(0,Co.jsx)(Xi,{files:b,onFileClick:M,onFileEdit:k,onFileDelete:S,showHeader:!r}),g==="recent"&&(0,Co.jsx)(Xi,{files:C,onFileClick:M,onFileEdit:k,onFileDelete:S,showHeader:!r}),g==="shared"&&(0,Co.jsx)(Xi,{files:T,onFileClick:M,onFileEdit:k,onFileDelete:S,showHeader:!r})]}),b.length===0&&(0,Co.jsx)(j,{children:(0,Co.jsx)(ae,{className:"Co-6",children:(0,Co.jsxs)("div",{className:"text-center py-8",children:[(0,Co.jsx)(Nu.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Co.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Nu files found"}),(0,Co.jsx)("p",{className:"text-muted-foreground mb-4",children:c||p!=="all"?"Try adjusting your filters Co see more results.":"Get started by uploading your first file."}),(0,Co.jsxs)(y,{onClick:x,className:"gap-2",children:[(0,Co.jsx)(Nu.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")})})}var Ev=({title:e,status:t,taskCount:a,children:o,onDrop:s,isCompact:r=!1})=>{let n=c=>{c.preventDefault()},i=c=>{c.preventDefault(),s(t)};return(0,Co.jsxs)(j,{className:`p-4 bg-card border-l-4 ${(()=>{switch(t){case"todo":return"border-l-gray-400";case"in-progress":return"border-l-blue-500";case"review":return"border-l-orange-500";case"done":return"border-l-green-500";default:return"border-l-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 ${r?"lg:max-w-Nu":""}`,onDragOver:n,onDrop:i,children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,Co.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,Co.jsx)(Z,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,Co.jsx)("div",{className:"space-y-4 min-h-[200px]",children:o})]})};var Yd=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:s=!1})=>{let r=d=>{a(e)},n=()=>{o(e)},i=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},l=()=>{switch(e.type){case"story":return(0,Co.jsx)(Nu.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Co.jsx)(Nu.Bug,{className:"h-3 w-3"});case"spike":return(0,Co.jsx)(Nu.Zap,{className:"h-3 w-3"});case"task":default:return(0,Co.jsx)(Nu.AlertCircle,{className:"h-3 w-3"})}},c=()=>{switch(e.type){case"story":return"bg-primary/20 text-primary";case"bug":return"bg-destructive/20 text-destructive";case"spike":return"bg-accent/20 text-accent";case"task":default:return"bg-muted text-muted-foreground"}};return s?(0,Co.jsx)(j,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:r,onClick:n,children:(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-Nu font-medium ${c()}`,children:l()}),(0,Co.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.title})]})}):(0,Co.jsxs)(j,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:r,onClick:n,children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Co.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${c()}`,children:[l(),(0,Co.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Co.jsxs)("div",{className:"flex gap-1",children:[(0,Co.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-Nu font-medium ${i()}`,children:e.priority}),(0,Co.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-Nu font-medium",children:e.points})]})]}),(0,Co.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.title}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Co.jsx)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:(0,Co.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Co.jsx)(Nu.User,{className:"h-4 w-4"}),(0,Co.jsx)("span",{children:e.assignee})]})})]})};var Dy=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Nu.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Nu.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Nu.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Nu.Zap}],Ty=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}],Jd=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:s,defaultEpicId:r})=>{let[n,i]=(0,Zp.useState)({title:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""});(0,Zp.useEffect)(()=>{e&&r&&i(d=>({...d,epicId:r}))},[e,r]),(0,Zp.useEffect)(()=>{e&&i({title:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""})},[e]);let l=d=>{d.preventDefault(),n.title.trim()&&n.epicId&&(a({title:n.title.trim(),description:n.description.trim(),status:"todo",priority:n.priority,type:n.type,points:n.points,epicId:n.epicId,sprintId:n.sprintId==="none"?void 0:n.sprintId,assignee:n.assignee.trim()||"Unassigned"}),i({title:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""}),t())},c=(d,p)=>{i(u=>({...u,[d]:p}))};return(0,Co.jsx)(Bt,{open:e,onOpenChange:t,children:(0,Co.jsxs)(Dt,{className:"sm:max-w-md",children:[(0,Co.jsx)(Ft,{children:(0,Co.jsx)(zt,{children:"Add New Task"})}),(0,Co.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"title",children:"Task Title"}),(0,Co.jsx)(G,{id:"title",value:n.title,onChange:d=>c("title",d.target.value),placeholder:"Enter task title",required:!0})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"description",children:"Description"}),(0,Co.jsx)(st,{id:"description",value:n.description,onChange:d=>c("description",d.target.value),placeholder:"Enter task description",rows:3})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Type"}),(0,Co.jsx)(Rr,{type:"single",value:n.type,onValueChange:d=>d&&c("type",d),children:Dy.map(d=>{let p=d.icon;return(0,Co.jsxs)(Ar,{value:d.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,Co.jsx)(p,{className:"h-4 w-4"}),d.label]},d.value)})})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Priority"}),(0,Co.jsx)(Rr,{type:"single",value:n.priority,onValueChange:d=>d&&c("priority",d),children:Ty.map(d=>(0,Co.jsx)(Ar,{value:d.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:d.label},d.value))})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"points",children:"Story Points"}),(0,Co.jsx)(G,{id:"points",type:"number",min:"1",max:"100",value:n.points,onChange:d=>c("points",parseInt(d.target.value)||1),placeholder:"Enter story points",required:!0})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"epic",children:"Epic"}),(0,Co.jsxs)(Le,{value:n.epicId,onValueChange:d=>c("epicId",d),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select an epic"})}),(0,Co.jsx)(Ie,{children:o.map(d=>(0,Co.jsx)(Q,{value:d.id,children:(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.name]})},d.id))})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Co.jsxs)(Le,{value:n.sprintId,onValueChange:d=>c("sprintId",d),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select a sprint"})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"none",children:"Nu Sprint"}),s.map(d=>(0,Co.jsx)(Q,{value:d.id,children:(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[d.name,d.isActive&&(0,Co.jsx)("span",{className:"text-Nu bg-green-100 text-green-800 px-1 rounded",children:"Active"})]})},d.id))]})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"assignee",children:"Assignee"}),(0,Co.jsx)(G,{id:"assignee",value:n.assignee,onChange:d=>c("assignee",d.target.value),placeholder:"Enter assignee name",required:!0})]}),(0,Co.jsxs)(js,{children:[(0,Co.jsx)(y,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Co.jsx)(y,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Qd=({label:e,value:t,onValueChange:a,options:o,showColor:s=!1,disabled:r=!1})=>{let[n,i]=(0,Zp.useState)(!1),l=o.find(d=>d.value===t);return(0,Co.jsxs)("div",{className:"space-y-1",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:e}),(0,Co.jsxs)(Le,{value:t,onValueChange:a,open:n,onOpenChange:d=>{r||i(d)},disabled:r,children:[(0,Co.jsx)(Ae,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Co.jsxs)(Z,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&i(!n),children:[s&&l?.color&&(0,Co.jsx)("div",{className:`w-2 h-2 rounded-full ${l.color} Co-1`}),l?.label||"Select..."]})}),(0,Co.jsx)(Ie,{children:o.map(d=>(0,Co.jsx)(Q,{value:d.value,children:s&&d.color?(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var Ry=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Nu.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Nu.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Nu.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Nu.Zap}],Ay=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}],Iy=[{value:"John Doe",label:"John Doe"},{value:"Jane Smith",label:"Jane Smith"},{value:"Bob Wilson",label:"Bob Wilson"},{value:"Alice Johnson",label:"Alice Johnson"},{value:"Carol Brown",label:"Carol Brown"},{value:"David Lee",label:"David Lee"},{value:"Emma Davis",label:"Emma Davis"},{value:"Frank Miller",label:"Frank Miller"},{value:"Grace Taylor",label:"Grace Taylor"},{value:"Unassigned",label:"Unassigned"}],zv=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:s,onClose:r,onDelete:n,isUpdating:i=!1,isDeleting:l=!1,deleteState:c="idle"})=>{let d=u=>u.split(" ").map(g=>g[0]).join("").toUpperCase(),p=()=>c==="loading"?(0,Co.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Nu gap-1",children:[(0,Co.jsx)(Nu.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):c==="success"?(0,Co.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Nu gap-1",children:[(0,Co.jsx)(Nu.Check,{className:"h-3 w-3"}),"Deleted"]}):c==="error"?(0,Co.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Nu gap-1",children:[(0,Co.jsx)(Nu.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,Co.jsxs)(y,{onClick:n,variant:"destructive",className:"w-full h-8 text-Nu gap-1",disabled:i||l,children:[(0,Co.jsx)(Nu.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Co.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Co.jsxs)("div",{className:"space-y-4",style:{opacity:i?.6:1},children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:"Status"}),(0,Co.jsx)(Qd,{label:"",value:e.status,onValueChange:u=>s("status",u),options:[{value:"todo",label:"Co Co"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:i})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:"Type"}),(0,Co.jsx)(Rr,{type:"single",value:e.type,onValueChange:u=>u&&s("type",u),className:"grid grid-cols-2 gap-1",disabled:i,children:Ry.map(u=>{let g=u.icon;return(0,Co.jsxs)(Ar,{value:u.value,className:"flex items-center gap-1 text-Nu h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:i,children:[(0,Co.jsx)(g,{className:"h-3 w-3"}),u.label]},u.value)})})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:"Priority"}),(0,Co.jsx)(Rr,{type:"single",value:e.priority,onValueChange:u=>u&&s("priority",u),className:"grid grid-cols-3 gap-1",disabled:i,children:Ay.map(u=>(0,Co.jsx)(Ar,{value:u.value,className:"text-Nu h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:i,children:u.label},u.value))})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:"Story Points"}),(0,Co.jsx)("input",{type:"number",min:"1",max:"100",value:e.points||1,onChange:u=>s("points",u.target.value),className:"w-full h-8 px-2 text-Nu border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:i})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:"Epic"}),(0,Co.jsx)(Qd,{label:"",value:e.epicId,onValueChange:u=>s("epicId",u),options:(t||[]).map(u=>({value:u.id,label:u.name,color:u.color})),showColor:!0,disabled:i})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:"Sprint"}),(0,Co.jsx)(Qd,{label:"",value:e.sprintId||"none",onValueChange:u=>s("sprintId",u==="none"?"":u),options:[{value:"none",label:"Nu Sprint"},...(a||[]).map(u=>({value:u.id,label:`${u.name}${u.isActive?" (Active)":""}`}))],disabled:i})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{className:"text-Nu text-muted-foreground",children:"Assignee"}),(0,Co.jsx)(zd,{label:"",value:e.assignee,onValueChange:u=>s("assignee",u),options:Iy,placeholder:"Search team members...",allowCustomValue:!0,disabled:i})]})]}),(0,Co.jsxs)("div",{className:"Nu-auto Co-4 space-y-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(y,{onClick:r,variant:"outline",className:"w-full h-8 text-Nu",disabled:i||l,children:"Close"}),p()]}),(0,Co.jsxs)("div",{className:"Co-4 border-t border-border space-y-2",children:[(0,Co.jsx)("div",{className:"text-Nu text-muted-foreground font-medium mb-2",children:"Information"}),(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("span",{className:"text-Nu text-muted-foreground",children:"Logged By"}),(0,Co.jsxs)("div",{className:"flex items-center gap-1 text-Nu text-muted-foreground",children:[(0,Co.jsx)(Nu.User,{className:"h-3 w-3"}),(0,Co.jsx)("span",{children:"System"})]})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("span",{className:"text-Nu text-muted-foreground",children:"Created"}),(0,Co.jsxs)("div",{className:"flex items-center gap-1 text-Nu text-muted-foreground",children:[(0,Co.jsx)(Nu.Calendar,{className:"h-3 w-3"}),(0,Co.jsx)("span",{children:e.createdAt.toLocaleDateString()})]})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("span",{className:"text-Nu text-muted-foreground",children:"Last Updated"}),(0,Co.jsxs)("div",{className:"flex items-center gap-1 text-Nu text-muted-foreground",children:[(0,Co.jsx)(Nu.Clock,{className:"h-3 w-3"}),(0,Co.jsxs)("span",{children:[o.toLocaleDateString()," at ",o.toLocaleTimeString()]})]})]})]})]})]})};var Zd=({isOpen:e,onClose:t,task:a,epics:o,sprints:s,onUpdateTask:r,onDeleteTask:n})=>{let[i,l]=(0,Zp.useState)(new Date),[c,d]=(0,Zp.useState)("idle"),[p,u]=(0,Zp.useState)("idle"),[g,h]=(0,Zp.useState)([{id:"1",text:"Initial task created and assigned.",author:"System",createdAt:a.createdAt},{id:"2",text:"Started working on the implementation.",author:a.assignee,createdAt:new Date(a.createdAt.getTime()+864e5)}]),f=async(M,K)=>{if(K!==a[M]){d("loading");try{await r(a.id,{[M]:K}),l(new Date),d("success"),setTimeout(()=>d("idle"),1500)}catch{d("error"),setTimeout(()=>d("idle"),3e3)}}},b=async(M,K)=>{if(K!==a[M]){d("loading");try{await r(a.id,{[M]:K}),l(new Date),d("success"),setTimeout(()=>d("idle"),1500)}catch{d("error"),setTimeout(()=>d("idle"),3e3)}}},C=M=>{let K={id:Date.now().toString(),text:M,author:"Current User",createdAt:new Date};h([...g,K])},T=async()=>{u("loading");try{await n(a.id),u("success"),setTimeout(()=>{t(),u("idle")},1e3)}catch{u("error"),setTimeout(()=>u("idle"),3e3)}},x=c!=="loading"&&p!=="loading",k=()=>{x&&t()},S=()=>c==="loading"?(0,Co.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Co.jsx)(Nu.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Co.jsx)("span",{children:"Updating..."})]}):c==="success"?(0,Co.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Co.jsx)(Nu.Check,{className:"h-4 w-4"}),(0,Co.jsx)("span",{children:"Updated successfully"})]}):c==="error"?(0,Co.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Co.jsx)(Nu.X,{className:"h-4 w-4"}),(0,Co.jsx)("span",{children:"Update failed"})]}):null;return(0,Co.jsx)(Bt,{open:e,onOpenChange:k,children:(0,Co.jsxs)(Dt,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Co.jsxs)(Ft,{children:[(0,Co.jsx)(zt,{className:"sr-only",children:a.title}),(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)("div",{className:"flex-1",children:S()}),!x&&(0,Co.jsx)("div",{className:"text-Nu text-muted-foreground",children:"Please wait..."})]})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Co.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Co.jsx)(Ld,{fieldName:"title",value:a.title,label:"",onSave:f,className:"border-b border-border pb-3",disabled:c==="loading"}),(0,Co.jsx)(Ld,{fieldName:"description",value:a.description,label:"Description",multiline:!0,onSave:f,disabled:c==="loading"}),(0,Co.jsx)(fp,{comments:g,onAddComment:C})]}),(0,Co.jsx)(zv,{task:a,epics:o,sprints:s,lastUpdated:i,onUpdateTask:b,onClose:k,onDelete:T,isUpdating:c==="loading",isDeleting:p==="loading",deleteState:p})]})]})})};var ec=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,s]=(0,Zp.useState)({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("T")[0],endDate:new Date().toISOString().split("T")[0],progress:0}),r=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],n=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],i=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],l=d=>{d.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:new Date(o.startDate),endDate:new Date(o.endDate),progress:o.progress,isSelected:!0}),s({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("T")[0],endDate:new Date().toISOString().split("T")[0],progress:0}),t())},c=(d,p)=>{s(u=>({...u,[d]:p}))};return(0,Co.jsx)(Bt,{open:e,onOpenChange:t,children:(0,Co.jsxs)(Dt,{className:"sm:max-w-md",children:[(0,Co.jsx)(Ft,{children:(0,Co.jsx)(zt,{children:"Add New Epic"})}),(0,Co.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"name",children:"Epic Name"}),(0,Co.jsx)(G,{id:"name",value:o.name,onChange:d=>c("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"description",children:"Description"}),(0,Co.jsx)(st,{id:"description",value:o.description,onChange:d=>c("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Color"}),(0,Co.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(d=>(0,Co.jsx)("button",{type:"button",onClick:()=>c("color",d),className:`w-8 h-8 rounded-full ${d} ${o.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Confidence"}),(0,Co.jsxs)(Le,{value:o.confidence,onValueChange:d=>c("confidence",d),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{})}),(0,Co.jsx)(Ie,{children:n.map(d=>(0,Co.jsx)(Q,{value:d.value,children:d.label},d.value))})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Phase"}),(0,Co.jsxs)(Le,{value:o.phase.toString(),onValueChange:d=>c("phase",parseInt(d)),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{})}),(0,Co.jsx)(Ie,{children:i.map(d=>(0,Co.jsx)(Q,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Start Date"}),(0,Co.jsx)(G,{type:"date",value:o.startDate,onChange:d=>c("startDate",d.target.value)})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"End Date"}),(0,Co.jsx)(G,{type:"date",value:o.endDate,onChange:d=>c("endDate",d.target.value)})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Progress (%)"}),(0,Co.jsx)(G,{type:"number",min:"0",max:"100",value:o.progress,onChange:d=>c("progress",parseInt(d.target.value)||0)})]}),(0,Co.jsxs)(js,{children:[(0,Co.jsx)(y,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Co.jsx)(y,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Hv=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialProjects:o=[],onAddTask:s,onUpdateTask:r,onDeleteTask:n,onTaskClick:i,onAddEpic:l})=>{let[c,d]=(0,Zp.useState)(e),[p,u]=(0,Zp.useState)(t),[g,h]=(0,Zp.useState)(a),[f,b]=(0,Zp.useState)(!1),[C,T]=(0,Zp.useState)(!1),[x,k]=(0,Zp.useState)(null),[S,M]=(0,Zp.useState)(null),K=p.filter(U=>U.isSelected).map(U=>U.id),A=g.find(U=>U.isSelected),D=c.filter(U=>{let J=K.includes(U.epicId);return!A||A.id==="all-tasks"?J:A.id==="backlog"?J&&!U.sprintId:J&&U.sprintId===A.id}),R=U=>D.filter(J=>J.status===U),$=U=>{let J={};return p.forEach(W=>{J[W.id]=U.filter(q=>q.epicId===W.id)}),J},w=U=>{M(U)},I=U=>{S&&(d(J=>J.map(W=>W.id===S.id?{...W,status:U}:W)),r?.(S.id,{status:U}),M(null))},P=U=>{let J={...U,id:Date.now().toString(),createdAt:new Date};d(W=>[...W,J]),s?.(U)},X=async(U,J)=>{d(W=>W.map(q=>q.id===U?{...q,...J}:q)),r&&await r(U,J)},fe=async U=>{d(J=>J.filter(W=>W.id!==U)),x?.id===U&&k(null),n&&await n(U)},_=U=>{let J={...U,id:Date.now().toString(),isSelected:!0};u(W=>[...W,J]),l?.(U)},de=U=>{k(U),i?.(U)};return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsx)(Lt,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-Co-r from-purple-600 via-violet-600 Co-indigo-600",primaryAction:{label:"Add task",onClick:()=>b(!0)},secondaryAction:{label:"Add epic",onClick:()=>T(!0)}}),(0,Co.jsx)("div",{className:"flex-1",children:(0,Co.jsxs)("div",{className:"w-full",children:[(0,Co.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[{id:"todo",title:"Co Co",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}].map(U=>{let J=R(U.status),W=$(J);return(0,Co.jsx)(Ev,{title:U.title,status:U.status,taskCount:J.length,onDrop:I,isCompact:U.status==="done",children:K.map(q=>{let Qe=p.find(Pe=>Pe.id===q),L=W[q]||[];return L.length===0?null:(0,Co.jsxs)("div",{className:"mb-6",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Co.jsx)("div",{className:`w-3 h-3 rounded-full ${Qe?.color}`}),(0,Co.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Qe?.name}),(0,Co.jsx)(Z,{variant:"secondary",className:"text-Nu",children:L.length})]})," ",(0,Co.jsx)("div",{className:"space-y-3",children:L.map(Pe=>(0,Co.jsx)(Yd,{task:Pe,epic:Qe,onDragStart:w,onTaskClick:de,isCompact:U.status==="done"},Pe.id))})]},q)})},U.id)})}),(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(Jd,{isOpen:f,onClose:()=>b(!1),onAddTask:P,epics:p,sprints:g}),(0,Co.jsx)(ec,{isOpen:C,onClose:()=>T(!1),onAddEpic:_}),x&&(0,Co.jsx)(Zd,{isOpen:!!x,onClose:()=>k(null),task:x,epics:p,sprints:g,onUpdateTask:X,onDeleteTask:fe})]})]})})]})};var Ov=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:s,onAddTaskToEpic:r,onAddEpic:n,onUpdateEpic:i,onDeleteEpic:l})=>{let[c,d]=(0,Zp.useState)(null),[p,u]=(0,Zp.useState)(null),[g,h]=(0,Zp.useState)({}),f=D=>{d(D)},b=D=>{D.preventDefault()},C=(D,R)=>{D.preventDefault(),c&&c.epicId!==R&&(o(c.id,{epicId:R}),d(null))},T=D=>e.filter(R=>R.epicId===D),x=D=>{u(D.id),h({name:D.name,description:D.description,confidence:D.confidence,phase:D.phase,progress:D.progress})},k=()=>{p&&g.name&&(i(p,g),u(null),h({}))},S=()=>{u(null),h({})},M=D=>{window.confirm("Are you sure you want Co delete this epic? This will also delete all associated tasks.")&&l(D)},K=D=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[D]||`Phase ${D}`,A=D=>{switch(D){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsx)(Lt,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-Co-r from-rose-600 via-pink-600 Co-fuchsia-600",primaryAction:{label:"Add epic",onClick:n}}),(0,Co.jsx)("div",{className:"flex-1",children:(0,Co.jsx)("div",{className:"w-full",children:(0,Co.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:t.map(D=>{let R=T(D.id),$=R.reduce((w,I)=>w+I.points,0);return(0,Co.jsxs)(j,{className:`flex flex-col ${p===D.id?"h-auto":"h-[600px]"} bg-card shadow-sm`,onDragOver:b,onDrop:w=>C(w,D.id),children:[(0,Co.jsx)("div",{className:"p-4 border-b border-border",children:p===D.id?(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Co.jsx)(G,{value:g.name||"",onChange:w=>h({...g,name:w.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Co.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:k,className:"p-1 h-8 w-8",children:(0,Co.jsx)(Nu.Check,{className:"h-4 w-4"})}),(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:S,className:"p-1 h-8 w-8",children:(0,Co.jsx)(Nu.X,{className:"h-4 w-4"})})]})]}),(0,Co.jsx)(st,{value:g.description||"",onChange:w=>h({...g,description:w.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)("label",{className:"text-Nu text-muted-foreground",children:"Confidence"}),(0,Co.jsxs)(Le,{value:g.confidence||D.confidence,onValueChange:w=>h({...g,confidence:w}),children:[(0,Co.jsx)(Ae,{className:"text-Nu",children:(0,Co.jsx)(We,{})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"low",children:"Low"}),(0,Co.jsx)(Q,{value:"medium",children:"Medium"}),(0,Co.jsx)(Q,{value:"high",children:"High"})]})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("label",{className:"text-Nu text-muted-foreground",children:"Phase"}),(0,Co.jsxs)(Le,{value:g.phase?.toString()||D.phase.toString(),onValueChange:w=>h({...g,phase:parseInt(w)}),children:[(0,Co.jsx)(Ae,{className:"text-Nu",children:(0,Co.jsx)(We,{})}),(0,Co.jsx)(Ie,{children:[1,2,3,4,5,6,7,8,9].map(w=>(0,Co.jsxs)(Q,{value:w.toString(),children:["Phase ",w]},w))})]})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)("label",{className:"text-Nu text-muted-foreground",children:"Progress (%)"}),(0,Co.jsx)(G,{type:"number",min:"0",max:"100",value:g.progress||D.progress,onChange:w=>h({...g,progress:parseInt(w.target.value)||0}),className:"text-Nu"})]})]}):(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Co.jsx)("div",{className:`w-4 h-4 rounded-full ${D.color}`}),(0,Co.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:D.name}),(0,Co.jsxs)("div",{className:"flex gap-1",children:[(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>x(D),className:"p-1 h-8 w-8",children:(0,Co.jsx)(Nu.Edit2,{className:"h-3 w-3"})}),(0,Co.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>M(D.id),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Co.jsx)(Nu.Trash2,{className:"h-3 w-3"})})]})]}),(0,Co.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Co.jsxs)(Z,{className:`text-Nu ${A(D.confidence)}`,children:[D.confidence," confidence"]}),(0,Co.jsxs)(Z,{variant:"outline",className:"text-Nu",children:["Phase ",D.phase]}),(0,Co.jsxs)(Z,{variant:"secondary",className:"text-Nu bg-muted text-muted-foreground",children:[R.length," tasks"]}),(0,Co.jsxs)(Z,{variant:"secondary",className:"text-Nu bg-muted text-muted-foreground",children:[$," pts"]})]}),D.description&&(0,Co.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:D.description}),(0,Co.jsxs)("div",{className:"mb-3",children:[(0,Co.jsxs)("div",{className:"flex justify-between text-Nu text-muted-foreground mb-1",children:[(0,Co.jsx)("span",{className:"select-none",children:"Progress"}),(0,Co.jsxs)("span",{className:"select-none",children:[D.progress,"%"]})]}),(0,Co.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,Co.jsx)("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:`${D.progress}%`}})})]}),(0,Co.jsxs)(y,{onClick:()=>r(D.id),variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Co.jsx)(Nu.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Co.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Co.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${c?"border-primary bg-primary/10":"border-border"}`,children:R.length===0?(0,Co.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-muted-foreground border-2 border-dashed border-border rounded-lg",children:[(0,Co.jsx)(Nu.Move,{className:"h-8 w-8 mb-2"}),(0,Co.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):R.map(w=>(0,Co.jsx)(Yd,{task:w,epic:D,onDragStart:f,onTaskClick:s,isCompact:!0},w.id))})})]},D.id)})})})})]})};var $Co=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,s]=(0,Zp.useState)({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),r=i=>{i.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate,endDate:o.endDate,isActive:o.isActive,isSelected:!1}),s({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),t())},n=()=>{s({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),t()};return(0,Co.jsx)(Bt,{open:e,onOpenChange:n,children:(0,Co.jsxs)(Dt,{className:"sm:max-w-md",children:[(0,Co.jsx)(Ft,{children:(0,Co.jsx)(zt,{children:"Add New Sprint"})}),(0,Co.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"name",children:"Sprint Name *"}),(0,Co.jsx)(G,{id:"name",value:o.name,onChange:i=>s(l=>({...l,name:i.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"description",children:"Description"}),(0,Co.jsx)(st,{id:"description",value:o.description,onChange:i=>s(l=>({...l,description:i.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"Start Date *"}),(0,Co.jsxs)(ns,{children:[(0,Co.jsx)(ls,{asChild:!0,children:(0,Co.jsxs)(y,{variant:"outline",className:m("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,Co.jsx)(Nu.CalendarIcon,{className:"Co-2 h-4 w-4"}),o.startDate?(0,Jm.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,Co.jsx)(Ir,{className:"w-auto p-0",align:"start",children:(0,Co.jsx)(ms,{mode:"single",selected:o.startDate,onSelect:i=>s(l=>({...l,startDate:i})),initialFocus:!0})})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{children:"End Date *"}),(0,Co.jsxs)(ns,{children:[(0,Co.jsx)(ls,{asChild:!0,children:(0,Co.jsxs)(y,{variant:"outline",className:m("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,Co.jsx)(Nu.CalendarIcon,{className:"Co-2 h-4 w-4"}),o.endDate?(0,Jm.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,Co.jsx)(Ir,{className:"w-auto p-0",align:"start",children:(0,Co.jsx)(ms,{mode:"single",selected:o.endDate,onSelect:i=>s(l=>({...l,endDate:i})),initialFocus:!0,disabled:i=>o.startDate?i<o.startDate:!1})})]})]})]}),(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)("input",{type:"checkbox",id:"isActive",checked:o.isActive,onChange:i=>s(l=>({...l,isActive:i.target.checked})),className:"rounded border-gray-300"}),(0,Co.jsx)(B,{htmlFor:"isActive",children:"Set as active sprint"})]}),(0,Co.jsxs)("div",{className:"flex justify-end gap-3 Co-4",children:[(0,Co.jsx)(y,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),(0,Co.jsx)(y,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Vv=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:s,onAddSprint:r})=>{let[n,i]=(0,Zp.useState)(["2"]),[l,c]=(0,Zp.useState)(null),[d,p]=(0,Zp.useState)(!1),[u,g]=(0,Zp.useState)(null),h=e.filter(I=>!I.sprintId),f=e.filter(I=>I.sprintId&&n.includes(I.sprintId)),b=[...a].filter(I=>I.id!=="backlog"&&I.id!=="all-tasks").sort((I,P)=>I.startDate.getTime()-P.startDate.getTime()),C=I=>t.find(P=>P.id===I),T=I=>a.find(P=>P.id===I),x=I=>{switch(I){case"high":return"bg-destructive/20 text-destructive";case"medium":return"bg-warning/20 text-warning";case"low":return"bg-success/20 text-success";default:return"bg-muted text-muted-foreground"}},k=I=>I.split(" ").map(P=>P[0]).join("").toUpperCase(),S=I=>{c(I)},M=I=>{I.preventDefault()},K=I=>{g(I)},A=()=>{g(null)},D=(I,P)=>{I.preventDefault(),g(null),l&&(o(l.id,{sprintId:P==="backlog"?void 0:P}),c(null))},R=I=>{I==="backlog"||I==="all-tasks"||i(P=>P.includes(I)?P.filter(X=>X!==I):[...P,I])},$=I=>{r(I),p(!1)},w=({task:I,showSprint:P=!1})=>{let X=C(I.epicId),fe=I.sprintId?T(I.sprintId):null,[_,de]=(0,Zp.useState)(!1),Te=W=>{W.defaultPrevented||_||s(I)},U=W=>{de(!0),S(I)},J=()=>{de(!1)};return(0,Co.jsx)(j,{className:`p-3 cursor-grab transition-all duration-200 hover:shadow-md bg-card border-border hover:border-border/80 active:cursor-grabbing ${_?"opacity-50 shadow-lg scale-105":""} ${l?.id===I.id?"ring-2 ring-primary":""}`,draggable:!0,onDragStart:U,onDragEnd:J,onClick:Te,children:(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Co.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1 select-none pointer-events-none",children:I.title}),(0,Co.jsx)(Z,{className:`text-Nu select-none pointer-events-none ${x(I.priority)}`,children:I.priority[0].toUpperCase()})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-Nu pointer-events-none",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-1",children:[X&&(0,Co.jsx)("div",{className:`w-2 h-2 rounded-full ${X.color}`}),(0,Co.jsx)("span",{className:"text-muted-foreground truncate select-none",children:X?.name})]}),(0,Co.jsx)("span",{className:"text-muted-foreground select-none",children:k(I.assignee)})]}),P&&fe&&(0,Co.jsxs)("div",{className:"flex items-center gap-1 text-Nu text-muted-foreground pointer-events-none",children:[(0,Co.jsx)(Nu.Calendar,{className:"h-3 w-3"}),(0,Co.jsx)("span",{className:"select-none",children:fe.name})]})]})})};return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsx)(Lt,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-Co-r from-orange-600 via-amber-600 Co-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>p(!0)}}),(0,Co.jsx)("div",{className:"flex-1",children:(0,Co.jsxs)("div",{className:"w-full",children:[(0,Co.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:[(0,Co.jsx)("div",{className:"lg:col-span-1",children:(0,Co.jsxs)(j,{className:"p-4 h-full bg-card shadow-sm",onDragOver:M,onDragEnter:()=>K("backlog"),onDragLeave:A,onDrop:I=>D(I,"backlog"),children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,Co.jsx)("h3",{className:"font-semibold text-foreground select-none",children:"Backlog"}),(0,Co.jsx)(Z,{variant:"secondary",className:"bg-muted text-muted-foreground",children:h.length})]}),(0,Co.jsxs)("div",{className:`space-y-3 overflow-y-auto max-h-[600px] min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${u==="backlog"?"border-primary bg-primary/10":"border-border"}`,children:[h.map(I=>(0,Co.jsx)(w,{task:I},I.id)),h.length===0&&(0,Co.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here Co move Co backlog"})]})]})}),(0,Co.jsx)("div",{className:"lg:col-span-3",children:(0,Co.jsxs)("div",{className:"space-y-4",children:[(0,Co.jsxs)(j,{className:"p-4 bg-card shadow-sm",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Co.jsx)("h3",{className:"font-semibold text-foreground select-none",children:"Select Sprints Co View"}),(0,Co.jsxs)(y,{onClick:()=>p(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-2",size:"sm",children:[(0,Co.jsx)(Nu.Plus,{className:"h-4 w-4"}),"Add Sprint"]})]}),(0,Co.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2",children:b.map(I=>(0,Co.jsxs)(y,{variant:n.includes(I.id)?"default":"outline",size:"sm",onClick:()=>R(I.id),className:"text-Nu h-8",children:[I.name,I.isActive&&(0,Co.jsx)("span",{className:"ml-1 text-success",children:"\u25CF"})]},I.id))})]}),(0,Co.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:n.map(I=>b.find(P=>P.id===I)).filter(Boolean).sort((I,P)=>I.startDate.getTime()-P.startDate.getTime()).map(I=>{let P=f.filter(X=>X.sprintId===I.id);return(0,Co.jsxs)(j,{className:"p-4 bg-card shadow-sm",onDragOver:M,onDragEnter:()=>K(I.id),onDragLeave:A,onDrop:X=>D(X,I.id),children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h3",{className:"font-semibold text-foreground select-none",children:I.name}),I.isActive&&(0,Co.jsx)("span",{className:"text-Nu text-success font-medium select-none",children:"Active Sprint"})]}),(0,Co.jsx)(Z,{variant:"secondary",className:"bg-muted text-muted-foreground",children:P.length})]}),(0,Co.jsxs)("div",{className:`space-y-3 overflow-y-auto max-h-[500px] min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${u===I.id?"border-primary bg-primary/10":"border-border"}`,children:[P.map(X=>(0,Co.jsx)(w,{task:X},X.id)),P.length===0&&(0,Co.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})]},I.id)})})," "]})})]}),(0,Co.jsx)($Co,{isOpen:d,onClose:()=>p(!1),onAddSprint:$})]})})]})};var My=e=>{switch(e){case"high":return"\u{1F534}";case"medium":return"\u{1F7E1}";case"low":return"\u{1F7E2}";default:return"\u26AA"}},By=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),Ly=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},Dp=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[s,r]=t.split(":");o.setHours(parseInt(s),parseInt(r))}return o<a},Tp=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Ey=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Fy=({colleagues:e,onAddReminder:t,trigger:a})=>{let[o,s]=(0,Zp.useState)(!1),[r,n]=(0,Zp.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""});return(0,Co.jsxs)(Bt,{open:o,onOpenChange:s,children:[(0,Co.jsx)(xl,{asChild:!0,children:a}),(0,Co.jsxs)(Dt,{className:"max-w-2xl",children:[(0,Co.jsx)(Ft,{children:(0,Co.jsx)(zt,{children:"Add New Reminder"})}),(0,Co.jsxs)("form",{onSubmit:l=>{l.preventDefault();let c=e.find(p=>p.id===r.colleagueId);if(!c)return;let d={title:r.title,description:r.description,dueDate:new Date(r.dueDate),dueTime:r.dueTime||void 0,colleague:c,isCompleted:!1,isRecurring:r.isRecurring,recurrencePattern:r.isRecurring?r.recurrencePattern:void 0,recurrenceInterval:r.isRecurring?r.recurrenceInterval:void 0,priority:r.priority,reminderEnabled:r.reminderEnabled,reminderMinutes:r.reminderEnabled?r.reminderMinutes:void 0,tags:r.tags?r.tags.split(",").map(p=>p.trim()):void 0};t(d),s(!1),n({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})},className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"title",children:"Title"}),(0,Co.jsx)(G,{id:"title",value:r.title,onChange:l=>n({...r,title:l.target.value}),placeholder:"Enter reminder title",required:!0})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"priority",children:"Priority"}),(0,Co.jsxs)(Le,{value:r.priority,onValueChange:l=>n({...r,priority:l}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"low",children:"\u{1F7E2} Low"}),(0,Co.jsx)(Q,{value:"medium",children:"\u{1F7E1} Medium"}),(0,Co.jsx)(Q,{value:"high",children:"\u{1F534} High"})]})]})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"description",children:"Description"}),(0,Co.jsx)(st,{id:"description",value:r.description,onChange:l=>n({...r,description:l.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"dueDate",children:"Due Date"}),(0,Co.jsx)(G,{id:"dueDate",type:"date",value:r.dueDate,onChange:l=>n({...r,dueDate:l.target.value}),required:!0})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Co.jsx)(G,{id:"dueTime",type:"time",value:r.dueTime,onChange:l=>n({...r,dueTime:l.target.value})})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"colleague",children:"Assigned Colleague"}),(0,Co.jsxs)(Le,{value:r.colleagueId,onValueChange:l=>n({...r,colleagueId:l}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select a digital colleague"})}),(0,Co.jsx)(Ie,{children:e.map(l=>(0,Co.jsx)(Q,{value:l.id,children:l.name},l.id))})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:l=>n({...r,isRecurring:l.target.checked}),className:"rounded border-border"}),(0,Co.jsx)(B,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Co.jsxs)(Le,{value:r.recurrencePattern,onValueChange:l=>n({...r,recurrencePattern:l}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"daily",children:"Daily"}),(0,Co.jsx)(Q,{value:"weekly",children:"Weekly"}),(0,Co.jsx)(Q,{value:"monthly",children:"Monthly"}),(0,Co.jsx)(Q,{value:"yearly",children:"Yearly"})]})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Co.jsx)(G,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:l=>n({...r,recurrenceInterval:parseInt(l.target.value)})})]})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)("input",{type:"checkbox",id:"reminderEnabled",checked:r.reminderEnabled,onChange:l=>n({...r,reminderEnabled:l.target.checked}),className:"rounded border-border"}),(0,Co.jsx)(B,{htmlFor:"reminderEnabled",children:"Enable reminder notifications"})]}),r.reminderEnabled&&(0,Co.jsxs)("div",{className:"pl-6",children:[(0,Co.jsx)(B,{htmlFor:"reminderMinutes",children:"Remind Co"}),(0,Co.jsxs)(Le,{value:r.reminderMinutes.toString(),onValueChange:l=>n({...r,reminderMinutes:parseInt(l)}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"5",children:"5 minutes before"}),(0,Co.jsx)(Q,{value:"15",children:"15 minutes before"}),(0,Co.jsx)(Q,{value:"30",children:"30 minutes before"}),(0,Co.jsx)(Q,{value:"60",children:"1 hour before"}),(0,Co.jsx)(Q,{value:"1440",children:"1 day before"})]})]})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"tags",children:"Tags (comma-separated)"}),(0,Co.jsx)(G,{id:"tags",value:r.tags,onChange:l=>n({...r,tags:l.target.value}),placeholder:"e.g., urgent, meeting, follow-up"})]}),(0,Co.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Co.jsx)(y,{type:"button",variant:"outline",onClick:()=>s(!1),children:"Cancel"}),(0,Co.jsx)(y,{type:"submit",children:"Add Reminder"})]})]})]})]})},zy=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:s})=>{let[r,n]=(0,Zp.useState)({title:e.title,description:e.description,dueDate:e.dueDate.toISOString().split("T")[0],dueTime:e.dueTime||"",colleagueId:e.colleague.id,priority:e.priority,isRecurring:e.isRecurring,recurrencePattern:e.recurrencePattern||"weekly",recurrenceInterval:e.recurrenceInterval||1,reminderEnabled:e.reminderEnabled,reminderMinutes:e.reminderMinutes||15,tags:e.tags?.join(", ")||""});return(0,Co.jsx)(Bt,{open:o,onOpenChange:s,children:(0,Co.jsxs)(Dt,{className:"max-w-2xl",children:[(0,Co.jsx)(Ft,{children:(0,Co.jsx)(zt,{children:"Edit Reminder"})}),(0,Co.jsxs)("form",{onSubmit:l=>{l.preventDefault();let c=t.find(p=>p.id===r.colleagueId);if(!c)return;let d={title:r.title,description:r.description,dueDate:new Date(r.dueDate),dueTime:r.dueTime||void 0,colleague:c,isRecurring:r.isRecurring,recurrencePattern:r.isRecurring?r.recurrencePattern:void 0,recurrenceInterval:r.isRecurring?r.recurrenceInterval:void 0,priority:r.priority,reminderEnabled:r.reminderEnabled,reminderMinutes:r.reminderEnabled?r.reminderMinutes:void 0,tags:r.tags?r.tags.split(",").map(p=>p.trim()):void 0};a(e.id,d),s()},className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-title",children:"Title"}),(0,Co.jsx)(G,{id:"edit-title",value:r.title,onChange:l=>n({...r,title:l.target.value}),placeholder:"Enter reminder title",required:!0})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-priority",children:"Priority"}),(0,Co.jsxs)(Le,{value:r.priority,onValueChange:l=>n({...r,priority:l}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"low",children:"\u{1F7E2} Low"}),(0,Co.jsx)(Q,{value:"medium",children:"\u{1F7E1} Medium"}),(0,Co.jsx)(Q,{value:"high",children:"\u{1F534} High"})]})]})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-description",children:"Description"}),(0,Co.jsx)(st,{id:"edit-description",value:r.description,onChange:l=>n({...r,description:l.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Co.jsx)(G,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:l=>n({...r,dueDate:l.target.value}),required:!0})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Co.jsx)(G,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:l=>n({...r,dueTime:l.target.value})})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-colleague",children:"Assigned Colleague"}),(0,Co.jsxs)(Le,{value:r.colleagueId,onValueChange:l=>n({...r,colleagueId:l}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{placeholder:"Select a digital colleague"})}),(0,Co.jsx)(Ie,{children:t.map(l=>(0,Co.jsx)(Q,{value:l.id,children:l.name},l.id))})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring,onChange:l=>n({...r,isRecurring:l.target.checked}),className:"rounded border-border"}),(0,Co.jsx)(B,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-recurrencePattern",children:"Frequency"}),(0,Co.jsxs)(Le,{value:r.recurrencePattern,onValueChange:l=>n({...r,recurrencePattern:l}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"daily",children:"Daily"}),(0,Co.jsx)(Q,{value:"weekly",children:"Weekly"}),(0,Co.jsx)(Q,{value:"monthly",children:"Monthly"}),(0,Co.jsx)(Q,{value:"yearly",children:"Yearly"})]})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-recurrenceInterval",children:"Every"}),(0,Co.jsx)(G,{id:"edit-recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:l=>n({...r,recurrenceInterval:parseInt(l.target.value)})})]})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)("input",{type:"checkbox",id:"edit-reminderEnabled",checked:r.reminderEnabled,onChange:l=>n({...r,reminderEnabled:l.target.checked}),className:"rounded border-border"}),(0,Co.jsx)(B,{htmlFor:"edit-reminderEnabled",children:"Enable reminder notifications"})]}),r.reminderEnabled&&(0,Co.jsxs)("div",{className:"pl-6",children:[(0,Co.jsx)(B,{htmlFor:"edit-reminderMinutes",children:"Remind Co"}),(0,Co.jsxs)(Le,{value:r.reminderMinutes.toString(),onValueChange:l=>n({...r,reminderMinutes:parseInt(l)}),children:[(0,Co.jsx)(Ae,{children:(0,Co.jsx)(We,{})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsx)(Q,{value:"5",children:"5 minutes before"}),(0,Co.jsx)(Q,{value:"15",children:"15 minutes before"}),(0,Co.jsx)(Q,{value:"30",children:"30 minutes before"}),(0,Co.jsx)(Q,{value:"60",children:"1 hour before"}),(0,Co.jsx)(Q,{value:"1440",children:"1 day before"})]})]})]})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsx)(B,{htmlFor:"edit-tags",children:"Tags (comma-separated)"}),(0,Co.jsx)(G,{id:"edit-tags",value:r.tags,onChange:l=>n({...r,tags:l.target.value}),placeholder:"e.g., urgent, meeting, follow-up"})]}),(0,Co.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Co.jsx)(y,{type:"button",variant:"outline",onClick:s,children:"Cancel"}),(0,Co.jsx)(y,{type:"submit",children:"Save Changes"})]})]})]})})},jy=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[s,r]=(0,Zp.useState)(!1),n=Dp(e.dueDate,e.dueTime),i=Tp(e.dueDate),l=Ey(e.dueDate),c=()=>{a(e.id,{isCompleted:!e.isCompleted,completedAt:e.isCompleted?void 0:new Date})},d=()=>i?"Today":l?"Tomorrow":n&&!e.isCompleted?"Overdue":By(e.dueDate);return(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(zy,{reminder:e,colleagues:t,onUpdateReminder:a,open:s,onClose:()=>r(!1)}),(0,Co.jsx)(j,{className:`transition-all duration-200 ${e.isCompleted?"opacity-60":""} ${n&&!e.isCompleted?"border-destructive/50 bg-destructive/5":""}`,children:(0,Co.jsx)(ae,{className:"p-4",children:(0,Co.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Co.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Co.jsx)("button",{onClick:c,className:"Nu-1 text-primary hover:text-primary/80",children:e.isCompleted?(0,Co.jsx)(Nu.CheckCircle,{className:"h-5 w-5"}):(0,Co.jsx)(Nu.Circle,{className:"h-5 w-5"})}),(0,Co.jsxs)("div",{className:"flex-1",children:[(0,Co.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,Co.jsx)("h3",{className:`font-semibold ${e.isCompleted?"line-through text-muted-foreground":""}`,children:e.title}),(0,Co.jsx)("span",{className:"text-sm",children:My(e.priority)}),e.isRecurring&&(0,Co.jsx)(Nu.Repeat,{className:"h-4 w-4 text-primary"}),e.reminderEnabled&&(0,Co.jsx)(Nu.Bell,{className:"h-4 w-4 text-success"})]}),(0,Co.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Co.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Co.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Co.jsx)(Nu.Calendar,{className:"h-4 w-4"}),(0,Co.jsx)("span",{className:n&&!e.isCompleted?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,Co.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Co.jsx)(Nu.Clock,{className:"h-4 w-4"}),(0,Co.jsx)("span",{children:Ly(e.dueTime)})]}),(0,Co.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Co.jsx)(Nu.User,{className:"h-4 w-4"}),(0,Co.jsx)("span",{children:e.colleague.name})]})]}),e.tags&&e.tags.length>0&&(0,Co.jsx)("div",{className:"flex flex-wrap gap-1 Nu-2",children:e.tags.map((p,u)=>(0,Co.jsx)(Z,{variant:"secondary",className:"text-Nu",children:p},u))})]})]}),(0,Co.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 p-0",children:(0,Co.jsx)(Nu.Edit2,{className:"h-4 w-4"})}),(0,Co.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>o(e.id),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Co.jsx)(Nu.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Gv=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:s})=>{let[r,n]=(0,Zp.useState)(e),[i]=(0,Zp.useState)(t),[l,c]=(0,Zp.useState)("all"),[d,p]=(0,Zp.useState)(""),u=T=>{let x={...T,id:Date.now().toString(),createdAt:new Date};n(k=>[...k,x]),a?.(T)},g=(T,x)=>{n(k=>k.map(S=>S.id===T?{...S,...x}:S)),o?.(T,x)},h=T=>{n(x=>x.filter(k=>k.id!==T)),s?.(T)},b=r.filter(T=>{if(d){let x=d.toLowerCase();if(!(T.title.toLowerCase().includes(x)||T.description.toLowerCase().includes(x)||T.colleague.name.toLowerCase().includes(x)||T.tags?.some(S=>S.toLowerCase().includes(x))))return!1}switch(l){case"pending":return!T.isCompleted;case"completed":return T.isCompleted;case"overdue":return!T.isCompleted&&Dp(T.dueDate,T.dueTime);case"today":return Tp(T.dueDate);default:return!0}}).sort((T,x)=>{if(T.isCompleted&&!x.isCompleted)return 1;if(!T.isCompleted&&x.isCompleted)return-1;let k={high:3,medium:2,low:1},S=k[x.priority]-k[T.priority];return S!==0?S:T.dueDate.getTime()-x.dueDate.getTime()}),C={total:r.length,pending:r.filter(T=>!T.isCompleted).length,completed:r.filter(T=>T.isCompleted).length,overdue:r.filter(T=>!T.isCompleted&&Dp(T.dueDate,T.dueTime)).length,today:r.filter(T=>Tp(T.dueDate)).length};return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsx)(Lt,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-Co-r from-emerald-600 via-teal-600 Co-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{let T={title:"New Reminder",description:"Don't forget Co complete this task",dueDate:new Date,dueTime:"09:00",colleague:i[0]||{id:"1",name:"Default Colleague",department:"General",role:"Team Member"},isCompleted:!1,isRecurring:!1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,tags:["reminder"]};u(T)}}}),(0,Co.jsx)("div",{className:"h-full bg-background",children:(0,Co.jsxs)("div",{className:"p-6",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Co.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Co.jsx)(Fy,{colleagues:i,onAddReminder:u,trigger:(0,Co.jsxs)(y,{className:"flex items-center space-x-2",children:[(0,Co.jsx)(Nu.Plus,{className:"h-4 w-4"}),(0,Co.jsx)("span",{children:"Add Reminder"})]})})]}),(0,Co.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Co.jsxs)(j,{className:"p-4",children:[(0,Co.jsx)("div",{className:"text-2xl font-bold text-foreground",children:C.total}),(0,Co.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Co.jsxs)(j,{className:"p-4",children:[(0,Co.jsx)("div",{className:"text-2xl font-bold text-primary",children:C.pending}),(0,Co.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Co.jsxs)(j,{className:"p-4",children:[(0,Co.jsx)("div",{className:"text-2xl font-bold text-success",children:C.completed}),(0,Co.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Co.jsxs)(j,{className:"p-4",children:[(0,Co.jsx)("div",{className:"text-2xl font-bold text-destructive",children:C.overdue}),(0,Co.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Co.jsxs)(j,{className:"p-4",children:[(0,Co.jsx)("div",{className:"text-2xl font-bold text-warning",children:C.today}),(0,Co.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Co.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Co.jsx)("div",{className:"flex-1",children:(0,Co.jsx)(G,{placeholder:"Search reminders...",value:d,onChange:T=>p(T.target.value),className:"max-w-md"})}),(0,Co.jsxs)(Le,{value:l,onValueChange:T=>c(T),children:[(0,Co.jsx)(Ae,{className:"w-40",children:(0,Co.jsx)(We,{})}),(0,Co.jsxs)(Ie,{children:[(0,Co.jsxs)(Q,{value:"all",children:["All (",C.total,")"]}),(0,Co.jsxs)(Q,{value:"pending",children:["Pending (",C.pending,")"]}),(0,Co.jsxs)(Q,{value:"completed",children:["Completed (",C.completed,")"]}),(0,Co.jsxs)(Q,{value:"overdue",children:["Overdue (",C.overdue,")"]}),(0,Co.jsxs)(Q,{value:"today",children:["Today (",C.today,")"]})]})]})]}),(0,Co.jsx)("div",{className:"space-y-4",children:b.length===0?(0,Co.jsxs)(j,{className:"p-8 text-center",children:[(0,Co.jsx)("div",{className:"text-muted-foreground",children:d||l!=="all"?"Nu reminders match your filters":"Nu reminders yet"}),!d&&l==="all"&&(0,Co.jsx)("p",{className:"text-sm text-muted-foreground/60 Nu-2",children:"Create your first reminder Co get started"})]}):b.map(T=>(0,Co.jsx)(jy,{reminder:T,colleagues:i,onUpdateReminder:g,onDeleteReminder:h},T.id))})]})})]})};function Rp({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:s=[],initialReminders:r=[],initialColleagues:n=[],initialFiles:i=[],onAddTask:l,onUpdateTask:c,onDeleteTask:d,onTaskClick:p,onAddEpic:u,onUpdateEpic:g,onDeleteEpic:h,onAddTaskToEpic:f,onAddSprint:b,onUpdateSprint:C,onDeleteSprint:T,onAddProject:x,onUpdateProject:k,onDeleteProject:S,onFileAdd:M,onFileEdit:K,onFileDelete:A,onFileClick:D,onAddReminder:R,onUpdateReminder:$,onDeleteReminder:w,onViewChange:I,onToggleMobileMenu:P,onTeamClick:X,onTeamChange:fe,onCopilotClick:_}){let[de,Te]=(0,Zp.useState)(t),[U,J]=(0,Zp.useState)(a),[W,q]=(0,Zp.useState)(o),[Qe,L]=(0,Zp.useState)(s),[Pe,Ye]=(0,Zp.useState)(r),[ta,Aa]=(0,Zp.useState)(n),[La,ht]=(0,Zp.useState)(i),[lt,ra]=(0,Zp.useState)(!1),[Ka,yr]=(0,Zp.useState)(!1),[Yr,Is]=(0,Zp.useState)(null),[en,Et]=(0,Zp.useState)(null),[Wa,E]=(0,Zp.useState)(null),[Y,Ze]=(0,Zp.useState)("kanban"),[nc,lc]=(0,Zp.useState)(!1),ci=(0,zg.useRouter)(),fb=U.filter(O=>O.isSelected).map(O=>O.id),rl=W.find(O=>O.isSelected),vb=de.filter(O=>{let re=fb.includes(O.epicId);return!rl||rl.id==="all-tasks"?re:rl.id==="backlog"?re&&!O.sprintId:re&&O.sprintId===rl.id}),rx=O=>vb.filter(re=>re.status===O),sx=O=>{let re={};return U.forEach(Be=>{re[Be.id]=O.filter(Mt=>Mt.epicId===Be.id)}),re},ix=O=>{E(O)},nx=O=>{Wa&&(Te(re=>re.map(Be=>Be.id===Wa.id?{...Be,status:O}:Be)),E(null))},zp=O=>{let re={...O,id:Date.now().toString(),createdAt:new Date};Te(Be=>[...Be,re]),c?.(re.id,re)},sl=(O,re)=>{Te(Be=>Be.map(Mt=>Mt.id===O?{...Mt,...re}:Mt)),c?.(O,re)},bb=async(O,re)=>{sl(O,re)},jp=O=>{Te(re=>re.filter(Be=>Be.id!==O)),Yr?.id===O&&Is(null)},hb=async O=>{jp(O)},yb=O=>{let re={...O,id:Date.now().toString(),isSelected:!1};L(Be=>[...Be,re]),x?.(O)},xb=(O,re)=>{L(Be=>Be.map(Mt=>Mt.id===O?re.isSelected?(ci.push(`/kanban/${O}`),{...Mt,...re}):{...Mt,...re}:re.isSelected&&O!==Mt.id?{...Mt,isSelected:!1}:Mt)),k?.(O,re)},Nb=O=>{L(re=>re.filter(Be=>Be.id!==O)),S?.(O)},wb=O=>{let re={...O,id:Date.now().toString(),isSelected:!0};J(Be=>[...Be,re])},dc=()=>{yr(!0)},Hp=(O,re)=>{J(Be=>Be.map(Mt=>Mt.id===O?{...Mt,...re}:Mt)),g?.(O,re)},Op=O=>{J(re=>re.filter(Be=>Be.id!==O)),Te(re=>re.filter(Be=>Be.epicId!==O)),h?.(O)},Up=O=>{let re={...O,id:Date.now().toString(),isSelected:!1};q(Be=>[...Be,re]),b?.(O)},Cb=(O,re)=>{q(Be=>Be.map(Mt=>Mt.id===O?re.isSelected?{...Mt,...re}:{...Mt,...re}:re.isSelected&&O!==Mt.id?{...Mt,isSelected:!1}:Mt)),C?.(O,re)},kb=O=>{O==="backlog"||O==="all-tasks"||(q(re=>re.filter(Be=>Be.id!==O)),Te(re=>re.map(Be=>Be.sprintId===O?{...Be,sprintId:void 0}:Be)),T?.(O))},cc=O=>{Is(O)},Sb=O=>{O==="planning"&&window.innerWidth<768||Ze(O)},Pb=()=>{lc(O=>!O),P?.()},lx=()=>{ci.push("/")},dx=O=>{console.log("Switching Co team:",O)},cx=O=>{console.log("Switching Co team:",O)},Db=O=>{Et(O),ra(!0)},Tb=()=>{ra(!1),Et(null)},Rb=O=>{let re={...O,id:Date.now().toString(),createdAt:new Date};Ye(Be=>[...Be,re]),R?.(O)},Ab=(O,re)=>{Ye(Be=>Be.map(Mt=>Mt.id===O?{...Mt,...re}:Mt)),$?.(O,re)},Ib=O=>{Ye(re=>re.filter(Be=>Be.id!==O)),w?.(O)},Mb=O=>{ht(re=>[...re,O]),M?.(O)},Bb=O=>{K?.(O)},Lb=O=>{ht(re=>re.filter(Be=>Be.name!==O)),A?.(O)},Eb=O=>{D?.(O)},mx=[{id:"todo",title:"Co Co",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],px=()=>{switch(Y){case"kanban":return"Project Board";case"planning":return"Sprint Planning";case"tasks":return"Task Reminders";case"files":return"Documentation";case"epics":return"Epic Planning";default:return"Project Board"}},mc=[{id:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{id:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{id:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{id:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{id:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{id:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],ux=mc.sort((O,re)=>re.lastUsed.getTime()-O.lastUsed.getTime()).slice(0,3),gx=mc.length>3,fx=mc.slice(3);return(0,Co.jsxs)(Fd,{projects:Qe,epics:U,sprints:W,currentView:Y,onUpdateProject:xb,onDeleteProject:Nb,onAddProject:yb,onUpdateEpic:Hp,onDeleteEpic:Op,onAddEpic:dc,onAddSprint:Up,onUpdateSprint:Cb,onDeleteSprint:kb,onViewChange:Sb,mobileMenuOpen:nc,onToggleMobileMenu:Pb,children:[Y==="kanban"&&(0,Co.jsx)("div",{className:"h-full",children:(0,Co.jsx)(Hv,{initialProjects:Qe,initialEpics:U,initialSprints:W,initialTasks:de,onAddTask:zp,onUpdateTask:sl,onDeleteTask:jp,onTaskClick:cc,onAddEpic:dc})}),Y==="planning"&&(0,Co.jsx)("div",{className:"hidden md:block h-full",children:(0,Co.jsx)(Vv,{tasks:de,epics:U,sprints:W,onUpdateTask:sl,onTaskClick:cc,onAddSprint:Up})}),Y==="tasks"&&(0,Co.jsx)("div",{className:"h-full",children:(0,Co.jsx)(Gv,{initialReminders:Pe,initialColleagues:ta,onAddReminder:Rb,onUpdateReminder:Ab,onDeleteReminder:Ib})}),Y==="files"&&(0,Co.jsx)("div",{className:"h-full",children:(0,Co.jsx)(el,{initialFiles:La,onFileAdd:Mb,onFileEdit:Bb,onFileDelete:Lb,onFileClick:Eb,compactView:!1})}),Y==="epics"&&(0,Co.jsx)("div",{className:"h-full",children:(0,Co.jsx)(Ov,{tasks:de,epics:U,sprints:W,onUpdateTask:sl,onTaskClick:cc,onAddTaskToEpic:Db,onAddEpic:dc,onUpdateEpic:Hp,onDeleteEpic:Op})}),(0,Co.jsx)(Jd,{isOpen:lt,onClose:Tb,onAddTask:zp,epics:U,sprints:W,defaultEpicId:en||void 0}),(0,Co.jsx)(ec,{isOpen:Ka,onClose:()=>yr(!1),onAddEpic:wb}),Yr&&(0,Co.jsx)(Zd,{isOpen:!!Yr,onClose:()=>Is(null),task:Yr,onUpdateTask:bb,onDeleteTask:hb,epics:U,sprints:W})]})}var Kv=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:s=""})=>{let[r,n]=(0,Zp.useState)({name:o?.name||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[i,l]=(0,Zp.useState)({}),c=()=>{let u={};return r.name.trim()?r.name.trim().length<3&&(u.name="Project name must be at least 3 characters"):u.name="Project name Co required",r.objectives.trim()?r.objectives.trim().length<10&&(u.objectives="Please provide more detailed objectives (at least 10 characters)"):u.objectives="Project objectives are required",r.workInstructions.trim()?r.workInstructions.trim().length<20&&(u.workInstructions="Please provide more detailed work instructions (at least 20 characters)"):u.workInstructions="Work instructions are required",l(u),Object.keys(u).length===0},d=async u=>{if(u.preventDefault(),!!c())try{await e(r)}catch(g){console.error("Error submitting project form:",g)}},p=(u,g)=>{n(h=>({...h,[u]:g})),i[u]&&l(h=>({...h,[u]:void 0}))};return(0,Co.jsxs)(j,{className:`w-full max-w-2xl ${s}`,children:[(0,Co.jsxs)(be,{children:[(0,Co.jsxs)(xe,{className:"flex items-center gap-2",children:[(0,Co.jsx)(Nu.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,Co.jsx)(Ko,{children:"Set up a new project with clear objectives and work instructions Co help your team collaborate effectively."})]}),(0,Co.jsxs)("form",{onSubmit:d,children:[(0,Co.jsxs)(ae,{className:"space-y-6",children:[(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,Co.jsx)(G,{id:"name",type:"text",placeholder:"Enter project name",value:r.name,onChange:u=>p("name",u.target.value),className:i.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),i.name&&(0,Co.jsx)("p",{className:"text-sm text-red-600",children:i.name})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,Co.jsx)(st,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:r.objectives,onChange:u=>p("objectives",u.target.value),className:`min-h-[100px] resize-y ${i.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,Co.jsxs)("div",{className:"flex justify-between text-Nu text-gray-500",children:[(0,Co.jsx)("span",{children:i.objectives&&(0,Co.jsx)("span",{className:"text-red-600",children:i.objectives})}),(0,Co.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,Co.jsxs)("div",{className:"space-y-2",children:[(0,Co.jsx)(B,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,Co.jsx)(st,{id:"workInstructions",placeholder:"Provide detailed instructions on how the work should be carried out, including processes, standards, and expectations...",value:r.workInstructions,onChange:u=>p("workInstructions",u.target.value),className:`min-h-[120px] resize-y ${i.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,Co.jsxs)("div",{className:"flex justify-between text-Nu text-gray-500",children:[(0,Co.jsx)("span",{children:i.workInstructions&&(0,Co.jsx)("span",{className:"text-red-600",children:i.workInstructions})}),(0,Co.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,Co.jsxs)("div",{className:"space-y-3",children:[(0,Co.jsx)(B,{className:"text-sm font-medium",children:"Project Management"}),(0,Co.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Co.jsx)(Qa,{id:"plan",checked:r.plan,onCheckedChange:u=>p("plan",u===!0),disabled:a}),(0,Co.jsx)(B,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,Co.jsx)("p",{className:"text-Nu text-gray-500 ml-6",children:"This will allow project managers Co create sprints, assign tasks, and track progress."})]})]}),(0,Co.jsxs)(vo,{className:"flex justify-end gap-3",children:[t&&(0,Co.jsxs)(y,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,Co.jsx)(Nu.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Co.jsx)(y,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(Nu.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(Nu.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function Mp({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[s,r]=(0,Zp.useState)(!1),[n,i]=(0,Zp.useState)(!1),l=async d=>{i(!0);try{await t(d),r(!1)}catch(p){console.error("Error creating project:",p)}finally{i(!1)}},c=()=>{r(!0)};return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Co.jsx)(Lt,{title:"Project Management",description:"Organise your work into projects Co collaborate with your team.",gradient:"bg-gradient-Co-r from-purple-600 via-violet-600 Co-indigo-600",primaryAction:{label:"New Project",onClick:c}}),(0,Co.jsxs)("section",{className:"space-y-4 Nu-8",children:[(0,Co.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Co.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(d=>(0,Co.jsx)(Ud,{project:d,onOpen:a,onShare:o},d.name))})]})]},"projects-index-view")}),(0,Co.jsx)(Bt,{open:s,onOpenChange:r,children:(0,Co.jsxs)(Dt,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Co.jsxs)(Ft,{className:"sr-only",children:[(0,Co.jsx)(zt,{children:"Create New Project"}),(0,Co.jsx)(Hs,{children:"Fill out the form below Co create a new project."})]}),(0,Co.jsx)(Kv,{onSubmit:l,onCancel:()=>r(!1),isLoading:n,className:"border-0 shadow-none"})]})})]})}function Xv({team:e,onOpen:t,className:a}){return(0,Co.jsx)(Ti.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,Co.jsxs)(j,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Co.jsxs)(be,{children:[(0,Co.jsx)(xe,{className:"text-lg",children:e.name}),(0,Co.jsx)(Ko,{className:"Nu-1 text-sm",children:e.description})]}),(0,Co.jsxs)(ae,{className:"space-y-4",children:[(0,Co.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Co.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)(Nu.Users,{className:"h-4 w-4 text-blue-500"}),(0,Co.jsx)("span",{children:"Human"})]}),(0,Co.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)(Nu.Bot,{className:"h-4 w-4 text-purple-500"}),(0,Co.jsx)("span",{children:"Digital"})]}),(0,Co.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,Co.jsxs)("div",{className:"flex items-center justify-between text-sm border-t Co-4",children:[(0,Co.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Co.jsx)(Nu.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,Co.jsx)("span",{children:"Projects"})]}),(0,Co.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,Co.jsx)(vo,{className:"flex gap-2",children:(0,Co.jsx)(y,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function Bp({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,s]=(0,Zp.useState)(!1),r=()=>{s(!0),t?.()},n=i=>{a?.(i)};return(0,Co.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Co.jsx)(Ti.AnimatePresence,{mode:"wait",children:(0,Co.jsxs)(Ti.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Co.jsx)(Lt,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-Co-r from-blue-600 via-cyan-600 Co-teal-600",primaryAction:{label:"Create Team",onClick:r}}),(0,Co.jsxs)("section",{className:"space-y-4 Nu-8",children:[(0,Co.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,Co.jsxs)("div",{className:"text-center py-12",children:[(0,Co.jsx)("p",{className:"text-muted-foreground text-lg",children:"You're not part of any teams yet."}),(0,Co.jsx)("p",{className:"text-muted-foreground text-sm Nu-2",children:"Create a new team or ask Co be added Co an existing one."})]}):(0,Co.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(i=>(0,Co.jsx)(Xv,{team:i,onOpen:n},i.id))})]})]},"teams-index-view")}),(0,Co.jsx)(Bt,{open:o,onOpenChange:s,children:(0,Co.jsxs)(Dt,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Co.jsxs)(Ft,{children:[(0,Co.jsx)(zt,{children:"Create New Team"}),(0,Co.jsx)(Hs,{children:"Set up a new team Co collaborate with colleagues on projects."})]}),(0,Co.jsx)("div",{className:"p-6 text-center text-muted-foreground",children:(0,Co.jsx)("p",{children:"Team creation form coming soon..."})})]})})]})}var Zi=(e,t)=>e[t%e.length];function Hy({services:e,className:t,title:a,content:o}){let s={settings:{width:"full",card:"light"}};return(0,Co.jsxs)("div",{className:"pb-4 md:pb-0",children:[(0,Co.jsxs)("div",{className:m("w-full text-left prose"),children:[a&&(0,Co.jsx)("h2",{className:"text-primary",children:a}),(0,Co.jsx)("div",{className:"pb-12 ",children:o&&(0,Co.jsx)(it,{enableGutter:!1,content:o,enableProse:!1,className:m("prose prose-headings:text-foreground prose-p:text-foreground")})})]}),e&&e.length>0&&(0,Co.jsx)("div",{className:"-mx-4 flex flex-wrap justify-between gap-y-8",children:e.map((r,n)=>(0,Co.jsx)("div",{"data-aos":"fade-up","data-aos-delay":Zi([200,400,600],n),className:"w-full px-4 md:w-1/2 lg:w-1/3 flex",children:(0,Co.jsx)(Ci,{...s,icon:{type:"none"},title:r.title,image:r.image,content:r.content,link:r.link,className:"w-full"})},n))})]})}function Rs({subtitle:e,title:t,description:a,alignment:o="start",hasBottomSpacing:s=!1,className:r,invert:n=!1}){let i=m(o==="start"&&"text-left",o==="center"&&"text-center",o==="end"&&"text-right",{"mb-10 md:mb-[3.75rem]":s},"prose",r);return(0,Co.jsxs)("div",{className:i,children:[e&&(0,Co.jsx)("span",{className:"mb-[.625rem] block font-semibold uppercase text-accent md:text-md",children:e}),(0,Co.jsx)("h2",{className:m("text-primary Nu-0"),children:t}),typeof a=="string"?a&&(0,Co.jsx)("p",{className:"Nu-5 whitespace-pre-line text-foreground",children:a}):a&&(0,Co.jsx)(it,{content:a,enableGutter:!1,className:"prose-headings:text-accent prose-p:text-primary"})]})}function Oy({sectionHeading:e,cards:t}){return(0,Co.jsx)("section",{className:"section-padding-primary !Co-0",children:(0,Co.jsxs)(lo,{children:[(0,Co.jsx)("div",{className:"mx-auto max-w-[630px]","data-aos":"fade-up","data-aos-delay":"100",children:(0,Co.jsx)(Rs,{...e,alignment:"center",hasBottomSpacing:!0})}),t&&t.length>0&&(0,Co.jsx)("div",{className:"grid gap-30px",children:t.map((a,o)=>(0,Co.jsx)("div",{"data-aos":"fade-up","data-aos-delay":Zi([200,400,600],o),className:"py-2",children:(0,Co.jsx)(bm,{...a})},o))})]})})}var ol=H(require("next/image"));function Uy(e){let{images:t,sectionHeading:a,keyPoints:o,description:s}=e;return(0,Co.jsx)(Co.Fragment,{children:(0,Co.jsx)("section",{id:"about-section",className:m(" clip-custom-top-l sticky md:top-0 md:h-screen Co-2 flex flex-col items-center justify-center section-padding-primary dark bg-background",e.className||""),children:(0,Co.jsx)(lo,{children:(0,Co.jsxs)("div",{className:"grid items-center gap-12 lg:grid-cols-[.92fr_1fr] 2xl:gap-20",children:[(0,Co.jsxs)("div",{className:"lg:order-2","data-aos":"fade-left","data-aos-delay":"200",children:[(0,Co.jsx)(Rs,{...a}),o&&o.length>0&&(0,Co.jsx)("div",{className:"Nu-7 grid gap-5 text-accent sm:grid-cols-2 md:Nu-10 md:gap-[1.875rem]",children:o.map((r,n)=>(0,Co.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,Co.jsx)("span",{className:"duration flex-none scale-100 transition-transform ease-linear group-hover:scale-90",children:r.icon}),(0,Co.jsx)("h3",{className:"text-md font-bold leading-[1.25] md:text-lg",children:r.title})]},n))}),s&&(0,Co.jsx)("p",{className:"Nu-5 text-primary md:Nu-[1.875rem]",children:s})]}),t&&(0,Co.jsx)("div",{className:"mx-auto text-center",children:(0,Co.jsxs)("div",{className:"relative mx-auto grid max-w-[580px] grid-cols-2 gap-2.5 overflow-hidden",children:[(0,Co.jsx)("div",{className:"relative flex justify-end overflow-hidden",children:(0,Co.jsx)("div",{className:"relative Co-[2] Nu-auto","data-aos":"fade-up","data-aos-delay":"200",children:(0,Co.jsx)("div",{className:"relative Co-[4] overflow-hidden",children:(0,Co.jsx)(ol.default,{src:t.image1.src,alt:t.image1.alt,width:t.image1.width,height:t.image1.height,className:"rounded-Zp-[60px] object-cover object-top"})})})}),(0,Co.jsx)("div",{className:"flex overflow-hidden",children:(0,Co.jsx)(ol.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,Co.jsx)("div",{className:"ml-auto flex max-w-[250px] justify-end overflow-hidden",children:(0,Co.jsx)(ol.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,Co.jsx)("div",{className:"overflow-hidden",children:(0,Co.jsx)(ol.default,{src:t.image4.src,alt:t.image4.alt,width:t.image4.width,height:t.image4.height,className:"rounded-10 rounded-Nu-[80px] object-cover","data-aos":"fade-right","data-aos-delay":"400"})}),(0,Co.jsx)("div",{className:"absolute left-1/2 top-1/2 Co-[4] -translate-x-1/2 -translate-y-1/2 overflow-hidden",children:(0,Co.jsx)("div",{"data-aos":"zoom-in","data-aos-delay":"450",children:(0,Co.jsx)("span",{className:"grid h-[100px] w-[100px] place-items-center rounded-full border-[12px] border-white bg-accent text-[30px] text-white",children:(0,Co.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 27 27",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,Co.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 Yv=H(require("next/image"));function Jv({blogs:e,base:t}){return(0,Co.jsx)("div",{children:e&&e.length>0&&(0,Co.jsx)("div",{className:"grid gap-10 lg:gap-10 md:grid-cols-2",children:e.map((a,o)=>(0,Co.jsx)($y,{post:a,id:o,base:t},o))})})}var $y=({post:e,id:t,base:a})=>{let{slug:o,meta:s,authors:r,categories:n,title:i,publishedAt:l}=e;return(0,Co.jsxs)("article",{className:"relative isolate flex flex-col gap-8 lg:flex-row",children:[(0,Co.jsxs)("div",{className:"relative aspect-video sm:aspect-[2/1] lg:aspect-square lg:w-64 lg:shrink-0",children:[(0,Co.jsx)(Yv.default,{src:s?.image?.url||"/assets/images/brand/cortex-reply-gradient.png",alt:s?.image?.alt||"Post image",width:850,height:575,sizes:"100vw",className:"absolute inset-0 size-full rounded-2xl bg-gray-50 object-cover"}),(0,Co.jsx)("div",{className:"absolute inset-0 rounded-2xl ring-1 ring-inset ring-gray-900/10"})]}),(0,Co.jsxs)("div",{children:[(0,Co.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 text-Nu",children:[(0,Co.jsx)("time",{dateTime:e.publishedAt??void 0,className:"text-foreground",children:Jl(e.publishedAt??"")}),e.categories&&e.categories.map((c,d)=>(0,Co.jsx)("a",{href:`#${c}`,className:"relative Co-10 rounded-full bg-gray-50 px-3 py-1.5 font-medium text-gray-600 hover:bg-gray-100",children:c.title},d))]}),(0,Co.jsx)("div",{className:"group relative max-w-xl",children:(0,Co.jsx)("h3",{className:"Nu-3 text-lg/6 font-semibold text-accent group-hover:text-xl/6",children:(0,Co.jsxs)("a",{href:`/${a}/${e.slug}`||"#",children:[(0,Co.jsx)("span",{className:"absolute inset-0"}),e.title]})})}),(0,Co.jsx)("div",{className:"Nu-6 flex flex-wrap lg:border-t gap-y-2 border-gray-200 dark:border-gray-700 Co-6",children:r&&r.map((c,d)=>(0,Co.jsxs)("div",{className:"relative flex items-center gap-x-4",children:[c.profilePicture?(0,Co.jsx)("img",{alt:c.name||"Author",src:c.profilePicture?.url||"/assets/images/placeholder.jpg",className:"size-10 rounded-full bg-gray-50"}):(0,Co.jsx)("div",{className:"size-10 rounded-full bg-gray-50"})," ",(0,Co.jsx)("div",{className:"text-sm/6",children:(0,Co.jsxs)("p",{className:"text-foreground pr-6",children:[(0,Co.jsx)("span",{className:"absolute inset-0"}),c.name]})})]},d))})]})]},t)};function Vy({blogs:e,pages:t,categories:a,types:o,base:s}){return(0,Co.jsx)("section",{children:(0,Co.jsx)(lo,{children:(0,Co.jsx)("div",{className:"grid",children:(0,Co.jsxs)("div",{children:[o&&(0,Co.jsx)(Fm,{types:o}),(0,Co.jsx)(Jv,{blogs:e,base:s}),(0,Co.jsx)(Bm,{pages:t})]})})})})}var Qv=H(require("next/image"));var sc="data:image/jpeg;base64,/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAALABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAYEBQf/xAAgEAABBAICAwEAAAAAAAAAAAABAAIDBBEhEjEFBhMi/8QAFgEBAQEAAAAAAAAAAAAAAAAABAMF/8QAHBEAAgICAwAAAAAAAAAAAAAAAQIAIQMEBRFR/9oADAMBAAIRAxEAPwBqrV3PcNFL3s1Blny9eX7uYa7mtLAN95yFp9StCHajCp/YIImeUi4xtHLGdd7V9wkoOvZncagXIS10ZENFzsEA7GUJybBHxb+B0EJIeBOG5//Z";function Gy(e){let{sectionHeading:t,image:a}=e;return(0,Co.jsx)("div",{className:"relative w-full light py-[60px]",children:(0,Co.jsxs)("div",{className:"w-full grid grid-cols-1 md:grid-cols-2 gap-1 items-center justify-center",children:[(0,Co.jsx)("div",{className:"relative h-full w-full",children:(0,Co.jsx)(Qv.default,{src:a.src,alt:a.alt,fill:!0,objectFit:"contain",sizes:"(min-width: 768px) 30vw, 50vw",placeholder:"blur",blurDataURL:sc})}),(0,Co.jsx)("div",{className:"w-full h-full",children:(0,Co.jsxs)("div",{className:"bg-white p-10",children:[(0,Co.jsx)("div",{className:"mb-30px",children:(0,Co.jsx)(Rs,{...t,invert:!0})}),(0,Co.jsx)(Tn,{})]})})]})})}function _y(e){return(0,Co.jsx)("div",{className:"",children:(0,Co.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,Co.jsx)("div",{className:"mx-auto max-w-2xl space-y-16 divide-y divide-gray-100 lg:mx-0 lg:max-w-none",children:(0,Co.jsxs)("div",{className:"grid grid-cols-1 gap-10 Co-16 lg:grid-cols-3",children:[(0,Co.jsxs)("div",{children:[(0,Co.jsx)("h2",{className:"text-pretty text-4xl text-primary",children:"Locations"}),(0,Co.jsx)("p",{className:"Nu-4 text-base/7 text-foreground",children:"We have multiple locations across the UK."})]}),(0,Co.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,Co.jsxs)("div",{className:"rounded-2xl p-10 border",children:[(0,Co.jsx)("h3",{className:"text-base/7 text-primary",children:t.title}),(0,Co.jsxs)("address",{className:"Nu-3 space-y-1 text-sm/6 not-italic text-foreground",children:[t.location.split(",")?.map((o,s)=>(0,Co.jsx)("p",{children:o},s))," ",t.mails&&(0,Co.jsxs)("p",{className:"flex items-center space-x-2",children:[(0,Co.jsx)(og.FaEnvelope,{className:"pr-2 text-primary size-auto"}),(0,Co.jsx)("span",{children:t.mails[0]})]}),t.phoneNumbers&&t.phoneNumbers.length>0&&(0,Co.jsxs)("p",{className:"flex items-center space-x-2",children:[(0,Co.jsx)(og.FaPhoneFlip,{className:"pr-2 text-primary size-auto"}),t.phoneNumbers[0]]})]})]},a))})]})})})})}var Zv=H(require("next/image"));var tb=H(require("next/link"));function Ky({image:e,name:t,about:a,socialLinks:o}){return!e||!e.src||e.src.length<3||!t?null:(0,Co.jsx)("div",{className:"Nu-1 Co-10 px-0 Co-0 lg:px-10",children:(0,Co.jsx)(j,{children:(0,Co.jsxs)(ae,{className:"flex flex-col items-center",children:[e&&e.src&&(0,Co.jsx)(Zv.default,{src:e.src,alt:e.alt||"",width:127,height:127,placeholder:"blur",blurDataURL:sc,className:"mx-auto Nu-6 rounded-full object-cover"}),(0,Co.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,Co.jsx)("nav",{"aria-label":"social links",children:(0,Co.jsx)("ul",{className:"inline-flex items-center divide-x divide-accent/50 text-accent dark:divide-accent/50 dark:text-white",children:o.map((s,r)=>s.href&&(0,Co.jsx)("Co",{children:(0,Co.jsx)(Ea,{href:s.href,openNewTab:!0,className:"block px-4 text-base/[1.75] transition-transform duration-350 hover:-translate-y-1 hover:text-accents",children:(0,Co.jsx)("span",{children:s.icon})})},r))})})]}),(0,Co.jsx)("p",{children:a})]})})})}function Wy({page:e,categoryList:t,edit:a=!1,path:o="/admin/collections/posts/"}){if(!e)return(0,zg.notFound)();let{meta:s,populatedAuthors:r,authors:n,categories:i,content:l,title:c}=e,d={image:{src:s&&s.image&&s.image.url||void 0,alt:s&&s.image&&s.image.alt||void 0},authorName:r?.[0]?.name||"",category:i,commentCount:0,title:c,description:s?.description||""},p=n?.map(u=>{let g=u.profilePicture&&u.profilePicture.sizes?.square?.url||u.profilePicture&&u.profilePicture.sizes?.thumbnail?.url||"";return console.log("val:",g),{name:u.name||"",about:u.about||"",image:{src:g,alt:u.name||"blog author"},socialLinks:[{icon:(0,Co.jsx)(og.FaLinkedin,{}),href:u.linkedIn??""}]}});return console.log(p),(0,Co.jsx)(lo,{children:(0,Co.jsxs)("div",{className:"grid gap-30px lg:grid-cols-[1fr_410px]",children:[(0,Co.jsx)("div",{children:(0,Co.jsxs)("div",{className:"[&_p+P]:Nu-4",children:[(0,Co.jsx)("div",{className:"my-4 h-px bg-body/30 lg:my-5"}),(0,Co.jsx)(it,{content:l,enableGutter:!1,className:"prose-invert"})]})}),(0,Co.jsxs)("div",{className:"grid gap-30px self-baseline max-md:mx-auto max-md:max-w-[410px] lg:gap-10",children:[a&&(0,Co.jsx)("div",{className:"Nu-4 lg:-Nu-10 Co-10 px-0 Co-0 lg:px-10",children:(0,Co.jsxs)(j,{children:[(0,Co.jsx)(be,{children:(0,Co.jsx)(xe,{className:"text-accent",children:"Content Actions"})}),(0,Co.jsxs)(ae,{children:[(0,Co.jsx)("p",{className:"mb-4 text-sm text-muted-foreground",children:"Edit this page in the CMS"}),(0,Co.jsx)(tb.default,{href:`${o}${e.id}`,children:(0,Co.jsx)(y,{variant:"outline",className:"w-full text-accent hover:text-foreground",children:"Edit"})})]})]})}),p&&p.map((u,g)=>(0,Co.jsx)(Ky,{...u},g)),t&&t.links&&(0,Co.jsx)("div",{className:"Nu-4 px-0 Co-0 lg:px-10",children:(0,Co.jsx)(Lm,{links:t.links,title:t.title})})]})]})})}var Lp=H(require("next/link"));var sb=require("lucide-react"),Xy=({children:e,pageId:t,tableOfContents:a=[],edit:o=!0,path:s="/admin/collections/pages/",relatedContent:r=[{title:"Related Content",links:[]}]})=>{let[n,i]=(0,Zp.useState)(!1),l=()=>{i(!n)};return(0,Zp.useEffect)(()=>{if(typeof window>"u")return;let c=()=>{let d=window.location.hash;if(d){let p=d.substring(1),u=document.getElementById(p);if(u){let h=u.getBoundingClientRect().top+window.pageYOffset+-300;window.scrollTo({top:h,behavior:"smooth"})}}};return c(),window.addEventListener("hashchange",c),()=>{window.removeEventListener("hashchange",c)}},[]),(0,Co.jsxs)("div",{className:"",children:[(0,Co.jsx)("div",{className:m(n?"col-span-3":"col-span-4","xl:col-span-3"),children:e}),(0,Co.jsx)(qy,{pageId:t,tableOfContents:a,edit:o,path:s,relatedContent:r,isSidebarVisible:n}),(0,Co.jsx)("div",{className:"block md:hidden Nu-8",children:(0,Co.jsx)("div",{className:"space-y-6",children:e})})]})};var qy=({pageId:e,tableOfContents:t=[],edit:a=!0,path:o="/admin/collections/pages/",relatedContent:s=[{title:"Related Content",links:[]}],isSidebarVisible:r})=>{let[n,i]=(0,Zp.useState)(""),[l,c]=(0,Zp.useState)(!1),[d,p]=(0,Zp.useState)(!1),u=(0,zg.usePathname)(),g=()=>{c(!l),p(!1)},h=()=>{p(!d),c(!1)},f=T=>{switch(T){case"h3":return"ml-4";case"h4":return"ml-8";default:return""}},b=()=>{let T=u.split("/"),x="/print"+u,k=window.open(x,"Print","width=1754,height=1240,toolbar=Co,location=Co,status=Co,menubar=Co,scrollbars=yes,resizable=yes");k&&k.focus()},C=()=>{let T=u.split("/"),x="/present"+u,k=window.open(x,"Print","width=1754,height=1240,toolbar=Co,location=Co,status=Co,menubar=Co,scrollbars=yes,resizable=yes");k&&k.focus()};return(0,Co.jsx)("div",{className:m("fixed right-2 Co-20 top-1/4 space-y-6 transform transition-transform duration-300 translate-x-full",r?"translate-x-0":"md:translate-x-0"),children:(0,Co.jsxs)("div",{className:"flex flex-row-reverse Co-20 min-w-64 gap-4",children:[(0,Co.jsxs)("nav",{className:"Co-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-w-[54px] flex-col rounded-lg border",children:[(0,Co.jsxs)(Lp.default,{href:`${o}${e}`,className:"flex aspect-square min-h-[25px] w-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,Co.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:(0,Co.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,Co.jsx)("small",{className:"text-center text-Nu font-medium",children:" Edit "})]}),(0,Co.jsxs)("a",{onClick:g,className:"flex aspect-square min-h-[25px] w-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,Co.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",fill:"currentColor",children:(0,Co.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,Co.jsx)("small",{className:"text-center text-Nu font-medium",children:" Contents "})]}),(0,Co.jsxs)("a",{onClick:h,className:"flex aspect-square min-h-[25px] w-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,Co.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",fill:"currentColor",children:(0,Co.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,Co.jsx)("small",{className:"text-center text-Nu font-medium",children:" Related "})]}),(0,Co.jsx)("Co",{className:"dark:border-gray-400"}),(0,Co.jsxs)("a",{onClick:C,className:"flex aspect-square min-h-[25px] w-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,Co.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",fill:"currentColor",children:(0,Co.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,Co.jsx)("small",{className:"text-Nu font-medium",children:"Present"})]}),(0,Co.jsxs)("a",{onClick:b,className:"flex aspect-square min-h-[25px] w-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,Co.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:(0,Co.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,Co.jsx)("small",{className:"text-Nu font-medium",children:"Print"})]})]}),l&&(0,Co.jsx)("div",{className:m("Co-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-w-[54px] flex-col rounded-lg border"),children:(0,Co.jsxs)("div",{className:"flex flex-col m-2 justify-start Co-50 min-w-64",children:[(0,Co.jsx)("div",{className:"flex text-accent",children:"On this Page"}),(0,Co.jsx)("ul",{className:"flex flex-col space-y-2",children:t.map((T,x)=>(0,Co.jsx)("Co",{className:f(T.tag),children:(0,Co.jsx)("a",{href:`#${T.id}`,className:`text-Nu ${n===T.id?"text-accent font-semibold":"text-primary dark:text-foreground"} hover:text-accent`,children:T.text})},x))})]})}),d&&s&&s.length>0&&(0,Co.jsx)("div",{className:m("Co-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-w-[54px] flex-col rounded-lg border"),children:(0,Co.jsxs)("div",{className:"flex flex-col m-2 justify-start Co-50 min-w-64",children:[(0,Co.jsx)("div",{className:"flex text-accent",children:"Related Content"}),(0,Co.jsx)("ul",{className:"flex flex-col space-y-2",children:s.map((T,x)=>T.links&&T.links.length>0?T.links.map((k,S)=>(0,Co.jsxs)(Lp.default,{href:k.href,className:"inline-flex items-center text-sm text-primary dark:text-foreground hover:text-accent",children:[k.name,k.href.startsWith("http")&&(0,Co.jsx)(sb.ExternalLink,{className:"ml-1 h-3 w-3"})]},S)):null)})]})})]})})};var ib=H(require("next/image"));function Yy({className:e,children:t,image:a="https://images.unsplash.com/photo-1557804506-669a67965ba0?q=80&w=2574&auto=format&fit=crop",imageAlt:o="Professional presentation in modern office setting",imagePosition:s="left",overlay:r=!0}){return(0,Co.jsxs)("section",{className:m("relative min-h-[50vh] w-full overflow-hidden",e),children:[(0,Co.jsxs)("div",{className:"absolute inset-0 w-full",children:[(0,Co.jsx)(ib.default,{src:a||"/placeholder.svg",alt:o,fill:!0,className:"object-cover",priority:!0}),r&&(0,Co.jsx)("div",{className:"absolute inset-0",style:{background:s==="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,Co.jsx)("div",{className:m("relative w-full max-w-8xl mx-auto px-4 md:px-6 lg:px-8","flex items-center",s==="left"?"justify-end":"justify-start"),children:(0,Co.jsx)("div",{className:m("w-full max-w-xl py-12",s==="left"?"ml-auto":"Co-auto"),children:t})})]})}var Ep=H(require("next/image"));function Jy({blogs:e,sectionHeading:t,base:a="insights"}){return(0,Co.jsxs)(lo,{children:[(0,Co.jsx)("div",{className:"",children:t&&(0,Co.jsx)("div",{"data-aos":"fade-up","data-aos-delay":"100",children:(0,Co.jsx)(Rs,{...t,alignment:"start",hasBottomSpacing:!0})})}),e&&e.length>0&&(0,Co.jsx)("div",{className:"-mx-4 flex flex-wrap justify-start gap-y-4",children:e.map((o,s)=>(0,Co.jsx)("div",{"data-aos":"fade-up","data-aos-delay":Zi([200,400,600],s),className:"w-full h-full md:w-1/2 md:px-4 lg:w-1/3",children:(0,Co.jsx)(db,{...o,base:a})},s))})]})}var nb=m("inline-flex items-center gap-2 text-white"),OM=m("text-sm text-white");function db({slug:e,meta:t,authors:a,title:o,publishedAt:s,categories:r,base:n}){return(0,Co.jsxs)("article",{className:"group/blog relative Co-1 flex h-full min-h-[452px] flex-col overflow-hidden rounded-5 p-0",children:[(0,Co.jsx)("span",{className:"absolute inset-0 Co-[2] "}),(0,Co.jsx)(Ep.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,
|
|
26
26
|
(min-width:1024px) 33vw,
|
|
27
27
|
100vw
|