cortex-react-components 2.13.14 → 2.15.0

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