cortex-react-components 2.0.5 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-VRE6VCHX.mjs → chunk-2BR55L74.mjs} +1 -1
- package/dist/{chunk-NBWEIVGC.mjs → chunk-2L2HGIOO.mjs} +1 -1
- package/dist/{chunk-GH3F4DKW.mjs → chunk-4FOM4XM6.mjs} +1 -1
- package/dist/{chunk-QTILVWJA.mjs → chunk-4RYG24IZ.mjs} +1 -1
- package/dist/chunk-5BK3HTPN.mjs +4 -0
- package/dist/{chunk-GIL2SMPM.mjs → chunk-5G3COZF4.mjs} +1 -1
- package/dist/{chunk-S5BLSQXV.mjs → chunk-5JQAH3EN.mjs} +1 -1
- package/dist/{chunk-ABGNIQRP.mjs → chunk-5RDLHKTK.mjs} +1 -1
- package/dist/{chunk-ZZ6VZFRV.mjs → chunk-67YQLYKU.mjs} +1 -1
- package/dist/chunk-6RXY6Z7T.mjs +4 -0
- package/dist/{chunk-WDZOGIT2.mjs → chunk-7WTM3LJ4.mjs} +1 -1
- package/dist/{chunk-JLUX7EHB.mjs → chunk-AHJIHY2A.mjs} +1 -1
- package/dist/{chunk-TRFGSHZW.mjs → chunk-AL6YBBXL.mjs} +1 -1
- package/dist/{chunk-PRK2XFAZ.mjs → chunk-AWMFKQHJ.mjs} +1 -1
- package/dist/{chunk-IV5HRCWW.mjs → chunk-BDDEMCAH.mjs} +1 -1
- package/dist/chunk-CBLP4MXP.mjs +4 -0
- package/dist/{chunk-75WE6ZXB.mjs → chunk-CLGBBNRB.mjs} +1 -1
- package/dist/{chunk-TK4JC5PG.mjs → chunk-E64KWNOT.mjs} +1 -1
- package/dist/{chunk-T36QUKC6.mjs → chunk-EB2UGKCE.mjs} +1 -1
- package/dist/{chunk-KEOMDWUC.mjs → chunk-EHSOO47V.mjs} +1 -1
- package/dist/{chunk-RVDQVN5C.mjs → chunk-ERURPIHS.mjs} +1 -1
- package/dist/{chunk-M74BIPBM.mjs → chunk-FATHLUEL.mjs} +1 -1
- package/dist/chunk-FGH7ESCA.mjs +4 -0
- package/dist/{chunk-TCXAETN2.mjs → chunk-FHJ4MHLT.mjs} +1 -1
- package/dist/{chunk-BN747TQM.mjs → chunk-GEFCIPUN.mjs} +1 -1
- package/dist/{chunk-45DDMEV4.mjs → chunk-GGXCPUR2.mjs} +1 -1
- package/dist/{chunk-2GZQYAN3.mjs → chunk-GWAEXG22.mjs} +1 -1
- package/dist/{chunk-FOISWNF5.mjs → chunk-HHYHENVF.mjs} +1 -1
- package/dist/{chunk-FXTFE74U.mjs → chunk-HKM6FA5J.mjs} +1 -1
- package/dist/{chunk-F4UGWCXY.mjs → chunk-IQQ7ZWCP.mjs} +1 -1
- package/dist/{chunk-IDG2O4B7.mjs → chunk-ISBVFNWD.mjs} +1 -1
- package/dist/{chunk-NXG2Y4N4.mjs → chunk-L3SSJ5A3.mjs} +1 -1
- package/dist/{chunk-IPV2NFB6.mjs → chunk-L7W3JS7W.mjs} +1 -1
- package/dist/{chunk-CVLUVZR3.mjs → chunk-LLED3RQS.mjs} +1 -1
- package/dist/{chunk-RK2CAIEF.mjs → chunk-M527EJIX.mjs} +1 -1
- package/dist/{chunk-UA76VX54.mjs → chunk-MMOATE43.mjs} +1 -1
- package/dist/{chunk-JT65KF7C.mjs → chunk-N2336R53.mjs} +1 -1
- package/dist/{chunk-Y62OBV2E.mjs → chunk-NC7WGIM5.mjs} +1 -1
- package/dist/{chunk-SNZ5BAQQ.mjs → chunk-NHFCO6RG.mjs} +1 -1
- package/dist/{chunk-OB5WMODY.mjs → chunk-O3ORC6HS.mjs} +1 -1
- package/dist/{chunk-V5W32NJ4.mjs → chunk-OEFXIEY3.mjs} +1 -1
- package/dist/{chunk-5KS3DITB.mjs → chunk-OJZQH57M.mjs} +1 -1
- package/dist/{chunk-ZFUP5NVF.mjs → chunk-PXLSH6S2.mjs} +1 -1
- package/dist/{chunk-BDNY6OKE.mjs → chunk-TEL4MSNV.mjs} +1 -1
- package/dist/{chunk-I4LKRX2X.mjs → chunk-UENDC4U4.mjs} +1 -1
- package/dist/chunk-V7F26YS5.mjs +4 -0
- package/dist/{chunk-BGADMIWV.mjs → chunk-WYHDFQVL.mjs} +1 -1
- package/dist/{chunk-UZSBX5GO.mjs → chunk-X3JZSN3W.mjs} +1 -1
- package/dist/{chunk-GTK2SGS5.mjs → chunk-XBCYPOFD.mjs} +1 -1
- package/dist/{chunk-66ODXUVL.mjs → chunk-XEZD3D7C.mjs} +1 -1
- package/dist/{chunk-VNYUNZ3M.mjs → chunk-XGIYNUGC.mjs} +1 -1
- package/dist/{chunk-RAGDUV7M.mjs → chunk-XIGBDWYI.mjs} +1 -1
- package/dist/components/AdvancedComponents/app-header.js +1 -1
- package/dist/components/AdvancedComponents/app-header.mjs +1 -1
- package/dist/components/AdvancedComponents/index.mjs +1 -1
- package/dist/components/Blocks/Banner.mjs +1 -1
- package/dist/components/Blocks/CallToAction.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
- package/dist/components/Blocks/Content.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
- package/dist/components/Blocks/ImageBlock.mjs +1 -1
- package/dist/components/Blocks/MediaBlock.mjs +1 -1
- package/dist/components/Blocks/RelatedPosts.mjs +1 -1
- package/dist/components/Blocks/RenderBlocks.mjs +1 -1
- package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/CRM/CogeBoard.mjs +1 -1
- package/dist/components/CRM/DealDetails.mjs +1 -1
- package/dist/components/CRM/KanbanBoard.mjs +1 -1
- package/dist/components/CRM/NewDealForm.mjs +1 -1
- package/dist/components/CRM/index.mjs +1 -1
- package/dist/components/Cards/ContentCard.mjs +1 -1
- package/dist/components/Cards/FeatureCard.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/Chat/ChatInterface.mjs +1 -1
- package/dist/components/Chat/CopilotInterface.d.ts +7 -2
- package/dist/components/Chat/CopilotInterface.js +1 -1
- package/dist/components/Chat/CopilotInterface.mjs +1 -1
- package/dist/components/Chat/README-AI-Integration.js +155 -0
- package/dist/components/Chat/README-AI-Integration.mjs +155 -0
- package/dist/components/Chat/chat-session-sidebar.js +1 -1
- package/dist/components/Chat/chat-session-sidebar.mjs +1 -1
- package/dist/components/Chat/demo.js +1 -1
- package/dist/components/Chat/demo.mjs +1 -1
- package/dist/components/Chat/example-usage.js +1 -1
- package/dist/components/Chat/example-usage.mjs +1 -1
- package/dist/components/Chat/example-with-vercel-ai.css +1 -0
- package/dist/components/Chat/example-with-vercel-ai.d.ts +47 -0
- package/dist/components/Chat/example-with-vercel-ai.js +5 -0
- package/dist/components/Chat/example-with-vercel-ai.mjs +2 -0
- package/dist/components/Chat/index.js +2 -2
- package/dist/components/Chat/index.mjs +1 -1
- package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
- package/dist/components/DigitalColleagues/DigitalColleageusLayout.d.ts +2 -1
- package/dist/components/DigitalColleagues/DigitalColleageusLayout.js +1 -1
- package/dist/components/DigitalColleagues/DigitalColleageusLayout.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/ManagementSidebar.mjs +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.js +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/ColleaguesView.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
- package/dist/components/DigitalColleagues/colleague-form.mjs +1 -1
- package/dist/components/DigitalColleagues/sidebar.js +1 -1
- package/dist/components/DigitalColleagues/sidebar.mjs +1 -1
- package/dist/components/HeaderFooter/Header.mjs +1 -1
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/HighImpact/index.mjs +1 -1
- package/dist/components/Heros/LowImpact/index.mjs +1 -1
- package/dist/components/Heros/MediumImpact/index.mjs +1 -1
- package/dist/components/Heros/PostHero/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/SectionHero/index.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Holidays/HolidayTracker.mjs +1 -1
- package/dist/components/Holidays/index.mjs +1 -1
- package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
- package/dist/components/Layouts/Print.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Menus/SidebarLeft.mjs +1 -1
- package/dist/components/Menus/SidebarRight.mjs +1 -1
- package/dist/components/Menus/index.mjs +1 -1
- package/dist/components/Other/index.mjs +1 -1
- package/dist/components/Payload/Card/index.mjs +1 -1
- package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
- package/dist/components/Payload/Media/index.mjs +1 -1
- package/dist/components/Payload/RichText/index.mjs +1 -1
- package/dist/components/Payload/RichText/serialize.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/Projects/KanbanBoardView.mjs +1 -1
- package/dist/components/Projects/ProjectPage.js +1 -1
- package/dist/components/Projects/ProjectPage.mjs +1 -1
- package/dist/components/Projects/ProjectView.mjs +1 -1
- package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
- package/dist/components/Projects/TaskDetailsModal.mjs +1 -1
- package/dist/components/dc-temp/index.mjs +1 -1
- package/dist/components/dc-temp/knowledge-search.mjs +1 -1
- package/dist/components/index.js +9 -9
- package/dist/components/index.mjs +1 -1
- package/dist/components/ui/index.mjs +1 -1
- package/dist/components/ui/sidebar.mjs +1 -1
- package/dist/index.js +14 -14
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/sections/AboutSection.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogList.mjs +1 -1
- package/dist/sections/BlogListSection.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/ServiceDetail.mjs +1 -1
- package/dist/sections/ServiceDetailSection.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/dist/test-useChat-api.d.ts +1 -0
- package/dist/test-useChat-api.js +1 -0
- package/dist/test-useChat-api.mjs +1 -0
- package/package.json +1 -1
- package/dist/chunk-2VR4KIQL.mjs +0 -4
- package/dist/chunk-JHSHXYPK.mjs +0 -4
- package/dist/chunk-PM35MWKG.mjs +0 -4
- package/dist/chunk-SWA5TRPZ.mjs +0 -4
- package/dist/chunk-ZCEVYZEO.mjs +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s}from"../../chunk-
|
|
1
|
+
import{a as s}from"../../chunk-6RXY6Z7T.mjs";import"../../chunk-FGH7ESCA.mjs";import"../../chunk-V7F26YS5.mjs";import"../../chunk-5BK3HTPN.mjs";import"../../chunk-L7W3JS7W.mjs";import"../../chunk-LUPNE23E.mjs";import"../../chunk-A2AEX4YB.mjs";import"../../chunk-DBY4SXQI.mjs";import"../../chunk-I3E2TYYZ.mjs";import"../../chunk-LTTO57ZK.mjs";import"../../chunk-CBLP4MXP.mjs";import"../../chunk-AZKOVKSK.mjs";import"../../chunk-M245YHYF.mjs";import"../../chunk-3KITWLRN.mjs";import"../../chunk-PA4ZBJDO.mjs";import{b as e}from"../../chunk-Q2DPE66H.mjs";import"../../chunk-INCYANPB.mjs";import"../../chunk-RLVKIMGU.mjs";import"../../chunk-OCPX4QPC.mjs";import"../../chunk-FT3AE7L2.mjs";import"../../chunk-3UMMMQEH.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-KY7WQYN4.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-SOLZ4VQH.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-YO3GQYRJ.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-FLHDNCNY.mjs";import"../../chunk-YEKQJ4YC.mjs";import{useState as o}from"react";import{jsx as t}from"react/jsx-runtime";var l=[{id:"1",role:"user",parts:[{type:"text",text:"Hello! Can you help me with a task?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:"Of course! I can help you with various tasks. Try uploading a file or use the capabilities menu at the bottom to see what I can do."}]}];function u(){let[a,i]=o(l);return t("div",{className:"h-screen w-full",children:t(s,{messages:a,capabilities:e,enableFileUpload:!0,maxFileSize:10,allowedFileTypes:["*"],businessUnits:[],sessions:[],notifications:[],onNewChat:()=>i([]),onSessionSelect:()=>{},onSessionDelete:()=>{},showCapabilities:!0})})}export{u as ChatDemo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
"use client"
|
|
4
4
|
|
|
5
|
-
"use strict";var Xa=Object.create;var nt=Object.defineProperty;var Qa=Object.getOwnPropertyDescriptor;var Ya=Object.getOwnPropertyNames;var Za=Object.getPrototypeOf,eo=Object.prototype.hasOwnProperty;var to=(e,t)=>{for(var a in t)nt(e,a,{get:t[a],enumerable:!0})},$t=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Ya(t))!eo.call(e,l)&&l!==a&&nt(e,l,{get:()=>t[l],enumerable:!(o=Qa(t,l))||o.enumerable});return e};var q=(e,t,a)=>(a=e!=null?Xa(Za(e)):{},$t(t||!e||!e.__esModule?nt(a,"default",{value:e,enumerable:!0}):a,e)),ao=e=>$t(nt({},"__esModule",{value:!0}),e);var ai={};to(ai,{ExampleChatInterface:()=>ti});module.exports=ao(ai);var st=q(require("react")),De=q(require("@radix-ui/react-avatar"));var ea=require("clsx");var St="-",oo=e=>{let t=ro(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:c=>{let r=c.split(St);return r[0]===""&&r.length!==1&&r.shift(),_t(r,t)||io(c)},getConflictingClassGroupIds:(c,r)=>{let u=a[c]||[];return r&&o[c]?[...u,...o[c]]:u}}},_t=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),l=o?_t(e.slice(1),o):void 0;if(l)return l;if(t.validators.length===0)return;let n=e.join(St);return t.validators.find(({validator:c})=>c(n))?.classGroupId},Kt=/^\[(.+)\]$/,io=e=>{if(Kt.test(e)){let t=Kt.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},ro=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return so(Object.entries(e.classGroups),a).forEach(([n,c])=>{Pt(c,o,n,t)}),o},Pt=(e,t,a,o)=>{e.forEach(l=>{if(typeof l=="string"){let n=l===""?t:qt(t,l);n.classGroupId=a;return}if(typeof l=="function"){if(no(l)){Pt(l(o),t,a,o);return}t.validators.push({validator:l,classGroupId:a});return}Object.entries(l).forEach(([n,c])=>{Pt(c,qt(t,n),a,o)})})},qt=(e,t)=>{let a=e;return t.split(St).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},no=e=>e.isThemeGetter,so=(e,t)=>t?e.map(([a,o])=>{let l=o.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([c,r])=>[t+c,r])):n);return[a,l]}):e,lo=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,l=(n,c)=>{a.set(n,c),t++,t>e&&(t=0,o=a,a=new Map)};return{get(n){let c=a.get(n);if(c!==void 0)return c;if((c=o.get(n))!==void 0)return l(n,c),c},set(n,c){a.has(n)?a.set(n,c):l(n,c)}}},Jt="!",co=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,l=t[0],n=t.length,c=r=>{let u=[],m=0,R=0,v;for(let w=0;w<r.length;w++){let T=r[w];if(m===0){if(T===l&&(o||r.slice(w,w+n)===t)){u.push(r.slice(R,w)),R=w+n;continue}if(T==="/"){v=w;continue}}T==="["?m++:T==="]"&&m--}let k=u.length===0?r:r.substring(R),P=k.startsWith(Jt),L=P?k.substring(1):k,D=v&&v>R?v-R:void 0;return{modifiers:u,hasImportantModifier:P,baseClassName:L,maybePostfixModifierPosition:D}};return a?r=>a({className:r,parseClassName:c}):c},po=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(o=>{o[0]==="["?(t.push(...a.sort(),o),a=[]):a.push(o)}),t.push(...a.sort()),t},mo=e=>({cache:lo(e.cacheSize),parseClassName:co(e),...oo(e)}),uo=/\s+/,go=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:l}=t,n=[],c=e.trim().split(uo),r="";for(let u=c.length-1;u>=0;u-=1){let m=c[u],{modifiers:R,hasImportantModifier:v,baseClassName:k,maybePostfixModifierPosition:P}=a(m),L=!!P,D=o(L?k.substring(0,P):k);if(!D){if(!L){r=m+(r.length>0?" "+r:r);continue}if(D=o(k),!D){r=m+(r.length>0?" "+r:r);continue}L=!1}let w=po(R).join(":"),T=v?w+Jt:w,M=T+D;if(n.includes(M))continue;n.push(M);let y=l(D,L);for(let U=0;U<y.length;++U){let X=y[U];n.push(T+X)}r=m+(r.length>0?" "+r:r)}return r};function fo(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Xt(t))&&(o&&(o+=" "),o+=a);return o}var Xt=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Xt(e[o]))&&(a&&(a+=" "),a+=t);return a};function bo(e,...t){let a,o,l,n=c;function c(u){let m=t.reduce((R,v)=>v(R),e());return a=mo(m),o=a.cache.get,l=a.cache.set,n=r,r(u)}function r(u){let m=o(u);if(m)return m;let R=go(u,a);return l(u,R),R}return function(){return n(fo.apply(null,arguments))}}var j=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Qt=/^\[(?:([a-z-]+):)?(.+)\]$/lt,vo=/^\d+\/\d+$/,ho=new Set(["px","full","screen"]),yo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|lt|lt|min|max))|\lt(calc|min|max|clamp)\(.+\)|^0$/,wo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Co=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)lt-?((\d+)?\.?(\d+)[a-z]+|0)/,No=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ke=e=>Ge(e)||ho.has(e)||vo.test(e),Ae=e=>We(e,"length",Mo),Ge=e=>!!e&&!Number.isNaN(Number(e)),Dt=e=>We(e,"number",Ge),Xe=e=>!!e&&Number.isInteger(Number(e)),ko=e=>e.endsWith("%")&&Ge(e.slice(0,-1)),h=e=>Qt.test(e),Me=e=>yo.test(e),Do=new Set(["length","size","percentage"]),Po=e=>We(e,Do,Yt),So=e=>We(e,"position",Yt),Ro=new Set(["image","url"]),To=e=>We(e,Ro,Bo),Ao=e=>We(e,"",Io),Qe=()=>!0,We=(e,t,a)=>{let o=Qt.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},Mo=e=>xo.test(e)&&!wo.test(e),Yt=()=>!1,Io=e=>Co.test(e),Bo=e=>No.test(e);var zo=()=>{let e=j("colors"),t=j("spacing"),a=j("blur"),o=j("brightness"),l=j("borderColor"),n=j("borderRadius"),c=j("borderSpacing"),r=j("borderWidth"),u=j("contrast"),m=j("grayscale"),R=j("hueRotate"),v=j("invert"),k=j("gap"),P=j("gradientColorStops"),L=j("gradientColorStopPositions"),D=j("inset"),w=j("margin"),T=j("opacity"),M=j("padding"),y=j("saturate"),U=j("scale"),X=j("sepia"),K=j("skew"),re=j("space"),J=j("translate"),G=()=>["auto","contain","none"],Q=()=>["auto","hidden","clip","visible","scroll"],Z=()=>["auto",h,t],I=()=>[h,t],Ne=()=>["",ke,Ae],d=()=>["auto",Ge,h],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],p=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",h],ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[Ge,h];return{cacheSize:500,separator:":",theme:{colors:[Qe],spacing:[ke,Ae],blur:["none","",Me,h],brightness:V(),borderColor:[e],borderRadius:["none","","full",Me,h],borderSpacing:I(),borderWidth:Ne(),contrast:V(),grayscale:H(),hueRotate:V(),invert:H(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[ko,Ae],inset:Z(),margin:Z(),opacity:V(),padding:I(),saturate:V(),scale:V(),sepia:H(),skew:V(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",h]}],container:["container"],columns:[{columns:[Me]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...A(),h]}],overflow:[{overflow:Q()}],"overflow-lt":[{"overflow-lt":Q()}],"overflow-y":[{"overflow-y":Q()}],overscroll:[{overscroll:G()}],"overscroll-lt":[{"overscroll-lt":G()}],"overscroll-y":[{"overscroll-y":G()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[D]}],"inset-lt":[{"inset-lt":[D]}],"inset-y":[{"inset-y":[D]}],start:[{start:[D]}],end:[{end:[D]}],top:[{top:[D]}],right:[{right:[D]}],bottom:[{bottom:[D]}],left:[{left:[D]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Xe,h]}],basis:[{basis:Z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",h]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",Xe,h]}],"grid-cols":[{"grid-cols":[Qe]}],"col-start-end":[{col:["auto",{span:["full",Xe,h]},h]}],"col-start":[{"col-start":d()}],"col-end":[{"col-end":d()}],"grid-rows":[{"grid-rows":[Qe]}],"row-start-end":[{row:["auto",{span:[Xe,h]},h]}],"row-start":[{"row-start":d()}],"row-end":[{"row-end":d()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",h]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",h]}],gap:[{gap:[k]}],"gap-lt":[{"gap-lt":[k]}],"gap-y":[{"gap-y":[k]}],"justify-content":[{justify:["normal",...B()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...B(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...B(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],lt:[{lt:[M]}],pt:[{pt:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-lt":[{"space-lt":[re]}],"space-lt-reverse":["space-lt-reverse"],"space-y":[{"space-y":[re]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",h,t]}],"min-w":[{"min-w":[h,t,"min","max","fit"]}],"max-w":[{"max-w":[h,t,"none","full","min","max","fit","prose",{screen:[Me]},Me]}],h:[{h:[h,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[h,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Me,Ae]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Dt]}],"font-family":[{font:[Qe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",h]}],"line-clamp":[{"line-clamp":["none",Ge,Dt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ke,h]}],"list-image":[{"list-image":["none",h]}],"list-style-type":[{list:["none","disc","decimal",h]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[T]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[T]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ke,Ae]}],"underline-offset":[{"underline-offset":["auto",ke,h]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[T]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...A(),So]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","lt","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Po]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","lt","bl","l","tl"]},To]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[L]}],"gradient-via-pos":[{via:[L]}],"gradient-to-pos":[{to:[L]}],"gradient-from":[{from:[P]}],"gradient-via":[{via:[P]}],"gradient-to":[{to:[P]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-lt":[{"rounded-lt":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[r]}],"border-w-lt":[{"border-lt":[r]}],"border-w-y":[{"border-y":[r]}],"border-w-s":[{"border-s":[r]}],"border-w-e":[{"border-e":[r]}],"border-w-t":[{"border-t":[r]}],"border-w-r":[{"border-r":[r]}],"border-w-lt":[{"border-lt":[r]}],"border-w-l":[{"border-l":[r]}],"border-opacity":[{"border-opacity":[T]}],"border-style":[{border:[...z(),"hidden"]}],"divide-lt":[{"divide-lt":[r]}],"divide-lt-reverse":["divide-lt-reverse"],"divide-y":[{"divide-y":[r]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[T]}],"divide-style":[{divide:z()}],"border-color":[{border:[l]}],"border-color-lt":[{"border-lt":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-lt":[{"border-lt":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[ke,h]}],"outline-w":[{outline:[ke,Ae]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[T]}],"ring-offset-w":[{"ring-offset":[ke,Ae]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Me,Ao]}],"shadow-color":[{shadow:[Qe]}],opacity:[{opacity:[T]}],"mix-blend":[{"mix-blend":[...p(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":p()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Me,h]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[R]}],invert:[{invert:[v]}],saturate:[{saturate:[y]}],sepia:[{sepia:[X]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[R]}],"backdrop-invert":[{"backdrop-invert":[v]}],"backdrop-opacity":[{"backdrop-opacity":[T]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[X]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-lt":[{"border-spacing-lt":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",h]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",h]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",h]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[U]}],"scale-lt":[{"scale-lt":[U]}],"scale-y":[{"scale-y":[U]}],rotate:[{rotate:[Xe,h]}],"translate-lt":[{"translate-lt":[J]}],"translate-y":[{"translate-y":[J]}],"skew-lt":[{"skew-lt":[K]}],"skew-y":[{"skew-y":[K]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",h]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","lt",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-lt":[{"scroll-lt":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","lt","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-lt":[{"touch-pan":["lt","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",h]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ke,Ae,Dt]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-lt","overflow-y"],overscroll:["overscroll-lt","overscroll-y"],inset:["inset-lt","inset-y","start","end","top","right","bottom","left"],"inset-lt":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-lt","gap-y"],p:["px","py","ps","lt","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-lt","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-lt":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-lt","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-lt","border-w-l"],"border-w-lt":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-lt"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-lt","border-color-l"],"border-color-lt":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-lt"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-lt","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-lt","touch-y","touch-pz"],"touch-lt":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Zt=bo(zo);function s(...e){return Zt((0,ea.clsx)(e))}var lt=require("react/jsx-runtime"),Ue=st.forwardRef(({className:e,...t},a)=>(0,lt.jsx)(De.Root,{ref:a,className:s("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Ue.displayName=De.Root.displayName;var Rt=st.forwardRef(({className:e,...t},a)=>(0,lt.jsx)(De.Image,{ref:a,className:s("aspect-square h-full w-full",e),...t}));Rt.displayName=De.Image.displayName;var je=st.forwardRef(({className:e,...t},a)=>(0,lt.jsx)(De.Fallback,{ref:a,className:s("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));je.displayName=De.Fallback.displayName;var Fe=q(require("react"));var se=Fe.forwardRef(({className:e,...t},a)=>(0,lt.jsx)("div",{ref:a,className:s("rounded-xl border bg-card text-card-foreground shadow",e),...t}));se.displayName="Card";var Pe=Fe.forwardRef(({className:e,...t},a)=>(0,lt.jsx)("div",{ref:a,className:s("flex flex-col space-y-1.5 p-6",e),...t}));Pe.displayName="CardHeader";var Se=Fe.forwardRef(({className:e,...t},a)=>(0,lt.jsx)("div",{ref:a,className:s("font-semibold leading-none tracking-tight",e),...t}));Se.displayName="CardTitle";var Tt=Fe.forwardRef(({className:e,...t},a)=>(0,lt.jsx)("div",{ref:a,className:s("text-sm text-muted-foreground",e),...t}));Tt.displayName="CardDescription";var ve=Fe.forwardRef(({className:e,...t},a)=>(0,lt.jsx)("div",{ref:a,className:s("p-6 pt-0",e),...t}));ve.displayName="CardContent";var Ye=Fe.forwardRef(({className:e,...t},a)=>(0,lt.jsx)("div",{ref:a,className:s("flex items-center p-6 pt-0",e),...t}));Ye.displayName="CardFooter";var ta=require("class-variance-authority");var Eo=(0,ta.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function le({className:e,variant:t,...a}){return(0,lt.jsx)("div",{className:s(Eo({variant:t}),e),...a})}var ia=require("lucide-react"),ra=require("date-fns");var $e=require("react");function oa({taskId:e,polling:t=!0,system:a="payload"}){let[o,l]=(0,$e.useState)(null),[n,c]=(0,$e.useState)(!1),[r,u]=(0,$e.useState)(null),m=async(v=!0)=>{if(e){v&&c(!0);try{let k=await fetch(`/api/tasks/${e}`);if(!k.ok)throw new Error(`Failed to fetch task: ${k.statusText}`);let P=await k.json();l(P)}catch(k){console.error("Error fetching task:",k),u(k instanceof Error?k:new Error("Unknown error occurred"))}finally{v&&c(!1)}}},R=()=>m(!1);return(0,$e.useEffect)(()=>{e&&m(!0);let v=null;return e&&t&&(v=setInterval(R,5e3)),()=>{v&&clearInterval(v)}},[e,t]),{task:o,loading:n,error:r}}var Lo=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"}},Uo=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function na({data:e}){let{id:t,system:a,fetchLatest:o,taskData:l,error:n}=e||{};if(!t)return null;let c=null,r=!0,u=n,m=o!==void 0?o:!0;if(c=l||{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:c,error:u}),m){let{task:P,loading:L,error:D}=oa({taskId:t,system:a});c=P,r=L,u=D}else r=!1;let R=Lo(c?.status||"todo"),v=Uo(c?.status||"todo"),k=c?.dateLogged||new Date().toISOString();try{let P=new Date(c?.dateLogged||"");isNaN(P.getTime())||(k=(0,ra.formatDistanceToNow)(P,{addSuffix:!0}))}catch{}return(0,lt.jsxs)(se,{className:s("w-full max-w-md shadow-md",u&&"border border-destructive"),children:[(0,lt.jsxs)(Pe,{className:"pb-2",children:[(0,lt.jsxs)("div",{className:"flex justify-between items-start",children:[(0,lt.jsx)(Se,{className:"text-lg font-semibold",children:r?"Loading...":c?.name||"Task"}),(0,lt.jsx)(le,{className:`${R}`,children:v})]}),c?.project&&(0,lt.jsxs)(Tt,{className:"text-sm text-gray-500",children:["Project: ",c.project.name]})]}),(0,lt.jsx)(ve,{className:"pb-2",children:r?(0,lt.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):u?(0,lt.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,lt.jsx)("p",{className:"text-sm text-foreground",children:c?.description||"......."})}),(0,lt.jsx)(Ye,{className:"pt-2 flex items-center justify-between",children:(0,lt.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,lt.jsx)(ia.Clock,{className:"h-3 w-3 mr-1"}),(0,lt.jsxs)("span",{children:["Created ",k]}),(0,lt.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,lt.jsxs)("span",{children:["Task #",t]})]})})]})}var At=q(require("react")),de=q(require("@radix-ui/react-scroll-area"));var he=At.forwardRef(({className:e,children:t,...a},o)=>(0,lt.jsxs)(de.Root,{ref:o,className:s("relative overflow-hidden",e),...a,children:[(0,lt.jsx)(de.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,lt.jsx)(sa,{}),(0,lt.jsx)(de.Corner,{})]}));he.displayName=de.Root.displayName;var sa=At.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,lt.jsx)(de.ScrollAreaScrollbar,{ref:o,orientation:t,className:s("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,lt.jsx)(de.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));sa.displayName=de.ScrollAreaScrollbar.displayName;var la={primary:"bg-blue-500",secondary:"bg-gray-500",accent:"bg-purple-500",categories:["bg-green-500","bg-blue-500","bg-purple-500","bg-pink-500","bg-indigo-500","bg-orange-500"],lists:["bg-green-400","bg-blue-400","bg-purple-400","bg-pink-400","bg-indigo-400","bg-orange-400"],items:["bg-green-300","bg-blue-300","bg-purple-300","bg-pink-300","bg-indigo-300","bg-orange-300"]};function Mt(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function pa({artefact:e,taskId:t,taskData:a,loading:o=!1,error:l=null}){let n=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},c=n.dateLogged;try{let r=new Date(n.dateLogged);isNaN(r.getTime())||(c=(0,ra.formatDistanceToNow)(r,{addSuffix:!0}))}catch{}return(0,lt.jsxs)(se,{className:"w-full max-w-md shadow-md",children:[(0,lt.jsx)(Pe,{className:"pb-2",children:(0,lt.jsx)("div",{className:"flex justify-between items-start",children:(0,lt.jsx)(Se,{className:"text-lg font-semibold",children:o?"Loading...":n.name})})}),(0,lt.jsx)(ve,{className:"pb-2",children:o?(0,lt.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):l?(0,lt.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,lt.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,lt.jsx)(Ye,{className:"pt-2 flex items-center justify-between",children:(0,lt.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,lt.jsx)(ia.Clock,{className:"h-3 w-3 mr-1"}),(0,lt.jsxs)("span",{children:["Created ",c]}),(0,lt.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,lt.jsxs)("span",{children:["Task #",n.id]})]})})]})}var Nt=require("framer-motion");var bt=q(require("react")),Ut=q(require("next/link"));var ma=require("@radix-ui/react-slot"),ga=q(require("react")),jo=(0,ta.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),S=ga.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...l},n)=>(0,lt.jsx)(e?ma.Slot:"button",{className:s(jo({className:t,size:a,variant:o})),ref:n,...l}));S.displayName="Button";var ba=q(require("react"));var Ze=ba.forwardRef(({className:e,type:t,...a},o)=>(0,lt.jsx)("input",{type:t,className:s("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...a}));Ze.displayName="Input";var et=q(require("react")),W=q(require("@radix-ui/react-dialog"));var ya=W.Root;var Fo=W.Portal;var xa=et.forwardRef(({className:e,...t},a)=>(0,lt.jsx)(W.Overlay,{ref:a,className:s("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));xa.displayName=W.Overlay.displayName;var It=et.forwardRef(({className:e,children:t,...a},o)=>(0,lt.jsxs)(Fo,{children:[(0,lt.jsx)(xa,{}),(0,lt.jsxs)(W.Content,{ref:o,className:s("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-lt-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,(0,lt.jsxs)(W.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,lt.jsx)(ia.X,{className:"h-4 w-4"}),(0,lt.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));It.displayName=W.Content.displayName;var Bt=({className:e,...t})=>(0,lt.jsx)("div",{className:s("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Bt.displayName="DialogHeader";var Ho=({className:e,...t})=>(0,lt.jsx)("div",{className:s("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-lt-2",e),...t});Ho.displayName="DialogFooter";var zt=et.forwardRef(({className:e,...t},a)=>(0,lt.jsx)(W.Title,{ref:a,className:s("text-lg font-semibold leading-none tracking-tight",e),...t}));zt.displayName=W.Title.displayName;var Oo=et.forwardRef(({className:e,...t},a)=>(0,lt.jsx)(W.Description,{ref:a,className:s("text-sm text-muted-foreground",e),...t}));Oo.displayName=W.Description.displayName;var tt=q(require("@radix-ui/react-checkbox")),Ca=q(require("react")),Et=Ca.forwardRef(({className:e,...t},a)=>(0,lt.jsx)(tt.Root,{className:s("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:a,...t,children:(0,lt.jsx)(tt.Indicator,{className:s("flex items-center justify-center text-current"),children:(0,lt.jsx)(ia.Check,{className:"h-4 w-4"})})}));Et.displayName=tt.Root.displayName;var ye=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var ka=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,lt.jsx)(ia.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,lt.jsx)(ia.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,lt.jsx)(ia.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,lt.jsx)(ia.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,lt.jsx)(ia.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,lt.jsx)(ia.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,lt.jsx)(ia.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,lt.jsx)(ia.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,lt.jsx)(ia.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,lt.jsx)(ia.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],mt=[{id:"1",name:"ia-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var Lt=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],dt=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],gt=[{id:"1",title:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",title:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",title:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",title:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",title:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",title:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",title:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],Vo=[...gt,{id:"8",title:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",title:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",title:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",title:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",title:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],Go=[...mt,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],pt={projects:[{id:"1",name:"Empty Project",description:"A project with no tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},Na={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:gt.filter(e=>e.epicId==="1")};var Wi={empty:{initialProjects:pt.projects,initialEpics:pt.epics,initialSprints:pt.sprints,initialTasks:pt.tasks},default:{initialProjects:mt,initialEpics:Lt,initialSprints:dt,initialTasks:gt},highDensity:{initialProjects:mt,initialEpics:Lt,initialSprints:dt,initialTasks:Vo},singleEpic:{initialProjects:mt,initialEpics:Na.epics,initialSprints:dt,initialTasks:Na.tasks},multipleProjects:{initialProjects:Go,initialEpics:Lt,initialSprints:dt,initialTasks:gt}},ut=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.js","Python","Git"].map(ye),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(ye),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused on driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(ye),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(ye),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated to understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","R","Statistics"].map(ye),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(ye),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(ye),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(ye),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(ye),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(ye),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],$lt=[{id:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:ut.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:ut.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date,dueTime:"16:00",colleague:ut.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var Ki=ut.filter(e=>e.type==="digital");function Da(e,t){let[a,o]=(0,$e.useState)(()=>{if(typeof window>"u")return t;try{let n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch{return t}}),l=n=>{try{o(n),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(n))}catch{}};return(0,$e.useEffect)(()=>{l(a)},[]),[a,l]}function jt({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:l=ka[0],onBusinessUnitChange:n,onSearch:c,className:r,logo:u="/headerlogo.png",appName:m="Nuvia",tagline:R="Collaboration Platform"}){let[v,k]=bt.useState({}),[P,L]=Da("sidebar-favorites",{}),[D,w]=bt.useState(null),[T,M]=bt.useState(""),y=d=>{k(A=>({...A,[d]:!A[d]}))},U=d=>{n?.(d)},X=()=>{T.trim()&&c?.(T.trim())},K=d=>{d.key==="Enter"&&(d.preventDefault(),X())},re=(d,A)=>{let z=P[d]||[],p=z.includes(A)?z.filter(B=>B!==A):z.concat(A);L({...P,[d]:p})},J=d=>{if(!d.items||!d.maxItems||d.items.length<=d.maxItems)return d.items||[];let A=P[d.id]||[],z=d.items.filter(B=>A.includes(B.id)),p=d.items.filter(B=>!A.includes(B.id));return[...z,...p].slice(0,d.maxItems)},G=d=>d.maxItems&&d.items&&d.items.length>d.maxItems,Q=e,Z=d=>{let A=G(d),z=J(d),p=(0,lt.jsxs)(lt.Fragment,{children:[(0,lt.jsxs)("div",{className:"flex items-center gap-3",children:[d.icon,(0,lt.jsx)("span",{children:d.title})]}),d.badge&&(0,lt.jsx)(le,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:d.badge}),d.items&&(0,lt.jsx)(ia.ChevronDown,{className:s("ml-2 h-4 w-4 transition-transform",v[d.title]?"rotate-180":"")})]}),B=s("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",d.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return d.url?(0,lt.jsx)(Ut.default,{href:d.url,className:B,onClick:a?o:void 0,children:p}):(0,lt.jsx)("button",{className:B,onClick:()=>d.items&&y(d.title),children:p})},I=()=>{let d=e.find(z=>z.id===D);if(!d||!d.items||!d.maxItems)return null;let A=P[d.id]||[];return(0,lt.jsx)(ya,{open:!!D,onOpenChange:z=>!z&&w(null),children:(0,lt.jsxs)(It,{className:"sm:max-w-md",children:[(0,lt.jsxs)(Bt,{children:[(0,lt.jsxs)(zt,{children:["Manage ",d.title," Favorites"]}),(0,lt.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",d.maxItems," items to show in ",d.title.toLowerCase(),"."]})]}),(0,lt.jsx)(he,{className:"max-h-96 pr-4",children:(0,lt.jsx)("div",{className:"space-y-4",children:d.items.map(z=>(0,lt.jsxs)("div",{className:"flex items-center space-lt-2",children:[(0,lt.jsx)(Et,{id:z.id,checked:A.includes(z.id),onCheckedChange:()=>re(d.id,z.id),disabled:!A.includes(z.id)&&A.length>=(d.maxItems||0)}),(0,lt.jsxs)("label",{htmlFor:z.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[z.title,z.badge&&(0,lt.jsx)(le,{variant:"outline",className:"text-xs",children:z.badge})]})]},z.id))})})]})})},Ne=(0,lt.jsxs)("div",{className:"flex h-full flex-col border-r bg-background",children:[(0,lt.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,lt.jsxs)("div",{className:"flex items-center gap-3",children:[(0,lt.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,lt.jsx)("img",{src:u,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,lt.jsxs)("div",{children:[(0,lt.jsx)("h2",{className:"font-semibold",children:m}),(0,lt.jsx)("p",{className:"text-xs text-muted-foreground",children:R})]})]}),a&&(0,lt.jsx)(S,{variant:"ghost",size:"icon",onClick:o,children:(0,lt.jsx)(ia.X,{className:"h-5 w-5"})})]}),(0,lt.jsx)("div",{className:"px-3 py-2",children:(0,lt.jsxs)("div",{className:"relative",children:[(0,lt.jsx)(ia.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,lt.jsx)(Ze,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:T,onChange:d=>M(d.target.value),onKeyPress:K})]})}),(0,lt.jsx)(he,{className:"flex-1 px-3 py-2",children:(0,lt.jsx)("div",{className:"space-y-1",children:Q.map(d=>(0,lt.jsxs)("div",{className:"mb-1",children:[Z(d),d.items&&v[d.title]&&(0,lt.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[J(d).map(A=>(0,lt.jsxs)(Ut.default,{href:A.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[A.title,A.badge&&(0,lt.jsx)(le,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:A.badge})]},A.id)),G(d)&&d.items&&d.items.length>J(d).length&&(0,lt.jsxs)("button",{onClick:()=>w(d.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",d.items.length-J(d).length," more available"]})]})]},d.id))})}),(0,lt.jsx)("div",{className:"border-t p-3",children:(0,lt.jsx)("div",{className:"space-y-1",children:(0,lt.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,lt.jsx)(ia.Settings,{className:"h-5 w-5"}),(0,lt.jsx)("span",{children:"Settings"})]})})}),(0,lt.jsx)(I,{})]});return a?(0,lt.jsx)("div",{className:s("fixed inset-y-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-lt-0":"-translate-lt-full",r),children:Ne}):(0,lt.jsx)("div",{className:s("fixed inset-y-0 left-0 z-30 w-64 transform border-r bg-background transition-transform duration-300 ease-in-out",t?"translate-lt-0":"-translate-lt-full",r),children:Ne})}var Pa=q(require("react")),ge=q(require("@radix-ui/react-tooltip"));var vt=ge.Provider,ht=ge.Root,yt=ge.Trigger,at=Pa.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,lt.jsx)(ge.Portal,{children:(0,lt.jsx)(ge.Content,{ref:o,sideOffset:t,className:s("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));at.displayName=ge.Content.displayName;var Sa=require("next-themes");function Ra(){let{setTheme:e,theme:t}=(0,Sa.useTheme)();return(0,lt.jsx)(vt,{children:(0,lt.jsxs)(ht,{children:[(0,lt.jsx)(yt,{asChild:!0,children:(0,lt.jsxs)(S,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,lt.jsx)(ia.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,lt.jsx)(ia.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,lt.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,lt.jsx)(at,{children:"Toggle theme"})]})})}function Ta({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:l,className:n}){let c=e.filter(m=>!m.read),r=c.length,u=m=>{switch(m){case"info":return(0,lt.jsx)(ia.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,lt.jsx)(ia.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,lt.jsx)(ia.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,lt.jsx)(ia.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,lt.jsx)(Nt.AnimatePresence,{children:t&&(0,lt.jsxs)(lt.Fragment,{children:[(0,lt.jsx)(Nt.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,lt.jsx)(Nt.motion.div,{initial:{lt:"100%"},animate:{lt:0},exit:{lt:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:s("fixed inset-y-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",n),children:(0,lt.jsxs)("div",{className:"flex h-full flex-col",children:[(0,lt.jsxs)("div",{className:"flex items-center justify-between border-lt p-4",children:[(0,lt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,lt.jsx)(ia.Bell,{className:"h-5 w-5"}),(0,lt.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),r>0&&(0,lt.jsxs)(le,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[r," new"]})]}),(0,lt.jsxs)(S,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,lt.jsx)(ia.X,{className:"h-5 w-5"}),(0,lt.jsx)("span",{className:"sr-only",children:"Close"})]})]}),r>0&&(0,lt.jsxs)("div",{className:"flex items-center justify-between border-lt p-2",children:[(0,lt.jsxs)("span",{className:"text-sm text-muted-foreground",children:[r," unread notification",r!==1?"s":""]}),(0,lt.jsx)(S,{variant:"ghost",size:"sm",onClick:l,className:"text-sm",children:"Dismiss all"})]}),c.length>0?(0,lt.jsx)(he,{className:"flex-1",children:(0,lt.jsx)("div",{className:"divide-y",children:c.map(m=>(0,lt.jsxs)("div",{className:s("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,lt.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:u(m.type)}),(0,lt.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,lt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,lt.jsx)("p",{className:"font-medium",children:m.title}),(0,lt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,lt.jsx)("p",{className:"text-xs text-muted-foreground",children:m.time}),(0,lt.jsx)(S,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(m.id),title:"Dismiss",children:(0,lt.jsx)(ia.Check,{className:"h-3 w-3"})})]})]}),(0,lt.jsx)("p",{className:"text-sm text-muted-foreground",children:m.description}),m.actionLabel&&(0,lt.jsxs)(S,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:m.onAction,children:[m.actionLabel,(0,lt.jsx)(ia.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},m.id))})}):(0,lt.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,lt.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,lt.jsx)(ia.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,lt.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,lt.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var Oe=q(require("@radix-ui/react-tabs"));function Aa({className:e,...t}){return(0,lt.jsx)(Oe.Root,{"data-slot":"tabs",className:s("flex flex-col gap-2",e),...t})}function Ma({className:e,...t}){return(0,lt.jsx)(Oe.List,{"data-slot":"tabs-list",className:s("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Ia({className:e,...t}){return(0,lt.jsx)(Oe.Trigger,{"data-slot":"tabs-trigger",className:s("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var Re=q(require("react")),C=q(require("@radix-ui/react-dropdown-menu")),Ke=require("@radix-ui/react-icons");var Ba=C.Root,za=C.Trigger;var Wo=Re.forwardRef(({className:e,inset:t,children:a,...o},l)=>(0,$.jsxs)(C.SubTrigger,{ref:l,className:s("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[a,(0,$.jsx)(Ke.ChevronRightIcon,{className:"ml-auto"})]}));Wo.displayName=C.SubTrigger.displayName;var $o=Re.forwardRef(({className:e,...t},a)=>(0,$.jsx)(C.SubContent,{ref:a,className:s("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));$o.displayName=C.SubContent.displayName;var Ht=Re.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,$.jsx)(C.Portal,{children:(0,$.jsx)(C.Content,{ref:o,sideOffset:t,className:s("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));Ht.displayName=C.Content.displayName;var Ot=Re.forwardRef(({className:e,inset:t,...a},o)=>(0,$.jsx)(C.Item,{ref:o,className:s("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...a}));Ot.displayName=C.Item.displayName;var Ko=Re.forwardRef(({className:e,children:t,checked:a,...o},l)=>(0,$.jsxs)(C.CheckboxItem,{ref:l,className:s("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[(0,$.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,$.jsx)(C.ItemIndicator,{children:(0,$.jsx)(Ke.CheckIcon,{className:"h-4 w-4"})})}),t]}));Ko.displayName=C.CheckboxItem.displayName;var qo=Re.forwardRef(({className:e,children:t,...a},o)=>(0,$.jsxs)(C.RadioItem,{ref:o,className:s("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,$.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,$.jsx)(C.ItemIndicator,{children:(0,$.jsx)(Ke.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));qo.displayName=C.RadioItem.displayName;var _o=Re.forwardRef(({className:e,inset:t,...a},o)=>(0,$.jsx)(C.Label,{ref:o,className:s("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));_o.displayName=C.Label.displayName;var Jo=Re.forwardRef(({className:e,...t},a)=>(0,$.jsx)(C.Separator,{ref:a,className:s("-mx-1 my-1 h-px bg-muted",e),...t}));Jo.displayName=C.Separator.displayName;var Xo=({className:e,...t})=>(0,$.jsx)("span",{className:s("ml-auto text-xs tracking-widest opacity-60",e),...t});Xo.displayName="DropdownMenuShortcut";function La({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:l="700px",gridCols:n=6}){let c=a.find(r=>r.value===e);return(0,lt.jsxs)(Nt.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,lt.jsx)("div",{className:"hidden md:block",children:(0,lt.jsx)(Aa,{value:e,onValueChange:t,children:(0,lt.jsx)(Ma,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:l,gridTemplateColumns:`repeat(${Math.min(n,a.length)}, minmax(0, 1fr))`},children:a.map(r=>(0,lt.jsx)(Nt.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,lt.jsx)(Ia,{value:r.value,className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:r.label})},r.value))})})}),(0,lt.jsx)("div",{className:"md:hidden",children:(0,lt.jsxs)(Ba,{children:[(0,lt.jsx)(za,{asChild:!0,children:(0,lt.jsxs)(S,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[c?.label||"Select",(0,lt.jsx)(ia.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,lt.jsx)(Ht,{align:"center",className:"w-[180px]",children:a.map(r=>(0,lt.jsx)(Ot,{onClick:()=>t?.(r.value),className:`cursor-pointer ${e===r.value?"bg-accent":""}`,children:r.label},r.value))})]})})]})}function Ua({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:l=!0,className:n,activeTab:c="assistant",onTabChange:r,showTabs:u=!0,tabOptions:m=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:R,actionIcon:v=(0,lt.jsx)(ia.Bot,{className:"mr-2 h-4 w-4"}),actionText:k="Action",onNotificationRemove:P,onRemoveAll:L,logo:D="/headerlogo.png",appName:w="Nuvia",tagline:T="Collaboration Platform"}){let[M,y]=(0,$e.useState)(!1),[U,X]=(0,$e.useState)(t),K=U.filter(G=>!G.read).length,re=G=>{X(Q=>Q.filter(Z=>Z.id!==G)),P?.(G)},J=()=>{X(G=>G.filter(Q=>Q.read)),L?.()};return(0,lt.jsxs)(lt.Fragment,{children:[(0,lt.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 border-lt bg-background/95 px-4 backdrop-blur ${n||""}`,children:[(0,lt.jsx)(S,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,lt.jsx)(ia.Menu,{className:"h-5 w-5"})}),(0,lt.jsx)(S,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,lt.jsx)(ia.PanelLeft,{className:"h-5 w-5"})}),!l&&(0,lt.jsxs)(Nt.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,lt:-20},animate:{opacity:1,lt:0},transition:{duration:.3},children:[(0,lt.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,lt.jsx)("img",{src:D,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,lt.jsxs)("div",{children:[(0,lt.jsx)("h2",{className:"font-semibold text-sm",children:w}),(0,lt.jsx)("p",{className:"text-xs text-muted-foreground",children:T})]})]}),(0,lt.jsxs)("div",{className:"flex flex-1 items-center",children:[u&&(0,lt.jsx)(La,{activeTab:c,onTabChange:r,tabOptions:m}),(0,lt.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,lt.jsx)(Nt.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,lt:20},animate:{opacity:1,lt:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,lt.jsx)(Nt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,lt.jsxs)(S,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:R,children:[v,k]})})}),(0,lt.jsx)(Ra,{}),(0,lt.jsx)(vt,{children:(0,lt.jsxs)(ht,{children:[(0,lt.jsx)(yt,{asChild:!0,children:(0,lt.jsx)(Nt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,lt.jsxs)(S,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>y(!0),children:[(0,lt.jsx)(Nt.motion.div,{animate:K>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:K>0?1/0:0,repeatDelay:3},children:(0,lt.jsx)(ia.Bell,{className:"h-5 w-5"})}),K>0&&(0,lt.jsx)(Nt.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:K})]})})}),(0,lt.jsx)(at,{children:"Notifications"})]})}),(0,lt.jsx)(Nt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,lt.jsxs)(Ue,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,lt.jsx)(Rt,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,lt.jsx)(je,{})]})})]})]})]}),(0,lt.jsx)(Ta,{notifications:U,open:M,onClose:()=>y(!1),onNotificationRemove:re,onRemoveAll:J})]})}var ja=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,lt.jsx)(ia.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Ha({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:l=ja[0],onBusinessUnitChange:n,onSearch:c,businessUnits:r=ja,activeTab:u,onTabChange:m,showTabs:R=!1,onActionClick:v,actionIcon:k,actionText:P="Action",onNotificationRemove:L,onRemoveAll:D,logo:w="/headerlogo.png",appName:T="Nuvia",tagline:M="Collaboration Platform"}){let[y,U]=(0,$e.useState)(!0),[X,K]=(0,$e.useState)(!1),[re,J]=(0,$e.useState)(l),G=Q=>{J(Q),n?.(Q)};return(0,lt.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl border bg-background w-[]",children:[X&&(0,lt.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>K(!1)}),(0,lt.jsx)("div",{className:"md:hidden",children:(0,lt.jsx)(jt,{items:e,isOpen:X,isMobile:!0,onClose:()=>K(!1),currentBusinessUnit:re,onBusinessUnitChange:G,onSearch:c,logo:w,appName:T,tagline:M})}),(0,lt.jsx)("div",{className:"hidden md:block",children:(0,lt.jsx)(jt,{items:e,isOpen:y,isMobile:!1,currentBusinessUnit:re,onBusinessUnitChange:G,onSearch:c,logo:w,appName:T,tagline:M})}),(0,lt.jsxs)("div",{className:s("min-h-screen fixed w-full transition-all duration-300 ease-in-out",y?"md:pl-64":"md:pl-0"),children:[(0,lt.jsx)(Ua,{title:a,notifications:o,onToggleSidebar:()=>U(!y),onToggleMobileMenu:()=>K(!0),sidebarOpen:y,activeTab:u,onTabChange:m,showTabs:R,onActionClick:v,actionIcon:k,actionText:P,onNotificationRemove:L,onRemoveAll:D,logo:w,appName:T,tagline:M}),(0,lt.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-auto",children:t})]})]})}function Oa({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:l,onSessionEdit:n,onSessionDelete:c,className:r}){return(0,lt.jsx)("div",{className:`space-y-4 ${r||""}`,children:(0,lt.jsxs)(se,{className:"shadow-sm",children:[(0,lt.jsx)("div",{className:"p-4 border-lt",children:(0,lt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,lt.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,lt.jsx)(ia.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,lt.jsxs)(S,{onClick:o,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,lt.jsx)(ia.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,lt.jsx)(he,{className:"h-[600px]",children:(0,lt.jsx)("div",{className:"p-2",children:e.length===0?(0,lt.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(u=>(0,lt.jsx)("div",{className:s("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===u.id&&"bg-muted border"),onClick:()=>l(u),children:(0,lt.jsx)("div",{className:"flex items-start gap-3",children:(0,lt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,lt.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,lt.jsx)("h4",{className:"font-medium text-sm truncate",children:u.title}),(0,lt.jsx)("div",{className:"flex items-center gap-1",children:(0,lt.jsxs)("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-1",children:[n&&(0,lt.jsx)(S,{variant:"ghost",size:"icon",className:"h-5 w-5 rounded",onClick:m=>{m.stopPropagation(),n(u.id)},children:(0,lt.jsx)(ia.Edit3,{className:"h-3 w-3"})}),c&&(0,lt.jsx)(S,{variant:"ghost",size:"icon",className:"h-5 w-5 rounded text-destructive hover:text-destructive",onClick:m=>{m.stopPropagation(),c(u.id)},children:(0,lt.jsx)(ia.Trash2,{className:"h-3 w-3"})})]})})]}),(0,lt.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:u.lastMessage})]})})},u.id))})})]})})}function Va({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:l,colorScheme:n=la,className:c}){let[r,u]=(0,$e.useState)([]),[m,R]=(0,$e.useState)([]),v=r[r.length-1],k=v?.children||e,P=(y,U)=>{switch(y.type){case"category":return n.categories[U%n.categories.length];case"list":return n.lists[U%n.lists.length];case"item":return n.items[U%n.items.length];default:return n.primary}},L=(0,$e.useMemo)(()=>({path:r,selectedItems:m,filters:{}}),[r,m]);(0,$e.useEffect)(()=>{l&&l(L)},[L,l]);let D=y=>{y.type==="category"||y.type==="list"?u([...r,y]):y.type==="item"&&R([...m,y])},w=()=>{u(r.slice(0,-1))},T=y=>{u(r.slice(0,y+1))},M=()=>v?.actions?v.actions:[];return t?(0,lt.jsxs)("div",{className:s("w-full",c),children:[(0,lt.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,lt.jsxs)("div",{className:"flex items-center gap-2",children:[r.length>0&&(0,lt.jsx)(Nt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:w,className:s("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,lt.jsx)(ia.ChevronLeft,{className:s("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-lt-0.5")})}),(0,lt.jsx)("h4",{className:"font-medium text-sm",children:v?.name||"Capabilities"})]}),(0,lt.jsx)(Nt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:a,className:s("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,lt.jsx)(ia.X,{className:s("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),r.length>0&&(0,lt.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,lt.jsx)(Nt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>u([]),className:s("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,lt.jsxs)("span",{className:"relative",children:["Capabilities",(0,lt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-lt-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),r.map((y,U)=>(0,lt.jsxs)("div",{className:"flex items-center gap-1",children:[(0,lt.jsx)(ia.ChevronRight,{className:"h-2 w-2"}),(0,lt.jsx)(Nt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>T(U),className:s("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,lt.jsxs)("span",{className:"relative",children:[y.name,(0,lt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-lt-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},y.id))]}),(0,lt.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,lt.jsx)(Nt.AnimatePresence,{mode:"wait",children:(0,lt.jsx)(Nt.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:v?.type==="list"&&v.data?(0,lt.jsx)(Zo,{data:v.data,onItemSelect:y=>R([...m,y]),colorScheme:n}):(0,lt.jsx)(Qo,{capabilities:k,onSelect:D,colorScheme:n})},v?.id||"root")})})]}):(0,lt.jsxs)(S,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,lt.jsx)(ia.Menu,{className:"h-4 w-4"}),(0,lt.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function Qo({capabilities:e,onSelect:t,colorScheme:a}){return(0,lt.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,l)=>(0,lt.jsx)(Yo,{capability:o,onClick:()=>t(o),color:a.categories[l%a.categories.length]},o.id))})}function Yo({capability:e,onClick:t,selected:a,color:o}){return(0,lt.jsxs)(Nt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:s("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",a&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,lt.jsx)("div",{className:s("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,lt.jsxs)("span",{className:"truncate relative",children:[e.name,(0,lt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-lt-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,lt.jsx)(ia.ChevronRight,{className:s("h-3 w-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-lt-0.5")}),e.type==="list"&&e.data&&(0,lt.jsx)(le,{variant:"secondary",className:s("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function Zo({data:e,onItemSelect:t,colorScheme:a}){return(0,lt.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,l)=>(0,lt.jsxs)(Nt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:s("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(o),children:[(0,lt.jsx)("div",{className:s("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[l%a.items.length])}),(0,lt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,lt.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,lt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-lt-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),o.subtitle&&(0,lt.jsx)("div",{className:s("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,lt.jsx)(le,{variant:"secondary",className:s("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:o.value})]},o.id))})}function Ga(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function Wa({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:l,fileUploads:n,isDragOver:c,enableFileUpload:r,onInputChange:u,onSendMessage:m,onKeyPress:R,onFileUpload:v,onRemoveFile:k,onDragOver:P,className:L}){let D=(0,$e.useRef)(null),w=(0,$e.useRef)(null),T=(0,$e.useRef)(null),[M,y]=(0,$e.useState)(!1),[U,X]=(0,$e.useState)({path:[],selectedItems:[],filters:{}});(0,$e.useEffect)(()=>{D.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,$e.useEffect)(()=>{M&&setTimeout(()=>{D.current?.scrollIntoView({behavior:"smooth"})},100)},[M]);let K=()=>Mt(U),re=()=>{let p=[];return l.forEach(B=>{B.actions&&B.actions.forEach(H=>{p.push({label:H.label,action:()=>J(H.id,{path:[B],selectedItems:[],filters:{}})})}),B.children&&B.children.forEach(H=>{H.type==="list"&&H.data&&p.push({label:`View ${H.name}`,action:()=>y(!0)})})}),p.slice(0,5)},J=(p,B)=>{console.log("Capability action:",p,B);let H=`Executing ${p} with context: ${JSON.stringify(B.path.map(ee=>ee.name))}`;y(!1)},G=Mt({path:[],selectedItems:[],filters:{}}),Q=p=>{v(p.target.files),p.target.files&&(p.target.value="")},Z=p=>{p.preventDefault(),P(!0)},I=p=>{p.preventDefault(),P(!1)},Ne=p=>{p.preventDefault(),P(!1),v(p.dataTransfer.files)},d=p=>{if(p===0)return"0 Bytes";let B=1024,H=["Bytes","KB","MB","GB"],ee=Math.floor(Math.log(p)/Math.log(B));return parseFloat((p/Math.pow(B,ee)).toFixed(2))+" "+H[ee]},A=p=>p.startsWith("image/")?(0,lt.jsx)(ia.Image,{className:"h-4 w-4"}):p.startsWith("text/")?(0,lt.jsx)(ia.FileText,{className:"h-4 w-4"}):(0,lt.jsx)(ia.File,{className:"h-4 w-4"}),z=p=>{let B=p.role==="assistant",H=p.role==="user",ee=Ga(p);return(0,lt.jsxs)("div",{className:s("flex items-start gap-3",H?"flex-row-reverse":""),children:[(0,lt.jsx)(Ue,{className:"h-8 w-8 shrink-0",children:(0,lt.jsx)(je,{className:s(H?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:H?(0,lt.jsx)(ia.User,{className:"h-4 w-4"}):(0,lt.jsx)(ia.Bot,{className:"h-4 w-4"})})}),(0,lt.jsxs)("div",{className:s("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",H?"bg-primary text-primary-foreground":"bg-muted"),children:[ee&&(0,lt.jsx)("div",{className:"mb-2 last:mb-0",children:(0,lt.jsx)("p",{className:"text-sm",children:ee})}),p.parts.map((V,ne)=>{if(V.type==="text")return null;if(V.type==="file"){let N=V;return(0,lt.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,lt.jsxs)("div",{className:"flex items-center gap-2",children:[A(N.mimeType||"application/octet-stream"),(0,lt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,lt.jsx)("p",{className:"text-sm font-medium truncate",children:N.name||N.url?.split("/").pop()||"File"}),N.size&&(0,lt.jsx)("p",{className:"text-xs opacity-70",children:d(N.size)}),N.mimeType&&(0,lt.jsx)("p",{className:"text-xs opacity-70",children:N.mimeType})]}),N.url&&(0,lt.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>window.open(N.url,"_blank"),className:"h-8 w-8 p-0",children:(0,lt.jsx)(ia.Download,{className:"h-4 w-4"})})]})},ne)}if(V.type.startsWith("tool-")){let N=V,be=V.type.replace("tool-","");if(be==="task")switch(N.state){case"input-available":return(0,lt.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},ne);case"output-available":return(0,lt.jsx)("div",{className:"mb-2",children:(0,lt.jsx)(na,{data:{id:N.output?.id||N.input?.id,fetchLatest:!1,taskData:N.output||N.input}})},ne);case"output-error":return(0,lt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",N.errorText]},ne);default:return null}if(be==="artefact")switch(N.state){case"input-available":return(0,lt.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},ne);case"output-available":return(0,lt.jsx)("div",{className:"mb-2",children:(0,lt.jsx)(pa,{artefact:N.output?.description||"",taskId:N.output?.id||N.input?.id,taskData:N.output||N.input})},ne);case"output-error":return(0,lt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",N.errorText]},ne);default:return null}return(0,lt.jsx)("div",{className:"mb-2",children:(0,lt.jsxs)(se,{className:"w-full max-w-md",children:[(0,lt.jsx)(Pe,{children:(0,lt.jsx)(Se,{className:"text-lg",children:be})}),(0,lt.jsxs)(ve,{children:[N.state==="input-available"&&(0,lt.jsxs)("p",{className:"text-sm",children:["Processing ",be,"..."]}),N.state==="output-available"&&(0,lt.jsx)("pre",{className:"text-sm",children:JSON.stringify(N.output,null,2)}),N.state==="output-error"&&(0,lt.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",N.errorText]})]})]})},ne)}if(V.type.startsWith("data-")){let N=V,be=V.type.replace("data-","");return be==="reference"?(0,lt.jsx)("div",{className:"mb-2",children:(0,lt.jsx)(se,{className:"w-full",children:(0,lt.jsx)(ve,{className:"p-4",children:(0,lt.jsx)("div",{className:"space-y-2",children:N.data?.references?.map((oe,Je)=>(0,lt.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,lt.jsx)(le,{variant:"outline",children:oe.type||"link"}),(0,lt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,lt.jsx)("p",{className:"text-sm font-medium truncate",children:oe.title}),oe.description&&(0,lt.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:oe.description})]}),oe.url&&(0,lt.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>window.open(oe.url,"_blank"),className:"h-8 w-8 p-0",children:(0,lt.jsx)(ia.ExternalLink,{className:"h-4 w-4"})})]},Je))})})})},ne):be==="menu"?(0,lt.jsx)("div",{className:"mb-2",children:(0,lt.jsxs)(se,{className:"w-full",children:[(0,lt.jsx)(Pe,{children:(0,lt.jsx)(Se,{className:"text-lg",children:N.data?.title})}),(0,lt.jsx)(ve,{children:(0,lt.jsx)("div",{className:"space-y-2",children:N.data?.items?.map((oe,Je)=>(0,lt.jsx)(S,{variant:"outline",className:"w-full justify-start",onClick:oe.action,children:(0,lt.jsxs)("div",{className:"text-left",children:[(0,lt.jsx)("p",{className:"font-medium",children:oe.label}),oe.description&&(0,lt.jsx)("p",{className:"text-xs text-muted-foreground",children:oe.description})]})},Je))})})]})},ne):(0,lt.jsx)("div",{className:"mb-2",children:(0,lt.jsxs)(se,{className:"w-full max-w-md",children:[(0,lt.jsx)(Pe,{children:(0,lt.jsx)(Se,{className:"text-lg",children:be})}),(0,lt.jsx)(ve,{children:(0,lt.jsx)("pre",{className:"text-sm",children:JSON.stringify(N.data,null,2)})})]})},ne)}return null})]})]})};return(0,lt.jsxs)(se,{className:`h-full flex flex-col shadow-sm ${L||""}`,children:[(0,lt.jsxs)(he,{ref:w,className:"flex-1 p-4",onDragOver:Z,onDragLeave:I,onDrop:Ne,children:[(0,lt.jsxs)("div",{className:s("space-y-4",c&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,lt.jsx)(Nt.AnimatePresence,{children:e.map(p=>(0,lt.jsx)(Nt.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:s("flex gap-3",p.role==="user"?"flex-row-reverse":"flex-row"),children:z(p)},p.id))}),M&&(0,lt.jsxs)(Nt.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,lt.jsx)(Ue,{className:"h-8 w-8",children:(0,lt.jsx)(je,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,lt.jsx)(ia.Bot,{className:"h-4 w-4"})})}),(0,lt.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,lt.jsx)(Va,{capabilities:l,isOpen:M,onToggle:()=>y(!M),onActionSelect:J,className:"w-full"})})]}),a&&(0,lt.jsxs)(Nt.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,lt.jsx)(Ue,{className:"h-8 w-8",children:(0,lt.jsx)(je,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,lt.jsx)(ia.Bot,{className:"h-4 w-4"})})}),(0,lt.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,lt.jsxs)("div",{className:"flex space-lt-1",children:[(0,lt.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,lt.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,lt.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,lt.jsx)("div",{ref:D})]}),n.length>0&&(0,lt.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,lt.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(p=>(0,lt.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[A(p.file.type),(0,lt.jsx)("span",{className:"text-sm font-medium",children:p.file.name}),(0,lt.jsx)("span",{className:"text-xs text-muted-foreground",children:d(p.file.size)}),(0,lt.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>k(p.id),className:"h-6 w-6 p-0",children:(0,lt.jsx)(ia.X,{className:"h-4 w-4"})})]},p.id))})}),(0,lt.jsxs)("div",{className:"border-t p-4 bg-muted/20",children:[(0,lt.jsxs)("div",{className:"flex gap-3",children:[(0,lt.jsx)(Ze,{value:t,onChange:p=>u(p.target.value),onKeyPress:R,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),r&&(0,lt.jsx)(S,{variant:"outline",size:"icon",onClick:()=>T.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,lt.jsx)(ia.Paperclip,{className:"h-4 w-4"})}),(0,lt.jsx)(S,{onClick:m,disabled:!t.trim()&&n.length===0||a,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,lt.jsx)(ia.Send,{className:"h-4 w-4"})})]}),(0,lt.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,lt.jsxs)(S,{onClick:()=>y(!M),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,lt.jsx)(ia.Menu,{className:"h-3 w-3 mr-1"}),M?"Hide":"Show"," Capabilities"]}),(0,lt.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[K().map((p,B)=>(0,lt.jsx)(S,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>J(p.id,U),children:p.label},`context-${p.id}`)),K().length===0&&re().map((p,B)=>(0,lt.jsx)(S,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:p.action,children:p.label},`suggestion-${B}`))]})]}),r&&(0,lt.jsx)("input",{ref:T,type:"file",multiple:!0,onChange:Q,className:"hidden"})]})]})}function Ka({messages:e=[],businessUnits:t=[],capabilities:a=[],sidebarItems:o=[],notifications:l=[],sessions:n=[],onNewChat:c,onSessionSelect:r,onSessionDelete:u,onSessionEdit:m=()=>console.log("Session edit not implemented"),onBusinessUnitChange:R=()=>{},onNotificationRemove:v=()=>{},onRemoveAll:k=()=>{},onActionClick:P=()=>{},onSearch:L=Z=>console.log("Search query:",Z),initialTeam:D="design",currentSession:w=null,showCapabilities:T=!0,title:M="Digital Colleagues",enableFileUpload:y=!0,maxFileSize:U=10,allowedFileTypes:X=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:K="/headerlogo.png",appName:re="Nuvia",tagline:J="AI-Powered Workspace",actionIcon:G=(0,lt.jsx)($a.Users,{className:"mr-2 h-4 w-4"}),actionText:Q="Collaborate"}){let[Z,I]=(0,$e.useState)(""),[Ne,d]=(0,$e.useState)(!1),A=t||[],z={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[p,B]=(0,$e.useState)(()=>A.length===0?z:A.find(ie=>ie.id===D)||A[0]),[H,ee]=(0,$e.useState)([]),[V,ne]=(0,$e.useState)(!1),N=ie=>{if(!ie||!y)return;let it=[];Array.from(ie).forEach(me=>{if(me.size>U*1024*1024){alert(`File ${me.name} is too large. Maximum size is ${U}MB.`);return}if(X.length>0&&!X.some(rt=>me.type.match(rt))){alert(`File type ${me.type} is not allowed.`);return}let Wt={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:me,status:"pending",progress:0};if(me.type.startsWith("image/")){let rt=new FileReader;rt.onload=_a=>{ee(Ja=>Ja.map(kt=>kt.id===Wt.id?{...kt,preview:_a.target?.result}:kt))},rt.readAsDataURL(me)}it.push(Wt)}),ee(me=>[...me,...it])},be=ie=>{ee(it=>it.filter(me=>me.id!==ie))},oe=()=>{!Z.trim()&&H.length===0||(console.log("Message to send:",Z),console.log("Files to upload:",H),I(""),ee([]),d(!0),setTimeout(()=>{d(!1)},1500))},Je=ie=>{ie.key==="Enter"&&!ie.shiftKey&&(ie.preventDefault(),oe())};return(0,lt.jsx)(Ha,{sidebarItems:o||[],title:M,notifications:l||[],businessUnits:A,currentBusinessUnit:p,onBusinessUnitChange:ie=>{ie&&(B(ie),R?.(ie))},onSearch:L,showTabs:!1,onActionClick:P,actionIcon:G,actionText:Q,onNotificationRemove:v,onRemoveAll:k,logo:K,appName:re,tagline:J,children:(0,lt.jsx)(Nt.AnimatePresence,{mode:"wait",children:(0,lt.jsx)(Nt.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,lt.jsxs)("div",{className:"h-full flex",children:[(0,lt.jsx)("div",{className:"w-80 bg-muted/50 flex-shrink-0 h-full p-2",children:(0,lt.jsx)(Oa,{sessions:n||[],currentSession:w,teams:A,onNewChat:c,onSessionSelect:r,onSessionEdit:m,onSessionDelete:u})}),(0,lt.jsx)("div",{className:"flex-1 h-full p-2",children:(0,lt.jsx)(Wa,{messages:e||[],input:Z,isTyping:Ne,currentSessionTitle:w?.title,capabilities:a||[],onInputChange:I,onSendMessage:oe,onKeyPress:Je,fileUploads:H,isDragOver:V,enableFileUpload:y,onFileUpload:N,onRemoveFile:be,onDragOver:ne})})]})},"chat-interface")})})}var ei=[{id:"1",role:"user",parts:[{type:"text",text:"Hello, can you help me with a task?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:"Of course! I can help you create and manage tasks."}]},{id:"3",role:"user",parts:[{type:"text",text:"Here is a file with project requirements"},{type:"file",mimeType:"application/pdf",url:"/path/to/file.pdf"}]},{id:"4",role:"assistant",parts:[{type:"text",text:"I'll create a task based on your requirements."},{type:"tool-task",toolCallId:"call-123",state:"output-available",input:{title:"Project Requirements Review",description:"Review and analyze the uploaded requirements document"},output:{id:"task-123",title:"Project Requirements Review",description:"Review and analyze the uploaded requirements document",status:"created",assignee:"AI Assistant",priority:"high"}}]},{id:"5",role:"assistant",parts:[{type:"text",text:"Here are some relevant resources for your project:"},{type:"data-reference",data:{references:[{id:"ref-1",title:"Project Management Best Practices",url:"https://example.com/pm-best-practices",description:"Comprehensive guide to project management",type:"document"},{id:"ref-2",title:"Requirements Gathering Template",url:"https://example.com/requirements-template",description:"Template for gathering project requirements",type:"link"}]}}]},{id:"6",role:"assistant",parts:[{type:"text",text:"What would you like to do next?"},{type:"data-menu",data:{title:"Available Actions",items:[{id:"action-1",label:"Create another task",description:"Set up a new task for the project",action:()=>console.log("Create task clicked")},{id:"action-2",label:"View project timeline",description:"See the project schedule and milestones",action:()=>console.log("View timeline clicked")},{id:"action-3",label:"Assign team members",description:"Add team members to the project",action:()=>console.log("Assign team clicked")}]}}]}];function ti(){return(0,lt.jsx)(Ka,{messages:ei,businessUnits:[{id:"engineering",name:"Engineering",description:"Software development team",icon:"\u2699\uFE0F",color:"bg-blue-500",accentColor:"bg-blue-600"}],capabilities:[],sessions:[],onNewChat:()=>console.log("New chat started"),onSessionSelect:e=>console.log("Session selected:",e),onSessionDelete:e=>console.log("Session deleted:",e),enableFileUpload:!0,title:"AI Assistant"})}0&&(module.exports={ExampleChatInterface});
|
|
5
|
+
"use strict";var so=Object.create;var st=Object.defineProperty;var lo=Object.getOwnPropertyDescriptor;var co=Object.getOwnPropertyNames;var po=Object.getPrototypeOf,mo=Object.prototype.hasOwnProperty;var uo=(e,t)=>{for(var a in t)st(e,a,{get:t[a],enumerable:!0})},_t=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of co(t))!mo.call(e,l)&&l!==a&&st(e,l,{get:()=>t[l],enumerable:!(o=lo(t,l))||o.enumerable});return e};var J=(e,t,a)=>(a=e!=null?so(po(e)):{},_t(t||!e||!e.__esModule?st(a,"default",{value:e,enumerable:!0}):a,e)),go=e=>_t(st({},"__esModule",{value:!0}),e);var ui={};uo(ui,{ExampleChatInterface:()=>mi});module.exports=go(ui);var lt=J(require("react")),De=J(require("@radix-ui/react-avatar"));var oa=require("clsx");var Tt="-",fo=e=>{let t=vo(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:c=>{let r=c.split(Tt);return r[0]===""&&r.length!==1&&r.shift(),Qt(r,t)||bo(c)},getConflictingClassGroupIds:(c,r)=>{let u=a[c]||[];return r&&o[c]?[...u,...o[c]]:u}}},Qt=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),l=o?Qt(e.slice(1),o):void 0;if(l)return l;if(t.validators.length===0)return;let n=e.join(Tt);return t.validators.find(({validator:c})=>c(n))?.classGroupId},Jt=/^\[(.+)\]$/,bo=e=>{if(Jt.test(e)){let t=Jt.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},vo=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return yo(Object.entries(e.classGroups),a).forEach(([n,c])=>{Rt(c,o,n,t)}),o},Rt=(e,t,a,o)=>{e.forEach(l=>{if(typeof l=="string"){let n=l===""?t:Xt(t,l);n.classGroupId=a;return}if(typeof l=="function"){if(ho(l)){Rt(l(o),t,a,o);return}t.validators.push({validator:l,classGroupId:a});return}Object.entries(l).forEach(([n,c])=>{Rt(c,Xt(t,n),a,o)})})},Xt=(e,t)=>{let a=e;return t.split(Tt).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},ho=e=>e.isThemeGetter,yo=(e,t)=>t?e.map(([a,o])=>{let l=o.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([c,r])=>[t+c,r])):n);return[a,l]}):e,xo=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,l=(n,c)=>{a.set(n,c),t++,t>e&&(t=0,o=a,a=new Map)};return{get(n){let c=a.get(n);if(c!==void 0)return c;if((c=o.get(n))!==void 0)return l(n,c),c},set(n,c){a.has(n)?a.set(n,c):l(n,c)}}},Yt="!",wo=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,l=t[0],n=t.length,c=r=>{let u=[],m=0,T=0,v;for(let x=0;x<r.length;x++){let S=r[x];if(m===0){if(S===l&&(o||r.slice(x,x+n)===t)){u.push(r.slice(T,x)),T=x+n;continue}if(S==="/"){v=x;continue}}S==="["?m++:S==="]"&&m--}let k=u.length===0?r:r.substring(T),P=k.startsWith(Yt),U=P?k.substring(1):k,D=v&&v>T?v-T:void 0;return{modifiers:u,hasImportantModifier:P,baseClassName:U,maybePostfixModifierPosition:D}};return a?r=>a({className:r,parseClassName:c}):c},Co=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(o=>{o[0]==="["?(t.push(...a.sort(),o),a=[]):a.push(o)}),t.push(...a.sort()),t},No=e=>({cache:xo(e.cacheSize),parseClassName:wo(e),...fo(e)}),ko=/\s+/,Do=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:l}=t,n=[],c=e.trim().split(ko),r="";for(let u=c.length-1;u>=0;u-=1){let m=c[u],{modifiers:T,hasImportantModifier:v,baseClassName:k,maybePostfixModifierPosition:P}=a(m),U=!!P,D=o(U?k.substring(0,P):k);if(!D){if(!U){r=m+(r.length>0?" "+r:r);continue}if(D=o(k),!D){r=m+(r.length>0?" "+r:r);continue}U=!1}let x=Co(T).join(":"),S=v?x+Yt:x,I=S+D;if(n.includes(I))continue;n.push(I);let C=l(D,U);for(let E=0;E<C.length;++E){let oe=C[E];n.push(S+oe)}r=m+(r.length>0?" "+r:r)}return r};function Po(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Zt(t))&&(o&&(o+=" "),o+=a);return o}var Zt=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Zt(e[o]))&&(a&&(a+=" "),a+=t);return a};function So(e,...t){let a,o,l,n=c;function c(u){let m=t.reduce((T,v)=>v(T),e());return a=No(m),o=a.cache.get,l=a.cache.set,n=r,r(u)}function r(u){let m=o(u);if(m)return m;let T=Do(u,a);return l(u,T),T}return function(){return n(Po.apply(null,arguments))}}var j=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},ea=/^\[(?:([a-sa-]+):)?(.+)\]$/ct,Ro=/^\d+\/\d+$/,To=new Set(["px","full","screen"]),Ao=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|ct|ct|min|max))|\ct(calc|min|max|clamp)\(.+\)|^0$/,Io=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Bo=/^(inset_)?-?((\d+)?\.?(\d+)[a-sa]+|0)_-?((\d+)?\.?(\d+)[a-sa]+|0)/,Lo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ke=e=>Ge(e)||To.has(e)||Ro.test(e),Ae=e=>We(e,"length",Vo),Ge=e=>!!e&&!Number.isNaN(Number(e)),St=e=>We(e,"number",Ge),Xe=e=>!!e&&Number.isInteger(Number(e)),zo=e=>e.endsWith("%")&&Ge(e.slice(0,-1)),h=e=>ea.test(e),Me=e=>Ao.test(e),Eo=new Set(["length","size","percentage"]),Uo=e=>We(e,Eo,ta),jo=e=>We(e,"position",ta),Fo=new Set(["image","url"]),Ho=e=>We(e,Fo,Wo),Oo=e=>We(e,"",Go),Qe=()=>!0,We=(e,t,a)=>{let o=ea.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},Vo=e=>Mo.test(e)&&!Io.test(e),ta=()=>!1,Go=e=>Bo.test(e),Wo=e=>Lo.test(e);var $o=()=>{let e=j("colors"),t=j("spacing"),a=j("blur"),o=j("brightness"),l=j("borderColor"),n=j("borderRadius"),c=j("borderSpacing"),r=j("borderWidth"),u=j("contrast"),m=j("grayscale"),T=j("hueRotate"),v=j("invert"),k=j("gap"),P=j("gradientColorStops"),U=j("gradientColorStopPositions"),D=j("inset"),x=j("margin"),S=j("opacity"),I=j("padding"),C=j("saturate"),E=j("scale"),oe=j("sepia"),K=j("skew"),ee=j("space"),G=j("translate"),q=()=>["auto","contain","none"],Q=()=>["auto","hidden","clip","visible","scroll"],ie=()=>["auto",h,t],B=()=>[h,t],Ne=()=>["",ke,Ae],d=()=>["auto",Ge,h],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],A=()=>["solid","dashed","dotted","double","none"],p=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",h],ne=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[Ge,h];return{cacheSize:500,separator:":",theme:{colors:[Qe],spacing:[ke,Ae],blur:["none","",Me,h],brightness:V(),borderColor:[e],borderRadius:["none","","full",Me,h],borderSpacing:B(),borderWidth:Ne(),contrast:V(),grayscale:O(),hueRotate:V(),invert:O(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[zo,Ae],inset:ie(),margin:ie(),opacity:V(),padding:B(),saturate:V(),scale:V(),sepia:O(),skew:V(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",h]}],container:["container"],columns:[{columns:[Me]}],"break-after":[{"break-after":ne()}],"break-before":[{"break-before":ne()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...L(),h]}],overflow:[{overflow:Q()}],"overflow-x":[{"overflow-x":Q()}],"overflow-ct":[{"overflow-ct":Q()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-ct":[{"overscroll-ct":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[D]}],"inset-x":[{"inset-x":[D]}],"inset-ct":[{"inset-ct":[D]}],start:[{start:[D]}],end:[{end:[D]}],top:[{top:[D]}],right:[{right:[D]}],bottom:[{bottom:[D]}],left:[{left:[D]}],visibility:["visible","invisible","collapse"],sa:[{sa:["auto",Xe,h]}],basis:[{basis:ie()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",h]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",Xe,h]}],"grid-cols":[{"grid-cols":[Qe]}],"col-start-end":[{col:["auto",{span:["full",Xe,h]},h]}],"col-start":[{"col-start":d()}],"col-end":[{"col-end":d()}],"grid-rows":[{"grid-rows":[Qe]}],"row-start-end":[{row:["auto",{span:[Xe,h]},h]}],"row-start":[{"row-start":d()}],"row-end":[{"row-end":d()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",h]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",h]}],gap:[{gap:[k]}],"gap-x":[{"gap-x":[k]}],"gap-ct":[{"gap-ct":[k]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[I]}],px:[{px:[I]}],py:[{py:[I]}],ps:[{ps:[I]}],pe:[{pe:[I]}],pt:[{pt:[I]}],pr:[{pr:[I]}],pb:[{pb:[I]}],pl:[{pl:[I]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],ct:[{ct:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[ee]}],"space-x-reverse":["space-x-reverse"],"space-ct":[{"space-ct":[ee]}],"space-ct-reverse":["space-ct-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",h,t]}],"min-w":[{"min-w":[h,t,"min","max","fit"]}],"max-w":[{"max-w":[h,t,"none","full","min","max","fit","prose",{screen:[Me]},Me]}],h:[{h:[h,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[h,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Me,Ae]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",St]}],"font-family":[{font:[Qe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",h]}],"line-clamp":[{"line-clamp":["none",Ge,St]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ke,h]}],"list-image":[{"list-image":["none",h]}],"list-style-type":[{list:["none","disc","decimal",h]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...A(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ke,Ae]}],"underline-offset":[{"underline-offset":["auto",ke,h]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...L(),jo]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","ct","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Uo]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","ct","bl","l","tl"]},Ho]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[U]}],"gradient-via-pos":[{via:[U]}],"gradient-to-pos":[{to:[U]}],"gradient-from":[{from:[P]}],"gradient-via":[{via:[P]}],"gradient-to":[{to:[P]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-ct":[{"rounded-ct":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[r]}],"border-w-x":[{"border-x":[r]}],"border-w-ct":[{"border-ct":[r]}],"border-w-s":[{"border-s":[r]}],"border-w-e":[{"border-e":[r]}],"border-w-t":[{"border-t":[r]}],"border-w-r":[{"border-r":[r]}],"border-w-ct":[{"border-ct":[r]}],"border-w-l":[{"border-l":[r]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...A(),"hidden"]}],"divide-x":[{"divide-x":[r]}],"divide-x-reverse":["divide-x-reverse"],"divide-ct":[{"divide-ct":[r]}],"divide-ct-reverse":["divide-ct-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:A()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-ct":[{"border-ct":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-ct":[{"border-ct":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...A()]}],"outline-offset":[{"outline-offset":[ke,h]}],"outline-w":[{outline:[ke,Ae]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[ke,Ae]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Me,Oo]}],"shadow-color":[{shadow:[Qe]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...p(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":p()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Me,h]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[T]}],invert:[{invert:[v]}],saturate:[{saturate:[C]}],sepia:[{sepia:[oe]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[T]}],"backdrop-invert":[{"backdrop-invert":[v]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-ct":[{"border-spacing-ct":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",h]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",h]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",h]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-ct":[{"scale-ct":[E]}],rotate:[{rotate:[Xe,h]}],"translate-x":[{"translate-x":[G]}],"translate-ct":[{"translate-ct":[G]}],"skew-x":[{"skew-x":[K]}],"skew-ct":[{"skew-ct":[K]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",h]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","ct","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-ct":[{"scroll-ct":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","ct","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-ct":[{"touch-pan":["ct","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",h]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ke,Ae,St]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-ct"],overscroll:["overscroll-x","overscroll-ct"],inset:["inset-x","inset-ct","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-ct":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-ct"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","ct","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-ct","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-ct":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-ct"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-ct","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-ct":["border-w-t","border-w-ct"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-ct","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-ct":["border-color-t","border-color-ct"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-ct","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-ct","touch-pz"],"touch-x":["touch"],"touch-ct":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var aa=So($o);function s(...e){return aa((0,oa.clsx)(e))}var ct=require("react/jsx-runtime"),Ue=lt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(De.Root,{ref:a,className:s("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Ue.displayName=De.Root.displayName;var At=lt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(De.Image,{ref:a,className:s("aspect-square h-full w-full",e),...t}));At.displayName=De.Image.displayName;var je=lt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(De.Fallback,{ref:a,className:s("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));je.displayName=De.Fallback.displayName;var Fe=J(require("react"));var le=Fe.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:s("rounded-xl border bg-card text-card-foreground shadow",e),...t}));le.displayName="Card";var Pe=Fe.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:s("flex flex-col space-ct-1.5 p-6",e),...t}));Pe.displayName="CardHeader";var Se=Fe.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:s("font-semibold leading-none tracking-tight",e),...t}));Se.displayName="CardTitle";var Mt=Fe.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:s("text-sm text-muted-foreground",e),...t}));Mt.displayName="CardDescription";var ve=Fe.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:s("p-6 pt-0",e),...t}));ve.displayName="CardContent";var Ye=Fe.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:s("flex items-center p-6 pt-0",e),...t}));Ye.displayName="CardFooter";var ia=require("class-variance-authority");var Ko=(0,ia.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ce({className:e,variant:t,...a}){return(0,ct.jsx)("div",{className:s(Ko({variant:t}),e),...a})}var sa=require("lucide-react"),la=require("date-fns");var $e=require("react");function na({taskId:e,polling:t=!0,system:a="payload"}){let[o,l]=(0,$e.useState)(null),[n,c]=(0,$e.useState)(!1),[r,u]=(0,$e.useState)(null),m=async(v=!0)=>{if(e){v&&c(!0);try{let k=await fetch(`/api/tasks/${e}`);if(!k.ok)throw new Error(`Failed to fetch task: ${k.statusText}`);let P=await k.json();l(P)}catch(k){console.error("Error fetching task:",k),u(k instanceof Error?k:new Error("Unknown error occurred"))}finally{v&&c(!1)}}},T=()=>m(!1);return(0,$e.useEffect)(()=>{e&&m(!0);let v=null;return e&&t&&(v=setInterval(T,5e3)),()=>{v&&clearInterval(v)}},[e,t]),{task:o,loading:n,error:r}}var qo=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"}},_o=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function ca({data:e}){let{id:t,system:a,fetchLatest:o,taskData:l,error:n}=e||{};if(!t)return null;let c=null,r=!0,u=n,m=o!==void 0?o:!0;if(c=l||{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:c,error:u}),m){let{task:P,loading:U,error:D}=na({taskId:t,system:a});c=P,r=U,u=D}else r=!1;let T=qo(c?.status||"todo"),v=_o(c?.status||"todo"),k=c?.dateLogged||new Date().toISOString();try{let P=new Date(c?.dateLogged||"");isNaN(P.getTime())||(k=(0,la.formatDistanceToNow)(P,{addSuffix:!0}))}catch{}return(0,ct.jsxs)(le,{className:s("w-full max-w-md shadow-md",u&&"border border-destructive"),children:[(0,ct.jsxs)(Pe,{className:"pb-2",children:[(0,ct.jsxs)("div",{className:"flex justify-between items-start",children:[(0,ct.jsx)(Se,{className:"text-lg font-semibold",children:r?"Loading...":c?.name||"Task"}),(0,ct.jsx)(ce,{className:`${T}`,children:v})]}),c?.project&&(0,ct.jsxs)(Mt,{className:"text-sm text-gray-500",children:["Project: ",c.project.name]})]}),(0,ct.jsx)(ve,{className:"pb-2",children:r?(0,ct.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):u?(0,ct.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,ct.jsx)("p",{className:"text-sm text-foreground",children:c?.description||"......."})}),(0,ct.jsx)(Ye,{className:"pt-2 flex items-center justify-between",children:(0,ct.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,ct.jsx)(sa.Clock,{className:"h-3 w-3 mr-1"}),(0,ct.jsxs)("span",{children:["Created ",k]}),(0,ct.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,ct.jsxs)("span",{children:["Task #",t]})]})})]})}var It=J(require("react")),pe=J(require("@radix-ui/react-scroll-area"));var he=It.forwardRef(({className:e,children:t,...a},o)=>(0,ct.jsxs)(pe.Root,{ref:o,className:s("relative overflow-hidden",e),...a,children:[(0,ct.jsx)(pe.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,ct.jsx)(da,{}),(0,ct.jsx)(pe.Corner,{})]}));he.displayName=pe.Root.displayName;var da=It.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,ct.jsx)(pe.ScrollAreaScrollbar,{ref:o,orientation:t,className:s("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,ct.jsx)(pe.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));da.displayName=pe.ScrollAreaScrollbar.displayName;var pa={primary:"bg-blue-500",secondary:"bg-gray-500",accent:"bg-purple-500",categories:["bg-green-500","bg-blue-500","bg-purple-500","bg-pink-500","bg-indigo-500","bg-orange-500"],lists:["bg-green-400","bg-blue-400","bg-purple-400","bg-pink-400","bg-indigo-400","bg-orange-400"],items:["bg-green-300","bg-blue-300","bg-purple-300","bg-pink-300","bg-indigo-300","bg-orange-300"]};function Bt(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function ga({artefact:e,taskId:t,taskData:a,loading:o=!1,error:l=null}){let n=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},c=n.dateLogged;try{let r=new Date(n.dateLogged);isNaN(r.getTime())||(c=(0,la.formatDistanceToNow)(r,{addSuffix:!0}))}catch{}return(0,ct.jsxs)(le,{className:"w-full max-w-md shadow-md",children:[(0,ct.jsx)(Pe,{className:"pb-2",children:(0,ct.jsx)("div",{className:"flex justify-between items-start",children:(0,ct.jsx)(Se,{className:"text-lg font-semibold",children:o?"Loading...":n.name})})}),(0,ct.jsx)(ve,{className:"pb-2",children:o?(0,ct.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):l?(0,ct.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,ct.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,ct.jsx)(Ye,{className:"pt-2 flex items-center justify-between",children:(0,ct.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,ct.jsx)(sa.Clock,{className:"h-3 w-3 mr-1"}),(0,ct.jsxs)("span",{children:["Created ",c]}),(0,ct.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,ct.jsxs)("span",{children:["Task #",n.id]})]})})]})}var _a=require("@ai-sdk/react"),kt=require("framer-motion");var vt=J(require("react")),Ft=J(require("next/link"));var fa=require("@radix-ui/react-slot"),va=J(require("react")),Jo=(0,ia.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),R=va.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...l},n)=>(0,ct.jsx)(e?fa.Slot:"button",{className:s(Jo({className:t,size:a,variant:o})),ref:n,...l}));R.displayName="Button";var ya=J(require("react"));var Ze=ya.forwardRef(({className:e,type:t,...a},o)=>(0,ct.jsx)("input",{type:t,className:s("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...a}));Ze.displayName="Input";var et=J(require("react")),W=J(require("@radix-ui/react-dialog"));var Ca=W.Root;var Xo=W.Portal;var Na=et.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(W.Overlay,{ref:a,className:s("fixed inset-0 sa-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Na.displayName=W.Overlay.displayName;var Lt=et.forwardRef(({className:e,children:t,...a},o)=>(0,ct.jsxs)(Xo,{children:[(0,ct.jsx)(Na,{}),(0,ct.jsxs)(W.Content,{ref:o,className:s("fixed left-[50%] top-[50%] sa-50 grid w-full max-w-lg translate-x-[-50%] translate-ct-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,(0,ct.jsxs)(W.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,ct.jsx)(sa.ct,{className:"h-4 w-4"}),(0,ct.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Lt.displayName=W.Content.displayName;var zt=({className:e,...t})=>(0,ct.jsx)("div",{className:s("flex flex-col space-ct-1.5 text-center sm:text-left",e),...t});zt.displayName="DialogHeader";var Qo=({className:e,...t})=>(0,ct.jsx)("div",{className:s("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Qo.displayName="DialogFooter";var Et=et.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(W.Title,{ref:a,className:s("text-lg font-semibold leading-none tracking-tight",e),...t}));Et.displayName=W.Title.displayName;var Yo=et.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(W.Description,{ref:a,className:s("text-sm text-muted-foreground",e),...t}));Yo.displayName=W.Description.displayName;var tt=J(require("@radix-ui/react-checkbox")),Da=J(require("react")),Ut=Da.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(tt.Root,{className:s("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:a,...t,children:(0,ct.jsx)(tt.Indicator,{className:s("flex items-center justify-center text-current"),children:(0,ct.jsx)(sa.Check,{className:"h-4 w-4"})})}));Ut.displayName=tt.Root.displayName;var ye=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var Sa=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,ct.jsx)(sa.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,ct.jsx)(sa.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,ct.jsx)(sa.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,ct.jsx)(sa.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,ct.jsx)(sa.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,ct.jsx)(sa.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,ct.jsx)(sa.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,ct.jsx)(sa.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,ct.jsx)(sa.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,ct.jsx)(sa.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],ut=[{id:"1",name:"E-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var jt=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],pt=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],ft=[{id:"1",title:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",title:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",title:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",title:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",title:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",title:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",title:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],Zo=[...ft,{id:"8",title:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",title:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",title:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",title:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",title:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],ei=[...ut,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],mt={projects:[{id:"1",name:"Empty Project",description:"A project with no tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},Pa={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:ft.filter(e=>e.epicId==="1")};var tr={empty:{initialProjects:mt.projects,initialEpics:mt.epics,initialSprints:mt.sprints,initialTasks:mt.tasks},default:{initialProjects:ut,initialEpics:jt,initialSprints:pt,initialTasks:ft},highDensity:{initialProjects:ut,initialEpics:jt,initialSprints:pt,initialTasks:Zo},singleEpic:{initialProjects:ut,initialEpics:Pa.epics,initialSprints:pt,initialTasks:Pa.tasks},multipleProjects:{initialProjects:ei,initialEpics:jt,initialSprints:pt,initialTasks:ft}},gt=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.js","Python","Git"].map(ye),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(ye),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused on driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(ye),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(ye),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated to understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","R","Statistics"].map(ye),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(ye),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(ye),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(ye),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(ye),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(ye),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],ar=[{id:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:gt.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:gt.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date,dueTime:"16:00",colleague:gt.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var or=gt.filter(e=>e.type==="digital");function Ra(e,t){let[a,o]=(0,$e.useState)(()=>{if(typeof window>"u")return t;try{let n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch{return t}}),l=n=>{try{o(n),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(n))}catch{}};return(0,$e.useEffect)(()=>{l(a)},[]),[a,l]}function Ht({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:l=Sa[0],onBusinessUnitChange:n,onSearch:c,className:r,logo:u="/headerlogo.png",appName:m="Nuvia",tagline:T="Collaboration Platform"}){let[v,k]=vt.useState({}),[P,U]=Ra("sidebar-favorites",{}),[D,x]=vt.useState(null),[S,I]=vt.useState(""),C=d=>{k(L=>({...L,[d]:!L[d]}))},E=d=>{n?.(d)},oe=()=>{S.trim()&&c?.(S.trim())},K=d=>{d.key==="Enter"&&(d.preventDefault(),oe())},ee=(d,L)=>{let A=P[d]||[],p=A.includes(L)?A.filter(M=>M!==L):A.concat(L);U({...P,[d]:p})},G=d=>{if(!d.items||!d.maxItems||d.items.length<=d.maxItems)return d.items||[];let L=P[d.id]||[],A=d.items.filter(M=>L.includes(M.id)),p=d.items.filter(M=>!L.includes(M.id));return[...A,...p].slice(0,d.maxItems)},q=d=>d.maxItems&&d.items&&d.items.length>d.maxItems,Q=e,ie=d=>{let L=q(d),A=G(d),p=(0,ct.jsxs)(ct.Fragment,{children:[(0,ct.jsxs)("div",{className:"flex items-center gap-3",children:[d.icon,(0,ct.jsx)("span",{children:d.title})]}),d.badge&&(0,ct.jsx)(ce,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:d.badge}),d.items&&(0,ct.jsx)(sa.ChevronDown,{className:s("ml-2 h-4 w-4 transition-transform",v[d.title]?"rotate-180":"")})]}),M=s("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",d.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return d.url?(0,ct.jsx)(Ft.default,{href:d.url,className:M,onClick:a?o:void 0,children:p}):(0,ct.jsx)("button",{className:M,onClick:()=>d.items&&C(d.title),children:p})},B=()=>{let d=e.find(A=>A.id===D);if(!d||!d.items||!d.maxItems)return null;let L=P[d.id]||[];return(0,ct.jsx)(Ca,{open:!!D,onOpenChange:A=>!A&&x(null),children:(0,ct.jsxs)(Lt,{className:"sm:max-w-md",children:[(0,ct.jsxs)(zt,{children:[(0,ct.jsxs)(Et,{children:["Manage ",d.title," Favorites"]}),(0,ct.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",d.maxItems," items to show in ",d.title.toLowerCase(),"."]})]}),(0,ct.jsx)(he,{className:"max-h-96 pr-4",children:(0,ct.jsx)("div",{className:"space-ct-4",children:d.items.map(A=>(0,ct.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ct.jsx)(Ut,{id:A.id,checked:L.includes(A.id),onCheckedChange:()=>ee(d.id,A.id),disabled:!L.includes(A.id)&&L.length>=(d.maxItems||0)}),(0,ct.jsxs)("label",{htmlFor:A.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[A.title,A.badge&&(0,ct.jsx)(ce,{variant:"outline",className:"text-xs",children:A.badge})]})]},A.id))})})]})})},Ne=(0,ct.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ct.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,ct.jsx)("img",{src:u,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,ct.jsxs)("div",{children:[(0,ct.jsx)("h2",{className:"font-semibold",children:m}),(0,ct.jsx)("p",{className:"text-xs text-muted-foreground",children:T})]})]}),a&&(0,ct.jsx)(R,{variant:"ghost",size:"icon",onClick:o,children:(0,ct.jsx)(sa.ct,{className:"h-5 w-5"})})]}),(0,ct.jsx)("div",{className:"px-3 py-2",children:(0,ct.jsxs)("div",{className:"relative",children:[(0,ct.jsx)(sa.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,ct.jsx)(Ze,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:S,onChange:d=>I(d.target.value),onKeyPress:K})]})}),(0,ct.jsx)(he,{className:"flex-1 px-3 py-2",children:(0,ct.jsx)("div",{className:"space-ct-1",children:Q.map(d=>(0,ct.jsxs)("div",{className:"mb-1",children:[ie(d),d.items&&v[d.title]&&(0,ct.jsxs)("div",{className:"mt-1 ml-6 space-ct-1 border-l pl-3",children:[G(d).map(L=>(0,ct.jsxs)(Ft.default,{href:L.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[L.title,L.badge&&(0,ct.jsx)(ce,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:L.badge})]},L.id)),q(d)&&d.items&&d.items.length>G(d).length&&(0,ct.jsxs)("button",{onClick:()=>x(d.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",d.items.length-G(d).length," more available"]})]})]},d.id))})}),(0,ct.jsx)("div",{className:"p-3",children:(0,ct.jsx)("div",{className:"space-ct-1",children:(0,ct.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,ct.jsx)(sa.Settings,{className:"h-5 w-5"}),(0,ct.jsx)("span",{children:"Settings"})]})})}),(0,ct.jsx)(B,{})]});return a?(0,ct.jsx)("div",{className:s("fixed inset-ct-0 left-0 sa-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",r),children:Ne}):(0,ct.jsx)("div",{className:s("fixed inset-ct-0 left-0 sa-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",r),children:Ne})}var Ta=J(require("react")),fe=J(require("@radix-ui/react-tooltip"));var ht=fe.Provider,yt=fe.Root,xt=fe.Trigger,at=Ta.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,ct.jsx)(fe.Portal,{children:(0,ct.jsx)(fe.Content,{ref:o,sideOffset:t,className:s("sa-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));at.displayName=fe.Content.displayName;var Aa=require("next-themes");function Ma(){let{setTheme:e,theme:t}=(0,Aa.useTheme)();return(0,ct.jsx)(ht,{children:(0,ct.jsxs)(yt,{children:[(0,ct.jsx)(xt,{asChild:!0,children:(0,ct.jsxs)(R,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,ct.jsx)(sa.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,ct.jsx)(sa.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,ct.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,ct.jsx)(at,{children:"Toggle theme"})]})})}function Ia({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:l,className:n}){let c=e.filter(m=>!m.read),r=c.length,u=m=>{switch(m){case"info":return(0,ct.jsx)(sa.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,ct.jsx)(sa.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,ct.jsx)(sa.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,ct.jsx)(sa.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,ct.jsx)(kt.AnimatePresence,{children:t&&(0,ct.jsxs)(ct.Fragment,{children:[(0,ct.jsx)(kt.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 sa-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,ct.jsx)(kt.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:s("fixed inset-ct-0 right-0 sa-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",n),children:(0,ct.jsxs)("div",{className:"flex h-full flex-col",children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between border-ct p-4",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsx)(sa.Bell,{className:"h-5 w-5"}),(0,ct.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),r>0&&(0,ct.jsxs)(ce,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[r," new"]})]}),(0,ct.jsxs)(R,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,ct.jsx)(sa.ct,{className:"h-5 w-5"}),(0,ct.jsx)("span",{className:"sr-only",children:"Close"})]})]}),r>0&&(0,ct.jsxs)("div",{className:"flex items-center justify-between border-ct p-2",children:[(0,ct.jsxs)("span",{className:"text-sm text-muted-foreground",children:[r," unread notification",r!==1?"s":""]}),(0,ct.jsx)(R,{variant:"ghost",size:"sm",onClick:l,className:"text-sm",children:"Dismiss all"})]}),c.length>0?(0,ct.jsx)(he,{className:"flex-1",children:(0,ct.jsx)("div",{className:"divide-ct",children:c.map(m=>(0,ct.jsxs)("div",{className:s("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,ct.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:u(m.type)}),(0,ct.jsxs)("div",{className:"flex-1 space-ct-1",children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsx)("p",{className:"font-medium",children:m.title}),(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsx)("p",{className:"text-xs text-muted-foreground",children:m.time}),(0,ct.jsx)(R,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(m.id),title:"Dismiss",children:(0,ct.jsx)(sa.Check,{className:"h-3 w-3"})})]})]}),(0,ct.jsx)("p",{className:"text-sm text-muted-foreground",children:m.description}),m.actionLabel&&(0,ct.jsxs)(R,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:m.onAction,children:[m.actionLabel,(0,ct.jsx)(sa.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},m.id))})}):(0,ct.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,ct.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,ct.jsx)(sa.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,ct.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,ct.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var Oe=J(require("@radix-ui/react-tabs"));function Ba({className:e,...t}){return(0,ct.jsx)(Oe.Root,{"data-slot":"tabs",className:s("flex flex-col gap-2",e),...t})}function La({className:e,...t}){return(0,ct.jsx)(Oe.List,{"data-slot":"tabs-list",className:s("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function za({className:e,...t}){return(0,ct.jsx)(Oe.Trigger,{"data-slot":"tabs-trigger",className:s("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var Re=J(require("react")),w=J(require("@radix-ui/react-dropdown-menu")),Ke=require("@radix-ui/react-icons");var Ea=w.Root,Ua=w.Trigger;var ti=Re.forwardRef(({className:e,inset:t,children:a,...o},l)=>(0,$.jsxs)(w.SubTrigger,{ref:l,className:s("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[a,(0,$.jsx)(Ke.ChevronRightIcon,{className:"ml-auto"})]}));ti.displayName=w.SubTrigger.displayName;var ai=Re.forwardRef(({className:e,...t},a)=>(0,$.jsx)(w.SubContent,{ref:a,className:s("sa-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));ai.displayName=w.SubContent.displayName;var Vt=Re.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,$.jsx)(w.Portal,{children:(0,$.jsx)(w.Content,{ref:o,sideOffset:t,className:s("sa-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));Vt.displayName=w.Content.displayName;var Gt=Re.forwardRef(({className:e,inset:t,...a},o)=>(0,$.jsx)(w.Item,{ref:o,className:s("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...a}));Gt.displayName=w.Item.displayName;var oi=Re.forwardRef(({className:e,children:t,checked:a,...o},l)=>(0,$.jsxs)(w.CheckboxItem,{ref:l,className:s("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[(0,$.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,$.jsx)(w.ItemIndicator,{children:(0,$.jsx)(Ke.CheckIcon,{className:"h-4 w-4"})})}),t]}));oi.displayName=w.CheckboxItem.displayName;var ii=Re.forwardRef(({className:e,children:t,...a},o)=>(0,$.jsxs)(w.RadioItem,{ref:o,className:s("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,$.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,$.jsx)(w.ItemIndicator,{children:(0,$.jsx)(Ke.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));ii.displayName=w.RadioItem.displayName;var ri=Re.forwardRef(({className:e,inset:t,...a},o)=>(0,$.jsx)(w.Label,{ref:o,className:s("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));ri.displayName=w.Label.displayName;var ni=Re.forwardRef(({className:e,...t},a)=>(0,$.jsx)(w.Separator,{ref:a,className:s("-mx-1 my-1 h-px bg-muted",e),...t}));ni.displayName=w.Separator.displayName;var si=({className:e,...t})=>(0,$.jsx)("span",{className:s("ml-auto text-xs tracking-widest opacity-60",e),...t});si.displayName="DropdownMenuShortcut";function Fa({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:l="700px",gridCols:n=6}){let c=a.find(r=>r.value===e);return(0,ct.jsxs)(kt.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,ct:-20},animate:{opacity:1,ct:0},transition:{duration:.3,ease:"easeOut"},children:[(0,ct.jsx)("div",{className:"hidden md:block",children:(0,ct.jsx)(Ba,{value:e,onValueChange:t,children:(0,ct.jsx)(La,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:l,gridTemplateColumns:`repeat(${Math.min(n,a.length)}, minmax(0, 1fr))`},children:a.map(r=>(0,ct.jsx)(kt.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,ct.jsx)(za,{value:r.value,className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:r.label})},r.value))})})}),(0,ct.jsx)("div",{className:"md:hidden",children:(0,ct.jsxs)(Ea,{children:[(0,ct.jsx)(Ua,{asChild:!0,children:(0,ct.jsxs)(R,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[c?.label||"Select",(0,ct.jsx)(sa.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,ct.jsx)(Vt,{align:"center",className:"w-[180px]",children:a.map(r=>(0,ct.jsx)(Gt,{onClick:()=>t?.(r.value),className:`cursor-pointer ${e===r.value?"bg-accent":""}`,children:r.label},r.value))})]})})]})}function Ha({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:l=!0,className:n,activeTab:c="assistant",onTabChange:r,showTabs:u=!0,tabOptions:m=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:T,actionIcon:v=(0,ct.jsx)(sa.Bot,{className:"mr-2 h-4 w-4"}),actionText:k="Action",onNotificationRemove:P,onRemoveAll:U,logo:D="/headerlogo.png",appName:x="Nuvia",tagline:S="Collaboration Platform"}){let[I,C]=(0,$t.useState)(!1),[E,oe]=(0,$t.useState)(t),K=E.filter(q=>!q.read).length,ee=q=>{oe(Q=>Q.filter(ie=>ie.id!==q)),P?.(q)},G=()=>{oe(q=>q.filter(Q=>Q.read)),U?.()};return(0,ct.jsxs)(ct.Fragment,{children:[(0,ct.jsxs)("header",{className:`sticky top-0 sa-10 flex h-16 items-center gap-3 px-4 backdrop-blur ${n||""}`,children:[(0,ct.jsx)(R,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,ct.jsx)(sa.Menu,{className:"h-5 w-5"})}),(0,ct.jsx)(R,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,ct.jsx)(sa.PanelLeft,{className:"h-5 w-5"})}),!l&&(0,ct.jsxs)(kt.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,ct.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,ct.jsx)("img",{src:D,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,ct.jsxs)("div",{children:[(0,ct.jsx)("h2",{className:"font-semibold text-sm",children:x}),(0,ct.jsx)("p",{className:"text-xs text-muted-foreground",children:S})]})]}),(0,ct.jsxs)("div",{className:"flex flex-1 items-center",children:[u&&(0,ct.jsx)(Fa,{activeTab:c,onTabChange:r,tabOptions:m}),(0,ct.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,ct.jsx)(kt.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,ct.jsx)(kt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ct.jsxs)(R,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:T,children:[v,k]})})}),(0,ct.jsx)(Ma,{}),(0,ct.jsx)(ht,{children:(0,ct.jsxs)(yt,{children:[(0,ct.jsx)(xt,{asChild:!0,children:(0,ct.jsx)(kt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ct.jsxs)(R,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>C(!0),children:[(0,ct.jsx)(kt.motion.div,{animate:K>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:K>0?1/0:0,repeatDelay:3},children:(0,ct.jsx)(sa.Bell,{className:"h-5 w-5"})}),K>0&&(0,ct.jsx)(kt.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:K})]})})}),(0,ct.jsx)(at,{children:"Notifications"})]})}),(0,ct.jsx)(kt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ct.jsxs)(Ue,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,ct.jsx)(At,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,ct.jsx)(je,{})]})})]})]})]}),(0,ct.jsx)(Ia,{notifications:E,open:I,onClose:()=>C(!1),onNotificationRemove:ee,onRemoveAll:G})]})}var Oa=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,ct.jsx)(sa.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Ga({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:l=Oa[0],onBusinessUnitChange:n,onSearch:c,businessUnits:r=Oa,activeTab:u,onTabChange:m,showTabs:T=!1,onActionClick:v,actionIcon:k,actionText:P="Action",onNotificationRemove:U,onRemoveAll:D,logo:x="/headerlogo.png",appName:S="Nuvia",tagline:I="Collaboration Platform",sidebarInitiallyClosed:C=!1}){let[E,oe]=(0,$e.useState)(!C),[K,ee]=(0,$e.useState)(!1),[G,q]=(0,$e.useState)(l),Q=ie=>{q(ie),n?.(ie)};return(0,ct.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[K&&(0,ct.jsx)("div",{className:"fixed inset-0 sa-40 bg-black/50 md:hidden",onClick:()=>ee(!1)}),(0,ct.jsx)("div",{className:"md:hidden",children:(0,ct.jsx)(Ht,{items:e,isOpen:K,isMobile:!0,onClose:()=>ee(!1),currentBusinessUnit:G,onBusinessUnitChange:Q,onSearch:c,logo:x,appName:S,tagline:I})}),(0,ct.jsx)("div",{className:"hidden md:block",children:(0,ct.jsx)(Ht,{items:e,isOpen:E,isMobile:!1,currentBusinessUnit:G,onBusinessUnitChange:Q,onSearch:c,logo:x,appName:S,tagline:I})}),(0,ct.jsxs)("div",{className:s("min-h-screen fixed w-full transition-all duration-300 ease-in-out",E?"md:pl-64":"md:pl-0"),children:[(0,ct.jsx)(Ha,{title:a,notifications:o,onToggleSidebar:()=>oe(!E),onToggleMobileMenu:()=>ee(!0),sidebarOpen:E,activeTab:u,onTabChange:m,showTabs:T,onActionClick:v,actionIcon:k,actionText:P,onNotificationRemove:U,onRemoveAll:D,logo:x,appName:S,tagline:I}),(0,ct.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-auto",children:t})]})]})}function Wa({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:l,onSessionEdit:n,onSessionDelete:c,className:r}){return(0,ct.jsx)("div",{className:`space-ct-4 h-full ${r||""}`,children:(0,ct.jsxs)(le,{className:"shadow-sm h-full",children:[(0,ct.jsx)("div",{className:"p-4 border-ct",children:(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,ct.jsx)(sa.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,ct.jsxs)(R,{onClick:o,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,ct.jsx)(sa.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,ct.jsx)(he,{className:"h-[600px]",children:(0,ct.jsx)("div",{className:"p-2",children:e.length===0?(0,ct.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(u=>(0,ct.jsx)("div",{className:s("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===u.id&&"bg-muted border"),onClick:()=>l(u),children:(0,ct.jsx)("div",{className:"flex items-start gap-3",children:(0,ct.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,ct.jsx)("h4",{className:"font-medium text-sm truncate",children:u.title}),(0,ct.jsx)("div",{className:"flex items-center gap-1",children:(0,ct.jsxs)("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-1",children:[n&&(0,ct.jsx)(R,{variant:"ghost",size:"icon",className:"h-5 w-5 rounded",onClick:m=>{m.stopPropagation(),n(u.id)},children:(0,ct.jsx)(sa.Edit3,{className:"h-3 w-3"})}),c&&(0,ct.jsx)(R,{variant:"ghost",size:"icon",className:"h-5 w-5 rounded text-destructive hover:text-destructive",onClick:m=>{m.stopPropagation(),c(u.id)},children:(0,ct.jsx)(sa.Trash2,{className:"h-3 w-3"})})]})})]}),(0,ct.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:u.lastMessage})]})})},u.id))})})]})})}function $a({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:l,colorScheme:n=pa,className:c}){let[r,u]=(0,$e.useState)([]),[m,T]=(0,$e.useState)([]),v=r[r.length-1],k=v?.children||e,P=(C,E)=>{switch(C.type){case"category":return n.categories[E%n.categories.length];case"list":return n.lists[E%n.lists.length];case"item":return n.items[E%n.items.length];default:return n.primary}},U=(0,$e.useMemo)(()=>({path:r,selectedItems:m,filters:{}}),[r,m]);(0,$e.useEffect)(()=>{l&&l(U)},[U,l]);let D=C=>{C.type==="category"||C.type==="list"?u([...r,C]):C.type==="item"&&T([...m,C])},x=()=>{u(r.slice(0,-1))},S=C=>{u(r.slice(0,C+1))},I=()=>v?.actions?v.actions:[];return t?(0,ct.jsxs)("div",{className:s("w-full",c),children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[r.length>0&&(0,ct.jsx)(kt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:x,className:s("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,ct.jsx)(sa.ChevronLeft,{className:s("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,ct.jsx)("h4",{className:"font-medium text-sm",children:v?.name||"Capabilities"})]}),(0,ct.jsx)(kt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:a,className:s("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,ct.jsx)(sa.ct,{className:s("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),r.length>0&&(0,ct.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,ct.jsx)(kt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>u([]),className:s("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,ct.jsxs)("span",{className:"relative",children:["Capabilities",(0,ct.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),r.map((C,E)=>(0,ct.jsxs)("div",{className:"flex items-center gap-1",children:[(0,ct.jsx)(sa.ChevronRight,{className:"h-2 w-2"}),(0,ct.jsx)(kt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>S(E),className:s("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,ct.jsxs)("span",{className:"relative",children:[C.name,(0,ct.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},C.id))]}),(0,ct.jsx)("div",{className:"max-h-40 overflow-ct-auto",children:(0,ct.jsx)(kt.AnimatePresence,{mode:"wait",children:(0,ct.jsx)(kt.motion.div,{initial:{opacity:0,ct:-4},animate:{opacity:1,ct:0},exit:{opacity:0,ct:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:v?.type==="list"&&v.data?(0,ct.jsx)(di,{data:v.data,onItemSelect:C=>T([...m,C]),colorScheme:n}):(0,ct.jsx)(li,{capabilities:k,onSelect:D,colorScheme:n})},v?.id||"root")})})]}):(0,ct.jsxs)(R,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,ct.jsx)(sa.Menu,{className:"h-4 w-4"}),(0,ct.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function li({capabilities:e,onSelect:t,colorScheme:a}){return(0,ct.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,l)=>(0,ct.jsx)(ci,{capability:o,onClick:()=>t(o),color:a.categories[l%a.categories.length]},o.id))})}function ci({capability:e,onClick:t,selected:a,color:o}){return(0,ct.jsxs)(kt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:s("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",a&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,ct.jsx)("div",{className:s("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,ct.jsxs)("span",{className:"truncate relative",children:[e.name,(0,ct.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,ct.jsx)(sa.ChevronRight,{className:s("h-3 w-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,ct.jsx)(ce,{variant:"secondary",className:s("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function di({data:e,onItemSelect:t,colorScheme:a}){return(0,ct.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,l)=>(0,ct.jsxs)(kt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:s("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(o),children:[(0,ct.jsx)("div",{className:s("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[l%a.items.length])}),(0,ct.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ct.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,ct.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),o.subtitle&&(0,ct.jsx)("div",{className:s("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,ct.jsx)(ce,{variant:"secondary",className:s("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:o.value})]},o.id))})}function Ka(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function qa({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:l,fileUploads:n,isDragOver:c,enableFileUpload:r,onInputChange:u,onSendMessage:m,onKeyPress:T,onFileUpload:v,onRemoveFile:k,onDragOver:P,className:U}){let D=(0,$e.useRef)(null),x=(0,$e.useRef)(null),S=(0,$e.useRef)(null),[I,C]=(0,$e.useState)(!1),[E,oe]=(0,$e.useState)({path:[],selectedItems:[],filters:{}});(0,$e.useEffect)(()=>{D.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,$e.useEffect)(()=>{I&&setTimeout(()=>{D.current?.scrollIntoView({behavior:"smooth"})},100)},[I]);let K=()=>Bt(E),ee=()=>{let p=[];return l.forEach(M=>{M.actions&&M.actions.forEach(O=>{p.push({label:O.label,action:()=>G(O.id,{path:[M],selectedItems:[],filters:{}})})}),M.children&&M.children.forEach(O=>{O.type==="list"&&O.data&&p.push({label:`View ${O.name}`,action:()=>C(!0)})})}),p.slice(0,5)},G=(p,M)=>{console.log("Capability action:",p,M);let O=`Executing ${p} with context: ${JSON.stringify(M.path.map(ne=>ne.name))}`;C(!1)},q=Bt({path:[],selectedItems:[],filters:{}}),Q=p=>{v(p.target.files),p.target.files&&(p.target.value="")},ie=p=>{p.preventDefault(),P(!0)},B=p=>{p.preventDefault(),P(!1)},Ne=p=>{p.preventDefault(),P(!1),v(p.dataTransfer.files)},d=p=>{if(p===0)return"0 Bytes";let M=1024,O=["Bytes","KB","MB","GB"],ne=Math.floor(Math.log(p)/Math.log(M));return parseFloat((p/Math.pow(M,ne)).toFixed(2))+" "+O[ne]},L=p=>p.startsWith("image/")?(0,ct.jsx)(sa.Image,{className:"h-4 w-4"}):p.startsWith("text/")?(0,ct.jsx)(sa.FileText,{className:"h-4 w-4"}):(0,ct.jsx)(sa.File,{className:"h-4 w-4"}),A=p=>{let M=p.role==="assistant",O=p.role==="user",ne=Ka(p);return(0,ct.jsxs)("div",{className:s("flex items-start gap-3",O?"flex-row-reverse":""),children:[(0,ct.jsx)(Ue,{className:"h-8 w-8 shrink-0",children:(0,ct.jsx)(je,{className:s(O?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:O?(0,ct.jsx)(sa.User,{className:"h-4 w-4"}):(0,ct.jsx)(sa.Bot,{className:"h-4 w-4"})})}),(0,ct.jsxs)("div",{className:s("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",O?"bg-primary text-primary-foreground":"bg-muted"),children:[ne&&(0,ct.jsx)("div",{className:"mb-2 last:mb-0",children:(0,ct.jsx)("p",{className:"text-sm",children:ne})}),p.parts.map((V,Y)=>{if(V.type==="text")return null;if(V.type==="file"){let N=V;return(0,ct.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[L(N.mimeType||"application/octet-stream"),(0,ct.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ct.jsx)("p",{className:"text-sm font-medium truncate",children:N.name||N.url?.split("/").pop()||"File"}),N.size&&(0,ct.jsx)("p",{className:"text-xs opacity-70",children:d(N.size)}),N.mimeType&&(0,ct.jsx)("p",{className:"text-xs opacity-70",children:N.mimeType})]}),N.url&&(0,ct.jsx)(R,{variant:"ghost",size:"sm",onClick:()=>window.open(N.url,"_blank"),className:"h-8 w-8 p-0",children:(0,ct.jsx)(sa.Download,{className:"h-4 w-4"})})]})},Y)}if(V.type.startsWith("tool-")){let N=V,re=V.type.replace("tool-","");if(re==="task")switch(N.state){case"input-available":return(0,ct.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},Y);case"output-available":return(0,ct.jsx)("div",{className:"mb-2",children:(0,ct.jsx)(ca,{data:{id:N.output?.id||N.input?.id,fetchLatest:!1,taskData:N.output||N.input}})},Y);case"output-error":return(0,ct.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",N.errorText]},Y);default:return null}if(re==="artefact")switch(N.state){case"input-available":return(0,ct.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},Y);case"output-available":return(0,ct.jsx)("div",{className:"mb-2",children:(0,ct.jsx)(ga,{artefact:N.output?.description||"",taskId:N.output?.id||N.input?.id,taskData:N.output||N.input})},Y);case"output-error":return(0,ct.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",N.errorText]},Y);default:return null}return(0,ct.jsx)("div",{className:"mb-2",children:(0,ct.jsxs)(le,{className:"w-full max-w-md",children:[(0,ct.jsx)(Pe,{children:(0,ct.jsx)(Se,{className:"text-lg",children:re})}),(0,ct.jsxs)(ve,{children:[N.state==="input-available"&&(0,ct.jsxs)("p",{className:"text-sm",children:["Processing ",re,"..."]}),N.state==="output-available"&&(0,ct.jsx)("pre",{className:"text-sm",children:JSON.stringify(N.output,null,2)}),N.state==="output-error"&&(0,ct.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",N.errorText]})]})]})},Y)}if(V.type.startsWith("data-")){let N=V,re=V.type.replace("data-","");return re==="reference"?(0,ct.jsx)("div",{className:"mb-2",children:(0,ct.jsx)(le,{className:"w-full",children:(0,ct.jsx)(ve,{className:"p-4",children:(0,ct.jsx)("div",{className:"space-ct-2",children:N.data?.references?.map((se,Je)=>(0,ct.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,ct.jsx)(ce,{variant:"outline",children:se.type||"link"}),(0,ct.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ct.jsx)("p",{className:"text-sm font-medium truncate",children:se.title}),se.description&&(0,ct.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:se.description})]}),se.url&&(0,ct.jsx)(R,{variant:"ghost",size:"sm",onClick:()=>window.open(se.url,"_blank"),className:"h-8 w-8 p-0",children:(0,ct.jsx)(sa.ExternalLink,{className:"h-4 w-4"})})]},Je))})})})},Y):re==="menu"?(0,ct.jsx)("div",{className:"mb-2",children:(0,ct.jsxs)(le,{className:"w-full",children:[(0,ct.jsx)(Pe,{children:(0,ct.jsx)(Se,{className:"text-lg",children:N.data?.title})}),(0,ct.jsx)(ve,{children:(0,ct.jsx)("div",{className:"space-ct-2",children:N.data?.items?.map((se,Je)=>(0,ct.jsx)(R,{variant:"outline",className:"w-full justify-start",onClick:se.action,children:(0,ct.jsxs)("div",{className:"text-left",children:[(0,ct.jsx)("p",{className:"font-medium",children:se.label}),se.description&&(0,ct.jsx)("p",{className:"text-xs text-muted-foreground",children:se.description})]})},Je))})})]})},Y):(0,ct.jsx)("div",{className:"mb-2",children:(0,ct.jsxs)(le,{className:"w-full max-w-md",children:[(0,ct.jsx)(Pe,{children:(0,ct.jsx)(Se,{className:"text-lg",children:re})}),(0,ct.jsx)(ve,{children:(0,ct.jsx)("pre",{className:"text-sm",children:JSON.stringify(N.data,null,2)})})]})},Y)}return null})]})]})};return(0,ct.jsxs)(le,{className:`h-full flex flex-col shadow-sm ${U||""}`,children:[(0,ct.jsxs)(he,{ref:x,className:"flex-1 p-4",onDragOver:ie,onDragLeave:B,onDrop:Ne,children:[(0,ct.jsxs)("div",{className:s("space-ct-4",c&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,ct.jsx)(kt.AnimatePresence,{children:e.map(p=>(0,ct.jsx)(kt.motion.div,{initial:{opacity:0,ct:10},animate:{opacity:1,ct:0},className:s("flex gap-3",p.role==="user"?"flex-row-reverse":"flex-row"),children:A(p)},p.id))}),I&&(0,ct.jsxs)(kt.motion.div,{initial:{opacity:0,ct:10},animate:{opacity:1,ct:0},exit:{opacity:0,ct:-10},className:"flex gap-3",children:[(0,ct.jsx)(Ue,{className:"h-8 w-8",children:(0,ct.jsx)(je,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,ct.jsx)(sa.Bot,{className:"h-4 w-4"})})}),(0,ct.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,ct.jsx)($a,{capabilities:l,isOpen:I,onToggle:()=>C(!I),onActionSelect:G,className:"w-full"})})]}),a&&(0,ct.jsxs)(kt.motion.div,{initial:{opacity:0,ct:10},animate:{opacity:1,ct:0},className:"flex gap-3",children:[(0,ct.jsx)(Ue,{className:"h-8 w-8",children:(0,ct.jsx)(je,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,ct.jsx)(sa.Bot,{className:"h-4 w-4"})})}),(0,ct.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,ct.jsxs)("div",{className:"flex space-x-1",children:[(0,ct.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,ct.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,ct.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,ct.jsx)("div",{ref:D})]}),n.length>0&&(0,ct.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,ct.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(p=>(0,ct.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[L(p.file.type),(0,ct.jsx)("span",{className:"text-sm font-medium",children:p.file.name}),(0,ct.jsx)("span",{className:"text-xs text-muted-foreground",children:d(p.file.size)}),(0,ct.jsx)(R,{variant:"ghost",size:"sm",onClick:()=>k(p.id),className:"h-6 w-6 p-0",children:(0,ct.jsx)(sa.ct,{className:"h-4 w-4"})})]},p.id))})}),(0,ct.jsxs)("div",{className:"border-t p-4 bg-muted/20",children:[(0,ct.jsxs)("div",{className:"flex gap-3",children:[(0,ct.jsx)(Ze,{value:t,onChange:p=>u(p.target.value),onKeyPress:T,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),r&&(0,ct.jsx)(R,{variant:"outline",size:"icon",onClick:()=>S.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,ct.jsx)(sa.Paperclip,{className:"h-4 w-4"})}),(0,ct.jsx)(R,{onClick:m,disabled:!t.trim()&&n.length===0||a,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,ct.jsx)(sa.Send,{className:"h-4 w-4"})})]}),(0,ct.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,ct.jsxs)(R,{onClick:()=>C(!I),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,ct.jsx)(sa.Menu,{className:"h-3 w-3 mr-1"}),I?"Hide":"Show"," Capabilities"]}),(0,ct.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[K().map((p,M)=>(0,ct.jsx)(R,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>G(p.id,E),children:p.label},`context-${p.id}`)),K().length===0&&ee().map((p,M)=>(0,ct.jsx)(R,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:p.action,children:p.label},`suggestion-${M}`))]})]}),r&&(0,ct.jsx)("input",{ref:S,type:"file",multiple:!0,onChange:Q,className:"hidden"})]})]})}function Xa({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:l=[],capabilities:n=[],sidebarItems:c=[],notifications:r=[],sessions:u=[],onNewChat:m,onSessionSelect:T,onSessionDelete:v,onSessionEdit:k=()=>console.log("Session edit not implemented"),onBusinessUnitChange:P=()=>{},onNotificationRemove:U=()=>{},onRemoveAll:D=()=>{},onActionClick:x=()=>{},onSearch:S=L=>console.log("Search query:",L),initialTeam:I="design",currentSession:C=null,showCapabilities:E=!0,title:oe="Digital Colleagues",enableFileUpload:K=!0,maxFileSize:ee=10,allowedFileTypes:G=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:q="/headerlogo.png",appName:Q="Nuvia",tagline:ie="AI-Powered Workspace",actionIcon:B=(0,ct.jsx)(sa.Users,{className:"mr-2 h-4 w-4"}),actionText:Ne="Collaborate",sidebarInitiallyClosed:d=!1}){let L=(0,_a.useChat)(e||{}),A=a?t||L:null,[p,M]=(0,$e.useState)(""),[O,ne]=(0,$e.useState)(!1),V=A?.messages||o,Y=p,N=A?.status==="submitted"||O,re=l||[],se={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[Je,Ya]=(0,$e.useState)(()=>re.length===0?se:re.find(_=>_.id===I)||re[0]),[Dt,it]=(0,$e.useState)([]),[Za,eo]=(0,$e.useState)(!1),to=_=>{if(!_||!K)return;let rt=[];Array.from(_).forEach(ue=>{if(ue.size>ee*1024*1024){alert(`File ${ue.name} is too large. Maximum size is ${ee}MB.`);return}if(G.length>0&&!G.some(nt=>ue.type.match(nt))){alert(`File type ${ue.type} is not allowed.`);return}let qt={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:ue,status:"pending",progress:0};if(ue.type.startsWith("image/")){let nt=new FileReader;nt.onload=ro=>{it(no=>no.map(Pt=>Pt.id===qt.id?{...Pt,preview:ro.target?.result}:Pt))},nt.readAsDataURL(ue)}rt.push(qt)}),it(ue=>[...ue,...rt])},ao=_=>{it(rt=>rt.filter(ue=>ue.id!==_))},Kt=()=>{if(!(!Y.trim()&&Dt.length===0)){if(A){let _={id:Date.now().toString(),role:"user",parts:[{type:"text",text:Y}]};A.sendMessage(_),M("")}else console.log("Message to send:",Y),console.log("Files to upload:",Dt),M(""),ne(!0),setTimeout(()=>{ne(!1)},1500);it([])}},oo=_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),Kt())},io=_=>{M(_)};return(0,ct.jsx)(Ga,{sidebarItems:c||[],title:oe,notifications:r||[],businessUnits:re,currentBusinessUnit:Je,onBusinessUnitChange:_=>{_&&(Ya(_),P?.(_))},onSearch:S,showTabs:!1,onActionClick:x,actionIcon:B,actionText:Ne,onNotificationRemove:U,onRemoveAll:D,logo:q,appName:Q,tagline:ie,sidebarInitiallyClosed:d,children:(0,ct.jsx)(kt.AnimatePresence,{mode:"wait",children:(0,ct.jsx)(kt.motion.div,{className:"flex-1 h-full",initial:{opacity:0,ct:10},animate:{opacity:1,ct:0},exit:{opacity:0,ct:-10},transition:{duration:.2},children:(0,ct.jsxs)("div",{className:"h-full flex",children:[(0,ct.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,ct.jsx)(Wa,{sessions:u||[],currentSession:C,teams:re,onNewChat:m,onSessionSelect:T,onSessionEdit:k,onSessionDelete:v})}),(0,ct.jsx)("div",{className:"flex-1 h-full p-2",children:(0,ct.jsx)(qa,{messages:V||[],input:Y,isTyping:N,currentSessionTitle:C?.title,capabilities:n||[],onInputChange:io,onSendMessage:Kt,onKeyPress:oo,fileUploads:Dt,isDragOver:Za,enableFileUpload:K,onFileUpload:to,onRemoveFile:ao,onDragOver:eo})})]})},"chat-interface")})})}var pi=[{id:"1",role:"user",parts:[{type:"text",text:"Hello, can you help ct with a task?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:"Of course! I can help you create and manage tasks."}]},{id:"3",role:"user",parts:[{type:"text",text:"Here is a file with project requirements"},{type:"file",mimeType:"application/pdf",url:"/path/to/file.pdf"}]},{id:"4",role:"assistant",parts:[{type:"text",text:"I'll create a task based on your requirements."},{type:"tool-task",toolCallId:"call-123",state:"output-available",input:{title:"Project Requirements Review",description:"Review and analyze the uploaded requirements document"},output:{id:"task-123",title:"Project Requirements Review",description:"Review and analyze the uploaded requirements document",status:"created",assignee:"AI Assistant",priority:"high"}}]},{id:"5",role:"assistant",parts:[{type:"text",text:"Here are some relevant resources for your project:"},{type:"data-reference",data:{references:[{id:"ref-1",title:"Project Management Best Practices",url:"https://example.com/pm-best-practices",description:"Comprehensive guide to project management",type:"document"},{id:"ref-2",title:"Requirements Gathering Template",url:"https://example.com/requirements-template",description:"Template for gathering project requirements",type:"link"}]}}]},{id:"6",role:"assistant",parts:[{type:"text",text:"What would you like to do next?"},{type:"data-menu",data:{title:"Available Actions",items:[{id:"action-1",label:"Create another task",description:"Set up a new task for the project",action:()=>console.log("Create task clicked")},{id:"action-2",label:"View project timeline",description:"See the project schedule and milestones",action:()=>console.log("View timeline clicked")},{id:"action-3",label:"Assign team members",description:"Add team members to the project",action:()=>console.log("Assign team clicked")}]}}]}];function mi(){return(0,ct.jsx)(Xa,{messages:pi,businessUnits:[{id:"engineering",name:"Engineering",description:"Software development team",icon:"\u2699\uFE0F",color:"bg-blue-500",accentColor:"bg-blue-600"}],capabilities:[],sessions:[],onNewChat:()=>console.log("New chat started"),onSessionSelect:e=>console.log("Session selected:",e),onSessionDelete:e=>console.log("Session deleted:",e),enableFileUpload:!0,title:"AI Assistant"})}0&&(module.exports={ExampleChatInterface});
|