cortex-react-components 2.14.0 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/chunk-5Y6FKL5W.mjs +4 -0
  2. package/dist/{chunk-F2Y3ELUO.mjs → chunk-A2KX5N75.mjs} +1 -1
  3. package/dist/chunk-EW6KWAHS.mjs +4 -0
  4. package/dist/{chunk-2Z5N6HIX.mjs → chunk-JTVWQ42C.mjs} +1 -1
  5. package/dist/{chunk-GSOFCLPO.mjs → chunk-RX63ABAF.mjs} +1 -1
  6. package/dist/chunk-UTHKFW4R.mjs +1 -0
  7. package/dist/components/Chat/ChatInterface.js +10 -9
  8. package/dist/components/Chat/ChatInterface.mjs +1 -1
  9. package/dist/components/Chat/CopilotInterface.js +11 -10
  10. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  11. package/dist/components/Chat/PartTypes/Reasoning.css +1 -0
  12. package/dist/components/Chat/PartTypes/Reasoning.d.ts +16 -0
  13. package/dist/components/Chat/PartTypes/Reasoning.js +5 -0
  14. package/dist/components/Chat/PartTypes/Reasoning.mjs +2 -0
  15. package/dist/components/Chat/PartTypes/Response.css +1 -0
  16. package/dist/components/Chat/PartTypes/Response.d.ts +5 -0
  17. package/dist/components/Chat/PartTypes/Response.js +4 -0
  18. package/dist/components/Chat/PartTypes/Response.mjs +2 -0
  19. package/dist/components/Chat/PartTypes/index.css +1 -0
  20. package/dist/components/Chat/PartTypes/index.d.ts +2 -0
  21. package/dist/components/Chat/PartTypes/index.js +11 -10
  22. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  23. package/dist/components/Chat/demo-long-messages.js +21 -20
  24. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  25. package/dist/components/Chat/demo-tests.js +38 -37
  26. package/dist/components/Chat/demo-tests.mjs +1 -1
  27. package/dist/components/Chat/demo.js +11 -10
  28. package/dist/components/Chat/demo.mjs +1 -1
  29. package/dist/components/Chat/example-usage.js +11 -10
  30. package/dist/components/Chat/example-usage.mjs +1 -1
  31. package/dist/components/Chat/example-with-vercel-ai.js +11 -10
  32. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  33. package/dist/components/Chat/index.js +11 -10
  34. package/dist/components/Chat/index.mjs +1 -1
  35. package/dist/components/Foundary/Views/index.mjs +1 -1
  36. package/dist/components/Foundary/index.mjs +1 -1
  37. package/dist/components/Heros/RenderHero.mjs +1 -1
  38. package/dist/components/Heros/index.mjs +1 -1
  39. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  40. package/dist/components/Layouts/Print.mjs +1 -1
  41. package/dist/components/Layouts/SlideShow.mjs +1 -1
  42. package/dist/components/Layouts/index.mjs +1 -1
  43. package/dist/components/Payload/index.mjs +1 -1
  44. package/dist/components/index.js +19 -19
  45. package/dist/components/index.mjs +1 -1
  46. package/dist/globals.css +1 -1
  47. package/dist/index.js +18 -18
  48. package/dist/index.mjs +1 -1
  49. package/dist/metafile-cjs.json +1 -1
  50. package/dist/metafile-esm.json +1 -1
  51. package/dist/pages/LandingPage.mjs +1 -1
  52. package/dist/pages/Page.mjs +1 -1
  53. package/dist/pages/Publish.mjs +1 -1
  54. package/dist/pages/Website.mjs +1 -1
  55. package/dist/sections/PageSections.mjs +1 -1
  56. package/dist/sections/ServiceSection.mjs +1 -1
  57. package/dist/sections/index.mjs +1 -1
  58. package/package.json +6 -4
  59. package/dist/chunk-4RGIPI27.mjs +0 -1
@@ -0,0 +1,4 @@
1
+ "use client";
2
+ "use strict";
3
+
4
+ import{a as h}from"./chunk-EW6KWAHS.mjs";import{a as C,b,c as R}from"./chunk-YNCJATT7.mjs";import{a}from"./chunk-MDJREBVI.mjs";import{useControllableState as x}from"@radix-ui/react-use-controllable-state";import{BrainIcon as S,ChevronDownIcon as A}from"lucide-react";import{createContext as E,memo as m,useContext as _,useEffect as T,useState as P}from"react";import{Fragment as U,jsx as n,jsxs as N}from"react/jsx-runtime";var y=E(null),M=()=>{let o=_(y);if(!o)throw new Error("Reasoning components must be used within Reasoning");return o},k=1e3,z=1e3,L=m(({className:o,isStreaming:e=!1,open:t,defaultOpen:s=!0,onOpenChange:p,duration:u,children:O,...w})=>{let[r,i]=x({prop:t,defaultProp:s,onChange:p}),[v,c]=x({prop:u,defaultProp:0}),[d,D]=P(!1),[l,f]=P(null);T(()=>{e?l===null&&f(Date.now()):l!==null&&(c(Math.ceil((Date.now()-l)/z)),f(null))},[e,l,c]),T(()=>{if(s&&!e&&r&&!d){let g=setTimeout(()=>{i(!1),D(!0)},k);return()=>clearTimeout(g)}},[e,r,s,i,d]);let I=g=>{i(g)};return n(y.Provider,{value:{isStreaming:e,isOpen:r,setIsOpen:i,duration:v},children:n(C,{className:a("not-prose mb-4",o),onOpenChange:I,open:r,...w,children:O})})}),V=(o,e)=>o||e===0?n("p",{children:"Thinking..."}):e===void 0?n("p",{children:"Thought for a few seconds"}):N("p",{children:["Thought for ",e," seconds"]}),B=m(({className:o,children:e,...t})=>{let{isStreaming:s,isOpen:p,duration:u}=M();return n(b,{className:a("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",o),...t,children:e??N(U,{children:[n(S,{className:"size-4"}),V(s,u),n(A,{className:a("size-4 transition-transform",p?"rotate-180":"rotate-0")})]})})}),H=m(({className:o,children:e,...t})=>n(R,{className:a("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",o),...t,children:n(h,{className:"grid gap-2",children:e})}));L.displayName="Reasoning";B.displayName="ReasoningTrigger";H.displayName="ReasoningContent";export{L as a,B as b,H as c};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{a as b}from"./chunk-E6UOMRHI.mjs";import{a as I}from"./chunk-56X4PU43.mjs";import{a as S}from"./chunk-4RGIPI27.mjs";import{useChat as me}from"@ai-sdk/react";import{useState as r}from"react";import{motion as fe,AnimatePresence as he}from"motion/react";import{Users as ye}from"lucide-react";import{jsx as n,jsxs as Ce}from"react/jsx-runtime";function Le({aiConfig:w,useCustomChat:F,enableAI:D=!0,messages:T=[],businessUnits:B=[],capabilities:R=[],sidebarItems:x=[],notifications:N=[],sessions:M=[],onNewChat:A,onSessionSelect:L,onSessionDelete:P,onSessionEdit:k=()=>{},onBusinessUnitChange:E=()=>{},onNotificationRemove:K=()=>{},onRemoveAll:O=()=>{},onActionClick:$=()=>{},onSearch:q=p=>console.log("Search query:",p),initialTeam:z="design",currentSession:m=null,showCapabilities:ve=!0,title:W="Digital Colleagues",enableFileUpload:f=!0,maxFileSize:h=10,allowedFileTypes:y=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:H="/headerlogo.png",appName:X="Nuvia",tagline:G="AI-Powered Workspace",actionIcon:J=n(ye,{className:"mr-2 h-4 w-4"}),actionText:Q="Collaborate",sidebarInitiallyClosed:V=!1}){let p={...w,onError:e=>{i?.setMessages(t=>[...t,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:e.message}]}]),console.error("Error in CopilotInterface:",e)}},Y=me(p||{}),i=D?F||Y:null,[Z,u]=r(""),[_,C]=r(!1),j=i?.messages||T,l=Z,ee=i?.status==="submitted"||_,se=i?.addToolResult?(e,t,s)=>{i.addToolResult({tool:t,toolCallId:e,output:s}),i.sendMessage()}:()=>{},o=B||[],te={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"},[ie,ne]=r(()=>o.length===0?te:o.find(e=>e.id===z)||o[0]),[a,c]=r([]),[oe,ae]=r(!1),re=e=>{if(!e||!f)return;let t=[];Array.from(e).forEach(s=>{if(s.size>h*1024*1024){alert(`File ${s.name} is too large. Maximum size is ${h}MB.`);return}if(y.length>0&&!y.some(d=>s.type.match(d))){alert(`File type ${s.type} is not allowed.`);return}let U={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:s,status:"pending",progress:0};if(s.type.startsWith("image/")){let d=new FileReader;d.onload=ue=>{c(ge=>ge.map(g=>g.id===U.id?{...g,preview:ue.target?.result}:g))},d.readAsDataURL(s)}t.push(U)}),c(s=>[...s,...t])},le=e=>{c(t=>t.filter(s=>s.id!==e))},v=()=>{if(!(!l.trim()&&a.length===0)){if(i){let e=a.length>0?ce(a.map(t=>t.file)):void 0;i.sendMessage({text:l,files:e},{body:{timestamp:Date.now()}}),u("")}else console.log("Message to send:",l),console.log("Files to upload:",a),u(""),C(!0),setTimeout(()=>{C(!1)},1500);c([])}},ce=e=>{let t=new DataTransfer;return e.forEach(s=>t.items.add(s)),t.files},de=e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),v())},pe=e=>{u(e)};return n(b,{sidebarItems:x||[],title:W,notifications:N||[],businessUnits:o,currentBusinessUnit:ie,onBusinessUnitChange:e=>{e&&(ne(e),E?.(e))},onSearch:q,showTabs:!1,onActionClick:$,actionIcon:J,actionText:Q,onNotificationRemove:K,onRemoveAll:O,logo:H,appName:X,tagline:G,sidebarInitiallyClosed:V,children:n(he,{mode:"wait",children:n(fe.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:Ce("div",{className:"h-full flex",children:[n("div",{className:"w-80 flex-shrink-0 h-full p-2",children:n(I,{sessions:M||[],currentSession:m,teams:o,onNewChat:A,onSessionSelect:L,onSessionEdit:k,onSessionDelete:P})}),n("div",{className:"flex-1 h-full p-2",children:n(S,{messages:j||[],input:l,isTyping:ee,currentSessionTitle:m?.title,capabilities:R||[],onInputChange:pe,addToolResult:se,onSendMessage:v,onKeyPress:de,fileUploads:a,isDragOver:oe,enableFileUpload:f,onFileUpload:re,onRemoveFile:le,onDragOver:ae})})]})},"chat-interface")})})}export{Le as a};
4
+ import{a as b}from"./chunk-E6UOMRHI.mjs";import{a as I}from"./chunk-56X4PU43.mjs";import{a as S}from"./chunk-UTHKFW4R.mjs";import{useChat as me}from"@ai-sdk/react";import{useState as r}from"react";import{motion as fe,AnimatePresence as he}from"motion/react";import{Users as ye}from"lucide-react";import{jsx as n,jsxs as Ce}from"react/jsx-runtime";function Le({aiConfig:w,useCustomChat:F,enableAI:D=!0,messages:T=[],businessUnits:B=[],capabilities:R=[],sidebarItems:x=[],notifications:N=[],sessions:M=[],onNewChat:A,onSessionSelect:L,onSessionDelete:P,onSessionEdit:k=()=>{},onBusinessUnitChange:E=()=>{},onNotificationRemove:K=()=>{},onRemoveAll:O=()=>{},onActionClick:$=()=>{},onSearch:q=p=>console.log("Search query:",p),initialTeam:z="design",currentSession:m=null,showCapabilities:ve=!0,title:W="Digital Colleagues",enableFileUpload:f=!0,maxFileSize:h=10,allowedFileTypes:y=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:H="/headerlogo.png",appName:X="Nuvia",tagline:G="AI-Powered Workspace",actionIcon:J=n(ye,{className:"mr-2 h-4 w-4"}),actionText:Q="Collaborate",sidebarInitiallyClosed:V=!1}){let p={...w,onError:e=>{i?.setMessages(t=>[...t,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:e.message}]}]),console.error("Error in CopilotInterface:",e)}},Y=me(p||{}),i=D?F||Y:null,[Z,u]=r(""),[_,C]=r(!1),j=i?.messages||T,l=Z,ee=i?.status==="submitted"||_,se=i?.addToolResult?(e,t,s)=>{i.addToolResult({tool:t,toolCallId:e,output:s}),i.sendMessage()}:()=>{},o=B||[],te={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"},[ie,ne]=r(()=>o.length===0?te:o.find(e=>e.id===z)||o[0]),[a,c]=r([]),[oe,ae]=r(!1),re=e=>{if(!e||!f)return;let t=[];Array.from(e).forEach(s=>{if(s.size>h*1024*1024){alert(`File ${s.name} is too large. Maximum size is ${h}MB.`);return}if(y.length>0&&!y.some(d=>s.type.match(d))){alert(`File type ${s.type} is not allowed.`);return}let U={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:s,status:"pending",progress:0};if(s.type.startsWith("image/")){let d=new FileReader;d.onload=ue=>{c(ge=>ge.map(g=>g.id===U.id?{...g,preview:ue.target?.result}:g))},d.readAsDataURL(s)}t.push(U)}),c(s=>[...s,...t])},le=e=>{c(t=>t.filter(s=>s.id!==e))},v=()=>{if(!(!l.trim()&&a.length===0)){if(i){let e=a.length>0?ce(a.map(t=>t.file)):void 0;i.sendMessage({text:l,files:e},{body:{timestamp:Date.now()}}),u("")}else console.log("Message to send:",l),console.log("Files to upload:",a),u(""),C(!0),setTimeout(()=>{C(!1)},1500);c([])}},ce=e=>{let t=new DataTransfer;return e.forEach(s=>t.items.add(s)),t.files},de=e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),v())},pe=e=>{u(e)};return n(b,{sidebarItems:x||[],title:W,notifications:N||[],businessUnits:o,currentBusinessUnit:ie,onBusinessUnitChange:e=>{e&&(ne(e),E?.(e))},onSearch:q,showTabs:!1,onActionClick:$,actionIcon:J,actionText:Q,onNotificationRemove:K,onRemoveAll:O,logo:H,appName:X,tagline:G,sidebarInitiallyClosed:V,children:n(he,{mode:"wait",children:n(fe.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:Ce("div",{className:"h-full flex",children:[n("div",{className:"w-80 flex-shrink-0 h-full p-2",children:n(I,{sessions:M||[],currentSession:m,teams:o,onNewChat:A,onSessionSelect:L,onSessionEdit:k,onSessionDelete:P})}),n("div",{className:"flex-1 h-full p-2",children:n(S,{messages:j||[],input:l,isTyping:ee,currentSessionTitle:m?.title,capabilities:R||[],onInputChange:pe,addToolResult:se,onSendMessage:v,onKeyPress:de,fileUploads:a,isDragOver:oe,enableFileUpload:f,onFileUpload:re,onRemoveFile:le,onDragOver:ae})})]})},"chat-interface")})})}export{Le as a};
@@ -0,0 +1,4 @@
1
+ "use client";
2
+ "use strict";
3
+
4
+ import{a as s}from"./chunk-MDJREBVI.mjs";import{memo as p}from"react";import{Streamdown as m}from"streamdown";import{jsx as r}from"react/jsx-runtime";var n=p(({className:o,...e})=>r(m,{className:s("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",o),...e}),(o,e)=>o.children===e.children);n.displayName="Response";export{n as a};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- import{a as S,b as w}from"./chunk-MXCW6SOT.mjs";import{a as k}from"./chunk-5SHZBJ5R.mjs";import{a as C}from"./chunk-I2GNNRFH.mjs";import{a as g}from"./chunk-MZP7RIQZ.mjs";import{a as v}from"./chunk-HKGW6JI2.mjs";import{a as f}from"./chunk-YKG4FNS4.mjs";import{a as u}from"./chunk-255P6K5W.mjs";import{c as m,f as p}from"./chunk-N3B3XNV3.mjs";import{a as d}from"./chunk-2BR55L74.mjs";import{a as s}from"./chunk-7WIO2CIC.mjs";import{a as x}from"./chunk-6C4WESLL.mjs";import{a as N}from"./chunk-CLGBBNRB.mjs";import{a as h}from"./chunk-FMJBJ3HN.mjs";import{a as n}from"./chunk-MDJREBVI.mjs";import{a as b}from"./chunk-WU3JMLSC.mjs";import{a as y}from"./chunk-BZAYEKYC.mjs";import z from"next/image";import{jsx as e,jsxs as o}from"react/jsx-runtime";var H=t=>({root:{type:"root",format:"",indent:0,version:1,children:[{type:"paragraph",format:"",indent:0,version:1,children:[{mode:"normal",text:t,type:"text",style:"",detail:0,format:0,version:1}],direction:"ltr",textStyle:"",textFormat:0}],direction:"ltr"}}),T=({children:t})=>e("div",{children:o("div",{className:"sticky top-0 h-screen",children:[t,e(s,{className:"text-black z-10",position:"header"})]})}),R=()=>o(T,{children:[o("video",{className:"fixed inset-0 object-cover w-full h-full z-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[e("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),e("div",{className:"fixed inset-0 h-full z-10 flex flex-col items-start justify-center text-white px-4",children:e(h,{children:o("div",{className:"flex flex-col items-start md:w-1/2 mb-10 z-0 md:mb-0",children:[e("h1",{className:"text-5xl md:text-7xl mb-6",children:"Lorum ipsum."}),e("div",{className:"text-lg md:text-2xl text-gray-300 mb-8 max-w-lg",children:"Lorum ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec dui ac odio."})]})})})]}),L={highImpact:u,lowImpact:v,mediumImpact:f,sectionHero:g,dummy:R};function P({...t}){let i=t.style;return o("div",{className:"relative overflow-y-none scroll-smooth snap-y snap-mandatory",children:[e(N,{isMenuOpen:!0,logoLight:y,logoDark:b,...t.header}),e(I,{...t.hero}),e(c,{theme:"light",style:i,children:e(k,{...t.service})}),e(c,{theme:"dark",style:i,image:t.service.services[0].image,children:e(j,{})}),e(c,{theme:"light",style:i,children:e(j,{})}),e(c,{theme:"dark",style:i,children:e(S,{...t.contact})}),e(c,{theme:"light",style:i,children:e(w,{...t.contact})}),e(c,{theme:"last",style:i,children:e(C,{...t.blog})}),e(m,{...t.cta}),e(x,{...t.footer})]})}var I=t=>{let{type:i}=t||{};if(!i||i==="none")return null;let l=L[i];return l?e(l,{...t}):null},j=()=>{let t={blurDataURL:"/assets/props/Cortex-Handshake-BG.jpg",height:1315,url:"/assets/props/Cortex-Handshake-BG.jpg",width:1920};return e("div",{className:"container",children:o("div",{className:"w-full grid grid-cols-1 md:grid-cols-2 gap-1 items-center justify-center",children:[o("div",{className:n("w-full text-left"),children:[e("h2",{className:"text-3xl md:text-5xl text-primary",children:"Lorum ipsum..."}),e("p",{className:"mt-4 text-gray-700 text-lg",children:e(p,{enableGutter:!1,content:H("Lorum ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec dui ac odio. Nulla facilisi. Nullam nec nisi nec odio ultricies ultricies. Nullam nec nisi nec odio ultricies ultricies. Nullam nec nisi nec odio ultricies ultricies. Lorum ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec dui ac odio. Nulla facilisi. Nullam nec nisi nec odio ultricies ultricies. Nullam nec nisi nec odio ultricies ultricies. Nullam nec nisi nec odio ultricies ultricies."),enableProse:!1,className:n("prose prose-headings:text-foreground prose-p:text-foreground")})}),e("button",{className:"mt-6 px-6 py-3 border border-1 border-accent text-foreground rounded-full text-base hover:bg-accent hover:text-accent-foreground transition",children:"Click here"})]}),e("div",{className:"w-full h-full min-h-96 p-6 md:p-6 flex justify-center",children:e(z,{src:t.url,alt:"image",width:t.width,height:t.height,className:"max-w-full"})})]})})},c=({children:t,theme:i,style:l,neighbours:M,shape:D,image:B,id:r,continueTheme:F})=>{let G=a=>o("div",{className:"select-none",children:[a&&typeof a=="object"&&e(d,{fill:!0,imgClassName:"z-5 object-cover",priority:!1,loading:"lazy",resource:a}),a&&typeof a=="string"&&e("div",{children:e(z,{className:"-z-10 object-cover",alt:"",fill:!0,priority:!0,src:a})})]});if(i==="dark"&&l==="slide")return e("section",{id:r||"next-section",className:"sticky md:top-0 h-screen",children:o("div",{className:"dark pt-0 min-h-[80vh]",children:[e(s,{className:"z-10",position:"dark-top"}),o("div",{className:"relative",children:[e("div",{className:"flex items-center bg-black justify-center pt-12",children:e("div",{className:"container",children:t})}),e(s,{className:"z-10",position:"dark-bottom"})]})]})});if(i==="light"&&l==="slide")return e("section",{id:r||"next-section",className:"sticky top-0 light pt-0 h-screen",children:o("div",{className:"sticky top-0 light pt-0 h-screen",children:[e(s,{className:"z-10",position:"light-top"}),o("div",{className:"relative bg-white",children:[e("div",{className:"flex items-center bg-white justify-center pt-12",children:e("div",{className:"container",children:t})}),e("div",{className:"h-[200px] bg-white"})]})]})});if(i==="first")return e("section",{id:r||"next-section",className:"",children:e("div",{className:"sticky top-0 light bg-background pt-6 min-h-[80vh]",children:o("div",{className:"relative",children:[e("div",{className:"flex items-center justify-center pt-12",children:e("div",{className:"container",children:t})}),e(s,{className:"text-black z-10",position:"bottom-right"})]})})});if(i==="light")return e("section",{id:r||"next-section",className:"",children:e("div",{className:n("sticky top-0 light bg-background min-h-[50vh]","pb-10"),children:e("div",{className:"flex items-center pt-8 justify-center",children:e("div",{className:"container",children:t})})})});if(i==="dark")return e("section",{id:r||"next-section",className:"",children:o("div",{className:"sticky -top-[1px] dark min-h-[80vh] bg-white",children:[e(s,{className:"text-black z-10",position:"bottom-right"}),e("div",{className:"flex items-center justify-center pt-12 bg-black",children:e("div",{className:"container",children:t})}),e(s,{className:"text-accent z-10",position:"top"})]})});if(i==="last")return e("section",{id:r||"next-section",className:"",children:o("div",{className:"sticky -top-[1px] dark min-h-[80vh] bg-white",children:[e(s,{className:"text-black z-10",position:"bottom-right"}),e("div",{className:"flex items-center justify-center pb-12 bg-black min-h-[80vh]",children:e("div",{className:"container",children:t})})]})})};export{P as a,c as b};
4
+ import{a as S,b as w}from"./chunk-MXCW6SOT.mjs";import{a as k}from"./chunk-5SHZBJ5R.mjs";import{a as C}from"./chunk-I2GNNRFH.mjs";import{a as g}from"./chunk-MZP7RIQZ.mjs";import{a as f}from"./chunk-YKG4FNS4.mjs";import{a as v}from"./chunk-HKGW6JI2.mjs";import{a as u}from"./chunk-255P6K5W.mjs";import{c as m,f as p}from"./chunk-N3B3XNV3.mjs";import{a as d}from"./chunk-2BR55L74.mjs";import{a as s}from"./chunk-7WIO2CIC.mjs";import{a as x}from"./chunk-6C4WESLL.mjs";import{a as N}from"./chunk-CLGBBNRB.mjs";import{a as h}from"./chunk-FMJBJ3HN.mjs";import{a as n}from"./chunk-MDJREBVI.mjs";import{a as b}from"./chunk-WU3JMLSC.mjs";import{a as y}from"./chunk-BZAYEKYC.mjs";import z from"next/image";import{jsx as e,jsxs as o}from"react/jsx-runtime";var H=t=>({root:{type:"root",format:"",indent:0,version:1,children:[{type:"paragraph",format:"",indent:0,version:1,children:[{mode:"normal",text:t,type:"text",style:"",detail:0,format:0,version:1}],direction:"ltr",textStyle:"",textFormat:0}],direction:"ltr"}}),T=({children:t})=>e("div",{children:o("div",{className:"sticky top-0 h-screen",children:[t,e(s,{className:"text-black z-10",position:"header"})]})}),R=()=>o(T,{children:[o("video",{className:"fixed inset-0 object-cover w-full h-full z-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[e("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),e("div",{className:"fixed inset-0 h-full z-10 flex flex-col items-start justify-center text-white px-4",children:e(h,{children:o("div",{className:"flex flex-col items-start md:w-1/2 mb-10 z-0 md:mb-0",children:[e("h1",{className:"text-5xl md:text-7xl mb-6",children:"Lorum ipsum."}),e("div",{className:"text-lg md:text-2xl text-gray-300 mb-8 max-w-lg",children:"Lorum ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec dui ac odio."})]})})})]}),L={highImpact:u,lowImpact:v,mediumImpact:f,sectionHero:g,dummy:R};function P({...t}){let i=t.style;return o("div",{className:"relative overflow-y-none scroll-smooth snap-y snap-mandatory",children:[e(N,{isMenuOpen:!0,logoLight:y,logoDark:b,...t.header}),e(I,{...t.hero}),e(c,{theme:"light",style:i,children:e(k,{...t.service})}),e(c,{theme:"dark",style:i,image:t.service.services[0].image,children:e(j,{})}),e(c,{theme:"light",style:i,children:e(j,{})}),e(c,{theme:"dark",style:i,children:e(S,{...t.contact})}),e(c,{theme:"light",style:i,children:e(w,{...t.contact})}),e(c,{theme:"last",style:i,children:e(C,{...t.blog})}),e(m,{...t.cta}),e(x,{...t.footer})]})}var I=t=>{let{type:i}=t||{};if(!i||i==="none")return null;let l=L[i];return l?e(l,{...t}):null},j=()=>{let t={blurDataURL:"/assets/props/Cortex-Handshake-BG.jpg",height:1315,url:"/assets/props/Cortex-Handshake-BG.jpg",width:1920};return e("div",{className:"container",children:o("div",{className:"w-full grid grid-cols-1 md:grid-cols-2 gap-1 items-center justify-center",children:[o("div",{className:n("w-full text-left"),children:[e("h2",{className:"text-3xl md:text-5xl text-primary",children:"Lorum ipsum..."}),e("p",{className:"mt-4 text-gray-700 text-lg",children:e(p,{enableGutter:!1,content:H("Lorum ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec dui ac odio. Nulla facilisi. Nullam nec nisi nec odio ultricies ultricies. Nullam nec nisi nec odio ultricies ultricies. Nullam nec nisi nec odio ultricies ultricies. Lorum ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec dui ac odio. Nulla facilisi. Nullam nec nisi nec odio ultricies ultricies. Nullam nec nisi nec odio ultricies ultricies. Nullam nec nisi nec odio ultricies ultricies."),enableProse:!1,className:n("prose prose-headings:text-foreground prose-p:text-foreground")})}),e("button",{className:"mt-6 px-6 py-3 border border-1 border-accent text-foreground rounded-full text-base hover:bg-accent hover:text-accent-foreground transition",children:"Click here"})]}),e("div",{className:"w-full h-full min-h-96 p-6 md:p-6 flex justify-center",children:e(z,{src:t.url,alt:"image",width:t.width,height:t.height,className:"max-w-full"})})]})})},c=({children:t,theme:i,style:l,neighbours:M,shape:D,image:B,id:r,continueTheme:F})=>{let G=a=>o("div",{className:"select-none",children:[a&&typeof a=="object"&&e(d,{fill:!0,imgClassName:"z-5 object-cover",priority:!1,loading:"lazy",resource:a}),a&&typeof a=="string"&&e("div",{children:e(z,{className:"-z-10 object-cover",alt:"",fill:!0,priority:!0,src:a})})]});if(i==="dark"&&l==="slide")return e("section",{id:r||"next-section",className:"sticky md:top-0 h-screen",children:o("div",{className:"dark pt-0 min-h-[80vh]",children:[e(s,{className:"z-10",position:"dark-top"}),o("div",{className:"relative",children:[e("div",{className:"flex items-center bg-black justify-center pt-12",children:e("div",{className:"container",children:t})}),e(s,{className:"z-10",position:"dark-bottom"})]})]})});if(i==="light"&&l==="slide")return e("section",{id:r||"next-section",className:"sticky top-0 light pt-0 h-screen",children:o("div",{className:"sticky top-0 light pt-0 h-screen",children:[e(s,{className:"z-10",position:"light-top"}),o("div",{className:"relative bg-white",children:[e("div",{className:"flex items-center bg-white justify-center pt-12",children:e("div",{className:"container",children:t})}),e("div",{className:"h-[200px] bg-white"})]})]})});if(i==="first")return e("section",{id:r||"next-section",className:"",children:e("div",{className:"sticky top-0 light bg-background pt-6 min-h-[80vh]",children:o("div",{className:"relative",children:[e("div",{className:"flex items-center justify-center pt-12",children:e("div",{className:"container",children:t})}),e(s,{className:"text-black z-10",position:"bottom-right"})]})})});if(i==="light")return e("section",{id:r||"next-section",className:"",children:e("div",{className:n("sticky top-0 light bg-background min-h-[50vh]","pb-10"),children:e("div",{className:"flex items-center pt-8 justify-center",children:e("div",{className:"container",children:t})})})});if(i==="dark")return e("section",{id:r||"next-section",className:"",children:o("div",{className:"sticky -top-[1px] dark min-h-[80vh] bg-white",children:[e(s,{className:"text-black z-10",position:"bottom-right"}),e("div",{className:"flex items-center justify-center pt-12 bg-black",children:e("div",{className:"container",children:t})}),e(s,{className:"text-accent z-10",position:"top"})]})});if(i==="last")return e("section",{id:r||"next-section",className:"",children:o("div",{className:"sticky -top-[1px] dark min-h-[80vh] bg-white",children:[e(s,{className:"text-black z-10",position:"bottom-right"}),e("div",{className:"flex items-center justify-center pb-12 bg-black min-h-[80vh]",children:e("div",{className:"container",children:t})})]})})};export{P as a,c as b};
@@ -1 +1 @@
1
- import{a as n}from"./chunk-MZP7RIQZ.mjs";import{a as l}from"./chunk-HKGW6JI2.mjs";import{a as m}from"./chunk-YKG4FNS4.mjs";import{a as i}from"./chunk-255P6K5W.mjs";import{ChevronRightIcon as c,HomeIcon as f}from"@heroicons/react/20/solid";import{Fragment as h,jsx as e,jsxs as a}from"react/jsx-runtime";var d={highImpact:i,lowImpact:l,mediumImpact:m,sectionHero:n},H=t=>{let{type:o}=t||{};if(!o||o==="none")return null;let r=d[o];return r?e(r,{...t}):null};function N({breadcrumbItems:t}){if(t&&t.length>0){let o=t.filter(r=>r.label.toLowerCase()!=="home");return e("nav",{"aria-label":"Breadcrumb",className:"flex",children:a("ol",{role:"list",className:"flex items-center space-x-4",children:[e("li",{children:e("div",{children:a("a",{href:"/",className:"text-foreground hover:text-accent",children:[e(f,{"aria-hidden":"true",className:"size-5 shrink-0"}),e("span",{className:"sr-only",children:"Home"})]})})}),o.map((r,s)=>e("li",{children:a("div",{className:"flex items-center",children:[e(c,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),r.href?e("a",{href:r.href,className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:r.label}):e("div",{className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:r.label})]})},s))]})})}return e(h,{})}export{H as a,N as b};
1
+ import{a as n}from"./chunk-MZP7RIQZ.mjs";import{a as m}from"./chunk-YKG4FNS4.mjs";import{a as l}from"./chunk-HKGW6JI2.mjs";import{a as i}from"./chunk-255P6K5W.mjs";import{ChevronRightIcon as c,HomeIcon as f}from"@heroicons/react/20/solid";import{Fragment as h,jsx as e,jsxs as a}from"react/jsx-runtime";var d={highImpact:i,lowImpact:l,mediumImpact:m,sectionHero:n},H=t=>{let{type:o}=t||{};if(!o||o==="none")return null;let r=d[o];return r?e(r,{...t}):null};function N({breadcrumbItems:t}){if(t&&t.length>0){let o=t.filter(r=>r.label.toLowerCase()!=="home");return e("nav",{"aria-label":"Breadcrumb",className:"flex",children:a("ol",{role:"list",className:"flex items-center space-x-4",children:[e("li",{children:e("div",{children:a("a",{href:"/",className:"text-foreground hover:text-accent",children:[e(f,{"aria-hidden":"true",className:"size-5 shrink-0"}),e("span",{className:"sr-only",children:"Home"})]})})}),o.map((r,s)=>e("li",{children:a("div",{className:"flex items-center",children:[e(c,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),r.href?e("a",{href:r.href,className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:r.label}):e("div",{className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:r.label})]})},s))]})})}return e(h,{})}export{H as a,N as b};
@@ -0,0 +1 @@
1
+ import{a as G}from"./chunk-3BG2SCNC.mjs";import{a as E}from"./chunk-SIL7AP7H.mjs";import{a as _}from"./chunk-6OCLRAHU.mjs";import{a as Q,b as X,c as j}from"./chunk-5Y6FKL5W.mjs";import{a as q}from"./chunk-2LINLX4S.mjs";import{a as V}from"./chunk-DBY4SXQI.mjs";import{a as J}from"./chunk-I2PVJQQR.mjs";import{d as P}from"./chunk-Q2DPE66H.mjs";import{a as K}from"./chunk-FT3AE7L2.mjs";import{a as U}from"./chunk-L5JPAKPM.mjs";import{b as m}from"./chunk-ZUA4KNIR.mjs";import{a as h,c as x}from"./chunk-SOLZ4VQH.mjs";import{b as W}from"./chunk-CSBGSBEU.mjs";import{a as f,b as N,c as y,e as v}from"./chunk-YO3GQYRJ.mjs";import{a as p}from"./chunk-MDJREBVI.mjs";import{useRef as M,useEffect as Y,useState as Z}from"react";import*as u from"motion/react-client";import{Send as fe,Bot as B,User as ve,Menu as ge,Paperclip as Ne,X as ye,FileText as he,Image as xe,File as be,Download as Ce,ExternalLink as we}from"lucide-react";import{jsx as e,jsxs as s}from"react/jsx-runtime";function Je({messages:b,input:F,isTyping:C=!1,currentSessionTitle:ke,capabilities:R,fileUploads:w,isDragOver:ee,enableFileUpload:S,onInputChange:te,addToolResult:k,onSendMessage:ae,onKeyPress:se,onFileUpload:L,onRemoveFile:ie,onDragOver:T,className:re}){let I=M(null),le=M(null),z=M(null),[c,g]=Z(!1),[H,Te]=Z({path:[],selectedItems:[],filters:{}});Y(()=>{I.current?.scrollIntoView({behavior:"smooth"})},[b]),Y(()=>{c&&setTimeout(()=>{I.current?.scrollIntoView({behavior:"smooth"})},100)},[c]);let O=()=>P(H),oe=()=>{let t=[];return R.forEach(l=>{l.actions&&l.actions.forEach(o=>{t.push({label:o.label,action:()=>D(o.id,{path:[l],selectedItems:[],filters:{}})})}),l.children&&l.children.forEach(o=>{o.type==="list"&&o.data&&t.push({label:`View ${o.name}`,action:()=>g(!0)})})}),t.slice(0,5)},D=(t,l)=>{console.log("Capability action:",t,l);let o=`Executing ${t} with context: ${JSON.stringify(l.path.map(i=>i.name))}`;g(!1)},Ie=P({path:[],selectedItems:[],filters:{}}),ne=t=>{L(t.target.files),t.target.files&&(t.target.value="")},me=t=>{t.preventDefault(),T(!0)},de=t=>{t.preventDefault(),T(!1)},ce=t=>{t.preventDefault(),T(!1),L(t.dataTransfer.files)},ue=t=>{if(t===0)return"0 Bytes";let l=1024,o=["Bytes","KB","MB","GB"],i=Math.floor(Math.log(t)/Math.log(l));return parseFloat((t/Math.pow(l,i)).toFixed(2))+" "+o[i]},$=t=>t.startsWith("image/")?e(xe,{className:"h-4 w-4"}):t.startsWith("text/")?e(he,{className:"h-4 w-4"}):e(be,{className:"h-4 w-4"}),pe=t=>{let l=t.role==="assistant",o=t.role==="user";return s("div",{className:p("flex my-2 items-start gap-3",o?"flex-row-reverse":""),children:[e(h,{className:"h-8 w-8 shrink-0",children:e(x,{className:p(o?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:o?e(ve,{className:"h-4 w-4"}):e(B,{className:"h-4 w-4"})})}),e("div",{className:p("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",o?"bg-primary text-primary-foreground":"bg-muted"),children:t.parts.map((i,r)=>{if(i.type==="text")return e(_,{id:t.id,content:i.text},`${t.id}-text`);if(i.type==="file"){let a=i;return e("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:s("div",{className:"flex items-center gap-2",children:[$(a.mediaType||"application/octet-stream"),e("div",{className:"flex-1 min-w-0",children:e("p",{className:"text-sm font-medium truncate",children:a.filename||a.url?.split("/").pop()||"File"})}),a.url&&e(m,{variant:"ghost",size:"sm",onClick:()=>window.open(a.url,"_blank"),className:"h-8 w-8 p-0",children:e(Ce,{className:"h-4 w-4"})})]})},r)}if(i.type.startsWith("tool-")){let a=i,d=i.type.replace("tool-","");if(d==="task")switch(a.state){case"input-available":return e("div",{className:"text-sm opacity-70",children:"Loading task..."},r);case"output-available":return e("div",{className:"mb-2",children:e(J,{data:{id:a.output?.id||a.input?.id,fetchLatest:!1,taskData:a.output||a.input}})},r);case"output-error":return s("div",{className:"text-sm text-red-500",children:["Error: ",a.errorText]},r);default:return null}if(i.type==="tool-requestEndpointLogin")return e("div",{className:"mb-2",children:e(E,{toolPart:a,index:r,addToolResult:k??(()=>{})})},r);if(i.type==="tool-authenticate")return e("div",{className:"mb-2",children:e(E,{toolPart:a,index:r,addToolResult:k??(()=>{})})},r);if(i.type==="tool-requestApproval")return e("div",{className:"mb-2",children:e(G,{toolPart:a,index:r,addToolResult:k??(()=>{})})},r);if(d==="artefact")switch(a.state){case"input-available":return e("div",{className:"text-sm opacity-70",children:"Loading artefact..."},r);case"output-available":return e("div",{className:"mb-2",children:e(V,{artefact:a.output?.description||"",taskId:a.output?.id||a.input?.id,taskData:a.output||a.input})},r);case"output-error":return s("div",{className:"text-sm text-red-500",children:["Error: ",a.errorText]},r);default:return null}return e("div",{className:"mb-2",children:s(f,{className:"w-full max-w-md",children:[e(N,{children:e(y,{className:"text-lg",children:d})}),s(v,{children:[a.state==="input-available"&&s("p",{className:"text-sm",children:["Processing ",d,"..."]}),a.state==="output-available"&&e("pre",{className:"text-sm",children:JSON.stringify(a.output,null,2)}),a.state==="output-error"&&s("p",{className:"text-sm text-red-500",children:["Error: ",a.errorText]})]})]})},r)}if(i.type.startsWith("data-")){let a=i,d=i.type.replace("data-","");return d==="reference"?e("div",{className:"mb-2",children:e(f,{className:"w-full",children:e(v,{className:"p-4",children:e("div",{className:"space-y-2",children:a.data?.references?.map((n,A)=>s("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[e(W,{variant:"outline",children:n.type||"link"}),s("div",{className:"flex-1 min-w-0",children:[e("p",{className:"text-sm font-medium truncate",children:n.title}),n.description&&e("p",{className:"text-xs text-muted-foreground truncate",children:n.description})]}),n.url&&e(m,{variant:"ghost",size:"sm",onClick:()=>window.open(n.url,"_blank"),className:"h-8 w-8 p-0",children:e(we,{className:"h-4 w-4"})})]},A))})})})},r):d==="menu"?e("div",{className:"mb-2",children:s(f,{className:"w-full",children:[e(N,{children:e(y,{className:"text-lg",children:a.data?.title})}),e(v,{children:e("div",{className:"space-y-2",children:a.data?.items?.map((n,A)=>e(m,{variant:"outline",className:"w-full justify-start",onClick:n.action,children:s("div",{className:"text-left",children:[e("p",{className:"font-medium",children:n.label}),n.description&&e("p",{className:"text-xs text-muted-foreground",children:n.description})]})},A))})})]})},r):e("div",{className:"mb-2",children:s(f,{className:"w-full max-w-md",children:[e(N,{children:e(y,{className:"text-lg",children:d})}),e(v,{children:e("pre",{className:"text-sm",children:JSON.stringify(a.data,null,2)})})]})},r)}if(i.type==="reasoning")return s(Q,{className:"w-full",isStreaming:status==="streaming"&&r===t.parts.length-1&&t.id===b.at(-1)?.id,children:[e(X,{}),e(j,{children:i.text})]},`${t.id}-${r}`)})})]})};return s("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${re||""}`,children:[s(K,{ref:le,className:"flex-1 p-4 bg-background border-0",onDragOver:me,onDragLeave:de,onDrop:ce,children:[s("div",{className:p("space-y-4",ee&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[e(u.animate,{children:b.map(t=>e(u.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:p("flex gap-3",t.role==="user"?"flex-row-reverse":"flex-row"),children:pe(t)},t.id))}),c&&s(u.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[e(h,{className:"h-8 w-8",children:e(x,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:e(B,{className:"h-4 w-4"})})}),e("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:e(q,{capabilities:R,isOpen:c,onToggle:()=>g(!c),onActionSelect:D,className:"w-full"})})]}),C&&s(u.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[e(h,{className:"h-8 w-8",children:e(x,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:e(B,{className:"h-4 w-4"})})}),e("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:s("div",{className:"flex space-x-1",children:[e("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),e("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),e("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),e("div",{ref:I})]}),w.length>0&&e("div",{className:"p-4 border-t bg-muted/10",children:e("div",{className:"flex flex-wrap gap-2",children:w.map(t=>s("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[$(t.file.type),e("span",{className:"text-sm font-medium",children:t.file.name}),e("span",{className:"text-xs text-muted-foreground",children:ue(t.file.size)}),e(m,{variant:"ghost",size:"sm",onClick:()=>ie(t.id),className:"h-6 w-6 p-0",children:e(ye,{className:"h-4 w-4"})})]},t.id))})}),s("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[s("div",{className:"flex gap-3",children:[e(U,{value:F,onChange:t=>te(t.target.value),onKeyPress:se,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:C}),S&&e(m,{variant:"outline",size:"icon",onClick:()=>z.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:e(Ne,{className:"h-4 w-4"})}),e(m,{onClick:ae,disabled:!F.trim()&&w.length===0||C,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:e(fe,{className:"h-4 w-4"})})]}),s("div",{className:"flex items-center gap-3 mt-3",children:[s(m,{onClick:()=>g(!c),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[e(ge,{className:"h-3 w-3 mr-1"}),c?"Hide":"Show"," Capabilities"]}),s("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[O().map((t,l)=>e(m,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>D(t.id,H),children:t.label},`context-${t.id}`)),O().length===0&&oe().map((t,l)=>e(m,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:t.action,children:t.label},`suggestion-${l}`))]})]}),S&&e("input",{ref:z,type:"file",multiple:!0,onChange:ne,className:"hidden"})]})]})}export{Je as a};
@@ -1,20 +1,21 @@
1
1
  "use client";
2
2
  "use strict";
3
3
  "use client"
4
+ 'use client';
4
5
 
5
- "use strict";var Tt=Object.create;var Te=Object.defineProperty;var St=Object.getOwnPropertyDescriptor;var Mt=Object.getOwnPropertyNames;var Lt=Object.getPrototypeOf,It=Object.prototype.hasOwnProperty;var Dt=(e,t)=>{for(var r in t)Te(e,r,{get:t[r],enumerable:!0})},qe=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Mt(t))!It.call(e,l)&&l!==r&&Te(e,l,{get:()=>t[l],enumerable:!(o=St(t,l))||o.enumerable});return e};var O=(e,t,r)=>(r=e!=null?Tt(Lt(e)):{},qe(t||!e||!e.__esModule?Te(r,"default",{value:e,enumerable:!0}):r,e)),Et=e=>qe(Te({},"__esModule",{value:!0}),e);var Cr={};Dt(Cr,{ChatInterface:()=>wr});module.exports=Et(Cr);var W=require("react"),de=O(require("motion/react-client")),k=require("lucide-react");var Se=O(require("react")),K=O(require("@radix-ui/react-avatar"));var tt=require("clsx");var ze="-",zt=e=>{let t=Ht(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{let i=s.split(ze);return i[0]===""&&i.length!==1&&i.shift(),Je(i,t)||Bt(s)},getConflictingClassGroupIds:(s,i)=>{let d=r[s]||[];return i&&o[s]?[...d,...o[s]]:d}}},Je=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],o=t.nextPart.get(r),l=o?Je(e.slice(1),o):void 0;if(l)return l;if(t.validators.length===0)return;let n=e.join(ze);return t.validators.find(({validator:s})=>s(n))?.classGroupId},Ke=/^\[(.+)\]$/,Bt=e=>{if(Ke.test(e)){let t=Ke.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Ht=e=>{let{theme:t,prefix:r}=e,o={nextPart:new Map,validators:[]};return Vt(Object.entries(e.classGroups),r).forEach(([n,s])=>{Ee(s,o,n,t)}),o},Ee=(e,t,r,o)=>{e.forEach(l=>{if(typeof l=="string"){let n=l===""?t:_e(t,l);n.classGroupId=r;return}if(typeof l=="function"){if(Ft(l)){Ee(l(o),t,r,o);return}t.validators.push({validator:l,classGroupId:r});return}Object.entries(l).forEach(([n,s])=>{Ee(s,_e(t,n),r,o)})})},_e=(e,t)=>{let r=e;return t.split(ze).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},Ft=e=>e.isThemeGetter,Vt=(e,t)=>t?e.map(([r,o])=>{let l=o.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([s,i])=>[t+s,i])):n);return[r,l]}):e,Ot=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map,l=(n,s)=>{r.set(n,s),t++,t>e&&(t=0,o=r,r=new Map)};return{get(n){let s=r.get(n);if(s!==void 0)return s;if((s=o.get(n))!==void 0)return l(n,s),s},set(n,s){r.has(n)?r.set(n,s):l(n,s)}}},Qe="!",Gt=e=>{let{separator:t,experimentalParseClassName:r}=e,o=t.length===1,l=t[0],n=t.length,s=i=>{let d=[],f=0,h=0,g;for(let w=0;w<i.length;w++){let T=i[w];if(f===0){if(T===l&&(o||i.slice(w,w+n)===t)){d.push(i.slice(h,w)),h=w+n;continue}if(T==="/"){g=w;continue}}T==="["?f++:T==="]"&&f--}let v=d.length===0?i:i.substring(h),R=v.startsWith(Qe),S=R?v.substring(1):v,A=g&&g>h?g-h:void 0;return{modifiers:d,hasImportantModifier:R,baseClassName:S,maybePostfixModifierPosition:A}};return r?i=>r({className:i,parseClassName:s}):s},$t=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(o=>{o[0]==="["?(t.push(...r.sort(),o),r=[]):r.push(o)}),t.push(...r.sort()),t},jt=e=>({cache:Ot(e.cacheSize),parseClassName:Gt(e),...zt(e)}),Ut=/\s+/,Wt=(e,t)=>{let{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:l}=t,n=[],s=e.trim().split(Ut),i="";for(let d=s.length-1;d>=0;d-=1){let f=s[d],{modifiers:h,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:R}=r(f),S=!!R,A=o(S?v.substring(0,R):v);if(!A){if(!S){i=f+(i.length>0?" "+i:i);continue}if(A=o(v),!A){i=f+(i.length>0?" "+i:i);continue}S=!1}let w=$t(h).join(":"),T=g?w+Qe:w,E=T+A;if(n.includes(E))continue;n.push(E);let y=l(A,S);for(let M=0;M<y.length;++M){let ae=y[M];n.push(T+ae)}i=f+(i.length>0?" "+i:i)}return i};function qt(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Xe(t))&&(o&&(o+=" "),o+=r);return o}var Xe=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=Xe(e[o]))&&(r&&(r+=" "),r+=t);return r};function Kt(e,...t){let r,o,l,n=s;function s(d){let f=t.reduce((h,g)=>g(h),e());return r=jt(f),o=r.cache.get,l=r.cache.set,n=i,i(d)}function i(d){let f=o(d);if(f)return f;let h=Wt(d,r);return l(d,h),h}return function(){return n(qt.apply(null,arguments))}}var N=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},Ze=/^\[(?:([Me-Me-]+):)?(.+)\]$/i,_t=/^\d+\/\d+$/,Jt=new Set(["px","full","screen"]),Qt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Zt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Yt=/^(inset_)?-?((\d+)?\.?(\d+)[Me-Me]+|0)_-?((\d+)?\.?(\d+)[Me-Me]+|0)/,er=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,q=e=>ue(e)||Jt.has(e)||_t.test(e),ee=e=>me(e,"length",lr),ue=e=>!!e&&!Number.isNaN(Number(e)),De=e=>me(e,"number",ue),ve=e=>!!e&&Number.isInteger(Number(e)),tr=e=>e.endsWith("%")&&ue(e.slice(0,-1)),m=e=>Ze.test(e),te=e=>Qt.test(e),rr=new Set(["length","size","percentage"]),ar=e=>me(e,rr,Ye),or=e=>me(e,"position",Ye),nr=new Set(["image","url"]),ir=e=>me(e,nr,dr),sr=e=>me(e,"",cr),he=()=>!0,me=(e,t,r)=>{let o=Ze.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):r(o[2]):!1},lr=e=>Xt.test(e)&&!Zt.test(e),Ye=()=>!1,cr=e=>Yt.test(e),dr=e=>er.test(e);var pr=()=>{let e=N("colors"),t=N("spacing"),r=N("blur"),o=N("brightness"),l=N("borderColor"),n=N("borderRadius"),s=N("borderSpacing"),i=N("borderWidth"),d=N("contrast"),f=N("grayscale"),h=N("hueRotate"),g=N("invert"),v=N("gap"),R=N("gradientColorStops"),S=N("gradientColorStopPositions"),A=N("inset"),w=N("margin"),T=N("opacity"),E=N("padding"),y=N("saturate"),M=N("scale"),ae=N("sepia"),Le=N("skew"),fe=N("space"),Ne=N("translate"),oe=()=>["auto","contain","none"],ke=()=>["auto","hidden","clip","visible","scroll"],be=()=>["auto",m,t],C=()=>[m,t],Ae=()=>["",q,ee],pe=()=>["auto",ue,m],Re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ne=()=>["solid","dashed","dotted","double","none"],Pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],c=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",m],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>[ue,m];return{cacheSize:500,separator:":",theme:{colors:[he],spacing:[q,ee],blur:["none","",te,m],brightness:x(),borderColor:[e],borderRadius:["none","","full",te,m],borderSpacing:C(),borderWidth:Ae(),contrast:x(),grayscale:P(),hueRotate:x(),invert:P(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[tr,ee],inset:be(),margin:be(),opacity:x(),padding:C(),saturate:x(),scale:x(),sepia:P(),skew:x(),space:C(),translate:C()},classGroups:{aspect:[{aspect:["auto","square","video",m]}],container:["container"],columns:[{columns:[te]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"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:[...Re(),m]}],overflow:[{overflow:ke()}],"overflow-x":[{"overflow-x":ke()}],"overflow-y":[{"overflow-y":ke()}],overscroll:[{overscroll:oe()}],"overscroll-x":[{"overscroll-x":oe()}],"overscroll-y":[{"overscroll-y":oe()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[A]}],"inset-x":[{"inset-x":[A]}],"inset-y":[{"inset-y":[A]}],start:[{start:[A]}],end:[{end:[A]}],top:[{top:[A]}],right:[{right:[A]}],bottom:[{bottom:[A]}],left:[{left:[A]}],visibility:["visible","invisible","collapse"],Me:[{Me:["auto",ve,m]}],basis:[{basis:be()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",m]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",ve,m]}],"grid-cols":[{"grid-cols":[he]}],"col-start-end":[{col:["auto",{span:["full",ve,m]},m]}],"col-start":[{"col-start":pe()}],"col-end":[{"col-end":pe()}],"grid-rows":[{"grid-rows":[he]}],"row-start-end":[{row:["auto",{span:[ve,m]},m]}],"row-start":[{"row-start":pe()}],"row-end":[{"row-end":pe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",m]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",m]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...c()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...c(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...c(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],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-x":[{"space-x":[fe]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[fe]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",m,t]}],"min-w":[{"min-w":[m,t,"min","max","fit"]}],"max-w":[{"max-w":[m,t,"none","full","min","max","fit","prose",{screen:[te]},te]}],h:[{h:[m,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[m,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[m,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[m,t,"auto","min","max","fit"]}],"font-size":[{text:["base",te,ee]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",De]}],"font-family":[{font:[he]}],"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",m]}],"line-clamp":[{"line-clamp":["none",ue,De]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",q,m]}],"list-image":[{"list-image":["none",m]}],"list-style-type":[{list:["none","disc","decimal",m]}],"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:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",q,ee]}],"underline-offset":[{"underline-offset":["auto",q,m]}],"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:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",m]}],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",m]}],"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:[...Re(),or]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ar]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ir]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[R]}],"gradient-via":[{via:[R]}],"gradient-to":[{to:[R]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-Me":[{"rounded-Me":[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:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[T]}],"border-style":[{border:[...ne(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[T]}],"divide-style":[{divide:ne()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[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-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...ne()]}],"outline-offset":[{"outline-offset":[q,m]}],"outline-w":[{outline:[q,ee]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[T]}],"ring-offset-w":[{"ring-offset":[q,ee]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",te,sr]}],"shadow-color":[{shadow:[he]}],opacity:[{opacity:[T]}],"mix-blend":[{"mix-blend":[...Pe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Pe()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[o]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",te,m]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[g]}],saturate:[{saturate:[y]}],sepia:[{sepia:[ae]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[T]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",m]}],duration:[{duration:x()}],ease:[{ease:["linear","in","out","in-out",m]}],delay:[{delay:x()}],animate:[{animate:["none","spin","ping","pulse","bounce",m]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[ve,m]}],"translate-x":[{"translate-x":[Ne]}],"translate-y":[{"translate-y":[Ne]}],"skew-x":[{"skew-x":[Le]}],"skew-y":[{"skew-y":[Le]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",m]}],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","Me-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",m]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","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",m]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[q,ee,De]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","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-b","rounded-l","rounded-ss","rounded-Me","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Me","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"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-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-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var et=Kt(pr);function p(...e){return et((0,tt.clsx)(e))}var Me=require("react/jsx-runtime"),ye=Se.forwardRef(({className:e,...t},r)=>(0,Me.jsx)(K.Root,{ref:r,className:p("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));ye.displayName=K.Root.displayName;var ur=Se.forwardRef(({className:e,...t},r)=>(0,Me.jsx)(K.Image,{ref:r,className:p("aspect-square h-full w-full",e),...t}));ur.displayName=K.Image.displayName;var xe=Se.forwardRef(({className:e,...t},r)=>(0,Me.jsx)(K.Fallback,{ref:r,className:p("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));xe.displayName=K.Fallback.displayName;var rt=require("@radix-ui/react-slot"),at=require("class-variance-authority"),ot=O(require("react")),mr=(0,at.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"}}}),H=ot.forwardRef(({asChild:e=!1,className:t,size:r,variant:o,...l},n)=>(0,Me.jsx)(e?rt.Slot:"button",{className:p(mr({className:t,size:r,variant:o})),ref:n,...l}));H.displayName="Button";var ie=O(require("react"));var $=ie.forwardRef(({className:e,...t},r)=>(0,Me.jsx)("div",{ref:r,className:p("rounded-xl border bg-card text-card-foreground shadow",e),...t}));$.displayName="Card";var _=ie.forwardRef(({className:e,...t},r)=>(0,Me.jsx)("div",{ref:r,className:p("flex flex-col space-y-1.5 p-6",e),...t}));_.displayName="CardHeader";var J=ie.forwardRef(({className:e,...t},r)=>(0,Me.jsx)("div",{ref:r,className:p("font-semibold leading-none tracking-tight",e),...t}));J.displayName="CardTitle";var Be=ie.forwardRef(({className:e,...t},r)=>(0,Me.jsx)("div",{ref:r,className:p("text-sm text-muted-foreground",e),...t}));Be.displayName="CardDescription";var j=ie.forwardRef(({className:e,...t},r)=>(0,Me.jsx)("div",{ref:r,className:p("p-6 pt-0",e),...t}));j.displayName="CardContent";var we=ie.forwardRef(({className:e,...t},r)=>(0,Me.jsx)("div",{ref:r,className:p("flex items-center p-6 pt-0",e),...t}));we.displayName="CardFooter";var it=O(require("react"));var He=it.forwardRef(({className:e,type:t,...r},o)=>(0,Me.jsx)("input",{type:t,className:p("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,...r}));He.displayName="Input";var Fe=O(require("react")),F=O(require("@radix-ui/react-scroll-area"));var Ve=Fe.forwardRef(({className:e,children:t,...r},o)=>(0,Me.jsxs)(F.Root,{ref:o,className:p("relative overflow-hidden",e),...r,children:[(0,Me.jsx)(F.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Me.jsx)(lt,{}),(0,Me.jsx)(F.Corner,{})]}));Ve.displayName=F.Root.displayName;var lt=Fe.forwardRef(({className:e,orientation:t="vertical",...r},o)=>(0,Me.jsx)(F.ScrollAreaScrollbar,{ref:o,orientation:t,className:p("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),...r,children:(0,Me.jsx)(F.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));lt.displayName=F.ScrollAreaScrollbar.displayName;var gr=(0,at.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,...r}){return(0,Me.jsx)("div",{className:p(gr({variant:t}),e),...r})}var U=require("motion/react");var pt={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 Oe(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function ut({capabilities:e,isOpen:t,onToggle:r,onActionSelect:o,onContextChange:l,colorScheme:n=pt,className:s}){let[i,d]=(0,W.useState)([]),[f,h]=(0,W.useState)([]),g=i[i.length-1],v=g?.children||e,R=(y,M)=>{switch(y.type){case"category":return n.categories[M%n.categories.length];case"list":return n.lists[M%n.lists.length];case"item":return n.items[M%n.items.length];default:return n.primary}},S=(0,W.useMemo)(()=>({path:i,selectedItems:f,filters:{}}),[i,f]);(0,W.useEffect)(()=>{l&&l(S)},[S,l]);let A=y=>{y.type==="category"||y.type==="list"?d([...i,y]):y.type==="item"&&h([...f,y])},w=()=>{d(i.slice(0,-1))},T=y=>{d(i.slice(0,y+1))},E=()=>g?.actions?g.actions:[];return t?(0,Me.jsxs)("div",{className:p("w-full",s),children:[(0,Me.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Me.jsxs)("div",{className:"flex items-center gap-2",children:[i.length>0&&(0,Me.jsx)(U.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:p("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,Me.jsx)(k.ChevronLeft,{className:p("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,Me.jsx)("h4",{className:"font-medium text-sm",children:g?.name||"Capabilities"})]}),(0,Me.jsx)(U.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:r,className:p("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,Me.jsx)(k.Me,{className:p("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),i.length>0&&(0,Me.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,Me.jsx)(U.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>d([]),className:p("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Me.jsxs)("span",{className:"relative",children:["Capabilities",(0,Me.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),i.map((y,M)=>(0,Me.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Me.jsx)(k.ChevronRight,{className:"h-2 w-2"}),(0,Me.jsx)(U.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>T(M),className:p("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Me.jsxs)("span",{className:"relative",children:[y.name,(0,Me.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},y.id))]}),(0,Me.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,Me.jsx)(U.AnimatePresence,{mode:"wait",children:(0,Me.jsx)(U.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:g?.type==="list"&&g.data?(0,Me.jsx)(vr,{data:g.data,onItemSelect:y=>h([...f,y]),colorScheme:n}):(0,Me.jsx)(fr,{capabilities:v,onSelect:A,colorScheme:n})},g?.id||"root")})})]}):(0,Me.jsxs)(H,{onClick:r,size:"sm",variant:"outline",className:"rounded-full",children:[(0,Me.jsx)(k.Menu,{className:"h-4 w-4"}),(0,Me.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function fr({capabilities:e,onSelect:t,colorScheme:r}){return(0,Me.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,l)=>(0,Me.jsx)(br,{capability:o,onClick:()=>t(o),color:r.categories[l%r.categories.length]},o.id))})}function br({capability:e,onClick:t,selected:r,color:o}){return(0,Me.jsxs)(U.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:p("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",r&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,Me.jsx)("div",{className:p("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,Me.jsxs)("span",{className:"truncate relative",children:[e.name,(0,Me.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,Me.jsx)(k.ChevronRight,{className:p("h-3 w-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,Me.jsx)(le,{variant:"secondary",className:p("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function vr({data:e,onItemSelect:t,colorScheme:r}){return(0,Me.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,l)=>(0,Me.jsxs)(U.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:p("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-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,Me.jsx)("div",{className:p("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",r.items[l%r.items.length])}),(0,Me.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Me.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,Me.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,Me.jsx)("div",{className:p("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,Me.jsx)(le,{variant:"secondary",className:p("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:o.value})]},o.id))})}var ft=require("date-fns");function mt({taskId:e,polling:t=!0,system:r="payload"}){let[o,l]=(0,W.useState)(null),[n,s]=(0,W.useState)(!1),[i,d]=(0,W.useState)(null),f=async(g=!0)=>{if(e){g&&s(!0);try{let v=await fetch(`/api/tasks/${e}`);if(!v.ok)throw new Error(`Failed to fetch task: ${v.statusText}`);let R=await v.json();l(R)}catch(v){console.error("Error fetching task:",v),d(v instanceof Error?v:new Error("Unknown error occurred"))}finally{g&&s(!1)}}},h=()=>f(!1);return(0,W.useEffect)(()=>{e&&f(!0);let g=null;return e&&t&&(g=setInterval(h,5e3)),()=>{g&&clearInterval(g)}},[e,t]),{task:o,loading:n,error:i}}var hr=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"}},yr=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function bt({data:e}){let{id:t,system:r,fetchLatest:o,taskData:l,error:n}=e||{};if(!t)return null;let s=null,i=!0,d=n,f=o!==void 0?o:!0;if(s=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:r,fetchLatest:f,taskData:s,error:d}),f){let{task:R,loading:S,error:A}=mt({taskId:t,system:r});s=R,i=S,d=A}else i=!1;let h=hr(s?.status||"todo"),g=yr(s?.status||"todo"),v=s?.dateLogged||new Date().toISOString();try{let R=new Date(s?.dateLogged||"");isNaN(R.getTime())||(v=(0,ft.formatDistanceToNow)(R,{addSuffix:!0}))}catch{}return(0,Me.jsxs)($,{className:p("w-full max-w-md shadow-md",d&&"border border-destructive"),children:[(0,Me.jsxs)(_,{className:"pb-2",children:[(0,Me.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Me.jsx)(J,{className:"text-lg font-semibold",children:i?"Loading...":s?.name||"Task"}),(0,Me.jsx)(le,{className:`${h}`,children:g})]}),s?.project&&(0,Me.jsxs)(Be,{className:"text-sm text-gray-500",children:["Project: ",s.project.name]})]}),(0,Me.jsx)(j,{className:"pb-2",children:i?(0,Me.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):d?(0,Me.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Me.jsx)("p",{className:"text-sm text-foreground",children:s?.description||"......."})}),(0,Me.jsx)(we,{className:"pt-2 flex items-center justify-between",children:(0,Me.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Me.jsx)(k.Clock,{className:"h-3 w-3 mr-1"}),(0,Me.jsxs)("span",{children:["Created ",v]}),(0,Me.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Me.jsxs)("span",{children:["Task #",t]})]})})]})}function yt({artefact:e,taskId:t,taskData:r,loading:o=!1,error:l=null}){let n=r||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},s=n.dateLogged;try{let i=new Date(n.dateLogged);isNaN(i.getTime())||(s=(0,ft.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,Me.jsxs)($,{className:"w-full max-w-md shadow-md",children:[(0,Me.jsx)(_,{className:"pb-2",children:(0,Me.jsx)("div",{className:"flex justify-between items-start",children:(0,Me.jsx)(J,{className:"text-lg font-semibold",children:o?"Loading...":n.name})})}),(0,Me.jsx)(j,{className:"pb-2",children:o?(0,Me.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):l?(0,Me.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Me.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,Me.jsx)(we,{className:"pt-2 flex items-center justify-between",children:(0,Me.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Me.jsx)(k.Clock,{className:"h-3 w-3 mr-1"}),(0,Me.jsxs)("span",{children:["Created ",s]}),(0,Me.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Me.jsxs)("span",{children:["Task #",n.id]})]})})]})}var wt=O(require("react"));var xt=({isOpen:e=!0,authUrl:t,onClose:r,onSuccess:o,description:l="This endpoint requires authentication to sync functions."})=>{let[n,s]=(0,W.useState)(!1),[i,d]=(0,W.useState)(""),f=()=>{if(!t){d("No authentication URL provided");return}s(!0),d("");try{let g=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!g){d("Popup blocked. Please allow popups for this site and try again."),s(!1);return}let v=setInterval(()=>{try{g.closed&&(clearInterval(v),s(!1),o(),r())}catch{}},1e3);setTimeout(()=>{g.closed||(g.close(),clearInterval(v),s(!1),d("Authentication timed out. Please try again."))},6e5)}catch{d("Failed to open authentication window"),s(!1)}},h=async()=>{try{await navigator.clipboard.writeText(t),d("")}catch{d("Failed to copy URL to clipboard")}};return e?(0,Me.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center Me-[1000]",children:(0,Me.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,Me.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,Me.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:l}),i&&(0,Me.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:i}),(0,Me.jsxs)("div",{className:"flex gap-2",children:[(0,Me.jsx)("button",{onClick:f,disabled:n||!t,className:`
6
+ "use strict";var Ut=Object.create;var Le=Object.defineProperty;var Wt=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var qt=Object.getPrototypeOf,Kt=Object.prototype.hasOwnProperty;var Jt=(e,t)=>{for(var o in t)Le(e,o,{get:t[o],enumerable:!0})},tt=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of _t(t))!Kt.call(e,s)&&s!==o&&Le(e,s,{get:()=>t[s],enumerable:!(a=Wt(t,s))||a.enumerable});return e};var V=(e,t,o)=>(o=e!=null?Ut(qt(e)):{},tt(t||!e||!e.__esModule?Le(o,"default",{value:e,enumerable:!0}):o,e)),Qt=e=>tt(Le({},"__esModule",{value:!0}),e);var jo={};Jt(jo,{ChatInterface:()=>$o});module.exports=Qt(jo);var q=require("react"),ue=V(require("motion/react-client")),A=require("lucide-react");var Ie=V(require("react")),J=V(require("@radix-ui/react-avatar"));var dt=require("clsx");var Oe="-",Xt=e=>{let t=Zt(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{let i=l.split(Oe);return i[0]===""&&i.length!==1&&i.shift(),at(i,t)||Yt(l)},getConflictingClassGroupIds:(l,i)=>{let p=o[l]||[];return i&&a[l]?[...p,...a[l]]:p}}},at=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),s=a?at(e.slice(1),a):void 0;if(s)return s;if(t.validators.length===0)return;let n=e.join(Oe);return t.validators.find(({validator:l})=>l(n))?.classGroupId},ot=/^\[(.+)\]$/,Yt=e=>{if(ot.test(e)){let t=ot.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Zt=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return to(Object.entries(e.classGroups),o).forEach(([n,l])=>{Fe(l,a,n,t)}),a},Fe=(e,t,o,a)=>{e.forEach(s=>{if(typeof s=="string"){let n=s===""?t:rt(t,s);n.classGroupId=o;return}if(typeof s=="function"){if(eo(s)){Fe(s(a),t,o,a);return}t.validators.push({validator:s,classGroupId:o});return}Object.entries(s).forEach(([n,l])=>{Fe(l,rt(t,n),o,a)})})},rt=(e,t)=>{let o=e;return t.split(Oe).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},eo=e=>e.isThemeGetter,to=(e,t)=>t?e.map(([o,a])=>{let s=a.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([l,i])=>[t+l,i])):n);return[o,s]}):e,oo=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,s=(n,l)=>{o.set(n,l),t++,t>e&&(t=0,a=o,o=new Map)};return{get(n){let l=o.get(n);if(l!==void 0)return l;if((l=a.get(n))!==void 0)return s(n,l),l},set(n,l){o.has(n)?o.set(n,l):s(n,l)}}},nt="!",ro=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,s=t[0],n=t.length,l=i=>{let p=[],f=0,h=0,m;for(let x=0;x<i.length;x++){let P=i[x];if(f===0){if(P===s&&(a||i.slice(x,x+n)===t)){p.push(i.slice(h,x)),h=x+n;continue}if(P==="/"){m=x;continue}}P==="["?f++:P==="]"&&f--}let b=p.length===0?i:i.substring(h),T=b.startsWith(nt),R=T?b.substring(1):b,w=m&&m>h?m-h:void 0;return{modifiers:p,hasImportantModifier:T,baseClassName:R,maybePostfixModifierPosition:w}};return o?i=>o({className:i,parseClassName:l}):l},ao=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},no=e=>({cache:oo(e.cacheSize),parseClassName:ro(e),...Xt(e)}),io=/\s+/,so=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:s}=t,n=[],l=e.trim().split(io),i="";for(let p=l.length-1;p>=0;p-=1){let f=l[p],{modifiers:h,hasImportantModifier:m,baseClassName:b,maybePostfixModifierPosition:T}=o(f),R=!!T,w=a(R?b.substring(0,T):b);if(!w){if(!R){i=f+(i.length>0?" "+i:i);continue}if(w=a(b),!w){i=f+(i.length>0?" "+i:i);continue}R=!1}let x=ao(h).join(":"),P=m?x+nt:x,E=P+w;if(n.includes(E))continue;n.push(E);let C=s(w,R);for(let L=0;L<C.length;++L){let ne=C[L];n.push(P+ne)}i=f+(i.length>0?" "+i:i)}return i};function lo(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=it(t))&&(a&&(a+=" "),a+=o);return a}var it=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=it(e[a]))&&(o&&(o+=" "),o+=t);return o};function co(e,...t){let o,a,s,n=l;function l(p){let f=t.reduce((h,m)=>m(h),e());return o=no(f),a=o.cache.get,s=o.cache.set,n=i,i(p)}function i(p){let f=a(p);if(f)return f;let h=so(p,o);return s(p,h),h}return function(){return n(lo.apply(null,arguments))}}var k=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},st=/^\[(?:([a-De-]+):)?(.+)\]$/i,po=/^\d+\/\d+$/,uo=new Set(["px","full","screen"]),mo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,go=/\d+(%|px|De?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|De?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,fo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,bo=/^(inset_)?-?((\d+)?\.?(\d+)[a-De]+|0)_-?((\d+)?\.?(\d+)[a-De]+|0)/,vo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,K=e=>ge(e)||uo.has(e)||po.test(e),oe=e=>fe(e,"length",Ro),ge=e=>!!e&&!Number.isNaN(Number(e)),He=e=>fe(e,"number",ge),xe=e=>!!e&&Number.isInteger(Number(e)),ho=e=>e.endsWith("%")&&ge(e.slice(0,-1)),g=e=>st.test(e),re=e=>mo.test(e),yo=new Set(["length","size","percentage"]),xo=e=>fe(e,yo,lt),Co=e=>fe(e,"position",lt),wo=new Set(["image","url"]),No=e=>fe(e,wo,Ao),ko=e=>fe(e,"",Po),Ce=()=>!0,fe=(e,t,o)=>{let a=st.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Ro=e=>go.test(e)&&!fo.test(e),lt=()=>!1,Po=e=>bo.test(e),Ao=e=>vo.test(e);var To=()=>{let e=k("colors"),t=k("spacing"),o=k("blur"),a=k("brightness"),s=k("borderColor"),n=k("borderRadius"),l=k("borderSpacing"),i=k("borderWidth"),p=k("contrast"),f=k("grayscale"),h=k("hueRotate"),m=k("invert"),b=k("gap"),T=k("gradientColorStops"),R=k("gradientColorStopPositions"),w=k("inset"),x=k("margin"),P=k("opacity"),E=k("padding"),C=k("saturate"),L=k("scale"),ne=k("sepia"),ze=k("skew"),he=k("space"),Pe=k("translate"),ie=()=>["auto","contain","none"],Ae=()=>["auto","hidden","clip","visible","scroll"],ye=()=>["auto",g,t],N=()=>[g,t],Te=()=>["",K,oe],me=()=>["auto",ge,g],Se=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],se=()=>["solid","dashed","dotted","double","none"],Me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],c=()=>["start","end","center","between","around","evenly","stretch"],S=()=>["","0",g],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>[ge,g];return{cacheSize:500,separator:":",theme:{colors:[Ce],spacing:[K,oe],blur:["none","",re,g],brightness:y(),borderColor:[e],borderRadius:["none","","full",re,g],borderSpacing:N(),borderWidth:Te(),contrast:y(),grayscale:S(),hueRotate:y(),invert:S(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[ho,oe],inset:ye(),margin:ye(),opacity:y(),padding:N(),saturate:y(),scale:y(),sepia:S(),skew:y(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",g]}],container:["container"],columns:[{columns:[re]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"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:[...Se(),g]}],overflow:[{overflow:Ae()}],"overflow-x":[{"overflow-x":Ae()}],"overflow-y":[{"overflow-y":Ae()}],overscroll:[{overscroll:ie()}],"overscroll-x":[{"overscroll-x":ie()}],"overscroll-y":[{"overscroll-y":ie()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],De:[{De:["auto",xe,g]}],basis:[{basis:ye()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",g]}],grow:[{grow:S()}],shrink:[{shrink:S()}],order:[{order:["first","last","none",xe,g]}],"grid-cols":[{"grid-cols":[Ce]}],"col-start-end":[{col:["auto",{span:["full",xe,g]},g]}],"col-start":[{"col-start":me()}],"col-end":[{"col-end":me()}],"grid-rows":[{"grid-rows":[Ce]}],"row-start-end":[{row:["auto",{span:[xe,g]},g]}],"row-start":[{"row-start":me()}],"row-end":[{"row-end":me()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",g]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",g]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...c()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...c(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...c(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],q:[{q:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[he]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[he]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",g,t]}],"min-w":[{"min-w":[g,t,"min","max","fit"]}],"max-w":[{"max-w":[g,t,"none","full","min","max","fit","prose",{screen:[re]},re]}],h:[{h:[g,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[g,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[g,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[g,t,"auto","min","max","fit"]}],"font-size":[{text:["base",re,oe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",He]}],"font-family":[{font:[Ce]}],"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",g]}],"line-clamp":[{"line-clamp":["none",ge,He]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",K,g]}],"list-image":[{"list-image":["none",g]}],"list-style-type":[{list:["none","disc","decimal",g]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[P]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",K,oe]}],"underline-offset":[{"underline-offset":["auto",K,g]}],"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:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",g]}],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",g]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[P]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Se(),Co]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",xo]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","De","br","b","bl","l","tl"]},No]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[R]}],"gradient-via-pos":[{via:[R]}],"gradient-to-pos":[{to:[R]}],"gradient-from":[{from:[T]}],"gradient-via":[{via:[T]}],"gradient-to":[{to:[T]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-De":[{"rounded-De":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-De":[{"rounded-De":[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:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-De":[{"border-De":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[P]}],"border-style":[{border:[...se(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[P]}],"divide-style":[{divide:se()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-De":[{"border-De":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...se()]}],"outline-offset":[{"outline-offset":[K,g]}],"outline-w":[{outline:[K,oe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[P]}],"ring-offset-w":[{"ring-offset":[K,oe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",re,ko]}],"shadow-color":[{shadow:[Ce]}],opacity:[{opacity:[P]}],"mix-blend":[{"mix-blend":[...Me(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Me()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",re,g]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[m]}],saturate:[{saturate:[C]}],sepia:[{sepia:[ne]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[P]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",g]}],duration:[{duration:y()}],ease:[{ease:["linear","in","out","in-out",g]}],delay:[{delay:y()}],animate:[{animate:["none","spin","ping","pulse","bounce",g]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[L]}],"scale-x":[{"scale-x":[L]}],"scale-y":[{"scale-y":[L]}],rotate:[{rotate:[xe,g]}],"translate-x":[{"translate-x":[Pe]}],"translate-y":[{"translate-y":[Pe]}],"skew-x":[{"skew-x":[ze]}],"skew-y":[{"skew-y":[ze]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",g]}],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",g]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-q":[{"scroll-q":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","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",g]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[K,oe,He]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","q","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-De","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-De","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-De"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-De":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-De","border-w-b","border-w-l"],"border-w-x":["border-w-De","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-De","border-color-b","border-color-l"],"border-color-x":["border-color-De","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"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-q","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var ct=co(To);function d(...e){return ct((0,dt.clsx)(e))}var De=require("react/jsx-runtime"),we=Ie.forwardRef(({className:e,...t},o)=>(0,De.jsx)(J.Root,{ref:o,className:d("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));we.displayName=J.Root.displayName;var So=Ie.forwardRef(({className:e,...t},o)=>(0,De.jsx)(J.Image,{ref:o,className:d("aspect-square h-full w-full",e),...t}));So.displayName=J.Image.displayName;var Ne=Ie.forwardRef(({className:e,...t},o)=>(0,De.jsx)(J.Fallback,{ref:o,className:d("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Ne.displayName=J.Fallback.displayName;var pt=require("@radix-ui/react-slot"),ut=require("class-variance-authority"),mt=V(require("react")),Mo=(0,ut.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"}}}),O=mt.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...s},n)=>(0,De.jsx)(e?pt.Slot:"button",{className:d(Mo({className:t,size:o,variant:a})),ref:n,...s}));O.displayName="Button";var le=V(require("react"));var U=le.forwardRef(({className:e,...t},o)=>(0,De.jsx)("div",{ref:o,className:d("rounded-xl border bg-card text-card-foreground shadow",e),...t}));U.displayName="Card";var Q=le.forwardRef(({className:e,...t},o)=>(0,De.jsx)("div",{ref:o,className:d("flex flex-col space-y-1.5 p-6",e),...t}));Q.displayName="CardHeader";var X=le.forwardRef(({className:e,...t},o)=>(0,De.jsx)("div",{ref:o,className:d("font-semibold leading-none tracking-tight",e),...t}));X.displayName="CardTitle";var Ve=le.forwardRef(({className:e,...t},o)=>(0,De.jsx)("div",{ref:o,className:d("text-sm text-muted-foreground",e),...t}));Ve.displayName="CardDescription";var W=le.forwardRef(({className:e,...t},o)=>(0,De.jsx)("div",{ref:o,className:d("p-6 pt-0",e),...t}));W.displayName="CardContent";var ke=le.forwardRef(({className:e,...t},o)=>(0,De.jsx)("div",{ref:o,className:d("flex items-center p-6 pt-0",e),...t}));ke.displayName="CardFooter";var ft=V(require("react"));var Ge=ft.forwardRef(({className:e,type:t,...o},a)=>(0,De.jsx)("input",{type:t,className:d("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:a,...o}));Ge.displayName="Input";var $e=V(require("react")),G=V(require("@radix-ui/react-scroll-area"));var je=$e.forwardRef(({className:e,children:t,...o},a)=>(0,De.jsxs)(G.Root,{ref:a,className:d("relative overflow-hidden",e),...o,children:[(0,De.jsx)(G.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,De.jsx)(vt,{}),(0,De.jsx)(G.Corner,{})]}));je.displayName=G.Root.displayName;var vt=$e.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,De.jsx)(G.ScrollAreaScrollbar,{ref:a,orientation:t,className:d("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),...o,children:(0,De.jsx)(G.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));vt.displayName=G.ScrollAreaScrollbar.displayName;var Lo=(0,ut.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 de({className:e,variant:t,...o}){return(0,De.jsx)("div",{className:d(Lo({variant:t}),e),...o})}var _=require("motion/react");var xt={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 Ue(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function Ct({capabilities:e,isOpen:t,onToggle:o,onActionSelect:a,onContextChange:s,colorScheme:n=xt,className:l}){let[i,p]=(0,q.useState)([]),[f,h]=(0,q.useState)([]),m=i[i.length-1],b=m?.children||e,T=(C,L)=>{switch(C.type){case"category":return n.categories[L%n.categories.length];case"list":return n.lists[L%n.lists.length];case"item":return n.items[L%n.items.length];default:return n.primary}},R=(0,q.useMemo)(()=>({path:i,selectedItems:f,filters:{}}),[i,f]);(0,q.useEffect)(()=>{s&&s(R)},[R,s]);let w=C=>{C.type==="category"||C.type==="list"?p([...i,C]):C.type==="item"&&h([...f,C])},x=()=>{p(i.slice(0,-1))},P=C=>{p(i.slice(0,C+1))},E=()=>m?.actions?m.actions:[];return t?(0,De.jsxs)("div",{className:d("w-full",l),children:[(0,De.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,De.jsxs)("div",{className:"flex items-center gap-2",children:[i.length>0&&(0,De.jsx)(_.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:d("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,De.jsx)(A.ChevronLeft,{className:d("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,De.jsx)("h4",{className:"font-medium text-sm",children:m?.name||"Capabilities"})]}),(0,De.jsx)(_.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:o,className:d("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,De.jsx)(A.X,{className:d("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),i.length>0&&(0,De.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,De.jsx)(_.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>p([]),className:d("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,De.jsxs)("span",{className:"relative",children:["Capabilities",(0,De.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),i.map((C,L)=>(0,De.jsxs)("div",{className:"flex items-center gap-1",children:[(0,De.jsx)(A.ChevronRight,{className:"h-2 w-2"}),(0,De.jsx)(_.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>P(L),className:d("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,De.jsxs)("span",{className:"relative",children:[C.name,(0,De.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,De.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,De.jsx)(_.AnimatePresence,{mode:"wait",children:(0,De.jsx)(_.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:m?.type==="list"&&m.data?(0,De.jsx)(Eo,{data:m.data,onItemSelect:C=>h([...f,C]),colorScheme:n}):(0,De.jsx)(Io,{capabilities:b,onSelect:w,colorScheme:n})},m?.id||"root")})})]}):(0,De.jsxs)(O,{onClick:o,size:"sm",variant:"outline",className:"rounded-full",children:[(0,De.jsx)(A.Menu,{className:"h-4 w-4"}),(0,De.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function Io({capabilities:e,onSelect:t,colorScheme:o}){return(0,De.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,s)=>(0,De.jsx)(Do,{capability:a,onClick:()=>t(a),color:o.categories[s%o.categories.length]},a.id))})}function Do({capability:e,onClick:t,selected:o,color:a}){return(0,De.jsxs)(_.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:d("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",o&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,De.jsx)("div",{className:d("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a)}),(0,De.jsxs)("span",{className:"truncate relative",children:[e.name,(0,De.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,De.jsx)(A.ChevronRight,{className:d("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,De.jsx)(de,{variant:"secondary",className:d("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 Eo({data:e,onItemSelect:t,colorScheme:o}){return(0,De.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,s)=>(0,De.jsxs)(_.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:d("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(a),children:[(0,De.jsx)("div",{className:d("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o.items[s%o.items.length])}),(0,De.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,De.jsxs)("span",{className:"truncate relative font-medium",children:[a.title,(0,De.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"})]}),a.subtitle&&(0,De.jsx)("div",{className:d("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:a.subtitle})]}),a.value&&(0,De.jsx)(de,{variant:"secondary",className:d("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:a.value})]},a.id))})}var kt=require("date-fns");function wt({taskId:e,polling:t=!0,system:o="payload"}){let[a,s]=(0,q.useState)(null),[n,l]=(0,q.useState)(!1),[i,p]=(0,q.useState)(null),f=async(m=!0)=>{if(e){m&&l(!0);try{let b=await fetch(`/api/tasks/${e}`);if(!b.ok)throw new Error(`Failed to fetch task: ${b.statusText}`);let T=await b.json();s(T)}catch(b){console.error("Error fetching task:",b),p(b instanceof Error?b:new Error("Unknown error occurred"))}finally{m&&l(!1)}}},h=()=>f(!1);return(0,q.useEffect)(()=>{e&&f(!0);let m=null;return e&&t&&(m=setInterval(h,5e3)),()=>{m&&clearInterval(m)}},[e,t]),{task:a,loading:n,error:i}}var zo=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"}},Bo=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Rt({data:e}){let{id:t,system:o,fetchLatest:a,taskData:s,error:n}=e||{};if(!t)return null;let l=null,i=!0,p=n,f=a!==void 0?a:!0;if(l=s||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:a,system:o,fetchLatest:f,taskData:l,error:p}),f){let{task:T,loading:R,error:w}=wt({taskId:t,system:o});l=T,i=R,p=w}else i=!1;let h=zo(l?.status||"todo"),m=Bo(l?.status||"todo"),b=l?.dateLogged||new Date().toISOString();try{let T=new Date(l?.dateLogged||"");isNaN(T.getTime())||(b=(0,kt.formatDistanceToNow)(T,{addSuffix:!0}))}catch{}return(0,De.jsxs)(U,{className:d("w-full max-w-md shadow-md",p&&"border border-destructive"),children:[(0,De.jsxs)(Q,{className:"pb-2",children:[(0,De.jsxs)("div",{className:"flex justify-between items-start",children:[(0,De.jsx)(X,{className:"text-lg font-semibold",children:i?"Loading...":l?.name||"Task"}),(0,De.jsx)(de,{className:`${h}`,children:m})]}),l?.project&&(0,De.jsxs)(Ve,{className:"text-sm text-gray-500",children:["Project: ",l.project.name]})]}),(0,De.jsx)(W,{className:"pb-2",children:i?(0,De.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):p?(0,De.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,De.jsx)("p",{className:"text-sm text-foreground",children:l?.description||"......."})}),(0,De.jsx)(ke,{className:"pt-2 flex items-center justify-between",children:(0,De.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,De.jsx)(A.Clock,{className:"h-3 w-3 mr-1"}),(0,De.jsxs)("span",{children:["Created ",b]}),(0,De.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,De.jsxs)("span",{children:["Task #",t]})]})})]})}function Tt({artefact:e,taskId:t,taskData:o,loading:a=!1,error:s=null}){let n=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},l=n.dateLogged;try{let i=new Date(n.dateLogged);isNaN(i.getTime())||(l=(0,kt.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,De.jsxs)(U,{className:"w-full max-w-md shadow-md",children:[(0,De.jsx)(Q,{className:"pb-2",children:(0,De.jsx)("div",{className:"flex justify-between items-start",children:(0,De.jsx)(X,{className:"text-lg font-semibold",children:a?"Loading...":n.name})})}),(0,De.jsx)(W,{className:"pb-2",children:a?(0,De.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):s?(0,De.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,De.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,De.jsx)(ke,{className:"pt-2 flex items-center justify-between",children:(0,De.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,De.jsx)(A.Clock,{className:"h-3 w-3 mr-1"}),(0,De.jsxs)("span",{children:["Created ",l]}),(0,De.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,De.jsxs)("span",{children:["Task #",n.id]})]})})]})}var Mt=V(require("react"));var St=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:a,description:s="This endpoint requires authentication to sync functions."})=>{let[n,l]=(0,q.useState)(!1),[i,p]=(0,q.useState)(""),f=()=>{if(!t){p("No authentication URL provided");return}l(!0),p("");try{let m=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!m){p("Popup blocked. Please allow popups for this site and try again."),l(!1);return}let b=setInterval(()=>{try{m.closed&&(clearInterval(b),l(!1),a(),o())}catch{}},1e3);setTimeout(()=>{m.closed||(m.close(),clearInterval(b),l(!1),p("Authentication timed out. Please try again."))},6e5)}catch{p("Failed to open authentication window"),l(!1)}},h=async()=>{try{await navigator.clipboard.writeText(t),p("")}catch{p("Failed to copy URL to clipboard")}};return e?(0,De.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center De-[1000]",children:(0,De.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,De.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,De.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s}),i&&(0,De.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:i}),(0,De.jsxs)("div",{className:"flex gap-2",children:[(0,De.jsx)("button",{onClick:f,disabled:n||!t,className:`
6
7
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
7
8
  ${n||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
8
- `,children:n?"Authenticating...":"Authenticate"}),(0,Me.jsx)("button",{onClick:h,disabled:!t,className:`
9
+ `,children:n?"Authenticating...":"Authenticate"}),(0,De.jsx)("button",{onClick:h,disabled:!t,className:`
9
10
  px-4 py-2 text-white border-none rounded text-sm
10
11
  ${t?"bg-blue-600 hover:bg-blue-700 cursor-pointer":"bg-gray-400 cursor-not-allowed"}
11
- `,children:"Copy URL"}),(0,Me.jsx)("button",{onClick:r,className:"px-4 py-2 bg-gray-500 hover:bg-gray-600 text-white border-none rounded text-sm cursor-pointer",children:"Cancel"})]})]})}):null};var $e=({toolPart:e,index:t,addToolResult:r})=>{let[o,l]=wt.default.useState(!0),n=()=>{r(e.input?.toolCallId,e.input?.tool,"Authentication completed"),l(!1)};switch(e.state){case"input-available":return(0,Me.jsxs)("div",{className:"mb-2",children:[(0,Me.jsx)(xt,{isOpen:o,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>l(!1),onSuccess:n,description:e.output?.reason||e.input?.reason}),!o&&(0,Me.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Me.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Me.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Me.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,Me.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var Ct=require("marked"),Nt=O(require("react-markdown"));function xr(e){return Ct.marked.lexer(e).map(r=>r.raw)}var kt=(0,W.memo)(({content:e})=>(0,Me.jsx)(Nt.default,{children:e}),(e,t)=>e.content===t.content);kt.displayName="MemoizedMarkdownBlock";var je=(0,W.memo)(({content:e,id:t})=>(0,W.useMemo)(()=>xr(e),[e]).map((o,l)=>(0,Me.jsx)(kt,{content:o},`${t}-block_${l}`)));je.displayName="PartText";var We=O(require("react"));var Rt=({isOpen:e=!0,reason:t,onClose:r,onApprove:o,onDeny:l,title:n="Approval Required"})=>{let[s,i]=(0,W.useState)(!1),d=()=>{i(!0),o(),r()},f=()=>{i(!0),l(),r()},h=()=>{i(!0),l(),r()};return e?(0,Me.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full shadow-lg",children:[(0,Me.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:n}),(0,Me.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:t}),(0,Me.jsxs)("div",{className:"flex gap-2",children:[(0,Me.jsx)("button",{onClick:d,disabled:s,className:`
12
+ `,children:"Copy URL"}),(0,De.jsx)("button",{onClick:o,className:"px-4 py-2 bg-gray-500 hover:bg-gray-600 text-white border-none rounded text-sm cursor-pointer",children:"Cancel"})]})]})}):null};var _e=({toolPart:e,index:t,addToolResult:o})=>{let[a,s]=Mt.default.useState(!0),n=()=>{o(e.input?.toolCallId,e.input?.tool,"Authentication completed"),s(!1)};switch(e.state){case"input-available":return(0,De.jsxs)("div",{className:"mb-2",children:[(0,De.jsx)(St,{isOpen:a,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>s(!1),onSuccess:n,description:e.output?.reason||e.input?.reason}),!a&&(0,De.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,De.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,De.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,De.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,De.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var Lt=require("marked"),It=V(require("react-markdown"));function Ho(e){return Lt.marked.lexer(e).map(o=>o.raw)}var Dt=(0,q.memo)(({content:e})=>(0,De.jsx)(It.default,{children:e}),(e,t)=>e.content===t.content);Dt.displayName="MemoizedMarkdownBlock";var qe=(0,q.memo)(({content:e,id:t})=>(0,q.useMemo)(()=>Ho(e),[e]).map((a,s)=>(0,De.jsx)(Dt,{content:a},`${t}-block_${s}`)));qe.displayName="PartText";var Je=V(require("react"));var zt=({isOpen:e=!0,reason:t,onClose:o,onApprove:a,onDeny:s,title:n="Approval Required"})=>{let[l,i]=(0,q.useState)(!1),p=()=>{i(!0),a(),o()},f=()=>{i(!0),s(),o()},h=()=>{i(!0),s(),o()};return e?(0,De.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full shadow-lg",children:[(0,De.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:n}),(0,De.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:t}),(0,De.jsxs)("div",{className:"flex gap-2",children:[(0,De.jsx)("button",{onClick:p,disabled:l,className:`
12
13
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
13
- ${s?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
14
- `,children:s?"Processing...":"Approve"}),(0,Me.jsx)("button",{onClick:f,disabled:s,className:`
14
+ ${l?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
15
+ `,children:l?"Processing...":"Approve"}),(0,De.jsx)("button",{onClick:f,disabled:l,className:`
15
16
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
16
- ${s?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
17
- `,children:s?"Processing...":"Deny"}),(0,Me.jsx)("button",{onClick:h,disabled:s,className:`
17
+ ${l?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
18
+ `,children:l?"Processing...":"Deny"}),(0,De.jsx)("button",{onClick:h,disabled:l,className:`
18
19
  px-4 py-2 text-white border-none rounded text-sm
19
- ${s?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
20
- `,children:"Cancel"})]})]}):null};var Pt=({toolPart:e,index:t,addToolResult:r})=>{let[o,l]=We.default.useState(!0),[n,s]=We.default.useState(null),i=()=>{r(e.input?.toolCallId,e.input?.tool,"Approved"),l(!1),s("approve")},d=()=>{r(e.input?.toolCallId,e.input?.tool,"Denied"),l(!1),s("deny")};switch(e.state){case"input-available":return(0,Me.jsxs)("div",{className:"mb-2",children:[(0,Me.jsx)(Rt,{isOpen:o,onApprove:i,onDeny:d,onClose:()=>l(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!o&&(0,Me.jsxs)(Me.Fragment,{children:[n==="approve"&&(0,Me.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Me.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Me.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Me.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),n==="deny"&&(0,Me.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Me.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,Me.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Me.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Me.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};function wr({messages:e,input:t,isTyping:r=!1,currentSessionTitle:o,capabilities:l,fileUploads:n,isDragOver:s,enableFileUpload:i,onInputChange:d,addToolResult:f,onSendMessage:h,onKeyPress:g,onFileUpload:v,onRemoveFile:R,onDragOver:S,className:A}){let w=(0,W.useRef)(null),T=(0,W.useRef)(null),E=(0,W.useRef)(null),[y,M]=(0,W.useState)(!1),[ae,Le]=(0,W.useState)({path:[],selectedItems:[],filters:{}});(0,W.useEffect)(()=>{w.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,W.useEffect)(()=>{y&&setTimeout(()=>{w.current?.scrollIntoView({behavior:"smooth"})},100)},[y]);let fe=()=>Oe(ae),Ne=()=>{let c=[];return l.forEach(P=>{P.actions&&P.actions.forEach(I=>{c.push({label:I.label,action:()=>oe(I.id,{path:[P],selectedItems:[],filters:{}})})}),P.children&&P.children.forEach(I=>{I.type==="list"&&I.data&&c.push({label:`View ${I.name}`,action:()=>M(!0)})})}),c.slice(0,5)},oe=(c,P)=>{console.log("Capability action:",c,P);let I=`Executing ${c} with context: ${JSON.stringify(P.path.map(x=>x.name))}`;M(!1)},ke=Oe({path:[],selectedItems:[],filters:{}}),be=c=>{v(c.target.files),c.target.files&&(c.target.value="")},C=c=>{c.preventDefault(),S(!0)},Ae=c=>{c.preventDefault(),S(!1)},pe=c=>{c.preventDefault(),S(!1),v(c.dataTransfer.files)},Re=c=>{if(c===0)return"0 Bytes";let P=1024,I=["Bytes","KB","MB","GB"],x=Math.floor(Math.log(c)/Math.log(P));return parseFloat((c/Math.pow(P,x)).toFixed(2))+" "+I[x]},ne=c=>c.startsWith("image/")?(0,Me.jsx)(k.Image,{className:"h-4 w-4"}):c.startsWith("text/")?(0,Me.jsx)(k.FileText,{className:"h-4 w-4"}):(0,Me.jsx)(k.File,{className:"h-4 w-4"}),Pe=c=>{let P=c.role==="assistant",I=c.role==="user";return(0,Me.jsxs)("div",{className:p("flex my-2 items-start gap-3",I?"flex-row-reverse":""),children:[(0,Me.jsx)(ye,{className:"h-8 w-8 shrink-0",children:(0,Me.jsx)(xe,{className:p(I?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:I?(0,Me.jsx)(k.User,{className:"h-4 w-4"}):(0,Me.jsx)(k.Bot,{className:"h-4 w-4"})})}),(0,Me.jsx)("div",{className:p("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",I?"bg-primary text-primary-foreground":"bg-muted"),children:c.parts.map((x,D)=>{if(x.type==="text")return(0,Me.jsx)(je,{id:c.id,content:x.text},`${c.id}-text`);if(x.type==="file"){let b=x;return(0,Me.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,Me.jsxs)("div",{className:"flex items-center gap-2",children:[ne(b.mediaType||"application/octet-stream"),(0,Me.jsx)("div",{className:"flex-1 min-w-0",children:(0,Me.jsx)("p",{className:"text-sm font-medium truncate",children:b.filename||b.url?.split("/").pop()||"File"})}),b.url&&(0,Me.jsx)(H,{variant:"ghost",size:"sm",onClick:()=>window.open(b.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Me.jsx)(k.Download,{className:"h-4 w-4"})})]})},D)}if(x.type.startsWith("tool-")){let b=x,Y=x.type.replace("tool-","");if(Y==="task")switch(b.state){case"input-available":return(0,Me.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},D);case"output-available":return(0,Me.jsx)("div",{className:"mb-2",children:(0,Me.jsx)(bt,{data:{id:b.output?.id||b.input?.id,fetchLatest:!1,taskData:b.output||b.input}})},D);case"output-error":return(0,Me.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",b.errorText]},D);default:return null}if(x.type==="tool-requestEndpointLogin")return(0,Me.jsx)("div",{className:"mb-2",children:(0,Me.jsx)($e,{toolPart:b,index:D,addToolResult:f??(()=>{})})},D);if(x.type==="tool-authenticate")return(0,Me.jsx)("div",{className:"mb-2",children:(0,Me.jsx)($e,{toolPart:b,index:D,addToolResult:f??(()=>{})})},D);if(x.type==="tool-requestApproval")return(0,Me.jsx)("div",{className:"mb-2",children:(0,Me.jsx)(Pt,{toolPart:b,index:D,addToolResult:f??(()=>{})})},D);if(Y==="artefact")switch(b.state){case"input-available":return(0,Me.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},D);case"output-available":return(0,Me.jsx)("div",{className:"mb-2",children:(0,Me.jsx)(yt,{artefact:b.output?.description||"",taskId:b.output?.id||b.input?.id,taskData:b.output||b.input})},D);case"output-error":return(0,Me.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",b.errorText]},D);default:return null}return(0,Me.jsx)("div",{className:"mb-2",children:(0,Me.jsxs)($,{className:"w-full max-w-md",children:[(0,Me.jsx)(_,{children:(0,Me.jsx)(J,{className:"text-lg",children:Y})}),(0,Me.jsxs)(j,{children:[b.state==="input-available"&&(0,Me.jsxs)("p",{className:"text-sm",children:["Processing ",Y,"..."]}),b.state==="output-available"&&(0,Me.jsx)("pre",{className:"text-sm",children:JSON.stringify(b.output,null,2)}),b.state==="output-error"&&(0,Me.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",b.errorText]})]})]})},D)}if(x.type.startsWith("data-")){let b=x,Y=x.type.replace("data-","");return Y==="reference"?(0,Me.jsx)("div",{className:"mb-2",children:(0,Me.jsx)($,{className:"w-full",children:(0,Me.jsx)(j,{className:"p-4",children:(0,Me.jsx)("div",{className:"space-y-2",children:b.data?.references?.map((V,Ie)=>(0,Me.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,Me.jsx)(le,{variant:"outline",children:V.type||"link"}),(0,Me.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Me.jsx)("p",{className:"text-sm font-medium truncate",children:V.title}),V.description&&(0,Me.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:V.description})]}),V.url&&(0,Me.jsx)(H,{variant:"ghost",size:"sm",onClick:()=>window.open(V.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Me.jsx)(k.ExternalLink,{className:"h-4 w-4"})})]},Ie))})})})},D):Y==="menu"?(0,Me.jsx)("div",{className:"mb-2",children:(0,Me.jsxs)($,{className:"w-full",children:[(0,Me.jsx)(_,{children:(0,Me.jsx)(J,{className:"text-lg",children:b.data?.title})}),(0,Me.jsx)(j,{children:(0,Me.jsx)("div",{className:"space-y-2",children:b.data?.items?.map((V,Ie)=>(0,Me.jsx)(H,{variant:"outline",className:"w-full justify-start",onClick:V.action,children:(0,Me.jsxs)("div",{className:"text-left",children:[(0,Me.jsx)("p",{className:"font-medium",children:V.label}),V.description&&(0,Me.jsx)("p",{className:"text-xs text-muted-foreground",children:V.description})]})},Ie))})})]})},D):(0,Me.jsx)("div",{className:"mb-2",children:(0,Me.jsxs)($,{className:"w-full max-w-md",children:[(0,Me.jsx)(_,{children:(0,Me.jsx)(J,{className:"text-lg",children:Y})}),(0,Me.jsx)(j,{children:(0,Me.jsx)("pre",{className:"text-sm",children:JSON.stringify(b.data,null,2)})})]})},D)}return null})})]})};return(0,Me.jsxs)("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${A||""}`,children:[(0,Me.jsxs)(Ve,{ref:T,className:"flex-1 p-4 bg-background border-0",onDragOver:C,onDragLeave:Ae,onDrop:pe,children:[(0,Me.jsxs)("div",{className:p("space-y-4",s&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Me.jsx)(de.animate,{children:e.map(c=>(0,Me.jsx)(de.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:p("flex gap-3",c.role==="user"?"flex-row-reverse":"flex-row"),children:Pe(c)},c.id))}),y&&(0,Me.jsxs)(de.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Me.jsx)(ye,{className:"h-8 w-8",children:(0,Me.jsx)(xe,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Me.jsx)(k.Bot,{className:"h-4 w-4"})})}),(0,Me.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Me.jsx)(ut,{capabilities:l,isOpen:y,onToggle:()=>M(!y),onActionSelect:oe,className:"w-full"})})]}),r&&(0,Me.jsxs)(de.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Me.jsx)(ye,{className:"h-8 w-8",children:(0,Me.jsx)(xe,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Me.jsx)(k.Bot,{className:"h-4 w-4"})})}),(0,Me.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Me.jsxs)("div",{className:"flex space-x-1",children:[(0,Me.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Me.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Me.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Me.jsx)("div",{ref:w})]}),n.length>0&&(0,Me.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,Me.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(c=>(0,Me.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[ne(c.file.type),(0,Me.jsx)("span",{className:"text-sm font-medium",children:c.file.name}),(0,Me.jsx)("span",{className:"text-xs text-muted-foreground",children:Re(c.file.size)}),(0,Me.jsx)(H,{variant:"ghost",size:"sm",onClick:()=>R(c.id),className:"h-6 w-6 p-0",children:(0,Me.jsx)(k.Me,{className:"h-4 w-4"})})]},c.id))})}),(0,Me.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,Me.jsxs)("div",{className:"flex gap-3",children:[(0,Me.jsx)(He,{value:t,onChange:c=>d(c.target.value),onKeyPress:g,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:r}),i&&(0,Me.jsx)(H,{variant:"outline",size:"icon",onClick:()=>E.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Me.jsx)(k.Paperclip,{className:"h-4 w-4"})}),(0,Me.jsx)(H,{onClick:h,disabled:!t.trim()&&n.length===0||r,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Me.jsx)(k.Send,{className:"h-4 w-4"})})]}),(0,Me.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Me.jsxs)(H,{onClick:()=>M(!y),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Me.jsx)(k.Menu,{className:"h-3 w-3 mr-1"}),y?"Hide":"Show"," Capabilities"]}),(0,Me.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[fe().map((c,P)=>(0,Me.jsx)(H,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>oe(c.id,ae),children:c.label},`context-${c.id}`)),fe().length===0&&Ne().map((c,P)=>(0,Me.jsx)(H,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:c.action,children:c.label},`suggestion-${P}`))]})]}),i&&(0,Me.jsx)("input",{ref:E,type:"file",multiple:!0,onChange:be,className:"hidden"})]})]})}0&&(module.exports={ChatInterface});
20
+ ${l?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
21
+ `,children:"Cancel"})]})]}):null};var Bt=({toolPart:e,index:t,addToolResult:o})=>{let[a,s]=Je.default.useState(!0),[n,l]=Je.default.useState(null),i=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),s(!1),l("approve")},p=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),s(!1),l("deny")};switch(e.state){case"input-available":return(0,De.jsxs)("div",{className:"mb-2",children:[(0,De.jsx)(zt,{isOpen:a,onApprove:i,onDeny:p,onClose:()=>s(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,De.jsxs)(De.Fragment,{children:[n==="approve"&&(0,De.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,De.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,De.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,De.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),n==="deny"&&(0,De.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,De.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,De.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,De.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,De.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var Xe=require("@radix-ui/react-use-controllable-state");var ve=V(require("@radix-ui/react-collapsible")),Ht=ve.Root,Ft=ve.CollapsibleTrigger,Ot=ve.CollapsibleContent;var Gt=require("streamdown"),Qe=(0,q.memo)(({className:e,...t})=>(0,$t.jsx)(Gt.Streamdown,{className:d("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);Qe.displayName="Response";var jt=(0,q.createContext)(null),Fo=()=>{let e=(0,q.useContext)(jt);if(!e)throw new Error("Reasoning components must q used within Reasoning");return e},Oo=1e3,Vo=1e3,Ye=(0,q.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:s,duration:n,children:l,...i})=>{let[p,f]=(0,Xe.useControllableState)({prop:o,defaultProp:a,onChange:s}),[h,m]=(0,Xe.useControllableState)({prop:n,defaultProp:0}),[b,T]=(0,q.useState)(!1),[R,w]=(0,q.useState)(null);(0,q.useEffect)(()=>{t?R===null&&w(Date.now()):R!==null&&(m(Math.ceil((Date.now()-R)/Vo)),w(null))},[t,R,m]),(0,q.useEffect)(()=>{if(a&&!t&&p&&!b){let P=setTimeout(()=>{f(!1),T(!0)},Oo);return()=>clearTimeout(P)}},[t,p,a,f,b]);let x=P=>{f(P)};return(0,De.jsx)(jt.Provider,{value:{isStreaming:t,isOpen:p,setIsOpen:f,duration:h},children:(0,De.jsx)(Ht,{className:d("not-prose mb-4",e),onOpenChange:x,open:p,...i,children:l})})}),Go=(e,t)=>e||t===0?(0,De.jsx)("p",{children:"Thinking..."}):t===void 0?(0,De.jsx)("p",{children:"Thought for a few seconds"}):(0,De.jsxs)("p",{children:["Thought for ",t," seconds"]}),Ze=(0,q.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:s,duration:n}=Fo();return(0,De.jsx)(Ft,{className:d("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,De.jsxs)(De.Fragment,{children:[(0,De.jsx)(A.BrainIcon,{className:"size-4"}),Go(a,n),(0,De.jsx)(A.ChevronDownIcon,{className:d("size-4 transition-transform",s?"rotate-180":"rotate-0")})]})})}),et=(0,q.memo)(({className:e,children:t,...o})=>(0,De.jsx)(Ot,{className:d("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:(0,De.jsx)(Qe,{className:"grid gap-2",children:t})}));Ye.displayName="Reasoning";Ze.displayName="ReasoningTrigger";et.displayName="ReasoningContent";function $o({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:s,fileUploads:n,isDragOver:l,enableFileUpload:i,onInputChange:p,addToolResult:f,onSendMessage:h,onKeyPress:m,onFileUpload:b,onRemoveFile:T,onDragOver:R,className:w}){let x=(0,q.useRef)(null),P=(0,q.useRef)(null),E=(0,q.useRef)(null),[C,L]=(0,q.useState)(!1),[ne,ze]=(0,q.useState)({path:[],selectedItems:[],filters:{}});(0,q.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,q.useEffect)(()=>{C&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[C]);let he=()=>Ue(ne),Pe=()=>{let c=[];return s.forEach(S=>{S.actions&&S.actions.forEach(D=>{c.push({label:D.label,action:()=>ie(D.id,{path:[S],selectedItems:[],filters:{}})})}),S.children&&S.children.forEach(D=>{D.type==="list"&&D.data&&c.push({label:`View ${D.name}`,action:()=>L(!0)})})}),c.slice(0,5)},ie=(c,S)=>{console.log("Capability action:",c,S);let D=`Executing ${c} with context: ${JSON.stringify(S.path.map(y=>y.name))}`;L(!1)},Ae=Ue({path:[],selectedItems:[],filters:{}}),ye=c=>{b(c.target.files),c.target.files&&(c.target.value="")},N=c=>{c.preventDefault(),R(!0)},Te=c=>{c.preventDefault(),R(!1)},me=c=>{c.preventDefault(),R(!1),b(c.dataTransfer.files)},Se=c=>{if(c===0)return"0 Bytes";let S=1024,D=["Bytes","KB","MB","GB"],y=Math.floor(Math.log(c)/Math.log(S));return parseFloat((c/Math.pow(S,y)).toFixed(2))+" "+D[y]},se=c=>c.startsWith("image/")?(0,De.jsx)(A.Image,{className:"h-4 w-4"}):c.startsWith("text/")?(0,De.jsx)(A.FileText,{className:"h-4 w-4"}):(0,De.jsx)(A.File,{className:"h-4 w-4"}),Me=c=>{let S=c.role==="assistant",D=c.role==="user";return(0,De.jsxs)("div",{className:d("flex my-2 items-start gap-3",D?"flex-row-reverse":""),children:[(0,De.jsx)(we,{className:"h-8 w-8 shrink-0",children:(0,De.jsx)(Ne,{className:d(D?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:D?(0,De.jsx)(A.User,{className:"h-4 w-4"}):(0,De.jsx)(A.Bot,{className:"h-4 w-4"})})}),(0,De.jsx)("div",{className:d("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",D?"bg-primary text-primary-foreground":"bg-muted"),children:c.parts.map((y,M)=>{if(y.type==="text")return(0,De.jsx)(qe,{id:c.id,content:y.text},`${c.id}-text`);if(y.type==="file"){let v=y;return(0,De.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,De.jsxs)("div",{className:"flex items-center gap-2",children:[se(v.mediaType||"application/octet-stream"),(0,De.jsx)("div",{className:"flex-1 min-w-0",children:(0,De.jsx)("p",{className:"text-sm font-medium truncate",children:v.filename||v.url?.split("/").pop()||"File"})}),v.url&&(0,De.jsx)(O,{variant:"ghost",size:"sm",onClick:()=>window.open(v.url,"_blank"),className:"h-8 w-8 p-0",children:(0,De.jsx)(A.Download,{className:"h-4 w-4"})})]})},M)}if(y.type.startsWith("tool-")){let v=y,te=y.type.replace("tool-","");if(te==="task")switch(v.state){case"input-available":return(0,De.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},M);case"output-available":return(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsx)(Rt,{data:{id:v.output?.id||v.input?.id,fetchLatest:!1,taskData:v.output||v.input}})},M);case"output-error":return(0,De.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",v.errorText]},M);default:return null}if(y.type==="tool-requestEndpointLogin")return(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsx)(_e,{toolPart:v,index:M,addToolResult:f??(()=>{})})},M);if(y.type==="tool-authenticate")return(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsx)(_e,{toolPart:v,index:M,addToolResult:f??(()=>{})})},M);if(y.type==="tool-requestApproval")return(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsx)(Bt,{toolPart:v,index:M,addToolResult:f??(()=>{})})},M);if(te==="artefact")switch(v.state){case"input-available":return(0,De.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},M);case"output-available":return(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsx)(Tt,{artefact:v.output?.description||"",taskId:v.output?.id||v.input?.id,taskData:v.output||v.input})},M);case"output-error":return(0,De.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",v.errorText]},M);default:return null}return(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsxs)(U,{className:"w-full max-w-md",children:[(0,De.jsx)(Q,{children:(0,De.jsx)(X,{className:"text-lg",children:te})}),(0,De.jsxs)(W,{children:[v.state==="input-available"&&(0,De.jsxs)("p",{className:"text-sm",children:["Processing ",te,"..."]}),v.state==="output-available"&&(0,De.jsx)("pre",{className:"text-sm",children:JSON.stringify(v.output,null,2)}),v.state==="output-error"&&(0,De.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",v.errorText]})]})]})},M)}if(y.type.startsWith("data-")){let v=y,te=y.type.replace("data-","");return te==="reference"?(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsx)(U,{className:"w-full",children:(0,De.jsx)(W,{className:"p-4",children:(0,De.jsx)("div",{className:"space-y-2",children:v.data?.references?.map(($,Be)=>(0,De.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,De.jsx)(de,{variant:"outline",children:$.type||"link"}),(0,De.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,De.jsx)("p",{className:"text-sm font-medium truncate",children:$.title}),$.description&&(0,De.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:$.description})]}),$.url&&(0,De.jsx)(O,{variant:"ghost",size:"sm",onClick:()=>window.open($.url,"_blank"),className:"h-8 w-8 p-0",children:(0,De.jsx)(A.ExternalLink,{className:"h-4 w-4"})})]},Be))})})})},M):te==="menu"?(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsxs)(U,{className:"w-full",children:[(0,De.jsx)(Q,{children:(0,De.jsx)(X,{className:"text-lg",children:v.data?.title})}),(0,De.jsx)(W,{children:(0,De.jsx)("div",{className:"space-y-2",children:v.data?.items?.map(($,Be)=>(0,De.jsx)(O,{variant:"outline",className:"w-full justify-start",onClick:$.action,children:(0,De.jsxs)("div",{className:"text-left",children:[(0,De.jsx)("p",{className:"font-medium",children:$.label}),$.description&&(0,De.jsx)("p",{className:"text-xs text-muted-foreground",children:$.description})]})},Be))})})]})},M):(0,De.jsx)("div",{className:"mb-2",children:(0,De.jsxs)(U,{className:"w-full max-w-md",children:[(0,De.jsx)(Q,{children:(0,De.jsx)(X,{className:"text-lg",children:te})}),(0,De.jsx)(W,{children:(0,De.jsx)("pre",{className:"text-sm",children:JSON.stringify(v.data,null,2)})})]})},M)}if(y.type==="reasoning")return(0,De.jsxs)(Ye,{className:"w-full",isStreaming:status==="streaming"&&M===c.parts.length-1&&c.id===e.at(-1)?.id,children:[(0,De.jsx)(Ze,{}),(0,De.jsx)(et,{children:y.text})]},`${c.id}-${M}`)})})]})};return(0,De.jsxs)("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${w||""}`,children:[(0,De.jsxs)(je,{ref:P,className:"flex-1 p-4 bg-background border-0",onDragOver:N,onDragLeave:Te,onDrop:me,children:[(0,De.jsxs)("div",{className:d("space-y-4",l&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,De.jsx)(ue.animate,{children:e.map(c=>(0,De.jsx)(ue.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:d("flex gap-3",c.role==="user"?"flex-row-reverse":"flex-row"),children:Me(c)},c.id))}),C&&(0,De.jsxs)(ue.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,De.jsx)(we,{className:"h-8 w-8",children:(0,De.jsx)(Ne,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,De.jsx)(A.Bot,{className:"h-4 w-4"})})}),(0,De.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,De.jsx)(Ct,{capabilities:s,isOpen:C,onToggle:()=>L(!C),onActionSelect:ie,className:"w-full"})})]}),o&&(0,De.jsxs)(ue.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,De.jsx)(we,{className:"h-8 w-8",children:(0,De.jsx)(Ne,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,De.jsx)(A.Bot,{className:"h-4 w-4"})})}),(0,De.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,De.jsxs)("div",{className:"flex space-x-1",children:[(0,De.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,De.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,De.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,De.jsx)("div",{ref:x})]}),n.length>0&&(0,De.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,De.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(c=>(0,De.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[se(c.file.type),(0,De.jsx)("span",{className:"text-sm font-medium",children:c.file.name}),(0,De.jsx)("span",{className:"text-xs text-muted-foreground",children:Se(c.file.size)}),(0,De.jsx)(O,{variant:"ghost",size:"sm",onClick:()=>T(c.id),className:"h-6 w-6 p-0",children:(0,De.jsx)(A.X,{className:"h-4 w-4"})})]},c.id))})}),(0,De.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,De.jsxs)("div",{className:"flex gap-3",children:[(0,De.jsx)(Ge,{value:t,onChange:c=>p(c.target.value),onKeyPress:m,placeholder:"How can De help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),i&&(0,De.jsx)(O,{variant:"outline",size:"icon",onClick:()=>E.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,De.jsx)(A.Paperclip,{className:"h-4 w-4"})}),(0,De.jsx)(O,{onClick:h,disabled:!t.trim()&&n.length===0||o,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,De.jsx)(A.Send,{className:"h-4 w-4"})})]}),(0,De.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,De.jsxs)(O,{onClick:()=>L(!C),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,De.jsx)(A.Menu,{className:"h-3 w-3 mr-1"}),C?"Hide":"Show"," Capabilities"]}),(0,De.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[he().map((c,S)=>(0,De.jsx)(O,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>ie(c.id,ne),children:c.label},`context-${c.id}`)),he().length===0&&Pe().map((c,S)=>(0,De.jsx)(O,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:c.action,children:c.label},`suggestion-${S}`))]})]}),i&&(0,De.jsx)("input",{ref:E,type:"file",multiple:!0,onChange:ye,className:"hidden"})]})]})}0&&(module.exports={ChatInterface});
@@ -1 +1 @@
1
- import{a}from"../../chunk-4RGIPI27.mjs";import"../../chunk-3BG2SCNC.mjs";import"../../chunk-6OT5PQXV.mjs";import"../../chunk-SIL7AP7H.mjs";import"../../chunk-QM5FOQHG.mjs";import"../../chunk-6OCLRAHU.mjs";import"../../chunk-2LINLX4S.mjs";import"../../chunk-DBY4SXQI.mjs";import"../../chunk-I2PVJQQR.mjs";import"../../chunk-LTTO57ZK.mjs";import"../../chunk-Q2DPE66H.mjs";import"../../chunk-FT3AE7L2.mjs";import"../../chunk-L5JPAKPM.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-YEKQJ4YC.mjs";export{a as ChatInterface};
1
+ import{a}from"../../chunk-UTHKFW4R.mjs";import"../../chunk-3BG2SCNC.mjs";import"../../chunk-6OT5PQXV.mjs";import"../../chunk-SIL7AP7H.mjs";import"../../chunk-QM5FOQHG.mjs";import"../../chunk-6OCLRAHU.mjs";import"../../chunk-5Y6FKL5W.mjs";import"../../chunk-EW6KWAHS.mjs";import"../../chunk-2LINLX4S.mjs";import"../../chunk-DBY4SXQI.mjs";import"../../chunk-I2PVJQQR.mjs";import"../../chunk-LTTO57ZK.mjs";import"../../chunk-Q2DPE66H.mjs";import"../../chunk-FT3AE7L2.mjs";import"../../chunk-YNCJATT7.mjs";import"../../chunk-L5JPAKPM.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-YEKQJ4YC.mjs";export{a as ChatInterface};