@libxai/board 1.5.55 → 1.5.56
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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -410,7 +410,7 @@ If ambiguous, ask for clarification in the message field.`;function Mm(e){return
|
|
|
410
410
|
${Fm(e).map(r=>{let o=r.startDate?r.startDate.toISOString().split("T")[0]:"no date",s=r.endDate?r.endDate.toISOString().split("T")[0]:"no date",n=r.dependencies?.length?`deps: [${r.dependencies.join(", ")}]`:"";return `- ${r.id}: "${r.name}" (${o} to ${s}, ${r.progress}%, ${r.status||"todo"}) ${n}`}).join(`
|
|
411
411
|
`)}
|
|
412
412
|
|
|
413
|
-
Today's date: ${new Date().toISOString().split("T")[0]}`}function Fm(e){let t=[],a=r=>{for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);};return a(e),t}function xo(e,t){let a=Fm(e),r=t.toLowerCase().trim(),o=a.find(i=>i.name.toLowerCase()===r);if(o)return o;let s=a.find(i=>i.name.toLowerCase().includes(r));if(s)return s;let n=r.split(/\s+/);return a.find(i=>{let c=i.name.toLowerCase();return n.every(l=>c.includes(l))})}function Id(e,t=new Date){let a=e.toLowerCase().trim(),r=new Date(t);if(r.setHours(0,0,0,0),a==="today"||a==="hoy")return r;if(a==="tomorrow"||a==="ma\xF1ana"){let p=new Date(r);return p.setDate(p.getDate()+1),p}if(a==="yesterday"||a==="ayer"){let p=new Date(r);return p.setDate(p.getDate()-1),p}if(a==="next week"||a==="la pr\xF3xima semana"){let p=new Date(r);return p.setDate(p.getDate()+7),p}let o=a.match(/(?:next\s+)?(monday|tuesday|wednesday|thursday|friday|saturday|sunday|lunes|martes|miércoles|miercoles|jueves|viernes|sábado|sabado|domingo)/i);if(o){let g={sunday:0,domingo:0,monday:1,lunes:1,tuesday:2,martes:2,wednesday:3,mi\u00E9rcoles:3,miercoles:3,thursday:4,jueves:4,friday:5,viernes:5,saturday:6,s\u00E1bado:6,sabado:6}[o[1].toLowerCase()];if(g!==void 0){let y=new Date(r),x=y.getDay(),h=g-x;return h<=0&&(h+=7),y.setDate(y.getDate()+h),y}}let s=a.match(/in\s+(\d+)\s+(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(s&&s[1]&&s[2]){let p=parseInt(s[1],10),g=s[2].toLowerCase(),y=new Date(r);return g==="day"||g==="d\xEDa"||g==="dias"?y.setDate(y.getDate()+p):g==="week"||g==="semana"||g==="semanas"?y.setDate(y.getDate()+p*7):(g==="month"||g==="mes"||g==="meses")&&y.setMonth(y.getMonth()+p),y}if(a.match(/(\d{4})-(\d{2})-(\d{2})/))return new Date(a);let i=a.match(/(\d{1,2})\/(\d{1,2})\/(\d{4})/);if(i&&i[1]&&i[2]&&i[3]){let p=parseInt(i[1],10),g=parseInt(i[2],10)-1,y=parseInt(i[3],10);return new Date(y,g,p)}let c={enero:0,febrero:1,marzo:2,abril:3,mayo:4,junio:5,julio:6,agosto:7,septiembre:8,octubre:9,noviembre:10,diciembre:11},l=a.match(/(\d{1,2})\s+de\s+(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)(?:\s+de\s+(\d{4}))?/i);if(l&&l[1]&&l[2]){let p=parseInt(l[1],10),g=c[l[2].toLowerCase()],y=l[3]?parseInt(l[3],10):r.getFullYear();if(g!==void 0)return new Date(y,g,p)}let m={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},d=a.match(/(january|february|march|april|may|june|july|august|september|october|november|december)\s+(\d{1,2})(?:,?\s+(\d{4}))?/i);if(d&&d[1]&&d[2]){let p=m[d[1].toLowerCase()],g=parseInt(d[2],10),y=d[3]?parseInt(d[3],10):r.getFullYear();if(p!==void 0)return new Date(y,p,g)}return null}function Bd(e){let a=e.toLowerCase().trim().match(/(\d+)\s*(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(a&&a[1]&&a[2]){let r=parseInt(a[1],10),o=a[2].toLowerCase();if(o==="day"||o==="d\xEDa"||o==="dias")return r;if(o==="week"||o==="semana"||o==="semanas")return r*7;if(o==="month"||o==="mes"||o==="meses")return r*30}return null}function Rd(e){let t=e.match(/(\d+)(?:\s*%)?/);if(t&&t[1]){let a=parseInt(t[1],10);return Math.max(0,Math.min(100,a))}return null}function Pm(e){let t=e.toLowerCase().trim();return t.includes("todo")||t.includes("pendiente")||t.includes("por hacer")?"todo":t.includes("in progress")||t.includes("in-progress")||t.includes("en progreso")||t.includes("working")||t.includes("trabajando")?"in-progress":t.includes("done")||t.includes("complete")||t.includes("finished")||t.includes("completado")||t.includes("terminado")||t.includes("hecho")?"completed":null}function Am(e,t){let a=e.toLowerCase().trim(),r=a.match(/(?:move|mover|mueve)\s+(?:la\s+tarea\s+)?["""]?(.+?)["""]?\s+(?:to|a|para)\s+(?:la\s+fecha\s+)?(.+)/i);if(r&&r[1]&&r[2]){let l=r[1].trim(),m=r[2].trim(),d=xo(t,l),p=Id(m);if(!d)return {type:"move_task",taskName:l,message:`Could not find a task named "${l}". Please check the task name and try again.`,success:false,error:"Task not found"};if(!p)return {type:"move_task",taskId:d.id,taskName:d.name,message:`Could not parse the date "${m}". Try using formats like "next Monday", "in 3 days", or "2024-01-15".`,success:false,error:"Invalid date"};let g=d.startDate&&d.endDate?Math.round((d.endDate.getTime()-d.startDate.getTime())/(1e3*60*60*24)):1,y=new Date(p);return y.setDate(y.getDate()+g),{type:"move_task",taskId:d.id,taskName:d.name,updates:{startDate:p,endDate:y},message:`Moved "${d.name}" to ${p.toLocaleDateString()}.`,success:true}}let o=a.match(/(?:extend|extender|extiende|alargar)\s+["""]?(.+?)["""]?\s+(?:by|por)\s+(.+)/i);if(o&&o[1]&&o[2]){let l=o[1].trim(),m=o[2].trim(),d=xo(t,l),p=Bd(m);if(!d)return {type:"resize_task",taskName:l,message:`Could not find a task named "${l}".`,success:false,error:"Task not found"};if(!p||!d.endDate)return {type:"resize_task",taskId:d.id,taskName:d.name,message:`Could not parse the duration "${m}".`,success:false,error:"Invalid duration"};let g=new Date(d.endDate);return g.setDate(g.getDate()+p),{type:"resize_task",taskId:d.id,taskName:d.name,updates:{endDate:g},message:`Extended "${d.name}" by ${p} days. New end date: ${g.toLocaleDateString()}.`,success:true}}let s=a.match(/(?:set|establecer|poner)\s+["""]?(.+?)["""]?\s+(?:progress|progreso)\s+(?:to|a|en)\s+(.+)/i);if(s&&s[1]&&s[2]){let l=s[1].trim(),m=s[2].trim(),d=xo(t,l),p=Rd(m);return d?p===null?{type:"set_progress",taskId:d.id,taskName:d.name,message:`Could not parse the progress value "${m}".`,success:false,error:"Invalid progress"}:{type:"set_progress",taskId:d.id,taskName:d.name,updates:{progress:p},message:`Set "${d.name}" progress to ${p}%.`,success:true}:{type:"set_progress",taskName:l,message:`Could not find a task named "${l}".`,success:false,error:"Task not found"}}let n=a.match(/(?:rename|renombrar|cambiar nombre de)\s+["""]?(.+?)["""]?\s+(?:to|a|por)\s+["""]?(.+?)["""]?$/i);if(n&&n[1]&&n[2]){let l=n[1].trim(),m=n[2].trim(),d=xo(t,l);return d?{type:"rename_task",taskId:d.id,taskName:d.name,updates:{name:m},message:`Renamed "${d.name}" to "${m}".`,success:true}:{type:"rename_task",taskName:l,message:`Could not find a task named "${l}".`,success:false,error:"Task not found"}}let i=a.match(/(?:link|vincular|conectar)\s+["""]?(.+?)["""]?\s+(?:to|a|con)\s+["""]?(.+?)["""]?$/i);if(i&&i[1]&&i[2]){let l=i[1].trim(),m=i[2].trim(),d=xo(t,l),p=xo(t,m);return d?p?{type:"link_tasks",taskId:p.id,taskName:p.name,dependencyFrom:d.id,dependencyTo:p.id,message:`Linked "${d.name}" \u2192 "${p.name}".`,success:true}:{type:"link_tasks",taskName:m,message:`Could not find a task named "${m}".`,success:false,error:"Target task not found"}:{type:"link_tasks",taskName:l,message:`Could not find a task named "${l}".`,success:false,error:"Source task not found"}}let c=a.match(/(?:delete|eliminar|borrar|remove|quitar)\s+["""]?(.+?)["""]?$/i);if(c&&c[1]){let l=c[1].trim(),m=xo(t,l);return m?{type:"delete_task",taskId:m.id,taskName:m.name,message:`Deleted "${m.name}".`,success:true}:{type:"delete_task",taskName:l,message:`Could not find a task named "${l}".`,success:false,error:"Task not found"}}return null}function Lm(e){if(!e||typeof e!="object")return {type:"unknown",message:"Invalid response from AI",success:false,error:"Invalid response format"};let t=e;return {type:t.type||"unknown",taskId:typeof t.taskId=="string"?t.taskId:void 0,taskName:typeof t.taskName=="string"?t.taskName:void 0,updates:t.updates,newTask:t.newTask,dependencyFrom:typeof t.dependencyFrom=="string"?t.dependencyFrom:void 0,dependencyTo:typeof t.dependencyTo=="string"?t.dependencyTo:void 0,message:typeof t.message=="string"?t.message:"Command processed",success:typeof t.success=="boolean"?t.success:false,error:typeof t.error=="string"?t.error:void 0}}function o2(e){if(e)switch(e.toUpperCase()){case "TODO":case "BLOCKED":return "todo";case "IN_PROGRESS":case "REVIEW":return "in-progress";case "DONE":return "completed";default:return "todo"}}function n2(e){switch(e){case "todo":return "TODO";case "in-progress":return "IN_PROGRESS";case "completed":return "DONE";default:return e||"TODO"}}function Ii(e,t=[],a=[]){let r=e.assignedUserIds?.map(m=>{let d=a.find(p=>p.id===m);return d?{name:d.name,initials:d.initials,color:d.color}:null}).filter(m=>m!==null),o=t.filter(m=>m.metadata?.parentCardId===e.id).map(m=>Ii(m,t,a)),s;e.dependencies&&(typeof e.dependencies[0]=="string"?s=e.dependencies:s=e.dependencies.filter(m=>m.type==="finish-to-start").map(m=>m.taskId));let n=m=>{if(m)return typeof m=="string"?new Date(m):m},i=n(e.startDate),c=n(e.endDate),l=e.metadata?.isMilestone===true||i&&c&&Math.abs(c.getTime()-i.getTime())<=864e5;return {id:e.id,name:e.title,startDate:i,endDate:c,progress:e.progress||0,status:o2(e.metadata?.status),assignees:r?.length?r:void 0,dependencies:s?.length?s:void 0,subtasks:o?.length?o:void 0,isExpanded:e.metadata?.isExpanded===true,isMilestone:l,isCriticalPath:e.metadata?.isCriticalPath===true}}function Im(e,t=[]){let a;return e.assignees&&e.assignees.length>0&&(a=e.assignees.map(r=>t.find(s=>s.name===r.name||s.initials===r.initials)?.id).filter(r=>r!==void 0)),{id:e.id,title:e.name,startDate:e.startDate,endDate:e.endDate,progress:e.progress,assignedUserIds:a?.length?a:void 0,metadata:{status:n2(e.status),isExpanded:e.isExpanded,isMilestone:e.isMilestone,isCriticalPath:e.isCriticalPath}}}function Bm(e,t=[]){return e.filter(r=>!r.metadata?.parentCardId).map(r=>Ii(r,e,t))}var Od={columns:{name:"Task ID / Name",startDate:"Start Date",endDate:"End Date",progress:"Progress",status:"Status",assignees:"Assignees",priority:"Priority",actions:"Actions",estimatedTime:"Estimated",quotedTime:"Quoted",elapsedTime:"Executed",tags:"Tags",scheduleVariance:"Sched / Var",hoursBar:"Hours (Spent / Allocated)",teamLoad:"Team Load",blockers:"Blockers",weight:"Weight"},toolbar:{search:"Search",searchPlaceholder:"Search tasks...",filter:"Filter",clearFilters:"Clear Filters",export:"Export",columns:"Columns",newTask:"New Task"},filters:{status:"Status",assignees:"Assignees",dateRange:"Date Range",showCompleted:"Show Completed",all:"All",none:"None"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},actions:{edit:"Edit",delete:"Delete",duplicate:"Duplicate",viewDetails:"View Details"},empty:{noTasks:"No tasks yet",noResults:"No tasks match your filters",addFirstTask:"Add your first task"},pagination:{showing:"Showing",of:"of",tasks:"tasks",previous:"Previous",next:"Next"},bulk:{selected:"selected",delete:"Delete",move:"Move to",assignTo:"Assign to"}},$d={columns:{name:"ID Tarea / Nombre",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",status:"Estado",assignees:"Asignados",priority:"Prioridad",actions:"Acciones",estimatedTime:"Estimado",quotedTime:"Ofertado",elapsedTime:"Ejecutado",tags:"Etiquetas",scheduleVariance:"Prog / Var",hoursBar:"Horas (Usado / Asignado)",teamLoad:"Equipo",blockers:"Bloqueantes",weight:"Peso"},toolbar:{search:"Buscar",searchPlaceholder:"Buscar tareas...",filter:"Filtrar",clearFilters:"Limpiar Filtros",export:"Exportar",columns:"Columnas",newTask:"Nueva Tarea"},filters:{status:"Estado",assignees:"Asignados",dateRange:"Rango de Fechas",showCompleted:"Mostrar Completadas",all:"Todos",none:"Ninguno"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},actions:{edit:"Editar",delete:"Eliminar",duplicate:"Duplicar",viewDetails:"Ver Detalles"},empty:{noTasks:"Sin tareas a\xFAn",noResults:"Ninguna tarea coincide con los filtros",addFirstTask:"Agrega tu primera tarea"},pagination:{showing:"Mostrando",of:"de",tasks:"tareas",previous:"Anterior",next:"Siguiente"},bulk:{selected:"seleccionadas",delete:"Eliminar",move:"Mover a",assignTo:"Asignar a"}},Bi={en:Od,es:$d};function Hd(e){return Bi[e]||Bi.en}function Ri(e,t){let a=Hd(e);return t?{columns:{...a.columns,...t.columns},toolbar:{...a.toolbar,...t.toolbar},filters:{...a.filters,...t.filters},status:{...a.status,...t.status},actions:{...a.actions,...t.actions},empty:{...a.empty,...t.empty},pagination:{...a.pagination,...t.pagination},bulk:{...a.bulk,...t.bulk}}:a}var zd=[{value:"todo",icon:lucideReact.Circle,color:"text-gray-400"},{value:"in-progress",icon:lucideReact.PlayCircle,color:"text-[#3B9EFF]"},{value:"completed",icon:lucideReact.CheckCircle2,color:"text-[#3BF06E]"}];function Rm(e){let t=e?.toLowerCase()||"todo";return t==="inprogress"||t==="in-progress"||t==="in_progress"?"in-progress":t==="completed"||t==="done"||t==="complete"?"completed":"todo"}function Om({value:e,onChange:t,isDark:a,translations:r,disabled:o=false}){let[s,n]=react.useState(false),i=react.useRef(null);react.useEffect(()=>{let g=y=>{i.current&&!i.current.contains(y.target)&&n(false);};return s&&document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[s]);let c=Rm(e),l=zd[0],m=zd.find(g=>g.value===c)??l,d=m.icon,p=g=>{switch(Rm(g)){case "completed":return r.completed;case "in-progress":return r.inProgress;default:return r.todo}};return o||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(d,{className:u("w-4 h-4 flex-shrink-0",m.color)}),jsxRuntime.jsx("span",{className:u("text-sm whitespace-nowrap",a?"text-white/60":"text-gray-500"),children:p(e)})]}):jsxRuntime.jsxs("div",{ref:i,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:g=>{g.stopPropagation(),n(!s);},className:u("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:[jsxRuntime.jsx(d,{className:u("w-4 h-4 flex-shrink-0",m.color)}),jsxRuntime.jsx("span",{className:u("text-sm whitespace-nowrap",a?"text-white/60":"text-gray-500"),children:p(e)}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-3 h-3",a?"text-white/30":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:u("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[140px]",a?"bg-[#1A1A1A] border-[#222]":"bg-white border-gray-200"),children:zd.map(g=>{let y=g.icon;return jsxRuntime.jsxs("button",{onClick:x=>{x.stopPropagation(),t(g.value),n(false);},className:u("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100",c===g.value&&(a?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx(y,{className:u("w-4 h-4",g.color)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:p(g.value)})]},g.value)})})]})}var Ud=[{value:"urgent",label:{en:"Urgent",es:"Urgente"},color:"text-[#FF2D20]",bg:"bg-[#FF2D20]"},{value:"high",label:{en:"High",es:"Alta"},color:"text-[#FF2D20]",bg:"bg-[#FF2D20]"},{value:"medium",label:{en:"Medium",es:"Media"},color:"text-[#FFD60A]",bg:"bg-[#FFD60A]"},{value:"low",label:{en:"Low",es:"Baja"},color:"text-[#3B9EFF]",bg:"bg-[#3B9EFF]"},{value:"none",label:{en:"None",es:"Ninguna"},color:"text-gray-400",bg:"bg-gray-400"}];function Hm({value:e="none",onChange:t,isDark:a,locale:r,disabled:o=false}){let[s,n]=react.useState(false),i=react.useRef(null);react.useEffect(()=>{let m=d=>{i.current&&!i.current.contains(d.target)&&n(false);};return s&&document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[s]);let c=Ud.find(m=>m.value===e)??Ud[4],l=r==="es"?"es":"en";return o||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Flag,{className:u("w-4 h-4",c.color)}),jsxRuntime.jsx("span",{className:u("text-sm",a?"text-white/60":"text-gray-500"),children:c.label[l]})]}):jsxRuntime.jsxs("div",{ref:i,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:m=>{m.stopPropagation(),n(!s);},className:u("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Flag,{className:u("w-4 h-4",c.color)}),jsxRuntime.jsx("span",{className:u("text-sm",a?"text-white/60":"text-gray-500"),children:c.label[l]}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-3 h-3",a?"text-white/30":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:u("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px]",a?"bg-[#1A1A1A] border-[#222]":"bg-white border-gray-200"),children:Ud.map(m=>jsxRuntime.jsxs("button",{onClick:d=>{d.stopPropagation(),t(m.value),n(false);},className:u("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100",e===m.value&&(a?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:u("w-2 h-2 rounded-full",m.bg)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:m.label[l]})]},m.value))})]})}function hs(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function Wd(e){let t=["bg-blue-500","bg-green-500","bg-purple-500","bg-pink-500","bg-yellow-500","bg-red-500","bg-indigo-500","bg-teal-500"],a=0;for(let r=0;r<e.length;r++)a=e.charCodeAt(r)+((a<<5)-a);return t[Math.abs(a)%t.length]??"bg-blue-500"}function Gm({value:e=[],availableUsers:t=[],onChange:a,isDark:r,locale:o,disabled:s=false}){let[n,i]=react.useState(false),[c,l]=react.useState(""),m=react.useRef(null),d=react.useRef(null);react.useEffect(()=>{let x=h=>{m.current&&!m.current.contains(h.target)&&(i(false),l(""));};return n&&document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[n]),react.useEffect(()=>{n&&d.current&&d.current.focus();},[n]);let p=t.filter(x=>x.name.toLowerCase().includes(c.toLowerCase())),g=x=>e.some(h=>h.name===x),y=x=>{if(a){if(g(x.name))a(e.filter(h=>h.name!==x.name));else {let h={name:x.name,initials:hs(x.name),color:x.color||Wd(x.name).replace("bg-","").replace("-500",""),avatar:x.avatarUrl,id:x.id};a([...e,h]);}i(false),l("");}};return s||!a?e.length===0?jsxRuntime.jsx("span",{className:u("text-sm",r?"text-white/30":"text-gray-400"),children:"-"}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-2",children:[e.slice(0,3).map((x,h)=>jsxRuntime.jsx("div",{className:u("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium text-white border-2",r?"border-[#0D0D0D]":"border-white",!x.avatar&&Wd(x.name)),style:x.color&&!x.avatar?{backgroundColor:x.color}:void 0,title:x.name,children:x.avatar?jsxRuntime.jsx("img",{src:x.avatar,alt:x.name,className:"w-full h-full rounded-full object-cover"}):x.initials||hs(x.name)},`${x.name}-${h}`)),e.length>3&&jsxRuntime.jsxs("div",{className:u("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium border-2",r?"bg-[#1A1A1A] border-[#0D0D0D] text-white":"bg-gray-200 border-white text-gray-600"),children:["+",e.length-3]})]}):jsxRuntime.jsxs("div",{ref:m,className:"relative",children:[jsxRuntime.jsx("button",{onClick:x=>{x.stopPropagation(),i(!n);},className:u("flex items-center gap-1 px-2 py-1 rounded transition-colors",r?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:e.length===0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.User,{className:u("w-4 h-4",r?"text-white/30":"text-gray-400")}),jsxRuntime.jsx(lucideReact.Plus,{className:u("w-3 h-3",r?"text-white/30":"text-gray-400")})]}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-1",children:[e.slice(0,2).map((x,h)=>jsxRuntime.jsx("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-medium text-white border",r?"border-[#0D0D0D]":"border-white",!x.avatar&&Wd(x.name)),style:x.color&&!x.avatar?{backgroundColor:x.color}:void 0,children:x.avatar?jsxRuntime.jsx("img",{src:x.avatar,alt:x.name,className:"w-full h-full rounded-full object-cover"}):x.initials||hs(x.name)},`${x.name}-${h}`)),e.length>2&&jsxRuntime.jsxs("span",{className:u("text-xs ml-1",r?"text-white/60":"text-gray-500"),children:["+",e.length-2]})]})}),n&&jsxRuntime.jsxs("div",{className:"absolute z-50 top-full left-0 mt-1.5 rounded-lg overflow-hidden",style:{width:260,backgroundColor:r?"rgba(17, 17, 17, 0.98)":"rgba(255, 255, 255, 0.98)",border:`1px solid ${r?"rgba(255,255,255,0.10)":"rgba(0,0,0,0.1)"}`,boxShadow:r?"0 8px 24px rgba(0,0,0,0.5)":"0 8px 24px rgba(0,0,0,0.12)"},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",style:{padding:"8px 10px",borderBottom:`1px solid ${r?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"}`},children:[jsxRuntime.jsx(lucideReact.Search,{className:"flex-shrink-0",style:{width:14,height:14,color:r?"rgba(255,255,255,0.20)":"#94A3B8"}}),jsxRuntime.jsx("input",{ref:d,type:"text",value:c,onChange:x=>l(x.target.value),placeholder:o==="es"?"Buscar miembros...":"Search members...",onClick:x=>x.stopPropagation(),style:{flex:1,fontSize:12,color:r?"rgba(255,255,255,0.92)":"#0F172A",backgroundColor:"transparent",border:"none",outline:"none",fontFamily:"Inter, sans-serif"}})]}),e.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",style:{padding:"6px 10px",borderBottom:`1px solid ${r?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"}`},children:e.map((x,h)=>jsxRuntime.jsxs("span",{className:"flex items-center gap-1",style:{fontSize:11,padding:"2px 6px 2px 4px",borderRadius:4,backgroundColor:x.color?`${x.color}20`:r?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)",color:x.color||(r?"#fff":"#334155")},children:[jsxRuntime.jsx("span",{className:"flex items-center justify-center",style:{width:16,height:16,borderRadius:"50%",backgroundColor:x.color||"#3B82F6",fontSize:8,fontWeight:700,color:"#fff"},children:x.avatar?jsxRuntime.jsx("img",{src:x.avatar,alt:x.name,className:"w-full h-full rounded-full object-cover"}):x.initials||hs(x.name)}),x.name.split(" ")[0],jsxRuntime.jsx("button",{onClick:f=>{f.stopPropagation(),a(e.filter(b=>b.name!==x.name));},className:"flex items-center justify-center",style:{width:14,height:14,borderRadius:3,border:"none",background:"transparent",color:"inherit",cursor:"pointer",opacity:.7},children:jsxRuntime.jsx(lucideReact.X,{style:{width:10,height:10}})})]},`${x.name}-${h}`))}),jsxRuntime.jsx("div",{style:{maxHeight:200,overflowY:"auto",padding:4},children:p.length===0?jsxRuntime.jsx("div",{style:{padding:"12px 10px",fontSize:12,color:r?"rgba(255,255,255,0.35)":"#94A3B8",textAlign:"center"},children:o==="es"?"No se encontraron miembros":"No members found"}):p.map(x=>{let h=g(x.name);return jsxRuntime.jsxs("button",{onClick:f=>{f.stopPropagation(),y(x);},className:"flex items-center w-full",style:{gap:8,padding:"6px 10px",borderRadius:4,border:"none",cursor:"pointer",backgroundColor:h?r?"rgba(0, 127, 255, 0.12)":"rgba(59, 130, 246, 0.08)":"transparent",color:r?"rgba(255,255,255,0.92)":"#0F172A",fontSize:12,textAlign:"left",transition:"background-color 0.1s"},onMouseEnter:f=>{h||(f.currentTarget.style.backgroundColor=r?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)");},onMouseLeave:f=>{h||(f.currentTarget.style.backgroundColor="transparent");},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center flex-shrink-0",style:{width:24,height:24,borderRadius:"50%",backgroundColor:x.color||"#3B82F6",fontSize:9,fontWeight:700,color:"#fff"},children:x.avatarUrl?jsxRuntime.jsx("img",{src:x.avatarUrl,alt:x.name,className:"w-full h-full rounded-full object-cover"}):hs(x.name)}),jsxRuntime.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.name}),h&&jsxRuntime.jsx("div",{className:"flex items-center justify-center",style:{width:16,height:16,borderRadius:4,backgroundColor:"rgba(96, 165, 250, 0.2)"},children:jsxRuntime.jsx("div",{style:{width:8,height:8,borderRadius:2,backgroundColor:"#60A5FA"}})})]},x.id)})})]})]})}function jm({startDate:e,endDate:t,onChange:a,singleDateMode:r=false,singleDateField:o="end",isDark:s,locale:n,disabled:i=false,placeholder:c}){let[l,m]=react.useState(false),[d,p]=react.useState(o),[g,y]=react.useState(()=>{let T=o==="start"?e:t;if(T){let k=T instanceof Date?T:new Date(T);return new Date(k.getFullYear(),k.getMonth(),1)}return new Date(new Date().getFullYear(),new Date().getMonth(),1)}),x=react.useRef(null),h=e?e instanceof Date?e:new Date(e):null,f=t?t instanceof Date?t:new Date(t):null;react.useEffect(()=>{let T=k=>{x.current&&!x.current.contains(k.target)&&m(false);};return l&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[l]),react.useEffect(()=>{l&&p(r?o:"start");},[l,r,o]);let b=T=>T?T.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"}):c||"-",v=react.useCallback(()=>{let T=g.getFullYear(),k=g.getMonth(),P=new Date(T,k,1),S=new Date(T,k+1,0).getDate(),J=P.getDay(),R=[],M=new Date(T,k,0).getDate();for(let Z=J-1;Z>=0;Z--)R.push({date:new Date(T,k-1,M-Z),isCurrentMonth:false});for(let Z=1;Z<=S;Z++)R.push({date:new Date(T,k,Z),isCurrentMonth:true});let q=42-R.length;for(let Z=1;Z<=q;Z++)R.push({date:new Date(T,k+1,Z),isCurrentMonth:false});return R},[g]),C=T=>{if(r)o==="start"?a(T,f||void 0):a(h||void 0,T),m(false);else if(d==="start"){let k=f&&T>f?T:f;a(T,k||void 0),p("end");}else {let k=h&&T<h?T:h;a(k||void 0,T),m(false);}},w=()=>{let T=new Date,k=new Date(T);k.setDate(T.getDate()+1);let P=new Date(T);P.setDate(T.getDate()+((6-T.getDay()+7)%7||7));let O=new Date(T);O.setDate(T.getDate()+((1-T.getDay()+7)%7||7));let S=new Date(T);S.setDate(T.getDate()+(6-T.getDay()+7)%7+7);let J=new Date(T);J.setDate(T.getDate()+14);let R=new Date(T);return R.setDate(T.getDate()+28),[{label:n==="es"?"Hoy":"Today",date:T,display:T.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:n==="es"?"Ma\xF1ana":"Tomorrow",date:k,display:k.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:n==="es"?"Este fin de semana":"This weekend",date:P,display:n==="es"?"s\xE1b.":"sat."},{label:n==="es"?"Pr\xF3xima semana":"Next week",date:O,display:n==="es"?"lun.":"mon."},{label:n==="es"?"Pr\xF3ximo fin de semana":"Next weekend",date:S,display:S.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:n==="es"?"2 semanas":"2 weeks",date:J,display:J.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:n==="es"?"4 semanas":"4 weeks",date:R,display:R.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}]};if(i){let T=r&&o==="start"?h:f;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:u("w-4 h-4",s?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("text-sm",s?"text-white/60":"text-gray-500"),children:b(T)})]})}let N=r&&o==="start"?h:f;return jsxRuntime.jsxs("div",{ref:x,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:T=>{T.stopPropagation(),m(!l);let k=o==="start"?h:f;k&&y(new Date(k.getFullYear(),k.getMonth(),1));},className:u("flex items-center gap-2 px-2 py-1 rounded transition-colors",s?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:u("w-4 h-4",s?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("text-sm",s?"text-white/60":"text-gray-500"),children:b(N)})]}),l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>m(false)}),jsxRuntime.jsxs("div",{className:u("absolute z-50 top-full left-0 mt-1 rounded-xl shadow-2xl overflow-hidden flex",s?"bg-[#1A1A1A] border border-[#222]":"bg-white border border-gray-200"),onClick:T=>T.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:u("w-44 py-2 border-r",s?"border-[#222]":"border-gray-200"),children:[w().map((T,k)=>jsxRuntime.jsxs("button",{className:u("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",s?"hover:bg-white/[0.05] text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>C(T.date),children:[jsxRuntime.jsx("span",{children:T.label}),jsxRuntime.jsx("span",{className:u("text-xs",s?"text-white/30":"text-gray-400"),children:T.display})]},k)),jsxRuntime.jsx("div",{className:u("border-t mt-2 pt-2",s?"border-[#222]":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:()=>{r?o==="start"?a(void 0,f||void 0):a(h||void 0,void 0):a(void 0,void 0),m(false);},className:u("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",s?"hover:bg-white/[0.05] text-red-400":"hover:bg-gray-50 text-red-500"),children:[jsxRuntime.jsx("span",{children:n==="es"?"Quitar fecha":"Clear date"}),jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4 opacity-50"})]})})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[!r&&jsxRuntime.jsx("div",{className:u("text-xs mb-3 px-2 py-1 rounded",s?"bg-white/[0.03] text-white/60":"bg-gray-100 text-gray-600"),children:d==="start"?n==="es"?"\u{1F4C5} Selecciona fecha de inicio":"\u{1F4C5} Select start date":n==="es"?"\u{1F4C5} Selecciona fecha de fin":"\u{1F4C5} Select end date"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("span",{className:u("font-medium",s?"text-white":"text-gray-900"),children:g.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>y(new Date),className:u("p-1 rounded text-sm transition-colors",s?"hover:bg-white/[0.05] text-white":"hover:bg-gray-100 text-gray-700"),children:n==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>y(new Date(g.getFullYear(),g.getMonth()-1)),className:u("p-1 rounded",s?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:u("w-4 h-4",s?"text-white":"text-gray-600")})}),jsxRuntime.jsx("button",{onClick:()=>y(new Date(g.getFullYear(),g.getMonth()+1)),className:u("p-1 rounded",s?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:u("w-4 h-4",s?"text-white":"text-gray-600")})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:(n==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(T=>jsxRuntime.jsx("div",{className:u("w-8 h-8 flex items-center justify-center text-xs",s?"text-white/30":"text-gray-400"),children:T},T))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:v().map((T,k)=>{let P=T.date.toDateString()===new Date().toDateString(),O=h?.toDateString()===T.date.toDateString(),S=f?.toDateString()===T.date.toDateString(),J=O||S,R=!r&&h&&f&&T.date>=h&&T.date<=f;return jsxRuntime.jsx("button",{onClick:()=>C(new Date(T.date)),className:u("w-8 h-8 rounded-full flex items-center justify-center text-sm transition-colors",!T.isCurrentMonth&&(s?"text-white/20":"text-gray-300"),T.isCurrentMonth&&(s?"text-white":"text-gray-900"),P&&"ring-2 ring-[#007BFF]",O&&"bg-[#007BFF] text-white",S&&!O&&"bg-[#7C3AED] text-white",R&&!J&&(s?"bg-[#7C3AED]/20":"bg-purple-100"),!J&&(s?"hover:bg-white/[0.05]":"hover:bg-gray-100")),children:T.date.getDate()},k)})})]})]})]})]})}function Hi({value:e,onChange:t,isDark:a,locale:r,disabled:o=false,dateField:s="end",startDate:n,endDate:i}){let c=e?e instanceof Date?e:new Date(e):null;return jsxRuntime.jsx(jm,{startDate:s==="start"?c:n||null,endDate:s==="end"?c:i||null,onChange:(p,g)=>{t&&t(s==="start"?p:g);},singleDateMode:true,singleDateField:s,isDark:a,locale:r,disabled:o||!t,placeholder:"-"})}function Rn(e=600){let[t,a]=react.useState(false),r=react.useRef(null),o=react.useCallback(()=>{r.current&&clearTimeout(r.current),a(true),r.current=setTimeout(()=>{a(false);},e);},[e]);return react.useEffect(()=>()=>{r.current&&clearTimeout(r.current);},[]),{isFlashing:t,triggerFlash:o}}function zi(e,t={}){let{enabled:a=true,duration:r=400,steps:o=8}=t,[s,n]=react.useState(e),[i,c]=react.useState(false),l=react.useRef(e),m=react.useRef([]);return react.useEffect(()=>{if(m.current.forEach(clearTimeout),m.current=[],!a||e===l.current||e===void 0){n(e),l.current=e;return}let d=l.current??0,p=e,g=p-d,y=r/o;c(true);for(let x=1;x<=o;x++){let h=setTimeout(()=>{let f=x/o,b=1-Math.pow(1-f,3),v=Math.round(d+g*b);n(v),x===o&&(c(false),n(p));},y*x);m.current.push(h);}return l.current=e,()=>{m.current.forEach(clearTimeout),m.current=[];}},[e,a,r,o]),{displayValue:s,isAnimating:i}}function Km(e,t={}){let{delay:a=1500,onCancel:r}=t,[o,s]=react.useState(null),[n,i]=react.useState(0),c=react.useRef(null),l=react.useRef(null),m=react.useCallback(g=>{c.current&&clearTimeout(c.current),l.current&&clearInterval(l.current),s(g),i(0);let y=Date.now();l.current=setInterval(()=>{let x=Date.now()-y,h=Math.min(x/a*100,100);i(h);},16),c.current=setTimeout(()=>{l.current&&clearInterval(l.current),e?.(g),s(null),i(0);},a);},[a,e]),d=react.useCallback(()=>{c.current&&clearTimeout(c.current),l.current&&clearInterval(l.current),s(null),i(0),r?.();},[r]);return react.useEffect(()=>()=>{c.current&&clearTimeout(c.current),l.current&&clearInterval(l.current);},[]),{pendingValue:o,isPending:o!==null,progress:n,startChange:m,cancelChange:d}}function qm({value:e=0,onChange:t,isDark:a,disabled:r=false,enableSlotMachine:o=true,enableSaveFlash:s=true}){let[n,i]=react.useState(false),[c,l]=react.useState(""),m=react.useRef(null),{isFlashing:d,triggerFlash:p}=Rn(),{displayValue:g,isAnimating:y}=zi(e,{enabled:o,duration:300,steps:6}),x=C=>{if(r||!t)return;C.stopPropagation();let w=C.currentTarget.getBoundingClientRect(),N=C.clientX-w.left,T=Math.round(N/w.width*100),k=Math.max(0,Math.min(100,T));k!==e&&(t(k),s&&p());},h=react.useCallback(C=>{r||!t||(C.stopPropagation(),l(String(e)),i(true));},[r,t,e]);react.useEffect(()=>{n&&m.current&&(m.current.focus(),m.current.select());},[n]);let f=react.useCallback(()=>{i(false);let C=parseInt(c,10);if(!isNaN(C)&&t){let w=Math.max(0,Math.min(100,C));w!==e&&(t(w),s&&p());}},[c,t,e,s,p]),b=react.useCallback(C=>{C.key==="Enter"&&f(),C.key==="Escape"&&i(false);},[f]),v=g??e;return jsxRuntime.jsxs("div",{className:u("flex items-center gap-2 w-full rounded px-1 py-0.5 transition-[background-color] duration-300",d&&(a?"bg-[#3BF06E]/30":"bg-[#3BF06E]/20")),children:[jsxRuntime.jsx("div",{onClick:x,className:u("flex-1 h-2 rounded-full overflow-hidden",a?"bg-white/[0.05]":"bg-gray-200",!r&&t&&"cursor-pointer"),children:jsxRuntime.jsx("div",{className:u("h-full rounded-full transition-[width]",v===100?"bg-[#3BF06E]":"bg-[#3B9EFF]",y&&"transition-none"),style:{width:`${v}%`}})}),n?jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",onClick:C=>C.stopPropagation(),children:[jsxRuntime.jsx("input",{ref:m,value:c,onChange:C=>l(C.target.value.replace(/[^0-9]/g,"")),onBlur:f,onKeyDown:b,maxLength:3,className:u("w-8 text-xs text-right tabular-nums font-mono rounded border px-1 py-0 outline-none",a?"bg-white/10 border-white/20 text-white focus:border-blue-400":"bg-white border-gray-300 text-gray-900 focus:border-blue-500")}),jsxRuntime.jsx("span",{className:u("text-xs font-mono",a?"text-white/40":"text-gray-400"),children:"%"})]}):jsxRuntime.jsxs("span",{onClick:h,className:u("text-xs w-8 text-right tabular-nums font-mono rounded px-1",a?"text-white/60":"text-gray-500",!r&&t&&"cursor-pointer hover:bg-white/[0.08]",y&&"font-medium scale-105"),title:!r&&t?"Click to edit":void 0,children:[v,"%"]})]})}function Qm({value:e="",onChange:t,isDark:a,placeholder:r="-",disabled:o=false}){let[s,n]=react.useState(false),[i,c]=react.useState(e),l=react.useRef(null);react.useEffect(()=>{s&&l.current&&(l.current.focus(),l.current.select());},[s]),react.useEffect(()=>{c(e);},[e]);let m=()=>{i!==e&&t?.(i),n(false);},d=p=>{p.key==="Enter"?m():p.key==="Escape"&&(c(e),n(false));};return o||!t?jsxRuntime.jsx("span",{className:u("text-sm truncate",a?"text-white/60":"text-gray-500"),children:e||r}):s?jsxRuntime.jsx("input",{ref:l,type:"text",value:i,onChange:p=>c(p.target.value),onBlur:m,onKeyDown:d,onClick:p=>p.stopPropagation(),className:u("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/[0.03] border-[#007BFF] text-white":"bg-white border-[#007BFF] text-gray-900")}):jsxRuntime.jsx("button",{onClick:p=>{p.stopPropagation(),n(true);},className:u("text-sm truncate text-left w-full px-2 py-1 rounded transition-colors",a?"text-white/60 hover:bg-white/[0.05]":"text-gray-500 hover:bg-gray-100",!e&&(a?"text-white/30":"text-gray-400")),children:e||r})}function tg({value:e,onChange:t,isDark:a,placeholder:r="-",min:o,max:s,disabled:n=false,enableSlotMachine:i=true,enableSaveFlash:c=true}){let[l,m]=react.useState(false),[d,p]=react.useState(e?.toString()||""),g=react.useRef(null),{isFlashing:y,triggerFlash:x}=Rn(),{displayValue:h,isAnimating:f}=zi(e,{enabled:i&&!l});react.useEffect(()=>{l&&g.current&&(g.current.focus(),g.current.select());},[l]),react.useEffect(()=>{p(e?.toString()||"");},[e]);let b=()=>{let C=parseFloat(d);if(!isNaN(C)){let w=C;o!==void 0&&(w=Math.max(o,w)),s!==void 0&&(w=Math.min(s,w)),w!==e&&(t?.(w),c&&x());}m(false);},v=C=>{C.key==="Enter"?b():C.key==="Escape"&&(p(e?.toString()||""),m(false));};return n||!t?jsxRuntime.jsx("span",{className:u("text-sm font-mono",a?"text-white/60":"text-gray-500",f&&"font-medium"),children:h!==void 0?h:r}):l?jsxRuntime.jsx("input",{ref:g,type:"number",value:d,onChange:C=>p(C.target.value),onBlur:b,onKeyDown:v,onClick:C=>C.stopPropagation(),min:o,max:s,className:u("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/[0.03] border-[#007BFF] text-white":"bg-white border-[#007BFF] text-gray-900")}):jsxRuntime.jsx("button",{onClick:C=>{C.stopPropagation(),m(true);},className:u("text-sm text-left w-full px-2 py-1 rounded transition-[background-color] duration-300",a?"text-white/60 hover:bg-white/[0.05]":"text-gray-500 hover:bg-gray-100",h===void 0&&(a?"text-white/30":"text-gray-400"),y&&(a?"bg-green-500/30":"bg-green-500/20"),f&&"font-medium scale-105"),children:h!==void 0?h:r})}function ag({value:e,options:t=[],onChange:a,isDark:r,placeholder:o="-",disabled:s=false}){let[n,i]=react.useState(false),c=react.useRef(null);return react.useEffect(()=>{let l=m=>{c.current&&!c.current.contains(m.target)&&i(false);};return n&&document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[n]),s||!a?jsxRuntime.jsx("span",{className:u("text-sm",r?"text-white/60":"text-gray-500"),children:e||o}):jsxRuntime.jsxs("div",{ref:c,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:l=>{l.stopPropagation(),i(!n);},className:u("flex items-center gap-2 px-2 py-1 rounded transition-colors min-w-[80px]",r?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:[jsxRuntime.jsx("span",{className:u("text-sm flex-1 text-left truncate",r?"text-white/60":"text-gray-500",!e&&(r?"text-white/30":"text-gray-400")),children:e||o}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-3 h-3 flex-shrink-0",r?"text-white/30":"text-gray-400")})]}),n&&jsxRuntime.jsx("div",{className:u("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px] max-h-48 overflow-y-auto",r?"bg-[#1A1A1A] border-[#222]":"bg-white border-gray-200"),children:t.length===0?jsxRuntime.jsx("p",{className:u("px-3 py-2 text-sm",r?"text-white/30":"text-gray-400"),children:"No options"}):t.map(l=>jsxRuntime.jsxs("button",{onClick:m=>{m.stopPropagation(),a(l),i(false);},className:u("w-full flex items-center justify-between gap-2 px-3 py-2 text-sm transition-colors",r?"hover:bg-white/[0.05]":"hover:bg-gray-100",e===l&&(r?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:l}),e===l&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-[#007BFF]"})]},l))})]})}function og({value:e=false,onChange:t,isDark:a,disabled:r=false,enableDelayedConfirm:o=true,confirmDelay:s=1500}){let{pendingValue:n,isPending:i,progress:c,startChange:l,cancelChange:m}=Km(t,{delay:s}),d=g=>{g.stopPropagation(),!r&&t&&(o?i?m():l(!e):t(!e));},p=i?n:e;return jsxRuntime.jsxs("div",{className:"relative inline-flex items-center gap-1",children:[jsxRuntime.jsxs("button",{onClick:d,disabled:r||!t,className:u("relative w-5 h-5 rounded border-2 flex items-center justify-center transition-[border-color,background-color,box-shadow]",p?"bg-[#007BFF] border-[#007BFF]":a?"border-[#333] hover:border-[#6B7280]":"border-gray-300 hover:border-gray-400",(r||!t)&&"opacity-50 cursor-not-allowed",i&&"ring-2 ring-offset-1",i&&p&&"ring-green-500/50",i&&!p&&"ring-red-500/50",i&&(a?"ring-offset-[#050505]":"ring-offset-white")),children:[i&&jsxRuntime.jsx("svg",{className:"absolute inset-0 w-full h-full -rotate-90",viewBox:"0 0 20 20",children:jsxRuntime.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:p?"#22C55E":"#EF4444",strokeWidth:"2",strokeDasharray:`${c/100*50.26} 50.26`,className:"transition-all duration-100"})}),i?jsxRuntime.jsx(lucideReact.Loader2,{className:"w-3 h-3 text-white animate-spin"}):p?jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"}):null]}),i&&jsxRuntime.jsx("button",{onClick:g=>{g.stopPropagation(),m();},className:u("w-4 h-4 rounded-full flex items-center justify-center transition-colors",a?"bg-red-500/20 hover:bg-red-500/40 text-red-400":"bg-red-100 hover:bg-red-200 text-red-500"),title:"Cancelar",children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]})}function ig({value:e=[],isDark:t,maxVisible:a=2}){if(e.length===0)return jsxRuntime.jsx("span",{className:u("text-sm",t?"text-white/30":"text-gray-400"),children:"-"});let r=e.slice(0,a),o=e.length-a;return jsxRuntime.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[r.map(s=>jsxRuntime.jsx("span",{className:"inline-flex items-center px-2 py-0.5 text-[9px] font-mono uppercase tracking-wide rounded",style:{backgroundColor:s.color?`${s.color}20`:t?"rgba(255,255,255,0.05)":"#F3F4F6",color:s.color||(t?"rgba(255,255,255,0.5)":"#6B7280")},children:s.name},s.id)),o>0&&jsxRuntime.jsxs("span",{className:u("inline-flex items-center px-2 py-0.5 text-xs rounded-full",t?"bg-white/[0.05] text-white/60":"bg-gray-100 text-gray-500"),children:["+",o]})]})}function G2(e,t="en"){if(e==null||e===0||!e||Number(e)===0)return "-";let a=Math.floor(e/60),r=e%60;return a===0?`${r}m`:r===0?`${a}h`:`${a}h ${r}m`}function V2(e){let t=e.trim().toLowerCase();if(!t||t==="-")return null;let a=t.match(/^(\d+):(\d+)$/);if(a&&a[1]&&a[2]){let i=parseInt(a[1],10),c=parseInt(a[2],10);return i*60+c}let r=t.match(/^(\d+\.?\d*)\s*h\s*(\d+)?\s*(m|min)?$/);if(r&&r[1]){let i=parseFloat(r[1]),c=r[2]?parseInt(r[2],10):0;return Math.round(i*60)+c}let o=t.match(/^(\d+\.?\d*)\s*h$/);if(o&&o[1])return Math.round(parseFloat(o[1])*60);let s=t.match(/^(\d+)\s*(m|min)$/);if(s&&s[1])return parseInt(s[1],10);let n=parseFloat(t);return isNaN(n)?null:Math.round(n*60)}function hr({value:e,onChange:t,isDark:a,locale:r="en",placeholder:o,disabled:s=false,enableSaveFlash:n=true,isBlurred:i=false,lens:c="hours",hourlyRate:l=0}){let[m,d]=react.useState(false),[p,g]=react.useState(""),y=react.useRef(null),{isFlashing:x,triggerFlash:h}=Rn(),f=c==="financial"&&l>0,b=f&&e?`$${Math.round(e/60*l).toLocaleString("en-US")}`:G2(e,r);react.useEffect(()=>{m&&y.current&&(y.current.focus(),y.current.select());},[m]),react.useEffect(()=>{if(e){let N=Math.floor(e/60),T=e%60;N>0&&T>0?g(`${N}h ${T}m`):N>0?g(`${N}h`):g(`${T}m`);}else g("");},[e,m]);let v=()=>{let N=V2(p);N!==e&&(t?.(N),n&&h()),d(false);},C=N=>{N.key==="Enter"?v():N.key==="Escape"&&d(false);};if(i)return jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",title:r==="es"?"No tienes permisos para ver este dato":"You don't have permission to view this data",children:[jsxRuntime.jsx(lucideReact.Clock,{className:u("w-3.5 h-3.5 flex-shrink-0",a?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("text-sm select-none blur-[4px] opacity-60 pointer-events-none",a?"text-white/60":"text-gray-500"),"aria-hidden":"true",children:"\u2022\u2022\u2022\u2022"})]});let w=f?lucideReact.DollarSign:lucideReact.Clock;return s||!t?!e||e===0?null:jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(w,{className:u("w-3.5 h-3.5 flex-shrink-0",a?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("text-sm font-mono",a?"text-white/60":"text-gray-500"),children:b})]}):m?jsxRuntime.jsx("input",{ref:y,type:"text",value:p,onChange:N=>g(N.target.value),onBlur:v,onKeyDown:C,onClick:N=>N.stopPropagation(),placeholder:"8 (=8h), 1h 30m",className:u("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/[0.03] border-[#007BFF] text-white placeholder:text-white/30":"bg-white border-[#007BFF] text-gray-900 placeholder:text-gray-400")}):jsxRuntime.jsxs("button",{onClick:N=>{N.stopPropagation(),d(true);},className:u("flex items-center gap-1 text-sm text-left w-full px-1.5 py-1 rounded transition-[background-color] duration-300 overflow-hidden",a?"hover:bg-white/[0.05]":"hover:bg-gray-100",e!=null&&e>0?a?"text-white/60":"text-gray-600":a?"text-white/30":"text-gray-400",x&&(a?"bg-green-500/30":"bg-green-500/20")),children:[e!=null&&e>0&&jsxRuntime.jsx(w,{className:u("w-3 h-3 flex-shrink-0",a?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:"truncate font-mono",children:b})]})}function ug({startDate:e,endDate:t,scheduleVariance:a,isDark:r,locale:o="en",hasTimeAllocated:s=true}){if(!e&&!t)return jsxRuntime.jsx("span",{className:u("text-[11px] font-mono",r?"text-white/30":"text-gray-400"),children:"-"});let n=c=>c.toLocaleDateString(o==="es"?"es-ES":"en-US",{month:"short",day:"numeric"}),i=()=>{if(a==null)return null;let c=o==="es";return a===0?s?jsxRuntime.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#3B9EFF",fontWeight:600},children:c?"En Tiempo":"On Track"}):jsxRuntime.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:r?"rgba(255,255,255,0.3)":"#94A3B8",fontWeight:500},children:c?"Tiempo no asignado":"No time allocated"}):a>0?jsxRuntime.jsxs("span",{className:"font-mono",style:{fontSize:"10px",color:"#3BF06E",fontWeight:600},children:["+",a,"d ",c?"Adelante":"Early"]}):jsxRuntime.jsxs("span",{className:"font-mono",style:{fontSize:"10px",color:"#FF2D20",fontWeight:600},children:[a,"d ",c?"Atraso":"Delay"]})};return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[jsxRuntime.jsxs("span",{className:u("text-[11px] font-mono",r?"text-white/60":"text-gray-500"),children:[e?n(e):"\u2014",jsxRuntime.jsx("span",{className:r?"text-white/20 mx-1":"text-gray-300 mx-1",children:"vs"}),t?n(t):"\u2014"]}),i()]})}function mg({task:e,isDark:t,locale:a="en",onLogTime:r,onEstimateUpdate:o,onSoldEffortUpdate:s,onOpenTimeLog:n,lens:i="hours",hourlyRate:c=0}){let l=a==="es",m=i==="financial"&&c>0,d=Z=>m?`$${Math.round(Z*c).toLocaleString("en-US")}`:`${Z}h`,[p,g]=react.useState(false),[y,x]=react.useState(false),[h,f]=react.useState(null),b=react.useRef(null),v=e.timeLoggedMinutes||0,C=e.effortMinutes||0,w=e.soldEffortMinutes||0,N=Math.round(v/60*10)/10,T=Math.round(C/60*10)/10,k=C>0?v/C*100:0,P=k>100?Math.round((v-C)/60*10)/10:0,O=k>100?"#EF4444":"#00E5CC";react.useEffect(()=>{if(!y&&!h)return;let Z=Re=>{b.current&&!b.current.contains(Re.target)&&(x(false),f(null));};return document.addEventListener("mousedown",Z),()=>document.removeEventListener("mousedown",Z)},[y,h]);let S=Z=>{if(Z.stopPropagation(),r&&!o&&!s){f("log");return}if(r||o||s){x(Re=>!Re),f(null);return}n&&n(e);},J=Z=>{x(false),f(Z);},R=async(Z,Re)=>{h==="log"&&r&&Z?r(e,Z,Re):h==="estimate"&&o?o(e,Z):h==="quoted"&&s&&s(e,Z),f(null);},$=r||o||s||n,M=[{mode:"log",icon:lucideReact.Clock,label:l?"Registrar tiempo":"Log time",show:!!r},{mode:"estimate",icon:lucideReact.Target,label:l?"Estimaci\xF3n":"Estimate",show:!!o},{mode:"quoted",icon:lucideReact.DollarSign,label:l?"T. Ofertado":"Quoted time",show:!!s}].filter(Z=>Z.show),q=h==="estimate"?C:h==="quoted"?w:void 0;return C===0&&v===0&&w===0?jsxRuntime.jsxs("div",{ref:b,className:"relative flex items-center gap-2",onClick:Z=>Z.stopPropagation(),onMouseEnter:()=>g(true),onMouseLeave:()=>g(false),children:[jsxRuntime.jsx("span",{className:u("text-[11px] font-mono",t?"text-white/30":"text-gray-400"),children:"\u2014"}),p&&$&&jsxRuntime.jsx("button",{onClick:S,className:"flex items-center justify-center w-6 h-6 rounded-md transition-colors",style:{color:t?"rgba(255,255,255,0.35)":"#9CA3AF",backgroundColor:"transparent"},onMouseEnter:Z=>{Z.currentTarget.style.color=t?"rgba(255,255,255,0.8)":"#374151",Z.currentTarget.style.backgroundColor=t?"rgba(255,255,255,0.06)":"#F3F4F6";},onMouseLeave:Z=>{Z.currentTarget.style.color=t?"rgba(255,255,255,0.35)":"#9CA3AF",Z.currentTarget.style.backgroundColor="transparent";},title:l?"+ Tiempo":"+ Time",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:y&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.1},className:"absolute right-0 top-full mt-1 z-50",style:{background:t?"rgba(10,10,10,0.95)":"#FFFFFF",border:t?"1px solid rgba(255,255,255,0.10)":"1px solid #E5E7EB",borderRadius:8,boxShadow:t?"0 8px 32px rgba(0,0,0,0.6)":"0 8px 32px rgba(0,0,0,0.12)",backdropFilter:"blur(16px)",overflow:"hidden",minWidth:160},children:M.map(Z=>jsxRuntime.jsxs("button",{onClick:Re=>{Re.stopPropagation(),J(Z.mode);},className:"w-full flex items-center gap-2 px-3 py-2 text-left transition-colors",style:{fontSize:11,fontFamily:"'JetBrains Mono', monospace",color:t?"rgba(255,255,255,0.7)":"#374151",background:"transparent",border:"none",cursor:"pointer"},onMouseEnter:Re=>{Re.target.style.background=t?"rgba(255,255,255,0.06)":"#F3F4F6";},onMouseLeave:Re=>{Re.target.style.background="transparent";},children:[jsxRuntime.jsx(Z.icon,{style:{width:12,height:12,flexShrink:0,opacity:.5}}),Z.label]},Z.mode))})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:h&&jsxRuntime.jsx("div",{className:"absolute right-0 top-full mt-1 z-50",children:jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.12},children:jsxRuntime.jsx(ao,{mode:h,locale:a,isDark:t,currentValue:q||void 0,onSave:R,onClose:()=>f(null)})})})})]}):jsxRuntime.jsxs("div",{ref:b,className:"relative flex items-center gap-2 w-full",onClick:Z=>Z.stopPropagation(),onMouseEnter:()=>g(true),onMouseLeave:()=>g(false),children:[jsxRuntime.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",style:{padding:"8px 12px",borderRadius:"4px",border:t?"1px solid #333":"1px solid #E5E7EB",backgroundColor:t?"#1A1A1A":"#F9FAFB"},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"font-mono",style:{fontSize:13,fontWeight:700,color:t?"#FFFFFF":"#111827"},children:d(N)}),C>0&&jsxRuntime.jsxs("span",{className:"font-mono",style:{fontSize:11,color:t?"rgba(255,255,255,0.3)":"#9CA3AF"},children:["/ ",d(T)]}),P>0&&jsxRuntime.jsxs("span",{className:"font-mono px-1.5 py-0.5 rounded",style:{fontSize:10,color:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)"},children:["+",d(P)," Over"]})]}),C>0&&jsxRuntime.jsx("div",{className:"w-full overflow-hidden",style:{height:3,backgroundColor:t?"#333":"#E5E7EB",borderRadius:2},children:jsxRuntime.jsx("div",{style:{height:"100%",width:`${Math.min(k,100)}%`,backgroundColor:O,borderRadius:2,transition:"width 0.3s"}})})]}),$&&jsxRuntime.jsx("button",{onClick:S,className:"flex-shrink-0 flex items-center justify-center w-7 h-7 rounded-md transition-all duration-150",style:{opacity:p?1:0,pointerEvents:p?"auto":"none",color:t?"rgba(255,255,255,0.35)":"#9CA3AF",backgroundColor:"transparent",border:"none"},onMouseEnter:Z=>{Z.currentTarget.style.color=t?"rgba(255,255,255,0.8)":"#374151",Z.currentTarget.style.backgroundColor=t?"rgba(255,255,255,0.06)":"#F3F4F6";},onMouseLeave:Z=>{Z.currentTarget.style.color=t?"rgba(255,255,255,0.35)":"#9CA3AF",Z.currentTarget.style.backgroundColor="transparent";},title:l?"+ Tiempo":"+ Time",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:y&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.1},className:"absolute right-0 top-full mt-1 z-50",style:{background:t?"rgba(10,10,10,0.95)":"#FFFFFF",border:t?"1px solid rgba(255,255,255,0.10)":"1px solid #E5E7EB",borderRadius:8,boxShadow:t?"0 8px 32px rgba(0,0,0,0.6)":"0 8px 32px rgba(0,0,0,0.12)",backdropFilter:"blur(16px)",overflow:"hidden",minWidth:160},children:M.map(Z=>jsxRuntime.jsxs("button",{onClick:Re=>{Re.stopPropagation(),J(Z.mode);},className:"w-full flex items-center gap-2 px-3 py-2 text-left transition-colors",style:{fontSize:11,fontFamily:"'JetBrains Mono', monospace",color:t?"rgba(255,255,255,0.7)":"#374151",background:"transparent",border:"none",cursor:"pointer"},onMouseEnter:Re=>{Re.target.style.background=t?"rgba(255,255,255,0.06)":"#F3F4F6";},onMouseLeave:Re=>{Re.target.style.background="transparent";},children:[jsxRuntime.jsx(Z.icon,{style:{width:12,height:12,flexShrink:0,opacity:.5}}),Z.label]},Z.mode))})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:h&&jsxRuntime.jsx("div",{className:"absolute right-0 top-full mt-1 z-50",children:jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.12},children:jsxRuntime.jsx(ao,{mode:h,locale:a,isDark:t,currentValue:q||void 0,onSave:R,onClose:()=>f(null)})})})})]})}function J2(e){let t=new Map;function a(r){if(r.assignees)for(let o of r.assignees)o.name&&!t.has(o.name)&&t.set(o.name,o);if(r.subtasks)for(let o of r.subtasks)a(o);}return a(e),Array.from(t.values())}function Q2(e){return e>100?{bg:"rgba(239,68,68,0.15)",text:"#EF4444"}:e>=86?{bg:"rgba(245,158,11,0.15)",text:"#F59E0B"}:e>=61?{bg:"rgba(0,229,204,0.15)",text:"#00E5CC"}:{bg:"rgba(34,197,94,0.15)",text:"#22C55E"}}function gg({assignee:e,size:t=28,isDark:a}){let r=t===28?"w-7 h-7":t===24?"w-6 h-6":"w-5 h-5",o=t===28?"text-[10px]":"text-[9px]";return e.avatar?jsxRuntime.jsx("img",{src:e.avatar,alt:e.name,className:u(r,"rounded-full object-cover ring-1 flex-shrink-0",a?"ring-white/10":"ring-gray-200")}):jsxRuntime.jsx("div",{className:u(r,"rounded-full flex items-center justify-center font-bold text-white ring-1 flex-shrink-0",o,a?"ring-white/10":"ring-gray-200"),style:{backgroundColor:e.color||"#6B7280"},children:e.initials||e.name?.charAt(0)?.toUpperCase()||"?"})}function fg({task:e,isDark:t,locale:a="en"}){let r=a==="es",o=!!e.hasChildren,s=e.assignees?.[0],n=e.teamLoad;if(o){let m=J2(e);if(m.length===0)return null;let d=m.slice(0,3),p=m.length-3;return jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("div",{className:"flex -space-x-2",children:d.map((g,y)=>jsxRuntime.jsx(gg,{assignee:g,size:24,isDark:t},g.name+y))}),p>0&&jsxRuntime.jsxs("span",{className:u("ml-1 text-[10px] font-mono",t?"text-white/40":"text-gray-400"),title:m.slice(3).map(g=>g.name).join(", "),children:["+",p]})]})}if(!s)return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:u("w-7 h-7 rounded-full flex items-center justify-center flex-shrink-0",t?"bg-white/5":"bg-gray-100"),children:jsxRuntime.jsx(lucideReact.User,{className:"w-3.5 h-3.5",style:{color:"#4B5563"}})}),jsxRuntime.jsx("span",{className:u("text-[11px]",t?"text-white/30":"text-gray-400"),children:r?"Sin asignar":"Unassigned"})]});let i=n?.percentage??0,c=!!n&&i>0,l=c?Q2(i):null;return jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(gg,{assignee:s,size:28,isDark:t}),jsxRuntime.jsx("span",{className:u("text-[13px] truncate",t?"text-white":"text-gray-900"),style:{maxWidth:"100px"},children:s.name})]}),c&&l&&jsxRuntime.jsxs("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono uppercase tracking-wide w-fit font-semibold",style:{backgroundColor:l.bg,color:l.text},children:[i,"% LOAD"]})]})}var Z2={critical:"bg-[#FF2D20]/15 text-[#FF2D20]",warning:"bg-[#FFD60A]/15 text-[#FFD60A]",info:"bg-[#3B9EFF]/15 text-[#3B9EFF]"};function hg({blockers:e,isDark:t,locale:a="en"}){return !e||e.length===0?jsxRuntime.jsx("span",{className:u("text-[9px] font-mono uppercase tracking-wide",t?"text-white/20":"text-gray-400"),children:a==="es"?"Ninguno":"None"}):jsxRuntime.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:e.map((r,o)=>jsxRuntime.jsxs("span",{className:u("px-1.5 py-0.5 rounded text-[9px] font-mono uppercase tracking-wide whitespace-nowrap",Z2[r.severity]),children:[r.type," #",r.id]},`${r.type}-${r.id}-${o}`))})}function g1(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function f1(e){let t=["blue","green","purple","pink","yellow","red","indigo","teal"],a=0;for(let r=0;r<e.length;r++)a=e.charCodeAt(r)+((a<<5)-a);return t[Math.abs(a)%t.length]??"blue"}function Cg({state:e,onClose:t,isDark:a,locale:r,onTaskEdit:o,onTaskDuplicate:s,onTaskDelete:n,onTaskUpdate:i,onColumnHide:c,onColumnSort:l,availableUsers:m=[],onOpenTimeLog:d,onReportBlocker:p,onCopyTaskLink:g,onTaskMove:y,onTaskIndent:x,onTaskOutdent:h}){let f=react.useRef(null),b=r==="es"?vg.es:vg.en;if(react.useEffect(()=>{let T=P=>{f.current&&!f.current.contains(P.target)&&t();},k=P=>{P.key==="Escape"&&t();};return document.addEventListener("mousedown",T),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",k);}},[t]),!e.isOpen)return null;let v=()=>{if(!e.task)return [];let T=[];return o&&T.push({id:"edit",label:b.edit,icon:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),onClick:()=>{o(e.task),t();}}),T.push({id:"sep1",label:"",icon:null,separator:true}),i&&(T.push({id:"status",label:b.changeStatus,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),submenu:[{id:"status-todo",label:b.todo,icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4 text-gray-400"}),onClick:()=>{i({...e.task,status:"todo",progress:0}),t();}},{id:"status-in-progress",label:b.inProgress,icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4 text-blue-500"}),onClick:()=>{i({...e.task,status:"in-progress",progress:e.task.progress||50}),t();}},{id:"status-completed",label:b.completed,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4 text-green-500"}),onClick:()=>{i({...e.task,status:"completed",progress:100}),t();}}]}),T.push({id:"priority",label:b.changePriority,icon:jsxRuntime.jsx(lucideReact.Flag,{className:"w-4 h-4"}),submenu:[{id:"priority-urgent",label:b.urgent,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),onClick:()=>{i({...e.task,priority:"urgent"}),t();}},{id:"priority-high",label:b.high,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-orange-500"}),onClick:()=>{i({...e.task,priority:"high"}),t();}},{id:"priority-medium",label:b.medium,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),onClick:()=>{i({...e.task,priority:"medium"}),t();}},{id:"priority-low",label:b.low,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-500"}),onClick:()=>{i({...e.task,priority:"low"}),t();}}]}),m.length>0&&T.push({id:"assign",label:b.assignUser,icon:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),submenu:m.slice(0,5).map(k=>({id:`assign-${k.id}`,label:k.name,icon:jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[10px] text-white bg-blue-500",children:k.name.charAt(0).toUpperCase()}),onClick:()=>{let P=e.task.assignees||[],S=P.some(J=>J.name===k.name)?P.filter(J=>J.name!==k.name):[...P,{name:k.name,initials:g1(k.name),color:k.color||f1(k.name),avatar:k.avatarUrl}];i({...e.task,assignees:S}),t();}}))})),d&&T.push({id:"log-time",label:b.logTime,icon:jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),onClick:()=>{d(e.task),t();}}),p&&T.push({id:"report-blocker",label:b.reportBlocker,icon:jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-4 h-4"}),onClick:()=>{p(e.task),t();}}),g&&T.push({id:"copy-link",label:b.copyLink,icon:jsxRuntime.jsx(lucideReact.Link2,{className:"w-4 h-4"}),onClick:()=>{g(e.task),t();}}),T.push({id:"sep2",label:"",icon:null,separator:true}),s&&T.push({id:"duplicate",label:b.duplicate,icon:jsxRuntime.jsx(lucideReact.Copy,{className:"w-4 h-4"}),onClick:()=>{s(e.task),t();}}),(y||x||h)&&(T.push({id:"sep3",label:"",icon:null,separator:true}),y&&(T.push({id:"move-up",label:b.moveUp,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),onClick:()=>{y(e.task.id,"up"),t();}}),T.push({id:"move-down",label:b.moveDown,icon:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),onClick:()=>{y(e.task.id,"down"),t();}})),x&&T.push({id:"indent",label:b.indent,icon:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"}),onClick:()=>{x(e.task.id),t();}}),h&&T.push({id:"outdent",label:b.outdent,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4 -rotate-90"}),onClick:()=>{h(e.task.id),t();}})),n&&T.push({id:"delete",label:b.delete,icon:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),danger:true,onClick:()=>{n(e.task.id),t();}}),T},C=()=>{if(!e.columnId)return [];let T=[];return l&&(T.push({id:"sort-asc",label:b.sortAsc,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),onClick:()=>{l(e.columnId,"asc"),t();}}),T.push({id:"sort-desc",label:b.sortDesc,icon:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),onClick:()=>{l(e.columnId,"desc"),t();}})),c&&e.columnId!=="name"&&(T.push({id:"sep-hide",label:"",icon:null,separator:true}),T.push({id:"hide",label:b.hideColumn,icon:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),onClick:()=>{c(e.columnId),t();}})),T},w=e.type==="task"?v():C(),N={position:"fixed",left:e.x,top:e.y,zIndex:9999};return jsxRuntime.jsx("div",{ref:f,style:N,className:u("py-1 rounded-lg shadow-xl border min-w-[180px]",a?"bg-[#0D0D0D] border-[#222]":"bg-white border-gray-200"),children:w.map(T=>T.separator?jsxRuntime.jsx("div",{className:u("my-1 h-px",a?"bg-white/[0.05]":"bg-gray-200")},T.id):T.submenu?jsxRuntime.jsx(b1,{item:T,isDark:a},T.id):jsxRuntime.jsxs("button",{onClick:T.onClick,className:u("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100",T.danger?"text-red-500 hover:text-red-600":a?"text-white":"text-gray-700"),children:[jsxRuntime.jsx("span",{className:u(T.danger?"text-red-500":a?"text-white/60":"text-gray-400"),children:T.icon}),T.label]},T.id))})}function b1({item:e,isDark:t}){let[a,r]=react.useState(false),o=react.useRef();return jsxRuntime.jsxs("div",{className:"relative",onMouseEnter:()=>{o.current&&clearTimeout(o.current),r(true);},onMouseLeave:()=>{o.current=setTimeout(()=>r(false),150);},children:[jsxRuntime.jsxs("button",{className:u("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/[0.05] text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-white/60":"text-gray-400",children:e.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:e.label}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:u("w-4 h-4",t?"text-white/30":"text-gray-400")})]}),a&&e.submenu&&jsxRuntime.jsx("div",{className:u("absolute left-full top-0 ml-1 py-1 rounded-lg shadow-xl border min-w-[160px]",t?"bg-[#0D0D0D] border-[#222]":"bg-white border-gray-200"),children:e.submenu.map(i=>jsxRuntime.jsxs("button",{onClick:i.onClick,className:u("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/[0.05] text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-white/60":"text-gray-400",children:i.icon}),i.label]},i.id))})]})}var vg={en:{edit:"Edit",changeStatus:"Change status",changePriority:"Change priority",assignUser:"Assign user",duplicate:"Duplicate",moveUp:"Move up",moveDown:"Move down",indent:"Make subtask",outdent:"Remove from parent",delete:"Delete",todo:"To Do",inProgress:"In Progress",completed:"Completed",urgent:"Urgent",high:"High",medium:"Medium",low:"Low",sortAsc:"Sort A \u2192 Z",sortDesc:"Sort Z \u2192 A",hideColumn:"Hide column",logTime:"Log Time",reportBlocker:"Report Blocker",copyLink:"Copy Link"},es:{edit:"Editar",changeStatus:"Cambiar estado",changePriority:"Cambiar prioridad",assignUser:"Asignar usuario",duplicate:"Duplicar",moveUp:"Mover arriba",moveDown:"Mover abajo",indent:"Convertir en subtarea",outdent:"Sacar de subtarea",delete:"Eliminar",todo:"Pendiente",inProgress:"En Progreso",completed:"Completado",urgent:"Urgente",high:"Alta",medium:"Media",low:"Baja",sortAsc:"Ordenar A \u2192 Z",sortDesc:"Ordenar Z \u2192 A",hideColumn:"Ocultar columna",logTime:"Registrar Tiempo",reportBlocker:"Reportar Bloqueante",copyLink:"Copiar Enlace"}};var Ag={name:jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),status:jsxRuntime.jsx(lucideReact.CircleDot,{className:"w-4 h-4"}),priority:jsxRuntime.jsx(lucideReact.Flag,{className:"w-4 h-4"}),assignees:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),startDate:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),endDate:jsxRuntime.jsx(lucideReact.CalendarCheck,{className:"w-4 h-4"}),progress:jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"}),tags:jsxRuntime.jsx(lucideReact.Tag,{className:"w-4 h-4"}),estimatedTime:jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),quotedTime:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),elapsedTime:jsxRuntime.jsx(lucideReact.Timer,{className:"w-4 h-4"}),effortMinutes:jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),timeLoggedMinutes:jsxRuntime.jsx(lucideReact.Timer,{className:"w-4 h-4"}),soldEffortMinutes:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),scheduleVariance:jsxRuntime.jsx(lucideReact.CalendarClock,{className:"w-4 h-4"}),hoursBar:jsxRuntime.jsx(lucideReact.BarChart3,{className:"w-4 h-4"}),teamLoad:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),blockers:jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-4 h-4"}),weight:jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"}),text:jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),number:jsxRuntime.jsx(lucideReact.Hash,{className:"w-4 h-4"}),date:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),dropdown:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4"}),checkbox:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-4 h-4"})},L1=["name","status","priority","startDate","endDate","progress","tags","effortMinutes","timeLoggedMinutes","soldEffortMinutes","weight"];function Ig({isOpen:e,onClose:t,columns:a,customFields:r=[],onColumnsChange:o,onCreateCustomField:s,isDark:n,locale:i}){let[c,l]=react.useState(""),[m,d]=react.useState(null),p=react.useRef(null),g=i==="es"?Lg.es:Lg.en;react.useLayoutEffect(()=>{if(!e||!p.current)return;let w=()=>{if(!p.current)return;let N=p.current.getBoundingClientRect(),k=window.innerHeight-N.top-20;d(Math.max(300,k));};return requestAnimationFrame(w),window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[e]),react.useEffect(()=>{if(!e)return;let w=setTimeout(()=>{let N=k=>{p.current&&!p.current.contains(k.target)&&t();},T=k=>{k.key==="Escape"&&t();};document.addEventListener("mousedown",N),document.addEventListener("keydown",T),p._cleanup=()=>{document.removeEventListener("mousedown",N),document.removeEventListener("keydown",T);};},100);return ()=>{clearTimeout(w),p._cleanup&&p._cleanup();}},[e,t]);let y=react.useMemo(()=>{let w=new Set([...L1]);return a.forEach(N=>{N.type&&N.type!=="assignees"&&w.add(N.type);}),Array.from(w)},[a]);if(!e)return null;let x=w=>{let N=g.columns[w];if(N)return N;let T=a.find(k=>k.type===w);return T?.label?T.label:w},h=w=>{if(w==="name")return;let N=a.map(T=>T.id===w?{...T,visible:!T.visible}:T);o(N);},f=(w,N)=>{let T=a.find(P=>P.type===w&&(!N||P.customFieldId===N));if(T){h(T.id);return}let k={id:N||w,type:w,label:N?r.find(P=>P.id===N)?.name||w:x(w),width:120,visible:true,sortable:true,resizable:true,customFieldId:N};o([...a,k]);},b=y.filter(w=>w!=="assignees"&&x(w).toLowerCase().includes(c.toLowerCase())),v=r.filter(w=>w.name.toLowerCase().includes(c.toLowerCase())),C=n?"#00E5FF":"#2E94FF";return jsxRuntime.jsxs("div",{ref:p,style:{...m?{maxHeight:`${m}px`}:{},background:n?"#111114":"#FFFFFF",border:`1px solid ${n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.08)"}`,boxShadow:n?"0 8px 32px rgba(0,0,0,0.7)":"0 8px 32px rgba(0,0,0,0.12)"},className:"absolute right-0 top-full mt-1 w-64 rounded-xl z-50 flex flex-col",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2.5",style:{borderBottom:`1px solid ${n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`},children:[jsxRuntime.jsx("span",{style:{fontSize:10,fontWeight:600,letterSpacing:"0.08em",color:n?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)",fontFamily:"JetBrains Mono, monospace"},children:g.title.toUpperCase()}),jsxRuntime.jsx("button",{onClick:t,className:"w-6 h-6 rounded-md flex items-center justify-center transition-colors",style:{color:n?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"},onMouseEnter:w=>{w.currentTarget.style.backgroundColor=n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",w.currentTarget.style.color=n?"rgba(255,255,255,0.7)":"rgba(0,0,0,0.6)";},onMouseLeave:w=>{w.currentTarget.style.backgroundColor="transparent",w.currentTarget.style.color=n?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)";},children:jsxRuntime.jsx(lucideReact.X,{className:"w-3.5 h-3.5"})})]}),jsxRuntime.jsx("div",{className:"px-3 py-2",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5",style:{color:n?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.25)"}}),jsxRuntime.jsx("input",{type:"text",value:c,onChange:w=>l(w.target.value),placeholder:g.searchPlaceholder,style:{fontSize:12,background:n?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.03)",border:`1px solid ${n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`,color:n?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.8)"},className:"w-full pl-8 pr-3 py-1.5 rounded-lg outline-none placeholder:opacity-40 transition-colors focus:border-[var(--focus-border)]",ref:w=>{w&&w.style.setProperty("--focus-border",C);},onFocus:w=>{w.currentTarget.style.borderColor=C,w.currentTarget.style.background=n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)";},onBlur:w=>{w.currentTarget.style.borderColor=n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)",w.currentTarget.style.background=n?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.03)";}})]})}),jsxRuntime.jsxs("div",{className:"overflow-y-auto flex-1 min-h-0 overscroll-contain px-2 pb-2",onWheel:w=>w.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"mb-1",children:[jsxRuntime.jsx("div",{className:"px-1.5 py-1.5",style:{fontSize:9,fontWeight:600,letterSpacing:"0.1em",color:n?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.3)",fontFamily:"JetBrains Mono, monospace"},children:g.standardFields.toUpperCase()}),jsxRuntime.jsx("div",{className:"space-y-px",children:b.map(w=>{let N=a.find(P=>P.type===w&&!P.customFieldId),T=N?.visible??false,k=w==="name";return jsxRuntime.jsxs("button",{onClick:()=>{k||(N?h(N.id):f(w));},disabled:k,className:"w-full flex items-center gap-2.5 px-2 py-[5px] rounded-md transition-colors",style:{opacity:k?.4:1,cursor:k?"not-allowed":"pointer"},onMouseEnter:P=>{k||(P.currentTarget.style.backgroundColor=n?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.04)");},onMouseLeave:P=>{P.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded flex items-center justify-center flex-shrink-0 transition-all",style:{background:T?C:"transparent",border:T?`1.5px solid ${C}`:`1.5px solid ${n?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.15)"}`,boxShadow:T?`0 0 6px ${C}40`:"none"},children:T&&jsxRuntime.jsx(lucideReact.Check,{className:"w-2.5 h-2.5 text-white",strokeWidth:3})}),jsxRuntime.jsx("span",{className:"flex-shrink-0 [&>svg]:w-3.5 [&>svg]:h-3.5",style:{color:T?C:n?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"},children:Ag[w]}),jsxRuntime.jsx("span",{style:{fontSize:12,fontWeight:T?500:400,color:T?n?"rgba(255,255,255,0.9)":"rgba(0,0,0,0.85)":n?"rgba(255,255,255,0.55)":"rgba(0,0,0,0.5)"},children:x(w)})]},w)})})]}),v.length>0&&jsxRuntime.jsxs("div",{className:"mt-1",children:[jsxRuntime.jsx("div",{className:"px-1.5 py-1.5",style:{fontSize:9,fontWeight:600,letterSpacing:"0.1em",color:n?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.3)",fontFamily:"JetBrains Mono, monospace",borderTop:`1px solid ${n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`,paddingTop:8,marginTop:4},children:g.customFields.toUpperCase()}),jsxRuntime.jsx("div",{className:"space-y-px",children:v.map(w=>{let T=a.find(k=>k.customFieldId===w.id)?.visible??false;return jsxRuntime.jsxs("button",{onClick:()=>f(w.type,w.id),className:"w-full flex items-center gap-2.5 px-2 py-[5px] rounded-md transition-colors",onMouseEnter:k=>{k.currentTarget.style.backgroundColor=n?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.04)";},onMouseLeave:k=>{k.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded flex items-center justify-center flex-shrink-0 transition-all",style:{background:T?C:"transparent",border:T?`1.5px solid ${C}`:`1.5px solid ${n?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.15)"}`,boxShadow:T?`0 0 6px ${C}40`:"none"},children:T&&jsxRuntime.jsx(lucideReact.Check,{className:"w-2.5 h-2.5 text-white",strokeWidth:3})}),jsxRuntime.jsx("span",{className:"flex-shrink-0 [&>svg]:w-3.5 [&>svg]:h-3.5",style:{color:T?C:n?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"},children:Ag[w.type]||jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"})}),jsxRuntime.jsx("span",{style:{fontSize:12,fontWeight:T?500:400,color:T?n?"rgba(255,255,255,0.9)":"rgba(0,0,0,0.85)":n?"rgba(255,255,255,0.55)":"rgba(0,0,0,0.5)"},children:w.name})]},w.id)})})]})]})]})}var Lg={en:{title:"Columns",searchPlaceholder:"Search fields...",standardFields:"Standard Fields",customFields:"Custom Fields",columns:{name:"Name",status:"Status",priority:"Priority",startDate:"Start Date",endDate:"End Date",progress:"Progress",tags:"Tags",estimatedTime:"Estimated",quotedTime:"Quoted",elapsedTime:"Time Spent",soldEffortMinutes:"Quoted",effortMinutes:"Estimated",timeLoggedMinutes:"Executed",text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox",weight:"Weight"}},es:{title:"Columnas",searchPlaceholder:"Buscar campos...",standardFields:"Campos Est\xE1ndar",customFields:"Campos Personalizados",columns:{name:"Nombre",status:"Estado",priority:"Prioridad",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",tags:"Etiquetas",estimatedTime:"Estimado",quotedTime:"Ofertado",elapsedTime:"Ejecutado",soldEffortMinutes:"Ofertado",effortMinutes:"Estimado",timeLoggedMinutes:"Ejecutado",text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla",weight:"Peso"}}};var W1=[{type:"text",icon:jsxRuntime.jsx(lucideReact.Type,{className:"w-5 h-5"})},{type:"number",icon:jsxRuntime.jsx(lucideReact.Hash,{className:"w-5 h-5"})},{type:"date",icon:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-5 h-5"})},{type:"dropdown",icon:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-5 h-5"})},{type:"checkbox",icon:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-5 h-5"})}];function Og({isOpen:e,onClose:t,onSave:a,isDark:r,locale:o}){let[s,n]=react.useState(""),[i,c]=react.useState("text"),[l,m]=react.useState([""]),d=o==="es"?Rg.es:Rg.en;react.useEffect(()=>{e&&(n(""),c("text"),m([""]));},[e]),react.useEffect(()=>{let h=f=>{f.key==="Escape"&&t();};return e&&document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,t]);let p=()=>{if(!s.trim())return;let h={name:s.trim(),type:i};i==="dropdown"&&(h.options=l.filter(f=>f.trim())),a(h),t();},g=()=>{m([...l,""]);},y=(h,f)=>{let b=[...l];b[h]=f,m(b);},x=h=>{l.length>1&&m(l.filter((f,b)=>b!==h));};return e?jsxRuntime.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),jsxRuntime.jsxs("div",{className:u("relative w-full max-w-md rounded-xl shadow-2xl border",r?"bg-[#0D0D0D] border-[#222]":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:u("flex items-center justify-between px-6 py-4 border-b",r?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h2",{className:u("text-lg font-semibold",r?"text-white":"text-gray-900"),children:d.title}),jsxRuntime.jsx("button",{onClick:t,className:u("p-1 rounded",r?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.X,{className:u("w-5 h-5",r?"text-white/60":"text-gray-400")})})]}),jsxRuntime.jsxs("div",{className:"p-6 space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:u("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:d.fieldName}),jsxRuntime.jsx("input",{type:"text",value:s,onChange:h=>n(h.target.value),placeholder:d.fieldNamePlaceholder,className:u("w-full px-4 py-2.5 rounded-lg border outline-none focus:ring-2 focus:ring-[#007BFF]/30",r?"bg-white/[0.03] border-[#222] text-white placeholder:text-white/30":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400"),autoFocus:true})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:u("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:d.fieldType}),jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-2",children:W1.map(h=>jsxRuntime.jsxs("button",{onClick:()=>c(h.type),className:u("flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors",i===h.type?"border-[#007BFF] bg-[#007BFF]/10":r?"border-[#222] hover:border-white/20":"border-gray-200 hover:border-gray-300"),children:[jsxRuntime.jsx("span",{className:i===h.type?"text-[#007BFF]":r?"text-white/60":"text-gray-400",children:h.icon}),jsxRuntime.jsx("span",{className:u("text-xs",i===h.type?"text-[#007BFF]":r?"text-white/60":"text-gray-500"),children:d.types[h.type]})]},h.type))})]}),i==="dropdown"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:u("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:d.options}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[l.map((h,f)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"text",value:h,onChange:b=>y(f,b.target.value),placeholder:`${d.option} ${f+1}`,className:u("flex-1 px-3 py-2 rounded-lg border outline-none focus:ring-2 focus:ring-[#007BFF]/30",r?"bg-white/[0.03] border-[#222] text-white placeholder:text-white/30":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400")}),l.length>1&&jsxRuntime.jsx("button",{onClick:()=>x(f),className:u("p-2 rounded-lg transition-colors",r?"hover:bg-white/[0.05] text-white/60":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},f)),jsxRuntime.jsxs("button",{onClick:g,className:u("flex items-center gap-2 px-3 py-2 text-sm rounded-lg transition-colors",r?"text-[#007BFF] hover:bg-white/[0.05]":"text-blue-600 hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),d.addOption]})]})]})]}),jsxRuntime.jsxs("div",{className:u("flex items-center justify-end gap-3 px-6 py-4 border-t",r?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("button",{onClick:t,className:u("px-4 py-2 text-sm font-medium rounded-lg transition-colors",r?"text-white/60 hover:bg-white/[0.05]":"text-gray-600 hover:bg-gray-100"),children:d.cancel}),jsxRuntime.jsx("button",{onClick:p,disabled:!s.trim(),className:u("px-4 py-2 text-sm font-medium rounded-lg transition-colors","bg-[#007BFF] text-white hover:bg-[#005FCC]",!s.trim()&&"opacity-50 cursor-not-allowed"),children:d.create})]})]})]}):null}var Rg={en:{title:"Create Custom Field",fieldName:"Field Name",fieldNamePlaceholder:"Enter field name...",fieldType:"Field Type",options:"Options",option:"Option",addOption:"Add option",cancel:"Cancel",create:"Create Field",types:{text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox"}},es:{title:"Crear Campo Personalizado",fieldName:"Nombre del Campo",fieldNamePlaceholder:"Ingresa el nombre...",fieldType:"Tipo de Campo",options:"Opciones",option:"Opci\xF3n",addOption:"Agregar opci\xF3n",cancel:"Cancelar",create:"Crear Campo",types:{text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla"}}};var zg={en:{filters:"Filters",filterByStatus:"FILTER BY STATUS",showAll:"Show All",completed:"Completed",inProgress:"In Progress",toDo:"To Do / Pending",hideCompleted:"Hide Completed Tasks"},es:{filters:"Filtros",filterByStatus:"FILTRAR POR ESTADO",showAll:"Mostrar Todo",completed:"Completadas",inProgress:"En Progreso",toDo:"Por Hacer / Pendiente",hideCompleted:"Ocultar Tareas Completadas"}};function Ug({value:e,hideCompleted:t,onChange:a,onHideCompletedChange:r,isDark:o,locale:s}){let[n,i]=react.useState(false),c=react.useRef(null),l=react.useRef(0),m=s==="es"?zg.es:zg.en;react.useEffect(()=>{if(!n)return;let g=x=>{Date.now()-l.current<100||c.current&&!c.current.contains(x.target)&&i(false);},y=x=>{x.key==="Escape"&&i(false);};return document.addEventListener("mousedown",g),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",y);}},[n]);let d=[{value:"all",label:m.showAll,icon:jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-[#007BFF] bg-[#007BFF]"}),color:"text-[#007BFF]"},{value:"completed",label:m.completed,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),color:"text-green-500"},{value:"in-progress",label:m.inProgress,icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4"}),color:"text-blue-500"},{value:"todo",label:m.toDo,icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4"}),color:"text-gray-400"}],p=e!=="all"||t;return jsxRuntime.jsxs("div",{ref:c,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:g=>{g.stopPropagation(),n||(l.current=Date.now()),i(y=>!y);},className:u("flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] font-medium transition-all border",o?"border-[#222] hover:bg-white/[0.05] text-white/70":"border-gray-200 hover:bg-gray-100 text-gray-700",p&&(o?"bg-[#2E94FF]/20 border-[#2E94FF]/50 text-[#2E94FF]":"bg-blue-50 border-blue-200 text-blue-600"),n&&(o?"bg-white/[0.05]":"bg-gray-100")),style:{fontFamily:"Inter, sans-serif"},children:[jsxRuntime.jsx(lucideReact.Filter,{className:"w-4 h-4"}),m.filters,p&&jsxRuntime.jsx("span",{className:u("w-2 h-2 rounded-full",o?"bg-[#2E94FF]":"bg-blue-500")})]}),n&&jsxRuntime.jsxs("div",{className:u("absolute left-0 top-full mt-2 w-72 rounded-lg shadow-xl border z-50",o?"bg-[#0D0D0D] border-[#222]":"bg-white border-gray-200"),children:[jsxRuntime.jsx("div",{className:u("px-4 py-3 border-b",o?"border-[#222]":"border-gray-200"),children:jsxRuntime.jsx("span",{className:u("text-xs font-medium uppercase tracking-wider",o?"text-white/30":"text-gray-400"),children:m.filterByStatus})}),jsxRuntime.jsx("div",{className:"py-2",children:d.map(g=>{let y=e===g.value&&!t,x=()=>g.value==="all"?y?jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-[#007BFF] bg-[#007BFF]"}):jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-400"}):g.icon;return jsxRuntime.jsxs("button",{onClick:()=>{a(g.value),r(false),i(false);},className:u("w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",o?"hover:bg-white/[0.05]":"hover:bg-gray-100",y&&(o?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:u(y?g.color:"text-gray-400","flex-shrink-0"),children:x()}),jsxRuntime.jsx("span",{className:u("flex-1 text-left whitespace-nowrap",o?"text-white":"text-gray-900"),children:g.label}),y&&jsxRuntime.jsx(lucideReact.Check,{className:u("w-4 h-4 flex-shrink-0",o?"text-[#007BFF]":"text-blue-500")})]},g.value)})}),jsxRuntime.jsx("div",{className:u("my-2 mx-4 h-px",o?"bg-white/[0.05]":"bg-gray-200")}),jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs("button",{onClick:()=>{let g=!t;r(g),g&&a("all"),i(false);},className:u("w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",o?"hover:bg-white/[0.05]":"hover:bg-gray-100",t&&(o?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:u("w-4 h-4 flex-shrink-0",t?o?"text-[#007BFF]":"text-blue-500":o?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("flex-1 text-left whitespace-nowrap",o?"text-white":"text-gray-900"),children:m.hideCompleted}),t&&jsxRuntime.jsx(lucideReact.Check,{className:u("w-4 h-4 flex-shrink-0",o?"text-[#007BFF]":"text-blue-500")})]})})]})]})}function Wg(e){if(e<=0)return "0h";let t=Math.floor(e/60),a=e%60;return a>0?`${t}h ${a}m`:`${t}h`}function ws(e){return e>=1e6?`$${(e/1e6).toFixed(1)}M`:e>=1e3?`$${(e/1e3).toFixed(1)}K`:`$${Math.round(e).toLocaleString("en-US")}`}function Gg({data:e,isDark:t,locale:a="en",onClose:r,lens:o="hours"}){let s=a==="es",n=o==="financial";return jsxRuntime.jsxs("div",{className:u("w-[220px] xl:w-[280px] flex-shrink-0 overflow-y-auto border-l",t?"bg-[#141414] border-[#222]":"bg-gray-50 border-gray-200"),children:[jsxRuntime.jsxs("div",{className:u("px-5 py-4 border-b flex items-center justify-between",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:u("text-[10px] font-mono uppercase tracking-wider font-bold",t?"text-white/40":"text-gray-500"),children:n?s?"SALUD FINANCIERA":"FINANCIAL HEALTH":s?"SALUD DEL PROYECTO":"PROJECT HEALTH"}),r&&jsxRuntime.jsx("button",{onClick:r,className:u("p-1 rounded transition-colors",t?"text-white/30 hover:text-white/60 hover:bg-white/[0.05]":"text-gray-400 hover:text-gray-600 hover:bg-gray-200"),title:s?"Cerrar panel":"Close panel",children:jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 1l10 10M11 1L1 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),n&&(e.totalOffered!==void 0||e.totalEstimated!==void 0)&&(()=>{let i=e.totalOffered??0,c=e.totalEstimated??0,l=e.totalExecuted??0,m=i-c,d=i>0?Math.round(m/i*100):0,p=i>0?Math.min(Math.round(c/i*100),120):0,g=c>i&&i>0,y=g?"#FF2D20":"#00E5CC";return jsxRuntime.jsxs("div",{className:u("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:u("text-[10px] font-mono uppercase tracking-wider mb-3",t?"text-white/40":"text-gray-500"),children:s?"PRESUPUESTO":"BUDGET"}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:s?"Ofertado":"Offered"}),jsxRuntime.jsx("span",{className:u("text-[11px] font-mono font-bold",t?"text-white/80":"text-gray-800"),children:ws(i)})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:s?"Estimado":"Estimated"}),jsxRuntime.jsx("span",{className:u("text-[11px] font-mono font-bold",g?"text-[#FF2D20]":t?"text-white/80":"text-gray-800"),children:ws(c)})]}),l>0&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:s?"Ejecutado":"Executed"}),jsxRuntime.jsx("span",{className:u("text-[11px] font-mono",t?"text-white/60":"text-gray-600"),children:ws(l)})]}),i>0&&jsxRuntime.jsx("div",{className:u("w-full h-2.5 rounded-full overflow-hidden mt-2",t?"bg-white/[0.06]":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(p,100)}%`,backgroundColor:y}})}),jsxRuntime.jsxs("div",{className:u("mt-2 px-3 py-2 rounded-lg text-center font-mono text-sm font-bold",m>=0?t?"bg-[#00E5CC]/10 text-[#00E5CC]":"bg-emerald-50 text-emerald-600":t?"bg-[#FF2D20]/10 text-[#FF2D20]":"bg-red-50 text-red-600"),children:[m>=0?`+${ws(m)} ${s?"Disp.":"Avail."}`:`${ws(Math.abs(m))} ${s?"P\xE9rdida":"Loss"}`,i>0&&jsxRuntime.jsxs("span",{className:"text-[10px] ml-1 opacity-60",children:["(",d,"%)"]})]})]})]})})(),(e.totalHoursSpentMinutes!==void 0||e.totalHoursAllocatedMinutes!==void 0)&&(()=>{let i=e.totalHoursSpentMinutes??0,c=e.totalHoursAllocatedMinutes??0,l=c>0?Math.min(Math.round(i/c*100),100):0,m=i>c&&c>0,d=m?"#FF2D20":l>=80?"#FFD60A":"#3BF06E";return jsxRuntime.jsxs("div",{className:u("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:u("text-[10px] font-mono uppercase tracking-wider mb-3",t?"text-white/40":"text-gray-500"),children:s?"HORAS DEL PROYECTO":"PROJECT HOURS"}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:s?"Usado":"Spent"}),jsxRuntime.jsx("span",{className:u("text-[11px] font-mono font-bold",m?"text-[#FF2D20]":t?"text-white/80":"text-gray-800"),children:Wg(i)})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:s?"Asignado":"Allocated"}),jsxRuntime.jsx("span",{className:u("text-[11px] font-mono",t?"text-white/60":"text-gray-600"),children:Wg(c)})]}),c>0&&jsxRuntime.jsx("div",{className:u("w-full h-1.5 rounded-full overflow-hidden mt-1",t?"bg-white/[0.06]":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${l}%`,backgroundColor:d}})})]})]})})(),(e.openRFIs!==void 0||e.submittalsApprovalPercent!==void 0)&&jsxRuntime.jsxs("div",{className:u("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:u("text-[10px] font-mono uppercase tracking-wider mb-3",t?"text-white/40":"text-gray-500"),children:s?"SALUD T\xC9CNICA":"TECHNICAL HEALTH"}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[e.openRFIs!==void 0&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:s?"RFIs Abiertos":"Open RFIs"}),jsxRuntime.jsx("span",{className:u("px-2 py-0.5 rounded text-[11px] font-mono font-bold",e.openRFIs>0?"bg-[#FF2D20]/15 text-[#FF2D20]":"bg-[#3BF06E]/15 text-[#3BF06E]"),children:e.openRFIs})]}),e.submittalsApprovalPercent!==void 0&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:s?"Aprobaci\xF3n Submittals":"Submittals Approval"}),jsxRuntime.jsxs("span",{className:u("text-[11px] font-mono font-bold",e.submittalsApprovalPercent>=80?"text-[#3BF06E]":"text-[#FFD60A]"),children:[e.submittalsApprovalPercent,"%"]})]})]})]}),e.scheduleVarianceDays!==void 0&&jsxRuntime.jsxs("div",{className:u("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:u("text-[10px] font-mono uppercase tracking-wider mb-3",t?"text-white/40":"text-gray-500"),children:s?"VARIACI\xD3N DE CRONOGRAMA":"SCHEDULE VARIANCE"}),(()=>{let i=e.scheduleVarianceDays??0,c=i>0,l=i<0,m=e.scheduleVarianceLabel||(c?`+${i} ${s?"D\xEDas ADELANTE":"Days AHEAD"}`:l?`${i} ${s?"D\xEDas ATR\xC1S":"Days BEHIND"}`:s?"EN TIEMPO":"ON TRACK");return jsxRuntime.jsx("div",{className:u("px-3 py-2 rounded-lg text-center font-mono text-sm font-bold",c&&"bg-[#3BF06E]/15 text-[#3BF06E]",l&&"bg-[#FF2D20]/15 text-[#FF2D20]",!c&&!l&&"bg-[#3B9EFF]/15 text-[#3B9EFF]"),children:m})})()]}),e.teams&&e.teams.length>0&&jsxRuntime.jsxs("div",{className:"px-5 py-4",children:[jsxRuntime.jsx("h4",{className:u("text-[10px] font-mono uppercase tracking-wider mb-3",t?"text-white/40":"text-gray-500"),children:s?"DISPONIBILIDAD DEL EQUIPO":"TEAM AVAILABILITY"}),jsxRuntime.jsx("div",{className:"space-y-3",children:e.teams.map((i,c)=>{let l=i.utilizationPercent>=100?"#FF2D20":i.utilizationPercent>=80?"#FFD60A":i.color||"#3BF06E";return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:i.name}),jsxRuntime.jsxs("span",{className:u("text-[10px] font-mono",t?"text-white/40":"text-gray-500"),children:[i.utilizationPercent,"%"]})]}),jsxRuntime.jsx("div",{className:u("w-full h-1.5 rounded-full overflow-hidden",t?"bg-white/[0.06]":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(i.utilizationPercent,100)}%`,backgroundColor:l}})})]},`${i.name}-${c}`)})})]})]})}var ow=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:140,visible:true,sortable:true,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true}];function qg(e,t=0){let a=[];for(let r of e)a.push({...r,level:t,hasChildren:(r.subtasks?.length||0)>0,parentPath:[r.id]}),r.subtasks?.length&&r.isExpanded!==false&&a.push(...qg(r.subtasks,t+1));return a}function nw(e){let t=e.subtasks;if(!t?.length)return null;let a=new Date,r=0,o=0;for(let s of t){if(!s.startDate||!s.endDate)continue;let n=s.startDate.getTime(),c=s.endDate.getTime()-n;if(c<=0)continue;let m=Math.max(0,Math.min(a.getTime()-n,c))/c*100;if(m<=0)continue;let d=(s.progress||0)/m;r+=d,o++;}return o>0?r/o:null}function sw(e){return e.subtasks?.length?e.subtasks.filter(t=>t.teamLoad&&t.teamLoad.percentage>=100).length:0}function Un(e){if(!e.subtasks?.length)return {spent:0,allocated:0,quoted:0};let t=0,a=0,r=0;for(let o of e.subtasks)if(o.subtasks?.length){let s=Un(o);t+=s.spent,a+=s.allocated,r+=s.quoted;}else t+=o.timeLoggedMinutes??0,a+=o.effortMinutes??0,r+=o.soldEffortMinutes??0;return {spent:t,allocated:a,quoted:r}}function zn(e){if(e<=0)return "0h";let t=Math.floor(e/60),a=e%60;return a>0?`${t}h ${a}m`:`${t}h`}function iw({value:e,onChange:t,isDark:a}){let[r,o]=react.useState(false),[s,n]=react.useState(String(e||""));return r?jsxRuntime.jsx("input",{autoFocus:true,type:"text",inputMode:"decimal",value:s,onClick:i=>i.stopPropagation(),onChange:i=>n(i.target.value.replace(/[^0-9.]/g,"")),onBlur:()=>{let i=parseFloat(s);!isNaN(i)&&i>=0&&i<=100?t(i):s===""&&t(0),o(false);},onKeyDown:i=>{i.key==="Enter"&&i.target.blur(),i.key==="Escape"&&(n(String(e||"")),o(false));},className:u("w-14 text-xs text-right font-mono px-1 py-0.5 rounded border outline-none",a?"bg-white/5 border-[#00E5CC]/50 text-white":"bg-gray-50 border-blue-400 text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"}}):jsxRuntime.jsx("button",{onClick:i=>{i.stopPropagation(),n(String(e||"")),o(true);},className:u("text-xs font-mono cursor-pointer hover:underline",e>0?a?"text-white/80":"text-gray-700":a?"text-white/30":"text-gray-300"),style:{fontFamily:"JetBrains Mono, monospace"},children:e>0?`${e}%`:"\u2014"})}function Xg({tasks:e,config:t={},callbacks:a={},isLoading:r=false,error:o,className:s,style:n,availableUsers:i=[],customFields:c=[],toolbarRightContent:l}){let{theme:m="dark",locale:d="en",customTranslations:p,showSearch:g=true,showHierarchy:y=true,tableColumns:x,allowColumnCustomization:h=true,allowColumnResize:f=true,enableContextMenu:b=true,showCreateTaskButton:v=false,onCreateTask:C,persistFilter:w=false,financialBlur:N,healthSidebar:T,lens:k="hours",hourlyRate:P=0,rateMap:O,aggregateParentHours:S=false,showProjectTotals:J=false}=t,R=Ri(d,p),$=m==="dark",M=F=>{if(!O||!F.assignees||F.assignees.length===0)return P;let ge=F.assignees.map(Ce=>Ce.id?O[Ce.id]:void 0).filter(Ce=>Ce!=null&&Ce>0);return ge.length===0?P:ge.reduce((Ce,Ge)=>Ce+Ge,0)/ge.length},q=react.useCallback(()=>{if(!w||typeof window>"u")return {statusFilter:"all",hideCompleted:false};try{let F=localStorage.getItem(w);if(F){let ge=JSON.parse(F);return {statusFilter:ge.statusFilter||"all",hideCompleted:ge.hideCompleted||!1}}}catch(F){console.error("Error loading persisted filter:",F);}return {statusFilter:"all",hideCompleted:false}},[w]),Z=react.useMemo(()=>{function F(ge){let Ce=0,Ge=0,Ze=0;for(let lt of ge)if(lt.subtasks&<.subtasks.length>0){let ye=F(lt.subtasks);Ce+=ye.spent,Ge+=ye.allocated,Ze+=ye.quoted;}else Ce+=lt.timeLoggedMinutes??0,Ge+=lt.effortMinutes??0,Ze+=lt.soldEffortMinutes??0;return {spent:Ce,allocated:Ge,quoted:Ze}}return F(e)},[e]),Re=react.useMemo(()=>{let F=new Map;function ge(Ce){let Ge=0;for(let Ze of Ce)if(Ze.subtasks&&Ze.subtasks.length>0){let lt=ge(Ze.subtasks);F.set(Ze.id,lt),Ge+=lt;}else Ge+=Ze.weight||0;return Ge}return ge(e),F},[e]),I=react.useMemo(()=>!T?.enabled||!T.data?T:{...T,data:{...T.data,totalHoursSpentMinutes:Z.spent,totalHoursAllocatedMinutes:Z.allocated}},[T,Z]),[K,be]=react.useState(true),[_e,z]=react.useState("position"),[ae,Q]=react.useState("asc"),[Me,we]=react.useState(""),[Ie,He]=react.useState(()=>q().statusFilter),[at,te]=react.useState(()=>q().hideCompleted),[Qe,ce]=react.useState(x||ow),[nt,bt]=react.useState(false),[Bt,ke]=react.useState(false),[wt,it]=react.useState({isOpen:false,x:0,y:0,type:"task"}),[je,H]=react.useState(null),[ie,D]=react.useState(false),[j,le]=react.useState(null),[he,G]=react.useState(null),[ee,Ue]=react.useState(null),Te=react.useRef(0),Le=react.useRef(false),Ee=!!(a.onTaskMove||a.onTaskReparent),qe=react.useCallback((F,ge)=>{Ee&&(ge.preventDefault(),Te.current=ge.clientY,H(F),Le.current=false,D(false),Ue({x:ge.clientX,y:ge.clientY}));},[Ee]),yt=react.useCallback(F=>{if(!je||(Math.abs(F.clientY-Te.current)>5&&!Le.current&&(Le.current=true,D(true)),Ue({x:F.clientX,y:F.clientY}),!Le.current))return;let Ce=document.querySelectorAll("[data-listview-row]"),Ge=null,Ze=null;Ce.forEach(lt=>{let ye=lt.getBoundingClientRect(),rt=lt.getAttribute("data-listview-row");if(rt&&rt!==je&&F.clientY>=ye.top&&F.clientY<=ye.bottom){Ge=rt;let Tt=F.clientY-ye.top,qt=ye.height;Ze=Tt<qt*.25?"above":Tt>qt*.75?"below":"child";}}),le(Ge),G(Ze);},[je]),pt=react.useCallback(()=>{if(Le.current&&je&&j&&he){if(he==="child"&&a.onTaskReparent)a.onTaskReparent(je,j);else if(he==="above"||he==="below"){let F=(Ge,Ze,lt=null)=>{for(let ye of Ge){if(ye.id===Ze)return lt;if(ye.subtasks){let rt=F(ye.subtasks,Ze,ye.id);if(rt!==void 0)return rt}}},ge=F(e,je,null),Ce=F(e,j,null);if(a.onTaskReparent){let Ge=(qt,Dt)=>{if(Dt===null)return qt;for(let zt of qt){if(zt.id===Dt)return zt.subtasks||[];if(zt.subtasks){let Xt=Ge(zt.subtasks,Dt);if(Xt.length>0||zt.subtasks.some(ba=>ba.id===Dt))return Xt}}return []},Ze=Ge(e,Ce??null),lt=Ze.findIndex(qt=>qt.id===j),ye=ge===Ce,rt=ye?Ze.findIndex(qt=>qt.id===je):-1,Tt=he==="below"?lt+1:lt;ye&&rt!==-1&&rt<lt&&(Tt-=1),a.onTaskReparent(je,Ce??null,Math.max(0,Tt));}}}H(null),le(null),G(null),Ue(null),Le.current=false,D(false);},[je,j,he,e,a]);react.useEffect(()=>{if(je)return document.addEventListener("mousemove",yt),document.addEventListener("mouseup",pt),document.body.style.cursor="grabbing",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",yt),document.removeEventListener("mouseup",pt),document.body.style.cursor="",document.body.style.userSelect="";}},[je,yt,pt]);let[tt,ot]=react.useState("all"),[Ot,$t]=react.useState(false),kt=react.useRef(null),Ct=react.useRef(null),mt=react.useMemo(()=>{let F=0;function ge(Ce,Ge){for(let Ze of Ce)Ge>F&&(F=Ge),Ze.subtasks?.length&&ge(Ze.subtasks,Ge+1);}return ge(e,1),F},[e]);react.useEffect(()=>{if(!Ot)return;let F=ge=>{kt.current?.contains(ge.target)||Ct.current?.contains(ge.target)||$t(false);};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[Ot]),react.useEffect(()=>{if(tt==="all"){let Ce=function(Ge){for(let Ze of Ge)Ze.subtasks?.length&&(Ze.isExpanded===false&&a.onTaskToggleExpand?.(Ze.id),Ce(Ze.subtasks));};Ce(e);}else {let Ce=function(Ge,Ze){for(let lt of Ge)if(lt.subtasks?.length){let ye=Ze<tt,rt=lt.isExpanded!==false;ye!==rt&&a.onTaskToggleExpand?.(lt.id),Ce(lt.subtasks,Ze+1);}};Ce(e,1);}},[tt]);let[At,We]=react.useState(null),[Pe,gt]=react.useState(0),[oe,fe]=react.useState(0),L=react.useRef(null),[V,Y]=react.useState(null),[ue,Ne]=react.useState(null);react.useEffect(()=>{x&&ce(x);},[x]),react.useEffect(()=>{if(!(!w||typeof window>"u"))try{localStorage.setItem(w,JSON.stringify({statusFilter:Ie,hideCompleted:at}));}catch(F){console.error("Error persisting filter state:",F);}},[w,Ie,at]);let Xe=react.useMemo(()=>{let F=new Set;function ge(Ce){for(let Ge of Ce)Ge.subtasks?.length&&(Ge.isExpanded!==false&&F.add(Ge.id),ge(Ge.subtasks));}return ge(e),F},[e]),ze=react.useMemo(()=>Qe.filter(F=>F.visible),[Qe]),Be=react.useCallback(F=>{a.onTaskToggleExpand?.(F);},[a]),xt=react.useCallback(F=>{_e===F?Q(ge=>ge==="asc"?"desc":"asc"):(z(F),Q("asc")),a.onSortChange?.({column:F,direction:ae==="asc"?"desc":"asc"});},[_e,ae,a]),ft=react.useCallback(F=>{ce(F),a.onColumnsChange?.(F);},[a]),Gt=react.useCallback(F=>{let ge=Qe.map(Ce=>Ce.id===F?{...Ce,visible:false}:Ce);ft(ge);},[Qe,ft]),Ta=react.useCallback((F,ge)=>{z(F),Q(ge);},[]),Zt=react.useCallback((F,ge,Ce)=>{b&&(F.preventDefault(),it({isOpen:true,x:F.clientX,y:F.clientY,type:ge?"task":"header",task:ge,columnId:Ce}));},[b]),U=react.useCallback(()=>{it(F=>({...F,isOpen:false}));},[]),ne=react.useCallback((F,ge)=>{if(!f)return;F.preventDefault(),F.stopPropagation();let Ce=Qe.find(Ge=>Ge.id===ge);Ce&&(We(ge),gt(F.clientX),fe(Ce.width));},[Qe,f]);react.useEffect(()=>{if(!At)return;let F=Ce=>{let Ge=Ce.clientX-Pe,Ze=Math.max(50,oe+Ge),lt=Qe.map(ye=>ye.id===At?{...ye,width:Ze}:ye);ce(lt);},ge=()=>{At&&a.onColumnsChange?.(Qe),We(null);};return document.addEventListener("mousemove",F),document.addEventListener("mouseup",ge),()=>{document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",ge);}},[At,Pe,oe,Qe,a]);let Oe=react.useCallback((F,ge)=>{if(ge==="name"){F.preventDefault();return}Y(ge),F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",ge),F.currentTarget instanceof HTMLElement&&(F.currentTarget.style.opacity="0.5");},[]),A=react.useCallback(F=>{F.currentTarget instanceof HTMLElement&&(F.currentTarget.style.opacity="1"),Y(null),Ne(null);},[]),me=react.useCallback((F,ge)=>{F.preventDefault(),ge!=="name"&&(F.dataTransfer.dropEffect="move",Ne(ge));},[]),Ve=react.useCallback(()=>{Ne(null);},[]),et=react.useCallback((F,ge)=>{if(F.preventDefault(),!V||V===ge||ge==="name")return;let Ce=[...Qe],Ge=Ce.findIndex(ye=>ye.id===V),Ze=Ce.findIndex(ye=>ye.id===ge);if(Ge===-1||Ze===-1)return;let lt=Ce.splice(Ge,1);lt[0]&&(Ce.splice(Ze,0,lt[0]),ft(Ce),Y(null),Ne(null));},[V,Qe,ft]),ra=react.useCallback(async F=>{if(a.onCreateCustomField){let ge={...F,id:`cf_${Date.now()}`,projectId:""};await a.onCreateCustomField(ge);}ke(false);},[a]),Ht=react.useCallback(F=>F.progress===100||F.status==="completed"?"completed":F.progress&&F.progress>0||F.status==="in-progress"?"in-progress":"todo",[]),fa=react.useMemo(()=>{let F=qg(e);if(Me.trim()){let ge=Me.toLowerCase();F=F.filter(Ce=>Ce.name.toLowerCase().includes(ge));}return Ie!=="all"&&(F=F.filter(ge=>Ht(ge)===Ie)),at&&(F=F.filter(ge=>Ht(ge)!=="completed")),F.sort((ge,Ce)=>{let Ge,Ze;switch(_e){case "name":Ge=ge.name.toLowerCase(),Ze=Ce.name.toLowerCase();break;case "startDate":Ge=ge.startDate?.getTime()||0,Ze=Ce.startDate?.getTime()||0;break;case "endDate":Ge=ge.endDate?.getTime()||0,Ze=Ce.endDate?.getTime()||0;break;case "progress":Ge=ge.progress||0,Ze=Ce.progress||0;break;case "status":Ge=ge.status||"todo",Ze=Ce.status||"todo";break;case "priority":let lt={urgent:0,high:1,medium:2,low:3,none:4};Ge=lt[ge.priority]??4,Ze=lt[Ce.priority]??4;break;case "position":return 0;default:return 0}return Ge<Ze?ae==="asc"?-1:1:Ge>Ze?ae==="asc"?1:-1:0}),F},[e,Me,Ie,at,_e,ae,Ht]),Ua=react.useCallback((F,ge)=>{let Ce=lt=>{a.onTaskUpdate?.({...F,...lt});},Ge=lt=>lt?F.customFields?.find(rt=>rt.fieldId===lt)?.value:void 0,Ze=(lt,ye)=>{if(!lt)return;let Tt=[...F.customFields||[]],qt=Tt.findIndex(Dt=>Dt.fieldId===lt);qt>=0?Tt[qt]={fieldId:lt,value:ye}:Tt.push({fieldId:lt,value:ye}),Ce({customFields:Tt});};switch(ge.type){case "name":return null;case "status":return jsxRuntime.jsx(Om,{value:F.status||(F.progress===100?"completed":F.progress&&F.progress>0?"in-progress":"todo"),onChange:ye=>{Ce({status:ye,progress:ye==="completed"?100:ye==="in-progress"?50:0});},isDark:$,locale:d,translations:R.status});case "priority":return jsxRuntime.jsx(Hm,{value:F.priority,onChange:ye=>Ce({priority:ye}),isDark:$,locale:d});case "assignees":{let ye=F.hasChildren,rt=F.assignees||[];if(ye&&F.subtasks?.length){let Tt=new Map;(F.assignees||[]).forEach(Dt=>Tt.set(Dt.name,Dt));let qt=Dt=>{(Dt||[]).forEach(zt=>{(zt.assignees||[]).forEach(Xt=>{Tt.has(Xt.name)||Tt.set(Xt.name,Xt);}),zt.subtasks?.length&&qt(zt.subtasks);});};qt(F.subtasks),rt=Array.from(Tt.values());}return jsxRuntime.jsx(Gm,{value:rt,availableUsers:i,onChange:Tt=>Ce({assignees:Tt}),isDark:$,locale:d,disabled:ye})}case "startDate":return jsxRuntime.jsx(Hi,{value:F.startDate,onChange:ye=>Ce({startDate:ye}),isDark:$,locale:d,dateField:"start",startDate:F.startDate,endDate:F.endDate});case "endDate":return jsxRuntime.jsx(Hi,{value:F.endDate,onChange:ye=>Ce({endDate:ye}),isDark:$,locale:d,dateField:"end",startDate:F.startDate,endDate:F.endDate});case "progress":return jsxRuntime.jsx(qm,{value:F.progress||0,onChange:ye=>{let rt=ye===100?"completed":ye>0?"in-progress":"todo";Ce({progress:ye,status:rt});},isDark:$});case "tags":return jsxRuntime.jsx(ig,{value:F.tags||[],isDark:$});case "text":return jsxRuntime.jsx(Qm,{value:Ge(ge.customFieldId)||"",onChange:ye=>Ze(ge.customFieldId,ye),isDark:$});case "number":return jsxRuntime.jsx(tg,{value:Ge(ge.customFieldId)||0,onChange:ye=>Ze(ge.customFieldId,ye),isDark:$});case "date":let lt=Ge(ge.customFieldId);return jsxRuntime.jsx(Hi,{value:lt?new Date(lt):void 0,onChange:ye=>Ze(ge.customFieldId,ye),isDark:$,locale:d});case "dropdown":return jsxRuntime.jsx(ag,{value:Ge(ge.customFieldId)||"",options:ge.options||[],onChange:ye=>Ze(ge.customFieldId,ye),isDark:$});case "checkbox":return jsxRuntime.jsx(og,{value:Ge(ge.customFieldId)||false,onChange:ye=>Ze(ge.customFieldId,ye),isDark:$});case "estimatedTime":{let ye=F.status==="completed"||F.progress===100;return jsxRuntime.jsx(hr,{value:F.estimatedTime,onChange:rt=>Ce({estimatedTime:rt}),isDark:$,locale:d,disabled:ye,lens:k,hourlyRate:M(F)})}case "quotedTime":{let ye=F.status==="completed"||F.progress===100,rt=N?.enabled&&(!N.columns||N.columns.includes("quotedTime"));return jsxRuntime.jsx(hr,{value:F.quotedTime,onChange:Tt=>Ce({quotedTime:Tt}),isDark:$,locale:d,disabled:ye,isBlurred:rt,lens:k,hourlyRate:M(F)})}case "elapsedTime":{let ye=F.status==="completed"||F.progress===100;return jsxRuntime.jsx(hr,{value:F.elapsedTime,onChange:rt=>Ce({elapsedTime:rt}),isDark:$,locale:d,disabled:ye,lens:k,hourlyRate:M(F)})}case "effortMinutes":{if(S&&F.subtasks&&F.subtasks.length>0){let{allocated:Dt,quoted:zt}=Un(F),Xt=M(F);if(k==="financial"&&Xt&&Dt>0&&zt>0){let ba=Math.round(Dt/60*Xt),ha=Math.round(zt/60*Xt)-ba;return jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(hr,{value:Dt>0?Dt:void 0,isDark:$,locale:d,disabled:true,lens:k,hourlyRate:M(F)}),ha!==0&&jsxRuntime.jsxs("span",{className:u("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap",ha>0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[ha>0?"+":"",ha>=1e3?`$${(ha/1e3).toFixed(1)}K`:`$${ha}`]})]})}return jsxRuntime.jsx(hr,{value:Dt>0?Dt:void 0,isDark:$,locale:d,disabled:true,lens:k,hourlyRate:M(F)})}let ye=F.status==="completed"||F.progress===100,rt=F.effortMinutes||0,Tt=F.soldEffortMinutes||0,qt=M(F);if(k==="financial"&&qt&&rt>0&&Tt>0){let Dt=Math.round(rt/60*qt),Xt=Math.round(Tt/60*qt)-Dt;return jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(hr,{value:rt,onChange:ba=>Ce({effortMinutes:ba}),isDark:$,locale:d,disabled:ye,lens:k,hourlyRate:M(F)}),Xt!==0&&jsxRuntime.jsxs("span",{className:u("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap",Xt>=0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[Xt>0?"+":"",Math.abs(Xt)>=1e3?`$${(Xt/1e3).toFixed(1)}K`:`$${Xt}`]})]})}return jsxRuntime.jsx(hr,{value:rt,onChange:Dt=>Ce({effortMinutes:Dt}),isDark:$,locale:d,disabled:ye,lens:k,hourlyRate:M(F)})}case "timeLoggedMinutes":{if(S&&F.subtasks&&F.subtasks.length>0){let{spent:rt}=Un(F);return jsxRuntime.jsx(hr,{value:rt>0?rt:void 0,isDark:$,locale:d,disabled:true,lens:k,hourlyRate:M(F)})}let ye=F.status==="completed"||F.progress===100;return jsxRuntime.jsx(hr,{value:F.timeLoggedMinutes,onChange:a.onLogTime?rt=>{a.onLogTime?.(F,rt);}:void 0,isDark:$,locale:d,placeholder:d==="es"?"Agregar":"Add",disabled:ye,lens:k,hourlyRate:M(F)})}case "soldEffortMinutes":{if(S&&F.subtasks&&F.subtasks.length>0){let{quoted:Tt}=Un(F),qt=N?.enabled&&(!N.columns||N.columns.includes("soldEffortMinutes"));return jsxRuntime.jsx(hr,{value:Tt>0?Tt:void 0,isDark:$,locale:d,disabled:true,isBlurred:qt,lens:k,hourlyRate:M(F)})}let ye=F.status==="completed"||F.progress===100,rt=N?.enabled&&(!N.columns||N.columns.includes("soldEffortMinutes"));return jsxRuntime.jsx(hr,{value:F.soldEffortMinutes,onChange:Tt=>Ce({soldEffortMinutes:Tt}),isDark:$,locale:d,disabled:ye,isBlurred:rt,lens:k,hourlyRate:M(F)})}case "scheduleVariance":{let ye=F.effortMinutes||0,rt=F.soldEffortMinutes||0,Tt=F.timeLoggedMinutes||0,qt=ye>0||rt>0||Tt>0;return jsxRuntime.jsx(ug,{startDate:F.startDate,endDate:F.endDate,scheduleVariance:F.scheduleVariance,isDark:$,locale:d,hasTimeAllocated:qt})}case "hoursBar":{if(S&&F.hasChildren){let{spent:ye,allocated:rt,quoted:Tt}=Un(F),qt=ye>rt&&rt>0;return jsxRuntime.jsxs("span",{className:u("text-[11px] font-mono flex items-center gap-1.5",$?"text-white/50":"text-gray-500"),children:[jsxRuntime.jsx("span",{className:u("font-bold",qt?"text-[#FF453A]":$?"text-white/80":"text-gray-800"),children:zn(ye)}),rt>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" / ",jsxRuntime.jsx("span",{className:$?"text-white/60":"text-gray-600",children:zn(rt)})]}),Tt>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" / ",jsxRuntime.jsx("span",{className:$?"text-amber-400/70":"text-amber-600",children:zn(Tt)})]})]})}return jsxRuntime.jsx(mg,{task:F,isDark:$,locale:d,onLogTime:a.onLogTime,onEstimateUpdate:a.onEstimateUpdate,onSoldEffortUpdate:a.onSoldEffortUpdate,showSoldEffort:t.showSoldEffort,onOpenTimeLog:a.onOpenTimeLog,lens:k,hourlyRate:M(F)})}case "teamLoad":return jsxRuntime.jsx(fg,{task:F,isDark:$,locale:d});case "blockers":return jsxRuntime.jsx(hg,{blockers:F.blockers,isDark:$,locale:d});case "weight":{let ye=Re.get(F.id);if(ye!==void 0)return jsxRuntime.jsx("span",{className:u("text-xs font-mono",ye>0?$?"text-white/50":"text-gray-400":$?"text-white/30":"text-gray-300"),style:{fontFamily:"JetBrains Mono, monospace"},children:ye>0?`${Number(ye.toFixed(2))}%`:"\u2014"});let rt=F.weight||0;return jsxRuntime.jsx(iw,{value:rt,onChange:Tt=>Ce({weight:Tt}),isDark:$})}default:return jsxRuntime.jsx("span",{className:u("text-sm",$?"text-white/60":"text-gray-500"),children:"-"})}},[a,$,d,i,R,S,Re]),Wa=react.useCallback(F=>{let Ce={name:R.columns.name,status:R.columns.status,priority:R.columns.priority,assignees:R.columns.assignees,startDate:R.columns.startDate,endDate:R.columns.endDate,progress:R.columns.progress,tags:R.columns.tags||(d==="es"?"Etiquetas":"Tags"),estimatedTime:R.columns.estimatedTime||(d==="es"?"Estimado":"Estimated"),quotedTime:R.columns.quotedTime||(d==="es"?"Ofertado":"Quoted"),elapsedTime:R.columns.elapsedTime||(d==="es"?"Ejecutado":"Executed"),soldEffortMinutes:R.columns.soldEffortMinutes||(d==="es"?"Ofertado":"Quoted"),effortMinutes:R.columns.effortMinutes||(d==="es"?"Estimado":"Estimated"),timeLoggedMinutes:R.columns.timeLoggedMinutes||(d==="es"?"Ejecutado":"Executed"),scheduleVariance:R.columns.scheduleVariance||(d==="es"?"Prog / Var":"Sched / Var"),hoursBar:R.columns.hoursBar||(d==="es"?"Horas (Usado / Asignado)":"Hours (Spent / Allocated)"),teamLoad:R.columns.teamLoad||(d==="es"?"Equipo":"Team"),blockers:R.columns.blockers||(d==="es"?"Bloqueantes":"Blockers"),weight:R.columns.weight||(d==="es"?"Peso":"Weight")}[F.type]||F.label;return typeof Ce=="string"?Ce:String(Ce||F.type)},[R,d]),pa=react.useMemo(()=>{let Ce=ze.reduce((Ze,lt)=>Ze+lt.width,0)+(h?48:0),Ge={};for(let Ze of ze)Ge[Ze.id]=`${Ze.width/Ce*100}%`;return Ge},[ze,h]);return r?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",$?"bg-[#0D0D0D]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#007BFF]"}),jsxRuntime.jsxs("p",{className:u("text-sm",$?"text-white/60":"text-gray-600"),children:[R.empty.noTasks,"..."]})]})}):o?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",$?"bg-[#0D0D0D]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsxRuntime.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center",children:jsxRuntime.jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:u("text-lg font-semibold mb-2",$?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:u("text-sm",$?"text-white/60":"text-gray-600"),children:typeof o=="string"?o:o.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",$?"bg-[#0D0D0D]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"text-center max-w-md",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-[#007BFF]/10 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.List,{className:"w-8 h-8 text-[#007BFF]"})}),jsxRuntime.jsx("h3",{className:u("text-lg font-semibold mb-2",$?"text-white":"text-gray-900"),children:R.empty.noTasks}),jsxRuntime.jsx("p",{className:u("text-sm",$?"text-white/60":"text-gray-600"),children:R.empty.addFirstTask})]})}):jsxRuntime.jsxs("div",{ref:L,className:u($?"bg-[#0D0D0D]":"bg-white",At&&"select-none",s),style:{display:"flex",flexDirection:"column",flex:"1 1 0%",width:"100%",height:"100%",overflow:"hidden",minHeight:0,...n},children:[jsxRuntime.jsx("div",{className:u("flex-shrink-0 px-6 py-4 border-b",$?"border-[#222]":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsxs("div",{className:u("text-sm",$?"text-white/60":"text-gray-600"),children:[fa.length," ",R.pagination.tasks]}),g&&jsxRuntime.jsxs("div",{className:"relative flex-1 max-w-md",children:[jsxRuntime.jsx(lucideReact.Search,{className:u("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",$?"text-white/60":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:Me,onChange:F=>we(F.target.value),placeholder:R.toolbar.searchPlaceholder,className:u("w-full h-9 pl-10 pr-4 rounded-lg border outline-none focus:ring-2 focus:ring-[#007BFF]/30",$?"bg-white/[0.03] border-[#222] text-white placeholder:text-white/30 font-mono":"bg-gray-100 border-gray-200 text-gray-900 placeholder:text-gray-400")})]}),jsxRuntime.jsx("div",{className:"flex-1"}),l&&jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:l}),y&&mt>1&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs("button",{ref:kt,onClick:()=>$t(!Ot),className:u("flex items-center gap-1.5 px-2 py-1.5 rounded-lg border transition-colors text-[11px] font-medium",$?Ot?"bg-blue-500/10 border-blue-500/40 text-blue-400":"bg-white/[0.03] border-[#333] text-white/50 hover:text-white/70 hover:bg-white/[0.05]":Ot?"bg-blue-50 border-blue-300 text-blue-600":"bg-gray-100 border-gray-200 text-gray-500 hover:text-gray-700 hover:bg-gray-200"),style:{fontFamily:"'JetBrains Mono', monospace"},children:[jsxRuntime.jsx(lucideReact.Layers,{className:"w-3.5 h-3.5"}),tt==="all"?d==="es"?"Todos":"All":`L${tt}`]}),Ot&&jsxRuntime.jsx("div",{ref:Ct,className:u("absolute top-full mt-1 right-0 w-24 rounded-lg border overflow-hidden z-50 shadow-lg",$?"bg-[#1A1A1A] border-[#333]":"bg-white border-gray-200"),children:[{value:"all",label:d==="es"?"Todos":"All"},...Array.from({length:Math.min(mt,5)},(F,ge)=>({value:ge+1,label:`L${ge+1}`}))].map(F=>jsxRuntime.jsxs("button",{onClick:()=>{ot(F.value),$t(false);},className:u("w-full px-3 py-2 text-left text-xs transition-colors flex items-center justify-between",$?tt===F.value?"bg-blue-500/10 text-blue-400":"text-white/60 hover:bg-white/[0.05] hover:text-white/80":tt===F.value?"bg-blue-50 text-blue-600":"text-gray-600 hover:bg-gray-100"),children:[jsxRuntime.jsx("span",{children:F.label}),tt===F.value&&jsxRuntime.jsx("span",{className:"text-blue-400",children:"\u2713"})]},String(F.value)))})]}),jsxRuntime.jsx(Ug,{value:Ie,hideCompleted:at,onChange:He,onHideCompletedChange:te,isDark:$,locale:d}),I?.enabled&&I.data&&!K&&jsxRuntime.jsx("button",{onClick:()=>be(true),className:u("flex items-center justify-center w-8 h-8 rounded-lg border transition-colors",$?"border-[#333] text-white/40 hover:text-white/70 hover:bg-white/[0.05]":"border-gray-200 text-gray-400 hover:text-gray-600 hover:bg-gray-100"),title:d==="es"?"Abrir panel de salud":"Open health panel",children:jsxRuntime.jsx(lucideReact.PanelRight,{className:"w-4 h-4"})}),t.toolbarEndContent,v&&C&&jsxRuntime.jsxs(framerMotion.motion.button,{onClick:C,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-[transform,box-shadow]",style:{background:"linear-gradient(135deg, #007BFF 0%, #005FCC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 123, 255, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 123, 255, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),jsxRuntime.jsx("span",{children:R.toolbar.newTask})]})]})}),jsxRuntime.jsxs("div",{style:{display:"flex",flex:"1 1 0%",overflow:"hidden",minHeight:0},children:[jsxRuntime.jsx("div",{style:{flex:"1 1 0%",overflow:"auto",minHeight:0},children:jsxRuntime.jsxs("div",{style:{width:"100%"},children:[jsxRuntime.jsxs("div",{className:u("flex-shrink-0 flex items-center border-b text-[9px] font-bold uppercase tracking-wider sticky top-0 z-10",$?"border-[#222] bg-[#1A1A1A] font-mono":"border-gray-200 bg-gray-50"),children:[ze.map(F=>{let ge=F.id!=="name",Ce=ue===F.id&&V!==F.id;return jsxRuntime.jsxs("div",{className:u("relative flex items-center gap-2 px-4 py-2 transition-all duration-150 group",$?"text-white/60":"text-gray-500",ge&&"cursor-grab",V===F.id&&"opacity-50",Ce&&($?"bg-[#007BFF]/20 border-l-2 border-l-[#007BFF]":"bg-blue-50 border-l-2 border-l-blue-400")),style:{width:pa[F.id],minWidth:F.minWidth},draggable:ge,onDragStart:ge?Ge=>Oe(Ge,F.id):void 0,onDragEnd:ge?A:void 0,onDragOver:ge?Ge=>me(Ge,F.id):void 0,onDragLeave:ge?Ve:void 0,onDrop:ge?Ge=>et(Ge,F.id):void 0,onContextMenu:Ge=>Zt(Ge,void 0,F.id),children:[ge&&jsxRuntime.jsx(lucideReact.GripVertical,{className:u("w-3 h-3 flex-shrink-0 transition-opacity",$?"text-white/20 group-hover:text-white/50":"text-gray-300 group-hover:text-gray-500")}),F.sortable?jsxRuntime.jsxs("button",{draggable:false,onClick:()=>xt(F.id),className:"flex items-center gap-1 hover:text-[#007BFF]",children:[Wa(F),jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:u("w-3 h-3",_e===F.id&&"text-[#007BFF]")})]}):jsxRuntime.jsx("span",{draggable:false,children:Wa(F)}),f&&F.resizable&&jsxRuntime.jsx("div",{className:u("absolute right-0 top-0 bottom-0 w-1 cursor-col-resize group","hover:bg-[#007BFF]",At===F.id&&"bg-[#007BFF]"),onMouseDown:Ge=>ne(Ge,F.id)})]},F.id)}),h&&jsxRuntime.jsxs("div",{className:"relative flex items-center justify-center px-3 py-0.5",children:[jsxRuntime.jsx("button",{onClick:F=>{F.stopPropagation(),bt(ge=>!ge);},className:u("p-0.5 rounded transition-colors",$?"hover:bg-white/[0.05] text-white/60 hover:text-white":"hover:bg-gray-200 text-gray-400 hover:text-gray-600",nt&&($?"bg-white/[0.05]":"bg-gray-200")),title:d==="es"?"Agregar columna":"Add column",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3 h-3"})}),jsxRuntime.jsx(Ig,{isOpen:nt,onClose:()=>bt(false),columns:Qe,customFields:c,onColumnsChange:ft,onCreateCustomField:()=>{bt(false),ke(true);},isDark:$,locale:d})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"popLayout",children:fa.map((F,ge)=>{let Ce=Xe.has(F.id),Ge=Math.min(ge*.01,.2),Ze=F.hasChildren&&F.level===0,lt=F.subtasks?.length||0;if(Ze){let{spent:zt,allocated:Xt,quoted:ba}=Un(F),Nr=nw(F),ha=sw(F);return jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,delay:Ge},className:u("flex items-center border-y cursor-pointer",$?"border-[#222] bg-[#222]":"border-gray-200 bg-gray-100"),onClick:()=>a.onTaskClick?.(F),children:ze.map(ir=>jsxRuntime.jsx("div",{className:"flex items-center px-4 py-2.5",style:{width:pa[ir.id],minWidth:ir.minWidth},children:ir.type==="name"?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 min-w-0 w-full",children:[jsxRuntime.jsx("button",{onClick:ya=>{ya.stopPropagation(),Be(F.id);},className:u("p-0.5 rounded flex-shrink-0",$?"hover:bg-white/[0.05]":"hover:bg-gray-200"),children:Ce?jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-4 h-4",$?"text-white/40":"text-gray-500")}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:u("w-4 h-4",$?"text-white/40":"text-gray-500")})}),jsxRuntime.jsx("span",{onClick:ya=>{ya.stopPropagation(),Be(F.id);},className:"flex-shrink-0 cursor-pointer",children:Ce?jsxRuntime.jsx(lucideReact.FolderOpen,{className:"w-4 h-4",style:{color:$?"#FFD60A":"#B45309"}}):jsxRuntime.jsx(lucideReact.Folder,{className:"w-4 h-4",style:{color:$?"#FFD60A":"#B45309"}})}),F.wbsCode&&jsxRuntime.jsx("span",{className:"text-[10px] font-mono flex-shrink-0",style:{color:$?"#FFD60A":"#B45309"},children:F.wbsCode}),jsxRuntime.jsx("span",{title:F.name,className:u("text-[11px] font-semibold uppercase tracking-wide truncate",$?"text-white":"text-gray-800"),style:{fontFamily:"Inter, system-ui, sans-serif",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},children:F.name}),jsxRuntime.jsxs("span",{className:u("text-[10px] font-mono px-2 py-0.5 rounded-full flex-shrink-0",$?"text-white/30 bg-white/[0.05]":"text-gray-500 bg-gray-200"),children:["(",lt," ",d==="es"?lt===1?"Tarea":"Tareas":lt===1?"Item":"Items",")"]}),Nr!==null&&jsxRuntime.jsxs("span",{className:u("text-[10px] font-mono flex-shrink-0",Nr>=1?"text-[#32D74B]":Nr>=.8?"text-[#FFD60A]":"text-[#FF453A]"),children:["Avg SPI: ",Nr.toFixed(2)]}),ha>0&&jsxRuntime.jsxs("span",{className:"text-[10px] font-mono text-[#FF453A] flex-shrink-0",children:[d==="es"?"Conflicto":"Conflict",": ",ha]})]}):ir.type==="timeLoggedMinutes"?jsxRuntime.jsx(hr,{value:zt>0?zt:void 0,isDark:$,locale:d,disabled:true,lens:k,hourlyRate:M(F)}):ir.type==="soldEffortMinutes"?jsxRuntime.jsx(hr,{value:ba>0?ba:void 0,isDark:$,locale:d,disabled:true,lens:k,hourlyRate:M(F)}):ir.type==="effortMinutes"?jsxRuntime.jsx(hr,{value:Xt>0?Xt:void 0,isDark:$,locale:d,disabled:true,lens:k,hourlyRate:M(F)}):Ua(F,ir)},ir.id))},F.id)}let ye=je===F.id,rt=j===F.id,Tt=rt&&he==="above",qt=rt&&he==="below",Dt=rt&&he==="child";return jsxRuntime.jsxs(framerMotion.motion.div,{"data-listview-row":F.id,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,delay:Ge},className:u("flex items-center border-b transition-colors relative group",$?"border-[#222] hover:bg-white/[0.05]":"border-gray-100 hover:bg-gray-50"),style:{opacity:ye?.4:1,backgroundColor:Dt?$?"rgba(46,148,255,0.08)":"rgba(46,148,255,0.05)":void 0,boxShadow:Dt?"inset 0 0 0 2px #2E94FF":void 0},onClick:()=>a.onTaskClick?.(F),onDoubleClick:()=>a.onTaskDoubleClick?.(F),onContextMenu:zt=>Zt(zt,F),children:[Tt&&jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:"#2E94FF",zIndex:10}}),qt&&jsxRuntime.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:2,backgroundColor:"#2E94FF",zIndex:10}}),Ee&&jsxRuntime.jsx("div",{className:"flex-shrink-0 flex items-center justify-center w-5 cursor-grab opacity-0 group-hover:opacity-40 hover:!opacity-80 transition-opacity",onMouseDown:zt=>qe(F.id,zt),style:{color:$?"#888":"#999"},children:jsxRuntime.jsx(lucideReact.GripVertical,{className:"w-3 h-3"})}),ze.map(zt=>jsxRuntime.jsx("div",{className:"flex items-center px-4 py-3 min-h-[56px]",style:{width:pa[zt.id],minWidth:zt.minWidth},children:zt.type==="name"?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 min-w-0 w-full",children:[y&&F.level>0&&jsxRuntime.jsx("div",{style:{width:`${F.level*24}px`},className:"flex-shrink-0"}),y&&F.hasChildren&&jsxRuntime.jsx("button",{onClick:Xt=>{Xt.stopPropagation(),Be(F.id);},className:u("p-0.5 rounded flex-shrink-0",$?"hover:bg-white/[0.05]":"hover:bg-gray-200"),children:Ce?jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-4 h-4",$?"text-white/60":"text-gray-400")}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:u("w-4 h-4",$?"text-white/60":"text-gray-400")})}),y&&!F.hasChildren&&jsxRuntime.jsx("div",{className:"w-5 flex-shrink-0"}),jsxRuntime.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[(F.wbsCode||F.taskCode)&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[F.wbsCode&&jsxRuntime.jsx("span",{className:u("text-[10px] font-mono",$?"text-[#007BFF]":"text-blue-600"),children:F.wbsCode}),F.taskCode&&jsxRuntime.jsx("span",{className:u("text-[10px] font-mono",$?"text-white/40":"text-gray-400"),children:F.taskCode})]}),jsxRuntime.jsx("span",{className:u("truncate font-bold text-[13px]",F.progress===100?$?"line-through text-white/50":"line-through text-gray-400":$?"text-white":"text-gray-900"),children:F.name}),F.tags?.[0]&&jsxRuntime.jsx("span",{className:"text-[9px] font-mono uppercase tracking-wide px-1.5 py-0.5 rounded w-fit",style:{backgroundColor:`${F.tags[0].color}20`,color:F.tags[0].color},children:F.tags[0].name})]})]}):Ua(F,zt)},zt.id)),h&&jsxRuntime.jsx("div",{className:"w-12 flex-shrink-0"})]},F.id)})}),J&&fa.length>0&&(()=>{let{spent:F,allocated:ge,quoted:Ce}=Z,Ge=ge-F,Ze=Ge<0,lt=Ze?`+${zn(Math.abs(Ge))} ${d==="es"?"EXCEDIDO":"OVER"}`:`-${zn(Ge)} ${d==="es"?"AHORRADO":"SAVED"}`,ye=k==="financial"&&P>0,rt=Dt=>ye?`$${(Dt/60*P).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0})}`:zn(Dt),Tt=ye?Math.abs(Ge/60*P):0,qt=ye?`${Ze?"+":"-"}$${Tt.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0})} ${Ze?d==="es"?"EXCEDIDO":"OVER":d==="es"?"AHORRADO":"SAVED"}`:lt;return jsxRuntime.jsxs("div",{className:u("flex items-center sticky bottom-0 z-10",$?"border-t border-[#2A2A3A]":"border-t border-gray-300"),style:{backgroundColor:$?"rgba(13, 17, 23, 0.95)":"rgba(255, 255, 255, 0.95)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:[ze.map(Dt=>jsxRuntime.jsx("div",{className:"flex items-center px-4 py-3",style:{width:pa[Dt.id],minWidth:Dt.minWidth},children:Dt.type==="name"?jsxRuntime.jsx("span",{className:u("text-[11px] font-black uppercase tracking-widest",$?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:d==="es"?"TOTAL PROYECTO":"TOTAL PROJECT"}):Dt.type==="hoursBar"?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 w-full",children:[jsxRuntime.jsx("span",{className:u("text-[12px] font-bold",$?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:rt(F)}),jsxRuntime.jsx("span",{className:u("text-[11px]",$?"text-white/40":"text-gray-400"),children:"/"}),jsxRuntime.jsx("span",{className:u("text-[11px]",$?"text-white/50":"text-gray-500"),style:{fontFamily:"JetBrains Mono, monospace"},children:rt(ge)}),ge>0&&jsxRuntime.jsx("span",{className:u("text-[10px] font-semibold ml-1",Ze?"text-[#FF453A]":"text-[#32D74B]"),style:{fontFamily:"JetBrains Mono, monospace"},children:ye?qt:lt})]}):Dt.type==="soldEffortMinutes"?jsxRuntime.jsx("span",{className:u("text-[12px] font-bold",$?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:Ce>0?rt(Ce):"\u2013"}):Dt.type==="effortMinutes"?(()=>{if(ye&&Ce>0&&ge>0){let zt=Math.round(Ce/60*(P||25)),Xt=Math.round(ge/60*(P||25)),ba=zt-Xt,Nr=zt>0?Math.round(ba/zt*100):0;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:u("text-[12px] font-bold",$?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:rt(ge)}),jsxRuntime.jsxs("span",{className:u("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap",ba>=0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[ba>=0?"+":"",Math.abs(ba)>=1e3?`$${(ba/1e3).toFixed(1)}K`:`$${ba}`,jsxRuntime.jsxs("span",{className:"ml-0.5 opacity-60",children:["(",Nr,"%)"]})]})]})}return jsxRuntime.jsx("span",{className:u("text-[12px] font-bold",$?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:ge>0?rt(ge):"\u2013"})})():Dt.type==="timeLoggedMinutes"?jsxRuntime.jsx("span",{className:u("text-[12px] font-bold",$?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:F>0?rt(F):"\u2013"}):Dt.type==="progress"?(()=>{let zt=e||[],Xt=0,ba=0,Nr=0,ha=0;for(let ya of zt){let pr=ya.weight||Re.get(ya.id)||0,ia=ya.progress||0;pr>0&&(Xt+=ia*pr,ba+=pr),Nr+=ia,ha++;}let ir=ba>0?Math.round(Xt/ba*10)/10:ha>0?Math.round(Nr/ha):0;return jsxRuntime.jsxs("span",{className:u("text-[12px] font-bold font-mono",$?"text-[#00E5CC]":"text-cyan-600"),style:{fontFamily:"JetBrains Mono, monospace"},children:[ir,"%"]})})():Dt.type==="weight"?(()=>{let zt=e||[],Xt=[],ba=ya=>{for(let pr of ya)Xt.push(pr),pr.subtasks?.length&&ba(pr.subtasks);};ba(zt);let ha=Xt.filter(ya=>!ya.subtasks?.length||ya.subtasks.length===0).reduce((ya,pr)=>ya+(pr.weight||0),0),ir=Math.abs(ha-100)<.1;return jsxRuntime.jsxs("span",{className:u("text-[12px] font-bold font-mono",ir?$?"text-[#22C55E]":"text-green-600":"text-[#EF4444]"),style:{fontFamily:"JetBrains Mono, monospace"},children:[Number(ha.toFixed(1)),"%"]})})():jsxRuntime.jsx("span",{className:u("text-[11px]",$?"text-white/30":"text-gray-300"),children:"\u2013"})},Dt.id)),h&&jsxRuntime.jsx("div",{className:"w-12 flex-shrink-0"})]})})(),fa.length===0&&Me&&jsxRuntime.jsx("div",{className:"flex items-center justify-center py-12",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(lucideReact.List,{className:u("w-12 h-12 mx-auto mb-4",$?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("p",{className:u($?"text-white/60":"text-gray-600"),children:R.empty.noResults})]})})]})}),I?.enabled&&I.data&&K&&jsxRuntime.jsx(Gg,{data:I.data,isDark:$,locale:d,onClose:()=>be(false),lens:t?.lens})]}),jsxRuntime.jsx(Cg,{state:wt,onClose:U,isDark:$,locale:d,onTaskEdit:a.onTaskEdit,onTaskDuplicate:a.onTaskDuplicate,onTaskDelete:a.onTaskDelete,onTaskUpdate:a.onTaskUpdate,onColumnHide:Gt,onColumnSort:Ta,availableUsers:i,onOpenTimeLog:a.onOpenTimeLog,onReportBlocker:a.onReportBlocker,onCopyTaskLink:a.onCopyTaskLink,onTaskMove:a.onTaskMove,onTaskIndent:a.onTaskIndent,onTaskOutdent:a.onTaskOutdent}),ie&&ee&&je&&reactDom.createPortal(jsxRuntime.jsx("div",{style:{position:"fixed",left:ee.x+12,top:ee.y-10,zIndex:99999,pointerEvents:"none"},children:(()=>{let ge=De.flattenTasks(e).find(Ce=>Ce.id===je);return ge?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg",style:{backgroundColor:$?"rgba(10,10,10,0.9)":"rgba(255,255,255,0.95)",border:`1px solid ${$?"rgba(255,255,255,0.1)":"#e5e7eb"}`,backdropFilter:"blur(8px)",boxShadow:"0 4px 12px rgba(0,0,0,0.3)"},children:[jsxRuntime.jsx(lucideReact.GripVertical,{className:"w-3 h-3",style:{color:"#2E94FF"}}),jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:$?"#e6edf3":"#111827"},children:ge.name})]}):null})()}),document.body),jsxRuntime.jsx(Og,{isOpen:Bt,onClose:()=>ke(false),onSave:ra,isDark:$,locale:d})]})}var Jg=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:140,visible:true,sortable:true,resizable:true},{id:"priority",type:"priority",label:"Priority",width:100,visible:false,sortable:true,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true},{id:"tags",type:"tags",label:"Tags",width:150,visible:false,sortable:false,resizable:true},{id:"soldEffortMinutes",type:"soldEffortMinutes",label:"Quoted",width:100,visible:false,sortable:true,resizable:true},{id:"effortMinutes",type:"effortMinutes",label:"Estimated",width:100,visible:false,sortable:true,resizable:true},{id:"timeLoggedMinutes",type:"timeLoggedMinutes",label:"Executed",width:100,visible:false,sortable:true,resizable:true},{id:"scheduleVariance",type:"scheduleVariance",label:"Sched / Var",width:180,visible:false,sortable:true,resizable:true},{id:"hoursBar",type:"hoursBar",label:"Hours",width:200,visible:false,sortable:true,resizable:true},{id:"teamLoad",type:"teamLoad",label:"Team Load",width:160,visible:false,sortable:true,resizable:true},{id:"blockers",type:"blockers",label:"Blockers",width:150,visible:false,sortable:false,resizable:true},{id:"weight",type:"weight",label:"Weight",width:80,visible:false,sortable:true,resizable:true}],Qg=[{type:"name",labelKey:"columns.name",icon:"Type"},{type:"status",labelKey:"columns.status",icon:"CircleDot"},{type:"priority",labelKey:"columns.priority",icon:"Flag"},{type:"assignees",labelKey:"columns.assignees",icon:"Users"},{type:"startDate",labelKey:"columns.startDate",icon:"Calendar"},{type:"endDate",labelKey:"columns.endDate",icon:"CalendarCheck"},{type:"progress",labelKey:"columns.progress",icon:"BarChart"},{type:"tags",labelKey:"columns.tags",icon:"Tag"},{type:"effortMinutes",labelKey:"columns.effortMinutes",icon:"Clock"},{type:"timeLoggedMinutes",labelKey:"columns.timeLoggedMinutes",icon:"Timer"},{type:"soldEffortMinutes",labelKey:"columns.soldEffortMinutes",icon:"FileText"},{type:"scheduleVariance",labelKey:"columns.scheduleVariance",icon:"CalendarClock"},{type:"hoursBar",labelKey:"columns.hoursBar",icon:"BarChart3"},{type:"teamLoad",labelKey:"columns.teamLoad",icon:"Users"},{type:"blockers",labelKey:"columns.blockers",icon:"AlertTriangle"},{type:"weight",labelKey:"columns.weight",icon:"Scale"}],Zg=[{type:"text",labelKey:"customFields.text",icon:"Type"},{type:"number",labelKey:"customFields.number",icon:"Hash"},{type:"date",labelKey:"customFields.date",icon:"Calendar"},{type:"dropdown",labelKey:"customFields.dropdown",icon:"ChevronDown"},{type:"checkbox",labelKey:"customFields.checkbox",icon:"CheckSquare"}];var oc={bgPrimary:"#0D0D0D",bgSecondary:"#141414",bgHover:"rgba(255,255,255,0.05)",bgSelected:"#0D131E",bgAlternate:"#141414",border:"#222222",borderLight:"#1A1A1A",textPrimary:"rgba(255,255,255,0.9)",textSecondary:"rgba(255,255,255,0.6)",textMuted:"rgba(255,255,255,0.3)",accent:"#007BFF",accentHover:"#2979FF",accentLight:"rgba(0,123,255,0.15)",statusTodo:"rgba(255,255,255,0.4)",statusInProgress:"#007BFF",statusCompleted:"#34D399",focusRing:"#007BFF",checkboxBg:"#1A1A1A",checkboxChecked:"#007BFF",bgGroupHeader:"#222222",headerBg:"#1A1A1A",neonRed:"#FF2D20",neonGreen:"#3BF06E",neonAmber:"#FFD60A",neonBlue:"#3B9EFF"},nc={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgSelected:"#dbeafe",bgAlternate:"#f9fafb",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da",checkboxBg:"#ffffff",checkboxChecked:"#0969da",bgGroupHeader:"#F3F4F6",headerBg:"#F9FAFB",neonRed:"#DC2626",neonGreen:"#16A34A",neonAmber:"#D97706",neonBlue:"#2E94FF"},sc={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgSelected:"#0f4c7520",bgAlternate:"#1a1a2e80",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1",checkboxBg:"#1f3460",checkboxChecked:"#6366f1",bgGroupHeader:"#1f3460",headerBg:"#16213e",neonRed:"#EF4444",neonGreen:"#34D399",neonAmber:"#FBBF24",neonBlue:"#6366F1"},Ki={dark:oc,light:nc,neutral:sc};function e0(e){return Ki[e]||Ki.dark}var ic={navigation:{today:"Today",previous:"Previous",next:"Next",month:"Month",week:"Week",day:"Day"},weekdays:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weekdaysFull:{sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday"},months:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},labels:{allDay:"All day",moreEvents:"+{count} more",noEvents:"No tasks",newTask:"New Task",viewAll:"View all",week:"Week",backlogTitle:"BACKLOG / UNSCHEDULED",systemStatus:"SYSTEM STATUS",budgetUtil:"Budget Util.",variance:"VARIANCE",cost:"COST",estimate:"Est",sold:"Sold",cashOut:"Cash Out",typeToAdd:"Type to add (e.g., Crane Inspection)",critical:"CRITICAL",blocker:"Blocker",risk:"Risk",delay:"delay",days:"Days"},tooltips:{progress:"Progress",status:"Status",assignees:"Assignees",duration:"Duration",days:"days"}},lc={navigation:{today:"Hoy",previous:"Anterior",next:"Siguiente",month:"Mes",week:"Semana",day:"D\xEDa"},weekdays:{sun:"Dom",mon:"Lun",tue:"Mar",wed:"Mi\xE9",thu:"Jue",fri:"Vie",sat:"S\xE1b"},weekdaysFull:{sunday:"Domingo",monday:"Lunes",tuesday:"Martes",wednesday:"Mi\xE9rcoles",thursday:"Jueves",friday:"Viernes",saturday:"S\xE1bado"},months:{january:"Enero",february:"Febrero",march:"Marzo",april:"Abril",may:"Mayo",june:"Junio",july:"Julio",august:"Agosto",september:"Septiembre",october:"Octubre",november:"Noviembre",december:"Diciembre"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},labels:{allDay:"Todo el d\xEDa",moreEvents:"+{count} m\xE1s",noEvents:"Sin tareas",newTask:"Nueva Tarea",viewAll:"Ver todo",week:"Semana",backlogTitle:"BACKLOG / SIN FECHA",systemStatus:"ESTADO DEL SISTEMA",budgetUtil:"Util. Presupuesto",variance:"VARIANZA",cost:"COSTO",estimate:"Est",sold:"Vendido",cashOut:"Desembolso",typeToAdd:"Escribe para agregar (ej: Inspecci\xF3n)",critical:"CR\xCDTICO",blocker:"Bloqueador",risk:"Riesgo",delay:"retraso",days:"D\xEDas"},tooltips:{progress:"Progreso",status:"Estado",assignees:"Asignados",duration:"Duraci\xF3n",days:"d\xEDas"}},Yi={en:ic,es:lc};function Cs(e){return Yi[e]||Yi.en}function qi(e,t){let a=Cs(e);return t?{navigation:{...a.navigation,...t.navigation},weekdays:{...a.weekdays,...t.weekdays},weekdaysFull:{...a.weekdaysFull,...t.weekdaysFull},months:{...a.months,...t.months},status:{...a.status,...t.status},labels:{...a.labels,...t.labels},tooltips:{...a.tooltips,...t.tooltips}}:a}function t0(e){let t=Cs(e);return [t.months.january,t.months.february,t.months.march,t.months.april,t.months.may,t.months.june,t.months.july,t.months.august,t.months.september,t.months.october,t.months.november,t.months.december]}function a0(e,t=0,a=true){let r=Cs(e),o=a?[r.weekdays.sun,r.weekdays.mon,r.weekdays.tue,r.weekdays.wed,r.weekdays.thu,r.weekdays.fri,r.weekdays.sat]:[r.weekdaysFull.sunday,r.weekdaysFull.monday,r.weekdaysFull.tuesday,r.weekdaysFull.wednesday,r.weekdaysFull.thursday,r.weekdaysFull.friday,r.weekdaysFull.saturday];return [...o.slice(t),...o.slice(0,t)]}function Ns(e){let t=[];function a(r){for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);}return a(e),t}function cc(e,t){if(!t.startDate||!t.endDate)return false;let a=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(t.startDate.getFullYear(),t.startDate.getMonth(),t.startDate.getDate()),o=new Date(t.endDate.getFullYear(),t.endDate.getMonth(),t.endDate.getDate());return a>=r&&a<=o}function n0({task:e,isDark:t}){return e.progress===100||e.status==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-emerald-400 flex-shrink-0"}):e.progress&&e.progress>0||e.status==="in-progress"?jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-3 h-3 text-[#007FFF] flex-shrink-0"}):jsxRuntime.jsx(lucideReact.Circle,{className:u("w-3 h-3 flex-shrink-0",t?"text-white/40":"text-gray-400")})}var l0=26,fw=22,bw=10;function s0(e,t){let a=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate());return Math.round((a-r)/(1e3*60*60*24))}function uc(e,t="hours",a=0){if(!e||e<=0)return null;if(t==="financial"&&a>0){let o=Math.round(e/60*a);return o>=1e3?`$${(o/1e3).toFixed(1)}k`:`$${o}`}let r=Math.round(e/480);return r>0?`${r}d`:null}function d0(e,t="hours",a=0){if(e.soldEffortMinutes==null||e.effortMinutes==null)return null;let r=e.soldEffortMinutes-e.effortMinutes;if(r===0)return null;let o=r<0,s;if(t==="financial"&&a>0){let n=Math.round(Math.abs(r/60)*a);s=n>=1e3?`$${(n/1e3).toFixed(1)}k`:`$${n}`;}else {let n=Math.round(Math.abs(r)/60);s=n>=1e3?`$${(n/1e3).toFixed(1)}k`:`$${n}`;}return {text:`${o?"-":"+"}${s}`,isNegative:o}}function i0(e,t="hours",a=0){if(t==="financial"&&a>0){let o=Math.round(Math.abs(e/60)*a);return o>=1e3?`$${(o/1e3).toFixed(1)}k`:`$${o}`}let r=Math.round(Math.abs(e)/60);return r>=1e3?`$${(r/1e3).toFixed(1)}k`:`$${r}`}function hw({segment:e,isDark:t,onClick:a,blurFinancials:r,isSelected:o,t:s,lens:n="hours",hourlyRate:i=0}){let{task:c,spanCols:l,lane:m,isStart:d,isEnd:p}=e,g=c.progress===100||c.status==="completed",y=c.isCriticalPath,x=d&&p?"rounded":d?"rounded-l":p?"rounded-r":"",h=p?uc(c.effortMinutes,n,i):null,f=p?d0(c,n,i):null,b=p?c.blockers?.find(v=>v.severity==="critical"):null;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:v=>{v.stopPropagation(),a();},whileHover:{scale:1.005},className:u("absolute flex items-center gap-1.5 px-2 text-xs cursor-pointer overflow-hidden",x,g?t?"text-emerald-400":"bg-emerald-500/10 text-emerald-600 border border-emerald-200":y?t?"text-white/90":"bg-red-50 border border-red-200 text-red-700 hover:border-red-300":t?"text-white/90":"bg-gray-50 border border-gray-200 text-gray-700 hover:border-blue-300"),style:{top:`${m*l0}px`,left:"1px",width:`calc(${l*100}% - 2px)`,height:`${fw}px`,zIndex:10,...t?g?{background:"rgba(16, 185, 129, 0.28)",border:"1px solid rgba(16, 185, 129, 0.50)",boxShadow:"0 0 14px rgba(16, 185, 129, 0.2), inset 0 0 14px rgba(16, 185, 129, 0.1)"}:y?{background:"rgba(239, 68, 68, 0.35)",border:"1px solid rgba(239, 68, 68, 0.65)",boxShadow:"0 0 18px rgba(239, 68, 68, 0.3), inset 0 0 18px rgba(239, 68, 68, 0.15)"}:{background:"rgba(18, 100, 255, 0.38)",border:"1px solid rgba(18, 100, 255, 0.65)",boxShadow:"0 0 18px rgba(18, 100, 255, 0.28), inset 0 0 18px rgba(18, 100, 255, 0.14)"}:{},borderLeftWidth:d?"3px":void 0,borderLeftColor:d?y?"#EF4444":g?"#10B981":"#1264FF":void 0,...o?{boxShadow:t?"0 0 0 1.5px rgba(0, 229, 255, 0.7), 0 0 12px rgba(0, 229, 255, 0.3)":"0 0 0 1.5px rgba(59, 130, 246, 0.7), 0 0 12px rgba(59, 130, 246, 0.2)",zIndex:20}:{}},children:[y&&d&&jsxRuntime.jsxs("span",{className:"text-[9px] font-mono font-bold text-red-400 uppercase tracking-wider flex-shrink-0",children:[s.labels.critical,":"]}),jsxRuntime.jsx("span",{className:"truncate flex-1 text-left font-medium",children:c.name}),p&&(h||f)&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0 text-[9px] font-mono text-white/35 ml-1",children:[h&&jsxRuntime.jsxs("span",{children:[s.labels.estimate,": ",h]}),f&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"text-white/15",children:"|"}),jsxRuntime.jsx("span",{className:u(f.isNegative?"text-red-400":"text-emerald-400",r&&"blur-sm select-none"),children:f.text})]})]}),b&&jsxRuntime.jsxs("span",{className:"flex-shrink-0 text-[8px] font-mono px-1.5 py-0.5 rounded bg-red-500/20 text-red-400 border border-red-500/30 ml-1",children:[s.labels.blocker,": ",b.type]}),c.progress>0&&c.progress<100&&jsxRuntime.jsx("div",{className:"absolute bottom-0 left-0 h-[2px] bg-[#1264FF]",style:{width:`${c.progress}%`}})]})}function c0({tasks:e,config:t={},callbacks:a={},initialDate:r,isLoading:o=false,error:s,className:n,style:i,availableTags:c=[],onCreateTag:l,attachmentsByTask:m,comments:d,onAddComment:p,currentUser:g,mentionableUsers:y,onUploadCommentAttachments:x,onTaskOpen:h,enableTimeTracking:f,timeTrackingSummary:b,timeEntries:v,timerState:C,onLogTime:w,onUpdateEstimate:N,onUpdateSoldEffort:T,onStartTimer:k,onStopTimer:P,onDiscardTimer:O,blurFinancials:S=false,suppressDetailModal:J=false,lens:R="hours",hourlyRate:$=0}){let{theme:M="dark",locale:q="en",customTranslations:Z,showBacklog:Re=true}=t,I=qi(q,Z),K=M==="dark"||M==="neutral",[be,_e]=react.useState(r||new Date),[z,ae]=react.useState(null),[Q,Me]=react.useState(null),[we,Ie]=react.useState(null),[He,at]=react.useState({}),te=3,Qe=3,ce=react.useCallback(G=>{Me(G.id),J||ae(G),h?.(G.id);},[J,h]),[nt,bt]=react.useState(null),Bt=react.useCallback(()=>{_e(new Date(be.getFullYear(),be.getMonth()-1,1));},[be]),ke=react.useCallback(()=>{_e(new Date(be.getFullYear(),be.getMonth()+1,1));},[be]),wt=react.useCallback(()=>{_e(new Date);},[]),it=react.useMemo(()=>{let G=be.getFullYear(),ee=be.getMonth(),Ue=new Date(G,ee,1),Te=new Date(G,ee+1,0),Le=Ue.getDay(),Ee=Te.getDate(),qe=Ns(e),yt=new Date;yt.setHours(0,0,0,0);let pt=[],tt=Le,ot=new Date(G,ee,0).getDate();for(let $t=tt-1;$t>=0;$t--){let kt=new Date(G,ee-1,ot-$t);pt.push({date:kt,isCurrentMonth:false,isToday:false,isWeekend:kt.getDay()===0||kt.getDay()===6,events:qe.filter(Ct=>cc(kt,Ct)).map(Ct=>({id:Ct.id,title:Ct.name,start:Ct.startDate,end:Ct.endDate,task:Ct}))});}for(let $t=1;$t<=Ee;$t++){let kt=new Date(G,ee,$t),Ct=kt.getTime()===yt.getTime();pt.push({date:kt,isCurrentMonth:true,isToday:Ct,isWeekend:kt.getDay()===0||kt.getDay()===6,events:qe.filter(mt=>cc(kt,mt)).map(mt=>({id:mt.id,title:mt.name,start:mt.startDate,end:mt.endDate,task:mt}))});}let Ot=42-pt.length;for(let $t=1;$t<=Ot;$t++){let kt=new Date(G,ee+1,$t);pt.push({date:kt,isCurrentMonth:false,isToday:false,isWeekend:kt.getDay()===0||kt.getDay()===6,events:qe.filter(Ct=>cc(kt,Ct)).map(Ct=>({id:Ct.id,title:Ct.name,start:Ct.startDate,end:Ct.endDate,task:Ct}))});}return pt},[be,e]),je=react.useMemo(()=>Ns(e).filter(G=>!G.startDate||!G.endDate),[e]),H=react.useMemo(()=>{let G=Ns(e),ee=0,Ue=0,Te=0,Le=0,Ee=0;G.forEach(ot=>{ot.effortMinutes&&(ee+=ot.effortMinutes),ot.soldEffortMinutes&&(Ue+=ot.soldEffortMinutes),ot.scheduleVariance!=null&&(Te+=ot.scheduleVariance,Le++),ot.soldEffortMinutes&&ot.effortMinutes&&(Ee+=ot.soldEffortMinutes-ot.effortMinutes);});let qe=Ue>0?Math.min(100,Math.round(ee/Ue*100)):0,yt=Le>0?Math.round(Te/Le):0,tt=`${Ee<0?"-":"+"}${i0(Ee,R,$)}`;return {budgetUtil:qe,avgVariance:yt,costDisplay:tt,hasCostData:Ue>0}},[e,R,$]),ie=react.useMemo(()=>{let G=[0,0,0,0,0,0];return it.forEach((ee,Ue)=>{let Te=Math.floor(Ue/7);ee.events.forEach(Le=>{if(Le.task.startDate&&Le.task.soldEffortMinutes){let Ee=new Date(Le.task.startDate),qe=ee.date;Ee.getFullYear()===qe.getFullYear()&&Ee.getMonth()===qe.getMonth()&&Ee.getDate()===qe.getDate()&&Te<G.length&&(G[Te]-=Le.task.soldEffortMinutes);}});}),G},[it]),D=react.useMemo(()=>{let G=Ns(e),ee=new Map,Ue=new Set,Te=[0,0,0,0,0,0];if(it.length===0)return {segmentsByCell:ee,multiDayTaskIds:Ue,maxLanesPerRow:Te};let Le=tt=>new Date(tt.getFullYear(),tt.getMonth(),tt.getDate()),Ee=Le(it[0].date),qe=Le(it[it.length-1].date),yt=[];for(let tt of G){if(!tt.startDate||!tt.endDate)continue;let ot=Le(tt.startDate),Ot=Le(tt.endDate);if(ot.getTime()===Ot.getTime()||Ot<Ee||ot>qe)continue;let $t=ot<Ee?Ee:ot,kt=Ot>qe?qe:Ot,Ct=s0($t,Ee),mt=s0(kt,Ee);Ct<0||Ct>41||mt<0||mt>41||Ct!==mt&&(Ue.add(tt.id),yt.push({task:tt,startIdx:Ct,endIdx:mt}));}yt.sort((tt,ot)=>tt.startIdx!==ot.startIdx?tt.startIdx-ot.startIdx:ot.endIdx-ot.startIdx-(tt.endIdx-tt.startIdx));let pt=[[],[],[],[],[],[]];for(let{task:tt,startIdx:ot,endIdx:Ot}of yt){let $t=Math.floor(ot/7),kt=Math.floor(Ot/7),Ct=Le(tt.startDate),mt=Le(tt.endDate),At=false;for(let We=$t;We<=kt;We++){let Pe=We===$t?ot%7:0,gt=We===kt?Ot%7:6,oe=gt-Pe+1,fe=0,L=pt[We]??[];for(pt[We]||(pt[We]=L);fe<L.length&&(L[fe]??-1)>=Pe;)fe++;if(fe>=bw){At=true;break}fe>=L.length?L.push(gt):L[fe]=gt,Te[We]=Math.max(Te[We]??0,fe+1);let V=We===$t&&Ct>=Ee,Y=We===kt&&mt<=qe,ue=We*7+Pe,Ne={taskId:tt.id,task:tt,rowIndex:We,startCol:Pe,endCol:gt,spanCols:oe,lane:fe,isStart:V,isEnd:Y};ee.has(ue)||ee.set(ue,[]),ee.get(ue).push(Ne);}At&&(Ue.delete(tt.id),ee.forEach((We,Pe)=>{let gt=We.filter(oe=>oe.taskId!==tt.id);gt.length===0?ee.delete(Pe):ee.set(Pe,gt);}));}return {segmentsByCell:ee,multiDayTaskIds:Ue,maxLanesPerRow:Te}},[it,e]),j=q==="es"?["Dom","Lun","Mar","Mi\xE9","Jue","Vie","S\xE1b"]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],le=be.toLocaleDateString(q==="es"?"es-ES":"en-US",{month:"long",year:"numeric"}),he=le.charAt(0).toUpperCase()+le.slice(1);return o?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",K?"bg-[#050505]":"bg-white",n),style:i,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#007FFF]"}),jsxRuntime.jsxs("p",{className:u("text-sm font-mono",K?"text-white/30":"text-gray-600"),children:[I.labels.noEvents,"..."]})]})}):s?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",K?"bg-[#050505]":"bg-white",n),style:i,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsxRuntime.jsx("div",{className:u("w-12 h-12 rounded-full flex items-center justify-center",K?"bg-red-500/10 border border-red-500/20":"bg-red-500/10"),children:jsxRuntime.jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:u("text-lg font-semibold mb-2",K?"text-white/90":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:u("text-sm",K?"text-white/40":"text-gray-600"),children:typeof s=="string"?s:s.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",K?"bg-[#050505]":"bg-white",n),style:i,children:jsxRuntime.jsxs("div",{className:"text-center max-w-md",children:[jsxRuntime.jsx("div",{className:u("w-16 h-16 mx-auto mb-4 rounded-2xl flex items-center justify-center",K?"bg-[#007FFF]/10 border border-[#007FFF]/20":"bg-blue-500/10"),children:jsxRuntime.jsx(lucideReact.Calendar,{className:u("w-8 h-8",K?"text-[#007FFF]":"text-blue-500")})}),jsxRuntime.jsx("h3",{className:u("text-lg font-semibold mb-2",K?"text-white/90":"text-gray-900"),children:I.labels.noEvents}),jsxRuntime.jsx("p",{className:u("text-sm",K?"text-white/30":"text-gray-600"),children:I.labels.newTask})]})}):jsxRuntime.jsxs("div",{className:u("flex-1 flex flex-col w-full h-full overflow-hidden",K?"bg-[#050505]":"bg-white",n),style:i,children:[jsxRuntime.jsxs("div",{className:"flex flex-1 overflow-hidden relative",children:[jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col min-w-0 relative overflow-hidden",children:[jsxRuntime.jsxs("div",{className:u("flex-shrink-0 h-10 flex items-center justify-between px-4 z-20",K?"bg-[#050505] border-b border-[#222]":"bg-white border-b border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[jsxRuntime.jsxs("div",{className:u("flex items-center gap-1.5 pl-2.5 pr-2 py-1 rounded-md text-xs transition-all",K?"bg-[#111] border border-white/10":"bg-gray-100 border border-gray-200"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:u("w-3.5 h-3.5",K?"text-[#007FFF]":"text-blue-500")}),jsxRuntime.jsx("span",{className:u("font-medium",K?"text-white":"text-gray-900"),children:q==="es"?"Calendario":"Calendar"})]}),jsxRuntime.jsx("div",{className:u("h-4 w-px",K?"bg-white/10":"bg-gray-200")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 select-none",children:[jsxRuntime.jsx("button",{onClick:Bt,className:u("w-6 h-6 flex items-center justify-center rounded transition-colors",K?"text-white/50 hover:text-white hover:bg-white/5":"text-gray-500 hover:text-gray-900 hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("span",{className:u("text-sm font-semibold tracking-tight min-w-[150px] text-center",K?"text-white":"text-gray-900"),children:he}),jsxRuntime.jsx("button",{onClick:ke,className:u("w-6 h-6 flex items-center justify-center rounded transition-colors",K?"text-white/50 hover:text-white hover:bg-white/5":"text-gray-500 hover:text-gray-900 hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[t.toolbarRightContent&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t.toolbarRightContent,jsxRuntime.jsx("div",{className:u("h-4 w-px",K?"bg-white/10":"bg-gray-200")})]}),jsxRuntime.jsx("button",{onClick:wt,className:u("px-2.5 py-1 text-xs rounded-md transition-all font-medium",K?"bg-white/5 border border-white/10 text-white/70 hover:bg-white/10 hover:text-white":"bg-gray-100 border border-gray-200 text-gray-700 hover:bg-gray-200"),children:I.navigation.today})]})]}),jsxRuntime.jsx("div",{className:u("grid grid-cols-7 sticky top-0 z-10",K?"bg-[#050505] border-b border-[#222]":"bg-white border-b border-gray-200"),children:j.map(G=>jsxRuntime.jsx("div",{className:u("py-2 text-center text-[10px] font-bold uppercase tracking-widest",K?"text-white/60 font-mono":"text-gray-500"),children:G},G))}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto",children:jsxRuntime.jsx("div",{className:u("grid grid-cols-7 min-h-[800px]",K?"bg-[#050505]":"bg-white"),style:{gridAutoRows:"minmax(140px, auto)"},onClick:()=>Me(null),children:it.map((G,ee)=>{let Ue=ee%7===6,Te=ee>=35;return jsxRuntime.jsxs("div",{className:u("min-h-[140px] p-2 transition-colors flex flex-col relative group overflow-visible",!Ue&&(K?"border-r border-[#222]":"border-r border-gray-200"),!Te&&(K?"border-b border-[#222]":"border-b border-gray-200"),K?G.isCurrentMonth?"bg-[#050505] hover:bg-white/[0.02]":"bg-[#080808] opacity-50":G.isCurrentMonth?"bg-white hover:bg-gray-50":"bg-gray-50 opacity-50",G.isToday&&K&&"ring-1 ring-[#007FFF]/40 ring-inset bg-[#007FFF]/[0.03]",G.isToday&&!K&&"ring-2 ring-blue-500 ring-inset"),children:[jsxRuntime.jsx("span",{className:u("text-xs font-mono select-none relative z-20",G.isToday?K?"text-[#007FFF] font-bold":"text-blue-600 font-bold":G.isCurrentMonth?K?"text-white/60":"text-gray-900":K?"text-white/20":"text-gray-400"),children:String(G.date.getDate()).padStart(2,"0")}),(()=>{let Le=Math.floor(ee/7),Ee=(D.maxLanesPerRow[Le]??0)*l0,qe=D.segmentsByCell.get(ee);return Ee===0&&!qe?null:jsxRuntime.jsx("div",{className:"relative -mx-2 overflow-visible",style:{minHeight:`${Ee}px`,zIndex:5},children:qe?.map(yt=>jsxRuntime.jsx(hw,{segment:yt,isDark:K,blurFinancials:S,isSelected:Q===yt.taskId,t:I,lens:R,hourlyRate:$,onClick:()=>{ce(yt.task),a.onEventClick?.({id:yt.task.id,title:yt.task.name,start:yt.task.startDate,end:yt.task.endDate,task:yt.task});}},yt.taskId))})})(),(()=>{let Le=G.events.filter(Ee=>Ee.task.isMilestone&&!D.multiDayTaskIds.has(Ee.id));return Le.length===0?null:jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mt-0.5 px-0.5",children:[Le.slice(0,4).map(Ee=>jsxRuntime.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 flex-shrink-0 cursor-pointer",title:Ee.title,onClick:qe=>{qe.stopPropagation(),ce(Ee.task);}},Ee.id)),Le.length>4&&jsxRuntime.jsxs("span",{className:u("text-[8px] font-mono",K?"text-white/30":"text-gray-400"),children:["+",Le.length-4]})]})})(),(()=>{let Le=[];G.events.forEach(qe=>{qe.task.blockers?.forEach(yt=>{(yt.severity==="warning"||yt.severity==="critical")&&Le.push({taskId:qe.id,type:yt.type,severity:yt.severity,variance:qe.task.scheduleVariance});});});let Ee=Le[0];return Ee?jsxRuntime.jsx("div",{className:"mt-0.5 px-0.5",children:jsxRuntime.jsxs("div",{className:u("text-[8px] font-mono px-1.5 py-0.5 rounded flex items-center gap-1",Ee.severity==="critical"?"bg-red-500/15 text-red-400 border border-red-500/20":"bg-amber-500/15 text-amber-400 border border-amber-500/20"),children:[jsxRuntime.jsx("span",{children:"\u26A0"}),jsxRuntime.jsxs("span",{className:"truncate",children:[I.labels.risk,": ",Ee.type,Ee.variance?` (+${Math.abs(Ee.variance)}d ${I.labels.delay})`:""]})]})}):null})(),(()=>{let Le=G.events.filter(pt=>!D.multiDayTaskIds.has(pt.id)),Ee=He[ee]||te,qe=Le.slice(0,Ee),yt=Le.length-Ee;return jsxRuntime.jsxs("div",{className:"mt-1 space-y-0.5 flex-1",children:[qe.map(pt=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{ce(pt.task),a.onEventClick?.(pt);},whileHover:{scale:1.01},className:u("w-full flex items-center gap-1.5 px-1.5 py-1 rounded text-[11px] transition-all text-left",pt.task.progress===100||pt.task.status==="completed"?K?"text-emerald-400":"bg-emerald-500/10 text-emerald-600":K?"text-white/90":"bg-gray-50 border border-gray-200 text-gray-700 hover:border-blue-300"),style:K?pt.task.progress===100||pt.task.status==="completed"?{background:"rgba(16, 185, 129, 0.28)",border:"1px solid rgba(16, 185, 129, 0.50)",boxShadow:"0 0 14px rgba(16, 185, 129, 0.2), inset 0 0 14px rgba(16, 185, 129, 0.1)"}:pt.task.isCriticalPath?{background:"rgba(239, 68, 68, 0.35)",border:"1px solid rgba(239, 68, 68, 0.65)",boxShadow:"0 0 18px rgba(239, 68, 68, 0.3), inset 0 0 18px rgba(239, 68, 68, 0.15)"}:{background:"rgba(18, 100, 255, 0.38)",border:"1px solid rgba(18, 100, 255, 0.65)",boxShadow:"0 0 18px rgba(18, 100, 255, 0.28), inset 0 0 18px rgba(18, 100, 255, 0.14)"}:void 0,children:[jsxRuntime.jsx("span",{className:u("flex-shrink-0 text-[9px]",pt.task.isMilestone?K?"text-amber-400":"text-amber-600":pt.task.isCriticalPath?"text-red-400":K?"text-[#1264FF]":"text-gray-400"),children:pt.task.isMilestone?"\u25C6":"\u25CF"}),jsxRuntime.jsx("span",{className:"truncate flex-1",children:pt.title})]},pt.id)),yt>0&&jsxRuntime.jsxs("button",{onClick:pt=>{pt.stopPropagation(),at(tt=>({...tt,[ee]:Ee+Qe}));},className:u("text-[10px] px-1.5 py-0.5 cursor-pointer font-mono font-medium uppercase tracking-wide transition-all rounded",K?"text-white/25 hover:text-white/50 hover:bg-white/5":"text-gray-400 hover:text-gray-600"),children:["+",yt," ",q==="es"?"m\xE1s":"more"]}),Ee>te&&Le.length>te&&jsxRuntime.jsx("button",{onClick:pt=>{pt.stopPropagation(),at(tt=>({...tt,[ee]:te}));},className:u("text-[10px] px-1.5 py-0.5 cursor-pointer font-mono font-medium uppercase tracking-wide transition-all rounded",K?"text-white/25 hover:text-white/50 hover:bg-white/5":"text-gray-400 hover:text-gray-600"),children:q==="es"?"menos":"less"})]})})(),G.isCurrentMonth&&a.onTaskCreate&&jsxRuntime.jsx("div",{className:"flex items-center justify-end mt-1",children:(()=>{let Le=ee>=28,Ee=ee%7>=5;return jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:qe=>{qe.stopPropagation(),bt(nt===ee?null:ee);},className:u("w-5 h-5 rounded flex items-center justify-center transition-all",nt===ee?"opacity-100 bg-[#007FFF] text-white":"opacity-0 group-hover:opacity-100",K?"hover:bg-[#007FFF] text-white/30 hover:text-white":"hover:bg-blue-500 text-gray-400 hover:text-white"),children:jsxRuntime.jsx(lucideReact.Plus,{className:u("w-3.5 h-3.5 transition-transform",nt===ee&&"rotate-45")})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:nt===ee&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>bt(null)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:Le?-5:5,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:Le?-5:5,scale:.95},transition:{duration:.12},className:u("absolute w-[320px] rounded-lg shadow-2xl z-50",Le?"bottom-full mb-1":"top-full mt-1",Ee?"right-0":"left-0",K?"bg-[#0A0A0A]/95 backdrop-blur-xl border border-white/[0.08] shadow-[0_8px_32px_rgba(0,0,0,0.6)]":"bg-white border border-gray-200 shadow-xl"),children:jsxRuntime.jsx(qo,{onSubmit:qe=>{a.onTaskCreate?.({name:qe.name,startDate:qe.startDate||G.date,endDate:qe.endDate||G.date,priority:qe.priority,assignees:qe.assignee?[qe.assignee]:void 0}),bt(null);},onCancel:()=>bt(null),availableUsers:t.availableUsers,isDark:K,locale:q==="es"?"es":"en",defaultDate:G.date,dropdownDirection:Le?"up":"down"})})]})})]})})()}),ee%7===6&&(()=>{let Le=Math.floor(ee/7),Ee=ie[Le];if(!Ee||Ee===0)return null;let qe=i0(Ee,R,$);return jsxRuntime.jsxs("div",{className:u("absolute bottom-1 right-2 text-[9px] font-mono font-bold tabular-nums z-20",Ee<0?"text-red-400":"text-emerald-400",S&&"blur-sm select-none"),children:[I.labels.cashOut,": ",Ee<0?"-":"+",qe]})})()]},ee)})})})]}),Re&&jsxRuntime.jsxs("aside",{className:u("w-[280px] flex-shrink-0 flex flex-col overflow-hidden",K?"bg-[#050505] border-l border-[#222]":"bg-white border-l border-gray-200"),children:[jsxRuntime.jsxs("div",{className:u("flex-shrink-0 h-14 flex items-center justify-between px-4",K?"bg-[#080808] border-b border-[#222]":"bg-gray-50 border-b border-gray-200"),children:[jsxRuntime.jsx("span",{className:u("text-[10px] font-mono font-bold uppercase tracking-[0.2em]",K?"text-white/40":"text-gray-500"),children:I.labels.backlogTitle}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsx("span",{className:u("text-[10px] font-mono tabular-nums",K?"text-white/20":"text-gray-400"),children:je.length})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:je.length===0?jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[jsxRuntime.jsx("div",{className:u("w-10 h-10 rounded-xl flex items-center justify-center mb-3",K?"bg-white/5":"bg-gray-100"),children:jsxRuntime.jsx(lucideReact.Calendar,{className:u("w-5 h-5",K?"text-white/20":"text-gray-400")})}),jsxRuntime.jsx("p",{className:u("text-xs font-mono",K?"text-white/20":"text-gray-400"),children:q==="es"?"Sin tareas pendientes":"No unscheduled tasks"})]}):je.map(G=>jsxRuntime.jsxs("button",{onClick:()=>{ce(G);},className:u("w-full text-left rounded-md p-3 transition-all group/card",K?"bg-[#0A0A0A] border border-white/[0.05] hover:border-white/[0.12] hover:bg-[#0E0E0E]":"bg-white border border-gray-100 hover:border-gray-200 hover:shadow-sm"),children:[jsxRuntime.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[jsxRuntime.jsx("div",{className:u("w-1 h-1 rounded-full mt-1.5 flex-shrink-0",K?"bg-white/20":"bg-gray-300")}),jsxRuntime.jsx("span",{className:u("text-sm font-medium leading-snug line-clamp-2",K?"text-white/80 group-hover/card:text-white":"text-gray-800"),children:G.name})]}),G.tags&&G.tags.length>0&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-1 ml-3",children:[G.tags.slice(0,3).map(ee=>jsxRuntime.jsx("span",{className:"text-[9px] font-mono uppercase tracking-wider px-1.5 py-0.5 rounded",style:{backgroundColor:`${ee.color}15`,color:ee.color,border:`1px solid ${ee.color}30`},children:ee.name},ee.id)),G.tags.length>3&&jsxRuntime.jsxs("span",{className:u("text-[9px] font-mono px-1 py-0.5",K?"text-white/20":"text-gray-400"),children:["+",G.tags.length-3]})]}),(G.effortMinutes||G.soldEffortMinutes)&&jsxRuntime.jsxs("div",{className:u("flex items-center gap-2 mt-1.5 ml-3 text-[9px] font-mono",K?"text-white/25":"text-gray-400",S&&"blur-sm select-none"),children:[uc(G.effortMinutes,R,$)&&jsxRuntime.jsxs("span",{children:[I.labels.estimate,": ",uc(G.effortMinutes,R,$)]}),(()=>{let ee=d0(G,R,$);return ee?jsxRuntime.jsx("span",{className:ee.isNegative?"text-red-400":"text-emerald-400",children:ee.text}):null})()]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mt-2 ml-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[G.priority&&jsxRuntime.jsx(lucideReact.Flag,{className:u("w-3 h-3",G.priority==="urgent"||G.priority==="high"?"text-red-400":G.priority==="medium"?"text-yellow-400":"text-green-400")}),jsxRuntime.jsx(n0,{task:G,isDark:K})]}),G.assignees&&G.assignees.length>0&&jsxRuntime.jsx("div",{className:"flex -space-x-1",children:G.assignees.slice(0,2).map((ee,Ue)=>jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[8px] font-mono font-bold text-white ring-1 ring-[#050505]",style:{backgroundColor:ee.color||"#007FFF"},title:ee.name,children:ee.initials||ee.name?.slice(0,2).toUpperCase()},Ue))})]})]},G.id))}),a.onTaskCreate&&jsxRuntime.jsx("div",{className:u("flex-shrink-0 px-3 py-2.5 border-t",K?"border-[#222] bg-[#080808]":"border-gray-200 bg-gray-50"),children:jsxRuntime.jsx("input",{type:"text",placeholder:I.labels.typeToAdd,className:u("w-full text-[11px] font-mono bg-transparent outline-none",K?"text-white/70 placeholder:text-white/15":"text-gray-700 placeholder:text-gray-400"),onKeyDown:G=>{G.key==="Enter"&&G.target.value.trim()&&(a.onTaskCreate?.({name:G.target.value.trim()}),G.target.value="");}})}),H.hasCostData&&jsxRuntime.jsxs("div",{className:u("flex-shrink-0 px-4 py-3 border-t space-y-2.5",K?"border-[#222] bg-[#080808]":"border-gray-200 bg-gray-50"),children:[jsxRuntime.jsxs("div",{className:u("text-[10px] font-mono font-bold uppercase tracking-[0.2em]",K?"text-white/40":"text-gray-500"),children:["\u25C8 ",I.labels.systemStatus]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("span",{className:u("text-[10px] font-mono",K?"text-white/40":"text-gray-500"),children:I.labels.budgetUtil}),jsxRuntime.jsxs("span",{className:u("text-[10px] font-mono font-bold tabular-nums",K?"text-white/60":"text-gray-700",S&&"blur-sm select-none"),children:[H.budgetUtil,"%"]})]}),jsxRuntime.jsx("div",{className:u("h-1.5 rounded-full overflow-hidden",K?"bg-white/5":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${H.budgetUtil}%`,background:H.budgetUtil>90?"#EF4444":H.budgetUtil>70?"#F59E0B":"linear-gradient(to right, #2E94FF, #8B5CF6)"}})})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[jsxRuntime.jsxs("div",{className:u("rounded-md px-2 py-1.5 text-center",K?"bg-white/[0.03] border border-white/[0.06]":"bg-gray-100 border border-gray-200"),children:[jsxRuntime.jsx("div",{className:u("text-[8px] font-mono uppercase tracking-wider mb-0.5",K?"text-white/25":"text-gray-400"),children:I.labels.variance}),jsxRuntime.jsxs("div",{className:u("text-[11px] font-mono font-bold tabular-nums",H.avgVariance>0?"text-emerald-400":H.avgVariance<0?"text-red-400":K?"text-white/50":"text-gray-600"),children:[H.avgVariance>0?"+":"",H.avgVariance," ",I.labels.days]})]}),jsxRuntime.jsxs("div",{className:u("rounded-md px-2 py-1.5 text-center",K?"bg-white/[0.03] border border-white/[0.06]":"bg-gray-100 border border-gray-200"),children:[jsxRuntime.jsx("div",{className:u("text-[8px] font-mono uppercase tracking-wider mb-0.5",K?"text-white/25":"text-gray-400"),children:I.labels.cost}),jsxRuntime.jsx("div",{className:u("text-[11px] font-mono font-bold tabular-nums",H.costDisplay.startsWith("-")?"text-red-400":"text-emerald-400",S&&"blur-sm select-none"),children:H.costDisplay})]})]})]})]})]}),!J&&jsxRuntime.jsx(go,{task:z,isOpen:!!z,onClose:()=>ae(null),onTaskUpdate:G=>{a.onTaskUpdate?.(G),ae(G);},theme:M==="dark"?"dark":"light",locale:q,availableUsers:t.availableUsers?.map(G=>({id:G.id,name:G.name,avatar:G.avatar,initials:G.name?.slice(0,2).toUpperCase()||"U",color:"#8B5CF6"}))||[],availableTags:c,onCreateTag:l,attachments:z?m?.get(z.id)||[]:[],onUploadAttachments:a.onUploadAttachments,onDeleteAttachment:a.onDeleteAttachment,availableTasks:Ns(e).filter(G=>G.id!==z?.id),comments:d?.filter(G=>G.taskId===z?.id).map(G=>({...G,createdAt:G.createdAt instanceof Date?G.createdAt:new Date(G.createdAt),updatedAt:G.updatedAt instanceof Date?G.updatedAt:G.updatedAt?new Date(G.updatedAt):void 0})),onAddComment:p,currentUser:g,mentionableUsers:y,onUploadCommentAttachments:x,enableTimeTracking:f,timeTrackingSummary:b,timeEntries:v,isTimerRunning:C?.isRunning,timerElapsedSeconds:C?.elapsedSeconds,onTimeLog:w,onEstimateUpdate:N,onSoldEffortUpdate:T,onTimerStart:k,onTimerStop:P,onTimerDiscard:O,blurFinancials:S}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:we&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>Ie(null),className:"fixed inset-0 bg-black/50 z-40"}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},className:u("fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[320px] max-h-[400px] rounded-xl shadow-2xl z-50 overflow-hidden",K?"bg-[#0A0A0A]/95 backdrop-blur-xl border border-white/[0.08]":"bg-white border border-gray-200"),children:[jsxRuntime.jsxs("div",{className:u("px-4 py-3 border-b flex items-center justify-between",K?"border-white/[0.08] bg-[#080808]":"border-gray-200"),children:[jsxRuntime.jsx("span",{className:u("font-medium text-sm",K?"text-white/90":"text-gray-900"),children:we.date.toLocaleDateString(q==="es"?"es-ES":"en-US",{weekday:"long",month:"long",day:"numeric"})}),jsxRuntime.jsx("button",{onClick:()=>Ie(null),className:u("p-1 rounded",K?"hover:bg-white/10 text-white/40":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),jsxRuntime.jsx("div",{className:"p-3 max-h-[320px] overflow-y-auto space-y-1.5",children:we.events.map(G=>jsxRuntime.jsxs("button",{onClick:()=>{Ie(null),ce(G.task);},className:u("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors",K?"hover:bg-white/5 border border-white/5":"hover:bg-gray-50 border border-gray-100"),children:[jsxRuntime.jsx(n0,{task:G.task,isDark:K}),jsxRuntime.jsx("span",{className:u("text-sm truncate flex-1",K?"text-white/80":"text-gray-900"),children:G.title}),(G.task.priority==="high"||G.task.priority==="urgent")&&jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5 text-red-400"})]},G.id))})]})]})})]})}var pc={bgPrimary:"#050505",bgSecondary:"#080808",bgHover:"rgba(255, 255, 255, 0.02)",bgToday:"rgba(0, 127, 255, 0.08)",bgWeekend:"#050505",bgOtherMonth:"#080808",border:"#222222",borderLight:"#1a1a1a",textPrimary:"rgba(255, 255, 255, 0.90)",textSecondary:"rgba(255, 255, 255, 0.60)",textMuted:"rgba(255, 255, 255, 0.30)",textToday:"#007FFF",accent:"#007FFF",accentHover:"#3399FF",accentLight:"rgba(0, 127, 255, 0.15)",statusTodo:"rgba(255, 255, 255, 0.40)",statusInProgress:"#007FFF",statusCompleted:"#34D399",focusRing:"#007FFF",glass:"rgba(20, 20, 20, 0.6)",glassBorder:"rgba(255, 255, 255, 0.08)",glassHover:"rgba(255, 255, 255, 0.05)",neonRed:"#FF2E2E",glowBlue:"0 0 10px rgba(0, 127, 255, 0.3)",glowRed:"0 0 10px rgba(255, 46, 46, 0.4)"},mc={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgToday:"#dbeafe",bgWeekend:"#f9fafb",bgOtherMonth:"#f3f4f680",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",textToday:"#0969da",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da",glass:"rgba(255, 255, 255, 0.8)",glassBorder:"rgba(0, 0, 0, 0.08)",glassHover:"rgba(0, 0, 0, 0.04)",neonRed:"#DC2626",glowBlue:"0 0 10px rgba(0, 127, 255, 0.15)",glowRed:"0 0 10px rgba(220, 38, 38, 0.2)"},gc={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgToday:"#6366f120",bgWeekend:"#16213e80",bgOtherMonth:"#1a1a2e50",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",textToday:"#818cf8",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1",glass:"rgba(26, 26, 46, 0.6)",glassBorder:"rgba(255, 255, 255, 0.06)",glassHover:"rgba(255, 255, 255, 0.04)",neonRed:"#EF4444",glowBlue:"0 0 10px rgba(99, 102, 241, 0.3)",glowRed:"0 0 10px rgba(239, 68, 68, 0.3)"},Qi={dark:pc,light:mc,neutral:gc};function u0(e){return Qi[e]||Qi.dark}function xw({stack:e,cards:t,renderCard:a,onCardClick:r,onToggleExpand:o,onUnstack:s,onDeleteStack:n,className:i}){let[c,l]=react.useState(false),m=react.useMemo(()=>t.filter(g=>e.cardIds.includes(g.id)),[t,e.cardIds]),d=react.useMemo(()=>{let g=m.length,y=new Set(m.flatMap(f=>f.assignedUserIds||[])).size,x=m.map(f=>f.priority).filter(Boolean),h=new Set(m.flatMap(f=>f.labels||[])).size;return {totalCards:g,uniqueAssignees:y,priorities:x,labels:h}},[m]),p=()=>{o?.(e.id);};return jsxRuntime.jsxs("div",{className:u("card-stack",!e.isExpanded&&"card-stack-collapsed",i),onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),style:{"--stack-color":e.color||"var(--color-accent-primary)"},children:[jsxRuntime.jsxs("div",{className:"card-stack-header",onClick:p,children:[jsxRuntime.jsxs("div",{className:"card-stack-header-left",children:[jsxRuntime.jsx("button",{className:"card-stack-toggle","aria-label":e.isExpanded?"Collapse":"Expand",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:u("card-stack-chevron",e.isExpanded&&"expanded"),children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})})}),jsxRuntime.jsx("h3",{className:"card-stack-title",children:e.title}),jsxRuntime.jsx("div",{className:"card-stack-badge",children:d.totalCards}),jsxRuntime.jsxs("div",{className:"card-stack-strategy",children:[e.strategy==="ai-similarity"&&"\u2728 AI",e.strategy==="manual"&&"\u{1F464} Manual",e.strategy==="labels"&&"\u{1F3F7}\uFE0F Labels",e.strategy==="assignee"&&"\u{1F465} Assignee",e.strategy==="priority"&&"\u{1F3AF} Priority",e.strategy==="epic"&&"\u{1F4DA} Epic"]})]}),c&&jsxRuntime.jsx("div",{className:"card-stack-actions",children:jsxRuntime.jsx("button",{className:"card-stack-action",onClick:g=>{g.stopPropagation(),n?.(e.id);},"aria-label":"Delete stack",children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})})]}),!e.isExpanded&&jsxRuntime.jsxs("div",{className:"card-stack-summary",children:[jsxRuntime.jsxs("div",{className:"card-stack-summary-item",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),jsxRuntime.jsxs("span",{children:[d.uniqueAssignees," assignees"]})]}),d.labels>0&&jsxRuntime.jsxs("div",{className:"card-stack-summary-item",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),jsxRuntime.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsxRuntime.jsxs("span",{children:[d.labels," labels"]})]}),e.confidence&&jsxRuntime.jsx("div",{className:"card-stack-summary-item",children:jsxRuntime.jsxs("span",{className:"card-stack-confidence",children:[Math.round(e.confidence*100),"% match"]})})]}),e.isExpanded&&jsxRuntime.jsx("div",{className:"card-stack-content",children:m.length===0?jsxRuntime.jsxs("div",{className:"card-stack-empty",children:[jsxRuntime.jsx("p",{children:"No cards in this stack"}),jsxRuntime.jsx("span",{children:"Drag cards here or delete this stack"})]}):jsxRuntime.jsx("div",{className:"card-stack-cards",children:m.map(g=>jsxRuntime.jsxs("div",{className:"card-stack-card-wrapper",children:[a?jsxRuntime.jsx("div",{onClick:()=>r?.(g),children:a(g)}):jsxRuntime.jsxs("div",{className:"card-stack-default-card",onClick:()=>r?.(g),children:[jsxRuntime.jsx("h4",{children:g.title}),g.description&&jsxRuntime.jsxs("p",{children:[g.description.substring(0,100),"..."]})]}),jsxRuntime.jsx("button",{className:"card-stack-unstack-btn",onClick:y=>{y.stopPropagation(),s?.(e.id,g.id);},"aria-label":"Remove from stack",children:jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},g.id))})})]})}var m0={showIcons:true,showAvatars:true,groupByDay:true,useRelativeTime:true,compact:false};function Ss(e){switch(e.type){case "created":return "Created card";case "status_changed":return `Changed status from "${e.changes.status?.from}" to "${e.changes.status?.to}"`;case "assignee_changed":return "Changed assignee";case "priority_changed":return `Changed priority from ${e.changes.priority?.from} to ${e.changes.priority?.to}`;case "moved":return `Moved from ${e.metadata?.fromColumn||"unknown"} to ${e.metadata?.toColumn||"unknown"}`;case "title_updated":return "Updated title";case "description_updated":return "Updated description";case "dates_changed":return "Changed dates";case "labels_changed":return "Updated labels";case "dependency_added":return "Added dependency";case "dependency_removed":return "Removed dependency";case "comment_added":return "Added comment";case "archived":return "Archived card";case "restored":return "Restored card";default:return "Updated card"}}function Es(e){return {created:"\u2728",status_changed:"\u{1F504}",assignee_changed:"\u{1F464}",priority_changed:"\u{1F3AF}",moved:"\u27A1\uFE0F",title_updated:"\u270F\uFE0F",description_updated:"\u{1F4DD}",dates_changed:"\u{1F4C5}",labels_changed:"\u{1F3F7}\uFE0F",dependency_added:"\u{1F517}",dependency_removed:"\u26D3\uFE0F\u200D\u{1F4A5}",comment_added:"\u{1F4AC}",archived:"\u{1F4E6}",restored:"\u267B\uFE0F"}[e]||"\u{1F4CC}"}function g0(e){return {created:"#10b981",status_changed:"#3b82f6",assignee_changed:"#8b5cf6",priority_changed:"#f59e0b",moved:"#06b6d4",title_updated:"#6366f1",description_updated:"#6366f1",dates_changed:"#ec4899",labels_changed:"#14b8a6",dependency_added:"#a855f7",dependency_removed:"#ef4444",comment_added:"#84cc16",archived:"#6b7280",restored:"#10b981"}[e]||"#6b7280"}function f0({events:e,filter:t,onFilterChange:a,onClearFilter:r,onEventClick:o,selectedEventId:s,config:n,className:i}){let c=react.useMemo(()=>({...m0,...n}),[n]),[l,m]=react.useState(new Set),d=react.useRef(null),p=react.useMemo(()=>{if(!c.groupByDay)return [{date:null,events:e}];let b=new Map;return e.forEach(v=>{let C=v.timestamp.toISOString().split("T")[0],w=b.get(C);w?w.push(v):b.set(C,[v]);}),Array.from(b.entries()).sort((v,C)=>C[0].localeCompare(v[0])).map(([v,C])=>({date:new Date(v),events:C.sort((w,N)=>N.timestamp.getTime()-w.timestamp.getTime())}))},[e,c.groupByDay]),{uniqueUsers:g,uniqueTypes:y}=react.useMemo(()=>{let b=new Set,v=new Set;return e.forEach(C=>{b.add(C.userId),v.add(C.type);}),{uniqueUsers:Array.from(b),uniqueTypes:Array.from(v)}},[e]),x=b=>{m(v=>{let C=new Set(v);return C.has(b)?C.delete(b):C.add(b),C});},h=b=>{let C=new Date().getTime()-b.getTime(),w=Math.floor(C/6e4),N=Math.floor(C/36e5),T=Math.floor(C/864e5);return w<1?"just now":w<60?`${w}m ago`:N<24?`${N}h ago`:T<7?`${T}d ago`:b.toLocaleDateString()},f=react.useMemo(()=>{let b=0;return t.types&&t.types.length>0&&b++,t.users&&t.users.length>0&&b++,t.dateRange&&b++,t.searchTerm&&b++,b},[t]);return react.useEffect(()=>{if(s&&d.current){let b=d.current.querySelector(`[data-event-id="${s}"]`);b&&b.scrollIntoView({behavior:"smooth",block:"center"});}},[s]),e.length===0?jsxRuntime.jsxs("div",{className:u("history-timeline-empty",i),children:[jsxRuntime.jsx("div",{className:"history-timeline-empty-icon",children:"\u{1F4DC}"}),jsxRuntime.jsx("p",{className:"history-timeline-empty-text",children:"No history events yet"}),jsxRuntime.jsx("p",{className:"history-timeline-empty-subtext",children:"Changes to this card will appear here"})]}):jsxRuntime.jsxs("div",{className:u("history-timeline",c.compact&&"compact",i),children:[jsxRuntime.jsxs("div",{className:"history-timeline-filters",children:[jsxRuntime.jsxs("div",{className:"history-timeline-filter-group",children:[jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.types?.[0]||"",onChange:b=>{let v=b.target.value;a({...t,types:v?[v]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Events"}),y.map(b=>jsxRuntime.jsxs("option",{value:b,children:[Es(b)," ",b.replace("_"," ")]},b))]}),g.length>1&&jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.users?.[0]||"",onChange:b=>{let v=b.target.value;a({...t,users:v?[v]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Users"}),g.map(b=>jsxRuntime.jsx("option",{value:b,children:b},b))]}),jsxRuntime.jsx("input",{type:"text",className:"history-timeline-filter-search",placeholder:"Search history...",value:t.searchTerm||"",onChange:b=>a({...t,searchTerm:b.target.value})})]}),f>0&&jsxRuntime.jsxs("button",{className:"history-timeline-filter-clear",onClick:r,children:["Clear filters (",f,")"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-container",ref:d,children:p.map(b=>jsxRuntime.jsxs("div",{className:"history-timeline-group",children:[c.groupByDay&&b.date&&jsxRuntime.jsxs("div",{className:"history-timeline-day-header",children:[jsxRuntime.jsx("span",{className:"history-timeline-day-date",children:b.date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),jsxRuntime.jsxs("span",{className:"history-timeline-day-count",children:[b.events.length," events"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-events",children:b.events.map((v,C)=>{let w=l.has(v.id),N=s===v.id,T=g0(v.type);return jsxRuntime.jsxs("div",{"data-event-id":v.id,className:u("history-timeline-event",w&&"expanded",N&&"selected"),onClick:()=>o?.(v),children:[jsxRuntime.jsxs("div",{className:"history-timeline-line",children:[jsxRuntime.jsx("div",{className:"history-timeline-dot",style:{backgroundColor:T},children:c.showIcons&&jsxRuntime.jsx("span",{className:"history-timeline-dot-icon",children:Es(v.type)})}),C<b.events.length-1&&jsxRuntime.jsx("div",{className:"history-timeline-connector",style:{borderColor:T}})]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-content",children:[jsxRuntime.jsxs("div",{className:"history-timeline-event-header",children:[jsxRuntime.jsxs("div",{className:"history-timeline-event-header-left",children:[c.showAvatars&&v.userAvatar&&jsxRuntime.jsx("img",{src:v.userAvatar,alt:v.userName||v.userId,className:"history-timeline-event-avatar"}),jsxRuntime.jsxs("div",{className:"history-timeline-event-description",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-user",children:v.userName||v.userId}),jsxRuntime.jsx("span",{className:"history-timeline-event-action",children:Ss(v)})]})]}),jsxRuntime.jsx("div",{className:"history-timeline-event-time",children:c.useRelativeTime?h(v.timestamp):v.timestamp.toLocaleString()})]}),Object.keys(v.changes).length>0&&jsxRuntime.jsxs("button",{className:"history-timeline-event-toggle",onClick:k=>{k.stopPropagation(),x(v.id);},children:[w?"\u25BC":"\u25B6"," Show changes"]}),w&&jsxRuntime.jsxs("div",{className:"history-timeline-event-changes",children:[Object.entries(v.changes).map(([k,P])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-change",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-change-key",children:[k,":"]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-change-values",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-change-from",children:JSON.stringify(P.from)}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-arrow",children:"\u2192"}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-to",children:JSON.stringify(P.to)})]})]},k)),v.metadata&&Object.keys(v.metadata).length>0&&jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata",children:[jsxRuntime.jsx("div",{className:"history-timeline-event-metadata-title",children:"Additional Info:"}),Object.entries(v.metadata).map(([k,P])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata-item",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-metadata-key",children:[k,":"]}),jsxRuntime.jsx("span",{className:"history-timeline-event-metadata-value",children:JSON.stringify(P)})]},k))]})]})]})]},v.id)})})]},b.date?.toISOString()||"all"))})]})}function h0({replayState:e,events:t,onStartReplay:a,onStopReplay:r,onTogglePlayback:o,onPrevious:s,onNext:n,onGoToEvent:i,onSpeedChange:c,className:l}){let m=[.5,1,1.5,2,3],d=react.useMemo(()=>!e||t.length===0?null:t[e.currentIndex],[e,t]),p=react.useMemo(()=>!e||e.totalEvents===0?0:e.currentIndex/(e.totalEvents-1)*100,[e]);return t.length===0?jsxRuntime.jsxs("div",{className:u("history-replay-empty",l),children:[jsxRuntime.jsx("div",{className:"history-replay-empty-icon",children:"\u23F3"}),jsxRuntime.jsx("p",{className:"history-replay-empty-text",children:"No history to replay"})]}):e?jsxRuntime.jsxs("div",{className:u("history-replay",l),children:[jsxRuntime.jsxs("div",{className:"history-replay-current-event",children:[jsxRuntime.jsx("div",{className:"history-replay-event-icon",children:d&&Es(d.type)}),jsxRuntime.jsxs("div",{className:"history-replay-event-info",children:[jsxRuntime.jsx("div",{className:"history-replay-event-description",children:d&&Ss(d)}),jsxRuntime.jsxs("div",{className:"history-replay-event-meta",children:[jsxRuntime.jsxs("span",{className:"history-replay-event-index",children:["Event ",e.currentIndex+1," of ",e.totalEvents]}),jsxRuntime.jsx("span",{className:"history-replay-event-time",children:d&&d.timestamp.toLocaleString()})]})]})]}),jsxRuntime.jsxs("div",{className:"history-replay-progress-container",children:[jsxRuntime.jsx("input",{type:"range",className:"history-replay-progress-slider",min:"0",max:e.totalEvents-1,value:e.currentIndex,onChange:g=>i(parseInt(g.target.value))}),jsxRuntime.jsx("div",{className:"history-replay-progress-fill",style:{width:`${p}%`}}),jsxRuntime.jsx("div",{className:"history-replay-progress-markers",children:t.map((g,y)=>jsxRuntime.jsx("div",{className:u("history-replay-progress-marker",y===e.currentIndex&&"active"),style:{left:`${y/(e.totalEvents-1)*100}%`},onClick:()=>i(y),title:Ss(g)},g.id))})]}),jsxRuntime.jsxs("div",{className:"history-replay-controls",children:[jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:s,disabled:!e.canGoBack,title:"Previous event (\u2190)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"19 20 9 12 19 4 19 20"}),jsxRuntime.jsx("line",{x1:"5",y1:"19",x2:"5",y2:"5"})]})}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-control-play",onClick:o,title:e.isPlaying?"Pause (Space)":"Play (Space)",children:e.isPlaying?jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[jsxRuntime.jsx("rect",{x:"6",y:"4",width:"4",height:"16"}),jsxRuntime.jsx("rect",{x:"14",y:"4",width:"4",height:"16"})]}):jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})})}),jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:n,disabled:!e.canGoForward,title:"Next event (\u2192)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"5 4 15 12 5 20 5 4"}),jsxRuntime.jsx("line",{x1:"19",y1:"5",x2:"19",y2:"19"})]})}),jsxRuntime.jsxs("div",{className:"history-replay-speed",children:[jsxRuntime.jsx("label",{className:"history-replay-speed-label",children:"Speed:"}),jsxRuntime.jsx("div",{className:"history-replay-speed-buttons",children:m.map(g=>jsxRuntime.jsxs("button",{className:u("history-replay-speed-btn",e.speed===g&&"active"),onClick:()=>c(g),children:[g,"x"]},g))})]}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-stop",onClick:r,title:"Stop replay (Esc)",children:jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("rect",{x:"6",y:"6",width:"12",height:"12"})})})]}),jsxRuntime.jsxs("div",{className:"history-replay-shortcuts",children:[jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"Space"})," Play/Pause"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"\u2190"})," Previous"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"\u2192"})," Next"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"Esc"})," Stop"]})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview",children:[jsxRuntime.jsxs("div",{className:"history-replay-card-preview-header",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-title",children:"Card State at This Point"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-time",children:d&&d.timestamp.toLocaleDateString()})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview-content",children:[jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Title:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.title})]}),e.cardState.description&&jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Description:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.description})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Priority:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.priority||"None"})]}),e.cardState.labels&&e.cardState.labels.length>0&&jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Labels:"}),jsxRuntime.jsx("div",{className:"history-replay-card-preview-labels",children:e.cardState.labels.map(g=>jsxRuntime.jsx("span",{className:"history-replay-card-preview-label-tag",children:g},g))})]})]})]})]}):jsxRuntime.jsxs("div",{className:u("history-replay-start",l),children:[jsxRuntime.jsxs("button",{className:"history-replay-start-button",onClick:a,children:[jsxRuntime.jsx("svg",{className:"history-replay-start-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),jsxRuntime.jsx("span",{children:"Start Time Travel"})]}),jsxRuntime.jsxs("p",{className:"history-replay-start-hint",children:["Replay ",t.length," events from this card's history"]})]})}function fc(e){return {blocks:"#ef4444",blocked_by:"#dc2626",depends_on:"#f59e0b",required_by:"#d97706",relates_to:"#6b7280",duplicates:"#8b5cf6",parent_of:"#3b82f6",child_of:"#2563eb",similar_to:"#10b981"}[e]||"#6b7280"}function bc(e){return {blocks:"Blocks",blocked_by:"Blocked by",depends_on:"Depends on",required_by:"Required by",relates_to:"Relates to",duplicates:"Duplicates",parent_of:"Parent of",child_of:"Child of",similar_to:"Similar to"}[e]||e}function y0(e){return {blocks:"\u{1F6AB}",blocked_by:"\u26D4",depends_on:"\u{1F517}",required_by:"\u{1F4CC}",relates_to:"\u{1F504}",duplicates:"\u{1F4CB}",parent_of:"\u{1F4C2}",child_of:"\u{1F4C4}",similar_to:"\u{1F50D}"}[e]||"\u{1F517}"}function x0(e){return ["blocks","blocked_by","depends_on","required_by","parent_of","child_of"].includes(e)}function Nw(e,t,a,r,o,s=100){let n=e.map(c=>({...c,x:c.x??a/2+Math.random()*100-50,y:c.y??r/2+Math.random()*100-50,vx:0,vy:0})),i=new Map(n.map(c=>[c.id,c]));for(let c=0;c<s;c++){let l=1-c/s;n.forEach(m=>{let d=a/2,p=r/2;m.vx+=(d-m.x)*o.centerForce*l,m.vy+=(p-m.y)*o.centerForce*l,n.forEach(g=>{if(m.id===g.id)return;let y=m.x-g.x,x=m.y-g.y,h=Math.sqrt(y*y+x*x)||1,f=o.chargeStrength*l/(h*h);m.vx+=y/h*f,m.vy+=x/h*f;});}),t.forEach(m=>{let d=i.get(typeof m.source=="string"?m.source:m.source.id),p=i.get(typeof m.target=="string"?m.target:m.target.id);if(!d||!p)return;let g=p.x-d.x,y=p.y-d.y,x=Math.sqrt(g*g+y*y)||1,h=(x-o.linkDistance)/x*o.forceStrength*l;d.vx+=g*h,d.vy+=y*h,p.vx-=g*h,p.vy-=y*h;}),n.forEach(m=>{m.fx!==null&&m.fx!==void 0?(m.x=m.fx,m.vx=0):m.x+=m.vx,m.fy!==null&&m.fy!==void 0?(m.y=m.fy,m.vy=0):m.y+=m.vy,m.x=Math.max(o.nodeSize,Math.min(a-o.nodeSize,m.x)),m.y=Math.max(o.nodeSize,Math.min(r-o.nodeSize,m.y)),m.vx*=.9,m.vy*=.9;});}return n}function v0({nodes:e,edges:t,config:a,filter:r,onFilterChange:o,criticalPath:s,stats:n,onInteraction:i,className:c}){let l=react.useRef(null),[m,d]=react.useState([]),[p,g]=react.useState(null),[y,x]=react.useState(null),[h,f]=react.useState(null),[b,v]=react.useState(1),[C,w]=react.useState({x:0,y:0});react.useEffect(()=>{if(e.length===0)return;let R=Nw(e,t,a.width,a.height,a,150);d(R);},[e,t,a]);let N=react.useCallback((R,$)=>{a.enableDragging&&($.stopPropagation(),g(R));},[a.enableDragging]),T=react.useCallback(R=>{if(!p||!l.current)return;let M=l.current.getBoundingClientRect(),q=(R.clientX-M.left-C.x)/b,Z=(R.clientY-M.top-C.y)/b;d(Re=>Re.map(I=>I.id===p?{...I,x:q,y:Z,fx:q,fy:Z}:I));},[p,b,C]),k=react.useCallback(()=>{g(null);},[]),P=react.useCallback((R,$)=>{$.stopPropagation(),i?.({type:"node-click",node:R,position:{x:$.clientX,y:$.clientY}});},[i]),O=react.useCallback((R,$)=>{$.stopPropagation(),i?.({type:"edge-click",edge:R,position:{x:$.clientX,y:$.clientY}});},[i]),S=react.useCallback(R=>{let $=m.find(M=>M.id===R);return $?{x:$.x,y:$.y}:{x:0,y:0}},[m]),J=react.useCallback(R=>{if(R.onCriticalPath)return "#ef4444";switch(a.colorScheme){case "status":return R.card.columnId==="done"?"#10b981":"#3b82f6";case "priority":let $=R.card.priority;return $==="URGENT"?"#ef4444":$==="HIGH"?"#f59e0b":$==="MEDIUM"?"#3b82f6":"#6b7280";case "assignee":return R.card.assigneeId?"#8b5cf6":"#6b7280";default:return "#3b82f6"}},[a.colorScheme]);return e.length===0?jsxRuntime.jsxs("div",{className:u("relationships-graph-empty",c),children:[jsxRuntime.jsx("div",{className:"relationships-graph-empty-icon",children:"\u{1F517}"}),jsxRuntime.jsx("p",{className:"relationships-graph-empty-text",children:"No relationships to display"}),jsxRuntime.jsx("p",{className:"relationships-graph-empty-subtext",children:"Add relationships between cards to see the graph"})]}):jsxRuntime.jsxs("div",{className:u("relationships-graph",c),children:[jsxRuntime.jsxs("div",{className:"relationships-graph-controls",children:[jsxRuntime.jsxs("div",{className:"relationships-graph-stats",children:[jsxRuntime.jsxs("span",{className:"relationships-graph-stat",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:n.totalNodes}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Cards"})]}),jsxRuntime.jsxs("span",{className:"relationships-graph-stat",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:n.totalEdges}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Relations"})]}),s&&jsxRuntime.jsxs("span",{className:"relationships-graph-stat relationships-graph-stat-critical",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:s.cardIds.length}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Critical Path"})]})]}),a.enableZoom&&jsxRuntime.jsxs("div",{className:"relationships-graph-zoom-controls",children:[jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>v(R=>Math.min(R+.2,3)),children:"+"}),jsxRuntime.jsxs("span",{className:"relationships-graph-zoom-value",children:[Math.round(b*100),"%"]}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>v(R=>Math.max(R-.2,.5)),children:"\u2212"}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>{v(1),w({x:0,y:0});},children:"Reset"})]})]}),jsxRuntime.jsx("div",{className:"relationships-graph-legend",children:Array.from(new Set(t.map(R=>R.type))).map(R=>jsxRuntime.jsxs("div",{className:"relationships-graph-legend-item",children:[jsxRuntime.jsx("div",{className:"relationships-graph-legend-color",style:{background:fc(R)}}),jsxRuntime.jsxs("span",{className:"relationships-graph-legend-label",children:[y0(R)," ",bc(R)]})]},R))}),jsxRuntime.jsxs("svg",{ref:l,className:"relationships-graph-canvas",width:a.width,height:a.height,onMouseMove:T,onMouseUp:k,onMouseLeave:k,children:[jsxRuntime.jsxs("g",{transform:`translate(${C.x}, ${C.y}) scale(${b})`,children:[jsxRuntime.jsx("g",{className:"relationships-graph-edges",children:t.map(R=>{let $=S(typeof R.source=="string"?R.source:R.source.id),M=S(typeof R.target=="string"?R.target:R.target.id),q=x0(R.type),Z=h===R.id,Re=R.onCriticalPath;return jsxRuntime.jsxs("g",{className:u("relationships-graph-edge",Z&&"hovered",Re&&"critical"),onMouseEnter:()=>f(R.id),onMouseLeave:()=>f(null),onClick:I=>O(R,I),children:[jsxRuntime.jsx("line",{x1:$.x,y1:$.y,x2:M.x,y2:M.y,stroke:fc(R.type),strokeWidth:Re?a.edgeWidth*2:a.edgeWidth,strokeOpacity:Z?1:.6,markerEnd:q?"url(#arrowhead)":void 0}),a.showEdgeLabels&&Z&&jsxRuntime.jsx("text",{x:($.x+M.x)/2,y:($.y+M.y)/2,className:"relationships-graph-edge-label",textAnchor:"middle",children:bc(R.type)})]},R.id)})}),jsxRuntime.jsx("g",{className:"relationships-graph-nodes",children:m.map(R=>{let $=y===R.id,M=R.onCriticalPath;return jsxRuntime.jsxs("g",{className:u("relationships-graph-node",$&&"hovered",M&&"critical"),transform:`translate(${R.x}, ${R.y})`,onMouseDown:q=>N(R.id,q),onMouseEnter:()=>x(R.id),onMouseLeave:()=>x(null),onClick:q=>P(R,q),children:[jsxRuntime.jsx("circle",{r:M?a.nodeSize*1.2:a.nodeSize,fill:J(R),stroke:M?"#fbbf24":"#ffffff",strokeWidth:M?3:2,opacity:$?1:.9}),a.showLabels&&jsxRuntime.jsx("text",{y:a.nodeSize+20,className:"relationships-graph-node-label",textAnchor:"middle",children:R.card.title.length>20?R.card.title.substring(0,20)+"...":R.card.title})]},R.id)})})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"10",refX:"9",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:jsxRuntime.jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:"#6b7280"})})})]})]})}function C0({isOpen:e,onClose:t,onPlanGenerated:a,onGeneratePlan:r,isLoading:o}){let[s,n]=react.useState(""),[i,c]=react.useState(false),[l,m]=react.useState(null),[d,p]=react.useState(null),g=react.useRef(null),y=i||o;react.useEffect(()=>{e&&g.current&&g.current.focus();},[e]),react.useEffect(()=>{let b=v=>{v.key==="Escape"&&!y&&x();};if(e)return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,y]);let x=()=>{y||(n(""),m(null),p(null),t());},h=async()=>{if(!(!s.trim()||y)){c(true),m(null),p(null);try{let b=await r(s.trim());p(b);}catch(b){m(b instanceof Error?b.message:"Failed to generate plan");}finally{c(false);}}},f=()=>{d&&(a(d),x());};return e?jsxRuntime.jsxs(Kt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:x}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-2xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:b=>b.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Generate Project Plan with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete Kanban board"})]}),jsxRuntime.jsx("button",{onClick:x,disabled:y,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:d?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Plan Generated Successfully!"})]}),d.explanation&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-blue-500/10 border border-blue-500/30",children:jsxRuntime.jsx("p",{className:"text-sm text-white/90",children:d.explanation})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Columns (",d.columns.length,")"]}),jsxRuntime.jsx("div",{className:"flex gap-2 flex-wrap",children:d.columns.map((b,v)=>jsxRuntime.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-white/5 border border-white/20 text-sm text-white/80",children:b.title},v))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Tasks (",d.cards.length,")"]}),jsxRuntime.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[d.cards.slice(0,10).map((b,v)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:b.title}),b.description&&jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-1 line-clamp-2",children:b.description})]}),b.priority&&jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${b.priority==="URGENT"?"bg-red-500/20 text-red-400":b.priority==="HIGH"?"bg-orange-500/20 text-orange-400":b.priority==="MEDIUM"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:b.priority})]})},v)),d.cards.length>10&&jsxRuntime.jsxs("p",{className:"text-xs text-white/50 text-center py-2",children:["+",d.cards.length-10," more tasks..."]})]})]})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description"}),jsxRuntime.jsx("textarea",{ref:g,value:s,onChange:b=>n(b.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:y}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),l&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:l}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((b,v)=>jsxRuntime.jsx("button",{onClick:()=>n(b),disabled:y,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:b},v))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:y&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:x,disabled:y,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),d?jsxRuntime.jsx("button",{onClick:f,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Plan to Board"}):jsxRuntime.jsx("button",{onClick:h,disabled:!s.trim()||y,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #2E94FF 0%, #2E94FF 100%)",color:"#ffffff"},children:y?"Generating...":"Generate Plan"})]})]})]})})]}):null}var hc={"gpt-4-turbo":{provider:"openai",name:"GPT-4 Turbo",contextWindow:128e3,costPer1kInput:.01,costPer1kOutput:.03,supportsVision:true,supportsJSON:true},"gpt-4":{provider:"openai",name:"GPT-4",contextWindow:8192,costPer1kInput:.03,costPer1kOutput:.06,supportsVision:false,supportsJSON:true},"gpt-3.5-turbo":{provider:"openai",name:"GPT-3.5 Turbo",contextWindow:16385,costPer1kInput:5e-4,costPer1kOutput:.0015,supportsVision:false,supportsJSON:true},"claude-3-5-sonnet-20241022":{provider:"anthropic",name:"Claude 3.5 Sonnet",contextWindow:2e5,costPer1kInput:.003,costPer1kOutput:.015,supportsVision:true,supportsJSON:true},"claude-3-opus-20240229":{provider:"anthropic",name:"Claude 3 Opus",contextWindow:2e5,costPer1kInput:.015,costPer1kOutput:.075,supportsVision:true,supportsJSON:true},"claude-3-haiku-20240307":{provider:"anthropic",name:"Claude 3 Haiku",contextWindow:2e5,costPer1kInput:25e-5,costPer1kOutput:.00125,supportsVision:true,supportsJSON:true}};var Sw={hobby:{requestsPerMonth:50,maxConcurrent:1,maxTokensPerRequest:4096},pro:{requestsPerMonth:500,maxConcurrent:3,maxTokensPerRequest:8192},enterprise:{requestsPerMonth:2e3,maxConcurrent:10,maxTokensPerRequest:16384}},Ew={generatePlan:{enabled:true,minPlanTier:"hobby",estimatedTokens:2e3},predictRisks:{enabled:true,minPlanTier:"pro",estimatedTokens:1500},suggestAssignee:{enabled:true,minPlanTier:"hobby",estimatedTokens:800},generateReport:{enabled:true,minPlanTier:"enterprise",estimatedTokens:3e3},generateSubtasks:{enabled:true,minPlanTier:"hobby",estimatedTokens:1e3}};function Mw(e,t,a){let r=hc[e];if(!r)throw new Error(`Unknown model: ${e}`);let o=t/1e3*r.costPer1kInput,s=a/1e3*r.costPer1kOutput;return o+s}function Ms(e){return `$${e.toFixed(4)}`}var yc=class{constructor(){this.operations=[];this.listeners=[];}record(t){let a=Mw(t.model,t.inputTokens,t.outputTokens),r={...t,id:`op_${Date.now()}_${Math.random().toString(36).substring(7)}`,timestamp:new Date,cost:a};return this.operations.push(r),this.listeners.forEach(o=>o(r)),this.operations.length>1e3&&(this.operations=this.operations.slice(-1e3)),r}getStats(t){let a=this.operations;t&&(a=a.filter(d=>d.timestamp>=t.start&&d.timestamp<=t.end));let r=a.length,o=a.reduce((d,p)=>d+p.cost,0),s=a.reduce((d,p)=>d+p.inputTokens,0),n=a.reduce((d,p)=>d+p.outputTokens,0),i=a.filter(d=>d.success),c=a.reduce((d,p)=>d+p.duration,0),l={},m={};return a.forEach(d=>{l[d.feature]=(l[d.feature]||0)+1,m[d.feature]=(m[d.feature]||0)+d.cost;}),{totalOperations:r,totalCost:o,totalInputTokens:s,totalOutputTokens:n,operationsByFeature:l,costsByFeature:m,averageDuration:r>0?c/r:0,successRate:r>0?i.length/r:0}}getRecentOperations(t=10){return this.operations.slice(-t).reverse()}checkLimit(t,a="month"){let o={hobby:{month:50,day:5},pro:{month:500,day:50},enterprise:{month:2e3,day:200}}[t][a],s=new Date,n=new Date;a==="month"?n.setMonth(s.getMonth()-1):n.setDate(s.getDate()-1);let i=this.operations.filter(m=>m.timestamp>=n).length,c=Math.max(0,o-i),l=i/o*100;return {used:i,limit:o,remaining:c,percentUsed:l,isExceeded:i>=o}}subscribe(t){return this.listeners.push(t),()=>{let a=this.listeners.indexOf(t);a>-1&&this.listeners.splice(a,1);}}clear(){this.operations=[];}export(){return JSON.stringify(this.operations,null,2)}},nn=new yc;function D0({isOpen:e,onClose:t,planTier:a="hobby"}){let[r,o]=react.useState(nn.getStats()),[s,n]=react.useState(nn.checkLimit(a));if(react.useEffect(()=>{if(!e)return;let c=setInterval(()=>{o(nn.getStats()),n(nn.checkLimit(a));},1e3);return ()=>clearInterval(c)},[e,a]),react.useEffect(()=>{let c=l=>{l.key==="Escape"&&t();};if(e)return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[e,t]),!e)return null;let i=nn.getRecentOperations(5);return jsxRuntime.jsxs(Kt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:t}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:c=>c.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-white",children:"AI Usage Dashboard"}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Monitor your AI consumption and costs"})]}),jsxRuntime.jsx("button",{onClick:t,className:"text-white/60 hover:text-white transition-colors",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[jsxRuntime.jsxs("div",{className:"p-4 rounded-xl bg-gradient-to-r from-blue-500/10 to-purple-500/10 border border-blue-500/30",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsxs("span",{className:"text-sm font-semibold text-white/90",children:["Monthly Usage (",a.toUpperCase(),")"]}),jsxRuntime.jsxs("span",{className:"text-sm font-bold text-white",children:[s.used," / ",s.limit]})]}),jsxRuntime.jsx("div",{className:"w-full h-2 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full transition-all",style:{width:`${Math.min(100,s.percentUsed)}%`,background:s.percentUsed>90?"#EF4444":s.percentUsed>70?"#F59E0B":"#10B981"}})}),jsxRuntime.jsxs("p",{className:"text-xs text-white/60 mt-2",children:[s.remaining," operations remaining this month"]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Total Cost"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-green-400 mt-1",children:Ms(r.totalCost)})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Operations"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-400 mt-1",children:r.totalOperations})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Tokens Used"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-400 mt-1",children:(r.totalInputTokens+r.totalOutputTokens).toLocaleString()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:[r.totalInputTokens.toLocaleString()," in /"," ",r.totalOutputTokens.toLocaleString()," out"]})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Success Rate"}),jsxRuntime.jsxs("p",{className:"text-2xl font-bold text-green-400 mt-1",children:[(r.successRate*100).toFixed(1),"%"]}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:["Avg: ",r.averageDuration.toFixed(0),"ms"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Usage by Feature"}),jsxRuntime.jsx("div",{className:"space-y-2",children:Object.entries(r.operationsByFeature).map(([c,l])=>{let m=r.costsByFeature[c]||0,d=r.totalOperations>0?l/r.totalOperations*100:0;return jsxRuntime.jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-white/90 capitalize",children:c.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[l," ops"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Ms(m)})]})]}),jsxRuntime.jsx("div",{className:"w-full h-1.5 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full bg-blue-500",style:{width:`${d}%`}})})]},c)})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Recent Operations"}),i.length===0?jsxRuntime.jsx("p",{className:"text-sm text-white/50 text-center py-8",children:"No operations yet. Start using AI features!"}):jsxRuntime.jsx("div",{className:"space-y-2",children:i.map(c=>jsxRuntime.jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90 capitalize",children:c.feature.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-0.5",children:[new Date(c.timestamp).toLocaleTimeString()," \u2022"," ",c.duration,"ms"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[c.inputTokens+c.outputTokens," tokens"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Ms(c.cost)}),jsxRuntime.jsx("div",{className:`w-2 h-2 rounded-full ${c.success?"bg-green-400":"bg-red-400"}`})]})]},c.id))})]})]}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("p",{className:"text-xs text-white/50",children:"Costs are estimates. Actual API charges may vary."}),jsxRuntime.jsx("button",{onClick:t,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80",children:"Close"})]})]})})]})}function M0({isOpen:e,onClose:t,onTasksGenerated:a,onGenerateTasks:r,isLoading:o,projectName:s}){let[n,i]=react.useState(""),[c,l]=react.useState(""),[m,d]=react.useState(""),[p,g]=react.useState(false),[y,x]=react.useState(null),[h,f]=react.useState(null),[b,v]=react.useState(null),C=react.useRef(null),w=p||o;react.useEffect(()=>{e&&C.current&&C.current.focus();},[e]),react.useEffect(()=>{let O=S=>{S.key==="Escape"&&!w&&N();};if(e)return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[e,w]);let N=()=>{w||(i(""),l(""),d(""),x(null),f(null),v(null),t());},T=async()=>{if(!(!n.trim()||w)){g(true),x(null),f(null),v(null);try{let O=await r({prompt:n.trim(),projectName:s||"Mi Proyecto",startDate:c||void 0,endDate:m||void 0});f(O.tasks.tasks),v({from_cache:O.from_cache,tokens_used:O.tokens_used,mock_mode:O.mock_mode,similarity:O.similarity,tokens_saved:O.tokens_saved});}catch(O){x(O instanceof Error?O.message:"Failed to generate tasks");}finally{g(false);}}},k=()=>{h&&(a(h),N());};if(!e)return null;let P=b?.similarity?((b.similarity||0)*100).toFixed(0):"0";return jsxRuntime.jsxs(Kt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:N}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:O=>O.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"9",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"14",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"19",width:"18",height:"2",rx:"1",fill:"currentColor"})]}),"Generate Gantt Tasks with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete task timeline"})]}),jsxRuntime.jsx("button",{onClick:N,disabled:w,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:h?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Tasks Generated Successfully!"})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[b?.mock_mode&&jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",children:"Mock Mode"}),b?.from_cache?jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-blue-500/20 text-blue-400 border border-blue-500/30",children:["From Cache (",P,"% similar)"]}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-green-500/20 text-green-400 border border-green-500/30",children:"AI Generated"}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-purple-500/20 text-purple-400 border border-purple-500/30",children:[b?.tokens_used||0," tokens"]}),b?.tokens_saved&&jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-indigo-500/20 text-indigo-400 border border-indigo-500/30",children:[b.tokens_saved," tokens saved"]}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-pink-500/20 text-pink-400 border border-pink-500/30",children:[h.length," tasks"]})]}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:h.map((O,S)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 hover:bg-white/10 transition-colors",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/50",children:["#",S+1]}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:O.name})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 text-xs text-white/60",children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"text-white/40",children:[jsxRuntime.jsx("rect",{x:"1",y:"2",width:"10",height:"8",rx:"1",stroke:"currentColor"}),jsxRuntime.jsx("path",{d:"M1 4h10",stroke:"currentColor"})]}),O.start," \u2192 ",O.end]}),jsxRuntime.jsxs("span",{children:[O.duration," days"]}),O.dependencies.length>0&&jsxRuntime.jsxs("span",{className:"text-blue-400",children:["Depends: ",O.dependencies.join(", ")]})]})]}),jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${O.priority==="high"?"bg-red-500/20 text-red-400":O.priority==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:O.priority})]})},O.id))})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description *"}),jsxRuntime.jsx("textarea",{ref:C,value:n,onChange:O=>i(O.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:w}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Start Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:c,onChange:O=>l(O.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-blue-500/50 transition-all",disabled:w})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"End Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:m,onChange:O=>d(O.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-blue-500/50 transition-all",disabled:w})]})]}),y&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:y}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((O,S)=>jsxRuntime.jsx("button",{onClick:()=>i(O),disabled:w,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:O},S))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:w&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:N,disabled:w,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),h?jsxRuntime.jsx("button",{onClick:k,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Tasks to Gantt"}):jsxRuntime.jsx("button",{onClick:T,disabled:!n.trim()||w,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #2E94FF 0%, #2E94FF 100%)",color:"#ffffff"},children:w?"Generating...":"Generate Tasks"})]})]})]})})]})}function tl({initialBoard:e,onPersist:t}){let[a,r]=react.useState(e),o=react.useCallback(h=>{t&&zs(()=>Promise.resolve(t(h)),{maxAttempts:3,initialDelay:1e3,onRetry:(f,b,v)=>{console.warn(`Retry attempt ${b} after ${v}ms: ${f.message}`);}}).then(f=>{f.success||console.error(`Failed to persist board after ${f.attempts} attempts:`,f.error);});},[t]),s=react.useCallback(async(h,f,b)=>{r(v=>{let C=v.cards.find(O=>O.id===h);if(!C)return v;let w=C.columnId,N={...C,columnId:f,position:b},T=v.cards.map(O=>O.id===h?N:O),k=v.columns.map(O=>{if(O.id===w)return {...O,cardIds:O.cardIds.filter(S=>S!==h)};if(O.id===f){let S=T.filter(J=>J.columnId===f).sort((J,R)=>J.position-R.position);return {...O,cardIds:S.map(J=>J.id)}}return O}),P={...v,cards:T,columns:k};return o(P),P});},[o]),n=react.useCallback(async(h,f)=>{r(b=>{let v=b.cards.map(w=>w.id===h?{...w,...f}:w),C={...b,cards:v};return o(C),C});},[o]),i=react.useCallback(async h=>{let f=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(b=>{let v={...h,id:f},C=b.columns.map(N=>N.id===h.columnId?{...N,cardIds:[...N.cardIds,f]}:N),w={...b,cards:[...b.cards,v],columns:C};return o(w),w});},[o]),c=react.useCallback(async h=>{r(f=>{let b=f.cards.find(N=>N.id===h);if(!b)return f;let v=f.cards.filter(N=>N.id!==h),C=f.columns.map(N=>N.id===b.columnId?{...N,cardIds:N.cardIds.filter(T=>T!==h)}:N),w={...f,cards:v,columns:C};return o(w),w});},[o]),l=react.useCallback(async h=>{let f=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(b=>{let v={...h,id:f,cardIds:[]},C={...b,columns:[...b.columns,v]};return o(C),C});},[o]),m=react.useCallback(async(h,f)=>{r(b=>{let v=b.columns.map(w=>w.id===h?{...w,...f}:w),C={...b,columns:v};return o(C),C});},[o]),d=react.useCallback(async h=>{r(f=>{let b=f.cards.filter(w=>w.columnId!==h),v=f.columns.filter(w=>w.id!==h),C={...f,cards:b,columns:v};return o(C),C});},[o]),p=react.useCallback(h=>{let f=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return i(h),f},[i]),g=react.useCallback(h=>{let f=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return l(h),f},[l]),y=react.useCallback(()=>{r(h=>{let f={...h,cards:[],columns:[]};return o(f),f});},[o]);return {board:a,callbacks:{onCardMove:s,onCardUpdate:n,onCardCreate:i,onCardDelete:c,onColumnCreate:l,onColumnUpdate:m,onColumnDelete:d},setBoard:r,helpers:{addCard:p,addColumn:g,deleteCard:c,deleteColumn:d,clearBoard:y}}}function P0({initialData:e,availableUsers:t=[],onSave:a}){let{board:r,callbacks:o,helpers:s}=tl({initialBoard:e,onPersist:a}),n=react.useMemo(()=>({addCard:(c,l,m={})=>{s.addCard({title:l,columnId:c,position:r.cards.filter(d=>d.columnId===c).length,...m});},addColumn:(c,l)=>{let m=r.columns.length>0?Math.max(...r.columns.map(d=>d.position)):0;s.addColumn({title:c,position:l??m+1e3});},reset:s.clearBoard}),[r.cards,r.columns,s]);return {props:react.useMemo(()=>({board:r,callbacks:o,availableUsers:t}),[r,o,t]),board:r,callbacks:o,utils:n}}var Fs={dateFilter:"all",priorities:[],assignees:[],labels:[],columns:[],search:""},L0={by:"none",order:"asc"};function I0({initialFilters:e={},initialSort:t={},currentUserId:a}={}){let[r,o]=react.useState({...Fs,...e}),[s,n]=react.useState({...L0,...t}),i=react.useCallback(x=>{o(h=>({...h,...x}));},[]),c=react.useCallback(x=>{n(h=>({...h,...x}));},[]),l=react.useCallback(()=>{o(Fs),n(L0);},[]),m=react.useCallback(()=>{a&&o({...Fs,assignees:[a]});},[a]),d=react.useCallback(()=>{o({...Fs,dateFilter:"overdue"});},[]),p=react.useCallback(()=>{o({...Fs,priorities:["HIGH","URGENT"]});},[]),g=react.useMemo(()=>r.dateFilter!=="all"||r.priorities.length>0||r.assignees.length>0||r.labels.length>0||r.columns.length>0||r.search!==""||s.by!=="none",[r,s]),y=react.useCallback(x=>{let h=[...x];if(r.search){let f=r.search.toLowerCase();h=h.filter(b=>b.title.toLowerCase().includes(f)||b.description?.toLowerCase().includes(f));}if(r.dateFilter!=="all"){let f=new Date,b=f.getFullYear(),v=String(f.getMonth()+1).padStart(2,"0"),C=String(f.getDate()).padStart(2,"0"),w=`${b}-${v}-${C}`;h=h.filter(N=>{if(!N.endDate&&!N.dueDate)return false;let T=N.endDate||N.dueDate;if(!T)return false;let k;if(typeof T=="string")k=T.split("T")[0]||T;else {let P=T.getUTCFullYear(),O=String(T.getUTCMonth()+1).padStart(2,"0"),S=String(T.getUTCDate()).padStart(2,"0");k=`${P}-${O}-${S}`;}switch(r.dateFilter){case "overdue":return k<w;case "today":return k===w;case "this-week":let P=new Date(w+"T00:00:00"),O=new Date(k+"T00:00:00"),S=new Date(P);return S.setDate(S.getDate()+7),O>=P&&O<=S;case "custom":if(r.dateRange){let J=typeof T=="string"?new Date(T):T;return J>=r.dateRange.start&&J<=r.dateRange.end}return true;default:return true}});}return r.priorities.length>0&&(h=h.filter(f=>f.priority&&r.priorities.includes(f.priority))),r.assignees.length>0&&(h=h.filter(f=>(f.assignedUserIds||(f.assigneeId?[f.assigneeId]:[])).some(v=>r.assignees.includes(v)))),r.labels.length>0&&(h=h.filter(f=>f.labels&&f.labels.some(b=>r.labels.includes(b)))),r.columns.length>0&&(h=h.filter(f=>r.columns.includes(f.columnId))),s.by!=="none"&&h.sort((f,b)=>{let v=0;switch(s.by){case "created":let C=f.createdAt?new Date(f.createdAt).getTime():0,w=b.createdAt?new Date(b.createdAt).getTime():0;v=C-w;break;case "priority":let N={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},T=N[f.priority||"LOW"],k=N[b.priority||"LOW"];v=T-k;break;case "dueDate":let P=f.endDate||f.dueDate,O=b.endDate||b.dueDate;if(!P)return 1;if(!O)return -1;let S=typeof P=="string"?new Date(P).getTime():P.getTime(),J=typeof O=="string"?new Date(O).getTime():O.getTime();v=S-J;break;case "title":v=f.title.localeCompare(b.title);break;case "estimate":let R=f.estimatedTime||0,$=b.estimatedTime||0;v=R-$;break;default:v=0;}return s.order==="asc"?v:-v}),h},[r,s]);return {filters:r,sort:s,setFilters:i,setSort:c,resetFilters:l,filterMyTasks:m,filterOverdue:d,filterHighPriority:p,applyFilters:y,hasActiveFilters:g}}var R0,O0;if(typeof window<"u")try{let e=Os("ai");R0=e.generateObject,O0=e.generateText;}catch{}function $0(e={}){let[t,a]=react.useState(false),[r,o]=react.useState(null),s=!!(R0&&O0&&e.apiKey),n=react.useCallback(async d=>{if(!s)throw new Error('AI features require the "ai" package and an API key. Install with: npm install ai');a(true),o(null);try{return console.log("Generating plan for:",d),{columns:[{title:"To Do",position:1e3,cardIds:[]},{title:"In Progress",position:2e3,cardIds:[]},{title:"Done",position:3e3,cardIds:[]}],cards:[{title:"Generated task from AI",description:`Based on: ${d}`,position:1e3,columnId:"temp-col-1"}],explanation:"This is a sample plan. Real implementation would use AI SDK."}}catch(p){let g=p instanceof Error?p:new Error("Failed to generate plan");throw o(g),g}finally{a(false);}},[s]),i=react.useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Suggesting assignee for:",d.title),{userId:"user-123",confidence:.85,reasoning:"Based on past performance and expertise"}}catch(p){let g=p instanceof Error?p:new Error("Failed to suggest assignee");throw o(g),g}finally{a(false);}},[s]),c=react.useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Analyzing board for risks..."),[{type:"RISK_OVERLOAD",severity:"HIGH",title:"Column overload detected",description:'Too many cards in "In Progress"',confidence:.9,suggestedAction:'Consider moving some cards back to "To Do"'}]}catch(p){let g=p instanceof Error?p:new Error("Failed to predict risks");throw o(g),g}finally{a(false);}},[s]),l=react.useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Generating subtasks for:",d.title),[{title:`Subtask 1 for: ${d.title}`,position:d.position+.1,columnId:d.columnId},{title:`Subtask 2 for: ${d.title}`,position:d.position+.2,columnId:d.columnId}]}catch(p){let g=p instanceof Error?p:new Error("Failed to generate subtasks");throw o(g),g}finally{a(false);}},[s]),m=react.useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Estimating effort for:",d.title),{hours:8,confidence:.75}}catch(p){let g=p instanceof Error?p:new Error("Failed to estimate effort");throw o(g),g}finally{a(false);}},[s]);return {onGeneratePlan:n,onSuggestAssignee:i,onPredictRisks:c,onGenerateSubtasks:l,onEstimateEffort:m,isAvailable:s,isLoading:t,error:r}}function vc(){let[e,t]=react.useState(()=>core.selectionStore.getState());react.useEffect(()=>core.selectionStore.subscribe(o=>{t(o);}),[]);let a=react.useCallback(r=>{core.selectionStore.setState(r);},[]);return [e,a]}function H0(e){let{cards:t}=e,[a,r]=vc(),o=react.useCallback(d=>a.selectedCardIds.includes(d),[a.selectedCardIds]),s=react.useCallback((d,p)=>{if(!p){r({selectedCardIds:[d],lastSelectedCardId:d});return}let g=p.ctrlKey||p.metaKey,y=p.shiftKey;if(g)a.selectedCardIds.includes(d)?r({selectedCardIds:a.selectedCardIds.filter(x=>x!==d),lastSelectedCardId:a.lastSelectedCardId}):r({selectedCardIds:[...a.selectedCardIds,d],lastSelectedCardId:d});else if(y&&a.lastSelectedCardId){let x=t.find(f=>f.id===d),h=t.find(f=>f.id===a.lastSelectedCardId);if(x&&h&&x.columnId===h.columnId){let f=t.filter(k=>k.columnId===x.columnId).sort((k,P)=>k.position-P.position),b=f.findIndex(k=>k.id===a.lastSelectedCardId),v=f.findIndex(k=>k.id===d),[C,w]=b<v?[b,v]:[v,b],N=f.slice(C,w+1).map(k=>k.id),T=Array.from(new Set([...a.selectedCardIds,...N]));r({selectedCardIds:T,lastSelectedCardId:d});}else r({selectedCardIds:[d],lastSelectedCardId:d});}else r({selectedCardIds:[d],lastSelectedCardId:d});},[t,a,r]),n=react.useCallback(d=>{r({selectedCardIds:a.selectedCardIds.filter(p=>p!==d),lastSelectedCardId:a.lastSelectedCardId});},[a,r]),i=react.useCallback(()=>{r({selectedCardIds:[],lastSelectedCardId:null});},[r]),c=react.useCallback(()=>{r({selectedCardIds:t.map(d=>d.id),lastSelectedCardId:t[t.length-1]?.id||null});},[t,r]),l=react.useCallback(d=>{a.selectedCardIds.includes(d)?n(d):r({selectedCardIds:[...a.selectedCardIds,d],lastSelectedCardId:d});},[a,n,r]),m=react.useCallback(()=>t.filter(d=>a.selectedCardIds.includes(d.id)),[t,a.selectedCardIds]);return {selectedCardIds:a.selectedCardIds,lastSelectedCardId:a.lastSelectedCardId,isCardSelected:o,selectCard:s,deselectCard:n,clearSelection:i,selectAll:c,toggleCard:l,getSelectedCards:m}}var z0={enableAutoStacking:true,autoStackConfidenceThreshold:.7,minCardsPerStack:2,enableManualStacking:true,showStackSummaries:true,animationDuration:200};function U0(e){let{cards:t,config:a,aiService:r}=e,o=react.useMemo(()=>({...z0,...a}),[a]),[s,n]=react.useState([]),i=react.useCallback((x,h,f,b,v)=>{if(h.length<o.minCardsPerStack){console.warn(`Cannot create stack: minimum ${o.minCardsPerStack} cards required`);return}let C={id:`stack-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,title:x,cardIds:h,columnId:f,strategy:b,color:v,isExpanded:true,position:s.filter(w=>w.columnId===f).length,createdAt:new Date};n(w=>[...w,C]);},[o.minCardsPerStack,s]),c=react.useCallback(x=>{n(h=>h.filter(f=>f.id!==x));},[]),l=react.useCallback(x=>{n(h=>h.map(f=>f.id===x?{...f,isExpanded:!f.isExpanded}:f));},[]),m=react.useCallback((x,h)=>{n(f=>f.map(b=>b.id===x&&!b.cardIds.includes(h)?{...b,cardIds:[...b.cardIds,h]}:b));},[]),d=react.useCallback((x,h)=>{n(f=>f.map(b=>{if(b.id===x){let v=b.cardIds.filter(C=>C!==h);return v.length<o.minCardsPerStack?null:{...b,cardIds:v}}return b}).filter(b=>b!==null));},[o.minCardsPerStack]),p=react.useCallback(x=>s.filter(h=>h.columnId===x).sort((h,f)=>h.position-f.position),[s]),g=react.useCallback(async x=>{let h=t.filter(w=>w.columnId===x);if(h.length<o.minCardsPerStack*2)return [];let f=[],b=new Map;h.forEach(w=>{w.labels&&w.labels.length>0&&w.labels.forEach(N=>{b.has(N)||b.set(N,[]),b.get(N).push(w);});}),b.forEach((w,N)=>{w.length>=o.minCardsPerStack&&f.push({stack:{title:`\u{1F4CC} ${N}`,cardIds:w.map(T=>T.id),columnId:x,strategy:"labels",color:"#3b82f6"},reason:`${w.length} cards with label "${N}"`,confidence:.85});});let v=new Map;h.forEach(w=>{w.assignedUserIds&&w.assignedUserIds.length>0&&w.assignedUserIds.forEach(N=>{v.has(N)||v.set(N,[]),v.get(N).push(w);});}),v.forEach((w,N)=>{w.length>=o.minCardsPerStack&&f.push({stack:{title:`\u{1F464} Assigned to user-${N.slice(-4)}`,cardIds:w.map(T=>T.id),columnId:x,strategy:"assignee",color:"#8b5cf6"},reason:`${w.length} cards assigned to the same user`,confidence:.8});});let C=new Map;if(h.forEach(w=>{w.priority&&(C.has(w.priority)||C.set(w.priority,[]),C.get(w.priority).push(w));}),C.forEach((w,N)=>{if(w.length>=o.minCardsPerStack){let T={low:"\u{1F7E2}",medium:"\u{1F7E1}",high:"\u{1F534}",urgent:"\u{1F6A8}"}[N.toLowerCase()]||"\u26AA";f.push({stack:{title:`${T} ${N} Priority`,cardIds:w.map(k=>k.id),columnId:x,strategy:"priority",color:N==="high"||N==="urgent"?"#ef4444":"#10b981"},reason:`${w.length} cards with ${N} priority`,confidence:.75});}}),r&&o.enableAutoStacking)for(let w of h){let T=(await r.findSimilar(w,h)).filter(k=>k.similarity>=o.autoStackConfidenceThreshold);if(T.length>=o.minCardsPerStack-1){let k=[w.id,...T.map(O=>O.card.id)],P=T.reduce((O,S)=>O+S.similarity,0)/T.length;f.push({stack:{title:`\u2728 Similar to "${w.title.substring(0,30)}${w.title.length>30?"...":""}"`,cardIds:k,columnId:x,strategy:"ai-similarity",color:"#f59e0b"},reason:`AI detected ${T.length+1} similar tasks`,confidence:P});}}return f.filter(w=>w.confidence>=o.autoStackConfidenceThreshold).sort((w,N)=>N.confidence-w.confidence).slice(0,5)},[t,o,r]),y=react.useCallback(x=>{i(x.stack.title,x.stack.cardIds,x.stack.columnId,x.stack.strategy,x.stack.color);},[i]);return react.useEffect(()=>{o.enableAutoStacking&&s.length===0&&new Set(t.map(h=>h.columnId)).forEach(async h=>{let f=await g(h),b=f[0];f.length>0&&b&&b.confidence>=.9&&y(b);});},[]),{stacks:s,createStack:i,deleteStack:c,toggleStack:l,addToStack:m,removeFromStack:d,getStacksForColumn:p,getSuggestions:g,applySuggestion:y,config:o}}var W0=react.createContext(null);function G0({children:e,initialData:t,onStateChange:a}){let r=react.useRef();if(!r.current){let s=new Map,n=new Map;t?.columns?.forEach(c=>{let{Column:l}=Os("@libxai/core");s.set(c.id,new l(c));}),t?.cards?.forEach(c=>{let{Card:l}=Os("@libxai/core");n.set(c.id,new l(c));});let i=null;if(t?.board){let{Board:c}=Os("@libxai/core");i=new c(t.board);}r.current=new core.BoardStore({board:i,columns:s,cards:n});}let o=r.current;return react.useEffect(()=>{if(a)return o.subscribeAll(s=>{a(o.getState());})},[o,a]),jsxRuntime.jsx(W0.Provider,{value:{store:o},children:e})}function al(){let e=react.useContext(W0);if(!e)throw new Error("useBoardStore must be used within BoardProvider");return e.store}function As(){let e=al(),[t,a]=react.useState(e.getBoard()),[r,o]=react.useState(e.getAllColumns()),[s,n]=react.useState(e.getAllCards());react.useEffect(()=>e.subscribeAll(()=>{a(e.getBoard()),o(e.getAllColumns()),n(e.getAllCards());}),[e]);let i=react.useCallback(b=>{e.updateBoard(b);},[e]),c=react.useCallback(b=>{e.addColumn(b);},[e]),l=react.useCallback((b,v)=>{e.updateColumn(b,v);},[e]),m=react.useCallback(b=>{e.deleteColumn(b);},[e]),d=react.useCallback(b=>e.getColumn(b),[e]),p=react.useCallback(b=>{e.addCard(b);},[e]),g=react.useCallback((b,v)=>{e.updateCard(b,v);},[e]),y=react.useCallback(b=>{e.deleteCard(b);},[e]),x=react.useCallback((b,v,C)=>{e.moveCard(b,v,C);},[e]),h=react.useCallback(b=>e.getCard(b),[e]),f=react.useCallback(b=>e.getCardsByColumn(b),[e]);return {board:t,columns:r,cards:s,updateBoard:i,addColumn:c,updateColumn:l,deleteColumn:m,getColumn:d,addCard:p,updateCard:g,deleteCard:y,moveCard:x,getCard:h,getCardsByColumn:f}}function _0(e){let{cards:t}=As();return react.useMemo(()=>e?t.filter(a=>{if(e.searchQuery){let r=e.searchQuery.toLowerCase(),o=a.title.toLowerCase().includes(r),s=a.description?.toLowerCase().includes(r);if(!o&&!s)return false}return !(e.priorities&&e.priorities.length>0&&(!a.priority||!e.priorities.includes(a.priority))||e.statuses&&e.statuses.length>0&&(!a.status||!e.statuses.includes(a.status))||e.assignedUserIds&&e.assignedUserIds.length>0&&!e.assignedUserIds.some(o=>a.isAssignedTo(o))||e.labels&&e.labels.length>0&&!e.labels.some(o=>a.hasLabel(o))||e.columnIds&&e.columnIds.length>0&&!e.columnIds.includes(a.columnId)||e.isOverdue!==void 0&&e.isOverdue!==a.isOverdue())}):t,[t,e])}function j0(e="position",t="asc"){let{cards:a}=As();return react.useMemo(()=>[...a].sort((o,s)=>{let n=0;switch(e){case "title":n=o.title.localeCompare(s.title);break;case "priority":{let i={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},c=o.priority?i[o.priority]:0,l=s.priority?i[s.priority]:0;n=c-l;break}case "createdAt":n=o.createdAt.getTime()-s.createdAt.getTime();break;case "updatedAt":n=o.updatedAt.getTime()-s.updatedAt.getTime();break;case "position":n=o.position-s.position;break}return t==="asc"?n:-n}),[a,e,t])}var rl=class{constructor(){this.plugins=new Map;this.enabled=new Set;this.config=new Map;this.context=null;this.pluginLogger=au.child("PluginManager");}setContext(t){this.context=t;}register(t){if(!t.id||!t.name||!t.version)throw new Error("Plugin must have id, name, and version");if(this.plugins.has(t.id)&&this.pluginLogger.warn(`Plugin ${t.id} is already registered, overwriting...`),t.dependencies){for(let a of t.dependencies)if(!this.plugins.has(a))throw new Error(`Plugin ${t.id} depends on ${a} which is not registered`)}this.plugins.set(t.id,t),t.defaultConfig&&this.config.set(t.id,{...t.defaultConfig}),this.enabled.add(t.id),this.pluginLogger.info(`Plugin registered: ${t.name} v${t.version}`),t.onInit&&this.context&&Promise.resolve(t.onInit(this.context)).catch(a=>{this.pluginLogger.error(`Failed to initialize plugin ${t.id}`,a,{plugin:t.id});});}unregister(t){let a=this.plugins.get(t);if(!a){this.pluginLogger.warn(`Plugin ${t} is not registered`);return}a.onDestroy&&Promise.resolve(a.onDestroy()).catch(r=>{this.pluginLogger.error(`Failed to destroy plugin ${t}`,r);}),this.plugins.delete(t),this.enabled.delete(t),this.config.delete(t),this.pluginLogger.info(`Plugin unregistered: ${a.name}`);}getPlugin(t){return this.plugins.get(t)}getPlugins(){return Array.from(this.plugins.values())}hasPlugin(t){return this.plugins.has(t)}setEnabled(t,a){if(!this.plugins.has(t))throw new Error(`Plugin ${t} is not registered`);a?(this.enabled.add(t),this.pluginLogger.info(`Plugin enabled: ${t}`)):(this.enabled.delete(t),this.pluginLogger.info(`Plugin disabled: ${t}`));}isEnabled(t){return this.enabled.has(t)}getConfig(t,a){return this.config.get(t)?.[a]}setConfig(t,a,r){this.config.has(t)||this.config.set(t,{});let o=this.config.get(t);o[a]=r,this.pluginLogger.debug(`Plugin config set: ${t}.${a}`,{value:r});}async executeHook(t,a,r){let o=r;for(let s of this.plugins.values()){if(!this.enabled.has(s.id))continue;let n=s[t];if(typeof n=="function")try{let i=await Promise.resolve(n.apply(s,a));i!==void 0&&(o=i,a[0]=i);}catch(i){this.pluginLogger.error(`Plugin hook failed: ${s.id}.${t}`,i,{plugin:s.id,hook:t});}}return o}async executeHookParallel(t,a){let r=[];for(let o of this.plugins.values()){if(!this.enabled.has(o.id))continue;let s=o[t];typeof s=="function"&&r.push(Promise.resolve(s.apply(o,a)).catch(n=>{this.pluginLogger.error(`Plugin hook failed: ${o.id}.${t}`,n,{plugin:o.id,hook:t});}));}await Promise.all(r);}},jw=new rl;function Y0({items:e,height:t,estimateSize:a,renderItem:r,className:o="",overscan:s=5,horizontal:n=false,gap:i=0,getItemKey:c}){let l=react.useRef(null),m=reactVirtual.useVirtualizer({count:e.length,getScrollElement:()=>l.current,estimateSize:()=>a,overscan:s,horizontal:n,gap:i}),d=m.getVirtualItems(),p={height:typeof t=="number"?`${t}px`:t,width:"100%",overflow:"auto",position:"relative"},g=n?{width:`${m.getTotalSize()}px`,height:"100%",position:"relative"}:{height:`${m.getTotalSize()}px`,width:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:l,style:p,className:o,children:jsxRuntime.jsx("div",{style:g,children:d.map(y=>{let x=e[y.index];if(!x)return null;let h=c?c(x,y.index):y.index,f={position:"absolute",top:n?0:y.start,left:n?y.start:0,width:n?y.size:"100%",height:n?"100%":y.size};return jsxRuntime.jsx("div",{style:f,"data-index":y.index,children:r(x,y.index)},h)})})})}function q0(e){return reactVirtual.useVirtualizer({count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateSize,overscan:e.overscan??5,horizontal:e.horizontal??false,gap:e.gap??0})}function J0({items:e,height:t,width:a="100%",estimateColumnWidth:r,renderColumn:o,className:s="",overscan:n=3,gap:i=16,getItemKey:c,horizontal:l=true}){let m=react.useRef(null),d=reactVirtual.useVirtualizer({horizontal:l,count:e.length,getScrollElement:()=>m.current,estimateSize:()=>r,overscan:n,gap:i}),p=d.getVirtualItems(),g={height:typeof t=="number"?`${t}px`:t,width:typeof a=="number"?`${a}px`:a,overflow:"auto",position:"relative"},y={width:`${d.getTotalSize()}px`,height:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:m,style:g,className:s,children:jsxRuntime.jsx("div",{style:y,children:p.map(x=>{let h=e[x.index];if(!h)return null;let f=c?c(h,x.index):x.index,b={position:"absolute",top:0,left:x.start,width:x.size,height:"100%"};return jsxRuntime.jsx("div",{style:b,"data-index":x.index,children:o(h,x.index)},f)})})})}function Q0(e){let t=reactVirtual.useVirtualizer({horizontal:true,count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateColumnWidth,overscan:e.overscan??3,gap:e.gap??0});return {columnVirtualizer:t,virtualColumns:t.getVirtualItems(),totalWidth:t.getTotalSize()}}function Z0(e,t=10){return e>t}var Tc={none:0,xs:4,sm:8,md:12,lg:16,xl:20,"2xl":24,"3xl":32,"4xl":40,"5xl":48,"6xl":64},Nc={none:0,sm:4,md:8,lg:12,xl:16,"2xl":20,full:9999},Dc={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48},Sc={light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800},Ec={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},Mc={base:0,dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070},Fc={instant:0,fastest:75,faster:100,fast:150,normal:200,slow:300,slower:400,slowest:500},Pc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",smooth:"cubic-bezier(0.4, 0.0, 0.2, 1)",sharp:"cubic-bezier(0.4, 0.0, 0.6, 1)",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},Ac={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"},Lc={0:0,5:.05,10:.1,20:.2,30:.3,40:.4,50:.5,60:.6,70:.7,80:.8,90:.9,100:1},Ic={column:{width:320,minWidth:280,maxWidth:400,gap:16,padding:12,headerHeight:48},card:{minHeight:80,maxHeight:400,padding:12,gap:8},board:{padding:16,gap:16}},Bc={timeline:{headerHeight:60,rowHeight:44,minRowHeight:32,maxRowHeight:80,taskPadding:4,gridLineWidth:1},task:{height:28,minHeight:20,maxHeight:40,borderRadius:4,padding:6},dependency:{lineWidth:2,arrowSize:8},scale:{day:{columnWidth:40,minColumnWidth:30,maxColumnWidth:60},week:{columnWidth:80,minColumnWidth:60,maxColumnWidth:120},month:{columnWidth:120,minColumnWidth:80,maxColumnWidth:200},quarter:{columnWidth:200,minColumnWidth:150,maxColumnWidth:300}},milestone:{size:16,rotation:45}},ol={spacing:Tc,borderRadius:Nc,fontSize:Dc,fontWeight:Sc,lineHeight:Ec,zIndex:Mc,duration:Fc,easing:Pc,shadows:Ac,opacity:Lc,kanban:Ic,gantt:Bc};function ef(e,t,a){return e[t]??a}function Rc(e,t="",a={}){for(let[r,o]of Object.entries(e)){let s=t?`${t}-${r}`:r;typeof o=="object"&&o!==null&&!Array.isArray(o)?Rc(o,s,a):(typeof o=="string"||typeof o=="number")&&(a[s]=o);}return a}function qw(e){return typeof e=="number"?e>0&&e<1e3?`${e}px`:e.toString():e}function Oc(e="asakaa"){let t=Rc(ol),a=[];for(let[r,o]of Object.entries(t)){let s=`--${e}-${r}`,n=qw(o);a.push(` ${s}: ${n};`);}return `:root {
|
|
413
|
+
Today's date: ${new Date().toISOString().split("T")[0]}`}function Fm(e){let t=[],a=r=>{for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);};return a(e),t}function xo(e,t){let a=Fm(e),r=t.toLowerCase().trim(),o=a.find(i=>i.name.toLowerCase()===r);if(o)return o;let s=a.find(i=>i.name.toLowerCase().includes(r));if(s)return s;let n=r.split(/\s+/);return a.find(i=>{let c=i.name.toLowerCase();return n.every(l=>c.includes(l))})}function Id(e,t=new Date){let a=e.toLowerCase().trim(),r=new Date(t);if(r.setHours(0,0,0,0),a==="today"||a==="hoy")return r;if(a==="tomorrow"||a==="ma\xF1ana"){let p=new Date(r);return p.setDate(p.getDate()+1),p}if(a==="yesterday"||a==="ayer"){let p=new Date(r);return p.setDate(p.getDate()-1),p}if(a==="next week"||a==="la pr\xF3xima semana"){let p=new Date(r);return p.setDate(p.getDate()+7),p}let o=a.match(/(?:next\s+)?(monday|tuesday|wednesday|thursday|friday|saturday|sunday|lunes|martes|miércoles|miercoles|jueves|viernes|sábado|sabado|domingo)/i);if(o){let g={sunday:0,domingo:0,monday:1,lunes:1,tuesday:2,martes:2,wednesday:3,mi\u00E9rcoles:3,miercoles:3,thursday:4,jueves:4,friday:5,viernes:5,saturday:6,s\u00E1bado:6,sabado:6}[o[1].toLowerCase()];if(g!==void 0){let y=new Date(r),x=y.getDay(),h=g-x;return h<=0&&(h+=7),y.setDate(y.getDate()+h),y}}let s=a.match(/in\s+(\d+)\s+(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(s&&s[1]&&s[2]){let p=parseInt(s[1],10),g=s[2].toLowerCase(),y=new Date(r);return g==="day"||g==="d\xEDa"||g==="dias"?y.setDate(y.getDate()+p):g==="week"||g==="semana"||g==="semanas"?y.setDate(y.getDate()+p*7):(g==="month"||g==="mes"||g==="meses")&&y.setMonth(y.getMonth()+p),y}if(a.match(/(\d{4})-(\d{2})-(\d{2})/))return new Date(a);let i=a.match(/(\d{1,2})\/(\d{1,2})\/(\d{4})/);if(i&&i[1]&&i[2]&&i[3]){let p=parseInt(i[1],10),g=parseInt(i[2],10)-1,y=parseInt(i[3],10);return new Date(y,g,p)}let c={enero:0,febrero:1,marzo:2,abril:3,mayo:4,junio:5,julio:6,agosto:7,septiembre:8,octubre:9,noviembre:10,diciembre:11},l=a.match(/(\d{1,2})\s+de\s+(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)(?:\s+de\s+(\d{4}))?/i);if(l&&l[1]&&l[2]){let p=parseInt(l[1],10),g=c[l[2].toLowerCase()],y=l[3]?parseInt(l[3],10):r.getFullYear();if(g!==void 0)return new Date(y,g,p)}let m={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},d=a.match(/(january|february|march|april|may|june|july|august|september|october|november|december)\s+(\d{1,2})(?:,?\s+(\d{4}))?/i);if(d&&d[1]&&d[2]){let p=m[d[1].toLowerCase()],g=parseInt(d[2],10),y=d[3]?parseInt(d[3],10):r.getFullYear();if(p!==void 0)return new Date(y,p,g)}return null}function Bd(e){let a=e.toLowerCase().trim().match(/(\d+)\s*(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(a&&a[1]&&a[2]){let r=parseInt(a[1],10),o=a[2].toLowerCase();if(o==="day"||o==="d\xEDa"||o==="dias")return r;if(o==="week"||o==="semana"||o==="semanas")return r*7;if(o==="month"||o==="mes"||o==="meses")return r*30}return null}function Rd(e){let t=e.match(/(\d+)(?:\s*%)?/);if(t&&t[1]){let a=parseInt(t[1],10);return Math.max(0,Math.min(100,a))}return null}function Pm(e){let t=e.toLowerCase().trim();return t.includes("todo")||t.includes("pendiente")||t.includes("por hacer")?"todo":t.includes("in progress")||t.includes("in-progress")||t.includes("en progreso")||t.includes("working")||t.includes("trabajando")?"in-progress":t.includes("done")||t.includes("complete")||t.includes("finished")||t.includes("completado")||t.includes("terminado")||t.includes("hecho")?"completed":null}function Am(e,t){let a=e.toLowerCase().trim(),r=a.match(/(?:move|mover|mueve)\s+(?:la\s+tarea\s+)?["""]?(.+?)["""]?\s+(?:to|a|para)\s+(?:la\s+fecha\s+)?(.+)/i);if(r&&r[1]&&r[2]){let l=r[1].trim(),m=r[2].trim(),d=xo(t,l),p=Id(m);if(!d)return {type:"move_task",taskName:l,message:`Could not find a task named "${l}". Please check the task name and try again.`,success:false,error:"Task not found"};if(!p)return {type:"move_task",taskId:d.id,taskName:d.name,message:`Could not parse the date "${m}". Try using formats like "next Monday", "in 3 days", or "2024-01-15".`,success:false,error:"Invalid date"};let g=d.startDate&&d.endDate?Math.round((d.endDate.getTime()-d.startDate.getTime())/(1e3*60*60*24)):1,y=new Date(p);return y.setDate(y.getDate()+g),{type:"move_task",taskId:d.id,taskName:d.name,updates:{startDate:p,endDate:y},message:`Moved "${d.name}" to ${p.toLocaleDateString()}.`,success:true}}let o=a.match(/(?:extend|extender|extiende|alargar)\s+["""]?(.+?)["""]?\s+(?:by|por)\s+(.+)/i);if(o&&o[1]&&o[2]){let l=o[1].trim(),m=o[2].trim(),d=xo(t,l),p=Bd(m);if(!d)return {type:"resize_task",taskName:l,message:`Could not find a task named "${l}".`,success:false,error:"Task not found"};if(!p||!d.endDate)return {type:"resize_task",taskId:d.id,taskName:d.name,message:`Could not parse the duration "${m}".`,success:false,error:"Invalid duration"};let g=new Date(d.endDate);return g.setDate(g.getDate()+p),{type:"resize_task",taskId:d.id,taskName:d.name,updates:{endDate:g},message:`Extended "${d.name}" by ${p} days. New end date: ${g.toLocaleDateString()}.`,success:true}}let s=a.match(/(?:set|establecer|poner)\s+["""]?(.+?)["""]?\s+(?:progress|progreso)\s+(?:to|a|en)\s+(.+)/i);if(s&&s[1]&&s[2]){let l=s[1].trim(),m=s[2].trim(),d=xo(t,l),p=Rd(m);return d?p===null?{type:"set_progress",taskId:d.id,taskName:d.name,message:`Could not parse the progress value "${m}".`,success:false,error:"Invalid progress"}:{type:"set_progress",taskId:d.id,taskName:d.name,updates:{progress:p},message:`Set "${d.name}" progress to ${p}%.`,success:true}:{type:"set_progress",taskName:l,message:`Could not find a task named "${l}".`,success:false,error:"Task not found"}}let n=a.match(/(?:rename|renombrar|cambiar nombre de)\s+["""]?(.+?)["""]?\s+(?:to|a|por)\s+["""]?(.+?)["""]?$/i);if(n&&n[1]&&n[2]){let l=n[1].trim(),m=n[2].trim(),d=xo(t,l);return d?{type:"rename_task",taskId:d.id,taskName:d.name,updates:{name:m},message:`Renamed "${d.name}" to "${m}".`,success:true}:{type:"rename_task",taskName:l,message:`Could not find a task named "${l}".`,success:false,error:"Task not found"}}let i=a.match(/(?:link|vincular|conectar)\s+["""]?(.+?)["""]?\s+(?:to|a|con)\s+["""]?(.+?)["""]?$/i);if(i&&i[1]&&i[2]){let l=i[1].trim(),m=i[2].trim(),d=xo(t,l),p=xo(t,m);return d?p?{type:"link_tasks",taskId:p.id,taskName:p.name,dependencyFrom:d.id,dependencyTo:p.id,message:`Linked "${d.name}" \u2192 "${p.name}".`,success:true}:{type:"link_tasks",taskName:m,message:`Could not find a task named "${m}".`,success:false,error:"Target task not found"}:{type:"link_tasks",taskName:l,message:`Could not find a task named "${l}".`,success:false,error:"Source task not found"}}let c=a.match(/(?:delete|eliminar|borrar|remove|quitar)\s+["""]?(.+?)["""]?$/i);if(c&&c[1]){let l=c[1].trim(),m=xo(t,l);return m?{type:"delete_task",taskId:m.id,taskName:m.name,message:`Deleted "${m.name}".`,success:true}:{type:"delete_task",taskName:l,message:`Could not find a task named "${l}".`,success:false,error:"Task not found"}}return null}function Lm(e){if(!e||typeof e!="object")return {type:"unknown",message:"Invalid response from AI",success:false,error:"Invalid response format"};let t=e;return {type:t.type||"unknown",taskId:typeof t.taskId=="string"?t.taskId:void 0,taskName:typeof t.taskName=="string"?t.taskName:void 0,updates:t.updates,newTask:t.newTask,dependencyFrom:typeof t.dependencyFrom=="string"?t.dependencyFrom:void 0,dependencyTo:typeof t.dependencyTo=="string"?t.dependencyTo:void 0,message:typeof t.message=="string"?t.message:"Command processed",success:typeof t.success=="boolean"?t.success:false,error:typeof t.error=="string"?t.error:void 0}}function o2(e){if(e)switch(e.toUpperCase()){case "TODO":case "BLOCKED":return "todo";case "IN_PROGRESS":case "REVIEW":return "in-progress";case "DONE":return "completed";default:return "todo"}}function n2(e){switch(e){case "todo":return "TODO";case "in-progress":return "IN_PROGRESS";case "completed":return "DONE";default:return e||"TODO"}}function Ii(e,t=[],a=[]){let r=e.assignedUserIds?.map(m=>{let d=a.find(p=>p.id===m);return d?{name:d.name,initials:d.initials,color:d.color}:null}).filter(m=>m!==null),o=t.filter(m=>m.metadata?.parentCardId===e.id).map(m=>Ii(m,t,a)),s;e.dependencies&&(typeof e.dependencies[0]=="string"?s=e.dependencies:s=e.dependencies.filter(m=>m.type==="finish-to-start").map(m=>m.taskId));let n=m=>{if(m)return typeof m=="string"?new Date(m):m},i=n(e.startDate),c=n(e.endDate),l=e.metadata?.isMilestone===true||i&&c&&Math.abs(c.getTime()-i.getTime())<=864e5;return {id:e.id,name:e.title,startDate:i,endDate:c,progress:e.progress||0,status:o2(e.metadata?.status),assignees:r?.length?r:void 0,dependencies:s?.length?s:void 0,subtasks:o?.length?o:void 0,isExpanded:e.metadata?.isExpanded===true,isMilestone:l,isCriticalPath:e.metadata?.isCriticalPath===true}}function Im(e,t=[]){let a;return e.assignees&&e.assignees.length>0&&(a=e.assignees.map(r=>t.find(s=>s.name===r.name||s.initials===r.initials)?.id).filter(r=>r!==void 0)),{id:e.id,title:e.name,startDate:e.startDate,endDate:e.endDate,progress:e.progress,assignedUserIds:a?.length?a:void 0,metadata:{status:n2(e.status),isExpanded:e.isExpanded,isMilestone:e.isMilestone,isCriticalPath:e.isCriticalPath}}}function Bm(e,t=[]){return e.filter(r=>!r.metadata?.parentCardId).map(r=>Ii(r,e,t))}var Od={columns:{name:"Task ID / Name",startDate:"Start Date",endDate:"End Date",progress:"Progress",status:"Status",assignees:"Assignees",priority:"Priority",actions:"Actions",estimatedTime:"Estimated",quotedTime:"Quoted",elapsedTime:"Executed",tags:"Tags",scheduleVariance:"Sched / Var",hoursBar:"Hours (Spent / Allocated)",teamLoad:"Team Load",blockers:"Blockers",weight:"Weight"},toolbar:{search:"Search",searchPlaceholder:"Search tasks...",filter:"Filter",clearFilters:"Clear Filters",export:"Export",columns:"Columns",newTask:"New Task"},filters:{status:"Status",assignees:"Assignees",dateRange:"Date Range",showCompleted:"Show Completed",all:"All",none:"None"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},actions:{edit:"Edit",delete:"Delete",duplicate:"Duplicate",viewDetails:"View Details"},empty:{noTasks:"No tasks yet",noResults:"No tasks match your filters",addFirstTask:"Add your first task"},pagination:{showing:"Showing",of:"of",tasks:"tasks",previous:"Previous",next:"Next"},bulk:{selected:"selected",delete:"Delete",move:"Move to",assignTo:"Assign to"}},$d={columns:{name:"ID Tarea / Nombre",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",status:"Estado",assignees:"Asignados",priority:"Prioridad",actions:"Acciones",estimatedTime:"Estimado",quotedTime:"Ofertado",elapsedTime:"Ejecutado",tags:"Etiquetas",scheduleVariance:"Prog / Var",hoursBar:"Horas (Usado / Asignado)",teamLoad:"Equipo",blockers:"Bloqueantes",weight:"Peso"},toolbar:{search:"Buscar",searchPlaceholder:"Buscar tareas...",filter:"Filtrar",clearFilters:"Limpiar Filtros",export:"Exportar",columns:"Columnas",newTask:"Nueva Tarea"},filters:{status:"Estado",assignees:"Asignados",dateRange:"Rango de Fechas",showCompleted:"Mostrar Completadas",all:"Todos",none:"Ninguno"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},actions:{edit:"Editar",delete:"Eliminar",duplicate:"Duplicar",viewDetails:"Ver Detalles"},empty:{noTasks:"Sin tareas a\xFAn",noResults:"Ninguna tarea coincide con los filtros",addFirstTask:"Agrega tu primera tarea"},pagination:{showing:"Mostrando",of:"de",tasks:"tareas",previous:"Anterior",next:"Siguiente"},bulk:{selected:"seleccionadas",delete:"Eliminar",move:"Mover a",assignTo:"Asignar a"}},Bi={en:Od,es:$d};function Hd(e){return Bi[e]||Bi.en}function Ri(e,t){let a=Hd(e);return t?{columns:{...a.columns,...t.columns},toolbar:{...a.toolbar,...t.toolbar},filters:{...a.filters,...t.filters},status:{...a.status,...t.status},actions:{...a.actions,...t.actions},empty:{...a.empty,...t.empty},pagination:{...a.pagination,...t.pagination},bulk:{...a.bulk,...t.bulk}}:a}var zd=[{value:"todo",icon:lucideReact.Circle,color:"text-gray-400"},{value:"in-progress",icon:lucideReact.PlayCircle,color:"text-[#3B9EFF]"},{value:"completed",icon:lucideReact.CheckCircle2,color:"text-[#3BF06E]"}];function Rm(e){let t=e?.toLowerCase()||"todo";return t==="inprogress"||t==="in-progress"||t==="in_progress"?"in-progress":t==="completed"||t==="done"||t==="complete"?"completed":"todo"}function Om({value:e,onChange:t,isDark:a,translations:r,disabled:o=false}){let[s,n]=react.useState(false),i=react.useRef(null);react.useEffect(()=>{let g=y=>{i.current&&!i.current.contains(y.target)&&n(false);};return s&&document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[s]);let c=Rm(e),l=zd[0],m=zd.find(g=>g.value===c)??l,d=m.icon,p=g=>{switch(Rm(g)){case "completed":return r.completed;case "in-progress":return r.inProgress;default:return r.todo}};return o||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(d,{className:u("w-4 h-4 flex-shrink-0",m.color)}),jsxRuntime.jsx("span",{className:u("text-sm whitespace-nowrap",a?"text-white/60":"text-gray-500"),children:p(e)})]}):jsxRuntime.jsxs("div",{ref:i,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:g=>{g.stopPropagation(),n(!s);},className:u("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:[jsxRuntime.jsx(d,{className:u("w-4 h-4 flex-shrink-0",m.color)}),jsxRuntime.jsx("span",{className:u("text-sm whitespace-nowrap",a?"text-white/60":"text-gray-500"),children:p(e)}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-3 h-3",a?"text-white/30":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:u("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[140px]",a?"bg-[#1A1A1A] border-[#222]":"bg-white border-gray-200"),children:zd.map(g=>{let y=g.icon;return jsxRuntime.jsxs("button",{onClick:x=>{x.stopPropagation(),t(g.value),n(false);},className:u("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100",c===g.value&&(a?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx(y,{className:u("w-4 h-4",g.color)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:p(g.value)})]},g.value)})})]})}var Ud=[{value:"urgent",label:{en:"Urgent",es:"Urgente"},color:"text-[#FF2D20]",bg:"bg-[#FF2D20]"},{value:"high",label:{en:"High",es:"Alta"},color:"text-[#FF2D20]",bg:"bg-[#FF2D20]"},{value:"medium",label:{en:"Medium",es:"Media"},color:"text-[#FFD60A]",bg:"bg-[#FFD60A]"},{value:"low",label:{en:"Low",es:"Baja"},color:"text-[#3B9EFF]",bg:"bg-[#3B9EFF]"},{value:"none",label:{en:"None",es:"Ninguna"},color:"text-gray-400",bg:"bg-gray-400"}];function Hm({value:e="none",onChange:t,isDark:a,locale:r,disabled:o=false}){let[s,n]=react.useState(false),i=react.useRef(null);react.useEffect(()=>{let m=d=>{i.current&&!i.current.contains(d.target)&&n(false);};return s&&document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[s]);let c=Ud.find(m=>m.value===e)??Ud[4],l=r==="es"?"es":"en";return o||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Flag,{className:u("w-4 h-4",c.color)}),jsxRuntime.jsx("span",{className:u("text-sm",a?"text-white/60":"text-gray-500"),children:c.label[l]})]}):jsxRuntime.jsxs("div",{ref:i,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:m=>{m.stopPropagation(),n(!s);},className:u("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Flag,{className:u("w-4 h-4",c.color)}),jsxRuntime.jsx("span",{className:u("text-sm",a?"text-white/60":"text-gray-500"),children:c.label[l]}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-3 h-3",a?"text-white/30":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:u("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px]",a?"bg-[#1A1A1A] border-[#222]":"bg-white border-gray-200"),children:Ud.map(m=>jsxRuntime.jsxs("button",{onClick:d=>{d.stopPropagation(),t(m.value),n(false);},className:u("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100",e===m.value&&(a?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:u("w-2 h-2 rounded-full",m.bg)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:m.label[l]})]},m.value))})]})}function hs(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function Wd(e){let t=["bg-blue-500","bg-green-500","bg-purple-500","bg-pink-500","bg-yellow-500","bg-red-500","bg-indigo-500","bg-teal-500"],a=0;for(let r=0;r<e.length;r++)a=e.charCodeAt(r)+((a<<5)-a);return t[Math.abs(a)%t.length]??"bg-blue-500"}function Gm({value:e=[],availableUsers:t=[],onChange:a,isDark:r,locale:o,disabled:s=false}){let[n,i]=react.useState(false),[c,l]=react.useState(""),m=react.useRef(null),d=react.useRef(null);react.useEffect(()=>{let x=h=>{m.current&&!m.current.contains(h.target)&&(i(false),l(""));};return n&&document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[n]),react.useEffect(()=>{n&&d.current&&d.current.focus();},[n]);let p=t.filter(x=>x.name.toLowerCase().includes(c.toLowerCase())),g=x=>e.some(h=>h.name===x),y=x=>{if(a){if(g(x.name))a(e.filter(h=>h.name!==x.name));else {let h={name:x.name,initials:hs(x.name),color:x.color||Wd(x.name).replace("bg-","").replace("-500",""),avatar:x.avatarUrl,id:x.id};a([...e,h]);}i(false),l("");}};return s||!a?e.length===0?jsxRuntime.jsx("span",{className:u("text-sm",r?"text-white/30":"text-gray-400"),children:"-"}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-2",children:[e.slice(0,3).map((x,h)=>jsxRuntime.jsx("div",{className:u("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium text-white border-2",r?"border-[#0D0D0D]":"border-white",!x.avatar&&Wd(x.name)),style:x.color&&!x.avatar?{backgroundColor:x.color}:void 0,title:x.name,children:x.avatar?jsxRuntime.jsx("img",{src:x.avatar,alt:x.name,className:"w-full h-full rounded-full object-cover"}):x.initials||hs(x.name)},`${x.name}-${h}`)),e.length>3&&jsxRuntime.jsxs("div",{className:u("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium border-2",r?"bg-[#1A1A1A] border-[#0D0D0D] text-white":"bg-gray-200 border-white text-gray-600"),children:["+",e.length-3]})]}):jsxRuntime.jsxs("div",{ref:m,className:"relative",children:[jsxRuntime.jsx("button",{onClick:x=>{x.stopPropagation(),i(!n);},className:u("flex items-center gap-1 px-2 py-1 rounded transition-colors",r?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:e.length===0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.User,{className:u("w-4 h-4",r?"text-white/30":"text-gray-400")}),jsxRuntime.jsx(lucideReact.Plus,{className:u("w-3 h-3",r?"text-white/30":"text-gray-400")})]}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-1",children:[e.slice(0,2).map((x,h)=>jsxRuntime.jsx("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-medium text-white border",r?"border-[#0D0D0D]":"border-white",!x.avatar&&Wd(x.name)),style:x.color&&!x.avatar?{backgroundColor:x.color}:void 0,children:x.avatar?jsxRuntime.jsx("img",{src:x.avatar,alt:x.name,className:"w-full h-full rounded-full object-cover"}):x.initials||hs(x.name)},`${x.name}-${h}`)),e.length>2&&jsxRuntime.jsxs("span",{className:u("text-xs ml-1",r?"text-white/60":"text-gray-500"),children:["+",e.length-2]})]})}),n&&jsxRuntime.jsxs("div",{className:"absolute z-50 top-full left-0 mt-1.5 rounded-lg overflow-hidden",style:{width:260,backgroundColor:r?"rgba(17, 17, 17, 0.98)":"rgba(255, 255, 255, 0.98)",border:`1px solid ${r?"rgba(255,255,255,0.10)":"rgba(0,0,0,0.1)"}`,boxShadow:r?"0 8px 24px rgba(0,0,0,0.5)":"0 8px 24px rgba(0,0,0,0.12)"},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",style:{padding:"8px 10px",borderBottom:`1px solid ${r?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"}`},children:[jsxRuntime.jsx(lucideReact.Search,{className:"flex-shrink-0",style:{width:14,height:14,color:r?"rgba(255,255,255,0.20)":"#94A3B8"}}),jsxRuntime.jsx("input",{ref:d,type:"text",value:c,onChange:x=>l(x.target.value),placeholder:o==="es"?"Buscar miembros...":"Search members...",onClick:x=>x.stopPropagation(),style:{flex:1,fontSize:12,color:r?"rgba(255,255,255,0.92)":"#0F172A",backgroundColor:"transparent",border:"none",outline:"none",fontFamily:"Inter, sans-serif"}})]}),e.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",style:{padding:"6px 10px",borderBottom:`1px solid ${r?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"}`},children:e.map((x,h)=>jsxRuntime.jsxs("span",{className:"flex items-center gap-1",style:{fontSize:11,padding:"2px 6px 2px 4px",borderRadius:4,backgroundColor:x.color?`${x.color}20`:r?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)",color:x.color||(r?"#fff":"#334155")},children:[jsxRuntime.jsx("span",{className:"flex items-center justify-center",style:{width:16,height:16,borderRadius:"50%",backgroundColor:x.color||"#3B82F6",fontSize:8,fontWeight:700,color:"#fff"},children:x.avatar?jsxRuntime.jsx("img",{src:x.avatar,alt:x.name,className:"w-full h-full rounded-full object-cover"}):x.initials||hs(x.name)}),x.name.split(" ")[0],jsxRuntime.jsx("button",{onClick:f=>{f.stopPropagation(),a(e.filter(b=>b.name!==x.name));},className:"flex items-center justify-center",style:{width:14,height:14,borderRadius:3,border:"none",background:"transparent",color:"inherit",cursor:"pointer",opacity:.7},children:jsxRuntime.jsx(lucideReact.X,{style:{width:10,height:10}})})]},`${x.name}-${h}`))}),jsxRuntime.jsx("div",{style:{maxHeight:200,overflowY:"auto",padding:4},children:p.length===0?jsxRuntime.jsx("div",{style:{padding:"12px 10px",fontSize:12,color:r?"rgba(255,255,255,0.35)":"#94A3B8",textAlign:"center"},children:o==="es"?"No se encontraron miembros":"No members found"}):p.map(x=>{let h=g(x.name);return jsxRuntime.jsxs("button",{onClick:f=>{f.stopPropagation(),y(x);},className:"flex items-center w-full",style:{gap:8,padding:"6px 10px",borderRadius:4,border:"none",cursor:"pointer",backgroundColor:h?r?"rgba(0, 127, 255, 0.12)":"rgba(59, 130, 246, 0.08)":"transparent",color:r?"rgba(255,255,255,0.92)":"#0F172A",fontSize:12,textAlign:"left",transition:"background-color 0.1s"},onMouseEnter:f=>{h||(f.currentTarget.style.backgroundColor=r?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)");},onMouseLeave:f=>{h||(f.currentTarget.style.backgroundColor="transparent");},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center flex-shrink-0",style:{width:24,height:24,borderRadius:"50%",backgroundColor:x.color||"#3B82F6",fontSize:9,fontWeight:700,color:"#fff"},children:x.avatarUrl?jsxRuntime.jsx("img",{src:x.avatarUrl,alt:x.name,className:"w-full h-full rounded-full object-cover"}):hs(x.name)}),jsxRuntime.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.name}),h&&jsxRuntime.jsx("div",{className:"flex items-center justify-center",style:{width:16,height:16,borderRadius:4,backgroundColor:"rgba(96, 165, 250, 0.2)"},children:jsxRuntime.jsx("div",{style:{width:8,height:8,borderRadius:2,backgroundColor:"#60A5FA"}})})]},x.id)})})]})]})}function jm({startDate:e,endDate:t,onChange:a,singleDateMode:r=false,singleDateField:o="end",isDark:s,locale:n,disabled:i=false,placeholder:c}){let[l,m]=react.useState(false),[d,p]=react.useState(o),[g,y]=react.useState(()=>{let T=o==="start"?e:t;if(T){let k=T instanceof Date?T:new Date(T);return new Date(k.getFullYear(),k.getMonth(),1)}return new Date(new Date().getFullYear(),new Date().getMonth(),1)}),x=react.useRef(null),h=e?e instanceof Date?e:new Date(e):null,f=t?t instanceof Date?t:new Date(t):null;react.useEffect(()=>{let T=k=>{x.current&&!x.current.contains(k.target)&&m(false);};return l&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[l]),react.useEffect(()=>{l&&p(r?o:"start");},[l,r,o]);let b=T=>T?T.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"}):c||"-",v=react.useCallback(()=>{let T=g.getFullYear(),k=g.getMonth(),P=new Date(T,k,1),S=new Date(T,k+1,0).getDate(),J=P.getDay(),R=[],M=new Date(T,k,0).getDate();for(let Z=J-1;Z>=0;Z--)R.push({date:new Date(T,k-1,M-Z),isCurrentMonth:false});for(let Z=1;Z<=S;Z++)R.push({date:new Date(T,k,Z),isCurrentMonth:true});let q=42-R.length;for(let Z=1;Z<=q;Z++)R.push({date:new Date(T,k+1,Z),isCurrentMonth:false});return R},[g]),C=T=>{if(r)o==="start"?a(T,f||void 0):a(h||void 0,T),m(false);else if(d==="start"){let k=f&&T>f?T:f;a(T,k||void 0),p("end");}else {let k=h&&T<h?T:h;a(k||void 0,T),m(false);}},w=()=>{let T=new Date,k=new Date(T);k.setDate(T.getDate()+1);let P=new Date(T);P.setDate(T.getDate()+((6-T.getDay()+7)%7||7));let O=new Date(T);O.setDate(T.getDate()+((1-T.getDay()+7)%7||7));let S=new Date(T);S.setDate(T.getDate()+(6-T.getDay()+7)%7+7);let J=new Date(T);J.setDate(T.getDate()+14);let R=new Date(T);return R.setDate(T.getDate()+28),[{label:n==="es"?"Hoy":"Today",date:T,display:T.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:n==="es"?"Ma\xF1ana":"Tomorrow",date:k,display:k.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:n==="es"?"Este fin de semana":"This weekend",date:P,display:n==="es"?"s\xE1b.":"sat."},{label:n==="es"?"Pr\xF3xima semana":"Next week",date:O,display:n==="es"?"lun.":"mon."},{label:n==="es"?"Pr\xF3ximo fin de semana":"Next weekend",date:S,display:S.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:n==="es"?"2 semanas":"2 weeks",date:J,display:J.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:n==="es"?"4 semanas":"4 weeks",date:R,display:R.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}]};if(i){let T=r&&o==="start"?h:f;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:u("w-4 h-4",s?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("text-sm",s?"text-white/60":"text-gray-500"),children:b(T)})]})}let N=r&&o==="start"?h:f;return jsxRuntime.jsxs("div",{ref:x,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:T=>{T.stopPropagation(),m(!l);let k=o==="start"?h:f;k&&y(new Date(k.getFullYear(),k.getMonth(),1));},className:u("flex items-center gap-2 px-2 py-1 rounded transition-colors",s?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:u("w-4 h-4",s?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("text-sm",s?"text-white/60":"text-gray-500"),children:b(N)})]}),l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>m(false)}),jsxRuntime.jsxs("div",{className:u("absolute z-50 top-full left-0 mt-1 rounded-xl shadow-2xl overflow-hidden flex",s?"bg-[#1A1A1A] border border-[#222]":"bg-white border border-gray-200"),onClick:T=>T.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:u("w-44 py-2 border-r",s?"border-[#222]":"border-gray-200"),children:[w().map((T,k)=>jsxRuntime.jsxs("button",{className:u("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",s?"hover:bg-white/[0.05] text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>C(T.date),children:[jsxRuntime.jsx("span",{children:T.label}),jsxRuntime.jsx("span",{className:u("text-xs",s?"text-white/30":"text-gray-400"),children:T.display})]},k)),jsxRuntime.jsx("div",{className:u("border-t mt-2 pt-2",s?"border-[#222]":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:()=>{r?o==="start"?a(void 0,f||void 0):a(h||void 0,void 0):a(void 0,void 0),m(false);},className:u("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",s?"hover:bg-white/[0.05] text-red-400":"hover:bg-gray-50 text-red-500"),children:[jsxRuntime.jsx("span",{children:n==="es"?"Quitar fecha":"Clear date"}),jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4 opacity-50"})]})})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[!r&&jsxRuntime.jsx("div",{className:u("text-xs mb-3 px-2 py-1 rounded",s?"bg-white/[0.03] text-white/60":"bg-gray-100 text-gray-600"),children:d==="start"?n==="es"?"\u{1F4C5} Selecciona fecha de inicio":"\u{1F4C5} Select start date":n==="es"?"\u{1F4C5} Selecciona fecha de fin":"\u{1F4C5} Select end date"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("span",{className:u("font-medium",s?"text-white":"text-gray-900"),children:g.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>y(new Date),className:u("p-1 rounded text-sm transition-colors",s?"hover:bg-white/[0.05] text-white":"hover:bg-gray-100 text-gray-700"),children:n==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>y(new Date(g.getFullYear(),g.getMonth()-1)),className:u("p-1 rounded",s?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:u("w-4 h-4",s?"text-white":"text-gray-600")})}),jsxRuntime.jsx("button",{onClick:()=>y(new Date(g.getFullYear(),g.getMonth()+1)),className:u("p-1 rounded",s?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:u("w-4 h-4",s?"text-white":"text-gray-600")})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:(n==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(T=>jsxRuntime.jsx("div",{className:u("w-8 h-8 flex items-center justify-center text-xs",s?"text-white/30":"text-gray-400"),children:T},T))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:v().map((T,k)=>{let P=T.date.toDateString()===new Date().toDateString(),O=h?.toDateString()===T.date.toDateString(),S=f?.toDateString()===T.date.toDateString(),J=O||S,R=!r&&h&&f&&T.date>=h&&T.date<=f;return jsxRuntime.jsx("button",{onClick:()=>C(new Date(T.date)),className:u("w-8 h-8 rounded-full flex items-center justify-center text-sm transition-colors",!T.isCurrentMonth&&(s?"text-white/20":"text-gray-300"),T.isCurrentMonth&&(s?"text-white":"text-gray-900"),P&&"ring-2 ring-[#007BFF]",O&&"bg-[#007BFF] text-white",S&&!O&&"bg-[#7C3AED] text-white",R&&!J&&(s?"bg-[#7C3AED]/20":"bg-purple-100"),!J&&(s?"hover:bg-white/[0.05]":"hover:bg-gray-100")),children:T.date.getDate()},k)})})]})]})]})]})}function Hi({value:e,onChange:t,isDark:a,locale:r,disabled:o=false,dateField:s="end",startDate:n,endDate:i}){let c=e?e instanceof Date?e:new Date(e):null;return jsxRuntime.jsx(jm,{startDate:s==="start"?c:n||null,endDate:s==="end"?c:i||null,onChange:(p,g)=>{t&&t(s==="start"?p:g);},singleDateMode:true,singleDateField:s,isDark:a,locale:r,disabled:o||!t,placeholder:"-"})}function Rn(e=600){let[t,a]=react.useState(false),r=react.useRef(null),o=react.useCallback(()=>{r.current&&clearTimeout(r.current),a(true),r.current=setTimeout(()=>{a(false);},e);},[e]);return react.useEffect(()=>()=>{r.current&&clearTimeout(r.current);},[]),{isFlashing:t,triggerFlash:o}}function zi(e,t={}){let{enabled:a=true,duration:r=400,steps:o=8}=t,[s,n]=react.useState(e),[i,c]=react.useState(false),l=react.useRef(e),m=react.useRef([]);return react.useEffect(()=>{if(m.current.forEach(clearTimeout),m.current=[],!a||e===l.current||e===void 0){n(e),l.current=e;return}let d=l.current??0,p=e,g=p-d,y=r/o;c(true);for(let x=1;x<=o;x++){let h=setTimeout(()=>{let f=x/o,b=1-Math.pow(1-f,3),v=Math.round(d+g*b);n(v),x===o&&(c(false),n(p));},y*x);m.current.push(h);}return l.current=e,()=>{m.current.forEach(clearTimeout),m.current=[];}},[e,a,r,o]),{displayValue:s,isAnimating:i}}function Km(e,t={}){let{delay:a=1500,onCancel:r}=t,[o,s]=react.useState(null),[n,i]=react.useState(0),c=react.useRef(null),l=react.useRef(null),m=react.useCallback(g=>{c.current&&clearTimeout(c.current),l.current&&clearInterval(l.current),s(g),i(0);let y=Date.now();l.current=setInterval(()=>{let x=Date.now()-y,h=Math.min(x/a*100,100);i(h);},16),c.current=setTimeout(()=>{l.current&&clearInterval(l.current),e?.(g),s(null),i(0);},a);},[a,e]),d=react.useCallback(()=>{c.current&&clearTimeout(c.current),l.current&&clearInterval(l.current),s(null),i(0),r?.();},[r]);return react.useEffect(()=>()=>{c.current&&clearTimeout(c.current),l.current&&clearInterval(l.current);},[]),{pendingValue:o,isPending:o!==null,progress:n,startChange:m,cancelChange:d}}function qm({value:e=0,onChange:t,isDark:a,disabled:r=false,enableSlotMachine:o=true,enableSaveFlash:s=true}){let[n,i]=react.useState(false),[c,l]=react.useState(""),m=react.useRef(null),{isFlashing:d,triggerFlash:p}=Rn(),{displayValue:g,isAnimating:y}=zi(e,{enabled:o,duration:300,steps:6}),x=C=>{if(r||!t)return;C.stopPropagation();let w=C.currentTarget.getBoundingClientRect(),N=C.clientX-w.left,T=Math.round(N/w.width*100),k=Math.max(0,Math.min(100,T));k!==e&&(t(k),s&&p());},h=react.useCallback(C=>{r||!t||(C.stopPropagation(),l(String(e)),i(true));},[r,t,e]);react.useEffect(()=>{n&&m.current&&(m.current.focus(),m.current.select());},[n]);let f=react.useCallback(()=>{i(false);let C=parseInt(c,10);if(!isNaN(C)&&t){let w=Math.max(0,Math.min(100,C));w!==e&&(t(w),s&&p());}},[c,t,e,s,p]),b=react.useCallback(C=>{C.key==="Enter"&&f(),C.key==="Escape"&&i(false);},[f]),v=g??e;return jsxRuntime.jsxs("div",{className:u("flex items-center gap-2 w-full rounded px-1 py-0.5 transition-[background-color] duration-300",d&&(a?"bg-[#3BF06E]/30":"bg-[#3BF06E]/20")),children:[jsxRuntime.jsx("div",{onClick:x,className:u("flex-1 h-2 rounded-full overflow-hidden",a?"bg-white/[0.05]":"bg-gray-200",!r&&t&&"cursor-pointer"),children:jsxRuntime.jsx("div",{className:u("h-full rounded-full transition-[width]",v===100?"bg-[#3BF06E]":"bg-[#3B9EFF]",y&&"transition-none"),style:{width:`${v}%`}})}),n?jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",onClick:C=>C.stopPropagation(),children:[jsxRuntime.jsx("input",{ref:m,value:c,onChange:C=>l(C.target.value.replace(/[^0-9]/g,"")),onBlur:f,onKeyDown:b,maxLength:3,className:u("w-8 text-xs text-right tabular-nums font-mono rounded border px-1 py-0 outline-none",a?"bg-white/10 border-white/20 text-white focus:border-blue-400":"bg-white border-gray-300 text-gray-900 focus:border-blue-500")}),jsxRuntime.jsx("span",{className:u("text-xs font-mono",a?"text-white/40":"text-gray-400"),children:"%"})]}):jsxRuntime.jsxs("span",{onClick:h,className:u("text-xs w-8 text-right tabular-nums font-mono rounded px-1",a?"text-white/60":"text-gray-500",!r&&t&&"cursor-pointer hover:bg-white/[0.08]",y&&"font-medium scale-105"),title:!r&&t?"Click to edit":void 0,children:[v,"%"]})]})}function Qm({value:e="",onChange:t,isDark:a,placeholder:r="-",disabled:o=false}){let[s,n]=react.useState(false),[i,c]=react.useState(e),l=react.useRef(null);react.useEffect(()=>{s&&l.current&&(l.current.focus(),l.current.select());},[s]),react.useEffect(()=>{c(e);},[e]);let m=()=>{i!==e&&t?.(i),n(false);},d=p=>{p.key==="Enter"?m():p.key==="Escape"&&(c(e),n(false));};return o||!t?jsxRuntime.jsx("span",{className:u("text-sm truncate",a?"text-white/60":"text-gray-500"),children:e||r}):s?jsxRuntime.jsx("input",{ref:l,type:"text",value:i,onChange:p=>c(p.target.value),onBlur:m,onKeyDown:d,onClick:p=>p.stopPropagation(),className:u("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/[0.03] border-[#007BFF] text-white":"bg-white border-[#007BFF] text-gray-900")}):jsxRuntime.jsx("button",{onClick:p=>{p.stopPropagation(),n(true);},className:u("text-sm truncate text-left w-full px-2 py-1 rounded transition-colors",a?"text-white/60 hover:bg-white/[0.05]":"text-gray-500 hover:bg-gray-100",!e&&(a?"text-white/30":"text-gray-400")),children:e||r})}function tg({value:e,onChange:t,isDark:a,placeholder:r="-",min:o,max:s,disabled:n=false,enableSlotMachine:i=true,enableSaveFlash:c=true}){let[l,m]=react.useState(false),[d,p]=react.useState(e?.toString()||""),g=react.useRef(null),{isFlashing:y,triggerFlash:x}=Rn(),{displayValue:h,isAnimating:f}=zi(e,{enabled:i&&!l});react.useEffect(()=>{l&&g.current&&(g.current.focus(),g.current.select());},[l]),react.useEffect(()=>{p(e?.toString()||"");},[e]);let b=()=>{let C=parseFloat(d);if(!isNaN(C)){let w=C;o!==void 0&&(w=Math.max(o,w)),s!==void 0&&(w=Math.min(s,w)),w!==e&&(t?.(w),c&&x());}m(false);},v=C=>{C.key==="Enter"?b():C.key==="Escape"&&(p(e?.toString()||""),m(false));};return n||!t?jsxRuntime.jsx("span",{className:u("text-sm font-mono",a?"text-white/60":"text-gray-500",f&&"font-medium"),children:h!==void 0?h:r}):l?jsxRuntime.jsx("input",{ref:g,type:"number",value:d,onChange:C=>p(C.target.value),onBlur:b,onKeyDown:v,onClick:C=>C.stopPropagation(),min:o,max:s,className:u("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/[0.03] border-[#007BFF] text-white":"bg-white border-[#007BFF] text-gray-900")}):jsxRuntime.jsx("button",{onClick:C=>{C.stopPropagation(),m(true);},className:u("text-sm text-left w-full px-2 py-1 rounded transition-[background-color] duration-300",a?"text-white/60 hover:bg-white/[0.05]":"text-gray-500 hover:bg-gray-100",h===void 0&&(a?"text-white/30":"text-gray-400"),y&&(a?"bg-green-500/30":"bg-green-500/20"),f&&"font-medium scale-105"),children:h!==void 0?h:r})}function ag({value:e,options:t=[],onChange:a,isDark:r,placeholder:o="-",disabled:s=false}){let[n,i]=react.useState(false),c=react.useRef(null);return react.useEffect(()=>{let l=m=>{c.current&&!c.current.contains(m.target)&&i(false);};return n&&document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[n]),s||!a?jsxRuntime.jsx("span",{className:u("text-sm",r?"text-white/60":"text-gray-500"),children:e||o}):jsxRuntime.jsxs("div",{ref:c,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:l=>{l.stopPropagation(),i(!n);},className:u("flex items-center gap-2 px-2 py-1 rounded transition-colors min-w-[80px]",r?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:[jsxRuntime.jsx("span",{className:u("text-sm flex-1 text-left truncate",r?"text-white/60":"text-gray-500",!e&&(r?"text-white/30":"text-gray-400")),children:e||o}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-3 h-3 flex-shrink-0",r?"text-white/30":"text-gray-400")})]}),n&&jsxRuntime.jsx("div",{className:u("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px] max-h-48 overflow-y-auto",r?"bg-[#1A1A1A] border-[#222]":"bg-white border-gray-200"),children:t.length===0?jsxRuntime.jsx("p",{className:u("px-3 py-2 text-sm",r?"text-white/30":"text-gray-400"),children:"No options"}):t.map(l=>jsxRuntime.jsxs("button",{onClick:m=>{m.stopPropagation(),a(l),i(false);},className:u("w-full flex items-center justify-between gap-2 px-3 py-2 text-sm transition-colors",r?"hover:bg-white/[0.05]":"hover:bg-gray-100",e===l&&(r?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:l}),e===l&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-[#007BFF]"})]},l))})]})}function og({value:e=false,onChange:t,isDark:a,disabled:r=false,enableDelayedConfirm:o=true,confirmDelay:s=1500}){let{pendingValue:n,isPending:i,progress:c,startChange:l,cancelChange:m}=Km(t,{delay:s}),d=g=>{g.stopPropagation(),!r&&t&&(o?i?m():l(!e):t(!e));},p=i?n:e;return jsxRuntime.jsxs("div",{className:"relative inline-flex items-center gap-1",children:[jsxRuntime.jsxs("button",{onClick:d,disabled:r||!t,className:u("relative w-5 h-5 rounded border-2 flex items-center justify-center transition-[border-color,background-color,box-shadow]",p?"bg-[#007BFF] border-[#007BFF]":a?"border-[#333] hover:border-[#6B7280]":"border-gray-300 hover:border-gray-400",(r||!t)&&"opacity-50 cursor-not-allowed",i&&"ring-2 ring-offset-1",i&&p&&"ring-green-500/50",i&&!p&&"ring-red-500/50",i&&(a?"ring-offset-[#050505]":"ring-offset-white")),children:[i&&jsxRuntime.jsx("svg",{className:"absolute inset-0 w-full h-full -rotate-90",viewBox:"0 0 20 20",children:jsxRuntime.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:p?"#22C55E":"#EF4444",strokeWidth:"2",strokeDasharray:`${c/100*50.26} 50.26`,className:"transition-all duration-100"})}),i?jsxRuntime.jsx(lucideReact.Loader2,{className:"w-3 h-3 text-white animate-spin"}):p?jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"}):null]}),i&&jsxRuntime.jsx("button",{onClick:g=>{g.stopPropagation(),m();},className:u("w-4 h-4 rounded-full flex items-center justify-center transition-colors",a?"bg-red-500/20 hover:bg-red-500/40 text-red-400":"bg-red-100 hover:bg-red-200 text-red-500"),title:"Cancelar",children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]})}function ig({value:e=[],isDark:t,maxVisible:a=2}){if(e.length===0)return jsxRuntime.jsx("span",{className:u("text-sm",t?"text-white/30":"text-gray-400"),children:"-"});let r=e.slice(0,a),o=e.length-a;return jsxRuntime.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[r.map(s=>jsxRuntime.jsx("span",{className:"inline-flex items-center px-2 py-0.5 text-[9px] font-mono uppercase tracking-wide rounded",style:{backgroundColor:s.color?`${s.color}20`:t?"rgba(255,255,255,0.05)":"#F3F4F6",color:s.color||(t?"rgba(255,255,255,0.5)":"#6B7280")},children:s.name},s.id)),o>0&&jsxRuntime.jsxs("span",{className:u("inline-flex items-center px-2 py-0.5 text-xs rounded-full",t?"bg-white/[0.05] text-white/60":"bg-gray-100 text-gray-500"),children:["+",o]})]})}function G2(e,t="en"){if(e==null||e===0||!e||Number(e)===0)return "-";let a=Math.floor(e/60),r=e%60;return a===0?`${r}m`:r===0?`${a}h`:`${a}h ${r}m`}function V2(e){let t=e.trim().toLowerCase();if(!t||t==="-")return null;let a=t.match(/^(\d+):(\d+)$/);if(a&&a[1]&&a[2]){let i=parseInt(a[1],10),c=parseInt(a[2],10);return i*60+c}let r=t.match(/^(\d+\.?\d*)\s*h\s*(\d+)?\s*(m|min)?$/);if(r&&r[1]){let i=parseFloat(r[1]),c=r[2]?parseInt(r[2],10):0;return Math.round(i*60)+c}let o=t.match(/^(\d+\.?\d*)\s*h$/);if(o&&o[1])return Math.round(parseFloat(o[1])*60);let s=t.match(/^(\d+)\s*(m|min)$/);if(s&&s[1])return parseInt(s[1],10);let n=parseFloat(t);return isNaN(n)?null:Math.round(n*60)}function hr({value:e,onChange:t,isDark:a,locale:r="en",placeholder:o,disabled:s=false,enableSaveFlash:n=true,isBlurred:i=false,lens:c="hours",hourlyRate:l=0}){let[m,d]=react.useState(false),[p,g]=react.useState(""),y=react.useRef(null),{isFlashing:x,triggerFlash:h}=Rn(),f=c==="financial"&&l>0,b=f&&e?`$${Math.round(e/60*l).toLocaleString("en-US")}`:G2(e,r);react.useEffect(()=>{m&&y.current&&(y.current.focus(),y.current.select());},[m]),react.useEffect(()=>{if(e){let N=Math.floor(e/60),T=e%60;N>0&&T>0?g(`${N}h ${T}m`):N>0?g(`${N}h`):g(`${T}m`);}else g("");},[e,m]);let v=()=>{let N=V2(p);N!==e&&(t?.(N),n&&h()),d(false);},C=N=>{N.key==="Enter"?v():N.key==="Escape"&&d(false);};if(i)return jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",title:r==="es"?"No tienes permisos para ver este dato":"You don't have permission to view this data",children:[jsxRuntime.jsx(lucideReact.Clock,{className:u("w-3.5 h-3.5 flex-shrink-0",a?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("text-sm select-none blur-[4px] opacity-60 pointer-events-none",a?"text-white/60":"text-gray-500"),"aria-hidden":"true",children:"\u2022\u2022\u2022\u2022"})]});let w=f?lucideReact.DollarSign:lucideReact.Clock;return s||!t?!e||e===0?null:jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(w,{className:u("w-3.5 h-3.5 flex-shrink-0",a?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("text-sm font-mono",a?"text-white/60":"text-gray-500"),children:b})]}):m?jsxRuntime.jsx("input",{ref:y,type:"text",value:p,onChange:N=>g(N.target.value),onBlur:v,onKeyDown:C,onClick:N=>N.stopPropagation(),placeholder:"8 (=8h), 1h 30m",className:u("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/[0.03] border-[#007BFF] text-white placeholder:text-white/30":"bg-white border-[#007BFF] text-gray-900 placeholder:text-gray-400")}):jsxRuntime.jsxs("button",{onClick:N=>{N.stopPropagation(),d(true);},className:u("flex items-center gap-1 text-sm text-left w-full px-1.5 py-1 rounded transition-[background-color] duration-300 overflow-hidden",a?"hover:bg-white/[0.05]":"hover:bg-gray-100",e!=null&&e>0?a?"text-white/60":"text-gray-600":a?"text-white/30":"text-gray-400",x&&(a?"bg-green-500/30":"bg-green-500/20")),children:[e!=null&&e>0&&jsxRuntime.jsx(w,{className:u("w-3 h-3 flex-shrink-0",a?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:"truncate font-mono",children:b})]})}function ug({startDate:e,endDate:t,scheduleVariance:a,isDark:r,locale:o="en",hasTimeAllocated:s=true}){if(!e&&!t)return jsxRuntime.jsx("span",{className:u("text-[11px] font-mono",r?"text-white/30":"text-gray-400"),children:"-"});let n=c=>c.toLocaleDateString(o==="es"?"es-ES":"en-US",{month:"short",day:"numeric"}),i=()=>{if(a==null)return null;let c=o==="es";return a===0?s?jsxRuntime.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#3B9EFF",fontWeight:600},children:c?"En Tiempo":"On Track"}):jsxRuntime.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:r?"rgba(255,255,255,0.3)":"#94A3B8",fontWeight:500},children:c?"Tiempo no asignado":"No time allocated"}):a>0?jsxRuntime.jsxs("span",{className:"font-mono",style:{fontSize:"10px",color:"#3BF06E",fontWeight:600},children:["+",a,"d ",c?"Adelante":"Early"]}):jsxRuntime.jsxs("span",{className:"font-mono",style:{fontSize:"10px",color:"#FF2D20",fontWeight:600},children:[a,"d ",c?"Atraso":"Delay"]})};return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[jsxRuntime.jsxs("span",{className:u("text-[11px] font-mono",r?"text-white/60":"text-gray-500"),children:[e?n(e):"\u2014",jsxRuntime.jsx("span",{className:r?"text-white/20 mx-1":"text-gray-300 mx-1",children:"vs"}),t?n(t):"\u2014"]}),i()]})}function mg({task:e,isDark:t,locale:a="en",onLogTime:r,onEstimateUpdate:o,onSoldEffortUpdate:s,onOpenTimeLog:n,lens:i="hours",hourlyRate:c=0}){let l=a==="es",m=i==="financial"&&c>0,d=Z=>m?`$${Math.round(Z*c).toLocaleString("en-US")}`:`${Z}h`,[p,g]=react.useState(false),[y,x]=react.useState(false),[h,f]=react.useState(null),b=react.useRef(null),v=e.timeLoggedMinutes||0,C=e.effortMinutes||0,w=e.soldEffortMinutes||0,N=Math.round(v/60*10)/10,T=Math.round(C/60*10)/10,k=C>0?v/C*100:0,P=k>100?Math.round((v-C)/60*10)/10:0,O=k>100?"#EF4444":"#00E5CC";react.useEffect(()=>{if(!y&&!h)return;let Z=Re=>{b.current&&!b.current.contains(Re.target)&&(x(false),f(null));};return document.addEventListener("mousedown",Z),()=>document.removeEventListener("mousedown",Z)},[y,h]);let S=Z=>{if(Z.stopPropagation(),r&&!o&&!s){f("log");return}if(r||o||s){x(Re=>!Re),f(null);return}n&&n(e);},J=Z=>{x(false),f(Z);},R=async(Z,Re)=>{h==="log"&&r&&Z?r(e,Z,Re):h==="estimate"&&o?o(e,Z):h==="quoted"&&s&&s(e,Z),f(null);},$=r||o||s||n,M=[{mode:"log",icon:lucideReact.Clock,label:l?"Registrar tiempo":"Log time",show:!!r},{mode:"estimate",icon:lucideReact.Target,label:l?"Estimaci\xF3n":"Estimate",show:!!o},{mode:"quoted",icon:lucideReact.DollarSign,label:l?"T. Ofertado":"Quoted time",show:!!s}].filter(Z=>Z.show),q=h==="estimate"?C:h==="quoted"?w:void 0;return C===0&&v===0&&w===0?jsxRuntime.jsxs("div",{ref:b,className:"relative flex items-center gap-2",onClick:Z=>Z.stopPropagation(),onMouseEnter:()=>g(true),onMouseLeave:()=>g(false),children:[jsxRuntime.jsx("span",{className:u("text-[11px] font-mono",t?"text-white/30":"text-gray-400"),children:"\u2014"}),p&&$&&jsxRuntime.jsx("button",{onClick:S,className:"flex items-center justify-center w-6 h-6 rounded-md transition-colors",style:{color:t?"rgba(255,255,255,0.35)":"#9CA3AF",backgroundColor:"transparent"},onMouseEnter:Z=>{Z.currentTarget.style.color=t?"rgba(255,255,255,0.8)":"#374151",Z.currentTarget.style.backgroundColor=t?"rgba(255,255,255,0.06)":"#F3F4F6";},onMouseLeave:Z=>{Z.currentTarget.style.color=t?"rgba(255,255,255,0.35)":"#9CA3AF",Z.currentTarget.style.backgroundColor="transparent";},title:l?"+ Tiempo":"+ Time",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:y&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.1},className:"absolute right-0 top-full mt-1 z-50",style:{background:t?"rgba(10,10,10,0.95)":"#FFFFFF",border:t?"1px solid rgba(255,255,255,0.10)":"1px solid #E5E7EB",borderRadius:8,boxShadow:t?"0 8px 32px rgba(0,0,0,0.6)":"0 8px 32px rgba(0,0,0,0.12)",backdropFilter:"blur(16px)",overflow:"hidden",minWidth:160},children:M.map(Z=>jsxRuntime.jsxs("button",{onClick:Re=>{Re.stopPropagation(),J(Z.mode);},className:"w-full flex items-center gap-2 px-3 py-2 text-left transition-colors",style:{fontSize:11,fontFamily:"'JetBrains Mono', monospace",color:t?"rgba(255,255,255,0.7)":"#374151",background:"transparent",border:"none",cursor:"pointer"},onMouseEnter:Re=>{Re.target.style.background=t?"rgba(255,255,255,0.06)":"#F3F4F6";},onMouseLeave:Re=>{Re.target.style.background="transparent";},children:[jsxRuntime.jsx(Z.icon,{style:{width:12,height:12,flexShrink:0,opacity:.5}}),Z.label]},Z.mode))})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:h&&jsxRuntime.jsx("div",{className:"absolute right-0 top-full mt-1 z-50",children:jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.12},children:jsxRuntime.jsx(ao,{mode:h,locale:a,isDark:t,currentValue:q||void 0,onSave:R,onClose:()=>f(null)})})})})]}):jsxRuntime.jsxs("div",{ref:b,className:"relative flex items-center gap-2 w-full",onClick:Z=>Z.stopPropagation(),onMouseEnter:()=>g(true),onMouseLeave:()=>g(false),children:[jsxRuntime.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",style:{padding:"8px 12px",borderRadius:"4px",border:t?"1px solid #333":"1px solid #E5E7EB",backgroundColor:t?"#1A1A1A":"#F9FAFB"},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"font-mono",style:{fontSize:13,fontWeight:700,color:t?"#FFFFFF":"#111827"},children:d(N)}),C>0&&jsxRuntime.jsxs("span",{className:"font-mono",style:{fontSize:11,color:t?"rgba(255,255,255,0.3)":"#9CA3AF"},children:["/ ",d(T)]}),P>0&&jsxRuntime.jsxs("span",{className:"font-mono px-1.5 py-0.5 rounded",style:{fontSize:10,color:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)"},children:["+",d(P)," Over"]})]}),C>0&&jsxRuntime.jsx("div",{className:"w-full overflow-hidden",style:{height:3,backgroundColor:t?"#333":"#E5E7EB",borderRadius:2},children:jsxRuntime.jsx("div",{style:{height:"100%",width:`${Math.min(k,100)}%`,backgroundColor:O,borderRadius:2,transition:"width 0.3s"}})})]}),$&&jsxRuntime.jsx("button",{onClick:S,className:"flex-shrink-0 flex items-center justify-center w-7 h-7 rounded-md transition-all duration-150",style:{opacity:p?1:0,pointerEvents:p?"auto":"none",color:t?"rgba(255,255,255,0.35)":"#9CA3AF",backgroundColor:"transparent",border:"none"},onMouseEnter:Z=>{Z.currentTarget.style.color=t?"rgba(255,255,255,0.8)":"#374151",Z.currentTarget.style.backgroundColor=t?"rgba(255,255,255,0.06)":"#F3F4F6";},onMouseLeave:Z=>{Z.currentTarget.style.color=t?"rgba(255,255,255,0.35)":"#9CA3AF",Z.currentTarget.style.backgroundColor="transparent";},title:l?"+ Tiempo":"+ Time",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:y&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.1},className:"absolute right-0 top-full mt-1 z-50",style:{background:t?"rgba(10,10,10,0.95)":"#FFFFFF",border:t?"1px solid rgba(255,255,255,0.10)":"1px solid #E5E7EB",borderRadius:8,boxShadow:t?"0 8px 32px rgba(0,0,0,0.6)":"0 8px 32px rgba(0,0,0,0.12)",backdropFilter:"blur(16px)",overflow:"hidden",minWidth:160},children:M.map(Z=>jsxRuntime.jsxs("button",{onClick:Re=>{Re.stopPropagation(),J(Z.mode);},className:"w-full flex items-center gap-2 px-3 py-2 text-left transition-colors",style:{fontSize:11,fontFamily:"'JetBrains Mono', monospace",color:t?"rgba(255,255,255,0.7)":"#374151",background:"transparent",border:"none",cursor:"pointer"},onMouseEnter:Re=>{Re.target.style.background=t?"rgba(255,255,255,0.06)":"#F3F4F6";},onMouseLeave:Re=>{Re.target.style.background="transparent";},children:[jsxRuntime.jsx(Z.icon,{style:{width:12,height:12,flexShrink:0,opacity:.5}}),Z.label]},Z.mode))})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:h&&jsxRuntime.jsx("div",{className:"absolute right-0 top-full mt-1 z-50",children:jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.12},children:jsxRuntime.jsx(ao,{mode:h,locale:a,isDark:t,currentValue:q||void 0,onSave:R,onClose:()=>f(null)})})})})]})}function J2(e){let t=new Map;function a(r){if(r.assignees)for(let o of r.assignees)o.name&&!t.has(o.name)&&t.set(o.name,o);if(r.subtasks)for(let o of r.subtasks)a(o);}return a(e),Array.from(t.values())}function Q2(e){return e>100?{bg:"rgba(239,68,68,0.15)",text:"#EF4444"}:e>=86?{bg:"rgba(245,158,11,0.15)",text:"#F59E0B"}:e>=61?{bg:"rgba(0,229,204,0.15)",text:"#00E5CC"}:{bg:"rgba(34,197,94,0.15)",text:"#22C55E"}}function gg({assignee:e,size:t=28,isDark:a}){let r=t===28?"w-7 h-7":t===24?"w-6 h-6":"w-5 h-5",o=t===28?"text-[10px]":"text-[9px]";return e.avatar?jsxRuntime.jsx("img",{src:e.avatar,alt:e.name,className:u(r,"rounded-full object-cover ring-1 flex-shrink-0",a?"ring-white/10":"ring-gray-200")}):jsxRuntime.jsx("div",{className:u(r,"rounded-full flex items-center justify-center font-bold text-white ring-1 flex-shrink-0",o,a?"ring-white/10":"ring-gray-200"),style:{backgroundColor:e.color||"#6B7280"},children:e.initials||e.name?.charAt(0)?.toUpperCase()||"?"})}function fg({task:e,isDark:t,locale:a="en"}){let r=a==="es",o=!!e.hasChildren,s=e.assignees?.[0],n=e.teamLoad;if(o){let m=J2(e);if(m.length===0)return null;let d=m.slice(0,3),p=m.length-3;return jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("div",{className:"flex -space-x-2",children:d.map((g,y)=>jsxRuntime.jsx(gg,{assignee:g,size:24,isDark:t},g.name+y))}),p>0&&jsxRuntime.jsxs("span",{className:u("ml-1 text-[10px] font-mono",t?"text-white/40":"text-gray-400"),title:m.slice(3).map(g=>g.name).join(", "),children:["+",p]})]})}if(!s)return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:u("w-7 h-7 rounded-full flex items-center justify-center flex-shrink-0",t?"bg-white/5":"bg-gray-100"),children:jsxRuntime.jsx(lucideReact.User,{className:"w-3.5 h-3.5",style:{color:"#4B5563"}})}),jsxRuntime.jsx("span",{className:u("text-[11px]",t?"text-white/30":"text-gray-400"),children:r?"Sin asignar":"Unassigned"})]});let i=n?.percentage??0,c=!!n&&i>0,l=c?Q2(i):null;return jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(gg,{assignee:s,size:28,isDark:t}),jsxRuntime.jsx("span",{className:u("text-[13px] truncate",t?"text-white":"text-gray-900"),style:{maxWidth:"100px"},children:s.name})]}),c&&l&&jsxRuntime.jsxs("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono uppercase tracking-wide w-fit font-semibold",style:{backgroundColor:l.bg,color:l.text},children:[i,"% LOAD"]})]})}var Z2={critical:"bg-[#FF2D20]/15 text-[#FF2D20]",warning:"bg-[#FFD60A]/15 text-[#FFD60A]",info:"bg-[#3B9EFF]/15 text-[#3B9EFF]"};function hg({blockers:e,isDark:t,locale:a="en"}){return !e||e.length===0?jsxRuntime.jsx("span",{className:u("text-[9px] font-mono uppercase tracking-wide",t?"text-white/20":"text-gray-400"),children:a==="es"?"Ninguno":"None"}):jsxRuntime.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:e.map((r,o)=>jsxRuntime.jsxs("span",{className:u("px-1.5 py-0.5 rounded text-[9px] font-mono uppercase tracking-wide whitespace-nowrap",Z2[r.severity]),children:[r.type," #",r.id]},`${r.type}-${r.id}-${o}`))})}function g1(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function f1(e){let t=["blue","green","purple","pink","yellow","red","indigo","teal"],a=0;for(let r=0;r<e.length;r++)a=e.charCodeAt(r)+((a<<5)-a);return t[Math.abs(a)%t.length]??"blue"}function Cg({state:e,onClose:t,isDark:a,locale:r,onTaskEdit:o,onTaskDuplicate:s,onTaskDelete:n,onTaskUpdate:i,onColumnHide:c,onColumnSort:l,availableUsers:m=[],onOpenTimeLog:d,onReportBlocker:p,onCopyTaskLink:g,onTaskMove:y,onTaskIndent:x,onTaskOutdent:h}){let f=react.useRef(null),b=r==="es"?vg.es:vg.en;if(react.useEffect(()=>{let T=P=>{f.current&&!f.current.contains(P.target)&&t();},k=P=>{P.key==="Escape"&&t();};return document.addEventListener("mousedown",T),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",k);}},[t]),!e.isOpen)return null;let v=()=>{if(!e.task)return [];let T=[];return o&&T.push({id:"edit",label:b.edit,icon:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),onClick:()=>{o(e.task),t();}}),T.push({id:"sep1",label:"",icon:null,separator:true}),i&&(T.push({id:"status",label:b.changeStatus,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),submenu:[{id:"status-todo",label:b.todo,icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4 text-gray-400"}),onClick:()=>{i({...e.task,status:"todo",progress:0}),t();}},{id:"status-in-progress",label:b.inProgress,icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4 text-blue-500"}),onClick:()=>{i({...e.task,status:"in-progress",progress:e.task.progress||50}),t();}},{id:"status-completed",label:b.completed,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4 text-green-500"}),onClick:()=>{i({...e.task,status:"completed",progress:100}),t();}}]}),T.push({id:"priority",label:b.changePriority,icon:jsxRuntime.jsx(lucideReact.Flag,{className:"w-4 h-4"}),submenu:[{id:"priority-urgent",label:b.urgent,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),onClick:()=>{i({...e.task,priority:"urgent"}),t();}},{id:"priority-high",label:b.high,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-orange-500"}),onClick:()=>{i({...e.task,priority:"high"}),t();}},{id:"priority-medium",label:b.medium,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),onClick:()=>{i({...e.task,priority:"medium"}),t();}},{id:"priority-low",label:b.low,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-500"}),onClick:()=>{i({...e.task,priority:"low"}),t();}}]}),m.length>0&&T.push({id:"assign",label:b.assignUser,icon:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),submenu:m.slice(0,5).map(k=>({id:`assign-${k.id}`,label:k.name,icon:jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[10px] text-white bg-blue-500",children:k.name.charAt(0).toUpperCase()}),onClick:()=>{let P=e.task.assignees||[],S=P.some(J=>J.name===k.name)?P.filter(J=>J.name!==k.name):[...P,{name:k.name,initials:g1(k.name),color:k.color||f1(k.name),avatar:k.avatarUrl}];i({...e.task,assignees:S}),t();}}))})),d&&T.push({id:"log-time",label:b.logTime,icon:jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),onClick:()=>{d(e.task),t();}}),p&&T.push({id:"report-blocker",label:b.reportBlocker,icon:jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-4 h-4"}),onClick:()=>{p(e.task),t();}}),g&&T.push({id:"copy-link",label:b.copyLink,icon:jsxRuntime.jsx(lucideReact.Link2,{className:"w-4 h-4"}),onClick:()=>{g(e.task),t();}}),T.push({id:"sep2",label:"",icon:null,separator:true}),s&&T.push({id:"duplicate",label:b.duplicate,icon:jsxRuntime.jsx(lucideReact.Copy,{className:"w-4 h-4"}),onClick:()=>{s(e.task),t();}}),(y||x||h)&&(T.push({id:"sep3",label:"",icon:null,separator:true}),y&&(T.push({id:"move-up",label:b.moveUp,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),onClick:()=>{y(e.task.id,"up"),t();}}),T.push({id:"move-down",label:b.moveDown,icon:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),onClick:()=>{y(e.task.id,"down"),t();}})),x&&T.push({id:"indent",label:b.indent,icon:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"}),onClick:()=>{x(e.task.id),t();}}),h&&T.push({id:"outdent",label:b.outdent,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4 -rotate-90"}),onClick:()=>{h(e.task.id),t();}})),n&&T.push({id:"delete",label:b.delete,icon:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),danger:true,onClick:()=>{n(e.task.id),t();}}),T},C=()=>{if(!e.columnId)return [];let T=[];return l&&(T.push({id:"sort-asc",label:b.sortAsc,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),onClick:()=>{l(e.columnId,"asc"),t();}}),T.push({id:"sort-desc",label:b.sortDesc,icon:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),onClick:()=>{l(e.columnId,"desc"),t();}})),c&&e.columnId!=="name"&&(T.push({id:"sep-hide",label:"",icon:null,separator:true}),T.push({id:"hide",label:b.hideColumn,icon:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),onClick:()=>{c(e.columnId),t();}})),T},w=e.type==="task"?v():C(),N={position:"fixed",left:e.x,top:e.y,zIndex:9999};return jsxRuntime.jsx("div",{ref:f,style:N,className:u("py-1 rounded-lg shadow-xl border min-w-[180px]",a?"bg-[#0D0D0D] border-[#222]":"bg-white border-gray-200"),children:w.map(T=>T.separator?jsxRuntime.jsx("div",{className:u("my-1 h-px",a?"bg-white/[0.05]":"bg-gray-200")},T.id):T.submenu?jsxRuntime.jsx(b1,{item:T,isDark:a},T.id):jsxRuntime.jsxs("button",{onClick:T.onClick,className:u("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100",T.danger?"text-red-500 hover:text-red-600":a?"text-white":"text-gray-700"),children:[jsxRuntime.jsx("span",{className:u(T.danger?"text-red-500":a?"text-white/60":"text-gray-400"),children:T.icon}),T.label]},T.id))})}function b1({item:e,isDark:t}){let[a,r]=react.useState(false),o=react.useRef();return jsxRuntime.jsxs("div",{className:"relative",onMouseEnter:()=>{o.current&&clearTimeout(o.current),r(true);},onMouseLeave:()=>{o.current=setTimeout(()=>r(false),150);},children:[jsxRuntime.jsxs("button",{className:u("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/[0.05] text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-white/60":"text-gray-400",children:e.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:e.label}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:u("w-4 h-4",t?"text-white/30":"text-gray-400")})]}),a&&e.submenu&&jsxRuntime.jsx("div",{className:u("absolute left-full top-0 ml-1 py-1 rounded-lg shadow-xl border min-w-[160px]",t?"bg-[#0D0D0D] border-[#222]":"bg-white border-gray-200"),children:e.submenu.map(i=>jsxRuntime.jsxs("button",{onClick:i.onClick,className:u("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/[0.05] text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-white/60":"text-gray-400",children:i.icon}),i.label]},i.id))})]})}var vg={en:{edit:"Edit",changeStatus:"Change status",changePriority:"Change priority",assignUser:"Assign user",duplicate:"Duplicate",moveUp:"Move up",moveDown:"Move down",indent:"Make subtask",outdent:"Remove from parent",delete:"Delete",todo:"To Do",inProgress:"In Progress",completed:"Completed",urgent:"Urgent",high:"High",medium:"Medium",low:"Low",sortAsc:"Sort A \u2192 Z",sortDesc:"Sort Z \u2192 A",hideColumn:"Hide column",logTime:"Log Time",reportBlocker:"Report Blocker",copyLink:"Copy Link"},es:{edit:"Editar",changeStatus:"Cambiar estado",changePriority:"Cambiar prioridad",assignUser:"Asignar usuario",duplicate:"Duplicar",moveUp:"Mover arriba",moveDown:"Mover abajo",indent:"Convertir en subtarea",outdent:"Sacar de subtarea",delete:"Eliminar",todo:"Pendiente",inProgress:"En Progreso",completed:"Completado",urgent:"Urgente",high:"Alta",medium:"Media",low:"Baja",sortAsc:"Ordenar A \u2192 Z",sortDesc:"Ordenar Z \u2192 A",hideColumn:"Ocultar columna",logTime:"Registrar Tiempo",reportBlocker:"Reportar Bloqueante",copyLink:"Copiar Enlace"}};var Ag={name:jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),status:jsxRuntime.jsx(lucideReact.CircleDot,{className:"w-4 h-4"}),priority:jsxRuntime.jsx(lucideReact.Flag,{className:"w-4 h-4"}),assignees:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),startDate:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),endDate:jsxRuntime.jsx(lucideReact.CalendarCheck,{className:"w-4 h-4"}),progress:jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"}),tags:jsxRuntime.jsx(lucideReact.Tag,{className:"w-4 h-4"}),estimatedTime:jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),quotedTime:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),elapsedTime:jsxRuntime.jsx(lucideReact.Timer,{className:"w-4 h-4"}),effortMinutes:jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),timeLoggedMinutes:jsxRuntime.jsx(lucideReact.Timer,{className:"w-4 h-4"}),soldEffortMinutes:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),scheduleVariance:jsxRuntime.jsx(lucideReact.CalendarClock,{className:"w-4 h-4"}),hoursBar:jsxRuntime.jsx(lucideReact.BarChart3,{className:"w-4 h-4"}),teamLoad:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),blockers:jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-4 h-4"}),weight:jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"}),text:jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),number:jsxRuntime.jsx(lucideReact.Hash,{className:"w-4 h-4"}),date:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),dropdown:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4"}),checkbox:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-4 h-4"})},L1=["name","status","priority","startDate","endDate","progress","tags","effortMinutes","timeLoggedMinutes","soldEffortMinutes","weight"];function Ig({isOpen:e,onClose:t,columns:a,customFields:r=[],onColumnsChange:o,onCreateCustomField:s,isDark:n,locale:i}){let[c,l]=react.useState(""),[m,d]=react.useState(null),p=react.useRef(null),g=i==="es"?Lg.es:Lg.en;react.useLayoutEffect(()=>{if(!e||!p.current)return;let w=()=>{if(!p.current)return;let N=p.current.getBoundingClientRect(),k=window.innerHeight-N.top-20;d(Math.max(300,k));};return requestAnimationFrame(w),window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[e]),react.useEffect(()=>{if(!e)return;let w=setTimeout(()=>{let N=k=>{p.current&&!p.current.contains(k.target)&&t();},T=k=>{k.key==="Escape"&&t();};document.addEventListener("mousedown",N),document.addEventListener("keydown",T),p._cleanup=()=>{document.removeEventListener("mousedown",N),document.removeEventListener("keydown",T);};},100);return ()=>{clearTimeout(w),p._cleanup&&p._cleanup();}},[e,t]);let y=react.useMemo(()=>{let w=new Set([...L1]);return a.forEach(N=>{N.type&&N.type!=="assignees"&&w.add(N.type);}),Array.from(w)},[a]);if(!e)return null;let x=w=>{let N=g.columns[w];if(N)return N;let T=a.find(k=>k.type===w);return T?.label?T.label:w},h=w=>{if(w==="name")return;let N=a.map(T=>T.id===w?{...T,visible:!T.visible}:T);o(N);},f=(w,N)=>{let T=a.find(P=>P.type===w&&(!N||P.customFieldId===N));if(T){h(T.id);return}let k={id:N||w,type:w,label:N?r.find(P=>P.id===N)?.name||w:x(w),width:120,visible:true,sortable:true,resizable:true,customFieldId:N};o([...a,k]);},b=y.filter(w=>w!=="assignees"&&x(w).toLowerCase().includes(c.toLowerCase())),v=r.filter(w=>w.name.toLowerCase().includes(c.toLowerCase())),C=n?"#00E5FF":"#2E94FF";return jsxRuntime.jsxs("div",{ref:p,style:{...m?{maxHeight:`${m}px`}:{},background:n?"#111114":"#FFFFFF",border:`1px solid ${n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.08)"}`,boxShadow:n?"0 8px 32px rgba(0,0,0,0.7)":"0 8px 32px rgba(0,0,0,0.12)"},className:"absolute right-0 top-full mt-1 w-64 rounded-xl z-50 flex flex-col",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2.5",style:{borderBottom:`1px solid ${n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`},children:[jsxRuntime.jsx("span",{style:{fontSize:10,fontWeight:600,letterSpacing:"0.08em",color:n?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)",fontFamily:"JetBrains Mono, monospace"},children:g.title.toUpperCase()}),jsxRuntime.jsx("button",{onClick:t,className:"w-6 h-6 rounded-md flex items-center justify-center transition-colors",style:{color:n?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"},onMouseEnter:w=>{w.currentTarget.style.backgroundColor=n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",w.currentTarget.style.color=n?"rgba(255,255,255,0.7)":"rgba(0,0,0,0.6)";},onMouseLeave:w=>{w.currentTarget.style.backgroundColor="transparent",w.currentTarget.style.color=n?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)";},children:jsxRuntime.jsx(lucideReact.X,{className:"w-3.5 h-3.5"})})]}),jsxRuntime.jsx("div",{className:"px-3 py-2",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5",style:{color:n?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.25)"}}),jsxRuntime.jsx("input",{type:"text",value:c,onChange:w=>l(w.target.value),placeholder:g.searchPlaceholder,style:{fontSize:12,background:n?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.03)",border:`1px solid ${n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`,color:n?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.8)"},className:"w-full pl-8 pr-3 py-1.5 rounded-lg outline-none placeholder:opacity-40 transition-colors focus:border-[var(--focus-border)]",ref:w=>{w&&w.style.setProperty("--focus-border",C);},onFocus:w=>{w.currentTarget.style.borderColor=C,w.currentTarget.style.background=n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)";},onBlur:w=>{w.currentTarget.style.borderColor=n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)",w.currentTarget.style.background=n?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.03)";}})]})}),jsxRuntime.jsxs("div",{className:"overflow-y-auto flex-1 min-h-0 overscroll-contain px-2 pb-2",onWheel:w=>w.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"mb-1",children:[jsxRuntime.jsx("div",{className:"px-1.5 py-1.5",style:{fontSize:9,fontWeight:600,letterSpacing:"0.1em",color:n?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.3)",fontFamily:"JetBrains Mono, monospace"},children:g.standardFields.toUpperCase()}),jsxRuntime.jsx("div",{className:"space-y-px",children:b.map(w=>{let N=a.find(P=>P.type===w&&!P.customFieldId),T=N?.visible??false,k=w==="name";return jsxRuntime.jsxs("button",{onClick:()=>{k||(N?h(N.id):f(w));},disabled:k,className:"w-full flex items-center gap-2.5 px-2 py-[5px] rounded-md transition-colors",style:{opacity:k?.4:1,cursor:k?"not-allowed":"pointer"},onMouseEnter:P=>{k||(P.currentTarget.style.backgroundColor=n?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.04)");},onMouseLeave:P=>{P.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded flex items-center justify-center flex-shrink-0 transition-all",style:{background:T?C:"transparent",border:T?`1.5px solid ${C}`:`1.5px solid ${n?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.15)"}`,boxShadow:T?`0 0 6px ${C}40`:"none"},children:T&&jsxRuntime.jsx(lucideReact.Check,{className:"w-2.5 h-2.5 text-white",strokeWidth:3})}),jsxRuntime.jsx("span",{className:"flex-shrink-0 [&>svg]:w-3.5 [&>svg]:h-3.5",style:{color:T?C:n?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"},children:Ag[w]}),jsxRuntime.jsx("span",{className:"truncate",style:{fontSize:12,fontWeight:T?500:400,color:T?n?"rgba(255,255,255,0.9)":"rgba(0,0,0,0.85)":n?"rgba(255,255,255,0.55)":"rgba(0,0,0,0.5)",maxWidth:"160px"},title:x(w),children:x(w)})]},w)})})]}),v.length>0&&jsxRuntime.jsxs("div",{className:"mt-1",children:[jsxRuntime.jsx("div",{className:"px-1.5 py-1.5",style:{fontSize:9,fontWeight:600,letterSpacing:"0.1em",color:n?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.3)",fontFamily:"JetBrains Mono, monospace",borderTop:`1px solid ${n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`,paddingTop:8,marginTop:4},children:g.customFields.toUpperCase()}),jsxRuntime.jsx("div",{className:"space-y-px",children:v.map(w=>{let T=a.find(k=>k.customFieldId===w.id)?.visible??false;return jsxRuntime.jsxs("button",{onClick:()=>f(w.type,w.id),className:"w-full flex items-center gap-2.5 px-2 py-[5px] rounded-md transition-colors",onMouseEnter:k=>{k.currentTarget.style.backgroundColor=n?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.04)";},onMouseLeave:k=>{k.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded flex items-center justify-center flex-shrink-0 transition-all",style:{background:T?C:"transparent",border:T?`1.5px solid ${C}`:`1.5px solid ${n?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.15)"}`,boxShadow:T?`0 0 6px ${C}40`:"none"},children:T&&jsxRuntime.jsx(lucideReact.Check,{className:"w-2.5 h-2.5 text-white",strokeWidth:3})}),jsxRuntime.jsx("span",{className:"flex-shrink-0 [&>svg]:w-3.5 [&>svg]:h-3.5",style:{color:T?C:n?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"},children:Ag[w.type]||jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"})}),jsxRuntime.jsx("span",{style:{fontSize:12,fontWeight:T?500:400,color:T?n?"rgba(255,255,255,0.9)":"rgba(0,0,0,0.85)":n?"rgba(255,255,255,0.55)":"rgba(0,0,0,0.5)"},children:w.name})]},w.id)})})]})]})]})}var Lg={en:{title:"Columns",searchPlaceholder:"Search fields...",standardFields:"Standard Fields",customFields:"Custom Fields",columns:{name:"Name",status:"Status",priority:"Priority",startDate:"Start Date",endDate:"End Date",progress:"Progress",tags:"Tags",estimatedTime:"Estimated",quotedTime:"Quoted",elapsedTime:"Time Spent",soldEffortMinutes:"Quoted",effortMinutes:"Estimated",timeLoggedMinutes:"Executed",text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox",weight:"Weight"}},es:{title:"Columnas",searchPlaceholder:"Buscar campos...",standardFields:"Campos Est\xE1ndar",customFields:"Campos Personalizados",columns:{name:"Nombre",status:"Estado",priority:"Prioridad",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",tags:"Etiquetas",estimatedTime:"Estimado",quotedTime:"Ofertado",elapsedTime:"Ejecutado",soldEffortMinutes:"Ofertado",effortMinutes:"Estimado",timeLoggedMinutes:"Ejecutado",text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla",weight:"Peso"}}};var W1=[{type:"text",icon:jsxRuntime.jsx(lucideReact.Type,{className:"w-5 h-5"})},{type:"number",icon:jsxRuntime.jsx(lucideReact.Hash,{className:"w-5 h-5"})},{type:"date",icon:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-5 h-5"})},{type:"dropdown",icon:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-5 h-5"})},{type:"checkbox",icon:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-5 h-5"})}];function Og({isOpen:e,onClose:t,onSave:a,isDark:r,locale:o}){let[s,n]=react.useState(""),[i,c]=react.useState("text"),[l,m]=react.useState([""]),d=o==="es"?Rg.es:Rg.en;react.useEffect(()=>{e&&(n(""),c("text"),m([""]));},[e]),react.useEffect(()=>{let h=f=>{f.key==="Escape"&&t();};return e&&document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,t]);let p=()=>{if(!s.trim())return;let h={name:s.trim(),type:i};i==="dropdown"&&(h.options=l.filter(f=>f.trim())),a(h),t();},g=()=>{m([...l,""]);},y=(h,f)=>{let b=[...l];b[h]=f,m(b);},x=h=>{l.length>1&&m(l.filter((f,b)=>b!==h));};return e?jsxRuntime.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),jsxRuntime.jsxs("div",{className:u("relative w-full max-w-md rounded-xl shadow-2xl border",r?"bg-[#0D0D0D] border-[#222]":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:u("flex items-center justify-between px-6 py-4 border-b",r?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h2",{className:u("text-lg font-semibold",r?"text-white":"text-gray-900"),children:d.title}),jsxRuntime.jsx("button",{onClick:t,className:u("p-1 rounded",r?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.X,{className:u("w-5 h-5",r?"text-white/60":"text-gray-400")})})]}),jsxRuntime.jsxs("div",{className:"p-6 space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:u("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:d.fieldName}),jsxRuntime.jsx("input",{type:"text",value:s,onChange:h=>n(h.target.value),placeholder:d.fieldNamePlaceholder,className:u("w-full px-4 py-2.5 rounded-lg border outline-none focus:ring-2 focus:ring-[#007BFF]/30",r?"bg-white/[0.03] border-[#222] text-white placeholder:text-white/30":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400"),autoFocus:true})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:u("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:d.fieldType}),jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-2",children:W1.map(h=>jsxRuntime.jsxs("button",{onClick:()=>c(h.type),className:u("flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors",i===h.type?"border-[#007BFF] bg-[#007BFF]/10":r?"border-[#222] hover:border-white/20":"border-gray-200 hover:border-gray-300"),children:[jsxRuntime.jsx("span",{className:i===h.type?"text-[#007BFF]":r?"text-white/60":"text-gray-400",children:h.icon}),jsxRuntime.jsx("span",{className:u("text-xs",i===h.type?"text-[#007BFF]":r?"text-white/60":"text-gray-500"),children:d.types[h.type]})]},h.type))})]}),i==="dropdown"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:u("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:d.options}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[l.map((h,f)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"text",value:h,onChange:b=>y(f,b.target.value),placeholder:`${d.option} ${f+1}`,className:u("flex-1 px-3 py-2 rounded-lg border outline-none focus:ring-2 focus:ring-[#007BFF]/30",r?"bg-white/[0.03] border-[#222] text-white placeholder:text-white/30":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400")}),l.length>1&&jsxRuntime.jsx("button",{onClick:()=>x(f),className:u("p-2 rounded-lg transition-colors",r?"hover:bg-white/[0.05] text-white/60":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},f)),jsxRuntime.jsxs("button",{onClick:g,className:u("flex items-center gap-2 px-3 py-2 text-sm rounded-lg transition-colors",r?"text-[#007BFF] hover:bg-white/[0.05]":"text-blue-600 hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),d.addOption]})]})]})]}),jsxRuntime.jsxs("div",{className:u("flex items-center justify-end gap-3 px-6 py-4 border-t",r?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("button",{onClick:t,className:u("px-4 py-2 text-sm font-medium rounded-lg transition-colors",r?"text-white/60 hover:bg-white/[0.05]":"text-gray-600 hover:bg-gray-100"),children:d.cancel}),jsxRuntime.jsx("button",{onClick:p,disabled:!s.trim(),className:u("px-4 py-2 text-sm font-medium rounded-lg transition-colors","bg-[#007BFF] text-white hover:bg-[#005FCC]",!s.trim()&&"opacity-50 cursor-not-allowed"),children:d.create})]})]})]}):null}var Rg={en:{title:"Create Custom Field",fieldName:"Field Name",fieldNamePlaceholder:"Enter field name...",fieldType:"Field Type",options:"Options",option:"Option",addOption:"Add option",cancel:"Cancel",create:"Create Field",types:{text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox"}},es:{title:"Crear Campo Personalizado",fieldName:"Nombre del Campo",fieldNamePlaceholder:"Ingresa el nombre...",fieldType:"Tipo de Campo",options:"Opciones",option:"Opci\xF3n",addOption:"Agregar opci\xF3n",cancel:"Cancelar",create:"Crear Campo",types:{text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla"}}};var zg={en:{filters:"Filters",filterByStatus:"FILTER BY STATUS",showAll:"Show All",completed:"Completed",inProgress:"In Progress",toDo:"To Do / Pending",hideCompleted:"Hide Completed Tasks"},es:{filters:"Filtros",filterByStatus:"FILTRAR POR ESTADO",showAll:"Mostrar Todo",completed:"Completadas",inProgress:"En Progreso",toDo:"Por Hacer / Pendiente",hideCompleted:"Ocultar Tareas Completadas"}};function Ug({value:e,hideCompleted:t,onChange:a,onHideCompletedChange:r,isDark:o,locale:s}){let[n,i]=react.useState(false),c=react.useRef(null),l=react.useRef(0),m=s==="es"?zg.es:zg.en;react.useEffect(()=>{if(!n)return;let g=x=>{Date.now()-l.current<100||c.current&&!c.current.contains(x.target)&&i(false);},y=x=>{x.key==="Escape"&&i(false);};return document.addEventListener("mousedown",g),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",y);}},[n]);let d=[{value:"all",label:m.showAll,icon:jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-[#007BFF] bg-[#007BFF]"}),color:"text-[#007BFF]"},{value:"completed",label:m.completed,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),color:"text-green-500"},{value:"in-progress",label:m.inProgress,icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4"}),color:"text-blue-500"},{value:"todo",label:m.toDo,icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4"}),color:"text-gray-400"}],p=e!=="all"||t;return jsxRuntime.jsxs("div",{ref:c,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:g=>{g.stopPropagation(),n||(l.current=Date.now()),i(y=>!y);},className:u("flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] font-medium transition-all border",o?"border-[#222] hover:bg-white/[0.05] text-white/70":"border-gray-200 hover:bg-gray-100 text-gray-700",p&&(o?"bg-[#2E94FF]/20 border-[#2E94FF]/50 text-[#2E94FF]":"bg-blue-50 border-blue-200 text-blue-600"),n&&(o?"bg-white/[0.05]":"bg-gray-100")),style:{fontFamily:"Inter, sans-serif"},children:[jsxRuntime.jsx(lucideReact.Filter,{className:"w-4 h-4"}),m.filters,p&&jsxRuntime.jsx("span",{className:u("w-2 h-2 rounded-full",o?"bg-[#2E94FF]":"bg-blue-500")})]}),n&&jsxRuntime.jsxs("div",{className:u("absolute left-0 top-full mt-2 w-72 rounded-lg shadow-xl border z-50",o?"bg-[#0D0D0D] border-[#222]":"bg-white border-gray-200"),children:[jsxRuntime.jsx("div",{className:u("px-4 py-3 border-b",o?"border-[#222]":"border-gray-200"),children:jsxRuntime.jsx("span",{className:u("text-xs font-medium uppercase tracking-wider",o?"text-white/30":"text-gray-400"),children:m.filterByStatus})}),jsxRuntime.jsx("div",{className:"py-2",children:d.map(g=>{let y=e===g.value&&!t,x=()=>g.value==="all"?y?jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-[#007BFF] bg-[#007BFF]"}):jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-400"}):g.icon;return jsxRuntime.jsxs("button",{onClick:()=>{a(g.value),r(false),i(false);},className:u("w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",o?"hover:bg-white/[0.05]":"hover:bg-gray-100",y&&(o?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:u(y?g.color:"text-gray-400","flex-shrink-0"),children:x()}),jsxRuntime.jsx("span",{className:u("flex-1 text-left whitespace-nowrap",o?"text-white":"text-gray-900"),children:g.label}),y&&jsxRuntime.jsx(lucideReact.Check,{className:u("w-4 h-4 flex-shrink-0",o?"text-[#007BFF]":"text-blue-500")})]},g.value)})}),jsxRuntime.jsx("div",{className:u("my-2 mx-4 h-px",o?"bg-white/[0.05]":"bg-gray-200")}),jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs("button",{onClick:()=>{let g=!t;r(g),g&&a("all"),i(false);},className:u("w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",o?"hover:bg-white/[0.05]":"hover:bg-gray-100",t&&(o?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:u("w-4 h-4 flex-shrink-0",t?o?"text-[#007BFF]":"text-blue-500":o?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("flex-1 text-left whitespace-nowrap",o?"text-white":"text-gray-900"),children:m.hideCompleted}),t&&jsxRuntime.jsx(lucideReact.Check,{className:u("w-4 h-4 flex-shrink-0",o?"text-[#007BFF]":"text-blue-500")})]})})]})]})}function Wg(e){if(e<=0)return "0h";let t=Math.floor(e/60),a=e%60;return a>0?`${t}h ${a}m`:`${t}h`}function ws(e){return e>=1e6?`$${(e/1e6).toFixed(1)}M`:e>=1e3?`$${(e/1e3).toFixed(1)}K`:`$${Math.round(e).toLocaleString("en-US")}`}function Gg({data:e,isDark:t,locale:a="en",onClose:r,lens:o="hours"}){let s=a==="es",n=o==="financial";return jsxRuntime.jsxs("div",{className:u("w-[220px] xl:w-[280px] flex-shrink-0 overflow-y-auto border-l",t?"bg-[#141414] border-[#222]":"bg-gray-50 border-gray-200"),children:[jsxRuntime.jsxs("div",{className:u("px-5 py-4 border-b flex items-center justify-between",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:u("text-[10px] font-mono uppercase tracking-wider font-bold",t?"text-white/40":"text-gray-500"),children:n?s?"SALUD FINANCIERA":"FINANCIAL HEALTH":s?"SALUD DEL PROYECTO":"PROJECT HEALTH"}),r&&jsxRuntime.jsx("button",{onClick:r,className:u("p-1 rounded transition-colors",t?"text-white/30 hover:text-white/60 hover:bg-white/[0.05]":"text-gray-400 hover:text-gray-600 hover:bg-gray-200"),title:s?"Cerrar panel":"Close panel",children:jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 1l10 10M11 1L1 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),n&&(e.totalOffered!==void 0||e.totalEstimated!==void 0)&&(()=>{let i=e.totalOffered??0,c=e.totalEstimated??0,l=e.totalExecuted??0,m=i-c,d=i>0?Math.round(m/i*100):0,p=i>0?Math.min(Math.round(c/i*100),120):0,g=c>i&&i>0,y=g?"#FF2D20":"#00E5CC";return jsxRuntime.jsxs("div",{className:u("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:u("text-[10px] font-mono uppercase tracking-wider mb-3",t?"text-white/40":"text-gray-500"),children:s?"PRESUPUESTO":"BUDGET"}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:s?"Ofertado":"Offered"}),jsxRuntime.jsx("span",{className:u("text-[11px] font-mono font-bold",t?"text-white/80":"text-gray-800"),children:ws(i)})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:s?"Estimado":"Estimated"}),jsxRuntime.jsx("span",{className:u("text-[11px] font-mono font-bold",g?"text-[#FF2D20]":t?"text-white/80":"text-gray-800"),children:ws(c)})]}),l>0&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:s?"Ejecutado":"Executed"}),jsxRuntime.jsx("span",{className:u("text-[11px] font-mono",t?"text-white/60":"text-gray-600"),children:ws(l)})]}),i>0&&jsxRuntime.jsx("div",{className:u("w-full h-2.5 rounded-full overflow-hidden mt-2",t?"bg-white/[0.06]":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(p,100)}%`,backgroundColor:y}})}),jsxRuntime.jsxs("div",{className:u("mt-2 px-3 py-2 rounded-lg text-center font-mono text-sm font-bold",m>=0?t?"bg-[#00E5CC]/10 text-[#00E5CC]":"bg-emerald-50 text-emerald-600":t?"bg-[#FF2D20]/10 text-[#FF2D20]":"bg-red-50 text-red-600"),children:[m>=0?`+${ws(m)} ${s?"Disp.":"Avail."}`:`${ws(Math.abs(m))} ${s?"P\xE9rdida":"Loss"}`,i>0&&jsxRuntime.jsxs("span",{className:"text-[10px] ml-1 opacity-60",children:["(",d,"%)"]})]})]})]})})(),(e.totalHoursSpentMinutes!==void 0||e.totalHoursAllocatedMinutes!==void 0)&&(()=>{let i=e.totalHoursSpentMinutes??0,c=e.totalHoursAllocatedMinutes??0,l=c>0?Math.min(Math.round(i/c*100),100):0,m=i>c&&c>0,d=m?"#FF2D20":l>=80?"#FFD60A":"#3BF06E";return jsxRuntime.jsxs("div",{className:u("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:u("text-[10px] font-mono uppercase tracking-wider mb-3",t?"text-white/40":"text-gray-500"),children:s?"HORAS DEL PROYECTO":"PROJECT HOURS"}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:s?"Usado":"Spent"}),jsxRuntime.jsx("span",{className:u("text-[11px] font-mono font-bold",m?"text-[#FF2D20]":t?"text-white/80":"text-gray-800"),children:Wg(i)})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:s?"Asignado":"Allocated"}),jsxRuntime.jsx("span",{className:u("text-[11px] font-mono",t?"text-white/60":"text-gray-600"),children:Wg(c)})]}),c>0&&jsxRuntime.jsx("div",{className:u("w-full h-1.5 rounded-full overflow-hidden mt-1",t?"bg-white/[0.06]":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${l}%`,backgroundColor:d}})})]})]})})(),(e.openRFIs!==void 0||e.submittalsApprovalPercent!==void 0)&&jsxRuntime.jsxs("div",{className:u("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:u("text-[10px] font-mono uppercase tracking-wider mb-3",t?"text-white/40":"text-gray-500"),children:s?"SALUD T\xC9CNICA":"TECHNICAL HEALTH"}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[e.openRFIs!==void 0&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:s?"RFIs Abiertos":"Open RFIs"}),jsxRuntime.jsx("span",{className:u("px-2 py-0.5 rounded text-[11px] font-mono font-bold",e.openRFIs>0?"bg-[#FF2D20]/15 text-[#FF2D20]":"bg-[#3BF06E]/15 text-[#3BF06E]"),children:e.openRFIs})]}),e.submittalsApprovalPercent!==void 0&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:s?"Aprobaci\xF3n Submittals":"Submittals Approval"}),jsxRuntime.jsxs("span",{className:u("text-[11px] font-mono font-bold",e.submittalsApprovalPercent>=80?"text-[#3BF06E]":"text-[#FFD60A]"),children:[e.submittalsApprovalPercent,"%"]})]})]})]}),e.scheduleVarianceDays!==void 0&&jsxRuntime.jsxs("div",{className:u("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:u("text-[10px] font-mono uppercase tracking-wider mb-3",t?"text-white/40":"text-gray-500"),children:s?"VARIACI\xD3N DE CRONOGRAMA":"SCHEDULE VARIANCE"}),(()=>{let i=e.scheduleVarianceDays??0,c=i>0,l=i<0,m=e.scheduleVarianceLabel||(c?`+${i} ${s?"D\xEDas ADELANTE":"Days AHEAD"}`:l?`${i} ${s?"D\xEDas ATR\xC1S":"Days BEHIND"}`:s?"EN TIEMPO":"ON TRACK");return jsxRuntime.jsx("div",{className:u("px-3 py-2 rounded-lg text-center font-mono text-sm font-bold",c&&"bg-[#3BF06E]/15 text-[#3BF06E]",l&&"bg-[#FF2D20]/15 text-[#FF2D20]",!c&&!l&&"bg-[#3B9EFF]/15 text-[#3B9EFF]"),children:m})})()]}),e.teams&&e.teams.length>0&&jsxRuntime.jsxs("div",{className:"px-5 py-4",children:[jsxRuntime.jsx("h4",{className:u("text-[10px] font-mono uppercase tracking-wider mb-3",t?"text-white/40":"text-gray-500"),children:s?"DISPONIBILIDAD DEL EQUIPO":"TEAM AVAILABILITY"}),jsxRuntime.jsx("div",{className:"space-y-3",children:e.teams.map((i,c)=>{let l=i.utilizationPercent>=100?"#FF2D20":i.utilizationPercent>=80?"#FFD60A":i.color||"#3BF06E";return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:i.name}),jsxRuntime.jsxs("span",{className:u("text-[10px] font-mono",t?"text-white/40":"text-gray-500"),children:[i.utilizationPercent,"%"]})]}),jsxRuntime.jsx("div",{className:u("w-full h-1.5 rounded-full overflow-hidden",t?"bg-white/[0.06]":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(i.utilizationPercent,100)}%`,backgroundColor:l}})})]},`${i.name}-${c}`)})})]})]})}var ow=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:140,visible:true,sortable:true,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true}];function qg(e,t=0){let a=[];for(let r of e)a.push({...r,level:t,hasChildren:(r.subtasks?.length||0)>0,parentPath:[r.id]}),r.subtasks?.length&&r.isExpanded!==false&&a.push(...qg(r.subtasks,t+1));return a}function nw(e){let t=e.subtasks;if(!t?.length)return null;let a=new Date,r=0,o=0;for(let s of t){if(!s.startDate||!s.endDate)continue;let n=s.startDate.getTime(),c=s.endDate.getTime()-n;if(c<=0)continue;let m=Math.max(0,Math.min(a.getTime()-n,c))/c*100;if(m<=0)continue;let d=(s.progress||0)/m;r+=d,o++;}return o>0?r/o:null}function sw(e){return e.subtasks?.length?e.subtasks.filter(t=>t.teamLoad&&t.teamLoad.percentage>=100).length:0}function Un(e){if(!e.subtasks?.length)return {spent:0,allocated:0,quoted:0};let t=0,a=0,r=0;for(let o of e.subtasks)if(o.subtasks?.length){let s=Un(o);t+=s.spent,a+=s.allocated,r+=s.quoted;}else t+=o.timeLoggedMinutes??0,a+=o.effortMinutes??0,r+=o.soldEffortMinutes??0;return {spent:t,allocated:a,quoted:r}}function zn(e){if(e<=0)return "0h";let t=Math.floor(e/60),a=e%60;return a>0?`${t}h ${a}m`:`${t}h`}function iw({value:e,onChange:t,isDark:a}){let[r,o]=react.useState(false),[s,n]=react.useState(String(e||""));return r?jsxRuntime.jsx("input",{autoFocus:true,type:"text",inputMode:"decimal",value:s,onClick:i=>i.stopPropagation(),onChange:i=>n(i.target.value.replace(/[^0-9.]/g,"")),onBlur:()=>{let i=parseFloat(s);!isNaN(i)&&i>=0&&i<=100?t(i):s===""&&t(0),o(false);},onKeyDown:i=>{i.key==="Enter"&&i.target.blur(),i.key==="Escape"&&(n(String(e||"")),o(false));},className:u("w-14 text-xs text-right font-mono px-1 py-0.5 rounded border outline-none",a?"bg-white/5 border-[#00E5CC]/50 text-white":"bg-gray-50 border-blue-400 text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"}}):jsxRuntime.jsx("button",{onClick:i=>{i.stopPropagation(),n(String(e||"")),o(true);},className:u("text-xs font-mono cursor-pointer hover:underline",e>0?a?"text-white/80":"text-gray-700":a?"text-white/30":"text-gray-300"),style:{fontFamily:"JetBrains Mono, monospace"},children:e>0?`${e}%`:"\u2014"})}function Xg({tasks:e,config:t={},callbacks:a={},isLoading:r=false,error:o,className:s,style:n,availableUsers:i=[],customFields:c=[],toolbarRightContent:l}){let{theme:m="dark",locale:d="en",customTranslations:p,showSearch:g=true,showHierarchy:y=true,tableColumns:x,allowColumnCustomization:h=true,allowColumnResize:f=true,enableContextMenu:b=true,showCreateTaskButton:v=false,onCreateTask:C,persistFilter:w=false,financialBlur:N,healthSidebar:T,lens:k="hours",hourlyRate:P=0,rateMap:O,aggregateParentHours:S=false,showProjectTotals:J=false}=t,R=Ri(d,p),$=m==="dark",M=F=>{if(!O||!F.assignees||F.assignees.length===0)return P;let ge=F.assignees.map(Ce=>Ce.id?O[Ce.id]:void 0).filter(Ce=>Ce!=null&&Ce>0);return ge.length===0?P:ge.reduce((Ce,Ge)=>Ce+Ge,0)/ge.length},q=react.useCallback(()=>{if(!w||typeof window>"u")return {statusFilter:"all",hideCompleted:false};try{let F=localStorage.getItem(w);if(F){let ge=JSON.parse(F);return {statusFilter:ge.statusFilter||"all",hideCompleted:ge.hideCompleted||!1}}}catch(F){console.error("Error loading persisted filter:",F);}return {statusFilter:"all",hideCompleted:false}},[w]),Z=react.useMemo(()=>{function F(ge){let Ce=0,Ge=0,Ze=0;for(let lt of ge)if(lt.subtasks&<.subtasks.length>0){let ye=F(lt.subtasks);Ce+=ye.spent,Ge+=ye.allocated,Ze+=ye.quoted;}else Ce+=lt.timeLoggedMinutes??0,Ge+=lt.effortMinutes??0,Ze+=lt.soldEffortMinutes??0;return {spent:Ce,allocated:Ge,quoted:Ze}}return F(e)},[e]),Re=react.useMemo(()=>{let F=new Map;function ge(Ce){let Ge=0;for(let Ze of Ce)if(Ze.subtasks&&Ze.subtasks.length>0){let lt=ge(Ze.subtasks);F.set(Ze.id,lt),Ge+=lt;}else Ge+=Ze.weight||0;return Ge}return ge(e),F},[e]),I=react.useMemo(()=>!T?.enabled||!T.data?T:{...T,data:{...T.data,totalHoursSpentMinutes:Z.spent,totalHoursAllocatedMinutes:Z.allocated}},[T,Z]),[K,be]=react.useState(true),[_e,z]=react.useState("position"),[ae,Q]=react.useState("asc"),[Me,we]=react.useState(""),[Ie,He]=react.useState(()=>q().statusFilter),[at,te]=react.useState(()=>q().hideCompleted),[Qe,ce]=react.useState(x||ow),[nt,bt]=react.useState(false),[Bt,ke]=react.useState(false),[wt,it]=react.useState({isOpen:false,x:0,y:0,type:"task"}),[je,H]=react.useState(null),[ie,D]=react.useState(false),[j,le]=react.useState(null),[he,G]=react.useState(null),[ee,Ue]=react.useState(null),Te=react.useRef(0),Le=react.useRef(false),Ee=!!(a.onTaskMove||a.onTaskReparent),qe=react.useCallback((F,ge)=>{Ee&&(ge.preventDefault(),Te.current=ge.clientY,H(F),Le.current=false,D(false),Ue({x:ge.clientX,y:ge.clientY}));},[Ee]),yt=react.useCallback(F=>{if(!je||(Math.abs(F.clientY-Te.current)>5&&!Le.current&&(Le.current=true,D(true)),Ue({x:F.clientX,y:F.clientY}),!Le.current))return;let Ce=document.querySelectorAll("[data-listview-row]"),Ge=null,Ze=null;Ce.forEach(lt=>{let ye=lt.getBoundingClientRect(),rt=lt.getAttribute("data-listview-row");if(rt&&rt!==je&&F.clientY>=ye.top&&F.clientY<=ye.bottom){Ge=rt;let Tt=F.clientY-ye.top,qt=ye.height;Ze=Tt<qt*.25?"above":Tt>qt*.75?"below":"child";}}),le(Ge),G(Ze);},[je]),pt=react.useCallback(()=>{if(Le.current&&je&&j&&he){if(he==="child"&&a.onTaskReparent)a.onTaskReparent(je,j);else if(he==="above"||he==="below"){let F=(Ge,Ze,lt=null)=>{for(let ye of Ge){if(ye.id===Ze)return lt;if(ye.subtasks){let rt=F(ye.subtasks,Ze,ye.id);if(rt!==void 0)return rt}}},ge=F(e,je,null),Ce=F(e,j,null);if(a.onTaskReparent){let Ge=(qt,Dt)=>{if(Dt===null)return qt;for(let zt of qt){if(zt.id===Dt)return zt.subtasks||[];if(zt.subtasks){let Xt=Ge(zt.subtasks,Dt);if(Xt.length>0||zt.subtasks.some(ba=>ba.id===Dt))return Xt}}return []},Ze=Ge(e,Ce??null),lt=Ze.findIndex(qt=>qt.id===j),ye=ge===Ce,rt=ye?Ze.findIndex(qt=>qt.id===je):-1,Tt=he==="below"?lt+1:lt;ye&&rt!==-1&&rt<lt&&(Tt-=1),a.onTaskReparent(je,Ce??null,Math.max(0,Tt));}}}H(null),le(null),G(null),Ue(null),Le.current=false,D(false);},[je,j,he,e,a]);react.useEffect(()=>{if(je)return document.addEventListener("mousemove",yt),document.addEventListener("mouseup",pt),document.body.style.cursor="grabbing",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",yt),document.removeEventListener("mouseup",pt),document.body.style.cursor="",document.body.style.userSelect="";}},[je,yt,pt]);let[tt,ot]=react.useState("all"),[Ot,$t]=react.useState(false),kt=react.useRef(null),Ct=react.useRef(null),mt=react.useMemo(()=>{let F=0;function ge(Ce,Ge){for(let Ze of Ce)Ge>F&&(F=Ge),Ze.subtasks?.length&&ge(Ze.subtasks,Ge+1);}return ge(e,1),F},[e]);react.useEffect(()=>{if(!Ot)return;let F=ge=>{kt.current?.contains(ge.target)||Ct.current?.contains(ge.target)||$t(false);};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[Ot]),react.useEffect(()=>{if(tt==="all"){let Ce=function(Ge){for(let Ze of Ge)Ze.subtasks?.length&&(Ze.isExpanded===false&&a.onTaskToggleExpand?.(Ze.id),Ce(Ze.subtasks));};Ce(e);}else {let Ce=function(Ge,Ze){for(let lt of Ge)if(lt.subtasks?.length){let ye=Ze<tt,rt=lt.isExpanded!==false;ye!==rt&&a.onTaskToggleExpand?.(lt.id),Ce(lt.subtasks,Ze+1);}};Ce(e,1);}},[tt]);let[At,We]=react.useState(null),[Pe,gt]=react.useState(0),[oe,fe]=react.useState(0),L=react.useRef(null),[V,Y]=react.useState(null),[ue,Ne]=react.useState(null);react.useEffect(()=>{x&&ce(x);},[x]),react.useEffect(()=>{if(!(!w||typeof window>"u"))try{localStorage.setItem(w,JSON.stringify({statusFilter:Ie,hideCompleted:at}));}catch(F){console.error("Error persisting filter state:",F);}},[w,Ie,at]);let Xe=react.useMemo(()=>{let F=new Set;function ge(Ce){for(let Ge of Ce)Ge.subtasks?.length&&(Ge.isExpanded!==false&&F.add(Ge.id),ge(Ge.subtasks));}return ge(e),F},[e]),ze=react.useMemo(()=>Qe.filter(F=>F.visible),[Qe]),Be=react.useCallback(F=>{a.onTaskToggleExpand?.(F);},[a]),xt=react.useCallback(F=>{_e===F?Q(ge=>ge==="asc"?"desc":"asc"):(z(F),Q("asc")),a.onSortChange?.({column:F,direction:ae==="asc"?"desc":"asc"});},[_e,ae,a]),ft=react.useCallback(F=>{ce(F),a.onColumnsChange?.(F);},[a]),Gt=react.useCallback(F=>{let ge=Qe.map(Ce=>Ce.id===F?{...Ce,visible:false}:Ce);ft(ge);},[Qe,ft]),Ta=react.useCallback((F,ge)=>{z(F),Q(ge);},[]),Zt=react.useCallback((F,ge,Ce)=>{b&&(F.preventDefault(),it({isOpen:true,x:F.clientX,y:F.clientY,type:ge?"task":"header",task:ge,columnId:Ce}));},[b]),U=react.useCallback(()=>{it(F=>({...F,isOpen:false}));},[]),ne=react.useCallback((F,ge)=>{if(!f)return;F.preventDefault(),F.stopPropagation();let Ce=Qe.find(Ge=>Ge.id===ge);Ce&&(We(ge),gt(F.clientX),fe(Ce.width));},[Qe,f]);react.useEffect(()=>{if(!At)return;let F=Ce=>{let Ge=Ce.clientX-Pe,Ze=Math.max(50,oe+Ge),lt=Qe.map(ye=>ye.id===At?{...ye,width:Ze}:ye);ce(lt);},ge=()=>{At&&a.onColumnsChange?.(Qe),We(null);};return document.addEventListener("mousemove",F),document.addEventListener("mouseup",ge),()=>{document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",ge);}},[At,Pe,oe,Qe,a]);let Oe=react.useCallback((F,ge)=>{if(ge==="name"){F.preventDefault();return}Y(ge),F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",ge),F.currentTarget instanceof HTMLElement&&(F.currentTarget.style.opacity="0.5");},[]),A=react.useCallback(F=>{F.currentTarget instanceof HTMLElement&&(F.currentTarget.style.opacity="1"),Y(null),Ne(null);},[]),me=react.useCallback((F,ge)=>{F.preventDefault(),ge!=="name"&&(F.dataTransfer.dropEffect="move",Ne(ge));},[]),Ve=react.useCallback(()=>{Ne(null);},[]),et=react.useCallback((F,ge)=>{if(F.preventDefault(),!V||V===ge||ge==="name")return;let Ce=[...Qe],Ge=Ce.findIndex(ye=>ye.id===V),Ze=Ce.findIndex(ye=>ye.id===ge);if(Ge===-1||Ze===-1)return;let lt=Ce.splice(Ge,1);lt[0]&&(Ce.splice(Ze,0,lt[0]),ft(Ce),Y(null),Ne(null));},[V,Qe,ft]),ra=react.useCallback(async F=>{if(a.onCreateCustomField){let ge={...F,id:`cf_${Date.now()}`,projectId:""};await a.onCreateCustomField(ge);}ke(false);},[a]),Ht=react.useCallback(F=>F.progress===100||F.status==="completed"?"completed":F.progress&&F.progress>0||F.status==="in-progress"?"in-progress":"todo",[]),fa=react.useMemo(()=>{let F=qg(e);if(Me.trim()){let ge=Me.toLowerCase();F=F.filter(Ce=>Ce.name.toLowerCase().includes(ge));}return Ie!=="all"&&(F=F.filter(ge=>Ht(ge)===Ie)),at&&(F=F.filter(ge=>Ht(ge)!=="completed")),F.sort((ge,Ce)=>{let Ge,Ze;switch(_e){case "name":Ge=ge.name.toLowerCase(),Ze=Ce.name.toLowerCase();break;case "startDate":Ge=ge.startDate?.getTime()||0,Ze=Ce.startDate?.getTime()||0;break;case "endDate":Ge=ge.endDate?.getTime()||0,Ze=Ce.endDate?.getTime()||0;break;case "progress":Ge=ge.progress||0,Ze=Ce.progress||0;break;case "status":Ge=ge.status||"todo",Ze=Ce.status||"todo";break;case "priority":let lt={urgent:0,high:1,medium:2,low:3,none:4};Ge=lt[ge.priority]??4,Ze=lt[Ce.priority]??4;break;case "position":return 0;default:return 0}return Ge<Ze?ae==="asc"?-1:1:Ge>Ze?ae==="asc"?1:-1:0}),F},[e,Me,Ie,at,_e,ae,Ht]),Ua=react.useCallback((F,ge)=>{let Ce=lt=>{a.onTaskUpdate?.({...F,...lt});},Ge=lt=>lt?F.customFields?.find(rt=>rt.fieldId===lt)?.value:void 0,Ze=(lt,ye)=>{if(!lt)return;let Tt=[...F.customFields||[]],qt=Tt.findIndex(Dt=>Dt.fieldId===lt);qt>=0?Tt[qt]={fieldId:lt,value:ye}:Tt.push({fieldId:lt,value:ye}),Ce({customFields:Tt});};switch(ge.type){case "name":return null;case "status":return jsxRuntime.jsx(Om,{value:F.status||(F.progress===100?"completed":F.progress&&F.progress>0?"in-progress":"todo"),onChange:ye=>{Ce({status:ye,progress:ye==="completed"?100:ye==="in-progress"?50:0});},isDark:$,locale:d,translations:R.status});case "priority":return jsxRuntime.jsx(Hm,{value:F.priority,onChange:ye=>Ce({priority:ye}),isDark:$,locale:d});case "assignees":{let ye=F.hasChildren,rt=F.assignees||[];if(ye&&F.subtasks?.length){let Tt=new Map;(F.assignees||[]).forEach(Dt=>Tt.set(Dt.name,Dt));let qt=Dt=>{(Dt||[]).forEach(zt=>{(zt.assignees||[]).forEach(Xt=>{Tt.has(Xt.name)||Tt.set(Xt.name,Xt);}),zt.subtasks?.length&&qt(zt.subtasks);});};qt(F.subtasks),rt=Array.from(Tt.values());}return jsxRuntime.jsx(Gm,{value:rt,availableUsers:i,onChange:Tt=>Ce({assignees:Tt}),isDark:$,locale:d,disabled:ye})}case "startDate":return jsxRuntime.jsx(Hi,{value:F.startDate,onChange:ye=>Ce({startDate:ye}),isDark:$,locale:d,dateField:"start",startDate:F.startDate,endDate:F.endDate});case "endDate":return jsxRuntime.jsx(Hi,{value:F.endDate,onChange:ye=>Ce({endDate:ye}),isDark:$,locale:d,dateField:"end",startDate:F.startDate,endDate:F.endDate});case "progress":return jsxRuntime.jsx(qm,{value:F.progress||0,onChange:ye=>{let rt=ye===100?"completed":ye>0?"in-progress":"todo";Ce({progress:ye,status:rt});},isDark:$});case "tags":return jsxRuntime.jsx(ig,{value:F.tags||[],isDark:$});case "text":return jsxRuntime.jsx(Qm,{value:Ge(ge.customFieldId)||"",onChange:ye=>Ze(ge.customFieldId,ye),isDark:$});case "number":return jsxRuntime.jsx(tg,{value:Ge(ge.customFieldId)||0,onChange:ye=>Ze(ge.customFieldId,ye),isDark:$});case "date":let lt=Ge(ge.customFieldId);return jsxRuntime.jsx(Hi,{value:lt?new Date(lt):void 0,onChange:ye=>Ze(ge.customFieldId,ye),isDark:$,locale:d});case "dropdown":return jsxRuntime.jsx(ag,{value:Ge(ge.customFieldId)||"",options:ge.options||[],onChange:ye=>Ze(ge.customFieldId,ye),isDark:$});case "checkbox":return jsxRuntime.jsx(og,{value:Ge(ge.customFieldId)||false,onChange:ye=>Ze(ge.customFieldId,ye),isDark:$});case "estimatedTime":{let ye=F.status==="completed"||F.progress===100;return jsxRuntime.jsx(hr,{value:F.estimatedTime,onChange:rt=>Ce({estimatedTime:rt}),isDark:$,locale:d,disabled:ye,lens:k,hourlyRate:M(F)})}case "quotedTime":{let ye=F.status==="completed"||F.progress===100,rt=N?.enabled&&(!N.columns||N.columns.includes("quotedTime"));return jsxRuntime.jsx(hr,{value:F.quotedTime,onChange:Tt=>Ce({quotedTime:Tt}),isDark:$,locale:d,disabled:ye,isBlurred:rt,lens:k,hourlyRate:M(F)})}case "elapsedTime":{let ye=F.status==="completed"||F.progress===100;return jsxRuntime.jsx(hr,{value:F.elapsedTime,onChange:rt=>Ce({elapsedTime:rt}),isDark:$,locale:d,disabled:ye,lens:k,hourlyRate:M(F)})}case "effortMinutes":{if(S&&F.subtasks&&F.subtasks.length>0){let{allocated:Dt,quoted:zt}=Un(F),Xt=M(F);if(k==="financial"&&Xt&&Dt>0&&zt>0){let ba=Math.round(Dt/60*Xt),ha=Math.round(zt/60*Xt)-ba;return jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(hr,{value:Dt>0?Dt:void 0,isDark:$,locale:d,disabled:true,lens:k,hourlyRate:M(F)}),ha!==0&&jsxRuntime.jsxs("span",{className:u("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap",ha>0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[ha>0?"+":"",ha>=1e3?`$${(ha/1e3).toFixed(1)}K`:`$${ha}`]})]})}return jsxRuntime.jsx(hr,{value:Dt>0?Dt:void 0,isDark:$,locale:d,disabled:true,lens:k,hourlyRate:M(F)})}let ye=F.status==="completed"||F.progress===100,rt=F.effortMinutes||0,Tt=F.soldEffortMinutes||0,qt=M(F);if(k==="financial"&&qt&&rt>0&&Tt>0){let Dt=Math.round(rt/60*qt),Xt=Math.round(Tt/60*qt)-Dt;return jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(hr,{value:rt,onChange:ba=>Ce({effortMinutes:ba}),isDark:$,locale:d,disabled:ye,lens:k,hourlyRate:M(F)}),Xt!==0&&jsxRuntime.jsxs("span",{className:u("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap",Xt>=0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[Xt>0?"+":"",Math.abs(Xt)>=1e3?`$${(Xt/1e3).toFixed(1)}K`:`$${Xt}`]})]})}return jsxRuntime.jsx(hr,{value:rt,onChange:Dt=>Ce({effortMinutes:Dt}),isDark:$,locale:d,disabled:ye,lens:k,hourlyRate:M(F)})}case "timeLoggedMinutes":{if(S&&F.subtasks&&F.subtasks.length>0){let{spent:rt}=Un(F);return jsxRuntime.jsx(hr,{value:rt>0?rt:void 0,isDark:$,locale:d,disabled:true,lens:k,hourlyRate:M(F)})}let ye=F.status==="completed"||F.progress===100;return jsxRuntime.jsx(hr,{value:F.timeLoggedMinutes,onChange:a.onLogTime?rt=>{a.onLogTime?.(F,rt);}:void 0,isDark:$,locale:d,placeholder:d==="es"?"Agregar":"Add",disabled:ye,lens:k,hourlyRate:M(F)})}case "soldEffortMinutes":{if(S&&F.subtasks&&F.subtasks.length>0){let{quoted:Tt}=Un(F),qt=N?.enabled&&(!N.columns||N.columns.includes("soldEffortMinutes"));return jsxRuntime.jsx(hr,{value:Tt>0?Tt:void 0,isDark:$,locale:d,disabled:true,isBlurred:qt,lens:k,hourlyRate:M(F)})}let ye=F.status==="completed"||F.progress===100,rt=N?.enabled&&(!N.columns||N.columns.includes("soldEffortMinutes"));return jsxRuntime.jsx(hr,{value:F.soldEffortMinutes,onChange:Tt=>Ce({soldEffortMinutes:Tt}),isDark:$,locale:d,disabled:ye,isBlurred:rt,lens:k,hourlyRate:M(F)})}case "scheduleVariance":{let ye=F.effortMinutes||0,rt=F.soldEffortMinutes||0,Tt=F.timeLoggedMinutes||0,qt=ye>0||rt>0||Tt>0;return jsxRuntime.jsx(ug,{startDate:F.startDate,endDate:F.endDate,scheduleVariance:F.scheduleVariance,isDark:$,locale:d,hasTimeAllocated:qt})}case "hoursBar":{if(S&&F.hasChildren){let{spent:ye,allocated:rt,quoted:Tt}=Un(F),qt=ye>rt&&rt>0;return jsxRuntime.jsxs("span",{className:u("text-[11px] font-mono flex items-center gap-1.5",$?"text-white/50":"text-gray-500"),children:[jsxRuntime.jsx("span",{className:u("font-bold",qt?"text-[#FF453A]":$?"text-white/80":"text-gray-800"),children:zn(ye)}),rt>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" / ",jsxRuntime.jsx("span",{className:$?"text-white/60":"text-gray-600",children:zn(rt)})]}),Tt>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" / ",jsxRuntime.jsx("span",{className:$?"text-amber-400/70":"text-amber-600",children:zn(Tt)})]})]})}return jsxRuntime.jsx(mg,{task:F,isDark:$,locale:d,onLogTime:a.onLogTime,onEstimateUpdate:a.onEstimateUpdate,onSoldEffortUpdate:a.onSoldEffortUpdate,showSoldEffort:t.showSoldEffort,onOpenTimeLog:a.onOpenTimeLog,lens:k,hourlyRate:M(F)})}case "teamLoad":return jsxRuntime.jsx(fg,{task:F,isDark:$,locale:d});case "blockers":return jsxRuntime.jsx(hg,{blockers:F.blockers,isDark:$,locale:d});case "weight":{let ye=Re.get(F.id);if(ye!==void 0)return jsxRuntime.jsx("span",{className:u("text-xs font-mono",ye>0?$?"text-white/50":"text-gray-400":$?"text-white/30":"text-gray-300"),style:{fontFamily:"JetBrains Mono, monospace"},children:ye>0?`${Number(ye.toFixed(2))}%`:"\u2014"});let rt=F.weight||0;return jsxRuntime.jsx(iw,{value:rt,onChange:Tt=>Ce({weight:Tt}),isDark:$})}default:return jsxRuntime.jsx("span",{className:u("text-sm",$?"text-white/60":"text-gray-500"),children:"-"})}},[a,$,d,i,R,S,Re]),Wa=react.useCallback(F=>{let Ce={name:R.columns.name,status:R.columns.status,priority:R.columns.priority,assignees:R.columns.assignees,startDate:R.columns.startDate,endDate:R.columns.endDate,progress:R.columns.progress,tags:R.columns.tags||(d==="es"?"Etiquetas":"Tags"),estimatedTime:R.columns.estimatedTime||(d==="es"?"Estimado":"Estimated"),quotedTime:R.columns.quotedTime||(d==="es"?"Ofertado":"Quoted"),elapsedTime:R.columns.elapsedTime||(d==="es"?"Ejecutado":"Executed"),soldEffortMinutes:R.columns.soldEffortMinutes||(d==="es"?"Ofertado":"Quoted"),effortMinutes:R.columns.effortMinutes||(d==="es"?"Estimado":"Estimated"),timeLoggedMinutes:R.columns.timeLoggedMinutes||(d==="es"?"Ejecutado":"Executed"),scheduleVariance:R.columns.scheduleVariance||(d==="es"?"Prog / Var":"Sched / Var"),hoursBar:R.columns.hoursBar||(d==="es"?"Horas (Usado / Asignado)":"Hours (Spent / Allocated)"),teamLoad:R.columns.teamLoad||(d==="es"?"Equipo":"Team"),blockers:R.columns.blockers||(d==="es"?"Bloqueantes":"Blockers"),weight:R.columns.weight||(d==="es"?"Peso":"Weight")}[F.type]||F.label;return typeof Ce=="string"?Ce:String(Ce||F.type)},[R,d]),pa=react.useMemo(()=>{let Ce=ze.reduce((Ze,lt)=>Ze+lt.width,0)+(h?48:0),Ge={};for(let Ze of ze)Ge[Ze.id]=`${Ze.width/Ce*100}%`;return Ge},[ze,h]);return r?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",$?"bg-[#0D0D0D]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#007BFF]"}),jsxRuntime.jsxs("p",{className:u("text-sm",$?"text-white/60":"text-gray-600"),children:[R.empty.noTasks,"..."]})]})}):o?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",$?"bg-[#0D0D0D]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsxRuntime.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center",children:jsxRuntime.jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:u("text-lg font-semibold mb-2",$?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:u("text-sm",$?"text-white/60":"text-gray-600"),children:typeof o=="string"?o:o.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",$?"bg-[#0D0D0D]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"text-center max-w-md",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-[#007BFF]/10 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.List,{className:"w-8 h-8 text-[#007BFF]"})}),jsxRuntime.jsx("h3",{className:u("text-lg font-semibold mb-2",$?"text-white":"text-gray-900"),children:R.empty.noTasks}),jsxRuntime.jsx("p",{className:u("text-sm",$?"text-white/60":"text-gray-600"),children:R.empty.addFirstTask})]})}):jsxRuntime.jsxs("div",{ref:L,className:u($?"bg-[#0D0D0D]":"bg-white",At&&"select-none",s),style:{display:"flex",flexDirection:"column",flex:"1 1 0%",width:"100%",height:"100%",overflow:"hidden",minHeight:0,...n},children:[jsxRuntime.jsx("div",{className:u("flex-shrink-0 px-6 py-4 border-b",$?"border-[#222]":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsxs("div",{className:u("text-sm",$?"text-white/60":"text-gray-600"),children:[fa.length," ",R.pagination.tasks]}),g&&jsxRuntime.jsxs("div",{className:"relative flex-1 max-w-md",children:[jsxRuntime.jsx(lucideReact.Search,{className:u("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",$?"text-white/60":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:Me,onChange:F=>we(F.target.value),placeholder:R.toolbar.searchPlaceholder,className:u("w-full h-9 pl-10 pr-4 rounded-lg border outline-none focus:ring-2 focus:ring-[#007BFF]/30",$?"bg-white/[0.03] border-[#222] text-white placeholder:text-white/30 font-mono":"bg-gray-100 border-gray-200 text-gray-900 placeholder:text-gray-400")})]}),jsxRuntime.jsx("div",{className:"flex-1"}),l&&jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:l}),y&&mt>1&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs("button",{ref:kt,onClick:()=>$t(!Ot),className:u("flex items-center gap-1.5 px-2 py-1.5 rounded-lg border transition-colors text-[11px] font-medium",$?Ot?"bg-blue-500/10 border-blue-500/40 text-blue-400":"bg-white/[0.03] border-[#333] text-white/50 hover:text-white/70 hover:bg-white/[0.05]":Ot?"bg-blue-50 border-blue-300 text-blue-600":"bg-gray-100 border-gray-200 text-gray-500 hover:text-gray-700 hover:bg-gray-200"),style:{fontFamily:"'JetBrains Mono', monospace"},children:[jsxRuntime.jsx(lucideReact.Layers,{className:"w-3.5 h-3.5"}),tt==="all"?d==="es"?"Todos":"All":`L${tt}`]}),Ot&&jsxRuntime.jsx("div",{ref:Ct,className:u("absolute top-full mt-1 right-0 w-24 rounded-lg border overflow-hidden z-50 shadow-lg",$?"bg-[#1A1A1A] border-[#333]":"bg-white border-gray-200"),children:[{value:"all",label:d==="es"?"Todos":"All"},...Array.from({length:Math.min(mt,5)},(F,ge)=>({value:ge+1,label:`L${ge+1}`}))].map(F=>jsxRuntime.jsxs("button",{onClick:()=>{ot(F.value),$t(false);},className:u("w-full px-3 py-2 text-left text-xs transition-colors flex items-center justify-between",$?tt===F.value?"bg-blue-500/10 text-blue-400":"text-white/60 hover:bg-white/[0.05] hover:text-white/80":tt===F.value?"bg-blue-50 text-blue-600":"text-gray-600 hover:bg-gray-100"),children:[jsxRuntime.jsx("span",{children:F.label}),tt===F.value&&jsxRuntime.jsx("span",{className:"text-blue-400",children:"\u2713"})]},String(F.value)))})]}),jsxRuntime.jsx(Ug,{value:Ie,hideCompleted:at,onChange:He,onHideCompletedChange:te,isDark:$,locale:d}),I?.enabled&&I.data&&!K&&jsxRuntime.jsx("button",{onClick:()=>be(true),className:u("flex items-center justify-center w-8 h-8 rounded-lg border transition-colors",$?"border-[#333] text-white/40 hover:text-white/70 hover:bg-white/[0.05]":"border-gray-200 text-gray-400 hover:text-gray-600 hover:bg-gray-100"),title:d==="es"?"Abrir panel de salud":"Open health panel",children:jsxRuntime.jsx(lucideReact.PanelRight,{className:"w-4 h-4"})}),t.toolbarEndContent,v&&C&&jsxRuntime.jsxs(framerMotion.motion.button,{onClick:C,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-[transform,box-shadow]",style:{background:"linear-gradient(135deg, #007BFF 0%, #005FCC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 123, 255, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 123, 255, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),jsxRuntime.jsx("span",{children:R.toolbar.newTask})]})]})}),jsxRuntime.jsxs("div",{style:{display:"flex",flex:"1 1 0%",overflow:"hidden",minHeight:0},children:[jsxRuntime.jsx("div",{style:{flex:"1 1 0%",overflow:"auto",minHeight:0},children:jsxRuntime.jsxs("div",{style:{width:"100%"},children:[jsxRuntime.jsxs("div",{className:u("flex-shrink-0 flex items-center border-b text-[9px] font-bold uppercase tracking-wider sticky top-0 z-10",$?"border-[#222] bg-[#1A1A1A] font-mono":"border-gray-200 bg-gray-50"),children:[ze.map(F=>{let ge=F.id!=="name",Ce=ue===F.id&&V!==F.id;return jsxRuntime.jsxs("div",{className:u("relative flex items-center gap-2 px-4 py-2 transition-all duration-150 group",$?"text-white/60":"text-gray-500",ge&&"cursor-grab",V===F.id&&"opacity-50",Ce&&($?"bg-[#007BFF]/20 border-l-2 border-l-[#007BFF]":"bg-blue-50 border-l-2 border-l-blue-400")),style:{width:pa[F.id],minWidth:F.minWidth},draggable:ge,onDragStart:ge?Ge=>Oe(Ge,F.id):void 0,onDragEnd:ge?A:void 0,onDragOver:ge?Ge=>me(Ge,F.id):void 0,onDragLeave:ge?Ve:void 0,onDrop:ge?Ge=>et(Ge,F.id):void 0,onContextMenu:Ge=>Zt(Ge,void 0,F.id),children:[ge&&jsxRuntime.jsx(lucideReact.GripVertical,{className:u("w-3 h-3 flex-shrink-0 transition-opacity",$?"text-white/20 group-hover:text-white/50":"text-gray-300 group-hover:text-gray-500")}),F.sortable?jsxRuntime.jsxs("button",{draggable:false,onClick:()=>xt(F.id),className:"flex items-center gap-1 hover:text-[#007BFF]",children:[Wa(F),jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:u("w-3 h-3",_e===F.id&&"text-[#007BFF]")})]}):jsxRuntime.jsx("span",{draggable:false,children:Wa(F)}),f&&F.resizable&&jsxRuntime.jsx("div",{className:u("absolute right-0 top-0 bottom-0 w-1 cursor-col-resize group","hover:bg-[#007BFF]",At===F.id&&"bg-[#007BFF]"),onMouseDown:Ge=>ne(Ge,F.id)})]},F.id)}),h&&jsxRuntime.jsxs("div",{className:"relative flex items-center justify-center px-3 py-0.5",children:[jsxRuntime.jsx("button",{onClick:F=>{F.stopPropagation(),bt(ge=>!ge);},className:u("p-0.5 rounded transition-colors",$?"hover:bg-white/[0.05] text-white/60 hover:text-white":"hover:bg-gray-200 text-gray-400 hover:text-gray-600",nt&&($?"bg-white/[0.05]":"bg-gray-200")),title:d==="es"?"Agregar columna":"Add column",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3 h-3"})}),jsxRuntime.jsx(Ig,{isOpen:nt,onClose:()=>bt(false),columns:Qe,customFields:c,onColumnsChange:ft,onCreateCustomField:()=>{bt(false),ke(true);},isDark:$,locale:d})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"popLayout",children:fa.map((F,ge)=>{let Ce=Xe.has(F.id),Ge=Math.min(ge*.01,.2),Ze=F.hasChildren&&F.level===0,lt=F.subtasks?.length||0;if(Ze){let{spent:zt,allocated:Xt,quoted:ba}=Un(F),Nr=nw(F),ha=sw(F);return jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,delay:Ge},className:u("flex items-center border-y cursor-pointer",$?"border-[#222] bg-[#222]":"border-gray-200 bg-gray-100"),onClick:()=>a.onTaskClick?.(F),children:ze.map(ir=>jsxRuntime.jsx("div",{className:"flex items-center px-4 py-2.5",style:{width:pa[ir.id],minWidth:ir.minWidth},children:ir.type==="name"?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 min-w-0 w-full",children:[jsxRuntime.jsx("button",{onClick:ya=>{ya.stopPropagation(),Be(F.id);},className:u("p-0.5 rounded flex-shrink-0",$?"hover:bg-white/[0.05]":"hover:bg-gray-200"),children:Ce?jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-4 h-4",$?"text-white/40":"text-gray-500")}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:u("w-4 h-4",$?"text-white/40":"text-gray-500")})}),jsxRuntime.jsx("span",{onClick:ya=>{ya.stopPropagation(),Be(F.id);},className:"flex-shrink-0 cursor-pointer",children:Ce?jsxRuntime.jsx(lucideReact.FolderOpen,{className:"w-4 h-4",style:{color:$?"#FFD60A":"#B45309"}}):jsxRuntime.jsx(lucideReact.Folder,{className:"w-4 h-4",style:{color:$?"#FFD60A":"#B45309"}})}),F.wbsCode&&jsxRuntime.jsx("span",{className:"text-[10px] font-mono flex-shrink-0",style:{color:$?"#FFD60A":"#B45309"},children:F.wbsCode}),jsxRuntime.jsx("span",{title:F.name,className:u("text-[11px] font-semibold uppercase tracking-wide truncate",$?"text-white":"text-gray-800"),style:{fontFamily:"Inter, system-ui, sans-serif",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},children:F.name}),jsxRuntime.jsxs("span",{className:u("text-[10px] font-mono px-2 py-0.5 rounded-full flex-shrink-0",$?"text-white/30 bg-white/[0.05]":"text-gray-500 bg-gray-200"),children:["(",lt," ",d==="es"?lt===1?"Tarea":"Tareas":lt===1?"Item":"Items",")"]}),Nr!==null&&jsxRuntime.jsxs("span",{className:u("text-[10px] font-mono flex-shrink-0",Nr>=1?"text-[#32D74B]":Nr>=.8?"text-[#FFD60A]":"text-[#FF453A]"),children:["Avg SPI: ",Nr.toFixed(2)]}),ha>0&&jsxRuntime.jsxs("span",{className:"text-[10px] font-mono text-[#FF453A] flex-shrink-0",children:[d==="es"?"Conflicto":"Conflict",": ",ha]})]}):ir.type==="timeLoggedMinutes"?jsxRuntime.jsx(hr,{value:zt>0?zt:void 0,isDark:$,locale:d,disabled:true,lens:k,hourlyRate:M(F)}):ir.type==="soldEffortMinutes"?jsxRuntime.jsx(hr,{value:ba>0?ba:void 0,isDark:$,locale:d,disabled:true,lens:k,hourlyRate:M(F)}):ir.type==="effortMinutes"?jsxRuntime.jsx(hr,{value:Xt>0?Xt:void 0,isDark:$,locale:d,disabled:true,lens:k,hourlyRate:M(F)}):Ua(F,ir)},ir.id))},F.id)}let ye=je===F.id,rt=j===F.id,Tt=rt&&he==="above",qt=rt&&he==="below",Dt=rt&&he==="child";return jsxRuntime.jsxs(framerMotion.motion.div,{"data-listview-row":F.id,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,delay:Ge},className:u("flex items-center border-b transition-colors relative group",$?"border-[#222] hover:bg-white/[0.05]":"border-gray-100 hover:bg-gray-50"),style:{opacity:ye?.4:1,backgroundColor:Dt?$?"rgba(46,148,255,0.08)":"rgba(46,148,255,0.05)":void 0,boxShadow:Dt?"inset 0 0 0 2px #2E94FF":void 0},onClick:()=>a.onTaskClick?.(F),onDoubleClick:()=>a.onTaskDoubleClick?.(F),onContextMenu:zt=>Zt(zt,F),children:[Tt&&jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:"#2E94FF",zIndex:10}}),qt&&jsxRuntime.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:2,backgroundColor:"#2E94FF",zIndex:10}}),Ee&&jsxRuntime.jsx("div",{className:"flex-shrink-0 flex items-center justify-center w-5 cursor-grab opacity-0 group-hover:opacity-40 hover:!opacity-80 transition-opacity",onMouseDown:zt=>qe(F.id,zt),style:{color:$?"#888":"#999"},children:jsxRuntime.jsx(lucideReact.GripVertical,{className:"w-3 h-3"})}),ze.map(zt=>jsxRuntime.jsx("div",{className:"flex items-center px-4 py-3 min-h-[56px]",style:{width:pa[zt.id],minWidth:zt.minWidth},children:zt.type==="name"?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 min-w-0 w-full",children:[y&&F.level>0&&jsxRuntime.jsx("div",{style:{width:`${F.level*24}px`},className:"flex-shrink-0"}),y&&F.hasChildren&&jsxRuntime.jsx("button",{onClick:Xt=>{Xt.stopPropagation(),Be(F.id);},className:u("p-0.5 rounded flex-shrink-0",$?"hover:bg-white/[0.05]":"hover:bg-gray-200"),children:Ce?jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-4 h-4",$?"text-white/60":"text-gray-400")}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:u("w-4 h-4",$?"text-white/60":"text-gray-400")})}),y&&!F.hasChildren&&jsxRuntime.jsx("div",{className:"w-5 flex-shrink-0"}),jsxRuntime.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[(F.wbsCode||F.taskCode)&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[F.wbsCode&&jsxRuntime.jsx("span",{className:u("text-[10px] font-mono",$?"text-[#007BFF]":"text-blue-600"),children:F.wbsCode}),F.taskCode&&jsxRuntime.jsx("span",{className:u("text-[10px] font-mono",$?"text-white/40":"text-gray-400"),children:F.taskCode})]}),jsxRuntime.jsx("span",{className:u("truncate font-bold text-[13px]",F.progress===100?$?"line-through text-white/50":"line-through text-gray-400":$?"text-white":"text-gray-900"),children:F.name}),F.tags?.[0]&&jsxRuntime.jsx("span",{className:"text-[9px] font-mono uppercase tracking-wide px-1.5 py-0.5 rounded w-fit",style:{backgroundColor:`${F.tags[0].color}20`,color:F.tags[0].color},children:F.tags[0].name})]})]}):Ua(F,zt)},zt.id)),h&&jsxRuntime.jsx("div",{className:"w-12 flex-shrink-0"})]},F.id)})}),J&&fa.length>0&&(()=>{let{spent:F,allocated:ge,quoted:Ce}=Z,Ge=ge-F,Ze=Ge<0,lt=Ze?`+${zn(Math.abs(Ge))} ${d==="es"?"EXCEDIDO":"OVER"}`:`-${zn(Ge)} ${d==="es"?"AHORRADO":"SAVED"}`,ye=k==="financial"&&P>0,rt=Dt=>ye?`$${(Dt/60*P).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0})}`:zn(Dt),Tt=ye?Math.abs(Ge/60*P):0,qt=ye?`${Ze?"+":"-"}$${Tt.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0})} ${Ze?d==="es"?"EXCEDIDO":"OVER":d==="es"?"AHORRADO":"SAVED"}`:lt;return jsxRuntime.jsxs("div",{className:u("flex items-center sticky bottom-0 z-10",$?"border-t border-[#2A2A3A]":"border-t border-gray-300"),style:{backgroundColor:$?"rgba(13, 17, 23, 0.95)":"rgba(255, 255, 255, 0.95)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:[ze.map(Dt=>jsxRuntime.jsx("div",{className:"flex items-center px-4 py-3",style:{width:pa[Dt.id],minWidth:Dt.minWidth},children:Dt.type==="name"?jsxRuntime.jsx("span",{className:u("text-[11px] font-black uppercase tracking-widest",$?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:d==="es"?"TOTAL PROYECTO":"TOTAL PROJECT"}):Dt.type==="hoursBar"?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 w-full",children:[jsxRuntime.jsx("span",{className:u("text-[12px] font-bold",$?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:rt(F)}),jsxRuntime.jsx("span",{className:u("text-[11px]",$?"text-white/40":"text-gray-400"),children:"/"}),jsxRuntime.jsx("span",{className:u("text-[11px]",$?"text-white/50":"text-gray-500"),style:{fontFamily:"JetBrains Mono, monospace"},children:rt(ge)}),ge>0&&jsxRuntime.jsx("span",{className:u("text-[10px] font-semibold ml-1",Ze?"text-[#FF453A]":"text-[#32D74B]"),style:{fontFamily:"JetBrains Mono, monospace"},children:ye?qt:lt})]}):Dt.type==="soldEffortMinutes"?jsxRuntime.jsx("span",{className:u("text-[12px] font-bold",$?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:Ce>0?rt(Ce):"\u2013"}):Dt.type==="effortMinutes"?(()=>{if(ye&&Ce>0&&ge>0){let zt=Math.round(Ce/60*(P||25)),Xt=Math.round(ge/60*(P||25)),ba=zt-Xt,Nr=zt>0?Math.round(ba/zt*100):0;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:u("text-[12px] font-bold",$?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:rt(ge)}),jsxRuntime.jsxs("span",{className:u("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap",ba>=0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[ba>=0?"+":"",Math.abs(ba)>=1e3?`$${(ba/1e3).toFixed(1)}K`:`$${ba}`,jsxRuntime.jsxs("span",{className:"ml-0.5 opacity-60",children:["(",Nr,"%)"]})]})]})}return jsxRuntime.jsx("span",{className:u("text-[12px] font-bold",$?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:ge>0?rt(ge):"\u2013"})})():Dt.type==="timeLoggedMinutes"?jsxRuntime.jsx("span",{className:u("text-[12px] font-bold",$?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:F>0?rt(F):"\u2013"}):Dt.type==="progress"?(()=>{let zt=e||[],Xt=0,ba=0,Nr=0,ha=0;for(let ya of zt){let pr=ya.weight||Re.get(ya.id)||0,ia=ya.progress||0;pr>0&&(Xt+=ia*pr,ba+=pr),Nr+=ia,ha++;}let ir=ba>0?Math.round(Xt/ba*10)/10:ha>0?Math.round(Nr/ha):0;return jsxRuntime.jsxs("span",{className:u("text-[12px] font-bold font-mono",$?"text-[#00E5CC]":"text-cyan-600"),style:{fontFamily:"JetBrains Mono, monospace"},children:[ir,"%"]})})():Dt.type==="weight"?(()=>{let zt=e||[],Xt=[],ba=ya=>{for(let pr of ya)Xt.push(pr),pr.subtasks?.length&&ba(pr.subtasks);};ba(zt);let ha=Xt.filter(ya=>!ya.subtasks?.length||ya.subtasks.length===0).reduce((ya,pr)=>ya+(pr.weight||0),0),ir=Math.abs(ha-100)<.1;return jsxRuntime.jsxs("span",{className:u("text-[12px] font-bold font-mono",ir?$?"text-[#22C55E]":"text-green-600":"text-[#EF4444]"),style:{fontFamily:"JetBrains Mono, monospace"},children:[Number(ha.toFixed(1)),"%"]})})():jsxRuntime.jsx("span",{className:u("text-[11px]",$?"text-white/30":"text-gray-300"),children:"\u2013"})},Dt.id)),h&&jsxRuntime.jsx("div",{className:"w-12 flex-shrink-0"})]})})(),fa.length===0&&Me&&jsxRuntime.jsx("div",{className:"flex items-center justify-center py-12",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(lucideReact.List,{className:u("w-12 h-12 mx-auto mb-4",$?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("p",{className:u($?"text-white/60":"text-gray-600"),children:R.empty.noResults})]})})]})}),I?.enabled&&I.data&&K&&jsxRuntime.jsx(Gg,{data:I.data,isDark:$,locale:d,onClose:()=>be(false),lens:t?.lens})]}),jsxRuntime.jsx(Cg,{state:wt,onClose:U,isDark:$,locale:d,onTaskEdit:a.onTaskEdit,onTaskDuplicate:a.onTaskDuplicate,onTaskDelete:a.onTaskDelete,onTaskUpdate:a.onTaskUpdate,onColumnHide:Gt,onColumnSort:Ta,availableUsers:i,onOpenTimeLog:a.onOpenTimeLog,onReportBlocker:a.onReportBlocker,onCopyTaskLink:a.onCopyTaskLink,onTaskMove:a.onTaskMove,onTaskIndent:a.onTaskIndent,onTaskOutdent:a.onTaskOutdent}),ie&&ee&&je&&reactDom.createPortal(jsxRuntime.jsx("div",{style:{position:"fixed",left:ee.x+12,top:ee.y-10,zIndex:99999,pointerEvents:"none"},children:(()=>{let ge=De.flattenTasks(e).find(Ce=>Ce.id===je);return ge?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg",style:{backgroundColor:$?"rgba(10,10,10,0.9)":"rgba(255,255,255,0.95)",border:`1px solid ${$?"rgba(255,255,255,0.1)":"#e5e7eb"}`,backdropFilter:"blur(8px)",boxShadow:"0 4px 12px rgba(0,0,0,0.3)"},children:[jsxRuntime.jsx(lucideReact.GripVertical,{className:"w-3 h-3",style:{color:"#2E94FF"}}),jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:$?"#e6edf3":"#111827"},children:ge.name})]}):null})()}),document.body),jsxRuntime.jsx(Og,{isOpen:Bt,onClose:()=>ke(false),onSave:ra,isDark:$,locale:d})]})}var Jg=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:140,visible:true,sortable:true,resizable:true},{id:"priority",type:"priority",label:"Priority",width:100,visible:false,sortable:true,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true},{id:"tags",type:"tags",label:"Tags",width:150,visible:false,sortable:false,resizable:true},{id:"soldEffortMinutes",type:"soldEffortMinutes",label:"Quoted",width:100,visible:false,sortable:true,resizable:true},{id:"effortMinutes",type:"effortMinutes",label:"Estimated",width:100,visible:false,sortable:true,resizable:true},{id:"timeLoggedMinutes",type:"timeLoggedMinutes",label:"Executed",width:100,visible:false,sortable:true,resizable:true},{id:"scheduleVariance",type:"scheduleVariance",label:"Sched / Var",width:180,visible:false,sortable:true,resizable:true},{id:"hoursBar",type:"hoursBar",label:"Hours",width:200,visible:false,sortable:true,resizable:true},{id:"teamLoad",type:"teamLoad",label:"Team Load",width:160,visible:false,sortable:true,resizable:true},{id:"blockers",type:"blockers",label:"Blockers",width:150,visible:false,sortable:false,resizable:true},{id:"weight",type:"weight",label:"Weight",width:80,visible:false,sortable:true,resizable:true}],Qg=[{type:"name",labelKey:"columns.name",icon:"Type"},{type:"status",labelKey:"columns.status",icon:"CircleDot"},{type:"priority",labelKey:"columns.priority",icon:"Flag"},{type:"assignees",labelKey:"columns.assignees",icon:"Users"},{type:"startDate",labelKey:"columns.startDate",icon:"Calendar"},{type:"endDate",labelKey:"columns.endDate",icon:"CalendarCheck"},{type:"progress",labelKey:"columns.progress",icon:"BarChart"},{type:"tags",labelKey:"columns.tags",icon:"Tag"},{type:"effortMinutes",labelKey:"columns.effortMinutes",icon:"Clock"},{type:"timeLoggedMinutes",labelKey:"columns.timeLoggedMinutes",icon:"Timer"},{type:"soldEffortMinutes",labelKey:"columns.soldEffortMinutes",icon:"FileText"},{type:"scheduleVariance",labelKey:"columns.scheduleVariance",icon:"CalendarClock"},{type:"hoursBar",labelKey:"columns.hoursBar",icon:"BarChart3"},{type:"teamLoad",labelKey:"columns.teamLoad",icon:"Users"},{type:"blockers",labelKey:"columns.blockers",icon:"AlertTriangle"},{type:"weight",labelKey:"columns.weight",icon:"Scale"}],Zg=[{type:"text",labelKey:"customFields.text",icon:"Type"},{type:"number",labelKey:"customFields.number",icon:"Hash"},{type:"date",labelKey:"customFields.date",icon:"Calendar"},{type:"dropdown",labelKey:"customFields.dropdown",icon:"ChevronDown"},{type:"checkbox",labelKey:"customFields.checkbox",icon:"CheckSquare"}];var oc={bgPrimary:"#0D0D0D",bgSecondary:"#141414",bgHover:"rgba(255,255,255,0.05)",bgSelected:"#0D131E",bgAlternate:"#141414",border:"#222222",borderLight:"#1A1A1A",textPrimary:"rgba(255,255,255,0.9)",textSecondary:"rgba(255,255,255,0.6)",textMuted:"rgba(255,255,255,0.3)",accent:"#007BFF",accentHover:"#2979FF",accentLight:"rgba(0,123,255,0.15)",statusTodo:"rgba(255,255,255,0.4)",statusInProgress:"#007BFF",statusCompleted:"#34D399",focusRing:"#007BFF",checkboxBg:"#1A1A1A",checkboxChecked:"#007BFF",bgGroupHeader:"#222222",headerBg:"#1A1A1A",neonRed:"#FF2D20",neonGreen:"#3BF06E",neonAmber:"#FFD60A",neonBlue:"#3B9EFF"},nc={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgSelected:"#dbeafe",bgAlternate:"#f9fafb",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da",checkboxBg:"#ffffff",checkboxChecked:"#0969da",bgGroupHeader:"#F3F4F6",headerBg:"#F9FAFB",neonRed:"#DC2626",neonGreen:"#16A34A",neonAmber:"#D97706",neonBlue:"#2E94FF"},sc={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgSelected:"#0f4c7520",bgAlternate:"#1a1a2e80",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1",checkboxBg:"#1f3460",checkboxChecked:"#6366f1",bgGroupHeader:"#1f3460",headerBg:"#16213e",neonRed:"#EF4444",neonGreen:"#34D399",neonAmber:"#FBBF24",neonBlue:"#6366F1"},Ki={dark:oc,light:nc,neutral:sc};function e0(e){return Ki[e]||Ki.dark}var ic={navigation:{today:"Today",previous:"Previous",next:"Next",month:"Month",week:"Week",day:"Day"},weekdays:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weekdaysFull:{sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday"},months:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},labels:{allDay:"All day",moreEvents:"+{count} more",noEvents:"No tasks",newTask:"New Task",viewAll:"View all",week:"Week",backlogTitle:"BACKLOG / UNSCHEDULED",systemStatus:"SYSTEM STATUS",budgetUtil:"Budget Util.",variance:"VARIANCE",cost:"COST",estimate:"Est",sold:"Sold",cashOut:"Cash Out",typeToAdd:"Type to add (e.g., Crane Inspection)",critical:"CRITICAL",blocker:"Blocker",risk:"Risk",delay:"delay",days:"Days"},tooltips:{progress:"Progress",status:"Status",assignees:"Assignees",duration:"Duration",days:"days"}},lc={navigation:{today:"Hoy",previous:"Anterior",next:"Siguiente",month:"Mes",week:"Semana",day:"D\xEDa"},weekdays:{sun:"Dom",mon:"Lun",tue:"Mar",wed:"Mi\xE9",thu:"Jue",fri:"Vie",sat:"S\xE1b"},weekdaysFull:{sunday:"Domingo",monday:"Lunes",tuesday:"Martes",wednesday:"Mi\xE9rcoles",thursday:"Jueves",friday:"Viernes",saturday:"S\xE1bado"},months:{january:"Enero",february:"Febrero",march:"Marzo",april:"Abril",may:"Mayo",june:"Junio",july:"Julio",august:"Agosto",september:"Septiembre",october:"Octubre",november:"Noviembre",december:"Diciembre"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},labels:{allDay:"Todo el d\xEDa",moreEvents:"+{count} m\xE1s",noEvents:"Sin tareas",newTask:"Nueva Tarea",viewAll:"Ver todo",week:"Semana",backlogTitle:"BACKLOG / SIN FECHA",systemStatus:"ESTADO DEL SISTEMA",budgetUtil:"Util. Presupuesto",variance:"VARIANZA",cost:"COSTO",estimate:"Est",sold:"Vendido",cashOut:"Desembolso",typeToAdd:"Escribe para agregar (ej: Inspecci\xF3n)",critical:"CR\xCDTICO",blocker:"Bloqueador",risk:"Riesgo",delay:"retraso",days:"D\xEDas"},tooltips:{progress:"Progreso",status:"Estado",assignees:"Asignados",duration:"Duraci\xF3n",days:"d\xEDas"}},Yi={en:ic,es:lc};function Cs(e){return Yi[e]||Yi.en}function qi(e,t){let a=Cs(e);return t?{navigation:{...a.navigation,...t.navigation},weekdays:{...a.weekdays,...t.weekdays},weekdaysFull:{...a.weekdaysFull,...t.weekdaysFull},months:{...a.months,...t.months},status:{...a.status,...t.status},labels:{...a.labels,...t.labels},tooltips:{...a.tooltips,...t.tooltips}}:a}function t0(e){let t=Cs(e);return [t.months.january,t.months.february,t.months.march,t.months.april,t.months.may,t.months.june,t.months.july,t.months.august,t.months.september,t.months.october,t.months.november,t.months.december]}function a0(e,t=0,a=true){let r=Cs(e),o=a?[r.weekdays.sun,r.weekdays.mon,r.weekdays.tue,r.weekdays.wed,r.weekdays.thu,r.weekdays.fri,r.weekdays.sat]:[r.weekdaysFull.sunday,r.weekdaysFull.monday,r.weekdaysFull.tuesday,r.weekdaysFull.wednesday,r.weekdaysFull.thursday,r.weekdaysFull.friday,r.weekdaysFull.saturday];return [...o.slice(t),...o.slice(0,t)]}function Ns(e){let t=[];function a(r){for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);}return a(e),t}function cc(e,t){if(!t.startDate||!t.endDate)return false;let a=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(t.startDate.getFullYear(),t.startDate.getMonth(),t.startDate.getDate()),o=new Date(t.endDate.getFullYear(),t.endDate.getMonth(),t.endDate.getDate());return a>=r&&a<=o}function n0({task:e,isDark:t}){return e.progress===100||e.status==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-emerald-400 flex-shrink-0"}):e.progress&&e.progress>0||e.status==="in-progress"?jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-3 h-3 text-[#007FFF] flex-shrink-0"}):jsxRuntime.jsx(lucideReact.Circle,{className:u("w-3 h-3 flex-shrink-0",t?"text-white/40":"text-gray-400")})}var l0=26,fw=22,bw=10;function s0(e,t){let a=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate());return Math.round((a-r)/(1e3*60*60*24))}function uc(e,t="hours",a=0){if(!e||e<=0)return null;if(t==="financial"&&a>0){let o=Math.round(e/60*a);return o>=1e3?`$${(o/1e3).toFixed(1)}k`:`$${o}`}let r=Math.round(e/480);return r>0?`${r}d`:null}function d0(e,t="hours",a=0){if(e.soldEffortMinutes==null||e.effortMinutes==null)return null;let r=e.soldEffortMinutes-e.effortMinutes;if(r===0)return null;let o=r<0,s;if(t==="financial"&&a>0){let n=Math.round(Math.abs(r/60)*a);s=n>=1e3?`$${(n/1e3).toFixed(1)}k`:`$${n}`;}else {let n=Math.round(Math.abs(r)/60);s=n>=1e3?`$${(n/1e3).toFixed(1)}k`:`$${n}`;}return {text:`${o?"-":"+"}${s}`,isNegative:o}}function i0(e,t="hours",a=0){if(t==="financial"&&a>0){let o=Math.round(Math.abs(e/60)*a);return o>=1e3?`$${(o/1e3).toFixed(1)}k`:`$${o}`}let r=Math.round(Math.abs(e)/60);return r>=1e3?`$${(r/1e3).toFixed(1)}k`:`$${r}`}function hw({segment:e,isDark:t,onClick:a,blurFinancials:r,isSelected:o,t:s,lens:n="hours",hourlyRate:i=0}){let{task:c,spanCols:l,lane:m,isStart:d,isEnd:p}=e,g=c.progress===100||c.status==="completed",y=c.isCriticalPath,x=d&&p?"rounded":d?"rounded-l":p?"rounded-r":"",h=p?uc(c.effortMinutes,n,i):null,f=p?d0(c,n,i):null,b=p?c.blockers?.find(v=>v.severity==="critical"):null;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:v=>{v.stopPropagation(),a();},whileHover:{scale:1.005},className:u("absolute flex items-center gap-1.5 px-2 text-xs cursor-pointer overflow-hidden",x,g?t?"text-emerald-400":"bg-emerald-500/10 text-emerald-600 border border-emerald-200":y?t?"text-white/90":"bg-red-50 border border-red-200 text-red-700 hover:border-red-300":t?"text-white/90":"bg-gray-50 border border-gray-200 text-gray-700 hover:border-blue-300"),style:{top:`${m*l0}px`,left:"1px",width:`calc(${l*100}% - 2px)`,height:`${fw}px`,zIndex:10,...t?g?{background:"rgba(16, 185, 129, 0.28)",border:"1px solid rgba(16, 185, 129, 0.50)",boxShadow:"0 0 14px rgba(16, 185, 129, 0.2), inset 0 0 14px rgba(16, 185, 129, 0.1)"}:y?{background:"rgba(239, 68, 68, 0.35)",border:"1px solid rgba(239, 68, 68, 0.65)",boxShadow:"0 0 18px rgba(239, 68, 68, 0.3), inset 0 0 18px rgba(239, 68, 68, 0.15)"}:{background:"rgba(18, 100, 255, 0.38)",border:"1px solid rgba(18, 100, 255, 0.65)",boxShadow:"0 0 18px rgba(18, 100, 255, 0.28), inset 0 0 18px rgba(18, 100, 255, 0.14)"}:{},borderLeftWidth:d?"3px":void 0,borderLeftColor:d?y?"#EF4444":g?"#10B981":"#1264FF":void 0,...o?{boxShadow:t?"0 0 0 1.5px rgba(0, 229, 255, 0.7), 0 0 12px rgba(0, 229, 255, 0.3)":"0 0 0 1.5px rgba(59, 130, 246, 0.7), 0 0 12px rgba(59, 130, 246, 0.2)",zIndex:20}:{}},children:[y&&d&&jsxRuntime.jsxs("span",{className:"text-[9px] font-mono font-bold text-red-400 uppercase tracking-wider flex-shrink-0",children:[s.labels.critical,":"]}),jsxRuntime.jsx("span",{className:"truncate flex-1 text-left font-medium",children:c.name}),p&&(h||f)&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0 text-[9px] font-mono text-white/35 ml-1",children:[h&&jsxRuntime.jsxs("span",{children:[s.labels.estimate,": ",h]}),f&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"text-white/15",children:"|"}),jsxRuntime.jsx("span",{className:u(f.isNegative?"text-red-400":"text-emerald-400",r&&"blur-sm select-none"),children:f.text})]})]}),b&&jsxRuntime.jsxs("span",{className:"flex-shrink-0 text-[8px] font-mono px-1.5 py-0.5 rounded bg-red-500/20 text-red-400 border border-red-500/30 ml-1",children:[s.labels.blocker,": ",b.type]}),c.progress>0&&c.progress<100&&jsxRuntime.jsx("div",{className:"absolute bottom-0 left-0 h-[2px] bg-[#1264FF]",style:{width:`${c.progress}%`}})]})}function c0({tasks:e,config:t={},callbacks:a={},initialDate:r,isLoading:o=false,error:s,className:n,style:i,availableTags:c=[],onCreateTag:l,attachmentsByTask:m,comments:d,onAddComment:p,currentUser:g,mentionableUsers:y,onUploadCommentAttachments:x,onTaskOpen:h,enableTimeTracking:f,timeTrackingSummary:b,timeEntries:v,timerState:C,onLogTime:w,onUpdateEstimate:N,onUpdateSoldEffort:T,onStartTimer:k,onStopTimer:P,onDiscardTimer:O,blurFinancials:S=false,suppressDetailModal:J=false,lens:R="hours",hourlyRate:$=0}){let{theme:M="dark",locale:q="en",customTranslations:Z,showBacklog:Re=true}=t,I=qi(q,Z),K=M==="dark"||M==="neutral",[be,_e]=react.useState(r||new Date),[z,ae]=react.useState(null),[Q,Me]=react.useState(null),[we,Ie]=react.useState(null),[He,at]=react.useState({}),te=3,Qe=3,ce=react.useCallback(G=>{Me(G.id),J||ae(G),h?.(G.id);},[J,h]),[nt,bt]=react.useState(null),Bt=react.useCallback(()=>{_e(new Date(be.getFullYear(),be.getMonth()-1,1));},[be]),ke=react.useCallback(()=>{_e(new Date(be.getFullYear(),be.getMonth()+1,1));},[be]),wt=react.useCallback(()=>{_e(new Date);},[]),it=react.useMemo(()=>{let G=be.getFullYear(),ee=be.getMonth(),Ue=new Date(G,ee,1),Te=new Date(G,ee+1,0),Le=Ue.getDay(),Ee=Te.getDate(),qe=Ns(e),yt=new Date;yt.setHours(0,0,0,0);let pt=[],tt=Le,ot=new Date(G,ee,0).getDate();for(let $t=tt-1;$t>=0;$t--){let kt=new Date(G,ee-1,ot-$t);pt.push({date:kt,isCurrentMonth:false,isToday:false,isWeekend:kt.getDay()===0||kt.getDay()===6,events:qe.filter(Ct=>cc(kt,Ct)).map(Ct=>({id:Ct.id,title:Ct.name,start:Ct.startDate,end:Ct.endDate,task:Ct}))});}for(let $t=1;$t<=Ee;$t++){let kt=new Date(G,ee,$t),Ct=kt.getTime()===yt.getTime();pt.push({date:kt,isCurrentMonth:true,isToday:Ct,isWeekend:kt.getDay()===0||kt.getDay()===6,events:qe.filter(mt=>cc(kt,mt)).map(mt=>({id:mt.id,title:mt.name,start:mt.startDate,end:mt.endDate,task:mt}))});}let Ot=42-pt.length;for(let $t=1;$t<=Ot;$t++){let kt=new Date(G,ee+1,$t);pt.push({date:kt,isCurrentMonth:false,isToday:false,isWeekend:kt.getDay()===0||kt.getDay()===6,events:qe.filter(Ct=>cc(kt,Ct)).map(Ct=>({id:Ct.id,title:Ct.name,start:Ct.startDate,end:Ct.endDate,task:Ct}))});}return pt},[be,e]),je=react.useMemo(()=>Ns(e).filter(G=>!G.startDate||!G.endDate),[e]),H=react.useMemo(()=>{let G=Ns(e),ee=0,Ue=0,Te=0,Le=0,Ee=0;G.forEach(ot=>{ot.effortMinutes&&(ee+=ot.effortMinutes),ot.soldEffortMinutes&&(Ue+=ot.soldEffortMinutes),ot.scheduleVariance!=null&&(Te+=ot.scheduleVariance,Le++),ot.soldEffortMinutes&&ot.effortMinutes&&(Ee+=ot.soldEffortMinutes-ot.effortMinutes);});let qe=Ue>0?Math.min(100,Math.round(ee/Ue*100)):0,yt=Le>0?Math.round(Te/Le):0,tt=`${Ee<0?"-":"+"}${i0(Ee,R,$)}`;return {budgetUtil:qe,avgVariance:yt,costDisplay:tt,hasCostData:Ue>0}},[e,R,$]),ie=react.useMemo(()=>{let G=[0,0,0,0,0,0];return it.forEach((ee,Ue)=>{let Te=Math.floor(Ue/7);ee.events.forEach(Le=>{if(Le.task.startDate&&Le.task.soldEffortMinutes){let Ee=new Date(Le.task.startDate),qe=ee.date;Ee.getFullYear()===qe.getFullYear()&&Ee.getMonth()===qe.getMonth()&&Ee.getDate()===qe.getDate()&&Te<G.length&&(G[Te]-=Le.task.soldEffortMinutes);}});}),G},[it]),D=react.useMemo(()=>{let G=Ns(e),ee=new Map,Ue=new Set,Te=[0,0,0,0,0,0];if(it.length===0)return {segmentsByCell:ee,multiDayTaskIds:Ue,maxLanesPerRow:Te};let Le=tt=>new Date(tt.getFullYear(),tt.getMonth(),tt.getDate()),Ee=Le(it[0].date),qe=Le(it[it.length-1].date),yt=[];for(let tt of G){if(!tt.startDate||!tt.endDate)continue;let ot=Le(tt.startDate),Ot=Le(tt.endDate);if(ot.getTime()===Ot.getTime()||Ot<Ee||ot>qe)continue;let $t=ot<Ee?Ee:ot,kt=Ot>qe?qe:Ot,Ct=s0($t,Ee),mt=s0(kt,Ee);Ct<0||Ct>41||mt<0||mt>41||Ct!==mt&&(Ue.add(tt.id),yt.push({task:tt,startIdx:Ct,endIdx:mt}));}yt.sort((tt,ot)=>tt.startIdx!==ot.startIdx?tt.startIdx-ot.startIdx:ot.endIdx-ot.startIdx-(tt.endIdx-tt.startIdx));let pt=[[],[],[],[],[],[]];for(let{task:tt,startIdx:ot,endIdx:Ot}of yt){let $t=Math.floor(ot/7),kt=Math.floor(Ot/7),Ct=Le(tt.startDate),mt=Le(tt.endDate),At=false;for(let We=$t;We<=kt;We++){let Pe=We===$t?ot%7:0,gt=We===kt?Ot%7:6,oe=gt-Pe+1,fe=0,L=pt[We]??[];for(pt[We]||(pt[We]=L);fe<L.length&&(L[fe]??-1)>=Pe;)fe++;if(fe>=bw){At=true;break}fe>=L.length?L.push(gt):L[fe]=gt,Te[We]=Math.max(Te[We]??0,fe+1);let V=We===$t&&Ct>=Ee,Y=We===kt&&mt<=qe,ue=We*7+Pe,Ne={taskId:tt.id,task:tt,rowIndex:We,startCol:Pe,endCol:gt,spanCols:oe,lane:fe,isStart:V,isEnd:Y};ee.has(ue)||ee.set(ue,[]),ee.get(ue).push(Ne);}At&&(Ue.delete(tt.id),ee.forEach((We,Pe)=>{let gt=We.filter(oe=>oe.taskId!==tt.id);gt.length===0?ee.delete(Pe):ee.set(Pe,gt);}));}return {segmentsByCell:ee,multiDayTaskIds:Ue,maxLanesPerRow:Te}},[it,e]),j=q==="es"?["Dom","Lun","Mar","Mi\xE9","Jue","Vie","S\xE1b"]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],le=be.toLocaleDateString(q==="es"?"es-ES":"en-US",{month:"long",year:"numeric"}),he=le.charAt(0).toUpperCase()+le.slice(1);return o?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",K?"bg-[#050505]":"bg-white",n),style:i,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#007FFF]"}),jsxRuntime.jsxs("p",{className:u("text-sm font-mono",K?"text-white/30":"text-gray-600"),children:[I.labels.noEvents,"..."]})]})}):s?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",K?"bg-[#050505]":"bg-white",n),style:i,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsxRuntime.jsx("div",{className:u("w-12 h-12 rounded-full flex items-center justify-center",K?"bg-red-500/10 border border-red-500/20":"bg-red-500/10"),children:jsxRuntime.jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:u("text-lg font-semibold mb-2",K?"text-white/90":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:u("text-sm",K?"text-white/40":"text-gray-600"),children:typeof s=="string"?s:s.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",K?"bg-[#050505]":"bg-white",n),style:i,children:jsxRuntime.jsxs("div",{className:"text-center max-w-md",children:[jsxRuntime.jsx("div",{className:u("w-16 h-16 mx-auto mb-4 rounded-2xl flex items-center justify-center",K?"bg-[#007FFF]/10 border border-[#007FFF]/20":"bg-blue-500/10"),children:jsxRuntime.jsx(lucideReact.Calendar,{className:u("w-8 h-8",K?"text-[#007FFF]":"text-blue-500")})}),jsxRuntime.jsx("h3",{className:u("text-lg font-semibold mb-2",K?"text-white/90":"text-gray-900"),children:I.labels.noEvents}),jsxRuntime.jsx("p",{className:u("text-sm",K?"text-white/30":"text-gray-600"),children:I.labels.newTask})]})}):jsxRuntime.jsxs("div",{className:u("flex-1 flex flex-col w-full h-full overflow-hidden",K?"bg-[#050505]":"bg-white",n),style:i,children:[jsxRuntime.jsxs("div",{className:"flex flex-1 overflow-hidden relative",children:[jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col min-w-0 relative overflow-hidden",children:[jsxRuntime.jsxs("div",{className:u("flex-shrink-0 h-10 flex items-center justify-between px-4 z-20",K?"bg-[#050505] border-b border-[#222]":"bg-white border-b border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[jsxRuntime.jsxs("div",{className:u("flex items-center gap-1.5 pl-2.5 pr-2 py-1 rounded-md text-xs transition-all",K?"bg-[#111] border border-white/10":"bg-gray-100 border border-gray-200"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:u("w-3.5 h-3.5",K?"text-[#007FFF]":"text-blue-500")}),jsxRuntime.jsx("span",{className:u("font-medium",K?"text-white":"text-gray-900"),children:q==="es"?"Calendario":"Calendar"})]}),jsxRuntime.jsx("div",{className:u("h-4 w-px",K?"bg-white/10":"bg-gray-200")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 select-none",children:[jsxRuntime.jsx("button",{onClick:Bt,className:u("w-6 h-6 flex items-center justify-center rounded transition-colors",K?"text-white/50 hover:text-white hover:bg-white/5":"text-gray-500 hover:text-gray-900 hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("span",{className:u("text-sm font-semibold tracking-tight min-w-[150px] text-center",K?"text-white":"text-gray-900"),children:he}),jsxRuntime.jsx("button",{onClick:ke,className:u("w-6 h-6 flex items-center justify-center rounded transition-colors",K?"text-white/50 hover:text-white hover:bg-white/5":"text-gray-500 hover:text-gray-900 hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[t.toolbarRightContent&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t.toolbarRightContent,jsxRuntime.jsx("div",{className:u("h-4 w-px",K?"bg-white/10":"bg-gray-200")})]}),jsxRuntime.jsx("button",{onClick:wt,className:u("px-2.5 py-1 text-xs rounded-md transition-all font-medium",K?"bg-white/5 border border-white/10 text-white/70 hover:bg-white/10 hover:text-white":"bg-gray-100 border border-gray-200 text-gray-700 hover:bg-gray-200"),children:I.navigation.today})]})]}),jsxRuntime.jsx("div",{className:u("grid grid-cols-7 sticky top-0 z-10",K?"bg-[#050505] border-b border-[#222]":"bg-white border-b border-gray-200"),children:j.map(G=>jsxRuntime.jsx("div",{className:u("py-2 text-center text-[10px] font-bold uppercase tracking-widest",K?"text-white/60 font-mono":"text-gray-500"),children:G},G))}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto",children:jsxRuntime.jsx("div",{className:u("grid grid-cols-7 min-h-[800px]",K?"bg-[#050505]":"bg-white"),style:{gridAutoRows:"minmax(140px, auto)"},onClick:()=>Me(null),children:it.map((G,ee)=>{let Ue=ee%7===6,Te=ee>=35;return jsxRuntime.jsxs("div",{className:u("min-h-[140px] p-2 transition-colors flex flex-col relative group overflow-visible",!Ue&&(K?"border-r border-[#222]":"border-r border-gray-200"),!Te&&(K?"border-b border-[#222]":"border-b border-gray-200"),K?G.isCurrentMonth?"bg-[#050505] hover:bg-white/[0.02]":"bg-[#080808] opacity-50":G.isCurrentMonth?"bg-white hover:bg-gray-50":"bg-gray-50 opacity-50",G.isToday&&K&&"ring-1 ring-[#007FFF]/40 ring-inset bg-[#007FFF]/[0.03]",G.isToday&&!K&&"ring-2 ring-blue-500 ring-inset"),children:[jsxRuntime.jsx("span",{className:u("text-xs font-mono select-none relative z-20",G.isToday?K?"text-[#007FFF] font-bold":"text-blue-600 font-bold":G.isCurrentMonth?K?"text-white/60":"text-gray-900":K?"text-white/20":"text-gray-400"),children:String(G.date.getDate()).padStart(2,"0")}),(()=>{let Le=Math.floor(ee/7),Ee=(D.maxLanesPerRow[Le]??0)*l0,qe=D.segmentsByCell.get(ee);return Ee===0&&!qe?null:jsxRuntime.jsx("div",{className:"relative -mx-2 overflow-visible",style:{minHeight:`${Ee}px`,zIndex:5},children:qe?.map(yt=>jsxRuntime.jsx(hw,{segment:yt,isDark:K,blurFinancials:S,isSelected:Q===yt.taskId,t:I,lens:R,hourlyRate:$,onClick:()=>{ce(yt.task),a.onEventClick?.({id:yt.task.id,title:yt.task.name,start:yt.task.startDate,end:yt.task.endDate,task:yt.task});}},yt.taskId))})})(),(()=>{let Le=G.events.filter(Ee=>Ee.task.isMilestone&&!D.multiDayTaskIds.has(Ee.id));return Le.length===0?null:jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mt-0.5 px-0.5",children:[Le.slice(0,4).map(Ee=>jsxRuntime.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 flex-shrink-0 cursor-pointer",title:Ee.title,onClick:qe=>{qe.stopPropagation(),ce(Ee.task);}},Ee.id)),Le.length>4&&jsxRuntime.jsxs("span",{className:u("text-[8px] font-mono",K?"text-white/30":"text-gray-400"),children:["+",Le.length-4]})]})})(),(()=>{let Le=[];G.events.forEach(qe=>{qe.task.blockers?.forEach(yt=>{(yt.severity==="warning"||yt.severity==="critical")&&Le.push({taskId:qe.id,type:yt.type,severity:yt.severity,variance:qe.task.scheduleVariance});});});let Ee=Le[0];return Ee?jsxRuntime.jsx("div",{className:"mt-0.5 px-0.5",children:jsxRuntime.jsxs("div",{className:u("text-[8px] font-mono px-1.5 py-0.5 rounded flex items-center gap-1",Ee.severity==="critical"?"bg-red-500/15 text-red-400 border border-red-500/20":"bg-amber-500/15 text-amber-400 border border-amber-500/20"),children:[jsxRuntime.jsx("span",{children:"\u26A0"}),jsxRuntime.jsxs("span",{className:"truncate",children:[I.labels.risk,": ",Ee.type,Ee.variance?` (+${Math.abs(Ee.variance)}d ${I.labels.delay})`:""]})]})}):null})(),(()=>{let Le=G.events.filter(pt=>!D.multiDayTaskIds.has(pt.id)),Ee=He[ee]||te,qe=Le.slice(0,Ee),yt=Le.length-Ee;return jsxRuntime.jsxs("div",{className:"mt-1 space-y-0.5 flex-1",children:[qe.map(pt=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{ce(pt.task),a.onEventClick?.(pt);},whileHover:{scale:1.01},className:u("w-full flex items-center gap-1.5 px-1.5 py-1 rounded text-[11px] transition-all text-left",pt.task.progress===100||pt.task.status==="completed"?K?"text-emerald-400":"bg-emerald-500/10 text-emerald-600":K?"text-white/90":"bg-gray-50 border border-gray-200 text-gray-700 hover:border-blue-300"),style:K?pt.task.progress===100||pt.task.status==="completed"?{background:"rgba(16, 185, 129, 0.28)",border:"1px solid rgba(16, 185, 129, 0.50)",boxShadow:"0 0 14px rgba(16, 185, 129, 0.2), inset 0 0 14px rgba(16, 185, 129, 0.1)"}:pt.task.isCriticalPath?{background:"rgba(239, 68, 68, 0.35)",border:"1px solid rgba(239, 68, 68, 0.65)",boxShadow:"0 0 18px rgba(239, 68, 68, 0.3), inset 0 0 18px rgba(239, 68, 68, 0.15)"}:{background:"rgba(18, 100, 255, 0.38)",border:"1px solid rgba(18, 100, 255, 0.65)",boxShadow:"0 0 18px rgba(18, 100, 255, 0.28), inset 0 0 18px rgba(18, 100, 255, 0.14)"}:void 0,children:[jsxRuntime.jsx("span",{className:u("flex-shrink-0 text-[9px]",pt.task.isMilestone?K?"text-amber-400":"text-amber-600":pt.task.isCriticalPath?"text-red-400":K?"text-[#1264FF]":"text-gray-400"),children:pt.task.isMilestone?"\u25C6":"\u25CF"}),jsxRuntime.jsx("span",{className:"truncate flex-1",children:pt.title})]},pt.id)),yt>0&&jsxRuntime.jsxs("button",{onClick:pt=>{pt.stopPropagation(),at(tt=>({...tt,[ee]:Ee+Qe}));},className:u("text-[10px] px-1.5 py-0.5 cursor-pointer font-mono font-medium uppercase tracking-wide transition-all rounded",K?"text-white/25 hover:text-white/50 hover:bg-white/5":"text-gray-400 hover:text-gray-600"),children:["+",yt," ",q==="es"?"m\xE1s":"more"]}),Ee>te&&Le.length>te&&jsxRuntime.jsx("button",{onClick:pt=>{pt.stopPropagation(),at(tt=>({...tt,[ee]:te}));},className:u("text-[10px] px-1.5 py-0.5 cursor-pointer font-mono font-medium uppercase tracking-wide transition-all rounded",K?"text-white/25 hover:text-white/50 hover:bg-white/5":"text-gray-400 hover:text-gray-600"),children:q==="es"?"menos":"less"})]})})(),G.isCurrentMonth&&a.onTaskCreate&&jsxRuntime.jsx("div",{className:"flex items-center justify-end mt-1",children:(()=>{let Le=ee>=28,Ee=ee%7>=5;return jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:qe=>{qe.stopPropagation(),bt(nt===ee?null:ee);},className:u("w-5 h-5 rounded flex items-center justify-center transition-all",nt===ee?"opacity-100 bg-[#007FFF] text-white":"opacity-0 group-hover:opacity-100",K?"hover:bg-[#007FFF] text-white/30 hover:text-white":"hover:bg-blue-500 text-gray-400 hover:text-white"),children:jsxRuntime.jsx(lucideReact.Plus,{className:u("w-3.5 h-3.5 transition-transform",nt===ee&&"rotate-45")})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:nt===ee&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>bt(null)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:Le?-5:5,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:Le?-5:5,scale:.95},transition:{duration:.12},className:u("absolute w-[320px] rounded-lg shadow-2xl z-50",Le?"bottom-full mb-1":"top-full mt-1",Ee?"right-0":"left-0",K?"bg-[#0A0A0A]/95 backdrop-blur-xl border border-white/[0.08] shadow-[0_8px_32px_rgba(0,0,0,0.6)]":"bg-white border border-gray-200 shadow-xl"),children:jsxRuntime.jsx(qo,{onSubmit:qe=>{a.onTaskCreate?.({name:qe.name,startDate:qe.startDate||G.date,endDate:qe.endDate||G.date,priority:qe.priority,assignees:qe.assignee?[qe.assignee]:void 0}),bt(null);},onCancel:()=>bt(null),availableUsers:t.availableUsers,isDark:K,locale:q==="es"?"es":"en",defaultDate:G.date,dropdownDirection:Le?"up":"down"})})]})})]})})()}),ee%7===6&&(()=>{let Le=Math.floor(ee/7),Ee=ie[Le];if(!Ee||Ee===0)return null;let qe=i0(Ee,R,$);return jsxRuntime.jsxs("div",{className:u("absolute bottom-1 right-2 text-[9px] font-mono font-bold tabular-nums z-20",Ee<0?"text-red-400":"text-emerald-400",S&&"blur-sm select-none"),children:[I.labels.cashOut,": ",Ee<0?"-":"+",qe]})})()]},ee)})})})]}),Re&&jsxRuntime.jsxs("aside",{className:u("w-[280px] flex-shrink-0 flex flex-col overflow-hidden",K?"bg-[#050505] border-l border-[#222]":"bg-white border-l border-gray-200"),children:[jsxRuntime.jsxs("div",{className:u("flex-shrink-0 h-14 flex items-center justify-between px-4",K?"bg-[#080808] border-b border-[#222]":"bg-gray-50 border-b border-gray-200"),children:[jsxRuntime.jsx("span",{className:u("text-[10px] font-mono font-bold uppercase tracking-[0.2em]",K?"text-white/40":"text-gray-500"),children:I.labels.backlogTitle}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsx("span",{className:u("text-[10px] font-mono tabular-nums",K?"text-white/20":"text-gray-400"),children:je.length})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:je.length===0?jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[jsxRuntime.jsx("div",{className:u("w-10 h-10 rounded-xl flex items-center justify-center mb-3",K?"bg-white/5":"bg-gray-100"),children:jsxRuntime.jsx(lucideReact.Calendar,{className:u("w-5 h-5",K?"text-white/20":"text-gray-400")})}),jsxRuntime.jsx("p",{className:u("text-xs font-mono",K?"text-white/20":"text-gray-400"),children:q==="es"?"Sin tareas pendientes":"No unscheduled tasks"})]}):je.map(G=>jsxRuntime.jsxs("button",{onClick:()=>{ce(G);},className:u("w-full text-left rounded-md p-3 transition-all group/card",K?"bg-[#0A0A0A] border border-white/[0.05] hover:border-white/[0.12] hover:bg-[#0E0E0E]":"bg-white border border-gray-100 hover:border-gray-200 hover:shadow-sm"),children:[jsxRuntime.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[jsxRuntime.jsx("div",{className:u("w-1 h-1 rounded-full mt-1.5 flex-shrink-0",K?"bg-white/20":"bg-gray-300")}),jsxRuntime.jsx("span",{className:u("text-sm font-medium leading-snug line-clamp-2",K?"text-white/80 group-hover/card:text-white":"text-gray-800"),children:G.name})]}),G.tags&&G.tags.length>0&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-1 ml-3",children:[G.tags.slice(0,3).map(ee=>jsxRuntime.jsx("span",{className:"text-[9px] font-mono uppercase tracking-wider px-1.5 py-0.5 rounded",style:{backgroundColor:`${ee.color}15`,color:ee.color,border:`1px solid ${ee.color}30`},children:ee.name},ee.id)),G.tags.length>3&&jsxRuntime.jsxs("span",{className:u("text-[9px] font-mono px-1 py-0.5",K?"text-white/20":"text-gray-400"),children:["+",G.tags.length-3]})]}),(G.effortMinutes||G.soldEffortMinutes)&&jsxRuntime.jsxs("div",{className:u("flex items-center gap-2 mt-1.5 ml-3 text-[9px] font-mono",K?"text-white/25":"text-gray-400",S&&"blur-sm select-none"),children:[uc(G.effortMinutes,R,$)&&jsxRuntime.jsxs("span",{children:[I.labels.estimate,": ",uc(G.effortMinutes,R,$)]}),(()=>{let ee=d0(G,R,$);return ee?jsxRuntime.jsx("span",{className:ee.isNegative?"text-red-400":"text-emerald-400",children:ee.text}):null})()]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mt-2 ml-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[G.priority&&jsxRuntime.jsx(lucideReact.Flag,{className:u("w-3 h-3",G.priority==="urgent"||G.priority==="high"?"text-red-400":G.priority==="medium"?"text-yellow-400":"text-green-400")}),jsxRuntime.jsx(n0,{task:G,isDark:K})]}),G.assignees&&G.assignees.length>0&&jsxRuntime.jsx("div",{className:"flex -space-x-1",children:G.assignees.slice(0,2).map((ee,Ue)=>jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[8px] font-mono font-bold text-white ring-1 ring-[#050505]",style:{backgroundColor:ee.color||"#007FFF"},title:ee.name,children:ee.initials||ee.name?.slice(0,2).toUpperCase()},Ue))})]})]},G.id))}),a.onTaskCreate&&jsxRuntime.jsx("div",{className:u("flex-shrink-0 px-3 py-2.5 border-t",K?"border-[#222] bg-[#080808]":"border-gray-200 bg-gray-50"),children:jsxRuntime.jsx("input",{type:"text",placeholder:I.labels.typeToAdd,className:u("w-full text-[11px] font-mono bg-transparent outline-none",K?"text-white/70 placeholder:text-white/15":"text-gray-700 placeholder:text-gray-400"),onKeyDown:G=>{G.key==="Enter"&&G.target.value.trim()&&(a.onTaskCreate?.({name:G.target.value.trim()}),G.target.value="");}})}),H.hasCostData&&jsxRuntime.jsxs("div",{className:u("flex-shrink-0 px-4 py-3 border-t space-y-2.5",K?"border-[#222] bg-[#080808]":"border-gray-200 bg-gray-50"),children:[jsxRuntime.jsxs("div",{className:u("text-[10px] font-mono font-bold uppercase tracking-[0.2em]",K?"text-white/40":"text-gray-500"),children:["\u25C8 ",I.labels.systemStatus]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("span",{className:u("text-[10px] font-mono",K?"text-white/40":"text-gray-500"),children:I.labels.budgetUtil}),jsxRuntime.jsxs("span",{className:u("text-[10px] font-mono font-bold tabular-nums",K?"text-white/60":"text-gray-700",S&&"blur-sm select-none"),children:[H.budgetUtil,"%"]})]}),jsxRuntime.jsx("div",{className:u("h-1.5 rounded-full overflow-hidden",K?"bg-white/5":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${H.budgetUtil}%`,background:H.budgetUtil>90?"#EF4444":H.budgetUtil>70?"#F59E0B":"linear-gradient(to right, #2E94FF, #8B5CF6)"}})})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[jsxRuntime.jsxs("div",{className:u("rounded-md px-2 py-1.5 text-center",K?"bg-white/[0.03] border border-white/[0.06]":"bg-gray-100 border border-gray-200"),children:[jsxRuntime.jsx("div",{className:u("text-[8px] font-mono uppercase tracking-wider mb-0.5",K?"text-white/25":"text-gray-400"),children:I.labels.variance}),jsxRuntime.jsxs("div",{className:u("text-[11px] font-mono font-bold tabular-nums",H.avgVariance>0?"text-emerald-400":H.avgVariance<0?"text-red-400":K?"text-white/50":"text-gray-600"),children:[H.avgVariance>0?"+":"",H.avgVariance," ",I.labels.days]})]}),jsxRuntime.jsxs("div",{className:u("rounded-md px-2 py-1.5 text-center",K?"bg-white/[0.03] border border-white/[0.06]":"bg-gray-100 border border-gray-200"),children:[jsxRuntime.jsx("div",{className:u("text-[8px] font-mono uppercase tracking-wider mb-0.5",K?"text-white/25":"text-gray-400"),children:I.labels.cost}),jsxRuntime.jsx("div",{className:u("text-[11px] font-mono font-bold tabular-nums",H.costDisplay.startsWith("-")?"text-red-400":"text-emerald-400",S&&"blur-sm select-none"),children:H.costDisplay})]})]})]})]})]}),!J&&jsxRuntime.jsx(go,{task:z,isOpen:!!z,onClose:()=>ae(null),onTaskUpdate:G=>{a.onTaskUpdate?.(G),ae(G);},theme:M==="dark"?"dark":"light",locale:q,availableUsers:t.availableUsers?.map(G=>({id:G.id,name:G.name,avatar:G.avatar,initials:G.name?.slice(0,2).toUpperCase()||"U",color:"#8B5CF6"}))||[],availableTags:c,onCreateTag:l,attachments:z?m?.get(z.id)||[]:[],onUploadAttachments:a.onUploadAttachments,onDeleteAttachment:a.onDeleteAttachment,availableTasks:Ns(e).filter(G=>G.id!==z?.id),comments:d?.filter(G=>G.taskId===z?.id).map(G=>({...G,createdAt:G.createdAt instanceof Date?G.createdAt:new Date(G.createdAt),updatedAt:G.updatedAt instanceof Date?G.updatedAt:G.updatedAt?new Date(G.updatedAt):void 0})),onAddComment:p,currentUser:g,mentionableUsers:y,onUploadCommentAttachments:x,enableTimeTracking:f,timeTrackingSummary:b,timeEntries:v,isTimerRunning:C?.isRunning,timerElapsedSeconds:C?.elapsedSeconds,onTimeLog:w,onEstimateUpdate:N,onSoldEffortUpdate:T,onTimerStart:k,onTimerStop:P,onTimerDiscard:O,blurFinancials:S}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:we&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>Ie(null),className:"fixed inset-0 bg-black/50 z-40"}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},className:u("fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[320px] max-h-[400px] rounded-xl shadow-2xl z-50 overflow-hidden",K?"bg-[#0A0A0A]/95 backdrop-blur-xl border border-white/[0.08]":"bg-white border border-gray-200"),children:[jsxRuntime.jsxs("div",{className:u("px-4 py-3 border-b flex items-center justify-between",K?"border-white/[0.08] bg-[#080808]":"border-gray-200"),children:[jsxRuntime.jsx("span",{className:u("font-medium text-sm",K?"text-white/90":"text-gray-900"),children:we.date.toLocaleDateString(q==="es"?"es-ES":"en-US",{weekday:"long",month:"long",day:"numeric"})}),jsxRuntime.jsx("button",{onClick:()=>Ie(null),className:u("p-1 rounded",K?"hover:bg-white/10 text-white/40":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),jsxRuntime.jsx("div",{className:"p-3 max-h-[320px] overflow-y-auto space-y-1.5",children:we.events.map(G=>jsxRuntime.jsxs("button",{onClick:()=>{Ie(null),ce(G.task);},className:u("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors",K?"hover:bg-white/5 border border-white/5":"hover:bg-gray-50 border border-gray-100"),children:[jsxRuntime.jsx(n0,{task:G.task,isDark:K}),jsxRuntime.jsx("span",{className:u("text-sm truncate flex-1",K?"text-white/80":"text-gray-900"),children:G.title}),(G.task.priority==="high"||G.task.priority==="urgent")&&jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5 text-red-400"})]},G.id))})]})]})})]})}var pc={bgPrimary:"#050505",bgSecondary:"#080808",bgHover:"rgba(255, 255, 255, 0.02)",bgToday:"rgba(0, 127, 255, 0.08)",bgWeekend:"#050505",bgOtherMonth:"#080808",border:"#222222",borderLight:"#1a1a1a",textPrimary:"rgba(255, 255, 255, 0.90)",textSecondary:"rgba(255, 255, 255, 0.60)",textMuted:"rgba(255, 255, 255, 0.30)",textToday:"#007FFF",accent:"#007FFF",accentHover:"#3399FF",accentLight:"rgba(0, 127, 255, 0.15)",statusTodo:"rgba(255, 255, 255, 0.40)",statusInProgress:"#007FFF",statusCompleted:"#34D399",focusRing:"#007FFF",glass:"rgba(20, 20, 20, 0.6)",glassBorder:"rgba(255, 255, 255, 0.08)",glassHover:"rgba(255, 255, 255, 0.05)",neonRed:"#FF2E2E",glowBlue:"0 0 10px rgba(0, 127, 255, 0.3)",glowRed:"0 0 10px rgba(255, 46, 46, 0.4)"},mc={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgToday:"#dbeafe",bgWeekend:"#f9fafb",bgOtherMonth:"#f3f4f680",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",textToday:"#0969da",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da",glass:"rgba(255, 255, 255, 0.8)",glassBorder:"rgba(0, 0, 0, 0.08)",glassHover:"rgba(0, 0, 0, 0.04)",neonRed:"#DC2626",glowBlue:"0 0 10px rgba(0, 127, 255, 0.15)",glowRed:"0 0 10px rgba(220, 38, 38, 0.2)"},gc={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgToday:"#6366f120",bgWeekend:"#16213e80",bgOtherMonth:"#1a1a2e50",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",textToday:"#818cf8",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1",glass:"rgba(26, 26, 46, 0.6)",glassBorder:"rgba(255, 255, 255, 0.06)",glassHover:"rgba(255, 255, 255, 0.04)",neonRed:"#EF4444",glowBlue:"0 0 10px rgba(99, 102, 241, 0.3)",glowRed:"0 0 10px rgba(239, 68, 68, 0.3)"},Qi={dark:pc,light:mc,neutral:gc};function u0(e){return Qi[e]||Qi.dark}function xw({stack:e,cards:t,renderCard:a,onCardClick:r,onToggleExpand:o,onUnstack:s,onDeleteStack:n,className:i}){let[c,l]=react.useState(false),m=react.useMemo(()=>t.filter(g=>e.cardIds.includes(g.id)),[t,e.cardIds]),d=react.useMemo(()=>{let g=m.length,y=new Set(m.flatMap(f=>f.assignedUserIds||[])).size,x=m.map(f=>f.priority).filter(Boolean),h=new Set(m.flatMap(f=>f.labels||[])).size;return {totalCards:g,uniqueAssignees:y,priorities:x,labels:h}},[m]),p=()=>{o?.(e.id);};return jsxRuntime.jsxs("div",{className:u("card-stack",!e.isExpanded&&"card-stack-collapsed",i),onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),style:{"--stack-color":e.color||"var(--color-accent-primary)"},children:[jsxRuntime.jsxs("div",{className:"card-stack-header",onClick:p,children:[jsxRuntime.jsxs("div",{className:"card-stack-header-left",children:[jsxRuntime.jsx("button",{className:"card-stack-toggle","aria-label":e.isExpanded?"Collapse":"Expand",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:u("card-stack-chevron",e.isExpanded&&"expanded"),children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})})}),jsxRuntime.jsx("h3",{className:"card-stack-title",children:e.title}),jsxRuntime.jsx("div",{className:"card-stack-badge",children:d.totalCards}),jsxRuntime.jsxs("div",{className:"card-stack-strategy",children:[e.strategy==="ai-similarity"&&"\u2728 AI",e.strategy==="manual"&&"\u{1F464} Manual",e.strategy==="labels"&&"\u{1F3F7}\uFE0F Labels",e.strategy==="assignee"&&"\u{1F465} Assignee",e.strategy==="priority"&&"\u{1F3AF} Priority",e.strategy==="epic"&&"\u{1F4DA} Epic"]})]}),c&&jsxRuntime.jsx("div",{className:"card-stack-actions",children:jsxRuntime.jsx("button",{className:"card-stack-action",onClick:g=>{g.stopPropagation(),n?.(e.id);},"aria-label":"Delete stack",children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})})]}),!e.isExpanded&&jsxRuntime.jsxs("div",{className:"card-stack-summary",children:[jsxRuntime.jsxs("div",{className:"card-stack-summary-item",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),jsxRuntime.jsxs("span",{children:[d.uniqueAssignees," assignees"]})]}),d.labels>0&&jsxRuntime.jsxs("div",{className:"card-stack-summary-item",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),jsxRuntime.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsxRuntime.jsxs("span",{children:[d.labels," labels"]})]}),e.confidence&&jsxRuntime.jsx("div",{className:"card-stack-summary-item",children:jsxRuntime.jsxs("span",{className:"card-stack-confidence",children:[Math.round(e.confidence*100),"% match"]})})]}),e.isExpanded&&jsxRuntime.jsx("div",{className:"card-stack-content",children:m.length===0?jsxRuntime.jsxs("div",{className:"card-stack-empty",children:[jsxRuntime.jsx("p",{children:"No cards in this stack"}),jsxRuntime.jsx("span",{children:"Drag cards here or delete this stack"})]}):jsxRuntime.jsx("div",{className:"card-stack-cards",children:m.map(g=>jsxRuntime.jsxs("div",{className:"card-stack-card-wrapper",children:[a?jsxRuntime.jsx("div",{onClick:()=>r?.(g),children:a(g)}):jsxRuntime.jsxs("div",{className:"card-stack-default-card",onClick:()=>r?.(g),children:[jsxRuntime.jsx("h4",{children:g.title}),g.description&&jsxRuntime.jsxs("p",{children:[g.description.substring(0,100),"..."]})]}),jsxRuntime.jsx("button",{className:"card-stack-unstack-btn",onClick:y=>{y.stopPropagation(),s?.(e.id,g.id);},"aria-label":"Remove from stack",children:jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},g.id))})})]})}var m0={showIcons:true,showAvatars:true,groupByDay:true,useRelativeTime:true,compact:false};function Ss(e){switch(e.type){case "created":return "Created card";case "status_changed":return `Changed status from "${e.changes.status?.from}" to "${e.changes.status?.to}"`;case "assignee_changed":return "Changed assignee";case "priority_changed":return `Changed priority from ${e.changes.priority?.from} to ${e.changes.priority?.to}`;case "moved":return `Moved from ${e.metadata?.fromColumn||"unknown"} to ${e.metadata?.toColumn||"unknown"}`;case "title_updated":return "Updated title";case "description_updated":return "Updated description";case "dates_changed":return "Changed dates";case "labels_changed":return "Updated labels";case "dependency_added":return "Added dependency";case "dependency_removed":return "Removed dependency";case "comment_added":return "Added comment";case "archived":return "Archived card";case "restored":return "Restored card";default:return "Updated card"}}function Es(e){return {created:"\u2728",status_changed:"\u{1F504}",assignee_changed:"\u{1F464}",priority_changed:"\u{1F3AF}",moved:"\u27A1\uFE0F",title_updated:"\u270F\uFE0F",description_updated:"\u{1F4DD}",dates_changed:"\u{1F4C5}",labels_changed:"\u{1F3F7}\uFE0F",dependency_added:"\u{1F517}",dependency_removed:"\u26D3\uFE0F\u200D\u{1F4A5}",comment_added:"\u{1F4AC}",archived:"\u{1F4E6}",restored:"\u267B\uFE0F"}[e]||"\u{1F4CC}"}function g0(e){return {created:"#10b981",status_changed:"#3b82f6",assignee_changed:"#8b5cf6",priority_changed:"#f59e0b",moved:"#06b6d4",title_updated:"#6366f1",description_updated:"#6366f1",dates_changed:"#ec4899",labels_changed:"#14b8a6",dependency_added:"#a855f7",dependency_removed:"#ef4444",comment_added:"#84cc16",archived:"#6b7280",restored:"#10b981"}[e]||"#6b7280"}function f0({events:e,filter:t,onFilterChange:a,onClearFilter:r,onEventClick:o,selectedEventId:s,config:n,className:i}){let c=react.useMemo(()=>({...m0,...n}),[n]),[l,m]=react.useState(new Set),d=react.useRef(null),p=react.useMemo(()=>{if(!c.groupByDay)return [{date:null,events:e}];let b=new Map;return e.forEach(v=>{let C=v.timestamp.toISOString().split("T")[0],w=b.get(C);w?w.push(v):b.set(C,[v]);}),Array.from(b.entries()).sort((v,C)=>C[0].localeCompare(v[0])).map(([v,C])=>({date:new Date(v),events:C.sort((w,N)=>N.timestamp.getTime()-w.timestamp.getTime())}))},[e,c.groupByDay]),{uniqueUsers:g,uniqueTypes:y}=react.useMemo(()=>{let b=new Set,v=new Set;return e.forEach(C=>{b.add(C.userId),v.add(C.type);}),{uniqueUsers:Array.from(b),uniqueTypes:Array.from(v)}},[e]),x=b=>{m(v=>{let C=new Set(v);return C.has(b)?C.delete(b):C.add(b),C});},h=b=>{let C=new Date().getTime()-b.getTime(),w=Math.floor(C/6e4),N=Math.floor(C/36e5),T=Math.floor(C/864e5);return w<1?"just now":w<60?`${w}m ago`:N<24?`${N}h ago`:T<7?`${T}d ago`:b.toLocaleDateString()},f=react.useMemo(()=>{let b=0;return t.types&&t.types.length>0&&b++,t.users&&t.users.length>0&&b++,t.dateRange&&b++,t.searchTerm&&b++,b},[t]);return react.useEffect(()=>{if(s&&d.current){let b=d.current.querySelector(`[data-event-id="${s}"]`);b&&b.scrollIntoView({behavior:"smooth",block:"center"});}},[s]),e.length===0?jsxRuntime.jsxs("div",{className:u("history-timeline-empty",i),children:[jsxRuntime.jsx("div",{className:"history-timeline-empty-icon",children:"\u{1F4DC}"}),jsxRuntime.jsx("p",{className:"history-timeline-empty-text",children:"No history events yet"}),jsxRuntime.jsx("p",{className:"history-timeline-empty-subtext",children:"Changes to this card will appear here"})]}):jsxRuntime.jsxs("div",{className:u("history-timeline",c.compact&&"compact",i),children:[jsxRuntime.jsxs("div",{className:"history-timeline-filters",children:[jsxRuntime.jsxs("div",{className:"history-timeline-filter-group",children:[jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.types?.[0]||"",onChange:b=>{let v=b.target.value;a({...t,types:v?[v]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Events"}),y.map(b=>jsxRuntime.jsxs("option",{value:b,children:[Es(b)," ",b.replace("_"," ")]},b))]}),g.length>1&&jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.users?.[0]||"",onChange:b=>{let v=b.target.value;a({...t,users:v?[v]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Users"}),g.map(b=>jsxRuntime.jsx("option",{value:b,children:b},b))]}),jsxRuntime.jsx("input",{type:"text",className:"history-timeline-filter-search",placeholder:"Search history...",value:t.searchTerm||"",onChange:b=>a({...t,searchTerm:b.target.value})})]}),f>0&&jsxRuntime.jsxs("button",{className:"history-timeline-filter-clear",onClick:r,children:["Clear filters (",f,")"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-container",ref:d,children:p.map(b=>jsxRuntime.jsxs("div",{className:"history-timeline-group",children:[c.groupByDay&&b.date&&jsxRuntime.jsxs("div",{className:"history-timeline-day-header",children:[jsxRuntime.jsx("span",{className:"history-timeline-day-date",children:b.date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),jsxRuntime.jsxs("span",{className:"history-timeline-day-count",children:[b.events.length," events"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-events",children:b.events.map((v,C)=>{let w=l.has(v.id),N=s===v.id,T=g0(v.type);return jsxRuntime.jsxs("div",{"data-event-id":v.id,className:u("history-timeline-event",w&&"expanded",N&&"selected"),onClick:()=>o?.(v),children:[jsxRuntime.jsxs("div",{className:"history-timeline-line",children:[jsxRuntime.jsx("div",{className:"history-timeline-dot",style:{backgroundColor:T},children:c.showIcons&&jsxRuntime.jsx("span",{className:"history-timeline-dot-icon",children:Es(v.type)})}),C<b.events.length-1&&jsxRuntime.jsx("div",{className:"history-timeline-connector",style:{borderColor:T}})]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-content",children:[jsxRuntime.jsxs("div",{className:"history-timeline-event-header",children:[jsxRuntime.jsxs("div",{className:"history-timeline-event-header-left",children:[c.showAvatars&&v.userAvatar&&jsxRuntime.jsx("img",{src:v.userAvatar,alt:v.userName||v.userId,className:"history-timeline-event-avatar"}),jsxRuntime.jsxs("div",{className:"history-timeline-event-description",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-user",children:v.userName||v.userId}),jsxRuntime.jsx("span",{className:"history-timeline-event-action",children:Ss(v)})]})]}),jsxRuntime.jsx("div",{className:"history-timeline-event-time",children:c.useRelativeTime?h(v.timestamp):v.timestamp.toLocaleString()})]}),Object.keys(v.changes).length>0&&jsxRuntime.jsxs("button",{className:"history-timeline-event-toggle",onClick:k=>{k.stopPropagation(),x(v.id);},children:[w?"\u25BC":"\u25B6"," Show changes"]}),w&&jsxRuntime.jsxs("div",{className:"history-timeline-event-changes",children:[Object.entries(v.changes).map(([k,P])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-change",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-change-key",children:[k,":"]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-change-values",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-change-from",children:JSON.stringify(P.from)}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-arrow",children:"\u2192"}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-to",children:JSON.stringify(P.to)})]})]},k)),v.metadata&&Object.keys(v.metadata).length>0&&jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata",children:[jsxRuntime.jsx("div",{className:"history-timeline-event-metadata-title",children:"Additional Info:"}),Object.entries(v.metadata).map(([k,P])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata-item",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-metadata-key",children:[k,":"]}),jsxRuntime.jsx("span",{className:"history-timeline-event-metadata-value",children:JSON.stringify(P)})]},k))]})]})]})]},v.id)})})]},b.date?.toISOString()||"all"))})]})}function h0({replayState:e,events:t,onStartReplay:a,onStopReplay:r,onTogglePlayback:o,onPrevious:s,onNext:n,onGoToEvent:i,onSpeedChange:c,className:l}){let m=[.5,1,1.5,2,3],d=react.useMemo(()=>!e||t.length===0?null:t[e.currentIndex],[e,t]),p=react.useMemo(()=>!e||e.totalEvents===0?0:e.currentIndex/(e.totalEvents-1)*100,[e]);return t.length===0?jsxRuntime.jsxs("div",{className:u("history-replay-empty",l),children:[jsxRuntime.jsx("div",{className:"history-replay-empty-icon",children:"\u23F3"}),jsxRuntime.jsx("p",{className:"history-replay-empty-text",children:"No history to replay"})]}):e?jsxRuntime.jsxs("div",{className:u("history-replay",l),children:[jsxRuntime.jsxs("div",{className:"history-replay-current-event",children:[jsxRuntime.jsx("div",{className:"history-replay-event-icon",children:d&&Es(d.type)}),jsxRuntime.jsxs("div",{className:"history-replay-event-info",children:[jsxRuntime.jsx("div",{className:"history-replay-event-description",children:d&&Ss(d)}),jsxRuntime.jsxs("div",{className:"history-replay-event-meta",children:[jsxRuntime.jsxs("span",{className:"history-replay-event-index",children:["Event ",e.currentIndex+1," of ",e.totalEvents]}),jsxRuntime.jsx("span",{className:"history-replay-event-time",children:d&&d.timestamp.toLocaleString()})]})]})]}),jsxRuntime.jsxs("div",{className:"history-replay-progress-container",children:[jsxRuntime.jsx("input",{type:"range",className:"history-replay-progress-slider",min:"0",max:e.totalEvents-1,value:e.currentIndex,onChange:g=>i(parseInt(g.target.value))}),jsxRuntime.jsx("div",{className:"history-replay-progress-fill",style:{width:`${p}%`}}),jsxRuntime.jsx("div",{className:"history-replay-progress-markers",children:t.map((g,y)=>jsxRuntime.jsx("div",{className:u("history-replay-progress-marker",y===e.currentIndex&&"active"),style:{left:`${y/(e.totalEvents-1)*100}%`},onClick:()=>i(y),title:Ss(g)},g.id))})]}),jsxRuntime.jsxs("div",{className:"history-replay-controls",children:[jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:s,disabled:!e.canGoBack,title:"Previous event (\u2190)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"19 20 9 12 19 4 19 20"}),jsxRuntime.jsx("line",{x1:"5",y1:"19",x2:"5",y2:"5"})]})}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-control-play",onClick:o,title:e.isPlaying?"Pause (Space)":"Play (Space)",children:e.isPlaying?jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[jsxRuntime.jsx("rect",{x:"6",y:"4",width:"4",height:"16"}),jsxRuntime.jsx("rect",{x:"14",y:"4",width:"4",height:"16"})]}):jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})})}),jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:n,disabled:!e.canGoForward,title:"Next event (\u2192)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"5 4 15 12 5 20 5 4"}),jsxRuntime.jsx("line",{x1:"19",y1:"5",x2:"19",y2:"19"})]})}),jsxRuntime.jsxs("div",{className:"history-replay-speed",children:[jsxRuntime.jsx("label",{className:"history-replay-speed-label",children:"Speed:"}),jsxRuntime.jsx("div",{className:"history-replay-speed-buttons",children:m.map(g=>jsxRuntime.jsxs("button",{className:u("history-replay-speed-btn",e.speed===g&&"active"),onClick:()=>c(g),children:[g,"x"]},g))})]}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-stop",onClick:r,title:"Stop replay (Esc)",children:jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("rect",{x:"6",y:"6",width:"12",height:"12"})})})]}),jsxRuntime.jsxs("div",{className:"history-replay-shortcuts",children:[jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"Space"})," Play/Pause"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"\u2190"})," Previous"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"\u2192"})," Next"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"Esc"})," Stop"]})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview",children:[jsxRuntime.jsxs("div",{className:"history-replay-card-preview-header",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-title",children:"Card State at This Point"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-time",children:d&&d.timestamp.toLocaleDateString()})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview-content",children:[jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Title:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.title})]}),e.cardState.description&&jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Description:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.description})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Priority:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.priority||"None"})]}),e.cardState.labels&&e.cardState.labels.length>0&&jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Labels:"}),jsxRuntime.jsx("div",{className:"history-replay-card-preview-labels",children:e.cardState.labels.map(g=>jsxRuntime.jsx("span",{className:"history-replay-card-preview-label-tag",children:g},g))})]})]})]})]}):jsxRuntime.jsxs("div",{className:u("history-replay-start",l),children:[jsxRuntime.jsxs("button",{className:"history-replay-start-button",onClick:a,children:[jsxRuntime.jsx("svg",{className:"history-replay-start-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),jsxRuntime.jsx("span",{children:"Start Time Travel"})]}),jsxRuntime.jsxs("p",{className:"history-replay-start-hint",children:["Replay ",t.length," events from this card's history"]})]})}function fc(e){return {blocks:"#ef4444",blocked_by:"#dc2626",depends_on:"#f59e0b",required_by:"#d97706",relates_to:"#6b7280",duplicates:"#8b5cf6",parent_of:"#3b82f6",child_of:"#2563eb",similar_to:"#10b981"}[e]||"#6b7280"}function bc(e){return {blocks:"Blocks",blocked_by:"Blocked by",depends_on:"Depends on",required_by:"Required by",relates_to:"Relates to",duplicates:"Duplicates",parent_of:"Parent of",child_of:"Child of",similar_to:"Similar to"}[e]||e}function y0(e){return {blocks:"\u{1F6AB}",blocked_by:"\u26D4",depends_on:"\u{1F517}",required_by:"\u{1F4CC}",relates_to:"\u{1F504}",duplicates:"\u{1F4CB}",parent_of:"\u{1F4C2}",child_of:"\u{1F4C4}",similar_to:"\u{1F50D}"}[e]||"\u{1F517}"}function x0(e){return ["blocks","blocked_by","depends_on","required_by","parent_of","child_of"].includes(e)}function Nw(e,t,a,r,o,s=100){let n=e.map(c=>({...c,x:c.x??a/2+Math.random()*100-50,y:c.y??r/2+Math.random()*100-50,vx:0,vy:0})),i=new Map(n.map(c=>[c.id,c]));for(let c=0;c<s;c++){let l=1-c/s;n.forEach(m=>{let d=a/2,p=r/2;m.vx+=(d-m.x)*o.centerForce*l,m.vy+=(p-m.y)*o.centerForce*l,n.forEach(g=>{if(m.id===g.id)return;let y=m.x-g.x,x=m.y-g.y,h=Math.sqrt(y*y+x*x)||1,f=o.chargeStrength*l/(h*h);m.vx+=y/h*f,m.vy+=x/h*f;});}),t.forEach(m=>{let d=i.get(typeof m.source=="string"?m.source:m.source.id),p=i.get(typeof m.target=="string"?m.target:m.target.id);if(!d||!p)return;let g=p.x-d.x,y=p.y-d.y,x=Math.sqrt(g*g+y*y)||1,h=(x-o.linkDistance)/x*o.forceStrength*l;d.vx+=g*h,d.vy+=y*h,p.vx-=g*h,p.vy-=y*h;}),n.forEach(m=>{m.fx!==null&&m.fx!==void 0?(m.x=m.fx,m.vx=0):m.x+=m.vx,m.fy!==null&&m.fy!==void 0?(m.y=m.fy,m.vy=0):m.y+=m.vy,m.x=Math.max(o.nodeSize,Math.min(a-o.nodeSize,m.x)),m.y=Math.max(o.nodeSize,Math.min(r-o.nodeSize,m.y)),m.vx*=.9,m.vy*=.9;});}return n}function v0({nodes:e,edges:t,config:a,filter:r,onFilterChange:o,criticalPath:s,stats:n,onInteraction:i,className:c}){let l=react.useRef(null),[m,d]=react.useState([]),[p,g]=react.useState(null),[y,x]=react.useState(null),[h,f]=react.useState(null),[b,v]=react.useState(1),[C,w]=react.useState({x:0,y:0});react.useEffect(()=>{if(e.length===0)return;let R=Nw(e,t,a.width,a.height,a,150);d(R);},[e,t,a]);let N=react.useCallback((R,$)=>{a.enableDragging&&($.stopPropagation(),g(R));},[a.enableDragging]),T=react.useCallback(R=>{if(!p||!l.current)return;let M=l.current.getBoundingClientRect(),q=(R.clientX-M.left-C.x)/b,Z=(R.clientY-M.top-C.y)/b;d(Re=>Re.map(I=>I.id===p?{...I,x:q,y:Z,fx:q,fy:Z}:I));},[p,b,C]),k=react.useCallback(()=>{g(null);},[]),P=react.useCallback((R,$)=>{$.stopPropagation(),i?.({type:"node-click",node:R,position:{x:$.clientX,y:$.clientY}});},[i]),O=react.useCallback((R,$)=>{$.stopPropagation(),i?.({type:"edge-click",edge:R,position:{x:$.clientX,y:$.clientY}});},[i]),S=react.useCallback(R=>{let $=m.find(M=>M.id===R);return $?{x:$.x,y:$.y}:{x:0,y:0}},[m]),J=react.useCallback(R=>{if(R.onCriticalPath)return "#ef4444";switch(a.colorScheme){case "status":return R.card.columnId==="done"?"#10b981":"#3b82f6";case "priority":let $=R.card.priority;return $==="URGENT"?"#ef4444":$==="HIGH"?"#f59e0b":$==="MEDIUM"?"#3b82f6":"#6b7280";case "assignee":return R.card.assigneeId?"#8b5cf6":"#6b7280";default:return "#3b82f6"}},[a.colorScheme]);return e.length===0?jsxRuntime.jsxs("div",{className:u("relationships-graph-empty",c),children:[jsxRuntime.jsx("div",{className:"relationships-graph-empty-icon",children:"\u{1F517}"}),jsxRuntime.jsx("p",{className:"relationships-graph-empty-text",children:"No relationships to display"}),jsxRuntime.jsx("p",{className:"relationships-graph-empty-subtext",children:"Add relationships between cards to see the graph"})]}):jsxRuntime.jsxs("div",{className:u("relationships-graph",c),children:[jsxRuntime.jsxs("div",{className:"relationships-graph-controls",children:[jsxRuntime.jsxs("div",{className:"relationships-graph-stats",children:[jsxRuntime.jsxs("span",{className:"relationships-graph-stat",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:n.totalNodes}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Cards"})]}),jsxRuntime.jsxs("span",{className:"relationships-graph-stat",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:n.totalEdges}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Relations"})]}),s&&jsxRuntime.jsxs("span",{className:"relationships-graph-stat relationships-graph-stat-critical",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:s.cardIds.length}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Critical Path"})]})]}),a.enableZoom&&jsxRuntime.jsxs("div",{className:"relationships-graph-zoom-controls",children:[jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>v(R=>Math.min(R+.2,3)),children:"+"}),jsxRuntime.jsxs("span",{className:"relationships-graph-zoom-value",children:[Math.round(b*100),"%"]}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>v(R=>Math.max(R-.2,.5)),children:"\u2212"}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>{v(1),w({x:0,y:0});},children:"Reset"})]})]}),jsxRuntime.jsx("div",{className:"relationships-graph-legend",children:Array.from(new Set(t.map(R=>R.type))).map(R=>jsxRuntime.jsxs("div",{className:"relationships-graph-legend-item",children:[jsxRuntime.jsx("div",{className:"relationships-graph-legend-color",style:{background:fc(R)}}),jsxRuntime.jsxs("span",{className:"relationships-graph-legend-label",children:[y0(R)," ",bc(R)]})]},R))}),jsxRuntime.jsxs("svg",{ref:l,className:"relationships-graph-canvas",width:a.width,height:a.height,onMouseMove:T,onMouseUp:k,onMouseLeave:k,children:[jsxRuntime.jsxs("g",{transform:`translate(${C.x}, ${C.y}) scale(${b})`,children:[jsxRuntime.jsx("g",{className:"relationships-graph-edges",children:t.map(R=>{let $=S(typeof R.source=="string"?R.source:R.source.id),M=S(typeof R.target=="string"?R.target:R.target.id),q=x0(R.type),Z=h===R.id,Re=R.onCriticalPath;return jsxRuntime.jsxs("g",{className:u("relationships-graph-edge",Z&&"hovered",Re&&"critical"),onMouseEnter:()=>f(R.id),onMouseLeave:()=>f(null),onClick:I=>O(R,I),children:[jsxRuntime.jsx("line",{x1:$.x,y1:$.y,x2:M.x,y2:M.y,stroke:fc(R.type),strokeWidth:Re?a.edgeWidth*2:a.edgeWidth,strokeOpacity:Z?1:.6,markerEnd:q?"url(#arrowhead)":void 0}),a.showEdgeLabels&&Z&&jsxRuntime.jsx("text",{x:($.x+M.x)/2,y:($.y+M.y)/2,className:"relationships-graph-edge-label",textAnchor:"middle",children:bc(R.type)})]},R.id)})}),jsxRuntime.jsx("g",{className:"relationships-graph-nodes",children:m.map(R=>{let $=y===R.id,M=R.onCriticalPath;return jsxRuntime.jsxs("g",{className:u("relationships-graph-node",$&&"hovered",M&&"critical"),transform:`translate(${R.x}, ${R.y})`,onMouseDown:q=>N(R.id,q),onMouseEnter:()=>x(R.id),onMouseLeave:()=>x(null),onClick:q=>P(R,q),children:[jsxRuntime.jsx("circle",{r:M?a.nodeSize*1.2:a.nodeSize,fill:J(R),stroke:M?"#fbbf24":"#ffffff",strokeWidth:M?3:2,opacity:$?1:.9}),a.showLabels&&jsxRuntime.jsx("text",{y:a.nodeSize+20,className:"relationships-graph-node-label",textAnchor:"middle",children:R.card.title.length>20?R.card.title.substring(0,20)+"...":R.card.title})]},R.id)})})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"10",refX:"9",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:jsxRuntime.jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:"#6b7280"})})})]})]})}function C0({isOpen:e,onClose:t,onPlanGenerated:a,onGeneratePlan:r,isLoading:o}){let[s,n]=react.useState(""),[i,c]=react.useState(false),[l,m]=react.useState(null),[d,p]=react.useState(null),g=react.useRef(null),y=i||o;react.useEffect(()=>{e&&g.current&&g.current.focus();},[e]),react.useEffect(()=>{let b=v=>{v.key==="Escape"&&!y&&x();};if(e)return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,y]);let x=()=>{y||(n(""),m(null),p(null),t());},h=async()=>{if(!(!s.trim()||y)){c(true),m(null),p(null);try{let b=await r(s.trim());p(b);}catch(b){m(b instanceof Error?b.message:"Failed to generate plan");}finally{c(false);}}},f=()=>{d&&(a(d),x());};return e?jsxRuntime.jsxs(Kt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:x}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-2xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:b=>b.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Generate Project Plan with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete Kanban board"})]}),jsxRuntime.jsx("button",{onClick:x,disabled:y,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:d?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Plan Generated Successfully!"})]}),d.explanation&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-blue-500/10 border border-blue-500/30",children:jsxRuntime.jsx("p",{className:"text-sm text-white/90",children:d.explanation})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Columns (",d.columns.length,")"]}),jsxRuntime.jsx("div",{className:"flex gap-2 flex-wrap",children:d.columns.map((b,v)=>jsxRuntime.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-white/5 border border-white/20 text-sm text-white/80",children:b.title},v))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Tasks (",d.cards.length,")"]}),jsxRuntime.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[d.cards.slice(0,10).map((b,v)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:b.title}),b.description&&jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-1 line-clamp-2",children:b.description})]}),b.priority&&jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${b.priority==="URGENT"?"bg-red-500/20 text-red-400":b.priority==="HIGH"?"bg-orange-500/20 text-orange-400":b.priority==="MEDIUM"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:b.priority})]})},v)),d.cards.length>10&&jsxRuntime.jsxs("p",{className:"text-xs text-white/50 text-center py-2",children:["+",d.cards.length-10," more tasks..."]})]})]})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description"}),jsxRuntime.jsx("textarea",{ref:g,value:s,onChange:b=>n(b.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:y}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),l&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:l}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((b,v)=>jsxRuntime.jsx("button",{onClick:()=>n(b),disabled:y,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:b},v))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:y&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:x,disabled:y,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),d?jsxRuntime.jsx("button",{onClick:f,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Plan to Board"}):jsxRuntime.jsx("button",{onClick:h,disabled:!s.trim()||y,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #2E94FF 0%, #2E94FF 100%)",color:"#ffffff"},children:y?"Generating...":"Generate Plan"})]})]})]})})]}):null}var hc={"gpt-4-turbo":{provider:"openai",name:"GPT-4 Turbo",contextWindow:128e3,costPer1kInput:.01,costPer1kOutput:.03,supportsVision:true,supportsJSON:true},"gpt-4":{provider:"openai",name:"GPT-4",contextWindow:8192,costPer1kInput:.03,costPer1kOutput:.06,supportsVision:false,supportsJSON:true},"gpt-3.5-turbo":{provider:"openai",name:"GPT-3.5 Turbo",contextWindow:16385,costPer1kInput:5e-4,costPer1kOutput:.0015,supportsVision:false,supportsJSON:true},"claude-3-5-sonnet-20241022":{provider:"anthropic",name:"Claude 3.5 Sonnet",contextWindow:2e5,costPer1kInput:.003,costPer1kOutput:.015,supportsVision:true,supportsJSON:true},"claude-3-opus-20240229":{provider:"anthropic",name:"Claude 3 Opus",contextWindow:2e5,costPer1kInput:.015,costPer1kOutput:.075,supportsVision:true,supportsJSON:true},"claude-3-haiku-20240307":{provider:"anthropic",name:"Claude 3 Haiku",contextWindow:2e5,costPer1kInput:25e-5,costPer1kOutput:.00125,supportsVision:true,supportsJSON:true}};var Sw={hobby:{requestsPerMonth:50,maxConcurrent:1,maxTokensPerRequest:4096},pro:{requestsPerMonth:500,maxConcurrent:3,maxTokensPerRequest:8192},enterprise:{requestsPerMonth:2e3,maxConcurrent:10,maxTokensPerRequest:16384}},Ew={generatePlan:{enabled:true,minPlanTier:"hobby",estimatedTokens:2e3},predictRisks:{enabled:true,minPlanTier:"pro",estimatedTokens:1500},suggestAssignee:{enabled:true,minPlanTier:"hobby",estimatedTokens:800},generateReport:{enabled:true,minPlanTier:"enterprise",estimatedTokens:3e3},generateSubtasks:{enabled:true,minPlanTier:"hobby",estimatedTokens:1e3}};function Mw(e,t,a){let r=hc[e];if(!r)throw new Error(`Unknown model: ${e}`);let o=t/1e3*r.costPer1kInput,s=a/1e3*r.costPer1kOutput;return o+s}function Ms(e){return `$${e.toFixed(4)}`}var yc=class{constructor(){this.operations=[];this.listeners=[];}record(t){let a=Mw(t.model,t.inputTokens,t.outputTokens),r={...t,id:`op_${Date.now()}_${Math.random().toString(36).substring(7)}`,timestamp:new Date,cost:a};return this.operations.push(r),this.listeners.forEach(o=>o(r)),this.operations.length>1e3&&(this.operations=this.operations.slice(-1e3)),r}getStats(t){let a=this.operations;t&&(a=a.filter(d=>d.timestamp>=t.start&&d.timestamp<=t.end));let r=a.length,o=a.reduce((d,p)=>d+p.cost,0),s=a.reduce((d,p)=>d+p.inputTokens,0),n=a.reduce((d,p)=>d+p.outputTokens,0),i=a.filter(d=>d.success),c=a.reduce((d,p)=>d+p.duration,0),l={},m={};return a.forEach(d=>{l[d.feature]=(l[d.feature]||0)+1,m[d.feature]=(m[d.feature]||0)+d.cost;}),{totalOperations:r,totalCost:o,totalInputTokens:s,totalOutputTokens:n,operationsByFeature:l,costsByFeature:m,averageDuration:r>0?c/r:0,successRate:r>0?i.length/r:0}}getRecentOperations(t=10){return this.operations.slice(-t).reverse()}checkLimit(t,a="month"){let o={hobby:{month:50,day:5},pro:{month:500,day:50},enterprise:{month:2e3,day:200}}[t][a],s=new Date,n=new Date;a==="month"?n.setMonth(s.getMonth()-1):n.setDate(s.getDate()-1);let i=this.operations.filter(m=>m.timestamp>=n).length,c=Math.max(0,o-i),l=i/o*100;return {used:i,limit:o,remaining:c,percentUsed:l,isExceeded:i>=o}}subscribe(t){return this.listeners.push(t),()=>{let a=this.listeners.indexOf(t);a>-1&&this.listeners.splice(a,1);}}clear(){this.operations=[];}export(){return JSON.stringify(this.operations,null,2)}},nn=new yc;function D0({isOpen:e,onClose:t,planTier:a="hobby"}){let[r,o]=react.useState(nn.getStats()),[s,n]=react.useState(nn.checkLimit(a));if(react.useEffect(()=>{if(!e)return;let c=setInterval(()=>{o(nn.getStats()),n(nn.checkLimit(a));},1e3);return ()=>clearInterval(c)},[e,a]),react.useEffect(()=>{let c=l=>{l.key==="Escape"&&t();};if(e)return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[e,t]),!e)return null;let i=nn.getRecentOperations(5);return jsxRuntime.jsxs(Kt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:t}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:c=>c.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-white",children:"AI Usage Dashboard"}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Monitor your AI consumption and costs"})]}),jsxRuntime.jsx("button",{onClick:t,className:"text-white/60 hover:text-white transition-colors",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[jsxRuntime.jsxs("div",{className:"p-4 rounded-xl bg-gradient-to-r from-blue-500/10 to-purple-500/10 border border-blue-500/30",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsxs("span",{className:"text-sm font-semibold text-white/90",children:["Monthly Usage (",a.toUpperCase(),")"]}),jsxRuntime.jsxs("span",{className:"text-sm font-bold text-white",children:[s.used," / ",s.limit]})]}),jsxRuntime.jsx("div",{className:"w-full h-2 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full transition-all",style:{width:`${Math.min(100,s.percentUsed)}%`,background:s.percentUsed>90?"#EF4444":s.percentUsed>70?"#F59E0B":"#10B981"}})}),jsxRuntime.jsxs("p",{className:"text-xs text-white/60 mt-2",children:[s.remaining," operations remaining this month"]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Total Cost"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-green-400 mt-1",children:Ms(r.totalCost)})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Operations"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-400 mt-1",children:r.totalOperations})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Tokens Used"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-400 mt-1",children:(r.totalInputTokens+r.totalOutputTokens).toLocaleString()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:[r.totalInputTokens.toLocaleString()," in /"," ",r.totalOutputTokens.toLocaleString()," out"]})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Success Rate"}),jsxRuntime.jsxs("p",{className:"text-2xl font-bold text-green-400 mt-1",children:[(r.successRate*100).toFixed(1),"%"]}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:["Avg: ",r.averageDuration.toFixed(0),"ms"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Usage by Feature"}),jsxRuntime.jsx("div",{className:"space-y-2",children:Object.entries(r.operationsByFeature).map(([c,l])=>{let m=r.costsByFeature[c]||0,d=r.totalOperations>0?l/r.totalOperations*100:0;return jsxRuntime.jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-white/90 capitalize",children:c.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[l," ops"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Ms(m)})]})]}),jsxRuntime.jsx("div",{className:"w-full h-1.5 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full bg-blue-500",style:{width:`${d}%`}})})]},c)})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Recent Operations"}),i.length===0?jsxRuntime.jsx("p",{className:"text-sm text-white/50 text-center py-8",children:"No operations yet. Start using AI features!"}):jsxRuntime.jsx("div",{className:"space-y-2",children:i.map(c=>jsxRuntime.jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90 capitalize",children:c.feature.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-0.5",children:[new Date(c.timestamp).toLocaleTimeString()," \u2022"," ",c.duration,"ms"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[c.inputTokens+c.outputTokens," tokens"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Ms(c.cost)}),jsxRuntime.jsx("div",{className:`w-2 h-2 rounded-full ${c.success?"bg-green-400":"bg-red-400"}`})]})]},c.id))})]})]}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("p",{className:"text-xs text-white/50",children:"Costs are estimates. Actual API charges may vary."}),jsxRuntime.jsx("button",{onClick:t,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80",children:"Close"})]})]})})]})}function M0({isOpen:e,onClose:t,onTasksGenerated:a,onGenerateTasks:r,isLoading:o,projectName:s}){let[n,i]=react.useState(""),[c,l]=react.useState(""),[m,d]=react.useState(""),[p,g]=react.useState(false),[y,x]=react.useState(null),[h,f]=react.useState(null),[b,v]=react.useState(null),C=react.useRef(null),w=p||o;react.useEffect(()=>{e&&C.current&&C.current.focus();},[e]),react.useEffect(()=>{let O=S=>{S.key==="Escape"&&!w&&N();};if(e)return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[e,w]);let N=()=>{w||(i(""),l(""),d(""),x(null),f(null),v(null),t());},T=async()=>{if(!(!n.trim()||w)){g(true),x(null),f(null),v(null);try{let O=await r({prompt:n.trim(),projectName:s||"Mi Proyecto",startDate:c||void 0,endDate:m||void 0});f(O.tasks.tasks),v({from_cache:O.from_cache,tokens_used:O.tokens_used,mock_mode:O.mock_mode,similarity:O.similarity,tokens_saved:O.tokens_saved});}catch(O){x(O instanceof Error?O.message:"Failed to generate tasks");}finally{g(false);}}},k=()=>{h&&(a(h),N());};if(!e)return null;let P=b?.similarity?((b.similarity||0)*100).toFixed(0):"0";return jsxRuntime.jsxs(Kt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:N}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:O=>O.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"9",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"14",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"19",width:"18",height:"2",rx:"1",fill:"currentColor"})]}),"Generate Gantt Tasks with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete task timeline"})]}),jsxRuntime.jsx("button",{onClick:N,disabled:w,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:h?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Tasks Generated Successfully!"})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[b?.mock_mode&&jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",children:"Mock Mode"}),b?.from_cache?jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-blue-500/20 text-blue-400 border border-blue-500/30",children:["From Cache (",P,"% similar)"]}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-green-500/20 text-green-400 border border-green-500/30",children:"AI Generated"}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-purple-500/20 text-purple-400 border border-purple-500/30",children:[b?.tokens_used||0," tokens"]}),b?.tokens_saved&&jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-indigo-500/20 text-indigo-400 border border-indigo-500/30",children:[b.tokens_saved," tokens saved"]}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-pink-500/20 text-pink-400 border border-pink-500/30",children:[h.length," tasks"]})]}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:h.map((O,S)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 hover:bg-white/10 transition-colors",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/50",children:["#",S+1]}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:O.name})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 text-xs text-white/60",children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"text-white/40",children:[jsxRuntime.jsx("rect",{x:"1",y:"2",width:"10",height:"8",rx:"1",stroke:"currentColor"}),jsxRuntime.jsx("path",{d:"M1 4h10",stroke:"currentColor"})]}),O.start," \u2192 ",O.end]}),jsxRuntime.jsxs("span",{children:[O.duration," days"]}),O.dependencies.length>0&&jsxRuntime.jsxs("span",{className:"text-blue-400",children:["Depends: ",O.dependencies.join(", ")]})]})]}),jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${O.priority==="high"?"bg-red-500/20 text-red-400":O.priority==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:O.priority})]})},O.id))})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description *"}),jsxRuntime.jsx("textarea",{ref:C,value:n,onChange:O=>i(O.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:w}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Start Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:c,onChange:O=>l(O.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-blue-500/50 transition-all",disabled:w})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"End Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:m,onChange:O=>d(O.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-blue-500/50 transition-all",disabled:w})]})]}),y&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:y}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((O,S)=>jsxRuntime.jsx("button",{onClick:()=>i(O),disabled:w,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:O},S))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:w&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:N,disabled:w,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),h?jsxRuntime.jsx("button",{onClick:k,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Tasks to Gantt"}):jsxRuntime.jsx("button",{onClick:T,disabled:!n.trim()||w,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #2E94FF 0%, #2E94FF 100%)",color:"#ffffff"},children:w?"Generating...":"Generate Tasks"})]})]})]})})]})}function tl({initialBoard:e,onPersist:t}){let[a,r]=react.useState(e),o=react.useCallback(h=>{t&&zs(()=>Promise.resolve(t(h)),{maxAttempts:3,initialDelay:1e3,onRetry:(f,b,v)=>{console.warn(`Retry attempt ${b} after ${v}ms: ${f.message}`);}}).then(f=>{f.success||console.error(`Failed to persist board after ${f.attempts} attempts:`,f.error);});},[t]),s=react.useCallback(async(h,f,b)=>{r(v=>{let C=v.cards.find(O=>O.id===h);if(!C)return v;let w=C.columnId,N={...C,columnId:f,position:b},T=v.cards.map(O=>O.id===h?N:O),k=v.columns.map(O=>{if(O.id===w)return {...O,cardIds:O.cardIds.filter(S=>S!==h)};if(O.id===f){let S=T.filter(J=>J.columnId===f).sort((J,R)=>J.position-R.position);return {...O,cardIds:S.map(J=>J.id)}}return O}),P={...v,cards:T,columns:k};return o(P),P});},[o]),n=react.useCallback(async(h,f)=>{r(b=>{let v=b.cards.map(w=>w.id===h?{...w,...f}:w),C={...b,cards:v};return o(C),C});},[o]),i=react.useCallback(async h=>{let f=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(b=>{let v={...h,id:f},C=b.columns.map(N=>N.id===h.columnId?{...N,cardIds:[...N.cardIds,f]}:N),w={...b,cards:[...b.cards,v],columns:C};return o(w),w});},[o]),c=react.useCallback(async h=>{r(f=>{let b=f.cards.find(N=>N.id===h);if(!b)return f;let v=f.cards.filter(N=>N.id!==h),C=f.columns.map(N=>N.id===b.columnId?{...N,cardIds:N.cardIds.filter(T=>T!==h)}:N),w={...f,cards:v,columns:C};return o(w),w});},[o]),l=react.useCallback(async h=>{let f=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(b=>{let v={...h,id:f,cardIds:[]},C={...b,columns:[...b.columns,v]};return o(C),C});},[o]),m=react.useCallback(async(h,f)=>{r(b=>{let v=b.columns.map(w=>w.id===h?{...w,...f}:w),C={...b,columns:v};return o(C),C});},[o]),d=react.useCallback(async h=>{r(f=>{let b=f.cards.filter(w=>w.columnId!==h),v=f.columns.filter(w=>w.id!==h),C={...f,cards:b,columns:v};return o(C),C});},[o]),p=react.useCallback(h=>{let f=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return i(h),f},[i]),g=react.useCallback(h=>{let f=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return l(h),f},[l]),y=react.useCallback(()=>{r(h=>{let f={...h,cards:[],columns:[]};return o(f),f});},[o]);return {board:a,callbacks:{onCardMove:s,onCardUpdate:n,onCardCreate:i,onCardDelete:c,onColumnCreate:l,onColumnUpdate:m,onColumnDelete:d},setBoard:r,helpers:{addCard:p,addColumn:g,deleteCard:c,deleteColumn:d,clearBoard:y}}}function P0({initialData:e,availableUsers:t=[],onSave:a}){let{board:r,callbacks:o,helpers:s}=tl({initialBoard:e,onPersist:a}),n=react.useMemo(()=>({addCard:(c,l,m={})=>{s.addCard({title:l,columnId:c,position:r.cards.filter(d=>d.columnId===c).length,...m});},addColumn:(c,l)=>{let m=r.columns.length>0?Math.max(...r.columns.map(d=>d.position)):0;s.addColumn({title:c,position:l??m+1e3});},reset:s.clearBoard}),[r.cards,r.columns,s]);return {props:react.useMemo(()=>({board:r,callbacks:o,availableUsers:t}),[r,o,t]),board:r,callbacks:o,utils:n}}var Fs={dateFilter:"all",priorities:[],assignees:[],labels:[],columns:[],search:""},L0={by:"none",order:"asc"};function I0({initialFilters:e={},initialSort:t={},currentUserId:a}={}){let[r,o]=react.useState({...Fs,...e}),[s,n]=react.useState({...L0,...t}),i=react.useCallback(x=>{o(h=>({...h,...x}));},[]),c=react.useCallback(x=>{n(h=>({...h,...x}));},[]),l=react.useCallback(()=>{o(Fs),n(L0);},[]),m=react.useCallback(()=>{a&&o({...Fs,assignees:[a]});},[a]),d=react.useCallback(()=>{o({...Fs,dateFilter:"overdue"});},[]),p=react.useCallback(()=>{o({...Fs,priorities:["HIGH","URGENT"]});},[]),g=react.useMemo(()=>r.dateFilter!=="all"||r.priorities.length>0||r.assignees.length>0||r.labels.length>0||r.columns.length>0||r.search!==""||s.by!=="none",[r,s]),y=react.useCallback(x=>{let h=[...x];if(r.search){let f=r.search.toLowerCase();h=h.filter(b=>b.title.toLowerCase().includes(f)||b.description?.toLowerCase().includes(f));}if(r.dateFilter!=="all"){let f=new Date,b=f.getFullYear(),v=String(f.getMonth()+1).padStart(2,"0"),C=String(f.getDate()).padStart(2,"0"),w=`${b}-${v}-${C}`;h=h.filter(N=>{if(!N.endDate&&!N.dueDate)return false;let T=N.endDate||N.dueDate;if(!T)return false;let k;if(typeof T=="string")k=T.split("T")[0]||T;else {let P=T.getUTCFullYear(),O=String(T.getUTCMonth()+1).padStart(2,"0"),S=String(T.getUTCDate()).padStart(2,"0");k=`${P}-${O}-${S}`;}switch(r.dateFilter){case "overdue":return k<w;case "today":return k===w;case "this-week":let P=new Date(w+"T00:00:00"),O=new Date(k+"T00:00:00"),S=new Date(P);return S.setDate(S.getDate()+7),O>=P&&O<=S;case "custom":if(r.dateRange){let J=typeof T=="string"?new Date(T):T;return J>=r.dateRange.start&&J<=r.dateRange.end}return true;default:return true}});}return r.priorities.length>0&&(h=h.filter(f=>f.priority&&r.priorities.includes(f.priority))),r.assignees.length>0&&(h=h.filter(f=>(f.assignedUserIds||(f.assigneeId?[f.assigneeId]:[])).some(v=>r.assignees.includes(v)))),r.labels.length>0&&(h=h.filter(f=>f.labels&&f.labels.some(b=>r.labels.includes(b)))),r.columns.length>0&&(h=h.filter(f=>r.columns.includes(f.columnId))),s.by!=="none"&&h.sort((f,b)=>{let v=0;switch(s.by){case "created":let C=f.createdAt?new Date(f.createdAt).getTime():0,w=b.createdAt?new Date(b.createdAt).getTime():0;v=C-w;break;case "priority":let N={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},T=N[f.priority||"LOW"],k=N[b.priority||"LOW"];v=T-k;break;case "dueDate":let P=f.endDate||f.dueDate,O=b.endDate||b.dueDate;if(!P)return 1;if(!O)return -1;let S=typeof P=="string"?new Date(P).getTime():P.getTime(),J=typeof O=="string"?new Date(O).getTime():O.getTime();v=S-J;break;case "title":v=f.title.localeCompare(b.title);break;case "estimate":let R=f.estimatedTime||0,$=b.estimatedTime||0;v=R-$;break;default:v=0;}return s.order==="asc"?v:-v}),h},[r,s]);return {filters:r,sort:s,setFilters:i,setSort:c,resetFilters:l,filterMyTasks:m,filterOverdue:d,filterHighPriority:p,applyFilters:y,hasActiveFilters:g}}var R0,O0;if(typeof window<"u")try{let e=Os("ai");R0=e.generateObject,O0=e.generateText;}catch{}function $0(e={}){let[t,a]=react.useState(false),[r,o]=react.useState(null),s=!!(R0&&O0&&e.apiKey),n=react.useCallback(async d=>{if(!s)throw new Error('AI features require the "ai" package and an API key. Install with: npm install ai');a(true),o(null);try{return console.log("Generating plan for:",d),{columns:[{title:"To Do",position:1e3,cardIds:[]},{title:"In Progress",position:2e3,cardIds:[]},{title:"Done",position:3e3,cardIds:[]}],cards:[{title:"Generated task from AI",description:`Based on: ${d}`,position:1e3,columnId:"temp-col-1"}],explanation:"This is a sample plan. Real implementation would use AI SDK."}}catch(p){let g=p instanceof Error?p:new Error("Failed to generate plan");throw o(g),g}finally{a(false);}},[s]),i=react.useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Suggesting assignee for:",d.title),{userId:"user-123",confidence:.85,reasoning:"Based on past performance and expertise"}}catch(p){let g=p instanceof Error?p:new Error("Failed to suggest assignee");throw o(g),g}finally{a(false);}},[s]),c=react.useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Analyzing board for risks..."),[{type:"RISK_OVERLOAD",severity:"HIGH",title:"Column overload detected",description:'Too many cards in "In Progress"',confidence:.9,suggestedAction:'Consider moving some cards back to "To Do"'}]}catch(p){let g=p instanceof Error?p:new Error("Failed to predict risks");throw o(g),g}finally{a(false);}},[s]),l=react.useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Generating subtasks for:",d.title),[{title:`Subtask 1 for: ${d.title}`,position:d.position+.1,columnId:d.columnId},{title:`Subtask 2 for: ${d.title}`,position:d.position+.2,columnId:d.columnId}]}catch(p){let g=p instanceof Error?p:new Error("Failed to generate subtasks");throw o(g),g}finally{a(false);}},[s]),m=react.useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Estimating effort for:",d.title),{hours:8,confidence:.75}}catch(p){let g=p instanceof Error?p:new Error("Failed to estimate effort");throw o(g),g}finally{a(false);}},[s]);return {onGeneratePlan:n,onSuggestAssignee:i,onPredictRisks:c,onGenerateSubtasks:l,onEstimateEffort:m,isAvailable:s,isLoading:t,error:r}}function vc(){let[e,t]=react.useState(()=>core.selectionStore.getState());react.useEffect(()=>core.selectionStore.subscribe(o=>{t(o);}),[]);let a=react.useCallback(r=>{core.selectionStore.setState(r);},[]);return [e,a]}function H0(e){let{cards:t}=e,[a,r]=vc(),o=react.useCallback(d=>a.selectedCardIds.includes(d),[a.selectedCardIds]),s=react.useCallback((d,p)=>{if(!p){r({selectedCardIds:[d],lastSelectedCardId:d});return}let g=p.ctrlKey||p.metaKey,y=p.shiftKey;if(g)a.selectedCardIds.includes(d)?r({selectedCardIds:a.selectedCardIds.filter(x=>x!==d),lastSelectedCardId:a.lastSelectedCardId}):r({selectedCardIds:[...a.selectedCardIds,d],lastSelectedCardId:d});else if(y&&a.lastSelectedCardId){let x=t.find(f=>f.id===d),h=t.find(f=>f.id===a.lastSelectedCardId);if(x&&h&&x.columnId===h.columnId){let f=t.filter(k=>k.columnId===x.columnId).sort((k,P)=>k.position-P.position),b=f.findIndex(k=>k.id===a.lastSelectedCardId),v=f.findIndex(k=>k.id===d),[C,w]=b<v?[b,v]:[v,b],N=f.slice(C,w+1).map(k=>k.id),T=Array.from(new Set([...a.selectedCardIds,...N]));r({selectedCardIds:T,lastSelectedCardId:d});}else r({selectedCardIds:[d],lastSelectedCardId:d});}else r({selectedCardIds:[d],lastSelectedCardId:d});},[t,a,r]),n=react.useCallback(d=>{r({selectedCardIds:a.selectedCardIds.filter(p=>p!==d),lastSelectedCardId:a.lastSelectedCardId});},[a,r]),i=react.useCallback(()=>{r({selectedCardIds:[],lastSelectedCardId:null});},[r]),c=react.useCallback(()=>{r({selectedCardIds:t.map(d=>d.id),lastSelectedCardId:t[t.length-1]?.id||null});},[t,r]),l=react.useCallback(d=>{a.selectedCardIds.includes(d)?n(d):r({selectedCardIds:[...a.selectedCardIds,d],lastSelectedCardId:d});},[a,n,r]),m=react.useCallback(()=>t.filter(d=>a.selectedCardIds.includes(d.id)),[t,a.selectedCardIds]);return {selectedCardIds:a.selectedCardIds,lastSelectedCardId:a.lastSelectedCardId,isCardSelected:o,selectCard:s,deselectCard:n,clearSelection:i,selectAll:c,toggleCard:l,getSelectedCards:m}}var z0={enableAutoStacking:true,autoStackConfidenceThreshold:.7,minCardsPerStack:2,enableManualStacking:true,showStackSummaries:true,animationDuration:200};function U0(e){let{cards:t,config:a,aiService:r}=e,o=react.useMemo(()=>({...z0,...a}),[a]),[s,n]=react.useState([]),i=react.useCallback((x,h,f,b,v)=>{if(h.length<o.minCardsPerStack){console.warn(`Cannot create stack: minimum ${o.minCardsPerStack} cards required`);return}let C={id:`stack-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,title:x,cardIds:h,columnId:f,strategy:b,color:v,isExpanded:true,position:s.filter(w=>w.columnId===f).length,createdAt:new Date};n(w=>[...w,C]);},[o.minCardsPerStack,s]),c=react.useCallback(x=>{n(h=>h.filter(f=>f.id!==x));},[]),l=react.useCallback(x=>{n(h=>h.map(f=>f.id===x?{...f,isExpanded:!f.isExpanded}:f));},[]),m=react.useCallback((x,h)=>{n(f=>f.map(b=>b.id===x&&!b.cardIds.includes(h)?{...b,cardIds:[...b.cardIds,h]}:b));},[]),d=react.useCallback((x,h)=>{n(f=>f.map(b=>{if(b.id===x){let v=b.cardIds.filter(C=>C!==h);return v.length<o.minCardsPerStack?null:{...b,cardIds:v}}return b}).filter(b=>b!==null));},[o.minCardsPerStack]),p=react.useCallback(x=>s.filter(h=>h.columnId===x).sort((h,f)=>h.position-f.position),[s]),g=react.useCallback(async x=>{let h=t.filter(w=>w.columnId===x);if(h.length<o.minCardsPerStack*2)return [];let f=[],b=new Map;h.forEach(w=>{w.labels&&w.labels.length>0&&w.labels.forEach(N=>{b.has(N)||b.set(N,[]),b.get(N).push(w);});}),b.forEach((w,N)=>{w.length>=o.minCardsPerStack&&f.push({stack:{title:`\u{1F4CC} ${N}`,cardIds:w.map(T=>T.id),columnId:x,strategy:"labels",color:"#3b82f6"},reason:`${w.length} cards with label "${N}"`,confidence:.85});});let v=new Map;h.forEach(w=>{w.assignedUserIds&&w.assignedUserIds.length>0&&w.assignedUserIds.forEach(N=>{v.has(N)||v.set(N,[]),v.get(N).push(w);});}),v.forEach((w,N)=>{w.length>=o.minCardsPerStack&&f.push({stack:{title:`\u{1F464} Assigned to user-${N.slice(-4)}`,cardIds:w.map(T=>T.id),columnId:x,strategy:"assignee",color:"#8b5cf6"},reason:`${w.length} cards assigned to the same user`,confidence:.8});});let C=new Map;if(h.forEach(w=>{w.priority&&(C.has(w.priority)||C.set(w.priority,[]),C.get(w.priority).push(w));}),C.forEach((w,N)=>{if(w.length>=o.minCardsPerStack){let T={low:"\u{1F7E2}",medium:"\u{1F7E1}",high:"\u{1F534}",urgent:"\u{1F6A8}"}[N.toLowerCase()]||"\u26AA";f.push({stack:{title:`${T} ${N} Priority`,cardIds:w.map(k=>k.id),columnId:x,strategy:"priority",color:N==="high"||N==="urgent"?"#ef4444":"#10b981"},reason:`${w.length} cards with ${N} priority`,confidence:.75});}}),r&&o.enableAutoStacking)for(let w of h){let T=(await r.findSimilar(w,h)).filter(k=>k.similarity>=o.autoStackConfidenceThreshold);if(T.length>=o.minCardsPerStack-1){let k=[w.id,...T.map(O=>O.card.id)],P=T.reduce((O,S)=>O+S.similarity,0)/T.length;f.push({stack:{title:`\u2728 Similar to "${w.title.substring(0,30)}${w.title.length>30?"...":""}"`,cardIds:k,columnId:x,strategy:"ai-similarity",color:"#f59e0b"},reason:`AI detected ${T.length+1} similar tasks`,confidence:P});}}return f.filter(w=>w.confidence>=o.autoStackConfidenceThreshold).sort((w,N)=>N.confidence-w.confidence).slice(0,5)},[t,o,r]),y=react.useCallback(x=>{i(x.stack.title,x.stack.cardIds,x.stack.columnId,x.stack.strategy,x.stack.color);},[i]);return react.useEffect(()=>{o.enableAutoStacking&&s.length===0&&new Set(t.map(h=>h.columnId)).forEach(async h=>{let f=await g(h),b=f[0];f.length>0&&b&&b.confidence>=.9&&y(b);});},[]),{stacks:s,createStack:i,deleteStack:c,toggleStack:l,addToStack:m,removeFromStack:d,getStacksForColumn:p,getSuggestions:g,applySuggestion:y,config:o}}var W0=react.createContext(null);function G0({children:e,initialData:t,onStateChange:a}){let r=react.useRef();if(!r.current){let s=new Map,n=new Map;t?.columns?.forEach(c=>{let{Column:l}=Os("@libxai/core");s.set(c.id,new l(c));}),t?.cards?.forEach(c=>{let{Card:l}=Os("@libxai/core");n.set(c.id,new l(c));});let i=null;if(t?.board){let{Board:c}=Os("@libxai/core");i=new c(t.board);}r.current=new core.BoardStore({board:i,columns:s,cards:n});}let o=r.current;return react.useEffect(()=>{if(a)return o.subscribeAll(s=>{a(o.getState());})},[o,a]),jsxRuntime.jsx(W0.Provider,{value:{store:o},children:e})}function al(){let e=react.useContext(W0);if(!e)throw new Error("useBoardStore must be used within BoardProvider");return e.store}function As(){let e=al(),[t,a]=react.useState(e.getBoard()),[r,o]=react.useState(e.getAllColumns()),[s,n]=react.useState(e.getAllCards());react.useEffect(()=>e.subscribeAll(()=>{a(e.getBoard()),o(e.getAllColumns()),n(e.getAllCards());}),[e]);let i=react.useCallback(b=>{e.updateBoard(b);},[e]),c=react.useCallback(b=>{e.addColumn(b);},[e]),l=react.useCallback((b,v)=>{e.updateColumn(b,v);},[e]),m=react.useCallback(b=>{e.deleteColumn(b);},[e]),d=react.useCallback(b=>e.getColumn(b),[e]),p=react.useCallback(b=>{e.addCard(b);},[e]),g=react.useCallback((b,v)=>{e.updateCard(b,v);},[e]),y=react.useCallback(b=>{e.deleteCard(b);},[e]),x=react.useCallback((b,v,C)=>{e.moveCard(b,v,C);},[e]),h=react.useCallback(b=>e.getCard(b),[e]),f=react.useCallback(b=>e.getCardsByColumn(b),[e]);return {board:t,columns:r,cards:s,updateBoard:i,addColumn:c,updateColumn:l,deleteColumn:m,getColumn:d,addCard:p,updateCard:g,deleteCard:y,moveCard:x,getCard:h,getCardsByColumn:f}}function _0(e){let{cards:t}=As();return react.useMemo(()=>e?t.filter(a=>{if(e.searchQuery){let r=e.searchQuery.toLowerCase(),o=a.title.toLowerCase().includes(r),s=a.description?.toLowerCase().includes(r);if(!o&&!s)return false}return !(e.priorities&&e.priorities.length>0&&(!a.priority||!e.priorities.includes(a.priority))||e.statuses&&e.statuses.length>0&&(!a.status||!e.statuses.includes(a.status))||e.assignedUserIds&&e.assignedUserIds.length>0&&!e.assignedUserIds.some(o=>a.isAssignedTo(o))||e.labels&&e.labels.length>0&&!e.labels.some(o=>a.hasLabel(o))||e.columnIds&&e.columnIds.length>0&&!e.columnIds.includes(a.columnId)||e.isOverdue!==void 0&&e.isOverdue!==a.isOverdue())}):t,[t,e])}function j0(e="position",t="asc"){let{cards:a}=As();return react.useMemo(()=>[...a].sort((o,s)=>{let n=0;switch(e){case "title":n=o.title.localeCompare(s.title);break;case "priority":{let i={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},c=o.priority?i[o.priority]:0,l=s.priority?i[s.priority]:0;n=c-l;break}case "createdAt":n=o.createdAt.getTime()-s.createdAt.getTime();break;case "updatedAt":n=o.updatedAt.getTime()-s.updatedAt.getTime();break;case "position":n=o.position-s.position;break}return t==="asc"?n:-n}),[a,e,t])}var rl=class{constructor(){this.plugins=new Map;this.enabled=new Set;this.config=new Map;this.context=null;this.pluginLogger=au.child("PluginManager");}setContext(t){this.context=t;}register(t){if(!t.id||!t.name||!t.version)throw new Error("Plugin must have id, name, and version");if(this.plugins.has(t.id)&&this.pluginLogger.warn(`Plugin ${t.id} is already registered, overwriting...`),t.dependencies){for(let a of t.dependencies)if(!this.plugins.has(a))throw new Error(`Plugin ${t.id} depends on ${a} which is not registered`)}this.plugins.set(t.id,t),t.defaultConfig&&this.config.set(t.id,{...t.defaultConfig}),this.enabled.add(t.id),this.pluginLogger.info(`Plugin registered: ${t.name} v${t.version}`),t.onInit&&this.context&&Promise.resolve(t.onInit(this.context)).catch(a=>{this.pluginLogger.error(`Failed to initialize plugin ${t.id}`,a,{plugin:t.id});});}unregister(t){let a=this.plugins.get(t);if(!a){this.pluginLogger.warn(`Plugin ${t} is not registered`);return}a.onDestroy&&Promise.resolve(a.onDestroy()).catch(r=>{this.pluginLogger.error(`Failed to destroy plugin ${t}`,r);}),this.plugins.delete(t),this.enabled.delete(t),this.config.delete(t),this.pluginLogger.info(`Plugin unregistered: ${a.name}`);}getPlugin(t){return this.plugins.get(t)}getPlugins(){return Array.from(this.plugins.values())}hasPlugin(t){return this.plugins.has(t)}setEnabled(t,a){if(!this.plugins.has(t))throw new Error(`Plugin ${t} is not registered`);a?(this.enabled.add(t),this.pluginLogger.info(`Plugin enabled: ${t}`)):(this.enabled.delete(t),this.pluginLogger.info(`Plugin disabled: ${t}`));}isEnabled(t){return this.enabled.has(t)}getConfig(t,a){return this.config.get(t)?.[a]}setConfig(t,a,r){this.config.has(t)||this.config.set(t,{});let o=this.config.get(t);o[a]=r,this.pluginLogger.debug(`Plugin config set: ${t}.${a}`,{value:r});}async executeHook(t,a,r){let o=r;for(let s of this.plugins.values()){if(!this.enabled.has(s.id))continue;let n=s[t];if(typeof n=="function")try{let i=await Promise.resolve(n.apply(s,a));i!==void 0&&(o=i,a[0]=i);}catch(i){this.pluginLogger.error(`Plugin hook failed: ${s.id}.${t}`,i,{plugin:s.id,hook:t});}}return o}async executeHookParallel(t,a){let r=[];for(let o of this.plugins.values()){if(!this.enabled.has(o.id))continue;let s=o[t];typeof s=="function"&&r.push(Promise.resolve(s.apply(o,a)).catch(n=>{this.pluginLogger.error(`Plugin hook failed: ${o.id}.${t}`,n,{plugin:o.id,hook:t});}));}await Promise.all(r);}},jw=new rl;function Y0({items:e,height:t,estimateSize:a,renderItem:r,className:o="",overscan:s=5,horizontal:n=false,gap:i=0,getItemKey:c}){let l=react.useRef(null),m=reactVirtual.useVirtualizer({count:e.length,getScrollElement:()=>l.current,estimateSize:()=>a,overscan:s,horizontal:n,gap:i}),d=m.getVirtualItems(),p={height:typeof t=="number"?`${t}px`:t,width:"100%",overflow:"auto",position:"relative"},g=n?{width:`${m.getTotalSize()}px`,height:"100%",position:"relative"}:{height:`${m.getTotalSize()}px`,width:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:l,style:p,className:o,children:jsxRuntime.jsx("div",{style:g,children:d.map(y=>{let x=e[y.index];if(!x)return null;let h=c?c(x,y.index):y.index,f={position:"absolute",top:n?0:y.start,left:n?y.start:0,width:n?y.size:"100%",height:n?"100%":y.size};return jsxRuntime.jsx("div",{style:f,"data-index":y.index,children:r(x,y.index)},h)})})})}function q0(e){return reactVirtual.useVirtualizer({count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateSize,overscan:e.overscan??5,horizontal:e.horizontal??false,gap:e.gap??0})}function J0({items:e,height:t,width:a="100%",estimateColumnWidth:r,renderColumn:o,className:s="",overscan:n=3,gap:i=16,getItemKey:c,horizontal:l=true}){let m=react.useRef(null),d=reactVirtual.useVirtualizer({horizontal:l,count:e.length,getScrollElement:()=>m.current,estimateSize:()=>r,overscan:n,gap:i}),p=d.getVirtualItems(),g={height:typeof t=="number"?`${t}px`:t,width:typeof a=="number"?`${a}px`:a,overflow:"auto",position:"relative"},y={width:`${d.getTotalSize()}px`,height:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:m,style:g,className:s,children:jsxRuntime.jsx("div",{style:y,children:p.map(x=>{let h=e[x.index];if(!h)return null;let f=c?c(h,x.index):x.index,b={position:"absolute",top:0,left:x.start,width:x.size,height:"100%"};return jsxRuntime.jsx("div",{style:b,"data-index":x.index,children:o(h,x.index)},f)})})})}function Q0(e){let t=reactVirtual.useVirtualizer({horizontal:true,count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateColumnWidth,overscan:e.overscan??3,gap:e.gap??0});return {columnVirtualizer:t,virtualColumns:t.getVirtualItems(),totalWidth:t.getTotalSize()}}function Z0(e,t=10){return e>t}var Tc={none:0,xs:4,sm:8,md:12,lg:16,xl:20,"2xl":24,"3xl":32,"4xl":40,"5xl":48,"6xl":64},Nc={none:0,sm:4,md:8,lg:12,xl:16,"2xl":20,full:9999},Dc={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48},Sc={light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800},Ec={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},Mc={base:0,dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070},Fc={instant:0,fastest:75,faster:100,fast:150,normal:200,slow:300,slower:400,slowest:500},Pc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",smooth:"cubic-bezier(0.4, 0.0, 0.2, 1)",sharp:"cubic-bezier(0.4, 0.0, 0.6, 1)",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},Ac={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"},Lc={0:0,5:.05,10:.1,20:.2,30:.3,40:.4,50:.5,60:.6,70:.7,80:.8,90:.9,100:1},Ic={column:{width:320,minWidth:280,maxWidth:400,gap:16,padding:12,headerHeight:48},card:{minHeight:80,maxHeight:400,padding:12,gap:8},board:{padding:16,gap:16}},Bc={timeline:{headerHeight:60,rowHeight:44,minRowHeight:32,maxRowHeight:80,taskPadding:4,gridLineWidth:1},task:{height:28,minHeight:20,maxHeight:40,borderRadius:4,padding:6},dependency:{lineWidth:2,arrowSize:8},scale:{day:{columnWidth:40,minColumnWidth:30,maxColumnWidth:60},week:{columnWidth:80,minColumnWidth:60,maxColumnWidth:120},month:{columnWidth:120,minColumnWidth:80,maxColumnWidth:200},quarter:{columnWidth:200,minColumnWidth:150,maxColumnWidth:300}},milestone:{size:16,rotation:45}},ol={spacing:Tc,borderRadius:Nc,fontSize:Dc,fontWeight:Sc,lineHeight:Ec,zIndex:Mc,duration:Fc,easing:Pc,shadows:Ac,opacity:Lc,kanban:Ic,gantt:Bc};function ef(e,t,a){return e[t]??a}function Rc(e,t="",a={}){for(let[r,o]of Object.entries(e)){let s=t?`${t}-${r}`:r;typeof o=="object"&&o!==null&&!Array.isArray(o)?Rc(o,s,a):(typeof o=="string"||typeof o=="number")&&(a[s]=o);}return a}function qw(e){return typeof e=="number"?e>0&&e<1e3?`${e}px`:e.toString():e}function Oc(e="asakaa"){let t=Rc(ol),a=[];for(let[r,o]of Object.entries(t)){let s=`--${e}-${r}`,n=qw(o);a.push(` ${s}: ${n};`);}return `:root {
|
|
414
414
|
${a.join(`
|
|
415
415
|
`)}
|
|
416
416
|
}`}function Ls(e,t="asakaa"){let a=[],r=Rc(e);for(let[o,s]of Object.entries(r)){let n=`--${t}-color-${o}`;a.push(` ${n}: ${s};`);}return `:root {
|