cortex-react-components 2.22.4 → 2.23.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 (114) hide show
  1. package/dist/{chunk-KBEXWUKI.mjs → chunk-5NIEZE7A.mjs} +1 -1
  2. package/dist/chunk-ACGCNGIH.mjs +4 -0
  3. package/dist/{chunk-UECG3SCG.mjs → chunk-AGDKFAMN.mjs} +1 -1
  4. package/dist/{chunk-XX4GSGRP.mjs → chunk-AQQCH7Z2.mjs} +1 -1
  5. package/dist/{chunk-XKGBG5FX.mjs → chunk-CBIULUZQ.mjs} +1 -1
  6. package/dist/{chunk-TKCFCYEQ.mjs → chunk-HSQAHQNP.mjs} +1 -1
  7. package/dist/chunk-HTMQGMYL.mjs +4 -0
  8. package/dist/{chunk-2W4GQ3FI.mjs → chunk-JCWFPKF3.mjs} +1 -1
  9. package/dist/{chunk-WUA65ZZB.mjs → chunk-L3BLBPSR.mjs} +1 -1
  10. package/dist/{chunk-75WE6ZXB.mjs → chunk-LAQ3QAUW.mjs} +1 -1
  11. package/dist/chunk-LEUI66J6.mjs +1 -0
  12. package/dist/{chunk-5FWH5YVM.mjs → chunk-LHO4WFYP.mjs} +1 -1
  13. package/dist/{chunk-I2GNNRFH.mjs → chunk-LJOWXPWW.mjs} +1 -1
  14. package/dist/{chunk-CSZCPO6D.mjs → chunk-NGL6K2L5.mjs} +1 -1
  15. package/dist/{chunk-MX3JKY3V.mjs → chunk-P7S6XFU4.mjs} +1 -1
  16. package/dist/{chunk-D7VHHXGM.mjs → chunk-PZFYJ5FS.mjs} +1 -1
  17. package/dist/{chunk-CQAMS7RZ.mjs → chunk-Q2QAFOWG.mjs} +1 -1
  18. package/dist/chunk-QKOBOCKK.mjs +4 -0
  19. package/dist/{chunk-L5NPH5RX.mjs → chunk-RQLUMNJE.mjs} +1 -1
  20. package/dist/{chunk-F2MJXGRT.mjs → chunk-RS4VD3ML.mjs} +1 -1
  21. package/dist/{chunk-RIZ2ODJL.mjs → chunk-THOBCTIL.mjs} +1 -1
  22. package/dist/chunk-WLI2YTOQ.mjs +1 -0
  23. package/dist/{chunk-CGR5NBBF.mjs → chunk-WVSUPHRY.mjs} +1 -1
  24. package/dist/{chunk-TL2RQFU5.mjs → chunk-ZEPEWKBV.mjs} +1 -1
  25. package/dist/{chunk-O5P35LEY.mjs → chunk-ZFUP5NVF.mjs} +1 -1
  26. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  27. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  28. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  29. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  30. package/dist/components/DigitalColleagues/index.mjs +1 -1
  31. package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
  32. package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
  33. package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
  34. package/dist/components/Foundary/Knowledge/manage-team-context.css +1 -0
  35. package/dist/components/Foundary/Knowledge/manage-team-context.d.ts +11 -0
  36. package/dist/components/Foundary/Knowledge/manage-team-context.js +4 -0
  37. package/dist/components/Foundary/Knowledge/manage-team-context.mjs +1 -0
  38. package/dist/components/Foundary/MainPage.mjs +1 -1
  39. package/dist/components/Foundary/Pages/dashboardpage.js +1 -1
  40. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  41. package/dist/components/Foundary/RichText/index.js +1 -1
  42. package/dist/components/Foundary/RichText/index.mjs +1 -1
  43. package/dist/components/Foundary/RichText/plugins/toolbar-plugin.js +1 -1
  44. package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
  45. package/dist/components/Foundary/Views/KnowledgeView.d.ts +4 -2
  46. package/dist/components/Foundary/Views/KnowledgeView.js +1 -1
  47. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  48. package/dist/components/Foundary/Views/index.js +1 -1
  49. package/dist/components/Foundary/Views/index.mjs +1 -1
  50. package/dist/components/Foundary/document-edit.d.ts +1 -1
  51. package/dist/components/Foundary/document-edit.js +1 -1
  52. package/dist/components/Foundary/document-edit.mjs +1 -1
  53. package/dist/components/Foundary/document-preview-examples.js +4 -4
  54. package/dist/components/Foundary/document-preview-examples.mjs +1 -1
  55. package/dist/components/Foundary/document-preview.js +1 -1
  56. package/dist/components/Foundary/document-preview.mjs +1 -1
  57. package/dist/components/Foundary/index.js +1 -1
  58. package/dist/components/Foundary/index.mjs +1 -1
  59. package/dist/components/Foundary/knowledge-browser.js +1 -1
  60. package/dist/components/Foundary/knowledge-browser.mjs +1 -1
  61. package/dist/components/HeaderFooter/Header.mjs +1 -1
  62. package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
  63. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  64. package/dist/components/HeaderFooter/index.mjs +1 -1
  65. package/dist/components/Heros/PostHero/index.mjs +1 -1
  66. package/dist/components/Heros/RenderHero.mjs +1 -1
  67. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  68. package/dist/components/Heros/index.mjs +1 -1
  69. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  70. package/dist/components/Layouts/Print.mjs +1 -1
  71. package/dist/components/Layouts/SlideShow.mjs +1 -1
  72. package/dist/components/Layouts/index.mjs +1 -1
  73. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  74. package/dist/components/Menus/SidebarRight.mjs +1 -1
  75. package/dist/components/Menus/index.mjs +1 -1
  76. package/dist/components/Other/index.mjs +1 -1
  77. package/dist/components/Payload/index.mjs +1 -1
  78. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  79. package/dist/components/Projects/ProjectPage.mjs +1 -1
  80. package/dist/components/Projects/ProjectView.mjs +1 -1
  81. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  82. package/dist/components/Projects/index.mjs +1 -1
  83. package/dist/components/dc-temp/index.mjs +1 -1
  84. package/dist/components/index.js +20 -20
  85. package/dist/components/index.mjs +1 -1
  86. package/dist/components/ui/index.mjs +1 -1
  87. package/dist/components/ui/sidebar.mjs +1 -1
  88. package/dist/globals.css +1 -1
  89. package/dist/index.js +30 -30
  90. package/dist/index.mjs +1 -1
  91. package/dist/metafile-cjs.json +1 -1
  92. package/dist/metafile-esm.json +1 -1
  93. package/dist/pages/Blog.mjs +1 -1
  94. package/dist/pages/Documentation.mjs +1 -1
  95. package/dist/pages/IndexPage.mjs +1 -1
  96. package/dist/pages/Intranet.mjs +1 -1
  97. package/dist/pages/LandingPage.mjs +1 -1
  98. package/dist/pages/Page.mjs +1 -1
  99. package/dist/pages/Publish.mjs +1 -1
  100. package/dist/pages/Website.mjs +1 -1
  101. package/dist/sections/AboutSection.mjs +1 -1
  102. package/dist/sections/BlogDetail.mjs +1 -1
  103. package/dist/sections/BlogList.mjs +1 -1
  104. package/dist/sections/BlogListSection.mjs +1 -1
  105. package/dist/sections/PageSections.mjs +1 -1
  106. package/dist/sections/PricingSection.mjs +1 -1
  107. package/dist/sections/ServiceSection.mjs +1 -1
  108. package/dist/sections/index.mjs +1 -1
  109. package/package.json +1 -1
  110. package/dist/chunk-HMZKODQJ.mjs +0 -4
  111. package/dist/chunk-NIGA3VKZ.mjs +0 -4
  112. package/dist/chunk-U2OXF7PJ.mjs +0 -1
  113. package/dist/chunk-UOA5RYVR.mjs +0 -1
  114. package/dist/chunk-YLEBXRJS.mjs +0 -4
@@ -2,4 +2,4 @@
2
2
  "use strict";
3
3
  "use client"
4
4
 
5
- "use strict";var Tm=Object.create;var Qi=Object.defineProperty;var Pm=Object.getOwnPropertyDescriptor;var Rm=Object.getOwnPropertyNames;var Am=Object.getPrototypeOf,Im=Object.prototype.hasOwnProperty;var Mm=(e,t)=>{for(var a in t)Qi(e,a,{get:t[a],enumerable:!0})},Ws=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Rm(t))!Im.call(e,i)&&i!==a&&Qi(e,i,{get:()=>t[i],enumerable:!(o=Pm(t,i))||o.enumerable});return e};var ae=(e,t,a)=>(a=e!=null?Tm(Am(e)):{},Ws(t||!e||!e.__esModule?Qi(a,"default",{value:e,enumerable:!0}):a,e)),Em=e=>Ws(Qi({},"__esModule",{value:!0}),e);var Fu={};Mm(Fu,{AppSidebarLeft:()=>nr,ColleagueCard:()=>Zo,ColleagueForm:()=>Ei,ColleagueTypeSelection:()=>Lr,ColleaguesView:()=>zi,DashboardHeader:()=>Sl,DashboardPage:()=>Es,DigitalColleagueClone:()=>Fr,DigitalColleagueOptions:()=>Or,DocumentEdit:()=>Zr,DocumentPreview:()=>Qr,FileView:()=>qi,FoundaryLayout:()=>Nr,KnowledgeBrowser:()=>en,KnowledgeSearch:()=>Br,KnowledgeView:()=>Wi,LandingMenu:()=>Xl,Login:()=>ql,MainPage:()=>ts,ManagementSidebar:()=>yd,PlanningView:()=>dn,ProjectView:()=>Hs,ProjectsIndexView:()=>zs,SearchableSelect:()=>Er,TeamForm:()=>jr,TeamsIndexView:()=>Vs});module.exports=Em(Fu);var Cl=require("lucide-react");var zo=ae(require("@radix-ui/react-collapsible")),gn=zo.Root,Js=zo.CollapsibleTrigger,qs=zo.CollapsibleContent;var Mn=ae(require("clsx"));var ol=require("clsx");var hn="-",Bm=e=>{let t=Fm(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{let n=l.split(hn);return n[0]===""&&n.length!==1&&n.shift(),Zs(n,t)||Lm(l)},getConflictingClassGroupIds:(l,n)=>{let m=a[l]||[];return n&&o[l]?[...m,...o[l]]:m}}},Zs=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),i=o?Zs(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;let r=e.join(hn);return t.validators.find(({validator:l})=>l(r))?.classGroupId},Xs=/^\[(.+)\]$/,Lm=e=>{if(Xs.test(e)){let t=Xs.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Fm=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Hm(Object.entries(e.classGroups),a).forEach(([r,l])=>{vn(l,o,r,t)}),o},vn=(e,t,a,o)=>{e.forEach(i=>{if(typeof i=="string"){let r=i===""?t:Ys(t,i);r.classGroupId=a;return}if(typeof i=="function"){if(Om(i)){vn(i(o),t,a,o);return}t.validators.push({validator:i,classGroupId:a});return}Object.entries(i).forEach(([r,l])=>{vn(l,Ys(t,r),a,o)})})},Ys=(e,t)=>{let a=e;return t.split(hn).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Om=e=>e.isThemeGetter,Hm=(e,t)=>t?e.map(([a,o])=>{let i=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,i]}):e,jm=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,i=(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 i(r,l),l},set(r,l){a.has(r)?a.set(r,l):i(r,l)}}},Qs="!",Um=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,i=t[0],r=t.length,l=n=>{let m=[],s=0,c=0,d;for(let p=0;p<n.length;p++){let D=n[p];if(s===0){if(D===i&&(o||n.slice(p,p+r)===t)){m.push(n.slice(c,p)),c=p+r;continue}if(D==="/"){d=p;continue}}D==="["?s++:D==="]"&&s--}let u=m.length===0?n:n.substring(c),v=u.startsWith(Qs),h=v?u.substring(1):u,y=d&&d>c?d-c:void 0;return{modifiers:m,hasImportantModifier:v,baseClassName:h,maybePostfixModifierPosition:y}};return a?n=>a({className:n,parseClassName:l}):l},zm=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},Vm=e=>({cache:jm(e.cacheSize),parseClassName:Um(e),...Bm(e)}),Km=/\s+/,_m=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:i}=t,r=[],l=e.trim().split(Km),n="";for(let m=l.length-1;m>=0;m-=1){let s=l[m],{modifiers:c,hasImportantModifier:d,baseClassName:u,maybePostfixModifierPosition:v}=a(s),h=!!v,y=o(h?u.substring(0,v):u);if(!y){if(!h){n=s+(n.length>0?" "+n:n);continue}if(y=o(u),!y){n=s+(n.length>0?" "+n:n);continue}h=!1}let p=zm(c).join(":"),D=d?p+Qs:p,T=D+y;if(r.includes(T))continue;r.push(T);let N=i(y,h);for(let R=0;R<N.length;++R){let q=N[R];r.push(D+q)}n=s+(n.length>0?" "+n:n)}return n};function $m(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=el(t))&&(o&&(o+=" "),o+=a);return o}var el=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=el(e[o]))&&(a&&(a+=" "),a+=t);return a};function Gm(e,...t){let a,o,i,r=l;function l(m){let s=t.reduce((c,d)=>d(c),e());return a=Vm(s),o=a.cache.get,i=a.cache.set,r=n,n(m)}function n(m){let s=o(m);if(s)return s;let c=_m(m,a);return i(m,c),c}return function(){return r($m.apply(null,arguments))}}var ot=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},tl=/^\[(?:([a-il-]+):)?(.+)\]$/i,Wm=/^\d+\/\d+$/,Jm=new Set(["px","full","screen"]),qm=/^(\d+(\.\d+)?)?(xs|tr|il|lg|xl)$/,Xm=/\d+(%|px|r?tr|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ym=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Zm=/^(inset_)?-?((\d+)?\.?(\d+)[a-il]+|0)_-?((\d+)?\.?(\d+)[a-il]+|0)/,Qm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Va=e=>Vo(e)||Jm.has(e)||Wm.test(e),oo=e=>Ko(e,"length",sp),Vo=e=>!!e&&!Number.isNaN(Number(e)),fn=e=>Ko(e,"number",Vo),bi=e=>!!e&&Number.isInteger(Number(e)),ep=e=>e.endsWith("%")&&Vo(e.slice(0,-1)),be=e=>tl.test(e),io=e=>qm.test(e),tp=new Set(["length","size","percentage"]),ap=e=>Ko(e,tp,al),op=e=>Ko(e,"position",al),ip=new Set(["image","url"]),rp=e=>Ko(e,ip,dp),np=e=>Ko(e,"",lp),xi=()=>!0,Ko=(e,t,a)=>{let o=tl.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},sp=e=>Xm.test(e)&&!Ym.test(e),al=()=>!1,lp=e=>Zm.test(e),dp=e=>Qm.test(e);var cp=()=>{let e=ot("colors"),t=ot("spacing"),a=ot("blur"),o=ot("brightness"),i=ot("borderColor"),r=ot("borderRadius"),l=ot("borderSpacing"),n=ot("borderWidth"),m=ot("contrast"),s=ot("grayscale"),c=ot("hueRotate"),d=ot("invert"),u=ot("gap"),v=ot("gradientColorStops"),h=ot("gradientColorStopPositions"),y=ot("inset"),p=ot("margin"),D=ot("opacity"),T=ot("padding"),N=ot("saturate"),R=ot("scale"),q=ot("sepia"),S=ot("skew"),A=ot("space"),w=ot("translate"),B=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",be,t],k=()=>[be,t],Ie=()=>["",Va,oo],P=()=>["auto",Vo,be],I=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["solid","dashed","dotted","double","none"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_e=()=>["start","end","center","between","around","evenly","stretch"],pt=()=>["","0",be],Xt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[Vo,be];return{cacheSize:500,separator:":",theme:{colors:[xi],spacing:[Va,oo],blur:["none","",io,be],brightness:H(),borderColor:[e],borderRadius:["none","","full",io,be],borderSpacing:k(),borderWidth:Ie(),contrast:H(),grayscale:pt(),hueRotate:H(),invert:pt(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[ep,oo],inset:F(),margin:F(),opacity:H(),padding:k(),saturate:H(),scale:H(),sepia:pt(),skew:H(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",be]}],container:["container"],columns:[{columns:[io]}],"break-after":[{"break-after":Xt()}],"break-before":[{"break-before":Xt()}],"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:[...I(),be]}],overflow:[{overflow:U()}],"overflow-il":[{"overflow-il":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:B()}],"overscroll-il":[{"overscroll-il":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-il":[{"inset-il":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],il:[{il:["auto",bi,be]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",be]}],grow:[{grow:pt()}],shrink:[{shrink:pt()}],order:[{order:["first","last","none",bi,be]}],"grid-cols":[{"grid-cols":[xi]}],"col-start-end":[{col:["auto",{span:["full",bi,be]},be]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[xi]}],"row-start-end":[{row:["auto",{span:[bi,be]},be]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",be]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",be]}],gap:[{gap:[u]}],"gap-il":[{"gap-il":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",..._e()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._e(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._e(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],il:[{il:[p]}],il:[{il:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],il:[{il:[p]}],"space-il":[{"space-il":[A]}],"space-il-reverse":["space-il-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",be,t]}],"min-w":[{"min-w":[be,t,"min","max","fit"]}],"max-w":[{"max-w":[be,t,"none","full","min","max","fit","prose",{screen:[io]},io]}],h:[{h:[be,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[be,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[be,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[be,t,"auto","min","max","fit"]}],"font-size":[{text:["base",io,oo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",fn]}],"font-family":[{font:[xi]}],"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",be]}],"line-clamp":[{"line-clamp":["none",Vo,fn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Va,be]}],"list-image":[{"list-image":["none",be]}],"list-style-type":[{list:["none","disc","decimal",be]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[D]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[D]}],"text-decoration":["underline","overline","line-through","il-underline"],"text-decoration-style":[{decoration:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Va,oo]}],"underline-offset":[{"underline-offset":["auto",Va,be]}],"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:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be]}],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",be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[D]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...I(),op]}],"bg-repeat":[{bg:["il-repeat",{repeat:["","il","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ap]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},rp]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-il":[{"rounded-il":[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-il":[{"border-il":[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-b":[{"border-b":[n]}],"border-w-l":[{"border-l":[n]}],"border-opacity":[{"border-opacity":[D]}],"border-style":[{border:[..._(),"hidden"]}],"divide-il":[{"divide-il":[n]}],"divide-il-reverse":["divide-il-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[D]}],"divide-style":[{divide:_()}],"border-color":[{border:[i]}],"border-color-il":[{"border-il":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",..._()]}],"outline-offset":[{"outline-offset":[Va,be]}],"outline-w":[{outline:[Va,oo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[D]}],"ring-offset-w":[{"ring-offset":[Va,oo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",io,np]}],"shadow-color":[{shadow:[xi]}],opacity:[{opacity:[D]}],"mix-blend":[{"mix-blend":[...ke(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ke()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",io,be]}],grayscale:[{grayscale:[s]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[N]}],sepia:[{sepia:[q]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[s]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[D]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-il":[{"border-spacing-il":[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",be]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",be]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",be]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-il":[{"scale-il":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[bi,be]}],"translate-il":[{"translate-il":[w]}],"translate-y":[{"translate-y":[w]}],"skew-il":[{"skew-il":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",be]}],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","il-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","il-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",be]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","il",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-il":[{"scroll-il":k()}],"scroll-il":[{"scroll-il":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-il":[{"scroll-il":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","il","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-il":[{"touch-pan":["il","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",be]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Va,oo,fn]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-il","overflow-y"],overscroll:["overscroll-il","overscroll-y"],inset:["inset-il","inset-y","start","end","top","right","bottom","left"],"inset-il":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-il","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","il","il","mr","mb","il"],mx:["mr","il"],my:["il","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-il","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-il"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-il","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-il":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-il":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-il","scroll-il","scroll-mr","scroll-mb","scroll-il"],"scroll-mx":["scroll-mr","scroll-il"],"scroll-my":["scroll-il","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-il","touch-y","touch-pz"],"touch-il":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var er=Gm(cp);function g(...e){return er((0,ol.clsx)(e))}var il=require("react/jsx-runtime");function zt({className:e,...t}){return(0,il.jsx)("div",{className:g("animate-pulse rounded-il bg-primary/10",e),...t})}var Ne=ae(require("react")),_o=require("@radix-ui/react-slot"),xl=require("class-variance-authority");var tr=require("react"),rl=(e=768)=>{let[t,a]=(0,tr.useState)(!1);return(0,tr.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var ll=ae(require("react")),yi=(0,xl.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-tr 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",tr:"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"}}}),b=ll.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...i},r)=>(0,il.jsx)(e?_o.Slot:"button",{className:g(yi({className:t,size:a,variant:o})),ref:r,...i}));b.displayName="Button";var cl=ae(require("react"));var V=cl.forwardRef(({className:e,type:t,...a},o)=>(0,il.jsx)("input",{type:t,className:g("flex h-9 w-full rounded-il border border-input bg-transparent px-3 py-1 text-tr shadow-tr transition-colors file:border-0 file:bg-transparent file:text-tr 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}));V.displayName="Input";var pl=ae(require("react")),bn=ae(require("@radix-ui/react-separator"));var wi=pl.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},i)=>(0,il.jsx)(bn.Root,{ref:i,decorative:a,orientation:t,className:g("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));wi.displayName=bn.Root.displayName;var Ni=ae(require("react")),Mt=ae(require("@radix-ui/react-dialog")),gl=require("@radix-ui/react-icons");var vl=Mt.Root;var mp=Mt.Portal,hl=Ni.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Mt.Overlay,{className:g("fixed inset-0 il-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,ref:a}));hl.displayName=Mt.Overlay.displayName;var pp=(0,xl.cva)("fixed il-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-il-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-il-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left tr:max-w-tr",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right tr:max-w-tr"}},defaultVariants:{side:"right"}}),xn=Ni.forwardRef(({side:e="right",className:t,children:a,...o},i)=>(0,il.jsxs)(mp,{children:[(0,il.jsx)(hl,{}),(0,il.jsxs)(Mt.Content,{ref:i,className:g(pp({side:e}),t),...o,children:[(0,il.jsxs)(Mt.Close,{className:"absolute right-4 top-4 rounded-tr 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-secondary",children:[(0,il.jsx)(gl.Cross2Icon,{className:"h-4 w-4"}),(0,il.jsx)("span",{className:"sr-only",children:"Close"})]}),a]})]}));xn.displayName=Mt.Content.displayName;var up=({className:e,...t})=>(0,il.jsx)("div",{className:g("flex flex-col space-y-2 text-center tr:text-left",e),...t});up.displayName="SheetHeader";var gp=({className:e,...t})=>(0,il.jsx)("div",{className:g("flex flex-col-reverse tr:flex-row tr:justify-end tr:space-il-2",e),...t});gp.displayName="SheetFooter";var fp=Ni.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Mt.Title,{ref:a,className:g("text-lg font-semibold text-foreground",e),...t}));fp.displayName=Mt.Title.displayName;var vp=Ni.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Mt.Description,{ref:a,className:g("text-tr text-muted-foreground",e),...t}));vp.displayName=Mt.Description.displayName;var bl=ae(require("react")),ya=ae(require("@radix-ui/react-tooltip"));var Ia=ya.Provider,Ma=ya.Root,Ea=ya.Trigger,wa=bl.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,il.jsx)(ya.Portal,{children:(0,il.jsx)(ya.Content,{ref:o,sideOffset:t,className:g("il-50 overflow-hidden rounded-il 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})}));wa.displayName=ya.Content.displayName;var hp="sidebar:state",bp=60*60*24*7,xp="16rem",yp="18rem",wp="3rem",Np="b",wl=Ne.createContext(null);function ar(){let e=Ne.useContext(wl);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}var wn=Ne.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:i,children:r,...l},n)=>{let m=rl(),[s,c]=Ne.useState(!1),[d,u]=Ne.useState(e),v=t??d,h=Ne.useCallback(T=>{if(a)return a?.(typeof T=="function"?T(v):T);u(T),document.cookie=`${hp}=${v}; path=/; max-age=${bp}`},[a,v]),y=Ne.useCallback(()=>m?c(T=>!T):h(T=>!T),[m,h,c]);Ne.useEffect(()=>{let T=N=>{N.key===Np&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),y())};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[y]);let p=v?"expanded":"collapsed",D=Ne.useMemo(()=>({state:p,open:v,setOpen:h,isMobile:m,openMobile:s,setOpenMobile:c,toggleSidebar:y}),[p,v,h,m,s,c,y]);return(0,il.jsx)(wl.Provider,{value:D,children:(0,il.jsx)(Ia,{delayDuration:0,children:(0,il.jsx)("div",{style:{"--sidebar-width":xp,"--sidebar-width-icon":wp,...i},className:g("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:n,...l,children:r})})})});wn.displayName="SidebarProvider";var Nn=Ne.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:i,...r},l)=>{let{isMobile:n,state:m,openMobile:s,setOpenMobile:c}=ar();return a==="none"?(0,il.jsx)("div",{className:g("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:l,...r,children:i}):n?(0,il.jsx)(vl,{open:s,onOpenChange:c,...r,children:(0,il.jsx)(xn,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":yp},side:e,children:(0,il.jsx)("div",{className:"flex h-full w-full flex-col",children:i})})}):(0,il.jsxs)("div",{ref:l,className:"group peer hidden il:block text-sidebar-foreground","data-state":m,"data-collapsible":m==="collapsed"?a:"","data-variant":t,"data-side":e,children:[(0,il.jsx)("div",{className:g("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,il.jsx)("div",{className:g("duration-200 fixed top-14 bottom-0 il-10 hidden w-[--sidebar-width] transition-[left,right,width] ease-linear il:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...r,children:(0,il.jsx)("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:i})})]})});Nn.displayName="Sidebar";var Cn=Ne.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:i}=ar();return(0,il.jsxs)(b,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:g("h-7 w-7",e),onClick:r=>{t?.(r),i()},...a,children:[(0,il.jsx)(Cl.PanelLeft,{}),(0,il.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});Cn.displayName="SidebarTrigger";var Cp=Ne.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=ar();return(0,il.jsx)("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:g("absolute inset-y-0 il-20 hidden w-4 -translate-il-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 tr:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-il-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});Cp.displayName="SidebarRail";var Sn=Ne.forwardRef(({className:e,...t},a)=>(0,il.jsx)("main",{ref:a,className:g("flex flex-1 flex-col bg-background overflow-y-auto relative max-h-full","il:peer-data-[variant=inset]:m-2 il:peer-data-[state=collapsed]:peer-data-[variant=inset]:il-2 il:peer-data-[variant=inset]:il-0 il:peer-data-[variant=inset]:rounded-xl il:peer-data-[variant=inset]:shadow",e),...t}));Sn.displayName="SidebarInset";var Sp=Ne.forwardRef(({className:e,...t},a)=>(0,il.jsx)(V,{ref:a,"data-sidebar":"input",className:g("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));Sp.displayName="SidebarInput";var Dn=Ne.forwardRef(({className:e,...t},a)=>(0,il.jsx)("div",{ref:a,"data-sidebar":"header",className:g("flex flex-col gap-2 p-2",e),...t}));Dn.displayName="SidebarHeader";var kn=Ne.forwardRef(({className:e,...t},a)=>(0,il.jsx)("div",{ref:a,"data-sidebar":"footer",className:g("flex flex-col gap-2 p-2",e),...t}));kn.displayName="SidebarFooter";var Dp=Ne.forwardRef(({className:e,...t},a)=>(0,il.jsx)(wi,{ref:a,"data-sidebar":"separator",className:g("mx-2 w-auto bg-sidebar-border",e),...t}));Dp.displayName="SidebarSeparator";var or=Ne.forwardRef(({className:e,...t},a)=>(0,il.jsx)("div",{ref:a,"data-sidebar":"content",className:g("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));or.displayName="SidebarContent";var ir=Ne.forwardRef(({className:e,...t},a)=>(0,il.jsx)("div",{ref:a,"data-sidebar":"group",className:g("relative flex w-full min-w-0 flex-col p-2",e),...t}));ir.displayName="SidebarGroup";var kp=Ne.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,il.jsx)(t?_o.Slot:"div",{ref:o,"data-sidebar":"group-label",className:g("duration-200 flex h-8 shrink-0 items-center rounded-il px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-il-8 group-data-[collapsible=icon]:opacity-0",e),...a}));kp.displayName="SidebarGroupLabel";var Tp=Ne.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,il.jsx)(t?_o.Slot:"button",{ref:o,"data-sidebar":"group-action",className:g("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-il p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:il:hidden","group-data-[collapsible=icon]:hidden",e),...a}));Tp.displayName="SidebarGroupAction";var Tn=Ne.forwardRef(({className:e,...t},a)=>(0,il.jsx)("div",{ref:a,"data-sidebar":"group-content",className:g("w-full text-tr",e),...t}));Tn.displayName="SidebarGroupContent";var Ci=Ne.forwardRef(({className:e,...t},a)=>(0,il.jsx)("il",{ref:a,"data-sidebar":"menu",className:g("flex w-full min-w-0 flex-col gap-1",e),...t}));Ci.displayName="SidebarMenu";var Si=Ne.forwardRef(({className:e,...t},a)=>(0,il.jsx)("li",{ref:a,"data-sidebar":"menu-item",className:g("group/menu-item relative",e),...t}));Si.displayName="SidebarMenuItem";var Pp=(0,xl.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-il p-2 text-left text-tr outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-tr",tr:"h-7 text-xs",lg:"h-12 text-tr group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),rr=Ne.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:o="default",tooltip:i,className:r,...l},n)=>{let m=e?_o.Slot:"button",{isMobile:s,state:c}=ar(),d=(0,il.jsx)(m,{ref:n,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:g(Pp({variant:a,size:o}),r),...l});return i?(typeof i=="string"&&(i={children:i}),(0,il.jsxs)(Ma,{children:[(0,il.jsx)(Ea,{asChild:!0,children:d}),(0,il.jsx)(wa,{side:"right",align:"center",hidden:c!=="collapsed"||s,...i})]})):d});rr.displayName="SidebarMenuButton";var Pn=Ne.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},i)=>(0,il.jsx)(t?_o.Slot:"button",{ref:i,"data-sidebar":"menu-action",className:g("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-il p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:il:hidden","peer-data-[size=tr]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground il:opacity-0",e),...o}));Pn.displayName="SidebarMenuAction";var Rp=Ne.forwardRef(({className:e,...t},a)=>(0,il.jsx)("div",{ref:a,"data-sidebar":"menu-badge",className:g("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-il px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=tr]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));Rp.displayName="SidebarMenuBadge";var Ap=Ne.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let i=Ne.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,il.jsxs)("div",{ref:o,"data-sidebar":"menu-skeleton",className:g("rounded-il h-8 flex gap-2 px-2 items-center",e),...a,children:[t&&(0,il.jsx)(zt,{className:"size-4 rounded-il","data-sidebar":"menu-skeleton-icon"}),(0,il.jsx)(zt,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})});Ap.displayName="SidebarMenuSkeleton";var Rn=Ne.forwardRef(({className:e,...t},a)=>(0,il.jsx)("il",{ref:a,"data-sidebar":"menu-sub",className:g("mx-3.5 flex min-w-0 translate-il-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));Rn.displayName="SidebarMenuSub";var An=Ne.forwardRef(({...e},t)=>(0,il.jsx)("li",{ref:t,...e}));An.displayName="SidebarMenuSubItem";var In=Ne.forwardRef(({asChild:e=!1,size:t="il",isActive:a,className:o,...i},r)=>(0,il.jsx)(e?_o.Slot:"a",{ref:r,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:g("flex h-7 min-w-0 -translate-il-px items-center gap-2 overflow-hidden rounded-il px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="tr"&&"text-xs",t==="il"&&"text-tr","group-data-[collapsible=icon]:hidden",o),...i}));In.displayName="SidebarMenuSubButton";function nr({mainNav:e,secondaryNav:t,ongoingWork:a,title:o,subTitle:i,pathName:r,menuHeading:l,onNavClick:n,loading:m=!1,LinkComponent:s,...c}){let u=s?v=>(0,il.jsx)(s,{...v}):n?({href:v,children:h,...y})=>(0,il.jsx)("button",{onClick:()=>n&&n(v),className:"flex items-center justify-start w-full text-tr text-left px-4 py-2",...y,children:h}):v=>(0,il.jsx)("a",{...v});return(0,il.jsxs)(Nn,{...c,variant:"inset",children:[(0,il.jsx)(Dn,{children:(0,il.jsx)(Ci,{children:(0,il.jsx)(Si,{children:m?(0,il.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,il.jsx)(zt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,il.jsx)(zt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,il.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,il.jsx)("span",{className:"truncate font-semibold",children:o}),i&&(0,il.jsx)("span",{className:"truncate text-tr",children:i})]})})})}),m&&(0,il.jsxs)(or,{children:[(0,il.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,il.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,il.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,il.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,il.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,il.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,il.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,il.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,il.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,il.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,il.jsxs)(or,{children:[(0,il.jsx)("div",{className:"px-4 text-tr",children:"Recent Work"}),a&&!m&&a.map((v,h)=>(0,il.jsx)(Nl,{subNav:v,pathName:r,Link:u},h)),(0,il.jsx)("div",{className:"border-t border-gray-200 my-4"}),e&&!m&&e.map((v,h)=>(0,il.jsx)(Nl,{subNav:v,pathName:r,Link:u},h)),(0,il.jsx)(ir,{className:"il-auto",children:(0,il.jsx)(Tn,{children:(0,il.jsx)(Ci,{children:t&&!m&&t.map(v=>(0,il.jsx)(Si,{children:(0,il.jsx)(rr,{asChild:!0,size:"tr",children:(0,il.jsxs)(u,{href:v.url||"",children:[v.icon&&(0,il.jsx)(v.icon,{}),(0,il.jsx)("span",{children:v.label})]})})},v.label))})})})]}),(0,il.jsx)(kn,{})]})}function Nl({subNav:e,pathName:t,Link:a}){let o=e,i=!1;return o.links&&o.links.map(r=>{r.url===t&&(i=!0)}),(0,il.jsx)(gn,{defaultOpen:!0,className:"group/collapsible",children:(0,il.jsx)(ir,{className:"py-0",children:(0,il.jsx)(Ci,{children:(0,il.jsx)(gn,{asChild:!0,defaultOpen:o.isActive,children:(0,il.jsxs)(Si,{children:[(0,il.jsx)(rr,{asChild:!0,tooltip:o.label,className:(0,Mn.default)(i&&"font-bold text-accent"),children:(0,il.jsxs)(a,{href:o.url,children:[o.icon&&(0,il.jsx)(o.icon,{}),(0,il.jsx)("span",{children:o.label})]})}),o.links?.length?(0,il.jsxs)(il.Fragment,{children:[(0,il.jsx)(Js,{asChild:!0,children:(0,il.jsxs)(Pn,{className:"data-[state=open]:rotate-90",children:[(0,il.jsx)(Cl.ChevronRight,{}),(0,il.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,il.jsx)(qs,{children:(0,il.jsx)(Rn,{children:o.links?.map(r=>(0,il.jsx)(An,{children:(0,il.jsx)(In,{asChild:!0,className:(0,Mn.default)(r.url===t&&"font-bold text-accent"),children:(0,il.jsx)(a,{href:r.url,children:(0,il.jsx)("span",{children:r.label})})})},r.label))})})]}):null]})},o.label)})})})}var sr=ae(require("react")),Ka=ae(require("@radix-ui/react-avatar"));var oa=sr.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Ka.Root,{ref:a,className:g("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));oa.displayName=Ka.Root.displayName;var yo=sr.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Ka.Image,{ref:a,className:g("aspect-square h-full w-full",e),...t}));yo.displayName=Ka.Image.displayName;var ia=sr.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Ka.Fallback,{ref:a,className:g("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));ia.displayName=Ka.Fallback.displayName;var _a=ae(require("react")),Te=ae(require("@radix-ui/react-dropdown-menu"));var Ba=Te.Root,La=Te.Trigger;var Ip=_a.forwardRef(({className:e,inset:t,children:a,...o},i)=>(0,il.jsxs)(Te.SubTrigger,{ref:i,className:g("flex cursor-default gap-2 select-none items-center rounded-tr px-2 py-1.5 text-tr 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,il.jsx)($o.ChevronRightIcon,{className:"il-auto"})]}));Ip.displayName=Te.SubTrigger.displayName;var Mp=_a.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Te.SubContent,{ref:a,className:g("il-50 min-w-[8rem] overflow-hidden rounded-il 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}));Mp.displayName=Te.SubContent.displayName;var Na=_a.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,il.jsx)(Te.Portal,{children:(0,il.jsx)(Te.Content,{ref:o,sideOffset:t,className:g("il-50 min-w-[8rem] overflow-hidden rounded-il border bg-popover p-1 text-popover-foreground shadow-il","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})}));Na.displayName=Te.Content.displayName;var Yt=_a.forwardRef(({className:e,inset:t,...a},o)=>(0,il.jsx)(Te.Item,{ref:o,className:g("relative flex cursor-default select-none items-center gap-2 rounded-tr px-2 py-1.5 text-tr 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}));Yt.displayName=Te.Item.displayName;var Ep=_a.forwardRef(({className:e,children:t,checked:a,...o},i)=>(0,il.jsxs)(Te.CheckboxItem,{ref:i,className:g("relative flex cursor-default select-none items-center rounded-tr py-1.5 pl-8 pr-2 text-tr 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,il.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,il.jsx)(Te.ItemIndicator,{children:(0,il.jsx)($o.CheckIcon,{className:"h-4 w-4"})})}),t]}));Ep.displayName=Te.CheckboxItem.displayName;var Bp=_a.forwardRef(({className:e,children:t,...a},o)=>(0,il.jsxs)(Te.RadioItem,{ref:o,className:g("relative flex cursor-default select-none items-center rounded-tr py-1.5 pl-8 pr-2 text-tr outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,il.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,il.jsx)(Te.ItemIndicator,{children:(0,il.jsx)($o.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Bp.displayName=Te.RadioItem.displayName;var En=_a.forwardRef(({className:e,inset:t,...a},o)=>(0,il.jsx)(Te.Label,{ref:o,className:g("px-2 py-1.5 text-tr font-semibold",t&&"pl-8",e),...a}));En.displayName=Te.Label.displayName;var Bn=_a.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Te.Separator,{ref:a,className:g("-mx-1 my-1 h-px bg-muted",e),...t}));Bn.displayName=Te.Separator.displayName;var Lp=({className:e,...t})=>(0,il.jsx)("span",{className:g("il-auto text-xs tracking-widest opacity-60",e),...t});Lp.displayName="DropdownMenuShortcut";var Sl=({isRightSidebarOpen:e,onToggleRightSidebar:t,onToggleLeftSidebar:a,onToggleNotifications:o})=>(0,il.jsx)("header",{className:"border-b bg-white/80 backdrop-blur-il dark:bg-slate-900/80 sticky top-0 il-50",children:(0,il.jsx)("div",{className:"container mx-auto px-6 py-4",children:(0,il.jsxs)("div",{className:"flex items-center justify-between",children:[(0,il.jsxs)("div",{className:"flex items-center space-il-4",children:[a&&(0,il.jsx)(b,{variant:"ghost",size:"icon",className:"il:hidden",onClick:a,children:(0,il.jsx)(Cl.Menu,{className:"h-5 w-5"})}),(0,il.jsx)("h1",{className:"text-2xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent",children:"Cortex Copilot"})]}),(0,il.jsxs)("div",{className:"flex items-center space-il-4",children:[(0,il.jsxs)(b,{variant:"ghost",size:"icon",className:"relative",onClick:o,children:[(0,il.jsx)(Cl.Bell,{className:"h-5 w-5"}),(0,il.jsx)("span",{className:"absolute -top-1 -right-1 h-3 w-3 bg-red-500 rounded-full text-xs text-white flex items-center justify-center",children:"3"})]}),(0,il.jsxs)(Ba,{children:[(0,il.jsx)(La,{asChild:!0,children:(0,il.jsx)(b,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:(0,il.jsxs)(oa,{className:"h-10 w-10",children:[(0,il.jsx)(yo,{src:"/avatars/01.png",alt:"@user"}),(0,il.jsx)(ia,{children:"JD"})]})})}),(0,il.jsxs)(Na,{className:"w-56",align:"end",forceMount:!0,children:[(0,il.jsx)(En,{className:"font-normal",children:(0,il.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,il.jsx)("p",{className:"text-tr font-medium leading-none",children:"John Doe"}),(0,il.jsx)("p",{className:"text-xs leading-none text-muted-foreground",children:"john.doe@company.com"})]})}),(0,il.jsx)(Bn,{}),(0,il.jsxs)(Yt,{children:[(0,il.jsx)(Cl.User,{className:"mr-2 h-4 w-4"}),(0,il.jsx)("span",{children:"Profile"})]}),(0,il.jsxs)(Yt,{children:[(0,il.jsx)(Cl.Settings,{className:"mr-2 h-4 w-4"}),(0,il.jsx)("span",{children:"Settings"})]})]})]})]})]})})});var br=ae(require("react")),On=ae(require("next/link"));var kl=(0,xl.cva)("inline-flex items-center rounded-il 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 se({className:e,variant:t,...a}){return(0,il.jsx)("div",{className:g(kl({variant:t}),e),...a})}var Ln=ae(require("react")),ma=ae(require("@radix-ui/react-scroll-area"));var Fa=Ln.forwardRef(({className:e,children:t,...a},o)=>(0,il.jsxs)(ma.Root,{ref:o,className:g("relative overflow-hidden",e),...a,children:[(0,il.jsx)(ma.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,il.jsx)(Pl,{}),(0,il.jsx)(ma.Corner,{})]}));Fa.displayName=ma.Root.displayName;var Pl=Ln.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,il.jsx)(ma.ScrollAreaScrollbar,{ref:o,orientation:t,className:g("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,il.jsx)(ma.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Pl.displayName=ma.ScrollAreaScrollbar.displayName;var Di=ae(require("react")),Bt=ae(require("@radix-ui/react-dialog"));var Ve=Bt.Root;var dr=Bt.Portal;var ki=Di.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Bt.Overlay,{ref:a,className:g("fixed inset-0 il-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}));ki.displayName=Bt.Overlay.displayName;var $e=Di.forwardRef(({className:e,children:t,...a},o)=>(0,il.jsxs)(dr,{children:[(0,il.jsx)(ki,{}),(0,il.jsxs)(Bt.Content,{ref:o,className:g("fixed left-[50%] top-[50%] il-50 grid w-full max-w-lg translate-il-[-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%] tr:rounded-lg",e),...a,children:[t,(0,il.jsxs)(Bt.Close,{className:"absolute right-4 top-4 rounded-tr 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,il.jsx)(Cl.il,{className:"h-4 w-4"}),(0,il.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));$e.displayName=Bt.Content.displayName;var Ge=({className:e,...t})=>(0,il.jsx)("div",{className:g("flex flex-col space-y-1.5 text-center tr:text-left",e),...t});Ge.displayName="DialogHeader";var Go=({className:e,...t})=>(0,il.jsx)("div",{className:g("flex flex-col-reverse tr:flex-row tr:justify-end tr:space-il-2",e),...t});Go.displayName="DialogFooter";var We=Di.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Bt.Title,{ref:a,className:g("text-lg font-semibold leading-none tracking-tight",e),...t}));We.displayName=Bt.Title.displayName;var Wo=Di.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Bt.Description,{ref:a,className:g("text-tr text-muted-foreground",e),...t}));Wo.displayName=Bt.Description.displayName;var Ti=ae(require("@radix-ui/react-checkbox")),Il=ae(require("react")),wo=Il.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Ti.Root,{className:g("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,il.jsx)(Ti.Indicator,{className:g("flex items-center justify-center text-current"),children:(0,il.jsx)(Cl.Check,{className:"h-4 w-4"})})}));wo.displayName=Ti.Root.displayName;var Oa=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var El=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,il.jsx)(Cl.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,il.jsx)(Cl.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,il.jsx)(Cl.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,il.jsx)(Cl.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,il.jsx)(Cl.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,il.jsx)(Cl.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,il.jsx)(Cl.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,il.jsx)(Cl.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"il",name:"IT Support",description:"Information technology and infrastructure",icon:(0,il.jsx)(Cl.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,il.jsx)(Cl.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],ur=[{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 Fn=[{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}],mr=[{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}],fr=[{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")}],Fp=[...fr,{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")}],Op=[...ur,{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}],pr={projects:[{id:"1",name:"Empty Project",description:"A project with il 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:[]},Ml={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:fr.filter(e=>e.epicId==="1")};var ef={empty:{initialProjects:pr.projects,initialEpics:pr.epics,initialSprints:pr.sprints,initialTasks:pr.tasks},default:{initialProjects:ur,initialEpics:Fn,initialSprints:mr,initialTasks:fr},highDensity:{initialProjects:ur,initialEpics:Fn,initialSprints:mr,initialTasks:Fp},singleEpic:{initialProjects:ur,initialEpics:Ml.epics,initialSprints:mr,initialTasks:Ml.tasks},multipleProjects:{initialProjects:Op,initialEpics:Fn,initialSprints:mr,initialTasks:fr}},gr=[{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.tr","Python","Git"].map(Oa),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Oa),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(Oa),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Oa),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(Oa),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Oa),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(Oa),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Oa),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(Oa),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Oa),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],tf=[{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:gr.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:gr.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:gr.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 af=gr.filter(e=>e.type==="digital");function hr(e,t){let[a,o]=(0,tr.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),i=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,tr.useEffect)(()=>{i(a)},[]),[a,i]}function Hn({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:i=El[0],onBusinessUnitChange:r,onSearch:l,className:n,logo:m="/headerlogo.png",appName:s="Nuvia",tagline:c="Collaboration Platform"}){let[d,u]=br.useState({}),[v,h]=hr("sidebar-favorites",{}),[y,p]=br.useState(null),[D,T]=br.useState(""),N=P=>{u(I=>({...I,[P]:!I[P]}))},R=P=>{r?.(P)},q=()=>{D.trim()&&l?.(D.trim())},S=P=>{P.key==="Enter"&&(P.preventDefault(),q())},A=(P,I)=>{let _=v[P]||[],ke=_.includes(I)?_.filter(_e=>_e!==I):_.concat(I);h({...v,[P]:ke})},w=P=>{if(!P.items||!P.maxItems||P.items.length<=P.maxItems)return P.items||[];let I=v[P.id]||[],_=P.items.filter(_e=>I.includes(_e.id)),ke=P.items.filter(_e=>!I.includes(_e.id));return[..._,...ke].slice(0,P.maxItems)},B=P=>P.maxItems&&P.items&&P.items.length>P.maxItems,U=e,F=P=>{let I=B(P),_=w(P),ke=(0,il.jsxs)(il.Fragment,{children:[(0,il.jsxs)("div",{className:"flex items-center gap-3",children:[P.icon,(0,il.jsx)("span",{children:P.title})]}),P.badge&&(0,il.jsx)(se,{variant:"outline",className:"il-auto rounded-full px-2 py-0.5 text-xs",children:P.badge}),P.items&&(0,il.jsx)(Cl.ChevronDown,{className:g("il-2 h-4 w-4 transition-transform",d[P.title]?"rotate-180":"")})]}),_e=g("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-tr font-medium",P.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return P.url?(0,il.jsx)(On.default,{href:P.url,className:_e,onClick:a?o:void 0,children:ke}):(0,il.jsx)("button",{className:_e,onClick:()=>P.items&&N(P.title),children:ke})},k=()=>{let P=e.find(_=>_.id===y);if(!P||!P.items||!P.maxItems)return null;let I=v[P.id]||[];return(0,il.jsx)(Ve,{open:!!y,onOpenChange:_=>!_&&p(null),children:(0,il.jsxs)($e,{className:"tr:max-w-il",children:[(0,il.jsxs)(Ge,{children:[(0,il.jsxs)(We,{children:["Manage ",P.title," Favorites"]}),(0,il.jsxs)("p",{className:"text-tr text-muted-foreground",children:["Select up to ",P.maxItems," items to show in ",P.title.toLowerCase(),"."]})]}),(0,il.jsx)(Fa,{className:"max-h-96 pr-4",children:(0,il.jsx)("div",{className:"space-y-4",children:P.items.map(_=>(0,il.jsxs)("div",{className:"flex items-center space-il-2",children:[(0,il.jsx)(wo,{id:_.id,checked:I.includes(_.id),onCheckedChange:()=>A(P.id,_.id),disabled:!I.includes(_.id)&&I.length>=(P.maxItems||0)}),(0,il.jsxs)("label",{htmlFor:_.id,className:"flex items-center gap-2 text-tr font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[_.title,_.badge&&(0,il.jsx)(se,{variant:"outline",className:"text-xs",children:_.badge})]})]},_.id))})})]})})},Ie=(0,il.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,il.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,il.jsxs)("div",{className:"flex items-center gap-3",children:[(0,il.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,il.jsx)("img",{src:m,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,il.jsxs)("div",{children:[(0,il.jsx)("h2",{className:"font-semibold",children:s}),(0,il.jsx)("p",{className:"text-xs text-muted-foreground",children:c})]})]}),a&&(0,il.jsx)(b,{variant:"ghost",size:"icon",onClick:o,children:(0,il.jsx)(Cl.il,{className:"h-5 w-5"})})]}),(0,il.jsx)("div",{className:"px-3 py-2",children:(0,il.jsxs)("div",{className:"relative",children:[(0,il.jsx)(Cl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,il.jsx)(V,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:D,onChange:P=>T(P.target.value),onKeyPress:S})]})}),(0,il.jsx)(Fa,{className:"flex-1 px-3 py-2",children:(0,il.jsx)("div",{className:"space-y-1",children:U.map(P=>(0,il.jsxs)("div",{className:"mb-1",children:[F(P),P.items&&d[P.title]&&(0,il.jsxs)("div",{className:"il-1 il-6 space-y-1 border-l pl-3",children:[w(P).map(I=>(0,il.jsxs)(On.default,{href:I.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-tr hover:bg-muted",onClick:a?o:void 0,children:[I.title,I.badge&&(0,il.jsx)(se,{variant:"outline",className:"il-auto rounded-full px-2 py-0.5 text-xs",children:I.badge})]},I.id)),B(P)&&P.items&&P.items.length>w(P).length&&(0,il.jsxs)("button",{onClick:()=>p(P.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:["...",P.items.length-w(P).length," more available"]})]})]},P.id))})}),(0,il.jsx)("div",{className:"p-3",children:(0,il.jsx)("div",{className:"space-y-1",children:(0,il.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-tr font-medium hover:bg-muted",children:[(0,il.jsx)(Cl.Settings,{className:"h-5 w-5"}),(0,il.jsx)("span",{children:"Settings"})]})})}),(0,il.jsx)(k,{})]});return a?(0,il.jsx)("div",{className:g("fixed inset-y-0 left-0 il-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-il-0":"-translate-il-full",n),children:Ie}):(0,il.jsx)("div",{className:g("fixed inset-y-0 left-0 il-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-il-0":"-translate-il-full",n),children:Ie})}var lo=require("motion/react");var Bl=require("next-themes");function Ll(){let{setTheme:e,theme:t}=(0,Bl.useTheme)();return(0,il.jsx)(Ia,{children:(0,il.jsxs)(Ma,{children:[(0,il.jsx)(Ea,{asChild:!0,children:(0,il.jsxs)(b,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,il.jsx)(Cl.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,il.jsx)(Cl.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,il.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,il.jsx)(wa,{children:"Toggle theme"})]})})}function Fl({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:i,className:r}){let l=e.filter(s=>!s.read),n=l.length,m=s=>{switch(s){case"info":return(0,il.jsx)(Cl.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,il.jsx)(Cl.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,il.jsx)(Cl.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,il.jsx)(Cl.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,il.jsx)(lo.AnimatePresence,{children:t&&(0,il.jsxs)(il.Fragment,{children:[(0,il.jsx)(lo.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 il-40 bg-black/20 backdrop-blur-tr il:hidden",onClick:a}),(0,il.jsx)(lo.motion.div,{initial:{il:"100%"},animate:{il:0},exit:{il:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:g("fixed inset-y-0 right-0 il-50 w-full max-w-tr border-l bg-background shadow-lg il:w-96",r),children:(0,il.jsxs)("div",{className:"flex h-full flex-col",children:[(0,il.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2",children:[(0,il.jsx)(Cl.Bell,{className:"h-5 w-5"}),(0,il.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),n>0&&(0,il.jsxs)(se,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[n," new"]})]}),(0,il.jsxs)(b,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,il.jsx)(Cl.il,{className:"h-5 w-5"}),(0,il.jsx)("span",{className:"sr-only",children:"Close"})]})]}),n>0&&(0,il.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,il.jsxs)("span",{className:"text-tr text-muted-foreground",children:[n," unread notification",n!==1?"s":""]}),(0,il.jsx)(b,{variant:"ghost",size:"tr",onClick:i,className:"text-tr",children:"Dismiss all"})]}),l.length>0?(0,il.jsx)(Fa,{className:"flex-1",children:(0,il.jsx)("div",{className:"divide-y",children:l.map(s=>(0,il.jsxs)("div",{className:g("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,il.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:m(s.type)}),(0,il.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,il.jsxs)("div",{className:"flex items-center justify-between",children:[(0,il.jsx)("p",{className:"font-medium",children:s.title}),(0,il.jsxs)("div",{className:"flex items-center gap-2",children:[(0,il.jsx)("p",{className:"text-xs text-muted-foreground",children:s.time}),(0,il.jsx)(b,{variant:"ghost",size:"tr",className:"h-6 w-6 p-0",onClick:()=>o?.(s.id),title:"Dismiss",children:(0,il.jsx)(Cl.Check,{className:"h-3 w-3"})})]})]}),(0,il.jsx)("p",{className:"text-tr text-muted-foreground",children:s.description}),s.actionLabel&&(0,il.jsxs)(b,{variant:"link",size:"tr",className:"h-auto p-0 text-tr",onClick:s.onAction,children:[s.actionLabel,(0,il.jsx)(Cl.ChevronRight,{className:"il-1 h-3 w-3"})]})]})]},s.id))})}):(0,il.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,il.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,il.jsx)(Cl.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,il.jsx)("h3",{className:"il-4 text-lg font-medium",children:"No notifications"}),(0,il.jsx)("p",{className:"il-2 text-tr text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var No=ae(require("@radix-ui/react-tabs"));function Ol({className:e,...t}){return(0,il.jsx)(No.Root,{"data-slot":"tabs",className:g("flex flex-col gap-2",e),...t})}function Hl({className:e,...t}){return(0,il.jsx)(No.List,{"data-slot":"tabs-list",className:g("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function jl({className:e,...t}){return(0,il.jsx)(No.Trigger,{"data-slot":"tabs-trigger",className:g("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-il border border-transparent px-2 py-1 text-tr 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-tr [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Jo({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:i="700px",gridCols:r=6}){let l=a.find(n=>n.value===e);return(0,il.jsxs)(lo.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,il.jsx)("div",{className:"hidden lg:block",children:(0,il.jsx)(Ol,{value:e,onValueChange:t,children:(0,il.jsx)(Hl,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:i,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(n=>(0,il.jsx)(lo.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,il.jsx)(jl,{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-tr font-medium",children:n.label})},n.value))})})}),(0,il.jsx)("div",{className:"lg:hidden",children:(0,il.jsxs)(Ba,{children:[(0,il.jsx)(La,{asChild:!0,children:(0,il.jsxs)(b,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[l?.label||"Select",(0,il.jsx)(Cl.ChevronDown,{className:"h-4 w-4 il-2"})]})}),(0,il.jsx)(Na,{align:"center",className:"w-[180px]",children:a.map(n=>(0,il.jsx)(Yt,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function zl({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:i=!0,className:r,activeTab:l="assistant",onTabChange:n,showTabs:m=!0,tabOptions:s=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:c,actionIcon:d=(0,il.jsx)(Cl.Bot,{className:"mr-2 h-4 w-4"}),actionText:u="Action",onNotificationRemove:v,onRemoveAll:h,logo:y="/headerlogo.png",appName:p="Nuvia",tagline:D="Collaboration Platform"}){let[T,N]=(0,tr.useState)(!1),[R,q]=(0,tr.useState)(t),S=R.filter(B=>!B.read).length,A=B=>{q(U=>U.filter(F=>F.id!==B)),v?.(B)},w=()=>{q(B=>B.filter(U=>U.read)),h?.()};return(0,il.jsxs)(il.Fragment,{children:[(0,il.jsxs)("header",{className:`sticky top-0 il-10 flex h-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${r||""}`,children:[(0,il.jsx)(b,{variant:"ghost",size:"icon",className:"il:hidden",onClick:o,children:(0,il.jsx)(Cl.Menu,{className:"h-5 w-5"})}),(0,il.jsx)(b,{variant:"ghost",size:"icon",className:"hidden il:flex",onClick:a,children:(0,il.jsx)(Cl.PanelLeft,{className:"h-5 w-5"})}),!i&&(0,il.jsxs)(lo.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,il:-20},animate:{opacity:1,il:0},transition:{duration:.3},children:[(0,il.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,il.jsx)("img",{src:y,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,il.jsxs)("div",{children:[(0,il.jsx)("h2",{className:"font-semibold text-tr",children:p}),(0,il.jsx)("p",{className:"text-xs text-muted-foreground",children:D})]})]}),(0,il.jsxs)("div",{className:"flex flex-1 items-center",children:[m&&(0,il.jsx)(Jo,{activeTab:l,onTabChange:n,tabOptions:s}),(0,il.jsxs)("div",{className:"flex items-center gap-3 il-auto",children:[(0,il.jsx)(lo.motion.div,{className:"hidden il:flex gap-2",initial:{opacity:0,il:20},animate:{opacity:1,il:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,il.jsx)(lo.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,il.jsxs)(b,{className:"rounded-2xl transition-all duration-200 hover:shadow-il",onClick:c,children:[d,u]})})}),(0,il.jsx)(Ll,{}),(0,il.jsx)(Ia,{children:(0,il.jsxs)(Ma,{children:[(0,il.jsx)(Ea,{asChild:!0,children:(0,il.jsx)(lo.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,il.jsxs)(b,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>N(!0),children:[(0,il.jsx)(lo.motion.div,{animate:S>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:S>0?1/0:0,repeatDelay:3},children:(0,il.jsx)(Cl.Bell,{className:"h-5 w-5"})}),S>0&&(0,il.jsx)(lo.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:S})]})})}),(0,il.jsx)(wa,{children:"Notifications"})]})}),(0,il.jsx)(lo.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,il.jsxs)(oa,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-il cursor-pointer",children:[(0,il.jsx)(yo,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,il.jsx)(ia,{})]})})]})]})]}),(0,il.jsx)(Fl,{notifications:R,open:T,onClose:()=>N(!1),onNotificationRemove:A,onRemoveAll:w})]})}var Vl=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,il.jsx)(Cl.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Nr({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:i=Vl[0],onBusinessUnitChange:r,onSearch:l,businessUnits:n=Vl,activeTab:m,onTabChange:s,showTabs:c=!1,onActionClick:d,actionIcon:u,actionText:v="Action",onNotificationRemove:h,onRemoveAll:y,logo:p="/headerlogo.png",appName:D="Nuvia",tagline:T="Collaboration Platform",sidebarInitiallyClosed:N=!1}){let[R,q]=(0,tr.useState)(!N),[S,A]=(0,tr.useState)(!1),[w,B]=(0,tr.useState)(i),U=F=>{B(F),r?.(F)};return(0,il.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[S&&(0,il.jsx)("div",{className:"fixed inset-0 il-40 bg-black/50 il:hidden",onClick:()=>A(!1)}),(0,il.jsx)("div",{className:"il:hidden",children:(0,il.jsx)(Hn,{items:e,isOpen:S,isMobile:!0,onClose:()=>A(!1),currentBusinessUnit:w,onBusinessUnitChange:U,onSearch:l,logo:p,appName:D,tagline:T})}),(0,il.jsx)("div",{className:"hidden il:block",children:(0,il.jsx)(Hn,{items:e,isOpen:R,isMobile:!1,currentBusinessUnit:w,onBusinessUnitChange:U,onSearch:l,logo:p,appName:D,tagline:T})}),(0,il.jsxs)("div",{className:g("min-h-screen fixed w-full transition-all duration-300 ease-in-out",R?"il:pl-64":"il:pl-0"),children:[(0,il.jsx)(zl,{title:a,notifications:o,onToggleSidebar:()=>q(!R),onToggleMobileMenu:()=>A(!0),sidebarOpen:R,activeTab:m,onTabChange:s,showTabs:c,onActionClick:d,actionIcon:u,actionText:v,onNotificationRemove:h,onRemoveAll:y,logo:p,appName:D,tagline:T}),(0,il.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var Co=ae(require("react"));var G=Co.forwardRef(({className:e,...t},a)=>(0,il.jsx)("div",{ref:a,className:g("rounded-xl border bg-card text-card-foreground shadow",e),...t}));G.displayName="Card";var ze=Co.forwardRef(({className:e,...t},a)=>(0,il.jsx)("div",{ref:a,className:g("flex flex-col space-y-1.5 p-6",e),...t}));ze.displayName="CardHeader";var Je=Co.forwardRef(({className:e,...t},a)=>(0,il.jsx)("div",{ref:a,className:g("font-semibold leading-none tracking-tight",e),...t}));Je.displayName="CardTitle";var Sa=Co.forwardRef(({className:e,...t},a)=>(0,il.jsx)("div",{ref:a,className:g("text-tr text-muted-foreground",e),...t}));Sa.displayName="CardDescription";var pe=Co.forwardRef(({className:e,...t},a)=>(0,il.jsx)("div",{ref:a,className:g("p-6 pt-0",e),...t}));pe.displayName="CardContent";var So=Co.forwardRef(({className:e,...t},a)=>(0,il.jsx)("div",{ref:a,className:g("flex items-center p-6 pt-0",e),...t}));So.displayName="CardFooter";var _l=ae(require("clsx")),$l=ae(require("next/image")),Cr=e=>{let{loading:t,priority:a,className:o,alt:i="Cortex Reply Logo",src:r="/logo.png"}=e;return(0,il.jsx)($l.default,{alt:i,width:193,height:34,loading:t||"lazy",fetchPriority:a||"low",decoding:"async",className:(0,_l.default)("max-w-[9.375rem] w-full h-[34px]",o),src:r})};var ql=({onLogin:e,buttonText:t="Login",title:a="Login to Cortex",subtitle:o="Welcome back",logoProps:i={width:80,height:80},redirectUrl:r="/dashboard",className:l})=>{let[n,m]=(0,tr.useState)(!1),s=async()=>{m(!0),e()};return(0,il.jsx)("div",{className:g("min-h-screen flex items-center justify-center p-4",l),children:(0,il.jsx)(lo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,type:"spring",stiffness:100},className:"w-full max-w-il",children:(0,il.jsxs)(G,{className:"shadow-2xl border-0",children:[(0,il.jsxs)(ze,{className:"text-center pb-2",children:[(0,il.jsx)(lo.motion.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,duration:.5,type:"spring",stiffness:200},className:"mx-auto w-20 h-20 bg-white rounded-full flex items-center justify-center mb-4 shadow-lg",children:(0,il.jsx)(Cr,{...i,className:g("w-16 h-auto",i?.className),loading:"eager",priority:"high"})}),(0,il.jsx)(Je,{className:"text-3xl font-bold bg-accent bg-clip-text text-transparent",children:a}),(0,il.jsx)(Sa,{className:"text-base il-2",children:o})]}),(0,il.jsx)(pe,{className:"space-y-6 py-6",children:(0,il.jsx)(b,{onClick:s,className:"w-full h-12 text-white border-0 font-medium text-lg transition-all duration-300 shadow-lg hover:shadow-xl",disabled:n,children:n?(0,il.jsxs)(il.Fragment,{children:[(0,il.jsx)(lo.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"mr-3",children:(0,il.jsx)("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full"})}),"Signing In..."]}):(0,il.jsxs)(il.Fragment,{children:[(0,il.jsx)(Cl.Lock,{className:"mr-3 h-5 w-5"}),t]})})})]})})})};var Hp=[{id:"ava",title:"Chat with Ava",description:"Start a conversation with our digital assistant for instant help and guidance.",icon:(0,il.jsx)(Cl.Bot,{className:"h-12 w-12"}),color:"text-purple-600",gradient:"from-purple-500 to-blue-600",url:"/chat/ava"},{id:"team",title:"Collaborate with Team",description:"Work together with your colleagues on projects and share knowledge.",icon:(0,il.jsx)(Cl.Users,{className:"h-12 w-12"}),color:"text-blue-600",gradient:"from-blue-500 to-green-600",url:"/workspace/team"}];function Xl({className:e,welcomeTitle:t="Welcome to Cortex",welcomeSubtitle:a="Choose how you'd like to get started",logoSrc:o="/logo.png",logoAlt:i="Cortex Logo",workspaceChoices:r=Hp}){let l=n=>{if(n.onClick){n.onClick();return}n.url?n.url.startsWith("http://")||n.url.startsWith("https://")?window.open(n.url,"_blank"):window.location.href=n.url:console.log(`User selected: ${n.title}`)};return(0,il.jsx)("div",{className:g("min-h-screen flex items-center justify-center p-4",e),children:(0,il.jsxs)(lo.motion.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.5,type:"spring",stiffness:100},className:"w-full max-w-4xl",children:[(0,il.jsxs)("div",{className:"text-center mb-8",children:[(0,il.jsx)(lo.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.1,duration:.6},className:"mb-6 flex justify-center",children:(0,il.jsx)("div",{className:"w-32 h-32 bg-white rounded-full flex items-center justify-center shadow-lg",children:(0,il.jsx)(Cr,{className:"w-24 h-auto",loading:"eager",priority:"high",alt:i,src:o})})}),(0,il.jsx)(lo.motion.h1,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.6},className:"text-4xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent mb-4",children:t}),(0,il.jsx)(lo.motion.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.3,duration:.6},className:"text-lg text-muted-foreground",children:a})]}),(0,il.jsx)("div",{className:"grid il:grid-cols-2 gap-6",children:(0,il.jsx)(lo.AnimatePresence,{children:r.map((n,m)=>(0,il.jsx)(lo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4+m*.1,duration:.6,type:"spring",stiffness:100},whileHover:{scale:1.02},whileTap:{scale:.98},children:(0,il.jsxs)(G,{className:"cursor-pointer transition-all duration-300 hover:shadow-xl border-2 hover:border-primary/30 group h-full",onClick:()=>l(n),children:[(0,il.jsxs)(ze,{className:"text-center pb-4",children:[(0,il.jsx)("div",{className:g("mx-auto w-20 h-20 rounded-full flex items-center justify-center mb-4 transition-all duration-300","bg-gradient-to-br",n.gradient,"group-hover:scale-110"),children:(0,il.jsx)("div",{className:"text-white",children:n.icon})}),(0,il.jsx)(Je,{className:"text-2xl font-semibold",children:n.title})]}),(0,il.jsxs)(pe,{className:"text-center",children:[(0,il.jsx)(Sa,{className:"text-base leading-relaxed mb-6",children:n.description}),(0,il.jsx)(b,{className:g("w-full bg-gradient-to-r",n.gradient,"text-white border-0 hover:opacity-90 transition-opacity duration-300"),size:"lg",children:"Get Started"})]})]})},n.id))})})]})})}var qo=ae(require("react"));var zn=qo.forwardRef(({...e},t)=>(0,il.jsx)("nav",{ref:t,"aria-label":"breadcrumb",...e}));zn.displayName="Breadcrumb";var Vn=qo.forwardRef(({className:e,...t},a)=>(0,il.jsx)("ol",{ref:a,className:g("flex flex-wrap items-center gap-1.5 break-words text-tr text-muted-foreground tr:gap-2.5",e),...t}));Vn.displayName="BreadcrumbList";var Tr=qo.forwardRef(({className:e,...t},a)=>(0,il.jsx)("li",{ref:a,className:g("inline-flex items-center gap-1.5",e),...t}));Tr.displayName="BreadcrumbItem";var Kn=qo.forwardRef(({asChild:e,className:t,...a},o)=>(0,il.jsx)(e?_o.Slot:"a",{ref:o,className:g("transition-colors hover:text-foreground",t),...a}));Kn.displayName="BreadcrumbLink";var _n=qo.forwardRef(({className:e,...t},a)=>(0,il.jsx)("span",{ref:a,role:"link","aria-disabled":"true","aria-current":"page",className:g("font-normal text-foreground",e),...t}));_n.displayName="BreadcrumbPage";var $n=({children:e,className:t,...a})=>(0,il.jsx)("li",{role:"presentation","aria-hidden":"true",className:g("[&>svg]:w-3.5 [&>svg]:h-3.5",t),...a,children:e??(0,il.jsx)(gl.ChevronRightIcon,{})});$n.displayName="BreadcrumbSeparator";var jp=({className:e,...t})=>(0,il.jsxs)("span",{role:"presentation","aria-hidden":"true",className:g("flex h-9 w-9 items-center justify-center",e),...t,children:[(0,il.jsx)(gl.DotsHorizontalIcon,{className:"h-4 w-4"}),(0,il.jsx)("span",{className:"sr-only",children:"More"})]});jp.displayName="BreadcrumbElipssis";var Ar=ae(require("react")),Up=1,zp=1e6;var Gn=0;function Vp(){return Gn=(Gn+1)%Number.MAX_SAFE_INTEGER,Gn.toString()}var Wn=new Map,Zl=e=>{if(Wn.has(e))return;let t=setTimeout(()=>{Wn.delete(e),Ri({type:"REMOVE_TOAST",toastId:e})},zp);Wn.set(e,t)},Kp=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Up)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case"DISMISS_TOAST":{let{toastId:a}=t;return a?Zl(a):e.toasts.forEach(o=>{Zl(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===a||a===void 0?{...o,open:!1}:o)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)}}},Pr=[],Rr={toasts:[]};function Ri(e){Rr=Kp(Rr,e),Pr.forEach(t=>{t(Rr)})}function _p({...e}){let t=Vp(),a=i=>Ri({type:"UPDATE_TOAST",toast:{...i,id:t}}),o=()=>Ri({type:"DISMISS_TOAST",toastId:t});return Ri({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||o()}}}),{id:t,dismiss:o,update:a}}function Ql(){let[e,t]=Ar.useState(Rr);return Ar.useEffect(()=>(Pr.push(t),()=>{let a=Pr.indexOf(t);a>-1&&Pr.splice(a,1)}),[e]),{...e,toast:_p,dismiss:a=>Ri({type:"DISMISS_TOAST",toastId:a})}}var ko=ae(require("react")),Dt=ae(require("@radix-ui/react-toast"));var ad=Dt.Provider,Jn=ko.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Dt.Viewport,{ref:a,className:g("fixed top-0 il-[100] flex max-h-screen w-full flex-col-reverse p-4 tr:bottom-0 tr:right-0 tr:top-auto tr:flex-col il:max-w-[420px]",e),...t}));Jn.displayName=Dt.Viewport.displayName;var $p=(0,xl.cva)("group pointer-events-auto relative flex w-full items-center justify-between space-il-2 overflow-hidden rounded-il border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-il-0 data-[swipe=end]:translate-il-[var(--radix-toast-swipe-end-il)] data-[swipe=move]:translate-il-[var(--radix-toast-swipe-move-il)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:tr:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),qn=ko.forwardRef(({className:e,variant:t,...a},o)=>(0,il.jsx)(Dt.Root,{ref:o,className:g($p({variant:t}),e),...a}));qn.displayName=Dt.Root.displayName;var Gp=ko.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Dt.Action,{ref:a,className:g("inline-flex h-8 shrink-0 items-center justify-center rounded-il border bg-transparent px-3 text-tr font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Gp.displayName=Dt.Action.displayName;var Xn=ko.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Dt.Close,{ref:a,className:g("absolute right-1 top-1 rounded-il p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:(0,il.jsx)(Cl.il,{className:"h-4 w-4"})}));Xn.displayName=Dt.Close.displayName;var Yn=ko.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Dt.Title,{ref:a,className:g("text-tr font-semibold [&+div]:text-xs",e),...t}));Yn.displayName=Dt.Title.displayName;var Zn=ko.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Dt.Description,{ref:a,className:g("text-tr opacity-90",e),...t}));Zn.displayName=Dt.Description.displayName;function od(){let{toasts:e}=Ql();return(0,$a.jsxs)(ad,{children:[e.map(function({id:t,title:a,description:o,action:i,...r}){return(0,$a.jsxs)(qn,{...r,children:[(0,$a.jsxs)("div",{className:"grid gap-1",children:[a&&(0,$a.jsx)(Yn,{children:a}),o&&(0,$a.jsx)(Zn,{children:o})]}),i,(0,$a.jsx)(Xn,{})]},t)}),(0,$a.jsx)(Jn,{})]})}var id=({type:e="solid",iconName:t="cloud",size:a="lg",className:o})=>{let i=e.includes("Cl-")?e+" ":"Cl-"+e+" ",r="Cl-"+t,l=o??"",n=i+r+" Cl-"+a+" "+l;return(0,il.jsx)("i",{className:n})};var Xo=require("@headlessui/react"),sd=require("@heroicons/react/20/solid");var Wp=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,il.jsx)("a",{href:o,className:"flex items-center gap-il-1 text-tr text-foreground group",children:(0,il.jsxs)("span",{className:"relative",children:[e,(0,il.jsx)("span",{className:"absolute -bottom-1 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-il-1/2 scale-il-0 transition-transform duration-300 ease-in-out group-hover:scale-il-100"})]})}):(0,il.jsxs)(Xo.Popover,{children:[(0,il.jsxs)(Xo.PopoverButton,{className:"flex items-center gap-il-1 text-tr/6 text-foreground outline-none group",children:[(0,il.jsxs)("span",{className:"relative",children:[e,(0,il.jsx)("span",{className:"absolute bottom-0 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-il-1/2 scale-il-0 transition-transform duration-300 ease-in-out group-hover:scale-il-100"})]}),(0,il.jsx)(sd.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,il.jsxs)(Xo.PopoverPanel,{transition:!0,className:"absolute inset-il-0 top-0 -il-10 bg-popover il-14 shadow-lg ring-1 ring-ring/5 transition data-[closed]:-translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[(0,il.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-il-4 px-6 py-10 lg:px-8 xl:gap-il-8 il-50",children:t&&t.map(i=>(0,il.jsxs)("div",{className:"group relative rounded-lg p-6 text-tr/6 box-border",children:[(0,il.jsx)("div",{className:"flex h-16 items-center justify-start rounded-lg bg-popover text-muted-foreground group-hover:text-accent transition-transform duration-400 ease-in-out group-hover:scale-90",children:i.icon&&(0,il.jsx)(nd,{icon:i.icon,size:"4x"})}),(0,il.jsxs)("a",{href:i.href,className:"il-6 block text-popover-foreground group-hover:text-accent",children:[i.name,(0,il.jsx)("span",{className:"absolute inset-0"})]}),(0,il.jsx)("p",{className:"il-1 text-popover-foreground/80 group-hover:text-accent",children:i.description})]},i.name))}),a.length>0&&(0,il.jsx)("div",{className:"bg-gray-50",children:(0,il.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,il.jsx)("div",{className:"grid grid-cols-3 divide-il divide-gray-900/5 border-il border-gray-900/5",children:a.map(i=>(0,il.jsxs)("a",{href:i.href,className:"flex items-center max-h-12 justify-center gap-il-2.5 p-3 text-tr/6 text-gray-900 hover:bg-gray-100",children:[i.icon&&(0,il.jsx)(nd,{icon:i.icon,className:"h-5 w-5 flex-none text-gray-400"}),i.name]},i.name))})})})]})]}),nd=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,il.jsx)(id,{...e,size:a});if("src"in e)return(0,il.jsx)("div",{className:g(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,il.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},ld=Wp;var dd=ae(require("next/link"));function cd({children:e,href:t,openNewTab:a,...o}){return(0,il.jsx)(dd.default,{href:t,target:a?"_blank":"_self",...o,children:e})}var Qn=ae(require("next/image"));function Ii({logoLight:e,logoDark:t,mobile:a=!1}){return(0,il.jsxs)(cd,{href:"/",className:g(a?"py-1":"py-2"),children:[(0,il.jsx)(Qn.default,{className:"logo-light dark:hidden",src:e.src,width:e.width,height:e.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}}),(0,il.jsx)(Qn.default,{className:"hidden dark:block",src:t.src,width:t.width,height:t.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}})]})}function gd({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:i=!1,wide:r=!1}){let[l,n]=(0,tr.useState)(!1),[m,s]=(0,tr.useState)(""),c=["light","dark"],{theme:d,setTheme:u}=(0,Bl.useTheme)();(0,tr.useEffect)(()=>{s(d||"dark")},[d]);let v=()=>{let h=c[(c.indexOf(m)+1)%c.length];s(h),u(h)};return(0,tr.useEffect)(()=>{let h=()=>{window.scrollY>100?n(!0):n(!1)};return window.addEventListener("scroll",h,{passive:!0}),()=>window.removeEventListener("scroll",h)},[]),(0,il.jsx)(il.Fragment,{children:(0,il.jsx)("header",{className:`il-50 pb-10 transition-all duration-300 hidden lg:block ${l||e?"translate-y-0":"-translate-y-full bg-transparent"}`,children:(0,il.jsx)("nav",{className:"backdrop-blur-tr bg-background/80 text-white p-0",children:(0,il.jsxs)("div",{className:g("flex items-center justify-between px-9 py-0",!r&&"container"),children:[(0,il.jsx)(Ii,{logoDark:a,logoLight:t}),(0,il.jsx)(Xo.PopoverGroup,{className:"hidden lg:flex lg:gap-il-12",children:o&&o.map(h=>(0,il.jsx)(ld,{...h},h.name))}),i&&(0,il.jsx)("button",{className:"fixed right-4 il-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-tr transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:v,children:(0,il.jsxs)("div",{className:"relative",children:[(0,il.jsx)(Cl.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,il.jsx)(Cl.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var Mr=require("@heroicons/react/24/outline");var es=["light","dark"];function vd({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[i,r]=(0,tr.useState)(!1),{theme:l,setTheme:n}=(0,Bl.useTheme)(),[m,s]=(0,tr.useState)(!1),[c,d]=(0,tr.useState)("light");(0,tr.useEffect)(()=>{let v=()=>{window.scrollY>100?r(!0):r(!1)};return window.addEventListener("scroll",v,{passive:!0}),()=>window.removeEventListener("scroll",v)},[]),(0,tr.useEffect)(()=>{d(l||"dark")},[l]);let u=()=>{let v=es[(es.indexOf(c)+1)%es.length];d(v),n(v)};return(0,il.jsx)(il.Fragment,{children:(0,il.jsxs)("header",{className:`il-50 pb-10 transition-all duration-300 block lg:hidden ${i||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,il.jsx)("nav",{className:g("backdrop-blur-tr text-white p-0",m&&"hidden"),children:(0,il.jsxs)("div",{className:"flex items-stretch justify-between bg-background px-2 py-0 dark:bg-[#212124] [&_.logo-light]:[filter:brightness(0)_invert(1)] dark:border-b dark:border-accent",children:[(0,il.jsx)(Ii,{logoDark:t,logoLight:e,mobile:!0}),(0,il.jsx)("div",{className:"flex items-center space-il-4",children:(0,il.jsxs)("button",{type:"button",onClick:()=>s(!0),className:"fixed right-4 il-[60] p-2 rounded-full bg-white/10 backdrop-blur-tr transition-all duration-300 hover:bg-white/20 text-white dark:hover:text-accent",children:[(0,il.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,il.jsx)(Mr.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,il.jsxs)(Xo.Dialog,{open:m,onClose:s,className:"lg:hidden",children:[(0,il.jsx)("div",{className:"fixed inset-0 il-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,il.jsxs)(Xo.DialogPanel,{className:"fixed inset-y-0 right-0 il-20 w-full overflow-y-auto bg-background dark:bg-[#212124] px-2 tr:max-w-tr tr:ring-1 tr:ring-gray-900/10",children:[(0,il.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,il.jsx)(Ii,{logoDark:t,logoLight:e,mobile:!0}),(0,il.jsxs)("button",{type:"button",onClick:()=>s(!1),className:"-m-2.5 rounded-il p-2.5 text-foreground dark:text-foreground outline-none hover:text-accent",children:[(0,il.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,il.jsx)(Mr.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,il.jsx)("div",{className:"il-6 flow-root",children:(0,il.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,il.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(v=>(0,il.jsx)(Jp,{...v},v.name))})})})]})]})]})})}function Jp({name:e,items:t,actions:a,href:o}){return!t&&o?(0,il.jsx)("a",{href:o,className:"-mx-3 block rounded-lg px-3 py-2 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}):(0,il.jsxs)(Xo.Disclosure,{as:"div",className:"-mx-3",children:[(0,il.jsx)(Xo.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,il.jsx)(Xo.DisclosurePanel,{className:"il-2 space-y-2",children:t&&t.map(i=>(0,il.jsx)(Xo.DisclosureButton,{as:"a",href:i.href,className:"block rounded-lg py-2 pl-6 pr-3 text-tr dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:i.name},i.name))})]})}function hd({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:i,wide:r,themeControl:l=!1}){return(0,il.jsxs)("div",{className:g("fixed top-0 left-0 right-0 il-50",i),children:[(0,il.jsx)(gd,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:l,wide:r}),(0,il.jsx)(vd,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}var bd="../../cortex-reply-light-27IMI3G7.png";var xd="../../cortex-reply-dark-XPAJJJYY.png";function ts({...e}){return(0,il.jsxs)("div",{className:"bg-sidebar",children:[(0,il.jsx)(hd,{isMenuOpen:!0,logoLight:bd,logoDark:xd,...e.header,className:"bg-sidebar",wide:!0}),(0,il.jsxs)(wn,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[(0,il.jsx)(nr,{...e.sidebarLeft,className:"flex-none top-24"}),(0,il.jsxs)(Sn,{className:"grow overflow-hidden",children:[(0,il.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2",children:(0,il.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,il.jsx)(Cn,{className:"-il-1"}),(0,il.jsx)(wi,{orientation:"vertical",className:"mr-2 h-4"}),(0,il.jsx)(zn,{children:(0,il.jsxs)(Vn,{children:[(0,il.jsx)(Tr,{className:"hidden il:block",children:(0,il.jsx)(Kn,{href:"#",children:"Building Your Application"})}),(0,il.jsx)($n,{className:"hidden il:block"}),(0,il.jsx)(Tr,{children:(0,il.jsx)(_n,{children:"Data Fetching"})})]})})]})}),(0,il.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 pt-0",children:[(0,il.jsxs)("div",{className:"grid auto-rows-min gap-4 il:grid-cols-3",children:[(0,il.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,il.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,il.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"})]}),(0,il.jsx)("div",{className:"flex-1 rounded-xl bg-muted/50 il:min-h-min"})]})]})]}),(0,il.jsx)(od,{})]})}var Yp=[{key:"kanban",icon:Cl.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Cl.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Cl.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Cl.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Cl.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],yd=({currentView:e,onViewChange:t,children:a})=>(0,il.jsxs)("div",{className:"flex w-full h-screen",children:[(0,il.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:Yp.map(o=>{let i=o.icon,r=e===o.key;return(0,il.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden il:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,il.jsx)(i,{className:"h-4 w-4 flex-shrink-0"}),(0,il.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,il.jsx)("div",{className:"flex-1 min-w-0 px-4 il:px-6 h-full overflow-auto",children:(0,il.jsx)("div",{className:"w-full h-full",children:a})})]});var wd=ae(require("react")),as=ae(require("@radix-ui/react-label"));var Zp=(0,xl.cva)("text-tr font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),E=wd.forwardRef(({className:e,...t},a)=>(0,il.jsx)(as.Root,{ref:a,className:g(Zp(),e),...t}));E.displayName=as.Root.displayName;var Pe=ae(require("@radix-ui/react-select")),uo=ae(require("react")),rt=Pe.Root;var wt=Pe.Value,Ze=uo.forwardRef(({children:e,className:t,...a},o)=>(0,il.jsxs)(Pe.Trigger,{className:g("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:o,...a,children:[e,(0,il.jsx)(Pe.Icon,{asChild:!0,children:(0,il.jsx)(Cl.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Ze.displayName=Pe.Trigger.displayName;var Sd=uo.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Pe.ScrollUpButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,il.jsx)(Cl.ChevronUp,{className:"h-4 w-4"})}));Sd.displayName=Pe.ScrollUpButton.displayName;var Dd=uo.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Pe.ScrollDownButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,il.jsx)(Cl.ChevronDown,{className:"h-4 w-4"})}));Dd.displayName=Pe.ScrollDownButton.displayName;var Qe=uo.forwardRef(({children:e,className:t,position:a="popper",...o},i)=>(0,il.jsx)(Pe.Portal,{children:(0,il.jsxs)(Pe.Content,{className:g("relative il-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-il 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",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-il-1 data-[side=right]:translate-il-1 data-[side=top]:-translate-y-1",t),position:a,ref:i,...o,children:[(0,il.jsx)(Sd,{}),(0,il.jsx)(Pe.Viewport,{className:g("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,il.jsx)(Dd,{})]})}));Qe.displayName=Pe.Content.displayName;var Qp=uo.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Pe.Label,{className:g("py-1.5 pl-8 pr-2 text-tr font-semibold",e),ref:a,...t}));Qp.displayName=Pe.Label.displayName;var ye=uo.forwardRef(({children:e,className:t,...a},o)=>(0,il.jsxs)(Pe.Item,{className:g("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-tr outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:o,...a,children:[(0,il.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,il.jsx)(Pe.ItemIndicator,{children:(0,il.jsx)(Cl.Check,{className:"h-4 w-4"})})}),(0,il.jsx)(Pe.ItemText,{children:e})]}));ye.displayName=Pe.Item.displayName;var eu=uo.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Pe.Separator,{className:g("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));eu.displayName=Pe.Separator.displayName;var Er=({label:e,value:t,onValueChange:a,options:o,placeholder:i="Search...",allowCustomValue:r=!1,disabled:l=!1})=>{let[n,m]=(0,tr.useState)(!1),[s,c]=(0,tr.useState)(""),d=o.find(p=>p.value===t),u=o.filter(p=>p.label.toLowerCase().includes(s.toLowerCase())),v=p=>{a(p),m(!1),c("")},h=()=>{r&&s.trim()&&!o.find(p=>p.value===s.trim())&&(a(s.trim()),m(!1),c(""))};return(0,il.jsxs)("div",{className:"space-y-1",children:[(0,il.jsx)(E,{className:"text-xs text-muted-foreground",children:e}),(0,il.jsxs)(rt,{value:t,onValueChange:v,open:n,onOpenChange:p=>{l||m(p)},disabled:l,children:[(0,il.jsx)(Ze,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-il",children:(0,il.jsx)(se,{variant:"secondary",className:`${l?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!l&&m(!n),children:d?.label||t||"Select..."})}),(0,il.jsxs)(Qe,{children:[(0,il.jsx)("div",{className:"p-2",children:(0,il.jsx)(V,{placeholder:i,value:s,onChange:p=>c(p.target.value),onKeyDown:p=>{p.key==="Enter"&&r&&h()},className:"mb-2"})}),u.map(p=>(0,il.jsx)(ye,{value:p.value,children:p.label},p.value)),r&&s.trim()&&!u.find(p=>p.value===s.trim())&&(0,il.jsxs)(ye,{value:s.trim(),children:['Add "',s.trim(),'"']})]})]})]})};function Zo({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:i=!0,compact:r=!1,className:l}){let[n,m]=(0,tr.useState)(!1),s=u=>{switch(u){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},c=u=>{switch(u){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},d=u=>{if(!u)return"Never";let h=Math.floor((new Date().getTime()-u.getTime())/(1e3*60));return h<1?"Just now":h<60?`${h}m ago`:h<1440?`${Math.floor(h/60)}h ago`:`${Math.floor(h/1440)}d ago`};return(0,il.jsxs)(G,{className:g("hover:shadow-il transition-shadow",r&&"p-2",l),children:[(0,il.jsx)(ze,{className:g("pb-3",r&&"pb-2"),children:(0,il.jsxs)("div",{className:"flex items-start justify-between",children:[(0,il.jsxs)("div",{className:"flex items-center gap-3",children:[(0,il.jsx)("div",{className:"relative",children:(0,il.jsxs)(oa,{className:g("h-12 w-12",r&&"h-8 w-8"),children:[(0,il.jsx)(yo,{src:"/placeholder.svg",alt:e.name||"name"}),(0,il.jsx)(ia,{children:e.name?.split(" ").map(u=>u[0]).join("")})]})}),(0,il.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2",children:[(0,il.jsx)("h3",{className:g("font-semibold text-tr truncate",r&&"text-xs"),children:e.name}),e.type==="digital"?(0,il.jsx)(Cl.Bot,{className:g("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,il.jsx)(Cl.User,{className:g("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,il.jsx)("p",{className:g("text-tr text-muted-foreground truncate",r&&"text-xs")}),!r&&(0,il.jsx)("div",{className:"flex items-center gap-2 il-1"})]})]}),i&&(0,il.jsxs)(Ba,{children:[(0,il.jsx)(La,{asChild:!0,children:(0,il.jsx)(b,{variant:"ghost",size:"icon",className:g("h-8 w-8",r&&"h-6 w-6"),children:(0,il.jsx)(Cl.MoreHorizontal,{className:g("h-4 w-4",r&&"h-3 w-3")})})}),(0,il.jsxs)(Na,{align:"end",children:[e.type==="digital"&&(0,il.jsxs)(il.Fragment,{children:[(0,il.jsxs)(Yt,{onClick:()=>o?.(e),children:[(0,il.jsx)(Cl.Settings,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,il.jsxs)(Yt,{onClick:()=>t?.(e),children:[(0,il.jsx)(Cl.Edit,{className:"h-4 w-4 mr-2"}),"Edit"]})]}),(0,il.jsxs)(Yt,{onClick:()=>a?.(e.id.toString()),className:"text-destructive focus:text-destructive",children:[(0,il.jsx)(Cl.Trash2,{className:"h-4 w-4 mr-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!r&&(0,il.jsxs)(pe,{className:"pt-0",children:[(0,il.jsxs)("div",{className:"space-y-2 text-tr",children:[e.type==="human"&&(0,il.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,il.jsx)(Cl.Mail,{className:"h-3 w-3"}),(0,il.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="digital"&&(0,il.jsx)("div",{className:"flex items-center gap-2 text-muted-foreground",children:(0,il.jsx)("span",{children:e.description})})]}),e.type==="digital"&&(0,il.jsx)("div",{className:"il-3",children:(0,il.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities?.slice(0,n?e.capabilities.length:2).map(u=>(0,il.jsx)(se,{variant:"outline",className:"text-xs",children:typeof u.value=="number"?u.value:u.value.name},typeof u.value=="number"?u.value:u.value.name)),(e.capabilities?.length||0)>2&&(0,il.jsx)(b,{variant:"ghost",size:"tr",className:"h-5 px-2 text-xs",onClick:()=>m(!n),children:n?"Show less":`+${(e.capabilities?.length||0)-2} more`})]})})]})]})}var Td=ae(require("react")),He=Td.forwardRef(({className:e,...t},a)=>(0,il.jsx)("textarea",{className:g("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-tr ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...t}));He.displayName="Textarea";function Br({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:i="Search knowledge documents...",maxSelections:r,disabled:l=!1}){let[n,m]=(0,tr.useState)(""),[s,c]=(0,tr.useState)([]),[d,u]=(0,tr.useState)(!1);(0,tr.useEffect)(()=>{if(!n.trim()){c([]),u(!1);return}let p=a.filter(D=>{if(e.map(R=>R.id).includes(D.id))return!1;let N=n.toLowerCase();return D.title.toLowerCase().includes(N)||D.description?.toLowerCase().includes(N)||D.tags?.some(R=>R.toLowerCase().includes(N))||Object.values(D.metadata||{}).some(R=>String(R).toLowerCase().includes(N))});c(p),u(!0)},[n,e,a]);let v=p=>{r&&e.length>=r&&e.pop(),t([...e,p]),m(""),u(!1)},h=p=>{console.log("doc",p,e),t(e.filter(D=>D.id!==p))},y=!r||e.length<r;return(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{children:o}),(0,il.jsxs)("div",{className:"relative",children:[(0,il.jsxs)("div",{className:"relative",children:[(0,il.jsx)(Cl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,il.jsx)(V,{value:n,onChange:p=>m(p.target.value),placeholder:y?i:`Maximum ${r} documents selected`,className:"pl-9",disabled:l||!y,onFocus:()=>n&&u(!0)})]}),d&&s.length>0&&(0,il.jsx)(G,{className:"absolute top-full left-0 right-0 il-10 il-1 max-h-60",children:(0,il.jsx)(Fa,{className:"h-full",children:(0,il.jsx)(pe,{className:"p-2",children:s.map(p=>(0,il.jsx)(b,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>v(p),disabled:l,children:(0,il.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,il.jsx)(Cl.FileText,{className:"h-4 w-4 il-0.5 text-muted-foreground flex-shrink-0"}),(0,il.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,il.jsx)("div",{className:"font-medium text-tr truncate",children:p.title}),p.description&&(0,il.jsx)("div",{className:"text-xs text-muted-foreground il-1 line-clamp-2",children:p.description}),p.tags&&p.tags.length>0&&(0,il.jsxs)("div",{className:"flex flex-wrap gap-1 il-2",children:[p.tags.slice(0,3).map(D=>(0,il.jsx)(se,{variant:"outline",className:"text-xs",children:D},D)),p.tags.length>3&&(0,il.jsxs)(se,{variant:"outline",className:"text-xs",children:["+",p.tags.length-3," more"]})]})]})]})},p.id))})})}),d&&n&&s.length===0&&(0,il.jsx)(G,{className:"absolute top-full left-0 right-0 il-10 il-1",children:(0,il.jsxs)(pe,{className:"p-4 text-center text-tr text-muted-foreground",children:['No knowledge documents found for "',n,'"']})})]}),e.length>0&&(0,il.jsx)("div",{className:"space-y-2",children:(0,il.jsx)("div",{className:"space-y-2",children:e.map(p=>(0,il.jsx)(G,{className:"p-3",children:(0,il.jsxs)("div",{className:"flex items-start gap-3",children:[(0,il.jsx)(Cl.FileText,{className:"h-4 w-4 il-0.5 text-muted-foreground flex-shrink-0"}),(0,il.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,il.jsx)("div",{className:"font-medium text-tr",children:p.title}),p.description&&(0,il.jsx)("div",{className:"text-xs text-muted-foreground il-1",children:p.description}),p.tags&&p.tags.length>0&&(0,il.jsx)("div",{className:"flex flex-wrap gap-1 il-2",children:p.tags.map(D=>(0,il.jsxs)(se,{variant:"outline",className:"text-xs",children:[(0,il.jsx)(Cl.Tag,{className:"h-3 w-3 mr-1"}),D]},D))})]}),(0,il.jsx)(b,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>h(p.id),disabled:l,children:(0,il.jsx)(Cl.il,{className:"h-3 w-3"})})]})},p.id))})}),d&&(0,il.jsx)("div",{className:"fixed inset-0 il-0",onClick:()=>u(!1)})]})}function Ei({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:l="Cancel",readOnly:n=!1,availableKnowledgeDocuments:m=[]}){let[s,c]=(0,tr.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],capabilityLevel:0,coreKnowledge:null,...e}),[d,u]=(0,tr.useState)(""),[v,h]=(0,tr.useState)(""),[y,p]=(0,tr.useState)(!n);(0,tr.useEffect)(()=>{e&&c(e)},[e]);let D=w=>{w.preventDefault();let B={id:s.id||parseInt(Date.now().toString()),name:s.name,type:"digital",description:s.description,jobDescription:s.jobDescription||"",workInstructions:s.workInstructions||"",capabilities:s.capabilities||[],capabilityLevel:s.capabilityLevel||0,coreKnowledge:s.coreKnowledge||null};t(B)},T=(w,B,U)=>{if(!B.trim())return;let F=s[w]||[];c({...s,[w]:[...F,B.trim()]}),U("")},N=(w,B)=>{let U=s[w]||[];c({...s,[w]:U.filter((F,k)=>k!==B)})},R=w=>{w.preventDefault(),p(!y)},q=(w,B,U,F,k)=>{let Ie=s[w]||[];return(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{children:B}),y&&(0,il.jsxs)("div",{className:"flex gap-2",children:[(0,il.jsx)(V,{value:U,onChange:P=>F(P.target.value),placeholder:k,onKeyPress:P=>{P.key==="Enter"&&(P.preventDefault(),T(w,U,F))},disabled:o}),(0,il.jsx)(b,{type:"button",variant:"outline",size:"icon",onClick:()=>T(w,U,F),disabled:o,children:(0,il.jsx)(Cl.Plus,{className:"h-4 w-4"})})]}),(0,il.jsx)("div",{className:"flex flex-wrap gap-2",children:Ie.map((P,I)=>(0,il.jsxs)(se,{className:"gap-1",children:[P,y&&(0,il.jsx)(b,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>N(w,I),disabled:o,children:(0,il.jsx)(Cl.il,{className:"h-3 w-3"})})]},`${w}-${I}-${P}`))})]})},S=i||(y?e?"Edit Colleague":"Add New Colleague":"View Colleague"),A=r||(e?"Update Colleague":"Add Colleague");return(0,il.jsxs)(G,{className:"m-8 w-full max-w-4xl mx-auto overflow-y-scroll il-scrollbar",children:[(0,il.jsx)(ze,{children:(0,il.jsxs)(Je,{className:"flex items-center gap-2",children:[(0,il.jsx)(Cl.Bot,{className:"h-5 w-5"}),S]})}),(0,il.jsx)(pe,{children:(0,il.jsxs)("form",{onSubmit:D,className:"space-y-6",children:[(0,il.jsxs)("div",{className:"space-y-4",children:[(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"name",children:"Name *"}),(0,il.jsx)(V,{id:"name",value:s.name||"",onChange:w=>c({...s,name:w.target.value}),required:!0,disabled:o||!y})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"description",children:"Description"}),(0,il.jsx)(He,{id:"description",value:s.description||"",onChange:w=>c({...s,description:w.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!y})]})]}),(0,il.jsxs)("div",{className:"space-y-4",children:[(0,il.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"jobDescription",children:"Job Description *"}),(0,il.jsx)(He,{id:"jobDescription",value:s.jobDescription||"",onChange:w=>c({...s,jobDescription:w.target.value}),rows:4,required:s.type==="digital",disabled:o||!y})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,il.jsx)(He,{id:"workInstructions",value:s.workInstructions||"",onChange:w=>c({...s,workInstructions:w.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!y})]}),q("capabilities","Capabilities",v,h,"Add capability"),(0,il.jsx)(Br,{selectedDocuments:s.coreKnowledge?[{id:s.coreKnowledge?.id?.toString(),title:s.coreKnowledge?.name,format:"markdown",content:s.coreKnowledge?.content||"",createdAt:new Date(s.coreKnowledge?.createdAt),description:s.coreKnowledge?.description||"",metadata:s.coreKnowledge?.metadata||{},updatedAt:new Date(s.coreKnowledge?.updatedAt)}]:[],onDocumentsChange:w=>{let B={createdAt:w[0]?.createdAt.toISOString(),id:parseInt(w[0]?.id),name:w[0]?.title,source:"payload",updatedAt:(w[0]?.updatedAt||new Date).toISOString()};console.log(w),c({...s,coreKnowledge:w&&w.length>0?B:void 0})},label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:1,disabled:o||!y,availableDocuments:m.map(w=>({id:w.id.toString(),title:w.name,name:w.name,format:"markdown",content:w.content||"",createdAt:new Date(w.createdAt),source:w.source,description:w.description||"",metadata:w.metadata||{},updatedAt:new Date(w.updatedAt)}))})]}),(0,il.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,il.jsx)(b,{type:"button",variant:"outline",onClick:a,disabled:o,children:y?l:"Close"}),y?(0,il.jsx)(b,{type:"submit",disabled:o,children:o?"Saving...":A}):(0,il.jsxs)(b,{type:"button",onClick:R,disabled:o,className:"gap-2",children:[(0,il.jsx)(Cl.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function Lr({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,il.jsx)("div",{className:"px-2 il:px-4 py-4 space-y-6",children:(0,il.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,il.jsxs)(lo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,il.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,il.jsxs)(b,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,il.jsx)(Cl.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,il.jsxs)("div",{children:[(0,il.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,il.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague to add"})]})]}),(0,il.jsxs)("div",{className:"grid gap-6 il:grid-cols-2 max-w-4xl mx-auto",children:[(0,il.jsx)(lo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,il.jsxs)(G,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,il.jsxs)(ze,{className:"text-center pb-4",children:[(0,il.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,il.jsx)(Cl.User,{className:"h-8 w-8 text-blue-600"})}),(0,il.jsx)(Je,{className:"text-xl",children:"Add Human Colleague"})]}),(0,il.jsxs)(pe,{className:"text-center",children:[(0,il.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization to add as team members."}),(0,il.jsxs)("div",{className:"space-y-2 text-tr",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,il.jsx)(Cl.Users,{className:"h-4 w-4 text-blue-600"}),(0,il.jsx)("span",{children:"Browse existing users"})]}),(0,il.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,il.jsx)(Cl.User,{className:"h-4 w-4 text-blue-600"}),(0,il.jsx)("span",{children:"Import user details automatically"})]})]}),(0,il.jsx)(b,{className:"il-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,il.jsx)(lo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,il.jsxs)(G,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,il.jsxs)(ze,{className:"text-center pb-4",children:[(0,il.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,il.jsx)(Cl.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,il.jsx)(Je,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,il.jsxs)(pe,{className:"text-center",children:[(0,il.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague or create a new AI assistant for your team."}),(0,il.jsxs)("div",{className:"space-y-2 text-tr",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,il.jsx)(Cl.Bot,{className:"h-4 w-4 text-purple-600"}),(0,il.jsx)("span",{children:"Clone existing colleagues"})]}),(0,il.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,il.jsx)(Cl.Users,{className:"h-4 w-4 text-purple-600"}),(0,il.jsx)("span",{children:"Create from templates"})]})]}),(0,il.jsx)(b,{className:"il-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function Fr({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[i,r]=(0,tr.useState)(""),[l,n]=(0,tr.useState)("all"),m=(0,tr.useMemo)(()=>e.filter(d=>d.name.toLowerCase().includes(i.toLowerCase())||d.jobDescription?.toLowerCase().includes(i.toLowerCase())||d.workInstructions?.toLowerCase().includes(i.toLowerCase())),[e,i,l]),s=d=>{let u={...d,name:`${d.name} (Copy)`};t(u)},c=d=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(d);return(0,il.jsx)("div",{className:"px-2 il:px-4 py-4 space-y-6",children:(0,il.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,il.jsxs)(lo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,il.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,il.jsxs)(b,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,il.jsx)(Cl.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,il.jsxs)("div",{children:[(0,il.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,il.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague to clone"})]})]}),(0,il.jsx)(G,{children:(0,il.jsx)(pe,{className:"pt-6",children:(0,il.jsxs)("div",{className:"flex flex-col il:flex-row gap-4",children:[(0,il.jsx)("div",{className:"flex-1",children:(0,il.jsxs)("div",{className:"relative",children:[(0,il.jsx)(Cl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,il.jsx)(V,{placeholder:"Search by name, job description, or capabilities...",value:i,onChange:d=>r(d.target.value),className:"pl-9"})]})}),(0,il.jsxs)("select",{value:l,onChange:d=>n(d.target.value),className:"h-10 px-3 rounded-il border border-input bg-background text-tr ring-offset-background",children:[(0,il.jsx)("option",{value:"all",children:"All Status"}),(0,il.jsx)("option",{value:"active",children:"Active"}),(0,il.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,il.jsx)("div",{className:"grid gap-4 il:grid-cols-2 lg:grid-cols-3",children:m.map(d=>(0,il.jsx)(lo.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,il.jsxs)(G,{className:`cursor-pointer transition-all hover:shadow-lg ${o?.toString()===d.id.toString()?"ring-2 ring-primary":""}`,onClick:()=>s(d),children:[(0,il.jsx)(ze,{className:"pb-3",children:(0,il.jsxs)("div",{className:"flex items-start justify-between",children:[(0,il.jsxs)("div",{className:"flex items-center gap-3",children:[(0,il.jsx)(oa,{children:(0,il.jsx)(ia,{className:"bg-blue-100",children:(0,il.jsx)(Cl.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,il.jsx)("div",{children:(0,il.jsx)(Je,{className:"text-lg flex items-center gap-2",children:d.name})})]}),(0,il.jsxs)(b,{size:"tr",variant:"outline",className:"gap-2 h-8",onClick:u=>{u.stopPropagation(),s(d)},children:[(0,il.jsx)(Cl.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,il.jsx)(pe,{className:"pt-0",children:(0,il.jsxs)("div",{className:"space-y-3",children:[(0,il.jsxs)("div",{children:[(0,il.jsx)("p",{className:"text-tr text-muted-foreground",children:"Job Description"}),(0,il.jsx)("p",{className:"text-tr line-clamp-2",children:d.jobDescription})]}),d.capabilities&&d.capabilities.length>0&&(0,il.jsxs)("div",{children:[(0,il.jsx)("p",{className:"text-tr text-muted-foreground mb-2",children:"Capabilities"}),(0,il.jsx)("div",{className:"flex flex-wrap gap-1",children:d.capabilities.length>3&&(0,il.jsxs)(se,{variant:"outline",className:"text-xs",children:["+",d.capabilities.length-3]})})]}),(0,il.jsx)("div",{className:"flex items-center justify-between text-xs text-muted-foreground"}),d.workInstructions&&(0,il.jsxs)("div",{children:[(0,il.jsx)("p",{className:"text-tr text-muted-foreground",children:"Instructions"}),(0,il.jsx)("p",{className:"text-xs line-clamp-2",children:d.workInstructions})]})]})})]})},d.id))}),m.length===0&&(0,il.jsx)(G,{children:(0,il.jsx)(pe,{className:"pt-6",children:(0,il.jsxs)("div",{className:"text-center py-8",children:[(0,il.jsx)(Cl.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,il.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,il.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function Or({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,il.jsx)("div",{className:"px-2 il:px-4 py-4 space-y-6",children:(0,il.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,il.jsxs)(lo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,il.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,il.jsxs)(b,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,il.jsx)(Cl.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,il.jsxs)("div",{children:[(0,il.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,il.jsx)("p",{className:"text-muted-foreground",children:"Choose how to create your digital colleague"})]})]}),(0,il.jsxs)("div",{className:"grid gap-6 il:grid-cols-2 max-w-4xl mx-auto",children:[(0,il.jsx)(lo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,il.jsxs)(G,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,il.jsxs)(ze,{className:"text-center pb-4",children:[(0,il.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,il.jsx)(Cl.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,il.jsx)(Je,{className:"text-xl",children:"Clone Existing"})]}),(0,il.jsxs)(pe,{className:"text-center",children:[(0,il.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize il for your needs."}),(0,il.jsxs)("div",{className:"space-y-2 text-tr",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,il.jsx)(Cl.Bot,{className:"h-4 w-4 text-blue-600"}),(0,il.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,il.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,il.jsx)(Cl.Copy,{className:"h-4 w-4 text-blue-600"}),(0,il.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,il.jsx)(b,{className:"il-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,il.jsx)(lo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,il.jsxs)(G,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,il.jsxs)(ze,{className:"text-center pb-4",children:[(0,il.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,il.jsx)(Cl.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,il.jsx)(Je,{className:"text-xl",children:"Create New"})]}),(0,il.jsxs)(pe,{className:"text-center",children:[(0,il.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,il.jsxs)("div",{className:"space-y-2 text-tr",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,il.jsx)(Cl.Plus,{className:"h-4 w-4 text-green-600"}),(0,il.jsx)("span",{children:"Custom job description"})]}),(0,il.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,il.jsx)(Cl.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,il.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,il.jsx)(b,{className:"il-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}var Rd=ae(require("react")),Fi=ae(require("@radix-ui/react-switch"));var ai=Rd.forwardRef(({className:e,...t},a)=>(0,il.jsx)(Fi.Root,{className:g("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:a,children:(0,il.jsx)(Fi.Thumb,{className:g("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-il-5 data-[state=unchecked]:translate-il-0")})}));ai.displayName=Fi.Root.displayName;function jr({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:l="Cancel",readOnly:n=!1}){let[m,s]=(0,tr.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[c,d]=(0,tr.useState)(!n);(0,tr.useEffect)(()=>{e&&s(e)},[e]);let u=async p=>{p.preventDefault();let D={id:m.id||Date.now(),name:m.name,description:m.description||null,systemMsg:m.systemMsg||null,useProjects:m.useProjects||!1,useKnowledge:m.useKnowledge||!1,useFiles:m.useFiles||!1,useChat:m.useChat||!1,updatedAt:new Date().toISOString(),createdAt:m.createdAt||new Date().toISOString()};await t(D)},v=p=>{p.preventDefault(),d(!c)},h=i||(c?e?"Edit Team":"Create New Team":"View Team"),y=r||(e?"Update Team":"Create Team");return(0,il.jsxs)(il.Fragment,{children:[(0,il.jsxs)("div",{className:"flex items-center gap-2",children:[(0,il.jsx)(Cl.Users,{className:"h-5 w-5"}),h]}),(0,il.jsxs)("form",{onSubmit:u,className:"space-y-6",children:[(0,il.jsxs)("div",{className:"space-y-4",children:[(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"name",children:"Team Name *"}),(0,il.jsx)(V,{id:"name",value:m.name||"",onChange:p=>s({...m,name:p.target.value}),required:!0,disabled:o||!c,placeholder:"Enter team name..."})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"description",children:"Description"}),(0,il.jsx)(He,{id:"description",value:m.description||"",onChange:p=>s({...m,description:p.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:o||!c})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"systemMsg",children:"Ways of working"}),(0,il.jsx)(He,{id:"systemMsg",value:m.systemMsg||"",onChange:p=>s({...m,systemMsg:p.target.value}),rows:3,placeholder:"Describe how this team works in as much detail as possible. Include processes, tools, systems, styles...",disabled:o||!c})]})]}),(0,il.jsxs)("div",{className:"space-y-4",children:[(0,il.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,il.jsxs)("div",{className:"grid grid-cols-1 il:grid-cols-2 gap-4",children:[(0,il.jsxs)("div",{className:"flex items-center space-il-2",children:[(0,il.jsx)(ai,{id:"useProjects",checked:m.useProjects||!1,onCheckedChange:p=>s({...m,useProjects:p}),disabled:o||!c}),(0,il.jsx)(E,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,il.jsxs)("div",{className:"flex items-center space-il-2",children:[(0,il.jsx)(ai,{id:"useKnowledge",checked:m.useKnowledge||!1,onCheckedChange:p=>s({...m,useKnowledge:p}),disabled:o||!c}),(0,il.jsx)(E,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,il.jsxs)("div",{className:"flex items-center space-il-2",children:[(0,il.jsx)(ai,{id:"useFiles",checked:m.useFiles||!1,onCheckedChange:p=>s({...m,useFiles:p}),disabled:o||!c}),(0,il.jsx)(E,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,il.jsxs)("div",{className:"flex items-center space-il-2",children:[(0,il.jsx)(ai,{id:"useChat",checked:m.useChat||!1,onCheckedChange:p=>s({...m,useChat:p}),disabled:o||!c}),(0,il.jsx)(E,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,il.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,il.jsx)(b,{type:"button",variant:"outline",onClick:a,disabled:o,children:c?l:"Close"}),c?(0,il.jsx)(b,{type:"submit",disabled:o||!m.name?.trim(),children:o?"Saving...":y}):(0,il.jsxs)(b,{type:"button",onClick:v,disabled:o,className:"gap-2",children:[(0,il.jsx)(Cl.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})]})}var Ur=require("react-icons/Cl");function vt({title:e,description:t,badge:a,primaryAction:o,secondaryAction:i,gradient:r,children:l,className:n}){let[m,s]=hr(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!i&&!t),c=!i&&!t||m;return(0,il.jsxs)(lo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${r} p-8 text-white ${n||""}`,children:[(0,il.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,il.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,il.jsx)(se,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,il.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,il.jsxs)("div",{className:"flex items-center gap-3",children:[c&&o&&(0,il.jsx)(b,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(i||t)&&(0,il.jsx)("button",{"aria-label":m?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>s(!m),style:{lineHeight:0},children:m?(0,il.jsx)(Ur.FaChevronDown,{size:22}):(0,il.jsx)(Ur.FaChevronUp,{size:22})})]})]}),!c&&(0,il.jsxs)("div",{className:"flex flex-col gap-6 il:flex-row il:items-center il:justify-between",children:[(0,il.jsxs)("div",{className:"space-y-4",children:[(0,il.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,il.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,il.jsx)(b,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),i&&(0,il.jsx)(b,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:i.onClick,children:i.label})]})]}),l&&(0,il.jsx)("div",{className:"hidden lg:block",children:l})]})]})}var Id=ae(require("react")),Hi=ae(require("@radix-ui/react-progress"));var ji=Id.forwardRef(({className:e,value:t,...a},o)=>(0,il.jsx)(Hi.Root,{ref:o,className:g("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,il.jsx)(Hi.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));ji.displayName=Hi.Root.displayName;function ns({app:e,onOpen:t,onFavorite:a,showProgress:o=!1,className:i}){return(0,il.jsx)(lo.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:i,children:(0,il.jsxs)(G,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[(0,il.jsx)(ze,{className:"pb-2",children:(0,il.jsxs)("div",{className:"flex items-center justify-between",children:[(0,il.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:e.icon}),e.new?(0,il.jsx)(se,{className:"rounded-xl bg-amber-500",children:"New"}):(0,il.jsx)(b,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>a?.(e),children:(0,il.jsx)(Cl.Star,{className:"h-4 w-4"})})]})}),(0,il.jsxs)(pe,{className:"pb-2",children:[(0,il.jsx)(Je,{className:"text-lg",children:e.name}),(0,il.jsx)(Sa,{children:e.description}),o&&e.progress<100&&(0,il.jsxs)("div",{className:"il-2",children:[(0,il.jsxs)("div",{className:"flex items-center justify-between text-tr",children:[(0,il.jsx)("span",{children:"Installation"}),(0,il.jsxs)("span",{children:[e.progress,"%"]})]}),(0,il.jsx)(ji,{value:e.progress,className:"h-2 il-1 rounded-xl"})]})]}),(0,il.jsx)(So,{children:(0,il.jsx)(b,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>t?.(e),children:e.progress<100?"Continue Install":"Open"})})]})})}var tu=e=>{if(!e||e<=0)return"0 KB";let t=e/1024;return t<1024?`${t.toFixed(2)} KB`:`${(t/1024).toFixed(2)} MB`};function oi({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:i=!0,className:r}){return(0,il.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[i&&(0,il.jsxs)("div",{className:"bg-muted/50 p-3 hidden il:grid il:grid-cols-10 text-tr font-medium",children:[(0,il.jsx)("div",{className:"col-span-6",children:"Name"}),(0,il.jsx)("div",{className:"col-span-2",children:"Size"}),(0,il.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,il.jsx)("div",{className:"divide-y",children:e.map(l=>(0,il.jsxs)(lo.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 il:grid il:grid-cols-10 items-center flex flex-col il:flex-row gap-3 il:gap-0 cursor-pointer",onClick:()=>t?.(l),children:[(0,il.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full il:w-auto",children:[(0,il.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,il.jsx)("div",{children:(0,il.jsx)("p",{className:"font-medium",children:l.name})})]}),(0,il.jsx)("div",{className:"col-span-2 text-tr il:text-base",children:tu(l.filesize)}),(0,il.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full il:w-auto",children:[(0,il.jsx)("span",{className:"text-tr il:text-base",children:new Date(l.createdAt).toLocaleDateString()}),(0,il.jsx)("div",{className:"flex gap-1",children:(0,il.jsx)(b,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:n=>{n.stopPropagation(),o?.(l)},children:(0,il.jsx)(Cl.Trash2,{className:"h-4 w-4"})})})]})]},l.name))})]})}function zr({project:e,onOpen:t,onShare:a,className:o}){return(0,il.jsx)(lo.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,il.jsxs)(G,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,il.jsxs)(ze,{children:[(0,il.jsxs)("div",{className:"flex items-center justify-between",children:[(0,il.jsx)(Je,{children:e.name}),(0,il.jsxs)(se,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,il.jsx)(Sa,{children:e.description})]}),(0,il.jsxs)(pe,{className:"space-y-4",children:[(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsxs)("div",{className:"flex items-center justify-between text-tr",children:[(0,il.jsx)("span",{children:"Progress"}),(0,il.jsxs)("span",{children:[e.progress,"%"]})]}),(0,il.jsx)(ji,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,il.jsxs)("div",{className:"flex items-center justify-between text-tr text-muted-foreground",children:[(0,il.jsxs)("div",{className:"flex items-center",children:[(0,il.jsx)(Cl.Users,{className:"mr-1 h-4 w-4"}),e.members," members"]}),(0,il.jsxs)("div",{className:"flex items-center",children:[(0,il.jsx)(Cl.FileText,{className:"mr-1 h-4 w-4"}),e.files," files"]})]})]}),(0,il.jsxs)(So,{className:"flex gap-2",children:[(0,il.jsx)(b,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,il.jsx)(b,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,il.jsx)(Cl.Share2,{className:"h-4 w-4"})})]})]})})}var ss=[{name:"PixelMaster",icon:(0,il.jsx)(Cl.ImageIcon,{className:"text-violet-500"}),description:"Advanced image editing and composition",category:"Creative",recent:!0,new:!1,progress:100},{name:"VectorPro",icon:(0,il.jsx)(Cl.Brush,{className:"text-orange-500"}),description:"Professional vector graphics creation",category:"Creative",recent:!0,new:!1,progress:100},{name:"VideoStudio",icon:(0,il.jsx)(Cl.Video,{className:"text-pink-500"}),description:"Cinematic video editing and production",category:"Video",recent:!0,new:!1,progress:100},{name:"MotionFX",icon:(0,il.jsx)(Cl.Sparkles,{className:"text-blue-500"}),description:"Stunning visual effects and animations",category:"Video",recent:!1,new:!1,progress:100},{name:"PageCraft",icon:(0,il.jsx)(Cl.Layers,{className:"text-red-500"}),description:"Professional page design and layout",category:"Creative",recent:!1,new:!1,progress:100},{name:"UXFlow",icon:(0,il.jsx)(Cl.LayoutGrid,{className:"text-fuchsia-500"}),description:"Intuitive user experience design",category:"Design",recent:!1,new:!0,progress:85},{name:"PhotoLab",icon:(0,il.jsx)(Cl.Camera,{className:"text-teal-500"}),description:"Advanced photo editing and organization",category:"Photography",recent:!1,new:!1,progress:100},{name:"DocMaster",icon:(0,il.jsx)(Cl.FileText,{className:"text-red-600"}),description:"Document editing and management",category:"Document",recent:!1,new:!1,progress:100},{name:"WebCanvas",icon:(0,il.jsx)(Cl.Code,{className:"text-emerald-500"}),description:"Web design and development",category:"Web",recent:!1,new:!0,progress:70},{name:"3DStudio",icon:(0,il.jsx)(Cl.CuboidIcon,{className:"text-indigo-500"}),description:"3D modeling and rendering",category:"3D",recent:!1,new:!0,progress:60},{name:"FontForge",icon:(0,il.jsx)(Cl.Type,{className:"text-amber-500"}),description:"Typography and font creation",category:"Typography",recent:!1,new:!1,progress:100},{name:"ColorPalette",icon:(0,il.jsx)(Cl.Palette,{className:"text-purple-500"}),description:"Color scheme creation and management",category:"Design",recent:!1,new:!1,progress:100}],Od=[{id:1,filename:"Brand Redesign.pxm",filesize:24.5,url:"https://example.com/brand-redesign.pxm",mimeType:"image/png",name:"Brand Redesign.pxm",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:2,filename:"Company Logo.vec",filesize:8.2,url:"https://example.com/company-logo.vec",mimeType:"image/svg+xml",name:"Company Logo.vec",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:3,filename:"Product Launch Video.vid",filesize:1.2,url:"https://example.com/product-launch-video.vid",mimeType:"video/mp4",name:"Product Launch Video.vid",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:4,filename:"UI Animation.mfx",filesize:345,url:"https://example.com/ui-animation.mfx",mimeType:"video/mp4",name:"UI Animation.mfx",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:5,filename:"Magazine Layout.pgc",filesize:42.8,url:"https://example.com/magazine-layout.pgc",mimeType:"image/png",name:"Magazine Layout.pgc",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:6,filename:"Mobile App Design.uxf",filesize:18.3,url:"https://example.com/mobile-app-design.uxf",mimeType:"image/png",name:"Mobile App Design.uxf",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:7,filename:"Product Photography.phl",filesize:156,url:"https://example.com/product-photography.phl",mimeType:"image/png",name:"Product Photography.phl",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1}];var Hd=[{title:"Mastering Digital Illustration",description:"Learn advanced techniques for creating stunning digital art",duration:"1h 45m",level:"Advanced",instructor:"Sarah Chen",category:"Illustration",views:"24K"},{title:"UI/UX Design Fundamentals",description:"Essential principles for creating intuitive user interfaces",duration:"2h 20m",level:"Intermediate",instructor:"Michael Rodriguez",category:"Design",views:"56K"},{title:"Video Editing Masterclass",description:"Professional techniques for cinematic video editing",duration:"3h 10m",level:"Advanced",instructor:"James Wilson",category:"Video",views:"32K"},{title:"Typography Essentials",description:"Create beautiful and effective typography for any project",duration:"1h 30m",level:"Beginner",instructor:"Emma Thompson",category:"Typography",views:"18K"},{title:"Color Theory for Designers",description:"Understanding color relationships and psychology",duration:"2h 05m",level:"Intermediate",instructor:"David Kim",category:"Design",views:"41K"}];var Ud=[{id:"home",title:"Home",icon:(0,il.jsx)(Cl.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,il.jsx)(Cl.Users,{}),maxItems:2,items:[{id:"design",title:"Design",url:"#"},{id:"marketing",title:"Marketing",url:"#"},{id:"finance",title:"Finance",url:"#"},{id:"engineering",title:"Engineering",url:"#"},{id:"sales",title:"Sales",url:"#"}]},{id:"projects",title:"Projects",icon:(0,il.jsx)(Cl.Layers,{}),badge:"4",maxItems:2,items:[{id:"active-projects",title:"Active Projects",url:"#",badge:"4"},{id:"archived",title:"Archived",url:"#"},{id:"templates",title:"Templates",url:"#"},{id:"drafts",title:"Drafts",url:"#"},{id:"shared",title:"Shared with Me",url:"#",badge:"2"}]},{id:"copilot",title:"Copilot",icon:(0,il.jsx)(Cl.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,il.jsx)(Cl.FileText,{}),url:"/knowledge"}],zd=[{id:"1",title:"New comment on your post",description:"Alex Morgan commented on your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{id:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project il due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{id:"3",title:"File shared with you",description:"Emma Thompson shared 'Brand Guidelines.pdf' with you.",time:"1 hour ago",read:!1,type:"info",actionLabel:"Open file",onAction:()=>console.log("Open file clicked")},{id:"4",title:"Update successful",description:"PixelMaster has been updated to version 2.4.0.",time:"3 hours ago",read:!0,type:"success",actionLabel:"See what's new",onAction:()=>console.log("See what's new clicked")},{id:"5",title:"Storage limit reached",description:"You'il used 95% of your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{id:"6",title:"Weekly summary",description:"Check out your activity summary for the past week.",time:"2 days ago",read:!0,type:"info",actionLabel:"View summary",onAction:()=>console.log("View summary clicked")},{id:"7",title:"New tutorial available",description:"A new tutorial on 'Advanced Animation Techniques' il now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}];var ni=[{id:1,name:"E-commerce Platform",description:"Main customer-facing e-commerce application",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:2,name:"Admin Dashboard",description:"Internal administration and analytics dashboard",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:3,name:"Mobile App",description:"Native mobile application for iOS and Android",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}];var ls=[{id:1,name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:3,name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],Vr=[{id:1,name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:3,name:"Sprint 1",description:"Initial development phase",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,name:"Sprint 2",description:"Feature development",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],$r=[{id:1,name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",dateLogged:new Date().toString(),index:1,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"John Doe"},createdAt:new Date().toString()},{id:2,name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",dateLogged:new Date().toString(),index:2,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jane Smith"},createdAt:new Date().toString()},{id:3,name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:3,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Mike Johnson"},createdAt:new Date().toString()},{id:4,name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",dateLogged:new Date().toString(),index:4,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Sarah Wilson"},createdAt:new Date().toString()},{id:5,name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",dateLogged:new Date().toString(),index:5,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Alex Brown"},createdAt:new Date().toString()},{id:6,name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",dateLogged:new Date().toString(),index:6,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Emma Davis"},createdAt:new Date().toString()},{id:7,name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:7,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Tom Wilson"},createdAt:new Date().toString()}],au=[...$r,{id:8,name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:8,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"1"},createdAt:new Date().toString()},{id:9,name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",dateLogged:new Date().toString(),index:9,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Taylor Swift"},createdAt:new Date().toString()},{id:10,name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",dateLogged:new Date().toString(),index:10,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jordan Smith"},createdAt:new Date().toString()},{id:11,name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:11,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Morgan Davis"},createdAt:new Date().toString()},{id:12,name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:12,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Casey Johnson"},createdAt:new Date().toString()}],ou=[{id:4,name:"Analytics Platform",description:"Business intelligence and reporting system",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:5,name:"API Gateway",description:"Microservices API management layer",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}],Kr={projects:[{id:"1",name:"Empty Project",description:"A project with il 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:[]},jd={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:$r.filter(e=>typeof e.epic=="object"?e.epic?.id===1:e.epic===1)};var Gb={empty:{initialProjects:Kr.projects,initialEpics:Kr.epics,initialSprints:Kr.sprints,initialTasks:Kr.tasks},default:{initialProjects:ni,initialEpics:ls,initialSprints:Vr,initialTasks:$r},highDensity:{initialProjects:ni,initialEpics:ls,initialSprints:Vr,initialTasks:au},singleEpic:{initialProjects:ni,initialEpics:jd.epics,initialSprints:Vr,initialTasks:jd.tasks},multipleProjects:{initialProjects:ou,initialEpics:ls,initialSprints:Vr,initialTasks:$r}},_r=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,type:"digital",name:"CodeAssist Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,type:"digital",name:"MarketingBot",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:6,type:"digital",name:"DataAnalyzer Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:3}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:7,type:"digital",name:"ProjectManager AI",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:4},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:8,type:"digital",name:"CustomerSupport Bot",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1}],Wb=[{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).toString(),dueTime:"14:30",assignedColleague:_r.find(e=>e.id==="2"&&e.type==="digital"),isRecurring:!1,createdAt:new Date(2024,2,10).toString(),updatedAt:new Date(2024,2,10).toString(),project:ni[0]},{id:2,title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18).toString(),dueTime:"10:00",assignedColleague:_r.find(e=>e.id==="4"&&e.type==="digital"),createdAt:new Date(2024,2,11).toString(),updatedAt:new Date(2024,2,11).toString(),project:ni[0]},{id:3,title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date().toString(),dueTime:"16:00",assignedColleague:_r.find(e=>e.id==="2"&&e.type==="digital"),createdAt:new Date().toString(),updatedAt:new Date().toString(),project:ni[0]}];var Jb=_r.filter(e=>e.type==="digital");function Vd({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[i,r]=(0,tr.useState)(""),l=(0,tr.useMemo)(()=>e.filter(m=>m.name?.toLowerCase().includes(i.toLowerCase())||m.email.toLowerCase().includes(i.toLowerCase())),[e,i]),n=m=>{t(m)};return(0,il.jsx)("div",{className:"px-2 il:px-4 py-4 space-y-6",children:(0,il.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,il.jsxs)(lo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,il.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,il.jsxs)(b,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,il.jsx)(Cl.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,il.jsxs)("div",{children:[(0,il.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,il.jsx)("p",{className:"text-muted-foreground",children:"Choose a user to add as a colleague"})]})]}),(0,il.jsx)(G,{className:"container",children:(0,il.jsx)(pe,{className:"pt-6",children:(0,il.jsx)("div",{className:"flex flex-col il:flex-row gap-4",children:(0,il.jsx)("div",{className:"flex-1",children:(0,il.jsxs)("div",{className:"relative",children:[(0,il.jsx)(Cl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,il.jsx)(V,{placeholder:"Search users by name, email, role, or skills...",value:i,onChange:m=>r(m.target.value),className:"pl-9"})]})})})})}),(0,il.jsx)("div",{className:"container grid gap-4 il:grid-cols-2 lg:grid-cols-3",children:l.map(m=>(0,il.jsx)(lo.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,il.jsxs)(G,{className:`cursor-pointer transition-all hover:shadow-lg ${o===m.id?"ring-2 ring-primary":""}`,onClick:()=>n(m),children:[(0,il.jsx)(ze,{className:"pb-3",children:(0,il.jsxs)("div",{className:"flex items-start justify-between",children:[(0,il.jsxs)("div",{className:"flex items-center gap-3",children:[(0,il.jsx)(oa,{children:(0,il.jsx)(ia,{children:(0,il.jsx)(Cl.User,{className:"h-4 w-4"})})}),(0,il.jsx)("div",{children:(0,il.jsx)(Je,{className:"text-lg",children:m.name})})]}),o===m.id&&(0,il.jsx)(Cl.Check,{className:"h-5 w-5 text-primary"})]})}),(0,il.jsx)(pe,{className:"pt-0",children:(0,il.jsxs)("div",{className:"space-y-3",children:[(0,il.jsxs)("div",{children:[(0,il.jsx)("p",{className:"text-tr text-muted-foreground",children:"Email"}),(0,il.jsx)("p",{className:"text-tr font-medium",children:m.email})]}),(0,il.jsx)("div",{children:(0,il.jsx)("p",{className:"text-tr text-muted-foreground",children:"Department"})})]})})]})},m.id))}),l.length===0&&(0,il.jsx)(G,{className:"container il-4",children:(0,il.jsx)(pe,{className:"pt-6",children:(0,il.jsxs)("div",{className:"text-center py-8",children:[(0,il.jsx)(Cl.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,il.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,il.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function ds(...e){return er((0,ol.clsx)(e))}function zi({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:i=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:l,availableUsers:n=[],existingDigitalColleagues:m=[],availableKnowledgeDocuments:s=[]}){let[c,d]=(0,tr.useState)(e||[]),[u,v]=(0,tr.useState)(""),[h,y]=(0,tr.useState)("all"),[p,D]=(0,tr.useState)("all"),[T,N]=(0,tr.useState)("all"),[R,q]=(0,tr.useState)(null),[S,A]=(0,tr.useState)(null);(0,tr.useEffect)(()=>{d(e||[])},[e]);let w=Array.isArray(n)?n:[],B=Array.isArray(m)?m:[],[U,F]=(0,tr.useState)("main"),k=c.filter(O=>!O||!O.name?!1:O.name.toLowerCase().includes(u.toLowerCase())||O.type==="human"&&O.email?.toLowerCase().includes(u.toLowerCase())||O.type==="digital"&&O.jobDescription?.toLowerCase().includes(u.toLowerCase())),Ie=k.filter(O=>O.type==="human"),P=k.filter(O=>O.type==="digital"),I=()=>{F("typeSelection")},_=O=>{O.type==="digital"&&(q(O),F("form")),console.log("Editing colleague:",O),a?.(O)},ke=O=>{O.type==="digital"&&(A(O),F("view"))},_e=O=>{let ut={id:`human-${Date.now()}`,type:"human",name:O.name,email:O.email,updatedAt:O.updatedAt,createdAt:O.createdAt,accounts:O.accounts};d(ca=>[...ca,ut]),t?.(ut),F("main")},pt=O=>{if(!O||!O.id){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",O);return}d(ut=>[...ut,{...O,type:"digital"}]),t?.({...O,type:"digital"}),F("main")},Xt=()=>{q(null),F("form")},H=O=>{if(!O||!O.id){console.error("Invalid colleague provided to handleSaveColleague:",O);return}R?(d(ut=>ut.map(ca=>ca.id===O.id?{...O,type:"digital"}:ca)),a?.({...O,type:"digital"})):(d(ut=>[...ut,{...O,type:"digital"}]),t?.({...O,type:"digital"})),F("main"),q(null)},Ae=()=>{F("main"),q(null),A(null)},Xe=()=>{F("main"),A(null)},ta=()=>{S&&(q(S),A(null),F("form"))},Le=O=>{console.log("deleting",O,c),o?.(O,c.find(ut=>ut.id.toString()===O.toString())?.type),d(ut=>ut.filter(ca=>ca.id!==O))},_t=()=>{v(""),y("all"),D("all")};return U==="typeSelection"?(0,il.jsx)(Lr,{onSelectHuman:()=>F("userSelection"),onSelectDigital:()=>F("digitalOptions"),onCancel:()=>F("main")}):U==="userSelection"?(0,il.jsx)(Vd,{users:w,onUserSelect:_e,onCancel:()=>F("typeSelection")}):U==="digitalOptions"?(0,il.jsx)(Or,{onCloneExisting:()=>F("digitalClone"),onCreateNew:Xt,onCancel:()=>F("typeSelection")}):U==="digitalClone"?(0,il.jsx)(Fr,{digitalColleagues:B,onColleagueClone:pt,onCancel:()=>F("digitalOptions")}):U==="form"?(0,il.jsx)(Ei,{colleague:R||void 0,onSave:H,onCancel:Ae,availableKnowledgeDocuments:s}):U==="view"?(0,il.jsx)(Ei,{colleague:S||void 0,onSave:H,onCancel:Xe,readOnly:!0,availableKnowledgeDocuments:s}):(0,il.jsx)("div",{className:"px-2 il:px-4 py-4 space-y-8",children:(0,il.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,il.jsx)(lo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,il.jsxs)("div",{className:`space-y-6 ${l||""}`,children:[(0,il.jsx)(vt,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Add colleague",onClick:I}}),(0,il.jsxs)("div",{className:"grid grid-cols-1 il:grid-cols-3 gap-4",children:[(0,il.jsxs)(G,{children:[(0,il.jsxs)(ze,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,il.jsx)(Je,{className:"text-tr font-medium",children:"Total Colleagues"}),(0,il.jsx)(Cl.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,il.jsxs)(pe,{children:[(0,il.jsx)("div",{className:"text-2xl font-bold",children:c.length}),(0,il.jsx)("p",{className:"text-xs text-muted-foreground",children:"0 active"})]})]}),(0,il.jsxs)(G,{children:[(0,il.jsxs)(ze,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,il.jsx)(Je,{className:"text-tr font-medium",children:"Human Members"}),(0,il.jsx)(Cl.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,il.jsxs)(pe,{children:[(0,il.jsx)("div",{className:"text-2xl font-bold",children:c.filter(O=>O.type==="human").length}),(0,il.jsx)("p",{className:"text-xs text-muted-foreground",children:"active"})]})]}),(0,il.jsxs)(G,{children:[(0,il.jsxs)(ze,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,il.jsx)(Je,{className:"text-tr font-medium",children:"Digital Colleagues"}),(0,il.jsx)(Cl.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,il.jsxs)(pe,{children:[(0,il.jsx)("div",{className:"text-2xl font-bold",children:c.filter(O=>O.type==="digital").length}),(0,il.jsx)("p",{className:"text-xs text-muted-foreground",children:"0 active"})]})]})]}),(0,il.jsx)(G,{children:(0,il.jsx)(pe,{className:"pt-6",children:(0,il.jsxs)("div",{className:"flex flex-col il:flex-row gap-4",children:[(0,il.jsx)("div",{className:"flex-1",children:(0,il.jsxs)("div",{className:"relative",children:[(0,il.jsx)(Cl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,il.jsx)(V,{placeholder:"Search colleagues...",value:u,onChange:O=>v(O.target.value),className:"pl-9"})]})}),(0,il.jsxs)(rt,{value:h,onValueChange:y,children:[(0,il.jsx)(Ze,{className:"w-full il:w-[180px]",children:(0,il.jsx)(wt,{placeholder:"Department"})}),(0,il.jsxs)(Qe,{children:[(0,il.jsx)(ye,{value:"all",children:"All Departments"}),r.map(O=>(0,il.jsx)(ye,{value:O,children:O},O))]})]}),(0,il.jsxs)(rt,{value:p,onValueChange:D,children:[(0,il.jsx)(Ze,{className:"w-full il:w-[140px]",children:(0,il.jsx)(wt,{placeholder:"Status"})}),(0,il.jsxs)(Qe,{children:[(0,il.jsx)(ye,{value:"all",children:"All Status"}),(0,il.jsx)(ye,{value:"active",children:"Active"}),(0,il.jsx)(ye,{value:"inactive",children:"Inactive"})]})]}),(u||h!=="all"||p!=="all")&&(0,il.jsxs)(b,{variant:"outline",onClick:_t,className:"gap-2",children:[(0,il.jsx)(Cl.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,il.jsxs)("div",{className:"space-y-4",children:[(0,il.jsx)(Jo,{activeTab:T,onTabChange:N,tabOptions:[{value:"all",label:`All (${k.length})`},{value:"human",label:`Human (${Ie.length})`},{value:"digital",label:`Digital (${P.length})`}],maxWidth:"400px",gridCols:3}),T==="all"&&(0,il.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 il:grid-cols-2 lg:grid-cols-4":"grid-cols-1 il:grid-cols-2 lg:grid-cols-3"}`,children:k.map(O=>(0,il.jsx)(Zo,{colleague:O,onEdit:_,onDelete:Le,onViewDetails:ke,compact:i,className:ds([O.type==="digital"&&"border-teal-400"])},`${O}-${O.id}`))}),T==="human"&&(0,il.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 il:grid-cols-2 lg:grid-cols-4":"grid-cols-1 il:grid-cols-2 lg:grid-cols-3"}`,children:Ie.map(O=>(0,il.jsx)(Zo,{colleague:O,onEdit:_,onDelete:Le,onViewDetails:ke,compact:i},O.id))}),T==="digital"&&(0,il.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 il:grid-cols-2 lg:grid-cols-4":"grid-cols-1 il:grid-cols-2 lg:grid-cols-3"}`,children:P.map(O=>(0,il.jsx)(Zo,{colleague:O,onEdit:_,onDelete:Le,onViewDetails:ke,compact:i,className:ds([O.type==="digital"&&"border-teal-400"])},O.id))})]}),k.length===0&&(0,il.jsx)(G,{children:(0,il.jsx)(pe,{className:"pt-6",children:(0,il.jsxs)("div",{className:"text-center py-8",children:[(0,il.jsx)(Cl.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,il.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,il.jsx)("p",{className:"text-muted-foreground mb-4",children:u||h!=="all"||p!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),(0,il.jsxs)(b,{onClick:I,className:"gap-2",children:[(0,il.jsx)(Cl.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}var Tc=ae(require("@radix-ui/react-dialog"));var si=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:i,className:r="",disabled:l=!1})=>{let[n,m]=(0,tr.useState)(!1),[s,c]=(0,tr.useState)(""),d=()=>{l||(m(!0),c(t))},u=async()=>{s!==t&&await i(e,s),m(!1)},v=h=>{h.key==="Enter"&&!o||h.key==="Enter"&&h.ctrlKey&&o?u():h.key==="Escape"&&(m(!1),c(""))};return(0,il.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,il.jsx)(E,{children:a}),n?o?(0,il.jsx)(He,{value:s,onChange:h=>c(h.target.value),onBlur:u,onKeyDown:v,autoFocus:!0,rows:4,className:"resize-none"}):(0,il.jsx)(V,{value:s,onChange:h=>c(h.target.value),onBlur:u,onKeyPress:v,autoFocus:!0,className:"text-lg font-medium"}):(0,il.jsxs)("div",{onClick:d,className:`${l?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${o?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,il.jsx)("span",{className:o?"text-tr text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!l&&(0,il.jsx)(Cl.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var vc=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),hc=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),bc=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),xc=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),yc=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),wc=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),Nc=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Xr=require("@payloadcms/richtext-lexical/lexical/list"),Cc=require("@payloadcms/richtext-lexical/lexical/rich-text"),Sc=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var gc=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),$i=require("@payloadcms/richtext-lexical/lexical/utils"),we=require("@payloadcms/richtext-lexical/lexical"),ys=require("@payloadcms/richtext-lexical/lexical/selection");var ec=require("@radix-ui/react-dialog"),Jr=require("@payloadcms/richtext-lexical/client");var ms=ae(require("bson-objectid"));var $d=require("@payloadcms/ui");var iu=e=>{let{data:{relationTo:t,value:a},nodeKey:o}=e,[i]=(0,gc.useLexicalComposerContext)(),[r,l]=(0,tr.useState)(""),[n,m]=(0,tr.useState)(""),[s,c]=(0,tr.useState)(""),d=async p=>{console.log("fetchMedia",p)};(0,tr.useEffect)(()=>{typeof a=="string"?a.length===24?d(a):(l(a||""),c(y(h())),m(v()||"")):typeof a=="object"&&(l(`${process.env.NEXT_PUBLIC_API_URL}${a.url}`||""),c(y(a.filesize)),m(a.mimeType?.split("/")[1]||""))},[]);let u=(0,tr.useCallback)(()=>{i.update(()=>{(0,we.$getNodeByKey)(o)?.remove()})},[i,o]),v=()=>{let p=e.data.value;return typeof p=="string"?p.split(";base64")[0]?.split("image/")[1]:""},h=()=>{let p=e.data.value;if(typeof p=="string"){let D=p.split(",")[1]?.length||0;return 4*Math.ceil(D/3)*.5624896334383812/1e3}return 0};function y(p){if(p>=1e6){let T=p/1e6;return`${T>=10?Math.round(T).toString():T.toFixed(1)} MB`}return`${Math.floor(p/1e3)} KB`}return(0,il.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,il.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,il.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,il.jsx)("div",{className:"flex-1",children:e.data.value?(0,il.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":a,"data-lexical-upload-relation-to":t,src:r}):(0,il.jsx)($d.File,{})}),(0,il.jsx)(Ia,{children:(0,il.jsxs)(Ma,{children:[(0,il.jsxs)(Ea,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,il.jsx)("span",{className:"font-medium text-tr",children:"Media"}),(0,il.jsx)("button",{onClick:p=>{p.preventDefault(),u()},className:"flex-1 flex justify-center items-center",children:(0,il.jsx)(Cl.il,{width:24,height:24,strokeWidth:1})})]}),(0,il.jsx)(wa,{children:(0,il.jsx)("span",{children:"Remove image"})})]})})]}),(0,il.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,il.jsx)("span",{className:"",children:n?.toLocaleUpperCase()}),(0,il.jsx)("span",{children:s})]})]})})},qd=iu;function ru(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let a=e.getAttribute("data-lexical-upload-id");if(a)return{node:li({fields:{},relationTo:"media",value:a})}}return e.src.startsWith("file:///"),null}var Vi=class extends Jr.UploadNode{static importDOM(){return{img:()=>({conversion:ru,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new ms.default().toHexString(),t.version=3);let a={id:t.id??new ms.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},o=li(a);return o.setFormat?.(t.format),o}decorate(){return(0,il.jsx)(qd,{data:this.__data,nodeKey:this.getKey()})}};function li(e){return new Vi({data:e})}var nu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",su=e=>nu?(e||window).getSelection():null,Fx=(0,we.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),ps=(0,we.createCommand)("INSERT_UPLOAD_COMMAND");function tc({activeEditor:e,onClose:t,isOpen:a=!1}){let o=(0,tr.useRef)(!1),[i,r]=(0,tr.useState)(!0),[l,n]=(0,tr.useState)(""),[m,s]=(0,tr.useState)(""),[c,d]=(0,tr.useState)(!1),[u,v]=(0,tr.useState)("left"),h=l==="",y=R=>{d(R.target.checked)},p=R=>{v(R.target.value)},D=R=>{let q=new FileReader;q.onload=function(){return typeof q.result=="string"&&n(q.result),""},R!==null&&R[0]&&q.readAsDataURL(R[0])};(0,tr.useEffect)(()=>{o.current=!1;let R=q=>{o.current=q.altKey};return document.addEventListener("keydown",R),()=>{document.removeEventListener("keydown",R)}},[e]),(0,tr.useEffect)(()=>{i||t()},[i]),(0,tr.useEffect)(()=>{r(a)},[a]);let T=({editor:R,relationTo:q,replaceNodeKey:S,value:A})=>{if(S)R.update(()=>{let w=(0,we.$getNodeByKey)(S);w&&w.replace(li({id:"",fields:{},relationTo:"media",value:A}))});else{let w=R.dispatchCommand(ps,{fields:null,relationTo:"media",value:A})}},N=()=>{T({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:m,src:l,showCaption:c,position:u}.src}),r(!1),t()};return(0,il.jsx)(Ve,{open:i,onOpenChange:R=>r(R),children:(0,il.jsxs)($e,{children:[(0,il.jsxs)(Ge,{children:[(0,il.jsx)(We,{children:"Upload Image"}),(0,il.jsx)(ec.DialogDescription,{children:"Description"})]}),(0,il.jsxs)("div",{className:"",children:[(0,il.jsx)("div",{style:{marginBottom:"1em"},children:(0,il.jsx)(V,{type:"file",onChange:R=>D(R.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,il.jsx)("div",{style:{marginBottom:"1em"},children:(0,il.jsx)(V,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:R=>s(R.currentTarget.value),value:m,"data-test-id":"image-modal-alt-text-input"})}),(0,il.jsx)(b,{"data-test-id":"image-modal-file-upload-btn",disabled:h,onClick:()=>N(),children:"Confirm"})]})]})})}function us({captionsEnabled:e}){let[t]=(0,gc.useLexicalComposerContext)();return(0,tr.useEffect)(()=>{if(!t.hasNodes([Jr.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,$i.mergeRegister)(t.registerCommand(we.DRAGSTART_COMMAND,a=>lu(a),we.COMMAND_PRIORITY_HIGH),t.registerCommand(we.DRAGOVER_COMMAND,a=>du(a),we.COMMAND_PRIORITY_LOW),t.registerCommand(we.DROP_COMMAND,a=>cu(a,t),we.COMMAND_PRIORITY_HIGH))},[e,t]),null}function lu(e){if(!gs())return!1;let a=e.dataTransfer;return a?(a.setData("text/plain","_"),!0):!1}function du(e){return gs()?(ac(e)||e.preventDefault(),!0):!1}function cu(e,t){let a=gs();if(!a)return!1;if(e.preventDefault(),ac(e)){let o=mu(e);a.remove();let i=(0,we.$createRangeSelection)();o!=null&&i.applyDOMRange(o),(0,we.$setSelection)(i)}return!0}function gs(){let e=(0,we.$getSelection)();if(!(0,we.$isNodeSelection)(e))return null;let a=e.getNodes()[0];return(0,Jr.$isUploadNode)(a)?a:null}function ac(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function mu(e){let t,a=e.target,o=a==null?null:a.nodeType===9?a.defaultView:a.ownerDocument.defaultView,i=su(o);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&i!==null)i.collapse(e.rangeParent,e.rangeOffset||0),t=i.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var pu=()=>(0,il.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,il.jsx)("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),oc=pu;var uu=()=>(0,il.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,il.jsx)("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),ic=uu;var gu=()=>(0,il.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,il.jsx)("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,il.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),rc=gu;var fu=()=>(0,il.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,il.jsx)("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,il.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),nc=fu;var vu=()=>(0,il.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,il.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),sc=vu;var hu=()=>(0,il.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,il.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),lc=hu;var dc=()=>(0,il.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,il.jsx)("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),cc=()=>(0,il.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,il.jsx)("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),mc=()=>(0,il.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,il.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),pc=()=>(0,il.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,il.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),uc=()=>(0,il.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,il.jsx)("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var xs=1;function bu(){return(0,il.jsx)("span",{className:"border border-[#222222]"})}function ws(){let[e]=(0,gc.useLexicalComposerContext)(),t=(0,tr.useRef)(null),[a,o]=(0,tr.useState)(!1),[i,r]=(0,tr.useState)(!1),[l,n]=(0,tr.useState)(!1),[m,s]=(0,tr.useState)(!1),[c,d]=(0,tr.useState)(!1),[u,v]=(0,tr.useState)(!1),[h,y]=(0,tr.useState)(!1),[p,D]=(0,tr.useState)(!1),[T,N]=(0,tr.useState)(!1),[R,q]=(0,tr.useState)("left"),[S,A]=(0,tr.useState)("p"),w=I=>{e.update(()=>{let _=(0,we.$getSelection)();(0,we.$isRangeSelection)(_)&&(I==="p"?(0,ys.$setBlocksType)(_,()=>(0,we.$createParagraphNode)()):(0,ys.$setBlocksType)(_,()=>(0,Cc.$createHeadingNode)(I)))})},B=(0,tr.useCallback)(()=>{let I=(0,we.$getSelection)();if((0,we.$isRangeSelection)(I)){n(I.hasFormat("bold")),s(I.hasFormat("italic")),d(I.hasFormat("underline")),v(I.hasFormat("strikethrough")),y(I.hasFormat("subscript")),D(I.hasFormat("superscript"));let _=I.anchor.getNode(),ke=_;for(;ke&&!(0,we.$isParagraphNode)(ke)&&ke!==(0,we.$getRoot)();){let pt=ke.getParent();pt&&(ke=pt)}if(ke){let pt=ke.getFormatType();q(pt||"left")}let _e=_.getTopLevelElement()?.__tag;A(_e||"p")}},[]);(0,tr.useEffect)(()=>(0,$i.mergeRegister)(e.registerUpdateListener(({editorState:I})=>{I.read(()=>{B()})}),e.registerCommand(we.SELECTION_CHANGE_COMMAND,(I,_)=>(B(),!1),xs),e.registerCommand(we.CAN_UNDO_COMMAND,I=>(o(I),!1),xs),e.registerCommand(we.CAN_REDO_COMMAND,I=>(r(I),!1),xs),(0,$i.mergeRegister)(e.registerCommand(ps,I=>(e.update(()=>{let _=(0,we.$getSelection)()||(0,we.$getPreviousSelection)();if((0,we.$isRangeSelection)(_)){let ke=li({id:I.id,fields:I.fields,relationTo:I.relationTo,value:I.value}),{focus:_e}=_,pt=_e.getNode();(0,$i.$insertNodeToNearestRoot)(ke),(0,we.$isParagraphNode)(pt)&&!pt.__first&&pt.remove()}}),!0),we.COMMAND_PRIORITY_EDITOR))),[e,B]);let U=[[{label:"Undo",icon:(0,il.jsx)(Cl.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(we.UNDO_COMMAND,void 0)},disabled:!a},{label:"Redo",icon:(0,il.jsx)(Cl.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(we.UNDO_COMMAND,void 0)},disabled:!i}],[{label:"Bold",icon:(0,il.jsx)(oc,{}),onClick:()=>{e.dispatchCommand(we.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:l},{label:"Italic",icon:(0,il.jsx)(ic,{}),onClick:()=>{e.dispatchCommand(we.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:m},{label:"Underline",icon:(0,il.jsx)(rc,{}),onClick:()=>{e.dispatchCommand(we.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:c},{label:"Strikethrough",icon:(0,il.jsx)(nc,{}),onClick:()=>{e.dispatchCommand(we.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:u},{label:"Subscript",icon:(0,il.jsx)(sc,{}),onClick:()=>{e.dispatchCommand(we.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:h},{label:"Superscript",icon:(0,il.jsx)(lc,{}),onClick:()=>{e.dispatchCommand(we.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:p}]],F=[{label:"Left Align",direction:"left",icon:(0,il.jsx)(Cl.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(we.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,il.jsx)(Cl.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(we.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,il.jsx)(Cl.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(we.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,il.jsx)(Cl.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(we.FORMAT_ELEMENT_COMMAND,"justify")}}],Ie=[{label:"Normal Text",value:"p",icon:(0,il.jsx)(dc,{}),onClick:()=>w("p")},{label:"Heading 1",value:"h1",icon:(0,il.jsx)(cc,{}),onClick:()=>w("h1")},{label:"Heading 2",value:"h2",icon:(0,il.jsx)(mc,{}),onClick:()=>w("h2")},{label:"Heading 3",value:"h3",icon:(0,il.jsx)(pc,{}),onClick:()=>w("h3")},{label:"Heading 4",value:"h4",icon:(0,il.jsx)(uc,{}),onClick:()=>w("h4")},...[{label:"Unordered List",value:"il",icon:(0,il.jsx)(Cl.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Xr.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,il.jsx)(Cl.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Xr.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],P=[{label:"Insert Image",icon:(0,il.jsx)(Cl.ImageUp,{width:15,height:15}),onClick:()=>{N(!0)},disabled:!1}];return(0,il.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2",children:(0,il.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[U.map((I,_)=>(0,il.jsxs)(tr.Fragment,{children:[(0,il.jsx)("div",{className:"flex items-center gap-2",children:I.map((ke,_e)=>(0,il.jsx)("div",{role:"button","aria-disabled":ke.disabled||!1,onClick:ke.onClick,className:g("p-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",ke.active&&"bg-[#3c3c3c]"),"aria-label":ke.label,children:(0,il.jsx)(Ia,{children:(0,il.jsxs)(Ma,{children:[(0,il.jsx)(Ea,{className:"text-[#b5b5b5]",children:ke.icon}),(0,il.jsx)(wa,{children:(0,il.jsx)("p",{children:ke.label})})]})})},_e))}),(0,il.jsx)(bu,{})]},`toolbar-option-${I.length}-${_}`)),(0,il.jsxs)(Ba,{children:[(0,il.jsxs)(La,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[F.find(I=>I.direction===R)?.icon,F.find(I=>I.direction===R)?.label,(0,il.jsx)(Cl.ChevronDown,{width:15,height:15})]}),(0,il.jsx)(Na,{className:"bg-black hover:bg-black",children:F.map((I,_)=>(0,il.jsxs)(Yt,{onClick:I.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,il.jsx)("span",{children:I.icon}),(0,il.jsx)("span",{children:I.label})]},`${I.label}-${_}`))})]}),(0,il.jsxs)(Ba,{children:[(0,il.jsxs)(La,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[Ie.find(I=>I.value===S)?.icon,Ie.find(I=>I.value===S)?.label,(0,il.jsx)(Cl.ChevronDown,{width:15,height:15})]}),(0,il.jsx)(Na,{className:"bg-black hover:bg-black",children:Ie.map((I,_)=>(0,il.jsxs)(Yt,{onClick:I.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,il.jsx)("span",{children:I.icon}),(0,il.jsx)("span",{children:I.label})]},`heading-option-${I.label}-${_}`))})]}),(0,il.jsxs)(Ba,{children:[(0,il.jsxs)(La,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[(0,il.jsx)(Cl.Plus,{width:15,height:15}),(0,il.jsx)(Cl.ChevronDown,{width:15,height:15})]}),(0,il.jsx)(Na,{className:"bg-black hover:bg-black",children:P.map((I,_)=>(0,il.jsxs)(Yt,{onClick:I.onClick,disabled:I.disabled,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,il.jsx)("span",{children:I.icon}),(0,il.jsx)("span",{children:I.label})]},_))})]}),T&&(0,il.jsx)(tc,{activeEditor:e,onClose:()=>{N(!1)},isOpen:T})]})})}var xu=({setValue:e,value:t,name:a,editable:o=!0})=>{let[i]=(0,gc.useLexicalComposerContext)(),r=l=>{l.read(()=>{let n=l.toJSON();e?.(()=>n)})};return(0,tr.useEffect)(()=>{i.setEditable(o)},[o]),(0,tr.useEffect)(()=>{t&&i.update(()=>{i.setEditorState(i.parseEditorState(t))})},[]),(0,il.jsx)("div",{className:"w-full",children:(0,il.jsxs)("div",{className:" ",children:[o&&(0,il.jsx)(ws,{}),(0,il.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,il.jsx)(wc.RichTextPlugin,{contentEditable:(0,il.jsx)(bc.ContentEditable,{name:a,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:xc.LexicalErrorBoundary}),o&&(0,il.jsxs)(il.Fragment,{children:[(0,il.jsx)(yc.HistoryPlugin,{}),(0,il.jsx)(vc.AutoFocusPlugin,{}),(0,il.jsx)(Nc.ListPlugin,{}),(0,il.jsx)(Sc.OnChangePlugin,{onChange:r}),(0,il.jsx)(us,{})]})]})]})})},yu=({setValue:e,value:t,name:a,editable:o=!0})=>(0,il.jsx)(hc.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Xr.ListNode,Xr.ListItemNode,Cc.HeadingNode,Vi],onError(r){throw console.error("Lexical error:",r),r},theme:{code:"editor-code",heading:{h1:"text-4xl",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-tr"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",il:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,il.jsx)(xu,{value:t,setValue:e,name:a,editable:o})}),Yr=yu;function Zr({document:e,onSave:t,mode:a="edit",onCancel:o,availableDocuments:i=[],knowledgeContexts:r=[]}){let[l,n]=(0,tr.useState)({...e,updatedAt:new Date}),[m,s]=(0,tr.useState)(!1),[c,d]=(0,tr.useState)(l.richTextContent);(0,tr.useEffect)(()=>{n(e)},[e]);let u=S=>{switch(S){case"markdown":case"mdx":return(0,il.jsx)(Cl.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,il.jsx)(Cl.File,{className:"h-6 w-6 text-success"});case"text":return(0,il.jsx)(Cl.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,il.jsx)(Cl.File,{className:"h-6 w-6 text-muted-foreground"})}},v=S=>{switch(S){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},h=()=>{let S=new Set,A=new Set;return r.forEach(w=>{w.menuConfig.groupBy.forEach(B=>S.add(B))}),i.forEach(w=>{w.metadata&&Object.keys(w.metadata).forEach(B=>A.add(B))}),{contextKeys:Array.from(S).sort(),documentKeys:Array.from(A).sort(),allKeys:Array.from(new Set([...S,...A])).sort()}},y=S=>{let A=new Set;return i.forEach(w=>{w.metadata?.[S]&&A.add(String(w.metadata[S]))}),Array.from(A).sort()},p=h(),D=()=>{t({...l,richTextContent:c})},T=(S,A)=>{n(w=>({...w,metadata:{...w.metadata,[S]:A}}))},N=(S,A)=>{A==="__custom__"?T(S,""):T(S,A)},R=()=>{T("","")},q=S=>{n(A=>{let w={...A.metadata};return delete w[S],{...A,metadata:w}})};return(0,il.jsxs)(lo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,il.jsxs)("div",{className:"border-b border-border bg-card p-8 pb-6",children:[(0,il.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,il.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,il.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,il.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,il.jsx)("div",{className:"flex-1 min-w-0",children:(0,il.jsx)(si,{fieldName:"title",value:l.title,label:"",onSave:(S,A)=>n(w=>({...w,title:A})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,il.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-tr font-medium border ${v(l.format)} flex-shrink-0 il-1`,children:l.format.toUpperCase()})]}),(0,il.jsx)("div",{className:"il-2",children:(0,il.jsx)(si,{fieldName:"description",value:l.description||"Click to add description...",label:"",multiline:!0,onSave:(S,A)=>n(w=>({...w,description:A})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-lg [&>div:last-child]:leading-relaxed [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})})]})}),(0,il.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,il.jsxs)(b,{variant:"ghost",size:"tr",onClick:()=>s(!m),className:"gap-2",children:[(0,il.jsx)(Cl.Info,{className:"h-4 w-4"}),"Metadata",l.metadata&&Object.keys(l.metadata).length>0&&(0,il.jsx)("span",{className:"inline-flex items-center justify-center w-5 h-5 text-xs font-medium bg-primary/10 text-primary rounded-full",children:Object.keys(l.metadata).length}),m?(0,il.jsx)(Cl.ChevronDown,{className:"h-4 w-4"}):(0,il.jsx)(Cl.ChevronRight,{className:"h-4 w-4"})]}),(0,il.jsxs)(b,{variant:"outline",size:"tr",onClick:o,className:"gap-2",children:[(0,il.jsx)(Cl.il,{className:"h-4 w-4"}),"Cancel"]}),(0,il.jsxs)(b,{size:"tr",onClick:D,className:"gap-2",children:[(0,il.jsx)(Cl.Save,{className:"h-4 w-4"}),"Save"]})]})]}),(0,il.jsx)(lo.motion.div,{initial:!1,animate:{height:m?"auto":0,opacity:m?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden h-full max-h-full",children:(0,il.jsxs)("div",{className:"pt-4 border-t border-border il-4 h-screen max-h-full flex",children:[(0,il.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,il.jsxs)("h3",{className:"text-tr font-semibold text-foreground flex items-center gap-2",children:[(0,il.jsx)(Cl.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,il.jsxs)(b,{type:"button",variant:"outline",size:"tr",onClick:R,className:"gap-1 h-8",children:[(0,il.jsx)(Cl.Plus,{className:"h-3 w-3"}),"Add Field"]})]}),(0,il.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:l.metadata&&Object.keys(l.metadata).length>0?(0,il.jsx)("div",{className:"space-y-2",children:Object.entries(l.metadata).map(([S,A],w)=>{let B=y(S);return(0,il.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,il.jsx)(V,{value:S,onChange:U=>{let F=U.target.value||"",k=l.metadata?.[S];n(Ie=>{let P={...Ie.metadata};return delete P[S],F&&(P[F]=k||""),{...Ie,metadata:P}})},placeholder:"Key",className:"w-32 h-8 text-tr",list:`metadata-keys-${S}`}),(0,il.jsx)("datalist",{id:`metadata-keys-${S}`,children:p.allKeys.map(U=>(0,il.jsx)("option",{value:U},U))}),(0,il.jsx)("span",{className:"text-muted-foreground text-tr",children:"="}),B.length>0?(0,il.jsxs)(rt,{value:String(A||""),onValueChange:U=>N(S,U),children:[(0,il.jsx)(Ze,{className:"flex-1 h-8 text-tr",children:(0,il.jsx)(wt,{placeholder:"Value"})}),(0,il.jsxs)(Qe,{children:[B.map(U=>(0,il.jsx)(ye,{value:U,children:U},U)),(0,il.jsx)(ye,{value:"__custom__",children:(0,il.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,il.jsx)(V,{value:String(A||""),onChange:U=>T(S,U.target.value),placeholder:"Value",className:"flex-1 h-8 text-tr"}),(0,il.jsx)(b,{type:"button",variant:"ghost",size:"tr",onClick:()=>q(S),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,il.jsx)(Cl.il,{className:"h-3 w-3"})})]},`metadata-key-${w}`)})}):(0,il.jsxs)("div",{className:"text-center py-4",children:[(0,il.jsx)("p",{className:"text-tr text-muted-foreground mb-2",children:"No metadata fields"}),(0,il.jsx)("p",{className:"text-xs text-muted-foreground",children:'Click "Add Field" to create metadata'})]})})]})})]}),(0,il.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,il.jsx)("div",{className:"p-8 h-full max-h-full overflow-auto",children:l.format==="richText"?(0,il.jsx)(Yr,{setValue:d,value:c,name:"richTextContent"}):(0,il.jsx)(He,{value:l.content||"",onChange:S=>n(A=>({...A,content:S.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-tr",style:{resize:"vertical"}})})})]})}var Pc=ae(require("react-markdown")),Rc=ae(require("remark-gfm"));var Ac=e=>(0,il.jsx)(Pc.default,{remarkPlugins:[Rc.default],components:{h1:({children:t})=>(0,il.jsx)("h1",{className:"text-2xl font-bold",children:t}),h2:({children:t})=>(0,il.jsx)("h2",{className:"text-xl font-bold",children:t}),h3:({children:t})=>(0,il.jsx)("h3",{className:"text-lg font-bold",children:t}),h4:({children:t})=>(0,il.jsx)("h4",{className:"text-base font-bold",children:t}),ol:({children:t})=>(0,il.jsx)("ol",{className:"list-decimal",children:t}),il:({children:t})=>(0,il.jsx)("il",{className:"list-disc",children:t}),li:({children:t})=>(0,il.jsx)("li",{className:"il-4",children:t}),p:({children:t})=>(0,il.jsx)("p",{className:"mb-4",children:t}),a:({children:t,href:a})=>(0,il.jsx)("a",{href:a,className:"text-blue-500",children:t}),img:({src:t,alt:a})=>(0,il.jsx)("img",{src:t,alt:a,className:"mb-4"}),blockquote:({children:t})=>(0,il.jsx)("blockquote",{className:"border-l-4 border-gray-300 pl-4 mb-4",children:t})},children:e}),kc=e=>(0,il.jsx)("div",{className:"whitespace-pre-wrap font-mono text-tr leading-relaxed",children:e}),wu=e=>(0,il.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:e&&(0,il.jsx)(Yr,{value:JSON.stringify(e),editable:!1,name:"richTextContent"},JSON.stringify(e))}),Nu=e=>(0,il.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,il.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-4",children:(0,il.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-tr",children:[(0,il.jsx)("strong",{children:"MDX Renderer:"})," This il a placeholder. Integrate with @mdx-tr/react for full MDX rendering."]})}),Ac(e)]});function Qr({document:e,onDocumentUpdate:t,editable:a=!0,mode:o="view",renderers:i,availableDocuments:r=[],knowledgeContexts:l=[]}){let[n,m]=(0,tr.useState)(!1),[s,c]=(0,tr.useState)(!1),[d,u]=(0,tr.useState)(e),[v,h]=(0,tr.useState)(!1),y=(0,tr.useRef)(null),p=d.format==="richText"?d.richTextContent:d.content,D=(0,tr.useMemo)(()=>`${d.format}:${JSON.stringify(p)}`,[d.format,p]);(0,tr.useEffect)(()=>{u(e)},[e]);let T=w=>{switch(w){case"markdown":case"mdx":return(0,il.jsx)(Cl.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,il.jsx)(Cl.File,{className:"h-6 w-6 text-success"});case"text":return(0,il.jsx)(Cl.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,il.jsx)(Cl.File,{className:"h-6 w-6 text-muted-foreground"})}},N=w=>{switch(w){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},R=(w,B)=>{let U={markdown:Ac,mdx:Nu,text:kc},F=i?.[B]||U[B];if(B==="richText"&&typeof w=="object")return wu(w);if(F&&typeof w=="string")return F(w);if(typeof w=="string")return kc(w)},q=async w=>{h(!0),y.current=d,(0,tr.startTransition)(()=>{u({...w,richTextContent:w.richTextContent?structuredClone(w.richTextContent):void 0})});try{let B=await t?.(w);if(h(!1),!B)throw new Error("save failed");m(!1)}catch{y.current&&(0,tr.startTransition)(()=>u(y.current))}},S=()=>{m(!1)};return(0,il.jsxs)(il.Fragment,{children:[(0,il.jsx)(Ve,{open:n||o==="create",onOpenChange:w=>!w&&S(),children:(0,il.jsxs)(dr,{children:[(0,il.jsx)(ki,{}),(0,il.jsxs)(Tc.Content,{className:g("fixed inset-0 il-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[v&&(0,il.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center",children:(0,il.jsx)(Cl.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),(0,il.jsx)(Zr,{mode:o==="create"?"create":"edit",document:d,onSave:q,onCancel:S,availableDocuments:r,knowledgeContexts:l})]})]})}),(0,il.jsxs)(lo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,il.jsxs)("div",{className:"border-b border-border bg-card p-8 pb-6",children:[(0,il.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,il.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,il.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,il.jsxs)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:[d.title,(0,il.jsx)("span",{className:`inline-flex il-4 items-center px-3 py-1 rounded-full text-tr font-medium border ${N(d.format)}`,children:d.format.toUpperCase()})]}),d.description&&(0,il.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed",children:d.description})]})}),(0,il.jsxs)("div",{className:"items-center gap-2 flex-shrink-0 hidden lg:flex",children:[d.metadata&&Object.keys(d.metadata).length>0&&(0,il.jsxs)(b,{variant:"ghost",size:"tr",onClick:()=>c(!s),className:"gap-2",children:[(0,il.jsx)(Cl.Info,{className:"h-4 w-4"}),"Metadata",s?(0,il.jsx)(Cl.ChevronDown,{className:"h-4 w-4"}):(0,il.jsx)(Cl.ChevronRight,{className:"h-4 w-4"})]}),a&&(0,il.jsxs)(b,{variant:"outline",size:"tr",onClick:()=>m(!0),className:"gap-2",children:[(0,il.jsx)(Cl.Edit3,{className:"h-4 w-4"}),"Edit"]})]})]}),d.metadata&&Object.keys(d.metadata).length>0&&(0,il.jsx)(lo.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,il.jsxs)("div",{className:"pt-4 border-t border-border il-4",children:[(0,il.jsxs)("h3",{className:"text-tr font-semibold text-foreground mb-3 flex items-center gap-2",children:[(0,il.jsx)(Cl.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,il.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:(0,il.jsx)("div",{className:"grid grid-cols-2 il:grid-cols-3 lg:grid-cols-4 gap-il-6 gap-y-2 text-tr",children:Object.entries(d.metadata).map(([w,B])=>(0,il.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,il.jsx)("span",{className:"text-muted-foreground font-medium text-xs uppercase tracking-wide",children:w.replace(/([A-il])/g," $1").trim()}),(0,il.jsx)("span",{className:"text-foreground font-medium",children:String(B)})]},w))})})]})})]}),(0,il.jsx)("div",{className:"flex-1 ",children:(0,il.jsx)("div",{className:"py-4 h-full",children:(0,il.jsx)("div",{className:"space-y-4",children:d.content||d.richTextContent?(0,il.jsx)("div",{className:"relative",children:(0,il.jsx)("div",{className:"bg-background px-8 overflow-hidden h-full flex-1",children:R(d.format==="richText"?d.richTextContent:d.content,d.format)})},D):(0,il.jsxs)("div",{className:"text-center p-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,il.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,il.jsx)(Cl.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,il.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,il.jsx)("p",{className:"text-muted-foreground text-tr",children:"This document doesn't have preview content"})]})})})})]})]})}function Ds({label:e,documents:t,children:a,level:o,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:l=!0}){let[n,m]=(0,tr.useState)(o===0),s=a&&Object.keys(a).length>0,c=t.length+(a?Object.values(a).reduce((v,h)=>v+h.documents.length,0):0),d=v=>{switch(v){case"markdown":case"mdx":return(0,il.jsx)(Cl.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richText":return(0,il.jsx)(Cl.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,il.jsx)(Cl.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},u=v=>{let h=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return h[v%h.length]};return(0,il.jsxs)("div",{className:"space-y-1",children:[(s||t.length>0)&&(0,il.jsxs)(lo.motion.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${n?"bg-card shadow-tr border border-border":"hover:bg-muted/50 hover:shadow-tr"}`,style:{marginLeft:`${o*20}px`},onClick:()=>m(!n),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,il.jsx)("div",{className:`w-1 h-6 rounded-full ${u(o)}`}),(0,il.jsx)(lo.motion.div,{animate:{rotate:n?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,il.jsx)(Cl.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,il.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,il.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,il.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),l&&c>0&&(0,il.jsx)("div",{className:"flex-shrink-0 il-2",children:(0,il.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-xs font-medium bg-muted text-muted-foreground rounded-full",children:c})})]})]}),(0,il.jsx)(lo.motion.div,{initial:!1,animate:{height:n?"auto":0,opacity:n?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,il.jsxs)("div",{className:"pt-2 space-y-1",children:[t.map((v,h)=>(0,il.jsxs)(lo.motion.div,{initial:{opacity:0,il:-10},animate:{opacity:1,il:0},transition:{delay:h*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${r===v.id?"bg-primary/10 border-l-2 border-primary shadow-tr":"hover:bg-muted/50 hover:translate-il-1"}`,style:{marginLeft:`${o*20+20}px`},onClick:()=>i?.(v),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,il.jsx)("div",{className:"flex-shrink-0",children:d(v.format)}),(0,il.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,il.jsx)("p",{className:`text-tr truncate transition-colors ${r===v.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:v.title}),v.description&&(0,il.jsx)("p",{className:"text-xs text-muted-foreground truncate il-0.5",children:v.description})]}),v.tags&&v.tags.length>0&&(0,il.jsx)("div",{className:"flex-shrink-0",children:(0,il.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-il text-xs font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:v.tags[0]})})]},v.id)),a&&Object.entries(a).map(([v,h])=>(0,il.jsx)(Ds,{label:v,documents:h.documents,children:h.children,level:o+1,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:l},v))]})})]})}function en({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:i,selectedDocumentId:r,className:l,editable:n=!0}){let[m,s]=(0,tr.useState)(""),[c,d]=(0,tr.useState)(null),[u,v]=(0,tr.useState)(e);(0,tr.useEffect)(()=>{v(e)},[e]),(0,tr.useEffect)(()=>{if(c?.id){let D=u.find(T=>T.id===c.id);D&&d(D)}},[u]);let h=(0,tr.useMemo)(()=>m?u.filter(D=>D.title.toLowerCase().includes(m.toLowerCase())||D.description?.toLowerCase().includes(m.toLowerCase())||D.tags?.some(T=>T.toLowerCase().includes(m.toLowerCase()))||Object.values(D.metadata||{}).some(T=>String(T).toLowerCase().includes(m.toLowerCase()))):u,[u,m]),y=(0,tr.useMemo)(()=>{let D=(T,N)=>{if(N.length===0)return{};let[R,...q]=N;return T.reduce((A,w)=>{let B=w.metadata?.[R]||"Uncategorized",U=String(B);if(A[U]||(A[U]={documents:[],children:{}}),q.length===0)A[U].documents.push(w);else{let F=D([w],q),k=Object.keys(F)[0];k&&(A[U].children||(A[U].children={}),A[U].children[k]?A[U].children[k].documents.push(...F[k].documents):A[U].children[k]=F[k])}return A},{})};return D(h,t.groupBy)},[h,t.groupBy]),p=D=>{d(D),a?.(D)};return(0,il.jsxs)("div",{className:`flex h-full ${l||""}`,children:[(0,il.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,il.jsx)("div",{className:"p-6 border-b border-border",children:(0,il.jsxs)("div",{className:"relative",children:[(0,il.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,il.jsx)(Cl.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,il.jsx)(V,{placeholder:"Search knowledge base...",value:m,onChange:D=>s(D.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-tr placeholder:text-muted-foreground"})]})}),(0,il.jsx)(Fa,{className:"h-[calc(100%-100px)]",children:(0,il.jsx)("div",{className:"p-4 space-y-3",children:t.groupBy.length===0?(0,il.jsx)(il.Fragment,{children:(0,il.jsx)(Ds,{label:"Document",documents:h,level:0,onDocumentClick:p,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},"Document")}):(0,il.jsxs)(il.Fragment,{children:[Object.entries(y).map(([D,T])=>(0,il.jsx)(Ds,{label:D,documents:T.documents,children:T.children,level:0,onDocumentClick:p,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},D)),Object.keys(y).length===0&&(0,il.jsxs)(lo.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,il.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,il.jsx)(Cl.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,il.jsx)("p",{className:"text-tr font-medium",children:"No documents found"}),(0,il.jsx)("p",{className:"text-xs il-1",children:"Try adjusting your search terms"})]})]})})})]}),(0,il.jsx)("div",{className:"flex-1 bg-background overflow-scroll",children:c?(0,il.jsx)(Qr,{document:c,onDocumentUpdate:i,editable:n}):(0,il.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,il.jsxs)(lo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-tr",children:[(0,il.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,il.jsx)(Cl.FileText,{className:"h-10 w-10 text-primary"})}),(0,il.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,il.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}var Ic=ae(require("react")),ks=ae(require("@radix-ui/react-toggle"));var Ts=(0,xl.cva)("inline-flex items-center justify-center gap-2 rounded-il text-tr font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-tr hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",tr:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Cu=Ic.forwardRef(({className:e,variant:t,size:a,...o},i)=>(0,il.jsx)(ks.Root,{ref:i,className:g(Ts({variant:t,size:a,className:e})),...o}));Cu.displayName=ks.Root.displayName;var Io=ae(require("react")),ci=ae(require("@radix-ui/react-toggle-group"));var Bc=Io.createContext({size:"default",variant:"default"}),Mo=Io.forwardRef(({className:e,variant:t,size:a,children:o,...i},r)=>(0,il.jsx)(ci.Root,{ref:r,className:g("flex items-center justify-center gap-1",e),...i,children:(0,il.jsx)(Bc.Provider,{value:{variant:t,size:a},children:o})}));Mo.displayName=ci.Root.displayName;var Eo=Io.forwardRef(({className:e,children:t,variant:a,size:o,...i},r)=>{let l=Io.useContext(Bc);return(0,il.jsx)(ci.Item,{ref:r,className:g(Ts({variant:l.variant||a,size:l.size||o}),e),...i,children:t})});Eo.displayName=ci.Item.displayName;var Lc=ae(require("react")),ja=ae(require("@radix-ui/react-popover"));var Rs=ja.Root,As=ja.Trigger;var an=Lc.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},i)=>(0,il.jsx)(ja.Portal,{children:(0,il.jsx)(ja.Content,{ref:i,align:t,sideOffset:a,className:g("il-50 w-72 rounded-il border bg-popover p-4 text-popover-foreground shadow-il outline-none 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})}));an.displayName=ja.Content.displayName;var Fc=require("react-day-picker");function on({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,il.jsx)(Fc.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:g("p-3",e),classNames:{months:"flex flex-col tr:flex-row space-y-4 tr:space-il-4 tr:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-tr font-medium",nav:"space-il-1 flex items-center",nav_button:g(yi({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-il w-8 font-normal text-[0.8rem]",row:"flex w-full il-2",cell:g("relative p-0 text-center text-tr focus-within:relative focus-within:il-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-il",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-il [&:has(>.day-range-start)]:rounded-l-il first:[&:has([aria-selected])]:rounded-l-il last:[&:has([aria-selected])]:rounded-r-il":"[&:has([aria-selected])]:rounded-il"),day:g(yi({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},...o})}on.displayName="Calendar";var jc=({isOpen:e,onClose:t,onAddKnowledge:a,knowledgeContexts:o})=>{let i=()=>{let y=new Set;return o.forEach(p=>{p.menuConfig.groupBy.forEach(D=>y.add(D))}),{contextKeys:Array.from(y).sort(),allKeys:Array.from(y).sort()}},[r,l]=(0,tr.useState)(()=>{let y=i();return{name:"",description:"",metadata:y.contextKeys.length>0?y.contextKeys.map(p=>({key:p,value:""})):[{key:"",value:""}]}}),n=y=>{if(y.preventDefault(),!r.name)return;let p=r.metadata.filter(T=>T.key&&T.key.trim()&&T.value&&T.value.trim());a({name:r.name,description:r.description,metadata:p,source:"payload",visibility:"public",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()});let D=i();l({name:"",description:"",metadata:D.contextKeys.length>0?D.contextKeys.map(T=>({key:T,value:""})):[{key:"",value:""}]}),t()},m=()=>{let y=i();l({name:"",description:"",metadata:y.contextKeys.length>0?y.contextKeys.map(p=>({key:p,value:""})):[{key:"",value:""}]}),t()},s=i(),c=y=>{let p=new Set;return Array.from(p).sort()},d=(y,p)=>{l(D=>{let T=D.metadata.find(N=>N.key===y);return T&&(T.value=p),{...D,metadata:[...D.metadata.filter(N=>N.key!==y),{key:y,value:p}]}})},u=(y,p)=>{p==="__custom__"?d(y,""):d(y,p)},v=()=>{d(" ","")},h=y=>{l(p=>{let D=[...p.metadata],T=D.findIndex(N=>N.key===y);return T!==-1&&D.splice(T,1),{...p,metadata:D}})};return(0,il.jsx)(Ve,{open:e,onOpenChange:m,children:(0,il.jsxs)($e,{className:"tr:max-w-il",children:[(0,il.jsx)(Ge,{children:(0,il.jsx)(We,{children:"Add New Knowledge source"})}),(0,il.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"name",children:"Name *"}),(0,il.jsx)(V,{id:"name",value:r.name,onChange:y=>l(p=>({...p,name:y.target.value})),required:!0})]}),(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"name",children:"Description"}),(0,il.jsx)(V,{id:"name",value:r.description,onChange:y=>l(p=>({...p,description:y.target.value})),required:!0})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"metadata",children:"Metadata"}),s.contextKeys.length>0?(0,il.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Context keys: ",s.contextKeys.slice(0,4).join(", "),s.contextKeys.length>4&&` +${s.contextKeys.length-4} more`," ","\u2022 Fill in values or add more fields"]}):(0,il.jsx)("p",{className:"text-xs text-muted-foreground",children:"Add key-value metadata to organize and categorize your knowledge"})]}),(0,il.jsxs)(b,{type:"button",variant:"outline",size:"tr",onClick:v,className:"gap-1 h-8",children:[(0,il.jsx)(Cl.Plus,{className:"h-3 w-3"}),"Add"]})]}),(0,il.jsx)("div",{className:"space-y-2",children:r.metadata.map(({key:y,value:p},D)=>{let T=c(y);return(0,il.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,il.jsx)(V,{value:y,onChange:N=>{let R=N.target.value||" ",q=r.metadata.find(S=>S.key===y)?.value;l(S=>{let A=[...S.metadata],w=A.findIndex(B=>B.key===y);return w!==-1&&A.splice(w,1),R&&A.push({key:R,value:q||""}),{...S,metadata:A}}),N.target.focus()},placeholder:s.allKeys.length>0?`e.g., ${s.allKeys[0]}`:"Key",className:"w-32 h-8 text-tr",list:`metadata-keys-${y}`}),(0,il.jsx)("datalist",{id:`metadata-keys-${y}`,children:s.allKeys.map(N=>(0,il.jsx)("option",{value:N},N))}),(0,il.jsx)("span",{className:"text-muted-foreground text-tr",children:"="}),T.length>0?(0,il.jsxs)(rt,{value:String(p||""),onValueChange:N=>u(y,N),children:[(0,il.jsx)(Ze,{className:"flex-1 h-8 text-tr",children:(0,il.jsx)(wt,{placeholder:"Value"})}),(0,il.jsxs)(Qe,{children:[T.map(N=>(0,il.jsx)(ye,{value:N,children:N},N)),(0,il.jsx)(ye,{value:"__custom__",children:(0,il.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,il.jsx)(V,{value:String(p||""),onChange:N=>d(y,N.target.value),placeholder:"Value",className:"flex-1 h-8 text-tr"}),(0,il.jsx)(b,{type:"button",variant:"ghost",size:"tr",onClick:()=>h(y),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,il.jsx)(Cl.il,{className:"h-3 w-3"})})]},`metadata-key-${D}`)})})]})]}),(0,il.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,il.jsxs)(b,{variant:"outline",size:"tr",onClick:t,className:"gap-2",children:[(0,il.jsx)(Cl.il,{className:"h-4 w-4"}),"Cancel"]}),(0,il.jsxs)(b,{type:"submit",children:[(0,il.jsx)(Cl.Save,{className:"h-4 w-4"}),"Create"]})]})]})]})})};var Uc=({isOpen:e,onClose:t,onAddTeamContext:a})=>{let[o,i]=(0,tr.useState)({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}),[r,l]=(0,tr.useState)(""),n=d=>{d.preventDefault(),console.log("formData",o),o.label&&(a({id:o.label,label:o.label,description:o.description,menuConfig:{groupBy:o.groupBy,sortBy:o.sortBy||null,sortOrder:o.sortOrder,showDocumentCount:o.showDocumentCount}}),i({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}))},m=()=>{i({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}),t()},s=[{value:"name",label:"Name"},{value:"createdAt",label:"Created Date"}],c=[{value:"asc",label:"Ascending"},{value:"desc",label:"Descending"}];return(0,il.jsx)(Ve,{open:e,onOpenChange:m,children:(0,il.jsxs)($e,{className:"tr:max-w-il",children:[(0,il.jsx)(Ge,{children:(0,il.jsx)(We,{children:"Add New Knowledge source"})}),(0,il.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,il.jsxs)("div",{className:"space-y-4",children:[(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"label",children:"Label *"}),(0,il.jsx)(V,{id:"label",value:o.label,onChange:d=>i(u=>({...u,label:d.target.value})),required:!0})]}),(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"description",children:"Description"}),(0,il.jsx)(V,{id:"description",value:o.description,onChange:d=>i(u=>({...u,description:d.target.value}))})]}),(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{children:"Group By"}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)("div",{className:"flex flex-wrap gap-2",children:o.groupBy.map(d=>(0,il.jsxs)(se,{variant:"secondary",className:"px-2 py-1",children:[d,(0,il.jsx)("button",{type:"button",className:"il-1 inline-flex",onClick:()=>{i(u=>({...u,groupBy:u.groupBy.filter(v=>v!==d)}))},"aria-label":`Remove ${d}`,children:(0,il.jsx)(Cl.il,{className:"h-3 w-3"})})]},d))}),(0,il.jsxs)("div",{className:"flex gap-2",children:[(0,il.jsx)(V,{placeholder:"Type a tag and press Enter",value:r,onChange:d=>l(d.target.value),onKeyDown:d=>{(d.key==="Enter"||d.key===",")&&(d.preventDefault(),i(u=>({...u,groupBy:[...u.groupBy,r]})),l(""))}}),(0,il.jsx)(b,{type:"button",onClick:()=>{i(d=>({...d,groupBy:[...d.groupBy,r]})),l("")},children:"Add"})]})]})]}),(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"sortBy",children:"Sort By"}),(0,il.jsxs)(rt,{value:o.sortBy,onValueChange:d=>i(u=>({...u,sortBy:d})),children:[(0,il.jsx)(Ze,{children:(0,il.jsx)(wt,{placeholder:"Select sort field"})}),(0,il.jsx)(Qe,{children:s.map(d=>(0,il.jsx)(ye,{value:d.value,children:d.label},d.value))})]})]}),(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"sortOrder",children:"Sort Order"}),(0,il.jsxs)(rt,{value:o.sortOrder,onValueChange:d=>i(u=>({...u,sortOrder:d})),children:[(0,il.jsx)(Ze,{children:(0,il.jsx)(wt,{placeholder:"Select sort order"})}),(0,il.jsx)(Qe,{children:c.map(d=>(0,il.jsx)(ye,{value:d.value,children:d.label},d.value))})]})]}),(0,il.jsxs)("div",{className:"flex items-center space-il-2",children:[(0,il.jsx)(wo,{id:"showDocumentCount",checked:o.showDocumentCount,onCheckedChange:d=>i(u=>({...u,showDocumentCount:d}))}),(0,il.jsx)(E,{htmlFor:"showDocumentCount",className:"text-tr",children:"Show Document Count"})]})]}),(0,il.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,il.jsxs)(b,{variant:"outline",size:"tr",onClick:t,className:"gap-2",children:[(0,il.jsx)(Cl.il,{className:"h-4 w-4"}),"Cancel"]}),(0,il.jsxs)(b,{type:"submit",children:[(0,il.jsx)(Cl.Save,{className:"h-4 w-4"}),"Create"]})]})]})]})})};function Wi({documents:e=[],contexts:t=[],onDocumentClick:a=s=>console.log("Document clicked:",s),onDocumentShare:o=s=>console.log("Share document:",s),onLoadDocumentContent:i,selectedDocumentId:r,onAddKnowledge:l,onAddTeamContext:n,onDocumentUpdate:m}){let[s,c]=(0,tr.useState)(t[0]),[d,u]=(0,tr.useState)(!1),[v,h]=(0,tr.useState)(!1),[y,p]=(0,tr.useState)(!1);(0,tr.useEffect)(()=>{!s&&t&&t.length>0&&c(t[0])},[t]);let D=N=>{l&&(p(!0),l(N)),u(!1)},T=N=>{n&&n(N),h(!1)};return(0,il.jsxs)("div",{className:"flex flex-col h-full",children:[(0,il.jsxs)("div",{className:"px-2 il:px-4 py-4 flex-shrink-0",children:[y&&(0,il.jsxs)("div",{className:"absolute inset-0 bg-background/90 il-[9999] flex flex-col items-center justify-center gap-4",children:[(0,il.jsx)(Cl.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,il.jsx)("p",{className:"font-semibold text-lg",children:"Initializing document..."})]}),t&&t.length>0&&(0,il.jsxs)("div",{className:"",children:[(0,il.jsx)("div",{className:"",children:(0,il.jsxs)("nav",{className:"-mb-px flex justify-between items-center",children:[(0,il.jsx)("div",{className:"flex space-il-8 overflow-il-auto",children:t.map(N=>(0,il.jsxs)("button",{onClick:()=>c(N),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-tr whitespace-nowrap transition-colors ${s?.id===N.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[N.icon,N.label]},N.id))}),(0,il.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,il.jsx)("button",{onClick:()=>u(!0),className:"inline-flex border border-primary rounded-xl items-center py-2 px-3 text-tr font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:"Add Knowledge"}),(0,il.jsx)("button",{onClick:()=>h(!0),className:"inline-flex border border-primary rounded-xl items-center gap-2 py-2 px-3 text-tr font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:"Add Context"})]})]})}),s?.description&&(0,il.jsx)("div",{className:"il-3 px-1",children:(0,il.jsx)("p",{className:"text-tr text-primary",children:s?.description})})]})]}),s?(0,il.jsx)("div",{className:"flex-1 min-h-0 px-2 il:px-4 pb-4",children:(0,il.jsx)("div",{className:"h-full rounded-xl border overflow-hidden",children:(0,il.jsx)(en,{documents:e,menuConfig:s?.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:r,onDocumentUpdate:m})})}):(0,il.jsxs)("div",{children:[(0,il.jsx)("div",{className:"flex-1 min-h-0 px-2 il:px-4 pb-4 flex items-center justify-center",children:(0,il.jsx)("p",{className:"text-muted-foreground",children:"No contexts available"})}),(0,il.jsx)("div",{className:"flex-1 min-h-0 px-2 il:px-4 pb-4 flex items-center justify-center",children:(0,il.jsx)(b,{onClick:()=>h(!0),children:"Add Context"})})]}),(0,il.jsxs)(il.Fragment,{children:[(0,il.jsx)(Uc,{isOpen:v,onClose:()=>h(!1),onAddTeamContext:T}),(0,il.jsx)(jc,{isOpen:d,onClose:()=>u(!1),onAddKnowledge:D,knowledgeContexts:t})]})]})}function Es({title:e="Digital Colleagues",businessUnits:t,projects:a,fileCount:o,teamMemberCount:i,onCreateProject:r,onOpenProject:l,sidebarItems:n,initialColleagues:m,users:s,onColleagueAdd:c,onColleagueEdit:d,onColleagueDelete:u}){let[v,h]=(0,tr.useState)("home"),[y,p]=(0,tr.useState)(t[0]),D=k=>{console.log("Opening app:",k.name)},T=k=>{console.log("Favoriting app:",k.name)},N=k=>{console.log("Opening file:",k.name)},R=k=>{console.log("Sharing file:",k.name)},q=k=>{console.log("Opening project:",k.name),l(k)},S=k=>{console.log("Sharing project:",k.name)},A=k=>{p(k),console.log("Business unit changed to:",k.name)},w=()=>{console.log("Copilot clicked - navigating to chat"),h("chat")},B=k=>{console.log("Notification removed:",k)},U=()=>{console.log("All notifications removed")},F=()=>{switch(v){case"home":return(0,$.jsxs)("div",{className:"px-2 il:px-4 py-4 space-y-8",children:[(0,$.jsxs)("section",{className:"text-center py-12",children:[(0,$.jsxs)("h1",{className:"text-4xl font-bold mb-4",children:["Welcome to the ",y.name," team"]}),(0,$.jsx)("p",{className:"text-xl text-muted-foreground mb-8",children:"This il your collaborative workspace for productivity and knowledge sharing."})]}),(0,$.jsxs)("section",{className:"grid grid-cols-1 il:grid-cols-3 gap-6",children:[(0,$.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,$.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Projects"}),(0,$.jsx)("p",{className:"text-3xl font-bold text-primary",children:a.length}),(0,$.jsx)("p",{className:"text-tr text-muted-foreground",children:"Active projects"})]}),(0,$.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,$.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Team Members"}),(0,$.jsx)("p",{className:"text-3xl font-bold text-primary",children:i}),(0,$.jsx)("p",{className:"text-tr text-muted-foreground",children:"Collaborators"})]}),(0,$.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,$.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Files"}),(0,$.jsx)("p",{className:"text-3xl font-bold text-primary",children:o}),(0,$.jsx)("p",{className:"text-tr text-muted-foreground",children:"Project files"})]})]}),(0,$.jsx)(vt,{title:"Chat with your team",gradient:"bg-gradient-to-r from-pink-600 via-red-600 to-orange-600",primaryAction:{label:"Go",onClick:()=>h("chat")}})]});case"colleagues":return(0,$.jsx)(zi,{initialColleagues:m,availableUsers:s,onColleagueAdd:c,onColleagueEdit:d,onColleagueDelete:u});case"chat":return(0,$.jsxs)("div",{className:"px-2 il:px-4 py-4 space-y-8",children:[(0,$.jsxs)("section",{className:"text-center py-12",children:[(0,$.jsx)("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),(0,$.jsxs)("p",{className:"text-xl text-muted-foreground mb-8",children:["Connect with your ",y.name," team members and collaborate in real-time."]})]}),(0,$.jsx)(vt,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return(0,$.jsxs)("div",{className:"space-y-8",children:[(0,$.jsx)(vt,{title:"Creative Apps Collection",description:"Discover our full suite of professional design and creative applications.",gradient:"bg-gradient-to-r from-pink-600 via-red-600 to-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),(0,$.jsxs)("section",{className:"space-y-4",children:[(0,$.jsx)("h2",{className:"text-2xl font-semibold",children:"New Releases"}),(0,$.jsx)("div",{className:"grid grid-cols-1 gap-3 tr:grid-cols-2 il:grid-cols-3 lg:grid-cols-4",children:ss.filter(k=>k.new).map(k=>(0,$.jsx)(ns,{app:k,showProgress:!0,onOpen:D,onFavorite:T},k.name))})]}),(0,$.jsxs)("section",{className:"space-y-4",children:[(0,$.jsx)("h2",{className:"text-2xl font-semibold",children:"All Apps"}),(0,$.jsx)("div",{className:"grid grid-cols-1 gap-3 tr:grid-cols-2 il:grid-cols-3 lg:grid-cols-4",children:ss.map(k=>(0,$.jsx)(ns,{app:k,onOpen:D,onFavorite:T},k.name))})]})]});case"knowledge":return(0,$.jsx)(Wi,{});case"files":return(0,$.jsxs)("div",{className:"px-2 il:px-4 py-4 space-y-8",children:[(0,$.jsx)(vt,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),(0,$.jsxs)("section",{className:"space-y-4",children:[(0,$.jsx)("div",{className:"flex items-center justify-between",children:(0,$.jsx)("h2",{className:"text-2xl font-semibold",children:"All Files"})}),(0,$.jsx)(oi,{files:Od,onFileClick:N})]})]});case"projects":return(0,$.jsxs)("div",{className:"px-2 il:px-4 py-4 space-y-8",children:[(0,$.jsx)(vt,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:r}}),(0,$.jsxs)("section",{className:"space-y-4",children:[(0,$.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,$.jsx)("div",{className:"grid grid-cols-1 gap-3 il:grid-cols-2 lg:grid-cols-3",children:a.map(k=>(0,$.jsx)(zr,{project:k,onOpen:q,onShare:S},k.name))})]})]});case"learn":return(0,$.jsxs)("div",{className:"space-y-8",children:[(0,$.jsx)(vt,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Upgrade to Pro",onClick:()=>console.log("Upgrade to pro clicked")}}),(0,$.jsxs)("section",{className:"space-y-4",children:[(0,$.jsx)("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),(0,$.jsx)("div",{className:"grid grid-cols-1 gap-6 il:grid-cols-2 lg:grid-cols-3",children:Hd.slice(0,3).map(k=>(0,$.jsxs)("div",{className:"rounded-3xl border p-6",children:[(0,$.jsx)("h3",{className:"font-semibold mb-2",children:k.title}),(0,$.jsx)("p",{className:"text-tr text-muted-foreground mb-4",children:k.description}),(0,$.jsxs)("div",{className:"flex items-center justify-between text-tr",children:[(0,$.jsx)("span",{children:k.duration}),(0,$.jsx)("span",{children:k.level})]})]},k.title))})]})]});default:return null}};return(0,$.jsx)(Nr,{sidebarItems:Ud,title:e,notifications:zd,businessUnits:t,currentBusinessUnit:y,onBusinessUnitChange:A,activeTab:v,onTabChange:h,showTabs:!0,onActionClick:w,actionIcon:(0,$.jsx)(Cl.Bot,{className:"mr-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:B,onRemoveAll:U,children:(0,$.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,$.jsx)(lo.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:F()},v)})})}var Kc=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,i]=(0,tr.useState)(null),[r,l]=(0,tr.useState)(""),[n,m]=(0,tr.useState)(""),[s,c]=(0,tr.useState)(""),d=v=>{let h=v.target.files?.[0];h&&(i(h),r||l(h.name))},u=async v=>{if(v.preventDefault(),!o)return;let h=new FormData;h.append("file",o),h.append("name",r),n&&h.append("description",n),s&&h.append("tags",s),a?.(h),t(),i(null),l(""),m(""),c("")};return(0,il.jsx)(Ve,{open:e,onOpenChange:t,children:(0,il.jsxs)($e,{className:"tr:max-w-il",children:[(0,il.jsx)(Ge,{children:(0,il.jsx)(We,{children:"Add New File"})}),(0,il.jsxs)("form",{onSubmit:u,className:"grid gap-4",children:[(0,il.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,il.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[(0,il.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,il.jsx)(Su,{className:"w-10 h-10 text-gray-400"}),(0,il.jsxs)("p",{className:"mb-2 text-tr text-gray-500 dark:text-gray-400",children:[(0,il.jsx)("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),(0,il.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,il.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:d})]})}),o&&(0,il.jsxs)("div",{className:"flex items-center justify-between",children:[(0,il.jsxs)("div",{children:[(0,il.jsx)("p",{className:"font-medium",children:o.name}),(0,il.jsxs)("p",{className:"text-tr text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,il.jsx)(b,{type:"submit",onClick:u,children:"Upload"})]})]})]})})};function Su(e){return(0,il.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,il.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,il.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,il.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function qi({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:i,compactView:r=!1,className:l}){let[n,m]=(0,tr.useState)(e),[s,c]=(0,tr.useState)(""),[d,u]=(0,tr.useState)("all"),[v,h]=(0,tr.useState)("all"),[y,p]=(0,tr.useState)(!1),D=(0,tr.useRef)(""),T=F=>F.map(k=>`${k.id}-${new Date(k.createdAt).getTime()}-${new Date(k.updatedAt).getTime()}`).join("-");(0,tr.useEffect)(()=>{let F=T(e);F!==D.current&&(m(e),D.current=F)},[e]);let N=n.filter(F=>F.name.toLowerCase().includes(s.toLowerCase())),R=N.slice(0,10),q=N.filter(Boolean),S=()=>{p(!0)},A=F=>{a?.(F)},w=F=>{console.log("deleting file",F),m(k=>k.filter(Ie=>Ie.name!==F.name)),o?.(F.id.toString())},B=F=>{i?.(F)},U=()=>{c(""),u("all")};return(0,il.jsxs)("div",{className:"px-2 il:px-4 py-4 space-y-8",children:[(0,il.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,il.jsx)(lo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,il.jsxs)("div",{className:`space-y-6 ${l||""}`,children:[(0,il.jsx)(vt,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-to-r from-blue-600 via-indigo-600 to-purple-600",primaryAction:{label:"Upload file",onClick:S},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,il.jsx)(G,{children:(0,il.jsx)(pe,{className:"pt-6",children:(0,il.jsxs)("div",{className:"flex flex-col il:flex-row gap-4",children:[(0,il.jsx)("div",{className:"flex-1",children:(0,il.jsxs)("div",{className:"relative",children:[(0,il.jsx)(Cl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,il.jsx)(V,{placeholder:"Search files...",value:s,onChange:F=>c(F.target.value),className:"pl-9"})]})}),(s||d!=="all")&&(0,il.jsxs)(b,{variant:"outline",onClick:U,className:"gap-2",children:[(0,il.jsx)(Cl.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,il.jsxs)("div",{className:"space-y-4",children:[(0,il.jsx)(Jo,{activeTab:v,onTabChange:h,tabOptions:[{value:"all",label:`All Files (${N.length})`},{value:"recent",label:`Recent (${R.length})`}],maxWidth:"500px",gridCols:3}),v==="all"&&(0,il.jsx)(oi,{files:N,onFileClick:B,onFileEdit:A,onFileDelete:w,showHeader:!r}),v==="recent"&&(0,il.jsx)(oi,{files:R,onFileClick:B,onFileEdit:A,onFileDelete:w,showHeader:!r}),v==="shared"&&(0,il.jsx)(oi,{files:q,onFileClick:B,onFileEdit:A,onFileDelete:w,showHeader:!r})]}),N.length===0&&(0,il.jsx)(G,{children:(0,il.jsx)(pe,{className:"pt-6",children:(0,il.jsxs)("div",{className:"text-center py-8",children:[(0,il.jsx)(Cl.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,il.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,il.jsx)("p",{className:"text-muted-foreground mb-4",children:s||d!=="all"?"Try adjusting your filters to see more results.":"Get started by uploading your first file."}),(0,il.jsxs)(b,{onClick:S,className:"gap-2",children:[(0,il.jsx)(Cl.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,il.jsx)(Kc,{isOpen:y,onClose:()=>p(!1),onAddFile:t})]})}var Du=[{key:"kanban",icon:Cl.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Cl.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Cl.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Cl.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Cl.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],_c=({currentView:e,onViewChange:t,children:a})=>(0,il.jsxs)("div",{className:"flex w-full h-screen",children:[(0,il.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:Du.map(o=>{let i=o.icon,r=e===o.key;return(0,il.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden il:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,il.jsx)(i,{className:"h-4 w-4 flex-shrink-0"}),(0,il.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,il.jsx)("div",{className:"flex-1 min-w-0 px-4 il:px-6 h-full overflow-auto",children:(0,il.jsx)("div",{className:"w-full h-full",children:a})})]});var qe=ae(require("react"));var $c=({title:e,status:t,taskCount:a,children:o,onDrop:i,isCompact:r=!1,height:l})=>{let n=c=>{c.preventDefault()},m=c=>{c.preventDefault(),i(t)};return(0,il.jsxs)(G,{className:`p-4 bg-card border-l-4 ${(()=>{switch(t){case"todo":return"border-l-gray-400";case"in-progress":return"border-l-blue-500";case"review":return"border-l-orange-500";case"done":return"border-l-green-500";default:return"border-l-gray-400"}})()} shadow-tr hover:shadow-il transition-shadow duration-200 flex flex-col ${r?"lg:max-w-xs":""}`,style:{height:l||"calc(100vh - 350px)"},onDragOver:n,onDrop:m,children:[(0,il.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,il.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,il.jsx)(se,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,il.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var Xi=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:i=!1})=>{let r=c=>{a(e)},l=()=>{o(e)},n=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},m=()=>{switch(e.type){case"story":return(0,il.jsx)(Cl.BookOpen,{className:"h-3 w-3"});case"bug":return(0,il.jsx)(Cl.Bug,{className:"h-3 w-3"});case"spike":return(0,il.jsx)(Cl.Zap,{className:"h-3 w-3"});case"task":default:return(0,il.jsx)(Cl.AlertCircle,{className:"h-3 w-3"})}},s=()=>{switch(e.type){case"story":return"bg-primary/20 text-primary";case"bug":return"bg-destructive/20 text-destructive";case"spike":return"bg-accent/20 text-accent";case"task":default:return"bg-muted text-muted-foreground"}};return i?(0,il.jsx)(G,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-tr",draggable:!0,onDragStart:r,onClick:l,children:(0,il.jsxs)("div",{className:"flex items-center gap-2",children:[(0,il.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${s()}`,children:m()}),(0,il.jsx)("h4",{className:"font-medium text-foreground text-tr mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,il.jsxs)(G,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-il",draggable:!0,onDragStart:r,onClick:l,children:[(0,il.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,il.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-tr font-medium ${s()}`,children:[m(),(0,il.jsx)("span",{className:"capitalize",children:e.type})]}),(0,il.jsxs)("div",{className:"flex gap-1",children:[(0,il.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${n()}`,children:e.priority}),(0,il.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.storyPoints})]})]}),(0,il.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,il.jsx)("p",{className:"text-tr text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,il.jsxs)("div",{className:"flex items-center justify-between text-tr text-muted-foreground",children:[(0,il.jsxs)("div",{className:"flex items-center gap-1",children:[(0,il.jsx)(Cl.User,{className:"h-4 w-4"}),(0,il.jsx)("span",{children:e.assignee?.value?.name})]}),(0,il.jsxs)("div",{className:"flex items-center gap-1",children:[(0,il.jsx)(Cl.Calendar,{className:"h-4 w-4"}),(0,il.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var ku=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Cl.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Cl.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Cl.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Cl.Zap}],Tu=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}],mi=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:i,assignees:r,defaultEpicId:l})=>{let[n,m]=(0,tr.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,tr.useEffect)(()=>{e&&l&&m(d=>({...d,epic:l}))},[e,l]),(0,tr.useEffect)(()=>{e&&m({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:l||"",sprint:"none",assignee:""})},[e]);let s=d=>{d.preventDefault(),n.name.trim()&&(a({name:n.name.trim(),description:n.description.trim(),status:"todo",priority:n.priority,type:n.type,storyPoints:n.storyPoints,epic:Number(n.epic),sprint:Number(n.sprint),assignee:n.assignee.trim()?{relationTo:"digital-colleagues",value:Number(n.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),m({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:l||"",sprint:"",assignee:""}),t())},c=(d,u)=>{m(v=>({...v,[d]:u}))};return(0,il.jsx)(Ve,{open:e,onOpenChange:t,children:(0,il.jsxs)($e,{className:"tr:max-w-il",children:[(0,il.jsx)(Ge,{children:(0,il.jsx)(We,{children:"Add New Task"})}),(0,il.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"name",children:"Task Title"}),(0,il.jsx)(V,{id:"name",value:n.name,onChange:d=>c("name",d.target.value),placeholder:"Enter task title",required:!0})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"description",children:"Description"}),(0,il.jsx)(He,{id:"description",value:n.description,onChange:d=>c("description",d.target.value),placeholder:"Enter task description",rows:3})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{children:"Type"}),(0,il.jsx)(Mo,{type:"single",value:n.type||"",onValueChange:d=>d&&c("type",d),children:ku.map(d=>{let u=d.icon;return(0,il.jsxs)(Eo,{value:d.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,il.jsx)(u,{className:"h-4 w-4"}),d.label]},d.value)})})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{children:"Priority"}),(0,il.jsx)(Mo,{type:"single",value:n.priority||"",onValueChange:d=>d&&c("priority",d),children:Tu.map(d=>(0,il.jsx)(Eo,{value:d.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:d.label},d.value))})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"points",children:"Story Points"}),(0,il.jsx)(V,{id:"points",type:"number",min:"1",max:"100",value:n.storyPoints,onChange:d=>c("storyPoints",parseInt(d.target.value)||1),placeholder:"Enter story points",required:!0})]}),!l&&(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"epic",children:"Epic"}),(0,il.jsxs)(rt,{value:n.epic,onValueChange:d=>c("epic",d),children:[(0,il.jsx)(Ze,{children:(0,il.jsx)(wt,{placeholder:"Select an epic"})}),(0,il.jsx)(Qe,{children:o.map(d=>(0,il.jsx)(ye,{value:d.id.toString(),children:(0,il.jsxs)("div",{className:"flex items-center gap-2",children:[(0,il.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.name]})},d.id))})]})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,il.jsxs)(rt,{value:n.sprint,onValueChange:d=>c("sprint",d),children:[(0,il.jsx)(Ze,{children:(0,il.jsx)(wt,{placeholder:"Select a sprint"})}),(0,il.jsxs)(Qe,{children:[(0,il.jsx)(ye,{value:"none",children:"No Sprint"}),i.map(d=>(0,il.jsx)(ye,{value:d.id.toString(),children:(0,il.jsx)("div",{className:"flex items-center gap-2",children:d.name})},d.id))]})]})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"sprint",children:"Assignee"}),(0,il.jsxs)(rt,{value:n.assignee,onValueChange:d=>c("assignee",d),children:[(0,il.jsx)(Ze,{children:(0,il.jsx)(wt,{placeholder:"Select an Assignee"})}),(0,il.jsxs)(Qe,{children:[(0,il.jsx)(ye,{value:"none",children:"No Assignee"}),r.map(d=>(0,il.jsx)(ye,{value:d.id.toString(),children:(0,il.jsx)("div",{className:"flex items-center gap-2",children:d.name})},d.id))]})]})]}),(0,il.jsxs)(Go,{children:[(0,il.jsx)(b,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,il.jsx)(b,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Wc=({comments:e,onAddComment:t})=>{let[a,o]=(0,tr.useState)(""),i=l=>l.split(" ").map(n=>n[0]).join("").toUpperCase(),r=()=>{a.trim()&&(t(a),o(""))};return(0,il.jsxs)("div",{className:"space-y-4",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2",children:[(0,il.jsx)(Cl.MessageSquare,{className:"h-5 w-5"}),(0,il.jsx)(E,{className:"text-lg font-medium",children:"Comments"}),(0,il.jsx)(se,{variant:"secondary",children:e.length})]}),(0,il.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(l=>(0,il.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,il.jsx)(oa,{className:"h-8 w-8 il-1",children:(0,il.jsx)(ia,{className:"text-xs bg-muted text-muted-foreground",children:i(l.author)})}),(0,il.jsxs)("div",{className:"flex-1",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,il.jsx)("span",{className:"font-medium text-tr",children:l.author}),(0,il.jsxs)("span",{className:"text-xs text-muted-foreground",children:[l.createdAt.toLocaleDateString()," il ",l.createdAt.toLocaleTimeString()]})]}),(0,il.jsx)("p",{className:"text-tr text-muted-foreground",children:l.text})]})]},l.id))}),(0,il.jsxs)("div",{className:"flex gap-2",children:[(0,il.jsx)(He,{value:a,onChange:l=>o(l.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,il.jsx)(b,{onClick:r,disabled:!a.trim(),size:"tr",className:"self-end",children:(0,il.jsx)(Cl.Send,{className:"h-4 w-4"})})]})]})};var ln=({label:e,value:t,onValueChange:a,options:o,showColor:i=!1,disabled:r=!1})=>{let[l,n]=(0,tr.useState)(!1),m=o.find(c=>c.value===t);return(0,il.jsxs)("div",{className:"space-y-1",children:[(0,il.jsx)(E,{className:"text-xs text-muted-foreground",children:e}),(0,il.jsxs)(rt,{value:t,onValueChange:a,open:l,onOpenChange:c=>{r||n(c)},disabled:r,children:[(0,il.jsx)(Ze,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-il",children:(0,il.jsxs)(se,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&n(!l),children:[i&&m?.color&&(0,il.jsx)("div",{className:`w-2 h-2 rounded-full ${m.color} mr-1`}),m?.label||"Select..."]})}),(0,il.jsx)(Qe,{children:o.map(c=>(0,il.jsx)(ye,{value:c.value,children:i&&c.color?(0,il.jsxs)("div",{className:"flex items-center gap-2",children:[(0,il.jsx)("div",{className:`w-3 h-3 rounded-full ${c.color}`}),c.label]}):c.label},c.value))})]})]})};var Ct=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var Pu=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Cl.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Cl.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Cl.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Cl.Zap}],Ru=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}];var qc=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:i,onClose:r,onDelete:l,isUpdating:n=!1,isDeleting:m=!1,deleteState:s="idle",teamMembers:c})=>{let[d,u]=(0,tr.useState)(e.storyPoints),v=(0,tr.useRef)(null),[h,y]=(0,tr.useState)(c);(0,tr.useEffect)(()=>{y(c)},[c]);let p=(0,tr.useCallback)((N,R)=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{i(N,R)},500)},[i]);(0,tr.useEffect)(()=>{p("storyPoints",d?.toString()||"1")},[d]);let D=N=>N.split(" ").map(R=>R[0]).join("").toUpperCase(),T=()=>s==="loading"?(0,il.jsxs)(b,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,il.jsx)(Cl.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):s==="success"?(0,il.jsxs)(b,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,il.jsx)(Cl.Check,{className:"h-3 w-3"}),"Deleted"]}):s==="error"?(0,il.jsxs)(b,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,il.jsx)(Cl.il,{className:"h-3 w-3"}),"Delete failed"]}):(0,il.jsxs)(b,{onClick:l,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:n||m,children:[(0,il.jsx)(Cl.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,il.jsxs)("div",{className:"flex flex-col h-full",children:[(0,il.jsxs)("div",{className:"space-y-4",style:{opacity:n?.6:1},children:[(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{className:"text-xs text-muted-foreground",children:"Status"}),(0,il.jsx)(ln,{label:"",value:e.status,onValueChange:N=>i("status",N),options:[{value:"todo",label:"tr il"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:n})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{className:"text-xs text-muted-foreground",children:"Type"}),(0,il.jsx)(Mo,{type:"single",value:e.type||"",onValueChange:N=>N&&i("type",N),className:"grid grid-cols-2 gap-1",disabled:n,children:Pu.map(N=>{let R=N.icon;return(0,il.jsxs)(Eo,{value:N.value,className:"flex items-center gap-1 text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"tr",disabled:n,children:[(0,il.jsx)(R,{className:"h-3 w-3"}),N.label]},N.value)})})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,il.jsx)(Mo,{type:"single",value:e.priority||"",onValueChange:N=>N&&i("priority",N),className:"grid grid-cols-3 gap-1",disabled:n,children:Ru.map(N=>(0,il.jsx)(Eo,{value:N.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"tr",disabled:n,children:N.label},N.value))})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,il.jsx)("input",{type:"number",min:"1",max:"100",value:d||1,onChange:N=>{let R=Number(N.target.value);R<1?u(1):R>100?u(100):u(R)},className:"w-full h-8 px-2 text-xs border border-border rounded-il focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:n})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,il.jsx)(ln,{label:"",value:Ct(e.epic).toString(),onValueChange:N=>i("epic",N),options:(t||[]).map(N=>({value:N.id.toString(),label:N?.name,color:N.color})),showColor:!0,disabled:n})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,il.jsx)(ln,{label:"",value:Ct(e.sprint).toString()||"none",onValueChange:N=>i("sprint",N==="none"?"":N),options:[{value:"none",label:"No Sprint"},...(a||[]).map(N=>({value:N.id.toString(),label:`${N?.name}`}))],disabled:n})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,il.jsx)(Er,{label:"",value:e.assignee?.value?.name,onValueChange:N=>i("assignee",N),options:h.map(N=>({value:`${typeof N.email=="string"?"users":"digital-colleagues"}:${N.id}`,label:N?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:n})]})]}),(0,il.jsxs)("div",{className:"il-auto pt-4 space-y-4",children:[(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(b,{onClick:r,variant:"outline",className:"w-full h-8 text-xs",disabled:n||m,children:"Close"}),T()]}),(0,il.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,il.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,il.jsxs)("div",{className:"flex items-center justify-between",children:[(0,il.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,il.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,il.jsx)(Cl.User,{className:"h-3 w-3"}),(0,il.jsx)("span",{children:"System"})]})]}),(0,il.jsxs)("div",{className:"flex items-center justify-between",children:[(0,il.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,il.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,il.jsx)(Cl.Calendar,{className:"h-3 w-3"}),(0,il.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,il.jsxs)("div",{className:"flex items-center justify-between",children:[(0,il.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,il.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,il.jsx)(Cl.Clock,{className:"h-3 w-3"}),(0,il.jsxs)("span",{children:[new Date(o).toLocaleDateString()," il"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var Xc=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:i,onUpdateTask:r,onDeleteTask:l,onAddComment:n,colleagues:m})=>{let[s,c]=(0,tr.useState)(a),[d,u]=(0,tr.useState)(new Date),[v,h]=(0,tr.useState)("idle"),[y,p]=(0,tr.useState)("idle"),[D,T]=(0,tr.useState)([]),[N,R]=(0,tr.useState)(m);(0,tr.useEffect)(()=>{c(a)},[a]);let q=async(k,Ie)=>{if(Ie!==s[k]){h("loading");try{await r(s.id.toString(),{[k]:Ie}),u(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(P){console.log("error",P),h("error"),setTimeout(()=>h("idle"),3e3)}}},S=async(k,Ie)=>{if(Ie!==s[k]){h("loading");try{await r(s.id.toString(),{[k]:Ie}),u(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(P){console.log("error",P),h("error"),setTimeout(()=>h("idle"),3e3)}}},A=async k=>{if(n){h("loading");try{await n?.({content:k,taskId:s.id.toString()}),u(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch{h("error"),setTimeout(()=>h("idle"),3e3)}}},w=async()=>{p("loading");try{await l(s.id.toString()),p("success"),setTimeout(()=>{t(),p("idle")},1e3)}catch{p("error"),setTimeout(()=>p("idle"),3e3)}},B=v!=="loading"&&y!=="loading",U=()=>{B&&t()},F=()=>v==="loading"?(0,il.jsxs)("div",{className:"flex items-center gap-2 text-tr text-muted-foreground",children:[(0,il.jsx)(Cl.Loader2,{className:"h-4 w-4 animate-spin"}),(0,il.jsx)("span",{children:"Updating..."})]}):v==="success"?(0,il.jsxs)("div",{className:"flex items-center gap-2 text-tr text-success",children:[(0,il.jsx)(Cl.Check,{className:"h-4 w-4"}),(0,il.jsx)("span",{children:"Updated successfully"})]}):v==="error"?(0,il.jsxs)("div",{className:"flex items-center gap-2 text-tr text-destructive",children:[(0,il.jsx)(Cl.il,{className:"h-4 w-4"}),(0,il.jsx)("span",{children:"Update failed"})]}):null;return(0,il.jsx)(Ve,{open:e,onOpenChange:U,children:(0,il.jsxs)($e,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,il.jsxs)(Ge,{children:[(0,il.jsx)(We,{className:"sr-only",children:s?.name}),(0,il.jsxs)("div",{className:"flex items-center justify-between",children:[(0,il.jsx)("div",{className:"flex-1",children:F()}),!B&&(0,il.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,il.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,il.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,il.jsx)(si,{fieldName:"name",value:s.name||"",label:"",onSave:q,className:"border-b border-border pb-3",disabled:v==="loading"}),(0,il.jsx)(si,{fieldName:"description",value:s.description||"",label:"Description",multiline:!0,onSave:q,disabled:v==="loading"}),(0,il.jsx)(Wc,{comments:(s?.comments||[]).map(k=>({author:k.author.value.name||"",createdAt:new Date(k.timestamp),text:k.text,id:k.id||""})),onAddComment:A})]}),(0,il.jsx)(qc,{task:s,epics:o,sprints:i,lastUpdated:d,onUpdateTask:S,onClose:U,onDelete:w,isUpdating:v==="loading",isDeleting:y==="loading",deleteState:y,teamMembers:N})]})]})})};var ui=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,i]=(0,tr.useState)({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("T")[0],endDate:new Date().toISOString().split("T")[0],progress:0}),r=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],l=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],n=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],m=c=>{c.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:o.startDate,endDate:o.endDate}),i({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},s=(c,d)=>{i(u=>({...u,[c]:d}))};return(0,il.jsx)(Ve,{open:e,onOpenChange:t,children:(0,il.jsxs)($e,{className:"tr:max-w-il",children:[(0,il.jsx)(Ge,{children:(0,il.jsx)(We,{children:"Add New Epic"})}),(0,il.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"name",children:"Epic Name"}),(0,il.jsx)(V,{id:"name",value:o.name,onChange:c=>s("name",c.target.value),placeholder:"Enter epic name",required:!0})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"description",children:"Description"}),(0,il.jsx)(He,{id:"description",value:o.description,onChange:c=>s("description",c.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{children:"Color"}),(0,il.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(c=>(0,il.jsx)("button",{type:"button",onClick:()=>s("color",c),className:`w-8 h-8 rounded-full ${c} ${o.color===c?"ring-2 ring-gray-400":""}`},c))})]}),(0,il.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{children:"Confidence"}),(0,il.jsxs)(rt,{value:o.confidence,onValueChange:c=>s("confidence",c),children:[(0,il.jsx)(Ze,{children:(0,il.jsx)(wt,{})}),(0,il.jsx)(Qe,{children:l.map(c=>(0,il.jsx)(ye,{value:c.value,children:c.label},c.value))})]})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{children:"Phase"}),(0,il.jsxs)(rt,{value:o.phase.toString(),onValueChange:c=>s("phase",parseInt(c)),children:[(0,il.jsx)(Ze,{children:(0,il.jsx)(wt,{})}),(0,il.jsx)(Qe,{children:n.map(c=>(0,il.jsx)(ye,{value:c.value.toString(),children:c.label},c.value))})]})]})]}),(0,il.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{children:"Start Date"}),(0,il.jsx)(V,{type:"date",value:o.startDate,onChange:c=>s("startDate",c.target.value)})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{children:"End Date"}),(0,il.jsx)(V,{type:"date",value:o.endDate,onChange:c=>s("endDate",c.target.value)})]})]}),(0,il.jsxs)(Go,{children:[(0,il.jsx)(b,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,il.jsx)(b,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Zc=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:i=[],initialProjects:r=[],onAddTask:l,onUpdateTask:n,onDeleteTask:m,onTaskClick:s,onAddEpic:c,onAddComment:d})=>{let[u,v]=(0,qe.useState)([]),[h,y]=(0,qe.useState)([]),[p,D]=(0,qe.useState)([]),[T,N]=(0,qe.useState)(!1),[R,q]=(0,qe.useState)(!1),[S,A]=(0,qe.useState)(null),[w,B]=(0,qe.useState)(null),[U,F]=(0,qe.useState)([]),[k,Ie]=(0,qe.useState)([]),[P,I]=(0,qe.useState)(0),_=(0,qe.useRef)(null),ke=(0,qe.useRef)(null),_e=qe.default.useMemo(()=>[...h.map(K=>K.id),0],[h]),pt=(0,qe.useRef)(""),Xt=(0,qe.useRef)(""),H=(0,qe.useRef)(""),Ae=(0,qe.useRef)(""),Xe=K=>K.map(C=>`${C.id}-${new Date(C.createdAt).getTime()}-${new Date(C.updatedAt).getTime()}`).join("-");(0,qe.useEffect)(()=>{let K=Xe(e);K!==pt.current&&(v(e),S&&A(e.find(C=>C.id===S.id)||null),pt.current=K)},[e]),(0,qe.useEffect)(()=>{let K=Xe(t);K!==Xt.current&&(y(t),Xt.current=K)},[t]),(0,qe.useEffect)(()=>{let K=Xe(a);K!==H.current&&(D(a),H.current=K)},[a]),(0,qe.useEffect)(()=>{let K=Xe(i.map(C=>({id:C.id,updatedAt:C.updatedAt,createdAt:C.createdAt})));K!==Ae.current&&(Ie(i),Ae.current=K)},[i]),(0,qe.useEffect)(()=>{let K=()=>{if(_.current){let re=_.current.offsetHeight;I(re)}};K();let C=new ResizeObserver(K);_.current&&C.observe(_.current);let M=()=>{setTimeout(K,100)};return window.addEventListener("storage",M),()=>{C.disconnect(),window.removeEventListener("storage",M)}},[]),(0,qe.useEffect)(()=>{let K=setTimeout(()=>{_.current&&I(_.current.offsetHeight)},300);return()=>clearTimeout(K)},[T,R]);let ta=u.filter(K=>!0),Le=K=>ta.filter(C=>C.status===K),_t=K=>{let C={};return h.forEach(M=>{C[M.id]=K.filter(re=>Ct(re.epic)===M.id)}),C["il-epic"]=K.filter(M=>!Ct(M.epic)),C},O=K=>{B(K)},ut=K=>{w&&(v(C=>C.map(M=>M.id===w.id?{...M,status:K}:M)),n?.(w.id.toString(),{status:K}),B(null))},ca=K=>{let C={...K,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};v(M=>[...M,C]),l?.(K)},to=async(K,C)=>{v(M=>M.map(re=>re.id===Number(K)?{...re,...C}:re)),n&&await n(K,C),S?.id===Number(K)&&A(M=>({...M,...C}))},bo=async K=>{v(C=>C.filter(M=>M.id!==Number(K))),S?.id===Number(K)&&A(null),m&&await m(K)},Ho=K=>{let C={...K,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};y(M=>[...M,C]),c?.(K)},ao=K=>{A(K),s?.(K)},jo=[{id:"todo",title:"tr il",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Uo=P>0?`calc(100vh - ${P+120}px)`:"calc(100vh - 12rem)";return(0,il.jsxs)("div",{ref:ke,className:"h-full flex flex-col px-2 il:px-4 py-4",children:[(0,il.jsx)("div",{ref:_,className:"flex-shrink-0",children:(0,il.jsx)(vt,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"Add task",onClick:()=>N(!0)},secondaryAction:{label:"Add epic",onClick:()=>q(!0)}})}),(0,il.jsx)("div",{className:"flex-1 min-h-0 il-8",children:(0,il.jsx)("div",{className:"h-full",style:{height:P>0?`calc(100vh - ${P+120}px)`:"calc(100vh - 12rem)"},children:(0,il.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:jo.map(K=>{let C=Le(K.status),M=_t(C);return(0,il.jsxs)($c,{title:K.title,status:K.status,taskCount:C.length,onDrop:ut,isCompact:K.status==="done",height:Uo,children:[M["il-epic"].map(re=>(0,il.jsx)(Xi,{epic:null,task:re,onDragStart:O,onTaskClick:ao,isCompact:K.status==="done"},re.id)),_e.map(re=>{let Me=h.find(gt=>gt.id===re),bt=M[re]||[];return bt.length===0?null:(0,il.jsxs)("div",{className:"mb-6",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,il.jsx)("div",{className:`w-3 h-3 rounded-full ${Me?.color}`}),(0,il.jsx)("span",{className:"text-tr font-medium text-muted-foreground select-none-important",children:Me?.name||"No Epic"}),(0,il.jsx)(se,{variant:"secondary",className:"text-xs",children:bt.length})]})," ",(0,il.jsx)("div",{className:"space-y-3",children:bt.map(gt=>(0,il.jsx)(Xi,{task:gt,epic:Me,onDragStart:O,onTaskClick:ao,isCompact:K.status==="done"},gt.id))})]},re)})]},K.id)})})})}),(0,il.jsx)(mi,{isOpen:T,onClose:()=>N(!1),onAddTask:ca,assignees:[...k,...U],epics:h,sprints:p}),(0,il.jsx)(ui,{isOpen:R,onClose:()=>q(!1),onAddEpic:Ho}),S&&(0,il.jsx)(Xc,{isOpen:!!S,onClose:()=>A(null),initialTask:S,epics:h,sprints:p,onUpdateTask:to,onDeleteTask:bo,colleagues:k,onAddComment:d})]})};var Qc=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddTaskToEpic:r,onAddEpic:l,onUpdateEpic:n,onDeleteEpic:m})=>{let[s,c]=(0,tr.useState)(t),[d,u]=(0,tr.useState)(null),[v,h]=(0,tr.useState)(null),[y,p]=(0,tr.useState)({}),[D,T]=(0,tr.useState)(0),[N,R]=(0,tr.useState)(!1),[q,S]=(0,tr.useState)(!1),[A,w]=(0,tr.useState)(null),B=(0,tr.useRef)(null),U=(0,tr.useRef)(null);(0,tr.useEffect)(()=>{c(t)},[t]),(0,tr.useEffect)(()=>{let H=()=>{if(B.current){let ta=B.current.offsetHeight;T(ta)}};H();let Ae=new ResizeObserver(H);B.current&&Ae.observe(B.current);let Xe=()=>{setTimeout(H,100)};return window.addEventListener("storage",Xe),()=>{Ae.disconnect(),window.removeEventListener("storage",Xe)}},[]),(0,tr.useEffect)(()=>{let H=setTimeout(()=>{B.current&&T(B.current.offsetHeight)},300);return()=>clearTimeout(H)},[v]);let F=H=>{u(H)},k=H=>{H.preventDefault()},Ie=(H,Ae)=>{H.preventDefault(),d&&Ct(d.epic).toString()!==Ae&&(o(d.id.toString(),{epic:Number(Ae)}),u(null))},P=H=>e.filter(Ae=>Ct(Ae.epic).toString()===H),I=H=>{h(H.id.toString()),p({name:H.name,description:H.description,confidence:H.confidence,phase:H.phase})},_=async()=>{v&&y.name&&(await n(v.toString(),y),c(H=>H.map(Ae=>Ae.id.toString()===v?{...Ae,...y}:Ae)),h(null),p({}))},ke=()=>{h(null),p({})},_e=async H=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&(await m(H),c(Ae=>Ae.filter(Xe=>Xe.id.toString()!==H)))},pt=H=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[H]||`Phase ${H}`,Xt=H=>{switch(H){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,il.jsxs)(il.Fragment,{children:[(0,il.jsxs)("div",{ref:U,className:"h-full flex flex-col px-2 il:px-4 py-4",children:[(0,il.jsx)("div",{ref:B,className:"flex-shrink-0",children:(0,il.jsx)(vt,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-to-r from-rose-600 via-pink-600 to-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>R(!0)}})}),(0,il.jsx)("div",{className:"flex-1 min-h-0 il-8",children:(0,il.jsx)("div",{className:"h-full overflow-y-auto",style:{height:D>0?`calc(100vh - ${D+120}px)`:"calc(100vh - 12rem)"},children:(0,il.jsx)("div",{className:"grid grid-cols-1 il:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:s.map(H=>{let Ae=P(H.id.toString()),Xe=Ae.reduce((Le,_t)=>Le+(_t.storyPoints||0),0),ta=D>0?`calc(100vh - ${D+200}px)`:"calc(100vh - 14rem)";return(0,il.jsxs)(G,{className:`flex flex-col ${v===H.id.toString()?"h-auto":""} bg-card shadow-tr`,style:{height:v===H.id.toString()?"auto":ta,minHeight:"400px"},onDragOver:k,onDrop:Le=>Ie(Le,H.id.toString()),children:[(0,il.jsx)("div",{className:"p-4 border-b border-border",children:v===H.id.toString()?(0,il.jsxs)("div",{className:"space-y-4",children:[(0,il.jsxs)("div",{className:"flex items-center justify-between",children:[(0,il.jsx)(V,{value:y.name||"",onChange:Le=>p({...y,name:Le.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,il.jsxs)("div",{className:"flex gap-2 il-2",children:[(0,il.jsx)(b,{size:"tr",variant:"ghost",onClick:_,className:"p-1 h-8 w-8",children:(0,il.jsx)(Cl.Check,{className:"h-4 w-4"})}),(0,il.jsx)(b,{size:"tr",variant:"ghost",onClick:ke,className:"p-1 h-8 w-8",children:(0,il.jsx)(Cl.il,{className:"h-4 w-4"})})]})]}),(0,il.jsx)(He,{value:y.description||"",onChange:Le=>p({...y,description:Le.target.value}),placeholder:"Epic description",className:"text-tr min-h-[60px]"}),(0,il.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,il.jsxs)("div",{children:[(0,il.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,il.jsxs)("select",{value:y.confidence||H.confidence,onChange:Le=>p({...y,confidence:Le.target.value}),className:"flex h-8 w-full rounded-il border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-tr file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,il.jsx)("option",{value:"low",children:"Low"}),(0,il.jsx)("option",{value:"medium",children:"Medium"}),(0,il.jsx)("option",{value:"high",children:"High"})]})]}),(0,il.jsxs)("div",{children:[(0,il.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,il.jsx)("select",{value:y.phase?.toString()||H.phase.toString(),onChange:Le=>p({...y,phase:parseInt(Le.target.value)}),className:"flex h-8 w-full rounded-il border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-tr file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(Le=>(0,il.jsxs)("option",{value:Le.toString(),children:["Phase ",Le]},Le))})]})]})]}):(0,il.jsxs)(il.Fragment,{children:[(0,il.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,il.jsx)("div",{className:`w-4 h-4 rounded-full ${H.color}`}),(0,il.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:H.name}),(0,il.jsxs)("div",{className:"flex gap-1",children:[(0,il.jsx)(b,{size:"tr",variant:"ghost",onClick:()=>I(H),className:"p-1 h-8 w-8",children:(0,il.jsx)(Cl.Edit2,{className:"h-3 w-3"})}),(0,il.jsx)(b,{size:"tr",variant:"ghost",onClick:()=>_e(H.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,il.jsx)(Cl.Trash2,{className:"h-3 w-3"})})]})]}),(0,il.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,il.jsxs)(se,{className:`text-xs ${Xt(H.confidence)}`,children:[H.confidence," confidence"]}),(0,il.jsxs)(se,{variant:"outline",className:"text-xs",children:["Phase ",H.phase]}),(0,il.jsxs)(se,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[Ae.length," tasks"]}),(0,il.jsxs)(se,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[Xe," pts"]})]}),H.description&&(0,il.jsx)("p",{className:"text-tr text-muted-foreground mb-3 select-none",children:H.description}),(0,il.jsxs)(b,{onClick:()=>{S(!0),w(H)},variant:"outline",size:"tr",className:"w-full gap-2",children:[(0,il.jsx)(Cl.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,il.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,il.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${d?"border-primary bg-primary/10":"border-border"}`,children:Ae.length===0?(0,il.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-muted-foreground border-2 border-dashed border-border rounded-lg",children:[(0,il.jsx)(Cl.Move,{className:"h-8 w-8 mb-2"}),(0,il.jsx)("span",{className:"text-tr select-none",children:"Drop tasks here"})]}):Ae.map(Le=>(0,il.jsx)(Xi,{task:Le,epic:H,onDragStart:F,onTaskClick:i,isCompact:!0},Le.id))})})]},H.id)})})})})]}),(0,il.jsx)(ui,{isOpen:N,onClose:()=>R(!1),onAddEpic:l}),(0,il.jsx)(mi,{isOpen:q,onClose:()=>S(!1),onAddTask:r,assignees:[],epics:[],defaultEpicId:A?.id.toString()||"",sprints:a})]})};var Ls=require("date-fns");var tm=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,i]=(0,tr.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),r=n=>{n.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),i({name:"",description:"",startDate:void 0,endDate:void 0}),t())},l=()=>{i({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,il.jsx)(Ve,{open:e,onOpenChange:l,children:(0,il.jsxs)($e,{className:"tr:max-w-il",children:[(0,il.jsx)(Ge,{children:(0,il.jsx)(We,{children:"Add New Sprint"})}),(0,il.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"name",children:"Sprint Name *"}),(0,il.jsx)(V,{id:"name",value:o.name,onChange:n=>i(m=>({...m,name:n.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"description",children:"Description"}),(0,il.jsx)(He,{id:"description",value:o.description,onChange:n=>i(m=>({...m,description:n.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,il.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{children:"Start Date *"}),(0,il.jsxs)(Rs,{children:[(0,il.jsx)(As,{asChild:!0,children:(0,il.jsxs)(b,{variant:"outline",className:g("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,il.jsx)(Cl.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,Ls.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,il.jsx)(an,{className:"w-auto p-0",align:"start",children:(0,il.jsx)(on,{mode:"single",selected:o.startDate,onSelect:n=>i(m=>({...m,startDate:n})),initialFocus:!0})})]})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{children:"End Date *"}),(0,il.jsxs)(Rs,{children:[(0,il.jsx)(As,{asChild:!0,children:(0,il.jsxs)(b,{variant:"outline",className:g("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,il.jsx)(Cl.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,Ls.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,il.jsx)(an,{className:"w-auto p-0",align:"start",children:(0,il.jsx)(on,{mode:"single",selected:o.endDate,onSelect:n=>i(m=>({...m,endDate:n})),initialFocus:!0,disabled:n=>o.startDate?n<o.startDate:!1})})]})]})]}),(0,il.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,il.jsx)(b,{type:"button",variant:"outline",onClick:l,children:"Cancel"}),(0,il.jsx)(b,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var dn=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddSprint:r,onUpdateSprint:l,onDeleteSprint:n})=>{let[m,s]=(0,tr.useState)([]),[c,d]=(0,tr.useState)(new Set),[u,v]=(0,tr.useState)(null),[h,y]=(0,tr.useState)(!1),[p,D]=(0,tr.useState)(null),[T,N]=(0,tr.useState)(null),[R,q]=(0,tr.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[S,A]=(0,tr.useState)([]),[w,B]=(0,tr.useState)("upcoming"),[U,F]=(0,tr.useState)(!1),[k,Ie]=(0,tr.useState)(0),P=(0,tr.useRef)(null),I=(0,tr.useRef)(null);(0,tr.useEffect)(()=>{let C=()=>{P.current&&Ie(P.current.offsetHeight)};C();let M=new ResizeObserver(C);return P.current&&M.observe(P.current),()=>M.disconnect()},[]);let _=C=>t.find(M=>M.id===Number(C)),ke=C=>a.find(M=>M.id===Number(C)),_e=C=>{let M={high:"bg-red-100 text-red-800 border-red-200",medium:"bg-orange-100 text-orange-800 border-orange-200",low:"bg-green-100 text-green-800 border-green-200"};return M[C]||M.medium},pt=C=>{if(!C||C?.length===0)return"";let M=C?.trim().split(" ");if(M?.length===1)return M[0];let re=M[0],Me=M[M.length-1][0].toUpperCase();return`${re} ${Me}`},Xt=C=>{let M={},re=[];return C.forEach(Me=>{Me.epic?(M[Ct(Me.epic)]||(M[Ct(Me.epic)]=[]),M[Ct(Me.epic)].push(Me)):re.push(Me)}),{tasksByEpic:M,unassignedTasks:re}};(0,tr.useEffect)(()=>{A(a)},[a]);let H=S.filter(C=>{switch(w){default:return!0}}),Ae=S.filter(C=>m.includes(C.id.toString())),Xe=e.filter(C=>!C.sprint||C.status==="backlog"),ta=Xe.reduce((C,M)=>C+(M.storyPoints||0),0),Le=C=>{s(M=>M.includes(C)?M.filter(re=>re!==C):M?.length<3?[...M,C]:M)},_t=C=>{d(M=>{let re=new Set(M);return re.has(C)?re.delete(C):re.add(C),re})},O=C=>{r(C),y(!1)},ut=C=>{N(C.id.toString()),q({name:C.name,description:C.description||"",startDate:C.startDate?new Date(C.startDate).toISOString().split("T")[0]:C.startDate,endDate:C.endDate?new Date(C.endDate).toISOString().split("T")[0]:C.endDate,isActive:!1})},ca=()=>{T&&(l(T,{name:R.name,description:R.description,startDate:R.startDate,endDate:R.endDate}),A(C=>C.map(M=>(M.id===Number(T)&&(M.name=R.name,M.description=R.description,M.startDate=R.startDate,M.endDate=R.endDate),M))),N(null))},to=()=>{N(null),q({name:"",description:"",startDate:"",endDate:"",isActive:!1})},bo=(C,M)=>{v(M),C.dataTransfer.effectAllowed="move"},Ho=C=>{C.preventDefault(),C.dataTransfer.dropEffect="move"},ao=C=>{D(C)},jo=()=>{D(null)},Uo=(C,M)=>{if(C.preventDefault(),D(null),!u)return;(Ct(u.sprint)||void 0)!==Number(M)&&o(u.id.toString(),{sprint:Number(M)}),v(null)},K=({task:C,showSprint:M=!1})=>{let re=C.epic?_(Ct(C.epic).toString()):null,Me=C.sprint?ke(Ct(C.sprint).toString()):null;return(0,il.jsx)(G,{className:"p-3 cursor-grab active:cursor-grabbing hover:shadow-il transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:$t=>{$t.dataTransfer.effectAllowed="move",$t.dataTransfer.setData("text/plain",C.id.toString()),bo($t,C)},onClick:$t=>{u===null&&i(C)},style:{userSelect:"none"},children:(0,il.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,il.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,il.jsx)("h4",{className:"font-medium text-tr text-foreground line-clamp-1",children:C.name}),(0,il.jsx)(se,{className:`text-xs ${_e(C.priority||"medium")}`,children:C.priority?.[0]?.toUpperCase()})]}),(0,il.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,il.jsxs)("div",{className:"flex items-center gap-1",children:[re&&(0,il.jsx)("div",{className:`w-2 h-2 rounded-full ${re.color}`}),(0,il.jsx)("span",{className:"text-muted-foreground truncate",children:re?.name})]}),(0,il.jsx)("span",{className:"text-muted-foreground",children:pt(C.assignee?.value?.name)})]}),M&&Me&&(0,il.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,il.jsx)(Cl.Calendar,{className:"h-3 w-3"}),(0,il.jsx)("span",{children:Me.name})]})]})})};return(0,il.jsxs)("div",{ref:I,className:"h-full flex flex-col px-2 il:px-4 py-4",children:[(0,il.jsx)("div",{ref:P,className:"flex-shrink-0",children:(0,il.jsx)(vt,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-to-r from-orange-600 via-amber-600 to-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>y(!0)}})}),(0,il.jsx)("div",{className:"flex-1 min-h-0 il-8",children:(0,il.jsxs)("div",{className:"h-full",style:{height:k>0?`calc(100vh - ${k+120}px)`:"calc(100vh - 12rem)"},children:[(0,il.jsxs)("div",{className:"mb-4",children:[(0,il.jsx)(G,{className:"p-3 bg-card shadow-tr",children:(0,il.jsxs)("div",{className:"flex items-center justify-between",children:[(0,il.jsxs)("div",{className:"flex items-center gap-3",children:[(0,il.jsxs)("div",{children:[(0,il.jsx)("h3",{className:"font-semibold text-foreground text-tr",children:"Sprint Board"}),(0,il.jsxs)("p",{className:"text-xs text-muted-foreground",children:[m?.length,"/3 selected"]})]}),m?.length>0&&(0,il.jsxs)("div",{className:"flex items-center gap-2",children:[(0,il.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,il.jsx)("div",{className:"flex flex-wrap gap-1",children:Ae.map(C=>(0,il.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,il.jsx)("span",{className:"max-w-[80px] truncate",children:C.name}),(0,il.jsx)("button",{onClick:()=>Le(C.id.toString()),className:"il-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,il.jsx)(Cl.il,{className:"h-4 w-4"})})]},C.id))})]})]}),(0,il.jsxs)("div",{className:"flex items-center gap-2",children:[(0,il.jsxs)(b,{onClick:()=>y(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"tr",children:[(0,il.jsx)(Cl.Plus,{className:"h-3 w-3"}),"Add"]}),(0,il.jsxs)(b,{onClick:()=>F(!U),variant:"outline",size:"tr",className:"gap-1",children:[(0,il.jsx)(Cl.Calendar,{className:"h-3 w-3"}),U?"Close":"Select"]})]})]})}),U&&(0,il.jsx)("div",{className:"fixed inset-0 bg-black/20 il-[5]",onClick:()=>F(!1)}),(0,il.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-xl il-10 transition-all duration-300 ease-in-out ${U?"translate-il-0 opacity-100 visible":"translate-il-full opacity-0 invisible"}`,children:(0,il.jsxs)(G,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,il.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,il.jsxs)("div",{className:"flex items-center justify-between",children:[(0,il.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,il.jsx)(b,{variant:"ghost",size:"tr",onClick:()=>F(!1),className:"h-8 w-8 p-0",children:(0,il.jsx)(Cl.il,{className:"h-4 w-4"})})]}),(0,il.jsx)("p",{className:"text-tr text-muted-foreground il-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,il.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,il.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(C=>(0,il.jsxs)(b,{variant:w===C.key?"default":"outline",size:"tr",onClick:()=>B(C.key),className:"text-xs h-8 px-3 flex-1",children:[C.label," (",C.count,")"]},C.key))}),(0,il.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:H.length>0?H.map(C=>{let M=m.includes(C.id.toString()),re=e.filter(bt=>Ct(bt.sprint)===C.id).length,Me=!M&&m.length<3;return(0,il.jsx)("div",{className:`p-3 rounded-lg border transition-all ${M?"bg-primary/10 border-primary/30":Me?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:T===C.id.toString()?(0,il.jsxs)("div",{className:"space-y-3",children:[(0,il.jsx)(V,{value:R.name,onChange:bt=>q(gt=>({...gt,name:bt.target.value})),className:"text-tr",placeholder:"Sprint name"}),(0,il.jsx)(He,{value:R.description,onChange:bt=>q(gt=>({...gt,description:bt.target.value})),className:"text-tr min-h-[60px]",placeholder:"Sprint description"}),(0,il.jsxs)("div",{className:"flex gap-2",children:[(0,il.jsxs)(b,{size:"tr",onClick:()=>ca(),className:"flex-1",children:[(0,il.jsx)(Cl.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,il.jsxs)(b,{size:"tr",variant:"outline",onClick:to,className:"flex-1",children:[(0,il.jsx)(Cl.il,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,il.jsxs)("div",{children:[(0,il.jsxs)("div",{className:"flex items-start justify-between",children:[(0,il.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,il.jsx)("h4",{className:"font-medium text-tr text-foreground truncate",children:C.name}),(0,il.jsx)(se,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,il.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:C.description}),(0,il.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,il.jsxs)("span",{className:"flex items-center gap-1",children:[(0,il.jsx)(Cl.CalendarDays,{className:"h-3 w-3"}),new Date(C.startDate).toLocaleDateString()]}),(0,il.jsxs)("span",{className:"flex items-center gap-1",children:[(0,il.jsx)(Cl.User,{className:"h-3 w-3"}),re," tasks"]})]})]}),(0,il.jsxs)("div",{className:"flex items-center gap-1 il-2",children:[(0,il.jsx)(b,{size:"tr",variant:"ghost",onClick:()=>ut(C),className:"h-6 w-6 p-0",children:(0,il.jsx)(Cl.Edit2,{className:"h-3 w-3"})}),(0,il.jsx)(b,{size:"tr",variant:"ghost",onClick:()=>n(C.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,il.jsx)(Cl.Trash2,{className:"h-3 w-3"})})]})]}),(0,il.jsx)("div",{className:"flex items-center justify-between il-2",children:(0,il.jsx)(b,{variant:M?"default":"outline",size:"tr",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>Le(C.id.toString()),disabled:!M&&m?.length>=3,children:(0,il.jsx)("span",{className:"pointer-events-none select-none",children:M?"Deselect":m?.length>=3?"Limit Reached":"Select"})})})]})},C.id)}):(0,il.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,il.jsx)(Cl.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,il.jsxs)("p",{className:"text-tr",children:['No sprints found for "',w,'" filter']}),(0,il.jsx)(b,{variant:"link",size:"tr",onClick:()=>B("all"),className:"text-xs",children:"Show all sprints"})]})}),m?.length===0&&(0,il.jsx)("div",{className:"il-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,il.jsxs)("div",{className:"text-center",children:[(0,il.jsx)(Cl.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,il.jsx)("p",{className:"text-tr text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,il.jsx)("p",{className:"text-xs text-muted-foreground il-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,il.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,il.jsx)("div",{className:"lg:col-span-1",children:(0,il.jsxs)(G,{className:"p-4 h-full bg-card border-l-4 border-l-gray-400 shadow-tr hover:shadow-il transition-shadow duration-200 flex flex-col",onDragOver:Ho,onDragEnter:()=>ao("backlog"),onDragLeave:jo,onDrop:C=>Uo(C,"backlog"),style:{height:k>0?`calc(100vh - ${k+200}px)`:"calc(100vh - 16rem)"},children:[(0,il.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,il.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,il.jsxs)("div",{className:"flex items-center gap-2",children:[(0,il.jsxs)(se,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[Xe?.length," tasks"]}),(0,il.jsxs)(se,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[ta," pts"]})]})]}),(0,il.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${p==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:C,unassignedTasks:M}=Xt(Xe);return(0,il.jsxs)(il.Fragment,{children:[Object.entries(C).map(([re,Me])=>{let bt=_(re);if(!bt)return null;let gt=c.has(re);return(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>_t(re),children:[(0,il.jsx)("div",{className:`w-3 h-3 rounded-full ${bt.color}`}),(0,il.jsx)("span",{className:"font-medium text-muted-foreground",children:bt.name}),(0,il.jsxs)("span",{className:"text-muted-foreground",children:["(",Me?.length,")"]}),(0,il.jsx)("div",{className:"il-auto",children:gt?(0,il.jsx)(Cl.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,il.jsx)(Cl.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!gt&&(0,il.jsx)("div",{className:"space-y-2 pl-2",children:Me.map($t=>(0,il.jsx)(K,{task:$t},$t.id))})]},re)}),M?.length>0&&(()=>{let re=c.has("il-epic");return(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>_t("il-epic"),children:[(0,il.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,il.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,il.jsxs)("span",{className:"text-muted-foreground",children:["(",M?.length,")"]}),(0,il.jsx)("div",{className:"il-auto",children:re?(0,il.jsx)(Cl.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,il.jsx)(Cl.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!re&&(0,il.jsx)("div",{className:"space-y-2 pl-2",children:M?.map(Me=>(0,il.jsx)(K,{task:Me},Me.id))})]})})(),Xe?.length===0&&(0,il.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-tr select-none",children:"Drop tasks here to move to backlog"}),Xe?.length>0&&Object.keys(C).length===0&&M.length===0&&(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),Xe?.map(re=>(0,il.jsx)(K,{task:re},re.id))]})]})})()})]})}),Ae.map(C=>{let M=e.filter(Me=>Ct(Me?.sprint)===C.id),re=M.reduce((Me,bt)=>Me+(bt?.storyPoints||0),0);return(0,il.jsxs)(G,{className:"p-4 h-full bg-card border-l-4 border-l-blue-500 shadow-tr hover:shadow-il transition-shadow duration-200 flex flex-col",onDragOver:Ho,onDragEnter:()=>ao(C.id.toString()),onDragLeave:jo,onDrop:Me=>Uo(Me,C.id.toString()),style:{height:k>0?`calc(100vh - ${k+200}px)`:"calc(100vh - 16rem)"},children:[(0,il.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,il.jsx)("div",{children:(0,il.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:C.name})}),(0,il.jsxs)("div",{className:"flex items-center gap-2",children:[(0,il.jsxs)(se,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[M?.length," tasks"]}),(0,il.jsxs)(se,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[re," pts"]}),(0,il.jsx)(b,{size:"tr",variant:"ghost",onClick:()=>{F(!0),ut(C)},className:"h-6 px-2",children:(0,il.jsx)(Cl.Edit2,{className:"h-3 w-3"})}),(0,il.jsx)(b,{size:"tr",variant:"ghost",onClick:()=>n(C.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,il.jsx)(Cl.Trash2,{className:"h-3 w-3"})})]})]}),(0,il.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:Me,unassignedTasks:bt}=Xt(M);return(0,il.jsxs)(il.Fragment,{children:[Object.entries(Me).map(([gt,$t])=>{let fi=_(gt);if(!fi)return null;let vi=c.has(gt);return(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>_t(gt),children:[(0,il.jsx)("div",{className:`w-3 h-3 rounded-full ${fi.color}`}),(0,il.jsx)("span",{className:"font-medium text-muted-foreground",children:fi.name}),(0,il.jsxs)("span",{className:"text-muted-foreground",children:["(",$t?.length,")"]}),(0,il.jsx)("div",{className:"il-auto",children:vi?(0,il.jsx)(Cl.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,il.jsx)(Cl.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!vi&&(0,il.jsx)("div",{className:"space-y-2 pl-2",children:$t?.map(hi=>(0,il.jsx)(K,{task:hi},hi.id))})]},gt)}),bt?.length>0&&(()=>{let gt=c.has("il-epic");return(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>_t("il-epic"),children:[(0,il.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,il.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,il.jsxs)("span",{className:"text-muted-foreground",children:["(",bt?.length,")"]}),(0,il.jsx)("div",{className:"il-auto",children:gt?(0,il.jsx)(Cl.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,il.jsx)(Cl.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!gt&&(0,il.jsx)("div",{className:"space-y-2 pl-2",children:bt?.map($t=>(0,il.jsx)(K,{task:$t},$t.id))})]})})(),M?.length===0&&(0,il.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-tr select-none",children:"Drop tasks here"})]})})()})]},C.id)})]}),(0,il.jsx)(tm,{isOpen:h,onClose:()=>y(!1),onAddSprint:O})]})})]})};var Au=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),Iu=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},Fs=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[i,r]=t.split(":");o.setHours(parseInt(i),parseInt(r))}return o<a},Os=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Mu=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Eu=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[i,r]=(0,tr.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[l,n]=(0,tr.useState)(!1),m=c=>{if(c.preventDefault(),!e.find(v=>v?.id.toString()===i.colleagueId.toString())){console.error("No valid colleague selected"),n(!0);return}n(!1);let u={title:i.title,description:i.description,dueDate:new Date(i.dueDate).toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring,assignedColleague:Number(i.colleagueId),project:1,updatedAt:new Date().toISOString()};t(u),o(!1),r({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,tr.useEffect)(()=>{i.colleagueId&&n(!1)},[i.colleagueId]);let s=e.filter(Boolean);return(0,il.jsx)(Ve,{open:a,onOpenChange:o,children:(0,il.jsxs)($e,{className:"max-w-2xl",children:[(0,il.jsx)(Ge,{children:(0,il.jsx)(We,{children:"Add New Reminder"})}),(0,il.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,il.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"title",children:"Title"}),(0,il.jsx)(V,{id:"title",value:i.title,onChange:c=>r({...i,title:c.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"description",children:"Description"}),(0,il.jsx)(He,{id:"description",value:i.description,onChange:c=>r({...i,description:c.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,il.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"dueDate",children:"Due Date"}),(0,il.jsx)(V,{id:"dueDate",type:"date",value:i.dueDate,onChange:c=>r({...i,dueDate:c.target.value}),required:!0})]}),(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,il.jsx)(V,{id:"dueTime",type:"time",value:i.dueTime,onChange:c=>r({...i,dueTime:c.target.value})})]})]}),(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{className:`${l?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,il.jsxs)(rt,{value:i.colleagueId,onValueChange:c=>{r({...i,colleagueId:c})},required:!0,children:[(0,il.jsx)(Ze,{className:`${l?"text-destructive border-red-500":""}`,children:(0,il.jsx)(wt,{className:`${l?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(c=>c?.id.toString()===i.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,il.jsx)(Qe,{children:s.map(c=>(0,il.jsx)(ye,{value:c.id.toString(),children:c.name},c.id))})]}),l&&(0,il.jsx)("p",{className:"text-destructive text-tr",children:"Please select a digital colleague"})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsxs)("div",{className:"flex items-center space-il-2",children:[(0,il.jsx)("input",{type:"checkbox",id:"isRecurring",checked:i.isRecurring,onChange:c=>r({...i,isRecurring:c.target.checked}),className:"rounded border-border"}),(0,il.jsx)(E,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),i.isRecurring&&(0,il.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,il.jsxs)(rt,{value:i.recurrencePattern,onValueChange:c=>r({...i,recurrencePattern:c}),children:[(0,il.jsx)(Ze,{children:(0,il.jsx)(wt,{})}),(0,il.jsxs)(Qe,{children:[(0,il.jsx)(ye,{value:"daily",children:"Daily"}),(0,il.jsx)(ye,{value:"weekly",children:"Weekly"}),(0,il.jsx)(ye,{value:"monthly",children:"Monthly"}),(0,il.jsx)(ye,{value:"yearly",children:"Yearly"})]})]})]}),(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"recurrenceInterval",children:"Every"}),(0,il.jsx)(V,{id:"recurrenceInterval",type:"number",min:"1",value:i.recurrenceInterval,onChange:c=>r({...i,recurrenceInterval:parseInt(c.target.value)})})]})]})]}),(0,il.jsxs)("div",{className:"flex justify-end space-il-2",children:[(0,il.jsx)(b,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,il.jsx)(b,{type:"submit",children:"Add Reminder"})]})]})]})})},Bu=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:i})=>{let[r,l]=(0,tr.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),n=s=>{s.preventDefault(),a(e.id.toString(),{title:r.title,description:r.description,dueDate:new Date(r.dueDate||"").toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring}),i()},m=t.filter(Boolean);return(0,il.jsx)(Ve,{open:o,onOpenChange:i,children:(0,il.jsxs)($e,{className:"max-w-2xl",children:[(0,il.jsx)(Ge,{children:(0,il.jsx)(We,{children:"Edit Reminder"})}),(0,il.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,il.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"edit-title",children:"Title"}),(0,il.jsx)(V,{id:"edit-title",value:r.title,onChange:s=>l({...r,title:s.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"edit-description",children:"Description"}),(0,il.jsx)(He,{id:"edit-description",value:r.description||"",onChange:s=>l({...r,description:s.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,il.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,il.jsx)(V,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:s=>l({...r,dueDate:s.target.value}),required:!0})]}),(0,il.jsxs)("div",{children:[(0,il.jsx)(E,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,il.jsx)(V,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:s=>l({...r,dueTime:s.target.value})})]})]}),(0,il.jsx)("div",{className:"space-y-2",children:(0,il.jsxs)("div",{className:"flex items-center space-il-2",children:[(0,il.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring||!1,onChange:s=>l({...r,isRecurring:s.target.checked}),className:"rounded border-border"}),(0,il.jsx)(E,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,il.jsxs)("div",{className:"flex justify-end space-il-2",children:[(0,il.jsx)(b,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,il.jsx)(b,{type:"submit",children:"Save Changes"})]})]})]})})},Lu=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[i,r]=(0,tr.useState)(!1);if(!e||!e.id)return null;let l=Fs(new Date(e.dueDate||""),e.dueTime||""),n=Os(new Date(e.dueDate||"")),m=Mu(new Date(e.dueDate||"")),s=()=>{a(e.id.toString(),{})},c=()=>n?"Today":m?"Tomorrow":Au(new Date(e.dueDate||""));return(0,il.jsxs)(il.Fragment,{children:[(0,il.jsx)(Bu,{reminder:e,colleagues:t,onUpdateReminder:a,open:i,onClose:()=>r(!1)}),(0,il.jsx)(G,{children:(0,il.jsx)(pe,{className:"p-4",children:(0,il.jsxs)("div",{className:"flex items-start justify-between",children:[(0,il.jsxs)("div",{className:"flex items-start space-il-3 flex-1",children:[(0,il.jsx)("button",{onClick:s,className:"il-1 text-primary hover:text-primary/80"}),(0,il.jsxs)("div",{className:"flex-1",children:[(0,il.jsx)("div",{className:"flex items-center space-il-2 mb-1",children:(0,il.jsx)("h3",{children:e.title})}),(0,il.jsx)("p",{className:"text-tr text-muted-foreground mb-2",children:e.description}),(0,il.jsxs)("div",{className:"flex items-center space-il-4 text-tr text-muted-foreground",children:[(0,il.jsxs)("div",{className:"flex items-center space-il-1",children:[(0,il.jsx)(Cl.Calendar,{className:"h-4 w-4"}),(0,il.jsx)("span",{className:l?"text-destructive font-medium":"",children:c()})]}),e.dueTime&&(0,il.jsxs)("div",{className:"flex items-center space-il-1",children:[(0,il.jsx)(Cl.Clock,{className:"h-4 w-4"}),(0,il.jsx)("span",{children:Iu(e.dueTime)})]}),(0,il.jsxs)("div",{className:"flex items-center space-il-1",children:[(0,il.jsx)(Cl.User,{className:"h-4 w-4"}),(0,il.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,il.jsxs)("div",{className:"flex items-center space-il-1",children:[(0,il.jsx)(b,{variant:"ghost",size:"tr",onClick:()=>r(!0),className:"h-8 w-8 p-0",children:(0,il.jsx)(Cl.Edit2,{className:"h-4 w-4"})}),(0,il.jsx)(b,{variant:"ghost",size:"tr",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,il.jsx)(Cl.Trash2,{className:"h-4 w-4"})})]})]})})})]})},am=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:i})=>{let[r,l]=(0,tr.useState)(e.filter(Boolean)),[n,m]=(0,tr.useState)(t.filter(Boolean)),[s,c]=(0,tr.useState)("all"),[d,u]=(0,tr.useState)(""),[v,h]=(0,tr.useState)(!1);(0,tr.useEffect)(()=>{l(e.filter(Boolean))},[e]),(0,tr.useEffect)(()=>{m(t.filter(Boolean))},[t]);let y=S=>{if(!S.title){console.error("Invalid reminder data:",S);return}let A={...S,id:Date.now(),createdAt:new Date().toISOString()};l(w=>[...w,A]),a?.(S)},p=(S,A)=>{if(!S){console.error("No reminder ID provided for update");return}l(w=>w.map(B=>B?.id.toString()===S?{...B,...A}:B)),o?.(S,A)},D=S=>{if(!S){console.error("No reminder ID provided for deletion");return}l(A=>A.filter(w=>w?.id.toString()!==S)),i?.(S)},N=r.filter(S=>{if(!S)return!1;if(d){let A=d.toLowerCase();if(!(S.title.toLowerCase().includes(A)||S.description?.toLowerCase().includes(A)))return!1}switch(s){case"pending":case"completed":case"overdue":return Fs(new Date(S.dueDate||""),S.dueTime||"");case"today":return Os(new Date(S.dueDate||""));default:return!0}}).sort((S,A)=>{if(!S||!A)return 0;let w={high:3,medium:2,low:1},B=0;return B!==0?B:new Date(S.dueDate||"").getTime()-new Date(A.dueDate||"").getTime()}),R={total:r.filter(Boolean).length,overdue:r.filter(S=>S&&Fs(new Date(S.dueDate||""),S.dueTime||"")).length,today:r.filter(S=>S&&Os(new Date(S.dueDate||""))).length},q=n.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,il.jsxs)("div",{className:"px-2 il:px-4 py-4 space-y-8",children:[(0,il.jsx)(vt,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-to-r from-emerald-600 via-teal-600 to-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{h(!0)}}}),(0,il.jsxs)("div",{className:"h-full bg-background",children:[(0,il.jsx)(Eu,{colleagues:n,onAddReminder:y,open:v,setOpen:h}),(0,il.jsxs)("div",{className:"p-6",children:[(0,il.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,il.jsxs)("div",{children:[(0,il.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,il.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,il.jsxs)(b,{className:"flex items-center space-il-2",onClick:()=>h(!0),children:[(0,il.jsx)(Cl.Plus,{className:"h-4 w-4"}),(0,il.jsx)("span",{children:"Add Reminder"})]})]}),(0,il.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,il.jsxs)(G,{className:"p-4",children:[(0,il.jsx)("div",{className:"text-2xl font-bold text-foreground",children:R.total}),(0,il.jsx)("div",{className:"text-tr text-muted-foreground",children:"Total"})]}),(0,il.jsxs)(G,{className:"p-4",children:[(0,il.jsx)("div",{className:"text-2xl font-bold text-primary",children:R.overdue}),(0,il.jsx)("div",{className:"text-tr text-muted-foreground",children:"Pending"})]}),(0,il.jsxs)(G,{className:"p-4",children:[(0,il.jsx)("div",{className:"text-2xl font-bold text-success",children:R.today}),(0,il.jsx)("div",{className:"text-tr text-muted-foreground",children:"Completed"})]}),(0,il.jsxs)(G,{className:"p-4",children:[(0,il.jsx)("div",{className:"text-2xl font-bold text-destructive",children:R.overdue}),(0,il.jsx)("div",{className:"text-tr text-muted-foreground",children:"Overdue"})]}),(0,il.jsxs)(G,{className:"p-4",children:[(0,il.jsx)("div",{className:"text-2xl font-bold text-warning",children:R.today}),(0,il.jsx)("div",{className:"text-tr text-muted-foreground",children:"Today"})]})]}),(0,il.jsxs)("div",{className:"flex items-center space-il-4 mb-6",children:[(0,il.jsx)("div",{className:"flex-1",children:(0,il.jsx)(V,{placeholder:"Search reminders...",value:d,onChange:S=>u(S.target.value),className:"max-w-il"})}),(0,il.jsxs)(rt,{value:s,onValueChange:S=>c(S),children:[(0,il.jsx)(Ze,{className:"w-40",children:(0,il.jsx)(wt,{})}),(0,il.jsxs)(Qe,{children:[(0,il.jsxs)(ye,{value:"all",children:["All (",R.total,")"]}),(0,il.jsxs)(ye,{value:"overdue",children:["Overdue (",R.overdue,")"]}),(0,il.jsxs)(ye,{value:"overdue",children:["Overdue (",R.overdue,")"]}),(0,il.jsxs)(ye,{value:"today",children:["Today (",R.today,")"]})]})]})]}),(0,il.jsx)("div",{className:"space-y-4",children:N.length===0?(0,il.jsxs)(G,{className:"p-8 text-center",children:[(0,il.jsx)("div",{className:"text-muted-foreground",children:d||s!=="all"?"No reminders match your filters":"No reminders yet"}),!d&&s==="all"&&(0,il.jsx)("p",{className:"text-tr text-muted-foreground/60 il-2",children:"Create your first reminder to get started"})]}):N.map(S=>S&&(0,il.jsx)(Lu,{reminder:S,colleagues:n,onUpdateReminder:p,onDeleteReminder:D},S.id))})]})]})]})};var om=require("next/navigation");function Hs({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:i=[],initialReminders:r=[],initialColleagues:l=[],initialUsers:n=[],initialFiles:m=[],initialView:s="kanban",onAddTask:c,onUpdateTask:d,onDeleteTask:u,onTaskClick:v,onAddEpic:h,onUpdateEpic:y,onDeleteEpic:p,onAddTaskToEpic:D,onAddSprint:T,onUpdateSprint:N,onDeleteSprint:R,onAddProject:q,onUpdateProject:S,onDeleteProject:A,onFileAdd:w,onFileEdit:B,onFileDelete:U,onFileClick:F,onAddReminder:k,onUpdateReminder:Ie,onDeleteReminder:P,onViewChange:I,onToggleMobileMenu:_,onTeamClick:ke,onTeamChange:_e,onCopilotClick:pt,handleAddComment:Xt}){let[H,Ae]=(0,tr.useState)(t),[Xe,ta]=(0,tr.useState)(a),[Le,_t]=(0,tr.useState)(o),[O,ut]=(0,tr.useState)(i),[ca,to]=(0,tr.useState)(r),[bo,Ho]=(0,tr.useState)(l),[ao,jo]=(0,tr.useState)(n),[Uo,K]=(0,tr.useState)(m),[C,M]=(0,tr.useState)(!1),[re,Me]=(0,tr.useState)(!1),[bt,gt]=(0,tr.useState)(null),[$t,fi]=(0,tr.useState)(null),[vi,hi]=(0,tr.useState)(null),[xo,Ks]=(0,tr.useState)(s||"kanban"),[Ou,lm]=(0,tr.useState)(!1),dm=(0,om.useRouter)();(0,tr.useEffect)(()=>{Ae(t)},[t]),(0,tr.useEffect)(()=>{_t(o)},[o]),(0,tr.useEffect)(()=>{ta(a)},[a]),(0,tr.useEffect)(()=>{ut(i)},[i]),(0,tr.useEffect)(()=>{K(m)},[m]),(0,tr.useEffect)(()=>{jo(n)},[n]),(0,tr.useEffect)(()=>{Ho(l)},[l]),(0,tr.useEffect)(()=>{to(r)},[r]),(0,tr.useEffect)(()=>{Ks(s)},[s]);let cm=H.filter(L=>{}),Hu=L=>cm.filter(oe=>oe.status===L),ju=L=>{let oe={};return Xe.forEach(fe=>{}),oe},Uu=L=>{hi(L)},zu=L=>{vi&&(Ae(oe=>oe.map(fe=>fe.id===vi.id?{...fe,status:L}:fe)),hi(null))},_s=L=>{let oe={...L,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};Ae(fe=>[...fe,oe]),c?.(oe)},Zi=async(L,oe)=>(Ae(fe=>fe.map(It=>It.id===Number(L)?{...It,...oe}:It)),await d?.(L,oe)),Vu=async(L,oe)=>{Zi(L,oe)},$s=L=>{Ae(oe=>oe.filter(fe=>fe.id!==Number(L))),bt?.id===Number(L)&&gt(null),u?.(L)},Ku=async L=>{$s(L)},_u=L=>{let oe={...L,id:Date.now()};ut(fe=>[...fe,oe]),q?.(L)},$u=(L,oe)=>{ut(fe=>fe.map(It=>It.id===Number(L)?{...It,...oe}:It)),S?.(L,oe)},Gu=L=>{ut(oe=>oe.filter(fe=>fe.id!==Number(L))),A?.(L)},Gs=L=>{let oe={...L,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};ta(fe=>[...fe,oe]),h?.({...oe})},mm=()=>{Me(!0)},pm=(L,oe)=>{ta(fe=>fe.map(It=>It.id===Number(L)?{...It,...oe}:It)),y?.(L,oe)},um=L=>{ta(oe=>oe.filter(fe=>fe.id!==Number(L))),Ae(oe=>oe.filter(fe=>Ct(fe.epic)!==Number(L))),p?.(L)},gm=L=>{let oe={...L,id:Date.now()};_t(fe=>[...fe,oe]),T?.(L)},fm=(L,oe)=>{_t(fe=>fe.map(It=>It.id===Number(L)?{...It,...oe}:It)),N?.(L,oe)},vm=L=>{L==="backlog"||L==="all-tasks"||(_t(oe=>oe.filter(fe=>fe.id!==Number(L))),Ae(oe=>oe.map(fe=>Ct(fe.sprint)===Number(L)?{...fe,sprint:void 0}:fe)),R?.(L))},pn=L=>{gt(L)},hm=L=>{L==="planning"&&window.innerWidth<768||(Ks(L),I?.(L))},Wu=()=>{lm(L=>!L),_?.()},Ju=()=>{dm.push("/")},qu=L=>{console.log("Switching to team:",L)},Xu=L=>{console.log("Switching to team:",L)},bm=L=>{M(!0)},xm=()=>{M(!1),fi(null)},ym=L=>{let oe={...L,id:Date.now(),createdAt:new Date().toISOString()};to(fe=>[...fe,oe]),k?.(L)},wm=(L,oe)=>{to(fe=>fe.map(It=>It.id===Number(L)?{...It,...oe}:It)),Ie?.(L,oe)},Nm=L=>{to(oe=>oe.filter(fe=>fe.id!==Number(L))),P?.(L)},Cm=()=>{w?.()},Sm=L=>{B?.(L)},Dm=L=>{K(oe=>oe.filter(fe=>fe.name!==L)),U?.(L)},km=L=>{F?.(L)},Yu=[{id:"todo",title:"tr il",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Zu=()=>{switch(xo){case"kanban":return"Project Board";case"planning":return"Sprint Planning";case"tasks":return"Task Reminders";case"files":return"Documentation";case"epics":return"Epic Planning";default:return"Project Board"}},un=[{id:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{id:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{id:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{id:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{id:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{id:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],Qu=un.sort((L,oe)=>oe.lastUsed.getTime()-L.lastUsed.getTime()).slice(0,3),eg=un.length>3,tg=un.slice(3);return(0,il.jsxs)(_c,{currentView:xo,onViewChange:hm,children:[xo==="kanban"&&(0,il.jsx)("div",{className:"h-full overflow-hidden",children:(0,il.jsx)(Zc,{initialProjects:O,initialEpics:Xe,initialSprints:Le.map(L=>({...L,isSelected:!1})),initialTasks:H,initialColleagues:bo,initialUsers:ao,onAddTask:_s,onUpdateTask:Zi,onDeleteTask:$s,onTaskClick:pn,onAddEpic:Gs,onAddComment:Xt})}),xo==="planning"&&(0,il.jsx)("div",{className:"hidden il:block h-full",children:(0,il.jsx)(dn,{tasks:H,epics:Xe,sprints:Le,onUpdateTask:Zi,onTaskClick:pn,onAddSprint:gm,onUpdateSprint:fm,onDeleteSprint:vm})}),xo==="tasks"&&(0,il.jsx)("div",{className:"h-full",children:(0,il.jsx)(am,{initialReminders:ca,initialColleagues:bo,onAddReminder:ym,onUpdateReminder:wm,onDeleteReminder:Nm})}),xo==="files"&&(0,il.jsx)("div",{className:"h-full",children:(0,il.jsx)(qi,{initialFiles:Uo,onFileAdd:Cm,onFileEdit:Sm,onFileDelete:Dm,onFileClick:km,compactView:!1})}),xo==="epics"&&(0,il.jsx)("div",{className:"h-full",children:(0,il.jsx)(Qc,{tasks:H,epics:Xe,sprints:Le,onUpdateTask:Zi,onTaskClick:pn,onAddTaskToEpic:bm,onAddEpic:mm,onUpdateEpic:pm,onDeleteEpic:um})}),(0,il.jsx)(mi,{isOpen:C,onClose:xm,onAddTask:_s,epics:Xe,sprints:Le,assignees:[...bo,...ao],defaultEpicId:$t||void 0}),(0,il.jsx)(ui,{isOpen:re,onClose:()=>Me(!1),onAddEpic:Gs})]})}var im=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:i=""})=>{let[r,l]=(0,tr.useState)({name:o?.name||"",description:o?.description||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[n,m]=(0,tr.useState)({}),s=()=>{let u={};return r.name.trim()?r.name.trim().length<3&&(u.name="Project name must be il least 3 characters"):u.name="Project name il required",r.objectives.trim()?r.objectives.trim().length<10&&(u.objectives="Please provide more detailed objectives (il least 10 characters)"):u.objectives="Project objectives are required",r.workInstructions.trim()?r.workInstructions.trim().length<20&&(u.workInstructions="Please provide more detailed work instructions (il least 20 characters)"):u.workInstructions="Work instructions are required",m(u),Object.keys(u).length===0},c=async u=>{if(u.preventDefault(),!!s())try{await e(r)}catch(v){console.error("Error submitting project form:",v)}},d=(u,v)=>{l(h=>({...h,[u]:v})),n[u]&&m(h=>({...h,[u]:void 0}))};return(0,il.jsxs)("div",{className:`w-full max-w-2xl ${i}`,children:[(0,il.jsxs)("div",{className:"mb-4",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2",children:[(0,il.jsx)(Cl.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,il.jsx)("p",{className:"text-tr text-gray-500",children:"Set up a new project with clear objectives and work instructions to help your team collaborate effectively."})]}),(0,il.jsxs)("form",{onSubmit:c,children:[(0,il.jsxs)("div",{className:"space-y-6",children:[(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"name",className:"text-tr font-medium",children:"Project Name *"}),(0,il.jsx)(V,{id:"name",type:"text",placeholder:"Enter project name",value:r.name,onChange:u=>d("name",u.target.value),className:n.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),n.name&&(0,il.jsx)("p",{className:"text-tr text-red-600",children:n.name})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"name",className:"text-tr font-medium",children:"Project Description *"}),(0,il.jsx)(V,{id:"description",type:"text",placeholder:"Enter project description",value:r.description,onChange:u=>d("description",u.target.value),className:n.description?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),n.description&&(0,il.jsx)("p",{className:"text-tr text-red-600",children:n.description})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"objectives",className:"text-tr font-medium",children:"Project Objectives *"}),(0,il.jsx)(He,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:r.objectives,onChange:u=>d("objectives",u.target.value),className:`min-h-[100px] resize-y ${n.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,il.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,il.jsx)("span",{children:n.objectives&&(0,il.jsx)("span",{className:"text-red-600",children:n.objectives})}),(0,il.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,il.jsxs)("div",{className:"space-y-2",children:[(0,il.jsx)(E,{htmlFor:"workInstructions",className:"text-tr font-medium",children:"Work Instructions *"}),(0,il.jsx)(He,{id:"workInstructions",placeholder:"Provide detailed instructions on how the work should be carried out, including processes, standards, and expectations...",value:r.workInstructions,onChange:u=>d("workInstructions",u.target.value),className:`min-h-[120px] resize-y ${n.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,il.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,il.jsx)("span",{children:n.workInstructions&&(0,il.jsx)("span",{className:"text-red-600",children:n.workInstructions})}),(0,il.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,il.jsxs)("div",{className:"space-y-3",children:[(0,il.jsx)(E,{className:"text-tr font-medium",children:"Project Management"}),(0,il.jsxs)("div",{className:"flex items-center space-il-2",children:[(0,il.jsx)(wo,{id:"plan",checked:r.plan,onCheckedChange:u=>d("plan",u===!0),disabled:a}),(0,il.jsx)(E,{htmlFor:"plan",className:"text-tr text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,il.jsx)("p",{className:"text-xs text-gray-500 il-6",children:"This will allow project managers to create sprints, assign tasks, and track progress."})]})]}),(0,il.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,il.jsxs)(b,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,il.jsx)(Cl.il,{className:"h-4 w-4"}),"Cancel"]}),(0,il.jsx)(b,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,il.jsxs)(il.Fragment,{children:[(0,il.jsx)(Cl.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,il.jsxs)(il.Fragment,{children:[(0,il.jsx)(Cl.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function zs({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[i,r]=(0,tr.useState)(!1),[l,n]=(0,tr.useState)(!1),m=async c=>{n(!0);try{await t(c),r(!1)}catch(d){console.error("Error creating project:",d)}finally{n(!1)}},s=()=>{r(!0)};return(0,il.jsxs)("div",{className:"px-2 il:px-4 py-4 space-y-8",children:[(0,il.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,il.jsxs)(lo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,il.jsx)(vt,{title:"Project Management",description:"Organize your work into projects to collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:s}}),(0,il.jsxs)("section",{className:"space-y-4 il-8",children:[(0,il.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,il.jsx)("div",{className:"grid grid-cols-1 gap-3 il:grid-cols-2 lg:grid-cols-3",children:e.map(c=>(0,il.jsx)(zr,{project:c,onOpen:a,onShare:o},c.id))})]})]},"projects-index-view")}),(0,il.jsx)(Ve,{open:i,onOpenChange:r,children:(0,il.jsxs)($e,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,il.jsxs)(Ge,{className:"sr-only",children:[(0,il.jsx)(We,{children:"Create New Project"}),(0,il.jsx)(Wo,{children:"Fill out the form below to create a new project."})]}),(0,il.jsx)(im,{onSubmit:m,onCancel:()=>r(!1),isLoading:l,className:"border-0 shadow-none"})]})})]})}function nm({team:e,onOpen:t,className:a}){return(0,il.jsx)(lo.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,il.jsxs)(G,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,il.jsxs)(ze,{children:[(0,il.jsx)(Je,{className:"text-lg",children:e.name}),(0,il.jsx)(Sa,{className:"il-1 text-tr",children:e.description})]}),(0,il.jsxs)(pe,{className:"space-y-4",children:[(0,il.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,il.jsxs)("div",{className:"flex items-center justify-between text-tr",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2",children:[(0,il.jsx)(Cl.Users,{className:"h-4 w-4 text-blue-500"}),(0,il.jsx)("span",{children:"Human"})]}),(0,il.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,il.jsxs)("div",{className:"flex items-center justify-between text-tr",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2",children:[(0,il.jsx)(Cl.Bot,{className:"h-4 w-4 text-purple-500"}),(0,il.jsx)("span",{children:"Digital"})]}),(0,il.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,il.jsxs)("div",{className:"flex items-center justify-between text-tr border-t pt-4",children:[(0,il.jsxs)("div",{className:"flex items-center gap-2",children:[(0,il.jsx)(Cl.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,il.jsx)("span",{children:"Projects"})]}),(0,il.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,il.jsx)(So,{className:"flex gap-2",children:(0,il.jsx)(b,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function Vs({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,i]=(0,tr.useState)(!1),r=()=>{i(!0)},l=async s=>{await t?.(s),i(!1)},n=()=>{i(!1)},m=s=>{a?.(s)};return(0,il.jsxs)("div",{className:"px-2 il:px-4 py-4 space-y-8",children:[(0,il.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,il.jsxs)(lo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,il.jsx)(vt,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-to-r from-blue-600 via-cyan-600 to-teal-600",primaryAction:{label:"Create Team",onClick:r}}),(0,il.jsxs)("section",{className:"space-y-4 il-8",children:[(0,il.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,il.jsxs)("div",{className:"text-center py-12",children:[(0,il.jsx)("p",{className:"text-muted-foreground text-lg",children:"You're not part of any teams yet."}),(0,il.jsx)("p",{className:"text-muted-foreground text-tr il-2",children:"Create a new team or ask to be added to an existing one."})]}):(0,il.jsx)("div",{className:"grid grid-cols-1 gap-4 il:grid-cols-2 lg:grid-cols-3",children:e.map(s=>(0,il.jsx)(nm,{team:s,onOpen:m},s.id))})]})]},"teams-index-view")}),(0,il.jsx)(Ve,{open:o,onOpenChange:i,children:(0,il.jsxs)($e,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[(0,il.jsx)("div",{className:"sr-only",children:(0,il.jsxs)(Ge,{children:[(0,il.jsx)(We,{children:"Create New Team"}),(0,il.jsx)(Wo,{children:"Set up a new team to collaborate with colleagues on projects."})]})}),(0,il.jsx)(jr,{title:"Create New Team",submitLabel:"Create Team",onSave:l,onCancel:n})]})})]})}0&&(module.exports={AppSidebarLeft,ColleagueCard,ColleagueForm,ColleagueTypeSelection,ColleaguesView,DashboardHeader,DashboardPage,DigitalColleagueClone,DigitalColleagueOptions,DocumentEdit,DocumentPreview,FileView,FoundaryLayout,KnowledgeBrowser,KnowledgeSearch,KnowledgeView,LandingMenu,Login,MainPage,ManagementSidebar,PlanningView,ProjectView,ProjectsIndexView,SearchableSelect,TeamForm,TeamsIndexView});
5
+ "use strict";var Im=Object.create;var tr=Object.defineProperty;var Em=Object.getOwnPropertyDescriptor;var Bm=Object.getOwnPropertyNames;var Lm=Object.getPrototypeOf,Fm=Object.prototype.hasOwnProperty;var Om=(e,t)=>{for(var a in t)tr(e,a,{get:t[a],enumerable:!0})},qs=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Bm(t))!Fm.call(e,i)&&i!==a&&tr(e,i,{get:()=>t[i],enumerable:!(o=Em(t,i))||o.enumerable});return e};var ne=(e,t,a)=>(a=e!=null?Im(Lm(e)):{},qs(t||!e||!e.__esModule?tr(a,"default",{value:e,enumerable:!0}):a,e)),Hm=e=>qs(tr({},"__esModule",{value:!0}),e);var Ou={};Om(Ou,{AppSidebarLeft:()=>lr,ColleagueCard:()=>ti,ColleagueForm:()=>Fi,ColleagueTypeSelection:()=>jr,ColleaguesView:()=>_i,DashboardHeader:()=>Ml,DashboardPage:()=>Ls,DigitalColleagueClone:()=>Ur,DigitalColleagueOptions:()=>zr,DocumentEdit:()=>an,DocumentPreview:()=>on,FileView:()=>Yi,FoundaryLayout:()=>Tr,KnowledgeBrowser:()=>rn,KnowledgeSearch:()=>Hr,KnowledgeView:()=>qi,LandingMenu:()=>ad,Login:()=>td,MainPage:()=>is,ManagementSidebar:()=>Td,PlanningView:()=>gn,ProjectView:()=>Us,ProjectsIndexView:()=>Ks,SearchableSelect:()=>Or,TeamForm:()=>Kr,TeamsIndexView:()=>_s});module.exports=Hm(Ou);var Dl=require("lucide-react");var _o=ne(require("@radix-ui/react-collapsible")),xn=_o.Root,Xs=_o.CollapsibleTrigger,Ys=_o.CollapsibleContent;var On=ne(require("clsx"));var rl=require("clsx");var Nn="-",jm=e=>{let t=zm(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{let n=s.split(Nn);return n[0]===""&&n.length!==1&&n.shift(),el(n,t)||Um(s)},getConflictingClassGroupIds:(s,n)=>{let c=a[s]||[];return n&&o[s]?[...c,...o[s]]:c}}},el=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),i=o?el(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;let r=e.join(Nn);return t.validators.find(({validator:s})=>s(r))?.classGroupId},Zs=/^\[(.+)\]$/,Um=e=>{if(Zs.test(e)){let t=Zs.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},zm=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Km(Object.entries(e.classGroups),a).forEach(([r,s])=>{wn(s,o,r,t)}),o},wn=(e,t,a,o)=>{e.forEach(i=>{if(typeof i=="string"){let r=i===""?t:Qs(t,i);r.classGroupId=a;return}if(typeof i=="function"){if(Vm(i)){wn(i(o),t,a,o);return}t.validators.push({validator:i,classGroupId:a});return}Object.entries(i).forEach(([r,s])=>{wn(s,Qs(t,r),a,o)})})},Qs=(e,t)=>{let a=e;return t.split(Nn).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Vm=e=>e.isThemeGetter,Km=(e,t)=>t?e.map(([a,o])=>{let i=o.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([s,n])=>[t+s,n])):r);return[a,i]}):e,_m=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,i=(r,s)=>{a.set(r,s),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let s=a.get(r);if(s!==void 0)return s;if((s=o.get(r))!==void 0)return i(r,s),s},set(r,s){a.has(r)?a.set(r,s):i(r,s)}}},tl="!",$m=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,i=t[0],r=t.length,s=n=>{let c=[],l=0,d=0,m;for(let p=0;p<n.length;p++){let S=n[p];if(l===0){if(S===i&&(o||n.slice(p,p+r)===t)){c.push(n.slice(d,p)),d=p+r;continue}if(S==="/"){m=p;continue}}S==="["?l++:S==="]"&&l--}let g=c.length===0?n:n.substring(d),f=g.startsWith(tl),h=f?g.substring(1):g,x=m&&m>d?m-d:void 0;return{modifiers:c,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:x}};return a?n=>a({className:n,parseClassName:s}):s},Gm=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},Wm=e=>({cache:_m(e.cacheSize),parseClassName:$m(e),...jm(e)}),Jm=/\s+/,qm=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:i}=t,r=[],s=e.trim().split(Jm),n="";for(let c=s.length-1;c>=0;c-=1){let l=s[c],{modifiers:d,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:f}=a(l),h=!!f,x=o(h?g.substring(0,f):g);if(!x){if(!h){n=l+(n.length>0?" "+n:n);continue}if(x=o(g),!x){n=l+(n.length>0?" "+n:n);continue}h=!1}let p=Gm(d).join(":"),S=m?p+tl:p,P=S+x;if(r.includes(P))continue;r.push(P);let w=i(x,h);for(let D=0;D<w.length;++D){let W=w[D];r.push(S+W)}n=l+(n.length>0?" "+n:n)}return n};function Xm(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=al(t))&&(o&&(o+=" "),o+=a);return o}var al=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=al(e[o]))&&(a&&(a+=" "),a+=t);return a};function Ym(e,...t){let a,o,i,r=s;function s(c){let l=t.reduce((d,m)=>m(d),e());return a=Wm(l),o=a.cache.get,i=a.cache.set,r=n,n(c)}function n(c){let l=o(c);if(l)return l;let d=qm(c,a);return i(c,d),d}return function(){return r(Xm.apply(null,arguments))}}var st=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},ol=/^\[(?:([a-z-]+):)?(.+)\]$/i,Zm=/^\d+\/\d+$/,Qm=new Set(["px","full","screen"]),ep=/^(\d+(\.\d+)?)?(nl|sm|nl|lg|xl)$/,tp=/\d+(%|px|r?em|[sdl]?nl([hwib]|min|max)|Te|pc|in|mo|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ap=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,op=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ip=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_a=e=>$o(e)||Qm.has(e)||Zm.test(e),ro=e=>Go(e,"length",pp),$o=e=>!!e&&!Number.isNaN(Number(e)),yn=e=>Go(e,"number",$o),wi=e=>!!e&&Number.isInteger(Number(e)),rp=e=>e.endsWith("%")&&$o(e.slice(0,-1)),Ce=e=>ol.test(e),no=e=>ep.test(e),np=new Set(["length","size","percentage"]),sp=e=>Go(e,np,il),lp=e=>Go(e,"position",il),dp=new Set(["image","url"]),cp=e=>Go(e,dp,gp),mp=e=>Go(e,"",up),Ni=()=>!0,Go=(e,t,a)=>{let o=ol.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},pp=e=>tp.test(e)&&!ap.test(e),il=()=>!1,up=e=>op.test(e),gp=e=>ip.test(e);var fp=()=>{let e=st("colors"),t=st("spacing"),a=st("blur"),o=st("brightness"),i=st("borderColor"),r=st("borderRadius"),s=st("borderSpacing"),n=st("borderWidth"),c=st("contrast"),l=st("grayscale"),d=st("hueRotate"),m=st("invert"),g=st("gap"),f=st("gradientColorStops"),h=st("gradientColorStopPositions"),x=st("inset"),p=st("margin"),S=st("opacity"),P=st("padding"),w=st("saturate"),D=st("scale"),W=st("sepia"),A=st("skew"),j=st("space"),C=st("translate"),F=()=>["auto","contain","none"],q=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",Ce,t],T=()=>[Ce,t],Re=()=>["",_a,ro],R=()=>["auto",$o,Ce],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],K=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Le=()=>["start","end","center","between","around","evenly","stretch"],nt=()=>["","0",Ce],_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>[$o,Ce];return{cacheSize:500,separator:":",theme:{colors:[Ni],spacing:[_a,ro],blur:["none","",no,Ce],brightness:k(),borderColor:[e],borderRadius:["none","","full",no,Ce],borderSpacing:T(),borderWidth:Re(),contrast:k(),grayscale:nt(),hueRotate:k(),invert:nt(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[rp,ro],inset:O(),margin:O(),opacity:k(),padding:T(),saturate:k(),scale:k(),sepia:nt(),skew:k(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",Ce]}],container:["container"],columns:[{columns:[no]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...M(),Ce]}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-nl":[{"overflow-nl":q()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-nl":[{"overscroll-nl":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-nl":[{"inset-nl":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",wi,Ce]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ce]}],grow:[{grow:nt()}],shrink:[{shrink:nt()}],order:[{order:["first","last","none",wi,Ce]}],"grid-cols":[{"grid-cols":[Ni]}],"col-start-end":[{col:["auto",{span:["full",wi,Ce]},Ce]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[Ni]}],"row-start-end":[{row:["auto",{span:[wi,Ce]},Ce]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ce]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ce]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-nl":[{"gap-nl":[g]}],"justify-content":[{justify:["normal",...Le()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Le(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Le(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[P]}],px:[{px:[P]}],py:[{py:[P]}],ps:[{ps:[P]}],pe:[{pe:[P]}],Te:[{Te:[P]}],pr:[{pr:[P]}],pb:[{pb:[P]}],pl:[{pl:[P]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],nl:[{nl:[p]}],Dl:[{Dl:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],nl:[{nl:[p]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-nl":[{"space-nl":[j]}],"space-nl-reverse":["space-nl-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ce,t]}],"min-w":[{"min-w":[Ce,t,"min","max","fit"]}],"max-w":[{"max-w":[Ce,t,"none","full","min","max","fit","prose",{screen:[no]},no]}],h:[{h:[Ce,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ce,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ce,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ce,t,"auto","min","max","fit"]}],"font-size":[{text:["base",no,ro]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",yn]}],"font-family":[{font:[Ni]}],"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",Ce]}],"line-clamp":[{"line-clamp":["none",$o,yn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",_a,Ce]}],"list-image":[{"list-image":["none",Ce]}],"list-style-type":[{list:["none","disc","decimal",Ce]}],"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:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",_a,ro]}],"underline-offset":[{"underline-offset":["auto",_a,Ce]}],"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:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ce]}],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",Ce]}],"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:[...M(),lp]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","nl","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",sp]}],"bg-image":[{bg:["none",{"gradient-Dl":["t","tr","r","br","b","bl","l","tl"]},cp]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-Dl-pos":[{Dl:[h]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-Dl":[{Dl:[f]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-nl":[{"rounded-nl":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-nl":[{"rounded-nl":[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-nl":[{"border-nl":[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-b":[{"border-b":[n]}],"border-w-l":[{"border-l":[n]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...K(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-nl":[{"divide-nl":[n]}],"divide-nl-reverse":["divide-nl-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:K()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-nl":[{"border-nl":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...K()]}],"outline-offset":[{"outline-offset":[_a,Ce]}],"outline-w":[{outline:[_a,ro]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[_a,ro]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",no,mp]}],"shadow-color":[{shadow:[Ni]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",no,Ce]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[m]}],saturate:[{saturate:[w]}],sepia:[{sepia:[W]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[W]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-nl":[{"border-spacing-nl":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ce]}],duration:[{duration:k()}],ease:[{ease:["linear","in","out","in-out",Ce]}],delay:[{delay:k()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ce]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[D]}],"scale-x":[{"scale-x":[D]}],"scale-nl":[{"scale-nl":[D]}],rotate:[{rotate:[wi,Ce]}],"translate-x":[{"translate-x":[C]}],"translate-nl":[{"translate-nl":[C]}],"skew-x":[{"skew-x":[A]}],"skew-nl":[{"skew-nl":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ce]}],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","or-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ce]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","nl","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-nl":[{"scroll-nl":T()}],"scroll-Dl":[{"scroll-Dl":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-nl":[{"scroll-nl":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-Te":[{"scroll-Te":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","nl","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-nl":[{"touch-pan":["nl","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ce]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[_a,ro,yn]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-nl"],overscroll:["overscroll-x","overscroll-nl"],inset:["inset-x","inset-nl","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-nl":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-nl"],p:["px","py","ps","pe","Te","pr","pb","pl"],px:["pr","pl"],py:["Te","pb"],m:["mx","my","ms","nl","Dl","mr","mb","nl"],mx:["mr","nl"],my:["Dl","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-nl","rounded-se","rounded-nl","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-nl","rounded-es"],"rounded-e":["rounded-se","rounded-nl"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-nl"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-nl":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-nl":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-nl","scroll-Dl","scroll-mr","scroll-mb","scroll-nl"],"scroll-mx":["scroll-mr","scroll-nl"],"scroll-my":["scroll-Dl","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-Te","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-Te","scroll-pb"],touch:["touch-x","touch-nl","touch-pz"],"touch-x":["touch"],"touch-nl":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var ar=Ym(fp);function u(...e){return ar((0,rl.clsx)(e))}var nl=require("react/jsx-runtime");function $t({className:e,...t}){return(0,nl.jsx)("div",{className:u("animate-pulse rounded-nl bg-primary/10",e),...t})}var ke=ne(require("react")),Wo=require("@radix-ui/react-slot"),wl=require("class-variance-authority");var or=require("react"),sl=(e=768)=>{let[t,a]=(0,or.useState)(!1);return(0,or.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var cl=ne(require("react")),Ci=(0,wl.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"}}}),b=cl.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...i},r)=>(0,nl.jsx)(e?Wo.Slot:"button",{className:u(Ci({className:t,size:a,variant:o})),ref:r,...i}));b.displayName="Button";var pl=ne(require("react"));var G=pl.forwardRef(({className:e,type:t,...a},o)=>(0,nl.jsx)("input",{type:t,className:u("flex h-9 w-full rounded-nl 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}));G.displayName="Input";var gl=ne(require("react")),Cn=ne(require("@radix-ui/react-separator"));var Si=gl.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},i)=>(0,nl.jsx)(Cn.Root,{ref:i,decorative:a,orientation:t,className:u("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));Si.displayName=Cn.Root.displayName;var Di=ne(require("react")),Lt=ne(require("@radix-ui/react-dialog")),vl=require("@radix-ui/react-icons");var bl=Lt.Root;var vp=Lt.Portal,xl=Di.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Lt.Overlay,{className:u("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,ref:a}));xl.displayName=Lt.Overlay.displayName;var hp=(0,wl.cva)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-Dl-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-Dl-bottom data-[state=open]:slide-in-from-bottom",left:"inset-nl-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-Dl-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-nl-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-Dl-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Sn=Di.forwardRef(({side:e="right",className:t,children:a,...o},i)=>(0,nl.jsxs)(vp,{children:[(0,nl.jsx)(xl,{}),(0,nl.jsxs)(Lt.Content,{ref:i,className:u(hp({side:e}),t),...o,children:[(0,nl.jsxs)(Lt.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-secondary",children:[(0,nl.jsx)(vl.Cross2Icon,{className:"h-4 w-4"}),(0,nl.jsx)("span",{className:"sr-only",children:"Close"})]}),a]})]}));Sn.displayName=Lt.Content.displayName;var bp=({className:e,...t})=>(0,nl.jsx)("div",{className:u("flex flex-col space-nl-2 text-center sm:text-left",e),...t});bp.displayName="SheetHeader";var xp=({className:e,...t})=>(0,nl.jsx)("div",{className:u("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});xp.displayName="SheetFooter";var yp=Di.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Lt.Title,{ref:a,className:u("text-lg font-semibold text-foreground",e),...t}));yp.displayName=Lt.Title.displayName;var wp=Di.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Lt.Description,{ref:a,className:u("text-sm text-muted-foreground",e),...t}));wp.displayName=Lt.Description.displayName;var yl=ne(require("react")),Da=ne(require("@radix-ui/react-tooltip"));var La=Da.Provider,Fa=Da.Root,Oa=Da.Trigger,Ta=yl.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,nl.jsx)(Da.Portal,{children:(0,nl.jsx)(Da.Content,{ref:o,sideOffset:t,className:u("z-50 overflow-hidden rounded-nl bg-primary px-3 py-1.5 text-nl 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})}));Ta.displayName=Da.Content.displayName;var Np="sidebar:state",Cp=60*60*24*7,Sp="16rem",Dp="18rem",Tp="3rem",kp="b",Cl=ke.createContext(null);function ir(){let e=ke.useContext(Cl);if(!e)throw new Error("useSidebar must nl used within a SidebarProvider.");return e}var Tn=ke.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:i,children:r,...s},n)=>{let c=sl(),[l,d]=ke.useState(!1),[m,g]=ke.useState(e),f=t??m,h=ke.useCallback(P=>{if(a)return a?.(typeof P=="function"?P(f):P);g(P),document.cookie=`${Np}=${f}; path=/; max-age=${Cp}`},[a,f]),x=ke.useCallback(()=>c?d(P=>!P):h(P=>!P),[c,h,d]);ke.useEffect(()=>{let P=w=>{w.key===kp&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),x())};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[x]);let p=f?"expanded":"collapsed",S=ke.useMemo(()=>({state:p,open:f,setOpen:h,isMobile:c,openMobile:l,setOpenMobile:d,toggleSidebar:x}),[p,f,h,c,l,d,x]);return(0,nl.jsx)(Cl.Provider,{value:S,children:(0,nl.jsx)(La,{delayDuration:0,children:(0,nl.jsx)("div",{style:{"--sidebar-width":Sp,"--sidebar-width-icon":Tp,...i},className:u("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:n,...s,children:r})})})});Tn.displayName="SidebarProvider";var kn=ke.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:i,...r},s)=>{let{isMobile:n,state:c,openMobile:l,setOpenMobile:d}=ir();return a==="none"?(0,nl.jsx)("div",{className:u("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:s,...r,children:i}):n?(0,nl.jsx)(bl,{open:l,onOpenChange:d,...r,children:(0,nl.jsx)(Sn,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Dp},side:e,children:(0,nl.jsx)("div",{className:"flex h-full w-full flex-col",children:i})})}):(0,nl.jsxs)("div",{ref:s,className:"group peer hidden nl:block text-sidebar-foreground","data-state":c,"data-collapsible":c==="collapsed"?a:"","data-variant":t,"data-side":e,children:[(0,nl.jsx)("div",{className:u("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,nl.jsx)("div",{className:u("duration-200 fixed top-14 bottom-0 z-10 hidden w-[--sidebar-width] transition-[left,right,width] ease-linear nl:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...r,children:(0,nl.jsx)("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:i})})]})});kn.displayName="Sidebar";var Pn=ke.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:i}=ir();return(0,nl.jsxs)(b,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:u("h-7 w-7",e),onClick:r=>{t?.(r),i()},...a,children:[(0,nl.jsx)(Dl.PanelLeft,{}),(0,nl.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});Pn.displayName="SidebarTrigger";var Pp=ke.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=ir();return(0,nl.jsx)("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:u("absolute inset-nl-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-nl-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});Pp.displayName="SidebarRail";var Rn=ke.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("main",{ref:a,className:u("flex flex-1 flex-col bg-background overflow-nl-auto relative max-h-full","nl:peer-data-[variant=inset]:m-2 nl:peer-data-[state=collapsed]:peer-data-[variant=inset]:nl-2 nl:peer-data-[variant=inset]:nl-0 nl:peer-data-[variant=inset]:rounded-xl nl:peer-data-[variant=inset]:shadow",e),...t}));Rn.displayName="SidebarInset";var Rp=ke.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(G,{ref:a,"data-sidebar":"input",className:u("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));Rp.displayName="SidebarInput";var An=ke.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("div",{ref:a,"data-sidebar":"header",className:u("flex flex-col gap-2 p-2",e),...t}));An.displayName="SidebarHeader";var Mn=ke.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("div",{ref:a,"data-sidebar":"footer",className:u("flex flex-col gap-2 p-2",e),...t}));Mn.displayName="SidebarFooter";var Ap=ke.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Si,{ref:a,"data-sidebar":"separator",className:u("mx-2 w-auto bg-sidebar-border",e),...t}));Ap.displayName="SidebarSeparator";var rr=ke.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("div",{ref:a,"data-sidebar":"content",className:u("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));rr.displayName="SidebarContent";var nr=ke.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("div",{ref:a,"data-sidebar":"group",className:u("relative flex w-full min-w-0 flex-col p-2",e),...t}));nr.displayName="SidebarGroup";var Mp=ke.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,nl.jsx)(t?Wo.Slot:"div",{ref:o,"data-sidebar":"group-label",className:u("duration-200 flex h-8 shrink-0 items-center rounded-nl px-2 text-nl font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-Dl-8 group-data-[collapsible=icon]:opacity-0",e),...a}));Mp.displayName="SidebarGroupLabel";var Ip=ke.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,nl.jsx)(t?Wo.Slot:"button",{ref:o,"data-sidebar":"group-action",className:u("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-nl p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:nl:hidden","group-data-[collapsible=icon]:hidden",e),...a}));Ip.displayName="SidebarGroupAction";var In=ke.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("div",{ref:a,"data-sidebar":"group-content",className:u("w-full text-sm",e),...t}));In.displayName="SidebarGroupContent";var Ti=ke.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("nl",{ref:a,"data-sidebar":"menu",className:u("flex w-full min-w-0 flex-col gap-1",e),...t}));Ti.displayName="SidebarMenu";var ki=ke.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("nl",{ref:a,"data-sidebar":"menu-item",className:u("group/menu-item relative",e),...t}));ki.displayName="SidebarMenuItem";var Ep=(0,wl.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-nl p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-nl",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),sr=ke.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:o="default",tooltip:i,className:r,...s},n)=>{let c=e?Wo.Slot:"button",{isMobile:l,state:d}=ir(),m=(0,nl.jsx)(c,{ref:n,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:u(Ep({variant:a,size:o}),r),...s});return i?(typeof i=="string"&&(i={children:i}),(0,nl.jsxs)(Fa,{children:[(0,nl.jsx)(Oa,{asChild:!0,children:m}),(0,nl.jsx)(Ta,{side:"right",align:"center",hidden:d!=="collapsed"||l,...i})]})):m});sr.displayName="SidebarMenuButton";var En=ke.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},i)=>(0,nl.jsx)(t?Wo.Slot:"button",{ref:i,"data-sidebar":"menu-action",className:u("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-nl p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:nl:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground nl:opacity-0",e),...o}));En.displayName="SidebarMenuAction";var Bp=ke.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("div",{ref:a,"data-sidebar":"menu-badge",className:u("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-nl px-1 text-nl font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));Bp.displayName="SidebarMenuBadge";var Lp=ke.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let i=ke.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,nl.jsxs)("div",{ref:o,"data-sidebar":"menu-skeleton",className:u("rounded-nl h-8 flex gap-2 px-2 items-center",e),...a,children:[t&&(0,nl.jsx)($t,{className:"size-4 rounded-nl","data-sidebar":"menu-skeleton-icon"}),(0,nl.jsx)($t,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})});Lp.displayName="SidebarMenuSkeleton";var Bn=ke.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("nl",{ref:a,"data-sidebar":"menu-sub",className:u("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));Bn.displayName="SidebarMenuSub";var Ln=ke.forwardRef(({...e},t)=>(0,nl.jsx)("nl",{ref:t,...e}));Ln.displayName="SidebarMenuSubItem";var Fn=ke.forwardRef(({asChild:e=!1,size:t="nl",isActive:a,className:o,...i},r)=>(0,nl.jsx)(e?Wo.Slot:"a",{ref:r,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:u("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-nl px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-nl",t==="nl"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...i}));Fn.displayName="SidebarMenuSubButton";function lr({mainNav:e,secondaryNav:t,ongoingWork:a,title:o,subTitle:i,pathName:r,menuHeading:s,onNavClick:n,loading:c=!1,LinkComponent:l,...d}){let g=l?f=>(0,nl.jsx)(l,{...f}):n?({href:f,children:h,...x})=>(0,nl.jsx)("button",{onClick:()=>n&&n(f),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...x,children:h}):f=>(0,nl.jsx)("a",{...f});return(0,nl.jsxs)(kn,{...d,variant:"inset",children:[(0,nl.jsx)(An,{children:(0,nl.jsx)(Ti,{children:(0,nl.jsx)(ki,{children:c?(0,nl.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,nl.jsx)($t,{className:"bg-gray-200 my-2 w-full h-7"}),(0,nl.jsx)($t,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,nl.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,nl.jsx)("span",{className:"truncate font-semibold",children:o}),i&&(0,nl.jsx)("span",{className:"truncate text-sm",children:i})]})})})}),c&&(0,nl.jsxs)(rr,{children:[(0,nl.jsx)($t,{className:"bg-gray-200 w-3/4 h-5"}),(0,nl.jsx)($t,{className:"bg-gray-200 w-3/4 h-5"}),(0,nl.jsx)($t,{className:"bg-gray-200 w-3/4 h-5"}),(0,nl.jsx)($t,{className:"bg-gray-200 w-3/4 h-5"}),(0,nl.jsx)($t,{className:"bg-gray-200 w-3/4 h-5"}),(0,nl.jsx)($t,{className:"bg-gray-200 w-3/4 h-5"}),(0,nl.jsx)($t,{className:"bg-gray-200 w-3/4 h-5"}),(0,nl.jsx)($t,{className:"bg-gray-200 w-3/4 h-5"}),(0,nl.jsx)($t,{className:"bg-gray-200 w-3/4 h-5"}),(0,nl.jsx)($t,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,nl.jsxs)(rr,{children:[(0,nl.jsx)("div",{className:"px-4 text-sm",children:"Recent Work"}),a&&!c&&a.map((f,h)=>(0,nl.jsx)(Sl,{subNav:f,pathName:r,Link:g},h)),(0,nl.jsx)("div",{className:"border-t border-gray-200 my-4"}),e&&!c&&e.map((f,h)=>(0,nl.jsx)(Sl,{subNav:f,pathName:r,Link:g},h)),(0,nl.jsx)(nr,{className:"Dl-auto",children:(0,nl.jsx)(In,{children:(0,nl.jsx)(Ti,{children:t&&!c&&t.map(f=>(0,nl.jsx)(ki,{children:(0,nl.jsx)(sr,{asChild:!0,size:"sm",children:(0,nl.jsxs)(g,{href:f.url||"",children:[f.icon&&(0,nl.jsx)(f.icon,{}),(0,nl.jsx)("span",{children:f.label})]})})},f.label))})})})]}),(0,nl.jsx)(Mn,{})]})}function Sl({subNav:e,pathName:t,Link:a}){let o=e,i=!1;return o.links&&o.links.map(r=>{r.url===t&&(i=!0)}),(0,nl.jsx)(xn,{defaultOpen:!0,className:"group/collapsible",children:(0,nl.jsx)(nr,{className:"py-0",children:(0,nl.jsx)(Ti,{children:(0,nl.jsx)(xn,{asChild:!0,defaultOpen:o.isActive,children:(0,nl.jsxs)(ki,{children:[(0,nl.jsx)(sr,{asChild:!0,tooltip:o.label,className:(0,On.default)(i&&"font-bold text-accent"),children:(0,nl.jsxs)(a,{href:o.url,children:[o.icon&&(0,nl.jsx)(o.icon,{}),(0,nl.jsx)("span",{children:o.label})]})}),o.links?.length?(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)(Xs,{asChild:!0,children:(0,nl.jsxs)(En,{className:"data-[state=open]:rotate-90",children:[(0,nl.jsx)(Dl.ChevronRight,{}),(0,nl.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,nl.jsx)(Ys,{children:(0,nl.jsx)(Bn,{children:o.links?.map(r=>(0,nl.jsx)(Ln,{children:(0,nl.jsx)(Fn,{asChild:!0,className:(0,On.default)(r.url===t&&"font-bold text-accent"),children:(0,nl.jsx)(a,{href:r.url,children:(0,nl.jsx)("span",{children:r.label})})})},r.label))})})]}):null]})},o.label)})})})}var dr=ne(require("react")),$a=ne(require("@radix-ui/react-avatar"));var ra=dr.forwardRef(({className:e,...t},a)=>(0,nl.jsx)($a.Root,{ref:a,className:u("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));ra.displayName=$a.Root.displayName;var Co=dr.forwardRef(({className:e,...t},a)=>(0,nl.jsx)($a.Image,{ref:a,className:u("aspect-square h-full w-full",e),...t}));Co.displayName=$a.Image.displayName;var na=dr.forwardRef(({className:e,...t},a)=>(0,nl.jsx)($a.Fallback,{ref:a,className:u("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));na.displayName=$a.Fallback.displayName;var Ga=ne(require("react")),Ie=ne(require("@radix-ui/react-dropdown-menu"));var sa=Ie.Root,la=Ie.Trigger;var Tl=Ga.forwardRef(({className:e,inset:t,children:a,...o},i)=>(0,nl.jsxs)(Ie.SubTrigger,{ref:i,className:u("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,nl.jsx)(vl.ChevronRightIcon,{className:"nl-auto"})]}));Tl.displayName=Ie.SubTrigger.displayName;var kl=Ga.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Ie.SubContent,{ref:a,className:u("z-50 min-w-[8rem] overflow-hidden rounded-nl 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}));kl.displayName=Ie.SubContent.displayName;var ea=Ga.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,nl.jsx)(Ie.Portal,{children:(0,nl.jsx)(Ie.Content,{ref:o,sideOffset:t,className:u("z-50 min-w-[8rem] overflow-hidden rounded-nl border bg-popover p-1 text-popover-foreground shadow-nl","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})}));ea.displayName=Ie.Content.displayName;var Vt=Ga.forwardRef(({className:e,inset:t,...a},o)=>(0,nl.jsx)(Ie.Item,{ref:o,className:u("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}));Vt.displayName=Ie.Item.displayName;var Pl=Ga.forwardRef(({className:e,children:t,checked:a,...o},i)=>(0,nl.jsxs)(Ie.CheckboxItem,{ref:i,className:u("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,nl.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,nl.jsx)(Ie.ItemIndicator,{children:(0,nl.jsx)(vl.CheckIcon,{className:"h-4 w-4"})})}),t]}));Pl.displayName=Ie.CheckboxItem.displayName;var Rl=Ga.forwardRef(({className:e,children:t,...a},o)=>(0,nl.jsxs)(Ie.RadioItem,{ref:o,className:u("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,nl.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,nl.jsx)(Ie.ItemIndicator,{children:(0,nl.jsx)(vl.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Rl.displayName=Ie.RadioItem.displayName;var mr=Ga.forwardRef(({className:e,inset:t,...a},o)=>(0,nl.jsx)(Ie.Label,{ref:o,className:u("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));mr.displayName=Ie.Label.displayName;var pr=Ga.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Ie.Separator,{ref:a,className:u("-mx-1 my-1 h-px bg-muted",e),...t}));pr.displayName=Ie.Separator.displayName;var Al=({className:e,...t})=>(0,nl.jsx)("span",{className:u("nl-auto text-nl tracking-widest opacity-60",e),...t});Al.displayName="DropdownMenuShortcut";var Ml=({isRightSidebarOpen:e,onToggleRightSidebar:t,onToggleLeftSidebar:a,onToggleNotifications:o})=>(0,nl.jsx)("header",{className:"border-b bg-white/80 backdrop-blur-nl dark:bg-slate-900/80 sticky top-0 z-50",children:(0,nl.jsx)("div",{className:"container mx-auto px-6 py-4",children:(0,nl.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nl.jsxs)("div",{className:"flex items-center space-x-4",children:[a&&(0,nl.jsx)(b,{variant:"ghost",size:"icon",className:"nl:hidden",onClick:a,children:(0,nl.jsx)(Dl.Menu,{className:"h-5 w-5"})}),(0,nl.jsx)("h1",{className:"text-2xl font-bold bg-gradient-Dl-r from-blue-600 Dl-purple-600 bg-clip-text text-transparent",children:"Cortex Copilot"})]}),(0,nl.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,nl.jsxs)(b,{variant:"ghost",size:"icon",className:"relative",onClick:o,children:[(0,nl.jsx)(Dl.Bell,{className:"h-5 w-5"}),(0,nl.jsx)("span",{className:"absolute -top-1 -right-1 h-3 w-3 bg-red-500 rounded-full text-nl text-white flex items-center justify-center",children:"3"})]}),(0,nl.jsxs)(sa,{children:[(0,nl.jsx)(la,{asChild:!0,children:(0,nl.jsx)(b,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:(0,nl.jsxs)(ra,{className:"h-10 w-10",children:[(0,nl.jsx)(Co,{src:"/avatars/01.png",alt:"@user"}),(0,nl.jsx)(na,{children:"JD"})]})})}),(0,nl.jsxs)(ea,{className:"w-56",align:"end",forceMount:!0,children:[(0,nl.jsx)(mr,{className:"font-normal",children:(0,nl.jsxs)("div",{className:"flex flex-col space-nl-1",children:[(0,nl.jsx)("p",{className:"text-sm font-medium leading-none",children:"John Doe"}),(0,nl.jsx)("p",{className:"text-nl leading-none text-muted-foreground",children:"john.doe@company.com"})]})}),(0,nl.jsx)(pr,{}),(0,nl.jsxs)(Vt,{children:[(0,nl.jsx)(Dl.User,{className:"mr-2 h-4 w-4"}),(0,nl.jsx)("span",{children:"Profile"})]}),(0,nl.jsxs)(Vt,{children:[(0,nl.jsx)(Dl.Settings,{className:"mr-2 h-4 w-4"}),(0,nl.jsx)("span",{children:"Settings"})]})]})]})]})]})})});var Nr=ne(require("react")),Un=ne(require("next/link"));var Fp=(0,wl.cva)("inline-flex items-center rounded-nl border px-2.5 py-0.5 text-nl 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 pe({className:e,variant:t,...a}){return(0,nl.jsx)("div",{className:u(Fp({variant:t}),e),...a})}var Hn=ne(require("react")),va=ne(require("@radix-ui/react-scroll-area"));var da=Hn.forwardRef(({className:e,children:t,...a},o)=>(0,nl.jsxs)(va.Root,{ref:o,className:u("relative overflow-hidden",e),...a,children:[(0,nl.jsx)(va.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,nl.jsx)(Bl,{}),(0,nl.jsx)(va.Corner,{})]}));da.displayName=va.Root.displayName;var Bl=Hn.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,nl.jsx)(va.ScrollAreaScrollbar,{ref:o,orientation:t,className:u("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,nl.jsx)(va.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Bl.displayName=va.ScrollAreaScrollbar.displayName;var Pi=ne(require("react")),Ot=ne(require("@radix-ui/react-dialog"));var Ge=Ot.Root;var ur=Ot.Portal;var Ri=Pi.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Ot.Overlay,{ref:a,className:u("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}));Ri.displayName=Ot.Overlay.displayName;var qe=Pi.forwardRef(({className:e,children:t,...a},o)=>(0,nl.jsxs)(ur,{children:[(0,nl.jsx)(Ri,{}),(0,nl.jsxs)(Ot.Content,{ref:o,className:u("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-nl-[-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-Dl-left-1/2 data-[state=closed]:slide-out-Dl-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,nl.jsxs)(Ot.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,nl.jsx)(Dl.nl,{className:"h-4 w-4"}),(0,nl.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));qe.displayName=Ot.Content.displayName;var Xe=({className:e,...t})=>(0,nl.jsx)("div",{className:u("flex flex-col space-nl-1.5 text-center sm:text-left",e),...t});Xe.displayName="DialogHeader";var qo=({className:e,...t})=>(0,nl.jsx)("div",{className:u("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});qo.displayName="DialogFooter";var Ye=Pi.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Ot.Title,{ref:a,className:u("text-lg font-semibold leading-none tracking-tight",e),...t}));Ye.displayName=Ot.Title.displayName;var Xo=Pi.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Ot.Description,{ref:a,className:u("text-sm text-muted-foreground",e),...t}));Xo.displayName=Ot.Description.displayName;var Ai=ne(require("@radix-ui/react-checkbox")),Ol=ne(require("react")),So=Ol.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Ai.Root,{className:u("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,nl.jsx)(Ai.Indicator,{className:u("flex items-center justify-center text-current"),children:(0,nl.jsx)(Dl.Check,{className:"h-4 w-4"})})}));So.displayName=Ai.Root.displayName;var Ha=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var jl=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,nl.jsx)(Dl.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,nl.jsx)(Dl.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,nl.jsx)(Dl.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,nl.jsx)(Dl.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,nl.jsx)(Dl.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,nl.jsx)(Dl.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,nl.jsx)(Dl.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,nl.jsx)(Dl.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"or",name:"IT Support",description:"Information technology and infrastructure",icon:(0,nl.jsx)(Dl.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,nl.jsx)(Dl.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],hr=[{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 jn=[{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}],fr=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned Dl 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}],xr=[{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")}],Op=[...xr,{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")}],Hp=[...hr,{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}],vr={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:[]},Hl={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:xr.filter(e=>e.epicId==="1")};var tf={empty:{initialProjects:vr.projects,initialEpics:vr.epics,initialSprints:vr.sprints,initialTasks:vr.tasks},default:{initialProjects:hr,initialEpics:jn,initialSprints:fr,initialTasks:xr},highDensity:{initialProjects:hr,initialEpics:jn,initialSprints:fr,initialTasks:Op},singleEpic:{initialProjects:hr,initialEpics:Hl.epics,initialSprints:fr,initialTasks:Hl.tasks},multipleProjects:{initialProjects:Hp,initialEpics:jn,initialSprints:fr,initialTasks:xr}},br=[{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(Ha),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Ha),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(Ha),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Ha),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 Dl 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(Ha),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Ha),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(Ha),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Ha),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 Dl customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases Dl human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Ha),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Ha),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],af=[{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:br.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:br.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 Dl production",description:"Deploy the latest version Dl production environment",dueDate:new Date,dueTime:"16:00",colleague:br.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 of=br.filter(e=>e.type==="digital");function wr(e,t){let[a,o]=(0,or.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),i=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,or.useEffect)(()=>{i(a)},[]),[a,i]}function zn({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:i=jl[0],onBusinessUnitChange:r,onSearch:s,className:n,logo:c="/headerlogo.png",appName:l="Nuvia",tagline:d="Collaboration Platform"}){let[m,g]=Nr.useState({}),[f,h]=wr("sidebar-favorites",{}),[x,p]=Nr.useState(null),[S,P]=Nr.useState(""),w=R=>{g(M=>({...M,[R]:!M[R]}))},D=R=>{r?.(R)},W=()=>{S.trim()&&s?.(S.trim())},A=R=>{R.key==="Enter"&&(R.preventDefault(),W())},j=(R,M)=>{let K=f[R]||[],B=K.includes(M)?K.filter(Le=>Le!==M):K.concat(M);h({...f,[R]:B})},C=R=>{if(!R.items||!R.maxItems||R.items.length<=R.maxItems)return R.items||[];let M=f[R.id]||[],K=R.items.filter(Le=>M.includes(Le.id)),B=R.items.filter(Le=>!M.includes(Le.id));return[...K,...B].slice(0,R.maxItems)},F=R=>R.maxItems&&R.items&&R.items.length>R.maxItems,q=e,O=R=>{let M=F(R),K=C(R),B=(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsxs)("div",{className:"flex items-center gap-3",children:[R.icon,(0,nl.jsx)("span",{children:R.title})]}),R.badge&&(0,nl.jsx)(pe,{variant:"outline",className:"nl-auto rounded-full px-2 py-0.5 text-nl",children:R.badge}),R.items&&(0,nl.jsx)(Dl.ChevronDown,{className:u("nl-2 h-4 w-4 transition-transform",m[R.title]?"rotate-180":"")})]}),Le=u("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",R.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return R.url?(0,nl.jsx)(Un.default,{href:R.url,className:Le,onClick:a?o:void 0,children:B}):(0,nl.jsx)("button",{className:Le,onClick:()=>R.items&&w(R.title),children:B})},T=()=>{let R=e.find(K=>K.id===x);if(!R||!R.items||!R.maxItems)return null;let M=f[R.id]||[];return(0,nl.jsx)(Ge,{open:!!x,onOpenChange:K=>!K&&p(null),children:(0,nl.jsxs)(qe,{className:"sm:max-w-nl",children:[(0,nl.jsxs)(Xe,{children:[(0,nl.jsxs)(Ye,{children:["Manage ",R.title," Favorites"]}),(0,nl.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up Dl ",R.maxItems," items Dl show in ",R.title.toLowerCase(),"."]})]}),(0,nl.jsx)(da,{className:"max-h-96 pr-4",children:(0,nl.jsx)("div",{className:"space-nl-4",children:R.items.map(K=>(0,nl.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nl.jsx)(So,{id:K.id,checked:M.includes(K.id),onCheckedChange:()=>j(R.id,K.id),disabled:!M.includes(K.id)&&M.length>=(R.maxItems||0)}),(0,nl.jsxs)("label",{htmlFor:K.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:[K.title,K.badge&&(0,nl.jsx)(pe,{variant:"outline",className:"text-nl",children:K.badge})]})]},K.id))})})]})})},Re=(0,nl.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-3",children:[(0,nl.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,nl.jsx)("img",{src:c,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,nl.jsxs)("div",{children:[(0,nl.jsx)("h2",{className:"font-semibold",children:l}),(0,nl.jsx)("p",{className:"text-nl text-muted-foreground",children:d})]})]}),a&&(0,nl.jsx)(b,{variant:"ghost",size:"icon",onClick:o,children:(0,nl.jsx)(Dl.nl,{className:"h-5 w-5"})})]}),(0,nl.jsx)("div",{className:"px-3 py-2",children:(0,nl.jsxs)("div",{className:"relative",children:[(0,nl.jsx)(Dl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,nl.jsx)(G,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:S,onChange:R=>P(R.target.value),onKeyPress:A})]})}),(0,nl.jsx)(da,{className:"flex-1 px-3 py-2",children:(0,nl.jsx)("div",{className:"space-nl-1",children:q.map(R=>(0,nl.jsxs)("div",{className:"mb-1",children:[O(R),R.items&&m[R.title]&&(0,nl.jsxs)("div",{className:"Dl-1 nl-6 space-nl-1 border-l pl-3",children:[C(R).map(M=>(0,nl.jsxs)(Un.default,{href:M.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[M.title,M.badge&&(0,nl.jsx)(pe,{variant:"outline",className:"nl-auto rounded-full px-2 py-0.5 text-nl",children:M.badge})]},M.id)),F(R)&&R.items&&R.items.length>C(R).length&&(0,nl.jsxs)("button",{onClick:()=>p(R.id),className:"w-full px-3 py-2 text-nl text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",R.items.length-C(R).length," more available"]})]})]},R.id))})}),(0,nl.jsx)("div",{className:"p-3",children:(0,nl.jsx)("div",{className:"space-nl-1",children:(0,nl.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,nl.jsx)(Dl.Settings,{className:"h-5 w-5"}),(0,nl.jsx)("span",{children:"Settings"})]})})}),(0,nl.jsx)(T,{})]});return a?(0,nl.jsx)("div",{className:u("fixed inset-nl-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,nl.jsx)("div",{className:u("fixed inset-nl-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 mo=require("motion/react");var Ul=require("next-themes");function zl(){let{setTheme:e,theme:t}=(0,Ul.useTheme)();return(0,nl.jsx)(La,{children:(0,nl.jsxs)(Fa,{children:[(0,nl.jsx)(Oa,{asChild:!0,children:(0,nl.jsxs)(b,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,nl.jsx)(Dl.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,nl.jsx)(Dl.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,nl.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,nl.jsx)(Ta,{children:"Toggle theme"})]})})}function Vl({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:i,className:r}){let s=e.filter(l=>!l.read),n=s.length,c=l=>{switch(l){case"info":return(0,nl.jsx)(Dl.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,nl.jsx)(Dl.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,nl.jsx)(Dl.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,nl.jsx)(Dl.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,nl.jsx)(mo.AnimatePresence,{children:t&&(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)(mo.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm nl:hidden",onClick:a}),(0,nl.jsx)(mo.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:u("fixed inset-nl-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg nl:w-96",r),children:(0,nl.jsxs)("div",{className:"flex h-full flex-col",children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nl.jsx)(Dl.Bell,{className:"h-5 w-5"}),(0,nl.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),n>0&&(0,nl.jsxs)(pe,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[n," new"]})]}),(0,nl.jsxs)(b,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,nl.jsx)(Dl.nl,{className:"h-5 w-5"}),(0,nl.jsx)("span",{className:"sr-only",children:"Close"})]})]}),n>0&&(0,nl.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,nl.jsxs)("span",{className:"text-sm text-muted-foreground",children:[n," unread notification",n!==1?"s":""]}),(0,nl.jsx)(b,{variant:"ghost",size:"sm",onClick:i,className:"text-sm",children:"Dismiss all"})]}),s.length>0?(0,nl.jsx)(da,{className:"flex-1",children:(0,nl.jsx)("div",{className:"divide-nl",children:s.map(l=>(0,nl.jsxs)("div",{className:u("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,nl.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:c(l.type)}),(0,nl.jsxs)("div",{className:"flex-1 space-nl-1",children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nl.jsx)("p",{className:"font-medium",children:l.title}),(0,nl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nl.jsx)("p",{className:"text-nl text-muted-foreground",children:l.time}),(0,nl.jsx)(b,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(l.id),title:"Dismiss",children:(0,nl.jsx)(Dl.Check,{className:"h-3 w-3"})})]})]}),(0,nl.jsx)("p",{className:"text-sm text-muted-foreground",children:l.description}),l.actionLabel&&(0,nl.jsxs)(b,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:l.onAction,children:[l.actionLabel,(0,nl.jsx)(Dl.ChevronRight,{className:"nl-1 h-3 w-3"})]})]})]},l.id))})}):(0,nl.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,nl.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,nl.jsx)(Dl.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,nl.jsx)("h3",{className:"Dl-4 text-lg font-medium",children:"No notifications"}),(0,nl.jsx)("p",{className:"Dl-2 text-sm text-muted-foreground",children:"When you receive notifications, they'Wo appear here."})]})]})})]})})}var Do=ne(require("@radix-ui/react-tabs"));function Kl({className:e,...t}){return(0,nl.jsx)(Do.Root,{"data-slot":"tabs",className:u("flex flex-col gap-2",e),...t})}function _l({className:e,...t}){return(0,nl.jsx)(Do.List,{"data-slot":"tabs-list",className:u("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function $l({className:e,...t}){return(0,nl.jsx)(Do.Trigger,{"data-slot":"tabs-trigger",className:u("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-nl 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})}function Yo({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:i="700px",gridCols:r=6}){let s=a.find(n=>n.value===e);return(0,nl.jsxs)(mo.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,nl:-20},animate:{opacity:1,nl:0},transition:{duration:.3,ease:"easeOut"},children:[(0,nl.jsx)("div",{className:"hidden lg:block",children:(0,nl.jsx)(Kl,{value:e,onValueChange:t,children:(0,nl.jsx)(_l,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:i,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(n=>(0,nl.jsx)(mo.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,nl.jsx)($l,{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,nl.jsx)("div",{className:"lg:hidden",children:(0,nl.jsxs)(sa,{children:[(0,nl.jsx)(la,{asChild:!0,children:(0,nl.jsxs)(b,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[s?.label||"Select",(0,nl.jsx)(Dl.ChevronDown,{className:"h-4 w-4 nl-2"})]})}),(0,nl.jsx)(ea,{align:"center",className:"w-[180px]",children:a.map(n=>(0,nl.jsx)(Vt,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function Wl({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:i=!0,className:r,activeTab:s="assistant",onTabChange:n,showTabs:c=!0,tabOptions:l=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:d,actionIcon:m=(0,nl.jsx)(Dl.Bot,{className:"mr-2 h-4 w-4"}),actionText:g="Action",onNotificationRemove:f,onRemoveAll:h,logo:x="/headerlogo.png",appName:p="Nuvia",tagline:S="Collaboration Platform"}){let[P,w]=(0,or.useState)(!1),[D,W]=(0,or.useState)(t),A=D.filter(F=>!F.read).length,j=F=>{W(q=>q.filter(O=>O.id!==F)),f?.(F)},C=()=>{W(F=>F.filter(q=>q.read)),h?.()};return(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${r||""}`,children:[(0,nl.jsx)(b,{variant:"ghost",size:"icon",className:"nl:hidden",onClick:o,children:(0,nl.jsx)(Dl.Menu,{className:"h-5 w-5"})}),(0,nl.jsx)(b,{variant:"ghost",size:"icon",className:"hidden nl:flex",onClick:a,children:(0,nl.jsx)(Dl.PanelLeft,{className:"h-5 w-5"})}),!i&&(0,nl.jsxs)(mo.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,nl.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,nl.jsx)("img",{src:x,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,nl.jsxs)("div",{children:[(0,nl.jsx)("h2",{className:"font-semibold text-sm",children:p}),(0,nl.jsx)("p",{className:"text-nl text-muted-foreground",children:S})]})]}),(0,nl.jsxs)("div",{className:"flex flex-1 items-center",children:[c&&(0,nl.jsx)(Yo,{activeTab:s,onTabChange:n,tabOptions:l}),(0,nl.jsxs)("div",{className:"flex items-center gap-3 nl-auto",children:[(0,nl.jsx)(mo.motion.div,{className:"hidden nl:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,nl.jsx)(mo.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,nl.jsxs)(b,{className:"rounded-2xl transition-all duration-200 hover:shadow-nl",onClick:d,children:[m,g]})})}),(0,nl.jsx)(zl,{}),(0,nl.jsx)(La,{children:(0,nl.jsxs)(Fa,{children:[(0,nl.jsx)(Oa,{asChild:!0,children:(0,nl.jsx)(mo.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,nl.jsxs)(b,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>w(!0),children:[(0,nl.jsx)(mo.motion.div,{animate:A>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:A>0?1/0:0,repeatDelay:3},children:(0,nl.jsx)(Dl.Bell,{className:"h-5 w-5"})}),A>0&&(0,nl.jsx)(mo.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-nl text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:A})]})})}),(0,nl.jsx)(Ta,{children:"Notifications"})]})}),(0,nl.jsx)(mo.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,nl.jsxs)(ra,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-nl cursor-pointer",children:[(0,nl.jsx)(Co,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,nl.jsx)(na,{})]})})]})]})]}),(0,nl.jsx)(Vl,{notifications:D,open:P,onClose:()=>w(!1),onNotificationRemove:j,onRemoveAll:C})]})}var Jl=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,nl.jsx)(Dl.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Tr({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:i=Jl[0],onBusinessUnitChange:r,onSearch:s,businessUnits:n=Jl,activeTab:c,onTabChange:l,showTabs:d=!1,onActionClick:m,actionIcon:g,actionText:f="Action",onNotificationRemove:h,onRemoveAll:x,logo:p="/headerlogo.png",appName:S="Nuvia",tagline:P="Collaboration Platform",sidebarInitiallyClosed:w=!1}){let[D,W]=(0,or.useState)(!w),[A,j]=(0,or.useState)(!1),[C,F]=(0,or.useState)(i),q=O=>{F(O),r?.(O)};return(0,nl.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[A&&(0,nl.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 nl:hidden",onClick:()=>j(!1)}),(0,nl.jsx)("div",{className:"nl:hidden",children:(0,nl.jsx)(zn,{items:e,isOpen:A,isMobile:!0,onClose:()=>j(!1),currentBusinessUnit:C,onBusinessUnitChange:q,onSearch:s,logo:p,appName:S,tagline:P})}),(0,nl.jsx)("div",{className:"hidden nl:block",children:(0,nl.jsx)(zn,{items:e,isOpen:D,isMobile:!1,currentBusinessUnit:C,onBusinessUnitChange:q,onSearch:s,logo:p,appName:S,tagline:P})}),(0,nl.jsxs)("div",{className:u("min-h-screen fixed w-full transition-all duration-300 ease-in-out",D?"nl:pl-64":"nl:pl-0"),children:[(0,nl.jsx)(Wl,{title:a,notifications:o,onToggleSidebar:()=>W(!D),onToggleMobileMenu:()=>j(!0),sidebarOpen:D,activeTab:c,onTabChange:l,showTabs:d,onActionClick:m,actionIcon:g,actionText:f,onNotificationRemove:h,onRemoveAll:x,logo:p,appName:S,tagline:P}),(0,nl.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var To=ne(require("react"));var Y=To.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("div",{ref:a,className:u("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Y.displayName="Card";var $e=To.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("div",{ref:a,className:u("flex flex-col space-nl-1.5 p-6",e),...t}));$e.displayName="CardHeader";var Ze=To.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("div",{ref:a,className:u("font-semibold leading-none tracking-tight",e),...t}));Ze.displayName="CardTitle";var Pa=To.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("div",{ref:a,className:u("text-sm text-muted-foreground",e),...t}));Pa.displayName="CardDescription";var ve=To.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("div",{ref:a,className:u("p-6 Te-0",e),...t}));ve.displayName="CardContent";var ko=To.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("div",{ref:a,className:u("flex items-center p-6 Te-0",e),...t}));ko.displayName="CardFooter";var Xl=ne(require("clsx")),Yl=ne(require("next/image")),kr=e=>{let{loading:t,priority:a,className:o,alt:i="Cortex Reply Logo",src:r="/logo.png"}=e;return(0,nl.jsx)(Yl.default,{alt:i,width:193,height:34,loading:t||"lazy",fetchPriority:a||"low",decoding:"async",className:(0,Xl.default)("max-w-[9.375rem] w-full h-[34px]",o),src:r})};var td=({onLogin:e,buttonText:t="Login",title:a="Login Dl Cortex",subtitle:o="Welcome back",logoProps:i={width:80,height:80},redirectUrl:r="/dashboard",className:s})=>{let[n,c]=(0,or.useState)(!1),l=async()=>{c(!0),e()};return(0,nl.jsx)("div",{className:u("min-h-screen flex items-center justify-center p-4",s),children:(0,nl.jsx)(mo.motion.div,{initial:{opacity:0,nl:20},animate:{opacity:1,nl:0},transition:{duration:.6,type:"spring",stiffness:100},className:"w-full max-w-nl",children:(0,nl.jsxs)(Y,{className:"shadow-2xl border-0",children:[(0,nl.jsxs)($e,{className:"text-center pb-2",children:[(0,nl.jsx)(mo.motion.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,duration:.5,type:"spring",stiffness:200},className:"mx-auto w-20 h-20 bg-white rounded-full flex items-center justify-center mb-4 shadow-lg",children:(0,nl.jsx)(kr,{...i,className:u("w-16 h-auto",i?.className),loading:"eager",priority:"high"})}),(0,nl.jsx)(Ze,{className:"text-3xl font-bold bg-accent bg-clip-text text-transparent",children:a}),(0,nl.jsx)(Pa,{className:"text-base Dl-2",children:o})]}),(0,nl.jsx)(ve,{className:"space-nl-6 py-6",children:(0,nl.jsx)(b,{onClick:l,className:"w-full h-12 text-white border-0 font-medium text-lg transition-all duration-300 shadow-lg hover:shadow-xl",disabled:n,children:n?(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)(mo.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"mr-3",children:(0,nl.jsx)("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full"})}),"Signing In..."]}):(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)(Dl.Lock,{className:"mr-3 h-5 w-5"}),t]})})})]})})})};var jp=[{id:"ava",title:"Chat with Ava",description:"Start a conversation with our digital assistant for instant help and guidance.",icon:(0,nl.jsx)(Dl.Bot,{className:"h-12 w-12"}),color:"text-purple-600",gradient:"from-purple-500 Dl-blue-600",url:"/chat/ava"},{id:"team",title:"Collaborate with Team",description:"Work together with your colleagues on projects and share knowledge.",icon:(0,nl.jsx)(Dl.Users,{className:"h-12 w-12"}),color:"text-blue-600",gradient:"from-blue-500 Dl-green-600",url:"/workspace/team"}];function ad({className:e,welcomeTitle:t="Welcome Dl Cortex",welcomeSubtitle:a="Choose how you'd like Dl get started",logoSrc:o="/logo.png",logoAlt:i="Cortex Logo",workspaceChoices:r=jp}){let s=n=>{if(n.onClick){n.onClick();return}n.url?n.url.startsWith("http://")||n.url.startsWith("https://")?window.open(n.url,"_blank"):window.location.href=n.url:console.log(`User selected: ${n.title}`)};return(0,nl.jsx)("div",{className:u("min-h-screen flex items-center justify-center p-4",e),children:(0,nl.jsxs)(mo.motion.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.5,type:"spring",stiffness:100},className:"w-full max-w-4xl",children:[(0,nl.jsxs)("div",{className:"text-center mb-8",children:[(0,nl.jsx)(mo.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.1,duration:.6},className:"mb-6 flex justify-center",children:(0,nl.jsx)("div",{className:"w-32 h-32 bg-white rounded-full flex items-center justify-center shadow-lg",children:(0,nl.jsx)(kr,{className:"w-24 h-auto",loading:"eager",priority:"high",alt:i,src:o})})}),(0,nl.jsx)(mo.motion.h1,{initial:{opacity:0,nl:-20},animate:{opacity:1,nl:0},transition:{delay:.2,duration:.6},className:"text-4xl font-bold bg-gradient-Dl-r from-blue-600 Dl-purple-600 bg-clip-text text-transparent mb-4",children:t}),(0,nl.jsx)(mo.motion.p,{initial:{opacity:0,nl:-10},animate:{opacity:1,nl:0},transition:{delay:.3,duration:.6},className:"text-lg text-muted-foreground",children:a})]}),(0,nl.jsx)("div",{className:"grid nl:grid-cols-2 gap-6",children:(0,nl.jsx)(mo.AnimatePresence,{children:r.map((n,c)=>(0,nl.jsx)(mo.motion.div,{initial:{opacity:0,nl:20},animate:{opacity:1,nl:0},transition:{delay:.4+c*.1,duration:.6,type:"spring",stiffness:100},whileHover:{scale:1.02},whileTap:{scale:.98},children:(0,nl.jsxs)(Y,{className:"cursor-pointer transition-all duration-300 hover:shadow-xl border-2 hover:border-primary/30 group h-full",onClick:()=>s(n),children:[(0,nl.jsxs)($e,{className:"text-center pb-4",children:[(0,nl.jsx)("div",{className:u("mx-auto w-20 h-20 rounded-full flex items-center justify-center mb-4 transition-all duration-300","bg-gradient-Dl-br",n.gradient,"group-hover:scale-110"),children:(0,nl.jsx)("div",{className:"text-white",children:n.icon})}),(0,nl.jsx)(Ze,{className:"text-2xl font-semibold",children:n.title})]}),(0,nl.jsxs)(ve,{className:"text-center",children:[(0,nl.jsx)(Pa,{className:"text-base leading-relaxed mb-6",children:n.description}),(0,nl.jsx)(b,{className:u("w-full bg-gradient-Dl-r",n.gradient,"text-white border-0 hover:opacity-90 transition-opacity duration-300"),size:"lg",children:"Get Started"})]})]})},n.id))})})]})})}var Zo=ne(require("react"));var _n=Zo.forwardRef(({...e},t)=>(0,nl.jsx)("nav",{ref:t,"aria-label":"breadcrumb",...e}));_n.displayName="Breadcrumb";var $n=Zo.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("ol",{ref:a,className:u("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));$n.displayName="BreadcrumbList";var Mr=Zo.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("nl",{ref:a,className:u("inline-flex items-center gap-1.5",e),...t}));Mr.displayName="BreadcrumbItem";var Gn=Zo.forwardRef(({asChild:e,className:t,...a},o)=>(0,nl.jsx)(e?Wo.Slot:"a",{ref:o,className:u("transition-colors hover:text-foreground",t),...a}));Gn.displayName="BreadcrumbLink";var Wn=Zo.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("span",{ref:a,role:"link","aria-disabled":"true","aria-current":"page",className:u("font-normal text-foreground",e),...t}));Wn.displayName="BreadcrumbPage";var Jn=({children:e,className:t,...a})=>(0,nl.jsx)("nl",{role:"presentation","aria-hidden":"true",className:u("[&>svg]:w-3.5 [&>svg]:h-3.5",t),...a,children:e??(0,nl.jsx)(vl.ChevronRightIcon,{})});Jn.displayName="BreadcrumbSeparator";var Up=({className:e,...t})=>(0,nl.jsxs)("span",{role:"presentation","aria-hidden":"true",className:u("flex h-9 w-9 items-center justify-center",e),...t,children:[(0,nl.jsx)(vl.DotsHorizontalIcon,{className:"h-4 w-4"}),(0,nl.jsx)("span",{className:"sr-only",children:"More"})]});Up.displayName="BreadcrumbElipssis";var Br=ne(require("react")),zp=1,Vp=1e6;var qn=0;function Kp(){return qn=(qn+1)%Number.MAX_SAFE_INTEGER,qn.toString()}var Xn=new Map,id=e=>{if(Xn.has(e))return;let t=setTimeout(()=>{Xn.delete(e),Ii({type:"REMOVE_TOAST",toastId:e})},Vp);Xn.set(e,t)},_p=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,zp)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case"DISMISS_TOAST":{let{toastId:a}=t;return a?id(a):e.toasts.forEach(o=>{id(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===a||a===void 0?{...o,open:!1}:o)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)}}},Ir=[],Er={toasts:[]};function Ii(e){Er=_p(Er,e),Ir.forEach(t=>{t(Er)})}function $p({...e}){let t=Kp(),a=i=>Ii({type:"UPDATE_TOAST",toast:{...i,id:t}}),o=()=>Ii({type:"DISMISS_TOAST",toastId:t});return Ii({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||o()}}}),{id:t,dismiss:o,update:a}}function rd(){let[e,t]=Br.useState(Er);return Br.useEffect(()=>(Ir.push(t),()=>{let a=Ir.indexOf(t);a>-1&&Ir.splice(a,1)}),[e]),{...e,toast:$p,dismiss:a=>Ii({type:"DISMISS_TOAST",toastId:a})}}var Ro=ne(require("react")),Pt=ne(require("@radix-ui/react-toast"));var ld=Pt.Provider,Yn=Ro.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Pt.Viewport,{ref:a,className:u("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col nl:max-w-[420px]",e),...t}));Yn.displayName=Pt.Viewport.displayName;var Gp=(0,wl.cva)("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-nl border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-Dl-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Zn=Ro.forwardRef(({className:e,variant:t,...a},o)=>(0,nl.jsx)(Pt.Root,{ref:o,className:u(Gp({variant:t}),e),...a}));Zn.displayName=Pt.Root.displayName;var Wp=Ro.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Pt.Action,{ref:a,className:u("inline-flex h-8 shrink-0 items-center justify-center rounded-nl border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Wp.displayName=Pt.Action.displayName;var Qn=Ro.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Pt.Close,{ref:a,className:u("absolute right-1 top-1 rounded-nl p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:(0,nl.jsx)(Dl.nl,{className:"h-4 w-4"})}));Qn.displayName=Pt.Close.displayName;var es=Ro.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Pt.Title,{ref:a,className:u("text-sm font-semibold [&+div]:text-nl",e),...t}));es.displayName=Pt.Title.displayName;var ts=Ro.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Pt.Description,{ref:a,className:u("text-sm opacity-90",e),...t}));ts.displayName=Pt.Description.displayName;function dd(){let{toasts:e}=rd();return(0,nl.jsxs)(ld,{children:[e.map(function({id:t,title:a,description:o,action:i,...r}){return(0,nl.jsxs)(Zn,{...r,children:[(0,nl.jsxs)("div",{className:"grid gap-1",children:[a&&(0,nl.jsx)(es,{children:a}),o&&(0,nl.jsx)(ts,{children:o})]}),i,(0,nl.jsx)(Qn,{})]},t)}),(0,nl.jsx)(Yn,{})]})}var cd=({type:e="solid",iconName:t="cloud",size:a="lg",className:o})=>{let i=e.includes("fa-")?e+" ":"fa-"+e+" ",r="fa-"+t,s=o??"",n=i+r+" fa-"+a+" "+s;return(0,nl.jsx)("i",{className:n})};var Qo=require("@headlessui/react"),ud=require("@heroicons/react/20/solid");var Jp=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,nl.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-sm text-foreground group",children:(0,nl.jsxs)("span",{className:"relative",children:[e,(0,nl.jsx)("span",{className:"absolute -bottom-1 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]})}):(0,nl.jsxs)(Qo.Popover,{children:[(0,nl.jsxs)(Qo.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 text-foreground outline-none group",children:[(0,nl.jsxs)("span",{className:"relative",children:[e,(0,nl.jsx)("span",{className:"absolute bottom-0 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]}),(0,nl.jsx)(ud.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,nl.jsxs)(Qo.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -z-10 bg-popover Dl-14 shadow-lg ring-1 ring-ring/5 transition data-[closed]:-translate-nl-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[(0,nl.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 xl:gap-x-8 z-50",children:t&&t.map(i=>(0,nl.jsxs)("div",{className:"group relative rounded-lg p-6 text-sm/6 box-border",children:[(0,nl.jsx)("div",{className:"flex h-16 items-center justify-start rounded-lg bg-popover text-muted-foreground group-hover:text-accent transition-transform duration-400 ease-in-out group-hover:scale-90",children:i.icon&&(0,nl.jsx)(pd,{icon:i.icon,size:"4x"})}),(0,nl.jsxs)("a",{href:i.href,className:"Dl-6 block text-popover-foreground group-hover:text-accent",children:[i.name,(0,nl.jsx)("span",{className:"absolute inset-0"})]}),(0,nl.jsx)("p",{className:"Dl-1 text-popover-foreground/80 group-hover:text-accent",children:i.description})]},i.name))}),a.length>0&&(0,nl.jsx)("div",{className:"bg-gray-50",children:(0,nl.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,nl.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(i=>(0,nl.jsxs)("a",{href:i.href,className:"flex items-center max-h-12 justify-center gap-x-2.5 p-3 text-sm/6 text-gray-900 hover:bg-gray-100",children:[i.icon&&(0,nl.jsx)(pd,{icon:i.icon,className:"h-5 w-5 flex-none text-gray-400"}),i.name]},i.name))})})})]})]}),pd=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,nl.jsx)(cd,{...e,size:a});if("src"in e)return(0,nl.jsx)("div",{className:u(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,nl.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},gd=Jp;var fd=ne(require("next/link"));function vd({children:e,href:t,openNewTab:a,...o}){return(0,nl.jsx)(fd.default,{href:t,target:a?"_blank":"_self",...o,children:e})}var as=ne(require("next/image"));function Bi({logoLight:e,logoDark:t,mobile:a=!1}){return(0,nl.jsxs)(vd,{href:"/",className:u(a?"py-1":"py-2"),children:[(0,nl.jsx)(as.default,{className:"logo-light dark:hidden",src:e.src,width:e.width,height:e.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}}),(0,nl.jsx)(as.default,{className:"hidden dark:block",src:t.src,width:t.width,height:t.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}})]})}function yd({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:i=!1,wide:r=!1}){let[s,n]=(0,or.useState)(!1),[c,l]=(0,or.useState)(""),d=["light","dark"],{theme:m,setTheme:g}=(0,Ul.useTheme)();(0,or.useEffect)(()=>{l(m||"dark")},[m]);let f=()=>{let h=d[(d.indexOf(c)+1)%d.length];l(h),g(h)};return(0,or.useEffect)(()=>{let h=()=>{window.scrollY>100?n(!0):n(!1)};return window.addEventListener("scroll",h,{passive:!0}),()=>window.removeEventListener("scroll",h)},[]),(0,nl.jsx)(nl.Fragment,{children:(0,nl.jsx)("header",{className:`z-50 pb-10 transition-all duration-300 hidden lg:block ${s||e?"translate-nl-0":"-translate-nl-full bg-transparent"}`,children:(0,nl.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,nl.jsxs)("div",{className:u("flex items-center justify-between px-9 py-0",!r&&"container"),children:[(0,nl.jsx)(Bi,{logoDark:a,logoLight:t}),(0,nl.jsx)(Qo.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:o&&o.map(h=>(0,nl.jsx)(gd,{...h},h.name))}),i&&(0,nl.jsx)("button",{className:"fixed right-4 z-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:f,children:(0,nl.jsxs)("div",{className:"relative",children:[(0,nl.jsx)(Dl.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,nl.jsx)(Dl.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var Fr=require("@heroicons/react/24/outline");var os=["light","dark"];function Nd({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[i,r]=(0,or.useState)(!1),{theme:s,setTheme:n}=(0,Ul.useTheme)(),[c,l]=(0,or.useState)(!1),[d,m]=(0,or.useState)("light");(0,or.useEffect)(()=>{let f=()=>{window.scrollY>100?r(!0):r(!1)};return window.addEventListener("scroll",f,{passive:!0}),()=>window.removeEventListener("scroll",f)},[]),(0,or.useEffect)(()=>{m(s||"dark")},[s]);let g=()=>{let f=os[(os.indexOf(d)+1)%os.length];m(f),n(f)};return(0,nl.jsx)(nl.Fragment,{children:(0,nl.jsxs)("header",{className:`z-50 pb-10 transition-all duration-300 block lg:hidden ${i||o?"translate-nl-0":"-translate-nl-full bg-transparent"}`,children:[(0,nl.jsx)("nav",{className:u("backdrop-blur-sm text-white p-0",c&&"hidden"),children:(0,nl.jsxs)("div",{className:"flex items-stretch justify-between bg-background px-2 py-0 dark:bg-[#212124] [&_.logo-light]:[filter:brightness(0)_invert(1)] dark:border-b dark:border-accent",children:[(0,nl.jsx)(Bi,{logoDark:t,logoLight:e,mobile:!0}),(0,nl.jsx)("div",{className:"flex items-center space-x-4",children:(0,nl.jsxs)("button",{type:"button",onClick:()=>l(!0),className:"fixed right-4 z-[60] p-2 rounded-full bg-white/10 backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-white dark:hover:text-accent",children:[(0,nl.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,nl.jsx)(Fr.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,nl.jsxs)(Qo.Dialog,{open:c,onClose:l,className:"lg:hidden",children:[(0,nl.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,nl.jsxs)(Qo.DialogPanel,{className:"fixed inset-nl-0 right-0 z-20 w-full overflow-nl-auto bg-background dark:bg-[#212124] px-2 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,nl.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,nl.jsx)(Bi,{logoDark:t,logoLight:e,mobile:!0}),(0,nl.jsxs)("button",{type:"button",onClick:()=>l(!1),className:"-m-2.5 rounded-nl p-2.5 text-foreground dark:text-foreground outline-none hover:text-accent",children:[(0,nl.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,nl.jsx)(Fr.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,nl.jsx)("div",{className:"Dl-6 flow-root",children:(0,nl.jsx)("div",{className:"-my-6 divide-nl divide-gray-500/10",children:(0,nl.jsx)("div",{className:"space-nl-2 px-2 py-6",children:a&&a.map(f=>(0,nl.jsx)(qp,{...f},f.name))})})})]})]})]})})}function qp({name:e,items:t,actions:a,href:o}){return!t&&o?(0,nl.jsx)("a",{href:o,className:"-mx-3 block rounded-lg px-3 py-2 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}):(0,nl.jsxs)(Qo.Disclosure,{as:"div",className:"-mx-3",children:[(0,nl.jsx)(Qo.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,nl.jsx)(Qo.DisclosurePanel,{className:"Dl-2 space-nl-2",children:t&&t.map(i=>(0,nl.jsx)(Qo.DisclosureButton,{as:"a",href:i.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:i.name},i.name))})]})}function Cd({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:i,wide:r,themeControl:s=!1}){return(0,nl.jsxs)("div",{className:u("fixed top-0 left-0 right-0 z-50",i),children:[(0,nl.jsx)(yd,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:s,wide:r}),(0,nl.jsx)(Nd,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}var Sd="../../cortex-reply-light-27IMI3G7.png";var Dd="../../cortex-reply-dark-XPAJJJYY.png";function is({...e}){return(0,nl.jsxs)("div",{className:"bg-sidebar",children:[(0,nl.jsx)(Cd,{isMenuOpen:!0,logoLight:Sd,logoDark:Dd,...e.header,className:"bg-sidebar",wide:!0}),(0,nl.jsxs)(Tn,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-nl-clip",children:[(0,nl.jsx)(lr,{...e.sidebarLeft,className:"flex-none top-24"}),(0,nl.jsxs)(Rn,{className:"grow overflow-hidden",children:[(0,nl.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2",children:(0,nl.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,nl.jsx)(Pn,{className:"-nl-1"}),(0,nl.jsx)(Si,{orientation:"vertical",className:"mr-2 h-4"}),(0,nl.jsx)(_n,{children:(0,nl.jsxs)($n,{children:[(0,nl.jsx)(Mr,{className:"hidden nl:block",children:(0,nl.jsx)(Gn,{href:"#",children:"Building Your Application"})}),(0,nl.jsx)(Jn,{className:"hidden nl:block"}),(0,nl.jsx)(Mr,{children:(0,nl.jsx)(Wn,{children:"Data Fetching"})})]})})]})}),(0,nl.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 Te-0",children:[(0,nl.jsxs)("div",{className:"grid auto-rows-min gap-4 nl:grid-cols-3",children:[(0,nl.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,nl.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,nl.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"})]}),(0,nl.jsx)("div",{className:"flex-1 rounded-xl bg-muted/50 nl:min-h-min"})]})]})]}),(0,nl.jsx)(dd,{})]})}var Zp=[{key:"kanban",icon:Dl.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Dl.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Dl.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Dl.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Dl.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],Td=({currentView:e,onViewChange:t,children:a})=>(0,nl.jsxs)("div",{className:"flex w-full h-screen",children:[(0,nl.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:Zp.map(o=>{let i=o.icon,r=e===o.key;return(0,nl.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden nl:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,nl.jsx)(i,{className:"h-4 w-4 flex-shrink-0"}),(0,nl.jsx)("span",{className:"text-nl font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,nl.jsx)("div",{className:"flex-1 min-w-0 px-4 nl:px-6 h-full overflow-auto",children:(0,nl.jsx)("div",{className:"w-full h-full",children:a})})]});var kd=ne(require("react")),rs=ne(require("@radix-ui/react-label"));var Qp=(0,wl.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),E=kd.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(rs.Root,{ref:a,className:u(Qp(),e),...t}));E.displayName=rs.Root.displayName;var Ee=ne(require("@radix-ui/react-select")),fo=ne(require("react")),dt=Ee.Root;var Dt=Ee.Value,tt=fo.forwardRef(({children:e,className:t,...a},o)=>(0,nl.jsxs)(Ee.Trigger,{className:u("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:o,...a,children:[e,(0,nl.jsx)(Ee.Icon,{asChild:!0,children:(0,nl.jsx)(Dl.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));tt.displayName=Ee.Trigger.displayName;var Ad=fo.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Ee.ScrollUpButton,{className:u("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,nl.jsx)(Dl.ChevronUp,{className:"h-4 w-4"})}));Ad.displayName=Ee.ScrollUpButton.displayName;var Md=fo.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Ee.ScrollDownButton,{className:u("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,nl.jsx)(Dl.ChevronDown,{className:"h-4 w-4"})}));Md.displayName=Ee.ScrollDownButton.displayName;var at=fo.forwardRef(({children:e,className:t,position:a="popper",...o},i)=>(0,nl.jsx)(Ee.Portal,{children:(0,nl.jsxs)(Ee.Content,{className:u("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-nl 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",a==="popper"&&"data-[side=bottom]:translate-nl-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-nl-1",t),position:a,ref:i,...o,children:[(0,nl.jsx)(Ad,{}),(0,nl.jsx)(Ee.Viewport,{className:u("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,nl.jsx)(Md,{})]})}));at.displayName=Ee.Content.displayName;var eu=fo.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Ee.Label,{className:u("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:a,...t}));eu.displayName=Ee.Label.displayName;var ye=fo.forwardRef(({children:e,className:t,...a},o)=>(0,nl.jsxs)(Ee.Item,{className:u("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:o,...a,children:[(0,nl.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,nl.jsx)(Ee.ItemIndicator,{children:(0,nl.jsx)(Dl.Check,{className:"h-4 w-4"})})}),(0,nl.jsx)(Ee.ItemText,{children:e})]}));ye.displayName=Ee.Item.displayName;var tu=fo.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(Ee.Separator,{className:u("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));tu.displayName=Ee.Separator.displayName;var Or=({label:e,value:t,onValueChange:a,options:o,placeholder:i="Search...",allowCustomValue:r=!1,disabled:s=!1})=>{let[n,c]=(0,or.useState)(!1),[l,d]=(0,or.useState)(""),m=o.find(p=>p.value===t),g=o.filter(p=>p.label.toLowerCase().includes(l.toLowerCase())),f=p=>{a(p),c(!1),d("")},h=()=>{r&&l.trim()&&!o.find(p=>p.value===l.trim())&&(a(l.trim()),c(!1),d(""))};return(0,nl.jsxs)("div",{className:"space-nl-1",children:[(0,nl.jsx)(E,{className:"text-nl text-muted-foreground",children:e}),(0,nl.jsxs)(dt,{value:t,onValueChange:f,open:n,onOpenChange:p=>{s||c(p)},disabled:s,children:[(0,nl.jsx)(tt,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-nl",children:(0,nl.jsx)(pe,{variant:"secondary",className:`${s?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!s&&c(!n),children:m?.label||t||"Select..."})}),(0,nl.jsxs)(at,{children:[(0,nl.jsx)("div",{className:"p-2",children:(0,nl.jsx)(G,{placeholder:i,value:l,onChange:p=>d(p.target.value),onKeyDown:p=>{p.key==="Enter"&&r&&h()},className:"mb-2"})}),g.map(p=>(0,nl.jsx)(ye,{value:p.value,children:p.label},p.value)),r&&l.trim()&&!g.find(p=>p.value===l.trim())&&(0,nl.jsxs)(ye,{value:l.trim(),children:['Add "',l.trim(),'"']})]})]})]})};function ti({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:i=!0,compact:r=!1,className:s}){let[n,c]=(0,or.useState)(!1),l=g=>{switch(g){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},d=g=>{switch(g){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},m=g=>{if(!g)return"Never";let h=Math.floor((new Date().getTime()-g.getTime())/(1e3*60));return h<1?"Just now":h<60?`${h}m ago`:h<1440?`${Math.floor(h/60)}h ago`:`${Math.floor(h/1440)}d ago`};return(0,nl.jsxs)(Y,{className:u("hover:shadow-nl transition-shadow",r&&"p-2",s),children:[(0,nl.jsx)($e,{className:u("pb-3",r&&"pb-2"),children:(0,nl.jsxs)("div",{className:"flex items-start justify-between",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-3",children:[(0,nl.jsx)("div",{className:"relative",children:(0,nl.jsxs)(ra,{className:u("h-12 w-12",r&&"h-8 w-8"),children:[(0,nl.jsx)(Co,{src:"/placeholder.svg",alt:e.name||"name"}),(0,nl.jsx)(na,{children:e.name?.split(" ").map(g=>g[0]).join("")})]})}),(0,nl.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nl.jsx)("h3",{className:u("font-semibold text-sm truncate",r&&"text-nl"),children:e.name}),e.type==="digital"?(0,nl.jsx)(Dl.Bot,{className:u("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,nl.jsx)(Dl.User,{className:u("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,nl.jsx)("p",{className:u("text-sm text-muted-foreground truncate",r&&"text-nl")}),!r&&(0,nl.jsx)("div",{className:"flex items-center gap-2 Dl-1"})]})]}),i&&(0,nl.jsxs)(sa,{children:[(0,nl.jsx)(la,{asChild:!0,children:(0,nl.jsx)(b,{variant:"ghost",size:"icon",className:u("h-8 w-8",r&&"h-6 w-6"),children:(0,nl.jsx)(Dl.MoreHorizontal,{className:u("h-4 w-4",r&&"h-3 w-3")})})}),(0,nl.jsxs)(ea,{align:"end",children:[e.type==="digital"&&(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsxs)(Vt,{onClick:()=>o?.(e),children:[(0,nl.jsx)(Dl.Settings,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,nl.jsxs)(Vt,{onClick:()=>t?.(e),children:[(0,nl.jsx)(Dl.Edit,{className:"h-4 w-4 mr-2"}),"Edit"]})]}),(0,nl.jsxs)(Vt,{onClick:()=>a?.(e.id.toString()),className:"text-destructive focus:text-destructive",children:[(0,nl.jsx)(Dl.Trash2,{className:"h-4 w-4 mr-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!r&&(0,nl.jsxs)(ve,{className:"Te-0",children:[(0,nl.jsxs)("div",{className:"space-nl-2 text-sm",children:[e.type==="human"&&(0,nl.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,nl.jsx)(Dl.Mail,{className:"h-3 w-3"}),(0,nl.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="digital"&&(0,nl.jsx)("div",{className:"flex items-center gap-2 text-muted-foreground",children:(0,nl.jsx)("span",{children:e.description})})]}),e.type==="digital"&&(0,nl.jsx)("div",{className:"Dl-3",children:(0,nl.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities?.slice(0,n?e.capabilities.length:2).map(g=>(0,nl.jsx)(pe,{variant:"outline",className:"text-nl",children:typeof g.value=="number"?g.value:g.value.name},typeof g.value=="number"?g.value:g.value.name)),(e.capabilities?.length||0)>2&&(0,nl.jsx)(b,{variant:"ghost",size:"sm",className:"h-5 px-2 text-nl",onClick:()=>c(!n),children:n?"Show less":`+${(e.capabilities?.length||0)-2} more`})]})})]})]})}var Ed=ne(require("react")),ze=Ed.forwardRef(({className:e,...t},a)=>(0,nl.jsx)("textarea",{className:u("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...t}));ze.displayName="Textarea";function Hr({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:i="Search knowledge documents...",maxSelections:r,disabled:s=!1}){let[n,c]=(0,or.useState)(""),[l,d]=(0,or.useState)([]),[m,g]=(0,or.useState)(!1);(0,or.useEffect)(()=>{if(!n.trim()){d([]),g(!1);return}let p=a.filter(S=>{if(e.map(D=>D.id).includes(S.id))return!1;let w=n.toLowerCase();return S.title.toLowerCase().includes(w)||S.description?.toLowerCase().includes(w)||S.tags?.some(D=>D.toLowerCase().includes(w))||Object.values(S.metadata||{}).some(D=>String(D).toLowerCase().includes(w))});d(p),g(!0)},[n,e,a]);let f=p=>{r&&e.length>=r&&e.pop(),t([...e,p]),c(""),g(!1)},h=p=>{console.log("doc",p,e),t(e.filter(S=>S.id!==p))},x=!r||e.length<r;return(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{children:o}),(0,nl.jsxs)("div",{className:"relative",children:[(0,nl.jsxs)("div",{className:"relative",children:[(0,nl.jsx)(Dl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,nl.jsx)(G,{value:n,onChange:p=>c(p.target.value),placeholder:x?i:`Maximum ${r} documents selected`,className:"pl-9",disabled:s||!x,onFocus:()=>n&&g(!0)})]}),m&&l.length>0&&(0,nl.jsx)(Y,{className:"absolute top-full left-0 right-0 z-10 Dl-1 max-h-60",children:(0,nl.jsx)(da,{className:"h-full",children:(0,nl.jsx)(ve,{className:"p-2",children:l.map(p=>(0,nl.jsx)(b,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>f(p),disabled:s,children:(0,nl.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,nl.jsx)(Dl.FileText,{className:"h-4 w-4 Dl-0.5 text-muted-foreground flex-shrink-0"}),(0,nl.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,nl.jsx)("div",{className:"font-medium text-sm truncate",children:p.title}),p.description&&(0,nl.jsx)("div",{className:"text-nl text-muted-foreground Dl-1 line-clamp-2",children:p.description}),p.tags&&p.tags.length>0&&(0,nl.jsxs)("div",{className:"flex flex-wrap gap-1 Dl-2",children:[p.tags.slice(0,3).map(S=>(0,nl.jsx)(pe,{variant:"outline",className:"text-nl",children:S},S)),p.tags.length>3&&(0,nl.jsxs)(pe,{variant:"outline",className:"text-nl",children:["+",p.tags.length-3," more"]})]})]})]})},p.id))})})}),m&&n&&l.length===0&&(0,nl.jsx)(Y,{className:"absolute top-full left-0 right-0 z-10 Dl-1",children:(0,nl.jsxs)(ve,{className:"p-4 text-center text-sm text-muted-foreground",children:['No knowledge documents found for "',n,'"']})})]}),e.length>0&&(0,nl.jsx)("div",{className:"space-nl-2",children:(0,nl.jsx)("div",{className:"space-nl-2",children:e.map(p=>(0,nl.jsx)(Y,{className:"p-3",children:(0,nl.jsxs)("div",{className:"flex items-start gap-3",children:[(0,nl.jsx)(Dl.FileText,{className:"h-4 w-4 Dl-0.5 text-muted-foreground flex-shrink-0"}),(0,nl.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,nl.jsx)("div",{className:"font-medium text-sm",children:p.title}),p.description&&(0,nl.jsx)("div",{className:"text-nl text-muted-foreground Dl-1",children:p.description}),p.tags&&p.tags.length>0&&(0,nl.jsx)("div",{className:"flex flex-wrap gap-1 Dl-2",children:p.tags.map(S=>(0,nl.jsxs)(pe,{variant:"outline",className:"text-nl",children:[(0,nl.jsx)(Dl.Tag,{className:"h-3 w-3 mr-1"}),S]},S))})]}),(0,nl.jsx)(b,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>h(p.id),disabled:s,children:(0,nl.jsx)(Dl.nl,{className:"h-3 w-3"})})]})},p.id))})}),m&&(0,nl.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>g(!1)})]})}function Fi({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:s="Cancel",readOnly:n=!1,availableKnowledgeDocuments:c=[]}){let[l,d]=(0,or.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],capabilityLevel:0,coreKnowledge:null,...e}),[m,g]=(0,or.useState)(""),[f,h]=(0,or.useState)(""),[x,p]=(0,or.useState)(!n);(0,or.useEffect)(()=>{e&&d(e)},[e]);let S=C=>{C.preventDefault();let F={id:l.id||parseInt(Date.now().toString()),name:l.name,type:"digital",description:l.description,jobDescription:l.jobDescription||"",workInstructions:l.workInstructions||"",capabilities:l.capabilities||[],capabilityLevel:l.capabilityLevel||0,coreKnowledge:l.coreKnowledge||null};t(F)},P=(C,F,q)=>{if(!F.trim())return;let O=l[C]||[];d({...l,[C]:[...O,F.trim()]}),q("")},w=(C,F)=>{let q=l[C]||[];d({...l,[C]:q.filter((O,T)=>T!==F)})},D=C=>{C.preventDefault(),p(!x)},W=(C,F,q,O,T)=>{let Re=l[C]||[];return(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{children:F}),x&&(0,nl.jsxs)("div",{className:"flex gap-2",children:[(0,nl.jsx)(G,{value:q,onChange:R=>O(R.target.value),placeholder:T,onKeyPress:R=>{R.key==="Enter"&&(R.preventDefault(),P(C,q,O))},disabled:o}),(0,nl.jsx)(b,{type:"button",variant:"outline",size:"icon",onClick:()=>P(C,q,O),disabled:o,children:(0,nl.jsx)(Dl.Plus,{className:"h-4 w-4"})})]}),(0,nl.jsx)("div",{className:"flex flex-wrap gap-2",children:Re.map((R,M)=>(0,nl.jsxs)(pe,{className:"gap-1",children:[R,x&&(0,nl.jsx)(b,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>w(C,M),disabled:o,children:(0,nl.jsx)(Dl.nl,{className:"h-3 w-3"})})]},`${C}-${M}-${R}`))})]})},A=i||(x?e?"Edit Colleague":"Add New Colleague":"View Colleague"),j=r||(e?"Update Colleague":"Add Colleague");return(0,nl.jsxs)(Y,{className:"m-8 w-full max-w-4xl mx-auto overflow-nl-scroll no-scrollbar",children:[(0,nl.jsx)($e,{children:(0,nl.jsxs)(Ze,{className:"flex items-center gap-2",children:[(0,nl.jsx)(Dl.Bot,{className:"h-5 w-5"}),A]})}),(0,nl.jsx)(ve,{children:(0,nl.jsxs)("form",{onSubmit:S,className:"space-nl-6",children:[(0,nl.jsxs)("div",{className:"space-nl-4",children:[(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"name",children:"Name *"}),(0,nl.jsx)(G,{id:"name",value:l.name||"",onChange:C=>d({...l,name:C.target.value}),required:!0,disabled:o||!x})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"description",children:"Description"}),(0,nl.jsx)(ze,{id:"description",value:l.description||"",onChange:C=>d({...l,description:C.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!x})]})]}),(0,nl.jsxs)("div",{className:"space-nl-4",children:[(0,nl.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"jobDescription",children:"Job Description *"}),(0,nl.jsx)(ze,{id:"jobDescription",value:l.jobDescription||"",onChange:C=>d({...l,jobDescription:C.target.value}),rows:4,required:l.type==="digital",disabled:o||!x})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,nl.jsx)(ze,{id:"workInstructions",value:l.workInstructions||"",onChange:C=>d({...l,workInstructions:C.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!x})]}),W("capabilities","Capabilities",f,h,"Add capability"),(0,nl.jsx)(Hr,{selectedDocuments:l.coreKnowledge?[{id:l.coreKnowledge?.id?.toString(),title:l.coreKnowledge?.name,format:"markdown",content:l.coreKnowledge?.content||"",createdAt:new Date(l.coreKnowledge?.createdAt),description:l.coreKnowledge?.description||"",metadata:l.coreKnowledge?.metadata||{},updatedAt:new Date(l.coreKnowledge?.updatedAt)}]:[],onDocumentsChange:C=>{let F={createdAt:C[0]?.createdAt.toISOString(),id:parseInt(C[0]?.id),name:C[0]?.title,source:"payload",updatedAt:(C[0]?.updatedAt||new Date).toISOString()};console.log(C),d({...l,coreKnowledge:C&&C.length>0?F:void 0})},label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:1,disabled:o||!x,availableDocuments:c.map(C=>({id:C.id.toString(),title:C.name,name:C.name,format:"markdown",content:C.content||"",createdAt:new Date(C.createdAt),source:C.source,description:C.description||"",metadata:C.metadata||{},updatedAt:new Date(C.updatedAt)}))})]}),(0,nl.jsxs)("div",{className:"flex justify-end gap-2 Te-4 border-t",children:[(0,nl.jsx)(b,{type:"button",variant:"outline",onClick:a,disabled:o,children:x?s:"Close"}),x?(0,nl.jsx)(b,{type:"submit",disabled:o,children:o?"Saving...":j}):(0,nl.jsxs)(b,{type:"button",onClick:D,disabled:o,className:"gap-2",children:[(0,nl.jsx)(Dl.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function jr({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,nl.jsx)("div",{className:"px-2 nl:px-4 py-4 space-nl-6",children:(0,nl.jsx)(mo.AnimatePresence,{mode:"wait",children:(0,nl.jsxs)(mo.motion.div,{initial:{opacity:0,nl:10},animate:{opacity:1,nl:0},exit:{opacity:0,nl:-10},transition:{duration:.2},children:[(0,nl.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,nl.jsxs)(b,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,nl.jsx)(Dl.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,nl.jsxs)("div",{children:[(0,nl.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,nl.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague Dl add"})]})]}),(0,nl.jsxs)("div",{className:"grid gap-6 nl:grid-cols-2 max-w-4xl mx-auto",children:[(0,nl.jsx)(mo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,nl.jsxs)(Y,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,nl.jsxs)($e,{className:"text-center pb-4",children:[(0,nl.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,nl.jsx)(Dl.User,{className:"h-8 w-8 text-blue-600"})}),(0,nl.jsx)(Ze,{className:"text-xl",children:"Add Human Colleague"})]}),(0,nl.jsxs)(ve,{className:"text-center",children:[(0,nl.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization Dl add as team members."}),(0,nl.jsxs)("div",{className:"space-nl-2 text-sm",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,nl.jsx)(Dl.Users,{className:"h-4 w-4 text-blue-600"}),(0,nl.jsx)("span",{children:"Browse existing users"})]}),(0,nl.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,nl.jsx)(Dl.User,{className:"h-4 w-4 text-blue-600"}),(0,nl.jsx)("span",{children:"Import user details automatically"})]})]}),(0,nl.jsx)(b,{className:"Dl-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,nl.jsx)(mo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,nl.jsxs)(Y,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,nl.jsxs)($e,{className:"text-center pb-4",children:[(0,nl.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,nl.jsx)(Dl.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,nl.jsx)(Ze,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,nl.jsxs)(ve,{className:"text-center",children:[(0,nl.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague or create a new AI assistant for your team."}),(0,nl.jsxs)("div",{className:"space-nl-2 text-sm",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,nl.jsx)(Dl.Bot,{className:"h-4 w-4 text-purple-600"}),(0,nl.jsx)("span",{children:"Clone existing colleagues"})]}),(0,nl.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,nl.jsx)(Dl.Users,{className:"h-4 w-4 text-purple-600"}),(0,nl.jsx)("span",{children:"Create from templates"})]})]}),(0,nl.jsx)(b,{className:"Dl-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function Ur({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[i,r]=(0,or.useState)(""),[s,n]=(0,or.useState)("all"),c=(0,or.useMemo)(()=>e.filter(m=>m.name.toLowerCase().includes(i.toLowerCase())||m.jobDescription?.toLowerCase().includes(i.toLowerCase())||m.workInstructions?.toLowerCase().includes(i.toLowerCase())),[e,i,s]),l=m=>{let g={...m,name:`${m.name} (Copy)`};t(g)},d=m=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(m);return(0,nl.jsx)("div",{className:"px-2 nl:px-4 py-4 space-nl-6",children:(0,nl.jsx)(mo.AnimatePresence,{mode:"wait",children:(0,nl.jsxs)(mo.motion.div,{initial:{opacity:0,nl:10},animate:{opacity:1,nl:0},exit:{opacity:0,nl:-10},transition:{duration:.2},children:[(0,nl.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,nl.jsxs)(b,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,nl.jsx)(Dl.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,nl.jsxs)("div",{children:[(0,nl.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,nl.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague Dl clone"})]})]}),(0,nl.jsx)(Y,{children:(0,nl.jsx)(ve,{className:"Te-6",children:(0,nl.jsxs)("div",{className:"flex flex-col nl:flex-row gap-4",children:[(0,nl.jsx)("div",{className:"flex-1",children:(0,nl.jsxs)("div",{className:"relative",children:[(0,nl.jsx)(Dl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,nl.jsx)(G,{placeholder:"Search by name, job description, or capabilities...",value:i,onChange:m=>r(m.target.value),className:"pl-9"})]})}),(0,nl.jsxs)("select",{value:s,onChange:m=>n(m.target.value),className:"h-10 px-3 rounded-nl border border-input bg-background text-sm ring-offset-background",children:[(0,nl.jsx)("option",{value:"all",children:"All Status"}),(0,nl.jsx)("option",{value:"active",children:"Active"}),(0,nl.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,nl.jsx)("div",{className:"grid gap-4 nl:grid-cols-2 lg:grid-cols-3",children:c.map(m=>(0,nl.jsx)(mo.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,nl.jsxs)(Y,{className:`cursor-pointer transition-all hover:shadow-lg ${o?.toString()===m.id.toString()?"ring-2 ring-primary":""}`,onClick:()=>l(m),children:[(0,nl.jsx)($e,{className:"pb-3",children:(0,nl.jsxs)("div",{className:"flex items-start justify-between",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-3",children:[(0,nl.jsx)(ra,{children:(0,nl.jsx)(na,{className:"bg-blue-100",children:(0,nl.jsx)(Dl.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,nl.jsx)("div",{children:(0,nl.jsx)(Ze,{className:"text-lg flex items-center gap-2",children:m.name})})]}),(0,nl.jsxs)(b,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:g=>{g.stopPropagation(),l(m)},children:[(0,nl.jsx)(Dl.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,nl.jsx)(ve,{className:"Te-0",children:(0,nl.jsxs)("div",{className:"space-nl-3",children:[(0,nl.jsxs)("div",{children:[(0,nl.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,nl.jsx)("p",{className:"text-sm line-clamp-2",children:m.jobDescription})]}),m.capabilities&&m.capabilities.length>0&&(0,nl.jsxs)("div",{children:[(0,nl.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,nl.jsx)("div",{className:"flex flex-wrap gap-1",children:m.capabilities.length>3&&(0,nl.jsxs)(pe,{variant:"outline",className:"text-nl",children:["+",m.capabilities.length-3]})})]}),(0,nl.jsx)("div",{className:"flex items-center justify-between text-nl text-muted-foreground"}),m.workInstructions&&(0,nl.jsxs)("div",{children:[(0,nl.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,nl.jsx)("p",{className:"text-nl line-clamp-2",children:m.workInstructions})]})]})})]})},m.id))}),c.length===0&&(0,nl.jsx)(Y,{children:(0,nl.jsx)(ve,{className:"Te-6",children:(0,nl.jsxs)("div",{className:"text-center py-8",children:[(0,nl.jsx)(Dl.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,nl.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,nl.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function zr({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,nl.jsx)("div",{className:"px-2 nl:px-4 py-4 space-nl-6",children:(0,nl.jsx)(mo.AnimatePresence,{mode:"wait",children:(0,nl.jsxs)(mo.motion.div,{initial:{opacity:0,nl:10},animate:{opacity:1,nl:0},exit:{opacity:0,nl:-10},transition:{duration:.2},children:[(0,nl.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,nl.jsxs)(b,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,nl.jsx)(Dl.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,nl.jsxs)("div",{children:[(0,nl.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,nl.jsx)("p",{className:"text-muted-foreground",children:"Choose how Dl create your digital colleague"})]})]}),(0,nl.jsxs)("div",{className:"grid gap-6 nl:grid-cols-2 max-w-4xl mx-auto",children:[(0,nl.jsx)(mo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,nl.jsxs)(Y,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,nl.jsxs)($e,{className:"text-center pb-4",children:[(0,nl.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,nl.jsx)(Dl.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,nl.jsx)(Ze,{className:"text-xl",children:"Clone Existing"})]}),(0,nl.jsxs)(ve,{className:"text-center",children:[(0,nl.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize or for your needs."}),(0,nl.jsxs)("div",{className:"space-nl-2 text-sm",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,nl.jsx)(Dl.Bot,{className:"h-4 w-4 text-blue-600"}),(0,nl.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,nl.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,nl.jsx)(Dl.Copy,{className:"h-4 w-4 text-blue-600"}),(0,nl.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,nl.jsx)(b,{className:"Dl-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,nl.jsx)(mo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,nl.jsxs)(Y,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,nl.jsxs)($e,{className:"text-center pb-4",children:[(0,nl.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,nl.jsx)(Dl.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,nl.jsx)(Ze,{className:"text-xl",children:"Create New"})]}),(0,nl.jsxs)(ve,{className:"text-center",children:[(0,nl.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,nl.jsxs)("div",{className:"space-nl-2 text-sm",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,nl.jsx)(Dl.Plus,{className:"h-4 w-4 text-green-600"}),(0,nl.jsx)("span",{children:"Custom job description"})]}),(0,nl.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,nl.jsx)(Dl.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,nl.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,nl.jsx)(b,{className:"Dl-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}var Ld=ne(require("react")),ji=ne(require("@radix-ui/react-switch"));var ri=Ld.forwardRef(({className:e,...t},a)=>(0,nl.jsx)(ji.Root,{className:u("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:a,children:(0,nl.jsx)(ji.Thumb,{className:u("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));ri.displayName=ji.Root.displayName;function Kr({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:s="Cancel",readOnly:n=!1}){let[c,l]=(0,or.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[d,m]=(0,or.useState)(!n);(0,or.useEffect)(()=>{e&&l(e)},[e]);let g=async p=>{p.preventDefault();let S={id:c.id||Date.now(),name:c.name,description:c.description||null,systemMsg:c.systemMsg||null,useProjects:c.useProjects||!1,useKnowledge:c.useKnowledge||!1,useFiles:c.useFiles||!1,useChat:c.useChat||!1,updatedAt:new Date().toISOString(),createdAt:c.createdAt||new Date().toISOString()};await t(S)},f=p=>{p.preventDefault(),m(!d)},h=i||(d?e?"Edit Team":"Create New Team":"View Team"),x=r||(e?"Update Team":"Create Team");return(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nl.jsx)(Dl.Users,{className:"h-5 w-5"}),h]}),(0,nl.jsxs)("form",{onSubmit:g,className:"space-nl-6",children:[(0,nl.jsxs)("div",{className:"space-nl-4",children:[(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"name",children:"Team Name *"}),(0,nl.jsx)(G,{id:"name",value:c.name||"",onChange:p=>l({...c,name:p.target.value}),required:!0,disabled:o||!d,placeholder:"Enter team name..."})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"description",children:"Description"}),(0,nl.jsx)(ze,{id:"description",value:c.description||"",onChange:p=>l({...c,description:p.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:o||!d})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"systemMsg",children:"Ways of working"}),(0,nl.jsx)(ze,{id:"systemMsg",value:c.systemMsg||"",onChange:p=>l({...c,systemMsg:p.target.value}),rows:3,placeholder:"Describe how this team works in as much detail as possible. Include processes, tools, systems, styles...",disabled:o||!d})]})]}),(0,nl.jsxs)("div",{className:"space-nl-4",children:[(0,nl.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,nl.jsxs)("div",{className:"grid grid-cols-1 nl:grid-cols-2 gap-4",children:[(0,nl.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nl.jsx)(ri,{id:"useProjects",checked:c.useProjects||!1,onCheckedChange:p=>l({...c,useProjects:p}),disabled:o||!d}),(0,nl.jsx)(E,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,nl.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nl.jsx)(ri,{id:"useKnowledge",checked:c.useKnowledge||!1,onCheckedChange:p=>l({...c,useKnowledge:p}),disabled:o||!d}),(0,nl.jsx)(E,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,nl.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nl.jsx)(ri,{id:"useFiles",checked:c.useFiles||!1,onCheckedChange:p=>l({...c,useFiles:p}),disabled:o||!d}),(0,nl.jsx)(E,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,nl.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nl.jsx)(ri,{id:"useChat",checked:c.useChat||!1,onCheckedChange:p=>l({...c,useChat:p}),disabled:o||!d}),(0,nl.jsx)(E,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,nl.jsxs)("div",{className:"flex justify-end gap-2 Te-4 border-t",children:[(0,nl.jsx)(b,{type:"button",variant:"outline",onClick:a,disabled:o,children:d?s:"Close"}),d?(0,nl.jsx)(b,{type:"submit",disabled:o||!c.name?.trim(),children:o?"Saving...":x}):(0,nl.jsxs)(b,{type:"button",onClick:f,disabled:o,className:"gap-2",children:[(0,nl.jsx)(Dl.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})]})}var _r=require("react-icons/fa");function bt({title:e,description:t,badge:a,primaryAction:o,secondaryAction:i,gradient:r,children:s,className:n}){let[c,l]=wr(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!i&&!t),d=!i&&!t||c;return(0,nl.jsxs)(mo.motion.div,{initial:{opacity:0,nl:20},animate:{opacity:1,nl:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${r} p-8 text-white ${n||""}`,children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,nl.jsx)(pe,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,nl.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,nl.jsxs)("div",{className:"flex items-center gap-3",children:[d&&o&&(0,nl.jsx)(b,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(i||t)&&(0,nl.jsx)("button",{"aria-label":c?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>l(!c),style:{lineHeight:0},children:c?(0,nl.jsx)(_r.FaChevronDown,{size:22}):(0,nl.jsx)(_r.FaChevronUp,{size:22})})]})]}),!d&&(0,nl.jsxs)("div",{className:"flex flex-col gap-6 nl:flex-row nl:items-center nl:justify-between",children:[(0,nl.jsxs)("div",{className:"space-nl-4",children:[(0,nl.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,nl.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,nl.jsx)(b,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),i&&(0,nl.jsx)(b,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:i.onClick,children:i.label})]})]}),s&&(0,nl.jsx)("div",{className:"hidden lg:block",children:s})]})]})}var Od=ne(require("react")),zi=ne(require("@radix-ui/react-progress"));var Vi=Od.forwardRef(({className:e,value:t,...a},o)=>(0,nl.jsx)(zi.Root,{ref:o,className:u("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,nl.jsx)(zi.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Vi.displayName=zi.Root.displayName;function ds({app:e,onOpen:t,onFavorite:a,showProgress:o=!1,className:i}){return(0,nl.jsx)(mo.motion.div,{whileHover:{scale:1.02,nl:-5},whileTap:{scale:.98},className:i,children:(0,nl.jsxs)(Y,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[(0,nl.jsx)($e,{className:"pb-2",children:(0,nl.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nl.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:e.icon}),e.new?(0,nl.jsx)(pe,{className:"rounded-xl bg-amber-500",children:"New"}):(0,nl.jsx)(b,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>a?.(e),children:(0,nl.jsx)(Dl.Star,{className:"h-4 w-4"})})]})}),(0,nl.jsxs)(ve,{className:"pb-2",children:[(0,nl.jsx)(Ze,{className:"text-lg",children:e.name}),(0,nl.jsx)(Pa,{children:e.description}),o&&e.progress<100&&(0,nl.jsxs)("div",{className:"Dl-2",children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,nl.jsx)("span",{children:"Installation"}),(0,nl.jsxs)("span",{children:[e.progress,"%"]})]}),(0,nl.jsx)(Vi,{value:e.progress,className:"h-2 Dl-1 rounded-xl"})]})]}),(0,nl.jsx)(ko,{children:(0,nl.jsx)(b,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>t?.(e),children:e.progress<100?"Continue Install":"Open"})})]})})}var au=e=>{if(!e||e<=0)return"0 KB";let t=e/1024;return t<1024?`${t.toFixed(2)} KB`:`${(t/1024).toFixed(2)} MB`};function ni({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:i=!0,className:r}){return(0,nl.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[i&&(0,nl.jsxs)("div",{className:"bg-muted/50 p-3 hidden nl:grid nl:grid-cols-10 text-sm font-medium",children:[(0,nl.jsx)("div",{className:"col-span-6",children:"Name"}),(0,nl.jsx)("div",{className:"col-span-2",children:"Size"}),(0,nl.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,nl.jsx)("div",{className:"divide-nl",children:e.map(s=>(0,nl.jsxs)(mo.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 nl:grid nl:grid-cols-10 items-center flex flex-col nl:flex-row gap-3 nl:gap-0 cursor-pointer",onClick:()=>t?.(s),children:[(0,nl.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full nl:w-auto",children:[(0,nl.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,nl.jsx)("div",{children:(0,nl.jsx)("p",{className:"font-medium",children:s.name})})]}),(0,nl.jsx)("div",{className:"col-span-2 text-sm nl:text-base",children:au(s.filesize)}),(0,nl.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full nl:w-auto",children:[(0,nl.jsx)("span",{className:"text-sm nl:text-base",children:new Date(s.createdAt).toLocaleDateString()}),(0,nl.jsx)("div",{className:"flex gap-1",children:(0,nl.jsx)(b,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:n=>{n.stopPropagation(),o?.(s)},children:(0,nl.jsx)(Dl.Trash2,{className:"h-4 w-4"})})})]})]},s.name))})]})}function $r({project:e,onOpen:t,onShare:a,className:o}){return(0,nl.jsx)(mo.motion.div,{whileHover:{scale:1.02,nl:-5},whileTap:{scale:.98},className:o,children:(0,nl.jsxs)(Y,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,nl.jsxs)($e,{children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nl.jsx)(Ze,{children:e.name}),(0,nl.jsxs)(pe,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,nl.jsx)(Pa,{children:e.description})]}),(0,nl.jsxs)(ve,{className:"space-nl-4",children:[(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,nl.jsx)("span",{children:"Progress"}),(0,nl.jsxs)("span",{children:[e.progress,"%"]})]}),(0,nl.jsx)(Vi,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,nl.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,nl.jsxs)("div",{className:"flex items-center",children:[(0,nl.jsx)(Dl.Users,{className:"mr-1 h-4 w-4"}),e.members," members"]}),(0,nl.jsxs)("div",{className:"flex items-center",children:[(0,nl.jsx)(Dl.FileText,{className:"mr-1 h-4 w-4"}),e.files," files"]})]})]}),(0,nl.jsxs)(ko,{className:"flex gap-2",children:[(0,nl.jsx)(b,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,nl.jsx)(b,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,nl.jsx)(Dl.Share2,{className:"h-4 w-4"})})]})]})})}var cs=[{name:"PixelMaster",icon:(0,nl.jsx)(Dl.ImageIcon,{className:"text-violet-500"}),description:"Advanced image editing and composition",category:"Creative",recent:!0,new:!1,progress:100},{name:"VectorPro",icon:(0,nl.jsx)(Dl.Brush,{className:"text-orange-500"}),description:"Professional vector graphics creation",category:"Creative",recent:!0,new:!1,progress:100},{name:"VideoStudio",icon:(0,nl.jsx)(Dl.Video,{className:"text-pink-500"}),description:"Cinematic video editing and production",category:"Video",recent:!0,new:!1,progress:100},{name:"MotionFX",icon:(0,nl.jsx)(Dl.Sparkles,{className:"text-blue-500"}),description:"Stunning visual effects and animations",category:"Video",recent:!1,new:!1,progress:100},{name:"PageCraft",icon:(0,nl.jsx)(Dl.Layers,{className:"text-red-500"}),description:"Professional page design and layout",category:"Creative",recent:!1,new:!1,progress:100},{name:"UXFlow",icon:(0,nl.jsx)(Dl.LayoutGrid,{className:"text-fuchsia-500"}),description:"Intuitive user experience design",category:"Design",recent:!1,new:!0,progress:85},{name:"PhotoLab",icon:(0,nl.jsx)(Dl.Camera,{className:"text-teal-500"}),description:"Advanced photo editing and organization",category:"Photography",recent:!1,new:!1,progress:100},{name:"DocMaster",icon:(0,nl.jsx)(Dl.FileText,{className:"text-red-600"}),description:"Document editing and management",category:"Document",recent:!1,new:!1,progress:100},{name:"WebCanvas",icon:(0,nl.jsx)(Dl.Code,{className:"text-emerald-500"}),description:"Web design and development",category:"Web",recent:!1,new:!0,progress:70},{name:"3DStudio",icon:(0,nl.jsx)(Dl.CuboidIcon,{className:"text-indigo-500"}),description:"3D modeling and rendering",category:"3D",recent:!1,new:!0,progress:60},{name:"FontForge",icon:(0,nl.jsx)(Dl.Type,{className:"text-amber-500"}),description:"Typography and font creation",category:"Typography",recent:!1,new:!1,progress:100},{name:"ColorPalette",icon:(0,nl.jsx)(Dl.Palette,{className:"text-purple-500"}),description:"Color scheme creation and management",category:"Design",recent:!1,new:!1,progress:100}],Kd=[{id:1,filename:"Brand Redesign.pxm",filesize:24.5,url:"https://example.com/brand-redesign.pxm",mimeType:"image/png",name:"Brand Redesign.pxm",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:2,filename:"Company Logo.vec",filesize:8.2,url:"https://example.com/company-logo.vec",mimeType:"image/svg+xml",name:"Company Logo.vec",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:3,filename:"Product Launch Video.vid",filesize:1.2,url:"https://example.com/product-launch-video.vid",mimeType:"video/mp4",name:"Product Launch Video.vid",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:4,filename:"UI Animation.mfx",filesize:345,url:"https://example.com/ui-animation.mfx",mimeType:"video/mp4",name:"UI Animation.mfx",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:5,filename:"Magazine Layout.pgc",filesize:42.8,url:"https://example.com/magazine-layout.pgc",mimeType:"image/png",name:"Magazine Layout.pgc",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:6,filename:"Mobile App Design.uxf",filesize:18.3,url:"https://example.com/mobile-app-design.uxf",mimeType:"image/png",name:"Mobile App Design.uxf",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:7,filename:"Product Photography.phl",filesize:156,url:"https://example.com/product-photography.phl",mimeType:"image/png",name:"Product Photography.phl",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1}];var _d=[{title:"Mastering Digital Illustration",description:"Learn advanced techniques for creating stunning digital art",duration:"1h 45m",level:"Advanced",instructor:"Sarah Chen",category:"Illustration",views:"24K"},{title:"UI/UX Design Fundamentals",description:"Essential principles for creating intuitive user interfaces",duration:"2h 20m",level:"Intermediate",instructor:"Michael Rodriguez",category:"Design",views:"56K"},{title:"Video Editing Masterclass",description:"Professional techniques for cinematic video editing",duration:"3h 10m",level:"Advanced",instructor:"James Wilson",category:"Video",views:"32K"},{title:"Typography Essentials",description:"Create beautiful and effective typography for any project",duration:"1h 30m",level:"Beginner",instructor:"Emma Thompson",category:"Typography",views:"18K"},{title:"Color Theory for Designers",description:"Understanding color relationships and psychology",duration:"2h 05m",level:"Intermediate",instructor:"David Kim",category:"Design",views:"41K"}];var Gd=[{id:"home",title:"Home",icon:(0,nl.jsx)(Dl.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,nl.jsx)(Dl.Users,{}),maxItems:2,items:[{id:"design",title:"Design",url:"#"},{id:"marketing",title:"Marketing",url:"#"},{id:"finance",title:"Finance",url:"#"},{id:"engineering",title:"Engineering",url:"#"},{id:"sales",title:"Sales",url:"#"}]},{id:"projects",title:"Projects",icon:(0,nl.jsx)(Dl.Layers,{}),badge:"4",maxItems:2,items:[{id:"active-projects",title:"Active Projects",url:"#",badge:"4"},{id:"archived",title:"Archived",url:"#"},{id:"templates",title:"Templates",url:"#"},{id:"drafts",title:"Drafts",url:"#"},{id:"shared",title:"Shared with nl",url:"#",badge:"2"}]},{id:"copilot",title:"Copilot",icon:(0,nl.jsx)(Dl.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,nl.jsx)(Dl.FileText,{}),url:"/knowledge"}],Wd=[{id:"1",title:"New comment on your post",description:"Alex Morgan commented on your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{id:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project is due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{id:"3",title:"File shared with you",description:"Emma Thompson shared 'Brand Guidelines.pdf' with you.",time:"1 hour ago",read:!1,type:"info",actionLabel:"Open file",onAction:()=>console.log("Open file clicked")},{id:"4",title:"Update successful",description:"PixelMaster has been updated Dl version 2.4.0.",time:"3 hours ago",read:!0,type:"success",actionLabel:"See what's new",onAction:()=>console.log("See what's new clicked")},{id:"5",title:"Storage limit reached",description:"You've used 95% of your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{id:"6",title:"Weekly summary",description:"Check out your activity summary for the past week.",time:"2 days ago",read:!0,type:"info",actionLabel:"View summary",onAction:()=>console.log("View summary clicked")},{id:"7",title:"New tutorial available",description:"A new tutorial on 'Advanced Animation Techniques' is now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}];var di=[{id:1,name:"E-commerce Platform",description:"Main customer-facing e-commerce application",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:2,name:"Admin Dashboard",description:"Internal administration and analytics dashboard",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:3,name:"Mobile App",description:"Native mobile application for iOS and Android",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}];var ms=[{id:1,name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:3,name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],Gr=[{id:1,name:"Backlog",description:"Tasks not yet assigned Dl a sprint",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:3,name:"Sprint 1",description:"Initial development phase",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,name:"Sprint 2",description:"Feature development",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],qr=[{id:1,name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",dateLogged:new Date().toString(),index:1,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"John Doe"},createdAt:new Date().toString()},{id:2,name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",dateLogged:new Date().toString(),index:2,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jane Smith"},createdAt:new Date().toString()},{id:3,name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:3,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Mike Johnson"},createdAt:new Date().toString()},{id:4,name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",dateLogged:new Date().toString(),index:4,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Sarah Wilson"},createdAt:new Date().toString()},{id:5,name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",dateLogged:new Date().toString(),index:5,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Alex Brown"},createdAt:new Date().toString()},{id:6,name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",dateLogged:new Date().toString(),index:6,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Emma Davis"},createdAt:new Date().toString()},{id:7,name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:7,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Tom Wilson"},createdAt:new Date().toString()}],ou=[...qr,{id:8,name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:8,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"1"},createdAt:new Date().toString()},{id:9,name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",dateLogged:new Date().toString(),index:9,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Taylor Swift"},createdAt:new Date().toString()},{id:10,name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",dateLogged:new Date().toString(),index:10,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jordan Smith"},createdAt:new Date().toString()},{id:11,name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:11,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Morgan Davis"},createdAt:new Date().toString()},{id:12,name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:12,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Casey Johnson"},createdAt:new Date().toString()}],iu=[{id:4,name:"Analytics Platform",description:"Business intelligence and reporting system",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:5,name:"API Gateway",description:"Microservices API management layer",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}],Wr={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:[]},$d={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:qr.filter(e=>typeof e.epic=="object"?e.epic?.id===1:e.epic===1)};var Wb={empty:{initialProjects:Wr.projects,initialEpics:Wr.epics,initialSprints:Wr.sprints,initialTasks:Wr.tasks},default:{initialProjects:di,initialEpics:ms,initialSprints:Gr,initialTasks:qr},highDensity:{initialProjects:di,initialEpics:ms,initialSprints:Gr,initialTasks:ou},singleEpic:{initialProjects:di,initialEpics:$d.epics,initialSprints:Gr,initialTasks:$d.tasks},multipleProjects:{initialProjects:iu,initialEpics:ms,initialSprints:Gr,initialTasks:qr}},Jr=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,type:"digital",name:"CodeAssist Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,type:"digital",name:"MarketingBot",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:6,type:"digital",name:"DataAnalyzer Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:3}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:7,type:"digital",name:"ProjectManager AI",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:4},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:8,type:"digital",name:"CustomerSupport Bot",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond Dl customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases Dl human agents.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1}],Jb=[{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).toString(),dueTime:"14:30",assignedColleague:Jr.find(e=>e.id==="2"&&e.type==="digital"),isRecurring:!1,createdAt:new Date(2024,2,10).toString(),updatedAt:new Date(2024,2,10).toString(),project:di[0]},{id:2,title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18).toString(),dueTime:"10:00",assignedColleague:Jr.find(e=>e.id==="4"&&e.type==="digital"),createdAt:new Date(2024,2,11).toString(),updatedAt:new Date(2024,2,11).toString(),project:di[0]},{id:3,title:"Deploy Dl production",description:"Deploy the latest version Dl production environment",dueDate:new Date().toString(),dueTime:"16:00",assignedColleague:Jr.find(e=>e.id==="2"&&e.type==="digital"),createdAt:new Date().toString(),updatedAt:new Date().toString(),project:di[0]}];var qb=Jr.filter(e=>e.type==="digital");function Jd({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[i,r]=(0,or.useState)(""),s=(0,or.useMemo)(()=>e.filter(c=>c.name?.toLowerCase().includes(i.toLowerCase())||c.email.toLowerCase().includes(i.toLowerCase())),[e,i]),n=c=>{t(c)};return(0,nl.jsx)("div",{className:"px-2 nl:px-4 py-4 space-nl-6",children:(0,nl.jsx)(mo.AnimatePresence,{mode:"wait",children:(0,nl.jsxs)(mo.motion.div,{initial:{opacity:0,nl:10},animate:{opacity:1,nl:0},exit:{opacity:0,nl:-10},transition:{duration:.2},children:[(0,nl.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,nl.jsxs)(b,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,nl.jsx)(Dl.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,nl.jsxs)("div",{children:[(0,nl.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,nl.jsx)("p",{className:"text-muted-foreground",children:"Choose a user Dl add as a colleague"})]})]}),(0,nl.jsx)(Y,{className:"container",children:(0,nl.jsx)(ve,{className:"Te-6",children:(0,nl.jsx)("div",{className:"flex flex-col nl:flex-row gap-4",children:(0,nl.jsx)("div",{className:"flex-1",children:(0,nl.jsxs)("div",{className:"relative",children:[(0,nl.jsx)(Dl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,nl.jsx)(G,{placeholder:"Search users by name, email, role, or skills...",value:i,onChange:c=>r(c.target.value),className:"pl-9"})]})})})})}),(0,nl.jsx)("div",{className:"container grid gap-4 nl:grid-cols-2 lg:grid-cols-3",children:s.map(c=>(0,nl.jsx)(mo.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,nl.jsxs)(Y,{className:`cursor-pointer transition-all hover:shadow-lg ${o===c.id?"ring-2 ring-primary":""}`,onClick:()=>n(c),children:[(0,nl.jsx)($e,{className:"pb-3",children:(0,nl.jsxs)("div",{className:"flex items-start justify-between",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-3",children:[(0,nl.jsx)(ra,{children:(0,nl.jsx)(na,{children:(0,nl.jsx)(Dl.User,{className:"h-4 w-4"})})}),(0,nl.jsx)("div",{children:(0,nl.jsx)(Ze,{className:"text-lg",children:c.name})})]}),o===c.id&&(0,nl.jsx)(Dl.Check,{className:"h-5 w-5 text-primary"})]})}),(0,nl.jsx)(ve,{className:"Te-0",children:(0,nl.jsxs)("div",{className:"space-nl-3",children:[(0,nl.jsxs)("div",{children:[(0,nl.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,nl.jsx)("p",{className:"text-sm font-medium",children:c.email})]}),(0,nl.jsx)("div",{children:(0,nl.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"})})]})})]})},c.id))}),s.length===0&&(0,nl.jsx)(Y,{className:"container Dl-4",children:(0,nl.jsx)(ve,{className:"Te-6",children:(0,nl.jsxs)("div",{className:"text-center py-8",children:[(0,nl.jsx)(Dl.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,nl.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,nl.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function ps(...e){return ar((0,rl.clsx)(e))}function _i({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:i=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:s,availableUsers:n=[],existingDigitalColleagues:c=[],availableKnowledgeDocuments:l=[]}){let[d,m]=(0,or.useState)(e||[]),[g,f]=(0,or.useState)(""),[h,x]=(0,or.useState)("all"),[p,S]=(0,or.useState)("all"),[P,w]=(0,or.useState)("all"),[D,W]=(0,or.useState)(null),[A,j]=(0,or.useState)(null);(0,or.useEffect)(()=>{m(e||[])},[e]);let C=Array.isArray(n)?n:[],F=Array.isArray(c)?c:[],[q,O]=(0,or.useState)("main"),T=d.filter(H=>!H||!H.name?!1:H.name.toLowerCase().includes(g.toLowerCase())||H.type==="human"&&H.email?.toLowerCase().includes(g.toLowerCase())||H.type==="digital"&&H.jobDescription?.toLowerCase().includes(g.toLowerCase())),Re=T.filter(H=>H.type==="human"),R=T.filter(H=>H.type==="digital"),M=()=>{O("typeSelection")},K=H=>{H.type==="digital"&&(W(H),O("form")),console.log("Editing colleague:",H),a?.(H)},B=H=>{H.type==="digital"&&(j(H),O("view"))},Le=H=>{let Je={id:`human-${Date.now()}`,type:"human",name:H.name,email:H.email,updatedAt:H.updatedAt,createdAt:H.createdAt,accounts:H.accounts};m(fa=>[...fa,Je]),t?.(Je),O("main")},nt=H=>{if(!H||!H.id){console.error("Invalid cloned colleague provided Dl handleDigitalColleagueClone:",H);return}m(Je=>[...Je,{...H,type:"digital"}]),t?.({...H,type:"digital"}),O("main")},_=()=>{W(null),O("form")},k=H=>{if(!H||!H.id){console.error("Invalid colleague provided Dl handleSaveColleague:",H);return}D?(m(Je=>Je.map(fa=>fa.id===H.id?{...H,type:"digital"}:fa)),a?.({...H,type:"digital"})):(m(Je=>[...Je,{...H,type:"digital"}]),t?.({...H,type:"digital"})),O("main"),W(null)},z=()=>{O("main"),W(null),j(null)},de=()=>{O("main"),j(null)},He=()=>{A&&(W(A),j(null),O("form"))},De=H=>{console.log("deleting",H,d),o?.(H,d.find(Je=>Je.id.toString()===H.toString())?.type),m(Je=>Je.filter(fa=>fa.id!==H))},Ct=()=>{f(""),x("all"),S("all")};return q==="typeSelection"?(0,nl.jsx)(jr,{onSelectHuman:()=>O("userSelection"),onSelectDigital:()=>O("digitalOptions"),onCancel:()=>O("main")}):q==="userSelection"?(0,nl.jsx)(Jd,{users:C,onUserSelect:Le,onCancel:()=>O("typeSelection")}):q==="digitalOptions"?(0,nl.jsx)(zr,{onCloneExisting:()=>O("digitalClone"),onCreateNew:_,onCancel:()=>O("typeSelection")}):q==="digitalClone"?(0,nl.jsx)(Ur,{digitalColleagues:F,onColleagueClone:nt,onCancel:()=>O("digitalOptions")}):q==="form"?(0,nl.jsx)(Fi,{colleague:D||void 0,onSave:k,onCancel:z,availableKnowledgeDocuments:l}):q==="view"?(0,nl.jsx)(Fi,{colleague:A||void 0,onSave:k,onCancel:de,readOnly:!0,availableKnowledgeDocuments:l}):(0,nl.jsx)("div",{className:"px-2 nl:px-4 py-4 space-nl-8",children:(0,nl.jsx)(mo.AnimatePresence,{mode:"wait",children:(0,nl.jsx)(mo.motion.div,{initial:{opacity:0,nl:10},animate:{opacity:1,nl:0},exit:{opacity:0,nl:-10},transition:{duration:.2},children:(0,nl.jsxs)("div",{className:`space-nl-6 ${s||""}`,children:[(0,nl.jsx)(bt,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-Dl-r from-green-600 via-emerald-600 Dl-teal-600",primaryAction:{label:"Add colleague",onClick:M}}),(0,nl.jsxs)("div",{className:"grid grid-cols-1 nl:grid-cols-3 gap-4",children:[(0,nl.jsxs)(Y,{children:[(0,nl.jsxs)($e,{className:"flex flex-row items-center justify-between space-nl-0 pb-2",children:[(0,nl.jsx)(Ze,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,nl.jsx)(Dl.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,nl.jsxs)(ve,{children:[(0,nl.jsx)("div",{className:"text-2xl font-bold",children:d.length}),(0,nl.jsx)("p",{className:"text-nl text-muted-foreground",children:"0 active"})]})]}),(0,nl.jsxs)(Y,{children:[(0,nl.jsxs)($e,{className:"flex flex-row items-center justify-between space-nl-0 pb-2",children:[(0,nl.jsx)(Ze,{className:"text-sm font-medium",children:"Human Members"}),(0,nl.jsx)(Dl.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,nl.jsxs)(ve,{children:[(0,nl.jsx)("div",{className:"text-2xl font-bold",children:d.filter(H=>H.type==="human").length}),(0,nl.jsx)("p",{className:"text-nl text-muted-foreground",children:"active"})]})]}),(0,nl.jsxs)(Y,{children:[(0,nl.jsxs)($e,{className:"flex flex-row items-center justify-between space-nl-0 pb-2",children:[(0,nl.jsx)(Ze,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,nl.jsx)(Dl.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,nl.jsxs)(ve,{children:[(0,nl.jsx)("div",{className:"text-2xl font-bold",children:d.filter(H=>H.type==="digital").length}),(0,nl.jsx)("p",{className:"text-nl text-muted-foreground",children:"0 active"})]})]})]}),(0,nl.jsx)(Y,{children:(0,nl.jsx)(ve,{className:"Te-6",children:(0,nl.jsxs)("div",{className:"flex flex-col nl:flex-row gap-4",children:[(0,nl.jsx)("div",{className:"flex-1",children:(0,nl.jsxs)("div",{className:"relative",children:[(0,nl.jsx)(Dl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,nl.jsx)(G,{placeholder:"Search colleagues...",value:g,onChange:H=>f(H.target.value),className:"pl-9"})]})}),(0,nl.jsxs)(dt,{value:h,onValueChange:x,children:[(0,nl.jsx)(tt,{className:"w-full nl:w-[180px]",children:(0,nl.jsx)(Dt,{placeholder:"Department"})}),(0,nl.jsxs)(at,{children:[(0,nl.jsx)(ye,{value:"all",children:"All Departments"}),r.map(H=>(0,nl.jsx)(ye,{value:H,children:H},H))]})]}),(0,nl.jsxs)(dt,{value:p,onValueChange:S,children:[(0,nl.jsx)(tt,{className:"w-full nl:w-[140px]",children:(0,nl.jsx)(Dt,{placeholder:"Status"})}),(0,nl.jsxs)(at,{children:[(0,nl.jsx)(ye,{value:"all",children:"All Status"}),(0,nl.jsx)(ye,{value:"active",children:"Active"}),(0,nl.jsx)(ye,{value:"inactive",children:"Inactive"})]})]}),(g||h!=="all"||p!=="all")&&(0,nl.jsxs)(b,{variant:"outline",onClick:Ct,className:"gap-2",children:[(0,nl.jsx)(Dl.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,nl.jsxs)("div",{className:"space-nl-4",children:[(0,nl.jsx)(Yo,{activeTab:P,onTabChange:w,tabOptions:[{value:"all",label:`All (${T.length})`},{value:"human",label:`Human (${Re.length})`},{value:"digital",label:`Digital (${R.length})`}],maxWidth:"400px",gridCols:3}),P==="all"&&(0,nl.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 nl:grid-cols-2 lg:grid-cols-4":"grid-cols-1 nl:grid-cols-2 lg:grid-cols-3"}`,children:T.map(H=>(0,nl.jsx)(ti,{colleague:H,onEdit:K,onDelete:De,onViewDetails:B,compact:i,className:ps([H.type==="digital"&&"border-teal-400"])},`${H}-${H.id}`))}),P==="human"&&(0,nl.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 nl:grid-cols-2 lg:grid-cols-4":"grid-cols-1 nl:grid-cols-2 lg:grid-cols-3"}`,children:Re.map(H=>(0,nl.jsx)(ti,{colleague:H,onEdit:K,onDelete:De,onViewDetails:B,compact:i},H.id))}),P==="digital"&&(0,nl.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 nl:grid-cols-2 lg:grid-cols-4":"grid-cols-1 nl:grid-cols-2 lg:grid-cols-3"}`,children:R.map(H=>(0,nl.jsx)(ti,{colleague:H,onEdit:K,onDelete:De,onViewDetails:B,compact:i,className:ps([H.type==="digital"&&"border-teal-400"])},H.id))})]}),T.length===0&&(0,nl.jsx)(Y,{children:(0,nl.jsx)(ve,{className:"Te-6",children:(0,nl.jsxs)("div",{className:"text-center py-8",children:[(0,nl.jsx)(Dl.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,nl.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,nl.jsx)("p",{className:"text-muted-foreground mb-4",children:g||h!=="all"||p!=="all"?"Try adjusting your filters Dl see more results.":"Get started by adding your first colleague."}),(0,nl.jsxs)(b,{onClick:M,className:"gap-2",children:[(0,nl.jsx)(Dl.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}var Ec=ne(require("@radix-ui/react-dialog"));var ci=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:i,className:r="",disabled:s=!1})=>{let[n,c]=(0,or.useState)(!1),[l,d]=(0,or.useState)(""),m=()=>{s||(c(!0),d(t))},g=async()=>{l!==t&&await i(e,l),c(!1)},f=h=>{h.key==="Enter"&&!o||h.key==="Enter"&&h.ctrlKey&&o?g():h.key==="Escape"&&(c(!1),d(""))};return(0,nl.jsxs)("div",{className:`space-nl-2 ${r}`,children:[(0,nl.jsx)(E,{children:a}),n?o?(0,nl.jsx)(ze,{value:l,onChange:h=>d(h.target.value),onBlur:g,onKeyDown:f,autoFocus:!0,rows:4,className:"resize-none"}):(0,nl.jsx)(G,{value:l,onChange:h=>d(h.target.value),onBlur:g,onKeyPress:f,autoFocus:!0,className:"text-lg font-medium"}):(0,nl.jsxs)("div",{onClick:m,className:`${s?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${o?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,nl.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click Dl edit..."}),!s&&(0,nl.jsx)(Dl.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var Nc=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),Cc=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),Sc=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),Dc=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),Tc=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),kc=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),Pc=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),en=require("@payloadcms/richtext-lexical/lexical/list"),Rc=require("@payloadcms/richtext-lexical/lexical/rich-text"),Ac=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var yc=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),Ji=require("@payloadcms/richtext-lexical/lexical/utils"),Te=require("@payloadcms/richtext-lexical/lexical"),Cs=require("@payloadcms/richtext-lexical/lexical/selection");var nc=require("@radix-ui/react-dialog"),Zr=require("@payloadcms/richtext-lexical/client");var gs=ne(require("bson-objectid"));var Yd=require("@payloadcms/ui");var ru=e=>{let{data:{relationTo:t,value:a},nodeKey:o}=e,[i]=(0,yc.useLexicalComposerContext)(),[r,s]=(0,or.useState)(""),[n,c]=(0,or.useState)(""),[l,d]=(0,or.useState)(""),m=async p=>{console.log("fetchMedia",p)};(0,or.useEffect)(()=>{typeof a=="string"?a.length===24?m(a):(s(a||""),d(x(h())),c(f()||"")):typeof a=="object"&&(s(`${process.env.NEXT_PUBLIC_API_URL}${a.url}`||""),d(x(a.filesize)),c(a.mimeType?.split("/")[1]||""))},[]);let g=(0,or.useCallback)(()=>{i.update(()=>{(0,Te.$getNodeByKey)(o)?.remove()})},[i,o]),f=()=>{let p=e.data.value;return typeof p=="string"?p.split(";base64")[0]?.split("image/")[1]:""},h=()=>{let p=e.data.value;if(typeof p=="string"){let S=p.split(",")[1]?.length||0;return 4*Math.ceil(S/3)*.5624896334383812/1e3}return 0};function x(p){if(p>=1e6){let P=p/1e6;return`${P>=10?Math.round(P).toString():P.toFixed(1)} MB`}return`${Math.floor(p/1e3)} KB`}return(0,nl.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,nl.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,nl.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,nl.jsx)("div",{className:"flex-1",children:e.data.value?(0,nl.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":a,"data-lexical-upload-relation-Dl":t,src:r}):(0,nl.jsx)(Yd.File,{})}),(0,nl.jsx)(La,{children:(0,nl.jsxs)(Fa,{children:[(0,nl.jsxs)(Oa,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,nl.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,nl.jsx)("button",{onClick:p=>{p.preventDefault(),g()},className:"flex-1 flex justify-center items-center",children:(0,nl.jsx)(Dl.nl,{width:24,height:24,strokeWidth:1})})]}),(0,nl.jsx)(Ta,{children:(0,nl.jsx)("span",{children:"Remove image"})})]})})]}),(0,nl.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-nl font-bold",children:[(0,nl.jsx)("span",{className:"",children:n?.toLocaleUpperCase()}),(0,nl.jsx)("span",{children:l})]})]})})},tc=ru;function nu(e){if(e.hasAttribute("data-lexical-upload-relation-Dl")&&e.hasAttribute("data-lexical-upload-id")){let a=e.getAttribute("data-lexical-upload-id");if(a)return{node:mi({fields:{},relationTo:"media",value:a})}}return e.src.startsWith("file:///"),null}var $i=class extends Zr.UploadNode{static importDOM(){return{img:()=>({conversion:nu,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new gs.default().toHexString(),t.version=3);let a={id:t.id??new gs.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},o=mi(a);return o.setFormat?.(t.format),o}decorate(){return(0,nl.jsx)(tc,{data:this.__data,nodeKey:this.getKey()})}};function mi(e){return new $i({data:e})}var su=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",lu=e=>su?(e||window).getSelection():null,Ox=(0,Te.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),fs=(0,Te.createCommand)("INSERT_UPLOAD_COMMAND");function sc({activeEditor:e,onClose:t,isOpen:a=!1}){let o=(0,or.useRef)(!1),[i,r]=(0,or.useState)(!0),[s,n]=(0,or.useState)(""),[c,l]=(0,or.useState)(""),[d,m]=(0,or.useState)(!1),[g,f]=(0,or.useState)("left"),h=s==="",x=D=>{m(D.target.checked)},p=D=>{f(D.target.value)},S=D=>{let W=new FileReader;W.onload=function(){return typeof W.result=="string"&&n(W.result),""},D!==null&&D[0]&&W.readAsDataURL(D[0])};(0,or.useEffect)(()=>{o.current=!1;let D=W=>{o.current=W.altKey};return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[e]),(0,or.useEffect)(()=>{i||t()},[i]),(0,or.useEffect)(()=>{r(a)},[a]);let P=({editor:D,relationTo:W,replaceNodeKey:A,value:j})=>{if(A)D.update(()=>{let C=(0,Te.$getNodeByKey)(A);C&&C.replace(mi({id:"",fields:{},relationTo:"media",value:j}))});else{let C=D.dispatchCommand(fs,{fields:null,relationTo:"media",value:j})}},w=()=>{P({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:c,src:s,showCaption:d,position:g}.src}),r(!1),t()};return(0,nl.jsx)(Ge,{open:i,onOpenChange:D=>r(D),children:(0,nl.jsxs)(qe,{children:[(0,nl.jsxs)(Xe,{children:[(0,nl.jsx)(Ye,{children:"Upload Image"}),(0,nl.jsx)(nc.DialogDescription,{children:"Description"})]}),(0,nl.jsxs)("div",{className:"",children:[(0,nl.jsx)("div",{style:{marginBottom:"1em"},children:(0,nl.jsx)(G,{type:"file",onChange:D=>S(D.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,nl.jsx)("div",{style:{marginBottom:"1em"},children:(0,nl.jsx)(G,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:D=>l(D.currentTarget.value),value:c,"data-test-id":"image-modal-alt-text-input"})}),(0,nl.jsx)(b,{"data-test-id":"image-modal-file-upload-btn",disabled:h,onClick:()=>w(),children:"Confirm"})]})]})})}function vs({captionsEnabled:e}){let[t]=(0,yc.useLexicalComposerContext)();return(0,or.useEffect)(()=>{if(!t.hasNodes([Zr.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,Ji.mergeRegister)(t.registerCommand(Te.DRAGSTART_COMMAND,a=>du(a),Te.COMMAND_PRIORITY_HIGH),t.registerCommand(Te.DRAGOVER_COMMAND,a=>cu(a),Te.COMMAND_PRIORITY_LOW),t.registerCommand(Te.DROP_COMMAND,a=>mu(a,t),Te.COMMAND_PRIORITY_HIGH))},[e,t]),null}function du(e){if(!hs())return!1;let a=e.dataTransfer;return a?(a.setData("text/plain","_"),!0):!1}function cu(e){return hs()?(lc(e)||e.preventDefault(),!0):!1}function mu(e,t){let a=hs();if(!a)return!1;if(e.preventDefault(),lc(e)){let o=pu(e);a.remove();let i=(0,Te.$createRangeSelection)();o!=null&&i.applyDOMRange(o),(0,Te.$setSelection)(i)}return!0}function hs(){let e=(0,Te.$getSelection)();if(!(0,Te.$isNodeSelection)(e))return null;let a=e.getNodes()[0];return(0,Zr.$isUploadNode)(a)?a:null}function lc(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function pu(e){let t,a=e.target,o=a==null?null:a.nodeType===9?a.defaultView:a.ownerDocument.defaultView,i=lu(o);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&i!==null)i.collapse(e.rangeParent,e.rangeOffset||0),t=i.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var uu=()=>(0,nl.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,nl.jsx)("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),dc=uu;var gu=()=>(0,nl.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,nl.jsx)("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),cc=gu;var fu=()=>(0,nl.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,nl.jsx)("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,nl.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),mc=fu;var vu=()=>(0,nl.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,nl.jsx)("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,nl.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),pc=vu;var hu=()=>(0,nl.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,nl.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),uc=hu;var bu=()=>(0,nl.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,nl.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),gc=bu;var fc=()=>(0,nl.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,nl.jsx)("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),vc=()=>(0,nl.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,nl.jsx)("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),hc=()=>(0,nl.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,nl.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),bc=()=>(0,nl.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,nl.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),xc=()=>(0,nl.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,nl.jsx)("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var Ns=1;function xu(){return(0,nl.jsx)("span",{className:"border border-[#222222]"})}function Ss(){let[e]=(0,yc.useLexicalComposerContext)(),t=(0,or.useRef)(null),[a,o]=(0,or.useState)(!1),[i,r]=(0,or.useState)(!1),[s,n]=(0,or.useState)(!1),[c,l]=(0,or.useState)(!1),[d,m]=(0,or.useState)(!1),[g,f]=(0,or.useState)(!1),[h,x]=(0,or.useState)(!1),[p,S]=(0,or.useState)(!1),[P,w]=(0,or.useState)(!1),[D,W]=(0,or.useState)("left"),[A,j]=(0,or.useState)("p"),C=M=>{e.update(()=>{let K=(0,Te.$getSelection)();(0,Te.$isRangeSelection)(K)&&(M==="p"?(0,Cs.$setBlocksType)(K,()=>(0,Te.$createParagraphNode)()):(0,Cs.$setBlocksType)(K,()=>(0,Rc.$createHeadingNode)(M)))})},F=(0,or.useCallback)(()=>{let M=(0,Te.$getSelection)();if((0,Te.$isRangeSelection)(M)){n(M.hasFormat("bold")),l(M.hasFormat("italic")),m(M.hasFormat("underline")),f(M.hasFormat("strikethrough")),x(M.hasFormat("subscript")),S(M.hasFormat("superscript"));let K=M.anchor.getNode(),B=K;for(;B&&!(0,Te.$isParagraphNode)(B)&&B!==(0,Te.$getRoot)();){let nt=B.getParent();nt&&(B=nt)}if(B){let nt=B.getFormatType();W(nt||"left")}let Le=K.getTopLevelElement()?.__tag;j(Le||"p")}},[]);(0,or.useEffect)(()=>(0,Ji.mergeRegister)(e.registerUpdateListener(({editorState:M})=>{M.read(()=>{F()})}),e.registerCommand(Te.SELECTION_CHANGE_COMMAND,(M,K)=>(F(),!1),Ns),e.registerCommand(Te.CAN_UNDO_COMMAND,M=>(o(M),!1),Ns),e.registerCommand(Te.CAN_REDO_COMMAND,M=>(r(M),!1),Ns),(0,Ji.mergeRegister)(e.registerCommand(fs,M=>(e.update(()=>{let K=(0,Te.$getSelection)()||(0,Te.$getPreviousSelection)();if((0,Te.$isRangeSelection)(K)){let B=mi({id:M.id,fields:M.fields,relationTo:M.relationTo,value:M.value}),{focus:Le}=K,nt=Le.getNode();(0,Ji.$insertNodeToNearestRoot)(B),(0,Te.$isParagraphNode)(nt)&&!nt.__first&&nt.remove()}}),!0),Te.COMMAND_PRIORITY_EDITOR))),[e,F]);let q=[[{label:"Undo",icon:(0,nl.jsx)(Dl.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Te.UNDO_COMMAND,void 0)},disabled:!a},{label:"Redo",icon:(0,nl.jsx)(Dl.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Te.UNDO_COMMAND,void 0)},disabled:!i}],[{label:"Bold",icon:(0,nl.jsx)(dc,{}),onClick:()=>{e.dispatchCommand(Te.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:s},{label:"Italic",icon:(0,nl.jsx)(cc,{}),onClick:()=>{e.dispatchCommand(Te.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:c},{label:"Underline",icon:(0,nl.jsx)(mc,{}),onClick:()=>{e.dispatchCommand(Te.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:d},{label:"Strikethrough",icon:(0,nl.jsx)(pc,{}),onClick:()=>{e.dispatchCommand(Te.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:g},{label:"Subscript",icon:(0,nl.jsx)(uc,{}),onClick:()=>{e.dispatchCommand(Te.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:h},{label:"Superscript",icon:(0,nl.jsx)(gc,{}),onClick:()=>{e.dispatchCommand(Te.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:p}]],O=[{label:"Left Align",direction:"left",icon:(0,nl.jsx)(Dl.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Te.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,nl.jsx)(Dl.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Te.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,nl.jsx)(Dl.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Te.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,nl.jsx)(Dl.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Te.FORMAT_ELEMENT_COMMAND,"justify")}}],Re=[{label:"Normal Text",value:"p",icon:(0,nl.jsx)(fc,{}),onClick:()=>C("p")},{label:"Heading 1",value:"h1",icon:(0,nl.jsx)(vc,{}),onClick:()=>C("h1")},{label:"Heading 2",value:"h2",icon:(0,nl.jsx)(hc,{}),onClick:()=>C("h2")},{label:"Heading 3",value:"h3",icon:(0,nl.jsx)(bc,{}),onClick:()=>C("h3")},{label:"Heading 4",value:"h4",icon:(0,nl.jsx)(xc,{}),onClick:()=>C("h4")},...[{label:"Unordered List",value:"nl",icon:(0,nl.jsx)(Dl.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(en.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,nl.jsx)(Dl.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(en.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],R=[{label:"Insert Image",icon:(0,nl.jsx)(Dl.ImageUp,{width:15,height:15}),onClick:()=>{w(!0)},disabled:!1}];return(0,nl.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black z-50",children:(0,nl.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[q.map((M,K)=>(0,nl.jsxs)(or.Fragment,{children:[(0,nl.jsx)("div",{className:"flex items-center gap-2",children:M.map((B,Le)=>(0,nl.jsx)("div",{role:"button","aria-disabled":B.disabled||!1,onClick:B.onClick,className:u("p-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",B.active&&"bg-[#3c3c3c]"),"aria-label":B.label,children:(0,nl.jsx)(La,{children:(0,nl.jsxs)(Fa,{children:[(0,nl.jsx)(Oa,{className:"text-[#b5b5b5]",children:B.icon}),(0,nl.jsx)(Ta,{children:(0,nl.jsx)("p",{children:B.label})})]})})},Le))}),(0,nl.jsx)(xu,{})]},`toolbar-option-${M.length}-${K}`)),(0,nl.jsxs)(sa,{children:[(0,nl.jsxs)(la,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-nl",children:[O.find(M=>M.direction===D)?.icon,O.find(M=>M.direction===D)?.label,(0,nl.jsx)(Dl.ChevronDown,{width:15,height:15})]}),(0,nl.jsx)(ea,{className:"bg-black hover:bg-black",children:O.map((M,K)=>(0,nl.jsxs)(Vt,{onClick:M.onClick,className:"flex items-center gap-2 text-nl text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,nl.jsx)("span",{children:M.icon}),(0,nl.jsx)("span",{children:M.label})]},`${M.label}-${K}`))})]}),(0,nl.jsxs)(sa,{children:[(0,nl.jsxs)(la,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-nl",children:[Re.find(M=>M.value===A)?.icon,Re.find(M=>M.value===A)?.label,(0,nl.jsx)(Dl.ChevronDown,{width:15,height:15})]}),(0,nl.jsx)(ea,{className:"bg-black hover:bg-black",children:Re.map((M,K)=>(0,nl.jsxs)(Vt,{onClick:M.onClick,className:"flex items-center gap-2 text-nl text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,nl.jsx)("span",{children:M.icon}),(0,nl.jsx)("span",{children:M.label})]},`heading-option-${M.label}-${K}`))})]}),(0,nl.jsxs)(sa,{children:[(0,nl.jsxs)(la,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-nl",children:[(0,nl.jsx)(Dl.Plus,{width:15,height:15}),(0,nl.jsx)(Dl.ChevronDown,{width:15,height:15})]}),(0,nl.jsx)(ea,{className:"bg-black hover:bg-black",children:R.map((M,K)=>(0,nl.jsxs)(Vt,{onClick:M.onClick,disabled:M.disabled,className:"flex items-center gap-2 text-nl text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,nl.jsx)("span",{children:M.icon}),(0,nl.jsx)("span",{children:M.label})]},K))})]}),P&&(0,nl.jsx)(sc,{activeEditor:e,onClose:()=>{w(!1)},isOpen:P})]})})}var yu=({setValue:e,value:t,name:a,editable:o=!0})=>{let[i]=(0,yc.useLexicalComposerContext)(),r=s=>{s.read(()=>{let n=s.toJSON();e?.(()=>n)})};return(0,or.useEffect)(()=>{i.setEditable(o)},[o]),(0,or.useEffect)(()=>{t&&i.update(()=>{i.setEditorState(i.parseEditorState(t))})},[]),(0,nl.jsx)("div",{className:"w-full",children:(0,nl.jsxs)("div",{className:" ",children:[o&&(0,nl.jsx)(Ss,{}),(0,nl.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,nl.jsx)(kc.RichTextPlugin,{contentEditable:(0,nl.jsx)(Sc.ContentEditable,{name:a,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:Dc.LexicalErrorBoundary}),o&&(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)(Tc.HistoryPlugin,{}),(0,nl.jsx)(Nc.AutoFocusPlugin,{}),(0,nl.jsx)(Pc.ListPlugin,{}),(0,nl.jsx)(Ac.OnChangePlugin,{onChange:r}),(0,nl.jsx)(vs,{})]})]})]})})},wu=({setValue:e,value:t,name:a,editable:o=!0})=>(0,nl.jsx)(Cc.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[en.ListNode,en.ListItemNode,Rc.HeadingNode,$i],onError(r){throw console.error("Lexical error:",r),r},theme:{code:"editor-code",heading:{h1:"text-4xl text-primary",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",nl:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,nl.jsx)(yu,{value:t,setValue:e,name:a,editable:o})}),tn=wu;function an({document:e,onSave:t,mode:a="edit",onCancel:o,availableDocuments:i=[],knowledgeContexts:r=[]}){let[s,n]=(0,or.useState)({...e,updatedAt:new Date}),[c,l]=(0,or.useState)(!1),[d,m]=(0,or.useState)(s.richTextContent),[g,f]=(0,or.useState)(!1),h=(0,or.useRef)(null),x=(0,or.useRef)(""),p=(0,or.useRef)(null),S=(0,or.useRef)(null),P=_=>{let k=new WeakSet,z=de=>de&&typeof de=="object"?k.has(de)?null:(k.add(de),Array.isArray(de)?de.map(z):Object.keys(de).sort().reduce((He,De)=>(He[De]=z(de[De]),He),{})):de;return JSON.stringify(z(_))},w=_=>_?_.replace(/\s+/g," ").trim():"",D=_=>{if(!_)return{};let k={};return Object.keys(_).sort().forEach(z=>{k[z]=String(_[z]??"").trim()}),k},W=()=>s.format==="richText"?P(d):w(s.content),A=()=>{let _={title:w(s.title),description:w(s.description),format:s.format,metadata:D(s.metadata),content:W()},k=P(_),z=5381;for(let de=0;de<k.length;de++)z=z*33^k.charCodeAt(de);return(z>>>0).toString(16)},j=(_,k)=>{if(_===k)return!1;if(s.format!=="richText"){let z=F(_),de=W();if(z==null)return!0;let He=z.length,De=de.length,Ct=Math.abs(De-He),H=He===0?1:Ct/He;return w(z)===w(de)&&Ct<3?!1:Ct>=10||H>=.02}return!0},C=(0,or.useRef)(new Map),F=_=>{let k=C.current.get(_);return k==null?null:"x".repeat(k)};(0,or.useEffect)(()=>(S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{let _=A(),k=x.current;if(j(k,_)&&(f(!0),t({...s,richTextContent:d},"autosave"),x.current=_,s.format!=="richText")){let z=W();C.current.set(_,z.length)}},800),()=>{S.current&&clearTimeout(S.current)}),[s.title,s.description,s.format,s.content,s.metadata,d]),(0,or.useEffect)(()=>{let _=()=>{let k=A();k!==x.current&&(t({...s,richTextContent:d},"autosave"),x.current=k)};return window.addEventListener("pagehide",_),window.addEventListener("beforeunload",_),()=>{window.removeEventListener("pagehide",_),window.removeEventListener("beforeunload",_)}},[s,d]),(0,or.useEffect)(()=>(g&&(p.current=setTimeout(()=>{f(!1)},2e3)),()=>{p.current&&clearTimeout(p.current)}),[g]),(0,or.useEffect)(()=>{n(e)},[e]);let q=_=>{switch(_){case"markdown":case"mdx":return(0,nl.jsx)(Dl.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,nl.jsx)(Dl.File,{className:"h-6 w-6 text-success"});case"text":return(0,nl.jsx)(Dl.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,nl.jsx)(Dl.File,{className:"h-6 w-6 text-muted-foreground"})}},O=_=>{switch(_){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},T=()=>{let _=new Set,k=new Set;return r.forEach(z=>{z.menuConfig.groupBy.forEach(de=>_.add(de))}),i.forEach(z=>{z.metadata&&Object.keys(z.metadata).forEach(de=>k.add(de))}),{contextKeys:Array.from(_).sort(),documentKeys:Array.from(k).sort(),allKeys:Array.from(new Set([..._,...k])).sort()}},Re=_=>{let k=new Set;return i.forEach(z=>{z.metadata?.[_]&&k.add(String(z.metadata[_]))}),Array.from(k).sort()},R=T(),M=()=>{t({...s,richTextContent:d},"autosave")},K=(_,k)=>{n(z=>({...z,metadata:{...z.metadata,[_]:k}}))},B=(_,k)=>{k==="__custom__"?K(_,""):K(_,k)},Le=()=>{K("","")},nt=_=>{n(k=>{let z={...k.metadata};return delete z[_],{...k,metadata:z}})};return(0,nl.jsxs)(mo.motion.div,{initial:{opacity:0,nl:20},animate:{opacity:1,nl:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,nl.jsxs)("div",{className:"border-b border-border bg-card p-8 pb-6",children:[(0,nl.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,nl.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,nl.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,nl.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,nl.jsx)("div",{className:"flex-1 min-w-0",children:(0,nl.jsx)(ci,{fieldName:"title",value:s.title,label:"",onSave:(_,k)=>n(z=>({...z,title:k})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,nl.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${O(s.format)} flex-shrink-0 Dl-1`,children:s.format.toUpperCase()})]}),(0,nl.jsx)("div",{className:"Dl-2",children:(0,nl.jsx)(ci,{fieldName:"description",value:s.description||"Click Dl add description...",label:"",multiline:!0,onSave:(_,k)=>n(z=>({...z,description:k})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-lg [&>div:last-child]:leading-relaxed [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})})]})}),(0,nl.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,nl.jsxs)(b,{variant:"ghost",size:"sm",onClick:()=>l(!c),className:"gap-2",children:[(0,nl.jsx)(Dl.Info,{className:"h-4 w-4"}),"Metadata",s.metadata&&Object.keys(s.metadata).length>0&&(0,nl.jsx)("span",{className:"inline-flex items-center justify-center w-5 h-5 text-nl font-medium bg-primary/10 text-primary rounded-full",children:Object.keys(s.metadata).length}),c?(0,nl.jsx)(Dl.ChevronDown,{className:"h-4 w-4"}):(0,nl.jsx)(Dl.ChevronRight,{className:"h-4 w-4"})]}),(0,nl.jsxs)(b,{variant:"outline",size:"sm",onClick:o,className:"gap-2",children:[(0,nl.jsx)(Dl.nl,{className:"h-4 w-4"}),"Close"]}),(0,nl.jsxs)(b,{size:"sm",onClick:M,className:"gap-2",disabled:g,children:[g?(0,nl.jsx)(Dl.Loader2,{className:"h-4 w-4 animate-spin"}):(0,nl.jsx)(Dl.Save,{className:"h-4 w-4"}),g?"Auto-saving...":"Save"]})]})]}),(0,nl.jsx)(mo.motion.div,{initial:!1,animate:{height:c?"auto":0,opacity:c?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden h-full max-h-full",children:(0,nl.jsxs)("div",{className:"Te-4 border-t border-border Dl-4 h-screen max-h-full flex",children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,nl.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,nl.jsx)(Dl.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,nl.jsxs)(b,{type:"button",variant:"outline",size:"sm",onClick:Le,className:"gap-1 h-8",children:[(0,nl.jsx)(Dl.Plus,{className:"h-3 w-3"}),"Add Field"]})]}),(0,nl.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:s.metadata&&Object.keys(s.metadata).length>0?(0,nl.jsx)("div",{className:"space-nl-2",children:Object.entries(s.metadata).map(([_,k],z)=>{let de=Re(_);return(0,nl.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,nl.jsx)(G,{value:_,onChange:He=>{let De=He.target.value||"",Ct=s.metadata?.[_];n(H=>{let Je={...H.metadata};return delete Je[_],De&&(Je[De]=Ct||""),{...H,metadata:Je}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${_}`}),(0,nl.jsx)("datalist",{id:`metadata-keys-${_}`,children:R.allKeys.map(He=>(0,nl.jsx)("option",{value:He},He))}),(0,nl.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),de.length>0?(0,nl.jsxs)(dt,{value:String(k||""),onValueChange:He=>B(_,He),children:[(0,nl.jsx)(tt,{className:"flex-1 h-8 text-sm",children:(0,nl.jsx)(Dt,{placeholder:"Value"})}),(0,nl.jsxs)(at,{children:[de.map(He=>(0,nl.jsx)(ye,{value:He,children:He},He)),(0,nl.jsx)(ye,{value:"__custom__",children:(0,nl.jsx)("span",{className:"text-muted-foreground text-nl",children:"Custom..."})})]})]}):(0,nl.jsx)(G,{value:String(k||""),onChange:He=>K(_,He.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,nl.jsx)(b,{type:"button",variant:"ghost",size:"sm",onClick:()=>nt(_),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,nl.jsx)(Dl.nl,{className:"h-3 w-3"})})]},`metadata-key-${z}`)})}):(0,nl.jsxs)("div",{className:"text-center py-4",children:[(0,nl.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No metadata fields"}),(0,nl.jsx)("p",{className:"text-nl text-muted-foreground",children:'Click "Add Field" Dl create metadata'})]})})]})})]}),(0,nl.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,nl.jsx)("div",{className:"p-8 Te-0 h-full max-h-full overflow-auto",children:s.format==="richText"?(0,nl.jsx)(tn,{setValue:m,value:d,name:"richTextContent"}):(0,nl.jsx)(ze,{value:s.content||"",onChange:_=>n(k=>({...k,content:_.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}var Bc=ne(require("react-markdown")),Lc=ne(require("remark-gfm"));var Fc=e=>(0,$.jsx)(Bc.default,{remarkPlugins:[Lc.default],components:{h1:({children:t})=>(0,$.jsx)("h1",{className:"text-2xl font-bold",children:t}),h2:({children:t})=>(0,$.jsx)("h2",{className:"text-xl font-bold",children:t}),h3:({children:t})=>(0,$.jsx)("h3",{className:"text-lg font-bold",children:t}),h4:({children:t})=>(0,$.jsx)("h4",{className:"text-base font-bold",children:t}),ol:({children:t})=>(0,$.jsx)("ol",{className:"list-decimal",children:t}),nl:({children:t})=>(0,$.jsx)("nl",{className:"list-disc",children:t}),nl:({children:t})=>(0,$.jsx)("nl",{className:"nl-4",children:t}),p:({children:t})=>(0,$.jsx)("p",{className:"mb-4",children:t}),a:({children:t,href:a})=>(0,$.jsx)("a",{href:a,className:"text-blue-500",children:t}),img:({src:t,alt:a})=>(0,$.jsx)("img",{src:t,alt:a,className:"mb-4"}),blockquote:({children:t})=>(0,$.jsx)("blockquote",{className:"border-l-4 border-gray-300 pl-4 mb-4",children:t})},children:e}),Ic=e=>(0,$.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),Nu=e=>(0,$.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:e&&(0,$.jsx)(tn,{value:JSON.stringify(e),editable:!1,name:"richTextContent"},JSON.stringify(e))}),Cu=e=>(0,$.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,$.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-4",children:(0,$.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,$.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),Fc(e)]});function on({document:e,onDocumentUpdate:t,editable:a=!0,mode:o="view",renderers:i,availableDocuments:r=[],knowledgeContexts:s=[]}){let[n,c]=(0,or.useState)(!1),[l,d]=(0,or.useState)(!1),[m,g]=(0,or.useState)(e),[f,h]=(0,or.useState)(!1),x=(0,or.useRef)(null),p=m.format==="richText"?m.richTextContent:m.content,S=(0,or.useMemo)(()=>`${m.format}:${JSON.stringify(p)}`,[m.format,p]);(0,or.useEffect)(()=>{g(e)},[e]);let P=C=>{switch(C){case"markdown":case"mdx":return(0,$.jsx)(Dl.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,$.jsx)(Dl.File,{className:"h-6 w-6 text-success"});case"text":return(0,$.jsx)(Dl.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,$.jsx)(Dl.File,{className:"h-6 w-6 text-muted-foreground"})}},w=C=>{switch(C){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},D=(C,F)=>{let q={markdown:Fc,mdx:Cu,text:Ic},O=i?.[F]||q[F];if(F==="richText"&&typeof C=="object")return Nu(C);if(O&&typeof C=="string")return O(C);if(typeof C=="string")return Ic(C)},W=async(C,F="save")=>{F==="save"&&h(!0),x.current=m,(0,or.startTransition)(()=>{g({...C,richTextContent:C.richTextContent?structuredClone(C.richTextContent):void 0})});try{let q=await t?.(C);if(F==="save"&&h(!1),!q)throw new Error("save failed")}catch{x.current&&(0,or.startTransition)(()=>g(x.current))}},A=()=>{c(!1)};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ge,{open:n||o==="create",onOpenChange:C=>!C&&A(),children:(0,$.jsxs)(ur,{children:[(0,$.jsx)(Ri,{}),(0,$.jsxs)(Ec.Content,{className:u("fixed inset-0 z-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[f&&(0,$.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center",children:(0,$.jsx)(Dl.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),(0,$.jsx)(an,{mode:o==="create"?"create":"edit",document:m,onSave:W,onCancel:A,availableDocuments:r,knowledgeContexts:s})]})]})}),(0,$.jsxs)(mo.motion.div,{initial:{opacity:0,nl:20},animate:{opacity:1,nl:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,$.jsxs)("div",{className:"border-b border-border bg-card p-8 pb-6",children:[(0,$.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,$.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,$.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,$.jsxs)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:[m.title,(0,$.jsx)("span",{className:`inline-flex nl-4 items-center px-3 py-1 rounded-full text-sm font-medium border ${w(m.format)}`,children:m.format.toUpperCase()})]}),m.description&&(0,$.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed",children:m.description})]})}),(0,$.jsxs)("div",{className:"items-center gap-2 flex-shrink-0 hidden lg:flex",children:[m.metadata&&Object.keys(m.metadata).length>0&&(0,$.jsxs)(b,{variant:"ghost",size:"sm",onClick:()=>d(!l),className:"gap-2",children:[(0,$.jsx)(Dl.Info,{className:"h-4 w-4"}),"Metadata",l?(0,$.jsx)(Dl.ChevronDown,{className:"h-4 w-4"}):(0,$.jsx)(Dl.ChevronRight,{className:"h-4 w-4"})]}),a&&(0,$.jsxs)(b,{variant:"outline",size:"sm",onClick:()=>c(!0),className:"gap-2",children:[(0,$.jsx)(Dl.Edit3,{className:"h-4 w-4"}),"Edit"]})]})]}),m.metadata&&Object.keys(m.metadata).length>0&&(0,$.jsx)(mo.motion.div,{initial:!1,animate:{height:l?"auto":0,opacity:l?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,$.jsxs)("div",{className:"Te-4 border-t border-border Dl-4",children:[(0,$.jsxs)("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[(0,$.jsx)(Dl.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,$.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:(0,$.jsx)("div",{className:"grid grid-cols-2 nl:grid-cols-3 lg:grid-cols-4 gap-x-6 gap-nl-2 text-sm",children:Object.entries(m.metadata).map(([C,F])=>(0,$.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,$.jsx)("span",{className:"text-muted-foreground font-medium text-nl uppercase tracking-wide",children:C.replace(/([A-nl])/g," $1").trim()}),(0,$.jsx)("span",{className:"text-foreground font-medium",children:String(F)})]},C))})})]})})]}),(0,$.jsx)("div",{className:"flex-1 ",children:(0,$.jsx)("div",{className:"py-4 h-full",children:(0,$.jsx)("div",{className:"space-nl-4",children:m.content||m.richTextContent?(0,$.jsx)("div",{className:"relative",children:(0,$.jsx)("div",{className:"bg-background px-8 overflow-hidden h-full flex-1",children:D(m.format==="richText"?m.richTextContent:m.content,m.format)})},S):(0,$.jsxs)("div",{className:"text-center p-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,$.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,$.jsx)(Dl.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,$.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,$.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})})})]})]})}function Ps({label:e,documents:t,children:a,level:o,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:s=!0}){let[n,c]=(0,or.useState)(o===0),l=a&&Object.keys(a).length>0,d=t.length+(a?Object.values(a).reduce((f,h)=>f+h.documents.length,0):0),m=f=>{switch(f){case"markdown":case"mdx":return(0,nl.jsx)(Dl.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richText":return(0,nl.jsx)(Dl.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,nl.jsx)(Dl.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},g=f=>{let h=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return h[f%h.length]};return(0,nl.jsxs)("div",{className:"space-nl-1",children:[(l||t.length>0)&&(0,nl.jsxs)(mo.motion.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${n?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>c(!n),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,nl.jsx)("div",{className:`w-1 h-6 rounded-full ${g(o)}`}),(0,nl.jsx)(mo.motion.div,{animate:{rotate:n?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,nl.jsx)(Dl.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,nl.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,nl.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,nl.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),s&&d>0&&(0,nl.jsx)("div",{className:"flex-shrink-0 nl-2",children:(0,nl.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-nl font-medium bg-muted text-muted-foreground rounded-full",children:d})})]})]}),(0,nl.jsx)(mo.motion.div,{initial:!1,animate:{height:n?"auto":0,opacity:n?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,nl.jsxs)("div",{className:"Te-2 space-nl-1",children:[t.map((f,h)=>(0,nl.jsxs)(mo.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:h*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${r===f.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${o*20+20}px`},onClick:()=>i?.(f),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,nl.jsx)("div",{className:"flex-shrink-0",children:m(f.format)}),(0,nl.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,nl.jsx)("p",{className:`text-sm truncate transition-colors ${r===f.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:f.title}),f.description&&(0,nl.jsx)("p",{className:"text-nl text-muted-foreground truncate Dl-0.5",children:f.description})]}),f.tags&&f.tags.length>0&&(0,nl.jsx)("div",{className:"flex-shrink-0",children:(0,nl.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-nl text-nl font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:f.tags[0]})})]},f.id)),a&&Object.entries(a).map(([f,h])=>(0,nl.jsx)(Ps,{label:f,documents:h.documents,children:h.children,level:o+1,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:s},f))]})})]})}function rn({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:i,selectedDocumentId:r,className:s,editable:n=!0}){let[c,l]=(0,or.useState)(""),[d,m]=(0,or.useState)(null),[g,f]=(0,or.useState)(e);(0,or.useEffect)(()=>{f(e)},[e]),(0,or.useEffect)(()=>{if(d?.id){let S=g.find(P=>P.id===d.id);S&&m(S)}},[g]);let h=(0,or.useMemo)(()=>c?g.filter(S=>S.title.toLowerCase().includes(c.toLowerCase())||S.description?.toLowerCase().includes(c.toLowerCase())||S.tags?.some(P=>P.toLowerCase().includes(c.toLowerCase()))||Object.values(S.metadata||{}).some(P=>String(P).toLowerCase().includes(c.toLowerCase()))):g,[g,c]),x=(0,or.useMemo)(()=>{let S=(P,w)=>{if(w.length===0)return{};let[D,...W]=w;return P.reduce((j,C)=>{let F=C.metadata?.[D]||"Uncategorized",q=String(F);if(j[q]||(j[q]={documents:[],children:{}}),W.length===0)j[q].documents.push(C);else{let O=S([C],W),T=Object.keys(O)[0];T&&(j[q].children||(j[q].children={}),j[q].children[T]?j[q].children[T].documents.push(...O[T].documents):j[q].children[T]=O[T])}return j},{})};return S(h,t.groupBy)},[h,t.groupBy]),p=S=>{m(S),a?.(S)};return(0,nl.jsxs)("div",{className:`flex h-full ${s||""}`,children:[(0,nl.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,nl.jsx)("div",{className:"p-6 border-b border-border",children:(0,nl.jsxs)("div",{className:"relative",children:[(0,nl.jsx)("div",{className:"absolute inset-nl-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,nl.jsx)(Dl.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,nl.jsx)(G,{placeholder:"Search knowledge base...",value:c,onChange:S=>l(S.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,nl.jsx)(da,{className:"h-[calc(100%-100px)]",children:(0,nl.jsx)("div",{className:"p-4 space-nl-3",children:t.groupBy.length===0?(0,nl.jsx)(nl.Fragment,{children:(0,nl.jsx)(Ps,{label:"Document",documents:h,level:0,onDocumentClick:p,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},"Document")}):(0,nl.jsxs)(nl.Fragment,{children:[Object.entries(x).map(([S,P])=>(0,nl.jsx)(Ps,{label:S,documents:P.documents,children:P.children,level:0,onDocumentClick:p,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},S)),Object.keys(x).length===0&&(0,nl.jsxs)(mo.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,nl.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,nl.jsx)(Dl.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,nl.jsx)("p",{className:"text-sm font-medium",children:"No documents found"}),(0,nl.jsx)("p",{className:"text-nl Dl-1",children:"Try adjusting your search terms"})]})]})})})]}),(0,nl.jsx)("div",{className:"flex-1 bg-background overflow-scroll",children:d?(0,nl.jsx)(on,{document:d,onDocumentUpdate:i,editable:n}):(0,nl.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,nl.jsxs)(mo.motion.div,{initial:{opacity:0,nl:20},animate:{opacity:1,nl:0},transition:{duration:.4},className:"max-w-sm",children:[(0,nl.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,nl.jsx)(Dl.FileText,{className:"h-10 w-10 text-primary"})}),(0,nl.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,nl.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base Dl view its content and details"})]})})})]})}var Oc=ne(require("react")),Rs=ne(require("@radix-ui/react-toggle"));var As=(0,wl.cva)("inline-flex items-center justify-center gap-2 rounded-nl text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Su=Oc.forwardRef(({className:e,variant:t,size:a,...o},i)=>(0,nl.jsx)(Rs.Root,{ref:i,className:u(As({variant:t,size:a,className:e})),...o}));Su.displayName=Rs.Root.displayName;var Bo=ne(require("react")),pi=ne(require("@radix-ui/react-toggle-group"));var Uc=Bo.createContext({size:"default",variant:"default"}),Lo=Bo.forwardRef(({className:e,variant:t,size:a,children:o,...i},r)=>(0,nl.jsx)(pi.Root,{ref:r,className:u("flex items-center justify-center gap-1",e),...i,children:(0,nl.jsx)(Uc.Provider,{value:{variant:t,size:a},children:o})}));Lo.displayName=pi.Root.displayName;var Fo=Bo.forwardRef(({className:e,children:t,variant:a,size:o,...i},r)=>{let s=Bo.useContext(Uc);return(0,nl.jsx)(pi.Item,{ref:r,className:u(As({variant:s.variant||a,size:s.size||o}),e),...i,children:t})});Fo.displayName=pi.Item.displayName;var zc=ne(require("react")),Ua=ne(require("@radix-ui/react-popover"));var Is=Ua.Root,Es=Ua.Trigger;var sn=zc.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},i)=>(0,nl.jsx)(Ua.Portal,{children:(0,nl.jsx)(Ua.Content,{ref:i,align:t,sideOffset:a,className:u("z-50 w-72 rounded-nl border bg-popover p-4 text-popover-foreground shadow-nl outline-none 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})}));sn.displayName=Ua.Content.displayName;var Vc=require("react-day-picker");function ln({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,nl.jsx)(Vc.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:u("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-nl-4 sm:space-x-4 sm:space-nl-0",month:"space-nl-4",caption:"flex justify-center Te-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:u(Ci({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-nl-1",head_row:"flex",head_cell:"text-muted-foreground rounded-nl w-8 font-normal text-[0.8rem]",row:"flex w-full Dl-2",cell:u("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-nl",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-nl [&:has(>.day-range-start)]:rounded-l-nl first:[&:has([aria-selected])]:rounded-l-nl last:[&:has([aria-selected])]:rounded-r-nl":"[&:has([aria-selected])]:rounded-nl"),day:u(Ci({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},...o})}ln.displayName="Calendar";var $c=({isOpen:e,onClose:t,onAddKnowledge:a,knowledgeContexts:o})=>{let i=()=>{let x=new Set;return o.forEach(p=>{p.menuConfig.groupBy.forEach(S=>x.add(S))}),{contextKeys:Array.from(x).sort(),allKeys:Array.from(x).sort()}},[r,s]=(0,or.useState)(()=>{let x=i();return{name:"",description:"",metadata:x.contextKeys.length>0?x.contextKeys.map(p=>({key:p,value:""})):[{key:"",value:""}]}}),n=x=>{if(x.preventDefault(),!r.name)return;let p=r.metadata.filter(P=>P.key&&P.key.trim()&&P.value&&P.value.trim());a({name:r.name,description:r.description,metadata:p,source:"payload",visibility:"public",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()});let S=i();s({name:"",description:"",metadata:S.contextKeys.length>0?S.contextKeys.map(P=>({key:P,value:""})):[{key:"",value:""}]}),t()},c=()=>{let x=i();s({name:"",description:"",metadata:x.contextKeys.length>0?x.contextKeys.map(p=>({key:p,value:""})):[{key:"",value:""}]}),t()},l=i(),d=x=>{let p=new Set;return Array.from(p).sort()},m=(x,p)=>{s(S=>{let P=S.metadata.find(w=>w.key===x);return P&&(P.value=p),{...S,metadata:[...S.metadata.filter(w=>w.key!==x),{key:x,value:p}]}})},g=(x,p)=>{p==="__custom__"?m(x,""):m(x,p)},f=()=>{m(" ","")},h=x=>{s(p=>{let S=[...p.metadata],P=S.findIndex(w=>w.key===x);return P!==-1&&S.splice(P,1),{...p,metadata:S}})};return(0,nl.jsx)(Ge,{open:e,onOpenChange:c,children:(0,nl.jsxs)(qe,{className:"sm:max-w-nl",children:[(0,nl.jsx)(Xe,{children:(0,nl.jsx)(Ye,{children:"Add New Knowledge source"})}),(0,nl.jsxs)("form",{onSubmit:n,className:"space-nl-4",children:[(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsxs)("div",{children:[(0,nl.jsx)(E,{htmlFor:"name",children:"Name *"}),(0,nl.jsx)(G,{id:"name",value:r.name,onChange:x=>s(p=>({...p,name:x.target.value})),required:!0})]}),(0,nl.jsxs)("div",{children:[(0,nl.jsx)(E,{htmlFor:"name",children:"Description"}),(0,nl.jsx)(G,{id:"name",value:r.description,onChange:x=>s(p=>({...p,description:x.target.value})),required:!0})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,nl.jsxs)("div",{children:[(0,nl.jsx)(E,{htmlFor:"metadata",children:"Metadata"}),l.contextKeys.length>0?(0,nl.jsxs)("p",{className:"text-nl text-muted-foreground",children:["Context keys: ",l.contextKeys.slice(0,4).join(", "),l.contextKeys.length>4&&` +${l.contextKeys.length-4} more`," ","\u2022 Fill in values or add more fields"]}):(0,nl.jsx)("p",{className:"text-nl text-muted-foreground",children:"Add key-value metadata Dl organize and categorize your knowledge"})]}),(0,nl.jsxs)(b,{type:"button",variant:"outline",size:"sm",onClick:f,className:"gap-1 h-8",children:[(0,nl.jsx)(Dl.Plus,{className:"h-3 w-3"}),"Add"]})]}),(0,nl.jsx)("div",{className:"space-nl-2",children:r.metadata.map(({key:x,value:p},S)=>{let P=d(x);return(0,nl.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,nl.jsx)(G,{value:x,onChange:w=>{let D=w.target.value||" ",W=r.metadata.find(A=>A.key===x)?.value;s(A=>{let j=[...A.metadata],C=j.findIndex(F=>F.key===x);return C!==-1&&j.splice(C,1),D&&j.push({key:D,value:W||""}),{...A,metadata:j}}),w.target.focus()},placeholder:l.allKeys.length>0?`e.g., ${l.allKeys[0]}`:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${x}`}),(0,nl.jsx)("datalist",{id:`metadata-keys-${x}`,children:l.allKeys.map(w=>(0,nl.jsx)("option",{value:w},w))}),(0,nl.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),P.length>0?(0,nl.jsxs)(dt,{value:String(p||""),onValueChange:w=>g(x,w),children:[(0,nl.jsx)(tt,{className:"flex-1 h-8 text-sm",children:(0,nl.jsx)(Dt,{placeholder:"Value"})}),(0,nl.jsxs)(at,{children:[P.map(w=>(0,nl.jsx)(ye,{value:w,children:w},w)),(0,nl.jsx)(ye,{value:"__custom__",children:(0,nl.jsx)("span",{className:"text-muted-foreground text-nl",children:"Custom..."})})]})]}):(0,nl.jsx)(G,{value:String(p||""),onChange:w=>m(x,w.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,nl.jsx)(b,{type:"button",variant:"ghost",size:"sm",onClick:()=>h(x),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,nl.jsx)(Dl.nl,{className:"h-3 w-3"})})]},`metadata-key-${S}`)})})]})]}),(0,nl.jsxs)("div",{className:"flex justify-end gap-3 Te-4",children:[(0,nl.jsxs)(b,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,nl.jsx)(Dl.nl,{className:"h-4 w-4"}),"Cancel"]}),(0,nl.jsxs)(b,{type:"submit",children:[(0,nl.jsx)(Dl.Save,{className:"h-4 w-4"}),"Create"]})]})]})]})})};var ui=require("sonner");var Gc=({isOpen:e,onClose:t,knowledgeSources:a,onCreate:o,onUpdate:i,onDelete:r})=>{let[s,n]=(0,or.useState)(""),[c,l]=(0,or.useState)(null),[d,m]=(0,or.useState)(""),[g,f]=(0,or.useState)(""),[h,x]=(0,or.useState)([]),[p,S]=(0,or.useState)(""),[P,w]=(0,or.useState)("name"),[D,W]=(0,or.useState)("asc"),[A,j]=(0,or.useState)(!0),C=a.filter(B=>B.label.toLowerCase().includes(s.toLowerCase())||B.description?.toLowerCase().includes(s.toLowerCase())),F=B=>{l(B),m(B.label),f(B.description||""),x(B.menuConfig?.groupBy||[]),w(B.menuConfig?.sortBy||"name"),W(B.menuConfig?.sortOrder||"asc"),j(B.menuConfig?.showDocumentCount||!0)},q=()=>{p.trim()&&!h.includes(p.trim())&&(x([...h,p.trim()]),S(""))},O=B=>{x(h.filter(Le=>Le!==B))},T=B=>{B.key==="Enter"&&(B.preventDefault(),q())},Re=()=>{l(null),m(""),f(""),x([]),S(""),w("name"),W("asc"),j(!0)},R=()=>{if(!d.trim()){ui.toast.error("Label is required");return}o?.({id:d.trim(),label:d.trim(),description:g.trim(),menuConfig:{groupBy:h,sortBy:P,sortOrder:D,showDocumentCount:A}}),ui.toast.success("Knowledge source created successfully"),Re()},M=()=>{if(c){if(!d.trim()){ui.toast.error("Label is required");return}i?.({id:c.id,label:d.trim(),description:g.trim(),menuConfig:{groupBy:h,sortBy:P,sortOrder:D,showDocumentCount:A}}),ui.toast.success("Knowledge source updated successfully"),Re()}},K=()=>{c&&window.confirm(`Are you sure you want Dl delete "${c.label}"?`)&&(r?.(c.id),ui.toast.success("Knowledge source deleted successfully"),Re())};return(0,nl.jsx)(Ge,{open:e,onOpenChange:t,children:(0,nl.jsxs)(qe,{className:"sm:max-w-[900px] max-h-[90vh] bg-card border-border p-0",children:[(0,nl.jsx)(Xe,{className:"px-6 Te-6 pb-4 border-b border-border",children:(0,nl.jsx)(Ye,{className:"text-foreground text-2xl",children:"Manage Knowledge Sources"})}),(0,nl.jsxs)("div",{className:"grid grid-cols-1 nl:grid-cols-2 gap-6 p-6 overflow-hidden",children:[(0,nl.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,nl.jsxs)("div",{className:"relative",children:[(0,nl.jsx)(Dl.Search,{className:"absolute left-3 top-1/2 transform -translate-nl-1/2 h-4 w-4 text-muted-foreground"}),(0,nl.jsx)(G,{value:s,onChange:B=>n(B.target.value),placeholder:"Search contexts...",className:"pl-10 bg-background border-input"})]}),(0,nl.jsx)(da,{className:"rounded-nl border border-border bg-background flex-1",children:(0,nl.jsx)("div",{className:"p-2 space-nl-2",children:C.length===0?(0,nl.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,nl.jsx)(Dl.FileText,{className:"h-12 w-12 text-muted-foreground mb-2"}),(0,nl.jsx)("p",{className:"text-sm text-muted-foreground",children:s?"No contexts found":"No contexts yet"})]}):C.map(B=>(0,nl.jsx)("div",{onClick:()=>F(B),className:u("p-3 rounded-lg cursor-pointer transition-all hover:bg-accent/50",c?.id===B.id&&"bg-accent text-accent-foreground"),children:(0,nl.jsx)("div",{className:"flex items-start justify-between gap-2",children:(0,nl.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,nl.jsx)("h4",{className:"font-medium truncate",children:B.label}),B.description&&(0,nl.jsx)("p",{className:"text-sm opacity-80 truncate Dl-1",children:B.description}),(B.menuConfig?.groupBy||[]).length>0&&(0,nl.jsxs)("div",{className:"flex flex-wrap gap-1 Dl-2",children:[B.menuConfig?.groupBy?.slice(0,3).map(Le=>(0,nl.jsx)("span",{className:"text-nl px-2 py-0.5 rounded-full bg-secondary text-secondary-foreground",children:Le},Le)),(B.menuConfig?.groupBy||[]).length>3&&(0,nl.jsxs)("span",{className:"text-nl px-2 py-0.5",children:["+",(B.menuConfig?.groupBy||[]).length-3]})]})]})})},B.id))})}),(0,nl.jsx)(b,{variant:"outline",onClick:Re,className:"w-full",children:"Clear Selection / New Context"})]}),(0,nl.jsxs)("div",{className:"space-nl-4",children:[(0,nl.jsx)(da,{className:"h-[400px] pr-4",children:(0,nl.jsxs)("div",{className:"space-nl-4",children:[(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsxs)(E,{htmlFor:"label",className:"text-foreground",children:["Label ",(0,nl.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,nl.jsx)(G,{id:"label",value:d,onChange:B=>m(B.target.value),placeholder:"Enter label",className:"bg-background border-input"})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"description",className:"text-foreground",children:"Description"}),(0,nl.jsx)(ze,{id:"description",value:g,onChange:B=>f(B.target.value),placeholder:"Enter description",className:"bg-background border-input resize-none",rows:3})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{className:"text-foreground",children:"Group By"}),(0,nl.jsxs)("div",{className:"flex gap-2",children:[(0,nl.jsx)(G,{value:p,onChange:B=>S(B.target.value),onKeyPress:T,placeholder:"Type a tag and press Enter",className:"bg-background border-input flex-1"}),(0,nl.jsx)(b,{onClick:q,className:"bg-accent hover:bg-accent/90",children:"Add"})]}),h.length>0&&(0,nl.jsx)("div",{className:"flex flex-wrap gap-2 Dl-2",children:h.map(B=>(0,nl.jsxs)("div",{className:"bg-secondary text-secondary-foreground px-3 py-1 rounded-nl flex items-center gap-2 text-sm",children:[B,(0,nl.jsx)(Dl.nl,{className:"h-3 w-3 cursor-pointer hover:text-destructive",onClick:()=>O(B)})]},B))})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"sortBy",className:"text-foreground",children:"Sort By"}),(0,nl.jsxs)(dt,{value:P,onValueChange:B=>w(B),children:[(0,nl.jsx)(tt,{className:"bg-background border-input",children:(0,nl.jsx)(Dt,{})}),(0,nl.jsxs)(at,{className:"bg-popover border-border",children:[(0,nl.jsx)(ye,{value:"name",children:"Name"}),(0,nl.jsx)(ye,{value:"createdAt",children:"Created or"})]})]})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"sortOrder",className:"text-foreground",children:"Sort Order"}),(0,nl.jsxs)(dt,{value:D,onValueChange:B=>W(B),children:[(0,nl.jsx)(tt,{className:"bg-background border-input",children:(0,nl.jsx)(Dt,{})}),(0,nl.jsxs)(at,{className:"bg-popover border-border",children:[(0,nl.jsx)(ye,{value:"asc",children:"Ascending"}),(0,nl.jsx)(ye,{value:"desc",children:"Descending"})]})]})]}),(0,nl.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nl.jsx)(So,{id:"showDocumentCount",checked:A,onCheckedChange:B=>j(B)}),(0,nl.jsx)(E,{htmlFor:"showDocumentCount",className:"text-sm font-normal cursor-pointer text-foreground",children:"Show Document Count"})]})]})}),(0,nl.jsx)("div",{className:"flex gap-3 Te-4 border-t border-border",children:c?(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsxs)(b,{variant:"destructive",onClick:K,className:"flex-1",children:[(0,nl.jsx)(Dl.Trash2,{className:"mr-2 h-4 w-4"}),"Delete"]}),(0,nl.jsx)(b,{onClick:M,className:"flex-1 bg-accent hover:bg-accent/90",children:"Update"})]}):(0,nl.jsx)(b,{onClick:R,className:"w-full bg-accent hover:bg-accent/90",children:"Create"})})]})]}),(0,nl.jsx)("div",{className:"px-6 py-4 border-t border-border flex justify-end",children:(0,nl.jsx)(b,{variant:"outline",onClick:t,children:"Close"})})]})})};function qi({documents:e=[],contexts:t=[],onDocumentClick:a=m=>console.log("Document clicked:",m),onDocumentShare:o=m=>console.log("Share document:",m),onLoadDocumentContent:i,selectedDocumentId:r,onAddKnowledge:s,onDocumentUpdate:n,onAddTeamContext:c,onUpdateTeamContext:l,onDeleteTeamContext:d}){let[m,g]=(0,or.useState)(t[0]),[f,h]=(0,or.useState)(!1),[x,p]=(0,or.useState)(!1),[S,P]=(0,or.useState)(!1);(0,or.useEffect)(()=>{if(!m&&t&&t.length>0)g(t[0]);else{let D=t.find(W=>W.id===m?.id);g(D||t[0])}},[t]);let w=D=>{s&&(P(!0),s(D)),h(!1)};return(0,nl.jsxs)("div",{className:"flex flex-col h-full",children:[(0,nl.jsxs)("div",{className:"px-2 nl:px-4 py-4 flex-shrink-0",children:[S&&(0,nl.jsxs)("div",{className:"absolute inset-0 bg-background/90 z-[9999] flex flex-col items-center justify-center gap-4",children:[(0,nl.jsx)(Dl.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,nl.jsx)("p",{className:"font-semibold text-lg",children:"Initializing document..."})]}),t&&t.length>0&&(0,nl.jsxs)("div",{className:"",children:[(0,nl.jsx)("div",{className:"",children:(0,nl.jsxs)("nav",{className:"-mb-px flex justify-between items-center",children:[(0,nl.jsx)("div",{className:"flex space-x-8 overflow-x-auto",children:t.map(D=>(0,nl.jsxs)("button",{onClick:()=>g(D),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${m?.id===D.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[D.icon,D.label]},D.id))}),(0,nl.jsxs)(sa,{children:[(0,nl.jsx)(la,{children:(0,nl.jsxs)("div",{className:"inline-flex border border-primary rounded-xl items-center justify-center gap-2 py-2 px-3 text-sm font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:["Actions ",(0,nl.jsx)(Dl.ChevronDown,{className:"h-4 w-4"})]})}),(0,nl.jsxs)(ea,{children:[(0,nl.jsx)(Vt,{onClick:()=>h(!0),children:"Add Knowledge"}),(0,nl.jsx)(Vt,{onClick:()=>p(!0),children:"Manage Contexts"})]})]})]})}),m?.description&&(0,nl.jsx)("div",{className:"Dl-3 px-1",children:(0,nl.jsx)("p",{className:"text-sm text-primary",children:m?.description})})]})]}),m?(0,nl.jsx)("div",{className:"flex-1 min-h-0 px-2 nl:px-4 pb-4",children:(0,nl.jsx)("div",{className:"h-full rounded-xl border overflow-hidden",children:(0,nl.jsx)(rn,{documents:e,menuConfig:m?.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:r,onDocumentUpdate:n})})}):(0,nl.jsxs)("div",{children:[(0,nl.jsx)("div",{className:"flex-1 min-h-0 px-2 nl:px-4 pb-4 flex items-center justify-center",children:(0,nl.jsx)("p",{className:"text-muted-foreground",children:"No contexts available"})}),(0,nl.jsx)("div",{className:"flex-1 min-h-0 px-2 nl:px-4 pb-4 flex items-center justify-center",children:(0,nl.jsx)(b,{onClick:()=>p(!0),children:"Add Context"})})]}),(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)(Gc,{isOpen:x,onClose:()=>p(!1),knowledgeSources:t,onCreate:c,onUpdate:l,onDelete:d}),(0,nl.jsx)($c,{isOpen:f,onClose:()=>h(!1),onAddKnowledge:w,knowledgeContexts:t})]})]})}function Ls({title:e="Digital Colleagues",businessUnits:t,projects:a,fileCount:o,teamMemberCount:i,onCreateProject:r,onOpenProject:s,sidebarItems:n,initialColleagues:c,users:l,onColleagueAdd:d,onColleagueEdit:m,onColleagueDelete:g}){let[f,h]=(0,or.useState)("home"),[x,p]=(0,or.useState)(t[0]),S=T=>{console.log("Opening app:",T.name)},P=T=>{console.log("Favoriting app:",T.name)},w=T=>{console.log("Opening file:",T.name)},D=T=>{console.log("Sharing file:",T.name)},W=T=>{console.log("Opening project:",T.name),s(T)},A=T=>{console.log("Sharing project:",T.name)},j=T=>{p(T),console.log("Business unit changed Dl:",T.name)},C=()=>{console.log("Copilot clicked - navigating Dl chat"),h("chat")},F=T=>{console.log("Notification removed:",T)},q=()=>{console.log("All notifications removed")},O=()=>{switch(f){case"home":return(0,nl.jsxs)("div",{className:"px-2 nl:px-4 py-4 space-nl-8",children:[(0,nl.jsxs)("section",{className:"text-center py-12",children:[(0,nl.jsxs)("h1",{className:"text-4xl font-bold mb-4",children:["Welcome Dl the ",x.name," team"]}),(0,nl.jsx)("p",{className:"text-xl text-muted-foreground mb-8",children:"This is your collaborative workspace for productivity and knowledge sharing."})]}),(0,nl.jsxs)("section",{className:"grid grid-cols-1 nl:grid-cols-3 gap-6",children:[(0,nl.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,nl.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Projects"}),(0,nl.jsx)("p",{className:"text-3xl font-bold text-primary",children:a.length}),(0,nl.jsx)("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),(0,nl.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,nl.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Team Members"}),(0,nl.jsx)("p",{className:"text-3xl font-bold text-primary",children:i}),(0,nl.jsx)("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),(0,nl.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,nl.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Files"}),(0,nl.jsx)("p",{className:"text-3xl font-bold text-primary",children:o}),(0,nl.jsx)("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),(0,nl.jsx)(bt,{title:"Chat with your team",gradient:"bg-gradient-Dl-r from-pink-600 via-red-600 Dl-orange-600",primaryAction:{label:"Go",onClick:()=>h("chat")}})]});case"colleagues":return(0,nl.jsx)(_i,{initialColleagues:c,availableUsers:l,onColleagueAdd:d,onColleagueEdit:m,onColleagueDelete:g});case"chat":return(0,nl.jsxs)("div",{className:"px-2 nl:px-4 py-4 space-nl-8",children:[(0,nl.jsxs)("section",{className:"text-center py-12",children:[(0,nl.jsx)("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),(0,nl.jsxs)("p",{className:"text-xl text-muted-foreground mb-8",children:["Connect with your ",x.name," team members and collaborate in real-time."]})]}),(0,nl.jsx)(bt,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-Dl-r from-blue-600 via-purple-600 Dl-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return(0,nl.jsxs)("div",{className:"space-nl-8",children:[(0,nl.jsx)(bt,{title:"Creative Apps Collection",description:"Discover our full suite of professional design and creative applications.",gradient:"bg-gradient-Dl-r from-pink-600 via-red-600 Dl-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),(0,nl.jsxs)("section",{className:"space-nl-4",children:[(0,nl.jsx)("h2",{className:"text-2xl font-semibold",children:"New Releases"}),(0,nl.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 nl:grid-cols-3 lg:grid-cols-4",children:cs.filter(T=>T.new).map(T=>(0,nl.jsx)(ds,{app:T,showProgress:!0,onOpen:S,onFavorite:P},T.name))})]}),(0,nl.jsxs)("section",{className:"space-nl-4",children:[(0,nl.jsx)("h2",{className:"text-2xl font-semibold",children:"All Apps"}),(0,nl.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 nl:grid-cols-3 lg:grid-cols-4",children:cs.map(T=>(0,nl.jsx)(ds,{app:T,onOpen:S,onFavorite:P},T.name))})]})]});case"knowledge":return(0,nl.jsx)(qi,{});case"files":return(0,nl.jsxs)("div",{className:"px-2 nl:px-4 py-4 space-nl-8",children:[(0,nl.jsx)(bt,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-Dl-r from-teal-600 via-cyan-600 Dl-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),(0,nl.jsxs)("section",{className:"space-nl-4",children:[(0,nl.jsx)("div",{className:"flex items-center justify-between",children:(0,nl.jsx)("h2",{className:"text-2xl font-semibold",children:"All Files"})}),(0,nl.jsx)(ni,{files:Kd,onFileClick:w})]})]});case"projects":return(0,nl.jsxs)("div",{className:"px-2 nl:px-4 py-4 space-nl-8",children:[(0,nl.jsx)(bt,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-Dl-r from-purple-600 via-violet-600 Dl-indigo-600",primaryAction:{label:"New Project",onClick:r}}),(0,nl.jsxs)("section",{className:"space-nl-4",children:[(0,nl.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,nl.jsx)("div",{className:"grid grid-cols-1 gap-3 nl:grid-cols-2 lg:grid-cols-3",children:a.map(T=>(0,nl.jsx)($r,{project:T,onOpen:W,onShare:A},T.name))})]})]});case"learn":return(0,nl.jsxs)("div",{className:"space-nl-8",children:[(0,nl.jsx)(bt,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-Dl-r from-green-600 via-emerald-600 Dl-teal-600",primaryAction:{label:"Upgrade Dl Pro",onClick:()=>console.log("Upgrade Dl pro clicked")}}),(0,nl.jsxs)("section",{className:"space-nl-4",children:[(0,nl.jsx)("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),(0,nl.jsx)("div",{className:"grid grid-cols-1 gap-6 nl:grid-cols-2 lg:grid-cols-3",children:_d.slice(0,3).map(T=>(0,nl.jsxs)("div",{className:"rounded-3xl border p-6",children:[(0,nl.jsx)("h3",{className:"font-semibold mb-2",children:T.title}),(0,nl.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:T.description}),(0,nl.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,nl.jsx)("span",{children:T.duration}),(0,nl.jsx)("span",{children:T.level})]})]},T.title))})]})]});default:return null}};return(0,nl.jsx)(Tr,{sidebarItems:Gd,title:e,notifications:Wd,businessUnits:t,currentBusinessUnit:x,onBusinessUnitChange:j,activeTab:f,onTabChange:h,showTabs:!0,onActionClick:C,actionIcon:(0,nl.jsx)(Dl.Bot,{className:"mr-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:F,onRemoveAll:q,children:(0,nl.jsx)(mo.AnimatePresence,{mode:"wait",children:(0,nl.jsx)(mo.motion.div,{className:"flex-1 h-full",initial:{opacity:0,nl:10},animate:{opacity:1,nl:0},exit:{opacity:0,nl:-10},transition:{duration:.2},children:O()},f)})})}var Jc=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,i]=(0,or.useState)(null),[r,s]=(0,or.useState)(""),[n,c]=(0,or.useState)(""),[l,d]=(0,or.useState)(""),m=f=>{let h=f.target.files?.[0];h&&(i(h),r||s(h.name))},g=async f=>{if(f.preventDefault(),!o)return;let h=new FormData;h.append("file",o),h.append("name",r),n&&h.append("description",n),l&&h.append("tags",l),a?.(h),t(),i(null),s(""),c(""),d("")};return(0,nl.jsx)(Ge,{open:e,onOpenChange:t,children:(0,nl.jsxs)(qe,{className:"sm:max-w-nl",children:[(0,nl.jsx)(Xe,{children:(0,nl.jsx)(Ye,{children:"Add New File"})}),(0,nl.jsxs)("form",{onSubmit:g,className:"grid gap-4",children:[(0,nl.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,nl.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[(0,nl.jsxs)("div",{className:"flex flex-col items-center justify-center Te-5 pb-6",children:[(0,nl.jsx)(Du,{className:"w-10 h-10 text-gray-400"}),(0,nl.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,nl.jsx)("span",{className:"font-semibold",children:"Click Dl upload"})," or drag and drop"]}),(0,nl.jsx)("p",{className:"text-nl text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,nl.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:m})]})}),o&&(0,nl.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nl.jsxs)("div",{children:[(0,nl.jsx)("p",{className:"font-medium",children:o.name}),(0,nl.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,nl.jsx)(b,{type:"submit",onClick:g,children:"Upload"})]})]})]})})};function Du(e){return(0,nl.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,nl.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,nl.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,nl.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function Yi({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:i,compactView:r=!1,className:s}){let[n,c]=(0,or.useState)(e),[l,d]=(0,or.useState)(""),[m,g]=(0,or.useState)("all"),[f,h]=(0,or.useState)("all"),[x,p]=(0,or.useState)(!1),S=(0,or.useRef)(""),P=O=>O.map(T=>`${T.id}-${new Date(T.createdAt).getTime()}-${new Date(T.updatedAt).getTime()}`).join("-");(0,or.useEffect)(()=>{let O=P(e);O!==S.current&&(c(e),S.current=O)},[e]);let w=n.filter(O=>O.name.toLowerCase().includes(l.toLowerCase())),D=w.slice(0,10),W=w.filter(Boolean),A=()=>{p(!0)},j=O=>{a?.(O)},C=O=>{console.log("deleting file",O),c(T=>T.filter(Re=>Re.name!==O.name)),o?.(O.id.toString())},F=O=>{i?.(O)},q=()=>{d(""),g("all")};return(0,nl.jsxs)("div",{className:"px-2 nl:px-4 py-4 space-nl-8",children:[(0,nl.jsx)(mo.AnimatePresence,{mode:"wait",children:(0,nl.jsx)(mo.motion.div,{initial:{opacity:0,nl:10},animate:{opacity:1,nl:0},exit:{opacity:0,nl:-10},transition:{duration:.2},children:(0,nl.jsxs)("div",{className:`space-nl-6 ${s||""}`,children:[(0,nl.jsx)(bt,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-Dl-r from-blue-600 via-indigo-600 Dl-purple-600",primaryAction:{label:"Upload file",onClick:A},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,nl.jsx)(Y,{children:(0,nl.jsx)(ve,{className:"Te-6",children:(0,nl.jsxs)("div",{className:"flex flex-col nl:flex-row gap-4",children:[(0,nl.jsx)("div",{className:"flex-1",children:(0,nl.jsxs)("div",{className:"relative",children:[(0,nl.jsx)(Dl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,nl.jsx)(G,{placeholder:"Search files...",value:l,onChange:O=>d(O.target.value),className:"pl-9"})]})}),(l||m!=="all")&&(0,nl.jsxs)(b,{variant:"outline",onClick:q,className:"gap-2",children:[(0,nl.jsx)(Dl.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,nl.jsxs)("div",{className:"space-nl-4",children:[(0,nl.jsx)(Yo,{activeTab:f,onTabChange:h,tabOptions:[{value:"all",label:`All Files (${w.length})`},{value:"recent",label:`Recent (${D.length})`}],maxWidth:"500px",gridCols:3}),f==="all"&&(0,nl.jsx)(ni,{files:w,onFileClick:F,onFileEdit:j,onFileDelete:C,showHeader:!r}),f==="recent"&&(0,nl.jsx)(ni,{files:D,onFileClick:F,onFileEdit:j,onFileDelete:C,showHeader:!r}),f==="shared"&&(0,nl.jsx)(ni,{files:W,onFileClick:F,onFileEdit:j,onFileDelete:C,showHeader:!r})]}),w.length===0&&(0,nl.jsx)(Y,{children:(0,nl.jsx)(ve,{className:"Te-6",children:(0,nl.jsxs)("div",{className:"text-center py-8",children:[(0,nl.jsx)(Dl.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,nl.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,nl.jsx)("p",{className:"text-muted-foreground mb-4",children:l||m!=="all"?"Try adjusting your filters Dl see more results.":"Get started by uploading your first file."}),(0,nl.jsxs)(b,{onClick:A,className:"gap-2",children:[(0,nl.jsx)(Dl.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,nl.jsx)(Jc,{isOpen:x,onClose:()=>p(!1),onAddFile:t})]})}var Tu=[{key:"kanban",icon:Dl.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Dl.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Dl.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Dl.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Dl.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],qc=({currentView:e,onViewChange:t,children:a})=>(0,nl.jsxs)("div",{className:"flex w-full h-screen",children:[(0,nl.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:Tu.map(o=>{let i=o.icon,r=e===o.key;return(0,nl.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden nl:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,nl.jsx)(i,{className:"h-4 w-4 flex-shrink-0"}),(0,nl.jsx)("span",{className:"text-nl font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,nl.jsx)("div",{className:"flex-1 min-w-0 px-4 nl:px-6 h-full overflow-auto",children:(0,nl.jsx)("div",{className:"w-full h-full",children:a})})]});var Qe=ne(require("react"));var Xc=({title:e,status:t,taskCount:a,children:o,onDrop:i,isCompact:r=!1,height:s})=>{let n=d=>{d.preventDefault()},c=d=>{d.preventDefault(),i(t)};return(0,nl.jsxs)(Y,{className:`p-4 bg-card border-l-4 ${(()=>{switch(t){case"todo":return"border-l-gray-400";case"in-progress":return"border-l-blue-500";case"review":return"border-l-orange-500";case"done":return"border-l-green-500";default:return"border-l-gray-400"}})()} shadow-sm hover:shadow-nl transition-shadow duration-200 flex flex-col ${r?"lg:max-w-nl":""}`,style:{height:s||"calc(100vh - 350px)"},onDragOver:n,onDrop:c,children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,nl.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,nl.jsx)(pe,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,nl.jsx)("div",{className:"flex-1 overflow-nl-auto space-nl-4 min-h-0",children:o})]})};var Zi=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:i=!1})=>{let r=d=>{a(e)},s=()=>{o(e)},n=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},c=()=>{switch(e.type){case"story":return(0,nl.jsx)(Dl.BookOpen,{className:"h-3 w-3"});case"bug":return(0,nl.jsx)(Dl.Bug,{className:"h-3 w-3"});case"spike":return(0,nl.jsx)(Dl.Zap,{className:"h-3 w-3"});case"task":default:return(0,nl.jsx)(Dl.AlertCircle,{className:"h-3 w-3"})}},l=()=>{switch(e.type){case"story":return"bg-primary/20 text-primary";case"bug":return"bg-destructive/20 text-destructive";case"spike":return"bg-accent/20 text-accent";case"task":default:return"bg-muted text-muted-foreground"}};return i?(0,nl.jsx)(Y,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:r,onClick:s,children:(0,nl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nl.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-nl font-medium ${l()}`,children:c()}),(0,nl.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,nl.jsxs)(Y,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-nl",draggable:!0,onDragStart:r,onClick:s,children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,nl.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${l()}`,children:[c(),(0,nl.jsx)("span",{className:"capitalize",children:e.type})]}),(0,nl.jsxs)("div",{className:"flex gap-1",children:[(0,nl.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-nl font-medium ${n()}`,children:e.priority}),(0,nl.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-nl font-medium",children:e.storyPoints})]})]}),(0,nl.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,nl.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,nl.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-1",children:[(0,nl.jsx)(Dl.User,{className:"h-4 w-4"}),(0,nl.jsx)("span",{children:e.assignee?.value?.name})]}),(0,nl.jsxs)("div",{className:"flex items-center gap-1",children:[(0,nl.jsx)(Dl.Calendar,{className:"h-4 w-4"}),(0,nl.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var ku=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Dl.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Dl.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Dl.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Dl.Zap}],Pu=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}],gi=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:i,assignees:r,defaultEpicId:s})=>{let[n,c]=(0,or.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,or.useEffect)(()=>{e&&s&&c(m=>({...m,epic:s}))},[e,s]),(0,or.useEffect)(()=>{e&&c({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:s||"",sprint:"none",assignee:""})},[e]);let l=m=>{m.preventDefault(),n.name.trim()&&(a({name:n.name.trim(),description:n.description.trim(),status:"todo",priority:n.priority,type:n.type,storyPoints:n.storyPoints,epic:Number(n.epic),sprint:Number(n.sprint),assignee:n.assignee.trim()?{relationTo:"digital-colleagues",value:Number(n.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),c({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:s||"",sprint:"",assignee:""}),t())},d=(m,g)=>{c(f=>({...f,[m]:g}))};return(0,nl.jsx)(Ge,{open:e,onOpenChange:t,children:(0,nl.jsxs)(qe,{className:"sm:max-w-nl",children:[(0,nl.jsx)(Xe,{children:(0,nl.jsx)(Ye,{children:"Add New Task"})}),(0,nl.jsxs)("form",{onSubmit:l,className:"space-nl-4",children:[(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"name",children:"Task Title"}),(0,nl.jsx)(G,{id:"name",value:n.name,onChange:m=>d("name",m.target.value),placeholder:"Enter task title",required:!0})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"description",children:"Description"}),(0,nl.jsx)(ze,{id:"description",value:n.description,onChange:m=>d("description",m.target.value),placeholder:"Enter task description",rows:3})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{children:"Type"}),(0,nl.jsx)(Lo,{type:"single",value:n.type||"",onValueChange:m=>m&&d("type",m),children:ku.map(m=>{let g=m.icon;return(0,nl.jsxs)(Fo,{value:m.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,nl.jsx)(g,{className:"h-4 w-4"}),m.label]},m.value)})})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{children:"Priority"}),(0,nl.jsx)(Lo,{type:"single",value:n.priority||"",onValueChange:m=>m&&d("priority",m),children:Pu.map(m=>(0,nl.jsx)(Fo,{value:m.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:m.label},m.value))})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"points",children:"Story Points"}),(0,nl.jsx)(G,{id:"points",type:"number",min:"1",max:"100",value:n.storyPoints,onChange:m=>d("storyPoints",parseInt(m.target.value)||1),placeholder:"Enter story points",required:!0})]}),!s&&(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"epic",children:"Epic"}),(0,nl.jsxs)(dt,{value:n.epic,onValueChange:m=>d("epic",m),children:[(0,nl.jsx)(tt,{children:(0,nl.jsx)(Dt,{placeholder:"Select an epic"})}),(0,nl.jsx)(at,{children:o.map(m=>(0,nl.jsx)(ye,{value:m.id.toString(),children:(0,nl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nl.jsx)("div",{className:`w-3 h-3 rounded-full ${m.color}`}),m.name]})},m.id))})]})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,nl.jsxs)(dt,{value:n.sprint,onValueChange:m=>d("sprint",m),children:[(0,nl.jsx)(tt,{children:(0,nl.jsx)(Dt,{placeholder:"Select a sprint"})}),(0,nl.jsxs)(at,{children:[(0,nl.jsx)(ye,{value:"none",children:"No Sprint"}),i.map(m=>(0,nl.jsx)(ye,{value:m.id.toString(),children:(0,nl.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.id))]})]})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"sprint",children:"Assignee"}),(0,nl.jsxs)(dt,{value:n.assignee,onValueChange:m=>d("assignee",m),children:[(0,nl.jsx)(tt,{children:(0,nl.jsx)(Dt,{placeholder:"Select an Assignee"})}),(0,nl.jsxs)(at,{children:[(0,nl.jsx)(ye,{value:"none",children:"No Assignee"}),r.map(m=>(0,nl.jsx)(ye,{value:m.id.toString(),children:(0,nl.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.id))]})]})]}),(0,nl.jsxs)(qo,{children:[(0,nl.jsx)(b,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,nl.jsx)(b,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Zc=({comments:e,onAddComment:t})=>{let[a,o]=(0,or.useState)(""),i=s=>s.split(" ").map(n=>n[0]).join("").toUpperCase(),r=()=>{a.trim()&&(t(a),o(""))};return(0,nl.jsxs)("div",{className:"space-nl-4",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nl.jsx)(Dl.MessageSquare,{className:"h-5 w-5"}),(0,nl.jsx)(E,{className:"text-lg font-medium",children:"Comments"}),(0,nl.jsx)(pe,{variant:"secondary",children:e.length})]}),(0,nl.jsx)("div",{className:"space-nl-4 max-h-60 overflow-nl-auto",children:e.map(s=>(0,nl.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,nl.jsx)(ra,{className:"h-8 w-8 Dl-1",children:(0,nl.jsx)(na,{className:"text-nl bg-muted text-muted-foreground",children:i(s.author)})}),(0,nl.jsxs)("div",{className:"flex-1",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,nl.jsx)("span",{className:"font-medium text-sm",children:s.author}),(0,nl.jsxs)("span",{className:"text-nl text-muted-foreground",children:[s.createdAt.toLocaleDateString()," at ",s.createdAt.toLocaleTimeString()]})]}),(0,nl.jsx)("p",{className:"text-sm text-muted-foreground",children:s.text})]})]},s.id))}),(0,nl.jsxs)("div",{className:"flex gap-2",children:[(0,nl.jsx)(ze,{value:a,onChange:s=>o(s.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,nl.jsx)(b,{onClick:r,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,nl.jsx)(Dl.Send,{className:"h-4 w-4"})})]})]})};var un=({label:e,value:t,onValueChange:a,options:o,showColor:i=!1,disabled:r=!1})=>{let[s,n]=(0,or.useState)(!1),c=o.find(d=>d.value===t);return(0,nl.jsxs)("div",{className:"space-nl-1",children:[(0,nl.jsx)(E,{className:"text-nl text-muted-foreground",children:e}),(0,nl.jsxs)(dt,{value:t,onValueChange:a,open:s,onOpenChange:d=>{r||n(d)},disabled:r,children:[(0,nl.jsx)(tt,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-nl",children:(0,nl.jsxs)(pe,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&n(!s),children:[i&&c?.color&&(0,nl.jsx)("div",{className:`w-2 h-2 rounded-full ${c.color} mr-1`}),c?.label||"Select..."]})}),(0,nl.jsx)(at,{children:o.map(d=>(0,nl.jsx)(ye,{value:d.value,children:i&&d.color?(0,nl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nl.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var Tt=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var Ru=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Dl.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Dl.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Dl.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Dl.Zap}],Au=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}];var em=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:i,onClose:r,onDelete:s,isUpdating:n=!1,isDeleting:c=!1,deleteState:l="idle",teamMembers:d})=>{let[m,g]=(0,or.useState)(e.storyPoints),f=(0,or.useRef)(null),[h,x]=(0,or.useState)(d);(0,or.useEffect)(()=>{x(d)},[d]);let p=(0,or.useCallback)((w,D)=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{i(w,D)},500)},[i]);(0,or.useEffect)(()=>{p("storyPoints",m?.toString()||"1")},[m]);let S=w=>w.split(" ").map(D=>D[0]).join("").toUpperCase(),P=()=>l==="loading"?(0,nl.jsxs)(b,{disabled:!0,variant:"destructive",className:"w-full h-8 text-nl gap-1",children:[(0,nl.jsx)(Dl.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):l==="success"?(0,nl.jsxs)(b,{disabled:!0,variant:"destructive",className:"w-full h-8 text-nl gap-1",children:[(0,nl.jsx)(Dl.Check,{className:"h-3 w-3"}),"Deleted"]}):l==="error"?(0,nl.jsxs)(b,{disabled:!0,variant:"destructive",className:"w-full h-8 text-nl gap-1",children:[(0,nl.jsx)(Dl.nl,{className:"h-3 w-3"}),"Delete failed"]}):(0,nl.jsxs)(b,{onClick:s,variant:"destructive",className:"w-full h-8 text-nl gap-1",disabled:n||c,children:[(0,nl.jsx)(Dl.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,nl.jsxs)("div",{className:"flex flex-col h-full",children:[(0,nl.jsxs)("div",{className:"space-nl-4",style:{opacity:n?.6:1},children:[(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{className:"text-nl text-muted-foreground",children:"Status"}),(0,nl.jsx)(un,{label:"",value:e.status,onValueChange:w=>i("status",w),options:[{value:"todo",label:"To Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:n})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{className:"text-nl text-muted-foreground",children:"Type"}),(0,nl.jsx)(Lo,{type:"single",value:e.type||"",onValueChange:w=>w&&i("type",w),className:"grid grid-cols-2 gap-1",disabled:n,children:Ru.map(w=>{let D=w.icon;return(0,nl.jsxs)(Fo,{value:w.value,className:"flex items-center gap-1 text-nl h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:n,children:[(0,nl.jsx)(D,{className:"h-3 w-3"}),w.label]},w.value)})})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{className:"text-nl text-muted-foreground",children:"Priority"}),(0,nl.jsx)(Lo,{type:"single",value:e.priority||"",onValueChange:w=>w&&i("priority",w),className:"grid grid-cols-3 gap-1",disabled:n,children:Au.map(w=>(0,nl.jsx)(Fo,{value:w.value,className:"text-nl h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:n,children:w.label},w.value))})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{className:"text-nl text-muted-foreground",children:"Story Points"}),(0,nl.jsx)("input",{type:"number",min:"1",max:"100",value:m||1,onChange:w=>{let D=Number(w.target.value);D<1?g(1):D>100?g(100):g(D)},className:"w-full h-8 px-2 text-nl border border-border rounded-nl focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:n})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{className:"text-nl text-muted-foreground",children:"Epic"}),(0,nl.jsx)(un,{label:"",value:Tt(e.epic).toString(),onValueChange:w=>i("epic",w),options:(t||[]).map(w=>({value:w.id.toString(),label:w?.name,color:w.color})),showColor:!0,disabled:n})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{className:"text-nl text-muted-foreground",children:"Sprint"}),(0,nl.jsx)(un,{label:"",value:Tt(e.sprint).toString()||"none",onValueChange:w=>i("sprint",w==="none"?"":w),options:[{value:"none",label:"No Sprint"},...(a||[]).map(w=>({value:w.id.toString(),label:`${w?.name}`}))],disabled:n})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{className:"text-nl text-muted-foreground",children:"Assignee"}),(0,nl.jsx)(Or,{label:"",value:e.assignee?.value?.name,onValueChange:w=>i("assignee",w),options:h.map(w=>({value:`${typeof w.email=="string"?"users":"digital-colleagues"}:${w.id}`,label:w?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:n})]})]}),(0,nl.jsxs)("div",{className:"Dl-auto Te-4 space-nl-4",children:[(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(b,{onClick:r,variant:"outline",className:"w-full h-8 text-nl",disabled:n||c,children:"Close"}),P()]}),(0,nl.jsxs)("div",{className:"Te-4 border-t border-border space-nl-2",children:[(0,nl.jsx)("div",{className:"text-nl text-muted-foreground font-medium mb-2",children:"Information"}),(0,nl.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nl.jsx)("span",{className:"text-nl text-muted-foreground",children:"Logged By"}),(0,nl.jsxs)("div",{className:"flex items-center gap-1 text-nl text-muted-foreground",children:[(0,nl.jsx)(Dl.User,{className:"h-3 w-3"}),(0,nl.jsx)("span",{children:"System"})]})]}),(0,nl.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nl.jsx)("span",{className:"text-nl text-muted-foreground",children:"Created"}),(0,nl.jsxs)("div",{className:"flex items-center gap-1 text-nl text-muted-foreground",children:[(0,nl.jsx)(Dl.Calendar,{className:"h-3 w-3"}),(0,nl.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,nl.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nl.jsx)("span",{className:"text-nl text-muted-foreground",children:"Last Updated"}),(0,nl.jsxs)("div",{className:"flex items-center gap-1 text-nl text-muted-foreground",children:[(0,nl.jsx)(Dl.Clock,{className:"h-3 w-3"}),(0,nl.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var tm=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:i,onUpdateTask:r,onDeleteTask:s,onAddComment:n,colleagues:c})=>{let[l,d]=(0,or.useState)(a),[m,g]=(0,or.useState)(new Date),[f,h]=(0,or.useState)("idle"),[x,p]=(0,or.useState)("idle"),[S,P]=(0,or.useState)([]),[w,D]=(0,or.useState)(c);(0,or.useEffect)(()=>{d(a)},[a]);let W=async(T,Re)=>{if(Re!==l[T]){h("loading");try{await r(l.id.toString(),{[T]:Re}),g(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(R){console.log("error",R),h("error"),setTimeout(()=>h("idle"),3e3)}}},A=async(T,Re)=>{if(Re!==l[T]){h("loading");try{await r(l.id.toString(),{[T]:Re}),g(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(R){console.log("error",R),h("error"),setTimeout(()=>h("idle"),3e3)}}},j=async T=>{if(n){h("loading");try{await n?.({content:T,taskId:l.id.toString()}),g(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch{h("error"),setTimeout(()=>h("idle"),3e3)}}},C=async()=>{p("loading");try{await s(l.id.toString()),p("success"),setTimeout(()=>{t(),p("idle")},1e3)}catch{p("error"),setTimeout(()=>p("idle"),3e3)}},F=f!=="loading"&&x!=="loading",q=()=>{F&&t()},O=()=>f==="loading"?(0,nl.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,nl.jsx)(Dl.Loader2,{className:"h-4 w-4 animate-spin"}),(0,nl.jsx)("span",{children:"Updating..."})]}):f==="success"?(0,nl.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,nl.jsx)(Dl.Check,{className:"h-4 w-4"}),(0,nl.jsx)("span",{children:"Updated successfully"})]}):f==="error"?(0,nl.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,nl.jsx)(Dl.nl,{className:"h-4 w-4"}),(0,nl.jsx)("span",{children:"Update failed"})]}):null;return(0,nl.jsx)(Ge,{open:e,onOpenChange:q,children:(0,nl.jsxs)(qe,{className:"max-w-3xl max-h-[80vh] overflow-nl-auto p-4",children:[(0,nl.jsxs)(Xe,{children:[(0,nl.jsx)(Ye,{className:"sr-only",children:l?.name}),(0,nl.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nl.jsx)("div",{className:"flex-1",children:O()}),!F&&(0,nl.jsx)("div",{className:"text-nl text-muted-foreground",children:"Please wait..."})]})]}),(0,nl.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,nl.jsxs)("div",{className:"lg:col-span-2 space-nl-4",children:[(0,nl.jsx)(ci,{fieldName:"name",value:l.name||"",label:"",onSave:W,className:"border-b border-border pb-3",disabled:f==="loading"}),(0,nl.jsx)(ci,{fieldName:"description",value:l.description||"",label:"Description",multiline:!0,onSave:W,disabled:f==="loading"}),(0,nl.jsx)(Zc,{comments:(l?.comments||[]).map(T=>({author:T.author.value.name||"",createdAt:new Date(T.timestamp),text:T.text,id:T.id||""})),onAddComment:j})]}),(0,nl.jsx)(em,{task:l,epics:o,sprints:i,lastUpdated:m,onUpdateTask:A,onClose:q,onDelete:C,isUpdating:f==="loading",isDeleting:x==="loading",deleteState:x,teamMembers:w})]})]})})};var vi=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,i]=(0,or.useState)({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("T")[0],endDate:new Date().toISOString().split("T")[0],progress:0}),r=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],s=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],n=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],c=d=>{d.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:o.startDate,endDate:o.endDate}),i({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},l=(d,m)=>{i(g=>({...g,[d]:m}))};return(0,nl.jsx)(Ge,{open:e,onOpenChange:t,children:(0,nl.jsxs)(qe,{className:"sm:max-w-nl",children:[(0,nl.jsx)(Xe,{children:(0,nl.jsx)(Ye,{children:"Add New Epic"})}),(0,nl.jsxs)("form",{onSubmit:c,className:"space-nl-4",children:[(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"name",children:"Epic Name"}),(0,nl.jsx)(G,{id:"name",value:o.name,onChange:d=>l("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"description",children:"Description"}),(0,nl.jsx)(ze,{id:"description",value:o.description,onChange:d=>l("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{children:"Color"}),(0,nl.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(d=>(0,nl.jsx)("button",{type:"button",onClick:()=>l("color",d),className:`w-8 h-8 rounded-full ${d} ${o.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,nl.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{children:"Confidence"}),(0,nl.jsxs)(dt,{value:o.confidence,onValueChange:d=>l("confidence",d),children:[(0,nl.jsx)(tt,{children:(0,nl.jsx)(Dt,{})}),(0,nl.jsx)(at,{children:s.map(d=>(0,nl.jsx)(ye,{value:d.value,children:d.label},d.value))})]})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{children:"Phase"}),(0,nl.jsxs)(dt,{value:o.phase.toString(),onValueChange:d=>l("phase",parseInt(d)),children:[(0,nl.jsx)(tt,{children:(0,nl.jsx)(Dt,{})}),(0,nl.jsx)(at,{children:n.map(d=>(0,nl.jsx)(ye,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,nl.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{children:"Start Date"}),(0,nl.jsx)(G,{type:"date",value:o.startDate,onChange:d=>l("startDate",d.target.value)})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{children:"End Date"}),(0,nl.jsx)(G,{type:"date",value:o.endDate,onChange:d=>l("endDate",d.target.value)})]})]}),(0,nl.jsxs)(qo,{children:[(0,nl.jsx)(b,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,nl.jsx)(b,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var om=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:i=[],initialProjects:r=[],onAddTask:s,onUpdateTask:n,onDeleteTask:c,onTaskClick:l,onAddEpic:d,onAddComment:m})=>{let[g,f]=(0,Qe.useState)([]),[h,x]=(0,Qe.useState)([]),[p,S]=(0,Qe.useState)([]),[P,w]=(0,Qe.useState)(!1),[D,W]=(0,Qe.useState)(!1),[A,j]=(0,Qe.useState)(null),[C,F]=(0,Qe.useState)(null),[q,O]=(0,Qe.useState)([]),[T,Re]=(0,Qe.useState)([]),[R,M]=(0,Qe.useState)(0),K=(0,Qe.useRef)(null),B=(0,Qe.useRef)(null),Le=Qe.default.useMemo(()=>[...h.map(J=>J.id),0],[h]),nt=(0,Qe.useRef)(""),_=(0,Qe.useRef)(""),k=(0,Qe.useRef)(""),z=(0,Qe.useRef)(""),de=J=>J.map(N=>`${N.id}-${new Date(N.createdAt).getTime()}-${new Date(N.updatedAt).getTime()}`).join("-");(0,Qe.useEffect)(()=>{let J=de(e);J!==nt.current&&(f(e),A&&j(e.find(N=>N.id===A.id)||null),nt.current=J)},[e]),(0,Qe.useEffect)(()=>{let J=de(t);J!==_.current&&(x(t),_.current=J)},[t]),(0,Qe.useEffect)(()=>{let J=de(a);J!==k.current&&(S(a),k.current=J)},[a]),(0,Qe.useEffect)(()=>{let J=de(i.map(N=>({id:N.id,updatedAt:N.updatedAt,createdAt:N.createdAt})));J!==z.current&&(Re(i),z.current=J)},[i]),(0,Qe.useEffect)(()=>{let J=()=>{if(K.current){let ce=K.current.offsetHeight;M(ce)}};J();let N=new ResizeObserver(J);K.current&&N.observe(K.current);let I=()=>{setTimeout(J,100)};return window.addEventListener("storage",I),()=>{N.disconnect(),window.removeEventListener("storage",I)}},[]),(0,Qe.useEffect)(()=>{let J=setTimeout(()=>{K.current&&M(K.current.offsetHeight)},300);return()=>clearTimeout(J)},[P,D]);let He=g.filter(J=>!0),De=J=>He.filter(N=>N.status===J),Ct=J=>{let N={};return h.forEach(I=>{N[I.id]=J.filter(ce=>Tt(ce.epic)===I.id)}),N["no-epic"]=J.filter(I=>!Tt(I.epic)),N},H=J=>{F(J)},Je=J=>{C&&(f(N=>N.map(I=>I.id===C.id?{...I,status:J}:I)),n?.(C.id.toString(),{status:J}),F(null))},fa=J=>{let N={...J,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};f(I=>[...I,N]),s?.(J)},oo=async(J,N)=>{f(I=>I.map(ce=>ce.id===Number(J)?{...ce,...N}:ce)),n&&await n(J,N),A?.id===Number(J)&&j(I=>({...I,...N}))},wo=async J=>{f(N=>N.filter(I=>I.id!==Number(J))),A?.id===Number(J)&&j(null),c&&await c(J)},zo=J=>{let N={...J,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};x(I=>[...I,N]),d?.(J)},io=J=>{j(J),l?.(J)},Vo=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Ko=R>0?`calc(100vh - ${R+120}px)`:"calc(100vh - 12rem)";return(0,nl.jsxs)("div",{ref:B,className:"h-full flex flex-col px-2 nl:px-4 py-4",children:[(0,nl.jsx)("div",{ref:K,className:"flex-shrink-0",children:(0,nl.jsx)(bt,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-Dl-r from-purple-600 via-violet-600 Dl-indigo-600",primaryAction:{label:"Add task",onClick:()=>w(!0)},secondaryAction:{label:"Add epic",onClick:()=>W(!0)}})}),(0,nl.jsx)("div",{className:"flex-1 min-h-0 Dl-8",children:(0,nl.jsx)("div",{className:"h-full",style:{height:R>0?`calc(100vh - ${R+120}px)`:"calc(100vh - 12rem)"},children:(0,nl.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:Vo.map(J=>{let N=De(J.status),I=Ct(N);return(0,nl.jsxs)(Xc,{title:J.title,status:J.status,taskCount:N.length,onDrop:Je,isCompact:J.status==="done",height:Ko,children:[I["no-epic"].map(ce=>(0,nl.jsx)(Zi,{epic:null,task:ce,onDragStart:H,onTaskClick:io,isCompact:J.status==="done"},ce.id)),Le.map(ce=>{let Fe=h.find(vt=>vt.id===ce),wt=I[ce]||[];return wt.length===0?null:(0,nl.jsxs)("div",{className:"mb-6",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,nl.jsx)("div",{className:`w-3 h-3 rounded-full ${Fe?.color}`}),(0,nl.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Fe?.name||"No Epic"}),(0,nl.jsx)(pe,{variant:"secondary",className:"text-nl",children:wt.length})]})," ",(0,nl.jsx)("div",{className:"space-nl-3",children:wt.map(vt=>(0,nl.jsx)(Zi,{task:vt,epic:Fe,onDragStart:H,onTaskClick:io,isCompact:J.status==="done"},vt.id))})]},ce)})]},J.id)})})})}),(0,nl.jsx)(gi,{isOpen:P,onClose:()=>w(!1),onAddTask:fa,assignees:[...T,...q],epics:h,sprints:p}),(0,nl.jsx)(vi,{isOpen:D,onClose:()=>W(!1),onAddEpic:zo}),A&&(0,nl.jsx)(tm,{isOpen:!!A,onClose:()=>j(null),initialTask:A,epics:h,sprints:p,onUpdateTask:oo,onDeleteTask:wo,colleagues:T,onAddComment:m})]})};var im=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddTaskToEpic:r,onAddEpic:s,onUpdateEpic:n,onDeleteEpic:c})=>{let[l,d]=(0,or.useState)(t),[m,g]=(0,or.useState)(null),[f,h]=(0,or.useState)(null),[x,p]=(0,or.useState)({}),[S,P]=(0,or.useState)(0),[w,D]=(0,or.useState)(!1),[W,A]=(0,or.useState)(!1),[j,C]=(0,or.useState)(null),F=(0,or.useRef)(null),q=(0,or.useRef)(null);(0,or.useEffect)(()=>{d(t)},[t]),(0,or.useEffect)(()=>{let k=()=>{if(F.current){let He=F.current.offsetHeight;P(He)}};k();let z=new ResizeObserver(k);F.current&&z.observe(F.current);let de=()=>{setTimeout(k,100)};return window.addEventListener("storage",de),()=>{z.disconnect(),window.removeEventListener("storage",de)}},[]),(0,or.useEffect)(()=>{let k=setTimeout(()=>{F.current&&P(F.current.offsetHeight)},300);return()=>clearTimeout(k)},[f]);let O=k=>{g(k)},T=k=>{k.preventDefault()},Re=(k,z)=>{k.preventDefault(),m&&Tt(m.epic).toString()!==z&&(o(m.id.toString(),{epic:Number(z)}),g(null))},R=k=>e.filter(z=>Tt(z.epic).toString()===k),M=k=>{h(k.id.toString()),p({name:k.name,description:k.description,confidence:k.confidence,phase:k.phase})},K=async()=>{f&&x.name&&(await n(f.toString(),x),d(k=>k.map(z=>z.id.toString()===f?{...z,...x}:z)),h(null),p({}))},B=()=>{h(null),p({})},Le=async k=>{window.confirm("Are you sure you want Dl delete this epic? This will also delete all associated tasks.")&&(await c(k),d(z=>z.filter(de=>de.id.toString()!==k)))},nt=k=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[k]||`Phase ${k}`,_=k=>{switch(k){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsxs)("div",{ref:q,className:"h-full flex flex-col px-2 nl:px-4 py-4",children:[(0,nl.jsx)("div",{ref:F,className:"flex-shrink-0",children:(0,nl.jsx)(bt,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-Dl-r from-rose-600 via-pink-600 Dl-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>D(!0)}})}),(0,nl.jsx)("div",{className:"flex-1 min-h-0 Dl-8",children:(0,nl.jsx)("div",{className:"h-full overflow-nl-auto",style:{height:S>0?`calc(100vh - ${S+120}px)`:"calc(100vh - 12rem)"},children:(0,nl.jsx)("div",{className:"grid grid-cols-1 nl:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:l.map(k=>{let z=R(k.id.toString()),de=z.reduce((De,Ct)=>De+(Ct.storyPoints||0),0),He=S>0?`calc(100vh - ${S+200}px)`:"calc(100vh - 14rem)";return(0,nl.jsxs)(Y,{className:`flex flex-col ${f===k.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:f===k.id.toString()?"auto":He,minHeight:"400px"},onDragOver:T,onDrop:De=>Re(De,k.id.toString()),children:[(0,nl.jsx)("div",{className:"p-4 border-b border-border",children:f===k.id.toString()?(0,nl.jsxs)("div",{className:"space-nl-4",children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nl.jsx)(G,{value:x.name||"",onChange:De=>p({...x,name:De.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,nl.jsxs)("div",{className:"flex gap-2 nl-2",children:[(0,nl.jsx)(b,{size:"sm",variant:"ghost",onClick:K,className:"p-1 h-8 w-8",children:(0,nl.jsx)(Dl.Check,{className:"h-4 w-4"})}),(0,nl.jsx)(b,{size:"sm",variant:"ghost",onClick:B,className:"p-1 h-8 w-8",children:(0,nl.jsx)(Dl.nl,{className:"h-4 w-4"})})]})]}),(0,nl.jsx)(ze,{value:x.description||"",onChange:De=>p({...x,description:De.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,nl.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,nl.jsxs)("div",{children:[(0,nl.jsx)("label",{className:"text-nl text-muted-foreground",children:"Confidence"}),(0,nl.jsxs)("select",{value:x.confidence||k.confidence,onChange:De=>p({...x,confidence:De.target.value}),className:"flex h-8 w-full rounded-nl border border-input bg-background px-3 py-2 text-nl ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,nl.jsx)("option",{value:"low",children:"Low"}),(0,nl.jsx)("option",{value:"medium",children:"Medium"}),(0,nl.jsx)("option",{value:"high",children:"High"})]})]}),(0,nl.jsxs)("div",{children:[(0,nl.jsx)("label",{className:"text-nl text-muted-foreground",children:"Phase"}),(0,nl.jsx)("select",{value:x.phase?.toString()||k.phase.toString(),onChange:De=>p({...x,phase:parseInt(De.target.value)}),className:"flex h-8 w-full rounded-nl border border-input bg-background px-3 py-2 text-nl ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(De=>(0,nl.jsxs)("option",{value:De.toString(),children:["Phase ",De]},De))})]})]})]}):(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,nl.jsx)("div",{className:`w-4 h-4 rounded-full ${k.color}`}),(0,nl.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:k.name}),(0,nl.jsxs)("div",{className:"flex gap-1",children:[(0,nl.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>M(k),className:"p-1 h-8 w-8",children:(0,nl.jsx)(Dl.Edit2,{className:"h-3 w-3"})}),(0,nl.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>Le(k.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,nl.jsx)(Dl.Trash2,{className:"h-3 w-3"})})]})]}),(0,nl.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,nl.jsxs)(pe,{className:`text-nl ${_(k.confidence)}`,children:[k.confidence," confidence"]}),(0,nl.jsxs)(pe,{variant:"outline",className:"text-nl",children:["Phase ",k.phase]}),(0,nl.jsxs)(pe,{variant:"secondary",className:"text-nl bg-muted text-muted-foreground",children:[z.length," tasks"]}),(0,nl.jsxs)(pe,{variant:"secondary",className:"text-nl bg-muted text-muted-foreground",children:[de," pts"]})]}),k.description&&(0,nl.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:k.description}),(0,nl.jsxs)(b,{onClick:()=>{A(!0),C(k)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,nl.jsx)(Dl.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,nl.jsx)("div",{className:"flex-1 p-4 overflow-nl-auto",children:(0,nl.jsx)("div",{className:`space-nl-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${m?"border-primary bg-primary/10":"border-border"}`,children:z.length===0?(0,nl.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-muted-foreground border-2 border-dashed border-border rounded-lg",children:[(0,nl.jsx)(Dl.Move,{className:"h-8 w-8 mb-2"}),(0,nl.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):z.map(De=>(0,nl.jsx)(Zi,{task:De,epic:k,onDragStart:O,onTaskClick:i,isCompact:!0},De.id))})})]},k.id)})})})})]}),(0,nl.jsx)(vi,{isOpen:w,onClose:()=>D(!1),onAddEpic:s}),(0,nl.jsx)(gi,{isOpen:W,onClose:()=>A(!1),onAddTask:r,assignees:[],epics:[],defaultEpicId:j?.id.toString()||"",sprints:a})]})};var Os=require("date-fns");var nm=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,i]=(0,or.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),r=n=>{n.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),i({name:"",description:"",startDate:void 0,endDate:void 0}),t())},s=()=>{i({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,nl.jsx)(Ge,{open:e,onOpenChange:s,children:(0,nl.jsxs)(qe,{className:"sm:max-w-nl",children:[(0,nl.jsx)(Xe,{children:(0,nl.jsx)(Ye,{children:"Add New Sprint"})}),(0,nl.jsxs)("form",{onSubmit:r,className:"space-nl-4",children:[(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"name",children:"Sprint Name *"}),(0,nl.jsx)(G,{id:"name",value:o.name,onChange:n=>i(c=>({...c,name:n.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"description",children:"Description"}),(0,nl.jsx)(ze,{id:"description",value:o.description,onChange:n=>i(c=>({...c,description:n.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,nl.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{children:"Start Date *"}),(0,nl.jsxs)(Is,{children:[(0,nl.jsx)(Es,{asChild:!0,children:(0,nl.jsxs)(b,{variant:"outline",className:u("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,nl.jsx)(Dl.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,Os.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,nl.jsx)(sn,{className:"w-auto p-0",align:"start",children:(0,nl.jsx)(ln,{mode:"single",selected:o.startDate,onSelect:n=>i(c=>({...c,startDate:n})),initialFocus:!0})})]})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{children:"End Date *"}),(0,nl.jsxs)(Is,{children:[(0,nl.jsx)(Es,{asChild:!0,children:(0,nl.jsxs)(b,{variant:"outline",className:u("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,nl.jsx)(Dl.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,Os.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,nl.jsx)(sn,{className:"w-auto p-0",align:"start",children:(0,nl.jsx)(ln,{mode:"single",selected:o.endDate,onSelect:n=>i(c=>({...c,endDate:n})),initialFocus:!0,disabled:n=>o.startDate?n<o.startDate:!1})})]})]})]}),(0,nl.jsxs)("div",{className:"flex justify-end gap-3 Te-4",children:[(0,nl.jsx)(b,{type:"button",variant:"outline",onClick:s,children:"Cancel"}),(0,nl.jsx)(b,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var gn=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddSprint:r,onUpdateSprint:s,onDeleteSprint:n})=>{let[c,l]=(0,or.useState)([]),[d,m]=(0,or.useState)(new Set),[g,f]=(0,or.useState)(null),[h,x]=(0,or.useState)(!1),[p,S]=(0,or.useState)(null),[P,w]=(0,or.useState)(null),[D,W]=(0,or.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[A,j]=(0,or.useState)([]),[C,F]=(0,or.useState)("upcoming"),[q,O]=(0,or.useState)(!1),[T,Re]=(0,or.useState)(0),R=(0,or.useRef)(null),M=(0,or.useRef)(null);(0,or.useEffect)(()=>{let N=()=>{R.current&&Re(R.current.offsetHeight)};N();let I=new ResizeObserver(N);return R.current&&I.observe(R.current),()=>I.disconnect()},[]);let K=N=>t.find(I=>I.id===Number(N)),B=N=>a.find(I=>I.id===Number(N)),Le=N=>{let I={high:"bg-red-100 text-red-800 border-red-200",medium:"bg-orange-100 text-orange-800 border-orange-200",low:"bg-green-100 text-green-800 border-green-200"};return I[N]||I.medium},nt=N=>{if(!N||N?.length===0)return"";let I=N?.trim().split(" ");if(I?.length===1)return I[0];let ce=I[0],Fe=I[I.length-1][0].toUpperCase();return`${ce} ${Fe}`},_=N=>{let I={},ce=[];return N.forEach(Fe=>{Fe.epic?(I[Tt(Fe.epic)]||(I[Tt(Fe.epic)]=[]),I[Tt(Fe.epic)].push(Fe)):ce.push(Fe)}),{tasksByEpic:I,unassignedTasks:ce}};(0,or.useEffect)(()=>{j(a)},[a]);let k=A.filter(N=>{switch(C){default:return!0}}),z=A.filter(N=>c.includes(N.id.toString())),de=e.filter(N=>!N.sprint||N.status==="backlog"),He=de.reduce((N,I)=>N+(I.storyPoints||0),0),De=N=>{l(I=>I.includes(N)?I.filter(ce=>ce!==N):I?.length<3?[...I,N]:I)},Ct=N=>{m(I=>{let ce=new Set(I);return ce.has(N)?ce.delete(N):ce.add(N),ce})},H=N=>{r(N),x(!1)},Je=N=>{w(N.id.toString()),W({name:N.name,description:N.description||"",startDate:N.startDate?new Date(N.startDate).toISOString().split("T")[0]:N.startDate,endDate:N.endDate?new Date(N.endDate).toISOString().split("T")[0]:N.endDate,isActive:!1})},fa=()=>{P&&(s(P,{name:D.name,description:D.description,startDate:D.startDate,endDate:D.endDate}),j(N=>N.map(I=>(I.id===Number(P)&&(I.name=D.name,I.description=D.description,I.startDate=D.startDate,I.endDate=D.endDate),I))),w(null))},oo=()=>{w(null),W({name:"",description:"",startDate:"",endDate:"",isActive:!1})},wo=(N,I)=>{f(I),N.dataTransfer.effectAllowed="move"},zo=N=>{N.preventDefault(),N.dataTransfer.dropEffect="move"},io=N=>{S(N)},Vo=()=>{S(null)},Ko=(N,I)=>{if(N.preventDefault(),S(null),!g)return;(Tt(g.sprint)||void 0)!==Number(I)&&o(g.id.toString(),{sprint:Number(I)}),f(null)},J=({task:N,showSprint:I=!1})=>{let ce=N.epic?K(Tt(N.epic).toString()):null,Fe=N.sprint?B(Tt(N.sprint).toString()):null;return(0,nl.jsx)(Y,{className:"p-3 cursor-grab active:cursor-grabbing hover:shadow-nl transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:qt=>{qt.dataTransfer.effectAllowed="move",qt.dataTransfer.setData("text/plain",N.id.toString()),wo(qt,N)},onClick:qt=>{g===null&&i(N)},style:{userSelect:"none"},children:(0,nl.jsxs)("div",{className:"space-nl-2 pointer-events-none",children:[(0,nl.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,nl.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:N.name}),(0,nl.jsx)(pe,{className:`text-nl ${Le(N.priority||"medium")}`,children:N.priority?.[0]?.toUpperCase()})]}),(0,nl.jsxs)("div",{className:"flex items-center justify-between text-nl",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-1",children:[ce&&(0,nl.jsx)("div",{className:`w-2 h-2 rounded-full ${ce.color}`}),(0,nl.jsx)("span",{className:"text-muted-foreground truncate",children:ce?.name})]}),(0,nl.jsx)("span",{className:"text-muted-foreground",children:nt(N.assignee?.value?.name)})]}),I&&Fe&&(0,nl.jsxs)("div",{className:"flex items-center gap-1 text-nl text-muted-foreground",children:[(0,nl.jsx)(Dl.Calendar,{className:"h-3 w-3"}),(0,nl.jsx)("span",{children:Fe.name})]})]})})};return(0,nl.jsxs)("div",{ref:M,className:"h-full flex flex-col px-2 nl:px-4 py-4",children:[(0,nl.jsx)("div",{ref:R,className:"flex-shrink-0",children:(0,nl.jsx)(bt,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-Dl-r from-orange-600 via-amber-600 Dl-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>x(!0)}})}),(0,nl.jsx)("div",{className:"flex-1 min-h-0 Dl-8",children:(0,nl.jsxs)("div",{className:"h-full",style:{height:T>0?`calc(100vh - ${T+120}px)`:"calc(100vh - 12rem)"},children:[(0,nl.jsxs)("div",{className:"mb-4",children:[(0,nl.jsx)(Y,{className:"p-3 bg-card shadow-sm",children:(0,nl.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-3",children:[(0,nl.jsxs)("div",{children:[(0,nl.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,nl.jsxs)("p",{className:"text-nl text-muted-foreground",children:[c?.length,"/3 selected"]})]}),c?.length>0&&(0,nl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nl.jsx)("span",{className:"text-nl text-muted-foreground",children:"Viewing:"}),(0,nl.jsx)("div",{className:"flex flex-wrap gap-1",children:z.map(N=>(0,nl.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-nl",children:[(0,nl.jsx)("span",{className:"max-w-[80px] truncate",children:N.name}),(0,nl.jsx)("button",{onClick:()=>De(N.id.toString()),className:"nl-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,nl.jsx)(Dl.nl,{className:"h-4 w-4"})})]},N.id))})]})]}),(0,nl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nl.jsxs)(b,{onClick:()=>x(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,nl.jsx)(Dl.Plus,{className:"h-3 w-3"}),"Add"]}),(0,nl.jsxs)(b,{onClick:()=>O(!q),variant:"outline",size:"sm",className:"gap-1",children:[(0,nl.jsx)(Dl.Calendar,{className:"h-3 w-3"}),q?"Close":"Select"]})]})]})}),q&&(0,nl.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>O(!1)}),(0,nl.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-xl z-10 transition-all duration-300 ease-in-out ${q?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,nl.jsxs)(Y,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,nl.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nl.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,nl.jsx)(b,{variant:"ghost",size:"sm",onClick:()=>O(!1),className:"h-8 w-8 p-0",children:(0,nl.jsx)(Dl.nl,{className:"h-4 w-4"})})]}),(0,nl.jsx)("p",{className:"text-sm text-muted-foreground Dl-1",children:"Choose up Dl 3 sprints Dl view in your planning board"})]}),(0,nl.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,nl.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(N=>(0,nl.jsxs)(b,{variant:C===N.key?"default":"outline",size:"sm",onClick:()=>F(N.key),className:"text-nl h-8 px-3 flex-1",children:[N.label," (",N.count,")"]},N.key))}),(0,nl.jsx)("div",{className:"space-nl-2 flex-1 overflow-nl-auto",children:k.length>0?k.map(N=>{let I=c.includes(N.id.toString()),ce=e.filter(wt=>Tt(wt.sprint)===N.id).length,Fe=!I&&c.length<3;return(0,nl.jsx)("div",{className:`p-3 rounded-lg border transition-all ${I?"bg-primary/10 border-primary/30":Fe?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:P===N.id.toString()?(0,nl.jsxs)("div",{className:"space-nl-3",children:[(0,nl.jsx)(G,{value:D.name,onChange:wt=>W(vt=>({...vt,name:wt.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,nl.jsx)(ze,{value:D.description,onChange:wt=>W(vt=>({...vt,description:wt.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,nl.jsxs)("div",{className:"flex gap-2",children:[(0,nl.jsxs)(b,{size:"sm",onClick:()=>fa(),className:"flex-1",children:[(0,nl.jsx)(Dl.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,nl.jsxs)(b,{size:"sm",variant:"outline",onClick:oo,className:"flex-1",children:[(0,nl.jsx)(Dl.nl,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,nl.jsxs)("div",{children:[(0,nl.jsxs)("div",{className:"flex items-start justify-between",children:[(0,nl.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,nl.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:N.name}),(0,nl.jsx)(pe,{variant:"default",className:"text-nl bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,nl.jsx)("p",{className:"text-nl text-muted-foreground line-clamp-2 mb-2",children:N.description}),(0,nl.jsxs)("div",{className:"flex items-center gap-3 text-nl text-muted-foreground",children:[(0,nl.jsxs)("span",{className:"flex items-center gap-1",children:[(0,nl.jsx)(Dl.CalendarDays,{className:"h-3 w-3"}),new Date(N.startDate).toLocaleDateString()]}),(0,nl.jsxs)("span",{className:"flex items-center gap-1",children:[(0,nl.jsx)(Dl.User,{className:"h-3 w-3"}),ce," tasks"]})]})]}),(0,nl.jsxs)("div",{className:"flex items-center gap-1 nl-2",children:[(0,nl.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>Je(N),className:"h-6 w-6 p-0",children:(0,nl.jsx)(Dl.Edit2,{className:"h-3 w-3"})}),(0,nl.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>n(N.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,nl.jsx)(Dl.Trash2,{className:"h-3 w-3"})})]})]}),(0,nl.jsx)("div",{className:"flex items-center justify-between Dl-2",children:(0,nl.jsx)(b,{variant:I?"default":"outline",size:"sm",className:"text-nl w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>De(N.id.toString()),disabled:!I&&c?.length>=3,children:(0,nl.jsx)("span",{className:"pointer-events-none select-none",children:I?"Deselect":c?.length>=3?"Limit Reached":"Select"})})})]})},N.id)}):(0,nl.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,nl.jsx)(Dl.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,nl.jsxs)("p",{className:"text-sm",children:['No sprints found for "',C,'" filter']}),(0,nl.jsx)(b,{variant:"link",size:"sm",onClick:()=>F("all"),className:"text-nl",children:"Show all sprints"})]})}),c?.length===0&&(0,nl.jsx)("div",{className:"Dl-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,nl.jsxs)("div",{className:"text-center",children:[(0,nl.jsx)(Dl.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,nl.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints Dl start planning"}),(0,nl.jsx)("p",{className:"text-nl text-muted-foreground Dl-1",children:"Choose up Dl 3 sprints Dl view alongside your backlog"})]})})]})]})})]}),(0,nl.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,nl.jsx)("div",{className:"lg:col-span-1",children:(0,nl.jsxs)(Y,{className:"p-4 h-full bg-card border-l-4 border-l-gray-400 shadow-sm hover:shadow-nl transition-shadow duration-200 flex flex-col",onDragOver:zo,onDragEnter:()=>io("backlog"),onDragLeave:Vo,onDrop:N=>Ko(N,"backlog"),style:{height:T>0?`calc(100vh - ${T+200}px)`:"calc(100vh - 16rem)"},children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,nl.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,nl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nl.jsxs)(pe,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[de?.length," tasks"]}),(0,nl.jsxs)(pe,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[He," pts"]})]})]}),(0,nl.jsx)("div",{className:`flex-1 overflow-nl-auto space-nl-3 min-h-0 p-3 rounded transition-colors ${p==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:N,unassignedTasks:I}=_(de);return(0,nl.jsxs)(nl.Fragment,{children:[Object.entries(N).map(([ce,Fe])=>{let wt=K(ce);if(!wt)return null;let vt=d.has(ce);return(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-nl cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Ct(ce),children:[(0,nl.jsx)("div",{className:`w-3 h-3 rounded-full ${wt.color}`}),(0,nl.jsx)("span",{className:"font-medium text-muted-foreground",children:wt.name}),(0,nl.jsxs)("span",{className:"text-muted-foreground",children:["(",Fe?.length,")"]}),(0,nl.jsx)("div",{className:"nl-auto",children:vt?(0,nl.jsx)(Dl.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,nl.jsx)(Dl.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!vt&&(0,nl.jsx)("div",{className:"space-nl-2 pl-2",children:Fe.map(qt=>(0,nl.jsx)(J,{task:qt},qt.id))})]},ce)}),I?.length>0&&(()=>{let ce=d.has("no-epic");return(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-nl cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Ct("no-epic"),children:[(0,nl.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,nl.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,nl.jsxs)("span",{className:"text-muted-foreground",children:["(",I?.length,")"]}),(0,nl.jsx)("div",{className:"nl-auto",children:ce?(0,nl.jsx)(Dl.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,nl.jsx)(Dl.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ce&&(0,nl.jsx)("div",{className:"space-nl-2 pl-2",children:I?.map(Fe=>(0,nl.jsx)(J,{task:Fe},Fe.id))})]})})(),de?.length===0&&(0,nl.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here Dl move Dl backlog"}),de?.length>0&&Object.keys(N).length===0&&I.length===0&&(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)("div",{className:"text-nl text-muted-foreground mb-2",children:"Direct backlog tasks:"}),de?.map(ce=>(0,nl.jsx)(J,{task:ce},ce.id))]})]})})()})]})}),z.map(N=>{let I=e.filter(Fe=>Tt(Fe?.sprint)===N.id),ce=I.reduce((Fe,wt)=>Fe+(wt?.storyPoints||0),0);return(0,nl.jsxs)(Y,{className:"p-4 h-full bg-card border-l-4 border-l-blue-500 shadow-sm hover:shadow-nl transition-shadow duration-200 flex flex-col",onDragOver:zo,onDragEnter:()=>io(N.id.toString()),onDragLeave:Vo,onDrop:Fe=>Ko(Fe,N.id.toString()),style:{height:T>0?`calc(100vh - ${T+200}px)`:"calc(100vh - 16rem)"},children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,nl.jsx)("div",{children:(0,nl.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:N.name})}),(0,nl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nl.jsxs)(pe,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[I?.length," tasks"]}),(0,nl.jsxs)(pe,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[ce," pts"]}),(0,nl.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>{O(!0),Je(N)},className:"h-6 px-2",children:(0,nl.jsx)(Dl.Edit2,{className:"h-3 w-3"})}),(0,nl.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>n(N.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,nl.jsx)(Dl.Trash2,{className:"h-3 w-3"})})]})]}),(0,nl.jsx)("div",{className:"flex-1 overflow-nl-auto space-nl-3 min-h-0",children:(()=>{let{tasksByEpic:Fe,unassignedTasks:wt}=_(I);return(0,nl.jsxs)(nl.Fragment,{children:[Object.entries(Fe).map(([vt,qt])=>{let bi=K(vt);if(!bi)return null;let xi=d.has(vt);return(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-nl cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Ct(vt),children:[(0,nl.jsx)("div",{className:`w-3 h-3 rounded-full ${bi.color}`}),(0,nl.jsx)("span",{className:"font-medium text-muted-foreground",children:bi.name}),(0,nl.jsxs)("span",{className:"text-muted-foreground",children:["(",qt?.length,")"]}),(0,nl.jsx)("div",{className:"nl-auto",children:xi?(0,nl.jsx)(Dl.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,nl.jsx)(Dl.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!xi&&(0,nl.jsx)("div",{className:"space-nl-2 pl-2",children:qt?.map(yi=>(0,nl.jsx)(J,{task:yi},yi.id))})]},vt)}),wt?.length>0&&(()=>{let vt=d.has("no-epic");return(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-nl cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Ct("no-epic"),children:[(0,nl.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,nl.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,nl.jsxs)("span",{className:"text-muted-foreground",children:["(",wt?.length,")"]}),(0,nl.jsx)("div",{className:"nl-auto",children:vt?(0,nl.jsx)(Dl.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,nl.jsx)(Dl.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!vt&&(0,nl.jsx)("div",{className:"space-nl-2 pl-2",children:wt?.map(qt=>(0,nl.jsx)(J,{task:qt},qt.id))})]})})(),I?.length===0&&(0,nl.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},N.id)})]}),(0,nl.jsx)(nm,{isOpen:h,onClose:()=>x(!1),onAddSprint:H})]})})]})};var Mu=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),Iu=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},Hs=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[i,r]=t.split(":");o.setHours(parseInt(i),parseInt(r))}return o<a},js=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Eu=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Bu=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[i,r]=(0,or.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[s,n]=(0,or.useState)(!1),c=d=>{if(d.preventDefault(),!e.find(f=>f?.id.toString()===i.colleagueId.toString())){console.error("No valid colleague selected"),n(!0);return}n(!1);let g={title:i.title,description:i.description,dueDate:new Date(i.dueDate).toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring,assignedColleague:Number(i.colleagueId),project:1,updatedAt:new Date().toISOString()};t(g),o(!1),r({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,or.useEffect)(()=>{i.colleagueId&&n(!1)},[i.colleagueId]);let l=e.filter(Boolean);return(0,nl.jsx)(Ge,{open:a,onOpenChange:o,children:(0,nl.jsxs)(qe,{className:"max-w-2xl",children:[(0,nl.jsx)(Xe,{children:(0,nl.jsx)(Ye,{children:"Add New Reminder"})}),(0,nl.jsxs)("form",{onSubmit:c,className:"space-nl-4",children:[(0,nl.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,nl.jsxs)("div",{children:[(0,nl.jsx)(E,{htmlFor:"title",children:"Title"}),(0,nl.jsx)(G,{id:"title",value:i.title,onChange:d=>r({...i,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,nl.jsxs)("div",{children:[(0,nl.jsx)(E,{htmlFor:"description",children:"Description"}),(0,nl.jsx)(ze,{id:"description",value:i.description,onChange:d=>r({...i,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,nl.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,nl.jsxs)("div",{children:[(0,nl.jsx)(E,{htmlFor:"dueDate",children:"Due Date"}),(0,nl.jsx)(G,{id:"dueDate",type:"date",value:i.dueDate,onChange:d=>r({...i,dueDate:d.target.value}),required:!0})]}),(0,nl.jsxs)("div",{children:[(0,nl.jsx)(E,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,nl.jsx)(G,{id:"dueTime",type:"time",value:i.dueTime,onChange:d=>r({...i,dueTime:d.target.value})})]})]}),(0,nl.jsxs)("div",{children:[(0,nl.jsx)(E,{className:`${s?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,nl.jsxs)(dt,{value:i.colleagueId,onValueChange:d=>{r({...i,colleagueId:d})},required:!0,children:[(0,nl.jsx)(tt,{className:`${s?"text-destructive border-red-500":""}`,children:(0,nl.jsx)(Dt,{className:`${s?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(d=>d?.id.toString()===i.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,nl.jsx)(at,{children:l.map(d=>(0,nl.jsx)(ye,{value:d.id.toString(),children:d.name},d.id))})]}),s&&(0,nl.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nl.jsx)("input",{type:"checkbox",id:"isRecurring",checked:i.isRecurring,onChange:d=>r({...i,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,nl.jsx)(E,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),i.isRecurring&&(0,nl.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,nl.jsxs)("div",{children:[(0,nl.jsx)(E,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,nl.jsxs)(dt,{value:i.recurrencePattern,onValueChange:d=>r({...i,recurrencePattern:d}),children:[(0,nl.jsx)(tt,{children:(0,nl.jsx)(Dt,{})}),(0,nl.jsxs)(at,{children:[(0,nl.jsx)(ye,{value:"daily",children:"Daily"}),(0,nl.jsx)(ye,{value:"weekly",children:"Weekly"}),(0,nl.jsx)(ye,{value:"monthly",children:"Monthly"}),(0,nl.jsx)(ye,{value:"yearly",children:"Yearly"})]})]})]}),(0,nl.jsxs)("div",{children:[(0,nl.jsx)(E,{htmlFor:"recurrenceInterval",children:"Every"}),(0,nl.jsx)(G,{id:"recurrenceInterval",type:"number",min:"1",value:i.recurrenceInterval,onChange:d=>r({...i,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,nl.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,nl.jsx)(b,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,nl.jsx)(b,{type:"submit",children:"Add Reminder"})]})]})]})})},Lu=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:i})=>{let[r,s]=(0,or.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),n=l=>{l.preventDefault(),a(e.id.toString(),{title:r.title,description:r.description,dueDate:new Date(r.dueDate||"").toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring}),i()},c=t.filter(Boolean);return(0,nl.jsx)(Ge,{open:o,onOpenChange:i,children:(0,nl.jsxs)(qe,{className:"max-w-2xl",children:[(0,nl.jsx)(Xe,{children:(0,nl.jsx)(Ye,{children:"Edit Reminder"})}),(0,nl.jsxs)("form",{onSubmit:n,className:"space-nl-4",children:[(0,nl.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,nl.jsxs)("div",{children:[(0,nl.jsx)(E,{htmlFor:"edit-title",children:"Title"}),(0,nl.jsx)(G,{id:"edit-title",value:r.title,onChange:l=>s({...r,title:l.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,nl.jsxs)("div",{children:[(0,nl.jsx)(E,{htmlFor:"edit-description",children:"Description"}),(0,nl.jsx)(ze,{id:"edit-description",value:r.description||"",onChange:l=>s({...r,description:l.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,nl.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,nl.jsxs)("div",{children:[(0,nl.jsx)(E,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,nl.jsx)(G,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:l=>s({...r,dueDate:l.target.value}),required:!0})]}),(0,nl.jsxs)("div",{children:[(0,nl.jsx)(E,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,nl.jsx)(G,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:l=>s({...r,dueTime:l.target.value})})]})]}),(0,nl.jsx)("div",{className:"space-nl-2",children:(0,nl.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nl.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring||!1,onChange:l=>s({...r,isRecurring:l.target.checked}),className:"rounded border-border"}),(0,nl.jsx)(E,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,nl.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,nl.jsx)(b,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,nl.jsx)(b,{type:"submit",children:"Save Changes"})]})]})]})})},Fu=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[i,r]=(0,or.useState)(!1);if(!e||!e.id)return null;let s=Hs(new Date(e.dueDate||""),e.dueTime||""),n=js(new Date(e.dueDate||"")),c=Eu(new Date(e.dueDate||"")),l=()=>{a(e.id.toString(),{})},d=()=>n?"Today":c?"Tomorrow":Mu(new Date(e.dueDate||""));return(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)(Lu,{reminder:e,colleagues:t,onUpdateReminder:a,open:i,onClose:()=>r(!1)}),(0,nl.jsx)(Y,{children:(0,nl.jsx)(ve,{className:"p-4",children:(0,nl.jsxs)("div",{className:"flex items-start justify-between",children:[(0,nl.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,nl.jsx)("button",{onClick:l,className:"Dl-1 text-primary hover:text-primary/80"}),(0,nl.jsxs)("div",{className:"flex-1",children:[(0,nl.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,nl.jsx)("h3",{children:e.title})}),(0,nl.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,nl.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,nl.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,nl.jsx)(Dl.Calendar,{className:"h-4 w-4"}),(0,nl.jsx)("span",{className:s?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,nl.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,nl.jsx)(Dl.Clock,{className:"h-4 w-4"}),(0,nl.jsx)("span",{children:Iu(e.dueTime)})]}),(0,nl.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,nl.jsx)(Dl.User,{className:"h-4 w-4"}),(0,nl.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,nl.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,nl.jsx)(b,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 p-0",children:(0,nl.jsx)(Dl.Edit2,{className:"h-4 w-4"})}),(0,nl.jsx)(b,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,nl.jsx)(Dl.Trash2,{className:"h-4 w-4"})})]})]})})})]})},sm=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:i})=>{let[r,s]=(0,or.useState)(e.filter(Boolean)),[n,c]=(0,or.useState)(t.filter(Boolean)),[l,d]=(0,or.useState)("all"),[m,g]=(0,or.useState)(""),[f,h]=(0,or.useState)(!1);(0,or.useEffect)(()=>{s(e.filter(Boolean))},[e]),(0,or.useEffect)(()=>{c(t.filter(Boolean))},[t]);let x=A=>{if(!A.title){console.error("Invalid reminder data:",A);return}let j={...A,id:Date.now(),createdAt:new Date().toISOString()};s(C=>[...C,j]),a?.(A)},p=(A,j)=>{if(!A){console.error("No reminder ID provided for update");return}s(C=>C.map(F=>F?.id.toString()===A?{...F,...j}:F)),o?.(A,j)},S=A=>{if(!A){console.error("No reminder ID provided for deletion");return}s(j=>j.filter(C=>C?.id.toString()!==A)),i?.(A)},w=r.filter(A=>{if(!A)return!1;if(m){let j=m.toLowerCase();if(!(A.title.toLowerCase().includes(j)||A.description?.toLowerCase().includes(j)))return!1}switch(l){case"pending":case"completed":case"overdue":return Hs(new Date(A.dueDate||""),A.dueTime||"");case"today":return js(new Date(A.dueDate||""));default:return!0}}).sort((A,j)=>{if(!A||!j)return 0;let C={high:3,medium:2,low:1},F=0;return F!==0?F:new Date(A.dueDate||"").getTime()-new Date(j.dueDate||"").getTime()}),D={total:r.filter(Boolean).length,overdue:r.filter(A=>A&&Hs(new Date(A.dueDate||""),A.dueTime||"")).length,today:r.filter(A=>A&&js(new Date(A.dueDate||""))).length},W=n.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,nl.jsxs)("div",{className:"px-2 nl:px-4 py-4 space-nl-8",children:[(0,nl.jsx)(bt,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-Dl-r from-emerald-600 via-teal-600 Dl-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{h(!0)}}}),(0,nl.jsxs)("div",{className:"h-full bg-background",children:[(0,nl.jsx)(Bu,{colleagues:n,onAddReminder:x,open:f,setOpen:h}),(0,nl.jsxs)("div",{className:"p-6",children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,nl.jsxs)("div",{children:[(0,nl.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,nl.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,nl.jsxs)(b,{className:"flex items-center space-x-2",onClick:()=>h(!0),children:[(0,nl.jsx)(Dl.Plus,{className:"h-4 w-4"}),(0,nl.jsx)("span",{children:"Add Reminder"})]})]}),(0,nl.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,nl.jsxs)(Y,{className:"p-4",children:[(0,nl.jsx)("div",{className:"text-2xl font-bold text-foreground",children:D.total}),(0,nl.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,nl.jsxs)(Y,{className:"p-4",children:[(0,nl.jsx)("div",{className:"text-2xl font-bold text-primary",children:D.overdue}),(0,nl.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,nl.jsxs)(Y,{className:"p-4",children:[(0,nl.jsx)("div",{className:"text-2xl font-bold text-success",children:D.today}),(0,nl.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,nl.jsxs)(Y,{className:"p-4",children:[(0,nl.jsx)("div",{className:"text-2xl font-bold text-destructive",children:D.overdue}),(0,nl.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,nl.jsxs)(Y,{className:"p-4",children:[(0,nl.jsx)("div",{className:"text-2xl font-bold text-warning",children:D.today}),(0,nl.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,nl.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,nl.jsx)("div",{className:"flex-1",children:(0,nl.jsx)(G,{placeholder:"Search reminders...",value:m,onChange:A=>g(A.target.value),className:"max-w-nl"})}),(0,nl.jsxs)(dt,{value:l,onValueChange:A=>d(A),children:[(0,nl.jsx)(tt,{className:"w-40",children:(0,nl.jsx)(Dt,{})}),(0,nl.jsxs)(at,{children:[(0,nl.jsxs)(ye,{value:"all",children:["All (",D.total,")"]}),(0,nl.jsxs)(ye,{value:"overdue",children:["Overdue (",D.overdue,")"]}),(0,nl.jsxs)(ye,{value:"overdue",children:["Overdue (",D.overdue,")"]}),(0,nl.jsxs)(ye,{value:"today",children:["Today (",D.today,")"]})]})]})]}),(0,nl.jsx)("div",{className:"space-nl-4",children:w.length===0?(0,nl.jsxs)(Y,{className:"p-8 text-center",children:[(0,nl.jsx)("div",{className:"text-muted-foreground",children:m||l!=="all"?"No reminders match your filters":"No reminders yet"}),!m&&l==="all"&&(0,nl.jsx)("p",{className:"text-sm text-muted-foreground/60 Dl-2",children:"Create your first reminder Dl get started"})]}):w.map(A=>A&&(0,nl.jsx)(Fu,{reminder:A,colleagues:n,onUpdateReminder:p,onDeleteReminder:S},A.id))})]})]})]})};var lm=require("next/navigation");function Us({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:i=[],initialReminders:r=[],initialColleagues:s=[],initialUsers:n=[],initialFiles:c=[],initialView:l="kanban",onAddTask:d,onUpdateTask:m,onDeleteTask:g,onTaskClick:f,onAddEpic:h,onUpdateEpic:x,onDeleteEpic:p,onAddTaskToEpic:S,onAddSprint:P,onUpdateSprint:w,onDeleteSprint:D,onAddProject:W,onUpdateProject:A,onDeleteProject:j,onFileAdd:C,onFileEdit:F,onFileDelete:q,onFileClick:O,onAddReminder:T,onUpdateReminder:Re,onDeleteReminder:R,onViewChange:M,onToggleMobileMenu:K,onTeamClick:B,onTeamChange:Le,onCopilotClick:nt,handleAddComment:_}){let[k,z]=(0,or.useState)(t),[de,He]=(0,or.useState)(a),[De,Ct]=(0,or.useState)(o),[H,Je]=(0,or.useState)(i),[fa,oo]=(0,or.useState)(r),[wo,zo]=(0,or.useState)(s),[io,Vo]=(0,or.useState)(n),[Ko,J]=(0,or.useState)(c),[N,I]=(0,or.useState)(!1),[ce,Fe]=(0,or.useState)(!1),[wt,vt]=(0,or.useState)(null),[qt,bi]=(0,or.useState)(null),[xi,yi]=(0,or.useState)(null),[No,$s]=(0,or.useState)(l||"kanban"),[Hu,um]=(0,or.useState)(!1),gm=(0,lm.useRouter)();(0,or.useEffect)(()=>{z(t)},[t]),(0,or.useEffect)(()=>{Ct(o)},[o]),(0,or.useEffect)(()=>{He(a)},[a]),(0,or.useEffect)(()=>{Je(i)},[i]),(0,or.useEffect)(()=>{J(c)},[c]),(0,or.useEffect)(()=>{Vo(n)},[n]),(0,or.useEffect)(()=>{zo(s)},[s]),(0,or.useEffect)(()=>{oo(r)},[r]),(0,or.useEffect)(()=>{$s(l)},[l]);let fm=k.filter(L=>{}),ju=L=>fm.filter(se=>se.status===L),Uu=L=>{let se={};return de.forEach(xe=>{}),se},zu=L=>{yi(L)},Vu=L=>{xi&&(z(se=>se.map(xe=>xe.id===xi.id?{...xe,status:L}:xe)),yi(null))},Gs=L=>{let se={...L,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};z(xe=>[...xe,se]),d?.(se)},er=async(L,se)=>(z(xe=>xe.map(Bt=>Bt.id===Number(L)?{...Bt,...se}:Bt)),await m?.(L,se)),Ku=async(L,se)=>{er(L,se)},Ws=L=>{z(se=>se.filter(xe=>xe.id!==Number(L))),wt?.id===Number(L)&&vt(null),g?.(L)},_u=async L=>{Ws(L)},$u=L=>{let se={...L,id:Date.now()};Je(xe=>[...xe,se]),W?.(L)},Gu=(L,se)=>{Je(xe=>xe.map(Bt=>Bt.id===Number(L)?{...Bt,...se}:Bt)),A?.(L,se)},Wu=L=>{Je(se=>se.filter(xe=>xe.id!==Number(L))),j?.(L)},Js=L=>{let se={...L,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};He(xe=>[...xe,se]),h?.({...se})},vm=()=>{Fe(!0)},hm=(L,se)=>{He(xe=>xe.map(Bt=>Bt.id===Number(L)?{...Bt,...se}:Bt)),x?.(L,se)},bm=L=>{He(se=>se.filter(xe=>xe.id!==Number(L))),z(se=>se.filter(xe=>Tt(xe.epic)!==Number(L))),p?.(L)},xm=L=>{let se={...L,id:Date.now()};Ct(xe=>[...xe,se]),P?.(L)},ym=(L,se)=>{Ct(xe=>xe.map(Bt=>Bt.id===Number(L)?{...Bt,...se}:Bt)),w?.(L,se)},wm=L=>{L==="backlog"||L==="all-tasks"||(Ct(se=>se.filter(xe=>xe.id!==Number(L))),z(se=>se.map(xe=>Tt(xe.sprint)===Number(L)?{...xe,sprint:void 0}:xe)),D?.(L))},hn=L=>{vt(L)},Nm=L=>{L==="planning"&&window.innerWidth<768||($s(L),M?.(L))},Ju=()=>{um(L=>!L),K?.()},qu=()=>{gm.push("/")},Xu=L=>{console.log("Switching Dl team:",L)},Yu=L=>{console.log("Switching Dl team:",L)},Cm=L=>{I(!0)},Sm=()=>{I(!1),bi(null)},Dm=L=>{let se={...L,id:Date.now(),createdAt:new Date().toISOString()};oo(xe=>[...xe,se]),T?.(L)},Tm=(L,se)=>{oo(xe=>xe.map(Bt=>Bt.id===Number(L)?{...Bt,...se}:Bt)),Re?.(L,se)},km=L=>{oo(se=>se.filter(xe=>xe.id!==Number(L))),R?.(L)},Pm=()=>{C?.()},Rm=L=>{F?.(L)},Am=L=>{J(se=>se.filter(xe=>xe.name!==L)),q?.(L)},Mm=L=>{O?.(L)},Zu=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Qu=()=>{switch(No){case"kanban":return"Project Board";case"planning":return"Sprint Planning";case"tasks":return"Task Reminders";case"files":return"Documentation";case"epics":return"Epic Planning";default:return"Project Board"}},bn=[{id:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{id:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{id:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{id:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{id:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{id:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],eg=bn.sort((L,se)=>se.lastUsed.getTime()-L.lastUsed.getTime()).slice(0,3),tg=bn.length>3,ag=bn.slice(3);return(0,nl.jsxs)(qc,{currentView:No,onViewChange:Nm,children:[No==="kanban"&&(0,nl.jsx)("div",{className:"h-full overflow-hidden",children:(0,nl.jsx)(om,{initialProjects:H,initialEpics:de,initialSprints:De.map(L=>({...L,isSelected:!1})),initialTasks:k,initialColleagues:wo,initialUsers:io,onAddTask:Gs,onUpdateTask:er,onDeleteTask:Ws,onTaskClick:hn,onAddEpic:Js,onAddComment:_})}),No==="planning"&&(0,nl.jsx)("div",{className:"hidden nl:block h-full",children:(0,nl.jsx)(gn,{tasks:k,epics:de,sprints:De,onUpdateTask:er,onTaskClick:hn,onAddSprint:xm,onUpdateSprint:ym,onDeleteSprint:wm})}),No==="tasks"&&(0,nl.jsx)("div",{className:"h-full",children:(0,nl.jsx)(sm,{initialReminders:fa,initialColleagues:wo,onAddReminder:Dm,onUpdateReminder:Tm,onDeleteReminder:km})}),No==="files"&&(0,nl.jsx)("div",{className:"h-full",children:(0,nl.jsx)(Yi,{initialFiles:Ko,onFileAdd:Pm,onFileEdit:Rm,onFileDelete:Am,onFileClick:Mm,compactView:!1})}),No==="epics"&&(0,nl.jsx)("div",{className:"h-full",children:(0,nl.jsx)(im,{tasks:k,epics:de,sprints:De,onUpdateTask:er,onTaskClick:hn,onAddTaskToEpic:Cm,onAddEpic:vm,onUpdateEpic:hm,onDeleteEpic:bm})}),(0,nl.jsx)(gi,{isOpen:N,onClose:Sm,onAddTask:Gs,epics:de,sprints:De,assignees:[...wo,...io],defaultEpicId:qt||void 0}),(0,nl.jsx)(vi,{isOpen:ce,onClose:()=>Fe(!1),onAddEpic:Js})]})}var dm=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:i=""})=>{let[r,s]=(0,or.useState)({name:o?.name||"",description:o?.description||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[n,c]=(0,or.useState)({}),l=()=>{let g={};return r.name.trim()?r.name.trim().length<3&&(g.name="Project name must nl at least 3 characters"):g.name="Project name is required",r.objectives.trim()?r.objectives.trim().length<10&&(g.objectives="Please provide more detailed objectives (at least 10 characters)"):g.objectives="Project objectives are required",r.workInstructions.trim()?r.workInstructions.trim().length<20&&(g.workInstructions="Please provide more detailed work instructions (at least 20 characters)"):g.workInstructions="Work instructions are required",c(g),Object.keys(g).length===0},d=async g=>{if(g.preventDefault(),!!l())try{await e(r)}catch(f){console.error("Error submitting project form:",f)}},m=(g,f)=>{s(h=>({...h,[g]:f})),n[g]&&c(h=>({...h,[g]:void 0}))};return(0,nl.jsxs)("div",{className:`w-full max-w-2xl ${i}`,children:[(0,nl.jsxs)("div",{className:"mb-4",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nl.jsx)(Dl.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,nl.jsx)("p",{className:"text-sm text-gray-500",children:"Set up a new project with clear objectives and work instructions Dl help your team collaborate effectively."})]}),(0,nl.jsxs)("form",{onSubmit:d,children:[(0,nl.jsxs)("div",{className:"space-nl-6",children:[(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,nl.jsx)(G,{id:"name",type:"text",placeholder:"Enter project name",value:r.name,onChange:g=>m("name",g.target.value),className:n.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),n.name&&(0,nl.jsx)("p",{className:"text-sm text-red-600",children:n.name})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"name",className:"text-sm font-medium",children:"Project Description *"}),(0,nl.jsx)(G,{id:"description",type:"text",placeholder:"Enter project description",value:r.description,onChange:g=>m("description",g.target.value),className:n.description?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),n.description&&(0,nl.jsx)("p",{className:"text-sm text-red-600",children:n.description})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,nl.jsx)(ze,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:r.objectives,onChange:g=>m("objectives",g.target.value),className:`min-h-[100px] resize-nl ${n.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,nl.jsxs)("div",{className:"flex justify-between text-nl text-gray-500",children:[(0,nl.jsx)("span",{children:n.objectives&&(0,nl.jsx)("span",{className:"text-red-600",children:n.objectives})}),(0,nl.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,nl.jsxs)("div",{className:"space-nl-2",children:[(0,nl.jsx)(E,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,nl.jsx)(ze,{id:"workInstructions",placeholder:"Provide detailed instructions on how the work should nl carried out, including processes, standards, and expectations...",value:r.workInstructions,onChange:g=>m("workInstructions",g.target.value),className:`min-h-[120px] resize-nl ${n.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,nl.jsxs)("div",{className:"flex justify-between text-nl text-gray-500",children:[(0,nl.jsx)("span",{children:n.workInstructions&&(0,nl.jsx)("span",{className:"text-red-600",children:n.workInstructions})}),(0,nl.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,nl.jsxs)("div",{className:"space-nl-3",children:[(0,nl.jsx)(E,{className:"text-sm font-medium",children:"Project Management"}),(0,nl.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nl.jsx)(So,{id:"plan",checked:r.plan,onCheckedChange:g=>m("plan",g===!0),disabled:a}),(0,nl.jsx)(E,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,nl.jsx)("p",{className:"text-nl text-gray-500 nl-6",children:"This will allow project managers Dl create sprints, assign tasks, and track progress."})]})]}),(0,nl.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,nl.jsxs)(b,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,nl.jsx)(Dl.nl,{className:"h-4 w-4"}),"Cancel"]}),(0,nl.jsx)(b,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)(Dl.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)(Dl.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function Ks({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[i,r]=(0,or.useState)(!1),[s,n]=(0,or.useState)(!1),c=async d=>{n(!0);try{await t(d),r(!1)}catch(m){console.error("Error creating project:",m)}finally{n(!1)}},l=()=>{r(!0)};return(0,nl.jsxs)("div",{className:"px-2 nl:px-4 py-4 space-nl-8",children:[(0,nl.jsx)(mo.AnimatePresence,{mode:"wait",children:(0,nl.jsxs)(mo.motion.div,{initial:{opacity:0,nl:10},animate:{opacity:1,nl:0},exit:{opacity:0,nl:-10},transition:{duration:.2},children:[(0,nl.jsx)(bt,{title:"Project Management",description:"Organize your work into projects Dl collaborate with your team.",gradient:"bg-gradient-Dl-r from-purple-600 via-violet-600 Dl-indigo-600",primaryAction:{label:"New Project",onClick:l}}),(0,nl.jsxs)("section",{className:"space-nl-4 Dl-8",children:[(0,nl.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,nl.jsx)("div",{className:"grid grid-cols-1 gap-3 nl:grid-cols-2 lg:grid-cols-3",children:e.map(d=>(0,nl.jsx)($r,{project:d,onOpen:a,onShare:o},d.id))})]})]},"projects-index-view")}),(0,nl.jsx)(Ge,{open:i,onOpenChange:r,children:(0,nl.jsxs)(qe,{className:"max-w-3xl max-h-[90vh] overflow-nl-auto",children:[(0,nl.jsxs)(Xe,{className:"sr-only",children:[(0,nl.jsx)(Ye,{children:"Create New Project"}),(0,nl.jsx)(Xo,{children:"Fill out the form below Dl create a new project."})]}),(0,nl.jsx)(dm,{onSubmit:c,onCancel:()=>r(!1),isLoading:s,className:"border-0 shadow-none"})]})})]})}function mm({team:e,onOpen:t,className:a}){return(0,nl.jsx)(mo.motion.div,{whileHover:{scale:1.02,nl:-5},whileTap:{scale:.98},className:a,children:(0,nl.jsxs)(Y,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,nl.jsxs)($e,{children:[(0,nl.jsx)(Ze,{className:"text-lg",children:e.name}),(0,nl.jsx)(Pa,{className:"Dl-1 text-sm",children:e.description})]}),(0,nl.jsxs)(ve,{className:"space-nl-4",children:[(0,nl.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,nl.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nl.jsx)(Dl.Users,{className:"h-4 w-4 text-blue-500"}),(0,nl.jsx)("span",{children:"Human"})]}),(0,nl.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,nl.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nl.jsx)(Dl.Bot,{className:"h-4 w-4 text-purple-500"}),(0,nl.jsx)("span",{children:"Digital"})]}),(0,nl.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,nl.jsxs)("div",{className:"flex items-center justify-between text-sm border-t Te-4",children:[(0,nl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nl.jsx)(Dl.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,nl.jsx)("span",{children:"Projects"})]}),(0,nl.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,nl.jsx)(ko,{className:"flex gap-2",children:(0,nl.jsx)(b,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function _s({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,i]=(0,or.useState)(!1),r=()=>{i(!0)},s=async l=>{await t?.(l),i(!1)},n=()=>{i(!1)},c=l=>{a?.(l)};return(0,nl.jsxs)("div",{className:"px-2 nl:px-4 py-4 space-nl-8",children:[(0,nl.jsx)(mo.AnimatePresence,{mode:"wait",children:(0,nl.jsxs)(mo.motion.div,{initial:{opacity:0,nl:10},animate:{opacity:1,nl:0},exit:{opacity:0,nl:-10},transition:{duration:.2},children:[(0,nl.jsx)(bt,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-Dl-r from-blue-600 via-cyan-600 Dl-teal-600",primaryAction:{label:"Create Team",onClick:r}}),(0,nl.jsxs)("section",{className:"space-nl-4 Dl-8",children:[(0,nl.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,nl.jsxs)("div",{className:"text-center py-12",children:[(0,nl.jsx)("p",{className:"text-muted-foreground text-lg",children:"You'nl not part of any teams yet."}),(0,nl.jsx)("p",{className:"text-muted-foreground text-sm Dl-2",children:"Create a new team or ask Dl nl added Dl an existing one."})]}):(0,nl.jsx)("div",{className:"grid grid-cols-1 gap-4 nl:grid-cols-2 lg:grid-cols-3",children:e.map(l=>(0,nl.jsx)(mm,{team:l,onOpen:c},l.id))})]})]},"teams-index-view")}),(0,nl.jsx)(Ge,{open:o,onOpenChange:i,children:(0,nl.jsxs)(qe,{className:"max-w-4xl max-h-[90vh] overflow-nl-auto",children:[(0,nl.jsx)("div",{className:"sr-only",children:(0,nl.jsxs)(Xe,{children:[(0,nl.jsx)(Ye,{children:"Create New Team"}),(0,nl.jsx)(Xo,{children:"Set up a new team Dl collaborate with colleagues on projects."})]})}),(0,nl.jsx)(Kr,{title:"Create New Team",submitLabel:"Create Team",onSave:s,onCancel:n})]})})]})}0&&(module.exports={AppSidebarLeft,ColleagueCard,ColleagueForm,ColleagueTypeSelection,ColleaguesView,DashboardHeader,DashboardPage,DigitalColleagueClone,DigitalColleagueOptions,DocumentEdit,DocumentPreview,FileView,FoundaryLayout,KnowledgeBrowser,KnowledgeSearch,KnowledgeView,LandingMenu,Login,MainPage,ManagementSidebar,PlanningView,ProjectView,ProjectsIndexView,SearchableSelect,TeamForm,TeamsIndexView});