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.
- package/dist/chunk-5Y6FKL5W.mjs +4 -0
- package/dist/{chunk-F2Y3ELUO.mjs → chunk-A2KX5N75.mjs} +1 -1
- package/dist/chunk-EW6KWAHS.mjs +4 -0
- package/dist/{chunk-2Z5N6HIX.mjs → chunk-JTVWQ42C.mjs} +1 -1
- package/dist/{chunk-GSOFCLPO.mjs → chunk-RX63ABAF.mjs} +1 -1
- package/dist/chunk-UTHKFW4R.mjs +1 -0
- package/dist/components/Chat/ChatInterface.js +10 -9
- package/dist/components/Chat/ChatInterface.mjs +1 -1
- package/dist/components/Chat/CopilotInterface.js +11 -10
- package/dist/components/Chat/CopilotInterface.mjs +1 -1
- package/dist/components/Chat/PartTypes/Reasoning.css +1 -0
- package/dist/components/Chat/PartTypes/Reasoning.d.ts +16 -0
- package/dist/components/Chat/PartTypes/Reasoning.js +5 -0
- package/dist/components/Chat/PartTypes/Reasoning.mjs +2 -0
- package/dist/components/Chat/PartTypes/Response.css +1 -0
- package/dist/components/Chat/PartTypes/Response.d.ts +5 -0
- package/dist/components/Chat/PartTypes/Response.js +4 -0
- package/dist/components/Chat/PartTypes/Response.mjs +2 -0
- package/dist/components/Chat/PartTypes/index.css +1 -0
- package/dist/components/Chat/PartTypes/index.d.ts +2 -0
- package/dist/components/Chat/PartTypes/index.js +11 -10
- package/dist/components/Chat/PartTypes/index.mjs +1 -1
- package/dist/components/Chat/demo-long-messages.js +21 -20
- package/dist/components/Chat/demo-long-messages.mjs +1 -1
- package/dist/components/Chat/demo-tests.js +38 -37
- package/dist/components/Chat/demo-tests.mjs +1 -1
- package/dist/components/Chat/demo.js +11 -10
- package/dist/components/Chat/demo.mjs +1 -1
- package/dist/components/Chat/example-usage.js +11 -10
- package/dist/components/Chat/example-usage.mjs +1 -1
- package/dist/components/Chat/example-with-vercel-ai.js +11 -10
- package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
- package/dist/components/Chat/index.js +11 -10
- package/dist/components/Chat/index.mjs +1 -1
- package/dist/components/Foundary/Views/index.mjs +1 -1
- package/dist/components/Foundary/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
- package/dist/components/Layouts/Print.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/index.js +19 -19
- package/dist/components/index.mjs +1 -1
- package/dist/globals.css +1 -1
- package/dist/index.js +18 -18
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +6 -4
- package/dist/chunk-4RGIPI27.mjs +0 -1
|
@@ -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 Ro=Object.create;var bt=Object.defineProperty;var So=Object.getOwnPropertyDescriptor;var Ao=Object.getOwnPropertyNames;var Mo=Object.getPrototypeOf,Io=Object.prototype.hasOwnProperty;var Bo=(e,t)=>{for(var a in t)bt(e,a,{get:t[a],enumerable:!0})},ia=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Ao(t))!Io.call(e,l)&&l!==a&&bt(e,l,{get:()=>t[l],enumerable:!(o=So(t,l))||o.enumerable});return e};var G=(e,t,a)=>(a=e!=null?Ro(Mo(e)):{},ia(t||!e||!e.__esModule?bt(a,"default",{value:e,enumerable:!0}):a,e)),Lo=e=>ia(bt({},"__esModule",{value:!0}),e);var Li={};Bo(Li,{ExampleChatInterface:()=>Bi});module.exports=Lo(Li);var vt=G(require("react")),Se=G(require("@radix-ui/react-avatar"));var ua=require("clsx");var Lt="-",Eo=e=>{let t=Uo(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{let n=s.split(Lt);return n[0]===""&&n.length!==1&&n.shift(),sa(n,t)||zo(s)},getConflictingClassGroupIds:(s,n)=>{let p=a[s]||[];return n&&o[s]?[...p,...o[s]]:p}}},sa=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),l=o?sa(e.slice(1),o):void 0;if(l)return l;if(t.validators.length===0)return;let r=e.join(Lt);return t.validators.find(({validator:s})=>s(r))?.classGroupId},ra=/^\[(.+)\]$/,zo=e=>{if(ra.test(e)){let t=ra.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Uo=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return jo(Object.entries(e.classGroups),a).forEach(([r,s])=>{Bt(s,o,r,t)}),o},Bt=(e,t,a,o)=>{e.forEach(l=>{if(typeof l=="string"){let r=l===""?t:na(t,l);r.classGroupId=a;return}if(typeof l=="function"){if(Fo(l)){Bt(l(o),t,a,o);return}t.validators.push({validator:l,classGroupId:a});return}Object.entries(l).forEach(([r,s])=>{Bt(s,na(t,r),a,o)})})},na=(e,t)=>{let a=e;return t.split(Lt).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Fo=e=>e.isThemeGetter,jo=(e,t)=>t?e.map(([a,o])=>{let l=o.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([s,n])=>[t+s,n])):r);return[a,l]}):e,Ho=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,l=(r,s)=>{a.set(r,s),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let s=a.get(r);if(s!==void 0)return s;if((s=o.get(r))!==void 0)return l(r,s),s},set(r,s){a.has(r)?a.set(r,s):l(r,s)}}},la="!",Oo=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,l=t[0],r=t.length,s=n=>{let p=[],u=0,k=0,f;for(let x=0;x<n.length;x++){let S=n[x];if(u===0){if(S===l&&(o||n.slice(x,x+r)===t)){p.push(n.slice(k,x)),k=x+r;continue}if(S==="/"){f=x;continue}}S==="["?u++:S==="]"&&u--}let y=p.length===0?n:n.substring(k),T=y.startsWith(la),U=T?y.substring(1):y,R=f&&f>k?f-k:void 0;return{modifiers:p,hasImportantModifier:T,baseClassName:U,maybePostfixModifierPosition:R}};return a?n=>a({className:n,parseClassName:s}):s},Vo=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(o=>{o[0]==="["?(t.push(...a.sort(),o),a=[]):a.push(o)}),t.push(...a.sort()),t},Go=e=>({cache:Ho(e.cacheSize),parseClassName:Oo(e),...Eo(e)}),Wo=/\s+/,qo=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:l}=t,r=[],s=e.trim().split(Wo),n="";for(let p=s.length-1;p>=0;p-=1){let u=s[p],{modifiers:k,hasImportantModifier:f,baseClassName:y,maybePostfixModifierPosition:T}=a(u),U=!!T,R=o(U?y.substring(0,T):y);if(!R){if(!U){n=u+(n.length>0?" "+n:n);continue}if(R=o(y),!R){n=u+(n.length>0?" "+n:n);continue}U=!1}let x=Vo(k).join(":"),S=f?x+la:x,F=S+R;if(r.includes(F))continue;r.push(F);let w=l(R,U);for(let E=0;E<w.length;++E){let Y=w[E];r.push(S+Y)}n=u+(n.length>0?" "+n:n)}return n};function $o(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=ca(t))&&(o&&(o+=" "),o+=a);return o}var ca=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=ca(e[o]))&&(a&&(a+=" "),a+=t);return a};function Ko(e,...t){let a,o,l,r=s;function s(p){let u=t.reduce((k,f)=>f(k),e());return a=Go(u),o=a.cache.get,l=a.cache.set,r=n,n(p)}function n(p){let u=o(p);if(u)return u;let k=qo(p,a);return l(p,k),k}return function(){return r($o.apply(null,arguments))}}var O=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},da=/^\[(?:([a-va-]+):)?(.+)\]$/ht,_o=/^\d+\/\d+$/,Jo=new Set(["px","full","screen"]),Xo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qo=/\d+(%|px|r?em|[sdl]?ht([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|ht|ht|min|max))|\ht(calc|min|max|clamp)\(.+\)|^0$/,Yo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Zo=/^(inset_)?-?((\d+)?\.?(\d+)[a-va]+|0)_-?((\d+)?\.?(\d+)[a-va]+|0)/,ei=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Re=e=>Qe(e)||Jo.has(e)||_o.test(e),ze=e=>Ye(e,"length",li),Qe=e=>!!e&&!Number.isNaN(Number(e)),It=e=>Ye(e,"number",Qe),nt=e=>!!e&&Number.isInteger(Number(e)),ti=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),h=e=>da.test(e),Ue=e=>Xo.test(e),ai=new Set(["length","size","percentage"]),oi=e=>Ye(e,ai,pa),ii=e=>Ye(e,"position",pa),ri=new Set(["image","url"]),ni=e=>Ye(e,ri,di),si=e=>Ye(e,"",ci),st=()=>!0,Ye=(e,t,a)=>{let o=da.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},li=e=>Qo.test(e)&&!Yo.test(e),pa=()=>!1,ci=e=>Zo.test(e),di=e=>ei.test(e);var pi=()=>{let e=O("colors"),t=O("spacing"),a=O("blur"),o=O("brightness"),l=O("borderColor"),r=O("borderRadius"),s=O("borderSpacing"),n=O("borderWidth"),p=O("contrast"),u=O("grayscale"),k=O("hueRotate"),f=O("invert"),y=O("gap"),T=O("gradientColorStops"),U=O("gradientColorStopPositions"),R=O("inset"),x=O("margin"),S=O("opacity"),F=O("padding"),w=O("saturate"),E=O("scale"),Y=O("sepia"),Z=O("skew"),ee=O("space"),Q=O("translate"),W=()=>["auto","contain","none"],oe=()=>["auto","hidden","clip","visible","scroll"],se=()=>["auto",h,t],M=()=>[h,t],De=()=>["",Re,ze],d=()=>["auto",Qe,h],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],m=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",h],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>[Qe,h];return{cacheSize:500,separator:":",theme:{colors:[st],spacing:[Re,ze],blur:["none","",Ue,h],brightness:A(),borderColor:[e],borderRadius:["none","","full",Ue,h],borderSpacing:M(),borderWidth:De(),contrast:A(),grayscale:j(),hueRotate:A(),invert:j(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[ti,ze],inset:se(),margin:se(),opacity:A(),padding:M(),saturate:A(),scale:A(),sepia:j(),skew:A(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",h]}],container:["container"],columns:[{columns:[Ue]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...L(),h]}],overflow:[{overflow:oe()}],"overflow-x":[{"overflow-x":oe()}],"overflow-y":[{"overflow-y":oe()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[R]}],"inset-x":[{"inset-x":[R]}],"inset-y":[{"inset-y":[R]}],start:[{start:[R]}],end:[{end:[R]}],top:[{top:[R]}],right:[{right:[R]}],bottom:[{bottom:[R]}],left:[{left:[R]}],visibility:["visible","invisible","collapse"],va:[{va:["auto",nt,h]}],basis:[{basis:se()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",h]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",nt,h]}],"grid-cols":[{"grid-cols":[st]}],"col-start-end":[{col:["auto",{span:["full",nt,h]},h]}],"col-start":[{"col-start":d()}],"col-end":[{"col-end":d()}],"grid-rows":[{"grid-rows":[st]}],"row-start-end":[{row:["auto",{span:[nt,h]},h]}],"row-start":[{"row-start":d()}],"row-end":[{"row-end":d()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",h]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",h]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...m()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...m(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...m(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[F]}],px:[{px:[F]}],py:[{py:[F]}],ps:[{ps:[F]}],ht:[{ht:[F]}],pt:[{pt:[F]}],pr:[{pr:[F]}],pb:[{pb:[F]}],pl:[{pl:[F]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],At:[{At:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[ee]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ee]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",h,t]}],"min-w":[{"min-w":[h,t,"min","max","fit"]}],"max-w":[{"max-w":[h,t,"none","full","min","max","fit","prose",{screen:[Ue]},Ue]}],h:[{h:[h,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[h,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ue,ze]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",It]}],"font-family":[{font:[st]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",h]}],"line-clamp":[{"line-clamp":["none",Qe,It]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Re,h]}],"list-image":[{"list-image":["none",h]}],"list-style-type":[{list:["none","disc","decimal",h]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Re,ze]}],"underline-offset":[{"underline-offset":["auto",Re,h]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...L(),ii]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",oi]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","ht","bl","l","tl"]},ni]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[U]}],"gradient-via-pos":[{via:[U]}],"gradient-to-pos":[{to:[U]}],"gradient-from":[{from:[T]}],"gradient-via":[{via:[T]}],"gradient-to":[{to:[T]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-ht":[{"rounded-ht":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-ee":[{"rounded-ee":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[n]}],"border-w-x":[{"border-x":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-r":[{"border-r":[n]}],"border-w-ht":[{"border-ht":[n]}],"border-w-l":[{"border-l":[n]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...I(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:I()}],"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-ht":[{"border-ht":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...I()]}],"outline-offset":[{"outline-offset":[Re,h]}],"outline-w":[{outline:[Re,ze]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:De()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Re,ze]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ue,si]}],"shadow-color":[{shadow:[st]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",Ue,h]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[k]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[Y]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[k]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[Y]}],"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",h]}],duration:[{duration:A()}],ease:[{ease:["linear","in","out","in-out",h]}],delay:[{delay:A()}],animate:[{animate:["none","spin","ping","pulse","bounce",h]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[nt,h]}],"translate-x":[{"translate-x":[Q]}],"translate-y":[{"translate-y":[Q]}],"skew-x":[{"skew-x":[Z]}],"skew-y":[{"skew-y":[Z]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",h]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ht-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-At":[{"scroll-At":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-ht":[{"scroll-ht":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",h]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Re,ze,It]}],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","ht","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","At","mr","mb","ml"],mx:["mr","ml"],my:["At","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-ht","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-ht":["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-ht","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-ht"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-ht","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-ht"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-At","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-At","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-ht","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 ma=Ko(pi);function c(...e){return ma((0,ua.clsx)(e))}var ht=require("react/jsx-runtime"),Ge=vt.forwardRef(({className:e,...t},a)=>(0,ht.jsx)(Se.Root,{ref:a,className:c("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Ge.displayName=Se.Root.displayName;var Et=vt.forwardRef(({className:e,...t},a)=>(0,ht.jsx)(Se.Image,{ref:a,className:c("aspect-square h-full w-full",e),...t}));Et.displayName=Se.Image.displayName;var We=vt.forwardRef(({className:e,...t},a)=>(0,ht.jsx)(Se.Fallback,{ref:a,className:c("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));We.displayName=Se.Fallback.displayName;var qe=G(require("react"));var me=qe.forwardRef(({className:e,...t},a)=>(0,$e.jsx)("div",{ref:a,className:c("rounded-xl border bg-card text-card-foreground shadow",e),...t}));me.displayName="Card";var Ae=qe.forwardRef(({className:e,...t},a)=>(0,$e.jsx)("div",{ref:a,className:c("flex flex-col space-y-1.5 p-6",e),...t}));Ae.displayName="CardHeader";var Me=qe.forwardRef(({className:e,...t},a)=>(0,$e.jsx)("div",{ref:a,className:c("font-semibold leading-none tracking-tight",e),...t}));Me.displayName="CardTitle";var zt=qe.forwardRef(({className:e,...t},a)=>(0,$e.jsx)("div",{ref:a,className:c("text-sm text-muted-foreground",e),...t}));zt.displayName="CardDescription";var xe=qe.forwardRef(({className:e,...t},a)=>(0,$e.jsx)("div",{ref:a,className:c("p-6 pt-0",e),...t}));xe.displayName="CardContent";var lt=qe.forwardRef(({className:e,...t},a)=>(0,$e.jsx)("div",{ref:a,className:c("flex items-center p-6 pt-0",e),...t}));lt.displayName="CardFooter";var ga=require("class-variance-authority");var mi=(0,ga.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,...a}){return(0,ht.jsx)("div",{className:c(mi({variant:t}),e),...a})}var va=require("lucide-react"),ha=require("date-fns");var Ze=require("react");function ba({taskId:e,polling:t=!0,system:a="payload"}){let[o,l]=(0,Ze.useState)(null),[r,s]=(0,Ze.useState)(!1),[n,p]=(0,Ze.useState)(null),u=async(f=!0)=>{if(e){f&&s(!0);try{let y=await fetch(`/api/tasks/${e}`);if(!y.ok)throw new Error(`Failed to fetch task: ${y.statusText}`);let T=await y.json();l(T)}catch(y){console.error("Error fetching task:",y),p(y instanceof Error?y:new Error("Unknown error occurred"))}finally{f&&s(!1)}}},k=()=>u(!1);return(0,Ze.useEffect)(()=>{e&&u(!0);let f=null;return e&&t&&(f=setInterval(k,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:o,loading:r,error:n}}var ui=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"}},gi=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function ya({data:e}){let{id:t,system:a,fetchLatest:o,taskData:l,error:r}=e||{};if(!t)return null;let s=null,n=!0,p=r,u=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:a,fetchLatest:u,taskData:s,error:p}),u){let{task:T,loading:U,error:R}=ba({taskId:t,system:a});s=T,n=U,p=R}else n=!1;let k=ui(s?.status||"todo"),f=gi(s?.status||"todo"),y=s?.dateLogged||new Date().toISOString();try{let T=new Date(s?.dateLogged||"");isNaN(T.getTime())||(y=(0,ha.formatDistanceToNow)(T,{addSuffix:!0}))}catch{}return(0,ht.jsxs)(me,{className:c("w-full max-w-md shadow-md",p&&"border border-destructive"),children:[(0,ht.jsxs)(Ae,{className:"pb-2",children:[(0,ht.jsxs)("div",{className:"flex justify-between items-start",children:[(0,ht.jsx)(Me,{className:"text-lg font-semibold",children:n?"Loading...":s?.name||"Task"}),(0,ht.jsx)(de,{className:`${k}`,children:f})]}),s?.project&&(0,ht.jsxs)(zt,{className:"text-sm text-gray-500",children:["Project: ",s.project.name]})]}),(0,ht.jsx)(xe,{className:"pb-2",children:n?(0,ht.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):p?(0,ht.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,ht.jsx)("p",{className:"text-sm text-foreground",children:s?.description||"......."})}),(0,ht.jsx)(lt,{className:"pt-2 flex items-center justify-between",children:(0,ht.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,ht.jsx)(va.Clock,{className:"h-3 w-3 mr-1"}),(0,ht.jsxs)("span",{children:["Created ",y]}),(0,ht.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,ht.jsxs)("span",{children:["Task #",t]})]})})]})}var Ut=G(require("react")),ue=G(require("@radix-ui/react-scroll-area"));var we=Ut.forwardRef(({className:e,children:t,...a},o)=>(0,ht.jsxs)(ue.Root,{ref:o,className:c("relative overflow-hidden",e),...a,children:[(0,ht.jsx)(ue.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,ht.jsx)(xa,{}),(0,ht.jsx)(ue.Corner,{})]}));we.displayName=ue.Root.displayName;var xa=Ut.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,ht.jsx)(ue.ScrollAreaScrollbar,{ref:o,orientation:t,className:c("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,ht.jsx)(ue.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));xa.displayName=ue.ScrollAreaScrollbar.displayName;var wa={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 Ft(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function ka({artefact:e,taskId:t,taskData:a,loading:o=!1,error:l=null}){let r=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},s=r.dateLogged;try{let n=new Date(r.dateLogged);isNaN(n.getTime())||(s=(0,ha.formatDistanceToNow)(n,{addSuffix:!0}))}catch{}return(0,ht.jsxs)(me,{className:"w-full max-w-md shadow-md",children:[(0,ht.jsx)(Ae,{className:"pb-2",children:(0,ht.jsx)("div",{className:"flex justify-between items-start",children:(0,ht.jsx)(Me,{className:"text-lg font-semibold",children:o?"Loading...":r.name})})}),(0,ht.jsx)(xe,{className:"pb-2",children:o?(0,ht.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):l?(0,ht.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,ht.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,ht.jsx)(lt,{className:"pt-2 flex items-center justify-between",children:(0,ht.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,ht.jsx)(va.Clock,{className:"h-3 w-3 mr-1"}),(0,ht.jsxs)("span",{children:["Created ",s]}),(0,ht.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,ht.jsxs)("span",{children:["Task #",r.id]})]})})]})}var mo=require("@ai-sdk/react"),At=require("motion/react");var Dt=G(require("react")),Wt=G(require("next/link"));var Pa=require("@radix-ui/react-slot"),Ta=G(require("react")),fi=(0,ga.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"}}}),D=Ta.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...l},r)=>(0,ht.jsx)(e?Pa.Slot:"button",{className:c(fi({className:t,size:a,variant:o})),ref:r,...l}));D.displayName="Button";var Sa=G(require("react"));var ct=Sa.forwardRef(({className:e,type:t,...a},o)=>(0,ht.jsx)("input",{type:t,className:c("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...a}));ct.displayName="Input";var dt=G(require("react")),_=G(require("@radix-ui/react-dialog"));var Ia=_.Root;var bi=_.Portal;var Ba=dt.forwardRef(({className:e,...t},a)=>(0,ht.jsx)(_.Overlay,{ref:a,className:c("fixed inset-0 va-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Ba.displayName=_.Overlay.displayName;var jt=dt.forwardRef(({className:e,children:t,...a},o)=>(0,ht.jsxs)(bi,{children:[(0,ht.jsx)(Ba,{}),(0,ht.jsxs)(_.Content,{ref:o,className:c("fixed left-[50%] top-[50%] va-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,(0,ht.jsxs)(_.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,ht.jsx)(va.ht,{className:"h-4 w-4"}),(0,ht.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));jt.displayName=_.Content.displayName;var Ht=({className:e,...t})=>(0,ht.jsx)("div",{className:c("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ht.displayName="DialogHeader";var vi=({className:e,...t})=>(0,ht.jsx)("div",{className:c("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});vi.displayName="DialogFooter";var Ot=dt.forwardRef(({className:e,...t},a)=>(0,ht.jsx)(_.Title,{ref:a,className:c("text-lg font-semibold leading-none tracking-tight",e),...t}));Ot.displayName=_.Title.displayName;var hi=dt.forwardRef(({className:e,...t},a)=>(0,ht.jsx)(_.Description,{ref:a,className:c("text-sm text-muted-foreground",e),...t}));hi.displayName=_.Description.displayName;var pt=G(require("@radix-ui/react-checkbox")),Ea=G(require("react")),Vt=Ea.forwardRef(({className:e,...t},a)=>(0,ht.jsx)(pt.Root,{className:c("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:a,...t,children:(0,ht.jsx)(pt.Indicator,{className:c("flex items-center justify-center text-current"),children:(0,ht.jsx)(va.Check,{className:"h-4 w-4"})})}));Vt.displayName=pt.Root.displayName;var Ce=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var Ua=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,ht.jsx)(va.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,ht.jsx)(va.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,ht.jsx)(va.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,ht.jsx)(va.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,ht.jsx)(va.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,ht.jsx)(va.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,ht.jsx)(va.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,ht.jsx)(va.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"Ze",name:"IT Support",description:"Information technology and infrastructure",icon:(0,ht.jsx)(va.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,ht.jsx)(va.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Ct=[{id:"1",name:"E-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var Gt=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],xt=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],kt=[{id:"1",name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],yi=[...kt,{id:"8",name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],xi=[...Ct,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],wt={projects:[{id:"1",name:"Empty Project",description:"A project with no tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},za={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:kt.filter(e=>e.epicId==="1")};var Cr={empty:{initialProjects:wt.projects,initialEpics:wt.epics,initialSprints:wt.sprints,initialTasks:wt.tasks},default:{initialProjects:Ct,initialEpics:Gt,initialSprints:xt,initialTasks:kt},highDensity:{initialProjects:Ct,initialEpics:Gt,initialSprints:xt,initialTasks:yi},singleEpic:{initialProjects:Ct,initialEpics:za.epics,initialSprints:xt,initialTasks:za.tasks},multipleProjects:{initialProjects:xi,initialEpics:Gt,initialSprints:xt,initialTasks:kt}},Nt=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.js","Python","Git"].map(Ce),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Ce),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused on driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(Ce),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Ce),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated to understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","R","Statistics"].map(Ce),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Ce),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(Ce),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Ce),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Ce),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Ce),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],Nr=[{id:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:Nt.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:Nt.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date,dueTime:"16:00",colleague:Nt.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var kr=Nt.filter(e=>e.type==="digital");function Fa(e,t){let[a,o]=(0,Ze.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),l=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,Ze.useEffect)(()=>{l(a)},[]),[a,l]}function qt({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:l=Ua[0],onBusinessUnitChange:r,onSearch:s,className:n,logo:p="/headerlogo.png",appName:u="Nuvia",tagline:k="Collaboration Platform"}){let[f,y]=Dt.useState({}),[T,U]=Fa("sidebar-favorites",{}),[R,x]=Dt.useState(null),[S,F]=Dt.useState(""),w=d=>{y(L=>({...L,[d]:!L[d]}))},E=d=>{r?.(d)},Y=()=>{S.trim()&&s?.(S.trim())},Z=d=>{d.key==="Enter"&&(d.preventDefault(),Y())},ee=(d,L)=>{let I=T[d]||[],q=I.includes(L)?I.filter(m=>m!==L):I.concat(L);U({...T,[d]:q})},Q=d=>{if(!d.items||!d.maxItems||d.items.length<=d.maxItems)return d.items||[];let L=T[d.id]||[],I=d.items.filter(m=>L.includes(m.id)),q=d.items.filter(m=>!L.includes(m.id));return[...I,...q].slice(0,d.maxItems)},W=d=>d.maxItems&&d.items&&d.items.length>d.maxItems,oe=e,se=d=>{let L=W(d),I=Q(d),q=(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsxs)("div",{className:"flex items-center gap-3",children:[d.icon,(0,ht.jsx)("span",{children:d.title})]}),d.badge&&(0,ht.jsx)(de,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:d.badge}),d.items&&(0,ht.jsx)(va.ChevronDown,{className:c("ml-2 h-4 w-4 transition-transform",f[d.title]?"rotate-180":"")})]}),m=c("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",d.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return d.url?(0,ht.jsx)(Wt.default,{href:d.url,className:m,onClick:a?o:void 0,children:q}):(0,ht.jsx)("button",{className:m,onClick:()=>d.items&&w(d.title),children:q})},M=()=>{let d=e.find(I=>I.id===R);if(!d||!d.items||!d.maxItems)return null;let L=T[d.id]||[];return(0,ht.jsx)(Ia,{open:!!R,onOpenChange:I=>!I&&x(null),children:(0,ht.jsxs)(jt,{className:"sm:max-w-md",children:[(0,ht.jsxs)(Ht,{children:[(0,ht.jsxs)(Ot,{children:["Manage ",d.title," Favorites"]}),(0,ht.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",d.maxItems," items to show in ",d.title.toLowerCase(),"."]})]}),(0,ht.jsx)(we,{className:"max-h-96 pr-4",children:(0,ht.jsx)("div",{className:"space-y-4",children:d.items.map(I=>(0,ht.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ht.jsx)(Vt,{id:I.id,checked:L.includes(I.id),onCheckedChange:()=>ee(d.id,I.id),disabled:!L.includes(I.id)&&L.length>=(d.maxItems||0)}),(0,ht.jsxs)("label",{htmlFor:I.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[I.title,I.badge&&(0,ht.jsx)(de,{variant:"outline",className:"text-xs",children:I.badge})]})]},I.id))})})]})})},De=(0,ht.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,ht.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,ht.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ht.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,ht.jsx)("img",{src:p,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,ht.jsxs)("div",{children:[(0,ht.jsx)("h2",{className:"font-semibold",children:u}),(0,ht.jsx)("p",{className:"text-xs text-muted-foreground",children:k})]})]}),a&&(0,ht.jsx)(D,{variant:"ghost",size:"icon",onClick:o,children:(0,ht.jsx)(va.ht,{className:"h-5 w-5"})})]}),(0,ht.jsx)("div",{className:"px-3 py-2",children:(0,ht.jsxs)("div",{className:"relative",children:[(0,ht.jsx)(va.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,ht.jsx)(ct,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:S,onChange:d=>F(d.target.value),onKeyPress:Z})]})}),(0,ht.jsx)(we,{className:"flex-1 px-3 py-2",children:(0,ht.jsx)("div",{className:"space-y-1",children:oe.map(d=>(0,ht.jsxs)("div",{className:"mb-1",children:[se(d),d.items&&f[d.title]&&(0,ht.jsxs)("div",{className:"At-1 ml-6 space-y-1 border-l pl-3",children:[Q(d).map(L=>(0,ht.jsxs)(Wt.default,{href:L.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[L.title,L.badge&&(0,ht.jsx)(de,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:L.badge})]},L.id)),W(d)&&d.items&&d.items.length>Q(d).length&&(0,ht.jsxs)("button",{onClick:()=>x(d.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",d.items.length-Q(d).length," more available"]})]})]},d.id))})}),(0,ht.jsx)("div",{className:"p-3",children:(0,ht.jsx)("div",{className:"space-y-1",children:(0,ht.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,ht.jsx)(va.Settings,{className:"h-5 w-5"}),(0,ht.jsx)("span",{children:"Settings"})]})})}),(0,ht.jsx)(M,{})]});return a?(0,ht.jsx)("div",{className:c("fixed inset-y-0 left-0 va-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",n),children:De}):(0,ht.jsx)("div",{className:c("fixed inset-y-0 left-0 va-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",n),children:De})}var ja=G(require("react")),be=G(require("@radix-ui/react-tooltip"));var et=be.Provider,tt=be.Root,at=be.Trigger,Ke=ja.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,$t.jsx)(be.Portal,{children:(0,$t.jsx)(be.Content,{ref:o,sideOffset:t,className:c("va-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));Ke.displayName=be.Content.displayName;var Ha=require("next-themes");function Oa(){let{setTheme:e,theme:t}=(0,Ha.useTheme)();return(0,ht.jsx)(et,{children:(0,ht.jsxs)(tt,{children:[(0,ht.jsx)(at,{asChild:!0,children:(0,ht.jsxs)(D,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,ht.jsx)(va.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,ht.jsx)(va.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,ht.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,ht.jsx)(Ke,{children:"Toggle theme"})]})})}function Va({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:l,className:r}){let s=e.filter(u=>!u.read),n=s.length,p=u=>{switch(u){case"info":return(0,ht.jsx)(va.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,ht.jsx)(va.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,ht.jsx)(va.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,ht.jsx)(va.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,ht.jsx)(At.AnimatePresence,{children:t&&(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsx)(At.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 va-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,ht.jsx)(At.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:c("fixed inset-y-0 right-0 va-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",r),children:(0,ht.jsxs)("div",{className:"flex h-full flex-col",children:[(0,ht.jsxs)("div",{className:"flex items-center justify-between border-ht p-4",children:[(0,ht.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ht.jsx)(va.Bell,{className:"h-5 w-5"}),(0,ht.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),n>0&&(0,ht.jsxs)(de,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[n," new"]})]}),(0,ht.jsxs)(D,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,ht.jsx)(va.ht,{className:"h-5 w-5"}),(0,ht.jsx)("span",{className:"sr-only",children:"Close"})]})]}),n>0&&(0,ht.jsxs)("div",{className:"flex items-center justify-between border-ht p-2",children:[(0,ht.jsxs)("span",{className:"text-sm text-muted-foreground",children:[n," unread notification",n!==1?"s":""]}),(0,ht.jsx)(D,{variant:"ghost",size:"sm",onClick:l,className:"text-sm",children:"Dismiss all"})]}),s.length>0?(0,ht.jsx)(we,{className:"flex-1",children:(0,ht.jsx)("div",{className:"divide-y",children:s.map(u=>(0,ht.jsxs)("div",{className:c("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,ht.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:p(u.type)}),(0,ht.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,ht.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ht.jsx)("p",{className:"font-medium",children:u.title}),(0,ht.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ht.jsx)("p",{className:"text-xs text-muted-foreground",children:u.time}),(0,ht.jsx)(D,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(u.id),title:"Dismiss",children:(0,ht.jsx)(va.Check,{className:"h-3 w-3"})})]})]}),(0,ht.jsx)("p",{className:"text-sm text-muted-foreground",children:u.description}),u.actionLabel&&(0,ht.jsxs)(D,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:u.onAction,children:[u.actionLabel,(0,ht.jsx)(va.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},u.id))})}):(0,ht.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,ht.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,ht.jsx)(va.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,ht.jsx)("h3",{className:"At-4 text-lg font-medium",children:"No notifications"}),(0,ht.jsx)("p",{className:"At-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var _e=G(require("@radix-ui/react-tabs"));function Ga({className:e,...t}){return(0,ht.jsx)(_e.Root,{"data-slot":"tabs",className:c("flex flex-col gap-2",e),...t})}function Wa({className:e,...t}){return(0,ht.jsx)(_e.List,{"data-slot":"tabs-list",className:c("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function qa({className:e,...t}){return(0,ht.jsx)(_e.Trigger,{"data-slot":"tabs-trigger",className:c("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var Ie=G(require("react")),P=G(require("@radix-ui/react-dropdown-menu")),ot=require("@radix-ui/react-icons");var $a=P.Root,Ka=P.Trigger;var wi=Ie.forwardRef(({className:e,inset:t,children:a,...o},l)=>(0,ht.jsxs)(P.SubTrigger,{ref:l,className:c("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[a,(0,ht.jsx)(ot.ChevronRightIcon,{className:"ml-auto"})]}));wi.displayName=P.SubTrigger.displayName;var Ci=Ie.forwardRef(({className:e,...t},a)=>(0,ht.jsx)(P.SubContent,{ref:a,className:c("va-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Ci.displayName=P.SubContent.displayName;var Kt=Ie.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,ht.jsx)(P.Portal,{children:(0,ht.jsx)(P.Content,{ref:o,sideOffset:t,className:c("va-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));Kt.displayName=P.Content.displayName;var _t=Ie.forwardRef(({className:e,inset:t,...a},o)=>(0,ht.jsx)(P.Item,{ref:o,className:c("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...a}));_t.displayName=P.Item.displayName;var Ni=Ie.forwardRef(({className:e,children:t,checked:a,...o},l)=>(0,ht.jsxs)(P.CheckboxItem,{ref:l,className:c("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[(0,ht.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,ht.jsx)(P.ItemIndicator,{children:(0,ht.jsx)(ot.CheckIcon,{className:"h-4 w-4"})})}),t]}));Ni.displayName=P.CheckboxItem.displayName;var ki=Ie.forwardRef(({className:e,children:t,...a},o)=>(0,ht.jsxs)(P.RadioItem,{ref:o,className:c("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,ht.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,ht.jsx)(P.ItemIndicator,{children:(0,ht.jsx)(ot.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));ki.displayName=P.RadioItem.displayName;var Pi=Ie.forwardRef(({className:e,inset:t,...a},o)=>(0,ht.jsx)(P.Label,{ref:o,className:c("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));Pi.displayName=P.Label.displayName;var Di=Ie.forwardRef(({className:e,...t},a)=>(0,ht.jsx)(P.Separator,{ref:a,className:c("-mx-1 my-1 h-px bg-muted",e),...t}));Di.displayName=P.Separator.displayName;var Ti=({className:e,...t})=>(0,ht.jsx)("span",{className:c("ml-auto text-xs tracking-widest opacity-60",e),...t});Ti.displayName="DropdownMenuShortcut";function Ja({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:l="700px",gridCols:r=6}){let s=a.find(n=>n.value===e);return(0,ht.jsxs)(At.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,ht.jsx)("div",{className:"hidden lg:block",children:(0,ht.jsx)(Ga,{value:e,onValueChange:t,children:(0,ht.jsx)(Wa,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:l,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(n=>(0,ht.jsx)(At.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,ht.jsx)(qa,{value:n.value,className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:n.label})},n.value))})})}),(0,ht.jsx)("div",{className:"lg:hidden",children:(0,ht.jsxs)($a,{children:[(0,ht.jsx)(Ka,{asChild:!0,children:(0,ht.jsxs)(D,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[s?.label||"Select",(0,ht.jsx)(va.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,ht.jsx)(Kt,{align:"center",className:"w-[180px]",children:a.map(n=>(0,ht.jsx)(_t,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function Xa({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:l=!0,className:r,activeTab:s="assistant",onTabChange:n,showTabs:p=!0,tabOptions:u=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:k,actionIcon:f=(0,ht.jsx)(va.Bot,{className:"mr-2 h-4 w-4"}),actionText:y="Action",onNotificationRemove:T,onRemoveAll:U,logo:R="/headerlogo.png",appName:x="Nuvia",tagline:S="Collaboration Platform"}){let[F,w]=(0,Ze.useState)(!1),[E,Y]=(0,Ze.useState)(t),Z=E.filter(W=>!W.read).length,ee=W=>{Y(oe=>oe.filter(se=>se.id!==W)),T?.(W)},Q=()=>{Y(W=>W.filter(oe=>oe.read)),U?.()};return(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsxs)("header",{className:`sticky top-0 va-10 flex h-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${r||""}`,children:[(0,ht.jsx)(D,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,ht.jsx)(va.Menu,{className:"h-5 w-5"})}),(0,ht.jsx)(D,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,ht.jsx)(va.PanelLeft,{className:"h-5 w-5"})}),!l&&(0,ht.jsxs)(At.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,ht.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,ht.jsx)("img",{src:R,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,ht.jsxs)("div",{children:[(0,ht.jsx)("h2",{className:"font-semibold text-sm",children:x}),(0,ht.jsx)("p",{className:"text-xs text-muted-foreground",children:S})]})]}),(0,ht.jsxs)("div",{className:"flex flex-1 items-center",children:[p&&(0,ht.jsx)(Ja,{activeTab:s,onTabChange:n,tabOptions:u}),(0,ht.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,ht.jsx)(At.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,ht.jsx)(At.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ht.jsxs)(D,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:k,children:[f,y]})})}),(0,ht.jsx)(Oa,{}),(0,ht.jsx)(et,{children:(0,ht.jsxs)(tt,{children:[(0,ht.jsx)(at,{asChild:!0,children:(0,ht.jsx)(At.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ht.jsxs)(D,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>w(!0),children:[(0,ht.jsx)(At.motion.div,{animate:Z>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:Z>0?1/0:0,repeatDelay:3},children:(0,ht.jsx)(va.Bell,{className:"h-5 w-5"})}),Z>0&&(0,ht.jsx)(At.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:Z})]})})}),(0,ht.jsx)(Ke,{children:"Notifications"})]})}),(0,ht.jsx)(At.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ht.jsxs)(Ge,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,ht.jsx)(Et,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,ht.jsx)(We,{})]})})]})]})]}),(0,ht.jsx)(Va,{notifications:E,open:F,onClose:()=>w(!1),onNotificationRemove:ee,onRemoveAll:Q})]})}var Qa=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,ht.jsx)(va.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Za({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:l=Qa[0],onBusinessUnitChange:r,onSearch:s,businessUnits:n=Qa,activeTab:p,onTabChange:u,showTabs:k=!1,onActionClick:f,actionIcon:y,actionText:T="Action",onNotificationRemove:U,onRemoveAll:R,logo:x="/headerlogo.png",appName:S="Nuvia",tagline:F="Collaboration Platform",sidebarInitiallyClosed:w=!1}){let[E,Y]=(0,Ze.useState)(!w),[Z,ee]=(0,Ze.useState)(!1),[Q,W]=(0,Ze.useState)(l),oe=se=>{W(se),r?.(se)};return(0,ht.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[Z&&(0,ht.jsx)("div",{className:"fixed inset-0 va-40 bg-black/50 md:hidden",onClick:()=>ee(!1)}),(0,ht.jsx)("div",{className:"md:hidden",children:(0,ht.jsx)(qt,{items:e,isOpen:Z,isMobile:!0,onClose:()=>ee(!1),currentBusinessUnit:Q,onBusinessUnitChange:oe,onSearch:s,logo:x,appName:S,tagline:F})}),(0,ht.jsx)("div",{className:"hidden md:block",children:(0,ht.jsx)(qt,{items:e,isOpen:E,isMobile:!1,currentBusinessUnit:Q,onBusinessUnitChange:oe,onSearch:s,logo:x,appName:S,tagline:F})}),(0,ht.jsxs)("div",{className:c("min-h-screen fixed w-full transition-all duration-300 ease-in-out",E?"md:pl-64":"md:pl-0"),children:[(0,ht.jsx)(Xa,{title:a,notifications:o,onToggleSidebar:()=>Y(!E),onToggleMobileMenu:()=>ee(!0),sidebarOpen:E,activeTab:p,onTabChange:u,showTabs:k,onActionClick:f,actionIcon:y,actionText:T,onNotificationRemove:U,onRemoveAll:R,logo:x,appName:S,tagline:F}),(0,ht.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}function eo({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:l,onSessionEdit:r,onSessionDelete:s,className:n}){return(0,ht.jsx)(et,{children:(0,ht.jsx)("div",{className:`space-y-4 h-full ${n||""}`,children:(0,ht.jsxs)(me,{className:"shadow-sm h-full",children:[(0,ht.jsx)("div",{className:"p-4 border-ht",children:(0,ht.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ht.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,ht.jsx)(va.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,ht.jsxs)(D,{onClick:o,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,ht.jsx)(va.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,ht.jsx)(we,{className:"h-[600px]",children:(0,ht.jsx)("div",{className:"p-2",children:e.length===0?(0,ht.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(p=>(0,ht.jsxs)(tt,{children:[(0,ht.jsx)(at,{asChild:!0,children:(0,ht.jsx)("div",{className:c("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===p.id&&"bg-muted border"),onClick:()=>l(p),children:(0,ht.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,ht.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,ht.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:p.title}),(0,ht.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:p.lastMessage})]}),(0,ht.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[r&&(0,ht.jsx)(D,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:u=>{u.stopPropagation(),r(p.id)},children:(0,ht.jsx)(va.Edit3,{className:"h-3 w-3"})}),s&&(0,ht.jsx)(D,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:u=>{u.stopPropagation(),s(p.id)},children:(0,ht.jsx)(va.Trash2,{className:"h-3 w-3"})})]})]})})}),(0,ht.jsx)(Ke,{side:"right",className:"max-w-xs",children:(0,ht.jsxs)("div",{className:"space-y-1",children:[(0,ht.jsx)("p",{className:"font-medium text-sm",children:p.title}),(0,ht.jsx)("p",{className:"text-xs",children:p.lastMessage})]})})]},p.id))})})]})})})}var Xe=G(require("motion/react-client"));function to({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:l,colorScheme:r=wa,className:s}){let[n,p]=(0,Ze.useState)([]),[u,k]=(0,Ze.useState)([]),f=n[n.length-1],y=f?.children||e,T=(w,E)=>{switch(w.type){case"category":return r.categories[E%r.categories.length];case"list":return r.lists[E%r.lists.length];case"item":return r.items[E%r.items.length];default:return r.primary}},U=(0,Ze.useMemo)(()=>({path:n,selectedItems:u,filters:{}}),[n,u]);(0,Ze.useEffect)(()=>{l&&l(U)},[U,l]);let R=w=>{w.type==="category"||w.type==="list"?p([...n,w]):w.type==="item"&&k([...u,w])},x=()=>{p(n.slice(0,-1))},S=w=>{p(n.slice(0,w+1))},F=()=>f?.actions?f.actions:[];return t?(0,ht.jsxs)("div",{className:c("w-full",s),children:[(0,ht.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,ht.jsxs)("div",{className:"flex items-center gap-2",children:[n.length>0&&(0,ht.jsx)(At.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:c("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,ht.jsx)(va.ChevronLeft,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,ht.jsx)("h4",{className:"font-medium text-sm",children:f?.name||"Capabilities"})]}),(0,ht.jsx)(At.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:a,className:c("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,ht.jsx)(va.ht,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),n.length>0&&(0,ht.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,ht.jsx)(At.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>p([]),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,ht.jsxs)("span",{className:"relative",children:["Capabilities",(0,ht.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"})]})}),n.map((w,E)=>(0,ht.jsxs)("div",{className:"flex items-center gap-1",children:[(0,ht.jsx)(va.ChevronRight,{className:"h-2 w-2"}),(0,ht.jsx)(At.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>S(E),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,ht.jsxs)("span",{className:"relative",children:[w.name,(0,ht.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"})]})})]},w.id))]}),(0,ht.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,ht.jsx)(At.AnimatePresence,{mode:"wait",children:(0,ht.jsx)(At.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:f?.type==="list"&&f.data?(0,ht.jsx)(Ai,{data:f.data,onItemSelect:w=>k([...u,w]),colorScheme:r}):(0,ht.jsx)(Ri,{capabilities:y,onSelect:R,colorScheme:r})},f?.id||"root")})})]}):(0,ht.jsxs)(D,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,ht.jsx)(va.Menu,{className:"h-4 w-4"}),(0,ht.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function Ri({capabilities:e,onSelect:t,colorScheme:a}){return(0,ht.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,l)=>(0,ht.jsx)(Si,{capability:o,onClick:()=>t(o),color:a.categories[l%a.categories.length]},o.id))})}function Si({capability:e,onClick:t,selected:a,color:o}){return(0,ht.jsxs)(At.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:c("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",a&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,ht.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,ht.jsxs)("span",{className:"truncate relative",children:[e.name,(0,ht.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,ht.jsx)(va.ChevronRight,{className:c("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,ht.jsx)(de,{variant:"secondary",className:c("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 Ai({data:e,onItemSelect:t,colorScheme:a}){return(0,ht.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,l)=>(0,ht.jsxs)(At.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:c("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,ht.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[l%a.items.length])}),(0,ht.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ht.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,ht.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,ht.jsx)("div",{className:c("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,ht.jsx)(de,{variant:"secondary",className:c("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 oo=G(require("react"));var ao=({isOpen:e=!0,authUrl:t,onClose:a,onSuccess:o,description:l="This endpoint requires authentication to sync functions."})=>{let[r,s]=(0,Ze.useState)(!1),[n,p]=(0,Ze.useState)(""),u=()=>{if(!t){p("No authentication URL provided");return}s(!0),p("");try{let f=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!f){p("Popup blocked. Please allow popups for this site and try again."),s(!1);return}let y=setInterval(()=>{try{f.closed&&(clearInterval(y),s(!1),o(),a())}catch{}},1e3);setTimeout(()=>{f.closed||(f.close(),clearInterval(y),s(!1),p("Authentication timed out. Please try again."))},6e5)}catch{p("Failed to open authentication window"),s(!1)}},k=async()=>{try{await navigator.clipboard.writeText(t),p("")}catch{p("Failed to copy URL to clipboard")}};return e?(0,ht.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center va-[1000]",children:(0,ht.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,ht.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,ht.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:l}),n&&(0,ht.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:n}),(0,ht.jsxs)("div",{className:"flex gap-2",children:[(0,ht.jsx)("button",{onClick:u,disabled:r||!t,className:`
|
|
6
|
+
"use strict";var Wa=Object.create;var yt=Object.defineProperty;var $a=Object.getOwnPropertyDescriptor;var qa=Object.getOwnPropertyNames;var Ka=Object.getPrototypeOf,_a=Object.prototype.hasOwnProperty;var Ja=(e,t)=>{for(var o in t)yt(e,o,{get:t[o],enumerable:!0})},go=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of qa(t))!_a.call(e,s)&&s!==o&&yt(e,s,{get:()=>t[s],enumerable:!(a=$a(t,s))||a.enumerable});return e};var G=(e,t,o)=>(o=e!=null?Wa(Ka(e)):{},go(t||!e||!e.__esModule?yt(o,"default",{value:e,enumerable:!0}):o,e)),Xa=e=>go(yt({},"__esModule",{value:!0}),e);var er={};Ja(er,{ExampleChatInterface:()=>Zi});module.exports=Xa(er);var xt=G(require("react")),Me=G(require("@radix-ui/react-avatar"));var No=require("clsx");var Ft="-",Qa=e=>{let t=Za(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{let n=l.split(Ft);return n[0]===""&&n.length!==1&&n.shift(),vo(n,t)||Ya(l)},getConflictingClassGroupIds:(l,n)=>{let p=o[l]||[];return n&&a[l]?[...p,...a[l]]:p}}},vo=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),s=a?vo(e.slice(1),a):void 0;if(s)return s;if(t.validators.length===0)return;let i=e.join(Ft);return t.validators.find(({validator:l})=>l(i))?.classGroupId},fo=/^\[(.+)\]$/,Ya=e=>{if(fo.test(e)){let t=fo.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Za=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return ti(Object.entries(e.classGroups),o).forEach(([i,l])=>{Ut(l,a,i,t)}),a},Ut=(e,t,o,a)=>{e.forEach(s=>{if(typeof s=="string"){let i=s===""?t:bo(t,s);i.classGroupId=o;return}if(typeof s=="function"){if(ei(s)){Ut(s(a),t,o,a);return}t.validators.push({validator:s,classGroupId:o});return}Object.entries(s).forEach(([i,l])=>{Ut(l,bo(t,i),o,a)})})},bo=(e,t)=>{let o=e;return t.split(Ft).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},ei=e=>e.isThemeGetter,ti=(e,t)=>t?e.map(([o,a])=>{let s=a.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,n])=>[t+l,n])):i);return[o,s]}):e,oi=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,s=(i,l)=>{o.set(i,l),t++,t>e&&(t=0,a=o,o=new Map)};return{get(i){let l=o.get(i);if(l!==void 0)return l;if((l=a.get(i))!==void 0)return s(i,l),l},set(i,l){o.has(i)?o.set(i,l):s(i,l)}}},ho="!",ai=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,s=t[0],i=t.length,l=n=>{let p=[],u=0,w=0,f;for(let x=0;x<n.length;x++){let P=n[x];if(u===0){if(P===s&&(a||n.slice(x,x+i)===t)){p.push(n.slice(w,x)),w=x+i;continue}if(P==="/"){f=x;continue}}P==="["?u++:P==="]"&&u--}let h=p.length===0?n:n.substring(w),T=h.startsWith(ho),M=T?h.substring(1):h,R=f&&f>w?f-w:void 0;return{modifiers:p,hasImportantModifier:T,baseClassName:M,maybePostfixModifierPosition:R}};return o?n=>o({className:n,parseClassName:l}):l},ii=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},ri=e=>({cache:oi(e.cacheSize),parseClassName:ai(e),...Qa(e)}),ni=/\s+/,si=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:s}=t,i=[],l=e.trim().split(ni),n="";for(let p=l.length-1;p>=0;p-=1){let u=l[p],{modifiers:w,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:T}=o(u),M=!!T,R=a(M?h.substring(0,T):h);if(!R){if(!M){n=u+(n.length>0?" "+n:n);continue}if(R=a(h),!R){n=u+(n.length>0?" "+n:n);continue}M=!1}let x=ii(w).join(":"),P=f?x+ho:x,F=P+R;if(i.includes(F))continue;i.push(F);let C=s(R,M);for(let z=0;z<C.length;++z){let Y=C[z];i.push(P+Y)}n=u+(n.length>0?" "+n:n)}return n};function li(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=yo(t))&&(a&&(a+=" "),a+=o);return a}var yo=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=yo(e[a]))&&(o&&(o+=" "),o+=t);return o};function ci(e,...t){let o,a,s,i=l;function l(p){let u=t.reduce((w,f)=>f(w),e());return o=ri(u),a=o.cache.get,s=o.cache.set,i=n,n(p)}function n(p){let u=a(p);if(u)return u;let w=si(p,o);return s(p,w),w}return function(){return i(li.apply(null,arguments))}}var H=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},xo=/^\[(?:([a-z-]+):)?(.+)\]$/i,di=/^\d+\/\d+$/,pi=new Set(["px","full","screen"]),mi=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ui=/\d+(%|px|wt?em|[sdl]?wt([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|wt?lh|cq(w|h|i|wt|min|max))|\wt(calc|min|max|clamp)\(.+\)|^0$/,gi=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,fi=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bi=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ae=e=>Ze(e)||pi.has(e)||di.test(e),Fe=e=>et(e,"length",ki),Ze=e=>!!e&&!Number.isNaN(Number(e)),zt=e=>et(e,"number",Ze),ct=e=>!!e&&Number.isInteger(Number(e)),vi=e=>e.endsWith("%")&&Ze(e.slice(0,-1)),y=e=>xo.test(e),je=e=>mi.test(e),hi=new Set(["length","size","percentage"]),yi=e=>et(e,hi,wo),xi=e=>et(e,"position",wo),wi=new Set(["image","url"]),Ci=e=>et(e,wi,Di),Ni=e=>et(e,"",Pi),dt=()=>!0,et=(e,t,o)=>{let a=xo.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},ki=e=>ui.test(e)&&!gi.test(e),wo=()=>!1,Pi=e=>fi.test(e),Di=e=>bi.test(e);var Ri=()=>{let e=H("colors"),t=H("spacing"),o=H("blur"),a=H("brightness"),s=H("borderColor"),i=H("borderRadius"),l=H("borderSpacing"),n=H("borderWidth"),p=H("contrast"),u=H("grayscale"),w=H("hueRotate"),f=H("invert"),h=H("gap"),T=H("gradientColorStops"),M=H("gradientColorStopPositions"),R=H("inset"),x=H("margin"),P=H("opacity"),F=H("padding"),C=H("saturate"),z=H("scale"),Y=H("sepia"),Z=H("skew"),ee=H("space"),Q=H("translate"),W=()=>["auto","contain","none"],ae=()=>["auto","hidden","clip","visible","scroll"],le=()=>["auto",y,t],I=()=>[y,t],Te=()=>["",Ae,Fe],d=()=>["auto",Ze,y],E=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],m=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",y],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>[Ze,y];return{cacheSize:500,separator:":",theme:{colors:[dt],spacing:[Ae,Fe],blur:["none","",je,y],brightness:S(),borderColor:[e],borderRadius:["none","","full",je,y],borderSpacing:I(),borderWidth:Te(),contrast:S(),grayscale:j(),hueRotate:S(),invert:j(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[vi,Fe],inset:le(),margin:le(),opacity:S(),padding:I(),saturate:S(),scale:S(),sepia:j(),skew:S(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",y]}],container:["container"],columns:[{columns:[je]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"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:[...E(),y]}],overflow:[{overflow:ae()}],"overflow-x":[{"overflow-x":ae()}],"overflow-y":[{"overflow-y":ae()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[R]}],"inset-x":[{"inset-x":[R]}],"inset-y":[{"inset-y":[R]}],start:[{start:[R]}],end:[{end:[R]}],top:[{top:[R]}],right:[{right:[R]}],bottom:[{bottom:[R]}],left:[{left:[R]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ct,y]}],basis:[{basis:le()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",y]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",ct,y]}],"grid-cols":[{"grid-cols":[dt]}],"col-start-end":[{col:["auto",{span:["full",ct,y]},y]}],"col-start":[{"col-start":d()}],"col-end":[{"col-end":d()}],"grid-rows":[{"grid-rows":[dt]}],"row-start-end":[{row:["auto",{span:[ct,y]},y]}],"row-start":[{"row-start":d()}],"row-end":[{"row-end":d()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",y]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",y]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...m()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...m(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...m(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[F]}],px:[{px:[F]}],py:[{py:[F]}],ps:[{ps:[F]}],pe:[{pe:[F]}],pt:[{pt:[F]}],pr:[{pr:[F]}],pb:[{pb:[F]}],pl:[{pl:[F]}],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":[ee]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ee]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",y,t]}],"min-w":[{"min-w":[y,t,"min","max","fit"]}],"max-w":[{"max-w":[y,t,"none","full","min","max","fit","prose",{screen:[je]},je]}],h:[{h:[y,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[y,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[y,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[y,t,"auto","min","max","fit"]}],"font-size":[{text:["base",je,Fe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",zt]}],"font-family":[{font:[dt]}],"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",y]}],"line-clamp":[{"line-clamp":["none",Ze,zt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ae,y]}],"list-image":[{"list-image":["none",y]}],"list-style-type":[{list:["none","disc","decimal",y]}],"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:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ae,Fe]}],"underline-offset":[{"underline-offset":["auto",Ae,y]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",y]}],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",y]}],"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:[...E(),xi]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",yi]}],"bg-image":[{bg:["none",{"gradient-tt":["t","tr","wt","br","wt","bl","l","tl"]},Ci]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[M]}],"gradient-via-pos":[{via:[M]}],"gradient-tt-pos":[{tt:[M]}],"gradient-from":[{from:[T]}],"gradient-via":[{via:[T]}],"gradient-tt":[{tt:[T]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-wt":[{"rounded-wt":[i]}],"rounded-wt":[{"rounded-wt":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-wt":[{"rounded-wt":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[n]}],"border-w-x":[{"border-x":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-wt":[{"border-wt":[n]}],"border-w-wt":[{"border-wt":[n]}],"border-w-l":[{"border-l":[n]}],"border-opacity":[{"border-opacity":[P]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[P]}],"divide-style":[{divide:B()}],"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-wt":[{"border-wt":[s]}],"border-color-wt":[{"border-wt":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[Ae,y]}],"outline-w":[{outline:[Ae,Fe]}],"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":[Ae,Fe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",je,Ni]}],"shadow-color":[{shadow:[dt]}],opacity:[{opacity:[P]}],"mix-blend":[{"mix-blend":[...q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",je,y]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[w]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[Y]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[w]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[P]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[Y]}],"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",y]}],duration:[{duration:S()}],ease:[{ease:["linear","in","out","in-out",y]}],delay:[{delay:S()}],animate:[{animate:["none","spin","ping","pulse","bounce",y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-y":[{"scale-y":[z]}],rotate:[{rotate:[ct,y]}],"translate-x":[{"translate-x":[Q]}],"translate-y":[{"translate-y":[Q]}],"skew-x":[{"skew-x":[Z]}],"skew-y":[{"skew-y":[Z]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",y]}],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","wt-resize","nw-resize","wt-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",y]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","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",y]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ae,Fe,zt]}],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-wt","rounded-wt","rounded-l","rounded-ss","rounded-wt","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-wt","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-wt":["rounded-tr","rounded-br"],"rounded-wt":["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-wt","border-w-wt","border-w-l"],"border-w-x":["border-w-wt","border-w-l"],"border-w-y":["border-w-t","border-w-wt"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-wt","border-color-wt","border-color-l"],"border-color-x":["border-color-wt","border-color-l"],"border-color-y":["border-color-t","border-color-wt"],"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 Co=ci(Ri);function c(...e){return Co((0,No.clsx)(e))}var wt=require("react/jsx-runtime"),$e=xt.forwardRef(({className:e,...t},o)=>(0,wt.jsx)(Me.Root,{ref:o,className:c("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));$e.displayName=Me.Root.displayName;var jt=xt.forwardRef(({className:e,...t},o)=>(0,wt.jsx)(Me.Image,{ref:o,className:c("aspect-square h-full w-full",e),...t}));jt.displayName=Me.Image.displayName;var qe=xt.forwardRef(({className:e,...t},o)=>(0,wt.jsx)(Me.Fallback,{ref:o,className:c("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));qe.displayName=Me.Fallback.displayName;var Ke=G(require("react"));var ge=Ke.forwardRef(({className:e,...t},o)=>(0,wt.jsx)("div",{ref:o,className:c("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ge.displayName="Card";var Ie=Ke.forwardRef(({className:e,...t},o)=>(0,wt.jsx)("div",{ref:o,className:c("flex flex-col space-y-1.5 p-6",e),...t}));Ie.displayName="CardHeader";var Be=Ke.forwardRef(({className:e,...t},o)=>(0,wt.jsx)("div",{ref:o,className:c("font-semibold leading-none tracking-tight",e),...t}));Be.displayName="CardTitle";var Ot=Ke.forwardRef(({className:e,...t},o)=>(0,wt.jsx)("div",{ref:o,className:c("text-sm text-muted-foreground",e),...t}));Ot.displayName="CardDescription";var Ce=Ke.forwardRef(({className:e,...t},o)=>(0,wt.jsx)("div",{ref:o,className:c("p-6 pt-0",e),...t}));Ce.displayName="CardContent";var pt=Ke.forwardRef(({className:e,...t},o)=>(0,wt.jsx)("div",{ref:o,className:c("flex items-center p-6 pt-0",e),...t}));pt.displayName="CardFooter";var ko=require("class-variance-authority");var Ti=(0,ko.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 me({className:e,variant:t,...o}){return(0,wt.jsx)("div",{className:c(Ti({variant:t}),e),...o})}var Ro=require("lucide-react"),To=require("date-fns");var tt=require("react");function Do({taskId:e,polling:t=!0,system:o="payload"}){let[a,s]=(0,tt.useState)(null),[i,l]=(0,tt.useState)(!1),[n,p]=(0,tt.useState)(null),u=async(f=!0)=>{if(e){f&&l(!0);try{let h=await fetch(`/api/tasks/${e}`);if(!h.ok)throw new Error(`Failed tt fetch task: ${h.statusText}`);let T=await h.json();s(T)}catch(h){console.error("Error fetching task:",h),p(h instanceof Error?h:new Error("Unknown error occurred"))}finally{f&&l(!1)}}},w=()=>u(!1);return(0,tt.useEffect)(()=>{e&&u(!0);let f=null;return e&&t&&(f=setInterval(w,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:a,loading:i,error:n}}var Si=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"}},Ai=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function So({data:e}){let{id:t,system:o,fetchLatest:a,taskData:s,error:i}=e||{};if(!t)return null;let l=null,n=!0,p=i,u=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:u,taskData:l,error:p}),u){let{task:T,loading:M,error:R}=Do({taskId:t,system:o});l=T,n=M,p=R}else n=!1;let w=Si(l?.status||"todo"),f=Ai(l?.status||"todo"),h=l?.dateLogged||new Date().toISOString();try{let T=new Date(l?.dateLogged||"");isNaN(T.getTime())||(h=(0,To.formatDistanceToNow)(T,{addSuffix:!0}))}catch{}return(0,wt.jsxs)(ge,{className:c("w-full max-w-md shadow-md",p&&"border border-destructive"),children:[(0,wt.jsxs)(Ie,{className:"pb-2",children:[(0,wt.jsxs)("div",{className:"flex justify-between items-start",children:[(0,wt.jsx)(Be,{className:"text-lg font-semibold",children:n?"Loading...":l?.name||"Task"}),(0,wt.jsx)(me,{className:`${w}`,children:f})]}),l?.project&&(0,wt.jsxs)(Ot,{className:"text-sm text-gray-500",children:["Project: ",l.project.name]})]}),(0,wt.jsx)(Ce,{className:"pb-2",children:n?(0,wt.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):p?(0,wt.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,wt.jsx)("p",{className:"text-sm text-foreground",children:l?.description||"......."})}),(0,wt.jsx)(pt,{className:"pt-2 flex items-center justify-between",children:(0,wt.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,wt.jsx)(Ro.Clock,{className:"h-3 w-3 mr-1"}),(0,wt.jsxs)("span",{children:["Created ",h]}),(0,wt.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,wt.jsxs)("span",{children:["Task #",t]})]})})]})}var Ht=G(require("react")),fe=G(require("@radix-ui/react-scroll-area"));var Ne=Ht.forwardRef(({className:e,children:t,...o},a)=>(0,wt.jsxs)(fe.Root,{ref:a,className:c("relative overflow-hidden",e),...o,children:[(0,wt.jsx)(fe.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,wt.jsx)(Ao,{}),(0,wt.jsx)(fe.Corner,{})]}));Ne.displayName=fe.Root.displayName;var Ao=Ht.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,wt.jsx)(fe.ScrollAreaScrollbar,{ref:a,orientation:t,className:c("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,wt.jsx)(fe.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Ao.displayName=fe.ScrollAreaScrollbar.displayName;var Mo={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 Vt(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function Lo({artefact:e,taskId:t,taskData:o,loading:a=!1,error:s=null}){let i=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},l=i.dateLogged;try{let n=new Date(i.dateLogged);isNaN(n.getTime())||(l=(0,To.formatDistanceToNow)(n,{addSuffix:!0}))}catch{}return(0,wt.jsxs)(ge,{className:"w-full max-w-md shadow-md",children:[(0,wt.jsx)(Ie,{className:"pb-2",children:(0,wt.jsx)("div",{className:"flex justify-between items-start",children:(0,wt.jsx)(Be,{className:"text-lg font-semibold",children:a?"Loading...":i.name})})}),(0,wt.jsx)(Ce,{className:"pb-2",children:a?(0,wt.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):s?(0,wt.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,wt.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,wt.jsx)(pt,{className:"pt-2 flex items-center justify-between",children:(0,wt.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,wt.jsx)(Ro.Clock,{className:"h-3 w-3 mr-1"}),(0,wt.jsxs)("span",{children:["Created ",l]}),(0,wt.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,wt.jsxs)("span",{children:["Task #",i.id]})]})})]})}var Ta=require("@ai-sdk/react"),Lt=require("motion/react");var St=G(require("react")),_t=G(require("next/link"));var Eo=require("@radix-ui/react-slot"),Uo=G(require("react")),Mi=(0,ko.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"}}}),A=Uo.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...s},i)=>(0,wt.jsx)(e?Eo.Slot:"button",{className:c(Mi({className:t,size:o,variant:a})),ref:i,...s}));A.displayName="Button";var jo=G(require("react"));var mt=jo.forwardRef(({className:e,type:t,...o},a)=>(0,wt.jsx)("input",{type:t,className:c("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}));mt.displayName="Input";var ut=G(require("react")),_=G(require("@radix-ui/react-dialog"));var Vo=_.Root;var Ii=_.Portal;var Go=ut.forwardRef(({className:e,...t},o)=>(0,wt.jsx)(_.Overlay,{ref:o,className:c("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Go.displayName=_.Overlay.displayName;var Gt=ut.forwardRef(({className:e,children:t,...o},a)=>(0,wt.jsxs)(Ii,{children:[(0,wt.jsx)(Go,{}),(0,wt.jsxs)(_.Content,{ref:a,className:c("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-tt-left-1/2 data-[state=closed]:slide-out-tt-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,wt.jsxs)(_.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,wt.jsx)(Ro.wt,{className:"h-4 w-4"}),(0,wt.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Gt.displayName=_.Content.displayName;var Wt=({className:e,...t})=>(0,wt.jsx)("div",{className:c("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Wt.displayName="DialogHeader";var Bi=({className:e,...t})=>(0,wt.jsx)("div",{className:c("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Bi.displayName="DialogFooter";var $t=ut.forwardRef(({className:e,...t},o)=>(0,wt.jsx)(_.Title,{ref:o,className:c("text-lg font-semibold leading-none tracking-tight",e),...t}));$t.displayName=_.Title.displayName;var Li=ut.forwardRef(({className:e,...t},o)=>(0,wt.jsx)(_.Description,{ref:o,className:c("text-sm text-muted-foreground",e),...t}));Li.displayName=_.Description.displayName;var gt=G(require("@radix-ui/react-checkbox")),$o=G(require("react")),qt=$o.forwardRef(({className:e,...t},o)=>(0,wt.jsx)(gt.Root,{className:c("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,wt.jsx)(gt.Indicator,{className:c("flex items-center justify-center text-current"),children:(0,wt.jsx)(Ro.Check,{className:"h-4 w-4"})})}));qt.displayName=gt.Root.displayName;var ke=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var Ko=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,wt.jsx)(Ro.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,wt.jsx)(Ro.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,wt.jsx)(Ro.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,wt.jsx)(Ro.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,wt.jsx)(Ro.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,wt.jsx)(Ro.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,wt.jsx)(Ro.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,wt.jsx)(Ro.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,wt.jsx)(Ro.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,wt.jsx)(Ro.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Pt=[{id:"1",name:"E-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var Kt=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],Nt=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned tt a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],Rt=[{id:"1",name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],Ei=[...Rt,{id:"8",name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],zi=[...Pt,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],kt={projects:[{id:"1",name:"Empty Project",description:"A project with no tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},qo={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:Rt.filter(e=>e.epicId==="1")};var Vr={empty:{initialProjects:kt.projects,initialEpics:kt.epics,initialSprints:kt.sprints,initialTasks:kt.tasks},default:{initialProjects:Pt,initialEpics:Kt,initialSprints:Nt,initialTasks:Rt},highDensity:{initialProjects:Pt,initialEpics:Kt,initialSprints:Nt,initialTasks:Ei},singleEpic:{initialProjects:Pt,initialEpics:qo.epics,initialSprints:Nt,initialTasks:qo.tasks},multipleProjects:{initialProjects:zi,initialEpics:Kt,initialSprints:Nt,initialTasks:Rt}},Dt=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.js","Python","Git"].map(ke),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(ke),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused on driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(ke),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(ke),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated tt understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","R","Statistics"].map(ke),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(ke),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(ke),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(ke),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond tt customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases tt human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(ke),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(ke),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],Gr=[{id:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:Dt.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:Dt.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy tt production",description:"Deploy the latest version tt production environment",dueDate:new Date,dueTime:"16:00",colleague:Dt.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var Wr=Dt.filter(e=>e.type==="digital");function _o(e,t){let[o,a]=(0,tt.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch{return t}}),s=i=>{try{a(i),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(i))}catch{}};return(0,tt.useEffect)(()=>{s(o)},[]),[o,s]}function Jt({items:e,isOpen:t,isMobile:o=!1,onClose:a,currentBusinessUnit:s=Ko[0],onBusinessUnitChange:i,onSearch:l,className:n,logo:p="/headerlogo.png",appName:u="Nuvia",tagline:w="Collaboration Platform"}){let[f,h]=St.useState({}),[T,M]=_o("sidebar-favorites",{}),[R,x]=St.useState(null),[P,F]=St.useState(""),C=d=>{h(E=>({...E,[d]:!E[d]}))},z=d=>{i?.(d)},Y=()=>{P.trim()&&l?.(P.trim())},Z=d=>{d.key==="Enter"&&(d.preventDefault(),Y())},ee=(d,E)=>{let B=T[d]||[],q=B.includes(E)?B.filter(m=>m!==E):B.concat(E);M({...T,[d]:q})},Q=d=>{if(!d.items||!d.maxItems||d.items.length<=d.maxItems)return d.items||[];let E=T[d.id]||[],B=d.items.filter(m=>E.includes(m.id)),q=d.items.filter(m=>!E.includes(m.id));return[...B,...q].slice(0,d.maxItems)},W=d=>d.maxItems&&d.items&&d.items.length>d.maxItems,ae=e,le=d=>{let E=W(d),B=Q(d),q=(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsxs)("div",{className:"flex items-center gap-3",children:[d.icon,(0,wt.jsx)("span",{children:d.title})]}),d.badge&&(0,wt.jsx)(me,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:d.badge}),d.items&&(0,wt.jsx)(Ro.ChevronDown,{className:c("ml-2 h-4 w-4 transition-transform",f[d.title]?"rotate-180":"")})]}),m=c("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",d.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return d.url?(0,wt.jsx)(_t.default,{href:d.url,className:m,onClick:o?a:void 0,children:q}):(0,wt.jsx)("button",{className:m,onClick:()=>d.items&&C(d.title),children:q})},I=()=>{let d=e.find(B=>B.id===R);if(!d||!d.items||!d.maxItems)return null;let E=T[d.id]||[];return(0,wt.jsx)(Vo,{open:!!R,onOpenChange:B=>!B&&x(null),children:(0,wt.jsxs)(Gt,{className:"sm:max-w-md",children:[(0,wt.jsxs)(Wt,{children:[(0,wt.jsxs)($t,{children:["Manage ",d.title," Favorites"]}),(0,wt.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up tt ",d.maxItems," items tt show in ",d.title.toLowerCase(),"."]})]}),(0,wt.jsx)(Ne,{className:"max-h-96 pr-4",children:(0,wt.jsx)("div",{className:"space-y-4",children:d.items.map(B=>(0,wt.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,wt.jsx)(qt,{id:B.id,checked:E.includes(B.id),onCheckedChange:()=>ee(d.id,B.id),disabled:!E.includes(B.id)&&E.length>=(d.maxItems||0)}),(0,wt.jsxs)("label",{htmlFor:B.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[B.title,B.badge&&(0,wt.jsx)(me,{variant:"outline",className:"text-xs",children:B.badge})]})]},B.id))})})]})})},Te=(0,wt.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,wt.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,wt.jsxs)("div",{className:"flex items-center gap-3",children:[(0,wt.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,wt.jsx)("img",{src:p,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,wt.jsxs)("div",{children:[(0,wt.jsx)("h2",{className:"font-semibold",children:u}),(0,wt.jsx)("p",{className:"text-xs text-muted-foreground",children:w})]})]}),o&&(0,wt.jsx)(A,{variant:"ghost",size:"icon",onClick:a,children:(0,wt.jsx)(Ro.wt,{className:"h-5 w-5"})})]}),(0,wt.jsx)("div",{className:"px-3 py-2",children:(0,wt.jsxs)("div",{className:"relative",children:[(0,wt.jsx)(Ro.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,wt.jsx)(mt,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:P,onChange:d=>F(d.target.value),onKeyPress:Z})]})}),(0,wt.jsx)(Ne,{className:"flex-1 px-3 py-2",children:(0,wt.jsx)("div",{className:"space-y-1",children:ae.map(d=>(0,wt.jsxs)("div",{className:"mb-1",children:[le(d),d.items&&f[d.title]&&(0,wt.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[Q(d).map(E=>(0,wt.jsxs)(_t.default,{href:E.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:o?a:void 0,children:[E.title,E.badge&&(0,wt.jsx)(me,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:E.badge})]},E.id)),W(d)&&d.items&&d.items.length>Q(d).length&&(0,wt.jsxs)("button",{onClick:()=>x(d.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",d.items.length-Q(d).length," more available"]})]})]},d.id))})}),(0,wt.jsx)("div",{className:"p-3",children:(0,wt.jsx)("div",{className:"space-y-1",children:(0,wt.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,wt.jsx)(Ro.Settings,{className:"h-5 w-5"}),(0,wt.jsx)("span",{children:"Settings"})]})})}),(0,wt.jsx)(I,{})]});return o?(0,wt.jsx)("div",{className:c("fixed inset-y-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",n),children:Te}):(0,wt.jsx)("div",{className:c("fixed inset-y-0 left-0 z-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",n),children:Te})}var Jo=G(require("react")),he=G(require("@radix-ui/react-tooltip"));var ot=he.Provider,at=he.Root,it=he.Trigger,Je=Jo.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,wt.jsx)(he.Portal,{children:(0,wt.jsx)(he.Content,{ref:a,sideOffset:t,className:c("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Je.displayName=he.Content.displayName;var Xo=require("next-themes");function Qo(){let{setTheme:e,theme:t}=(0,Xo.useTheme)();return(0,wt.jsx)(ot,{children:(0,wt.jsxs)(at,{children:[(0,wt.jsx)(it,{asChild:!0,children:(0,wt.jsxs)(A,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,wt.jsx)(Ro.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,wt.jsx)(Ro.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,wt.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,wt.jsx)(Je,{children:"Toggle theme"})]})})}function Yo({notifications:e,open:t,onClose:o,onNotificationRemove:a,onRemoveAll:s,className:i}){let l=e.filter(u=>!u.read),n=l.length,p=u=>{switch(u){case"info":return(0,wt.jsx)(Ro.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,wt.jsx)(Ro.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,wt.jsx)(Ro.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,wt.jsx)(Ro.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,wt.jsx)(Lt.AnimatePresence,{children:t&&(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(Lt.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:o}),(0,wt.jsx)(Lt.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:c("fixed inset-y-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",i),children:(0,wt.jsxs)("div",{className:"flex h-full flex-col",children:[(0,wt.jsxs)("div",{className:"flex items-center justify-between border-wt p-4",children:[(0,wt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,wt.jsx)(Ro.Bell,{className:"h-5 w-5"}),(0,wt.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),n>0&&(0,wt.jsxs)(me,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[n," new"]})]}),(0,wt.jsxs)(A,{variant:"ghost",size:"icon",onClick:o,className:"rounded-full",children:[(0,wt.jsx)(Ro.wt,{className:"h-5 w-5"}),(0,wt.jsx)("span",{className:"sr-only",children:"Close"})]})]}),n>0&&(0,wt.jsxs)("div",{className:"flex items-center justify-between border-wt p-2",children:[(0,wt.jsxs)("span",{className:"text-sm text-muted-foreground",children:[n," unread notification",n!==1?"s":""]}),(0,wt.jsx)(A,{variant:"ghost",size:"sm",onClick:s,className:"text-sm",children:"Dismiss all"})]}),l.length>0?(0,wt.jsx)(Ne,{className:"flex-1",children:(0,wt.jsx)("div",{className:"divide-y",children:l.map(u=>(0,wt.jsxs)("div",{className:c("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,wt.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:p(u.type)}),(0,wt.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,wt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,wt.jsx)("p",{className:"font-medium",children:u.title}),(0,wt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,wt.jsx)("p",{className:"text-xs text-muted-foreground",children:u.time}),(0,wt.jsx)(A,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>a?.(u.id),title:"Dismiss",children:(0,wt.jsx)(Ro.Check,{className:"h-3 w-3"})})]})]}),(0,wt.jsx)("p",{className:"text-sm text-muted-foreground",children:u.description}),u.actionLabel&&(0,wt.jsxs)(A,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:u.onAction,children:[u.actionLabel,(0,wt.jsx)(Ro.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},u.id))})}):(0,wt.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,wt.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,wt.jsx)(Ro.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,wt.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,wt.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var Xe=G(require("@radix-ui/react-tabs"));function Zo({className:e,...t}){return(0,wt.jsx)(Xe.Root,{"data-slot":"tabs",className:c("flex flex-col gap-2",e),...t})}function ea({className:e,...t}){return(0,wt.jsx)(Xe.List,{"data-slot":"tabs-list",className:c("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function ta({className:e,...t}){return(0,wt.jsx)(Xe.Trigger,{"data-slot":"tabs-trigger",className:c("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var Le=G(require("react")),D=G(require("@radix-ui/react-dropdown-menu")),rt=require("@radix-ui/react-icons");var oa=D.Root,aa=D.Trigger;var Ui=Le.forwardRef(({className:e,inset:t,children:o,...a},s)=>(0,wt.jsxs)(D.SubTrigger,{ref:s,className:c("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...a,children:[o,(0,wt.jsx)(rt.ChevronRightIcon,{className:"ml-auto"})]}));Ui.displayName=D.SubTrigger.displayName;var Fi=Le.forwardRef(({className:e,...t},o)=>(0,wt.jsx)(D.SubContent,{ref:o,className:c("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Fi.displayName=D.SubContent.displayName;var Qt=Le.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,wt.jsx)(D.Portal,{children:(0,wt.jsx)(D.Content,{ref:a,sideOffset:t,className:c("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Qt.displayName=D.Content.displayName;var Yt=Le.forwardRef(({className:e,inset:t,...o},a)=>(0,wt.jsx)(D.Item,{ref:a,className:c("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...o}));Yt.displayName=D.Item.displayName;var ji=Le.forwardRef(({className:e,children:t,checked:o,...a},s)=>(0,wt.jsxs)(D.CheckboxItem,{ref:s,className:c("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...a,children:[(0,wt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,wt.jsx)(D.ItemIndicator,{children:(0,wt.jsx)(rt.CheckIcon,{className:"h-4 w-4"})})}),t]}));ji.displayName=D.CheckboxItem.displayName;var Oi=Le.forwardRef(({className:e,children:t,...o},a)=>(0,wt.jsxs)(D.RadioItem,{ref:a,className:c("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[(0,wt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,wt.jsx)(D.ItemIndicator,{children:(0,wt.jsx)(rt.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Oi.displayName=D.RadioItem.displayName;var Hi=Le.forwardRef(({className:e,inset:t,...o},a)=>(0,wt.jsx)(D.Label,{ref:a,className:c("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));Hi.displayName=D.Label.displayName;var Vi=Le.forwardRef(({className:e,...t},o)=>(0,wt.jsx)(D.Separator,{ref:o,className:c("-mx-1 my-1 h-px bg-muted",e),...t}));Vi.displayName=D.Separator.displayName;var Gi=({className:e,...t})=>(0,wt.jsx)("span",{className:c("ml-auto text-xs tracking-widest opacity-60",e),...t});Gi.displayName="DropdownMenuShortcut";function ra({activeTab:e,onTabChange:t,tabOptions:o,className:a="",maxWidth:s="700px",gridCols:i=6}){let l=o.find(n=>n.value===e);return(0,wt.jsxs)(Lt.motion.div,{className:`flex-1 flex justify-center ${a}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,wt.jsx)("div",{className:"hidden lg:block",children:(0,wt.jsx)(Zo,{value:e,onValueChange:t,children:(0,wt.jsx)(ea,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:s,gridTemplateColumns:`repeat(${Math.min(i,o.length)}, minmax(0, 1fr))`},children:o.map(n=>(0,wt.jsx)(Lt.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,wt.jsx)(ta,{value:n.value,className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:n.label})},n.value))})})}),(0,wt.jsx)("div",{className:"lg:hidden",children:(0,wt.jsxs)(oa,{children:[(0,wt.jsx)(aa,{asChild:!0,children:(0,wt.jsxs)(A,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[l?.label||"Select",(0,wt.jsx)(Ro.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,wt.jsx)(Qt,{align:"center",className:"w-[180px]",children:o.map(n=>(0,wt.jsx)(Yt,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function na({title:e,notifications:t=[],onToggleSidebar:o,onToggleMobileMenu:a,sidebarOpen:s=!0,className:i,activeTab:l="assistant",onTabChange:n,showTabs:p=!0,tabOptions:u=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:w,actionIcon:f=(0,wt.jsx)(Ro.Bot,{className:"mr-2 h-4 w-4"}),actionText:h="Action",onNotificationRemove:T,onRemoveAll:M,logo:R="/headerlogo.png",appName:x="Nuvia",tagline:P="Collaboration Platform"}){let[F,C]=(0,tt.useState)(!1),[z,Y]=(0,tt.useState)(t),Z=z.filter(W=>!W.read).length,ee=W=>{Y(ae=>ae.filter(le=>le.id!==W)),T?.(W)},Q=()=>{Y(W=>W.filter(ae=>ae.read)),M?.()};return(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${i||""}`,children:[(0,wt.jsx)(A,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,wt.jsx)(Ro.Menu,{className:"h-5 w-5"})}),(0,wt.jsx)(A,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:o,children:(0,wt.jsx)(Ro.PanelLeft,{className:"h-5 w-5"})}),!s&&(0,wt.jsxs)(Lt.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,wt.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,wt.jsx)("img",{src:R,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,wt.jsxs)("div",{children:[(0,wt.jsx)("h2",{className:"font-semibold text-sm",children:x}),(0,wt.jsx)("p",{className:"text-xs text-muted-foreground",children:P})]})]}),(0,wt.jsxs)("div",{className:"flex flex-1 items-center",children:[p&&(0,wt.jsx)(ra,{activeTab:l,onTabChange:n,tabOptions:u}),(0,wt.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,wt.jsx)(Lt.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,wt.jsx)(Lt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,wt.jsxs)(A,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:w,children:[f,h]})})}),(0,wt.jsx)(Qo,{}),(0,wt.jsx)(ot,{children:(0,wt.jsxs)(at,{children:[(0,wt.jsx)(it,{asChild:!0,children:(0,wt.jsx)(Lt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,wt.jsxs)(A,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>C(!0),children:[(0,wt.jsx)(Lt.motion.div,{animate:Z>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:Z>0?1/0:0,repeatDelay:3},children:(0,wt.jsx)(Ro.Bell,{className:"h-5 w-5"})}),Z>0&&(0,wt.jsx)(Lt.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:Z})]})})}),(0,wt.jsx)(Je,{children:"Notifications"})]})}),(0,wt.jsx)(Lt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,wt.jsxs)($e,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,wt.jsx)(jt,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,wt.jsx)(qe,{})]})})]})]})]}),(0,wt.jsx)(Yo,{notifications:z,open:F,onClose:()=>C(!1),onNotificationRemove:ee,onRemoveAll:Q})]})}var sa=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,wt.jsx)(Ro.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function ca({sidebarItems:e,children:t,title:o="Digital Colleagues",notifications:a=[],currentBusinessUnit:s=sa[0],onBusinessUnitChange:i,onSearch:l,businessUnits:n=sa,activeTab:p,onTabChange:u,showTabs:w=!1,onActionClick:f,actionIcon:h,actionText:T="Action",onNotificationRemove:M,onRemoveAll:R,logo:x="/headerlogo.png",appName:P="Nuvia",tagline:F="Collaboration Platform",sidebarInitiallyClosed:C=!1}){let[z,Y]=(0,tt.useState)(!C),[Z,ee]=(0,tt.useState)(!1),[Q,W]=(0,tt.useState)(s),ae=le=>{W(le),i?.(le)};return(0,wt.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[Z&&(0,wt.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>ee(!1)}),(0,wt.jsx)("div",{className:"md:hidden",children:(0,wt.jsx)(Jt,{items:e,isOpen:Z,isMobile:!0,onClose:()=>ee(!1),currentBusinessUnit:Q,onBusinessUnitChange:ae,onSearch:l,logo:x,appName:P,tagline:F})}),(0,wt.jsx)("div",{className:"hidden md:block",children:(0,wt.jsx)(Jt,{items:e,isOpen:z,isMobile:!1,currentBusinessUnit:Q,onBusinessUnitChange:ae,onSearch:l,logo:x,appName:P,tagline:F})}),(0,wt.jsxs)("div",{className:c("min-h-screen fixed w-full transition-all duration-300 ease-in-out",z?"md:pl-64":"md:pl-0"),children:[(0,wt.jsx)(na,{title:o,notifications:a,onToggleSidebar:()=>Y(!z),onToggleMobileMenu:()=>ee(!0),sidebarOpen:z,activeTab:p,onTabChange:u,showTabs:w,onActionClick:f,actionIcon:h,actionText:T,onNotificationRemove:M,onRemoveAll:R,logo:x,appName:P,tagline:F}),(0,wt.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}function da({sessions:e,currentSession:t,teams:o,onNewChat:a,onSessionSelect:s,onSessionEdit:i,onSessionDelete:l,className:n}){return(0,wt.jsx)(ot,{children:(0,wt.jsx)("div",{className:`space-y-4 h-full ${n||""}`,children:(0,wt.jsxs)(ge,{className:"shadow-sm h-full",children:[(0,wt.jsx)("div",{className:"p-4 border-wt",children:(0,wt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,wt.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,wt.jsx)(Ro.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,wt.jsxs)(A,{onClick:a,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,wt.jsx)(Ro.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,wt.jsx)(Ne,{className:"h-[600px]",children:(0,wt.jsx)("div",{className:"p-2",children:e.length===0?(0,wt.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(p=>(0,wt.jsxs)(at,{children:[(0,wt.jsx)(it,{asChild:!0,children:(0,wt.jsx)("div",{className:c("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===p.id&&"bg-muted border"),onClick:()=>s(p),children:(0,wt.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,wt.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,wt.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:p.title}),(0,wt.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:p.lastMessage})]}),(0,wt.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[i&&(0,wt.jsx)(A,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:u=>{u.stopPropagation(),i(p.id)},children:(0,wt.jsx)(Ro.Edit3,{className:"h-3 w-3"})}),l&&(0,wt.jsx)(A,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:u=>{u.stopPropagation(),l(p.id)},children:(0,wt.jsx)(Ro.Trash2,{className:"h-3 w-3"})})]})]})})}),(0,wt.jsx)(Je,{side:"right",className:"max-w-xs",children:(0,wt.jsxs)("div",{className:"space-y-1",children:[(0,wt.jsx)("p",{className:"font-medium text-sm",children:p.title}),(0,wt.jsx)("p",{className:"text-xs",children:p.lastMessage})]})})]},p.id))})})]})})})}var Ye=G(require("motion/react-client"));function pa({capabilities:e,isOpen:t,onToggle:o,onActionSelect:a,onContextChange:s,colorScheme:i=Mo,className:l}){let[n,p]=(0,tt.useState)([]),[u,w]=(0,tt.useState)([]),f=n[n.length-1],h=f?.children||e,T=(C,z)=>{switch(C.type){case"category":return i.categories[z%i.categories.length];case"list":return i.lists[z%i.lists.length];case"item":return i.items[z%i.items.length];default:return i.primary}},M=(0,tt.useMemo)(()=>({path:n,selectedItems:u,filters:{}}),[n,u]);(0,tt.useEffect)(()=>{s&&s(M)},[M,s]);let R=C=>{C.type==="category"||C.type==="list"?p([...n,C]):C.type==="item"&&w([...u,C])},x=()=>{p(n.slice(0,-1))},P=C=>{p(n.slice(0,C+1))},F=()=>f?.actions?f.actions:[];return t?(0,wt.jsxs)("div",{className:c("w-full",l),children:[(0,wt.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,wt.jsxs)("div",{className:"flex items-center gap-2",children:[n.length>0&&(0,wt.jsx)(Lt.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:c("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,wt.jsx)(Ro.ChevronLeft,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,wt.jsx)("h4",{className:"font-medium text-sm",children:f?.name||"Capabilities"})]}),(0,wt.jsx)(Lt.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:c("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,wt.jsx)(Ro.wt,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),n.length>0&&(0,wt.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,wt.jsx)(Lt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>p([]),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,wt.jsxs)("span",{className:"relative",children:["Capabilities",(0,wt.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"})]})}),n.map((C,z)=>(0,wt.jsxs)("div",{className:"flex items-center gap-1",children:[(0,wt.jsx)(Ro.ChevronRight,{className:"h-2 w-2"}),(0,wt.jsx)(Lt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>P(z),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,wt.jsxs)("span",{className:"relative",children:[C.name,(0,wt.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,wt.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,wt.jsx)(Lt.AnimatePresence,{mode:"wait",children:(0,wt.jsx)(Lt.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:f?.type==="list"&&f.data?(0,wt.jsx)(qi,{data:f.data,onItemSelect:C=>w([...u,C]),colorScheme:i}):(0,wt.jsx)(Wi,{capabilities:h,onSelect:R,colorScheme:i})},f?.id||"root")})})]}):(0,wt.jsxs)(A,{onClick:o,size:"sm",variant:"outline",className:"rounded-full",children:[(0,wt.jsx)(Ro.Menu,{className:"h-4 w-4"}),(0,wt.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function Wi({capabilities:e,onSelect:t,colorScheme:o}){return(0,wt.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,s)=>(0,wt.jsx)($i,{capability:a,onClick:()=>t(a),color:o.categories[s%o.categories.length]},a.id))})}function $i({capability:e,onClick:t,selected:o,color:a}){return(0,wt.jsxs)(Lt.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:c("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,wt.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a)}),(0,wt.jsxs)("span",{className:"truncate relative",children:[e.name,(0,wt.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,wt.jsx)(Ro.ChevronRight,{className:c("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,wt.jsx)(me,{variant:"secondary",className:c("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 qi({data:e,onItemSelect:t,colorScheme:o}){return(0,wt.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,s)=>(0,wt.jsxs)(Lt.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:c("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,wt.jsx)("div",{className:c("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,wt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,wt.jsxs)("span",{className:"truncate relative font-medium",children:[a.title,(0,wt.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,wt.jsx)("div",{className:c("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:a.subtitle})]}),a.value&&(0,wt.jsx)(me,{variant:"secondary",className:c("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 ua=G(require("react"));var ma=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:a,description:s="This endpoint requires authentication tt sync functions."})=>{let[i,l]=(0,tt.useState)(!1),[n,p]=(0,tt.useState)(""),u=()=>{if(!t){p("No authentication URL provided");return}l(!0),p("");try{let f=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!f){p("Popup blocked. Please allow popups for this site and try again."),l(!1);return}let h=setInterval(()=>{try{f.closed&&(clearInterval(h),l(!1),a(),o())}catch{}},1e3);setTimeout(()=>{f.closed||(f.close(),clearInterval(h),l(!1),p("Authentication timed out. Please try again."))},6e5)}catch{p("Failed tt open authentication window"),l(!1)}},w=async()=>{try{await navigator.clipboard.writeText(t),p("")}catch{p("Failed tt copy URL tt clipboard")}};return e?(0,wt.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,wt.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,wt.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,wt.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s}),n&&(0,wt.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:n}),(0,wt.jsxs)("div",{className:"flex gap-2",children:[(0,wt.jsx)("button",{onClick:u,disabled:i||!t,className:`
|
|
6
7
|
px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
|
|
7
|
-
${
|
|
8
|
-
`,children:
|
|
8
|
+
${i||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
|
|
9
|
+
`,children:i?"Authenticating...":"Authenticate"}),(0,wt.jsx)("button",{onClick:w,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,
|
|
12
|
+
`,children:"Copy URL"}),(0,wt.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 oo=({toolPart:e,index:t,addToolResult:o})=>{let[a,s]=ua.default.useState(!0),i=()=>{o(e.input?.toolCallId,e.input?.tool,"Authentication completed"),s(!1)};switch(e.state){case"input-available":return(0,wt.jsxs)("div",{className:"mb-2",children:[(0,wt.jsx)(ma,{isOpen:a,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>s(!1),onSuccess:i,description:e.output?.reason||e.input?.reason}),!a&&(0,wt.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,wt.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,wt.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,wt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,wt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var ga=require("marked"),fa=G(require("react-markdown"));function Ki(e){return ga.marked.lexer(e).map(o=>o.raw)}var ba=(0,tt.memo)(({content:e})=>(0,wt.jsx)(fa.default,{children:e}),(e,t)=>e.content===t.content);ba.displayName="MemoizedMarkdownBlock";var ao=(0,tt.memo)(({content:e,id:t})=>(0,tt.useMemo)(()=>Ki(e),[e]).map((a,s)=>(0,wt.jsx)(ba,{content:a},`${t}-block_${s}`)));ao.displayName="PartText";var ro=G(require("react"));var ha=({isOpen:e=!0,reason:t,onClose:o,onApprove:a,onDeny:s,title:i="Approval Required"})=>{let[l,n]=(0,tt.useState)(!1),p=()=>{n(!0),a(),o()},u=()=>{n(!0),s(),o()},w=()=>{n(!0),s(),o()};return e?(0,wt.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full shadow-lg",children:[(0,wt.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:i}),(0,wt.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:t}),(0,wt.jsxs)("div",{className:"flex gap-2",children:[(0,wt.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
|
-
${
|
|
14
|
-
`,children:
|
|
14
|
+
${l?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
|
|
15
|
+
`,children:l?"Processing...":"Approve"}),(0,wt.jsx)("button",{onClick:u,disabled:l,className:`
|
|
15
16
|
px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
|
|
16
|
-
${
|
|
17
|
-
`,children:
|
|
17
|
+
${l?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
|
|
18
|
+
`,children:l?"Processing...":"Deny"}),(0,wt.jsx)("button",{onClick:w,disabled:l,className:`
|
|
18
19
|
px-4 py-2 text-white border-none rounded text-sm
|
|
19
|
-
${
|
|
20
|
-
`,children:"Cancel"})]})]}):null};var co=({toolPart:e,index:t,addToolResult:a})=>{let[o,l]=ta.default.useState(!0),[r,s]=ta.default.useState(null),n=()=>{a(e.input?.toolCallId,e.input?.tool,"Approved"),l(!1),s("approve")},p=()=>{a(e.input?.toolCallId,e.input?.tool,"Denied"),l(!1),s("deny")};switch(e.state){case"input-available":return(0,ht.jsxs)("div",{className:"mb-2",children:[(0,ht.jsx)(lo,{isOpen:o,onApprove:n,onDeny:p,onClose:()=>l(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!o&&(0,ht.jsxs)(ht.Fragment,{children:[r==="approve"&&(0,ht.jsx)("div",{className:"flex items-center justify-center At-3",children:(0,ht.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,ht.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,ht.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),r==="deny"&&(0,ht.jsx)("div",{className:"flex items-center justify-center At-3",children:(0,ht.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,ht.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,ht.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,ht.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};function po({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:l,fileUploads:r,isDragOver:s,enableFileUpload:n,onInputChange:p,addToolResult:u,onSendMessage:k,onKeyPress:f,onFileUpload:y,onRemoveFile:T,onDragOver:U,className:R}){let x=(0,Ze.useRef)(null),S=(0,Ze.useRef)(null),F=(0,Ze.useRef)(null),[w,E]=(0,Ze.useState)(!1),[Y,Z]=(0,Ze.useState)({path:[],selectedItems:[],filters:{}});(0,Ze.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,Ze.useEffect)(()=>{w&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[w]);let ee=()=>Ft(Y),Q=()=>{let m=[];return l.forEach(j=>{j.actions&&j.actions.forEach($=>{m.push({label:$.label,action:()=>W($.id,{path:[j],selectedItems:[],filters:{}})})}),j.children&&j.children.forEach($=>{$.type==="list"&&$.data&&m.push({label:`View ${$.name}`,action:()=>E(!0)})})}),m.slice(0,5)},W=(m,j)=>{console.log("Capability action:",m,j);let $=`Executing ${m} with context: ${JSON.stringify(j.path.map(A=>A.name))}`;E(!1)},oe=Ft({path:[],selectedItems:[],filters:{}}),se=m=>{y(m.target.files),m.target.files&&(m.target.value="")},M=m=>{m.preventDefault(),U(!0)},De=m=>{m.preventDefault(),U(!1)},d=m=>{m.preventDefault(),U(!1),y(m.dataTransfer.files)},L=m=>{if(m===0)return"0 Bytes";let j=1024,$=["Bytes","KB","MB","GB"],A=Math.floor(Math.log(m)/Math.log(j));return parseFloat((m/Math.pow(j,A)).toFixed(2))+" "+$[A]},I=m=>m.startsWith("image/")?(0,ht.jsx)(va.Image,{className:"h-4 w-4"}):m.startsWith("text/")?(0,ht.jsx)(va.FileText,{className:"h-4 w-4"}):(0,ht.jsx)(va.File,{className:"h-4 w-4"}),q=m=>{let j=m.role==="assistant",$=m.role==="user";return(0,ht.jsxs)("div",{className:c("flex my-2 items-start gap-3",$?"flex-row-reverse":""),children:[(0,ht.jsx)(Ge,{className:"h-8 w-8 shrink-0",children:(0,ht.jsx)(We,{className:c($?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:$?(0,ht.jsx)(va.User,{className:"h-4 w-4"}):(0,ht.jsx)(va.Bot,{className:"h-4 w-4"})})}),(0,ht.jsx)("div",{className:c("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",$?"bg-primary text-primary-foreground":"bg-muted"),children:m.parts.map((A,K)=>{if(A.type==="text")return(0,ht.jsx)(Zt,{id:m.id,content:A.text},`${m.id}-text`);if(A.type==="file"){let N=A;return(0,ht.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,ht.jsxs)("div",{className:"flex items-center gap-2",children:[I(N.mediaType||"application/octet-stream"),(0,ht.jsx)("div",{className:"flex-1 min-w-0",children:(0,ht.jsx)("p",{className:"text-sm font-medium truncate",children:N.filename||N.url?.split("/").pop()||"File"})}),N.url&&(0,ht.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(N.url,"_blank"),className:"h-8 w-8 p-0",children:(0,ht.jsx)(va.Download,{className:"h-4 w-4"})})]})},K)}if(A.type.startsWith("tool-")){let N=A,ye=A.type.replace("tool-","");if(ye==="task")switch(N.state){case"input-available":return(0,ht.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},K);case"output-available":return(0,ht.jsx)("div",{className:"mb-2",children:(0,ht.jsx)(ya,{data:{id:N.output?.id||N.input?.id,fetchLatest:!1,taskData:N.output||N.input}})},K);case"output-error":return(0,ht.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",N.errorText]},K);default:return null}if(A.type==="tool-requestEndpointLogin")return(0,ht.jsx)("div",{className:"mb-2",children:(0,ht.jsx)(Yt,{toolPart:N,index:K,addToolResult:u??(()=>{})})},K);if(A.type==="tool-authenticate")return(0,ht.jsx)("div",{className:"mb-2",children:(0,ht.jsx)(Yt,{toolPart:N,index:K,addToolResult:u??(()=>{})})},K);if(A.type==="tool-requestApproval")return(0,ht.jsx)("div",{className:"mb-2",children:(0,ht.jsx)(co,{toolPart:N,index:K,addToolResult:u??(()=>{})})},K);if(ye==="artefact")switch(N.state){case"input-available":return(0,ht.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},K);case"output-available":return(0,ht.jsx)("div",{className:"mb-2",children:(0,ht.jsx)(ka,{artefact:N.output?.description||"",taskId:N.output?.id||N.input?.id,taskData:N.output||N.input})},K);case"output-error":return(0,ht.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",N.errorText]},K);default:return null}return(0,ht.jsx)("div",{className:"mb-2",children:(0,ht.jsxs)(me,{className:"w-full max-w-md",children:[(0,ht.jsx)(Ae,{children:(0,ht.jsx)(Me,{className:"text-lg",children:ye})}),(0,ht.jsxs)(xe,{children:[N.state==="input-available"&&(0,ht.jsxs)("p",{className:"text-sm",children:["Processing ",ye,"..."]}),N.state==="output-available"&&(0,ht.jsx)("pre",{className:"text-sm",children:JSON.stringify(N.output,null,2)}),N.state==="output-error"&&(0,ht.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",N.errorText]})]})]})},K)}if(A.type.startsWith("data-")){let N=A,ye=A.type.replace("data-","");return ye==="reference"?(0,ht.jsx)("div",{className:"mb-2",children:(0,ht.jsx)(me,{className:"w-full",children:(0,ht.jsx)(xe,{className:"p-4",children:(0,ht.jsx)("div",{className:"space-y-2",children:N.data?.references?.map((le,Te)=>(0,ht.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,ht.jsx)(de,{variant:"outline",children:le.type||"link"}),(0,ht.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ht.jsx)("p",{className:"text-sm font-medium truncate",children:le.title}),le.description&&(0,ht.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:le.description})]}),le.url&&(0,ht.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(le.url,"_blank"),className:"h-8 w-8 p-0",children:(0,ht.jsx)(va.ExternalLink,{className:"h-4 w-4"})})]},Te))})})})},K):ye==="menu"?(0,ht.jsx)("div",{className:"mb-2",children:(0,ht.jsxs)(me,{className:"w-full",children:[(0,ht.jsx)(Ae,{children:(0,ht.jsx)(Me,{className:"text-lg",children:N.data?.title})}),(0,ht.jsx)(xe,{children:(0,ht.jsx)("div",{className:"space-y-2",children:N.data?.items?.map((le,Te)=>(0,ht.jsx)(D,{variant:"outline",className:"w-full justify-start",onClick:le.action,children:(0,ht.jsxs)("div",{className:"text-left",children:[(0,ht.jsx)("p",{className:"font-medium",children:le.label}),le.description&&(0,ht.jsx)("p",{className:"text-xs text-muted-foreground",children:le.description})]})},Te))})})]})},K):(0,ht.jsx)("div",{className:"mb-2",children:(0,ht.jsxs)(me,{className:"w-full max-w-md",children:[(0,ht.jsx)(Ae,{children:(0,ht.jsx)(Me,{className:"text-lg",children:ye})}),(0,ht.jsx)(xe,{children:(0,ht.jsx)("pre",{className:"text-sm",children:JSON.stringify(N.data,null,2)})})]})},K)}return null})})]})};return(0,ht.jsxs)("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${R||""}`,children:[(0,ht.jsxs)(we,{ref:S,className:"flex-1 p-4 bg-background border-0",onDragOver:M,onDragLeave:De,onDrop:d,children:[(0,ht.jsxs)("div",{className:c("space-y-4",s&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,ht.jsx)(Xe.animate,{children:e.map(m=>(0,ht.jsx)(Xe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:c("flex gap-3",m.role==="user"?"flex-row-reverse":"flex-row"),children:q(m)},m.id))}),w&&(0,ht.jsxs)(Xe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,ht.jsx)(Ge,{className:"h-8 w-8",children:(0,ht.jsx)(We,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,ht.jsx)(va.Bot,{className:"h-4 w-4"})})}),(0,ht.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,ht.jsx)(to,{capabilities:l,isOpen:w,onToggle:()=>E(!w),onActionSelect:W,className:"w-full"})})]}),a&&(0,ht.jsxs)(Xe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,ht.jsx)(Ge,{className:"h-8 w-8",children:(0,ht.jsx)(We,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,ht.jsx)(va.Bot,{className:"h-4 w-4"})})}),(0,ht.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,ht.jsxs)("div",{className:"flex space-x-1",children:[(0,ht.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,ht.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,ht.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,ht.jsx)("div",{ref:x})]}),r.length>0&&(0,ht.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,ht.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(m=>(0,ht.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[I(m.file.type),(0,ht.jsx)("span",{className:"text-sm font-medium",children:m.file.name}),(0,ht.jsx)("span",{className:"text-xs text-muted-foreground",children:L(m.file.size)}),(0,ht.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>T(m.id),className:"h-6 w-6 p-0",children:(0,ht.jsx)(va.ht,{className:"h-4 w-4"})})]},m.id))})}),(0,ht.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,ht.jsxs)("div",{className:"flex gap-3",children:[(0,ht.jsx)(ct,{value:t,onChange:m=>p(m.target.value),onKeyPress:f,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),n&&(0,ht.jsx)(D,{variant:"outline",size:"icon",onClick:()=>F.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,ht.jsx)(va.Paperclip,{className:"h-4 w-4"})}),(0,ht.jsx)(D,{onClick:k,disabled:!t.trim()&&r.length===0||a,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,ht.jsx)(va.Send,{className:"h-4 w-4"})})]}),(0,ht.jsxs)("div",{className:"flex items-center gap-3 At-3",children:[(0,ht.jsxs)(D,{onClick:()=>E(!w),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,ht.jsx)(va.Menu,{className:"h-3 w-3 mr-1"}),w?"Hide":"Show"," Capabilities"]}),(0,ht.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[ee().map((m,j)=>(0,ht.jsx)(D,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>W(m.id,Y),children:m.label},`context-${m.id}`)),ee().length===0&&Q().map((m,j)=>(0,ht.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:m.action,children:m.label},`suggestion-${j}`))]})]}),n&&(0,ht.jsx)("input",{ref:F,type:"file",multiple:!0,onChange:se,className:"hidden"})]})]})}function go({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:l=[],capabilities:r=[],sidebarItems:s=[],notifications:n=[],sessions:p=[],onNewChat:u,onSessionSelect:k,onSessionDelete:f,onSessionEdit:y=()=>{},onBusinessUnitChange:T=()=>{},onNotificationRemove:U=()=>{},onRemoveAll:R=()=>{},onActionClick:x=()=>{},onSearch:S=L=>console.log("Search query:",L),initialTeam:F="design",currentSession:w=null,showCapabilities:E=!0,title:Y="Digital Colleagues",enableFileUpload:Z=!0,maxFileSize:ee=10,allowedFileTypes:Q=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:W="/headerlogo.png",appName:oe="Nuvia",tagline:se="AI-Powered Workspace",actionIcon:M=(0,ht.jsx)(va.Users,{className:"mr-2 h-4 w-4"}),actionText:De="Collaborate",sidebarInitiallyClosed:d=!1}){let L={...e,onError:H=>{q?.setMessages(ce=>[...ce,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:H.message}]}]),console.error("Error in CopilotInterface:",H)}},I=(0,mo.useChat)(L||{}),q=a?t||I:null,[m,j]=(0,Ze.useState)(""),[$,A]=(0,Ze.useState)(!1),K=q?.messages||o,N=m,ye=q?.status==="submitted"||$,le=q?.addToolResult?(H,ce,ie)=>{q.addToolResult({tool:ce,toolCallId:H,output:ie}),q.sendMessage()}:()=>{},Te=l||[],bo={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"},[vo,ho]=(0,Ze.useState)(()=>Te.length===0?bo:Te.find(H=>H.id===F)||Te[0]),[rt,gt]=(0,Ze.useState)([]),[yo,xo]=(0,Ze.useState)(!1),wo=H=>{if(!H||!Z)return;let ce=[];Array.from(H).forEach(ie=>{if(ie.size>ee*1024*1024){alert(`File ${ie.name} is too large. Maximum size is ${ee}MB.`);return}if(Q.length>0&&!Q.some(ft=>ie.type.match(ft))){alert(`File type ${ie.type} is not allowed.`);return}let oa={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:ie,status:"pending",progress:0};if(ie.type.startsWith("image/")){let ft=new FileReader;ft.onload=Do=>{gt(To=>To.map(Mt=>Mt.id===oa.id?{...Mt,preview:Do.target?.result}:Mt))},ft.readAsDataURL(ie)}ce.push(oa)}),gt(ie=>[...ie,...ce])},Co=H=>{gt(ce=>ce.filter(ie=>ie.id!==H))},aa=()=>{if(!(!N.trim()&&rt.length===0)){if(q){let H=rt.length>0?No(rt.map(ce=>ce.file)):void 0;q.sendMessage({text:N,files:H},{body:{timestamp:Date.now()}}),j("")}else console.log("Message to send:",N),console.log("Files to upload:",rt),j(""),A(!0),setTimeout(()=>{A(!1)},1500);gt([])}},No=H=>{let ce=new DataTransfer;return H.forEach(ie=>ce.items.add(ie)),ce.files},ko=H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),aa())},Po=H=>{j(H)};return(0,ht.jsx)(Za,{sidebarItems:s||[],title:Y,notifications:n||[],businessUnits:Te,currentBusinessUnit:vo,onBusinessUnitChange:H=>{H&&(ho(H),T?.(H))},onSearch:S,showTabs:!1,onActionClick:x,actionIcon:M,actionText:De,onNotificationRemove:U,onRemoveAll:R,logo:W,appName:oe,tagline:se,sidebarInitiallyClosed:d,children:(0,ht.jsx)(At.AnimatePresence,{mode:"wait",children:(0,ht.jsx)(At.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,ht.jsxs)("div",{className:"h-full flex",children:[(0,ht.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,ht.jsx)(eo,{sessions:p||[],currentSession:w,teams:Te,onNewChat:u,onSessionSelect:k,onSessionEdit:y,onSessionDelete:f})}),(0,ht.jsx)("div",{className:"flex-1 h-full p-2",children:(0,ht.jsx)(po,{messages:K||[],input:N,isTyping:ye,currentSessionTitle:w?.title,capabilities:r||[],onInputChange:Po,addToolResult:le,onSendMessage:aa,onKeyPress:ko,fileUploads:rt,isDragOver:yo,enableFileUpload:Z,onFileUpload:wo,onRemoveFile:Co,onDragOver:xo})})]})},"chat-interface")})})}var Ii=[{id:"1",role:"user",parts:[{type:"text",text:"Hello, can you help me with a task?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:"Of course! I can help you create and manage tasks."}]},{id:"3",role:"user",parts:[{type:"text",text:"Here is a file with project requirements"},{type:"file",mimeType:"application/pdf",url:"/path/to/file.pdf"}]},{id:"4",role:"assistant",parts:[{type:"text",text:"I'll create a task based on your requirements."},{type:"tool-task",toolCallId:"call-123",state:"output-available",input:{title:"Project Requirements Review",description:"Review and analyze the uploaded requirements document"},output:{id:"task-123",title:"Project Requirements Review",description:"Review and analyze the uploaded requirements document",status:"created",assignee:"AI Assistant",priority:"high"}}]},{id:"5",role:"assistant",parts:[{type:"text",text:"Here are some relevant resources for your project:"},{type:"data-reference",data:{references:[{id:"ref-1",title:"Project Management Best Practices",url:"https://example.com/pm-best-practices",description:"Comprehensive guide to project management",type:"document"},{id:"ref-2",title:"Requirements Gathering Template",url:"https://example.com/requirements-template",description:"Template for gathering project requirements",type:"link"}]}}]},{id:"6",role:"assistant",parts:[{type:"text",text:"What would you like to do next?"},{type:"data-menu",data:{title:"Available Actions",items:[{id:"action-1",label:"Create another task",description:"Set up a new task for the project",action:()=>console.log("Create task clicked")},{id:"action-2",label:"View project timeline",description:"See the project schedule and milestones",action:()=>console.log("View timeline clicked")},{id:"action-3",label:"Assign team members",description:"Add team members to the project",action:()=>console.log("Assign team clicked")}]}}]}];function Bi(){return(0,ht.jsx)(go,{messages:Ii,businessUnits:[{id:"engineering",name:"Engineering",description:"Software development team",icon:"\u2699\uFE0F",color:"bg-blue-500",accentColor:"bg-blue-600"}],capabilities:[],sessions:[],onNewChat:()=>console.log("New chat started"),onSessionSelect:e=>console.log("Session selected:",e),onSessionDelete:e=>console.log("Session deleted:",e),enableFileUpload:!0,title:"AI Assistant"})}0&&(module.exports={ExampleChatInterface});
|
|
20
|
+
${l?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
|
|
21
|
+
`,children:"Cancel"})]})]}):null};var ya=({toolPart:e,index:t,addToolResult:o})=>{let[a,s]=ro.default.useState(!0),[i,l]=ro.default.useState(null),n=()=>{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,wt.jsxs)("div",{className:"mb-2",children:[(0,wt.jsx)(ha,{isOpen:a,onApprove:n,onDeny:p,onClose:()=>s(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,wt.jsxs)(wt.Fragment,{children:[i==="approve"&&(0,wt.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,wt.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,wt.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,wt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),i==="deny"&&(0,wt.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,wt.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,wt.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,wt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,wt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var so=require("@radix-ui/react-use-controllable-state");var nt=G(require("@radix-ui/react-collapsible")),xa=nt.Root,wa=nt.CollapsibleTrigger,Ca=nt.CollapsibleContent;var ka=require("streamdown"),no=(0,tt.memo)(({className:e,...t})=>(0,wt.jsx)(ka.Streamdown,{className:c("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);no.displayName="Response";var Da=(0,tt.createContext)(null),_i=()=>{let e=(0,tt.useContext)(Da);if(!e)throw new Error("Reasoning components must wt used within Reasoning");return e},Ji=1e3,Xi=1e3,lo=(0,tt.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:s,duration:i,children:l,...n})=>{let[p,u]=(0,so.useControllableState)({prop:o,defaultProp:a,onChange:s}),[w,f]=(0,so.useControllableState)({prop:i,defaultProp:0}),[h,T]=(0,tt.useState)(!1),[M,R]=(0,tt.useState)(null);(0,tt.useEffect)(()=>{t?M===null&&R(Date.now()):M!==null&&(f(Math.ceil((Date.now()-M)/Xi)),R(null))},[t,M,f]),(0,tt.useEffect)(()=>{if(a&&!t&&p&&!h){let P=setTimeout(()=>{u(!1),T(!0)},Ji);return()=>clearTimeout(P)}},[t,p,a,u,h]);let x=P=>{u(P)};return(0,wt.jsx)(Da.Provider,{value:{isStreaming:t,isOpen:p,setIsOpen:u,duration:w},children:(0,wt.jsx)(xa,{className:c("not-prose mb-4",e),onOpenChange:x,open:p,...n,children:l})})}),Qi=(e,t)=>e||t===0?(0,wt.jsx)("p",{children:"Thinking..."}):t===void 0?(0,wt.jsx)("p",{children:"Thought for a few seconds"}):(0,wt.jsxs)("p",{children:["Thought for ",t," seconds"]}),co=(0,tt.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:s,duration:i}=_i();return(0,wt.jsx)(wa,{className:c("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(Ro.BrainIcon,{className:"size-4"}),Qi(a,i),(0,wt.jsx)(Ro.ChevronDownIcon,{className:c("size-4 transition-transform",s?"rotate-180":"rotate-0")})]})})}),po=(0,tt.memo)(({className:e,children:t,...o})=>(0,wt.jsx)(Ca,{className:c("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-tt-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,wt.jsx)(no,{className:"grid gap-2",children:t})}));lo.displayName="Reasoning";co.displayName="ReasoningTrigger";po.displayName="ReasoningContent";function Ra({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:s,fileUploads:i,isDragOver:l,enableFileUpload:n,onInputChange:p,addToolResult:u,onSendMessage:w,onKeyPress:f,onFileUpload:h,onRemoveFile:T,onDragOver:M,className:R}){let x=(0,tt.useRef)(null),P=(0,tt.useRef)(null),F=(0,tt.useRef)(null),[C,z]=(0,tt.useState)(!1),[Y,Z]=(0,tt.useState)({path:[],selectedItems:[],filters:{}});(0,tt.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,tt.useEffect)(()=>{C&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[C]);let ee=()=>Vt(Y),Q=()=>{let m=[];return s.forEach(j=>{j.actions&&j.actions.forEach(K=>{m.push({label:K.label,action:()=>W(K.id,{path:[j],selectedItems:[],filters:{}})})}),j.children&&j.children.forEach(K=>{K.type==="list"&&K.data&&m.push({label:`View ${K.name}`,action:()=>z(!0)})})}),m.slice(0,5)},W=(m,j)=>{console.log("Capability action:",m,j);let K=`Executing ${m} with context: ${JSON.stringify(j.path.map(S=>S.name))}`;z(!1)},ae=Vt({path:[],selectedItems:[],filters:{}}),le=m=>{h(m.target.files),m.target.files&&(m.target.value="")},I=m=>{m.preventDefault(),M(!0)},Te=m=>{m.preventDefault(),M(!1)},d=m=>{m.preventDefault(),M(!1),h(m.dataTransfer.files)},E=m=>{if(m===0)return"0 Bytes";let j=1024,K=["Bytes","KB","MB","GB"],S=Math.floor(Math.log(m)/Math.log(j));return parseFloat((m/Math.pow(j,S)).toFixed(2))+" "+K[S]},B=m=>m.startsWith("image/")?(0,wt.jsx)(Ro.Image,{className:"h-4 w-4"}):m.startsWith("text/")?(0,wt.jsx)(Ro.FileText,{className:"h-4 w-4"}):(0,wt.jsx)(Ro.File,{className:"h-4 w-4"}),q=m=>{let j=m.role==="assistant",K=m.role==="user";return(0,wt.jsxs)("div",{className:c("flex my-2 items-start gap-3",K?"flex-row-reverse":""),children:[(0,wt.jsx)($e,{className:"h-8 w-8 shrink-0",children:(0,wt.jsx)(qe,{className:c(K?"bg-primary text-primary-foreground":"bg-gradient-tt-br from-purple-600 tt-blue-600 text-white"),children:K?(0,wt.jsx)(Ro.User,{className:"h-4 w-4"}):(0,wt.jsx)(Ro.Bot,{className:"h-4 w-4"})})}),(0,wt.jsx)("div",{className:c("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",K?"bg-primary text-primary-foreground":"bg-muted"),children:m.parts.map((S,$)=>{if(S.type==="text")return(0,wt.jsx)(ao,{id:m.id,content:S.text},`${m.id}-text`);if(S.type==="file"){let k=S;return(0,wt.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,wt.jsxs)("div",{className:"flex items-center gap-2",children:[B(k.mediaType||"application/octet-stream"),(0,wt.jsx)("div",{className:"flex-1 min-w-0",children:(0,wt.jsx)("p",{className:"text-sm font-medium truncate",children:k.filename||k.url?.split("/").pop()||"File"})}),k.url&&(0,wt.jsx)(A,{variant:"ghost",size:"sm",onClick:()=>window.open(k.url,"_blank"),className:"h-8 w-8 p-0",children:(0,wt.jsx)(Ro.Download,{className:"h-4 w-4"})})]})},$)}if(S.type.startsWith("tool-")){let k=S,we=S.type.replace("tool-","");if(we==="task")switch(k.state){case"input-available":return(0,wt.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},$);case"output-available":return(0,wt.jsx)("div",{className:"mb-2",children:(0,wt.jsx)(So,{data:{id:k.output?.id||k.input?.id,fetchLatest:!1,taskData:k.output||k.input}})},$);case"output-error":return(0,wt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",k.errorText]},$);default:return null}if(S.type==="tool-requestEndpointLogin")return(0,wt.jsx)("div",{className:"mb-2",children:(0,wt.jsx)(oo,{toolPart:k,index:$,addToolResult:u??(()=>{})})},$);if(S.type==="tool-authenticate")return(0,wt.jsx)("div",{className:"mb-2",children:(0,wt.jsx)(oo,{toolPart:k,index:$,addToolResult:u??(()=>{})})},$);if(S.type==="tool-requestApproval")return(0,wt.jsx)("div",{className:"mb-2",children:(0,wt.jsx)(ya,{toolPart:k,index:$,addToolResult:u??(()=>{})})},$);if(we==="artefact")switch(k.state){case"input-available":return(0,wt.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},$);case"output-available":return(0,wt.jsx)("div",{className:"mb-2",children:(0,wt.jsx)(Lo,{artefact:k.output?.description||"",taskId:k.output?.id||k.input?.id,taskData:k.output||k.input})},$);case"output-error":return(0,wt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",k.errorText]},$);default:return null}return(0,wt.jsx)("div",{className:"mb-2",children:(0,wt.jsxs)(ge,{className:"w-full max-w-md",children:[(0,wt.jsx)(Ie,{children:(0,wt.jsx)(Be,{className:"text-lg",children:we})}),(0,wt.jsxs)(Ce,{children:[k.state==="input-available"&&(0,wt.jsxs)("p",{className:"text-sm",children:["Processing ",we,"..."]}),k.state==="output-available"&&(0,wt.jsx)("pre",{className:"text-sm",children:JSON.stringify(k.output,null,2)}),k.state==="output-error"&&(0,wt.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",k.errorText]})]})]})},$)}if(S.type.startsWith("data-")){let k=S,we=S.type.replace("data-","");return we==="reference"?(0,wt.jsx)("div",{className:"mb-2",children:(0,wt.jsx)(ge,{className:"w-full",children:(0,wt.jsx)(Ce,{className:"p-4",children:(0,wt.jsx)("div",{className:"space-y-2",children:k.data?.references?.map((de,Se)=>(0,wt.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,wt.jsx)(me,{variant:"outline",children:de.type||"link"}),(0,wt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,wt.jsx)("p",{className:"text-sm font-medium truncate",children:de.title}),de.description&&(0,wt.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:de.description})]}),de.url&&(0,wt.jsx)(A,{variant:"ghost",size:"sm",onClick:()=>window.open(de.url,"_blank"),className:"h-8 w-8 p-0",children:(0,wt.jsx)(Ro.ExternalLink,{className:"h-4 w-4"})})]},Se))})})})},$):we==="menu"?(0,wt.jsx)("div",{className:"mb-2",children:(0,wt.jsxs)(ge,{className:"w-full",children:[(0,wt.jsx)(Ie,{children:(0,wt.jsx)(Be,{className:"text-lg",children:k.data?.title})}),(0,wt.jsx)(Ce,{children:(0,wt.jsx)("div",{className:"space-y-2",children:k.data?.items?.map((de,Se)=>(0,wt.jsx)(A,{variant:"outline",className:"w-full justify-start",onClick:de.action,children:(0,wt.jsxs)("div",{className:"text-left",children:[(0,wt.jsx)("p",{className:"font-medium",children:de.label}),de.description&&(0,wt.jsx)("p",{className:"text-xs text-muted-foreground",children:de.description})]})},Se))})})]})},$):(0,wt.jsx)("div",{className:"mb-2",children:(0,wt.jsxs)(ge,{className:"w-full max-w-md",children:[(0,wt.jsx)(Ie,{children:(0,wt.jsx)(Be,{className:"text-lg",children:we})}),(0,wt.jsx)(Ce,{children:(0,wt.jsx)("pre",{className:"text-sm",children:JSON.stringify(k.data,null,2)})})]})},$)}if(S.type==="reasoning")return(0,wt.jsxs)(lo,{className:"w-full",isStreaming:status==="streaming"&&$===m.parts.length-1&&m.id===e.at(-1)?.id,children:[(0,wt.jsx)(co,{}),(0,wt.jsx)(po,{children:S.text})]},`${m.id}-${$}`)})})]})};return(0,wt.jsxs)("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${R||""}`,children:[(0,wt.jsxs)(Ne,{ref:P,className:"flex-1 p-4 bg-background border-0",onDragOver:I,onDragLeave:Te,onDrop:d,children:[(0,wt.jsxs)("div",{className:c("space-y-4",l&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,wt.jsx)(Ye.animate,{children:e.map(m=>(0,wt.jsx)(Ye.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:c("flex gap-3",m.role==="user"?"flex-row-reverse":"flex-row"),children:q(m)},m.id))}),C&&(0,wt.jsxs)(Ye.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,wt.jsx)($e,{className:"h-8 w-8",children:(0,wt.jsx)(qe,{className:"bg-gradient-tt-br from-purple-600 tt-blue-600 text-white",children:(0,wt.jsx)(Ro.Bot,{className:"h-4 w-4"})})}),(0,wt.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,wt.jsx)(pa,{capabilities:s,isOpen:C,onToggle:()=>z(!C),onActionSelect:W,className:"w-full"})})]}),o&&(0,wt.jsxs)(Ye.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,wt.jsx)($e,{className:"h-8 w-8",children:(0,wt.jsx)(qe,{className:"bg-gradient-tt-br from-purple-600 tt-blue-600 text-white",children:(0,wt.jsx)(Ro.Bot,{className:"h-4 w-4"})})}),(0,wt.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,wt.jsxs)("div",{className:"flex space-x-1",children:[(0,wt.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,wt.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,wt.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,wt.jsx)("div",{ref:x})]}),i.length>0&&(0,wt.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,wt.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(m=>(0,wt.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[B(m.file.type),(0,wt.jsx)("span",{className:"text-sm font-medium",children:m.file.name}),(0,wt.jsx)("span",{className:"text-xs text-muted-foreground",children:E(m.file.size)}),(0,wt.jsx)(A,{variant:"ghost",size:"sm",onClick:()=>T(m.id),className:"h-6 w-6 p-0",children:(0,wt.jsx)(Ro.wt,{className:"h-4 w-4"})})]},m.id))})}),(0,wt.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,wt.jsxs)("div",{className:"flex gap-3",children:[(0,wt.jsx)(mt,{value:t,onChange:m=>p(m.target.value),onKeyPress:f,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),n&&(0,wt.jsx)(A,{variant:"outline",size:"icon",onClick:()=>F.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,wt.jsx)(Ro.Paperclip,{className:"h-4 w-4"})}),(0,wt.jsx)(A,{onClick:w,disabled:!t.trim()&&i.length===0||o,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,wt.jsx)(Ro.Send,{className:"h-4 w-4"})})]}),(0,wt.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,wt.jsxs)(A,{onClick:()=>z(!C),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,wt.jsx)(Ro.Menu,{className:"h-3 w-3 mr-1"}),C?"Hide":"Show"," Capabilities"]}),(0,wt.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[ee().map((m,j)=>(0,wt.jsx)(A,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>W(m.id,Y),children:m.label},`context-${m.id}`)),ee().length===0&&Q().map((m,j)=>(0,wt.jsx)(A,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:m.action,children:m.label},`suggestion-${j}`))]})]}),n&&(0,wt.jsx)("input",{ref:F,type:"file",multiple:!0,onChange:le,className:"hidden"})]})]})}function Aa({aiConfig:e,useCustomChat:t,enableAI:o=!0,messages:a=[],businessUnits:s=[],capabilities:i=[],sidebarItems:l=[],notifications:n=[],sessions:p=[],onNewChat:u,onSessionSelect:w,onSessionDelete:f,onSessionEdit:h=()=>{},onBusinessUnitChange:T=()=>{},onNotificationRemove:M=()=>{},onRemoveAll:R=()=>{},onActionClick:x=()=>{},onSearch:P=E=>console.log("Search query:",E),initialTeam:F="design",currentSession:C=null,showCapabilities:z=!0,title:Y="Digital Colleagues",enableFileUpload:Z=!0,maxFileSize:ee=10,allowedFileTypes:Q=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:W="/headerlogo.png",appName:ae="Nuvia",tagline:le="AI-Powered Workspace",actionIcon:I=(0,wt.jsx)(Ro.Users,{className:"mr-2 h-4 w-4"}),actionText:Te="Collaborate",sidebarInitiallyClosed:d=!1}){let E={...e,onError:O=>{q?.setMessages(pe=>[...pe,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:O.message}]}]),console.error("Error in CopilotInterface:",O)}},B=(0,Ta.useChat)(E||{}),q=o?t||B:null,[m,j]=(0,tt.useState)(""),[K,S]=(0,tt.useState)(!1),$=q?.messages||a,k=m,we=q?.status==="submitted"||K,de=q?.addToolResult?(O,pe,ie)=>{q.addToolResult({tool:pe,toolCallId:O,output:ie}),q.sendMessage()}:()=>{},Se=s||[],Ia={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"},[Ba,La]=(0,tt.useState)(()=>Se.length===0?Ia:Se.find(O=>O.id===F)||Se[0]),[lt,vt]=(0,tt.useState)([]),[Ea,za]=(0,tt.useState)(!1),Ua=O=>{if(!O||!Z)return;let pe=[];Array.from(O).forEach(ie=>{if(ie.size>ee*1024*1024){alert(`File ${ie.name} is too large. Maximum size is ${ee}MB.`);return}if(Q.length>0&&!Q.some(ht=>ie.type.match(ht))){alert(`File type ${ie.type} is not allowed.`);return}let uo={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:ie,status:"pending",progress:0};if(ie.type.startsWith("image/")){let ht=new FileReader;ht.onload=Va=>{vt(Ga=>Ga.map(Et=>Et.id===uo.id?{...Et,preview:Va.target?.result}:Et))},ht.readAsDataURL(ie)}pe.push(uo)}),vt(ie=>[...ie,...pe])},Fa=O=>{vt(pe=>pe.filter(ie=>ie.id!==O))},mo=()=>{if(!(!k.trim()&<.length===0)){if(q){let O=lt.length>0?ja(lt.map(pe=>pe.file)):void 0;q.sendMessage({text:k,files:O},{body:{timestamp:Date.now()}}),j("")}else console.log("Message tt send:",k),console.log("Files tt upload:",lt),j(""),S(!0),setTimeout(()=>{S(!1)},1500);vt([])}},ja=O=>{let pe=new DataTransfer;return O.forEach(ie=>pe.items.add(ie)),pe.files},Oa=O=>{O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),mo())},Ha=O=>{j(O)};return(0,wt.jsx)(ca,{sidebarItems:l||[],title:Y,notifications:n||[],businessUnits:Se,currentBusinessUnit:Ba,onBusinessUnitChange:O=>{O&&(La(O),T?.(O))},onSearch:P,showTabs:!1,onActionClick:x,actionIcon:I,actionText:Te,onNotificationRemove:M,onRemoveAll:R,logo:W,appName:ae,tagline:le,sidebarInitiallyClosed:d,children:(0,wt.jsx)(Lt.AnimatePresence,{mode:"wait",children:(0,wt.jsx)(Lt.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,wt.jsxs)("div",{className:"h-full flex",children:[(0,wt.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,wt.jsx)(da,{sessions:p||[],currentSession:C,teams:Se,onNewChat:u,onSessionSelect:w,onSessionEdit:h,onSessionDelete:f})}),(0,wt.jsx)("div",{className:"flex-1 h-full p-2",children:(0,wt.jsx)(Ra,{messages:$||[],input:k,isTyping:we,currentSessionTitle:C?.title,capabilities:i||[],onInputChange:Ha,addToolResult:de,onSendMessage:mo,onKeyPress:Oa,fileUploads:lt,isDragOver:Ea,enableFileUpload:Z,onFileUpload:Ua,onRemoveFile:Fa,onDragOver:za})})]})},"chat-interface")})})}var Yi=[{id:"1",role:"user",parts:[{type:"text",text:"Hello, can you help me with a task?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:"Of course! I can help you create and manage tasks."}]},{id:"3",role:"user",parts:[{type:"text",text:"Here is a file with project requirements"},{type:"file",mimeType:"application/pdf",url:"/path/tt/file.pdf"}]},{id:"4",role:"assistant",parts:[{type:"text",text:"I'll create a task based on your requirements."},{type:"tool-task",toolCallId:"call-123",state:"output-available",input:{title:"Project Requirements Review",description:"Review and analyze the uploaded requirements document"},output:{id:"task-123",title:"Project Requirements Review",description:"Review and analyze the uploaded requirements document",status:"created",assignee:"AI Assistant",priority:"high"}}]},{id:"5",role:"assistant",parts:[{type:"text",text:"Here are some relevant resources for your project:"},{type:"data-reference",data:{references:[{id:"ref-1",title:"Project Management Best Practices",url:"https://example.com/pm-best-practices",description:"Comprehensive guide tt project management",type:"document"},{id:"ref-2",title:"Requirements Gathering Template",url:"https://example.com/requirements-template",description:"Template for gathering project requirements",type:"link"}]}}]},{id:"6",role:"assistant",parts:[{type:"text",text:"What would you like tt do next?"},{type:"data-menu",data:{title:"Available Actions",items:[{id:"action-1",label:"Create another task",description:"Set up a new task for the project",action:()=>console.log("Create task clicked")},{id:"action-2",label:"View project timeline",description:"See the project schedule and milestones",action:()=>console.log("View timeline clicked")},{id:"action-3",label:"Assign team members",description:"Add team members tt the project",action:()=>console.log("Assign team clicked")}]}}]}];function Zi(){return(0,wt.jsx)(Aa,{messages:Yi,businessUnits:[{id:"engineering",name:"Engineering",description:"Software development team",icon:"\u2699\uFE0F",color:"bg-blue-500",accentColor:"bg-blue-600"}],capabilities:[],sessions:[],onNewChat:()=>console.log("New chat started"),onSessionSelect:e=>console.log("Session selected:",e),onSessionDelete:e=>console.log("Session deleted:",e),enableFileUpload:!0,title:"AI Assistant"})}0&&(module.exports={ExampleChatInterface});
|