cortex-react-components 2.13.10 → 2.13.11
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-ANCSWAD7.mjs → chunk-2GM2LPLB.mjs} +1 -1
- package/dist/{chunk-QILFMWE5.mjs → chunk-2OOJ4ZFB.mjs} +1 -1
- package/dist/{chunk-UPRS7OYQ.mjs → chunk-2UNIT7NC.mjs} +1 -1
- package/dist/{chunk-33CHGT4N.mjs → chunk-4SRUEQTP.mjs} +1 -1
- package/dist/{chunk-USGRM22Y.mjs → chunk-6PS55VJZ.mjs} +1 -1
- package/dist/{chunk-3EGSOIRH.mjs → chunk-7OMPPFGG.mjs} +1 -1
- package/dist/chunk-AP6ZM2J6.mjs +4 -0
- package/dist/{chunk-CTC6WSB6.mjs → chunk-BQQ4V4PX.mjs} +1 -1
- package/dist/{chunk-DKRRVTCV.mjs → chunk-CJDUN6R4.mjs} +1 -1
- package/dist/{chunk-M5QUXKCF.mjs → chunk-DPZHVBGG.mjs} +1 -1
- package/dist/{chunk-CBRUFCI3.mjs → chunk-F3CQJWDX.mjs} +1 -1
- package/dist/{chunk-YPSUDHCJ.mjs → chunk-F64CA5CH.mjs} +1 -1
- package/dist/{chunk-MEVSHOG4.mjs → chunk-FEWOSBUJ.mjs} +1 -1
- package/dist/{chunk-MFUZNS7C.mjs → chunk-FYQBRCQM.mjs} +1 -1
- package/dist/{chunk-HLTP3ZQN.mjs → chunk-GAZHKHGB.mjs} +1 -1
- package/dist/{chunk-MGSTQLZC.mjs → chunk-GETYSIZV.mjs} +1 -1
- package/dist/{chunk-GO42W2BM.mjs → chunk-HDKHF3EA.mjs} +1 -1
- package/dist/{chunk-VQBOJHZF.mjs → chunk-HKMNAXLM.mjs} +1 -1
- package/dist/{chunk-TKCFCYEQ.mjs → chunk-HSQAHQNP.mjs} +1 -1
- package/dist/{chunk-OXKN6X62.mjs → chunk-KVLUT4U2.mjs} +1 -1
- package/dist/chunk-L3V5YDPH.mjs +1 -0
- package/dist/{chunk-ESPA7NWT.mjs → chunk-MDBYZZXI.mjs} +1 -1
- package/dist/{chunk-YWRU7OE3.mjs → chunk-MO4HRQEL.mjs} +1 -1
- package/dist/{chunk-DX3G3FKT.mjs → chunk-O24GFE6Q.mjs} +1 -1
- package/dist/{chunk-R33MOMFK.mjs → chunk-P6OSMPUQ.mjs} +1 -1
- package/dist/{chunk-JNJJAJPI.mjs → chunk-PNUBVBSR.mjs} +1 -1
- package/dist/{chunk-RMZLEIRP.mjs → chunk-PTZT4QJW.mjs} +1 -1
- package/dist/{chunk-U2WF6H6D.mjs → chunk-QQFIVSBW.mjs} +1 -1
- package/dist/{chunk-W2UVMIWN.mjs → chunk-R5SXUWYU.mjs} +1 -1
- package/dist/{chunk-CCJJAUGB.mjs → chunk-R6AYIVIR.mjs} +1 -1
- package/dist/{chunk-P55W6AFU.mjs → chunk-RIRZRO6U.mjs} +1 -1
- package/dist/{chunk-RSDUFAIB.mjs → chunk-T5HJS6OF.mjs} +1 -1
- package/dist/{chunk-VPAJF7N2.mjs → chunk-TTSBUSVB.mjs} +1 -1
- package/dist/{chunk-6EKGV4I2.mjs → chunk-U3FYDDE2.mjs} +1 -1
- package/dist/{chunk-X3JZSN3W.mjs → chunk-UZSBX5GO.mjs} +1 -1
- package/dist/{chunk-XGIYNUGC.mjs → chunk-VNYUNZ3M.mjs} +1 -1
- package/dist/{chunk-2BR55L74.mjs → chunk-VRE6VCHX.mjs} +1 -1
- package/dist/{chunk-VL7AXCXD.mjs → chunk-XOEYCVMT.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/ImageBlock.mjs +1 -1
- package/dist/components/Blocks/MediaBlock.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/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/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/ColleaguesView.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/index.js +1 -1
- package/dist/components/DigitalColleagues/index.mjs +1 -1
- package/dist/components/Foundary/MainPage.mjs +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
- package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
- package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
- package/dist/components/Foundary/Views/TeamsIndexView.mjs +1 -1
- package/dist/components/Foundary/Views/index.js +1 -1
- package/dist/components/Foundary/Views/index.mjs +1 -1
- package/dist/components/Foundary/index.js +1 -1
- package/dist/components/Foundary/index.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/RenderHero.mjs +1 -1
- package/dist/components/Heros/SectionHero/index.mjs +1 -1
- package/dist/components/Heros/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/Other/index.mjs +1 -1
- package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
- package/dist/components/Payload/Media/index.mjs +1 -1
- package/dist/components/Payload/PayloadCard/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/AddEpicModal.d.ts +1 -1
- package/dist/components/Projects/AddEpicModal.js +1 -1
- package/dist/components/Projects/AddEpicModal.mjs +1 -1
- package/dist/components/Projects/EpicsView.d.ts +1 -1
- package/dist/components/Projects/EpicsView.js +1 -1
- package/dist/components/Projects/EpicsView.mjs +1 -1
- package/dist/components/Projects/KanbanBoardView.d.ts +1 -1
- package/dist/components/Projects/KanbanBoardView.js +1 -1
- package/dist/components/Projects/KanbanBoardView.mjs +1 -1
- package/dist/components/Projects/ProjectPage.js +1 -1
- package/dist/components/Projects/ProjectPage.mjs +1 -1
- package/dist/components/Projects/ProjectView.d.ts +1 -1
- package/dist/components/Projects/ProjectView.js +1 -1
- package/dist/components/Projects/ProjectView.mjs +1 -1
- package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
- package/dist/components/Projects/index.js +1 -1
- package/dist/components/Projects/index.mjs +1 -1
- package/dist/components/dc-temp/index.mjs +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/index.js +1 -1
- 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/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/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-6R36YTGY.mjs +0 -1
- package/dist/chunk-KSRDC26N.mjs +0 -4
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
"use client"
|
|
4
4
|
|
|
5
|
-
"use strict";"use client";var xr=Object.create;var ta=Object.defineProperty;var yr=Object.getOwnPropertyDescriptor;var wr=Object.getOwnPropertyNames;var Nr=Object.getPrototypeOf,Cr=Object.prototype.hasOwnProperty;var kr=(e,t)=>{for(var a in t)ta(e,a,{get:t[a],enumerable:!0})},$a=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of wr(t))!Cr.call(e,r)&&r!==a&&ta(e,r,{get:()=>t[r],enumerable:!(o=yr(t,r))||o.enumerable});return e};var ue=(e,t,a)=>(a=e!=null?xr(Nr(e)):{},$a(t||!e||!e.__esModule?ta(a,"default",{value:e,enumerable:!0}):a,e)),Sr=e=>$a(ta({},"__esModule",{value:!0}),e);var Fi={};kr(Fi,{default:()=>Qo});module.exports=Sr(Fi);var oe=require("react");var mt=require("lucide-react"),ct=require("react/jsx-runtime"),Dr=[{key:"kanban",icon:mt.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:mt.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:mt.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:mt.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:mt.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],ja=({currentView:e,onViewChange:t,children:a})=>(0,ct.jsxs)("div",{className:"flex w-full h-screen",children:[(0,ct.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:Dr.map(o=>{let r=o.icon,s=e===o.key;return(0,ct.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${s?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,ct.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,ct.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,ct.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,ct.jsx)("div",{className:"w-full h-full",children:a})})]});var eo=require("class-variance-authority");var Qa=require("clsx");var xa="-",Tr=e=>{let t=Rr(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:c=>{let n=c.split(xa);return n[0]===""&&n.length!==1&&n.shift(),Ka(n,t)||Pr(c)},getConflictingClassGroupIds:(c,n)=>{let u=a[c]||[];return n&&o[c]?[...u,...o[c]]:u}}},Ka=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),r=o?Ka(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;let s=e.join(xa);return t.validators.find(({validator:c})=>c(s))?.classGroupId},Wa=/^\[(.+)\]$/,Pr=e=>{if(Wa.test(e)){let t=Wa.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Rr=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Ar(Object.entries(e.classGroups),a).forEach(([s,c])=>{ha(c,o,s,t)}),o},ha=(e,t,a,o)=>{e.forEach(r=>{if(typeof r=="string"){let s=r===""?t:_a(t,r);s.classGroupId=a;return}if(typeof r=="function"){if(Er(r)){ha(r(o),t,a,o);return}t.validators.push({validator:r,classGroupId:a});return}Object.entries(r).forEach(([s,c])=>{ha(c,_a(t,s),a,o)})})},_a=(e,t)=>{let a=e;return t.split(xa).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Er=e=>e.isThemeGetter,Ar=(e,t)=>t?e.map(([a,o])=>{let r=o.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([c,n])=>[t+c,n])):s);return[a,r]}):e,Mr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,r=(s,c)=>{a.set(s,c),t++,t>e&&(t=0,o=a,a=new Map)};return{get(s){let c=a.get(s);if(c!==void 0)return c;if((c=o.get(s))!==void 0)return r(s,c),c},set(s,c){a.has(s)?a.set(s,c):r(s,c)}}},qa="!",Ir=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,r=t[0],s=t.length,c=n=>{let u=[],p=0,d=0,g;for(let v=0;v<n.length;v++){let V=n[v];if(p===0){if(V===r&&(o||n.slice(v,v+s)===t)){u.push(n.slice(d,v)),d=v+s;continue}if(V==="/"){g=v;continue}}V==="["?p++:V==="]"&&p--}let T=u.length===0?n:n.substring(d),C=T.startsWith(qa),b=C?T.substring(1):T,I=g&&g>d?g-d:void 0;return{modifiers:u,hasImportantModifier:C,baseClassName:b,maybePostfixModifierPosition:I}};return a?n=>a({className:n,parseClassName:c}):c},Fr=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},Lr=e=>({cache:Mr(e.cacheSize),parseClassName:Ir(e),...Tr(e)}),Br=/\s+/,Or=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:r}=t,s=[],c=e.trim().split(Br),n="";for(let u=c.length-1;u>=0;u-=1){let p=c[u],{modifiers:d,hasImportantModifier:g,baseClassName:T,maybePostfixModifierPosition:C}=a(p),b=!!C,I=o(b?T.substring(0,C):T);if(!I){if(!b){n=p+(n.length>0?" "+n:n);continue}if(I=o(T),!I){n=p+(n.length>0?" "+n:n);continue}b=!1}let v=Fr(d).join(":"),V=g?v+qa:v,W=V+I;if(s.includes(W))continue;s.push(W);let w=r(I,b);for(let F=0;F<w.length;++F){let se=w[F];s.push(V+se)}n=p+(n.length>0?" "+n:n)}return n};function zr(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Ja(t))&&(o&&(o+=" "),o+=a);return o}var Ja=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Ja(e[o]))&&(a&&(a+=" "),a+=t);return a};function Vr(e,...t){let a,o,r,s=c;function c(u){let p=t.reduce((d,g)=>g(d),e());return a=Lr(p),o=a.cache.get,r=a.cache.set,s=n,n(u)}function n(u){let p=o(u);if(p)return p;let d=Or(u,a);return r(u,d),d}return function(){return s(zr.apply(null,arguments))}}var re=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Xa=/^\[(?:([a-z-]+):)?(.+)\]$/ct,Hr=/^\d+\/\d+$/,Ur=new Set(["px","full","screen"]),Gr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$r=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|ct|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Wr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_r=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pt=e=>Lt(e)||Ur.has(e)||Hr.test(e),ht=e=>Bt(e,"length",ei),Lt=e=>!!e&&!Number.isNaN(Number(e)),ba=e=>Bt(e,"number",Lt),Kt=e=>!!e&&Number.isInteger(Number(e)),Kr=e=>e.endsWith("%")&&Lt(e.slice(0,-1)),z=e=>Xa.test(e),xt=e=>Gr.test(e),qr=new Set(["length","size","percentage"]),Jr=e=>Bt(e,qr,Za),Xr=e=>Bt(e,"position",Za),Zr=new Set(["image","url"]),Yr=e=>Bt(e,Zr,ai),Qr=e=>Bt(e,"",ti),qt=()=>!0,Bt=(e,t,a)=>{let o=Xa.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},ei=e=>$r.test(e)&&!jr.test(e),Za=()=>!1,ti=e=>Wr.test(e),ai=e=>_r.test(e);var oi=()=>{let e=re("colors"),t=re("spacing"),a=re("blur"),o=re("brightness"),r=re("borderColor"),s=re("borderRadius"),c=re("borderSpacing"),n=re("borderWidth"),u=re("contrast"),p=re("grayscale"),d=re("hueRotate"),g=re("invert"),T=re("gap"),C=re("gradientColorStops"),b=re("gradientColorStopPositions"),I=re("inset"),v=re("margin"),V=re("opacity"),W=re("padding"),w=re("saturate"),F=re("scale"),se=re("sepia"),k=re("skew"),_=re("space"),te=re("translate"),O=()=>["auto","contain","none"],be=()=>["auto","hidden","clip","visible","scroll"],Me=()=>["auto",z,t],E=()=>[z,t],we=()=>["",pt,ht],ee=()=>["auto",Lt,z],et=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],he=()=>["solid","dashed","dotted","double","none"],lt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],tt=()=>["start","end","center","between","around","evenly","stretch"],rt=()=>["","0",z],at=()=>["auto","avoid","all","avoid-page","page","left","right","column"],h=()=>[Lt,z];return{cacheSize:500,separator:":",theme:{colors:[qt],spacing:[pt,ht],blur:["none","",xt,z],brightness:h(),borderColor:[e],borderRadius:["none","","full",xt,z],borderSpacing:E(),borderWidth:we(),contrast:h(),grayscale:rt(),hueRotate:h(),invert:rt(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[Kr,ht],inset:Me(),margin:Me(),opacity:h(),padding:E(),saturate:h(),scale:h(),sepia:rt(),skew:h(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",z]}],container:["container"],columns:[{columns:[xt]}],"break-after":[{"break-after":at()}],"break-before":[{"break-before":at()}],"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:[...et(),z]}],overflow:[{overflow:be()}],"overflow-x":[{"overflow-x":be()}],"overflow-y":[{"overflow-y":be()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[I]}],"inset-x":[{"inset-x":[I]}],"inset-y":[{"inset-y":[I]}],start:[{start:[I]}],end:[{end:[I]}],top:[{top:[I]}],right:[{right:[I]}],bottom:[{bottom:[I]}],left:[{left:[I]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Kt,z]}],basis:[{basis:Me()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",z]}],grow:[{grow:rt()}],shrink:[{shrink:rt()}],order:[{order:["first","last","none",Kt,z]}],"grid-cols":[{"grid-cols":[qt]}],"col-start-end":[{col:["auto",{span:["full",Kt,z]},z]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[qt]}],"row-start-end":[{row:["auto",{span:[Kt,z]},z]}],"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",z]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",z]}],gap:[{gap:[T]}],"gap-x":[{"gap-x":[T]}],"gap-y":[{"gap-y":[T]}],"justify-content":[{justify:["normal",...tt()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...tt(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...tt(),"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]}],mt:[{mt:[W]}],pt:[{pt:[W]}],pr:[{pr:[W]}],pb:[{pb:[W]}],pl:[{pl:[W]}],m:[{m:[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":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",z,t]}],"min-w":[{"min-w":[z,t,"min","max","fit"]}],"max-w":[{"max-w":[z,t,"none","full","min","max","fit","prose",{screen:[xt]},xt]}],h:[{h:[z,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[z,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[z,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[z,t,"auto","min","max","fit"]}],"font-size":[{text:["base",xt,ht]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ba]}],"font-family":[{font:[qt]}],"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",z]}],"line-clamp":[{"line-clamp":["none",Lt,ba]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",pt,z]}],"list-image":[{"list-image":["none",z]}],"list-style-type":[{list:["none","disc","decimal",z]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[V]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[V]}],"text-decoration":["underline","overline","line-through","eo-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",pt,ht]}],"underline-offset":[{"underline-offset":["auto",pt,z]}],"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:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",z]}],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",z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[V]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...et(),Xr]}],"bg-repeat":[{bg:["eo-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Jr]}],"bg-image":[{bg:["none",{"gradient-ct":["t","tr","r","br","b","bl","ct","tl"]},Yr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-ct-pos":[{ct:[b]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-ct":[{ct:[C]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-ct":[{"rounded-ct":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[n]}],"border-w-x":[{"border-x":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-r":[{"border-r":[n]}],"border-w-b":[{"border-b":[n]}],"border-w-ct":[{"border-ct":[n]}],"border-opacity":[{"border-opacity":[V]}],"border-style":[{border:[...he(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[V]}],"divide-style":[{divide:he()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-ct":[{"border-ct":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...he()]}],"outline-offset":[{"outline-offset":[pt,z]}],"outline-w":[{outline:[pt,ht]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:we()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[V]}],"ring-offset-w":[{"ring-offset":[pt,ht]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xt,Qr]}],"shadow-color":[{shadow:[qt]}],opacity:[{opacity:[V]}],"mix-blend":[{"mix-blend":[...lt(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":lt()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",xt,z]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[g]}],saturate:[{saturate:[w]}],sepia:[{sepia:[se]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[V]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",z]}],duration:[{duration:h()}],ease:[{ease:["linear","in","out","in-out",z]}],delay:[{delay:h()}],animate:[{animate:["none","spin","ping","pulse","bounce",z]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[F]}],"scale-x":[{"scale-x":[F]}],"scale-y":[{"scale-y":[F]}],rotate:[{rotate:[Kt,z]}],"translate-x":[{"translate-x":[te]}],"translate-y":[{"translate-y":[te]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",z]}],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","eo-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",z]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",z]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[pt,ht,ba]}],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","mt","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-ct","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-ct":["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-ct"],"border-w-x":["border-w-r","border-w-ct"],"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-ct"],"border-color-x":["border-color-r","border-color-ct"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-mt","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ya=Vr(oi);function y(...e){return Ya((0,Qa.clsx)(e))}var ri=(0,eo.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function le({className:e,variant:t,...a}){return(0,ct.jsx)("div",{className:y(ri({variant:t}),e),...a})}var Dt=ue(require("react"));var ie=Dt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:y("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ie.displayName="Card";var ii=Dt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:y("flex flex-col space-y-1.5 p-6",e),...t}));ii.displayName="CardHeader";var ni=Dt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:y("font-semibold leading-none tracking-tight",e),...t}));ni.displayName="CardTitle";var si=Dt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:y("text-sm text-muted-foreground",e),...t}));si.displayName="CardDescription";var Ot=Dt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:y("p-6 pt-0",e),...t}));Ot.displayName="CardContent";var li=Dt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:y("flex items-center p-6 pt-0",e),...t}));li.displayName="CardFooter";var ao=({title:e,status:t,taskCount:a,children:o,onDrop:r,isCompact:s=!1,height:c})=>{let n=d=>{d.preventDefault()},u=d=>{d.preventDefault(),r(t)};return(0,ct.jsxs)(ie,{className:`p-4 bg-card border-ct-4 ${(()=>{switch(t){case"todo":return"border-ct-gray-400";case"in-progress":return"border-ct-blue-500";case"review":return"border-ct-orange-500";case"done":return"border-ct-green-500";default:return"border-ct-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${s?"lg:max-w-xs":""}`,style:{height:c||"calc(100vh - 350px)"},onDragOver:n,onDrop:u,children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,ct.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${s?"text-base":"text-lg"}`,children:e}),(0,ct.jsx)(le,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,ct.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var Jt=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:r=!1})=>{let s=d=>{a(e)},c=()=>{o(e)},n=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},u=()=>{switch(e.type){case"story":return(0,ct.jsx)(mt.BookOpen,{className:"h-3 w-3"});case"bug":return(0,ct.jsx)(mt.Bug,{className:"h-3 w-3"});case"spike":return(0,ct.jsx)(mt.Zap,{className:"h-3 w-3"});case"task":default:return(0,ct.jsx)(mt.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 r?(0,ct.jsx)(ie,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:s,onClick:c,children:(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${p()}`,children:u()}),(0,ct.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,ct.jsxs)(ie,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:s,onClick:c,children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,ct.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${p()}`,children:[u(),(0,ct.jsx)("span",{className:"capitalize",children:e.type})]}),(0,ct.jsxs)("div",{className:"flex gap-1",children:[(0,ct.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${n()}`,children:e.priority}),(0,ct.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.storyPoints})]})]}),(0,ct.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,ct.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,ct.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-1",children:[(0,ct.jsx)(mt.User,{className:"h-4 w-4"}),(0,ct.jsx)("span",{children:e.assignee?.value?.name})]}),(0,ct.jsxs)("div",{className:"flex items-center gap-1",children:[(0,ct.jsx)(mt.Calendar,{className:"h-4 w-4"}),(0,ct.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var Xt=ue(require("react")),Ce=ue(require("@radix-ui/react-dialog"));var Ke=Ce.Root;var di=Ce.Portal;var ro=Xt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(Ce.Overlay,{ref:a,className:y("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}));ro.displayName=Ce.Overlay.displayName;var Ue=Xt.forwardRef(({className:e,children:t,...a},o)=>(0,ct.jsxs)(di,{children:[(0,ct.jsx)(ro,{}),(0,ct.jsxs)(Ce.Content,{ref:o,className:y("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-ct-left-1/2 data-[state=closed]:slide-out-ct-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,ct.jsxs)(Ce.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,ct.jsx)(mt.X,{className:"h-4 w-4"}),(0,ct.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Ue.displayName=Ce.Content.displayName;var Ge=({className:e,...t})=>(0,ct.jsx)("div",{className:y("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ge.displayName="DialogHeader";var Zt=({className:e,...t})=>(0,ct.jsx)("div",{className:y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Zt.displayName="DialogFooter";var $e=Xt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(Ce.Title,{ref:a,className:y("text-lg font-semibold leading-none tracking-tight",e),...t}));$e.displayName=Ce.Title.displayName;var ci=Xt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(Ce.Description,{ref:a,className:y("text-sm text-muted-foreground",e),...t}));ci.displayName=Ce.Description.displayName;var io=require("@radix-ui/react-slot"),so=ue(require("react")),aa=(0,eo.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),N=so.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...r},s)=>(0,ct.jsx)(e?io.Slot:"button",{className:y(aa({className:t,size:a,variant:o})),ref:s,...r}));N.displayName="Button";var co=ue(require("react"));var Z=co.forwardRef(({className:e,type:t,...a},o)=>(0,ct.jsx)("input",{type:t,className:y("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}));Z.displayName="Input";var po=ue(require("react")),Ee=po.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("textarea",{className:y("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}));Ee.displayName="Textarea";var H=ue(require("@radix-ui/react-select")),yt=ue(require("react")),ze=H.Root;var ot=H.Value,Fe=yt.forwardRef(({children:e,className:t,...a},o)=>(0,ct.jsxs)(H.Trigger,{className:y("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,ct.jsx)(H.Icon,{asChild:!0,children:(0,ct.jsx)(mt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Fe.displayName=H.Trigger.displayName;var go=yt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(H.ScrollUpButton,{className:y("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,ct.jsx)(mt.ChevronUp,{className:"h-4 w-4"})}));go.displayName=H.ScrollUpButton.displayName;var fo=yt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(H.ScrollDownButton,{className:y("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,ct.jsx)(mt.ChevronDown,{className:"h-4 w-4"})}));fo.displayName=H.ScrollDownButton.displayName;var Le=yt.forwardRef(({children:e,className:t,position:a="popper",...o},r)=>(0,ct.jsx)(H.Portal,{children:(0,ct.jsxs)(H.Content,{className:y("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:r,...o,children:[(0,ct.jsx)(go,{}),(0,ct.jsx)(H.Viewport,{className:y("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,ct.jsx)(fo,{})]})}));Le.displayName=H.Content.displayName;var mi=yt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(H.Label,{className:y("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:a,...t}));mi.displayName=H.Label.displayName;var ne=yt.forwardRef(({children:e,className:t,...a},o)=>(0,ct.jsxs)(H.Item,{className:y("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:o,...a,children:[(0,ct.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,ct.jsx)(H.ItemIndicator,{children:(0,ct.jsx)(mt.Check,{className:"h-4 w-4"})})}),(0,ct.jsx)(H.ItemText,{children:e})]}));ne.displayName=H.Item.displayName;var pi=yt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(H.Separator,{className:y("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));pi.displayName=H.Separator.displayName;var vo=ue(require("react")),ya=ue(require("@radix-ui/react-label"));var ui=(0,eo.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),R=vo.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(ya.Root,{ref:a,className:y(ui(),e),...t}));R.displayName=ya.Root.displayName;var Et=ue(require("react")),zt=ue(require("@radix-ui/react-toggle-group"));var xo=ue(require("react")),wa=ue(require("@radix-ui/react-toggle"));var Na=(0,eo.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"}}),gi=xo.forwardRef(({className:e,variant:t,size:a,...o},r)=>(0,ct.jsx)(wa.Root,{ref:r,className:y(Na({variant:t,size:a,className:e})),...o}));gi.displayName=wa.Root.displayName;var No=Et.createContext({size:"default",variant:"default"}),At=Et.forwardRef(({className:e,variant:t,size:a,children:o,...r},s)=>(0,ct.jsx)(zt.Root,{ref:s,className:y("flex items-center justify-center gap-1",e),...r,children:(0,ct.jsx)(No.Provider,{value:{variant:t,size:a},children:o})}));At.displayName=zt.Root.displayName;var Mt=Et.forwardRef(({className:e,children:t,variant:a,size:o,...r},s)=>{let c=Et.useContext(No);return(0,ct.jsx)(zt.Item,{ref:s,className:y(Na({variant:c.variant||a,size:c.size||o}),e),...r,children:t})});Mt.displayName=zt.Item.displayName;var fi=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:mt.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:mt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:mt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:mt.Zap}],vi=[{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"}],Vt=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:r,assignees:s,defaultEpicId:c})=>{let[n,u]=(0,oe.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,oe.useEffect)(()=>{e&&c&&u(g=>({...g,epic:c}))},[e,c]),(0,oe.useEffect)(()=>{e&&u({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:c||"",sprint:"none",assignee:""})},[e]);let p=g=>{g.preventDefault(),n.name.trim()&&(a({name:n.name.trim(),description:n.description.trim(),status:"todo",priority:n.priority,type:n.type,storyPoints:n.storyPoints,epic:Number(n.epic),sprint:Number(n.sprint),assignee:n.assignee.trim()?{relationTo:"digital-colleagues",value:Number(n.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),u({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:c||"",sprint:"",assignee:""}),t())},d=(g,T)=>{u(C=>({...C,[g]:T}))};return(0,ct.jsx)(Ke,{open:e,onOpenChange:t,children:(0,ct.jsxs)(Ue,{className:"sm:max-w-md",children:[(0,ct.jsx)(Ge,{children:(0,ct.jsx)($e,{children:"Add New Task"})}),(0,ct.jsxs)("form",{onSubmit:p,className:"space-y-4",children:[(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{htmlFor:"name",children:"Task Title"}),(0,ct.jsx)(Z,{id:"name",value:n.name,onChange:g=>d("name",g.target.value),placeholder:"Enter task title",required:!0})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{htmlFor:"description",children:"Description"}),(0,ct.jsx)(Ee,{id:"description",value:n.description,onChange:g=>d("description",g.target.value),placeholder:"Enter task description",rows:3})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{children:"Type"}),(0,ct.jsx)(At,{type:"single",value:n.type||"",onValueChange:g=>g&&d("type",g),children:fi.map(g=>{let T=g.icon;return(0,ct.jsxs)(Mt,{value:g.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,ct.jsx)(T,{className:"h-4 w-4"}),g.label]},g.value)})})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{children:"Priority"}),(0,ct.jsx)(At,{type:"single",value:n.priority||"",onValueChange:g=>g&&d("priority",g),children:vi.map(g=>(0,ct.jsx)(Mt,{value:g.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:g.label},g.value))})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{htmlFor:"points",children:"Story Points"}),(0,ct.jsx)(Z,{id:"points",type:"number",min:"1",max:"100",value:n.storyPoints,onChange:g=>d("storyPoints",parseInt(g.target.value)||1),placeholder:"Enter story points",required:!0})]}),!c&&(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{htmlFor:"epic",children:"Epic"}),(0,ct.jsxs)(ze,{value:n.epic,onValueChange:g=>d("epic",g),children:[(0,ct.jsx)(Fe,{children:(0,ct.jsx)(ot,{placeholder:"Select an epic"})}),(0,ct.jsx)(Le,{children:o.map(g=>(0,ct.jsx)(ne,{value:g.id.toString(),children:(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsx)("div",{className:`w-3 h-3 rounded-full ${g.color}`}),g.name]})},g.id))})]})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,ct.jsxs)(ze,{value:n.sprint,onValueChange:g=>d("sprint",g),children:[(0,ct.jsx)(Fe,{children:(0,ct.jsx)(ot,{placeholder:"Select a sprint"})}),(0,ct.jsxs)(Le,{children:[(0,ct.jsx)(ne,{value:"none",children:"No Sprint"}),r.map(g=>(0,ct.jsx)(ne,{value:g.id.toString(),children:(0,ct.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{htmlFor:"sprint",children:"Assignee"}),(0,ct.jsxs)(ze,{value:n.assignee,onValueChange:g=>d("assignee",g),children:[(0,ct.jsx)(Fe,{children:(0,ct.jsx)(ot,{placeholder:"Select an Assignee"})}),(0,ct.jsxs)(Le,{children:[(0,ct.jsx)(ne,{value:"none",children:"No Assignee"}),s.map(g=>(0,ct.jsx)(ne,{value:g.id.toString(),children:(0,ct.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,ct.jsxs)(Zt,{children:[(0,ct.jsx)(N,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,ct.jsx)(N,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var ka=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:r,className:s="",disabled:c=!1})=>{let[n,u]=(0,oe.useState)(!1),[p,d]=(0,oe.useState)(""),g=()=>{c||(u(!0),d(t))},T=async()=>{p!==t&&await r(e,p),u(!1)},C=b=>{b.key==="Enter"&&!o||b.key==="Enter"&&b.ctrlKey&&o?T():b.key==="Escape"&&(u(!1),d(""))};return(0,ct.jsxs)("div",{className:`space-y-2 ${s}`,children:[(0,ct.jsx)(R,{children:a}),n?o?(0,ct.jsx)(Ee,{value:p,onChange:b=>d(b.target.value),onBlur:T,onKeyDown:C,autoFocus:!0,rows:4,className:"resize-none"}):(0,ct.jsx)(Z,{value:p,onChange:b=>d(b.target.value),onBlur:T,onKeyPress:C,autoFocus:!0,className:"text-lg font-medium"}):(0,ct.jsxs)("div",{onClick:g,className:`${c?"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,ct.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click ct edit..."}),!c&&(0,ct.jsx)(mt.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var ra=ue(require("react")),gt=ue(require("@radix-ui/react-avatar"));var Sa=ra.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(gt.Root,{ref:a,className:y("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Sa.displayName=gt.Root.displayName;var bi=ra.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(gt.Image,{ref:a,className:y("aspect-square h-full w-full",e),...t}));bi.displayName=gt.Image.displayName;var Da=ra.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(gt.Fallback,{ref:a,className:y("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Da.displayName=gt.Fallback.displayName;var So=({comments:e,onAddComment:t})=>{let[a,o]=(0,oe.useState)(""),r=c=>c.split(" ").map(n=>n[0]).join("").toUpperCase(),s=()=>{a.trim()&&(t(a),o(""))};return(0,ct.jsxs)("div",{className:"space-y-4",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsx)(mt.MessageSquare,{className:"h-5 w-5"}),(0,ct.jsx)(R,{className:"text-lg font-medium",children:"Comments"}),(0,ct.jsx)(le,{variant:"secondary",children:e.length})]}),(0,ct.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(c=>(0,ct.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,ct.jsx)(Sa,{className:"h-8 w-8 mt-1",children:(0,ct.jsx)(Da,{className:"text-xs bg-muted text-muted-foreground",children:r(c.author)})}),(0,ct.jsxs)("div",{className:"flex-1",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,ct.jsx)("span",{className:"font-medium text-sm",children:c.author}),(0,ct.jsxs)("span",{className:"text-xs text-muted-foreground",children:[c.createdAt.toLocaleDateString()," at ",c.createdAt.toLocaleTimeString()]})]}),(0,ct.jsx)("p",{className:"text-sm text-muted-foreground",children:c.text})]})]},c.id))}),(0,ct.jsxs)("div",{className:"flex gap-2",children:[(0,ct.jsx)(Ee,{value:a,onChange:c=>o(c.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,ct.jsx)(N,{onClick:s,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,ct.jsx)(mt.Send,{className:"h-4 w-4"})})]})]})};var sa=({label:e,value:t,onValueChange:a,options:o,showColor:r=!1,disabled:s=!1})=>{let[c,n]=(0,oe.useState)(!1),u=o.find(d=>d.value===t);return(0,ct.jsxs)("div",{className:"space-y-1",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:e}),(0,ct.jsxs)(ze,{value:t,onValueChange:a,open:c,onOpenChange:d=>{s||n(d)},disabled:s,children:[(0,ct.jsx)(Fe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,ct.jsxs)(le,{variant:"secondary",className:`${s?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!s&&n(!c),children:[r&&u?.color&&(0,ct.jsx)("div",{className:`w-2 h-2 rounded-full ${u.color} mr-1`}),u?.label||"Select..."]})}),(0,ct.jsx)(Le,{children:o.map(d=>(0,ct.jsx)(ne,{value:d.value,children:r&&d.color?(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var To=({label:e,value:t,onValueChange:a,options:o,placeholder:r="Search...",allowCustomValue:s=!1,disabled:c=!1})=>{let[n,u]=(0,oe.useState)(!1),[p,d]=(0,oe.useState)(""),g=o.find(v=>v.value===t),T=o.filter(v=>v.label.toLowerCase().includes(p.toLowerCase())),C=v=>{a(v),u(!1),d("")},b=()=>{s&&p.trim()&&!o.find(v=>v.value===p.trim())&&(a(p.trim()),u(!1),d(""))};return(0,ct.jsxs)("div",{className:"space-y-1",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:e}),(0,ct.jsxs)(ze,{value:t,onValueChange:C,open:n,onOpenChange:v=>{c||u(v)},disabled:c,children:[(0,ct.jsx)(Fe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,ct.jsx)(le,{variant:"secondary",className:`${c?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!c&&u(!n),children:g?.label||t||"Select..."})}),(0,ct.jsxs)(Le,{children:[(0,ct.jsx)("div",{className:"p-2",children:(0,ct.jsx)(Z,{placeholder:r,value:p,onChange:v=>d(v.target.value),onKeyDown:v=>{v.key==="Enter"&&s&&b()},className:"mb-2"})}),T.map(v=>(0,ct.jsx)(ne,{value:v.value,children:v.label},v.value)),s&&p.trim()&&!T.find(v=>v.value===p.trim())&&(0,ct.jsxs)(ne,{value:p.trim(),children:['Add "',p.trim(),'"']})]})]})]})};var fe=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var hi=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:mt.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:mt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:mt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:mt.Zap}],xi=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}];var Po=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:r,onClose:s,onDelete:c,isUpdating:n=!1,isDeleting:u=!1,deleteState:p="idle",teamMembers:d})=>{let[g,T]=(0,oe.useState)(e.storyPoints),C=(0,oe.useRef)(null),[b,I]=(0,oe.useState)(d);(0,oe.useEffect)(()=>{I(d)},[d]);let v=(0,oe.useCallback)((w,F)=>{C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{r(w,F)},500)},[r]);(0,oe.useEffect)(()=>{v("storyPoints",g?.toString()||"1")},[g]);let V=w=>w.split(" ").map(F=>F[0]).join("").toUpperCase(),W=()=>p==="loading"?(0,ct.jsxs)(N,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,ct.jsx)(mt.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):p==="success"?(0,ct.jsxs)(N,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,ct.jsx)(mt.Check,{className:"h-3 w-3"}),"Deleted"]}):p==="error"?(0,ct.jsxs)(N,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,ct.jsx)(mt.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,ct.jsxs)(N,{onClick:c,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:n||u,children:[(0,ct.jsx)(mt.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,ct.jsxs)("div",{className:"flex flex-col h-full",children:[(0,ct.jsxs)("div",{className:"space-y-4",style:{opacity:n?.6:1},children:[(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:"Status"}),(0,ct.jsx)(sa,{label:"",value:e.status,onValueChange:w=>r("status",w),options:[{value:"todo",label:"To oe"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:n})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:"Type"}),(0,ct.jsx)(At,{type:"single",value:e.type||"",onValueChange:w=>w&&r("type",w),className:"grid grid-cols-2 gap-1",disabled:n,children:hi.map(w=>{let F=w.icon;return(0,ct.jsxs)(Mt,{value:w.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:n,children:[(0,ct.jsx)(F,{className:"h-3 w-3"}),w.label]},w.value)})})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,ct.jsx)(At,{type:"single",value:e.priority||"",onValueChange:w=>w&&r("priority",w),className:"grid grid-cols-3 gap-1",disabled:n,children:xi.map(w=>(0,ct.jsx)(Mt,{value:w.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:n,children:w.label},w.value))})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,ct.jsx)("input",{type:"number",min:"1",max:"100",value:g||1,onChange:w=>{let F=Number(w.target.value);F<1?T(1):F>100?T(100):T(F)},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:n})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,ct.jsx)(sa,{label:"",value:fe(e.epic).toString(),onValueChange:w=>r("epic",w),options:(t||[]).map(w=>({value:w.id.toString(),label:w?.name,color:w.color})),showColor:!0,disabled:n})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,ct.jsx)(sa,{label:"",value:fe(e.sprint).toString()||"none",onValueChange:w=>r("sprint",w==="none"?"":w),options:[{value:"none",label:"No Sprint"},...(a||[]).map(w=>({value:w.id.toString(),label:`${w?.name}`}))],disabled:n})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,ct.jsx)(To,{label:"",value:e.assignee?.value?.name,onValueChange:w=>r("assignee",w),options:b.map(w=>({value:`${typeof w.email=="string"?"users":"digital-colleagues"}:${w.id}`,label:w?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:n})]})]}),(0,ct.jsxs)("div",{className:"mt-auto pt-4 space-y-4",children:[(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(N,{onClick:s,variant:"outline",className:"w-full h-8 text-xs",disabled:n||u,children:"Close"}),W()]}),(0,ct.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,ct.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,ct.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,ct.jsx)(mt.User,{className:"h-3 w-3"}),(0,ct.jsx)("span",{children:"System"})]})]}),(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,ct.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,ct.jsx)(mt.Calendar,{className:"h-3 w-3"}),(0,ct.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,ct.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,ct.jsx)(mt.Clock,{className:"h-3 w-3"}),(0,ct.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var Ro=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:r,onUpdateTask:s,onDeleteTask:c,onAddComment:n,colleagues:u})=>{let[p,d]=(0,oe.useState)(a),[g,T]=(0,oe.useState)(new Date),[C,b]=(0,oe.useState)("idle"),[I,v]=(0,oe.useState)("idle"),[V,W]=(0,oe.useState)([]),[w,F]=(0,oe.useState)(u);(0,oe.useEffect)(()=>{d(a)},[a]);let se=async(E,we)=>{if(we!==p[E]){b("loading");try{let ee=await s(p.id.toString(),{[E]:we});d(ee),T(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(ee){console.log("error",ee),b("error"),setTimeout(()=>b("idle"),3e3)}}},k=async(E,we)=>{if(we!==p[E]){b("loading");try{let ee=await s(p.id.toString(),{[E]:we});d(ee),T(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(ee){console.log("error",ee),b("error"),setTimeout(()=>b("idle"),3e3)}}},_=async E=>{if(n){b("loading");try{let we=await n?.({content:E,taskId:p.id.toString()});d(we),T(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch{b("error"),setTimeout(()=>b("idle"),3e3)}}},te=async()=>{v("loading");try{await c(p.id.toString()),v("success"),setTimeout(()=>{t(),v("idle")},1e3)}catch{v("error"),setTimeout(()=>v("idle"),3e3)}},O=C!=="loading"&&I!=="loading",be=()=>{O&&t()},Me=()=>C==="loading"?(0,ct.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,ct.jsx)(mt.Loader2,{className:"h-4 w-4 animate-spin"}),(0,ct.jsx)("span",{children:"Updating..."})]}):C==="success"?(0,ct.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,ct.jsx)(mt.Check,{className:"h-4 w-4"}),(0,ct.jsx)("span",{children:"Updated successfully"})]}):C==="error"?(0,ct.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,ct.jsx)(mt.X,{className:"h-4 w-4"}),(0,ct.jsx)("span",{children:"Update failed"})]}):null;return(0,ct.jsx)(Ke,{open:e,onOpenChange:be,children:(0,ct.jsxs)(Ue,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,ct.jsxs)(Ge,{children:[(0,ct.jsx)($e,{className:"sr-only",children:p.name}),(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsx)("div",{className:"flex-1",children:Me()}),!O&&(0,ct.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,ct.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,ct.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,ct.jsx)(ka,{fieldName:"name",value:p.name||"",label:"",onSave:se,className:"border-b border-border pb-3",disabled:C==="loading"}),(0,ct.jsx)(ka,{fieldName:"description",value:p.description||"",label:"Description",multiline:!0,onSave:se,disabled:C==="loading"}),(0,ct.jsx)(So,{comments:(p?.comments||[]).map(E=>({author:E.author.value.name||"",createdAt:new Date(E.timestamp),text:E.text,id:E.id||""})),onAddComment:_})]}),(0,ct.jsx)(Po,{task:p,epics:o,sprints:r,lastUpdated:g,onUpdateTask:k,onClose:be,onDelete:te,isUpdating:C==="loading",isDeleting:I==="loading",deleteState:I,teamMembers:w})]})]})})};var Ut=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,r]=(0,oe.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}),s=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],c=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],n=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],u=d=>{d.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:o.startDate,endDate:o.endDate,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),r({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},p=(d,g)=>{r(T=>({...T,[d]:g}))};return(0,ct.jsx)(Ke,{open:e,onOpenChange:t,children:(0,ct.jsxs)(Ue,{className:"sm:max-w-md",children:[(0,ct.jsx)(Ge,{children:(0,ct.jsx)($e,{children:"Add New Epic"})}),(0,ct.jsxs)("form",{onSubmit:u,className:"space-y-4",children:[(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{htmlFor:"name",children:"Epic Name"}),(0,ct.jsx)(Z,{id:"name",value:o.name,onChange:d=>p("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{htmlFor:"description",children:"Description"}),(0,ct.jsx)(Ee,{id:"description",value:o.description,onChange:d=>p("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{children:"Color"}),(0,ct.jsx)("div",{className:"flex gap-2 flex-wrap",children:s.map(d=>(0,ct.jsx)("button",{type:"button",onClick:()=>p("color",d),className:`w-8 h-8 rounded-full ${d} ${o.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,ct.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{children:"Confidence"}),(0,ct.jsxs)(ze,{value:o.confidence,onValueChange:d=>p("confidence",d),children:[(0,ct.jsx)(Fe,{children:(0,ct.jsx)(ot,{})}),(0,ct.jsx)(Le,{children:c.map(d=>(0,ct.jsx)(ne,{value:d.value,children:d.label},d.value))})]})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{children:"Phase"}),(0,ct.jsxs)(ze,{value:o.phase.toString(),onValueChange:d=>p("phase",parseInt(d)),children:[(0,ct.jsx)(Fe,{children:(0,ct.jsx)(ot,{})}),(0,ct.jsx)(Le,{children:n.map(d=>(0,ct.jsx)(ne,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,ct.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{children:"Start Date"}),(0,ct.jsx)(Z,{type:"date",value:o.startDate,onChange:d=>p("startDate",d.target.value)})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{children:"End Date"}),(0,ct.jsx)(Z,{type:"date",value:o.endDate,onChange:d=>p("endDate",d.target.value)})]})]}),(0,ct.jsxs)(Zt,{children:[(0,ct.jsx)(N,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,ct.jsx)(N,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Mo=require("motion/react");function Ao(e,t){let[a,o]=(0,oe.useState)(()=>{if(typeof window>"u")return t;try{let s=window.localStorage.getItem(e);return s?JSON.parse(s):t}catch{return t}}),r=s=>{try{o(s),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(s))}catch{}};return(0,oe.useEffect)(()=>{r(a)},[]),[a,r]}var da=require("react-icons/fa");function nt({title:e,description:t,badge:a,primaryAction:o,secondaryAction:r,gradient:s,children:c,className:n}){let[u,p]=Ao(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),d=!r&&!t||u;return(0,ct.jsxs)(Mo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${s} p-8 text-white ${n||""}`,children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,ct.jsx)(le,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,ct.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,ct.jsxs)("div",{className:"flex items-center gap-3",children:[d&&o&&(0,ct.jsx)(N,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(r||t)&&(0,ct.jsx)("button",{"aria-label":u?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>p(!u),style:{lineHeight:0},children:u?(0,ct.jsx)(da.FaChevronDown,{size:22}):(0,ct.jsx)(da.FaChevronUp,{size:22})})]})]}),!d&&(0,ct.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,ct.jsxs)("div",{className:"space-y-4",children:[(0,ct.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,ct.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,ct.jsx)(N,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),r&&(0,ct.jsx)(N,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),c&&(0,ct.jsx)("div",{className:"hidden lg:block",children:c})]})]})}var Io=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:r=[],initialProjects:s=[],onAddTask:c,onUpdateTask:n,onDeleteTask:u,onTaskClick:p,onAddEpic:d,onAddComment:g})=>{let[T,C]=(0,oe.useState)(e),[b,I]=(0,oe.useState)(t),[v,V]=(0,oe.useState)(a),[W,w]=(0,oe.useState)(!1),[F,se]=(0,oe.useState)(!1),[k,_]=(0,oe.useState)(null),[te,O]=(0,oe.useState)(null),[be,Me]=(0,oe.useState)(o),[E,we]=(0,oe.useState)(r),[ee,et]=(0,oe.useState)(0),he=(0,oe.useRef)(null),lt=(0,oe.useRef)(null),tt=b.filter(M=>!0).map(M=>M.id),rt=v.find(M=>M.isSelected);tt.push(0),(0,oe.useEffect)(()=>{C(e)},[e]),(0,oe.useEffect)(()=>{I(t)},[t]),(0,oe.useEffect)(()=>{V(a)},[a]),(0,oe.useEffect)(()=>{we(r)},[r]),(0,oe.useEffect)(()=>{let M=()=>{if(he.current){let Te=he.current.offsetHeight;et(Te)}};M();let X=new ResizeObserver(M);he.current&&X.observe(he.current);let Q=()=>{setTimeout(M,100)};return window.addEventListener("storage",Q),()=>{X.disconnect(),window.removeEventListener("storage",Q)}},[]),(0,oe.useEffect)(()=>{let M=setTimeout(()=>{he.current&&et(he.current.offsetHeight)},300);return()=>clearTimeout(M)},[W,F]);let at=T.filter(M=>!0),h=M=>at.filter(X=>X.status===M),K=M=>{let X={};return b.forEach(Q=>{X[Q.id]=M.filter(Te=>fe(Te.epic)===Q.id)}),X["eo-epic"]=M.filter(Q=>!fe(Q.epic)),X},me=M=>{O(M)},qe=M=>{te&&(C(X=>X.map(Q=>Q.id===te.id?{...Q,status:M}:Q)),n?.(te.id.toString(),{status:M}),O(null))},Y=M=>{let X={...M,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};C(Q=>[...Q,X]),c?.(M)},We=async(M,X)=>{if(C(Te=>Te.map(Ie=>Ie.id===Number(M)?{...Ie,...X}:Ie)),n)return await n(M,X);let Q=T.find(Te=>Te.id===Number(M));if(!Q)throw new Error("Task not found");return{...Q,...X}},$t=async M=>{C(X=>X.filter(Q=>Q.id!==Number(M))),k?.id===Number(M)&&_(null),u&&await u(M)},dt=M=>{let X={...M,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};I(Q=>[...Q,X]),d?.(M)},Ft=M=>{_(M),p?.(M)},bt=[{id:"todo",title:"To oe",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],kt=ee>0?`calc(100vh - ${ee+120}px)`:"calc(100vh - 12rem)";return(0,ct.jsxs)("div",{ref:lt,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,ct.jsx)("div",{ref:he,className:"flex-shrink-0",children:(0,ct.jsx)(nt,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-ct-r from-purple-600 via-violet-600 ct-indigo-600",primaryAction:{label:"Add task",onClick:()=>w(!0)},secondaryAction:{label:"Add epic",onClick:()=>se(!0)}})}),(0,ct.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,ct.jsx)("div",{className:"h-full",style:{height:ee>0?`calc(100vh - ${ee+120}px)`:"calc(100vh - 12rem)"},children:(0,ct.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:bt.map(M=>{let X=h(M.status),Q=K(X);return(0,ct.jsxs)(ao,{title:M.title,status:M.status,taskCount:X.length,onDrop:qe,isCompact:M.status==="done",height:kt,children:[Q["eo-epic"].map(Te=>(0,ct.jsx)(Jt,{epic:null,task:Te,onDragStart:me,onTaskClick:Ft,isCompact:M.status==="done"})),tt.map(Te=>{let Ie=b.find(x=>x.id===Te),m=Q[Te]||[];return m.length===0?null:(0,ct.jsxs)("div",{className:"mb-6",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,ct.jsx)("div",{className:`w-3 h-3 rounded-full ${Ie?.color}`}),(0,ct.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Ie?.name||"No Epic"}),(0,ct.jsx)(le,{variant:"secondary",className:"text-xs",children:m.length})]})," ",(0,ct.jsx)("div",{className:"space-y-3",children:m.map(x=>(0,ct.jsx)(Jt,{task:x,epic:Ie,onDragStart:me,onTaskClick:Ft,isCompact:M.status==="done"},x.id))})]},Te)})]},M.id)})})})}),(0,ct.jsx)(Vt,{isOpen:W,onClose:()=>w(!1),onAddTask:Y,assignees:[...E,...be],epics:b,sprints:v}),(0,ct.jsx)(Ut,{isOpen:F,onClose:()=>se(!1),onAddEpic:dt}),k&&(0,ct.jsx)(Ro,{isOpen:!!k,onClose:()=>_(null),initialTask:k,epics:b,sprints:v,onUpdateTask:We,onDeleteTask:$t,colleagues:E,onAddComment:g})]})};var Fo=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddTaskToEpic:s,onAddEpic:c,onUpdateEpic:n,onDeleteEpic:u})=>{let[p,d]=(0,oe.useState)(t),[g,T]=(0,oe.useState)(null),[C,b]=(0,oe.useState)(null),[I,v]=(0,oe.useState)({}),[V,W]=(0,oe.useState)(0),[w,F]=(0,oe.useState)(!1),[se,k]=(0,oe.useState)(!1),[_,te]=(0,oe.useState)(null),O=(0,oe.useRef)(null),be=(0,oe.useRef)(null);(0,oe.useEffect)(()=>{d(t)},[t]),(0,oe.useEffect)(()=>{let h=()=>{if(O.current){let qe=O.current.offsetHeight;W(qe)}};h();let K=new ResizeObserver(h);O.current&&K.observe(O.current);let me=()=>{setTimeout(h,100)};return window.addEventListener("storage",me),()=>{K.disconnect(),window.removeEventListener("storage",me)}},[]),(0,oe.useEffect)(()=>{let h=setTimeout(()=>{O.current&&W(O.current.offsetHeight)},300);return()=>clearTimeout(h)},[C]);let Me=h=>{T(h)},E=h=>{h.preventDefault()},we=(h,K)=>{h.preventDefault(),g&&fe(g.epic).toString()!==K&&(o(g.id.toString(),{epic:Number(K)}),T(null))},ee=h=>e.filter(K=>fe(K.epic).toString()===h),et=h=>{b(h.id.toString()),v({name:h.name,description:h.description,confidence:h.confidence,phase:h.phase})},he=async()=>{C&&I.name&&(await n(C.toString(),I),d(h=>h.map(K=>K.id.toString()===C?{...K,...I}:K)),b(null),v({}))},lt=()=>{b(null),v({})},tt=async h=>{window.confirm("Are you sure you want ct delete this epic? This will also delete all associated tasks.")&&(await u(h),d(K=>K.filter(me=>me.id.toString()!==h)))},rt=h=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[h]||`Phase ${h}`,at=h=>{switch(h){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,ct.jsxs)(ct.Fragment,{children:[(0,ct.jsxs)("div",{ref:be,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,ct.jsx)("div",{ref:O,className:"flex-shrink-0",children:(0,ct.jsx)(nt,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-ct-r from-rose-600 via-pink-600 ct-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>F(!0)}})}),(0,ct.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,ct.jsx)("div",{className:"h-full overflow-y-auto",style:{height:V>0?`calc(100vh - ${V+120}px)`:"calc(100vh - 12rem)"},children:(0,ct.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:p.map(h=>{let K=ee(h.id.toString()),me=K.reduce((Y,We)=>Y+(We.storyPoints||0),0),qe=V>0?`calc(100vh - ${V+200}px)`:"calc(100vh - 14rem)";return(0,ct.jsxs)(ie,{className:`flex flex-col ${C===h.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:C===h.id.toString()?"auto":qe,minHeight:"400px"},onDragOver:E,onDrop:Y=>we(Y,h.id.toString()),children:[(0,ct.jsx)("div",{className:"p-4 border-b border-border",children:C===h.id.toString()?(0,ct.jsxs)("div",{className:"space-y-4",children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsx)(Z,{value:I.name||"",onChange:Y=>v({...I,name:Y.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,ct.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,ct.jsx)(N,{size:"sm",variant:"ghost",onClick:he,className:"p-1 h-8 w-8",children:(0,ct.jsx)(mt.Check,{className:"h-4 w-4"})}),(0,ct.jsx)(N,{size:"sm",variant:"ghost",onClick:lt,className:"p-1 h-8 w-8",children:(0,ct.jsx)(mt.X,{className:"h-4 w-4"})})]})]}),(0,ct.jsx)(Ee,{value:I.description||"",onChange:Y=>v({...I,description:Y.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,ct.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,ct.jsxs)("div",{children:[(0,ct.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,ct.jsxs)("select",{value:I.confidence||h.confidence,onChange:Y=>v({...I,confidence:Y.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,ct.jsx)("option",{value:"low",children:"Low"}),(0,ct.jsx)("option",{value:"medium",children:"Medium"}),(0,ct.jsx)("option",{value:"high",children:"High"})]})]}),(0,ct.jsxs)("div",{children:[(0,ct.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,ct.jsx)("select",{value:I.phase?.toString()||h.phase.toString(),onChange:Y=>v({...I,phase:parseInt(Y.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(Y=>(0,ct.jsxs)("option",{value:Y.toString(),children:["Phase ",Y]},Y))})]})]})]}):(0,ct.jsxs)(ct.Fragment,{children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,ct.jsx)("div",{className:`w-4 h-4 rounded-full ${h.color}`}),(0,ct.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:h.name}),(0,ct.jsxs)("div",{className:"flex gap-1",children:[(0,ct.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>et(h),className:"p-1 h-8 w-8",children:(0,ct.jsx)(mt.Edit2,{className:"h-3 w-3"})}),(0,ct.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>tt(h.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,ct.jsx)(mt.Trash2,{className:"h-3 w-3"})})]})]}),(0,ct.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,ct.jsxs)(le,{className:`text-xs ${at(h.confidence)}`,children:[h.confidence," confidence"]}),(0,ct.jsxs)(le,{variant:"outline",className:"text-xs",children:["Phase ",h.phase]}),(0,ct.jsxs)(le,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[K.length," tasks"]}),(0,ct.jsxs)(le,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[me," pts"]})]}),h.description&&(0,ct.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:h.description}),(0,ct.jsxs)(N,{onClick:()=>{k(!0),te(h)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,ct.jsx)(mt.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,ct.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,ct.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${g?"border-primary bg-primary/10":"border-border"}`,children:K.length===0?(0,ct.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,ct.jsx)(mt.Move,{className:"h-8 w-8 mb-2"}),(0,ct.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):K.map(Y=>(0,ct.jsx)(Jt,{task:Y,epic:h,onDragStart:Me,onTaskClick:r,isCompact:!0},Y.id))})})]},h.id)})})})})]}),(0,ct.jsx)(Ut,{isOpen:w,onClose:()=>F(!1),onAddEpic:c}),(0,ct.jsx)(Vt,{isOpen:se,onClose:()=>k(!1),onAddTask:s,assignees:[],epics:[],defaultEpicId:_?.id.toString()||"",sprints:a})]})};var Lo=require("react-day-picker");function ca({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,ct.jsx)(Lo.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:y("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 pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:y(aa({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:y("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-ct-md first:[&:has([aria-selected])]:rounded-ct-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:y(aa({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})}ca.displayName="Calendar";var Oo=ue(require("react")),st=ue(require("@radix-ui/react-popover"));var Ra=st.Root,Ea=st.Trigger;var ma=Oo.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},r)=>(0,ct.jsx)(st.Portal,{children:(0,ct.jsx)(st.Content,{ref:r,align:t,sideOffset:a,className:y("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})}));ma.displayName=st.Content.displayName;var Ma=require("date-fns");var Vo=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,r]=(0,oe.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),s=n=>{n.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),r({name:"",description:"",startDate:void 0,endDate:void 0}),t())},c=()=>{r({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,$.jsx)(Ke,{open:e,onOpenChange:c,children:(0,$.jsxs)(Ue,{className:"sm:max-w-md",children:[(0,$.jsx)(Ge,{children:(0,$.jsx)($e,{children:"Add New Sprint"})}),(0,$.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{htmlFor:"name",children:"Sprint Name *"}),(0,$.jsx)(Z,{id:"name",value:o.name,onChange:n=>r(u=>({...u,name:n.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{htmlFor:"description",children:"Description"}),(0,$.jsx)(Ee,{id:"description",value:o.description,onChange:n=>r(u=>({...u,description:n.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,$.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{children:"Start Date *"}),(0,$.jsxs)(Ra,{children:[(0,$.jsx)(Ea,{asChild:!0,children:(0,$.jsxs)(N,{variant:"outline",className:y("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,$.jsx)(mt.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,Ma.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,$.jsx)(ma,{className:"w-auto p-0",align:"start",children:(0,$.jsx)(ca,{mode:"single",selected:o.startDate,onSelect:n=>r(u=>({...u,startDate:n})),initialFocus:!0})})]})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{children:"End Date *"}),(0,$.jsxs)(Ra,{children:[(0,$.jsx)(Ea,{asChild:!0,children:(0,$.jsxs)(N,{variant:"outline",className:y("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,$.jsx)(mt.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,Ma.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,$.jsx)(ma,{className:"w-auto p-0",align:"start",children:(0,$.jsx)(ca,{mode:"single",selected:o.endDate,onSelect:n=>r(u=>({...u,endDate:n})),initialFocus:!0,disabled:n=>o.startDate?n<o.startDate:!1})})]})]})]}),(0,$.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,$.jsx)(N,{type:"button",variant:"outline",onClick:c,children:"Cancel"}),(0,$.jsx)(N,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Ho=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddSprint:s,onUpdateSprint:c,onDeleteSprint:n})=>{let[u,p]=(0,oe.useState)([]),[d,g]=(0,oe.useState)(new Set),[T,C]=(0,oe.useState)(null),[b,I]=(0,oe.useState)(!1),[v,V]=(0,oe.useState)(null),[W,w]=(0,oe.useState)(null),[F,se]=(0,oe.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[k,_]=(0,oe.useState)([]),[te,O]=(0,oe.useState)("upcoming"),[be,Me]=(0,oe.useState)(!1),[E,we]=(0,oe.useState)(0),ee=(0,oe.useRef)(null),et=(0,oe.useRef)(null);(0,oe.useEffect)(()=>{let m=()=>{ee.current&&we(ee.current.offsetHeight)};m();let x=new ResizeObserver(m);return ee.current&&x.observe(ee.current),()=>x.disconnect()},[]);let he=m=>t.find(x=>x.id===Number(m)),lt=m=>a.find(x=>x.id===Number(m)),tt=m=>{let x={high:"bg-red-100 text-red-800 border-red-200",medium:"bg-orange-100 text-orange-800 border-orange-200",low:"bg-green-100 text-green-800 border-green-200"};return x[m]||x.medium},rt=m=>{if(!m||m?.length===0)return"";let x=m?.trim().split(" ");if(x?.length===1)return x[0];let G=x[0],q=x[x.length-1][0].toUpperCase();return`${G} ${q}`},at=m=>{let x={},G=[];return m.forEach(q=>{q.epic?(x[fe(q.epic)]||(x[fe(q.epic)]=[]),x[fe(q.epic)].push(q)):G.push(q)}),{tasksByEpic:x,unassignedTasks:G}};(0,oe.useEffect)(()=>{_(a)},[a]);let h=k.filter(m=>{switch(te){default:return!0}}),K=k.filter(m=>u.includes(m.id.toString())),me=e.filter(m=>!m.sprint||m.status==="backlog"),qe=me.reduce((m,x)=>m+(x.storyPoints||0),0),Y=m=>{p(x=>x.includes(m)?x.filter(G=>G!==m):x?.length<3?[...x,m]:x)},We=m=>{g(x=>{let G=new Set(x);return G.has(m)?G.delete(m):G.add(m),G})},$t=m=>{s(m),I(!1)},dt=m=>{w(m.id.toString()),se({name:m.name,description:m.description||"",startDate:m.startDate?new Date(m.startDate).toISOString().split("T")[0]:m.startDate,endDate:m.endDate?new Date(m.endDate).toISOString().split("T")[0]:m.endDate,isActive:!1})},Ft=()=>{W&&(c(W,{name:F.name,description:F.description,startDate:F.startDate,endDate:F.endDate}),_(m=>m.map(x=>(x.id===Number(W)&&(x.name=F.name,x.description=F.description,x.startDate=F.startDate,x.endDate=F.endDate),x))),w(null))},bt=()=>{w(null),se({name:"",description:"",startDate:"",endDate:"",isActive:!1})},kt=(m,x)=>{C(x),m.dataTransfer.effectAllowed="move"},M=m=>{m.preventDefault(),m.dataTransfer.dropEffect="move"},X=m=>{V(m)},Q=()=>{V(null)},Te=(m,x)=>{if(m.preventDefault(),V(null),!T)return;(fe(T.sprint)||void 0)!==Number(x)&&o(T.id.toString(),{sprint:Number(x)}),C(null)},Ie=({task:m,showSprint:x=!1})=>{let G=m.epic?he(fe(m.epic).toString()):null,q=m.sprint?lt(fe(m.sprint).toString()):null;return(0,ct.jsx)(ie,{className:"p-3 cursor-grab active:cursor-grabbing hover:shadow-md transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:Oe=>{Oe.dataTransfer.effectAllowed="move",Oe.dataTransfer.setData("text/plain",m.id.toString()),kt(Oe,m)},onClick:Oe=>{T===null&&r(m)},style:{userSelect:"none"},children:(0,ct.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,ct.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,ct.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:m.name}),(0,ct.jsx)(le,{className:`text-xs ${tt(m.priority||"medium")}`,children:m.priority?.[0]?.toUpperCase()})]}),(0,ct.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-1",children:[G&&(0,ct.jsx)("div",{className:`w-2 h-2 rounded-full ${G.color}`}),(0,ct.jsx)("span",{className:"text-muted-foreground truncate",children:G?.name})]}),(0,ct.jsx)("span",{className:"text-muted-foreground",children:rt(m.assignee?.value?.name)})]}),x&&q&&(0,ct.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,ct.jsx)(mt.Calendar,{className:"h-3 w-3"}),(0,ct.jsx)("span",{children:q.name})]})]})})};return(0,ct.jsxs)("div",{ref:et,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,ct.jsx)("div",{ref:ee,className:"flex-shrink-0",children:(0,ct.jsx)(nt,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-ct-r from-orange-600 via-amber-600 ct-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>I(!0)}})}),(0,ct.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,ct.jsxs)("div",{className:"h-full",style:{height:E>0?`calc(100vh - ${E+120}px)`:"calc(100vh - 12rem)"},children:[(0,ct.jsxs)("div",{className:"mb-4",children:[(0,ct.jsx)(ie,{className:"p-3 bg-card shadow-sm",children:(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ct.jsxs)("div",{children:[(0,ct.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,ct.jsxs)("p",{className:"text-xs text-muted-foreground",children:[u?.length,"/3 selected"]})]}),u?.length>0&&(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,ct.jsx)("div",{className:"flex flex-wrap gap-1",children:K.map(m=>(0,ct.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,ct.jsx)("span",{className:"max-w-[80px] truncate",children:m.name}),(0,ct.jsx)("button",{onClick:()=>Y(m.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,ct.jsx)(mt.X,{className:"h-4 w-4"})})]},m.id))})]})]}),(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsxs)(N,{onClick:()=>I(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,ct.jsx)(mt.Plus,{className:"h-3 w-3"}),"Add"]}),(0,ct.jsxs)(N,{onClick:()=>Me(!be),variant:"outline",size:"sm",className:"gap-1",children:[(0,ct.jsx)(mt.Calendar,{className:"h-3 w-3"}),be?"Close":"Select"]})]})]})}),be&&(0,ct.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>Me(!1)}),(0,ct.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-ct shadow-xl z-10 transition-all duration-300 ease-in-out ${be?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,ct.jsxs)(ie,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,ct.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,ct.jsx)(N,{variant:"ghost",size:"sm",onClick:()=>Me(!1),className:"h-8 w-8 p-0",children:(0,ct.jsx)(mt.X,{className:"h-4 w-4"})})]}),(0,ct.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose up ct 3 sprints ct view in your planning board"})]}),(0,ct.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,ct.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(m=>(0,ct.jsxs)(N,{variant:te===m.key?"default":"outline",size:"sm",onClick:()=>O(m.key),className:"text-xs h-8 px-3 flex-1",children:[m.label," (",m.count,")"]},m.key))}),(0,ct.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:h.length>0?h.map(m=>{let x=u.includes(m.id.toString()),G=e.filter(Pe=>fe(Pe.sprint)===m.id).length,q=!x&&u.length<3;return(0,ct.jsx)("div",{className:`p-3 rounded-lg border transition-all ${x?"bg-primary/10 border-primary/30":q?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:W===m.id.toString()?(0,ct.jsxs)("div",{className:"space-y-3",children:[(0,ct.jsx)(Z,{value:F.name,onChange:Pe=>se(Re=>({...Re,name:Pe.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,ct.jsx)(Ee,{value:F.description,onChange:Pe=>se(Re=>({...Re,description:Pe.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,ct.jsxs)("div",{className:"flex gap-2",children:[(0,ct.jsxs)(N,{size:"sm",onClick:()=>Ft(),className:"flex-1",children:[(0,ct.jsx)(mt.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,ct.jsxs)(N,{size:"sm",variant:"outline",onClick:bt,className:"flex-1",children:[(0,ct.jsx)(mt.X,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,ct.jsxs)("div",{children:[(0,ct.jsxs)("div",{className:"flex items-start justify-between",children:[(0,ct.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,ct.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:m.name}),(0,ct.jsx)(le,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,ct.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:m.description}),(0,ct.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,ct.jsxs)("span",{className:"flex items-center gap-1",children:[(0,ct.jsx)(mt.CalendarDays,{className:"h-3 w-3"}),new Date(m.startDate).toLocaleDateString()]}),(0,ct.jsxs)("span",{className:"flex items-center gap-1",children:[(0,ct.jsx)(mt.User,{className:"h-3 w-3"}),G," tasks"]})]})]}),(0,ct.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,ct.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>dt(m),className:"h-6 w-6 p-0",children:(0,ct.jsx)(mt.Edit2,{className:"h-3 w-3"})}),(0,ct.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>n(m.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,ct.jsx)(mt.Trash2,{className:"h-3 w-3"})})]})]}),(0,ct.jsx)("div",{className:"flex items-center justify-between mt-2",children:(0,ct.jsx)(N,{variant:x?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>Y(m.id.toString()),disabled:!x&&u?.length>=3,children:(0,ct.jsx)("span",{className:"pointer-events-none select-none",children:x?"Deselect":u?.length>=3?"Limit Reached":"Select"})})})]})},m.id)}):(0,ct.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,ct.jsx)(mt.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,ct.jsxs)("p",{className:"text-sm",children:['No sprints found for "',te,'" filter']}),(0,ct.jsx)(N,{variant:"link",size:"sm",onClick:()=>O("all"),className:"text-xs",children:"Show all sprints"})]})}),u?.length===0&&(0,ct.jsx)("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,ct.jsxs)("div",{className:"text-center",children:[(0,ct.jsx)(mt.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,ct.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints ct start planning"}),(0,ct.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Choose up ct 3 sprints ct view alongside your backlog"})]})})]})]})})]}),(0,ct.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,ct.jsx)("div",{className:"lg:col-span-1",children:(0,ct.jsxs)(ie,{className:"p-4 h-full bg-card border-ct-4 border-ct-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:M,onDragEnter:()=>X("backlog"),onDragLeave:Q,onDrop:m=>Te(m,"backlog"),style:{height:E>0?`calc(100vh - ${E+200}px)`:"calc(100vh - 16rem)"},children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,ct.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsxs)(le,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[me?.length," tasks"]}),(0,ct.jsxs)(le,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[qe," pts"]})]})]}),(0,ct.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${v==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:m,unassignedTasks:x}=at(me);return(0,ct.jsxs)(ct.Fragment,{children:[Object.entries(m).map(([G,q])=>{let Pe=he(G);if(!Pe)return null;let Re=d.has(G);return(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>We(G),children:[(0,ct.jsx)("div",{className:`w-3 h-3 rounded-full ${Pe.color}`}),(0,ct.jsx)("span",{className:"font-medium text-muted-foreground",children:Pe.name}),(0,ct.jsxs)("span",{className:"text-muted-foreground",children:["(",q?.length,")"]}),(0,ct.jsx)("div",{className:"ml-auto",children:Re?(0,ct.jsx)(mt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,ct.jsx)(mt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Re&&(0,ct.jsx)("div",{className:"space-y-2 pl-2",children:q.map(Oe=>(0,ct.jsx)(Ie,{task:Oe},Oe.id))})]},G)}),x?.length>0&&(()=>{let G=d.has("eo-epic");return(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>We("eo-epic"),children:[(0,ct.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,ct.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,ct.jsxs)("span",{className:"text-muted-foreground",children:["(",x?.length,")"]}),(0,ct.jsx)("div",{className:"ml-auto",children:G?(0,ct.jsx)(mt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,ct.jsx)(mt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!G&&(0,ct.jsx)("div",{className:"space-y-2 pl-2",children:x?.map(q=>(0,ct.jsx)(Ie,{task:q},q.id))})]})})(),me?.length===0&&(0,ct.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here ct move ct backlog"}),me?.length>0&&Object.keys(m).length===0&&x.length===0&&(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),me?.map(G=>(0,ct.jsx)(Ie,{task:G},G.id))]})]})})()})]})}),K.map(m=>{let x=e.filter(q=>fe(q?.sprint)===m.id),G=x.reduce((q,Pe)=>q+(Pe?.storyPoints||0),0);return(0,ct.jsxs)(ie,{className:"p-4 h-full bg-card border-ct-4 border-ct-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:M,onDragEnter:()=>X(m.id.toString()),onDragLeave:Q,onDrop:q=>Te(q,m.id.toString()),style:{height:E>0?`calc(100vh - ${E+200}px)`:"calc(100vh - 16rem)"},children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,ct.jsx)("div",{children:(0,ct.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:m.name})}),(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsxs)(le,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[x?.length," tasks"]}),(0,ct.jsxs)(le,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[G," pts"]}),(0,ct.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>{Me(!0),dt(m)},className:"h-6 px-2",children:(0,ct.jsx)(mt.Edit2,{className:"h-3 w-3"})}),(0,ct.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>n(m.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,ct.jsx)(mt.Trash2,{className:"h-3 w-3"})})]})]}),(0,ct.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:q,unassignedTasks:Pe}=at(x);return(0,ct.jsxs)(ct.Fragment,{children:[Object.entries(q).map(([Re,Oe])=>{let jt=he(Re);if(!jt)return null;let Wt=d.has(Re);return(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>We(Re),children:[(0,ct.jsx)("div",{className:`w-3 h-3 rounded-full ${jt.color}`}),(0,ct.jsx)("span",{className:"font-medium text-muted-foreground",children:jt.name}),(0,ct.jsxs)("span",{className:"text-muted-foreground",children:["(",Oe?.length,")"]}),(0,ct.jsx)("div",{className:"ml-auto",children:Wt?(0,ct.jsx)(mt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,ct.jsx)(mt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Wt&&(0,ct.jsx)("div",{className:"space-y-2 pl-2",children:Oe?.map(_t=>(0,ct.jsx)(Ie,{task:_t},_t.id))})]},Re)}),Pe?.length>0&&(()=>{let Re=d.has("eo-epic");return(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>We("eo-epic"),children:[(0,ct.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,ct.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,ct.jsxs)("span",{className:"text-muted-foreground",children:["(",Pe?.length,")"]}),(0,ct.jsx)("div",{className:"ml-auto",children:Re?(0,ct.jsx)(mt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,ct.jsx)(mt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Re&&(0,ct.jsx)("div",{className:"space-y-2 pl-2",children:Pe?.map(Oe=>(0,ct.jsx)(Ie,{task:Oe},Oe.id))})]})})(),x?.length===0&&(0,ct.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},m.id)})]}),(0,ct.jsx)(Vo,{isOpen:b,onClose:()=>I(!1),onAddSprint:$t})]})})]})};var yi=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),wi=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})},Ia=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[r,s]=t.split(":");o.setHours(parseInt(r),parseInt(s))}return o<a},Fa=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Ni=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Ci=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[r,s]=(0,oe.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[c,n]=(0,oe.useState)(!1),u=d=>{if(d.preventDefault(),!e.find(C=>C?.id.toString()===r.colleagueId.toString())){console.error("No valid colleague selected"),n(!0);return}n(!1);let T={title:r.title,description:r.description,dueDate:new Date(r.dueDate).toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring,assignedColleague:Number(r.colleagueId),project:1,updatedAt:new Date().toISOString()};t(T),o(!1),s({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,oe.useEffect)(()=>{r.colleagueId&&n(!1)},[r.colleagueId]);let p=e.filter(Boolean);return(0,ct.jsx)(Ke,{open:a,onOpenChange:o,children:(0,ct.jsxs)(Ue,{className:"max-w-2xl",children:[(0,ct.jsx)(Ge,{children:(0,ct.jsx)($e,{children:"Add New Reminder"})}),(0,ct.jsxs)("form",{onSubmit:u,className:"space-y-4",children:[(0,ct.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"title",children:"Title"}),(0,ct.jsx)(Z,{id:"title",value:r.title,onChange:d=>s({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"description",children:"Description"}),(0,ct.jsx)(Ee,{id:"description",value:r.description,onChange:d=>s({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,ct.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"dueDate",children:"Due Date"}),(0,ct.jsx)(Z,{id:"dueDate",type:"date",value:r.dueDate,onChange:d=>s({...r,dueDate:d.target.value}),required:!0})]}),(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,ct.jsx)(Z,{id:"dueTime",type:"time",value:r.dueTime,onChange:d=>s({...r,dueTime:d.target.value})})]})]}),(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{className:`${c?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,ct.jsxs)(ze,{value:r.colleagueId,onValueChange:d=>{s({...r,colleagueId:d})},required:!0,children:[(0,ct.jsx)(Fe,{className:`${c?"text-destructive border-red-500":""}`,children:(0,ct.jsx)(ot,{className:`${c?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(d=>d?.id.toString()===r.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,ct.jsx)(Le,{children:p.map(d=>(0,ct.jsx)(ne,{value:d.id.toString(),children:d.name},d.id))})]}),c&&(0,ct.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ct.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:d=>s({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,ct.jsx)(R,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,ct.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,ct.jsxs)(ze,{value:r.recurrencePattern,onValueChange:d=>s({...r,recurrencePattern:d}),children:[(0,ct.jsx)(Fe,{children:(0,ct.jsx)(ot,{})}),(0,ct.jsxs)(Le,{children:[(0,ct.jsx)(ne,{value:"daily",children:"Daily"}),(0,ct.jsx)(ne,{value:"weekly",children:"Weekly"}),(0,ct.jsx)(ne,{value:"monthly",children:"Monthly"}),(0,ct.jsx)(ne,{value:"yearly",children:"Yearly"})]})]})]}),(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"recurrenceInterval",children:"Every"}),(0,ct.jsx)(Z,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:d=>s({...r,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,ct.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,ct.jsx)(N,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,ct.jsx)(N,{type:"submit",children:"Add Reminder"})]})]})]})})},ki=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:r})=>{let[s,c]=(0,oe.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),n=p=>{p.preventDefault(),a(e.id.toString(),{title:s.title,description:s.description,dueDate:new Date(s.dueDate||"").toISOString(),dueTime:s.dueTime||void 0,isRecurring:s.isRecurring}),r()},u=t.filter(Boolean);return(0,ct.jsx)(Ke,{open:o,onOpenChange:r,children:(0,ct.jsxs)(Ue,{className:"max-w-2xl",children:[(0,ct.jsx)(Ge,{children:(0,ct.jsx)($e,{children:"Edit Reminder"})}),(0,ct.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,ct.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"edit-title",children:"Title"}),(0,ct.jsx)(Z,{id:"edit-title",value:s.title,onChange:p=>c({...s,title:p.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"edit-description",children:"Description"}),(0,ct.jsx)(Ee,{id:"edit-description",value:s.description||"",onChange:p=>c({...s,description:p.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,ct.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,ct.jsx)(Z,{id:"edit-dueDate",type:"date",value:s.dueDate,onChange:p=>c({...s,dueDate:p.target.value}),required:!0})]}),(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,ct.jsx)(Z,{id:"edit-dueTime",type:"time",value:s.dueTime,onChange:p=>c({...s,dueTime:p.target.value})})]})]}),(0,ct.jsx)("div",{className:"space-y-2",children:(0,ct.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ct.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:s.isRecurring||!1,onChange:p=>c({...s,isRecurring:p.target.checked}),className:"rounded border-border"}),(0,ct.jsx)(R,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,ct.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,ct.jsx)(N,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,ct.jsx)(N,{type:"submit",children:"Save Changes"})]})]})]})})},Si=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[r,s]=(0,oe.useState)(!1);if(!e||!e.id)return null;let c=Ia(new Date(e.dueDate||""),e.dueTime||""),n=Fa(new Date(e.dueDate||"")),u=Ni(new Date(e.dueDate||"")),p=()=>{a(e.id.toString(),{})},d=()=>n?"Today":u?"Tomorrow":yi(new Date(e.dueDate||""));return(0,ct.jsxs)(ct.Fragment,{children:[(0,ct.jsx)(ki,{reminder:e,colleagues:t,onUpdateReminder:a,open:r,onClose:()=>s(!1)}),(0,ct.jsx)(ie,{children:(0,ct.jsx)(Ot,{className:"p-4",children:(0,ct.jsxs)("div",{className:"flex items-start justify-between",children:[(0,ct.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,ct.jsx)("button",{onClick:p,className:"mt-1 text-primary hover:text-primary/80"}),(0,ct.jsxs)("div",{className:"flex-1",children:[(0,ct.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,ct.jsx)("h3",{children:e.title})}),(0,ct.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,ct.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,ct.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,ct.jsx)(mt.Calendar,{className:"h-4 w-4"}),(0,ct.jsx)("span",{className:c?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,ct.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,ct.jsx)(mt.Clock,{className:"h-4 w-4"}),(0,ct.jsx)("span",{children:wi(e.dueTime)})]}),(0,ct.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,ct.jsx)(mt.User,{className:"h-4 w-4"}),(0,ct.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,ct.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,ct.jsx)(N,{variant:"ghost",size:"sm",onClick:()=>s(!0),className:"h-8 w-8 p-0",children:(0,ct.jsx)(mt.Edit2,{className:"h-4 w-4"})}),(0,ct.jsx)(N,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,ct.jsx)(mt.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Uo=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:r})=>{let[s,c]=(0,oe.useState)(e.filter(Boolean)),[n,u]=(0,oe.useState)(t.filter(Boolean)),[p,d]=(0,oe.useState)("all"),[g,T]=(0,oe.useState)(""),[C,b]=(0,oe.useState)(!1);(0,oe.useEffect)(()=>{c(e.filter(Boolean))},[e]),(0,oe.useEffect)(()=>{u(t.filter(Boolean))},[t]);let I=k=>{if(!k.title){console.error("Invalid reminder data:",k);return}let _={...k,id:Date.now(),createdAt:new Date().toISOString()};c(te=>[...te,_]),a?.(k)},v=(k,_)=>{if(!k){console.error("No reminder ID provided for update");return}c(te=>te.map(O=>O?.id.toString()===k?{...O,..._}:O)),o?.(k,_)},V=k=>{if(!k){console.error("No reminder ID provided for deletion");return}c(_=>_.filter(te=>te?.id.toString()!==k)),r?.(k)},w=s.filter(k=>{if(!k)return!1;if(g){let _=g.toLowerCase();if(!(k.title.toLowerCase().includes(_)||k.description?.toLowerCase().includes(_)))return!1}switch(p){case"pending":case"completed":case"overdue":return Ia(new Date(k.dueDate||""),k.dueTime||"");case"today":return Fa(new Date(k.dueDate||""));default:return!0}}).sort((k,_)=>{if(!k||!_)return 0;let te={high:3,medium:2,low:1},O=0;return O!==0?O:new Date(k.dueDate||"").getTime()-new Date(_.dueDate||"").getTime()}),F={total:s.filter(Boolean).length,overdue:s.filter(k=>k&&Ia(new Date(k.dueDate||""),k.dueTime||"")).length,today:s.filter(k=>k&&Fa(new Date(k.dueDate||""))).length},se=n.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,ct.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,ct.jsx)(nt,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-ct-r from-emerald-600 via-teal-600 ct-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{b(!0)}}}),(0,ct.jsxs)("div",{className:"h-full bg-background",children:[(0,ct.jsx)(Ci,{colleagues:n,onAddReminder:I,open:C,setOpen:b}),(0,ct.jsxs)("div",{className:"p-6",children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,ct.jsxs)("div",{children:[(0,ct.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,ct.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,ct.jsxs)(N,{className:"flex items-center space-x-2",onClick:()=>b(!0),children:[(0,ct.jsx)(mt.Plus,{className:"h-4 w-4"}),(0,ct.jsx)("span",{children:"Add Reminder"})]})]}),(0,ct.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,ct.jsxs)(ie,{className:"p-4",children:[(0,ct.jsx)("div",{className:"text-2xl font-bold text-foreground",children:F.total}),(0,ct.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,ct.jsxs)(ie,{className:"p-4",children:[(0,ct.jsx)("div",{className:"text-2xl font-bold text-primary",children:F.overdue}),(0,ct.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,ct.jsxs)(ie,{className:"p-4",children:[(0,ct.jsx)("div",{className:"text-2xl font-bold text-success",children:F.today}),(0,ct.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,ct.jsxs)(ie,{className:"p-4",children:[(0,ct.jsx)("div",{className:"text-2xl font-bold text-destructive",children:F.overdue}),(0,ct.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,ct.jsxs)(ie,{className:"p-4",children:[(0,ct.jsx)("div",{className:"text-2xl font-bold text-warning",children:F.today}),(0,ct.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,ct.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,ct.jsx)("div",{className:"flex-1",children:(0,ct.jsx)(Z,{placeholder:"Search reminders...",value:g,onChange:k=>T(k.target.value),className:"max-w-md"})}),(0,ct.jsxs)(ze,{value:p,onValueChange:k=>d(k),children:[(0,ct.jsx)(Fe,{className:"w-40",children:(0,ct.jsx)(ot,{})}),(0,ct.jsxs)(Le,{children:[(0,ct.jsxs)(ne,{value:"all",children:["All (",F.total,")"]}),(0,ct.jsxs)(ne,{value:"overdue",children:["Overdue (",F.overdue,")"]}),(0,ct.jsxs)(ne,{value:"overdue",children:["Overdue (",F.overdue,")"]}),(0,ct.jsxs)(ne,{value:"today",children:["Today (",F.today,")"]})]})]})]}),(0,ct.jsx)("div",{className:"space-y-4",children:w.length===0?(0,ct.jsxs)(ie,{className:"p-8 text-center",children:[(0,ct.jsx)("div",{className:"text-muted-foreground",children:g||p!=="all"?"No reminders match your filters":"No reminders yet"}),!g&&p==="all"&&(0,ct.jsx)("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder ct get started"})]}):w.map(k=>k&&(0,ct.jsx)(Si,{reminder:k,colleagues:n,onUpdateReminder:v,onDeleteReminder:V},k.id))})]})]})]})};var It=ue(require("@radix-ui/react-tabs"));function Go({className:e,...t}){return(0,ct.jsx)(It.Root,{"data-slot":"tabs",className:y("flex flex-col gap-2",e),...t})}function $o({className:e,...t}){return(0,ct.jsx)(It.List,{"data-slot":"tabs-list",className:y("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function jo({className:e,...t}){return(0,ct.jsx)(It.Trigger,{"data-slot":"tabs-trigger",className:y("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 vt=ue(require("react")),U=ue(require("@radix-ui/react-dropdown-menu")),Gt=require("@radix-ui/react-icons");var Wo=U.Root,_o=U.Trigger;var Di=vt.forwardRef(({className:e,inset:t,children:a,...o},r)=>(0,ct.jsxs)(U.SubTrigger,{ref:r,className:y("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,ct.jsx)(Gt.ChevronRightIcon,{className:"ml-auto"})]}));Di.displayName=U.SubTrigger.displayName;var Ti=vt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(U.SubContent,{ref:a,className:y("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}));Ti.displayName=U.SubContent.displayName;var La=vt.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,ct.jsx)(U.Portal,{children:(0,ct.jsx)(U.Content,{ref:o,sideOffset:t,className:y("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})}));La.displayName=U.Content.displayName;var Ba=vt.forwardRef(({className:e,inset:t,...a},o)=>(0,ct.jsx)(U.Item,{ref:o,className:y("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}));Ba.displayName=U.Item.displayName;var Pi=vt.forwardRef(({className:e,children:t,checked:a,...o},r)=>(0,ct.jsxs)(U.CheckboxItem,{ref:r,className:y("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[(0,ct.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,ct.jsx)(U.ItemIndicator,{children:(0,ct.jsx)(Gt.CheckIcon,{className:"h-4 w-4"})})}),t]}));Pi.displayName=U.CheckboxItem.displayName;var Ri=vt.forwardRef(({className:e,children:t,...a},o)=>(0,ct.jsxs)(U.RadioItem,{ref:o,className:y("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,ct.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,ct.jsx)(U.ItemIndicator,{children:(0,ct.jsx)(Gt.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Ri.displayName=U.RadioItem.displayName;var Ei=vt.forwardRef(({className:e,inset:t,...a},o)=>(0,ct.jsx)(U.Label,{ref:o,className:y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));Ei.displayName=U.Label.displayName;var Ai=vt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(U.Separator,{ref:a,className:y("-mx-1 my-1 h-px bg-muted",e),...t}));Ai.displayName=U.Separator.displayName;var Mi=({className:e,...t})=>(0,ct.jsx)("span",{className:y("ml-auto text-xs tracking-widest opacity-60",e),...t});Mi.displayName="DropdownMenuShortcut";function qo({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:r="700px",gridCols:s=6}){let c=a.find(n=>n.value===e);return(0,ct.jsxs)(Mo.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,ct.jsx)("div",{className:"hidden lg:block",children:(0,ct.jsx)(Go,{value:e,onValueChange:t,children:(0,ct.jsx)($o,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(s,a.length)}, minmax(0, 1fr))`},children:a.map(n=>(0,ct.jsx)(Mo.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,ct.jsx)(jo,{value:n.value,className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:n.label})},n.value))})})}),(0,ct.jsx)("div",{className:"lg:hidden",children:(0,ct.jsxs)(Wo,{children:[(0,ct.jsx)(_o,{asChild:!0,children:(0,ct.jsxs)(N,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[c?.label||"Select",(0,ct.jsx)(mt.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,ct.jsx)(La,{align:"center",className:"w-[180px]",children:a.map(n=>(0,ct.jsx)(Ba,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function ua({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:r=!0,className:s}){return(0,ct.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${s||""}`,children:[r&&(0,ct.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,ct.jsx)("div",{className:"col-span-6",children:"Name"}),(0,ct.jsx)("div",{className:"col-span-2",children:"Size"}),(0,ct.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,ct.jsx)("div",{className:"divide-y",children:e.map(c=>(0,ct.jsxs)(Mo.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?.(c),children:[(0,ct.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,ct.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,ct.jsx)("div",{children:(0,ct.jsx)("p",{className:"font-medium",children:c.name})})]}),(0,ct.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:c.filesize}),(0,ct.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,ct.jsx)("span",{className:"text-sm md:text-base",children:typeof c.createdAt=="string"?c.createdAt:new Date(c.createdAt).toLocaleDateString()}),(0,ct.jsx)("div",{className:"flex gap-1",children:(0,ct.jsx)(N,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:n=>{n.stopPropagation(),o?.(c)},children:(0,ct.jsx)(mt.Trash2,{className:"h-4 w-4"})})})]})]},c.name))})]})}var Zo=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,r]=(0,oe.useState)(null),[s,c]=(0,oe.useState)(""),[n,u]=(0,oe.useState)(""),[p,d]=(0,oe.useState)(""),g=C=>{let b=C.target.files?.[0];b&&(r(b),s||c(b.name))},T=async C=>{if(C.preventDefault(),!o)return;let b=new FormData;b.append("file",o),b.append("name",s),n&&b.append("description",n),p&&b.append("tags",p),a?.(b),t(),r(null),c(""),u(""),d("")};return(0,ct.jsx)(Ke,{open:e,onOpenChange:t,children:(0,ct.jsxs)(Ue,{className:"sm:max-w-md",children:[(0,ct.jsx)(Ge,{children:(0,ct.jsx)($e,{children:"Add New File"})}),(0,ct.jsxs)("form",{onSubmit:T,className:"grid gap-4",children:[(0,ct.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,ct.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[(0,ct.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,ct.jsx)(Ii,{className:"w-10 h-10 text-gray-400"}),(0,ct.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,ct.jsx)("span",{className:"font-semibold",children:"Click ct upload"})," or drag and drop"]}),(0,ct.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,ct.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:g})]})}),o&&(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsxs)("div",{children:[(0,ct.jsx)("p",{className:"font-medium",children:o.name}),(0,ct.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,ct.jsx)(N,{type:"submit",onClick:T,children:"Upload"})]})]})]})})};function Ii(e){return(0,ct.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ct.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,ct.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,ct.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function za({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:r,compactView:s=!1,className:c}){let[n,u]=(0,oe.useState)(e),[p,d]=(0,oe.useState)(""),[g,T]=(0,oe.useState)("all"),[C,b]=(0,oe.useState)("all"),[I,v]=(0,oe.useState)(!1);(0,oe.useEffect)(()=>{u(e)},[e]);let V=n.filter(O=>O.name.toLowerCase().includes(p.toLowerCase())),W=V.slice(0,10),w=V.filter(Boolean),F=()=>{v(!0)},se=O=>{a?.(O)},k=O=>{console.log("deleting file",O),u(be=>be.filter(Me=>Me.name!==O.name)),o?.(O.id.toString())},_=O=>{r?.(O)},te=()=>{d(""),T("all")};return(0,ct.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,ct.jsx)(Mo.AnimatePresence,{mode:"wait",children:(0,ct.jsx)(Mo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,ct.jsxs)("div",{className:`space-y-6 ${c||""}`,children:[(0,ct.jsx)(nt,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-ct-r from-blue-600 via-indigo-600 ct-purple-600",primaryAction:{label:"Upload file",onClick:F},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,ct.jsx)(ie,{children:(0,ct.jsx)(Ot,{className:"pt-6",children:(0,ct.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,ct.jsx)("div",{className:"flex-1",children:(0,ct.jsxs)("div",{className:"relative",children:[(0,ct.jsx)(mt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,ct.jsx)(Z,{placeholder:"Search files...",value:p,onChange:O=>d(O.target.value),className:"pl-9"})]})}),(p||g!=="all")&&(0,ct.jsxs)(N,{variant:"outline",onClick:te,className:"gap-2",children:[(0,ct.jsx)(mt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,ct.jsxs)("div",{className:"space-y-4",children:[(0,ct.jsx)(qo,{activeTab:C,onTabChange:b,tabOptions:[{value:"all",label:`All Files (${V.length})`},{value:"recent",label:`Recent (${W.length})`}],maxWidth:"500px",gridCols:3}),C==="all"&&(0,ct.jsx)(ua,{files:V,onFileClick:_,onFileEdit:se,onFileDelete:k,showHeader:!s}),C==="recent"&&(0,ct.jsx)(ua,{files:W,onFileClick:_,onFileEdit:se,onFileDelete:k,showHeader:!s}),C==="shared"&&(0,ct.jsx)(ua,{files:w,onFileClick:_,onFileEdit:se,onFileDelete:k,showHeader:!s})]}),V.length===0&&(0,ct.jsx)(ie,{children:(0,ct.jsx)(Ot,{className:"pt-6",children:(0,ct.jsxs)("div",{className:"text-center py-8",children:[(0,ct.jsx)(mt.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,ct.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,ct.jsx)("p",{className:"text-muted-foreground mb-4",children:p||g!=="all"?"Try adjusting your filters ct see more results.":"Get started by uploading your first file."}),(0,ct.jsxs)(N,{onClick:F,className:"gap-2",children:[(0,ct.jsx)(mt.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,ct.jsx)(Zo,{isOpen:I,onClose:()=>v(!1),onAddFile:t})]})}var Yo=require("next/navigation");function Qo({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:r=[],initialReminders:s=[],initialColleagues:c=[],initialUsers:n=[],initialFiles:u=[],initialView:p="kanban",onAddTask:d,onUpdateTask:g,onDeleteTask:T,onTaskClick:C,onAddEpic:b,onUpdateEpic:I,onDeleteEpic:v,onAddTaskToEpic:V,onAddSprint:W,onUpdateSprint:w,onDeleteSprint:F,onAddProject:se,onUpdateProject:k,onDeleteProject:_,onFileAdd:te,onFileEdit:O,onFileDelete:be,onFileClick:Me,onAddReminder:E,onUpdateReminder:we,onDeleteReminder:ee,onViewChange:et,onToggleMobileMenu:he,onTeamClick:lt,onTeamChange:tt,onCopilotClick:rt,handleAddComment:at}){let[h,K]=(0,oe.useState)(t),[me,qe]=(0,oe.useState)(a),[Y,We]=(0,oe.useState)(o),[$t,dt]=(0,oe.useState)(r),[Ft,bt]=(0,oe.useState)(s),[kt,M]=(0,oe.useState)(c),[X,Q]=(0,oe.useState)(n),[Te,Ie]=(0,oe.useState)(u),[m,x]=(0,oe.useState)(!1),[G,q]=(0,oe.useState)(!1),[Pe,Re]=(0,oe.useState)(null),[Oe,jt]=(0,oe.useState)(null),[Wt,_t]=(0,oe.useState)(null),[St,Va]=(0,oe.useState)(p||"kanban"),[Li,er]=(0,oe.useState)(!1),tr=(0,Yo.useRouter)();(0,oe.useEffect)(()=>{K(t)},[t]),(0,oe.useEffect)(()=>{We(o)},[o]),(0,oe.useEffect)(()=>{qe(a)},[a]),(0,oe.useEffect)(()=>{dt(r)},[r]),(0,oe.useEffect)(()=>{Ie(u)},[u]),(0,oe.useEffect)(()=>{Q(n)},[n]),(0,oe.useEffect)(()=>{M(c)},[c]),(0,oe.useEffect)(()=>{bt(s)},[s]),(0,oe.useEffect)(()=>{Va(p)},[p]);let ar=h.filter(f=>{}),Bi=f=>ar.filter(A=>A.status===f),Oi=f=>{let A={};return me.forEach(L=>{}),A},zi=f=>{_t(f)},Vi=f=>{Wt&&(K(A=>A.map(L=>L.id===Wt.id?{...L,status:f}:L)),_t(null))},Ha=f=>{let A={...f,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};K(L=>[...L,A]),d?.(A)},ea=async(f,A)=>(K(L=>L.map(Ne=>Ne.id===Number(f)?{...Ne,...A}:Ne)),await g?.(f,A)),Hi=async(f,A)=>{ea(f,A)},Ua=f=>{K(A=>A.filter(L=>L.id!==Number(f))),Pe?.id===Number(f)&&Re(null),T?.(f)},Ui=async f=>{Ua(f)},Gi=f=>{let A={...f,id:Date.now()};dt(L=>[...L,A]),se?.(f)},$ct=(f,A)=>{dt(L=>L.map(Ne=>Ne.id===Number(f)?{...Ne,...A}:Ne)),k?.(f,A)},ji=f=>{dt(A=>A.filter(L=>L.id!==Number(f))),_?.(f)},Ga=f=>{let A={...f,id:Date.now()};qe(L=>[...L,A]),b?.({...A})},or=()=>{q(!0)},rr=(f,A)=>{qe(L=>L.map(Ne=>Ne.id===Number(f)?{...Ne,...A}:Ne)),I?.(f,A)},ir=f=>{qe(A=>A.filter(L=>L.id!==Number(f))),K(A=>A.filter(L=>fe(L.epic)!==Number(f))),v?.(f)},nr=f=>{let A={...f,id:Date.now()};We(L=>[...L,A]),W?.(f)},sr=(f,A)=>{We(L=>L.map(Ne=>Ne.id===Number(f)?{...Ne,...A}:Ne)),w?.(f,A)},lr=f=>{f==="backlog"||f==="all-tasks"||(We(A=>A.filter(L=>L.id!==Number(f))),K(A=>A.map(L=>fe(L.sprint)===Number(f)?{...L,sprint:void 0}:L)),F?.(f))},fa=f=>{Re(f)},dr=f=>{f==="planning"&&window.innerWidth<768||(Va(f),et?.(f))},Wi=()=>{er(f=>!f),he?.()},_i=()=>{tr.push("/")},Ki=f=>{console.log("Switching ct team:",f)},qi=f=>{console.log("Switching ct team:",f)},cr=f=>{x(!0)},mr=()=>{x(!1),jt(null)},pr=f=>{let A={...f,id:Date.now(),createdAt:new Date().toISOString()};bt(L=>[...L,A]),E?.(f)},ur=(f,A)=>{bt(L=>L.map(Ne=>Ne.id===Number(f)?{...Ne,...A}:Ne)),we?.(f,A)},gr=f=>{bt(A=>A.filter(L=>L.id!==Number(f))),ee?.(f)},fr=()=>{te?.()},vr=f=>{O?.(f)},br=f=>{Ie(A=>A.filter(L=>L.name!==f)),be?.(f)},hr=f=>{Me?.(f)},Ji=[{id:"todo",title:"To oe",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Xi=()=>{switch(St){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"}},va=[{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")}],Zi=va.sort((f,A)=>A.lastUsed.getTime()-f.lastUsed.getTime()).slice(0,3),Yi=va.length>3,Qi=va.slice(3);return(0,ct.jsxs)(ja,{currentView:St,onViewChange:dr,children:[St==="kanban"&&(0,ct.jsx)("div",{className:"h-full overflow-hidden",children:(0,ct.jsx)(Io,{initialProjects:$t,initialEpics:me,initialSprints:Y.map(f=>({...f,isSelected:!1})),initialTasks:h,initialColleagues:kt,initialUsers:X,onAddTask:Ha,onUpdateTask:ea,onDeleteTask:Ua,onTaskClick:fa,onAddEpic:Ga,onAddComment:at})}),St==="planning"&&(0,ct.jsx)("div",{className:"hidden md:block h-full",children:(0,ct.jsx)(Ho,{tasks:h,epics:me,sprints:Y,onUpdateTask:ea,onTaskClick:fa,onAddSprint:nr,onUpdateSprint:sr,onDeleteSprint:lr})}),St==="tasks"&&(0,ct.jsx)("div",{className:"h-full",children:(0,ct.jsx)(Uo,{initialReminders:Ft,initialColleagues:kt,onAddReminder:pr,onUpdateReminder:ur,onDeleteReminder:gr})}),St==="files"&&(0,ct.jsx)("div",{className:"h-full",children:(0,ct.jsx)(za,{initialFiles:Te,onFileAdd:fr,onFileEdit:vr,onFileDelete:br,onFileClick:hr,compactView:!1})}),St==="epics"&&(0,ct.jsx)("div",{className:"h-full",children:(0,ct.jsx)(Fo,{tasks:h,epics:me,sprints:Y,onUpdateTask:ea,onTaskClick:fa,onAddTaskToEpic:cr,onAddEpic:or,onUpdateEpic:rr,onDeleteEpic:ir})}),(0,ct.jsx)(Vt,{isOpen:m,onClose:mr,onAddTask:Ha,epics:me,sprints:Y,assignees:[...kt,...X],defaultEpicId:Oe||void 0}),(0,ct.jsx)(Ut,{isOpen:G,onClose:()=>q(!1),onAddEpic:Ga})]})}
|
|
5
|
+
"use strict";"use client";var xr=Object.create;var ta=Object.defineProperty;var yr=Object.getOwnPropertyDescriptor;var wr=Object.getOwnPropertyNames;var Nr=Object.getPrototypeOf,Cr=Object.prototype.hasOwnProperty;var kr=(e,t)=>{for(var a in t)ta(e,a,{get:t[a],enumerable:!0})},$a=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of wr(t))!Cr.call(e,r)&&r!==a&&ta(e,r,{get:()=>t[r],enumerable:!(o=yr(t,r))||o.enumerable});return e};var ue=(e,t,a)=>(a=e!=null?xr(Nr(e)):{},$a(t||!e||!e.__esModule?ta(a,"default",{value:e,enumerable:!0}):a,e)),Sr=e=>$a(ta({},"__esModule",{value:!0}),e);var Fi={};kr(Fi,{default:()=>Qo});module.exports=Sr(Fi);var oe=require("react");var mt=require("lucide-react"),ct=require("react/jsx-runtime"),Dr=[{key:"kanban",icon:mt.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:mt.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:mt.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:mt.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:mt.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],ja=({currentView:e,onViewChange:t,children:a})=>(0,ct.jsxs)("div",{className:"flex w-full h-screen",children:[(0,ct.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:Dr.map(o=>{let r=o.icon,s=e===o.key;return(0,ct.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${s?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,ct.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,ct.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,ct.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,ct.jsx)("div",{className:"w-full h-full",children:a})})]});var eo=require("class-variance-authority");var Qa=require("clsx");var xa="-",Tr=e=>{let t=Rr(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:c=>{let n=c.split(xa);return n[0]===""&&n.length!==1&&n.shift(),Ka(n,t)||Pr(c)},getConflictingClassGroupIds:(c,n)=>{let u=a[c]||[];return n&&o[c]?[...u,...o[c]]:u}}},Ka=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),r=o?Ka(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;let s=e.join(xa);return t.validators.find(({validator:c})=>c(s))?.classGroupId},Wa=/^\[(.+)\]$/,Pr=e=>{if(Wa.test(e)){let t=Wa.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Rr=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Ar(Object.entries(e.classGroups),a).forEach(([s,c])=>{ha(c,o,s,t)}),o},ha=(e,t,a,o)=>{e.forEach(r=>{if(typeof r=="string"){let s=r===""?t:_a(t,r);s.classGroupId=a;return}if(typeof r=="function"){if(Er(r)){ha(r(o),t,a,o);return}t.validators.push({validator:r,classGroupId:a});return}Object.entries(r).forEach(([s,c])=>{ha(c,_a(t,s),a,o)})})},_a=(e,t)=>{let a=e;return t.split(xa).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Er=e=>e.isThemeGetter,Ar=(e,t)=>t?e.map(([a,o])=>{let r=o.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([c,n])=>[t+c,n])):s);return[a,r]}):e,Mr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,r=(s,c)=>{a.set(s,c),t++,t>e&&(t=0,o=a,a=new Map)};return{get(s){let c=a.get(s);if(c!==void 0)return c;if((c=o.get(s))!==void 0)return r(s,c),c},set(s,c){a.has(s)?a.set(s,c):r(s,c)}}},qa="!",Ir=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,r=t[0],s=t.length,c=n=>{let u=[],p=0,d=0,g;for(let v=0;v<n.length;v++){let V=n[v];if(p===0){if(V===r&&(o||n.slice(v,v+s)===t)){u.push(n.slice(d,v)),d=v+s;continue}if(V==="/"){g=v;continue}}V==="["?p++:V==="]"&&p--}let T=u.length===0?n:n.substring(d),C=T.startsWith(qa),b=C?T.substring(1):T,I=g&&g>d?g-d:void 0;return{modifiers:u,hasImportantModifier:C,baseClassName:b,maybePostfixModifierPosition:I}};return a?n=>a({className:n,parseClassName:c}):c},Fr=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},Lr=e=>({cache:Mr(e.cacheSize),parseClassName:Ir(e),...Tr(e)}),Br=/\s+/,Or=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:r}=t,s=[],c=e.trim().split(Br),n="";for(let u=c.length-1;u>=0;u-=1){let p=c[u],{modifiers:d,hasImportantModifier:g,baseClassName:T,maybePostfixModifierPosition:C}=a(p),b=!!C,I=o(b?T.substring(0,C):T);if(!I){if(!b){n=p+(n.length>0?" "+n:n);continue}if(I=o(T),!I){n=p+(n.length>0?" "+n:n);continue}b=!1}let v=Fr(d).join(":"),V=g?v+qa:v,W=V+I;if(s.includes(W))continue;s.push(W);let w=r(I,b);for(let F=0;F<w.length;++F){let se=w[F];s.push(V+se)}n=p+(n.length>0?" "+n:n)}return n};function zr(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Ja(t))&&(o&&(o+=" "),o+=a);return o}var Ja=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Ja(e[o]))&&(a&&(a+=" "),a+=t);return a};function Vr(e,...t){let a,o,r,s=c;function c(u){let p=t.reduce((d,g)=>g(d),e());return a=Lr(p),o=a.cache.get,r=a.cache.set,s=n,n(u)}function n(u){let p=o(u);if(p)return p;let d=Or(u,a);return r(u,d),d}return function(){return s(zr.apply(null,arguments))}}var re=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Xa=/^\[(?:([a-z-]+):)?(.+)\]$/ct,Hr=/^\d+\/\d+$/,Ur=new Set(["px","full","screen"]),Gr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$r=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|ct|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Wr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_r=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pt=e=>Lt(e)||Ur.has(e)||Hr.test(e),ht=e=>Bt(e,"length",ei),Lt=e=>!!e&&!Number.isNaN(Number(e)),ba=e=>Bt(e,"number",Lt),Kt=e=>!!e&&Number.isInteger(Number(e)),Kr=e=>e.endsWith("%")&&Lt(e.slice(0,-1)),z=e=>Xa.test(e),xt=e=>Gr.test(e),qr=new Set(["length","size","percentage"]),Jr=e=>Bt(e,qr,Za),Xr=e=>Bt(e,"position",Za),Zr=new Set(["image","url"]),Yr=e=>Bt(e,Zr,ai),Qr=e=>Bt(e,"",ti),qt=()=>!0,Bt=(e,t,a)=>{let o=Xa.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},ei=e=>$r.test(e)&&!jr.test(e),Za=()=>!1,ti=e=>Wr.test(e),ai=e=>_r.test(e);var oi=()=>{let e=re("colors"),t=re("spacing"),a=re("blur"),o=re("brightness"),r=re("borderColor"),s=re("borderRadius"),c=re("borderSpacing"),n=re("borderWidth"),u=re("contrast"),p=re("grayscale"),d=re("hueRotate"),g=re("invert"),T=re("gap"),C=re("gradientColorStops"),b=re("gradientColorStopPositions"),I=re("inset"),v=re("margin"),V=re("opacity"),W=re("padding"),w=re("saturate"),F=re("scale"),se=re("sepia"),k=re("skew"),_=re("space"),te=re("translate"),O=()=>["auto","contain","none"],be=()=>["auto","hidden","clip","visible","scroll"],Me=()=>["auto",z,t],E=()=>[z,t],we=()=>["",pt,ht],ee=()=>["auto",Lt,z],et=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],he=()=>["solid","dashed","dotted","double","none"],lt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],tt=()=>["start","end","center","between","around","evenly","stretch"],rt=()=>["","0",z],at=()=>["auto","avoid","all","avoid-page","page","left","right","column"],h=()=>[Lt,z];return{cacheSize:500,separator:":",theme:{colors:[qt],spacing:[pt,ht],blur:["none","",xt,z],brightness:h(),borderColor:[e],borderRadius:["none","","full",xt,z],borderSpacing:E(),borderWidth:we(),contrast:h(),grayscale:rt(),hueRotate:h(),invert:rt(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[Kr,ht],inset:Me(),margin:Me(),opacity:h(),padding:E(),saturate:h(),scale:h(),sepia:rt(),skew:h(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",z]}],container:["container"],columns:[{columns:[xt]}],"break-after":[{"break-after":at()}],"break-before":[{"break-before":at()}],"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:[...et(),z]}],overflow:[{overflow:be()}],"overflow-x":[{"overflow-x":be()}],"overflow-y":[{"overflow-y":be()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[I]}],"inset-x":[{"inset-x":[I]}],"inset-y":[{"inset-y":[I]}],start:[{start:[I]}],end:[{end:[I]}],top:[{top:[I]}],right:[{right:[I]}],bottom:[{bottom:[I]}],left:[{left:[I]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Kt,z]}],basis:[{basis:Me()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",z]}],grow:[{grow:rt()}],shrink:[{shrink:rt()}],order:[{order:["first","last","none",Kt,z]}],"grid-cols":[{"grid-cols":[qt]}],"col-start-end":[{col:["auto",{span:["full",Kt,z]},z]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[qt]}],"row-start-end":[{row:["auto",{span:[Kt,z]},z]}],"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",z]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",z]}],gap:[{gap:[T]}],"gap-x":[{"gap-x":[T]}],"gap-y":[{"gap-y":[T]}],"justify-content":[{justify:["normal",...tt()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...tt(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...tt(),"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]}],mt:[{mt:[W]}],pt:[{pt:[W]}],pr:[{pr:[W]}],pb:[{pb:[W]}],pl:[{pl:[W]}],m:[{m:[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":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",z,t]}],"min-w":[{"min-w":[z,t,"min","max","fit"]}],"max-w":[{"max-w":[z,t,"none","full","min","max","fit","prose",{screen:[xt]},xt]}],h:[{h:[z,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[z,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[z,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[z,t,"auto","min","max","fit"]}],"font-size":[{text:["base",xt,ht]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ba]}],"font-family":[{font:[qt]}],"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",z]}],"line-clamp":[{"line-clamp":["none",Lt,ba]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",pt,z]}],"list-image":[{"list-image":["none",z]}],"list-style-type":[{list:["none","disc","decimal",z]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[V]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[V]}],"text-decoration":["underline","overline","line-through","eo-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",pt,ht]}],"underline-offset":[{"underline-offset":["auto",pt,z]}],"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:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",z]}],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",z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[V]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...et(),Xr]}],"bg-repeat":[{bg:["eo-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Jr]}],"bg-image":[{bg:["none",{"gradient-ct":["t","tr","r","br","b","bl","ct","tl"]},Yr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-ct-pos":[{ct:[b]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-ct":[{ct:[C]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-ct":[{"rounded-ct":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[n]}],"border-w-x":[{"border-x":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-r":[{"border-r":[n]}],"border-w-b":[{"border-b":[n]}],"border-w-ct":[{"border-ct":[n]}],"border-opacity":[{"border-opacity":[V]}],"border-style":[{border:[...he(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[V]}],"divide-style":[{divide:he()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-ct":[{"border-ct":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...he()]}],"outline-offset":[{"outline-offset":[pt,z]}],"outline-w":[{outline:[pt,ht]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:we()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[V]}],"ring-offset-w":[{"ring-offset":[pt,ht]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xt,Qr]}],"shadow-color":[{shadow:[qt]}],opacity:[{opacity:[V]}],"mix-blend":[{"mix-blend":[...lt(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":lt()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",xt,z]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[g]}],saturate:[{saturate:[w]}],sepia:[{sepia:[se]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[V]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",z]}],duration:[{duration:h()}],ease:[{ease:["linear","in","out","in-out",z]}],delay:[{delay:h()}],animate:[{animate:["none","spin","ping","pulse","bounce",z]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[F]}],"scale-x":[{"scale-x":[F]}],"scale-y":[{"scale-y":[F]}],rotate:[{rotate:[Kt,z]}],"translate-x":[{"translate-x":[te]}],"translate-y":[{"translate-y":[te]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",z]}],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","eo-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",z]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",z]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[pt,ht,ba]}],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","mt","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-ct","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-ct":["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-ct"],"border-w-x":["border-w-r","border-w-ct"],"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-ct"],"border-color-x":["border-color-r","border-color-ct"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-mt","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ya=Vr(oi);function y(...e){return Ya((0,Qa.clsx)(e))}var ri=(0,eo.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function le({className:e,variant:t,...a}){return(0,ct.jsx)("div",{className:y(ri({variant:t}),e),...a})}var Dt=ue(require("react"));var ie=Dt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:y("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ie.displayName="Card";var ii=Dt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:y("flex flex-col space-y-1.5 p-6",e),...t}));ii.displayName="CardHeader";var ni=Dt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:y("font-semibold leading-none tracking-tight",e),...t}));ni.displayName="CardTitle";var si=Dt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:y("text-sm text-muted-foreground",e),...t}));si.displayName="CardDescription";var Ot=Dt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:y("p-6 pt-0",e),...t}));Ot.displayName="CardContent";var li=Dt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("div",{ref:a,className:y("flex items-center p-6 pt-0",e),...t}));li.displayName="CardFooter";var ao=({title:e,status:t,taskCount:a,children:o,onDrop:r,isCompact:s=!1,height:c})=>{let n=d=>{d.preventDefault()},u=d=>{d.preventDefault(),r(t)};return(0,ct.jsxs)(ie,{className:`p-4 bg-card border-ct-4 ${(()=>{switch(t){case"todo":return"border-ct-gray-400";case"in-progress":return"border-ct-blue-500";case"review":return"border-ct-orange-500";case"done":return"border-ct-green-500";default:return"border-ct-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${s?"lg:max-w-xs":""}`,style:{height:c||"calc(100vh - 350px)"},onDragOver:n,onDrop:u,children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,ct.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${s?"text-base":"text-lg"}`,children:e}),(0,ct.jsx)(le,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,ct.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var Jt=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:r=!1})=>{let s=d=>{a(e)},c=()=>{o(e)},n=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},u=()=>{switch(e.type){case"story":return(0,ct.jsx)(mt.BookOpen,{className:"h-3 w-3"});case"bug":return(0,ct.jsx)(mt.Bug,{className:"h-3 w-3"});case"spike":return(0,ct.jsx)(mt.Zap,{className:"h-3 w-3"});case"task":default:return(0,ct.jsx)(mt.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 r?(0,ct.jsx)(ie,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:s,onClick:c,children:(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${p()}`,children:u()}),(0,ct.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,ct.jsxs)(ie,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:s,onClick:c,children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,ct.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${p()}`,children:[u(),(0,ct.jsx)("span",{className:"capitalize",children:e.type})]}),(0,ct.jsxs)("div",{className:"flex gap-1",children:[(0,ct.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${n()}`,children:e.priority}),(0,ct.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.storyPoints})]})]}),(0,ct.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,ct.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,ct.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-1",children:[(0,ct.jsx)(mt.User,{className:"h-4 w-4"}),(0,ct.jsx)("span",{children:e.assignee?.value?.name})]}),(0,ct.jsxs)("div",{className:"flex items-center gap-1",children:[(0,ct.jsx)(mt.Calendar,{className:"h-4 w-4"}),(0,ct.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var Xt=ue(require("react")),Ce=ue(require("@radix-ui/react-dialog"));var Ke=Ce.Root;var di=Ce.Portal;var ro=Xt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(Ce.Overlay,{ref:a,className:y("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}));ro.displayName=Ce.Overlay.displayName;var Ue=Xt.forwardRef(({className:e,children:t,...a},o)=>(0,ct.jsxs)(di,{children:[(0,ct.jsx)(ro,{}),(0,ct.jsxs)(Ce.Content,{ref:o,className:y("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-ct-left-1/2 data-[state=closed]:slide-out-ct-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,ct.jsxs)(Ce.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,ct.jsx)(mt.X,{className:"h-4 w-4"}),(0,ct.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Ue.displayName=Ce.Content.displayName;var Ge=({className:e,...t})=>(0,ct.jsx)("div",{className:y("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ge.displayName="DialogHeader";var Zt=({className:e,...t})=>(0,ct.jsx)("div",{className:y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Zt.displayName="DialogFooter";var $e=Xt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(Ce.Title,{ref:a,className:y("text-lg font-semibold leading-none tracking-tight",e),...t}));$e.displayName=Ce.Title.displayName;var ci=Xt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(Ce.Description,{ref:a,className:y("text-sm text-muted-foreground",e),...t}));ci.displayName=Ce.Description.displayName;var io=require("@radix-ui/react-slot"),so=ue(require("react")),aa=(0,eo.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),N=so.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...r},s)=>(0,ct.jsx)(e?io.Slot:"button",{className:y(aa({className:t,size:a,variant:o})),ref:s,...r}));N.displayName="Button";var co=ue(require("react"));var Z=co.forwardRef(({className:e,type:t,...a},o)=>(0,ct.jsx)("input",{type:t,className:y("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}));Z.displayName="Input";var po=ue(require("react")),Ee=po.forwardRef(({className:e,...t},a)=>(0,ct.jsx)("textarea",{className:y("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}));Ee.displayName="Textarea";var H=ue(require("@radix-ui/react-select")),yt=ue(require("react")),ze=H.Root;var ot=H.Value,Fe=yt.forwardRef(({children:e,className:t,...a},o)=>(0,ct.jsxs)(H.Trigger,{className:y("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,ct.jsx)(H.Icon,{asChild:!0,children:(0,ct.jsx)(mt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Fe.displayName=H.Trigger.displayName;var go=yt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(H.ScrollUpButton,{className:y("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,ct.jsx)(mt.ChevronUp,{className:"h-4 w-4"})}));go.displayName=H.ScrollUpButton.displayName;var fo=yt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(H.ScrollDownButton,{className:y("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,ct.jsx)(mt.ChevronDown,{className:"h-4 w-4"})}));fo.displayName=H.ScrollDownButton.displayName;var Le=yt.forwardRef(({children:e,className:t,position:a="popper",...o},r)=>(0,ct.jsx)(H.Portal,{children:(0,ct.jsxs)(H.Content,{className:y("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:r,...o,children:[(0,ct.jsx)(go,{}),(0,ct.jsx)(H.Viewport,{className:y("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,ct.jsx)(fo,{})]})}));Le.displayName=H.Content.displayName;var mi=yt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(H.Label,{className:y("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:a,...t}));mi.displayName=H.Label.displayName;var ne=yt.forwardRef(({children:e,className:t,...a},o)=>(0,ct.jsxs)(H.Item,{className:y("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:o,...a,children:[(0,ct.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,ct.jsx)(H.ItemIndicator,{children:(0,ct.jsx)(mt.Check,{className:"h-4 w-4"})})}),(0,ct.jsx)(H.ItemText,{children:e})]}));ne.displayName=H.Item.displayName;var pi=yt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(H.Separator,{className:y("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));pi.displayName=H.Separator.displayName;var vo=ue(require("react")),ya=ue(require("@radix-ui/react-label"));var ui=(0,eo.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),R=vo.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(ya.Root,{ref:a,className:y(ui(),e),...t}));R.displayName=ya.Root.displayName;var Et=ue(require("react")),zt=ue(require("@radix-ui/react-toggle-group"));var xo=ue(require("react")),wa=ue(require("@radix-ui/react-toggle"));var Na=(0,eo.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"}}),gi=xo.forwardRef(({className:e,variant:t,size:a,...o},r)=>(0,ct.jsx)(wa.Root,{ref:r,className:y(Na({variant:t,size:a,className:e})),...o}));gi.displayName=wa.Root.displayName;var No=Et.createContext({size:"default",variant:"default"}),At=Et.forwardRef(({className:e,variant:t,size:a,children:o,...r},s)=>(0,ct.jsx)(zt.Root,{ref:s,className:y("flex items-center justify-center gap-1",e),...r,children:(0,ct.jsx)(No.Provider,{value:{variant:t,size:a},children:o})}));At.displayName=zt.Root.displayName;var Mt=Et.forwardRef(({className:e,children:t,variant:a,size:o,...r},s)=>{let c=Et.useContext(No);return(0,ct.jsx)(zt.Item,{ref:s,className:y(Na({variant:c.variant||a,size:c.size||o}),e),...r,children:t})});Mt.displayName=zt.Item.displayName;var fi=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:mt.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:mt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:mt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:mt.Zap}],vi=[{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"}],Vt=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:r,assignees:s,defaultEpicId:c})=>{let[n,u]=(0,oe.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,oe.useEffect)(()=>{e&&c&&u(g=>({...g,epic:c}))},[e,c]),(0,oe.useEffect)(()=>{e&&u({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:c||"",sprint:"none",assignee:""})},[e]);let p=g=>{g.preventDefault(),n.name.trim()&&(a({name:n.name.trim(),description:n.description.trim(),status:"todo",priority:n.priority,type:n.type,storyPoints:n.storyPoints,epic:Number(n.epic),sprint:Number(n.sprint),assignee:n.assignee.trim()?{relationTo:"digital-colleagues",value:Number(n.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),u({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:c||"",sprint:"",assignee:""}),t())},d=(g,T)=>{u(C=>({...C,[g]:T}))};return(0,ct.jsx)(Ke,{open:e,onOpenChange:t,children:(0,ct.jsxs)(Ue,{className:"sm:max-w-md",children:[(0,ct.jsx)(Ge,{children:(0,ct.jsx)($e,{children:"Add New Task"})}),(0,ct.jsxs)("form",{onSubmit:p,className:"space-y-4",children:[(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{htmlFor:"name",children:"Task Title"}),(0,ct.jsx)(Z,{id:"name",value:n.name,onChange:g=>d("name",g.target.value),placeholder:"Enter task title",required:!0})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{htmlFor:"description",children:"Description"}),(0,ct.jsx)(Ee,{id:"description",value:n.description,onChange:g=>d("description",g.target.value),placeholder:"Enter task description",rows:3})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{children:"Type"}),(0,ct.jsx)(At,{type:"single",value:n.type||"",onValueChange:g=>g&&d("type",g),children:fi.map(g=>{let T=g.icon;return(0,ct.jsxs)(Mt,{value:g.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,ct.jsx)(T,{className:"h-4 w-4"}),g.label]},g.value)})})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{children:"Priority"}),(0,ct.jsx)(At,{type:"single",value:n.priority||"",onValueChange:g=>g&&d("priority",g),children:vi.map(g=>(0,ct.jsx)(Mt,{value:g.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:g.label},g.value))})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{htmlFor:"points",children:"Story Points"}),(0,ct.jsx)(Z,{id:"points",type:"number",min:"1",max:"100",value:n.storyPoints,onChange:g=>d("storyPoints",parseInt(g.target.value)||1),placeholder:"Enter story points",required:!0})]}),!c&&(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{htmlFor:"epic",children:"Epic"}),(0,ct.jsxs)(ze,{value:n.epic,onValueChange:g=>d("epic",g),children:[(0,ct.jsx)(Fe,{children:(0,ct.jsx)(ot,{placeholder:"Select an epic"})}),(0,ct.jsx)(Le,{children:o.map(g=>(0,ct.jsx)(ne,{value:g.id.toString(),children:(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsx)("div",{className:`w-3 h-3 rounded-full ${g.color}`}),g.name]})},g.id))})]})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,ct.jsxs)(ze,{value:n.sprint,onValueChange:g=>d("sprint",g),children:[(0,ct.jsx)(Fe,{children:(0,ct.jsx)(ot,{placeholder:"Select a sprint"})}),(0,ct.jsxs)(Le,{children:[(0,ct.jsx)(ne,{value:"none",children:"No Sprint"}),r.map(g=>(0,ct.jsx)(ne,{value:g.id.toString(),children:(0,ct.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{htmlFor:"sprint",children:"Assignee"}),(0,ct.jsxs)(ze,{value:n.assignee,onValueChange:g=>d("assignee",g),children:[(0,ct.jsx)(Fe,{children:(0,ct.jsx)(ot,{placeholder:"Select an Assignee"})}),(0,ct.jsxs)(Le,{children:[(0,ct.jsx)(ne,{value:"none",children:"No Assignee"}),s.map(g=>(0,ct.jsx)(ne,{value:g.id.toString(),children:(0,ct.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,ct.jsxs)(Zt,{children:[(0,ct.jsx)(N,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,ct.jsx)(N,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var ka=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:r,className:s="",disabled:c=!1})=>{let[n,u]=(0,oe.useState)(!1),[p,d]=(0,oe.useState)(""),g=()=>{c||(u(!0),d(t))},T=async()=>{p!==t&&await r(e,p),u(!1)},C=b=>{b.key==="Enter"&&!o||b.key==="Enter"&&b.ctrlKey&&o?T():b.key==="Escape"&&(u(!1),d(""))};return(0,ct.jsxs)("div",{className:`space-y-2 ${s}`,children:[(0,ct.jsx)(R,{children:a}),n?o?(0,ct.jsx)(Ee,{value:p,onChange:b=>d(b.target.value),onBlur:T,onKeyDown:C,autoFocus:!0,rows:4,className:"resize-none"}):(0,ct.jsx)(Z,{value:p,onChange:b=>d(b.target.value),onBlur:T,onKeyPress:C,autoFocus:!0,className:"text-lg font-medium"}):(0,ct.jsxs)("div",{onClick:g,className:`${c?"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,ct.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click ct edit..."}),!c&&(0,ct.jsx)(mt.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var ra=ue(require("react")),gt=ue(require("@radix-ui/react-avatar"));var Sa=ra.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(gt.Root,{ref:a,className:y("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Sa.displayName=gt.Root.displayName;var bi=ra.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(gt.Image,{ref:a,className:y("aspect-square h-full w-full",e),...t}));bi.displayName=gt.Image.displayName;var Da=ra.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(gt.Fallback,{ref:a,className:y("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Da.displayName=gt.Fallback.displayName;var So=({comments:e,onAddComment:t})=>{let[a,o]=(0,oe.useState)(""),r=c=>c.split(" ").map(n=>n[0]).join("").toUpperCase(),s=()=>{a.trim()&&(t(a),o(""))};return(0,ct.jsxs)("div",{className:"space-y-4",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsx)(mt.MessageSquare,{className:"h-5 w-5"}),(0,ct.jsx)(R,{className:"text-lg font-medium",children:"Comments"}),(0,ct.jsx)(le,{variant:"secondary",children:e.length})]}),(0,ct.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(c=>(0,ct.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,ct.jsx)(Sa,{className:"h-8 w-8 mt-1",children:(0,ct.jsx)(Da,{className:"text-xs bg-muted text-muted-foreground",children:r(c.author)})}),(0,ct.jsxs)("div",{className:"flex-1",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,ct.jsx)("span",{className:"font-medium text-sm",children:c.author}),(0,ct.jsxs)("span",{className:"text-xs text-muted-foreground",children:[c.createdAt.toLocaleDateString()," at ",c.createdAt.toLocaleTimeString()]})]}),(0,ct.jsx)("p",{className:"text-sm text-muted-foreground",children:c.text})]})]},c.id))}),(0,ct.jsxs)("div",{className:"flex gap-2",children:[(0,ct.jsx)(Ee,{value:a,onChange:c=>o(c.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,ct.jsx)(N,{onClick:s,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,ct.jsx)(mt.Send,{className:"h-4 w-4"})})]})]})};var sa=({label:e,value:t,onValueChange:a,options:o,showColor:r=!1,disabled:s=!1})=>{let[c,n]=(0,oe.useState)(!1),u=o.find(d=>d.value===t);return(0,ct.jsxs)("div",{className:"space-y-1",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:e}),(0,ct.jsxs)(ze,{value:t,onValueChange:a,open:c,onOpenChange:d=>{s||n(d)},disabled:s,children:[(0,ct.jsx)(Fe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,ct.jsxs)(le,{variant:"secondary",className:`${s?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!s&&n(!c),children:[r&&u?.color&&(0,ct.jsx)("div",{className:`w-2 h-2 rounded-full ${u.color} mr-1`}),u?.label||"Select..."]})}),(0,ct.jsx)(Le,{children:o.map(d=>(0,ct.jsx)(ne,{value:d.value,children:r&&d.color?(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var To=({label:e,value:t,onValueChange:a,options:o,placeholder:r="Search...",allowCustomValue:s=!1,disabled:c=!1})=>{let[n,u]=(0,oe.useState)(!1),[p,d]=(0,oe.useState)(""),g=o.find(v=>v.value===t),T=o.filter(v=>v.label.toLowerCase().includes(p.toLowerCase())),C=v=>{a(v),u(!1),d("")},b=()=>{s&&p.trim()&&!o.find(v=>v.value===p.trim())&&(a(p.trim()),u(!1),d(""))};return(0,ct.jsxs)("div",{className:"space-y-1",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:e}),(0,ct.jsxs)(ze,{value:t,onValueChange:C,open:n,onOpenChange:v=>{c||u(v)},disabled:c,children:[(0,ct.jsx)(Fe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,ct.jsx)(le,{variant:"secondary",className:`${c?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!c&&u(!n),children:g?.label||t||"Select..."})}),(0,ct.jsxs)(Le,{children:[(0,ct.jsx)("div",{className:"p-2",children:(0,ct.jsx)(Z,{placeholder:r,value:p,onChange:v=>d(v.target.value),onKeyDown:v=>{v.key==="Enter"&&s&&b()},className:"mb-2"})}),T.map(v=>(0,ct.jsx)(ne,{value:v.value,children:v.label},v.value)),s&&p.trim()&&!T.find(v=>v.value===p.trim())&&(0,ct.jsxs)(ne,{value:p.trim(),children:['Add "',p.trim(),'"']})]})]})]})};var fe=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var hi=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:mt.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:mt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:mt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:mt.Zap}],xi=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}];var Po=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:r,onClose:s,onDelete:c,isUpdating:n=!1,isDeleting:u=!1,deleteState:p="idle",teamMembers:d})=>{let[g,T]=(0,oe.useState)(e.storyPoints),C=(0,oe.useRef)(null),[b,I]=(0,oe.useState)(d);(0,oe.useEffect)(()=>{I(d)},[d]);let v=(0,oe.useCallback)((w,F)=>{C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{r(w,F)},500)},[r]);(0,oe.useEffect)(()=>{v("storyPoints",g?.toString()||"1")},[g]);let V=w=>w.split(" ").map(F=>F[0]).join("").toUpperCase(),W=()=>p==="loading"?(0,ct.jsxs)(N,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,ct.jsx)(mt.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):p==="success"?(0,ct.jsxs)(N,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,ct.jsx)(mt.Check,{className:"h-3 w-3"}),"Deleted"]}):p==="error"?(0,ct.jsxs)(N,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,ct.jsx)(mt.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,ct.jsxs)(N,{onClick:c,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:n||u,children:[(0,ct.jsx)(mt.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,ct.jsxs)("div",{className:"flex flex-col h-full",children:[(0,ct.jsxs)("div",{className:"space-y-4",style:{opacity:n?.6:1},children:[(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:"Status"}),(0,ct.jsx)(sa,{label:"",value:e.status,onValueChange:w=>r("status",w),options:[{value:"todo",label:"To oe"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:n})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:"Type"}),(0,ct.jsx)(At,{type:"single",value:e.type||"",onValueChange:w=>w&&r("type",w),className:"grid grid-cols-2 gap-1",disabled:n,children:hi.map(w=>{let F=w.icon;return(0,ct.jsxs)(Mt,{value:w.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:n,children:[(0,ct.jsx)(F,{className:"h-3 w-3"}),w.label]},w.value)})})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,ct.jsx)(At,{type:"single",value:e.priority||"",onValueChange:w=>w&&r("priority",w),className:"grid grid-cols-3 gap-1",disabled:n,children:xi.map(w=>(0,ct.jsx)(Mt,{value:w.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:n,children:w.label},w.value))})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,ct.jsx)("input",{type:"number",min:"1",max:"100",value:g||1,onChange:w=>{let F=Number(w.target.value);F<1?T(1):F>100?T(100):T(F)},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:n})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,ct.jsx)(sa,{label:"",value:fe(e.epic).toString(),onValueChange:w=>r("epic",w),options:(t||[]).map(w=>({value:w.id.toString(),label:w?.name,color:w.color})),showColor:!0,disabled:n})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,ct.jsx)(sa,{label:"",value:fe(e.sprint).toString()||"none",onValueChange:w=>r("sprint",w==="none"?"":w),options:[{value:"none",label:"No Sprint"},...(a||[]).map(w=>({value:w.id.toString(),label:`${w?.name}`}))],disabled:n})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,ct.jsx)(To,{label:"",value:e.assignee?.value?.name,onValueChange:w=>r("assignee",w),options:b.map(w=>({value:`${typeof w.email=="string"?"users":"digital-colleagues"}:${w.id}`,label:w?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:n})]})]}),(0,ct.jsxs)("div",{className:"mt-auto pt-4 space-y-4",children:[(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(N,{onClick:s,variant:"outline",className:"w-full h-8 text-xs",disabled:n||u,children:"Close"}),W()]}),(0,ct.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,ct.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,ct.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,ct.jsx)(mt.User,{className:"h-3 w-3"}),(0,ct.jsx)("span",{children:"System"})]})]}),(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,ct.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,ct.jsx)(mt.Calendar,{className:"h-3 w-3"}),(0,ct.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,ct.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,ct.jsx)(mt.Clock,{className:"h-3 w-3"}),(0,ct.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var Ro=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:r,onUpdateTask:s,onDeleteTask:c,onAddComment:n,colleagues:u})=>{let[p,d]=(0,oe.useState)(a),[g,T]=(0,oe.useState)(new Date),[C,b]=(0,oe.useState)("idle"),[I,v]=(0,oe.useState)("idle"),[V,W]=(0,oe.useState)([]),[w,F]=(0,oe.useState)(u);(0,oe.useEffect)(()=>{d(a)},[a]);let se=async(E,we)=>{if(we!==p[E]){b("loading");try{let ee=await s(p.id.toString(),{[E]:we});d(ee),T(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(ee){console.log("error",ee),b("error"),setTimeout(()=>b("idle"),3e3)}}},k=async(E,we)=>{if(we!==p[E]){b("loading");try{let ee=await s(p.id.toString(),{[E]:we});d(ee),T(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(ee){console.log("error",ee),b("error"),setTimeout(()=>b("idle"),3e3)}}},_=async E=>{if(n){b("loading");try{let we=await n?.({content:E,taskId:p.id.toString()});d(we),T(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch{b("error"),setTimeout(()=>b("idle"),3e3)}}},te=async()=>{v("loading");try{await c(p.id.toString()),v("success"),setTimeout(()=>{t(),v("idle")},1e3)}catch{v("error"),setTimeout(()=>v("idle"),3e3)}},O=C!=="loading"&&I!=="loading",be=()=>{O&&t()},Me=()=>C==="loading"?(0,ct.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,ct.jsx)(mt.Loader2,{className:"h-4 w-4 animate-spin"}),(0,ct.jsx)("span",{children:"Updating..."})]}):C==="success"?(0,ct.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,ct.jsx)(mt.Check,{className:"h-4 w-4"}),(0,ct.jsx)("span",{children:"Updated successfully"})]}):C==="error"?(0,ct.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,ct.jsx)(mt.X,{className:"h-4 w-4"}),(0,ct.jsx)("span",{children:"Update failed"})]}):null;return(0,ct.jsx)(Ke,{open:e,onOpenChange:be,children:(0,ct.jsxs)(Ue,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,ct.jsxs)(Ge,{children:[(0,ct.jsx)($e,{className:"sr-only",children:p.name}),(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsx)("div",{className:"flex-1",children:Me()}),!O&&(0,ct.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,ct.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,ct.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,ct.jsx)(ka,{fieldName:"name",value:p.name||"",label:"",onSave:se,className:"border-b border-border pb-3",disabled:C==="loading"}),(0,ct.jsx)(ka,{fieldName:"description",value:p.description||"",label:"Description",multiline:!0,onSave:se,disabled:C==="loading"}),(0,ct.jsx)(So,{comments:(p?.comments||[]).map(E=>({author:E.author.value.name||"",createdAt:new Date(E.timestamp),text:E.text,id:E.id||""})),onAddComment:_})]}),(0,ct.jsx)(Po,{task:p,epics:o,sprints:r,lastUpdated:g,onUpdateTask:k,onClose:be,onDelete:te,isUpdating:C==="loading",isDeleting:I==="loading",deleteState:I,teamMembers:w})]})]})})};var Ut=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,r]=(0,oe.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}),s=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],c=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],n=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],u=d=>{d.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:o.startDate,endDate:o.endDate}),r({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},p=(d,g)=>{r(T=>({...T,[d]:g}))};return(0,ct.jsx)(Ke,{open:e,onOpenChange:t,children:(0,ct.jsxs)(Ue,{className:"sm:max-w-md",children:[(0,ct.jsx)(Ge,{children:(0,ct.jsx)($e,{children:"Add New Epic"})}),(0,ct.jsxs)("form",{onSubmit:u,className:"space-y-4",children:[(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{htmlFor:"name",children:"Epic Name"}),(0,ct.jsx)(Z,{id:"name",value:o.name,onChange:d=>p("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{htmlFor:"description",children:"Description"}),(0,ct.jsx)(Ee,{id:"description",value:o.description,onChange:d=>p("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{children:"Color"}),(0,ct.jsx)("div",{className:"flex gap-2 flex-wrap",children:s.map(d=>(0,ct.jsx)("button",{type:"button",onClick:()=>p("color",d),className:`w-8 h-8 rounded-full ${d} ${o.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,ct.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{children:"Confidence"}),(0,ct.jsxs)(ze,{value:o.confidence,onValueChange:d=>p("confidence",d),children:[(0,ct.jsx)(Fe,{children:(0,ct.jsx)(ot,{})}),(0,ct.jsx)(Le,{children:c.map(d=>(0,ct.jsx)(ne,{value:d.value,children:d.label},d.value))})]})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{children:"Phase"}),(0,ct.jsxs)(ze,{value:o.phase.toString(),onValueChange:d=>p("phase",parseInt(d)),children:[(0,ct.jsx)(Fe,{children:(0,ct.jsx)(ot,{})}),(0,ct.jsx)(Le,{children:n.map(d=>(0,ct.jsx)(ne,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,ct.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{children:"Start Date"}),(0,ct.jsx)(Z,{type:"date",value:o.startDate,onChange:d=>p("startDate",d.target.value)})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)(R,{children:"End Date"}),(0,ct.jsx)(Z,{type:"date",value:o.endDate,onChange:d=>p("endDate",d.target.value)})]})]}),(0,ct.jsxs)(Zt,{children:[(0,ct.jsx)(N,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,ct.jsx)(N,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Mo=require("motion/react");function Ao(e,t){let[a,o]=(0,oe.useState)(()=>{if(typeof window>"u")return t;try{let s=window.localStorage.getItem(e);return s?JSON.parse(s):t}catch{return t}}),r=s=>{try{o(s),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(s))}catch{}};return(0,oe.useEffect)(()=>{r(a)},[]),[a,r]}var da=require("react-icons/fa");function nt({title:e,description:t,badge:a,primaryAction:o,secondaryAction:r,gradient:s,children:c,className:n}){let[u,p]=Ao(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),d=!r&&!t||u;return(0,ct.jsxs)(Mo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${s} p-8 text-white ${n||""}`,children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,ct.jsx)(le,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,ct.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,ct.jsxs)("div",{className:"flex items-center gap-3",children:[d&&o&&(0,ct.jsx)(N,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(r||t)&&(0,ct.jsx)("button",{"aria-label":u?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>p(!u),style:{lineHeight:0},children:u?(0,ct.jsx)(da.FaChevronDown,{size:22}):(0,ct.jsx)(da.FaChevronUp,{size:22})})]})]}),!d&&(0,ct.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,ct.jsxs)("div",{className:"space-y-4",children:[(0,ct.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,ct.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,ct.jsx)(N,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),r&&(0,ct.jsx)(N,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),c&&(0,ct.jsx)("div",{className:"hidden lg:block",children:c})]})]})}var Io=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:r=[],initialProjects:s=[],onAddTask:c,onUpdateTask:n,onDeleteTask:u,onTaskClick:p,onAddEpic:d,onAddComment:g})=>{let[T,C]=(0,oe.useState)(e),[b,I]=(0,oe.useState)(t),[v,V]=(0,oe.useState)(a),[W,w]=(0,oe.useState)(!1),[F,se]=(0,oe.useState)(!1),[k,_]=(0,oe.useState)(null),[te,O]=(0,oe.useState)(null),[be,Me]=(0,oe.useState)(o),[E,we]=(0,oe.useState)(r),[ee,et]=(0,oe.useState)(0),he=(0,oe.useRef)(null),lt=(0,oe.useRef)(null),tt=b.filter(M=>!0).map(M=>M.id),rt=v.find(M=>M.isSelected);tt.push(0),(0,oe.useEffect)(()=>{C(e)},[e]),(0,oe.useEffect)(()=>{I(t)},[t]),(0,oe.useEffect)(()=>{V(a)},[a]),(0,oe.useEffect)(()=>{we(r)},[r]),(0,oe.useEffect)(()=>{let M=()=>{if(he.current){let Te=he.current.offsetHeight;et(Te)}};M();let X=new ResizeObserver(M);he.current&&X.observe(he.current);let Q=()=>{setTimeout(M,100)};return window.addEventListener("storage",Q),()=>{X.disconnect(),window.removeEventListener("storage",Q)}},[]),(0,oe.useEffect)(()=>{let M=setTimeout(()=>{he.current&&et(he.current.offsetHeight)},300);return()=>clearTimeout(M)},[W,F]);let at=T.filter(M=>!0),h=M=>at.filter(X=>X.status===M),K=M=>{let X={};return b.forEach(Q=>{X[Q.id]=M.filter(Te=>fe(Te.epic)===Q.id)}),X["eo-epic"]=M.filter(Q=>!fe(Q.epic)),X},me=M=>{O(M)},qe=M=>{te&&(C(X=>X.map(Q=>Q.id===te.id?{...Q,status:M}:Q)),n?.(te.id.toString(),{status:M}),O(null))},Y=M=>{let X={...M,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};C(Q=>[...Q,X]),c?.(M)},We=async(M,X)=>{if(C(Te=>Te.map(Ie=>Ie.id===Number(M)?{...Ie,...X}:Ie)),n)return await n(M,X);let Q=T.find(Te=>Te.id===Number(M));if(!Q)throw new Error("Task not found");return{...Q,...X}},$t=async M=>{C(X=>X.filter(Q=>Q.id!==Number(M))),k?.id===Number(M)&&_(null),u&&await u(M)},dt=M=>{let X={...M,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};I(Q=>[...Q,X]),d?.(M)},Ft=M=>{_(M),p?.(M)},bt=[{id:"todo",title:"To oe",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],kt=ee>0?`calc(100vh - ${ee+120}px)`:"calc(100vh - 12rem)";return(0,ct.jsxs)("div",{ref:lt,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,ct.jsx)("div",{ref:he,className:"flex-shrink-0",children:(0,ct.jsx)(nt,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-ct-r from-purple-600 via-violet-600 ct-indigo-600",primaryAction:{label:"Add task",onClick:()=>w(!0)},secondaryAction:{label:"Add epic",onClick:()=>se(!0)}})}),(0,ct.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,ct.jsx)("div",{className:"h-full",style:{height:ee>0?`calc(100vh - ${ee+120}px)`:"calc(100vh - 12rem)"},children:(0,ct.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:bt.map(M=>{let X=h(M.status),Q=K(X);return(0,ct.jsxs)(ao,{title:M.title,status:M.status,taskCount:X.length,onDrop:qe,isCompact:M.status==="done",height:kt,children:[Q["eo-epic"].map(Te=>(0,ct.jsx)(Jt,{epic:null,task:Te,onDragStart:me,onTaskClick:Ft,isCompact:M.status==="done"})),tt.map(Te=>{let Ie=b.find(x=>x.id===Te),m=Q[Te]||[];return m.length===0?null:(0,ct.jsxs)("div",{className:"mb-6",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,ct.jsx)("div",{className:`w-3 h-3 rounded-full ${Ie?.color}`}),(0,ct.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Ie?.name||"No Epic"}),(0,ct.jsx)(le,{variant:"secondary",className:"text-xs",children:m.length})]})," ",(0,ct.jsx)("div",{className:"space-y-3",children:m.map(x=>(0,ct.jsx)(Jt,{task:x,epic:Ie,onDragStart:me,onTaskClick:Ft,isCompact:M.status==="done"},x.id))})]},Te)})]},M.id)})})})}),(0,ct.jsx)(Vt,{isOpen:W,onClose:()=>w(!1),onAddTask:Y,assignees:[...E,...be],epics:b,sprints:v}),(0,ct.jsx)(Ut,{isOpen:F,onClose:()=>se(!1),onAddEpic:dt}),k&&(0,ct.jsx)(Ro,{isOpen:!!k,onClose:()=>_(null),initialTask:k,epics:b,sprints:v,onUpdateTask:We,onDeleteTask:$t,colleagues:E,onAddComment:g})]})};var Fo=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddTaskToEpic:s,onAddEpic:c,onUpdateEpic:n,onDeleteEpic:u})=>{let[p,d]=(0,oe.useState)(t),[g,T]=(0,oe.useState)(null),[C,b]=(0,oe.useState)(null),[I,v]=(0,oe.useState)({}),[V,W]=(0,oe.useState)(0),[w,F]=(0,oe.useState)(!1),[se,k]=(0,oe.useState)(!1),[_,te]=(0,oe.useState)(null),O=(0,oe.useRef)(null),be=(0,oe.useRef)(null);(0,oe.useEffect)(()=>{d(t)},[t]),(0,oe.useEffect)(()=>{let h=()=>{if(O.current){let qe=O.current.offsetHeight;W(qe)}};h();let K=new ResizeObserver(h);O.current&&K.observe(O.current);let me=()=>{setTimeout(h,100)};return window.addEventListener("storage",me),()=>{K.disconnect(),window.removeEventListener("storage",me)}},[]),(0,oe.useEffect)(()=>{let h=setTimeout(()=>{O.current&&W(O.current.offsetHeight)},300);return()=>clearTimeout(h)},[C]);let Me=h=>{T(h)},E=h=>{h.preventDefault()},we=(h,K)=>{h.preventDefault(),g&&fe(g.epic).toString()!==K&&(o(g.id.toString(),{epic:Number(K)}),T(null))},ee=h=>e.filter(K=>fe(K.epic).toString()===h),et=h=>{b(h.id.toString()),v({name:h.name,description:h.description,confidence:h.confidence,phase:h.phase})},he=async()=>{C&&I.name&&(await n(C.toString(),I),d(h=>h.map(K=>K.id.toString()===C?{...K,...I}:K)),b(null),v({}))},lt=()=>{b(null),v({})},tt=async h=>{window.confirm("Are you sure you want ct delete this epic? This will also delete all associated tasks.")&&(await u(h),d(K=>K.filter(me=>me.id.toString()!==h)))},rt=h=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[h]||`Phase ${h}`,at=h=>{switch(h){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,ct.jsxs)(ct.Fragment,{children:[(0,ct.jsxs)("div",{ref:be,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,ct.jsx)("div",{ref:O,className:"flex-shrink-0",children:(0,ct.jsx)(nt,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-ct-r from-rose-600 via-pink-600 ct-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>F(!0)}})}),(0,ct.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,ct.jsx)("div",{className:"h-full overflow-y-auto",style:{height:V>0?`calc(100vh - ${V+120}px)`:"calc(100vh - 12rem)"},children:(0,ct.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:p.map(h=>{let K=ee(h.id.toString()),me=K.reduce((Y,We)=>Y+(We.storyPoints||0),0),qe=V>0?`calc(100vh - ${V+200}px)`:"calc(100vh - 14rem)";return(0,ct.jsxs)(ie,{className:`flex flex-col ${C===h.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:C===h.id.toString()?"auto":qe,minHeight:"400px"},onDragOver:E,onDrop:Y=>we(Y,h.id.toString()),children:[(0,ct.jsx)("div",{className:"p-4 border-b border-border",children:C===h.id.toString()?(0,ct.jsxs)("div",{className:"space-y-4",children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsx)(Z,{value:I.name||"",onChange:Y=>v({...I,name:Y.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,ct.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,ct.jsx)(N,{size:"sm",variant:"ghost",onClick:he,className:"p-1 h-8 w-8",children:(0,ct.jsx)(mt.Check,{className:"h-4 w-4"})}),(0,ct.jsx)(N,{size:"sm",variant:"ghost",onClick:lt,className:"p-1 h-8 w-8",children:(0,ct.jsx)(mt.X,{className:"h-4 w-4"})})]})]}),(0,ct.jsx)(Ee,{value:I.description||"",onChange:Y=>v({...I,description:Y.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,ct.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,ct.jsxs)("div",{children:[(0,ct.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,ct.jsxs)("select",{value:I.confidence||h.confidence,onChange:Y=>v({...I,confidence:Y.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,ct.jsx)("option",{value:"low",children:"Low"}),(0,ct.jsx)("option",{value:"medium",children:"Medium"}),(0,ct.jsx)("option",{value:"high",children:"High"})]})]}),(0,ct.jsxs)("div",{children:[(0,ct.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,ct.jsx)("select",{value:I.phase?.toString()||h.phase.toString(),onChange:Y=>v({...I,phase:parseInt(Y.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(Y=>(0,ct.jsxs)("option",{value:Y.toString(),children:["Phase ",Y]},Y))})]})]})]}):(0,ct.jsxs)(ct.Fragment,{children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,ct.jsx)("div",{className:`w-4 h-4 rounded-full ${h.color}`}),(0,ct.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:h.name}),(0,ct.jsxs)("div",{className:"flex gap-1",children:[(0,ct.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>et(h),className:"p-1 h-8 w-8",children:(0,ct.jsx)(mt.Edit2,{className:"h-3 w-3"})}),(0,ct.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>tt(h.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,ct.jsx)(mt.Trash2,{className:"h-3 w-3"})})]})]}),(0,ct.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,ct.jsxs)(le,{className:`text-xs ${at(h.confidence)}`,children:[h.confidence," confidence"]}),(0,ct.jsxs)(le,{variant:"outline",className:"text-xs",children:["Phase ",h.phase]}),(0,ct.jsxs)(le,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[K.length," tasks"]}),(0,ct.jsxs)(le,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[me," pts"]})]}),h.description&&(0,ct.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:h.description}),(0,ct.jsxs)(N,{onClick:()=>{k(!0),te(h)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,ct.jsx)(mt.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,ct.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,ct.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${g?"border-primary bg-primary/10":"border-border"}`,children:K.length===0?(0,ct.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,ct.jsx)(mt.Move,{className:"h-8 w-8 mb-2"}),(0,ct.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):K.map(Y=>(0,ct.jsx)(Jt,{task:Y,epic:h,onDragStart:Me,onTaskClick:r,isCompact:!0},Y.id))})})]},h.id)})})})})]}),(0,ct.jsx)(Ut,{isOpen:w,onClose:()=>F(!1),onAddEpic:c}),(0,ct.jsx)(Vt,{isOpen:se,onClose:()=>k(!1),onAddTask:s,assignees:[],epics:[],defaultEpicId:_?.id.toString()||"",sprints:a})]})};var Lo=require("react-day-picker");function ca({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,ct.jsx)(Lo.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:y("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 pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:y(aa({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:y("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-ct-md first:[&:has([aria-selected])]:rounded-ct-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:y(aa({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})}ca.displayName="Calendar";var Oo=ue(require("react")),st=ue(require("@radix-ui/react-popover"));var Ra=st.Root,Ea=st.Trigger;var ma=Oo.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},r)=>(0,ct.jsx)(st.Portal,{children:(0,ct.jsx)(st.Content,{ref:r,align:t,sideOffset:a,className:y("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})}));ma.displayName=st.Content.displayName;var Ma=require("date-fns");var Vo=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,r]=(0,oe.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),s=n=>{n.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),r({name:"",description:"",startDate:void 0,endDate:void 0}),t())},c=()=>{r({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,$.jsx)(Ke,{open:e,onOpenChange:c,children:(0,$.jsxs)(Ue,{className:"sm:max-w-md",children:[(0,$.jsx)(Ge,{children:(0,$.jsx)($e,{children:"Add New Sprint"})}),(0,$.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{htmlFor:"name",children:"Sprint Name *"}),(0,$.jsx)(Z,{id:"name",value:o.name,onChange:n=>r(u=>({...u,name:n.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{htmlFor:"description",children:"Description"}),(0,$.jsx)(Ee,{id:"description",value:o.description,onChange:n=>r(u=>({...u,description:n.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,$.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{children:"Start Date *"}),(0,$.jsxs)(Ra,{children:[(0,$.jsx)(Ea,{asChild:!0,children:(0,$.jsxs)(N,{variant:"outline",className:y("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,$.jsx)(mt.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,Ma.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,$.jsx)(ma,{className:"w-auto p-0",align:"start",children:(0,$.jsx)(ca,{mode:"single",selected:o.startDate,onSelect:n=>r(u=>({...u,startDate:n})),initialFocus:!0})})]})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{children:"End Date *"}),(0,$.jsxs)(Ra,{children:[(0,$.jsx)(Ea,{asChild:!0,children:(0,$.jsxs)(N,{variant:"outline",className:y("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,$.jsx)(mt.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,Ma.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,$.jsx)(ma,{className:"w-auto p-0",align:"start",children:(0,$.jsx)(ca,{mode:"single",selected:o.endDate,onSelect:n=>r(u=>({...u,endDate:n})),initialFocus:!0,disabled:n=>o.startDate?n<o.startDate:!1})})]})]})]}),(0,$.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,$.jsx)(N,{type:"button",variant:"outline",onClick:c,children:"Cancel"}),(0,$.jsx)(N,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Ho=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddSprint:s,onUpdateSprint:c,onDeleteSprint:n})=>{let[u,p]=(0,oe.useState)([]),[d,g]=(0,oe.useState)(new Set),[T,C]=(0,oe.useState)(null),[b,I]=(0,oe.useState)(!1),[v,V]=(0,oe.useState)(null),[W,w]=(0,oe.useState)(null),[F,se]=(0,oe.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[k,_]=(0,oe.useState)([]),[te,O]=(0,oe.useState)("upcoming"),[be,Me]=(0,oe.useState)(!1),[E,we]=(0,oe.useState)(0),ee=(0,oe.useRef)(null),et=(0,oe.useRef)(null);(0,oe.useEffect)(()=>{let m=()=>{ee.current&&we(ee.current.offsetHeight)};m();let x=new ResizeObserver(m);return ee.current&&x.observe(ee.current),()=>x.disconnect()},[]);let he=m=>t.find(x=>x.id===Number(m)),lt=m=>a.find(x=>x.id===Number(m)),tt=m=>{let x={high:"bg-red-100 text-red-800 border-red-200",medium:"bg-orange-100 text-orange-800 border-orange-200",low:"bg-green-100 text-green-800 border-green-200"};return x[m]||x.medium},rt=m=>{if(!m||m?.length===0)return"";let x=m?.trim().split(" ");if(x?.length===1)return x[0];let G=x[0],q=x[x.length-1][0].toUpperCase();return`${G} ${q}`},at=m=>{let x={},G=[];return m.forEach(q=>{q.epic?(x[fe(q.epic)]||(x[fe(q.epic)]=[]),x[fe(q.epic)].push(q)):G.push(q)}),{tasksByEpic:x,unassignedTasks:G}};(0,oe.useEffect)(()=>{_(a)},[a]);let h=k.filter(m=>{switch(te){default:return!0}}),K=k.filter(m=>u.includes(m.id.toString())),me=e.filter(m=>!m.sprint||m.status==="backlog"),qe=me.reduce((m,x)=>m+(x.storyPoints||0),0),Y=m=>{p(x=>x.includes(m)?x.filter(G=>G!==m):x?.length<3?[...x,m]:x)},We=m=>{g(x=>{let G=new Set(x);return G.has(m)?G.delete(m):G.add(m),G})},$t=m=>{s(m),I(!1)},dt=m=>{w(m.id.toString()),se({name:m.name,description:m.description||"",startDate:m.startDate?new Date(m.startDate).toISOString().split("T")[0]:m.startDate,endDate:m.endDate?new Date(m.endDate).toISOString().split("T")[0]:m.endDate,isActive:!1})},Ft=()=>{W&&(c(W,{name:F.name,description:F.description,startDate:F.startDate,endDate:F.endDate}),_(m=>m.map(x=>(x.id===Number(W)&&(x.name=F.name,x.description=F.description,x.startDate=F.startDate,x.endDate=F.endDate),x))),w(null))},bt=()=>{w(null),se({name:"",description:"",startDate:"",endDate:"",isActive:!1})},kt=(m,x)=>{C(x),m.dataTransfer.effectAllowed="move"},M=m=>{m.preventDefault(),m.dataTransfer.dropEffect="move"},X=m=>{V(m)},Q=()=>{V(null)},Te=(m,x)=>{if(m.preventDefault(),V(null),!T)return;(fe(T.sprint)||void 0)!==Number(x)&&o(T.id.toString(),{sprint:Number(x)}),C(null)},Ie=({task:m,showSprint:x=!1})=>{let G=m.epic?he(fe(m.epic).toString()):null,q=m.sprint?lt(fe(m.sprint).toString()):null;return(0,ct.jsx)(ie,{className:"p-3 cursor-grab active:cursor-grabbing hover:shadow-md transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:Oe=>{Oe.dataTransfer.effectAllowed="move",Oe.dataTransfer.setData("text/plain",m.id.toString()),kt(Oe,m)},onClick:Oe=>{T===null&&r(m)},style:{userSelect:"none"},children:(0,ct.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,ct.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,ct.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:m.name}),(0,ct.jsx)(le,{className:`text-xs ${tt(m.priority||"medium")}`,children:m.priority?.[0]?.toUpperCase()})]}),(0,ct.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-1",children:[G&&(0,ct.jsx)("div",{className:`w-2 h-2 rounded-full ${G.color}`}),(0,ct.jsx)("span",{className:"text-muted-foreground truncate",children:G?.name})]}),(0,ct.jsx)("span",{className:"text-muted-foreground",children:rt(m.assignee?.value?.name)})]}),x&&q&&(0,ct.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,ct.jsx)(mt.Calendar,{className:"h-3 w-3"}),(0,ct.jsx)("span",{children:q.name})]})]})})};return(0,ct.jsxs)("div",{ref:et,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,ct.jsx)("div",{ref:ee,className:"flex-shrink-0",children:(0,ct.jsx)(nt,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-ct-r from-orange-600 via-amber-600 ct-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>I(!0)}})}),(0,ct.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,ct.jsxs)("div",{className:"h-full",style:{height:E>0?`calc(100vh - ${E+120}px)`:"calc(100vh - 12rem)"},children:[(0,ct.jsxs)("div",{className:"mb-4",children:[(0,ct.jsx)(ie,{className:"p-3 bg-card shadow-sm",children:(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ct.jsxs)("div",{children:[(0,ct.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,ct.jsxs)("p",{className:"text-xs text-muted-foreground",children:[u?.length,"/3 selected"]})]}),u?.length>0&&(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,ct.jsx)("div",{className:"flex flex-wrap gap-1",children:K.map(m=>(0,ct.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,ct.jsx)("span",{className:"max-w-[80px] truncate",children:m.name}),(0,ct.jsx)("button",{onClick:()=>Y(m.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,ct.jsx)(mt.X,{className:"h-4 w-4"})})]},m.id))})]})]}),(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsxs)(N,{onClick:()=>I(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,ct.jsx)(mt.Plus,{className:"h-3 w-3"}),"Add"]}),(0,ct.jsxs)(N,{onClick:()=>Me(!be),variant:"outline",size:"sm",className:"gap-1",children:[(0,ct.jsx)(mt.Calendar,{className:"h-3 w-3"}),be?"Close":"Select"]})]})]})}),be&&(0,ct.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>Me(!1)}),(0,ct.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-ct shadow-xl z-10 transition-all duration-300 ease-in-out ${be?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,ct.jsxs)(ie,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,ct.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,ct.jsx)(N,{variant:"ghost",size:"sm",onClick:()=>Me(!1),className:"h-8 w-8 p-0",children:(0,ct.jsx)(mt.X,{className:"h-4 w-4"})})]}),(0,ct.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose up ct 3 sprints ct view in your planning board"})]}),(0,ct.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,ct.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(m=>(0,ct.jsxs)(N,{variant:te===m.key?"default":"outline",size:"sm",onClick:()=>O(m.key),className:"text-xs h-8 px-3 flex-1",children:[m.label," (",m.count,")"]},m.key))}),(0,ct.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:h.length>0?h.map(m=>{let x=u.includes(m.id.toString()),G=e.filter(Pe=>fe(Pe.sprint)===m.id).length,q=!x&&u.length<3;return(0,ct.jsx)("div",{className:`p-3 rounded-lg border transition-all ${x?"bg-primary/10 border-primary/30":q?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:W===m.id.toString()?(0,ct.jsxs)("div",{className:"space-y-3",children:[(0,ct.jsx)(Z,{value:F.name,onChange:Pe=>se(Re=>({...Re,name:Pe.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,ct.jsx)(Ee,{value:F.description,onChange:Pe=>se(Re=>({...Re,description:Pe.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,ct.jsxs)("div",{className:"flex gap-2",children:[(0,ct.jsxs)(N,{size:"sm",onClick:()=>Ft(),className:"flex-1",children:[(0,ct.jsx)(mt.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,ct.jsxs)(N,{size:"sm",variant:"outline",onClick:bt,className:"flex-1",children:[(0,ct.jsx)(mt.X,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,ct.jsxs)("div",{children:[(0,ct.jsxs)("div",{className:"flex items-start justify-between",children:[(0,ct.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,ct.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:m.name}),(0,ct.jsx)(le,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,ct.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:m.description}),(0,ct.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,ct.jsxs)("span",{className:"flex items-center gap-1",children:[(0,ct.jsx)(mt.CalendarDays,{className:"h-3 w-3"}),new Date(m.startDate).toLocaleDateString()]}),(0,ct.jsxs)("span",{className:"flex items-center gap-1",children:[(0,ct.jsx)(mt.User,{className:"h-3 w-3"}),G," tasks"]})]})]}),(0,ct.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,ct.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>dt(m),className:"h-6 w-6 p-0",children:(0,ct.jsx)(mt.Edit2,{className:"h-3 w-3"})}),(0,ct.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>n(m.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,ct.jsx)(mt.Trash2,{className:"h-3 w-3"})})]})]}),(0,ct.jsx)("div",{className:"flex items-center justify-between mt-2",children:(0,ct.jsx)(N,{variant:x?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>Y(m.id.toString()),disabled:!x&&u?.length>=3,children:(0,ct.jsx)("span",{className:"pointer-events-none select-none",children:x?"Deselect":u?.length>=3?"Limit Reached":"Select"})})})]})},m.id)}):(0,ct.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,ct.jsx)(mt.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,ct.jsxs)("p",{className:"text-sm",children:['No sprints found for "',te,'" filter']}),(0,ct.jsx)(N,{variant:"link",size:"sm",onClick:()=>O("all"),className:"text-xs",children:"Show all sprints"})]})}),u?.length===0&&(0,ct.jsx)("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,ct.jsxs)("div",{className:"text-center",children:[(0,ct.jsx)(mt.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,ct.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints ct start planning"}),(0,ct.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Choose up ct 3 sprints ct view alongside your backlog"})]})})]})]})})]}),(0,ct.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,ct.jsx)("div",{className:"lg:col-span-1",children:(0,ct.jsxs)(ie,{className:"p-4 h-full bg-card border-ct-4 border-ct-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:M,onDragEnter:()=>X("backlog"),onDragLeave:Q,onDrop:m=>Te(m,"backlog"),style:{height:E>0?`calc(100vh - ${E+200}px)`:"calc(100vh - 16rem)"},children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,ct.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsxs)(le,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[me?.length," tasks"]}),(0,ct.jsxs)(le,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[qe," pts"]})]})]}),(0,ct.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${v==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:m,unassignedTasks:x}=at(me);return(0,ct.jsxs)(ct.Fragment,{children:[Object.entries(m).map(([G,q])=>{let Pe=he(G);if(!Pe)return null;let Re=d.has(G);return(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>We(G),children:[(0,ct.jsx)("div",{className:`w-3 h-3 rounded-full ${Pe.color}`}),(0,ct.jsx)("span",{className:"font-medium text-muted-foreground",children:Pe.name}),(0,ct.jsxs)("span",{className:"text-muted-foreground",children:["(",q?.length,")"]}),(0,ct.jsx)("div",{className:"ml-auto",children:Re?(0,ct.jsx)(mt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,ct.jsx)(mt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Re&&(0,ct.jsx)("div",{className:"space-y-2 pl-2",children:q.map(Oe=>(0,ct.jsx)(Ie,{task:Oe},Oe.id))})]},G)}),x?.length>0&&(()=>{let G=d.has("eo-epic");return(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>We("eo-epic"),children:[(0,ct.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,ct.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,ct.jsxs)("span",{className:"text-muted-foreground",children:["(",x?.length,")"]}),(0,ct.jsx)("div",{className:"ml-auto",children:G?(0,ct.jsx)(mt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,ct.jsx)(mt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!G&&(0,ct.jsx)("div",{className:"space-y-2 pl-2",children:x?.map(q=>(0,ct.jsx)(Ie,{task:q},q.id))})]})})(),me?.length===0&&(0,ct.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here ct move ct backlog"}),me?.length>0&&Object.keys(m).length===0&&x.length===0&&(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),me?.map(G=>(0,ct.jsx)(Ie,{task:G},G.id))]})]})})()})]})}),K.map(m=>{let x=e.filter(q=>fe(q?.sprint)===m.id),G=x.reduce((q,Pe)=>q+(Pe?.storyPoints||0),0);return(0,ct.jsxs)(ie,{className:"p-4 h-full bg-card border-ct-4 border-ct-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:M,onDragEnter:()=>X(m.id.toString()),onDragLeave:Q,onDrop:q=>Te(q,m.id.toString()),style:{height:E>0?`calc(100vh - ${E+200}px)`:"calc(100vh - 16rem)"},children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,ct.jsx)("div",{children:(0,ct.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:m.name})}),(0,ct.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ct.jsxs)(le,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[x?.length," tasks"]}),(0,ct.jsxs)(le,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[G," pts"]}),(0,ct.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>{Me(!0),dt(m)},className:"h-6 px-2",children:(0,ct.jsx)(mt.Edit2,{className:"h-3 w-3"})}),(0,ct.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>n(m.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,ct.jsx)(mt.Trash2,{className:"h-3 w-3"})})]})]}),(0,ct.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:q,unassignedTasks:Pe}=at(x);return(0,ct.jsxs)(ct.Fragment,{children:[Object.entries(q).map(([Re,Oe])=>{let jt=he(Re);if(!jt)return null;let Wt=d.has(Re);return(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>We(Re),children:[(0,ct.jsx)("div",{className:`w-3 h-3 rounded-full ${jt.color}`}),(0,ct.jsx)("span",{className:"font-medium text-muted-foreground",children:jt.name}),(0,ct.jsxs)("span",{className:"text-muted-foreground",children:["(",Oe?.length,")"]}),(0,ct.jsx)("div",{className:"ml-auto",children:Wt?(0,ct.jsx)(mt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,ct.jsx)(mt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Wt&&(0,ct.jsx)("div",{className:"space-y-2 pl-2",children:Oe?.map(_t=>(0,ct.jsx)(Ie,{task:_t},_t.id))})]},Re)}),Pe?.length>0&&(()=>{let Re=d.has("eo-epic");return(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>We("eo-epic"),children:[(0,ct.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,ct.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,ct.jsxs)("span",{className:"text-muted-foreground",children:["(",Pe?.length,")"]}),(0,ct.jsx)("div",{className:"ml-auto",children:Re?(0,ct.jsx)(mt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,ct.jsx)(mt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Re&&(0,ct.jsx)("div",{className:"space-y-2 pl-2",children:Pe?.map(Oe=>(0,ct.jsx)(Ie,{task:Oe},Oe.id))})]})})(),x?.length===0&&(0,ct.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},m.id)})]}),(0,ct.jsx)(Vo,{isOpen:b,onClose:()=>I(!1),onAddSprint:$t})]})})]})};var yi=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),wi=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})},Ia=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[r,s]=t.split(":");o.setHours(parseInt(r),parseInt(s))}return o<a},Fa=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Ni=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Ci=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[r,s]=(0,oe.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[c,n]=(0,oe.useState)(!1),u=d=>{if(d.preventDefault(),!e.find(C=>C?.id.toString()===r.colleagueId.toString())){console.error("No valid colleague selected"),n(!0);return}n(!1);let T={title:r.title,description:r.description,dueDate:new Date(r.dueDate).toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring,assignedColleague:Number(r.colleagueId),project:1,updatedAt:new Date().toISOString()};t(T),o(!1),s({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,oe.useEffect)(()=>{r.colleagueId&&n(!1)},[r.colleagueId]);let p=e.filter(Boolean);return(0,ct.jsx)(Ke,{open:a,onOpenChange:o,children:(0,ct.jsxs)(Ue,{className:"max-w-2xl",children:[(0,ct.jsx)(Ge,{children:(0,ct.jsx)($e,{children:"Add New Reminder"})}),(0,ct.jsxs)("form",{onSubmit:u,className:"space-y-4",children:[(0,ct.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"title",children:"Title"}),(0,ct.jsx)(Z,{id:"title",value:r.title,onChange:d=>s({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"description",children:"Description"}),(0,ct.jsx)(Ee,{id:"description",value:r.description,onChange:d=>s({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,ct.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"dueDate",children:"Due Date"}),(0,ct.jsx)(Z,{id:"dueDate",type:"date",value:r.dueDate,onChange:d=>s({...r,dueDate:d.target.value}),required:!0})]}),(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,ct.jsx)(Z,{id:"dueTime",type:"time",value:r.dueTime,onChange:d=>s({...r,dueTime:d.target.value})})]})]}),(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{className:`${c?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,ct.jsxs)(ze,{value:r.colleagueId,onValueChange:d=>{s({...r,colleagueId:d})},required:!0,children:[(0,ct.jsx)(Fe,{className:`${c?"text-destructive border-red-500":""}`,children:(0,ct.jsx)(ot,{className:`${c?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(d=>d?.id.toString()===r.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,ct.jsx)(Le,{children:p.map(d=>(0,ct.jsx)(ne,{value:d.id.toString(),children:d.name},d.id))})]}),c&&(0,ct.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,ct.jsxs)("div",{className:"space-y-2",children:[(0,ct.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ct.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:d=>s({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,ct.jsx)(R,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,ct.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,ct.jsxs)(ze,{value:r.recurrencePattern,onValueChange:d=>s({...r,recurrencePattern:d}),children:[(0,ct.jsx)(Fe,{children:(0,ct.jsx)(ot,{})}),(0,ct.jsxs)(Le,{children:[(0,ct.jsx)(ne,{value:"daily",children:"Daily"}),(0,ct.jsx)(ne,{value:"weekly",children:"Weekly"}),(0,ct.jsx)(ne,{value:"monthly",children:"Monthly"}),(0,ct.jsx)(ne,{value:"yearly",children:"Yearly"})]})]})]}),(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"recurrenceInterval",children:"Every"}),(0,ct.jsx)(Z,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:d=>s({...r,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,ct.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,ct.jsx)(N,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,ct.jsx)(N,{type:"submit",children:"Add Reminder"})]})]})]})})},ki=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:r})=>{let[s,c]=(0,oe.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),n=p=>{p.preventDefault(),a(e.id.toString(),{title:s.title,description:s.description,dueDate:new Date(s.dueDate||"").toISOString(),dueTime:s.dueTime||void 0,isRecurring:s.isRecurring}),r()},u=t.filter(Boolean);return(0,ct.jsx)(Ke,{open:o,onOpenChange:r,children:(0,ct.jsxs)(Ue,{className:"max-w-2xl",children:[(0,ct.jsx)(Ge,{children:(0,ct.jsx)($e,{children:"Edit Reminder"})}),(0,ct.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,ct.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"edit-title",children:"Title"}),(0,ct.jsx)(Z,{id:"edit-title",value:s.title,onChange:p=>c({...s,title:p.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"edit-description",children:"Description"}),(0,ct.jsx)(Ee,{id:"edit-description",value:s.description||"",onChange:p=>c({...s,description:p.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,ct.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,ct.jsx)(Z,{id:"edit-dueDate",type:"date",value:s.dueDate,onChange:p=>c({...s,dueDate:p.target.value}),required:!0})]}),(0,ct.jsxs)("div",{children:[(0,ct.jsx)(R,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,ct.jsx)(Z,{id:"edit-dueTime",type:"time",value:s.dueTime,onChange:p=>c({...s,dueTime:p.target.value})})]})]}),(0,ct.jsx)("div",{className:"space-y-2",children:(0,ct.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ct.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:s.isRecurring||!1,onChange:p=>c({...s,isRecurring:p.target.checked}),className:"rounded border-border"}),(0,ct.jsx)(R,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,ct.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,ct.jsx)(N,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,ct.jsx)(N,{type:"submit",children:"Save Changes"})]})]})]})})},Si=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[r,s]=(0,oe.useState)(!1);if(!e||!e.id)return null;let c=Ia(new Date(e.dueDate||""),e.dueTime||""),n=Fa(new Date(e.dueDate||"")),u=Ni(new Date(e.dueDate||"")),p=()=>{a(e.id.toString(),{})},d=()=>n?"Today":u?"Tomorrow":yi(new Date(e.dueDate||""));return(0,ct.jsxs)(ct.Fragment,{children:[(0,ct.jsx)(ki,{reminder:e,colleagues:t,onUpdateReminder:a,open:r,onClose:()=>s(!1)}),(0,ct.jsx)(ie,{children:(0,ct.jsx)(Ot,{className:"p-4",children:(0,ct.jsxs)("div",{className:"flex items-start justify-between",children:[(0,ct.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,ct.jsx)("button",{onClick:p,className:"mt-1 text-primary hover:text-primary/80"}),(0,ct.jsxs)("div",{className:"flex-1",children:[(0,ct.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,ct.jsx)("h3",{children:e.title})}),(0,ct.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,ct.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,ct.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,ct.jsx)(mt.Calendar,{className:"h-4 w-4"}),(0,ct.jsx)("span",{className:c?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,ct.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,ct.jsx)(mt.Clock,{className:"h-4 w-4"}),(0,ct.jsx)("span",{children:wi(e.dueTime)})]}),(0,ct.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,ct.jsx)(mt.User,{className:"h-4 w-4"}),(0,ct.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,ct.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,ct.jsx)(N,{variant:"ghost",size:"sm",onClick:()=>s(!0),className:"h-8 w-8 p-0",children:(0,ct.jsx)(mt.Edit2,{className:"h-4 w-4"})}),(0,ct.jsx)(N,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,ct.jsx)(mt.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Uo=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:r})=>{let[s,c]=(0,oe.useState)(e.filter(Boolean)),[n,u]=(0,oe.useState)(t.filter(Boolean)),[p,d]=(0,oe.useState)("all"),[g,T]=(0,oe.useState)(""),[C,b]=(0,oe.useState)(!1);(0,oe.useEffect)(()=>{c(e.filter(Boolean))},[e]),(0,oe.useEffect)(()=>{u(t.filter(Boolean))},[t]);let I=k=>{if(!k.title){console.error("Invalid reminder data:",k);return}let _={...k,id:Date.now(),createdAt:new Date().toISOString()};c(te=>[...te,_]),a?.(k)},v=(k,_)=>{if(!k){console.error("No reminder ID provided for update");return}c(te=>te.map(O=>O?.id.toString()===k?{...O,..._}:O)),o?.(k,_)},V=k=>{if(!k){console.error("No reminder ID provided for deletion");return}c(_=>_.filter(te=>te?.id.toString()!==k)),r?.(k)},w=s.filter(k=>{if(!k)return!1;if(g){let _=g.toLowerCase();if(!(k.title.toLowerCase().includes(_)||k.description?.toLowerCase().includes(_)))return!1}switch(p){case"pending":case"completed":case"overdue":return Ia(new Date(k.dueDate||""),k.dueTime||"");case"today":return Fa(new Date(k.dueDate||""));default:return!0}}).sort((k,_)=>{if(!k||!_)return 0;let te={high:3,medium:2,low:1},O=0;return O!==0?O:new Date(k.dueDate||"").getTime()-new Date(_.dueDate||"").getTime()}),F={total:s.filter(Boolean).length,overdue:s.filter(k=>k&&Ia(new Date(k.dueDate||""),k.dueTime||"")).length,today:s.filter(k=>k&&Fa(new Date(k.dueDate||""))).length},se=n.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,ct.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,ct.jsx)(nt,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-ct-r from-emerald-600 via-teal-600 ct-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{b(!0)}}}),(0,ct.jsxs)("div",{className:"h-full bg-background",children:[(0,ct.jsx)(Ci,{colleagues:n,onAddReminder:I,open:C,setOpen:b}),(0,ct.jsxs)("div",{className:"p-6",children:[(0,ct.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,ct.jsxs)("div",{children:[(0,ct.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,ct.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,ct.jsxs)(N,{className:"flex items-center space-x-2",onClick:()=>b(!0),children:[(0,ct.jsx)(mt.Plus,{className:"h-4 w-4"}),(0,ct.jsx)("span",{children:"Add Reminder"})]})]}),(0,ct.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,ct.jsxs)(ie,{className:"p-4",children:[(0,ct.jsx)("div",{className:"text-2xl font-bold text-foreground",children:F.total}),(0,ct.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,ct.jsxs)(ie,{className:"p-4",children:[(0,ct.jsx)("div",{className:"text-2xl font-bold text-primary",children:F.overdue}),(0,ct.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,ct.jsxs)(ie,{className:"p-4",children:[(0,ct.jsx)("div",{className:"text-2xl font-bold text-success",children:F.today}),(0,ct.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,ct.jsxs)(ie,{className:"p-4",children:[(0,ct.jsx)("div",{className:"text-2xl font-bold text-destructive",children:F.overdue}),(0,ct.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,ct.jsxs)(ie,{className:"p-4",children:[(0,ct.jsx)("div",{className:"text-2xl font-bold text-warning",children:F.today}),(0,ct.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,ct.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,ct.jsx)("div",{className:"flex-1",children:(0,ct.jsx)(Z,{placeholder:"Search reminders...",value:g,onChange:k=>T(k.target.value),className:"max-w-md"})}),(0,ct.jsxs)(ze,{value:p,onValueChange:k=>d(k),children:[(0,ct.jsx)(Fe,{className:"w-40",children:(0,ct.jsx)(ot,{})}),(0,ct.jsxs)(Le,{children:[(0,ct.jsxs)(ne,{value:"all",children:["All (",F.total,")"]}),(0,ct.jsxs)(ne,{value:"overdue",children:["Overdue (",F.overdue,")"]}),(0,ct.jsxs)(ne,{value:"overdue",children:["Overdue (",F.overdue,")"]}),(0,ct.jsxs)(ne,{value:"today",children:["Today (",F.today,")"]})]})]})]}),(0,ct.jsx)("div",{className:"space-y-4",children:w.length===0?(0,ct.jsxs)(ie,{className:"p-8 text-center",children:[(0,ct.jsx)("div",{className:"text-muted-foreground",children:g||p!=="all"?"No reminders match your filters":"No reminders yet"}),!g&&p==="all"&&(0,ct.jsx)("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder ct get started"})]}):w.map(k=>k&&(0,ct.jsx)(Si,{reminder:k,colleagues:n,onUpdateReminder:v,onDeleteReminder:V},k.id))})]})]})]})};var It=ue(require("@radix-ui/react-tabs"));function Go({className:e,...t}){return(0,ct.jsx)(It.Root,{"data-slot":"tabs",className:y("flex flex-col gap-2",e),...t})}function $o({className:e,...t}){return(0,ct.jsx)(It.List,{"data-slot":"tabs-list",className:y("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function jo({className:e,...t}){return(0,ct.jsx)(It.Trigger,{"data-slot":"tabs-trigger",className:y("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 vt=ue(require("react")),U=ue(require("@radix-ui/react-dropdown-menu")),Gt=require("@radix-ui/react-icons");var Wo=U.Root,_o=U.Trigger;var Di=vt.forwardRef(({className:e,inset:t,children:a,...o},r)=>(0,ct.jsxs)(U.SubTrigger,{ref:r,className:y("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,ct.jsx)(Gt.ChevronRightIcon,{className:"ml-auto"})]}));Di.displayName=U.SubTrigger.displayName;var Ti=vt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(U.SubContent,{ref:a,className:y("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}));Ti.displayName=U.SubContent.displayName;var La=vt.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,ct.jsx)(U.Portal,{children:(0,ct.jsx)(U.Content,{ref:o,sideOffset:t,className:y("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})}));La.displayName=U.Content.displayName;var Ba=vt.forwardRef(({className:e,inset:t,...a},o)=>(0,ct.jsx)(U.Item,{ref:o,className:y("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}));Ba.displayName=U.Item.displayName;var Pi=vt.forwardRef(({className:e,children:t,checked:a,...o},r)=>(0,ct.jsxs)(U.CheckboxItem,{ref:r,className:y("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[(0,ct.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,ct.jsx)(U.ItemIndicator,{children:(0,ct.jsx)(Gt.CheckIcon,{className:"h-4 w-4"})})}),t]}));Pi.displayName=U.CheckboxItem.displayName;var Ri=vt.forwardRef(({className:e,children:t,...a},o)=>(0,ct.jsxs)(U.RadioItem,{ref:o,className:y("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,ct.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,ct.jsx)(U.ItemIndicator,{children:(0,ct.jsx)(Gt.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Ri.displayName=U.RadioItem.displayName;var Ei=vt.forwardRef(({className:e,inset:t,...a},o)=>(0,ct.jsx)(U.Label,{ref:o,className:y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));Ei.displayName=U.Label.displayName;var Ai=vt.forwardRef(({className:e,...t},a)=>(0,ct.jsx)(U.Separator,{ref:a,className:y("-mx-1 my-1 h-px bg-muted",e),...t}));Ai.displayName=U.Separator.displayName;var Mi=({className:e,...t})=>(0,ct.jsx)("span",{className:y("ml-auto text-xs tracking-widest opacity-60",e),...t});Mi.displayName="DropdownMenuShortcut";function qo({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:r="700px",gridCols:s=6}){let c=a.find(n=>n.value===e);return(0,ct.jsxs)(Mo.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,ct.jsx)("div",{className:"hidden lg:block",children:(0,ct.jsx)(Go,{value:e,onValueChange:t,children:(0,ct.jsx)($o,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(s,a.length)}, minmax(0, 1fr))`},children:a.map(n=>(0,ct.jsx)(Mo.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,ct.jsx)(jo,{value:n.value,className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:n.label})},n.value))})})}),(0,ct.jsx)("div",{className:"lg:hidden",children:(0,ct.jsxs)(Wo,{children:[(0,ct.jsx)(_o,{asChild:!0,children:(0,ct.jsxs)(N,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[c?.label||"Select",(0,ct.jsx)(mt.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,ct.jsx)(La,{align:"center",className:"w-[180px]",children:a.map(n=>(0,ct.jsx)(Ba,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function ua({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:r=!0,className:s}){return(0,ct.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${s||""}`,children:[r&&(0,ct.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,ct.jsx)("div",{className:"col-span-6",children:"Name"}),(0,ct.jsx)("div",{className:"col-span-2",children:"Size"}),(0,ct.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,ct.jsx)("div",{className:"divide-y",children:e.map(c=>(0,ct.jsxs)(Mo.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?.(c),children:[(0,ct.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,ct.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,ct.jsx)("div",{children:(0,ct.jsx)("p",{className:"font-medium",children:c.name})})]}),(0,ct.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:c.filesize}),(0,ct.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,ct.jsx)("span",{className:"text-sm md:text-base",children:typeof c.createdAt=="string"?c.createdAt:new Date(c.createdAt).toLocaleDateString()}),(0,ct.jsx)("div",{className:"flex gap-1",children:(0,ct.jsx)(N,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:n=>{n.stopPropagation(),o?.(c)},children:(0,ct.jsx)(mt.Trash2,{className:"h-4 w-4"})})})]})]},c.name))})]})}var Zo=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,r]=(0,oe.useState)(null),[s,c]=(0,oe.useState)(""),[n,u]=(0,oe.useState)(""),[p,d]=(0,oe.useState)(""),g=C=>{let b=C.target.files?.[0];b&&(r(b),s||c(b.name))},T=async C=>{if(C.preventDefault(),!o)return;let b=new FormData;b.append("file",o),b.append("name",s),n&&b.append("description",n),p&&b.append("tags",p),a?.(b),t(),r(null),c(""),u(""),d("")};return(0,ct.jsx)(Ke,{open:e,onOpenChange:t,children:(0,ct.jsxs)(Ue,{className:"sm:max-w-md",children:[(0,ct.jsx)(Ge,{children:(0,ct.jsx)($e,{children:"Add New File"})}),(0,ct.jsxs)("form",{onSubmit:T,className:"grid gap-4",children:[(0,ct.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,ct.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[(0,ct.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,ct.jsx)(Ii,{className:"w-10 h-10 text-gray-400"}),(0,ct.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,ct.jsx)("span",{className:"font-semibold",children:"Click ct upload"})," or drag and drop"]}),(0,ct.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,ct.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:g})]})}),o&&(0,ct.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ct.jsxs)("div",{children:[(0,ct.jsx)("p",{className:"font-medium",children:o.name}),(0,ct.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,ct.jsx)(N,{type:"submit",onClick:T,children:"Upload"})]})]})]})})};function Ii(e){return(0,ct.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ct.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,ct.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,ct.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function za({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:r,compactView:s=!1,className:c}){let[n,u]=(0,oe.useState)(e),[p,d]=(0,oe.useState)(""),[g,T]=(0,oe.useState)("all"),[C,b]=(0,oe.useState)("all"),[I,v]=(0,oe.useState)(!1);(0,oe.useEffect)(()=>{u(e)},[e]);let V=n.filter(O=>O.name.toLowerCase().includes(p.toLowerCase())),W=V.slice(0,10),w=V.filter(Boolean),F=()=>{v(!0)},se=O=>{a?.(O)},k=O=>{console.log("deleting file",O),u(be=>be.filter(Me=>Me.name!==O.name)),o?.(O.id.toString())},_=O=>{r?.(O)},te=()=>{d(""),T("all")};return(0,ct.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,ct.jsx)(Mo.AnimatePresence,{mode:"wait",children:(0,ct.jsx)(Mo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,ct.jsxs)("div",{className:`space-y-6 ${c||""}`,children:[(0,ct.jsx)(nt,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-ct-r from-blue-600 via-indigo-600 ct-purple-600",primaryAction:{label:"Upload file",onClick:F},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,ct.jsx)(ie,{children:(0,ct.jsx)(Ot,{className:"pt-6",children:(0,ct.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,ct.jsx)("div",{className:"flex-1",children:(0,ct.jsxs)("div",{className:"relative",children:[(0,ct.jsx)(mt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,ct.jsx)(Z,{placeholder:"Search files...",value:p,onChange:O=>d(O.target.value),className:"pl-9"})]})}),(p||g!=="all")&&(0,ct.jsxs)(N,{variant:"outline",onClick:te,className:"gap-2",children:[(0,ct.jsx)(mt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,ct.jsxs)("div",{className:"space-y-4",children:[(0,ct.jsx)(qo,{activeTab:C,onTabChange:b,tabOptions:[{value:"all",label:`All Files (${V.length})`},{value:"recent",label:`Recent (${W.length})`}],maxWidth:"500px",gridCols:3}),C==="all"&&(0,ct.jsx)(ua,{files:V,onFileClick:_,onFileEdit:se,onFileDelete:k,showHeader:!s}),C==="recent"&&(0,ct.jsx)(ua,{files:W,onFileClick:_,onFileEdit:se,onFileDelete:k,showHeader:!s}),C==="shared"&&(0,ct.jsx)(ua,{files:w,onFileClick:_,onFileEdit:se,onFileDelete:k,showHeader:!s})]}),V.length===0&&(0,ct.jsx)(ie,{children:(0,ct.jsx)(Ot,{className:"pt-6",children:(0,ct.jsxs)("div",{className:"text-center py-8",children:[(0,ct.jsx)(mt.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,ct.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,ct.jsx)("p",{className:"text-muted-foreground mb-4",children:p||g!=="all"?"Try adjusting your filters ct see more results.":"Get started by uploading your first file."}),(0,ct.jsxs)(N,{onClick:F,className:"gap-2",children:[(0,ct.jsx)(mt.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,ct.jsx)(Zo,{isOpen:I,onClose:()=>v(!1),onAddFile:t})]})}var Yo=require("next/navigation");function Qo({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:r=[],initialReminders:s=[],initialColleagues:c=[],initialUsers:n=[],initialFiles:u=[],initialView:p="kanban",onAddTask:d,onUpdateTask:g,onDeleteTask:T,onTaskClick:C,onAddEpic:b,onUpdateEpic:I,onDeleteEpic:v,onAddTaskToEpic:V,onAddSprint:W,onUpdateSprint:w,onDeleteSprint:F,onAddProject:se,onUpdateProject:k,onDeleteProject:_,onFileAdd:te,onFileEdit:O,onFileDelete:be,onFileClick:Me,onAddReminder:E,onUpdateReminder:we,onDeleteReminder:ee,onViewChange:et,onToggleMobileMenu:he,onTeamClick:lt,onTeamChange:tt,onCopilotClick:rt,handleAddComment:at}){let[h,K]=(0,oe.useState)(t),[me,qe]=(0,oe.useState)(a),[Y,We]=(0,oe.useState)(o),[$t,dt]=(0,oe.useState)(r),[Ft,bt]=(0,oe.useState)(s),[kt,M]=(0,oe.useState)(c),[X,Q]=(0,oe.useState)(n),[Te,Ie]=(0,oe.useState)(u),[m,x]=(0,oe.useState)(!1),[G,q]=(0,oe.useState)(!1),[Pe,Re]=(0,oe.useState)(null),[Oe,jt]=(0,oe.useState)(null),[Wt,_t]=(0,oe.useState)(null),[St,Va]=(0,oe.useState)(p||"kanban"),[Li,er]=(0,oe.useState)(!1),tr=(0,Yo.useRouter)();(0,oe.useEffect)(()=>{K(t)},[t]),(0,oe.useEffect)(()=>{We(o)},[o]),(0,oe.useEffect)(()=>{qe(a)},[a]),(0,oe.useEffect)(()=>{dt(r)},[r]),(0,oe.useEffect)(()=>{Ie(u)},[u]),(0,oe.useEffect)(()=>{Q(n)},[n]),(0,oe.useEffect)(()=>{M(c)},[c]),(0,oe.useEffect)(()=>{bt(s)},[s]),(0,oe.useEffect)(()=>{Va(p)},[p]);let ar=h.filter(f=>{}),Bi=f=>ar.filter(A=>A.status===f),Oi=f=>{let A={};return me.forEach(L=>{}),A},zi=f=>{_t(f)},Vi=f=>{Wt&&(K(A=>A.map(L=>L.id===Wt.id?{...L,status:f}:L)),_t(null))},Ha=f=>{let A={...f,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};K(L=>[...L,A]),d?.(A)},ea=async(f,A)=>(K(L=>L.map(Ne=>Ne.id===Number(f)?{...Ne,...A}:Ne)),await g?.(f,A)),Hi=async(f,A)=>{ea(f,A)},Ua=f=>{K(A=>A.filter(L=>L.id!==Number(f))),Pe?.id===Number(f)&&Re(null),T?.(f)},Ui=async f=>{Ua(f)},Gi=f=>{let A={...f,id:Date.now()};dt(L=>[...L,A]),se?.(f)},$ct=(f,A)=>{dt(L=>L.map(Ne=>Ne.id===Number(f)?{...Ne,...A}:Ne)),k?.(f,A)},ji=f=>{dt(A=>A.filter(L=>L.id!==Number(f))),_?.(f)},Ga=f=>{let A={...f,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};qe(L=>[...L,A]),b?.({...A})},or=()=>{q(!0)},rr=(f,A)=>{qe(L=>L.map(Ne=>Ne.id===Number(f)?{...Ne,...A}:Ne)),I?.(f,A)},ir=f=>{qe(A=>A.filter(L=>L.id!==Number(f))),K(A=>A.filter(L=>fe(L.epic)!==Number(f))),v?.(f)},nr=f=>{let A={...f,id:Date.now()};We(L=>[...L,A]),W?.(f)},sr=(f,A)=>{We(L=>L.map(Ne=>Ne.id===Number(f)?{...Ne,...A}:Ne)),w?.(f,A)},lr=f=>{f==="backlog"||f==="all-tasks"||(We(A=>A.filter(L=>L.id!==Number(f))),K(A=>A.map(L=>fe(L.sprint)===Number(f)?{...L,sprint:void 0}:L)),F?.(f))},fa=f=>{Re(f)},dr=f=>{f==="planning"&&window.innerWidth<768||(Va(f),et?.(f))},Wi=()=>{er(f=>!f),he?.()},_i=()=>{tr.push("/")},Ki=f=>{console.log("Switching ct team:",f)},qi=f=>{console.log("Switching ct team:",f)},cr=f=>{x(!0)},mr=()=>{x(!1),jt(null)},pr=f=>{let A={...f,id:Date.now(),createdAt:new Date().toISOString()};bt(L=>[...L,A]),E?.(f)},ur=(f,A)=>{bt(L=>L.map(Ne=>Ne.id===Number(f)?{...Ne,...A}:Ne)),we?.(f,A)},gr=f=>{bt(A=>A.filter(L=>L.id!==Number(f))),ee?.(f)},fr=()=>{te?.()},vr=f=>{O?.(f)},br=f=>{Ie(A=>A.filter(L=>L.name!==f)),be?.(f)},hr=f=>{Me?.(f)},Ji=[{id:"todo",title:"To oe",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Xi=()=>{switch(St){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"}},va=[{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")}],Zi=va.sort((f,A)=>A.lastUsed.getTime()-f.lastUsed.getTime()).slice(0,3),Yi=va.length>3,Qi=va.slice(3);return(0,ct.jsxs)(ja,{currentView:St,onViewChange:dr,children:[St==="kanban"&&(0,ct.jsx)("div",{className:"h-full overflow-hidden",children:(0,ct.jsx)(Io,{initialProjects:$t,initialEpics:me,initialSprints:Y.map(f=>({...f,isSelected:!1})),initialTasks:h,initialColleagues:kt,initialUsers:X,onAddTask:Ha,onUpdateTask:ea,onDeleteTask:Ua,onTaskClick:fa,onAddEpic:Ga,onAddComment:at})}),St==="planning"&&(0,ct.jsx)("div",{className:"hidden md:block h-full",children:(0,ct.jsx)(Ho,{tasks:h,epics:me,sprints:Y,onUpdateTask:ea,onTaskClick:fa,onAddSprint:nr,onUpdateSprint:sr,onDeleteSprint:lr})}),St==="tasks"&&(0,ct.jsx)("div",{className:"h-full",children:(0,ct.jsx)(Uo,{initialReminders:Ft,initialColleagues:kt,onAddReminder:pr,onUpdateReminder:ur,onDeleteReminder:gr})}),St==="files"&&(0,ct.jsx)("div",{className:"h-full",children:(0,ct.jsx)(za,{initialFiles:Te,onFileAdd:fr,onFileEdit:vr,onFileDelete:br,onFileClick:hr,compactView:!1})}),St==="epics"&&(0,ct.jsx)("div",{className:"h-full",children:(0,ct.jsx)(Fo,{tasks:h,epics:me,sprints:Y,onUpdateTask:ea,onTaskClick:fa,onAddTaskToEpic:cr,onAddEpic:or,onUpdateEpic:rr,onDeleteEpic:ir})}),(0,ct.jsx)(Vt,{isOpen:m,onClose:mr,onAddTask:Ha,epics:me,sprints:Y,assignees:[...kt,...X],defaultEpicId:Oe||void 0}),(0,ct.jsx)(Ut,{isOpen:G,onClose:()=>q(!1),onAddEpic:Ga})]})}
|