cortex-react-components 2.3.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-N3B3XNV3.mjs → chunk-2BRDNDUB.mjs} +1 -1
- package/dist/{chunk-M7NV6EFH.mjs → chunk-3HNU2NYP.mjs} +1 -1
- package/dist/{chunk-FKU4VQR6.mjs → chunk-3NRXQBBS.mjs} +1 -1
- package/dist/chunk-553B5H2H.mjs +4 -0
- package/dist/{chunk-PK3OBSCB.mjs → chunk-5MWZTJYP.mjs} +1 -1
- package/dist/{chunk-B7AXSCTN.mjs → chunk-6MSM3CZ6.mjs} +1 -1
- package/dist/{chunk-5SHZBJ5R.mjs → chunk-75F3LJMX.mjs} +1 -1
- package/dist/{chunk-7BCUACIY.mjs → chunk-7HR6FNWF.mjs} +1 -1
- package/dist/{chunk-MXCW6SOT.mjs → chunk-7R47MHQE.mjs} +1 -1
- package/dist/{chunk-RAGDUV7M.mjs → chunk-7VDNUJZC.mjs} +1 -1
- package/dist/{chunk-LJQPLE4S.mjs → chunk-AJQHGVZ5.mjs} +1 -1
- package/dist/{chunk-LHEZJYVN.mjs → chunk-AQZEZ3UR.mjs} +1 -1
- package/dist/{chunk-QUXHULLX.mjs → chunk-ATIEKI6M.mjs} +1 -1
- package/dist/{chunk-QTILVWJA.mjs → chunk-B2EJGXDG.mjs} +1 -1
- package/dist/{chunk-GS2VFNHY.mjs → chunk-B3F6F2S4.mjs} +1 -1
- package/dist/{chunk-U3F45KVI.mjs → chunk-BKR3FRMQ.mjs} +1 -1
- package/dist/{chunk-YKG4FNS4.mjs → chunk-C4RWEPVF.mjs} +1 -1
- package/dist/{chunk-7GMAMIHM.mjs → chunk-CXOVEABI.mjs} +1 -1
- package/dist/{chunk-YNTAZCKJ.mjs → chunk-DKVCSRUJ.mjs} +1 -1
- package/dist/{chunk-ABGNIQRP.mjs → chunk-ECXVQZBN.mjs} +1 -1
- package/dist/{chunk-IF3425JX.mjs → chunk-FE7ZGUPU.mjs} +1 -1
- package/dist/{chunk-H3CJOE6S.mjs → chunk-GHOL5L32.mjs} +1 -1
- package/dist/{chunk-2RQDJ5XT.mjs → chunk-GTZJWMZR.mjs} +1 -1
- package/dist/{chunk-TK4JC5PG.mjs → chunk-INPV5MBU.mjs} +1 -1
- package/dist/{chunk-RNMPX2AU.mjs → chunk-IPIDKLAW.mjs} +1 -1
- package/dist/{chunk-LJOWXPWW.mjs → chunk-KWYJ3XZI.mjs} +1 -1
- package/dist/{chunk-WUA65ZZB.mjs → chunk-L3BLBPSR.mjs} +1 -1
- package/dist/{chunk-CLGBBNRB.mjs → chunk-LAQ3QAUW.mjs} +1 -1
- package/dist/chunk-LW4QFIFR.mjs +4 -0
- package/dist/chunk-LYPWYO4W.mjs +1 -0
- package/dist/{chunk-FTZRG54P.mjs → chunk-M4UVNIK2.mjs} +1 -1
- package/dist/{chunk-7EXAS7HK.mjs → chunk-MAAKU7PN.mjs} +1 -1
- package/dist/{chunk-HKGW6JI2.mjs → chunk-NINFDOV5.mjs} +1 -1
- package/dist/{chunk-ZFUP5NVF.mjs → chunk-O5P35LEY.mjs} +1 -1
- package/dist/{chunk-SW7RYGO6.mjs → chunk-OQYER4E7.mjs} +1 -1
- package/dist/chunk-PC6TVU7J.mjs +1 -0
- package/dist/{chunk-N7BHIWS5.mjs → chunk-R75OR5VS.mjs} +1 -1
- package/dist/{chunk-255P6K5W.mjs → chunk-RGOKBIQ5.mjs} +1 -1
- package/dist/{chunk-67QPOSVV.mjs → chunk-RJGYVDOU.mjs} +1 -1
- package/dist/{chunk-CAKJOTEE.mjs → chunk-RVHCTANZ.mjs} +1 -1
- package/dist/{chunk-SRUG246N.mjs → chunk-TXVA6XJT.mjs} +1 -1
- package/dist/{chunk-P2MTGU2L.mjs → chunk-UJSXVIXW.mjs} +1 -1
- package/dist/{chunk-67VXPDWA.mjs → chunk-VR5WOPRD.mjs} +1 -1
- package/dist/{chunk-S4A4VHOI.mjs → chunk-VWLPVN4M.mjs} +1 -1
- package/dist/{chunk-ERJXTG6X.mjs → chunk-WIRQ5IRT.mjs} +1 -1
- package/dist/components/Blocks/Banner.mjs +1 -1
- package/dist/components/Blocks/CallToAction.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
- package/dist/components/Blocks/Content.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
- package/dist/components/Blocks/RelatedPosts.mjs +1 -1
- package/dist/components/Blocks/RenderBlocks.mjs +1 -1
- package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/CRM/index.mjs +1 -1
- package/dist/components/Cards/ContentCard.mjs +1 -1
- package/dist/components/Cards/FeatureCard.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/ManagementSidebar.mjs +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.js +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
- package/dist/components/DigitalColleagues/README-document-edit.js +238 -0
- package/dist/components/DigitalColleagues/README-document-edit.mjs +238 -0
- package/dist/components/DigitalColleagues/README-document-preview.js +210 -0
- package/dist/components/DigitalColleagues/README-document-preview.mjs +210 -0
- package/dist/components/DigitalColleagues/Views/ColleaguesView.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/KnowledgeView.js +1 -1
- package/dist/components/DigitalColleagues/Views/KnowledgeView.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/index.js +1 -1
- package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
- package/dist/components/DigitalColleagues/document-edit.d.ts +4 -2
- package/dist/components/DigitalColleagues/document-edit.js +2 -1
- package/dist/components/DigitalColleagues/document-edit.mjs +1 -1
- package/dist/components/DigitalColleagues/document-preview-examples.css +1 -0
- package/dist/components/DigitalColleagues/document-preview-examples.d.ts +12 -0
- package/dist/components/DigitalColleagues/document-preview-examples.js +35 -0
- package/dist/components/DigitalColleagues/document-preview-examples.mjs +31 -0
- package/dist/components/DigitalColleagues/document-preview.d.ts +12 -2
- package/dist/components/DigitalColleagues/document-preview.js +2 -1
- package/dist/components/DigitalColleagues/document-preview.mjs +1 -1
- package/dist/components/DigitalColleagues/index.js +1 -1
- package/dist/components/DigitalColleagues/index.mjs +1 -1
- package/dist/components/DigitalColleagues/knowledge-browser.js +1 -1
- package/dist/components/DigitalColleagues/knowledge-browser.mjs +1 -1
- package/dist/components/DigitalColleagues/types.d.ts +1 -1
- package/dist/components/HeaderFooter/Header.mjs +1 -1
- package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/HighImpact/index.mjs +1 -1
- package/dist/components/Heros/LowImpact/index.mjs +1 -1
- package/dist/components/Heros/MediumImpact/index.mjs +1 -1
- package/dist/components/Heros/PostHero/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/SectionHero/index.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Holidays/HolidayGrid.js +1 -1
- package/dist/components/Holidays/HolidayGrid.mjs +1 -1
- package/dist/components/Holidays/HolidayTracker.js +1 -1
- package/dist/components/Holidays/HolidayTracker.mjs +1 -1
- package/dist/components/Holidays/RequestLeave.js +1 -1
- package/dist/components/Holidays/RequestLeave.mjs +1 -1
- package/dist/components/Holidays/index.js +1 -1
- package/dist/components/Holidays/index.mjs +1 -1
- package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
- package/dist/components/Layouts/Print.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Menus/SidebarLeft.mjs +1 -1
- package/dist/components/Menus/SidebarRight.mjs +1 -1
- package/dist/components/Menus/index.mjs +1 -1
- package/dist/components/Other/index.mjs +1 -1
- package/dist/components/Payload/RichText/index.mjs +1 -1
- package/dist/components/Payload/RichText/serialize.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/Projects/KanbanBoardView.mjs +1 -1
- package/dist/components/Projects/ProjectPage.mjs +1 -1
- package/dist/components/Projects/ProjectView.mjs +1 -1
- package/dist/components/dc-temp/index.js +1 -1
- package/dist/components/dc-temp/index.mjs +1 -1
- package/dist/components/index.js +11 -11
- package/dist/components/index.mjs +1 -1
- package/dist/components/ui/index.mjs +1 -1
- package/dist/components/ui/sidebar.mjs +1 -1
- package/dist/globals.css +1 -1
- package/dist/index.js +15 -15
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/sections/AboutSection.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogList.mjs +1 -1
- package/dist/sections/BlogListSection.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/ServiceDetail.mjs +1 -1
- package/dist/sections/ServiceDetailSection.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/form/index.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/dist/utils/BankHolidays.d.ts +1 -4
- package/dist/utils/BankHolidays.js +1 -1
- package/dist/utils/BankHolidays.mjs +1 -1
- package/dist/utils/DaysUtil.js +1 -1
- package/dist/utils/DaysUtil.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-A24EPYUY.mjs +0 -1
- package/dist/chunk-BDFHWLTS.mjs +0 -4
- package/dist/chunk-GILMVRED.mjs +0 -4
- package/dist/chunk-QKGEV7LG.mjs +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
'use client'
|
|
4
4
|
|
|
5
|
-
"use strict";var Os=Object.create;var Qa=Object.defineProperty;var zs=Object.getOwnPropertyDescriptor;var Hs=Object.getOwnPropertyNames;var Vs=Object.getPrototypeOf,Us=Object.prototype.hasOwnProperty;var $s=(e,t)=>{for(var a in t)Qa(e,a,{get:t[a],enumerable:!0})},Dr=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Hs(t))!Us.call(e,l)&&l!==a&&Qa(e,l,{get:()=>t[l],enumerable:!(o=zs(t,l))||o.enumerable});return e};var he=(e,t,a)=>(a=e!=null?Os(Vs(e)):{},Dr(t||!e||!e.__esModule?Qa(a,"default",{value:e,enumerable:!0}):a,e)),Ks=e=>Dr(Qa({},"__esModule",{value:!0}),e);var Rl={};$s(Rl,{ColleaguesView:()=>Ko,FileView:()=>ja,KnowledgeView:()=>Go,ProjectView:()=>mr,ProjectsIndexView:()=>br,TeamsIndexView:()=>hr});module.exports=Ks(Rl);var Lt=require("react"),ut=require("lucide-react");var Fr=require("clsx");var Oo="-",Gs=e=>{let t=Ws(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:n=>{let d=n.split(Oo);return d[0]===""&&d.length!==1&&d.shift(),Tr(d,t)||_s(n)},getConflictingClassGroupIds:(n,d)=>{let s=a[n]||[];return d&&o[n]?[...s,...o[n]]:s}}},Tr=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),l=o?Tr(e.slice(1),o):void 0;if(l)return l;if(t.validators.length===0)return;let r=e.join(Oo);return t.validators.find(({validator:n})=>n(r))?.classGroupId},kr=/^\[(.+)\]$/,_s=e=>{if(kr.test(e)){let t=kr.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Ws=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Js(Object.entries(e.classGroups),a).forEach(([r,n])=>{jo(n,o,r,t)}),o},jo=(e,t,a,o)=>{e.forEach(l=>{if(typeof l=="string"){let r=l===""?t:Pr(t,l);r.classGroupId=a;return}if(typeof l=="function"){if(qs(l)){jo(l(o),t,a,o);return}t.validators.push({validator:l,classGroupId:a});return}Object.entries(l).forEach(([r,n])=>{jo(n,Pr(t,r),a,o)})})},Pr=(e,t)=>{let a=e;return t.split(Oo).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},qs=e=>e.isThemeGetter,Js=(e,t)=>t?e.map(([a,o])=>{let l=o.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([n,d])=>[t+n,d])):r);return[a,l]}):e,Xs=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,l=(r,n)=>{a.set(r,n),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let n=a.get(r);if(n!==void 0)return n;if((n=o.get(r))!==void 0)return l(r,n),n},set(r,n){a.has(r)?a.set(r,n):l(r,n)}}},Rr="!",Ys=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,l=t[0],r=t.length,n=d=>{let s=[],p=0,c=0,g;for(let v=0;v<d.length;v++){let R=d[v];if(p===0){if(R===l&&(o||d.slice(v,v+r)===t)){s.push(d.slice(c,v)),c=v+r;continue}if(R==="/"){g=v;continue}}R==="["?p++:R==="]"&&p--}let u=s.length===0?d:d.substring(c),h=u.startsWith(Rr),S=h?u.substring(1):u,T=g&&g>c?g-c:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:S,maybePostfixModifierPosition:T}};return a?d=>a({className:d,parseClassName:n}):n},Zs=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},Qs=e=>({cache:Xs(e.cacheSize),parseClassName:Ys(e),...Gs(e)}),en=/\s+/,tn=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:l}=t,r=[],n=e.trim().split(en),d="";for(let s=n.length-1;s>=0;s-=1){let p=n[s],{modifiers:c,hasImportantModifier:g,baseClassName:u,maybePostfixModifierPosition:h}=a(p),S=!!h,T=o(S?u.substring(0,h):u);if(!T){if(!S){d=p+(d.length>0?" "+d:d);continue}if(T=o(u),!T){d=p+(d.length>0?" "+d:d);continue}S=!1}let v=Zs(c).join(":"),R=g?v+Rr:v,N=R+T;if(r.includes(N))continue;r.push(N);let V=l(T,S);for(let _=0;_<V.length;++_){let q=V[_];r.push(R+q)}d=p+(d.length>0?" "+d:d)}return d};function an(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Er(t))&&(o&&(o+=" "),o+=a);return o}var Er=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Er(e[o]))&&(a&&(a+=" "),a+=t);return a};function on(e,...t){let a,o,l,r=n;function n(s){let p=t.reduce((c,g)=>g(c),e());return a=Qs(p),o=a.cache.get,l=a.cache.set,r=d,d(s)}function d(s){let p=o(s);if(p)return p;let c=tn(s,a);return l(s,c),c}return function(){return r(an.apply(null,arguments))}}var Me=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Ir=/^\[(?:([a-z-]+):)?(.+)\]$/Or,rn=/^\d+\/\d+$/,sn=new Set(["px","full","screen"]),nn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ln=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|ut|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|Or|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,cn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rt=e=>ca(e)||sn.has(e)||rn.test(e),zt=e=>ma(e,"length",xn),ca=e=>!!e&&!Number.isNaN(Number(e)),Lo=e=>ma(e,"number",ca),Ta=e=>!!e&&Number.isInteger(Number(e)),pn=e=>e.endsWith("%")&&ca(e.slice(0,-1)),se=e=>Ir.test(e),Ht=e=>nn.test(e),un=new Set(["length","size","percentage"]),gn=e=>ma(e,un,Ar),fn=e=>ma(e,"position",Ar),vn=new Set(["image","url"]),bn=e=>ma(e,vn,wn),hn=e=>ma(e,"",yn),Ra=()=>!0,ma=(e,t,a)=>{let o=Ir.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},xn=e=>ln.test(e)&&!dn.test(e),Ar=()=>!1,yn=e=>cn.test(e),wn=e=>mn.test(e);var Nn=()=>{let e=Me("colors"),t=Me("spacing"),a=Me("blur"),o=Me("brightness"),l=Me("borderColor"),r=Me("borderRadius"),n=Me("borderSpacing"),d=Me("borderWidth"),s=Me("contrast"),p=Me("grayscale"),c=Me("hueRotate"),g=Me("invert"),u=Me("gap"),h=Me("gradientColorStops"),S=Me("gradientColorStopPositions"),T=Me("inset"),v=Me("margin"),R=Me("opacity"),N=Me("padding"),V=Me("saturate"),_=Me("scale"),q=Me("sepia"),le=Me("skew"),ue=Me("space"),x=Me("translate"),D=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],be=()=>["auto",se,t],A=()=>[se,t],C=()=>["",Rt,zt],Y=()=>["auto",ca,se],Te=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ct=()=>["solid","dashed","dotted","double","none"],mt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ze=()=>["start","end","center","between","around","evenly","stretch"],Ue=()=>["","0",se],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Q=()=>[ca,se];return{cacheSize:500,separator:":",theme:{colors:[Ra],spacing:[Rt,zt],blur:["none","",Ht,se],brightness:Q(),borderColor:[e],borderRadius:["none","","full",Ht,se],borderSpacing:A(),borderWidth:C(),contrast:Q(),grayscale:Ue(),hueRotate:Q(),invert:Ue(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[pn,zt],inset:be(),margin:be(),opacity:Q(),padding:A(),saturate:Q(),scale:Q(),sepia:Ue(),skew:Q(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",se]}],container:["container"],columns:[{columns:[Ht]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"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:[...Te(),se]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[T]}],"inset-x":[{"inset-x":[T]}],"inset-y":[{"inset-y":[T]}],start:[{start:[T]}],end:[{end:[T]}],top:[{top:[T]}],right:[{right:[T]}],bottom:[{bottom:[T]}],left:[{left:[T]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ta,se]}],basis:[{basis:be()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",se]}],grow:[{grow:Ue()}],shrink:[{shrink:Ue()}],order:[{order:["first","last","none",Ta,se]}],"grid-cols":[{"grid-cols":[Ra]}],"col-start-end":[{col:["auto",{span:["full",Ta,se]},se]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[Ra]}],"row-start-end":[{row:["auto",{span:[Ta,se]},se]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","Lt",se]}],"auto-rows":[{"auto-rows":["auto","min","max","Lt",se]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",...ze()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ze(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ze(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],zo:[{zo:[N]}],Or:[{Or:[N]}],ut:[{ut:[N]}],Or:[{Or:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],Or:[{Or:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[ue]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ue]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",se,t]}],"min-w":[{"min-w":[se,t,"min","max","fit"]}],"max-w":[{"max-w":[se,t,"none","full","min","max","fit","prose",{screen:[Ht]},Ht]}],h:[{h:[se,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[se,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[se,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[se,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ht,zt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Lo]}],"font-family":[{font:[Ra]}],"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",se]}],"line-clamp":[{"line-clamp":["none",ca,Lo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Rt,se]}],"list-image":[{"list-image":["none",se]}],"list-style-type":[{list:["none","disc","decimal",se]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[R]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[R]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ct(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Rt,zt]}],"underline-offset":[{"underline-offset":["auto",Rt,se]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se]}],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",se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[R]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Te(),fn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",gn]}],"bg-image":[{bg:["none",{"gradient-Or":["t","Lt","r","br","b","bl","l","tl"]},bn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-Or-pos":[{Or:[S]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-Or":[{Or:[h]}],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-Or":[{"rounded-Or":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-Lt":[{"rounded-Lt":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[d]}],"border-w-x":[{"border-x":[d]}],"border-w-y":[{"border-y":[d]}],"border-w-s":[{"border-s":[d]}],"border-w-e":[{"border-e":[d]}],"border-w-t":[{"border-t":[d]}],"border-w-r":[{"border-r":[d]}],"border-w-b":[{"border-b":[d]}],"border-w-l":[{"border-l":[d]}],"border-opacity":[{"border-opacity":[R]}],"border-style":[{border:[...ct(),"hidden"]}],"divide-x":[{"divide-x":[d]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[d]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[R]}],"divide-style":[{divide:ct()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...ct()]}],"outline-offset":[{"outline-offset":[Rt,se]}],"outline-w":[{outline:[Rt,zt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:C()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[R]}],"ring-offset-w":[{"ring-offset":[Rt,zt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ht,hn]}],"shadow-color":[{shadow:[Ra]}],opacity:[{opacity:[R]}],"mix-blend":[{"mix-blend":[...mt(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":mt()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[s]}],"drop-shadow":[{"drop-shadow":["","none",Ht,se]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[g]}],saturate:[{saturate:[V]}],sepia:[{sepia:[q]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[s]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[R]}],"backdrop-saturate":[{"backdrop-saturate":[V]}],"backdrop-sepia":[{"backdrop-sepia":[q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-y":[{"border-spacing-y":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",se]}],duration:[{duration:Q()}],ease:[{ease:["linear","in","out","in-out",se]}],delay:[{delay:Q()}],animate:[{animate:["none","spin","ping","pulse","bounce",se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[Ta,se]}],"translate-x":[{"translate-x":[x]}],"translate-y":[{"translate-y":[x]}],"skew-x":[{"skew-x":[le]}],"skew-y":[{"skew-y":[le]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",se]}],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","Or-resize","nw-resize","se-resize","sw-resize","ew-resize","zo-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",se]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-Or":[{"scroll-Or":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-zo":[{"scroll-zo":A()}],"scroll-Or":[{"scroll-Or":A()}],"scroll-ut":[{"scroll-ut":A()}],"scroll-Or":[{"scroll-Or":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",se]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Rt,zt,Lo]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","zo","Or","ut","Or","pb","pl"],px:["Or","pl"],py:["ut","pb"],Or:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-Or","rounded-es","rounded-tl","rounded-Lt","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-Or"],"rounded-t":["rounded-tl","rounded-Lt"],"rounded-r":["rounded-Lt","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["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-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-Or":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-zo","scroll-Or","scroll-ut","scroll-Or","scroll-pb","scroll-pl"],"scroll-px":["scroll-Or","scroll-pl"],"scroll-py":["scroll-ut","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Mr=on(Nn);function f(...e){return Mr((0,Fr.clsx)(e))}var Br=require("@radix-Lt/react-slot"),Lr=require("class-variance-authority"),jr=he(require("react")),Or=require("react/jsx-runtime"),eo=(0,Lr.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=jr.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...l},r)=>(0,Or.jsx)(e?Br.Slot:"button",{className:f(eo({className:t,size:a,variant:o})),ref:r,...l}));b.displayName="Button";var qt=he(require("react"));var j=qt.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("div",{ref:a,className:f("rounded-xl border bg-card text-card-foreground shadow",e),...t}));j.displayName="Card";var ke=qt.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("div",{ref:a,className:f("flex flex-col space-y-1.5 p-6",e),...t}));ke.displayName="CardHeader";var Ee=qt.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("div",{ref:a,className:f("font-semibold leading-none tracking-tight",e),...t}));Ee.displayName="CardTitle";var Jt=qt.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("div",{ref:a,className:f("text-sm text-muted-foreground",e),...t}));Jt.displayName="CardDescription";var ie=qt.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("div",{ref:a,className:f("p-6 ut-0",e),...t}));ie.displayName="CardContent";var Xt=qt.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("div",{ref:a,className:f("flex items-center p-6 ut-0",e),...t}));Xt.displayName="CardFooter";var zr=he(require("react"));var L=zr.forwardRef(({className:e,type:t,...a},o)=>(0,Or.jsx)("input",{type:t,className:f("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...a}));L.displayName="Input";var ge=he(require("@radix-Lt/react-select")),Vt=he(require("react")),Ce=ge.Root;var Ie=ge.Value,we=Vt.forwardRef(({children:e,className:t,...a},o)=>(0,$e.jsxs)(ge.Trigger,{className:f("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,$e.jsx)(ge.Icon,{asChild:!0,children:(0,$e.jsx)(ut.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));we.displayName=ge.Trigger.displayName;var Vr=Vt.forwardRef(({className:e,...t},a)=>(0,$e.jsx)(ge.ScrollUpButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,$e.jsx)(ut.ChevronUp,{className:"h-4 w-4"})}));Vr.displayName=ge.ScrollUpButton.displayName;var Ur=Vt.forwardRef(({className:e,...t},a)=>(0,$e.jsx)(ge.ScrollDownButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,$e.jsx)(ut.ChevronDown,{className:"h-4 w-4"})}));Ur.displayName=ge.ScrollDownButton.displayName;var Ne=Vt.forwardRef(({children:e,className:t,position:a="popper",...o},l)=>(0,$e.jsx)(ge.Portal,{children:(0,$e.jsxs)(ge.Content,{className:f("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,ref:l,...o,children:[(0,$e.jsx)(Vr,{}),(0,$e.jsx)(ge.Viewport,{className:f("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,$e.jsx)(Ur,{})]})}));Ne.displayName=ge.Content.displayName;var Cn=Vt.forwardRef(({className:e,...t},a)=>(0,$e.jsx)(ge.Label,{className:f("py-1.5 pl-8 Or-2 text-sm font-semibold",e),ref:a,...t}));Cn.displayName=ge.Label.displayName;var H=Vt.forwardRef(({children:e,className:t,...a},o)=>(0,$e.jsxs)(ge.Item,{className:f("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 Or-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,$e.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,$e.jsx)(ge.ItemIndicator,{children:(0,$e.jsx)(ut.Check,{className:"h-4 w-4"})})}),(0,$e.jsx)(ge.ItemText,{children:e})]}));H.displayName=ge.Item.displayName;var Sn=Vt.forwardRef(({className:e,...t},a)=>(0,$e.jsx)(ge.Separator,{className:f("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));Sn.displayName=ge.Separator.displayName;var zo=require("framer-motion");var Qt=he(require("@radix-Lt/react-tabs"));function $r({className:e,...t}){return(0,Or.jsx)(Qt.Root,{"data-slot":"tabs",className:f("flex flex-col gap-2",e),...t})}function Kr({className:e,...t}){return(0,Or.jsx)(Qt.List,{"data-slot":"tabs-list",className:f("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Gr({className:e,...t}){return(0,Or.jsx)(Qt.Trigger,{"data-slot":"tabs-trigger",className:f("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var Et=he(require("react")),fe=he(require("@radix-Lt/react-dropdown-menu")),pa=require("@radix-Lt/react-icons");var ao=fe.Root,oo=fe.Trigger;var Dn=Et.forwardRef(({className:e,inset:t,children:a,...o},l)=>(0,Or.jsxs)(fe.SubTrigger,{ref:l,className:f("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,Or.jsx)(pa.ChevronRightIcon,{className:"ml-auto"})]}));Dn.displayName=fe.SubTrigger.displayName;var kn=Et.forwardRef(({className:e,...t},a)=>(0,Or.jsx)(fe.SubContent,{ref:a,className:f("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));kn.displayName=fe.SubContent.displayName;var Ea=Et.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Or.jsx)(fe.Portal,{children:(0,Or.jsx)(fe.Content,{ref:o,sideOffset:t,className:f("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));Ea.displayName=fe.Content.displayName;var ea=Et.forwardRef(({className:e,inset:t,...a},o)=>(0,Or.jsx)(fe.Item,{ref:o,className:f("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}));ea.displayName=fe.Item.displayName;var Pn=Et.forwardRef(({className:e,children:t,checked:a,...o},l)=>(0,Or.jsxs)(fe.CheckboxItem,{ref:l,className:f("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Or-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,Or.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Or.jsx)(fe.ItemIndicator,{children:(0,Or.jsx)(pa.CheckIcon,{className:"h-4 w-4"})})}),t]}));Pn.displayName=fe.CheckboxItem.displayName;var Tn=Et.forwardRef(({className:e,children:t,...a},o)=>(0,Or.jsxs)(fe.RadioItem,{ref:o,className:f("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Or-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,Or.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Or.jsx)(fe.ItemIndicator,{children:(0,Or.jsx)(pa.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Tn.displayName=fe.RadioItem.displayName;var Rn=Et.forwardRef(({className:e,inset:t,...a},o)=>(0,Or.jsx)(fe.Label,{ref:o,className:f("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));Rn.displayName=fe.Label.displayName;var En=Et.forwardRef(({className:e,...t},a)=>(0,Or.jsx)(fe.Separator,{ref:a,className:f("-mx-1 my-1 h-px bg-muted",e),...t}));En.displayName=fe.Separator.displayName;var In=({className:e,...t})=>(0,Or.jsx)("span",{className:f("ml-auto text-xs tracking-widest opacity-60",e),...t});In.displayName="DropdownMenuShortcut";function ro({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:l="700px",gridCols:r=6}){let n=a.find(d=>d.value===e);return(0,Or.jsxs)(zo.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,Or.jsx)("div",{className:"hidden md:block",children:(0,Or.jsx)($r,{value:e,onValueChange:t,children:(0,Or.jsx)(Kr,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:l,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(d=>(0,Or.jsx)(zo.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Or.jsx)(Gr,{value:d.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:d.label})},d.value))})})}),(0,Or.jsx)("div",{className:"md:hidden",children:(0,Or.jsxs)(ao,{children:[(0,Or.jsx)(oo,{asChild:!0,children:(0,Or.jsxs)(b,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[n?.label||"Select",(0,Or.jsx)(ut.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Or.jsx)(Ea,{align:"center",className:"w-[180px]",children:a.map(d=>(0,Or.jsx)(ea,{onClick:()=>t?.(d.value),className:`cursor-pointer ${e===d.value?"bg-accent":""}`,children:d.label},d.value))})]})})]})}var io=he(require("react")),It=he(require("@radix-Lt/react-avatar"));var At=io.forwardRef(({className:e,...t},a)=>(0,Or.jsx)(It.Root,{ref:a,className:f("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));At.displayName=It.Root.displayName;var Ia=io.forwardRef(({className:e,...t},a)=>(0,Or.jsx)(It.Image,{ref:a,className:f("aspect-square h-full w-full",e),...t}));Ia.displayName=It.Image.displayName;var Mt=io.forwardRef(({className:e,...t},a)=>(0,Or.jsx)(It.Fallback,{ref:a,className:f("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Mt.displayName=It.Fallback.displayName;var An=(0,Lr.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Z({className:e,variant:t,...a}){return(0,Or.jsx)("div",{className:f(An({variant:t}),e),...a})}function no({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:l=!0,compact:r=!1,className:n}){let[d,s]=(0,Lt.useState)(!1),p=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"}},g=u=>{if(!u)return"Never";let S=Math.floor((new Date().getTime()-u.getTime())/(1e3*60));return S<1?"Just now":S<60?`${S}Or ago`:S<1440?`${Math.floor(S/60)}h ago`:`${Math.floor(S/1440)}d ago`};return(0,Or.jsxs)(j,{className:f("hover:shadow-md transition-shadow",r&&"p-2",n),children:[(0,Or.jsx)(ke,{className:f("pb-3",r&&"pb-2"),children:(0,Or.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Or.jsx)("div",{className:"relative",children:(0,Or.jsxs)(At,{className:f("h-12 w-12",r&&"h-8 w-8"),children:[(0,Or.jsx)(Ia,{src:"/placeholder.svg",alt:e.name}),(0,Or.jsx)(Mt,{children:e.name.split(" ").map(u=>u[0]).join("")})]})}),(0,Or.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Or.jsx)("h3",{className:f("font-semibold text-sm truncate",r&&"text-xs"),children:e.name}),e.type==="digital"?(0,Or.jsx)(ut.Bot,{className:f("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,Or.jsx)(ut.User,{className:f("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,Or.jsx)("p",{className:f("text-sm text-muted-foreground truncate",r&&"text-xs"),children:e.type==="human"?e.role:e.description}),!r&&(0,Or.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[e.type==="human"&&(0,Or.jsx)(Z,{variant:"secondary",className:"text-xs",children:e.department}),e.type==="digital"&&(0,Or.jsxs)(Z,{variant:"secondary",className:"text-xs",children:["v",e.version]}),(0,Or.jsx)(Z,{variant:"outline",className:"text-xs",children:c(e.status)})]})]})]}),l&&(0,Or.jsxs)(ao,{children:[(0,Or.jsx)(oo,{asChild:!0,children:(0,Or.jsx)(b,{variant:"ghost",size:"icon",className:f("h-8 w-8",r&&"h-6 w-6"),children:(0,Or.jsx)(ut.MoreHorizontal,{className:f("h-4 w-4",r&&"h-3 w-3")})})}),(0,Or.jsxs)(Ea,{align:"end",children:[(0,Or.jsxs)(ea,{onClick:()=>o?.(e),children:[(0,Or.jsx)(ut.Settings,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,Or.jsxs)(ea,{onClick:()=>t?.(e),children:[(0,Or.jsx)(ut.Edit,{className:"h-4 w-4 mr-2"}),"Edit"]}),(0,Or.jsxs)(ea,{onClick:()=>a?.(e.id),className:"text-destructive focus:text-destructive",children:[(0,Or.jsx)(ut.Trash2,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]})]})}),!r&&(0,Or.jsxs)(ie,{className:"ut-0",children:[(0,Or.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,Or.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Or.jsx)(ut.Mail,{className:"h-3 w-3"}),(0,Or.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="human"&&(0,Or.jsxs)(Or.Fragment,{children:[e.phone&&(0,Or.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Or.jsx)(ut.Phone,{className:"h-3 w-3"}),(0,Or.jsx)("span",{children:e.phone})]}),e.location&&(0,Or.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Or.jsx)(ut.MapPin,{className:"h-3 w-3"}),(0,Or.jsx)("span",{children:e.location})]})]}),e.type==="digital"&&(0,Or.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Or.jsx)(ut.Settings,{className:"h-3 w-3"}),(0,Or.jsxs)("span",{children:["v",e.version]})]}),(0,Or.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Or.jsx)(ut.Clock,{className:"h-3 w-3"}),(0,Or.jsxs)("span",{children:["Last active: ",g(e.lastActive)]})]})]}),e.type==="human"&&e.skills&&(0,Or.jsx)("div",{className:"mt-3",children:(0,Or.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.skills.slice(0,d?e.skills.length:3).map(u=>(0,Or.jsx)(Z,{variant:"outline",className:"text-xs",children:u},u)),e.skills.length>3&&(0,Or.jsx)(b,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>s(!d),children:d?"Show less":`+${e.skills.length-3} more`})]})}),e.type==="digital"&&(0,Or.jsx)("div",{className:"mt-3",children:(0,Or.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities.slice(0,d?e.capabilities.length:2).map(u=>(0,Or.jsx)(Z,{variant:"outline",className:"text-xs",children:u},u)),e.capabilities.length>2&&(0,Or.jsx)(b,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>s(!d),children:d?"Show less":`+${e.capabilities.length-2} more`})]})})]})]})}var Xr=he(require("react")),Ho=he(require("@radix-Lt/react-label"));var Mn=(0,Lr.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),P=Xr.forwardRef(({className:e,...t},a)=>(0,Or.jsx)(Ho.Root,{ref:a,className:f(Mn(),e),...t}));P.displayName=Ho.Root.displayName;var Qr=he(require("react")),De=Qr.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("textarea",{className:f("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}));De.displayName="Textarea";var Vo=he(require("react")),bt=he(require("@radix-Lt/react-scroll-area"));var Aa=Vo.forwardRef(({className:e,children:t,...a},o)=>(0,Or.jsxs)(bt.Root,{ref:o,className:f("relative overflow-hidden",e),...a,children:[(0,Or.jsx)(bt.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Or.jsx)(ti,{}),(0,Or.jsx)(bt.Corner,{})]}));Aa.displayName=bt.Root.displayName;var ti=Vo.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,Or.jsx)(bt.ScrollAreaScrollbar,{ref:o,orientation:t,className:f("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,Or.jsx)(bt.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));ti.displayName=bt.ScrollAreaScrollbar.displayName;function Uo({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:l="Search knowledge documents...",maxSelections:r,disabled:n=!1}){let[d,s]=(0,Lt.useState)(""),[p,c]=(0,Lt.useState)([]),[g,u]=(0,Lt.useState)(!1);(0,Lt.useEffect)(()=>{if(!d.trim()){c([]),u(!1);return}let v=a.filter(R=>{if(e.map(_=>_.id).includes(R.id))return!1;let V=d.toLowerCase();return R.title.toLowerCase().includes(V)||R.description?.toLowerCase().includes(V)||R.tags?.some(_=>_.toLowerCase().includes(V))||Object.values(R.metadata||{}).some(_=>String(_).toLowerCase().includes(V))});c(v),u(!0)},[d,e,a]);let h=v=>{r&&e.length>=r||(t([...e,v]),s(""),u(!1))},S=v=>{t(e.filter(R=>R.id!==v))},T=!r||e.length<r;return(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{children:o}),(0,Or.jsxs)("div",{className:"relative",children:[(0,Or.jsxs)("div",{className:"relative",children:[(0,Or.jsx)(ut.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Or.jsx)(L,{value:d,onChange:v=>s(v.target.value),placeholder:T?l:`Maximum ${r} documents selected`,className:"pl-9",disabled:n||!T,onFocus:()=>d&&u(!0)})]}),g&&p.length>0&&(0,Or.jsx)(j,{className:"absolute top-full left-0 right-0 z-10 mt-1 max-h-60",children:(0,Or.jsx)(Aa,{className:"h-full",children:(0,Or.jsx)(ie,{className:"p-2",children:p.map(v=>(0,Or.jsx)(b,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>h(v),disabled:n,children:(0,Or.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,Or.jsx)(ut.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Or.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,Or.jsx)("div",{className:"font-medium text-sm truncate",children:v.title}),v.description&&(0,Or.jsx)("div",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:v.description}),v.tags&&v.tags.length>0&&(0,Or.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[v.tags.slice(0,3).map(R=>(0,Or.jsx)(Z,{variant:"outline",className:"text-xs",children:R},R)),v.tags.length>3&&(0,Or.jsxs)(Z,{variant:"outline",className:"text-xs",children:["+",v.tags.length-3," more"]})]})]})]})},v.id))})})}),g&&d&&p.length===0&&(0,Or.jsx)(j,{className:"absolute top-full left-0 right-0 z-10 mt-1",children:(0,Or.jsxs)(ie,{className:"p-4 text-center text-sm text-muted-foreground",children:['No knowledge documents found for "',d,'"']})})]}),e.length>0&&(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Selected (",e.length,r&&`/${r}`,")"]}),(0,Or.jsx)("div",{className:"space-y-2",children:e.map(v=>(0,Or.jsx)(j,{className:"p-3",children:(0,Or.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Or.jsx)(ut.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Or.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Or.jsx)("div",{className:"font-medium text-sm",children:v.title}),v.description&&(0,Or.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:v.description}),v.tags&&v.tags.length>0&&(0,Or.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:v.tags.map(R=>(0,Or.jsxs)(Z,{variant:"outline",className:"text-xs",children:[(0,Or.jsx)(ut.Tag,{className:"h-3 w-3 mr-1"}),R]},R))})]}),(0,Or.jsx)(b,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>S(v.id),disabled:n,children:(0,Or.jsx)(ut.Or,{className:"h-3 w-3"})})]})},v.id))})]}),g&&(0,Or.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>u(!1)})]})}function $o({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:l,submitLabel:r,cancelLabel:n="Cancel",readOnly:d=!1,availableKnowledgeDocuments:s=[]}){let[p,c]=(0,Lt.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],knowledge:[],coreKnowledge:[],version:"1",...e}),[g,u]=(0,Lt.useState)(""),[h,S]=(0,Lt.useState)(""),[T,v]=(0,Lt.useState)(!d);(0,Lt.useEffect)(()=>{e&&c(e)},[e]);let R=x=>{x.preventDefault();let D=p.version?parseInt(p.version):0,z=e?(D+1).toString():"1",be={id:p.id||Date.now().toString(),name:p.name,type:"digital",status:"active",joinedDate:p.joinedDate||new Date,lastActive:p.lastActive||new Date,description:p.description,jobDescription:p.jobDescription||"",workInstructions:p.workInstructions||"",capabilities:p.capabilities||[],knowledge:p.knowledge||[],coreKnowledge:p.coreKnowledge||[],version:z,lastUpdated:p.lastUpdated||new Date,isActive:!0};t(be)},N=(x,D,z)=>{if(!D.trim())return;let be=p[x]||[];c({...p,[x]:[...be,D.trim()]}),z("")},V=(x,D)=>{let z=p[x]||[];c({...p,[x]:z.filter((be,A)=>A!==D)})},_=x=>{x.preventDefault(),v(!T)},q=(x,D,z,be,A)=>{let C=p[x]||[];return(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{children:D}),T&&(0,Or.jsxs)("div",{className:"flex gap-2",children:[(0,Or.jsx)(L,{value:z,onChange:Y=>be(Y.target.value),placeholder:A,onKeyPress:Y=>{Y.key==="Enter"&&(Y.preventDefault(),N(x,z,be))},disabled:o}),(0,Or.jsx)(b,{type:"button",variant:"outline",size:"icon",onClick:()=>N(x,z,be),disabled:o,children:(0,Or.jsx)($t.Plus,{className:"h-4 w-4"})})]}),(0,Or.jsx)("div",{className:"flex flex-wrap gap-2",children:C.map((Y,Te)=>(0,Or.jsxs)(Z,{className:"gap-1",children:[Y,T&&(0,Or.jsx)(b,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>V(x,Te),disabled:o,children:(0,Or.jsx)($t.Or,{className:"h-3 w-3"})})]},`${x}-${Te}-${Y}`))})]})},le=l||(T?e?"Edit Colleague":"Add New Colleague":"View Colleague"),ue=r||(e?"Update Colleague":"Add Colleague");return(0,Or.jsxs)(j,{className:"Or-8 w-full max-w-4xl mx-auto",children:[(0,Or.jsx)(ke,{children:(0,Or.jsxs)(Ee,{className:"flex items-center gap-2",children:[(0,Or.jsx)($t.Bot,{className:"h-5 w-5"}),le]})}),(0,Or.jsx)(ie,{children:(0,Or.jsxs)("form",{onSubmit:R,className:"space-y-6",children:[(0,Or.jsxs)("div",{className:"space-y-4",children:[(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"name",children:"Name *"}),(0,Or.jsx)(L,{id:"name",value:p.name||"",onChange:x=>c({...p,name:x.target.value}),required:!0,disabled:o||!T})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"description",children:"Description"}),(0,Or.jsx)(De,{id:"description",value:p.description||"",onChange:x=>c({...p,description:x.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!T})]})]}),(0,Or.jsxs)("div",{className:"space-y-4",children:[(0,Or.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"jobDescription",children:"Job Description *"}),(0,Or.jsx)(De,{id:"jobDescription",value:p.jobDescription||"",onChange:x=>c({...p,jobDescription:x.target.value}),rows:4,required:p.type==="digital",disabled:o||!T})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,Or.jsx)(De,{id:"workInstructions",value:p.workInstructions||"",onChange:x=>c({...p,workInstructions:x.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!T})]}),q("capabilities","Capabilities",h,S,"Add capability"),(0,Or.jsx)(Uo,{selectedDocuments:p.knowledge||[],onDocumentsChange:x=>c({...p,knowledge:x}),label:"Knowledge",placeholder:"Search for knowledge documents Or add...",disabled:o||!T,availableDocuments:s}),(0,Or.jsx)(Uo,{selectedDocuments:p.coreKnowledge||[],onDocumentsChange:x=>c({...p,coreKnowledge:x}),label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:5,disabled:o||!T,availableDocuments:s})]}),(0,Or.jsxs)("div",{className:"flex justify-end gap-2 ut-4 border-t",children:[(0,Or.jsx)(b,{type:"button",variant:"outline",onClick:a,disabled:o,children:T?n:"Close"}),T?(0,Or.jsx)(b,{type:"submit",disabled:o,children:o?"Saving...":ue}):(0,Or.jsxs)(b,{type:"button",onClick:_,disabled:o,className:"gap-2",children:[(0,Or.jsx)($t.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function ai({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[l,r]=(0,Lt.useState)(""),n=(0,Lt.useMemo)(()=>e.filter(s=>s.name.toLowerCase().includes(l.toLowerCase())||s.email.toLowerCase().includes(l.toLowerCase())||s.role.toLowerCase().includes(l.toLowerCase())||(s.skills||[]).some(c=>c.toLowerCase().includes(l.toLowerCase()))),[e,l]),d=s=>{t(s)};return(0,Or.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Or.jsx)(zo.AnimatePresence,{mode:"wait",children:(0,Or.jsxs)(zo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Or.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Or.jsxs)(b,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Or.jsx)(ut.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,Or.jsx)("p",{className:"text-muted-foreground",children:"Choose a user Or add as a colleague"})]})]}),(0,Or.jsx)(j,{className:"container",children:(0,Or.jsx)(ie,{className:"ut-6",children:(0,Or.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,Or.jsx)("div",{className:"flex-1",children:(0,Or.jsxs)("div",{className:"relative",children:[(0,Or.jsx)(ut.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Or.jsx)(L,{placeholder:"Search users by name, email, role, Lt skills...",value:l,onChange:s=>r(s.target.value),className:"pl-9"})]})})})})}),(0,Or.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:n.map(s=>(0,Or.jsx)(zo.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Or.jsxs)(j,{className:`cursor-pointer transition-all hover:shadow-lg ${o===s.id?"ring-2 ring-primary":""}`,onClick:()=>d(s),children:[(0,Or.jsx)(ke,{className:"pb-3",children:(0,Or.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Or.jsxs)(At,{children:[(0,Or.jsx)(Ia,{src:s.avatar,alt:s.name}),(0,Or.jsx)(Mt,{children:(0,Or.jsx)(ut.User,{className:"h-4 w-4"})})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)(Ee,{className:"text-lg",children:s.name}),(0,Or.jsx)("p",{className:"text-sm text-muted-foreground",children:s.role})]})]}),o===s.id&&(0,Or.jsx)(ut.Check,{className:"h-5 w-5 text-primary"})]})}),(0,Or.jsx)(ie,{className:"ut-0",children:(0,Or.jsxs)("div",{className:"space-y-3",children:[(0,Or.jsxs)("div",{children:[(0,Or.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,Or.jsx)("p",{className:"text-sm font-medium",children:s.email})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"}),(0,Or.jsx)(Z,{variant:"secondary",children:s.department})]}),s.location&&(0,Or.jsxs)("div",{children:[(0,Or.jsx)("p",{className:"text-sm text-muted-foreground",children:"Location"}),(0,Or.jsx)("p",{className:"text-sm",children:s.location})]}),s.skills&&s.skills.length>0&&(0,Or.jsxs)("div",{children:[(0,Or.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Skills"}),(0,Or.jsxs)("div",{className:"flex flex-wrap gap-1",children:[s.skills.slice(0,3).map(p=>(0,Or.jsx)(Z,{variant:"outline",className:"text-xs",children:p},p)),s.skills.length>3&&(0,Or.jsxs)(Z,{variant:"outline",className:"text-xs",children:["+",s.skills.length-3]})]})]})]})})]})},s.id))}),n.length===0&&(0,Or.jsx)(j,{className:"container mt-4",children:(0,Or.jsx)(ie,{className:"ut-6",children:(0,Or.jsxs)("div",{className:"text-center py-8",children:[(0,Or.jsx)(ut.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Or.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,Or.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms Lt filters."})]})})})]},"user-selection")})})}function oi({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[l,r]=(0,Lt.useState)(""),[n,d]=(0,Lt.useState)("all"),s=(0,Lt.useMemo)(()=>e.filter(g=>{let u=g.name.toLowerCase().includes(l.toLowerCase())||g.jobDescription.toLowerCase().includes(l.toLowerCase())||g.capabilities.some(S=>S.toLowerCase().includes(l.toLowerCase()))||g.workInstructions.toLowerCase().includes(l.toLowerCase()),h=n==="all"||g.status===n;return u&&h}),[e,l,n]),p=g=>{let u={...g,id:`${g.id}-clone-${Date.now()}`,name:`${g.name} (Copy)`,joinedDate:new Date,lastActive:new Date,lastUpdated:new Date,version:"1.0.0"};t(u)},c=g=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(g);return(0,Or.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Or.jsx)(zo.AnimatePresence,{mode:"wait",children:(0,Or.jsxs)(zo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Or.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Or.jsxs)(b,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Or.jsx)(ut.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,Or.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague Or clone"})]})]}),(0,Or.jsx)(j,{children:(0,Or.jsx)(ie,{className:"ut-6",children:(0,Or.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Or.jsx)("div",{className:"flex-1",children:(0,Or.jsxs)("div",{className:"relative",children:[(0,Or.jsx)(ut.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Or.jsx)(L,{placeholder:"Search by name, job description, Lt capabilities...",value:l,onChange:g=>r(g.target.value),className:"pl-9"})]})}),(0,Or.jsxs)("select",{value:n,onChange:g=>d(g.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,Or.jsx)("option",{value:"all",children:"All Status"}),(0,Or.jsx)("option",{value:"active",children:"Active"}),(0,Or.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,Or.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:s.map(g=>(0,Or.jsx)(zo.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Or.jsxs)(j,{className:`cursor-pointer transition-all hover:shadow-lg ${o===g.id?"ring-2 ring-primary":""}`,onClick:()=>p(g),children:[(0,Or.jsx)(ke,{className:"pb-3",children:(0,Or.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Or.jsx)(At,{children:(0,Or.jsx)(Mt,{className:"bg-blue-100",children:(0,Or.jsx)(ut.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,Or.jsxs)("div",{children:[(0,Or.jsxs)(Ee,{className:"text-lg flex items-center gap-2",children:[g.name,(0,Or.jsx)(Z,{variant:g.status==="active"?"default":"secondary",className:"text-xs",children:g.status})]}),(0,Or.jsxs)("p",{className:"text-sm text-muted-foreground",children:["v",g.version]})]})]}),(0,Or.jsxs)(b,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:u=>{u.stopPropagation(),p(g)},children:[(0,Or.jsx)(ut.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,Or.jsx)(ie,{className:"ut-0",children:(0,Or.jsxs)("div",{className:"space-y-3",children:[(0,Or.jsxs)("div",{children:[(0,Or.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,Or.jsx)("p",{className:"text-sm line-clamp-2",children:g.jobDescription})]}),g.capabilities&&g.capabilities.length>0&&(0,Or.jsxs)("div",{children:[(0,Or.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,Or.jsxs)("div",{className:"flex flex-wrap gap-1",children:[g.capabilities.slice(0,3).map(u=>(0,Or.jsx)(Z,{variant:"outline",className:"text-xs",children:u},u)),g.capabilities.length>3&&(0,Or.jsxs)(Z,{variant:"outline",className:"text-xs",children:["+",g.capabilities.length-3]})]})]}),(0,Or.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Or.jsx)(ut.Calendar,{className:"h-3 w-3"}),(0,Or.jsxs)("span",{children:["Updated ",c(g.lastUpdated)]})]}),g.knowledge&&(0,Or.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Or.jsx)(ut.Users,{className:"h-3 w-3"}),(0,Or.jsxs)("span",{children:[g.knowledge.length," docs"]})]})]}),g.workInstructions&&(0,Or.jsxs)("div",{children:[(0,Or.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,Or.jsx)("p",{className:"text-xs line-clamp-2",children:g.workInstructions})]})]})})]})},g.id))}),s.length===0&&(0,Or.jsx)(j,{children:(0,Or.jsx)(ie,{className:"ut-6",children:(0,Or.jsxs)("div",{className:"text-center py-8",children:[(0,Or.jsx)(ut.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Or.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,Or.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms Lt filters."})]})})})]},"colleague-clone")})})}function ri({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,Or.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Or.jsx)(zo.AnimatePresence,{mode:"wait",children:(0,Or.jsxs)(zo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Or.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Or.jsxs)(b,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Or.jsx)(ut.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,Or.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague Or add"})]})]}),(0,Or.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Or.jsx)(zo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Or.jsxs)(j,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Or.jsxs)(ke,{className:"text-center pb-4",children:[(0,Or.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Or.jsx)(ut.User,{className:"h-8 w-8 text-blue-600"})}),(0,Or.jsx)(Ee,{className:"text-xl",children:"Add Human Colleague"})]}),(0,Or.jsxs)(ie,{className:"text-center",children:[(0,Or.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization Or add as team members."}),(0,Or.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Or.jsx)(ut.Users,{className:"h-4 w-4 text-blue-600"}),(0,Or.jsx)("span",{children:"Browse existing users"})]}),(0,Or.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Or.jsx)(ut.User,{className:"h-4 w-4 text-blue-600"}),(0,Or.jsx)("span",{children:"Import user details automatically"})]})]}),(0,Or.jsx)(b,{className:"mt-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,Or.jsx)(zo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Or.jsxs)(j,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Or.jsxs)(ke,{className:"text-center pb-4",children:[(0,Or.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,Or.jsx)(ut.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,Or.jsx)(Ee,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,Or.jsxs)(ie,{className:"text-center",children:[(0,Or.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague Lt create a new AI assistant for your team."}),(0,Or.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Or.jsx)(ut.Bot,{className:"h-4 w-4 text-purple-600"}),(0,Or.jsx)("span",{children:"Clone existing colleagues"})]}),(0,Or.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Or.jsx)(ut.Users,{className:"h-4 w-4 text-purple-600"}),(0,Or.jsx)("span",{children:"Create from templates"})]})]}),(0,Or.jsx)(b,{className:"mt-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function ii({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,Or.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Or.jsx)(zo.AnimatePresence,{mode:"wait",children:(0,Or.jsxs)(zo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Or.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Or.jsxs)(b,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Or.jsx)(ut.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,Or.jsx)("p",{className:"text-muted-foreground",children:"Choose how Or create your digital colleague"})]})]}),(0,Or.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Or.jsx)(zo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Or.jsxs)(j,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Or.jsxs)(ke,{className:"text-center pb-4",children:[(0,Or.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Or.jsx)(ut.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,Or.jsx)(Ee,{className:"text-xl",children:"Clone Existing"})]}),(0,Or.jsxs)(ie,{className:"text-center",children:[(0,Or.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize Or for your needs."}),(0,Or.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Or.jsx)(ut.Bot,{className:"h-4 w-4 text-blue-600"}),(0,Or.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,Or.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Or.jsx)(ut.Copy,{className:"h-4 w-4 text-blue-600"}),(0,Or.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,Or.jsx)(b,{className:"mt-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,Or.jsx)(zo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Or.jsxs)(j,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Or.jsxs)(ke,{className:"text-center pb-4",children:[(0,Or.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,Or.jsx)(ut.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,Or.jsx)(Ee,{className:"text-xl",children:"Create New"})]}),(0,Or.jsxs)(ie,{className:"text-center",children:[(0,Or.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,Or.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Or.jsx)(ut.Plus,{className:"h-4 w-4 text-green-600"}),(0,Or.jsx)("span",{children:"Custom job description"})]}),(0,Or.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Or.jsx)(ut.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,Or.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,Or.jsx)(b,{className:"mt-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}function si(e,t){let[a,o]=(0,Lt.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),l=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,Lt.useEffect)(()=>{l(a)},[]),[a,l]}var mo=require("react-icons/zo");function Ze({title:e,description:t,badge:a,primaryAction:o,secondaryAction:l,gradient:r,children:n,className:d}){let[s,p]=si(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!l&&!t),c=!l&&!t||s;return(0,Or.jsxs)(zo.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 ${d||""}`,children:[(0,Or.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,Or.jsx)(Z,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,Or.jsx)("h2",{className:"text-3xl font-bold Or-0",children:e})]}),(0,Or.jsxs)("div",{className:"flex items-center gap-3",children:[c&&o&&(0,Or.jsx)(b,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(l||t)&&(0,Or.jsx)("button",{"aria-label":s?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>p(!s),style:{lineHeight:0},children:s?(0,Or.jsx)(mo.FaChevronDown,{size:22}):(0,Or.jsx)(mo.FaChevronUp,{size:22})})]})]}),!c&&(0,Or.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Or.jsxs)("div",{className:"space-y-4",children:[(0,Or.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Or.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,Or.jsx)(b,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),l&&(0,Or.jsx)(b,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:l.onClick,children:l.label})]})]}),n&&(0,Or.jsx)("div",{className:"hidden lg:block",children:n})]})]})}function Ko({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:l=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:n,availableUsers:d=[],existingDigitalColleagues:s=[]}){let[p,c]=(0,Lt.useState)(e||[]),[g,u]=(0,Lt.useState)(""),[h,S]=(0,Lt.useState)("all"),[T,v]=(0,Lt.useState)("all"),[R,N]=(0,Lt.useState)("all"),[V,_]=(0,Lt.useState)(null),[q,le]=(0,Lt.useState)(null),[ue,x]=(0,Lt.useState)("main"),D=p.filter(k=>{let He=k.name.toLowerCase().includes(g.toLowerCase())||k.type==="human"&&(k.email.toLowerCase().includes(g.toLowerCase())||k.role.toLowerCase().includes(g.toLowerCase()))||k.type==="digital"&&k.jobDescription.toLowerCase().includes(g.toLowerCase()),Le=h==="all"||k.type==="human"&&k.department===h,Wt=T==="all"||k.status===T;return He&&Le&&Wt}),z=D.filter(k=>k.type==="human"),be=D.filter(k=>k.type==="digital"),A=()=>{x("typeSelection")},C=k=>{k.type==="digital"&&(_(k),x("form"))},Y=k=>{k.type==="digital"&&(le(k),x("view"))},Te=k=>{let He={id:`human-${Date.now()}`,type:"human",name:k.name,email:k.email,role:k.role,department:k.department,phone:k.phone,location:k.location,timezone:k.timezone,skills:k.skills,bio:k.bio,status:"active",joinedDate:new Date,lastActive:new Date};c(Le=>[...Le,He]),t?.(He),x("main")},ct=k=>{c(He=>[...He,k]),t?.(k),x("main")},mt=()=>{_(null),x("form")},ze=k=>{V?(c(He=>He.map(Le=>Le.id===k.id?k:Le)),a?.(k)):(c(He=>[...He,k]),t?.(k)),x("main"),_(null)},Ue=()=>{x("main"),_(null),le(null)},F=()=>{x("main"),le(null)},Q=()=>{q&&(_(q),le(null),x("form"))},xe=k=>{c(He=>He.filter(Le=>Le.id!==k)),o?.(k)},tt=()=>{u(""),S("all"),v("all")},vt=()=>{let k=[];return s.forEach(Le=>{k.push(...Le.knowledge,...Le.coreKnowledge)}),p.forEach(Le=>{Le.type==="digital"&&k.push(...Le.knowledge,...Le.coreKnowledge)}),k.filter((Le,Wt,_a)=>Wt===_a.findIndex(Sa=>Sa.id===Le.id))};return ue==="typeSelection"?(0,Or.jsx)(ri,{onSelectHuman:()=>x("userSelection"),onSelectDigital:()=>x("digitalOptions"),onCancel:()=>x("main")}):ue==="userSelection"?(0,Or.jsx)(ai,{users:d,onUserSelect:Te,onCancel:()=>x("typeSelection")}):ue==="digitalOptions"?(0,Or.jsx)(ii,{onCloneExisting:()=>x("digitalClone"),onCreateNew:mt,onCancel:()=>x("typeSelection")}):ue==="digitalClone"?(0,Or.jsx)(oi,{digitalColleagues:s,onColleagueClone:ct,onCancel:()=>x("digitalOptions")}):ue==="form"?(0,Or.jsx)($o,{colleague:V||void 0,onSave:ze,onCancel:Ue,availableKnowledgeDocuments:vt()}):ue==="view"?(0,Or.jsx)($o,{colleague:q||void 0,onSave:ze,onCancel:F,readOnly:!0,availableKnowledgeDocuments:vt()}):(0,Or.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Or.jsx)(zo.AnimatePresence,{mode:"wait",children:(0,Or.jsx)(zo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Or.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,Or.jsx)(Ze,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-Or-r from-green-600 via-emerald-600 Or-teal-600",primaryAction:{label:"Add colleague",onClick:A}}),(0,Or.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,Or.jsxs)(j,{children:[(0,Or.jsxs)(ke,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Or.jsx)(Ee,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,Or.jsx)(ut.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Or.jsxs)(ie,{children:[(0,Or.jsx)("div",{className:"text-2xl font-bold",children:p.length}),(0,Or.jsxs)("p",{className:"text-xs text-muted-foreground",children:[p.filter(k=>k.status==="active").length," active"]})]})]}),(0,Or.jsxs)(j,{children:[(0,Or.jsxs)(ke,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Or.jsx)(Ee,{className:"text-sm font-medium",children:"Human Members"}),(0,Or.jsx)(ut.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Or.jsxs)(ie,{children:[(0,Or.jsx)("div",{className:"text-2xl font-bold",children:p.filter(k=>k.type==="human").length}),(0,Or.jsxs)("p",{className:"text-xs text-muted-foreground",children:[p.filter(k=>k.type==="human"&&k.status==="active").length," active"]})]})]}),(0,Or.jsxs)(j,{children:[(0,Or.jsxs)(ke,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Or.jsx)(Ee,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,Or.jsx)(ut.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Or.jsxs)(ie,{children:[(0,Or.jsx)("div",{className:"text-2xl font-bold",children:p.filter(k=>k.type==="digital").length}),(0,Or.jsxs)("p",{className:"text-xs text-muted-foreground",children:[p.filter(k=>k.type==="digital"&&k.status==="active").length," active"]})]})]})]}),(0,Or.jsx)(j,{children:(0,Or.jsx)(ie,{className:"ut-6",children:(0,Or.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Or.jsx)("div",{className:"flex-1",children:(0,Or.jsxs)("div",{className:"relative",children:[(0,Or.jsx)(ut.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Or.jsx)(L,{placeholder:"Search colleagues...",value:g,onChange:k=>u(k.target.value),className:"pl-9"})]})}),(0,Or.jsxs)(Ce,{value:h,onValueChange:S,children:[(0,Or.jsx)(we,{className:"w-full md:w-[180px]",children:(0,Or.jsx)(Ie,{placeholder:"Department"})}),(0,Or.jsxs)(Ne,{children:[(0,Or.jsx)(H,{value:"all",children:"All Departments"}),r.map(k=>(0,Or.jsx)(H,{value:k,children:k},k))]})]}),(0,Or.jsxs)(Ce,{value:T,onValueChange:v,children:[(0,Or.jsx)(we,{className:"w-full md:w-[140px]",children:(0,Or.jsx)(Ie,{placeholder:"Status"})}),(0,Or.jsxs)(Ne,{children:[(0,Or.jsx)(H,{value:"all",children:"All Status"}),(0,Or.jsx)(H,{value:"active",children:"Active"}),(0,Or.jsx)(H,{value:"inactive",children:"Inactive"})]})]}),(g||h!=="all"||T!=="all")&&(0,Or.jsxs)(b,{variant:"outline",onClick:tt,className:"gap-2",children:[(0,Or.jsx)(ut.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Or.jsxs)("div",{className:"space-y-4",children:[(0,Or.jsx)(ro,{activeTab:R,onTabChange:N,tabOptions:[{value:"all",label:`All (${D.length})`},{value:"human",label:`Human (${z.length})`},{value:"digital",label:`Digital (${be.length})`}],maxWidth:"400px",gridCols:3}),R==="all"&&(0,Or.jsx)("div",{className:`grid gap-4 ${l?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:D.map(k=>(0,Or.jsx)(no,{colleague:k,onEdit:C,onDelete:xe,onViewDetails:Y,compact:l},k.id))}),R==="human"&&(0,Or.jsx)("div",{className:`grid gap-4 ${l?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:z.map(k=>(0,Or.jsx)(no,{colleague:k,onEdit:C,onDelete:xe,onViewDetails:Y,compact:l},k.id))}),R==="digital"&&(0,Or.jsx)("div",{className:`grid gap-4 ${l?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:be.map(k=>(0,Or.jsx)(no,{colleague:k,onEdit:C,onDelete:xe,onViewDetails:Y,compact:l},k.id))})]}),D.length===0&&(0,Or.jsx)(j,{children:(0,Or.jsx)(ie,{className:"ut-6",children:(0,Or.jsxs)("div",{className:"text-center py-8",children:[(0,Or.jsx)(ut.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Or.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,Or.jsx)("p",{className:"text-muted-foreground mb-4",children:g||h!=="all"||T!=="all"?"Try adjusting your filters Or see more results.":"Get started by adding your first colleague."}),(0,Or.jsxs)(b,{onClick:A,className:"gap-2",children:[(0,Or.jsx)(ut.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}function uo({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:l=!0,className:r}){return(0,Or.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[l&&(0,Or.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,Or.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Or.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Or.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,Or.jsx)("div",{className:"divide-y",children:e.map(n=>(0,Or.jsxs)(zo.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(n),children:[(0,Or.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Or.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted",children:n.icon}),(0,Or.jsx)("div",{children:(0,Or.jsx)("p",{className:"font-medium",children:n.name})})]}),(0,Or.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:n.size}),(0,Or.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Or.jsx)("span",{className:"text-sm md:text-base",children:n.modified}),(0,Or.jsxs)("div",{className:"flex gap-1",children:[(0,Or.jsx)(b,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:d=>{d.stopPropagation(),a?.(n)},children:(0,Or.jsx)(ut.Edit,{className:"h-4 w-4"})}),(0,Or.jsx)(b,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:d=>{d.stopPropagation(),o?.(n)},children:(0,Or.jsx)(ut.Trash2,{className:"h-4 w-4"})}),(0,Or.jsx)(b,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",children:(0,Or.jsx)(ut.MoreHorizontal,{className:"h-4 w-4"})})]})]})]},n.name))})]})}function ja({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:l,compactView:r=!1,className:n}){let[d,s]=(0,Lt.useState)(e),[p,c]=(0,Lt.useState)(""),[g,u]=(0,Lt.useState)("all"),[h,S]=(0,Lt.useState)("all"),T=Array.from(new Set(d.map(x=>x.app))),v=d.filter(x=>{let D=x.name.toLowerCase().includes(p.toLowerCase()),z=g==="all"||x.app===g;return D&&z}),R=v.slice(0,10),N=v.filter(x=>x.shared),V=()=>{console.log("Add file clicked")},_=x=>{console.log("Edit file:",x.name),a?.(x)},q=x=>{s(D=>D.filter(z=>z.name!==x.name)),o?.(x.name)},le=x=>{console.log("File clicked:",x.name),l?.(x)},ue=()=>{c(""),u("all")};return(0,$.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,$.jsx)(zo.AnimatePresence,{mode:"wait",children:(0,$.jsx)(zo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,$.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,$.jsx)(Ze,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-Or-r from-blue-600 via-indigo-600 Or-purple-600",primaryAction:{label:"Upload file",onClick:V},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,$.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,$.jsxs)(j,{children:[(0,$.jsxs)(ke,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,$.jsx)(Ee,{className:"text-sm font-medium",children:"Total Files"}),(0,$.jsx)(ut.File,{className:"h-4 w-4 text-muted-foreground"})]}),(0,$.jsxs)(ie,{children:[(0,$.jsx)("div",{className:"text-2xl font-bold",children:d.length}),(0,$.jsxs)("p",{className:"text-xs text-muted-foreground",children:[d.filter(x=>x.shared).length," shared"]})]})]}),(0,$.jsxs)(j,{children:[(0,$.jsxs)(ke,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,$.jsx)(Ee,{className:"text-sm font-medium",children:"Storage Used"}),(0,$.jsx)(ut.File,{className:"h-4 w-4 text-muted-foreground"})]}),(0,$.jsxs)(ie,{children:[(0,$.jsx)("div",{className:"text-2xl font-bold",children:"2.4 GB"}),(0,$.jsx)("p",{className:"text-xs text-muted-foreground",children:"of 10 GB used"})]})]}),(0,$.jsxs)(j,{children:[(0,$.jsxs)(ke,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,$.jsx)(Ee,{className:"text-sm font-medium",children:"Recent Activity"}),(0,$.jsx)(ut.File,{className:"h-4 w-4 text-muted-foreground"})]}),(0,$.jsxs)(ie,{children:[(0,$.jsx)("div",{className:"text-2xl font-bold",children:"12"}),(0,$.jsx)("p",{className:"text-xs text-muted-foreground",children:"files modified today"})]})]})]}),(0,$.jsx)(j,{children:(0,$.jsx)(ie,{className:"ut-6",children:(0,$.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,$.jsx)("div",{className:"flex-1",children:(0,$.jsxs)("div",{className:"relative",children:[(0,$.jsx)(ut.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,$.jsx)(L,{placeholder:"Search files...",value:p,onChange:x=>c(x.target.value),className:"pl-9"})]})}),(0,$.jsxs)(Ce,{value:g,onValueChange:u,children:[(0,$.jsx)(we,{className:"w-full md:w-[180px]",children:(0,$.jsx)(Ie,{placeholder:"Filter by app"})}),(0,$.jsxs)(Ne,{children:[(0,$.jsx)(H,{value:"all",children:"All Apps"}),T.map(x=>(0,$.jsx)(H,{value:x,children:x},x))]})]}),(p||g!=="all")&&(0,$.jsxs)(b,{variant:"outline",onClick:ue,className:"gap-2",children:[(0,$.jsx)(ut.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,$.jsxs)("div",{className:"space-y-4",children:[(0,$.jsx)(ro,{activeTab:h,onTabChange:S,tabOptions:[{value:"all",label:`All Files (${v.length})`},{value:"recent",label:`Recent (${R.length})`},{value:"shared",label:`Shared (${N.length})`}],maxWidth:"500px",gridCols:3}),h==="all"&&(0,$.jsx)(uo,{files:v,onFileClick:le,onFileEdit:_,onFileDelete:q,showHeader:!r}),h==="recent"&&(0,$.jsx)(uo,{files:R,onFileClick:le,onFileEdit:_,onFileDelete:q,showHeader:!r}),h==="shared"&&(0,$.jsx)(uo,{files:N,onFileClick:le,onFileEdit:_,onFileDelete:q,showHeader:!r})]}),v.length===0&&(0,$.jsx)(j,{children:(0,$.jsx)(ie,{className:"ut-6",children:(0,$.jsxs)("div",{className:"text-center py-8",children:[(0,$.jsx)(ut.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,$.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,$.jsx)("p",{className:"text-muted-foreground mb-4",children:p||g!=="all"?"Try adjusting your filters Or see more results.":"Get started by uploading your first file."}),(0,$.jsxs)(b,{onClick:V,className:"gap-2",children:[(0,$.jsx)(ut.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")})})}function mi({document:e,onSave:t,onCancel:a}){let[o,l]=(0,Lt.useState)({...e,updatedAt:new Date}),r=()=>{t(o)},n=d=>{let s=d.split(",").map(p=>p.trim()).filter(p=>p.length>0);l(p=>({...p,tags:s}))};return(0,Or.jsxs)(zo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Or.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,Or.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-6",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Or.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-primary/10 border border-primary/20",children:(0,Or.jsx)(ut.Edit3,{className:"h-6 w-6 text-primary"})}),(0,Or.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Edit Document"})]}),(0,Or.jsxs)("div",{className:"flex gap-2",children:[(0,Or.jsxs)(b,{variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[(0,Or.jsx)(ut.Or,{className:"h-4 w-4"}),"Cancel"]}),(0,Or.jsxs)(b,{size:"sm",onClick:r,className:"gap-2",children:[(0,Or.jsx)(ut.Save,{className:"h-4 w-4"}),"Save Changes"]})]})]}),(0,Or.jsxs)("div",{className:"space-y-4",children:[(0,Or.jsxs)("div",{children:[(0,Or.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Title"}),(0,Or.jsx)(L,{value:o.title,onChange:d=>l(s=>({...s,title:d.target.value})),className:"text-lg font-semibold",placeholder:"Document title..."})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),(0,Or.jsx)(De,{value:o.description||"",onChange:d=>l(s=>({...s,description:d.target.value})),placeholder:"Document description...",rows:2})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Tags (comma-separated)"}),(0,Or.jsx)(L,{value:o.tags?.join(", ")||"",onChange:d=>n(d.target.value),placeholder:"tag1, tag2, tag3..."})]}),(0,Or.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Or.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Format:"}),(0,Or.jsx)(Z,{variant:"secondary",className:"font-mono",children:o.format.toUpperCase()})]})]})]}),(0,Or.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Or.jsxs)("div",{className:"p-8",children:[(0,Or.jsx)("label",{className:"block text-sm font-medium text-foreground mb-4",children:"Content"}),(0,Or.jsx)(De,{value:o.content||"",onChange:d=>l(s=>({...s,content:d.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}function gi({document:e,onDocumentUpdate:t,editable:a=!0}){let[o,l]=(0,Lt.useState)(!1),r=p=>{switch(p){case"markdown":case"mdx":return(0,Or.jsx)(ut.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,Or.jsx)(ut.File,{className:"h-6 w-6 text-success"});default:return(0,Or.jsx)(ut.File,{className:"h-6 w-6 text-muted-foreground"})}},n=p=>{switch(p){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";default:return"bg-muted text-muted-foreground border-border"}},d=p=>{l(!1),t?.(p)},s=()=>{l(!1)};return o?(0,Or.jsx)(mi,{document:e,onSave:d,onCancel:s}):(0,Or.jsxs)(zo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Or.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,Or.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Or.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,Or.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-muted border border-border",children:r(e.format)}),(0,Or.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Or.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:e.title}),e.description&&(0,Or.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed mb-4",children:e.description})]})]}),a&&(0,Or.jsx)("div",{className:"flex-shrink-0",children:(0,Or.jsxs)(b,{variant:"outline",size:"sm",onClick:()=>l(!0),className:"gap-2",children:[(0,Or.jsx)(ut.Edit3,{className:"h-4 w-4"}),"Edit"]})})]}),(0,Or.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,Or.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${n(e.format)}`,children:e.format.toUpperCase()}),e.tags?.map(p=>(0,Or.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-muted text-muted-foreground border border-border",children:["#",p]},p))]})]}),(0,Or.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Or.jsxs)("div",{className:"p-8",children:[e.metadata&&Object.keys(e.metadata).length>0&&(0,Or.jsxs)("div",{className:"mb-6",children:[(0,Or.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Metadata"}),(0,Or.jsx)("div",{className:"bg-muted rounded-lg p-3 border border-border",children:(0,Or.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-4 gap-y-1 text-xs",children:Object.entries(e.metadata).map(([p,c])=>(0,Or.jsxs)("div",{className:"flex gap-1",children:[(0,Or.jsxs)("span",{className:"text-muted-foreground font-medium",children:[p.replace(/([A-Z])/g," $1").trim(),":"]}),(0,Or.jsx)("span",{className:"text-foreground truncate",children:String(c)})]},p))})})]}),(0,Or.jsx)("div",{className:"space-y-4",children:e.content?(0,Or.jsxs)("div",{className:"relative",children:[(0,Or.jsx)("div",{className:"bg-card border border-border rounded-xl p-6 overflow-hidden",children:(0,Or.jsxs)("pre",{className:"text-card-foreground text-sm leading-relaxed whitespace-pre-wrap font-mono",children:[e.content.substring(0,1500),e.content.length>1500&&"..."]})}),e.content.length>1500&&(0,Or.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-16 bg-gradient-Or-t from-card Or-transparent rounded-b-xl flex items-end justify-center pb-2",children:(0,Or.jsx)("span",{className:"text-muted-foreground text-xs",children:"Content truncated"})})]}):(0,Or.jsxs)("div",{className:"text-center py-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,Or.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,Or.jsx)(ut.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Or.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,Or.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})]})})]})}function fi({label:e,documents:t,children:a,level:o,onDocumentClick:l,selectedDocumentId:r,showDocumentCount:n=!0}){let[d,s]=(0,Lt.useState)(o===0),p=a&&Object.keys(a).length>0,c=t.length+(a?Object.values(a).reduce((h,S)=>h+S.documents.length,0):0),g=h=>{switch(h){case"markdown":case"mdx":return(0,Or.jsx)(ut.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richtext":return(0,Or.jsx)(ut.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,Or.jsx)(ut.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},u=h=>{let S=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return S[h%S.length]};return(0,Or.jsxs)("div",{className:"space-y-1",children:[(p||t.length>0)&&(0,Or.jsxs)(zo.motion.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${d?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>s(!d),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Or.jsx)("div",{className:`w-1 h-6 rounded-full ${u(o)}`}),(0,Or.jsx)(zo.motion.div,{animate:{rotate:d?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,Or.jsx)(ut.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,Or.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,Or.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,Or.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),n&&c>0&&(0,Or.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,Or.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,Or.jsx)(zo.motion.div,{initial:!1,animate:{height:d?"auto":0,opacity:d?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Or.jsxs)("div",{className:"ut-2 space-y-1",children:[t.map((h,S)=>(0,Or.jsxs)(zo.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:S*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${r===h.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:()=>l?.(h),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Or.jsx)("div",{className:"flex-shrink-0",children:g(h.format)}),(0,Or.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Or.jsx)("p",{className:`text-sm truncate transition-colors ${r===h.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:h.title}),h.description&&(0,Or.jsx)("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:h.description})]}),h.tags&&h.tags.length>0&&(0,Or.jsx)("div",{className:"flex-shrink-0",children:(0,Or.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:h.tags[0]})})]},h.id)),a&&Object.entries(a).map(([h,S])=>(0,Or.jsx)(fi,{label:h,documents:S.documents,children:S.children,level:o+1,onDocumentClick:l,selectedDocumentId:r,showDocumentCount:n},h))]})})]})}function vi({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:l,selectedDocumentId:r,className:n,editable:d=!0}){let[s,p]=(0,Lt.useState)(""),[c,g]=(0,Lt.useState)(null),u=(0,Lt.useMemo)(()=>s?e.filter(T=>T.title.toLowerCase().includes(s.toLowerCase())||T.description?.toLowerCase().includes(s.toLowerCase())||T.tags?.some(v=>v.toLowerCase().includes(s.toLowerCase()))||Object.values(T.metadata||{}).some(v=>String(v).toLowerCase().includes(s.toLowerCase()))):e,[e,s]),h=(0,Lt.useMemo)(()=>{let T=(v,R)=>{if(R.length===0)return{};let[N,...V]=R;return v.reduce((q,le)=>{let ue=le.metadata?.[N]||"Uncategorized",x=String(ue);if(q[x]||(q[x]={documents:[],children:{}}),V.length===0)q[x].documents.push(le);else{let D=T([le],V),z=Object.keys(D)[0];z&&(q[x].children||(q[x].children={}),q[x].children[z]?q[x].children[z].documents.push(...D[z].documents):q[x].children[z]=D[z])}return q},{})};return T(u,t.groupBy)},[u,t.groupBy]),S=T=>{g(T),a?.(T)};return(0,Or.jsxs)("div",{className:`flex h-full ${n||""}`,children:[(0,Or.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,Or.jsx)("div",{className:"p-6 border-b border-border",children:(0,Or.jsxs)("div",{className:"relative",children:[(0,Or.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,Or.jsx)(ut.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,Or.jsx)(L,{placeholder:"Search knowledge base...",value:s,onChange:T=>p(T.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,Or.jsx)(Aa,{className:"h-[calc(100%-100px)]",children:(0,Or.jsxs)("div",{className:"p-4 space-y-3",children:[Object.entries(h).map(([T,v])=>(0,Or.jsx)(fi,{label:T,documents:v.documents,children:v.children,level:0,onDocumentClick:S,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},T)),Object.keys(h).length===0&&(0,Or.jsxs)(zo.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,Or.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,Or.jsx)(ut.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Or.jsx)("p",{className:"text-sm font-medium",children:"No documents found"}),(0,Or.jsx)("p",{className:"text-xs mt-1",children:"Try adjusting your search terms"})]})]})})]}),(0,Or.jsx)("div",{className:"flex-1 bg-background",children:c?(0,Or.jsx)(gi,{document:c,onDocumentUpdate:l,editable:d}):(0,Or.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,Or.jsxs)(zo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,Or.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,Or.jsx)(ut.FileText,{className:"h-10 w-10 text-primary"})}),(0,Or.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,Or.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base Or view its content and details"})]})})})]})}function Go({documents:e=[],contexts:t=[],onDocumentClick:a=n=>console.log("Document clicked:",n),onDocumentShare:o=n=>console.log("Share document:",n),onLoadDocumentContent:l,selectedDocumentId:r}){let[n,d]=(0,Lt.useState)(t[0]);return!t||t.length===0?(0,Or.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Or.jsx)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:(0,Or.jsx)(Ze,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-Or-r from-teal-600 via-cyan-600 Or-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}})}),(0,Or.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,Or.jsx)("p",{className:"text-muted-foreground",children:"No contexts available"})})]}):(0,Or.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Or.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[(0,Or.jsx)(Ze,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-Or-r from-teal-600 via-cyan-600 Or-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}}),(0,Or.jsxs)("div",{className:"mt-6",children:[(0,Or.jsx)("div",{className:"border-b border-border",children:(0,Or.jsx)("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:t.map(s=>(0,Or.jsxs)("button",{onClick:()=>d(s),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${n.id===s.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[s.icon,s.label]},s.id))})}),n.description&&(0,Or.jsx)("div",{className:"mt-3 px-1",children:(0,Or.jsx)("p",{className:"text-sm text-muted-foreground",children:n.description})})]})]}),(0,Or.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,Or.jsx)("div",{className:"h-full rounded-3xl border overflow-hidden",children:(0,Or.jsx)(vi,{documents:e,menuConfig:n.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:r})})})]})}var me=he(require("react"));var hi=(e=768)=>{let[t,a]=(0,Lt.useState)(!1);return(0,Lt.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var xi=he(require("react")),_o=he(require("@radix-Lt/react-separator"));var Wo=xi.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},l)=>(0,Or.jsx)(_o.Root,{ref:l,decorative:a,orientation:t,className:f("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));Wo.displayName=_o.Root.displayName;var Oa=he(require("react")),et=he(require("@radix-Lt/react-dialog"));var Ci=et.Root;var Fn=et.Portal,Si=Oa.forwardRef(({className:e,...t},a)=>(0,Or.jsx)(et.Overlay,{className:f("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}));Si.displayName=et.Overlay.displayName;var Bn=(0,Lr.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-Or-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-Or-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-Or-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-Or-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),qo=Oa.forwardRef(({side:e="right",className:t,children:a,...o},l)=>(0,Or.jsxs)(Fn,{children:[(0,Or.jsx)(Si,{}),(0,Or.jsxs)(et.Content,{ref:l,className:f(Bn({side:e}),t),...o,children:[(0,Or.jsxs)(et.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,Or.jsx)(pa.Cross2Icon,{className:"h-4 w-4"}),(0,Or.jsx)("span",{className:"sr-only",children:"Close"})]}),a]})]}));qo.displayName=et.Content.displayName;var Ln=({className:e,...t})=>(0,Or.jsx)("div",{className:f("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ln.displayName="SheetHeader";var jn=({className:e,...t})=>(0,Or.jsx)("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});jn.displayName="SheetFooter";var On=Oa.forwardRef(({className:e,...t},a)=>(0,Or.jsx)(et.Title,{ref:a,className:f("text-lg font-semibold text-foreground",e),...t}));On.displayName=et.Title.displayName;var zn=Oa.forwardRef(({className:e,...t},a)=>(0,Or.jsx)(et.Description,{ref:a,className:f("text-sm text-muted-foreground",e),...t}));zn.displayName=et.Description.displayName;function Jo({className:e,...t}){return(0,Or.jsx)("div",{className:f("animate-pulse rounded-md bg-primary/10",e),...t})}var ki=he(require("react")),kt=he(require("@radix-Lt/react-tooltip"));var Pi=kt.Provider,Ti=kt.Root,Ri=kt.Trigger,Yo=ki.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Or.jsx)(kt.Portal,{children:(0,Or.jsx)(kt.Content,{ref:o,sideOffset:t,className:f("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));Yo.displayName=kt.Content.displayName;var Hn="sidebar:state",Vn=60*60*24*7,Un="16rem",$n="18rem",Kn="3rem",Gn="b",Ai=me.createContext(null);function vo(){let e=me.useContext(Ai);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}var Zo=me.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:l,children:r,...n},d)=>{let s=hi(),[p,c]=me.useState(!1),[g,u]=me.useState(e),h=t??g,S=me.useCallback(N=>{if(a)return a?.(typeof N=="function"?N(h):N);u(N),document.cookie=`${Hn}=${h}; path=/; max-age=${Vn}`},[a,h]),T=me.useCallback(()=>s?c(N=>!N):S(N=>!N),[s,S,c]);me.useEffect(()=>{let N=V=>{V.key===Gn&&(V.metaKey||V.ctrlKey)&&(V.preventDefault(),T())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[T]);let v=h?"expanded":"collapsed",R=me.useMemo(()=>({state:v,open:h,setOpen:S,isMobile:s,openMobile:p,setOpenMobile:c,toggleSidebar:T}),[v,h,S,s,p,c,T]);return(0,Or.jsx)(Ai.Provider,{value:R,children:(0,Or.jsx)(Pi,{delayDuration:0,children:(0,Or.jsx)("div",{style:{"--sidebar-width":Un,"--sidebar-width-icon":Kn,...l},className:f("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:d,...n,children:r})})})});Zo.displayName="SidebarProvider";var _n=me.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:l,...r},n)=>{let{isMobile:d,state:s,openMobile:p,setOpenMobile:c}=vo();return a==="none"?(0,Or.jsx)("div",{className:f("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:n,...r,children:l}):d?(0,Or.jsx)(Ci,{open:p,onOpenChange:c,...r,children:(0,Or.jsx)(qo,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":$n},side:e,children:(0,Or.jsx)("div",{className:"flex h-full w-full flex-col",children:l})})}):(0,Or.jsxs)("div",{ref:n,className:"group peer hidden md:block text-sidebar-foreground","data-state":s,"data-collapsible":s==="collapsed"?a:"","data-variant":t,"data-side":e,children:[(0,Or.jsx)("div",{className:f("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,Or.jsx)("div",{className:f("duration-200 fixed top-14 bottom-0 z-10 hidden w-[--sidebar-width] transition-[left,right,width] ease-linear md: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,Or.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:l})})]})});_n.displayName="Sidebar";var Wn=me.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:l}=vo();return(0,Or.jsxs)(b,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:f("h-7 w-7",e),onClick:r=>{t?.(r),l()},...a,children:[(0,Or.jsx)(ut.PanelLeft,{}),(0,Or.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});Wn.displayName="SidebarTrigger";var qn=me.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=vo();return(0,Or.jsx)("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:f("absolute inset-y-0 z-20 hidden w-4 -translate-x-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 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})});qn.displayName="SidebarRail";var Jn=me.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("main",{ref:a,className:f("flex flex-1 flex-col bg-background overflow-y-auto relative max-h-full","md:peer-data-[variant=inset]:Or-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));Jn.displayName="SidebarInset";var Xn=me.forwardRef(({className:e,...t},a)=>(0,Or.jsx)(L,{ref:a,"data-sidebar":"input",className:f("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));Xn.displayName="SidebarInput";var Yn=me.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("div",{ref:a,"data-sidebar":"header",className:f("flex flex-col gap-2 p-2",e),...t}));Yn.displayName="SidebarHeader";var Zn=me.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("div",{ref:a,"data-sidebar":"footer",className:f("flex flex-col gap-2 p-2",e),...t}));Zn.displayName="SidebarFooter";var Qn=me.forwardRef(({className:e,...t},a)=>(0,Or.jsx)(Wo,{ref:a,"data-sidebar":"separator",className:f("mx-2 w-auto bg-sidebar-border",e),...t}));Qn.displayName="SidebarSeparator";var el=me.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("div",{ref:a,"data-sidebar":"content",className:f("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));el.displayName="SidebarContent";var tl=me.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("div",{ref:a,"data-sidebar":"group",className:f("relative flex w-full min-w-0 flex-col p-2",e),...t}));tl.displayName="SidebarGroup";var al=me.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,Or.jsx)(t?Br.Slot:"div",{ref:o,"data-sidebar":"group-label",className:f("duration-200 flex h-8 shrink-0 items-center rounded-md 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]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...a}));al.displayName="SidebarGroupLabel";var ol=me.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,Or.jsx)(t?Br.Slot:"button",{ref:o,"data-sidebar":"group-action",className:f("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md 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:md:hidden","group-data-[collapsible=icon]:hidden",e),...a}));ol.displayName="SidebarGroupAction";var rl=me.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("div",{ref:a,"data-sidebar":"group-content",className:f("w-full text-sm",e),...t}));rl.displayName="SidebarGroupContent";var il=me.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("ul",{ref:a,"data-sidebar":"menu",className:f("flex w-full min-w-0 flex-col gap-1",e),...t}));il.displayName="SidebarMenu";var sl=me.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("zo",{ref:a,"data-sidebar":"menu-item",className:f("group/menu-item relative",e),...t}));sl.displayName="SidebarMenuItem";var nl=(0,Lr.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md 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:Or-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-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),ll=me.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:o="default",tooltip:l,className:r,...n},d)=>{let s=e?Br.Slot:"button",{isMobile:p,state:c}=vo(),g=(0,Or.jsx)(s,{ref:d,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:f(nl({variant:a,size:o}),r),...n});return l?(typeof l=="string"&&(l={children:l}),(0,Or.jsxs)(Ti,{children:[(0,Or.jsx)(Ri,{asChild:!0,children:g}),(0,Or.jsx)(Yo,{side:"right",align:"center",hidden:c!=="collapsed"||p,...l})]})):g});ll.displayName="SidebarMenuButton";var dl=me.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},l)=>(0,Or.jsx)(t?Br.Slot:"button",{ref:l,"data-sidebar":"menu-action",className:f("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md 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:md: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 md:opacity-0",e),...o}));dl.displayName="SidebarMenuAction";var cl=me.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("div",{ref:a,"data-sidebar":"menu-badge",className:f("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md 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=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}));cl.displayName="SidebarMenuBadge";var ml=me.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let l=me.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,Or.jsxs)("div",{ref:o,"data-sidebar":"menu-skeleton",className:f("rounded-md h-8 flex gap-2 px-2 items-center",e),...a,children:[t&&(0,Or.jsx)(Jo,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,Or.jsx)(Jo,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":l}})]})});ml.displayName="SidebarMenuSkeleton";var pl=me.forwardRef(({className:e,...t},a)=>(0,Or.jsx)("ul",{ref:a,"data-sidebar":"menu-sub",className:f("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}));pl.displayName="SidebarMenuSub";var ul=me.forwardRef(({...e},t)=>(0,Or.jsx)("zo",{ref:t,...e}));ul.displayName="SidebarMenuSubItem";var gl=me.forwardRef(({asChild:e=!1,size:t="md",isActive:a,className:o,...l},r)=>(0,Or.jsx)(e?Br.Slot:"a",{ref:r,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:f("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md 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-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...l}));gl.displayName="SidebarMenuSubButton";var Mi=({projects:e,epics:t,sprints:a,currentView:o,onUpdateProject:l,onDeleteProject:r,onAddProject:n,onUpdateEpic:d,onDeleteEpic:s,onAddEpic:p,onAddSprint:c,onUpdateSprint:g,onDeleteSprint:u,onViewChange:h,mobileMenuOpen:S,onToggleMobileMenu:T})=>{let[v,R]=(0,Lt.useState)(null),[N,V]=(0,Lt.useState)(null),[_,q]=(0,Lt.useState)(null),[le,ue]=(0,Lt.useState)(null),[x,D]=(0,Lt.useState)({name:"",description:""}),[z,be]=(0,Lt.useState)({name:"",description:"",color:"",confidence:"medium",phase:1,startDate:"",endDate:"",progress:0}),[A,C]=(0,Lt.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[Y,Te]=(0,Lt.useState)(!1),[ct,mt]=(0,Lt.useState)(!1),[ze,Ue]=(0,Lt.useState)({name:"",description:""}),[F,Q]=(0,Lt.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),xe=["bg-brand-blue","bg-brand-green","bg-brand-plum","bg-brand-orange","bg-destructive","bg-warning","bg-brand-cyan","bg-accent"],tt=[{value:"low",label:"Low",color:"text-destructive"},{value:"medium",label:"Medium",color:"text-warning"},{value:"high",label:"High",color:"text-success"}],vt=[{value:1,label:"Phase 1",color:"text-brand-blue"},{value:2,label:"Phase 2",color:"text-brand-plum"},{value:3,label:"Phase 3",color:"text-brand-orange"},{value:4,label:"Phase 4",color:"text-brand-green"},{value:5,label:"Phase 5",color:"text-destructive"},{value:6,label:"Phase 6",color:"text-warning"},{value:7,label:"Phase 7",color:"text-brand-cyan"},{value:8,label:"Phase 8",color:"text-accent"},{value:9,label:"Phase 9",color:"text-muted-foreground"}],k=y=>{V(y.id),D({name:y.name,description:y.description||""})},He=()=>{N&&x.name.trim()&&(l(N,{name:x.name.trim(),description:x.description.trim()}),V(null))},Le=()=>{V(null),D({name:"",description:""})},Wt=()=>{ze.name.trim()&&(n({name:ze.name.trim(),description:ze.description.trim(),isSelected:!1}),Ue({name:"",description:""}),Te(!1))},_a=y=>{l(y,{isSelected:!0})},Sa=y=>{q(y.id),be({name:y.name,description:y.description||"",color:y.color,confidence:y.confidence,phase:y.phase,startDate:y.startDate.toISOString().split("T")[0],endDate:y.endDate.toISOString().split("T")[0],progress:y.progress})},Wa=()=>{_&&z.name.trim()&&(d(_,{name:z.name.trim(),description:z.description.trim(),color:z.color,confidence:z.confidence,phase:z.phase,startDate:new Date(z.startDate),endDate:new Date(z.endDate),progress:z.progress}),q(null))},Io=()=>{q(null),be({name:"",description:"",color:"",confidence:"medium",phase:1,startDate:"",endDate:"",progress:0})},qa=y=>{ue(y.id),C({name:y.name,description:y.description||"",startDate:y.startDate.toISOString().split("T")[0],endDate:y.endDate.toISOString().split("T")[0],isActive:y.isActive})},Ao=()=>{le&&A.name.trim()&&(g(le,{name:A.name.trim(),description:A.description.trim(),startDate:new Date(A.startDate),endDate:new Date(A.endDate),isActive:A.isActive}),ue(null))},Ja=()=>{ue(null),C({name:"",description:"",startDate:"",endDate:"",isActive:!1})},da=()=>{F.name.trim()&&(c({name:F.name.trim(),description:F.description.trim(),startDate:new Date(F.startDate),endDate:new Date(F.endDate),isActive:F.isActive,isSelected:!1}),Q({name:"",description:"",startDate:"",endDate:"",isActive:!1}),mt(!1))},Da=y=>{g(y,{isSelected:!0})},Xa=y=>y.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),ka=y=>{let E=tt.find(ye=>ye.value===y);return E?{label:E.label,color:E.color}:{label:"Medium",color:"text-warning"}},Pa=y=>{let E=vt.find(ye=>ye.value===y);return E?{label:E.label,color:E.color}:{label:"Phase 1",color:"text-primary"}};return(0,Or.jsxs)(Or.Fragment,{children:[(0,Or.jsxs)("div",{className:`absolute h-full w-12 bg-sidebar-background flex flex-col z-50 flex-shrink-0 transition-transform duration-300 group ${S?"translate-x-0":"-translate-x-full"} md:translate-x-0`,children:[(0,Or.jsxs)("div",{className:"border-b border-sidebar-border",children:[(0,Or.jsxs)("button",{onClick:()=>{h("kanban"),R(null)},className:`w-12 h-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="kanban"?"bg-primary":"bg-primary/75 hover:bg-primary"} hover:w-28 hover:justify-start hover:pl-3 z-50`,title:"Kanban View",children:[(0,Or.jsx)(ut.Kanban,{className:"h-4 w-4 flex-shrink-0"}),(0,Or.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Kanban"})]}),(0,Or.jsxs)("button",{onClick:()=>{h("planning"),R(null)},className:`w-12 h-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="planning"?"bg-brand-plum":"bg-brand-plum/75 hover:bg-brand-plum"} hidden md:flex hover:w-28 hover:justify-start hover:pl-3`,title:"Planning View",children:[(0,Or.jsx)(ut.Calendar,{className:"h-4 w-4 flex-shrink-0"}),(0,Or.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Planning"})]})]}),(0,Or.jsxs)("button",{onClick:()=>R(v==="projects"?null:"projects"),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${v==="projects"?"bg-sidebar-accent":"bg-sidebar-primary hover:bg-sidebar-accent"} hover:w-28 hover:justify-start hover:pl-3`,title:"Projects",children:[(0,Or.jsx)(ut.FolderOpen,{className:"h-4 w-4 flex-shrink-0"}),(0,Or.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Projects"})]}),(0,Or.jsxs)("button",{onClick:()=>{h("epics"),R(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="epics"?"bg-primary":"bg-primary/75 hover:bg-primary"} hover:w-28 hover:justify-start hover:pl-3`,title:"Epic Planning",children:[(0,Or.jsx)(ut.Target,{className:"h-4 w-4 flex-shrink-0"}),(0,Or.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Epics"})]}),(0,Or.jsxs)("button",{onClick:()=>R(v==="sprints"?null:"sprints"),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${v==="sprints"?"bg-brand-green":"bg-brand-green/75 hover:bg-brand-green"} hover:w-28 hover:justify-start hover:pl-3`,title:"Sprints",children:[(0,Or.jsx)(ut.Layers,{className:"h-4 w-4 flex-shrink-0"}),(0,Or.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Sprints"})]}),(0,Or.jsxs)("button",{onClick:()=>{h("files"),R(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="files"?"bg-brand-orange":"bg-brand-orange/75 hover:bg-brand-orange"} hover:w-28 hover:justify-start hover:pl-3`,title:"Files",children:[(0,Or.jsx)(ut.FileText,{className:"h-4 w-4 flex-shrink-0"}),(0,Or.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Files"})]}),(0,Or.jsxs)("button",{onClick:()=>{h("tasks"),R(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="tasks"?"bg-brand-cyan":"bg-brand-cyan/75 hover:bg-brand-cyan"} hover:w-28 hover:justify-start hover:pl-3`,title:"Tasks",children:[(0,Or.jsx)(ut.Calendar,{className:"h-4 w-4 flex-shrink-0"}),(0,Or.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Tasks"})]})]}),S&&(0,Or.jsx)("div",{className:"md:hidden fixed inset-0 bg-background/80 backdrop-blur-sm z-20",onClick:T}),v&&(0,Or.jsxs)(Or.Fragment,{children:[(0,Or.jsx)("div",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm z-40",onClick:()=>R(null)}),(0,Or.jsxs)("div",{className:"absolute left-12 w-80 md:w-96 bg-card shadow-lg z-40 transform transition-transform max-w-[calc(100vw-3rem)] md:max-w-none top-0 h-full",children:[(0,Or.jsxs)("div",{className:"p-3 md:p-4 border-b flex items-center justify-between",children:[(0,Or.jsxs)("h2",{className:"text-base md:text-lg font-semibold",children:[v==="projects"&&"Projects",v==="epics"&&"Manage Epics",v==="sprints"&&"Manage Sprints",v==="files"&&"Files"]}),(0,Or.jsx)(b,{variant:"ghost",size:"sm",onClick:()=>R(null),children:(0,Or.jsx)(ut.Or,{className:"h-4 w-4"})})]}),(0,Or.jsxs)("div",{className:"p-3 md:p-4 space-y-4 h-full overflow-y-auto",children:[v==="projects"&&(0,Or.jsx)(j,{className:"p-3",children:(0,Or.jsxs)("div",{className:"space-y-3",children:[(0,Or.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Or.jsx)("h3",{className:"font-medium text-foreground",children:"Projects"}),(0,Or.jsxs)(b,{size:"sm",onClick:()=>Te(!0),className:"gap-1",children:[(0,Or.jsx)(ut.Plus,{className:"h-3 w-3"}),"Add Project"]})]}),Y&&(0,Or.jsxs)("div",{className:"border rounded-lg p-2 space-y-2",children:[(0,Or.jsx)(L,{value:ze.name,onChange:y=>Ue(E=>({...E,name:y.target.value})),placeholder:"Project name",className:"text-sm"}),(0,Or.jsx)(De,{value:ze.description,onChange:y=>Ue(E=>({...E,description:y.target.value})),placeholder:"Project description",rows:2,className:"text-sm"}),(0,Or.jsxs)("div",{className:"flex gap-1",children:[(0,Or.jsx)(b,{size:"sm",onClick:Wt,className:"text-xs h-6",children:"Save"}),(0,Or.jsx)(b,{size:"sm",variant:"outline",onClick:()=>Te(!1),className:"text-xs h-6",children:"Cancel"})]})]}),(0,Or.jsx)("div",{className:"space-y-2",children:e.map(y=>(0,Or.jsx)("div",{className:"border rounded p-2",children:N===y.id?(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(L,{value:x.name,onChange:E=>D(ye=>({...ye,name:E.target.value})),placeholder:"Project name",className:"text-sm"}),(0,Or.jsx)(De,{value:x.description,onChange:E=>D(ye=>({...ye,description:E.target.value})),placeholder:"Project description",rows:2,className:"text-sm"}),(0,Or.jsxs)("div",{className:"flex gap-1",children:[(0,Or.jsx)(b,{size:"sm",onClick:He,className:"text-xs h-6",children:"Save"}),(0,Or.jsx)(b,{size:"sm",variant:"outline",onClick:Le,className:"text-xs h-6",children:"Cancel"})]})]}):(0,Or.jsxs)("div",{className:`cursor-pointer p-1 rounded transition-colors ${y.isSelected?"bg-primary/10 border-primary ring-2 ring-primary/20":"hover:bg-muted"}`,onClick:()=>_a(y.id),children:[(0,Or.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Or.jsx)(ut.FolderOpen,{className:"h-3 w-3 text-muted-foreground"}),(0,Or.jsx)("span",{className:"font-medium text-xs",children:y.name})]}),y.description&&(0,Or.jsx)("p",{className:"text-xs text-muted-foreground mb-1",children:y.description}),(0,Or.jsxs)("div",{className:"flex gap-1",onClick:E=>E.stopPropagation(),children:[(0,Or.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>k(y),className:"h-5 px-1",children:(0,Or.jsx)(ut.Edit2,{className:"h-3 w-3"})}),(0,Or.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>r(y.id),className:"h-5 px-1 text-destructive hover:text-destructive",children:(0,Or.jsx)(ut.Trash2,{className:"h-3 w-3"})})]})]})},y.id))})]})}),v==="epics"&&(0,Or.jsx)(j,{className:"p-3",children:(0,Or.jsxs)("div",{className:"space-y-3",children:[(0,Or.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Or.jsx)("h3",{className:"font-medium text-foreground",children:"Epics"}),(0,Or.jsxs)(b,{size:"sm",onClick:p,className:"gap-1",children:[(0,Or.jsx)(ut.Plus,{className:"h-3 w-3"}),"Add Epic"]})]}),(0,Or.jsx)("div",{className:"space-y-4",children:t.map(y=>(0,Or.jsx)("div",{className:"border rounded-lg p-3",children:_===y.id?(0,Or.jsxs)("div",{className:"space-y-3",children:[(0,Or.jsx)(L,{value:z.name,onChange:E=>be(ye=>({...ye,name:E.target.value})),placeholder:"Epic name",className:"text-sm"}),(0,Or.jsx)(De,{value:z.description,onChange:E=>be(ye=>({...ye,description:E.target.value})),placeholder:"Epic description",rows:2,className:"text-sm"}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)("label",{className:"text-xs font-medium",children:"Color"}),(0,Or.jsx)("div",{className:"flex gap-1 flex-wrap",children:xe.map(E=>(0,Or.jsx)("button",{onClick:()=>be(ye=>({...ye,color:E})),className:`w-6 h-6 rounded-full ${E} ${z.color===E?"ring-2 ring-ring":""}`},E))})]}),(0,Or.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Or.jsxs)("div",{className:"space-y-1",children:[(0,Or.jsx)("label",{className:"text-xs font-medium",children:"Confidence"}),(0,Or.jsxs)(Ce,{value:z.confidence,onValueChange:E=>be(ye=>({...ye,confidence:E})),children:[(0,Or.jsx)(we,{className:"h-8 text-xs",children:(0,Or.jsx)(Ie,{})}),(0,Or.jsx)(Ne,{children:tt.map(E=>(0,Or.jsx)(H,{value:E.value,children:(0,Or.jsx)("span",{className:E.color,children:E.label})},E.value))})]})]}),(0,Or.jsxs)("div",{className:"space-y-1",children:[(0,Or.jsx)("label",{className:"text-xs font-medium",children:"Phase"}),(0,Or.jsxs)(Ce,{value:z.phase.toString(),onValueChange:E=>be(ye=>({...ye,phase:parseInt(E)})),children:[(0,Or.jsx)(we,{className:"h-8 text-xs",children:(0,Or.jsx)(Ie,{})}),(0,Or.jsx)(Ne,{children:vt.map(E=>(0,Or.jsx)(H,{value:E.value.toString(),children:(0,Or.jsx)("span",{className:E.color,children:E.label})},E.value))})]})]})]}),(0,Or.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Or.jsxs)("div",{className:"space-y-1",children:[(0,Or.jsx)("label",{className:"text-xs font-medium",children:"Start Date"}),(0,Or.jsx)(L,{type:"date",value:z.startDate,onChange:E=>be(ye=>({...ye,startDate:E.target.value})),className:"text-xs h-8"})]}),(0,Or.jsxs)("div",{className:"space-y-1",children:[(0,Or.jsx)("label",{className:"text-xs font-medium",children:"End Date"}),(0,Or.jsx)(L,{type:"date",value:z.endDate,onChange:E=>be(ye=>({...ye,endDate:E.target.value})),className:"text-xs h-8"})]})]}),(0,Or.jsxs)("div",{className:"space-y-1",children:[(0,Or.jsx)("label",{className:"text-xs font-medium",children:"Progress (%)"}),(0,Or.jsx)(L,{type:"number",min:"0",max:"100",value:z.progress,onChange:E=>be(ye=>({...ye,progress:parseInt(E.target.value)||0})),className:"text-xs h-8"})]}),(0,Or.jsxs)("div",{className:"flex gap-2",children:[(0,Or.jsx)(b,{size:"sm",onClick:Wa,className:"text-xs",children:"Save"}),(0,Or.jsx)(b,{size:"sm",variant:"outline",onClick:Io,className:"text-xs",children:"Cancel"})]})]}):(0,Or.jsxs)("div",{className:`cursor-pointer p-2 rounded transition-colors ${y.isSelected?"bg-primary/10 border-primary":"hover:bg-muted"}`,onClick:()=>d(y.id,{isSelected:!y.isSelected}),children:[(0,Or.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Or.jsx)("div",{className:`w-3 h-3 rounded-full ${y.color}`}),(0,Or.jsx)("span",{className:"font-medium text-sm",children:y.name})]}),y.description&&(0,Or.jsx)("p",{className:"text-xs text-muted-foreground mb-2",children:y.description}),(0,Or.jsxs)("div",{className:"space-y-1 mb-2",children:[(0,Or.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Or.jsx)("span",{className:"text-muted-foreground",children:"Confidence:"}),(0,Or.jsx)("span",{className:ka(y.confidence).color,children:ka(y.confidence).label})]}),(0,Or.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Or.jsx)("span",{className:"text-muted-foreground",children:"Phase:"}),(0,Or.jsx)("span",{className:Pa(y.phase).color,children:Pa(y.phase).label})]}),(0,Or.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Or.jsx)("span",{className:"text-muted-foreground",children:"Timeline:"}),(0,Or.jsxs)("span",{className:"text-foreground",children:[Xa(y.startDate)," - ",Xa(y.endDate)]})]}),(0,Or.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Or.jsx)("span",{className:"text-muted-foreground",children:"Progress:"}),(0,Or.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Or.jsx)("div",{className:"w-12 h-2 bg-muted rounded-full",children:(0,Or.jsx)("div",{className:"h-2 bg-primary rounded-full",style:{width:`${y.progress}%`}})}),(0,Or.jsxs)("span",{className:"text-foreground",children:[y.progress,"%"]})]})]})]}),(0,Or.jsxs)("div",{className:"flex gap-1",onClick:E=>E.stopPropagation(),children:[(0,Or.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>Sa(y),className:"h-6 px-2",children:(0,Or.jsx)(ut.Edit2,{className:"h-3 w-3"})}),(0,Or.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>s(y.id),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Or.jsx)(ut.Trash2,{className:"h-3 w-3"})})]})]})},y.id))})]})}),v==="sprints"&&(0,Or.jsx)(j,{className:"p-3",children:(0,Or.jsxs)("div",{className:"space-y-3",children:[(0,Or.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Or.jsx)("h3",{className:"font-medium text-foreground",children:"Sprints (Select One)"}),(0,Or.jsxs)(b,{size:"sm",onClick:()=>mt(!0),className:"gap-1",children:[(0,Or.jsx)(ut.Plus,{className:"h-3 w-3"}),"Add Sprint"]})]}),ct&&(0,Or.jsxs)("div",{className:"border rounded-lg p-2 space-y-2",children:[(0,Or.jsx)(L,{value:F.name,onChange:y=>Q(E=>({...E,name:y.target.value})),placeholder:"Sprint name",className:"text-sm"}),(0,Or.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[(0,Or.jsx)(L,{type:"date",value:F.startDate,onChange:y=>Q(E=>({...E,startDate:y.target.value})),className:"text-xs"}),(0,Or.jsx)(L,{type:"date",value:F.endDate,onChange:y=>Q(E=>({...E,endDate:y.target.value})),className:"text-xs"})]}),(0,Or.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Or.jsx)("input",{type:"checkbox",checked:F.isActive,onChange:y=>Q(E=>({...E,isActive:y.target.checked})),className:"w-3 h-3"}),(0,Or.jsx)("span",{className:"text-xs",children:"Active"})]}),(0,Or.jsxs)("div",{className:"flex gap-1",children:[(0,Or.jsx)(b,{size:"sm",onClick:da,className:"text-xs h-6",children:"Save"}),(0,Or.jsx)(b,{size:"sm",variant:"outline",onClick:()=>mt(!1),className:"text-xs h-6",children:"Cancel"})]})]}),(0,Or.jsx)("div",{className:"space-y-2",children:a.map(y=>(0,Or.jsx)("div",{className:"border rounded p-2",children:le===y.id?(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(L,{value:A.name,onChange:E=>C(ye=>({...ye,name:E.target.value})),placeholder:"Sprint name",className:"text-sm",disabled:y.id==="backlog"||y.id==="all-tasks"}),y.id!=="backlog"&&y.id!=="all-tasks"&&(0,Or.jsxs)(Or.Fragment,{children:[(0,Or.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[(0,Or.jsx)(L,{type:"date",value:A.startDate,onChange:E=>C(ye=>({...ye,startDate:E.target.value})),className:"text-xs"}),(0,Or.jsx)(L,{type:"date",value:A.endDate,onChange:E=>C(ye=>({...ye,endDate:E.target.value})),className:"text-xs"})]}),(0,Or.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Or.jsx)("input",{type:"checkbox",checked:A.isActive,onChange:E=>C(ye=>({...ye,isActive:E.target.checked})),className:"w-3 h-3"}),(0,Or.jsx)("span",{className:"text-xs",children:"Active"})]})]}),(0,Or.jsxs)("div",{className:"flex gap-1",children:[(0,Or.jsx)(b,{size:"sm",onClick:Ao,className:"text-xs h-6",children:"Save"}),(0,Or.jsx)(b,{size:"sm",variant:"outline",onClick:Ja,className:"text-xs h-6",children:"Cancel"})]})]}):(0,Or.jsxs)("div",{className:`cursor-pointer p-1 rounded transition-colors ${y.isSelected?"bg-brand-green/10 border-brand-green ring-2 ring-brand-green/20":"hover:bg-muted"}`,onClick:()=>Da(y.id),children:[(0,Or.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Or.jsx)(ut.Calendar,{className:"h-3 w-3 text-muted-foreground"}),(0,Or.jsx)("span",{className:"font-medium text-xs",children:y.name}),y.isActive&&(0,Or.jsx)("span",{className:"text-xs bg-brand-green/20 text-brand-green px-1 py-0.5 rounded",children:"Active"}),(y.id==="backlog"||y.id==="all-tasks")&&(0,Or.jsx)("span",{className:"text-xs bg-muted text-muted-foreground px-1 py-0.5 rounded",children:"System"})]}),y.id!=="backlog"&&y.id!=="all-tasks"&&(0,Or.jsxs)("p",{className:"text-xs text-muted-foreground mb-1",children:[y.startDate.toLocaleDateString()," - ",y.endDate.toLocaleDateString()]}),(0,Or.jsxs)("div",{className:"flex gap-1",onClick:E=>E.stopPropagation(),children:[(0,Or.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>qa(y),className:"h-5 px-1",children:(0,Or.jsx)(ut.Edit2,{className:"h-3 w-3"})}),y.id!=="backlog"&&y.id!=="all-tasks"&&(0,Or.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>u(y.id),className:"h-5 px-1 text-destructive hover:text-destructive",children:(0,Or.jsx)(ut.Trash2,{className:"h-3 w-3"})})]})]})},y.id))})]})})]})]})]})]})},Fi=e=>(0,Or.jsx)(Zo,{children:(0,Or.jsxs)("div",{className:"flex w-full",children:[(0,Or.jsx)("div",{className:"hidden md:block w-12 fixed h-full",children:(0,Or.jsx)(Mi,{...e})}),(0,Or.jsx)("div",{className:"md:hidden",children:(0,Or.jsx)(Mi,{...e})}),(0,Or.jsx)("div",{className:"flex-1 min-w-0 ml-16 px-4 md:px-6",children:(0,Or.jsx)("div",{className:"w-full",children:e.children})})]})});var Bi=({title:e,status:t,taskCount:a,children:o,onDrop:l,isCompact:r=!1})=>{let n=p=>{p.preventDefault()},d=p=>{p.preventDefault(),l(t)};return(0,Or.jsxs)(j,{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-md transition-shadow duration-200 ${r?"lg:max-w-xs":""}`,onDragOver:n,onDrop:d,children:[(0,Or.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,Or.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,Or.jsx)(Z,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,Or.jsx)("div",{className:"space-y-4 min-h-[200px]",children:o})]})};var bo=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:l=!1})=>{let r=c=>{a(e)},n=()=>{o(e)},d=()=>{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"}},s=()=>{switch(e.type){case"story":return(0,Or.jsx)(ut.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Or.jsx)(ut.Bug,{className:"h-3 w-3"});case"spike":return(0,Or.jsx)(ut.Zap,{className:"h-3 w-3"});case"task":default:return(0,Or.jsx)(ut.AlertCircle,{className:"h-3 w-3"})}},p=()=>{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 l?(0,Or.jsx)(j,{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:n,children:(0,Or.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Or.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${p()}`,children:s()}),(0,Or.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.title})]})}):(0,Or.jsxs)(j,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:r,onClick:n,children:[(0,Or.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Or.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${p()}`,children:[s(),(0,Or.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Or.jsxs)("div",{className:"flex gap-1",children:[(0,Or.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${d()}`,children:e.priority}),(0,Or.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.points})]})]}),(0,Or.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.title}),(0,Or.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Or.jsx)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:(0,Or.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Or.jsx)(ut.User,{className:"h-4 w-4"}),(0,Or.jsx)("span",{children:e.assignee})]})})]})};var za=he(require("react")),_e=he(require("@radix-Lt/react-dialog"));var lt=_e.Root,ji=_e.Trigger,fl=_e.Portal;var Oi=za.forwardRef(({className:e,...t},a)=>(0,Or.jsx)(_e.Overlay,{ref:a,className:f("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}));Oi.displayName=_e.Overlay.displayName;var at=za.forwardRef(({className:e,children:t,...a},o)=>(0,Or.jsxs)(fl,{children:[(0,Or.jsx)(Oi,{}),(0,Or.jsxs)(_e.Content,{ref:o,className:f("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-Or-left-1/2 data-[state=closed]:slide-out-Or-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,Or.jsxs)(_e.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,Or.jsx)(ut.Or,{className:"h-4 w-4"}),(0,Or.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));at.displayName=_e.Content.displayName;var ot=({className:e,...t})=>(0,Or.jsx)("div",{className:f("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ot.displayName="DialogHeader";var Ha=({className:e,...t})=>(0,Or.jsx)("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ha.displayName="DialogFooter";var rt=za.forwardRef(({className:e,...t},a)=>(0,Or.jsx)(_e.Title,{ref:a,className:f("text-lg font-semibold leading-none tracking-tight",e),...t}));rt.displayName=_e.Title.displayName;var Va=za.forwardRef(({className:e,...t},a)=>(0,Or.jsx)(_e.Description,{ref:a,className:f("text-sm text-muted-foreground",e),...t}));Va.displayName=_e.Description.displayName;var ia=he(require("react")),xa=he(require("@radix-Lt/react-toggle-group"));var zi=he(require("react")),Qo=he(require("@radix-Lt/react-toggle"));var er=(0,Lr.cva)("inline-flex items-center justify-center gap-2 rounded-md 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"}}),vl=zi.forwardRef(({className:e,variant:t,size:a,...o},l)=>(0,Or.jsx)(Qo.Root,{ref:l,className:f(er({variant:t,size:a,className:e})),...o}));vl.displayName=Qo.Root.displayName;var Ui=ia.createContext({size:"default",variant:"default"}),sa=ia.forwardRef(({className:e,variant:t,size:a,children:o,...l},r)=>(0,Or.jsx)(xa.Root,{ref:r,className:f("flex items-center justify-center gap-1",e),...l,children:(0,Or.jsx)(Ui.Provider,{value:{variant:t,size:a},children:o})}));sa.displayName=xa.Root.displayName;var na=ia.forwardRef(({className:e,children:t,variant:a,size:o,...l},r)=>{let n=ia.useContext(Ui);return(0,Or.jsx)(xa.Item,{ref:r,className:f(er({variant:n.variant||a,size:n.size||o}),e),...l,children:t})});na.displayName=xa.Item.displayName;var bl=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:ut.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:ut.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:ut.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:ut.Zap}],hl=[{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"}],xo=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:l,defaultEpicId:r})=>{let[n,d]=(0,Lt.useState)({title:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""});(0,Lt.useEffect)(()=>{e&&r&&d(c=>({...c,epicId:r}))},[e,r]),(0,Lt.useEffect)(()=>{e&&d({title:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""})},[e]);let s=c=>{c.preventDefault(),n.title.trim()&&n.epicId&&(a({title:n.title.trim(),description:n.description.trim(),status:"todo",priority:n.priority,type:n.type,points:n.points,epicId:n.epicId,sprintId:n.sprintId==="none"?void 0:n.sprintId,assignee:n.assignee.trim()||"Unassigned"}),d({title:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""}),t())},p=(c,g)=>{d(u=>({...u,[c]:g}))};return(0,Or.jsx)(lt,{open:e,onOpenChange:t,children:(0,Or.jsxs)(at,{className:"sm:max-w-md",children:[(0,Or.jsx)(ot,{children:(0,Or.jsx)(rt,{children:"Add New Task"})}),(0,Or.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"title",children:"Task Title"}),(0,Or.jsx)(L,{id:"title",value:n.title,onChange:c=>p("title",c.target.value),placeholder:"Enter task title",required:!0})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"description",children:"Description"}),(0,Or.jsx)(De,{id:"description",value:n.description,onChange:c=>p("description",c.target.value),placeholder:"Enter task description",rows:3})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{children:"Type"}),(0,Or.jsx)(sa,{type:"single",value:n.type,onValueChange:c=>c&&p("type",c),children:bl.map(c=>{let g=c.icon;return(0,Or.jsxs)(na,{value:c.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,Or.jsx)(g,{className:"h-4 w-4"}),c.label]},c.value)})})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{children:"Priority"}),(0,Or.jsx)(sa,{type:"single",value:n.priority,onValueChange:c=>c&&p("priority",c),children:hl.map(c=>(0,Or.jsx)(na,{value:c.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:c.label},c.value))})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"points",children:"Story Points"}),(0,Or.jsx)(L,{id:"points",type:"number",min:"1",max:"100",value:n.points,onChange:c=>p("points",parseInt(c.target.value)||1),placeholder:"Enter story points",required:!0})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"epic",children:"Epic"}),(0,Or.jsxs)(Ce,{value:n.epicId,onValueChange:c=>p("epicId",c),children:[(0,Or.jsx)(we,{children:(0,Or.jsx)(Ie,{placeholder:"Select an epic"})}),(0,Or.jsx)(Ne,{children:o.map(c=>(0,Or.jsx)(H,{value:c.id,children:(0,Or.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Or.jsx)("div",{className:`w-3 h-3 rounded-full ${c.color}`}),c.name]})},c.id))})]})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Or.jsxs)(Ce,{value:n.sprintId,onValueChange:c=>p("sprintId",c),children:[(0,Or.jsx)(we,{children:(0,Or.jsx)(Ie,{placeholder:"Select a sprint"})}),(0,Or.jsxs)(Ne,{children:[(0,Or.jsx)(H,{value:"none",children:"No Sprint"}),l.map(c=>(0,Or.jsx)(H,{value:c.id,children:(0,Or.jsxs)("div",{className:"flex items-center gap-2",children:[c.name,c.isActive&&(0,Or.jsx)("span",{className:"text-xs bg-green-100 text-green-800 px-1 rounded",children:"Active"})]})},c.id))]})]})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"assignee",children:"Assignee"}),(0,Or.jsx)(L,{id:"assignee",value:n.assignee,onChange:c=>p("assignee",c.target.value),placeholder:"Enter assignee name",required:!0})]}),(0,Or.jsxs)(Ha,{children:[(0,Or.jsx)(b,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Or.jsx)(b,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var ar=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:l,className:r="",disabled:n=!1})=>{let[d,s]=(0,Lt.useState)(!1),[p,c]=(0,Lt.useState)(""),g=()=>{n||(s(!0),c(t))},u=async()=>{p!==t&&await l(e,p),s(!1)},h=S=>{S.key==="Enter"&&!o||S.key==="Enter"&&S.ctrlKey&&o?u():S.key==="Escape"&&(s(!1),c(""))};return(0,Or.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,Or.jsx)(P,{children:a}),d?o?(0,Or.jsx)(De,{value:p,onChange:S=>c(S.target.value),onBlur:u,onKeyDown:h,autoFocus:!0,rows:4,className:"resize-none"}):(0,Or.jsx)(L,{value:p,onChange:S=>c(S.target.value),onBlur:u,onKeyPress:h,autoFocus:!0,className:"text-lg font-medium"}):(0,Or.jsxs)("div",{onClick:g,className:`${n?"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,Or.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click Or edit..."}),!n&&(0,Or.jsx)($Or.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var Gi=({comments:e,onAddComment:t})=>{let[a,o]=(0,Lt.useState)(""),l=n=>n.split(" ").map(d=>d[0]).join("").toUpperCase(),r=()=>{a.trim()&&(t(a),o(""))};return(0,Or.jsxs)("div",{className:"space-y-4",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Or.jsx)(ut.MessageSquare,{className:"h-5 w-5"}),(0,Or.jsx)(P,{className:"text-lg font-medium",children:"Comments"}),(0,Or.jsx)(Z,{variant:"secondary",children:e.length})]}),(0,Or.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(n=>(0,Or.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Or.jsx)(At,{className:"h-8 w-8 mt-1",children:(0,Or.jsx)(Mt,{className:"text-xs bg-muted text-muted-foreground",children:l(n.author)})}),(0,Or.jsxs)("div",{className:"flex-1",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Or.jsx)("span",{className:"font-medium text-sm",children:n.author}),(0,Or.jsxs)("span",{className:"text-xs text-muted-foreground",children:[n.createdAt.toLocaleDateString()," at ",n.createdAt.toLocaleTimeString()]})]}),(0,Or.jsx)("p",{className:"text-sm text-muted-foreground",children:n.text})]})]},n.id))}),(0,Or.jsxs)("div",{className:"flex gap-2",children:[(0,Or.jsx)(De,{value:a,onChange:n=>o(n.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Or.jsx)(b,{onClick:r,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,Or.jsx)(ut.Send,{className:"h-4 w-4"})})]})]})};var wo=({label:e,value:t,onValueChange:a,options:o,showColor:l=!1,disabled:r=!1})=>{let[n,d]=(0,Lt.useState)(!1),s=o.find(c=>c.value===t);return(0,Or.jsxs)("div",{className:"space-y-1",children:[(0,Or.jsx)(P,{className:"text-xs text-muted-foreground",children:e}),(0,Or.jsxs)(Ce,{value:t,onValueChange:a,open:n,onOpenChange:c=>{r||d(c)},disabled:r,children:[(0,Or.jsx)(we,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Or.jsxs)(Z,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&d(!n),children:[l&&s?.color&&(0,Or.jsx)("div",{className:`w-2 h-2 rounded-full ${s.color} mr-1`}),s?.label||"Select..."]})}),(0,Or.jsx)(Ne,{children:o.map(c=>(0,Or.jsx)(H,{value:c.value,children:l&&c.color?(0,Or.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Or.jsx)("div",{className:`w-3 h-3 rounded-full ${c.color}`}),c.label]}):c.label},c.value))})]})]})};var Wi=({label:e,value:t,onValueChange:a,options:o,placeholder:l="Search...",allowCustomValue:r=!1,disabled:n=!1})=>{let[d,s]=(0,Lt.useState)(!1),[p,c]=(0,Lt.useState)(""),g=o.find(v=>v.value===t),u=o.filter(v=>v.label.toLowerCase().includes(p.toLowerCase())),h=v=>{a(v),s(!1),c("")},S=()=>{r&&p.trim()&&!o.find(v=>v.value===p.trim())&&(a(p.trim()),s(!1),c(""))};return(0,Or.jsxs)("div",{className:"space-y-1",children:[(0,Or.jsx)(P,{className:"text-xs text-muted-foreground",children:e}),(0,Or.jsxs)(Ce,{value:t,onValueChange:h,open:d,onOpenChange:v=>{n||s(v)},disabled:n,children:[(0,Or.jsx)(we,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Or.jsx)(Z,{variant:"secondary",className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!n&&s(!d),children:g?.label||t||"Select..."})}),(0,Or.jsxs)(Ne,{children:[(0,Or.jsx)("div",{className:"p-2",children:(0,Or.jsx)(L,{placeholder:l,value:p,onChange:v=>c(v.target.value),onKeyDown:v=>{v.key==="Enter"&&r&&S()},className:"mb-2"})}),u.map(v=>(0,Or.jsx)(H,{value:v.value,children:v.label},v.value)),r&&p.trim()&&!u.find(v=>v.value===p.trim())&&(0,Or.jsxs)(H,{value:p.trim(),children:['Add "',p.trim(),'"']})]})]})]})};var xl=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:ut.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:ut.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:ut.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:ut.Zap}],yl=[{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"}],wl=[{value:"John Doe",label:"John Doe"},{value:"Jane Smith",label:"Jane Smith"},{value:"Bob Wilson",label:"Bob Wilson"},{value:"Alice Johnson",label:"Alice Johnson"},{value:"Carol Brown",label:"Carol Brown"},{value:"David Lee",label:"David Lee"},{value:"Emma Davis",label:"Emma Davis"},{value:"Frank Miller",label:"Frank Miller"},{value:"Grace Taylor",label:"Grace Taylor"},{value:"Unassigned",label:"Unassigned"}],qi=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:l,onClose:r,onDelete:n,isUpdating:d=!1,isDeleting:s=!1,deleteState:p="idle"})=>{let c=u=>u.split(" ").map(h=>h[0]).join("").toUpperCase(),g=()=>p==="loading"?(0,Or.jsxs)(b,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Or.jsx)(ut.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):p==="success"?(0,Or.jsxs)(b,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Or.jsx)(ut.Check,{className:"h-3 w-3"}),"Deleted"]}):p==="error"?(0,Or.jsxs)(b,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Or.jsx)(ut.Or,{className:"h-3 w-3"}),"Delete failed"]}):(0,Or.jsxs)(b,{onClick:n,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:d||s,children:[(0,Or.jsx)(ut.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Or.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Or.jsxs)("div",{className:"space-y-4",style:{opacity:d?.6:1},children:[(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{className:"text-xs text-muted-foreground",children:"Status"}),(0,Or.jsx)(wo,{label:"",value:e.status,onValueChange:u=>l("status",u),options:[{value:"todo",label:"Or Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:d})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{className:"text-xs text-muted-foreground",children:"Type"}),(0,Or.jsx)(sa,{type:"single",value:e.type,onValueChange:u=>u&&l("type",u),className:"grid grid-cols-2 gap-1",disabled:d,children:xl.map(u=>{let h=u.icon;return(0,Or.jsxs)(na,{value:u.value,className:"flex items-center gap-1 text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:d,children:[(0,Or.jsx)(h,{className:"h-3 w-3"}),u.label]},u.value)})})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,Or.jsx)(sa,{type:"single",value:e.priority,onValueChange:u=>u&&l("priority",u),className:"grid grid-cols-3 gap-1",disabled:d,children:yl.map(u=>(0,Or.jsx)(na,{value:u.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:d,children:u.label},u.value))})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,Or.jsx)("input",{type:"number",min:"1",max:"100",value:e.points||1,onChange:u=>l("points",u.target.value),className:"w-full h-8 px-2 text-xs border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:d})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,Or.jsx)(wo,{label:"",value:e.epicId,onValueChange:u=>l("epicId",u),options:(t||[]).map(u=>({value:u.id,label:u.name,color:u.color})),showColor:!0,disabled:d})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,Or.jsx)(wo,{label:"",value:e.sprintId||"none",onValueChange:u=>l("sprintId",u==="none"?"":u),options:[{value:"none",label:"No Sprint"},...(a||[]).map(u=>({value:u.id,label:`${u.name}${u.isActive?" (Active)":""}`}))],disabled:d})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,Or.jsx)(Wi,{label:"",value:e.assignee,onValueChange:u=>l("assignee",u),options:wl,placeholder:"Search team members...",allowCustomValue:!0,disabled:d})]})]}),(0,Or.jsxs)("div",{className:"mt-auto ut-4 space-y-4",children:[(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(b,{onClick:r,variant:"outline",className:"w-full h-8 text-xs",disabled:d||s,children:"Close"}),g()]}),(0,Or.jsxs)("div",{className:"ut-4 border-t border-border space-y-2",children:[(0,Or.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,Or.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Or.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,Or.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Or.jsx)(ut.User,{className:"h-3 w-3"}),(0,Or.jsx)("span",{children:"System"})]})]}),(0,Or.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Or.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,Or.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Or.jsx)(ut.Calendar,{className:"h-3 w-3"}),(0,Or.jsx)("span",{children:e.createdAt.toLocaleDateString()})]})]}),(0,Or.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Or.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,Or.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Or.jsx)(ut.Clock,{className:"h-3 w-3"}),(0,Or.jsxs)("span",{children:[o.toLocaleDateString()," at ",o.toLocaleTimeString()]})]})]})]})]})]})};var No=({isOpen:e,onClose:t,task:a,epics:o,sprints:l,onUpdateTask:r,onDeleteTask:n})=>{let[d,s]=(0,$a.useState)(new Date),[p,c]=(0,$a.useState)("idle"),[g,u]=(0,$a.useState)("idle"),[h,S]=(0,$a.useState)([{id:"1",text:"Initial task created and assigned.",author:"System",createdAt:a.createdAt},{id:"2",text:"Started working on the implementation.",author:a.assignee,createdAt:new Date(a.createdAt.getTime()+864e5)}]),T=async(le,ue)=>{if(ue!==a[le]){c("loading");try{await r(a.id,{[le]:ue}),s(new Date),c("success"),setTimeout(()=>c("idle"),1500)}catch{c("error"),setTimeout(()=>c("idle"),3e3)}}},v=async(le,ue)=>{if(ue!==a[le]){c("loading");try{await r(a.id,{[le]:ue}),s(new Date),c("success"),setTimeout(()=>c("idle"),1500)}catch{c("error"),setTimeout(()=>c("idle"),3e3)}}},R=le=>{let ue={id:Date.now().toString(),text:le,author:"Current User",createdAt:new Date};S([...h,ue])},N=async()=>{u("loading");try{await n(a.id),u("success"),setTimeout(()=>{t(),u("idle")},1e3)}catch{u("error"),setTimeout(()=>u("idle"),3e3)}},V=p!=="loading"&&g!=="loading",_=()=>{V&&t()},q=()=>p==="loading"?(0,Or.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Or.jsx)(ut.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Or.jsx)("span",{children:"Updating..."})]}):p==="success"?(0,Or.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Or.jsx)(ut.Check,{className:"h-4 w-4"}),(0,Or.jsx)("span",{children:"Updated successfully"})]}):p==="error"?(0,Or.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Or.jsx)(ut.Or,{className:"h-4 w-4"}),(0,Or.jsx)("span",{children:"Update failed"})]}):null;return(0,Or.jsx)(lt,{open:e,onOpenChange:_,children:(0,Or.jsxs)(at,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Or.jsxs)(ot,{children:[(0,Or.jsx)(rt,{className:"sr-only",children:a.title}),(0,Or.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Or.jsx)("div",{className:"flex-1",children:q()}),!V&&(0,Or.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,Or.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Or.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Or.jsx)(ar,{fieldName:"title",value:a.title,label:"",onSave:T,className:"border-b border-border pb-3",disabled:p==="loading"}),(0,Or.jsx)(ar,{fieldName:"description",value:a.description,label:"Description",multiline:!0,onSave:T,disabled:p==="loading"}),(0,Or.jsx)(Gi,{comments:h,onAddComment:R})]}),(0,Or.jsx)(qi,{task:a,epics:o,sprints:l,lastUpdated:d,onUpdateTask:v,onClose:_,onDelete:N,isUpdating:p==="loading",isDeleting:g==="loading",deleteState:g})]})]})})};var Co=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,l]=(0,Lt.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"],n=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],d=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],s=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:new Date(o.startDate),endDate:new Date(o.endDate),progress:o.progress,isSelected:!0}),l({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}),t())},p=(c,g)=>{l(u=>({...u,[c]:g}))};return(0,Or.jsx)(lt,{open:e,onOpenChange:t,children:(0,Or.jsxs)(at,{className:"sm:max-w-md",children:[(0,Or.jsx)(ot,{children:(0,Or.jsx)(rt,{children:"Add New Epic"})}),(0,Or.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"name",children:"Epic Name"}),(0,Or.jsx)(L,{id:"name",value:o.name,onChange:c=>p("name",c.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"description",children:"Description"}),(0,Or.jsx)(De,{id:"description",value:o.description,onChange:c=>p("description",c.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{children:"Color"}),(0,Or.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(c=>(0,Or.jsx)("button",{type:"button",onClick:()=>p("color",c),className:`w-8 h-8 rounded-full ${c} ${o.color===c?"ring-2 ring-gray-400":""}`},c))})]}),(0,Or.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{children:"Confidence"}),(0,Or.jsxs)(Ce,{value:o.confidence,onValueChange:c=>p("confidence",c),children:[(0,Or.jsx)(we,{children:(0,Or.jsx)(Ie,{})}),(0,Or.jsx)(Ne,{children:n.map(c=>(0,Or.jsx)(H,{value:c.value,children:c.label},c.value))})]})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{children:"Phase"}),(0,Or.jsxs)(Ce,{value:o.phase.toString(),onValueChange:c=>p("phase",parseInt(c)),children:[(0,Or.jsx)(we,{children:(0,Or.jsx)(Ie,{})}),(0,Or.jsx)(Ne,{children:d.map(c=>(0,Or.jsx)(H,{value:c.value.toString(),children:c.label},c.value))})]})]})]}),(0,Or.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{children:"Start Date"}),(0,Or.jsx)(L,{type:"date",value:o.startDate,onChange:c=>p("startDate",c.target.value)})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{children:"End Date"}),(0,Or.jsx)(L,{type:"date",value:o.endDate,onChange:c=>p("endDate",c.target.value)})]})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{children:"Progress (%)"}),(0,Or.jsx)(L,{type:"number",min:"0",max:"100",value:o.progress,onChange:c=>p("progress",parseInt(c.target.value)||0)})]}),(0,Or.jsxs)(Ha,{children:[(0,Or.jsx)(b,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Or.jsx)(b,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Xi=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialProjects:o=[],onAddTask:l,onUpdateTask:r,onDeleteTask:n,onTaskClick:d,onAddEpic:s})=>{let[p,c]=(0,Lt.useState)(e),[g,u]=(0,Lt.useState)(t),[h,S]=(0,Lt.useState)(a),[T,v]=(0,Lt.useState)(!1),[R,N]=(0,Lt.useState)(!1),[V,_]=(0,Lt.useState)(null),[q,le]=(0,Lt.useState)(null),ue=g.filter(F=>F.isSelected).map(F=>F.id),x=h.find(F=>F.isSelected),D=p.filter(F=>{let Q=ue.includes(F.epicId);return!x||x.id==="all-tasks"?Q:x.id==="backlog"?Q&&!F.sprintId:Q&&F.sprintId===x.id}),z=F=>D.filter(Q=>Q.status===F),be=F=>{let Q={};return g.forEach(xe=>{Q[xe.id]=F.filter(tt=>tt.epicId===xe.id)}),Q},A=F=>{le(F)},C=F=>{q&&(c(Q=>Q.map(xe=>xe.id===q.id?{...xe,status:F}:xe)),r?.(q.id,{status:F}),le(null))},Y=F=>{let Q={...F,id:Date.now().toString(),createdAt:new Date};c(xe=>[...xe,Q]),l?.(F)},Te=async(F,Q)=>{c(xe=>xe.map(tt=>tt.id===F?{...tt,...Q}:tt)),r&&await r(F,Q)},ct=async F=>{c(Q=>Q.filter(xe=>xe.id!==F)),V?.id===F&&_(null),n&&await n(F)},mt=F=>{let Q={...F,id:Date.now().toString(),isSelected:!0};u(xe=>[...xe,Q]),s?.(F)},ze=F=>{_(F),d?.(F)};return(0,Or.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Or.jsx)(Ze,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-Or-r from-purple-600 via-violet-600 Or-indigo-600",primaryAction:{label:"Add task",onClick:()=>v(!0)},secondaryAction:{label:"Add epic",onClick:()=>N(!0)}}),(0,Or.jsx)("div",{className:"flex-1",children:(0,Or.jsxs)("div",{className:"w-full",children:[(0,Or.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[{id:"todo",title:"Or Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}].map(F=>{let Q=z(F.status),xe=be(Q);return(0,Or.jsx)(Bi,{title:F.title,status:F.status,taskCount:Q.length,onDrop:C,isCompact:F.status==="done",children:ue.map(tt=>{let vt=g.find(He=>He.id===tt),k=xe[tt]||[];return k.length===0?null:(0,Or.jsxs)("div",{className:"mb-6",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Or.jsx)("div",{className:`w-3 h-3 rounded-full ${vt?.color}`}),(0,Or.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:vt?.name}),(0,Or.jsx)(Z,{variant:"secondary",className:"text-xs",children:k.length})]})," ",(0,Or.jsx)("div",{className:"space-y-3",children:k.map(He=>(0,Or.jsx)(bo,{task:He,epic:vt,onDragStart:A,onTaskClick:ze,isCompact:F.status==="done"},He.id))})]},tt)})},F.id)})}),(0,Or.jsxs)(Or.Fragment,{children:[(0,Or.jsx)(xo,{isOpen:T,onClose:()=>v(!1),onAddTask:Y,epics:g,sprints:h}),(0,Or.jsx)(Co,{isOpen:R,onClose:()=>N(!1),onAddEpic:mt}),V&&(0,Or.jsx)(No,{isOpen:!!V,onClose:()=>_(null),task:V,epics:g,sprints:h,onUpdateTask:Te,onDeleteTask:ct})]})]})})]})};var Yi=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:l,onAddTaskToEpic:r,onAddEpic:n,onUpdateEpic:d,onDeleteEpic:s})=>{let[p,c]=(0,Lt.useState)(null),[g,u]=(0,Lt.useState)(null),[h,S]=(0,Lt.useState)({}),T=D=>{c(D)},v=D=>{D.preventDefault()},R=(D,z)=>{D.preventDefault(),p&&p.epicId!==z&&(o(p.id,{epicId:z}),c(null))},N=D=>e.filter(z=>z.epicId===D),V=D=>{u(D.id),S({name:D.name,description:D.description,confidence:D.confidence,phase:D.phase,progress:D.progress})},_=()=>{g&&h.name&&(d(g,h),u(null),S({}))},q=()=>{u(null),S({})},le=D=>{window.confirm("Are you sure you want Or delete this epic? This will also delete all associated tasks.")&&s(D)},ue=D=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[D]||`Phase ${D}`,x=D=>{switch(D){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,Or.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Or.jsx)(Ze,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-Or-r from-rose-600 via-pink-600 Or-fuchsia-600",primaryAction:{label:"Add epic",onClick:n}}),(0,Or.jsx)("div",{className:"flex-1",children:(0,Or.jsx)("div",{className:"w-full",children:(0,Or.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:t.map(D=>{let z=N(D.id),be=z.reduce((A,C)=>A+C.points,0);return(0,Or.jsxs)(j,{className:`flex flex-col ${g===D.id?"h-auto":"h-[600px]"} bg-card shadow-sm`,onDragOver:v,onDrop:A=>R(A,D.id),children:[(0,Or.jsx)("div",{className:"p-4 border-b border-border",children:g===D.id?(0,Or.jsxs)("div",{className:"space-y-4",children:[(0,Or.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Or.jsx)(L,{value:h.name||"",onChange:A=>S({...h,name:A.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Or.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Or.jsx)(b,{size:"sm",variant:"ghost",onClick:_,className:"p-1 h-8 w-8",children:(0,Or.jsx)(ut.Check,{className:"h-4 w-4"})}),(0,Or.jsx)(b,{size:"sm",variant:"ghost",onClick:q,className:"p-1 h-8 w-8",children:(0,Or.jsx)(ut.Or,{className:"h-4 w-4"})})]})]}),(0,Or.jsx)(De,{value:h.description||"",onChange:A=>S({...h,description:A.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Or.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Or.jsxs)("div",{children:[(0,Or.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,Or.jsxs)(Ce,{value:h.confidence||D.confidence,onValueChange:A=>S({...h,confidence:A}),children:[(0,Or.jsx)(we,{className:"text-xs",children:(0,Or.jsx)(Ie,{})}),(0,Or.jsxs)(Ne,{children:[(0,Or.jsx)(H,{value:"low",children:"Low"}),(0,Or.jsx)(H,{value:"medium",children:"Medium"}),(0,Or.jsx)(H,{value:"high",children:"High"})]})]})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,Or.jsxs)(Ce,{value:h.phase?.toString()||D.phase.toString(),onValueChange:A=>S({...h,phase:parseInt(A)}),children:[(0,Or.jsx)(we,{className:"text-xs",children:(0,Or.jsx)(Ie,{})}),(0,Or.jsx)(Ne,{children:[1,2,3,4,5,6,7,8,9].map(A=>(0,Or.jsxs)(H,{value:A.toString(),children:["Phase ",A]},A))})]})]})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)("label",{className:"text-xs text-muted-foreground",children:"Progress (%)"}),(0,Or.jsx)(L,{type:"number",min:"0",max:"100",value:h.progress||D.progress,onChange:A=>S({...h,progress:parseInt(A.target.value)||0}),className:"text-xs"})]})]}):(0,Or.jsxs)(Or.Fragment,{children:[(0,Or.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Or.jsx)("div",{className:`w-4 h-4 rounded-full ${D.color}`}),(0,Or.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:D.name}),(0,Or.jsxs)("div",{className:"flex gap-1",children:[(0,Or.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>V(D),className:"p-1 h-8 w-8",children:(0,Or.jsx)(ut.Edit2,{className:"h-3 w-3"})}),(0,Or.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>le(D.id),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Or.jsx)(ut.Trash2,{className:"h-3 w-3"})})]})]}),(0,Or.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Or.jsxs)(Z,{className:`text-xs ${x(D.confidence)}`,children:[D.confidence," confidence"]}),(0,Or.jsxs)(Z,{variant:"outline",className:"text-xs",children:["Phase ",D.phase]}),(0,Or.jsxs)(Z,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[z.length," tasks"]}),(0,Or.jsxs)(Z,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[be," pts"]})]}),D.description&&(0,Or.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:D.description}),(0,Or.jsxs)("div",{className:"mb-3",children:[(0,Or.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground mb-1",children:[(0,Or.jsx)("span",{className:"select-none",children:"Progress"}),(0,Or.jsxs)("span",{className:"select-none",children:[D.progress,"%"]})]}),(0,Or.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,Or.jsx)("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:`${D.progress}%`}})})]}),(0,Or.jsxs)(b,{onClick:()=>r(D.id),variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Or.jsx)(ut.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Or.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Or.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${p?"border-primary bg-primary/10":"border-border"}`,children:z.length===0?(0,Or.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,Or.jsx)(ut.Move,{className:"h-8 w-8 mb-2"}),(0,Or.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):z.map(A=>(0,Or.jsx)(bo,{task:A,epic:D,onDragStart:T,onTaskClick:l,isCompact:!0},A.id))})})]},D.id)})})})})]})};var Zi=require("react-day-picker");function Do({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,Or.jsx)(Zi.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:f("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center ut-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:f(eo({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-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:f("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-md",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:f(eo({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})}Do.displayName="Calendar";var es=he(require("react")),Tt=he(require("@radix-Lt/react-popover"));var ir=Tt.Root,sr=Tt.Trigger;var ko=es.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},l)=>(0,Or.jsx)(Tt.Portal,{children:(0,Or.jsx)(Tt.Content,{ref:l,align:t,sideOffset:a,className:f("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md 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})}));ko.displayName=Tt.Content.displayName;var lr=require("date-fns");var as=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,l]=(0,Lt.useState)({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),r=d=>{d.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate,endDate:o.endDate,isActive:o.isActive,isSelected:!1}),l({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),t())},n=()=>{l({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),t()};return(0,Or.jsx)(lt,{open:e,onOpenChange:n,children:(0,Or.jsxs)(at,{className:"sm:max-w-md",children:[(0,Or.jsx)(ot,{children:(0,Or.jsx)(rt,{children:"Add New Sprint"})}),(0,Or.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"name",children:"Sprint Name *"}),(0,Or.jsx)(L,{id:"name",value:o.name,onChange:d=>l(s=>({...s,name:d.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"description",children:"Description"}),(0,Or.jsx)(De,{id:"description",value:o.description,onChange:d=>l(s=>({...s,description:d.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Or.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{children:"Start Date *"}),(0,Or.jsxs)(ir,{children:[(0,Or.jsx)(sr,{asChild:!0,children:(0,Or.jsxs)(b,{variant:"outline",className:f("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,Or.jsx)(ut.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,lr.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,Or.jsx)(ko,{className:"w-auto p-0",align:"start",children:(0,Or.jsx)(Do,{mode:"single",selected:o.startDate,onSelect:d=>l(s=>({...s,startDate:d})),initialFocus:!0})})]})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{children:"End Date *"}),(0,Or.jsxs)(ir,{children:[(0,Or.jsx)(sr,{asChild:!0,children:(0,Or.jsxs)(b,{variant:"outline",className:f("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,Or.jsx)(ut.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,lr.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,Or.jsx)(ko,{className:"w-auto p-0",align:"start",children:(0,Or.jsx)(Do,{mode:"single",selected:o.endDate,onSelect:d=>l(s=>({...s,endDate:d})),initialFocus:!0,disabled:d=>o.startDate?d<o.startDate:!1})})]})]})]}),(0,Or.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Or.jsx)("input",{type:"checkbox",id:"isActive",checked:o.isActive,onChange:d=>l(s=>({...s,isActive:d.target.checked})),className:"rounded border-gray-300"}),(0,Or.jsx)(P,{htmlFor:"isActive",children:"Set as active sprint"})]}),(0,Or.jsxs)("div",{className:"flex justify-end gap-3 ut-4",children:[(0,Or.jsx)(b,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),(0,Or.jsx)(b,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var os=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:l,onAddSprint:r})=>{let[n,d]=(0,Lt.useState)(["2"]),[s,p]=(0,Lt.useState)(null),[c,g]=(0,Lt.useState)(!1),[u,h]=(0,Lt.useState)(null),S=e.filter(C=>!C.sprintId),T=e.filter(C=>C.sprintId&&n.includes(C.sprintId)),v=[...a].filter(C=>C.id!=="backlog"&&C.id!=="all-tasks").sort((C,Y)=>C.startDate.getTime()-Y.startDate.getTime()),R=C=>t.find(Y=>Y.id===C),N=C=>a.find(Y=>Y.id===C),V=C=>{switch(C){case"high":return"bg-destructive/20 text-destructive";case"medium":return"bg-warning/20 text-warning";case"low":return"bg-success/20 text-success";default:return"bg-muted text-muted-foreground"}},_=C=>C.split(" ").map(Y=>Y[0]).join("").toUpperCase(),q=C=>{p(C)},le=C=>{C.preventDefault()},ue=C=>{h(C)},x=()=>{h(null)},D=(C,Y)=>{C.preventDefault(),h(null),s&&(o(s.id,{sprintId:Y==="backlog"?void 0:Y}),p(null))},z=C=>{C==="backlog"||C==="all-tasks"||d(Y=>Y.includes(C)?Y.filter(Te=>Te!==C):[...Y,C])},be=C=>{r(C),g(!1)},A=({task:C,showSprint:Y=!1})=>{let Te=R(C.epicId),ct=C.sprintId?N(C.sprintId):null,[mt,ze]=(0,Lt.useState)(!1),Ue=xe=>{xe.defaultPrevented||mt||l(C)},F=xe=>{ze(!0),q(C)},Q=()=>{ze(!1)};return(0,Or.jsx)(j,{className:`p-3 cursor-grab transition-all duration-200 hover:shadow-md bg-card border-border hover:border-border/80 active:cursor-grabbing ${mt?"opacity-50 shadow-lg scale-105":""} ${s?.id===C.id?"ring-2 ring-primary":""}`,draggable:!0,onDragStart:F,onDragEnd:Q,onClick:Ue,children:(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Or.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1 select-none pointer-events-none",children:C.title}),(0,Or.jsx)(Z,{className:`text-xs select-none pointer-events-none ${V(C.priority)}`,children:C.priority[0].toUpperCase()})]}),(0,Or.jsxs)("div",{className:"flex items-center justify-between text-xs pointer-events-none",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-1",children:[Te&&(0,Or.jsx)("div",{className:`w-2 h-2 rounded-full ${Te.color}`}),(0,Or.jsx)("span",{className:"text-muted-foreground truncate select-none",children:Te?.name})]}),(0,Or.jsx)("span",{className:"text-muted-foreground select-none",children:_(C.assignee)})]}),Y&&ct&&(0,Or.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground pointer-events-none",children:[(0,Or.jsx)(ut.Calendar,{className:"h-3 w-3"}),(0,Or.jsx)("span",{className:"select-none",children:ct.name})]})]})})};return(0,Or.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Or.jsx)(Ze,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-Or-r from-orange-600 via-amber-600 Or-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>g(!0)}}),(0,Or.jsx)("div",{className:"flex-1",children:(0,Or.jsxs)("div",{className:"w-full",children:[(0,Or.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:[(0,Or.jsx)("div",{className:"lg:col-span-1",children:(0,Or.jsxs)(j,{className:"p-4 h-full bg-card shadow-sm",onDragOver:le,onDragEnter:()=>ue("backlog"),onDragLeave:x,onDrop:C=>D(C,"backlog"),children:[(0,Or.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,Or.jsx)("h3",{className:"font-semibold text-foreground select-none",children:"Backlog"}),(0,Or.jsx)(Z,{variant:"secondary",className:"bg-muted text-muted-foreground",children:S.length})]}),(0,Or.jsxs)("div",{className:`space-y-3 overflow-y-auto max-h-[600px] min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${u==="backlog"?"border-primary bg-primary/10":"border-border"}`,children:[S.map(C=>(0,Or.jsx)(A,{task:C},C.id)),S.length===0&&(0,Or.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here Or move Or backlog"})]})]})}),(0,Or.jsx)("div",{className:"lg:col-span-3",children:(0,Or.jsxs)("div",{className:"space-y-4",children:[(0,Or.jsxs)(j,{className:"p-4 bg-card shadow-sm",children:[(0,Or.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Or.jsx)("h3",{className:"font-semibold text-foreground select-none",children:"Select Sprints Or View"}),(0,Or.jsxs)(b,{onClick:()=>g(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-2",size:"sm",children:[(0,Or.jsx)(ut.Plus,{className:"h-4 w-4"}),"Add Sprint"]})]}),(0,Or.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2",children:v.map(C=>(0,Or.jsxs)(b,{variant:n.includes(C.id)?"default":"outline",size:"sm",onClick:()=>z(C.id),className:"text-xs h-8",children:[C.name,C.isActive&&(0,Or.jsx)("span",{className:"ml-1 text-success",children:"\u25CF"})]},C.id))})]}),(0,Or.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:n.map(C=>v.find(Y=>Y.id===C)).filter(Boolean).sort((C,Y)=>C.startDate.getTime()-Y.startDate.getTime()).map(C=>{let Y=T.filter(Te=>Te.sprintId===C.id);return(0,Or.jsxs)(j,{className:"p-4 bg-card shadow-sm",onDragOver:le,onDragEnter:()=>ue(C.id),onDragLeave:x,onDrop:Te=>D(Te,C.id),children:[(0,Or.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,Or.jsxs)("div",{children:[(0,Or.jsx)("h3",{className:"font-semibold text-foreground select-none",children:C.name}),C.isActive&&(0,Or.jsx)("span",{className:"text-xs text-success font-medium select-none",children:"Active Sprint"})]}),(0,Or.jsx)(Z,{variant:"secondary",className:"bg-muted text-muted-foreground",children:Y.length})]}),(0,Or.jsxs)("div",{className:`space-y-3 overflow-y-auto max-h-[500px] min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${u===C.id?"border-primary bg-primary/10":"border-border"}`,children:[Y.map(Te=>(0,Or.jsx)(A,{task:Te},Te.id)),Y.length===0&&(0,Or.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})]},C.id)})})," "]})})]}),(0,Or.jsx)(as,{isOpen:c,onClose:()=>g(!1),onAddSprint:be})]})})]})};var Nl=e=>{switch(e){case"high":return"\u{1F534}";case"medium":return"\u{1F7E1}";case"low":return"\u{1F7E2}";default:return"\u26AA"}},Cl=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),Sl=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})},dr=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[l,r]=t.split(":");o.setHours(parseInt(l),parseInt(r))}return o<a},cr=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Dl=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},kl=({colleagues:e,onAddReminder:t,trigger:a})=>{let[o,l]=(0,Lt.useState)(!1),[r,n]=(0,Lt.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""});return(0,Or.jsxs)(lt,{open:o,onOpenChange:l,children:[(0,Or.jsx)(ji,{asChild:!0,children:a}),(0,Or.jsxs)(at,{className:"max-w-2xl",children:[(0,Or.jsx)(ot,{children:(0,Or.jsx)(rt,{children:"Add New Reminder"})}),(0,Or.jsxs)("form",{onSubmit:s=>{s.preventDefault();let p=e.find(g=>g.id===r.colleagueId);if(!p)return;let c={title:r.title,description:r.description,dueDate:new Date(r.dueDate),dueTime:r.dueTime||void 0,colleague:p,isCompleted:!1,isRecurring:r.isRecurring,recurrencePattern:r.isRecurring?r.recurrencePattern:void 0,recurrenceInterval:r.isRecurring?r.recurrenceInterval:void 0,priority:r.priority,reminderEnabled:r.reminderEnabled,reminderMinutes:r.reminderEnabled?r.reminderMinutes:void 0,tags:r.tags?r.tags.split(",").map(g=>g.trim()):void 0};t(c),l(!1),n({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})},className:"space-y-4",children:[(0,Or.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"title",children:"Title"}),(0,Or.jsx)(L,{id:"title",value:r.title,onChange:s=>n({...r,title:s.target.value}),placeholder:"Enter reminder title",required:!0})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"priority",children:"Priority"}),(0,Or.jsxs)(Ce,{value:r.priority,onValueChange:s=>n({...r,priority:s}),children:[(0,Or.jsx)(we,{children:(0,Or.jsx)(Ie,{})}),(0,Or.jsxs)(Ne,{children:[(0,Or.jsx)(H,{value:"low",children:"\u{1F7E2} Low"}),(0,Or.jsx)(H,{value:"medium",children:"\u{1F7E1} Medium"}),(0,Or.jsx)(H,{value:"high",children:"\u{1F534} High"})]})]})]})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"description",children:"Description"}),(0,Or.jsx)(De,{id:"description",value:r.description,onChange:s=>n({...r,description:s.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Or.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"dueDate",children:"Due Date"}),(0,Or.jsx)(L,{id:"dueDate",type:"date",value:r.dueDate,onChange:s=>n({...r,dueDate:s.target.value}),required:!0})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Or.jsx)(L,{id:"dueTime",type:"time",value:r.dueTime,onChange:s=>n({...r,dueTime:s.target.value})})]})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"colleague",children:"Assigned Colleague"}),(0,Or.jsxs)(Ce,{value:r.colleagueId,onValueChange:s=>n({...r,colleagueId:s}),children:[(0,Or.jsx)(we,{children:(0,Or.jsx)(Ie,{placeholder:"Select a digital colleague"})}),(0,Or.jsx)(Ne,{children:e.map(s=>(0,Or.jsx)(H,{value:s.id,children:s.name},s.id))})]})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Or.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:s=>n({...r,isRecurring:s.target.checked}),className:"rounded border-border"}),(0,Or.jsx)(P,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Or.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Or.jsxs)(Ce,{value:r.recurrencePattern,onValueChange:s=>n({...r,recurrencePattern:s}),children:[(0,Or.jsx)(we,{children:(0,Or.jsx)(Ie,{})}),(0,Or.jsxs)(Ne,{children:[(0,Or.jsx)(H,{value:"daily",children:"Daily"}),(0,Or.jsx)(H,{value:"weekly",children:"Weekly"}),(0,Or.jsx)(H,{value:"monthly",children:"Monthly"}),(0,Or.jsx)(H,{value:"yearly",children:"Yearly"})]})]})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Or.jsx)(L,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:s=>n({...r,recurrenceInterval:parseInt(s.target.value)})})]})]})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Or.jsx)("input",{type:"checkbox",id:"reminderEnabled",checked:r.reminderEnabled,onChange:s=>n({...r,reminderEnabled:s.target.checked}),className:"rounded border-border"}),(0,Or.jsx)(P,{htmlFor:"reminderEnabled",children:"Enable reminder notifications"})]}),r.reminderEnabled&&(0,Or.jsxs)("div",{className:"pl-6",children:[(0,Or.jsx)(P,{htmlFor:"reminderMinutes",children:"Remind me"}),(0,Or.jsxs)(Ce,{value:r.reminderMinutes.toString(),onValueChange:s=>n({...r,reminderMinutes:parseInt(s)}),children:[(0,Or.jsx)(we,{children:(0,Or.jsx)(Ie,{})}),(0,Or.jsxs)(Ne,{children:[(0,Or.jsx)(H,{value:"5",children:"5 minutes before"}),(0,Or.jsx)(H,{value:"15",children:"15 minutes before"}),(0,Or.jsx)(H,{value:"30",children:"30 minutes before"}),(0,Or.jsx)(H,{value:"60",children:"1 hour before"}),(0,Or.jsx)(H,{value:"1440",children:"1 day before"})]})]})]})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"tags",children:"Tags (comma-separated)"}),(0,Or.jsx)(L,{id:"tags",value:r.tags,onChange:s=>n({...r,tags:s.target.value}),placeholder:"e.g., urgent, meeting, follow-up"})]}),(0,Or.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Or.jsx)(b,{type:"button",variant:"outline",onClick:()=>l(!1),children:"Cancel"}),(0,Or.jsx)(b,{type:"submit",children:"Add Reminder"})]})]})]})]})},Pl=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:l})=>{let[r,n]=(0,Lt.useState)({title:e.title,description:e.description,dueDate:e.dueDate.toISOString().split("T")[0],dueTime:e.dueTime||"",colleagueId:e.colleague.id,priority:e.priority,isRecurring:e.isRecurring,recurrencePattern:e.recurrencePattern||"weekly",recurrenceInterval:e.recurrenceInterval||1,reminderEnabled:e.reminderEnabled,reminderMinutes:e.reminderMinutes||15,tags:e.tags?.join(", ")||""});return(0,Or.jsx)(lt,{open:o,onOpenChange:l,children:(0,Or.jsxs)(at,{className:"max-w-2xl",children:[(0,Or.jsx)(ot,{children:(0,Or.jsx)(rt,{children:"Edit Reminder"})}),(0,Or.jsxs)("form",{onSubmit:s=>{s.preventDefault();let p=t.find(g=>g.id===r.colleagueId);if(!p)return;let c={title:r.title,description:r.description,dueDate:new Date(r.dueDate),dueTime:r.dueTime||void 0,colleague:p,isRecurring:r.isRecurring,recurrencePattern:r.isRecurring?r.recurrencePattern:void 0,recurrenceInterval:r.isRecurring?r.recurrenceInterval:void 0,priority:r.priority,reminderEnabled:r.reminderEnabled,reminderMinutes:r.reminderEnabled?r.reminderMinutes:void 0,tags:r.tags?r.tags.split(",").map(g=>g.trim()):void 0};a(e.id,c),l()},className:"space-y-4",children:[(0,Or.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"edit-title",children:"Title"}),(0,Or.jsx)(L,{id:"edit-title",value:r.title,onChange:s=>n({...r,title:s.target.value}),placeholder:"Enter reminder title",required:!0})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"edit-priority",children:"Priority"}),(0,Or.jsxs)(Ce,{value:r.priority,onValueChange:s=>n({...r,priority:s}),children:[(0,Or.jsx)(we,{children:(0,Or.jsx)(Ie,{})}),(0,Or.jsxs)(Ne,{children:[(0,Or.jsx)(H,{value:"low",children:"\u{1F7E2} Low"}),(0,Or.jsx)(H,{value:"medium",children:"\u{1F7E1} Medium"}),(0,Or.jsx)(H,{value:"high",children:"\u{1F534} High"})]})]})]})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"edit-description",children:"Description"}),(0,Or.jsx)(De,{id:"edit-description",value:r.description,onChange:s=>n({...r,description:s.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Or.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Or.jsx)(L,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:s=>n({...r,dueDate:s.target.value}),required:!0})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Or.jsx)(L,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:s=>n({...r,dueTime:s.target.value})})]})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"edit-colleague",children:"Assigned Colleague"}),(0,Or.jsxs)(Ce,{value:r.colleagueId,onValueChange:s=>n({...r,colleagueId:s}),children:[(0,Or.jsx)(we,{children:(0,Or.jsx)(Ie,{placeholder:"Select a digital colleague"})}),(0,Or.jsx)(Ne,{children:t.map(s=>(0,Or.jsx)(H,{value:s.id,children:s.name},s.id))})]})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Or.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring,onChange:s=>n({...r,isRecurring:s.target.checked}),className:"rounded border-border"}),(0,Or.jsx)(P,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Or.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"edit-recurrencePattern",children:"Frequency"}),(0,Or.jsxs)(Ce,{value:r.recurrencePattern,onValueChange:s=>n({...r,recurrencePattern:s}),children:[(0,Or.jsx)(we,{children:(0,Or.jsx)(Ie,{})}),(0,Or.jsxs)(Ne,{children:[(0,Or.jsx)(H,{value:"daily",children:"Daily"}),(0,Or.jsx)(H,{value:"weekly",children:"Weekly"}),(0,Or.jsx)(H,{value:"monthly",children:"Monthly"}),(0,Or.jsx)(H,{value:"yearly",children:"Yearly"})]})]})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"edit-recurrenceInterval",children:"Every"}),(0,Or.jsx)(L,{id:"edit-recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:s=>n({...r,recurrenceInterval:parseInt(s.target.value)})})]})]})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Or.jsx)("input",{type:"checkbox",id:"edit-reminderEnabled",checked:r.reminderEnabled,onChange:s=>n({...r,reminderEnabled:s.target.checked}),className:"rounded border-border"}),(0,Or.jsx)(P,{htmlFor:"edit-reminderEnabled",children:"Enable reminder notifications"})]}),r.reminderEnabled&&(0,Or.jsxs)("div",{className:"pl-6",children:[(0,Or.jsx)(P,{htmlFor:"edit-reminderMinutes",children:"Remind me"}),(0,Or.jsxs)(Ce,{value:r.reminderMinutes.toString(),onValueChange:s=>n({...r,reminderMinutes:parseInt(s)}),children:[(0,Or.jsx)(we,{children:(0,Or.jsx)(Ie,{})}),(0,Or.jsxs)(Ne,{children:[(0,Or.jsx)(H,{value:"5",children:"5 minutes before"}),(0,Or.jsx)(H,{value:"15",children:"15 minutes before"}),(0,Or.jsx)(H,{value:"30",children:"30 minutes before"}),(0,Or.jsx)(H,{value:"60",children:"1 hour before"}),(0,Or.jsx)(H,{value:"1440",children:"1 day before"})]})]})]})]}),(0,Or.jsxs)("div",{children:[(0,Or.jsx)(P,{htmlFor:"edit-tags",children:"Tags (comma-separated)"}),(0,Or.jsx)(L,{id:"edit-tags",value:r.tags,onChange:s=>n({...r,tags:s.target.value}),placeholder:"e.g., urgent, meeting, follow-up"})]}),(0,Or.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Or.jsx)(b,{type:"button",variant:"outline",onClick:l,children:"Cancel"}),(0,Or.jsx)(b,{type:"submit",children:"Save Changes"})]})]})]})})},Tl=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[l,r]=(0,Lt.useState)(!1),n=dr(e.dueDate,e.dueTime),d=cr(e.dueDate),s=Dl(e.dueDate),p=()=>{a(e.id,{isCompleted:!e.isCompleted,completedAt:e.isCompleted?void 0:new Date})},c=()=>d?"Today":s?"Tomorrow":n&&!e.isCompleted?"Overdue":Cl(e.dueDate);return(0,Or.jsxs)(Or.Fragment,{children:[(0,Or.jsx)(Pl,{reminder:e,colleagues:t,onUpdateReminder:a,open:l,onClose:()=>r(!1)}),(0,Or.jsx)(j,{className:`transition-all duration-200 ${e.isCompleted?"opacity-60":""} ${n&&!e.isCompleted?"border-destructive/50 bg-destructive/5":""}`,children:(0,Or.jsx)(ie,{className:"p-4",children:(0,Or.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Or.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Or.jsx)("button",{onClick:p,className:"mt-1 text-primary hover:text-primary/80",children:e.isCompleted?(0,Or.jsx)(ut.CheckCircle,{className:"h-5 w-5"}):(0,Or.jsx)(ut.Circle,{className:"h-5 w-5"})}),(0,Or.jsxs)("div",{className:"flex-1",children:[(0,Or.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,Or.jsx)("h3",{className:`font-semibold ${e.isCompleted?"line-through text-muted-foreground":""}`,children:e.title}),(0,Or.jsx)("span",{className:"text-sm",children:Nl(e.priority)}),e.isRecurring&&(0,Or.jsx)(ut.Repeat,{className:"h-4 w-4 text-primary"}),e.reminderEnabled&&(0,Or.jsx)(ut.Bell,{className:"h-4 w-4 text-success"})]}),(0,Or.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Or.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Or.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Or.jsx)(ut.Calendar,{className:"h-4 w-4"}),(0,Or.jsx)("span",{className:n&&!e.isCompleted?"text-destructive font-medium":"",children:c()})]}),e.dueTime&&(0,Or.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Or.jsx)(ut.Clock,{className:"h-4 w-4"}),(0,Or.jsx)("span",{children:Sl(e.dueTime)})]}),(0,Or.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Or.jsx)(ut.User,{className:"h-4 w-4"}),(0,Or.jsx)("span",{children:e.colleague.name})]})]}),e.tags&&e.tags.length>0&&(0,Or.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:e.tags.map((g,u)=>(0,Or.jsx)(Z,{variant:"secondary",className:"text-xs",children:g},u))})]})]}),(0,Or.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Or.jsx)(b,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 p-0",children:(0,Or.jsx)(ut.Edit2,{className:"h-4 w-4"})}),(0,Or.jsx)(b,{variant:"ghost",size:"sm",onClick:()=>o(e.id),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Or.jsx)(ut.Trash2,{className:"h-4 w-4"})})]})]})})})]})},rs=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:l})=>{let[r,n]=(0,Lt.useState)(e),[d]=(0,Lt.useState)(t),[s,p]=(0,Lt.useState)("all"),[c,g]=(0,Lt.useState)(""),u=N=>{let V={...N,id:Date.now().toString(),createdAt:new Date};n(_=>[..._,V]),a?.(N)},h=(N,V)=>{n(_=>_.map(q=>q.id===N?{...q,...V}:q)),o?.(N,V)},S=N=>{n(V=>V.filter(_=>_.id!==N)),l?.(N)},v=r.filter(N=>{if(c){let V=c.toLowerCase();if(!(N.title.toLowerCase().includes(V)||N.description.toLowerCase().includes(V)||N.colleague.name.toLowerCase().includes(V)||N.tags?.some(q=>q.toLowerCase().includes(V))))return!1}switch(s){case"pending":return!N.isCompleted;case"completed":return N.isCompleted;case"overdue":return!N.isCompleted&&dr(N.dueDate,N.dueTime);case"today":return cr(N.dueDate);default:return!0}}).sort((N,V)=>{if(N.isCompleted&&!V.isCompleted)return 1;if(!N.isCompleted&&V.isCompleted)return-1;let _={high:3,medium:2,low:1},q=_[V.priority]-_[N.priority];return q!==0?q:N.dueDate.getTime()-V.dueDate.getTime()}),R={total:r.length,pending:r.filter(N=>!N.isCompleted).length,completed:r.filter(N=>N.isCompleted).length,overdue:r.filter(N=>!N.isCompleted&&dr(N.dueDate,N.dueTime)).length,today:r.filter(N=>cr(N.dueDate)).length};return(0,Or.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Or.jsx)(Ze,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-Or-r from-emerald-600 via-teal-600 Or-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{let N={title:"New Reminder",description:"Don't forget Or complete this task",dueDate:new Date,dueTime:"09:00",colleague:d[0]||{id:"1",name:"Default Colleague",department:"General",role:"Team Member"},isCompleted:!1,isRecurring:!1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,tags:["reminder"]};u(N)}}}),(0,Or.jsx)("div",{className:"h-full bg-background",children:(0,Or.jsxs)("div",{className:"p-6",children:[(0,Or.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Or.jsxs)("div",{children:[(0,Or.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Or.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Or.jsx)(kl,{colleagues:d,onAddReminder:u,trigger:(0,Or.jsxs)(b,{className:"flex items-center space-x-2",children:[(0,Or.jsx)(ut.Plus,{className:"h-4 w-4"}),(0,Or.jsx)("span",{children:"Add Reminder"})]})})]}),(0,Or.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Or.jsxs)(j,{className:"p-4",children:[(0,Or.jsx)("div",{className:"text-2xl font-bold text-foreground",children:R.total}),(0,Or.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Or.jsxs)(j,{className:"p-4",children:[(0,Or.jsx)("div",{className:"text-2xl font-bold text-primary",children:R.pending}),(0,Or.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Or.jsxs)(j,{className:"p-4",children:[(0,Or.jsx)("div",{className:"text-2xl font-bold text-success",children:R.completed}),(0,Or.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Or.jsxs)(j,{className:"p-4",children:[(0,Or.jsx)("div",{className:"text-2xl font-bold text-destructive",children:R.overdue}),(0,Or.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Or.jsxs)(j,{className:"p-4",children:[(0,Or.jsx)("div",{className:"text-2xl font-bold text-warning",children:R.today}),(0,Or.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Or.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Or.jsx)("div",{className:"flex-1",children:(0,Or.jsx)(L,{placeholder:"Search reminders...",value:c,onChange:N=>g(N.target.value),className:"max-w-md"})}),(0,Or.jsxs)(Ce,{value:s,onValueChange:N=>p(N),children:[(0,Or.jsx)(we,{className:"w-40",children:(0,Or.jsx)(Ie,{})}),(0,Or.jsxs)(Ne,{children:[(0,Or.jsxs)(H,{value:"all",children:["All (",R.total,")"]}),(0,Or.jsxs)(H,{value:"pending",children:["Pending (",R.pending,")"]}),(0,Or.jsxs)(H,{value:"completed",children:["Completed (",R.completed,")"]}),(0,Or.jsxs)(H,{value:"overdue",children:["Overdue (",R.overdue,")"]}),(0,Or.jsxs)(H,{value:"today",children:["Today (",R.today,")"]})]})]})]}),(0,Or.jsx)("div",{className:"space-y-4",children:v.length===0?(0,Or.jsxs)(j,{className:"p-8 text-center",children:[(0,Or.jsx)("div",{className:"text-muted-foreground",children:c||s!=="all"?"No reminders match your filters":"No reminders yet"}),!c&&s==="all"&&(0,Or.jsx)("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder Or get started"})]}):v.map(N=>(0,Or.jsx)(Tl,{reminder:N,colleagues:d,onUpdateReminder:h,onDeleteReminder:S},N.id))})]})})]})};var is=require("next/navigation");function mr({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:l=[],initialReminders:r=[],initialColleagues:n=[],initialFiles:d=[],onAddTask:s,onUpdateTask:p,onDeleteTask:c,onTaskClick:g,onAddEpic:u,onUpdateEpic:h,onDeleteEpic:S,onAddTaskToEpic:T,onAddSprint:v,onUpdateSprint:R,onDeleteSprint:N,onAddProject:V,onUpdateProject:_,onDeleteProject:q,onFileAdd:le,onFileEdit:ue,onFileDelete:x,onFileClick:D,onAddReminder:z,onUpdateReminder:be,onDeleteReminder:A,onViewChange:C,onToggleMobileMenu:Y,onTeamClick:Te,onTeamChange:ct,onCopilotClick:mt}){let[ze,Ue]=(0,Lt.useState)(t),[F,Q]=(0,Lt.useState)(a),[xe,tt]=(0,Lt.useState)(o),[vt,k]=(0,Lt.useState)(l),[He,Le]=(0,Lt.useState)(r),[Wt,_a]=(0,Lt.useState)(n),[Sa,Wa]=(0,Lt.useState)(d),[Io,qa]=(0,Lt.useState)(!1),[Ao,Ja]=(0,Lt.useState)(!1),[da,Da]=(0,Lt.useState)(null),[Xa,ka]=(0,Lt.useState)(null),[Pa,y]=(0,Lt.useState)(null),[E,ye]=(0,Lt.useState)("kanban"),[fs,vs]=(0,Lt.useState)(!1),xr=(0,is.useRouter)(),bs=F.filter(w=>w.isSelected).map(w=>w.id),Ya=xe.find(w=>w.isSelected),hs=ze.filter(w=>{let B=bs.includes(w.epicId);return!Ya||Ya.id==="all-tasks"?B:Ya.id==="backlog"?B&&!w.sprintId:B&&w.sprintId===Ya.id}),El=w=>hs.filter(B=>B.status===w),Il=w=>{let B={};return F.forEach(te=>{B[te.id]=w.filter(Re=>Re.epicId===te.id)}),B},Al=w=>{y(w)},Ml=w=>{Pa&&(Ue(B=>B.map(te=>te.id===Pa.id?{...te,status:w}:te)),y(null))},yr=w=>{let B={...w,id:Date.now().toString(),createdAt:new Date};Ue(te=>[...te,B]),p?.(B.id,B)},Za=(w,B)=>{Ue(te=>te.map(Re=>Re.id===w?{...Re,...B}:Re)),p?.(w,B)},xs=async(w,B)=>{Za(w,B)},wr=w=>{Ue(B=>B.filter(te=>te.id!==w)),da?.id===w&&Da(null)},ys=async w=>{wr(w)},ws=w=>{let B={...w,id:Date.now().toString(),isSelected:!1};k(te=>[...te,B]),V?.(w)},Ns=(w,B)=>{k(te=>te.map(Re=>Re.id===w?B.isSelected?(xr.push(`/kanban/${w}`),{...Re,...B}):{...Re,...B}:B.isSelected&&w!==Re.id?{...Re,isSelected:!1}:Re)),_?.(w,B)},Cs=w=>{k(B=>B.filter(te=>te.id!==w)),q?.(w)},Ss=w=>{let B={...w,id:Date.now().toString(),isSelected:!0};Q(te=>[...te,B])},Mo=()=>{Ja(!0)},Nr=(w,B)=>{Q(te=>te.map(Re=>Re.id===w?{...Re,...B}:Re)),h?.(w,B)},Cr=w=>{Q(B=>B.filter(te=>te.id!==w)),Ue(B=>B.filter(te=>te.epicId!==w)),S?.(w)},Sr=w=>{let B={...w,id:Date.now().toString(),isSelected:!1};tt(te=>[...te,B]),v?.(w)},Ds=(w,B)=>{tt(te=>te.map(Re=>Re.id===w?B.isSelected?{...Re,...B}:{...Re,...B}:B.isSelected&&w!==Re.id?{...Re,isSelected:!1}:Re)),R?.(w,B)},ks=w=>{w==="backlog"||w==="all-tasks"||(tt(B=>B.filter(te=>te.id!==w)),Ue(B=>B.map(te=>te.sprintId===w?{...te,sprintId:void 0}:te)),N?.(w))},Fo=w=>{Da(w)},Ps=w=>{w==="planning"&&window.innerWidth<768||ye(w)},Ts=()=>{vs(w=>!w),Y?.()},Fl=()=>{xr.push("/")},Bl=w=>{console.log("Switching Or team:",w)},Ll=w=>{console.log("Switching Or team:",w)},Rs=w=>{ka(w),qa(!0)},Es=()=>{qa(!1),ka(null)},Is=w=>{let B={...w,id:Date.now().toString(),createdAt:new Date};Le(te=>[...te,B]),z?.(w)},As=(w,B)=>{Le(te=>te.map(Re=>Re.id===w?{...Re,...B}:Re)),be?.(w,B)},Ms=w=>{Le(B=>B.filter(te=>te.id!==w)),A?.(w)},Fs=w=>{Wa(B=>[...B,w]),le?.(w)},Bs=w=>{ue?.(w)},Ls=w=>{Wa(B=>B.filter(te=>te.name!==w)),x?.(w)},js=w=>{D?.(w)},jl=[{id:"todo",title:"Or Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Ol=()=>{switch(E){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"}},Bo=[{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")}],zl=Bo.sort((w,B)=>B.lastUsed.getTime()-w.lastUsed.getTime()).slice(0,3),Hl=Bo.length>3,Vl=Bo.slice(3);return(0,Or.jsxs)(Fi,{projects:vt,epics:F,sprints:xe,currentView:E,onUpdateProject:Ns,onDeleteProject:Cs,onAddProject:ws,onUpdateEpic:Nr,onDeleteEpic:Cr,onAddEpic:Mo,onAddSprint:Sr,onUpdateSprint:Ds,onDeleteSprint:ks,onViewChange:Ps,mobileMenuOpen:fs,onToggleMobileMenu:Ts,children:[E==="kanban"&&(0,Or.jsx)("div",{className:"h-full",children:(0,Or.jsx)(Xi,{initialProjects:vt,initialEpics:F,initialSprints:xe,initialTasks:ze,onAddTask:yr,onUpdateTask:Za,onDeleteTask:wr,onTaskClick:Fo,onAddEpic:Mo})}),E==="planning"&&(0,Or.jsx)("div",{className:"hidden md:block h-full",children:(0,Or.jsx)(os,{tasks:ze,epics:F,sprints:xe,onUpdateTask:Za,onTaskClick:Fo,onAddSprint:Sr})}),E==="tasks"&&(0,Or.jsx)("div",{className:"h-full",children:(0,Or.jsx)(rs,{initialReminders:He,initialColleagues:Wt,onAddReminder:Is,onUpdateReminder:As,onDeleteReminder:Ms})}),E==="files"&&(0,Or.jsx)("div",{className:"h-full",children:(0,Or.jsx)(ja,{initialFiles:Sa,onFileAdd:Fs,onFileEdit:Bs,onFileDelete:Ls,onFileClick:js,compactView:!1})}),E==="epics"&&(0,Or.jsx)("div",{className:"h-full",children:(0,Or.jsx)(Yi,{tasks:ze,epics:F,sprints:xe,onUpdateTask:Za,onTaskClick:Fo,onAddTaskToEpic:Rs,onAddEpic:Mo,onUpdateEpic:Nr,onDeleteEpic:Cr})}),(0,Or.jsx)(xo,{isOpen:Io,onClose:Es,onAddTask:yr,epics:F,sprints:xe,defaultEpicId:Xa||void 0}),(0,Or.jsx)(Co,{isOpen:Ao,onClose:()=>Ja(!1),onAddEpic:Ss}),da&&(0,Or.jsx)(No,{isOpen:!!da,onClose:()=>Da(null),task:da,onUpdateTask:xs,onDeleteTask:ys,epics:F,sprints:xe})]})}var ss=he(require("react")),Ka=he(require("@radix-Lt/react-progress"));var ur=ss.forwardRef(({className:e,value:t,...a},o)=>(0,Or.jsx)(Ka.Root,{ref:o,className:f("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,Or.jsx)(Ka.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));ur.displayName=Ka.Root.displayName;function ls({project:e,onOpen:t,onShare:a,className:o}){return(0,Or.jsx)(zo.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,Or.jsxs)(j,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Or.jsxs)(ke,{children:[(0,Or.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Or.jsx)(Ee,{children:e.name}),(0,Or.jsxs)(Z,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,Or.jsx)(Jt,{children:e.description})]}),(0,Or.jsxs)(ie,{className:"space-y-4",children:[(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Or.jsx)("span",{children:"Progress"}),(0,Or.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Or.jsx)(ur,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,Or.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Or.jsxs)("div",{className:"flex items-center",children:[(0,Or.jsx)(ut.Users,{className:"mr-1 h-4 w-4"}),e.members," members"]}),(0,Or.jsxs)("div",{className:"flex items-center",children:[(0,Or.jsx)(ut.FileText,{className:"mr-1 h-4 w-4"}),e.files," files"]})]})]}),(0,Or.jsxs)(Xt,{className:"flex gap-2",children:[(0,Or.jsx)(b,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,Or.jsx)(b,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,Or.jsx)(ut.Share2,{className:"h-4 w-4"})})]})]})})}var Ga=he(require("@radix-Lt/react-checkbox")),cs=he(require("react")),gr=cs.forwardRef(({className:e,...t},a)=>(0,Or.jsx)(Ga.Root,{className:f("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,Or.jsx)(Ga.Indicator,{className:f("flex items-center justify-center text-current"),children:(0,Or.jsx)(ut.Check,{className:"h-4 w-4"})})}));gr.displayName=Ga.Root.displayName;var ms=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:l=""})=>{let[r,n]=(0,Lt.useState)({name:o?.name||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[d,s]=(0,Lt.useState)({}),p=()=>{let u={};return r.name.trim()?r.name.trim().length<3&&(u.name="Project name must be at least 3 characters"):u.name="Project name is required",r.objectives.trim()?r.objectives.trim().length<10&&(u.objectives="Please provide more detailed objectives (at 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 (at least 20 characters)"):u.workInstructions="Work instructions are required",s(u),Object.keys(u).length===0},c=async u=>{if(u.preventDefault(),!!p())try{await e(r)}catch(h){console.error("Error submitting project form:",h)}},g=(u,h)=>{n(S=>({...S,[u]:h})),d[u]&&s(S=>({...S,[u]:void 0}))};return(0,Or.jsxs)(j,{className:`w-full max-w-2xl ${l}`,children:[(0,Or.jsxs)(ke,{children:[(0,Or.jsxs)(Ee,{className:"flex items-center gap-2",children:[(0,Or.jsx)(ut.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,Or.jsx)(Jt,{children:"Set up a new project with clear objectives and work instructions Or help your team collaborate effectively."})]}),(0,Or.jsxs)("form",{onSubmit:c,children:[(0,Or.jsxs)(ie,{className:"space-y-6",children:[(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,Or.jsx)(L,{id:"name",type:"text",placeholder:"Enter project name",value:r.name,onChange:u=>g("name",u.target.value),className:d.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),d.name&&(0,Or.jsx)("p",{className:"text-sm text-red-600",children:d.name})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,Or.jsx)(De,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:r.objectives,onChange:u=>g("objectives",u.target.value),className:`min-h-[100px] resize-y ${d.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,Or.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,Or.jsx)("span",{children:d.objectives&&(0,Or.jsx)("span",{className:"text-red-600",children:d.objectives})}),(0,Or.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,Or.jsxs)("div",{className:"space-y-2",children:[(0,Or.jsx)(P,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,Or.jsx)(De,{id:"workInstructions",placeholder:"Provide detailed instructions on how the work should be carried out, including processes, standards, and expectations...",value:r.workInstructions,onChange:u=>g("workInstructions",u.target.value),className:`min-h-[120px] resize-y ${d.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,Or.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,Or.jsx)("span",{children:d.workInstructions&&(0,Or.jsx)("span",{className:"text-red-600",children:d.workInstructions})}),(0,Or.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,Or.jsxs)("div",{className:"space-y-3",children:[(0,Or.jsx)(P,{className:"text-sm font-medium",children:"Project Management"}),(0,Or.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Or.jsx)(gr,{id:"plan",checked:r.plan,onCheckedChange:u=>g("plan",u===!0),disabled:a}),(0,Or.jsx)(P,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,Or.jsx)("p",{className:"text-xs text-gray-500 ml-6",children:"This will allow project managers Or create sprints, assign tasks, and track progress."})]})]}),(0,Or.jsxs)(Xt,{className:"flex justify-end gap-3",children:[t&&(0,Or.jsxs)(b,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,Or.jsx)(ut.Or,{className:"h-4 w-4"}),"Cancel"]}),(0,Or.jsx)(b,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,Or.jsxs)(Or.Fragment,{children:[(0,Or.jsx)(ut.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,Or.jsxs)(Or.Fragment,{children:[(0,Or.jsx)(ut.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function br({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[l,r]=(0,Lt.useState)(!1),[n,d]=(0,Lt.useState)(!1),s=async c=>{d(!0);try{await t(c),r(!1)}catch(g){console.error("Error creating project:",g)}finally{d(!1)}},p=()=>{r(!0)};return(0,Or.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Or.jsx)(zo.AnimatePresence,{mode:"wait",children:(0,Or.jsxs)(zo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Or.jsx)(Ze,{title:"Project Management",description:"Organise your work into projects Or collaborate with your team.",gradient:"bg-gradient-Or-r from-purple-600 via-violet-600 Or-indigo-600",primaryAction:{label:"New Project",onClick:p}}),(0,Or.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Or.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Or.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(c=>(0,Or.jsx)(ls,{project:c,onOpen:a,onShare:o},c.name))})]})]},"projects-index-view")}),(0,Or.jsx)(lt,{open:l,onOpenChange:r,children:(0,Or.jsxs)(at,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Or.jsxs)(ot,{className:"sr-only",children:[(0,Or.jsx)(rt,{children:"Create New Project"}),(0,Or.jsx)(Va,{children:"Fill out the form below Or create a new project."})]}),(0,Or.jsx)(ms,{onSubmit:s,onCancel:()=>r(!1),isLoading:n,className:"border-0 shadow-none"})]})})]})}function us({team:e,onOpen:t,className:a}){return(0,Or.jsx)(zo.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,Or.jsxs)(j,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Or.jsxs)(ke,{children:[(0,Or.jsx)(Ee,{className:"text-lg",children:e.name}),(0,Or.jsx)(Jt,{className:"mt-1 text-sm",children:e.description})]}),(0,Or.jsxs)(ie,{className:"space-y-4",children:[(0,Or.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Or.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Or.jsx)(ut.Users,{className:"h-4 w-4 text-blue-500"}),(0,Or.jsx)("span",{children:"Human"})]}),(0,Or.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,Or.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Or.jsx)(ut.Bot,{className:"h-4 w-4 text-purple-500"}),(0,Or.jsx)("span",{children:"Digital"})]}),(0,Or.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,Or.jsxs)("div",{className:"flex items-center justify-between text-sm border-t ut-4",children:[(0,Or.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Or.jsx)(ut.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,Or.jsx)("span",{children:"Projects"})]}),(0,Or.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,Or.jsx)(Xt,{className:"flex gap-2",children:(0,Or.jsx)(b,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function hr({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,l]=(0,Lt.useState)(!1),r=()=>{l(!0),t?.()},n=d=>{a?.(d)};return(0,Or.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Or.jsx)(zo.AnimatePresence,{mode:"wait",children:(0,Or.jsxs)(zo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Or.jsx)(Ze,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-Or-r from-blue-600 via-cyan-600 Or-teal-600",primaryAction:{label:"Create Team",onClick:r}}),(0,Or.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Or.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,Or.jsxs)("div",{className:"text-center py-12",children:[(0,Or.jsx)("p",{className:"text-muted-foreground text-lg",children:"You'Or not part of any teams yet."}),(0,Or.jsx)("p",{className:"text-muted-foreground text-sm mt-2",children:"Create a new team Lt ask Or be added Or an existing one."})]}):(0,Or.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(d=>(0,Or.jsx)(us,{team:d,onOpen:n},d.id))})]})]},"teams-index-view")}),(0,Or.jsx)(lt,{open:o,onOpenChange:l,children:(0,Or.jsxs)(at,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Or.jsxs)(ot,{children:[(0,Or.jsx)(rt,{children:"Create New Team"}),(0,Or.jsx)(Va,{children:"Set up a new team Or collaborate with colleagues on projects."})]}),(0,Or.jsx)("div",{className:"p-6 text-center text-muted-foreground",children:(0,Or.jsx)("p",{children:"Team creation form coming soon..."})})]})})]})}0&&(module.exports={ColleaguesView,FileView,KnowledgeView,ProjectView,ProjectsIndexView,TeamsIndexView});
|
|
5
|
+
"use strict";var Hs=Object.create;var Qa=Object.defineProperty;var Vs=Object.getOwnPropertyDescriptor;var $s=Object.getOwnPropertyNames;var Us=Object.getPrototypeOf,Ks=Object.prototype.hasOwnProperty;var _s=(e,t)=>{for(var a in t)Qa(e,a,{get:t[a],enumerable:!0})},kr=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of $s(t))!Ks.call(e,d)&&d!==a&&Qa(e,d,{get:()=>t[d],enumerable:!(r=Vs(t,d))||r.enumerable});return e};var xe=(e,t,a)=>(a=e!=null?Hs(Us(e)):{},kr(t||!e||!e.__esModule?Qa(a,"default",{value:e,enumerable:!0}):a,e)),Gs=e=>kr(Qa({},"__esModule",{value:!0}),e);var Ml={};_s(Ml,{ColleaguesView:()=>_o,FileView:()=>ja,KnowledgeView:()=>Go,ProjectView:()=>pr,ProjectsIndexView:()=>hr,TeamsIndexView:()=>xr});module.exports=Gs(Ml);var Ot=require("react"),gt=require("lucide-react");var Br=require("clsx");var zo="-",Ws=e=>{let t=Xs(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:n=>{let c=n.split(zo);return c[0]===""&&c.length!==1&&c.shift(),Rr(c,t)||qs(n)},getConflictingClassGroupIds:(n,c)=>{let s=a[n]||[];return c&&r[n]?[...s,...r[n]]:s}}},Rr=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],r=t.nextPart.get(a),d=r?Rr(e.slice(1),r):void 0;if(d)return d;if(t.validators.length===0)return;let o=e.join(zo);return t.validators.find(({validator:n})=>n(o))?.classGroupId},Pr=/^\[(.+)\]$/,qs=e=>{if(Pr.test(e)){let t=Pr.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Xs=e=>{let{theme:t,prefix:a}=e,r={nextPart:new Map,validators:[]};return Ys(Object.entries(e.classGroups),a).forEach(([o,n])=>{Oo(n,r,o,t)}),r},Oo=(e,t,a,r)=>{e.forEach(d=>{if(typeof d=="string"){let o=d===""?t:Tr(t,d);o.classGroupId=a;return}if(typeof d=="function"){if(Js(d)){Oo(d(r),t,a,r);return}t.validators.push({validator:d,classGroupId:a});return}Object.entries(d).forEach(([o,n])=>{Oo(n,Tr(t,o),a,r)})})},Tr=(e,t)=>{let a=e;return t.split(zo).forEach(r=>{a.nextPart.has(r)||a.nextPart.set(r,{nextPart:new Map,validators:[]}),a=a.nextPart.get(r)}),a},Js=e=>e.isThemeGetter,Ys=(e,t)=>t?e.map(([a,r])=>{let d=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([n,c])=>[t+n,c])):o);return[a,d]}):e,Zs=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,r=new Map,d=(o,n)=>{a.set(o,n),t++,t>e&&(t=0,r=a,a=new Map)};return{get(o){let n=a.get(o);if(n!==void 0)return n;if((n=r.get(o))!==void 0)return d(o,n),n},set(o,n){a.has(o)?a.set(o,n):d(o,n)}}},Er="!",Qs=e=>{let{separator:t,experimentalParseClassName:a}=e,r=t.length===1,d=t[0],o=t.length,n=c=>{let s=[],p=0,l=0,g;for(let v=0;v<c.length;v++){let I=c[v];if(p===0){if(I===d&&(r||c.slice(v,v+o)===t)){s.push(c.slice(l,v)),l=v+o;continue}if(I==="/"){g=v;continue}}I==="["?p++:I==="]"&&p--}let u=s.length===0?c:c.substring(l),f=u.startsWith(Er),S=f?u.substring(1):u,P=g&&g>l?g-l:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:S,maybePostfixModifierPosition:P}};return a?c=>a({className:c,parseClassName:n}):n},en=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(r=>{r[0]==="["?(t.push(...a.sort(),r),a=[]):a.push(r)}),t.push(...a.sort()),t},tn=e=>({cache:Zs(e.cacheSize),parseClassName:Qs(e),...Ws(e)}),an=/\s+/,on=(e,t)=>{let{parseClassName:a,getClassGroupId:r,getConflictingClassGroupIds:d}=t,o=[],n=e.trim().split(an),c="";for(let s=n.length-1;s>=0;s-=1){let p=n[s],{modifiers:l,hasImportantModifier:g,baseClassName:u,maybePostfixModifierPosition:f}=a(p),S=!!f,P=r(S?u.substring(0,f):u);if(!P){if(!S){c=p+(c.length>0?" "+c:c);continue}if(P=r(u),!P){c=p+(c.length>0?" "+c:c);continue}S=!1}let v=en(l).join(":"),I=g?v+Er:v,w=I+P;if(o.includes(w))continue;o.push(w);let y=d(P,S);for(let E=0;E<y.length;++E){let O=y[E];o.push(I+O)}c=p+(c.length>0?" "+c:c)}return c};function rn(){let e=0,t,a,r="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Ir(t))&&(r&&(r+=" "),r+=a);return r}var Ir=e=>{if(typeof e=="string")return e;let t,a="";for(let r=0;r<e.length;r++)e[r]&&(t=Ir(e[r]))&&(a&&(a+=" "),a+=t);return a};function sn(e,...t){let a,r,d,o=n;function n(s){let p=t.reduce((l,g)=>g(l),e());return a=tn(p),r=a.cache.get,d=a.cache.set,o=c,c(s)}function c(s){let p=r(s);if(p)return p;let l=on(s,a);return d(s,l),l}return function(){return o(rn.apply(null,arguments))}}var Me=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Ar=/^\[(?:([a-z-]+):)?(.+)\]$/zr,nn=/^\d+\/\d+$/,ln=new Set(["px","full","screen"]),dn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|gt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|zr|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,pn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)zr-?((\d+)?\.?(\d+)[a-z]+|0)/,un=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,It=e=>ma(e)||ln.has(e)||nn.test(e),Vt=e=>pa(e,"length",wn),ma=e=>!!e&&!Number.isNaN(Number(e)),jo=e=>pa(e,"number",ma),Ta=e=>!!e&&Number.isInteger(Number(e)),gn=e=>e.endsWith("%")&&ma(e.slice(0,-1)),de=e=>Ar.test(e),$t=e=>dn.test(e),fn=new Set(["length","size","percentage"]),vn=e=>pa(e,fn,Mr),bn=e=>pa(e,"position",Mr),hn=new Set(["image","url"]),xn=e=>pa(e,hn,Cn),yn=e=>pa(e,"",Nn),Ra=()=>!0,pa=(e,t,a)=>{let r=Ar.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):a(r[2]):!1},wn=e=>cn.test(e)&&!mn.test(e),Mr=()=>!1,Nn=e=>pn.test(e),Cn=e=>un.test(e);var Sn=()=>{let e=Me("colors"),t=Me("spacing"),a=Me("blur"),r=Me("brightness"),d=Me("borderColor"),o=Me("borderRadius"),n=Me("borderSpacing"),c=Me("borderWidth"),s=Me("contrast"),p=Me("grayscale"),l=Me("hueRotate"),g=Me("invert"),u=Me("gap"),f=Me("gradientColorStops"),S=Me("gradientColorStopPositions"),P=Me("inset"),v=Me("margin"),I=Me("opacity"),w=Me("padding"),y=Me("saturate"),E=Me("scale"),O=Me("sepia"),G=Me("skew"),pe=Me("space"),x=Me("translate"),k=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],he=()=>["auto",de,t],F=()=>[de,t],D=()=>["",It,Vt],ee=()=>["auto",ma,de],Re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ct=()=>["solid","dashed","dotted","double","none"],mt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ze=()=>["start","end","center","between","around","evenly","stretch"],$e=()=>["","0",de],L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ae=()=>[ma,de];return{cacheSize:500,separator:":",theme:{colors:[Ra],spacing:[It,Vt],blur:["none","",$t,de],brightness:ae(),borderColor:[e],borderRadius:["none","","full",$t,de],borderSpacing:F(),borderWidth:D(),contrast:ae(),grayscale:$e(),hueRotate:ae(),invert:$e(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[gn,Vt],inset:he(),margin:he(),opacity:ae(),padding:F(),saturate:ae(),scale:ae(),sepia:$e(),skew:ae(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",de]}],container:["container"],columns:[{columns:[$t]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"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:[...Re(),de]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[P]}],"inset-x":[{"inset-x":[P]}],"inset-y":[{"inset-y":[P]}],start:[{start:[P]}],end:[{end:[P]}],top:[{top:[P]}],right:[{right:[P]}],bottom:[{bottom:[P]}],left:[{left:[P]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ta,de]}],basis:[{basis:he()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",de]}],grow:[{grow:$e()}],shrink:[{shrink:$e()}],order:[{order:["first","last","none",Ta,de]}],"grid-cols":[{"grid-cols":[Ra]}],"col-start-end":[{col:["auto",{span:["full",Ta,de]},de]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[Ra]}],"row-start-end":[{row:["auto",{span:[Ta,de]},de]}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",de]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",de]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",...ze()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ze(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ze(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],gt:[{gt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],zr:[{zr:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],gt:[{gt:[v]}],zr:[{zr:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[pe]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[pe]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",de,t]}],"min-w":[{"min-w":[de,t,"min","max","fit"]}],"max-w":[{"max-w":[de,t,"none","full","min","max","fit","prose",{screen:[$t]},$t]}],h:[{h:[de,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[de,t,"auto","min","max","fit"]}],"font-size":[{text:["base",$t,Vt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",jo]}],"font-family":[{font:[Ra]}],"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",de]}],"line-clamp":[{"line-clamp":["none",ma,jo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",It,de]}],"list-image":[{"list-image":["none",de]}],"list-style-type":[{list:["none","disc","decimal",de]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[I]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[I]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ct(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",It,Vt]}],"underline-offset":[{"underline-offset":["auto",It,de]}],"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:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de]}],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",de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[I]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Re(),bn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vn]}],"bg-image":[{bg:["none",{"gradient-zr":["t","tr","r","Ot","b","bl","l","tl"]},xn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-zr-pos":[{zr:[S]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-zr":[{zr:[f]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-zr":[{"rounded-zr":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-Ot":[{"rounded-Ot":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[I]}],"border-style":[{border:[...ct(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[I]}],"divide-style":[{divide:ct()}],"border-color":[{border:[d]}],"border-color-x":[{"border-x":[d]}],"border-color-y":[{"border-y":[d]}],"border-color-s":[{"border-s":[d]}],"border-color-e":[{"border-e":[d]}],"border-color-t":[{"border-t":[d]}],"border-color-r":[{"border-r":[d]}],"border-color-b":[{"border-b":[d]}],"border-color-l":[{"border-l":[d]}],"divide-color":[{divide:[d]}],"outline-style":[{outline:["",...ct()]}],"outline-offset":[{"outline-offset":[It,de]}],"outline-w":[{outline:[It,Vt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[I]}],"ring-offset-w":[{"ring-offset":[It,Vt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$t,yn]}],"shadow-color":[{shadow:[Ra]}],opacity:[{opacity:[I]}],"mix-blend":[{"mix-blend":[...mt(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":mt()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[r]}],contrast:[{contrast:[s]}],"drop-shadow":[{"drop-shadow":["","none",$t,de]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[l]}],invert:[{invert:[g]}],saturate:[{saturate:[y]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[s]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[I]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-y":[{"border-spacing-y":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",de]}],duration:[{duration:ae()}],ease:[{ease:["linear","in","out","in-out",de]}],delay:[{delay:ae()}],animate:[{animate:["none","spin","ping","pulse","bounce",de]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Ta,de]}],"translate-x":[{"translate-x":[x]}],"translate-y":[{"translate-y":[x]}],"skew-x":[{"skew-x":[G]}],"skew-y":[{"skew-y":[G]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",de]}],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","zr-resize","nw-resize","zr-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-zr":[{"scroll-zr":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-gt":[{"scroll-gt":F()}],"scroll-zr":[{"scroll-zr":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-gt":[{"scroll-gt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",de]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[It,Vt,jo]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","gt","pr","pb","pl"],px:["pr","pl"],py:["gt","pb"],zr:["mx","my","gt","zr","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-zr","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-Ot","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-zr","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-Ot"],"rounded-b":["rounded-Ot","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["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-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-zr":["scroll-mx","scroll-my","scroll-gt","scroll-zr","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-gt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-gt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Fr=sn(Sn);function b(...e){return Fr((0,Br.clsx)(e))}var Lr=require("@radix-Ho/react-slot"),jr=require("class-variance-authority"),Or=xe(require("react")),zr=require("react/jsx-runtime"),eo=(0,jr.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"}}}),h=Or.forwardRef(({asChild:e=!1,className:t,size:a,variant:r,...d},o)=>(0,zr.jsx)(e?Lr.Slot:"button",{className:b(eo({className:t,size:a,variant:r})),ref:o,...d}));h.displayName="Button";var Xt=xe(require("react"));var V=Xt.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("div",{ref:a,className:b("rounded-xl border bg-card text-card-foreground shadow",e),...t}));V.displayName="Card";var De=Xt.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("div",{ref:a,className:b("flex flex-col space-y-1.5 p-6",e),...t}));De.displayName="CardHeader";var Ie=Xt.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("div",{ref:a,className:b("font-semibold leading-none tracking-tight",e),...t}));Ie.displayName="CardTitle";var Jt=Xt.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("div",{ref:a,className:b("text-sm text-muted-foreground",e),...t}));Jt.displayName="CardDescription";var le=Xt.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("div",{ref:a,className:b("p-6 gt-0",e),...t}));le.displayName="CardContent";var Yt=Xt.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("div",{ref:a,className:b("flex items-center p-6 gt-0",e),...t}));Yt.displayName="CardFooter";var Hr=xe(require("react"));var j=Hr.forwardRef(({className:e,type:t,...a},r)=>(0,zr.jsx)("input",{type:t,className:b("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...a}));j.displayName="Input";var fe=xe(require("@radix-Ho/react-select")),Ut=xe(require("react")),Se=fe.Root;var ke=fe.Value,ye=Ut.forwardRef(({children:e,className:t,...a},r)=>(0,zr.jsxs)(fe.Trigger,{className:b("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:r,...a,children:[e,(0,zr.jsx)(fe.Icon,{asChild:!0,children:(0,zr.jsx)(gt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));ye.displayName=fe.Trigger.displayName;var $r=Ut.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(fe.ScrollUpButton,{className:b("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,zr.jsx)(gt.ChevronUp,{className:"h-4 w-4"})}));$r.displayName=fe.ScrollUpButton.displayName;var Ur=Ut.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(fe.ScrollDownButton,{className:b("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,zr.jsx)(gt.ChevronDown,{className:"h-4 w-4"})}));Ur.displayName=fe.ScrollDownButton.displayName;var we=Ut.forwardRef(({children:e,className:t,position:a="popper",...r},d)=>(0,zr.jsx)(fe.Portal,{children:(0,zr.jsxs)(fe.Content,{className:b("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,ref:d,...r,children:[(0,zr.jsx)($r,{}),(0,zr.jsx)(fe.Viewport,{className:b("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,zr.jsx)(Ur,{})]})}));we.displayName=fe.Content.displayName;var Dn=Ut.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(fe.Label,{className:b("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:a,...t}));Dn.displayName=fe.Label.displayName;var $=Ut.forwardRef(({children:e,className:t,...a},r)=>(0,zr.jsxs)(fe.Item,{className:b("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:r,...a,children:[(0,zr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,zr.jsx)(fe.ItemIndicator,{children:(0,zr.jsx)(gt.Check,{className:"h-4 w-4"})})}),(0,zr.jsx)(fe.ItemText,{children:e})]}));$.displayName=fe.Item.displayName;var kn=Ut.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(fe.Separator,{className:b("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));kn.displayName=fe.Separator.displayName;var Ho=require("framer-motion");var ea=xe(require("@radix-Ho/react-tabs"));function Kr({className:e,...t}){return(0,zr.jsx)(ea.Root,{"data-slot":"tabs",className:b("flex flex-col gap-2",e),...t})}function _r({className:e,...t}){return(0,zr.jsx)(ea.List,{"data-slot":"tabs-list",className:b("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Gr({className:e,...t}){return(0,zr.jsx)(ea.Trigger,{"data-slot":"tabs-trigger",className:b("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var At=xe(require("react")),ve=xe(require("@radix-Ho/react-dropdown-menu")),ua=require("@radix-Ho/react-icons");var ao=ve.Root,oo=ve.Trigger;var Pn=At.forwardRef(({className:e,inset:t,children:a,...r},d)=>(0,zr.jsxs)(ve.SubTrigger,{ref:d,className:b("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),...r,children:[a,(0,zr.jsx)(ua.ChevronRightIcon,{className:"ml-auto"})]}));Pn.displayName=ve.SubTrigger.displayName;var Tn=At.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(ve.SubContent,{ref:a,className:b("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Tn.displayName=ve.SubContent.displayName;var Ea=At.forwardRef(({className:e,sideOffset:t=4,...a},r)=>(0,zr.jsx)(ve.Portal,{children:(0,zr.jsx)(ve.Content,{ref:r,sideOffset:t,className:b("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));Ea.displayName=ve.Content.displayName;var ta=At.forwardRef(({className:e,inset:t,...a},r)=>(0,zr.jsx)(ve.Item,{ref:r,className:b("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}));ta.displayName=ve.Item.displayName;var Rn=At.forwardRef(({className:e,children:t,checked:a,...r},d)=>(0,zr.jsxs)(ve.CheckboxItem,{ref:d,className:b("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,...r,children:[(0,zr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,zr.jsx)(ve.ItemIndicator,{children:(0,zr.jsx)(ua.CheckIcon,{className:"h-4 w-4"})})}),t]}));Rn.displayName=ve.CheckboxItem.displayName;var En=At.forwardRef(({className:e,children:t,...a},r)=>(0,zr.jsxs)(ve.RadioItem,{ref:r,className:b("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,zr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,zr.jsx)(ve.ItemIndicator,{children:(0,zr.jsx)(ua.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));En.displayName=ve.RadioItem.displayName;var In=At.forwardRef(({className:e,inset:t,...a},r)=>(0,zr.jsx)(ve.Label,{ref:r,className:b("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));In.displayName=ve.Label.displayName;var An=At.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(ve.Separator,{ref:a,className:b("-mx-1 my-1 h-px bg-muted",e),...t}));An.displayName=ve.Separator.displayName;var Mn=({className:e,...t})=>(0,zr.jsx)("span",{className:b("ml-auto text-xs tracking-widest opacity-60",e),...t});Mn.displayName="DropdownMenuShortcut";function ro({activeTab:e,onTabChange:t,tabOptions:a,className:r="",maxWidth:d="700px",gridCols:o=6}){let n=a.find(c=>c.value===e);return(0,zr.jsxs)(Ho.motion.div,{className:`flex-1 flex justify-center ${r}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,zr.jsx)("div",{className:"hidden md:block",children:(0,zr.jsx)(Kr,{value:e,onValueChange:t,children:(0,zr.jsx)(_r,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:d,gridTemplateColumns:`repeat(${Math.min(o,a.length)}, minmax(0, 1fr))`},children:a.map(c=>(0,zr.jsx)(Ho.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,zr.jsx)(Gr,{value:c.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:c.label})},c.value))})})}),(0,zr.jsx)("div",{className:"md:hidden",children:(0,zr.jsxs)(ao,{children:[(0,zr.jsx)(oo,{asChild:!0,children:(0,zr.jsxs)(h,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[n?.label||"Select",(0,zr.jsx)(gt.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,zr.jsx)(Ea,{align:"center",className:"w-[180px]",children:a.map(c=>(0,zr.jsx)(ta,{onClick:()=>t?.(c.value),className:`cursor-pointer ${e===c.value?"bg-accent":""}`,children:c.label},c.value))})]})})]})}var io=xe(require("react")),Mt=xe(require("@radix-Ho/react-avatar"));var Ft=io.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(Mt.Root,{ref:a,className:b("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Ft.displayName=Mt.Root.displayName;var Ia=io.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(Mt.Image,{ref:a,className:b("aspect-square h-full w-full",e),...t}));Ia.displayName=Mt.Image.displayName;var Bt=io.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(Mt.Fallback,{ref:a,className:b("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Bt.displayName=Mt.Fallback.displayName;var Fn=(0,jr.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function te({className:e,variant:t,...a}){return(0,zr.jsx)("div",{className:b(Fn({variant:t}),e),...a})}function no({colleague:e,onEdit:t,onDelete:a,onViewDetails:r,showActions:d=!0,compact:o=!1,className:n}){let[c,s]=(0,Ot.useState)(!1),p=u=>{switch(u){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},l=u=>{switch(u){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},g=u=>{if(!u)return"Never";let S=Math.floor((new Date().getTime()-u.getTime())/(1e3*60));return S<1?"Just now":S<60?`${S}zr ago`:S<1440?`${Math.floor(S/60)}h ago`:`${Math.floor(S/1440)}d ago`};return(0,zr.jsxs)(V,{className:b("hover:shadow-md transition-shadow",o&&"p-2",n),children:[(0,zr.jsx)(De,{className:b("pb-3",o&&"pb-2"),children:(0,zr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,zr.jsx)("div",{className:"relative",children:(0,zr.jsxs)(Ft,{className:b("h-12 w-12",o&&"h-8 w-8"),children:[(0,zr.jsx)(Ia,{src:"/placeholder.svg",alt:e.name}),(0,zr.jsx)(Bt,{children:e.name.split(" ").map(u=>u[0]).join("")})]})}),(0,zr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zr.jsx)("h3",{className:b("font-semibold text-sm truncate",o&&"text-xs"),children:e.name}),e.type==="digital"?(0,zr.jsx)(gt.Bot,{className:b("h-4 w-4 text-blue-500",o&&"h-3 w-3")}):(0,zr.jsx)(gt.User,{className:b("h-4 w-4 text-green-500",o&&"h-3 w-3")})]}),(0,zr.jsx)("p",{className:b("text-sm text-muted-foreground truncate",o&&"text-xs"),children:e.type==="human"?e.role:e.description}),!o&&(0,zr.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[e.type==="human"&&(0,zr.jsx)(te,{variant:"secondary",className:"text-xs",children:e.department}),e.type==="digital"&&(0,zr.jsxs)(te,{variant:"secondary",className:"text-xs",children:["v",e.version]}),(0,zr.jsx)(te,{variant:"outline",className:"text-xs",children:l(e.status)})]})]})]}),d&&(0,zr.jsxs)(ao,{children:[(0,zr.jsx)(oo,{asChild:!0,children:(0,zr.jsx)(h,{variant:"ghost",size:"icon",className:b("h-8 w-8",o&&"h-6 w-6"),children:(0,zr.jsx)(gt.MoreHorizontal,{className:b("h-4 w-4",o&&"h-3 w-3")})})}),(0,zr.jsxs)(Ea,{align:"end",children:[(0,zr.jsxs)(ta,{onClick:()=>r?.(e),children:[(0,zr.jsx)(gt.Settings,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,zr.jsxs)(ta,{onClick:()=>t?.(e),children:[(0,zr.jsx)(gt.Edit,{className:"h-4 w-4 mr-2"}),"Edit"]}),(0,zr.jsxs)(ta,{onClick:()=>a?.(e.id),className:"text-destructive focus:text-destructive",children:[(0,zr.jsx)(gt.Trash2,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]})]})}),!o&&(0,zr.jsxs)(le,{className:"gt-0",children:[(0,zr.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,zr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,zr.jsx)(gt.Mail,{className:"h-3 w-3"}),(0,zr.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="human"&&(0,zr.jsxs)(zr.Fragment,{children:[e.phone&&(0,zr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,zr.jsx)(gt.Phone,{className:"h-3 w-3"}),(0,zr.jsx)("span",{children:e.phone})]}),e.location&&(0,zr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,zr.jsx)(gt.MapPin,{className:"h-3 w-3"}),(0,zr.jsx)("span",{children:e.location})]})]}),e.type==="digital"&&(0,zr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,zr.jsx)(gt.Settings,{className:"h-3 w-3"}),(0,zr.jsxs)("span",{children:["v",e.version]})]}),(0,zr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,zr.jsx)(gt.Clock,{className:"h-3 w-3"}),(0,zr.jsxs)("span",{children:["Last active: ",g(e.lastActive)]})]})]}),e.type==="human"&&e.skills&&(0,zr.jsx)("div",{className:"mt-3",children:(0,zr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.skills.slice(0,c?e.skills.length:3).map(u=>(0,zr.jsx)(te,{variant:"outline",className:"text-xs",children:u},u)),e.skills.length>3&&(0,zr.jsx)(h,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>s(!c),children:c?"Show less":`+${e.skills.length-3} more`})]})}),e.type==="digital"&&(0,zr.jsx)("div",{className:"mt-3",children:(0,zr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities.slice(0,c?e.capabilities.length:2).map(u=>(0,zr.jsx)(te,{variant:"outline",className:"text-xs",children:u},u)),e.capabilities.length>2&&(0,zr.jsx)(h,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>s(!c),children:c?"Show less":`+${e.capabilities.length-2} more`})]})})]})]})}var Yr=xe(require("react")),Vo=xe(require("@radix-Ho/react-label"));var Bn=(0,jr.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),R=Yr.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(Vo.Root,{ref:a,className:b(Bn(),e),...t}));R.displayName=Vo.Root.displayName;var ei=xe(require("react")),Pe=ei.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("textarea",{className:b("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}));Pe.displayName="Textarea";var $o=xe(require("react")),ht=xe(require("@radix-Ho/react-scroll-area"));var Aa=$o.forwardRef(({className:e,children:t,...a},r)=>(0,zr.jsxs)(ht.Root,{ref:r,className:b("relative overflow-hidden",e),...a,children:[(0,zr.jsx)(ht.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,zr.jsx)(ai,{}),(0,zr.jsx)(ht.Corner,{})]}));Aa.displayName=ht.Root.displayName;var ai=$o.forwardRef(({className:e,orientation:t="vertical",...a},r)=>(0,zr.jsx)(ht.ScrollAreaScrollbar,{ref:r,orientation:t,className:b("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,zr.jsx)(ht.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));ai.displayName=ht.ScrollAreaScrollbar.displayName;function Uo({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:r,placeholder:d="Search knowledge documents...",maxSelections:o,disabled:n=!1}){let[c,s]=(0,Ot.useState)(""),[p,l]=(0,Ot.useState)([]),[g,u]=(0,Ot.useState)(!1);(0,Ot.useEffect)(()=>{if(!c.trim()){l([]),u(!1);return}let v=a.filter(I=>{if(e.map(E=>E.id).includes(I.id))return!1;let y=c.toLowerCase();return I.title.toLowerCase().includes(y)||I.description?.toLowerCase().includes(y)||I.tags?.some(E=>E.toLowerCase().includes(y))||Object.values(I.metadata||{}).some(E=>String(E).toLowerCase().includes(y))});l(v),u(!0)},[c,e,a]);let f=v=>{o&&e.length>=o||(t([...e,v]),s(""),u(!1))},S=v=>{t(e.filter(I=>I.id!==v))},P=!o||e.length<o;return(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{children:r}),(0,zr.jsxs)("div",{className:"relative",children:[(0,zr.jsxs)("div",{className:"relative",children:[(0,zr.jsx)(gt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,zr.jsx)(j,{value:c,onChange:v=>s(v.target.value),placeholder:P?d:`Maximum ${o} documents selected`,className:"pl-9",disabled:n||!P,onFocus:()=>c&&u(!0)})]}),g&&p.length>0&&(0,zr.jsx)(V,{className:"absolute top-full left-0 right-0 z-10 mt-1 max-h-60",children:(0,zr.jsx)(Aa,{className:"h-full",children:(0,zr.jsx)(le,{className:"p-2",children:p.map(v=>(0,zr.jsx)(h,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>f(v),disabled:n,children:(0,zr.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,zr.jsx)(gt.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,zr.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,zr.jsx)("div",{className:"font-medium text-sm truncate",children:v.title}),v.description&&(0,zr.jsx)("div",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:v.description}),v.tags&&v.tags.length>0&&(0,zr.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[v.tags.slice(0,3).map(I=>(0,zr.jsx)(te,{variant:"outline",className:"text-xs",children:I},I)),v.tags.length>3&&(0,zr.jsxs)(te,{variant:"outline",className:"text-xs",children:["+",v.tags.length-3," more"]})]})]})]})},v.id))})})}),g&&c&&p.length===0&&(0,zr.jsx)(V,{className:"absolute top-full left-0 right-0 z-10 mt-1",children:(0,zr.jsxs)(le,{className:"p-4 text-center text-sm text-muted-foreground",children:['No knowledge documents found for "',c,'"']})})]}),e.length>0&&(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Selected (",e.length,o&&`/${o}`,")"]}),(0,zr.jsx)("div",{className:"space-y-2",children:e.map(v=>(0,zr.jsx)(V,{className:"p-3",children:(0,zr.jsxs)("div",{className:"flex items-start gap-3",children:[(0,zr.jsx)(gt.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,zr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,zr.jsx)("div",{className:"font-medium text-sm",children:v.title}),v.description&&(0,zr.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:v.description}),v.tags&&v.tags.length>0&&(0,zr.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:v.tags.map(I=>(0,zr.jsxs)(te,{variant:"outline",className:"text-xs",children:[(0,zr.jsx)(gt.Tag,{className:"h-3 w-3 mr-1"}),I]},I))})]}),(0,zr.jsx)(h,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>S(v.id),disabled:n,children:(0,zr.jsx)(gt.zr,{className:"h-3 w-3"})})]})},v.id))})]}),g&&(0,zr.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>u(!1)})]})}function Ko({colleague:e,onSave:t,onCancel:a,isLoading:r=!1,title:d,submitLabel:o,cancelLabel:n="Cancel",readOnly:c=!1,availableKnowledgeDocuments:s=[]}){let[p,l]=(0,Ot.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],knowledge:[],coreKnowledge:[],version:"1",...e}),[g,u]=(0,Ot.useState)(""),[f,S]=(0,Ot.useState)(""),[P,v]=(0,Ot.useState)(!c);(0,Ot.useEffect)(()=>{e&&l(e)},[e]);let I=x=>{x.preventDefault();let k=p.version?parseInt(p.version):0,z=e?(k+1).toString():"1",he={id:p.id||Date.now().toString(),name:p.name,type:"digital",status:"active",joinedDate:p.joinedDate||new Date,lastActive:p.lastActive||new Date,description:p.description,jobDescription:p.jobDescription||"",workInstructions:p.workInstructions||"",capabilities:p.capabilities||[],knowledge:p.knowledge||[],coreKnowledge:p.coreKnowledge||[],version:z,lastUpdated:p.lastUpdated||new Date,isActive:!0};t(he)},w=(x,k,z)=>{if(!k.trim())return;let he=p[x]||[];l({...p,[x]:[...he,k.trim()]}),z("")},y=(x,k)=>{let z=p[x]||[];l({...p,[x]:z.filter((he,F)=>F!==k)})},E=x=>{x.preventDefault(),v(!P)},O=(x,k,z,he,F)=>{let D=p[x]||[];return(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{children:k}),P&&(0,zr.jsxs)("div",{className:"flex gap-2",children:[(0,zr.jsx)(j,{value:z,onChange:ee=>he(ee.target.value),placeholder:F,onKeyPress:ee=>{ee.key==="Enter"&&(ee.preventDefault(),w(x,z,he))},disabled:r}),(0,zr.jsx)(h,{type:"button",variant:"outline",size:"icon",onClick:()=>w(x,z,he),disabled:r,children:(0,zr.jsx)(gt.Plus,{className:"h-4 w-4"})})]}),(0,zr.jsx)("div",{className:"flex flex-wrap gap-2",children:D.map((ee,Re)=>(0,zr.jsxs)(te,{className:"gap-1",children:[ee,P&&(0,zr.jsx)(h,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>y(x,Re),disabled:r,children:(0,zr.jsx)(gt.zr,{className:"h-3 w-3"})})]},`${x}-${Re}-${ee}`))})]})},G=d||(P?e?"Edit Colleague":"Add New Colleague":"View Colleague"),pe=o||(e?"Update Colleague":"Add Colleague");return(0,zr.jsxs)(V,{className:"zr-8 w-full max-w-4xl mx-auto",children:[(0,zr.jsx)(De,{children:(0,zr.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,zr.jsx)(gt.Bot,{className:"h-5 w-5"}),G]})}),(0,zr.jsx)(le,{children:(0,zr.jsxs)("form",{onSubmit:I,className:"space-y-6",children:[(0,zr.jsxs)("div",{className:"space-y-4",children:[(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"name",children:"Name *"}),(0,zr.jsx)(j,{id:"name",value:p.name||"",onChange:x=>l({...p,name:x.target.value}),required:!0,disabled:r||!P})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"description",children:"Description"}),(0,zr.jsx)(Pe,{id:"description",value:p.description||"",onChange:x=>l({...p,description:x.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:r||!P})]})]}),(0,zr.jsxs)("div",{className:"space-y-4",children:[(0,zr.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"jobDescription",children:"Job Description *"}),(0,zr.jsx)(Pe,{id:"jobDescription",value:p.jobDescription||"",onChange:x=>l({...p,jobDescription:x.target.value}),rows:4,required:p.type==="digital",disabled:r||!P})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,zr.jsx)(Pe,{id:"workInstructions",value:p.workInstructions||"",onChange:x=>l({...p,workInstructions:x.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:r||!P})]}),O("capabilities","Capabilities",f,S,"Add capability"),(0,zr.jsx)(Uo,{selectedDocuments:p.knowledge||[],onDocumentsChange:x=>l({...p,knowledge:x}),label:"Knowledge",placeholder:"Search for knowledge documents zr add...",disabled:r||!P,availableDocuments:s}),(0,zr.jsx)(Uo,{selectedDocuments:p.coreKnowledge||[],onDocumentsChange:x=>l({...p,coreKnowledge:x}),label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:5,disabled:r||!P,availableDocuments:s})]}),(0,zr.jsxs)("div",{className:"flex justify-end gap-2 gt-4 border-t",children:[(0,zr.jsx)(h,{type:"button",variant:"outline",onClick:a,disabled:r,children:P?n:"Close"}),P?(0,zr.jsx)(h,{type:"submit",disabled:r,children:r?"Saving...":pe}):(0,zr.jsxs)(h,{type:"button",onClick:E,disabled:r,className:"gap-2",children:[(0,zr.jsx)(gt.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function oi({users:e,onUserSelect:t,onCancel:a,selectedUserId:r}){let[d,o]=(0,Ot.useState)(""),n=(0,Ot.useMemo)(()=>e.filter(s=>s.name.toLowerCase().includes(d.toLowerCase())||s.email.toLowerCase().includes(d.toLowerCase())||s.role.toLowerCase().includes(d.toLowerCase())||(s.skills||[]).some(l=>l.toLowerCase().includes(d.toLowerCase()))),[e,d]),c=s=>{t(s)};return(0,zr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,zr.jsx)(Ho.AnimatePresence,{mode:"wait",children:(0,zr.jsxs)(Ho.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,zr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,zr.jsxs)(h,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,zr.jsx)(gt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,zr.jsx)("p",{className:"text-muted-foreground",children:"Choose a user zr add as a colleague"})]})]}),(0,zr.jsx)(V,{className:"container",children:(0,zr.jsx)(le,{className:"gt-6",children:(0,zr.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,zr.jsx)("div",{className:"flex-1",children:(0,zr.jsxs)("div",{className:"relative",children:[(0,zr.jsx)(gt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,zr.jsx)(j,{placeholder:"Search users by name, email, role, or skills...",value:d,onChange:s=>o(s.target.value),className:"pl-9"})]})})})})}),(0,zr.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:n.map(s=>(0,zr.jsx)(Ho.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,zr.jsxs)(V,{className:`cursor-pointer transition-all hover:shadow-lg ${r===s.id?"ring-2 ring-primary":""}`,onClick:()=>c(s),children:[(0,zr.jsx)(De,{className:"pb-3",children:(0,zr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,zr.jsxs)(Ft,{children:[(0,zr.jsx)(Ia,{src:s.avatar,alt:s.name}),(0,zr.jsx)(Bt,{children:(0,zr.jsx)(gt.User,{className:"h-4 w-4"})})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)(Ie,{className:"text-lg",children:s.name}),(0,zr.jsx)("p",{className:"text-sm text-muted-foreground",children:s.role})]})]}),r===s.id&&(0,zr.jsx)(gt.Check,{className:"h-5 w-5 text-primary"})]})}),(0,zr.jsx)(le,{className:"gt-0",children:(0,zr.jsxs)("div",{className:"space-y-3",children:[(0,zr.jsxs)("div",{children:[(0,zr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,zr.jsx)("p",{className:"text-sm font-medium",children:s.email})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"}),(0,zr.jsx)(te,{variant:"secondary",children:s.department})]}),s.location&&(0,zr.jsxs)("div",{children:[(0,zr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Location"}),(0,zr.jsx)("p",{className:"text-sm",children:s.location})]}),s.skills&&s.skills.length>0&&(0,zr.jsxs)("div",{children:[(0,zr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Skills"}),(0,zr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[s.skills.slice(0,3).map(p=>(0,zr.jsx)(te,{variant:"outline",className:"text-xs",children:p},p)),s.skills.length>3&&(0,zr.jsxs)(te,{variant:"outline",className:"text-xs",children:["+",s.skills.length-3]})]})]})]})})]})},s.id))}),n.length===0&&(0,zr.jsx)(V,{className:"container mt-4",children:(0,zr.jsx)(le,{className:"gt-6",children:(0,zr.jsxs)("div",{className:"text-center py-8",children:[(0,zr.jsx)(gt.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,zr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,zr.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function ri({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:r}){let[d,o]=(0,Ot.useState)(""),[n,c]=(0,Ot.useState)("all"),s=(0,Ot.useMemo)(()=>e.filter(g=>{let u=g.name.toLowerCase().includes(d.toLowerCase())||g.jobDescription.toLowerCase().includes(d.toLowerCase())||g.capabilities.some(S=>S.toLowerCase().includes(d.toLowerCase()))||g.workInstructions.toLowerCase().includes(d.toLowerCase()),f=n==="all"||g.status===n;return u&&f}),[e,d,n]),p=g=>{let u={...g,id:`${g.id}-clone-${Date.now()}`,name:`${g.name} (Copy)`,joinedDate:new Date,lastActive:new Date,lastUpdated:new Date,version:"1.0.0"};t(u)},l=g=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(g);return(0,zr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,zr.jsx)(Ho.AnimatePresence,{mode:"wait",children:(0,zr.jsxs)(Ho.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,zr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,zr.jsxs)(h,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,zr.jsx)(gt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,zr.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague zr clone"})]})]}),(0,zr.jsx)(V,{children:(0,zr.jsx)(le,{className:"gt-6",children:(0,zr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,zr.jsx)("div",{className:"flex-1",children:(0,zr.jsxs)("div",{className:"relative",children:[(0,zr.jsx)(gt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,zr.jsx)(j,{placeholder:"Search by name, job description, or capabilities...",value:d,onChange:g=>o(g.target.value),className:"pl-9"})]})}),(0,zr.jsxs)("select",{value:n,onChange:g=>c(g.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,zr.jsx)("option",{value:"all",children:"All Status"}),(0,zr.jsx)("option",{value:"active",children:"Active"}),(0,zr.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,zr.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:s.map(g=>(0,zr.jsx)(Ho.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,zr.jsxs)(V,{className:`cursor-pointer transition-all hover:shadow-lg ${r===g.id?"ring-2 ring-primary":""}`,onClick:()=>p(g),children:[(0,zr.jsx)(De,{className:"pb-3",children:(0,zr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,zr.jsx)(Ft,{children:(0,zr.jsx)(Bt,{className:"bg-blue-100",children:(0,zr.jsx)(gt.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,zr.jsxs)("div",{children:[(0,zr.jsxs)(Ie,{className:"text-lg flex items-center gap-2",children:[g.name,(0,zr.jsx)(te,{variant:g.status==="active"?"default":"secondary",className:"text-xs",children:g.status})]}),(0,zr.jsxs)("p",{className:"text-sm text-muted-foreground",children:["v",g.version]})]})]}),(0,zr.jsxs)(h,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:u=>{u.stopPropagation(),p(g)},children:[(0,zr.jsx)(gt.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,zr.jsx)(le,{className:"gt-0",children:(0,zr.jsxs)("div",{className:"space-y-3",children:[(0,zr.jsxs)("div",{children:[(0,zr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,zr.jsx)("p",{className:"text-sm line-clamp-2",children:g.jobDescription})]}),g.capabilities&&g.capabilities.length>0&&(0,zr.jsxs)("div",{children:[(0,zr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,zr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[g.capabilities.slice(0,3).map(u=>(0,zr.jsx)(te,{variant:"outline",className:"text-xs",children:u},u)),g.capabilities.length>3&&(0,zr.jsxs)(te,{variant:"outline",className:"text-xs",children:["+",g.capabilities.length-3]})]})]}),(0,zr.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,zr.jsx)(gt.Calendar,{className:"h-3 w-3"}),(0,zr.jsxs)("span",{children:["Updated ",l(g.lastUpdated)]})]}),g.knowledge&&(0,zr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,zr.jsx)(gt.Users,{className:"h-3 w-3"}),(0,zr.jsxs)("span",{children:[g.knowledge.length," docs"]})]})]}),g.workInstructions&&(0,zr.jsxs)("div",{children:[(0,zr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,zr.jsx)("p",{className:"text-xs line-clamp-2",children:g.workInstructions})]})]})})]})},g.id))}),s.length===0&&(0,zr.jsx)(V,{children:(0,zr.jsx)(le,{className:"gt-6",children:(0,zr.jsxs)("div",{className:"text-center py-8",children:[(0,zr.jsx)(gt.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,zr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,zr.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function ii({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,zr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,zr.jsx)(Ho.AnimatePresence,{mode:"wait",children:(0,zr.jsxs)(Ho.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,zr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,zr.jsxs)(h,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,zr.jsx)(gt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,zr.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague zr add"})]})]}),(0,zr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,zr.jsx)(Ho.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,zr.jsxs)(V,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,zr.jsxs)(De,{className:"text-center pb-4",children:[(0,zr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,zr.jsx)(gt.User,{className:"h-8 w-8 text-blue-600"})}),(0,zr.jsx)(Ie,{className:"text-xl",children:"Add Human Colleague"})]}),(0,zr.jsxs)(le,{className:"text-center",children:[(0,zr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization zr add as team members."}),(0,zr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,zr.jsx)(gt.Users,{className:"h-4 w-4 text-blue-600"}),(0,zr.jsx)("span",{children:"Browse existing users"})]}),(0,zr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,zr.jsx)(gt.User,{className:"h-4 w-4 text-blue-600"}),(0,zr.jsx)("span",{children:"Import user details automatically"})]})]}),(0,zr.jsx)(h,{className:"mt-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,zr.jsx)(Ho.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,zr.jsxs)(V,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,zr.jsxs)(De,{className:"text-center pb-4",children:[(0,zr.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,zr.jsx)(gt.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,zr.jsx)(Ie,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,zr.jsxs)(le,{className:"text-center",children:[(0,zr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague or create a new AI assistant for your team."}),(0,zr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,zr.jsx)(gt.Bot,{className:"h-4 w-4 text-purple-600"}),(0,zr.jsx)("span",{children:"Clone existing colleagues"})]}),(0,zr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,zr.jsx)(gt.Users,{className:"h-4 w-4 text-purple-600"}),(0,zr.jsx)("span",{children:"Create from templates"})]})]}),(0,zr.jsx)(h,{className:"mt-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function si({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,zr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,zr.jsx)(Ho.AnimatePresence,{mode:"wait",children:(0,zr.jsxs)(Ho.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,zr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,zr.jsxs)(h,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,zr.jsx)(gt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,zr.jsx)("p",{className:"text-muted-foreground",children:"Choose how zr create your digital colleague"})]})]}),(0,zr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,zr.jsx)(Ho.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,zr.jsxs)(V,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,zr.jsxs)(De,{className:"text-center pb-4",children:[(0,zr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,zr.jsx)(gt.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,zr.jsx)(Ie,{className:"text-xl",children:"Clone Existing"})]}),(0,zr.jsxs)(le,{className:"text-center",children:[(0,zr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize zr for your needs."}),(0,zr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,zr.jsx)(gt.Bot,{className:"h-4 w-4 text-blue-600"}),(0,zr.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,zr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,zr.jsx)(gt.Copy,{className:"h-4 w-4 text-blue-600"}),(0,zr.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,zr.jsx)(h,{className:"mt-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,zr.jsx)(Ho.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,zr.jsxs)(V,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,zr.jsxs)(De,{className:"text-center pb-4",children:[(0,zr.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,zr.jsx)(gt.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,zr.jsx)(Ie,{className:"text-xl",children:"Create New"})]}),(0,zr.jsxs)(le,{className:"text-center",children:[(0,zr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,zr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,zr.jsx)(gt.Plus,{className:"h-4 w-4 text-green-600"}),(0,zr.jsx)("span",{children:"Custom job description"})]}),(0,zr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,zr.jsx)(gt.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,zr.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,zr.jsx)(h,{className:"mt-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}function ni(e,t){let[a,r]=(0,Ot.useState)(()=>{if(typeof window>"u")return t;try{let o=window.localStorage.getItem(e);return o?JSON.parse(o):t}catch{return t}}),d=o=>{try{r(o),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(o))}catch{}};return(0,Ot.useEffect)(()=>{d(a)},[]),[a,d]}var mo=require("react-icons/Ho");function Ze({title:e,description:t,badge:a,primaryAction:r,secondaryAction:d,gradient:o,children:n,className:c}){let[s,p]=ni(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!d&&!t),l=!d&&!t||s;return(0,zr.jsxs)(Ho.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${o} p-8 text-white ${c||""}`,children:[(0,zr.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,zr.jsx)(te,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,zr.jsx)("h2",{className:"text-3xl font-bold zr-0",children:e})]}),(0,zr.jsxs)("div",{className:"flex items-center gap-3",children:[l&&r&&(0,zr.jsx)(h,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:r.onClick,children:r.label}),(d||t)&&(0,zr.jsx)("button",{"aria-label":s?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>p(!s),style:{lineHeight:0},children:s?(0,zr.jsx)(mo.FaChevronDown,{size:22}):(0,zr.jsx)(mo.FaChevronUp,{size:22})})]})]}),!l&&(0,zr.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,zr.jsxs)("div",{className:"space-y-4",children:[(0,zr.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,zr.jsxs)("div",{className:"flex flex-wrap gap-3",children:[r&&(0,zr.jsx)(h,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:r.onClick,children:r.label}),d&&(0,zr.jsx)(h,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:d.onClick,children:d.label})]})]}),n&&(0,zr.jsx)("div",{className:"hidden lg:block",children:n})]})]})}function _o({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:r,compactView:d=!1,departments:o=["Design","Engineering","Marketing","Product","Sales","Operations"],className:n,availableUsers:c=[],existingDigitalColleagues:s=[]}){let[p,l]=(0,Ot.useState)(e||[]),[g,u]=(0,Ot.useState)(""),[f,S]=(0,Ot.useState)("all"),[P,v]=(0,Ot.useState)("all"),[I,w]=(0,Ot.useState)("all"),[y,E]=(0,Ot.useState)(null),[O,G]=(0,Ot.useState)(null),[pe,x]=(0,Ot.useState)("main"),k=p.filter(T=>{let He=T.name.toLowerCase().includes(g.toLowerCase())||T.type==="human"&&(T.email.toLowerCase().includes(g.toLowerCase())||T.role.toLowerCase().includes(g.toLowerCase()))||T.type==="digital"&&T.jobDescription.toLowerCase().includes(g.toLowerCase()),Le=f==="all"||T.type==="human"&&T.department===f,qt=P==="all"||T.status===P;return He&&Le&&qt}),z=k.filter(T=>T.type==="human"),he=k.filter(T=>T.type==="digital"),F=()=>{x("typeSelection")},D=T=>{T.type==="digital"&&(E(T),x("form"))},ee=T=>{T.type==="digital"&&(G(T),x("view"))},Re=T=>{let He={id:`human-${Date.now()}`,type:"human",name:T.name,email:T.email,role:T.role,department:T.department,phone:T.phone,location:T.location,timezone:T.timezone,skills:T.skills,bio:T.bio,status:"active",joinedDate:new Date,lastActive:new Date};l(Le=>[...Le,He]),t?.(He),x("main")},ct=T=>{l(He=>[...He,T]),t?.(T),x("main")},mt=()=>{E(null),x("form")},ze=T=>{y?(l(He=>He.map(Le=>Le.id===T.id?T:Le)),a?.(T)):(l(He=>[...He,T]),t?.(T)),x("main"),E(null)},$e=()=>{x("main"),E(null),G(null)},L=()=>{x("main"),G(null)},ae=()=>{O&&(E(O),G(null),x("form"))},Ne=T=>{l(He=>He.filter(Le=>Le.id!==T)),r?.(T)},tt=()=>{u(""),S("all"),v("all")},bt=()=>{let T=[];return s.forEach(Le=>{T.push(...Le.knowledge,...Le.coreKnowledge)}),p.forEach(Le=>{Le.type==="digital"&&T.push(...Le.knowledge,...Le.coreKnowledge)}),T.filter((Le,qt,Ga)=>qt===Ga.findIndex(Sa=>Sa.id===Le.id))};return pe==="typeSelection"?(0,zr.jsx)(ii,{onSelectHuman:()=>x("userSelection"),onSelectDigital:()=>x("digitalOptions"),onCancel:()=>x("main")}):pe==="userSelection"?(0,zr.jsx)(oi,{users:c,onUserSelect:Re,onCancel:()=>x("typeSelection")}):pe==="digitalOptions"?(0,zr.jsx)(si,{onCloneExisting:()=>x("digitalClone"),onCreateNew:mt,onCancel:()=>x("typeSelection")}):pe==="digitalClone"?(0,zr.jsx)(ri,{digitalColleagues:s,onColleagueClone:ct,onCancel:()=>x("digitalOptions")}):pe==="form"?(0,zr.jsx)(Ko,{colleague:y||void 0,onSave:ze,onCancel:$e,availableKnowledgeDocuments:bt()}):pe==="view"?(0,zr.jsx)(Ko,{colleague:O||void 0,onSave:ze,onCancel:L,readOnly:!0,availableKnowledgeDocuments:bt()}):(0,zr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,zr.jsx)(Ho.AnimatePresence,{mode:"wait",children:(0,zr.jsx)(Ho.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,zr.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,zr.jsx)(Ze,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-zr-r from-green-600 via-emerald-600 zr-teal-600",primaryAction:{label:"Add colleague",onClick:F}}),(0,zr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,zr.jsxs)(V,{children:[(0,zr.jsxs)(De,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,zr.jsx)(Ie,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,zr.jsx)(gt.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,zr.jsxs)(le,{children:[(0,zr.jsx)("div",{className:"text-2xl font-bold",children:p.length}),(0,zr.jsxs)("p",{className:"text-xs text-muted-foreground",children:[p.filter(T=>T.status==="active").length," active"]})]})]}),(0,zr.jsxs)(V,{children:[(0,zr.jsxs)(De,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,zr.jsx)(Ie,{className:"text-sm font-medium",children:"Human Members"}),(0,zr.jsx)(gt.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,zr.jsxs)(le,{children:[(0,zr.jsx)("div",{className:"text-2xl font-bold",children:p.filter(T=>T.type==="human").length}),(0,zr.jsxs)("p",{className:"text-xs text-muted-foreground",children:[p.filter(T=>T.type==="human"&&T.status==="active").length," active"]})]})]}),(0,zr.jsxs)(V,{children:[(0,zr.jsxs)(De,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,zr.jsx)(Ie,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,zr.jsx)(gt.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,zr.jsxs)(le,{children:[(0,zr.jsx)("div",{className:"text-2xl font-bold",children:p.filter(T=>T.type==="digital").length}),(0,zr.jsxs)("p",{className:"text-xs text-muted-foreground",children:[p.filter(T=>T.type==="digital"&&T.status==="active").length," active"]})]})]})]}),(0,zr.jsx)(V,{children:(0,zr.jsx)(le,{className:"gt-6",children:(0,zr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,zr.jsx)("div",{className:"flex-1",children:(0,zr.jsxs)("div",{className:"relative",children:[(0,zr.jsx)(gt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,zr.jsx)(j,{placeholder:"Search colleagues...",value:g,onChange:T=>u(T.target.value),className:"pl-9"})]})}),(0,zr.jsxs)(Se,{value:f,onValueChange:S,children:[(0,zr.jsx)(ye,{className:"w-full md:w-[180px]",children:(0,zr.jsx)(ke,{placeholder:"Department"})}),(0,zr.jsxs)(we,{children:[(0,zr.jsx)($,{value:"all",children:"All Departments"}),o.map(T=>(0,zr.jsx)($,{value:T,children:T},T))]})]}),(0,zr.jsxs)(Se,{value:P,onValueChange:v,children:[(0,zr.jsx)(ye,{className:"w-full md:w-[140px]",children:(0,zr.jsx)(ke,{placeholder:"Status"})}),(0,zr.jsxs)(we,{children:[(0,zr.jsx)($,{value:"all",children:"All Status"}),(0,zr.jsx)($,{value:"active",children:"Active"}),(0,zr.jsx)($,{value:"inactive",children:"Inactive"})]})]}),(g||f!=="all"||P!=="all")&&(0,zr.jsxs)(h,{variant:"outline",onClick:tt,className:"gap-2",children:[(0,zr.jsx)(gt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,zr.jsxs)("div",{className:"space-y-4",children:[(0,zr.jsx)(ro,{activeTab:I,onTabChange:w,tabOptions:[{value:"all",label:`All (${k.length})`},{value:"human",label:`Human (${z.length})`},{value:"digital",label:`Digital (${he.length})`}],maxWidth:"400px",gridCols:3}),I==="all"&&(0,zr.jsx)("div",{className:`grid gap-4 ${d?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:k.map(T=>(0,zr.jsx)(no,{colleague:T,onEdit:D,onDelete:Ne,onViewDetails:ee,compact:d},T.id))}),I==="human"&&(0,zr.jsx)("div",{className:`grid gap-4 ${d?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:z.map(T=>(0,zr.jsx)(no,{colleague:T,onEdit:D,onDelete:Ne,onViewDetails:ee,compact:d},T.id))}),I==="digital"&&(0,zr.jsx)("div",{className:`grid gap-4 ${d?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:he.map(T=>(0,zr.jsx)(no,{colleague:T,onEdit:D,onDelete:Ne,onViewDetails:ee,compact:d},T.id))})]}),k.length===0&&(0,zr.jsx)(V,{children:(0,zr.jsx)(le,{className:"gt-6",children:(0,zr.jsxs)("div",{className:"text-center py-8",children:[(0,zr.jsx)(gt.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,zr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,zr.jsx)("p",{className:"text-muted-foreground mb-4",children:g||f!=="all"||P!=="all"?"Try adjusting your filters zr see more results.":"Get started by adding your first colleague."}),(0,zr.jsxs)(h,{onClick:F,className:"gap-2",children:[(0,zr.jsx)(gt.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}function uo({files:e,onFileClick:t,onFileEdit:a,onFileDelete:r,showHeader:d=!0,className:o}){return(0,zr.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${o||""}`,children:[d&&(0,zr.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,zr.jsx)("div",{className:"col-span-6",children:"Name"}),(0,zr.jsx)("div",{className:"col-span-2",children:"Size"}),(0,zr.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,zr.jsx)("div",{className:"divide-y",children:e.map(n=>(0,zr.jsxs)(Ho.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(n),children:[(0,zr.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,zr.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted",children:n.icon}),(0,zr.jsx)("div",{children:(0,zr.jsx)("p",{className:"font-medium",children:n.name})})]}),(0,zr.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:n.size}),(0,zr.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,zr.jsx)("span",{className:"text-sm md:text-base",children:n.modified}),(0,zr.jsxs)("div",{className:"flex gap-1",children:[(0,zr.jsx)(h,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:c=>{c.stopPropagation(),a?.(n)},children:(0,zr.jsx)(gt.Edit,{className:"h-4 w-4"})}),(0,zr.jsx)(h,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:c=>{c.stopPropagation(),r?.(n)},children:(0,zr.jsx)(gt.Trash2,{className:"h-4 w-4"})}),(0,zr.jsx)(h,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",children:(0,zr.jsx)(gt.MoreHorizontal,{className:"h-4 w-4"})})]})]})]},n.name))})]})}function ja({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:r,onFileClick:d,compactView:o=!1,className:n}){let[c,s]=(0,Ot.useState)(e),[p,l]=(0,Ot.useState)(""),[g,u]=(0,Ot.useState)("all"),[f,S]=(0,Ot.useState)("all"),P=Array.from(new Set(c.map(x=>x.app))),v=c.filter(x=>{let k=x.name.toLowerCase().includes(p.toLowerCase()),z=g==="all"||x.app===g;return k&&z}),I=v.slice(0,10),w=v.filter(x=>x.shared),y=()=>{console.log("Add file clicked")},E=x=>{console.log("Edit file:",x.name),a?.(x)},O=x=>{s(k=>k.filter(z=>z.name!==x.name)),r?.(x.name)},G=x=>{console.log("File clicked:",x.name),d?.(x)},pe=()=>{l(""),u("all")};return(0,zr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,zr.jsx)(Ho.AnimatePresence,{mode:"wait",children:(0,zr.jsx)(Ho.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,zr.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,zr.jsx)(Ze,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-zr-r from-blue-600 via-indigo-600 zr-purple-600",primaryAction:{label:"Upload file",onClick:y},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,zr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,zr.jsxs)(V,{children:[(0,zr.jsxs)(De,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,zr.jsx)(Ie,{className:"text-sm font-medium",children:"Total Files"}),(0,zr.jsx)(gt.File,{className:"h-4 w-4 text-muted-foreground"})]}),(0,zr.jsxs)(le,{children:[(0,zr.jsx)("div",{className:"text-2xl font-bold",children:c.length}),(0,zr.jsxs)("p",{className:"text-xs text-muted-foreground",children:[c.filter(x=>x.shared).length," shared"]})]})]}),(0,zr.jsxs)(V,{children:[(0,zr.jsxs)(De,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,zr.jsx)(Ie,{className:"text-sm font-medium",children:"Storage Used"}),(0,zr.jsx)(gt.File,{className:"h-4 w-4 text-muted-foreground"})]}),(0,zr.jsxs)(le,{children:[(0,zr.jsx)("div",{className:"text-2xl font-bold",children:"2.4 GB"}),(0,zr.jsx)("p",{className:"text-xs text-muted-foreground",children:"of 10 GB used"})]})]}),(0,zr.jsxs)(V,{children:[(0,zr.jsxs)(De,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,zr.jsx)(Ie,{className:"text-sm font-medium",children:"Recent Activity"}),(0,zr.jsx)(gt.File,{className:"h-4 w-4 text-muted-foreground"})]}),(0,zr.jsxs)(le,{children:[(0,zr.jsx)("div",{className:"text-2xl font-bold",children:"12"}),(0,zr.jsx)("p",{className:"text-xs text-muted-foreground",children:"files modified today"})]})]})]}),(0,zr.jsx)(V,{children:(0,zr.jsx)(le,{className:"gt-6",children:(0,zr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,zr.jsx)("div",{className:"flex-1",children:(0,zr.jsxs)("div",{className:"relative",children:[(0,zr.jsx)(gt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,zr.jsx)(j,{placeholder:"Search files...",value:p,onChange:x=>l(x.target.value),className:"pl-9"})]})}),(0,zr.jsxs)(Se,{value:g,onValueChange:u,children:[(0,zr.jsx)(ye,{className:"w-full md:w-[180px]",children:(0,zr.jsx)(ke,{placeholder:"Filter by app"})}),(0,zr.jsxs)(we,{children:[(0,zr.jsx)($,{value:"all",children:"All Apps"}),P.map(x=>(0,zr.jsx)($,{value:x,children:x},x))]})]}),(p||g!=="all")&&(0,zr.jsxs)(h,{variant:"outline",onClick:pe,className:"gap-2",children:[(0,zr.jsx)(gt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,zr.jsxs)("div",{className:"space-y-4",children:[(0,zr.jsx)(ro,{activeTab:f,onTabChange:S,tabOptions:[{value:"all",label:`All Files (${v.length})`},{value:"recent",label:`Recent (${I.length})`},{value:"shared",label:`Shared (${w.length})`}],maxWidth:"500px",gridCols:3}),f==="all"&&(0,zr.jsx)(uo,{files:v,onFileClick:G,onFileEdit:E,onFileDelete:O,showHeader:!o}),f==="recent"&&(0,zr.jsx)(uo,{files:I,onFileClick:G,onFileEdit:E,onFileDelete:O,showHeader:!o}),f==="shared"&&(0,zr.jsx)(uo,{files:w,onFileClick:G,onFileEdit:E,onFileDelete:O,showHeader:!o})]}),v.length===0&&(0,zr.jsx)(V,{children:(0,zr.jsx)(le,{className:"gt-6",children:(0,zr.jsxs)("div",{className:"text-center py-8",children:[(0,zr.jsx)(gt.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,zr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,zr.jsx)("p",{className:"text-muted-foreground mb-4",children:p||g!=="all"?"Try adjusting your filters zr see more results.":"Get started by uploading your first file."}),(0,zr.jsxs)(h,{onClick:y,className:"gap-2",children:[(0,zr.jsx)(gt.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")})})}function mi({document:e,onSave:t,onCancel:a,availableDocuments:r=[],knowledgeContexts:d=[]}){let[o,n]=(0,Ot.useState)({...e,updatedAt:new Date}),[c,s]=(0,Ot.useState)(!1),[p,l]=(0,Ot.useState)(!1),g=()=>{let y=new Set,E=new Set;return d.forEach(O=>{O.menuConfig.groupBy.forEach(G=>y.add(G))}),r.forEach(O=>{O.metadata&&Object.keys(O.metadata).forEach(G=>E.add(G))}),{contextKeys:Array.from(y).sort(),documentKeys:Array.from(E).sort(),allKeys:Array.from(new Set([...y,...E])).sort()}},u=y=>{let E=new Set;return r.forEach(O=>{O.metadata?.[y]&&E.add(String(O.metadata[y]))}),Array.from(E).sort()},f=g(),S=()=>{t(o)},P=(y,E)=>{n(O=>({...O,metadata:{...O.metadata,[y]:E}}))},v=(y,E)=>{E==="__custom__"?P(y,""):P(y,E)},I=()=>{let y=`field_${Date.now()}`;P(y,"")},w=y=>{n(E=>{let O={...E.metadata};return delete O[y],{...E,metadata:O}})};return(0,zr.jsxs)(Ho.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,zr.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,zr.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-6",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,zr.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-primary/10 border border-primary/20",children:(0,zr.jsx)(gt.Edit3,{className:"h-6 w-6 text-primary"})}),(0,zr.jsx)("div",{className:"flex-1 min-w-0",children:p?(0,zr.jsx)(j,{value:o.title,onChange:y=>n(E=>({...E,title:y.target.value})),onBlur:()=>l(!1),onKeyDown:y=>{y.key==="Enter"&&l(!1),y.key==="Escape"&&(n(E=>({...E,title:e.title})),l(!1))},autoFocus:!0,className:"text-xl font-bold border-none p-0 h-auto bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0",placeholder:"Document title..."}):(0,zr.jsxs)("div",{className:"flex items-center gap-2 group",children:[(0,zr.jsx)("h1",{className:"text-xl font-bold text-foreground cursor-pointer hover:text-primary transition-colors py-1",onClick:()=>l(!0),title:"Click zr edit title",children:o.title||"Untitled Document"}),(0,zr.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>l(!0),className:"opacity-0 group-hover:opacity-100 transition-opacity h-6 w-6 p-0",children:(0,zr.jsx)(gt.Edit3,{className:"h-3 w-3"})})]})})]}),(0,zr.jsxs)("div",{className:"flex gap-2",children:[(0,zr.jsxs)(h,{variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[(0,zr.jsx)(gt.zr,{className:"h-4 w-4"}),"Cancel"]}),(0,zr.jsxs)(h,{size:"sm",onClick:S,className:"gap-2",children:[(0,zr.jsx)(gt.Save,{className:"h-4 w-4"}),"Save Changes"]})]})]}),(0,zr.jsxs)("div",{className:"space-y-4",children:[(0,zr.jsxs)("div",{children:[(0,zr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-1",children:"Description"}),(0,zr.jsx)(j,{value:o.description||"",onChange:y=>n(E=>({...E,description:y.target.value})),placeholder:"Brief description...",className:"text-sm"})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsxs)("button",{type:"button",onClick:()=>s(!c),className:"flex items-center justify-between w-full p-3 bg-muted/20 hover:bg-muted/30 rounded-lg border border-border transition-colors",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-2",children:[c?(0,zr.jsx)(gt.ChevronDown,{className:"h-4 w-4 text-muted-foreground"}):(0,zr.jsx)(gt.ChevronRight,{className:"h-4 w-4 text-muted-foreground"}),(0,zr.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Metadata"}),o.metadata&&Object.keys(o.metadata).length>0&&(0,zr.jsxs)("span",{className:"text-xs bg-primary/10 text-primary px-2 py-1 rounded-full",children:[Object.keys(o.metadata).length," field",Object.keys(o.metadata).length!==1?"s":""]})]}),(0,zr.jsxs)("div",{className:"flex items-center gap-2",children:[f.contextKeys.length>0&&!c&&(0,zr.jsxs)("span",{className:"text-xs text-muted-foreground",children:[f.contextKeys.slice(0,2).join(", "),f.contextKeys.length>2&&"..."]}),(0,zr.jsxs)(h,{type:"button",variant:"ghost",size:"sm",onClick:y=>{y.stopPropagation(),I(),s(!0)},className:"gap-1 h-6 px-2",children:[(0,zr.jsx)(gt.Plus,{className:"h-3 w-3"}),"Add"]})]})]}),c&&(0,zr.jsx)("div",{className:"mt-3 space-y-2 pl-6",children:o.metadata&&Object.keys(o.metadata).length>0?Object.entries(o.metadata).map(([y,E])=>{let O=u(y);return(0,zr.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,zr.jsx)(j,{value:y,onChange:G=>{let pe=G.target.value,x=o.metadata?.[y];n(k=>{let z={...k.metadata};return delete z[y],pe&&(z[pe]=x||""),{...k,metadata:z}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${y}`}),(0,zr.jsx)("datalist",{id:`metadata-keys-${y}`,children:f.allKeys.map(G=>(0,zr.jsx)("option",{value:G},G))}),(0,zr.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),O.length>0?(0,zr.jsxs)(Se,{value:String(E||""),onValueChange:G=>v(y,G),children:[(0,zr.jsx)(ye,{className:"flex-1 h-8 text-sm",children:(0,zr.jsx)(ke,{placeholder:"Value"})}),(0,zr.jsxs)(we,{children:[O.map(G=>(0,zr.jsx)($,{value:G,children:G},G)),(0,zr.jsx)($,{value:"__custom__",children:(0,zr.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,zr.jsx)(j,{value:String(E||""),onChange:G=>P(y,G.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,zr.jsx)(h,{type:"button",variant:"ghost",size:"sm",onClick:()=>w(y),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,zr.jsx)(gt.zr,{className:"h-3 w-3"})})]},y)}):(0,zr.jsx)("div",{className:"text-center py-3 border border-dashed border-border rounded-lg bg-muted/10",children:(0,zr.jsx)("p",{className:"text-xs text-muted-foreground",children:"No metadata fields yet"})})})]}),(0,zr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zr.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Format:"}),(0,zr.jsx)(te,{variant:"secondary",className:"font-mono",children:o.format.toUpperCase()})]})]})]}),(0,zr.jsx)("div",{className:"flex-1 overflow-auto",children:(0,zr.jsxs)("div",{className:"p-8",children:[(0,zr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-4",children:"Content"}),(0,zr.jsx)(Pe,{value:o.content||"",onChange:y=>n(E=>({...E,content:y.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}var fi=e=>(0,zr.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:e.replace(/\n/g,"<Ot>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`(.*?)`/g,'<code class="bg-muted px-1 py-0.5 rounded text-sm">$1</code>').replace(/^# (.*$)/gm,'<h1 class="text-2xl font-bold mb-4">$1</h1>').replace(/^## (.*$)/gm,'<h2 class="text-xl font-semibold mb-3">$1</h2>').replace(/^### (.*$)/gm,'<h3 class="text-lg font-medium mb-2">$1</h3>')}}),pi=e=>(0,zr.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),Ln=e=>(0,zr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,zr.jsx)("div",{className:"bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-lg p-4 mb-4",children:(0,zr.jsxs)("p",{className:"text-amber-800 dark:text-amber-200 text-sm",children:[(0,zr.jsx)("strong",{children:"RichText Renderer:"})," This is a placeholder. Integrate with @payloadcms/richtext-lexical for full rendering."]})}),(0,zr.jsx)("pre",{className:"text-sm",children:e})]}),jn=e=>(0,zr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,zr.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,zr.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,zr.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),fi(e)]});function vi({document:e,onDocumentUpdate:t,editable:a=!0,renderers:r,availableDocuments:d=[],knowledgeContexts:o=[]}){let[n,c]=(0,Ot.useState)(!1),s=f=>{switch(f){case"markdown":case"mdx":return(0,zr.jsx)(gt.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,zr.jsx)(gt.File,{className:"h-6 w-6 text-success"});case"text":return(0,zr.jsx)(gt.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,zr.jsx)(gt.File,{className:"h-6 w-6 text-muted-foreground"})}},p=f=>{switch(f){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"}},l=(f,S)=>{let P={markdown:fi,mdx:jn,richtext:Ln,text:pi},v=r?.[S]||P[S];return v?v(f):pi(f)},g=f=>{c(!1),t?.(f)},u=()=>{c(!1)};return n?(0,zr.jsx)(mi,{document:e,onSave:g,onCancel:u,availableDocuments:d,knowledgeContexts:o}):(0,zr.jsxs)(Ho.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,zr.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,zr.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,zr.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,zr.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-muted border border-border",children:s(e.format)}),(0,zr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,zr.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:e.title}),e.description&&(0,zr.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed mb-4",children:e.description})]})]}),a&&(0,zr.jsx)("div",{className:"flex-shrink-0",children:(0,zr.jsxs)(h,{variant:"outline",size:"sm",onClick:()=>c(!0),className:"gap-2",children:[(0,zr.jsx)(gt.Edit3,{className:"h-4 w-4"}),"Edit"]})})]}),(0,zr.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,zr.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${p(e.format)}`,children:e.format.toUpperCase()}),e.tags?.map(f=>(0,zr.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-muted text-muted-foreground border border-border",children:["#",f]},f))]})]}),(0,zr.jsx)("div",{className:"flex-1 overflow-auto",children:(0,zr.jsxs)("div",{className:"p-8",children:[e.metadata&&Object.keys(e.metadata).length>0&&(0,zr.jsxs)("div",{className:"mb-6",children:[(0,zr.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Metadata"}),(0,zr.jsx)("div",{className:"bg-muted rounded-lg p-3 border border-border",children:(0,zr.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-4 gap-y-1 text-xs",children:Object.entries(e.metadata).map(([f,S])=>(0,zr.jsxs)("div",{className:"flex gap-1",children:[(0,zr.jsxs)("span",{className:"text-muted-foreground font-medium",children:[f.replace(/([A-zr])/g," $1").trim(),":"]}),(0,zr.jsx)("span",{className:"text-foreground truncate",children:String(S)})]},f))})})]}),(0,zr.jsx)("div",{className:"space-y-4",children:e.content?(0,zr.jsx)("div",{className:"relative",children:(0,zr.jsx)("div",{className:"bg-card border border-border rounded-xl p-6 overflow-hidden",children:l(e.content,e.format)})}):(0,zr.jsxs)("div",{className:"text-center py-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,zr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,zr.jsx)(gt.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,zr.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,zr.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})]})})]})}function bi({label:e,documents:t,children:a,level:r,onDocumentClick:d,selectedDocumentId:o,showDocumentCount:n=!0}){let[c,s]=(0,Ot.useState)(r===0),p=a&&Object.keys(a).length>0,l=t.length+(a?Object.values(a).reduce((f,S)=>f+S.documents.length,0):0),g=f=>{switch(f){case"markdown":case"mdx":return(0,zr.jsx)(gt.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richtext":return(0,zr.jsx)(gt.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,zr.jsx)(gt.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},u=f=>{let S=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return S[f%S.length]};return(0,zr.jsxs)("div",{className:"space-y-1",children:[(p||t.length>0)&&(0,zr.jsxs)(Ho.motion.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${c?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${r*20}px`},onClick:()=>s(!c),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,zr.jsx)("div",{className:`w-1 h-6 rounded-full ${u(r)}`}),(0,zr.jsx)(Ho.motion.div,{animate:{rotate:c?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,zr.jsx)(gt.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,zr.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,zr.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,zr.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),n&&l>0&&(0,zr.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,zr.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:l})})]})]}),(0,zr.jsx)(Ho.motion.div,{initial:!1,animate:{height:c?"auto":0,opacity:c?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,zr.jsxs)("div",{className:"gt-2 space-y-1",children:[t.map((f,S)=>(0,zr.jsxs)(Ho.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:S*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${o===f.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${r*20+20}px`},onClick:()=>d?.(f),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,zr.jsx)("div",{className:"flex-shrink-0",children:g(f.format)}),(0,zr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,zr.jsx)("p",{className:`text-sm truncate transition-colors ${o===f.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:f.title}),f.description&&(0,zr.jsx)("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:f.description})]}),f.tags&&f.tags.length>0&&(0,zr.jsx)("div",{className:"flex-shrink-0",children:(0,zr.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs 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,S])=>(0,zr.jsx)(bi,{label:f,documents:S.documents,children:S.children,level:r+1,onDocumentClick:d,selectedDocumentId:o,showDocumentCount:n},f))]})})]})}function hi({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:r,onDocumentUpdate:d,selectedDocumentId:o,className:n,editable:c=!0}){let[s,p]=(0,Ot.useState)(""),[l,g]=(0,Ot.useState)(null),u=(0,Ot.useMemo)(()=>s?e.filter(P=>P.title.toLowerCase().includes(s.toLowerCase())||P.description?.toLowerCase().includes(s.toLowerCase())||P.tags?.some(v=>v.toLowerCase().includes(s.toLowerCase()))||Object.values(P.metadata||{}).some(v=>String(v).toLowerCase().includes(s.toLowerCase()))):e,[e,s]),f=(0,Ot.useMemo)(()=>{let P=(v,I)=>{if(I.length===0)return{};let[w,...y]=I;return v.reduce((O,G)=>{let pe=G.metadata?.[w]||"Uncategorized",x=String(pe);if(O[x]||(O[x]={documents:[],children:{}}),y.length===0)O[x].documents.push(G);else{let k=P([G],y),z=Object.keys(k)[0];z&&(O[x].children||(O[x].children={}),O[x].children[z]?O[x].children[z].documents.push(...k[z].documents):O[x].children[z]=k[z])}return O},{})};return P(u,t.groupBy)},[u,t.groupBy]),S=P=>{g(P),a?.(P)};return(0,zr.jsxs)("div",{className:`flex h-full ${n||""}`,children:[(0,zr.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,zr.jsx)("div",{className:"p-6 border-b border-border",children:(0,zr.jsxs)("div",{className:"relative",children:[(0,zr.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,zr.jsx)(gt.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,zr.jsx)(j,{placeholder:"Search knowledge base...",value:s,onChange:P=>p(P.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,zr.jsx)(Aa,{className:"h-[calc(100%-100px)]",children:(0,zr.jsxs)("div",{className:"p-4 space-y-3",children:[Object.entries(f).map(([P,v])=>(0,zr.jsx)(bi,{label:P,documents:v.documents,children:v.children,level:0,onDocumentClick:S,selectedDocumentId:o,showDocumentCount:t.showDocumentCount},P)),Object.keys(f).length===0&&(0,zr.jsxs)(Ho.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,zr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,zr.jsx)(gt.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,zr.jsx)("p",{className:"text-sm font-medium",children:"No documents found"}),(0,zr.jsx)("p",{className:"text-xs mt-1",children:"Try adjusting your search terms"})]})]})})]}),(0,zr.jsx)("div",{className:"flex-1 bg-background",children:l?(0,zr.jsx)(vi,{document:l,onDocumentUpdate:d,editable:c}):(0,zr.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,zr.jsxs)(Ho.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,zr.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,zr.jsx)(gt.FileText,{className:"h-10 w-10 text-primary"})}),(0,zr.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,zr.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base zr view its content and details"})]})})})]})}function Go({documents:e=[],contexts:t=[],onDocumentClick:a=n=>console.log("Document clicked:",n),onDocumentShare:r=n=>console.log("Share document:",n),onLoadDocumentContent:d,selectedDocumentId:o}){let[n,c]=(0,Ot.useState)(t[0]);return!t||t.length===0?(0,zr.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,zr.jsx)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:(0,zr.jsx)(Ze,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-zr-r from-teal-600 via-cyan-600 zr-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}})}),(0,zr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,zr.jsx)("p",{className:"text-muted-foreground",children:"No contexts available"})})]}):(0,zr.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,zr.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[(0,zr.jsx)(Ze,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-zr-r from-teal-600 via-cyan-600 zr-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}}),(0,zr.jsxs)("div",{className:"mt-6",children:[(0,zr.jsx)("div",{className:"border-b border-border",children:(0,zr.jsx)("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:t.map(s=>(0,zr.jsxs)("button",{onClick:()=>c(s),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${n.id===s.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[s.icon,s.label]},s.id))})}),n.description&&(0,zr.jsx)("div",{className:"mt-3 px-1",children:(0,zr.jsx)("p",{className:"text-sm text-muted-foreground",children:n.description})})]})]}),(0,zr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,zr.jsx)("div",{className:"h-full rounded-3xl border overflow-hidden",children:(0,zr.jsx)(hi,{documents:e,menuConfig:n.menuConfig,onDocumentClick:a,onDocumentShare:r,selectedDocumentId:o})})})]})}var ue=xe(require("react"));var yi=(e=768)=>{let[t,a]=(0,Ot.useState)(!1);return(0,Ot.useEffect)(()=>{let r=()=>{a(window.innerWidth<e)};return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[e]),t};var wi=xe(require("react")),Wo=xe(require("@radix-Ho/react-separator"));var qo=wi.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...r},d)=>(0,zr.jsx)(Wo.Root,{ref:d,decorative:a,orientation:t,className:b("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));qo.displayName=Wo.Root.displayName;var Oa=xe(require("react")),et=xe(require("@radix-Ho/react-dialog"));var Di=et.Root;var On=et.Portal,ki=Oa.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(et.Overlay,{className:b("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}));ki.displayName=et.Overlay.displayName;var zn=(0,jr.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-zr-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-zr-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-zr-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-zr-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Xo=Oa.forwardRef(({side:e="right",className:t,children:a,...r},d)=>(0,zr.jsxs)(On,{children:[(0,zr.jsx)(ki,{}),(0,zr.jsxs)(et.Content,{ref:d,className:b(zn({side:e}),t),...r,children:[(0,zr.jsxs)(et.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,zr.jsx)(ua.Cross2Icon,{className:"h-4 w-4"}),(0,zr.jsx)("span",{className:"sr-only",children:"Close"})]}),a]})]}));Xo.displayName=et.Content.displayName;var Hn=({className:e,...t})=>(0,zr.jsx)("div",{className:b("flex flex-col space-y-2 text-center sm:text-left",e),...t});Hn.displayName="SheetHeader";var Vn=({className:e,...t})=>(0,zr.jsx)("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Vn.displayName="SheetFooter";var $n=Oa.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(et.Title,{ref:a,className:b("text-lg font-semibold text-foreground",e),...t}));$n.displayName=et.Title.displayName;var Un=Oa.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(et.Description,{ref:a,className:b("text-sm text-muted-foreground",e),...t}));Un.displayName=et.Description.displayName;function Jo({className:e,...t}){return(0,zr.jsx)("div",{className:b("animate-pulse rounded-md bg-primary/10",e),...t})}var Ti=xe(require("react")),Pt=xe(require("@radix-Ho/react-tooltip"));var Ri=Pt.Provider,Ei=Pt.Root,Ii=Pt.Trigger,Zo=Ti.forwardRef(({className:e,sideOffset:t=4,...a},r)=>(0,zr.jsx)(Pt.Portal,{children:(0,zr.jsx)(Pt.Content,{ref:r,sideOffset:t,className:b("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));Zo.displayName=Pt.Content.displayName;var Kn="sidebar:state",_n=60*60*24*7,Gn="16rem",Wn="18rem",qn="3rem",Xn="b",Fi=ue.createContext(null);function bo(){let e=ue.useContext(Fi);if(!e)throw new Error("useSidebar must zr used within a SidebarProvider.");return e}var Qo=ue.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:r,style:d,children:o,...n},c)=>{let s=yi(),[p,l]=ue.useState(!1),[g,u]=ue.useState(e),f=t??g,S=ue.useCallback(w=>{if(a)return a?.(typeof w=="function"?w(f):w);u(w),document.cookie=`${Kn}=${f}; path=/; max-age=${_n}`},[a,f]),P=ue.useCallback(()=>s?l(w=>!w):S(w=>!w),[s,S,l]);ue.useEffect(()=>{let w=y=>{y.key===Xn&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),P())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[P]);let v=f?"expanded":"collapsed",I=ue.useMemo(()=>({state:v,open:f,setOpen:S,isMobile:s,openMobile:p,setOpenMobile:l,toggleSidebar:P}),[v,f,S,s,p,l,P]);return(0,zr.jsx)(Fi.Provider,{value:I,children:(0,zr.jsx)(Ri,{delayDuration:0,children:(0,zr.jsx)("div",{style:{"--sidebar-width":Gn,"--sidebar-width-icon":qn,...d},className:b("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...n,children:o})})})});Qo.displayName="SidebarProvider";var Jn=ue.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:r,children:d,...o},n)=>{let{isMobile:c,state:s,openMobile:p,setOpenMobile:l}=bo();return a==="none"?(0,zr.jsx)("div",{className:b("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:n,...o,children:d}):c?(0,zr.jsx)(Di,{open:p,onOpenChange:l,...o,children:(0,zr.jsx)(Xo,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Wn},side:e,children:(0,zr.jsx)("div",{className:"flex h-full w-full flex-col",children:d})})}):(0,zr.jsxs)("div",{ref:n,className:"group peer hidden md:block text-sidebar-foreground","data-state":s,"data-collapsible":s==="collapsed"?a:"","data-variant":t,"data-side":e,children:[(0,zr.jsx)("div",{className:b("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)zr+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,zr.jsx)("div",{className:b("duration-200 fixed top-14 bottom-0 z-10 hidden w-[--sidebar-width] transition-[left,right,width] ease-linear md: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)zr+_theme(spacing.4)zr+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...o,children:(0,zr.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:d})})]})});Jn.displayName="Sidebar";var Yn=ue.forwardRef(({className:e,onClick:t,...a},r)=>{let{toggleSidebar:d}=bo();return(0,zr.jsxs)(h,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:b("h-7 w-7",e),onClick:o=>{t?.(o),d()},...a,children:[(0,zr.jsx)(gt.PanelLeft,{}),(0,zr.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});Yn.displayName="SidebarTrigger";var Zn=ue.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:r}=bo();return(0,zr.jsx)("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:b("absolute inset-y-0 z-20 hidden w-4 -translate-x-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 sm:flex","[[data-side=left]zr&]:cursor-w-resize [[data-side=right]zr&]:cursor-e-resize","[[data-side=left][data-state=collapsed]zr&]:cursor-e-resize [[data-side=right][data-state=collapsed]zr&]: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]zr&]:-right-2","[[data-side=right][data-collapsible=offcanvas]zr&]:-left-2",e),...t})});Zn.displayName="SidebarRail";var Qn=ue.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("main",{ref:a,className:b("flex flex-1 flex-col bg-background overflow-y-auto relative max-h-full","md:peer-data-[variant=inset]:zr-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));Qn.displayName="SidebarInset";var el=ue.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(j,{ref:a,"data-sidebar":"input",className:b("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));el.displayName="SidebarInput";var tl=ue.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("div",{ref:a,"data-sidebar":"header",className:b("flex flex-col gap-2 p-2",e),...t}));tl.displayName="SidebarHeader";var al=ue.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("div",{ref:a,"data-sidebar":"footer",className:b("flex flex-col gap-2 p-2",e),...t}));al.displayName="SidebarFooter";var ol=ue.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(qo,{ref:a,"data-sidebar":"separator",className:b("mx-2 w-auto bg-sidebar-border",e),...t}));ol.displayName="SidebarSeparator";var rl=ue.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("div",{ref:a,"data-sidebar":"content",className:b("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));rl.displayName="SidebarContent";var il=ue.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("div",{ref:a,"data-sidebar":"group",className:b("relative flex w-full min-w-0 flex-col p-2",e),...t}));il.displayName="SidebarGroup";var sl=ue.forwardRef(({className:e,asChild:t=!1,...a},r)=>(0,zr.jsx)(t?Lr.Slot:"div",{ref:r,"data-sidebar":"group-label",className:b("duration-200 flex h-8 shrink-0 items-center rounded-md 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]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...a}));sl.displayName="SidebarGroupLabel";var nl=ue.forwardRef(({className:e,asChild:t=!1,...a},r)=>(0,zr.jsx)(t?Lr.Slot:"button",{ref:r,"data-sidebar":"group-action",className:b("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md 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:md:hidden","group-data-[collapsible=icon]:hidden",e),...a}));nl.displayName="SidebarGroupAction";var ll=ue.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("div",{ref:a,"data-sidebar":"group-content",className:b("w-full text-sm",e),...t}));ll.displayName="SidebarGroupContent";var dl=ue.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("ul",{ref:a,"data-sidebar":"menu",className:b("flex w-full min-w-0 flex-col gap-1",e),...t}));dl.displayName="SidebarMenu";var cl=ue.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("Ho",{ref:a,"data-sidebar":"menu-item",className:b("group/menu-item relative",e),...t}));cl.displayName="SidebarMenuItem";var ml=(0,jr.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md 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-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),pl=ue.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:r="default",tooltip:d,className:o,...n},c)=>{let s=e?Lr.Slot:"button",{isMobile:p,state:l}=bo(),g=(0,zr.jsx)(s,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:b(ml({variant:a,size:r}),o),...n});return d?(typeof d=="string"&&(d={children:d}),(0,zr.jsxs)(Ei,{children:[(0,zr.jsx)(Ii,{asChild:!0,children:g}),(0,zr.jsx)(Zo,{side:"right",align:"center",hidden:l!=="collapsed"||p,...d})]})):g});pl.displayName="SidebarMenuButton";var ul=ue.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...r},d)=>(0,zr.jsx)(t?Lr.Slot:"button",{ref:d,"data-sidebar":"menu-action",className:b("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md 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:md: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 md:opacity-0",e),...r}));ul.displayName="SidebarMenuAction";var gl=ue.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("div",{ref:a,"data-sidebar":"menu-badge",className:b("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md 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=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}));gl.displayName="SidebarMenuBadge";var fl=ue.forwardRef(({className:e,showIcon:t=!1,...a},r)=>{let d=ue.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,zr.jsxs)("div",{ref:r,"data-sidebar":"menu-skeleton",className:b("rounded-md h-8 flex gap-2 px-2 items-center",e),...a,children:[t&&(0,zr.jsx)(Jo,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,zr.jsx)(Jo,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":d}})]})});fl.displayName="SidebarMenuSkeleton";var vl=ue.forwardRef(({className:e,...t},a)=>(0,zr.jsx)("ul",{ref:a,"data-sidebar":"menu-sub",className:b("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}));vl.displayName="SidebarMenuSub";var bl=ue.forwardRef(({...e},t)=>(0,zr.jsx)("Ho",{ref:t,...e}));bl.displayName="SidebarMenuSubItem";var hl=ue.forwardRef(({asChild:e=!1,size:t="md",isActive:a,className:r,...d},o)=>(0,zr.jsx)(e?Lr.Slot:"a",{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:b("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md 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-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...d}));hl.displayName="SidebarMenuSubButton";var Bi=({projects:e,epics:t,sprints:a,currentView:r,onUpdateProject:d,onDeleteProject:o,onAddProject:n,onUpdateEpic:c,onDeleteEpic:s,onAddEpic:p,onAddSprint:l,onUpdateSprint:g,onDeleteSprint:u,onViewChange:f,mobileMenuOpen:S,onToggleMobileMenu:P})=>{let[v,I]=(0,Ot.useState)(null),[w,y]=(0,Ot.useState)(null),[E,O]=(0,Ot.useState)(null),[G,pe]=(0,Ot.useState)(null),[x,k]=(0,Ot.useState)({name:"",description:""}),[z,he]=(0,Ot.useState)({name:"",description:"",color:"",confidence:"medium",phase:1,startDate:"",endDate:"",progress:0}),[F,D]=(0,Ot.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[ee,Re]=(0,Ot.useState)(!1),[ct,mt]=(0,Ot.useState)(!1),[ze,$e]=(0,Ot.useState)({name:"",description:""}),[L,ae]=(0,Ot.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),Ne=["bg-brand-blue","bg-brand-green","bg-brand-plum","bg-brand-orange","bg-destructive","bg-warning","bg-brand-cyan","bg-accent"],tt=[{value:"low",label:"Low",color:"text-destructive"},{value:"medium",label:"Medium",color:"text-warning"},{value:"high",label:"High",color:"text-success"}],bt=[{value:1,label:"Phase 1",color:"text-brand-blue"},{value:2,label:"Phase 2",color:"text-brand-plum"},{value:3,label:"Phase 3",color:"text-brand-orange"},{value:4,label:"Phase 4",color:"text-brand-green"},{value:5,label:"Phase 5",color:"text-destructive"},{value:6,label:"Phase 6",color:"text-warning"},{value:7,label:"Phase 7",color:"text-brand-cyan"},{value:8,label:"Phase 8",color:"text-accent"},{value:9,label:"Phase 9",color:"text-muted-foreground"}],T=N=>{y(N.id),k({name:N.name,description:N.description||""})},He=()=>{w&&x.name.trim()&&(d(w,{name:x.name.trim(),description:x.description.trim()}),y(null))},Le=()=>{y(null),k({name:"",description:""})},qt=()=>{ze.name.trim()&&(n({name:ze.name.trim(),description:ze.description.trim(),isSelected:!1}),$e({name:"",description:""}),Re(!1))},Ga=N=>{d(N,{isSelected:!0})},Sa=N=>{O(N.id),he({name:N.name,description:N.description||"",color:N.color,confidence:N.confidence,phase:N.phase,startDate:N.startDate.toISOString().split("T")[0],endDate:N.endDate.toISOString().split("T")[0],progress:N.progress})},Wa=()=>{E&&z.name.trim()&&(c(E,{name:z.name.trim(),description:z.description.trim(),color:z.color,confidence:z.confidence,phase:z.phase,startDate:new Date(z.startDate),endDate:new Date(z.endDate),progress:z.progress}),O(null))},Ao=()=>{O(null),he({name:"",description:"",color:"",confidence:"medium",phase:1,startDate:"",endDate:"",progress:0})},qa=N=>{pe(N.id),D({name:N.name,description:N.description||"",startDate:N.startDate.toISOString().split("T")[0],endDate:N.endDate.toISOString().split("T")[0],isActive:N.isActive})},Mo=()=>{G&&F.name.trim()&&(g(G,{name:F.name.trim(),description:F.description.trim(),startDate:new Date(F.startDate),endDate:new Date(F.endDate),isActive:F.isActive}),pe(null))},Xa=()=>{pe(null),D({name:"",description:"",startDate:"",endDate:"",isActive:!1})},ca=()=>{L.name.trim()&&(l({name:L.name.trim(),description:L.description.trim(),startDate:new Date(L.startDate),endDate:new Date(L.endDate),isActive:L.isActive,isSelected:!1}),ae({name:"",description:"",startDate:"",endDate:"",isActive:!1}),mt(!1))},Da=N=>{g(N,{isSelected:!0})},Ja=N=>N.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),ka=N=>{let A=tt.find(Ce=>Ce.value===N);return A?{label:A.label,color:A.color}:{label:"Medium",color:"text-warning"}},Pa=N=>{let A=bt.find(Ce=>Ce.value===N);return A?{label:A.label,color:A.color}:{label:"Phase 1",color:"text-primary"}};return(0,zr.jsxs)(zr.Fragment,{children:[(0,zr.jsxs)("div",{className:`absolute h-full w-12 bg-sidebar-background flex flex-col z-50 flex-shrink-0 transition-transform duration-300 group ${S?"translate-x-0":"-translate-x-full"} md:translate-x-0`,children:[(0,zr.jsxs)("div",{className:"border-b border-sidebar-border",children:[(0,zr.jsxs)("button",{onClick:()=>{f("kanban"),I(null)},className:`w-12 h-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r==="kanban"?"bg-primary":"bg-primary/75 hover:bg-primary"} hover:w-28 hover:justify-start hover:pl-3 z-50`,title:"Kanban View",children:[(0,zr.jsx)(gt.Kanban,{className:"h-4 w-4 flex-shrink-0"}),(0,zr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Kanban"})]}),(0,zr.jsxs)("button",{onClick:()=>{f("planning"),I(null)},className:`w-12 h-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r==="planning"?"bg-brand-plum":"bg-brand-plum/75 hover:bg-brand-plum"} hidden md:flex hover:w-28 hover:justify-start hover:pl-3`,title:"Planning View",children:[(0,zr.jsx)(gt.Calendar,{className:"h-4 w-4 flex-shrink-0"}),(0,zr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Planning"})]})]}),(0,zr.jsxs)("button",{onClick:()=>I(v==="projects"?null:"projects"),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${v==="projects"?"bg-sidebar-accent":"bg-sidebar-primary hover:bg-sidebar-accent"} hover:w-28 hover:justify-start hover:pl-3`,title:"Projects",children:[(0,zr.jsx)(gt.FolderOpen,{className:"h-4 w-4 flex-shrink-0"}),(0,zr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Projects"})]}),(0,zr.jsxs)("button",{onClick:()=>{f("epics"),I(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r==="epics"?"bg-primary":"bg-primary/75 hover:bg-primary"} hover:w-28 hover:justify-start hover:pl-3`,title:"Epic Planning",children:[(0,zr.jsx)(gt.Target,{className:"h-4 w-4 flex-shrink-0"}),(0,zr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Epics"})]}),(0,zr.jsxs)("button",{onClick:()=>I(v==="sprints"?null:"sprints"),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${v==="sprints"?"bg-brand-green":"bg-brand-green/75 hover:bg-brand-green"} hover:w-28 hover:justify-start hover:pl-3`,title:"Sprints",children:[(0,zr.jsx)(gt.Layers,{className:"h-4 w-4 flex-shrink-0"}),(0,zr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Sprints"})]}),(0,zr.jsxs)("button",{onClick:()=>{f("files"),I(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r==="files"?"bg-brand-orange":"bg-brand-orange/75 hover:bg-brand-orange"} hover:w-28 hover:justify-start hover:pl-3`,title:"Files",children:[(0,zr.jsx)(gt.FileText,{className:"h-4 w-4 flex-shrink-0"}),(0,zr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Files"})]}),(0,zr.jsxs)("button",{onClick:()=>{f("tasks"),I(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r==="tasks"?"bg-brand-cyan":"bg-brand-cyan/75 hover:bg-brand-cyan"} hover:w-28 hover:justify-start hover:pl-3`,title:"Tasks",children:[(0,zr.jsx)(gt.Calendar,{className:"h-4 w-4 flex-shrink-0"}),(0,zr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Tasks"})]})]}),S&&(0,zr.jsx)("div",{className:"md:hidden fixed inset-0 bg-background/80 backdrop-blur-sm z-20",onClick:P}),v&&(0,zr.jsxs)(zr.Fragment,{children:[(0,zr.jsx)("div",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm z-40",onClick:()=>I(null)}),(0,zr.jsxs)("div",{className:"absolute left-12 w-80 md:w-96 bg-card shadow-lg z-40 transform transition-transform max-w-[calc(100vw-3rem)] md:max-w-none top-0 h-full",children:[(0,zr.jsxs)("div",{className:"p-3 md:p-4 border-b flex items-center justify-between",children:[(0,zr.jsxs)("h2",{className:"text-base md:text-lg font-semibold",children:[v==="projects"&&"Projects",v==="epics"&&"Manage Epics",v==="sprints"&&"Manage Sprints",v==="files"&&"Files"]}),(0,zr.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>I(null),children:(0,zr.jsx)(gt.zr,{className:"h-4 w-4"})})]}),(0,zr.jsxs)("div",{className:"p-3 md:p-4 space-y-4 h-full overflow-y-auto",children:[v==="projects"&&(0,zr.jsx)(V,{className:"p-3",children:(0,zr.jsxs)("div",{className:"space-y-3",children:[(0,zr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zr.jsx)("h3",{className:"font-medium text-foreground",children:"Projects"}),(0,zr.jsxs)(h,{size:"sm",onClick:()=>Re(!0),className:"gap-1",children:[(0,zr.jsx)(gt.Plus,{className:"h-3 w-3"}),"Add Project"]})]}),ee&&(0,zr.jsxs)("div",{className:"border rounded-lg p-2 space-y-2",children:[(0,zr.jsx)(j,{value:ze.name,onChange:N=>$e(A=>({...A,name:N.target.value})),placeholder:"Project name",className:"text-sm"}),(0,zr.jsx)(Pe,{value:ze.description,onChange:N=>$e(A=>({...A,description:N.target.value})),placeholder:"Project description",rows:2,className:"text-sm"}),(0,zr.jsxs)("div",{className:"flex gap-1",children:[(0,zr.jsx)(h,{size:"sm",onClick:qt,className:"text-xs h-6",children:"Save"}),(0,zr.jsx)(h,{size:"sm",variant:"outline",onClick:()=>Re(!1),className:"text-xs h-6",children:"Cancel"})]})]}),(0,zr.jsx)("div",{className:"space-y-2",children:e.map(N=>(0,zr.jsx)("div",{className:"border rounded p-2",children:w===N.id?(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(j,{value:x.name,onChange:A=>k(Ce=>({...Ce,name:A.target.value})),placeholder:"Project name",className:"text-sm"}),(0,zr.jsx)(Pe,{value:x.description,onChange:A=>k(Ce=>({...Ce,description:A.target.value})),placeholder:"Project description",rows:2,className:"text-sm"}),(0,zr.jsxs)("div",{className:"flex gap-1",children:[(0,zr.jsx)(h,{size:"sm",onClick:He,className:"text-xs h-6",children:"Save"}),(0,zr.jsx)(h,{size:"sm",variant:"outline",onClick:Le,className:"text-xs h-6",children:"Cancel"})]})]}):(0,zr.jsxs)("div",{className:`cursor-pointer p-1 rounded transition-colors ${N.isSelected?"bg-primary/10 border-primary ring-2 ring-primary/20":"hover:bg-muted"}`,onClick:()=>Ga(N.id),children:[(0,zr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,zr.jsx)(gt.FolderOpen,{className:"h-3 w-3 text-muted-foreground"}),(0,zr.jsx)("span",{className:"font-medium text-xs",children:N.name})]}),N.description&&(0,zr.jsx)("p",{className:"text-xs text-muted-foreground mb-1",children:N.description}),(0,zr.jsxs)("div",{className:"flex gap-1",onClick:A=>A.stopPropagation(),children:[(0,zr.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>T(N),className:"h-5 px-1",children:(0,zr.jsx)(gt.Edit2,{className:"h-3 w-3"})}),(0,zr.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>o(N.id),className:"h-5 px-1 text-destructive hover:text-destructive",children:(0,zr.jsx)(gt.Trash2,{className:"h-3 w-3"})})]})]})},N.id))})]})}),v==="epics"&&(0,zr.jsx)(V,{className:"p-3",children:(0,zr.jsxs)("div",{className:"space-y-3",children:[(0,zr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zr.jsx)("h3",{className:"font-medium text-foreground",children:"Epics"}),(0,zr.jsxs)(h,{size:"sm",onClick:p,className:"gap-1",children:[(0,zr.jsx)(gt.Plus,{className:"h-3 w-3"}),"Add Epic"]})]}),(0,zr.jsx)("div",{className:"space-y-4",children:t.map(N=>(0,zr.jsx)("div",{className:"border rounded-lg p-3",children:E===N.id?(0,zr.jsxs)("div",{className:"space-y-3",children:[(0,zr.jsx)(j,{value:z.name,onChange:A=>he(Ce=>({...Ce,name:A.target.value})),placeholder:"Epic name",className:"text-sm"}),(0,zr.jsx)(Pe,{value:z.description,onChange:A=>he(Ce=>({...Ce,description:A.target.value})),placeholder:"Epic description",rows:2,className:"text-sm"}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)("label",{className:"text-xs font-medium",children:"Color"}),(0,zr.jsx)("div",{className:"flex gap-1 flex-wrap",children:Ne.map(A=>(0,zr.jsx)("button",{onClick:()=>he(Ce=>({...Ce,color:A})),className:`w-6 h-6 rounded-full ${A} ${z.color===A?"ring-2 ring-ring":""}`},A))})]}),(0,zr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,zr.jsxs)("div",{className:"space-y-1",children:[(0,zr.jsx)("label",{className:"text-xs font-medium",children:"Confidence"}),(0,zr.jsxs)(Se,{value:z.confidence,onValueChange:A=>he(Ce=>({...Ce,confidence:A})),children:[(0,zr.jsx)(ye,{className:"h-8 text-xs",children:(0,zr.jsx)(ke,{})}),(0,zr.jsx)(we,{children:tt.map(A=>(0,zr.jsx)($,{value:A.value,children:(0,zr.jsx)("span",{className:A.color,children:A.label})},A.value))})]})]}),(0,zr.jsxs)("div",{className:"space-y-1",children:[(0,zr.jsx)("label",{className:"text-xs font-medium",children:"Phase"}),(0,zr.jsxs)(Se,{value:z.phase.toString(),onValueChange:A=>he(Ce=>({...Ce,phase:parseInt(A)})),children:[(0,zr.jsx)(ye,{className:"h-8 text-xs",children:(0,zr.jsx)(ke,{})}),(0,zr.jsx)(we,{children:bt.map(A=>(0,zr.jsx)($,{value:A.value.toString(),children:(0,zr.jsx)("span",{className:A.color,children:A.label})},A.value))})]})]})]}),(0,zr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,zr.jsxs)("div",{className:"space-y-1",children:[(0,zr.jsx)("label",{className:"text-xs font-medium",children:"Start Date"}),(0,zr.jsx)(j,{type:"date",value:z.startDate,onChange:A=>he(Ce=>({...Ce,startDate:A.target.value})),className:"text-xs h-8"})]}),(0,zr.jsxs)("div",{className:"space-y-1",children:[(0,zr.jsx)("label",{className:"text-xs font-medium",children:"End Date"}),(0,zr.jsx)(j,{type:"date",value:z.endDate,onChange:A=>he(Ce=>({...Ce,endDate:A.target.value})),className:"text-xs h-8"})]})]}),(0,zr.jsxs)("div",{className:"space-y-1",children:[(0,zr.jsx)("label",{className:"text-xs font-medium",children:"Progress (%)"}),(0,zr.jsx)(j,{type:"number",min:"0",max:"100",value:z.progress,onChange:A=>he(Ce=>({...Ce,progress:parseInt(A.target.value)||0})),className:"text-xs h-8"})]}),(0,zr.jsxs)("div",{className:"flex gap-2",children:[(0,zr.jsx)(h,{size:"sm",onClick:Wa,className:"text-xs",children:"Save"}),(0,zr.jsx)(h,{size:"sm",variant:"outline",onClick:Ao,className:"text-xs",children:"Cancel"})]})]}):(0,zr.jsxs)("div",{className:`cursor-pointer p-2 rounded transition-colors ${N.isSelected?"bg-primary/10 border-primary":"hover:bg-muted"}`,onClick:()=>c(N.id,{isSelected:!N.isSelected}),children:[(0,zr.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,zr.jsx)("div",{className:`w-3 h-3 rounded-full ${N.color}`}),(0,zr.jsx)("span",{className:"font-medium text-sm",children:N.name})]}),N.description&&(0,zr.jsx)("p",{className:"text-xs text-muted-foreground mb-2",children:N.description}),(0,zr.jsxs)("div",{className:"space-y-1 mb-2",children:[(0,zr.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,zr.jsx)("span",{className:"text-muted-foreground",children:"Confidence:"}),(0,zr.jsx)("span",{className:ka(N.confidence).color,children:ka(N.confidence).label})]}),(0,zr.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,zr.jsx)("span",{className:"text-muted-foreground",children:"Phase:"}),(0,zr.jsx)("span",{className:Pa(N.phase).color,children:Pa(N.phase).label})]}),(0,zr.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,zr.jsx)("span",{className:"text-muted-foreground",children:"Timeline:"}),(0,zr.jsxs)("span",{className:"text-foreground",children:[Ja(N.startDate)," - ",Ja(N.endDate)]})]}),(0,zr.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,zr.jsx)("span",{className:"text-muted-foreground",children:"Progress:"}),(0,zr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zr.jsx)("div",{className:"w-12 h-2 bg-muted rounded-full",children:(0,zr.jsx)("div",{className:"h-2 bg-primary rounded-full",style:{width:`${N.progress}%`}})}),(0,zr.jsxs)("span",{className:"text-foreground",children:[N.progress,"%"]})]})]})]}),(0,zr.jsxs)("div",{className:"flex gap-1",onClick:A=>A.stopPropagation(),children:[(0,zr.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>Sa(N),className:"h-6 px-2",children:(0,zr.jsx)(gt.Edit2,{className:"h-3 w-3"})}),(0,zr.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>s(N.id),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,zr.jsx)(gt.Trash2,{className:"h-3 w-3"})})]})]})},N.id))})]})}),v==="sprints"&&(0,zr.jsx)(V,{className:"p-3",children:(0,zr.jsxs)("div",{className:"space-y-3",children:[(0,zr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zr.jsx)("h3",{className:"font-medium text-foreground",children:"Sprints (Select One)"}),(0,zr.jsxs)(h,{size:"sm",onClick:()=>mt(!0),className:"gap-1",children:[(0,zr.jsx)(gt.Plus,{className:"h-3 w-3"}),"Add Sprint"]})]}),ct&&(0,zr.jsxs)("div",{className:"border rounded-lg p-2 space-y-2",children:[(0,zr.jsx)(j,{value:L.name,onChange:N=>ae(A=>({...A,name:N.target.value})),placeholder:"Sprint name",className:"text-sm"}),(0,zr.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[(0,zr.jsx)(j,{type:"date",value:L.startDate,onChange:N=>ae(A=>({...A,startDate:N.target.value})),className:"text-xs"}),(0,zr.jsx)(j,{type:"date",value:L.endDate,onChange:N=>ae(A=>({...A,endDate:N.target.value})),className:"text-xs"})]}),(0,zr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zr.jsx)("input",{type:"checkbox",checked:L.isActive,onChange:N=>ae(A=>({...A,isActive:N.target.checked})),className:"w-3 h-3"}),(0,zr.jsx)("span",{className:"text-xs",children:"Active"})]}),(0,zr.jsxs)("div",{className:"flex gap-1",children:[(0,zr.jsx)(h,{size:"sm",onClick:ca,className:"text-xs h-6",children:"Save"}),(0,zr.jsx)(h,{size:"sm",variant:"outline",onClick:()=>mt(!1),className:"text-xs h-6",children:"Cancel"})]})]}),(0,zr.jsx)("div",{className:"space-y-2",children:a.map(N=>(0,zr.jsx)("div",{className:"border rounded p-2",children:G===N.id?(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(j,{value:F.name,onChange:A=>D(Ce=>({...Ce,name:A.target.value})),placeholder:"Sprint name",className:"text-sm",disabled:N.id==="backlog"||N.id==="all-tasks"}),N.id!=="backlog"&&N.id!=="all-tasks"&&(0,zr.jsxs)(zr.Fragment,{children:[(0,zr.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[(0,zr.jsx)(j,{type:"date",value:F.startDate,onChange:A=>D(Ce=>({...Ce,startDate:A.target.value})),className:"text-xs"}),(0,zr.jsx)(j,{type:"date",value:F.endDate,onChange:A=>D(Ce=>({...Ce,endDate:A.target.value})),className:"text-xs"})]}),(0,zr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zr.jsx)("input",{type:"checkbox",checked:F.isActive,onChange:A=>D(Ce=>({...Ce,isActive:A.target.checked})),className:"w-3 h-3"}),(0,zr.jsx)("span",{className:"text-xs",children:"Active"})]})]}),(0,zr.jsxs)("div",{className:"flex gap-1",children:[(0,zr.jsx)(h,{size:"sm",onClick:Mo,className:"text-xs h-6",children:"Save"}),(0,zr.jsx)(h,{size:"sm",variant:"outline",onClick:Xa,className:"text-xs h-6",children:"Cancel"})]})]}):(0,zr.jsxs)("div",{className:`cursor-pointer p-1 rounded transition-colors ${N.isSelected?"bg-brand-green/10 border-brand-green ring-2 ring-brand-green/20":"hover:bg-muted"}`,onClick:()=>Da(N.id),children:[(0,zr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,zr.jsx)(gt.Calendar,{className:"h-3 w-3 text-muted-foreground"}),(0,zr.jsx)("span",{className:"font-medium text-xs",children:N.name}),N.isActive&&(0,zr.jsx)("span",{className:"text-xs bg-brand-green/20 text-brand-green px-1 py-0.5 rounded",children:"Active"}),(N.id==="backlog"||N.id==="all-tasks")&&(0,zr.jsx)("span",{className:"text-xs bg-muted text-muted-foreground px-1 py-0.5 rounded",children:"System"})]}),N.id!=="backlog"&&N.id!=="all-tasks"&&(0,zr.jsxs)("p",{className:"text-xs text-muted-foreground mb-1",children:[N.startDate.toLocaleDateString()," - ",N.endDate.toLocaleDateString()]}),(0,zr.jsxs)("div",{className:"flex gap-1",onClick:A=>A.stopPropagation(),children:[(0,zr.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>qa(N),className:"h-5 px-1",children:(0,zr.jsx)(gt.Edit2,{className:"h-3 w-3"})}),N.id!=="backlog"&&N.id!=="all-tasks"&&(0,zr.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>u(N.id),className:"h-5 px-1 text-destructive hover:text-destructive",children:(0,zr.jsx)(gt.Trash2,{className:"h-3 w-3"})})]})]})},N.id))})]})})]})]})]})]})},Li=e=>(0,zr.jsx)(Qo,{children:(0,zr.jsxs)("div",{className:"flex w-full",children:[(0,zr.jsx)("div",{className:"hidden md:block w-12 fixed h-full",children:(0,zr.jsx)(Bi,{...e})}),(0,zr.jsx)("div",{className:"md:hidden",children:(0,zr.jsx)(Bi,{...e})}),(0,zr.jsx)("div",{className:"flex-1 min-w-0 ml-16 px-4 md:px-6",children:(0,zr.jsx)("div",{className:"w-full",children:e.children})})]})});var ji=({title:e,status:t,taskCount:a,children:r,onDrop:d,isCompact:o=!1})=>{let n=p=>{p.preventDefault()},c=p=>{p.preventDefault(),d(t)};return(0,zr.jsxs)(V,{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-md transition-shadow duration-200 ${o?"lg:max-w-xs":""}`,onDragOver:n,onDrop:c,children:[(0,zr.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,zr.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${o?"text-base":"text-lg"}`,children:e}),(0,zr.jsx)(te,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,zr.jsx)("div",{className:"space-y-4 min-h-[200px]",children:r})]})};var ho=({task:e,epic:t,onDragStart:a,onTaskClick:r,isCompact:d=!1})=>{let o=l=>{a(e)},n=()=>{r(e)},c=()=>{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"}},s=()=>{switch(e.type){case"story":return(0,zr.jsx)(gt.BookOpen,{className:"h-3 w-3"});case"bug":return(0,zr.jsx)(gt.Bug,{className:"h-3 w-3"});case"spike":return(0,zr.jsx)(gt.Zap,{className:"h-3 w-3"});case"task":default:return(0,zr.jsx)(gt.AlertCircle,{className:"h-3 w-3"})}},p=()=>{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 d?(0,zr.jsx)(V,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:o,onClick:n,children:(0,zr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zr.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${p()}`,children:s()}),(0,zr.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.title})]})}):(0,zr.jsxs)(V,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:o,onClick:n,children:[(0,zr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,zr.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${p()}`,children:[s(),(0,zr.jsx)("span",{className:"capitalize",children:e.type})]}),(0,zr.jsxs)("div",{className:"flex gap-1",children:[(0,zr.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${c()}`,children:e.priority}),(0,zr.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.points})]})]}),(0,zr.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.title}),(0,zr.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,zr.jsx)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:(0,zr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,zr.jsx)(gt.User,{className:"h-4 w-4"}),(0,zr.jsx)("span",{children:e.assignee})]})})]})};var za=xe(require("react")),Ge=xe(require("@radix-Ho/react-dialog"));var lt=Ge.Root,zi=Ge.Trigger,xl=Ge.Portal;var Hi=za.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(Ge.Overlay,{ref:a,className:b("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}));Hi.displayName=Ge.Overlay.displayName;var at=za.forwardRef(({className:e,children:t,...a},r)=>(0,zr.jsxs)(xl,{children:[(0,zr.jsx)(Hi,{}),(0,zr.jsxs)(Ge.Content,{ref:r,className:b("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-zr-left-1/2 data-[state=closed]:slide-out-zr-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,zr.jsxs)(Ge.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,zr.jsx)(gt.zr,{className:"h-4 w-4"}),(0,zr.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));at.displayName=Ge.Content.displayName;var ot=({className:e,...t})=>(0,zr.jsx)("div",{className:b("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ot.displayName="DialogHeader";var Ha=({className:e,...t})=>(0,zr.jsx)("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ha.displayName="DialogFooter";var rt=za.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(Ge.Title,{ref:a,className:b("text-lg font-semibold leading-none tracking-tight",e),...t}));rt.displayName=Ge.Title.displayName;var Va=za.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(Ge.Description,{ref:a,className:b("text-sm text-muted-foreground",e),...t}));Va.displayName=Ge.Description.displayName;var sa=xe(require("react")),xa=xe(require("@radix-Ho/react-toggle-group"));var Vi=xe(require("react")),er=xe(require("@radix-Ho/react-toggle"));var tr=(0,$zr.cva)("inline-flex items-center justify-center gap-2 rounded-md 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"}}),yl=Vi.forwardRef(({className:e,variant:t,size:a,...r},d)=>(0,zr.jsx)(er.Root,{ref:d,className:b(tr({variant:t,size:a,className:e})),...r}));yl.displayName=er.Root.displayName;var Ki=sa.createContext({size:"default",variant:"default"}),na=sa.forwardRef(({className:e,variant:t,size:a,children:r,...d},o)=>(0,zr.jsx)(xa.Root,{ref:o,className:b("flex items-center justify-center gap-1",e),...d,children:(0,zr.jsx)(Ki.Provider,{value:{variant:t,size:a},children:r})}));na.displayName=xa.Root.displayName;var la=sa.forwardRef(({className:e,children:t,variant:a,size:r,...d},o)=>{let n=sa.useContext(Ki);return(0,zr.jsx)(xa.Item,{ref:o,className:b(tr({variant:n.variant||a,size:n.size||r}),e),...d,children:t})});la.displayName=xa.Item.displayName;var wl=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:gt.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:gt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:gt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:gt.Zap}],Nl=[{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"}],yo=({isOpen:e,onClose:t,onAddTask:a,epics:r,sprints:d,defaultEpicId:o})=>{let[n,c]=(0,$a.useState)({title:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""});(0,$a.useEffect)(()=>{e&&o&&c(l=>({...l,epicId:o}))},[e,o]),(0,$a.useEffect)(()=>{e&&c({title:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""})},[e]);let s=l=>{l.preventDefault(),n.title.trim()&&n.epicId&&(a({title:n.title.trim(),description:n.description.trim(),status:"todo",priority:n.priority,type:n.type,points:n.points,epicId:n.epicId,sprintId:n.sprintId==="none"?void 0:n.sprintId,assignee:n.assignee.trim()||"Unassigned"}),c({title:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""}),t())},p=(l,g)=>{c(u=>({...u,[l]:g}))};return(0,zr.jsx)(lt,{open:e,onOpenChange:t,children:(0,zr.jsxs)(at,{className:"sm:max-w-md",children:[(0,zr.jsx)(ot,{children:(0,zr.jsx)(rt,{children:"Add New Task"})}),(0,zr.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"title",children:"Task Title"}),(0,zr.jsx)(j,{id:"title",value:n.title,onChange:l=>p("title",l.target.value),placeholder:"Enter task title",required:!0})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"description",children:"Description"}),(0,zr.jsx)(Pe,{id:"description",value:n.description,onChange:l=>p("description",l.target.value),placeholder:"Enter task description",rows:3})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{children:"Type"}),(0,zr.jsx)(na,{type:"single",value:n.type,onValueChange:l=>l&&p("type",l),children:wl.map(l=>{let g=l.icon;return(0,zr.jsxs)(la,{value:l.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,zr.jsx)(g,{className:"h-4 w-4"}),l.label]},l.value)})})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{children:"Priority"}),(0,zr.jsx)(na,{type:"single",value:n.priority,onValueChange:l=>l&&p("priority",l),children:Nl.map(l=>(0,zr.jsx)(la,{value:l.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:l.label},l.value))})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"points",children:"Story Points"}),(0,zr.jsx)(j,{id:"points",type:"number",min:"1",max:"100",value:n.points,onChange:l=>p("points",parseInt(l.target.value)||1),placeholder:"Enter story points",required:!0})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"epic",children:"Epic"}),(0,zr.jsxs)(Se,{value:n.epicId,onValueChange:l=>p("epicId",l),children:[(0,zr.jsx)(ye,{children:(0,zr.jsx)(ke,{placeholder:"Select an epic"})}),(0,zr.jsx)(we,{children:r.map(l=>(0,zr.jsx)($,{value:l.id,children:(0,zr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zr.jsx)("div",{className:`w-3 h-3 rounded-full ${l.color}`}),l.name]})},l.id))})]})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,zr.jsxs)(Se,{value:n.sprintId,onValueChange:l=>p("sprintId",l),children:[(0,zr.jsx)(ye,{children:(0,zr.jsx)(ke,{placeholder:"Select a sprint"})}),(0,zr.jsxs)(we,{children:[(0,zr.jsx)($,{value:"none",children:"No Sprint"}),d.map(l=>(0,zr.jsx)($,{value:l.id,children:(0,zr.jsxs)("div",{className:"flex items-center gap-2",children:[l.name,l.isActive&&(0,zr.jsx)("span",{className:"text-xs bg-green-100 text-green-800 px-1 rounded",children:"Active"})]})},l.id))]})]})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"assignee",children:"Assignee"}),(0,zr.jsx)(j,{id:"assignee",value:n.assignee,onChange:l=>p("assignee",l.target.value),placeholder:"Enter assignee name",required:!0})]}),(0,zr.jsxs)(Ha,{children:[(0,zr.jsx)(h,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,zr.jsx)(h,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var or=({fieldName:e,value:t,label:a,multiline:r=!1,onSave:d,className:o="",disabled:n=!1})=>{let[c,s]=(0,Ot.useState)(!1),[p,l]=(0,Ot.useState)(""),g=()=>{n||(s(!0),l(t))},u=async()=>{p!==t&&await d(e,p),s(!1)},f=S=>{S.key==="Enter"&&!r||S.key==="Enter"&&S.ctrlKey&&r?u():S.key==="Escape"&&(s(!1),l(""))};return(0,zr.jsxs)("div",{className:`space-y-2 ${o}`,children:[(0,zr.jsx)(R,{children:a}),c?r?(0,zr.jsx)(Pe,{value:p,onChange:S=>l(S.target.value),onBlur:u,onKeyDown:f,autoFocus:!0,rows:4,className:"resize-none"}):(0,zr.jsx)(j,{value:p,onChange:S=>l(S.target.value),onBlur:u,onKeyPress:f,autoFocus:!0,className:"text-lg font-medium"}):(0,zr.jsxs)("div",{onClick:g,className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${r?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,zr.jsx)("span",{className:r?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click zr edit..."}),!n&&(0,zr.jsx)(gt.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var Wi=({comments:e,onAddComment:t})=>{let[a,r]=(0,Ot.useState)(""),d=n=>n.split(" ").map(c=>c[0]).join("").toUpperCase(),o=()=>{a.trim()&&(t(a),r(""))};return(0,zr.jsxs)("div",{className:"space-y-4",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zr.jsx)(gt.MessageSquare,{className:"h-5 w-5"}),(0,zr.jsx)(R,{className:"text-lg font-medium",children:"Comments"}),(0,zr.jsx)(te,{variant:"secondary",children:e.length})]}),(0,zr.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(n=>(0,zr.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,zr.jsx)(Ft,{className:"h-8 w-8 mt-1",children:(0,zr.jsx)(Bt,{className:"text-xs bg-muted text-muted-foreground",children:d(n.author)})}),(0,zr.jsxs)("div",{className:"flex-1",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,zr.jsx)("span",{className:"font-medium text-sm",children:n.author}),(0,zr.jsxs)("span",{className:"text-xs text-muted-foreground",children:[n.createdAt.toLocaleDateString()," at ",n.createdAt.toLocaleTimeString()]})]}),(0,zr.jsx)("p",{className:"text-sm text-muted-foreground",children:n.text})]})]},n.id))}),(0,zr.jsxs)("div",{className:"flex gap-2",children:[(0,zr.jsx)(Pe,{value:a,onChange:n=>r(n.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,zr.jsx)(h,{onClick:o,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,zr.jsx)(gt.Send,{className:"h-4 w-4"})})]})]})};var No=({label:e,value:t,onValueChange:a,options:r,showColor:d=!1,disabled:o=!1})=>{let[n,c]=(0,Ot.useState)(!1),s=r.find(l=>l.value===t);return(0,zr.jsxs)("div",{className:"space-y-1",children:[(0,zr.jsx)(R,{className:"text-xs text-muted-foreground",children:e}),(0,zr.jsxs)(Se,{value:t,onValueChange:a,open:n,onOpenChange:l=>{o||c(l)},disabled:o,children:[(0,zr.jsx)(ye,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,zr.jsxs)(te,{variant:"secondary",className:`${o?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!o&&c(!n),children:[d&&s?.color&&(0,zr.jsx)("div",{className:`w-2 h-2 rounded-full ${s.color} mr-1`}),s?.label||"Select..."]})}),(0,zr.jsx)(we,{children:r.map(l=>(0,zr.jsx)($,{value:l.value,children:d&&l.color?(0,zr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zr.jsx)("div",{className:`w-3 h-3 rounded-full ${l.color}`}),l.label]}):l.label},l.value))})]})]})};var Xi=({label:e,value:t,onValueChange:a,options:r,placeholder:d="Search...",allowCustomValue:o=!1,disabled:n=!1})=>{let[c,s]=(0,Ot.useState)(!1),[p,l]=(0,Ot.useState)(""),g=r.find(v=>v.value===t),u=r.filter(v=>v.label.toLowerCase().includes(p.toLowerCase())),f=v=>{a(v),s(!1),l("")},S=()=>{o&&p.trim()&&!r.find(v=>v.value===p.trim())&&(a(p.trim()),s(!1),l(""))};return(0,zr.jsxs)("div",{className:"space-y-1",children:[(0,zr.jsx)(R,{className:"text-xs text-muted-foreground",children:e}),(0,zr.jsxs)(Se,{value:t,onValueChange:f,open:c,onOpenChange:v=>{n||s(v)},disabled:n,children:[(0,zr.jsx)(ye,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,zr.jsx)(te,{variant:"secondary",className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!n&&s(!c),children:g?.label||t||"Select..."})}),(0,zr.jsxs)(we,{children:[(0,zr.jsx)("div",{className:"p-2",children:(0,zr.jsx)(j,{placeholder:d,value:p,onChange:v=>l(v.target.value),onKeyDown:v=>{v.key==="Enter"&&o&&S()},className:"mb-2"})}),u.map(v=>(0,zr.jsx)($,{value:v.value,children:v.label},v.value)),o&&p.trim()&&!u.find(v=>v.value===p.trim())&&(0,zr.jsxs)($,{value:p.trim(),children:['Add "',p.trim(),'"']})]})]})]})};var Cl=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:gt.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:gt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:gt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:gt.Zap}],Sl=[{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"}],Dl=[{value:"John Doe",label:"John Doe"},{value:"Jane Smith",label:"Jane Smith"},{value:"Bob Wilson",label:"Bob Wilson"},{value:"Alice Johnson",label:"Alice Johnson"},{value:"Carol Brown",label:"Carol Brown"},{value:"David Lee",label:"David Lee"},{value:"Emma Davis",label:"Emma Davis"},{value:"Frank Miller",label:"Frank Miller"},{value:"Grace Taylor",label:"Grace Taylor"},{value:"Unassigned",label:"Unassigned"}],Ji=({task:e,epics:t,sprints:a,lastUpdated:r,onUpdateTask:d,onClose:o,onDelete:n,isUpdating:c=!1,isDeleting:s=!1,deleteState:p="idle"})=>{let l=u=>u.split(" ").map(f=>f[0]).join("").toUpperCase(),g=()=>p==="loading"?(0,zr.jsxs)(h,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,zr.jsx)(gt.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):p==="success"?(0,zr.jsxs)(h,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,zr.jsx)(gt.Check,{className:"h-3 w-3"}),"Deleted"]}):p==="error"?(0,zr.jsxs)(h,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,zr.jsx)(gt.zr,{className:"h-3 w-3"}),"Delete failed"]}):(0,zr.jsxs)(h,{onClick:n,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:c||s,children:[(0,zr.jsx)(gt.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,zr.jsxs)("div",{className:"flex flex-col h-full",children:[(0,zr.jsxs)("div",{className:"space-y-4",style:{opacity:c?.6:1},children:[(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{className:"text-xs text-muted-foreground",children:"Status"}),(0,zr.jsx)(No,{label:"",value:e.status,onValueChange:u=>d("status",u),options:[{value:"todo",label:"gt Ot"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:c})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{className:"text-xs text-muted-foreground",children:"Type"}),(0,zr.jsx)(na,{type:"single",value:e.type,onValueChange:u=>u&&d("type",u),className:"grid grid-cols-2 gap-1",disabled:c,children:Cl.map(u=>{let f=u.icon;return(0,zr.jsxs)(la,{value:u.value,className:"flex items-center gap-1 text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:c,children:[(0,zr.jsx)(f,{className:"h-3 w-3"}),u.label]},u.value)})})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,zr.jsx)(na,{type:"single",value:e.priority,onValueChange:u=>u&&d("priority",u),className:"grid grid-cols-3 gap-1",disabled:c,children:Sl.map(u=>(0,zr.jsx)(la,{value:u.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:c,children:u.label},u.value))})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,zr.jsx)("input",{type:"number",min:"1",max:"100",value:e.points||1,onChange:u=>d("points",u.target.value),className:"w-full h-8 px-2 text-xs border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:c})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,zr.jsx)(No,{label:"",value:e.epicId,onValueChange:u=>d("epicId",u),options:(t||[]).map(u=>({value:u.id,label:u.name,color:u.color})),showColor:!0,disabled:c})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,zr.jsx)(No,{label:"",value:e.sprintId||"none",onValueChange:u=>d("sprintId",u==="none"?"":u),options:[{value:"none",label:"No Sprint"},...(a||[]).map(u=>({value:u.id,label:`${u.name}${u.isActive?" (Active)":""}`}))],disabled:c})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,zr.jsx)(Xi,{label:"",value:e.assignee,onValueChange:u=>d("assignee",u),options:Dl,placeholder:"Search team members...",allowCustomValue:!0,disabled:c})]})]}),(0,zr.jsxs)("div",{className:"mt-auto gt-4 space-y-4",children:[(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(h,{onClick:o,variant:"outline",className:"w-full h-8 text-xs",disabled:c||s,children:"Close"}),g()]}),(0,zr.jsxs)("div",{className:"gt-4 border-t border-border space-y-2",children:[(0,zr.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,zr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,zr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,zr.jsx)(gt.User,{className:"h-3 w-3"}),(0,zr.jsx)("span",{children:"System"})]})]}),(0,zr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,zr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,zr.jsx)(gt.Calendar,{className:"h-3 w-3"}),(0,zr.jsx)("span",{children:e.createdAt.toLocaleDateString()})]})]}),(0,zr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,zr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,zr.jsx)(gt.Clock,{className:"h-3 w-3"}),(0,zr.jsxs)("span",{children:[r.toLocaleDateString()," at ",r.toLocaleTimeString()]})]})]})]})]})]})};var Co=({isOpen:e,onClose:t,task:a,epics:r,sprints:d,onUpdateTask:o,onDeleteTask:n})=>{let[c,s]=(0,Ot.useState)(new Date),[p,l]=(0,Ot.useState)("idle"),[g,u]=(0,Ot.useState)("idle"),[f,S]=(0,Ot.useState)([{id:"1",text:"Initial task created and assigned.",author:"System",createdAt:a.createdAt},{id:"2",text:"Started working on the implementation.",author:a.assignee,createdAt:new Date(a.createdAt.getTime()+864e5)}]),P=async(G,pe)=>{if(pe!==a[G]){l("loading");try{await o(a.id,{[G]:pe}),s(new Date),l("success"),setTimeout(()=>l("idle"),1500)}catch{l("error"),setTimeout(()=>l("idle"),3e3)}}},v=async(G,pe)=>{if(pe!==a[G]){l("loading");try{await o(a.id,{[G]:pe}),s(new Date),l("success"),setTimeout(()=>l("idle"),1500)}catch{l("error"),setTimeout(()=>l("idle"),3e3)}}},I=G=>{let pe={id:Date.now().toString(),text:G,author:"Current User",createdAt:new Date};S([...f,pe])},w=async()=>{u("loading");try{await n(a.id),u("success"),setTimeout(()=>{t(),u("idle")},1e3)}catch{u("error"),setTimeout(()=>u("idle"),3e3)}},y=p!=="loading"&&g!=="loading",E=()=>{y&&t()},O=()=>p==="loading"?(0,zr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,zr.jsx)(gt.Loader2,{className:"h-4 w-4 animate-spin"}),(0,zr.jsx)("span",{children:"Updating..."})]}):p==="success"?(0,zr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,zr.jsx)(gt.Check,{className:"h-4 w-4"}),(0,zr.jsx)("span",{children:"Updated successfully"})]}):p==="error"?(0,zr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,zr.jsx)(gt.zr,{className:"h-4 w-4"}),(0,zr.jsx)("span",{children:"Update failed"})]}):null;return(0,zr.jsx)(lt,{open:e,onOpenChange:E,children:(0,zr.jsxs)(at,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,zr.jsxs)(ot,{children:[(0,zr.jsx)(rt,{className:"sr-only",children:a.title}),(0,zr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zr.jsx)("div",{className:"flex-1",children:O()}),!y&&(0,zr.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,zr.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,zr.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,zr.jsx)(or,{fieldName:"title",value:a.title,label:"",onSave:P,className:"border-b border-border pb-3",disabled:p==="loading"}),(0,zr.jsx)(or,{fieldName:"description",value:a.description,label:"Description",multiline:!0,onSave:P,disabled:p==="loading"}),(0,zr.jsx)(Wi,{comments:f,onAddComment:I})]}),(0,zr.jsx)(Ji,{task:a,epics:r,sprints:d,lastUpdated:c,onUpdateTask:v,onClose:E,onDelete:w,isUpdating:p==="loading",isDeleting:g==="loading",deleteState:g})]})]})})};var So=({isOpen:e,onClose:t,onAddEpic:a})=>{let[r,d]=(0,Ot.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}),o=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],n=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],c=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],s=l=>{l.preventDefault(),r.name.trim()&&(a({name:r.name.trim(),description:r.description.trim(),color:r.color,confidence:r.confidence,phase:r.phase,startDate:new Date(r.startDate),endDate:new Date(r.endDate),progress:r.progress,isSelected:!0}),d({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}),t())},p=(l,g)=>{d(u=>({...u,[l]:g}))};return(0,zr.jsx)(lt,{open:e,onOpenChange:t,children:(0,zr.jsxs)(at,{className:"sm:max-w-md",children:[(0,zr.jsx)(ot,{children:(0,zr.jsx)(rt,{children:"Add New Epic"})}),(0,zr.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"name",children:"Epic Name"}),(0,zr.jsx)(j,{id:"name",value:r.name,onChange:l=>p("name",l.target.value),placeholder:"Enter epic name",required:!0})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"description",children:"Description"}),(0,zr.jsx)(Pe,{id:"description",value:r.description,onChange:l=>p("description",l.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{children:"Color"}),(0,zr.jsx)("div",{className:"flex gap-2 flex-wrap",children:o.map(l=>(0,zr.jsx)("button",{type:"button",onClick:()=>p("color",l),className:`w-8 h-8 rounded-full ${l} ${r.color===l?"ring-2 ring-gray-400":""}`},l))})]}),(0,zr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{children:"Confidence"}),(0,zr.jsxs)(Se,{value:r.confidence,onValueChange:l=>p("confidence",l),children:[(0,zr.jsx)(ye,{children:(0,zr.jsx)(ke,{})}),(0,zr.jsx)(we,{children:n.map(l=>(0,zr.jsx)($,{value:l.value,children:l.label},l.value))})]})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{children:"Phase"}),(0,zr.jsxs)(Se,{value:r.phase.toString(),onValueChange:l=>p("phase",parseInt(l)),children:[(0,zr.jsx)(ye,{children:(0,zr.jsx)(ke,{})}),(0,zr.jsx)(we,{children:c.map(l=>(0,zr.jsx)($,{value:l.value.toString(),children:l.label},l.value))})]})]})]}),(0,zr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{children:"Start Date"}),(0,zr.jsx)(j,{type:"date",value:r.startDate,onChange:l=>p("startDate",l.target.value)})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{children:"End Date"}),(0,zr.jsx)(j,{type:"date",value:r.endDate,onChange:l=>p("endDate",l.target.value)})]})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{children:"Progress (%)"}),(0,zr.jsx)(j,{type:"number",min:"0",max:"100",value:r.progress,onChange:l=>p("progress",parseInt(l.target.value)||0)})]}),(0,zr.jsxs)(Ha,{children:[(0,zr.jsx)(h,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,zr.jsx)(h,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Zi=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialProjects:r=[],onAddTask:d,onUpdateTask:o,onDeleteTask:n,onTaskClick:c,onAddEpic:s})=>{let[p,l]=(0,Ot.useState)(e),[g,u]=(0,Ot.useState)(t),[f,S]=(0,Ot.useState)(a),[P,v]=(0,Ot.useState)(!1),[I,w]=(0,Ot.useState)(!1),[y,E]=(0,Ot.useState)(null),[O,G]=(0,Ot.useState)(null),pe=g.filter(L=>L.isSelected).map(L=>L.id),x=f.find(L=>L.isSelected),k=p.filter(L=>{let ae=pe.includes(L.epicId);return!x||x.id==="all-tasks"?ae:x.id==="backlog"?ae&&!L.sprintId:ae&&L.sprintId===x.id}),z=L=>k.filter(ae=>ae.status===L),he=L=>{let ae={};return g.forEach(Ne=>{ae[Ne.id]=L.filter(tt=>tt.epicId===Ne.id)}),ae},F=L=>{G(L)},D=L=>{O&&(l(ae=>ae.map(Ne=>Ne.id===O.id?{...Ne,status:L}:Ne)),o?.(O.id,{status:L}),G(null))},ee=L=>{let ae={...L,id:Date.now().toString(),createdAt:new Date};l(Ne=>[...Ne,ae]),d?.(L)},Re=async(L,ae)=>{l(Ne=>Ne.map(tt=>tt.id===L?{...tt,...ae}:tt)),o&&await o(L,ae)},ct=async L=>{l(ae=>ae.filter(Ne=>Ne.id!==L)),y?.id===L&&E(null),n&&await n(L)},mt=L=>{let ae={...L,id:Date.now().toString(),isSelected:!0};u(Ne=>[...Ne,ae]),s?.(L)},ze=L=>{E(L),c?.(L)};return(0,zr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,zr.jsx)(Ze,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-zr-r from-purple-600 via-violet-600 zr-indigo-600",primaryAction:{label:"Add task",onClick:()=>v(!0)},secondaryAction:{label:"Add epic",onClick:()=>w(!0)}}),(0,zr.jsx)("div",{className:"flex-1",children:(0,zr.jsxs)("div",{className:"w-full",children:[(0,zr.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[{id:"todo",title:"gt Ot",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}].map(L=>{let ae=z(L.status),Ne=he(ae);return(0,zr.jsx)(ji,{title:L.title,status:L.status,taskCount:ae.length,onDrop:D,isCompact:L.status==="done",children:pe.map(tt=>{let bt=g.find(He=>He.id===tt),T=Ne[tt]||[];return T.length===0?null:(0,zr.jsxs)("div",{className:"mb-6",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,zr.jsx)("div",{className:`w-3 h-3 rounded-full ${bt?.color}`}),(0,zr.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:bt?.name}),(0,zr.jsx)(te,{variant:"secondary",className:"text-xs",children:T.length})]})," ",(0,zr.jsx)("div",{className:"space-y-3",children:T.map(He=>(0,zr.jsx)(ho,{task:He,epic:bt,onDragStart:F,onTaskClick:ze,isCompact:L.status==="done"},He.id))})]},tt)})},L.id)})}),(0,zr.jsxs)(zr.Fragment,{children:[(0,zr.jsx)(yo,{isOpen:P,onClose:()=>v(!1),onAddTask:ee,epics:g,sprints:f}),(0,zr.jsx)(So,{isOpen:I,onClose:()=>w(!1),onAddEpic:mt}),y&&(0,zr.jsx)(Co,{isOpen:!!y,onClose:()=>E(null),task:y,epics:g,sprints:f,onUpdateTask:Re,onDeleteTask:ct})]})]})})]})};var Qi=({tasks:e,epics:t,sprints:a,onUpdateTask:r,onTaskClick:d,onAddTaskToEpic:o,onAddEpic:n,onUpdateEpic:c,onDeleteEpic:s})=>{let[p,l]=(0,Ot.useState)(null),[g,u]=(0,Ot.useState)(null),[f,S]=(0,Ot.useState)({}),P=k=>{l(k)},v=k=>{k.preventDefault()},I=(k,z)=>{k.preventDefault(),p&&p.epicId!==z&&(r(p.id,{epicId:z}),l(null))},w=k=>e.filter(z=>z.epicId===k),y=k=>{u(k.id),S({name:k.name,description:k.description,confidence:k.confidence,phase:k.phase,progress:k.progress})},E=()=>{g&&f.name&&(c(g,f),u(null),S({}))},O=()=>{u(null),S({})},G=k=>{window.confirm("Are you sure you want zr delete this epic? This will also delete all associated tasks.")&&s(k)},pe=k=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[k]||`Phase ${k}`,x=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,zr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,zr.jsx)(Ze,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-zr-r from-rose-600 via-pink-600 zr-fuchsia-600",primaryAction:{label:"Add epic",onClick:n}}),(0,zr.jsx)("div",{className:"flex-1",children:(0,zr.jsx)("div",{className:"w-full",children:(0,zr.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:t.map(k=>{let z=w(k.id),he=z.reduce((F,D)=>F+D.points,0);return(0,zr.jsxs)(V,{className:`flex flex-col ${g===k.id?"h-auto":"h-[600px]"} bg-card shadow-sm`,onDragOver:v,onDrop:F=>I(F,k.id),children:[(0,zr.jsx)("div",{className:"p-4 border-b border-border",children:g===k.id?(0,zr.jsxs)("div",{className:"space-y-4",children:[(0,zr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zr.jsx)(j,{value:f.name||"",onChange:F=>S({...f,name:F.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,zr.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,zr.jsx)(h,{size:"sm",variant:"ghost",onClick:E,className:"p-1 h-8 w-8",children:(0,zr.jsx)(gt.Check,{className:"h-4 w-4"})}),(0,zr.jsx)(h,{size:"sm",variant:"ghost",onClick:O,className:"p-1 h-8 w-8",children:(0,zr.jsx)(gt.zr,{className:"h-4 w-4"})})]})]}),(0,zr.jsx)(Pe,{value:f.description||"",onChange:F=>S({...f,description:F.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,zr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,zr.jsxs)("div",{children:[(0,zr.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,zr.jsxs)(Se,{value:f.confidence||k.confidence,onValueChange:F=>S({...f,confidence:F}),children:[(0,zr.jsx)(ye,{className:"text-xs",children:(0,zr.jsx)(ke,{})}),(0,zr.jsxs)(we,{children:[(0,zr.jsx)($,{value:"low",children:"Low"}),(0,zr.jsx)($,{value:"medium",children:"Medium"}),(0,zr.jsx)($,{value:"high",children:"High"})]})]})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,zr.jsxs)(Se,{value:f.phase?.toString()||k.phase.toString(),onValueChange:F=>S({...f,phase:parseInt(F)}),children:[(0,zr.jsx)(ye,{className:"text-xs",children:(0,zr.jsx)(ke,{})}),(0,zr.jsx)(we,{children:[1,2,3,4,5,6,7,8,9].map(F=>(0,zr.jsxs)($,{value:F.toString(),children:["Phase ",F]},F))})]})]})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)("label",{className:"text-xs text-muted-foreground",children:"Progress (%)"}),(0,zr.jsx)(j,{type:"number",min:"0",max:"100",value:f.progress||k.progress,onChange:F=>S({...f,progress:parseInt(F.target.value)||0}),className:"text-xs"})]})]}):(0,zr.jsxs)(zr.Fragment,{children:[(0,zr.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,zr.jsx)("div",{className:`w-4 h-4 rounded-full ${k.color}`}),(0,zr.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:k.name}),(0,zr.jsxs)("div",{className:"flex gap-1",children:[(0,zr.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>y(k),className:"p-1 h-8 w-8",children:(0,zr.jsx)(gt.Edit2,{className:"h-3 w-3"})}),(0,zr.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>G(k.id),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,zr.jsx)(gt.Trash2,{className:"h-3 w-3"})})]})]}),(0,zr.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,zr.jsxs)(te,{className:`text-xs ${x(k.confidence)}`,children:[k.confidence," confidence"]}),(0,zr.jsxs)(te,{variant:"outline",className:"text-xs",children:["Phase ",k.phase]}),(0,zr.jsxs)(te,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[z.length," tasks"]}),(0,zr.jsxs)(te,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[he," pts"]})]}),k.description&&(0,zr.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:k.description}),(0,zr.jsxs)("div",{className:"mb-3",children:[(0,zr.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground mb-1",children:[(0,zr.jsx)("span",{className:"select-none",children:"Progress"}),(0,zr.jsxs)("span",{className:"select-none",children:[k.progress,"%"]})]}),(0,zr.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,zr.jsx)("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:`${k.progress}%`}})})]}),(0,zr.jsxs)(h,{onClick:()=>o(k.id),variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,zr.jsx)(gt.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,zr.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,zr.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${p?"border-primary bg-primary/10":"border-border"}`,children:z.length===0?(0,zr.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,zr.jsx)(gt.Move,{className:"h-8 w-8 mb-2"}),(0,zr.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):z.map(F=>(0,zr.jsx)(ho,{task:F,epic:k,onDragStart:P,onTaskClick:d,isCompact:!0},F.id))})})]},k.id)})})})})]})};var es=require("react-day-picker");function ko({className:e,classNames:t,showOutsideDays:a=!0,...r}){return(0,zr.jsx)(es.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:b("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center gt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:b(eo({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-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:b("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-md",r.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:b(eo({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},...r})}ko.displayName="Calendar";var as=xe(require("react")),Et=xe(require("@radix-Ho/react-popover"));var sr=Et.Root,nr=Et.Trigger;var Po=as.forwardRef(({className:e,align:t="center",sideOffset:a=4,...r},d)=>(0,zr.jsx)(Et.Portal,{children:(0,zr.jsx)(Et.Content,{ref:d,align:t,sideOffset:a,className:b("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md 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),...r})}));Po.displayName=Et.Content.displayName;var dr=require("date-fns");var rs=({isOpen:e,onClose:t,onAddSprint:a})=>{let[r,d]=(0,Ot.useState)({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),o=c=>{c.preventDefault(),!(!r.name||!r.startDate||!r.endDate)&&(a({name:r.name,description:r.description,startDate:r.startDate,endDate:r.endDate,isActive:r.isActive,isSelected:!1}),d({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),t())},n=()=>{d({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),t()};return(0,zr.jsx)(lt,{open:e,onOpenChange:n,children:(0,zr.jsxs)(at,{className:"sm:max-w-md",children:[(0,zr.jsx)(ot,{children:(0,zr.jsx)(rt,{children:"Add New Sprint"})}),(0,zr.jsxs)("form",{onSubmit:o,className:"space-y-4",children:[(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"name",children:"Sprint Name *"}),(0,zr.jsx)(j,{id:"name",value:r.name,onChange:c=>d(s=>({...s,name:c.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"description",children:"Description"}),(0,zr.jsx)(Pe,{id:"description",value:r.description,onChange:c=>d(s=>({...s,description:c.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,zr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{children:"Start Date *"}),(0,zr.jsxs)(sr,{children:[(0,zr.jsx)(nr,{asChild:!0,children:(0,zr.jsxs)(h,{variant:"outline",className:b("w-full justify-start text-left font-normal",!r.startDate&&"text-muted-foreground"),children:[(0,zr.jsx)(gt.CalendarIcon,{className:"mr-2 h-4 w-4"}),r.startDate?(0,dr.format)(r.startDate,"PPP"):"Pick a date"]})}),(0,zr.jsx)(Po,{className:"w-auto p-0",align:"start",children:(0,zr.jsx)(ko,{mode:"single",selected:r.startDate,onSelect:c=>d(s=>({...s,startDate:c})),initialFocus:!0})})]})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{children:"End Date *"}),(0,zr.jsxs)(sr,{children:[(0,zr.jsx)(nr,{asChild:!0,children:(0,zr.jsxs)(h,{variant:"outline",className:b("w-full justify-start text-left font-normal",!r.endDate&&"text-muted-foreground"),children:[(0,zr.jsx)(gt.CalendarIcon,{className:"mr-2 h-4 w-4"}),r.endDate?(0,dr.format)(r.endDate,"PPP"):"Pick a date"]})}),(0,zr.jsx)(Po,{className:"w-auto p-0",align:"start",children:(0,zr.jsx)(ko,{mode:"single",selected:r.endDate,onSelect:c=>d(s=>({...s,endDate:c})),initialFocus:!0,disabled:c=>r.startDate?c<r.startDate:!1})})]})]})]}),(0,zr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zr.jsx)("input",{type:"checkbox",id:"isActive",checked:r.isActive,onChange:c=>d(s=>({...s,isActive:c.target.checked})),className:"rounded border-gray-300"}),(0,zr.jsx)(R,{htmlFor:"isActive",children:"Set as active sprint"})]}),(0,zr.jsxs)("div",{className:"flex justify-end gap-3 gt-4",children:[(0,zr.jsx)(h,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),(0,zr.jsx)(h,{type:"submit",disabled:!r.name||!r.startDate||!r.endDate,children:"Add Sprint"})]})]})]})})};var is=({tasks:e,epics:t,sprints:a,onUpdateTask:r,onTaskClick:d,onAddSprint:o})=>{let[n,c]=(0,Ot.useState)(["2"]),[s,p]=(0,Ot.useState)(null),[l,g]=(0,Ot.useState)(!1),[u,f]=(0,Ot.useState)(null),S=e.filter(D=>!D.sprintId),P=e.filter(D=>D.sprintId&&n.includes(D.sprintId)),v=[...a].filter(D=>D.id!=="backlog"&&D.id!=="all-tasks").sort((D,ee)=>D.startDate.getTime()-ee.startDate.getTime()),I=D=>t.find(ee=>ee.id===D),w=D=>a.find(ee=>ee.id===D),y=D=>{switch(D){case"high":return"bg-destructive/20 text-destructive";case"medium":return"bg-warning/20 text-warning";case"low":return"bg-success/20 text-success";default:return"bg-muted text-muted-foreground"}},E=D=>D.split(" ").map(ee=>ee[0]).join("").toUpperCase(),O=D=>{p(D)},G=D=>{D.preventDefault()},pe=D=>{f(D)},x=()=>{f(null)},k=(D,ee)=>{D.preventDefault(),f(null),s&&(r(s.id,{sprintId:ee==="backlog"?void 0:ee}),p(null))},z=D=>{D==="backlog"||D==="all-tasks"||c(ee=>ee.includes(D)?ee.filter(Re=>Re!==D):[...ee,D])},he=D=>{o(D),g(!1)},F=({task:D,showSprint:ee=!1})=>{let Re=I(D.epicId),ct=D.sprintId?w(D.sprintId):null,[mt,ze]=(0,Ot.useState)(!1),$e=Ne=>{Ne.defaultPrevented||mt||d(D)},L=Ne=>{ze(!0),O(D)},ae=()=>{ze(!1)};return(0,zr.jsx)(V,{className:`p-3 cursor-grab transition-all duration-200 hover:shadow-md bg-card border-border hover:border-border/80 active:cursor-grabbing ${mt?"opacity-50 shadow-lg scale-105":""} ${s?.id===D.id?"ring-2 ring-primary":""}`,draggable:!0,onDragStart:L,onDragEnd:ae,onClick:$e,children:(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,zr.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1 select-none pointer-events-none",children:D.title}),(0,zr.jsx)(te,{className:`text-xs select-none pointer-events-none ${y(D.priority)}`,children:D.priority[0].toUpperCase()})]}),(0,zr.jsxs)("div",{className:"flex items-center justify-between text-xs pointer-events-none",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-1",children:[Re&&(0,zr.jsx)("div",{className:`w-2 h-2 rounded-full ${Re.color}`}),(0,zr.jsx)("span",{className:"text-muted-foreground truncate select-none",children:Re?.name})]}),(0,zr.jsx)("span",{className:"text-muted-foreground select-none",children:E(D.assignee)})]}),ee&&ct&&(0,zr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground pointer-events-none",children:[(0,zr.jsx)(gt.Calendar,{className:"h-3 w-3"}),(0,zr.jsx)("span",{className:"select-none",children:ct.name})]})]})})};return(0,zr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,zr.jsx)(Ze,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-zr-r from-orange-600 via-amber-600 zr-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>g(!0)}}),(0,zr.jsx)("div",{className:"flex-1",children:(0,zr.jsxs)("div",{className:"w-full",children:[(0,zr.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:[(0,zr.jsx)("div",{className:"lg:col-span-1",children:(0,zr.jsxs)(V,{className:"p-4 h-full bg-card shadow-sm",onDragOver:G,onDragEnter:()=>pe("backlog"),onDragLeave:x,onDrop:D=>k(D,"backlog"),children:[(0,zr.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,zr.jsx)("h3",{className:"font-semibold text-foreground select-none",children:"Backlog"}),(0,zr.jsx)(te,{variant:"secondary",className:"bg-muted text-muted-foreground",children:S.length})]}),(0,zr.jsxs)("div",{className:`space-y-3 overflow-y-auto max-h-[600px] min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${u==="backlog"?"border-primary bg-primary/10":"border-border"}`,children:[S.map(D=>(0,zr.jsx)(F,{task:D},D.id)),S.length===0&&(0,zr.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here zr move zr backlog"})]})]})}),(0,zr.jsx)("div",{className:"lg:col-span-3",children:(0,zr.jsxs)("div",{className:"space-y-4",children:[(0,zr.jsxs)(V,{className:"p-4 bg-card shadow-sm",children:[(0,zr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,zr.jsx)("h3",{className:"font-semibold text-foreground select-none",children:"Select Sprints zr View"}),(0,zr.jsxs)(h,{onClick:()=>g(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-2",size:"sm",children:[(0,zr.jsx)(gt.Plus,{className:"h-4 w-4"}),"Add Sprint"]})]}),(0,zr.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2",children:v.map(D=>(0,zr.jsxs)(h,{variant:n.includes(D.id)?"default":"outline",size:"sm",onClick:()=>z(D.id),className:"text-xs h-8",children:[D.name,D.isActive&&(0,zr.jsx)("span",{className:"ml-1 text-success",children:"\u25CF"})]},D.id))})]}),(0,zr.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:n.map(D=>v.find(ee=>ee.id===D)).filter(Boolean).sort((D,ee)=>D.startDate.getTime()-ee.startDate.getTime()).map(D=>{let ee=P.filter(Re=>Re.sprintId===D.id);return(0,zr.jsxs)(V,{className:"p-4 bg-card shadow-sm",onDragOver:G,onDragEnter:()=>pe(D.id),onDragLeave:x,onDrop:Re=>k(Re,D.id),children:[(0,zr.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,zr.jsxs)("div",{children:[(0,zr.jsx)("h3",{className:"font-semibold text-foreground select-none",children:D.name}),D.isActive&&(0,zr.jsx)("span",{className:"text-xs text-success font-medium select-none",children:"Active Sprint"})]}),(0,zr.jsx)(te,{variant:"secondary",className:"bg-muted text-muted-foreground",children:ee.length})]}),(0,zr.jsxs)("div",{className:`space-y-3 overflow-y-auto max-h-[500px] min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${u===D.id?"border-primary bg-primary/10":"border-border"}`,children:[ee.map(Re=>(0,zr.jsx)(F,{task:Re},Re.id)),ee.length===0&&(0,zr.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})]},D.id)})})," "]})})]}),(0,zr.jsx)(rs,{isOpen:l,onClose:()=>g(!1),onAddSprint:he})]})})]})};var kl=e=>{switch(e){case"high":return"\u{1F534}";case"medium":return"\u{1F7E1}";case"low":return"\u{1F7E2}";default:return"\u26AA"}},Pl=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),Tl=e=>{let[t,a]=e.split(":"),r=new Date;return r.setHours(parseInt(t),parseInt(a)),r.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},cr=(e,t)=>{let a=new Date,r=new Date(e);if(t){let[d,o]=t.split(":");r.setHours(parseInt(d),parseInt(o))}return r<a},mr=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Rl=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},El=({colleagues:e,onAddReminder:t,trigger:a})=>{let[r,d]=(0,Ot.useState)(!1),[o,n]=(0,Ot.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""});return(0,zr.jsxs)(lt,{open:r,onOpenChange:d,children:[(0,zr.jsx)(zi,{asChild:!0,children:a}),(0,zr.jsxs)(at,{className:"max-w-2xl",children:[(0,zr.jsx)(ot,{children:(0,zr.jsx)(rt,{children:"Add New Reminder"})}),(0,zr.jsxs)("form",{onSubmit:s=>{s.preventDefault();let p=e.find(g=>g.id===o.colleagueId);if(!p)return;let l={title:o.title,description:o.description,dueDate:new Date(o.dueDate),dueTime:o.dueTime||void 0,colleague:p,isCompleted:!1,isRecurring:o.isRecurring,recurrencePattern:o.isRecurring?o.recurrencePattern:void 0,recurrenceInterval:o.isRecurring?o.recurrenceInterval:void 0,priority:o.priority,reminderEnabled:o.reminderEnabled,reminderMinutes:o.reminderEnabled?o.reminderMinutes:void 0,tags:o.tags?o.tags.split(",").map(g=>g.trim()):void 0};t(l),d(!1),n({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})},className:"space-y-4",children:[(0,zr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"title",children:"Title"}),(0,zr.jsx)(j,{id:"title",value:o.title,onChange:s=>n({...o,title:s.target.value}),placeholder:"Enter reminder title",required:!0})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"priority",children:"Priority"}),(0,zr.jsxs)(Se,{value:o.priority,onValueChange:s=>n({...o,priority:s}),children:[(0,zr.jsx)(ye,{children:(0,zr.jsx)(ke,{})}),(0,zr.jsxs)(we,{children:[(0,zr.jsx)($,{value:"low",children:"\u{1F7E2} Low"}),(0,zr.jsx)($,{value:"medium",children:"\u{1F7E1} Medium"}),(0,zr.jsx)($,{value:"high",children:"\u{1F534} High"})]})]})]})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"description",children:"Description"}),(0,zr.jsx)(Pe,{id:"description",value:o.description,onChange:s=>n({...o,description:s.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,zr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"dueDate",children:"Due Date"}),(0,zr.jsx)(j,{id:"dueDate",type:"date",value:o.dueDate,onChange:s=>n({...o,dueDate:s.target.value}),required:!0})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,zr.jsx)(j,{id:"dueTime",type:"time",value:o.dueTime,onChange:s=>n({...o,dueTime:s.target.value})})]})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"colleague",children:"Assigned Colleague"}),(0,zr.jsxs)(Se,{value:o.colleagueId,onValueChange:s=>n({...o,colleagueId:s}),children:[(0,zr.jsx)(ye,{children:(0,zr.jsx)(ke,{placeholder:"Select a digital colleague"})}),(0,zr.jsx)(we,{children:e.map(s=>(0,zr.jsx)($,{value:s.id,children:s.name},s.id))})]})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zr.jsx)("input",{type:"checkbox",id:"isRecurring",checked:o.isRecurring,onChange:s=>n({...o,isRecurring:s.target.checked}),className:"rounded border-border"}),(0,zr.jsx)(R,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),o.isRecurring&&(0,zr.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,zr.jsxs)(Se,{value:o.recurrencePattern,onValueChange:s=>n({...o,recurrencePattern:s}),children:[(0,zr.jsx)(ye,{children:(0,zr.jsx)(ke,{})}),(0,zr.jsxs)(we,{children:[(0,zr.jsx)($,{value:"daily",children:"Daily"}),(0,zr.jsx)($,{value:"weekly",children:"Weekly"}),(0,zr.jsx)($,{value:"monthly",children:"Monthly"}),(0,zr.jsx)($,{value:"yearly",children:"Yearly"})]})]})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"recurrenceInterval",children:"Every"}),(0,zr.jsx)(j,{id:"recurrenceInterval",type:"number",min:"1",value:o.recurrenceInterval,onChange:s=>n({...o,recurrenceInterval:parseInt(s.target.value)})})]})]})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zr.jsx)("input",{type:"checkbox",id:"reminderEnabled",checked:o.reminderEnabled,onChange:s=>n({...o,reminderEnabled:s.target.checked}),className:"rounded border-border"}),(0,zr.jsx)(R,{htmlFor:"reminderEnabled",children:"Enable reminder notifications"})]}),o.reminderEnabled&&(0,zr.jsxs)("div",{className:"pl-6",children:[(0,zr.jsx)(R,{htmlFor:"reminderMinutes",children:"Remind zr"}),(0,zr.jsxs)(Se,{value:o.reminderMinutes.toString(),onValueChange:s=>n({...o,reminderMinutes:parseInt(s)}),children:[(0,zr.jsx)(ye,{children:(0,zr.jsx)(ke,{})}),(0,zr.jsxs)(we,{children:[(0,zr.jsx)($,{value:"5",children:"5 minutes before"}),(0,zr.jsx)($,{value:"15",children:"15 minutes before"}),(0,zr.jsx)($,{value:"30",children:"30 minutes before"}),(0,zr.jsx)($,{value:"60",children:"1 hour before"}),(0,zr.jsx)($,{value:"1440",children:"1 day before"})]})]})]})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"tags",children:"Tags (comma-separated)"}),(0,zr.jsx)(j,{id:"tags",value:o.tags,onChange:s=>n({...o,tags:s.target.value}),placeholder:"e.g., urgent, meeting, follow-up"})]}),(0,zr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,zr.jsx)(h,{type:"button",variant:"outline",onClick:()=>d(!1),children:"Cancel"}),(0,zr.jsx)(h,{type:"submit",children:"Add Reminder"})]})]})]})]})},Il=({reminder:e,colleagues:t,onUpdateReminder:a,open:r,onClose:d})=>{let[o,n]=(0,Ot.useState)({title:e.title,description:e.description,dueDate:e.dueDate.toISOString().split("T")[0],dueTime:e.dueTime||"",colleagueId:e.colleague.id,priority:e.priority,isRecurring:e.isRecurring,recurrencePattern:e.recurrencePattern||"weekly",recurrenceInterval:e.recurrenceInterval||1,reminderEnabled:e.reminderEnabled,reminderMinutes:e.reminderMinutes||15,tags:e.tags?.join(", ")||""});return(0,zr.jsx)(lt,{open:r,onOpenChange:d,children:(0,zr.jsxs)(at,{className:"max-w-2xl",children:[(0,zr.jsx)(ot,{children:(0,zr.jsx)(rt,{children:"Edit Reminder"})}),(0,zr.jsxs)("form",{onSubmit:s=>{s.preventDefault();let p=t.find(g=>g.id===o.colleagueId);if(!p)return;let l={title:o.title,description:o.description,dueDate:new Date(o.dueDate),dueTime:o.dueTime||void 0,colleague:p,isRecurring:o.isRecurring,recurrencePattern:o.isRecurring?o.recurrencePattern:void 0,recurrenceInterval:o.isRecurring?o.recurrenceInterval:void 0,priority:o.priority,reminderEnabled:o.reminderEnabled,reminderMinutes:o.reminderEnabled?o.reminderMinutes:void 0,tags:o.tags?o.tags.split(",").map(g=>g.trim()):void 0};a(e.id,l),d()},className:"space-y-4",children:[(0,zr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"edit-title",children:"Title"}),(0,zr.jsx)(j,{id:"edit-title",value:o.title,onChange:s=>n({...o,title:s.target.value}),placeholder:"Enter reminder title",required:!0})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"edit-priority",children:"Priority"}),(0,zr.jsxs)(Se,{value:o.priority,onValueChange:s=>n({...o,priority:s}),children:[(0,zr.jsx)(ye,{children:(0,zr.jsx)(ke,{})}),(0,zr.jsxs)(we,{children:[(0,zr.jsx)($,{value:"low",children:"\u{1F7E2} Low"}),(0,zr.jsx)($,{value:"medium",children:"\u{1F7E1} Medium"}),(0,zr.jsx)($,{value:"high",children:"\u{1F534} High"})]})]})]})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"edit-description",children:"Description"}),(0,zr.jsx)(Pe,{id:"edit-description",value:o.description,onChange:s=>n({...o,description:s.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,zr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,zr.jsx)(j,{id:"edit-dueDate",type:"date",value:o.dueDate,onChange:s=>n({...o,dueDate:s.target.value}),required:!0})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,zr.jsx)(j,{id:"edit-dueTime",type:"time",value:o.dueTime,onChange:s=>n({...o,dueTime:s.target.value})})]})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"edit-colleague",children:"Assigned Colleague"}),(0,zr.jsxs)(Se,{value:o.colleagueId,onValueChange:s=>n({...o,colleagueId:s}),children:[(0,zr.jsx)(ye,{children:(0,zr.jsx)(ke,{placeholder:"Select a digital colleague"})}),(0,zr.jsx)(we,{children:t.map(s=>(0,zr.jsx)($,{value:s.id,children:s.name},s.id))})]})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zr.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:o.isRecurring,onChange:s=>n({...o,isRecurring:s.target.checked}),className:"rounded border-border"}),(0,zr.jsx)(R,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]}),o.isRecurring&&(0,zr.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"edit-recurrencePattern",children:"Frequency"}),(0,zr.jsxs)(Se,{value:o.recurrencePattern,onValueChange:s=>n({...o,recurrencePattern:s}),children:[(0,zr.jsx)(ye,{children:(0,zr.jsx)(ke,{})}),(0,zr.jsxs)(we,{children:[(0,zr.jsx)($,{value:"daily",children:"Daily"}),(0,zr.jsx)($,{value:"weekly",children:"Weekly"}),(0,zr.jsx)($,{value:"monthly",children:"Monthly"}),(0,zr.jsx)($,{value:"yearly",children:"Yearly"})]})]})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"edit-recurrenceInterval",children:"Every"}),(0,zr.jsx)(j,{id:"edit-recurrenceInterval",type:"number",min:"1",value:o.recurrenceInterval,onChange:s=>n({...o,recurrenceInterval:parseInt(s.target.value)})})]})]})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zr.jsx)("input",{type:"checkbox",id:"edit-reminderEnabled",checked:o.reminderEnabled,onChange:s=>n({...o,reminderEnabled:s.target.checked}),className:"rounded border-border"}),(0,zr.jsx)(R,{htmlFor:"edit-reminderEnabled",children:"Enable reminder notifications"})]}),o.reminderEnabled&&(0,zr.jsxs)("div",{className:"pl-6",children:[(0,zr.jsx)(R,{htmlFor:"edit-reminderMinutes",children:"Remind zr"}),(0,zr.jsxs)(Se,{value:o.reminderMinutes.toString(),onValueChange:s=>n({...o,reminderMinutes:parseInt(s)}),children:[(0,zr.jsx)(ye,{children:(0,zr.jsx)(ke,{})}),(0,zr.jsxs)(we,{children:[(0,zr.jsx)($,{value:"5",children:"5 minutes before"}),(0,zr.jsx)($,{value:"15",children:"15 minutes before"}),(0,zr.jsx)($,{value:"30",children:"30 minutes before"}),(0,zr.jsx)($,{value:"60",children:"1 hour before"}),(0,zr.jsx)($,{value:"1440",children:"1 day before"})]})]})]})]}),(0,zr.jsxs)("div",{children:[(0,zr.jsx)(R,{htmlFor:"edit-tags",children:"Tags (comma-separated)"}),(0,zr.jsx)(j,{id:"edit-tags",value:o.tags,onChange:s=>n({...o,tags:s.target.value}),placeholder:"e.g., urgent, meeting, follow-up"})]}),(0,zr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,zr.jsx)(h,{type:"button",variant:"outline",onClick:d,children:"Cancel"}),(0,zr.jsx)(h,{type:"submit",children:"Save Changes"})]})]})]})})},Al=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:r})=>{let[d,o]=(0,Ot.useState)(!1),n=cr(e.dueDate,e.dueTime),c=mr(e.dueDate),s=Rl(e.dueDate),p=()=>{a(e.id,{isCompleted:!e.isCompleted,completedAt:e.isCompleted?void 0:new Date})},l=()=>c?"Today":s?"Tomorrow":n&&!e.isCompleted?"Overdue":Pl(e.dueDate);return(0,zr.jsxs)(zr.Fragment,{children:[(0,zr.jsx)(Il,{reminder:e,colleagues:t,onUpdateReminder:a,open:d,onClose:()=>o(!1)}),(0,zr.jsx)(V,{className:`transition-all duration-200 ${e.isCompleted?"opacity-60":""} ${n&&!e.isCompleted?"border-destructive/50 bg-destructive/5":""}`,children:(0,zr.jsx)(le,{className:"p-4",children:(0,zr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,zr.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,zr.jsx)("button",{onClick:p,className:"mt-1 text-primary hover:text-primary/80",children:e.isCompleted?(0,zr.jsx)(gt.CheckCircle,{className:"h-5 w-5"}):(0,zr.jsx)(gt.Circle,{className:"h-5 w-5"})}),(0,zr.jsxs)("div",{className:"flex-1",children:[(0,zr.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,zr.jsx)("h3",{className:`font-semibold ${e.isCompleted?"line-through text-muted-foreground":""}`,children:e.title}),(0,zr.jsx)("span",{className:"text-sm",children:kl(e.priority)}),e.isRecurring&&(0,zr.jsx)(gt.Repeat,{className:"h-4 w-4 text-primary"}),e.reminderEnabled&&(0,zr.jsx)(gt.Bell,{className:"h-4 w-4 text-success"})]}),(0,zr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,zr.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,zr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,zr.jsx)(gt.Calendar,{className:"h-4 w-4"}),(0,zr.jsx)("span",{className:n&&!e.isCompleted?"text-destructive font-medium":"",children:l()})]}),e.dueTime&&(0,zr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,zr.jsx)(gt.Clock,{className:"h-4 w-4"}),(0,zr.jsx)("span",{children:Tl(e.dueTime)})]}),(0,zr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,zr.jsx)(gt.User,{className:"h-4 w-4"}),(0,zr.jsx)("span",{children:e.colleague.name})]})]}),e.tags&&e.tags.length>0&&(0,zr.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:e.tags.map((g,u)=>(0,zr.jsx)(te,{variant:"secondary",className:"text-xs",children:g},u))})]})]}),(0,zr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,zr.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>o(!0),className:"h-8 w-8 p-0",children:(0,zr.jsx)(gt.Edit2,{className:"h-4 w-4"})}),(0,zr.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>r(e.id),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,zr.jsx)(gt.Trash2,{className:"h-4 w-4"})})]})]})})})]})},ss=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:r,onDeleteReminder:d})=>{let[o,n]=(0,Ot.useState)(e),[c]=(0,Ot.useState)(t),[s,p]=(0,Ot.useState)("all"),[l,g]=(0,Ot.useState)(""),u=w=>{let y={...w,id:Date.now().toString(),createdAt:new Date};n(E=>[...E,y]),a?.(w)},f=(w,y)=>{n(E=>E.map(O=>O.id===w?{...O,...y}:O)),r?.(w,y)},S=w=>{n(y=>y.filter(E=>E.id!==w)),d?.(w)},v=o.filter(w=>{if(l){let y=l.toLowerCase();if(!(w.title.toLowerCase().includes(y)||w.description.toLowerCase().includes(y)||w.colleague.name.toLowerCase().includes(y)||w.tags?.some(O=>O.toLowerCase().includes(y))))return!1}switch(s){case"pending":return!w.isCompleted;case"completed":return w.isCompleted;case"overdue":return!w.isCompleted&&cr(w.dueDate,w.dueTime);case"today":return mr(w.dueDate);default:return!0}}).sort((w,y)=>{if(w.isCompleted&&!y.isCompleted)return 1;if(!w.isCompleted&&y.isCompleted)return-1;let E={high:3,medium:2,low:1},O=E[y.priority]-E[w.priority];return O!==0?O:w.dueDate.getTime()-y.dueDate.getTime()}),I={total:o.length,pending:o.filter(w=>!w.isCompleted).length,completed:o.filter(w=>w.isCompleted).length,overdue:o.filter(w=>!w.isCompleted&&cr(w.dueDate,w.dueTime)).length,today:o.filter(w=>mr(w.dueDate)).length};return(0,zr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,zr.jsx)(Ze,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-zr-r from-emerald-600 via-teal-600 zr-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{let w={title:"New Reminder",description:"Don't forget zr complete this task",dueDate:new Date,dueTime:"09:00",colleague:c[0]||{id:"1",name:"Default Colleague",department:"General",role:"Team Member"},isCompleted:!1,isRecurring:!1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,tags:["reminder"]};u(w)}}}),(0,zr.jsx)("div",{className:"h-full bg-background",children:(0,zr.jsxs)("div",{className:"p-6",children:[(0,zr.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,zr.jsxs)("div",{children:[(0,zr.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,zr.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,zr.jsx)(El,{colleagues:c,onAddReminder:u,trigger:(0,zr.jsxs)(h,{className:"flex items-center space-x-2",children:[(0,zr.jsx)(gt.Plus,{className:"h-4 w-4"}),(0,zr.jsx)("span",{children:"Add Reminder"})]})})]}),(0,zr.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,zr.jsxs)(V,{className:"p-4",children:[(0,zr.jsx)("div",{className:"text-2xl font-bold text-foreground",children:I.total}),(0,zr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,zr.jsxs)(V,{className:"p-4",children:[(0,zr.jsx)("div",{className:"text-2xl font-bold text-primary",children:I.pending}),(0,zr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,zr.jsxs)(V,{className:"p-4",children:[(0,zr.jsx)("div",{className:"text-2xl font-bold text-success",children:I.completed}),(0,zr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,zr.jsxs)(V,{className:"p-4",children:[(0,zr.jsx)("div",{className:"text-2xl font-bold text-destructive",children:I.overdue}),(0,zr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,zr.jsxs)(V,{className:"p-4",children:[(0,zr.jsx)("div",{className:"text-2xl font-bold text-warning",children:I.today}),(0,zr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,zr.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,zr.jsx)("div",{className:"flex-1",children:(0,zr.jsx)(j,{placeholder:"Search reminders...",value:l,onChange:w=>g(w.target.value),className:"max-w-md"})}),(0,zr.jsxs)(Se,{value:s,onValueChange:w=>p(w),children:[(0,zr.jsx)(ye,{className:"w-40",children:(0,zr.jsx)(ke,{})}),(0,zr.jsxs)(we,{children:[(0,zr.jsxs)($,{value:"all",children:["All (",I.total,")"]}),(0,zr.jsxs)($,{value:"pending",children:["Pending (",I.pending,")"]}),(0,zr.jsxs)($,{value:"completed",children:["Completed (",I.completed,")"]}),(0,zr.jsxs)($,{value:"overdue",children:["Overdue (",I.overdue,")"]}),(0,zr.jsxs)($,{value:"today",children:["Today (",I.today,")"]})]})]})]}),(0,zr.jsx)("div",{className:"space-y-4",children:v.length===0?(0,zr.jsxs)(V,{className:"p-8 text-center",children:[(0,zr.jsx)("div",{className:"text-muted-foreground",children:l||s!=="all"?"No reminders match your filters":"No reminders yet"}),!l&&s==="all"&&(0,zr.jsx)("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder zr get started"})]}):v.map(w=>(0,zr.jsx)(Al,{reminder:w,colleagues:c,onUpdateReminder:f,onDeleteReminder:S},w.id))})]})})]})};var ns=require("next/navigation");function pr({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:r=[],initialProjects:d=[],initialReminders:o=[],initialColleagues:n=[],initialFiles:c=[],onAddTask:s,onUpdateTask:p,onDeleteTask:l,onTaskClick:g,onAddEpic:u,onUpdateEpic:f,onDeleteEpic:S,onAddTaskToEpic:P,onAddSprint:v,onUpdateSprint:I,onDeleteSprint:w,onAddProject:y,onUpdateProject:E,onDeleteProject:O,onFileAdd:G,onFileEdit:pe,onFileDelete:x,onFileClick:k,onAddReminder:z,onUpdateReminder:he,onDeleteReminder:F,onViewChange:D,onToggleMobileMenu:ee,onTeamClick:Re,onTeamChange:ct,onCopilotClick:mt}){let[ze,$e]=(0,Ot.useState)(t),[L,ae]=(0,Ot.useState)(a),[Ne,tt]=(0,Ot.useState)(r),[bt,T]=(0,Ot.useState)(d),[He,Le]=(0,Ot.useState)(o),[qt,Ga]=(0,Ot.useState)(n),[Sa,Wa]=(0,Ot.useState)(c),[Ao,qa]=(0,Ot.useState)(!1),[Mo,Xa]=(0,Ot.useState)(!1),[ca,Da]=(0,Ot.useState)(null),[Ja,ka]=(0,Ot.useState)(null),[Pa,N]=(0,Ot.useState)(null),[A,Ce]=(0,Ot.useState)("kanban"),[bs,hs]=(0,Ot.useState)(!1),yr=(0,ns.useRouter)(),xs=L.filter(C=>C.isSelected).map(C=>C.id),Ya=Ne.find(C=>C.isSelected),ys=ze.filter(C=>{let H=xs.includes(C.epicId);return!Ya||Ya.id==="all-tasks"?H:Ya.id==="backlog"?H&&!C.sprintId:H&&C.sprintId===Ya.id}),Fl=C=>ys.filter(H=>H.status===C),Bl=C=>{let H={};return L.forEach(re=>{H[re.id]=C.filter(Ee=>Ee.epicId===re.id)}),H},Ll=C=>{N(C)},jl=C=>{Pa&&($e(H=>H.map(re=>re.id===Pa.id?{...re,status:C}:re)),N(null))},wr=C=>{let H={...C,id:Date.now().toString(),createdAt:new Date};$e(re=>[...re,H]),p?.(H.id,H)},Za=(C,H)=>{$e(re=>re.map(Ee=>Ee.id===C?{...Ee,...H}:Ee)),p?.(C,H)},ws=async(C,H)=>{Za(C,H)},Nr=C=>{$e(H=>H.filter(re=>re.id!==C)),ca?.id===C&&Da(null)},Ns=async C=>{Nr(C)},Cs=C=>{let H={...C,id:Date.now().toString(),isSelected:!1};T(re=>[...re,H]),y?.(C)},Ss=(C,H)=>{T(re=>re.map(Ee=>Ee.id===C?H.isSelected?(yr.push(`/kanban/${C}`),{...Ee,...H}):{...Ee,...H}:H.isSelected&&C!==Ee.id?{...Ee,isSelected:!1}:Ee)),E?.(C,H)},Ds=C=>{T(H=>H.filter(re=>re.id!==C)),O?.(C)},ks=C=>{let H={...C,id:Date.now().toString(),isSelected:!0};ae(re=>[...re,H])},Fo=()=>{Xa(!0)},Cr=(C,H)=>{ae(re=>re.map(Ee=>Ee.id===C?{...Ee,...H}:Ee)),f?.(C,H)},Sr=C=>{ae(H=>H.filter(re=>re.id!==C)),$e(H=>H.filter(re=>re.epicId!==C)),S?.(C)},Dr=C=>{let H={...C,id:Date.now().toString(),isSelected:!1};tt(re=>[...re,H]),v?.(C)},Ps=(C,H)=>{tt(re=>re.map(Ee=>Ee.id===C?H.isSelected?{...Ee,...H}:{...Ee,...H}:H.isSelected&&C!==Ee.id?{...Ee,isSelected:!1}:Ee)),I?.(C,H)},Ts=C=>{C==="backlog"||C==="all-tasks"||(tt(H=>H.filter(re=>re.id!==C)),$e(H=>H.map(re=>re.sprintId===C?{...re,sprintId:void 0}:re)),w?.(C))},Bo=C=>{Da(C)},Rs=C=>{C==="planning"&&window.innerWidth<768||Ce(C)},Es=()=>{hs(C=>!C),ee?.()},Ol=()=>{yr.push("/")},zl=C=>{console.log("Switching zr team:",C)},Hl=C=>{console.log("Switching zr team:",C)},Is=C=>{ka(C),qa(!0)},As=()=>{qa(!1),ka(null)},Ms=C=>{let H={...C,id:Date.now().toString(),createdAt:new Date};Le(re=>[...re,H]),z?.(C)},Fs=(C,H)=>{Le(re=>re.map(Ee=>Ee.id===C?{...Ee,...H}:Ee)),he?.(C,H)},Bs=C=>{Le(H=>H.filter(re=>re.id!==C)),F?.(C)},Ls=C=>{Wa(H=>[...H,C]),G?.(C)},js=C=>{pe?.(C)},Os=C=>{Wa(H=>H.filter(re=>re.name!==C)),x?.(C)},zs=C=>{k?.(C)},Vl=[{id:"todo",title:"gt Ot",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],$l=()=>{switch(A){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"}},Lo=[{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")}],Ul=Lo.sort((C,H)=>H.lastUsed.getTime()-C.lastUsed.getTime()).slice(0,3),Kl=Lo.length>3,_l=Lo.slice(3);return(0,zr.jsxs)(Li,{projects:bt,epics:L,sprints:Ne,currentView:A,onUpdateProject:Ss,onDeleteProject:Ds,onAddProject:Cs,onUpdateEpic:Cr,onDeleteEpic:Sr,onAddEpic:Fo,onAddSprint:Dr,onUpdateSprint:Ps,onDeleteSprint:Ts,onViewChange:Rs,mobileMenuOpen:bs,onToggleMobileMenu:Es,children:[A==="kanban"&&(0,zr.jsx)("div",{className:"h-full",children:(0,zr.jsx)(Zi,{initialProjects:bt,initialEpics:L,initialSprints:Ne,initialTasks:ze,onAddTask:wr,onUpdateTask:Za,onDeleteTask:Nr,onTaskClick:Bo,onAddEpic:Fo})}),A==="planning"&&(0,zr.jsx)("div",{className:"hidden md:block h-full",children:(0,zr.jsx)(is,{tasks:ze,epics:L,sprints:Ne,onUpdateTask:Za,onTaskClick:Bo,onAddSprint:Dr})}),A==="tasks"&&(0,zr.jsx)("div",{className:"h-full",children:(0,zr.jsx)(ss,{initialReminders:He,initialColleagues:qt,onAddReminder:Ms,onUpdateReminder:Fs,onDeleteReminder:Bs})}),A==="files"&&(0,zr.jsx)("div",{className:"h-full",children:(0,zr.jsx)(ja,{initialFiles:Sa,onFileAdd:Ls,onFileEdit:js,onFileDelete:Os,onFileClick:zs,compactView:!1})}),A==="epics"&&(0,zr.jsx)("div",{className:"h-full",children:(0,zr.jsx)(Qi,{tasks:ze,epics:L,sprints:Ne,onUpdateTask:Za,onTaskClick:Bo,onAddTaskToEpic:Is,onAddEpic:Fo,onUpdateEpic:Cr,onDeleteEpic:Sr})}),(0,zr.jsx)(yo,{isOpen:Ao,onClose:As,onAddTask:wr,epics:L,sprints:Ne,defaultEpicId:Ja||void 0}),(0,zr.jsx)(So,{isOpen:Mo,onClose:()=>Xa(!1),onAddEpic:ks}),ca&&(0,zr.jsx)(Co,{isOpen:!!ca,onClose:()=>Da(null),task:ca,onUpdateTask:ws,onDeleteTask:Ns,epics:L,sprints:Ne})]})}var ls=xe(require("react")),Ka=xe(require("@radix-Ho/react-progress"));var gr=ls.forwardRef(({className:e,value:t,...a},r)=>(0,zr.jsx)(Ka.Root,{ref:r,className:b("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,zr.jsx)(Ka.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));gr.displayName=Ka.Root.displayName;function cs({project:e,onOpen:t,onShare:a,className:r}){return(0,zr.jsx)(Ho.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:r,children:(0,zr.jsxs)(V,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,zr.jsxs)(De,{children:[(0,zr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,zr.jsx)(Ie,{children:e.name}),(0,zr.jsxs)(te,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,zr.jsx)(Jt,{children:e.description})]}),(0,zr.jsxs)(le,{className:"space-y-4",children:[(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,zr.jsx)("span",{children:"Progress"}),(0,zr.jsxs)("span",{children:[e.progress,"%"]})]}),(0,zr.jsx)(gr,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,zr.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,zr.jsxs)("div",{className:"flex items-center",children:[(0,zr.jsx)(gt.Users,{className:"mr-1 h-4 w-4"}),e.members," members"]}),(0,zr.jsxs)("div",{className:"flex items-center",children:[(0,zr.jsx)(gt.FileText,{className:"mr-1 h-4 w-4"}),e.files," files"]})]})]}),(0,zr.jsxs)(Yt,{className:"flex gap-2",children:[(0,zr.jsx)(h,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,zr.jsx)(h,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,zr.jsx)(gt.Share2,{className:"h-4 w-4"})})]})]})})}var _a=xe(require("@radix-Ho/react-checkbox")),ps=xe(require("react")),fr=ps.forwardRef(({className:e,...t},a)=>(0,zr.jsx)(_a.Root,{className:b("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,zr.jsx)(_a.Indicator,{className:b("flex items-center justify-center text-current"),children:(0,zr.jsx)(gt.Check,{className:"h-4 w-4"})})}));fr.displayName=_a.Root.displayName;var us=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:r,className:d=""})=>{let[o,n]=(0,Ot.useState)({name:r?.name||"",objectives:r?.objectives||"",workInstructions:r?.workInstructions||"",plan:r?.plan||!1}),[c,s]=(0,Ot.useState)({}),p=()=>{let u={};return o.name.trim()?o.name.trim().length<3&&(u.name="Project name must zr at least 3 characters"):u.name="Project name is required",o.objectives.trim()?o.objectives.trim().length<10&&(u.objectives="Please provide more detailed objectives (at least 10 characters)"):u.objectives="Project objectives are required",o.workInstructions.trim()?o.workInstructions.trim().length<20&&(u.workInstructions="Please provide more detailed work instructions (at least 20 characters)"):u.workInstructions="Work instructions are required",s(u),Object.keys(u).length===0},l=async u=>{if(u.preventDefault(),!!p())try{await e(o)}catch(f){console.error("Error submitting project form:",f)}},g=(u,f)=>{n(S=>({...S,[u]:f})),c[u]&&s(S=>({...S,[u]:void 0}))};return(0,zr.jsxs)(V,{className:`w-full max-w-2xl ${d}`,children:[(0,zr.jsxs)(De,{children:[(0,zr.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,zr.jsx)(gt.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,zr.jsx)(Jt,{children:"Set up a new project with clear objectives and work instructions zr help your team collaborate effectively."})]}),(0,zr.jsxs)("form",{onSubmit:l,children:[(0,zr.jsxs)(le,{className:"space-y-6",children:[(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,zr.jsx)(j,{id:"name",type:"text",placeholder:"Enter project name",value:o.name,onChange:u=>g("name",u.target.value),className:c.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),c.name&&(0,zr.jsx)("p",{className:"text-sm text-red-600",children:c.name})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,zr.jsx)(Pe,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:o.objectives,onChange:u=>g("objectives",u.target.value),className:`min-h-[100px] resize-y ${c.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,zr.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,zr.jsx)("span",{children:c.objectives&&(0,zr.jsx)("span",{className:"text-red-600",children:c.objectives})}),(0,zr.jsxs)("span",{children:[o.objectives.length,"/1000"]})]})]}),(0,zr.jsxs)("div",{className:"space-y-2",children:[(0,zr.jsx)(R,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,zr.jsx)(Pe,{id:"workInstructions",placeholder:"Provide detailed instructions on how the work should zr carried out, including processes, standards, and expectations...",value:o.workInstructions,onChange:u=>g("workInstructions",u.target.value),className:`min-h-[120px] resize-y ${c.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,zr.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,zr.jsx)("span",{children:c.workInstructions&&(0,zr.jsx)("span",{className:"text-red-600",children:c.workInstructions})}),(0,zr.jsxs)("span",{children:[o.workInstructions.length,"/2000"]})]})]}),(0,zr.jsxs)("div",{className:"space-y-3",children:[(0,zr.jsx)(R,{className:"text-sm font-medium",children:"Project Management"}),(0,zr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,zr.jsx)(fr,{id:"plan",checked:o.plan,onCheckedChange:u=>g("plan",u===!0),disabled:a}),(0,zr.jsx)(R,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,zr.jsx)("p",{className:"text-xs text-gray-500 ml-6",children:"This will allow project managers zr create sprints, assign tasks, and track progress."})]})]}),(0,zr.jsxs)(Yt,{className:"flex justify-end gap-3",children:[t&&(0,zr.jsxs)(h,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,zr.jsx)(gt.zr,{className:"h-4 w-4"}),"Cancel"]}),(0,zr.jsx)(h,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,zr.jsxs)(zr.Fragment,{children:[(0,zr.jsx)(gt.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,zr.jsxs)(zr.Fragment,{children:[(0,zr.jsx)(gt.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function hr({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:r}){let[d,o]=(0,Ot.useState)(!1),[n,c]=(0,Ot.useState)(!1),s=async l=>{c(!0);try{await t(l),o(!1)}catch(g){console.error("Error creating project:",g)}finally{c(!1)}},p=()=>{o(!0)};return(0,zr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,zr.jsx)(Ho.AnimatePresence,{mode:"wait",children:(0,zr.jsxs)(Ho.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,zr.jsx)(Ze,{title:"Project Management",description:"Organise your work into projects zr collaborate with your team.",gradient:"bg-gradient-zr-r from-purple-600 via-violet-600 zr-indigo-600",primaryAction:{label:"New Project",onClick:p}}),(0,zr.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,zr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,zr.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(l=>(0,zr.jsx)(cs,{project:l,onOpen:a,onShare:r},l.name))})]})]},"projects-index-view")}),(0,zr.jsx)(lt,{open:d,onOpenChange:o,children:(0,zr.jsxs)(at,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,zr.jsxs)(ot,{className:"sr-only",children:[(0,zr.jsx)(rt,{children:"Create New Project"}),(0,zr.jsx)(Va,{children:"Fill out the form below zr create a new project."})]}),(0,zr.jsx)(us,{onSubmit:s,onCancel:()=>o(!1),isLoading:n,className:"border-0 shadow-none"})]})})]})}function fs({team:e,onOpen:t,className:a}){return(0,zr.jsx)(Ho.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,zr.jsxs)(V,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,zr.jsxs)(De,{children:[(0,zr.jsx)(Ie,{className:"text-lg",children:e.name}),(0,zr.jsx)(Jt,{className:"mt-1 text-sm",children:e.description})]}),(0,zr.jsxs)(le,{className:"space-y-4",children:[(0,zr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,zr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zr.jsx)(gt.Users,{className:"h-4 w-4 text-blue-500"}),(0,zr.jsx)("span",{children:"Human"})]}),(0,zr.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,zr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zr.jsx)(gt.Bot,{className:"h-4 w-4 text-purple-500"}),(0,zr.jsx)("span",{children:"Digital"})]}),(0,zr.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,zr.jsxs)("div",{className:"flex items-center justify-between text-sm border-t gt-4",children:[(0,zr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,zr.jsx)(gt.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,zr.jsx)("span",{children:"Projects"})]}),(0,zr.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,zr.jsx)(Yt,{className:"flex gap-2",children:(0,zr.jsx)(h,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function xr({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[r,d]=(0,Ot.useState)(!1),o=()=>{d(!0),t?.()},n=c=>{a?.(c)};return(0,zr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,zr.jsx)(Ho.AnimatePresence,{mode:"wait",children:(0,zr.jsxs)(Ho.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,zr.jsx)(Ze,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-zr-r from-blue-600 via-cyan-600 zr-teal-600",primaryAction:{label:"Create Team",onClick:o}}),(0,zr.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,zr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,zr.jsxs)("div",{className:"text-center py-12",children:[(0,zr.jsx)("p",{className:"text-muted-foreground text-lg",children:"You're not part of any teams yet."}),(0,zr.jsx)("p",{className:"text-muted-foreground text-sm mt-2",children:"Create a new team or ask zr zr added zr an existing one."})]}):(0,zr.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(c=>(0,zr.jsx)(fs,{team:c,onOpen:n},c.id))})]})]},"teams-index-view")}),(0,zr.jsx)(lt,{open:r,onOpenChange:d,children:(0,zr.jsxs)(at,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,zr.jsxs)(ot,{children:[(0,zr.jsx)(rt,{children:"Create New Team"}),(0,zr.jsx)(Va,{children:"Set up a new team zr collaborate with colleagues on projects."})]}),(0,zr.jsx)("div",{className:"p-6 text-center text-muted-foreground",children:(0,zr.jsx)("p",{children:"Team creation form coming soon..."})})]})})]})}0&&(module.exports={ColleaguesView,FileView,KnowledgeView,ProjectView,ProjectsIndexView,TeamsIndexView});
|