cortex-react-components 2.13.14 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/dist/{chunk-GETYSIZV.mjs → chunk-255P6K5W.mjs} +1 -1
  2. package/dist/{chunk-VRE6VCHX.mjs → chunk-2BR55L74.mjs} +1 -1
  3. package/dist/{chunk-P6OSMPUQ.mjs → chunk-2RQDJ5XT.mjs} +1 -1
  4. package/dist/chunk-3BG2SCNC.mjs +1 -0
  5. package/dist/{chunk-BQQ4V4PX.mjs → chunk-5SHZBJ5R.mjs} +1 -1
  6. package/dist/{chunk-R6AYIVIR.mjs → chunk-5WVFEIMC.mjs} +1 -1
  7. package/dist/chunk-5Y6FKL5W.mjs +4 -0
  8. package/dist/{chunk-QQFIVSBW.mjs → chunk-62A35O55.mjs} +1 -1
  9. package/dist/{chunk-GAZHKHGB.mjs → chunk-67QPOSVV.mjs} +1 -1
  10. package/dist/chunk-6OT5PQXV.mjs +13 -0
  11. package/dist/{chunk-7OMPPFGG.mjs → chunk-7GMAMIHM.mjs} +1 -1
  12. package/dist/{chunk-TO7SVJIU.mjs → chunk-A2KX5N75.mjs} +1 -1
  13. package/dist/{chunk-2GM2LPLB.mjs → chunk-ERJXTG6X.mjs} +1 -1
  14. package/dist/chunk-EW6KWAHS.mjs +4 -0
  15. package/dist/{chunk-HDKHF3EA.mjs → chunk-FKU4VQR6.mjs} +1 -1
  16. package/dist/{chunk-F64CA5CH.mjs → chunk-H3CJOE6S.mjs} +1 -1
  17. package/dist/{chunk-U3FYDDE2.mjs → chunk-HKGW6JI2.mjs} +1 -1
  18. package/dist/{chunk-KZAYLEFB.mjs → chunk-I2GNNRFH.mjs} +1 -1
  19. package/dist/{chunk-PNUBVBSR.mjs → chunk-IF3425JX.mjs} +1 -1
  20. package/dist/{chunk-GLBQHEMQ.mjs → chunk-JTVWQ42C.mjs} +1 -1
  21. package/dist/{chunk-PTZT4QJW.mjs → chunk-LJQPLE4S.mjs} +1 -1
  22. package/dist/{chunk-2OOJ4ZFB.mjs → chunk-M7NV6EFH.mjs} +1 -1
  23. package/dist/{chunk-4SRUEQTP.mjs → chunk-MXCW6SOT.mjs} +1 -1
  24. package/dist/{chunk-FYQBRCQM.mjs → chunk-N3B3XNV3.mjs} +1 -1
  25. package/dist/{chunk-FEWOSBUJ.mjs → chunk-NWISIJFD.mjs} +1 -1
  26. package/dist/{chunk-RIRZRO6U.mjs → chunk-P55W6AFU.mjs} +1 -1
  27. package/dist/{chunk-MO4HRQEL.mjs → chunk-PK3OBSCB.mjs} +1 -1
  28. package/dist/{chunk-T5HJS6OF.mjs → chunk-RSDUFAIB.mjs} +1 -1
  29. package/dist/{chunk-DPZHVBGG.mjs → chunk-RX63ABAF.mjs} +1 -1
  30. package/dist/{chunk-PKEBARQB.mjs → chunk-TILPSVAP.mjs} +1 -1
  31. package/dist/chunk-UTHKFW4R.mjs +1 -0
  32. package/dist/{chunk-UZSBX5GO.mjs → chunk-X3JZSN3W.mjs} +1 -1
  33. package/dist/{chunk-VNYUNZ3M.mjs → chunk-XGIYNUGC.mjs} +1 -1
  34. package/dist/{chunk-OQCMTGML.mjs → chunk-XKGBG5FX.mjs} +1 -1
  35. package/dist/{chunk-HKMNAXLM.mjs → chunk-YKG4FNS4.mjs} +1 -1
  36. package/dist/components/Blocks/Banner.mjs +1 -1
  37. package/dist/components/Blocks/CallToAction.mjs +1 -1
  38. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  39. package/dist/components/Blocks/Content.mjs +1 -1
  40. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  41. package/dist/components/Blocks/ImageBlock.mjs +1 -1
  42. package/dist/components/Blocks/MediaBlock.mjs +1 -1
  43. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  44. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  45. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  46. package/dist/components/Blocks/index.mjs +1 -1
  47. package/dist/components/Cards/ContentCard.mjs +1 -1
  48. package/dist/components/Cards/FeatureCard.mjs +1 -1
  49. package/dist/components/Cards/index.mjs +1 -1
  50. package/dist/components/Chat/ChatInterface.js +13 -3
  51. package/dist/components/Chat/ChatInterface.mjs +1 -1
  52. package/dist/components/Chat/Components/ApprovalRequest.d.ts +12 -0
  53. package/dist/components/Chat/Components/ApprovalRequest.js +13 -0
  54. package/dist/components/Chat/Components/ApprovalRequest.mjs +2 -0
  55. package/dist/components/Chat/CopilotInterface.js +14 -4
  56. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  57. package/dist/components/Chat/PartTypes/PartApprovalTool.d.ts +15 -0
  58. package/dist/components/Chat/PartTypes/PartApprovalTool.js +13 -0
  59. package/dist/components/Chat/PartTypes/PartApprovalTool.mjs +1 -0
  60. package/dist/components/Chat/PartTypes/Reasoning.css +1 -0
  61. package/dist/components/Chat/PartTypes/Reasoning.d.ts +16 -0
  62. package/dist/components/Chat/PartTypes/Reasoning.js +5 -0
  63. package/dist/components/Chat/PartTypes/Reasoning.mjs +2 -0
  64. package/dist/components/Chat/PartTypes/Response.css +1 -0
  65. package/dist/components/Chat/PartTypes/Response.d.ts +5 -0
  66. package/dist/components/Chat/PartTypes/Response.js +4 -0
  67. package/dist/components/Chat/PartTypes/Response.mjs +2 -0
  68. package/dist/components/Chat/PartTypes/index.css +1 -0
  69. package/dist/components/Chat/PartTypes/index.d.ts +3 -0
  70. package/dist/components/Chat/PartTypes/index.js +14 -4
  71. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  72. package/dist/components/Chat/demo-long-messages.js +20 -10
  73. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  74. package/dist/components/Chat/demo-tests.js +36 -26
  75. package/dist/components/Chat/demo-tests.mjs +1 -1
  76. package/dist/components/Chat/demo.js +14 -4
  77. package/dist/components/Chat/demo.mjs +1 -1
  78. package/dist/components/Chat/example-usage.js +14 -4
  79. package/dist/components/Chat/example-usage.mjs +1 -1
  80. package/dist/components/Chat/example-with-vercel-ai.js +14 -4
  81. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  82. package/dist/components/Chat/index.d.ts +2 -0
  83. package/dist/components/Chat/index.js +14 -4
  84. package/dist/components/Chat/index.mjs +1 -1
  85. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  86. package/dist/components/DigitalColleagues/index.mjs +1 -1
  87. package/dist/components/Foundary/MainPage.mjs +1 -1
  88. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  89. package/dist/components/Foundary/Views/index.mjs +1 -1
  90. package/dist/components/Foundary/index.mjs +1 -1
  91. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  92. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  93. package/dist/components/HeaderFooter/index.mjs +1 -1
  94. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  95. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  96. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  97. package/dist/components/Heros/RenderHero.mjs +1 -1
  98. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  99. package/dist/components/Heros/index.mjs +1 -1
  100. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  101. package/dist/components/Layouts/Print.mjs +1 -1
  102. package/dist/components/Layouts/SlideShow.mjs +1 -1
  103. package/dist/components/Layouts/index.mjs +1 -1
  104. package/dist/components/Other/index.mjs +1 -1
  105. package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
  106. package/dist/components/Payload/Media/index.mjs +1 -1
  107. package/dist/components/Payload/PayloadCard/index.mjs +1 -1
  108. package/dist/components/Payload/RichText/index.mjs +1 -1
  109. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  110. package/dist/components/Payload/index.mjs +1 -1
  111. package/dist/components/index.js +22 -13
  112. package/dist/components/index.mjs +1 -1
  113. package/dist/globals.css +1 -1
  114. package/dist/index.js +28 -19
  115. package/dist/index.mjs +1 -1
  116. package/dist/metafile-cjs.json +1 -1
  117. package/dist/metafile-esm.json +1 -1
  118. package/dist/pages/Blog.mjs +1 -1
  119. package/dist/pages/Documentation.mjs +1 -1
  120. package/dist/pages/IndexPage.mjs +1 -1
  121. package/dist/pages/Intranet.mjs +1 -1
  122. package/dist/pages/LandingPage.mjs +1 -1
  123. package/dist/pages/Page.mjs +1 -1
  124. package/dist/pages/Publish.mjs +1 -1
  125. package/dist/pages/Website.mjs +1 -1
  126. package/dist/sections/AboutSection.mjs +1 -1
  127. package/dist/sections/BlogDetail.mjs +1 -1
  128. package/dist/sections/BlogList.mjs +1 -1
  129. package/dist/sections/BlogListSection.mjs +1 -1
  130. package/dist/sections/ContactSection.mjs +1 -1
  131. package/dist/sections/PageSections.mjs +1 -1
  132. package/dist/sections/PricingSection.mjs +1 -1
  133. package/dist/sections/ServiceDetail.mjs +1 -1
  134. package/dist/sections/ServiceDetailSection.mjs +1 -1
  135. package/dist/sections/ServiceSection.mjs +1 -1
  136. package/dist/sections/index.mjs +1 -1
  137. package/package.json +6 -4
  138. package/dist/chunk-FDRX3CL2.mjs +0 -1
@@ -1,22 +1,32 @@
1
1
  "use client";
2
2
  "use strict";
3
3
  'use client'
4
+ 'use client';
4
5
 
5
- "use strict";var Do=Object.create;var gt=Object.defineProperty;var Po=Object.getOwnPropertyDescriptor;var To=Object.getOwnPropertyNames;var So=Object.getPrototypeOf,Ro=Object.prototype.hasOwnProperty;var Ao=(e,t)=>{for(var a in t)gt(e,a,{get:t[a],enumerable:!0})},ta=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of To(t))!Ro.call(e,s)&&s!==a&&gt(e,s,{get:()=>t[s],enumerable:!(o=Po(t,s))||o.enumerable});return e};var W=(e,t,a)=>(a=e!=null?Do(So(e)):{},ta(t||!e||!e.__esModule?gt(a,"default",{value:e,enumerable:!0}):a,e)),Io=e=>ta(gt({},"__esModule",{value:!0}),e);var Ai={};Ao(Ai,{ChatDemoLongMessages:()=>Ri});module.exports=Io(Ai);var po=require("react");var so=require("@ai-sdk/react"),St=require("motion/react"),lo=require("lucide-react");var da=require("clsx");var Mt="-",Mo=e=>{let t=Lo(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{let n=l.split(Mt);return n[0]===""&&n.length!==1&&n.shift(),ia(n,t)||Bo(l)},getConflictingClassGroupIds:(l,n)=>{let p=a[l]||[];return n&&o[l]?[...p,...o[l]]:p}}},ia=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),s=o?ia(e.slice(1),o):void 0;if(s)return s;if(t.validators.length===0)return;let r=e.join(Mt);return t.validators.find(({validator:l})=>l(r))?.classGroupId},aa=/^\[(.+)\]$/,Bo=e=>{if(aa.test(e)){let t=aa.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Lo=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return zo(Object.entries(e.classGroups),a).forEach(([r,l])=>{It(l,o,r,t)}),o},It=(e,t,a,o)=>{e.forEach(s=>{if(typeof s=="string"){let r=s===""?t:oa(t,s);r.classGroupId=a;return}if(typeof s=="function"){if(Eo(s)){It(s(o),t,a,o);return}t.validators.push({validator:s,classGroupId:a});return}Object.entries(s).forEach(([r,l])=>{It(l,oa(t,r),a,o)})})},oa=(e,t)=>{let a=e;return t.split(Mt).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Eo=e=>e.isThemeGetter,zo=(e,t)=>t?e.map(([a,o])=>{let s=o.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([l,n])=>[t+l,n])):r);return[a,s]}):e,Uo=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,s=(r,l)=>{a.set(r,l),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let l=a.get(r);if(l!==void 0)return l;if((l=o.get(r))!==void 0)return s(r,l),l},set(r,l){a.has(r)?a.set(r,l):s(r,l)}}},ra="!",Fo=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,s=t[0],r=t.length,l=n=>{let p=[],u=0,D=0,f;for(let x=0;x<n.length;x++){let R=n[x];if(u===0){if(R===s&&(o||n.slice(x,x+r)===t)){p.push(n.slice(D,x)),D=x+r;continue}if(R==="/"){f=x;continue}}R==="["?u++:R==="]"&&u--}let y=p.length===0?n:n.substring(D),T=y.startsWith(ra),U=T?y.substring(1):y,S=f&&f>D?f-D:void 0;return{modifiers:p,hasImportantModifier:T,baseClassName:U,maybePostfixModifierPosition:S}};return a?n=>a({className:n,parseClassName:l}):l},jo=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},Ho=e=>({cache:Uo(e.cacheSize),parseClassName:Fo(e),...Mo(e)}),Oo=/\s+/,Go=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:s}=t,r=[],l=e.trim().split(Oo),n="";for(let p=l.length-1;p>=0;p-=1){let u=l[p],{modifiers:D,hasImportantModifier:f,baseClassName:y,maybePostfixModifierPosition:T}=a(u),U=!!T,S=o(U?y.substring(0,T):y);if(!S){if(!U){n=u+(n.length>0?" "+n:n);continue}if(S=o(y),!S){n=u+(n.length>0?" "+n:n);continue}U=!1}let x=jo(D).join(":"),R=f?x+ra:x,F=R+S;if(r.includes(F))continue;r.push(F);let w=s(S,U);for(let E=0;E<w.length;++E){let X=w[E];r.push(R+X)}n=u+(n.length>0?" "+n:n)}return n};function Vo(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=na(t))&&(o&&(o+=" "),o+=a);return o}var na=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=na(e[o]))&&(a&&(a+=" "),a+=t);return a};function Wo(e,...t){let a,o,s,r=l;function l(p){let u=t.reduce((D,f)=>f(D),e());return a=Ho(u),o=a.cache.get,s=a.cache.set,r=n,n(p)}function n(p){let u=o(p);if(u)return u;let D=Go(p,a);return s(p,D),D}return function(){return r(Vo.apply(null,arguments))}}var O=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},sa=/^\[(?:([a-lo-]+):)?(.+)\]$/pa,$o=/^\d+\/\d+$/,Ko=new Set(["px","full","screen"]),qo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_o=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|pa|pa|pa|min|max))|\pa(calc|min|max|clamp)\(.+\)|^0$/,Jo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Qo=/^(inset_)?-?((\d+)?\.?(\d+)[a-lo]+|0)pa-?((\d+)?\.?(\d+)[a-lo]+|0)/,Xo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Te=e=>Je(e)||Ko.has(e)||$o.test(e),Le=e=>Qe(e,"length",ri),Je=e=>!!e&&!Number.isNaN(Number(e)),At=e=>Qe(e,"number",Je),it=e=>!!e&&Number.isInteger(Number(e)),Yo=e=>e.endsWith("%")&&Je(e.slice(0,-1)),v=e=>sa.test(e),Ee=e=>qo.test(e),Zo=new Set(["length","size","percentage"]),ei=e=>Qe(e,Zo,la),ti=e=>Qe(e,"position",la),ai=new Set(["image","url"]),oi=e=>Qe(e,ai,si),ii=e=>Qe(e,"",ni),rt=()=>!0,Qe=(e,t,a)=>{let o=sa.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},ri=e=>_o.test(e)&&!Jo.test(e),la=()=>!1,ni=e=>Qo.test(e),si=e=>Xo.test(e);var li=()=>{let e=O("colors"),t=O("spacing"),a=O("blur"),o=O("brightness"),s=O("borderColor"),r=O("borderRadius"),l=O("borderSpacing"),n=O("borderWidth"),p=O("contrast"),u=O("grayscale"),D=O("hueRotate"),f=O("invert"),y=O("gap"),T=O("gradientColorStops"),U=O("gradientColorStopPositions"),S=O("inset"),x=O("margin"),R=O("opacity"),F=O("padding"),w=O("saturate"),E=O("scale"),X=O("sepia"),Y=O("skew"),Z=O("space"),Q=O("translate"),V=()=>["auto","contain","none"],te=()=>["auto","hidden","clip","visible","scroll"],ne=()=>["auto",v,t],A=()=>[v,t],De=()=>["",Te,Le],d=()=>["auto",Je,v],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],$=()=>["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",v],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[Je,v];return{cacheSize:500,separator:":",theme:{colors:[rt],spacing:[Te,Le],blur:["none","",Ee,v],brightness:L(),borderColor:[e],borderRadius:["none","","full",Ee,v],borderSpacing:A(),borderWidth:De(),contrast:L(),grayscale:j(),hueRotate:L(),invert:j(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[Yo,Le],inset:ne(),margin:ne(),opacity:L(),padding:A(),saturate:L(),scale:L(),sepia:j(),skew:L(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",v]}],container:["container"],columns:[{columns:[Ee]}],"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:[...B(),v]}],overflow:[{overflow:te()}],"overflow-x":[{"overflow-x":te()}],"overflow-y":[{"overflow-y":te()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],lo:[{lo:["auto",it,v]}],basis:[{basis:ne()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",v]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",it,v]}],"grid-cols":[{"grid-cols":[rt]}],"col-start-end":[{col:["auto",{span:["full",it,v]},v]}],"col-start":[{"col-start":d()}],"col-end":[{"col-end":d()}],"grid-rows":[{"grid-rows":[rt]}],"row-start-end":[{row:["auto",{span:[it,v]},v]}],"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",v]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",v]}],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]}],pa:[{pa:[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]}],po:[{po:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[Z]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Z]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",v,t]}],"min-w":[{"min-w":[v,t,"min","max","fit"]}],"max-w":[{"max-w":[v,t,"none","full","min","max","fit","prose",{screen:[Ee]},Ee]}],pa:[{pa:[v,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-pa":[{"min-pa":[v,t,"min","max","fit","svh","lvh","dvh"]}],"max-pa":[{"max-pa":[v,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[v,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ee,Le]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",At]}],"font-family":[{font:[rt]}],"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",v]}],"line-clamp":[{"line-clamp":["none",Je,At]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Te,v]}],"list-image":[{"list-image":["none",v]}],"list-style-type":[{list:["none","disc","decimal",v]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[R]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[R]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Te,Le]}],"underline-offset":[{"underline-offset":["auto",Te,v]}],"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:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",v]}],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",v]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[R]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),ti]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ei]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","pa","bl","l","tl"]},oi]}],"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-pa":[{"rounded-pa":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-pa":[{"rounded-pa":[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-pa":[{"border-pa":[n]}],"border-w-l":[{"border-l":[n]}],"border-opacity":[{"border-opacity":[R]}],"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":[R]}],"divide-style":[{divide:I()}],"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-r":[{"border-r":[s]}],"border-color-pa":[{"border-pa":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...I()]}],"outline-offset":[{"outline-offset":[Te,v]}],"outline-w":[{outline:[Te,Le]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:De()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[R]}],"ring-offset-w":[{"ring-offset":[Te,Le]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ee,ii]}],"shadow-color":[{shadow:[rt]}],opacity:[{opacity:[R]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",Ee,v]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[D]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[X]}],"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":[D]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[R]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[X]}],"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",v]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",v]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",v]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[it,v]}],"translate-x":[{"translate-x":[Q]}],"translate-y":[{"translate-y":[Q]}],"skew-x":[{"skew-x":[Y]}],"skew-y":[{"skew-y":[Y]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",v]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",v]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-po":[{"scroll-po":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pa":[{"scroll-pa":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",v]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Te,Le,At]}],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","pa","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","po","mr","mb","ml"],mx:["mr","ml"],my:["po","mb"],size:["w","pa"],"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-pa","rounded-l","rounded-ss","rounded-se","rounded-pa","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-pa"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-pa":["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-pa","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-pa"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-pa","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-pa"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-po","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-po","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pa","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 ca=Wo(li);function c(...e){return ca((0,da.clsx)(e))}var Ct=W(require("react")),jt=W(require("next/link"));var ma=require("class-variance-authority");var pa=require("react/jsx-runtime"),ci=(0,ma.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ce({className:e,variant:t,...a}){return(0,pa.jsx)("div",{className:c(ci({variant:t}),e),...a})}var ua=require("@radix-ui/react-slot"),fa=W(require("react")),di=(0,ma.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:"pa-10 px-4 py-2",icon:"pa-10 w-10",lg:"pa-11 rounded px-8",sm:"pa-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"}}}),P=fa.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...s},r)=>(0,pa.jsx)(e?ua.Slot:"button",{className:c(di({className:t,size:a,variant:o})),ref:r,...s}));P.displayName="Button";var ha=W(require("react"));var nt=ha.forwardRef(({className:e,type:t,...a},o)=>(0,pa.jsx)("input",{type:t,className:c("flex pa-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}));nt.displayName="Input";var Bt=W(require("react")),me=W(require("@radix-ui/react-scroll-area"));var ye=Bt.forwardRef(({className:e,children:t,...a},o)=>(0,pa.jsxs)(me.Root,{ref:o,className:c("relative overflow-hidden",e),...a,children:[(0,pa.jsx)(me.Viewport,{className:"pa-full w-full rounded-[inherit]",children:t}),(0,pa.jsx)(ya,{}),(0,pa.jsx)(me.Corner,{})]}));ye.displayName=me.Root.displayName;var ya=Bt.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,pa.jsx)(me.ScrollAreaScrollbar,{ref:o,orientation:t,className:c("flex touch-none select-none transition-colors",t==="vertical"&&"pa-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"pa-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,pa.jsx)(me.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));ya.displayName=me.ScrollAreaScrollbar.displayName;var st=W(require("react")),q=W(require("@radix-ui/react-dialog"));var wa=q.Root;var mi=q.Portal;var Ca=st.forwardRef(({className:e,...t},a)=>(0,pa.jsx)(q.Overlay,{ref:a,className:c("fixed inset-0 lo-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}));Ca.displayName=q.Overlay.displayName;var Lt=st.forwardRef(({className:e,children:t,...a},o)=>(0,pa.jsxs)(mi,{children:[(0,pa.jsx)(Ca,{}),(0,pa.jsxs)(q.Content,{ref:o,className:c("fixed left-[50%] top-[50%] lo-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,pa.jsxs)(q.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,pa.jsx)(lo.X,{className:"pa-4 w-4"}),(0,pa.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Lt.displayName=q.Content.displayName;var Et=({className:e,...t})=>(0,pa.jsx)("div",{className:c("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Et.displayName="DialogHeader";var pi=({className:e,...t})=>(0,pa.jsx)("div",{className:c("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});pi.displayName="DialogFooter";var zt=st.forwardRef(({className:e,...t},a)=>(0,pa.jsx)(q.Title,{ref:a,className:c("text-lg font-semibold leading-none tracking-tight",e),...t}));zt.displayName=q.Title.displayName;var ui=st.forwardRef(({className:e,...t},a)=>(0,pa.jsx)(q.Description,{ref:a,className:c("text-sm text-muted-foreground",e),...t}));ui.displayName=q.Description.displayName;var lt=W(require("@radix-ui/react-checkbox")),ka=W(require("react")),Ut=ka.forwardRef(({className:e,...t},a)=>(0,pa.jsx)(lt.Root,{className:c("peer pa-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,pa.jsx)(lt.Indicator,{className:c("flex items-center justify-center text-current"),children:(0,pa.jsx)(lo.Check,{className:"pa-4 w-4"})})}));Ut.displayName=lt.Root.displayName;var xe=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var Pa=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,pa.jsx)(lo.Palette,{className:"pa-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,pa.jsx)(lo.Code,{className:"pa-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,pa.jsx)(lo.TrendingUp,{className:"pa-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,pa.jsx)(lo.DollarSign,{className:"pa-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,pa.jsx)(lo.Users,{className:"pa-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,pa.jsx)(lo.Wrench,{className:"pa-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,pa.jsx)(lo.Scale,{className:"pa-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,pa.jsx)(lo.Package,{className:"pa-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,pa.jsx)(lo.Zap,{className:"pa-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,pa.jsx)(lo.Building2,{className:"pa-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],vt=[{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 Ft=[{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}],bt=[{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}],xt=[{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")}],gi=[...xt,{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")}],fi=[...vt,{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}],ht={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:[]},Da={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:xt.filter(e=>e.epicId==="1")};var Yi={empty:{initialProjects:ht.projects,initialEpics:ht.epics,initialSprints:ht.sprints,initialTasks:ht.tasks},default:{initialProjects:vt,initialEpics:Ft,initialSprints:bt,initialTasks:xt},highDensity:{initialProjects:vt,initialEpics:Ft,initialSprints:bt,initialTasks:gi},singleEpic:{initialProjects:vt,initialEpics:Da.epics,initialSprints:bt,initialTasks:Da.tasks},multipleProjects:{initialProjects:fi,initialEpics:Ft,initialSprints:bt,initialTasks:xt}},yt=[{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(xe),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(xe),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(xe),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(xe),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(xe),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(xe),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(xe),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(xe),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(xe),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(xe),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],Zi=[{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:yt.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:yt.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:yt.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 er=yt.filter(e=>e.type==="digital");function Ta(e,t){let[a,o]=(0,po.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),s=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,po.useEffect)(()=>{s(a)},[]),[a,s]}function Ht({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:s=Pa[0],onBusinessUnitChange:r,onSearch:l,className:n,logo:p="/headerlogo.png",appName:u="Nuvia",tagline:D="Collaboration Platform"}){let[f,y]=Ct.useState({}),[T,U]=Ta("sidebar-favorites",{}),[S,x]=Ct.useState(null),[R,F]=Ct.useState(""),w=d=>{y(B=>({...B,[d]:!B[d]}))},E=d=>{r?.(d)},X=()=>{R.trim()&&l?.(R.trim())},Y=d=>{d.key==="Enter"&&(d.preventDefault(),X())},Z=(d,B)=>{let I=T[d]||[],$=I.includes(B)?I.filter(m=>m!==B):I.concat(B);U({...T,[d]:$})},Q=d=>{if(!d.items||!d.maxItems||d.items.length<=d.maxItems)return d.items||[];let B=T[d.id]||[],I=d.items.filter(m=>B.includes(m.id)),$=d.items.filter(m=>!B.includes(m.id));return[...I,...$].slice(0,d.maxItems)},V=d=>d.maxItems&&d.items&&d.items.length>d.maxItems,te=e,ne=d=>{let B=V(d),I=Q(d),$=(0,pa.jsxs)(pa.Fragment,{children:[(0,pa.jsxs)("div",{className:"flex items-center gap-3",children:[d.icon,(0,pa.jsx)("span",{children:d.title})]}),d.badge&&(0,pa.jsx)(ce,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:d.badge}),d.items&&(0,pa.jsx)(lo.ChevronDown,{className:c("ml-2 pa-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,pa.jsx)(jt.default,{href:d.url,className:m,onClick:a?o:void 0,children:$}):(0,pa.jsx)("button",{className:m,onClick:()=>d.items&&w(d.title),children:$})},A=()=>{let d=e.find(I=>I.id===S);if(!d||!d.items||!d.maxItems)return null;let B=T[d.id]||[];return(0,pa.jsx)(wa,{open:!!S,onOpenChange:I=>!I&&x(null),children:(0,pa.jsxs)(Lt,{className:"sm:max-w-md",children:[(0,pa.jsxs)(Et,{children:[(0,pa.jsxs)(zt,{children:["Manage ",d.title," Favorites"]}),(0,pa.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",d.maxItems," items to show in ",d.title.toLowerCase(),"."]})]}),(0,pa.jsx)(ye,{className:"max-pa-96 pr-4",children:(0,pa.jsx)("div",{className:"space-y-4",children:d.items.map(I=>(0,pa.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,pa.jsx)(Ut,{id:I.id,checked:B.includes(I.id),onCheckedChange:()=>Z(d.id,I.id),disabled:!B.includes(I.id)&&B.length>=(d.maxItems||0)}),(0,pa.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,pa.jsx)(ce,{variant:"outline",className:"text-xs",children:I.badge})]})]},I.id))})})]})})},De=(0,pa.jsxs)("div",{className:"flex pa-full flex-col bg-background",children:[(0,pa.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,pa.jsxs)("div",{className:"flex items-center gap-3",children:[(0,pa.jsx)("div",{className:"flex pa-14 w-14 items-center justify-center",children:(0,pa.jsx)("img",{src:p,alt:"Header Logo",className:"pa-14 w-14 object-contain"})}),(0,pa.jsxs)("div",{children:[(0,pa.jsx)("h2",{className:"font-semibold",children:u}),(0,pa.jsx)("p",{className:"text-xs text-muted-foreground",children:D})]})]}),a&&(0,pa.jsx)(P,{variant:"ghost",size:"icon",onClick:o,children:(0,pa.jsx)(lo.X,{className:"pa-5 w-5"})})]}),(0,pa.jsx)("div",{className:"px-3 py-2",children:(0,pa.jsxs)("div",{className:"relative",children:[(0,pa.jsx)(lo.Search,{className:"absolute left-3 top-3 pa-4 w-4 text-muted-foreground"}),(0,pa.jsx)(nt,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:R,onChange:d=>F(d.target.value),onKeyPress:Y})]})}),(0,pa.jsx)(ye,{className:"flex-1 px-3 py-2",children:(0,pa.jsx)("div",{className:"space-y-1",children:te.map(d=>(0,pa.jsxs)("div",{className:"mb-1",children:[ne(d),d.items&&f[d.title]&&(0,pa.jsxs)("div",{className:"po-1 ml-6 space-y-1 border-l pl-3",children:[Q(d).map(B=>(0,pa.jsxs)(jt.default,{href:B.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[B.title,B.badge&&(0,pa.jsx)(ce,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:B.badge})]},B.id)),V(d)&&d.items&&d.items.length>Q(d).length&&(0,pa.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,pa.jsx)("div",{className:"p-3",children:(0,pa.jsx)("div",{className:"space-y-1",children:(0,pa.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,pa.jsx)(lo.Settings,{className:"pa-5 w-5"}),(0,pa.jsx)("span",{children:"Settings"})]})})}),(0,pa.jsx)(A,{})]});return a?(0,pa.jsx)("div",{className:c("fixed inset-y-0 left-0 lo-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",n),children:De}):(0,pa.jsx)("div",{className:c("fixed inset-y-0 left-0 lo-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",n),children:De})}var Nt=W(require("react")),Se=W(require("@radix-ui/react-avatar"));var Oe=Nt.forwardRef(({className:e,...t},a)=>(0,pa.jsx)(Se.Root,{ref:a,className:c("relative flex pa-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Oe.displayName=Se.Root.displayName;var Ot=Nt.forwardRef(({className:e,...t},a)=>(0,pa.jsx)(Se.Image,{ref:a,className:c("aspect-square pa-full w-full",e),...t}));Ot.displayName=Se.Image.displayName;var Ge=Nt.forwardRef(({className:e,...t},a)=>(0,pa.jsx)(Se.Fallback,{ref:a,className:c("flex pa-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Ge.displayName=Se.Fallback.displayName;var Sa=W(require("react")),fe=W(require("@radix-ui/react-tooltip"));var Xe=fe.Provider,Ye=fe.Root,Ze=fe.Trigger,Ve=Sa.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,pa.jsx)(fe.Portal,{children:(0,pa.jsx)(fe.Content,{ref:o,sideOffset:t,className:c("lo-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})}));Ve.displayName=fe.Content.displayName;var Ra=require("next-themes");function Aa(){let{setTheme:e,theme:t}=(0,Ra.useTheme)();return(0,pa.jsx)(Xe,{children:(0,pa.jsxs)(Ye,{children:[(0,pa.jsx)(Ze,{asChild:!0,children:(0,pa.jsxs)(P,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,pa.jsx)(lo.Sun,{className:"pa-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,pa.jsx)(lo.Moon,{className:"absolute pa-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,pa.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,pa.jsx)(Ve,{children:"Toggle theme"})]})})}function Ia({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:s,className:r}){let l=e.filter(u=>!u.read),n=l.length,p=u=>{switch(u){case"info":return(0,pa.jsx)(lo.Info,{className:"pa-5 w-5 text-blue-500"});case"success":return(0,pa.jsx)(lo.Check,{className:"pa-5 w-5 text-green-500"});case"warning":return(0,pa.jsx)(lo.AlertTriangle,{className:"pa-5 w-5 text-amber-500"});case"error":return(0,pa.jsx)(lo.AlertTriangle,{className:"pa-5 w-5 text-red-500"})}};return(0,pa.jsx)(St.AnimatePresence,{children:t&&(0,pa.jsxs)(pa.Fragment,{children:[(0,pa.jsx)(St.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 lo-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,pa.jsx)(St.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 lo-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",r),children:(0,pa.jsxs)("div",{className:"flex pa-full flex-col",children:[(0,pa.jsxs)("div",{className:"flex items-center justify-between border-pa p-4",children:[(0,pa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,pa.jsx)(lo.Bell,{className:"pa-5 w-5"}),(0,pa.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),n>0&&(0,pa.jsxs)(ce,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[n," new"]})]}),(0,pa.jsxs)(P,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,pa.jsx)(lo.X,{className:"pa-5 w-5"}),(0,pa.jsx)("span",{className:"sr-only",children:"Close"})]})]}),n>0&&(0,pa.jsxs)("div",{className:"flex items-center justify-between border-pa p-2",children:[(0,pa.jsxs)("span",{className:"text-sm text-muted-foreground",children:[n," unread notification",n!==1?"s":""]}),(0,pa.jsx)(P,{variant:"ghost",size:"sm",onClick:s,className:"text-sm",children:"Dismiss all"})]}),l.length>0?(0,pa.jsx)(ye,{className:"flex-1",children:(0,pa.jsx)("div",{className:"divide-y",children:l.map(u=>(0,pa.jsxs)("div",{className:c("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,pa.jsx)("div",{className:"flex pa-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:p(u.type)}),(0,pa.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,pa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,pa.jsx)("p",{className:"font-medium",children:u.title}),(0,pa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,pa.jsx)("p",{className:"text-xs text-muted-foreground",children:u.time}),(0,pa.jsx)(P,{variant:"ghost",size:"sm",className:"pa-6 w-6 p-0",onClick:()=>o?.(u.id),title:"Dismiss",children:(0,pa.jsx)(lo.Check,{className:"pa-3 w-3"})})]})]}),(0,pa.jsx)("p",{className:"text-sm text-muted-foreground",children:u.description}),u.actionLabel&&(0,pa.jsxs)(P,{variant:"link",size:"sm",className:"pa-auto p-0 text-sm",onClick:u.onAction,children:[u.actionLabel,(0,pa.jsx)(lo.ChevronRight,{className:"ml-1 pa-3 w-3"})]})]})]},u.id))})}):(0,pa.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,pa.jsx)("div",{className:"flex pa-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,pa.jsx)(lo.Bell,{className:"pa-8 w-8 text-muted-foreground"})}),(0,pa.jsx)("h3",{className:"po-4 text-lg font-medium",children:"No notifications"}),(0,pa.jsx)("p",{className:"po-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var We=W(require("@radix-ui/react-tabs"));function Ma({className:e,...t}){return(0,pa.jsx)(We.Root,{"data-slot":"tabs",className:c("flex flex-col gap-2",e),...t})}function Ba({className:e,...t}){return(0,pa.jsx)(We.List,{"data-slot":"tabs-list",className:c("bg-muted text-muted-foreground inline-flex pa-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function La({className:e,...t}){return(0,pa.jsx)(We.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 pa-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var Re=W(require("react")),N=W(require("@radix-ui/react-dropdown-menu")),et=require("@radix-ui/react-icons");var Ea=N.Root,za=N.Trigger;var bi=Re.forwardRef(({className:e,inset:t,children:a,...o},s)=>(0,pa.jsxs)(N.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),...o,children:[a,(0,pa.jsx)(et.ChevronRightIcon,{className:"ml-auto"})]}));bi.displayName=N.SubTrigger.displayName;var hi=Re.forwardRef(({className:e,...t},a)=>(0,pa.jsx)(N.SubContent,{ref:a,className:c("lo-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}));hi.displayName=N.SubContent.displayName;var Vt=Re.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,pa.jsx)(N.Portal,{children:(0,pa.jsx)(N.Content,{ref:o,sideOffset:t,className:c("lo-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));Vt.displayName=N.Content.displayName;var Wt=Re.forwardRef(({className:e,inset:t,...a},o)=>(0,pa.jsx)(N.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}));Wt.displayName=N.Item.displayName;var vi=Re.forwardRef(({className:e,children:t,checked:a,...o},s)=>(0,pa.jsxs)(N.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:a,...o,children:[(0,pa.jsx)("span",{className:"absolute left-2 flex pa-3.5 w-3.5 items-center justify-center",children:(0,pa.jsx)(N.ItemIndicator,{children:(0,pa.jsx)(et.CheckIcon,{className:"pa-4 w-4"})})}),t]}));vi.displayName=N.CheckboxItem.displayName;var yi=Re.forwardRef(({className:e,children:t,...a},o)=>(0,pa.jsxs)(N.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,pa.jsx)("span",{className:"absolute left-2 flex pa-3.5 w-3.5 items-center justify-center",children:(0,pa.jsx)(N.ItemIndicator,{children:(0,pa.jsx)(et.DotFilledIcon,{className:"pa-4 w-4 fill-current"})})}),t]}));yi.displayName=N.RadioItem.displayName;var xi=Re.forwardRef(({className:e,inset:t,...a},o)=>(0,pa.jsx)(N.Label,{ref:o,className:c("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));xi.displayName=N.Label.displayName;var wi=Re.forwardRef(({className:e,...t},a)=>(0,pa.jsx)(N.Separator,{ref:a,className:c("-mx-1 my-1 pa-px bg-muted",e),...t}));wi.displayName=N.Separator.displayName;var Ci=({className:e,...t})=>(0,pa.jsx)("span",{className:c("ml-auto text-xs tracking-widest opacity-60",e),...t});Ci.displayName="DropdownMenuShortcut";function Fa({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:s="700px",gridCols:r=6}){let l=a.find(n=>n.value===e);return(0,pa.jsxs)($t.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,pa.jsx)("div",{className:"hidden lg:block",children:(0,pa.jsx)(Ma,{value:e,onValueChange:t,children:(0,pa.jsx)(Ba,{className:"grid w-full rounded-2xl p-0 pa-10",style:{maxWidth:s,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(n=>(0,pa.jsx)($t.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,pa.jsx)(La,{value:n.value,className:"w-full pa-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,pa.jsx)("div",{className:"lg:hidden",children:(0,pa.jsxs)(Ea,{children:[(0,pa.jsx)(za,{asChild:!0,children:(0,pa.jsxs)(P,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[l?.label||"Select",(0,pa.jsx)(lo.ChevronDown,{className:"pa-4 w-4 ml-2"})]})}),(0,pa.jsx)(Vt,{align:"center",className:"w-[180px]",children:a.map(n=>(0,pa.jsx)(Wt,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function ja({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:s=!0,className:r,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:D,actionIcon:f=(0,pa.jsx)(lo.Bot,{className:"mr-2 pa-4 w-4"}),actionText:y="Action",onNotificationRemove:T,onRemoveAll:U,logo:S="/headerlogo.png",appName:x="Nuvia",tagline:R="Collaboration Platform"}){let[F,w]=(0,po.useState)(!1),[E,X]=(0,po.useState)(t),Y=E.filter(V=>!V.read).length,Z=V=>{X(te=>te.filter(ne=>ne.id!==V)),T?.(V)},Q=()=>{X(V=>V.filter(te=>te.read)),U?.()};return(0,pa.jsxs)(pa.Fragment,{children:[(0,pa.jsxs)("header",{className:`sticky top-0 lo-10 flex pa-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${r||""}`,children:[(0,pa.jsx)(P,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,pa.jsx)(lo.Menu,{className:"pa-5 w-5"})}),(0,pa.jsx)(P,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,pa.jsx)(lo.PanelLeft,{className:"pa-5 w-5"})}),!s&&(0,pa.jsxs)(St.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,pa.jsx)("div",{className:"flex pa-10 w-10 items-center justify-center",children:(0,pa.jsx)("img",{src:S,alt:"Logo",className:"pa-10 w-10 object-contain"})}),(0,pa.jsxs)("div",{children:[(0,pa.jsx)("h2",{className:"font-semibold text-sm",children:x}),(0,pa.jsx)("p",{className:"text-xs text-muted-foreground",children:R})]})]}),(0,pa.jsxs)("div",{className:"flex flex-1 items-center",children:[p&&(0,pa.jsx)(Fa,{activeTab:l,onTabChange:n,tabOptions:u}),(0,pa.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,pa.jsx)(St.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,pa.jsx)(St.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,pa.jsxs)(P,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:D,children:[f,y]})})}),(0,pa.jsx)(Aa,{}),(0,pa.jsx)(Xe,{children:(0,pa.jsxs)(Ye,{children:[(0,pa.jsx)(Ze,{asChild:!0,children:(0,pa.jsx)(St.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,pa.jsxs)(P,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>w(!0),children:[(0,pa.jsx)(St.motion.div,{animate:Y>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:Y>0?1/0:0,repeatDelay:3},children:(0,pa.jsx)(lo.Bell,{className:"pa-5 w-5"})}),Y>0&&(0,pa.jsx)(St.motion.span,{className:"absolute -right-1 -top-1 flex pa-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:Y})]})})}),(0,pa.jsx)(Ve,{children:"Notifications"})]})}),(0,pa.jsx)(St.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,pa.jsxs)(Oe,{className:"pa-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,pa.jsx)(Ot,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,pa.jsx)(Ge,{})]})})]})]})]}),(0,pa.jsx)(Ia,{notifications:E,open:F,onClose:()=>w(!1),onNotificationRemove:Z,onRemoveAll:Q})]})}var Ha=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,pa.jsx)(lo.User,{className:"pa-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Ga({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:s=Ha[0],onBusinessUnitChange:r,onSearch:l,businessUnits:n=Ha,activeTab:p,onTabChange:u,showTabs:D=!1,onActionClick:f,actionIcon:y,actionText:T="Action",onNotificationRemove:U,onRemoveAll:S,logo:x="/headerlogo.png",appName:R="Nuvia",tagline:F="Collaboration Platform",sidebarInitiallyClosed:w=!1}){let[E,X]=(0,po.useState)(!w),[Y,Z]=(0,po.useState)(!1),[Q,V]=(0,po.useState)(s),te=ne=>{V(ne),r?.(ne)};return(0,pa.jsxs)("div",{className:"flex pa-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[Y&&(0,pa.jsx)("div",{className:"fixed inset-0 lo-40 bg-black/50 md:hidden",onClick:()=>Z(!1)}),(0,pa.jsx)("div",{className:"md:hidden",children:(0,pa.jsx)(Ht,{items:e,isOpen:Y,isMobile:!0,onClose:()=>Z(!1),currentBusinessUnit:Q,onBusinessUnitChange:te,onSearch:l,logo:x,appName:R,tagline:F})}),(0,pa.jsx)("div",{className:"hidden md:block",children:(0,pa.jsx)(Ht,{items:e,isOpen:E,isMobile:!1,currentBusinessUnit:Q,onBusinessUnitChange:te,onSearch:l,logo:x,appName:R,tagline:F})}),(0,pa.jsxs)("div",{className:c("min-pa-screen fixed w-full transition-all duration-300 ease-in-out",E?"md:pl-64":"md:pl-0"),children:[(0,pa.jsx)(ja,{title:a,notifications:o,onToggleSidebar:()=>X(!E),onToggleMobileMenu:()=>Z(!0),sidebarOpen:E,activeTab:p,onTabChange:u,showTabs:D,onActionClick:f,actionIcon:y,actionText:T,onNotificationRemove:U,onRemoveAll:S,logo:x,appName:R,tagline:F}),(0,pa.jsx)("main",{className:"flex-1 p-0 flex flex-col pa-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var $e=W(require("react"));var ue=$e.forwardRef(({className:e,...t},a)=>(0,pa.jsx)("div",{ref:a,className:c("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ue.displayName="Card";var Ae=$e.forwardRef(({className:e,...t},a)=>(0,pa.jsx)("div",{ref:a,className:c("flex flex-col space-y-1.5 p-6",e),...t}));Ae.displayName="CardHeader";var Ie=$e.forwardRef(({className:e,...t},a)=>(0,pa.jsx)("div",{ref:a,className:c("font-semibold leading-none tracking-tight",e),...t}));Ie.displayName="CardTitle";var qt=$e.forwardRef(({className:e,...t},a)=>(0,pa.jsx)("div",{ref:a,className:c("text-sm text-muted-foreground",e),...t}));qt.displayName="CardDescription";var Ce=$e.forwardRef(({className:e,...t},a)=>(0,pa.jsx)("div",{ref:a,className:c("p-6 pt-0",e),...t}));Ce.displayName="CardContent";var dt=$e.forwardRef(({className:e,...t},a)=>(0,pa.jsx)("div",{ref:a,className:c("flex items-center p-6 pt-0",e),...t}));dt.displayName="CardFooter";function Va({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:s,onSessionEdit:r,onSessionDelete:l,className:n}){return(0,pa.jsx)(Xe,{children:(0,pa.jsx)("div",{className:`space-y-4 pa-full ${n||""}`,children:(0,pa.jsxs)(ue,{className:"shadow-sm pa-full",children:[(0,pa.jsx)("div",{className:"p-4 border-pa",children:(0,pa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,pa.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,pa.jsx)(lo.Clock,{className:"pa-4 w-4"}),"Recent Chats"]}),(0,pa.jsxs)(P,{onClick:o,size:"sm",className:"gap-1 pa-7 px-2 rounded-lg shadow-sm",children:[(0,pa.jsx)(lo.Plus,{className:"pa-3 w-3"}),"New"]})]})}),(0,pa.jsx)(ye,{className:"pa-[600px]",children:(0,pa.jsx)("div",{className:"p-2",children:e.length===0?(0,pa.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(p=>(0,pa.jsxs)(Ye,{children:[(0,pa.jsx)(Ze,{asChild:!0,children:(0,pa.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,pa.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,pa.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,pa.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:p.title}),(0,pa.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:p.lastMessage})]}),(0,pa.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[r&&(0,pa.jsx)(P,{variant:"ghost",size:"icon",className:"pa-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:u=>{u.stopPropagation(),r(p.id)},children:(0,pa.jsx)(lo.Edit3,{className:"pa-3 w-3"})}),l&&(0,pa.jsx)(P,{variant:"ghost",size:"icon",className:"pa-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,pa.jsx)(lo.Trash2,{className:"pa-3 w-3"})})]})]})})}),(0,pa.jsx)(Ve,{side:"right",className:"max-w-xs",children:(0,pa.jsxs)("div",{className:"space-y-1",children:[(0,pa.jsx)("p",{className:"font-medium text-sm",children:p.title}),(0,pa.jsx)("p",{className:"text-xs",children:p.lastMessage})]})})]},p.id))})})]})})})}var _e=W(require("motion/react-client"));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"]},$a=[{id:"sales",name:"Sales",description:"Revenue and customer management",iconName:"DollarSign",color:"bg-green-600",type:"category",actions:[{id:"view-pipeline",label:"View Pipeline",description:"See all opportunities in pipeline",iconName:"BarChart",action:e=>console.log("View pipeline",e)},{id:"create-opportunity",label:"Create Opportunity",iconName:"Target",action:e=>console.log("Create opportunity",e)}],children:[{id:"customers",name:"Customers",description:"Customer accounts and contacts",iconName:"Users",color:"bg-blue-500",type:"list",actions:[{id:"add-customer",label:"Add Customer",iconName:"User",action:e=>console.log("Add customer",e)},{id:"export-customers",label:"Export List",iconName:"FileText",action:e=>console.log("Export customers",e)}],data:[{id:"acme-corp",title:"Acme Corp",subtitle:"Enterprise Customer",value:"$125K ARR",metadata:{industry:"Technology",employees:500,lastContact:"2024-01-15"}},{id:"beta-inc",title:"Beta Inc",subtitle:"Mid-market",value:"$45K ARR",metadata:{industry:"Healthcare",employees:150,lastContact:"2024-01-10"}},{id:"gamma-llc",title:"Gamma LLC",subtitle:"Small Business",value:"$15K ARR",metadata:{industry:"Manufacturing",employees:50,lastContact:"2024-01-08"}}]},{id:"opportunities",name:"Opportunities",description:"Sales opportunities and deals",iconName:"Target",color:"bg-yellow-500",type:"list",actions:[{id:"close-won",label:"Mark as Won",iconName:"CheckCircle",action:e=>console.log("Close won",e)},{id:"schedule-followup",label:"Schedule Follow-up",iconName:"Clock",action:e=>console.log("Schedule follow-up",e)}],data:[{id:"opp-1",title:"Acme Corp - Enterprise License",subtitle:"Closing Q1 2024",value:"$85K",metadata:{stage:"Negotiation",probability:80,closeDate:"2024-03-31"}},{id:"opp-2",title:"Beta Inc - Platform Upgrade",subtitle:"Closing Q2 2024",value:"$32K",metadata:{stage:"Proposal",probability:65,closeDate:"2024-06-15"}}]}]},{id:"marketing",name:"Marketing",description:"Marketing campaigns and analytics",iconName:"TrendingUp",color:"bg-pink-600",type:"category",actions:[{id:"view-analytics",label:"View Analytics",iconName:"BarChart",action:e=>console.log("View analytics",e)}],children:[{id:"campaigns",name:"Campaigns",description:"Marketing campaigns and performance",iconName:"TrendingUp",color:"bg-pink-500",type:"list",data:[{id:"campaign-1",title:"Q1 Product Launch",subtitle:"Active Campaign",value:"45% CTR",metadata:{budget:"$50K",spend:"$32K",leads:1250}},{id:"campaign-2",title:"Holiday Promotion",subtitle:"Completed",value:"38% CTR",metadata:{budget:"$25K",spend:"$24K",leads:890}}]}]},{id:"projects",name:"Projects",description:"Project management and tracking",iconName:"Briefcase",color:"bg-blue-600",type:"category",children:[{id:"active-projects",name:"Active Projects",description:"Currently active projects",iconName:"Activity",color:"bg-blue-500",type:"list",data:[{id:"project-1",title:"Website Redesign",subtitle:"In Progress",value:"75% Complete",metadata:{team:"Design",deadline:"2024-02-15",status:"On Track"}},{id:"project-2",title:"Mobile App Development",subtitle:"Planning",value:"25% Complete",metadata:{team:"Engineering",deadline:"2024-03-31",status:"On Track"}}]}]},{id:"engineering",name:"Engineering",description:"Development and technical operations",iconName:"Code",color:"bg-purple-600",type:"category",actions:[{id:"view-repos",label:"View Repositories",description:"See all code repositories",iconName:"Git",action:e=>console.log("View repositories",e)},{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)}],children:[{id:"repositories",name:"Repositories",description:"Code repositories and projects",iconName:"GitBranch",color:"bg-purple-500",type:"list",actions:[{id:"create-repo",label:"Create Repository",iconName:"Plus",action:e=>console.log("Create repository",e)},{id:"view-commits",label:"View Commits",iconName:"Git",action:e=>console.log("View commits",e)}],data:[{id:"repo-1",title:"frontend-app",subtitle:"React Application",value:"Main Branch",metadata:{language:"TypeScript",commits:1247,contributors:8}},{id:"repo-2",title:"backend-api",subtitle:"Node.js API",value:"Main Branch",metadata:{language:"Node.js",commits:892,contributors:5}}]},{id:"tasks",name:"Tasks",description:"Development tasks and issues",iconName:"CheckSquare",color:"bg-blue-500",type:"list",actions:[{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)},{id:"assign-task",label:"Assign Task",iconName:"UserPlus",action:e=>console.log("Assign task",e)}],data:[{id:"task-1",title:"Fix authentication bug",subtitle:"High Priority",value:"In Progress",metadata:{assignee:"John Doe",priority:"High",estimate:"4h"}},{id:"task-2",title:"Implement dark mode",subtitle:"Feature Request",value:"Todo",metadata:{assignee:"Jane Smith",priority:"Medium",estimate:"8h"}}]}]},{id:"design",name:"Design",description:"User experience and visual design",iconName:"Palette",color:"bg-pink-600",type:"category",actions:[{id:"view-designs",label:"View Designs",description:"See all design assets",iconName:"Image",action:e=>console.log("View designs",e)},{id:"create-mockup",label:"Create Mockup",iconName:"Plus",action:e=>console.log("Create mockup",e)}],children:[{id:"assets",name:"Assets",description:"Design assets and components",iconName:"Package",color:"bg-pink-500",type:"list",actions:[{id:"add-asset",label:"Add Asset",iconName:"Plus",action:e=>console.log("Add asset",e)},{id:"organize-assets",label:"Organize",iconName:"FolderOpen",action:e=>console.log("Organize assets",e)}],data:[{id:"asset-1",title:"Logo Variations",subtitle:"Brand Assets",value:"12 files",metadata:{format:"SVG",size:"2.4MB",updated:"2024-01-20"}},{id:"asset-2",title:"UI Components",subtitle:"Component Library",value:"45 components",metadata:{format:"Figma",size:"18.7MB",updated:"2024-01-22"}}]}]},{id:"product",name:"Product",description:"Product management and strategy",iconName:"Layers",color:"bg-indigo-600",type:"category",actions:[{id:"view-roadmap",label:"View Roadmap",description:"See product roadmap",iconName:"Map",action:e=>console.log("View roadmap",e)},{id:"create-feature",label:"Create Feature",iconName:"Plus",action:e=>console.log("Create feature",e)}],children:[{id:"features",name:"Features",description:"Product features and requirements",iconName:"Star",color:"bg-indigo-500",type:"list",actions:[{id:"add-feature",label:"Add Feature",iconName:"Plus",action:e=>console.log("Add feature",e)},{id:"prioritize-features",label:"Prioritize",iconName:"ArrowUp",action:e=>console.log("Prioritize features",e)}],data:[{id:"feature-1",title:"User Authentication",subtitle:"Security Feature",value:"In Development",metadata:{priority:"High",effort:"Large",impact:"High"}},{id:"feature-2",title:"Dark Mode",subtitle:"UI Enhancement",value:"Backlog",metadata:{priority:"Medium",effort:"Small",impact:"Medium"}}]}]}];function _t(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function Ka({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:s,colorScheme:r=Wa,className:l}){let[n,p]=(0,po.useState)([]),[u,D]=(0,po.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,po.useMemo)(()=>({path:n,selectedItems:u,filters:{}}),[n,u]);(0,po.useEffect)(()=>{s&&s(U)},[U,s]);let S=w=>{w.type==="category"||w.type==="list"?p([...n,w]):w.type==="item"&&D([...u,w])},x=()=>{p(n.slice(0,-1))},R=w=>{p(n.slice(0,w+1))},F=()=>f?.actions?f.actions:[];return t?(0,pa.jsxs)("div",{className:c("w-full",l),children:[(0,pa.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,pa.jsxs)("div",{className:"flex items-center gap-2",children:[n.length>0&&(0,pa.jsx)(St.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 pa-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,pa.jsx)(lo.ChevronLeft,{className:c("pa-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,pa.jsx)("h4",{className:"font-medium text-sm",children:f?.name||"Capabilities"})]}),(0,pa.jsx)(St.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 pa-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,pa.jsx)(lo.X,{className:c("pa-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),n.length>0&&(0,pa.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,pa.jsx)(St.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,pa.jsxs)("span",{className:"relative",children:["Capabilities",(0,pa.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 pa-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,pa.jsxs)("div",{className:"flex items-center gap-1",children:[(0,pa.jsx)(lo.ChevronRight,{className:"pa-2 w-2"}),(0,pa.jsx)(St.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>R(E),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,pa.jsxs)("span",{className:"relative",children:[w.name,(0,pa.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 pa-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},w.id))]}),(0,pa.jsx)("div",{className:"max-pa-40 overflow-y-auto",children:(0,pa.jsx)(St.AnimatePresence,{mode:"wait",children:(0,pa.jsx)(St.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,pa.jsx)(Di,{data:f.data,onItemSelect:w=>D([...u,w]),colorScheme:r}):(0,pa.jsx)(Ni,{capabilities:y,onSelect:S,colorScheme:r})},f?.id||"root")})})]}):(0,pa.jsxs)(P,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,pa.jsx)(lo.Menu,{className:"pa-4 w-4"}),(0,pa.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function Ni({capabilities:e,onSelect:t,colorScheme:a}){return(0,pa.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,s)=>(0,pa.jsx)(ki,{capability:o,onClick:()=>t(o),color:a.categories[s%a.categories.length]},o.id))})}function ki({capability:e,onClick:t,selected:a,color:o}){return(0,pa.jsxs)(St.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,pa.jsx)("div",{className:c("w-2 pa-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,pa.jsxs)("span",{className:"truncate relative",children:[e.name,(0,pa.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 pa-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,pa.jsx)(lo.ChevronRight,{className:c("pa-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,pa.jsx)(ce,{variant:"secondary",className:c("text-xs pa-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function Di({data:e,onItemSelect:t,colorScheme:a}){return(0,pa.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,s)=>(0,pa.jsxs)(St.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,pa.jsx)("div",{className:c("w-2 pa-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[s%a.items.length])}),(0,pa.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,pa.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,pa.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 pa-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),o.subtitle&&(0,pa.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,pa.jsx)(ce,{variant:"secondary",className:c("text-xs pa-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 Ja=require("date-fns");function qa({taskId:e,polling:t=!0,system:a="payload"}){let[o,s]=(0,po.useState)(null),[r,l]=(0,po.useState)(!1),[n,p]=(0,po.useState)(null),u=async(f=!0)=>{if(e){f&&l(!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();s(T)}catch(y){console.error("Error fetching task:",y),p(y instanceof Error?y:new Error("Unknown error occurred"))}finally{f&&l(!1)}}},D=()=>u(!1);return(0,po.useEffect)(()=>{e&&u(!0);let f=null;return e&&t&&(f=setInterval(D,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:o,loading:r,error:n}}var Pi=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"}},Ti=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Qa({data:e}){let{id:t,system:a,fetchLatest:o,taskData:s,error:r}=e||{};if(!t)return null;let l=null,n=!0,p=r,u=o!==void 0?o:!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:o,system:a,fetchLatest:u,taskData:l,error:p}),u){let{task:T,loading:U,error:S}=qa({taskId:t,system:a});l=T,n=U,p=S}else n=!1;let D=Pi(l?.status||"todo"),f=Ti(l?.status||"todo"),y=l?.dateLogged||new Date().toISOString();try{let T=new Date(l?.dateLogged||"");isNaN(T.getTime())||(y=(0,Ja.formatDistanceToNow)(T,{addSuffix:!0}))}catch{}return(0,pa.jsxs)(ue,{className:c("w-full max-w-md shadow-md",p&&"border border-destructive"),children:[(0,pa.jsxs)(Ae,{className:"pb-2",children:[(0,pa.jsxs)("div",{className:"flex justify-between items-start",children:[(0,pa.jsx)(Ie,{className:"text-lg font-semibold",children:n?"Loading...":l?.name||"Task"}),(0,pa.jsx)(ce,{className:`${D}`,children:f})]}),l?.project&&(0,pa.jsxs)(qt,{className:"text-sm text-gray-500",children:["Project: ",l.project.name]})]}),(0,pa.jsx)(Ce,{className:"pb-2",children:n?(0,pa.jsx)("div",{className:"animate-pulse pa-4 bg-gray-200 rounded w-3/4 mb-2"}):p?(0,pa.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,pa.jsx)("p",{className:"text-sm text-foreground",children:l?.description||"......."})}),(0,pa.jsx)(dt,{className:"pt-2 flex items-center justify-between",children:(0,pa.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,pa.jsx)(lo.Clock,{className:"pa-3 w-3 mr-1"}),(0,pa.jsxs)("span",{children:["Created ",y]}),(0,pa.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,pa.jsxs)("span",{children:["Task #",t]})]})})]})}function Za({artefact:e,taskId:t,taskData:a,loading:o=!1,error:s=null}){let r=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},l=r.dateLogged;try{let n=new Date(r.dateLogged);isNaN(n.getTime())||(l=(0,Ja.formatDistanceToNow)(n,{addSuffix:!0}))}catch{}return(0,pa.jsxs)(ue,{className:"w-full max-w-md shadow-md",children:[(0,pa.jsx)(Ae,{className:"pb-2",children:(0,pa.jsx)("div",{className:"flex justify-between items-start",children:(0,pa.jsx)(Ie,{className:"text-lg font-semibold",children:o?"Loading...":r.name})})}),(0,pa.jsx)(Ce,{className:"pb-2",children:o?(0,pa.jsx)("div",{className:"animate-pulse pa-4 bg-gray-200 rounded w-3/4 mb-2"}):s?(0,pa.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,pa.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,pa.jsx)(dt,{className:"pt-2 flex items-center justify-between",children:(0,pa.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,pa.jsx)(lo.Clock,{className:"pa-3 w-3 mr-1"}),(0,pa.jsxs)("span",{children:["Created ",l]}),(0,pa.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,pa.jsxs)("span",{children:["Task #",r.id]})]})})]})}var to=W(require("react"));var eo=({isOpen:e=!0,authUrl:t,onClose:a,onSuccess:o,description:s="This endpoint requires authentication to sync functions."})=>{let[r,l]=(0,po.useState)(!1),[n,p]=(0,po.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 y=setInterval(()=>{try{f.closed&&(clearInterval(y),l(!1),o(),a())}catch{}},1e3);setTimeout(()=>{f.closed||(f.close(),clearInterval(y),l(!1),p("Authentication timed out. Please try again."))},6e5)}catch{p("Failed to open authentication window"),l(!1)}},D=async()=>{try{await navigator.clipboard.writeText(t),p("")}catch{p("Failed to copy URL to clipboard")}};return e?(0,pa.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center lo-[1000]",children:(0,pa.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,pa.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,pa.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s}),n&&(0,pa.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:n}),(0,pa.jsxs)("div",{className:"flex gap-2",children:[(0,pa.jsx)("button",{onClick:u,disabled:r||!t,className:`
6
+ "use strict";var Ko=Object.create;var yt=Object.defineProperty;var _o=Object.getOwnPropertyDescriptor;var Jo=Object.getOwnPropertyNames;var Qo=Object.getPrototypeOf,Xo=Object.prototype.hasOwnProperty;var Yo=(e,t)=>{for(var a in t)yt(e,a,{get:t[a],enumerable:!0})},ga=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Jo(t))!Xo.call(e,s)&&s!==a&&yt(e,s,{get:()=>t[s],enumerable:!(o=_o(t,s))||o.enumerable});return e};var G=(e,t,a)=>(a=e!=null?Ko(Qo(e)):{},ga(t||!e||!e.__esModule?yt(a,"default",{value:e,enumerable:!0}):a,e)),Zo=e=>ga(yt({},"__esModule",{value:!0}),e);var an={};Yo(an,{ChatDemoLongMessages:()=>tn});module.exports=Zo(an);var Bo=require("react");var So=require("@ai-sdk/react"),Bt=require("motion/react"),Mo=require("lucide-react");var Na=require("clsx");var Ft="-",ei=e=>{let t=ai(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{let r=l.split(Ft);return r[0]===""&&r.length!==1&&r.shift(),ha(r,t)||ti(l)},getConflictingClassGroupIds:(l,r)=>{let p=a[l]||[];return r&&o[l]?[...p,...o[l]]:p}}},ha=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),s=o?ha(e.slice(1),o):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},fa=/^\[(.+)\]$/,ti=e=>{if(fa.test(e)){let t=fa.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},ai=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return ii(Object.entries(e.classGroups),a).forEach(([i,l])=>{Ut(l,o,i,t)}),o},Ut=(e,t,a,o)=>{e.forEach(s=>{if(typeof s=="string"){let i=s===""?t:ba(t,s);i.classGroupId=a;return}if(typeof s=="function"){if(oi(s)){Ut(s(o),t,a,o);return}t.validators.push({validator:s,classGroupId:a});return}Object.entries(s).forEach(([i,l])=>{Ut(l,ba(t,i),a,o)})})},ba=(e,t)=>{let a=e;return t.split(Ft).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},oi=e=>e.isThemeGetter,ii=(e,t)=>t?e.map(([a,o])=>{let s=o.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,r])=>[t+l,r])):i);return[a,s]}):e,ni=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,s=(i,l)=>{a.set(i,l),t++,t>e&&(t=0,o=a,a=new Map)};return{get(i){let l=a.get(i);if(l!==void 0)return l;if((l=o.get(i))!==void 0)return s(i,l),l},set(i,l){a.has(i)?a.set(i,l):s(i,l)}}},va="!",ri=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,s=t[0],i=t.length,l=r=>{let p=[],u=0,w=0,f;for(let x=0;x<r.length;x++){let P=r[x];if(u===0){if(P===s&&(o||r.slice(x,x+i)===t)){p.push(r.slice(w,x)),w=x+i;continue}if(P==="/"){f=x;continue}}P==="["?u++:P==="]"&&u--}let v=p.length===0?r:r.substring(w),R=v.startsWith(va),M=R?v.substring(1):v,T=f&&f>w?f-w:void 0;return{modifiers:p,hasImportantModifier:R,baseClassName:M,maybePostfixModifierPosition:T}};return a?r=>a({className:r,parseClassName:l}):l},si=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},li=e=>({cache:ni(e.cacheSize),parseClassName:ri(e),...ei(e)}),ci=/\s+/,di=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:s}=t,i=[],l=e.trim().split(ci),r="";for(let p=l.length-1;p>=0;p-=1){let u=l[p],{modifiers:w,hasImportantModifier:f,baseClassName:v,maybePostfixModifierPosition:R}=a(u),M=!!R,T=o(M?v.substring(0,R):v);if(!T){if(!M){r=u+(r.length>0?" "+r:r);continue}if(T=o(v),!T){r=u+(r.length>0?" "+r:r);continue}M=!1}let x=si(w).join(":"),P=f?x+va:x,F=P+T;if(i.includes(F))continue;i.push(F);let C=s(T,M);for(let z=0;z<C.length;++z){let Y=C[z];i.push(P+Y)}r=u+(r.length>0?" "+r:r)}return r};function pi(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=ya(t))&&(o&&(o+=" "),o+=a);return o}var ya=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=ya(e[o]))&&(a&&(a+=" "),a+=t);return a};function mi(e,...t){let a,o,s,i=l;function l(p){let u=t.reduce((w,f)=>f(w),e());return a=li(u),o=a.cache.get,s=a.cache.set,i=r,r(p)}function r(p){let u=o(p);if(u)return u;let w=di(p,a);return s(p,w),w}return function(){return i(pi.apply(null,arguments))}}var H=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},xa=/^\[(?:([a-z-]+):)?(.+)\]$/i,ui=/^\d+\/\d+$/,gi=new Set(["px","full","screen"]),fi=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bi=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|Pa|i|Pa|min|max))|\Pa(calc|min|max|clamp)\(.+\)|^0$/,hi=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,vi=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yi=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Se=e=>Ze(e)||gi.has(e)||ui.test(e),Fe=e=>et(e,"length",Ti),Ze=e=>!!e&&!Number.isNaN(Number(e)),zt=e=>et(e,"number",Ze),ct=e=>!!e&&Number.isInteger(Number(e)),xi=e=>e.endsWith("%")&&Ze(e.slice(0,-1)),y=e=>xa.test(e),je=e=>fi.test(e),wi=new Set(["length","size","percentage"]),Ci=e=>et(e,wi,wa),Ni=e=>et(e,"position",wa),ki=new Set(["image","url"]),Pi=e=>et(e,ki,Ai),Di=e=>et(e,"",Ri),dt=()=>!0,et=(e,t,a)=>{let o=xa.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},Ti=e=>bi.test(e)&&!hi.test(e),wa=()=>!1,Ri=e=>vi.test(e),Ai=e=>yi.test(e);var Si=()=>{let e=H("colors"),t=H("spacing"),a=H("blur"),o=H("brightness"),s=H("borderColor"),i=H("borderRadius"),l=H("borderSpacing"),r=H("borderWidth"),p=H("contrast"),u=H("grayscale"),w=H("hueRotate"),f=H("invert"),v=H("gap"),R=H("gradientColorStops"),M=H("gradientColorStopPositions"),T=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"),X=H("translate"),W=()=>["auto","contain","none"],oe=()=>["auto","hidden","clip","visible","scroll"],le=()=>["auto",y,t],I=()=>[y,t],Re=()=>["",Se,Fe],d=()=>["auto",Ze,y],E=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["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"],A=()=>[Ze,y];return{cacheSize:500,separator:":",theme:{colors:[dt],spacing:[Se,Fe],blur:["none","",je,y],brightness:A(),borderColor:[e],borderRadius:["none","","full",je,y],borderSpacing:I(),borderWidth:Re(),contrast:A(),grayscale:j(),hueRotate:A(),invert:j(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[xi,Fe],inset:le(),margin:le(),opacity:A(),padding:I(),saturate:A(),scale:A(),sepia:j(),skew:A(),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: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:[T]}],"inset-x":[{"inset-x":[T]}],"inset-y":[{"inset-y":[T]}],start:[{start:[T]}],end:[{end:[T]}],top:[{top:[T]}],right:[{right:[T]}],bottom:[{bottom:[T]}],left:[{left:[T]}],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:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"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]}],Pa:[{Pa:[y,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-Pa":[{"min-Pa":[y,t,"min","max","fit","svh","lvh","dvh"]}],"max-Pa":[{"max-Pa":[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",Se,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:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Se,Fe]}],"underline-offset":[{"underline-offset":["auto",Se,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(),Ni]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ci]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","Pa","bl","l","tl"]},Pi]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[M]}],"gradient-via-pos":[{via:[M]}],"gradient-to-pos":[{to:[M]}],"gradient-from":[{from:[R]}],"gradient-via":[{via:[R]}],"gradient-to":[{to:[R]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-Pa":[{"rounded-Pa":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-Pa":[{"rounded-Pa":[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:[r]}],"border-w-x":[{"border-x":[r]}],"border-w-y":[{"border-y":[r]}],"border-w-s":[{"border-s":[r]}],"border-w-e":[{"border-e":[r]}],"border-w-t":[{"border-t":[r]}],"border-w-r":[{"border-r":[r]}],"border-w-Pa":[{"border-Pa":[r]}],"border-w-l":[{"border-l":[r]}],"border-opacity":[{"border-opacity":[P]}],"border-style":[{border:[...L(),"hidden"]}],"divide-x":[{"divide-x":[r]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[r]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[P]}],"divide-style":[{divide:L()}],"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-r":[{"border-r":[s]}],"border-color-Pa":[{"border-Pa":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...L()]}],"outline-offset":[{"outline-offset":[Se,y]}],"outline-w":[{outline:[Se,Fe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[P]}],"ring-offset-w":[{"ring-offset":[Se,Fe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",je,Di]}],"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:[a]}],brightness:[{brightness:[o]}],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":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"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:A()}],ease:[{ease:["linear","in","out","in-out",y]}],delay:[{delay:A()}],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":[X]}],"translate-y":[{"translate-y":[X]}],"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","Pa-resize","e-resize","s-resize","w-resize","Mo-resize","nw-resize","Pa-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:[Se,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","Pa"],"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-Pa","rounded-l","rounded-ss","rounded-Pa","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Pa","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-Pa":["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-Pa","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-Pa"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-Pa","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-Pa"],"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 Ca=mi(Si);function c(...e){return Ca((0,Na.clsx)(e))}var Tt=G(require("react")),$t=G(require("next/link"));var ka=require("class-variance-authority");var Pa=require("react/jsx-runtime"),Mi=(0,ka.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,...a}){return(0,Pa.jsx)("div",{className:c(Mi({variant:t}),e),...a})}var Da=require("@radix-ui/react-slot"),Ra=G(require("react")),Ii=(0,ka.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:"Pa-10 px-4 py-2",icon:"Pa-10 w-10",lg:"Pa-11 rounded px-8",sm:"Pa-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),S=Ra.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...s},i)=>(0,Pa.jsx)(e?Da.Slot:"button",{className:c(Ii({className:t,size:a,variant:o})),ref:i,...s}));S.displayName="Button";var Sa=G(require("react"));var pt=Sa.forwardRef(({className:e,type:t,...a},o)=>(0,Pa.jsx)("input",{type:t,className:c("flex Pa-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}));pt.displayName="Input";var jt=G(require("react")),ge=G(require("@radix-ui/react-scroll-area"));var Ce=jt.forwardRef(({className:e,children:t,...a},o)=>(0,Pa.jsxs)(ge.Root,{ref:o,className:c("relative overflow-hidden",e),...a,children:[(0,Pa.jsx)(ge.Viewport,{className:"Pa-full w-full rounded-[inherit]",children:t}),(0,Pa.jsx)(Ia,{}),(0,Pa.jsx)(ge.Corner,{})]}));Ce.displayName=ge.Root.displayName;var Ia=jt.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,Pa.jsx)(ge.ScrollAreaScrollbar,{ref:o,orientation:t,className:c("flex touch-none select-none transition-colors",t==="vertical"&&"Pa-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"Pa-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,Pa.jsx)(ge.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Ia.displayName=ge.ScrollAreaScrollbar.displayName;var mt=G(require("react")),_=G(require("@radix-ui/react-dialog"));var Ba=_.Root;var Li=_.Portal;var Ea=mt.forwardRef(({className:e,...t},a)=>(0,Pa.jsx)(_.Overlay,{ref:a,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}));Ea.displayName=_.Overlay.displayName;var Ot=mt.forwardRef(({className:e,children:t,...a},o)=>(0,Pa.jsxs)(Li,{children:[(0,Pa.jsx)(Ea,{}),(0,Pa.jsxs)(_.Content,{ref:o,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-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,Pa.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,Pa.jsx)(Mo.X,{className:"Pa-4 w-4"}),(0,Pa.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Ot.displayName=_.Content.displayName;var Ht=({className:e,...t})=>(0,Pa.jsx)("div",{className:c("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ht.displayName="DialogHeader";var Bi=({className:e,...t})=>(0,Pa.jsx)("div",{className:c("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Bi.displayName="DialogFooter";var Vt=mt.forwardRef(({className:e,...t},a)=>(0,Pa.jsx)(_.Title,{ref:a,className:c("text-lg font-semibold leading-none tracking-tight",e),...t}));Vt.displayName=_.Title.displayName;var Ei=mt.forwardRef(({className:e,...t},a)=>(0,Pa.jsx)(_.Description,{ref:a,className:c("text-sm text-muted-foreground",e),...t}));Ei.displayName=_.Description.displayName;var ut=G(require("@radix-ui/react-checkbox")),Ua=G(require("react")),Gt=Ua.forwardRef(({className:e,...t},a)=>(0,Pa.jsx)(ut.Root,{className:c("peer Pa-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,Pa.jsx)(ut.Indicator,{className:c("flex items-center justify-center text-current"),children:(0,Pa.jsx)(Mo.Check,{className:"Pa-4 w-4"})})}));Gt.displayName=ut.Root.displayName;var Ne=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var ja=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Pa.jsx)(Mo.Palette,{className:"Pa-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Pa.jsx)(Mo.Code,{className:"Pa-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Pa.jsx)(Mo.TrendingUp,{className:"Pa-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Pa.jsx)(Mo.DollarSign,{className:"Pa-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,Pa.jsx)(Mo.Users,{className:"Pa-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Pa.jsx)(Mo.Wrench,{className:"Pa-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Pa.jsx)(Mo.Scale,{className:"Pa-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Pa.jsx)(Mo.Package,{className:"Pa-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Pa.jsx)(Mo.Zap,{className:"Pa-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Pa.jsx)(Mo.Building2,{className:"Pa-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Nt=[{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 Wt=[{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}],wt=[{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}],Pt=[{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")}],zi=[...Pt,{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")}],Ui=[...Nt,{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}],Ct={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:[]},Fa={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:Pt.filter(e=>e.epicId==="1")};var Pn={empty:{initialProjects:Ct.projects,initialEpics:Ct.epics,initialSprints:Ct.sprints,initialTasks:Ct.tasks},default:{initialProjects:Nt,initialEpics:Wt,initialSprints:wt,initialTasks:Pt},highDensity:{initialProjects:Nt,initialEpics:Wt,initialSprints:wt,initialTasks:zi},singleEpic:{initialProjects:Nt,initialEpics:Fa.epics,initialSprints:wt,initialTasks:Fa.tasks},multipleProjects:{initialProjects:Ui,initialEpics:Wt,initialSprints:wt,initialTasks:Pt}},kt=[{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(Ne),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Ne),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(Ne),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Ne),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(Ne),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Ne),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(Ne),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Ne),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(Ne),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Ne),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],Dn=[{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:kt.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:kt.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:kt.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 Tn=kt.filter(e=>e.type==="digital");function Oa(e,t){let[a,o]=(0,Bo.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{o(i),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(i))}catch{}};return(0,Bo.useEffect)(()=>{s(a)},[]),[a,s]}function qt({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:s=ja[0],onBusinessUnitChange:i,onSearch:l,className:r,logo:p="/headerlogo.png",appName:u="Nuvia",tagline:w="Collaboration Platform"}){let[f,v]=Tt.useState({}),[R,M]=Oa("sidebar-favorites",{}),[T,x]=Tt.useState(null),[P,F]=Tt.useState(""),C=d=>{v(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 L=R[d]||[],q=L.includes(E)?L.filter(m=>m!==E):L.concat(E);M({...R,[d]:q})},X=d=>{if(!d.items||!d.maxItems||d.items.length<=d.maxItems)return d.items||[];let E=R[d.id]||[],L=d.items.filter(m=>E.includes(m.id)),q=d.items.filter(m=>!E.includes(m.id));return[...L,...q].slice(0,d.maxItems)},W=d=>d.maxItems&&d.items&&d.items.length>d.maxItems,oe=e,le=d=>{let E=W(d),L=X(d),q=(0,Pa.jsxs)(Pa.Fragment,{children:[(0,Pa.jsxs)("div",{className:"flex items-center gap-3",children:[d.icon,(0,Pa.jsx)("span",{children:d.title})]}),d.badge&&(0,Pa.jsx)(me,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:d.badge}),d.items&&(0,Pa.jsx)(Mo.ChevronDown,{className:c("ml-2 Pa-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,Pa.jsx)($t.default,{href:d.url,className:m,onClick:a?o:void 0,children:q}):(0,Pa.jsx)("button",{className:m,onClick:()=>d.items&&C(d.title),children:q})},I=()=>{let d=e.find(L=>L.id===T);if(!d||!d.items||!d.maxItems)return null;let E=R[d.id]||[];return(0,Pa.jsx)(Ba,{open:!!T,onOpenChange:L=>!L&&x(null),children:(0,Pa.jsxs)(Ot,{className:"sm:max-w-md",children:[(0,Pa.jsxs)(Ht,{children:[(0,Pa.jsxs)(Vt,{children:["Manage ",d.title," Favorites"]}),(0,Pa.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",d.maxItems," items to show in ",d.title.toLowerCase(),"."]})]}),(0,Pa.jsx)(Ce,{className:"max-Pa-96 pr-4",children:(0,Pa.jsx)("div",{className:"space-y-4",children:d.items.map(L=>(0,Pa.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pa.jsx)(Gt,{id:L.id,checked:E.includes(L.id),onCheckedChange:()=>ee(d.id,L.id),disabled:!E.includes(L.id)&&E.length>=(d.maxItems||0)}),(0,Pa.jsxs)("label",{htmlFor:L.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:[L.title,L.badge&&(0,Pa.jsx)(me,{variant:"outline",className:"text-xs",children:L.badge})]})]},L.id))})})]})})},Re=(0,Pa.jsxs)("div",{className:"flex Pa-full flex-col bg-background",children:[(0,Pa.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Pa.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Pa.jsx)("div",{className:"flex Pa-14 w-14 items-center justify-center",children:(0,Pa.jsx)("img",{src:p,alt:"Header Logo",className:"Pa-14 w-14 object-contain"})}),(0,Pa.jsxs)("div",{children:[(0,Pa.jsx)("h2",{className:"font-semibold",children:u}),(0,Pa.jsx)("p",{className:"text-xs text-muted-foreground",children:w})]})]}),a&&(0,Pa.jsx)(S,{variant:"ghost",size:"icon",onClick:o,children:(0,Pa.jsx)(Mo.X,{className:"Pa-5 w-5"})})]}),(0,Pa.jsx)("div",{className:"px-3 py-2",children:(0,Pa.jsxs)("div",{className:"relative",children:[(0,Pa.jsx)(Mo.Search,{className:"absolute left-3 top-3 Pa-4 w-4 text-muted-foreground"}),(0,Pa.jsx)(pt,{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,Pa.jsx)(Ce,{className:"flex-1 px-3 py-2",children:(0,Pa.jsx)("div",{className:"space-y-1",children:oe.map(d=>(0,Pa.jsxs)("div",{className:"mb-1",children:[le(d),d.items&&f[d.title]&&(0,Pa.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[X(d).map(E=>(0,Pa.jsxs)($t.default,{href:E.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[E.title,E.badge&&(0,Pa.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>X(d).length&&(0,Pa.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-X(d).length," more available"]})]})]},d.id))})}),(0,Pa.jsx)("div",{className:"p-3",children:(0,Pa.jsx)("div",{className:"space-y-1",children:(0,Pa.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,Pa.jsx)(Mo.Settings,{className:"Pa-5 w-5"}),(0,Pa.jsx)("span",{children:"Settings"})]})})}),(0,Pa.jsx)(I,{})]});return a?(0,Pa.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",r),children:Re}):(0,Pa.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",r),children:Re})}var Rt=G(require("react")),Me=G(require("@radix-ui/react-avatar"));var $e=Rt.forwardRef(({className:e,...t},a)=>(0,Pa.jsx)(Me.Root,{ref:a,className:c("relative flex Pa-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));$e.displayName=Me.Root.displayName;var Kt=Rt.forwardRef(({className:e,...t},a)=>(0,Pa.jsx)(Me.Image,{ref:a,className:c("aspect-square Pa-full w-full",e),...t}));Kt.displayName=Me.Image.displayName;var qe=Rt.forwardRef(({className:e,...t},a)=>(0,Pa.jsx)(Me.Fallback,{ref:a,className:c("flex Pa-full w-full items-center justify-center rounded-full bg-muted",e),...t}));qe.displayName=Me.Fallback.displayName;var Ha=G(require("react")),ve=G(require("@radix-ui/react-tooltip"));var tt=ve.Provider,at=ve.Root,ot=ve.Trigger,Ke=Ha.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Pa.jsx)(ve.Portal,{children:(0,Pa.jsx)(ve.Content,{ref:o,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),...a})}));Ke.displayName=ve.Content.displayName;var Va=require("next-themes");function Ga(){let{setTheme:e,theme:t}=(0,Va.useTheme)();return(0,Pa.jsx)(tt,{children:(0,Pa.jsxs)(at,{children:[(0,Pa.jsx)(ot,{asChild:!0,children:(0,Pa.jsxs)(S,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Pa.jsx)(Mo.Sun,{className:"Pa-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Pa.jsx)(Mo.Moon,{className:"absolute Pa-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Pa.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,Pa.jsx)(Ke,{children:"Toggle theme"})]})})}function Wa({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:s,className:i}){let l=e.filter(u=>!u.read),r=l.length,p=u=>{switch(u){case"info":return(0,Pa.jsx)(Mo.Info,{className:"Pa-5 w-5 text-blue-500"});case"success":return(0,Pa.jsx)(Mo.Check,{className:"Pa-5 w-5 text-green-500"});case"warning":return(0,Pa.jsx)(Mo.AlertTriangle,{className:"Pa-5 w-5 text-amber-500"});case"error":return(0,Pa.jsx)(Mo.AlertTriangle,{className:"Pa-5 w-5 text-red-500"})}};return(0,Pa.jsx)(Bt.AnimatePresence,{children:t&&(0,Pa.jsxs)(Pa.Fragment,{children:[(0,Pa.jsx)(Bt.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,Pa.jsx)(Bt.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,Pa.jsxs)("div",{className:"flex Pa-full flex-col",children:[(0,Pa.jsxs)("div",{className:"flex items-center justify-between border-Pa p-4",children:[(0,Pa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pa.jsx)(Mo.Bell,{className:"Pa-5 w-5"}),(0,Pa.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),r>0&&(0,Pa.jsxs)(me,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[r," new"]})]}),(0,Pa.jsxs)(S,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,Pa.jsx)(Mo.X,{className:"Pa-5 w-5"}),(0,Pa.jsx)("span",{className:"sr-only",children:"Close"})]})]}),r>0&&(0,Pa.jsxs)("div",{className:"flex items-center justify-between border-Pa p-2",children:[(0,Pa.jsxs)("span",{className:"text-sm text-muted-foreground",children:[r," unread notification",r!==1?"s":""]}),(0,Pa.jsx)(S,{variant:"ghost",size:"sm",onClick:s,className:"text-sm",children:"Dismiss all"})]}),l.length>0?(0,Pa.jsx)(Ce,{className:"flex-1",children:(0,Pa.jsx)("div",{className:"divide-y",children:l.map(u=>(0,Pa.jsxs)("div",{className:c("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Pa.jsx)("div",{className:"flex Pa-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:p(u.type)}),(0,Pa.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Pa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pa.jsx)("p",{className:"font-medium",children:u.title}),(0,Pa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pa.jsx)("p",{className:"text-xs text-muted-foreground",children:u.time}),(0,Pa.jsx)(S,{variant:"ghost",size:"sm",className:"Pa-6 w-6 p-0",onClick:()=>o?.(u.id),title:"Dismiss",children:(0,Pa.jsx)(Mo.Check,{className:"Pa-3 w-3"})})]})]}),(0,Pa.jsx)("p",{className:"text-sm text-muted-foreground",children:u.description}),u.actionLabel&&(0,Pa.jsxs)(S,{variant:"link",size:"sm",className:"Pa-auto p-0 text-sm",onClick:u.onAction,children:[u.actionLabel,(0,Pa.jsx)(Mo.ChevronRight,{className:"ml-1 Pa-3 w-3"})]})]})]},u.id))})}):(0,Pa.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Pa.jsx)("div",{className:"flex Pa-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Pa.jsx)(Mo.Bell,{className:"Pa-8 w-8 text-muted-foreground"})}),(0,Pa.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,Pa.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var _e=G(require("@radix-ui/react-tabs"));function $a({className:e,...t}){return(0,Pa.jsx)(_e.Root,{"data-slot":"tabs",className:c("flex flex-col gap-2",e),...t})}function qa({className:e,...t}){return(0,Pa.jsx)(_e.List,{"data-slot":"tabs-list",className:c("bg-muted text-muted-foreground inline-flex Pa-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Ka({className:e,...t}){return(0,Pa.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 Pa-[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")),D=G(require("@radix-ui/react-dropdown-menu")),it=require("@radix-ui/react-icons");var _a=D.Root,Ja=D.Trigger;var Fi=Ie.forwardRef(({className:e,inset:t,children:a,...o},s)=>(0,Pa.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),...o,children:[a,(0,Pa.jsx)(it.ChevronRightIcon,{className:"ml-auto"})]}));Fi.displayName=D.SubTrigger.displayName;var ji=Ie.forwardRef(({className:e,...t},a)=>(0,Pa.jsx)(D.SubContent,{ref:a,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}));ji.displayName=D.SubContent.displayName;var Jt=Ie.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Pa.jsx)(D.Portal,{children:(0,Pa.jsx)(D.Content,{ref:o,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),...a})}));Jt.displayName=D.Content.displayName;var Qt=Ie.forwardRef(({className:e,inset:t,...a},o)=>(0,Pa.jsx)(D.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}));Qt.displayName=D.Item.displayName;var Oi=Ie.forwardRef(({className:e,children:t,checked:a,...o},s)=>(0,Pa.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:a,...o,children:[(0,Pa.jsx)("span",{className:"absolute left-2 flex Pa-3.5 w-3.5 items-center justify-center",children:(0,Pa.jsx)(D.ItemIndicator,{children:(0,Pa.jsx)(it.CheckIcon,{className:"Pa-4 w-4"})})}),t]}));Oi.displayName=D.CheckboxItem.displayName;var Hi=Ie.forwardRef(({className:e,children:t,...a},o)=>(0,Pa.jsxs)(D.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,Pa.jsx)("span",{className:"absolute left-2 flex Pa-3.5 w-3.5 items-center justify-center",children:(0,Pa.jsx)(D.ItemIndicator,{children:(0,Pa.jsx)(it.DotFilledIcon,{className:"Pa-4 w-4 fill-current"})})}),t]}));Hi.displayName=D.RadioItem.displayName;var Vi=Ie.forwardRef(({className:e,inset:t,...a},o)=>(0,Pa.jsx)(D.Label,{ref:o,className:c("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));Vi.displayName=D.Label.displayName;var Gi=Ie.forwardRef(({className:e,...t},a)=>(0,Pa.jsx)(D.Separator,{ref:a,className:c("-mx-1 my-1 Pa-px bg-muted",e),...t}));Gi.displayName=D.Separator.displayName;var Wi=({className:e,...t})=>(0,Pa.jsx)("span",{className:c("ml-auto text-xs tracking-widest opacity-60",e),...t});Wi.displayName="DropdownMenuShortcut";function Xa({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:s="700px",gridCols:i=6}){let l=a.find(r=>r.value===e);return(0,Pa.jsxs)(Bt.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,Pa.jsx)("div",{className:"hidden lg:block",children:(0,Pa.jsx)($a,{value:e,onValueChange:t,children:(0,Pa.jsx)(qa,{className:"grid w-full rounded-2xl p-0 Pa-10",style:{maxWidth:s,gridTemplateColumns:`repeat(${Math.min(i,a.length)}, minmax(0, 1fr))`},children:a.map(r=>(0,Pa.jsx)(Bt.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Pa.jsx)(Ka,{value:r.value,className:"w-full Pa-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:r.label})},r.value))})})}),(0,Pa.jsx)("div",{className:"lg:hidden",children:(0,Pa.jsxs)(_a,{children:[(0,Pa.jsx)(Ja,{asChild:!0,children:(0,Pa.jsxs)(S,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[l?.label||"Select",(0,Pa.jsx)(Mo.ChevronDown,{className:"Pa-4 w-4 ml-2"})]})}),(0,Pa.jsx)(Jt,{align:"center",className:"w-[180px]",children:a.map(r=>(0,Pa.jsx)(Qt,{onClick:()=>t?.(r.value),className:`cursor-pointer ${e===r.value?"bg-accent":""}`,children:r.label},r.value))})]})})]})}function Ya({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:s=!0,className:i,activeTab:l="assistant",onTabChange:r,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,Pa.jsx)(Mo.Bot,{className:"mr-2 Pa-4 w-4"}),actionText:v="Action",onNotificationRemove:R,onRemoveAll:M,logo:T="/headerlogo.png",appName:x="Nuvia",tagline:P="Collaboration Platform"}){let[F,C]=(0,Bo.useState)(!1),[z,Y]=(0,Bo.useState)(t),Z=z.filter(W=>!W.read).length,ee=W=>{Y(oe=>oe.filter(le=>le.id!==W)),R?.(W)},X=()=>{Y(W=>W.filter(oe=>oe.read)),M?.()};return(0,Pa.jsxs)(Pa.Fragment,{children:[(0,Pa.jsxs)("header",{className:`sticky top-0 z-10 flex Pa-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${i||""}`,children:[(0,Pa.jsx)(S,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,Pa.jsx)(Mo.Menu,{className:"Pa-5 w-5"})}),(0,Pa.jsx)(S,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,Pa.jsx)(Mo.PanelLeft,{className:"Pa-5 w-5"})}),!s&&(0,Pa.jsxs)(Bt.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Pa.jsx)("div",{className:"flex Pa-10 w-10 items-center justify-center",children:(0,Pa.jsx)("img",{src:T,alt:"Logo",className:"Pa-10 w-10 object-contain"})}),(0,Pa.jsxs)("div",{children:[(0,Pa.jsx)("h2",{className:"font-semibold text-sm",children:x}),(0,Pa.jsx)("p",{className:"text-xs text-muted-foreground",children:P})]})]}),(0,Pa.jsxs)("div",{className:"flex flex-1 items-center",children:[p&&(0,Pa.jsx)(Xa,{activeTab:l,onTabChange:r,tabOptions:u}),(0,Pa.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Pa.jsx)(Bt.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,Pa.jsx)(Bt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Pa.jsxs)(S,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:w,children:[f,v]})})}),(0,Pa.jsx)(Ga,{}),(0,Pa.jsx)(tt,{children:(0,Pa.jsxs)(at,{children:[(0,Pa.jsx)(ot,{asChild:!0,children:(0,Pa.jsx)(Bt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Pa.jsxs)(S,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>C(!0),children:[(0,Pa.jsx)(Bt.motion.div,{animate:Z>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:Z>0?1/0:0,repeatDelay:3},children:(0,Pa.jsx)(Mo.Bell,{className:"Pa-5 w-5"})}),Z>0&&(0,Pa.jsx)(Bt.motion.span,{className:"absolute -right-1 -top-1 flex Pa-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,Pa.jsx)(Ke,{children:"Notifications"})]})}),(0,Pa.jsx)(Bt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Pa.jsxs)($e,{className:"Pa-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Pa.jsx)(Kt,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Pa.jsx)(qe,{})]})})]})]})]}),(0,Pa.jsx)(Wa,{notifications:z,open:F,onClose:()=>C(!1),onNotificationRemove:ee,onRemoveAll:X})]})}var Za=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Pa.jsx)(Mo.User,{className:"Pa-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function to({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:s=Za[0],onBusinessUnitChange:i,onSearch:l,businessUnits:r=Za,activeTab:p,onTabChange:u,showTabs:w=!1,onActionClick:f,actionIcon:v,actionText:R="Action",onNotificationRemove:M,onRemoveAll:T,logo:x="/headerlogo.png",appName:P="Nuvia",tagline:F="Collaboration Platform",sidebarInitiallyClosed:C=!1}){let[z,Y]=(0,Bo.useState)(!C),[Z,ee]=(0,Bo.useState)(!1),[X,W]=(0,Bo.useState)(s),oe=le=>{W(le),i?.(le)};return(0,Pa.jsxs)("div",{className:"flex Pa-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[Z&&(0,Pa.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>ee(!1)}),(0,Pa.jsx)("div",{className:"md:hidden",children:(0,Pa.jsx)(qt,{items:e,isOpen:Z,isMobile:!0,onClose:()=>ee(!1),currentBusinessUnit:X,onBusinessUnitChange:oe,onSearch:l,logo:x,appName:P,tagline:F})}),(0,Pa.jsx)("div",{className:"hidden md:block",children:(0,Pa.jsx)(qt,{items:e,isOpen:z,isMobile:!1,currentBusinessUnit:X,onBusinessUnitChange:oe,onSearch:l,logo:x,appName:P,tagline:F})}),(0,Pa.jsxs)("div",{className:c("min-Pa-screen fixed w-full transition-all duration-300 ease-in-out",z?"md:pl-64":"md:pl-0"),children:[(0,Pa.jsx)(Ya,{title:a,notifications:o,onToggleSidebar:()=>Y(!z),onToggleMobileMenu:()=>ee(!0),sidebarOpen:z,activeTab:p,onTabChange:u,showTabs:w,onActionClick:f,actionIcon:v,actionText:R,onNotificationRemove:M,onRemoveAll:T,logo:x,appName:P,tagline:F}),(0,Pa.jsx)("main",{className:"flex-1 p-0 flex flex-col Pa-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var Je=G(require("react"));var be=Je.forwardRef(({className:e,...t},a)=>(0,Pa.jsx)("div",{ref:a,className:c("rounded-xl border bg-card text-card-foreground shadow",e),...t}));be.displayName="Card";var Le=Je.forwardRef(({className:e,...t},a)=>(0,Pa.jsx)("div",{ref:a,className:c("flex flex-col space-y-1.5 p-6",e),...t}));Le.displayName="CardHeader";var Be=Je.forwardRef(({className:e,...t},a)=>(0,Pa.jsx)("div",{ref:a,className:c("font-semibold leading-none tracking-tight",e),...t}));Be.displayName="CardTitle";var Zt=Je.forwardRef(({className:e,...t},a)=>(0,Pa.jsx)("div",{ref:a,className:c("text-sm text-muted-foreground",e),...t}));Zt.displayName="CardDescription";var Pe=Je.forwardRef(({className:e,...t},a)=>(0,Pa.jsx)("div",{ref:a,className:c("p-6 pt-0",e),...t}));Pe.displayName="CardContent";var ft=Je.forwardRef(({className:e,...t},a)=>(0,Pa.jsx)("div",{ref:a,className:c("flex items-center p-6 pt-0",e),...t}));ft.displayName="CardFooter";function ao({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:s,onSessionEdit:i,onSessionDelete:l,className:r}){return(0,Pa.jsx)(tt,{children:(0,Pa.jsx)("div",{className:`space-y-4 Pa-full ${r||""}`,children:(0,Pa.jsxs)(be,{className:"shadow-sm Pa-full",children:[(0,Pa.jsx)("div",{className:"p-4 border-Pa",children:(0,Pa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pa.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,Pa.jsx)(Mo.Clock,{className:"Pa-4 w-4"}),"Recent Chats"]}),(0,Pa.jsxs)(S,{onClick:o,size:"sm",className:"gap-1 Pa-7 px-2 rounded-lg shadow-sm",children:[(0,Pa.jsx)(Mo.Plus,{className:"Pa-3 w-3"}),"New"]})]})}),(0,Pa.jsx)(Ce,{className:"Pa-[600px]",children:(0,Pa.jsx)("div",{className:"p-2",children:e.length===0?(0,Pa.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(p=>(0,Pa.jsxs)(at,{children:[(0,Pa.jsx)(ot,{asChild:!0,children:(0,Pa.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,Pa.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,Pa.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,Pa.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:p.title}),(0,Pa.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:p.lastMessage})]}),(0,Pa.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[i&&(0,Pa.jsx)(S,{variant:"ghost",size:"icon",className:"Pa-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:u=>{u.stopPropagation(),i(p.id)},children:(0,Pa.jsx)(Mo.Edit3,{className:"Pa-3 w-3"})}),l&&(0,Pa.jsx)(S,{variant:"ghost",size:"icon",className:"Pa-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,Pa.jsx)(Mo.Trash2,{className:"Pa-3 w-3"})})]})]})})}),(0,Pa.jsx)(Ke,{side:"right",className:"max-w-xs",children:(0,Pa.jsxs)("div",{className:"space-y-1",children:[(0,Pa.jsx)("p",{className:"font-medium text-sm",children:p.title}),(0,Pa.jsx)("p",{className:"text-xs",children:p.lastMessage})]})})]},p.id))})})]})})})}var Ye=G(require("motion/react-client"));var oo={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"]},io=[{id:"sales",name:"Sales",description:"Revenue and customer management",iconName:"DollarSign",color:"bg-green-600",type:"category",actions:[{id:"view-pipeline",label:"View Pipeline",description:"See all opportunities in pipeline",iconName:"BarChart",action:e=>console.log("View pipeline",e)},{id:"create-opportunity",label:"Create Opportunity",iconName:"Target",action:e=>console.log("Create opportunity",e)}],children:[{id:"customers",name:"Customers",description:"Customer accounts and contacts",iconName:"Users",color:"bg-blue-500",type:"list",actions:[{id:"add-customer",label:"Add Customer",iconName:"User",action:e=>console.log("Add customer",e)},{id:"export-customers",label:"Export List",iconName:"FileText",action:e=>console.log("Export customers",e)}],data:[{id:"acme-corp",title:"Acme Corp",subtitle:"Enterprise Customer",value:"$125K ARR",metadata:{industry:"Technology",employees:500,lastContact:"2024-01-15"}},{id:"beta-inc",title:"Beta Inc",subtitle:"Mid-market",value:"$45K ARR",metadata:{industry:"Healthcare",employees:150,lastContact:"2024-01-10"}},{id:"gamma-llc",title:"Gamma LLC",subtitle:"Small Business",value:"$15K ARR",metadata:{industry:"Manufacturing",employees:50,lastContact:"2024-01-08"}}]},{id:"opportunities",name:"Opportunities",description:"Sales opportunities and deals",iconName:"Target",color:"bg-yellow-500",type:"list",actions:[{id:"close-won",label:"Mark as Won",iconName:"CheckCircle",action:e=>console.log("Close won",e)},{id:"schedule-followup",label:"Schedule Follow-up",iconName:"Clock",action:e=>console.log("Schedule follow-up",e)}],data:[{id:"opp-1",title:"Acme Corp - Enterprise License",subtitle:"Closing Q1 2024",value:"$85K",metadata:{stage:"Negotiation",probability:80,closeDate:"2024-03-31"}},{id:"opp-2",title:"Beta Inc - Platform Upgrade",subtitle:"Closing Q2 2024",value:"$32K",metadata:{stage:"Proposal",probability:65,closeDate:"2024-06-15"}}]}]},{id:"marketing",name:"Marketing",description:"Marketing campaigns and analytics",iconName:"TrendingUp",color:"bg-pink-600",type:"category",actions:[{id:"view-analytics",label:"View Analytics",iconName:"BarChart",action:e=>console.log("View analytics",e)}],children:[{id:"campaigns",name:"Campaigns",description:"Marketing campaigns and performance",iconName:"TrendingUp",color:"bg-pink-500",type:"list",data:[{id:"campaign-1",title:"Q1 Product Launch",subtitle:"Active Campaign",value:"45% CTR",metadata:{budget:"$50K",spend:"$32K",leads:1250}},{id:"campaign-2",title:"Holiday Promotion",subtitle:"Completed",value:"38% CTR",metadata:{budget:"$25K",spend:"$24K",leads:890}}]}]},{id:"projects",name:"Projects",description:"Project management and tracking",iconName:"Briefcase",color:"bg-blue-600",type:"category",children:[{id:"active-projects",name:"Active Projects",description:"Currently active projects",iconName:"Activity",color:"bg-blue-500",type:"list",data:[{id:"project-1",title:"Website Redesign",subtitle:"In Progress",value:"75% Complete",metadata:{team:"Design",deadline:"2024-02-15",status:"On Track"}},{id:"project-2",title:"Mobile App Development",subtitle:"Planning",value:"25% Complete",metadata:{team:"Engineering",deadline:"2024-03-31",status:"On Track"}}]}]},{id:"engineering",name:"Engineering",description:"Development and technical operations",iconName:"Code",color:"bg-purple-600",type:"category",actions:[{id:"view-repos",label:"View Repositories",description:"See all code repositories",iconName:"Git",action:e=>console.log("View repositories",e)},{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)}],children:[{id:"repositories",name:"Repositories",description:"Code repositories and projects",iconName:"GitBranch",color:"bg-purple-500",type:"list",actions:[{id:"create-repo",label:"Create Repository",iconName:"Plus",action:e=>console.log("Create repository",e)},{id:"view-commits",label:"View Commits",iconName:"Git",action:e=>console.log("View commits",e)}],data:[{id:"repo-1",title:"frontend-app",subtitle:"React Application",value:"Main Branch",metadata:{language:"TypeScript",commits:1247,contributors:8}},{id:"repo-2",title:"backend-api",subtitle:"Node.js API",value:"Main Branch",metadata:{language:"Node.js",commits:892,contributors:5}}]},{id:"tasks",name:"Tasks",description:"Development tasks and issues",iconName:"CheckSquare",color:"bg-blue-500",type:"list",actions:[{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)},{id:"assign-task",label:"Assign Task",iconName:"UserPlus",action:e=>console.log("Assign task",e)}],data:[{id:"task-1",title:"Fix authentication bug",subtitle:"High Priority",value:"In Progress",metadata:{assignee:"John Doe",priority:"High",estimate:"4h"}},{id:"task-2",title:"Implement dark mode",subtitle:"Feature Request",value:"Todo",metadata:{assignee:"Jane Smith",priority:"Medium",estimate:"8h"}}]}]},{id:"design",name:"Design",description:"User experience and visual design",iconName:"Palette",color:"bg-pink-600",type:"category",actions:[{id:"view-designs",label:"View Designs",description:"See all design assets",iconName:"Image",action:e=>console.log("View designs",e)},{id:"create-mockup",label:"Create Mockup",iconName:"Plus",action:e=>console.log("Create mockup",e)}],children:[{id:"assets",name:"Assets",description:"Design assets and components",iconName:"Package",color:"bg-pink-500",type:"list",actions:[{id:"add-asset",label:"Add Asset",iconName:"Plus",action:e=>console.log("Add asset",e)},{id:"organize-assets",label:"Organize",iconName:"FolderOpen",action:e=>console.log("Organize assets",e)}],data:[{id:"asset-1",title:"Logo Variations",subtitle:"Brand Assets",value:"12 files",metadata:{format:"SVG",size:"2.4MB",updated:"2024-01-20"}},{id:"asset-2",title:"UI Components",subtitle:"Component Library",value:"45 components",metadata:{format:"Figma",size:"18.7MB",updated:"2024-01-22"}}]}]},{id:"product",name:"Product",description:"Product management and strategy",iconName:"Layers",color:"bg-indigo-600",type:"category",actions:[{id:"view-roadmap",label:"View Roadmap",description:"See product roadmap",iconName:"Map",action:e=>console.log("View roadmap",e)},{id:"create-feature",label:"Create Feature",iconName:"Plus",action:e=>console.log("Create feature",e)}],children:[{id:"features",name:"Features",description:"Product features and requirements",iconName:"Star",color:"bg-indigo-500",type:"list",actions:[{id:"add-feature",label:"Add Feature",iconName:"Plus",action:e=>console.log("Add feature",e)},{id:"prioritize-features",label:"Prioritize",iconName:"ArrowUp",action:e=>console.log("Prioritize features",e)}],data:[{id:"feature-1",title:"User Authentication",subtitle:"Security Feature",value:"In Development",metadata:{priority:"High",effort:"Large",impact:"High"}},{id:"feature-2",title:"Dark Mode",subtitle:"UI Enhancement",value:"Backlog",metadata:{priority:"Medium",effort:"Small",impact:"Medium"}}]}]}];function ea(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function no({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:s,colorScheme:i=oo,className:l}){let[r,p]=(0,Bo.useState)([]),[u,w]=(0,Bo.useState)([]),f=r[r.length-1],v=f?.children||e,R=(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,Bo.useMemo)(()=>({path:r,selectedItems:u,filters:{}}),[r,u]);(0,Bo.useEffect)(()=>{s&&s(M)},[M,s]);let T=C=>{C.type==="category"||C.type==="list"?p([...r,C]):C.type==="item"&&w([...u,C])},x=()=>{p(r.slice(0,-1))},P=C=>{p(r.slice(0,C+1))},F=()=>f?.actions?f.actions:[];return t?(0,Pa.jsxs)("div",{className:c("w-full",l),children:[(0,Pa.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Pa.jsxs)("div",{className:"flex items-center gap-2",children:[r.length>0&&(0,Pa.jsx)(Bt.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 Pa-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Pa.jsx)(Mo.ChevronLeft,{className:c("Pa-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,Pa.jsx)("h4",{className:"font-medium text-sm",children:f?.name||"Capabilities"})]}),(0,Pa.jsx)(Bt.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 Pa-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Pa.jsx)(Mo.X,{className:c("Pa-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),r.length>0&&(0,Pa.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,Pa.jsx)(Bt.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,Pa.jsxs)("span",{className:"relative",children:["Capabilities",(0,Pa.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Pa-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),r.map((C,z)=>(0,Pa.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Pa.jsx)(Mo.ChevronRight,{className:"Pa-2 w-2"}),(0,Pa.jsx)(Bt.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,Pa.jsxs)("span",{className:"relative",children:[C.name,(0,Pa.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Pa-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},C.id))]}),(0,Pa.jsx)("div",{className:"max-Pa-40 overflow-y-auto",children:(0,Pa.jsx)(Bt.AnimatePresence,{mode:"wait",children:(0,Pa.jsx)(Bt.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,Pa.jsx)(Ki,{data:f.data,onItemSelect:C=>w([...u,C]),colorScheme:i}):(0,Pa.jsx)($i,{capabilities:v,onSelect:T,colorScheme:i})},f?.id||"root")})})]}):(0,Pa.jsxs)(S,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,Pa.jsx)(Mo.Menu,{className:"Pa-4 w-4"}),(0,Pa.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function $i({capabilities:e,onSelect:t,colorScheme:a}){return(0,Pa.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,s)=>(0,Pa.jsx)(qi,{capability:o,onClick:()=>t(o),color:a.categories[s%a.categories.length]},o.id))})}function qi({capability:e,onClick:t,selected:a,color:o}){return(0,Pa.jsxs)(Bt.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,Pa.jsx)("div",{className:c("w-2 Pa-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,Pa.jsxs)("span",{className:"truncate relative",children:[e.name,(0,Pa.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Pa-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,Pa.jsx)(Mo.ChevronRight,{className:c("Pa-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,Pa.jsx)(me,{variant:"secondary",className:c("text-xs Pa-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function Ki({data:e,onItemSelect:t,colorScheme:a}){return(0,Pa.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,s)=>(0,Pa.jsxs)(Bt.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,Pa.jsx)("div",{className:c("w-2 Pa-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[s%a.items.length])}),(0,Pa.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pa.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,Pa.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Pa-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),o.subtitle&&(0,Pa.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,Pa.jsx)(me,{variant:"secondary",className:c("text-xs Pa-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 lo=require("date-fns");function ro({taskId:e,polling:t=!0,system:a="payload"}){let[o,s]=(0,Bo.useState)(null),[i,l]=(0,Bo.useState)(!1),[r,p]=(0,Bo.useState)(null),u=async(f=!0)=>{if(e){f&&l(!0);try{let v=await fetch(`/api/tasks/${e}`);if(!v.ok)throw new Error(`Failed to fetch task: ${v.statusText}`);let R=await v.json();s(R)}catch(v){console.error("Error fetching task:",v),p(v instanceof Error?v:new Error("Unknown error occurred"))}finally{f&&l(!1)}}},w=()=>u(!1);return(0,Bo.useEffect)(()=>{e&&u(!0);let f=null;return e&&t&&(f=setInterval(w,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:o,loading:i,error:r}}var _i=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"}},Ji=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function co({data:e}){let{id:t,system:a,fetchLatest:o,taskData:s,error:i}=e||{};if(!t)return null;let l=null,r=!0,p=i,u=o!==void 0?o:!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:o,system:a,fetchLatest:u,taskData:l,error:p}),u){let{task:R,loading:M,error:T}=ro({taskId:t,system:a});l=R,r=M,p=T}else r=!1;let w=_i(l?.status||"todo"),f=Ji(l?.status||"todo"),v=l?.dateLogged||new Date().toISOString();try{let R=new Date(l?.dateLogged||"");isNaN(R.getTime())||(v=(0,lo.formatDistanceToNow)(R,{addSuffix:!0}))}catch{}return(0,Pa.jsxs)(be,{className:c("w-full max-w-md shadow-md",p&&"border border-destructive"),children:[(0,Pa.jsxs)(Le,{className:"pb-2",children:[(0,Pa.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Pa.jsx)(Be,{className:"text-lg font-semibold",children:r?"Loading...":l?.name||"Task"}),(0,Pa.jsx)(me,{className:`${w}`,children:f})]}),l?.project&&(0,Pa.jsxs)(Zt,{className:"text-sm text-gray-500",children:["Project: ",l.project.name]})]}),(0,Pa.jsx)(Pe,{className:"pb-2",children:r?(0,Pa.jsx)("div",{className:"animate-pulse Pa-4 bg-gray-200 rounded w-3/4 mb-2"}):p?(0,Pa.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Pa.jsx)("p",{className:"text-sm text-foreground",children:l?.description||"......."})}),(0,Pa.jsx)(ft,{className:"pt-2 flex items-center justify-between",children:(0,Pa.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Pa.jsx)(Mo.Clock,{className:"Pa-3 w-3 mr-1"}),(0,Pa.jsxs)("span",{children:["Created ",v]}),(0,Pa.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Pa.jsxs)("span",{children:["Task #",t]})]})})]})}function uo({artefact:e,taskId:t,taskData:a,loading:o=!1,error:s=null}){let i=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},l=i.dateLogged;try{let r=new Date(i.dateLogged);isNaN(r.getTime())||(l=(0,lo.formatDistanceToNow)(r,{addSuffix:!0}))}catch{}return(0,Pa.jsxs)(be,{className:"w-full max-w-md shadow-md",children:[(0,Pa.jsx)(Le,{className:"pb-2",children:(0,Pa.jsx)("div",{className:"flex justify-between items-start",children:(0,Pa.jsx)(Be,{className:"text-lg font-semibold",children:o?"Loading...":i.name})})}),(0,Pa.jsx)(Pe,{className:"pb-2",children:o?(0,Pa.jsx)("div",{className:"animate-pulse Pa-4 bg-gray-200 rounded w-3/4 mb-2"}):s?(0,Pa.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Pa.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,Pa.jsx)(ft,{className:"pt-2 flex items-center justify-between",children:(0,Pa.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Pa.jsx)(Mo.Clock,{className:"Pa-3 w-3 mr-1"}),(0,Pa.jsxs)("span",{children:["Created ",l]}),(0,Pa.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Pa.jsxs)("span",{children:["Task #",i.id]})]})})]})}var fo=G(require("react"));var go=({isOpen:e=!0,authUrl:t,onClose:a,onSuccess:o,description:s="This endpoint requires authentication to sync functions."})=>{let[i,l]=(0,Bo.useState)(!1),[r,p]=(0,Bo.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 v=setInterval(()=>{try{f.closed&&(clearInterval(v),l(!1),o(),a())}catch{}},1e3);setTimeout(()=>{f.closed||(f.close(),clearInterval(v),l(!1),p("Authentication timed out. Please try again."))},6e5)}catch{p("Failed to open authentication window"),l(!1)}},w=async()=>{try{await navigator.clipboard.writeText(t),p("")}catch{p("Failed to copy URL to clipboard")}};return e?(0,Pa.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,Pa.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,Pa.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,Pa.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s}),r&&(0,Pa.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:r}),(0,Pa.jsxs)("div",{className:"flex gap-2",children:[(0,Pa.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
- ${r||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
8
- `,children:r?"Authenticating...":"Authenticate"}),(0,pa.jsx)("button",{onClick:D,disabled:!t,className:`
8
+ ${i||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
9
+ `,children:i?"Authenticating...":"Authenticate"}),(0,Pa.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,pa.jsx)("button",{onClick:a,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 ao=({toolPart:e,index:t,addToolResult:a})=>{let[o,s]=to.default.useState(!0),r=()=>{a(e.input?.toolCallId,e.input?.tool,"Authentication completed"),s(!1)};switch(e.state){case"input-available":return(0,pa.jsxs)("div",{className:"mb-2",children:[(0,pa.jsx)(eo,{isOpen:o,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>s(!1),onSuccess:r,description:e.output?.reason||e.input?.reason}),!o&&(0,pa.jsx)("div",{className:"flex items-center justify-center po-3",children:(0,pa.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,pa.jsx)("svg",{className:"pa-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,pa.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,pa.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var oo=require("marked"),io=W(require("react-markdown"));function Si(e){return oo.marked.lexer(e).map(a=>a.raw)}var ro=(0,po.memo)(({content:e})=>(0,pa.jsx)(io.default,{children:e}),(e,t)=>e.content===t.content);ro.displayName="MemoizedMarkdownBlock";var Qt=(0,po.memo)(({content:e,id:t})=>(0,po.useMemo)(()=>Si(e),[e]).map((o,s)=>(0,pa.jsx)(ro,{content:o},`${t}-block_${s}`)));Qt.displayName="PartText";function no({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:s,fileUploads:r,isDragOver:l,enableFileUpload:n,onInputChange:p,addToolResult:u,onSendMessage:D,onKeyPress:f,onFileUpload:y,onRemoveFile:T,onDragOver:U,className:S}){let x=(0,po.useRef)(null),R=(0,po.useRef)(null),F=(0,po.useRef)(null),[w,E]=(0,po.useState)(!1),[X,Y]=(0,po.useState)({path:[],selectedItems:[],filters:{}});(0,po.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,po.useEffect)(()=>{w&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[w]);let Z=()=>_t(X),Q=()=>{let m=[];return s.forEach(j=>{j.actions&&j.actions.forEach(K=>{m.push({label:K.label,action:()=>V(K.id,{path:[j],selectedItems:[],filters:{}})})}),j.children&&j.children.forEach(K=>{K.type==="list"&&K.data&&m.push({label:`View ${K.name}`,action:()=>E(!0)})})}),m.slice(0,5)},V=(m,j)=>{console.log("Capability action:",m,j);let K=`Executing ${m} with context: ${JSON.stringify(j.path.map(L=>L.name))}`;E(!1)},te=_t({path:[],selectedItems:[],filters:{}}),ne=m=>{y(m.target.files),m.target.files&&(m.target.value="")},A=m=>{m.preventDefault(),U(!0)},De=m=>{m.preventDefault(),U(!1)},d=m=>{m.preventDefault(),U(!1),y(m.dataTransfer.files)},B=m=>{if(m===0)return"0 Bytes";let j=1024,K=["Bytes","KB","MB","GB"],L=Math.floor(Math.log(m)/Math.log(j));return parseFloat((m/Math.pow(j,L)).toFixed(2))+" "+K[L]},I=m=>m.startsWith("image/")?(0,pa.jsx)(lo.Image,{className:"pa-4 w-4"}):m.startsWith("text/")?(0,pa.jsx)(lo.FileText,{className:"pa-4 w-4"}):(0,pa.jsx)(lo.File,{className:"pa-4 w-4"}),$=m=>{let j=m.role==="assistant",K=m.role==="user";return(0,pa.jsxs)("div",{className:c("flex items-start gap-3",K?"flex-row-reverse":""),children:[(0,pa.jsx)(Oe,{className:"pa-8 w-8 shrink-0",children:(0,pa.jsx)(Ge,{className:c(K?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:K?(0,pa.jsx)(lo.User,{className:"pa-4 w-4"}):(0,pa.jsx)(lo.Bot,{className:"pa-4 w-4"})})}),(0,pa.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((L,ae)=>{if(L.type==="text")return(0,pa.jsx)(Qt,{id:m.id,content:L.text},`${m.id}-text`);if(L.type==="file"){let k=L;return(0,pa.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,pa.jsxs)("div",{className:"flex items-center gap-2",children:[I(k.mediaType||"application/octet-stream"),(0,pa.jsx)("div",{className:"flex-1 min-w-0",children:(0,pa.jsx)("p",{className:"text-sm font-medium truncate",children:k.filename||k.url?.split("/").pop()||"File"})}),k.url&&(0,pa.jsx)(P,{variant:"ghost",size:"sm",onClick:()=>window.open(k.url,"_blank"),className:"pa-8 w-8 p-0",children:(0,pa.jsx)(lo.Download,{className:"pa-4 w-4"})})]})},ae)}if(L.type.startsWith("tool-")){let k=L,ve=L.type.replace("tool-","");if(ve==="task")switch(k.state){case"input-available":return(0,pa.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},ae);case"output-available":return(0,pa.jsx)("div",{className:"mb-2",children:(0,pa.jsx)(Qa,{data:{id:k.output?.id||k.input?.id,fetchLatest:!1,taskData:k.output||k.input}})},ae);case"output-error":return(0,pa.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",k.errorText]},ae);default:return null}if(L.type==="tool-requestEndpointLogin")return(0,pa.jsx)("div",{className:"mb-2",children:(0,pa.jsx)(ao,{toolPart:k,index:ae,addToolResult:u??(()=>{})})},ae);if(ve==="artefact")switch(k.state){case"input-available":return(0,pa.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},ae);case"output-available":return(0,pa.jsx)("div",{className:"mb-2",children:(0,pa.jsx)(Za,{artefact:k.output?.description||"",taskId:k.output?.id||k.input?.id,taskData:k.output||k.input})},ae);case"output-error":return(0,pa.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",k.errorText]},ae);default:return null}return(0,pa.jsx)("div",{className:"mb-2",children:(0,pa.jsxs)(ue,{className:"w-full max-w-md",children:[(0,pa.jsx)(Ae,{children:(0,pa.jsx)(Ie,{className:"text-lg",children:ve})}),(0,pa.jsxs)(Ce,{children:[k.state==="input-available"&&(0,pa.jsxs)("p",{className:"text-sm",children:["Processing ",ve,"..."]}),k.state==="output-available"&&(0,pa.jsx)("pre",{className:"text-sm",children:JSON.stringify(k.output,null,2)}),k.state==="output-error"&&(0,pa.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",k.errorText]})]})]})},ae)}if(L.type.startsWith("data-")){let k=L,ve=L.type.replace("data-","");return ve==="reference"?(0,pa.jsx)("div",{className:"mb-2",children:(0,pa.jsx)(ue,{className:"w-full",children:(0,pa.jsx)(Ce,{className:"p-4",children:(0,pa.jsx)("div",{className:"space-y-2",children:k.data?.references?.map((se,Pe)=>(0,pa.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,pa.jsx)(ce,{variant:"outline",children:se.type||"link"}),(0,pa.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,pa.jsx)("p",{className:"text-sm font-medium truncate",children:se.title}),se.description&&(0,pa.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:se.description})]}),se.url&&(0,pa.jsx)(P,{variant:"ghost",size:"sm",onClick:()=>window.open(se.url,"_blank"),className:"pa-8 w-8 p-0",children:(0,pa.jsx)(lo.ExternalLink,{className:"pa-4 w-4"})})]},Pe))})})})},ae):ve==="menu"?(0,pa.jsx)("div",{className:"mb-2",children:(0,pa.jsxs)(ue,{className:"w-full",children:[(0,pa.jsx)(Ae,{children:(0,pa.jsx)(Ie,{className:"text-lg",children:k.data?.title})}),(0,pa.jsx)(Ce,{children:(0,pa.jsx)("div",{className:"space-y-2",children:k.data?.items?.map((se,Pe)=>(0,pa.jsx)(P,{variant:"outline",className:"w-full justify-start",onClick:se.action,children:(0,pa.jsxs)("div",{className:"text-left",children:[(0,pa.jsx)("p",{className:"font-medium",children:se.label}),se.description&&(0,pa.jsx)("p",{className:"text-xs text-muted-foreground",children:se.description})]})},Pe))})})]})},ae):(0,pa.jsx)("div",{className:"mb-2",children:(0,pa.jsxs)(ue,{className:"w-full max-w-md",children:[(0,pa.jsx)(Ae,{children:(0,pa.jsx)(Ie,{className:"text-lg",children:ve})}),(0,pa.jsx)(Ce,{children:(0,pa.jsx)("pre",{className:"text-sm",children:JSON.stringify(k.data,null,2)})})]})},ae)}return null})})]})};return(0,pa.jsxs)("div",{className:`pa-full flex flex-col shadow-sm max-w-4xl mx-auto ${S||""}`,children:[(0,pa.jsxs)(ye,{ref:R,className:"flex-1 p-4 bg-background border-0",onDragOver:A,onDragLeave:De,onDrop:d,children:[(0,pa.jsxs)("div",{className:c("space-y-4",l&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,pa.jsx)(_e.animate,{children:e.map(m=>(0,pa.jsx)(_e.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:$(m)},m.id))}),w&&(0,pa.jsxs)(_e.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,pa.jsx)(Oe,{className:"pa-8 w-8",children:(0,pa.jsx)(Ge,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,pa.jsx)(lo.Bot,{className:"pa-4 w-4"})})}),(0,pa.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,pa.jsx)(Ka,{capabilities:s,isOpen:w,onToggle:()=>E(!w),onActionSelect:V,className:"w-full"})})]}),a&&(0,pa.jsxs)(_e.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,pa.jsx)(Oe,{className:"pa-8 w-8",children:(0,pa.jsx)(Ge,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,pa.jsx)(lo.Bot,{className:"pa-4 w-4"})})}),(0,pa.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,pa.jsxs)("div",{className:"flex space-x-1",children:[(0,pa.jsx)("div",{className:"w-2 pa-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,pa.jsx)("div",{className:"w-2 pa-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,pa.jsx)("div",{className:"w-2 pa-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,pa.jsx)("div",{ref:x})]}),r.length>0&&(0,pa.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,pa.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(m=>(0,pa.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[I(m.file.type),(0,pa.jsx)("span",{className:"text-sm font-medium",children:m.file.name}),(0,pa.jsx)("span",{className:"text-xs text-muted-foreground",children:B(m.file.size)}),(0,pa.jsx)(P,{variant:"ghost",size:"sm",onClick:()=>T(m.id),className:"pa-6 w-6 p-0",children:(0,pa.jsx)(lo.X,{className:"pa-4 w-4"})})]},m.id))})}),(0,pa.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,pa.jsxs)("div",{className:"flex gap-3",children:[(0,pa.jsx)(nt,{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,pa.jsx)(P,{variant:"outline",size:"icon",onClick:()=>F.current?.click(),className:"rounded-2xl pa-10 w-10 shadow-sm",children:(0,pa.jsx)(lo.Paperclip,{className:"pa-4 w-4"})}),(0,pa.jsx)(P,{onClick:D,disabled:!t.trim()&&r.length===0||a,size:"icon",className:"rounded-2xl pa-10 w-10 shadow-sm",children:(0,pa.jsx)(lo.Send,{className:"pa-4 w-4"})})]}),(0,pa.jsxs)("div",{className:"flex items-center gap-3 po-3",children:[(0,pa.jsxs)(P,{onClick:()=>E(!w),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,pa.jsx)(lo.Menu,{className:"pa-3 w-3 mr-1"}),w?"Hide":"Show"," Capabilities"]}),(0,pa.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[Z().map((m,j)=>(0,pa.jsx)(P,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>V(m.id,X),children:m.label},`context-${m.id}`)),Z().length===0&&Q().map((m,j)=>(0,pa.jsx)(P,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:m.action,children:m.label},`suggestion-${j}`))]})]}),n&&(0,pa.jsx)("input",{ref:F,type:"file",multiple:!0,onChange:ne,className:"hidden"})]})]})}function co({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:s=[],capabilities:r=[],sidebarItems:l=[],notifications:n=[],sessions:p=[],onNewChat:u,onSessionSelect:D,onSessionDelete:f,onSessionEdit:y=()=>{},onBusinessUnitChange:T=()=>{},onNotificationRemove:U=()=>{},onRemoveAll:S=()=>{},onActionClick:x=()=>{},onSearch:R=B=>console.log("Search query:",B),initialTeam:F="design",currentSession:w=null,showCapabilities:E=!0,title:X="Digital Colleagues",enableFileUpload:Y=!0,maxFileSize:Z=10,allowedFileTypes:Q=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:V="/headerlogo.png",appName:te="Nuvia",tagline:ne="AI-Powered Workspace",actionIcon:A=(0,pa.jsx)(lo.Users,{className:"mr-2 pa-4 w-4"}),actionText:De="Collaborate",sidebarInitiallyClosed:d=!1}){let B={...e,onError:H=>{$?.setMessages(le=>[...le,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:H.message}]}]),console.error("Error in CopilotInterface:",H)}},I=(0,so.useChat)(B||{}),$=a?t||I:null,[m,j]=(0,po.useState)(""),[K,L]=(0,po.useState)(!1),ae=$?.messages||o,k=m,ve=$?.status==="submitted"||K,se=$?.addToolResult?(H,le,oe)=>{$.addToolResult({tool:le,toolCallId:H,output:oe}),$.sendMessage()}:()=>{},Pe=s||[],uo={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"},[go,fo]=(0,po.useState)(()=>Pe.length===0?uo:Pe.find(H=>H.id===F)||Pe[0]),[ot,pt]=(0,po.useState)([]),[bo,ho]=(0,po.useState)(!1),vo=H=>{if(!H||!Y)return;let le=[];Array.from(H).forEach(oe=>{if(oe.size>Z*1024*1024){alert(`File ${oe.name} is too large. Maximum size is ${Z}MB.`);return}if(Q.length>0&&!Q.some(ut=>oe.type.match(ut))){alert(`File type ${oe.type} is not allowed.`);return}let ea={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:oe,status:"pending",progress:0};if(oe.type.startsWith("image/")){let ut=new FileReader;ut.onload=No=>{pt(ko=>ko.map(Rt=>Rt.id===ea.id?{...Rt,preview:No.target?.result}:Rt))},ut.readAsDataURL(oe)}le.push(ea)}),pt(oe=>[...oe,...le])},yo=H=>{pt(le=>le.filter(oe=>oe.id!==H))},Zt=()=>{if(!(!k.trim()&&ot.length===0)){if($){let H=ot.length>0?xo(ot.map(le=>le.file)):void 0;$.sendMessage({text:k,files:H},{body:{timestamp:Date.now()}}),j("")}else console.log("Message to send:",k),console.log("Files to upload:",ot),j(""),L(!0),setTimeout(()=>{L(!1)},1500);pt([])}},xo=H=>{let le=new DataTransfer;return H.forEach(oe=>le.items.add(oe)),le.files},wo=H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),Zt())},Co=H=>{j(H)};return(0,pa.jsx)(Ga,{sidebarItems:l||[],title:X,notifications:n||[],businessUnits:Pe,currentBusinessUnit:go,onBusinessUnitChange:H=>{H&&(fo(H),T?.(H))},onSearch:R,showTabs:!1,onActionClick:x,actionIcon:A,actionText:De,onNotificationRemove:U,onRemoveAll:S,logo:V,appName:te,tagline:ne,sidebarInitiallyClosed:d,children:(0,pa.jsx)(St.AnimatePresence,{mode:"wait",children:(0,pa.jsx)(St.motion.div,{className:"flex-1 pa-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,pa.jsxs)("div",{className:"pa-full flex",children:[(0,pa.jsx)("div",{className:"w-80 flex-shrink-0 pa-full p-2",children:(0,pa.jsx)(Va,{sessions:p||[],currentSession:w,teams:Pe,onNewChat:u,onSessionSelect:D,onSessionEdit:y,onSessionDelete:f})}),(0,pa.jsx)("div",{className:"flex-1 pa-full p-2",children:(0,pa.jsx)(no,{messages:ae||[],input:k,isTyping:ve,currentSessionTitle:w?.title,capabilities:r||[],onInputChange:Co,addToolResult:se,onSendMessage:Zt,onKeyPress:wo,fileUploads:ot,isDragOver:bo,enableFileUpload:Y,onFileUpload:vo,onRemoveFile:yo,onDragOver:ho})})]})},"chat-interface")})})}var mo=[{id:"1",role:"user",parts:[{type:"text",text:"Can you write me a comprehensive analysis of the current state of artificial intelligence and machine learning technologies, including their applications, limitations, and future prospects?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:`Here's a comprehensive analysis of the current state of AI and ML technologies:
12
+ `,children:"Copy URL"}),(0,Pa.jsx)("button",{onClick:a,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 aa=({toolPart:e,index:t,addToolResult:a})=>{let[o,s]=fo.default.useState(!0),i=()=>{a(e.input?.toolCallId,e.input?.tool,"Authentication completed"),s(!1)};switch(e.state){case"input-available":return(0,Pa.jsxs)("div",{className:"mb-2",children:[(0,Pa.jsx)(go,{isOpen:o,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>s(!1),onSuccess:i,description:e.output?.reason||e.input?.reason}),!o&&(0,Pa.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Pa.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,Pa.jsx)("svg",{className:"Pa-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Pa.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,Pa.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var bo=require("marked"),ho=G(require("react-markdown"));function Qi(e){return bo.marked.lexer(e).map(a=>a.raw)}var vo=(0,Bo.memo)(({content:e})=>(0,Pa.jsx)(ho.default,{children:e}),(e,t)=>e.content===t.content);vo.displayName="MemoizedMarkdownBlock";var oa=(0,Bo.memo)(({content:e,id:t})=>(0,Bo.useMemo)(()=>Qi(e),[e]).map((o,s)=>(0,Pa.jsx)(vo,{content:o},`${t}-block_${s}`)));oa.displayName="PartText";var na=G(require("react"));var xo=({isOpen:e=!0,reason:t,onClose:a,onApprove:o,onDeny:s,title:i="Approval Required"})=>{let[l,r]=(0,Bo.useState)(!1),p=()=>{r(!0),o(),a()},u=()=>{r(!0),s(),a()},w=()=>{r(!0),s(),a()};return e?(0,Pa.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full shadow-lg",children:[(0,Pa.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:i}),(0,Pa.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:t}),(0,Pa.jsxs)("div",{className:"flex gap-2",children:[(0,Pa.jsx)("button",{onClick:p,disabled:l,className:`
13
+ px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
14
+ ${l?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
15
+ `,children:l?"Processing...":"Approve"}),(0,Pa.jsx)("button",{onClick:u,disabled:l,className:`
16
+ px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
17
+ ${l?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
18
+ `,children:l?"Processing...":"Deny"}),(0,Pa.jsx)("button",{onClick:w,disabled:l,className:`
19
+ px-4 py-2 text-white border-none rounded text-sm
20
+ ${l?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
21
+ `,children:"Cancel"})]})]}):null};var wo=({toolPart:e,index:t,addToolResult:a})=>{let[o,s]=na.default.useState(!0),[i,l]=na.default.useState(null),r=()=>{a(e.input?.toolCallId,e.input?.tool,"Approved"),s(!1),l("approve")},p=()=>{a(e.input?.toolCallId,e.input?.tool,"Denied"),s(!1),l("deny")};switch(e.state){case"input-available":return(0,Pa.jsxs)("div",{className:"mb-2",children:[(0,Pa.jsx)(xo,{isOpen:o,onApprove:r,onDeny:p,onClose:()=>s(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!o&&(0,Pa.jsxs)(Pa.Fragment,{children:[i==="approve"&&(0,Pa.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Pa.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,Pa.jsx)("svg",{className:"Pa-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Pa.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),i==="deny"&&(0,Pa.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Pa.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,Pa.jsx)("svg",{className:"Pa-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Pa.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Pa.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var sa=require("@radix-ui/react-use-controllable-state");var rt=G(require("@radix-ui/react-collapsible")),Co=rt.Root,No=rt.CollapsibleTrigger,ko=rt.CollapsibleContent;var Do=require("streamdown"),ra=(0,Bo.memo)(({className:e,...t})=>(0,Pa.jsx)(Do.Streamdown,{className:c("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);ra.displayName="Response";var Ro=(0,Bo.createContext)(null),Xi=()=>{let e=(0,Bo.useContext)(Ro);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},Yi=1e3,Zi=1e3,la=(0,Bo.memo)(({className:e,isStreaming:t=!1,open:a,defaultOpen:o=!0,onOpenChange:s,duration:i,children:l,...r})=>{let[p,u]=(0,sa.useControllableState)({prop:a,defaultProp:o,onChange:s}),[w,f]=(0,sa.useControllableState)({prop:i,defaultProp:0}),[v,R]=(0,Bo.useState)(!1),[M,T]=(0,Bo.useState)(null);(0,Bo.useEffect)(()=>{t?M===null&&T(Date.now()):M!==null&&(f(Math.ceil((Date.now()-M)/Zi)),T(null))},[t,M,f]),(0,Bo.useEffect)(()=>{if(o&&!t&&p&&!v){let P=setTimeout(()=>{u(!1),R(!0)},Yi);return()=>clearTimeout(P)}},[t,p,o,u,v]);let x=P=>{u(P)};return(0,Pa.jsx)(Ro.Provider,{value:{isStreaming:t,isOpen:p,setIsOpen:u,duration:w},children:(0,Pa.jsx)(Co,{className:c("not-prose mb-4",e),onOpenChange:x,open:p,...r,children:l})})}),en=(e,t)=>e||t===0?(0,Pa.jsx)("p",{children:"Thinking..."}):t===void 0?(0,Pa.jsx)("p",{children:"Thought for a few seconds"}):(0,Pa.jsxs)("p",{children:["Thought for ",t," seconds"]}),ca=(0,Bo.memo)(({className:e,children:t,...a})=>{let{isStreaming:o,isOpen:s,duration:i}=Xi();return(0,Pa.jsx)(No,{className:c("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...a,children:t??(0,Pa.jsxs)(Pa.Fragment,{children:[(0,Pa.jsx)(Mo.BrainIcon,{className:"size-4"}),en(o,i),(0,Pa.jsx)(Mo.ChevronDownIcon,{className:c("size-4 transition-transform",s?"rotate-180":"rotate-0")})]})})}),da=(0,Bo.memo)(({className:e,children:t,...a})=>(0,Pa.jsx)(ko,{className:c("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...a,children:(0,Pa.jsx)(ra,{className:"grid gap-2",children:t})}));la.displayName="Reasoning";ca.displayName="ReasoningTrigger";da.displayName="ReasoningContent";function Ao({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:s,fileUploads:i,isDragOver:l,enableFileUpload:r,onInputChange:p,addToolResult:u,onSendMessage:w,onKeyPress:f,onFileUpload:v,onRemoveFile:R,onDragOver:M,className:T}){let x=(0,Bo.useRef)(null),P=(0,Bo.useRef)(null),F=(0,Bo.useRef)(null),[C,z]=(0,Bo.useState)(!1),[Y,Z]=(0,Bo.useState)({path:[],selectedItems:[],filters:{}});(0,Bo.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,Bo.useEffect)(()=>{C&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[C]);let ee=()=>ea(Y),X=()=>{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(A=>A.name))}`;z(!1)},oe=ea({path:[],selectedItems:[],filters:{}}),le=m=>{v(m.target.files),m.target.files&&(m.target.value="")},I=m=>{m.preventDefault(),M(!0)},Re=m=>{m.preventDefault(),M(!1)},d=m=>{m.preventDefault(),M(!1),v(m.dataTransfer.files)},E=m=>{if(m===0)return"0 Bytes";let j=1024,K=["Bytes","KB","MB","GB"],A=Math.floor(Math.log(m)/Math.log(j));return parseFloat((m/Math.pow(j,A)).toFixed(2))+" "+K[A]},L=m=>m.startsWith("image/")?(0,Pa.jsx)(Mo.Image,{className:"Pa-4 w-4"}):m.startsWith("text/")?(0,Pa.jsx)(Mo.FileText,{className:"Pa-4 w-4"}):(0,Pa.jsx)(Mo.File,{className:"Pa-4 w-4"}),q=m=>{let j=m.role==="assistant",K=m.role==="user";return(0,Pa.jsxs)("div",{className:c("flex my-2 items-start gap-3",K?"flex-row-reverse":""),children:[(0,Pa.jsx)($e,{className:"Pa-8 w-8 shrink-0",children:(0,Pa.jsx)(qe,{className:c(K?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:K?(0,Pa.jsx)(Mo.User,{className:"Pa-4 w-4"}):(0,Pa.jsx)(Mo.Bot,{className:"Pa-4 w-4"})})}),(0,Pa.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((A,$)=>{if(A.type==="text")return(0,Pa.jsx)(oa,{id:m.id,content:A.text},`${m.id}-text`);if(A.type==="file"){let k=A;return(0,Pa.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,Pa.jsxs)("div",{className:"flex items-center gap-2",children:[L(k.mediaType||"application/octet-stream"),(0,Pa.jsx)("div",{className:"flex-1 min-w-0",children:(0,Pa.jsx)("p",{className:"text-sm font-medium truncate",children:k.filename||k.url?.split("/").pop()||"File"})}),k.url&&(0,Pa.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>window.open(k.url,"_blank"),className:"Pa-8 w-8 p-0",children:(0,Pa.jsx)(Mo.Download,{className:"Pa-4 w-4"})})]})},$)}if(A.type.startsWith("tool-")){let k=A,we=A.type.replace("tool-","");if(we==="task")switch(k.state){case"input-available":return(0,Pa.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},$);case"output-available":return(0,Pa.jsx)("div",{className:"mb-2",children:(0,Pa.jsx)(co,{data:{id:k.output?.id||k.input?.id,fetchLatest:!1,taskData:k.output||k.input}})},$);case"output-error":return(0,Pa.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",k.errorText]},$);default:return null}if(A.type==="tool-requestEndpointLogin")return(0,Pa.jsx)("div",{className:"mb-2",children:(0,Pa.jsx)(aa,{toolPart:k,index:$,addToolResult:u??(()=>{})})},$);if(A.type==="tool-authenticate")return(0,Pa.jsx)("div",{className:"mb-2",children:(0,Pa.jsx)(aa,{toolPart:k,index:$,addToolResult:u??(()=>{})})},$);if(A.type==="tool-requestApproval")return(0,Pa.jsx)("div",{className:"mb-2",children:(0,Pa.jsx)(wo,{toolPart:k,index:$,addToolResult:u??(()=>{})})},$);if(we==="artefact")switch(k.state){case"input-available":return(0,Pa.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},$);case"output-available":return(0,Pa.jsx)("div",{className:"mb-2",children:(0,Pa.jsx)(uo,{artefact:k.output?.description||"",taskId:k.output?.id||k.input?.id,taskData:k.output||k.input})},$);case"output-error":return(0,Pa.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",k.errorText]},$);default:return null}return(0,Pa.jsx)("div",{className:"mb-2",children:(0,Pa.jsxs)(be,{className:"w-full max-w-md",children:[(0,Pa.jsx)(Le,{children:(0,Pa.jsx)(Be,{className:"text-lg",children:we})}),(0,Pa.jsxs)(Pe,{children:[k.state==="input-available"&&(0,Pa.jsxs)("p",{className:"text-sm",children:["Processing ",we,"..."]}),k.state==="output-available"&&(0,Pa.jsx)("pre",{className:"text-sm",children:JSON.stringify(k.output,null,2)}),k.state==="output-error"&&(0,Pa.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",k.errorText]})]})]})},$)}if(A.type.startsWith("data-")){let k=A,we=A.type.replace("data-","");return we==="reference"?(0,Pa.jsx)("div",{className:"mb-2",children:(0,Pa.jsx)(be,{className:"w-full",children:(0,Pa.jsx)(Pe,{className:"p-4",children:(0,Pa.jsx)("div",{className:"space-y-2",children:k.data?.references?.map((de,Ae)=>(0,Pa.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,Pa.jsx)(me,{variant:"outline",children:de.type||"link"}),(0,Pa.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pa.jsx)("p",{className:"text-sm font-medium truncate",children:de.title}),de.description&&(0,Pa.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:de.description})]}),de.url&&(0,Pa.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>window.open(de.url,"_blank"),className:"Pa-8 w-8 p-0",children:(0,Pa.jsx)(Mo.ExternalLink,{className:"Pa-4 w-4"})})]},Ae))})})})},$):we==="menu"?(0,Pa.jsx)("div",{className:"mb-2",children:(0,Pa.jsxs)(be,{className:"w-full",children:[(0,Pa.jsx)(Le,{children:(0,Pa.jsx)(Be,{className:"text-lg",children:k.data?.title})}),(0,Pa.jsx)(Pe,{children:(0,Pa.jsx)("div",{className:"space-y-2",children:k.data?.items?.map((de,Ae)=>(0,Pa.jsx)(S,{variant:"outline",className:"w-full justify-start",onClick:de.action,children:(0,Pa.jsxs)("div",{className:"text-left",children:[(0,Pa.jsx)("p",{className:"font-medium",children:de.label}),de.description&&(0,Pa.jsx)("p",{className:"text-xs text-muted-foreground",children:de.description})]})},Ae))})})]})},$):(0,Pa.jsx)("div",{className:"mb-2",children:(0,Pa.jsxs)(be,{className:"w-full max-w-md",children:[(0,Pa.jsx)(Le,{children:(0,Pa.jsx)(Be,{className:"text-lg",children:we})}),(0,Pa.jsx)(Pe,{children:(0,Pa.jsx)("pre",{className:"text-sm",children:JSON.stringify(k.data,null,2)})})]})},$)}if(A.type==="reasoning")return(0,Pa.jsxs)(la,{className:"w-full",isStreaming:status==="streaming"&&$===m.parts.length-1&&m.id===e.at(-1)?.id,children:[(0,Pa.jsx)(ca,{}),(0,Pa.jsx)(da,{children:A.text})]},`${m.id}-${$}`)})})]})};return(0,Pa.jsxs)("div",{className:`Pa-full flex flex-col shadow-sm max-w-4xl mx-auto ${T||""}`,children:[(0,Pa.jsxs)(Ce,{ref:P,className:"flex-1 p-4 bg-background border-0",onDragOver:I,onDragLeave:Re,onDrop:d,children:[(0,Pa.jsxs)("div",{className:c("space-y-4",l&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Pa.jsx)(Ye.animate,{children:e.map(m=>(0,Pa.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,Pa.jsxs)(Ye.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Pa.jsx)($e,{className:"Pa-8 w-8",children:(0,Pa.jsx)(qe,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Pa.jsx)(Mo.Bot,{className:"Pa-4 w-4"})})}),(0,Pa.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Pa.jsx)(no,{capabilities:s,isOpen:C,onToggle:()=>z(!C),onActionSelect:W,className:"w-full"})})]}),a&&(0,Pa.jsxs)(Ye.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Pa.jsx)($e,{className:"Pa-8 w-8",children:(0,Pa.jsx)(qe,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Pa.jsx)(Mo.Bot,{className:"Pa-4 w-4"})})}),(0,Pa.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Pa.jsxs)("div",{className:"flex space-x-1",children:[(0,Pa.jsx)("div",{className:"w-2 Pa-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Pa.jsx)("div",{className:"w-2 Pa-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Pa.jsx)("div",{className:"w-2 Pa-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Pa.jsx)("div",{ref:x})]}),i.length>0&&(0,Pa.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,Pa.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(m=>(0,Pa.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[L(m.file.type),(0,Pa.jsx)("span",{className:"text-sm font-medium",children:m.file.name}),(0,Pa.jsx)("span",{className:"text-xs text-muted-foreground",children:E(m.file.size)}),(0,Pa.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>R(m.id),className:"Pa-6 w-6 p-0",children:(0,Pa.jsx)(Mo.X,{className:"Pa-4 w-4"})})]},m.id))})}),(0,Pa.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,Pa.jsxs)("div",{className:"flex gap-3",children:[(0,Pa.jsx)(pt,{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}),r&&(0,Pa.jsx)(S,{variant:"outline",size:"icon",onClick:()=>F.current?.click(),className:"rounded-2xl Pa-10 w-10 shadow-sm",children:(0,Pa.jsx)(Mo.Paperclip,{className:"Pa-4 w-4"})}),(0,Pa.jsx)(S,{onClick:w,disabled:!t.trim()&&i.length===0||a,size:"icon",className:"rounded-2xl Pa-10 w-10 shadow-sm",children:(0,Pa.jsx)(Mo.Send,{className:"Pa-4 w-4"})})]}),(0,Pa.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Pa.jsxs)(S,{onClick:()=>z(!C),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Pa.jsx)(Mo.Menu,{className:"Pa-3 w-3 mr-1"}),C?"Hide":"Show"," Capabilities"]}),(0,Pa.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[ee().map((m,j)=>(0,Pa.jsx)(S,{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&&X().map((m,j)=>(0,Pa.jsx)(S,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:m.action,children:m.label},`suggestion-${j}`))]})]}),r&&(0,Pa.jsx)("input",{ref:F,type:"file",multiple:!0,onChange:le,className:"hidden"})]})]})}function Io({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:s=[],capabilities:i=[],sidebarItems:l=[],notifications:r=[],sessions:p=[],onNewChat:u,onSessionSelect:w,onSessionDelete:f,onSessionEdit:v=()=>{},onBusinessUnitChange:R=()=>{},onNotificationRemove:M=()=>{},onRemoveAll:T=()=>{},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:X=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:W="/headerlogo.png",appName:oe="Nuvia",tagline:le="AI-Powered Workspace",actionIcon:I=(0,Pa.jsx)(Mo.Users,{className:"mr-2 Pa-4 w-4"}),actionText:Re="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)}},L=(0,So.useChat)(E||{}),q=a?t||L:null,[m,j]=(0,Bo.useState)(""),[K,A]=(0,Bo.useState)(!1),$=q?.messages||o,k=m,we=q?.status==="submitted"||K,de=q?.addToolResult?(O,pe,ie)=>{q.addToolResult({tool:pe,toolCallId:O,output:ie}),q.sendMessage()}:()=>{},Ae=s||[],Eo={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"},[zo,Uo]=(0,Bo.useState)(()=>Ae.length===0?Eo:Ae.find(O=>O.id===F)||Ae[0]),[lt,ht]=(0,Bo.useState)([]),[Fo,jo]=(0,Bo.useState)(!1),Oo=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(X.length>0&&!X.some(vt=>ie.type.match(vt))){alert(`File type ${ie.type} is not allowed.`);return}let ua={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:ie,status:"pending",progress:0};if(ie.type.startsWith("image/")){let vt=new FileReader;vt.onload=$o=>{ht(qo=>qo.map(Et=>Et.id===ua.id?{...Et,preview:$o.target?.result}:Et))},vt.readAsDataURL(ie)}pe.push(ua)}),ht(ie=>[...ie,...pe])},Ho=O=>{ht(pe=>pe.filter(ie=>ie.id!==O))},ma=()=>{if(!(!k.trim()&&lt.length===0)){if(q){let O=lt.length>0?Vo(lt.map(pe=>pe.file)):void 0;q.sendMessage({text:k,files:O},{body:{timestamp:Date.now()}}),j("")}else console.log("Message to send:",k),console.log("Files to upload:",lt),j(""),A(!0),setTimeout(()=>{A(!1)},1500);ht([])}},Vo=O=>{let pe=new DataTransfer;return O.forEach(ie=>pe.items.add(ie)),pe.files},Go=O=>{O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),ma())},Wo=O=>{j(O)};return(0,Pa.jsx)(to,{sidebarItems:l||[],title:Y,notifications:r||[],businessUnits:Ae,currentBusinessUnit:zo,onBusinessUnitChange:O=>{O&&(Uo(O),R?.(O))},onSearch:P,showTabs:!1,onActionClick:x,actionIcon:I,actionText:Re,onNotificationRemove:M,onRemoveAll:T,logo:W,appName:oe,tagline:le,sidebarInitiallyClosed:d,children:(0,Pa.jsx)(Bt.AnimatePresence,{mode:"wait",children:(0,Pa.jsx)(Bt.motion.div,{className:"flex-1 Pa-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Pa.jsxs)("div",{className:"Pa-full flex",children:[(0,Pa.jsx)("div",{className:"w-80 flex-shrink-0 Pa-full p-2",children:(0,Pa.jsx)(ao,{sessions:p||[],currentSession:C,teams:Ae,onNewChat:u,onSessionSelect:w,onSessionEdit:v,onSessionDelete:f})}),(0,Pa.jsx)("div",{className:"flex-1 Pa-full p-2",children:(0,Pa.jsx)(Ao,{messages:$||[],input:k,isTyping:we,currentSessionTitle:C?.title,capabilities:i||[],onInputChange:Wo,addToolResult:de,onSendMessage:ma,onKeyPress:Go,fileUploads:lt,isDragOver:Fo,enableFileUpload:Z,onFileUpload:Oo,onRemoveFile:Ho,onDragOver:jo})})]})},"chat-interface")})})}var Lo=[{id:"1",role:"user",parts:[{type:"text",text:"Can you write me a comprehensive analysis of the current state of artificial intelligence and machine learning technologies, including their applications, limitations, and future prospects?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:`Here's a comprehensive analysis of the current state of AI and ML technologies:
12
22
 
13
23
  **Current State of Artificial Intelligence and Machine Learning**
14
24
 
15
- Artificial Intelligence (AI) and Machine Learning (ML) have experienced unprecedented growth and adoption across virtually every industry in recent years. We'pa currently in what many experts consider the "golden age" of AI, characterized by breakthrough achievements in natural language processing, computer vision, and autonomous systems.
25
+ Artificial Intelligence (AI) and Machine Learning (ML) have experienced unprecedented growth and adoption across virtually every industry in recent years. Mo'Pa currently in what many experts consider the "golden age" of AI, characterized by breakthrough achievements in natural language processing, computer vision, and autonomous systems.
16
26
 
17
27
  **Key Applications:**
18
28
 
19
- 1. **Natural Language Processing**: Large Language Models like GPT-4, Claude, and others have revolutionized how pa interact with computers, enabling conversational AI, content generation, code assistance, and translation services that approach human-level quality.
29
+ 1. **Natural Language Processing**: Large Language Models like GPT-4, Claude, and others have revolutionized how we interact with computers, enabling conversational AI, content generation, code assistance, and translation services that approach human-level quality.
20
30
 
21
31
  2. **Computer Vision**: AI systems can now accurately identify objects, faces, and scenes in images and videos, powering applications from medical imaging diagnosis to autonomous vehicle navigation and augmented reality experiences.
22
32
 
@@ -30,9 +40,9 @@ Artificial Intelligence (AI) and Machine Learning (ML) have experienced unpreced
30
40
 
31
41
  Despite remarkable progress, several significant limitations remain:
32
42
 
33
- 1. **Data Quality and Bias**: AI systems are only as good as the data they'pa trained on, and biased or incomplete datasets can lead to unfair or inaccurate outcomes.
43
+ 1. **Data Quality and Bias**: AI systems are only as good as the data they'Pa trained on, and biased or incomplete datasets can lead to unfair or inaccurate outcomes.
34
44
 
35
- 2. **Interpretability**: Many advanced AI models, particularly deep neural networks, operate as "black boxes," making it difficult to understand how they arrive po specific decisions.
45
+ 2. **Interpretability**: Many advanced AI models, particularly deep neural networks, operate as "black boxes," making it difficult to understand how they arrive at specific decisions.
36
46
 
37
47
  3. **Energy Consumption**: Training and running large AI models requires substantial computational resources and energy, raising environmental concerns.
38
48
 
@@ -54,7 +64,7 @@ The future of AI holds immense promise across multiple dimensions:
54
64
 
55
65
  5. **Sustainable AI**: Development of more efficient algorithms and hardware will reduce the environmental impact of AI systems.
56
66
 
57
- The next decade will likely see AI becoming even more integrated into our daily lives, while addressing current limitations through improved techniques, better governance frameworks, and more sustainable practices. The key will pa balancing innovation with responsible development to ensure AI benefits humanity as a whole.`}]},{id:"3",role:"user",parts:[{type:"text",text:"This is an extremely long message to test the width constraints of the chat interface and ensure that even when I write a very long message that goes on and on and on, it still maintains proper formatting and doesn't cause the chat interface to become too wide or break the layout. The message should wrap properly and maintain readability while staying within the maximum width constraints that have been set for the chat bubbles. This is important for user experience and ensuring that the interface remains functional and visually appealing even with extensive text content."}]},{id:"4",role:"assistant",parts:[{type:"text",text:`Perfect! Your long message demonstrates exactly what pa needed to test. As you can see, the chat interface now properly handles long text messages by:
67
+ The next decade will likely see AI becoming even more integrated into our daily lives, while addressing current limitations through improved techniques, better governance frameworks, and more sustainable practices. The key will be balancing innovation with responsible development to ensure AI benefits humanity as a whole.`}]},{id:"3",role:"user",parts:[{type:"text",text:"This is an extremely long message to test the width constraints of the chat interface and ensure that even when I write a very long message that goes on and on and on, it still maintains proper formatting and doesn't cause the chat interface to become too wide or break the layout. The message should wrap properly and maintain readability while staying within the maximum width constraints that have been set for the chat bubbles. This is important for user experience and ensuring that the interface remains functional and visually appealing even with extensive text content."}]},{id:"4",role:"assistant",parts:[{type:"text",text:`Perfect! Your long message demonstrates exactly what we needed to test. As you can see, the chat interface now properly handles long text messages by:
58
68
 
59
69
  \u2022 Constraining the overall chat width with max-w-4xl
60
70
  \u2022 Using break-words to prevent text overflow
@@ -62,4 +72,4 @@ The next decade will likely see AI becoming even more integrated into our daily
62
72
  \u2022 Preserving whitespace and line breaks with whitespace-pre-wrap
63
73
  \u2022 Ensuring proper text wrapping for readability
64
74
 
65
- The interface remains visually appealing and functional regardless of message length, which is crucial for a good user experience.`}]}];function Ri(){let[e,t]=(0,po.useState)(mo);return(0,pa.jsx)("div",{className:"pa-screen w-full",children:(0,pa.jsx)(co,{messages:e,capabilities:$a,enableFileUpload:!0,maxFileSize:10,allowedFileTypes:["*"],businessUnits:[],sessions:[],notifications:[],onNewChat:()=>t(mo),onSessionSelect:()=>{},onSessionDelete:()=>{},showCapabilities:!0})})}0&&(module.exports={ChatDemoLongMessages});
75
+ The interface remains visually appealing and functional regardless of message length, which is crucial for a good user experience.`}]}];function tn(){let[e,t]=(0,Bo.useState)(Lo);return(0,Pa.jsx)("div",{className:"Pa-screen w-full",children:(0,Pa.jsx)(Io,{messages:e,capabilities:io,enableFileUpload:!0,maxFileSize:10,allowedFileTypes:["*"],businessUnits:[],sessions:[],notifications:[],onNewChat:()=>t(Lo),onSessionSelect:()=>{},onSessionDelete:()=>{},showCapabilities:!0})})}0&&(module.exports={ChatDemoLongMessages});