cortex-react-components 2.15.0 → 2.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/{chunk-N3B3XNV3.mjs → chunk-2BRDNDUB.mjs} +1 -1
  2. package/dist/{chunk-M7NV6EFH.mjs → chunk-3HNU2NYP.mjs} +1 -1
  3. package/dist/{chunk-FKU4VQR6.mjs → chunk-3NRXQBBS.mjs} +1 -1
  4. package/dist/{chunk-NWISIJFD.mjs → chunk-3Y7QG6VP.mjs} +1 -1
  5. package/dist/{chunk-A2KX5N75.mjs → chunk-4ZWGVKVT.mjs} +1 -1
  6. package/dist/{chunk-LHO4WFYP.mjs → chunk-5FWH5YVM.mjs} +1 -1
  7. package/dist/{chunk-PK3OBSCB.mjs → chunk-5MWZTJYP.mjs} +1 -1
  8. package/dist/{chunk-DMCFEJ2C.mjs → chunk-6VRPQKAK.mjs} +1 -1
  9. package/dist/{chunk-5SHZBJ5R.mjs → chunk-75F3LJMX.mjs} +1 -1
  10. package/dist/{chunk-MXCW6SOT.mjs → chunk-7R47MHQE.mjs} +1 -1
  11. package/dist/{chunk-LJQPLE4S.mjs → chunk-AJQHGVZ5.mjs} +1 -1
  12. package/dist/{chunk-YKG4FNS4.mjs → chunk-C4RWEPVF.mjs} +1 -1
  13. package/dist/{chunk-7GMAMIHM.mjs → chunk-CXOVEABI.mjs} +1 -1
  14. package/dist/{chunk-JTVWQ42C.mjs → chunk-DDQWJGAN.mjs} +1 -1
  15. package/dist/{chunk-D2H36ZLW.mjs → chunk-DXE6AGJX.mjs} +1 -1
  16. package/dist/{chunk-5WVFEIMC.mjs → chunk-EM3T2XYC.mjs} +1 -1
  17. package/dist/{chunk-IF3425JX.mjs → chunk-FE7ZGUPU.mjs} +1 -1
  18. package/dist/{chunk-H3CJOE6S.mjs → chunk-GHOL5L32.mjs} +1 -1
  19. package/dist/{chunk-2RQDJ5XT.mjs → chunk-GTZJWMZR.mjs} +1 -1
  20. package/dist/{chunk-AQQCH7Z2.mjs → chunk-KBEXWUKI.mjs} +1 -1
  21. package/dist/{chunk-I2GNNRFH.mjs → chunk-LJXTXROJ.mjs} +1 -1
  22. package/dist/{chunk-PO3XUUWY.mjs → chunk-LLP4EFT4.mjs} +1 -1
  23. package/dist/{chunk-OLIYPWO3.mjs → chunk-LQX37M4T.mjs} +1 -1
  24. package/dist/{chunk-P7S6XFU4.mjs → chunk-MX3JKY3V.mjs} +1 -1
  25. package/dist/{chunk-HKGW6JI2.mjs → chunk-NINFDOV5.mjs} +1 -1
  26. package/dist/{chunk-RX63ABAF.mjs → chunk-O54IXEY5.mjs} +1 -1
  27. package/dist/{chunk-ZFUP5NVF.mjs → chunk-O5P35LEY.mjs} +1 -1
  28. package/dist/chunk-OGAY4DL2.mjs +1 -0
  29. package/dist/{chunk-TILPSVAP.mjs → chunk-PHQMSVOB.mjs} +1 -1
  30. package/dist/{chunk-255P6K5W.mjs → chunk-RGOKBIQ5.mjs} +1 -1
  31. package/dist/{chunk-67QPOSVV.mjs → chunk-RJGYVDOU.mjs} +1 -1
  32. package/dist/{chunk-XKGBG5FX.mjs → chunk-TVTTUSWM.mjs} +1 -1
  33. package/dist/{chunk-SRUG246N.mjs → chunk-TXVA6XJT.mjs} +1 -1
  34. package/dist/chunk-UGBDJDPW.mjs +4 -0
  35. package/dist/{chunk-6PS55VJZ.mjs → chunk-VDFRWGXR.mjs} +1 -1
  36. package/dist/{chunk-ERJXTG6X.mjs → chunk-WIRQ5IRT.mjs} +1 -1
  37. package/dist/{chunk-2HWSTGAP.mjs → chunk-XQ3XV5DH.mjs} +1 -1
  38. package/dist/{chunk-5NIEZE7A.mjs → chunk-XX4GSGRP.mjs} +1 -1
  39. package/dist/{chunk-62A35O55.mjs → chunk-ZEALRBXW.mjs} +1 -1
  40. package/dist/chunk-ZN7NNMB7.mjs +4 -0
  41. package/dist/components/Blocks/Banner.mjs +1 -1
  42. package/dist/components/Blocks/CallToAction.mjs +1 -1
  43. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  44. package/dist/components/Blocks/Content.mjs +1 -1
  45. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  46. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  47. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  48. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  49. package/dist/components/Blocks/index.mjs +1 -1
  50. package/dist/components/Cards/ContentCard.mjs +1 -1
  51. package/dist/components/Cards/FeatureCard.mjs +1 -1
  52. package/dist/components/Cards/index.mjs +1 -1
  53. package/dist/components/Chat/ChatInterface.js +6 -6
  54. package/dist/components/Chat/ChatInterface.mjs +1 -1
  55. package/dist/components/Chat/CopilotInterface.js +7 -7
  56. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  57. package/dist/components/Chat/PartTypes/CodeBlock.css +1 -0
  58. package/dist/components/Chat/PartTypes/CodeBlock.d.ts +15 -0
  59. package/dist/components/Chat/PartTypes/CodeBlock.js +4 -0
  60. package/dist/components/Chat/PartTypes/CodeBlock.mjs +2 -0
  61. package/dist/components/Chat/PartTypes/Tool.css +1 -0
  62. package/dist/components/Chat/PartTypes/Tool.d.ts +22 -0
  63. package/dist/components/Chat/PartTypes/Tool.js +5 -0
  64. package/dist/components/Chat/PartTypes/Tool.mjs +2 -0
  65. package/dist/components/Chat/PartTypes/index.d.ts +2 -0
  66. package/dist/components/Chat/PartTypes/index.js +6 -6
  67. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  68. package/dist/components/Chat/demo-long-messages.js +12 -12
  69. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  70. package/dist/components/Chat/demo-tests.js +27 -27
  71. package/dist/components/Chat/demo-tests.mjs +1 -1
  72. package/dist/components/Chat/demo.js +7 -7
  73. package/dist/components/Chat/demo.mjs +1 -1
  74. package/dist/components/Chat/example-usage.js +7 -7
  75. package/dist/components/Chat/example-usage.mjs +1 -1
  76. package/dist/components/Chat/example-with-vercel-ai.js +7 -7
  77. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  78. package/dist/components/Chat/index.js +11 -11
  79. package/dist/components/Chat/index.mjs +1 -1
  80. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  81. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  82. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  83. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  84. package/dist/components/DigitalColleagues/index.mjs +1 -1
  85. package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
  86. package/dist/components/Foundary/MainPage.mjs +1 -1
  87. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  88. package/dist/components/Foundary/Views/index.mjs +1 -1
  89. package/dist/components/Foundary/index.mjs +1 -1
  90. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  91. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  92. package/dist/components/HeaderFooter/index.mjs +1 -1
  93. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  94. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  95. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  96. package/dist/components/Heros/PostHero/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/Menus/SidebarLeft.mjs +1 -1
  105. package/dist/components/Menus/SidebarRight.mjs +1 -1
  106. package/dist/components/Menus/index.mjs +1 -1
  107. package/dist/components/Other/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/Projects/EpicsView.mjs +1 -1
  112. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  113. package/dist/components/Projects/ProjectPage.mjs +1 -1
  114. package/dist/components/Projects/ProjectView.mjs +1 -1
  115. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  116. package/dist/components/Projects/index.mjs +1 -1
  117. package/dist/components/dc-temp/index.mjs +1 -1
  118. package/dist/components/index.js +14 -14
  119. package/dist/components/index.mjs +1 -1
  120. package/dist/components/ui/index.mjs +1 -1
  121. package/dist/components/ui/sidebar.mjs +1 -1
  122. package/dist/globals.css +1 -1
  123. package/dist/index.js +25 -25
  124. package/dist/index.mjs +1 -1
  125. package/dist/metafile-cjs.json +1 -1
  126. package/dist/metafile-esm.json +1 -1
  127. package/dist/pages/Blog.mjs +1 -1
  128. package/dist/pages/Documentation.mjs +1 -1
  129. package/dist/pages/IndexPage.mjs +1 -1
  130. package/dist/pages/Intranet.mjs +1 -1
  131. package/dist/pages/LandingPage.mjs +1 -1
  132. package/dist/pages/Page.mjs +1 -1
  133. package/dist/pages/Publish.mjs +1 -1
  134. package/dist/pages/Website.mjs +1 -1
  135. package/dist/sections/AboutSection.mjs +1 -1
  136. package/dist/sections/BlogDetail.mjs +1 -1
  137. package/dist/sections/BlogList.mjs +1 -1
  138. package/dist/sections/BlogListSection.mjs +1 -1
  139. package/dist/sections/ContactSection.mjs +1 -1
  140. package/dist/sections/PageSections.mjs +1 -1
  141. package/dist/sections/PricingSection.mjs +1 -1
  142. package/dist/sections/ServiceDetail.mjs +1 -1
  143. package/dist/sections/ServiceDetailSection.mjs +1 -1
  144. package/dist/sections/ServiceSection.mjs +1 -1
  145. package/dist/sections/form/index.mjs +1 -1
  146. package/dist/sections/index.mjs +1 -1
  147. package/package.json +5 -2
  148. package/dist/chunk-UTHKFW4R.mjs +0 -1
@@ -3,19 +3,19 @@
3
3
  'use client'
4
4
  'use client';
5
5
 
6
- "use strict";var qa=Object.create;var yt=Object.defineProperty;var Ka=Object.getOwnPropertyDescriptor;var _a=Object.getOwnPropertyNames;var Ja=Object.getPrototypeOf,Xa=Object.prototype.hasOwnProperty;var Qa=(e,t)=>{for(var o in t)yt(e,o,{get:t[o],enumerable:!0})},fo=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of _a(t))!Xa.call(e,s)&&s!==o&&yt(e,s,{get:()=>t[s],enumerable:!(a=Ka(t,s))||a.enumerable});return e};var G=(e,t,o)=>(o=e!=null?qa(Ja(e)):{},fo(t||!e||!e.__esModule?yt(o,"default",{value:e,enumerable:!0}):o,e)),Ya=e=>fo(yt({},"__esModule",{value:!0}),e);var or={};Qa(or,{ChatDemo:()=>tr});module.exports=Ya(or);var Ba=require("react");var Aa=require("@ai-sdk/react"),Lt=require("motion/react"),Ma=require("lucide-react");var ko=require("clsx");var Ft="-",Za=e=>{let t=ti(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{let n=l.split(Ft);return n[0]===""&&n.length!==1&&n.shift(),ho(n,t)||ei(l)},getConflictingClassGroupIds:(l,n)=>{let p=o[l]||[];return n&&a[l]?[...p,...a[l]]:p}}},ho=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),s=a?ho(e.slice(1),a):void 0;if(s)return s;if(t.validators.length===0)return;let i=e.join(Ft);return t.validators.find(({validator:l})=>l(i))?.classGroupId},bo=/^\[(.+)\]$/,ei=e=>{if(bo.test(e)){let t=bo.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},ti=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return ai(Object.entries(e.classGroups),o).forEach(([i,l])=>{Ut(l,a,i,t)}),a},Ut=(e,t,o,a)=>{e.forEach(s=>{if(typeof s=="string"){let i=s===""?t:vo(t,s);i.classGroupId=o;return}if(typeof s=="function"){if(oi(s)){Ut(s(a),t,o,a);return}t.validators.push({validator:s,classGroupId:o});return}Object.entries(s).forEach(([i,l])=>{Ut(l,vo(t,i),o,a)})})},vo=(e,t)=>{let o=e;return t.split(Ft).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},oi=e=>e.isThemeGetter,ai=(e,t)=>t?e.map(([o,a])=>{let s=a.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,n])=>[t+l,n])):i);return[o,s]}):e,ii=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,s=(i,l)=>{o.set(i,l),t++,t>e&&(t=0,a=o,o=new Map)};return{get(i){let l=o.get(i);if(l!==void 0)return l;if((l=a.get(i))!==void 0)return s(i,l),l},set(i,l){o.has(i)?o.set(i,l):s(i,l)}}},yo="!",ri=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,s=t[0],i=t.length,l=n=>{let p=[],u=0,w=0,f;for(let x=0;x<n.length;x++){let P=n[x];if(u===0){if(P===s&&(a||n.slice(x,x+i)===t)){p.push(n.slice(w,x)),w=x+i;continue}if(P==="/"){f=x;continue}}P==="["?u++:P==="]"&&u--}let h=p.length===0?n:n.substring(w),R=h.startsWith(yo),M=R?h.substring(1):h,T=f&&f>w?f-w:void 0;return{modifiers:p,hasImportantModifier:R,baseClassName:M,maybePostfixModifierPosition:T}};return o?n=>o({className:n,parseClassName:l}):l},ni=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},si=e=>({cache:ii(e.cacheSize),parseClassName:ri(e),...Za(e)}),li=/\s+/,ci=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:s}=t,i=[],l=e.trim().split(li),n="";for(let p=l.length-1;p>=0;p-=1){let u=l[p],{modifiers:w,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:R}=o(u),M=!!R,T=a(M?h.substring(0,R):h);if(!T){if(!M){n=u+(n.length>0?" "+n:n);continue}if(T=a(h),!T){n=u+(n.length>0?" "+n:n);continue}M=!1}let x=ni(w).join(":"),P=f?x+yo: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)}n=u+(n.length>0?" "+n:n)}return n};function di(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=xo(t))&&(a&&(a+=" "),a+=o);return a}var xo=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=xo(e[a]))&&(o&&(o+=" "),o+=t);return o};function pi(e,...t){let o,a,s,i=l;function l(p){let u=t.reduce((w,f)=>f(w),e());return o=si(u),a=o.cache.get,s=o.cache.set,i=n,n(p)}function n(p){let u=a(p);if(u)return u;let w=ci(p,o);return s(p,w),w}return function(){return i(di.apply(null,arguments))}}var H=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},wo=/^\[(?:([a-z-]+):)?(.+)\]$/i,mi=/^\d+\/\d+$/,ui=new Set(["px","full","screen"]),gi=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fi=/\d+(%|px|Do?em|[sdl]?Do([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|Do?lh|cq(w|h|i|Do|min|max))|\Do(calc|min|max|clamp)\(.+\)|^0$/,bi=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,vi=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hi=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ae=e=>Ze(e)||ui.has(e)||mi.test(e),Fe=e=>et(e,"length",Di),Ze=e=>!!e&&!Number.isNaN(Number(e)),zt=e=>et(e,"number",Ze),ct=e=>!!e&&Number.isInteger(Number(e)),yi=e=>e.endsWith("%")&&Ze(e.slice(0,-1)),y=e=>wo.test(e),je=e=>gi.test(e),xi=new Set(["length","size","percentage"]),wi=e=>et(e,xi,Co),Ci=e=>et(e,"position",Co),Ni=new Set(["image","url"]),ki=e=>et(e,Ni,Ri),Pi=e=>et(e,"",Ti),dt=()=>!0,et=(e,t,o)=>{let a=wo.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Di=e=>fi.test(e)&&!bi.test(e),Co=()=>!1,Ti=e=>vi.test(e),Ri=e=>hi.test(e);var Si=()=>{let e=H("colors"),t=H("spacing"),o=H("blur"),a=H("brightness"),s=H("borderColor"),i=H("borderRadius"),l=H("borderSpacing"),n=H("borderWidth"),p=H("contrast"),u=H("grayscale"),w=H("hueRotate"),f=H("invert"),h=H("gap"),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"),Q=H("translate"),W=()=>["auto","contain","none"],ae=()=>["auto","hidden","clip","visible","scroll"],le=()=>["auto",y,t],I=()=>[y,t],Re=()=>["",Ae,Fe],d=()=>["auto",Ze,y],E=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],m=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",y],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>[Ze,y];return{cacheSize:500,separator:":",theme:{colors:[dt],spacing:[Ae,Fe],blur:["none","",je,y],brightness:S(),borderColor:[e],borderRadius:["none","","full",je,y],borderSpacing:I(),borderWidth:Re(),contrast:S(),grayscale:j(),hueRotate:S(),invert:j(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[yi,Fe],inset:le(),margin:le(),opacity:S(),padding:I(),saturate:S(),scale:S(),sepia:j(),skew:S(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",y]}],container:["container"],columns:[{columns:[je]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...E(),y]}],overflow:[{overflow:ae()}],"overflow-x":[{"overflow-x":ae()}],"overflow-y":[{"overflow-y":ae()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[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:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...m()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...m(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...m(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[F]}],px:[{px:[F]}],py:[{py:[F]}],ps:[{ps:[F]}],pe:[{pe:[F]}],pt:[{pt:[F]}],pr:[{pr:[F]}],pb:[{pb:[F]}],pl:[{pl:[F]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[ee]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ee]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",y,t]}],"min-w":[{"min-w":[y,t,"min","max","fit"]}],"max-w":[{"max-w":[y,t,"none","full","min","max","fit","prose",{screen:[je]},je]}],h:[{h:[y,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[y,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[y,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[y,t,"auto","min","max","fit"]}],"font-size":[{text:["base",je,Fe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",zt]}],"font-family":[{font:[dt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",y]}],"line-clamp":[{"line-clamp":["none",Ze,zt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ae,y]}],"list-image":[{"list-image":["none",y]}],"list-style-type":[{list:["none","disc","decimal",y]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[P]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ae,Fe]}],"underline-offset":[{"underline-offset":["auto",Ae,y]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",y]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[P]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...E(),Ci]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",wi]}],"bg-image":[{bg:["none",{"gradient-Ba":["t","tr","Do","br","Do","bl","l","tl"]},ki]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[M]}],"gradient-via-pos":[{via:[M]}],"gradient-Ba-pos":[{Ba:[M]}],"gradient-from":[{from:[R]}],"gradient-via":[{via:[R]}],"gradient-Ba":[{Ba:[R]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-Do":[{"rounded-Do":[i]}],"rounded-Do":[{"rounded-Do":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-Do":[{"rounded-Do":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[n]}],"border-w-x":[{"border-x":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-Do":[{"border-Do":[n]}],"border-w-Do":[{"border-Do":[n]}],"border-w-l":[{"border-l":[n]}],"border-opacity":[{"border-opacity":[P]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[P]}],"divide-style":[{divide:B()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-Do":[{"border-Do":[s]}],"border-color-Do":[{"border-Do":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[Ae,y]}],"outline-w":[{outline:[Ae,Fe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[P]}],"ring-offset-w":[{"ring-offset":[Ae,Fe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",je,Pi]}],"shadow-color":[{shadow:[dt]}],opacity:[{opacity:[P]}],"mix-blend":[{"mix-blend":[...q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",je,y]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[w]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[Y]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[w]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[P]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[Y]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",y]}],duration:[{duration:S()}],ease:[{ease:["linear","in","out","in-out",y]}],delay:[{delay:S()}],animate:[{animate:["none","spin","ping","pulse","bounce",y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-y":[{"scale-y":[z]}],rotate:[{rotate:[ct,y]}],"translate-x":[{"translate-x":[Q]}],"translate-y":[{"translate-y":[Q]}],"skew-x":[{"skew-x":[Z]}],"skew-y":[{"skew-y":[Z]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",y]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","Do-resize","nw-resize","Do-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",y]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",y]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ae,Fe,zt]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-Do","rounded-Do","rounded-l","rounded-ss","rounded-Do","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Do","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-Do":["rounded-tr","rounded-br"],"rounded-Do":["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-Do","border-w-Do","border-w-l"],"border-w-x":["border-w-Do","border-w-l"],"border-w-y":["border-w-t","border-w-Do"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-Do","border-color-Do","border-color-l"],"border-color-x":["border-color-Do","border-color-l"],"border-color-y":["border-color-t","border-color-Do"],"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 No=pi(Si);function c(...e){return No((0,ko.clsx)(e))}var Tt=G(require("react")),$t=G(require("next/link"));var Po=require("class-variance-authority");var Do=require("react/jsx-runtime"),Ai=(0,Po.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function me({className:e,variant:t,...o}){return(0,Do.jsx)("div",{className:c(Ai({variant:t}),e),...o})}var To=require("@radix-ui/react-slot"),So=G(require("react")),Mi=(0,Po.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),A=So.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...s},i)=>(0,Do.jsx)(e?To.Slot:"button",{className:c(Mi({className:t,size:o,variant:a})),ref:i,...s}));A.displayName="Button";var Mo=G(require("react"));var pt=Mo.forwardRef(({className:e,type:t,...o},a)=>(0,Do.jsx)("input",{type:t,className:c("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...o}));pt.displayName="Input";var jt=G(require("react")),ge=G(require("@radix-ui/react-scroll-area"));var Ce=jt.forwardRef(({className:e,children:t,...o},a)=>(0,Do.jsxs)(ge.Root,{ref:a,className:c("relative overflow-hidden",e),...o,children:[(0,Do.jsx)(ge.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Do.jsx)(Bo,{}),(0,Do.jsx)(ge.Corner,{})]}));Ce.displayName=ge.Root.displayName;var Bo=jt.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,Do.jsx)(ge.ScrollAreaScrollbar,{ref:a,orientation:t,className:c("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,Do.jsx)(ge.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Bo.displayName=ge.ScrollAreaScrollbar.displayName;var mt=G(require("react")),_=G(require("@radix-ui/react-dialog"));var Eo=_.Root;var Ii=_.Portal;var zo=mt.forwardRef(({className:e,...t},o)=>(0,Do.jsx)(_.Overlay,{ref:o,className:c("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));zo.displayName=_.Overlay.displayName;var Ot=mt.forwardRef(({className:e,children:t,...o},a)=>(0,Do.jsxs)(Ii,{children:[(0,Do.jsx)(zo,{}),(0,Do.jsxs)(_.Content,{ref:a,className:c("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-Ba-left-1/2 data-[state=closed]:slide-out-Ba-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,Do.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,Do.jsx)(Ma.Do,{className:"h-4 w-4"}),(0,Do.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Ot.displayName=_.Content.displayName;var Ht=({className:e,...t})=>(0,Do.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,Do.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},o)=>(0,Do.jsx)(_.Title,{ref:o,className:c("text-lg font-semibold leading-none tracking-tight",e),...t}));Vt.displayName=_.Title.displayName;var Li=mt.forwardRef(({className:e,...t},o)=>(0,Do.jsx)(_.Description,{ref:o,className:c("text-sm text-muted-foreground",e),...t}));Li.displayName=_.Description.displayName;var ut=G(require("@radix-ui/react-checkbox")),Fo=G(require("react")),Gt=Fo.forwardRef(({className:e,...t},o)=>(0,Do.jsx)(ut.Root,{className:c("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,Do.jsx)(ut.Indicator,{className:c("flex items-center justify-center text-current"),children:(0,Do.jsx)(Ma.Check,{className:"h-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 Oo=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Do.jsx)(Ma.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Do.jsx)(Ma.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Do.jsx)(Ma.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Do.jsx)(Ma.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,Do.jsx)(Ma.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Do.jsx)(Ma.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Do.jsx)(Ma.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Do.jsx)(Ma.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Do.jsx)(Ma.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Do.jsx)(Ma.Building2,{className:"h-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 Ba 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")}],Ei=[...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")}],zi=[...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:[]},jo={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 kr={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:Ei},singleEpic:{initialProjects:Nt,initialEpics:jo.epics,initialSprints:wt,initialTasks:jo.tasks},multipleProjects:{initialProjects:zi,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 Ba 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 Ba customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases Ba 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}],Pr=[{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 Ba production",description:"Deploy the latest version Ba 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 Dr=kt.filter(e=>e.type==="digital");function Ho(e,t){let[o,a]=(0,Ba.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch{return t}}),s=i=>{try{a(i),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(i))}catch{}};return(0,Ba.useEffect)(()=>{s(o)},[]),[o,s]}function qt({items:e,isOpen:t,isMobile:o=!1,onClose:a,currentBusinessUnit:s=Oo[0],onBusinessUnitChange:i,onSearch:l,className:n,logo:p="/headerlogo.png",appName:u="Nuvia",tagline:w="Collaboration Platform"}){let[f,h]=Tt.useState({}),[R,M]=Ho("sidebar-favorites",{}),[T,x]=Tt.useState(null),[P,F]=Tt.useState(""),C=d=>{h(E=>({...E,[d]:!E[d]}))},z=d=>{i?.(d)},Y=()=>{P.trim()&&l?.(P.trim())},Z=d=>{d.key==="Enter"&&(d.preventDefault(),Y())},ee=(d,E)=>{let B=R[d]||[],q=B.includes(E)?B.filter(m=>m!==E):B.concat(E);M({...R,[d]:q})},Q=d=>{if(!d.items||!d.maxItems||d.items.length<=d.maxItems)return d.items||[];let E=R[d.id]||[],B=d.items.filter(m=>E.includes(m.id)),q=d.items.filter(m=>!E.includes(m.id));return[...B,...q].slice(0,d.maxItems)},W=d=>d.maxItems&&d.items&&d.items.length>d.maxItems,ae=e,le=d=>{let E=W(d),B=Q(d),q=(0,Do.jsxs)(Do.Fragment,{children:[(0,Do.jsxs)("div",{className:"flex items-center gap-3",children:[d.icon,(0,Do.jsx)("span",{children:d.title})]}),d.badge&&(0,Do.jsx)(me,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:d.badge}),d.items&&(0,Do.jsx)(Ma.ChevronDown,{className:c("ml-2 h-4 w-4 transition-transform",f[d.title]?"rotate-180":"")})]}),m=c("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",d.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return d.url?(0,Do.jsx)($t.default,{href:d.url,className:m,onClick:o?a:void 0,children:q}):(0,Do.jsx)("button",{className:m,onClick:()=>d.items&&C(d.title),children:q})},I=()=>{let d=e.find(B=>B.id===T);if(!d||!d.items||!d.maxItems)return null;let E=R[d.id]||[];return(0,Do.jsx)(Eo,{open:!!T,onOpenChange:B=>!B&&x(null),children:(0,Do.jsxs)(Ot,{className:"sm:max-w-md",children:[(0,Do.jsxs)(Ht,{children:[(0,Do.jsxs)(Vt,{children:["Manage ",d.title," Favorites"]}),(0,Do.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up Ba ",d.maxItems," items Ba show in ",d.title.toLowerCase(),"."]})]}),(0,Do.jsx)(Ce,{className:"max-h-96 pr-4",children:(0,Do.jsx)("div",{className:"space-y-4",children:d.items.map(B=>(0,Do.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Do.jsx)(Gt,{id:B.id,checked:E.includes(B.id),onCheckedChange:()=>ee(d.id,B.id),disabled:!E.includes(B.id)&&E.length>=(d.maxItems||0)}),(0,Do.jsxs)("label",{htmlFor:B.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[B.title,B.badge&&(0,Do.jsx)(me,{variant:"outline",className:"text-xs",children:B.badge})]})]},B.id))})})]})})},Re=(0,Do.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,Do.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Do.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Do.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,Do.jsx)("img",{src:p,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,Do.jsxs)("div",{children:[(0,Do.jsx)("h2",{className:"font-semibold",children:u}),(0,Do.jsx)("p",{className:"text-xs text-muted-foreground",children:w})]})]}),o&&(0,Do.jsx)(A,{variant:"ghost",size:"icon",onClick:a,children:(0,Do.jsx)(Ma.Do,{className:"h-5 w-5"})})]}),(0,Do.jsx)("div",{className:"px-3 py-2",children:(0,Do.jsxs)("div",{className:"relative",children:[(0,Do.jsx)(Ma.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Do.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,Do.jsx)(Ce,{className:"flex-1 px-3 py-2",children:(0,Do.jsx)("div",{className:"space-y-1",children:ae.map(d=>(0,Do.jsxs)("div",{className:"mb-1",children:[le(d),d.items&&f[d.title]&&(0,Do.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[Q(d).map(E=>(0,Do.jsxs)($t.default,{href:E.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:o?a:void 0,children:[E.title,E.badge&&(0,Do.jsx)(me,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:E.badge})]},E.id)),W(d)&&d.items&&d.items.length>Q(d).length&&(0,Do.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,Do.jsx)("div",{className:"p-3",children:(0,Do.jsx)("div",{className:"space-y-1",children:(0,Do.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,Do.jsx)(Ma.Settings,{className:"h-5 w-5"}),(0,Do.jsx)("span",{children:"Settings"})]})})}),(0,Do.jsx)(I,{})]});return o?(0,Do.jsx)("div",{className:c("fixed inset-y-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",n),children:Re}):(0,Do.jsx)("div",{className:c("fixed inset-y-0 left-0 z-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",n),children:Re})}var Rt=G(require("react")),Me=G(require("@radix-ui/react-avatar"));var $e=Rt.forwardRef(({className:e,...t},o)=>(0,Do.jsx)(Me.Root,{ref:o,className:c("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));$e.displayName=Me.Root.displayName;var Kt=Rt.forwardRef(({className:e,...t},o)=>(0,Do.jsx)(Me.Image,{ref:o,className:c("aspect-square h-full w-full",e),...t}));Kt.displayName=Me.Image.displayName;var qe=Rt.forwardRef(({className:e,...t},o)=>(0,Do.jsx)(Me.Fallback,{ref:o,className:c("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));qe.displayName=Me.Fallback.displayName;var Vo=G(require("react")),he=G(require("@radix-ui/react-tooltip"));var tt=he.Provider,ot=he.Root,at=he.Trigger,Ke=Vo.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Do.jsx)(he.Portal,{children:(0,Do.jsx)(he.Content,{ref:a,sideOffset:t,className:c("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Ke.displayName=he.Content.displayName;var Go=require("next-themes");function Wo(){let{setTheme:e,theme:t}=(0,Go.useTheme)();return(0,Do.jsx)(tt,{children:(0,Do.jsxs)(ot,{children:[(0,Do.jsx)(at,{asChild:!0,children:(0,Do.jsxs)(A,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Do.jsx)(Ma.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Do.jsx)(Ma.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Do.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,Do.jsx)(Ke,{children:"Toggle theme"})]})})}function $o({notifications:e,open:t,onClose:o,onNotificationRemove:a,onRemoveAll:s,className:i}){let l=e.filter(u=>!u.read),n=l.length,p=u=>{switch(u){case"info":return(0,Do.jsx)(Ma.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,Do.jsx)(Ma.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,Do.jsx)(Ma.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,Do.jsx)(Ma.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,Do.jsx)(Lt.AnimatePresence,{children:t&&(0,Do.jsxs)(Do.Fragment,{children:[(0,Do.jsx)(Lt.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:o}),(0,Do.jsx)(Lt.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:c("fixed inset-y-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",i),children:(0,Do.jsxs)("div",{className:"flex h-full flex-col",children:[(0,Do.jsxs)("div",{className:"flex items-center justify-between border-Do p-4",children:[(0,Do.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Do.jsx)(Ma.Bell,{className:"h-5 w-5"}),(0,Do.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),n>0&&(0,Do.jsxs)(me,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[n," new"]})]}),(0,Do.jsxs)(A,{variant:"ghost",size:"icon",onClick:o,className:"rounded-full",children:[(0,Do.jsx)(Ma.Do,{className:"h-5 w-5"}),(0,Do.jsx)("span",{className:"sr-only",children:"Close"})]})]}),n>0&&(0,Do.jsxs)("div",{className:"flex items-center justify-between border-Do p-2",children:[(0,Do.jsxs)("span",{className:"text-sm text-muted-foreground",children:[n," unread notification",n!==1?"s":""]}),(0,Do.jsx)(A,{variant:"ghost",size:"sm",onClick:s,className:"text-sm",children:"Dismiss all"})]}),l.length>0?(0,Do.jsx)(Ce,{className:"flex-1",children:(0,Do.jsx)("div",{className:"divide-y",children:l.map(u=>(0,Do.jsxs)("div",{className:c("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Do.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:p(u.type)}),(0,Do.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Do.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Do.jsx)("p",{className:"font-medium",children:u.title}),(0,Do.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Do.jsx)("p",{className:"text-xs text-muted-foreground",children:u.time}),(0,Do.jsx)(A,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>a?.(u.id),title:"Dismiss",children:(0,Do.jsx)(Ma.Check,{className:"h-3 w-3"})})]})]}),(0,Do.jsx)("p",{className:"text-sm text-muted-foreground",children:u.description}),u.actionLabel&&(0,Do.jsxs)(A,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:u.onAction,children:[u.actionLabel,(0,Do.jsx)(Ma.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},u.id))})}):(0,Do.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Do.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Do.jsx)(Ma.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,Do.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,Do.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 qo({className:e,...t}){return(0,Do.jsx)(_e.Root,{"data-slot":"tabs",className:c("flex flex-col gap-2",e),...t})}function Ko({className:e,...t}){return(0,Do.jsx)(_e.List,{"data-slot":"tabs-list",className:c("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function _o({className:e,...t}){return(0,Do.jsx)(_e.Trigger,{"data-slot":"tabs-trigger",className:c("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var Ie=G(require("react")),D=G(require("@radix-ui/react-dropdown-menu")),it=require("@radix-ui/react-icons");var Jo=D.Root,Xo=D.Trigger;var Ui=Ie.forwardRef(({className:e,inset:t,children:o,...a},s)=>(0,Do.jsxs)(D.SubTrigger,{ref:s,className:c("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...a,children:[o,(0,Do.jsx)(it.ChevronRightIcon,{className:"ml-auto"})]}));Ui.displayName=D.SubTrigger.displayName;var Fi=Ie.forwardRef(({className:e,...t},o)=>(0,Do.jsx)(D.SubContent,{ref:o,className:c("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Fi.displayName=D.SubContent.displayName;var Jt=Ie.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Do.jsx)(D.Portal,{children:(0,Do.jsx)(D.Content,{ref:a,sideOffset:t,className:c("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Jt.displayName=D.Content.displayName;var Xt=Ie.forwardRef(({className:e,inset:t,...o},a)=>(0,Do.jsx)(D.Item,{ref:a,className:c("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...o}));Xt.displayName=D.Item.displayName;var ji=Ie.forwardRef(({className:e,children:t,checked:o,...a},s)=>(0,Do.jsxs)(D.CheckboxItem,{ref:s,className:c("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...a,children:[(0,Do.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Do.jsx)(D.ItemIndicator,{children:(0,Do.jsx)(it.CheckIcon,{className:"h-4 w-4"})})}),t]}));ji.displayName=D.CheckboxItem.displayName;var Oi=Ie.forwardRef(({className:e,children:t,...o},a)=>(0,Do.jsxs)(D.RadioItem,{ref:a,className:c("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[(0,Do.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Do.jsx)(D.ItemIndicator,{children:(0,Do.jsx)(it.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Oi.displayName=D.RadioItem.displayName;var Hi=Ie.forwardRef(({className:e,inset:t,...o},a)=>(0,Do.jsx)(D.Label,{ref:a,className:c("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));Hi.displayName=D.Label.displayName;var Vi=Ie.forwardRef(({className:e,...t},o)=>(0,Do.jsx)(D.Separator,{ref:o,className:c("-mx-1 my-1 h-px bg-muted",e),...t}));Vi.displayName=D.Separator.displayName;var Gi=({className:e,...t})=>(0,Do.jsx)("span",{className:c("ml-auto text-xs tracking-widest opacity-60",e),...t});Gi.displayName="DropdownMenuShortcut";function Yo({activeTab:e,onTabChange:t,tabOptions:o,className:a="",maxWidth:s="700px",gridCols:i=6}){let l=o.find(n=>n.value===e);return(0,Do.jsxs)(Lt.motion.div,{className:`flex-1 flex justify-center ${a}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,Do.jsx)("div",{className:"hidden lg:block",children:(0,Do.jsx)(qo,{value:e,onValueChange:t,children:(0,Do.jsx)(Ko,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:s,gridTemplateColumns:`repeat(${Math.min(i,o.length)}, minmax(0, 1fr))`},children:o.map(n=>(0,Do.jsx)(Lt.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Do.jsx)(_o,{value:n.value,className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:n.label})},n.value))})})}),(0,Do.jsx)("div",{className:"lg:hidden",children:(0,Do.jsxs)(Jo,{children:[(0,Do.jsx)(Xo,{asChild:!0,children:(0,Do.jsxs)(A,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[l?.label||"Select",(0,Do.jsx)(Ma.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Do.jsx)(Jt,{align:"center",className:"w-[180px]",children:o.map(n=>(0,Do.jsx)(Xt,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function Zo({title:e,notifications:t=[],onToggleSidebar:o,onToggleMobileMenu:a,sidebarOpen:s=!0,className:i,activeTab:l="assistant",onTabChange:n,showTabs:p=!0,tabOptions:u=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:w,actionIcon:f=(0,Do.jsx)(Ma.Bot,{className:"mr-2 h-4 w-4"}),actionText:h="Action",onNotificationRemove:R,onRemoveAll:M,logo:T="/headerlogo.png",appName:x="Nuvia",tagline:P="Collaboration Platform"}){let[F,C]=(0,Ba.useState)(!1),[z,Y]=(0,Ba.useState)(t),Z=z.filter(W=>!W.read).length,ee=W=>{Y(ae=>ae.filter(le=>le.id!==W)),R?.(W)},Q=()=>{Y(W=>W.filter(ae=>ae.read)),M?.()};return(0,Do.jsxs)(Do.Fragment,{children:[(0,Do.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${i||""}`,children:[(0,Do.jsx)(A,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,Do.jsx)(Ma.Menu,{className:"h-5 w-5"})}),(0,Do.jsx)(A,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:o,children:(0,Do.jsx)(Ma.PanelLeft,{className:"h-5 w-5"})}),!s&&(0,Do.jsxs)(Lt.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Do.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,Do.jsx)("img",{src:T,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,Do.jsxs)("div",{children:[(0,Do.jsx)("h2",{className:"font-semibold text-sm",children:x}),(0,Do.jsx)("p",{className:"text-xs text-muted-foreground",children:P})]})]}),(0,Do.jsxs)("div",{className:"flex flex-1 items-center",children:[p&&(0,Do.jsx)(Yo,{activeTab:l,onTabChange:n,tabOptions:u}),(0,Do.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Do.jsx)(Lt.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,Do.jsx)(Lt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Do.jsxs)(A,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:w,children:[f,h]})})}),(0,Do.jsx)(Wo,{}),(0,Do.jsx)(tt,{children:(0,Do.jsxs)(ot,{children:[(0,Do.jsx)(at,{asChild:!0,children:(0,Do.jsx)(Lt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Do.jsxs)(A,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>C(!0),children:[(0,Do.jsx)(Lt.motion.div,{animate:Z>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:Z>0?1/0:0,repeatDelay:3},children:(0,Do.jsx)(Ma.Bell,{className:"h-5 w-5"})}),Z>0&&(0,Do.jsx)(Lt.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:Z})]})})}),(0,Do.jsx)(Ke,{children:"Notifications"})]})}),(0,Do.jsx)(Lt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Do.jsxs)($e,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Do.jsx)(Kt,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Do.jsx)(qe,{})]})})]})]})]}),(0,Do.jsx)($o,{notifications:z,open:F,onClose:()=>C(!1),onNotificationRemove:ee,onRemoveAll:Q})]})}var ea=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Do.jsx)(Ma.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function oa({sidebarItems:e,children:t,title:o="Digital Colleagues",notifications:a=[],currentBusinessUnit:s=ea[0],onBusinessUnitChange:i,onSearch:l,businessUnits:n=ea,activeTab:p,onTabChange:u,showTabs:w=!1,onActionClick:f,actionIcon:h,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,Ba.useState)(!C),[Z,ee]=(0,Ba.useState)(!1),[Q,W]=(0,Ba.useState)(s),ae=le=>{W(le),i?.(le)};return(0,Do.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[Z&&(0,Do.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>ee(!1)}),(0,Do.jsx)("div",{className:"md:hidden",children:(0,Do.jsx)(qt,{items:e,isOpen:Z,isMobile:!0,onClose:()=>ee(!1),currentBusinessUnit:Q,onBusinessUnitChange:ae,onSearch:l,logo:x,appName:P,tagline:F})}),(0,Do.jsx)("div",{className:"hidden md:block",children:(0,Do.jsx)(qt,{items:e,isOpen:z,isMobile:!1,currentBusinessUnit:Q,onBusinessUnitChange:ae,onSearch:l,logo:x,appName:P,tagline:F})}),(0,Do.jsxs)("div",{className:c("min-h-screen fixed w-full transition-all duration-300 ease-in-out",z?"md:pl-64":"md:pl-0"),children:[(0,Do.jsx)(Zo,{title:o,notifications:a,onToggleSidebar:()=>Y(!z),onToggleMobileMenu:()=>ee(!0),sidebarOpen:z,activeTab:p,onTabChange:u,showTabs:w,onActionClick:f,actionIcon:h,actionText:R,onNotificationRemove:M,onRemoveAll:T,logo:x,appName:P,tagline:F}),(0,Do.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var Je=G(require("react"));var be=Je.forwardRef(({className:e,...t},o)=>(0,Do.jsx)("div",{ref:o,className:c("rounded-xl border bg-card text-card-foreground shadow",e),...t}));be.displayName="Card";var Be=Je.forwardRef(({className:e,...t},o)=>(0,Do.jsx)("div",{ref:o,className:c("flex flex-col space-y-1.5 p-6",e),...t}));Be.displayName="CardHeader";var Le=Je.forwardRef(({className:e,...t},o)=>(0,Do.jsx)("div",{ref:o,className:c("font-semibold leading-none tracking-tight",e),...t}));Le.displayName="CardTitle";var Zt=Je.forwardRef(({className:e,...t},o)=>(0,Do.jsx)("div",{ref:o,className:c("text-sm text-muted-foreground",e),...t}));Zt.displayName="CardDescription";var Pe=Je.forwardRef(({className:e,...t},o)=>(0,Do.jsx)("div",{ref:o,className:c("p-6 pt-0",e),...t}));Pe.displayName="CardContent";var ft=Je.forwardRef(({className:e,...t},o)=>(0,Do.jsx)("div",{ref:o,className:c("flex items-center p-6 pt-0",e),...t}));ft.displayName="CardFooter";function aa({sessions:e,currentSession:t,teams:o,onNewChat:a,onSessionSelect:s,onSessionEdit:i,onSessionDelete:l,className:n}){return(0,Do.jsx)(tt,{children:(0,Do.jsx)("div",{className:`space-y-4 h-full ${n||""}`,children:(0,Do.jsxs)(be,{className:"shadow-sm h-full",children:[(0,Do.jsx)("div",{className:"p-4 border-Do",children:(0,Do.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Do.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,Do.jsx)(Ma.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,Do.jsxs)(A,{onClick:a,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,Do.jsx)(Ma.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,Do.jsx)(Ce,{className:"h-[600px]",children:(0,Do.jsx)("div",{className:"p-2",children:e.length===0?(0,Do.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(p=>(0,Do.jsxs)(ot,{children:[(0,Do.jsx)(at,{asChild:!0,children:(0,Do.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,Do.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,Do.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,Do.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:p.title}),(0,Do.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:p.lastMessage})]}),(0,Do.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[i&&(0,Do.jsx)(A,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:u=>{u.stopPropagation(),i(p.id)},children:(0,Do.jsx)(Ma.Edit3,{className:"h-3 w-3"})}),l&&(0,Do.jsx)(A,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:u=>{u.stopPropagation(),l(p.id)},children:(0,Do.jsx)(Ma.Trash2,{className:"h-3 w-3"})})]})]})})}),(0,Do.jsx)(Ke,{side:"right",className:"max-w-xs",children:(0,Do.jsxs)("div",{className:"space-y-1",children:[(0,Do.jsx)("p",{className:"font-medium text-sm",children:p.title}),(0,Do.jsx)("p",{className:"text-xs",children:p.lastMessage})]})})]},p.id))})})]})})})}var Ye=G(require("motion/react-client"));var ia={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"]},ra=[{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 eo(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function na({capabilities:e,isOpen:t,onToggle:o,onActionSelect:a,onContextChange:s,colorScheme:i=ia,className:l}){let[n,p]=(0,Ba.useState)([]),[u,w]=(0,Ba.useState)([]),f=n[n.length-1],h=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,Ba.useMemo)(()=>({path:n,selectedItems:u,filters:{}}),[n,u]);(0,Ba.useEffect)(()=>{s&&s(M)},[M,s]);let T=C=>{C.type==="category"||C.type==="list"?p([...n,C]):C.type==="item"&&w([...u,C])},x=()=>{p(n.slice(0,-1))},P=C=>{p(n.slice(0,C+1))},F=()=>f?.actions?f.actions:[];return t?(0,Do.jsxs)("div",{className:c("w-full",l),children:[(0,Do.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Do.jsxs)("div",{className:"flex items-center gap-2",children:[n.length>0&&(0,Do.jsx)(Lt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:x,className:c("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Do.jsx)(Ma.ChevronLeft,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,Do.jsx)("h4",{className:"font-medium text-sm",children:f?.name||"Capabilities"})]}),(0,Do.jsx)(Lt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:o,className:c("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Do.jsx)(Ma.Do,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),n.length>0&&(0,Do.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,Do.jsx)(Lt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>p([]),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Do.jsxs)("span",{className:"relative",children:["Capabilities",(0,Do.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),n.map((C,z)=>(0,Do.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Do.jsx)(Ma.ChevronRight,{className:"h-2 w-2"}),(0,Do.jsx)(Lt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>P(z),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Do.jsxs)("span",{className:"relative",children:[C.name,(0,Do.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},C.id))]}),(0,Do.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,Do.jsx)(Lt.AnimatePresence,{mode:"wait",children:(0,Do.jsx)(Lt.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:f?.type==="list"&&f.data?(0,Do.jsx)(qi,{data:f.data,onItemSelect:C=>w([...u,C]),colorScheme:i}):(0,Do.jsx)(Wi,{capabilities:h,onSelect:T,colorScheme:i})},f?.id||"root")})})]}):(0,Do.jsxs)(A,{onClick:o,size:"sm",variant:"outline",className:"rounded-full",children:[(0,Do.jsx)(Ma.Menu,{className:"h-4 w-4"}),(0,Do.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function Wi({capabilities:e,onSelect:t,colorScheme:o}){return(0,Do.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,s)=>(0,Do.jsx)($i,{capability:a,onClick:()=>t(a),color:o.categories[s%o.categories.length]},a.id))})}function $i({capability:e,onClick:t,selected:o,color:a}){return(0,Do.jsxs)(Lt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:c("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",o&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,Do.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a)}),(0,Do.jsxs)("span",{className:"truncate relative",children:[e.name,(0,Do.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,Do.jsx)(Ma.ChevronRight,{className:c("h-3 w-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,Do.jsx)(me,{variant:"secondary",className:c("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function qi({data:e,onItemSelect:t,colorScheme:o}){return(0,Do.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,s)=>(0,Do.jsxs)(Lt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:c("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(a),children:[(0,Do.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o.items[s%o.items.length])}),(0,Do.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Do.jsxs)("span",{className:"truncate relative font-medium",children:[a.title,(0,Do.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),a.subtitle&&(0,Do.jsx)("div",{className:c("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:a.subtitle})]}),a.value&&(0,Do.jsx)(me,{variant:"secondary",className:c("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:a.value})]},a.id))})}var ca=require("date-fns");function sa({taskId:e,polling:t=!0,system:o="payload"}){let[a,s]=(0,Ba.useState)(null),[i,l]=(0,Ba.useState)(!1),[n,p]=(0,Ba.useState)(null),u=async(f=!0)=>{if(e){f&&l(!0);try{let h=await fetch(`/api/tasks/${e}`);if(!h.ok)throw new Error(`Failed Ba fetch task: ${h.statusText}`);let R=await h.json();s(R)}catch(h){console.error("Error fetching task:",h),p(h instanceof Error?h:new Error("Unknown error occurred"))}finally{f&&l(!1)}}},w=()=>u(!1);return(0,Ba.useEffect)(()=>{e&&u(!0);let f=null;return e&&t&&(f=setInterval(w,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:a,loading:i,error:n}}var Ki=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"}},_i=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function da({data:e}){let{id:t,system:o,fetchLatest:a,taskData:s,error:i}=e||{};if(!t)return null;let l=null,n=!0,p=i,u=a!==void 0?a:!0;if(l=s||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:a,system:o,fetchLatest:u,taskData:l,error:p}),u){let{task:R,loading:M,error:T}=sa({taskId:t,system:o});l=R,n=M,p=T}else n=!1;let w=Ki(l?.status||"todo"),f=_i(l?.status||"todo"),h=l?.dateLogged||new Date().toISOString();try{let R=new Date(l?.dateLogged||"");isNaN(R.getTime())||(h=(0,ca.formatDistanceToNow)(R,{addSuffix:!0}))}catch{}return(0,Do.jsxs)(be,{className:c("w-full max-w-md shadow-md",p&&"border border-destructive"),children:[(0,Do.jsxs)(Be,{className:"pb-2",children:[(0,Do.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Do.jsx)(Le,{className:"text-lg font-semibold",children:n?"Loading...":l?.name||"Task"}),(0,Do.jsx)(me,{className:`${w}`,children:f})]}),l?.project&&(0,Do.jsxs)(Zt,{className:"text-sm text-gray-500",children:["Project: ",l.project.name]})]}),(0,Do.jsx)(Pe,{className:"pb-2",children:n?(0,Do.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):p?(0,Do.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Do.jsx)("p",{className:"text-sm text-foreground",children:l?.description||"......."})}),(0,Do.jsx)(ft,{className:"pt-2 flex items-center justify-between",children:(0,Do.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Do.jsx)(Ma.Clock,{className:"h-3 w-3 mr-1"}),(0,Do.jsxs)("span",{children:["Created ",h]}),(0,Do.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Do.jsxs)("span",{children:["Task #",t]})]})})]})}function ua({artefact:e,taskId:t,taskData:o,loading:a=!1,error:s=null}){let i=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},l=i.dateLogged;try{let n=new Date(i.dateLogged);isNaN(n.getTime())||(l=(0,ca.formatDistanceToNow)(n,{addSuffix:!0}))}catch{}return(0,Do.jsxs)(be,{className:"w-full max-w-md shadow-md",children:[(0,Do.jsx)(Be,{className:"pb-2",children:(0,Do.jsx)("div",{className:"flex justify-between items-start",children:(0,Do.jsx)(Le,{className:"text-lg font-semibold",children:a?"Loading...":i.name})})}),(0,Do.jsx)(Pe,{className:"pb-2",children:a?(0,Do.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):s?(0,Do.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Do.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,Do.jsx)(ft,{className:"pt-2 flex items-center justify-between",children:(0,Do.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Do.jsx)(Ma.Clock,{className:"h-3 w-3 mr-1"}),(0,Do.jsxs)("span",{children:["Created ",l]}),(0,Do.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Do.jsxs)("span",{children:["Task #",i.id]})]})})]})}var fa=G(require("react"));var ga=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:a,description:s="This endpoint requires authentication Ba sync functions."})=>{let[i,l]=(0,Ba.useState)(!1),[n,p]=(0,Ba.useState)(""),u=()=>{if(!t){p("No authentication URL provided");return}l(!0),p("");try{let f=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!f){p("Popup blocked. Please allow popups for this site and try again."),l(!1);return}let h=setInterval(()=>{try{f.closed&&(clearInterval(h),l(!1),a(),o())}catch{}},1e3);setTimeout(()=>{f.closed||(f.close(),clearInterval(h),l(!1),p("Authentication timed out. Please try again."))},6e5)}catch{p("Failed Ba open authentication window"),l(!1)}},w=async()=>{try{await navigator.clipboard.writeText(t),p("")}catch{p("Failed Ba copy URL Ba clipboard")}};return e?(0,Do.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,Do.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,Do.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,Do.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s}),n&&(0,Do.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:n}),(0,Do.jsxs)("div",{className:"flex gap-2",children:[(0,Do.jsx)("button",{onClick:u,disabled:i||!t,className:`
6
+ "use strict";var ri=Object.create;var Nt=Object.defineProperty;var ni=Object.getOwnPropertyDescriptor;var si=Object.getOwnPropertyNames;var li=Object.getPrototypeOf,ci=Object.prototype.hasOwnProperty;var di=(e,t)=>{for(var o in t)Nt(e,o,{get:t[o],enumerable:!0})},Po=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of si(t))!ci.call(e,s)&&s!==o&&Nt(e,s,{get:()=>t[s],enumerable:!(a=ni(t,s))||a.enumerable});return e};var G=(e,t,o)=>(o=e!=null?ri(li(e)):{},Po(t||!e||!e.__esModule?Nt(o,"default",{value:e,enumerable:!0}):o,e)),pi=e=>Po(Nt({},"__esModule",{value:!0}),e);var vr={};di(vr,{ChatDemo:()=>br});module.exports=pi(vr);var qa=require("react");var Wa=require("@ai-sdk/react"),Gt=require("motion/react"),Ga=require("lucide-react");var Lo=require("clsx");var _t="-",mi=e=>{let t=gi(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{let n=l.split(_t);return n[0]===""&&n.length!==1&&n.shift(),Ro(n,t)||ui(l)},getConflictingClassGroupIds:(l,n)=>{let p=o[l]||[];return n&&a[l]?[...p,...a[l]]:p}}},Ro=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),s=a?Ro(e.slice(1),a):void 0;if(s)return s;if(t.validators.length===0)return;let r=e.join(_t);return t.validators.find(({validator:l})=>l(r))?.classGroupId},To=/^\[(.+)\]$/,ui=e=>{if(To.test(e)){let t=To.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},gi=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return bi(Object.entries(e.classGroups),o).forEach(([r,l])=>{Kt(l,a,r,t)}),a},Kt=(e,t,o,a)=>{e.forEach(s=>{if(typeof s=="string"){let r=s===""?t:Do(t,s);r.classGroupId=o;return}if(typeof s=="function"){if(fi(s)){Kt(s(a),t,o,a);return}t.validators.push({validator:s,classGroupId:o});return}Object.entries(s).forEach(([r,l])=>{Kt(l,Do(t,r),o,a)})})},Do=(e,t)=>{let o=e;return t.split(_t).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},fi=e=>e.isThemeGetter,bi=(e,t)=>t?e.map(([o,a])=>{let s=a.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([l,n])=>[t+l,n])):r);return[o,s]}):e,vi=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,s=(r,l)=>{o.set(r,l),t++,t>e&&(t=0,a=o,o=new Map)};return{get(r){let l=o.get(r);if(l!==void 0)return l;if((l=a.get(r))!==void 0)return s(r,l),l},set(r,l){o.has(r)?o.set(r,l):s(r,l)}}},So="!",hi=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,s=t[0],r=t.length,l=n=>{let p=[],u=0,C=0,f;for(let x=0;x<n.length;x++){let T=n[x];if(u===0){if(T===s&&(a||n.slice(x,x+r)===t)){p.push(n.slice(C,x)),C=x+r;continue}if(T==="/"){f=x;continue}}T==="["?u++:T==="]"&&u--}let h=p.length===0?n:n.substring(C),S=h.startsWith(So),I=S?h.substring(1):h,R=f&&f>C?f-C:void 0;return{modifiers:p,hasImportantModifier:S,baseClassName:I,maybePostfixModifierPosition:R}};return o?n=>o({className:n,parseClassName:l}):l},yi=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},xi=e=>({cache:vi(e.cacheSize),parseClassName:hi(e),...mi(e)}),wi=/\s+/,Ci=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:s}=t,r=[],l=e.trim().split(wi),n="";for(let p=l.length-1;p>=0;p-=1){let u=l[p],{modifiers:C,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:S}=o(u),I=!!S,R=a(I?h.substring(0,S):h);if(!R){if(!I){n=u+(n.length>0?" "+n:n);continue}if(R=a(h),!R){n=u+(n.length>0?" "+n:n);continue}I=!1}let x=yi(C).join(":"),T=f?x+So:x,F=T+R;if(r.includes(F))continue;r.push(F);let N=s(R,I);for(let z=0;z<N.length;++z){let Z=N[z];r.push(T+Z)}n=u+(n.length>0?" "+n:n)}return n};function Ni(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Ao(t))&&(a&&(a+=" "),a+=o);return a}var Ao=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=Ao(e[a]))&&(o&&(o+=" "),o+=t);return o};function ki(e,...t){let o,a,s,r=l;function l(p){let u=t.reduce((C,f)=>f(C),e());return o=xi(u),a=o.cache.get,s=o.cache.set,r=n,n(p)}function n(p){let u=a(p);if(u)return u;let C=Ci(p,o);return s(p,C),C}return function(){return r(Ni.apply(null,arguments))}}var H=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Io=/^\[(?:([a-z-]+):)?(.+)\]$/zo,Pi=/^\d+\/\d+$/,Ti=new Set(["px","full","screen"]),Di=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ri=/\d+(%|px|r?em|[sdl]?zo([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|zo|zo|min|max))|\zo(calc|min|max|clamp)\(.+\)|^0$/,Si=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ai=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ii=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Me=e=>ot(e)||Ti.has(e)||Pi.test(e),Oe=e=>at(e,"length",ji),ot=e=>!!e&&!Number.isNaN(Number(e)),qt=e=>at(e,"number",ot),mt=e=>!!e&&Number.isInteger(Number(e)),Mi=e=>e.endsWith("%")&&ot(e.slice(0,-1)),y=e=>Io.test(e),He=e=>Di.test(e),Bi=new Set(["length","size","percentage"]),Li=e=>at(e,Bi,Mo),Ei=e=>at(e,"position",Mo),zi=new Set(["image","url"]),Ui=e=>at(e,zi,Hi),Fi=e=>at(e,"",Oi),ut=()=>!0,at=(e,t,o)=>{let a=Io.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},ji=e=>Ri.test(e)&&!Si.test(e),Mo=()=>!1,Oi=e=>Ai.test(e),Hi=e=>Ii.test(e);var Vi=()=>{let e=H("colors"),t=H("spacing"),o=H("blur"),a=H("brightness"),s=H("borderColor"),r=H("borderRadius"),l=H("borderSpacing"),n=H("borderWidth"),p=H("contrast"),u=H("grayscale"),C=H("hueRotate"),f=H("invert"),h=H("gap"),S=H("gradientColorStops"),I=H("gradientColorStopPositions"),R=H("inset"),x=H("margin"),T=H("opacity"),F=H("padding"),N=H("saturate"),z=H("scale"),Z=H("sepia"),ee=H("skew"),te=H("space"),Y=H("translate"),q=()=>["auto","contain","none"],ie=()=>["auto","hidden","clip","visible","scroll"],de=()=>["auto",y,t],M=()=>[y,t],Ae=()=>["",Me,Oe],d=()=>["auto",ot,y],E=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],K=()=>["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],_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>[ot,y];return{cacheSize:500,separator:":",theme:{colors:[ut],spacing:[Me,Oe],blur:["none","",He,y],brightness:w(),borderColor:[e],borderRadius:["none","","full",He,y],borderSpacing:M(),borderWidth:Ae(),contrast:w(),grayscale:j(),hueRotate:w(),invert:j(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[Mi,Oe],inset:de(),margin:de(),opacity:w(),padding:M(),saturate:w(),scale:w(),sepia:j(),skew:w(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",y]}],container:["container"],columns:[{columns:[He]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...E(),y]}],overflow:[{overflow:ie()}],"overflow-x":[{"overflow-x":ie()}],"overflow-y":[{"overflow-y":ie()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[R]}],"inset-x":[{"inset-x":[R]}],"inset-y":[{"inset-y":[R]}],start:[{start:[R]}],end:[{end:[R]}],top:[{top:[R]}],right:[{right:[R]}],bottom:[{bottom:[R]}],left:[{left:[R]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",mt,y]}],basis:[{basis:de()}],"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",mt,y]}],"grid-cols":[{"grid-cols":[ut]}],"col-start-end":[{col:["auto",{span:["full",mt,y]},y]}],"col-start":[{"col-start":d()}],"col-end":[{"col-end":d()}],"grid-rows":[{"grid-rows":[ut]}],"row-start-end":[{row:["auto",{span:[mt,y]},y]}],"row-start":[{"row-start":d()}],"row-end":[{"row-end":d()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",y]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",y]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...m()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...m(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...m(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[F]}],px:[{px:[F]}],py:[{py:[F]}],ps:[{ps:[F]}],qa:[{qa:[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":[te]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[te]}],"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:[He]},He]}],h:[{h:[y,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[y,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[y,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[y,t,"auto","min","max","fit"]}],"font-size":[{text:["base",He,Oe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",qt]}],"font-family":[{font:[ut]}],"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",ot,qt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Me,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":[T]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[T]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Me,Oe]}],"underline-offset":[{"underline-offset":["auto",Me,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:M()}],"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":[T]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...E(),Ei]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Li]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","zo","bl","l","tl"]},Ui]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[I]}],"gradient-via-pos":[{via:[I]}],"gradient-to-pos":[{to:[I]}],"gradient-from":[{from:[S]}],"gradient-via":[{via:[S]}],"gradient-to":[{to:[S]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-zo":[{"rounded-zo":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-Ga":[{"rounded-Ga":[r]}],"rounded-ee":[{"rounded-ee":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[n]}],"border-w-x":[{"border-x":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-r":[{"border-r":[n]}],"border-w-zo":[{"border-zo":[n]}],"border-w-l":[{"border-l":[n]}],"border-opacity":[{"border-opacity":[T]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[T]}],"divide-style":[{divide:B()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-zo":[{"border-zo":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[Me,y]}],"outline-w":[{outline:[Me,Oe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[T]}],"ring-offset-w":[{"ring-offset":[Me,Oe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",He,Fi]}],"shadow-color":[{shadow:[ut]}],opacity:[{opacity:[T]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",He,y]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[C]}],invert:[{invert:[f]}],saturate:[{saturate:[N]}],sepia:[{sepia:[Z]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[C]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[T]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[Z]}],"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:w()}],ease:[{ease:["linear","in","out","in-out",y]}],delay:[{delay:w()}],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:[mt,y]}],"translate-x":[{"translate-x":[Y]}],"translate-y":[{"translate-y":[Y]}],"skew-x":[{"skew-x":[ee]}],"skew-y":[{"skew-y":[ee]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",y]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","Ga-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":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-qa":[{"scroll-qa":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",y]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Me,Oe,qt]}],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","qa","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-zo","rounded-l","rounded-ss","rounded-Ga","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Ga","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-zo":["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-zo","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-zo"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-zo","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-zo"],"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-qa","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 Bo=ki(Vi);function c(...e){return Bo((0,Lo.clsx)(e))}var It=G(require("react")),to=G(require("next/link"));var Eo=require("class-variance-authority");var zo=require("react/jsx-runtime"),Wi=(0,Eo.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 ne({className:e,variant:t,...o}){return(0,zo.jsx)("div",{className:c(Wi({variant:t}),e),...o})}var Uo=require("@radix-ui/react-slot"),jo=G(require("react")),Gi=(0,Eo.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),A=jo.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...s},r)=>(0,zo.jsx)(e?Uo.Slot:"button",{className:c(Gi({className:t,size:o,variant:a})),ref:r,...s}));A.displayName="Button";var Ho=G(require("react"));var gt=Ho.forwardRef(({className:e,type:t,...o},a)=>(0,zo.jsx)("input",{type:t,className:c("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...o}));gt.displayName="Input";var Jt=G(require("react")),fe=G(require("@radix-ui/react-scroll-area"));var ke=Jt.forwardRef(({className:e,children:t,...o},a)=>(0,zo.jsxs)(fe.Root,{ref:a,className:c("relative overflow-hidden",e),...o,children:[(0,zo.jsx)(fe.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,zo.jsx)(Wo,{}),(0,zo.jsx)(fe.Corner,{})]}));ke.displayName=fe.Root.displayName;var Wo=Jt.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,zo.jsx)(fe.ScrollAreaScrollbar,{ref:a,orientation:t,className:c("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,zo.jsx)(fe.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Wo.displayName=fe.ScrollAreaScrollbar.displayName;var ft=G(require("react")),J=G(require("@radix-ui/react-dialog"));var $o=J.Root;var $zo=J.Portal;var qo=ft.forwardRef(({className:e,...t},o)=>(0,zo.jsx)(J.Overlay,{ref:o,className:c("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));qo.displayName=J.Overlay.displayName;var Xt=ft.forwardRef(({className:e,children:t,...o},a)=>(0,zo.jsxs)($zo,{children:[(0,zo.jsx)(qo,{}),(0,zo.jsxs)(J.Content,{ref:a,className:c("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-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),...o,children:[t,(0,zo.jsxs)(J.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,zo.jsx)(Ga.zo,{className:"h-4 w-4"}),(0,zo.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Xt.displayName=J.Content.displayName;var Qt=({className:e,...t})=>(0,zo.jsx)("div",{className:c("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Qt.displayName="DialogHeader";var qi=({className:e,...t})=>(0,zo.jsx)("div",{className:c("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});qi.displayName="DialogFooter";var Yt=ft.forwardRef(({className:e,...t},o)=>(0,zo.jsx)(J.Title,{ref:o,className:c("text-lg font-semibold leading-none tracking-tight",e),...t}));Yt.displayName=J.Title.displayName;var Ki=ft.forwardRef(({className:e,...t},o)=>(0,zo.jsx)(J.Description,{ref:o,className:c("text-sm text-muted-foreground",e),...t}));Ki.displayName=J.Description.displayName;var bt=G(require("@radix-ui/react-checkbox")),_o=G(require("react")),Zt=_o.forwardRef(({className:e,...t},o)=>(0,zo.jsx)(bt.Root,{className:c("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,zo.jsx)(bt.Indicator,{className:c("flex items-center justify-center text-current"),children:(0,zo.jsx)(Ga.Check,{className:"h-4 w-4"})})}));Zt.displayName=bt.Root.displayName;var Pe=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var Xo=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,zo.jsx)(Ga.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,zo.jsx)(Ga.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,zo.jsx)(Ga.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,zo.jsx)(Ga.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,zo.jsx)(Ga.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,zo.jsx)(Ga.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,zo.jsx)(Ga.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,zo.jsx)(Ga.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,zo.jsx)(Ga.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,zo.jsx)(Ga.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Dt=[{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 eo=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],Pt=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],St=[{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")}],_i=[...St,{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")}],Ji=[...Dt,{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}],Tt={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:[]},Jo={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:St.filter(e=>e.epicId==="1")};var jr={empty:{initialProjects:Tt.projects,initialEpics:Tt.epics,initialSprints:Tt.sprints,initialTasks:Tt.tasks},default:{initialProjects:Dt,initialEpics:eo,initialSprints:Pt,initialTasks:St},highDensity:{initialProjects:Dt,initialEpics:eo,initialSprints:Pt,initialTasks:_i},singleEpic:{initialProjects:Dt,initialEpics:Jo.epics,initialSprints:Pt,initialTasks:Jo.tasks},multipleProjects:{initialProjects:Ji,initialEpics:eo,initialSprints:Pt,initialTasks:St}},Rt=[{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(Pe),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Pe),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(Pe),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Pe),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(Pe),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Pe),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(Pe),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Pe),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(Pe),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Pe),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],Or=[{id:"1",title:"Review quarterly report",description:"Ga through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:Rt.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:Rt.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:Rt.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 Hr=Rt.filter(e=>e.type==="digital");function Qo(e,t){let[o,a]=(0,qa.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{a(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,qa.useEffect)(()=>{s(o)},[]),[o,s]}function oo({items:e,isOpen:t,isMobile:o=!1,onClose:a,currentBusinessUnit:s=Xo[0],onBusinessUnitChange:r,onSearch:l,className:n,logo:p="/headerlogo.png",appName:u="Nuvia",tagline:C="Collaboration Platform"}){let[f,h]=It.useState({}),[S,I]=Qo("sidebar-favorites",{}),[R,x]=It.useState(null),[T,F]=It.useState(""),N=d=>{h(E=>({...E,[d]:!E[d]}))},z=d=>{r?.(d)},Z=()=>{T.trim()&&l?.(T.trim())},ee=d=>{d.key==="Enter"&&(d.preventDefault(),Z())},te=(d,E)=>{let B=S[d]||[],K=B.includes(E)?B.filter(m=>m!==E):B.concat(E);I({...S,[d]:K})},Y=d=>{if(!d.items||!d.maxItems||d.items.length<=d.maxItems)return d.items||[];let E=S[d.id]||[],B=d.items.filter(m=>E.includes(m.id)),K=d.items.filter(m=>!E.includes(m.id));return[...B,...K].slice(0,d.maxItems)},q=d=>d.maxItems&&d.items&&d.items.length>d.maxItems,ie=e,de=d=>{let E=q(d),B=Y(d),K=(0,zo.jsxs)(zo.Fragment,{children:[(0,zo.jsxs)("div",{className:"flex items-center gap-3",children:[d.icon,(0,zo.jsx)("span",{children:d.title})]}),d.badge&&(0,zo.jsx)(ne,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:d.badge}),d.items&&(0,zo.jsx)(Ga.ChevronDown,{className:c("ml-2 h-4 w-4 transition-transform",f[d.title]?"rotate-180":"")})]}),m=c("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",d.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return d.url?(0,zo.jsx)(to.default,{href:d.url,className:m,onClick:o?a:void 0,children:K}):(0,zo.jsx)("button",{className:m,onClick:()=>d.items&&N(d.title),children:K})},M=()=>{let d=e.find(B=>B.id===R);if(!d||!d.items||!d.maxItems)return null;let E=S[d.id]||[];return(0,zo.jsx)($o,{open:!!R,onOpenChange:B=>!B&&x(null),children:(0,zo.jsxs)(Xt,{className:"sm:max-w-md",children:[(0,zo.jsxs)(Qt,{children:[(0,zo.jsxs)(Yt,{children:["Manage ",d.title," Favorites"]}),(0,zo.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",d.maxItems," items to show in ",d.title.toLowerCase(),"."]})]}),(0,zo.jsx)(ke,{className:"max-h-96 pr-4",children:(0,zo.jsx)("div",{className:"space-y-4",children:d.items.map(B=>(0,zo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zo.jsx)(Zt,{id:B.id,checked:E.includes(B.id),onCheckedChange:()=>te(d.id,B.id),disabled:!E.includes(B.id)&&E.length>=(d.maxItems||0)}),(0,zo.jsxs)("label",{htmlFor:B.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[B.title,B.badge&&(0,zo.jsx)(ne,{variant:"outline",className:"text-xs",children:B.badge})]})]},B.id))})})]})})},Ae=(0,zo.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,zo.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,zo.jsxs)("div",{className:"flex items-center gap-3",children:[(0,zo.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,zo.jsx)("img",{src:p,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,zo.jsxs)("div",{children:[(0,zo.jsx)("h2",{className:"font-semibold",children:u}),(0,zo.jsx)("p",{className:"text-xs text-muted-foreground",children:C})]})]}),o&&(0,zo.jsx)(A,{variant:"ghost",size:"icon",onClick:a,children:(0,zo.jsx)(Ga.zo,{className:"h-5 w-5"})})]}),(0,zo.jsx)("div",{className:"px-3 py-2",children:(0,zo.jsxs)("div",{className:"relative",children:[(0,zo.jsx)(Ga.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,zo.jsx)(gt,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:T,onChange:d=>F(d.target.value),onKeyPress:ee})]})}),(0,zo.jsx)(ke,{className:"flex-1 px-3 py-2",children:(0,zo.jsx)("div",{className:"space-y-1",children:ie.map(d=>(0,zo.jsxs)("div",{className:"mb-1",children:[de(d),d.items&&f[d.title]&&(0,zo.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[Y(d).map(E=>(0,zo.jsxs)(to.default,{href:E.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:o?a:void 0,children:[E.title,E.badge&&(0,zo.jsx)(ne,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:E.badge})]},E.id)),q(d)&&d.items&&d.items.length>Y(d).length&&(0,zo.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-Y(d).length," more available"]})]})]},d.id))})}),(0,zo.jsx)("div",{className:"p-3",children:(0,zo.jsx)("div",{className:"space-y-1",children:(0,zo.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,zo.jsx)(Ga.Settings,{className:"h-5 w-5"}),(0,zo.jsx)("span",{children:"Settings"})]})})}),(0,zo.jsx)(M,{})]});return o?(0,zo.jsx)("div",{className:c("fixed inset-y-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",n),children:Ae}):(0,zo.jsx)("div",{className:c("fixed inset-y-0 left-0 z-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",n),children:Ae})}var Mt=G(require("react")),Be=G(require("@radix-ui/react-avatar"));var _e=Mt.forwardRef(({className:e,...t},o)=>(0,zo.jsx)(Be.Root,{ref:o,className:c("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));_e.displayName=Be.Root.displayName;var ao=Mt.forwardRef(({className:e,...t},o)=>(0,zo.jsx)(Be.Image,{ref:o,className:c("aspect-square h-full w-full",e),...t}));ao.displayName=Be.Image.displayName;var Je=Mt.forwardRef(({className:e,...t},o)=>(0,zo.jsx)(Be.Fallback,{ref:o,className:c("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Je.displayName=Be.Fallback.displayName;var Yo=G(require("react")),xe=G(require("@radix-ui/react-tooltip"));var it=xe.Provider,rt=xe.Root,nt=xe.Trigger,Xe=Yo.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,zo.jsx)(xe.Portal,{children:(0,zo.jsx)(xe.Content,{ref:a,sideOffset:t,className:c("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Xe.displayName=xe.Content.displayName;var Zo=require("next-themes");function ea(){let{setTheme:e,theme:t}=(0,Zo.useTheme)();return(0,zo.jsx)(it,{children:(0,zo.jsxs)(rt,{children:[(0,zo.jsx)(nt,{asChild:!0,children:(0,zo.jsxs)(A,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,zo.jsx)(Ga.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,zo.jsx)(Ga.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,zo.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,zo.jsx)(Xe,{children:"Toggle theme"})]})})}function ta({notifications:e,open:t,onClose:o,onNotificationRemove:a,onRemoveAll:s,className:r}){let l=e.filter(u=>!u.read),n=l.length,p=u=>{switch(u){case"info":return(0,zo.jsx)(Ga.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,zo.jsx)(Ga.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,zo.jsx)(Ga.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,zo.jsx)(Ga.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,zo.jsx)(Gt.AnimatePresence,{children:t&&(0,zo.jsxs)(zo.Fragment,{children:[(0,zo.jsx)(Gt.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:o}),(0,zo.jsx)(Gt.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",r),children:(0,zo.jsxs)("div",{className:"flex h-full flex-col",children:[(0,zo.jsxs)("div",{className:"flex items-center justify-between border-zo p-4",children:[(0,zo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zo.jsx)(Ga.Bell,{className:"h-5 w-5"}),(0,zo.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),n>0&&(0,zo.jsxs)(ne,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[n," new"]})]}),(0,zo.jsxs)(A,{variant:"ghost",size:"icon",onClick:o,className:"rounded-full",children:[(0,zo.jsx)(Ga.zo,{className:"h-5 w-5"}),(0,zo.jsx)("span",{className:"sr-only",children:"Close"})]})]}),n>0&&(0,zo.jsxs)("div",{className:"flex items-center justify-between border-zo p-2",children:[(0,zo.jsxs)("span",{className:"text-sm text-muted-foreground",children:[n," unread notification",n!==1?"s":""]}),(0,zo.jsx)(A,{variant:"ghost",size:"sm",onClick:s,className:"text-sm",children:"Dismiss all"})]}),l.length>0?(0,zo.jsx)(ke,{className:"flex-1",children:(0,zo.jsx)("div",{className:"divide-y",children:l.map(u=>(0,zo.jsxs)("div",{className:c("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,zo.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:p(u.type)}),(0,zo.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,zo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zo.jsx)("p",{className:"font-medium",children:u.title}),(0,zo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zo.jsx)("p",{className:"text-xs text-muted-foreground",children:u.time}),(0,zo.jsx)(A,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>a?.(u.id),title:"Dismiss",children:(0,zo.jsx)(Ga.Check,{className:"h-3 w-3"})})]})]}),(0,zo.jsx)("p",{className:"text-sm text-muted-foreground",children:u.description}),u.actionLabel&&(0,zo.jsxs)(A,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:u.onAction,children:[u.actionLabel,(0,zo.jsx)(Ga.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},u.id))})}):(0,zo.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,zo.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,zo.jsx)(Ga.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,zo.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,zo.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var Qe=G(require("@radix-ui/react-tabs"));function oa({className:e,...t}){return(0,zo.jsx)(Qe.Root,{"data-slot":"tabs",className:c("flex flex-col gap-2",e),...t})}function aa({className:e,...t}){return(0,zo.jsx)(Qe.List,{"data-slot":"tabs-list",className:c("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function ia({className:e,...t}){return(0,zo.jsx)(Qe.Trigger,{"data-slot":"tabs-trigger",className:c("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var Le=G(require("react")),D=G(require("@radix-ui/react-dropdown-menu")),st=require("@radix-ui/react-icons");var ra=D.Root,na=D.Trigger;var Xi=Le.forwardRef(({className:e,inset:t,children:o,...a},s)=>(0,zo.jsxs)(D.SubTrigger,{ref:s,className:c("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...a,children:[o,(0,zo.jsx)(st.ChevronRightIcon,{className:"ml-auto"})]}));Xi.displayName=D.SubTrigger.displayName;var Qi=Le.forwardRef(({className:e,...t},o)=>(0,zo.jsx)(D.SubContent,{ref:o,className:c("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Qi.displayName=D.SubContent.displayName;var ro=Le.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,zo.jsx)(D.Portal,{children:(0,zo.jsx)(D.Content,{ref:a,sideOffset:t,className:c("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));ro.displayName=D.Content.displayName;var no=Le.forwardRef(({className:e,inset:t,...o},a)=>(0,zo.jsx)(D.Item,{ref:a,className:c("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...o}));no.displayName=D.Item.displayName;var Yi=Le.forwardRef(({className:e,children:t,checked:o,...a},s)=>(0,zo.jsxs)(D.CheckboxItem,{ref:s,className:c("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...a,children:[(0,zo.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,zo.jsx)(D.ItemIndicator,{children:(0,zo.jsx)(st.CheckIcon,{className:"h-4 w-4"})})}),t]}));Yi.displayName=D.CheckboxItem.displayName;var Zi=Le.forwardRef(({className:e,children:t,...o},a)=>(0,zo.jsxs)(D.RadioItem,{ref:a,className:c("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[(0,zo.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,zo.jsx)(D.ItemIndicator,{children:(0,zo.jsx)(st.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Zi.displayName=D.RadioItem.displayName;var er=Le.forwardRef(({className:e,inset:t,...o},a)=>(0,zo.jsx)(D.Label,{ref:a,className:c("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));er.displayName=D.Label.displayName;var tr=Le.forwardRef(({className:e,...t},o)=>(0,zo.jsx)(D.Separator,{ref:o,className:c("-mx-1 my-1 h-px bg-muted",e),...t}));tr.displayName=D.Separator.displayName;var or=({className:e,...t})=>(0,zo.jsx)("span",{className:c("ml-auto text-xs tracking-widest opacity-60",e),...t});or.displayName="DropdownMenuShortcut";function la({activeTab:e,onTabChange:t,tabOptions:o,className:a="",maxWidth:s="700px",gridCols:r=6}){let l=o.find(n=>n.value===e);return(0,zo.jsxs)(Gt.motion.div,{className:`flex-1 flex justify-center ${a}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,zo.jsx)("div",{className:"hidden lg:block",children:(0,zo.jsx)(oa,{value:e,onValueChange:t,children:(0,zo.jsx)(aa,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:s,gridTemplateColumns:`repeat(${Math.min(r,o.length)}, minmax(0, 1fr))`},children:o.map(n=>(0,zo.jsx)(Gt.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,zo.jsx)(ia,{value:n.value,className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:n.label})},n.value))})})}),(0,zo.jsx)("div",{className:"lg:hidden",children:(0,zo.jsxs)(ra,{children:[(0,zo.jsx)(na,{asChild:!0,children:(0,zo.jsxs)(A,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[l?.label||"Select",(0,zo.jsx)(Ga.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,zo.jsx)(ro,{align:"center",className:"w-[180px]",children:o.map(n=>(0,zo.jsx)(no,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function ca({title:e,notifications:t=[],onToggleSidebar:o,onToggleMobileMenu:a,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:C,actionIcon:f=(0,zo.jsx)($e.Bot,{className:"mr-2 h-4 w-4"}),actionText:h="Action",onNotificationRemove:S,onRemoveAll:I,logo:R="/headerlogo.png",appName:x="Nuvia",tagline:T="Collaboration Platform"}){let[F,N]=(0,qa.useState)(!1),[z,Z]=(0,qa.useState)(t),ee=z.filter(q=>!q.read).length,te=q=>{Z(ie=>ie.filter(de=>de.id!==q)),S?.(q)},Y=()=>{Z(q=>q.filter(ie=>ie.read)),I?.()};return(0,zo.jsxs)(zo.Fragment,{children:[(0,zo.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${r||""}`,children:[(0,zo.jsx)(A,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,zo.jsx)($e.Menu,{className:"h-5 w-5"})}),(0,zo.jsx)(A,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:o,children:(0,zo.jsx)($e.PanelLeft,{className:"h-5 w-5"})}),!s&&(0,zo.jsxs)(Gt.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,zo.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,zo.jsx)("img",{src:R,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,zo.jsxs)("div",{children:[(0,zo.jsx)("h2",{className:"font-semibold text-sm",children:x}),(0,zo.jsx)("p",{className:"text-xs text-muted-foreground",children:T})]})]}),(0,zo.jsxs)("div",{className:"flex flex-1 items-center",children:[p&&(0,zo.jsx)(la,{activeTab:l,onTabChange:n,tabOptions:u}),(0,zo.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,zo.jsx)(Gt.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,zo.jsx)(Gt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,zo.jsxs)(A,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:C,children:[f,h]})})}),(0,zo.jsx)(ea,{}),(0,zo.jsx)(it,{children:(0,zo.jsxs)(rt,{children:[(0,zo.jsx)(nt,{asChild:!0,children:(0,zo.jsx)(Gt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,zo.jsxs)(A,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>N(!0),children:[(0,zo.jsx)(Gt.motion.div,{animate:ee>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:ee>0?1/0:0,repeatDelay:3},children:(0,zo.jsx)($e.Bell,{className:"h-5 w-5"})}),ee>0&&(0,zo.jsx)(Gt.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:ee})]})})}),(0,zo.jsx)(Xe,{children:"Notifications"})]})}),(0,zo.jsx)(Gt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,zo.jsxs)(_e,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,zo.jsx)(ao,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,zo.jsx)(Je,{})]})})]})]})]}),(0,zo.jsx)(ta,{notifications:z,open:F,onClose:()=>N(!1),onNotificationRemove:te,onRemoveAll:Y})]})}var da=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,zo.jsx)(Ga.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function ma({sidebarItems:e,children:t,title:o="Digital Colleagues",notifications:a=[],currentBusinessUnit:s=da[0],onBusinessUnitChange:r,onSearch:l,businessUnits:n=da,activeTab:p,onTabChange:u,showTabs:C=!1,onActionClick:f,actionIcon:h,actionText:S="Action",onNotificationRemove:I,onRemoveAll:R,logo:x="/headerlogo.png",appName:T="Nuvia",tagline:F="Collaboration Platform",sidebarInitiallyClosed:N=!1}){let[z,Z]=(0,qa.useState)(!N),[ee,te]=(0,qa.useState)(!1),[Y,q]=(0,qa.useState)(s),ie=de=>{q(de),r?.(de)};return(0,zo.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[ee&&(0,zo.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>te(!1)}),(0,zo.jsx)("div",{className:"md:hidden",children:(0,zo.jsx)(oo,{items:e,isOpen:ee,isMobile:!0,onClose:()=>te(!1),currentBusinessUnit:Y,onBusinessUnitChange:ie,onSearch:l,logo:x,appName:T,tagline:F})}),(0,zo.jsx)("div",{className:"hidden md:block",children:(0,zo.jsx)(oo,{items:e,isOpen:z,isMobile:!1,currentBusinessUnit:Y,onBusinessUnitChange:ie,onSearch:l,logo:x,appName:T,tagline:F})}),(0,zo.jsxs)("div",{className:c("min-h-screen fixed w-full transition-all duration-300 ease-in-out",z?"md:pl-64":"md:pl-0"),children:[(0,zo.jsx)(ca,{title:o,notifications:a,onToggleSidebar:()=>Z(!z),onToggleMobileMenu:()=>te(!0),sidebarOpen:z,activeTab:p,onTabChange:u,showTabs:C,onActionClick:f,actionIcon:h,actionText:S,onNotificationRemove:I,onRemoveAll:R,logo:x,appName:T,tagline:F}),(0,zo.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var Ye=G(require("react"));var ve=Ye.forwardRef(({className:e,...t},o)=>(0,zo.jsx)("div",{ref:o,className:c("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ve.displayName="Card";var Ee=Ye.forwardRef(({className:e,...t},o)=>(0,zo.jsx)("div",{ref:o,className:c("flex flex-col space-y-1.5 p-6",e),...t}));Ee.displayName="CardHeader";var ze=Ye.forwardRef(({className:e,...t},o)=>(0,zo.jsx)("div",{ref:o,className:c("font-semibold leading-none tracking-tight",e),...t}));ze.displayName="CardTitle";var co=Ye.forwardRef(({className:e,...t},o)=>(0,zo.jsx)("div",{ref:o,className:c("text-sm text-muted-foreground",e),...t}));co.displayName="CardDescription";var De=Ye.forwardRef(({className:e,...t},o)=>(0,zo.jsx)("div",{ref:o,className:c("p-6 pt-0",e),...t}));De.displayName="CardContent";var ht=Ye.forwardRef(({className:e,...t},o)=>(0,zo.jsx)("div",{ref:o,className:c("flex items-center p-6 pt-0",e),...t}));ht.displayName="CardFooter";function ua({sessions:e,currentSession:t,teams:o,onNewChat:a,onSessionSelect:s,onSessionEdit:r,onSessionDelete:l,className:n}){return(0,zo.jsx)(it,{children:(0,zo.jsx)("div",{className:`space-y-4 h-full ${n||""}`,children:(0,zo.jsxs)(ve,{className:"shadow-sm h-full",children:[(0,zo.jsx)("div",{className:"p-4 border-zo",children:(0,zo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zo.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,zo.jsx)(Ga.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,zo.jsxs)(A,{onClick:a,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,zo.jsx)(Ga.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,zo.jsx)(ke,{className:"h-[600px]",children:(0,zo.jsx)("div",{className:"p-2",children:e.length===0?(0,zo.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(p=>(0,zo.jsxs)(rt,{children:[(0,zo.jsx)(nt,{asChild:!0,children:(0,zo.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,zo.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,zo.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,zo.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:p.title}),(0,zo.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:p.lastMessage})]}),(0,zo.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[r&&(0,zo.jsx)(A,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:u=>{u.stopPropagation(),r(p.id)},children:(0,zo.jsx)(Ga.Edit3,{className:"h-3 w-3"})}),l&&(0,zo.jsx)(A,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:u=>{u.stopPropagation(),l(p.id)},children:(0,zo.jsx)(Ga.Trash2,{className:"h-3 w-3"})})]})]})})}),(0,zo.jsx)(Xe,{side:"right",className:"max-w-xs",children:(0,zo.jsxs)("div",{className:"space-y-1",children:[(0,zo.jsx)("p",{className:"font-medium text-sm",children:p.title}),(0,zo.jsx)("p",{className:"text-xs",children:p.lastMessage})]})})]},p.id))})})]})})})}var tt=G(require("motion/react-client"));var ga={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"]},fa=[{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 po(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function ba({capabilities:e,isOpen:t,onToggle:o,onActionSelect:a,onContextChange:s,colorScheme:r=ga,className:l}){let[n,p]=(0,qa.useState)([]),[u,C]=(0,qa.useState)([]),f=n[n.length-1],h=f?.children||e,S=(N,z)=>{switch(N.type){case"category":return r.categories[z%r.categories.length];case"list":return r.lists[z%r.lists.length];case"item":return r.items[z%r.items.length];default:return r.primary}},I=(0,qa.useMemo)(()=>({path:n,selectedItems:u,filters:{}}),[n,u]);(0,qa.useEffect)(()=>{s&&s(I)},[I,s]);let R=N=>{N.type==="category"||N.type==="list"?p([...n,N]):N.type==="item"&&C([...u,N])},x=()=>{p(n.slice(0,-1))},T=N=>{p(n.slice(0,N+1))},F=()=>f?.actions?f.actions:[];return t?(0,zo.jsxs)("div",{className:c("w-full",l),children:[(0,zo.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,zo.jsxs)("div",{className:"flex items-center gap-2",children:[n.length>0&&(0,zo.jsx)(Gt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:x,className:c("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,zo.jsx)(Ga.ChevronLeft,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,zo.jsx)("h4",{className:"font-medium text-sm",children:f?.name||"Capabilities"})]}),(0,zo.jsx)(Gt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:o,className:c("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,zo.jsx)(Ga.zo,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),n.length>0&&(0,zo.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,zo.jsx)(Gt.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,zo.jsxs)("span",{className:"relative",children:["Capabilities",(0,zo.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),n.map((N,z)=>(0,zo.jsxs)("div",{className:"flex items-center gap-1",children:[(0,zo.jsx)(Ga.ChevronRight,{className:"h-2 w-2"}),(0,zo.jsx)(Gt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>T(z),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,zo.jsxs)("span",{className:"relative",children:[N.name,(0,zo.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},N.id))]}),(0,zo.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,zo.jsx)(Gt.AnimatePresence,{mode:"wait",children:(0,zo.jsx)(Gt.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,zo.jsx)(rr,{data:f.data,onItemSelect:N=>C([...u,N]),colorScheme:r}):(0,zo.jsx)(ar,{capabilities:h,onSelect:R,colorScheme:r})},f?.id||"root")})})]}):(0,zo.jsxs)(A,{onClick:o,size:"sm",variant:"outline",className:"rounded-full",children:[(0,zo.jsx)(Ga.Menu,{className:"h-4 w-4"}),(0,zo.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function ar({capabilities:e,onSelect:t,colorScheme:o}){return(0,zo.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,s)=>(0,zo.jsx)(ir,{capability:a,onClick:()=>t(a),color:o.categories[s%o.categories.length]},a.id))})}function ir({capability:e,onClick:t,selected:o,color:a}){return(0,zo.jsxs)(Gt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:c("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",o&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,zo.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a)}),(0,zo.jsxs)("span",{className:"truncate relative",children:[e.name,(0,zo.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,zo.jsx)(Ga.ChevronRight,{className:c("h-3 w-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,zo.jsx)(ne,{variant:"secondary",className:c("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function rr({data:e,onItemSelect:t,colorScheme:o}){return(0,zo.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,s)=>(0,zo.jsxs)(Gt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:c("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(a),children:[(0,zo.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o.items[s%o.items.length])}),(0,zo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,zo.jsxs)("span",{className:"truncate relative font-medium",children:[a.title,(0,zo.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),a.subtitle&&(0,zo.jsx)("div",{className:c("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:a.subtitle})]}),a.value&&(0,zo.jsx)(ne,{variant:"secondary",className:c("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:a.value})]},a.id))})}var ya=require("date-fns");function va({taskId:e,polling:t=!0,system:o="payload"}){let[a,s]=(0,qa.useState)(null),[r,l]=(0,qa.useState)(!1),[n,p]=(0,qa.useState)(null),u=async(f=!0)=>{if(e){f&&l(!0);try{let h=await fetch(`/api/tasks/${e}`);if(!h.ok)throw new Error(`Failed to fetch task: ${h.statusText}`);let S=await h.json();s(S)}catch(h){console.error("Error fetching task:",h),p(h instanceof Error?h:new Error("Unknown error occurred"))}finally{f&&l(!1)}}},C=()=>u(!1);return(0,qa.useEffect)(()=>{e&&u(!0);let f=null;return e&&t&&(f=setInterval(C,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:a,loading:r,error:n}}var nr=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"}},sr=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function xa({data:e}){let{id:t,system:o,fetchLatest:a,taskData:s,error:r}=e||{};if(!t)return null;let l=null,n=!0,p=r,u=a!==void 0?a:!0;if(l=s||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:a,system:o,fetchLatest:u,taskData:l,error:p}),u){let{task:S,loading:I,error:R}=va({taskId:t,system:o});l=S,n=I,p=R}else n=!1;let C=nr(l?.status||"todo"),f=sr(l?.status||"todo"),h=l?.dateLogged||new Date().toISOString();try{let S=new Date(l?.dateLogged||"");isNaN(S.getTime())||(h=(0,ya.formatDistanceToNow)(S,{addSuffix:!0}))}catch{}return(0,zo.jsxs)(ve,{className:c("w-full max-w-md shadow-md",p&&"border border-destructive"),children:[(0,zo.jsxs)(Ee,{className:"pb-2",children:[(0,zo.jsxs)("div",{className:"flex justify-between items-start",children:[(0,zo.jsx)(ze,{className:"text-lg font-semibold",children:n?"Loading...":l?.name||"Task"}),(0,zo.jsx)(ne,{className:`${C}`,children:f})]}),l?.project&&(0,zo.jsxs)(co,{className:"text-sm text-gray-500",children:["Project: ",l.project.name]})]}),(0,zo.jsx)(De,{className:"pb-2",children:n?(0,zo.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):p?(0,zo.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,zo.jsx)("p",{className:"text-sm text-foreground",children:l?.description||"......."})}),(0,zo.jsx)(ht,{className:"pt-2 flex items-center justify-between",children:(0,zo.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,zo.jsx)(Ga.Clock,{className:"h-3 w-3 mr-1"}),(0,zo.jsxs)("span",{children:["Created ",h]}),(0,zo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,zo.jsxs)("span",{children:["Task #",t]})]})})]})}function Na({artefact:e,taskId:t,taskData:o,loading:a=!1,error:s=null}){let r=o||{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,ya.formatDistanceToNow)(n,{addSuffix:!0}))}catch{}return(0,zo.jsxs)(ve,{className:"w-full max-w-md shadow-md",children:[(0,zo.jsx)(Ee,{className:"pb-2",children:(0,zo.jsx)("div",{className:"flex justify-between items-start",children:(0,zo.jsx)(ze,{className:"text-lg font-semibold",children:a?"Loading...":r.name})})}),(0,zo.jsx)(De,{className:"pb-2",children:a?(0,zo.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):s?(0,zo.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,zo.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,zo.jsx)(ht,{className:"pt-2 flex items-center justify-between",children:(0,zo.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,zo.jsx)(Ga.Clock,{className:"h-3 w-3 mr-1"}),(0,zo.jsxs)("span",{children:["Created ",l]}),(0,zo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,zo.jsxs)("span",{children:["Task #",r.id]})]})})]})}var Pa=G(require("react"));var ka=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:a,description:s="This endpoint requires authentication to sync functions."})=>{let[r,l]=(0,qa.useState)(!1),[n,p]=(0,qa.useState)(""),u=()=>{if(!t){p("No authentication URL provided");return}l(!0),p("");try{let f=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!f){p("Popup blocked. Please allow popups for this site and try again."),l(!1);return}let h=setInterval(()=>{try{f.closed&&(clearInterval(h),l(!1),a(),o())}catch{}},1e3);setTimeout(()=>{f.closed||(f.close(),clearInterval(h),l(!1),p("Authentication timed out. Please try again."))},6e5)}catch{p("Failed to open authentication window"),l(!1)}},C=async()=>{try{await navigator.clipboard.writeText(t),p("")}catch{p("Failed to copy URL to clipboard")}};return e?(0,zo.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,zo.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,zo.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,zo.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s}),n&&(0,zo.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:n}),(0,zo.jsxs)("div",{className:"flex gap-2",children:[(0,zo.jsx)("button",{onClick:u,disabled:r||!t,className:`
7
7
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
8
- ${i||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
9
- `,children:i?"Authenticating...":"Authenticate"}),(0,Do.jsx)("button",{onClick:w,disabled:!t,className:`
8
+ ${r||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
9
+ `,children:r?"Authenticating...":"Authenticate"}),(0,zo.jsx)("button",{onClick:C,disabled:!t,className:`
10
10
  px-4 py-2 text-white border-none rounded text-sm
11
11
  ${t?"bg-blue-600 hover:bg-blue-700 cursor-pointer":"bg-gray-400 cursor-not-allowed"}
12
- `,children:"Copy URL"}),(0,Do.jsx)("button",{onClick:o,className:"px-4 py-2 bg-gray-500 hover:bg-gray-600 text-white border-none rounded text-sm cursor-pointer",children:"Cancel"})]})]})}):null};var oo=({toolPart:e,index:t,addToolResult:o})=>{let[a,s]=fa.default.useState(!0),i=()=>{o(e.input?.toolCallId,e.input?.tool,"Authentication completed"),s(!1)};switch(e.state){case"input-available":return(0,Do.jsxs)("div",{className:"mb-2",children:[(0,Do.jsx)(ga,{isOpen:a,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>s(!1),onSuccess:i,description:e.output?.reason||e.input?.reason}),!a&&(0,Do.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Do.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,Do.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Do.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,Do.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var ba=require("marked"),va=G(require("react-markdown"));function Ji(e){return ba.marked.lexer(e).map(o=>o.raw)}var ha=(0,Ba.memo)(({content:e})=>(0,Do.jsx)(va.default,{children:e}),(e,t)=>e.content===t.content);ha.displayName="MemoizedMarkdownBlock";var ao=(0,Ba.memo)(({content:e,id:t})=>(0,Ba.useMemo)(()=>Ji(e),[e]).map((a,s)=>(0,Do.jsx)(ha,{content:a},`${t}-block_${s}`)));ao.displayName="PartText";var ro=G(require("react"));var xa=({isOpen:e=!0,reason:t,onClose:o,onApprove:a,onDeny:s,title:i="Approval Required"})=>{let[l,n]=(0,Ba.useState)(!1),p=()=>{n(!0),a(),o()},u=()=>{n(!0),s(),o()},w=()=>{n(!0),s(),o()};return e?(0,Do.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full shadow-lg",children:[(0,Do.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:i}),(0,Do.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:t}),(0,Do.jsxs)("div",{className:"flex gap-2",children:[(0,Do.jsx)("button",{onClick:p,disabled:l,className:`
12
+ `,children:"Copy URL"}),(0,zo.jsx)("button",{onClick:o,className:"px-4 py-2 bg-gray-500 hover:bg-gray-600 text-white border-none rounded text-sm cursor-pointer",children:"Cancel"})]})]})}):null};var uo=({toolPart:e,index:t,addToolResult:o})=>{let[a,s]=Pa.default.useState(!0),r=()=>{o(e.input?.toolCallId,e.input?.tool,"Authentication completed"),s(!1)};switch(e.state){case"input-available":return(0,zo.jsxs)("div",{className:"mb-2",children:[(0,zo.jsx)(ka,{isOpen:a,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>s(!1),onSuccess:r,description:e.output?.reason||e.input?.reason}),!a&&(0,zo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,zo.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,zo.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,zo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,zo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var Ta=require("marked"),Da=G(require("react-markdown"));function lr(e){return Ta.marked.lexer(e).map(o=>o.raw)}var Ra=(0,qa.memo)(({content:e})=>(0,zo.jsx)(Da.default,{children:e}),(e,t)=>e.content===t.content);Ra.displayName="MemoizedMarkdownBlock";var go=(0,qa.memo)(({content:e,id:t})=>(0,qa.useMemo)(()=>lr(e),[e]).map((a,s)=>(0,zo.jsx)(Ra,{content:a},`${t}-block_${s}`)));go.displayName="PartText";var bo=G(require("react"));var Aa=({isOpen:e=!0,reason:t,onClose:o,onApprove:a,onDeny:s,title:r="Approval Required"})=>{let[l,n]=(0,qa.useState)(!1),p=()=>{n(!0),a(),o()},u=()=>{n(!0),s(),o()},C=()=>{n(!0),s(),o()};return e?(0,zo.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full shadow-lg",children:[(0,zo.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:r}),(0,zo.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:t}),(0,zo.jsxs)("div",{className:"flex gap-2",children:[(0,zo.jsx)("button",{onClick:p,disabled:l,className:`
13
13
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
14
14
  ${l?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
15
- `,children:l?"Processing...":"Approve"}),(0,Do.jsx)("button",{onClick:u,disabled:l,className:`
15
+ `,children:l?"Processing...":"Approve"}),(0,zo.jsx)("button",{onClick:u,disabled:l,className:`
16
16
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
17
17
  ${l?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
18
- `,children:l?"Processing...":"Deny"}),(0,Do.jsx)("button",{onClick:w,disabled:l,className:`
18
+ `,children:l?"Processing...":"Deny"}),(0,zo.jsx)("button",{onClick:C,disabled:l,className:`
19
19
  px-4 py-2 text-white border-none rounded text-sm
20
20
  ${l?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
21
- `,children:"Cancel"})]})]}):null};var wa=({toolPart:e,index:t,addToolResult:o})=>{let[a,s]=ro.default.useState(!0),[i,l]=ro.default.useState(null),n=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),s(!1),l("approve")},p=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),s(!1),l("deny")};switch(e.state){case"input-available":return(0,Do.jsxs)("div",{className:"mb-2",children:[(0,Do.jsx)(xa,{isOpen:a,onApprove:n,onDeny:p,onClose:()=>s(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,Do.jsxs)(Do.Fragment,{children:[i==="approve"&&(0,Do.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Do.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,Do.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Do.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),i==="deny"&&(0,Do.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Do.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,Do.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Do.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Do.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var so=require("@radix-ui/react-use-controllable-state");var nt=G(require("@radix-ui/react-collapsible")),Ca=nt.Root,Na=nt.CollapsibleTrigger,ka=nt.CollapsibleContent;var Da=require("streamdown"),no=(0,Ba.memo)(({className:e,...t})=>(0,Do.jsx)(Da.Streamdown,{className:c("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);no.displayName="Response";var Ra=(0,Ba.createContext)(null),Xi=()=>{let e=(0,Ba.useContext)(Ra);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},Qi=1e3,Yi=1e3,lo=(0,Ba.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:s,duration:i,children:l,...n})=>{let[p,u]=(0,so.useControllableState)({prop:o,defaultProp:a,onChange:s}),[w,f]=(0,so.useControllableState)({prop:i,defaultProp:0}),[h,R]=(0,Ba.useState)(!1),[M,T]=(0,Ba.useState)(null);(0,Ba.useEffect)(()=>{t?M===null&&T(Date.now()):M!==null&&(f(Math.ceil((Date.now()-M)/Yi)),T(null))},[t,M,f]),(0,Ba.useEffect)(()=>{if(a&&!t&&p&&!h){let P=setTimeout(()=>{u(!1),R(!0)},Qi);return()=>clearTimeout(P)}},[t,p,a,u,h]);let x=P=>{u(P)};return(0,Do.jsx)(Ra.Provider,{value:{isStreaming:t,isOpen:p,setIsOpen:u,duration:w},children:(0,Do.jsx)(Ca,{className:c("not-prose mb-4",e),onOpenChange:x,open:p,...n,children:l})})}),Zi=(e,t)=>e||t===0?(0,Do.jsx)("p",{children:"Thinking..."}):t===void 0?(0,Do.jsx)("p",{children:"Thought for a few seconds"}):(0,Do.jsxs)("p",{children:["Thought for ",t," seconds"]}),co=(0,Ba.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:s,duration:i}=Xi();return(0,Do.jsx)(Na,{className:c("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,Do.jsxs)(Do.Fragment,{children:[(0,Do.jsx)(Ma.BrainIcon,{className:"size-4"}),Zi(a,i),(0,Do.jsx)(Ma.ChevronDownIcon,{className:c("size-4 transition-transform",s?"rotate-180":"rotate-0")})]})})}),po=(0,Ba.memo)(({className:e,children:t,...o})=>(0,Do.jsx)(ka,{className:c("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-Ba-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:(0,Do.jsx)(no,{className:"grid gap-2",children:t})}));lo.displayName="Reasoning";co.displayName="ReasoningTrigger";po.displayName="ReasoningContent";function Sa({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:s,fileUploads:i,isDragOver:l,enableFileUpload:n,onInputChange:p,addToolResult:u,onSendMessage:w,onKeyPress:f,onFileUpload:h,onRemoveFile:R,onDragOver:M,className:T}){let x=(0,Ba.useRef)(null),P=(0,Ba.useRef)(null),F=(0,Ba.useRef)(null),[C,z]=(0,Ba.useState)(!1),[Y,Z]=(0,Ba.useState)({path:[],selectedItems:[],filters:{}});(0,Ba.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,Ba.useEffect)(()=>{C&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[C]);let ee=()=>eo(Y),Q=()=>{let m=[];return s.forEach(j=>{j.actions&&j.actions.forEach(K=>{m.push({label:K.label,action:()=>W(K.id,{path:[j],selectedItems:[],filters:{}})})}),j.children&&j.children.forEach(K=>{K.type==="list"&&K.data&&m.push({label:`View ${K.name}`,action:()=>z(!0)})})}),m.slice(0,5)},W=(m,j)=>{console.log("Capability action:",m,j);let K=`Executing ${m} with context: ${JSON.stringify(j.path.map(S=>S.name))}`;z(!1)},ae=eo({path:[],selectedItems:[],filters:{}}),le=m=>{h(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),h(m.dataTransfer.files)},E=m=>{if(m===0)return"0 Bytes";let j=1024,K=["Bytes","KB","MB","GB"],S=Math.floor(Math.log(m)/Math.log(j));return parseFloat((m/Math.pow(j,S)).toFixed(2))+" "+K[S]},B=m=>m.startsWith("image/")?(0,Do.jsx)(Ma.Image,{className:"h-4 w-4"}):m.startsWith("text/")?(0,Do.jsx)(Ma.FileText,{className:"h-4 w-4"}):(0,Do.jsx)(Ma.File,{className:"h-4 w-4"}),q=m=>{let j=m.role==="assistant",K=m.role==="user";return(0,Do.jsxs)("div",{className:c("flex my-2 items-start gap-3",K?"flex-row-reverse":""),children:[(0,Do.jsx)($e,{className:"h-8 w-8 shrink-0",children:(0,Do.jsx)(qe,{className:c(K?"bg-primary text-primary-foreground":"bg-gradient-Ba-br from-purple-600 Ba-blue-600 text-white"),children:K?(0,Do.jsx)(Ma.User,{className:"h-4 w-4"}):(0,Do.jsx)(Ma.Bot,{className:"h-4 w-4"})})}),(0,Do.jsx)("div",{className:c("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",K?"bg-primary text-primary-foreground":"bg-muted"),children:m.parts.map((S,$)=>{if(S.type==="text")return(0,Do.jsx)(ao,{id:m.id,content:S.text},`${m.id}-text`);if(S.type==="file"){let k=S;return(0,Do.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,Do.jsxs)("div",{className:"flex items-center gap-2",children:[B(k.mediaType||"application/octet-stream"),(0,Do.jsx)("div",{className:"flex-1 min-w-0",children:(0,Do.jsx)("p",{className:"text-sm font-medium truncate",children:k.filename||k.url?.split("/").pop()||"File"})}),k.url&&(0,Do.jsx)(A,{variant:"ghost",size:"sm",onClick:()=>window.open(k.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Do.jsx)(Ma.Download,{className:"h-4 w-4"})})]})},$)}if(S.type.startsWith("tool-")){let k=S,we=S.type.replace("tool-","");if(we==="task")switch(k.state){case"input-available":return(0,Do.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},$);case"output-available":return(0,Do.jsx)("div",{className:"mb-2",children:(0,Do.jsx)(da,{data:{id:k.output?.id||k.input?.id,fetchLatest:!1,taskData:k.output||k.input}})},$);case"output-error":return(0,Do.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",k.errorText]},$);default:return null}if(S.type==="tool-requestEndpointLogin")return(0,Do.jsx)("div",{className:"mb-2",children:(0,Do.jsx)(oo,{toolPart:k,index:$,addToolResult:u??(()=>{})})},$);if(S.type==="tool-authenticate")return(0,Do.jsx)("div",{className:"mb-2",children:(0,Do.jsx)(oo,{toolPart:k,index:$,addToolResult:u??(()=>{})})},$);if(S.type==="tool-requestApproval")return(0,Do.jsx)("div",{className:"mb-2",children:(0,Do.jsx)(wa,{toolPart:k,index:$,addToolResult:u??(()=>{})})},$);if(we==="artefact")switch(k.state){case"input-available":return(0,Do.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},$);case"output-available":return(0,Do.jsx)("div",{className:"mb-2",children:(0,Do.jsx)(ua,{artefact:k.output?.description||"",taskId:k.output?.id||k.input?.id,taskData:k.output||k.input})},$);case"output-error":return(0,Do.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",k.errorText]},$);default:return null}return(0,Do.jsx)("div",{className:"mb-2",children:(0,Do.jsxs)(be,{className:"w-full max-w-md",children:[(0,Do.jsx)(Be,{children:(0,Do.jsx)(Le,{className:"text-lg",children:we})}),(0,Do.jsxs)(Pe,{children:[k.state==="input-available"&&(0,Do.jsxs)("p",{className:"text-sm",children:["Processing ",we,"..."]}),k.state==="output-available"&&(0,Do.jsx)("pre",{className:"text-sm",children:JSON.stringify(k.output,null,2)}),k.state==="output-error"&&(0,Do.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",k.errorText]})]})]})},$)}if(S.type.startsWith("data-")){let k=S,we=S.type.replace("data-","");return we==="reference"?(0,Do.jsx)("div",{className:"mb-2",children:(0,Do.jsx)(be,{className:"w-full",children:(0,Do.jsx)(Pe,{className:"p-4",children:(0,Do.jsx)("div",{className:"space-y-2",children:k.data?.references?.map((de,Se)=>(0,Do.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,Do.jsx)(me,{variant:"outline",children:de.type||"link"}),(0,Do.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Do.jsx)("p",{className:"text-sm font-medium truncate",children:de.title}),de.description&&(0,Do.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:de.description})]}),de.url&&(0,Do.jsx)(A,{variant:"ghost",size:"sm",onClick:()=>window.open(de.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Do.jsx)(Ma.ExternalLink,{className:"h-4 w-4"})})]},Se))})})})},$):we==="menu"?(0,Do.jsx)("div",{className:"mb-2",children:(0,Do.jsxs)(be,{className:"w-full",children:[(0,Do.jsx)(Be,{children:(0,Do.jsx)(Le,{className:"text-lg",children:k.data?.title})}),(0,Do.jsx)(Pe,{children:(0,Do.jsx)("div",{className:"space-y-2",children:k.data?.items?.map((de,Se)=>(0,Do.jsx)(A,{variant:"outline",className:"w-full justify-start",onClick:de.action,children:(0,Do.jsxs)("div",{className:"text-left",children:[(0,Do.jsx)("p",{className:"font-medium",children:de.label}),de.description&&(0,Do.jsx)("p",{className:"text-xs text-muted-foreground",children:de.description})]})},Se))})})]})},$):(0,Do.jsx)("div",{className:"mb-2",children:(0,Do.jsxs)(be,{className:"w-full max-w-md",children:[(0,Do.jsx)(Be,{children:(0,Do.jsx)(Le,{className:"text-lg",children:we})}),(0,Do.jsx)(Pe,{children:(0,Do.jsx)("pre",{className:"text-sm",children:JSON.stringify(k.data,null,2)})})]})},$)}if(S.type==="reasoning")return(0,Do.jsxs)(lo,{className:"w-full",isStreaming:status==="streaming"&&$===m.parts.length-1&&m.id===e.at(-1)?.id,children:[(0,Do.jsx)(co,{}),(0,Do.jsx)(po,{children:S.text})]},`${m.id}-${$}`)})})]})};return(0,Do.jsxs)("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${T||""}`,children:[(0,Do.jsxs)(Ce,{ref:P,className:"flex-1 p-4 bg-background border-0",onDragOver:I,onDragLeave:Re,onDrop:d,children:[(0,Do.jsxs)("div",{className:c("space-y-4",l&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Do.jsx)(Ye.animate,{children:e.map(m=>(0,Do.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,Do.jsxs)(Ye.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Do.jsx)($e,{className:"h-8 w-8",children:(0,Do.jsx)(qe,{className:"bg-gradient-Ba-br from-purple-600 Ba-blue-600 text-white",children:(0,Do.jsx)(Ma.Bot,{className:"h-4 w-4"})})}),(0,Do.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Do.jsx)(na,{capabilities:s,isOpen:C,onToggle:()=>z(!C),onActionSelect:W,className:"w-full"})})]}),o&&(0,Do.jsxs)(Ye.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Do.jsx)($e,{className:"h-8 w-8",children:(0,Do.jsx)(qe,{className:"bg-gradient-Ba-br from-purple-600 Ba-blue-600 text-white",children:(0,Do.jsx)(Ma.Bot,{className:"h-4 w-4"})})}),(0,Do.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Do.jsxs)("div",{className:"flex space-x-1",children:[(0,Do.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Do.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Do.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Do.jsx)("div",{ref:x})]}),i.length>0&&(0,Do.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,Do.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(m=>(0,Do.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[B(m.file.type),(0,Do.jsx)("span",{className:"text-sm font-medium",children:m.file.name}),(0,Do.jsx)("span",{className:"text-xs text-muted-foreground",children:E(m.file.size)}),(0,Do.jsx)(A,{variant:"ghost",size:"sm",onClick:()=>R(m.id),className:"h-6 w-6 p-0",children:(0,Do.jsx)(Ma.Do,{className:"h-4 w-4"})})]},m.id))})}),(0,Do.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,Do.jsxs)("div",{className:"flex gap-3",children:[(0,Do.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:o}),n&&(0,Do.jsx)(A,{variant:"outline",size:"icon",onClick:()=>F.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Do.jsx)(Ma.Paperclip,{className:"h-4 w-4"})}),(0,Do.jsx)(A,{onClick:w,disabled:!t.trim()&&i.length===0||o,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Do.jsx)(Ma.Send,{className:"h-4 w-4"})})]}),(0,Do.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Do.jsxs)(A,{onClick:()=>z(!C),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Do.jsx)(Ma.Menu,{className:"h-3 w-3 mr-1"}),C?"Hide":"Show"," Capabilities"]}),(0,Do.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[ee().map((m,j)=>(0,Do.jsx)(A,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>W(m.id,Y),children:m.label},`context-${m.id}`)),ee().length===0&&Q().map((m,j)=>(0,Do.jsx)(A,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:m.action,children:m.label},`suggestion-${j}`))]})]}),n&&(0,Do.jsx)("input",{ref:F,type:"file",multiple:!0,onChange:le,className:"hidden"})]})]})}function Ia({aiConfig:e,useCustomChat:t,enableAI:o=!0,messages:a=[],businessUnits:s=[],capabilities:i=[],sidebarItems:l=[],notifications:n=[],sessions:p=[],onNewChat:u,onSessionSelect:w,onSessionDelete:f,onSessionEdit:h=()=>{},onBusinessUnitChange: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:Q=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:W="/headerlogo.png",appName:ae="Nuvia",tagline:le="AI-Powered Workspace",actionIcon:I=(0,Do.jsx)(Ma.Users,{className:"mr-2 h-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)}},B=(0,Aa.useChat)(E||{}),q=o?t||B:null,[m,j]=(0,Ba.useState)(""),[K,S]=(0,Ba.useState)(!1),$=q?.messages||a,k=m,we=q?.status==="submitted"||K,de=q?.addToolResult?(O,pe,ie)=>{q.addToolResult({tool:pe,toolCallId:O,output:ie}),q.sendMessage()}:()=>{},Se=s||[],La={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"},[Ea,za]=(0,Ba.useState)(()=>Se.length===0?La:Se.find(O=>O.id===F)||Se[0]),[lt,vt]=(0,Ba.useState)([]),[Ua,Fa]=(0,Ba.useState)(!1),ja=O=>{if(!O||!Z)return;let pe=[];Array.from(O).forEach(ie=>{if(ie.size>ee*1024*1024){alert(`File ${ie.name} is too large. Maximum size is ${ee}MB.`);return}if(Q.length>0&&!Q.some(ht=>ie.type.match(ht))){alert(`File type ${ie.type} is not allowed.`);return}let go={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:ie,status:"pending",progress:0};if(ie.type.startsWith("image/")){let ht=new FileReader;ht.onload=Wa=>{vt($a=>$a.map(Et=>Et.id===go.id?{...Et,preview:Wa.target?.result}:Et))},ht.readAsDataURL(ie)}pe.push(go)}),vt(ie=>[...ie,...pe])},Oa=O=>{vt(pe=>pe.filter(ie=>ie.id!==O))},uo=()=>{if(!(!k.trim()&&lt.length===0)){if(q){let O=lt.length>0?Ha(lt.map(pe=>pe.file)):void 0;q.sendMessage({text:k,files:O},{body:{timestamp:Date.now()}}),j("")}else console.log("Message Ba send:",k),console.log("Files Ba upload:",lt),j(""),S(!0),setTimeout(()=>{S(!1)},1500);vt([])}},Ha=O=>{let pe=new DataTransfer;return O.forEach(ie=>pe.items.add(ie)),pe.files},Va=O=>{O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),uo())},Ga=O=>{j(O)};return(0,Do.jsx)(oa,{sidebarItems:l||[],title:Y,notifications:n||[],businessUnits:Se,currentBusinessUnit:Ea,onBusinessUnitChange:O=>{O&&(za(O),R?.(O))},onSearch:P,showTabs:!1,onActionClick:x,actionIcon:I,actionText:Re,onNotificationRemove:M,onRemoveAll:T,logo:W,appName:ae,tagline:le,sidebarInitiallyClosed:d,children:(0,Do.jsx)(Lt.AnimatePresence,{mode:"wait",children:(0,Do.jsx)(Lt.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Do.jsxs)("div",{className:"h-full flex",children:[(0,Do.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,Do.jsx)(aa,{sessions:p||[],currentSession:C,teams:Se,onNewChat:u,onSessionSelect:w,onSessionEdit:h,onSessionDelete:f})}),(0,Do.jsx)("div",{className:"flex-1 h-full p-2",children:(0,Do.jsx)(Sa,{messages:$||[],input:k,isTyping:we,currentSessionTitle:C?.title,capabilities:i||[],onInputChange:Ga,addToolResult:de,onSendMessage:uo,onKeyPress:Va,fileUploads:lt,isDragOver:Ua,enableFileUpload:Z,onFileUpload:ja,onRemoveFile:Oa,onDragOver:Fa})})]})},"chat-interface")})})}var er=[{id:"1",role:"user",parts:[{type:"text",text:"Hello! Can you help me with a task?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:"Of course! I can help you with various tasks. Try uploading a file or use the capabilities menu at the bottom Ba see what I can do."}]}];function tr(){let[e,t]=(0,Ba.useState)(er);return(0,Do.jsx)("div",{className:"h-screen w-full",children:(0,Do.jsx)(Ia,{messages:e,capabilities:ra,enableFileUpload:!0,maxFileSize:10,allowedFileTypes:["*"],businessUnits:[],sessions:[],notifications:[],onNewChat:()=>t([]),onSessionSelect:()=>{},onSessionDelete:()=>{},showCapabilities:!0})})}0&&(module.exports={ChatDemo});
21
+ `,children:"Cancel"})]})]}):null};var Ia=({toolPart:e,index:t,addToolResult:o})=>{let[a,s]=bo.default.useState(!0),[r,l]=bo.default.useState(null),n=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),s(!1),l("approve")},p=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),s(!1),l("deny")};switch(e.state){case"input-available":return(0,zo.jsxs)("div",{className:"mb-2",children:[(0,zo.jsx)(Aa,{isOpen:a,onApprove:n,onDeny:p,onClose:()=>s(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,zo.jsxs)(zo.Fragment,{children:[r==="approve"&&(0,zo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,zo.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,zo.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,zo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),r==="deny"&&(0,zo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,zo.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,zo.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,zo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,zo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var vo=require("@radix-ui/react-use-controllable-state");var ct=G(require("@radix-ui/react-collapsible")),Ut=ct.Root,Ft=ct.CollapsibleTrigger,jt=ct.CollapsibleContent;var Ba=require("streamdown"),xt=(0,qa.memo)(({className:e,...t})=>(0,zo.jsx)(Ba.Streamdown,{className:c("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);xt.displayName="Response";var Ea=(0,qa.createContext)(null),cr=()=>{let e=(0,qa.useContext)(Ea);if(!e)throw new Error("Reasoning components must zo used within Reasoning");return e},dr=1e3,pr=1e3,ho=(0,qa.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:s,duration:r,children:l,...n})=>{let[p,u]=(0,vo.useControllableState)({prop:o,defaultProp:a,onChange:s}),[C,f]=(0,vo.useControllableState)({prop:r,defaultProp:0}),[h,S]=(0,qa.useState)(!1),[I,R]=(0,qa.useState)(null);(0,qa.useEffect)(()=>{t?I===null&&R(Date.now()):I!==null&&(f(Math.ceil((Date.now()-I)/pr)),R(null))},[t,I,f]),(0,qa.useEffect)(()=>{if(a&&!t&&p&&!h){let T=setTimeout(()=>{u(!1),S(!0)},dr);return()=>clearTimeout(T)}},[t,p,a,u,h]);let x=T=>{u(T)};return(0,zo.jsx)(Ea.Provider,{value:{isStreaming:t,isOpen:p,setIsOpen:u,duration:C},children:(0,zo.jsx)(Ut,{className:c("not-prose mb-4",e),onOpenChange:x,open:p,...n,children:l})})}),mr=(e,t)=>e||t===0?(0,zo.jsx)("p",{children:"Thinking..."}):t===void 0?(0,zo.jsx)("p",{children:"Thought for a few seconds"}):(0,zo.jsxs)("p",{children:["Thought for ",t," seconds"]}),yo=(0,qa.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:s,duration:r}=cr();return(0,zo.jsx)(Ft,{className:c("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,zo.jsxs)(zo.Fragment,{children:[(0,zo.jsx)(Ga.BrainIcon,{className:"size-4"}),mr(a,r),(0,zo.jsx)(Ga.ChevronDownIcon,{className:c("size-4 transition-transform",s?"rotate-180":"rotate-0")})]})})}),xo=(0,qa.memo)(({className:e,children:t,...o})=>(0,zo.jsx)(jt,{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),...o,children:(0,zo.jsx)(xt,{className:"grid gap-2",children:t})}));ho.displayName="Reasoning";yo.displayName="ReasoningTrigger";xo.displayName="ReasoningContent";var wo=require("react-syntax-highlighter"),Vt=require("react-syntax-highlighter/dist/esm/styles/prism"),ur=(0,qa.createContext)({code:""}),Wt=({code:e,language:t,showLineNumbers:o=!1,className:a,children:s,...r})=>(0,zo.jsx)(ur.Provider,{value:{code:e},children:(0,zo.jsx)("div",{className:c("relative w-full overflow-hidden rounded-md border bg-background text-foreground",a),...r,children:(0,zo.jsxs)("div",{className:"relative",children:[(0,zo.jsx)(wo.Prism,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:Vt.oneLight,children:e}),(0,zo.jsx)(wo.Prism,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:Vt.oneDark,children:e}),s&&(0,zo.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:s})]})})});var Ua=({className:e,...t})=>(0,zo.jsx)(Ut,{className:c("not-prose mb-4 w-full rounded-md border",e),...t}),gr=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,zo.jsxs)(ne,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,zo.jsx)(Ga.CircleIcon,{className:"size-4"}),"input-available":(0,zo.jsx)(Ga.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,zo.jsx)(Ga.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,zo.jsx)(Ga.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},Fa=({className:e,type:t,state:o,...a})=>(0,zo.jsxs)(Ft,{className:c("flex w-full items-center justify-between gap-4 p-3",e),...a,children:[(0,zo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zo.jsx)(Ga.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,zo.jsx)("span",{className:"font-medium text-sm",children:t}),gr(o)]}),(0,zo.jsx)(Ga.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),ja=({className:e,...t})=>(0,zo.jsx)(jt,{className:c("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Oa=({className:e,input:t,...o})=>(0,zo.jsxs)("div",{className:c("space-y-2 overflow-hidden p-4",e),...o,children:[(0,zo.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,zo.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,zo.jsx)(Wt,{code:JSON.stringify(t,null,2),language:"json"})})]}),Ha=({className:e,output:t,errorText:o,...a})=>{if(!(t||o))return null;let s=(0,zo.jsx)("div",{children:t});return typeof t=="object"?s=(0,zo.jsx)(Wt,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(s=(0,zo.jsx)(Wt,{code:t,language:"json"})),(0,zo.jsxs)("div",{className:c("space-y-2 p-4",e),...a,children:[(0,zo.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,zo.jsxs)("div",{className:c("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,zo.jsx)("div",{children:o}),s]})]})};function Va({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:s,fileUploads:r,isDragOver:l,enableFileUpload:n,onInputChange:p,addToolResult:u,onSendMessage:C,onKeyPress:f,onFileUpload:h,onRemoveFile:S,onDragOver:I,className:R}){let x=(0,qa.useRef)(null),T=(0,qa.useRef)(null),F=(0,qa.useRef)(null),[N,z]=(0,qa.useState)(!1),[Z,ee]=(0,qa.useState)({path:[],selectedItems:[],filters:{}});(0,qa.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,qa.useEffect)(()=>{N&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[N]);let te=()=>po(Z),Y=()=>{let m=[];return s.forEach(j=>{j.actions&&j.actions.forEach(_=>{m.push({label:_.label,action:()=>q(_.id,{path:[j],selectedItems:[],filters:{}})})}),j.children&&j.children.forEach(_=>{_.type==="list"&&_.data&&m.push({label:`View ${_.name}`,action:()=>z(!0)})})}),m.slice(0,5)},q=(m,j)=>{console.log("Capability action:",m,j);let _=`Executing ${m} with context: ${JSON.stringify(j.path.map(w=>w.name))}`;z(!1)},ie=po({path:[],selectedItems:[],filters:{}}),de=m=>{h(m.target.files),m.target.files&&(m.target.value="")},M=m=>{m.preventDefault(),I(!0)},Ae=m=>{m.preventDefault(),I(!1)},d=m=>{m.preventDefault(),I(!1),h(m.dataTransfer.files)},E=m=>{if(m===0)return"0 Bytes";let j=1024,_=["Bytes","KB","MB","GB"],w=Math.floor(Math.log(m)/Math.log(j));return parseFloat((m/Math.pow(j,w)).toFixed(2))+" "+_[w]},B=m=>m.startsWith("image/")?(0,zo.jsx)(Ga.Image,{className:"h-4 w-4"}):m.startsWith("text/")?(0,zo.jsx)(Ga.FileText,{className:"h-4 w-4"}):(0,zo.jsx)(Ga.File,{className:"h-4 w-4"}),K=m=>{let j=m.role==="assistant",_=m.role==="user";return(0,zo.jsxs)("div",{className:c("flex my-2 items-start gap-3",_?"flex-row-reverse":""),children:[(0,zo.jsx)(_e,{className:"h-8 w-8 shrink-0",children:(0,zo.jsx)(Je,{className:c(_?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:_?(0,zo.jsx)(Ga.User,{className:"h-4 w-4"}):(0,zo.jsx)(Ga.Bot,{className:"h-4 w-4"})})}),(0,zo.jsx)("div",{className:c("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",_?"bg-primary text-primary-foreground":"bg-muted"),children:m.parts.map((w,$)=>{if(w.type==="text")return(0,zo.jsx)(go,{id:m.id,content:w.text},`${m.id}-text`);if(w.type==="file"){let P=w;return(0,zo.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,zo.jsxs)("div",{className:"flex items-center gap-2",children:[B(P.mediaType||"application/octet-stream"),(0,zo.jsx)("div",{className:"flex-1 min-w-0",children:(0,zo.jsx)("p",{className:"text-sm font-medium truncate",children:P.filename||P.url?.split("/").pop()||"File"})}),P.url&&(0,zo.jsx)(A,{variant:"ghost",size:"sm",onClick:()=>window.open(P.url,"_blank"),className:"h-8 w-8 p-0",children:(0,zo.jsx)(Ga.Download,{className:"h-4 w-4"})})]})},$)}if(w.type.startsWith("tool-")){let P=w,Ne=w.type.replace("tool-","");if(Ne==="task")switch(P.state){case"input-available":return(0,zo.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},$);case"output-available":return(0,zo.jsx)("div",{className:"mb-2",children:(0,zo.jsx)(xa,{data:{id:P.output?.id||P.input?.id,fetchLatest:!1,taskData:P.output||P.input}})},$);case"output-error":return(0,zo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",P.errorText]},$);default:return null}if(w.type==="tool-requestEndpointLogin")return(0,zo.jsx)("div",{className:"mb-2",children:(0,zo.jsx)(uo,{toolPart:P,index:$,addToolResult:u??(()=>{})})},$);if(w.type==="tool-authenticate")return(0,zo.jsx)("div",{className:"mb-2",children:(0,zo.jsx)(uo,{toolPart:P,index:$,addToolResult:u??(()=>{})})},$);if(w.type==="tool-requestApproval")return(0,zo.jsx)("div",{className:"mb-2",children:(0,zo.jsx)(Ia,{toolPart:P,index:$,addToolResult:u??(()=>{})})},$);if(Ne==="artefact")switch(P.state){case"input-available":return(0,zo.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},$);case"output-available":return(0,zo.jsx)("div",{className:"mb-2",children:(0,zo.jsx)(Na,{artefact:P.output?.description||"",taskId:P.output?.id||P.input?.id,taskData:P.output||P.input})},$);case"output-error":return(0,zo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",P.errorText]},$);default:return null}return(0,zo.jsx)("div",{className:"mb-2",children:(0,zo.jsxs)(ve,{className:"w-full max-w-md",children:[(0,zo.jsx)(Ee,{children:(0,zo.jsx)(ze,{className:"text-lg",children:Ne})}),(0,zo.jsxs)(De,{children:[P.state==="input-available"&&(0,zo.jsxs)("p",{className:"text-sm",children:["Processing ",Ne,"..."]}),P.state==="output-available"&&(0,zo.jsx)("pre",{className:"text-sm",children:JSON.stringify(P.output,null,2)}),P.state==="output-error"&&(0,zo.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",P.errorText]})]})]})},$)}if(w.type.startsWith("data-")){let P=w,Ne=w.type.replace("data-","");return Ne==="reference"?(0,zo.jsx)("div",{className:"mb-2",children:(0,zo.jsx)(ve,{className:"w-full",children:(0,zo.jsx)(De,{className:"p-4",children:(0,zo.jsx)("div",{className:"space-y-2",children:P.data?.references?.map((me,Ie)=>(0,zo.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,zo.jsx)(ne,{variant:"outline",children:me.type||"link"}),(0,zo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,zo.jsx)("p",{className:"text-sm font-medium truncate",children:me.title}),me.description&&(0,zo.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:me.description})]}),me.url&&(0,zo.jsx)(A,{variant:"ghost",size:"sm",onClick:()=>window.open(me.url,"_blank"),className:"h-8 w-8 p-0",children:(0,zo.jsx)(Ga.ExternalLink,{className:"h-4 w-4"})})]},Ie))})})})},$):Ne==="menu"?(0,zo.jsx)("div",{className:"mb-2",children:(0,zo.jsxs)(ve,{className:"w-full",children:[(0,zo.jsx)(Ee,{children:(0,zo.jsx)(ze,{className:"text-lg",children:P.data?.title})}),(0,zo.jsx)(De,{children:(0,zo.jsx)("div",{className:"space-y-2",children:P.data?.items?.map((me,Ie)=>(0,zo.jsx)(A,{variant:"outline",className:"w-full justify-start",onClick:me.action,children:(0,zo.jsxs)("div",{className:"text-left",children:[(0,zo.jsx)("p",{className:"font-medium",children:me.label}),me.description&&(0,zo.jsx)("p",{className:"text-xs text-muted-foreground",children:me.description})]})},Ie))})})]})},$):(0,zo.jsx)("div",{className:"mb-2",children:(0,zo.jsxs)(ve,{className:"w-full max-w-md",children:[(0,zo.jsx)(Ee,{children:(0,zo.jsx)(ze,{className:"text-lg",children:Ne})}),(0,zo.jsx)(De,{children:(0,zo.jsx)("pre",{className:"text-sm",children:JSON.stringify(P.data,null,2)})})]})},$)}if(w.type==="reasoning")return(0,zo.jsxs)(ho,{className:"w-full",isStreaming:status==="streaming"&&$===m.parts.length-1&&m.id===e.at(-1)?.id,children:[(0,zo.jsx)(yo,{}),(0,zo.jsx)(xo,{children:w.text})]},`${m.id}-${$}`);if(w.type==="dynamic-tool")return(0,zo.jsxs)(Ua,{defaultOpen:!0,children:[(0,zo.jsx)(Fa,{type:`tool-${w.toolName}`,state:w.state}),(0,zo.jsxs)(ja,{children:[(0,zo.jsx)(Oa,{input:w.input}),(0,zo.jsx)(Ha,{output:(0,zo.jsx)(xt,{children:String(w.output)}),errorText:w.errorText})]})]},`${m.id}-${$}`)})})]})};return(0,zo.jsxs)("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${R||""}`,children:[(0,zo.jsxs)(ke,{ref:T,className:"flex-1 p-4 bg-background border-0",onDragOver:M,onDragLeave:Ae,onDrop:d,children:[(0,zo.jsxs)("div",{className:c("space-y-4",l&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,zo.jsx)(tt.animate,{children:e.map(m=>(0,zo.jsx)(tt.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:K(m)},m.id))}),N&&(0,zo.jsxs)(tt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,zo.jsx)(_e,{className:"h-8 w-8",children:(0,zo.jsx)(Je,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,zo.jsx)(Ga.Bot,{className:"h-4 w-4"})})}),(0,zo.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,zo.jsx)(ba,{capabilities:s,isOpen:N,onToggle:()=>z(!N),onActionSelect:q,className:"w-full"})})]}),o&&(0,zo.jsxs)(tt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,zo.jsx)(_e,{className:"h-8 w-8",children:(0,zo.jsx)(Je,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,zo.jsx)(Ga.Bot,{className:"h-4 w-4"})})}),(0,zo.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,zo.jsxs)("div",{className:"flex space-x-1",children:[(0,zo.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,zo.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,zo.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,zo.jsx)("div",{ref:x})]}),r.length>0&&(0,zo.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,zo.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(m=>(0,zo.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[B(m.file.type),(0,zo.jsx)("span",{className:"text-sm font-medium",children:m.file.name}),(0,zo.jsx)("span",{className:"text-xs text-muted-foreground",children:E(m.file.size)}),(0,zo.jsx)(A,{variant:"ghost",size:"sm",onClick:()=>S(m.id),className:"h-6 w-6 p-0",children:(0,zo.jsx)(Ga.zo,{className:"h-4 w-4"})})]},m.id))})}),(0,zo.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,zo.jsxs)("div",{className:"flex gap-3",children:[(0,zo.jsx)(gt,{value:t,onChange:m=>p(m.target.value),onKeyPress:f,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),n&&(0,zo.jsx)(A,{variant:"outline",size:"icon",onClick:()=>F.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,zo.jsx)(Ga.Paperclip,{className:"h-4 w-4"})}),(0,zo.jsx)(A,{onClick:C,disabled:!t.trim()&&r.length===0||o,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,zo.jsx)(Ga.Send,{className:"h-4 w-4"})})]}),(0,zo.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,zo.jsxs)(A,{onClick:()=>z(!N),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,zo.jsx)(Ga.Menu,{className:"h-3 w-3 mr-1"}),N?"Hide":"Show"," Capabilities"]}),(0,zo.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[te().map((m,j)=>(0,zo.jsx)(A,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>q(m.id,Z),children:m.label},`context-${m.id}`)),te().length===0&&Y().map((m,j)=>(0,zo.jsx)(A,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:m.action,children:m.label},`suggestion-${j}`))]})]}),n&&(0,zo.jsx)("input",{ref:F,type:"file",multiple:!0,onChange:de,className:"hidden"})]})]})}function $a({aiConfig:e,useCustomChat:t,enableAI:o=!0,messages:a=[],businessUnits:s=[],capabilities:r=[],sidebarItems:l=[],notifications:n=[],sessions:p=[],onNewChat:u,onSessionSelect:C,onSessionDelete:f,onSessionEdit:h=()=>{},onBusinessUnitChange:S=()=>{},onNotificationRemove:I=()=>{},onRemoveAll:R=()=>{},onActionClick:x=()=>{},onSearch:T=E=>console.log("Search query:",E),initialTeam:F="design",currentSession:N=null,showCapabilities:z=!0,title:Z="Digital Colleagues",enableFileUpload:ee=!0,maxFileSize:te=10,allowedFileTypes:Y=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:q="/headerlogo.png",appName:ie="Nuvia",tagline:de="AI-Powered Workspace",actionIcon:M=(0,zo.jsx)(Ga.Users,{className:"mr-2 h-4 w-4"}),actionText:Ae="Collaborate",sidebarInitiallyClosed:d=!1}){let E={...e,onError:O=>{K?.setMessages(ue=>[...ue,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:O.message}]}]),console.error("Error in CopilotInterface:",O)}},B=(0,Wa.useChat)(E||{}),K=o?t||B:null,[m,j]=(0,qa.useState)(""),[_,w]=(0,qa.useState)(!1),$=K?.messages||a,P=m,Ne=K?.status==="submitted"||_,me=K?.addToolResult?(O,ue,re)=>{K.addToolResult({tool:ue,toolCallId:O,output:re}),K.sendMessage()}:()=>{},Ie=s||[],Ka={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"},[_a,Ja]=(0,qa.useState)(()=>Ie.length===0?Ka:Ie.find(O=>O.id===F)||Ie[0]),[pt,wt]=(0,qa.useState)([]),[Xa,Qa]=(0,qa.useState)(!1),Ya=O=>{if(!O||!ee)return;let ue=[];Array.from(O).forEach(re=>{if(re.size>te*1024*1024){alert(`File ${re.name} is too large. Maximum size is ${te}MB.`);return}if(Y.length>0&&!Y.some(Ct=>re.type.match(Ct))){alert(`File type ${re.type} is not allowed.`);return}let ko={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:re,status:"pending",progress:0};if(re.type.startsWith("image/")){let Ct=new FileReader;Ct.onload=ai=>{wt(ii=>ii.map($t=>$t.id===ko.id?{...$t,preview:ai.target?.result}:$t))},Ct.readAsDataURL(re)}ue.push(ko)}),wt(re=>[...re,...ue])},Za=O=>{wt(ue=>ue.filter(re=>re.id!==O))},No=()=>{if(!(!P.trim()&&pt.length===0)){if(K){let O=pt.length>0?ei(pt.map(ue=>ue.file)):void 0;K.sendMessage({text:P,files:O},{body:{timestamp:Date.now()}}),j("")}else console.log("Message to send:",P),console.log("Files to upload:",pt),j(""),w(!0),setTimeout(()=>{w(!1)},1500);wt([])}},ei=O=>{let ue=new DataTransfer;return O.forEach(re=>ue.items.add(re)),ue.files},ti=O=>{O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),No())},oi=O=>{j(O)};return(0,zo.jsx)(ma,{sidebarItems:l||[],title:Z,notifications:n||[],businessUnits:Ie,currentBusinessUnit:_a,onBusinessUnitChange:O=>{O&&(Ja(O),S?.(O))},onSearch:T,showTabs:!1,onActionClick:x,actionIcon:M,actionText:Ae,onNotificationRemove:I,onRemoveAll:R,logo:q,appName:ie,tagline:de,sidebarInitiallyClosed:d,children:(0,zo.jsx)(Gt.AnimatePresence,{mode:"wait",children:(0,zo.jsx)(Gt.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,zo.jsxs)("div",{className:"h-full flex",children:[(0,zo.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,zo.jsx)(ua,{sessions:p||[],currentSession:N,teams:Ie,onNewChat:u,onSessionSelect:C,onSessionEdit:h,onSessionDelete:f})}),(0,zo.jsx)("div",{className:"flex-1 h-full p-2",children:(0,zo.jsx)(Va,{messages:$||[],input:P,isTyping:Ne,currentSessionTitle:N?.title,capabilities:r||[],onInputChange:oi,addToolResult:me,onSendMessage:No,onKeyPress:ti,fileUploads:pt,isDragOver:Xa,enableFileUpload:ee,onFileUpload:Ya,onRemoveFile:Za,onDragOver:Qa})})]})},"chat-interface")})})}var fr=[{id:"1",role:"user",parts:[{type:"text",text:"Hello! Can you help me with a task?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:"Of course! I can help you with various tasks. Try uploading a file or use the capabilities menu at the bottom to see what I can do."}]}];function br(){let[e,t]=(0,qa.useState)(fr);return(0,zo.jsx)("div",{className:"h-screen w-full",children:(0,zo.jsx)($a,{messages:e,capabilities:fa,enableFileUpload:!0,maxFileSize:10,allowedFileTypes:["*"],businessUnits:[],sessions:[],notifications:[],onNewChat:()=>t([]),onSessionSelect:()=>{},onSessionDelete:()=>{},showCapabilities:!0})})}0&&(module.exports={ChatDemo});