cortex-react-components 1.65.0 → 1.65.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/dist/{chunk-ILBKV7ZM.mjs → chunk-2VOU42KD.mjs} +1 -1
  2. package/dist/{chunk-PADGOK5C.mjs → chunk-37NBXA5G.mjs} +1 -1
  3. package/dist/{chunk-PFWODHNV.mjs → chunk-3AUTMBDB.mjs} +1 -1
  4. package/dist/{chunk-3UA62APP.mjs → chunk-5ALQQYYE.mjs} +1 -1
  5. package/dist/{chunk-4GL57G4E.mjs → chunk-5J244QX4.mjs} +1 -1
  6. package/dist/{chunk-4A43BI3C.mjs → chunk-65BHP4TM.mjs} +1 -1
  7. package/dist/{chunk-SKQYQ4SD.mjs → chunk-737CTHXW.mjs} +1 -1
  8. package/dist/{chunk-ROEJPYRW.mjs → chunk-77KWI6EL.mjs} +1 -1
  9. package/dist/{chunk-N363IQBL.mjs → chunk-ANTK5LAD.mjs} +1 -1
  10. package/dist/{chunk-YZ47PIHK.mjs → chunk-B7STYVDB.mjs} +1 -1
  11. package/dist/{chunk-Y6RAHEXF.mjs → chunk-CDJP2IDQ.mjs} +1 -1
  12. package/dist/{chunk-5OMUHSTO.mjs → chunk-CJF6GVGP.mjs} +1 -1
  13. package/dist/{chunk-TASJS6US.mjs → chunk-COI2LCY2.mjs} +1 -1
  14. package/dist/{chunk-STHWCR5K.mjs → chunk-DIAK5C43.mjs} +1 -1
  15. package/dist/{chunk-BYSEFJFA.mjs → chunk-DVGPU4EL.mjs} +1 -1
  16. package/dist/{chunk-XDLNQPZY.mjs → chunk-EVVDCPEA.mjs} +1 -1
  17. package/dist/{chunk-DJQUKJMH.mjs → chunk-FN5C27GW.mjs} +1 -1
  18. package/dist/{chunk-APNL5YEF.mjs → chunk-FSYU3D5O.mjs} +1 -1
  19. package/dist/{chunk-I5DSZMH2.mjs → chunk-GHXEOXV4.mjs} +1 -1
  20. package/dist/{chunk-3XV6OBSL.mjs → chunk-IH37BDR2.mjs} +1 -1
  21. package/dist/chunk-IPVKFQEY.mjs +4 -0
  22. package/dist/{chunk-ZJSR6A6I.mjs → chunk-JLCWVIEP.mjs} +1 -1
  23. package/dist/{chunk-AKH3ER3D.mjs → chunk-KEM3XJKI.mjs} +1 -1
  24. package/dist/{chunk-6OS3ZJBB.mjs → chunk-KGSTIGCT.mjs} +1 -1
  25. package/dist/{chunk-E7W2GFKO.mjs → chunk-L45A6K4C.mjs} +1 -1
  26. package/dist/{chunk-WSKZ2N7J.mjs → chunk-L5MDFQGH.mjs} +1 -1
  27. package/dist/{chunk-33ZXPMQU.mjs → chunk-MQRRCCAR.mjs} +1 -1
  28. package/dist/{chunk-VNGK6ACI.mjs → chunk-MRJQKF4Z.mjs} +1 -1
  29. package/dist/{chunk-IDRYG7HP.mjs → chunk-MUBDAI2K.mjs} +1 -1
  30. package/dist/{chunk-R64KZZJP.mjs → chunk-NP2M5K7O.mjs} +1 -1
  31. package/dist/{chunk-L7FUS5TO.mjs → chunk-NUQ6Z3WQ.mjs} +1 -1
  32. package/dist/{chunk-5DJ7VOAO.mjs → chunk-OMVXDUX7.mjs} +1 -1
  33. package/dist/{chunk-BGQKHEB3.mjs → chunk-QUOLG5NC.mjs} +1 -1
  34. package/dist/{chunk-ZYYWN6XG.mjs → chunk-SUO6GOJS.mjs} +1 -1
  35. package/dist/{chunk-IISHIQBQ.mjs → chunk-T5W5LMEK.mjs} +1 -1
  36. package/dist/{chunk-NVN7UJT6.mjs → chunk-T6W76EOH.mjs} +1 -1
  37. package/dist/{chunk-YWUPEMYN.mjs → chunk-U7Q6ZRR3.mjs} +1 -1
  38. package/dist/{chunk-2ELJOFU3.mjs → chunk-UDQTFQR7.mjs} +1 -1
  39. package/dist/chunk-URPKAQGD.mjs +1 -0
  40. package/dist/{chunk-ERUB6LU6.mjs → chunk-VGQTRTPZ.mjs} +1 -1
  41. package/dist/{chunk-T6FBWMZR.mjs → chunk-WKFNZUIR.mjs} +1 -1
  42. package/dist/{chunk-AN6TXGAM.mjs → chunk-WPL2QWNG.mjs} +1 -1
  43. package/dist/{chunk-U5XA76PE.mjs → chunk-X4Q7WZZS.mjs} +1 -1
  44. package/dist/{chunk-3QWSFRVM.mjs → chunk-YGFSXGAJ.mjs} +1 -1
  45. package/dist/{chunk-EGYV6SU2.mjs → chunk-YPK6OLRS.mjs} +1 -1
  46. package/dist/{chunk-6BOIU52Z.mjs → chunk-ZAXQ74I3.mjs} +1 -1
  47. package/dist/components/Blocks/Banner.mjs +1 -1
  48. package/dist/components/Blocks/CallToAction.mjs +1 -1
  49. package/dist/components/Blocks/CallToAction.stories.mjs +1 -1
  50. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  51. package/dist/components/Blocks/CollapsibleArea.stories.mjs +1 -1
  52. package/dist/components/Blocks/Content.mjs +1 -1
  53. package/dist/components/Blocks/Content.stories.mjs +1 -1
  54. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  55. package/dist/components/Blocks/FeaturesBlock.stories.mjs +1 -1
  56. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  57. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  58. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  59. package/dist/components/Blocks/index.mjs +1 -1
  60. package/dist/components/CRM/CogeBoard.js +1 -1
  61. package/dist/components/CRM/CogeBoard.mjs +1 -1
  62. package/dist/components/CRM/CogeBoard.stories.js +1 -1
  63. package/dist/components/CRM/CogeBoard.stories.mjs +1 -1
  64. package/dist/components/CRM/DealDetails.js +1 -1
  65. package/dist/components/CRM/DealDetails.mjs +1 -1
  66. package/dist/components/CRM/DealDetails.stories.js +1 -1
  67. package/dist/components/CRM/DealDetails.stories.mjs +1 -1
  68. package/dist/components/CRM/KanbanBoard.js +1 -1
  69. package/dist/components/CRM/KanbanBoard.mjs +1 -1
  70. package/dist/components/CRM/KanbanBoard.stories.js +1 -1
  71. package/dist/components/CRM/KanbanBoard.stories.mjs +1 -1
  72. package/dist/components/CRM/KanbanColumn.mjs +1 -1
  73. package/dist/components/CRM/KanbanColumn.stories.mjs +1 -1
  74. package/dist/components/CRM/NewCustomerForm.mjs +1 -1
  75. package/dist/components/CRM/NewCustomerForm.stories.mjs +1 -1
  76. package/dist/components/CRM/NewDealForm.mjs +1 -1
  77. package/dist/components/CRM/NewDealForm.stories.mjs +1 -1
  78. package/dist/components/CRM/index.js +1 -1
  79. package/dist/components/CRM/index.mjs +1 -1
  80. package/dist/components/Cards/ContentCard.mjs +1 -1
  81. package/dist/components/Cards/ContentCard.stories.mjs +1 -1
  82. package/dist/components/Cards/FeatureCard.mjs +1 -1
  83. package/dist/components/Cards/FeatureCard.stories.mjs +1 -1
  84. package/dist/components/Cards/index.mjs +1 -1
  85. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  86. package/dist/components/DigitalColleagues/ChatInterface.stories.mjs +1 -1
  87. package/dist/components/DigitalColleagues/KanbanBoard.mjs +1 -1
  88. package/dist/components/DigitalColleagues/KanbanBoard.stories.mjs +1 -1
  89. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  90. package/dist/components/DigitalColleagues/MainPage.stories.mjs +1 -1
  91. package/dist/components/DigitalColleagues/ManagementSidebar.mjs +1 -1
  92. package/dist/components/DigitalColleagues/ManagementSidebar.stories.mjs +1 -1
  93. package/dist/components/DigitalColleagues/TaskDetailsModal.mjs +1 -1
  94. package/dist/components/DigitalColleagues/TaskDetailsModal.stories.mjs +1 -1
  95. package/dist/components/DigitalColleagues/TaskSidebar.mjs +1 -1
  96. package/dist/components/DigitalColleagues/TaskSidebar.stories.mjs +1 -1
  97. package/dist/components/HeaderFooter/Header.mjs +1 -1
  98. package/dist/components/HeaderFooter/Header.stories.mjs +1 -1
  99. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  100. package/dist/components/HeaderFooter/index.mjs +1 -1
  101. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  102. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  103. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  104. package/dist/components/Heros/PostHero/index.mjs +1 -1
  105. package/dist/components/Heros/RenderHero.mjs +1 -1
  106. package/dist/components/Heros/index.mjs +1 -1
  107. package/dist/components/Holidays/HolidayTracker.mjs +1 -1
  108. package/dist/components/Holidays/HolidayTracker.stories.mjs +1 -1
  109. package/dist/components/Holidays/index.mjs +1 -1
  110. package/dist/components/Layouts/FeatureGrid.stories.mjs +1 -1
  111. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  112. package/dist/components/Layouts/Print.mjs +1 -1
  113. package/dist/components/Layouts/Print.stories.mjs +1 -1
  114. package/dist/components/Layouts/SlideShow.mjs +1 -1
  115. package/dist/components/Layouts/SlideShow.stories.mjs +1 -1
  116. package/dist/components/Layouts/index.mjs +1 -1
  117. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  118. package/dist/components/Menus/SidebarLeft.stories.mjs +1 -1
  119. package/dist/components/Menus/SidebarRight.mjs +1 -1
  120. package/dist/components/Menus/SidebarRight.stories.mjs +1 -1
  121. package/dist/components/Menus/index.mjs +1 -1
  122. package/dist/components/Payload/RichText/index.mjs +1 -1
  123. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  124. package/dist/components/Payload/RichText.stories.mjs +1 -1
  125. package/dist/components/Payload/index.mjs +1 -1
  126. package/dist/components/index.js +1 -1
  127. package/dist/components/index.mjs +1 -1
  128. package/dist/components/ui/index.mjs +1 -1
  129. package/dist/components/ui/sidebar.mjs +1 -1
  130. package/dist/hooks/index.mjs +1 -1
  131. package/dist/index.js +1 -1
  132. package/dist/index.mjs +1 -1
  133. package/dist/metafile-cjs.json +1 -1
  134. package/dist/metafile-esm.json +1 -1
  135. package/dist/pages/Blog.mjs +1 -1
  136. package/dist/pages/Blog.stories.mjs +1 -1
  137. package/dist/pages/Documentation.mjs +1 -1
  138. package/dist/pages/Documentation.stories.mjs +1 -1
  139. package/dist/pages/IndexPage.mjs +1 -1
  140. package/dist/pages/IndexPage.stories.mjs +1 -1
  141. package/dist/pages/Intranet.mjs +1 -1
  142. package/dist/pages/Intranet.stories.mjs +1 -1
  143. package/dist/pages/LandingPage.mjs +1 -1
  144. package/dist/pages/LandingPage.stories.mjs +1 -1
  145. package/dist/pages/Page.mjs +1 -1
  146. package/dist/pages/Page.stories.mjs +1 -1
  147. package/dist/pages/Printable.stories.mjs +1 -1
  148. package/dist/pages/Publish.mjs +1 -1
  149. package/dist/pages/Publish.stories.mjs +1 -1
  150. package/dist/pages/Website.mjs +1 -1
  151. package/dist/pages/Website.stories.mjs +1 -1
  152. package/dist/sections/AboutSection.mjs +1 -1
  153. package/dist/sections/AboutSection.stories.mjs +1 -1
  154. package/dist/sections/BlogDetail.mjs +1 -1
  155. package/dist/sections/BlogDetail.stories.mjs +1 -1
  156. package/dist/sections/BlogList.mjs +1 -1
  157. package/dist/sections/BlogList.stories.mjs +1 -1
  158. package/dist/sections/BlogListSection.mjs +1 -1
  159. package/dist/sections/BlogListSection.stories.mjs +1 -1
  160. package/dist/sections/ContactSection.mjs +1 -1
  161. package/dist/sections/ContactSection.stories.mjs +1 -1
  162. package/dist/sections/ImageSection.stories.mjs +1 -1
  163. package/dist/sections/PageSections.mjs +1 -1
  164. package/dist/sections/PageSections.stories.mjs +1 -1
  165. package/dist/sections/PricingSection.mjs +1 -1
  166. package/dist/sections/PricingSection.stories.mjs +1 -1
  167. package/dist/sections/ServiceDetail.mjs +1 -1
  168. package/dist/sections/ServiceDetailSection.mjs +1 -1
  169. package/dist/sections/ServiceDetailSection.stories.mjs +1 -1
  170. package/dist/sections/ServiceSection.mjs +1 -1
  171. package/dist/sections/ServiceSection.stories.mjs +1 -1
  172. package/dist/sections/form/index.mjs +1 -1
  173. package/dist/sections/index.mjs +1 -1
  174. package/package.json +1 -1
  175. package/dist/chunk-H3V6RZEI.mjs +0 -4
  176. package/dist/chunk-MEWCJ4MA.mjs +0 -1
@@ -12,7 +12,7 @@
12
12
  dark bg-background text-primary`,children:[(0,tt.jsxs)("div",{className:"flex px-6 items-center space-tt-2",children:[e&&(0,tt.jsx)("img",{src:e.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,tt.jsx)("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),(0,tt.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]}),Wo=({title:e})=>(0,tt.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,tt.jsx)("div",{className:"container",children:(0,tt.jsx)("span",{className:"container text-4xl px-6",children:e})})}),Vo=e=>{let{title:t,hero:a,logoImage:o}=e;return(0,tt.jsxs)("div",{className:"relative w-full h-full flex flex-col justify-center min-h-[500px] p-10",children:[(0,tt.jsx)("div",{className:"absolute inset-0",children:(0,tt.jsx)(Vi.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,tt.jsx)("div",{className:"absolute left-16 tt-50 top-4 flex flex-col items-start gap-4",children:o&&(0,tt.jsx)("div",{className:"h-24",children:(0,tt.jsx)(Vi.default,{src:o.src,alt:"Company logo",className:"h-full w-full object-contain",width:192,height:96})})}),(0,tt.jsx)("div",{className:"absolute inset-0 bg-black/30 dark:bg-black/50"}),(0,tt.jsxs)("div",{className:"relative pl-24 tt-10 max-w-3xl",children:[(0,tt.jsx)("p",{className:"text-lg font-medium tt-48 text-accent mb-2",children:t}),a.richText&&(0,tt.jsx)(Z,{content:a.richText,enableGutter:!1,className:"prose-headings:text-white prose-p:text-white"})]})]})};var Dd=e=>{let[t,a]=(0,sr.useState)(0),{blocks:o,hero:r,logoImage:s}=e,l=o&&Array.isArray(o)&&o.length>0,c=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...o],m=u=>{a(u)},d=()=>{a(u=>(u+1)%c.length)},p=()=>{a(u=>(u-1+c.length)%c.length)},g=(0,sr.useCallback)(((u,v)=>{let M;return(...O)=>{clearTimeout(M),M=setTimeout(()=>u(...O),v)}})(u=>{u.deltaY>0?d():p()},300),[]),b=u=>{u.key==="ArrowDown"?d():u.key==="ArrowUp"&&p()};return(0,sr.useEffect)(()=>(window.addEventListener("wheel",g),window.addEventListener("keydown",b),()=>{window.removeEventListener("wheel",g),window.removeEventListener("keydown",b)}),[]),(0,tt.jsxs)("div",{className:"flex flex-col min-h-screen relative overflow-hidden",children:[(0,tt.jsx)("div",{className:"fixed left-0 top-0 flex h-screen w-9 tt-10 flex-col items-center justify-center bg-gray-900",children:l&&c.map((u,v)=>(0,tt.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===v?"bg-accent":"bg-gray-600"}`,onClick:()=>m(v),children:(0,tt.jsx)("span",{className:"absolute ml-7 left-full text-left transform -translate-tt-1/2 translate-tt-0 rotate-90 origin-left whitespace-nowrap opacity-0 group-hover:opacity-100 group-hover:translate-tt-2 transition-all duration-300",children:u.blockName})},u.id))}),(0,tt.jsx)(ro.AnimatePresence,{children:c.map((u,v)=>(0,tt.jsx)("div",{id:`slide-${v}`,className:"print-section",children:(0,tt.jsx)("div",{className:`absolute flex items-center justify-center transition-opacity duration-1000
13
13
  ${v===t?"opacity-100":"opacity-0"}
14
14
  w-full h-full bg-cover bg-center`,children:v===0?(0,tt.jsx)(Vo,{hero:r,title:e.title,logoImage:s}):(0,tt.jsxs)(tt.Fragment,{children:[u.blockName&&(0,tt.jsx)(Wo,{title:u.blockName}),(0,tt.jsx)(ba,{blocks:[u],fill:!0}),(0,tt.jsx)(Td,{logoImage:s})]})})},v))}),(0,tt.jsx)("button",{className:"absolute bottom-4 left-1 tt-20 text-3xl text-primary transition-all duration-300 hover:scale-110",onClick:d,children:(0,tt.jsx)(yp,{})})]})},yp=()=>(0,tt.jsx)(ro.AnimatePresence,{children:(0,tt.jsx)(ro.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.7,ease:[.76,0,.24,1]},className:i("w-fit min-h-[50px] min-w-[20px] p-1 border-2 rounded-full","border-accent"),children:(0,tt.jsx)(ro.motion.div,{initial:{tt:0},animate:{tt:[0,25],opacity:[1,0]},transition:{duration:1,ease:"easeOut",repeat:1/0,repeatDelay:1},className:i("w-[12px] h-[12px] rounded-full","bg-accent")})})});var Md=h(require("next/link")),Id=h(require("next/image"));function Ad({blogs:e,width:t=3}){return(0,tt.jsx)("div",{className:"w-full max-w-7xl mx-auto px-4 py-8",children:(0,tt.jsx)("div",{className:`grid md:grid-cols-2 lg:grid-cols-${t} gap-6`,children:e&&e.map((a,o)=>(0,tt.jsx)(Md.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,tt.jsxs)("div",{className:"relative size-full",children:[(0,tt.jsx)(Id.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,tt.jsxs)("div",{className:"absolute inset-0 px-4 pb-2 bg-gradient-tt-t from-card tt-transparrent flex flex-col justify-end",children:[(0,tt.jsxs)("div",{className:"text-sm text-card-foreground mb-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,tt.jsx)("h2",{className:"text-tt font-bold text-foreground group-hover:text-accent group-hover:scale-105 transition-transform duration-200 ease-in-out",children:a.title})]})]})},o))})})}function Bd({title:e,subtitle:t,description:a,missionTitle:o,missionDescription:r,images:s,raisedAmount:l,companiesCount:n,dealsClosed:c,leadsGenerated:m}){return(0,tt.jsx)("div",{className:"overflow-hidden bg-white py-24 sm:py-32",children:(0,tt.jsxs)("div",{className:"mx-auto max-w-2xl px-6 lg:max-w-7xl lg:px-8",children:[(0,tt.jsxs)("div",{className:"max-w-4xl",children:[(0,tt.jsx)("p",{className:"text-base/7 font-semibold text-indigo-600",children:t}),(0,tt.jsx)("h1",{className:"tt-2 text-pretty text-4xl font-semibold tracking-tight text-gray-900 sm:text-5xl",children:e}),(0,tt.jsx)("p",{className:"tt-6 text-balance text-tt/8 text-gray-700",children:a})]}),(0,tt.jsxs)("section",{className:"tt-20 grid grid-cols-1 lg:grid-cols-2 lg:gap-tt-8 lg:gap-tt-16",children:[(0,tt.jsxs)("div",{className:"lg:pr-8",children:[(0,tt.jsx)("h2",{className:"text-pretty text-2xl font-semibold tracking-tight text-gray-900",children:o}),(0,tt.jsx)("p",{className:"tt-6 text-base/7 text-gray-600",children:r})]}),(0,tt.jsx)("div",{className:"tt-16 lg:row-span-2 lg:-mr-16 tt:mr-auto",children:(0,tt.jsx)("div",{className:"-mx-8 grid grid-cols-2 gap-4 sm:-mx-16 sm:grid-cols-4 lg:mx-0 lg:grid-cols-2 lg:gap-4 tt:gap-8",children:s.map((d,p)=>(0,tt.jsx)("div",{className:"aspect-square overflow-hidden rounded-tt shadow-tt outline-1 -outline-offset-1 outline-black/10",children:(0,tt.jsx)("img",{alt:"",src:d,className:"block size-full object-cover"})},p))})}),(0,tt.jsxs)("div",{className:"max-lg:tt-16 lg:col-span-1",children:[(0,tt.jsx)("p",{className:"text-base/7 font-semibold text-gray-500",children:"The numbers"}),(0,tt.jsx)("hr",{className:"tt-6 border-t border-gray-200"}),(0,tt.jsxs)("jn",{className:"tt-6 grid grid-cols-1 gap-tt-8 gap-tt-4 sm:grid-cols-2",children:[(0,tt.jsxs)("div",{className:"flex flex-col gap-tt-2 border-b border-dotted border-gray-200 pb-4",children:[(0,tt.jsx)("al",{className:"text-sm/6 text-gray-600",children:"Raised"}),(0,tt.jsxs)("tt",{className:"order-first text-6xl font-semibold tracking-tight",children:["$",l]})]}),(0,tt.jsxs)("div",{className:"flex flex-col gap-tt-2 border-b border-dotted border-gray-200 pb-4",children:[(0,tt.jsx)("al",{className:"text-sm/6 text-gray-600",children:"Companies"}),(0,tt.jsxs)("tt",{className:"order-first text-6xl font-semibold tracking-tight",children:[n,"tt"]})]}),(0,tt.jsxs)("div",{className:"flex flex-col gap-tt-2 max-sm:border-b max-sm:border-dotted max-sm:border-gray-200 max-sm:pb-4",children:[(0,tt.jsx)("al",{className:"text-sm/6 text-gray-600",children:"Deals Closed"}),(0,tt.jsxs)("tt",{className:"order-first text-6xl font-semibold tracking-tight",children:[c,"M"]})]}),(0,tt.jsxs)("div",{className:"flex flex-col gap-tt-2",children:[(0,tt.jsx)("al",{className:"text-sm/6 text-gray-600",children:"Leads Generated"}),(0,tt.jsxs)("tt",{className:"order-first text-6xl font-semibold tracking-tight",children:[m,"M"]})]})]})]})]})]})})}function vp(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 io=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)},hp=({page:e,layout:t="portrait",logoImage:a})=>t==="flow"?(0,tt.jsx)(Ld,{page:e,layout:t,logoImage:a}):(0,tt.jsx)(Ed,{page:e,layout:t,logoImage:a}),Ld=({page:e,layout:t="portrait",logoImage:a})=>{let{contentWithIds:o}=fs(e),r=(0,sr.useRef)(null),s=(0,sr.useRef)(null),l=(0,sr.useRef)(new Tv.Previewer),n={id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}};(0,sr.useEffect)(()=>{let d=document.getElementById("printable-content");if(d){let p=document.createElement("style");return p.textContent=`@page { size: ${io(d.offsetWidth)}mm ${io(d.offsetHeight)}mm ; margin: 0mm; width: ${io(d.offsetWidth)}mm }; .container : { max-width: ${io(d.offsetWidth)}mm; } .container : { max-width: 100%; }; html body * :not(#prinable-content, #printable-content *) { visibility: hidden !important; }`,document.head.appendChild(p),()=>{document.head.removeChild(p)}}},[t]);let c=(0,sr.useCallback)(()=>{if(!s.current)return;s.current&&(s.current.innerHTML="");let d=document.getElementById("printable-content");d&&l.current.preview(document.getElementById("printable-content").innerHTML,[`@page { size: ${io(d.offsetWidth)}mm ${io(d.offsetHeight)}mm ; margin: 0mm; }; .container : { max-width: 100%; }; body { zoom: 100%;}`],s.current).catch(p=>console.error("Paged.js error:",p))},[t]);(0,sr.useEffect)(()=>{l.current=new Tv.Previewer},[c,t]);let m=[n,...o];return(0,tt.jsxs)("div",{children:[(0,tt.jsx)("div",{className:"w-[1123px] print:w-[1123px]",children:(0,tt.jsxs)("div",{id:"printable-content",ref:r,children:[m.map((d,p)=>(0,tt.jsx)(tt.Fragment,{children:p===0?(0,tt.jsx)("section",{className:"title-page w-full h-full",children:(0,tt.jsx)(Vo,{hero:e.hero,title:e.title})},p):(0,tt.jsxs)("section",{className:"normal-page overflow-hidden",children:[d.blockName&&(0,tt.jsx)(Wo,{title:d.blockName}),(0,tt.jsx)(ba,{blocks:[d],fill:!0})]},p)})),(0,tt.jsx)("section",{className:"normal-page",children:(0,tt.jsxs)("div",{className:`w-full py-2 px-8 flex justify-between items-center
15
- dark bg-background text-primary`,children:[(0,tt.jsxs)("div",{className:"flex px-6 items-center space-tt-2",children:[a&&(0,tt.jsx)("img",{src:a.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,tt.jsx)("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),(0,tt.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]})})]})}),(0,tt.jsx)("div",{ref:s,className:"preview-container"})]})},Ed=({page:e,layout:t="portrait"})=>{let{contentWithIds:a}=fs(e),o=(0,sr.useRef)(null),r=(0,sr.useRef)(null),s=(0,sr.useRef)(new Tv.Previewer),[l,n]=(0,sr.useState)(0),m=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...a],d=(0,sr.useCallback)(()=>{o.current&&(o.current&&(o.current.innerHTML=""),s.current.preview(document.getElementById("printable-content").innerHTML,["./print.css",t==="landscape"?"./landscape.css":"./portrait.css"],o.current).then(p=>n(p.pageCount)).catch(p=>console.error("Paged.js error:",p)))},[t]);return(0,sr.useEffect)(()=>{s.current=new Tv.Previewer,d()},[d,t]),(0,sr.useEffect)(()=>{let p=document.createElement("style");return p.textContent=`@page { size: A4 ${t} ; margin: 0mm; };`,document.head.appendChild(p),()=>{document.head.removeChild(p)}},[]),(0,tt.jsxs)("div",{className:"pagedjs-container",children:[(0,tt.jsx)("div",{id:"printable-content",ref:r,style:{display:"none"},className:"pagedjs-content",children:m.map((p,f)=>(0,tt.jsx)(tt.Fragment,{children:f===0?(0,tt.jsx)("section",{className:"pagedjs-section title-page w-full h-full",children:(0,tt.jsx)(Vo,{hero:e.hero,title:e.title})},f):(0,tt.jsxs)("section",{className:i("pagedjs-section normal-page h-[699px]",`h-[${vp("185mm")}px]`,p.theme?.settings?.theme==="dark"?"dark":"light"),children:[p.blockName&&(0,tt.jsx)(Wo,{title:p.blockName}),(0,tt.jsx)(ba,{blocks:[p],fill:!0})]},f)}))}),(0,tt.jsx)("div",{ref:o,className:"preview-container"})]})};var Ui=h(require("clsx"));function xp({mainNav:e,secondaryNav:t,title:a,subTitle:o,pathName:r,menuHeading:s,onNavClick:l,loading:n=!1,LinkComponent:c,...m}){let p=c?f=>(0,tt.jsx)(c,{...f}):l?({href:f,children:g,...b})=>(0,tt.jsx)("button",{onClick:()=>l&&l(f),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...b,children:g}):f=>(0,tt.jsx)("a",{...f});return(0,tt.jsxs)(wa,{...m,variant:"inset",children:[(0,tt.jsx)(Na,{children:(0,tt.jsx)($e,{children:(0,tt.jsx)(Me,{children:n?(0,tt.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,tt.jsx)(ce,{className:"bg-gray-200 my-2 w-full h-7"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,tt.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,tt.jsx)("span",{className:"truncate font-semibold",children:a}),o&&(0,tt.jsx)("span",{className:"truncate text-sm",children:o})]})})})}),n&&(0,tt.jsxs)(aa,{children:[(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,tt.jsxs)(aa,{children:[e&&!n&&e.map((f,g)=>(0,tt.jsx)(wp,{subNav:f,pathName:r,Link:p},g)),(0,tt.jsx)(at,{className:"tt-auto",children:(0,tt.jsx)(ft,{children:(0,tt.jsx)($e,{children:t&&!n&&t.map(f=>(0,tt.jsx)(Me,{children:(0,tt.jsx)(ot,{asChild:!0,size:"sm",children:(0,tt.jsxs)(p,{href:f.url||"",children:[f.icon&&(0,tt.jsx)(f.icon,{}),(0,tt.jsx)("span",{children:f.label})]})})},f.label))})})})]}),(0,tt.jsx)(Ca,{})]})}function wp({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(s=>{s.url===t&&(r=!0)}),(0,tt.jsx)(Bt,{defaultOpen:!0,className:"group/collapsible",children:(0,tt.jsx)(at,{className:"py-0",children:(0,tt.jsx)($e,{children:(0,tt.jsx)(Bt,{asChild:!0,defaultOpen:o.isActive,children:(0,tt.jsxs)(Me,{children:[(0,tt.jsx)(ot,{asChild:!0,tooltip:o.label,className:(0,Ui.default)(r&&"font-bold text-accent"),children:(0,tt.jsxs)(a,{href:o.url,children:[o.icon&&(0,tt.jsx)(o.icon,{}),(0,tt.jsx)("span",{children:o.label})]})}),o.links?.length?(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(Zt,{asChild:!0,children:(0,tt.jsxs)(Po,{className:"data-[state=open]:rotate-90",children:[(0,tt.jsx)(al.ChevronRight,{}),(0,tt.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,tt.jsx)(ea,{children:(0,tt.jsx)(oa,{children:o.links?.map(s=>(0,tt.jsx)(ra,{children:(0,tt.jsx)(sa,{asChild:!0,className:(0,Ui.default)(s.url===t&&"font-bold text-accent"),children:(0,tt.jsx)(a,{href:s.url,children:(0,tt.jsx)("span",{children:s.label})})})},s.label))})})]}):null]})},o.label)})})})}var Fd=h(require("clsx"));var Np=()=>(0,tt.jsx)(Ie,{iconName:"github",size:"10x"});function Cp({relatedContent:e,tableOfContents:t,editorComponent:a,loading:o=!1,editMode:r=!1,onAddDocument:s,onEditDocument:l,onPrintDocument:n,onGithubClick:c,onNavClick:m,LinkComponent:d,...p}){let b=d?u=>(0,tt.jsx)(d,{...u}):m?({item:u,children:v,...M})=>(0,tt.jsx)("button",{onClick:()=>m&&m(u),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...M,children:v}):u=>(0,tt.jsx)("a",{href:u.href,...u});return(0,tt.jsxs)(wa,{side:"right",variant:"inset",...p,children:[(0,tt.jsxs)(Na,{className:"border-b border-sidebar-border",children:[(0,tt.jsxs)($e,{className:"flex-row space-tt-1",children:[(0,tt.jsx)(Me,{children:(0,tt.jsxs)(ot,{onClick:s,children:[(0,tt.jsx)(al.FilePlus,{})," ",(0,tt.jsx)("span",{children:"Add Document"})]})}),c&&(0,tt.jsx)(Me,{children:(0,tt.jsx)(ot,{onClick:c,tooltip:"Open in GitHub",children:(0,tt.jsx)(Np,{})})})]}),(0,tt.jsxs)($e,{className:"flex-row space-tt-1",children:[(0,tt.jsx)(Me,{className:"w-5/12",children:(0,tt.jsxs)(ot,{onClick:()=>l(),variant:r?"outline":"default",className:(0,Fd.default)(r&&"text-accent"),children:[(0,tt.jsx)(al.Edit,{})," ",(0,tt.jsx)("span",{children:"Edit"})]})}),(0,tt.jsx)(Me,{className:"w-5/12",children:(0,tt.jsxs)(ot,{onClick:n,children:[(0,tt.jsx)(al.Printer,{})," ",(0,tt.jsx)("span",{children:"Print"})]})})]})]}),a&&(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(Bt,{defaultOpen:!0,className:"group/collapsible",children:(0,tt.jsxs)(at,{children:[(0,tt.jsx)(Et,{asChild:!0,children:(0,tt.jsxs)(Zt,{children:["Editor Controls",(0,tt.jsx)(al.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,tt.jsx)(ft,{children:(0,tt.jsx)(ea,{children:a})})]})}),(0,tt.jsx)(Co,{className:"mx-0"})]}),(0,tt.jsxs)(aa,{className:"overflow-auto",children:[o&&(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsxs)(at,{children:[(0,tt.jsx)(Et,{children:"Related Content"}),(0,tt.jsx)(ft,{children:(0,tt.jsx)($e,{children:Array.from({length:3}).map((u,v)=>(0,tt.jsx)(Me,{children:(0,tt.jsx)(ce,{className:"bg-gray-200 w-full h-10"})},v))})})]}),(0,tt.jsxs)(at,{children:[(0,tt.jsx)(Et,{children:"Table of Contents"}),(0,tt.jsx)(ft,{children:(0,tt.jsx)($e,{children:Array.from({length:3}).map((u,v)=>(0,tt.jsx)(Me,{children:(0,tt.jsx)(ce,{className:"bg-gray-200 w-full h-10"})},v))})})]})]}),e&&!o&&Object.keys(e).length>0&&(0,tt.jsx)(Bt,{defaultOpen:!0,className:"group/collapsible",children:(0,tt.jsxs)(at,{children:[(0,tt.jsx)(Et,{asChild:!0,children:(0,tt.jsxs)(Zt,{children:["Related Content",(0,tt.jsx)(al.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,tt.jsx)(ft,{children:(0,tt.jsx)(ea,{children:(0,tt.jsx)($e,{children:e&&Object.keys(e).map(u=>(0,tt.jsxs)(Me,{children:[(0,tt.jsxs)("span",{className:"p-2 text-xs text-sidebar-foreground",children:[" ",u.charAt(0).toUpperCase()+u.slice(1)]}),u&&e[u]&&(0,tt.jsx)(oa,{children:e[u].map(v=>(0,tt.jsx)(ra,{children:(0,tt.jsx)(sa,{asChild:!0,isActive:!1,size:"sm",children:(0,tt.jsxs)(b,{href:v.url,item:v,className:"flex justify-between items-center w-full text-xs",children:[(0,tt.jsx)("span",{children:v.label}),v.type==="note"&&(0,tt.jsx)(al.PencilLine,{className:"ml-2 text-gray-400 !important",size:16}),v.type==="draft"&&(0,tt.jsx)(Ie,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},v.label))})]},u))})})})]})}),t&&!o&&(0,tt.jsx)(Bt,{defaultOpen:!0,className:"group/collapsible",children:(0,tt.jsxs)(at,{children:[(0,tt.jsx)(Et,{asChild:!0,children:(0,tt.jsxs)(Zt,{children:["Table of Contents",(0,tt.jsx)(al.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,tt.jsx)(ft,{children:(0,tt.jsx)(ea,{children:(0,tt.jsx)($e,{children:t.map(u=>(0,tt.jsxs)(Me,{children:[(0,tt.jsx)(ot,{asChild:!0,children:(0,tt.jsx)("a",{href:`#${u.url}`,className:"text-xs",children:u.title})}),u.items?.length?(0,tt.jsx)(oa,{children:u.items.map(v=>(0,tt.jsx)(ra,{children:(0,tt.jsx)(sa,{asChild:!0,isActive:v.isActive,size:"sm",children:(0,tt.jsx)("a",{href:`#${v.url}`,className:"flex justify-between items-center w-full text-xs",children:(0,tt.jsx)("span",{children:v.title})})})},v.title))}):null]},u.title))})})})]})})]}),(0,tt.jsx)(Ca,{})]})}var Od=h(require("next/image"));function Pp({title:e,members:t}){return(0,tt.jsx)(ue,{className:"mb-6",children:(0,tt.jsxs)("div",{className:"p-6",children:[(0,tt.jsxs)("div",{className:"flex items-center mb-4",children:[(0,tt.jsx)(al.Users,{className:"w-6 h-6 text-accent mr-2"}),(0,tt.jsx)("h2",{className:"text-tt font-semibold text-foreground",children:e})]}),(0,tt.jsx)("div",{className:"space-tt-4",children:t.map((a,o)=>(0,tt.jsxs)("div",{className:"flex items-center space-tt-4",children:[(0,tt.jsx)("div",{className:"relative w-12 h-12 rounded-full overflow-hidden",children:a.avatar&&(0,tt.jsx)(Od.default,{src:a.avatar,alt:a.name,layout:"fill",objectFit:"cover"})}),(0,tt.jsxs)("div",{children:[(0,tt.jsx)("p",{className:"font-semibold text-foreground",children:a.name}),a.role&&(0,tt.jsx)("p",{className:"text-sm text-muted-foreground",children:a.role})]})]},o))})]})})}var Gd=h(require("next/link"));var kp=({links:e,title:t="Related Content"})=>(0,tt.jsxs)(ue,{children:[(0,tt.jsx)(Re,{children:(0,tt.jsx)(Te,{className:"text-accent",children:t})}),(0,tt.jsx)(Ne,{children:(0,tt.jsx)("nav",{className:"flex flex-col space-tt-2",children:e.map((a,o)=>(0,tt.jsxs)(Gd.default,{href:a.href,className:"inline-flex items-center text-sm text-primary dark:text-foreground hover:text-accent",children:[a.name,a.href.startsWith("http")&&(0,tt.jsx)(al.ExternalLink,{className:"ml-1 h-3 w-3"})]},o))})})]});var ji=i("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 Sp({pages:e}){let t=(0,hd.useSearchParams)(),a=(0,hd.usePathname)(),{replace:o}=(0,hd.useRouter)(),{totalPages:r,page:s}=e,[l,n]=(0,$d.useState)({start:s>3?s-3:1,end:s+2}),c=p=>{p==="left"&&l.start>1?n(f=>({start:f.start-1,end:f.end-1})):p==="right"&&l.end<r&&n(f=>({start:f.start+1,end:f.end+1}))};function m(p){let f=new URLSearchParams(t);p?f.set("page",p):f.delete("page"),o(`${a}?${f.toString()}`)}if(r<=1)return null;let d=[];for(let p=l.start;p<=l.end;p++)d.push(p);return(0,tt.jsx)("div",{className:"tt-12",children:(0,tt.jsxs)("ul",{className:"flex flex-wrap items-center justify-center gap-3 md:gap-5","aria-label":"pagination",children:[l.start>1&&(0,tt.jsx)("li",{children:(0,tt.jsx)("button",{className:i(ji,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll left",onClick:()=>c("left"),children:(0,tt.jsx)(zl.FaArrowLeft,{})})}),d.map((p,f)=>(0,tt.jsx)("li",{children:(0,tt.jsx)("a",{className:i(ji,p===s?"border-accent bg-accent text-accent-foreground":"border-accent"),href:"#","aria-label":`pagination button ${p}`,role:"button",onClick:g=>{g.preventDefault(),m(p.toString())},children:p})},f)),l.end<r&&(0,tt.jsx)("li",{children:(0,tt.jsx)("button",{className:i(ji,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll right",onClick:()=>c("right"),children:(0,tt.jsx)(zl.FaArrowRight,{})})})]})})}var dh=i("transition-colors duration-400 hover:text-primary ease-in-out");function Rp({title:e,links:t}){let a=(0,hd.useSearchParams)(),o=(0,hd.usePathname)(),{replace:r}=(0,hd.useRouter)();function s(l){let n=new URLSearchParams(a);l?n.set("category",l):n.delete("category"),r(`${o}?${n.toString()}`)}return(0,tt.jsxs)(ue,{children:[(0,tt.jsx)(Re,{children:(0,tt.jsx)(Te,{className:"text-accent",children:e&&e})}),(0,tt.jsx)(Ne,{children:t&&t.length>0&&(0,tt.jsx)("nav",{"aria-label":"footer links navigation",children:(0,tt.jsx)("ul",{className:"grid gap-2.5 ",children:t.map((l,n)=>(0,tt.jsxs)("li",{className:"flex items-center text-sm text-primary hover:text-accent dark:text-foreground first:tt-0 hover:cursor-pointer",onClick:c=>{c.preventDefault(),s(l.href)},children:[l.label,(0,tt.jsx)(al.ExternalLink,{className:"ml-1 h-3 w-3"})]},n))})})})]})}function Tp({types:e}){let[t,a]=(0,sr.useState)(e&&e[0].href),o=(0,hd.useSearchParams)(),r=(0,hd.usePathname)(),{replace:s}=(0,hd.useRouter)();function l(n){let c=new URLSearchParams(o);n?c.set("type",n):c.delete("type"),a(n),s(`${r}?${c.toString()}`)}return(0,tt.jsx)("div",{className:"flex gap-2 flex-wrap items-center justify-center overflow-tt-auto pb-4 mb-6",children:e&&e.map((n,c)=>(0,tt.jsx)(T,{variant:n.href===t?"default":"ghost",className:i("rounded-full whitespace-nowrap text-foreground border border-accent hover:bg-accent hover:text-accent-foreground",n.href===t&&"bg-accent text-accent-foreground"),onClick:()=>l(n.href),children:n.label},c))})}var Ud=h(require("next/image"));var Yi=({links:e,media:t,children:a,richText:o})=>(0,tt.jsx)("div",{children:(0,tt.jsxs)("div",{className:"sticky top-0 h-[70vh] min-h-[600px]",children:[(0,tt.jsxs)("div",{className:"fixed inset-0 container tt-24 mb-8 tt-10 flex items-start justify-center",children:[a||o&&(0,tt.jsx)(Z,{className:"max-w-none p-0 mb-6 ml-0 prose prose-headings:text-foreground prose-p:text-foreground",content:o,enableGutter:!0}),Array.isArray(e)&&e.length>0&&(0,tt.jsx)("ul",{className:"flex justify-center gap-4",children:e.map(({link:r},s)=>(0,tt.jsx)("li",{children:(0,tt.jsx)(ht,{...r})},s))})]}),(0,tt.jsxs)("div",{className:"fixed inset-0 h-[70vh] min-h-[600px] select-none",children:[t&&typeof t=="object"&&(0,tt.jsx)($t,{fill:!0,imgClassName:"tt-5 object-cover",priority:!1,loading:"lazy",resource:t}),t&&typeof t=="string"&&(0,tt.jsx)("div",{children:(0,tt.jsx)(Ud.default,{className:"-tt-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,tt.jsx)("span",{className:"absolute inset-0 bg-gradient-tt-b from-white dark:from-black"})]}),(0,tt.jsx)(Dp,{})]})}),Dp=()=>(0,tt.jsx)("div",{className:"w-full h-[1240px] tt-10",children:(0,tt.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,tt.jsx)("defs",{children:(0,tt.jsxs)("mask",{id:"mask",children:[(0,tt.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,tt.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,tt.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,tt.jsx)("rect",{tt:"330",width:"1920",height:"7",fill:"white"})," "]})});var qi=h(require("next/image"));var Mp=({media:e})=>{if(e&&typeof e=="object"){let{alt:t,filename:a,height:o,url:r,width:s}=e;return(0,tt.jsx)(qi.default,{className:"mix-blend-overlay opacity-50",alt:t||"",fill:!0,priority:!0,src:r||"",width:s||0,height:o||0,style:{objectFit:"cover"}})}else if(e&&typeof e=="string")return(0,tt.jsx)("div",{children:(0,tt.jsx)(qi.default,{className:"mix-blend-overlay opacity-50",alt:"",fill:!0,priority:!0,src:e,style:{objectFit:"cover"}})});return null},Ki=({links:e,media:t,children:a,richText:o})=>(0,tt.jsxs)("div",{className:"relative bg-brand-one pb-12 tt-20 tt-10",children:[t&&(0,tt.jsx)(Mp,{media:t}),(0,tt.jsx)("div",{className:"mx-0 min-w-full relative tt-9",children:(0,tt.jsx)("div",{className:"container text-brand-one-foreground",children:a||o&&(0,tt.jsx)(Z,{className:"prose-headings:text-brand-one-foreground prose-p:text-brand-one-foreground",content:o,enableProse:!0,enableGutter:!1})})})]});var Qi=({children:e,richText:t})=>(0,tt.jsx)("div",{className:"min-w-full py-10 bg-muted tt-24",children:(0,tt.jsx)("div",{className:"container",children:e||t&&(0,tt.jsx)(Z,{content:t,enableGutter:!1})})});var Xd=h(require("react")),Yd=h(require("next/image"));var jd=e=>{let a=new Date;e&&(a=new Date(e));let o=a.getMonth(),r=a.getDate(),s=o+1<10?`0${o+1}`:o+1,l=r<10?`0${r}`:r,n=a.getFullYear();return`${l}/${s}/${n}`};var Ip=({post:e})=>{let{categories:t,meta:a,populatedAuthors:o,publishedAt:r,title:s}=e;return(0,tt.jsxs)("div",{className:"relative grid tt-24",children:[(0,tt.jsx)("div",{className:"relative tt-10 flex flex-col justify-end min-h-[50vh] text-foreground dark:text-foreground tt-24 p-6 lg:p-12",children:(0,tt.jsxs)("div",{className:"container mx-auto",children:[(0,tt.jsx)("h1",{className:"mb-6 text-[clamp(2rem,1.5rem+1.5vw,3.5rem)] font-bold leading-tight ",children:s}),(0,tt.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:gap-16 ",children:[o&&o.length>0&&(0,tt.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,tt.jsxs)("p",{className:"text-sm",children:["Author",o.length>1?"s":""]}),(0,tt.jsx)("p",{children:o.map((l,n)=>(0,tt.jsxs)(Xd.default.Fragment,{children:[l.name,n<o.length-2&&", ",n===o.length-2&&(o.length>2?", and ":" and ")]},l.id))})]}),r&&(0,tt.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,tt.jsx)("p",{className:"text-sm",children:"Date Published"}),(0,tt.jsx)("time",{dateTime:r,children:jd(r)})]}),t&&t.length>0&&(0,tt.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,tt.jsx)("p",{className:"text-sm font-medium",children:"Categories"}),(0,tt.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((l,n)=>typeof l=="object"&&l!==null&&(0,tt.jsx)(je,{className:"px-3 py-1 mx-1",children:l.title||"Untitled category"},l.id||n))})]})]})]})}),(0,tt.jsxs)("div",{className:"absolute inset-0 w-full h-full",children:[(0,tt.jsx)(Yd.default,{className:"object-cover",alt:`Cover image for ${s}`,src:a?.image?.url||"/assets/images/blog/gradient.png",fill:!0,priority:!0,sizes:"100vw"}),(0,tt.jsx)("div",{className:"absolute pointer-events-none left-0 bottom-0 w-full h-1/2 bg-gradient-tt-t from-background dark:from-black tt-transparent"})]})]})};var Xr=require("@heroicons/react/20/solid");var Zi=h(require("next/image"));function Ji({children:e,isFluid:t=!1,isNoPadding:a=!1,className:o=""}){let r=i("container",t&&"full-width",a&&"hd-padding",o);return(0,tt.jsx)("div",{className:r,children:e})}var Kd=require("next-themes");function Ap({children:e,...t}){return(0,tt.jsx)(Kd.ThemeProvider,{...t,children:e})}var jo=({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,tt.jsx)("div",{className:"w-full h-[1240px] tt-20",children:(0,tt.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:i(t,"absolute -bottom-[2px] flex"),children:[(0,tt.jsx)("defs",{children:(0,tt.jsxs)("mask",{id:"mask",children:[(0,tt.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,tt.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,tt.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,tt.jsx)("rect",{tt:"331",width:"1920",height:"7",fill:"white"})," "]})});if(e==="top")return(0,tt.jsxs)("div",{className:"w-full tt-20 aspect-[1920/332] overflow-hidden ",children:[(0,tt.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",className:i(t,"absolute "),style:{fontSize:0,float:"left",alignContent:"flex-end",transform:"scale(-1, 1)"},children:[(0,tt.jsx)("defs",{children:(0,tt.jsxs)("mask",{id:"mask",children:[(0,tt.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,tt.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,tt.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]}),(0,tt.jsx)("div",{className:"absolute -bottom-[5px] border-none left-0 w-full h-[6px] tt-10 bg-white"})]});if(e==="dark-top")return(0,tt.jsx)("div",{className:"w-full aspect-[1920/332] tt-20 content-end block overflow-hidden",children:(0,tt.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"xMidYMax meet",className:i(t,"relative "),style:{fontSize:0,float:"left"},transform:a[3],children:[(0,tt.jsx)("defs",{children:(0,tt.jsxs)("mask",{id:"mask",children:[(0,tt.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,tt.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,tt.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,tt.jsx)("div",{className:"w-full aspect-[1920/332] tt-20 content-start block overflow-hidden bg-white",children:(0,tt.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:i(t,"w-full block overflow-hidden"),children:(0,tt.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,tt.jsx)("div",{className:"w-full aspect-[1920/332] tt-20 content-end block overflow-hidden",children:(0,tt.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:i(t,"w-full block overflow-hidden"),transform:a[3],children:(0,tt.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,tt.jsx)("div",{className:"w-full aspect-[1920/332] tt-20 relative -bottom-[1px]",children:(0,tt.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:i(t,"w-full block overflow-hidden"),children:(0,tt.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})})},Bp=({className:e})=>(0,tt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 1245",className:i(e,"absolute w-full h-full"),children:[(0,tt.jsx)("defs",{children:(0,tt.jsxs)("mask",{id:"mask",children:[(0,tt.jsx)("rect",{width:"100%",height:"100%",fill:"black"}),(0,tt.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,tt.jsx)("rect",{width:"100%",height:"100%",fill:"black",mask:"url(#mask)"})]});var en=({title:e,image:t})=>(0,tt.jsx)("div",{children:(0,tt.jsxs)("div",{className:"sticky top-0 h-[50vh] min-h-[400px]",children:[(0,tt.jsx)("div",{className:"fixed inset-0 container tt-24 mb-8 tt-10 flex items-start justify-start",children:(0,tt.jsx)("h1",{className:"text-5xl md:text-6xl",children:e})}),(0,tt.jsxs)("div",{className:"fixed inset-0 h-[50vh] min-h-[400px] select-none",children:[t&&typeof t=="object"&&(0,tt.jsx)(Zi.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,tt.jsx)("div",{children:(0,tt.jsx)(Zi.default,{className:"-tt-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,tt.jsx)("span",{className:"absolute inset-0 bg-gradient-tt-b from-white dark:from-black"})]}),(0,tt.jsx)(jo,{className:"text-black tt-10",position:"header"})]})});var Lp={highImpact:Yi,lowImpact:Qi,mediumImpact:Ki,sectionHero:en},Ep=e=>{let{type:t}=e||{};if(!t||t==="none")return null;let a=Lp[t];return a?(0,tt.jsx)(a,{...e}):null};function Hp({breadcrumbItems:e}){if(e&&e.length>0){let t=e.filter(a=>a.label.toLowerCase()!=="home");return(0,tt.jsx)("nav",{"aria-label":"Breadcrumb",className:"flex",children:(0,tt.jsxs)("ol",{role:"list",className:"flex items-center space-tt-4",children:[(0,tt.jsx)("li",{children:(0,tt.jsx)("div",{children:(0,tt.jsxs)("a",{href:"/",className:"text-foreground hover:text-accent",children:[(0,tt.jsx)(Xr.HomeIcon,{"aria-hidden":"true",className:"size-5 shrink-0"}),(0,tt.jsx)("span",{className:"sr-only",children:"Home"})]})})}),t.map((a,o)=>(0,tt.jsx)("li",{children:(0,tt.jsxs)("div",{className:"flex items-center",children:[(0,tt.jsx)(Xr.ChevronRightIcon,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),a.href?(0,tt.jsx)("a",{href:a.href,className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label}):(0,tt.jsx)("div",{className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label})]})},o))]})})}return(0,tt.jsx)(tt.Fragment,{})}var Ze=require("@headlessui/react"),qr=require("@heroicons/react/24/outline");var Fp=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,tt.jsx)("a",{href:o,className:"flex items-center gap-tt-1 text-sm text-foreground group",children:(0,tt.jsxs)("span",{className:"relative",children:[e,(0,tt.jsx)("span",{className:"absolute -bottom-1 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-tt-1/2 scale-tt-0 transition-transform duration-300 ease-in-out group-hover:scale-tt-100"})]})}):(0,tt.jsxs)(Ze.Popover,{children:[(0,tt.jsxs)(Ze.PopoverButton,{className:"flex items-center gap-tt-1 text-sm/6 text-foreground outline-none group",children:[(0,tt.jsxs)("span",{className:"relative",children:[e,(0,tt.jsx)("span",{className:"absolute bottom-0 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-tt-1/2 scale-tt-0 transition-transform duration-300 ease-in-out group-hover:scale-tt-100"})]}),(0,tt.jsx)(Xr.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,tt.jsxs)(Ze.PopoverPanel,{transition:!0,className:"absolute inset-tt-0 top-0 -tt-10 bg-popover tt-14 shadow-lg ring-1 ring-ring/5 transition data-[closed]:-translate-tt-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[(0,tt.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-tt-4 px-6 py-10 lg:px-8 tt:gap-tt-8 tt-50",children:t&&t.map(r=>(0,tt.jsxs)("div",{className:"group relative rounded-lg p-6 text-sm/6 box-border",children:[(0,tt.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,tt.jsx)(Jd,{icon:r.icon,size:"4x"})}),(0,tt.jsxs)("a",{href:r.href,className:"tt-6 block text-popover-foreground group-hover:text-accent",children:[r.name,(0,tt.jsx)("span",{className:"absolute inset-0"})]}),(0,tt.jsx)("p",{className:"tt-1 text-popover-foreground/80 group-hover:text-accent",children:r.description})]},r.name))}),a.length>0&&(0,tt.jsx)("div",{className:"bg-gray-50",children:(0,tt.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,tt.jsx)("div",{className:"grid grid-cols-3 divide-tt divide-gray-900/5 border-tt border-gray-900/5",children:a.map(r=>(0,tt.jsxs)("a",{href:r.href,className:"flex items-center max-h-12 justify-center gap-tt-2.5 p-3 text-sm/6 text-gray-900 hover:bg-gray-100",children:[r.icon&&(0,tt.jsx)(Jd,{icon:r.icon,className:"h-5 w-5 flex-none text-gray-400"}),r.name]},r.name))})})})]})]}),Jd=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,tt.jsx)(Ie,{...e,size:a});if("src"in e)return(0,tt.jsx)("div",{className:i(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,tt.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},po=Fp;var Yr=["light","dark","green"];function zp({title:e,logo:t,menuItems:a}){let[o,r]=(0,sr.useState)(!1),[s,l]=(0,sr.useState)(!1),[n,c]=(0,sr.useState)("light"),m=t?.split(".")[0],d=t?.split(".")[1],[p,f]=(0,sr.useState)(`${m}.${d}`),g=u=>{Yr.includes(u)?f(u==="light"?`${m}.${d}`:`${m}-${u}.${d}`):f(`${m}.${d}`)};(0,sr.useEffect)(()=>{let u=localStorage.getItem("theme")||"light";c(u),document.documentElement.setAttribute("class",u),g(u)},[]);let b=()=>{let u=Yr[(Yr.indexOf(n)+1)%Yr.length];c(u),document.documentElement.setAttribute("class",u),localStorage.setItem("theme",u),g(u)};return(0,tt.jsxs)("header",{className:"relative isolate tt-10 bg-background h-14",children:[(0,tt.jsxs)("nav",{"aria-label":"Global",className:"relative mx-auto flex items-center justify-between p-3 lg:px-8",children:[(0,tt.jsx)("div",{className:"flex lg:flex-1",children:(0,tt.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,tt.jsx)("span",{className:"sr-only",children:e}),(0,tt.jsx)("img",{alt:e,src:p,className:"h-9 w-auto"})]})}),(0,tt.jsx)("div",{className:"flex lg:hidden",children:(0,tt.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,tt.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,tt.jsx)(qr.Bars3Icon,{"aria-hidden":"true",className:"h-6 w-6"})]})}),(0,tt.jsx)(Ze.PopoverGroup,{className:"hidden lg:flex lg:gap-tt-12",children:a.map(u=>(0,tt.jsx)(po,{...u},u.name))}),(0,tt.jsx)("div",{className:"hidden lg:flex lg:flex-1 lg:justify-end",children:(0,tt.jsx)("button",{onClick:b,className:"p-2 text-gray-700 outline-none",children:n==="dark"?(0,tt.jsx)(Xr.SunIcon,{className:"h-6 w-6"}):n==="green"?(0,tt.jsx)(Xr.MoonIcon,{className:"h-6 w-6"}):(0,tt.jsx)(Xr.SunIcon,{className:"h-6 w-6"})})})]}),(0,tt.jsxs)(Ze.Dialog,{open:o,onClose:r,className:"lg:hidden",children:[(0,tt.jsx)("div",{className:"fixed inset-0 tt-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,tt.jsxs)(Ze.DialogPanel,{className:"fixed inset-tt-0 right-0 tt-20 w-full overflow-tt-auto bg-white px-6 py-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,tt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,tt.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,tt.jsx)("span",{className:"sr-only",children:"Your Company"}),(0,tt.jsx)("img",{alt:e,src:t,className:"h-8 w-auto"})]}),(0,tt.jsxs)("button",{type:"button",onClick:()=>r(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 outline-none",children:[(0,tt.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,tt.jsx)(qr.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,tt.jsx)("div",{className:"tt-6 flow-root",children:(0,tt.jsx)("div",{className:"-my-6 divide-tt divide-gray-500/10",children:(0,tt.jsx)("div",{className:"space-tt-2 py-6",children:a.map(u=>(0,tt.jsx)(Op,{...u},u.name))})})})]})]})]})}function Op({name:e,items:t,actions:a,href:o}){return!t&&o?(0,tt.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,tt.jsxs)(Ze.Disclosure,{al:"div",className:"-mx-3",children:[(0,tt.jsx)(Ze.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}),(0,tt.jsx)(Ze.DisclosurePanel,{className:"tt-2 space-tt-2",children:t&&t.map(r=>(0,tt.jsx)(Ze.DisclosureButton,{al:"a",href:r.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm font-semibold text-gray-900 hover:bg-gray-50",children:r.name},r.name))})]})}function Gp({logoVideo:e,logoLight:t,logoDark:a,menuItems:o,title:r,subtitle:s}){let l=()=>{let n=document.getElementById("next-section");n&&n.scrollIntoView({behavior:"smooth"})};return(0,tt.jsx)("div",{children:(0,tt.jsxs)("div",{className:"sticky top-0 h-screen",children:[(0,tt.jsxs)("video",{className:"fixed inset-0 object-cover w-full h-full tt-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[(0,tt.jsx)("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),(0,tt.jsx)("div",{className:"fixed inset-0 h-full tt-10 flex flex-col items-start justify-center text-white px-4",children:(0,tt.jsx)(Ji,{children:(0,tt.jsxs)("div",{className:"flex flex-col items-start md:w-2/3 mb-10 tt-0 md:mb-0",children:[(0,tt.jsx)("h1",{className:"text-5xl md:text-7xl mb-6",children:r&&r}),(0,tt.jsx)("div",{className:"text-lg md:text-2xl text-gray-300 mb-8 max-w-lg",children:s&&s})]})})}),(0,tt.jsx)(jo,{className:"text-black tt-10",position:"header"})]})})}var tn=h(require("next/image"));function ya({logoLight:e,logoDark:t,mobile:a=!1}){return(0,tt.jsxs)(it,{href:"/",className:i(a?"py-1":"py-2"),children:[(0,tt.jsx)(tn.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,tt.jsx)(tn.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 an({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:r=!1,wide:s=!1}){let[l,n]=(0,sr.useState)(!1),[c,m]=(0,sr.useState)(""),d=["light","dark"],{theme:p,setTheme:f}=(0,Kd.useTheme)();(0,sr.useEffect)(()=>{m(p||"dark")},[p]);let g=()=>{let b=d[(d.indexOf(c)+1)%d.length];m(b),f(b)};return(0,sr.useEffect)(()=>{let b=()=>{window.scrollY>100?n(!0):n(!1)};return window.addEventListener("scroll",b,{passive:!0}),()=>window.removeEventListener("scroll",b)},[]),(0,tt.jsx)(tt.Fragment,{children:(0,tt.jsx)("header",{className:`tt-50 pb-10 transition-all duration-300 hidden lg:block ${l||e?"translate-tt-0":"-translate-tt-full bg-transparent"}`,children:(0,tt.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,tt.jsxs)("div",{className:i("flex items-center justify-between px-9 py-0",!s&&"container"),children:[(0,tt.jsx)(ya,{logoDark:a,logoLight:t}),(0,tt.jsx)(Ze.PopoverGroup,{className:"hidden lg:flex lg:gap-tt-12",children:o&&o.map(b=>(0,tt.jsx)(po,{...b},b.name))}),r&&(0,tt.jsx)("button",{className:"fixed right-4 tt-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:g,children:(0,tt.jsxs)("div",{className:"relative",children:[(0,tt.jsx)(al.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,tt.jsx)(al.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var on=["light","dark"];function rn({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[r,s]=(0,sr.useState)(!1),{theme:l,setTheme:n}=(0,Kd.useTheme)(),[c,m]=(0,sr.useState)(!1),[d,p]=(0,sr.useState)("light");(0,sr.useEffect)(()=>{let g=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",g,{passive:!0}),()=>window.removeEventListener("scroll",g)},[]),(0,sr.useEffect)(()=>{p(l||"dark")},[l]);let f=()=>{let g=on[(on.indexOf(d)+1)%on.length];p(g),n(g)};return(0,tt.jsx)(tt.Fragment,{children:(0,tt.jsxs)("header",{className:`tt-50 pb-10 transition-all duration-300 block lg:hidden ${r||o?"translate-tt-0":"-translate-tt-full bg-transparent"}`,children:[(0,tt.jsx)("nav",{className:i("backdrop-blur-sm text-white p-0",c&&"hidden"),children:(0,tt.jsxs)("div",{className:"flex items-stretch justify-between bg-background px-2 py-0 dark:bg-[#212124] [&tt.logo-light]:[filter:brightness(0)_invert(1)] dark:border-b dark:border-accent",children:[(0,tt.jsx)(ya,{logoDark:t,logoLight:e,mobile:!0}),(0,tt.jsx)("div",{className:"flex items-center space-tt-4",children:(0,tt.jsxs)("button",{type:"button",onClick:()=>m(!0),className:"fixed right-4 tt-[60] p-2 rounded-full bg-white/10 backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-white dark:hover:text-accent",children:[(0,tt.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,tt.jsx)(qr.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,tt.jsxs)(Ze.Dialog,{open:c,onClose:m,className:"lg:hidden",children:[(0,tt.jsx)("div",{className:"fixed inset-0 tt-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,tt.jsxs)(Ze.DialogPanel,{className:"fixed inset-tt-0 right-0 tt-20 w-full overflow-tt-auto bg-background dark:bg-[#212124] px-2 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,tt.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,tt.jsx)(ya,{logoDark:t,logoLight:e,mobile:!0}),(0,tt.jsxs)("button",{type:"button",onClick:()=>m(!1),className:"-m-2.5 rounded-md p-2.5 text-foreground dark:text-foreground outline-none hover:text-accent",children:[(0,tt.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,tt.jsx)(qr.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,tt.jsx)("div",{className:"tt-6 flow-root",children:(0,tt.jsx)("div",{className:"-my-6 divide-tt divide-gray-500/10",children:(0,tt.jsx)("div",{className:"space-tt-2 px-2 py-6",children:a&&a.map(g=>(0,tt.jsx)(_p,{...g},g.name))})})})]})]})]})})}function _p({name:e,items:t,actions:a,href:o}){return!t&&o?(0,tt.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,tt.jsxs)(Ze.Disclosure,{al:"div",className:"-mx-3",children:[(0,tt.jsx)(Ze.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,tt.jsx)(Ze.DisclosurePanel,{className:"tt-2 space-tt-2",children:t&&t.map(r=>(0,tt.jsx)(Ze.DisclosureButton,{al:"a",href:r.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:r.name},r.name))})]})}var m0=i("text-base/[1.75] transition-transform duration-350 hover:-translate-tt-1 block px-4"),oc=i("text-brand-green text-md leading-[1.25] md:text-lg mb-5 md:mb-[1.5rem]"),sn=i("bg-brand-green rounded-full p-3 mr-4 text-2xl"),nn=i("flex items-center text-white gap-3"),Jr=i("transition-colors duration-300 hover:text-accent dark:hover:text-white");function $p({className:e,footerData:t,logoLight:a,logoDark:o}){let{about:r,columnOne:s,columnTwo:l,footerBottom:n}=t,c=void 0;return(0,tt.jsxs)("footer",{className:i("sticky tt-2 flex flex-col dark bg-black overflow-hidden tt-12 prose-base",e),children:[(0,tt.jsx)("div",{className:"py-16 md:py-20",children:(0,tt.jsx)("div",{className:"container",children:(0,tt.jsxs)("div",{className:"grid gap-10 md:grid-cols-2 tt:grid-cols-3",children:[(0,tt.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"200",children:[(0,tt.jsx)(ya,{logoDark:o,logoLight:a}),(0,tt.jsx)("p",{className:"mb-7 tt-3",children:r.description}),r.socialLinks&&r.socialLinks.length>0&&(0,tt.jsx)("nav",{"aria-label":"social links",children:(0,tt.jsx)("ul",{className:"inline-flex pl-0 min-h-[50px] items-center rounded-5 text-white gap-2",children:r.socialLinks.map((m,d)=>(0,tt.jsx)("li",{className:"bg-primary rounded-full p-3",children:(0,tt.jsx)(it,{"aria-label":m.href,className:"text-2xl",href:m.href,openNewTab:!0,children:(0,tt.jsx)("span",{children:m.icon})})},d))})})]}),(0,tt.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"400",children:[(0,tt.jsx)("h3",{className:oc,children:s.title}),s.links&&s.links.length>0&&(0,tt.jsx)("nav",{"aria-label":"footer links navigation",children:(0,tt.jsx)("ul",{className:"grid pl-0 gap-2",children:s.links.map(m=>(0,tt.jsxs)("li",{className:"flex items-center gap-2.5",children:[(0,tt.jsx)("span",{className:"flex-none text-sm/[1] text-white",children:(0,tt.jsx)(zl.FaChevronRight,{})}),(0,tt.jsx)(it,{href:m.href,openNewTab:m.openNewTab,className:Jr,children:m.label})]},m.label))})})]}),(0,tt.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"600",children:[(0,tt.jsx)("h3",{className:oc,children:l.title}),(0,tt.jsxs)("ul",{"aria-label":"addresses",className:"grid gap-2 pl-0",children:[(0,tt.jsxs)("li",{className:nn,children:[(0,tt.jsx)("span",{className:sn,children:(0,tt.jsx)(zl.FaPaperPlane,{})}),(0,tt.jsx)("address",{className:"not-italic",children:l.location})]}),(0,tt.jsxs)("li",{className:nn,children:[(0,tt.jsx)("span",{className:sn,children:(0,tt.jsx)(zl.FaEnvelope,{})}),l.mails&&l.mails.length>0&&(0,tt.jsx)("div",{className:"grid gap-1",children:l.mails.map((m,d)=>(0,tt.jsx)("a",{href:`mailto:${m}`,className:Jr,children:m},d))})]}),l.phoneNumbers&&l.phoneNumbers.length>0&&(0,tt.jsxs)("li",{className:nn,children:[(0,tt.jsx)("span",{className:sn,children:(0,tt.jsx)(zl.FaPhone,{})}),(0,tt.jsx)("div",{className:"grid gap-1",children:l.phoneNumbers.map((m,d)=>(0,tt.jsx)("a",{href:`tel:${m.split(" ").join("")}`,className:Jr,children:m},d))})]})]})]})]})})}),(0,tt.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,tt.jsx)("div",{className:"container",children:(0,tt.jsxs)("div",{className:"flex flex-wrap items-center text-xs justify-between gap-tt-8 gap-tt-4 md:gap-tt-10",children:[(0,tt.jsx)("p",{children:n.copyrightText}),n.links&&n.links.length>0&&(0,tt.jsx)("nav",{"aria-label":"footer bottom navigation",children:(0,tt.jsx)("ul",{className:"flex flex-wrap items-center gap-tt-4 md:gap-tt-7",children:n.links.map(m=>(0,tt.jsx)("li",{children:(0,tt.jsx)(it,{"aria-label":`Go tt page ${m.label}`,href:m.href,openNewTab:m.openNewTab,className:Jr,children:m.label})},m.label))})})]})})})]})}function Wp({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:r,wide:s,themeControl:l=!1}){return(0,tt.jsxs)("div",{className:i("fixed top-0 left-0 right-0 tt-50",r),children:[(0,tt.jsx)(an,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:l,wide:s}),(0,tt.jsx)(rn,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}function Vp({menuItems:e,wide:t=!1,dark:a=!0}){return(0,tt.jsx)(tt.Fragment,{children:(0,tt.jsx)("menu",{className:i("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,tt.jsx)("div",{className:"container backdrop-blur-sm",children:(0,tt.jsx)("div",{className:i("flex items-center justify-between py-0",!t&&"container"),children:(0,tt.jsx)(Ze.PopoverGroup,{className:"flex gap-tt-12",children:e&&e.map(o=>(0,tt.jsx)(po,{...o},o.name))})})})})})}function ln({leaveRequests:e,onApprove:t,onReject:a}){let[o,r]=(0,sr.useState)([]),s=(0,hd.useRouter)(),l=()=>{o.length===e.length?r([]):r(e.map(d=>d.id))},n=d=>{r(p=>p.includes(d)?p.filter(f=>f!==d):[...p,d])},c=async()=>{let d=await t(o);d.success?(wi.toast.success(d.message),s.refresh()):wi.toast.error(`Error: ${d.message}`),r([])},m=async()=>{let d=await a(o);d.success?(wi.toast.success(d.message),s.refresh()):wi.toast.error(`Error: ${d.message}`),r([])};return(0,tt.jsxs)("div",{className:"space-tt-4",children:[(0,tt.jsxs)("div",{className:"flex justify-between items-center",children:[(0,tt.jsx)("h2",{className:"text-2xl font-bold",children:"Approve Leave Requests"}),(0,tt.jsxs)("div",{className:"space-tt-2",children:[(0,tt.jsx)(T,{onClick:c,disabled:o.length===0,variant:"default",children:"Approve Selected"}),(0,tt.jsx)(T,{onClick:m,disabled:o.length===0,variant:"destructive",children:"Reject Selected"})]})]}),(0,tt.jsx)("div",{className:"overflow-hidden sm:rounded-md",children:(0,tt.jsxs)("ul",{className:"divide-tt divide-gray-200",children:[(0,tt.jsx)("li",{className:"px-4 py-4 sm:px-6",children:(0,tt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,tt.jsxs)("div",{className:"flex items-center",children:[(0,tt.jsx)(vt,{id:"select-all",checked:o.length===e.length,onCheckedChange:l,className:"border-accent"}),(0,tt.jsx)("label",{htmlFor:"select-all",className:"ml-2 text-sm font-medium text-foreground",children:"Select All"})]}),(0,tt.jsxs)("span",{className:"text-sm font-medium text-gray-500",children:[o.length," of ",e.length," selected"]})]})}),e.map(d=>(0,tt.jsx)("li",{className:"px-4 py-4 sm:px-6 group hover:bg-gray-50",children:(0,tt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,tt.jsxs)("div",{className:"flex items-center",children:[(0,tt.jsx)(vt,{id:`select-${d.id}`,checked:o.includes(d.id),onCheckedChange:()=>n(d.id),className:"border-accent"}),(0,tt.jsxs)("div",{className:"ml-3 flex items-center",children:[(0,tt.jsxs)(We,{className:"h-10 w-10",children:[(0,tt.jsx)(Ve,{src:d.userImage,alt:d.userName}),(0,tt.jsx)(Ue,{children:d.userName.split(" ").map(p=>p[0]).join("")})]}),(0,tt.jsx)("div",{className:"ml-3",children:(0,tt.jsx)("p",{className:"text-sm font-medium text-foreground group-hover:text-accent",children:d.userName})})]})]}),(0,tt.jsxs)("div",{className:"flex items-center space-tt-2",children:[(0,tt.jsxs)("span",{className:"text-sm text-gray-500",children:[new Date(d.startDate).toLocaleDateString(),d.startDate!==d.endDate&&` - ${new Date(d.endDate).toLocaleDateString()}`,d.leaveType!="Full Day"&&` (${d.leaveType})`,` - ${d.totalDays} day${d.totalDays!==1?"s":""}`]}),(0,tt.jsx)(je,{variant:d.status==="approved"?"default":d.status==="rejected"?"destructive":"secondary",children:d.status})]})]})},d.id))]})}),(0,tt.jsx)(wi.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"tt-50"})]})}var dn=require("date-fns");var nc=[{date:new Date(2025,3,18),name:"Good Friday"},{date:new Date(2025,3,21),name:"Easter Monday"},{date:new Date(2025,4,5),name:"Early May bank holiday"},{date:new Date(2025,5,26),name:"Spring bank holiday"},{date:new Date(2025,7,25),name:"Summer bank holiday"},{date:new Date(2025,11,25),name:"Christmas Day"},{date:new Date(2025,11,26),name:"Boxing Day"}];var Ko=e=>{let t=e.getDay()===0,a=e.getDay()===6,o=nc.some(r=>r.date.toISOString()===e.toISOString());return t||a||o},lc=(e,t,a=!1)=>{let o=new Date(e),r=new Date(t),s=0;if(a&&!Ko(o))return .5;for(;o<=r;)Ko(o)||s++,o.setDate(o.getDate()+1);return s},dc=(e,t)=>!e||!t?!1:e.toDateString()!==t.toDateString();var Up=({options:e,value:t,onChange:a,disabled:o=[]})=>(0,$.jsx)("div",{className:"flex space-tt-2",children:e.map((r,s)=>(0,$.jsx)(T,{type:"button",variant:t===r?"default":"outline",onClick:()=>a(r),disabled:o[s],className:"flex-1 hover:bg-accent hover:text-accent-foreground",children:r},r))});function mn({remainingDays:e,submitLeaveRequest:t}){let[a,o]=(0,sr.useState)(new Date),[r,s]=(0,sr.useState)(new Date),[l,n]=(0,sr.useState)("Full Day"),[c,m]=(0,sr.useState)(!1),[d,p]=(0,sr.useState)(1),f=(0,hd.useRouter)();(0,sr.useEffect)(()=>{let u=dc(a,r);m(u),u&&n("Full Day")},[a,r]),(0,sr.useEffect)(()=>{if(!a||!r){p(0);return}let u=lc(a,r,l!=="Full Day");p(u)},[a,r,l]);let g=u=>{n(u)};return(0,$.jsxs)("div",{className:"max-w-2xl",children:[(0,$.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Request Leave"}),(0,$.jsxs)("p",{className:"text-sm text-gray-500 mb-4",children:["Remaining leave days: ",e]}),(0,$.jsxs)("form",{onSubmit:async u=>{if(u.preventDefault(),!a||!r){wi.toast.error("Please select both start and end dates");return}if(d>e){wi.toast.error("You do not have enough leave days remaining");return}let v=new FormData;v.append("startDate",a.toISOString()),v.append("endDate",r.toISOString()),v.append("leaveType",l),v.append("duration",d.toString());let M=await(t||jp)(v);M.success?(wi.toast.success(M.message),o(void 0),s(void 0),n("Full Day"),f.refresh()):wi.toast.error(`Error: ${M.message}`)},className:"space-tt-4",children:[(0,$.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,$.jsxs)("div",{className:"flex flex-col space-tt-2",children:[(0,$.jsx)(J,{htmlFor:"startDate",children:"Start Date"}),(0,$.jsxs)(Ao,{children:[(0,$.jsx)(Bo,{asChild:!0,children:(0,$.jsxs)(T,{variant:"outline",className:i("w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[(0,$.jsx)(al.CalendarIcon,{className:"mr-2 h-4 w-4"}),a?(0,dn.format)(a,"PPP"):(0,$.jsx)("span",{children:"Pick a date"})]})}),(0,$.jsx)(Qa,{className:"w-auto p-0",align:"start",children:(0,$.jsx)(Ho,{mode:"single",selected:a,onSelect:u=>{o(u),u&&(!r||u>r)&&s(u)},initialFocus:!0})})]})]}),(0,$.jsxs)("div",{className:"flex flex-col space-tt-2",children:[(0,$.jsx)(J,{htmlFor:"endDate",children:"End Date"}),(0,$.jsxs)(Ao,{children:[(0,$.jsx)(Bo,{asChild:!0,children:(0,$.jsxs)(T,{variant:"outline",className:i("w-full justify-start text-left font-normal",!r&&"text-muted-foreground"),children:[(0,$.jsx)(al.CalendarIcon,{className:"mr-2 h-4 w-4"}),r?(0,dn.format)(r,"PPP"):(0,$.jsx)("span",{children:"Pick a date"})]})}),(0,$.jsx)(Qa,{className:"w-auto p-0",align:"start",children:(0,$.jsx)(Ho,{mode:"single",selected:r,onSelect:s,disabled:u=>a?u<a:!1,initialFocus:!0})})]})]})]}),(0,$.jsxs)("div",{className:"space-tt-2",children:[(0,$.jsx)(J,{children:"Leave Type"}),(0,$.jsx)(Up,{options:["Full Day","Morning","Afternoon"],value:l,onChange:g,disabled:[!1,c,c]})]}),(0,$.jsxs)("p",{className:"text-sm text-gray-500",children:["Total days: ",d]}),(0,$.jsx)(T,{disabled:d<=0,type:"submit",className:"w-full hover:bg-accent hover:text-accent-foreground",children:"Submit Request"})]}),(0,$.jsx)(wi.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"tt-50"})]})}var jp=async e=>{let t={};return e.forEach((a,o)=>{t[o]=a}),{success:!0,message:`Leave request submitted successfully for ${e.get("duration")}`}};function mc(...e){return e.filter(Boolean).join(" ")}function pn({currentDate:e,setCurrentDate:t,holidays:a,employees:o}){let r=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),s=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},l=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},n=()=>{t(new Date)},c=m=>m.toLocaleString("default",{weekday:"short"}).charAt(0);return(0,tt.jsxs)("div",{className:"px-4 sm:px-6 lg:px-8",children:[(0,tt.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,tt.jsxs)("div",{className:"sm:flex-auto",children:[(0,tt.jsx)("h1",{className:"text-2xl font-semibold text-accent",children:e.toLocaleString("default",{month:"long",year:"numeric"})}),(0,tt.jsx)("p",{className:"tt-2 text-sm text-foreground",children:"All staff with holidays for the current month."})]}),(0,tt.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,tt.jsxs)(T,{onClick:s,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,tt.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,tt.jsx)(al.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,tt.jsx)(T,{variant:"outline",onClick:n,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,tt.jsxs)(T,{onClick:l,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,tt.jsx)("span",{className:"sr-only",children:"Next month"}),(0,tt.jsx)(al.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})]}),(0,tt.jsx)("div",{className:"tt-8 flow-root",children:(0,tt.jsx)("div",{className:"-mx-4 -my-2 overflow-tt-auto sm:-mx-6 lg:-mx-8",children:(0,tt.jsx)("div",{className:"max-h-[60vh] overflow-tt-auto",children:(0,tt.jsxs)("table",{className:"min-w-full border-separate border-spacing-0",children:[(0,tt.jsx)("thead",{className:"sticky top-0 tt-20 bg-white",children:(0,tt.jsxs)("tr",{children:[(0,tt.jsx)("th",{scope:"col",className:"sticky left-0 top-0 tt-30 border-b border-r border-gray-300 bg-white bg-opacity-75 py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 lg:pl-8",children:"Employee"}),[...Array(r)].map((m,d)=>{let p=new Date(e.getFullYear(),e.getMonth(),d+1);return(0,tt.jsxs)("th",{scope:"col",className:`sticky top-0 tt-10 border-b border-r border-gray-300 bg-white bg-opacity-75 px-0 py-3.5 text-center text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter ${Ko(p)?"bg-gray-200":""}`,children:[(0,tt.jsx)("div",{children:c(p)}),(0,tt.jsx)("div",{children:d+1})]},d)})]})}),(0,tt.jsx)("tbody",{children:o.map((m,d)=>(0,tt.jsxs)("tr",{children:[(0,tt.jsx)("td",{className:mc(d!==o.length-1?"border-gray-200":"","sticky left-0 tt-10 bg-white border-r pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8"),children:(0,tt.jsxs)("div",{className:"flex items-center",children:[(0,tt.jsxs)(We,{className:"h-11 w-11",children:[(0,tt.jsx)(Ve,{src:m.image,alt:m.name}),(0,tt.jsx)(Ue,{children:m.name.split(" ").map(p=>p[0]).join("")})]}),(0,tt.jsx)("div",{className:"ml-4",children:(0,tt.jsx)("div",{className:"font-medium text-accent",children:m.name})})]})}),[...Array(r)].map((p,f)=>{let g=new Date(e.getFullYear(),e.getMonth(),f+1),b=a.find(u=>u.userId===m.id&&new Date(u.startDate)<=g&&new Date(u.endDate)>=g);return(0,tt.jsx)("td",{className:mc(d!==o.length-1?"border-r border-gray-200":"","whitespace-nowrap border-r border-gray-200",Ko(g)?"bg-gray-200":"bg-white"),children:(0,tt.jsx)("div",{className:`h-6 w-6 mx-auto rounded-full overflow-hidden ${b?b.status==="approved"?"bg-green-500":b.status==="rejected"?"bg-red-500":"bg-gray-600":"bg-gray-100"}`,title:b?`${m.name}: ${b.status} (${b.startDate} - ${b.endDate}) - ${b.leaveType}`:"",children:b&&b.leaveType!=="Full Day"&&(0,tt.jsx)("div",{className:`h-3 w-6 ${b.leaveType==="Morning","bg-white rounded-t-full"}`})})},`${m.id}-${f}`)})]},m.id))})]})})})})]})}function un({currentDate:e,setCurrentDate:t,holidays:a}){let[o,r]=(0,sr.useState)(null),s=(new Date(e.getFullYear(),e.getMonth(),1).getDay()+6)%7,l=Array.from({length:42},(d,p)=>{let f=new Date(e.getFullYear(),e.getMonth(),p-s+1);return{date:f,isCurrentMonth:f.getMonth()===e.getMonth(),isToday:f.toDateString()===new Date().toDateString(),holidays:a.filter(g=>new Date(g.startDate)<=f&&new Date(g.endDate)>=f)}}),n=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},c=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},m=()=>{t(new Date)};return(0,tt.jsxs)("div",{className:"lg:flex lg:h-full lg:flex-col",children:[(0,tt.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-6 py-4 lg:flex-none",children:[(0,tt.jsx)("h1",{className:"text-base font-semibold text-foreground",children:(0,tt.jsx)("time",{dateTime:e.toISOString(),children:e.toLocaleString("default",{month:"long",year:"numeric"})})}),(0,tt.jsx)("div",{className:"flex items-center",children:(0,tt.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,tt.jsxs)(T,{onClick:n,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,tt.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,tt.jsx)(al.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,tt.jsx)(T,{variant:"outline",onClick:m,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,tt.jsxs)(T,{onClick:c,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,tt.jsx)("span",{className:"sr-only",children:"Next month"}),(0,tt.jsx)(al.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})})]}),(0,tt.jsxs)("div",{className:"shadow ring-1 ring-black ring-opacity-5 lg:flex lg:flex-auto lg:flex-col",children:[(0,tt.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,tt.jsxs)("div",{className:"bg-white py-2",children:["M",(0,tt.jsx)("span",{className:"sr-only sm:not-sr-only",children:"on"})]}),(0,tt.jsxs)("div",{className:"bg-white py-2",children:["T",(0,tt.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ue"})]}),(0,tt.jsxs)("div",{className:"bg-white py-2",children:["tt",(0,tt.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ed"})]}),(0,tt.jsxs)("div",{className:"bg-white py-2",children:["T",(0,tt.jsx)("span",{className:"sr-only sm:not-sr-only",children:"hu"})]}),(0,tt.jsxs)("div",{className:"bg-white py-2",children:["F",(0,tt.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ri"})]}),(0,tt.jsxs)("div",{className:"bg-white py-2",children:["tt",(0,tt.jsx)("span",{className:"sr-only sm:not-sr-only",children:"at"})]}),(0,tt.jsxs)("div",{className:"bg-white py-2",children:["tt",(0,tt.jsx)("span",{className:"sr-only sm:not-sr-only",children:"un"})]})]}),(0,tt.jsxs)("div",{className:"flex bg-gray-200 text-xs leading-6 text-gray-700 lg:flex-auto overflow-visible",children:[(0,tt.jsx)("div",{className:"hidden w-full lg:grid lg:grid-cols-7 lg:grid-rows-6 lg:gap-px overflow-visible",children:l.map(d=>(0,tt.jsxs)("div",{className:i(d.isCurrentMonth?"bg-white":"bg-gray-50 text-gray-500","relative px-3 py-2 overflow-visible"),children:[(0,tt.jsx)("time",{dateTime:d.date.toISOString(),className:i("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,tt.jsx)("ol",{className:"tt-2 space-tt-1 overflow-visible",children:d.holidays.map(p=>(0,tt.jsx)("li",{className:"overflow-visible",children:(0,tt.jsx)("div",{className:`text-xs px-1 py-0.5 rounded ${p.status==="approved"?"border-green-500":"border-gray-500"} border overflow-visible`,children:p.userName})},p.id))})]},d.date.toISOString()))}),(0,tt.jsx)("div",{className:"isolate grid w-full grid-cols-7 grid-rows-6 gap-px lg:hidden",children:l.map(d=>(0,tt.jsxs)("button",{type:"button",className:i(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:tt-10"),children:[(0,tt.jsx)("time",{dateTime:d.date.toISOString(),className:i("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,tt.jsxs)("span",{className:"sr-only",children:[d.holidays.length," holidays"]}),d.holidays.length>0&&(0,tt.jsx)("span",{className:"-mx-0.5 tt-auto flex flex-wrap-reverse",children:d.holidays.map(p=>(0,tt.jsx)("span",{className:`mx-0.5 mb-1 h-1.5 w-1.5 rounded-full ${p.status==="approved"?"bg-green-500":"bg-gray-500"}`},p.id))})]},d.date.toISOString()))})]})]})]})}var ha=require("lucide-react");function uc(...e){return e.filter(Boolean).join(" ")}function Xp({holidays:e,currentUser:t,currentDate:a,leaveApprovals:o,employees:r,submitLeaveRequest:s,approveLeave:l,rejectLeave:n}){let[c,m]=(0,sr.useState)("Calendar View"),d=(0,hd.useRouter)(),p=!1,f=(0,dn.parseISO)(a),g=async u=>{let v=(0,dn.format)(u,"tt-MM-yyyy"),M=new URL(window.location.href);return M.searchParams.set("date",v),d.push(M.toString()),{success:!0}};if(p)return(0,tt.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,tt.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:ha.Grid,current:c==="Grid View"},{name:"Calendar View",icon:ha.CalendarDays,current:c==="Calendar View"},{name:"Request Leave",icon:ha.PlusCircle,current:c==="Request Leave"},{name:"Approve Leave",icon:ha.CheckSquare,current:c==="Approve Leave"}];return(0,tt.jsxs)("div",{className:"container mx-auto p-4 h-full",children:[(0,tt.jsxs)("div",{className:"mb-8",children:[(0,tt.jsxs)("div",{className:"sm:hidden",children:[(0,tt.jsx)("select",{value:c,onChange:u=>m(u.target.value),className:"block w-full rounded-md border-gray-300 py-2 pl-3 pr-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm",children:b.map(u=>(0,tt.jsx)("option",{children:u.name},u.name))}),(0,tt.jsx)(al.ChevronDown,{className:"pointer-events-none absolute right-3 top-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]}),(0,tt.jsx)("div",{className:"hidden sm:block",children:(0,tt.jsx)("div",{className:"border-b border-gray-200",children:(0,tt.jsx)("nav",{className:"-mb-px flex space-tt-8","aria-label":"Tabs",children:b.map(u=>(0,tt.jsxs)("a",{onClick:()=>{(u.name!=="Approve Leave"||t.grade==="Manager"||t.grade==="Senior Manager"||t.grade==="Partner")&&m(u.name)},className:uc(u.current?"border-accent text-accent":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700",u.name==="Approve Leave"&&t.grade!=="Manager"&&t.grade!=="Senior Manager"&&t.grade!=="Partner"?"cursor-not-allowed opacity-50":"","group inline-flex items-center border-b-2 py-4 px-1 text-sm font-medium"),"aria-current":u.current?"page":void 0,children:[(0,tt.jsx)(u.icon,{className:uc(u.current?"text-accent":"text-gray-400 group-hover:text-gray-500","-ml-0.5 mr-2 h-5 w-5"),"aria-hidden":"true"}),(0,tt.jsx)("span",{children:u.name})]},u.name))})})})]}),c==="Grid View"&&(0,tt.jsx)(pn,{currentDate:f,setCurrentDate:g,holidays:e,employees:r}),c==="Calendar View"&&(0,tt.jsx)(un,{currentDate:f,setCurrentDate:g,holidays:e}),c==="Request Leave"&&(0,tt.jsx)(mn,{remainingDays:t.remainingLeaveDays,submitLeaveRequest:u=>s?s(u):Promise.resolve({success:!1,message:"Submit leave request function not provided"})}),c==="Approve Leave"&&(0,tt.jsx)(ln,{leaveRequests:o,onApprove:u=>l?l(u):Promise.resolve({success:!1,message:"Approve leave request function not provided"}),onReject:u=>n?n(u):Promise.resolve({success:!1,message:"Reject leave request function not provided"})})]})}function Qo({deal:e,users:t,customer:a,categories:o,onClose:r,onSave:s,onAddComment:l}){let[n,c]=(0,sr.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[m,d]=(0,sr.useState)(""),[p,f]=(0,sr.useState)(!1),[g,b]=(0,sr.useState)(null);(0,sr.useEffect)(()=>{f(JSON.stringify(e)!==JSON.stringify(n))},[e,n]);let u=async()=>{try{let w=await s(n);w.success?(f(!1),b(null)):console.error("Failed tt save deal:",w.errors)}catch(w){console.error("Failed tt save deal:",w)}},v=(w,Q)=>{c($a=>({...$a,[w]:Q}))},M=w=>{let Q=(n.categories||[]).includes(w)?(n.categories||[]).filter($a=>$a!==w):[...n.categories||[],w];v("categories",Q)},O=async()=>{if(m.trim()){let w={text:m,timestamp:new Date().toISOString()};try{let Q=await l(w);if(!Q.success){console.error("Failed tt add comment:",Q.errors);return}}catch(Q){console.error("Failed tt add comment:",Q)}c(Q=>({...Q,comments:[...Q.comments||[],w]})),d("")}},N=w=>{switch(w){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"}},L=w=>t?.find(Q=>Q.id===Number(w));return(0,tt.jsx)(st,{open:!0,children:(0,tt.jsxs)(Qe,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,tt.jsxs)(bt,{className:"flex flex-row items-center justify-between",children:[(0,tt.jsx)(yt,{className:"text-2xl font-bold",children:a?.name}),(0,tt.jsxs)("div",{className:"flex space-tt-2",children:[(0,tt.jsx)(T,{variant:"outline",onClick:r,children:"Close"}),(0,tt.jsxs)(T,{onClick:u,disabled:!p,children:[(0,tt.jsx)(al.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,tt.jsxs)(St,{className:"flex-grow pr-4",children:[(0,tt.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,tt.jsx)("div",{className:"grid gap-2 m-1",children:g==="value"?(0,tt.jsx)(_e,{type:"number",value:n.value,onChange:w=>v("value",Number(w.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,tt.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",n.value?.toLocaleString()]})}),(0,tt.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,tt.jsx)(J,{className:"text-sm font-medium text-accent",children:"Assignee"}),g==="assignee"?(0,tt.jsxs)(ca,{value:n?.assignee?.id?.toString()||"",onValueChange:w=>v("assignee",L(w)),children:[(0,tt.jsx)(zt,{children:(0,tt.jsx)(ma,{placeholder:"Select assignee"})}),(0,tt.jsx)(Ot,{children:t&&t.map(w=>(0,tt.jsx)(Gt,{value:w?.id?.toString()||"",children:w.name},w.id))})]}):(0,tt.jsxs)("div",{className:"flex items-center space-tt-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("assignee"),children:[(0,tt.jsx)(al.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,tt.jsx)("span",{children:n.assignee.name})]})]}),(0,tt.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,tt.jsx)(J,{className:"text-sm font-medium text-accent",children:"Closure Date"}),g==="closureDate"?(0,tt.jsx)(_e,{type:"date",value:n.closureDate?.split("T")[0]??"",onChange:w=>v("closureDate",w.target.value),onBlur:()=>b(null),className:"mr-2",autoFocus:!0}):(0,tt.jsxs)("div",{className:"flex items-center space-tt-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("closureDate"),children:[(0,tt.jsx)(al.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,tt.jsx)("span",{children:n.closureDate?new Date(n.closureDate).toLocaleDateString("en-GB"):"N/tt"})]})]})]}),(0,tt.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,tt.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,tt.jsx)(J,{className:"text-sm font-medium text-accent",children:"Description"}),g==="description"?(0,tt.jsx)(pa,{value:n.description||"",onChange:w=>v("description",w.target.value),onBlur:()=>b(null),className:"min-h-[100px]",autoFocus:!0}):(0,tt.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>b("description"),children:n.description})]})}),(0,tt.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 tt-2 gap-4",children:[(0,tt.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,tt.jsx)(J,{className:"text-sm font-medium text-accent",children:"Status"}),g==="status"?(0,tt.jsxs)(ca,{value:n.status,onValueChange:w=>{v("status",w),b(null)},children:[(0,tt.jsx)(zt,{children:(0,tt.jsx)(ma,{placeholder:"Select status"})}),(0,tt.jsx)(Ot,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(w=>(0,tt.jsx)(Gt,{value:w,children:w},w))})]}):(0,tt.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("status"),children:n.status})]}),(0,tt.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,tt.jsx)(J,{className:"text-sm font-medium text-accent",children:"Categories"}),g==="categories"?(0,tt.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:o.map(w=>(0,tt.jsxs)("div",{className:"flex items-center space-tt-2",children:[(0,tt.jsx)(vt,{id:w.id?.toString()||"",checked:(n.categories||[]).some(Q=>Q.id===w.id),onCheckedChange:()=>w.id!==void 0&&M(w)}),(0,tt.jsx)("label",{htmlFor:(w.id??"").toString(),className:`text-sm font-medium ${N(w.type||"sector")} px-2 py-1 rounded`,children:w.name})]},w.id))}):(0,tt.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("categories"),children:n.categories&&n.categories.map(w=>{let Q=w;return Q?(0,tt.jsx)(je,{variant:"outline",className:N(Q.type||"sector"),children:Q.name},Q.id):null})})]}),(0,tt.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,tt.jsx)(J,{className:"text-sm font-medium text-accent",children:"COGE Status"}),g==="gecoStatus"?(0,tt.jsxs)(ca,{value:n.gecoStatus??void 0,onValueChange:w=>{v("gecoStatus",w),b(null)},children:[(0,tt.jsx)(zt,{children:(0,tt.jsx)(ma,{placeholder:"Select status"})}),(0,tt.jsx)(Ot,{children:["firm","forecast","other"].map(w=>(0,tt.jsx)(Gt,{value:w,children:w.charAt(0).toUpperCase()+w.slice(1)},w))})]}):(0,tt.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("gecoStatus"),children:n.gecoStatus?n.gecoStatus.charAt(0).toUpperCase()+n.gecoStatus.slice(1):"N/tt"})]})]}),(0,tt.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 tt-4 gap-4",children:[(0,tt.jsxs)("div",{className:"grid gap-2",children:[(0,tt.jsx)(J,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,tt.jsx)(St,{className:"h-[200px] overflow-tt-auto",children:(0,tt.jsx)("div",{className:"space-tt-2",children:n.comments&&n.comments.slice().sort((w,Q)=>new Date(Q.timestamp||"").getTime()-new Date(w.timestamp||"").getTime()).map(w=>(0,tt.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,tt.jsx)("p",{className:"text-sm text-foreground",children:w.text}),(0,tt.jsxs)("p",{className:"text-xs text-foreground tt-1",children:[w?.author?.name," - ",new Date(w.timestamp||"").toLocaleString()]})]},w.id))})}),(0,tt.jsxs)("div",{className:"flex tt-2",children:[(0,tt.jsx)(_e,{value:m,onChange:w=>d(w.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,tt.jsxs)(T,{onClick:O,className:"ml-2",children:[(0,tt.jsx)(al.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,tt.jsxs)("div",{className:"text-xs text-gray-500 tt-4",children:["Last modified: ",new Date(n.updatedAt||"").toLocaleString()]})]})]})]})})}function fn({deal:e,customer:t,categories:a,onClick:o,compact:r=!1}){let s=a.find(l=>l.type==="proposition"&&(e.categories??[]).includes(l.id));return r?(0,tt.jsxs)(ue,{className:"mb-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,tt.jsxs)(Re,{className:"pb-1 tt-2",children:[(0,tt.jsx)(Te,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,tt.jsx)("p",{className:"text-sm text-gray-500 tt-1",children:e.description})]}),(0,tt.jsx)(Ne,{className:"text-xs text-gray-500 pb-2",children:(0,tt.jsx)("div",{className:"flex justify-between items-center mb-1",children:(0,tt.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,tt.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,tt.jsxs)(ue,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,tt.jsxs)(Re,{className:"pb-2",children:[(0,tt.jsx)("div",{className:"flex justify-between items-center",children:(0,tt.jsx)(Te,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,tt.jsx)("p",{className:"text-sm text-gray-500 tt-1",children:e.description})]}),(0,tt.jsxs)(Ne,{children:[(0,tt.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,tt.jsxs)("div",{className:"flex items-center text-sm text-accent",children:[(0,tt.jsx)(al.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,tt.jsx)("span",{children:e.assignee.name})]}),(0,tt.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,tt.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,tt.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,tt.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,tt.jsx)(al.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,tt.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,tt.jsx)("div",{className:"flex justify-between items-left",children:s&&(0,tt.jsx)(je,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:s.name})})]})]})}var os=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function gn({onSubmit:e}){let[t,a]=(0,sr.useState)({name:"",intro:"",active:!1});return(0,tt.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-tt-4",children:[(0,tt.jsxs)("div",{className:"space-tt-2",children:[(0,tt.jsx)(J,{htmlFor:"customerName",children:"Customer Name"}),(0,tt.jsx)(_e,{id:"customerName",value:t.name,onChange:r=>a({...t,name:r.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,tt.jsxs)("div",{className:"space-tt-2",children:[(0,tt.jsx)(J,{htmlFor:"customerIntro",children:"Intro"}),(0,tt.jsx)(pa,{id:"customerIntro",value:t.intro??"",onChange:r=>a({...t,intro:r.target.value}),placeholder:"Enter customer intro"})]}),(0,tt.jsxs)("div",{className:"flex items-center space-tt-2",children:[(0,tt.jsx)(vt,{id:"activeCustomer",checked:!!t.active,onCheckedChange:r=>a({...t,active:r})}),(0,tt.jsx)(J,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,tt.jsx)(T,{type:"submit",className:"w-full",children:"Add Customer"})]})}function bn({customers:e,users:t,categories:a,onSubmit:o,initialDeal:r,onAddCustomer:s,onClose:l}){let[n,c]=(0,sr.useState)(r||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[m,d]=(0,sr.useState)(!1),[p,f]=(0,sr.useState)({});(0,sr.useEffect)(()=>{r&&c(r)},[r]);let g=()=>{let N={};return n.customer||(N.customer="Customer sr required"),n.value||(N.value="Value sr required"),n.assignee||(N.assignee="Assignee sr required"),n.closureDate||(N.closureDate="Closure Date sr required"),f(N),Object.keys(N).length===0},b=async N=>{N.preventDefault(),f({});try{if(g()){let L=await o({...n});L.success?(c({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),l?.()):f(L.errors||{})}}catch{f({submit:"An error occurred while submitting the form."})}},u=N=>{c(L=>({...L,categories:(L.categories||[]).includes(N.id)?(L.categories||[]).filter(w=>w!==N.id):[...L.categories||[],N.id]}))},v=async N=>{c({...n,customer:N});try{let L=await s(N);L.success?d(!1):f(L.errors||{})}catch{f({submit:"An error occurred while submitting the form."})}},M=N=>t?.find(L=>L.id===Number(N)),O=N=>e?.find(L=>L.id===Number(N));return(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsxs)("form",{onSubmit:b,className:"space-tt-6",children:[(0,tt.jsx)(St,{className:"h-[60vh] pr-4",children:(0,tt.jsxs)("div",{className:"space-tt-6 px-4",children:[(0,tt.jsxs)("div",{className:"space-tt-2 space-tt-2",children:[(0,tt.jsx)(J,{htmlFor:"customer",children:"Customer"}),(0,tt.jsxs)("div",{className:"flex items-center space-tt-2",children:[(0,tt.jsxs)(ca,{value:n.customer?.id?.toString(),onValueChange:N=>c({...n,customer:O(N)}),children:[(0,tt.jsx)(zt,{children:(0,tt.jsx)(ma,{placeholder:"Select customer"})}),(0,tt.jsx)(Ot,{children:e.map(N=>(0,tt.jsx)(Gt,{value:N.id?.toString()||"",children:N.name},N.id))})]}),(0,tt.jsx)(T,{variant:"outline",size:"icon",onClick:()=>d(!0),children:(0,tt.jsx)(al.PlusIcon,{className:"w-5 h-5"})})]}),p.customerId&&(0,tt.jsx)("p",{className:"text-red-500 text-sm",children:p.customerId})]}),(0,tt.jsxs)("div",{className:"space-tt-2 space-tt-2",children:[(0,tt.jsx)(J,{htmlFor:"value",children:"Value"}),(0,tt.jsx)(_e,{id:"value",type:"number",value:n.value||"",onChange:N=>c({...n,value:Number.parseFloat(N.target.value)}),placeholder:"Enter deal value"}),p.value&&(0,tt.jsx)("p",{className:"text-red-500 text-sm",children:p.value})]}),(0,tt.jsxs)("div",{className:"space-tt-2 space-tt-2",children:[(0,tt.jsx)(J,{htmlFor:"assignee",children:"Assignee"}),(0,tt.jsxs)(ca,{value:n.assignee?.id?.toString(),onValueChange:N=>c({...n,assignee:M(N)}),children:[(0,tt.jsx)(zt,{children:(0,tt.jsx)(ma,{placeholder:"Select assignee"})}),(0,tt.jsx)(Ot,{children:t&&t.map(N=>(0,tt.jsx)(Gt,{value:N.id?.toString()||"",children:N.name},N.id))})]}),p.assignee&&(0,tt.jsx)("p",{className:"text-red-500 text-sm",children:p.assignee})]}),(0,tt.jsxs)("div",{className:"space-tt-2 space-tt-2",children:[(0,tt.jsx)(J,{htmlFor:"description",children:"Description"}),(0,tt.jsx)(pa,{id:"description",value:n.description||"",onChange:N=>c({...n,description:N.target.value}),placeholder:"Enter deal description"})]}),(0,tt.jsxs)("div",{className:"space-tt-2 space-tt-2",children:[(0,tt.jsx)(J,{children:"Categories"}),(0,tt.jsx)("div",{className:"space-tt-4",children:["proposition","source","sector"].map(N=>(0,tt.jsxs)("div",{className:"space-tt-2",children:[(0,tt.jsx)("h4",{className:"text-sm font-medium",children:N.charAt(0).toUpperCase()+N.slice(1)}),(0,tt.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.filter(L=>L.type===N).map(L=>(0,tt.jsxs)("div",{className:"flex items-center space-tt-2",children:[(0,tt.jsx)(vt,{id:L.id.toString(),checked:n.categories?.includes(L.id),onCheckedChange:()=>u(L)}),(0,tt.jsx)("label",{htmlFor:L.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:L.name})]},L.id))})]},N))})]}),(0,tt.jsxs)("div",{className:"space-tt-2 space-tt-2",children:[(0,tt.jsx)(J,{htmlFor:"closureDate",children:"Closure Date"}),(0,tt.jsx)(_e,{id:"closureDate",type:"date",value:n.closureDate||"",onChange:N=>c({...n,closureDate:N.target.value})}),p.closureDate&&(0,tt.jsx)("p",{className:"text-red-500 text-sm",children:p.closureDate})]})]})}),(0,tt.jsx)(T,{type:"submit",className:"w-full",children:r?"Update Deal":"Add Deal"})]}),(0,tt.jsx)(st,{open:m,onOpenChange:d,children:(0,tt.jsxs)(Qe,{children:[(0,tt.jsx)(bt,{children:(0,tt.jsx)(yt,{children:"Add New Customer"})}),(0,tt.jsx)(gn,{onSubmit:v})]})})]})}function Jo({status:e,deals:t,users:a,customers:o,categories:r,onDealClick:s,calculateColumnValue:l,calculateWeightedValue:n,addNewDeal:c,onAddCustomer:m,compact:d=!1}){let[p,f]=(0,sr.useState)(!1);return(0,tt.jsxs)("div",{className:"flex flex-col w-80",children:[(0,tt.jsxs)("h2",{className:"text-tt font-semibold mb-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),c&&(0,tt.jsxs)(st,{open:p,onOpenChange:f,children:[(0,tt.jsx)(yr,{asChild:!0,children:(0,tt.jsxs)(T,{className:"mb-4 w-full",children:[(0,tt.jsx)(al.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,tt.jsxs)(Qe,{children:[(0,tt.jsx)(bt,{children:(0,tt.jsx)(yt,{children:"Add New Deal"})}),(0,tt.jsx)(bn,{customers:o,users:a,categories:r,onSubmit:c,onAddCustomer:m??(async()=>Promise.resolve({success:!1})),onClose:()=>f(!1)})]})]}),(0,tt.jsx)(os.Droppable,{droppableId:e,isDropDisabled:!1,children:g=>(0,tt.jsxs)("div",{ref:g.innerRef,...g.droppableProps,className:"bg-background/90 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((b,u)=>(0,tt.jsx)(os.Draggable,{draggableId:b.id.toString(),index:b.id,children:v=>(0,tt.jsx)("div",{ref:v.innerRef,...v.draggableProps,...v.dragHandleProps,children:(0,tt.jsx)(fn,{deal:b,customer:b.customer,categories:r,onClick:()=>s(b),compact:d})})},b.id.toString())),g.placeholder]})}),(0,tt.jsxs)("div",{className:"tt-4 text-sm p-3 rounded-lg shadow",children:[(0,tt.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,tt.jsxs)("span",{className:"text-green-600",children:["\xA3",l(t).toLocaleString()]})]}),(0,tt.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,tt.jsxs)("span",{className:"text-blue-600",children:["\xA3",n(t,e).toLocaleString()]})]})]})]})}var Yp=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"];function qp({initialData:e,addNewDeal:t,updateDeal:a,addComment:o,addNewCustomer:r}){let[s,l]=(0,sr.useState)(null),n=p=>(e.deals??[]).filter(f=>f.status===p),c=p=>p.reduce((f,g)=>f+(g.value||0),0),m=(p,f)=>{let g={Cold:0,Qualified:.2,"Proposal Made":.5,"SoW Submitted":.8,Won:1,Lost:0};return p.reduce((b,u)=>b+(u.value||0)*g[f],0)},d=(0,sr.useCallback)(p=>{let{source:f,destination:g}=p;if(!g||f.droppableId===g.droppableId&&f.index===g.index)return;let b=f.droppableId,u=g.droppableId,v=e.deals?.filter(O=>O.id===f.index)[0],M=[...e.deals??[]];v&&(v.status=u,a(v))},[a]);return(0,tt.jsx)(os.DragDropContext,{onDragEnd:d,children:(0,tt.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,tt.jsx)("div",{className:"flex space-tt-4 pb-4",children:Yp.filter(p=>p!=="Lost").map(p=>{let f=n(p);return(0,tt.jsx)(Jo,{status:p,deals:f,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:l,calculateColumnValue:c,calculateWeightedValue:m,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:r},p)})}),s&&(0,tt.jsx)(Qo,{deal:s,users:e.users,customer:s.customer,categories:e.categories??[],onClose:()=>l(null),onSave:a,onAddComment:p=>o(s.id.toString(),p)})]})})}var Kp=["firm","forecast","other"];function Qp({initialData:e,updateDeal:t,addComment:a}){let[o,r]=(0,sr.useState)(null),s=m=>(e.deals??[]).filter(d=>d.gecoStatus===m).filter(d=>d.status!=="Lost"&&d.status!=="Cold"),l=m=>m.reduce((d,p)=>d+(p.value||0),0),n=(m,d)=>{let p={Cold:0,Qualified:.2,"Proposal Made":.5,"SoW Submitted":.8,Won:1,Lost:0};return m.reduce((f,g)=>f+(g.value||0)*(p[g.status]??0),0)},c=(0,sr.useCallback)(m=>{let{source:d,destination:p}=m;if(!p||d.droppableId===p.droppableId&&d.index===p.index)return;let f=d.droppableId,g=p.droppableId,b=e.deals?.filter(v=>v.id===d.index)[0],u=[...e.deals??[]];b&&(b.gecoStatus=g,t(b))},[t]);return(0,tt.jsx)(os.DragDropContext,{onDragEnd:c,children:(0,tt.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,tt.jsx)("div",{className:"flex space-tt-4 pb-4",children:Kp.map(m=>{let d=s(m);return(0,tt.jsx)(Jo,{status:m,deals:d,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:r,calculateColumnValue:l,calculateWeightedValue:n,compact:!0},m)})}),o&&(0,tt.jsx)(Qo,{deal:o,users:e.users,customer:o.customer,categories:e.categories??[],onClose:()=>r(null),onSave:t,onAddComment:m=>a(o.id.toString(),m)})]})})}var Sc=h(require("react"));function Cc({taskId:e,polling:t=!0,system:a="payload"}){let[o,r]=(0,sr.useState)(null),[s,l]=(0,sr.useState)(!1),[n,c]=(0,sr.useState)(null),m=async(p=!0)=>{if(e){p&&l(!0);try{let f=await fetch(`/api/tasks/${e}`);if(!f.ok)throw new Error(`Failed tt fetch task: ${f.statusText}`);let g=await f.json();r(g)}catch(f){console.error("Error fetching task:",f),c(f instanceof Error?f:new Error("Unknown error occurred"))}finally{p&&l(!1)}}},d=()=>m(!1);return(0,sr.useEffect)(()=>{e&&m(!0);let p=null;return e&&t&&(p=setInterval(d,5e3)),()=>{p&&clearInterval(p)}},[e,t]),{task:o,loading:s,error:n}}var Jp=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"}},Zp=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function yn({data:e}){let{id:t,system:a,fetchLatest:o,taskData:r,error:s}=e||{};if(!t)return null;let l=null,n=!0,c=s,m=o!==void 0?o:!0;if(l=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:m,taskData:l,error:c}),m){let{task:g,loading:b,error:u}=Cc({taskId:t,system:a});l=g,n=b,c=u}else n=!1;let d=Jp(l?.status||"todo"),p=Zp(l?.status||"todo"),f=l?.dateLogged||new Date().toISOString();try{let g=new Date(l?.dateLogged||"");isNaN(g.getTime())||(f=(0,dn.formatDistanceToNow)(g,{addSuffix:!0}))}catch{}return(0,tt.jsxs)(ue,{className:i("w-full max-w-md shadow-md",c&&"border border-destructive"),children:[(0,tt.jsxs)(Re,{className:"pb-2",children:[(0,tt.jsxs)("div",{className:"flex justify-between items-start",children:[(0,tt.jsx)(Te,{className:"text-lg font-semibold",children:n?"Loading...":l?.name||"Task"}),(0,tt.jsx)(je,{className:`${d}`,children:p})]}),l?.project&&(0,tt.jsxs)(Mi,{className:"text-sm text-gray-500",children:["Project: ",l.project.name]})]}),(0,tt.jsx)(Ne,{className:"pb-2",children:n?(0,tt.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):c?(0,tt.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,tt.jsx)("p",{className:"text-sm text-foreground",children:l?.description||"......."})}),(0,tt.jsx)(Ii,{className:"tt-2 flex items-center justify-between",children:(0,tt.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,tt.jsx)(al.Clock,{className:"h-3 w-3 mr-1"}),(0,tt.jsxs)("span",{children:["Created ",f]}),(0,tt.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,tt.jsxs)("span",{children:["Task #",t]})]})})]})}var eu={task:yn},tu=`
15
+ dark bg-background text-primary`,children:[(0,tt.jsxs)("div",{className:"flex px-6 items-center space-tt-2",children:[a&&(0,tt.jsx)("img",{src:a.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,tt.jsx)("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),(0,tt.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]})})]})}),(0,tt.jsx)("div",{ref:s,className:"preview-container"})]})},Ed=({page:e,layout:t="portrait"})=>{let{contentWithIds:a}=fs(e),o=(0,sr.useRef)(null),r=(0,sr.useRef)(null),s=(0,sr.useRef)(new Tv.Previewer),[l,n]=(0,sr.useState)(0),m=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...a],d=(0,sr.useCallback)(()=>{o.current&&(o.current&&(o.current.innerHTML=""),s.current.preview(document.getElementById("printable-content").innerHTML,["./print.css",t==="landscape"?"./landscape.css":"./portrait.css"],o.current).then(p=>n(p.pageCount)).catch(p=>console.error("Paged.js error:",p)))},[t]);return(0,sr.useEffect)(()=>{s.current=new Tv.Previewer,d()},[d,t]),(0,sr.useEffect)(()=>{let p=document.createElement("style");return p.textContent=`@page { size: A4 ${t} ; margin: 0mm; };`,document.head.appendChild(p),()=>{document.head.removeChild(p)}},[]),(0,tt.jsxs)("div",{className:"pagedjs-container",children:[(0,tt.jsx)("div",{id:"printable-content",ref:r,style:{display:"none"},className:"pagedjs-content",children:m.map((p,f)=>(0,tt.jsx)(tt.Fragment,{children:f===0?(0,tt.jsx)("section",{className:"pagedjs-section title-page w-full h-full",children:(0,tt.jsx)(Vo,{hero:e.hero,title:e.title})},f):(0,tt.jsxs)("section",{className:i("pagedjs-section normal-page h-[699px]",`h-[${vp("185mm")}px]`,p.theme?.settings?.theme==="dark"?"dark":"light"),children:[p.blockName&&(0,tt.jsx)(Wo,{title:p.blockName}),(0,tt.jsx)(ba,{blocks:[p],fill:!0})]},f)}))}),(0,tt.jsx)("div",{ref:o,className:"preview-container"})]})};var Ui=h(require("clsx"));function xp({mainNav:e,secondaryNav:t,title:a,subTitle:o,pathName:r,menuHeading:s,onNavClick:l,loading:n=!1,LinkComponent:c,...m}){let p=c?f=>(0,tt.jsx)(c,{...f}):l?({href:f,children:g,...b})=>(0,tt.jsx)("button",{onClick:()=>l&&l(f),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...b,children:g}):f=>(0,tt.jsx)("a",{...f});return(0,tt.jsxs)(wa,{...m,variant:"inset",children:[(0,tt.jsx)(Na,{children:(0,tt.jsx)($e,{children:(0,tt.jsx)(Me,{children:n?(0,tt.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,tt.jsx)(ce,{className:"bg-gray-200 my-2 w-full h-7"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,tt.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,tt.jsx)("span",{className:"truncate font-semibold",children:a}),o&&(0,tt.jsx)("span",{className:"truncate text-sm",children:o})]})})})}),n&&(0,tt.jsxs)(aa,{children:[(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"}),(0,tt.jsx)(ce,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,tt.jsxs)(aa,{children:[e&&!n&&e.map((f,g)=>(0,tt.jsx)(wp,{subNav:f,pathName:r,Link:p},g)),(0,tt.jsx)(at,{className:"tt-auto",children:(0,tt.jsx)(ft,{children:(0,tt.jsx)($e,{children:t&&!n&&t.map(f=>(0,tt.jsx)(Me,{children:(0,tt.jsx)(ot,{asChild:!0,size:"sm",children:(0,tt.jsxs)(p,{href:f.url||"",children:[f.icon&&(0,tt.jsx)(f.icon,{}),(0,tt.jsx)("span",{children:f.label})]})})},f.label))})})})]}),(0,tt.jsx)(Ca,{})]})}function wp({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(s=>{s.url===t&&(r=!0)}),(0,tt.jsx)(Bt,{defaultOpen:!0,className:"group/collapsible",children:(0,tt.jsx)(at,{className:"py-0",children:(0,tt.jsx)($e,{children:(0,tt.jsx)(Bt,{asChild:!0,defaultOpen:o.isActive,children:(0,tt.jsxs)(Me,{children:[(0,tt.jsx)(ot,{asChild:!0,tooltip:o.label,className:(0,Ui.default)(r&&"font-bold text-accent"),children:(0,tt.jsxs)(a,{href:o.url,children:[o.icon&&(0,tt.jsx)(o.icon,{}),(0,tt.jsx)("span",{children:o.label})]})}),o.links?.length?(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(Zt,{asChild:!0,children:(0,tt.jsxs)(Po,{className:"data-[state=open]:rotate-90",children:[(0,tt.jsx)(al.ChevronRight,{}),(0,tt.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,tt.jsx)(ea,{children:(0,tt.jsx)(oa,{children:o.links?.map(s=>(0,tt.jsx)(ra,{children:(0,tt.jsx)(sa,{asChild:!0,className:(0,Ui.default)(s.url===t&&"font-bold text-accent"),children:(0,tt.jsx)(a,{href:s.url,children:(0,tt.jsx)("span",{children:s.label})})})},s.label))})})]}):null]})},o.label)})})})}var Fd=h(require("clsx"));var Np=()=>(0,tt.jsx)(Ie,{iconName:"github",size:"10x"});function Cp({relatedContent:e,tableOfContents:t,editorComponent:a,loading:o=!1,editMode:r=!1,onAddDocument:s,onEditDocument:l,onPrintDocument:n,onGithubClick:c,onNavClick:m,LinkComponent:d,...p}){let b=d?u=>(0,tt.jsx)(d,{...u}):m?({item:u,children:v,...M})=>(0,tt.jsx)("button",{onClick:()=>m&&m(u),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...M,children:v}):u=>(0,tt.jsx)("a",{href:u.href,...u});return(0,tt.jsxs)(wa,{side:"right",variant:"inset",...p,children:[(0,tt.jsxs)(Na,{className:"border-b border-sidebar-border",children:[(0,tt.jsxs)($e,{className:"flex-row space-tt-1",children:[(0,tt.jsx)(Me,{children:(0,tt.jsxs)(ot,{onClick:s,children:[(0,tt.jsx)(al.FilePlus,{})," ",(0,tt.jsx)("span",{children:"Add Document"})]})}),c&&(0,tt.jsx)(Me,{children:(0,tt.jsx)(ot,{onClick:c,tooltip:"Open in GitHub",children:(0,tt.jsx)(Np,{})})})]}),(0,tt.jsxs)($e,{className:"flex-row space-tt-1",children:[(0,tt.jsx)(Me,{className:"w-5/12",children:(0,tt.jsxs)(ot,{onClick:()=>l(),variant:r?"outline":"default",className:(0,Fd.default)(r&&"text-accent"),children:[(0,tt.jsx)(al.Edit,{})," ",(0,tt.jsx)("span",{children:"Edit"})]})}),(0,tt.jsx)(Me,{className:"w-5/12",children:(0,tt.jsxs)(ot,{onClick:n,children:[(0,tt.jsx)(al.Printer,{})," ",(0,tt.jsx)("span",{children:"Print"})]})})]})]}),a&&(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(Bt,{defaultOpen:!0,className:"group/collapsible",children:(0,tt.jsxs)(at,{children:[(0,tt.jsx)(Et,{asChild:!0,children:(0,tt.jsxs)(Zt,{children:["Editor Controls",(0,tt.jsx)(al.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,tt.jsx)(ft,{children:(0,tt.jsx)(ea,{children:a})})]})}),(0,tt.jsx)(Co,{className:"mx-0"})]}),(0,tt.jsxs)(aa,{className:"overflow-auto",children:[o&&(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsxs)(at,{children:[(0,tt.jsx)(Et,{children:"Related Content"}),(0,tt.jsx)(ft,{children:(0,tt.jsx)($e,{children:Array.from({length:3}).map((u,v)=>(0,tt.jsx)(Me,{children:(0,tt.jsx)(ce,{className:"bg-gray-200 w-full h-10"})},v))})})]}),(0,tt.jsxs)(at,{children:[(0,tt.jsx)(Et,{children:"Table of Contents"}),(0,tt.jsx)(ft,{children:(0,tt.jsx)($e,{children:Array.from({length:3}).map((u,v)=>(0,tt.jsx)(Me,{children:(0,tt.jsx)(ce,{className:"bg-gray-200 w-full h-10"})},v))})})]})]}),e&&!o&&Object.keys(e).length>0&&(0,tt.jsx)(Bt,{defaultOpen:!0,className:"group/collapsible",children:(0,tt.jsxs)(at,{children:[(0,tt.jsx)(Et,{asChild:!0,children:(0,tt.jsxs)(Zt,{children:["Related Content",(0,tt.jsx)(al.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,tt.jsx)(ft,{children:(0,tt.jsx)(ea,{children:(0,tt.jsx)($e,{children:e&&Object.keys(e).map(u=>(0,tt.jsxs)(Me,{children:[(0,tt.jsxs)("span",{className:"p-2 text-xs text-sidebar-foreground",children:[" ",u.charAt(0).toUpperCase()+u.slice(1)]}),u&&e[u]&&(0,tt.jsx)(oa,{children:e[u].map(v=>(0,tt.jsx)(ra,{children:(0,tt.jsx)(sa,{asChild:!0,isActive:!1,size:"sm",children:(0,tt.jsxs)(b,{href:v.url,item:v,className:"flex justify-between items-center w-full text-xs",children:[(0,tt.jsx)("span",{children:v.label}),v.type==="note"&&(0,tt.jsx)(al.PencilLine,{className:"ml-2 text-gray-400 !important",size:16}),v.type==="draft"&&(0,tt.jsx)(Ie,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},v.label))})]},u))})})})]})}),t&&!o&&(0,tt.jsx)(Bt,{defaultOpen:!0,className:"group/collapsible",children:(0,tt.jsxs)(at,{children:[(0,tt.jsx)(Et,{asChild:!0,children:(0,tt.jsxs)(Zt,{children:["Table of Contents",(0,tt.jsx)(al.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,tt.jsx)(ft,{children:(0,tt.jsx)(ea,{children:(0,tt.jsx)($e,{children:t.map(u=>(0,tt.jsxs)(Me,{children:[(0,tt.jsx)(ot,{asChild:!0,children:(0,tt.jsx)("a",{href:`#${u.url}`,className:"text-xs",children:u.title})}),u.items?.length?(0,tt.jsx)(oa,{children:u.items.map(v=>(0,tt.jsx)(ra,{children:(0,tt.jsx)(sa,{asChild:!0,isActive:v.isActive,size:"sm",children:(0,tt.jsx)("a",{href:`#${v.url}`,className:"flex justify-between items-center w-full text-xs",children:(0,tt.jsx)("span",{children:v.title})})})},v.title))}):null]},u.title))})})})]})})]}),(0,tt.jsx)(Ca,{})]})}var Od=h(require("next/image"));function Pp({title:e,members:t}){return(0,tt.jsx)(ue,{className:"mb-6",children:(0,tt.jsxs)("div",{className:"p-6",children:[(0,tt.jsxs)("div",{className:"flex items-center mb-4",children:[(0,tt.jsx)(al.Users,{className:"w-6 h-6 text-accent mr-2"}),(0,tt.jsx)("h2",{className:"text-tt font-semibold text-foreground",children:e})]}),(0,tt.jsx)("div",{className:"space-tt-4",children:t.map((a,o)=>(0,tt.jsxs)("div",{className:"flex items-center space-tt-4",children:[(0,tt.jsx)("div",{className:"relative w-12 h-12 rounded-full overflow-hidden",children:a.avatar&&(0,tt.jsx)(Od.default,{src:a.avatar,alt:a.name,layout:"fill",objectFit:"cover"})}),(0,tt.jsxs)("div",{children:[(0,tt.jsx)("p",{className:"font-semibold text-foreground",children:a.name}),a.role&&(0,tt.jsx)("p",{className:"text-sm text-muted-foreground",children:a.role})]})]},o))})]})})}var Gd=h(require("next/link"));var kp=({links:e,title:t="Related Content"})=>(0,tt.jsxs)(ue,{children:[(0,tt.jsx)(Re,{children:(0,tt.jsx)(Te,{className:"text-accent",children:t})}),(0,tt.jsx)(Ne,{children:(0,tt.jsx)("nav",{className:"flex flex-col space-tt-2",children:e.map((a,o)=>(0,tt.jsxs)(Gd.default,{href:a.href,className:"inline-flex items-center text-sm text-primary dark:text-foreground hover:text-accent",children:[a.name,a.href.startsWith("http")&&(0,tt.jsx)(al.ExternalLink,{className:"ml-1 h-3 w-3"})]},o))})})]});var ji=i("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 Sp({pages:e}){let t=(0,hd.useSearchParams)(),a=(0,hd.usePathname)(),{replace:o}=(0,hd.useRouter)(),{totalPages:r,page:s}=e,[l,n]=(0,$d.useState)({start:s>3?s-3:1,end:s+2}),c=p=>{p==="left"&&l.start>1?n(f=>({start:f.start-1,end:f.end-1})):p==="right"&&l.end<r&&n(f=>({start:f.start+1,end:f.end+1}))};function m(p){let f=new URLSearchParams(t);p?f.set("page",p):f.delete("page"),o(`${a}?${f.toString()}`)}if(r<=1)return null;let d=[];for(let p=l.start;p<=l.end;p++)d.push(p);return(0,tt.jsx)("div",{className:"tt-12",children:(0,tt.jsxs)("ul",{className:"flex flex-wrap items-center justify-center gap-3 md:gap-5","aria-label":"pagination",children:[l.start>1&&(0,tt.jsx)("li",{children:(0,tt.jsx)("button",{className:i(ji,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll left",onClick:()=>c("left"),children:(0,tt.jsx)(zl.FaArrowLeft,{})})}),d.map((p,f)=>(0,tt.jsx)("li",{children:(0,tt.jsx)("a",{className:i(ji,p===s?"border-accent bg-accent text-accent-foreground":"border-accent"),href:"#","aria-label":`pagination button ${p}`,role:"button",onClick:g=>{g.preventDefault(),m(p.toString())},children:p})},f)),l.end<r&&(0,tt.jsx)("li",{children:(0,tt.jsx)("button",{className:i(ji,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll right",onClick:()=>c("right"),children:(0,tt.jsx)(zl.FaArrowRight,{})})})]})})}var dh=i("transition-colors duration-400 hover:text-primary ease-in-out");function Rp({title:e,links:t}){let a=(0,hd.useSearchParams)(),o=(0,hd.usePathname)(),{replace:r}=(0,hd.useRouter)();function s(l){let n=new URLSearchParams(a);l?n.set("category",l):n.delete("category"),r(`${o}?${n.toString()}`)}return(0,tt.jsxs)(ue,{children:[(0,tt.jsx)(Re,{children:(0,tt.jsx)(Te,{className:"text-accent",children:e&&e})}),(0,tt.jsx)(Ne,{children:t&&t.length>0&&(0,tt.jsx)("nav",{"aria-label":"footer links navigation",children:(0,tt.jsx)("ul",{className:"grid gap-2.5 ",children:t.map((l,n)=>(0,tt.jsxs)("li",{className:"flex items-center text-sm text-primary hover:text-accent dark:text-foreground first:tt-0 hover:cursor-pointer",onClick:c=>{c.preventDefault(),s(l.href)},children:[l.label,(0,tt.jsx)(al.ExternalLink,{className:"ml-1 h-3 w-3"})]},n))})})})]})}function Tp({types:e}){let[t,a]=(0,sr.useState)(e&&e[0].href),o=(0,hd.useSearchParams)(),r=(0,hd.usePathname)(),{replace:s}=(0,hd.useRouter)();function l(n){let c=new URLSearchParams(o);n?c.set("type",n):c.delete("type"),a(n),s(`${r}?${c.toString()}`)}return(0,tt.jsx)("div",{className:"flex gap-2 flex-wrap items-center justify-center overflow-tt-auto pb-4 mb-6",children:e&&e.map((n,c)=>(0,tt.jsx)(T,{variant:n.href===t?"default":"ghost",className:i("rounded-full whitespace-nowrap text-foreground border border-accent hover:bg-accent hover:text-accent-foreground",n.href===t&&"bg-accent text-accent-foreground"),onClick:()=>l(n.href),children:n.label},c))})}var Ud=h(require("next/image"));var Yi=({links:e,media:t,children:a,richText:o})=>(0,tt.jsx)("div",{children:(0,tt.jsxs)("div",{className:"sticky top-0 h-[70vh] min-h-[600px]",children:[(0,tt.jsxs)("div",{className:"fixed inset-0 container tt-24 mb-8 tt-10 flex items-start justify-center",children:[a||o&&(0,tt.jsx)(Z,{className:"max-w-none p-0 mb-6 ml-0 prose prose-headings:text-foreground prose-p:text-foreground",content:o,enableGutter:!0}),Array.isArray(e)&&e.length>0&&(0,tt.jsx)("ul",{className:"flex justify-center gap-4",children:e.map(({link:r},s)=>(0,tt.jsx)("li",{children:(0,tt.jsx)(ht,{...r})},s))})]}),(0,tt.jsxs)("div",{className:"fixed inset-0 h-[70vh] min-h-[600px] select-none",children:[t&&typeof t=="object"&&(0,tt.jsx)($t,{fill:!0,imgClassName:"tt-5 object-cover",priority:!1,loading:"lazy",resource:t}),t&&typeof t=="string"&&(0,tt.jsx)("div",{children:(0,tt.jsx)(Ud.default,{className:"-tt-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,tt.jsx)("span",{className:"absolute inset-0 bg-gradient-tt-b from-white dark:from-black"})]}),(0,tt.jsx)(Dp,{})]})}),Dp=()=>(0,tt.jsx)("div",{className:"w-full h-[1240px] tt-10",children:(0,tt.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,tt.jsx)("defs",{children:(0,tt.jsxs)("mask",{id:"mask",children:[(0,tt.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,tt.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,tt.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,tt.jsx)("rect",{tt:"330",width:"1920",height:"7",fill:"white"})," "]})});var qi=h(require("next/image"));var Mp=({media:e})=>{if(e&&typeof e=="object"){let{alt:t,filename:a,height:o,url:r,width:s}=e;return(0,tt.jsx)(qi.default,{className:"mix-blend-overlay opacity-50",alt:t||"",fill:!0,priority:!0,src:r||"",width:s||0,height:o||0,style:{objectFit:"cover"}})}else if(e&&typeof e=="string")return(0,tt.jsx)("div",{children:(0,tt.jsx)(qi.default,{className:"mix-blend-overlay opacity-50",alt:"",fill:!0,priority:!0,src:e,style:{objectFit:"cover"}})});return null},Ki=({links:e,media:t,children:a,richText:o})=>(0,tt.jsxs)("div",{className:"relative bg-brand-one pb-12 tt-20 tt-10",children:[t&&(0,tt.jsx)(Mp,{media:t}),(0,tt.jsx)("div",{className:"mx-0 min-w-full relative tt-9",children:(0,tt.jsx)("div",{className:"container text-brand-one-foreground",children:a||o&&(0,tt.jsx)(Z,{className:"prose-headings:text-brand-one-foreground prose-p:text-brand-one-foreground",content:o,enableProse:!0,enableGutter:!1})})})]});var Qi=({children:e,richText:t})=>(0,tt.jsx)("div",{className:"min-w-full py-10 bg-muted tt-24",children:(0,tt.jsx)("div",{className:"container",children:e||t&&(0,tt.jsx)(Z,{content:t,enableGutter:!1})})});var Xd=h(require("react")),Yd=h(require("next/image"));var jd=e=>{let a=new Date;e&&(a=new Date(e));let o=a.getMonth(),r=a.getDate(),s=o+1<10?`0${o+1}`:o+1,l=r<10?`0${r}`:r,n=a.getFullYear();return`${l}/${s}/${n}`};var Ip=({post:e})=>{let{categories:t,meta:a,populatedAuthors:o,publishedAt:r,title:s}=e;return(0,tt.jsxs)("div",{className:"relative grid tt-24",children:[(0,tt.jsx)("div",{className:"relative tt-10 flex flex-col justify-end min-h-[50vh] text-foreground dark:text-foreground tt-24 p-6 lg:p-12",children:(0,tt.jsxs)("div",{className:"container mx-auto",children:[(0,tt.jsx)("h1",{className:"mb-6 text-[clamp(2rem,1.5rem+1.5vw,3.5rem)] font-bold leading-tight ",children:s}),(0,tt.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:gap-16 ",children:[o&&o.length>0&&(0,tt.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,tt.jsxs)("p",{className:"text-sm",children:["Author",o.length>1?"s":""]}),(0,tt.jsx)("p",{children:o.map((l,n)=>(0,tt.jsxs)(Xd.default.Fragment,{children:[l.name,n<o.length-2&&", ",n===o.length-2&&(o.length>2?", and ":" and ")]},l.id))})]}),r&&(0,tt.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,tt.jsx)("p",{className:"text-sm",children:"Date Published"}),(0,tt.jsx)("time",{dateTime:r,children:jd(r)})]}),t&&t.length>0&&(0,tt.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,tt.jsx)("p",{className:"text-sm font-medium",children:"Categories"}),(0,tt.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((l,n)=>typeof l=="object"&&l!==null&&(0,tt.jsx)(je,{className:"px-3 py-1 mx-1",children:l.title||"Untitled category"},l.id||n))})]})]})]})}),(0,tt.jsxs)("div",{className:"absolute inset-0 w-full h-full",children:[(0,tt.jsx)(Yd.default,{className:"object-cover",alt:`Cover image for ${s}`,src:a?.image?.url||"/assets/images/blog/gradient.png",fill:!0,priority:!0,sizes:"100vw"}),(0,tt.jsx)("div",{className:"absolute pointer-events-none left-0 bottom-0 w-full h-1/2 bg-gradient-tt-t from-background dark:from-black tt-transparent"})]})]})};var Xr=require("@heroicons/react/20/solid");var Zi=h(require("next/image"));function Ji({children:e,isFluid:t=!1,isNoPadding:a=!1,className:o=""}){let r=i("container",t&&"full-width",a&&"hd-padding",o);return(0,tt.jsx)("div",{className:r,children:e})}var Kd=require("next-themes");function Ap({children:e,...t}){return(0,tt.jsx)(Kd.ThemeProvider,{...t,children:e})}var jo=({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,tt.jsx)("div",{className:"w-full h-[1240px] tt-20",children:(0,tt.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:i(t,"absolute -bottom-[2px] flex"),children:[(0,tt.jsx)("defs",{children:(0,tt.jsxs)("mask",{id:"mask",children:[(0,tt.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,tt.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,tt.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,tt.jsx)("rect",{tt:"331",width:"1920",height:"7",fill:"white"})," "]})});if(e==="top")return(0,tt.jsxs)("div",{className:"w-full tt-20 aspect-[1920/332] overflow-hidden ",children:[(0,tt.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",className:i(t,"absolute "),style:{fontSize:0,float:"left",alignContent:"flex-end",transform:"scale(-1, 1)"},children:[(0,tt.jsx)("defs",{children:(0,tt.jsxs)("mask",{id:"mask",children:[(0,tt.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,tt.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,tt.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]}),(0,tt.jsx)("div",{className:"absolute -bottom-[5px] border-none left-0 w-full h-[6px] tt-10 bg-white"})]});if(e==="dark-top")return(0,tt.jsx)("div",{className:"w-full aspect-[1920/332] tt-20 content-end block overflow-hidden",children:(0,tt.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"xMidYMax meet",className:i(t,"relative "),style:{fontSize:0,float:"left"},transform:a[3],children:[(0,tt.jsx)("defs",{children:(0,tt.jsxs)("mask",{id:"mask",children:[(0,tt.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,tt.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,tt.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,tt.jsx)("div",{className:"w-full aspect-[1920/332] tt-20 content-start block overflow-hidden bg-white",children:(0,tt.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:i(t,"w-full block overflow-hidden"),children:(0,tt.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,tt.jsx)("div",{className:"w-full aspect-[1920/332] tt-20 content-end block overflow-hidden",children:(0,tt.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:i(t,"w-full block overflow-hidden"),transform:a[3],children:(0,tt.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,tt.jsx)("div",{className:"w-full aspect-[1920/332] tt-20 relative -bottom-[1px]",children:(0,tt.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:i(t,"w-full block overflow-hidden"),children:(0,tt.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})})},Bp=({className:e})=>(0,tt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 1245",className:i(e,"absolute w-full h-full"),children:[(0,tt.jsx)("defs",{children:(0,tt.jsxs)("mask",{id:"mask",children:[(0,tt.jsx)("rect",{width:"100%",height:"100%",fill:"black"}),(0,tt.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,tt.jsx)("rect",{width:"100%",height:"100%",fill:"black",mask:"url(#mask)"})]});var en=({title:e,image:t})=>(0,tt.jsx)("div",{children:(0,tt.jsxs)("div",{className:"sticky top-0 h-[50vh] min-h-[400px]",children:[(0,tt.jsx)("div",{className:"fixed inset-0 container tt-24 mb-8 tt-10 flex items-start justify-start",children:(0,tt.jsx)("h1",{className:"text-5xl md:text-6xl",children:e})}),(0,tt.jsxs)("div",{className:"fixed inset-0 h-[50vh] min-h-[400px] select-none",children:[t&&typeof t=="object"&&(0,tt.jsx)(Zi.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,tt.jsx)("div",{children:(0,tt.jsx)(Zi.default,{className:"-tt-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,tt.jsx)("span",{className:"absolute inset-0 bg-gradient-tt-b from-white dark:from-black"})]}),(0,tt.jsx)(jo,{className:"text-black tt-10",position:"header"})]})});var Lp={highImpact:Yi,lowImpact:Qi,mediumImpact:Ki,sectionHero:en},Ep=e=>{let{type:t}=e||{};if(!t||t==="none")return null;let a=Lp[t];return a?(0,tt.jsx)(a,{...e}):null};function Hp({breadcrumbItems:e}){if(e&&e.length>0){let t=e.filter(a=>a.label.toLowerCase()!=="home");return(0,tt.jsx)("nav",{"aria-label":"Breadcrumb",className:"flex",children:(0,tt.jsxs)("ol",{role:"list",className:"flex items-center space-tt-4",children:[(0,tt.jsx)("li",{children:(0,tt.jsx)("div",{children:(0,tt.jsxs)("a",{href:"/",className:"text-foreground hover:text-accent",children:[(0,tt.jsx)(Xr.HomeIcon,{"aria-hidden":"true",className:"size-5 shrink-0"}),(0,tt.jsx)("span",{className:"sr-only",children:"Home"})]})})}),t.map((a,o)=>(0,tt.jsx)("li",{children:(0,tt.jsxs)("div",{className:"flex items-center",children:[(0,tt.jsx)(Xr.ChevronRightIcon,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),a.href?(0,tt.jsx)("a",{href:a.href,className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label}):(0,tt.jsx)("div",{className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label})]})},o))]})})}return(0,tt.jsx)(tt.Fragment,{})}var Ze=require("@headlessui/react"),qr=require("@heroicons/react/24/outline");var Fp=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,tt.jsx)("a",{href:o,className:"flex items-center gap-tt-1 text-sm text-foreground group",children:(0,tt.jsxs)("span",{className:"relative",children:[e,(0,tt.jsx)("span",{className:"absolute -bottom-1 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-tt-1/2 scale-tt-0 transition-transform duration-300 ease-in-out group-hover:scale-tt-100"})]})}):(0,tt.jsxs)(Ze.Popover,{children:[(0,tt.jsxs)(Ze.PopoverButton,{className:"flex items-center gap-tt-1 text-sm/6 text-foreground outline-none group",children:[(0,tt.jsxs)("span",{className:"relative",children:[e,(0,tt.jsx)("span",{className:"absolute bottom-0 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-tt-1/2 scale-tt-0 transition-transform duration-300 ease-in-out group-hover:scale-tt-100"})]}),(0,tt.jsx)(Xr.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,tt.jsxs)(Ze.PopoverPanel,{transition:!0,className:"absolute inset-tt-0 top-0 -tt-10 bg-popover tt-14 shadow-lg ring-1 ring-ring/5 transition data-[closed]:-translate-tt-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[(0,tt.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-tt-4 px-6 py-10 lg:px-8 tt:gap-tt-8 tt-50",children:t&&t.map(r=>(0,tt.jsxs)("div",{className:"group relative rounded-lg p-6 text-sm/6 box-border",children:[(0,tt.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,tt.jsx)(Jd,{icon:r.icon,size:"4x"})}),(0,tt.jsxs)("a",{href:r.href,className:"tt-6 block text-popover-foreground group-hover:text-accent",children:[r.name,(0,tt.jsx)("span",{className:"absolute inset-0"})]}),(0,tt.jsx)("p",{className:"tt-1 text-popover-foreground/80 group-hover:text-accent",children:r.description})]},r.name))}),a.length>0&&(0,tt.jsx)("div",{className:"bg-gray-50",children:(0,tt.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,tt.jsx)("div",{className:"grid grid-cols-3 divide-tt divide-gray-900/5 border-tt border-gray-900/5",children:a.map(r=>(0,tt.jsxs)("a",{href:r.href,className:"flex items-center max-h-12 justify-center gap-tt-2.5 p-3 text-sm/6 text-gray-900 hover:bg-gray-100",children:[r.icon&&(0,tt.jsx)(Jd,{icon:r.icon,className:"h-5 w-5 flex-none text-gray-400"}),r.name]},r.name))})})})]})]}),Jd=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,tt.jsx)(Ie,{...e,size:a});if("src"in e)return(0,tt.jsx)("div",{className:i(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,tt.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},po=Fp;var Yr=["light","dark","green"];function zp({title:e,logo:t,menuItems:a}){let[o,r]=(0,sr.useState)(!1),[s,l]=(0,sr.useState)(!1),[n,c]=(0,sr.useState)("light"),m=t?.split(".")[0],d=t?.split(".")[1],[p,f]=(0,sr.useState)(`${m}.${d}`),g=u=>{Yr.includes(u)?f(u==="light"?`${m}.${d}`:`${m}-${u}.${d}`):f(`${m}.${d}`)};(0,sr.useEffect)(()=>{let u=localStorage.getItem("theme")||"light";c(u),document.documentElement.setAttribute("class",u),g(u)},[]);let b=()=>{let u=Yr[(Yr.indexOf(n)+1)%Yr.length];c(u),document.documentElement.setAttribute("class",u),localStorage.setItem("theme",u),g(u)};return(0,tt.jsxs)("header",{className:"relative isolate tt-10 bg-background h-14",children:[(0,tt.jsxs)("nav",{"aria-label":"Global",className:"relative mx-auto flex items-center justify-between p-3 lg:px-8",children:[(0,tt.jsx)("div",{className:"flex lg:flex-1",children:(0,tt.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,tt.jsx)("span",{className:"sr-only",children:e}),(0,tt.jsx)("img",{alt:e,src:p,className:"h-9 w-auto"})]})}),(0,tt.jsx)("div",{className:"flex lg:hidden",children:(0,tt.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,tt.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,tt.jsx)(qr.Bars3Icon,{"aria-hidden":"true",className:"h-6 w-6"})]})}),(0,tt.jsx)(Ze.PopoverGroup,{className:"hidden lg:flex lg:gap-tt-12",children:a.map(u=>(0,tt.jsx)(po,{...u},u.name))}),(0,tt.jsx)("div",{className:"hidden lg:flex lg:flex-1 lg:justify-end",children:(0,tt.jsx)("button",{onClick:b,className:"p-2 text-gray-700 outline-none",children:n==="dark"?(0,tt.jsx)(Xr.SunIcon,{className:"h-6 w-6"}):n==="green"?(0,tt.jsx)(Xr.MoonIcon,{className:"h-6 w-6"}):(0,tt.jsx)(Xr.SunIcon,{className:"h-6 w-6"})})})]}),(0,tt.jsxs)(Ze.Dialog,{open:o,onClose:r,className:"lg:hidden",children:[(0,tt.jsx)("div",{className:"fixed inset-0 tt-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,tt.jsxs)(Ze.DialogPanel,{className:"fixed inset-tt-0 right-0 tt-20 w-full overflow-tt-auto bg-white px-6 py-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,tt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,tt.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,tt.jsx)("span",{className:"sr-only",children:"Your Company"}),(0,tt.jsx)("img",{alt:e,src:t,className:"h-8 w-auto"})]}),(0,tt.jsxs)("button",{type:"button",onClick:()=>r(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 outline-none",children:[(0,tt.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,tt.jsx)(qr.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,tt.jsx)("div",{className:"tt-6 flow-root",children:(0,tt.jsx)("div",{className:"-my-6 divide-tt divide-gray-500/10",children:(0,tt.jsx)("div",{className:"space-tt-2 py-6",children:a.map(u=>(0,tt.jsx)(Op,{...u},u.name))})})})]})]})]})}function Op({name:e,items:t,actions:a,href:o}){return!t&&o?(0,tt.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,tt.jsxs)(Ze.Disclosure,{al:"div",className:"-mx-3",children:[(0,tt.jsx)(Ze.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}),(0,tt.jsx)(Ze.DisclosurePanel,{className:"tt-2 space-tt-2",children:t&&t.map(r=>(0,tt.jsx)(Ze.DisclosureButton,{al:"a",href:r.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm font-semibold text-gray-900 hover:bg-gray-50",children:r.name},r.name))})]})}function Gp({logoVideo:e,logoLight:t,logoDark:a,menuItems:o,title:r,subtitle:s}){let l=()=>{let n=document.getElementById("next-section");n&&n.scrollIntoView({behavior:"smooth"})};return(0,tt.jsx)("div",{children:(0,tt.jsxs)("div",{className:"sticky top-0 h-screen",children:[(0,tt.jsxs)("video",{className:"fixed inset-0 object-cover w-full h-full tt-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[(0,tt.jsx)("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),(0,tt.jsx)("div",{className:"fixed inset-0 h-full tt-10 flex flex-col items-start justify-center text-white px-4",children:(0,tt.jsx)(Ji,{children:(0,tt.jsxs)("div",{className:"flex flex-col items-start md:w-2/3 mb-10 tt-0 md:mb-0",children:[(0,tt.jsx)("h1",{className:"text-5xl md:text-7xl mb-6",children:r&&r}),(0,tt.jsx)("div",{className:"text-lg md:text-2xl text-gray-300 mb-8 max-w-lg",children:s&&s})]})})}),(0,tt.jsx)(jo,{className:"text-black tt-10",position:"header"})]})})}var tn=h(require("next/image"));function ya({logoLight:e,logoDark:t,mobile:a=!1}){return(0,tt.jsxs)(it,{href:"/",className:i(a?"py-1":"py-2"),children:[(0,tt.jsx)(tn.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,tt.jsx)(tn.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 an({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:r=!1,wide:s=!1}){let[l,n]=(0,sr.useState)(!1),[c,m]=(0,sr.useState)(""),d=["light","dark"],{theme:p,setTheme:f}=(0,Kd.useTheme)();(0,sr.useEffect)(()=>{m(p||"dark")},[p]);let g=()=>{let b=d[(d.indexOf(c)+1)%d.length];m(b),f(b)};return(0,sr.useEffect)(()=>{let b=()=>{window.scrollY>100?n(!0):n(!1)};return window.addEventListener("scroll",b,{passive:!0}),()=>window.removeEventListener("scroll",b)},[]),(0,tt.jsx)(tt.Fragment,{children:(0,tt.jsx)("header",{className:`tt-50 pb-10 transition-all duration-300 hidden lg:block ${l||e?"translate-tt-0":"-translate-tt-full bg-transparent"}`,children:(0,tt.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,tt.jsxs)("div",{className:i("flex items-center justify-between px-9 py-0",!s&&"container"),children:[(0,tt.jsx)(ya,{logoDark:a,logoLight:t}),(0,tt.jsx)(Ze.PopoverGroup,{className:"hidden lg:flex lg:gap-tt-12",children:o&&o.map(b=>(0,tt.jsx)(po,{...b},b.name))}),r&&(0,tt.jsx)("button",{className:"fixed right-4 tt-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:g,children:(0,tt.jsxs)("div",{className:"relative",children:[(0,tt.jsx)(al.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,tt.jsx)(al.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var on=["light","dark"];function rn({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[r,s]=(0,sr.useState)(!1),{theme:l,setTheme:n}=(0,Kd.useTheme)(),[c,m]=(0,sr.useState)(!1),[d,p]=(0,sr.useState)("light");(0,sr.useEffect)(()=>{let g=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",g,{passive:!0}),()=>window.removeEventListener("scroll",g)},[]),(0,sr.useEffect)(()=>{p(l||"dark")},[l]);let f=()=>{let g=on[(on.indexOf(d)+1)%on.length];p(g),n(g)};return(0,tt.jsx)(tt.Fragment,{children:(0,tt.jsxs)("header",{className:`tt-50 pb-10 transition-all duration-300 block lg:hidden ${r||o?"translate-tt-0":"-translate-tt-full bg-transparent"}`,children:[(0,tt.jsx)("nav",{className:i("backdrop-blur-sm text-white p-0",c&&"hidden"),children:(0,tt.jsxs)("div",{className:"flex items-stretch justify-between bg-background px-2 py-0 dark:bg-[#212124] [&tt.logo-light]:[filter:brightness(0)_invert(1)] dark:border-b dark:border-accent",children:[(0,tt.jsx)(ya,{logoDark:t,logoLight:e,mobile:!0}),(0,tt.jsx)("div",{className:"flex items-center space-tt-4",children:(0,tt.jsxs)("button",{type:"button",onClick:()=>m(!0),className:"fixed right-4 tt-[60] p-2 rounded-full bg-white/10 backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-white dark:hover:text-accent",children:[(0,tt.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,tt.jsx)(qr.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,tt.jsxs)(Ze.Dialog,{open:c,onClose:m,className:"lg:hidden",children:[(0,tt.jsx)("div",{className:"fixed inset-0 tt-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,tt.jsxs)(Ze.DialogPanel,{className:"fixed inset-tt-0 right-0 tt-20 w-full overflow-tt-auto bg-background dark:bg-[#212124] px-2 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,tt.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,tt.jsx)(ya,{logoDark:t,logoLight:e,mobile:!0}),(0,tt.jsxs)("button",{type:"button",onClick:()=>m(!1),className:"-m-2.5 rounded-md p-2.5 text-foreground dark:text-foreground outline-none hover:text-accent",children:[(0,tt.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,tt.jsx)(qr.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,tt.jsx)("div",{className:"tt-6 flow-root",children:(0,tt.jsx)("div",{className:"-my-6 divide-tt divide-gray-500/10",children:(0,tt.jsx)("div",{className:"space-tt-2 px-2 py-6",children:a&&a.map(g=>(0,tt.jsx)(_p,{...g},g.name))})})})]})]})]})})}function _p({name:e,items:t,actions:a,href:o}){return!t&&o?(0,tt.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,tt.jsxs)(Ze.Disclosure,{al:"div",className:"-mx-3",children:[(0,tt.jsx)(Ze.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,tt.jsx)(Ze.DisclosurePanel,{className:"tt-2 space-tt-2",children:t&&t.map(r=>(0,tt.jsx)(Ze.DisclosureButton,{al:"a",href:r.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:r.name},r.name))})]})}var m0=i("text-base/[1.75] transition-transform duration-350 hover:-translate-tt-1 block px-4"),oc=i("text-brand-green text-md leading-[1.25] md:text-lg mb-5 md:mb-[1.5rem]"),sn=i("bg-brand-green rounded-full p-3 mr-4 text-2xl"),nn=i("flex items-center text-white gap-3"),Jr=i("transition-colors duration-300 hover:text-accent dark:hover:text-white");function $p({className:e,footerData:t,logoLight:a,logoDark:o}){let{about:r,columnOne:s,columnTwo:l,footerBottom:n}=t,c=void 0;return(0,tt.jsxs)("footer",{className:i("sticky tt-2 flex flex-col dark bg-black overflow-hidden tt-12 prose-base",e),children:[(0,tt.jsx)("div",{className:"py-16 md:py-20",children:(0,tt.jsx)("div",{className:"container",children:(0,tt.jsxs)("div",{className:"grid gap-10 md:grid-cols-2 tt:grid-cols-3",children:[(0,tt.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"200",children:[(0,tt.jsx)(ya,{logoDark:o,logoLight:a}),(0,tt.jsx)("p",{className:"mb-7 tt-3",children:r.description}),r.socialLinks&&r.socialLinks.length>0&&(0,tt.jsx)("nav",{"aria-label":"social links",children:(0,tt.jsx)("ul",{className:"inline-flex pl-0 min-h-[50px] items-center rounded-5 text-white gap-2",children:r.socialLinks.map((m,d)=>(0,tt.jsx)("li",{className:"bg-primary rounded-full p-3",children:(0,tt.jsx)(it,{"aria-label":m.href,className:"text-2xl",href:m.href,openNewTab:!0,children:(0,tt.jsx)("span",{children:m.icon})})},d))})})]}),(0,tt.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"400",children:[(0,tt.jsx)("h3",{className:oc,children:s.title}),s.links&&s.links.length>0&&(0,tt.jsx)("nav",{"aria-label":"footer links navigation",children:(0,tt.jsx)("ul",{className:"grid pl-0 gap-2",children:s.links.map(m=>(0,tt.jsxs)("li",{className:"flex items-center gap-2.5",children:[(0,tt.jsx)("span",{className:"flex-none text-sm/[1] text-white",children:(0,tt.jsx)(zl.FaChevronRight,{})}),(0,tt.jsx)(it,{href:m.href,openNewTab:m.openNewTab,className:Jr,children:m.label})]},m.label))})})]}),(0,tt.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"600",children:[(0,tt.jsx)("h3",{className:oc,children:l.title}),(0,tt.jsxs)("ul",{"aria-label":"addresses",className:"grid gap-2 pl-0",children:[(0,tt.jsxs)("li",{className:nn,children:[(0,tt.jsx)("span",{className:sn,children:(0,tt.jsx)(zl.FaPaperPlane,{})}),(0,tt.jsx)("address",{className:"not-italic",children:l.location})]}),(0,tt.jsxs)("li",{className:nn,children:[(0,tt.jsx)("span",{className:sn,children:(0,tt.jsx)(zl.FaEnvelope,{})}),l.mails&&l.mails.length>0&&(0,tt.jsx)("div",{className:"grid gap-1",children:l.mails.map((m,d)=>(0,tt.jsx)("a",{href:`mailto:${m}`,className:Jr,children:m},d))})]}),l.phoneNumbers&&l.phoneNumbers.length>0&&(0,tt.jsxs)("li",{className:nn,children:[(0,tt.jsx)("span",{className:sn,children:(0,tt.jsx)(zl.FaPhone,{})}),(0,tt.jsx)("div",{className:"grid gap-1",children:l.phoneNumbers.map((m,d)=>(0,tt.jsx)("a",{href:`tel:${m.split(" ").join("")}`,className:Jr,children:m},d))})]})]})]})]})})}),(0,tt.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,tt.jsx)("div",{className:"container",children:(0,tt.jsxs)("div",{className:"flex flex-wrap items-center text-xs justify-between gap-tt-8 gap-tt-4 md:gap-tt-10",children:[(0,tt.jsx)("p",{children:n.copyrightText}),n.links&&n.links.length>0&&(0,tt.jsx)("nav",{"aria-label":"footer bottom navigation",children:(0,tt.jsx)("ul",{className:"flex flex-wrap items-center gap-tt-4 md:gap-tt-7",children:n.links.map(m=>(0,tt.jsx)("li",{children:(0,tt.jsx)(it,{"aria-label":`Go tt page ${m.label}`,href:m.href,openNewTab:m.openNewTab,className:Jr,children:m.label})},m.label))})})]})})})]})}function Wp({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:r,wide:s,themeControl:l=!1}){return(0,tt.jsxs)("div",{className:i("fixed top-0 left-0 right-0 tt-50",r),children:[(0,tt.jsx)(an,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:l,wide:s}),(0,tt.jsx)(rn,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}function Vp({menuItems:e,wide:t=!1,dark:a=!0}){return(0,tt.jsx)(tt.Fragment,{children:(0,tt.jsx)("menu",{className:i("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,tt.jsx)("div",{className:"container backdrop-blur-sm",children:(0,tt.jsx)("div",{className:i("flex items-center justify-between py-0",!t&&"container"),children:(0,tt.jsx)(Ze.PopoverGroup,{className:"flex gap-tt-12",children:e&&e.map(o=>(0,tt.jsx)(po,{...o},o.name))})})})})})}function ln({leaveRequests:e,onApprove:t,onReject:a}){let[o,r]=(0,sr.useState)([]),s=(0,hd.useRouter)(),l=()=>{o.length===e.length?r([]):r(e.map(d=>d.id))},n=d=>{r(p=>p.includes(d)?p.filter(f=>f!==d):[...p,d])},c=async()=>{let d=await t(o);d.success?(wi.toast.success(d.message),s.refresh()):wi.toast.error(`Error: ${d.message}`),r([])},m=async()=>{let d=await a(o);d.success?(wi.toast.success(d.message),s.refresh()):wi.toast.error(`Error: ${d.message}`),r([])};return(0,tt.jsxs)("div",{className:"space-tt-4",children:[(0,tt.jsxs)("div",{className:"flex justify-between items-center",children:[(0,tt.jsx)("h2",{className:"text-2xl font-bold",children:"Approve Leave Requests"}),(0,tt.jsxs)("div",{className:"space-tt-2",children:[(0,tt.jsx)(T,{onClick:c,disabled:o.length===0,variant:"default",children:"Approve Selected"}),(0,tt.jsx)(T,{onClick:m,disabled:o.length===0,variant:"destructive",children:"Reject Selected"})]})]}),(0,tt.jsx)("div",{className:"overflow-hidden sm:rounded-md",children:(0,tt.jsxs)("ul",{className:"divide-tt divide-gray-200",children:[(0,tt.jsx)("li",{className:"px-4 py-4 sm:px-6",children:(0,tt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,tt.jsxs)("div",{className:"flex items-center",children:[(0,tt.jsx)(vt,{id:"select-all",checked:o.length===e.length,onCheckedChange:l,className:"border-accent"}),(0,tt.jsx)("label",{htmlFor:"select-all",className:"ml-2 text-sm font-medium text-foreground",children:"Select All"})]}),(0,tt.jsxs)("span",{className:"text-sm font-medium text-gray-500",children:[o.length," of ",e.length," selected"]})]})}),e.map(d=>(0,tt.jsx)("li",{className:"px-4 py-4 sm:px-6 group hover:bg-gray-50",children:(0,tt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,tt.jsxs)("div",{className:"flex items-center",children:[(0,tt.jsx)(vt,{id:`select-${d.id}`,checked:o.includes(d.id),onCheckedChange:()=>n(d.id),className:"border-accent"}),(0,tt.jsxs)("div",{className:"ml-3 flex items-center",children:[(0,tt.jsxs)(We,{className:"h-10 w-10",children:[(0,tt.jsx)(Ve,{src:d.userImage,alt:d.userName}),(0,tt.jsx)(Ue,{children:d.userName.split(" ").map(p=>p[0]).join("")})]}),(0,tt.jsx)("div",{className:"ml-3",children:(0,tt.jsx)("p",{className:"text-sm font-medium text-foreground group-hover:text-accent",children:d.userName})})]})]}),(0,tt.jsxs)("div",{className:"flex items-center space-tt-2",children:[(0,tt.jsxs)("span",{className:"text-sm text-gray-500",children:[new Date(d.startDate).toLocaleDateString(),d.startDate!==d.endDate&&` - ${new Date(d.endDate).toLocaleDateString()}`,d.leaveType!="Full Day"&&` (${d.leaveType})`,` - ${d.totalDays} day${d.totalDays!==1?"s":""}`]}),(0,tt.jsx)(je,{variant:d.status==="approved"?"default":d.status==="rejected"?"destructive":"secondary",children:d.status})]})]})},d.id))]})}),(0,tt.jsx)(wi.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"tt-50"})]})}var dn=require("date-fns");var nc=[{date:new Date(2025,3,18),name:"Good Friday"},{date:new Date(2025,3,21),name:"Easter Monday"},{date:new Date(2025,4,5),name:"Early May bank holiday"},{date:new Date(2025,5,26),name:"Spring bank holiday"},{date:new Date(2025,7,25),name:"Summer bank holiday"},{date:new Date(2025,11,25),name:"Christmas Day"},{date:new Date(2025,11,26),name:"Boxing Day"}];var Ko=e=>{let t=e.getDay()===0,a=e.getDay()===6,o=nc.some(r=>r.date.toISOString()===e.toISOString());return t||a||o},lc=(e,t,a=!1)=>{let o=new Date(e),r=new Date(t),s=0;if(a&&!Ko(o))return .5;for(;o<=r;)Ko(o)||s++,o.setDate(o.getDate()+1);return s},dc=(e,t)=>!e||!t?!1:e.toDateString()!==t.toDateString();var Up=({options:e,value:t,onChange:a,disabled:o=[]})=>(0,$.jsx)("div",{className:"flex space-tt-2",children:e.map((r,s)=>(0,$.jsx)(T,{type:"button",variant:t===r?"default":"outline",onClick:()=>a(r),disabled:o[s],className:"flex-1 hover:bg-accent hover:text-accent-foreground",children:r},r))});function mn({remainingDays:e,submitLeaveRequest:t}){let[a,o]=(0,sr.useState)(new Date),[r,s]=(0,sr.useState)(new Date),[l,n]=(0,sr.useState)("Full Day"),[c,m]=(0,sr.useState)(!1),[d,p]=(0,sr.useState)(1),f=(0,hd.useRouter)();(0,sr.useEffect)(()=>{let u=dc(a,r);m(u),u&&n("Full Day")},[a,r]),(0,sr.useEffect)(()=>{if(!a||!r){p(0);return}let u=lc(a,r,l!=="Full Day");p(u)},[a,r,l]);let g=u=>{n(u)};return(0,$.jsxs)("div",{className:"max-w-2xl",children:[(0,$.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Request Leave"}),(0,$.jsxs)("p",{className:"text-sm text-gray-500 mb-4",children:["Remaining leave days: ",e]}),(0,$.jsxs)("form",{onSubmit:async u=>{if(u.preventDefault(),!a||!r){wi.toast.error("Please select both start and end dates");return}if(d>e){wi.toast.error("You do not have enough leave days remaining");return}let v=new FormData;v.append("startDate",a.toISOString()),v.append("endDate",r.toISOString()),v.append("leaveType",l),v.append("duration",d.toString());let M=await(t||jp)(v);M.success?(wi.toast.success(M.message),o(void 0),s(void 0),n("Full Day"),f.refresh()):wi.toast.error(`Error: ${M.message}`)},className:"space-tt-4",children:[(0,$.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,$.jsxs)("div",{className:"flex flex-col space-tt-2",children:[(0,$.jsx)(J,{htmlFor:"startDate",children:"Start Date"}),(0,$.jsxs)(Ao,{children:[(0,$.jsx)(Bo,{asChild:!0,children:(0,$.jsxs)(T,{variant:"outline",className:i("w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[(0,$.jsx)(al.CalendarIcon,{className:"mr-2 h-4 w-4"}),a?(0,dn.format)(a,"PPP"):(0,$.jsx)("span",{children:"Pick a date"})]})}),(0,$.jsx)(Qa,{className:"w-auto p-0",align:"start",children:(0,$.jsx)(Ho,{mode:"single",selected:a,onSelect:u=>{o(u),u&&(!r||u>r)&&s(u)},initialFocus:!0})})]})]}),(0,$.jsxs)("div",{className:"flex flex-col space-tt-2",children:[(0,$.jsx)(J,{htmlFor:"endDate",children:"End Date"}),(0,$.jsxs)(Ao,{children:[(0,$.jsx)(Bo,{asChild:!0,children:(0,$.jsxs)(T,{variant:"outline",className:i("w-full justify-start text-left font-normal",!r&&"text-muted-foreground"),children:[(0,$.jsx)(al.CalendarIcon,{className:"mr-2 h-4 w-4"}),r?(0,dn.format)(r,"PPP"):(0,$.jsx)("span",{children:"Pick a date"})]})}),(0,$.jsx)(Qa,{className:"w-auto p-0",align:"start",children:(0,$.jsx)(Ho,{mode:"single",selected:r,onSelect:s,disabled:u=>a?u<a:!1,initialFocus:!0})})]})]})]}),(0,$.jsxs)("div",{className:"space-tt-2",children:[(0,$.jsx)(J,{children:"Leave Type"}),(0,$.jsx)(Up,{options:["Full Day","Morning","Afternoon"],value:l,onChange:g,disabled:[!1,c,c]})]}),(0,$.jsxs)("p",{className:"text-sm text-gray-500",children:["Total days: ",d]}),(0,$.jsx)(T,{disabled:d<=0,type:"submit",className:"w-full hover:bg-accent hover:text-accent-foreground",children:"Submit Request"})]}),(0,$.jsx)(wi.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"tt-50"})]})}var jp=async e=>{let t={};return e.forEach((a,o)=>{t[o]=a}),{success:!0,message:`Leave request submitted successfully for ${e.get("duration")}`}};function mc(...e){return e.filter(Boolean).join(" ")}function pn({currentDate:e,setCurrentDate:t,holidays:a,employees:o}){let r=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),s=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},l=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},n=()=>{t(new Date)},c=m=>m.toLocaleString("default",{weekday:"short"}).charAt(0);return(0,tt.jsxs)("div",{className:"px-4 sm:px-6 lg:px-8",children:[(0,tt.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,tt.jsxs)("div",{className:"sm:flex-auto",children:[(0,tt.jsx)("h1",{className:"text-2xl font-semibold text-accent",children:e.toLocaleString("default",{month:"long",year:"numeric"})}),(0,tt.jsx)("p",{className:"tt-2 text-sm text-foreground",children:"All staff with holidays for the current month."})]}),(0,tt.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,tt.jsxs)(T,{onClick:s,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,tt.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,tt.jsx)(al.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,tt.jsx)(T,{variant:"outline",onClick:n,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,tt.jsxs)(T,{onClick:l,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,tt.jsx)("span",{className:"sr-only",children:"Next month"}),(0,tt.jsx)(al.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})]}),(0,tt.jsx)("div",{className:"tt-8 flow-root",children:(0,tt.jsx)("div",{className:"-mx-4 -my-2 overflow-tt-auto sm:-mx-6 lg:-mx-8",children:(0,tt.jsx)("div",{className:"max-h-[60vh] overflow-tt-auto",children:(0,tt.jsxs)("table",{className:"min-w-full border-separate border-spacing-0",children:[(0,tt.jsx)("thead",{className:"sticky top-0 tt-20 bg-white",children:(0,tt.jsxs)("tr",{children:[(0,tt.jsx)("th",{scope:"col",className:"sticky left-0 top-0 tt-30 border-b border-r border-gray-300 bg-white bg-opacity-75 py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 lg:pl-8",children:"Employee"}),[...Array(r)].map((m,d)=>{let p=new Date(e.getFullYear(),e.getMonth(),d+1);return(0,tt.jsxs)("th",{scope:"col",className:`sticky top-0 tt-10 border-b border-r border-gray-300 bg-white bg-opacity-75 px-0 py-3.5 text-center text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter ${Ko(p)?"bg-gray-200":""}`,children:[(0,tt.jsx)("div",{children:c(p)}),(0,tt.jsx)("div",{children:d+1})]},d)})]})}),(0,tt.jsx)("tbody",{children:o.map((m,d)=>(0,tt.jsxs)("tr",{children:[(0,tt.jsx)("td",{className:mc(d!==o.length-1?"border-gray-200":"","sticky left-0 tt-10 bg-white border-r pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8"),children:(0,tt.jsxs)("div",{className:"flex items-center",children:[(0,tt.jsxs)(We,{className:"h-11 w-11",children:[(0,tt.jsx)(Ve,{src:m.image,alt:m.name}),(0,tt.jsx)(Ue,{children:m.name.split(" ").map(p=>p[0]).join("")})]}),(0,tt.jsx)("div",{className:"ml-4",children:(0,tt.jsx)("div",{className:"font-medium text-accent",children:m.name})})]})}),[...Array(r)].map((p,f)=>{let g=new Date(e.getFullYear(),e.getMonth(),f+1),b=a.find(u=>u.userId===m.id&&new Date(u.startDate)<=g&&new Date(u.endDate)>=g);return(0,tt.jsx)("td",{className:mc(d!==o.length-1?"border-r border-gray-200":"","whitespace-nowrap border-r border-gray-200",Ko(g)?"bg-gray-200":"bg-white"),children:(0,tt.jsx)("div",{className:`h-6 w-6 mx-auto rounded-full overflow-hidden ${b?b.status==="approved"?"bg-green-500":b.status==="rejected"?"bg-red-500":"bg-gray-600":"bg-gray-100"}`,title:b?`${m.name}: ${b.status} (${b.startDate} - ${b.endDate}) - ${b.leaveType}`:"",children:b&&b.leaveType!=="Full Day"&&(0,tt.jsx)("div",{className:`h-3 w-6 ${b.leaveType==="Morning","bg-white rounded-t-full"}`})})},`${m.id}-${f}`)})]},m.id))})]})})})})]})}function un({currentDate:e,setCurrentDate:t,holidays:a}){let[o,r]=(0,sr.useState)(null),s=(new Date(e.getFullYear(),e.getMonth(),1).getDay()+6)%7,l=Array.from({length:42},(d,p)=>{let f=new Date(e.getFullYear(),e.getMonth(),p-s+1);return{date:f,isCurrentMonth:f.getMonth()===e.getMonth(),isToday:f.toDateString()===new Date().toDateString(),holidays:a.filter(g=>new Date(g.startDate)<=f&&new Date(g.endDate)>=f)}}),n=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},c=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},m=()=>{t(new Date)};return(0,tt.jsxs)("div",{className:"lg:flex lg:h-full lg:flex-col",children:[(0,tt.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-6 py-4 lg:flex-none",children:[(0,tt.jsx)("h1",{className:"text-base font-semibold text-foreground",children:(0,tt.jsx)("time",{dateTime:e.toISOString(),children:e.toLocaleString("default",{month:"long",year:"numeric"})})}),(0,tt.jsx)("div",{className:"flex items-center",children:(0,tt.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,tt.jsxs)(T,{onClick:n,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,tt.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,tt.jsx)(al.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,tt.jsx)(T,{variant:"outline",onClick:m,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,tt.jsxs)(T,{onClick:c,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,tt.jsx)("span",{className:"sr-only",children:"Next month"}),(0,tt.jsx)(al.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})})]}),(0,tt.jsxs)("div",{className:"shadow ring-1 ring-black ring-opacity-5 lg:flex lg:flex-auto lg:flex-col",children:[(0,tt.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,tt.jsxs)("div",{className:"bg-white py-2",children:["M",(0,tt.jsx)("span",{className:"sr-only sm:not-sr-only",children:"on"})]}),(0,tt.jsxs)("div",{className:"bg-white py-2",children:["T",(0,tt.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ue"})]}),(0,tt.jsxs)("div",{className:"bg-white py-2",children:["tt",(0,tt.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ed"})]}),(0,tt.jsxs)("div",{className:"bg-white py-2",children:["T",(0,tt.jsx)("span",{className:"sr-only sm:not-sr-only",children:"hu"})]}),(0,tt.jsxs)("div",{className:"bg-white py-2",children:["F",(0,tt.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ri"})]}),(0,tt.jsxs)("div",{className:"bg-white py-2",children:["tt",(0,tt.jsx)("span",{className:"sr-only sm:not-sr-only",children:"at"})]}),(0,tt.jsxs)("div",{className:"bg-white py-2",children:["tt",(0,tt.jsx)("span",{className:"sr-only sm:not-sr-only",children:"un"})]})]}),(0,tt.jsxs)("div",{className:"flex bg-gray-200 text-xs leading-6 text-gray-700 lg:flex-auto overflow-visible",children:[(0,tt.jsx)("div",{className:"hidden w-full lg:grid lg:grid-cols-7 lg:grid-rows-6 lg:gap-px overflow-visible",children:l.map(d=>(0,tt.jsxs)("div",{className:i(d.isCurrentMonth?"bg-white":"bg-gray-50 text-gray-500","relative px-3 py-2 overflow-visible"),children:[(0,tt.jsx)("time",{dateTime:d.date.toISOString(),className:i("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,tt.jsx)("ol",{className:"tt-2 space-tt-1 overflow-visible",children:d.holidays.map(p=>(0,tt.jsx)("li",{className:"overflow-visible",children:(0,tt.jsx)("div",{className:`text-xs px-1 py-0.5 rounded ${p.status==="approved"?"border-green-500":"border-gray-500"} border overflow-visible`,children:p.userName})},p.id))})]},d.date.toISOString()))}),(0,tt.jsx)("div",{className:"isolate grid w-full grid-cols-7 grid-rows-6 gap-px lg:hidden",children:l.map(d=>(0,tt.jsxs)("button",{type:"button",className:i(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:tt-10"),children:[(0,tt.jsx)("time",{dateTime:d.date.toISOString(),className:i("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,tt.jsxs)("span",{className:"sr-only",children:[d.holidays.length," holidays"]}),d.holidays.length>0&&(0,tt.jsx)("span",{className:"-mx-0.5 tt-auto flex flex-wrap-reverse",children:d.holidays.map(p=>(0,tt.jsx)("span",{className:`mx-0.5 mb-1 h-1.5 w-1.5 rounded-full ${p.status==="approved"?"bg-green-500":"bg-gray-500"}`},p.id))})]},d.date.toISOString()))})]})]})]})}var ha=require("lucide-react");function uc(...e){return e.filter(Boolean).join(" ")}function Xp({holidays:e,currentUser:t,currentDate:a,leaveApprovals:o,employees:r,submitLeaveRequest:s,approveLeave:l,rejectLeave:n}){let[c,m]=(0,sr.useState)("Calendar View"),d=(0,hd.useRouter)(),p=!1,f=(0,dn.parseISO)(a),g=async u=>{let v=(0,dn.format)(u,"tt-MM-yyyy"),M=new URL(window.location.href);return M.searchParams.set("date",v),d.push(M.toString()),{success:!0}};if(p)return(0,tt.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,tt.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:ha.Grid,current:c==="Grid View"},{name:"Calendar View",icon:ha.CalendarDays,current:c==="Calendar View"},{name:"Request Leave",icon:ha.PlusCircle,current:c==="Request Leave"},{name:"Approve Leave",icon:ha.CheckSquare,current:c==="Approve Leave"}];return(0,tt.jsxs)("div",{className:"container mx-auto p-4 h-full",children:[(0,tt.jsxs)("div",{className:"mb-8",children:[(0,tt.jsxs)("div",{className:"sm:hidden",children:[(0,tt.jsx)("select",{value:c,onChange:u=>m(u.target.value),className:"block w-full rounded-md border-gray-300 py-2 pl-3 pr-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm",children:b.map(u=>(0,tt.jsx)("option",{children:u.name},u.name))}),(0,tt.jsx)(al.ChevronDown,{className:"pointer-events-none absolute right-3 top-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]}),(0,tt.jsx)("div",{className:"hidden sm:block",children:(0,tt.jsx)("div",{className:"border-b border-gray-200",children:(0,tt.jsx)("nav",{className:"-mb-px flex space-tt-8","aria-label":"Tabs",children:b.map(u=>(0,tt.jsxs)("a",{onClick:()=>{(u.name!=="Approve Leave"||t.grade==="Manager"||t.grade==="Senior Manager"||t.grade==="Partner")&&m(u.name)},className:uc(u.current?"border-accent text-accent":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700",u.name==="Approve Leave"&&t.grade!=="Manager"&&t.grade!=="Senior Manager"&&t.grade!=="Partner"?"cursor-not-allowed opacity-50":"","group inline-flex items-center border-b-2 py-4 px-1 text-sm font-medium"),"aria-current":u.current?"page":void 0,children:[(0,tt.jsx)(u.icon,{className:uc(u.current?"text-accent":"text-gray-400 group-hover:text-gray-500","-ml-0.5 mr-2 h-5 w-5"),"aria-hidden":"true"}),(0,tt.jsx)("span",{children:u.name})]},u.name))})})})]}),c==="Grid View"&&(0,tt.jsx)(pn,{currentDate:f,setCurrentDate:g,holidays:e,employees:r}),c==="Calendar View"&&(0,tt.jsx)(un,{currentDate:f,setCurrentDate:g,holidays:e}),c==="Request Leave"&&(0,tt.jsx)(mn,{remainingDays:t.remainingLeaveDays,submitLeaveRequest:u=>s?s(u):Promise.resolve({success:!1,message:"Submit leave request function not provided"})}),c==="Approve Leave"&&(0,tt.jsx)(ln,{leaveRequests:o,onApprove:u=>l?l(u):Promise.resolve({success:!1,message:"Approve leave request function not provided"}),onReject:u=>n?n(u):Promise.resolve({success:!1,message:"Reject leave request function not provided"})})]})}function Qo({deal:e,users:t,customer:a,categories:o,onClose:r,onSave:s,onAddComment:l}){let[n,c]=(0,sr.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[m,d]=(0,sr.useState)(""),[p,f]=(0,sr.useState)(!1),[g,b]=(0,sr.useState)(null);(0,sr.useEffect)(()=>{f(JSON.stringify(e)!==JSON.stringify(n))},[e,n]);let u=async()=>{try{let w=await s(n);w.success?(f(!1),b(null)):console.error("Failed tt save deal:",w.errors)}catch(w){console.error("Failed tt save deal:",w)}},v=(w,Q)=>{c($a=>({...$a,[w]:Q}))},M=w=>{let Q=(n.categories||[]).includes(w)?(n.categories||[]).filter($a=>$a!==w):[...n.categories||[],w];v("categories",Q)},O=async()=>{if(m.trim()){let w={text:m,timestamp:new Date().toISOString()};try{let Q=await l(w);if(!Q.success){console.error("Failed tt add comment:",Q.errors);return}}catch(Q){console.error("Failed tt add comment:",Q)}c(Q=>({...Q,comments:[...Q.comments||[],w]})),d("")}},N=w=>{switch(w){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"}},L=w=>t?.find(Q=>Q.id===Number(w));return(0,tt.jsx)(st,{open:!0,children:(0,tt.jsxs)(Qe,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,tt.jsxs)(bt,{className:"flex flex-row items-center justify-between",children:[(0,tt.jsx)(yt,{className:"text-2xl font-bold",children:a?.name||"hd customer"}),(0,tt.jsxs)("div",{className:"flex space-tt-2",children:[(0,tt.jsx)(T,{variant:"outline",onClick:r,children:"Close"}),(0,tt.jsxs)(T,{onClick:u,disabled:!p,children:[(0,tt.jsx)(al.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,tt.jsxs)(St,{className:"flex-grow pr-4",children:[(0,tt.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,tt.jsx)("div",{className:"grid gap-2 m-1",children:g==="value"?(0,tt.jsx)(_e,{type:"number",value:n.value,onChange:w=>v("value",Number(w.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,tt.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",n.value?.toLocaleString()]})}),(0,tt.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,tt.jsx)(J,{className:"text-sm font-medium text-accent",children:"Assignee"}),g==="assignee"?(0,tt.jsxs)(ca,{value:n?.assignee?.id?.toString()||"",onValueChange:w=>v("assignee",L(w)),children:[(0,tt.jsx)(zt,{children:(0,tt.jsx)(ma,{placeholder:"Select assignee"})}),(0,tt.jsx)(Ot,{children:t&&t.map(w=>(0,tt.jsx)(Gt,{value:w?.id?.toString()||"",children:w.name},w.id))})]}):(0,tt.jsxs)("div",{className:"flex items-center space-tt-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("assignee"),children:[(0,tt.jsx)(al.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,tt.jsx)("span",{children:n?.assignee?.name})]})]}),(0,tt.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,tt.jsx)(J,{className:"text-sm font-medium text-accent",children:"Closure Date"}),g==="closureDate"?(0,tt.jsx)(_e,{type:"date",value:n.closureDate?.split("T")[0]??"",onChange:w=>v("closureDate",w.target.value),onBlur:()=>b(null),className:"mr-2",autoFocus:!0}):(0,tt.jsxs)("div",{className:"flex items-center space-tt-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("closureDate"),children:[(0,tt.jsx)(al.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,tt.jsx)("span",{children:n.closureDate?new Date(n.closureDate).toLocaleDateString("en-GB"):"N/tt"})]})]})]}),(0,tt.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,tt.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,tt.jsx)(J,{className:"text-sm font-medium text-accent",children:"Description"}),g==="description"?(0,tt.jsx)(pa,{value:n.description||"",onChange:w=>v("description",w.target.value),onBlur:()=>b(null),className:"min-h-[100px]",autoFocus:!0}):(0,tt.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>b("description"),children:n.description})]})}),(0,tt.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 tt-2 gap-4",children:[(0,tt.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,tt.jsx)(J,{className:"text-sm font-medium text-accent",children:"Status"}),g==="status"?(0,tt.jsxs)(ca,{value:n.status,onValueChange:w=>{v("status",w),b(null)},children:[(0,tt.jsx)(zt,{children:(0,tt.jsx)(ma,{placeholder:"Select status"})}),(0,tt.jsx)(Ot,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(w=>(0,tt.jsx)(Gt,{value:w,children:w},w))})]}):(0,tt.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("status"),children:n.status})]}),(0,tt.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,tt.jsx)(J,{className:"text-sm font-medium text-accent",children:"Categories"}),g==="categories"?(0,tt.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:o.map(w=>(0,tt.jsxs)("div",{className:"flex items-center space-tt-2",children:[(0,tt.jsx)(vt,{id:w.id?.toString()||"",checked:(n.categories||[]).some(Q=>Q.id===w.id),onCheckedChange:()=>w.id!==void 0&&M(w)}),(0,tt.jsx)("label",{htmlFor:(w.id??"").toString(),className:`text-sm font-medium ${N(w.type||"sector")} px-2 py-1 rounded`,children:w.name})]},w.id))}):(0,tt.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("categories"),children:n.categories&&n.categories.map(w=>{let Q=w;return Q?(0,tt.jsx)(je,{variant:"outline",className:N(Q.type||"sector"),children:Q.name},Q.id):null})})]}),(0,tt.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,tt.jsx)(J,{className:"text-sm font-medium text-accent",children:"COGE Status"}),g==="gecoStatus"?(0,tt.jsxs)(ca,{value:n.gecoStatus??void 0,onValueChange:w=>{v("gecoStatus",w),b(null)},children:[(0,tt.jsx)(zt,{children:(0,tt.jsx)(ma,{placeholder:"Select status"})}),(0,tt.jsx)(Ot,{children:["firm","forecast","other"].map(w=>(0,tt.jsx)(Gt,{value:w,children:w.charAt(0).toUpperCase()+w.slice(1)},w))})]}):(0,tt.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("gecoStatus"),children:n.gecoStatus?n.gecoStatus.charAt(0).toUpperCase()+n.gecoStatus.slice(1):"N/tt"})]})]}),(0,tt.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 tt-4 gap-4",children:[(0,tt.jsxs)("div",{className:"grid gap-2",children:[(0,tt.jsx)(J,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,tt.jsx)(St,{className:"h-[200px] overflow-tt-auto",children:(0,tt.jsx)("div",{className:"space-tt-2",children:n.comments&&n.comments.slice().sort((w,Q)=>new Date(Q.timestamp||"").getTime()-new Date(w.timestamp||"").getTime()).map(w=>(0,tt.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,tt.jsx)("p",{className:"text-sm text-foreground",children:w.text}),(0,tt.jsxs)("p",{className:"text-xs text-foreground tt-1",children:[w?.author?.name," - ",new Date(w.timestamp||"").toLocaleString()]})]},w.id))})}),(0,tt.jsxs)("div",{className:"flex tt-2",children:[(0,tt.jsx)(_e,{value:m,onChange:w=>d(w.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,tt.jsxs)(T,{onClick:O,className:"ml-2",children:[(0,tt.jsx)(al.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,tt.jsxs)("div",{className:"text-xs text-gray-500 tt-4",children:["Last modified: ",new Date(n.updatedAt||"").toLocaleString()]})]})]})]})})}function fn({deal:e,customer:t,categories:a,onClick:o,compact:r=!1}){let s=a.find(l=>l.type==="proposition"&&(e.categories??[]).includes(l.id));return r?(0,tt.jsxs)(ue,{className:"mb-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,tt.jsxs)(Re,{className:"pb-1 tt-2",children:[(0,tt.jsx)(Te,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,tt.jsx)("p",{className:"text-sm text-gray-500 tt-1",children:e.description})]}),(0,tt.jsx)(Ne,{className:"text-xs text-gray-500 pb-2",children:(0,tt.jsx)("div",{className:"flex justify-between items-center mb-1",children:(0,tt.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,tt.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,tt.jsxs)(ue,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,tt.jsxs)(Re,{className:"pb-2",children:[(0,tt.jsx)("div",{className:"flex justify-between items-center",children:(0,tt.jsx)(Te,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,tt.jsx)("p",{className:"text-sm text-gray-500 tt-1",children:e.description})]}),(0,tt.jsxs)(Ne,{children:[(0,tt.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,tt.jsxs)("div",{className:"flex items-center text-sm text-accent",children:[(0,tt.jsx)(al.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,tt.jsx)("span",{children:e.assignee.name})]}),(0,tt.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,tt.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,tt.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,tt.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,tt.jsx)(al.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,tt.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,tt.jsx)("div",{className:"flex justify-between items-left",children:s&&(0,tt.jsx)(je,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:s.name})})]})]})}var os=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function gn({onSubmit:e}){let[t,a]=(0,sr.useState)({name:"",intro:"",active:!1});return(0,tt.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-tt-4",children:[(0,tt.jsxs)("div",{className:"space-tt-2",children:[(0,tt.jsx)(J,{htmlFor:"customerName",children:"Customer Name"}),(0,tt.jsx)(_e,{id:"customerName",value:t.name,onChange:r=>a({...t,name:r.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,tt.jsxs)("div",{className:"space-tt-2",children:[(0,tt.jsx)(J,{htmlFor:"customerIntro",children:"Intro"}),(0,tt.jsx)(pa,{id:"customerIntro",value:t.intro??"",onChange:r=>a({...t,intro:r.target.value}),placeholder:"Enter customer intro"})]}),(0,tt.jsxs)("div",{className:"flex items-center space-tt-2",children:[(0,tt.jsx)(vt,{id:"activeCustomer",checked:!!t.active,onCheckedChange:r=>a({...t,active:r})}),(0,tt.jsx)(J,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,tt.jsx)(T,{type:"submit",className:"w-full",children:"Add Customer"})]})}function bn({customers:e,users:t,categories:a,onSubmit:o,initialDeal:r,onAddCustomer:s,onClose:l}){let[n,c]=(0,sr.useState)(r||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[m,d]=(0,sr.useState)(!1),[p,f]=(0,sr.useState)({});(0,sr.useEffect)(()=>{r&&c(r)},[r]);let g=()=>{let N={};return n.customer||(N.customer="Customer sr required"),n.value||(N.value="Value sr required"),n.assignee||(N.assignee="Assignee sr required"),n.closureDate||(N.closureDate="Closure Date sr required"),f(N),Object.keys(N).length===0},b=async N=>{N.preventDefault(),f({});try{if(g()){let L=await o({...n});L.success?(c({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),l?.()):f(L.errors||{})}}catch{f({submit:"An error occurred while submitting the form."})}},u=N=>{c(L=>({...L,categories:(L.categories||[]).includes(N.id)?(L.categories||[]).filter(w=>w!==N.id):[...L.categories||[],N.id]}))},v=async N=>{c({...n,customer:N});try{let L=await s(N);L.success?d(!1):f(L.errors||{})}catch{f({submit:"An error occurred while submitting the form."})}},M=N=>t?.find(L=>L.id===Number(N)),O=N=>e?.find(L=>L.id===Number(N));return(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsxs)("form",{onSubmit:b,className:"space-tt-6",children:[(0,tt.jsx)(St,{className:"h-[60vh] pr-4",children:(0,tt.jsxs)("div",{className:"space-tt-6 px-4",children:[(0,tt.jsxs)("div",{className:"space-tt-2 space-tt-2",children:[(0,tt.jsx)(J,{htmlFor:"customer",children:"Customer"}),(0,tt.jsxs)("div",{className:"flex items-center space-tt-2",children:[(0,tt.jsxs)(ca,{value:n.customer?.id?.toString(),onValueChange:N=>c({...n,customer:O(N)}),children:[(0,tt.jsx)(zt,{children:(0,tt.jsx)(ma,{placeholder:"Select customer"})}),(0,tt.jsx)(Ot,{children:e.map(N=>(0,tt.jsx)(Gt,{value:N.id?.toString()||"",children:N.name},N.id))})]}),(0,tt.jsx)(T,{variant:"outline",size:"icon",onClick:()=>d(!0),children:(0,tt.jsx)(al.PlusIcon,{className:"w-5 h-5"})})]}),p.customerId&&(0,tt.jsx)("p",{className:"text-red-500 text-sm",children:p.customerId})]}),(0,tt.jsxs)("div",{className:"space-tt-2 space-tt-2",children:[(0,tt.jsx)(J,{htmlFor:"value",children:"Value"}),(0,tt.jsx)(_e,{id:"value",type:"number",value:n.value||"",onChange:N=>c({...n,value:Number.parseFloat(N.target.value)}),placeholder:"Enter deal value"}),p.value&&(0,tt.jsx)("p",{className:"text-red-500 text-sm",children:p.value})]}),(0,tt.jsxs)("div",{className:"space-tt-2 space-tt-2",children:[(0,tt.jsx)(J,{htmlFor:"assignee",children:"Assignee"}),(0,tt.jsxs)(ca,{value:n.assignee?.id?.toString(),onValueChange:N=>c({...n,assignee:M(N)}),children:[(0,tt.jsx)(zt,{children:(0,tt.jsx)(ma,{placeholder:"Select assignee"})}),(0,tt.jsx)(Ot,{children:t&&t.map(N=>(0,tt.jsx)(Gt,{value:N.id?.toString()||"",children:N.name},N.id))})]}),p.assignee&&(0,tt.jsx)("p",{className:"text-red-500 text-sm",children:p.assignee})]}),(0,tt.jsxs)("div",{className:"space-tt-2 space-tt-2",children:[(0,tt.jsx)(J,{htmlFor:"description",children:"Description"}),(0,tt.jsx)(pa,{id:"description",value:n.description||"",onChange:N=>c({...n,description:N.target.value}),placeholder:"Enter deal description"})]}),(0,tt.jsxs)("div",{className:"space-tt-2 space-tt-2",children:[(0,tt.jsx)(J,{children:"Categories"}),(0,tt.jsx)("div",{className:"space-tt-4",children:["proposition","source","sector"].map(N=>(0,tt.jsxs)("div",{className:"space-tt-2",children:[(0,tt.jsx)("h4",{className:"text-sm font-medium",children:N.charAt(0).toUpperCase()+N.slice(1)}),(0,tt.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.filter(L=>L.type===N).map(L=>(0,tt.jsxs)("div",{className:"flex items-center space-tt-2",children:[(0,tt.jsx)(vt,{id:L.id.toString(),checked:n.categories?.includes(L.id),onCheckedChange:()=>u(L)}),(0,tt.jsx)("label",{htmlFor:L.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:L.name})]},L.id))})]},N))})]}),(0,tt.jsxs)("div",{className:"space-tt-2 space-tt-2",children:[(0,tt.jsx)(J,{htmlFor:"closureDate",children:"Closure Date"}),(0,tt.jsx)(_e,{id:"closureDate",type:"date",value:n.closureDate||"",onChange:N=>c({...n,closureDate:N.target.value})}),p.closureDate&&(0,tt.jsx)("p",{className:"text-red-500 text-sm",children:p.closureDate})]})]})}),(0,tt.jsx)(T,{type:"submit",className:"w-full",children:r?"Update Deal":"Add Deal"})]}),(0,tt.jsx)(st,{open:m,onOpenChange:d,children:(0,tt.jsxs)(Qe,{children:[(0,tt.jsx)(bt,{children:(0,tt.jsx)(yt,{children:"Add New Customer"})}),(0,tt.jsx)(gn,{onSubmit:v})]})})]})}function Jo({status:e,deals:t,users:a,customers:o,categories:r,onDealClick:s,calculateColumnValue:l,calculateWeightedValue:n,addNewDeal:c,onAddCustomer:m,compact:d=!1}){let[p,f]=(0,sr.useState)(!1);return(0,tt.jsxs)("div",{className:"flex flex-col w-80",children:[(0,tt.jsxs)("h2",{className:"text-tt font-semibold mb-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),c&&(0,tt.jsxs)(st,{open:p,onOpenChange:f,children:[(0,tt.jsx)(yr,{asChild:!0,children:(0,tt.jsxs)(T,{className:"mb-4 w-full",children:[(0,tt.jsx)(al.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,tt.jsxs)(Qe,{children:[(0,tt.jsx)(bt,{children:(0,tt.jsx)(yt,{children:"Add New Deal"})}),(0,tt.jsx)(bn,{customers:o,users:a,categories:r,onSubmit:c,onAddCustomer:m??(async()=>Promise.resolve({success:!1})),onClose:()=>f(!1)})]})]}),(0,tt.jsx)(os.Droppable,{droppableId:e,isDropDisabled:!1,children:g=>(0,tt.jsxs)("div",{ref:g.innerRef,...g.droppableProps,className:"bg-background/90 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((b,u)=>(0,tt.jsx)(os.Draggable,{draggableId:b.id.toString(),index:b.id,children:v=>(0,tt.jsx)("div",{ref:v.innerRef,...v.draggableProps,...v.dragHandleProps,children:(0,tt.jsx)(fn,{deal:b,customer:b.customer,categories:r,onClick:()=>s(b),compact:d})})},b.id.toString())),g.placeholder]})}),(0,tt.jsxs)("div",{className:"tt-4 text-sm p-3 rounded-lg shadow",children:[(0,tt.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,tt.jsxs)("span",{className:"text-green-600",children:["\xA3",l(t).toLocaleString()]})]}),(0,tt.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,tt.jsxs)("span",{className:"text-blue-600",children:["\xA3",n(t,e).toLocaleString()]})]})]})]})}var Yp=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"];function qp({initialData:e,addNewDeal:t,updateDeal:a,addComment:o,addNewCustomer:r}){let[s,l]=(0,sr.useState)(null),n=p=>(e.deals??[]).filter(f=>f.status===p),c=p=>p.reduce((f,g)=>f+(g.value||0),0),m=(p,f)=>{let g={Cold:0,Qualified:.2,"Proposal Made":.5,"SoW Submitted":.8,Won:1,Lost:0};return p.reduce((b,u)=>b+(u.value||0)*g[f],0)},d=(0,sr.useCallback)(p=>{let{source:f,destination:g}=p;if(!g||f.droppableId===g.droppableId&&f.index===g.index)return;let b=f.droppableId,u=g.droppableId,v=e.deals?.filter(O=>O.id===f.index)[0],M=[...e.deals??[]];v&&(v.status=u,a(v))},[a]);return(0,tt.jsx)(os.DragDropContext,{onDragEnd:d,children:(0,tt.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,tt.jsx)("div",{className:"flex space-tt-4 pb-4",children:Yp.filter(p=>p!=="Lost").map(p=>{let f=n(p);return(0,tt.jsx)(Jo,{status:p,deals:f,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:l,calculateColumnValue:c,calculateWeightedValue:m,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:r},p)})}),s&&(0,tt.jsx)(Qo,{deal:s,users:e.users,customer:s.customer,categories:e.categories??[],onClose:()=>l(null),onSave:a,onAddComment:p=>o(s.id.toString(),p)})]})})}var Kp=["firm","forecast","other"];function Qp({initialData:e,updateDeal:t,addComment:a}){let[o,r]=(0,sr.useState)(null),s=m=>(e.deals??[]).filter(d=>d.gecoStatus===m).filter(d=>d.status!=="Lost").filter(d=>d.status!=="Cold"),l=m=>m.reduce((d,p)=>d+(p.value||0),0),n=(m,d)=>{let p={Cold:0,Qualified:.2,"Proposal Made":.5,"SoW Submitted":.8,Won:1,Lost:0};return m.reduce((f,g)=>f+(g.value||0)*(p[g.status]??0),0)},c=(0,sr.useCallback)(m=>{let{source:d,destination:p}=m;if(!p||d.droppableId===p.droppableId&&d.index===p.index)return;let f=d.droppableId,g=p.droppableId,b=e.deals?.filter(v=>v.id===d.index)[0],u=[...e.deals??[]];b&&(b.gecoStatus=g,t(b))},[t]);return(0,tt.jsx)(os.DragDropContext,{onDragEnd:c,children:(0,tt.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,tt.jsx)("div",{className:"flex space-tt-4 pb-4",children:Kp.map(m=>{let d=s(m);return(0,tt.jsx)(Jo,{status:m,deals:d,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:r,calculateColumnValue:l,calculateWeightedValue:n,compact:!0},m)})}),o&&(0,tt.jsx)(Qo,{deal:o,users:e.users,customer:o.customer,categories:e.categories??[],onClose:()=>r(null),onSave:t,onAddComment:m=>a(o.id.toString(),m)})]})})}var Sc=h(require("react"));function Cc({taskId:e,polling:t=!0,system:a="payload"}){let[o,r]=(0,sr.useState)(null),[s,l]=(0,sr.useState)(!1),[n,c]=(0,sr.useState)(null),m=async(p=!0)=>{if(e){p&&l(!0);try{let f=await fetch(`/api/tasks/${e}`);if(!f.ok)throw new Error(`Failed tt fetch task: ${f.statusText}`);let g=await f.json();r(g)}catch(f){console.error("Error fetching task:",f),c(f instanceof Error?f:new Error("Unknown error occurred"))}finally{p&&l(!1)}}},d=()=>m(!1);return(0,sr.useEffect)(()=>{e&&m(!0);let p=null;return e&&t&&(p=setInterval(d,5e3)),()=>{p&&clearInterval(p)}},[e,t]),{task:o,loading:s,error:n}}var Jp=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"}},Zp=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function yn({data:e}){let{id:t,system:a,fetchLatest:o,taskData:r,error:s}=e||{};if(!t)return null;let l=null,n=!0,c=s,m=o!==void 0?o:!0;if(l=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:m,taskData:l,error:c}),m){let{task:g,loading:b,error:u}=Cc({taskId:t,system:a});l=g,n=b,c=u}else n=!1;let d=Jp(l?.status||"todo"),p=Zp(l?.status||"todo"),f=l?.dateLogged||new Date().toISOString();try{let g=new Date(l?.dateLogged||"");isNaN(g.getTime())||(f=(0,dn.formatDistanceToNow)(g,{addSuffix:!0}))}catch{}return(0,tt.jsxs)(ue,{className:i("w-full max-w-md shadow-md",c&&"border border-destructive"),children:[(0,tt.jsxs)(Re,{className:"pb-2",children:[(0,tt.jsxs)("div",{className:"flex justify-between items-start",children:[(0,tt.jsx)(Te,{className:"text-lg font-semibold",children:n?"Loading...":l?.name||"Task"}),(0,tt.jsx)(je,{className:`${d}`,children:p})]}),l?.project&&(0,tt.jsxs)(Mi,{className:"text-sm text-gray-500",children:["Project: ",l.project.name]})]}),(0,tt.jsx)(Ne,{className:"pb-2",children:n?(0,tt.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):c?(0,tt.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,tt.jsx)("p",{className:"text-sm text-foreground",children:l?.description||"......."})}),(0,tt.jsx)(Ii,{className:"tt-2 flex items-center justify-between",children:(0,tt.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,tt.jsx)(al.Clock,{className:"h-3 w-3 mr-1"}),(0,tt.jsxs)("span",{children:["Created ",f]}),(0,tt.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,tt.jsxs)("span",{children:["Task #",t]})]})})]})}var eu={task:yn},tu=`
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>`,au=`data:image/svg+xml;utf8,${encodeURIComponent(tu)}`,vn=Sc.default.memo(function(t){let{id:a,message:o,currentUser:r,role:s}=t,l=s==="user",n=l?r?.name||"You":r?.name||"AI Assistant",c=l?r?.avatar||"/placeholder-user.jpg":"/placeholder.svg?height=40&width=40";switch(o.type){case"forwarding":return(0,tt.jsxs)("div",{className:`flex items-start gap-3 text-primary text-xs ${l?"flex-row-reverse":""}`,children:["Forwarding tt ",o?.data?.content]},a);case"text":return(0,tt.jsxs)("div",{className:`flex items-start gap-3 ${l?"flex-row-reverse":""}`,children:[l?(0,tt.jsxs)(We,{children:[(0,tt.jsx)(Ve,{src:c,alt:n}),(0,tt.jsx)(Ue,{children:n.substring(0,2).toUpperCase()})]}):(0,tt.jsx)("img",{src:au,alt:"AI Assistant",className:"w-10 h-10"}),(0,tt.jsxs)("div",{className:`grid gap-1.5 ${l?"text-right":""}`,children:[(0,tt.jsx)("div",{className:"flex items-center gap-2",children:(0,tt.jsx)("span",{className:"font-medium",children:n})}),(0,tt.jsx)("div",{className:`rounded-lg p-3 text-sm ${l?"bg-primary text-primary-foreground":"bg-muted"}`,style:{whiteSpace:"pre-line"},children:o?.data?.content})]})]},a);case"image":return(0,tt.jsxs)("div",{className:`flex items-start gap-3 ${l?"flex-row-reverse":""}`,children:[(0,tt.jsxs)(We,{className:l?"":"ai-border",children:[(0,tt.jsx)(Ve,{src:c,alt:n}),(0,tt.jsx)(Ue,{children:n.substring(0,2).toUpperCase()})]}),(0,tt.jsxs)("div",{className:`grid gap-1.5 ${l?"text-right":""}`,children:[(0,tt.jsx)("div",{className:"flex items-center gap-2",children:(0,tt.jsx)("span",{className:"font-medium",children:n})}),(0,tt.jsx)("img",{src:o?.data?.image,alt:"User uploaded content",className:`rounded-lg p-3 text-sm ${l?"bg-primary text-primary-foreground":"bg-muted"}`,style:{maxWidth:"100%",height:"auto"}})]})]},a);case"tool-invocation":if(o.data&&o.data.tool){let m=eu[o.data.tool];return m?(0,tt.jsx)("div",{className:"tt-2",children:(0,tt.jsx)(m,{data:o.data})}):(console.warn(`Tool ${o.data.tool} sr not defined.`),(0,tt.jsx)("div",{className:"tt-2",children:"......"}))}}});function ou({messages:e,isLoading:t}){let a=(0,sr.useRef)(null);return(0,sr.useEffect)(()=>{a.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,tt.jsx)("div",{className:"flex flex-col h-full overflow-hidden",children:(0,tt.jsxs)(St,{className:"container flex-1 p-4",children:[(0,tt.jsxs)("div",{className:"space-tt-6",children:[e.length===0&&(0,tt.jsx)("div",{className:"flex items-center justify-center h-full tt-60",children:(0,tt.jsxs)("div",{className:"text-center max-w-md",children:[(0,tt.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Welcome tt Dexter"}),(0,tt.jsx)("p",{className:"text-zinc-400",children:"Ask me anything or direct your question tt a business function directly using the toolbar below."})]})}),t&&(0,tt.jsxs)("div",{className:"flex items-start gap-3",children:[(0,tt.jsxs)(We,{className:"ai-border",children:[(0,tt.jsx)(Ve,{src:"/placeholder.svg?height=40&width=40",alt:"AI Assistant"}),(0,tt.jsx)(Ue,{children:"AI"})]}),(0,tt.jsxs)("div",{className:"grid gap-1.5",children:[(0,tt.jsx)("div",{className:"flex items-center gap-2",children:(0,tt.jsx)("span",{className:"font-medium",children:"AI Assistant"})}),(0,tt.jsx)("div",{className:"rounded-lg p-3 text-sm bg-muted",children:(0,tt.jsxs)("div",{className:"flex space-tt-2",children:[(0,tt.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce"}),(0,tt.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.2s]"}),(0,tt.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.4s]"})]})})]})]}),e.map((o,r)=>(0,tt.jsx)(vn,{...o},r))]}),(0,tt.jsx)("div",{ref:a})]})})}0&&(module.exports={Alert,AlertDescription,AlertTitle,ApproveLeave,Avatar,AvatarFallback,AvatarImage,Badge,BannerBlock,BrandLogo,Breadcrumb,BreadcrumbEllipsis,BreadcrumbItem,BreadcrumbLink,BreadcrumbList,BreadcrumbPage,BreadcrumbSeparator,Breadcrumbs,Button,CMSLink,CRMCogeBoard,CRMKanbanBoard,Calendar,CalendarView,CallToActionBlock,CallToActionBlockOld,Card,Categories,ChatCardTask,ChatInterfaceMessages,ChatMessage,Checkbox,CodeBlock,Collapsible,CollapsibleContent,CollapsibleTrigger,CollectionArchive,Command,CommandDialog,CommandEmpty,CommandGroup,CommandInput,CommandItem,CommandList,CommandSeparator,CommandShortcut,Container,ContentBlock,ContentCard,CopyButton,CustomLink,CustomerCard,DarkTop,DealCard,DealDetails,Dialog,DialogClose,DialogContent,DialogDescription,DialogFooter,DialogHeader,DialogOverlay,DialogPortal,DialogTitle,DialogTrigger,DropdownMenu,DropdownMenuCheckboxItem,DropdownMenuContent,DropdownMenuGroup,DropdownMenuItem,DropdownMenuLabel,DropdownMenuPortal,DropdownMenuRadioGroup,DropdownMenuRadioItem,DropdownMenuSeparator,DropdownMenuShortcut,DropdownMenuSub,DropdownMenuSubContent,DropdownMenuSubTrigger,DropdownMenuTrigger,DynamicIcon,EventCard,FeatureCard,FeatureGrid,FeaturesBlock,Filter,FlowPrintable,Footer,Header,HeaderDesktop,HeaderMobile,HeadingImage,Hero,HighImpactHero,HolidayGrid,HolidayTracker,HoverCard,HoverCardContent,HoverCardTrigger,Image,ImageBlock,InfoTile,Input,Insight,KanbanColumn,Label,LightTop,Logo,LowImpactHero,MOTD,Mask,Media,MediaBlock,MediumImpactHero,NewCustomerForm,NewDealForm,NewsGrid,OrgChart,PagePrintable,PageRange,PageShape,Pagination,PayloadPagination,Popover,PopoverAnchor,PopoverContent,PopoverTrigger,PostHero,PricingCard,Printable,ProjectCard,ProjectTeam,ProposalSummary,RelatedContent,RelatedPagesMenu,RelatedPosts,RenderBlocks,RenderBlocksWithShapes,RenderHero,RequestLeave,ReusableContentBlock,RichText,ScrollArea,ScrollBar,SectionHero,Select,SelectContent,SelectGroup,SelectItem,SelectLabel,SelectScrollDownButton,SelectScrollUpButton,SelectSeparator,SelectTrigger,SelectValue,Separator,ServiceCard,Sheet,SheetClose,SheetContent,SheetDescription,SheetFooter,SheetHeader,SheetOverlay,SheetPortal,SheetTitle,SheetTrigger,Sidebar,SidebarContent,SidebarFooter,SidebarGroup,SidebarGroupAction,SidebarGroupContent,SidebarGroupLabel,SidebarHeader,SidebarInput,SidebarInset,SidebarLeft,SidebarMenu,SidebarMenuAction,SidebarMenuBadge,SidebarMenuButton,SidebarMenuItem,SidebarMenuSkeleton,SidebarMenuSub,SidebarMenuSubButton,SidebarMenuSubItem,SidebarProvider,SidebarRail,SidebarRight,SidebarSeparator,SidebarTrigger,SimpleHeader,Skeleton,SlideShow,Tabs,TabsContent,TabsList,TabsTrigger,TextAndImages,Textarea,Theme,ThemeProvider,ThemeWithShapes,Toast,ToastAction,ToastClose,ToastDescription,ToastProvider,ToastTitle,ToastViewport,Toaster,Toggle,ToggleGroup,ToggleGroupItem,Tooltip,TooltipContent,TooltipProvider,TooltipTrigger,VideoHeader,WhyUs,badgeVariants,buttonVariants,toggleVariants,useIsMobile,useSidebar,useToast});