@libxai/board 1.9.14 → 1.9.15
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/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -122,7 +122,7 @@ import {createRoot}from'react-dom/client';import {dragStore,BaseViewAdapter,sele
|
|
|
122
122
|
1.
|
|
123
123
|
|
|
124
124
|
**Action items:**
|
|
125
|
-
- [ ] `,priority:"MEDIUM",labels:["meeting"]}}];function Bc({templates:e,onSelectTemplate:t,className:r}){let[a,n]=useState(false),s=useRef(null),o=useRef(null);useEffect(()=>{function i(d){s.current&&!s.current.contains(d.target)&&o.current&&!o.current.contains(d.target)&&n(false);}if(a)return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[a]);let c=i=>{t(i),n(false);},l=e.reduce((i,d)=>{let u=d.category||"Other";return i[u]||(i[u]=[]),i[u].push(d),i},{});return jsxs("div",{className:g("relative inline-block",r),children:[jsxs("button",{ref:o,onClick:()=>n(!a),className:"flex items-center gap-2 px-3 py-2 rounded-lg border transition-all text-sm font-medium shadow-lg",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-primary)"},onMouseEnter:i=>{i.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",i.currentTarget.style.borderColor="var(--theme-border-secondary)";},onMouseLeave:i=>{i.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",i.currentTarget.style.borderColor="var(--theme-border-primary)";},title:"Create from template",children:[jsx("span",{className:"text-base leading-none",children:"\u{1F4CB}"}),jsx("span",{children:"Templates"}),jsx("svg",{className:g("w-4 h-4 transition-transform",a&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),a&&jsxs("div",{ref:s,className:"absolute top-full left-0 mt-2 min-w-[320px] max-w-[400px] rounded-xl backdrop-blur-xl border shadow-2xl z-50 overflow-hidden max-h-[500px] overflow-y-auto",style:{backgroundColor:"var(--theme-bg-primary)",borderColor:"var(--theme-border-primary)"},children:[jsxs("div",{className:"px-4 py-3 border-b sticky top-0 backdrop-blur-sm",style:{borderColor:"var(--theme-border-primary)",backgroundColor:"var(--theme-bg-secondary)"},children:[jsx("span",{className:"text-sm font-bold uppercase tracking-wider",style:{color:"var(--theme-text-primary)"},children:"Card Templates"}),jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:"Quick start with pre-configured cards"})]}),Object.entries(l).map(([i,d])=>jsxs("div",{className:"py-2",children:[jsx("div",{className:"px-4 py-2",children:jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--theme-text-secondary)"},children:i})}),jsx("div",{children:d.map(u=>jsxs("button",{onClick:()=>c(u),className:"w-full px-4 py-3 flex items-start gap-3 text-left transition-all active:scale-[0.98]",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsx("span",{className:"text-2xl leading-none mt-0.5",children:u.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"font-semibold text-sm",style:{color:"var(--theme-text-primary)"},children:u.name}),u.description&&jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:u.description})]})]},u.id))})]},i)),e.length===0&&jsx("div",{className:"px-4 py-8 text-center",style:{color:"var(--theme-text-tertiary)"},children:jsx("p",{className:"text-sm",children:"No templates available"})})]})]})}function Oc({board:e,isOpen:t,onClose:r,onImport:a,boardElementRef:n,className:s}){let[o,c]=useState("export"),[l,i]=useState("json"),[d,u]=useState(null),p=useRef(null);if(!t)return null;let m=async()=>{let x=n?.current||void 0,y=await Lu(e,l,x);Au(y,l);},f=async x=>{let y=x.target.files?.[0];if(y){try{let b=await Bu(y),h=y.name.endsWith(".json")?"json":"csv",v=Ru(b,h);u(v),v.success&&a&&a(v,b);}catch(b){u({success:false,errors:[`Failed to read file: ${b instanceof Error?b.message:"Unknown error"}`]});}p.current&&(p.current.value="");}};return jsxs("div",{className:g("fixed inset-0 z-[9999] flex items-center justify-center",s),children:[jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:r}),jsxs("div",{className:"relative bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl rounded-2xl border border-white/20 shadow-2xl max-w-2xl w-full mx-4",children:[jsxs("div",{className:"px-6 py-5 border-b border-white/10 flex items-center justify-between",children:[jsxs("div",{children:[jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[jsx("span",{className:"text-3xl",children:"\u{1F4E6}"}),"Export / Import"]}),jsx("p",{className:"text-sm text-white/60 mt-1",children:"Transfer your board data"})]}),jsx("button",{onClick:r,className:"text-white/50 hover:text-white transition-colors text-2xl leading-none p-2 hover:bg-white/10 rounded-lg","aria-label":"Close",children:"\xD7"})]}),jsxs("div",{className:"flex border-b border-white/10",children:[jsx("button",{onClick:()=>c("export"),className:g("flex-1 px-6 py-4 font-semibold transition-colors",o==="export"?"text-white border-b-2 border-[#00E5CC]":"text-white/50 hover:text-white/80"),children:"Export"}),jsx("button",{onClick:()=>c("import"),className:g("flex-1 px-6 py-4 font-semibold transition-colors",o==="import"?"text-white border-b-2 border-[#00E5CC]":"text-white/50 hover:text-white/80"),children:"Import"})]}),jsxs("div",{className:"p-6",children:[o==="export"&&jsxs("div",{className:"space-y-6",children:[jsxs("div",{children:[jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Select format"}),jsx("div",{className:"grid grid-cols-3 gap-3",children:["json","csv","pdf"].map(x=>jsxs("button",{onClick:()=>i(x),className:g("p-4 rounded-lg border-2 transition-all text-center",l===x?"border-[#00E5CC] bg-[#00E5CC]/20 text-white":"border-white/20 hover:border-white/40 text-white/70 hover:text-white"),children:[jsxs("div",{className:"text-2xl mb-2",children:[x==="json"&&"\u{1F4C4}",x==="csv"&&"\u{1F4CA}",x==="pdf"&&"\u{1F4DD}"]}),jsx("div",{className:"font-semibold uppercase text-xs",children:x})]},x))})]}),jsxs("div",{className:"bg-white/5 rounded-lg p-4",children:[jsx("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:"Preview"}),jsxs("div",{className:"text-xs text-white/60",children:[jsxs("div",{children:["Board: ",jsx("span",{className:"text-white/90",children:e.title||"Untitled"})]}),jsxs("div",{children:["Columns: ",jsx("span",{className:"text-white/90",children:e.columns.length})]}),jsxs("div",{children:["Cards: ",jsx("span",{className:"text-white/90",children:e.cards.length})]})]})]}),jsx("button",{onClick:m,className:"w-full py-3 px-4 bg-gradient-to-r from-[#00C4AE] to-[#00C4AE] hover:from-[#00E5CC] hover:to-[#00C4AE] text-white font-semibold rounded-lg transition-all shadow-lg shadow-[#00E5CC]/20",children:"Export Board"})]}),o==="import"&&jsxs("div",{className:"space-y-6",children:[jsxs("div",{children:[jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Upload file"}),jsx("input",{ref:p,type:"file",accept:".json,.csv",onChange:f,className:"hidden"}),jsxs("button",{onClick:()=>p.current?.click(),className:"w-full py-12 px-4 border-2 border-dashed border-white/30 hover:border-white/50 rounded-lg transition-colors text-white/70 hover:text-white",children:[jsx("div",{className:"text-5xl mb-3",children:"\u{1F4C1}"}),jsx("div",{className:"font-semibold mb-1",children:"Click to select file"}),jsx("div",{className:"text-xs text-white/50",children:"Supports JSON and CSV files"})]})]}),d&&jsxs("div",{className:g("p-4 rounded-lg",d.success?"bg-green-500/20 border border-green-500/30":"bg-red-500/20 border border-red-500/30"),children:[jsx("h3",{className:g("font-semibold mb-2",d.success?"text-green-400":"text-red-400"),children:d.success?"\u2713 Import Successful":"\u2717 Import Failed"}),d.success&&jsxs("div",{className:"text-sm text-white/80",children:[jsxs("div",{children:["Cards imported: ",d.cardsImported]}),jsxs("div",{children:["Columns imported: ",d.columnsImported]})]}),d.errors&&d.errors.length>0&&jsx("div",{className:"mt-2 text-sm",children:d.errors.map((x,y)=>jsxs("div",{className:"text-red-300",children:["\u2022 ",x]},y))})]})]})]})]})]})}var Sx=["URGENT","HIGH","MEDIUM","LOW"],Ex=[{value:"none",label:"None"},{value:"created",label:"Date Created"},{value:"priority",label:"Priority"},{value:"dueDate",label:"Due Date"},{value:"title",label:"Title"},{value:"estimate",label:"Estimate"}],Mx=[{value:"none",label:"No Grouping"},{value:"priority",label:"By Priority"},{value:"assignee",label:"By Assignee"},{value:"label",label:"By Label"}];function Hc({filters:e,sort:t,onFiltersChange:r,onSortChange:a,onReset:n,onFilterMyTasks:s,onFilterOverdue:o,onFilterHighPriority:c,availableUsers:l=[],availableLabels:i=[],availableColumns:d=[],showQuickFilters:u=true,compact:p=false,groupBy:m="none",onGroupByChange:f}){let[x,y]=useState(true),b=useCallback(S=>{r({search:S.target.value});},[r]),h=useCallback(S=>{r({dateFilter:S.target.value});},[r]),v=useCallback(S=>{a({by:S.target.value});},[a]),w=useCallback(()=>{a({order:t.order==="asc"?"desc":"asc"});},[t.order,a]),C=e.search||e.dateFilter!=="all"||e.priorities.length>0||e.assignees.length>0||e.labels.length>0||t.by!=="none";return jsxs("div",{className:`filter-bar ${p?"filter-bar--compact":""} ${x?"filter-bar--collapsed":""}`,children:[jsxs("div",{className:"filter-bar__header",onClick:()=>y(!x),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",marginBottom:x?"0":"12px",padding:"4px 6px",borderRadius:"6px",transition:"all 0.2s ease"},onMouseEnter:S=>{S.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:S=>{S.currentTarget.style.backgroundColor="transparent";},children:[jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:x?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s",color:"var(--theme-text-secondary)"},children:jsx("polyline",{points:"6 9 12 15 18 9"})}),jsx("span",{className:"filter-bar__label",style:{fontWeight:500,fontSize:"0.875rem",color:"var(--theme-text-primary)"},children:"Filters & Grouping"}),C&&jsxs("span",{style:{color:"var(--theme-accent-primary)",fontSize:"0.75rem",fontWeight:600},children:["(",[e.search&&"search",e.dateFilter!=="all"&&"date",e.priorities.length>0&&"priority",e.assignees.length>0&&"assignee",e.labels.length>0&&"label",t.by!=="none"&&"sort"].filter(Boolean).length," active)"]})]}),!x&&jsxs("div",{className:"filter-bar__content",children:[u&&jsxs("div",{className:"filter-bar__quick",style:{marginBottom:"12px"},children:[jsx("span",{className:"filter-bar__label",children:"Quick:"}),s&&jsx("button",{onClick:s,className:"filter-bar__quick-btn",title:"Show only my tasks",children:"My Tasks"}),o&&jsx("button",{onClick:o,className:"filter-bar__quick-btn",title:"Show overdue tasks",children:"Overdue"}),c&&jsx("button",{onClick:c,className:"filter-bar__quick-btn",title:"Show high priority tasks",children:"High Priority"})]}),jsxs("div",{className:"filter-bar__main",children:[jsx("div",{className:"filter-bar__field",children:jsx("input",{type:"text",placeholder:"Search tasks...",value:e.search,onChange:b,className:"filter-bar__search"})}),jsx("div",{className:"filter-bar__field",children:jsxs("select",{value:e.dateFilter,onChange:h,className:"filter-bar__select",children:[jsx("option",{value:"all",children:"All Dates"}),jsx("option",{value:"overdue",children:"Overdue"}),jsx("option",{value:"today",children:"Today"}),jsx("option",{value:"this-week",children:"This Week"})]})}),jsx("div",{className:"filter-bar__field",children:jsxs("select",{value:e.priorities[0]||"all",onChange:S=>{let F=S.target.value;r({priorities:F==="all"?[]:[F]});},className:"filter-bar__select",children:[jsx("option",{value:"all",children:"All Priorities"}),Sx.map(S=>jsx("option",{value:S,children:S},S))]})}),l.length>0&&jsx("div",{className:"filter-bar__field",children:jsxs("select",{value:e.assignees[0]||"all",onChange:S=>{let F=S.target.value;r({assignees:F==="all"?[]:[F]});},className:"filter-bar__select",children:[jsx("option",{value:"all",children:"All Assignees"}),l.map(S=>jsx("option",{value:S.id,children:S.name},S.id))]})}),i.length>0&&jsx("div",{className:"filter-bar__field",children:jsxs("select",{value:e.labels[0]||"all",onChange:S=>{let F=S.target.value;r({labels:F==="all"?[]:[F]});},className:"filter-bar__select",children:[jsx("option",{value:"all",children:"All Labels"}),i.map(S=>jsx("option",{value:S,children:S},S))]})}),jsxs("div",{className:"filter-bar__field filter-bar__sort",children:[jsx("span",{className:"filter-bar__label",style:{color:"var(--theme-text-secondary)"},children:"Sort:"}),jsx("select",{value:t.by,onChange:v,className:"filter-bar__select filter-bar__select--sm",children:Ex.map(S=>jsx("option",{value:S.value,children:S.label},S.value))}),t.by!=="none"&&jsx("button",{onClick:w,className:"filter-bar__sort-toggle",title:`Sort ${t.order==="asc"?"descending":"ascending"}`,children:t.order==="asc"?"\u2191":"\u2193"})]}),f&&jsx("div",{className:"filter-bar__field",children:jsx("select",{value:m,onChange:S=>f(S.target.value),className:"filter-bar__select",style:{fontWeight:500,borderWidth:"2px"},children:Mx.map(S=>jsx("option",{value:S.value,children:S.label},S.value))})}),C&&jsx("button",{onClick:n,className:"filter-bar__reset",title:"Clear all filters",children:"Clear"})]})]})]})}function Uc({onOpenExport:e,onOpenThemes:t,onOpenShortcuts:r,className:a,viewMode:n="kanban",onExportGanttPDF:s,onExportGanttExcel:o,onExportGanttPNG:c,onExportGanttCSV:l}){let[i,d]=useState(false),u=useRef(null);useEffect(()=>{let m=f=>{u.current&&!u.current.contains(f.target)&&d(false);};return i&&document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m);}},[i]);let p=m=>{m(),d(false);};return jsxs("div",{className:g("relative",a),ref:u,children:[jsxs("button",{onClick:()=>d(!i),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all border",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-secondary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",m.currentTarget.style.color="var(--theme-text-primary)";},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",m.currentTarget.style.color="var(--theme-text-secondary)";},"aria-label":"Configuration Menu","aria-expanded":i,children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("circle",{cx:"12",cy:"12",r:"3"}),jsx("path",{d:"M12 1v6m0 6v6M5.6 5.6l4.2 4.2m4.2 4.2l4.2 4.2M1 12h6m6 0h6M5.6 18.4l4.2-4.2m4.2-4.2l4.2-4.2"})]}),jsx("span",{children:"Config"})]}),i&&jsxs("div",{className:"absolute right-0 mt-2 w-48 rounded-lg border shadow-lg overflow-hidden z-50",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[n==="kanban"?jsxs("button",{onClick:()=>p(e),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})}),"Export"]}):jsxs(Fragment,{children:[jsxs("button",{onClick:()=>p(async()=>await s?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsx("polyline",{points:"14 2 14 8 20 8"}),jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsx("polyline",{points:"10 9 9 9 8 9"})]}),"Export PDF"]}),jsxs("button",{onClick:()=>p(async()=>await o?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsx("polyline",{points:"14 2 14 8 20 8"}),jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),"Export Excel"]}),jsxs("button",{onClick:()=>p(async()=>await c?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),jsx("polyline",{points:"21 15 16 10 5 21"})]}),"Export PNG"]}),jsxs("button",{onClick:()=>p(()=>l?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsx("polyline",{points:"14 2 14 8 20 8"}),jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),jsx("line",{x1:"8",y1:"17",x2:"16",y2:"17"})]}),"Export CSV"]})]}),jsxs("button",{onClick:()=>p(t),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("circle",{cx:"12",cy:"12",r:"5"}),jsx("path",{d:"M12 1v6m0 6v6m8.5-8.5L17 15M7 9L3.5 5.5M7 15l-3.5 3.5M20.5 5.5L17 9m3.5 11.5L17 17"})]}),"Themes"]}),jsxs("button",{onClick:()=>p(r),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M8 12h.01M12 12h.01M16 12h.01M7 16h10"})]}),"Shortcuts"]})]})]})}var Wc={name:"dark",displayName:"Dark (Enhanced)",emoji:"\u{1F319}",colors:{bgPrimary:"#222326",bgSecondary:"#2A2B2F",bgTertiary:"#33343A",bgCard:"#2d2d2d",bgHover:"#353535",bgActive:"#404040",bgInput:"#2a2a2a",textPrimary:"#F4F5F8",textSecondary:"#AEB6C0",textTertiary:"#7A7F8A",textDisabled:"#606060",textInverse:"#1a1a1a",borderPrimary:"rgba(255, 255, 255, 0.1)",borderSecondary:"rgba(255, 255, 255, 0.05)",borderDefault:"#404040",borderHover:"#505050",borderSubtle:"#2a2a2a",accentPrimary:"#5E6AD2",accentHover:"#7780DD",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.1)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.2)",success:"#10B981",warning:"#F59E0B",error:"#EF4444",info:"#00E5CC",danger:"#ef4444",dangerBorder:"rgba(239, 68, 68, 0.3)",dangerBackground:"rgba(239, 68, 68, 0.1)",dangerBackgroundHover:"rgba(239, 68, 68, 0.2)"},shadows:{sm:"0 1px 2px rgba(0, 0, 0, 0.3)",md:"0 4px 12px rgba(0, 0, 0, 0.4)",lg:"0 12px 32px rgba(0, 0, 0, 0.5)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},zc={name:"light",displayName:"Light (Standard)",emoji:"\u2600\uFE0F",colors:{bgPrimary:"#FFFFFF",bgSecondary:"#F7F7F8",bgTertiary:"#EEEFF1",bgCard:"#ffffff",bgHover:"#f3f4f6",bgActive:"#e5e7eb",bgInput:"#f9fafb",textPrimary:"#1A1A1A",textSecondary:"#5A5A5A",textTertiary:"#8A8A8A",textDisabled:"#d1d5db",textInverse:"#ffffff",borderPrimary:"rgba(0, 0, 0, 0.1)",borderSecondary:"rgba(0, 0, 0, 0.05)",borderDefault:"#e5e7eb",borderHover:"#d1d5db",borderSubtle:"#f3f4f6",accentPrimary:"#5E6AD2",accentHover:"#4A56B8",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.08)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.15)",success:"#059669",warning:"#D97706",error:"#DC2626",info:"#00E5CC",danger:"#dc2626",dangerBorder:"rgba(220, 38, 38, 0.3)",dangerBackground:"rgba(220, 38, 38, 0.08)",dangerBackgroundHover:"rgba(220, 38, 38, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.12)",md:"0 4px 12px rgba(0, 0, 0, 0.15)",lg:"0 12px 32px rgba(0, 0, 0, 0.2)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Gc={name:"neutral",emoji:"\u26AA",displayName:"Neutral (Zen)",colors:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgTertiary:"#E7E5E4",bgCard:"#FEFEFE",bgHover:"#F0EFEE",bgActive:"#E7E5E4",bgInput:"#FAFAF9",textPrimary:"#1C1917",textSecondary:"#57534E",textTertiary:"#A8A29E",textDisabled:"#D6D3D1",textInverse:"#FAFAF9",borderPrimary:"#E7E5E4",borderSecondary:"#F0EFEE",borderDefault:"#E7E5E4",borderHover:"#D6D3D1",borderSubtle:"#F5F5F4",accentPrimary:"#292524",accentHover:"#44403C",interactivePrimary:"#292524",interactivePrimaryHover:"#44403C",interactivePrimaryBorder:"rgba(41, 37, 36, 0.3)",interactivePrimaryBackground:"rgba(41, 37, 36, 0.06)",interactivePrimaryBackgroundHover:"rgba(41, 37, 36, 0.12)",success:"#15803D",warning:"#CA8A04",error:"#B91C1C",info:"#1D4ED8",danger:"#B91C1C",dangerBorder:"rgba(185, 28, 28, 0.3)",dangerBackground:"rgba(185, 28, 28, 0.08)",dangerBackgroundHover:"rgba(185, 28, 28, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.1)",md:"0 4px 12px rgba(0, 0, 0, 0.12)",lg:"0 12px 32px rgba(0, 0, 0, 0.15)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},So={dark:Wc,light:zc,neutral:Gc},Vi="dark";var ji=createContext(void 0),Hx="asakaa-theme";function cm({children:e,defaultTheme:t=Vi,storageKey:r=Hx}){let[a,n]=useState(()=>{if(typeof window<"u"){let c=localStorage.getItem(r);if(c&&(c==="dark"||c==="light"||c==="neutral"))return c}return t}),s=useCallback(c=>{n(c),typeof window<"u"&&localStorage.setItem(r,c);},[r]);useEffect(()=>{if(typeof window>"u")return;let c=document.documentElement,l=So[a];Object.entries(l.colors).forEach(([d,u])=>{u&&c.style.setProperty(`--theme-${Ux(d)}`,u);}),Object.entries({bgPrimary:"--asakaa-color-background-primary",bgSecondary:"--asakaa-color-background-secondary",bgTertiary:"--asakaa-color-background-tertiary",bgCard:"--asakaa-color-background-card",bgHover:"--asakaa-color-background-hover",bgActive:"--asakaa-color-background-active",bgInput:"--asakaa-color-background-input",textPrimary:"--asakaa-color-text-primary",textSecondary:"--asakaa-color-text-secondary",textTertiary:"--asakaa-color-text-tertiary",textDisabled:"--asakaa-color-text-disabled",textInverse:"--asakaa-color-text-inverse",borderPrimary:"--asakaa-color-border-primary",borderSecondary:"--asakaa-color-border-secondary",borderDefault:"--asakaa-color-border-default",borderHover:"--asakaa-color-border-hover",borderSubtle:"--asakaa-color-border-subtle",accentPrimary:"--asakaa-color-accent-primary",accentHover:"--asakaa-color-accent-hover",interactivePrimary:"--asakaa-color-interactive-primary",interactivePrimaryHover:"--asakaa-color-interactive-primaryHover",interactivePrimaryBorder:"--asakaa-color-interactive-primaryBorder",interactivePrimaryBackground:"--asakaa-color-interactive-primaryBackground",interactivePrimaryBackgroundHover:"--asakaa-color-interactive-primaryBackgroundHover",success:"--asakaa-color-status-success",warning:"--asakaa-color-status-warning",error:"--asakaa-color-status-error",info:"--asakaa-color-status-info",danger:"--asakaa-color-danger",dangerBorder:"--asakaa-color-danger-border",dangerBackground:"--asakaa-color-danger-background",dangerBackgroundHover:"--asakaa-color-danger-backgroundHover"}).forEach(([d,u])=>{let p=l.colors[d];p&&c.style.setProperty(u,p);}),c.setAttribute("data-theme",a),c.classList.remove("theme-dark","theme-light","theme-neutral"),c.classList.add(`theme-${a}`);},[a]);let o={theme:a,setTheme:s,themes:So};return jsx(ji.Provider,{value:o,children:e})}function es(){let e=useContext(ji);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function Ux(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Vc({isOpen:e,onClose:t,className:r}){let{theme:a,setTheme:n}=es();return e?jsxs("div",{className:g("fixed inset-0 z-[9999] flex items-center justify-center",r),children:[jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:t}),jsxs("div",{className:"relative rounded-2xl border shadow-2xl max-w-md w-full mx-4",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[jsxs("div",{className:"px-6 py-5 border-b flex items-center justify-between",style:{borderColor:"var(--theme-border-primary)"},children:[jsx("h2",{className:"text-2xl font-bold",style:{color:"var(--theme-text-primary)"},children:"Select Theme"}),jsx("button",{onClick:t,className:"text-2xl leading-none p-2 hover:bg-white/10 rounded-lg transition-colors",style:{color:"var(--theme-text-secondary)"},"aria-label":"Close",children:"\xD7"})]}),jsx("div",{className:"p-6 space-y-3",children:Object.entries(So).map(([s,o])=>jsxs("button",{onClick:()=>{n(s),t();},className:g("w-full p-4 rounded-lg border-2 transition-all flex items-center gap-4",a===s?"border-[#00E5CC] bg-[#00E5CC]/20":"border-white/20 hover:border-white/40"),style:{backgroundColor:a===s?"var(--theme-accent-primary)20":"transparent"},children:[jsx("div",{className:"text-3xl",children:o.emoji}),jsxs("div",{className:"text-left flex-1",children:[jsx("div",{className:"font-semibold",style:{color:"var(--theme-text-primary)"},children:o.displayName}),jsxs("div",{className:"text-xs",style:{color:"var(--theme-text-secondary)"},children:[s==="dark"&&"Default dark theme with Linear-inspired colors",s==="light"&&"Clean light theme with high contrast",s==="neutral"&&"Monochrome zen theme"]})]}),a===s&&jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:jsx("path",{d:"M20 6L9 17l-5-5"})})]},s))})]})]}):null}var lt={dark:{bgPrimary:"#050505",bgSecondary:"#0A0A0A",bgGrid:"rgba(255, 255, 255, 0.02)",bgWeekend:"rgba(17, 17, 17, 0.4)",border:"rgba(255, 255, 255, 0.08)",borderLight:"rgba(255, 255, 255, 0.05)",textPrimary:"rgba(255, 255, 255, 0.92)",textSecondary:"rgba(255, 255, 255, 0.60)",textTertiary:"rgba(255, 255, 255, 0.35)",accent:"#00E5CC",accentHover:"#5AADFF",accentLight:"rgba(0, 229, 204, 0.12)",taskBarPrimary:"#00E5CC",taskBarProgress:"#5AADFF",taskBarHandle:"#FFFFFF",dependency:"#444444",dependencyHover:"#FFFFFF",criticalPath:"#EF4444",criticalPathLight:"rgba(239, 68, 68, 0.15)",today:"#EF4444",todayLight:"rgba(239, 68, 68, 0.08)",milestone:"#FFFFFF",milestoneLight:"rgba(255, 255, 255, 0.1)",statusTodo:"#666666",statusInProgress:"#00E5CC",statusCompleted:"#10B981",hoverBg:"rgba(255, 255, 255, 0.04)",focusRing:"#00E5CC",dotGrid:"rgba(255, 255, 255, 0.05)",glassHeader:"#0A0A0A",glassToolbar:"rgba(0, 0, 0, 0.4)",forecastHud:"rgba(15, 15, 15, 0.9)",neonRedGlow:"0 0 8px rgba(239, 68, 68, 0.25)",executionBarBg:"rgba(0, 229, 204, 0.12)"},light:{bgPrimary:"#FFFFFF",bgSecondary:"#F8FAFC",bgGrid:"#F1F5F9",bgWeekend:"rgba(0, 196, 174, 0.03)",border:"#CBD5E1",borderLight:"#E2E8F0",textPrimary:"#0F172A",textSecondary:"#334155",textTertiary:"#64748B",accent:"#00E5CC",accentHover:"#1D4ED8",accentLight:"rgba(0, 196, 174, 0.08)",taskBarPrimary:"#00E5CC",taskBarProgress:"#00A893",taskBarHandle:"#FFFFFF",dependency:"#6B7280",dependencyHover:"#00E5CC",criticalPath:"#DC2626",criticalPathLight:"rgba(220, 38, 38, 0.1)",today:"#D21E24",todayLight:"rgba(210, 30, 36, 0.1)",milestone:"#F59E0B",milestoneLight:"rgba(245, 158, 11, 0.08)",statusTodo:"#64748B",statusInProgress:"#00E5CC",statusCompleted:"#059669",hoverBg:"rgba(0, 0, 0, 0.04)",focusRing:"#00E5CC",dotGrid:"rgba(0, 0, 0, 0.04)",glassHeader:"#F8FAFC",glassToolbar:"rgba(255, 255, 255, 0.85)",forecastHud:"rgba(248, 250, 252, 0.95)",neonRedGlow:"0 0 10px rgba(220, 38, 38, 0.3)",executionBarBg:"rgba(0, 196, 174, 0.28)"},neutral:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgGrid:"#EFEDEC",bgWeekend:"rgba(41, 37, 36, 0.02)",border:"#D6D3D1",borderLight:"#E7E5E4",textPrimary:"#0C0A09",textSecondary:"#44403C",textTertiary:"#78716C",accent:"#292524",accentHover:"#44403C",accentLight:"rgba(41, 37, 36, 0.08)",taskBarPrimary:"#292524",taskBarProgress:"#1C1917",taskBarHandle:"#FFFFFF",dependency:"#78716C",dependencyHover:"#A8A29E",criticalPath:"#44403C",criticalPathLight:"rgba(68, 64, 60, 0.08)",today:"#1C1917",todayLight:"rgba(28, 25, 23, 0.06)",milestone:"#57534E",milestoneLight:"rgba(87, 83, 78, 0.08)",statusTodo:"#78716C",statusInProgress:"#292524",statusCompleted:"#15803D",hoverBg:"rgba(0, 0, 0, 0.035)",focusRing:"#292524",dotGrid:"rgba(0, 0, 0, 0.03)",glassHeader:"#F5F5F4",glassToolbar:"rgba(250, 250, 249, 0.85)",forecastHud:"rgba(245, 245, 244, 0.95)",neonRedGlow:"0 0 10px rgba(68, 64, 60, 0.3)",executionBarBg:"rgba(41, 37, 36, 0.25)"}};function dm(e="dark"){if(typeof window>"u"||typeof getComputedStyle>"u")return lt[e]||lt.dark;let t=document.documentElement,r=getComputedStyle(t),a=(s,o)=>r.getPropertyValue(s).trim()||o;return {bgPrimary:a("--theme-bg-primary",lt[e].bgPrimary),bgSecondary:a("--theme-bg-secondary",lt[e].bgSecondary),bgGrid:a("--theme-bg-card",lt[e].bgGrid),bgWeekend:a("--theme-bg-hover",lt[e].bgWeekend),border:a("--theme-border-primary",lt[e].border),borderLight:a("--theme-border-subtle",lt[e].borderLight),textPrimary:a("--theme-text-primary",lt[e].textPrimary),textSecondary:a("--theme-text-secondary",lt[e].textSecondary),textTertiary:a("--theme-text-tertiary",lt[e].textTertiary),accent:a("--theme-accent-primary",lt[e].accent),accentHover:a("--theme-accent-hover",lt[e].accentHover),accentLight:a("--theme-accent-primary",lt[e].accentLight),taskBarPrimary:a("--theme-accent-primary",lt[e].taskBarPrimary),taskBarProgress:a("--theme-accent-hover",lt[e].taskBarProgress),taskBarHandle:a("--theme-text-inverse",lt[e].taskBarHandle||"#FFFFFF"),dependency:a("--theme-border-secondary",lt[e].dependency),dependencyHover:a("--theme-border-secondary",lt[e].dependencyHover),criticalPath:a("--theme-error",lt[e].criticalPath),criticalPathLight:a("--theme-error",lt[e].criticalPathLight),today:e==="light"?a("--theme-accent-primary",lt[e].today):e==="neutral"?a("--theme-text-primary",lt[e].today):a("--theme-error",lt[e].today),todayLight:e==="light"?a("--theme-accent-primary",lt[e].todayLight):e==="neutral"?a("--theme-text-primary",lt[e].todayLight):a("--theme-error",lt[e].todayLight),milestone:a("--theme-warning",lt[e].milestone),milestoneLight:a("--theme-warning",lt[e].milestoneLight),statusTodo:a("--theme-text-tertiary",lt[e].statusTodo),statusInProgress:a("--theme-accent-primary",lt[e].statusInProgress),statusCompleted:a("--theme-success",lt[e].statusCompleted),hoverBg:a("--theme-bg-hover",lt[e].hoverBg),focusRing:a("--theme-accent-primary",lt[e].focusRing),...lt[e].dotGrid&&{dotGrid:lt[e].dotGrid},...lt[e].glassHeader&&{glassHeader:lt[e].glassHeader},...lt[e].glassToolbar&&{glassToolbar:lt[e].glassToolbar},...lt[e].forecastHud&&{forecastHud:lt[e].forecastHud},...lt[e].neonRedGlow&&{neonRedGlow:lt[e].neonRedGlow},...lt[e].executionBarBg&&{executionBarBg:lt[e].executionBarBg}}}var _i={columns:{taskName:"TASK NAME",startDate:"Start Date",endDate:"End Date",duration:"Duration",assignees:"Assignees",status:"Status",progress:"% Complete",priority:"Priority"},toolbar:{today:"Today",day:"Day",week:"Week",month:"Month",export:"Export",exportPdf:"Export to PDF",exportPng:"Export to PNG",exportCsv:"Export to CSV",exportExcel:"Export to Excel",exportMsProject:"Export to MS Project",undo:"Undo",redo:"Redo",createTask:"New Task",density:"Row Density",compact:"Compact",normal:"Normal",spacious:"Spacious",filterAll:"All",filterIncomplete:"Incomplete",filterInProgress:"In Progress",filterCompleted:"Completed",filter:"Filters",filterBy:"FILTER BY STATUS",filterAllDesc:"Show all tasks",filterIncompleteDesc:"Hide completed tasks",filterInProgressDesc:"Tasks currently being worked on",filterCompletedDesc:"Only show finished tasks",clearFilter:"Clear filter",hideCompleted:"Hide Completed Tasks",toDo:"To Do / Pending",wbsLevel:"Level",wbsAllLevels:"All",viewExecution:"Execution",viewOracle:"Pulse View",simulateScenario:"Simulate Scenario",projectForecast:"PROJECT FORECAST",expectedFinish:"Expected Finish",confidence:"Confidence",costAtCompletion:"Cost at Completion",delayLabel:"Delay",earlyLabel:"Early",onTimeLabel:"On Time",budgetOver:"Over",budgetUnder:"Under",baselines:"Baselines",visibility:"Visibility",share:"Share",copySnapshotLink:"Copy Snapshot Link",copied:"Copied!"},contextMenu:{editTask:"Edit Task",addSubtask:"Add Subtask",markIncomplete:"Mark Incomplete",setInProgress:"Set In Progress",markComplete:"Mark Complete",duplicateTask:"Duplicate Task",splitTask:"Split Task",deleteTask:"Delete Task"},actions:{edit:"Edit",delete:"Delete",duplicate:"Duplicate",addSubtask:"Add Subtask",indent:"Indent",outdent:"Outdent",moveUp:"Move Up",moveDown:"Move Down",splitTask:"Split Task",linkTasks:"Link Tasks",unlinkTasks:"Unlink Tasks"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},labels:{progress:"Progress",duration:"Duration",days:"days",day:"day",assigned:"Assigned",milestone:"Milestone",criticalPath:"Critical Path",subtask:"Subtask",task:"Task",noTasks:"No tasks yet",addTask:"Add task",newTask:"New Task",loading:"Loading...",error:"Error",today:"Today",week:"Week",clickToSetDates:"Click to set dates..."},ai:{placeholder:'Ask AI to edit tasks... (e.g., "Move Design to next week")',thinking:"Thinking...",suggestions:{moveTask:'Move "Task Name" to next Monday',extendTask:'Extend "Task Name" by 3 days',renameTask:'Rename "Old Name" to "New Name"',setProgress:'Set "Task Name" progress to 50%',linkTasks:'Link "Task A" to "Task B"',createTask:'Create a new task called "New Task"',deleteTask:'Delete "Task Name"',assignTask:'Assign John to "Task Name"'},errors:{taskNotFound:"Task not found",invalidDate:"Invalid date",invalidDuration:"Invalid duration",invalidProgress:"Invalid progress value",unknownCommand:"Unknown command",processingError:"Error processing command"}},export:{projectName:"Gantt Project",ganttTasks:"Gantt Tasks",taskId:"Task ID",taskName:"Task Name",startDate:"Start Date",endDate:"End Date",isMilestone:"Is Milestone",parentId:"Parent ID",yes:"Yes",no:"No",noTasksToExport:"No tasks available to export"},dateFormat:{short:"MM/dd",medium:"MMM d",long:"MMMM d, yyyy"}},um={columns:{taskName:"NOMBRE DE TAREA",startDate:"Fecha Inicio",endDate:"Fecha Fin",duration:"Duraci\xF3n",assignees:"Asignados",status:"Estado",progress:"% Completado",priority:"Prioridad"},toolbar:{today:"Hoy",day:"D\xEDa",week:"Semana",month:"Mes",export:"Exportar",exportPdf:"Exportar a PDF",exportPng:"Exportar a PNG",exportCsv:"Exportar a CSV",exportExcel:"Exportar a Excel",exportMsProject:"Exportar a MS Project",undo:"Deshacer",redo:"Rehacer",createTask:"Nueva Tarea",density:"Densidad",compact:"Compacto",normal:"Normal",spacious:"Espacioso",filterAll:"Todas",filterIncomplete:"Sin completar",filterInProgress:"En progreso",filterCompleted:"Completadas",filter:"Filtros",filterBy:"FILTRAR POR ESTADO",filterAllDesc:"Mostrar todas las tareas",filterIncompleteDesc:"Ocultar tareas completadas",filterInProgressDesc:"Tareas en las que se est\xE1 trabajando",filterCompletedDesc:"Solo mostrar tareas terminadas",clearFilter:"Limpiar filtro",hideCompleted:"Ocultar Tareas Completadas",toDo:"Por Hacer / Pendiente",wbsLevel:"Nivel",wbsAllLevels:"Todos",viewExecution:"Ejecuci\xF3n",viewOracle:"Vista Pulse",simulateScenario:"Simular Escenario",projectForecast:"PRON\xD3STICO DEL PROYECTO",expectedFinish:"Fin Estimado",confidence:"Confianza",costAtCompletion:"Costo al Completar",delayLabel:"Retraso",earlyLabel:"Adelanto",onTimeLabel:"A Tiempo",budgetOver:"Excedido",budgetUnder:"Bajo",baselines:"L\xEDneas Base",visibility:"Visibilidad",share:"Compartir",copySnapshotLink:"Copiar enlace de vista",copied:"\xA1Copiado!"},contextMenu:{editTask:"Editar Tarea",addSubtask:"Agregar Subtarea",markIncomplete:"Marcar Incompleta",setInProgress:"Marcar En Progreso",markComplete:"Marcar Completada",duplicateTask:"Duplicar Tarea",splitTask:"Dividir Tarea",deleteTask:"Eliminar Tarea"},actions:{edit:"Editar",delete:"Eliminar",duplicate:"Duplicar",addSubtask:"Agregar Subtarea",indent:"Aumentar Nivel",outdent:"Disminuir Nivel",moveUp:"Mover Arriba",moveDown:"Mover Abajo",splitTask:"Dividir Tarea",linkTasks:"Vincular Tareas",unlinkTasks:"Desvincular Tareas"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},labels:{progress:"Progreso",duration:"Duraci\xF3n",days:"d\xEDas",day:"d\xEDa",assigned:"Asignado",milestone:"Hito",criticalPath:"Ruta Cr\xEDtica",subtask:"Subtarea",task:"Tarea",noTasks:"Sin tareas a\xFAn",addTask:"Agregar tarea",newTask:"Nueva Tarea",loading:"Cargando...",error:"Error",today:"Hoy",week:"Semana",clickToSetDates:"Clic para establecer fechas..."},ai:{placeholder:'P\xEDdele a la IA que edite tareas... (ej: "Mover Dise\xF1o a la pr\xF3xima semana")',thinking:"Pensando...",suggestions:{moveTask:'Mover "Nombre de Tarea" al pr\xF3ximo lunes',extendTask:'Extender "Nombre de Tarea" por 3 d\xEDas',renameTask:'Renombrar "Nombre Anterior" a "Nombre Nuevo"',setProgress:'Establecer progreso de "Nombre de Tarea" al 50%',linkTasks:'Vincular "Tarea A" con "Tarea B"',createTask:'Crear una nueva tarea llamada "Nueva Tarea"',deleteTask:'Eliminar "Nombre de Tarea"',assignTask:'Asignar a Juan a "Nombre de Tarea"'},errors:{taskNotFound:"Tarea no encontrada",invalidDate:"Fecha inv\xE1lida",invalidDuration:"Duraci\xF3n inv\xE1lida",invalidProgress:"Valor de progreso inv\xE1lido",unknownCommand:"Comando desconocido",processingError:"Error procesando el comando"}},export:{projectName:"Proyecto Gantt",ganttTasks:"Tareas Gantt",taskId:"ID de Tarea",taskName:"Nombre de Tarea",startDate:"Fecha Inicio",endDate:"Fecha Fin",isMilestone:"Es Hito",parentId:"ID Padre",yes:"S\xED",no:"No",noTasksToExport:"No hay tareas disponibles para exportar"},dateFormat:{short:"dd/MM",medium:"d MMM",long:"d de MMMM de yyyy"}},jc={en:_i,es:um};function pm(e){return jc[e]||jc.en}function _c(e,t){let r=pm(e);return t?{columns:{...r.columns,...t.columns},toolbar:{...r.toolbar,...t.toolbar},contextMenu:{...r.contextMenu,...t.contextMenu},actions:{...r.actions,...t.actions},status:{...r.status,...t.status},labels:{...r.labels,...t.labels},ai:{...r.ai,...t.ai,suggestions:{...r.ai.suggestions,...t.ai?.suggestions},errors:{...r.ai.errors,...t.ai?.errors}},export:{...r.export,...t.export},dateFormat:{...r.dateFormat,...t.dateFormat}}:r}var rs=createContext(_i);function ja(){return useContext(rs)}function Gs(e,t,r="left",a=208){let[n,s]=useState({top:0,left:0});return useEffect(()=>{if(!t||!e.current)return;let o=e.current.getBoundingClientRect(),c=o.bottom+4,l;r==="right"?l=o.right-a:l=o.left;let i=8;l+a>window.innerWidth-i&&(l=window.innerWidth-i-a),l<i&&(l=i),s({top:c,left:l});},[t,r,e,a]),n}function wm({theme:e,onExportPNG:t,onExportPDF:r,onExportExcel:a,onExportCSV:n,onExportJSON:s,onExportMSProject:o}){let[c,l]=useState(false),[i,d]=useState(null),u=useRef(null),p=useRef(null),m=ja(),f=Gs(u,c,"right",176);if(useEffect(()=>{if(!c)return;let h=v=>{let w=v.target;u.current&&!u.current.contains(w)&&p.current&&!p.current.contains(w)&&l(false);};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[c]),!(t||r||a||n||s||o))return null;let y=[{id:"png",label:"PNG",description:"Image",icon:jsx(FileImage,{className:"w-4 h-4"}),handler:t},{id:"pdf",label:"PDF",description:"Document",icon:jsx(FileText,{className:"w-4 h-4"}),handler:r},{id:"excel",label:"Excel",description:"Spreadsheet",icon:jsx(FileSpreadsheet,{className:"w-4 h-4"}),handler:a},{id:"csv",label:"CSV",description:"Comma-separated",icon:jsx(FileText,{className:"w-4 h-4"}),handler:n},{id:"json",label:"JSON",description:"Data",icon:jsx(FileJson,{className:"w-4 h-4"}),handler:s},{id:"msproject",label:"MS Project",description:"XML",icon:jsx(FolderKanban,{className:"w-4 h-4"}),handler:o}].filter(h=>h.handler),b=async(h,v)=>{if(v){d(h);try{await v();}catch(w){console.error(`Export ${h} failed:`,w);}finally{d(null),l(false);}}};return jsxs(Fragment,{children:[jsxs(motion.button,{ref:u,onClick:()=>l(!c),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{backgroundColor:c?e.accent:e.bgSecondary,border:`1px solid ${c?e.accent:e.borderLight}`,color:c?"#FFFFFF":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{scale:1.02,backgroundColor:e.accent,color:"#FFFFFF"},whileTap:{scale:.98},children:[jsx(Download,{className:"w-3.5 h-3.5"}),jsx("span",{children:m.toolbar.export}),jsx(ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:c?"rotate(180deg)":"rotate(0deg)"}})]}),createPortal(jsx(AnimatePresence,{children:c&&jsx(motion.div,{ref:p,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-44 rounded-xl overflow-hidden",style:{top:f.top,left:f.left,zIndex:99999,backgroundColor:e.bgPrimary==="#050505"?"rgba(10, 10, 10, 0.95)":e.bgSecondary,border:`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.08)":e.border}`,boxShadow:e.bgPrimary==="#050505"?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:jsx("div",{className:"py-1",children:y.map((h,v)=>jsxs(motion.button,{onClick:()=>b(h.id,h.handler),disabled:i!==null,className:"w-full flex items-center gap-2.5 px-3 py-2 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:v<y.length-1?`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.borderLight}`:"none",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:v*.03},children:[jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md",style:{backgroundColor:e.accentLight,color:e.accent},children:i===h.id?jsx(motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsx(Download,{className:"w-3.5 h-3.5"})}):h.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"text-[11px] font-medium truncate",style:{color:e.textPrimary},children:h.label}),jsx("div",{className:"text-[9px] truncate",style:{color:e.textTertiary},children:h.description})]})]},h.id))})})}),document.body)]})}function gm({theme:e,onExportPNG:t,onExportPDF:r,onExportExcel:a,onExportMSProject:n,onCopySnapshotLink:s}){let[o,c]=useState(false),[l,i]=useState(null),[d,u]=useState(false),p=useRef(null),m=useRef(null),f=ja(),x=Gs(p,o,"right",224),y=e.bgPrimary==="#050505"||(e.bgPrimary||"").charAt(1)==="0",b=f.toolbar.visibility==="Visibilidad";useEffect(()=>{if(!o)return;let C=S=>{let F=S.target;p.current&&!p.current.contains(F)&&m.current&&!m.current.contains(F)&&c(false);};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[o]);let h=[{id:"png",label:f.toolbar.exportPng,icon:jsx(FileImage,{className:"w-3.5 h-3.5"}),handler:t},{id:"pdf",label:f.toolbar.exportPdf,icon:jsx(FileText,{className:"w-3.5 h-3.5"}),handler:r},{id:"excel",label:f.toolbar.exportExcel,icon:jsx(FileSpreadsheet,{className:"w-3.5 h-3.5"}),handler:a},{id:"msproject",label:f.toolbar.exportMsProject,icon:jsx(FolderKanban,{className:"w-3.5 h-3.5"}),handler:n}].filter(C=>C.handler),v=async(C,S)=>{if(S){i(C);try{await S();}catch(F){console.error(`Export ${C} failed:`,F);}finally{i(null),c(false);}}},w=()=>{s?.(),u(true),setTimeout(()=>u(false),2e3);};return jsxs(Fragment,{children:[jsx(motion.button,{ref:p,onClick:()=>c(!o),className:"flex items-center justify-center w-8 h-8 rounded-lg",style:{color:o?e.accent:e.textTertiary,backgroundColor:o?e.accentLight:"transparent"},whileHover:{color:e.textPrimary,backgroundColor:e.hoverBg},title:f.toolbar.share,children:jsx(Share2,{className:"w-4 h-4"})}),createPortal(jsx(AnimatePresence,{children:o&&jsxs(motion.div,{ref:m,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-56 rounded-xl overflow-hidden",style:{top:x.top,left:x.left,zIndex:99999,backgroundColor:y?"rgba(10, 10, 10, 0.95)":e.bgSecondary||"#F8FAFC",border:`1px solid ${y?"rgba(255,255,255,0.08)":e.border||"#CBD5E1"}`,boxShadow:y?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[h.length>0&&jsxs(Fragment,{children:[jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:y?"rgba(255,255,255,0.35)":e.textTertiary},children:b?"EXPORTAR":"EXPORT"})}),jsx("div",{className:"py-0.5",children:h.map((C,S)=>jsxs(motion.button,{onClick:()=>v(C.id,C.handler),disabled:l!==null,className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:y?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:S*.03},children:[jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md flex-shrink-0",style:{backgroundColor:e.accentLight,color:e.accent},children:l===C.id?jsx(motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsx(Download,{className:"w-3.5 h-3.5"})}):C.icon}),jsx("span",{className:"flex-1 text-left",children:C.label})]},C.id))})]}),h.length>0&&s&&jsx("div",{className:"mx-3 h-px",style:{backgroundColor:y?"rgba(255,255,255,0.06)":e.borderLight}}),s&&jsxs(Fragment,{children:[jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:y?"rgba(255,255,255,0.35)":e.textTertiary},children:b?"COMPARTIR":"SHARE"})}),jsx("div",{className:"py-0.5 pb-1.5",children:jsxs(motion.button,{onClick:w,className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:y?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:h.length*.03},children:[jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md flex-shrink-0",style:{backgroundColor:d?"rgba(34,197,94,0.15)":e.accentLight,color:d?"#22C55E":e.accent},children:d?jsx(Check,{className:"w-3.5 h-3.5"}):jsx(Link2,{className:"w-3.5 h-3.5"})}),jsx("span",{className:"flex-1 text-left",children:d?f.toolbar.copied:f.toolbar.copySnapshotLink})]})})]})]})}),document.body)]})}function lv({options:e,value:t,onChange:r,theme:a,layoutId:n="activeSegment"}){return jsx("div",{className:"inline-flex p-1 rounded-lg relative",style:{backgroundColor:a.bgSecondary,border:`1px solid ${a.borderLight}`},children:e.map(s=>{let o=t===s.value;return jsxs(motion.button,{onClick:()=>r(s.value),className:"relative px-3 py-1.5 rounded-md text-[11px] transition-all flex items-center gap-1.5 min-w-[70px] justify-center",style:{color:o?a.textPrimary:a.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:o?600:500,zIndex:o?2:1},whileHover:{scale:1.02},whileTap:{scale:.98},children:[o&&jsx(motion.div,{layoutId:n,className:"absolute inset-0 rounded-md",style:{backgroundColor:a.accent,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},transition:{type:"spring",stiffness:400,damping:30}}),s.icon&&jsx("span",{className:"relative z-10",style:{color:o?"#FFFFFF":a.textTertiary},children:s.icon}),jsx("span",{className:"relative z-10",style:{color:o?"#FFFFFF":a.textTertiary},children:s.label})]},s.value)})})}function cv({options:e,value:t,onChange:r,theme:a}){return jsx("div",{className:"inline-flex items-center gap-1",children:e.map(n=>{let s=t===n.value;return jsxs(motion.button,{onClick:()=>r(n.value),className:"relative px-3 py-1.5 text-[11px] transition-all",style:{color:s?a.accent:a.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:s?600:500},whileHover:{color:s?a.accent:a.textSecondary},whileTap:{scale:.98},children:[jsx("span",{children:n.label}),s&&jsx(motion.div,{layoutId:"timeScaleUnderline",className:"absolute bottom-0 left-1 right-1 h-0.5 rounded-full",style:{backgroundColor:a.accent},transition:{type:"spring",stiffness:400,damping:30}})]},n.value)})})}function fm({theme:e,value:t,onChange:r,maxDepth:a}){let[n,s]=useState(false),o=useRef(null),c=useRef(null),l=ja(),i=Gs(o,n,"left");useEffect(()=>{if(!n)return;let p=m=>{let f=m.target;o.current&&!o.current.contains(f)&&c.current&&!c.current.contains(f)&&s(false);};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[n]);let d=[{value:"all",label:l.toolbar.wbsAllLevels||"All"},...Array.from({length:Math.min(a,5)},(p,m)=>({value:m+1,label:`L${m+1}`}))],u=t==="all"?l.toolbar.wbsAllLevels||"All":`L${t}`;return jsxs(Fragment,{children:[jsxs(motion.button,{ref:o,onClick:()=>s(!n),className:"flex items-center gap-1.5 px-2 py-1.5 rounded-lg transition-all",style:{backgroundColor:n?e.accentLight:e.bgSecondary,border:`1px solid ${n?e.accent:e.borderLight}`,color:n?e.accent:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.02},whileTap:{scale:.98},title:`${l.toolbar.wbsLevel||"Level"}: ${u}`,children:[jsx(Layers,{className:"w-3.5 h-3.5"}),jsx("span",{className:"text-[11px] font-medium",style:{fontFamily:"'JetBrains Mono', monospace"},children:u})]}),createPortal(jsx(AnimatePresence,{children:n&&jsx(motion.div,{ref:c,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-24 rounded-xl overflow-hidden",style:{top:i.top,left:i.left,zIndex:99999,backgroundColor:e.bgPrimary==="#050505"?"rgba(10, 10, 10, 0.95)":e.bgSecondary,border:`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.08)":e.border}`,boxShadow:e.bgPrimary==="#050505"?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:jsx("div",{className:"py-1",children:d.map((p,m)=>{let f=t===p.value;return jsxs(motion.button,{onClick:()=>{r(p.value),s(false);},className:"w-full flex items-center justify-between px-3 py-2 text-left transition-all",style:{backgroundColor:f?e.accentLight:"transparent",borderBottom:m<d.length-1?`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.borderLight}`:"none"},whileHover:{backgroundColor:f?e.accentLight:e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:m*.03},children:[jsx("span",{className:"text-[11px]",style:{color:f?e.accent:e.textPrimary,fontFamily:"'JetBrains Mono', monospace",fontWeight:f?600:500},children:p.label}),f&&jsx(Check,{className:"w-3.5 h-3.5",style:{color:e.accent}})]},String(p.value))})})})}),document.body)]})}function bm({theme:e,value:t,onChange:r,hideCompleted:a=false,onHideCompletedChange:n}){let[s,o]=useState(false),c=useRef(null),l=useRef(null),i=ja(),d=Gs(c,s,"left");useEffect(()=>{if(!s)return;let f=setTimeout(()=>{let x=b=>{let h=b.target;c.current&&!c.current.contains(h)&&l.current&&!l.current.contains(h)&&o(false);},y=b=>{b.key==="Escape"&&o(false);};document.addEventListener("mousedown",x),document.addEventListener("keydown",y),l._cleanup=()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",y);};},100);return ()=>{clearTimeout(f),l._cleanup&&l._cleanup();}},[s]);let u=[{value:"all",label:i.toolbar.filterAll||"Show All",icon:jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-[#00E5CC] bg-[#00E5CC]"}),color:"text-[#00E5CC]"},{value:"completed",label:i.toolbar.filterCompleted||"Completed",icon:jsx(CheckCircle2,{className:"w-3.5 h-3.5"}),color:"text-green-500"},{value:"in_progress",label:i.toolbar.filterInProgress||"In Progress",icon:jsx(PlayCircle,{className:"w-3.5 h-3.5"}),color:"text-[#00E5CC]"},{value:"incomplete",label:i.toolbar.toDo||"To Do / Pending",icon:jsx(Circle,{className:"w-3.5 h-3.5"}),color:"text-gray-400"}],p=t!=="all"||a,m=e.bgPrimary==="#0F1117"||e.bgPrimary==="#0a0a0a"||e.bgPrimary==="#050505"||e.textPrimary==="#FFFFFF";return jsxs(Fragment,{children:[jsxs(motion.button,{ref:c,onClick:f=>{f.stopPropagation(),o(x=>!x);},className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{backgroundColor:p?m?"rgba(0, 229, 204, 0.2)":"rgb(239 246 255)":s?e.hoverBg:e.bgSecondary,border:`1px solid ${p?m?"rgba(0, 229, 204, 0.5)":"rgb(191 219 254)":e.borderLight}`,color:p?"#00E5CC":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{backgroundColor:e.hoverBg,scale:1.02},whileTap:{scale:.98},children:[jsx(Filter,{className:"w-4 h-4"}),jsx("span",{children:i.toolbar.filter||"Filters"}),p&&jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:"#00E5CC"}})]}),createPortal(jsx(AnimatePresence,{children:s&&jsxs(motion.div,{ref:l,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-56 rounded-xl overflow-hidden",style:{top:d.top,left:d.left,zIndex:99999,backgroundColor:m?"rgba(10, 10, 10, 0.95)":"#FFFFFF",border:`1px solid ${m?"rgba(255,255,255,0.08)":"rgb(229 231 235)"}`,boxShadow:m?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[jsx("div",{className:"px-3 py-2 border-b",style:{borderColor:m?"rgba(255,255,255,0.06)":"rgb(229 231 235)"},children:jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:m?"rgba(255,255,255,0.35)":"#9CA3AF",fontFamily:"Inter, sans-serif"},children:i.toolbar.filterBy||"FILTER BY STATUS"})}),jsx("div",{className:"py-1",children:u.map(f=>{let x=t===f.value&&!a,y=()=>f.value==="all"?x?jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-[#00E5CC] bg-[#00E5CC]"}):jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-gray-400"}):f.icon;return jsxs(motion.button,{onClick:()=>{r(f.value),n&&n(false),o(false);},className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{backgroundColor:x?m?"rgba(255,255,255,0.05)":"rgb(249 250 251)":"transparent",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:m?"rgba(255,255,255,0.06)":"rgb(243 244 246)"},children:[jsx("span",{className:`${x?f.color:"text-gray-400"} flex-shrink-0`,children:y()}),jsx("span",{className:"flex-1 text-left whitespace-nowrap font-medium",style:{color:m?"rgba(255,255,255,0.85)":"#111827"},children:f.label}),x&&jsx(Check,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"#00E5CC"}})]},f.value)})}),jsx("div",{className:"mx-3 h-px",style:{backgroundColor:m?"rgba(255,255,255,0.06)":"rgb(229 231 235)"}}),n&&jsx("div",{className:"py-1",children:jsxs(motion.button,{onClick:()=>{n(!a),a||r("all"),o(false);},className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{backgroundColor:a?m?"rgba(255,255,255,0.05)":"rgb(249 250 251)":"transparent",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:m?"rgba(255,255,255,0.06)":"rgb(243 244 246)"},children:[jsx(EyeOff,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:a?"#00E5CC":m?"rgba(255,255,255,0.35)":"#9CA3AF"}}),jsx("span",{className:"flex-1 text-left whitespace-nowrap font-medium",style:{color:m?"rgba(255,255,255,0.85)":"#111827"},children:i.toolbar.hideCompleted||"Hide Completed Tasks"}),a&&jsx(Check,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"#00E5CC"}})]})})]})}),document.body)]})}function dv({value:e,onChange:t,theme:r}){let a=ja(),n=r.bgPrimary==="#050505"||r.textPrimary==="#FFFFFF",s=[{value:"day",label:a.toolbar.day.charAt(0).toUpperCase()},{value:"week",label:a.toolbar.week.charAt(0).toUpperCase()},{value:"month",label:a.toolbar.month.charAt(0).toUpperCase()}];return jsx("div",{className:"inline-flex items-center rounded-full p-0.5",style:{backgroundColor:n?"#000000":r.bgSecondary,border:`1px solid ${n?"rgba(255,255,255,0.1)":r.border}`},children:s.map(o=>{let c=e===o.value;return jsx(motion.button,{onClick:()=>t(o.value),className:"relative px-3 py-1 text-[11px] font-medium rounded-full transition-colors",style:{color:c?n?"#FFFFFF":r.textPrimary:r.textTertiary,fontFamily:"Inter, sans-serif",backgroundColor:c?n?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)":"transparent"},whileHover:{color:n?"#FFFFFF":r.textPrimary},whileTap:{scale:.95},children:o.label},o.value)})})}function uv({theme:e,forecast:t}){let r=ja(),a=e.bgPrimary==="#050505"||e.textPrimary==="#FFFFFF",n=t?.expectedFinish?t.expectedFinish.toLocaleDateString(void 0,{month:"short",day:"numeric"}):"\u2014",s=t?.delayDays,o=s!=null,c=s!=null?s>0?`+${s}d ${r.toolbar.delayLabel}`:s<0?`${s}d ${r.toolbar.earlyLabel}`:r.toolbar.onTimeLabel:null,l=s!=null&&s>0?{bg:a?"rgba(239,68,68,0.15)":"rgba(220,38,38,0.1)",text:a?"#EF4444":"#DC2626"}:s!=null&&s<0?{bg:a?"rgba(34,197,94,0.15)":"rgba(22,163,74,0.1)",text:a?"#22C55E":"#16A34A"}:{bg:a?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",text:e.textTertiary},i=t?.confidencePercent,d=i!=null?i>=75?"#22C55E":i>=40?"#F59E0B":"#EF4444":e.textTertiary,u=t?.costAtCompletion,p=t?.currency||"$",m=u!=null?u>=1e6?`${p}${(u/1e6).toFixed(2)}M`:u>=1e3?`${p}${(u/1e3).toFixed(1)}K`:`${p}${u.toFixed(0)}`:"\u2014",f=t?.budgetVariancePercent,x=f!=null&&f!==0,y=f!=null?f>0?`+${f.toFixed(0)}% ${r.toolbar.budgetOver}`:`${f.toFixed(0)}% ${r.toolbar.budgetUnder}`:null,b=f!=null&&f>0?{bg:a?"rgba(239,68,68,0.15)":"rgba(220,38,38,0.1)",text:a?"#EF4444":"#DC2626"}:f!=null&&f<0?{bg:a?"rgba(34,197,94,0.15)":"rgba(22,163,74,0.1)",text:a?"#22C55E":"#16A34A"}:{bg:"transparent",text:e.textTertiary};return jsxs("div",{className:"h-12 px-4 flex items-center justify-between border-b",style:{backgroundColor:e.forecastHud||(a?"rgba(15,15,15,0.9)":"rgba(248,250,252,0.95)"),borderColor:e.borderLight,backdropFilter:"blur(12px)"},children:[jsxs("div",{className:"flex items-center gap-6",children:[jsx("span",{className:"text-[9px] uppercase tracking-[0.15em]",style:{color:e.textTertiary,fontFamily:"'JetBrains Mono', monospace",fontWeight:500},children:r.toolbar.projectForecast}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-[13px] font-semibold",style:{color:e.textPrimary,fontFamily:"Inter, sans-serif"},children:[r.toolbar.expectedFinish,": ",n]}),o&&c&&jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:l.bg,color:l.text,fontFamily:"'JetBrains Mono', monospace"},children:c})]})]}),jsxs("div",{className:"flex items-center gap-6",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-[11px]",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif"},children:[r.toolbar.confidence,":"]}),jsx("span",{className:"text-[13px] font-semibold",style:{color:d,fontFamily:"'JetBrains Mono', monospace"},children:i!=null?`${i.toFixed(0)}%`:"\u2014"})]}),jsx("div",{className:"w-px h-5",style:{backgroundColor:a?"rgba(255,255,255,0.08)":e.borderLight}}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-[11px]",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif"},children:[r.toolbar.costAtCompletion,":"]}),jsx("span",{className:"text-[13px] font-bold",style:{color:e.textPrimary,fontFamily:"'JetBrains Mono', monospace"},children:m}),x&&y&&jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:b.bg,color:b.text,fontFamily:"'JetBrains Mono', monospace"},children:y})]})]})]})}function pv({theme:e,showCriticalPath:t,onShowCriticalPathChange:r,showBaseline:a,onShowBaselineChange:n,highlightWeekends:s,onHighlightWeekendsChange:o,showDependencies:c,onShowDependenciesChange:l,rowDensity:i,onRowDensityChange:d,hasDependencies:u=true}){let[p,m]=useState(false),f=useRef(null),x=useRef(null),y=ja(),b=Gs(f,p,"right",208),h=e.bgPrimary==="#050505"||(e.bgPrimary||"").charAt(1)==="0";useEffect(()=>{if(!p)return;let S=F=>{let k=F.target;f.current&&!f.current.contains(k)&&x.current&&!x.current.contains(k)&&m(false);};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[p]);let v=y.toolbar.visibility==="Visibilidad",w=[{key:"criticalPath",label:v?"Ruta Cr\xEDtica":"Critical Path",icon:Zap,active:t,onChange:r,disabled:!u,tooltip:u?void 0:v?"Agrega dependencias entre tareas para ver la ruta cr\xEDtica":"Add dependencies between tasks to see the critical path"},{key:"baselines",label:v?"L\xEDneas Base":"Baselines",icon:Layers,active:a,onChange:n},{key:"weekends",label:v?"Fines de Semana":"Weekends",icon:CalendarDays,active:s,onChange:o},{key:"dependencies",label:v?"Dependencias":"Dependencies",icon:GitBranch,active:c,onChange:l}],C=[{value:"compact",label:y.toolbar.visibility==="Visibilidad"?"Compacto":"Compact"},{value:"comfortable",label:"Normal"},{value:"spacious",label:y.toolbar.visibility==="Visibilidad"?"Amplio":"Spacious"}];return jsxs(Fragment,{children:[jsx(motion.button,{ref:f,onClick:()=>m(!p),className:"flex items-center justify-center w-8 h-8 rounded-lg",style:{color:p?e.accent:e.textTertiary,backgroundColor:p?e.accentLight:"transparent"},whileHover:{color:e.textPrimary,backgroundColor:e.hoverBg},title:y.toolbar.visibility,children:jsx(Eye,{className:"w-4 h-4"})}),createPortal(jsx(AnimatePresence,{children:p&&jsxs(motion.div,{ref:x,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-52 rounded-xl overflow-hidden",style:{top:b.top,left:b.left,zIndex:99999,backgroundColor:h?"rgba(10, 10, 10, 0.95)":e.bgSecondary||"#F8FAFC",border:`1px solid ${h?"rgba(255,255,255,0.08)":e.border||"#CBD5E1"}`,boxShadow:h?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:h?"rgba(255,255,255,0.35)":e.textTertiary},children:y.toolbar.visibility==="Visibilidad"?"OPCIONES DE VISTA":"DISPLAY OPTIONS"})}),jsx("div",{className:"py-0.5",children:w.map((S,F)=>{let k=S.icon,N=S.disabled,P=S.tooltip;return jsxs(motion.button,{onClick:()=>!N&&S.onChange?.(!S.active),className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:N?h?"rgba(255,255,255,0.3)":"#9CA3AF":h?"rgba(255,255,255,0.85)":"#111827",cursor:N?"not-allowed":"pointer"},whileHover:N?{}:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:F*.03},title:P,children:[jsx(k,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:N?h?"rgba(255,255,255,0.2)":"#D1D5DB":S.active?e.accent||"#00E5CC":e.textTertiary}}),jsx("span",{className:"flex-1 text-left",children:S.label}),S.active&&!N&&jsx(Check,{className:"w-3.5 h-3.5",style:{color:e.accent||"#00E5CC"}})]},S.key)})}),jsx("div",{className:"mx-3 h-px",style:{backgroundColor:h?"rgba(255,255,255,0.06)":e.borderLight}}),jsxs("div",{className:"py-0.5",children:[jsx("div",{className:"px-3 pt-2 pb-1",children:jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:h?"rgba(255,255,255,0.35)":e.textTertiary},children:y.toolbar.visibility==="Visibilidad"?"DENSIDAD":"DENSITY"})}),C.map((S,F)=>{let k=i===S.value;return jsxs(motion.button,{onClick:()=>d(S.value),className:"w-full flex items-center justify-between px-3 py-2 text-[11px] transition-colors",style:{color:h?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:(w.length+F)*.03},children:[jsx("span",{style:{color:k?e.accent||"#00E5CC":h?"rgba(255,255,255,0.85)":e.textPrimary},children:S.label}),k&&jsx(Check,{className:"w-3.5 h-3.5",style:{color:e.accent||"#00E5CC"}})]},S.value)})]})]})}),document.body)]})}function Ki({theme:e,timeScale:t,onTimeScaleChange:r,zoom:a,onZoomChange:n,currentTheme:s,onThemeChange:o,rowDensity:c,onRowDensityChange:l,showThemeSelector:i=false,showCreateTaskButton:d=false,createTaskLabel:u,onCreateTask:p,taskFilter:m="all",onTaskFilterChange:f,hideCompleted:x=false,onHideCompletedChange:y,toolbarRightContent:b,wbsLevel:h,onWbsLevelChange:v,maxWbsDepth:w=4,viewMode:C="execution",onViewModeChange:S,projectForecast:F,hideForecastHud:k,onExportPNG:N,onExportPDF:P,onExportExcel:T,onExportCSV:Y,onExportJSON:H,onExportMSProject:ee,showCriticalPath:I=true,onShowCriticalPathChange:K,showDependencies:j=true,onShowDependenciesChange:W,highlightWeekends:$=true,onHighlightWeekendsChange:ve,showBaseline:We=false,onShowBaselineChange:Pe,onCopySnapshotLink:be,hasDependencies:ye=true}){let fe=ja(),ze=N||P||T||Y||H||ee,Ce=!!e.glassToolbar,Ae=[{value:"day",label:fe.toolbar.day},{value:"week",label:fe.toolbar.week},{value:"month",label:fe.toolbar.month}],Me=[{value:"dark",label:"Dark",icon:jsx(Moon,{className:"w-3.5 h-3.5"})},{value:"light",label:"Light",icon:jsx(Sun,{className:"w-3.5 h-3.5"})},{value:"neutral",label:"Zen",icon:jsx(Palette,{className:"w-3.5 h-3.5"})}],qe=e.bgPrimary==="#050505"||e.textPrimary==="#FFFFFF";if(Ce){let de=qe?"rgba(255,255,255,0.08)":e.borderLight;return jsxs("div",{className:"flex flex-col",children:[jsxs("div",{className:"h-[52px] px-4 flex items-center justify-between border-b",style:{backgroundColor:e.glassToolbar,borderColor:e.borderLight,backdropFilter:"blur(12px)"},children:[jsx("div",{className:"flex items-center gap-3",children:S&&jsxs("div",{className:"inline-flex items-center rounded-full p-0.5",style:{backgroundColor:qe?"#000000":e.bgSecondary,border:`1px solid ${qe?"rgba(255,255,255,0.08)":e.border}`},children:[jsx(motion.button,{onClick:()=>S("execution"),className:"px-3 py-1.5 rounded-full text-[11px] font-medium transition-colors",style:{backgroundColor:C==="execution"?qe?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)":"transparent",color:C==="execution"?e.textPrimary:e.textTertiary,fontFamily:"Inter, sans-serif"},whileHover:C!=="execution"?{color:e.textSecondary}:{},children:fe.toolbar.viewExecution}),jsx(motion.button,{onClick:()=>S("oracle"),className:"px-3 py-1.5 rounded-full text-[11px] font-medium transition-colors",style:{backgroundColor:C==="oracle"?qe?"rgba(0, 229, 204,0.15)":"rgba(0, 196, 174,0.08)":"transparent",color:C==="oracle"?"#00E5CC":e.textTertiary,fontFamily:"Inter, sans-serif"},whileHover:C!=="oracle"?{color:e.textSecondary}:{},children:fe.toolbar.viewOracle})]})}),jsxs("div",{className:"flex items-center gap-3",children:[jsx(dv,{value:t,onChange:r,theme:e}),jsx("div",{className:"w-px h-5",style:{backgroundColor:de}}),v&&jsx(fm,{theme:e,value:h??"all",onChange:v,maxDepth:w}),f&&jsx(bm,{theme:e,value:m,onChange:f,hideCompleted:x,onHideCompletedChange:y}),b&&jsxs(Fragment,{children:[jsx("div",{className:"w-px h-5",style:{backgroundColor:de}}),b]}),jsx("div",{className:"w-px h-5",style:{backgroundColor:de}}),jsx(pv,{theme:e,showCriticalPath:I,onShowCriticalPathChange:K,showBaseline:We,onShowBaselineChange:Pe,highlightWeekends:$,onHighlightWeekendsChange:ve,showDependencies:j,onShowDependenciesChange:W,rowDensity:c,onRowDensityChange:l,hasDependencies:ye}),jsx(gm,{theme:e,onExportPNG:N,onExportPDF:P,onExportExcel:T,onExportMSProject:ee,onCopySnapshotLink:be}),d&&p&&jsxs(motion.button,{onClick:p,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px]",style:{background:`linear-gradient(135deg, ${e.accent} 0%, ${e.accentHover} 100%)`,color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:`0 2px 8px ${qe?"rgba(0, 229, 204,0.3)":"rgba(0, 196, 174,0.3)"}`},whileHover:{scale:1.02,boxShadow:`0 4px 12px ${qe?"rgba(0, 229, 204,0.4)":"rgba(0, 196, 174,0.4)"}`},whileTap:{scale:.98},children:[jsx(Plus,{className:"w-3.5 h-3.5"}),jsx("span",{children:u||fe.toolbar.createTask})]})]})]}),F&&!k&&jsx(uv,{theme:e,forecast:F})]})}return jsxs("div",{className:"h-12 px-4 flex items-center justify-between border-b",style:{backgroundColor:e.bgGrid,borderColor:e.border},children:[jsxs("div",{className:"flex items-center gap-3",children:[jsx(cv,{options:Ae,value:t,onChange:de=>r(de),theme:e}),jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),jsxs("div",{className:"flex items-center gap-1",children:[jsx(motion.button,{onClick:()=>n(Math.max(.5,a-.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:"transparent",color:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsx(ZoomOut,{className:"w-3.5 h-3.5"})}),jsxs("div",{className:"px-2 py-0.5 rounded text-[11px] tabular-nums min-w-[42px] text-center",style:{color:e.textSecondary,fontFamily:"'JetBrains Mono', monospace",fontWeight:500},children:[Math.round(a*100),"%"]}),jsx(motion.button,{onClick:()=>n(Math.min(2,a+.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:"transparent",color:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsx(ZoomIn,{className:"w-3.5 h-3.5"})})]}),jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),v&&jsx(fm,{theme:e,value:h??"all",onChange:v,maxDepth:w}),f&&jsxs(Fragment,{children:[jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),jsx(bm,{theme:e,value:m,onChange:f,hideCompleted:x,onHideCompletedChange:y})]})]}),jsxs("div",{className:"flex items-center gap-3",children:[b&&jsxs(Fragment,{children:[b,jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}})]}),d&&p&&jsxs(Fragment,{children:[jsxs(motion.button,{onClick:p,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{background:"linear-gradient(135deg, #00E5CC 0%, #00E5CC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 229, 204, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 229, 204, 0.4)"},whileTap:{scale:.98},children:[jsx(Plus,{className:"w-3.5 h-3.5"}),jsx("span",{children:u||fe.toolbar.createTask})]}),(ze||i)&&jsx("div",{className:"w-px h-6",style:{backgroundColor:e.borderLight}})]}),jsx(gm,{theme:e,onExportPNG:N,onExportPDF:P,onExportExcel:T,onExportMSProject:ee,onCopySnapshotLink:be}),i&&jsx("div",{className:"w-px h-6",style:{backgroundColor:e.borderLight}}),i&&jsx(lv,{options:Me,value:s,onChange:de=>o(de),theme:e})]})]})}function qi({columns:e,onToggleColumn:t,theme:r}){let[a,n]=useState(false),[s,o]=useState({x:0,y:0}),c=useRef(null),l=useRef(null);useEffect(()=>{if(!a)return;let d=u=>{c.current&&!c.current.contains(u.target)&&n(false);};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[a]);let i=e.filter(d=>d.id!=="name");return jsxs(Fragment,{children:[jsx(motion.button,{ref:l,onClick:()=>{if(!a&&l.current){let d=l.current.getBoundingClientRect();o({x:d.left,y:d.bottom+4});}n(!a);},className:"p-2 rounded-md transition-colors flex items-center gap-1",style:{backgroundColor:r.bgSecondary,border:`1px solid ${r.borderLight}`,color:r.textSecondary},whileHover:{backgroundColor:r.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsx(Plus,{className:"w-4 h-4"})}),jsx(AnimatePresence,{children:a&&jsx(lr,{children:jsx(motion.div,{ref:c,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15},className:"column-manager-menu fixed min-w-[180px] rounded-lg shadow-xl z-[9999]",style:{left:`${s.x}px`,top:`${s.y}px`,backgroundColor:r.bgSecondary,border:`1px solid ${r.border}`},children:jsxs("div",{className:"py-1",children:[jsx("div",{className:"px-3 py-2 text-xs uppercase tracking-wider",style:{color:r.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"Add Column"}),i.map(d=>jsxs("button",{onClick:()=>{t(d.id);},className:"w-full px-3 py-2 text-left flex items-center justify-between transition-colors text-sm",style:{color:r.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif"},onMouseEnter:u=>{u.currentTarget.style.backgroundColor=r.hoverBg;},onMouseLeave:u=>{u.currentTarget.style.backgroundColor="transparent";},children:[jsx("span",{children:d.label}),d.visible&&jsx(Check,{className:"w-4 h-4",style:{color:r.accent}})]},d.id))]})})})})]})}function os({isOpen:e,x:t,y:r,items:a,onClose:n,theme:s}){let o=useRef(null),[c,l]=useState({x:t,y:r});if(useEffect(()=>{if(!e)return;let d=200,u=a.length*36+8,p=8,m=window.innerWidth,f=window.innerHeight,x=t,y=r;t+d+p>m&&(x=t-d,x<p&&(x=p)),r+u+p>f&&(y=f-u-p,y<p&&(y=p)),l({x,y});},[e,t,r,a.length]),useEffect(()=>{if(!e)return;let d=p=>{o.current&&!o.current.contains(p.target)&&n();},u=p=>{p.key==="Escape"&&n();};return document.addEventListener("mousedown",d),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",u);}},[e,n]),!e)return null;let i=d=>d.startsWith("#")&&(d.length===7||d.length===4)?d:s.bgPrimary?.includes("1")||s.bgPrimary?.includes("2")||s.textPrimary?.toLowerCase().includes("fff")||s.textPrimary?.toLowerCase().includes("white")?"#1E2128":"#FFFFFF";return jsx(AnimatePresence,{children:jsx(motion.div,{ref:o,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15,ease:[.4,0,.2,1]},className:"fixed z-[9999] min-w-[200px] rounded-lg",style:{left:`${c.x}px`,top:`${c.y}px`,backgroundColor:i(s.bgSecondary),border:`1px solid ${s.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2)",backdropFilter:"none"},children:jsx("div",{className:"py-1",children:a.map(d=>jsxs("div",{children:[d.separator&&jsx("div",{className:"my-1 h-px",style:{backgroundColor:s.borderLight}}),jsxs("button",{onClick:()=>{d.disabled||(d.onClick(),n());},disabled:d.disabled,className:"w-full px-3 py-2 text-left flex items-center gap-2 transition-colors text-sm",style:{color:d.disabled?s.textTertiary:s.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif",cursor:d.disabled?"not-allowed":"pointer",opacity:d.disabled?.5:1},onMouseEnter:u=>{d.disabled||(u.currentTarget.style.backgroundColor=s.hoverBg);},onMouseLeave:u=>{u.currentTarget.style.backgroundColor="transparent";},children:[d.icon&&jsx("span",{style:{color:s.textSecondary},children:d.icon}),jsx("span",{className:"flex-1",children:d.label}),d.submenu&&jsx(ChevronRight,{className:"w-3.5 h-3.5",style:{color:s.textTertiary}})]})]},d.id))})})})}var ar={Edit:jsx(Edit3,{className:"w-4 h-4"}),Pencil:jsx(Pencil,{className:"w-4 h-4"}),Delete:jsx(Trash2,{className:"w-4 h-4"}),Add:jsx(Plus,{className:"w-4 h-4"}),AddSubtask:jsx(Plus,{className:"w-4 h-4"}),Remove:jsx(Minus,{className:"w-4 h-4"}),Link:jsx(Link2,{className:"w-4 h-4"}),Progress:jsx(BarChart3,{className:"w-4 h-4"}),Sort:jsx(ArrowUpDown,{className:"w-4 h-4"}),SortAsc:jsx(ArrowUp,{className:"w-4 h-4"}),SortDesc:jsx(ArrowDown,{className:"w-4 h-4"}),Hide:jsx(EyeOff,{className:"w-4 h-4"}),Show:jsx(Eye,{className:"w-4 h-4"}),Settings:jsx(Settings,{className:"w-4 h-4"}),Split:jsx(Scissors,{className:"w-4 h-4"}),Duplicate:jsx(Copy,{className:"w-4 h-4"}),MarkIncomplete:jsx(Circle,{className:"w-4 h-4"}),SetInProgress:jsx(PlayCircle,{className:"w-4 h-4"}),MarkComplete:jsx(CheckCircle2,{className:"w-4 h-4"})};function Em({tasks:e,selectedTaskIds:t,onTaskSelect:r,onTaskCreate:a,onTaskDelete:n,onTaskDuplicate:s,onTaskMove:o,onTaskIndent:c,onTaskOutdent:l,onTaskRename:i,onTaskToggleExpand:d,onOpenTaskModal:u,enableKeyboard:p=true}){let m=useRef(false),f=useCallback(v=>{m.current=v;},[]),x=useCallback(v=>{let w=[],C=S=>{for(let F of S)w.push(F),F.subtasks&&F.subtasks.length>0&&F.isExpanded&&C(F.subtasks);};return C(v),w},[]),y=useCallback(()=>{let v=x(e);for(let w of v)if(t.has(w.id))return w;return null},[e,t,x]),b=useCallback((v,w)=>{let C=x(e);if(C.length===0)return;let S=y();if(!S){r(C[0].id,false);return}let F=C.findIndex(P=>P.id===S.id);if(F===-1)return;let k=v==="up"?F-1:F+1;if(k<0||k>=C.length)return;let N=C[k];r(N.id,w);},[e,y,x,r]),h=useCallback(v=>{if(!p)return;let w=v.target;if(w.tagName==="INPUT"||w.tagName==="TEXTAREA"||w.isContentEditable||m.current){v.key==="Escape"&&(w.blur(),m.current=false);return}let F=navigator.platform.toUpperCase().indexOf("MAC")>=0?v.metaKey:v.ctrlKey,k=Array.from(t),N=y();if(v.key==="ArrowUp"){v.preventDefault(),b("up",v.shiftKey);return}if(v.key==="ArrowDown"){v.preventDefault(),b("down",v.shiftKey);return}if(N&&(v.key==="ArrowRight"||v.key==="ArrowLeft")){N.subtasks&&N.subtasks.length>0&&(v.preventDefault(),(v.key==="ArrowRight"&&!N.isExpanded||v.key==="ArrowLeft"&&N.isExpanded)&&d(N.id));return}if(v.altKey&&(v.key==="ArrowUp"||v.key==="ArrowDown")){k.length>0&&(v.preventDefault(),o(k,v.key==="ArrowUp"?"up":"down"));return}if(v.key==="Tab"&&!v.shiftKey){k.length>0&&(v.preventDefault(),c(k));return}if(v.key==="Tab"&&v.shiftKey){k.length>0&&(v.preventDefault(),l(k));return}if(v.key==="Enter"&&!v.shiftKey&&!F){N&&(v.preventDefault(),a(N.id,"below"));return}if(v.key==="Enter"&&v.shiftKey&&!F){N&&(v.preventDefault(),a(N.id,"above"));return}if(v.key==="Enter"&&F){N&&(v.preventDefault(),u(N.id));return}if(v.key==="F2"){N&&(v.preventDefault(),i(N.id));return}if(v.key==="Delete"||v.key==="Backspace"&&F){k.length>0&&(v.preventDefault(),n(k));return}if(v.key==="d"&&F&&!v.shiftKey){k.length>0&&(v.preventDefault(),s(k));return}},[p,t,y,b,a,n,s,o,c,l,i,d,u]);return useEffect(()=>{if(p)return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h);}},[p,h]),{setIsEditing:f}}function Pm(){let[e,t]=useState(new Set),[r,a]=useState(null),n=useCallback(u=>{t(new Set([u])),a(u);},[]),s=useCallback(u=>{t(p=>{let m=new Set(p);return m.has(u)?m.delete(u):m.add(u),m}),a(u);},[]),o=useCallback((u,p)=>{if(!r){n(u);return}let m=p.indexOf(r),f=p.indexOf(u);if(m===-1||f===-1){n(u);return}let x=Math.min(m,f),y=Math.max(m,f),b=p.slice(x,y+1);t(new Set(b)),a(u);},[r,n]),c=useCallback((u,p,m,f)=>{f?o(u,p):m?s(u):n(u);},[n,s,o]),l=useCallback((u,p)=>{p?t(m=>{let f=new Set(m);return f.add(u),f}):n(u);},[n]),i=useCallback(()=>{t(new Set),a(null);},[]),d=useCallback(u=>e.has(u),[e]);return {selectedTaskIds:e,selectTask:n,toggleTaskSelection:s,selectTaskRange:o,handleTaskClick:c,handleKeyboardSelection:l,clearSelection:i,isTaskSelected:d}}function Jc(e){return e.map((t,r)=>({...t,position:r,subtasks:t.subtasks?.length?Jc(t.subtasks):t.subtasks}))}function Mo(e){let t=[],r=(a,n,s=0)=>{let o=[...a].sort((c,l)=>(c.position??0)-(l.position??0));for(let c=0;c<o.length;c++){let l={...o[c],parentId:n,level:s,position:o[c].position??c};t.push(l),l.subtasks&&l.subtasks.length>0&&l.isExpanded&&r(l.subtasks,l.id,s+1);}};return r(e),t}function ss(e,t){for(let r of e){if(r.id===t)return r;if(r.subtasks){let a=ss(r.subtasks,t);if(a)return a}}return null}function Xc(e,t){for(let r of e)if(r.subtasks){if(r.subtasks.some(n=>n.id===t))return r;let a=Xc(r.subtasks,t);if(a)return a}return null}function Qc(e,t){if(t.length===0)return e;let r=Mo(e),a=t[0],n=r.findIndex(p=>p.id===a);if(n<=0)return e;let s=r[n-1],o=(p,m)=>{let f=[];return {tasks:p.filter(y=>{if(m.has(y.id))return f.push(y),false;if(y.subtasks){let b=o(y.subtasks,m);y.subtasks=b.tasks,f.push(...b.removed);}return true}),removed:f}},c=(p,m,f)=>p.map(x=>x.id===m?{...x,subtasks:[...x.subtasks||[],...f],isExpanded:true}:x.subtasks?{...x,subtasks:c(x.subtasks,m,f)}:x),l=new Set(t),{tasks:i,removed:d}=o(e,l),u=c(i,s.id,d);return Jc(u)}function Zc(e,t){if(t.length===0)return e;let r=[...e];for(let a of t){let n=Xc(r,a);if(!n)continue;let s=Xc(r,n.id),o=(i,d,u)=>{for(let p=0;p<i.length;p++){let m=i[p];if(m.id===d&&m.subtasks){let f=m.subtasks.findIndex(x=>x.id===u);if(f!==-1){let[x]=m.subtasks.splice(f,1);return x}}if(m.subtasks){let f=o(m.subtasks,d,u);if(f)return f}}return null},c=(i,d,u)=>{let p=i.findIndex(m=>m.id===d);if(p!==-1)return i.splice(p+1,0,u),i;for(let m of i)m.subtasks&&c(m.subtasks,d,u);return i},l=o(r,n.id,a);l&&(s&&s.subtasks?c(s.subtasks,n.id,l):c(r,n.id,l));}return Jc(r)}function ed(e,t,r){if(t.length===0)return e;let a=[...e],n=t[0],s=(o,c,l)=>{let i=o.findIndex(u=>u.id===c);if(i===-1){for(let u of o)if(u.subtasks&&s(u.subtasks,c,l))return true;return false}let d=l==="up"?i-1:i+1;return d<0||d>=o.length?false:([o[i],o[d]]=[o[d],o[i]],o[i]={...o[i],position:i},o[d]={...o[d],position:d},true)};return s(a,n,r),a}function td(e,t){let r=new Set(t),a=n=>n.filter(s=>!r.has(s.id)).map(s=>s.subtasks?{...s,subtasks:a(s.subtasks)}:s);return a(e)}function js(e,t){let r=[...e],a=[];for(let n of t){let s=(l,i)=>l.map((d,u)=>({...d,id:`${d.id}-copy-${Date.now()}-${u}`,parentId:i,subtasks:d.subtasks?s(d.subtasks,`${d.id}-copy-${Date.now()}-${u}`):void 0})),o=l=>{let i=l.findIndex(m=>m.id===n);if(i===-1){for(let m of l)if(m.subtasks){let f=o(m.subtasks);if(f)return f}return null}let d=l[i],u=`${d.id}-copy-${Date.now()}`,p={...d,id:u,name:`${d.name} (Copy)`,subtasks:d.subtasks?s(d.subtasks,u):void 0};return l.splice(i+1,0,p),p},c=o(r);c&&a.push(c);}return {tasks:r,duplicatedTasks:a}}function Fm(e,t,r){let a=[...e],n=new Date,s=new Date(n);s.setDate(s.getDate()+7);let o={id:`task-${Date.now()}`,name:"New Task",progress:0,status:"todo",startDate:n,endDate:s,color:"#00E5CC"},c=l=>{let i=l.findIndex(u=>u.id===t);if(i===-1){for(let u of l)if(u.subtasks&&c(u.subtasks))return true;return false}let d=r==="above"?i:i+1;return l.splice(d,0,o),true};return c(a),{tasks:a,newTask:o}}function rd(e,t,r){return e.map(a=>a.id===t?{...a,name:r}:a.subtasks?{...a,subtasks:rd(a.subtasks,t,r)}:a)}function ad(e,t){return e.map(r=>r.id===t?{...r,isExpanded:!r.isExpanded}:r.subtasks?{...r,subtasks:ad(r.subtasks,t)}:r)}function nd(e,t){let r=p=>{for(let m of p){if(m.id===t)return m;if(m.subtasks){let f=r(m.subtasks);if(f)return f}}return null},a=r(e),n=new Date,s=new Date(n);s.setDate(s.getDate()+7);let o=a?.startDate||n,c=a?.endDate||s,l=p=>{for(let m of p){if(m.id===t)return (m.subtasks||[]).length;if(m.subtasks){let f=l(m.subtasks);if(f>=0)return f}}return 0},i=l(e),d={id:`task-${Date.now()}`,name:"New Subtask",progress:0,status:"todo",startDate:new Date(o),endDate:new Date(c),color:a?.color||"#00E5CC",position:i,parentId:t},u=p=>p.map(m=>{if(m.id===t){let f=m.subtasks||[];return {...m,subtasks:[...f,d],isExpanded:true}}return m.subtasks?{...m,subtasks:u(m.subtasks)}:m});return {tasks:u(e),newTask:d}}function Lm(e,t,r,a){if(t===r)return e;let n=ss(e,t);if(!n)return e;if(r){let c=(l,i)=>{if(!l.subtasks)return false;for(let d of l.subtasks)if(d.id===i||c(d,i))return true;return false};if(c(n,r))return e}let s=c=>{let l=c.filter(d=>d.id!==t),i=l.length<c.length;return l.map((d,u)=>{let p=i?{...d,position:u}:d;return p.subtasks&&p.subtasks.length>0?{...p,subtasks:s(p.subtasks)}:p})},o=s(e);if(r===null){let c=a!==void 0?a:o.length;o.splice(c,0,{...n,parentId:void 0}),o=o.map((l,i)=>({...l,position:i}));}else {let c=l=>l.map(i=>{if(i.id===r){let d=i.subtasks||[],u=a!==void 0?a:d.length,p=[...d];p.splice(u,0,{...n,parentId:r});let m=p.map((f,x)=>({...f,position:x}));return {...i,subtasks:m,isExpanded:true}}return i.subtasks&&i.subtasks.length>0?{...i,subtasks:c(i.subtasks)}:i});o=c(o);}return o}function _a(e){return e.map(t=>{if(!t.subtasks||t.subtasks.length===0)return t;let r=_a(t.subtasks),a=r.reduce((c,l)=>(l.startDate&&c.starts.push(new Date(l.startDate).getTime()),l.endDate&&c.ends.push(new Date(l.endDate).getTime()),c.progresses.push(l.progress??0),c),{starts:[],ends:[],progresses:[]}),n=a.starts.length>0?new Date(Math.min(...a.starts)):t.startDate,s=a.ends.length>0?new Date(Math.max(...a.ends)):t.endDate,o=a.progresses.length>0?Math.round(a.progresses.reduce((c,l)=>c+l,0)/a.progresses.length):t.progress;return {...t,subtasks:r,startDate:n,endDate:s,progress:o}})}function Xi({tasks:e,theme:t,rowHeight:r,availableUsers:a=[],templates:n,onTaskClick:s,onTaskDblClick:o,onTaskContextMenu:c,onTaskToggle:l,scrollTop:i,columns:d,onToggleColumn:u,onColumnResize:p,onTaskUpdate:m,onBulkFill:f,onTaskIndent:x,onTaskOutdent:y,onTaskMove:b,onMultiTaskDelete:h,onTaskDuplicate:v,onTaskCreate:w,onTaskRename:C,onCreateSubtask:S,onOpenTaskModal:F,onDeleteRequest:k,onTaskReparent:N,allTasks:P,scrollContainerRef:T,showCriticalPath:Y=false}){let H=useContext(rs),[ee,I]=useState(null),[K,j]=useState(null),[W,$]=useState(""),ve=useRef(null),[We,Pe]=useState(null),[be,ye]=useState(0),[fe,ze]=useState(0),[Ce,Ae]=useState({isOpen:false,x:0,y:0,type:"header"}),[Me,qe]=useState(null),[de,et]=useState(null),[Re,Be]=useState(null),Nt=useRef(0),bt=5,Oe=useRef(false),[Ie,st]=useState(null),[kt,$e]=useState(false),He=useRef(null),[L,oe]=useState(null),[B,_]=useState(null),[U,J]=useState(false),De=useRef(null);useEffect(()=>{function se(me){De.current&&!De.current.contains(me.target)&&J(false);}if(U)return document.addEventListener("mousedown",se),()=>document.removeEventListener("mousedown",se)},[U]),useEffect(()=>{K&&ve.current&&(ve.current.focus(),ve.current.select());},[K]),useEffect(()=>{if(!We)return;let se=mt=>{let Xe=mt.clientX-be,it=fe+Xe;p?.(We,it);},me=()=>{Pe(null),document.body.style.cursor="",document.body.style.userSelect="";};return document.addEventListener("mousemove",se),document.addEventListener("mouseup",me),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",se),document.removeEventListener("mouseup",me),document.body.style.cursor="",document.body.style.userSelect="";}},[We,be,fe,p]);let{selectedTaskIds:pe,handleTaskClick:rt,isTaskSelected:tt}=Pm(),{setIsEditing:Qe}=Em({tasks:e,selectedTaskIds:pe,onTaskSelect:(se,me)=>{let Xe=Mo(e).map(it=>it.id);rt(se,Xe,me||false,false);},onTaskCreate:w||(()=>{}),onTaskDelete:h||(()=>{}),onTaskDuplicate:v||(()=>{}),onTaskMove:b||(()=>{}),onTaskIndent:x||(()=>{}),onTaskOutdent:y||(()=>{}),onTaskRename:se=>{let me=Mo(e).find(mt=>mt.id===se);me&&hr(me);},onTaskToggleExpand:l||(()=>{}),onOpenTaskModal:se=>{let me=Mo(e).find(mt=>mt.id===se);me&&F&&F(me);},enableKeyboard:true}),Ht=(se,me=0,mt="")=>{let Xe=[],it=[...se].sort((V,ce)=>(V.position??0)-(ce.position??0));for(let V=0;V<it.length;V++){let ce=it[V],Q=V+1,O=mt?`${mt}.${Q}`:`${Q}.0`,te=ce.wbsCode||O;if(ce.wbsCode=te,Xe.push({task:ce,level:me}),ce.subtasks&&ce.subtasks.length>0&&ce.isExpanded){let M=ce.wbsCode?.replace(/\.0$/,"")||(mt?`${mt}.${Q}`:`${Q}`);Xe.push(...Ht(ce.subtasks,me+1,M));}}return Xe},pt=Ht(e),qt=48,Ut=Math.max(pt.length*r,600-qt),ur=(se,me)=>me==="assignees"?se.assignees:me==="startDate"?se.startDate:se.endDate,br=(se,me,mt,Xe)=>{se.preventDefault(),se.stopPropagation(),oe({sourceTaskId:me,column:mt,sourceIndex:Xe,targetIndex:Xe}),document.body.style.cursor="crosshair",document.body.style.userSelect="none";let it=se.currentTarget.closest("[data-grid-body]"),V=q=>{let xe=it?.getBoundingClientRect().top??0,re=Math.floor((q-xe)/r);return re=Math.max(0,Math.min(pt.length-1,re)),re<Xe&&(re=Xe),re},ce=se.clientY,Q=T?.current??null,O=()=>{He.current&&(cancelAnimationFrame(He.current),He.current=null);},te=()=>{let q=V(ce);oe(xe=>xe&&{...xe,targetIndex:q});},we=()=>{if(O(),!Q)return;let q=Q.getBoundingClientRect(),xe=60,re=12,Ze=ce-q.top,Ye=q.bottom-ce;if(Ye<xe&&Q.scrollTop<Q.scrollHeight-Q.clientHeight){let Rt=Math.max(1,Math.round(re*(1-Math.max(0,Ye)/xe))),Lt=()=>{Q.scrollTop+=Rt,te(),Q.scrollTop<Q.scrollHeight-Q.clientHeight&&(He.current=requestAnimationFrame(Lt));};He.current=requestAnimationFrame(Lt);}else if(Ze<xe&&Q.scrollTop>0){let Rt=Math.max(1,Math.round(re*(1-Math.max(0,Ze)/xe))),Lt=()=>{Q.scrollTop-=Rt,te(),Q.scrollTop>0&&(He.current=requestAnimationFrame(Lt));};He.current=requestAnimationFrame(Lt);}},M=q=>{ce=q.clientY,te(),we();},R=q=>{window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",R),O(),document.body.style.cursor="",document.body.style.userSelect="",oe(null);let xe=V(q.clientY),re=pt.find(Bt=>Bt.task.id===me)?.task;if(!re)return;let Ze=ur(re,mt),Ye=Math.min(Xe,xe),Rt=Math.max(Xe,xe),Lt=[];for(let Bt=Ye;Bt<=Rt;Bt++){if(Bt===Xe)continue;let or=pt[Bt]?.task;!or||or.subtasks&&or.subtasks.length>0||Lt.push(or.id);}Lt.length!==0&&f?.(Lt,mt,Ze);};window.addEventListener("mousemove",M),window.addEventListener("mouseup",R);},da=se=>{if(!L)return false;let me=Math.min(L.sourceIndex,L.targetIndex),mt=Math.max(L.sourceIndex,L.targetIndex);return se>=me&&se<=mt},Yt=se=>!se.startDate||!se.endDate?"-":`${Math.ceil((se.endDate.getTime()-se.startDate.getTime())/(1e3*60*60*24))}d`,hr=se=>{j(se.id),$(se.name),Qe(true);},Ft=se=>{W.trim()&&W!==e.find(me=>me.id===se)?.name&&C?.(se,W.trim()),j(null),$(""),Qe(false);},jr=()=>{j(null),$(""),Qe(false);},Wt=(se,me)=>{me.stopPropagation(),S?.(se.id);},nr=(se,me)=>{me.preventDefault(),Nt.current=me.clientY,qe(se),Oe.current=false,$e(false),st({x:me.clientX,y:me.clientY});},_r=se=>{if(!Me||(Math.abs(se.clientY-Nt.current)>bt&&!Oe.current&&(Oe.current=true,$e(true)),st({x:se.clientX,y:se.clientY}),!Oe.current))return;if(T?.current){let V=T.current,ce=V.getBoundingClientRect(),Q=60,O=12;He.current&&(cancelAnimationFrame(He.current),He.current=null);let te=se.clientY-ce.top,we=ce.bottom-se.clientY;if(te<Q&&V.scrollTop>0){let M=Math.round(O*(1-te/Q)),R=()=>{V.scrollTop-=M,Oe.current&&V.scrollTop>0&&(He.current=requestAnimationFrame(R));};He.current=requestAnimationFrame(R);}else if(we<Q&&V.scrollTop<V.scrollHeight-V.clientHeight){let M=Math.round(O*(1-we/Q)),R=()=>{V.scrollTop+=M,Oe.current&&V.scrollTop<V.scrollHeight-V.clientHeight&&(He.current=requestAnimationFrame(R));};He.current=requestAnimationFrame(R);}}let mt=document.querySelectorAll("[data-task-row]"),Xe=null,it=null;mt.forEach(V=>{let ce=V.getBoundingClientRect(),Q=V.getAttribute("data-task-row");if(Q&&Q!==Me&&se.clientY>=ce.top&&se.clientY<=ce.bottom){Xe=Q;let O=se.clientY-ce.top,te=ce.height;O<te*.25?it="above":O>te*.75?it="below":it="child";}}),et(Xe),Be(it);},Dr=()=>{if(Oe.current&&Me&&de&&Re){if(Re==="child")N?.(Me,de);else if(Re==="above"||Re==="below"){let se=(V,ce,Q=null)=>{for(let O of V){if(O.id===ce)return Q;if(O.subtasks){let te=se(O.subtasks,ce,O.id);if(te!==void 0)return te}}},me=P&&P.length>0?P:e,mt=se(me,Me,null),Xe=se(me,de,null),it=(V,ce,Q,O)=>{let te=V.findIndex(R=>R.id===ce),we=O?V.findIndex(R=>R.id===Q):-1,M=Re==="below"?te+1:te;return O&&we!==-1&&we<te&&(M-=1),Math.max(0,M)};if(Xe===null){let ce=it(me,de,Me,mt===null);N?.(Me,null,ce);}else {let V=ss(me,Xe);if(V?.subtasks){let ce=mt===Xe,Q=it(V.subtasks,de,Me,ce);N?.(Me,Xe,Q);}}}}He.current&&(cancelAnimationFrame(He.current),He.current=null),qe(null),et(null),Be(null),st(null),Oe.current=false,$e(false);};useEffect(()=>{if(Me)return document.addEventListener("mousemove",_r),document.addEventListener("mouseup",Dr),document.body.style.cursor="grabbing",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",_r),document.removeEventListener("mouseup",Dr),document.body.style.cursor="",document.body.style.userSelect="";}},[Me,de,Re]);let ot=(se,me,mt)=>{let Xe=me.subtasks&&me.subtasks.length>0;switch(se.id){case "name":let it=K===me.id,V=ee===me.id;return jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 relative",style:{paddingLeft:`${mt*20}px`},children:[N&&jsx("div",{className:"cursor-grab active:cursor-grabbing p-0.5 rounded hover:bg-white/10 transition-all flex-shrink-0",style:{color:t.textTertiary,opacity:V?1:.3},onMouseDown:re=>nr(me.id,re),title:"Arrastrar para mover tarea",children:jsx(GripVertical,{className:"w-4 h-4"})}),me.subtasks&&me.subtasks.length>0?jsx("button",{onClick:re=>{re.stopPropagation(),l?.(me.id);},className:"p-0.5 hover:bg-opacity-10 rounded transition-colors flex-shrink-0",style:{color:t.textSecondary},children:me.isExpanded?jsx(ChevronDown,{className:"w-4 h-4"}):jsx(ChevronRight,{className:"w-4 h-4"})}):jsx("div",{className:"w-5 h-5 flex-shrink-0"}),it?jsx("input",{ref:ve,type:"text",value:W,onChange:re=>$(re.target.value),onKeyDown:re=>{re.key==="Enter"?Ft(me.id):re.key==="Escape"&&jr();},onBlur:()=>Ft(me.id),className:"flex-1 px-2 py-1 rounded border outline-none",style:{backgroundColor:t.bgPrimary,borderColor:t.accent,color:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:"13px",fontWeight:500},onClick:re=>re.stopPropagation()}):jsxs(Fragment,{children:[jsxs("span",{className:"flex-1 min-w-0",style:{display:"flex",alignItems:"baseline",gap:"6px",color:me.parentId?t.textSecondary:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:me.parentId?"13px":"14px",fontWeight:me.isMilestone?600:me.parentId?400:600,letterSpacing:me.parentId?"0":"-0.01em"},title:me.name,children:[me.wbsCode&&jsx("span",{style:{color:t.textTertiary,fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,opacity:.65,flexShrink:0},children:me.wbsCode}),me.isHighlighted&&me.status==="completed"&&jsx("span",{title:"\u2605",style:{color:"#F59E0B",fontSize:"10px",flexShrink:0,lineHeight:1},children:"\u2605"}),jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:me.name}),me.subtasks&&me.subtasks.length>0&&jsxs("span",{style:{color:"#6B7280",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",fontWeight:400,flexShrink:0,whiteSpace:"nowrap"},children:["\xB7 ",Math.round(me.progress||0),"%"]}),Y&&me.isCriticalPath&&jsx("span",{style:{display:"inline-block",width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#EF4444",flexShrink:0,marginLeft:"2px"}}),Y&&me.cpmData&&jsxs("span",{style:{color:me.cpmData.totalFloat<=0?"#EF4444":me.cpmData.totalFloat<=5?"#F59E0B":"#6B7280",fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",fontWeight:500,flexShrink:0,whiteSpace:"nowrap",marginLeft:"4px"},children:["TF: ",Math.round(me.cpmData.totalFloat),"d"]})]}),V&&!it&&jsxs("div",{className:"flex items-center gap-1 ml-2",onClick:re=>re.stopPropagation(),children:[jsx("button",{onClick:re=>Wt(me,re),className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Create subtask",children:jsx(Plus,{className:"w-3.5 h-3.5"})}),jsx("button",{onClick:re=>{re.stopPropagation(),hr(me);},className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Rename (F2)",children:jsx(Edit3,{className:"w-3.5 h-3.5"})})]})]})]});case "startDate":case "endDate":let Q=se.id==="startDate"?"startDate":"endDate",O=me[Q],te=B?.taskId===me.id&&B?.field===Q,we=re=>re?(typeof re=="string"?new Date(re):re).toLocaleDateString("es-ES",{day:"2-digit",month:"2-digit",year:"numeric"}):"-";return jsxs("div",{className:"flex items-center justify-center w-full relative",onClick:re=>re.stopPropagation(),children:[jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-2 py-1 rounded text-xs transition-colors hover:bg-white/5",style:{color:t.textSecondary,opacity:Xe?.5:1,cursor:Xe?"default":"pointer"},title:Xe?"Auto-calculated from subtasks":void 0,onClick:re=>{if(!Xe)if(te)_(null);else {let Ze=re.currentTarget.getBoundingClientRect();_({taskId:me.id,field:Q,month:O?typeof O=="string"?new Date(O):O:new Date,position:{top:Ze.bottom+4,left:Ze.left}});}},children:[jsx(Calendar,{className:"w-3 h-3",style:{color:t.textTertiary}}),jsx("span",{children:we(O)}),Xe&&jsx("span",{style:{fontSize:"9px",color:t.textTertiary,marginLeft:"2px"},children:"\u25BC"})]}),te&&typeof document<"u"&&createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-[9998]",onClick:()=>_(null)}),jsxs(motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"fixed z-[9999] rounded-xl shadow-2xl overflow-visible flex",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,top:B?.position.top,left:B?.position.left},onClick:re=>re.stopPropagation(),children:[jsxs("div",{className:"w-36 py-2",style:{borderRight:`1px solid ${t.border}`},children:[(()=>{let re=new Date,Ze=new Date(re);Ze.setDate(re.getDate()+1);let Ye=new Date(re);Ye.setDate(re.getDate()+7);let Rt=new Date(re);return Rt.setDate(re.getDate()+14),[{label:"Hoy",date:re},{label:"Ma\xF1ana",date:Ze},{label:"Pr\xF3xima semana",date:Ye},{label:"2 semanas",date:Rt}].map((Bt,or)=>jsx("button",{type:"button",className:"w-full px-3 py-1.5 text-xs text-left transition-colors",style:{color:t.textPrimary},onMouseEnter:Qa=>Qa.currentTarget.style.backgroundColor=t.hoverBg||"rgba(255,255,255,0.05)",onMouseLeave:Qa=>Qa.currentTarget.style.backgroundColor="transparent",onClick:()=>{m?.(me.id,{[Q]:Bt.date}),_(null);},children:Bt.label},or))})(),jsx("div",{style:{borderTop:`1px solid ${t.border}`,margin:"0.25rem 0"}}),jsx("button",{type:"button",className:"w-full px-3 py-1.5 text-xs text-left transition-colors",style:{color:"#EF4444"},onMouseEnter:re=>re.currentTarget.style.backgroundColor=t.hoverBg||"rgba(255,255,255,0.05)",onMouseLeave:re=>re.currentTarget.style.backgroundColor="transparent",onClick:()=>{m?.(me.id,{[Q]:void 0}),_(null);},children:"Borrar"})]}),jsxs("div",{className:"p-2",children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsx("button",{type:"button",onClick:()=>_(re=>re?{...re,month:new Date(re.month.getFullYear(),re.month.getMonth()-1)}:null),className:"p-1 rounded hover:bg-white/10",children:jsx(ChevronLeft,{className:"w-3.5 h-3.5",style:{color:t.textSecondary}})}),jsx("span",{className:"text-xs font-medium",style:{color:t.textPrimary},children:B?.month.toLocaleDateString("es-ES",{month:"long",year:"numeric"})}),jsx("button",{type:"button",onClick:()=>_(re=>re?{...re,month:new Date(re.month.getFullYear(),re.month.getMonth()+1)}:null),className:"p-1 rounded hover:bg-white/10",children:jsx(ChevronRight,{className:"w-3.5 h-3.5",style:{color:t.textSecondary}})})]}),jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:["D","L","M","M","J","V","S"].map((re,Ze)=>jsx("div",{className:"w-6 h-6 flex items-center justify-center text-[10px]",style:{color:t.textTertiary},children:re},Ze))}),jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let re=B?.month||new Date,Ze=re.getFullYear(),Ye=re.getMonth(),Rt=new Date(Ze,Ye,1).getDay(),Lt=new Date(Ze,Ye+1,0).getDate(),Bt=new Date,or=[];for(let sr=Rt-1;sr>=0;sr--)or.push({day:new Date(Ze,Ye,-sr).getDate(),date:new Date(Ze,Ye-1,new Date(Ze,Ye,-sr).getDate()),isCurrentMonth:false});for(let sr=1;sr<=Lt;sr++)or.push({day:sr,date:new Date(Ze,Ye,sr),isCurrentMonth:true});let Qa=42-or.length;for(let sr=1;sr<=Qa;sr++)or.push({day:sr,date:new Date(Ze,Ye+1,sr),isCurrentMonth:false});return or.map((sr,Ra)=>{let Ho=sr.date.toDateString()===Bt.toDateString(),Vn=(O?typeof O=="string"?new Date(O):O:null)?.toDateString()===sr.date.toDateString();return jsx("button",{type:"button",className:"w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors",style:{color:sr.isCurrentMonth?Vn?"#FFF":t.textPrimary:t.textTertiary,backgroundColor:Vn?"#00E5CC":"transparent",boxShadow:Ho&&!Vn?"inset 0 0 0 1px #00E5CC":"none"},onClick:()=>{m?.(me.id,{[Q]:sr.date}),_(null);},children:sr.day},Ra)})})()})]})]})]}),document.body)]});case "duration":return jsx("div",{className:"flex items-center justify-center w-full",children:jsx("span",{className:"text-xs tabular-nums",style:{color:t.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:600},children:Yt(me)})});case "assignees":if(Xe)return jsx("div",{className:"flex items-center justify-center w-full",style:{opacity:.4},children:jsx("span",{className:"text-xs",style:{color:t.textTertiary},children:"\u2014"})});let M=a.filter(re=>me.assignees?.some(Ze=>Ze.id?Ze.id===re.id:Ze.name===re.name||Ze.initials===re.initials));return jsx("div",{className:"flex items-center justify-center w-full",onClick:re=>re.stopPropagation(),children:jsx(ko,{assignedUsers:M,availableUsers:a,onChange:re=>{let Ze=re.map(Ye=>({id:Ye.id,name:Ye.name,initials:Ye.initials,color:Ye.color}));m?.(me.id,{assignees:Ze});}})});case "status":if(Xe){let re=me.progress===100?"\u2713":me.progress>0?"\u25D0":"\u25CB";return jsx("div",{className:"flex items-center justify-center w-full",style:{opacity:.5},children:jsx("span",{className:"text-xs",style:{color:t.textTertiary},children:re})})}return jsx("div",{className:"flex items-center justify-center w-full",onClick:re=>re.stopPropagation(),children:jsx(tp,{status:me.status||"todo",onChange:re=>{m?.(me.id,{status:re,progress:re==="completed"?100:me.progress});}})});case "progress":return jsxs("div",{className:"flex items-center justify-center gap-2 w-full",style:{opacity:Xe?.6:1},children:[jsx("div",{className:"flex-1 h-1.5 rounded-full overflow-hidden max-w-[60px]",style:{backgroundColor:t.bgSecondary},children:jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${me.progress}%`,backgroundColor:me.progress===100?t.statusCompleted:t.accent}})}),jsxs("span",{className:"text-xs tabular-nums min-w-[35px] text-right",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:[me.progress,"%"]})]});case "priority":let R={low:"LOW",medium:"MEDIUM",high:"HIGH",urgent:"URGENT"},q={LOW:"low",MEDIUM:"medium",HIGH:"high",URGENT:"urgent"},xe=R[me.priority||"medium"]||"MEDIUM";return jsx("div",{className:"flex items-center justify-center w-full",onClick:re=>re.stopPropagation(),children:jsx(vo,{priority:xe,onChange:re=>{re&&m?.(me.id,{priority:q[re]||"medium"});}})});default:return null}},_e=se=>[{id:"hide",label:"Hide Column",icon:ar.Hide,onClick:()=>u(se),disabled:se==="name"},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"sortAsc",label:"Sort Ascending",icon:ar.SortAsc,onClick:()=>{}},{id:"sortDesc",label:"Sort Descending",icon:ar.SortDesc,onClick:()=>{}}],ua=se=>{let me=se.subtasks&&se.subtasks.length>0,mt=Mo(e),Xe=pe.size>1&&pe.has(se.id),it=Xe?mt.filter(te=>pe.has(te.id)):[se],V=it.map(te=>te.id),ce=it.filter(te=>!(te.subtasks&&te.subtasks.length>0)),Q=Xe?` (${V.length})`:"",O=()=>{k?k(V,se.name):h?.(V);};return me?[{id:"addSubtask",label:H?.contextMenu?.addSubtask||"Add Subtask",icon:ar.Add,onClick:()=>{S?.(se.id);}},{id:"duplicate",label:(H?.contextMenu?.duplicateTask||"Duplicate Task")+Q,icon:ar.Duplicate,onClick:()=>{v?.(V);}},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"delete",label:(H?.contextMenu?.deleteTask||"Delete Task")+Q,icon:ar.Delete,onClick:O}]:[{id:"edit",label:H?.contextMenu?.editTask||"Edit Task",icon:ar.Pencil,onClick:()=>{o?.(se);}},{id:"addSubtask",label:H?.contextMenu?.addSubtask||"Add Subtask",icon:ar.Add,onClick:()=>{S?.(se.id);}},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"markIncomplete",label:(H?.contextMenu?.markIncomplete||"Mark Incomplete")+Q,icon:ar.MarkIncomplete,onClick:()=>{ce.forEach(te=>m?.(te.id,{status:"todo",progress:0}));},disabled:ce.length===0||ce.every(te=>te.status==="todo")},{id:"setInProgress",label:(H?.contextMenu?.setInProgress||"Set In Progress")+Q,icon:ar.SetInProgress,onClick:()=>{ce.forEach(te=>m?.(te.id,{status:"in-progress"}));},disabled:ce.length===0||ce.every(te=>te.status==="in-progress")},{id:"markComplete",label:(H?.contextMenu?.markComplete||"Mark Complete")+Q,icon:ar.MarkComplete,onClick:()=>{ce.forEach(te=>m?.(te.id,{status:"completed",progress:100}));},disabled:ce.length===0||ce.every(te=>te.status==="completed")},{id:"sep2",label:"",onClick:()=>{},separator:true},{id:"duplicate",label:(H?.contextMenu?.duplicateTask||"Duplicate Task")+Q,icon:ar.Duplicate,onClick:()=>{v?.(V);}},{id:"split",label:H?.contextMenu?.splitTask||"Split Task",icon:ar.Split,onClick:()=>{},disabled:true},{id:"sep3",label:"",onClick:()=>{},separator:true},{id:"delete",label:(H?.contextMenu?.deleteTask||"Delete Task")+Q,icon:ar.Delete,onClick:O}]},jt=d.filter(se=>se.visible),oa=jt.reduce((se,me)=>se+me.width,0);return jsxs("div",{className:"gantt-taskgrid-content",style:{backgroundColor:t.bgPrimary,minWidth:oa},children:[jsxs("div",{className:"sticky top-0 z-10 flex items-center",style:{backgroundColor:t.glassHeader||t.bgSecondary,height:`${qt}px`,paddingLeft:"3px",borderBottom:`1px solid ${t.border}`,boxSizing:"border-box"},children:[jsx("div",{className:"flex items-center flex-1 min-w-0",children:jt.map((se,me)=>{let mt=me===jt.length-1,Xe=se.id==="name";return jsxs("div",{className:`flex items-center px-4 cursor-pointer hover:bg-opacity-50 transition-colors relative ${Xe?"":"justify-center"}`,style:{width:`${se.width}px`,minWidth:`${se.minWidth??(Xe?200:60)}px`,maxWidth:`${se.maxWidth??2e3}px`,flexShrink:Xe&&jt.length===1?1:0,flexGrow:Xe&&jt.length===1?1:0,borderRight:mt?"none":`1px solid ${t.borderLight}`,height:"100%",boxSizing:"border-box",overflow:"hidden"},onContextMenu:it=>{it.preventDefault(),Ae({isOpen:true,x:it.clientX,y:it.clientY,type:"header",columnId:se.id});},onMouseEnter:it=>{it.currentTarget.style.backgroundColor=t.hoverBg;},onMouseLeave:it=>{it.currentTarget.style.backgroundColor="transparent";},children:[jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,paddingRight:"0"},title:se.label,children:se.label}),se.resizable&&jsx("div",{className:"absolute right-0 top-0 bottom-0 cursor-col-resize transition-colors group",style:{width:"12px",marginRight:"-6px",backgroundColor:We===se.id?`${t.accent}30`:"transparent",zIndex:5},onMouseDown:it=>{it.preventDefault(),it.stopPropagation(),Pe(se.id),ye(it.clientX),ze(se.width);},title:"Drag to resize column",children:jsx("div",{className:"absolute top-0 bottom-0 transition-opacity",style:{left:"5px",width:"2px",backgroundColor:t.accent,borderRadius:"1px",opacity:We===se.id?.8:void 0},children:jsx("div",{className:"absolute inset-0 opacity-20 group-hover:opacity-80 transition-opacity",style:{backgroundColor:t.accent}})})})]},se.id)})}),jsxs("div",{className:"flex items-center gap-1 px-2",style:{position:"sticky",right:0,height:"100%",backgroundColor:t.glassHeader||t.bgSecondary,zIndex:5},children:[jsx(qi,{columns:d,onToggleColumn:u,theme:t}),jsx("button",{onClick:()=>J(!U),className:"p-1.5 rounded hover:bg-opacity-10 transition-colors",style:{color:t.textTertiary},title:"Keyboard shortcuts",children:jsx(Keyboard,{className:"w-4 h-4"})}),U&&jsxs("div",{ref:De,className:"absolute top-full right-0 mt-2 p-4 rounded-lg shadow-2xl z-50 min-w-[400px]",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,color:t.textPrimary},onClick:se=>se.stopPropagation(),children:[jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b",style:{borderColor:t.border},children:[jsx("h3",{className:"font-semibold text-sm",style:{color:t.textPrimary},children:"Keyboard Shortcuts"}),jsx("button",{onClick:()=>J(false),className:"text-xs px-2 py-1 rounded hover:bg-opacity-10",style:{color:t.textTertiary},children:"Close"})]}),jsxs("div",{className:"space-y-3 text-xs",children:[jsxs("div",{children:[jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Navigation"}),jsxs("div",{className:"space-y-1",children:[jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Move focus up/down"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2191 / \u2193"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Select range"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + \u2191 / \u2193"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Toggle selection"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Click"})]})]})]}),jsxs("div",{children:[jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Hierarchy"}),jsxs("div",{className:"space-y-1",children:[jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Indent task"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Tab"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Outdent task"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Tab"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Expand/Collapse"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2192 / \u2190"})]})]})]}),jsxs("div",{children:[jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Editing"}),jsxs("div",{className:"space-y-1",children:[jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Create task below"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Enter"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Create task above"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Enter"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Open task modal"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Enter"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Rename task"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"F2"})]})]})]}),jsxs("div",{children:[jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Actions"}),jsxs("div",{className:"space-y-1",children:[jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Move task up/down"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Alt + \u2191 / \u2193"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Delete task"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Delete"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Duplicate task"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + D"})]})]})]})]})]})]})]}),jsx("div",{className:"gantt-taskgrid-content","data-grid-body":true,style:{minHeight:Ut},children:pt.map(({task:se,level:me},mt)=>{let Xe=tt(se.id),it=da(mt),V=de===se.id,ce=V&&Re==="above",Q=V&&Re==="below",O=V&&Re==="child",te={};return O&&(te.backgroundColor=`${t.accent}15`,te.boxShadow=`inset 0 0 0 2px ${t.accent}`),jsxs(motion.div,{"data-task-row":se.id,className:`flex items-center cursor-pointer group ${Me===se.id?"opacity-50":""}`,style:{position:"relative",height:`${r}px`,borderLeft:Xe?`3px solid ${t.accent}`:"3px solid transparent",backgroundColor:Xe?t.accentLight:O?`${t.accent}15`:mt%2===0?t.bgPrimary:t.bgGrid,opacity:Y?se.isCriticalPath?1:.4:void 0,transition:"opacity 300ms ease",...te},onMouseEnter:()=>I(se.id),onMouseLeave:()=>I(null),onClick:we=>{let R=Mo(e).map(re=>re.id),xe=navigator.platform.toUpperCase().indexOf("MAC")>=0?we.metaKey:we.ctrlKey;rt(se.id,R,xe,we.shiftKey),!xe&&!we.shiftKey&&s?.(se);},onDoubleClick:we=>{we.stopPropagation(),o?.(se);},onContextMenu:we=>{we.preventDefault(),Ae({isOpen:true,x:we.clientX,y:we.clientY,type:"task",task:se}),c?.(se,we);},whileHover:{backgroundColor:Xe?t.accentLight:t.hoverBg},children:[ce&&jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"2px",backgroundColor:t.accent,zIndex:10}}),Q&&jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"2px",backgroundColor:t.accent,zIndex:10}}),jt.map((we,M)=>{let R=M===jt.length-1,q=we.id==="name",xe=!!(se.subtasks&&se.subtasks.length>0),re=we.id==="assignees"||we.id==="startDate"||we.id==="endDate"?we.id:null,Ye=!!re&&!xe&&ee===se.id&&!L,Rt=it&&!!L&&L.column===we.id;return jsxs("div",{className:`px-4 flex items-center ${q?"justify-start":"justify-center"}`,style:{position:"relative",width:`${we.width}px`,minWidth:`${we.minWidth??(q?200:60)}px`,maxWidth:`${we.maxWidth??2e3}px`,flexShrink:q&&jt.length===1?1:0,flexGrow:q&&jt.length===1?1:0,borderRight:R?"none":`1px solid ${ee===se.id?t.border:t.borderLight}`,height:"100%",boxSizing:"border-box",overflow:"visible",backgroundColor:Rt?`${t.accent}22`:void 0,boxShadow:Rt?`inset 0 0 0 1px ${t.accent}66`:void 0},children:[ot(we,se,q?me:0),Ye&&re&&jsx("div",{title:"Arrastr\xE1 hacia abajo para aplicar a varias tareas",onMouseDown:Lt=>br(Lt,se.id,re,mt),style:{position:"absolute",right:2,bottom:2,width:8,height:8,borderRadius:2,background:t.accent,border:`1px solid ${t.bgPrimary}`,cursor:"crosshair",zIndex:5}})]},`${se.id}-${we.id}`)})]},se.id)})}),jsx(os,{isOpen:Ce.isOpen,x:Ce.x,y:Ce.y,items:Ce.type==="header"&&Ce.columnId?_e(Ce.columnId):Ce.type==="task"&&Ce.task?ua(Ce.task):[],onClose:()=>Ae({...Ce,isOpen:false}),theme:t}),kt&&Ie&&Me&&typeof document<"u"&&createPortal(jsx("div",{style:{position:"fixed",left:Ie.x+12,top:Ie.y-10,zIndex:99999,pointerEvents:"none"},children:(()=>{let se=pt.find(me=>me.task.id===Me)?.task;return se?jsx("div",{className:"flex items-center gap-2 px-2 py-1 rounded",style:{backgroundColor:"rgba(255, 255, 255, 0.08)",backdropFilter:"blur(4px)"},children:jsx("span",{className:"text-xs font-medium",style:{color:t.textSecondary,opacity:.9},children:se.name})}):null})()}),document.body)]})}function $m(e,t){let[r,a]=useState("none"),[n,s]=useState(0),[o,c]=useState(e),[l,i]=useState(t),[d,u]=useState(null),[p,m]=useState(null),[f,x]=useState(null),[y,b]=useState(null),[h,v]=useState(0),[w,C]=useState(0),[S,F]=useState(null),[k,N]=useState(false);return {dragMode:r,setDragMode:a,dragOffset:n,setDragOffset:s,ghostX:o,setGhostX:c,ghostWidth:l,setGhostWidth:i,connectionLine:d,setConnectionLine:u,hoveredTaskId:p,setHoveredTaskId:m,activeZone:f,setActiveZone:x,draggedSegmentIndex:y,setDraggedSegmentIndex:b,draggedSegmentStartX:h,setDraggedSegmentStartX:v,segmentDragOffsetX:w,setSegmentDragOffsetX:C,hoveredSegmentIndex:S,setHoveredSegmentIndex:F,isHovered:k,setIsHovered:N,isDragging:r!=="none",isResizing:r==="resize-start"||r==="resize-end",isConnecting:r==="connect",resetDragState:(ee,I)=>{a("none"),u(null),m(null),c(ee),i(I),C(0),b(null),v(0);}}}function Ji({task:e,x:t,y:r,width:a,theme:n,dayWidth:s,startDate:o,templates:c,onClick:l,onDoubleClick:i,onContextMenu:d,onDateChange:u,onDependencyCreate:p,allTaskPositions:m=[],onDragMove:f,onHoverChange:x,showBaseline:y,showTaskBarLabels:b=true,showCriticalPath:h=true,readOnly:v=false,onProgressChange:w}){let C=$m(t,a),S=useRef(null),F=useRef(false),k=useRef(null),N=useRef(null),{dragMode:P,setDragMode:T,dragOffset:Y,setDragOffset:H,ghostX:ee,setGhostX:I,ghostWidth:K,setGhostWidth:j,connectionLine:W,setConnectionLine:$,hoveredTaskId:ve,setHoveredTaskId:We,activeZone:Pe,setActiveZone:be,draggedSegmentIndex:ye,setDraggedSegmentIndex:fe,draggedSegmentStartX:ze,setDraggedSegmentStartX:Ce,segmentDragOffsetX:Ae,setSegmentDragOffsetX:Me,hoveredSegmentIndex:qe,setHoveredSegmentIndex:de,isHovered:et,setIsHovered:Re,isDragging:Be,isResizing:Nt,isConnecting:bt,resetDragState:Oe}=C,Ie=18,st=!!n.executionBarBg,kt=n.textPrimary==="#FFFFFF"||n.bgPrimary==="#050505",$e=st?3:6,He=e.subtasks&&e.subtasks.length>0,L=useRef(null),[oe,B]=(()=>{let V=useRef(null),[,ce]=useState(0);return [V.current,Q=>{V.current=Q,ce(O=>O+1);}]})(),_=!!w&&!v&&!He&&!e.segments&&!!e.startDate&&!!e.endDate,U=e.endDate&&(()=>{let V=new Date;V.setHours(0,0,0,0);let ce=new Date(e.endDate);return ce.setHours(0,0,0,0),ce<V})()&&e.progress<100,J=h&&e.isCriticalPath,De=n.name==="neutral"||n.today==="#1C1917",pe=e.status==="completed"||e.progress===100,rt={low:"#10B981",LOW:"#10B981",medium:"#F59E0B",MEDIUM:"#F59E0B",high:"#F97316",HIGH:"#F97316",urgent:"#EF4444",URGENT:"#EF4444"},Qe=h&&e.isCriticalPath||U?"#EF4444":e.color?e.color:e.priority&&rt[e.priority]?rt[e.priority]:n.taskBarPrimary,Ht=v?"default":Be?bt?"crosshair":Nt?"ew-resize":"grabbing":"grab",pt=v?"default":"ew-resize",Ut=(V=>V>=80?20:V>=60?15:V>=50?12:10)(a),ur=a<50,br=a<40;useEffect(()=>{x&&(!et||Be||e.segments)&&x(null);},[et,Be,e.segments,x]);let da=V=>V.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Yt=()=>{let V=Math.ceil((e.endDate.getTime()-e.startDate.getTime())/864e5);return `${V} day${V!==1?"s":""}`},hr=V=>Math.round(V/s)*s,Ft=V=>{let ce=Math.round(V/s),Q=new Date(o);return Q.setDate(Q.getDate()+ce),Q},jr=(V,ce)=>{for(let Q of m){if(Q.id===e.id)continue;let O=5;if(V>=Q.x-O&&V<=Q.x+Q.width+O&&ce>=Q.y-O&&ce<=Q.y+Q.height+O)return Q.id}return null},Wt=useCallback((V,ce,Q)=>{if(v)return;V.preventDefault(),V.stopPropagation();let O=S.current?.ownerSVGElement;if(!O)return;let te=O.createSVGPoint();te.x=V.clientX,te.y=V.clientY;let we=te.matrixTransform(O.getScreenCTM()?.inverse()),M=Q!==void 0?Q:t,R=ce;if(!R){let q=we.x-M;V.shiftKey?(R="connect",$({x:t+a,y:r+Ie/2})):V.ctrlKey||V.metaKey?R="move":V.altKey?R=q<a/2?"resize-start":"resize-end":br?q<a/2?R="move":R="resize-end":ur?q<=Ut/2?R="resize-start":q>=a-Ut/2?R="resize-end":R="move":q<=Ut?R="resize-start":q>=a-Ut?R="resize-end":R="move";}F.current=false,T(R),Re(false),be(null),R==="move"?H(we.x-M):R==="connect"?$({x:t+a,y:r+Ie/2}):H(0),I(M),j(a);},[t,a,r,Ie,v]),nr=useCallback(V=>{let ce=S.current?.ownerSVGElement;if(!ce)return;let Q=ce.closest(".gantt-timeline-scroll");if(!Q)return;let O=Q.getBoundingClientRect(),te=60,we=15,M=0;if(V.clientX<O.left+te){let R=O.left+te-V.clientX;M=-Math.min(we,R/2);}else if(V.clientX>O.right-te){let R=V.clientX-(O.right-te);M=Math.min(we,R/2);}return M!==0&&(Q.scrollLeft+=M),M!==0},[]),_r=useCallback(V=>{if(P==="none")return;F.current=true,N.current=V;let ce=S.current?.ownerSVGElement;if(!ce)return;if(P==="move"||P==="resize-start"||P==="resize-end"){let te=nr(V);te&&!k.current?k.current=window.setInterval(()=>{N.current&&(nr(N.current),_r(N.current));},16):!te&&k.current&&(window.clearInterval(k.current),k.current=null);}let Q=ce.createSVGPoint();Q.x=V.clientX,Q.y=V.clientY;let O=Q.matrixTransform(ce.getScreenCTM()?.inverse());if(P==="connect"){$({x:O.x,y:O.y});let te=jr(O.x,O.y);We(te);}else if(P==="move"){let te=O.x-Y,we=hr(te);I(we),j(a);let M=Math.round((we-t)/s);if(f?.(e.id,M,true),e.segments&&e.segments.length>0&&ye!==null){let R=we-ze;Me(R);}}else if(P==="resize-start"){let te=O.x,we=hr(te),M=t+a-we;M>=s&&(I(we),j(M));}else if(P==="resize-end"){let te=O.x,M=hr(te)-t;M>=s&&j(M);}},[P,t,a,s,Y,e,hr,ye,ze,jr,We,$,I,j,Me,f,nr]),Dr=useCallback(()=>{if(k.current&&(window.clearInterval(k.current),k.current=null),N.current=null,P!=="none"){if(P==="connect")ve&&p&&p(e,ve),$(null),We(null);else {let V=e.endDate.getTime()-e.startDate.getTime(),ce,Q,O=true;if(P==="move"){if(ce=Ft(ee),Q=new Date(ce.getTime()+V),e.segments&&e.segments.length>0&&ye!==null){let te=Math.round(Ae/s),we=e.segments.map((xe,re)=>{if(re===ye){let Ze=new Date(xe.startDate),Ye=new Date(xe.endDate);return Ze.setDate(Ze.getDate()+te),Ye.setDate(Ye.getDate()+te),{startDate:Ze,endDate:Ye}}return xe}),M=we.flatMap(xe=>[xe.startDate,xe.endDate]),R=new Date(Math.min(...M.map(xe=>xe.getTime()))),q=new Date(Math.max(...M.map(xe=>xe.getTime())));u?.({...e,segments:we},R,q),Oe(t,a);return}}else P==="resize-start"?(ce=Ft(ee),Q=e.endDate,ce>Q&&(console.warn("Invalid date range: start date must be before or equal to end date"),O=false)):P==="resize-end"?(ce=e.startDate,Q=Ft(ee+K),Q.setDate(Q.getDate()-1),Q<ce&&(console.warn("Invalid date range: end date must be after or equal to start date"),O=false)):O=false;O&&ce&&Q&&(Q.getTime()<ce.getTime()?console.warn("Invalid date range: end date cannot be before start date"):u?.(e,ce,Q));}f?.(e.id,0,false),Oe(t,a);}},[P,ee,K,e,u,ve,p,t,a,s,Ft,Ae,ye,Oe,f]);useEffect(()=>{if(P==="none")return;let V=Q=>{_r(Q);},ce=()=>{Dr();};return window.addEventListener("mousemove",V),window.addEventListener("mouseup",ce),()=>{window.removeEventListener("mousemove",V),window.removeEventListener("mouseup",ce),k.current&&(window.clearInterval(k.current),k.current=null);}},[P,_r,Dr]);let ot=Be&&!bt?ee:t,_e=Be&&!bt?K:a,ua=c.taskClass(e),jt=24,oa=h?e.isCriticalPath?1:.25:1,se=useCallback(V=>{if(!_)return;V.stopPropagation(),V.preventDefault();let Q=S.current?.querySelector('rect[data-bar-background="true"]')?.getBoundingClientRect()??null;L.current={barRect:Q,initialPct:e.progress||0},V.currentTarget.setPointerCapture(V.pointerId),B(e.progress||0);},[_,e.progress,B]),me=useCallback(V=>{let ce=L.current;if(!ce)return;let O=S.current?.querySelector('rect[data-bar-background="true"]')?.getBoundingClientRect()??ce.barRect;if(!O||O.width<=0)return;let te=(V.clientX-O.left)/O.width,we=Math.round(Math.max(0,Math.min(1,te))*100);V.shiftKey&&(we=Math.round(we/25)*25),B(we);},[B]),mt=useCallback(V=>{let ce=L.current;if(!ce)return;V.stopPropagation(),V.preventDefault();try{V.currentTarget.releasePointerCapture(V.pointerId);}catch{}let Q=oe;L.current=null,B(null),Q!=null&&Q!==ce.initialPct&&w&&w(e,Q);},[oe,w,e,B]),Xe=useCallback(V=>{V.stopPropagation(),V.preventDefault();},[]),it=oe??(e.progress||0);return jsxs("g",{ref:S,"data-task-bar":"true",style:{opacity:oa,transition:"opacity 300ms ease"},onClick:()=>{!Be&&!F.current&&l?.(e),F.current=false;},onDoubleClick:V=>{!Be&&!F.current&&(V.stopPropagation(),i?.(e));},onContextMenu:V=>{V.preventDefault(),d?.(e,V);},onMouseEnter:()=>!Be&&Re(true),onMouseMove:V=>{x&&et&&!Be&&!e.segments&&x({task:e,x:t,y:r,width:a,height:Ie,showBelow:false,mouseX:V.clientX,mouseY:V.clientY});},onMouseLeave:()=>{Be||(Re(false),be(null));},children:[jsx("rect",{x:t,y:r,width:a+jt,height:Ie,fill:"transparent",style:{pointerEvents:"all"}}),et&&!Be&&!ur&&!e.segments&&jsxs(Fragment,{children:[jsx("rect",{x:t,y:r,width:Ut,height:Ie,fill:Pe==="resize-start"?n.accent:"transparent",opacity:Pe==="resize-start"?.15:0,style:{cursor:pt,pointerEvents:"all"},onMouseEnter:()=>be("resize-start"),onMouseDown:V=>Wt(V,"resize-start")}),jsx("rect",{x:t+Ut,y:r,width:a-Ut*2,height:Ie,fill:Pe==="move"?n.accent:"transparent",opacity:Pe==="move"?.1:0,style:{cursor:v?"default":"grab",pointerEvents:"all"},onMouseEnter:()=>be("move"),onMouseDown:V=>Wt(V,"move")}),jsx("rect",{x:t+a-Ut,y:r,width:Ut,height:Ie,fill:Pe==="resize-end"?n.accent:"transparent",opacity:Pe==="resize-end"?.15:0,style:{cursor:pt,pointerEvents:"all"},onMouseEnter:()=>be("resize-end"),onMouseDown:V=>Wt(V,"resize-end")})]}),et&&!Be&&br&&jsxs(Fragment,{children:[jsx("rect",{x:t,y:r,width:a/2,height:Ie,fill:Pe==="move"?n.accent:"transparent",opacity:Pe==="move"?.2:0,style:{cursor:v?"default":"grab",pointerEvents:"all"},onMouseEnter:()=>be("move"),onMouseDown:V=>Wt(V,"move")}),jsx("rect",{x:t+a/2,y:r,width:a/2,height:Ie,fill:Pe==="resize-end"?n.accent:"transparent",opacity:Pe==="resize-end"?.2:0,style:{cursor:pt,pointerEvents:"all"},onMouseEnter:()=>be("resize-end"),onMouseDown:V=>Wt(V,"resize-end")}),et&&jsx(motion.line,{x1:t+a/2,y1:r+4,x2:t+a/2,y2:r+Ie-4,stroke:n.textTertiary,strokeWidth:1,strokeDasharray:"2 2",opacity:.3,initial:{opacity:0},animate:{opacity:.3},transition:{duration:.2},style:{pointerEvents:"none"}})]}),Be&&!bt&&!e.segments&&jsx(motion.rect,{x:ee,y:r,width:K,height:Ie,rx:$e,fill:n.accent,opacity:.15,stroke:n.accent,strokeWidth:1,strokeDasharray:"4 3",initial:{opacity:0},animate:{opacity:.25},transition:{duration:.15},style:{pointerEvents:"none"}}),y&&e.baselineStartDate&&e.baselineEndDate&&!Be&&(()=>{let V=e.baselineStartDate.getTime(),ce=e.baselineEndDate.getTime(),Q=o.getTime(),O=864e5,te=(V-Q)/O,we=(ce-V)/O,M=te*s,R=Math.max(we*s,s),q=ot+_e,xe=M+R,re=e.endDate?.getTime()??0,Ze=Math.ceil((re-ce)/O),Ye=Ze>0,Rt=Ze<-0;return jsxs("g",{style:{pointerEvents:"none"},children:[jsx("rect",{x:M,y:r,width:R,height:Ie,rx:$e,fill:"none",stroke:kt?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.35)",strokeWidth:1.5,strokeDasharray:"6 4"}),Ye&&q>xe&&jsx("rect",{x:xe,y:r,width:q-xe,height:Ie,rx:0,fill:"#EF4444",opacity:.2}),Ye&&jsxs("text",{x:Math.max(q,xe)+6,y:r+Ie/2+1,fill:"#EF4444",fontSize:"10",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",dominantBaseline:"middle",children:["+",Ze,"d"]}),Rt&&jsxs("text",{x:q+6,y:r+Ie/2+1,fill:"#10B981",fontSize:"10",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",dominantBaseline:"middle",children:[Ze,"d"]})]})})(),!e.segments&&st&&He&&(()=>{let ce=r+(Ie-8)/2,Q=4,O=e.progress||0,te=new Date;te.setHours(0,0,0,0);let we=e.startDate&&te>=e.startDate,M=e.endDate&&(()=>{let Ye=new Date(e.endDate);return Ye.setHours(0,0,0,0),te>Ye})(),R=e.startDate&&te<e.startDate,q=1;if(we&&e.startDate&&e.endDate&&!R){let Ye=new Date(e.startDate);Ye.setHours(0,0,0,0);let Rt=new Date(e.endDate);Rt.setHours(0,0,0,0);let Lt=Math.max(1,(Rt.getTime()-Ye.getTime())/(1e3*60*60*24)),or=Math.min((te.getTime()-Ye.getTime())/(1e3*60*60*24),Lt)/Lt*100;q=or>0?O/or:1;}let xe;O>=100?xe="#00E5CC":R?xe="#4B5563":M&&O<100?xe="#EF4444":q>=.95?xe="#22C55E":q>=.8?xe="#F59E0B":xe="#EF4444";let re=Math.max(O/100*_e,O>0?Q*2:0),Ze=_e>100&&O>0;return jsxs("g",{"data-task-class":ua,style:{cursor:"default",pointerEvents:"all"},children:[jsx("rect",{x:ot,y:ce,width:_e,height:8,rx:Q,fill:"rgba(255,255,255,0.10)"}),O>0&&jsx("rect",{x:ot,y:ce,width:re,height:8,rx:Q,fill:xe}),Ze&&jsxs("text",{x:ot+re+6,y:ce+8/2,dominantBaseline:"central",fill:"rgba(255,255,255,0.7)",fontSize:"9",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none",userSelect:"none"},children:[Math.round(O),"%"]})]})})(),!e.segments&&st&&!He&&jsx(motion.rect,{x:ot,y:r,width:_e,height:Ie,rx:$e,fill:n.executionBarBg||"rgba(255,255,255,0.06)",stroke:n.border||"rgba(255,255,255,0.1)",strokeWidth:1,"data-task-class":ua,"data-bar-background":"true",initial:{opacity:0,scale:.95},animate:{opacity:Be&&!bt?.15:e.parentId?.6:1,scale:et&&!Be?1.01:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:V=>Wt(V),style:{cursor:Ht,pointerEvents:"all"}}),!e.segments&&!st&&jsx(motion.rect,{x:ot,y:r,width:_e,height:Ie,rx:$e,fill:Qe,"data-task-class":ua,initial:{opacity:0,scale:.95},animate:{opacity:Be&&!bt?.15:e.parentId?.6:et?.9:.8,scale:et&&!Be?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:He?void 0:V=>Wt(V),style:{cursor:He?"default":Ht,pointerEvents:"all"}}),st&&(U||J)&&!e.segments&&jsx("rect",{x:ot,y:r,width:_e,height:Ie,rx:$e,fill:"none",stroke:n.criticalPath,strokeWidth:2,style:{pointerEvents:"none",filter:`drop-shadow(0 0 6px ${n.criticalPathLight||"rgba(255,46,46,0.4)"})`}}),!e.segments&&it>0&&!He&&jsx("rect",{x:ot,y:r,width:Math.max(_e*(it/100),$e*2),height:Ie,rx:$e,fill:Qe,opacity:1,style:{pointerEvents:"none"}}),!e.segments&&!He&&e.progress<100&&(()=>{let V=e.progress>0?_e*(e.progress/100):0,ce=ot+V,Q=_e-V,O=e.progress===0?$e:0,te=e.progress===0?ot:ce,we=e.progress===0?_e:Q;return jsxs(Fragment,{children:[jsx("rect",{x:te,y:r,width:we,height:Ie,rx:O,fill:"url(#bar-remaining-hatch)",style:{pointerEvents:"none"}}),jsx("rect",{x:te,y:r,width:we,height:Ie,rx:O,fill:"none",stroke:"#00E5CC",strokeWidth:.8,strokeDasharray:"5 3",style:{pointerEvents:"none"}})]})})(),st&&!e.segments&&e.progress>0&&e.progress<100&&!He&&!Be&&oe===null&&(()=>{let V=ot+_e*(e.progress/100),ce=8,Q=e.assignees?.[0];return jsxs("g",{style:{pointerEvents:"none"},children:[jsx("circle",{cx:V,cy:r+Ie/2,r:ce,fill:Q?.color||n.accent,stroke:"#000",strokeWidth:1.5}),jsx("text",{x:V,y:r+Ie/2,textAnchor:"middle",dominantBaseline:"central",fill:"#FFF",fontSize:"8",fontWeight:"600",fontFamily:"Inter, sans-serif",children:Q?.initials||Q?.name?.charAt(0)?.toUpperCase()||""})]})})(),_&&!Be&&_e>=40&&(oe!==null||it<88)&&(()=>{let V=ot+_e*(it/100),ce=r+Ie/2,Q=oe!==null,O=Q?7:et?6:5,te=Q||et?1:.35,we=ot+_e-V,M=Math.max(4,Math.min(12,we-10)),R=12;return jsxs("g",{children:[jsx("rect",{x:V-R,y:ce-12,width:R+M,height:24,fill:"transparent",style:{cursor:"ew-resize",touchAction:"none"},onPointerDown:se,onPointerMove:me,onPointerUp:mt,onPointerCancel:mt,onClick:Xe,onDoubleClick:Xe,onMouseDown:q=>q.stopPropagation()}),jsx("circle",{cx:V,cy:ce,r:O,fill:"#FFFFFF",stroke:Qe,strokeWidth:2,opacity:te,style:{pointerEvents:"none",filter:Q?`drop-shadow(0 0 4px ${Qe})`:void 0,transition:"r 120ms ease, opacity 120ms ease"}}),Q&&jsxs("g",{style:{pointerEvents:"none"},children:[jsx("rect",{x:V-20,y:ce-28,width:40,height:18,rx:4,fill:kt?"rgba(15, 15, 20, 0.95)":"rgba(255, 255, 255, 0.95)",stroke:Qe,strokeWidth:1}),jsxs("text",{x:V,y:ce-16,textAnchor:"middle",dominantBaseline:"central",fill:kt?"#FFFFFF":"#111111",fontSize:"11",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",children:[oe,"%"]})]})]})})(),e.segments&&e.segments.map((V,ce)=>{let Q=(V.startDate.getTime()-o.getTime())/864e5*s,te=(V.endDate.getTime()-o.getTime())/(1e3*60*60*24)*s-Q+s,we=Be&&P==="move"&&ye===ce,M=qe===ce,R=we?Q+Ae:Q;return jsxs("g",{onMouseEnter:()=>!Be&&de(ce),onMouseLeave:()=>!Be&&de(null),children:[jsx(motion.rect,{x:R,y:r,width:te,height:Ie,rx:$e,fill:Qe,initial:{opacity:0,scale:.95},animate:{opacity:we||e.parentId?.6:M?.9:.8,scale:M&&!Be?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:q=>{q.stopPropagation(),fe(ce),Ce(Q),Wt(q,void 0,Q);},style:{cursor:Ht,pointerEvents:"all"}}),jsx("rect",{x:R,y:r,width:te*(e.progress/100),height:Ie,rx:$e,fill:Qe,opacity:1,style:{pointerEvents:"none"}})]},`segment-${ce}`)}),De&&(U||J)&&!e.segments&&jsxs(Fragment,{children:[J&&!U&&jsx("rect",{x:ot,y:r,width:_e,height:Ie,rx:$e,fill:"none",stroke:n.border,strokeWidth:2,strokeDasharray:"4 4",opacity:.8,style:{pointerEvents:"none"}}),U&&jsx("rect",{x:ot,y:r,width:_e,height:Ie,rx:$e,fill:"url(#diagonal-stripes)",opacity:.3,style:{pointerEvents:"none"}})]}),b&&_e>60&&!e.segments&&!(st&&He)&&(()=>{let V=c.taskLabel(e),ce=typeof V=="string"?V:e.name,Q=ce.length>Math.floor(_e/8)?`${ce.substring(0,Math.floor(_e/8))}...`:ce;return jsx("text",{x:ot+8,y:r+Ie/2,dominantBaseline:"middle",fill:pe?"rgba(255, 255, 255, 0.6)":"#FFFFFF",fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none",textDecoration:pe?"line-through":"none"},children:Q})})(),!Be&&!e.segments&&!He&&e.progress>0&&e.progress<100&&(st?jsxs("text",{x:ot+_e+6,y:r+Ie/2,dominantBaseline:"middle",fill:"#FFFFFF",fontSize:"9",fontWeight:"500",fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none",userSelect:"none"},children:[e.progress,"%"]}):_e>100?jsxs("text",{x:ot+_e-12,y:r+Ie/2,dominantBaseline:"middle",textAnchor:"end",fill:"rgba(255, 255, 255, 0.9)",fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none"},children:[e.progress,"%"]}):null),e.status&&_e>80&&!Be&&!e.segments&&!(st&&He)&&jsxs("g",{style:{pointerEvents:"none"},children:[e.status==="completed"&&jsx("circle",{cx:ot+_e-8,cy:r+8,r:4,fill:n.statusCompleted,stroke:"#FFFFFF",strokeWidth:1.5}),e.status==="in-progress"&&jsx("circle",{cx:ot+_e-8,cy:r+8,r:4,fill:n.statusInProgress,stroke:"#FFFFFF",strokeWidth:1.5,opacity:.8})]}),(et||Nt)&&!bt&&!e.segments&&!He&&jsxs(Fragment,{children:[jsxs("g",{children:[jsx("rect",{x:ot-2,y:r,width:16,height:Ie,fill:"transparent",style:{cursor:pt},onMouseEnter:()=>be("resize-start"),onMouseLeave:()=>be(null),onMouseDown:V=>{V.stopPropagation(),Wt(V,"resize-start");}}),jsx(motion.rect,{x:ot+4,y:r+8,width:3,height:Ie-16,rx:1.5,fill:Pe==="resize-start"||P==="resize-start"?"#ffffff":"rgba(255,255,255,0.5)",style:{pointerEvents:"none"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})]}),jsxs("g",{children:[jsx("rect",{x:ot+_e-14,y:r,width:16,height:Ie,fill:"transparent",style:{cursor:pt},onMouseEnter:()=>be("resize-end"),onMouseLeave:()=>be(null),onMouseDown:V=>{V.stopPropagation(),Wt(V,"resize-end");}}),jsx(motion.rect,{x:ot+_e-7,y:r+8,width:3,height:Ie-16,rx:1.5,fill:Pe==="resize-end"||P==="resize-end"?"#ffffff":"rgba(255,255,255,0.5)",style:{pointerEvents:"none"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})]})]}),jsx(AnimatePresence,{children:et&&!Be&&!e.segments&&jsxs(motion.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[jsx("circle",{cx:t+a+10,cy:r+Ie/2,r:10,fill:"transparent",style:{cursor:"crosshair"},onMouseEnter:()=>be("connect"),onMouseLeave:()=>be(null),onMouseDown:V=>{V.stopPropagation(),Wt(V,"connect");}}),jsx(motion.circle,{cx:t+a+10,cy:r+Ie/2,r:4,fill:n.accent,stroke:"#FFFFFF",strokeWidth:1.5,style:{pointerEvents:"none"},initial:{scale:0},animate:{scale:Pe==="connect"?1.4:1},exit:{scale:0},transition:{duration:.15,type:"spring",stiffness:500,damping:30}})]})}),bt&&W&&jsxs("g",{style:{pointerEvents:"none"},children:[jsx(motion.line,{x1:t+a,y1:r+Ie/2,x2:W.x,y2:W.y,stroke:ve?n.statusCompleted:n.accent,strokeWidth:ve?3:2,strokeDasharray:"6 4",initial:{opacity:0},animate:{opacity:ve?1:.8},transition:{duration:.15}}),jsx(motion.circle,{cx:W.x,cy:W.y,r:ve?8:6,fill:ve?n.statusCompleted:n.accent,stroke:"#FFFFFF",strokeWidth:2,initial:{scale:0},animate:{scale:1},transition:{duration:.15}}),ve&&jsx(motion.text,{x:W.x+15,y:W.y,dominantBaseline:"middle",fill:n.statusCompleted,fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",initial:{opacity:0,x:W.x+10},animate:{opacity:1,x:W.x+15},transition:{duration:.2},children:"Connect"})]}),(et||Be)&&!bt&&!e.segments&&jsx(motion.rect,{x:ot-1,y:r-1,width:_e+2,height:Ie+2,rx:$e+1,fill:"none",stroke:Be?n.accent:st?"rgba(255,255,255,0.2)":n.taskBarPrimary,strokeWidth:st?1:2,opacity:Be||st?.6:.4,initial:{opacity:0},animate:{opacity:Be||st?.6:.4},transition:{duration:.2},style:{pointerEvents:"none"}}),Nt&&jsxs(Fragment,{children:[jsx("line",{x1:ee,y1:0,x2:ee,y2:1e3,stroke:n.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}}),jsx("line",{x1:ee+K,y1:0,x2:ee+K,y2:1e3,stroke:n.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}})]}),jsx(AnimatePresence,{children:et&&!Be&&!e.segments&&!x&&(()=>{let Q=r<100,O=Q?r+Ie+13:r-82-13,te=Q?`M ${ot+_e/2-6} ${r+Ie+3} L ${ot+_e/2} ${r+Ie+13} L ${ot+_e/2+6} ${r+Ie+3}`:`M ${ot+_e/2-6} ${r-13} L ${ot+_e/2} ${r-3} L ${ot+_e/2+6} ${r-13}`,we=O+22,M=O+40,R=O+55,q=O+70,xe=Q?O+82-5:r-18;return jsxs(motion.g,{initial:{opacity:0,y:Q?-10:10},animate:{opacity:1,y:0},exit:{opacity:0,y:Q?-10:10},transition:{duration:.2},style:{pointerEvents:"none"},children:[jsx("path",{d:te,fill:n.bgSecondary,stroke:n.border,strokeWidth:1}),jsx("rect",{x:ot+_e/2-120,y:O,width:240,height:82,rx:8,fill:n.bgSecondary,stroke:n.border,strokeWidth:1,filter:"drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))"}),jsx("text",{x:ot+_e/2,y:we,textAnchor:"middle",fill:n.textPrimary,fontSize:"13",fontWeight:"600",fontFamily:"Inter, sans-serif",children:e.name.length>28?`${e.name.substring(0,28)}...`:e.name}),jsx("text",{x:ot+_e/2-110,y:M,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Start:"}),jsx("text",{x:ot+_e/2-70,y:M,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:da(e.startDate)}),jsx("text",{x:ot+_e/2-110,y:R,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"End:"}),jsx("text",{x:ot+_e/2-70,y:R,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:da(e.endDate)}),jsx("text",{x:ot+_e/2+10,y:M,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Duration:"}),jsx("text",{x:ot+_e/2+65,y:M,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:Yt()}),jsx("text",{x:ot+_e/2+10,y:R,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Progress:"}),jsxs("text",{x:ot+_e/2+65,y:R,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.progress,"%"]}),e.assignees&&e.assignees.length>0&&jsxs(Fragment,{children:[jsx("text",{x:ot+_e/2-110,y:q,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Assignees:"}),jsxs("text",{x:ot+_e/2-50,y:q,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.assignees.map(re=>re.name).join(", ").substring(0,30),e.assignees.map(re=>re.name).join(", ").length>30?"...":""]})]}),!Q&&jsx("text",{x:ot+_e/2,y:xe,textAnchor:"middle",fill:n.textTertiary,fontSize:"9",fontFamily:"Inter, sans-serif",style:{opacity:.7},children:br?"Left: move \u2022 Right: resize":ur?"Drag to move \u2022 Hold ALT + drag edge to resize":"Drag edges to resize \u2022 Drag center to move \u2022 Click \u26AB to link"})]})})()})]})}var od=260,ls=8,Um=16,ew=-12;function Wm({tooltipData:e,theme:t,locale:r="en",workingDaysConfig:a}){let[n,s]=useState(null);if(useLayoutEffect(()=>{if(!e){s(null);return}let{task:v,mouseX:w,mouseY:C}=e,S=v.effortMinutes!=null||v.timeLoggedMinutes!=null||v.soldEffortMinutes!=null,F=v.lastActivity!=null,k=(S?155:105)+(F?28:0),N=w+Um,P=C+ew-k;N+od>window.innerWidth-ls&&(N=w-od-Um),N<ls&&(N=ls);let T=P<ls;T&&(P=C+20),P+k>window.innerHeight-ls&&(P=window.innerHeight-ls-k),s({left:N,top:P,showBelow:T});},[e]),!e||!n)return null;let{task:o}=e,c=o.effortMinutes!=null||o.timeLoggedMinutes!=null||o.soldEffortMinutes!=null,l={start:r==="es"?"Inicio":"Start",end:r==="es"?"Fin":"End",duration:r==="es"?"Duraci\xF3n":"Duration",progress:r==="es"?"Progreso":"Progress",assignees:r==="es"?"Asignados":"Assignees",estimated:r==="es"?"Estimado":"Estimated",logged:r==="es"?"Registrado":"Logged",quoted:r==="es"?"Ofertado":"Quoted"},i=v=>v.toLocaleDateString(r==="es"?"es-ES":"en-US",{month:"short",day:"numeric",year:"numeric"}),d=()=>{if(!o.startDate||!o.endDate)return "N/A";if(!a?.enabledWeekdays){let P=Math.max(1,Math.round((o.endDate.getTime()-o.startDate.getTime())/864e5)+1);return r==="es"?`${P} d\xEDa${P!==1?"s":""}`:`${P} day${P!==1?"s":""}`}let v=a.enabledWeekdays,w=a.holidayDates instanceof Set?a.holidayDates:new Set(a.holidayDates??[]),C=P=>`${P.getFullYear()}-${String(P.getMonth()+1).padStart(2,"0")}-${String(P.getDate()).padStart(2,"0")}`,S=0,F=new Date(o.startDate.getFullYear(),o.startDate.getMonth(),o.startDate.getDate()),k=new Date(o.endDate.getFullYear(),o.endDate.getMonth(),o.endDate.getDate());for(;F.getTime()<=k.getTime();){let P=F.getDay();v[P]&&!w.has(C(F))&&S++,F.setDate(F.getDate()+1);}let N=Math.max(0,S);return r==="es"?`${N} d\xEDa${N!==1?"s":""}`:`${N} day${N!==1?"s":""}`},u=v=>{if(v==null||v===0)return "N/A";let w=Math.floor(v/60),C=v%60;return w===0?`${C}m`:C===0?`${w}h`:`${w}h ${C}m`},p=t.textTertiary||"#9CA3AF",m=t.textSecondary||"#D1D5DB",f=t.textPrimary||"#F9FAFB",x=t.accent||"#00E5CC",y=t.bgSecondary||"#1F2937",b=t.border||"#374151",h=jsxs("div",{style:{position:"fixed",left:n.left,top:n.top,width:od,zIndex:99999,pointerEvents:"none",fontFamily:"Inter, system-ui, sans-serif",animation:"gantt-tooltip-fade 0.12s ease-out"},children:[jsxs("div",{style:{background:y,border:`1px solid ${b}`,borderRadius:8,padding:"12px 14px",boxShadow:"0 8px 24px rgba(0,0,0,0.3)"},children:[jsx("div",{style:{fontSize:13,fontWeight:600,color:f,marginBottom:8,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.name}),jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"3px 12px",fontSize:11},children:[jsx(Qi,{label:l.start,value:o.startDate?i(o.startDate):"N/A",labelColor:p,valueColor:m}),jsx(Qi,{label:l.duration,value:d(),labelColor:p,valueColor:m}),jsx(Qi,{label:l.end,value:o.endDate?i(o.endDate):"N/A",labelColor:p,valueColor:m}),jsx(Qi,{label:l.progress,value:`${o.progress}%`,labelColor:p,valueColor:m})]}),o.assignees&&o.assignees.length>0&&jsxs("div",{style:{fontSize:11,marginTop:6},children:[jsxs("span",{style:{color:p},children:[l.assignees,": "]}),jsx("span",{style:{color:m,fontWeight:500},children:o.assignees.map(v=>v.name).join(", ")})]}),c&&jsxs("div",{style:{marginTop:6,display:"flex",gap:10,fontSize:11},children:[o.effortMinutes!=null&&jsxs("span",{children:[jsxs("span",{style:{color:p},children:[l.estimated,":"]})," ",jsx("span",{style:{color:m,fontWeight:600},children:u(o.effortMinutes)})]}),o.timeLoggedMinutes!=null&&jsxs("span",{children:[jsxs("span",{style:{color:p},children:[l.logged,":"]})," ",jsx("span",{style:{color:x,fontWeight:600},children:u(o.timeLoggedMinutes)})]}),o.soldEffortMinutes!=null&&jsxs("span",{children:[jsxs("span",{style:{color:p},children:[l.quoted,":"]})," ",jsx("span",{style:{color:m,fontWeight:600},children:u(o.soldEffortMinutes)})]})]}),o.lastActivity&&jsxs("div",{style:{marginTop:8,paddingTop:8,borderTop:`1px solid ${t?.borderSubtle||"rgba(255,255,255,0.08)"}`,fontSize:11,color:p,lineHeight:1.4},children:[jsx("span",{style:{opacity:.7},children:r==="es"?"\xDAltimo: ":"Last: "}),jsx("span",{style:{color:m},children:o.lastActivity.userName})," ",jsx("span",{children:o.lastActivity.summary})," ",jsx("span",{style:{opacity:.6},children:o.lastActivity.relativeTime})]})]}),jsx("style",{children:`
|
|
125
|
+
- [ ] `,priority:"MEDIUM",labels:["meeting"]}}];function Bc({templates:e,onSelectTemplate:t,className:r}){let[a,n]=useState(false),s=useRef(null),o=useRef(null);useEffect(()=>{function i(d){s.current&&!s.current.contains(d.target)&&o.current&&!o.current.contains(d.target)&&n(false);}if(a)return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[a]);let c=i=>{t(i),n(false);},l=e.reduce((i,d)=>{let u=d.category||"Other";return i[u]||(i[u]=[]),i[u].push(d),i},{});return jsxs("div",{className:g("relative inline-block",r),children:[jsxs("button",{ref:o,onClick:()=>n(!a),className:"flex items-center gap-2 px-3 py-2 rounded-lg border transition-all text-sm font-medium shadow-lg",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-primary)"},onMouseEnter:i=>{i.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",i.currentTarget.style.borderColor="var(--theme-border-secondary)";},onMouseLeave:i=>{i.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",i.currentTarget.style.borderColor="var(--theme-border-primary)";},title:"Create from template",children:[jsx("span",{className:"text-base leading-none",children:"\u{1F4CB}"}),jsx("span",{children:"Templates"}),jsx("svg",{className:g("w-4 h-4 transition-transform",a&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),a&&jsxs("div",{ref:s,className:"absolute top-full left-0 mt-2 min-w-[320px] max-w-[400px] rounded-xl backdrop-blur-xl border shadow-2xl z-50 overflow-hidden max-h-[500px] overflow-y-auto",style:{backgroundColor:"var(--theme-bg-primary)",borderColor:"var(--theme-border-primary)"},children:[jsxs("div",{className:"px-4 py-3 border-b sticky top-0 backdrop-blur-sm",style:{borderColor:"var(--theme-border-primary)",backgroundColor:"var(--theme-bg-secondary)"},children:[jsx("span",{className:"text-sm font-bold uppercase tracking-wider",style:{color:"var(--theme-text-primary)"},children:"Card Templates"}),jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:"Quick start with pre-configured cards"})]}),Object.entries(l).map(([i,d])=>jsxs("div",{className:"py-2",children:[jsx("div",{className:"px-4 py-2",children:jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--theme-text-secondary)"},children:i})}),jsx("div",{children:d.map(u=>jsxs("button",{onClick:()=>c(u),className:"w-full px-4 py-3 flex items-start gap-3 text-left transition-all active:scale-[0.98]",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsx("span",{className:"text-2xl leading-none mt-0.5",children:u.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"font-semibold text-sm",style:{color:"var(--theme-text-primary)"},children:u.name}),u.description&&jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:u.description})]})]},u.id))})]},i)),e.length===0&&jsx("div",{className:"px-4 py-8 text-center",style:{color:"var(--theme-text-tertiary)"},children:jsx("p",{className:"text-sm",children:"No templates available"})})]})]})}function Oc({board:e,isOpen:t,onClose:r,onImport:a,boardElementRef:n,className:s}){let[o,c]=useState("export"),[l,i]=useState("json"),[d,u]=useState(null),p=useRef(null);if(!t)return null;let m=async()=>{let x=n?.current||void 0,y=await Lu(e,l,x);Au(y,l);},f=async x=>{let y=x.target.files?.[0];if(y){try{let b=await Bu(y),h=y.name.endsWith(".json")?"json":"csv",v=Ru(b,h);u(v),v.success&&a&&a(v,b);}catch(b){u({success:false,errors:[`Failed to read file: ${b instanceof Error?b.message:"Unknown error"}`]});}p.current&&(p.current.value="");}};return jsxs("div",{className:g("fixed inset-0 z-[9999] flex items-center justify-center",s),children:[jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:r}),jsxs("div",{className:"relative bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl rounded-2xl border border-white/20 shadow-2xl max-w-2xl w-full mx-4",children:[jsxs("div",{className:"px-6 py-5 border-b border-white/10 flex items-center justify-between",children:[jsxs("div",{children:[jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[jsx("span",{className:"text-3xl",children:"\u{1F4E6}"}),"Export / Import"]}),jsx("p",{className:"text-sm text-white/60 mt-1",children:"Transfer your board data"})]}),jsx("button",{onClick:r,className:"text-white/50 hover:text-white transition-colors text-2xl leading-none p-2 hover:bg-white/10 rounded-lg","aria-label":"Close",children:"\xD7"})]}),jsxs("div",{className:"flex border-b border-white/10",children:[jsx("button",{onClick:()=>c("export"),className:g("flex-1 px-6 py-4 font-semibold transition-colors",o==="export"?"text-white border-b-2 border-[#00E5CC]":"text-white/50 hover:text-white/80"),children:"Export"}),jsx("button",{onClick:()=>c("import"),className:g("flex-1 px-6 py-4 font-semibold transition-colors",o==="import"?"text-white border-b-2 border-[#00E5CC]":"text-white/50 hover:text-white/80"),children:"Import"})]}),jsxs("div",{className:"p-6",children:[o==="export"&&jsxs("div",{className:"space-y-6",children:[jsxs("div",{children:[jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Select format"}),jsx("div",{className:"grid grid-cols-3 gap-3",children:["json","csv","pdf"].map(x=>jsxs("button",{onClick:()=>i(x),className:g("p-4 rounded-lg border-2 transition-all text-center",l===x?"border-[#00E5CC] bg-[#00E5CC]/20 text-white":"border-white/20 hover:border-white/40 text-white/70 hover:text-white"),children:[jsxs("div",{className:"text-2xl mb-2",children:[x==="json"&&"\u{1F4C4}",x==="csv"&&"\u{1F4CA}",x==="pdf"&&"\u{1F4DD}"]}),jsx("div",{className:"font-semibold uppercase text-xs",children:x})]},x))})]}),jsxs("div",{className:"bg-white/5 rounded-lg p-4",children:[jsx("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:"Preview"}),jsxs("div",{className:"text-xs text-white/60",children:[jsxs("div",{children:["Board: ",jsx("span",{className:"text-white/90",children:e.title||"Untitled"})]}),jsxs("div",{children:["Columns: ",jsx("span",{className:"text-white/90",children:e.columns.length})]}),jsxs("div",{children:["Cards: ",jsx("span",{className:"text-white/90",children:e.cards.length})]})]})]}),jsx("button",{onClick:m,className:"w-full py-3 px-4 bg-gradient-to-r from-[#00C4AE] to-[#00C4AE] hover:from-[#00E5CC] hover:to-[#00C4AE] text-white font-semibold rounded-lg transition-all shadow-lg shadow-[#00E5CC]/20",children:"Export Board"})]}),o==="import"&&jsxs("div",{className:"space-y-6",children:[jsxs("div",{children:[jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Upload file"}),jsx("input",{ref:p,type:"file",accept:".json,.csv",onChange:f,className:"hidden"}),jsxs("button",{onClick:()=>p.current?.click(),className:"w-full py-12 px-4 border-2 border-dashed border-white/30 hover:border-white/50 rounded-lg transition-colors text-white/70 hover:text-white",children:[jsx("div",{className:"text-5xl mb-3",children:"\u{1F4C1}"}),jsx("div",{className:"font-semibold mb-1",children:"Click to select file"}),jsx("div",{className:"text-xs text-white/50",children:"Supports JSON and CSV files"})]})]}),d&&jsxs("div",{className:g("p-4 rounded-lg",d.success?"bg-green-500/20 border border-green-500/30":"bg-red-500/20 border border-red-500/30"),children:[jsx("h3",{className:g("font-semibold mb-2",d.success?"text-green-400":"text-red-400"),children:d.success?"\u2713 Import Successful":"\u2717 Import Failed"}),d.success&&jsxs("div",{className:"text-sm text-white/80",children:[jsxs("div",{children:["Cards imported: ",d.cardsImported]}),jsxs("div",{children:["Columns imported: ",d.columnsImported]})]}),d.errors&&d.errors.length>0&&jsx("div",{className:"mt-2 text-sm",children:d.errors.map((x,y)=>jsxs("div",{className:"text-red-300",children:["\u2022 ",x]},y))})]})]})]})]})]})}var Sx=["URGENT","HIGH","MEDIUM","LOW"],Ex=[{value:"none",label:"None"},{value:"created",label:"Date Created"},{value:"priority",label:"Priority"},{value:"dueDate",label:"Due Date"},{value:"title",label:"Title"},{value:"estimate",label:"Estimate"}],Mx=[{value:"none",label:"No Grouping"},{value:"priority",label:"By Priority"},{value:"assignee",label:"By Assignee"},{value:"label",label:"By Label"}];function Hc({filters:e,sort:t,onFiltersChange:r,onSortChange:a,onReset:n,onFilterMyTasks:s,onFilterOverdue:o,onFilterHighPriority:c,availableUsers:l=[],availableLabels:i=[],availableColumns:d=[],showQuickFilters:u=true,compact:p=false,groupBy:m="none",onGroupByChange:f}){let[x,y]=useState(true),b=useCallback(S=>{r({search:S.target.value});},[r]),h=useCallback(S=>{r({dateFilter:S.target.value});},[r]),v=useCallback(S=>{a({by:S.target.value});},[a]),w=useCallback(()=>{a({order:t.order==="asc"?"desc":"asc"});},[t.order,a]),C=e.search||e.dateFilter!=="all"||e.priorities.length>0||e.assignees.length>0||e.labels.length>0||t.by!=="none";return jsxs("div",{className:`filter-bar ${p?"filter-bar--compact":""} ${x?"filter-bar--collapsed":""}`,children:[jsxs("div",{className:"filter-bar__header",onClick:()=>y(!x),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",marginBottom:x?"0":"12px",padding:"4px 6px",borderRadius:"6px",transition:"all 0.2s ease"},onMouseEnter:S=>{S.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:S=>{S.currentTarget.style.backgroundColor="transparent";},children:[jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:x?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s",color:"var(--theme-text-secondary)"},children:jsx("polyline",{points:"6 9 12 15 18 9"})}),jsx("span",{className:"filter-bar__label",style:{fontWeight:500,fontSize:"0.875rem",color:"var(--theme-text-primary)"},children:"Filters & Grouping"}),C&&jsxs("span",{style:{color:"var(--theme-accent-primary)",fontSize:"0.75rem",fontWeight:600},children:["(",[e.search&&"search",e.dateFilter!=="all"&&"date",e.priorities.length>0&&"priority",e.assignees.length>0&&"assignee",e.labels.length>0&&"label",t.by!=="none"&&"sort"].filter(Boolean).length," active)"]})]}),!x&&jsxs("div",{className:"filter-bar__content",children:[u&&jsxs("div",{className:"filter-bar__quick",style:{marginBottom:"12px"},children:[jsx("span",{className:"filter-bar__label",children:"Quick:"}),s&&jsx("button",{onClick:s,className:"filter-bar__quick-btn",title:"Show only my tasks",children:"My Tasks"}),o&&jsx("button",{onClick:o,className:"filter-bar__quick-btn",title:"Show overdue tasks",children:"Overdue"}),c&&jsx("button",{onClick:c,className:"filter-bar__quick-btn",title:"Show high priority tasks",children:"High Priority"})]}),jsxs("div",{className:"filter-bar__main",children:[jsx("div",{className:"filter-bar__field",children:jsx("input",{type:"text",placeholder:"Search tasks...",value:e.search,onChange:b,className:"filter-bar__search"})}),jsx("div",{className:"filter-bar__field",children:jsxs("select",{value:e.dateFilter,onChange:h,className:"filter-bar__select",children:[jsx("option",{value:"all",children:"All Dates"}),jsx("option",{value:"overdue",children:"Overdue"}),jsx("option",{value:"today",children:"Today"}),jsx("option",{value:"this-week",children:"This Week"})]})}),jsx("div",{className:"filter-bar__field",children:jsxs("select",{value:e.priorities[0]||"all",onChange:S=>{let F=S.target.value;r({priorities:F==="all"?[]:[F]});},className:"filter-bar__select",children:[jsx("option",{value:"all",children:"All Priorities"}),Sx.map(S=>jsx("option",{value:S,children:S},S))]})}),l.length>0&&jsx("div",{className:"filter-bar__field",children:jsxs("select",{value:e.assignees[0]||"all",onChange:S=>{let F=S.target.value;r({assignees:F==="all"?[]:[F]});},className:"filter-bar__select",children:[jsx("option",{value:"all",children:"All Assignees"}),l.map(S=>jsx("option",{value:S.id,children:S.name},S.id))]})}),i.length>0&&jsx("div",{className:"filter-bar__field",children:jsxs("select",{value:e.labels[0]||"all",onChange:S=>{let F=S.target.value;r({labels:F==="all"?[]:[F]});},className:"filter-bar__select",children:[jsx("option",{value:"all",children:"All Labels"}),i.map(S=>jsx("option",{value:S,children:S},S))]})}),jsxs("div",{className:"filter-bar__field filter-bar__sort",children:[jsx("span",{className:"filter-bar__label",style:{color:"var(--theme-text-secondary)"},children:"Sort:"}),jsx("select",{value:t.by,onChange:v,className:"filter-bar__select filter-bar__select--sm",children:Ex.map(S=>jsx("option",{value:S.value,children:S.label},S.value))}),t.by!=="none"&&jsx("button",{onClick:w,className:"filter-bar__sort-toggle",title:`Sort ${t.order==="asc"?"descending":"ascending"}`,children:t.order==="asc"?"\u2191":"\u2193"})]}),f&&jsx("div",{className:"filter-bar__field",children:jsx("select",{value:m,onChange:S=>f(S.target.value),className:"filter-bar__select",style:{fontWeight:500,borderWidth:"2px"},children:Mx.map(S=>jsx("option",{value:S.value,children:S.label},S.value))})}),C&&jsx("button",{onClick:n,className:"filter-bar__reset",title:"Clear all filters",children:"Clear"})]})]})]})}function Uc({onOpenExport:e,onOpenThemes:t,onOpenShortcuts:r,className:a,viewMode:n="kanban",onExportGanttPDF:s,onExportGanttExcel:o,onExportGanttPNG:c,onExportGanttCSV:l}){let[i,d]=useState(false),u=useRef(null);useEffect(()=>{let m=f=>{u.current&&!u.current.contains(f.target)&&d(false);};return i&&document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m);}},[i]);let p=m=>{m(),d(false);};return jsxs("div",{className:g("relative",a),ref:u,children:[jsxs("button",{onClick:()=>d(!i),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all border",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-secondary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",m.currentTarget.style.color="var(--theme-text-primary)";},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",m.currentTarget.style.color="var(--theme-text-secondary)";},"aria-label":"Configuration Menu","aria-expanded":i,children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("circle",{cx:"12",cy:"12",r:"3"}),jsx("path",{d:"M12 1v6m0 6v6M5.6 5.6l4.2 4.2m4.2 4.2l4.2 4.2M1 12h6m6 0h6M5.6 18.4l4.2-4.2m4.2-4.2l4.2-4.2"})]}),jsx("span",{children:"Config"})]}),i&&jsxs("div",{className:"absolute right-0 mt-2 w-48 rounded-lg border shadow-lg overflow-hidden z-50",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[n==="kanban"?jsxs("button",{onClick:()=>p(e),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})}),"Export"]}):jsxs(Fragment,{children:[jsxs("button",{onClick:()=>p(async()=>await s?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsx("polyline",{points:"14 2 14 8 20 8"}),jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsx("polyline",{points:"10 9 9 9 8 9"})]}),"Export PDF"]}),jsxs("button",{onClick:()=>p(async()=>await o?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsx("polyline",{points:"14 2 14 8 20 8"}),jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),"Export Excel"]}),jsxs("button",{onClick:()=>p(async()=>await c?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),jsx("polyline",{points:"21 15 16 10 5 21"})]}),"Export PNG"]}),jsxs("button",{onClick:()=>p(()=>l?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsx("polyline",{points:"14 2 14 8 20 8"}),jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),jsx("line",{x1:"8",y1:"17",x2:"16",y2:"17"})]}),"Export CSV"]})]}),jsxs("button",{onClick:()=>p(t),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("circle",{cx:"12",cy:"12",r:"5"}),jsx("path",{d:"M12 1v6m0 6v6m8.5-8.5L17 15M7 9L3.5 5.5M7 15l-3.5 3.5M20.5 5.5L17 9m3.5 11.5L17 17"})]}),"Themes"]}),jsxs("button",{onClick:()=>p(r),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M8 12h.01M12 12h.01M16 12h.01M7 16h10"})]}),"Shortcuts"]})]})]})}var Wc={name:"dark",displayName:"Dark (Enhanced)",emoji:"\u{1F319}",colors:{bgPrimary:"#222326",bgSecondary:"#2A2B2F",bgTertiary:"#33343A",bgCard:"#2d2d2d",bgHover:"#353535",bgActive:"#404040",bgInput:"#2a2a2a",textPrimary:"#F4F5F8",textSecondary:"#AEB6C0",textTertiary:"#7A7F8A",textDisabled:"#606060",textInverse:"#1a1a1a",borderPrimary:"rgba(255, 255, 255, 0.1)",borderSecondary:"rgba(255, 255, 255, 0.05)",borderDefault:"#404040",borderHover:"#505050",borderSubtle:"#2a2a2a",accentPrimary:"#5E6AD2",accentHover:"#7780DD",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.1)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.2)",success:"#10B981",warning:"#F59E0B",error:"#EF4444",info:"#00E5CC",danger:"#ef4444",dangerBorder:"rgba(239, 68, 68, 0.3)",dangerBackground:"rgba(239, 68, 68, 0.1)",dangerBackgroundHover:"rgba(239, 68, 68, 0.2)"},shadows:{sm:"0 1px 2px rgba(0, 0, 0, 0.3)",md:"0 4px 12px rgba(0, 0, 0, 0.4)",lg:"0 12px 32px rgba(0, 0, 0, 0.5)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},zc={name:"light",displayName:"Light (Standard)",emoji:"\u2600\uFE0F",colors:{bgPrimary:"#FFFFFF",bgSecondary:"#F7F7F8",bgTertiary:"#EEEFF1",bgCard:"#ffffff",bgHover:"#f3f4f6",bgActive:"#e5e7eb",bgInput:"#f9fafb",textPrimary:"#1A1A1A",textSecondary:"#5A5A5A",textTertiary:"#8A8A8A",textDisabled:"#d1d5db",textInverse:"#ffffff",borderPrimary:"rgba(0, 0, 0, 0.1)",borderSecondary:"rgba(0, 0, 0, 0.05)",borderDefault:"#e5e7eb",borderHover:"#d1d5db",borderSubtle:"#f3f4f6",accentPrimary:"#5E6AD2",accentHover:"#4A56B8",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.08)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.15)",success:"#059669",warning:"#D97706",error:"#DC2626",info:"#00E5CC",danger:"#dc2626",dangerBorder:"rgba(220, 38, 38, 0.3)",dangerBackground:"rgba(220, 38, 38, 0.08)",dangerBackgroundHover:"rgba(220, 38, 38, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.12)",md:"0 4px 12px rgba(0, 0, 0, 0.15)",lg:"0 12px 32px rgba(0, 0, 0, 0.2)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Gc={name:"neutral",emoji:"\u26AA",displayName:"Neutral (Zen)",colors:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgTertiary:"#E7E5E4",bgCard:"#FEFEFE",bgHover:"#F0EFEE",bgActive:"#E7E5E4",bgInput:"#FAFAF9",textPrimary:"#1C1917",textSecondary:"#57534E",textTertiary:"#A8A29E",textDisabled:"#D6D3D1",textInverse:"#FAFAF9",borderPrimary:"#E7E5E4",borderSecondary:"#F0EFEE",borderDefault:"#E7E5E4",borderHover:"#D6D3D1",borderSubtle:"#F5F5F4",accentPrimary:"#292524",accentHover:"#44403C",interactivePrimary:"#292524",interactivePrimaryHover:"#44403C",interactivePrimaryBorder:"rgba(41, 37, 36, 0.3)",interactivePrimaryBackground:"rgba(41, 37, 36, 0.06)",interactivePrimaryBackgroundHover:"rgba(41, 37, 36, 0.12)",success:"#15803D",warning:"#CA8A04",error:"#B91C1C",info:"#1D4ED8",danger:"#B91C1C",dangerBorder:"rgba(185, 28, 28, 0.3)",dangerBackground:"rgba(185, 28, 28, 0.08)",dangerBackgroundHover:"rgba(185, 28, 28, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.1)",md:"0 4px 12px rgba(0, 0, 0, 0.12)",lg:"0 12px 32px rgba(0, 0, 0, 0.15)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},So={dark:Wc,light:zc,neutral:Gc},Vi="dark";var ji=createContext(void 0),Hx="asakaa-theme";function cm({children:e,defaultTheme:t=Vi,storageKey:r=Hx}){let[a,n]=useState(()=>{if(typeof window<"u"){let c=localStorage.getItem(r);if(c&&(c==="dark"||c==="light"||c==="neutral"))return c}return t}),s=useCallback(c=>{n(c),typeof window<"u"&&localStorage.setItem(r,c);},[r]);useEffect(()=>{if(typeof window>"u")return;let c=document.documentElement,l=So[a];Object.entries(l.colors).forEach(([d,u])=>{u&&c.style.setProperty(`--theme-${Ux(d)}`,u);}),Object.entries({bgPrimary:"--asakaa-color-background-primary",bgSecondary:"--asakaa-color-background-secondary",bgTertiary:"--asakaa-color-background-tertiary",bgCard:"--asakaa-color-background-card",bgHover:"--asakaa-color-background-hover",bgActive:"--asakaa-color-background-active",bgInput:"--asakaa-color-background-input",textPrimary:"--asakaa-color-text-primary",textSecondary:"--asakaa-color-text-secondary",textTertiary:"--asakaa-color-text-tertiary",textDisabled:"--asakaa-color-text-disabled",textInverse:"--asakaa-color-text-inverse",borderPrimary:"--asakaa-color-border-primary",borderSecondary:"--asakaa-color-border-secondary",borderDefault:"--asakaa-color-border-default",borderHover:"--asakaa-color-border-hover",borderSubtle:"--asakaa-color-border-subtle",accentPrimary:"--asakaa-color-accent-primary",accentHover:"--asakaa-color-accent-hover",interactivePrimary:"--asakaa-color-interactive-primary",interactivePrimaryHover:"--asakaa-color-interactive-primaryHover",interactivePrimaryBorder:"--asakaa-color-interactive-primaryBorder",interactivePrimaryBackground:"--asakaa-color-interactive-primaryBackground",interactivePrimaryBackgroundHover:"--asakaa-color-interactive-primaryBackgroundHover",success:"--asakaa-color-status-success",warning:"--asakaa-color-status-warning",error:"--asakaa-color-status-error",info:"--asakaa-color-status-info",danger:"--asakaa-color-danger",dangerBorder:"--asakaa-color-danger-border",dangerBackground:"--asakaa-color-danger-background",dangerBackgroundHover:"--asakaa-color-danger-backgroundHover"}).forEach(([d,u])=>{let p=l.colors[d];p&&c.style.setProperty(u,p);}),c.setAttribute("data-theme",a),c.classList.remove("theme-dark","theme-light","theme-neutral"),c.classList.add(`theme-${a}`);},[a]);let o={theme:a,setTheme:s,themes:So};return jsx(ji.Provider,{value:o,children:e})}function es(){let e=useContext(ji);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function Ux(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Vc({isOpen:e,onClose:t,className:r}){let{theme:a,setTheme:n}=es();return e?jsxs("div",{className:g("fixed inset-0 z-[9999] flex items-center justify-center",r),children:[jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:t}),jsxs("div",{className:"relative rounded-2xl border shadow-2xl max-w-md w-full mx-4",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[jsxs("div",{className:"px-6 py-5 border-b flex items-center justify-between",style:{borderColor:"var(--theme-border-primary)"},children:[jsx("h2",{className:"text-2xl font-bold",style:{color:"var(--theme-text-primary)"},children:"Select Theme"}),jsx("button",{onClick:t,className:"text-2xl leading-none p-2 hover:bg-white/10 rounded-lg transition-colors",style:{color:"var(--theme-text-secondary)"},"aria-label":"Close",children:"\xD7"})]}),jsx("div",{className:"p-6 space-y-3",children:Object.entries(So).map(([s,o])=>jsxs("button",{onClick:()=>{n(s),t();},className:g("w-full p-4 rounded-lg border-2 transition-all flex items-center gap-4",a===s?"border-[#00E5CC] bg-[#00E5CC]/20":"border-white/20 hover:border-white/40"),style:{backgroundColor:a===s?"var(--theme-accent-primary)20":"transparent"},children:[jsx("div",{className:"text-3xl",children:o.emoji}),jsxs("div",{className:"text-left flex-1",children:[jsx("div",{className:"font-semibold",style:{color:"var(--theme-text-primary)"},children:o.displayName}),jsxs("div",{className:"text-xs",style:{color:"var(--theme-text-secondary)"},children:[s==="dark"&&"Default dark theme with Linear-inspired colors",s==="light"&&"Clean light theme with high contrast",s==="neutral"&&"Monochrome zen theme"]})]}),a===s&&jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:jsx("path",{d:"M20 6L9 17l-5-5"})})]},s))})]})]}):null}var lt={dark:{bgPrimary:"#050505",bgSecondary:"#0A0A0A",bgGrid:"rgba(255, 255, 255, 0.02)",bgWeekend:"rgba(17, 17, 17, 0.4)",border:"rgba(255, 255, 255, 0.08)",borderLight:"rgba(255, 255, 255, 0.05)",textPrimary:"rgba(255, 255, 255, 0.92)",textSecondary:"rgba(255, 255, 255, 0.60)",textTertiary:"rgba(255, 255, 255, 0.35)",accent:"#00E5CC",accentHover:"#5AADFF",accentLight:"rgba(0, 229, 204, 0.12)",taskBarPrimary:"#00E5CC",taskBarProgress:"#5AADFF",taskBarHandle:"#FFFFFF",dependency:"#444444",dependencyHover:"#FFFFFF",criticalPath:"#EF4444",criticalPathLight:"rgba(239, 68, 68, 0.15)",today:"#EF4444",todayLight:"rgba(239, 68, 68, 0.08)",milestone:"#FFFFFF",milestoneLight:"rgba(255, 255, 255, 0.1)",statusTodo:"#666666",statusInProgress:"#00E5CC",statusCompleted:"#10B981",hoverBg:"rgba(255, 255, 255, 0.04)",focusRing:"#00E5CC",dotGrid:"rgba(255, 255, 255, 0.05)",glassHeader:"#0A0A0A",glassToolbar:"rgba(0, 0, 0, 0.4)",forecastHud:"rgba(15, 15, 15, 0.9)",neonRedGlow:"0 0 8px rgba(239, 68, 68, 0.25)",executionBarBg:"rgba(0, 229, 204, 0.12)"},light:{bgPrimary:"#FFFFFF",bgSecondary:"#F8FAFC",bgGrid:"#F1F5F9",bgWeekend:"rgba(0, 196, 174, 0.03)",border:"#CBD5E1",borderLight:"#E2E8F0",textPrimary:"#0F172A",textSecondary:"#334155",textTertiary:"#64748B",accent:"#00E5CC",accentHover:"#1D4ED8",accentLight:"rgba(0, 196, 174, 0.08)",taskBarPrimary:"#00E5CC",taskBarProgress:"#00A893",taskBarHandle:"#FFFFFF",dependency:"#6B7280",dependencyHover:"#00E5CC",criticalPath:"#DC2626",criticalPathLight:"rgba(220, 38, 38, 0.1)",today:"#D21E24",todayLight:"rgba(210, 30, 36, 0.1)",milestone:"#F59E0B",milestoneLight:"rgba(245, 158, 11, 0.08)",statusTodo:"#64748B",statusInProgress:"#00E5CC",statusCompleted:"#059669",hoverBg:"rgba(0, 0, 0, 0.04)",focusRing:"#00E5CC",dotGrid:"rgba(0, 0, 0, 0.04)",glassHeader:"#F8FAFC",glassToolbar:"rgba(255, 255, 255, 0.85)",forecastHud:"rgba(248, 250, 252, 0.95)",neonRedGlow:"0 0 10px rgba(220, 38, 38, 0.3)",executionBarBg:"rgba(0, 196, 174, 0.28)"},neutral:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgGrid:"#EFEDEC",bgWeekend:"rgba(41, 37, 36, 0.02)",border:"#D6D3D1",borderLight:"#E7E5E4",textPrimary:"#0C0A09",textSecondary:"#44403C",textTertiary:"#78716C",accent:"#292524",accentHover:"#44403C",accentLight:"rgba(41, 37, 36, 0.08)",taskBarPrimary:"#292524",taskBarProgress:"#1C1917",taskBarHandle:"#FFFFFF",dependency:"#78716C",dependencyHover:"#A8A29E",criticalPath:"#44403C",criticalPathLight:"rgba(68, 64, 60, 0.08)",today:"#1C1917",todayLight:"rgba(28, 25, 23, 0.06)",milestone:"#57534E",milestoneLight:"rgba(87, 83, 78, 0.08)",statusTodo:"#78716C",statusInProgress:"#292524",statusCompleted:"#15803D",hoverBg:"rgba(0, 0, 0, 0.035)",focusRing:"#292524",dotGrid:"rgba(0, 0, 0, 0.03)",glassHeader:"#F5F5F4",glassToolbar:"rgba(250, 250, 249, 0.85)",forecastHud:"rgba(245, 245, 244, 0.95)",neonRedGlow:"0 0 10px rgba(68, 64, 60, 0.3)",executionBarBg:"rgba(41, 37, 36, 0.25)"}};function dm(e="dark"){if(typeof window>"u"||typeof getComputedStyle>"u")return lt[e]||lt.dark;let t=document.documentElement,r=getComputedStyle(t),a=(s,o)=>r.getPropertyValue(s).trim()||o;return {bgPrimary:a("--theme-bg-primary",lt[e].bgPrimary),bgSecondary:a("--theme-bg-secondary",lt[e].bgSecondary),bgGrid:a("--theme-bg-card",lt[e].bgGrid),bgWeekend:a("--theme-bg-hover",lt[e].bgWeekend),border:a("--theme-border-primary",lt[e].border),borderLight:a("--theme-border-subtle",lt[e].borderLight),textPrimary:a("--theme-text-primary",lt[e].textPrimary),textSecondary:a("--theme-text-secondary",lt[e].textSecondary),textTertiary:a("--theme-text-tertiary",lt[e].textTertiary),accent:a("--theme-accent-primary",lt[e].accent),accentHover:a("--theme-accent-hover",lt[e].accentHover),accentLight:a("--theme-accent-primary",lt[e].accentLight),taskBarPrimary:a("--theme-accent-primary",lt[e].taskBarPrimary),taskBarProgress:a("--theme-accent-hover",lt[e].taskBarProgress),taskBarHandle:a("--theme-text-inverse",lt[e].taskBarHandle||"#FFFFFF"),dependency:a("--theme-border-secondary",lt[e].dependency),dependencyHover:a("--theme-border-secondary",lt[e].dependencyHover),criticalPath:a("--theme-error",lt[e].criticalPath),criticalPathLight:a("--theme-error",lt[e].criticalPathLight),today:e==="light"?a("--theme-accent-primary",lt[e].today):e==="neutral"?a("--theme-text-primary",lt[e].today):a("--theme-error",lt[e].today),todayLight:e==="light"?a("--theme-accent-primary",lt[e].todayLight):e==="neutral"?a("--theme-text-primary",lt[e].todayLight):a("--theme-error",lt[e].todayLight),milestone:a("--theme-warning",lt[e].milestone),milestoneLight:a("--theme-warning",lt[e].milestoneLight),statusTodo:a("--theme-text-tertiary",lt[e].statusTodo),statusInProgress:a("--theme-accent-primary",lt[e].statusInProgress),statusCompleted:a("--theme-success",lt[e].statusCompleted),hoverBg:a("--theme-bg-hover",lt[e].hoverBg),focusRing:a("--theme-accent-primary",lt[e].focusRing),...lt[e].dotGrid&&{dotGrid:lt[e].dotGrid},...lt[e].glassHeader&&{glassHeader:lt[e].glassHeader},...lt[e].glassToolbar&&{glassToolbar:lt[e].glassToolbar},...lt[e].forecastHud&&{forecastHud:lt[e].forecastHud},...lt[e].neonRedGlow&&{neonRedGlow:lt[e].neonRedGlow},...lt[e].executionBarBg&&{executionBarBg:lt[e].executionBarBg}}}var _i={columns:{taskName:"TASK NAME",startDate:"Start Date",endDate:"End Date",duration:"Duration",assignees:"Assignees",status:"Status",progress:"% Complete",priority:"Priority"},toolbar:{today:"Today",day:"Day",week:"Week",month:"Month",export:"Export",exportPdf:"Export to PDF",exportPng:"Export to PNG",exportCsv:"Export to CSV",exportExcel:"Export to Excel",exportMsProject:"Export to MS Project",undo:"Undo",redo:"Redo",createTask:"New Task",density:"Row Density",compact:"Compact",normal:"Normal",spacious:"Spacious",filterAll:"All",filterIncomplete:"Incomplete",filterInProgress:"In Progress",filterCompleted:"Completed",filter:"Filters",filterBy:"FILTER BY STATUS",filterAllDesc:"Show all tasks",filterIncompleteDesc:"Hide completed tasks",filterInProgressDesc:"Tasks currently being worked on",filterCompletedDesc:"Only show finished tasks",clearFilter:"Clear filter",hideCompleted:"Hide Completed Tasks",toDo:"To Do / Pending",wbsLevel:"Level",wbsAllLevels:"All",viewExecution:"Execution",viewOracle:"Pulse View",simulateScenario:"Simulate Scenario",projectForecast:"PROJECT FORECAST",expectedFinish:"Expected Finish",confidence:"Confidence",costAtCompletion:"Cost at Completion",delayLabel:"Delay",earlyLabel:"Early",onTimeLabel:"On Time",budgetOver:"Over",budgetUnder:"Under",baselines:"Baselines",visibility:"Visibility",share:"Share",copySnapshotLink:"Copy Snapshot Link",copied:"Copied!"},contextMenu:{editTask:"Edit Task",addSubtask:"Add Subtask",markIncomplete:"Mark Incomplete",setInProgress:"Set In Progress",markComplete:"Mark Complete",duplicateTask:"Duplicate Task",splitTask:"Split Task",deleteTask:"Delete Task"},actions:{edit:"Edit",delete:"Delete",duplicate:"Duplicate",addSubtask:"Add Subtask",indent:"Indent",outdent:"Outdent",moveUp:"Move Up",moveDown:"Move Down",splitTask:"Split Task",linkTasks:"Link Tasks",unlinkTasks:"Unlink Tasks"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},labels:{progress:"Progress",duration:"Duration",days:"days",day:"day",assigned:"Assigned",milestone:"Milestone",criticalPath:"Critical Path",subtask:"Subtask",task:"Task",noTasks:"No tasks yet",addTask:"Add task",newTask:"New Task",loading:"Loading...",error:"Error",today:"Today",week:"Week",clickToSetDates:"Click to set dates..."},ai:{placeholder:'Ask AI to edit tasks... (e.g., "Move Design to next week")',thinking:"Thinking...",suggestions:{moveTask:'Move "Task Name" to next Monday',extendTask:'Extend "Task Name" by 3 days',renameTask:'Rename "Old Name" to "New Name"',setProgress:'Set "Task Name" progress to 50%',linkTasks:'Link "Task A" to "Task B"',createTask:'Create a new task called "New Task"',deleteTask:'Delete "Task Name"',assignTask:'Assign John to "Task Name"'},errors:{taskNotFound:"Task not found",invalidDate:"Invalid date",invalidDuration:"Invalid duration",invalidProgress:"Invalid progress value",unknownCommand:"Unknown command",processingError:"Error processing command"}},export:{projectName:"Gantt Project",ganttTasks:"Gantt Tasks",taskId:"Task ID",taskName:"Task Name",startDate:"Start Date",endDate:"End Date",isMilestone:"Is Milestone",parentId:"Parent ID",yes:"Yes",no:"No",noTasksToExport:"No tasks available to export"},dateFormat:{short:"MM/dd",medium:"MMM d",long:"MMMM d, yyyy"}},um={columns:{taskName:"NOMBRE DE TAREA",startDate:"Fecha Inicio",endDate:"Fecha Fin",duration:"Duraci\xF3n",assignees:"Asignados",status:"Estado",progress:"% Completado",priority:"Prioridad"},toolbar:{today:"Hoy",day:"D\xEDa",week:"Semana",month:"Mes",export:"Exportar",exportPdf:"Exportar a PDF",exportPng:"Exportar a PNG",exportCsv:"Exportar a CSV",exportExcel:"Exportar a Excel",exportMsProject:"Exportar a MS Project",undo:"Deshacer",redo:"Rehacer",createTask:"Nueva Tarea",density:"Densidad",compact:"Compacto",normal:"Normal",spacious:"Espacioso",filterAll:"Todas",filterIncomplete:"Sin completar",filterInProgress:"En progreso",filterCompleted:"Completadas",filter:"Filtros",filterBy:"FILTRAR POR ESTADO",filterAllDesc:"Mostrar todas las tareas",filterIncompleteDesc:"Ocultar tareas completadas",filterInProgressDesc:"Tareas en las que se est\xE1 trabajando",filterCompletedDesc:"Solo mostrar tareas terminadas",clearFilter:"Limpiar filtro",hideCompleted:"Ocultar Tareas Completadas",toDo:"Por Hacer / Pendiente",wbsLevel:"Nivel",wbsAllLevels:"Todos",viewExecution:"Ejecuci\xF3n",viewOracle:"Vista Pulse",simulateScenario:"Simular Escenario",projectForecast:"PRON\xD3STICO DEL PROYECTO",expectedFinish:"Fin Estimado",confidence:"Confianza",costAtCompletion:"Costo al Completar",delayLabel:"Retraso",earlyLabel:"Adelanto",onTimeLabel:"A Tiempo",budgetOver:"Excedido",budgetUnder:"Bajo",baselines:"L\xEDneas Base",visibility:"Visibilidad",share:"Compartir",copySnapshotLink:"Copiar enlace de vista",copied:"\xA1Copiado!"},contextMenu:{editTask:"Editar Tarea",addSubtask:"Agregar Subtarea",markIncomplete:"Marcar Incompleta",setInProgress:"Marcar En Progreso",markComplete:"Marcar Completada",duplicateTask:"Duplicar Tarea",splitTask:"Dividir Tarea",deleteTask:"Eliminar Tarea"},actions:{edit:"Editar",delete:"Eliminar",duplicate:"Duplicar",addSubtask:"Agregar Subtarea",indent:"Aumentar Nivel",outdent:"Disminuir Nivel",moveUp:"Mover Arriba",moveDown:"Mover Abajo",splitTask:"Dividir Tarea",linkTasks:"Vincular Tareas",unlinkTasks:"Desvincular Tareas"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},labels:{progress:"Progreso",duration:"Duraci\xF3n",days:"d\xEDas",day:"d\xEDa",assigned:"Asignado",milestone:"Hito",criticalPath:"Ruta Cr\xEDtica",subtask:"Subtarea",task:"Tarea",noTasks:"Sin tareas a\xFAn",addTask:"Agregar tarea",newTask:"Nueva Tarea",loading:"Cargando...",error:"Error",today:"Hoy",week:"Semana",clickToSetDates:"Clic para establecer fechas..."},ai:{placeholder:'P\xEDdele a la IA que edite tareas... (ej: "Mover Dise\xF1o a la pr\xF3xima semana")',thinking:"Pensando...",suggestions:{moveTask:'Mover "Nombre de Tarea" al pr\xF3ximo lunes',extendTask:'Extender "Nombre de Tarea" por 3 d\xEDas',renameTask:'Renombrar "Nombre Anterior" a "Nombre Nuevo"',setProgress:'Establecer progreso de "Nombre de Tarea" al 50%',linkTasks:'Vincular "Tarea A" con "Tarea B"',createTask:'Crear una nueva tarea llamada "Nueva Tarea"',deleteTask:'Eliminar "Nombre de Tarea"',assignTask:'Asignar a Juan a "Nombre de Tarea"'},errors:{taskNotFound:"Tarea no encontrada",invalidDate:"Fecha inv\xE1lida",invalidDuration:"Duraci\xF3n inv\xE1lida",invalidProgress:"Valor de progreso inv\xE1lido",unknownCommand:"Comando desconocido",processingError:"Error procesando el comando"}},export:{projectName:"Proyecto Gantt",ganttTasks:"Tareas Gantt",taskId:"ID de Tarea",taskName:"Nombre de Tarea",startDate:"Fecha Inicio",endDate:"Fecha Fin",isMilestone:"Es Hito",parentId:"ID Padre",yes:"S\xED",no:"No",noTasksToExport:"No hay tareas disponibles para exportar"},dateFormat:{short:"dd/MM",medium:"d MMM",long:"d de MMMM de yyyy"}},jc={en:_i,es:um};function pm(e){return jc[e]||jc.en}function _c(e,t){let r=pm(e);return t?{columns:{...r.columns,...t.columns},toolbar:{...r.toolbar,...t.toolbar},contextMenu:{...r.contextMenu,...t.contextMenu},actions:{...r.actions,...t.actions},status:{...r.status,...t.status},labels:{...r.labels,...t.labels},ai:{...r.ai,...t.ai,suggestions:{...r.ai.suggestions,...t.ai?.suggestions},errors:{...r.ai.errors,...t.ai?.errors}},export:{...r.export,...t.export},dateFormat:{...r.dateFormat,...t.dateFormat}}:r}var rs=createContext(_i);function ja(){return useContext(rs)}function Gs(e,t,r="left",a=208){let[n,s]=useState({top:0,left:0});return useEffect(()=>{if(!t||!e.current)return;let o=e.current.getBoundingClientRect(),c=o.bottom+4,l;r==="right"?l=o.right-a:l=o.left;let i=8;l+a>window.innerWidth-i&&(l=window.innerWidth-i-a),l<i&&(l=i),s({top:c,left:l});},[t,r,e,a]),n}function wm({theme:e,onExportPNG:t,onExportPDF:r,onExportExcel:a,onExportCSV:n,onExportJSON:s,onExportMSProject:o}){let[c,l]=useState(false),[i,d]=useState(null),u=useRef(null),p=useRef(null),m=ja(),f=Gs(u,c,"right",176);if(useEffect(()=>{if(!c)return;let h=v=>{let w=v.target;u.current&&!u.current.contains(w)&&p.current&&!p.current.contains(w)&&l(false);};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[c]),!(t||r||a||n||s||o))return null;let y=[{id:"png",label:"PNG",description:"Image",icon:jsx(FileImage,{className:"w-4 h-4"}),handler:t},{id:"pdf",label:"PDF",description:"Document",icon:jsx(FileText,{className:"w-4 h-4"}),handler:r},{id:"excel",label:"Excel",description:"Spreadsheet",icon:jsx(FileSpreadsheet,{className:"w-4 h-4"}),handler:a},{id:"csv",label:"CSV",description:"Comma-separated",icon:jsx(FileText,{className:"w-4 h-4"}),handler:n},{id:"json",label:"JSON",description:"Data",icon:jsx(FileJson,{className:"w-4 h-4"}),handler:s},{id:"msproject",label:"MS Project",description:"XML",icon:jsx(FolderKanban,{className:"w-4 h-4"}),handler:o}].filter(h=>h.handler),b=async(h,v)=>{if(v){d(h);try{await v();}catch(w){console.error(`Export ${h} failed:`,w);}finally{d(null),l(false);}}};return jsxs(Fragment,{children:[jsxs(motion.button,{ref:u,onClick:()=>l(!c),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{backgroundColor:c?e.accent:e.bgSecondary,border:`1px solid ${c?e.accent:e.borderLight}`,color:c?"#FFFFFF":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{scale:1.02,backgroundColor:e.accent,color:"#FFFFFF"},whileTap:{scale:.98},children:[jsx(Download,{className:"w-3.5 h-3.5"}),jsx("span",{children:m.toolbar.export}),jsx(ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:c?"rotate(180deg)":"rotate(0deg)"}})]}),createPortal(jsx(AnimatePresence,{children:c&&jsx(motion.div,{ref:p,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-44 rounded-xl overflow-hidden",style:{top:f.top,left:f.left,zIndex:99999,backgroundColor:e.bgPrimary==="#050505"?"rgba(10, 10, 10, 0.95)":e.bgSecondary,border:`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.08)":e.border}`,boxShadow:e.bgPrimary==="#050505"?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:jsx("div",{className:"py-1",children:y.map((h,v)=>jsxs(motion.button,{onClick:()=>b(h.id,h.handler),disabled:i!==null,className:"w-full flex items-center gap-2.5 px-3 py-2 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:v<y.length-1?`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.borderLight}`:"none",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:v*.03},children:[jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md",style:{backgroundColor:e.accentLight,color:e.accent},children:i===h.id?jsx(motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsx(Download,{className:"w-3.5 h-3.5"})}):h.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"text-[11px] font-medium truncate",style:{color:e.textPrimary},children:h.label}),jsx("div",{className:"text-[9px] truncate",style:{color:e.textTertiary},children:h.description})]})]},h.id))})})}),document.body)]})}function gm({theme:e,onExportPNG:t,onExportPDF:r,onExportExcel:a,onExportMSProject:n,onCopySnapshotLink:s}){let[o,c]=useState(false),[l,i]=useState(null),[d,u]=useState(false),p=useRef(null),m=useRef(null),f=ja(),x=Gs(p,o,"right",224),y=e.bgPrimary==="#050505"||(e.bgPrimary||"").charAt(1)==="0",b=f.toolbar.visibility==="Visibilidad";useEffect(()=>{if(!o)return;let C=S=>{let F=S.target;p.current&&!p.current.contains(F)&&m.current&&!m.current.contains(F)&&c(false);};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[o]);let h=[{id:"png",label:f.toolbar.exportPng,icon:jsx(FileImage,{className:"w-3.5 h-3.5"}),handler:t},{id:"pdf",label:f.toolbar.exportPdf,icon:jsx(FileText,{className:"w-3.5 h-3.5"}),handler:r},{id:"excel",label:f.toolbar.exportExcel,icon:jsx(FileSpreadsheet,{className:"w-3.5 h-3.5"}),handler:a},{id:"msproject",label:f.toolbar.exportMsProject,icon:jsx(FolderKanban,{className:"w-3.5 h-3.5"}),handler:n}].filter(C=>C.handler),v=async(C,S)=>{if(S){i(C);try{await S();}catch(F){console.error(`Export ${C} failed:`,F);}finally{i(null),c(false);}}},w=()=>{s?.(),u(true),setTimeout(()=>u(false),2e3);};return jsxs(Fragment,{children:[jsx(motion.button,{ref:p,onClick:()=>c(!o),className:"flex items-center justify-center w-8 h-8 rounded-lg",style:{color:o?e.accent:e.textTertiary,backgroundColor:o?e.accentLight:"transparent"},whileHover:{color:e.textPrimary,backgroundColor:e.hoverBg},title:f.toolbar.share,children:jsx(Share2,{className:"w-4 h-4"})}),createPortal(jsx(AnimatePresence,{children:o&&jsxs(motion.div,{ref:m,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-56 rounded-xl overflow-hidden",style:{top:x.top,left:x.left,zIndex:99999,backgroundColor:y?"rgba(10, 10, 10, 0.95)":e.bgSecondary||"#F8FAFC",border:`1px solid ${y?"rgba(255,255,255,0.08)":e.border||"#CBD5E1"}`,boxShadow:y?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[h.length>0&&jsxs(Fragment,{children:[jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:y?"rgba(255,255,255,0.35)":e.textTertiary},children:b?"EXPORTAR":"EXPORT"})}),jsx("div",{className:"py-0.5",children:h.map((C,S)=>jsxs(motion.button,{onClick:()=>v(C.id,C.handler),disabled:l!==null,className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:y?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:S*.03},children:[jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md flex-shrink-0",style:{backgroundColor:e.accentLight,color:e.accent},children:l===C.id?jsx(motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsx(Download,{className:"w-3.5 h-3.5"})}):C.icon}),jsx("span",{className:"flex-1 text-left",children:C.label})]},C.id))})]}),h.length>0&&s&&jsx("div",{className:"mx-3 h-px",style:{backgroundColor:y?"rgba(255,255,255,0.06)":e.borderLight}}),s&&jsxs(Fragment,{children:[jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:y?"rgba(255,255,255,0.35)":e.textTertiary},children:b?"COMPARTIR":"SHARE"})}),jsx("div",{className:"py-0.5 pb-1.5",children:jsxs(motion.button,{onClick:w,className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:y?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:h.length*.03},children:[jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md flex-shrink-0",style:{backgroundColor:d?"rgba(34,197,94,0.15)":e.accentLight,color:d?"#22C55E":e.accent},children:d?jsx(Check,{className:"w-3.5 h-3.5"}):jsx(Link2,{className:"w-3.5 h-3.5"})}),jsx("span",{className:"flex-1 text-left",children:d?f.toolbar.copied:f.toolbar.copySnapshotLink})]})})]})]})}),document.body)]})}function lv({options:e,value:t,onChange:r,theme:a,layoutId:n="activeSegment"}){return jsx("div",{className:"inline-flex p-1 rounded-lg relative",style:{backgroundColor:a.bgSecondary,border:`1px solid ${a.borderLight}`},children:e.map(s=>{let o=t===s.value;return jsxs(motion.button,{onClick:()=>r(s.value),className:"relative px-3 py-1.5 rounded-md text-[11px] transition-all flex items-center gap-1.5 min-w-[70px] justify-center",style:{color:o?a.textPrimary:a.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:o?600:500,zIndex:o?2:1},whileHover:{scale:1.02},whileTap:{scale:.98},children:[o&&jsx(motion.div,{layoutId:n,className:"absolute inset-0 rounded-md",style:{backgroundColor:a.accent,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},transition:{type:"spring",stiffness:400,damping:30}}),s.icon&&jsx("span",{className:"relative z-10",style:{color:o?"#FFFFFF":a.textTertiary},children:s.icon}),jsx("span",{className:"relative z-10",style:{color:o?"#FFFFFF":a.textTertiary},children:s.label})]},s.value)})})}function cv({options:e,value:t,onChange:r,theme:a}){return jsx("div",{className:"inline-flex items-center gap-1",children:e.map(n=>{let s=t===n.value;return jsxs(motion.button,{onClick:()=>r(n.value),className:"relative px-3 py-1.5 text-[11px] transition-all",style:{color:s?a.accent:a.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:s?600:500},whileHover:{color:s?a.accent:a.textSecondary},whileTap:{scale:.98},children:[jsx("span",{children:n.label}),s&&jsx(motion.div,{layoutId:"timeScaleUnderline",className:"absolute bottom-0 left-1 right-1 h-0.5 rounded-full",style:{backgroundColor:a.accent},transition:{type:"spring",stiffness:400,damping:30}})]},n.value)})})}function fm({theme:e,value:t,onChange:r,maxDepth:a}){let[n,s]=useState(false),o=useRef(null),c=useRef(null),l=ja(),i=Gs(o,n,"left");useEffect(()=>{if(!n)return;let p=m=>{let f=m.target;o.current&&!o.current.contains(f)&&c.current&&!c.current.contains(f)&&s(false);};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[n]);let d=[{value:"all",label:l.toolbar.wbsAllLevels||"All"},...Array.from({length:Math.min(a,5)},(p,m)=>({value:m+1,label:`L${m+1}`}))],u=t==="all"?l.toolbar.wbsAllLevels||"All":`L${t}`;return jsxs(Fragment,{children:[jsxs(motion.button,{ref:o,onClick:()=>s(!n),className:"flex items-center gap-1.5 px-2 py-1.5 rounded-lg transition-all",style:{backgroundColor:n?e.accentLight:e.bgSecondary,border:`1px solid ${n?e.accent:e.borderLight}`,color:n?e.accent:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.02},whileTap:{scale:.98},title:`${l.toolbar.wbsLevel||"Level"}: ${u}`,children:[jsx(Layers,{className:"w-3.5 h-3.5"}),jsx("span",{className:"text-[11px] font-medium",style:{fontFamily:"'JetBrains Mono', monospace"},children:u})]}),createPortal(jsx(AnimatePresence,{children:n&&jsx(motion.div,{ref:c,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-24 rounded-xl overflow-hidden",style:{top:i.top,left:i.left,zIndex:99999,backgroundColor:e.bgPrimary==="#050505"?"rgba(10, 10, 10, 0.95)":e.bgSecondary,border:`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.08)":e.border}`,boxShadow:e.bgPrimary==="#050505"?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:jsx("div",{className:"py-1",children:d.map((p,m)=>{let f=t===p.value;return jsxs(motion.button,{onClick:()=>{r(p.value),s(false);},className:"w-full flex items-center justify-between px-3 py-2 text-left transition-all",style:{backgroundColor:f?e.accentLight:"transparent",borderBottom:m<d.length-1?`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.borderLight}`:"none"},whileHover:{backgroundColor:f?e.accentLight:e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:m*.03},children:[jsx("span",{className:"text-[11px]",style:{color:f?e.accent:e.textPrimary,fontFamily:"'JetBrains Mono', monospace",fontWeight:f?600:500},children:p.label}),f&&jsx(Check,{className:"w-3.5 h-3.5",style:{color:e.accent}})]},String(p.value))})})})}),document.body)]})}function bm({theme:e,value:t,onChange:r,hideCompleted:a=false,onHideCompletedChange:n}){let[s,o]=useState(false),c=useRef(null),l=useRef(null),i=ja(),d=Gs(c,s,"left");useEffect(()=>{if(!s)return;let f=setTimeout(()=>{let x=b=>{let h=b.target;c.current&&!c.current.contains(h)&&l.current&&!l.current.contains(h)&&o(false);},y=b=>{b.key==="Escape"&&o(false);};document.addEventListener("mousedown",x),document.addEventListener("keydown",y),l._cleanup=()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",y);};},100);return ()=>{clearTimeout(f),l._cleanup&&l._cleanup();}},[s]);let u=[{value:"all",label:i.toolbar.filterAll||"Show All",icon:jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-[#00E5CC] bg-[#00E5CC]"}),color:"text-[#00E5CC]"},{value:"completed",label:i.toolbar.filterCompleted||"Completed",icon:jsx(CheckCircle2,{className:"w-3.5 h-3.5"}),color:"text-green-500"},{value:"in_progress",label:i.toolbar.filterInProgress||"In Progress",icon:jsx(PlayCircle,{className:"w-3.5 h-3.5"}),color:"text-[#00E5CC]"},{value:"incomplete",label:i.toolbar.toDo||"To Do / Pending",icon:jsx(Circle,{className:"w-3.5 h-3.5"}),color:"text-gray-400"}],p=t!=="all"||a,m=e.bgPrimary==="#0F1117"||e.bgPrimary==="#0a0a0a"||e.bgPrimary==="#050505"||e.textPrimary==="#FFFFFF";return jsxs(Fragment,{children:[jsxs(motion.button,{ref:c,onClick:f=>{f.stopPropagation(),o(x=>!x);},className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{backgroundColor:p?m?"rgba(0, 229, 204, 0.2)":"rgb(239 246 255)":s?e.hoverBg:e.bgSecondary,border:`1px solid ${p?m?"rgba(0, 229, 204, 0.5)":"rgb(191 219 254)":e.borderLight}`,color:p?"#00E5CC":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{backgroundColor:e.hoverBg,scale:1.02},whileTap:{scale:.98},children:[jsx(Filter,{className:"w-4 h-4"}),jsx("span",{children:i.toolbar.filter||"Filters"}),p&&jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:"#00E5CC"}})]}),createPortal(jsx(AnimatePresence,{children:s&&jsxs(motion.div,{ref:l,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-56 rounded-xl overflow-hidden",style:{top:d.top,left:d.left,zIndex:99999,backgroundColor:m?"rgba(10, 10, 10, 0.95)":"#FFFFFF",border:`1px solid ${m?"rgba(255,255,255,0.08)":"rgb(229 231 235)"}`,boxShadow:m?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[jsx("div",{className:"px-3 py-2 border-b",style:{borderColor:m?"rgba(255,255,255,0.06)":"rgb(229 231 235)"},children:jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:m?"rgba(255,255,255,0.35)":"#9CA3AF",fontFamily:"Inter, sans-serif"},children:i.toolbar.filterBy||"FILTER BY STATUS"})}),jsx("div",{className:"py-1",children:u.map(f=>{let x=t===f.value&&!a,y=()=>f.value==="all"?x?jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-[#00E5CC] bg-[#00E5CC]"}):jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-gray-400"}):f.icon;return jsxs(motion.button,{onClick:()=>{r(f.value),n&&n(false),o(false);},className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{backgroundColor:x?m?"rgba(255,255,255,0.05)":"rgb(249 250 251)":"transparent",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:m?"rgba(255,255,255,0.06)":"rgb(243 244 246)"},children:[jsx("span",{className:`${x?f.color:"text-gray-400"} flex-shrink-0`,children:y()}),jsx("span",{className:"flex-1 text-left whitespace-nowrap font-medium",style:{color:m?"rgba(255,255,255,0.85)":"#111827"},children:f.label}),x&&jsx(Check,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"#00E5CC"}})]},f.value)})}),jsx("div",{className:"mx-3 h-px",style:{backgroundColor:m?"rgba(255,255,255,0.06)":"rgb(229 231 235)"}}),n&&jsx("div",{className:"py-1",children:jsxs(motion.button,{onClick:()=>{n(!a),a||r("all"),o(false);},className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{backgroundColor:a?m?"rgba(255,255,255,0.05)":"rgb(249 250 251)":"transparent",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:m?"rgba(255,255,255,0.06)":"rgb(243 244 246)"},children:[jsx(EyeOff,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:a?"#00E5CC":m?"rgba(255,255,255,0.35)":"#9CA3AF"}}),jsx("span",{className:"flex-1 text-left whitespace-nowrap font-medium",style:{color:m?"rgba(255,255,255,0.85)":"#111827"},children:i.toolbar.hideCompleted||"Hide Completed Tasks"}),a&&jsx(Check,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"#00E5CC"}})]})})]})}),document.body)]})}function dv({value:e,onChange:t,theme:r}){let a=ja(),n=r.bgPrimary==="#050505"||r.textPrimary==="#FFFFFF",s=[{value:"day",label:a.toolbar.day.charAt(0).toUpperCase()},{value:"week",label:a.toolbar.week.charAt(0).toUpperCase()},{value:"month",label:a.toolbar.month.charAt(0).toUpperCase()}];return jsx("div",{className:"inline-flex items-center rounded-full p-0.5",style:{backgroundColor:n?"#000000":r.bgSecondary,border:`1px solid ${n?"rgba(255,255,255,0.1)":r.border}`},children:s.map(o=>{let c=e===o.value;return jsx(motion.button,{onClick:()=>t(o.value),className:"relative px-3 py-1 text-[11px] font-medium rounded-full transition-colors",style:{color:c?n?"#FFFFFF":r.textPrimary:r.textTertiary,fontFamily:"Inter, sans-serif",backgroundColor:c?n?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)":"transparent"},whileHover:{color:n?"#FFFFFF":r.textPrimary},whileTap:{scale:.95},children:o.label},o.value)})})}function uv({theme:e,forecast:t}){let r=ja(),a=e.bgPrimary==="#050505"||e.textPrimary==="#FFFFFF",n=t?.expectedFinish?t.expectedFinish.toLocaleDateString(void 0,{month:"short",day:"numeric"}):"\u2014",s=t?.delayDays,o=s!=null,c=s!=null?s>0?`+${s}d ${r.toolbar.delayLabel}`:s<0?`${s}d ${r.toolbar.earlyLabel}`:r.toolbar.onTimeLabel:null,l=s!=null&&s>0?{bg:a?"rgba(239,68,68,0.15)":"rgba(220,38,38,0.1)",text:a?"#EF4444":"#DC2626"}:s!=null&&s<0?{bg:a?"rgba(34,197,94,0.15)":"rgba(22,163,74,0.1)",text:a?"#22C55E":"#16A34A"}:{bg:a?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",text:e.textTertiary},i=t?.confidencePercent,d=i!=null?i>=75?"#22C55E":i>=40?"#F59E0B":"#EF4444":e.textTertiary,u=t?.costAtCompletion,p=t?.currency||"$",m=u!=null?u>=1e6?`${p}${(u/1e6).toFixed(2)}M`:u>=1e3?`${p}${(u/1e3).toFixed(1)}K`:`${p}${u.toFixed(0)}`:"\u2014",f=t?.budgetVariancePercent,x=f!=null&&f!==0,y=f!=null?f>0?`+${f.toFixed(0)}% ${r.toolbar.budgetOver}`:`${f.toFixed(0)}% ${r.toolbar.budgetUnder}`:null,b=f!=null&&f>0?{bg:a?"rgba(239,68,68,0.15)":"rgba(220,38,38,0.1)",text:a?"#EF4444":"#DC2626"}:f!=null&&f<0?{bg:a?"rgba(34,197,94,0.15)":"rgba(22,163,74,0.1)",text:a?"#22C55E":"#16A34A"}:{bg:"transparent",text:e.textTertiary};return jsxs("div",{className:"h-12 px-4 flex items-center justify-between border-b",style:{backgroundColor:e.forecastHud||(a?"rgba(15,15,15,0.9)":"rgba(248,250,252,0.95)"),borderColor:e.borderLight,backdropFilter:"blur(12px)"},children:[jsxs("div",{className:"flex items-center gap-6",children:[jsx("span",{className:"text-[9px] uppercase tracking-[0.15em]",style:{color:e.textTertiary,fontFamily:"'JetBrains Mono', monospace",fontWeight:500},children:r.toolbar.projectForecast}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-[13px] font-semibold",style:{color:e.textPrimary,fontFamily:"Inter, sans-serif"},children:[r.toolbar.expectedFinish,": ",n]}),o&&c&&jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:l.bg,color:l.text,fontFamily:"'JetBrains Mono', monospace"},children:c})]})]}),jsxs("div",{className:"flex items-center gap-6",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-[11px]",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif"},children:[r.toolbar.confidence,":"]}),jsx("span",{className:"text-[13px] font-semibold",style:{color:d,fontFamily:"'JetBrains Mono', monospace"},children:i!=null?`${i.toFixed(0)}%`:"\u2014"})]}),jsx("div",{className:"w-px h-5",style:{backgroundColor:a?"rgba(255,255,255,0.08)":e.borderLight}}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-[11px]",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif"},children:[r.toolbar.costAtCompletion,":"]}),jsx("span",{className:"text-[13px] font-bold",style:{color:e.textPrimary,fontFamily:"'JetBrains Mono', monospace"},children:m}),x&&y&&jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:b.bg,color:b.text,fontFamily:"'JetBrains Mono', monospace"},children:y})]})]})]})}function pv({theme:e,showCriticalPath:t,onShowCriticalPathChange:r,showBaseline:a,onShowBaselineChange:n,highlightWeekends:s,onHighlightWeekendsChange:o,showDependencies:c,onShowDependenciesChange:l,rowDensity:i,onRowDensityChange:d,hasDependencies:u=true}){let[p,m]=useState(false),f=useRef(null),x=useRef(null),y=ja(),b=Gs(f,p,"right",208),h=e.bgPrimary==="#050505"||(e.bgPrimary||"").charAt(1)==="0";useEffect(()=>{if(!p)return;let S=F=>{let k=F.target;f.current&&!f.current.contains(k)&&x.current&&!x.current.contains(k)&&m(false);};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[p]);let v=y.toolbar.visibility==="Visibilidad",w=[{key:"criticalPath",label:v?"Ruta Cr\xEDtica":"Critical Path",icon:Zap,active:t,onChange:r,disabled:!u,tooltip:u?void 0:v?"Agrega dependencias entre tareas para ver la ruta cr\xEDtica":"Add dependencies between tasks to see the critical path"},{key:"baselines",label:v?"L\xEDneas Base":"Baselines",icon:Layers,active:a,onChange:n},{key:"weekends",label:v?"Fines de Semana":"Weekends",icon:CalendarDays,active:s,onChange:o},{key:"dependencies",label:v?"Dependencias":"Dependencies",icon:GitBranch,active:c,onChange:l}],C=[{value:"compact",label:y.toolbar.visibility==="Visibilidad"?"Compacto":"Compact"},{value:"comfortable",label:"Normal"},{value:"spacious",label:y.toolbar.visibility==="Visibilidad"?"Amplio":"Spacious"}];return jsxs(Fragment,{children:[jsx(motion.button,{ref:f,onClick:()=>m(!p),className:"flex items-center justify-center w-8 h-8 rounded-lg",style:{color:p?e.accent:e.textTertiary,backgroundColor:p?e.accentLight:"transparent"},whileHover:{color:e.textPrimary,backgroundColor:e.hoverBg},title:y.toolbar.visibility,children:jsx(Eye,{className:"w-4 h-4"})}),createPortal(jsx(AnimatePresence,{children:p&&jsxs(motion.div,{ref:x,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-52 rounded-xl overflow-hidden",style:{top:b.top,left:b.left,zIndex:99999,backgroundColor:h?"rgba(10, 10, 10, 0.95)":e.bgSecondary||"#F8FAFC",border:`1px solid ${h?"rgba(255,255,255,0.08)":e.border||"#CBD5E1"}`,boxShadow:h?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:h?"rgba(255,255,255,0.35)":e.textTertiary},children:y.toolbar.visibility==="Visibilidad"?"OPCIONES DE VISTA":"DISPLAY OPTIONS"})}),jsx("div",{className:"py-0.5",children:w.map((S,F)=>{let k=S.icon,N=S.disabled,P=S.tooltip;return jsxs(motion.button,{onClick:()=>!N&&S.onChange?.(!S.active),className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:N?h?"rgba(255,255,255,0.3)":"#9CA3AF":h?"rgba(255,255,255,0.85)":"#111827",cursor:N?"not-allowed":"pointer"},whileHover:N?{}:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:F*.03},title:P,children:[jsx(k,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:N?h?"rgba(255,255,255,0.2)":"#D1D5DB":S.active?e.accent||"#00E5CC":e.textTertiary}}),jsx("span",{className:"flex-1 text-left",children:S.label}),S.active&&!N&&jsx(Check,{className:"w-3.5 h-3.5",style:{color:e.accent||"#00E5CC"}})]},S.key)})}),jsx("div",{className:"mx-3 h-px",style:{backgroundColor:h?"rgba(255,255,255,0.06)":e.borderLight}}),jsxs("div",{className:"py-0.5",children:[jsx("div",{className:"px-3 pt-2 pb-1",children:jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:h?"rgba(255,255,255,0.35)":e.textTertiary},children:y.toolbar.visibility==="Visibilidad"?"DENSIDAD":"DENSITY"})}),C.map((S,F)=>{let k=i===S.value;return jsxs(motion.button,{onClick:()=>d(S.value),className:"w-full flex items-center justify-between px-3 py-2 text-[11px] transition-colors",style:{color:h?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:(w.length+F)*.03},children:[jsx("span",{style:{color:k?e.accent||"#00E5CC":h?"rgba(255,255,255,0.85)":e.textPrimary},children:S.label}),k&&jsx(Check,{className:"w-3.5 h-3.5",style:{color:e.accent||"#00E5CC"}})]},S.value)})]})]})}),document.body)]})}function Ki({theme:e,timeScale:t,onTimeScaleChange:r,zoom:a,onZoomChange:n,currentTheme:s,onThemeChange:o,rowDensity:c,onRowDensityChange:l,showThemeSelector:i=false,showCreateTaskButton:d=false,createTaskLabel:u,onCreateTask:p,taskFilter:m="all",onTaskFilterChange:f,hideCompleted:x=false,onHideCompletedChange:y,toolbarRightContent:b,wbsLevel:h,onWbsLevelChange:v,maxWbsDepth:w=4,viewMode:C="execution",onViewModeChange:S,projectForecast:F,hideForecastHud:k,onExportPNG:N,onExportPDF:P,onExportExcel:T,onExportCSV:Y,onExportJSON:H,onExportMSProject:ee,showCriticalPath:I=true,onShowCriticalPathChange:K,showDependencies:j=true,onShowDependenciesChange:W,highlightWeekends:$=true,onHighlightWeekendsChange:ve,showBaseline:We=false,onShowBaselineChange:Pe,onCopySnapshotLink:be,hasDependencies:ye=true}){let fe=ja(),ze=N||P||T||Y||H||ee,Ce=!!e.glassToolbar,Ae=[{value:"day",label:fe.toolbar.day},{value:"week",label:fe.toolbar.week},{value:"month",label:fe.toolbar.month}],Me=[{value:"dark",label:"Dark",icon:jsx(Moon,{className:"w-3.5 h-3.5"})},{value:"light",label:"Light",icon:jsx(Sun,{className:"w-3.5 h-3.5"})},{value:"neutral",label:"Zen",icon:jsx(Palette,{className:"w-3.5 h-3.5"})}],qe=e.bgPrimary==="#050505"||e.textPrimary==="#FFFFFF";if(Ce){let de=qe?"rgba(255,255,255,0.08)":e.borderLight;return jsxs("div",{className:"flex flex-col",children:[jsxs("div",{className:"h-[52px] px-4 flex items-center justify-between border-b",style:{backgroundColor:e.glassToolbar,borderColor:e.borderLight,backdropFilter:"blur(12px)"},children:[jsx("div",{className:"flex items-center gap-3",children:S&&jsxs("div",{className:"inline-flex items-center rounded-full p-0.5",style:{backgroundColor:qe?"#000000":e.bgSecondary,border:`1px solid ${qe?"rgba(255,255,255,0.08)":e.border}`},children:[jsx(motion.button,{onClick:()=>S("execution"),className:"px-3 py-1.5 rounded-full text-[11px] font-medium transition-colors",style:{backgroundColor:C==="execution"?qe?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)":"transparent",color:C==="execution"?e.textPrimary:e.textTertiary,fontFamily:"Inter, sans-serif"},whileHover:C!=="execution"?{color:e.textSecondary}:{},children:fe.toolbar.viewExecution}),jsx(motion.button,{onClick:()=>S("oracle"),className:"px-3 py-1.5 rounded-full text-[11px] font-medium transition-colors",style:{backgroundColor:C==="oracle"?qe?"rgba(0, 229, 204,0.15)":"rgba(0, 196, 174,0.08)":"transparent",color:C==="oracle"?"#00E5CC":e.textTertiary,fontFamily:"Inter, sans-serif"},whileHover:C!=="oracle"?{color:e.textSecondary}:{},children:fe.toolbar.viewOracle})]})}),jsxs("div",{className:"flex items-center gap-3",children:[jsx(dv,{value:t,onChange:r,theme:e}),jsx("div",{className:"w-px h-5",style:{backgroundColor:de}}),v&&jsx(fm,{theme:e,value:h??"all",onChange:v,maxDepth:w}),f&&jsx(bm,{theme:e,value:m,onChange:f,hideCompleted:x,onHideCompletedChange:y}),b&&jsxs(Fragment,{children:[jsx("div",{className:"w-px h-5",style:{backgroundColor:de}}),b]}),jsx("div",{className:"w-px h-5",style:{backgroundColor:de}}),jsx(pv,{theme:e,showCriticalPath:I,onShowCriticalPathChange:K,showBaseline:We,onShowBaselineChange:Pe,highlightWeekends:$,onHighlightWeekendsChange:ve,showDependencies:j,onShowDependenciesChange:W,rowDensity:c,onRowDensityChange:l,hasDependencies:ye}),jsx(gm,{theme:e,onExportPNG:N,onExportPDF:P,onExportExcel:T,onExportMSProject:ee,onCopySnapshotLink:be}),d&&p&&jsxs(motion.button,{onClick:p,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px]",style:{background:`linear-gradient(135deg, ${e.accent} 0%, ${e.accentHover} 100%)`,color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:`0 2px 8px ${qe?"rgba(0, 229, 204,0.3)":"rgba(0, 196, 174,0.3)"}`},whileHover:{scale:1.02,boxShadow:`0 4px 12px ${qe?"rgba(0, 229, 204,0.4)":"rgba(0, 196, 174,0.4)"}`},whileTap:{scale:.98},children:[jsx(Plus,{className:"w-3.5 h-3.5"}),jsx("span",{children:u||fe.toolbar.createTask})]})]})]}),F&&!k&&jsx(uv,{theme:e,forecast:F})]})}return jsxs("div",{className:"h-12 px-4 flex items-center justify-between border-b",style:{backgroundColor:e.bgGrid,borderColor:e.border},children:[jsxs("div",{className:"flex items-center gap-3",children:[jsx(cv,{options:Ae,value:t,onChange:de=>r(de),theme:e}),jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),jsxs("div",{className:"flex items-center gap-1",children:[jsx(motion.button,{onClick:()=>n(Math.max(.5,a-.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:"transparent",color:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsx(ZoomOut,{className:"w-3.5 h-3.5"})}),jsxs("div",{className:"px-2 py-0.5 rounded text-[11px] tabular-nums min-w-[42px] text-center",style:{color:e.textSecondary,fontFamily:"'JetBrains Mono', monospace",fontWeight:500},children:[Math.round(a*100),"%"]}),jsx(motion.button,{onClick:()=>n(Math.min(2,a+.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:"transparent",color:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsx(ZoomIn,{className:"w-3.5 h-3.5"})})]}),jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),v&&jsx(fm,{theme:e,value:h??"all",onChange:v,maxDepth:w}),f&&jsxs(Fragment,{children:[jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),jsx(bm,{theme:e,value:m,onChange:f,hideCompleted:x,onHideCompletedChange:y})]})]}),jsxs("div",{className:"flex items-center gap-3",children:[b&&jsxs(Fragment,{children:[b,jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}})]}),d&&p&&jsxs(Fragment,{children:[jsxs(motion.button,{onClick:p,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{background:"linear-gradient(135deg, #00E5CC 0%, #00E5CC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 229, 204, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 229, 204, 0.4)"},whileTap:{scale:.98},children:[jsx(Plus,{className:"w-3.5 h-3.5"}),jsx("span",{children:u||fe.toolbar.createTask})]}),(ze||i)&&jsx("div",{className:"w-px h-6",style:{backgroundColor:e.borderLight}})]}),jsx(gm,{theme:e,onExportPNG:N,onExportPDF:P,onExportExcel:T,onExportMSProject:ee,onCopySnapshotLink:be}),i&&jsx("div",{className:"w-px h-6",style:{backgroundColor:e.borderLight}}),i&&jsx(lv,{options:Me,value:s,onChange:de=>o(de),theme:e})]})]})}function qi({columns:e,onToggleColumn:t,theme:r}){let[a,n]=useState(false),[s,o]=useState({x:0,y:0}),c=useRef(null),l=useRef(null);useEffect(()=>{if(!a)return;let d=u=>{c.current&&!c.current.contains(u.target)&&n(false);};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[a]);let i=e.filter(d=>d.id!=="name");return jsxs(Fragment,{children:[jsx(motion.button,{ref:l,onClick:()=>{if(!a&&l.current){let d=l.current.getBoundingClientRect();o({x:d.left,y:d.bottom+4});}n(!a);},className:"p-2 rounded-md transition-colors flex items-center gap-1",style:{backgroundColor:r.bgSecondary,border:`1px solid ${r.borderLight}`,color:r.textSecondary},whileHover:{backgroundColor:r.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsx(Plus,{className:"w-4 h-4"})}),jsx(AnimatePresence,{children:a&&jsx(lr,{children:jsx(motion.div,{ref:c,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15},className:"column-manager-menu fixed min-w-[180px] rounded-lg shadow-xl z-[9999]",style:{left:`${s.x}px`,top:`${s.y}px`,backgroundColor:r.bgSecondary,border:`1px solid ${r.border}`},children:jsxs("div",{className:"py-1",children:[jsx("div",{className:"px-3 py-2 text-xs uppercase tracking-wider",style:{color:r.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"Add Column"}),i.map(d=>jsxs("button",{onClick:()=>{t(d.id);},className:"w-full px-3 py-2 text-left flex items-center justify-between transition-colors text-sm",style:{color:r.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif"},onMouseEnter:u=>{u.currentTarget.style.backgroundColor=r.hoverBg;},onMouseLeave:u=>{u.currentTarget.style.backgroundColor="transparent";},children:[jsx("span",{children:d.label}),d.visible&&jsx(Check,{className:"w-4 h-4",style:{color:r.accent}})]},d.id))]})})})})]})}function os({isOpen:e,x:t,y:r,items:a,onClose:n,theme:s}){let o=useRef(null),[c,l]=useState({x:t,y:r});if(useEffect(()=>{if(!e)return;let d=200,u=a.length*36+8,p=8,m=window.innerWidth,f=window.innerHeight,x=t,y=r;t+d+p>m&&(x=t-d,x<p&&(x=p)),r+u+p>f&&(y=f-u-p,y<p&&(y=p)),l({x,y});},[e,t,r,a.length]),useEffect(()=>{if(!e)return;let d=p=>{o.current&&!o.current.contains(p.target)&&n();},u=p=>{p.key==="Escape"&&n();};return document.addEventListener("mousedown",d),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",u);}},[e,n]),!e)return null;let i=d=>d.startsWith("#")&&(d.length===7||d.length===4)?d:s.bgPrimary?.includes("1")||s.bgPrimary?.includes("2")||s.textPrimary?.toLowerCase().includes("fff")||s.textPrimary?.toLowerCase().includes("white")?"#1E2128":"#FFFFFF";return jsx(AnimatePresence,{children:jsx(motion.div,{ref:o,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15,ease:[.4,0,.2,1]},className:"fixed z-[9999] min-w-[200px] rounded-lg",style:{left:`${c.x}px`,top:`${c.y}px`,backgroundColor:i(s.bgSecondary),border:`1px solid ${s.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2)",backdropFilter:"none"},children:jsx("div",{className:"py-1",children:a.map(d=>jsxs("div",{children:[d.separator&&jsx("div",{className:"my-1 h-px",style:{backgroundColor:s.borderLight}}),jsxs("button",{onClick:()=>{d.disabled||(d.onClick(),n());},disabled:d.disabled,className:"w-full px-3 py-2 text-left flex items-center gap-2 transition-colors text-sm",style:{color:d.disabled?s.textTertiary:s.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif",cursor:d.disabled?"not-allowed":"pointer",opacity:d.disabled?.5:1},onMouseEnter:u=>{d.disabled||(u.currentTarget.style.backgroundColor=s.hoverBg);},onMouseLeave:u=>{u.currentTarget.style.backgroundColor="transparent";},children:[d.icon&&jsx("span",{style:{color:s.textSecondary},children:d.icon}),jsx("span",{className:"flex-1",children:d.label}),d.submenu&&jsx(ChevronRight,{className:"w-3.5 h-3.5",style:{color:s.textTertiary}})]})]},d.id))})})})}var ar={Edit:jsx(Edit3,{className:"w-4 h-4"}),Pencil:jsx(Pencil,{className:"w-4 h-4"}),Delete:jsx(Trash2,{className:"w-4 h-4"}),Add:jsx(Plus,{className:"w-4 h-4"}),AddSubtask:jsx(Plus,{className:"w-4 h-4"}),Remove:jsx(Minus,{className:"w-4 h-4"}),Link:jsx(Link2,{className:"w-4 h-4"}),Progress:jsx(BarChart3,{className:"w-4 h-4"}),Sort:jsx(ArrowUpDown,{className:"w-4 h-4"}),SortAsc:jsx(ArrowUp,{className:"w-4 h-4"}),SortDesc:jsx(ArrowDown,{className:"w-4 h-4"}),Hide:jsx(EyeOff,{className:"w-4 h-4"}),Show:jsx(Eye,{className:"w-4 h-4"}),Settings:jsx(Settings,{className:"w-4 h-4"}),Split:jsx(Scissors,{className:"w-4 h-4"}),Duplicate:jsx(Copy,{className:"w-4 h-4"}),MarkIncomplete:jsx(Circle,{className:"w-4 h-4"}),SetInProgress:jsx(PlayCircle,{className:"w-4 h-4"}),MarkComplete:jsx(CheckCircle2,{className:"w-4 h-4"})};function Em({tasks:e,selectedTaskIds:t,onTaskSelect:r,onTaskCreate:a,onTaskDelete:n,onTaskDuplicate:s,onTaskMove:o,onTaskIndent:c,onTaskOutdent:l,onTaskRename:i,onTaskToggleExpand:d,onOpenTaskModal:u,enableKeyboard:p=true}){let m=useRef(false),f=useCallback(v=>{m.current=v;},[]),x=useCallback(v=>{let w=[],C=S=>{for(let F of S)w.push(F),F.subtasks&&F.subtasks.length>0&&F.isExpanded&&C(F.subtasks);};return C(v),w},[]),y=useCallback(()=>{let v=x(e);for(let w of v)if(t.has(w.id))return w;return null},[e,t,x]),b=useCallback((v,w)=>{let C=x(e);if(C.length===0)return;let S=y();if(!S){r(C[0].id,false);return}let F=C.findIndex(P=>P.id===S.id);if(F===-1)return;let k=v==="up"?F-1:F+1;if(k<0||k>=C.length)return;let N=C[k];r(N.id,w);},[e,y,x,r]),h=useCallback(v=>{if(!p)return;let w=v.target;if(w.tagName==="INPUT"||w.tagName==="TEXTAREA"||w.isContentEditable||m.current){v.key==="Escape"&&(w.blur(),m.current=false);return}let F=navigator.platform.toUpperCase().indexOf("MAC")>=0?v.metaKey:v.ctrlKey,k=Array.from(t),N=y();if(v.key==="ArrowUp"){v.preventDefault(),b("up",v.shiftKey);return}if(v.key==="ArrowDown"){v.preventDefault(),b("down",v.shiftKey);return}if(N&&(v.key==="ArrowRight"||v.key==="ArrowLeft")){N.subtasks&&N.subtasks.length>0&&(v.preventDefault(),(v.key==="ArrowRight"&&!N.isExpanded||v.key==="ArrowLeft"&&N.isExpanded)&&d(N.id));return}if(v.altKey&&(v.key==="ArrowUp"||v.key==="ArrowDown")){k.length>0&&(v.preventDefault(),o(k,v.key==="ArrowUp"?"up":"down"));return}if(v.key==="Tab"&&!v.shiftKey){k.length>0&&(v.preventDefault(),c(k));return}if(v.key==="Tab"&&v.shiftKey){k.length>0&&(v.preventDefault(),l(k));return}if(v.key==="Enter"&&!v.shiftKey&&!F){N&&(v.preventDefault(),a(N.id,"below"));return}if(v.key==="Enter"&&v.shiftKey&&!F){N&&(v.preventDefault(),a(N.id,"above"));return}if(v.key==="Enter"&&F){N&&(v.preventDefault(),u(N.id));return}if(v.key==="F2"){N&&(v.preventDefault(),i(N.id));return}if(v.key==="Delete"||v.key==="Backspace"&&F){k.length>0&&(v.preventDefault(),n(k));return}if(v.key==="d"&&F&&!v.shiftKey){k.length>0&&(v.preventDefault(),s(k));return}},[p,t,y,b,a,n,s,o,c,l,i,d,u]);return useEffect(()=>{if(p)return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h);}},[p,h]),{setIsEditing:f}}function Pm(){let[e,t]=useState(new Set),[r,a]=useState(null),n=useCallback(u=>{t(new Set([u])),a(u);},[]),s=useCallback(u=>{t(p=>{let m=new Set(p);return m.has(u)?m.delete(u):m.add(u),m}),a(u);},[]),o=useCallback((u,p)=>{if(!r){n(u);return}let m=p.indexOf(r),f=p.indexOf(u);if(m===-1||f===-1){n(u);return}let x=Math.min(m,f),y=Math.max(m,f),b=p.slice(x,y+1);t(new Set(b)),a(u);},[r,n]),c=useCallback((u,p,m,f)=>{f?o(u,p):m?s(u):n(u);},[n,s,o]),l=useCallback((u,p)=>{p?t(m=>{let f=new Set(m);return f.add(u),f}):n(u);},[n]),i=useCallback(()=>{t(new Set),a(null);},[]),d=useCallback(u=>e.has(u),[e]);return {selectedTaskIds:e,selectTask:n,toggleTaskSelection:s,selectTaskRange:o,handleTaskClick:c,handleKeyboardSelection:l,clearSelection:i,isTaskSelected:d}}function Jc(e){return e.map((t,r)=>({...t,position:r,subtasks:t.subtasks?.length?Jc(t.subtasks):t.subtasks}))}function Mo(e){let t=[],r=(a,n,s=0)=>{let o=[...a].sort((c,l)=>(c.position??0)-(l.position??0));for(let c=0;c<o.length;c++){let l={...o[c],parentId:n,level:s,position:o[c].position??c};t.push(l),l.subtasks&&l.subtasks.length>0&&l.isExpanded&&r(l.subtasks,l.id,s+1);}};return r(e),t}function ss(e,t){for(let r of e){if(r.id===t)return r;if(r.subtasks){let a=ss(r.subtasks,t);if(a)return a}}return null}function Xc(e,t){for(let r of e)if(r.subtasks){if(r.subtasks.some(n=>n.id===t))return r;let a=Xc(r.subtasks,t);if(a)return a}return null}function Qc(e,t){if(t.length===0)return e;let r=Mo(e),a=t[0],n=r.findIndex(p=>p.id===a);if(n<=0)return e;let s=r[n-1],o=(p,m)=>{let f=[];return {tasks:p.filter(y=>{if(m.has(y.id))return f.push(y),false;if(y.subtasks){let b=o(y.subtasks,m);y.subtasks=b.tasks,f.push(...b.removed);}return true}),removed:f}},c=(p,m,f)=>p.map(x=>x.id===m?{...x,subtasks:[...x.subtasks||[],...f],isExpanded:true}:x.subtasks?{...x,subtasks:c(x.subtasks,m,f)}:x),l=new Set(t),{tasks:i,removed:d}=o(e,l),u=c(i,s.id,d);return Jc(u)}function Zc(e,t){if(t.length===0)return e;let r=[...e];for(let a of t){let n=Xc(r,a);if(!n)continue;let s=Xc(r,n.id),o=(i,d,u)=>{for(let p=0;p<i.length;p++){let m=i[p];if(m.id===d&&m.subtasks){let f=m.subtasks.findIndex(x=>x.id===u);if(f!==-1){let[x]=m.subtasks.splice(f,1);return x}}if(m.subtasks){let f=o(m.subtasks,d,u);if(f)return f}}return null},c=(i,d,u)=>{let p=i.findIndex(m=>m.id===d);if(p!==-1)return i.splice(p+1,0,u),i;for(let m of i)m.subtasks&&c(m.subtasks,d,u);return i},l=o(r,n.id,a);l&&(s&&s.subtasks?c(s.subtasks,n.id,l):c(r,n.id,l));}return Jc(r)}function ed(e,t,r){if(t.length===0)return e;let a=[...e],n=t[0],s=(o,c,l)=>{let i=o.findIndex(u=>u.id===c);if(i===-1){for(let u of o)if(u.subtasks&&s(u.subtasks,c,l))return true;return false}let d=l==="up"?i-1:i+1;return d<0||d>=o.length?false:([o[i],o[d]]=[o[d],o[i]],o[i]={...o[i],position:i},o[d]={...o[d],position:d},true)};return s(a,n,r),a}function td(e,t){let r=new Set(t),a=n=>n.filter(s=>!r.has(s.id)).map(s=>s.subtasks?{...s,subtasks:a(s.subtasks)}:s);return a(e)}function js(e,t){let r=[...e],a=[];for(let n of t){let s=(l,i)=>l.map((d,u)=>({...d,id:`${d.id}-copy-${Date.now()}-${u}`,parentId:i,subtasks:d.subtasks?s(d.subtasks,`${d.id}-copy-${Date.now()}-${u}`):void 0})),o=l=>{let i=l.findIndex(m=>m.id===n);if(i===-1){for(let m of l)if(m.subtasks){let f=o(m.subtasks);if(f)return f}return null}let d=l[i],u=`${d.id}-copy-${Date.now()}`,p={...d,id:u,name:`${d.name} (Copy)`,subtasks:d.subtasks?s(d.subtasks,u):void 0};return l.splice(i+1,0,p),p},c=o(r);c&&a.push(c);}return {tasks:r,duplicatedTasks:a}}function Fm(e,t,r){let a=[...e],n=new Date,s=new Date(n);s.setDate(s.getDate()+7);let o={id:`task-${Date.now()}`,name:"New Task",progress:0,status:"todo",startDate:n,endDate:s,color:"#00E5CC"},c=l=>{let i=l.findIndex(u=>u.id===t);if(i===-1){for(let u of l)if(u.subtasks&&c(u.subtasks))return true;return false}let d=r==="above"?i:i+1;return l.splice(d,0,o),true};return c(a),{tasks:a,newTask:o}}function rd(e,t,r){return e.map(a=>a.id===t?{...a,name:r}:a.subtasks?{...a,subtasks:rd(a.subtasks,t,r)}:a)}function ad(e,t){return e.map(r=>r.id===t?{...r,isExpanded:!r.isExpanded}:r.subtasks?{...r,subtasks:ad(r.subtasks,t)}:r)}function nd(e,t){let r=p=>{for(let m of p){if(m.id===t)return m;if(m.subtasks){let f=r(m.subtasks);if(f)return f}}return null},a=r(e),n=new Date,s=new Date(n);s.setDate(s.getDate()+7);let o=a?.startDate||n,c=a?.endDate||s,l=p=>{for(let m of p){if(m.id===t)return (m.subtasks||[]).length;if(m.subtasks){let f=l(m.subtasks);if(f>=0)return f}}return 0},i=l(e),d={id:`task-${Date.now()}`,name:"New Subtask",progress:0,status:"todo",startDate:new Date(o),endDate:new Date(c),color:a?.color||"#00E5CC",position:i,parentId:t},u=p=>p.map(m=>{if(m.id===t){let f=m.subtasks||[];return {...m,subtasks:[...f,d],isExpanded:true}}return m.subtasks?{...m,subtasks:u(m.subtasks)}:m});return {tasks:u(e),newTask:d}}function Lm(e,t,r,a){if(t===r)return e;let n=ss(e,t);if(!n)return e;if(r){let c=(l,i)=>{if(!l.subtasks)return false;for(let d of l.subtasks)if(d.id===i||c(d,i))return true;return false};if(c(n,r))return e}let s=c=>{let l=c.filter(d=>d.id!==t),i=l.length<c.length;return l.map((d,u)=>{let p=i?{...d,position:u}:d;return p.subtasks&&p.subtasks.length>0?{...p,subtasks:s(p.subtasks)}:p})},o=s(e);if(r===null){let c=a!==void 0?a:o.length;o.splice(c,0,{...n,parentId:void 0}),o=o.map((l,i)=>({...l,position:i}));}else {let c=l=>l.map(i=>{if(i.id===r){let d=i.subtasks||[],u=a!==void 0?a:d.length,p=[...d];p.splice(u,0,{...n,parentId:r});let m=p.map((f,x)=>({...f,position:x}));return {...i,subtasks:m,isExpanded:true}}return i.subtasks&&i.subtasks.length>0?{...i,subtasks:c(i.subtasks)}:i});o=c(o);}return o}function _a(e){return e.map(t=>{if(!t.subtasks||t.subtasks.length===0)return t;let r=_a(t.subtasks),a=r.reduce((c,l)=>(l.startDate&&c.starts.push(new Date(l.startDate).getTime()),l.endDate&&c.ends.push(new Date(l.endDate).getTime()),c.progresses.push(l.progress??0),c),{starts:[],ends:[],progresses:[]}),n=a.starts.length>0?new Date(Math.min(...a.starts)):t.startDate,s=a.ends.length>0?new Date(Math.max(...a.ends)):t.endDate,o=a.progresses.length>0?Math.round(a.progresses.reduce((c,l)=>c+l,0)/a.progresses.length):t.progress;return {...t,subtasks:r,startDate:n,endDate:s,progress:o}})}function Xi({tasks:e,theme:t,rowHeight:r,availableUsers:a=[],templates:n,onTaskClick:s,onTaskDblClick:o,onTaskContextMenu:c,onTaskToggle:l,scrollTop:i,columns:d,onToggleColumn:u,onColumnResize:p,onTaskUpdate:m,onBulkFill:f,onTaskIndent:x,onTaskOutdent:y,onTaskMove:b,onMultiTaskDelete:h,onTaskDuplicate:v,onTaskCreate:w,onTaskRename:C,onCreateSubtask:S,onOpenTaskModal:F,onDeleteRequest:k,onTaskReparent:N,allTasks:P,scrollContainerRef:T,showCriticalPath:Y=false}){let H=useContext(rs),[ee,I]=useState(null),[K,j]=useState(null),[W,$]=useState(""),ve=useRef(null),[We,Pe]=useState(null),[be,ye]=useState(0),[fe,ze]=useState(0),[Ce,Ae]=useState({isOpen:false,x:0,y:0,type:"header"}),[Me,qe]=useState(null),[de,et]=useState(null),[Re,Be]=useState(null),Nt=useRef(0),bt=5,Oe=useRef(false),[Ie,st]=useState(null),[kt,$e]=useState(false),He=useRef(null),[L,oe]=useState(null),[B,_]=useState(null),[U,J]=useState(false),De=useRef(null);useEffect(()=>{function se(me){De.current&&!De.current.contains(me.target)&&J(false);}if(U)return document.addEventListener("mousedown",se),()=>document.removeEventListener("mousedown",se)},[U]),useEffect(()=>{K&&ve.current&&(ve.current.focus(),ve.current.select());},[K]),useEffect(()=>{if(!We)return;let se=mt=>{let Xe=mt.clientX-be,it=fe+Xe;p?.(We,it);},me=()=>{Pe(null),document.body.style.cursor="",document.body.style.userSelect="";};return document.addEventListener("mousemove",se),document.addEventListener("mouseup",me),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",se),document.removeEventListener("mouseup",me),document.body.style.cursor="",document.body.style.userSelect="";}},[We,be,fe,p]);let{selectedTaskIds:pe,handleTaskClick:rt,isTaskSelected:tt}=Pm(),{setIsEditing:Qe}=Em({tasks:e,selectedTaskIds:pe,onTaskSelect:(se,me)=>{let Xe=Mo(e).map(it=>it.id);rt(se,Xe,me||false,false);},onTaskCreate:w||(()=>{}),onTaskDelete:h||(()=>{}),onTaskDuplicate:v||(()=>{}),onTaskMove:b||(()=>{}),onTaskIndent:x||(()=>{}),onTaskOutdent:y||(()=>{}),onTaskRename:se=>{let me=Mo(e).find(mt=>mt.id===se);me&&hr(me);},onTaskToggleExpand:l||(()=>{}),onOpenTaskModal:se=>{let me=Mo(e).find(mt=>mt.id===se);me&&F&&F(me);},enableKeyboard:true}),Ht=(se,me=0,mt="")=>{let Xe=[],it=[...se].sort((V,ce)=>(V.position??0)-(ce.position??0));for(let V=0;V<it.length;V++){let ce=it[V],Q=V+1,O=mt?`${mt}.${Q}`:`${Q}.0`,te=ce.wbsCode||O;if(ce.wbsCode=te,Xe.push({task:ce,level:me}),ce.subtasks&&ce.subtasks.length>0&&ce.isExpanded){let M=ce.wbsCode?.replace(/\.0$/,"")||(mt?`${mt}.${Q}`:`${Q}`);Xe.push(...Ht(ce.subtasks,me+1,M));}}return Xe},pt=Ht(e),qt=48,Ut=Math.max(pt.length*r,600-qt),ur=(se,me)=>me==="assignees"?se.assignees:me==="startDate"?se.startDate:se.endDate,br=(se,me,mt,Xe)=>{se.preventDefault(),se.stopPropagation(),oe({sourceTaskId:me,column:mt,sourceIndex:Xe,targetIndex:Xe}),document.body.style.cursor="crosshair",document.body.style.userSelect="none";let it=se.currentTarget.closest("[data-grid-body]"),V=q=>{let xe=it?.getBoundingClientRect().top??0,re=Math.floor((q-xe)/r);return re=Math.max(0,Math.min(pt.length-1,re)),re<Xe&&(re=Xe),re},ce=se.clientY,Q=T?.current??null,O=()=>{He.current&&(cancelAnimationFrame(He.current),He.current=null);},te=()=>{let q=V(ce);oe(xe=>xe&&{...xe,targetIndex:q});},we=()=>{if(O(),!Q)return;let q=Q.getBoundingClientRect(),xe=60,re=12,Ze=ce-q.top,Ye=q.bottom-ce;if(Ye<xe&&Q.scrollTop<Q.scrollHeight-Q.clientHeight){let Rt=Math.max(1,Math.round(re*(1-Math.max(0,Ye)/xe))),Lt=()=>{Q.scrollTop+=Rt,te(),Q.scrollTop<Q.scrollHeight-Q.clientHeight&&(He.current=requestAnimationFrame(Lt));};He.current=requestAnimationFrame(Lt);}else if(Ze<xe&&Q.scrollTop>0){let Rt=Math.max(1,Math.round(re*(1-Math.max(0,Ze)/xe))),Lt=()=>{Q.scrollTop-=Rt,te(),Q.scrollTop>0&&(He.current=requestAnimationFrame(Lt));};He.current=requestAnimationFrame(Lt);}},M=q=>{ce=q.clientY,te(),we();},R=q=>{window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",R),O(),document.body.style.cursor="",document.body.style.userSelect="",oe(null);let xe=V(q.clientY),re=pt.find(Bt=>Bt.task.id===me)?.task;if(!re)return;let Ze=ur(re,mt),Ye=Math.min(Xe,xe),Rt=Math.max(Xe,xe),Lt=[];for(let Bt=Ye;Bt<=Rt;Bt++){if(Bt===Xe)continue;let or=pt[Bt]?.task;!or||or.subtasks&&or.subtasks.length>0||Lt.push(or.id);}Lt.length!==0&&f?.(Lt,mt,Ze);};window.addEventListener("mousemove",M),window.addEventListener("mouseup",R);},da=se=>{if(!L)return false;let me=Math.min(L.sourceIndex,L.targetIndex),mt=Math.max(L.sourceIndex,L.targetIndex);return se>=me&&se<=mt},Yt=se=>!se.startDate||!se.endDate?"-":`${Math.ceil((se.endDate.getTime()-se.startDate.getTime())/(1e3*60*60*24))}d`,hr=se=>{j(se.id),$(se.name),Qe(true);},Ft=se=>{W.trim()&&W!==e.find(me=>me.id===se)?.name&&C?.(se,W.trim()),j(null),$(""),Qe(false);},jr=()=>{j(null),$(""),Qe(false);},Wt=(se,me)=>{me.stopPropagation(),S?.(se.id);},nr=(se,me)=>{me.preventDefault(),Nt.current=me.clientY,qe(se),Oe.current=false,$e(false),st({x:me.clientX,y:me.clientY});},_r=se=>{if(!Me||(Math.abs(se.clientY-Nt.current)>bt&&!Oe.current&&(Oe.current=true,$e(true)),st({x:se.clientX,y:se.clientY}),!Oe.current))return;if(T?.current){let V=T.current,ce=V.getBoundingClientRect(),Q=60,O=12;He.current&&(cancelAnimationFrame(He.current),He.current=null);let te=se.clientY-ce.top,we=ce.bottom-se.clientY;if(te<Q&&V.scrollTop>0){let M=Math.round(O*(1-te/Q)),R=()=>{V.scrollTop-=M,Oe.current&&V.scrollTop>0&&(He.current=requestAnimationFrame(R));};He.current=requestAnimationFrame(R);}else if(we<Q&&V.scrollTop<V.scrollHeight-V.clientHeight){let M=Math.round(O*(1-we/Q)),R=()=>{V.scrollTop+=M,Oe.current&&V.scrollTop<V.scrollHeight-V.clientHeight&&(He.current=requestAnimationFrame(R));};He.current=requestAnimationFrame(R);}}let mt=document.querySelectorAll("[data-task-row]"),Xe=null,it=null;mt.forEach(V=>{let ce=V.getBoundingClientRect(),Q=V.getAttribute("data-task-row");if(Q&&Q!==Me&&se.clientY>=ce.top&&se.clientY<=ce.bottom){Xe=Q;let O=se.clientY-ce.top,te=ce.height;O<te*.25?it="above":O>te*.75?it="below":it="child";}}),et(Xe),Be(it);},Dr=()=>{if(Oe.current&&Me&&de&&Re){if(Re==="child")N?.(Me,de);else if(Re==="above"||Re==="below"){let se=(V,ce,Q=null)=>{for(let O of V){if(O.id===ce)return Q;if(O.subtasks){let te=se(O.subtasks,ce,O.id);if(te!==void 0)return te}}},me=P&&P.length>0?P:e,mt=se(me,Me,null),Xe=se(me,de,null),it=(V,ce,Q,O)=>{let te=V.findIndex(R=>R.id===ce),we=O?V.findIndex(R=>R.id===Q):-1,M=Re==="below"?te+1:te;return O&&we!==-1&&we<te&&(M-=1),Math.max(0,M)};if(Xe===null){let ce=it(me,de,Me,mt===null);N?.(Me,null,ce);}else {let V=ss(me,Xe);if(V?.subtasks){let ce=mt===Xe,Q=it(V.subtasks,de,Me,ce);N?.(Me,Xe,Q);}}}}He.current&&(cancelAnimationFrame(He.current),He.current=null),qe(null),et(null),Be(null),st(null),Oe.current=false,$e(false);};useEffect(()=>{if(Me)return document.addEventListener("mousemove",_r),document.addEventListener("mouseup",Dr),document.body.style.cursor="grabbing",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",_r),document.removeEventListener("mouseup",Dr),document.body.style.cursor="",document.body.style.userSelect="";}},[Me,de,Re]);let ot=(se,me,mt)=>{let Xe=me.subtasks&&me.subtasks.length>0;switch(se.id){case "name":let it=K===me.id,V=ee===me.id;return jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 relative",style:{paddingLeft:`${mt*20}px`},children:[N&&jsx("div",{className:"cursor-grab active:cursor-grabbing p-0.5 rounded hover:bg-white/10 transition-all flex-shrink-0",style:{color:t.textTertiary,opacity:V?1:.3},onMouseDown:re=>nr(me.id,re),title:"Arrastrar para mover tarea",children:jsx(GripVertical,{className:"w-4 h-4"})}),me.subtasks&&me.subtasks.length>0?jsx("button",{onClick:re=>{re.stopPropagation(),l?.(me.id);},className:"p-0.5 hover:bg-opacity-10 rounded transition-colors flex-shrink-0",style:{color:t.textSecondary},children:me.isExpanded?jsx(ChevronDown,{className:"w-4 h-4"}):jsx(ChevronRight,{className:"w-4 h-4"})}):jsx("div",{className:"w-5 h-5 flex-shrink-0"}),it?jsx("input",{ref:ve,type:"text",value:W,onChange:re=>$(re.target.value),onKeyDown:re=>{re.key==="Enter"?Ft(me.id):re.key==="Escape"&&jr();},onBlur:()=>Ft(me.id),className:"flex-1 px-2 py-1 rounded border outline-none",style:{backgroundColor:t.bgPrimary,borderColor:t.accent,color:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:"13px",fontWeight:500},onClick:re=>re.stopPropagation()}):jsxs(Fragment,{children:[jsxs("span",{className:"flex-1 min-w-0",style:{display:"flex",alignItems:"baseline",gap:"6px",color:me.parentId?t.textSecondary:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:me.parentId?"13px":"14px",fontWeight:me.isMilestone?600:me.parentId?400:600,letterSpacing:me.parentId?"0":"-0.01em"},title:me.name,children:[me.wbsCode&&jsx("span",{style:{color:t.textTertiary,fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,opacity:.65,flexShrink:0},children:me.wbsCode}),me.isHighlighted&&me.status==="completed"&&jsx("span",{title:"\u2605",style:{color:"#F59E0B",fontSize:"10px",flexShrink:0,lineHeight:1},children:"\u2605"}),jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:me.name}),me.subtasks&&me.subtasks.length>0&&jsxs("span",{style:{color:"#6B7280",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",fontWeight:400,flexShrink:0,whiteSpace:"nowrap"},children:["\xB7 ",Math.round(me.progress||0),"%"]}),Y&&me.isCriticalPath&&jsx("span",{style:{display:"inline-block",width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#EF4444",flexShrink:0,marginLeft:"2px"}}),Y&&me.cpmData&&jsxs("span",{style:{color:me.cpmData.totalFloat<=0?"#EF4444":me.cpmData.totalFloat<=5?"#F59E0B":"#6B7280",fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",fontWeight:500,flexShrink:0,whiteSpace:"nowrap",marginLeft:"4px"},children:["TF: ",Math.round(me.cpmData.totalFloat),"d"]})]}),V&&!it&&jsxs("div",{className:"flex items-center gap-1 ml-2",onClick:re=>re.stopPropagation(),children:[jsx("button",{onClick:re=>Wt(me,re),className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Create subtask",children:jsx(Plus,{className:"w-3.5 h-3.5"})}),jsx("button",{onClick:re=>{re.stopPropagation(),hr(me);},className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Rename (F2)",children:jsx(Edit3,{className:"w-3.5 h-3.5"})})]})]})]});case "startDate":case "endDate":let Q=se.id==="startDate"?"startDate":"endDate",O=me[Q],te=B?.taskId===me.id&&B?.field===Q,we=re=>re?(typeof re=="string"?new Date(re):re).toLocaleDateString("es-ES",{day:"2-digit",month:"2-digit",year:"numeric"}):"-";return jsxs("div",{className:"flex items-center justify-center w-full relative",onClick:re=>re.stopPropagation(),children:[jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-2 py-1 rounded text-xs transition-colors hover:bg-white/5",style:{color:t.textSecondary,opacity:Xe?.5:1,cursor:Xe?"default":"pointer"},title:Xe?"Auto-calculated from subtasks":void 0,onClick:re=>{if(!Xe)if(te)_(null);else {let Ze=re.currentTarget.getBoundingClientRect();_({taskId:me.id,field:Q,month:O?typeof O=="string"?new Date(O):O:new Date,position:{top:Ze.bottom+4,left:Ze.left}});}},children:[jsx(Calendar,{className:"w-3 h-3",style:{color:t.textTertiary}}),jsx("span",{children:we(O)}),Xe&&jsx("span",{style:{fontSize:"9px",color:t.textTertiary,marginLeft:"2px"},children:"\u25BC"})]}),te&&typeof document<"u"&&createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-[9998]",onClick:()=>_(null)}),jsxs(motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"fixed z-[9999] rounded-xl shadow-2xl overflow-visible flex",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,top:B?.position.top,left:B?.position.left},onClick:re=>re.stopPropagation(),children:[jsxs("div",{className:"w-36 py-2",style:{borderRight:`1px solid ${t.border}`},children:[(()=>{let re=new Date,Ze=new Date(re);Ze.setDate(re.getDate()+1);let Ye=new Date(re);Ye.setDate(re.getDate()+7);let Rt=new Date(re);return Rt.setDate(re.getDate()+14),[{label:"Hoy",date:re},{label:"Ma\xF1ana",date:Ze},{label:"Pr\xF3xima semana",date:Ye},{label:"2 semanas",date:Rt}].map((Bt,or)=>jsx("button",{type:"button",className:"w-full px-3 py-1.5 text-xs text-left transition-colors",style:{color:t.textPrimary},onMouseEnter:Qa=>Qa.currentTarget.style.backgroundColor=t.hoverBg||"rgba(255,255,255,0.05)",onMouseLeave:Qa=>Qa.currentTarget.style.backgroundColor="transparent",onClick:()=>{m?.(me.id,{[Q]:Bt.date}),_(null);},children:Bt.label},or))})(),jsx("div",{style:{borderTop:`1px solid ${t.border}`,margin:"0.25rem 0"}}),jsx("button",{type:"button",className:"w-full px-3 py-1.5 text-xs text-left transition-colors",style:{color:"#EF4444"},onMouseEnter:re=>re.currentTarget.style.backgroundColor=t.hoverBg||"rgba(255,255,255,0.05)",onMouseLeave:re=>re.currentTarget.style.backgroundColor="transparent",onClick:()=>{m?.(me.id,{[Q]:void 0}),_(null);},children:"Borrar"})]}),jsxs("div",{className:"p-2",children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsx("button",{type:"button",onClick:()=>_(re=>re?{...re,month:new Date(re.month.getFullYear(),re.month.getMonth()-1)}:null),className:"p-1 rounded hover:bg-white/10",children:jsx(ChevronLeft,{className:"w-3.5 h-3.5",style:{color:t.textSecondary}})}),jsx("span",{className:"text-xs font-medium",style:{color:t.textPrimary},children:B?.month.toLocaleDateString("es-ES",{month:"long",year:"numeric"})}),jsx("button",{type:"button",onClick:()=>_(re=>re?{...re,month:new Date(re.month.getFullYear(),re.month.getMonth()+1)}:null),className:"p-1 rounded hover:bg-white/10",children:jsx(ChevronRight,{className:"w-3.5 h-3.5",style:{color:t.textSecondary}})})]}),jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:["D","L","M","M","J","V","S"].map((re,Ze)=>jsx("div",{className:"w-6 h-6 flex items-center justify-center text-[10px]",style:{color:t.textTertiary},children:re},Ze))}),jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let re=B?.month||new Date,Ze=re.getFullYear(),Ye=re.getMonth(),Rt=new Date(Ze,Ye,1).getDay(),Lt=new Date(Ze,Ye+1,0).getDate(),Bt=new Date,or=[];for(let sr=Rt-1;sr>=0;sr--)or.push({day:new Date(Ze,Ye,-sr).getDate(),date:new Date(Ze,Ye-1,new Date(Ze,Ye,-sr).getDate()),isCurrentMonth:false});for(let sr=1;sr<=Lt;sr++)or.push({day:sr,date:new Date(Ze,Ye,sr),isCurrentMonth:true});let Qa=42-or.length;for(let sr=1;sr<=Qa;sr++)or.push({day:sr,date:new Date(Ze,Ye+1,sr),isCurrentMonth:false});return or.map((sr,Ra)=>{let Ho=sr.date.toDateString()===Bt.toDateString(),Vn=(O?typeof O=="string"?new Date(O):O:null)?.toDateString()===sr.date.toDateString();return jsx("button",{type:"button",className:"w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors",style:{color:sr.isCurrentMonth?Vn?"#FFF":t.textPrimary:t.textTertiary,backgroundColor:Vn?"#00E5CC":"transparent",boxShadow:Ho&&!Vn?"inset 0 0 0 1px #00E5CC":"none"},onClick:()=>{m?.(me.id,{[Q]:sr.date}),_(null);},children:sr.day},Ra)})})()})]})]})]}),document.body)]});case "duration":return jsx("div",{className:"flex items-center justify-center w-full",children:jsx("span",{className:"text-xs tabular-nums",style:{color:t.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:600},children:Yt(me)})});case "assignees":if(Xe)return jsx("div",{className:"flex items-center justify-center w-full",style:{opacity:.4},children:jsx("span",{className:"text-xs",style:{color:t.textTertiary},children:"\u2014"})});let M=a.filter(re=>me.assignees?.some(Ze=>Ze.id?Ze.id===re.id:Ze.name===re.name||Ze.initials===re.initials));return jsx("div",{className:"flex items-center justify-center w-full",onClick:re=>re.stopPropagation(),children:jsx(ko,{assignedUsers:M,availableUsers:a,onChange:re=>{let Ze=re.map(Ye=>({id:Ye.id,name:Ye.name,initials:Ye.initials,color:Ye.color}));m?.(me.id,{assignees:Ze});}})});case "status":if(Xe){let re=me.progress===100?"\u2713":me.progress>0?"\u25D0":"\u25CB";return jsx("div",{className:"flex items-center justify-center w-full",style:{opacity:.5},children:jsx("span",{className:"text-xs",style:{color:t.textTertiary},children:re})})}return jsx("div",{className:"flex items-center justify-center w-full",onClick:re=>re.stopPropagation(),children:jsx(tp,{status:me.status||"todo",onChange:re=>{m?.(me.id,{status:re,progress:re==="completed"?100:me.progress});}})});case "progress":return jsxs("div",{className:"flex items-center justify-center gap-2 w-full",style:{opacity:Xe?.6:1},children:[jsx("div",{className:"flex-1 h-1.5 rounded-full overflow-hidden max-w-[60px]",style:{backgroundColor:t.bgSecondary},children:jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${me.progress}%`,backgroundColor:me.progress===100?t.statusCompleted:t.accent}})}),jsxs("span",{className:"text-xs tabular-nums min-w-[35px] text-right",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:[me.progress,"%"]})]});case "priority":let R={low:"LOW",medium:"MEDIUM",high:"HIGH",urgent:"URGENT"},q={LOW:"low",MEDIUM:"medium",HIGH:"high",URGENT:"urgent"},xe=R[me.priority||"medium"]||"MEDIUM";return jsx("div",{className:"flex items-center justify-center w-full",onClick:re=>re.stopPropagation(),children:jsx(vo,{priority:xe,onChange:re=>{re&&m?.(me.id,{priority:q[re]||"medium"});}})});default:return null}},_e=se=>[{id:"hide",label:"Hide Column",icon:ar.Hide,onClick:()=>u(se),disabled:se==="name"},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"sortAsc",label:"Sort Ascending",icon:ar.SortAsc,onClick:()=>{}},{id:"sortDesc",label:"Sort Descending",icon:ar.SortDesc,onClick:()=>{}}],ua=se=>{let me=se.subtasks&&se.subtasks.length>0,mt=Mo(e),Xe=pe.size>1&&pe.has(se.id),it=Xe?mt.filter(te=>pe.has(te.id)):[se],V=it.map(te=>te.id),ce=it.filter(te=>!(te.subtasks&&te.subtasks.length>0)),Q=Xe?` (${V.length})`:"",O=()=>{k?k(V,se.name):h?.(V);};return me?[{id:"addSubtask",label:H?.contextMenu?.addSubtask||"Add Subtask",icon:ar.Add,onClick:()=>{S?.(se.id);}},{id:"duplicate",label:(H?.contextMenu?.duplicateTask||"Duplicate Task")+Q,icon:ar.Duplicate,onClick:()=>{v?.(V);}},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"delete",label:(H?.contextMenu?.deleteTask||"Delete Task")+Q,icon:ar.Delete,onClick:O}]:[{id:"edit",label:H?.contextMenu?.editTask||"Edit Task",icon:ar.Pencil,onClick:()=>{o?.(se);}},{id:"addSubtask",label:H?.contextMenu?.addSubtask||"Add Subtask",icon:ar.Add,onClick:()=>{S?.(se.id);}},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"markIncomplete",label:(H?.contextMenu?.markIncomplete||"Mark Incomplete")+Q,icon:ar.MarkIncomplete,onClick:()=>{ce.forEach(te=>m?.(te.id,{status:"todo",progress:0}));},disabled:ce.length===0||ce.every(te=>te.status==="todo")},{id:"setInProgress",label:(H?.contextMenu?.setInProgress||"Set In Progress")+Q,icon:ar.SetInProgress,onClick:()=>{ce.forEach(te=>m?.(te.id,{status:"in-progress"}));},disabled:ce.length===0||ce.every(te=>te.status==="in-progress")},{id:"markComplete",label:(H?.contextMenu?.markComplete||"Mark Complete")+Q,icon:ar.MarkComplete,onClick:()=>{ce.forEach(te=>m?.(te.id,{status:"completed",progress:100}));},disabled:ce.length===0||ce.every(te=>te.status==="completed")},{id:"sep2",label:"",onClick:()=>{},separator:true},{id:"duplicate",label:(H?.contextMenu?.duplicateTask||"Duplicate Task")+Q,icon:ar.Duplicate,onClick:()=>{v?.(V);}},{id:"split",label:H?.contextMenu?.splitTask||"Split Task",icon:ar.Split,onClick:()=>{},disabled:true},{id:"sep3",label:"",onClick:()=>{},separator:true},{id:"delete",label:(H?.contextMenu?.deleteTask||"Delete Task")+Q,icon:ar.Delete,onClick:O}]},jt=d.filter(se=>se.visible),oa=jt.reduce((se,me)=>se+me.width,0);return jsxs("div",{className:"gantt-taskgrid-content",style:{backgroundColor:t.bgPrimary,minWidth:oa},children:[jsxs("div",{className:"sticky top-0 z-10 flex items-center",style:{backgroundColor:t.glassHeader||t.bgSecondary,height:`${qt}px`,paddingLeft:"3px",borderBottom:`1px solid ${t.border}`,boxSizing:"border-box"},children:[jsx("div",{className:"flex items-center flex-1 min-w-0",children:jt.map((se,me)=>{let mt=me===jt.length-1,Xe=se.id==="name";return jsxs("div",{className:`flex items-center px-4 cursor-pointer hover:bg-opacity-50 transition-colors relative ${Xe?"":"justify-center"}`,style:{width:`${se.width}px`,minWidth:`${se.minWidth??(Xe?200:60)}px`,maxWidth:`${se.maxWidth??2e3}px`,flexShrink:Xe&&jt.length===1?1:0,flexGrow:Xe&&jt.length===1?1:0,borderRight:mt?"none":`1px solid ${t.borderLight}`,height:"100%",boxSizing:"border-box",overflow:"hidden"},onContextMenu:it=>{it.preventDefault(),Ae({isOpen:true,x:it.clientX,y:it.clientY,type:"header",columnId:se.id});},onMouseEnter:it=>{it.currentTarget.style.backgroundColor=t.hoverBg;},onMouseLeave:it=>{it.currentTarget.style.backgroundColor="transparent";},children:[jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,paddingRight:"0"},title:se.label,children:se.label}),se.resizable&&jsx("div",{className:"absolute right-0 top-0 bottom-0 cursor-col-resize transition-colors group",style:{width:"12px",marginRight:"-6px",backgroundColor:We===se.id?`${t.accent}30`:"transparent",zIndex:5},onMouseDown:it=>{it.preventDefault(),it.stopPropagation(),Pe(se.id),ye(it.clientX),ze(se.width);},title:"Drag to resize column",children:jsx("div",{className:"absolute top-0 bottom-0 transition-opacity",style:{left:"5px",width:"2px",backgroundColor:t.accent,borderRadius:"1px",opacity:We===se.id?.8:void 0},children:jsx("div",{className:"absolute inset-0 opacity-20 group-hover:opacity-80 transition-opacity",style:{backgroundColor:t.accent}})})})]},se.id)})}),jsxs("div",{className:"flex items-center gap-1 px-2",style:{position:"sticky",right:0,height:"100%",backgroundColor:t.glassHeader||t.bgSecondary,zIndex:5},children:[jsx(qi,{columns:d,onToggleColumn:u,theme:t}),jsx("button",{onClick:()=>J(!U),className:"p-1.5 rounded hover:bg-opacity-10 transition-colors",style:{color:t.textTertiary},title:"Keyboard shortcuts",children:jsx(Keyboard,{className:"w-4 h-4"})}),U&&jsxs("div",{ref:De,className:"absolute top-full right-0 mt-2 p-4 rounded-lg shadow-2xl z-50 min-w-[400px]",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,color:t.textPrimary},onClick:se=>se.stopPropagation(),children:[jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b",style:{borderColor:t.border},children:[jsx("h3",{className:"font-semibold text-sm",style:{color:t.textPrimary},children:"Keyboard Shortcuts"}),jsx("button",{onClick:()=>J(false),className:"text-xs px-2 py-1 rounded hover:bg-opacity-10",style:{color:t.textTertiary},children:"Close"})]}),jsxs("div",{className:"space-y-3 text-xs",children:[jsxs("div",{children:[jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Navigation"}),jsxs("div",{className:"space-y-1",children:[jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Move focus up/down"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2191 / \u2193"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Select range"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + \u2191 / \u2193"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Toggle selection"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Click"})]})]})]}),jsxs("div",{children:[jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Hierarchy"}),jsxs("div",{className:"space-y-1",children:[jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Indent task"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Tab"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Outdent task"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Tab"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Expand/Collapse"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2192 / \u2190"})]})]})]}),jsxs("div",{children:[jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Editing"}),jsxs("div",{className:"space-y-1",children:[jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Create task below"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Enter"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Create task above"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Enter"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Open task modal"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Enter"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Rename task"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"F2"})]})]})]}),jsxs("div",{children:[jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Actions"}),jsxs("div",{className:"space-y-1",children:[jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Move task up/down"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Alt + \u2191 / \u2193"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Delete task"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Delete"})]}),jsxs("div",{className:"flex justify-between",children:[jsx("span",{style:{color:t.textTertiary},children:"Duplicate task"}),jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + D"})]})]})]})]})]})]})]}),jsx("div",{className:"gantt-taskgrid-content","data-grid-body":true,style:{minHeight:Ut},children:pt.map(({task:se,level:me},mt)=>{let Xe=tt(se.id),it=da(mt),V=de===se.id,ce=V&&Re==="above",Q=V&&Re==="below",O=V&&Re==="child",te={};return O&&(te.backgroundColor=`${t.accent}15`,te.boxShadow=`inset 0 0 0 2px ${t.accent}`),jsxs(motion.div,{"data-task-row":se.id,className:`flex items-center cursor-pointer group ${Me===se.id?"opacity-50":""}`,style:{position:"relative",height:`${r}px`,borderLeft:Xe?`3px solid ${t.accent}`:"3px solid transparent",backgroundColor:Xe?t.accentLight:O?`${t.accent}15`:mt%2===0?t.bgPrimary:t.bgGrid,opacity:Y?se.isCriticalPath?1:.4:void 0,transition:"opacity 300ms ease",...te},onMouseEnter:()=>I(se.id),onMouseLeave:()=>I(null),onClick:we=>{let R=Mo(e).map(re=>re.id),xe=navigator.platform.toUpperCase().indexOf("MAC")>=0?we.metaKey:we.ctrlKey;rt(se.id,R,xe,we.shiftKey),!xe&&!we.shiftKey&&s?.(se);},onDoubleClick:we=>{we.stopPropagation(),o?.(se);},onContextMenu:we=>{we.preventDefault(),Ae({isOpen:true,x:we.clientX,y:we.clientY,type:"task",task:se}),c?.(se,we);},whileHover:{backgroundColor:Xe?t.accentLight:t.hoverBg},children:[ce&&jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"2px",backgroundColor:t.accent,zIndex:10}}),Q&&jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"2px",backgroundColor:t.accent,zIndex:10}}),jt.map((we,M)=>{let R=M===jt.length-1,q=we.id==="name",xe=!!(se.subtasks&&se.subtasks.length>0),re=we.id==="assignees"||we.id==="startDate"||we.id==="endDate"?we.id:null,Ye=!!re&&!xe&&ee===se.id&&!L,Rt=it&&!!L&&L.column===we.id;return jsxs("div",{className:`px-4 flex items-center ${q?"justify-start":"justify-center"}`,style:{position:"relative",width:`${we.width}px`,minWidth:`${we.minWidth??(q?200:60)}px`,maxWidth:`${we.maxWidth??2e3}px`,flexShrink:q&&jt.length===1?1:0,flexGrow:q&&jt.length===1?1:0,borderRight:R?"none":`1px solid ${ee===se.id?t.border:t.borderLight}`,height:"100%",boxSizing:"border-box",overflow:"visible",backgroundColor:Rt?`${t.accent}22`:void 0,boxShadow:Rt?`inset 0 0 0 1px ${t.accent}66`:void 0},children:[ot(we,se,q?me:0),Ye&&re&&jsx("div",{title:"Arrastr\xE1 hacia abajo para aplicar a varias tareas",onMouseDown:Lt=>br(Lt,se.id,re,mt),style:{position:"absolute",right:2,bottom:2,width:8,height:8,borderRadius:2,background:t.accent,border:`1px solid ${t.bgPrimary}`,cursor:"crosshair",zIndex:5}})]},`${se.id}-${we.id}`)})]},se.id)})}),jsx(os,{isOpen:Ce.isOpen,x:Ce.x,y:Ce.y,items:Ce.type==="header"&&Ce.columnId?_e(Ce.columnId):Ce.type==="task"&&Ce.task?ua(Ce.task):[],onClose:()=>Ae({...Ce,isOpen:false}),theme:t}),kt&&Ie&&Me&&typeof document<"u"&&createPortal(jsx("div",{style:{position:"fixed",left:Ie.x+12,top:Ie.y-10,zIndex:99999,pointerEvents:"none"},children:(()=>{let se=pt.find(me=>me.task.id===Me)?.task;return se?jsx("div",{className:"flex items-center gap-2 px-2 py-1 rounded",style:{backgroundColor:"rgba(255, 255, 255, 0.08)",backdropFilter:"blur(4px)"},children:jsx("span",{className:"text-xs font-medium",style:{color:t.textSecondary,opacity:.9},children:se.name})}):null})()}),document.body)]})}function $m(e,t){let[r,a]=useState("none"),[n,s]=useState(0),[o,c]=useState(e),[l,i]=useState(t),[d,u]=useState(null),[p,m]=useState(null),[f,x]=useState(null),[y,b]=useState(null),[h,v]=useState(0),[w,C]=useState(0),[S,F]=useState(null),[k,N]=useState(false);return {dragMode:r,setDragMode:a,dragOffset:n,setDragOffset:s,ghostX:o,setGhostX:c,ghostWidth:l,setGhostWidth:i,connectionLine:d,setConnectionLine:u,hoveredTaskId:p,setHoveredTaskId:m,activeZone:f,setActiveZone:x,draggedSegmentIndex:y,setDraggedSegmentIndex:b,draggedSegmentStartX:h,setDraggedSegmentStartX:v,segmentDragOffsetX:w,setSegmentDragOffsetX:C,hoveredSegmentIndex:S,setHoveredSegmentIndex:F,isHovered:k,setIsHovered:N,isDragging:r!=="none",isResizing:r==="resize-start"||r==="resize-end",isConnecting:r==="connect",resetDragState:(ee,I)=>{a("none"),u(null),m(null),c(ee),i(I),C(0),b(null),v(0);}}}function Ji({task:e,x:t,y:r,width:a,theme:n,dayWidth:s,startDate:o,templates:c,onClick:l,onDoubleClick:i,onContextMenu:d,onDateChange:u,onDependencyCreate:p,allTaskPositions:m=[],onDragMove:f,onHoverChange:x,showBaseline:y,showTaskBarLabels:b=true,showCriticalPath:h=true,readOnly:v=false,onProgressChange:w}){let C=$m(t,a),S=useRef(null),F=useRef(false),k=useRef(null),N=useRef(null),{dragMode:P,setDragMode:T,dragOffset:Y,setDragOffset:H,ghostX:ee,setGhostX:I,ghostWidth:K,setGhostWidth:j,connectionLine:W,setConnectionLine:$,hoveredTaskId:ve,setHoveredTaskId:We,activeZone:Pe,setActiveZone:be,draggedSegmentIndex:ye,setDraggedSegmentIndex:fe,draggedSegmentStartX:ze,setDraggedSegmentStartX:Ce,segmentDragOffsetX:Ae,setSegmentDragOffsetX:Me,hoveredSegmentIndex:qe,setHoveredSegmentIndex:de,isHovered:et,setIsHovered:Re,isDragging:Be,isResizing:Nt,isConnecting:bt,resetDragState:Oe}=C,Ie=18,st=!!n.executionBarBg,kt=n.textPrimary==="#FFFFFF"||n.bgPrimary==="#050505",$e=st?3:6,He=e.subtasks&&e.subtasks.length>0,L=useRef(null),[oe,B]=(()=>{let V=useRef(null),[,ce]=useState(0);return [V.current,Q=>{V.current=Q,ce(O=>O+1);}]})(),_=!!w&&!v&&!He&&!e.segments&&!!e.startDate&&!!e.endDate,U=e.endDate&&(()=>{let V=new Date;V.setHours(0,0,0,0);let ce=new Date(e.endDate);return ce.setHours(0,0,0,0),ce<V})()&&e.progress<100,J=h&&e.isCriticalPath,De=n.name==="neutral"||n.today==="#1C1917",pe=e.status==="completed"||e.progress===100,rt={low:"#10B981",LOW:"#10B981",medium:"#F59E0B",MEDIUM:"#F59E0B",high:"#F97316",HIGH:"#F97316",urgent:"#EF4444",URGENT:"#EF4444"},Qe=h&&e.isCriticalPath||U?"#EF4444":e.color?e.color:e.priority&&rt[e.priority]?rt[e.priority]:n.taskBarPrimary,Ht=v?"default":Be?bt?"crosshair":Nt?"ew-resize":"grabbing":"grab",pt=v?"default":"ew-resize",Ut=(V=>V>=80?20:V>=60?15:V>=50?12:10)(a),ur=a<50,br=a<40;useEffect(()=>{x&&(!et||Be||e.segments)&&x(null);},[et,Be,e.segments,x]);let da=V=>V.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Yt=()=>{let V=Math.ceil((e.endDate.getTime()-e.startDate.getTime())/864e5);return `${V} day${V!==1?"s":""}`},hr=V=>Math.round(V/s)*s,Ft=V=>{let ce=Math.round(V/s),Q=new Date(o);return Q.setDate(Q.getDate()+ce),Q},jr=(V,ce)=>{for(let Q of m){if(Q.id===e.id)continue;let O=5;if(V>=Q.x-O&&V<=Q.x+Q.width+O&&ce>=Q.y-O&&ce<=Q.y+Q.height+O)return Q.id}return null},Wt=useCallback((V,ce,Q)=>{if(v)return;V.preventDefault(),V.stopPropagation();let O=S.current?.ownerSVGElement;if(!O)return;let te=O.createSVGPoint();te.x=V.clientX,te.y=V.clientY;let we=te.matrixTransform(O.getScreenCTM()?.inverse()),M=Q!==void 0?Q:t,R=ce;if(!R){let q=we.x-M;V.shiftKey?(R="connect",$({x:t+a,y:r+Ie/2})):V.ctrlKey||V.metaKey?R="move":V.altKey?R=q<a/2?"resize-start":"resize-end":br?q<a/2?R="move":R="resize-end":ur?q<=Ut/2?R="resize-start":q>=a-Ut/2?R="resize-end":R="move":q<=Ut?R="resize-start":q>=a-Ut?R="resize-end":R="move";}F.current=false,T(R),Re(false),be(null),R==="move"?H(we.x-M):R==="connect"?$({x:t+a,y:r+Ie/2}):H(0),I(M),j(a);},[t,a,r,Ie,v]),nr=useCallback(V=>{let ce=S.current?.ownerSVGElement;if(!ce)return;let Q=ce.closest(".gantt-timeline-scroll");if(!Q)return;let O=Q.getBoundingClientRect(),te=60,we=15,M=0;if(V.clientX<O.left+te){let R=O.left+te-V.clientX;M=-Math.min(we,R/2);}else if(V.clientX>O.right-te){let R=V.clientX-(O.right-te);M=Math.min(we,R/2);}return M!==0&&(Q.scrollLeft+=M),M!==0},[]),_r=useCallback(V=>{if(P==="none")return;F.current=true,N.current=V;let ce=S.current?.ownerSVGElement;if(!ce)return;if(P==="move"||P==="resize-start"||P==="resize-end"){let te=nr(V);te&&!k.current?k.current=window.setInterval(()=>{N.current&&(nr(N.current),_r(N.current));},16):!te&&k.current&&(window.clearInterval(k.current),k.current=null);}let Q=ce.createSVGPoint();Q.x=V.clientX,Q.y=V.clientY;let O=Q.matrixTransform(ce.getScreenCTM()?.inverse());if(P==="connect"){$({x:O.x,y:O.y});let te=jr(O.x,O.y);We(te);}else if(P==="move"){let te=O.x-Y,we=hr(te);I(we),j(a);let M=Math.round((we-t)/s);if(f?.(e.id,M,true),e.segments&&e.segments.length>0&&ye!==null){let R=we-ze;Me(R);}}else if(P==="resize-start"){let te=O.x,we=hr(te),M=t+a-we;M>=s&&(I(we),j(M));}else if(P==="resize-end"){let te=O.x,M=hr(te)-t;M>=s&&j(M);}},[P,t,a,s,Y,e,hr,ye,ze,jr,We,$,I,j,Me,f,nr]),Dr=useCallback(()=>{if(k.current&&(window.clearInterval(k.current),k.current=null),N.current=null,P!=="none"){if(P==="connect")ve&&p&&p(e,ve),$(null),We(null);else {let V=e.endDate.getTime()-e.startDate.getTime(),ce,Q,O=true;if(P==="move"){if(ce=Ft(ee),Q=new Date(ce.getTime()+V),e.segments&&e.segments.length>0&&ye!==null){let te=Math.round(Ae/s),we=e.segments.map((xe,re)=>{if(re===ye){let Ze=new Date(xe.startDate),Ye=new Date(xe.endDate);return Ze.setDate(Ze.getDate()+te),Ye.setDate(Ye.getDate()+te),{startDate:Ze,endDate:Ye}}return xe}),M=we.flatMap(xe=>[xe.startDate,xe.endDate]),R=new Date(Math.min(...M.map(xe=>xe.getTime()))),q=new Date(Math.max(...M.map(xe=>xe.getTime())));u?.({...e,segments:we},R,q),Oe(t,a);return}}else P==="resize-start"?(ce=Ft(ee),Q=e.endDate,ce>Q&&(console.warn("Invalid date range: start date must be before or equal to end date"),O=false)):P==="resize-end"?(ce=e.startDate,Q=Ft(ee+K),Q.setDate(Q.getDate()-1),Q<ce&&(console.warn("Invalid date range: end date must be after or equal to start date"),O=false)):O=false;O&&ce&&Q&&(Q.getTime()<ce.getTime()?console.warn("Invalid date range: end date cannot be before start date"):u?.(e,ce,Q));}f?.(e.id,0,false),Oe(t,a);}},[P,ee,K,e,u,ve,p,t,a,s,Ft,Ae,ye,Oe,f]);useEffect(()=>{if(P==="none")return;let V=Q=>{_r(Q);},ce=()=>{Dr();};return window.addEventListener("mousemove",V),window.addEventListener("mouseup",ce),()=>{window.removeEventListener("mousemove",V),window.removeEventListener("mouseup",ce),k.current&&(window.clearInterval(k.current),k.current=null);}},[P,_r,Dr]);let ot=Be&&!bt?ee:t,_e=Be&&!bt?K:a,ua=c.taskClass(e),jt=24,oa=h?e.isCriticalPath?1:.25:1,se=useCallback(V=>{if(!_)return;V.stopPropagation(),V.preventDefault();let Q=S.current?.querySelector('rect[data-bar-background="true"]')?.getBoundingClientRect()??null;L.current={barRect:Q,initialPct:e.progress||0},V.currentTarget.setPointerCapture(V.pointerId),B(e.progress||0);},[_,e.progress,B]),me=useCallback(V=>{let ce=L.current;if(!ce)return;let O=S.current?.querySelector('rect[data-bar-background="true"]')?.getBoundingClientRect()??ce.barRect;if(!O||O.width<=0)return;let te=(V.clientX-O.left)/O.width,we=Math.round(Math.max(0,Math.min(1,te))*100);V.shiftKey&&(we=Math.round(we/25)*25),B(we);},[B]),mt=useCallback(V=>{let ce=L.current;if(!ce)return;V.stopPropagation(),V.preventDefault();try{V.currentTarget.releasePointerCapture(V.pointerId);}catch{}let Q=oe;L.current=null,B(null),Q!=null&&Q!==ce.initialPct&&w&&w(e,Q);},[oe,w,e,B]),Xe=useCallback(V=>{V.stopPropagation(),V.preventDefault();},[]),it=oe??(e.progress||0);return jsxs("g",{ref:S,"data-task-bar":"true",style:{opacity:oa,transition:"opacity 300ms ease"},onClick:()=>{!Be&&!F.current&&l?.(e),F.current=false;},onDoubleClick:V=>{!Be&&!F.current&&(V.stopPropagation(),i?.(e));},onContextMenu:V=>{V.preventDefault(),d?.(e,V);},onMouseEnter:()=>!Be&&Re(true),onMouseMove:V=>{x&&et&&!Be&&!e.segments&&x({task:e,x:t,y:r,width:a,height:Ie,showBelow:false,mouseX:V.clientX,mouseY:V.clientY});},onMouseLeave:()=>{Be||(Re(false),be(null));},children:[jsx("rect",{x:t,y:r,width:a+jt,height:Ie,fill:"transparent",style:{pointerEvents:"all"}}),et&&!Be&&!ur&&!e.segments&&jsxs(Fragment,{children:[jsx("rect",{x:t,y:r,width:Ut,height:Ie,fill:Pe==="resize-start"?n.accent:"transparent",opacity:Pe==="resize-start"?.15:0,style:{cursor:pt,pointerEvents:"all"},onMouseEnter:()=>be("resize-start"),onMouseDown:V=>Wt(V,"resize-start")}),jsx("rect",{x:t+Ut,y:r,width:a-Ut*2,height:Ie,fill:Pe==="move"?n.accent:"transparent",opacity:Pe==="move"?.1:0,style:{cursor:v?"default":"grab",pointerEvents:"all"},onMouseEnter:()=>be("move"),onMouseDown:V=>Wt(V,"move")}),jsx("rect",{x:t+a-Ut,y:r,width:Ut,height:Ie,fill:Pe==="resize-end"?n.accent:"transparent",opacity:Pe==="resize-end"?.15:0,style:{cursor:pt,pointerEvents:"all"},onMouseEnter:()=>be("resize-end"),onMouseDown:V=>Wt(V,"resize-end")})]}),et&&!Be&&br&&jsxs(Fragment,{children:[jsx("rect",{x:t,y:r,width:a/2,height:Ie,fill:Pe==="move"?n.accent:"transparent",opacity:Pe==="move"?.2:0,style:{cursor:v?"default":"grab",pointerEvents:"all"},onMouseEnter:()=>be("move"),onMouseDown:V=>Wt(V,"move")}),jsx("rect",{x:t+a/2,y:r,width:a/2,height:Ie,fill:Pe==="resize-end"?n.accent:"transparent",opacity:Pe==="resize-end"?.2:0,style:{cursor:pt,pointerEvents:"all"},onMouseEnter:()=>be("resize-end"),onMouseDown:V=>Wt(V,"resize-end")}),et&&jsx(motion.line,{x1:t+a/2,y1:r+4,x2:t+a/2,y2:r+Ie-4,stroke:n.textTertiary,strokeWidth:1,strokeDasharray:"2 2",opacity:.3,initial:{opacity:0},animate:{opacity:.3},transition:{duration:.2},style:{pointerEvents:"none"}})]}),Be&&!bt&&!e.segments&&jsx(motion.rect,{x:ee,y:r,width:K,height:Ie,rx:$e,fill:n.accent,opacity:.15,stroke:n.accent,strokeWidth:1,strokeDasharray:"4 3",initial:{opacity:0},animate:{opacity:.25},transition:{duration:.15},style:{pointerEvents:"none"}}),y&&e.baselineStartDate&&e.baselineEndDate&&!Be&&(()=>{let V=e.baselineStartDate.getTime(),ce=e.baselineEndDate.getTime(),Q=o.getTime(),O=864e5,te=(V-Q)/O,we=(ce-V)/O,M=te*s,R=Math.max(we*s,s),q=ot+_e,xe=M+R,re=e.endDate?.getTime()??0,Ze=Math.ceil((re-ce)/O),Ye=Ze>0,Rt=Ze<-0;return jsxs("g",{style:{pointerEvents:"none"},children:[jsx("rect",{x:M,y:r,width:R,height:Ie,rx:$e,fill:"none",stroke:kt?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.35)",strokeWidth:1.5,strokeDasharray:"6 4"}),Ye&&q>xe&&jsx("rect",{x:xe,y:r,width:q-xe,height:Ie,rx:0,fill:"#EF4444",opacity:.2}),Ye&&jsxs("text",{x:Math.max(q,xe)+6,y:r+Ie/2+1,fill:"#EF4444",fontSize:"10",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",dominantBaseline:"middle",children:["+",Ze,"d"]}),Rt&&jsxs("text",{x:q+6,y:r+Ie/2+1,fill:"#10B981",fontSize:"10",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",dominantBaseline:"middle",children:[Ze,"d"]})]})})(),!e.segments&&st&&He&&(()=>{let ce=r+(Ie-8)/2,Q=4,O=e.progress||0,te=new Date;te.setHours(0,0,0,0);let we=e.startDate&&te>=e.startDate,M=e.endDate&&(()=>{let Ye=new Date(e.endDate);return Ye.setHours(0,0,0,0),te>Ye})(),R=e.startDate&&te<e.startDate,q=1;if(we&&e.startDate&&e.endDate&&!R){let Ye=new Date(e.startDate);Ye.setHours(0,0,0,0);let Rt=new Date(e.endDate);Rt.setHours(0,0,0,0);let Lt=Math.max(1,(Rt.getTime()-Ye.getTime())/(1e3*60*60*24)),or=Math.min((te.getTime()-Ye.getTime())/(1e3*60*60*24),Lt)/Lt*100;q=or>0?O/or:1;}let xe;O>=100?xe="#00E5CC":R?xe="#4B5563":M&&O<100?xe="#EF4444":q>=.95?xe="#22C55E":q>=.8?xe="#F59E0B":xe="#EF4444";let re=Math.max(O/100*_e,O>0?Q*2:0),Ze=_e>100&&O>0;return jsxs("g",{"data-task-class":ua,style:{cursor:"default",pointerEvents:"all"},children:[jsx("rect",{x:ot,y:ce,width:_e,height:8,rx:Q,fill:"rgba(255,255,255,0.10)"}),O>0&&jsx("rect",{x:ot,y:ce,width:re,height:8,rx:Q,fill:xe}),Ze&&jsxs("text",{x:ot+re+6,y:ce+8/2,dominantBaseline:"central",fill:"rgba(255,255,255,0.7)",fontSize:"9",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none",userSelect:"none"},children:[Math.round(O),"%"]})]})})(),!e.segments&&st&&!He&&jsx(motion.rect,{x:ot,y:r,width:_e,height:Ie,rx:$e,fill:n.executionBarBg||"rgba(255,255,255,0.06)",stroke:n.border||"rgba(255,255,255,0.1)",strokeWidth:1,"data-task-class":ua,"data-bar-background":"true",initial:{opacity:0,scale:.95},animate:{opacity:Be&&!bt?.15:e.parentId?.6:1,scale:et&&!Be?1.01:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:V=>Wt(V),style:{cursor:Ht,pointerEvents:"all"}}),!e.segments&&!st&&jsx(motion.rect,{x:ot,y:r,width:_e,height:Ie,rx:$e,fill:Qe,"data-task-class":ua,initial:{opacity:0,scale:.95},animate:{opacity:Be&&!bt?.15:e.parentId?.6:et?.9:.8,scale:et&&!Be?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:He?void 0:V=>Wt(V),style:{cursor:He?"default":Ht,pointerEvents:"all"}}),st&&(U||J)&&!e.segments&&jsx("rect",{x:ot,y:r,width:_e,height:Ie,rx:$e,fill:"none",stroke:n.criticalPath,strokeWidth:2,style:{pointerEvents:"none",filter:`drop-shadow(0 0 6px ${n.criticalPathLight||"rgba(255,46,46,0.4)"})`}}),!e.segments&&it>0&&!He&&jsx("rect",{x:ot,y:r,width:Math.max(_e*(it/100),$e*2),height:Ie,rx:$e,fill:Qe,opacity:1,style:{pointerEvents:"none"}}),!e.segments&&!He&&e.progress<100&&(()=>{let V=e.progress>0?_e*(e.progress/100):0,ce=ot+V,Q=_e-V,O=e.progress===0?$e:0,te=e.progress===0?ot:ce,we=e.progress===0?_e:Q;return jsxs(Fragment,{children:[jsx("rect",{x:te,y:r,width:we,height:Ie,rx:O,fill:"url(#bar-remaining-hatch)",style:{pointerEvents:"none"}}),jsx("rect",{x:te,y:r,width:we,height:Ie,rx:O,fill:"none",stroke:Qe,strokeWidth:.8,strokeDasharray:"5 3",style:{pointerEvents:"none"}})]})})(),st&&!e.segments&&e.progress>0&&e.progress<100&&!He&&!Be&&oe===null&&(()=>{let V=ot+_e*(e.progress/100),ce=8,Q=e.assignees?.[0];return jsxs("g",{style:{pointerEvents:"none"},children:[jsx("circle",{cx:V,cy:r+Ie/2,r:ce,fill:Q?.color||n.accent,stroke:"#000",strokeWidth:1.5}),jsx("text",{x:V,y:r+Ie/2,textAnchor:"middle",dominantBaseline:"central",fill:"#FFF",fontSize:"8",fontWeight:"600",fontFamily:"Inter, sans-serif",children:Q?.initials||Q?.name?.charAt(0)?.toUpperCase()||""})]})})(),_&&!Be&&_e>=40&&(oe!==null||it<88)&&(()=>{let V=ot+_e*(it/100),ce=r+Ie/2,Q=oe!==null,O=Q?7:et?6:5,te=Q||et?1:.35,we=ot+_e-V,M=Math.max(4,Math.min(12,we-10)),R=12;return jsxs("g",{children:[jsx("rect",{x:V-R,y:ce-12,width:R+M,height:24,fill:"transparent",style:{cursor:"ew-resize",touchAction:"none"},onPointerDown:se,onPointerMove:me,onPointerUp:mt,onPointerCancel:mt,onClick:Xe,onDoubleClick:Xe,onMouseDown:q=>q.stopPropagation()}),jsx("circle",{cx:V,cy:ce,r:O,fill:"#FFFFFF",stroke:Qe,strokeWidth:2,opacity:te,style:{pointerEvents:"none",filter:Q?`drop-shadow(0 0 4px ${Qe})`:void 0,transition:"r 120ms ease, opacity 120ms ease"}}),Q&&jsxs("g",{style:{pointerEvents:"none"},children:[jsx("rect",{x:V-20,y:ce-28,width:40,height:18,rx:4,fill:kt?"rgba(15, 15, 20, 0.95)":"rgba(255, 255, 255, 0.95)",stroke:Qe,strokeWidth:1}),jsxs("text",{x:V,y:ce-16,textAnchor:"middle",dominantBaseline:"central",fill:kt?"#FFFFFF":"#111111",fontSize:"11",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",children:[oe,"%"]})]})]})})(),e.segments&&e.segments.map((V,ce)=>{let Q=(V.startDate.getTime()-o.getTime())/864e5*s,te=(V.endDate.getTime()-o.getTime())/(1e3*60*60*24)*s-Q+s,we=Be&&P==="move"&&ye===ce,M=qe===ce,R=we?Q+Ae:Q;return jsxs("g",{onMouseEnter:()=>!Be&&de(ce),onMouseLeave:()=>!Be&&de(null),children:[jsx(motion.rect,{x:R,y:r,width:te,height:Ie,rx:$e,fill:Qe,initial:{opacity:0,scale:.95},animate:{opacity:we||e.parentId?.6:M?.9:.8,scale:M&&!Be?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:q=>{q.stopPropagation(),fe(ce),Ce(Q),Wt(q,void 0,Q);},style:{cursor:Ht,pointerEvents:"all"}}),jsx("rect",{x:R,y:r,width:te*(e.progress/100),height:Ie,rx:$e,fill:Qe,opacity:1,style:{pointerEvents:"none"}})]},`segment-${ce}`)}),De&&(U||J)&&!e.segments&&jsxs(Fragment,{children:[J&&!U&&jsx("rect",{x:ot,y:r,width:_e,height:Ie,rx:$e,fill:"none",stroke:n.border,strokeWidth:2,strokeDasharray:"4 4",opacity:.8,style:{pointerEvents:"none"}}),U&&jsx("rect",{x:ot,y:r,width:_e,height:Ie,rx:$e,fill:"url(#diagonal-stripes)",opacity:.3,style:{pointerEvents:"none"}})]}),b&&_e>60&&!e.segments&&!(st&&He)&&(()=>{let V=c.taskLabel(e),ce=typeof V=="string"?V:e.name,Q=ce.length>Math.floor(_e/8)?`${ce.substring(0,Math.floor(_e/8))}...`:ce;return jsx("text",{x:ot+8,y:r+Ie/2,dominantBaseline:"middle",fill:pe?"rgba(255, 255, 255, 0.6)":"#FFFFFF",fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none",textDecoration:pe?"line-through":"none"},children:Q})})(),!Be&&!e.segments&&!He&&e.progress>0&&e.progress<100&&(st?jsxs("text",{x:ot+_e+6,y:r+Ie/2,dominantBaseline:"middle",fill:"#FFFFFF",fontSize:"9",fontWeight:"500",fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none",userSelect:"none"},children:[e.progress,"%"]}):_e>100?jsxs("text",{x:ot+_e-12,y:r+Ie/2,dominantBaseline:"middle",textAnchor:"end",fill:"rgba(255, 255, 255, 0.9)",fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none"},children:[e.progress,"%"]}):null),e.status&&_e>80&&!Be&&!e.segments&&!(st&&He)&&jsxs("g",{style:{pointerEvents:"none"},children:[e.status==="completed"&&jsx("circle",{cx:ot+_e-8,cy:r+8,r:4,fill:n.statusCompleted,stroke:"#FFFFFF",strokeWidth:1.5}),e.status==="in-progress"&&jsx("circle",{cx:ot+_e-8,cy:r+8,r:4,fill:n.statusInProgress,stroke:"#FFFFFF",strokeWidth:1.5,opacity:.8})]}),(et||Nt)&&!bt&&!e.segments&&!He&&jsxs(Fragment,{children:[jsxs("g",{children:[jsx("rect",{x:ot-2,y:r,width:16,height:Ie,fill:"transparent",style:{cursor:pt},onMouseEnter:()=>be("resize-start"),onMouseLeave:()=>be(null),onMouseDown:V=>{V.stopPropagation(),Wt(V,"resize-start");}}),jsx(motion.rect,{x:ot+4,y:r+8,width:3,height:Ie-16,rx:1.5,fill:Pe==="resize-start"||P==="resize-start"?"#ffffff":"rgba(255,255,255,0.5)",style:{pointerEvents:"none"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})]}),jsxs("g",{children:[jsx("rect",{x:ot+_e-14,y:r,width:16,height:Ie,fill:"transparent",style:{cursor:pt},onMouseEnter:()=>be("resize-end"),onMouseLeave:()=>be(null),onMouseDown:V=>{V.stopPropagation(),Wt(V,"resize-end");}}),jsx(motion.rect,{x:ot+_e-7,y:r+8,width:3,height:Ie-16,rx:1.5,fill:Pe==="resize-end"||P==="resize-end"?"#ffffff":"rgba(255,255,255,0.5)",style:{pointerEvents:"none"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})]})]}),jsx(AnimatePresence,{children:et&&!Be&&!e.segments&&jsxs(motion.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[jsx("circle",{cx:t+a+10,cy:r+Ie/2,r:10,fill:"transparent",style:{cursor:"crosshair"},onMouseEnter:()=>be("connect"),onMouseLeave:()=>be(null),onMouseDown:V=>{V.stopPropagation(),Wt(V,"connect");}}),jsx(motion.circle,{cx:t+a+10,cy:r+Ie/2,r:4,fill:n.accent,stroke:"#FFFFFF",strokeWidth:1.5,style:{pointerEvents:"none"},initial:{scale:0},animate:{scale:Pe==="connect"?1.4:1},exit:{scale:0},transition:{duration:.15,type:"spring",stiffness:500,damping:30}})]})}),bt&&W&&jsxs("g",{style:{pointerEvents:"none"},children:[jsx(motion.line,{x1:t+a,y1:r+Ie/2,x2:W.x,y2:W.y,stroke:ve?n.statusCompleted:n.accent,strokeWidth:ve?3:2,strokeDasharray:"6 4",initial:{opacity:0},animate:{opacity:ve?1:.8},transition:{duration:.15}}),jsx(motion.circle,{cx:W.x,cy:W.y,r:ve?8:6,fill:ve?n.statusCompleted:n.accent,stroke:"#FFFFFF",strokeWidth:2,initial:{scale:0},animate:{scale:1},transition:{duration:.15}}),ve&&jsx(motion.text,{x:W.x+15,y:W.y,dominantBaseline:"middle",fill:n.statusCompleted,fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",initial:{opacity:0,x:W.x+10},animate:{opacity:1,x:W.x+15},transition:{duration:.2},children:"Connect"})]}),(et||Be)&&!bt&&!e.segments&&jsx(motion.rect,{x:ot-1,y:r-1,width:_e+2,height:Ie+2,rx:$e+1,fill:"none",stroke:Be?n.accent:st?"rgba(255,255,255,0.2)":n.taskBarPrimary,strokeWidth:st?1:2,opacity:Be||st?.6:.4,initial:{opacity:0},animate:{opacity:Be||st?.6:.4},transition:{duration:.2},style:{pointerEvents:"none"}}),Nt&&jsxs(Fragment,{children:[jsx("line",{x1:ee,y1:0,x2:ee,y2:1e3,stroke:n.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}}),jsx("line",{x1:ee+K,y1:0,x2:ee+K,y2:1e3,stroke:n.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}})]}),jsx(AnimatePresence,{children:et&&!Be&&!e.segments&&!x&&(()=>{let Q=r<100,O=Q?r+Ie+13:r-82-13,te=Q?`M ${ot+_e/2-6} ${r+Ie+3} L ${ot+_e/2} ${r+Ie+13} L ${ot+_e/2+6} ${r+Ie+3}`:`M ${ot+_e/2-6} ${r-13} L ${ot+_e/2} ${r-3} L ${ot+_e/2+6} ${r-13}`,we=O+22,M=O+40,R=O+55,q=O+70,xe=Q?O+82-5:r-18;return jsxs(motion.g,{initial:{opacity:0,y:Q?-10:10},animate:{opacity:1,y:0},exit:{opacity:0,y:Q?-10:10},transition:{duration:.2},style:{pointerEvents:"none"},children:[jsx("path",{d:te,fill:n.bgSecondary,stroke:n.border,strokeWidth:1}),jsx("rect",{x:ot+_e/2-120,y:O,width:240,height:82,rx:8,fill:n.bgSecondary,stroke:n.border,strokeWidth:1,filter:"drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))"}),jsx("text",{x:ot+_e/2,y:we,textAnchor:"middle",fill:n.textPrimary,fontSize:"13",fontWeight:"600",fontFamily:"Inter, sans-serif",children:e.name.length>28?`${e.name.substring(0,28)}...`:e.name}),jsx("text",{x:ot+_e/2-110,y:M,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Start:"}),jsx("text",{x:ot+_e/2-70,y:M,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:da(e.startDate)}),jsx("text",{x:ot+_e/2-110,y:R,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"End:"}),jsx("text",{x:ot+_e/2-70,y:R,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:da(e.endDate)}),jsx("text",{x:ot+_e/2+10,y:M,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Duration:"}),jsx("text",{x:ot+_e/2+65,y:M,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:Yt()}),jsx("text",{x:ot+_e/2+10,y:R,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Progress:"}),jsxs("text",{x:ot+_e/2+65,y:R,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.progress,"%"]}),e.assignees&&e.assignees.length>0&&jsxs(Fragment,{children:[jsx("text",{x:ot+_e/2-110,y:q,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Assignees:"}),jsxs("text",{x:ot+_e/2-50,y:q,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.assignees.map(re=>re.name).join(", ").substring(0,30),e.assignees.map(re=>re.name).join(", ").length>30?"...":""]})]}),!Q&&jsx("text",{x:ot+_e/2,y:xe,textAnchor:"middle",fill:n.textTertiary,fontSize:"9",fontFamily:"Inter, sans-serif",style:{opacity:.7},children:br?"Left: move \u2022 Right: resize":ur?"Drag to move \u2022 Hold ALT + drag edge to resize":"Drag edges to resize \u2022 Drag center to move \u2022 Click \u26AB to link"})]})})()})]})}var od=260,ls=8,Um=16,ew=-12;function Wm({tooltipData:e,theme:t,locale:r="en",workingDaysConfig:a}){let[n,s]=useState(null);if(useLayoutEffect(()=>{if(!e){s(null);return}let{task:v,mouseX:w,mouseY:C}=e,S=v.effortMinutes!=null||v.timeLoggedMinutes!=null||v.soldEffortMinutes!=null,F=v.lastActivity!=null,k=(S?155:105)+(F?28:0),N=w+Um,P=C+ew-k;N+od>window.innerWidth-ls&&(N=w-od-Um),N<ls&&(N=ls);let T=P<ls;T&&(P=C+20),P+k>window.innerHeight-ls&&(P=window.innerHeight-ls-k),s({left:N,top:P,showBelow:T});},[e]),!e||!n)return null;let{task:o}=e,c=o.effortMinutes!=null||o.timeLoggedMinutes!=null||o.soldEffortMinutes!=null,l={start:r==="es"?"Inicio":"Start",end:r==="es"?"Fin":"End",duration:r==="es"?"Duraci\xF3n":"Duration",progress:r==="es"?"Progreso":"Progress",assignees:r==="es"?"Asignados":"Assignees",estimated:r==="es"?"Estimado":"Estimated",logged:r==="es"?"Registrado":"Logged",quoted:r==="es"?"Ofertado":"Quoted"},i=v=>v.toLocaleDateString(r==="es"?"es-ES":"en-US",{month:"short",day:"numeric",year:"numeric"}),d=()=>{if(!o.startDate||!o.endDate)return "N/A";if(!a?.enabledWeekdays){let P=Math.max(1,Math.round((o.endDate.getTime()-o.startDate.getTime())/864e5)+1);return r==="es"?`${P} d\xEDa${P!==1?"s":""}`:`${P} day${P!==1?"s":""}`}let v=a.enabledWeekdays,w=a.holidayDates instanceof Set?a.holidayDates:new Set(a.holidayDates??[]),C=P=>`${P.getFullYear()}-${String(P.getMonth()+1).padStart(2,"0")}-${String(P.getDate()).padStart(2,"0")}`,S=0,F=new Date(o.startDate.getFullYear(),o.startDate.getMonth(),o.startDate.getDate()),k=new Date(o.endDate.getFullYear(),o.endDate.getMonth(),o.endDate.getDate());for(;F.getTime()<=k.getTime();){let P=F.getDay();v[P]&&!w.has(C(F))&&S++,F.setDate(F.getDate()+1);}let N=Math.max(0,S);return r==="es"?`${N} d\xEDa${N!==1?"s":""}`:`${N} day${N!==1?"s":""}`},u=v=>{if(v==null||v===0)return "N/A";let w=Math.floor(v/60),C=v%60;return w===0?`${C}m`:C===0?`${w}h`:`${w}h ${C}m`},p=t.textTertiary||"#9CA3AF",m=t.textSecondary||"#D1D5DB",f=t.textPrimary||"#F9FAFB",x=t.accent||"#00E5CC",y=t.bgSecondary||"#1F2937",b=t.border||"#374151",h=jsxs("div",{style:{position:"fixed",left:n.left,top:n.top,width:od,zIndex:99999,pointerEvents:"none",fontFamily:"Inter, system-ui, sans-serif",animation:"gantt-tooltip-fade 0.12s ease-out"},children:[jsxs("div",{style:{background:y,border:`1px solid ${b}`,borderRadius:8,padding:"12px 14px",boxShadow:"0 8px 24px rgba(0,0,0,0.3)"},children:[jsx("div",{style:{fontSize:13,fontWeight:600,color:f,marginBottom:8,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.name}),jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"3px 12px",fontSize:11},children:[jsx(Qi,{label:l.start,value:o.startDate?i(o.startDate):"N/A",labelColor:p,valueColor:m}),jsx(Qi,{label:l.duration,value:d(),labelColor:p,valueColor:m}),jsx(Qi,{label:l.end,value:o.endDate?i(o.endDate):"N/A",labelColor:p,valueColor:m}),jsx(Qi,{label:l.progress,value:`${o.progress}%`,labelColor:p,valueColor:m})]}),o.assignees&&o.assignees.length>0&&jsxs("div",{style:{fontSize:11,marginTop:6},children:[jsxs("span",{style:{color:p},children:[l.assignees,": "]}),jsx("span",{style:{color:m,fontWeight:500},children:o.assignees.map(v=>v.name).join(", ")})]}),c&&jsxs("div",{style:{marginTop:6,display:"flex",gap:10,fontSize:11},children:[o.effortMinutes!=null&&jsxs("span",{children:[jsxs("span",{style:{color:p},children:[l.estimated,":"]})," ",jsx("span",{style:{color:m,fontWeight:600},children:u(o.effortMinutes)})]}),o.timeLoggedMinutes!=null&&jsxs("span",{children:[jsxs("span",{style:{color:p},children:[l.logged,":"]})," ",jsx("span",{style:{color:x,fontWeight:600},children:u(o.timeLoggedMinutes)})]}),o.soldEffortMinutes!=null&&jsxs("span",{children:[jsxs("span",{style:{color:p},children:[l.quoted,":"]})," ",jsx("span",{style:{color:m,fontWeight:600},children:u(o.soldEffortMinutes)})]})]}),o.lastActivity&&jsxs("div",{style:{marginTop:8,paddingTop:8,borderTop:`1px solid ${t?.borderSubtle||"rgba(255,255,255,0.08)"}`,fontSize:11,color:p,lineHeight:1.4},children:[jsx("span",{style:{opacity:.7},children:r==="es"?"\xDAltimo: ":"Last: "}),jsx("span",{style:{color:m},children:o.lastActivity.userName})," ",jsx("span",{children:o.lastActivity.summary})," ",jsx("span",{style:{opacity:.6},children:o.lastActivity.relativeTime})]})]}),jsx("style",{children:`
|
|
126
126
|
@keyframes gantt-tooltip-fade {
|
|
127
127
|
from { opacity: 0; transform: translateY(${n.showBelow?"-4px":"4px"}); }
|
|
128
128
|
to { opacity: 1; transform: translateY(0); }
|
|
@@ -439,6 +439,6 @@ ${ui(gu,"asakaa").split(`
|
|
|
439
439
|
`).slice(1,-1).join(`
|
|
440
440
|
`)}
|
|
441
441
|
}
|
|
442
|
-
`}var
|
|
442
|
+
`}var e2=({theme:e})=>{switch(e){case "dark":return jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M13.5 8.5C13.5 11.2614 11.2614 13.5 8.5 13.5C5.73858 13.5 3.5 11.2614 3.5 8.5C3.5 5.73858 5.73858 3.5 8.5 3.5C8.66667 3.5 8.83074 3.50926 8.99199 3.52734C8.10635 4.35233 7.5 5.53318 7.5 6.85C7.5 9.33579 9.49421 11.33 11.98 11.33C12.5933 11.33 13.1751 11.2075 13.7069 10.9844C13.5698 11.8951 13.2042 12.7349 12.6674 13.4367",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});case "light":return jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("circle",{cx:"8",cy:"8",r:"3",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M8 1V2M8 14V15M15 8H14M2 8H1M12.5 12.5L11.8 11.8M4.2 4.2L3.5 3.5M12.5 3.5L11.8 4.2M4.2 11.8L3.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]});case "neutral":return jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M5 8L8 8L8 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}};function Jf({showLabels:e=true,compact:t=false,className:r=""}){let{theme:a,setTheme:n,themes:s}=es();return jsx("div",{className:`theme-switcher ${t?"theme-switcher--compact":""} ${r}`,children:Object.entries(s).map(([o,c])=>{let l=o,i=l===a;return jsxs("button",{onClick:()=>n(l),className:`theme-switcher__button ${i?"theme-switcher__button--active":""}`,"aria-label":`Switch to ${c.displayName} theme`,"aria-pressed":i,title:c.displayName,children:[jsx("span",{className:"theme-switcher__icon","aria-hidden":"true",children:jsx(e2,{theme:l})}),e&&!t&&jsx("span",{className:"theme-switcher__label",children:c.displayName})]},l)})})}
|
|
443
443
|
export{wf as AIUsageDashboard,LC as AI_FEATURES,_d as AI_MODELS,wc as AddCardButton,bc as AddColumnButton,Jo as AttachmentUploader,Of as BoardProvider,zi as BulkOperationsToolbar,Mc as BurnDownChart,S0 as CUSTOM_FIELD_TYPES,nf as CalendarBoard,Ln as Card,pf as CardHistoryReplay,df as CardHistoryTimeline,ff as CardRelationshipsGraph,CC as CardStack,Bc as CardTemplateSelector,Yl as CircuitBreaker,_o as Column,qi as ColumnManager,Tc as CommandPalette,Uc as ConfigMenu,os as ContextMenu,Us as DEFAULT_SHORTCUTS,N0 as DEFAULT_TABLE_COLUMNS,Rc as DEFAULT_TEMPLATES,Ds as DateRangePicker,Es as DependenciesSelector,Ks as DependencyLine,Pc as DistributionCharts,ac as EditableColumnTitle,Xo as ErrorBoundary,wm as ExportDropdown,Oc as ExportImportModal,Hc as FilterBar,tg as GANTT_AI_SYSTEM_PROMPT,sl as GanttAIAssistant,Jm as GanttBoard,rs as GanttI18nContext,rl as GanttMilestone,Ki as GanttToolbar,Tf as GenerateGanttTasksDialog,yf as GeneratePlanModal,Ac as GroupBySelector,cc as HealthBar,Jn as KanbanBoard,gc as KanbanToolbar,Os as KanbanViewAdapter,Ic as KeyboardShortcutsHelp,T0 as ListView,ar as MenuIcons,$l as PluginManager,vo as PrioritySelector,dc as ProfitabilityReport,Bs as QuickTaskCreate,FC as RATE_LIMITS,D0 as STANDARD_FIELDS,Fc as SwimlaneBoardView,oc as TagBadge,mp as TagList,Ko as TagPicker,Ji as TaskBar,No as TaskDetailModal,eg as TaskFormModal,Xi as TaskGrid,Vc as ThemeModal,cm as ThemeProvider,Jf as ThemeSwitcher,xn as TimeInputPopover,sc as TimePill,ic as TimePopover,al as Timeline,ko as UserAssignmentSelector,Ec as VelocityChart,_f as VirtualGrid,Gf as VirtualList,Ro as aiUsageTracker,eu as borderRadius,Nl as buildCalendar,hi as calculatePosition,cl as cardToGanttTask,lg as cardsToGanttTasks,g as cn,Gp as createKanbanView,vb as createRetryWrapper,Wc as darkTheme,Hl as darkTokenTheme,Vi as defaultTheme,Ol as designTokens,ou as duration,su as easing,Xf as exportTokensToCSS,Hn as findTaskByName,tu as fontSize,ru as fontWeight,ii as formatCost,_i as ganttEnTranslations,um as ganttEsTranslations,ig as ganttTaskToCardUpdate,lt as ganttThemes,du as ganttTokens,jc as ganttTranslations,Ne as ganttUtils,pu as generateCSSVariables,fu as generateCompleteCSS,bb as generateInitialPositions,rg as generateTasksContext,ui as generateThemeVariables,E0 as getListViewTheme,gd as getListViewTranslations,Yf as getToken,pm as getTranslations,cu as kanbanTokens,zc as lightTheme,mu as lightTokenTheme,au as lineHeight,Bd as listViewDarkTheme,pd as listViewEnTranslations,md as listViewEsTranslations,$d as listViewLightTheme,Od as listViewNeutralTheme,Cl as listViewThemes,dl as listViewTranslations,ul as mergeListViewTranslations,_c as mergeTranslations,Gc as neutralTheme,gu as neutralTokenTheme,lu as opacity,og as parseLocalCommand,cd as parseNaturalDate,dd as parseNaturalDuration,ud as parseProgress,ng as parseStatus,XC as pluginManager,xb as retrySyncOperation,yi as retryWithBackoff,iu as shadows,qf as shouldVirtualizeGrid,Fl as simulateReschedule,Zd as spacing,So as themes,Af as useAI,Df as useBoard,di as useBoardCore,Bl as useBoardStore,Bf as useCardStacking,pc as useDragState,Uf as useFilteredCards,Mf as useFilters,ja as useGanttI18n,Rl as useKanbanState,sm as useKeyboardShortcuts,If as useMultiSelect,Yd as useSelectionState,Wf as useSortedCards,es as useTheme,Kf as useVirtualGrid,Vf as useVirtualList,sg as validateAIResponse,kc as withErrorBoundary,wi as wouldCreateCircularDependency,nu as zIndex};//# sourceMappingURL=index.js.map
|
|
444
444
|
//# sourceMappingURL=index.js.map
|