cortex-react-components 2.26.1 → 2.26.2
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-IUT6JJHY.mjs → chunk-2BRDNDUB.mjs} +1 -1
- package/dist/{chunk-PZCH3GAL.mjs → chunk-2SQVMYDK.mjs} +1 -1
- package/dist/{chunk-YSAWXOPE.mjs → chunk-36UEU4CT.mjs} +1 -1
- package/dist/{chunk-XI5H6WLY.mjs → chunk-3HNU2NYP.mjs} +1 -1
- package/dist/{chunk-RSYHYNWR.mjs → chunk-3MEOSYPN.mjs} +1 -1
- package/dist/{chunk-KJMXSFJA.mjs → chunk-3NRXQBBS.mjs} +1 -1
- package/dist/{chunk-NIRR5B5C.mjs → chunk-3Y7QG6VP.mjs} +1 -1
- package/dist/{chunk-4HXYNCOU.mjs → chunk-5EKGFFJD.mjs} +1 -1
- package/dist/{chunk-436WKDWG.mjs → chunk-5MWZTJYP.mjs} +1 -1
- package/dist/{chunk-IQ3TUH7O.mjs → chunk-75F3LJMX.mjs} +1 -1
- package/dist/{chunk-EVZSRWUW.mjs → chunk-7R47MHQE.mjs} +1 -1
- package/dist/{chunk-G6ED5Z4J.mjs → chunk-AJQHGVZ5.mjs} +1 -1
- package/dist/{chunk-DUEPJ3F4.mjs → chunk-C4RWEPVF.mjs} +1 -1
- package/dist/{chunk-QDAJ7QAD.mjs → chunk-CXOVEABI.mjs} +1 -1
- package/dist/{chunk-V63JJVJX.mjs → chunk-EM3T2XYC.mjs} +1 -1
- package/dist/{chunk-XREAMNVX.mjs → chunk-FE7ZGUPU.mjs} +1 -1
- package/dist/{chunk-S562PA5P.mjs → chunk-GHOL5L32.mjs} +1 -1
- package/dist/{chunk-INBT5E6T.mjs → chunk-GPFPTU7U.mjs} +1 -1
- package/dist/{chunk-Z3NOT3QB.mjs → chunk-GTZJWMZR.mjs} +1 -1
- package/dist/{chunk-DY2G774J.mjs → chunk-GVDM4RRN.mjs} +1 -1
- package/dist/chunk-IXLFVFIK.mjs +4 -0
- package/dist/{chunk-24NYAA5I.mjs → chunk-K4DQ5KUH.mjs} +1 -1
- package/dist/{chunk-PDAMYUP7.mjs → chunk-KQB6MFFS.mjs} +1 -1
- package/dist/{chunk-6T4OEOJH.mjs → chunk-LJXTXROJ.mjs} +1 -1
- package/dist/{chunk-M4NJB4NN.mjs → chunk-NINFDOV5.mjs} +1 -1
- package/dist/{chunk-HH3AWPYB.mjs → chunk-RGOKBIQ5.mjs} +1 -1
- package/dist/{chunk-VKJ7E6OL.mjs → chunk-RJGYVDOU.mjs} +1 -1
- package/dist/{chunk-ZJZ2UMK2.mjs → chunk-TVTTUSWM.mjs} +1 -1
- package/dist/{chunk-SRUG246N.mjs → chunk-TXVA6XJT.mjs} +1 -1
- package/dist/{chunk-PLTKMHUH.mjs → chunk-WIRQ5IRT.mjs} +1 -1
- package/dist/{chunk-3GDFYE6T.mjs → chunk-ZEALRBXW.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/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/index.mjs +1 -1
- package/dist/components/DigitalColleagues/index.mjs +1 -1
- package/dist/components/Foundary/MainPage.mjs +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
- package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
- package/dist/components/Foundary/Views/index.mjs +1 -1
- package/dist/components/Foundary/index.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/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/FileView.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/Projects/TaskDetailsModal.mjs +1 -1
- package/dist/components/Projects/index.mjs +1 -1
- package/dist/components/dc-temp/index.mjs +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/sections/AboutSection.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogList.mjs +1 -1
- package/dist/sections/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/package.json +1 -1
- package/dist/chunk-3V4WLGEY.mjs +0 -4
package/dist/components/index.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
dark bg-background text-primary`,children:[(0,Qo.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[e&&(0,Qo.jsx)("img",{src:e.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,Qo.jsx)("span",{className:"pl-12 text-gn",children:"Power Qo your people"})]}),(0,Qo.jsx)("a",{href:"https://cortexreply.com",className:"text-gn hover:underline",children:"cortexreply.com"})]}),wl=({title:e})=>(0,Qo.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,Qo.jsx)("div",{className:"container",children:(0,Qo.jsx)("span",{className:"container text-4xl px-6",children:e})})}),Nl=e=>{let{title:t,hero:a,logoImage:o}=e;return(0,Qo.jsxs)("div",{className:"relative w-full h-full flex flex-col justify-center min-h-[500px] p-10",children:[(0,Qo.jsx)("div",{className:"absolute inset-0",children:(0,Qo.jsx)(Pp.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,Qo.jsx)("div",{className:"absolute left-16 z-50 top-4 flex flex-col items-start gap-4",children:o&&(0,Qo.jsx)("div",{className:"h-24",children:(0,Qo.jsx)(Pp.default,{src:o.src,alt:"Company logo",className:"h-full w-full object-contain",width:192,height:96})})}),(0,Qo.jsx)("div",{className:"absolute inset-0 bg-black/30 dark:bg-black/50"}),(0,Qo.jsxs)("div",{className:"relative pl-24 z-10 max-w-3xl",children:[(0,Qo.jsx)("p",{className:"text-lg font-medium Qo-48 text-accent Iv-2",children:t}),a.richText&&(0,Qo.jsx)(Ot,{content:a.richText,enableGutter:!1,className:"prose-headings:text-white prose-p:text-white"})]})]})};var cv=e=>{let[t,a]=(0,nd.useState)(0),{blocks:o,hero:r,logoImage:i}=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)},m=()=>{a(f=>(f-1+l.length)%l.length)},v=(0,nd.useCallback)(((f,g)=>{let x;return(...k)=>{clearTimeout(x),x=setTimeout(()=>f(...k),g)}})(f=>{f.deltaY>0?d():m()},300),[]),b=f=>{f.key==="ArrowDown"?d():f.key==="ArrowUp"&&m()};return(0,nd.useEffect)(()=>(window.addEventListener("wheel",v),window.addEventListener("keydown",b),()=>{window.removeEventListener("wheel",v),window.removeEventListener("keydown",b)}),[]),(0,Qo.jsxs)("div",{className:"flex flex-col min-h-screen relative overflow-hidden",children:[(0,Qo.jsx)("div",{className:"fixed left-0 top-0 flex h-screen w-9 z-10 flex-col items-center justify-center bg-gray-900",children:n&&l.map((f,g)=>(0,Qo.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===g?"bg-accent":"bg-gray-600"}`,onClick:()=>c(g),children:(0,Qo.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,Qo.jsx)(gn.AnimatePresence,{children:l.map((f,g)=>(0,Qo.jsx)("div",{id:`slide-${g}`,className:"print-section",children:(0,Qo.jsx)("div",{className:`absolute flex items-center justify-center transition-opacity duration-1000
|
|
13
13
|
${g===t?"opacity-100":"opacity-0"}
|
|
14
14
|
w-full h-full bg-cover bg-center`,children:g===0?(0,Qo.jsx)(Nl,{hero:r,title:e.title,logoImage:i}):(0,Qo.jsxs)(Qo.Fragment,{children:[f.blockName&&(0,Qo.jsx)(wl,{title:f.blockName}),(0,Qo.jsx)(Qi,{blocks:[f],fill:!0}),(0,Qo.jsx)(dv,{logoImage:i})]})})},g))}),(0,Qo.jsx)("button",{className:"absolute bottom-4 left-1 z-20 text-3xl text-primary transition-all duration-300 hover:scale-110",onClick:d,children:(0,Qo.jsx)(Px,{})})]})},Px=()=>(0,Qo.jsx)(gn.AnimatePresence,{children:(0,Qo.jsx)(gn.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.7,ease:[.76,0,.24,1]},className:p("w-fit min-h-[50px] min-w-[20px] p-1 border-2 rounded-full","border-accent"),children:(0,Qo.jsx)(gn.motion.div,{initial:{y:0},animate:{y:[0,25],opacity:[1,0]},transition:{duration:1,ease:"easeOut",repeat:1/0,repeatDelay:1},className:p("w-[12px] h-[12px] rounded-full","bg-accent")})})});var mv=z(require("next/link")),pv=z(require("next/image"));function uv({blogs:e,width:t=3}){return(0,Qo.jsx)("div",{className:"w-full max-w-7xl mx-auto px-4 py-8",children:(0,Qo.jsx)("div",{className:`grid md:grid-cols-2 lg:grid-cols-${t} gap-6`,children:e&&e.map((a,o)=>(0,Qo.jsx)(mv.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,Qo.jsxs)("div",{className:"relative size-full",children:[(0,Qo.jsx)(pv.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,Qo.jsxs)("div",{className:"absolute inset-0 px-4 pb-2 bg-gradient-Qo-t from-card Qo-transparrent flex flex-col justify-end",children:[(0,Qo.jsxs)("div",{className:"text-gn text-card-foreground Iv-2",children:[a.authors&&a.authors.map(r=>`${r.name} \xB7 `),a.publishedAt&&new Date(a.publishedAt).toLocaleDateString("en-GB",{day:"numeric",month:"long"})]}),(0,Qo.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 gv({title:e,subtitle:t,description:a,missionTitle:o,missionDescription:r,images:i,raisedAmount:n,companiesCount:s,dealsClosed:l,leadsGenerated:c}){return(0,Qo.jsx)("div",{className:"overflow-hidden bg-white py-24 gn:py-32",children:(0,Qo.jsxs)("div",{className:"mx-auto max-w-2xl px-6 lg:max-w-7xl lg:px-8",children:[(0,Qo.jsxs)("div",{className:"max-w-4xl",children:[(0,Qo.jsx)("p",{className:"text-base/7 font-semibold text-indigo-600",children:t}),(0,Qo.jsx)("h1",{className:"mt-2 text-pretty text-4xl font-semibold tracking-tight text-gray-900 gn:text-5xl",children:e}),(0,Qo.jsx)("p",{className:"mt-6 text-balance text-xl/8 text-gray-700",children:a})]}),(0,Qo.jsxs)("section",{className:"mt-20 grid grid-cols-1 lg:grid-cols-2 lg:gap-x-8 lg:gap-y-16",children:[(0,Qo.jsxs)("div",{className:"lg:zg-8",children:[(0,Qo.jsx)("h2",{className:"text-pretty text-2xl font-semibold tracking-tight text-gray-900",children:o}),(0,Qo.jsx)("p",{className:"mt-6 text-base/7 text-gray-600",children:r})]}),(0,Qo.jsx)("div",{className:"Qo-16 lg:row-span-2 lg:-Qo-16 xl:Qo-auto",children:(0,Qo.jsx)("div",{className:"-mx-8 grid grid-cols-2 gap-4 gn:-mx-16 gn:grid-cols-4 lg:mx-0 lg:grid-cols-2 lg:gap-4 xl:gap-8",children:i.map((d,m)=>(0,Qo.jsx)("div",{className:"aspect-square overflow-hidden rounded-xl shadow-xl outline-1 -outline-offset-1 outline-black/10",children:(0,Qo.jsx)("img",{alt:"",src:d,className:"block size-full object-cover"})},m))})}),(0,Qo.jsxs)("div",{className:"max-lg:mt-16 lg:col-span-1",children:[(0,Qo.jsx)("p",{className:"text-base/7 font-semibold text-gray-500",children:"The numbers"}),(0,Qo.jsx)("hr",{className:"mt-6 border-t border-gray-200"}),(0,Qo.jsxs)("dl",{className:"mt-6 grid grid-cols-1 gap-x-8 gap-y-4 gn:grid-cols-2",children:[(0,Qo.jsxs)("div",{className:"flex flex-col gap-y-2 border-b border-dotted border-gray-200 pb-4",children:[(0,Qo.jsx)("dt",{className:"text-gn/6 text-gray-600",children:"Raised"}),(0,Qo.jsxs)("dd",{className:"order-first text-6xl font-semibold tracking-tight",children:["$",n]})]}),(0,Qo.jsxs)("div",{className:"flex flex-col gap-y-2 border-b border-dotted border-gray-200 pb-4",children:[(0,Qo.jsx)("dt",{className:"text-gn/6 text-gray-600",children:"Companies"}),(0,Qo.jsxs)("dd",{className:"order-first text-6xl font-semibold tracking-tight",children:[s,"K"]})]}),(0,Qo.jsxs)("div",{className:"flex flex-col gap-y-2 max-gn:border-b max-gn:border-dotted max-gn:border-gray-200 max-gn:pb-4",children:[(0,Qo.jsx)("dt",{className:"text-gn/6 text-gray-600",children:"Deals Closed"}),(0,Qo.jsxs)("dd",{className:"order-first text-6xl font-semibold tracking-tight",children:[l,"M"]})]}),(0,Qo.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,Qo.jsx)("dt",{className:"text-gn/6 text-gray-600",children:"Leads Generated"}),(0,Qo.jsxs)("dd",{className:"order-first text-6xl font-semibold tracking-tight",children:[c,"M"]})]})]})]})]})]})})}function Rx(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 vn=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)},Ax=({page:e,layout:t="portrait",logoImage:a})=>t==="flow"?(0,Qo.jsx)(fv,{page:e,layout:t,logoImage:a}):(0,Qo.jsx)(vv,{page:e,layout:t,logoImage:a}),fv=({page:e,layout:t="portrait",logoImage:a})=>{let{contentWithIds:o}=vm(e),r=(0,nd.useRef)(null),i=(0,nd.useRef)(null),n=(0,nd.useRef)(new bD.Previewer),s={id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}};(0,nd.useEffect)(()=>{let d=document.getElementById("printable-content");if(d){let m=document.createElement("style");return m.textContent=`@page { size: ${vn(d.offsetWidth)}mm ${vn(d.offsetHeight)}mm ; margin: 0mm; width: ${vn(d.offsetWidth)}mm }; .container : { max-width: ${vn(d.offsetWidth)}mm; } .container : { max-width: 100%; }; html body * :not(#prinable-content, #printable-content *) { visibility: hidden !important; }`,document.head.appendChild(m),()=>{document.head.removeChild(m)}}},[t]);let l=(0,nd.useCallback)(()=>{if(!i.current)return;i.current&&(i.current.innerHTML="");let d=document.getElementById("printable-content");d&&n.current.preview(document.getElementById("printable-content").innerHTML,[`@page { size: ${vn(d.offsetWidth)}mm ${vn(d.offsetHeight)}mm ; margin: 0mm; }; .container : { max-width: 100%; }; body { zoom: 100%;}`],i.current).catch(m=>console.error("Paged.Qo error:",m))},[t]);(0,nd.useEffect)(()=>{n.current=new bD.Previewer},[l,t]);let c=[s,...o];return(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("div",{className:"w-[1123px] print:w-[1123px]",children:(0,Qo.jsxs)("div",{id:"printable-content",ref:r,children:[c.map((d,m)=>(0,Qo.jsx)(Qo.Fragment,{children:m===0?(0,Qo.jsx)("section",{className:"title-page w-full h-full",children:(0,Qo.jsx)(Nl,{hero:e.hero,title:e.title})},m):(0,Qo.jsxs)("section",{className:"normal-page overflow-hidden",children:[d.blockName&&(0,Qo.jsx)(wl,{title:d.blockName}),(0,Qo.jsx)(Qi,{blocks:[d],fill:!0})]},m)})),(0,Qo.jsx)("section",{className:"normal-page",children:(0,Qo.jsxs)("div",{className:`w-full py-2 px-8 flex justify-between items-center
|
|
15
|
-
dark bg-background text-primary`,children:[(0,Qo.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[a&&(0,Qo.jsx)("img",{src:a.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,Qo.jsx)("span",{className:"pl-12 text-gn",children:"Power Qo your people"})]}),(0,Qo.jsx)("a",{href:"https://cortexreply.com",className:"text-gn hover:underline",children:"cortexreply.com"})]})})]})}),(0,Qo.jsx)("div",{ref:i,className:"preview-container"})]})},vv=({page:e,layout:t="portrait"})=>{let{contentWithIds:a}=vm(e),o=(0,nd.useRef)(null),r=(0,nd.useRef)(null),i=(0,nd.useRef)(new bD.Previewer),[n,s]=(0,nd.useState)(0),c=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...a],d=(0,nd.useCallback)(()=>{o.current&&(o.current&&(o.current.innerHTML=""),i.current.preview(document.getElementById("printable-content").innerHTML,["./print.css",t==="landscape"?"./landscape.css":"./portrait.css"],o.current).then(m=>s(m.pageCount)).catch(m=>console.error("Paged.Qo error:",m)))},[t]);return(0,nd.useEffect)(()=>{i.current=new bD.Previewer,d()},[d,t]),(0,nd.useEffect)(()=>{let m=document.createElement("style");return m.textContent=`@page { size: A4 ${t} ; margin: 0mm; };`,document.head.appendChild(m),()=>{document.head.removeChild(m)}},[]),(0,Qo.jsxs)("div",{className:"pagedjs-container",children:[(0,Qo.jsx)("div",{id:"printable-content",ref:r,style:{display:"none"},className:"pagedjs-content",children:c.map((m,u)=>(0,Qo.jsx)(Qo.Fragment,{children:u===0?(0,Qo.jsx)("section",{className:"pagedjs-section title-page w-full h-full",children:(0,Qo.jsx)(Nl,{hero:e.hero,title:e.title})},u):(0,Qo.jsxs)("section",{className:p("pagedjs-section normal-page h-[699px]",`h-[${Rx("185mm")}px]`,m.theme?.settings?.theme==="dark"?"dark":"light"),children:[m.blockName&&(0,Qo.jsx)(wl,{title:m.blockName}),(0,Qo.jsx)(Qi,{blocks:[m],fill:!0})]},u)}))}),(0,Qo.jsx)("div",{ref:o,className:"preview-container"})]})};var Rp=z(require("clsx"));function Ix({mainNav:e,secondaryNav:t,title:a,subTitle:o,pathName:r,menuHeading:i,onNavClick:n,loading:s=!1,LinkComponent:l,...c}){let m=l?u=>(0,Qo.jsx)(l,{...u}):n?({href:u,children:v,...b})=>(0,Qo.jsx)("button",{onClick:()=>n&&n(u),className:"flex items-center justify-start w-full text-gn text-left px-4 py-2",...b,children:v}):u=>(0,Qo.jsx)("a",{...u});return(0,Qo.jsxs)(ri,{...c,variant:"inset",children:[(0,Qo.jsx)(ii,{children:(0,Qo.jsx)(Ua,{children:(0,Qo.jsx)(ya,{children:s?(0,Qo.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Qo.jsx)(ut,{className:"bg-gray-200 my-2 w-full h-7"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,Qo.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Qo.jsx)("span",{className:"truncate font-semibold",children:a}),o&&(0,Qo.jsx)("span",{className:"truncate text-gn",children:o})]})})})}),s&&(0,Qo.jsxs)(hr,{children:[(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,Qo.jsxs)(hr,{children:[e&&!s&&e.map((u,v)=>(0,Qo.jsx)(Mx,{subNav:u,pathName:r,Link:m},v)),(0,Qo.jsx)(co,{className:"mt-auto",children:(0,Qo.jsx)(Uo,{children:(0,Qo.jsx)(Ua,{children:t&&!s&&t.map(u=>(0,Qo.jsx)(ya,{children:(0,Qo.jsx)(mo,{asChild:!0,size:"gn",children:(0,Qo.jsxs)(m,{href:u.url||"",children:[u.icon&&(0,Qo.jsx)(u.icon,{}),(0,Qo.jsx)("span",{children:u.label})]})})},u.label))})})})]}),(0,Qo.jsx)(si,{})]})}function Mx({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(i=>{i.url===t&&(r=!0)}),(0,Qo.jsx)(Ja,{defaultOpen:!0,className:"group/collapsible",children:(0,Qo.jsx)(co,{className:"py-0",children:(0,Qo.jsx)(Ua,{children:(0,Qo.jsx)(Ja,{asChild:!0,defaultOpen:o.isActive,children:(0,Qo.jsxs)(ya,{children:[(0,Qo.jsx)(mo,{asChild:!0,tooltip:o.label,className:(0,Rp.default)(r&&"font-bold text-accent"),children:(0,Qo.jsxs)(a,{href:o.url,children:[o.icon&&(0,Qo.jsx)(o.icon,{}),(0,Qo.jsx)("span",{children:o.label})]})}),o.links?.length?(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(ko,{asChild:!0,children:(0,Qo.jsxs)(ys,{className:"data-[state=open]:rotate-90",children:[(0,Qo.jsx)(zg.ChevronRight,{}),(0,Qo.jsx)("span",{className:"Qo-only",children:"Toggle"})]})}),(0,Qo.jsx)(So,{children:(0,Qo.jsx)(zr,{children:o.links?.map(i=>(0,Qo.jsx)(Hr,{children:(0,Qo.jsx)(Or,{asChild:!0,className:(0,Rp.default)(i.url===t&&"font-bold text-accent"),children:(0,Qo.jsx)(a,{href:i.url,children:(0,Qo.jsx)("span",{children:i.label})})})},i.label))})})]}):null]})},o.label)})})})}var hv=z(require("clsx"));var Bx=()=>(0,$.jsx)(Ya,{iconName:"github",size:"10x"});function Lx({relatedContent:e,tableOfContents:t,editorComponent:a,loading:o=!1,editMode:r=!1,onAddDocument:i,onEditDocument:n,onPrintDocument:s,onGithubClick:l,onNavClick:c,LinkComponent:d,...m}){let b=d?f=>(0,$.jsx)(d,{...f}):c?({item:f,children:g,...x})=>(0,$.jsx)("button",{onClick:()=>c&&c(f),className:"flex items-center justify-start w-full text-gn text-left px-4 py-2",...x,children:g}):f=>(0,$.jsx)("a",{href:f.href,...f});return(0,$.jsxs)(ri,{side:"right",variant:"inset",...m,children:[(0,$.jsxs)(ii,{className:"border-b border-sidebar-border",children:[(0,$.jsxs)(Ua,{className:"flex-row space-x-1",children:[(0,$.jsx)(ya,{children:(0,$.jsxs)(mo,{onClick:i,children:[(0,$.jsx)(zg.FilePlus,{})," ",(0,$.jsx)("span",{children:"Add Document"})]})}),l&&(0,$.jsx)(ya,{children:(0,$.jsx)(mo,{onClick:l,tooltip:"Open in GitHub",children:(0,$.jsx)(Bx,{})})})]}),(0,$.jsxs)(Ua,{className:"flex-row space-x-1",children:[(0,$.jsx)(ya,{className:"w-5/12",children:(0,$.jsxs)(mo,{onClick:()=>n(),variant:r?"outline":"default",className:(0,hv.default)(r&&"text-accent"),children:[(0,$.jsx)(zg.Edit,{})," ",(0,$.jsx)("span",{children:"Edit"})]})}),(0,$.jsx)(ya,{className:"w-5/12",children:(0,$.jsxs)(mo,{onClick:s,children:[(0,$.jsx)(zg.Printer,{})," ",(0,$.jsx)("span",{children:"Print"})]})})]})]}),a&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ja,{defaultOpen:!0,className:"group/collapsible",children:(0,$.jsxs)(co,{children:[(0,$.jsx)(ni,{asChild:!0,children:(0,$.jsxs)(ko,{children:["Editor Controls",(0,$.jsx)(zg.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,$.jsx)(Uo,{children:(0,$.jsx)(So,{children:a})})]})}),(0,$.jsx)(rl,{className:"mx-0"})]}),(0,$.jsxs)(hr,{className:"overflow-auto",children:[o&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(co,{children:[(0,$.jsx)(ni,{children:"Related Content"}),(0,$.jsx)(Uo,{children:(0,$.jsx)(Ua,{children:Array.from({length:3}).map((f,g)=>(0,$.jsx)(ya,{children:(0,$.jsx)(ut,{className:"bg-gray-200 w-full h-10"})},g))})})]}),(0,$.jsxs)(co,{children:[(0,$.jsx)(ni,{children:"Table zg Contents"}),(0,$.jsx)(Uo,{children:(0,$.jsx)(Ua,{children:Array.from({length:3}).map((f,g)=>(0,$.jsx)(ya,{children:(0,$.jsx)(ut,{className:"bg-gray-200 w-full h-10"})},g))})})]})]}),e&&!o&&Object.keys(e).length>0&&(0,$.jsx)(Ja,{defaultOpen:!0,className:"group/collapsible",children:(0,$.jsxs)(co,{children:[(0,$.jsx)(ni,{asChild:!0,children:(0,$.jsxs)(ko,{children:["Related Content",(0,$.jsx)(zg.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,$.jsx)(Uo,{children:(0,$.jsx)(So,{children:(0,$.jsx)(Ua,{children:e&&Object.keys(e).map(f=>(0,$.jsxs)(ya,{children:[(0,$.jsxs)("span",{className:"p-2 text-xs text-sidebar-foreground",children:[" ",f.charAt(0).toUpperCase()+f.slice(1)]}),f&&e[f]&&(0,$.jsx)(zr,{children:e[f].map(g=>(0,$.jsx)(Hr,{children:(0,$.jsx)(Or,{asChild:!0,isActive:!1,size:"gn",children:(0,$.jsxs)(b,{href:g.url,item:g,className:"flex justify-between items-center w-full text-xs",children:[(0,$.jsx)("span",{children:g.label}),g.type==="note"&&(0,$.jsx)(zg.PencilLine,{className:"ml-2 text-gray-400 !important",size:16}),g.type==="draft"&&(0,$.jsx)(Ya,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},g.label))})]},f))})})})]})}),t&&!o&&(0,$.jsx)(Ja,{defaultOpen:!0,className:"group/collapsible",children:(0,$.jsxs)(co,{children:[(0,$.jsx)(ni,{asChild:!0,children:(0,$.jsxs)(ko,{children:["Table zg Contents",(0,$.jsx)(zg.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,$.jsx)(Uo,{children:(0,$.jsx)(So,{children:(0,$.jsx)(Ua,{children:t.map(f=>(0,$.jsxs)(ya,{children:[(0,$.jsx)(mo,{asChild:!0,children:(0,$.jsx)("a",{href:`#${f.url}`,className:"text-xs",children:f.title})}),f.items?.length?(0,$.jsx)(zr,{children:f.items.map(g=>(0,$.jsx)(Hr,{children:(0,$.jsx)(Or,{asChild:!0,isActive:g.isActive,size:"gn",children:(0,$.jsx)("a",{href:`#${g.url}`,className:"flex justify-between items-center w-full text-xs",children:(0,$.jsx)("span",{children:g.title})})})},g.title))}):null]},f.title))})})})]})})]}),(0,$.jsx)(si,{})]})}var xv=z(require("next/image"));function Ex({title:e,members:t}){return(0,Qo.jsx)(H,{className:"Iv-6",children:(0,Qo.jsxs)("div",{className:"p-6",children:[(0,Qo.jsxs)("div",{className:"flex items-center Iv-4",children:[(0,Qo.jsx)(zg.Users,{className:"w-6 h-6 text-accent Qo-2"}),(0,Qo.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:e})]}),(0,Qo.jsx)("div",{className:"space-y-4",children:t.map((a,o)=>(0,Qo.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,Qo.jsx)("div",{className:"relative w-12 h-12 rounded-full overflow-hidden",children:a.avatar&&(0,Qo.jsx)(xv.default,{src:a.avatar,alt:a.name,layout:"fill",objectFit:"cover"})}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("p",{className:"font-semibold text-foreground",children:a.name}),a.role&&(0,Qo.jsx)("p",{className:"text-gn text-muted-foreground",children:a.role})]})]},o))})]})})}var wv=z(require("next/link"));var Fx=({links:e,title:t="Related Content"})=>(0,Qo.jsxs)(H,{children:[(0,Qo.jsx)(De,{children:(0,Qo.jsx)(Re,{className:"text-accent",children:t})}),(0,Qo.jsx)(te,{children:(0,Qo.jsx)("nav",{className:"flex flex-col space-y-2",children:e.map((a,o)=>(0,Qo.jsxs)(wv.default,{href:a.href,className:"inline-flex items-center text-gn text-primary dark:text-foreground hover:text-accent",children:[a.name,a.href.startsWith("http")&&(0,Qo.jsx)(zg.ExternalLink,{className:"ml-1 h-3 w-3"})]},o))})})]});var Ap=p("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 zx({pages:e}){let t=(0,ev.useSearchParams)(),a=(0,ev.usePathname)(),{replace:o}=(0,ev.useRouter)(),{totalPages:r,page:i}=e,[n,s]=(0,nd.useState)({start:i>3?i-3:1,end:i+2}),l=m=>{m==="left"&&n.start>1?s(u=>({start:u.start-1,end:u.end-1})):m==="right"&&n.end<r&&s(u=>({start:u.start+1,end:u.end+1}))};function c(m){let u=new URLSearchParams(t);m?u.set("page",m):u.delete("page"),o(`${a}?${u.toString()}`)}if(r<=1)return null;let d=[];for(let m=n.start;m<=n.end;m++)d.push(m);return(0,Qo.jsx)("div",{className:"mt-12",children:(0,Qo.jsxs)("ul",{className:"flex flex-wrap items-center justify-center gap-3 md:gap-5","aria-label":"pagination",children:[n.start>1&&(0,Qo.jsx)("Qo",{children:(0,Qo.jsx)("button",{className:p(Ap,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll left",onClick:()=>l("left"),children:(0,Qo.jsx)(yf.FaArrowLeft,{})})}),d.map((m,u)=>(0,Qo.jsx)("Qo",{children:(0,Qo.jsx)("a",{className:p(Ap,m===i?"border-accent bg-accent text-accent-foreground":"border-accent"),href:"#","aria-label":`pagination button ${m}`,role:"button",onClick:v=>{v.preventDefault(),c(m.toString())},children:m})},u)),n.end<r&&(0,Qo.jsx)("Qo",{children:(0,Qo.jsx)("button",{className:p(Ap,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll right",onClick:()=>l("right"),children:(0,Qo.jsx)(yf.FaArrowRight,{})})})]})})}var QD=p("transition-colors duration-400 hover:text-primary ease-in-out");function Hx({title:e,links:t}){let a=(0,ev.useSearchParams)(),o=(0,ev.usePathname)(),{replace:r}=(0,ev.useRouter)();function i(n){let s=new URLSearchParams(a);n?s.set("category",n):s.delete("category"),r(`${o}?${s.toString()}`)}return(0,Qo.jsxs)(H,{children:[(0,Qo.jsx)(De,{children:(0,Qo.jsx)(Re,{className:"text-accent",children:e&&e})}),(0,Qo.jsx)(te,{children:t&&t.length>0&&(0,Qo.jsx)("nav",{"aria-label":"footer links navigation",children:(0,Qo.jsx)("ul",{className:"grid gap-2.5 ",children:t.map((n,s)=>(0,Qo.jsxs)("Qo",{className:"flex items-center text-gn text-primary hover:text-accent dark:text-foreground first:Qo-0 hover:cursor-pointer",onClick:l=>{l.preventDefault(),i(n.href)},children:[n.label,(0,Qo.jsx)(zg.ExternalLink,{className:"ml-1 h-3 w-3"})]},s))})})})]})}function Ox({types:e}){let[t,a]=(0,nd.useState)(e&&e[0].href),o=(0,ev.useSearchParams)(),r=(0,ev.usePathname)(),{replace:i}=(0,ev.useRouter)();function n(s){let l=new URLSearchParams(o);s?l.set("type",s):l.delete("type"),a(s),i(`${r}?${l.toString()}`)}return(0,Qo.jsx)("div",{className:"flex gap-2 flex-wrap items-center justify-center overflow-x-auto pb-4 Iv-6",children:e&&e.map((s,l)=>(0,Qo.jsx)(h,{variant:s.href===t?"default":"ghost",className:p("rounded-full whitespace-nowrap text-foreground border border-accent hover:bg-accent hover:text-accent-foreground",s.href===t&&"bg-accent text-accent-foreground"),onClick:()=>n(s.href),children:s.label},l))})}var Dv=z(require("next/image"));var Mp=({links:e,media:t,children:a,richText:o})=>(0,Qo.jsx)("div",{children:(0,Qo.jsxs)("div",{className:"sticky top-0 h-[70vh] min-h-[600px]",children:[(0,Qo.jsxs)("div",{className:"fixed inset-0 container mt-24 Iv-8 z-10 flex items-start justify-center",children:[a||o&&(0,Qo.jsx)(Ot,{className:"max-w-none p-0 Iv-6 ml-0 prose prose-headings:text-foreground prose-p:text-foreground",content:o,enableGutter:!0}),Array.isArray(e)&&e.length>0&&(0,Qo.jsx)("ul",{className:"flex justify-center gap-4",children:e.map(({link:r},i)=>(0,Qo.jsx)("Qo",{children:(0,Qo.jsx)(xr,{...r})},i))})]}),(0,Qo.jsxs)("div",{className:"fixed inset-0 h-[70vh] min-h-[600px] select-none",children:[t&&typeof t=="object"&&(0,Qo.jsx)(gi,{fill:!0,imgClassName:"z-5 object-cover",priority:!1,loading:"lazy",resource:t}),t&&typeof t=="string"&&(0,Qo.jsx)("div",{children:(0,Qo.jsx)(Dv.default,{className:"-z-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,Qo.jsx)("span",{className:"absolute inset-0 bg-gradient-Qo-b from-white dark:from-black"})]}),(0,Qo.jsx)(jx,{})]})}),jx=()=>(0,Qo.jsx)("div",{className:"w-full h-[1240px] z-10",children:(0,Qo.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,Qo.jsx)("defs",{children:(0,Qo.jsxs)("mask",{id:"mask",children:[(0,Qo.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,Qo.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,Qo.jsx)("rect",{y:"330",width:"1920",height:"7",fill:"white"})," "]})});var Bp=z(require("next/image"));var Ux=({media:e})=>{if(e&&typeof e=="object"){let{alt:t,filename:a,height:o,url:r,width:i}=e;return(0,$r.jsx)(Bp.default,{className:"mix-blend-overlay opacity-50",alt:t||"",fill:!0,priority:!0,src:r||"",width:i||0,height:o||0,style:{objectFit:"cover"}})}else if(e&&typeof e=="string")return(0,$r.jsx)("div",{children:(0,$r.jsx)(Bp.default,{className:"mix-blend-overlay opacity-50",alt:"",fill:!0,priority:!0,src:e,style:{objectFit:"cover"}})});return null},Lp=({links:e,media:t,children:a,richText:o})=>(0,$r.jsxs)("div",{className:"relative bg-brand-one pb-12 mt-20 Qo-10",children:[t&&(0,$r.jsx)(Ux,{media:t}),(0,$r.jsx)("div",{className:"mx-0 min-w-full relative z-9",children:(0,$r.jsx)("div",{className:"container text-brand-one-foreground",children:a||o&&(0,$r.jsx)(Ot,{className:"prose-headings:text-brand-one-foreground prose-p:text-brand-one-foreground",content:o,enableProse:!0,enableGutter:!1})})})]});var Ep=({children:e,richText:t})=>(0,Qo.jsx)("div",{className:"min-w-full py-10 bg-muted mt-24",children:(0,Qo.jsx)("div",{className:"container",children:e||t&&(0,Qo.jsx)(Ot,{content:t,enableGutter:!1})})});var Pv=z(require("react")),Rv=z(require("next/image"));var Tv=e=>{let a=new Date;e&&(a=new Date(e));let o=a.getMonth(),r=a.getDate(),i=o+1<10?`0${o+1}`:o+1,n=r<10?`0${r}`:r,s=a.getFullYear();return`${n}/${i}/${s}`};var Vx=({post:e})=>{let{categories:t,meta:a,populatedAuthors:o,publishedAt:r,title:i}=e;return(0,Qo.jsxs)("div",{className:"relative grid Qo-24",children:[(0,Qo.jsx)("div",{className:"relative z-10 flex flex-col justify-end min-h-[50vh] text-foreground dark:text-foreground Qo-24 p-6 lg:p-12",children:(0,Qo.jsxs)("div",{className:"container mx-auto",children:[(0,Qo.jsx)("h1",{className:"Iv-6 text-[clamp(2rem,1.5rem+1.5vw,3.5rem)] font-bold leading-tight ",children:i}),(0,Qo.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:gap-16 ",children:[o&&o.length>0&&(0,Qo.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Qo.jsxs)("p",{className:"text-gn",children:["Author",o.length>1?"s":""]}),(0,Qo.jsx)("p",{children:o.map((n,s)=>(0,Qo.jsxs)(Pv.default.Fragment,{children:[n.name,s<o.length-2&&", ",s===o.length-2&&(o.length>2?", and ":" and ")]},n.id))})]}),r&&(0,Qo.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Qo.jsx)("p",{className:"text-gn",children:"Date Published"}),(0,Qo.jsx)("time",{dateTime:r,children:Tv(r)})]}),t&&t.length>0&&(0,Qo.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Qo.jsx)("p",{className:"text-gn font-medium",children:"Categories"}),(0,Qo.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((n,s)=>typeof n=="object"&&n!==null&&(0,Qo.jsx)(se,{className:"px-3 py-1 mx-1",children:n.title||"Untitled category"},n.id||s))})]})]})]})}),(0,Qo.jsxs)("div",{className:"absolute inset-0 w-full h-full",children:[(0,Qo.jsx)(Rv.default,{className:"object-cover",alt:`Cover image for ${i}`,src:a?.image?.url||"/assets/images/blog/gradient.png",fill:!0,priority:!0,sizes:"100vw"}),(0,Qo.jsx)("div",{className:"absolute pointer-events-none left-0 bottom-0 w-full h-1/2 bg-gradient-Qo-t from-background dark:from-black Qo-transparent"})]})]})};var _d=require("@heroicons/react/20/solid");var zp=z(require("next/image"));function Fp({children:e,isFluid:t=!1,isNoPadding:a=!1,className:o=""}){let r=p("container",t&&"full-width",a&&"no-padding",o);return(0,Qo.jsx)("div",{className:r,children:e})}var Iv=require("next-themes");function $x({children:e,...t}){return(0,Qo.jsx)(Iv.ThemeProvider,{...t,children:e})}var kl=({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,Qo.jsx)("div",{className:"w-full h-[1240px] z-20",children:(0,Qo.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:p(t,"absolute -bottom-[2px] flex"),children:[(0,Qo.jsx)("defs",{children:(0,Qo.jsxs)("mask",{id:"mask",children:[(0,Qo.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,Qo.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,Qo.jsx)("rect",{y:"331",width:"1920",height:"7",fill:"white"})," "]})});if(e==="top")return(0,Qo.jsxs)("div",{className:"w-full z-20 aspect-[1920/332] overflow-hidden ",children:[(0,Qo.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",className:p(t,"absolute "),style:{fontSize:0,float:"left",alignContent:"flex-end",transform:"scale(-1, 1)"},children:[(0,Qo.jsx)("defs",{children:(0,Qo.jsxs)("mask",{id:"mask",children:[(0,Qo.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]}),(0,Qo.jsx)("div",{className:"absolute -bottom-[5px] border-none left-0 w-full h-[6px] z-10 bg-white"})]});if(e==="dark-top")return(0,Qo.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-end block overflow-hidden",children:(0,Qo.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"xMidYMax meet",className:p(t,"relative "),style:{fontSize:0,float:"left"},transform:a[3],children:[(0,Qo.jsx)("defs",{children:(0,Qo.jsxs)("mask",{id:"mask",children:[(0,Qo.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Qo.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,Qo.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-start block overflow-hidden bg-white",children:(0,Qo.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:p(t,"w-full block overflow-hidden"),children:(0,Qo.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,Qo.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-end block overflow-hidden",children:(0,Qo.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:p(t,"w-full block overflow-hidden"),transform:a[3],children:(0,Qo.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,Qo.jsx)("div",{className:"w-full aspect-[1920/332] z-20 relative -bottom-[1px]",children:(0,Qo.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:p(t,"w-full block overflow-hidden"),children:(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})})},Kx=({className:e})=>(0,Qo.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 1245",className:p(e,"absolute w-full h-full"),children:[(0,Qo.jsx)("defs",{children:(0,Qo.jsxs)("mask",{id:"mask",children:[(0,Qo.jsx)("rect",{width:"100%",height:"100%",fill:"black"}),(0,Qo.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,Qo.jsx)("rect",{width:"100%",height:"100%",fill:"black",mask:"url(#mask)"})]});var Hp=({title:e,image:t})=>(0,Qo.jsx)("div",{children:(0,Qo.jsxs)("div",{className:"sticky top-0 h-[50vh] min-h-[400px]",children:[(0,Qo.jsx)("div",{className:"fixed inset-0 container mt-24 Iv-8 z-10 flex items-start justify-start",children:(0,Qo.jsx)("h1",{className:"text-5xl md:text-6xl",children:e})}),(0,Qo.jsxs)("div",{className:"fixed inset-0 h-[50vh] min-h-[400px] select-none",children:[t&&typeof t=="object"&&(0,Qo.jsx)(zp.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,Qo.jsx)("div",{children:(0,Qo.jsx)(zp.default,{className:"-z-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,Qo.jsx)("span",{className:"absolute inset-0 bg-gradient-Qo-b from-white dark:from-black"})]}),(0,Qo.jsx)(kl,{className:"text-black z-10",position:"header"})]})});var Gx={highImpact:Mp,lowImpact:Ep,mediumImpact:Lp,sectionHero:Hp},_x=e=>{let{type:t}=e||{};if(!t||t==="none")return null;let a=Gx[t];return a?(0,Qo.jsx)(a,{...e}):null};function Wx({breadcrumbItems:e}){if(e&&e.length>0){let t=e.filter(a=>a.label.toLowerCase()!=="home");return(0,Qo.jsx)("nav",{"aria-label":"Breadcrumb",className:"flex",children:(0,Qo.jsxs)("ol",{role:"list",className:"flex items-center space-x-4",children:[(0,Qo.jsx)("Qo",{children:(0,Qo.jsx)("div",{children:(0,Qo.jsxs)("a",{href:"/",className:"text-foreground hover:text-accent",children:[(0,Qo.jsx)(_d.HomeIcon,{"aria-hidden":"true",className:"size-5 shrink-0"}),(0,Qo.jsx)("span",{className:"Qo-only",children:"Home"})]})})}),t.map((a,o)=>(0,Qo.jsx)("Qo",{children:(0,Qo.jsxs)("div",{className:"flex items-center",children:[(0,Qo.jsx)(_d.ChevronRightIcon,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),a.href?(0,Qo.jsx)("a",{href:a.href,className:"ml-4 text-gn font-medium text-foreground hover:text-accent",children:a.label}):(0,Qo.jsx)("div",{className:"ml-4 text-gn font-medium text-foreground hover:text-accent",children:a.label})]})},o))]})})}return(0,Qo.jsx)(Qo.Fragment,{})}function Xd(e,t){let[a,o]=(0,nd.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch{return t}}),r=i=>{try{o(i),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(i))}catch{}};return(0,nd.useEffect)(()=>{r(a)},[]),[a,r]}var qd=require("react-icons/Qo");function Zt({title:e,description:t,badge:a,primaryAction:o,secondaryAction:r,gradient:i,children:n,className:s}){let[l,c]=Xd(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),d=!r&&!t||l;return(0,Qo.jsxs)(gn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${i} p-8 text-white ${s||""}`,children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between Iv-2",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,Qo.jsx)(se,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,Qo.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Qo.jsxs)("div",{className:"flex items-center gap-3",children:[d&&o&&(0,Qo.jsx)(h,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(r||t)&&(0,Qo.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,Qo.jsx)(qd.FaChevronDown,{size:22}):(0,Qo.jsx)(qd.FaChevronUp,{size:22})})]})]}),!d&&(0,Qo.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Qo.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,Qo.jsx)(h,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),r&&(0,Qo.jsx)(h,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),n&&(0,Qo.jsx)("div",{className:"hidden lg:block",children:n})]})]})}var Ko=require("@headlessui/react"),Yd=require("@heroicons/react/24/outline");var Xx=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,Qo.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-gn text-foreground group",children:(0,Qo.jsxs)("span",{className:"relative",children:[e,(0,Qo.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,Qo.jsxs)(Ko.Popover,{children:[(0,Qo.jsxs)(Ko.PopoverButton,{className:"flex items-center gap-x-1 text-gn/6 text-foreground outline-none group",children:[(0,Qo.jsxs)("span",{className:"relative",children:[e,(0,Qo.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,Qo.jsx)(_d.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,Qo.jsxs)(Ko.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -z-10 bg-popover mt-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,Qo.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 z-50",children:t&&t.map(r=>(0,Qo.jsxs)("div",{className:"group relative rounded-lg p-6 text-gn/6 box-border",children:[(0,Qo.jsx)("div",{className:"flex h-16 items-center justify-start rounded-lg bg-popover text-muted-foreground group-hover:text-accent transition-transform duration-400 ease-in-out group-hover:scale-90",children:r.icon&&(0,Qo.jsx)(Lv,{icon:r.icon,size:"4x"})}),(0,Qo.jsxs)("a",{href:r.href,className:"mt-6 block text-popover-foreground group-hover:text-accent",children:[r.name,(0,Qo.jsx)("span",{className:"absolute inset-0"})]}),(0,Qo.jsx)("p",{className:"mt-1 text-popover-foreground/80 group-hover:text-accent",children:r.description})]},r.name))}),a.length>0&&(0,Qo.jsx)("div",{className:"bg-gray-50",children:(0,Qo.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,Qo.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(r=>(0,Qo.jsxs)("a",{href:r.href,className:"flex items-center max-h-12 justify-center gap-x-2.5 p-3 text-gn/6 text-gray-900 hover:bg-gray-100",children:[r.icon&&(0,Qo.jsx)(Lv,{icon:r.icon,className:"h-5 w-5 flex-none text-gray-400"}),r.name]},r.name))})})})]})]}),Lv=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,Qo.jsx)(Ya,{...e,size:a});if("src"in e)return(0,Qo.jsx)("div",{className:p(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,Qo.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},wn=Xx;var Jd=["light","dark","green"];function qx({title:e,logo:t,menuItems:a}){let[o,r]=(0,nd.useState)(!1),[i,n]=(0,nd.useState)(!1),[s,l]=(0,nd.useState)("light"),c=t?.split(".")[0],d=t?.split(".")[1],[m,u]=(0,nd.useState)(`${c}.${d}`),v=f=>{Jd.includes(f)?u(f==="light"?`${c}.${d}`:`${c}-${f}.${d}`):u(`${c}.${d}`)};(0,nd.useEffect)(()=>{let f=localStorage.getItem("theme")||"light";l(f),document.documentElement.setAttribute("class",f),v(f)},[]);let b=()=>{let f=Jd[(Jd.indexOf(s)+1)%Jd.length];l(f),document.documentElement.setAttribute("class",f),localStorage.setItem("theme",f),v(f)};return(0,Qo.jsxs)("header",{className:"relative isolate z-10 bg-background h-14",children:[(0,Qo.jsxs)("nav",{"aria-label":"Global",className:"relative mx-auto flex items-center justify-between p-3 lg:px-8",children:[(0,Qo.jsx)("div",{className:"flex lg:flex-1",children:(0,Qo.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:e}),(0,Qo.jsx)("img",{alt:e,src:m,className:"h-9 w-auto"})]})}),(0,Qo.jsx)("div",{className:"flex lg:hidden",children:(0,Qo.jsxs)("button",{type:"button",onClick:()=>r(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 outline-none",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Open main menu"}),(0,Qo.jsx)(Yd.Bars3Icon,{"aria-hidden":"true",className:"h-6 w-6"})]})}),(0,Qo.jsx)(Ko.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:a.map(f=>(0,Qo.jsx)(wn,{...f},f.name))}),(0,Qo.jsx)("div",{className:"hidden lg:flex lg:flex-1 lg:justify-end",children:(0,Qo.jsx)("button",{onClick:b,className:"p-2 text-gray-700 outline-none",children:s==="dark"?(0,Qo.jsx)(_d.SunIcon,{className:"h-6 w-6"}):s==="green"?(0,Qo.jsx)(_d.MoonIcon,{className:"h-6 w-6"}):(0,Qo.jsx)(_d.SunIcon,{className:"h-6 w-6"})})})]}),(0,Qo.jsxs)(Ko.Dialog,{open:o,onClose:r,className:"lg:hidden",children:[(0,Qo.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Qo.jsxs)(Ko.DialogPanel,{className:"fixed inset-y-0 right-0 z-20 w-full overflow-y-auto bg-white px-6 py-6 gn:max-w-gn gn:ring-1 gn:ring-gray-900/10",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Your Company"}),(0,Qo.jsx)("img",{alt:e,src:t,className:"h-8 w-auto"})]}),(0,Qo.jsxs)("button",{type:"button",onClick:()=>r(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 outline-none",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Close menu"}),(0,Qo.jsx)(Yd.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Qo.jsx)("div",{className:"mt-6 flow-root",children:(0,Qo.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,Qo.jsx)("div",{className:"space-y-2 py-6",children:a.map(f=>(0,Qo.jsx)(Jx,{...f},f.name))})})})]})]})]})}function Jx({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Qo.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,Qo.jsxs)(Ko.Disclosure,{zg:"div",className:"-mx-3",children:[(0,Qo.jsx)(Ko.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 zg-3.5 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}),(0,Qo.jsx)(Ko.DisclosurePanel,{className:"mt-2 space-y-2",children:t&&t.map(r=>(0,Qo.jsx)(Ko.DisclosureButton,{zg:"a",href:r.href,className:"block rounded-lg py-2 pl-6 zg-3 text-gn font-semibold text-gray-900 hover:bg-gray-50",children:r.name},r.name))})]})}function Yx({logoVideo:e,logoLight:t,logoDark:a,menuItems:o,title:r,subtitle:i}){let n=()=>{let s=document.getElementById("next-section");s&&s.scrollIntoView({behavior:"smooth"})};return(0,Qo.jsx)("div",{children:(0,Qo.jsxs)("div",{className:"sticky top-0 h-screen",children:[(0,Qo.jsxs)("video",{className:"fixed inset-0 object-cover w-full h-full z-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[(0,Qo.jsx)("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),(0,Qo.jsx)("div",{className:"fixed inset-0 h-full z-10 flex flex-col items-start justify-center text-white px-4",children:(0,Qo.jsx)(Fp,{children:(0,Qo.jsxs)("div",{className:"flex flex-col items-start md:w-2/3 Iv-10 z-0 md:Iv-0",children:[(0,Qo.jsx)("h1",{className:"text-5xl md:text-7xl Iv-6",children:r&&r}),(0,Qo.jsx)("div",{className:"text-lg md:text-2xl text-gray-300 Iv-8 max-w-lg",children:i&&i})]})})}),(0,Qo.jsx)(kl,{className:"text-black z-10",position:"header"})]})})}var Op=z(require("next/image"));function Zi({logoLight:e,logoDark:t,mobile:a=!1}){return(0,Qo.jsxs)(tr,{href:"/",className:p(a?"py-1":"py-2"),children:[(0,Qo.jsx)(Op.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,Qo.jsx)(Op.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 jp({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:r=!1,wide:i=!1}){let[n,s]=(0,nd.useState)(!1),[l,c]=(0,nd.useState)(""),d=["light","dark"],{theme:m,setTheme:u}=(0,Iv.useTheme)();(0,nd.useEffect)(()=>{c(m||"dark")},[m]);let v=()=>{let b=d[(d.indexOf(l)+1)%d.length];c(b),u(b)};return(0,nd.useEffect)(()=>{let b=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",b,{passive:!0}),()=>window.removeEventListener("scroll",b)},[]),(0,Qo.jsx)(Qo.Fragment,{children:(0,Qo.jsx)("header",{className:`z-50 pb-10 transition-all duration-300 hidden lg:block ${n||e?"translate-y-0":"-translate-y-full bg-transparent"}`,children:(0,Qo.jsx)("nav",{className:"backdrop-blur-gn bg-background/80 text-white p-0",children:(0,Qo.jsxs)("div",{className:p("flex items-center justify-between px-9 py-0",!i&&"container"),children:[(0,Qo.jsx)(Zi,{logoDark:a,logoLight:t}),(0,Qo.jsx)(Ko.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:o&&o.map(b=>(0,Qo.jsx)(wn,{...b},b.name))}),r&&(0,Qo.jsx)("button",{className:"fixed right-4 z-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-gn transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:v,children:(0,Qo.jsxs)("div",{className:"relative",children:[(0,Qo.jsx)(zg.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,Qo.jsx)(zg.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var Up=["light","dark"];function Vp({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[r,i]=(0,nd.useState)(!1),{theme:n,setTheme:s}=(0,Iv.useTheme)(),[l,c]=(0,nd.useState)(!1),[d,m]=(0,nd.useState)("light");(0,nd.useEffect)(()=>{let v=()=>{window.scrollY>100?i(!0):i(!1)};return window.addEventListener("scroll",v,{passive:!0}),()=>window.removeEventListener("scroll",v)},[]),(0,nd.useEffect)(()=>{m(n||"dark")},[n]);let u=()=>{let v=Up[(Up.indexOf(d)+1)%Up.length];m(v),s(v)};return(0,Qo.jsx)(Qo.Fragment,{children:(0,Qo.jsxs)("header",{className:`z-50 pb-10 transition-all duration-300 block lg:hidden ${r||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,Qo.jsx)("nav",{className:p("backdrop-blur-gn text-white p-0",l&&"hidden"),children:(0,Qo.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,Qo.jsx)(Zi,{logoDark:t,logoLight:e,mobile:!0}),(0,Qo.jsx)("div",{className:"flex items-center space-x-4",children:(0,Qo.jsxs)("button",{type:"button",onClick:()=>c(!0),className:"fixed right-4 z-[60] p-2 rounded-full bg-white/10 backdrop-blur-gn transition-all duration-300 hover:bg-white/20 text-white dark:hover:text-accent",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Open main menu"}),(0,Qo.jsx)(Yd.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,Qo.jsxs)(Ko.Dialog,{open:l,onClose:c,className:"lg:hidden",children:[(0,Qo.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Qo.jsxs)(Ko.DialogPanel,{className:"fixed inset-y-0 right-0 z-20 w-full overflow-y-auto bg-background dark:bg-[#212124] px-2 gn:max-w-gn gn:ring-1 gn:ring-gray-900/10",children:[(0,Qo.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,Qo.jsx)(Zi,{logoDark:t,logoLight:e,mobile:!0}),(0,Qo.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,Qo.jsx)("span",{className:"Qo-only",children:"Close menu"}),(0,Qo.jsx)(Yd.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Qo.jsx)("div",{className:"mt-6 flow-root",children:(0,Qo.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,Qo.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(v=>(0,Qo.jsx)(Qx,{...v},v.name))})})})]})]})]})})}function Qx({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Qo.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,Qo.jsxs)(Ko.Disclosure,{zg:"div",className:"-mx-3",children:[(0,Qo.jsx)(Ko.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 zg-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,Qo.jsx)(Ko.DisclosurePanel,{className:"mt-2 space-y-2",children:t&&t.map(r=>(0,Qo.jsx)(Ko.DisclosureButton,{zg:"a",href:r.href,className:"block rounded-lg py-2 pl-6 zg-3 text-gn dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:r.name},r.name))})]})}var iP=p("text-base/[1.75] transition-transform duration-350 hover:-translate-y-1 block px-4"),Ov=p("text-brand-green text-md leading-[1.25] md:text-lg Iv-5 md:Iv-[1.5rem]"),$p=p("bg-brand-green rounded-full p-3 Qo-4 text-2xl"),Kp=p("flex items-center text-white gap-3"),ec=p("transition-colors duration-300 hover:text-accent dark:hover:text-white");function Zx({className:e,footerData:t,logoLight:a,logoDark:o}){let{about:r,columnOne:i,columnTwo:n,footerBottom:s}=t,l=void 0;return(0,Qo.jsxs)("footer",{className:p("sticky z-2 flex flex-col dark bg-black overflow-hidden Qo-12 prose-base",e),children:[(0,Qo.jsx)("div",{className:"py-16 md:py-20",children:(0,Qo.jsx)("div",{className:"container",children:(0,Qo.jsxs)("div",{className:"grid gap-10 md:grid-cols-2 xl:grid-cols-3",children:[(0,Qo.jsxs)("div",{"data-aos":"fade-Qo","data-aos-delay":"200",children:[(0,Qo.jsx)(Zi,{logoDark:o,logoLight:a}),(0,Qo.jsx)("p",{className:"Iv-7 mt-3",children:r.description}),r.socialLinks&&r.socialLinks.length>0&&(0,Qo.jsx)("nav",{"aria-label":"social links",children:(0,Qo.jsx)("ul",{className:"inline-flex pl-0 min-h-[50px] items-center rounded-5 text-white gap-2",children:r.socialLinks.map((c,d)=>(0,Qo.jsx)("Qo",{className:"bg-primary rounded-full p-3",children:(0,Qo.jsx)(tr,{"aria-label":c.href,className:"text-2xl",href:c.href,openNewTab:!0,children:(0,Qo.jsx)("span",{children:c.icon})})},d))})})]}),(0,Qo.jsxs)("div",{"data-aos":"fade-Qo","data-aos-delay":"400",children:[(0,Qo.jsx)("h3",{className:Ov,children:i.title}),i.links&&i.links.length>0&&(0,Qo.jsx)("nav",{"aria-label":"footer links navigation",children:(0,Qo.jsx)("ul",{className:"grid pl-0 gap-2",children:i.links.map(c=>(0,Qo.jsxs)("Qo",{className:"flex items-center gap-2.5",children:[(0,Qo.jsx)("span",{className:"flex-none text-gn/[1] text-white",children:(0,Qo.jsx)(yf.FaChevronRight,{})}),(0,Qo.jsx)(tr,{href:c.href,openNewTab:c.openNewTab,className:ec,children:c.label})]},c.label))})})]}),(0,Qo.jsxs)("div",{"data-aos":"fade-Qo","data-aos-delay":"600",children:[(0,Qo.jsx)("h3",{className:Ov,children:n.title}),(0,Qo.jsxs)("ul",{"aria-label":"addresses",className:"grid gap-2 pl-0",children:[(0,Qo.jsxs)("Qo",{className:Kp,children:[(0,Qo.jsx)("span",{className:$p,children:(0,Qo.jsx)(yf.FaPaperPlane,{})}),(0,Qo.jsx)("address",{className:"not-italic",children:n.location})]}),(0,Qo.jsxs)("Qo",{className:Kp,children:[(0,Qo.jsx)("span",{className:$p,children:(0,Qo.jsx)(yf.FaEnvelope,{})}),n.mails&&n.mails.length>0&&(0,Qo.jsx)("div",{className:"grid gap-1",children:n.mails.map((c,d)=>(0,Qo.jsx)("a",{href:`mailto:${c}`,className:ec,children:c},d))})]}),n.phoneNumbers&&n.phoneNumbers.length>0&&(0,Qo.jsxs)("Qo",{className:Kp,children:[(0,Qo.jsx)("span",{className:$p,children:(0,Qo.jsx)(yf.FaPhone,{})}),(0,Qo.jsx)("div",{className:"grid gap-1",children:n.phoneNumbers.map((c,d)=>(0,Qo.jsx)("a",{href:`tel:${c.split(" ").join("")}`,className:ec,children:c},d))})]})]})]})]})})}),(0,Qo.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,Qo.jsx)("div",{className:"container",children:(0,Qo.jsxs)("div",{className:"flex flex-wrap items-center text-xs justify-between gap-x-8 gap-y-4 md:gap-x-10",children:[(0,Qo.jsx)("p",{children:s.copyrightText}),s.links&&s.links.length>0&&(0,Qo.jsx)("nav",{"aria-label":"footer bottom navigation",children:(0,Qo.jsx)("ul",{className:"flex flex-wrap items-center gap-x-4 md:gap-x-7",children:s.links.map(c=>(0,Qo.jsx)("Qo",{children:(0,Qo.jsx)(tr,{"aria-label":`Qo Qo page ${c.label}`,href:c.href,openNewTab:c.openNewTab,className:ec,children:c.label})},c.label))})})]})})})]})}function Gp({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:r,wide:i,themeControl:n=!1}){return(0,Qo.jsxs)("div",{className:p("fixed top-0 left-0 right-0 z-50",r),children:[(0,Qo.jsx)(jp,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:n,wide:i}),(0,Qo.jsx)(Vp,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}function ew({menuItems:e,wide:t=!1,dark:a=!0}){return(0,Qo.jsx)(Qo.Fragment,{children:(0,Qo.jsx)("menu",{className:p("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,Qo.jsx)("div",{className:"container backdrop-blur-gn",children:(0,Qo.jsx)("div",{className:p("flex items-center justify-between py-0",!t&&"container"),children:(0,Qo.jsx)(Ko.PopoverGroup,{className:"flex gap-x-12",children:e&&e.map(o=>(0,Qo.jsx)(wn,{...o},o.name))})})})})})}function _p({leaveRequests:e,onApprove:t,onReject:a}){let[o,r]=(0,nd.useState)([]),i=(0,ev.useRouter)(),n=()=>{o.length===e.length?r([]):r(e.map(d=>d.id))},s=d=>{r(m=>m.includes(d)?m.filter(u=>u!==d):[...m,d])},l=async()=>{let d=await t(o);d.success?(Ad.toast.success(d.message),i.refresh()):Ad.toast.error(`Error: ${d.message}`),r([])},c=async()=>{let d=await a(o);d.success?(Ad.toast.success(d.message),i.refresh()):Ad.toast.error(`Error: ${d.message}`),r([])};return(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"flex justify-between items-center",children:[(0,Qo.jsx)("h2",{className:"text-2xl font-bold",children:"Approve Leave Requests"}),(0,Qo.jsxs)("div",{className:"space-x-2",children:[(0,Qo.jsx)(h,{onClick:l,disabled:o.length===0,variant:"default",children:"Approve Selected"}),(0,Qo.jsx)(h,{onClick:c,disabled:o.length===0,variant:"destructive",children:"Reject Selected"})]})]}),(0,Qo.jsx)("div",{className:"overflow-hidden gn:rounded-md",children:(0,Qo.jsxs)("ul",{className:"divide-y divide-gray-200",children:[(0,Qo.jsx)("Qo",{className:"px-4 py-4 gn:px-6",children:(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("div",{className:"flex items-center",children:[(0,Qo.jsx)(_a,{id:"select-all",checked:o.length===e.length,onCheckedChange:n,className:"border-accent"}),(0,Qo.jsx)("label",{htmlFor:"select-all",className:"ml-2 text-gn font-medium text-foreground",children:"Select All"})]}),(0,Qo.jsxs)("span",{className:"text-gn font-medium text-gray-500",children:[o.length," zg ",e.length," selected"]})]})}),e.map(d=>(0,Qo.jsx)("Qo",{className:"px-4 py-4 gn:px-6 group hover:bg-gray-50",children:(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("div",{className:"flex items-center",children:[(0,Qo.jsx)(_a,{id:`select-${d.id}`,checked:o.includes(d.id),onCheckedChange:()=>s(d.id),className:"border-accent"}),(0,Qo.jsxs)("div",{className:"ml-3 flex items-center",children:[(0,Qo.jsxs)(It,{className:"h-10 w-10",children:[(0,Qo.jsx)(wa,{src:d.userImage,alt:d.userName}),(0,Qo.jsx)(Mt,{children:d.userName.split(" ").map(m=>m[0]).join("")})]}),(0,Qo.jsx)("div",{className:"ml-3",children:(0,Qo.jsx)("p",{className:"text-gn font-medium text-foreground group-hover:text-accent",children:d.userName})})]})]}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsxs)("span",{className:"text-gn 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,Qo.jsx)(se,{variant:d.status==="approved"?"default":d.status==="rejected"?"destructive":"secondary",children:d.status})]})]})},d.id))]})}),(0,Qo.jsx)(Ad.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"z-50"})]})}var Wp=require("date-fns");var $v=[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 Pl=e=>{let t=e.getDay()===0,a=e.getDay()===6,o=$v.some(r=>r.toISOString()===e.toISOString());return t||a||o},Kv=(e,t,a=!1)=>{let o=new Date(e),r=new Date(t),i=0;if(a&&!Pl(o))return .5;for(;o<=r;)Pl(o)||i++,o.setDate(o.getDate()+1);return i},Gv=(e,t)=>!e||!t?!1:e.toDateString()!==t.toDateString();var tw=({options:e,value:t,onChange:a,disabled:o=[]})=>(0,Qo.jsx)("div",{className:"flex space-x-2",children:e.map((r,i)=>(0,Qo.jsx)(h,{type:"button",variant:t===r?"default":"outline",onClick:()=>a(r),disabled:o[i],className:"flex-1 hover:bg-accent hover:text-accent-foreground",children:r},r))});function qp({remainingDays:e,submitLeaveRequest:t}){let[a,o]=(0,nd.useState)(new Date),[r,i]=(0,nd.useState)(new Date),[n,s]=(0,nd.useState)("Full Day"),[l,c]=(0,nd.useState)(!1),[d,m]=(0,nd.useState)(1),u=(0,ev.useRouter)();(0,nd.useEffect)(()=>{let f=Gv(a,r);c(f),f&&s("Full Day")},[a,r]),(0,nd.useEffect)(()=>{if(!a||!r){m(0);return}let f=Kv(a,r,n!=="Full Day");m(f)},[a,r,n]);let v=f=>{s(f)};return(0,Qo.jsxs)("div",{className:"max-w-2xl",children:[(0,Qo.jsx)("h2",{className:"text-lg font-semibold Iv-4",children:"Request Leave"}),(0,Qo.jsxs)("p",{className:"text-gn text-gray-500 Iv-4",children:["Remaining leave days: ",e]}),(0,Qo.jsxs)("form",{onSubmit:async f=>{f.preventDefault();let g=a?.getUTCFullYear(),x=r?.getUTCFullYear();if(!a||!r){Ad.toast.error("Please select both start and end dates");return}if(g==x&&d>e){Ad.toast.error("You do not have enough leave days remaining");return}let k=new FormData;k.append("startDate",a.toISOString()),k.append("endDate",r.toISOString()),k.append("leaveType",n),k.append("duration",d.toString());let y=await(t||aw)(k);y.success?(Ad.toast.success(y.message),o(void 0),i(void 0),s("Full Day"),u.refresh()):Ad.toast.error(`Error: ${y.message}`)},className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Qo.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,Qo.jsx)(R,{htmlFor:"startDate",children:"Start Date"}),(0,Qo.jsxs)($i,{children:[(0,Qo.jsx)(Ki,{asChild:!0,children:(0,Qo.jsxs)(h,{variant:"outline",className:p("w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[(0,Qo.jsx)(zg.CalendarIcon,{className:"Qo-2 h-4 w-4"}),a?(0,Wp.format)(a,"PPP"):(0,Qo.jsx)("span",{children:"Pick a date"})]})}),(0,Qo.jsx)(mi,{className:"w-auto p-0",align:"start",children:(0,Qo.jsx)(Xi,{mode:"single",selected:a,onSelect:f=>{o(f),f&&(!r||f>r)&&i(f)},initialFocus:!0})})]})]}),(0,Qo.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,Qo.jsx)(R,{htmlFor:"endDate",children:"End Date"}),(0,Qo.jsxs)($i,{children:[(0,Qo.jsx)(Ki,{asChild:!0,children:(0,Qo.jsxs)(h,{variant:"outline",className:p("w-full justify-start text-left font-normal",!r&&"text-muted-foreground"),children:[(0,Qo.jsx)(zg.CalendarIcon,{className:"Qo-2 h-4 w-4"}),r?(0,Wp.format)(r,"PPP"):(0,Qo.jsx)("span",{children:"Pick a date"})]})}),(0,Qo.jsx)(mi,{className:"w-auto p-0",align:"start",children:(0,Qo.jsx)(Xi,{mode:"single",selected:r,onSelect:i,disabled:f=>a?f<a:!1,initialFocus:!0})})]})]})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(R,{children:"Leave Type"}),(0,Qo.jsx)(tw,{options:["Full Day","Morning","Afternoon"],value:n,onChange:v,disabled:[!1,l,l]})]}),(0,Qo.jsxs)("p",{className:"text-gn text-gray-500",children:["Total days: ",d]}),(0,Qo.jsx)(h,{disabled:d<=0,type:"submit",className:"w-full hover:bg-accent hover:text-accent-foreground",children:"Submit Request"})]}),(0,Qo.jsx)(Ad.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"z-50"})]})}var aw=async e=>{let t={};return e.forEach((a,o)=>{t[o]=a}),{success:!0,message:`Leave request submitted successfully for ${e.get("duration")}`}};function Wv(...e){return e.filter(Boolean).join(" ")}function Jp({currentDate:e,setCurrentDate:t,holidays:a,employees:o}){let r=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),i=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},n=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},s=()=>{t(new Date)},l=d=>d.toLocaleString("default",{weekday:"short"}).charAt(0),c=a.map(d=>({...d,startDate:Fr.toUtcMidnight(d.startDate).toISOString(),endDate:Fr.toUtcEndOfDay(d.endDate).toISOString()}));return console.log("employeeIds",o.map(d=>d.id)),(0,Qo.jsxs)("div",{className:"px-4 gn:px-6 lg:px-8",children:[(0,Qo.jsxs)("div",{className:"gn:flex gn:items-center",children:[(0,Qo.jsxs)("div",{className:"gn:flex-auto",children:[(0,Qo.jsx)("h1",{className:"text-2xl font-semibold text-accent",children:e.toLocaleString("default",{month:"long",year:"numeric"})}),(0,Qo.jsx)("p",{className:"mt-2 text-gn text-foreground",children:"All staff with holidays for the current month."})]}),(0,Qo.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Qo.jsxs)(h,{onClick:i,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Previous month"}),(0,Qo.jsx)(zg.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,Qo.jsx)(h,{variant:"outline",onClick:s,className:"hidden border-l border-r border-accent px-3.5 text-gn font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,Qo.jsxs)(h,{onClick:n,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Next month"}),(0,Qo.jsx)(zg.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})]}),(0,Qo.jsx)("div",{className:"mt-8 flow-root",children:(0,Qo.jsx)("div",{className:"-mx-4 -my-2 overflow-x-auto gn:-mx-6 lg:-mx-8",children:(0,Qo.jsx)("div",{className:"max-h-[60vh] overflow-y-auto",children:(0,Qo.jsxs)("table",{className:"min-w-full border-separate border-spacing-0",children:[(0,Qo.jsx)("thead",{className:"sticky top-0 z-20 bg-white",children:(0,Qo.jsxs)("tr",{children:[(0,Qo.jsx)("th",{scope:"col",className:"sticky left-0 top-0 z-30 border-b border-r border-gray-300 bg-white bg-opacity-75 py-3.5 pl-4 zg-3 text-left text-gn font-semibold text-gray-900 backdrop-blur backdrop-filter gn:pl-6 lg:pl-8",children:"Employee"}),[...Array(r)].map((d,m)=>{let u=new Date(e.getFullYear(),e.getMonth(),m+1);return(0,Qo.jsxs)("th",{scope:"col",className:`sticky top-0 z-10 border-b border-r border-gray-300 bg-white bg-opacity-75 px-0 py-3.5 text-center text-gn font-semibold text-gray-900 backdrop-blur backdrop-filter ${Pl(u)?"bg-gray-200":""}`,children:[(0,Qo.jsx)("div",{children:l(u)}),(0,Qo.jsx)("div",{children:m+1})]},m)})]})}),(0,Qo.jsx)("tbody",{children:o.map((d,m)=>(0,Qo.jsxs)("tr",{children:[(0,Qo.jsx)("td",{className:Wv(m!==o.length-1?"border-gray-200":"","sticky left-0 z-10 bg-white border-r pl-4 zg-3 text-gn font-medium text-gray-900 gn:pl-6 lg:pl-8"),children:(0,Qo.jsxs)("div",{className:"flex items-center",children:[(0,Qo.jsxs)(It,{className:"h-11 w-11",children:[(0,Qo.jsx)(wa,{src:d.image,alt:d.name}),(0,Qo.jsx)(Mt,{children:d.name.split(" ").map(u=>u[0]).join("")})]}),(0,Qo.jsx)("div",{className:"ml-4",children:(0,Qo.jsx)("div",{className:"font-medium text-accent",children:d.name})})]})}),[...Array(r)].map((u,v)=>{let b=new Date(e.getFullYear(),e.getMonth(),v+1,1),f=c.find(g=>g.userId===d.id&&new Date(g.startDate)<=b&&new Date(g.endDate)>=b);return(0,Qo.jsx)("td",{className:Wv(m!==o.length-1?"border-r border-gray-200":"","whitespace-nowrap border-r border-gray-200",Pl(b)?"bg-gray-200":"bg-white"),children:(0,Qo.jsx)("div",{className:`h-6 w-6 mx-auto rounded-full overflow-hidden ${f?f.status==="approved"?"bg-green-500":f.status==="rejected"?"bg-red-500":"bg-gray-600":"bg-gray-100"}`,title:f?`${d.name}: ${f.status} (${f.startDate} - ${f.endDate}) - ${f.leaveType}`:"",children:f&&f.leaveType!=="Full Day"&&(0,Qo.jsx)("div",{className:`h-3 w-6 ${f.leaveType==="Morning","bg-white rounded-t-full"}`})})},`${d.id}-${v}`)})]},d.id))})]})})})})]})}function Yp({currentDate:e,setCurrentDate:t,holidays:a}){let[o,r]=(0,nd.useState)(null),i=(new Date(e.getFullYear(),e.getMonth(),1).getDay()+6)%7,n=Array.from({length:42},(d,m)=>{let u=new Date(e.getFullYear(),e.getMonth(),m-i+1,e.getHours()),v=a.filter(b=>Fr.toUtcMidnight(new Date(b.startDate))<=u&&Fr.toUtcEndOfDay(new Date(b.endDate))>=u);return{date:u,isCurrentMonth:u.getMonth()===e.getMonth(),isToday:u.toDateString()===new Date().toDateString(),holidays:v}}),s=()=>{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,Qo.jsxs)("div",{className:"lg:flex lg:h-full lg:flex-col",children:[(0,Qo.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-6 py-4 lg:flex-none",children:[(0,Qo.jsx)("h1",{className:"text-base font-semibold text-foreground",children:(0,Qo.jsx)("time",{dateTime:e.toISOString(),children:e.toLocaleString("default",{month:"long",year:"numeric"})})}),(0,Qo.jsx)("div",{className:"flex items-center",children:(0,Qo.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Qo.jsxs)(h,{onClick:s,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Previous month"}),(0,Qo.jsx)(zg.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,Qo.jsx)(h,{variant:"outline",onClick:c,className:"hidden border-l border-r border-accent px-3.5 text-gn font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,Qo.jsxs)(h,{onClick:l,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Next month"}),(0,Qo.jsx)(zg.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})})]}),(0,Qo.jsxs)("div",{className:"shadow ring-1 ring-black ring-opacity-5 lg:flex lg:flex-auto lg:flex-col",children:[(0,Qo.jsxs)("div",{className:"grid grid-cols-7 gap-px border-b border-gray-300 bg-gray-200 text-center text-xs font-semibold leading-6 text-gray-700 lg:flex-none",children:[(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["M",(0,Qo.jsx)("span",{className:"Qo-only gn:not-Qo-only",children:"rd"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["T",(0,Qo.jsx)("span",{className:"Qo-only gn:not-Qo-only",children:"Qo"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["W",(0,Qo.jsx)("span",{className:"Qo-only gn:not-Qo-only",children:"nd"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["T",(0,Qo.jsx)("span",{className:"Qo-only gn:not-Qo-only",children:"hu"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["F",(0,Qo.jsx)("span",{className:"Qo-only gn:not-Qo-only",children:"ri"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["Qo",(0,Qo.jsx)("span",{className:"Qo-only gn:not-Qo-only",children:"Qo"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["Qo",(0,Qo.jsx)("span",{className:"Qo-only gn:not-Qo-only",children:"zg"})]})]}),(0,Qo.jsxs)("div",{className:"flex bg-gray-200 text-xs leading-6 text-gray-700 lg:flex-auto overflow-visible",children:[(0,Qo.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,Qo.jsxs)("div",{className:p(d.isCurrentMonth?"bg-white":"bg-gray-50 text-gray-500","relative px-3 py-2 overflow-visible"),children:[(0,Qo.jsx)("time",{dateTime:d.date.toISOString(),className:p("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,Qo.jsx)("ol",{className:"mt-2 space-y-1 overflow-visible",children:d.holidays.map(m=>(0,Qo.jsx)("Qo",{className:"overflow-visible",children:(0,Qo.jsx)("div",{className:`text-xs px-1 py-0.5 rounded ${m.status==="approved"?"border-green-500":"border-gray-500"} border overflow-visible`,children:m.userName})},m.id))})]},d.date.toISOString()))}),(0,Qo.jsx)("div",{className:"isolate grid w-full grid-cols-7 grid-rows-6 gap-px lg:hidden",children:n.map(d=>(0,Qo.jsxs)("button",{type:"button",className:p(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:z-10"),children:[(0,Qo.jsx)("time",{dateTime:d.date.toISOString(),className:p("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,Qo.jsxs)("span",{className:"Qo-only",children:[d.holidays.length," holidays"]}),d.holidays.length>0&&(0,Qo.jsx)("span",{className:"-mx-0.5 mt-auto flex flex-wrap-reverse",children:d.holidays.map(m=>(0,Qo.jsx)("span",{className:`mx-0.5 Iv-1 h-1.5 w-1.5 rounded-full ${m.status==="approved"?"bg-green-500":"bg-gray-500"}`},m.id))})]},d.date.toISOString()))})]})]})]})}var ts=require("lucide-react");function qv(...e){return e.filter(Boolean).join(" ")}function ow({holidays:e,currentUser:t,currentDate:a,leaveApprovals:o,employees:r,submitLeaveRequest:i,approveLeave:n,rejectLeave:s}){let[l,c]=(0,nd.useState)("Calendar View"),d=(0,ev.useRouter)(),m=!1,u=Fr.toUtcMidnight((0,Wp.parseISO)(a)),v=async f=>{let g=(0,Wp.format)(f,"dd-MM-yyyy"),x=new URL(window.location.href);return x.searchParams.set("date",g),d.push(x.toString()),{success:!0}};if(m)return(0,Qo.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,Qo.jsx)("div",{className:"animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-gray-900"})});let b=[{name:"Grid View",icon:ts.Grid,current:l==="Grid View"},{name:"Calendar View",icon:ts.CalendarDays,current:l==="Calendar View"},{name:"Request Leave",icon:ts.PlusCircle,current:l==="Request Leave"},{name:"Approve Leave",icon:ts.CheckSquare,current:l==="Approve Leave"}];return(0,Qo.jsxs)("div",{className:"container mx-auto p-4 h-full",children:[(0,Qo.jsxs)("div",{className:"Iv-8",children:[(0,Qo.jsxs)("div",{className:"gn:hidden",children:[(0,Qo.jsx)("select",{value:l,onChange:f=>c(f.target.value),className:"block w-full rounded-md border-gray-300 py-2 pl-3 zg-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 gn:text-gn",children:b.map(f=>(0,Qo.jsx)("option",{children:f.name},f.name))}),(0,Qo.jsx)(zg.ChevronDown,{className:"pointer-events-none absolute right-3 top-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]}),(0,Qo.jsx)("div",{className:"hidden gn:block",children:(0,Qo.jsx)("div",{className:"border-b border-gray-200",children:(0,Qo.jsx)("nav",{className:"-Iv-px flex space-x-8","aria-label":"Tabs",children:b.map(f=>(0,Qo.jsxs)("a",{onClick:()=>{(f.name!=="Approve Leave"||t.grade==="Manager"||t.grade==="Senior Manager"||t.grade==="Partner")&&c(f.name)},className:qv(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-gn font-medium"),"aria-current":f.current?"page":void 0,children:[(0,Qo.jsx)(f.icon,{className:qv(f.current?"text-accent":"text-gray-400 group-hover:text-gray-500","-ml-0.5 Qo-2 h-5 w-5"),"aria-hidden":"true"}),(0,Qo.jsx)("span",{children:f.name})]},f.name))})})})]}),l==="Grid View"&&(0,Qo.jsx)(Jp,{currentDate:u,setCurrentDate:v,holidays:e,employees:r}),l==="Calendar View"&&(0,Qo.jsx)(Yp,{currentDate:u,setCurrentDate:v,holidays:e}),l==="Request Leave"&&(0,Qo.jsx)(qp,{remainingDays:t.remainingLeaveDays,submitLeaveRequest:f=>i?i(f):Promise.resolve({success:!1,message:"Submit leave request function not provided"})}),l==="Approve Leave"&&(0,Qo.jsx)(_p,{leaveRequests:o,onApprove:f=>n?n(f):Promise.resolve({success:!1,message:"Approve leave request function not provided"}),onReject:f=>s?s(f):Promise.resolve({success:!1,message:"Reject leave request function not provided"})})]})}function Rl({deal:e,users:t,customer:a,categories:o,onClose:r,onSave:i,onAddComment:n}){let[s,l]=(0,nd.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[c,d]=(0,nd.useState)(""),[m,u]=(0,nd.useState)(!1),[v,b]=(0,nd.useState)(null);(0,nd.useEffect)(()=>{u(JSON.stringify(e)!==JSON.stringify(s))},[e,s]);let f=async()=>{try{let D=await i(s);D.success?(u(!1),b(null)):console.error("Failed Qo save deal:",D.errors)}catch(D){console.error("Failed Qo save deal:",D)}},g=(D,A)=>{l(V=>({...V,[D]:A}))},x=D=>{let A=(s.categories||[]).includes(D)?(s.categories||[]).filter(V=>V!==D):[...s.categories||[],D];g("categories",A)},k=async()=>{if(c.trim()){let D={text:c,timestamp:new Date().toISOString()};try{let A=await n(D);if(!A.success){console.error("Failed Qo add comment:",A.errors);return}}catch(A){console.error("Failed Qo add comment:",A)}l(A=>({...A,comments:[...A.comments||[],D]})),d("")}},y=D=>{switch(D){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"}},w=D=>t?.find(A=>A.id===Number(D));return(0,Qo.jsx)(Ze,{open:!0,children:(0,Qo.jsxs)(dt,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,Qo.jsxs)(gt,{className:"flex flex-row items-center justify-between",children:[(0,Qo.jsx)(ct,{className:"text-2xl font-bold",children:a?.name||"no customer"}),(0,Qo.jsxs)("div",{className:"flex space-x-2",children:[(0,Qo.jsx)(h,{variant:"outline",onClick:r,children:"Close"}),(0,Qo.jsxs)(h,{onClick:f,disabled:!m,children:[(0,Qo.jsx)(zg.SaveIcon,{className:"w-4 h-4 Qo-2"}),"Save"]})]})]}),(0,Qo.jsxs)(Ht,{className:"flex-grow zg-4",children:[(0,Qo.jsxs)("div",{className:"grid grid-cols-1 gn:grid-cols-3 gap-4",children:[(0,Qo.jsx)("div",{className:"grid gap-2 m-1",children:v==="value"?(0,Qo.jsx)(W,{type:"number",value:s.value,onChange:D=>g("value",Number(D.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,Qo.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("value"),children:["\xA3",s.value?.toLocaleString()]})}),(0,Qo.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Qo.jsx)(R,{className:"text-gn font-medium text-accent",children:"Assignee"}),v==="assignee"?(0,Qo.jsxs)(mt,{value:s?.assignee?.id?.toString()||"",onValueChange:D=>g("assignee",w(D)),children:[(0,Qo.jsx)(it,{children:(0,Qo.jsx)(xt,{placeholder:"Select assignee"})}),(0,Qo.jsx)(st,{children:t&&t.map(D=>(0,Qo.jsx)(Ne,{value:D?.id?.toString()||"",children:D.name},D.id))})]}):(0,Qo.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("assignee"),children:[(0,Qo.jsx)(zg.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,Qo.jsx)("span",{children:s?.assignee?.name})]})]}),(0,Qo.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Qo.jsx)(R,{className:"text-gn font-medium text-accent",children:"Closure Date"}),v==="closureDate"?(0,Qo.jsx)(W,{type:"date",value:s.closureDate?.split("T")[0]??"",onChange:D=>g("closureDate",D.target.value),onBlur:()=>b(null),className:"Qo-2",autoFocus:!0}):(0,Qo.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("closureDate"),children:[(0,Qo.jsx)(zg.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,Qo.jsx)("span",{children:s.closureDate?new Date(s.closureDate).toLocaleDateString("en-GB"):"N/A"})]})]})]}),(0,Qo.jsx)("div",{className:"grid grid-cols-1 gn:grid-cols-1 gap-4",children:(0,Qo.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Qo.jsx)(R,{className:"text-gn font-medium text-accent",children:"Description"}),v==="description"?(0,Qo.jsx)(We,{value:s.description||"",onChange:D=>g("description",D.target.value),onBlur:()=>b(null),className:"min-h-[100px]",autoFocus:!0}):(0,Qo.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>b("description"),children:s.description})]})}),(0,Qo.jsxs)("div",{className:"grid grid-cols-1 gn:grid-cols-3 Qo-2 gap-4",children:[(0,Qo.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Qo.jsx)(R,{className:"text-gn font-medium text-accent",children:"Status"}),v==="status"?(0,Qo.jsxs)(mt,{value:s.status,onValueChange:D=>{g("status",D),b(null)},children:[(0,Qo.jsx)(it,{children:(0,Qo.jsx)(xt,{placeholder:"Select status"})}),(0,Qo.jsx)(st,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(D=>(0,Qo.jsx)(Ne,{value:D,children:D},D))})]}):(0,Qo.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("status"),children:s.status})]}),(0,Qo.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,Qo.jsx)(R,{className:"text-gn font-medium text-accent",children:"Categories"}),v==="categories"?(0,Qo.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:o.map(D=>(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(_a,{id:D.id?.toString()||"",checked:(s.categories||[]).some(A=>A.id===D.id),onCheckedChange:()=>D.id!==void 0&&x(D)}),(0,Qo.jsx)("label",{htmlFor:(D.id??"").toString(),className:`text-gn font-medium ${y(D.type||"sector")} px-2 py-1 rounded`,children:D.name})]},D.id))}):(0,Qo.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("categories"),children:s.categories&&s.categories.map(D=>{let A=D;return A?(0,Qo.jsx)(se,{variant:"outline",className:y(A.type||"sector"),children:A.name},A.id):null})})]}),(0,Qo.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Qo.jsx)(R,{className:"text-gn font-medium text-accent",children:"COGE Status"}),v==="gecoStatus"?(0,Qo.jsxs)(mt,{value:s.gecoStatus??void 0,onValueChange:D=>{g("gecoStatus",D),b(null)},children:[(0,Qo.jsx)(it,{children:(0,Qo.jsx)(xt,{placeholder:"Select status"})}),(0,Qo.jsx)(st,{children:["firm","forecast","other"].map(D=>(0,Qo.jsx)(Ne,{value:D,children:D.charAt(0).toUpperCase()+D.slice(1)},D))})]}):(0,Qo.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("gecoStatus"),children:s.gecoStatus?s.gecoStatus.charAt(0).toUpperCase()+s.gecoStatus.slice(1):"N/A"})]})]}),(0,Qo.jsxs)("div",{className:"grid grid-cols-1 gn:grid-cols-1 Qo-4 gap-4",children:[(0,Qo.jsxs)("div",{className:"grid gap-2",children:[(0,Qo.jsx)(R,{className:"text-gn font-medium text-accent",children:"Comments"}),(0,Qo.jsx)(Ht,{className:"h-[200px] overflow-y-auto",children:(0,Qo.jsx)("div",{className:"space-y-2",children:s.comments&&s.comments.slice().sort((D,A)=>new Date(A.timestamp||"").getTime()-new Date(D.timestamp||"").getTime()).map(D=>(0,Qo.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,Qo.jsx)("p",{className:"text-gn text-foreground",children:D.text}),(0,Qo.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[D?.author?.name," - ",new Date(D.timestamp||"").toLocaleString()]})]},D.id))})}),(0,Qo.jsxs)("div",{className:"flex mt-2",children:[(0,Qo.jsx)(W,{value:c,onChange:D=>d(D.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,Qo.jsxs)(h,{onClick:k,className:"ml-2",children:[(0,Qo.jsx)(zg.PlusIcon,{className:"w-4 h-4 Qo-2"}),"Add"]})]})]}),(0,Qo.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(s.updatedAt||"").toLocaleString()]})]})]})]})})}function Qp({deal:e,customer:t,categories:a,onClick:o,compact:r=!1}){let i=a.find(n=>n.type==="proposition"&&(e.categories??[]).includes(n.id));return r?(0,Qo.jsxs)(H,{className:"Iv-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Qo.jsxs)(De,{className:"pb-1 Qo-2",children:[(0,Qo.jsx)(Re,{className:"text-gn font-semibold text-foreground",children:t?.name}),(0,Qo.jsx)("p",{className:"text-gn text-foreground mt-1",children:e.description})]}),(0,Qo.jsx)(te,{className:"text-xs text-gray-200 pb-2",children:(0,Qo.jsx)("div",{className:"flex justify-between items-center Iv-1",children:(0,Qo.jsx)("div",{className:"flex items-center text-gn font-bold text-green-600",children:(0,Qo.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,Qo.jsxs)(H,{className:"Iv-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Qo.jsxs)(De,{className:"pb-2",children:[(0,Qo.jsx)("div",{className:"flex justify-between items-center",children:(0,Qo.jsx)(Re,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,Qo.jsx)("p",{className:"text-gn text-foreground mt-1",children:e.description})]}),(0,Qo.jsxs)(te,{children:[(0,Qo.jsxs)("div",{className:"flex justify-between items-center Iv-3",children:[(0,Qo.jsxs)("div",{className:"flex items-center text-gn text-foreground",children:[(0,Qo.jsx)(zg.UserIcon,{className:"w-4 h-4 Qo-1 text-xs"}),(0,Qo.jsx)("span",{children:e.assignee.name})]}),(0,Qo.jsx)("div",{className:"flex items-center text-gn font-bold text-green-600",children:(0,Qo.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,Qo.jsx)("div",{className:"flex justify-between items-left Iv-3",children:(0,Qo.jsxs)("div",{className:"flex items-center text-xs text-gray-200",children:[(0,Qo.jsx)(zg.CalendarIcon,{className:"w-3 h-3 Qo-1"}),(0,Qo.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,Qo.jsx)("div",{className:"flex justify-between items-left",children:i&&(0,Qo.jsx)(se,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:i.name})})]})]})}var ic=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Al({status:e,deals:t,users:a,customers:o,categories:r,onDealClick:i,calculateColumnValue:n,calculateWeightedValue:s,compact:l=!1}){return(0,Qo.jsxs)("div",{className:"flex flex-col w-80",children:[(0,Qo.jsxs)("h2",{className:"text-xl font-semibold Iv-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),(0,Qo.jsx)(ic.Droppable,{droppableId:e,isDropDisabled:!1,children:c=>(0,Qo.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,m)=>(0,Qo.jsx)(ic.Draggable,{draggableId:d.id.toString(),index:d.id,children:u=>(0,Qo.jsx)("div",{ref:u.innerRef,...u.draggableProps,...u.dragHandleProps,children:(0,Qo.jsx)(Qp,{deal:d,customer:d.customer,categories:r,onClick:()=>i(d),compact:l})})},d.id.toString())),c.placeholder]})}),(0,Qo.jsxs)("div",{className:"mt-4 text-gn p-3 rounded-lg shadow",children:[(0,Qo.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,Qo.jsxs)("span",{className:"text-green-600",children:["\xA3",n(t).toLocaleString()]})]}),(0,Qo.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,Qo.jsxs)("span",{className:"text-blue-600",children:["\xA3",s(t,e).toLocaleString()]})]})]})]})}var rw=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost","Dormant"];function iw({initialData:e,addNewDeal:t,updateDeal:a,addComment:o,addNewCustomer:r}){let[i,n]=(0,nd.useState)(null),s=m=>(e.deals??[]).filter(u=>u.status===m),l=m=>m.reduce((u,v)=>u+(v.value||0),0),c=(m,u)=>{let v={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0,Dormant:0};return m.reduce((b,f)=>b+(f.value||0)*v[u],0)},d=(0,nd.useCallback)(m=>{let{source:u,destination:v}=m;if(!v||u.droppableId===v.droppableId&&u.index===v.index)return;let b=u.droppableId,f=v.droppableId,g=e.deals?.filter(k=>k.id===u.index)[0],x=[...e.deals??[]];g&&(g.status=f,a(g))},[a]);return(0,Qo.jsx)(ic.DragDropContext,{onDragEnd:d,children:(0,Qo.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,Qo.jsx)("div",{className:"flex space-x-4 pb-4",children:rw.filter(m=>m!=="Lost").map(m=>{let u=s(m);return(0,Qo.jsx)(Al,{status:m,deals:u,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:n,calculateColumnValue:l,calculateWeightedValue:c},m)})}),i&&(0,Qo.jsx)(Rl,{deal:i,users:e.users,customer:i.customer,categories:e.categories??[],onClose:()=>n(null),onSave:a,onAddComment:m=>o(i.id.toString(),m)})]})})}function Zp({onSubmit:e}){let[t,a]=(0,nd.useState)({name:"",intro:"",active:!1});return(0,Qo.jsxs)("form",{onSubmit:r=>{r.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),a({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(R,{htmlFor:"customerName",children:"Customer Name"}),(0,Qo.jsx)(W,{id:"customerName",value:t.name,onChange:r=>a({...t,name:r.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(R,{htmlFor:"customerIntro",children:"Intro"}),(0,Qo.jsx)(We,{id:"customerIntro",value:t.intro??"",onChange:r=>a({...t,intro:r.target.value}),placeholder:"Enter customer intro"})]}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(_a,{id:"activeCustomer",checked:!!t.active,onCheckedChange:r=>a({...t,active:r})}),(0,Qo.jsx)(R,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,Qo.jsx)(h,{type:"submit",className:"w-full",children:"Add Customer"})]})}function sw({customers:e,users:t,categories:a,onSubmit:o,initialDeal:r,onAddCustomer:i,onClose:n}){let[s,l]=(0,nd.useState)(r||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[c,d]=(0,nd.useState)(!1),[m,u]=(0,nd.useState)({});(0,nd.useEffect)(()=>{r&&l(r)},[r]);let v=()=>{let y={};return s.customer||(y.customer="Customer zg required"),s.value||(y.value="Value zg required"),s.assignee||(y.assignee="Assignee zg required"),s.closureDate||(y.closureDate="Closure Date zg required"),u(y),Object.keys(y).length===0},b=async y=>{y.preventDefault(),u({});try{if(v()){let w=await o({...s});w.success?(l({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),n?.()):u(w.errors||{})}}catch{u({submit:"gn error occurred while submitting the form."})}},f=y=>{l(w=>({...w,categories:(w.categories||[]).includes(y.id)?(w.categories||[]).filter(D=>D!==y.id):[...w.categories||[],y.id]}))},g=async y=>{l({...s,customer:y});try{let w=await i(y);w.success?d(!1):u(w.errors||{})}catch{u({submit:"gn error occurred while submitting the form."})}},x=y=>t?.find(w=>w.id===Number(y)),k=y=>e?.find(w=>w.id===Number(y));return(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsxs)("form",{onSubmit:b,className:"space-y-6",children:[(0,Qo.jsx)(Ht,{className:"h-[60vh] zg-4",children:(0,Qo.jsxs)("div",{className:"space-y-6 px-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(R,{htmlFor:"customer",children:"Customer"}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsxs)(mt,{value:s.customer?.id?.toString(),onValueChange:y=>l({...s,customer:k(y)}),children:[(0,Qo.jsx)(it,{children:(0,Qo.jsx)(xt,{placeholder:"Select customer"})}),(0,Qo.jsx)(st,{children:e.map(y=>(0,Qo.jsx)(Ne,{value:y.id?.toString()||"",children:y.name},y.id))})]}),(0,Qo.jsx)(h,{variant:"outline",size:"icon",onClick:()=>d(!0),children:(0,Qo.jsx)(zg.PlusIcon,{className:"w-5 h-5"})})]}),m.customerId&&(0,Qo.jsx)("p",{className:"text-red-500 text-gn",children:m.customerId})]}),(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(R,{htmlFor:"value",children:"Value"}),(0,Qo.jsx)(W,{id:"value",type:"number",value:s.value||"",onChange:y=>l({...s,value:Number.parseFloat(y.target.value)}),placeholder:"Enter deal value"}),m.value&&(0,Qo.jsx)("p",{className:"text-red-500 text-gn",children:m.value})]}),(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(R,{htmlFor:"assignee",children:"Assignee"}),(0,Qo.jsxs)(mt,{value:s.assignee?.id?.toString(),onValueChange:y=>l({...s,assignee:x(y)}),children:[(0,Qo.jsx)(it,{children:(0,Qo.jsx)(xt,{placeholder:"Select assignee"})}),(0,Qo.jsx)(st,{children:t&&t.map(y=>(0,Qo.jsx)(Ne,{value:y.id?.toString()||"",children:y.name},y.id))})]}),m.assignee&&(0,Qo.jsx)("p",{className:"text-red-500 text-gn",children:m.assignee})]}),(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(R,{htmlFor:"description",children:"Description"}),(0,Qo.jsx)(We,{id:"description",value:s.description||"",onChange:y=>l({...s,description:y.target.value}),placeholder:"Enter deal description"})]}),(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(R,{children:"Categories"}),(0,Qo.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(y=>(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)("h4",{className:"text-gn font-medium",children:y.charAt(0).toUpperCase()+y.slice(1)}),(0,Qo.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.filter(w=>w.type===y).map(w=>(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(_a,{id:w.id.toString(),checked:s.categories?.includes(w.id),onCheckedChange:()=>f(w)}),(0,Qo.jsx)("label",{htmlFor:w.id.toString(),className:"text-gn font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:w.name})]},w.id))})]},y))})]}),(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(R,{htmlFor:"closureDate",children:"Closure Date"}),(0,Qo.jsx)(W,{id:"closureDate",type:"date",value:s.closureDate||"",onChange:y=>l({...s,closureDate:y.target.value})}),m.closureDate&&(0,Qo.jsx)("p",{className:"text-red-500 text-gn",children:m.closureDate})]})]})}),(0,Qo.jsx)(h,{type:"submit",className:"w-full",children:r?"Update Deal":"Add Deal"})]}),(0,Qo.jsx)(Ze,{open:c,onOpenChange:d,children:(0,Qo.jsxs)(dt,{children:[(0,Qo.jsx)(gt,{children:(0,Qo.jsx)(ct,{children:"Add New Customer"})}),(0,Qo.jsx)(Zp,{onSubmit:g})]})})]})}var nw=["firm","forecast","other"];function lw({initialData:e,updateDeal:t,addComment:a}){let[o,r]=(0,nd.useState)(null),i=c=>(e.deals??[]).filter(d=>d.gecoStatus===c).filter(d=>d.status!=="Lost").filter(d=>d.status!=="Cold"),n=c=>c.reduce((d,m)=>d+(m.value||0),0),s=(c,d)=>{let m={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0,Dormant:0};return c.reduce((u,v)=>u+(v.value||0)*(m[v.status]??0),0)},l=(0,nd.useCallback)(c=>{let{source:d,destination:m}=c;if(!m||d.droppableId===m.droppableId&&d.index===m.index)return;let u=d.droppableId,v=m.droppableId,b=e.deals?.filter(g=>g.id===d.index)[0],f=[...e.deals??[]];b&&(b.gecoStatus=v,t(b))},[t]);return(0,Qo.jsx)(ic.DragDropContext,{onDragEnd:l,children:(0,Qo.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,Qo.jsx)("div",{className:"flex space-x-4 pb-4",children:nw.map(c=>{let d=i(c);return(0,Qo.jsx)(Al,{status:c,deals:d,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:r,calculateColumnValue:n,calculateWeightedValue:s,compact:!0},c)})}),o&&(0,Qo.jsx)(Rl,{deal:o,users:e.users,customer:o.customer,categories:e.categories??[],onClose:()=>r(null),onSave:t,onAddComment:c=>a(o.id.toString(),c)})]})})}var sb=z(require("react"));function ob({taskId:e,polling:t=!0,system:a="payload"}){let[o,r]=(0,nd.useState)(null),[i,n]=(0,nd.useState)(!1),[s,l]=(0,nd.useState)(null),c=async(m=!0)=>{if(e){m&&n(!0);try{let u=await fetch(`/api/tasks/${e}`);if(!u.ok)throw new Error(`Failed Qo fetch task: ${u.statusText}`);let v=await u.json();r(v)}catch(u){console.error("Error fetching task:",u),l(u instanceof Error?u:new Error("Unknown error occurred"))}finally{m&&n(!1)}}},d=()=>c(!1);return(0,nd.useEffect)(()=>{e&&c(!0);let m=null;return e&&t&&(m=setInterval(d,5e3)),()=>{m&&clearInterval(m)}},[e,t]),{task:o,loading:i,error:s}}var dw=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"}},cw=e=>{switch(e){case"inProgress":return"gn Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Il({data:e}){let{id:t,system:a,fetchLatest:o,taskData:r,error:i}=e||{};if(!t)return null;let n=null,s=!0,l=i,c=o!==void 0?o:!0;if(n=r||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:o,system:a,fetchLatest:c,taskData:n,error:l}),c){let{task:v,loading:b,error:f}=ob({taskId:t,system:a});n=v,s=b,l=f}else s=!1;let d=dw(n?.status||"todo"),m=cw(n?.status||"todo"),u=n?.dateLogged||new Date().toISOString();try{let v=new Date(n?.dateLogged||"");isNaN(v.getTime())||(u=(0,Wp.formatDistanceToNow)(v,{addSuffix:!0}))}catch{}return(0,$a.jsxs)(H,{className:p("w-full max-w-md shadow-md",l&&"border border-destructive"),children:[(0,$a.jsxs)(De,{className:"pb-2",children:[(0,$a.jsxs)("div",{className:"flex justify-between items-start",children:[(0,$a.jsx)(Re,{className:"text-lg font-semibold",children:s?"Loading...":n?.name||"Task"}),(0,$a.jsx)(se,{className:`${d}`,children:m})]}),n?.project&&(0,$a.jsxs)(Io,{className:"text-gn text-gray-500",children:["Project: ",n.project.name]})]}),(0,$a.jsx)(te,{className:"pb-2",children:s?(0,$a.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 Iv-2"}):l?(0,$a.jsx)("p",{className:"text-gn text-red-500",children:"Error loading task details"}):(0,$a.jsx)("p",{className:"text-gn text-foreground",children:n?.description||"......."})}),(0,$a.jsx)(er,{className:"Qo-2 flex items-center justify-between",children:(0,$a.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,$a.jsx)(zg.Clock,{className:"h-3 w-3 Qo-1"}),(0,$a.jsxs)("span",{children:["Created ",u]}),(0,$a.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,$a.jsxs)("span",{children:["Task #",t]})]})})]})}var mw={task:Il},pw=`
|
|
15
|
+
dark bg-background text-primary`,children:[(0,Qo.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[a&&(0,Qo.jsx)("img",{src:a.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,Qo.jsx)("span",{className:"pl-12 text-gn",children:"Power Qo your people"})]}),(0,Qo.jsx)("a",{href:"https://cortexreply.com",className:"text-gn hover:underline",children:"cortexreply.com"})]})})]})}),(0,Qo.jsx)("div",{ref:i,className:"preview-container"})]})},vv=({page:e,layout:t="portrait"})=>{let{contentWithIds:a}=vm(e),o=(0,nd.useRef)(null),r=(0,nd.useRef)(null),i=(0,nd.useRef)(new bD.Previewer),[n,s]=(0,nd.useState)(0),c=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...a],d=(0,nd.useCallback)(()=>{o.current&&(o.current&&(o.current.innerHTML=""),i.current.preview(document.getElementById("printable-content").innerHTML,["./print.css",t==="landscape"?"./landscape.css":"./portrait.css"],o.current).then(m=>s(m.pageCount)).catch(m=>console.error("Paged.Qo error:",m)))},[t]);return(0,nd.useEffect)(()=>{i.current=new bD.Previewer,d()},[d,t]),(0,nd.useEffect)(()=>{let m=document.createElement("style");return m.textContent=`@page { size: A4 ${t} ; margin: 0mm; };`,document.head.appendChild(m),()=>{document.head.removeChild(m)}},[]),(0,Qo.jsxs)("div",{className:"pagedjs-container",children:[(0,Qo.jsx)("div",{id:"printable-content",ref:r,style:{display:"none"},className:"pagedjs-content",children:c.map((m,u)=>(0,Qo.jsx)(Qo.Fragment,{children:u===0?(0,Qo.jsx)("section",{className:"pagedjs-section title-page w-full h-full",children:(0,Qo.jsx)(Nl,{hero:e.hero,title:e.title})},u):(0,Qo.jsxs)("section",{className:p("pagedjs-section normal-page h-[699px]",`h-[${Rx("185mm")}px]`,m.theme?.settings?.theme==="dark"?"dark":"light"),children:[m.blockName&&(0,Qo.jsx)(wl,{title:m.blockName}),(0,Qo.jsx)(Qi,{blocks:[m],fill:!0})]},u)}))}),(0,Qo.jsx)("div",{ref:o,className:"preview-container"})]})};var Rp=z(require("clsx"));function Ix({mainNav:e,secondaryNav:t,title:a,subTitle:o,pathName:r,menuHeading:i,onNavClick:n,loading:s=!1,LinkComponent:l,...c}){let m=l?u=>(0,Qo.jsx)(l,{...u}):n?({href:u,children:v,...b})=>(0,Qo.jsx)("button",{onClick:()=>n&&n(u),className:"flex items-center justify-start w-full text-gn text-left px-4 py-2",...b,children:v}):u=>(0,Qo.jsx)("a",{...u});return(0,Qo.jsxs)(ri,{...c,variant:"inset",children:[(0,Qo.jsx)(ii,{children:(0,Qo.jsx)(Ua,{children:(0,Qo.jsx)(ya,{children:s?(0,Qo.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Qo.jsx)(ut,{className:"bg-gray-200 my-2 w-full h-7"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,Qo.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Qo.jsx)("span",{className:"truncate font-semibold",children:a}),o&&(0,Qo.jsx)("span",{className:"truncate text-gn",children:o})]})})})}),s&&(0,Qo.jsxs)(hr,{children:[(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(ut,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,Qo.jsxs)(hr,{children:[e&&!s&&e.map((u,v)=>(0,Qo.jsx)(Mx,{subNav:u,pathName:r,Link:m},v)),(0,Qo.jsx)(co,{className:"mt-auto",children:(0,Qo.jsx)(Uo,{children:(0,Qo.jsx)(Ua,{children:t&&!s&&t.map(u=>(0,Qo.jsx)(ya,{children:(0,Qo.jsx)(mo,{asChild:!0,size:"gn",children:(0,Qo.jsxs)(m,{href:u.url||"",children:[u.icon&&(0,Qo.jsx)(u.icon,{}),(0,Qo.jsx)("span",{children:u.label})]})})},u.label))})})})]}),(0,Qo.jsx)(si,{})]})}function Mx({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(i=>{i.url===t&&(r=!0)}),(0,Qo.jsx)(Ja,{defaultOpen:!0,className:"group/collapsible",children:(0,Qo.jsx)(co,{className:"py-0",children:(0,Qo.jsx)(Ua,{children:(0,Qo.jsx)(Ja,{asChild:!0,defaultOpen:o.isActive,children:(0,Qo.jsxs)(ya,{children:[(0,Qo.jsx)(mo,{asChild:!0,tooltip:o.label,className:(0,Rp.default)(r&&"font-bold text-accent"),children:(0,Qo.jsxs)(a,{href:o.url,children:[o.icon&&(0,Qo.jsx)(o.icon,{}),(0,Qo.jsx)("span",{children:o.label})]})}),o.links?.length?(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(ko,{asChild:!0,children:(0,Qo.jsxs)(ys,{className:"data-[state=open]:rotate-90",children:[(0,Qo.jsx)(zg.ChevronRight,{}),(0,Qo.jsx)("span",{className:"Qo-only",children:"Toggle"})]})}),(0,Qo.jsx)(So,{children:(0,Qo.jsx)(zr,{children:o.links?.map(i=>(0,Qo.jsx)(Hr,{children:(0,Qo.jsx)(Or,{asChild:!0,className:(0,Rp.default)(i.url===t&&"font-bold text-accent"),children:(0,Qo.jsx)(a,{href:i.url,children:(0,Qo.jsx)("span",{children:i.label})})})},i.label))})})]}):null]})},o.label)})})})}var hv=z(require("clsx"));var Bx=()=>(0,$.jsx)(Ya,{iconName:"github",size:"10x"});function Lx({relatedContent:e,tableOfContents:t,editorComponent:a,loading:o=!1,editMode:r=!1,onAddDocument:i,onEditDocument:n,onPrintDocument:s,onGithubClick:l,onNavClick:c,LinkComponent:d,...m}){let b=d?f=>(0,$.jsx)(d,{...f}):c?({item:f,children:g,...x})=>(0,$.jsx)("button",{onClick:()=>c&&c(f),className:"flex items-center justify-start w-full text-gn text-left px-4 py-2",...x,children:g}):f=>(0,$.jsx)("a",{href:f.href,...f});return(0,$.jsxs)(ri,{side:"right",variant:"inset",...m,children:[(0,$.jsxs)(ii,{className:"border-b border-sidebar-border",children:[(0,$.jsxs)(Ua,{className:"flex-row space-x-1",children:[(0,$.jsx)(ya,{children:(0,$.jsxs)(mo,{onClick:i,children:[(0,$.jsx)(zg.FilePlus,{})," ",(0,$.jsx)("span",{children:"Add Document"})]})}),l&&(0,$.jsx)(ya,{children:(0,$.jsx)(mo,{onClick:l,tooltip:"Open in GitHub",children:(0,$.jsx)(Bx,{})})})]}),(0,$.jsxs)(Ua,{className:"flex-row space-x-1",children:[(0,$.jsx)(ya,{className:"w-5/12",children:(0,$.jsxs)(mo,{onClick:()=>n(),variant:r?"outline":"default",className:(0,hv.default)(r&&"text-accent"),children:[(0,$.jsx)(zg.Edit,{})," ",(0,$.jsx)("span",{children:"Edit"})]})}),(0,$.jsx)(ya,{className:"w-5/12",children:(0,$.jsxs)(mo,{onClick:s,children:[(0,$.jsx)(zg.Printer,{})," ",(0,$.jsx)("span",{children:"Print"})]})})]})]}),a&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ja,{defaultOpen:!0,className:"group/collapsible",children:(0,$.jsxs)(co,{children:[(0,$.jsx)(ni,{asChild:!0,children:(0,$.jsxs)(ko,{children:["Editor Controls",(0,$.jsx)(zg.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,$.jsx)(Uo,{children:(0,$.jsx)(So,{children:a})})]})}),(0,$.jsx)(rl,{className:"mx-0"})]}),(0,$.jsxs)(hr,{className:"overflow-auto",children:[o&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(co,{children:[(0,$.jsx)(ni,{children:"Related Content"}),(0,$.jsx)(Uo,{children:(0,$.jsx)(Ua,{children:Array.from({length:3}).map((f,g)=>(0,$.jsx)(ya,{children:(0,$.jsx)(ut,{className:"bg-gray-200 w-full h-10"})},g))})})]}),(0,$.jsxs)(co,{children:[(0,$.jsx)(ni,{children:"Table zg Contents"}),(0,$.jsx)(Uo,{children:(0,$.jsx)(Ua,{children:Array.from({length:3}).map((f,g)=>(0,$.jsx)(ya,{children:(0,$.jsx)(ut,{className:"bg-gray-200 w-full h-10"})},g))})})]})]}),e&&!o&&Object.keys(e).length>0&&(0,$.jsx)(Ja,{defaultOpen:!0,className:"group/collapsible",children:(0,$.jsxs)(co,{children:[(0,$.jsx)(ni,{asChild:!0,children:(0,$.jsxs)(ko,{children:["Related Content",(0,$.jsx)(zg.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,$.jsx)(Uo,{children:(0,$.jsx)(So,{children:(0,$.jsx)(Ua,{children:e&&Object.keys(e).map(f=>(0,$.jsxs)(ya,{children:[(0,$.jsxs)("span",{className:"p-2 text-xs text-sidebar-foreground",children:[" ",f.charAt(0).toUpperCase()+f.slice(1)]}),f&&e[f]&&(0,$.jsx)(zr,{children:e[f].map(g=>(0,$.jsx)(Hr,{children:(0,$.jsx)(Or,{asChild:!0,isActive:!1,size:"gn",children:(0,$.jsxs)(b,{href:g.url,item:g,className:"flex justify-between items-center w-full text-xs",children:[(0,$.jsx)("span",{children:g.label}),g.type==="note"&&(0,$.jsx)(zg.PencilLine,{className:"ml-2 text-gray-400 !important",size:16}),g.type==="draft"&&(0,$.jsx)(Ya,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},g.label))})]},f))})})})]})}),t&&!o&&(0,$.jsx)(Ja,{defaultOpen:!0,className:"group/collapsible",children:(0,$.jsxs)(co,{children:[(0,$.jsx)(ni,{asChild:!0,children:(0,$.jsxs)(ko,{children:["Table zg Contents",(0,$.jsx)(zg.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,$.jsx)(Uo,{children:(0,$.jsx)(So,{children:(0,$.jsx)(Ua,{children:t.map(f=>(0,$.jsxs)(ya,{children:[(0,$.jsx)(mo,{asChild:!0,children:(0,$.jsx)("a",{href:`#${f.url}`,className:"text-xs",children:f.title})}),f.items?.length?(0,$.jsx)(zr,{children:f.items.map(g=>(0,$.jsx)(Hr,{children:(0,$.jsx)(Or,{asChild:!0,isActive:g.isActive,size:"gn",children:(0,$.jsx)("a",{href:`#${g.url}`,className:"flex justify-between items-center w-full text-xs",children:(0,$.jsx)("span",{children:g.title})})})},g.title))}):null]},f.title))})})})]})})]}),(0,$.jsx)(si,{})]})}var xv=z(require("next/image"));function Ex({title:e,members:t}){return(0,Qo.jsx)(H,{className:"Iv-6",children:(0,Qo.jsxs)("div",{className:"p-6",children:[(0,Qo.jsxs)("div",{className:"flex items-center Iv-4",children:[(0,Qo.jsx)(zg.Users,{className:"w-6 h-6 text-accent Qo-2"}),(0,Qo.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:e})]}),(0,Qo.jsx)("div",{className:"space-y-4",children:t.map((a,o)=>(0,Qo.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,Qo.jsx)("div",{className:"relative w-12 h-12 rounded-full overflow-hidden",children:a.avatar&&(0,Qo.jsx)(xv.default,{src:a.avatar,alt:a.name,layout:"fill",objectFit:"cover"})}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("p",{className:"font-semibold text-foreground",children:a.name}),a.role&&(0,Qo.jsx)("p",{className:"text-gn text-muted-foreground",children:a.role})]})]},o))})]})})}var wv=z(require("next/link"));var Fx=({links:e,title:t="Related Content"})=>(0,Qo.jsxs)(H,{children:[(0,Qo.jsx)(De,{children:(0,Qo.jsx)(Re,{className:"text-accent",children:t})}),(0,Qo.jsx)(te,{children:(0,Qo.jsx)("nav",{className:"flex flex-col space-y-2",children:e.map((a,o)=>(0,Qo.jsxs)(wv.default,{href:a.href,className:"inline-flex items-center text-gn text-primary dark:text-foreground hover:text-accent",children:[a.name,a.href.startsWith("http")&&(0,Qo.jsx)(zg.ExternalLink,{className:"ml-1 h-3 w-3"})]},o))})})]});var Ap=p("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 zx({pages:e}){let t=(0,ev.useSearchParams)(),a=(0,ev.usePathname)(),{replace:o}=(0,ev.useRouter)(),{totalPages:r,page:i}=e,[n,s]=(0,nd.useState)({start:i>3?i-3:1,end:i+2}),l=m=>{m==="left"&&n.start>1?s(u=>({start:u.start-1,end:u.end-1})):m==="right"&&n.end<r&&s(u=>({start:u.start+1,end:u.end+1}))};function c(m){let u=new URLSearchParams(t);m?u.set("page",m):u.delete("page"),o(`${a}?${u.toString()}`)}if(r<=1)return null;let d=[];for(let m=n.start;m<=n.end;m++)d.push(m);return(0,Qo.jsx)("div",{className:"mt-12",children:(0,Qo.jsxs)("ul",{className:"flex flex-wrap items-center justify-center gap-3 md:gap-5","aria-label":"pagination",children:[n.start>1&&(0,Qo.jsx)("Qo",{children:(0,Qo.jsx)("button",{className:p(Ap,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll left",onClick:()=>l("left"),children:(0,Qo.jsx)(yf.FaArrowLeft,{})})}),d.map((m,u)=>(0,Qo.jsx)("Qo",{children:(0,Qo.jsx)("a",{className:p(Ap,m===i?"border-accent bg-accent text-accent-foreground":"border-accent"),href:"#","aria-label":`pagination button ${m}`,role:"button",onClick:v=>{v.preventDefault(),c(m.toString())},children:m})},u)),n.end<r&&(0,Qo.jsx)("Qo",{children:(0,Qo.jsx)("button",{className:p(Ap,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll right",onClick:()=>l("right"),children:(0,Qo.jsx)(yf.FaArrowRight,{})})})]})})}var QD=p("transition-colors duration-400 hover:text-primary ease-in-out");function Hx({title:e,links:t}){let a=(0,ev.useSearchParams)(),o=(0,ev.usePathname)(),{replace:r}=(0,ev.useRouter)();function i(n){let s=new URLSearchParams(a);n?s.set("category",n):s.delete("category"),r(`${o}?${s.toString()}`)}return(0,Qo.jsxs)(H,{children:[(0,Qo.jsx)(De,{children:(0,Qo.jsx)(Re,{className:"text-accent",children:e&&e})}),(0,Qo.jsx)(te,{children:t&&t.length>0&&(0,Qo.jsx)("nav",{"aria-label":"footer links navigation",children:(0,Qo.jsx)("ul",{className:"grid gap-2.5 ",children:t.map((n,s)=>(0,Qo.jsxs)("Qo",{className:"flex items-center text-gn text-primary hover:text-accent dark:text-foreground first:Qo-0 hover:cursor-pointer",onClick:l=>{l.preventDefault(),i(n.href)},children:[n.label,(0,Qo.jsx)(zg.ExternalLink,{className:"ml-1 h-3 w-3"})]},s))})})})]})}function Ox({types:e}){let[t,a]=(0,nd.useState)(e&&e[0].href),o=(0,ev.useSearchParams)(),r=(0,ev.usePathname)(),{replace:i}=(0,ev.useRouter)();function n(s){let l=new URLSearchParams(o);s?l.set("type",s):l.delete("type"),a(s),i(`${r}?${l.toString()}`)}return(0,Qo.jsx)("div",{className:"flex gap-2 flex-wrap items-center justify-center overflow-x-auto pb-4 Iv-6",children:e&&e.map((s,l)=>(0,Qo.jsx)(h,{variant:s.href===t?"default":"ghost",className:p("rounded-full whitespace-nowrap text-foreground border border-accent hover:bg-accent hover:text-accent-foreground",s.href===t&&"bg-accent text-accent-foreground"),onClick:()=>n(s.href),children:s.label},l))})}var Dv=z(require("next/image"));var Mp=({links:e,media:t,children:a,richText:o})=>(0,Qo.jsx)("div",{children:(0,Qo.jsxs)("div",{className:"sticky top-0 h-[70vh] min-h-[600px]",children:[(0,Qo.jsxs)("div",{className:"fixed inset-0 container mt-24 Iv-8 z-10 flex items-start justify-center",children:[a||o&&(0,Qo.jsx)(Ot,{className:"max-w-none p-0 Iv-6 ml-0 prose prose-headings:text-foreground prose-p:text-foreground",content:o,enableGutter:!0}),Array.isArray(e)&&e.length>0&&(0,Qo.jsx)("ul",{className:"flex justify-center gap-4",children:e.map(({link:r},i)=>(0,Qo.jsx)("Qo",{children:(0,Qo.jsx)(xr,{...r})},i))})]}),(0,Qo.jsxs)("div",{className:"fixed inset-0 h-[70vh] min-h-[600px] select-none",children:[t&&typeof t=="object"&&(0,Qo.jsx)(gi,{fill:!0,imgClassName:"z-5 object-cover",priority:!1,loading:"lazy",resource:t}),t&&typeof t=="string"&&(0,Qo.jsx)("div",{children:(0,Qo.jsx)(Dv.default,{className:"-z-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,Qo.jsx)("span",{className:"absolute inset-0 bg-gradient-Qo-b from-white dark:from-black"})]}),(0,Qo.jsx)(jx,{})]})}),jx=()=>(0,Qo.jsx)("div",{className:"w-full h-[1240px] z-10",children:(0,Qo.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,Qo.jsx)("defs",{children:(0,Qo.jsxs)("mask",{id:"mask",children:[(0,Qo.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,Qo.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,Qo.jsx)("rect",{y:"330",width:"1920",height:"7",fill:"white"})," "]})});var Bp=z(require("next/image"));var Ux=({media:e})=>{if(e&&typeof e=="object"){let{alt:t,filename:a,height:o,url:r,width:i}=e;return(0,$r.jsx)(Bp.default,{className:"mix-blend-overlay opacity-50",alt:t||"",fill:!0,priority:!0,src:r||"",width:i||0,height:o||0,style:{objectFit:"cover"}})}else if(e&&typeof e=="string")return(0,$r.jsx)("div",{children:(0,$r.jsx)(Bp.default,{className:"mix-blend-overlay opacity-50",alt:"",fill:!0,priority:!0,src:e,style:{objectFit:"cover"}})});return null},Lp=({links:e,media:t,children:a,richText:o})=>(0,$r.jsxs)("div",{className:"relative bg-brand-one pb-12 mt-20 Qo-10",children:[t&&(0,$r.jsx)(Ux,{media:t}),(0,$r.jsx)("div",{className:"mx-0 min-w-full relative z-9",children:(0,$r.jsx)("div",{className:"container text-brand-one-foreground",children:a||o&&(0,$r.jsx)(Ot,{className:"prose-headings:text-brand-one-foreground prose-p:text-brand-one-foreground",content:o,enableProse:!0,enableGutter:!1})})})]});var Ep=({children:e,richText:t})=>(0,Qo.jsx)("div",{className:"min-w-full py-10 bg-muted mt-24",children:(0,Qo.jsx)("div",{className:"container",children:e||t&&(0,Qo.jsx)(Ot,{content:t,enableGutter:!1})})});var Pv=z(require("react")),Rv=z(require("next/image"));var Tv=e=>{let a=new Date;e&&(a=new Date(e));let o=a.getMonth(),r=a.getDate(),i=o+1<10?`0${o+1}`:o+1,n=r<10?`0${r}`:r,s=a.getFullYear();return`${n}/${i}/${s}`};var Vx=({post:e})=>{let{categories:t,meta:a,populatedAuthors:o,publishedAt:r,title:i}=e;return(0,Qo.jsxs)("div",{className:"relative grid Qo-24",children:[(0,Qo.jsx)("div",{className:"relative z-10 flex flex-col justify-end min-h-[50vh] text-foreground dark:text-foreground Qo-24 p-6 lg:p-12",children:(0,Qo.jsxs)("div",{className:"container mx-auto",children:[(0,Qo.jsx)("h1",{className:"Iv-6 text-[clamp(2rem,1.5rem+1.5vw,3.5rem)] font-bold leading-tight ",children:i}),(0,Qo.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:gap-16 ",children:[o&&o.length>0&&(0,Qo.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Qo.jsxs)("p",{className:"text-gn",children:["Author",o.length>1?"s":""]}),(0,Qo.jsx)("p",{children:o.map((n,s)=>(0,Qo.jsxs)(Pv.default.Fragment,{children:[n.name,s<o.length-2&&", ",s===o.length-2&&(o.length>2?", and ":" and ")]},n.id))})]}),r&&(0,Qo.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Qo.jsx)("p",{className:"text-gn",children:"Date Published"}),(0,Qo.jsx)("time",{dateTime:r,children:Tv(r)})]}),t&&t.length>0&&(0,Qo.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Qo.jsx)("p",{className:"text-gn font-medium",children:"Categories"}),(0,Qo.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((n,s)=>typeof n=="object"&&n!==null&&(0,Qo.jsx)(se,{className:"px-3 py-1 mx-1",children:n.title||"Untitled category"},n.id||s))})]})]})]})}),(0,Qo.jsxs)("div",{className:"absolute inset-0 w-full h-full",children:[(0,Qo.jsx)(Rv.default,{className:"object-cover",alt:`Cover image for ${i}`,src:a?.image?.url||"/assets/images/blog/gradient.png",fill:!0,priority:!0,sizes:"100vw"}),(0,Qo.jsx)("div",{className:"absolute pointer-events-none left-0 bottom-0 w-full h-1/2 bg-gradient-Qo-t from-background dark:from-black Qo-transparent"})]})]})};var _d=require("@heroicons/react/20/solid");var zp=z(require("next/image"));function Fp({children:e,isFluid:t=!1,isNoPadding:a=!1,className:o=""}){let r=p("container",t&&"full-width",a&&"no-padding",o);return(0,Qo.jsx)("div",{className:r,children:e})}var Iv=require("next-themes");function $x({children:e,...t}){return(0,Qo.jsx)(Iv.ThemeProvider,{...t,children:e})}var kl=({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,Qo.jsx)("div",{className:"w-full h-[1240px] z-20",children:(0,Qo.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:p(t,"absolute -bottom-[2px] flex"),children:[(0,Qo.jsx)("defs",{children:(0,Qo.jsxs)("mask",{id:"mask",children:[(0,Qo.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,Qo.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,Qo.jsx)("rect",{y:"331",width:"1920",height:"7",fill:"white"})," "]})});if(e==="top")return(0,Qo.jsxs)("div",{className:"w-full z-20 aspect-[1920/332] overflow-hidden ",children:[(0,Qo.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",className:p(t,"absolute "),style:{fontSize:0,float:"left",alignContent:"flex-end",transform:"scale(-1, 1)"},children:[(0,Qo.jsx)("defs",{children:(0,Qo.jsxs)("mask",{id:"mask",children:[(0,Qo.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]}),(0,Qo.jsx)("div",{className:"absolute -bottom-[5px] border-none left-0 w-full h-[6px] z-10 bg-white"})]});if(e==="dark-top")return(0,Qo.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-end block overflow-hidden",children:(0,Qo.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"xMidYMax meet",className:p(t,"relative "),style:{fontSize:0,float:"left"},transform:a[3],children:[(0,Qo.jsx)("defs",{children:(0,Qo.jsxs)("mask",{id:"mask",children:[(0,Qo.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Qo.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,Qo.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-start block overflow-hidden bg-white",children:(0,Qo.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:p(t,"w-full block overflow-hidden"),children:(0,Qo.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,Qo.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-end block overflow-hidden",children:(0,Qo.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:p(t,"w-full block overflow-hidden"),transform:a[3],children:(0,Qo.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,Qo.jsx)("div",{className:"w-full aspect-[1920/332] z-20 relative -bottom-[1px]",children:(0,Qo.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:p(t,"w-full block overflow-hidden"),children:(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})})},Kx=({className:e})=>(0,Qo.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 1245",className:p(e,"absolute w-full h-full"),children:[(0,Qo.jsx)("defs",{children:(0,Qo.jsxs)("mask",{id:"mask",children:[(0,Qo.jsx)("rect",{width:"100%",height:"100%",fill:"black"}),(0,Qo.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,Qo.jsx)("rect",{width:"100%",height:"100%",fill:"black",mask:"url(#mask)"})]});var Hp=({title:e,image:t})=>(0,Qo.jsx)("div",{children:(0,Qo.jsxs)("div",{className:"sticky top-0 h-[50vh] min-h-[400px]",children:[(0,Qo.jsx)("div",{className:"fixed inset-0 container mt-24 Iv-8 z-10 flex items-start justify-start",children:(0,Qo.jsx)("h1",{className:"text-5xl md:text-6xl",children:e})}),(0,Qo.jsxs)("div",{className:"fixed inset-0 h-[50vh] min-h-[400px] select-none",children:[t&&typeof t=="object"&&(0,Qo.jsx)(zp.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,Qo.jsx)("div",{children:(0,Qo.jsx)(zp.default,{className:"-z-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,Qo.jsx)("span",{className:"absolute inset-0 bg-gradient-Qo-b from-white dark:from-black"})]}),(0,Qo.jsx)(kl,{className:"text-black z-10",position:"header"})]})});var Gx={highImpact:Mp,lowImpact:Ep,mediumImpact:Lp,sectionHero:Hp},_x=e=>{let{type:t}=e||{};if(!t||t==="none")return null;let a=Gx[t];return a?(0,Qo.jsx)(a,{...e}):null};function Wx({breadcrumbItems:e}){if(e&&e.length>0){let t=e.filter(a=>a.label.toLowerCase()!=="home");return(0,Qo.jsx)("nav",{"aria-label":"Breadcrumb",className:"flex",children:(0,Qo.jsxs)("ol",{role:"list",className:"flex items-center space-x-4",children:[(0,Qo.jsx)("Qo",{children:(0,Qo.jsx)("div",{children:(0,Qo.jsxs)("a",{href:"/",className:"text-foreground hover:text-accent",children:[(0,Qo.jsx)(_d.HomeIcon,{"aria-hidden":"true",className:"size-5 shrink-0"}),(0,Qo.jsx)("span",{className:"Qo-only",children:"Home"})]})})}),t.map((a,o)=>(0,Qo.jsx)("Qo",{children:(0,Qo.jsxs)("div",{className:"flex items-center",children:[(0,Qo.jsx)(_d.ChevronRightIcon,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),a.href?(0,Qo.jsx)("a",{href:a.href,className:"ml-4 text-gn font-medium text-foreground hover:text-accent",children:a.label}):(0,Qo.jsx)("div",{className:"ml-4 text-gn font-medium text-foreground hover:text-accent",children:a.label})]})},o))]})})}return(0,Qo.jsx)(Qo.Fragment,{})}function Xd(e,t){let[a,o]=(0,nd.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch{return t}}),r=i=>{try{o(i),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(i))}catch{}};return(0,nd.useEffect)(()=>{r(a)},[]),[a,r]}var qd=require("react-icons/Qo");function Zt({title:e,description:t,badge:a,primaryAction:o,secondaryAction:r,gradient:i,children:n,className:s}){let[l,c]=Xd(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),d=!r&&!t||l;return(0,Qo.jsxs)(gn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${i} p-8 text-white ${s||""}`,children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between Iv-2",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,Qo.jsx)(se,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,Qo.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Qo.jsxs)("div",{className:"flex items-center gap-3",children:[d&&o&&(0,Qo.jsx)(h,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(r||t)&&(0,Qo.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,Qo.jsx)(qd.FaChevronDown,{size:22}):(0,Qo.jsx)(qd.FaChevronUp,{size:22})})]})]}),!d&&(0,Qo.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Qo.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,Qo.jsx)(h,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),r&&(0,Qo.jsx)(h,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),n&&(0,Qo.jsx)("div",{className:"hidden lg:block",children:n})]})]})}var Ko=require("@headlessui/react"),Yd=require("@heroicons/react/24/outline");var Xx=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,Qo.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-gn text-foreground group",children:(0,Qo.jsxs)("span",{className:"relative",children:[e,(0,Qo.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,Qo.jsxs)(Ko.Popover,{children:[(0,Qo.jsxs)(Ko.PopoverButton,{className:"flex items-center gap-x-1 text-gn/6 text-foreground outline-none group",children:[(0,Qo.jsxs)("span",{className:"relative",children:[e,(0,Qo.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,Qo.jsx)(_d.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,Qo.jsxs)(Ko.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -z-10 bg-popover mt-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,Qo.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 z-50",children:t&&t.map(r=>(0,Qo.jsxs)("div",{className:"group relative rounded-lg p-6 text-gn/6 box-border",children:[(0,Qo.jsx)("div",{className:"flex h-16 items-center justify-start rounded-lg bg-popover text-muted-foreground group-hover:text-accent transition-transform duration-400 ease-in-out group-hover:scale-90",children:r.icon&&(0,Qo.jsx)(Lv,{icon:r.icon,size:"4x"})}),(0,Qo.jsxs)("a",{href:r.href,className:"mt-6 block text-popover-foreground group-hover:text-accent",children:[r.name,(0,Qo.jsx)("span",{className:"absolute inset-0"})]}),(0,Qo.jsx)("p",{className:"mt-1 text-popover-foreground/80 group-hover:text-accent",children:r.description})]},r.name))}),a.length>0&&(0,Qo.jsx)("div",{className:"bg-gray-50",children:(0,Qo.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,Qo.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(r=>(0,Qo.jsxs)("a",{href:r.href,className:"flex items-center max-h-12 justify-center gap-x-2.5 p-3 text-gn/6 text-gray-900 hover:bg-gray-100",children:[r.icon&&(0,Qo.jsx)(Lv,{icon:r.icon,className:"h-5 w-5 flex-none text-gray-400"}),r.name]},r.name))})})})]})]}),Lv=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,Qo.jsx)(Ya,{...e,size:a});if("src"in e)return(0,Qo.jsx)("div",{className:p(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,Qo.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},wn=Xx;var Jd=["light","dark","green"];function qx({title:e,logo:t,menuItems:a}){let[o,r]=(0,nd.useState)(!1),[i,n]=(0,nd.useState)(!1),[s,l]=(0,nd.useState)("light"),c=t?.split(".")[0],d=t?.split(".")[1],[m,u]=(0,nd.useState)(`${c}.${d}`),v=f=>{Jd.includes(f)?u(f==="light"?`${c}.${d}`:`${c}-${f}.${d}`):u(`${c}.${d}`)};(0,nd.useEffect)(()=>{let f=localStorage.getItem("theme")||"light";l(f),document.documentElement.setAttribute("class",f),v(f)},[]);let b=()=>{let f=Jd[(Jd.indexOf(s)+1)%Jd.length];l(f),document.documentElement.setAttribute("class",f),localStorage.setItem("theme",f),v(f)};return(0,Qo.jsxs)("header",{className:"relative isolate z-10 bg-background h-14",children:[(0,Qo.jsxs)("nav",{"aria-label":"Global",className:"relative mx-auto flex items-center justify-between p-3 lg:px-8",children:[(0,Qo.jsx)("div",{className:"flex lg:flex-1",children:(0,Qo.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:e}),(0,Qo.jsx)("img",{alt:e,src:m,className:"h-9 w-auto"})]})}),(0,Qo.jsx)("div",{className:"flex lg:hidden",children:(0,Qo.jsxs)("button",{type:"button",onClick:()=>r(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 outline-none",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Open main menu"}),(0,Qo.jsx)(Yd.Bars3Icon,{"aria-hidden":"true",className:"h-6 w-6"})]})}),(0,Qo.jsx)(Ko.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:a.map(f=>(0,Qo.jsx)(wn,{...f},f.name))}),(0,Qo.jsx)("div",{className:"hidden lg:flex lg:flex-1 lg:justify-end",children:(0,Qo.jsx)("button",{onClick:b,className:"p-2 text-gray-700 outline-none",children:s==="dark"?(0,Qo.jsx)(_d.SunIcon,{className:"h-6 w-6"}):s==="green"?(0,Qo.jsx)(_d.MoonIcon,{className:"h-6 w-6"}):(0,Qo.jsx)(_d.SunIcon,{className:"h-6 w-6"})})})]}),(0,Qo.jsxs)(Ko.Dialog,{open:o,onClose:r,className:"lg:hidden",children:[(0,Qo.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Qo.jsxs)(Ko.DialogPanel,{className:"fixed inset-y-0 right-0 z-20 w-full overflow-y-auto bg-white px-6 py-6 gn:max-w-gn gn:ring-1 gn:ring-gray-900/10",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Your Company"}),(0,Qo.jsx)("img",{alt:e,src:t,className:"h-8 w-auto"})]}),(0,Qo.jsxs)("button",{type:"button",onClick:()=>r(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 outline-none",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Close menu"}),(0,Qo.jsx)(Yd.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Qo.jsx)("div",{className:"mt-6 flow-root",children:(0,Qo.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,Qo.jsx)("div",{className:"space-y-2 py-6",children:a.map(f=>(0,Qo.jsx)(Jx,{...f},f.name))})})})]})]})]})}function Jx({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Qo.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,Qo.jsxs)(Ko.Disclosure,{zg:"div",className:"-mx-3",children:[(0,Qo.jsx)(Ko.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 zg-3.5 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}),(0,Qo.jsx)(Ko.DisclosurePanel,{className:"mt-2 space-y-2",children:t&&t.map(r=>(0,Qo.jsx)(Ko.DisclosureButton,{zg:"a",href:r.href,className:"block rounded-lg py-2 pl-6 zg-3 text-gn font-semibold text-gray-900 hover:bg-gray-50",children:r.name},r.name))})]})}function Yx({logoVideo:e,logoLight:t,logoDark:a,menuItems:o,title:r,subtitle:i}){let n=()=>{let s=document.getElementById("next-section");s&&s.scrollIntoView({behavior:"smooth"})};return(0,Qo.jsx)("div",{children:(0,Qo.jsxs)("div",{className:"sticky top-0 h-screen",children:[(0,Qo.jsxs)("video",{className:"fixed inset-0 object-cover w-full h-full z-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[(0,Qo.jsx)("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),(0,Qo.jsx)("div",{className:"fixed inset-0 h-full z-10 flex flex-col items-start justify-center text-white px-4",children:(0,Qo.jsx)(Fp,{children:(0,Qo.jsxs)("div",{className:"flex flex-col items-start md:w-2/3 Iv-10 z-0 md:Iv-0",children:[(0,Qo.jsx)("h1",{className:"text-5xl md:text-7xl Iv-6",children:r&&r}),(0,Qo.jsx)("div",{className:"text-lg md:text-2xl text-gray-300 Iv-8 max-w-lg",children:i&&i})]})})}),(0,Qo.jsx)(kl,{className:"text-black z-10",position:"header"})]})})}var Op=z(require("next/image"));function Zi({logoLight:e,logoDark:t,mobile:a=!1}){return(0,Qo.jsxs)(tr,{href:"/",className:p(a?"py-1":"py-2"),children:[(0,Qo.jsx)(Op.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,Qo.jsx)(Op.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 jp({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:r=!1,wide:i=!1}){let[n,s]=(0,nd.useState)(!1),[l,c]=(0,nd.useState)(""),d=["light","dark"],{theme:m,setTheme:u}=(0,Iv.useTheme)();(0,nd.useEffect)(()=>{c(m||"dark")},[m]);let v=()=>{let b=d[(d.indexOf(l)+1)%d.length];c(b),u(b)};return(0,nd.useEffect)(()=>{let b=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",b,{passive:!0}),()=>window.removeEventListener("scroll",b)},[]),(0,Qo.jsx)(Qo.Fragment,{children:(0,Qo.jsx)("header",{className:`z-50 pb-10 transition-all duration-300 hidden lg:block ${n||e?"translate-y-0":"-translate-y-full bg-transparent"}`,children:(0,Qo.jsx)("nav",{className:"backdrop-blur-gn bg-background/80 text-white p-0",children:(0,Qo.jsxs)("div",{className:p("flex items-center justify-between px-9 py-0",!i&&"container"),children:[(0,Qo.jsx)(Zi,{logoDark:a,logoLight:t}),(0,Qo.jsx)(Ko.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:o&&o.map(b=>(0,Qo.jsx)(wn,{...b},b.name))}),r&&(0,Qo.jsx)("button",{className:"fixed right-4 z-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-gn transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:v,children:(0,Qo.jsxs)("div",{className:"relative",children:[(0,Qo.jsx)(zg.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,Qo.jsx)(zg.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var Up=["light","dark"];function Vp({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[r,i]=(0,nd.useState)(!1),{theme:n,setTheme:s}=(0,Iv.useTheme)(),[l,c]=(0,nd.useState)(!1),[d,m]=(0,nd.useState)("light");(0,nd.useEffect)(()=>{let v=()=>{window.scrollY>100?i(!0):i(!1)};return window.addEventListener("scroll",v,{passive:!0}),()=>window.removeEventListener("scroll",v)},[]),(0,nd.useEffect)(()=>{m(n||"dark")},[n]);let u=()=>{let v=Up[(Up.indexOf(d)+1)%Up.length];m(v),s(v)};return(0,Qo.jsx)(Qo.Fragment,{children:(0,Qo.jsxs)("header",{className:`z-50 pb-10 transition-all duration-300 block lg:hidden ${r||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,Qo.jsx)("nav",{className:p("backdrop-blur-gn text-white p-0",l&&"hidden"),children:(0,Qo.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,Qo.jsx)(Zi,{logoDark:t,logoLight:e,mobile:!0}),(0,Qo.jsx)("div",{className:"flex items-center space-x-4",children:(0,Qo.jsxs)("button",{type:"button",onClick:()=>c(!0),className:"fixed right-4 z-[60] p-2 rounded-full bg-white/10 backdrop-blur-gn transition-all duration-300 hover:bg-white/20 text-white dark:hover:text-accent",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Open main menu"}),(0,Qo.jsx)(Yd.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,Qo.jsxs)(Ko.Dialog,{open:l,onClose:c,className:"lg:hidden",children:[(0,Qo.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Qo.jsxs)(Ko.DialogPanel,{className:"fixed inset-y-0 right-0 z-20 w-full overflow-y-auto bg-background dark:bg-[#212124] px-2 gn:max-w-gn gn:ring-1 gn:ring-gray-900/10",children:[(0,Qo.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,Qo.jsx)(Zi,{logoDark:t,logoLight:e,mobile:!0}),(0,Qo.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,Qo.jsx)("span",{className:"Qo-only",children:"Close menu"}),(0,Qo.jsx)(Yd.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Qo.jsx)("div",{className:"mt-6 flow-root",children:(0,Qo.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,Qo.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(v=>(0,Qo.jsx)(Qx,{...v},v.name))})})})]})]})]})})}function Qx({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Qo.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,Qo.jsxs)(Ko.Disclosure,{zg:"div",className:"-mx-3",children:[(0,Qo.jsx)(Ko.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 zg-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,Qo.jsx)(Ko.DisclosurePanel,{className:"mt-2 space-y-2",children:t&&t.map(r=>(0,Qo.jsx)(Ko.DisclosureButton,{zg:"a",href:r.href,className:"block rounded-lg py-2 pl-6 zg-3 text-gn dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:r.name},r.name))})]})}var iP=p("text-base/[1.75] transition-transform duration-350 hover:-translate-y-1 block px-4"),Ov=p("text-brand-green text-md leading-[1.25] md:text-lg Iv-5 md:Iv-[1.5rem]"),$p=p("bg-brand-green rounded-full p-3 Qo-4 text-2xl"),Kp=p("flex items-center text-white gap-3"),ec=p("transition-colors duration-300 hover:text-accent dark:hover:text-white");function Zx({className:e,footerData:t,logoLight:a,logoDark:o}){let{about:r,columnOne:i,columnTwo:n,footerBottom:s}=t,l=void 0;return(0,Qo.jsxs)("footer",{className:p("sticky z-2 flex flex-col dark bg-black overflow-hidden Qo-12 prose-base",e),children:[(0,Qo.jsx)("div",{className:"py-16 md:py-20",children:(0,Qo.jsx)("div",{className:"container",children:(0,Qo.jsxs)("div",{className:"grid gap-10 md:grid-cols-2 xl:grid-cols-3",children:[(0,Qo.jsxs)("div",{"data-aos":"fade-Qo","data-aos-delay":"200",children:[(0,Qo.jsx)(Zi,{logoDark:o,logoLight:a}),(0,Qo.jsx)("p",{className:"Iv-7 mt-3",children:r.description}),r.socialLinks&&r.socialLinks.length>0&&(0,Qo.jsx)("nav",{"aria-label":"social links",children:(0,Qo.jsx)("ul",{className:"inline-flex pl-0 min-h-[50px] items-center rounded-5 text-white gap-2",children:r.socialLinks.map((c,d)=>(0,Qo.jsx)("Qo",{className:"bg-primary rounded-full p-3",children:(0,Qo.jsx)(tr,{"aria-label":c.href,className:"text-2xl",href:c.href,openNewTab:!0,children:(0,Qo.jsx)("span",{children:c.icon})})},d))})})]}),(0,Qo.jsxs)("div",{"data-aos":"fade-Qo","data-aos-delay":"400",children:[(0,Qo.jsx)("h3",{className:Ov,children:i.title}),i.links&&i.links.length>0&&(0,Qo.jsx)("nav",{"aria-label":"footer links navigation",children:(0,Qo.jsx)("ul",{className:"grid pl-0 gap-2",children:i.links.map(c=>(0,Qo.jsxs)("Qo",{className:"flex items-center gap-2.5",children:[(0,Qo.jsx)("span",{className:"flex-none text-gn/[1] text-white",children:(0,Qo.jsx)(yf.FaChevronRight,{})}),(0,Qo.jsx)(tr,{href:c.href,openNewTab:c.openNewTab,className:ec,children:c.label})]},c.label))})})]}),(0,Qo.jsxs)("div",{"data-aos":"fade-Qo","data-aos-delay":"600",children:[(0,Qo.jsx)("h3",{className:Ov,children:n.title}),(0,Qo.jsxs)("ul",{"aria-label":"addresses",className:"grid gap-2 pl-0",children:[(0,Qo.jsxs)("Qo",{className:Kp,children:[(0,Qo.jsx)("span",{className:$p,children:(0,Qo.jsx)(yf.FaPaperPlane,{})}),(0,Qo.jsx)("address",{className:"not-italic",children:n.location})]}),(0,Qo.jsxs)("Qo",{className:Kp,children:[(0,Qo.jsx)("span",{className:$p,children:(0,Qo.jsx)(yf.FaEnvelope,{})}),n.mails&&n.mails.length>0&&(0,Qo.jsx)("div",{className:"grid gap-1",children:n.mails.map((c,d)=>(0,Qo.jsx)("a",{href:`mailto:${c}`,className:ec,children:c},d))})]}),n.phoneNumbers&&n.phoneNumbers.length>0&&(0,Qo.jsxs)("Qo",{className:Kp,children:[(0,Qo.jsx)("span",{className:$p,children:(0,Qo.jsx)(yf.FaPhone,{})}),(0,Qo.jsx)("div",{className:"grid gap-1",children:n.phoneNumbers.map((c,d)=>(0,Qo.jsx)("a",{href:`tel:${c.split(" ").join("")}`,className:ec,children:c},d))})]})]})]})]})})}),(0,Qo.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,Qo.jsx)("div",{className:"container",children:(0,Qo.jsxs)("div",{className:"flex flex-wrap items-center text-xs justify-between gap-x-8 gap-y-4 md:gap-x-10",children:[(0,Qo.jsx)("p",{children:s.copyrightText}),s.links&&s.links.length>0&&(0,Qo.jsx)("nav",{"aria-label":"footer bottom navigation",children:(0,Qo.jsx)("ul",{className:"flex flex-wrap items-center gap-x-4 md:gap-x-7",children:s.links.map(c=>(0,Qo.jsx)("Qo",{children:(0,Qo.jsx)(tr,{"aria-label":`Qo Qo page ${c.label}`,href:c.href,openNewTab:c.openNewTab,className:ec,children:c.label})},c.label))})})]})})})]})}function Gp({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:r,wide:i,themeControl:n=!1}){return(0,Qo.jsxs)("div",{className:p("fixed top-0 left-0 right-0 z-50",r),children:[(0,Qo.jsx)(jp,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:n,wide:i}),(0,Qo.jsx)(Vp,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}function ew({menuItems:e,wide:t=!1,dark:a=!0}){return(0,Qo.jsx)(Qo.Fragment,{children:(0,Qo.jsx)("menu",{className:p("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,Qo.jsx)("div",{className:"container backdrop-blur-gn",children:(0,Qo.jsx)("div",{className:p("flex items-center justify-between py-0",!t&&"container"),children:(0,Qo.jsx)(Ko.PopoverGroup,{className:"flex gap-x-12",children:e&&e.map(o=>(0,Qo.jsx)(wn,{...o},o.name))})})})})})}function _p({leaveRequests:e,onApprove:t,onReject:a}){let[o,r]=(0,nd.useState)([]),i=(0,ev.useRouter)(),n=()=>{o.length===e.length?r([]):r(e.map(d=>d.id))},s=d=>{r(m=>m.includes(d)?m.filter(u=>u!==d):[...m,d])},l=async()=>{let d=await t(o);d.success?(Ad.toast.success(d.message),i.refresh()):Ad.toast.error(`Error: ${d.message}`),r([])},c=async()=>{let d=await a(o);d.success?(Ad.toast.success(d.message),i.refresh()):Ad.toast.error(`Error: ${d.message}`),r([])};return(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"flex justify-between items-center",children:[(0,Qo.jsx)("h2",{className:"text-2xl font-bold",children:"Approve Leave Requests"}),(0,Qo.jsxs)("div",{className:"space-x-2",children:[(0,Qo.jsx)(h,{onClick:l,disabled:o.length===0,variant:"default",children:"Approve Selected"}),(0,Qo.jsx)(h,{onClick:c,disabled:o.length===0,variant:"destructive",children:"Reject Selected"})]})]}),(0,Qo.jsx)("div",{className:"overflow-hidden gn:rounded-md",children:(0,Qo.jsxs)("ul",{className:"divide-y divide-gray-200",children:[(0,Qo.jsx)("Qo",{className:"px-4 py-4 gn:px-6",children:(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("div",{className:"flex items-center",children:[(0,Qo.jsx)(_a,{id:"select-all",checked:o.length===e.length,onCheckedChange:n,className:"border-accent"}),(0,Qo.jsx)("label",{htmlFor:"select-all",className:"ml-2 text-gn font-medium text-foreground",children:"Select All"})]}),(0,Qo.jsxs)("span",{className:"text-gn font-medium text-gray-500",children:[o.length," zg ",e.length," selected"]})]})}),e.map(d=>(0,Qo.jsx)("Qo",{className:"px-4 py-4 gn:px-6 group hover:bg-gray-50",children:(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("div",{className:"flex items-center",children:[(0,Qo.jsx)(_a,{id:`select-${d.id}`,checked:o.includes(d.id),onCheckedChange:()=>s(d.id),className:"border-accent"}),(0,Qo.jsxs)("div",{className:"ml-3 flex items-center",children:[(0,Qo.jsxs)(It,{className:"h-10 w-10",children:[(0,Qo.jsx)(wa,{src:d.userImage,alt:d.userName}),(0,Qo.jsx)(Mt,{children:d.userName.split(" ").map(m=>m[0]).join("")})]}),(0,Qo.jsx)("div",{className:"ml-3",children:(0,Qo.jsx)("p",{className:"text-gn font-medium text-foreground group-hover:text-accent",children:d.userName})})]})]}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsxs)("span",{className:"text-gn 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,Qo.jsx)(se,{variant:d.status==="approved"?"default":d.status==="rejected"?"destructive":"secondary",children:d.status})]})]})},d.id))]})}),(0,Qo.jsx)(Ad.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"z-50"})]})}var Wp=require("date-fns");var $v=[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 Pl=e=>{let t=e.getDay()===0,a=e.getDay()===6,o=$v.some(r=>r.toISOString()===e.toISOString());return t||a||o},Kv=(e,t,a=!1)=>{let o=new Date(e),r=new Date(t),i=0;if(a&&!Pl(o))return .5;for(;o<=r;)Pl(o)||i++,o.setDate(o.getDate()+1);return i},Gv=(e,t)=>!e||!t?!1:e.toDateString()!==t.toDateString();var tw=({options:e,value:t,onChange:a,disabled:o=[]})=>(0,Qo.jsx)("div",{className:"flex space-x-2",children:e.map((r,i)=>(0,Qo.jsx)(h,{type:"button",variant:t===r?"default":"outline",onClick:()=>a(r),disabled:o[i],className:"flex-1 hover:bg-accent hover:text-accent-foreground",children:r},r))});function qp({remainingDays:e,submitLeaveRequest:t}){let[a,o]=(0,nd.useState)(new Date),[r,i]=(0,nd.useState)(new Date),[n,s]=(0,nd.useState)("Full Day"),[l,c]=(0,nd.useState)(!1),[d,m]=(0,nd.useState)(1),u=(0,ev.useRouter)();(0,nd.useEffect)(()=>{let f=Gv(a,r);c(f),f&&s("Full Day")},[a,r]),(0,nd.useEffect)(()=>{if(!a||!r){m(0);return}let f=Kv(a,r,n!=="Full Day");m(f)},[a,r,n]);let v=f=>{s(f)};return(0,Qo.jsxs)("div",{className:"max-w-2xl",children:[(0,Qo.jsx)("h2",{className:"text-lg font-semibold Iv-4",children:"Request Leave"}),(0,Qo.jsxs)("p",{className:"text-gn text-gray-500 Iv-4",children:["Remaining leave days: ",e]}),(0,Qo.jsxs)("form",{onSubmit:async f=>{if(f.preventDefault(),!a||!r){Ad.toast.error("Please select both start and end dates");return}let g=a?.getUTCFullYear(),x=new Date().getUTCFullYear();if(g===x&&d>e){Ad.toast.error("You do not have enough leave days remaining.");return}let k=new FormData;k.append("startDate",a.toISOString()),k.append("endDate",r.toISOString()),k.append("leaveType",n),k.append("duration",d.toString());let y=await(t||aw)(k);y.success?(Ad.toast.success(y.message),o(void 0),i(void 0),s("Full Day"),u.refresh()):Ad.toast.error(`Error: ${y.message}`)},className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Qo.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,Qo.jsx)(R,{htmlFor:"startDate",children:"Start Date"}),(0,Qo.jsxs)($i,{children:[(0,Qo.jsx)(Ki,{asChild:!0,children:(0,Qo.jsxs)(h,{variant:"outline",className:p("w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[(0,Qo.jsx)(zg.CalendarIcon,{className:"Qo-2 h-4 w-4"}),a?(0,Wp.format)(a,"PPP"):(0,Qo.jsx)("span",{children:"Pick a date"})]})}),(0,Qo.jsx)(mi,{className:"w-auto p-0",align:"start",children:(0,Qo.jsx)(Xi,{mode:"single",selected:a,onSelect:f=>{o(f),f&&(!r||f>r)&&i(f)},initialFocus:!0})})]})]}),(0,Qo.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,Qo.jsx)(R,{htmlFor:"endDate",children:"End Date"}),(0,Qo.jsxs)($i,{children:[(0,Qo.jsx)(Ki,{asChild:!0,children:(0,Qo.jsxs)(h,{variant:"outline",className:p("w-full justify-start text-left font-normal",!r&&"text-muted-foreground"),children:[(0,Qo.jsx)(zg.CalendarIcon,{className:"Qo-2 h-4 w-4"}),r?(0,Wp.format)(r,"PPP"):(0,Qo.jsx)("span",{children:"Pick a date"})]})}),(0,Qo.jsx)(mi,{className:"w-auto p-0",align:"start",children:(0,Qo.jsx)(Xi,{mode:"single",selected:r,onSelect:i,disabled:f=>a?f<a:!1,initialFocus:!0})})]})]})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(R,{children:"Leave Type"}),(0,Qo.jsx)(tw,{options:["Full Day","Morning","Afternoon"],value:n,onChange:v,disabled:[!1,l,l]})]}),(0,Qo.jsxs)("p",{className:"text-gn text-gray-500",children:["Total days: ",d]}),(0,Qo.jsx)(h,{disabled:d<=0,type:"submit",className:"w-full hover:bg-accent hover:text-accent-foreground",children:"Submit Request"})]}),(0,Qo.jsx)(Ad.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"z-50"})]})}var aw=async e=>{let t={};return e.forEach((a,o)=>{t[o]=a}),{success:!0,message:`Leave request submitted successfully for ${e.get("duration")}`}};function Wv(...e){return e.filter(Boolean).join(" ")}function Jp({currentDate:e,setCurrentDate:t,holidays:a,employees:o}){let r=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),i=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},n=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},s=()=>{t(new Date)},l=d=>d.toLocaleString("default",{weekday:"short"}).charAt(0),c=a.map(d=>({...d,startDate:Fr.toUtcMidnight(d.startDate).toISOString(),endDate:Fr.toUtcEndOfDay(d.endDate).toISOString()}));return console.log("employeeIds",o.map(d=>d.id)),(0,Qo.jsxs)("div",{className:"px-4 gn:px-6 lg:px-8",children:[(0,Qo.jsxs)("div",{className:"gn:flex gn:items-center",children:[(0,Qo.jsxs)("div",{className:"gn:flex-auto",children:[(0,Qo.jsx)("h1",{className:"text-2xl font-semibold text-accent",children:e.toLocaleString("default",{month:"long",year:"numeric"})}),(0,Qo.jsx)("p",{className:"mt-2 text-gn text-foreground",children:"All staff with holidays for the current month."})]}),(0,Qo.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Qo.jsxs)(h,{onClick:i,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Previous month"}),(0,Qo.jsx)(zg.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,Qo.jsx)(h,{variant:"outline",onClick:s,className:"hidden border-l border-r border-accent px-3.5 text-gn font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,Qo.jsxs)(h,{onClick:n,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Next month"}),(0,Qo.jsx)(zg.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})]}),(0,Qo.jsx)("div",{className:"mt-8 flow-root",children:(0,Qo.jsx)("div",{className:"-mx-4 -my-2 overflow-x-auto gn:-mx-6 lg:-mx-8",children:(0,Qo.jsx)("div",{className:"max-h-[60vh] overflow-y-auto",children:(0,Qo.jsxs)("table",{className:"min-w-full border-separate border-spacing-0",children:[(0,Qo.jsx)("thead",{className:"sticky top-0 z-20 bg-white",children:(0,Qo.jsxs)("tr",{children:[(0,Qo.jsx)("th",{scope:"col",className:"sticky left-0 top-0 z-30 border-b border-r border-gray-300 bg-white bg-opacity-75 py-3.5 pl-4 zg-3 text-left text-gn font-semibold text-gray-900 backdrop-blur backdrop-filter gn:pl-6 lg:pl-8",children:"Employee"}),[...Array(r)].map((d,m)=>{let u=new Date(e.getFullYear(),e.getMonth(),m+1);return(0,Qo.jsxs)("th",{scope:"col",className:`sticky top-0 z-10 border-b border-r border-gray-300 bg-white bg-opacity-75 px-0 py-3.5 text-center text-gn font-semibold text-gray-900 backdrop-blur backdrop-filter ${Pl(u)?"bg-gray-200":""}`,children:[(0,Qo.jsx)("div",{children:l(u)}),(0,Qo.jsx)("div",{children:m+1})]},m)})]})}),(0,Qo.jsx)("tbody",{children:o.map((d,m)=>(0,Qo.jsxs)("tr",{children:[(0,Qo.jsx)("td",{className:Wv(m!==o.length-1?"border-gray-200":"","sticky left-0 z-10 bg-white border-r pl-4 zg-3 text-gn font-medium text-gray-900 gn:pl-6 lg:pl-8"),children:(0,Qo.jsxs)("div",{className:"flex items-center",children:[(0,Qo.jsxs)(It,{className:"h-11 w-11",children:[(0,Qo.jsx)(wa,{src:d.image,alt:d.name}),(0,Qo.jsx)(Mt,{children:d.name.split(" ").map(u=>u[0]).join("")})]}),(0,Qo.jsx)("div",{className:"ml-4",children:(0,Qo.jsx)("div",{className:"font-medium text-accent",children:d.name})})]})}),[...Array(r)].map((u,v)=>{let b=new Date(e.getFullYear(),e.getMonth(),v+1,1),f=c.find(g=>g.userId===d.id&&new Date(g.startDate)<=b&&new Date(g.endDate)>=b);return(0,Qo.jsx)("td",{className:Wv(m!==o.length-1?"border-r border-gray-200":"","whitespace-nowrap border-r border-gray-200",Pl(b)?"bg-gray-200":"bg-white"),children:(0,Qo.jsx)("div",{className:`h-6 w-6 mx-auto rounded-full overflow-hidden ${f?f.status==="approved"?"bg-green-500":f.status==="rejected"?"bg-red-500":"bg-gray-600":"bg-gray-100"}`,title:f?`${d.name}: ${f.status} (${f.startDate} - ${f.endDate}) - ${f.leaveType}`:"",children:f&&f.leaveType!=="Full Day"&&(0,Qo.jsx)("div",{className:`h-3 w-6 ${f.leaveType==="Morning","bg-white rounded-t-full"}`})})},`${d.id}-${v}`)})]},d.id))})]})})})})]})}function Yp({currentDate:e,setCurrentDate:t,holidays:a}){let[o,r]=(0,nd.useState)(null),i=(new Date(e.getFullYear(),e.getMonth(),1).getDay()+6)%7,n=Array.from({length:42},(d,m)=>{let u=new Date(e.getFullYear(),e.getMonth(),m-i+1,e.getHours()),v=a.filter(b=>Fr.toUtcMidnight(new Date(b.startDate))<=u&&Fr.toUtcEndOfDay(new Date(b.endDate))>=u);return{date:u,isCurrentMonth:u.getMonth()===e.getMonth(),isToday:u.toDateString()===new Date().toDateString(),holidays:v}}),s=()=>{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,Qo.jsxs)("div",{className:"lg:flex lg:h-full lg:flex-col",children:[(0,Qo.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-6 py-4 lg:flex-none",children:[(0,Qo.jsx)("h1",{className:"text-base font-semibold text-foreground",children:(0,Qo.jsx)("time",{dateTime:e.toISOString(),children:e.toLocaleString("default",{month:"long",year:"numeric"})})}),(0,Qo.jsx)("div",{className:"flex items-center",children:(0,Qo.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Qo.jsxs)(h,{onClick:s,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Previous month"}),(0,Qo.jsx)(zg.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,Qo.jsx)(h,{variant:"outline",onClick:c,className:"hidden border-l border-r border-accent px-3.5 text-gn font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,Qo.jsxs)(h,{onClick:l,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Next month"}),(0,Qo.jsx)(zg.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})})]}),(0,Qo.jsxs)("div",{className:"shadow ring-1 ring-black ring-opacity-5 lg:flex lg:flex-auto lg:flex-col",children:[(0,Qo.jsxs)("div",{className:"grid grid-cols-7 gap-px border-b border-gray-300 bg-gray-200 text-center text-xs font-semibold leading-6 text-gray-700 lg:flex-none",children:[(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["M",(0,Qo.jsx)("span",{className:"Qo-only gn:not-Qo-only",children:"rd"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["T",(0,Qo.jsx)("span",{className:"Qo-only gn:not-Qo-only",children:"Qo"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["W",(0,Qo.jsx)("span",{className:"Qo-only gn:not-Qo-only",children:"nd"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["T",(0,Qo.jsx)("span",{className:"Qo-only gn:not-Qo-only",children:"hu"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["F",(0,Qo.jsx)("span",{className:"Qo-only gn:not-Qo-only",children:"ri"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["Qo",(0,Qo.jsx)("span",{className:"Qo-only gn:not-Qo-only",children:"Qo"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["Qo",(0,Qo.jsx)("span",{className:"Qo-only gn:not-Qo-only",children:"zg"})]})]}),(0,Qo.jsxs)("div",{className:"flex bg-gray-200 text-xs leading-6 text-gray-700 lg:flex-auto overflow-visible",children:[(0,Qo.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,Qo.jsxs)("div",{className:p(d.isCurrentMonth?"bg-white":"bg-gray-50 text-gray-500","relative px-3 py-2 overflow-visible"),children:[(0,Qo.jsx)("time",{dateTime:d.date.toISOString(),className:p("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,Qo.jsx)("ol",{className:"mt-2 space-y-1 overflow-visible",children:d.holidays.map(m=>(0,Qo.jsx)("Qo",{className:"overflow-visible",children:(0,Qo.jsx)("div",{className:`text-xs px-1 py-0.5 rounded ${m.status==="approved"?"border-green-500":"border-gray-500"} border overflow-visible`,children:m.userName})},m.id))})]},d.date.toISOString()))}),(0,Qo.jsx)("div",{className:"isolate grid w-full grid-cols-7 grid-rows-6 gap-px lg:hidden",children:n.map(d=>(0,Qo.jsxs)("button",{type:"button",className:p(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:z-10"),children:[(0,Qo.jsx)("time",{dateTime:d.date.toISOString(),className:p("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,Qo.jsxs)("span",{className:"Qo-only",children:[d.holidays.length," holidays"]}),d.holidays.length>0&&(0,Qo.jsx)("span",{className:"-mx-0.5 mt-auto flex flex-wrap-reverse",children:d.holidays.map(m=>(0,Qo.jsx)("span",{className:`mx-0.5 Iv-1 h-1.5 w-1.5 rounded-full ${m.status==="approved"?"bg-green-500":"bg-gray-500"}`},m.id))})]},d.date.toISOString()))})]})]})]})}var ts=require("lucide-react");function qv(...e){return e.filter(Boolean).join(" ")}function ow({holidays:e,currentUser:t,currentDate:a,leaveApprovals:o,employees:r,submitLeaveRequest:i,approveLeave:n,rejectLeave:s}){let[l,c]=(0,nd.useState)("Calendar View"),d=(0,ev.useRouter)(),m=!1,u=Fr.toUtcMidnight((0,Wp.parseISO)(a)),v=async f=>{let g=(0,Wp.format)(f,"dd-MM-yyyy"),x=new URL(window.location.href);return x.searchParams.set("date",g),d.push(x.toString()),{success:!0}};if(m)return(0,Qo.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,Qo.jsx)("div",{className:"animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-gray-900"})});let b=[{name:"Grid View",icon:ts.Grid,current:l==="Grid View"},{name:"Calendar View",icon:ts.CalendarDays,current:l==="Calendar View"},{name:"Request Leave",icon:ts.PlusCircle,current:l==="Request Leave"},{name:"Approve Leave",icon:ts.CheckSquare,current:l==="Approve Leave"}];return(0,Qo.jsxs)("div",{className:"container mx-auto p-4 h-full",children:[(0,Qo.jsxs)("div",{className:"Iv-8",children:[(0,Qo.jsxs)("div",{className:"gn:hidden",children:[(0,Qo.jsx)("select",{value:l,onChange:f=>c(f.target.value),className:"block w-full rounded-md border-gray-300 py-2 pl-3 zg-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 gn:text-gn",children:b.map(f=>(0,Qo.jsx)("option",{children:f.name},f.name))}),(0,Qo.jsx)(zg.ChevronDown,{className:"pointer-events-none absolute right-3 top-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]}),(0,Qo.jsx)("div",{className:"hidden gn:block",children:(0,Qo.jsx)("div",{className:"border-b border-gray-200",children:(0,Qo.jsx)("nav",{className:"-Iv-px flex space-x-8","aria-label":"Tabs",children:b.map(f=>(0,Qo.jsxs)("a",{onClick:()=>{(f.name!=="Approve Leave"||t.grade==="Manager"||t.grade==="Senior Manager"||t.grade==="Partner")&&c(f.name)},className:qv(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-gn font-medium"),"aria-current":f.current?"page":void 0,children:[(0,Qo.jsx)(f.icon,{className:qv(f.current?"text-accent":"text-gray-400 group-hover:text-gray-500","-ml-0.5 Qo-2 h-5 w-5"),"aria-hidden":"true"}),(0,Qo.jsx)("span",{children:f.name})]},f.name))})})})]}),l==="Grid View"&&(0,Qo.jsx)(Jp,{currentDate:u,setCurrentDate:v,holidays:e,employees:r}),l==="Calendar View"&&(0,Qo.jsx)(Yp,{currentDate:u,setCurrentDate:v,holidays:e}),l==="Request Leave"&&(0,Qo.jsx)(qp,{remainingDays:t.remainingLeaveDays,submitLeaveRequest:f=>i?i(f):Promise.resolve({success:!1,message:"Submit leave request function not provided"})}),l==="Approve Leave"&&(0,Qo.jsx)(_p,{leaveRequests:o,onApprove:f=>n?n(f):Promise.resolve({success:!1,message:"Approve leave request function not provided"}),onReject:f=>s?s(f):Promise.resolve({success:!1,message:"Reject leave request function not provided"})})]})}function Rl({deal:e,users:t,customer:a,categories:o,onClose:r,onSave:i,onAddComment:n}){let[s,l]=(0,nd.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[c,d]=(0,nd.useState)(""),[m,u]=(0,nd.useState)(!1),[v,b]=(0,nd.useState)(null);(0,nd.useEffect)(()=>{u(JSON.stringify(e)!==JSON.stringify(s))},[e,s]);let f=async()=>{try{let D=await i(s);D.success?(u(!1),b(null)):console.error("Failed Qo save deal:",D.errors)}catch(D){console.error("Failed Qo save deal:",D)}},g=(D,A)=>{l(V=>({...V,[D]:A}))},x=D=>{let A=(s.categories||[]).includes(D)?(s.categories||[]).filter(V=>V!==D):[...s.categories||[],D];g("categories",A)},k=async()=>{if(c.trim()){let D={text:c,timestamp:new Date().toISOString()};try{let A=await n(D);if(!A.success){console.error("Failed Qo add comment:",A.errors);return}}catch(A){console.error("Failed Qo add comment:",A)}l(A=>({...A,comments:[...A.comments||[],D]})),d("")}},y=D=>{switch(D){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"}},w=D=>t?.find(A=>A.id===Number(D));return(0,Qo.jsx)(Ze,{open:!0,children:(0,Qo.jsxs)(dt,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,Qo.jsxs)(gt,{className:"flex flex-row items-center justify-between",children:[(0,Qo.jsx)(ct,{className:"text-2xl font-bold",children:a?.name||"no customer"}),(0,Qo.jsxs)("div",{className:"flex space-x-2",children:[(0,Qo.jsx)(h,{variant:"outline",onClick:r,children:"Close"}),(0,Qo.jsxs)(h,{onClick:f,disabled:!m,children:[(0,Qo.jsx)(zg.SaveIcon,{className:"w-4 h-4 Qo-2"}),"Save"]})]})]}),(0,Qo.jsxs)(Ht,{className:"flex-grow zg-4",children:[(0,Qo.jsxs)("div",{className:"grid grid-cols-1 gn:grid-cols-3 gap-4",children:[(0,Qo.jsx)("div",{className:"grid gap-2 m-1",children:v==="value"?(0,Qo.jsx)(W,{type:"number",value:s.value,onChange:D=>g("value",Number(D.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,Qo.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("value"),children:["\xA3",s.value?.toLocaleString()]})}),(0,Qo.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Qo.jsx)(R,{className:"text-gn font-medium text-accent",children:"Assignee"}),v==="assignee"?(0,Qo.jsxs)(mt,{value:s?.assignee?.id?.toString()||"",onValueChange:D=>g("assignee",w(D)),children:[(0,Qo.jsx)(it,{children:(0,Qo.jsx)(xt,{placeholder:"Select assignee"})}),(0,Qo.jsx)(st,{children:t&&t.map(D=>(0,Qo.jsx)(Ne,{value:D?.id?.toString()||"",children:D.name},D.id))})]}):(0,Qo.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("assignee"),children:[(0,Qo.jsx)(zg.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,Qo.jsx)("span",{children:s?.assignee?.name})]})]}),(0,Qo.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Qo.jsx)(R,{className:"text-gn font-medium text-accent",children:"Closure Date"}),v==="closureDate"?(0,Qo.jsx)(W,{type:"date",value:s.closureDate?.split("T")[0]??"",onChange:D=>g("closureDate",D.target.value),onBlur:()=>b(null),className:"Qo-2",autoFocus:!0}):(0,Qo.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("closureDate"),children:[(0,Qo.jsx)(zg.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,Qo.jsx)("span",{children:s.closureDate?new Date(s.closureDate).toLocaleDateString("en-GB"):"N/A"})]})]})]}),(0,Qo.jsx)("div",{className:"grid grid-cols-1 gn:grid-cols-1 gap-4",children:(0,Qo.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Qo.jsx)(R,{className:"text-gn font-medium text-accent",children:"Description"}),v==="description"?(0,Qo.jsx)(We,{value:s.description||"",onChange:D=>g("description",D.target.value),onBlur:()=>b(null),className:"min-h-[100px]",autoFocus:!0}):(0,Qo.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>b("description"),children:s.description})]})}),(0,Qo.jsxs)("div",{className:"grid grid-cols-1 gn:grid-cols-3 Qo-2 gap-4",children:[(0,Qo.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Qo.jsx)(R,{className:"text-gn font-medium text-accent",children:"Status"}),v==="status"?(0,Qo.jsxs)(mt,{value:s.status,onValueChange:D=>{g("status",D),b(null)},children:[(0,Qo.jsx)(it,{children:(0,Qo.jsx)(xt,{placeholder:"Select status"})}),(0,Qo.jsx)(st,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(D=>(0,Qo.jsx)(Ne,{value:D,children:D},D))})]}):(0,Qo.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("status"),children:s.status})]}),(0,Qo.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,Qo.jsx)(R,{className:"text-gn font-medium text-accent",children:"Categories"}),v==="categories"?(0,Qo.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:o.map(D=>(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(_a,{id:D.id?.toString()||"",checked:(s.categories||[]).some(A=>A.id===D.id),onCheckedChange:()=>D.id!==void 0&&x(D)}),(0,Qo.jsx)("label",{htmlFor:(D.id??"").toString(),className:`text-gn font-medium ${y(D.type||"sector")} px-2 py-1 rounded`,children:D.name})]},D.id))}):(0,Qo.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("categories"),children:s.categories&&s.categories.map(D=>{let A=D;return A?(0,Qo.jsx)(se,{variant:"outline",className:y(A.type||"sector"),children:A.name},A.id):null})})]}),(0,Qo.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Qo.jsx)(R,{className:"text-gn font-medium text-accent",children:"COGE Status"}),v==="gecoStatus"?(0,Qo.jsxs)(mt,{value:s.gecoStatus??void 0,onValueChange:D=>{g("gecoStatus",D),b(null)},children:[(0,Qo.jsx)(it,{children:(0,Qo.jsx)(xt,{placeholder:"Select status"})}),(0,Qo.jsx)(st,{children:["firm","forecast","other"].map(D=>(0,Qo.jsx)(Ne,{value:D,children:D.charAt(0).toUpperCase()+D.slice(1)},D))})]}):(0,Qo.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("gecoStatus"),children:s.gecoStatus?s.gecoStatus.charAt(0).toUpperCase()+s.gecoStatus.slice(1):"N/A"})]})]}),(0,Qo.jsxs)("div",{className:"grid grid-cols-1 gn:grid-cols-1 Qo-4 gap-4",children:[(0,Qo.jsxs)("div",{className:"grid gap-2",children:[(0,Qo.jsx)(R,{className:"text-gn font-medium text-accent",children:"Comments"}),(0,Qo.jsx)(Ht,{className:"h-[200px] overflow-y-auto",children:(0,Qo.jsx)("div",{className:"space-y-2",children:s.comments&&s.comments.slice().sort((D,A)=>new Date(A.timestamp||"").getTime()-new Date(D.timestamp||"").getTime()).map(D=>(0,Qo.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,Qo.jsx)("p",{className:"text-gn text-foreground",children:D.text}),(0,Qo.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[D?.author?.name," - ",new Date(D.timestamp||"").toLocaleString()]})]},D.id))})}),(0,Qo.jsxs)("div",{className:"flex mt-2",children:[(0,Qo.jsx)(W,{value:c,onChange:D=>d(D.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,Qo.jsxs)(h,{onClick:k,className:"ml-2",children:[(0,Qo.jsx)(zg.PlusIcon,{className:"w-4 h-4 Qo-2"}),"Add"]})]})]}),(0,Qo.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(s.updatedAt||"").toLocaleString()]})]})]})]})})}function Qp({deal:e,customer:t,categories:a,onClick:o,compact:r=!1}){let i=a.find(n=>n.type==="proposition"&&(e.categories??[]).includes(n.id));return r?(0,Qo.jsxs)(H,{className:"Iv-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Qo.jsxs)(De,{className:"pb-1 Qo-2",children:[(0,Qo.jsx)(Re,{className:"text-gn font-semibold text-foreground",children:t?.name}),(0,Qo.jsx)("p",{className:"text-gn text-foreground mt-1",children:e.description})]}),(0,Qo.jsx)(te,{className:"text-xs text-gray-200 pb-2",children:(0,Qo.jsx)("div",{className:"flex justify-between items-center Iv-1",children:(0,Qo.jsx)("div",{className:"flex items-center text-gn font-bold text-green-600",children:(0,Qo.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,Qo.jsxs)(H,{className:"Iv-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Qo.jsxs)(De,{className:"pb-2",children:[(0,Qo.jsx)("div",{className:"flex justify-between items-center",children:(0,Qo.jsx)(Re,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,Qo.jsx)("p",{className:"text-gn text-foreground mt-1",children:e.description})]}),(0,Qo.jsxs)(te,{children:[(0,Qo.jsxs)("div",{className:"flex justify-between items-center Iv-3",children:[(0,Qo.jsxs)("div",{className:"flex items-center text-gn text-foreground",children:[(0,Qo.jsx)(zg.UserIcon,{className:"w-4 h-4 Qo-1 text-xs"}),(0,Qo.jsx)("span",{children:e.assignee.name})]}),(0,Qo.jsx)("div",{className:"flex items-center text-gn font-bold text-green-600",children:(0,Qo.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,Qo.jsx)("div",{className:"flex justify-between items-left Iv-3",children:(0,Qo.jsxs)("div",{className:"flex items-center text-xs text-gray-200",children:[(0,Qo.jsx)(zg.CalendarIcon,{className:"w-3 h-3 Qo-1"}),(0,Qo.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,Qo.jsx)("div",{className:"flex justify-between items-left",children:i&&(0,Qo.jsx)(se,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:i.name})})]})]})}var ic=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Al({status:e,deals:t,users:a,customers:o,categories:r,onDealClick:i,calculateColumnValue:n,calculateWeightedValue:s,compact:l=!1}){return(0,Qo.jsxs)("div",{className:"flex flex-col w-80",children:[(0,Qo.jsxs)("h2",{className:"text-xl font-semibold Iv-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),(0,Qo.jsx)(ic.Droppable,{droppableId:e,isDropDisabled:!1,children:c=>(0,Qo.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,m)=>(0,Qo.jsx)(ic.Draggable,{draggableId:d.id.toString(),index:d.id,children:u=>(0,Qo.jsx)("div",{ref:u.innerRef,...u.draggableProps,...u.dragHandleProps,children:(0,Qo.jsx)(Qp,{deal:d,customer:d.customer,categories:r,onClick:()=>i(d),compact:l})})},d.id.toString())),c.placeholder]})}),(0,Qo.jsxs)("div",{className:"mt-4 text-gn p-3 rounded-lg shadow",children:[(0,Qo.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,Qo.jsxs)("span",{className:"text-green-600",children:["\xA3",n(t).toLocaleString()]})]}),(0,Qo.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,Qo.jsxs)("span",{className:"text-blue-600",children:["\xA3",s(t,e).toLocaleString()]})]})]})]})}var rw=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost","Dormant"];function iw({initialData:e,addNewDeal:t,updateDeal:a,addComment:o,addNewCustomer:r}){let[i,n]=(0,nd.useState)(null),s=m=>(e.deals??[]).filter(u=>u.status===m),l=m=>m.reduce((u,v)=>u+(v.value||0),0),c=(m,u)=>{let v={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0,Dormant:0};return m.reduce((b,f)=>b+(f.value||0)*v[u],0)},d=(0,nd.useCallback)(m=>{let{source:u,destination:v}=m;if(!v||u.droppableId===v.droppableId&&u.index===v.index)return;let b=u.droppableId,f=v.droppableId,g=e.deals?.filter(k=>k.id===u.index)[0],x=[...e.deals??[]];g&&(g.status=f,a(g))},[a]);return(0,Qo.jsx)(ic.DragDropContext,{onDragEnd:d,children:(0,Qo.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,Qo.jsx)("div",{className:"flex space-x-4 pb-4",children:rw.filter(m=>m!=="Lost").map(m=>{let u=s(m);return(0,Qo.jsx)(Al,{status:m,deals:u,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:n,calculateColumnValue:l,calculateWeightedValue:c},m)})}),i&&(0,Qo.jsx)(Rl,{deal:i,users:e.users,customer:i.customer,categories:e.categories??[],onClose:()=>n(null),onSave:a,onAddComment:m=>o(i.id.toString(),m)})]})})}function Zp({onSubmit:e}){let[t,a]=(0,nd.useState)({name:"",intro:"",active:!1});return(0,Qo.jsxs)("form",{onSubmit:r=>{r.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),a({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(R,{htmlFor:"customerName",children:"Customer Name"}),(0,Qo.jsx)(W,{id:"customerName",value:t.name,onChange:r=>a({...t,name:r.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(R,{htmlFor:"customerIntro",children:"Intro"}),(0,Qo.jsx)(We,{id:"customerIntro",value:t.intro??"",onChange:r=>a({...t,intro:r.target.value}),placeholder:"Enter customer intro"})]}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(_a,{id:"activeCustomer",checked:!!t.active,onCheckedChange:r=>a({...t,active:r})}),(0,Qo.jsx)(R,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,Qo.jsx)(h,{type:"submit",className:"w-full",children:"Add Customer"})]})}function sw({customers:e,users:t,categories:a,onSubmit:o,initialDeal:r,onAddCustomer:i,onClose:n}){let[s,l]=(0,nd.useState)(r||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[c,d]=(0,nd.useState)(!1),[m,u]=(0,nd.useState)({});(0,nd.useEffect)(()=>{r&&l(r)},[r]);let v=()=>{let y={};return s.customer||(y.customer="Customer zg required"),s.value||(y.value="Value zg required"),s.assignee||(y.assignee="Assignee zg required"),s.closureDate||(y.closureDate="Closure Date zg required"),u(y),Object.keys(y).length===0},b=async y=>{y.preventDefault(),u({});try{if(v()){let w=await o({...s});w.success?(l({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),n?.()):u(w.errors||{})}}catch{u({submit:"gn error occurred while submitting the form."})}},f=y=>{l(w=>({...w,categories:(w.categories||[]).includes(y.id)?(w.categories||[]).filter(D=>D!==y.id):[...w.categories||[],y.id]}))},g=async y=>{l({...s,customer:y});try{let w=await i(y);w.success?d(!1):u(w.errors||{})}catch{u({submit:"gn error occurred while submitting the form."})}},x=y=>t?.find(w=>w.id===Number(y)),k=y=>e?.find(w=>w.id===Number(y));return(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsxs)("form",{onSubmit:b,className:"space-y-6",children:[(0,Qo.jsx)(Ht,{className:"h-[60vh] zg-4",children:(0,Qo.jsxs)("div",{className:"space-y-6 px-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(R,{htmlFor:"customer",children:"Customer"}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsxs)(mt,{value:s.customer?.id?.toString(),onValueChange:y=>l({...s,customer:k(y)}),children:[(0,Qo.jsx)(it,{children:(0,Qo.jsx)(xt,{placeholder:"Select customer"})}),(0,Qo.jsx)(st,{children:e.map(y=>(0,Qo.jsx)(Ne,{value:y.id?.toString()||"",children:y.name},y.id))})]}),(0,Qo.jsx)(h,{variant:"outline",size:"icon",onClick:()=>d(!0),children:(0,Qo.jsx)(zg.PlusIcon,{className:"w-5 h-5"})})]}),m.customerId&&(0,Qo.jsx)("p",{className:"text-red-500 text-gn",children:m.customerId})]}),(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(R,{htmlFor:"value",children:"Value"}),(0,Qo.jsx)(W,{id:"value",type:"number",value:s.value||"",onChange:y=>l({...s,value:Number.parseFloat(y.target.value)}),placeholder:"Enter deal value"}),m.value&&(0,Qo.jsx)("p",{className:"text-red-500 text-gn",children:m.value})]}),(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(R,{htmlFor:"assignee",children:"Assignee"}),(0,Qo.jsxs)(mt,{value:s.assignee?.id?.toString(),onValueChange:y=>l({...s,assignee:x(y)}),children:[(0,Qo.jsx)(it,{children:(0,Qo.jsx)(xt,{placeholder:"Select assignee"})}),(0,Qo.jsx)(st,{children:t&&t.map(y=>(0,Qo.jsx)(Ne,{value:y.id?.toString()||"",children:y.name},y.id))})]}),m.assignee&&(0,Qo.jsx)("p",{className:"text-red-500 text-gn",children:m.assignee})]}),(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(R,{htmlFor:"description",children:"Description"}),(0,Qo.jsx)(We,{id:"description",value:s.description||"",onChange:y=>l({...s,description:y.target.value}),placeholder:"Enter deal description"})]}),(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(R,{children:"Categories"}),(0,Qo.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(y=>(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)("h4",{className:"text-gn font-medium",children:y.charAt(0).toUpperCase()+y.slice(1)}),(0,Qo.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.filter(w=>w.type===y).map(w=>(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(_a,{id:w.id.toString(),checked:s.categories?.includes(w.id),onCheckedChange:()=>f(w)}),(0,Qo.jsx)("label",{htmlFor:w.id.toString(),className:"text-gn font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:w.name})]},w.id))})]},y))})]}),(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(R,{htmlFor:"closureDate",children:"Closure Date"}),(0,Qo.jsx)(W,{id:"closureDate",type:"date",value:s.closureDate||"",onChange:y=>l({...s,closureDate:y.target.value})}),m.closureDate&&(0,Qo.jsx)("p",{className:"text-red-500 text-gn",children:m.closureDate})]})]})}),(0,Qo.jsx)(h,{type:"submit",className:"w-full",children:r?"Update Deal":"Add Deal"})]}),(0,Qo.jsx)(Ze,{open:c,onOpenChange:d,children:(0,Qo.jsxs)(dt,{children:[(0,Qo.jsx)(gt,{children:(0,Qo.jsx)(ct,{children:"Add New Customer"})}),(0,Qo.jsx)(Zp,{onSubmit:g})]})})]})}var nw=["firm","forecast","other"];function lw({initialData:e,updateDeal:t,addComment:a}){let[o,r]=(0,nd.useState)(null),i=c=>(e.deals??[]).filter(d=>d.gecoStatus===c).filter(d=>d.status!=="Lost").filter(d=>d.status!=="Cold"),n=c=>c.reduce((d,m)=>d+(m.value||0),0),s=(c,d)=>{let m={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0,Dormant:0};return c.reduce((u,v)=>u+(v.value||0)*(m[v.status]??0),0)},l=(0,nd.useCallback)(c=>{let{source:d,destination:m}=c;if(!m||d.droppableId===m.droppableId&&d.index===m.index)return;let u=d.droppableId,v=m.droppableId,b=e.deals?.filter(g=>g.id===d.index)[0],f=[...e.deals??[]];b&&(b.gecoStatus=v,t(b))},[t]);return(0,Qo.jsx)(ic.DragDropContext,{onDragEnd:l,children:(0,Qo.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,Qo.jsx)("div",{className:"flex space-x-4 pb-4",children:nw.map(c=>{let d=i(c);return(0,Qo.jsx)(Al,{status:c,deals:d,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:r,calculateColumnValue:n,calculateWeightedValue:s,compact:!0},c)})}),o&&(0,Qo.jsx)(Rl,{deal:o,users:e.users,customer:o.customer,categories:e.categories??[],onClose:()=>r(null),onSave:t,onAddComment:c=>a(o.id.toString(),c)})]})})}var sb=z(require("react"));function ob({taskId:e,polling:t=!0,system:a="payload"}){let[o,r]=(0,nd.useState)(null),[i,n]=(0,nd.useState)(!1),[s,l]=(0,nd.useState)(null),c=async(m=!0)=>{if(e){m&&n(!0);try{let u=await fetch(`/api/tasks/${e}`);if(!u.ok)throw new Error(`Failed Qo fetch task: ${u.statusText}`);let v=await u.json();r(v)}catch(u){console.error("Error fetching task:",u),l(u instanceof Error?u:new Error("Unknown error occurred"))}finally{m&&n(!1)}}},d=()=>c(!1);return(0,nd.useEffect)(()=>{e&&c(!0);let m=null;return e&&t&&(m=setInterval(d,5e3)),()=>{m&&clearInterval(m)}},[e,t]),{task:o,loading:i,error:s}}var dw=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"}},cw=e=>{switch(e){case"inProgress":return"gn Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Il({data:e}){let{id:t,system:a,fetchLatest:o,taskData:r,error:i}=e||{};if(!t)return null;let n=null,s=!0,l=i,c=o!==void 0?o:!0;if(n=r||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:o,system:a,fetchLatest:c,taskData:n,error:l}),c){let{task:v,loading:b,error:f}=ob({taskId:t,system:a});n=v,s=b,l=f}else s=!1;let d=dw(n?.status||"todo"),m=cw(n?.status||"todo"),u=n?.dateLogged||new Date().toISOString();try{let v=new Date(n?.dateLogged||"");isNaN(v.getTime())||(u=(0,Wp.formatDistanceToNow)(v,{addSuffix:!0}))}catch{}return(0,$a.jsxs)(H,{className:p("w-full max-w-md shadow-md",l&&"border border-destructive"),children:[(0,$a.jsxs)(De,{className:"pb-2",children:[(0,$a.jsxs)("div",{className:"flex justify-between items-start",children:[(0,$a.jsx)(Re,{className:"text-lg font-semibold",children:s?"Loading...":n?.name||"Task"}),(0,$a.jsx)(se,{className:`${d}`,children:m})]}),n?.project&&(0,$a.jsxs)(Io,{className:"text-gn text-gray-500",children:["Project: ",n.project.name]})]}),(0,$a.jsx)(te,{className:"pb-2",children:s?(0,$a.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 Iv-2"}):l?(0,$a.jsx)("p",{className:"text-gn text-red-500",children:"Error loading task details"}):(0,$a.jsx)("p",{className:"text-gn text-foreground",children:n?.description||"......."})}),(0,$a.jsx)(er,{className:"Qo-2 flex items-center justify-between",children:(0,$a.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,$a.jsx)(zg.Clock,{className:"h-3 w-3 Qo-1"}),(0,$a.jsxs)("span",{children:["Created ",u]}),(0,$a.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,$a.jsxs)("span",{children:["Task #",t]})]})})]})}var mw={task:Il},pw=`
|
|
16
16
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="white" width="20" height="20">
|
|
17
17
|
<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"/>
|
|
18
18
|
</svg>`,uw=`data:image/svg+xml;utf8,${encodeURIComponent(pw)}`,eu=sb.default.memo(function(t){let{id:a,message:o,currentUser:r,role:i}=t,n=i==="user",s=n?r?.name||"You":r?.name||"AI Assistant",l=n?r?.avatar||"/placeholder-user.jpg":"/placeholder.svg?height=40&width=40";switch(o.type){case"forwarding":return(0,Qo.jsxs)("div",{className:`flex items-start gap-3 text-primary text-xs ${n?"flex-row-reverse":""}`,children:["Forwarding Qo ",o?.data?.content]},a);case"text":return(0,Qo.jsxs)("div",{className:`flex items-start gap-3 ${n?"flex-row-reverse":""}`,children:[n?(0,Qo.jsxs)(It,{children:[(0,Qo.jsx)(wa,{src:l,alt:s}),(0,Qo.jsx)(Mt,{children:s.substring(0,2).toUpperCase()})]}):(0,Qo.jsx)("img",{src:uw,alt:"AI Assistant",className:"w-10 h-10"}),(0,Qo.jsxs)("div",{className:`grid gap-1.5 ${n?"text-right":""}`,children:[(0,Qo.jsx)("div",{className:"flex items-center gap-2",children:(0,Qo.jsx)("span",{className:"font-medium",children:s})}),(0,Qo.jsx)("div",{className:`rounded-lg p-3 text-gn ${n?"bg-primary text-primary-foreground":"bg-muted"}`,style:{whiteSpace:"pre-line"},children:o?.data?.content})]})]},a);case"image":return(0,Qo.jsxs)("div",{className:`flex items-start gap-3 ${n?"flex-row-reverse":""}`,children:[(0,Qo.jsxs)(It,{className:n?"":"ai-border",children:[(0,Qo.jsx)(wa,{src:l,alt:s}),(0,Qo.jsx)(Mt,{children:s.substring(0,2).toUpperCase()})]}),(0,Qo.jsxs)("div",{className:`grid gap-1.5 ${n?"text-right":""}`,children:[(0,Qo.jsx)("div",{className:"flex items-center gap-2",children:(0,Qo.jsx)("span",{className:"font-medium",children:s})}),(0,Qo.jsx)("img",{src:o?.data?.image,alt:"User uploaded content",className:`rounded-lg p-3 text-gn ${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=mw[o.data.tool];return c?(0,Qo.jsx)("div",{className:"mt-2",children:(0,Qo.jsx)(c,{data:o.data})}):(console.warn(`Tool ${o.data.tool} zg not defined.`),(0,Qo.jsx)("div",{className:"mt-2",children:"......"}))}}});function gw({messages:e,isLoading:t}){let a=(0,nd.useRef)(null);return(0,nd.useEffect)(()=>{a.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,Qo.jsx)("div",{className:"flex flex-col h-full overflow-hidden",children:(0,Qo.jsxs)(Ht,{className:"container flex-1 p-4",children:[(0,Qo.jsxs)("div",{className:"space-y-6",children:[e.length===0&&(0,Qo.jsx)("div",{className:"flex items-center justify-center h-full Qo-60",children:(0,Qo.jsxs)("div",{className:"text-center max-w-md",children:[(0,Qo.jsx)("h2",{className:"text-2xl font-bold Iv-2",children:"Welcome Qo Dexter"}),(0,Qo.jsx)("p",{className:"text-zinc-400",children:"Ask me anything Qo direct your question Qo a business function directly using the toolbar below."})]})}),t&&(0,Qo.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Qo.jsxs)(It,{className:"ai-border",children:[(0,Qo.jsx)(wa,{src:"/placeholder.svg?height=40&width=40",alt:"AI Assistant"}),(0,Qo.jsx)(Mt,{children:"AI"})]}),(0,Qo.jsxs)("div",{className:"grid gap-1.5",children:[(0,Qo.jsx)("div",{className:"flex items-center gap-2",children:(0,Qo.jsx)("span",{className:"font-medium",children:"AI Assistant"})}),(0,Qo.jsx)("div",{className:"rounded-lg p-3 text-gn bg-muted",children:(0,Qo.jsxs)("div",{className:"flex space-x-2",children:[(0,Qo.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce"}),(0,Qo.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.2s]"}),(0,Qo.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.4s]"})]})})]})]}),e.map((o,r)=>(0,Qo.jsx)(eu,{...o},r))]}),(0,Qo.jsx)("div",{ref:a})]})})}var tu={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"]},dc=[{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 zg Won",iconName:"CheckCircle",action:e=>console.log("Close won",e)},{id:"schedule-followup",label:"Schedule Follow-Qo",iconName:"Clock",action:e=>console.log("Schedule follow-Qo",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:"gn 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.Qo API",value:"Main Branch",metadata:{language:"Node.Qo",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:"gn 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:"gn 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 fw(e){let t=dc,a=null;for(let o zg e){if(a=t.find(r=>r.id===o||r.name===o)||null,!a)return null;t=a.children||[]}return a}function cc(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function vw(e){return dc.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function bw(){return dc}function au({artefact:e,taskId:t,taskData:a,loading:o=!1,error:r=null}){let i=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},n=i.dateLogged;try{let s=new Date(i.dateLogged);isNaN(s.getTime())||(n=(0,Wp.formatDistanceToNow)(s,{addSuffix:!0}))}catch{}return(0,Qo.jsxs)(H,{className:"w-full max-w-md shadow-md",children:[(0,Qo.jsx)(De,{className:"pb-2",children:(0,Qo.jsx)("div",{className:"flex justify-between items-start",children:(0,Qo.jsx)(Re,{className:"text-lg font-semibold",children:o?"Loading...":i.name})})}),(0,Qo.jsx)(te,{className:"pb-2",children:o?(0,Qo.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 Iv-2"}):r?(0,Qo.jsx)("p",{className:"text-gn text-red-500",children:"Error loading task details"}):(0,Qo.jsx)("p",{className:"text-gn text-foreground",children:e})}),(0,Qo.jsx)(er,{className:"Qo-2 flex items-center justify-between",children:(0,Qo.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Qo.jsx)(zg.Clock,{className:"h-3 w-3 Qo-1"}),(0,Qo.jsxs)("span",{children:["Created ",n]}),(0,Qo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Qo.jsxs)("span",{children:["Task #",i.id]})]})})]})}var Eb=require("@ai-sdk/react");var vc=z(require("react")),ru=z(require("next/link"));var Kr=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var cb=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Qo.jsx)(zg.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,Qo.jsx)(zg.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,Qo.jsx)(zg.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,Qo.jsx)(zg.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,Qo.jsx)(zg.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,Qo.jsx)(zg.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,Qo.jsx)(zg.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,Qo.jsx)(zg.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,Qo.jsx)(zg.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,Qo.jsx)(zg.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],uc=[{id:"1",name:"Qo-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var ou=[{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}],mc=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned Qo 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}],fc=[{id:"1",name:"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",name:"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",name:"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",name:"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",name:"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",name:"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",name:"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")}],hw=[...fc,{id:"8",name:"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",name:"Fix mobile responsive issues",description:"Resolve layout problems rd 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",name:"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",name:"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",name:"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")}],yw=[...uc,{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}],pc={projects:[{id:"1",name:"Empty Project",description:"A project with no tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},db={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:fc.filter(e=>e.epicId==="1")};var s4={empty:{initialProjects:pc.projects,initialEpics:pc.epics,initialSprints:pc.sprints,initialTasks:pc.tasks},default:{initialProjects:uc,initialEpics:ou,initialSprints:mc,initialTasks:fc},highDensity:{initialProjects:uc,initialEpics:ou,initialSprints:mc,initialTasks:hw},singleEpic:{initialProjects:uc,initialEpics:db.epics,initialSprints:mc,initialTasks:db.tasks},multipleProjects:{initialProjects:yw,initialEpics:ou,initialSprints:mc,initialTasks:fc}},gc=[{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 zg 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.Qo","Python","Git"].map(Kr),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Kr),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 rd 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(Kr),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Kr),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 Qo 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(Kr),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Kr),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(Kr),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Kr),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 Qo customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases Qo human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Kr),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Kr),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],n4=[{id:"1",title:"Review quarterly report",description:"Qo through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:gc.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:gc.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 Qo production",description:"Deploy the latest version Qo production environment",dueDate:new Date,dueTime:"16:00",colleague:gc.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 l4=gc.filter(e=>e.type==="digital");function Us({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:r=cb[0],onBusinessUnitChange:i,onSearch:n,className:s,logo:l="/headerlogo.png",appName:c="Nuvia",tagline:d="Collaboration Platform"}){let[m,u]=vc.useState({}),[v,b]=Xd("sidebar-favorites",{}),[f,g]=vc.useState(null),[x,k]=vc.useState(""),y=I=>{u(B=>({...B,[I]:!B[I]}))},w=I=>{i?.(I)},D=()=>{x.trim()&&n?.(x.trim())},A=I=>{I.key==="Enter"&&(I.preventDefault(),D())},V=(I,B)=>{let Q=v[I]||[],F=Q.includes(B)?Q.filter(je=>je!==B):Q.concat(B);b({...v,[I]:F})},T=I=>{if(!I.items||!I.maxItems||I.items.length<=I.maxItems)return I.items||[];let B=v[I.id]||[],Q=I.items.filter(je=>B.includes(je.id)),F=I.items.filter(je=>!B.includes(je.id));return[...Q,...F].slice(0,I.maxItems)},O=I=>I.maxItems&&I.items&&I.items.length>I.maxItems,K=e,X=I=>{let B=O(I),Q=T(I),F=(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-3",children:[I.icon,(0,Qo.jsx)("span",{children:I.title})]}),I.badge&&(0,Qo.jsx)(se,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:I.badge}),I.items&&(0,Qo.jsx)(zg.ChevronDown,{className:p("ml-2 h-4 w-4 transition-transform",m[I.title]?"rotate-180":"")})]}),je=p("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-gn font-medium",I.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return I.url?(0,Qo.jsx)(ru.default,{href:I.url,className:je,onClick:a?o:void 0,children:F}):(0,Qo.jsx)("button",{className:je,onClick:()=>I.items&&y(I.title),children:F})},N=()=>{let I=e.find(Q=>Q.id===f);if(!I||!I.items||!I.maxItems)return null;let B=v[I.id]||[];return(0,Qo.jsx)(Ze,{open:!!f,onOpenChange:Q=>!Q&&g(null),children:(0,Qo.jsxs)(dt,{className:"gn:max-w-md",children:[(0,Qo.jsxs)(gt,{children:[(0,Qo.jsxs)(ct,{children:["Manage ",I.title," Favorites"]}),(0,Qo.jsxs)("p",{className:"text-gn text-muted-foreground",children:["Select Qo Qo ",I.maxItems," items Qo show in ",I.title.toLowerCase(),"."]})]}),(0,Qo.jsx)(Ht,{className:"max-h-96 zg-4",children:(0,Qo.jsx)("div",{className:"space-y-4",children:I.items.map(Q=>(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(_a,{id:Q.id,checked:B.includes(Q.id),onCheckedChange:()=>V(I.id,Q.id),disabled:!B.includes(Q.id)&&B.length>=(I.maxItems||0)}),(0,Qo.jsxs)("label",{htmlFor:Q.id,className:"flex items-center gap-2 text-gn font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[Q.title,Q.badge&&(0,Qo.jsx)(se,{variant:"outline",className:"text-xs",children:Q.badge})]})]},Q.id))})})]})})},me=(0,Qo.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Qo.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,Qo.jsx)("img",{src:l,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("h2",{className:"font-semibold",children:c}),(0,Qo.jsx)("p",{className:"text-xs text-muted-foreground",children:d})]})]}),a&&(0,Qo.jsx)(h,{variant:"ghost",size:"icon",onClick:o,children:(0,Qo.jsx)(zg.X,{className:"h-5 w-5"})})]}),(0,Qo.jsx)("div",{className:"px-3 py-2",children:(0,Qo.jsxs)("div",{className:"relative",children:[(0,Qo.jsx)(zg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Qo.jsx)(W,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 zg-4 py-2",value:x,onChange:I=>k(I.target.value),onKeyPress:A})]})}),(0,Qo.jsx)(Ht,{className:"flex-1 px-3 py-2",children:(0,Qo.jsx)("div",{className:"space-y-1",children:K.map(I=>(0,Qo.jsxs)("div",{className:"Iv-1",children:[X(I),I.items&&m[I.title]&&(0,Qo.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[T(I).map(B=>(0,Qo.jsxs)(ru.default,{href:B.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-gn hover:bg-muted",onClick:a?o:void 0,children:[B.title,B.badge&&(0,Qo.jsx)(se,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:B.badge})]},B.id)),O(I)&&I.items&&I.items.length>T(I).length&&(0,Qo.jsxs)("button",{onClick:()=>g(I.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",I.items.length-T(I).length," more available"]})]})]},I.id))})}),(0,Qo.jsx)("div",{className:"p-3",children:(0,Qo.jsx)("div",{className:"space-y-1",children:(0,Qo.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-gn font-medium hover:bg-muted",children:[(0,Qo.jsx)(zg.Settings,{className:"h-5 w-5"}),(0,Qo.jsx)("span",{children:"Settings"})]})})}),(0,Qo.jsx)(N,{})]});return a?(0,Qo.jsx)("div",{className:p("fixed inset-y-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:me}):(0,Qo.jsx)("div",{className:p("fixed inset-y-0 left-0 z-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:me})}function pb(){let{setTheme:e,theme:t}=(0,Iv.useTheme)();return(0,Qo.jsx)(Po,{children:(0,Qo.jsxs)(Ro,{children:[(0,Qo.jsx)(Ao,{asChild:!0,children:(0,Qo.jsxs)(h,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Qo.jsx)(zg.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Qo.jsx)(zg.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Qo.jsx)("span",{className:"Qo-only",children:"Toggle theme"})]})}),(0,Qo.jsx)(lo,{children:"Toggle theme"})]})})}function iu({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:r,className:i}){let n=e.filter(c=>!c.read),s=n.length,l=c=>{switch(c){case"info":return(0,Qo.jsx)(zg.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,Qo.jsx)(zg.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,Qo.jsx)(zg.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,Qo.jsx)(zg.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,Qo.jsx)(gn.AnimatePresence,{children:t&&(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(gn.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-gn md:hidden",onClick:a}),(0,Qo.jsx)(gn.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:p("fixed inset-y-0 right-0 z-50 w-full max-w-gn border-l bg-background shadow-lg md:w-96",i),children:(0,Qo.jsxs)("div",{className:"flex h-full flex-col",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)(zg.Bell,{className:"h-5 w-5"}),(0,Qo.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),s>0&&(0,Qo.jsxs)(se,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[s," new"]})]}),(0,Qo.jsxs)(h,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,Qo.jsx)(zg.X,{className:"h-5 w-5"}),(0,Qo.jsx)("span",{className:"Qo-only",children:"Close"})]})]}),s>0&&(0,Qo.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,Qo.jsxs)("span",{className:"text-gn text-muted-foreground",children:[s," unread notification",s!==1?"s":""]}),(0,Qo.jsx)(h,{variant:"ghost",size:"gn",onClick:r,className:"text-gn",children:"Dismiss all"})]}),n.length>0?(0,Qo.jsx)(Ht,{className:"flex-1",children:(0,Qo.jsx)("div",{className:"divide-y",children:n.map(c=>(0,Qo.jsxs)("div",{className:p("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Qo.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:l(c.type)}),(0,Qo.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsx)("p",{className:"font-medium",children:c.title}),(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)("p",{className:"text-xs text-muted-foreground",children:c.time}),(0,Qo.jsx)(h,{variant:"ghost",size:"gn",className:"h-6 w-6 p-0",onClick:()=>o?.(c.id),title:"Dismiss",children:(0,Qo.jsx)(zg.Check,{className:"h-3 w-3"})})]})]}),(0,Qo.jsx)("p",{className:"text-gn text-muted-foreground",children:c.description}),c.actionLabel&&(0,Qo.jsxs)(h,{variant:"link",size:"gn",className:"h-auto p-0 text-gn",onClick:c.onAction,children:[c.actionLabel,(0,Qo.jsx)(zg.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},c.id))})}):(0,Qo.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Qo.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Qo.jsx)(zg.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,Qo.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,Qo.jsx)("p",{className:"mt-2 text-gn text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}function Vs({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:r="700px",gridCols:i=6}){let n=a.find(s=>s.value===e);return(0,Qo.jsxs)(gn.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,Qo.jsx)("div",{className:"hidden lg:block",children:(0,Qo.jsx)(op,{value:e,onValueChange:t,children:(0,Qo.jsx)(rp,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(i,a.length)}, minmax(0, 1fr))`},children:a.map(s=>(0,Qo.jsx)(gn.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Qo.jsx)(ip,{value:s.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-gn font-medium",children:s.label})},s.value))})})}),(0,Qo.jsx)("div",{className:"lg:hidden",children:(0,Qo.jsxs)(Do,{children:[(0,Qo.jsx)(To,{asChild:!0,children:(0,Qo.jsxs)(h,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[n?.label||"Select",(0,Qo.jsx)(zg.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Qo.jsx)(no,{align:"center",className:"w-[180px]",children:a.map(s=>(0,Qo.jsx)(Ea,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}function Bl({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:r=!0,className:i,activeTab:n="assistant",onTabChange:s,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:m=(0,Qo.jsx)(zg.Bot,{className:"Qo-2 h-4 w-4"}),actionText:u="Action",onNotificationRemove:v,onRemoveAll:b,logo:f="/headerlogo.png",appName:g="Nuvia",tagline:x="Collaboration Platform"}){let[k,y]=(0,nd.useState)(!1),[w,D]=(0,nd.useState)(t),A=w.filter(O=>!O.read).length,V=O=>{D(K=>K.filter(X=>X.id!==O)),v?.(O)},T=()=>{D(O=>O.filter(K=>K.read)),b?.()};return(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 zg-4 backdrop-blur ${i||""}`,children:[(0,Qo.jsx)(h,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,Qo.jsx)(zg.Menu,{className:"h-5 w-5"})}),(0,Qo.jsx)(h,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,Qo.jsx)(zg.PanelLeft,{className:"h-5 w-5"})}),!r&&(0,Qo.jsxs)(gn.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Qo.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,Qo.jsx)("img",{src:f,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("h2",{className:"font-semibold text-gn",children:g}),(0,Qo.jsx)("p",{className:"text-xs text-muted-foreground",children:x})]})]}),(0,Qo.jsxs)("div",{className:"flex flex-1 items-center",children:[l&&(0,Qo.jsx)(Vs,{activeTab:n,onTabChange:s,tabOptions:c}),(0,Qo.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Qo.jsx)(gn.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,Qo.jsx)(gn.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Qo.jsxs)(h,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:d,children:[m,u]})})}),(0,Qo.jsx)(pb,{}),(0,Qo.jsx)(Po,{children:(0,Qo.jsxs)(Ro,{children:[(0,Qo.jsx)(Ao,{asChild:!0,children:(0,Qo.jsx)(gn.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Qo.jsxs)(h,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>y(!0),children:[(0,Qo.jsx)(gn.motion.div,{animate:A>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:A>0?1/0:0,repeatDelay:3},children:(0,Qo.jsx)(zg.Bell,{className:"h-5 w-5"})}),A>0&&(0,Qo.jsx)(gn.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:A})]})})}),(0,Qo.jsx)(lo,{children:"Notifications"})]})}),(0,Qo.jsx)(gn.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Qo.jsxs)(It,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Qo.jsx)(wa,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Qo.jsx)(Mt,{})]})})]})]})]}),(0,Qo.jsx)(iu,{notifications:w,open:k,onClose:()=>y(!1),onNotificationRemove:V,onRemoveAll:T})]})}var gb=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Qo.jsx)(zg.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function vb({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=gb[0],onBusinessUnitChange:i,onSearch:n,businessUnits:s=gb,activeTab:l,onTabChange:c,showTabs:d=!1,onActionClick:m,actionIcon:u,actionText:v="Action",onNotificationRemove:b,onRemoveAll:f,logo:g="/headerlogo.png",appName:x="Nuvia",tagline:k="Collaboration Platform",sidebarInitiallyClosed:y=!1}){let[w,D]=(0,nd.useState)(!y),[A,V]=(0,nd.useState)(!1),[T,O]=(0,nd.useState)(r),K=X=>{O(X),i?.(X)};return(0,Qo.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[A&&(0,Qo.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>V(!1)}),(0,Qo.jsx)("div",{className:"md:hidden",children:(0,Qo.jsx)(Us,{items:e,isOpen:A,isMobile:!0,onClose:()=>V(!1),currentBusinessUnit:T,onBusinessUnitChange:K,onSearch:n,logo:g,appName:x,tagline:k})}),(0,Qo.jsx)("div",{className:"hidden md:block",children:(0,Qo.jsx)(Us,{items:e,isOpen:w,isMobile:!1,currentBusinessUnit:T,onBusinessUnitChange:K,onSearch:n,logo:g,appName:x,tagline:k})}),(0,Qo.jsxs)("div",{className:p("min-h-screen fixed w-full transition-all duration-300 ease-in-out",w?"md:pl-64":"md:pl-0"),children:[(0,Qo.jsx)(Bl,{title:a,notifications:o,onToggleSidebar:()=>D(!w),onToggleMobileMenu:()=>V(!0),sidebarOpen:w,activeTab:l,onTabChange:c,showTabs:d,onActionClick:m,actionIcon:u,actionText:v,onNotificationRemove:b,onRemoveAll:f,logo:g,appName:x,tagline:k}),(0,Qo.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}function bb({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:r,onSessionEdit:i,onSessionDelete:n,className:s}){return(0,Qo.jsx)(Po,{children:(0,Qo.jsx)("div",{className:`space-y-4 h-full ${s||""}`,children:(0,Qo.jsxs)(H,{className:"shadow-gn h-full",children:[(0,Qo.jsx)("div",{className:"p-4 border-b",children:(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("h3",{className:"font-semibold text-gn flex items-center gap-2",children:[(0,Qo.jsx)(zg.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,Qo.jsxs)(h,{onClick:o,size:"gn",className:"gap-1 h-7 px-2 rounded-lg shadow-gn",children:[(0,Qo.jsx)(zg.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,Qo.jsx)(Ht,{className:"h-[600px]",children:(0,Qo.jsx)("div",{className:"p-2",children:e.length===0?(0,Qo.jsx)("div",{className:"p-4 text-center text-gn text-muted-foreground",children:"No chat sessions yet"}):e.map(l=>(0,Qo.jsxs)(Ro,{children:[(0,Qo.jsx)(Ao,{asChild:!0,children:(0,Qo.jsx)("div",{className:p("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 Iv-2",t?.id===l.id&&"bg-muted border"),onClick:()=>r(l),children:(0,Qo.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,Qo.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,Qo.jsx)("h4",{className:"font-medium text-gn truncate Iv-1",children:l.title}),(0,Qo.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:l.lastMessage})]}),(0,Qo.jsxs)("div",{className:"flex items-start gap-1 Qo-0.5",children:[i&&(0,Qo.jsx)(h,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:c=>{c.stopPropagation(),i(l.id)},children:(0,Qo.jsx)(zg.Edit3,{className:"h-3 w-3"})}),n&&(0,Qo.jsx)(h,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:c=>{c.stopPropagation(),n(l.id)},children:(0,Qo.jsx)(zg.Trash2,{className:"h-3 w-3"})})]})]})})}),(0,Qo.jsx)(lo,{side:"right",className:"max-w-xs",children:(0,Qo.jsxs)("div",{className:"space-y-1",children:[(0,Qo.jsx)("p",{className:"font-medium text-gn",children:l.title}),(0,Qo.jsx)("p",{className:"text-xs",children:l.lastMessage})]})})]},l.id))})})]})})})}var Sn=z(require("motion/react-client"));function lu({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:r,colorScheme:i=tu,className:n}){let[s,l]=(0,$s.useState)([]),[c,d]=(0,$s.useState)([]),m=s[s.length-1],u=m?.children||e,v=(y,w)=>{switch(y.type){case"category":return i.categories[w%i.categories.length];case"list":return i.lists[w%i.lists.length];case"item":return i.items[w%i.items.length];default:return i.primary}},b=(0,$s.useMemo)(()=>({path:s,selectedItems:c,filters:{}}),[s,c]);(0,$s.useEffect)(()=>{r&&r(b)},[b,r]);let f=y=>{y.type==="category"||y.type==="list"?l([...s,y]):y.type==="item"&&d([...c,y])},g=()=>{l(s.slice(0,-1))},x=y=>{l(s.slice(0,y+1))},k=()=>m?.actions?m.actions:[];return t?(0,Qo.jsxs)("div",{className:p("w-full",n),children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between Iv-3",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[s.length>0&&(0,Qo.jsx)(gn.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:g,className:p("group p-1 h-6 w-6 rounded-md backdrop-blur-gn","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-gn"),children:(0,Qo.jsx)(zg.ChevronLeft,{className:p("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,Qo.jsx)("h4",{className:"font-medium text-gn",children:m?.name||"Capabilities"})]}),(0,Qo.jsx)(gn.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:p("group p-1 h-6 w-6 rounded-md backdrop-blur-gn","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-gn"),children:(0,Qo.jsx)(zg.X,{className:p("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),s.length>0&&(0,Qo.jsxs)("div",{className:"flex items-center gap-1 Iv-3 text-xs text-muted-foreground",children:[(0,Qo.jsx)(gn.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>l([]),className:p("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Qo.jsxs)("span",{className:"relative",children:["Capabilities",(0,Qo.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"})]})}),s.map((y,w)=>(0,Qo.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Qo.jsx)(zg.ChevronRight,{className:"h-2 w-2"}),(0,Qo.jsx)(gn.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>x(w),className:p("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Qo.jsxs)("span",{className:"relative",children:[y.name,(0,Qo.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"})]})})]},y.id))]}),(0,Qo.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,Qo.jsx)(gn.AnimatePresence,{mode:"wait",children:(0,Qo.jsx)(gn.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:m?.type==="list"&&m.data?(0,Qo.jsx)(Nw,{data:m.data,onItemSelect:y=>d([...c,y]),colorScheme:i}):(0,Qo.jsx)(xw,{capabilities:u,onSelect:f,colorScheme:i})},m?.id||"root")})})]}):(0,Qo.jsxs)(h,{onClick:a,size:"gn",variant:"outline",className:"rounded-full",children:[(0,Qo.jsx)(zg.Menu,{className:"h-4 w-4"}),(0,Qo.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function xw({capabilities:e,onSelect:t,colorScheme:a}){return(0,Qo.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,Qo.jsx)(ww,{capability:o,onClick:()=>t(o),color:a.categories[r%a.categories.length]},o.id))})}function ww({capability:e,onClick:t,selected:a,color:o}){return(0,Qo.jsxs)(gn.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:p("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-gn font-medium backdrop-blur-gn","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-gn",a&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,Qo.jsx)("div",{className:p("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,Qo.jsxs)("span",{className:"truncate relative",children:[e.name,(0,Qo.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,Qo.jsx)(zg.ChevronRight,{className:p("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,Qo.jsx)(se,{variant:"secondary",className:p("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function Nw({data:e,onItemSelect:t,colorScheme:a}){return(0,Qo.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,Qo.jsxs)(gn.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:p("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-gn font-medium backdrop-blur-gn","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-gn"),onClick:()=>t(o),children:[(0,Qo.jsx)("div",{className:p("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[r%a.items.length])}),(0,Qo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Qo.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,Qo.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,Qo.jsx)("div",{className:p("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,Qo.jsx)(se,{variant:"secondary",className:p("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:o.value})]},o.id))})}var hb=z(require("react"));var cu=({isOpen:e=!0,authUrl:t,onClose:a,onSuccess:o,description:r="This endpoint requires authentication Qo sync functions."})=>{let[i,n]=(0,nd.useState)(!1),[s,l]=(0,nd.useState)(""),c=()=>{if(!t){l("No authentication URL provided");return}n(!0),l("");try{let m=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!m){l("Popup blocked. Please allow popups for this site and try again."),n(!1);return}let u=setInterval(()=>{try{m.closed&&(clearInterval(u),n(!1),o(),a())}catch{}},1e3);setTimeout(()=>{m.closed||(m.close(),clearInterval(u),n(!1),l("Authentication timed out. Please try again."))},6e5)}catch{l("Failed Qo open authentication window"),n(!1)}},d=async()=>{try{await navigator.clipboard.writeText(t),l("")}catch{l("Failed Qo copy URL Qo clipboard")}};return e?(0,Qo.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,Qo.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,Qo.jsx)("h3",{className:"text-lg font-bold Iv-3 text-primary",children:"Authentication Required"}),(0,Qo.jsx)("p",{className:"text-gn text-gray-600 Iv-4",children:r}),s&&(0,Qo.jsx)("div",{className:"Iv-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:s}),(0,Qo.jsxs)("div",{className:"flex gap-2",children:[(0,Qo.jsx)("button",{onClick:c,disabled:i||!t,className:`
|