@libxai/board 0.17.407 → 0.17.409
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
|
@@ -386,7 +386,7 @@ If ambiguous, ask for clarification in the message field.`;function fm(e){return
|
|
|
386
386
|
${bm(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(`
|
|
387
387
|
`)}
|
|
388
388
|
|
|
389
|
-
Today's date: ${new Date().toISOString().split("T")[0]}`}function bm(e){let t=[],a=r=>{for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);};return a(e),t}function Mr(e,t){let a=bm(e),r=t.toLowerCase().trim(),o=a.find(m=>m.name.toLowerCase()===r);if(o)return o;let s=a.find(m=>m.name.toLowerCase().includes(r));if(s)return s;let n=r.split(/\s+/);return a.find(m=>{let g=m.name.toLowerCase();return n.every(i=>g.includes(i))})}function Xi(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 b=new Date(r);return b.setDate(b.getDate()+1),b}if(a==="yesterday"||a==="ayer"){let b=new Date(r);return b.setDate(b.getDate()-1),b}if(a==="next week"||a==="la pr\xF3xima semana"){let b=new Date(r);return b.setDate(b.getDate()+7),b}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 v={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(v!==void 0){let k=new Date(r),C=k.getDay(),h=v-C;return h<=0&&(h+=7),k.setDate(k.getDate()+h),k}}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 b=parseInt(s[1],10),v=s[2].toLowerCase(),k=new Date(r);return v==="day"||v==="d\xEDa"||v==="dias"?k.setDate(k.getDate()+b):v==="week"||v==="semana"||v==="semanas"?k.setDate(k.getDate()+b*7):(v==="month"||v==="mes"||v==="meses")&&k.setMonth(k.getMonth()+b),k}if(a.match(/(\d{4})-(\d{2})-(\d{2})/))return new Date(a);let m=a.match(/(\d{1,2})\/(\d{1,2})\/(\d{4})/);if(m&&m[1]&&m[2]&&m[3]){let b=parseInt(m[1],10),v=parseInt(m[2],10)-1,k=parseInt(m[3],10);return new Date(k,v,b)}let g={enero:0,febrero:1,marzo:2,abril:3,mayo:4,junio:5,julio:6,agosto:7,septiembre:8,octubre:9,noviembre:10,diciembre:11},i=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(i&&i[1]&&i[2]){let b=parseInt(i[1],10),v=g[i[2].toLowerCase()],k=i[3]?parseInt(i[3],10):r.getFullYear();if(v!==void 0)return new Date(k,v,b)}let p={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},l=a.match(/(january|february|march|april|may|june|july|august|september|october|november|december)\s+(\d{1,2})(?:,?\s+(\d{4}))?/i);if(l&&l[1]&&l[2]){let b=p[l[1].toLowerCase()],v=parseInt(l[2],10),k=l[3]?parseInt(l[3],10):r.getFullYear();if(b!==void 0)return new Date(k,b,v)}return null}function Ji(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 Zi(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 hm(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 ym(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 i=r[1].trim(),p=r[2].trim(),l=Mr(t,i),b=Xi(p);if(!l)return {type:"move_task",taskName:i,message:`Could not find a task named "${i}". Please check the task name and try again.`,success:false,error:"Task not found"};if(!b)return {type:"move_task",taskId:l.id,taskName:l.name,message:`Could not parse the date "${p}". Try using formats like "next Monday", "in 3 days", or "2024-01-15".`,success:false,error:"Invalid date"};let v=l.startDate&&l.endDate?Math.round((l.endDate.getTime()-l.startDate.getTime())/(1e3*60*60*24)):1,k=new Date(b);return k.setDate(k.getDate()+v),{type:"move_task",taskId:l.id,taskName:l.name,updates:{startDate:b,endDate:k},message:`Moved "${l.name}" to ${b.toLocaleDateString()}.`,success:true}}let o=a.match(/(?:extend|extender|extiende|alargar)\s+["""]?(.+?)["""]?\s+(?:by|por)\s+(.+)/i);if(o&&o[1]&&o[2]){let i=o[1].trim(),p=o[2].trim(),l=Mr(t,i),b=Ji(p);if(!l)return {type:"resize_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"};if(!b||!l.endDate)return {type:"resize_task",taskId:l.id,taskName:l.name,message:`Could not parse the duration "${p}".`,success:false,error:"Invalid duration"};let v=new Date(l.endDate);return v.setDate(v.getDate()+b),{type:"resize_task",taskId:l.id,taskName:l.name,updates:{endDate:v},message:`Extended "${l.name}" by ${b} days. New end date: ${v.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 i=s[1].trim(),p=s[2].trim(),l=Mr(t,i),b=Zi(p);return l?b===null?{type:"set_progress",taskId:l.id,taskName:l.name,message:`Could not parse the progress value "${p}".`,success:false,error:"Invalid progress"}:{type:"set_progress",taskId:l.id,taskName:l.name,updates:{progress:b},message:`Set "${l.name}" progress to ${b}%.`,success:true}:{type:"set_progress",taskName:i,message:`Could not find a task named "${i}".`,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 i=n[1].trim(),p=n[2].trim(),l=Mr(t,i);return l?{type:"rename_task",taskId:l.id,taskName:l.name,updates:{name:p},message:`Renamed "${l.name}" to "${p}".`,success:true}:{type:"rename_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}let m=a.match(/(?:link|vincular|conectar)\s+["""]?(.+?)["""]?\s+(?:to|a|con)\s+["""]?(.+?)["""]?$/i);if(m&&m[1]&&m[2]){let i=m[1].trim(),p=m[2].trim(),l=Mr(t,i),b=Mr(t,p);return l?b?{type:"link_tasks",taskId:b.id,taskName:b.name,dependencyFrom:l.id,dependencyTo:b.id,message:`Linked "${l.name}" \u2192 "${b.name}".`,success:true}:{type:"link_tasks",taskName:p,message:`Could not find a task named "${p}".`,success:false,error:"Target task not found"}:{type:"link_tasks",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Source task not found"}}let g=a.match(/(?:delete|eliminar|borrar|remove|quitar)\s+["""]?(.+?)["""]?$/i);if(g&&g[1]){let i=g[1].trim(),p=Mr(t,i);return p?{type:"delete_task",taskId:p.id,taskName:p.name,message:`Deleted "${p.name}".`,success:true}:{type:"delete_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}return null}function vm(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 dh(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 ch(e){switch(e){case "todo":return "TODO";case "in-progress":return "IN_PROGRESS";case "completed":return "DONE";default:return e||"TODO"}}function rs(e,t=[],a=[]){let r=e.assignedUserIds?.map(p=>{let l=a.find(b=>b.id===p);return l?{name:l.name,initials:l.initials,color:l.color}:null}).filter(p=>p!==null),o=t.filter(p=>p.metadata?.parentCardId===e.id).map(p=>rs(p,t,a)),s;e.dependencies&&(typeof e.dependencies[0]=="string"?s=e.dependencies:s=e.dependencies.filter(p=>p.type==="finish-to-start").map(p=>p.taskId));let n=p=>{if(p)return typeof p=="string"?new Date(p):p},m=n(e.startDate),g=n(e.endDate),i=e.metadata?.isMilestone===true||m&&g&&Math.abs(g.getTime()-m.getTime())<=864e5;return {id:e.id,name:e.title,startDate:m,endDate:g,progress:e.progress||0,status:dh(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:i,isCriticalPath:e.metadata?.isCriticalPath===true}}function xm(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:ch(e.status),isExpanded:e.isExpanded,isMilestone:e.isMilestone,isCriticalPath:e.isCriticalPath}}}function km(e,t=[]){return e.filter(r=>!r.metadata?.parentCardId).map(r=>rs(r,e,t))}var Qi={columns:{name:"Task Name",startDate:"Start Date",endDate:"End Date",progress:"Progress",status:"Status",assignees:"Assignees",priority:"Priority",actions:"Actions"},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"}},el={columns:{name:"Nombre de Tarea",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",status:"Estado",assignees:"Asignados",priority:"Prioridad",actions:"Acciones"},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"}},os={en:Qi,es:el};function tl(e){return os[e]||os.en}function ns(e,t){let a=tl(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 al=[{value:"todo",icon:lucideReact.Circle,color:"text-gray-400"},{value:"in-progress",icon:lucideReact.PlayCircle,color:"text-blue-500"},{value:"completed",icon:lucideReact.CheckCircle2,color:"text-green-500"}];function wm({value:e,onChange:t,isDark:a,translations:r,disabled:o=false}){let[s,n]=react.useState(false),m=react.useRef(null);react.useEffect(()=>{let b=v=>{m.current&&!m.current.contains(v.target)&&n(false);};return s&&document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[s]);let g=al[0],i=al.find(b=>b.value===e)??g,p=i.icon,l=b=>{switch(b){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(p,{className:d("w-4 h-4",i.color)}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:l(e)})]}):jsxRuntime.jsxs("div",{ref:m,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:b=>{b.stopPropagation(),n(!s);},className:d("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(p,{className:d("w-4 h-4",i.color)}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:l(e)}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3",a?"text-[#6B7280]":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:d("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[140px]",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:al.map(b=>{let v=b.icon;return jsxRuntime.jsxs("button",{onClick:k=>{k.stopPropagation(),t(b.value),n(false);},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",e===b.value&&(a?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx(v,{className:d("w-4 h-4",b.color)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:l(b.value)})]},b.value)})})]})}var rl=[{value:"urgent",label:{en:"Urgent",es:"Urgente"},color:"text-red-500",bg:"bg-red-500"},{value:"high",label:{en:"High",es:"Alta"},color:"text-orange-500",bg:"bg-orange-500"},{value:"medium",label:{en:"Medium",es:"Media"},color:"text-yellow-500",bg:"bg-yellow-500"},{value:"low",label:{en:"Low",es:"Baja"},color:"text-blue-500",bg:"bg-blue-500"},{value:"none",label:{en:"None",es:"Ninguna"},color:"text-gray-400",bg:"bg-gray-400"}];function Tm({value:e="none",onChange:t,isDark:a,locale:r,disabled:o=false}){let[s,n]=react.useState(false),m=react.useRef(null);react.useEffect(()=>{let p=l=>{m.current&&!m.current.contains(l.target)&&n(false);};return s&&document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[s]);let g=rl.find(p=>p.value===e)??rl[4],i=r==="es"?"es":"en";return o||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Flag,{className:d("w-4 h-4",g.color)}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:g.label[i]})]}):jsxRuntime.jsxs("div",{ref:m,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:p=>{p.stopPropagation(),n(!s);},className:d("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Flag,{className:d("w-4 h-4",g.color)}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:g.label[i]}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3",a?"text-[#6B7280]":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:d("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px]",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:rl.map(p=>jsxRuntime.jsxs("button",{onClick:l=>{l.stopPropagation(),t(p.value),n(false);},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",e===p.value&&(a?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:d("w-2 h-2 rounded-full",p.bg)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:p.label[i]})]},p.value))})]})}function ls(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function ds(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 Dm({value:e=[],availableUsers:t=[],onChange:a,isDark:r,locale:o,disabled:s=false}){let[n,m]=react.useState(false),[g,i]=react.useState(""),p=react.useRef(null);react.useEffect(()=>{let k=C=>{p.current&&!p.current.contains(C.target)&&(m(false),i(""));};return n&&document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[n]);let l=t.filter(k=>k.name.toLowerCase().includes(g.toLowerCase())||k.email?.toLowerCase().includes(g.toLowerCase())),b=k=>e.some(C=>C.name===k),v=k=>{if(a)if(b(k.name))a(e.filter(C=>C.name!==k.name));else {let C={name:k.name,initials:ls(k.name),color:k.color||ds(k.name).replace("bg-","").replace("-500",""),avatar:k.avatarUrl};a([...e,C]);}};return s||!a?e.length===0?jsxRuntime.jsx("span",{className:d("text-sm",r?"text-[#6B7280]":"text-gray-400"),children:"-"}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-2",children:[e.slice(0,3).map((k,C)=>jsxRuntime.jsx("div",{className:d("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium text-white border-2",r?"border-[#0F1117]":"border-white",!k.avatar&&ds(k.name)),style:k.color&&!k.avatar?{backgroundColor:k.color}:void 0,title:k.name,children:k.avatar?jsxRuntime.jsx("img",{src:k.avatar,alt:k.name,className:"w-full h-full rounded-full object-cover"}):k.initials||ls(k.name)},`${k.name}-${C}`)),e.length>3&&jsxRuntime.jsxs("div",{className:d("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium border-2",r?"bg-[#374151] border-[#0F1117] text-white":"bg-gray-200 border-white text-gray-600"),children:["+",e.length-3]})]}):jsxRuntime.jsxs("div",{ref:p,className:"relative",children:[jsxRuntime.jsx("button",{onClick:k=>{k.stopPropagation(),m(!n);},className:d("flex items-center gap-1 px-2 py-1 rounded transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100"),children:e.length===0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.User,{className:d("w-4 h-4",r?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx(lucideReact.Plus,{className:d("w-3 h-3",r?"text-[#6B7280]":"text-gray-400")})]}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-1",children:[e.slice(0,2).map((k,C)=>jsxRuntime.jsx("div",{className:d("w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-medium text-white border",r?"border-[#0F1117]":"border-white",!k.avatar&&ds(k.name)),style:k.color&&!k.avatar?{backgroundColor:k.color}:void 0,children:k.avatar?jsxRuntime.jsx("img",{src:k.avatar,alt:k.name,className:"w-full h-full rounded-full object-cover"}):k.initials||ls(k.name)},`${k.name}-${C}`)),e.length>2&&jsxRuntime.jsxs("span",{className:d("text-xs ml-1",r?"text-[#9CA3AF]":"text-gray-500"),children:["+",e.length-2]})]})}),n&&jsxRuntime.jsxs("div",{className:d("absolute z-50 top-full left-0 mt-1 rounded-lg shadow-lg border w-64",r?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsx("div",{className:"p-2 border-b",style:{borderColor:r?"rgba(255,255,255,0.1)":"#E5E7EB"},children:jsxRuntime.jsx("input",{type:"text",value:g,onChange:k=>i(k.target.value),placeholder:o==="es"?"Buscar usuario...":"Search user...",className:d("w-full px-3 py-1.5 text-sm rounded border outline-none",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400"),onClick:k=>k.stopPropagation()})}),jsxRuntime.jsx("div",{className:"max-h-48 overflow-y-auto py-1",children:l.length===0?jsxRuntime.jsx("p",{className:d("px-3 py-2 text-sm",r?"text-[#6B7280]":"text-gray-400"),children:o==="es"?"No se encontraron usuarios":"No users found"}):l.map(k=>jsxRuntime.jsxs("button",{onClick:C=>{C.stopPropagation(),v(k);},className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx("div",{className:d("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium text-white",!k.avatarUrl&&ds(k.name)),children:k.avatarUrl?jsxRuntime.jsx("img",{src:k.avatarUrl,alt:k.name,className:"w-full h-full rounded-full object-cover"}):ls(k.name)}),jsxRuntime.jsxs("div",{className:"flex-1 text-left",children:[jsxRuntime.jsx("div",{className:r?"text-white":"text-gray-900",children:k.name}),k.email&&jsxRuntime.jsx("div",{className:d("text-xs",r?"text-[#6B7280]":"text-gray-400"),children:k.email})]}),b(k.name)&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-green-500"})]},k.id))}),e.length>0&&jsxRuntime.jsx("div",{className:"p-2 border-t flex flex-wrap gap-1",style:{borderColor:r?"rgba(255,255,255,0.1)":"#E5E7EB"},children:e.map((k,C)=>jsxRuntime.jsxs("span",{className:d("inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded-full",r?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:[k.name,jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),a(e.filter(f=>f.name!==k.name));},className:"hover:text-red-500",children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},`${k.name}-${C}`))})]})]})}var Ih={en:["January","February","March","April","May","June","July","August","September","October","November","December"],es:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"]},Bh={en:["Su","Mo","Tu","We","Th","Fr","Sa"],es:["Do","Lu","Ma","Mi","Ju","Vi","S\xE1"]};function cs({value:e,onChange:t,isDark:a,locale:r,disabled:o=false}){let[s,n]=react.useState(false),[m,g]=react.useState(()=>{if(e){let h=e instanceof Date?e:new Date(e);return new Date(h.getFullYear(),h.getMonth(),1)}return new Date(new Date().getFullYear(),new Date().getMonth(),1)}),i=react.useRef(null),p=e?e instanceof Date?e:new Date(e):null,l=r==="es"?"es":"en";react.useEffect(()=>{let h=f=>{i.current&&!i.current.contains(f.target)&&n(false);};return s&&document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s]);let b=h=>h?h.toLocaleDateString(r==="es"?"es-ES":"en-US",{day:"numeric",month:"short"}):"-",v=(h,f)=>new Date(h,f+1,0).getDate(),k=(h,f)=>new Date(h,f,1).getDay(),C=()=>{let h=m.getFullYear(),f=m.getMonth(),u=v(h,f),x=k(h,f),c=new Date,N=[];for(let w=0;w<x;w++)N.push(jsxRuntime.jsx("div",{className:"w-8 h-8"},`empty-${w}`));for(let w=1;w<=u;w++){let B=new Date(h,f,w),y=p&&p.getDate()===w&&p.getMonth()===f&&p.getFullYear()===h,I=c.getDate()===w&&c.getMonth()===f&&c.getFullYear()===h;N.push(jsxRuntime.jsx("button",{onClick:P=>{P.stopPropagation(),t?.(B),n(false);},className:d("w-8 h-8 rounded-full text-sm transition-colors",y?"bg-[#3B82F6] text-white":I?a?"bg-white/10 text-white":"bg-gray-100 text-gray-900":a?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-900"),children:w},w));}return N};return o||!t?jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:b(p)}):jsxRuntime.jsxs("div",{ref:i,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:h=>{h.stopPropagation(),n(!s);},className:d("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:d("w-4 h-4",a?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:b(p)})]}),s&&jsxRuntime.jsxs("div",{className:d("absolute z-50 top-full left-0 mt-1 p-3 rounded-lg shadow-lg border",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),g(new Date(m.getFullYear(),m.getMonth()-1,1));},className:d("p-1 rounded",a?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:d("w-4 h-4",a?"text-white":"text-gray-600")})}),jsxRuntime.jsxs("span",{className:d("text-sm font-medium",a?"text-white":"text-gray-900"),children:[Ih[l][m.getMonth()]," ",m.getFullYear()]}),jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),g(new Date(m.getFullYear(),m.getMonth()+1,1));},className:d("p-1 rounded",a?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:d("w-4 h-4",a?"text-white":"text-gray-600")})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-1",children:Bh[l].map(h=>jsxRuntime.jsx("div",{className:d("w-8 h-6 text-xs flex items-center justify-center",a?"text-[#6B7280]":"text-gray-400"),children:h},h))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:C()}),jsxRuntime.jsxs("div",{className:"mt-3 pt-3 border-t flex gap-2",style:{borderColor:a?"rgba(255,255,255,0.1)":"#E5E7EB"},children:[jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),t?.(new Date),n(false);},className:d("flex-1 py-1.5 text-xs rounded",a?"bg-white/10 text-white hover:bg-white/20":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:r==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation();let f=new Date;f.setDate(f.getDate()+1),t?.(f),n(false);},className:d("flex-1 py-1.5 text-xs rounded",a?"bg-white/10 text-white hover:bg-white/20":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:r==="es"?"Ma\xF1ana":"Tomorrow"})]})]})]})}function Mm({value:e=0,onChange:t,isDark:a,disabled:r=false}){return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 w-full",children:[jsxRuntime.jsx("div",{onClick:s=>{if(r||!t)return;s.stopPropagation();let n=s.currentTarget.getBoundingClientRect(),m=s.clientX-n.left,g=Math.round(m/n.width*100),i=Math.max(0,Math.min(100,g));t(i);},className:d("flex-1 h-2 rounded-full overflow-hidden",a?"bg-white/10":"bg-gray-200",!r&&t&&"cursor-pointer"),children:jsxRuntime.jsx("div",{className:d("h-full rounded-full transition-all",e===100?"bg-green-500":"bg-[#3B82F6]"),style:{width:`${e}%`}})}),jsxRuntime.jsxs("span",{className:d("text-xs w-8 text-right",a?"text-[#9CA3AF]":"text-gray-500"),children:[e,"%"]})]})}function Lm({value:e="",onChange:t,isDark:a,placeholder:r="-",disabled:o=false}){let[s,n]=react.useState(false),[m,g]=react.useState(e),i=react.useRef(null);react.useEffect(()=>{s&&i.current&&(i.current.focus(),i.current.select());},[s]),react.useEffect(()=>{g(e);},[e]);let p=()=>{m!==e&&t?.(m),n(false);},l=b=>{b.key==="Enter"?p():b.key==="Escape"&&(g(e),n(false));};return o||!t?jsxRuntime.jsx("span",{className:d("text-sm truncate",a?"text-[#94A3B8]":"text-gray-500"),children:e||r}):s?jsxRuntime.jsx("input",{ref:i,type:"text",value:m,onChange:b=>g(b.target.value),onBlur:p,onKeyDown:l,onClick:b=>b.stopPropagation(),className:d("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/5 border-[#3B82F6] text-white":"bg-white border-[#3B82F6] text-gray-900")}):jsxRuntime.jsx("button",{onClick:b=>{b.stopPropagation(),n(true);},className:d("text-sm truncate text-left w-full px-2 py-1 rounded transition-colors",a?"text-[#94A3B8] hover:bg-white/10":"text-gray-500 hover:bg-gray-100",!e&&(a?"text-[#6B7280]":"text-gray-400")),children:e||r})}function Rm({value:e,onChange:t,isDark:a,placeholder:r="-",min:o,max:s,disabled:n=false}){let[m,g]=react.useState(false),[i,p]=react.useState(e?.toString()||""),l=react.useRef(null);react.useEffect(()=>{m&&l.current&&(l.current.focus(),l.current.select());},[m]),react.useEffect(()=>{p(e?.toString()||"");},[e]);let b=()=>{let k=parseFloat(i);if(!isNaN(k)){let C=k;o!==void 0&&(C=Math.max(o,C)),s!==void 0&&(C=Math.min(s,C)),C!==e&&t?.(C);}g(false);},v=k=>{k.key==="Enter"?b():k.key==="Escape"&&(p(e?.toString()||""),g(false));};return n||!t?jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:e!==void 0?e:r}):m?jsxRuntime.jsx("input",{ref:l,type:"number",value:i,onChange:k=>p(k.target.value),onBlur:b,onKeyDown:v,onClick:k=>k.stopPropagation(),min:o,max:s,className:d("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/5 border-[#3B82F6] text-white":"bg-white border-[#3B82F6] text-gray-900")}):jsxRuntime.jsx("button",{onClick:k=>{k.stopPropagation(),g(true);},className:d("text-sm text-left w-full px-2 py-1 rounded transition-colors",a?"text-[#94A3B8] hover:bg-white/10":"text-gray-500 hover:bg-gray-100",e===void 0&&(a?"text-[#6B7280]":"text-gray-400")),children:e!==void 0?e:r})}function Om({value:e,options:t=[],onChange:a,isDark:r,placeholder:o="-",disabled:s=false}){let[n,m]=react.useState(false),g=react.useRef(null);return react.useEffect(()=>{let i=p=>{g.current&&!g.current.contains(p.target)&&m(false);};return n&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n]),s||!a?jsxRuntime.jsx("span",{className:d("text-sm",r?"text-[#94A3B8]":"text-gray-500"),children:e||o}):jsxRuntime.jsxs("div",{ref:g,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:i=>{i.stopPropagation(),m(!n);},className:d("flex items-center gap-2 px-2 py-1 rounded transition-colors min-w-[80px]",r?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx("span",{className:d("text-sm flex-1 text-left truncate",r?"text-[#94A3B8]":"text-gray-500",!e&&(r?"text-[#6B7280]":"text-gray-400")),children:e||o}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3 flex-shrink-0",r?"text-[#6B7280]":"text-gray-400")})]}),n&&jsxRuntime.jsx("div",{className:d("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-[#1F2937] border-white/10":"bg-white border-gray-200"),children:t.length===0?jsxRuntime.jsx("p",{className:d("px-3 py-2 text-sm",r?"text-[#6B7280]":"text-gray-400"),children:"No options"}):t.map(i=>jsxRuntime.jsxs("button",{onClick:p=>{p.stopPropagation(),a(i),m(false);},className:d("w-full flex items-center justify-between gap-2 px-3 py-2 text-sm transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100",e===i&&(r?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:i}),e===i&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-[#3B82F6]"})]},i))})]})}function Um({value:e=false,onChange:t,isDark:a,disabled:r=false}){return jsxRuntime.jsx("button",{onClick:s=>{s.stopPropagation(),!r&&t&&t(!e);},disabled:r||!t,className:d("w-5 h-5 rounded border-2 flex items-center justify-center transition-colors",e?"bg-[#3B82F6] border-[#3B82F6]":a?"border-[#4B5563] hover:border-[#6B7280]":"border-gray-300 hover:border-gray-400",(r||!t)&&"opacity-50 cursor-not-allowed"),children:e&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})})}function Wm({value:e=[],isDark:t,maxVisible:a=2}){if(e.length===0)return jsxRuntime.jsx("span",{className:d("text-sm",t?"text-[#6B7280]":"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-xs rounded-full",style:{backgroundColor:s.color?`${s.color}20`:t?"rgba(255,255,255,0.1)":"#F3F4F6",color:s.color||(t?"#9CA3AF":"#6B7280")},children:s.name},s.id)),o>0&&jsxRuntime.jsxs("span",{className:d("inline-flex items-center px-2 py-0.5 text-xs rounded-full",t?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-500"),children:["+",o]})]})}function ry(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function oy(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 jm({state:e,onClose:t,isDark:a,locale:r,onTaskEdit:o,onTaskDuplicate:s,onTaskDelete:n,onTaskUpdate:m,onColumnHide:g,onColumnSort:i,availableUsers:p=[]}){let l=react.useRef(null),b=r==="es"?_m.es:_m.en;if(react.useEffect(()=>{let f=x=>{l.current&&!l.current.contains(x.target)&&t();},u=x=>{x.key==="Escape"&&t();};return document.addEventListener("mousedown",f),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",u);}},[t]),!e.isOpen)return null;let v=()=>{if(!e.task)return [];let f=[];return o&&f.push({id:"edit",label:b.edit,icon:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),onClick:()=>{o(e.task),t();}}),f.push({id:"sep1",label:"",icon:null,separator:true}),m&&(f.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:()=>{m({...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:()=>{m({...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:()=>{m({...e.task,status:"completed",progress:100}),t();}}]}),f.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:()=>{m({...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:()=>{m({...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:()=>{m({...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:()=>{m({...e.task,priority:"low"}),t();}}]}),p.length>0&&f.push({id:"assign",label:b.assignUser,icon:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),submenu:p.slice(0,5).map(u=>({id:`assign-${u.id}`,label:u.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:u.name.charAt(0).toUpperCase()}),onClick:()=>{let x=e.task.assignees||[],N=x.some(w=>w.name===u.name)?x.filter(w=>w.name!==u.name):[...x,{name:u.name,initials:ry(u.name),color:u.color||oy(u.name),avatar:u.avatarUrl}];m({...e.task,assignees:N}),t();}}))})),f.push({id:"sep2",label:"",icon:null,separator:true}),s&&f.push({id:"duplicate",label:b.duplicate,icon:jsxRuntime.jsx(lucideReact.Copy,{className:"w-4 h-4"}),onClick:()=>{s(e.task),t();}}),n&&f.push({id:"delete",label:b.delete,icon:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),danger:true,onClick:()=>{n(e.task.id),t();}}),f},k=()=>{if(!e.columnId)return [];let f=[];return i&&(f.push({id:"sort-asc",label:b.sortAsc,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),onClick:()=>{i(e.columnId,"asc"),t();}}),f.push({id:"sort-desc",label:b.sortDesc,icon:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),onClick:()=>{i(e.columnId,"desc"),t();}})),g&&e.columnId!=="name"&&(f.push({id:"sep-hide",label:"",icon:null,separator:true}),f.push({id:"hide",label:b.hideColumn,icon:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),onClick:()=>{g(e.columnId),t();}})),f},C=e.type==="task"?v():k(),h={position:"fixed",left:e.x,top:e.y,zIndex:9999};return jsxRuntime.jsx("div",{ref:l,style:h,className:d("py-1 rounded-lg shadow-xl border min-w-[180px]",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:C.map(f=>f.separator?jsxRuntime.jsx("div",{className:d("my-1 h-px",a?"bg-white/10":"bg-gray-200")},f.id):f.submenu?jsxRuntime.jsx(ny,{item:f,isDark:a},f.id):jsxRuntime.jsxs("button",{onClick:f.onClick,className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",f.danger?"text-red-500 hover:text-red-600":a?"text-white":"text-gray-700"),children:[jsxRuntime.jsx("span",{className:d(f.danger?"text-red-500":a?"text-[#9CA3AF]":"text-gray-400"),children:f.icon}),f.label]},f.id))})}function ny({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:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-[#9CA3AF]":"text-gray-400",children:e.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:e.label}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:d("w-4 h-4",t?"text-[#6B7280]":"text-gray-400")})]}),a&&e.submenu&&jsxRuntime.jsx("div",{className:d("absolute left-full top-0 ml-1 py-1 rounded-lg shadow-xl border min-w-[160px]",t?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:e.submenu.map(m=>jsxRuntime.jsxs("button",{onClick:m.onClick,className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-[#9CA3AF]":"text-gray-400",children:m.icon}),m.label]},m.id))})]})}var _m={en:{edit:"Edit",changeStatus:"Change status",changePriority:"Change priority",assignUser:"Assign user",duplicate:"Duplicate",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"},es:{edit:"Editar",changeStatus:"Cambiar estado",changePriority:"Cambiar prioridad",assignUser:"Asignar usuario",duplicate:"Duplicar",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"}};var qm={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"}),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"})},ky=["name","status","priority","assignees","startDate","endDate","progress","tags"];function Jm({isOpen:e,onClose:t,columns:a,customFields:r=[],onColumnsChange:o,onCreateCustomField:s,isDark:n,locale:m}){let[g,i]=react.useState(""),p=react.useRef(null),l=m==="es"?Xm.es:Xm.en;if(react.useEffect(()=>{if(!e)return;let f=setTimeout(()=>{let u=c=>{p.current&&!p.current.contains(c.target)&&t();},x=c=>{c.key==="Escape"&&t();};document.addEventListener("mousedown",u),document.addEventListener("keydown",x),p._cleanup=()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",x);};},100);return ()=>{clearTimeout(f),p._cleanup&&p._cleanup();}},[e,t]),!e)return null;let b=f=>l.columns[f]||f,v=f=>{if(f==="name")return;let u=a.map(x=>x.id===f?{...x,visible:!x.visible}:x);o(u);},k=(f,u)=>{let x=a.find(N=>N.type===f&&(!u||N.customFieldId===u));if(x){v(x.id);return}let c={id:u||f,type:f,label:u?r.find(N=>N.id===u)?.name||f:b(f),width:120,visible:true,sortable:true,resizable:true,customFieldId:u};o([...a,c]);},C=ky.filter(f=>b(f).toLowerCase().includes(g.toLowerCase())),h=r.filter(f=>f.name.toLowerCase().includes(g.toLowerCase()));return jsxRuntime.jsxs("div",{ref:p,className:d("absolute right-0 top-full mt-1 w-72 rounded-lg shadow-xl border z-50",n?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:d("flex items-center justify-between px-4 py-3 border-b",n?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:d("font-medium",n?"text-white":"text-gray-900"),children:l.title}),jsxRuntime.jsx("button",{onClick:t,className:d("p-1 rounded",n?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.X,{className:d("w-4 h-4",n?"text-[#9CA3AF]":"text-gray-400")})})]}),jsxRuntime.jsx("div",{className:"p-3",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:d("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",n?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:g,onChange:f=>i(f.target.value),placeholder:l.searchPlaceholder,className:d("w-full pl-9 pr-3 py-2 text-sm rounded-lg border outline-none",n?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400")})]})}),jsxRuntime.jsxs("div",{className:"px-3 pb-2",children:[jsxRuntime.jsx("h4",{className:d("text-xs font-medium uppercase tracking-wider mb-2",n?"text-[#6B7280]":"text-gray-400"),children:l.standardFields}),jsxRuntime.jsx("div",{className:"space-y-1",children:C.map(f=>{let u=a.find(N=>N.type===f&&!N.customFieldId),x=u?.visible??false,c=f==="name";return jsxRuntime.jsxs("button",{onClick:()=>!c&&v(u?.id||f),disabled:c,className:d("w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",n?"hover:bg-white/10":"hover:bg-gray-100",c&&"opacity-50 cursor-not-allowed"),children:[jsxRuntime.jsx("div",{className:d("w-5 h-5 rounded border flex items-center justify-center",x?"bg-[#3B82F6] border-[#3B82F6]":n?"border-[#4B5563]":"border-gray-300"),children:x&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:n?"text-[#9CA3AF]":"text-gray-400",children:qm[f]}),jsxRuntime.jsx("span",{className:n?"text-white":"text-gray-900",children:b(f)})]},f)})})]}),h.length>0&&jsxRuntime.jsxs("div",{className:"px-3 pb-2",children:[jsxRuntime.jsx("h4",{className:d("text-xs font-medium uppercase tracking-wider mb-2",n?"text-[#6B7280]":"text-gray-400"),children:l.customFields}),jsxRuntime.jsx("div",{className:"space-y-1",children:h.map(f=>{let x=a.find(c=>c.customFieldId===f.id)?.visible??false;return jsxRuntime.jsxs("button",{onClick:()=>k(f.type,f.id),className:d("w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",n?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx("div",{className:d("w-5 h-5 rounded border flex items-center justify-center",x?"bg-[#3B82F6] border-[#3B82F6]":n?"border-[#4B5563]":"border-gray-300"),children:x&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:n?"text-[#9CA3AF]":"text-gray-400",children:qm[f.type]||jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"})}),jsxRuntime.jsx("span",{className:n?"text-white":"text-gray-900",children:f.name})]},f.id)})})]}),s&&jsxRuntime.jsx("div",{className:d("p-3 border-t",n?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:s,className:d("w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-colors",n?"bg-[#3B82F6]/20 text-[#3B82F6] hover:bg-[#3B82F6]/30":"bg-blue-50 text-blue-600 hover:bg-blue-100"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),l.createField]})})]})}var Xm={en:{title:"Columns",searchPlaceholder:"Search fields...",standardFields:"Standard Fields",customFields:"Custom Fields",createField:"Create custom field",columns:{name:"Name",status:"Status",priority:"Priority",assignees:"Assignees",startDate:"Start Date",endDate:"End Date",progress:"Progress",tags:"Tags",text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox"}},es:{title:"Columnas",searchPlaceholder:"Buscar campos...",standardFields:"Campos Est\xE1ndar",customFields:"Campos Personalizados",createField:"Crear campo personalizado",columns:{name:"Nombre",status:"Estado",priority:"Prioridad",assignees:"Asignados",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",tags:"Etiquetas",text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla"}}};var My=[{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 ep({isOpen:e,onClose:t,onSave:a,isDark:r,locale:o}){let[s,n]=react.useState(""),[m,g]=react.useState("text"),[i,p]=react.useState([""]),l=o==="es"?Qm.es:Qm.en;react.useEffect(()=>{e&&(n(""),g("text"),p([""]));},[e]),react.useEffect(()=>{let h=f=>{f.key==="Escape"&&t();};return e&&document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,t]);let b=()=>{if(!s.trim())return;let h={name:s.trim(),type:m};m==="dropdown"&&(h.options=i.filter(f=>f.trim())),a(h),t();},v=()=>{p([...i,""]);},k=(h,f)=>{let u=[...i];u[h]=f,p(u);},C=h=>{i.length>1&&p(i.filter((f,u)=>u!==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:d("relative w-full max-w-md rounded-xl shadow-2xl",r?"bg-[#1F2937]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:d("flex items-center justify-between px-6 py-4 border-b",r?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h2",{className:d("text-lg font-semibold",r?"text-white":"text-gray-900"),children:l.title}),jsxRuntime.jsx("button",{onClick:t,className:d("p-1 rounded",r?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.X,{className:d("w-5 h-5",r?"text-[#9CA3AF]":"text-gray-400")})})]}),jsxRuntime.jsxs("div",{className:"p-6 space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:d("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:l.fieldName}),jsxRuntime.jsx("input",{type:"text",value:s,onChange:h=>n(h.target.value),placeholder:l.fieldNamePlaceholder,className:d("w-full px-4 py-2.5 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400"),autoFocus:true})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:d("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:l.fieldType}),jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-2",children:My.map(h=>jsxRuntime.jsxs("button",{onClick:()=>g(h.type),className:d("flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors",m===h.type?"border-[#3B82F6] bg-[#3B82F6]/10":r?"border-white/10 hover:border-white/20":"border-gray-200 hover:border-gray-300"),children:[jsxRuntime.jsx("span",{className:m===h.type?"text-[#3B82F6]":r?"text-[#9CA3AF]":"text-gray-400",children:h.icon}),jsxRuntime.jsx("span",{className:d("text-xs",m===h.type?"text-[#3B82F6]":r?"text-[#9CA3AF]":"text-gray-500"),children:l.types[h.type]})]},h.type))})]}),m==="dropdown"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:d("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:l.options}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[i.map((h,f)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"text",value:h,onChange:u=>k(f,u.target.value),placeholder:`${l.option} ${f+1}`,className:d("flex-1 px-3 py-2 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400")}),i.length>1&&jsxRuntime.jsx("button",{onClick:()=>C(f),className:d("p-2 rounded-lg transition-colors",r?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},f)),jsxRuntime.jsxs("button",{onClick:v,className:d("flex items-center gap-2 px-3 py-2 text-sm rounded-lg transition-colors",r?"text-[#3B82F6] hover:bg-white/10":"text-blue-600 hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),l.addOption]})]})]})]}),jsxRuntime.jsxs("div",{className:d("flex items-center justify-end gap-3 px-6 py-4 border-t",r?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("button",{onClick:t,className:d("px-4 py-2 text-sm font-medium rounded-lg transition-colors",r?"text-[#9CA3AF] hover:bg-white/10":"text-gray-600 hover:bg-gray-100"),children:l.cancel}),jsxRuntime.jsx("button",{onClick:b,disabled:!s.trim(),className:d("px-4 py-2 text-sm font-medium rounded-lg transition-colors","bg-[#3B82F6] text-white hover:bg-[#2563EB]",!s.trim()&&"opacity-50 cursor-not-allowed"),children:l.create})]})]})]}):null}var Qm={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 Wy=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:120,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 rp(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(...rp(r.subtasks,t+1));return a}function Gy({status:e,progress:t}){return t===100||e==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-5 h-5 text-green-500"}):t&&t>0||e==="in-progress"?jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-5 h-5 text-blue-500"}):jsxRuntime.jsx(lucideReact.Circle,{className:"w-5 h-5 text-gray-400"})}function op({tasks:e,config:t={},callbacks:a={},isLoading:r=false,error:o,className:s,style:n,availableUsers:m=[],customFields:g=[]}){let{theme:i="dark",locale:p="en",customTranslations:l,showSearch:b=true,showHierarchy:v=true,tableColumns:k,allowColumnCustomization:C=true,allowColumnResize:h=true,enableContextMenu:f=true}=t,u=ns(p,l),x=i==="dark",[c,N]=react.useState("startDate"),[w,B]=react.useState("asc"),[y,I]=react.useState(""),[P,T]=react.useState(k||Wy),[W,O]=react.useState(false),[q,te]=react.useState(false),[ne,oe]=react.useState({isOpen:false,x:0,y:0,type:"task"}),[ce,be]=react.useState(null),[Le,A]=react.useState(0),[R,L]=react.useState(0),j=react.useRef(null);react.useEffect(()=>{k&&T(k);},[k]);let X=react.useMemo(()=>{let G=new Set;function ae(xe){for(let Oe of xe)Oe.subtasks?.length&&(Oe.isExpanded!==false&&G.add(Oe.id),ae(Oe.subtasks));}return ae(e),G},[e]),z=react.useMemo(()=>P.filter(G=>G.visible),[P]),ve=react.useCallback(G=>{a.onTaskToggleExpand?.(G);},[a]),se=react.useCallback(G=>{c===G?B(ae=>ae==="asc"?"desc":"asc"):(N(G),B("asc")),a.onSortChange?.({column:G,direction:w==="asc"?"desc":"asc"});},[c,w,a]),Ie=react.useCallback(G=>{T(G),a.onColumnsChange?.(G);},[a]),qe=react.useCallback(G=>{let ae=P.map(xe=>xe.id===G?{...xe,visible:false}:xe);Ie(ae);},[P,Ie]),Qe=react.useCallback((G,ae)=>{N(G),B(ae);},[]),ie=react.useCallback((G,ae,xe)=>{f&&(G.preventDefault(),oe({isOpen:true,x:G.clientX,y:G.clientY,type:ae?"task":"header",task:ae,columnId:xe}));},[f]),Xe=react.useCallback(()=>{oe(G=>({...G,isOpen:false}));},[]),lt=react.useCallback((G,ae)=>{if(!h)return;G.preventDefault(),G.stopPropagation();let xe=P.find(Oe=>Oe.id===ae);xe&&(be(ae),A(G.clientX),L(xe.width));},[P,h]);react.useEffect(()=>{if(!ce)return;let G=xe=>{let Oe=xe.clientX-Le,ye=Math.max(50,R+Oe),it=P.map(Ue=>Ue.id===ce?{...Ue,width:ye}:Ue);T(it);},ae=()=>{ce&&a.onColumnsChange?.(P),be(null);};return document.addEventListener("mousemove",G),document.addEventListener("mouseup",ae),()=>{document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",ae);}},[ce,Le,R,P,a]);let kt=react.useCallback(async G=>{if(a.onCreateCustomField){let ae={...G,id:`cf_${Date.now()}`,projectId:""};await a.onCreateCustomField(ae);}te(false);},[a]),yt=react.useMemo(()=>{let G=rp(e);if(y.trim()){let ae=y.toLowerCase();G=G.filter(xe=>xe.name.toLowerCase().includes(ae));}return G.sort((ae,xe)=>{let Oe,ye;switch(c){case "name":Oe=ae.name.toLowerCase(),ye=xe.name.toLowerCase();break;case "startDate":Oe=ae.startDate?.getTime()||0,ye=xe.startDate?.getTime()||0;break;case "endDate":Oe=ae.endDate?.getTime()||0,ye=xe.endDate?.getTime()||0;break;case "progress":Oe=ae.progress||0,ye=xe.progress||0;break;case "status":Oe=ae.status||"todo",ye=xe.status||"todo";break;case "priority":let it={urgent:0,high:1,medium:2,low:3,none:4};Oe=it[ae.priority]??4,ye=it[xe.priority]??4;break;default:return 0}return Oe<ye?w==="asc"?-1:1:Oe>ye?w==="asc"?1:-1:0}),G},[e,y,c,w]),$=react.useCallback((G,ae)=>{let xe=it=>{a.onTaskUpdate?.({...G,...it});},Oe=it=>it?G.customFields?.find(wt=>wt.fieldId===it)?.value:void 0,ye=(it,Ue)=>{if(!it)return;let ut=[...G.customFields||[]],Bt=ut.findIndex(jt=>jt.fieldId===it);Bt>=0?ut[Bt]={fieldId:it,value:Ue}:ut.push({fieldId:it,value:Ue}),xe({customFields:ut});};switch(ae.type){case "name":return null;case "status":return jsxRuntime.jsx(wm,{value:G.status||(G.progress===100?"completed":G.progress&&G.progress>0?"in-progress":"todo"),onChange:Ue=>{xe({status:Ue,progress:Ue==="completed"?100:Ue==="in-progress"?50:0});},isDark:x,locale:p,translations:u.status});case "priority":return jsxRuntime.jsx(Tm,{value:G.priority,onChange:Ue=>xe({priority:Ue}),isDark:x,locale:p});case "assignees":return jsxRuntime.jsx(Dm,{value:G.assignees||[],availableUsers:m,onChange:Ue=>xe({assignees:Ue}),isDark:x,locale:p});case "startDate":return jsxRuntime.jsx(cs,{value:G.startDate,onChange:Ue=>xe({startDate:Ue}),isDark:x,locale:p});case "endDate":return jsxRuntime.jsx(cs,{value:G.endDate,onChange:Ue=>xe({endDate:Ue}),isDark:x,locale:p});case "progress":return jsxRuntime.jsx(Mm,{value:G.progress||0,onChange:Ue=>{let wt=Ue===100?"completed":Ue>0?"in-progress":"todo";xe({progress:Ue,status:wt});},isDark:x});case "tags":return jsxRuntime.jsx(Wm,{value:G.tags||[],isDark:x});case "text":return jsxRuntime.jsx(Lm,{value:Oe(ae.customFieldId)||"",onChange:Ue=>ye(ae.customFieldId,Ue),isDark:x});case "number":return jsxRuntime.jsx(Rm,{value:Oe(ae.customFieldId)||0,onChange:Ue=>ye(ae.customFieldId,Ue),isDark:x});case "date":let it=Oe(ae.customFieldId);return jsxRuntime.jsx(cs,{value:it?new Date(it):void 0,onChange:Ue=>ye(ae.customFieldId,Ue),isDark:x,locale:p});case "dropdown":return jsxRuntime.jsx(Om,{value:Oe(ae.customFieldId)||"",options:ae.options||[],onChange:Ue=>ye(ae.customFieldId,Ue),isDark:x});case "checkbox":return jsxRuntime.jsx(Um,{value:Oe(ae.customFieldId)||false,onChange:Ue=>ye(ae.customFieldId,Ue),isDark:x});default:return jsxRuntime.jsx("span",{className:d("text-sm",x?"text-[#94A3B8]":"text-gray-500"),children:"-"})}},[a,x,p,m,u]),fe=react.useCallback(G=>({name:u.columns.name,status:u.columns.status,priority:u.columns.priority,assignees:u.columns.assignees,startDate:u.columns.startDate,endDate:u.columns.endDate,progress:u.columns.progress})[G.type]||G.label,[u]),Ae=react.useMemo(()=>z.reduce((G,ae)=>G+ae.width,0)+(C?48:0),[z,C]);return r?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",x?"bg-[#0F1117]":"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-[#3B82F6]"}),jsxRuntime.jsxs("p",{className:d("text-sm",x?"text-[#9CA3AF]":"text-gray-600"),children:[u.empty.noTasks,"..."]})]})}):o?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",x?"bg-[#0F1117]":"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:d("text-lg font-semibold mb-2",x?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:d("text-sm",x?"text-[#9CA3AF]":"text-gray-600"),children:typeof o=="string"?o:o.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",x?"bg-[#0F1117]":"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-[#3B82F6]/10 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.List,{className:"w-8 h-8 text-[#3B82F6]"})}),jsxRuntime.jsx("h3",{className:d("text-lg font-semibold mb-2",x?"text-white":"text-gray-900"),children:u.empty.noTasks}),jsxRuntime.jsx("p",{className:d("text-sm",x?"text-[#9CA3AF]":"text-gray-600"),children:u.empty.addFirstTask})]})}):jsxRuntime.jsxs("div",{ref:j,className:d("flex-1 flex flex-col w-full h-full overflow-hidden",x?"bg-[#0F1117]":"bg-white",ce&&"select-none",s),style:n,children:[jsxRuntime.jsx("div",{className:d("flex-shrink-0 px-6 py-4 border-b",x?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[b&&jsxRuntime.jsxs("div",{className:"relative flex-1 max-w-md",children:[jsxRuntime.jsx(lucideReact.Search,{className:d("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",x?"text-[#9CA3AF]":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:y,onChange:G=>I(G.target.value),placeholder:u.toolbar.searchPlaceholder,className:d("w-full h-9 pl-10 pr-4 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",x?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-100 border-gray-200 text-gray-900 placeholder:text-gray-400")})]}),jsxRuntime.jsxs("div",{className:d("text-sm",x?"text-[#9CA3AF]":"text-gray-600"),children:[yt.length," ",u.pagination.tasks]})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-auto",children:jsxRuntime.jsxs("div",{style:{minWidth:Ae},children:[jsxRuntime.jsxs("div",{className:d("flex-shrink-0 flex items-center border-b text-xs font-medium uppercase tracking-wider sticky top-0 z-10",x?"border-white/10 bg-[#0F1117]":"border-gray-200 bg-gray-50"),children:[z.map(G=>jsxRuntime.jsxs("div",{className:d("relative flex items-center gap-2 px-4 py-3",x?"text-[#9CA3AF]":"text-gray-500"),style:{width:G.width,minWidth:G.minWidth},onContextMenu:ae=>ie(ae,void 0,G.id),children:[G.sortable?jsxRuntime.jsxs("button",{onClick:()=>se(G.id),className:"flex items-center gap-1 hover:text-[#3B82F6]",children:[fe(G),jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:d("w-3 h-3",c===G.id&&"text-[#3B82F6]")})]}):jsxRuntime.jsx("span",{children:fe(G)}),h&&G.resizable&&jsxRuntime.jsx("div",{className:d("absolute right-0 top-0 bottom-0 w-1 cursor-col-resize group","hover:bg-[#3B82F6]",ce===G.id&&"bg-[#3B82F6]"),onMouseDown:ae=>lt(ae,G.id)})]},G.id)),C&&jsxRuntime.jsxs("div",{className:"relative flex items-center justify-center px-3 py-3",children:[jsxRuntime.jsx("button",{onClick:G=>{G.stopPropagation(),O(ae=>!ae);},className:d("p-1.5 rounded-lg transition-colors",x?"hover:bg-white/10 text-[#9CA3AF] hover:text-white":"hover:bg-gray-200 text-gray-400 hover:text-gray-600",W&&(x?"bg-white/10":"bg-gray-200")),title:p==="es"?"Agregar columna":"Add column",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"})}),jsxRuntime.jsx(Jm,{isOpen:W,onClose:()=>O(false),columns:P,customFields:g,onColumnsChange:Ie,onCreateCustomField:()=>{O(false),te(true);},isDark:x,locale:p})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:yt.map((G,ae)=>{let xe=X.has(G.id);return jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{delay:ae*.02},className:d("flex items-center border-b transition-colors",x?"border-white/5 hover:bg-white/5":"border-gray-100 hover:bg-gray-50"),onClick:()=>a.onTaskClick?.(G),onDoubleClick:()=>a.onTaskDoubleClick?.(G),onContextMenu:Oe=>ie(Oe,G),children:[z.map(Oe=>jsxRuntime.jsx("div",{className:"flex items-center px-4 py-3 min-h-[52px]",style:{width:Oe.width,minWidth:Oe.minWidth},children:Oe.type==="name"?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 min-w-0 w-full",children:[v&&G.level>0&&jsxRuntime.jsx("div",{style:{width:`${G.level*24}px`},className:"flex-shrink-0"}),v&&G.hasChildren&&jsxRuntime.jsx("button",{onClick:ye=>{ye.stopPropagation(),ve(G.id);},className:d("p-0.5 rounded flex-shrink-0",x?"hover:bg-white/10":"hover:bg-gray-200"),children:xe?jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-4 h-4",x?"text-[#9CA3AF]":"text-gray-400")}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:d("w-4 h-4",x?"text-[#9CA3AF]":"text-gray-400")})}),v&&!G.hasChildren&&jsxRuntime.jsx("div",{className:"w-5 flex-shrink-0"}),jsxRuntime.jsx("button",{onClick:ye=>{ye.stopPropagation(),a.onTaskUpdate?.({...G,progress:G.progress===100?0:100,status:G.progress===100?"todo":"completed"});},className:"flex-shrink-0",children:jsxRuntime.jsx(Gy,{status:G.status,progress:G.progress})}),jsxRuntime.jsx("span",{className:d("truncate font-medium",x?"text-white":"text-gray-900",G.progress===100&&(x?"line-through text-[#6B7280]":"line-through text-gray-400")),children:G.name})]}):$(G,Oe)},Oe.id)),C&&jsxRuntime.jsx("div",{className:"w-12 flex-shrink-0"})]},G.id)})}),yt.length===0&&y&&jsxRuntime.jsx("div",{className:"flex items-center justify-center py-12",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(lucideReact.List,{className:d("w-12 h-12 mx-auto mb-4",x?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("p",{className:d(x?"text-[#9CA3AF]":"text-gray-600"),children:u.empty.noResults})]})})]})}),jsxRuntime.jsx(jm,{state:ne,onClose:Xe,isDark:x,locale:p,onTaskEdit:a.onTaskEdit,onTaskDuplicate:a.onTaskDuplicate,onTaskDelete:a.onTaskDelete,onTaskUpdate:a.onTaskUpdate,onColumnHide:qe,onColumnSort:Qe,availableUsers:m}),jsxRuntime.jsx(ep,{isOpen:q,onClose:()=>te(false),onSave:kt,isDark:x,locale:p})]})}var np=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:120,visible:true,sortable:true,resizable:true},{id:"priority",type:"priority",label:"Priority",width:100,visible:false,sortable:true,resizable:true},{id:"assignees",type:"assignees",label:"Assignees",width:150,visible:false,sortable:false,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}],sp=[{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"}],ip=[{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 dl={bgPrimary:"#0d1117",bgSecondary:"#161b22",bgHover:"#21262d",bgSelected:"#1f6feb20",bgAlternate:"#0d111780",border:"#30363d",borderLight:"#21262d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681",accent:"#58a6ff",accentHover:"#79b8ff",accentLight:"#58a6ff20",statusTodo:"#8b949e",statusInProgress:"#f0883e",statusCompleted:"#3fb950",focusRing:"#58a6ff",checkboxBg:"#21262d",checkboxChecked:"#58a6ff"},cl={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"},ml={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"},us={dark:dl,light:cl,neutral:ml};function lp(e){return us[e]||us.dark}var pl={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"},tooltips:{progress:"Progress",status:"Status",assignees:"Assignees",duration:"Duration",days:"days"}},ul={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"},tooltips:{progress:"Progreso",status:"Estado",assignees:"Asignados",duration:"Duraci\xF3n",days:"d\xEDas"}},gs={en:pl,es:ul};function nn(e){return gs[e]||gs.en}function fs(e,t){let a=nn(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 dp(e){let t=nn(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 cp(e,t=0,a=true){let r=nn(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 lv(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 vl(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 fp({task:e}){return e.progress===100||e.status==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-green-500 flex-shrink-0"}):e.progress&&e.progress>0||e.status==="in-progress"?jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-3 h-3 text-blue-500 flex-shrink-0"}):jsxRuntime.jsx(lucideReact.Circle,{className:"w-3 h-3 text-gray-400 flex-shrink-0"})}function hp({tasks:e,config:t={},callbacks:a={},initialDate:r,isLoading:o=false,error:s,className:n,style:m,availableTags:g=[],onCreateTag:i,attachmentsByTask:p,comments:l,onAddComment:b,currentUser:v,mentionableUsers:k,onTaskOpen:C}){let{theme:h="dark",locale:f="en",customTranslations:u}=t,x=fs(f,u),c=h==="dark",N={textTertiary:c?"#6B7280":"#9CA3AF",textSecondary:c?"#9CA3AF":"#6B7280",textPrimary:c?"#FFFFFF":"#111827",borderLight:c?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",border:c?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",bgPrimary:c?"#1A1D25":"#FFFFFF",bgSecondary:c?"#0F1117":"#F9FAFB",hoverBg:c?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)"},[w,B]=react.useState(r||new Date),[y,I]=react.useState(null),[P,T]=react.useState(null),[W,O]=react.useState(null),[q,te]=react.useState(new Date),[ne,oe]=react.useState({}),ce=4,be=3,[Le,A]=react.useState(false),[R,L]=react.useState(false),[j,X]=react.useState(false),[z,ve]=react.useState(false),[se,Ie]=react.useState(null),[qe,Qe]=react.useState(""),[ie,Xe]=react.useState(void 0),[lt,kt]=react.useState(null),[yt,$]=react.useState(false),[fe,Ae]=react.useState(false),[G,ae]=react.useState(null),[xe,Oe]=react.useState(false),[ye,it]=react.useState(new Date),[Ue,wt]=react.useState(false),[ut,Bt]=react.useState(false),[jt,Se]=react.useState(false),[Ve,ua]=react.useState(""),[Ze,Ke]=react.useState(false),[F,Te]=react.useState(""),[Z,ke]=react.useState(false),Ce=react.useCallback(()=>{B(new Date(w.getFullYear(),w.getMonth()-1,1));},[w]),$e=react.useCallback(()=>{B(new Date(w.getFullYear(),w.getMonth()+1,1));},[w]),Be=react.useCallback(()=>{B(new Date);},[]),st=react.useMemo(()=>{let M=w.getFullYear(),V=w.getMonth(),Me=new Date(M,V,1),Ye=new Date(M,V+1,0),Pt=Me.getDay(),de=Ye.getDate(),We=lv(e),vt=new Date;vt.setHours(0,0,0,0);let Re=[],gt=Pt,va=new Date(M,V,0).getDate();for(let Kt=gt-1;Kt>=0;Kt--){let je=new Date(M,V-1,va-Kt);Re.push({date:je,isCurrentMonth:false,isToday:false,isWeekend:je.getDay()===0||je.getDay()===6,events:We.filter(Yt=>vl(je,Yt)).map(Yt=>({id:Yt.id,title:Yt.name,start:Yt.startDate,end:Yt.endDate,task:Yt}))});}for(let Kt=1;Kt<=de;Kt++){let je=new Date(M,V,Kt),Yt=je.getTime()===vt.getTime();Re.push({date:je,isCurrentMonth:true,isToday:Yt,isWeekend:je.getDay()===0||je.getDay()===6,events:We.filter(ga=>vl(je,ga)).map(ga=>({id:ga.id,title:ga.name,start:ga.startDate,end:ga.endDate,task:ga}))});}let wa=42-Re.length;for(let Kt=1;Kt<=wa;Kt++){let je=new Date(M,V+1,Kt);Re.push({date:je,isCurrentMonth:false,isToday:false,isWeekend:je.getDay()===0||je.getDay()===6,events:We.filter(Yt=>vl(je,Yt)).map(Yt=>({id:Yt.id,title:Yt.name,start:Yt.startDate,end:Yt.endDate,task:Yt}))});}return Re},[w,e]),U=f==="es"?["Dom","Lun","Mar","Mi\xE9","Jue","Vie","S\xE1b"]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Y=w.toLocaleDateString(f==="es"?"es-ES":"en-US",{month:"long",year:"numeric"}),pe=react.useCallback((M,V)=>{if(!y)return;let Me={...y,[M]:V};I(Me),a.onTaskUpdate?.(Me);},[y,a]),_e=react.useCallback(M=>{if(!y)return;let V=y.progress||0;M==="completed"?V=100:M==="todo"&&(V=0);let Me={...y,status:M,progress:V};I(Me),a.onTaskUpdate?.(Me),A(false);},[y,a]),ze=react.useCallback((M,V)=>{if(!y)return;let Me={...y,startDate:M,endDate:V};I(Me),a.onTaskUpdate?.(Me);},[y,a]),H=react.useCallback(()=>{A(false),L(false),X(false),O(null),Se(false),ua(""),Ke(false);},[]),le=react.useCallback(async M=>{if(M.preventDefault(),M.stopPropagation(),wt(false),!y||!a.onUploadAttachments)return;let V=Array.from(M.dataTransfer.files);if(V.length!==0){Bt(true);try{await a.onUploadAttachments(y.id,V);}finally{Bt(false);}}},[y,a]),He=react.useCallback(async M=>{if(!y||!a.onUploadAttachments||!M.target.files)return;let V=Array.from(M.target.files);if(V.length!==0){Bt(true);try{await a.onUploadAttachments(y.id,V);}finally{Bt(false);}M.target.value="";}},[y,a]),Ft=react.useCallback(M=>{M.preventDefault(),M.stopPropagation(),wt(true);},[]),rt=react.useCallback(M=>{M.preventDefault(),M.stopPropagation(),wt(false);},[]),ya=react.useCallback(M=>M<1024?`${M} B`:M<1024*1024?`${(M/1024).toFixed(1)} KB`:`${(M/(1024*1024)).toFixed(1)} MB`,[]),$a=react.useCallback(M=>M.startsWith("image/")?lucideReact.Image:M.includes("pdf")||M.includes("document")?lucideReact.FileText:lucideReact.File,[]),ct=react.useMemo(()=>!y||!p?[]:p.get(y.id)||[],[y,p]);return o?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",c?"bg-[#0F1117]":"bg-white",n),style:m,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-[#3B82F6]"}),jsxRuntime.jsxs("p",{className:d("text-sm",c?"text-[#9CA3AF]":"text-gray-600"),children:[x.labels.noEvents,"..."]})]})}):s?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",c?"bg-[#0F1117]":"bg-white",n),style:m,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:d("text-lg font-semibold mb-2",c?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:d("text-sm",c?"text-[#9CA3AF]":"text-gray-600"),children:typeof s=="string"?s:s.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",c?"bg-[#0F1117]":"bg-white",n),style:m,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-[#3B82F6]/10 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-8 h-8 text-[#3B82F6]"})}),jsxRuntime.jsx("h3",{className:d("text-lg font-semibold mb-2",c?"text-white":"text-gray-900"),children:x.labels.noEvents}),jsxRuntime.jsx("p",{className:d("text-sm",c?"text-[#9CA3AF]":"text-gray-600"),children:x.labels.newTask})]})}):jsxRuntime.jsxs("div",{className:d("flex-1 flex flex-col w-full h-full overflow-auto",c?"bg-[#0F1117]":"bg-white",n),style:m,children:[jsxRuntime.jsx("div",{className:d("flex-shrink-0 px-6 py-4 border-b",c?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx("h2",{className:d("text-xl font-semibold capitalize",c?"text-white":"text-gray-900"),children:Y}),jsxRuntime.jsx("button",{onClick:Be,className:d("px-3 py-1.5 text-sm rounded-lg transition-colors",c?"bg-white/5 text-white hover:bg-white/10":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:x.navigation.today})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("button",{onClick:Ce,className:d("p-2 rounded-lg transition-colors",c?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:d("w-5 h-5",c?"text-[#9CA3AF]":"text-gray-600")})}),jsxRuntime.jsx("button",{onClick:$e,className:d("p-2 rounded-lg transition-colors",c?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:d("w-5 h-5",c?"text-[#9CA3AF]":"text-gray-600")})})]})]})}),jsxRuntime.jsx("div",{className:"flex-1 p-6 min-h-0",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-px mb-2",children:U.map(M=>jsxRuntime.jsx("div",{className:d("py-2 text-center text-xs font-medium uppercase",c?"text-[#9CA3AF]":"text-gray-500"),children:M},M))}),jsxRuntime.jsx("div",{className:d("grid grid-cols-7 auto-rows-min gap-px rounded-lg",c?"bg-[#2D2D2D]":"bg-gray-300"),children:st.map((M,V)=>{let Me=M.date.getDay()===0||M.date.getDay()===6;return jsxRuntime.jsxs("div",{className:d("min-h-[120px] p-2 transition-colors flex flex-col relative group",c?Me?"bg-[#1C1F26]":M.isCurrentMonth?"bg-[#13161B]":"bg-[#0D0F13]":Me?"bg-gray-100":M.isCurrentMonth?"bg-white":"bg-gray-50",M.isToday&&"ring-2 ring-[#3B82F6] ring-inset"),children:[(()=>{let Ye=ne[V]||ce,Pt=M.events.slice(0,Ye),de=M.events.length-Ye;return jsxRuntime.jsxs("div",{className:"space-y-1 flex-1",children:[Pt.map(We=>jsxRuntime.jsx("div",{className:"relative group",children:jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{I(We.task),a.onEventClick?.(We),C?.(We.task.id);},whileHover:{scale:1.02},className:d("w-full flex items-center gap-1 px-1.5 py-0.5 rounded text-xs truncate",We.task.progress===100?c?"bg-green-500/20 text-green-400":"bg-green-500/10 text-green-600":c?"bg-[#3B82F6]/20 text-[#3B82F6]":"bg-[#3B82F6]/10 text-[#3B82F6]"),children:[jsxRuntime.jsx(fp,{task:We.task}),jsxRuntime.jsx("span",{className:"truncate",children:We.title})]})},We.id)),de>0&&jsxRuntime.jsxs("button",{onClick:We=>{We.stopPropagation(),oe(vt=>({...vt,[V]:Ye+be}));},className:d("text-xs px-1.5 py-0.5 hover:underline cursor-pointer font-medium",c?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-600"),children:["+",de," ",f==="es"?"M\xC1S":"MORE"]}),Ye>ce&&M.events.length>ce&&jsxRuntime.jsx("button",{onClick:We=>{We.stopPropagation(),oe(vt=>({...vt,[V]:ce}));},className:d("text-xs px-1.5 py-0.5 hover:underline cursor-pointer font-medium",c?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-600"),children:f==="es"?"MENOS":"LESS"})]})})(),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-1",children:[(()=>{let Ye=V>=28,Pt=V%7>=5;return jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:de=>{de.stopPropagation(),se===V?Ie(null):(Ie(V),Qe(""),Xe(void 0),kt(null),ae(null),$(false),Ae(false),Oe(false),it(M.date));},className:d("w-5 h-5 rounded flex items-center justify-center transition-all",se===V?"opacity-100 bg-[#7C3AED] text-white":"opacity-0 group-hover:opacity-100",c?"hover:bg-[#7C3AED] text-[#6B7280] hover:text-white":"hover:bg-[#7C3AED] text-gray-400 hover:text-white"),children:jsxRuntime.jsx(lucideReact.Plus,{className:d("w-3.5 h-3.5 transition-transform",se===V&&"rotate-45")})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:se===V&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>{Ie(null),Qe(""),Xe(void 0),kt(null),ae(null),$(false),Ae(false),Oe(false);}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:Ye?-5:5,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:Ye?-5:5,scale:.95},transition:{duration:.12},className:d("absolute w-[320px] rounded-lg shadow-2xl z-50",Ye?"bottom-full mb-1":"top-full mt-1",Pt?"right-0":"left-0",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:de=>{de.stopPropagation(),$(false),Ae(false),Oe(false);},children:[jsxRuntime.jsx("div",{className:"p-2.5",children:jsxRuntime.jsx("input",{type:"text",value:qe,onChange:de=>Qe(de.target.value),placeholder:f==="es"?'Escribe el nombre de la tarea o "/" para los comandos':'Type task name or "/" for commands',className:d("w-full bg-transparent text-sm outline-none placeholder:opacity-40",c?"text-white":"text-gray-900"),autoFocus:true,onKeyDown:de=>{if(de.key==="Enter"&&qe.trim()){let We=t.availableUsers?.find(Re=>Re.id===lt),vt=G||M.date;a.onTaskCreate?.({name:qe.trim(),startDate:vt,endDate:vt,priority:ie,assignees:We?[We]:void 0}),Qe(""),Xe(void 0),kt(null),ae(null),Ie(null);}de.key==="Escape"&&(Ie(null),Qe(""),Xe(void 0),kt(null),ae(null));}})}),jsxRuntime.jsxs("div",{className:d("px-2.5 py-2 flex items-center justify-between border-t",c?"border-white/10":"border-gray-100"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:de=>{de.stopPropagation(),$(!yt),Ae(false);},className:d("p-1 rounded transition-colors",ie?ie==="urgent"||ie==="high"?"text-red-400 bg-red-500/20":ie==="medium"?"text-yellow-400 bg-yellow-500/20":"text-green-400 bg-green-500/20":c?"hover:bg-white/10 text-[#6B7280]":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:yt&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-0 bottom-full mb-1 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[120px]",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:de=>de.stopPropagation(),children:[{id:"urgent",label:f==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:f==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:f==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:f==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:f==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(de=>jsxRuntime.jsxs("button",{onClick:()=>{Xe(de.id),$(false);},className:d("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",c?"hover:bg-white/5":"hover:bg-gray-50",ie===de.id&&(c?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:d("w-2 h-2 rounded-full",de.color)}),jsxRuntime.jsx("span",{className:c?"text-white":"text-gray-900",children:de.label})]},de.id||"none"))})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs("button",{onClick:de=>{de.stopPropagation(),Oe(!xe),$(false),Ae(false),it(G||M.date);},className:d("flex items-center gap-1 text-xs px-1.5 py-0.5 rounded transition-colors",G?"bg-[#7C3AED]/20 text-[#7C3AED]":c?"bg-white/5 text-[#9CA3AF] hover:bg-white/10":"bg-gray-100 text-gray-500 hover:bg-gray-200"),children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:"w-3 h-3"}),(G||M.date).toLocaleDateString(f==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:xe&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-0 bottom-full mb-1 z-[60] rounded-xl shadow-2xl overflow-hidden flex",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:de=>de.stopPropagation(),children:[jsxRuntime.jsx("div",{className:d("w-40 py-2 border-r",c?"border-white/10":"border-gray-200"),children:(()=>{let de=new Date,We=new Date(de);We.setDate(de.getDate()+1);let vt=new Date(de);vt.setDate(de.getDate()+((6-de.getDay()+7)%7||7));let Re=new Date(de);Re.setDate(de.getDate()+((1-de.getDay()+7)%7||7));let gt=new Date(de);gt.setDate(de.getDate()+14);let va=new Date(de);return va.setDate(de.getDate()+28),[{label:f==="es"?"Hoy":"Today",date:de,display:de.toLocaleDateString(f==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:f==="es"?"Ma\xF1ana":"Tomorrow",date:We,display:We.toLocaleDateString(f==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:f==="es"?"Este fin de semana":"This weekend",date:vt,display:f==="es"?"s\xE1b.":"sat."},{label:f==="es"?"Pr\xF3xima semana":"Next week",date:Re,display:f==="es"?"lun.":"mon."},{label:f==="es"?"2 semanas":"2 weeks",date:gt,display:gt.toLocaleDateString(f==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:f==="es"?"4 semanas":"4 weeks",date:va,display:va.toLocaleDateString(f==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}].map((Kt,je)=>jsxRuntime.jsxs("button",{className:d("w-full flex items-center justify-between px-3 py-1.5 text-xs transition-colors",c?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{ae(Kt.date),Oe(false);},children:[jsxRuntime.jsx("span",{children:Kt.label}),jsxRuntime.jsx("span",{className:d("text-[10px]",c?"text-[#6B7280]":"text-gray-400"),children:Kt.display})]},je))})()}),jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("span",{className:d("text-xs font-medium",c?"text-white":"text-gray-900"),children:ye.toLocaleDateString(f==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{onClick:()=>it(new Date),className:d("px-1.5 py-0.5 rounded text-[10px] transition-colors",c?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:f==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>it(new Date(ye.getFullYear(),ye.getMonth()-1)),className:d("p-0.5 rounded",c?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{onClick:()=>it(new Date(ye.getFullYear(),ye.getMonth()+1)),className:d("p-0.5 rounded",c?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:(f==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(de=>jsxRuntime.jsx("div",{className:d("w-6 h-6 flex items-center justify-center text-[10px]",c?"text-[#6B7280]":"text-gray-400"),children:de},de))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let de=ye.getFullYear(),We=ye.getMonth(),vt=new Date(de,We,1).getDay(),Re=new Date(de,We+1,0).getDate(),gt=new Date(de,We,0).getDate(),va=new Date,wa=[];for(let je=vt-1;je>=0;je--)wa.push({dayNum:gt-je,isCurrentMonth:false,date:new Date(de,We-1,gt-je)});for(let je=1;je<=Re;je++)wa.push({dayNum:je,isCurrentMonth:true,date:new Date(de,We,je)});let Kt=42-wa.length;for(let je=1;je<=Kt;je++)wa.push({dayNum:je,isCurrentMonth:false,date:new Date(de,We+1,je)});return wa.map((je,Yt)=>{let ga=je.date.toDateString()===va.toDateString(),Ar=(G||M.date).toDateString()===je.date.toDateString();return jsxRuntime.jsx("button",{className:d("w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors",!je.isCurrentMonth&&(c?"text-[#4B5563]":"text-gray-300"),je.isCurrentMonth&&(c?"text-white":"text-gray-900"),ga&&"ring-1 ring-[#3B82F6]",Ar&&"bg-[#7C3AED] text-white",!Ar&&(c?"hover:bg-white/10":"hover:bg-gray-100")),onClick:()=>{ae(je.date),Oe(false);},children:je.dayNum},Yt)})})()})]})]})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:de=>{de.stopPropagation(),Ae(!fe),$(false);},className:d("p-1 rounded transition-colors",lt?"text-[#7C3AED] bg-[#7C3AED]/20":c?"hover:bg-white/10 text-[#6B7280]":"hover:bg-gray-100 text-gray-400"),children:lt?jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center text-white text-[8px] font-medium",style:{backgroundColor:t.availableUsers?.find(de=>de.id===lt)?.color||"#7C3AED"},children:t.availableUsers?.find(de=>de.id===lt)?.initials||t.availableUsers?.find(de=>de.id===lt)?.name?.slice(0,2).toUpperCase()}):jsxRuntime.jsx(lucideReact.User,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:fe&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-0 bottom-full mb-1 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[160px] max-h-[200px] overflow-y-auto",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:de=>de.stopPropagation(),children:[jsxRuntime.jsxs("button",{onClick:()=>{kt(null),Ae(false);},className:d("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",c?"hover:bg-white/5":"hover:bg-gray-50",!lt&&(c?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:d("w-5 h-5 rounded-full flex items-center justify-center",c?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(lucideReact.User,{className:"w-3 h-3 text-gray-400"})}),jsxRuntime.jsx("span",{className:c?"text-[#9CA3AF]":"text-gray-500",children:f==="es"?"Sin asignar":"Unassigned"})]}),t.availableUsers?.map(de=>jsxRuntime.jsxs("button",{onClick:()=>{kt(de.id),Ae(false);},className:d("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",c?"hover:bg-white/5":"hover:bg-gray-50",lt===de.id&&(c?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-white text-[9px] font-medium",style:{backgroundColor:de.color||"#7C3AED"},children:de.initials||de.name?.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:c?"text-white":"text-gray-900",children:de.name})]},de.id)),(!t.availableUsers||t.availableUsers.length===0)&&jsxRuntime.jsx("div",{className:d("px-3 py-2 text-xs",c?"text-[#6B7280]":"text-gray-400"),children:f==="es"?"No hay usuarios disponibles":"No users available"})]})})]})]}),jsxRuntime.jsx("button",{onClick:()=>{if(qe.trim()){let de=t.availableUsers?.find(vt=>vt.id===lt),We=G||M.date;a.onTaskCreate?.({name:qe.trim(),startDate:We,endDate:We,priority:ie,assignees:de?[de]:void 0}),Qe(""),Xe(void 0),kt(null),ae(null),Ie(null);}},disabled:!qe.trim(),className:d("px-2.5 py-1 rounded text-xs font-medium transition-colors",qe.trim()?"bg-[#7C3AED] hover:bg-[#6D28D9] text-white":c?"bg-white/5 text-[#4B5563]":"bg-gray-100 text-gray-400"),children:f==="es"?"Guardar":"Save"})]})]})]})})]})})(),jsxRuntime.jsx("span",{className:d("text-sm font-medium",M.isToday?"text-[#3B82F6]":M.isCurrentMonth?c?"text-white":"text-gray-900":c?"text-[#6B7280]":"text-gray-400"),children:M.date.getDate()})]})]},V)})})]})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:y&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>{I(null),Te("");},className:"fixed inset-0 bg-black/50 z-40"}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},className:d("fixed inset-4 md:inset-8 lg:inset-12 rounded-xl shadow-2xl z-50 flex overflow-hidden",c?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxRuntime.jsxs("div",{className:d("px-6 py-3 border-b flex items-center gap-3",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Circle,{className:d("w-4 h-4",c?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsxs("span",{className:d("text-xs px-2 py-0.5 rounded",c?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:[f==="es"?"Tarea":"Task"," \u2228"]}),jsxRuntime.jsx("span",{className:d("text-xs font-mono",c?"text-[#6B7280]":"text-gray-400"),children:y.id.slice(0,8)}),jsxRuntime.jsxs("button",{className:d("flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium transition-colors",c?"bg-purple-500/20 text-purple-400 hover:bg-purple-500/30":"bg-purple-100 text-purple-700 hover:bg-purple-200"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-3 h-3"}),"Ask AI"]})]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{className:d("p-1.5 rounded transition-colors",c?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.Maximize2,{className:"w-4 h-4"})}),jsxRuntime.jsx("button",{className:d("p-1.5 rounded transition-colors",c?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{onClick:()=>{I(null),Te("");},className:d("p-1.5 rounded transition-colors",c?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"px-6 py-4",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>{let M=y.progress===100?0:100,Me={...y,progress:M,status:M===100?"completed":"todo"};I(Me),a.onTaskUpdate?.(Me);},className:d("mt-1 w-5 h-5 rounded-full border-2 flex items-center justify-center transition-colors",y.progress===100?"bg-green-500 border-green-500":c?"border-white/30 hover:border-white/50":"border-gray-300 hover:border-gray-400"),children:y.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("h2",{className:d("text-xl font-semibold flex-1",y.progress===100?"line-through text-[#6B7280]":c?"text-white":"text-gray-900"),children:y.name})]})}),jsxRuntime.jsxs("div",{className:"px-6 pb-6 flex-1 overflow-y-auto overflow-x-visible",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-12 gap-y-5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CheckCircle2,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Estado":"Status"}),jsxRuntime.jsx("button",{onClick:()=>{H(),A(!Le);},className:d("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",y.progress===100||y.status==="completed"?"bg-green-500/20 text-green-400":y.progress&&y.progress>0||y.status==="in-progress"?"bg-blue-500/20 text-blue-400":c?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:y.progress===100||y.status==="completed"?f==="es"?"COMPLETADO":"DONE":y.progress&&y.progress>0||y.status==="in-progress"?f==="es"?"EN PROGRESO":"IN PROGRESS":f==="es"?"POR HACER":"TO DO"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Le&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>A(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"todo",label:f==="es"?"Por hacer":"To Do",color:"bg-white/10 text-white"},{id:"in-progress",label:f==="es"?"En progreso":"In Progress",color:"bg-blue-500/20 text-blue-400"},{id:"completed",label:f==="es"?"Completado":"Done",color:"bg-green-500/20 text-green-400"}].map(M=>jsxRuntime.jsxs("button",{onClick:()=>_e(M.id),className:d("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",c?"hover:bg-white/5":"hover:bg-gray-50",(y.status===M.id||M.id==="completed"&&y.progress===100||M.id==="in-progress"&&y.progress&&y.progress>0&&y.progress<100||M.id==="todo"&&(!y.progress||y.progress===0)&&y.status!=="in-progress"&&y.status!=="completed")&&(c?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:d("w-2 h-2 rounded-full",M.id==="completed"?"bg-green-500":M.id==="in-progress"?"bg-blue-500":"bg-gray-400")}),jsxRuntime.jsx("span",{className:c?"text-white":"text-gray-900",children:M.label})]},M.id))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.User,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Asignados":"Assignees"}),jsxRuntime.jsxs("button",{onClick:()=>{A(false),L(false),O(null),X(!j);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[y.assignees&&y.assignees.length>0?jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[y.assignees.slice(0,3).map((M,V)=>jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-medium",style:{backgroundColor:M.color||"#8B5CF6"},title:M.name,children:M.initials||M.name.slice(0,2).toUpperCase()},V)),y.assignees.length>3&&jsxRuntime.jsxs("span",{className:d("text-xs",c?"text-[#6B7280]":"text-gray-400"),children:["+",y.assignees.length-3]})]}):jsxRuntime.jsx("span",{className:d("text-sm",c?"text-[#6B7280]":"text-gray-400"),children:f==="es"?"Agregar":"Add"}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3",c?"text-[#6B7280]":"text-gray-400")})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:j&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>X(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[200px] max-h-[280px] overflow-y-auto",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:t.availableUsers&&t.availableUsers.length>0?t.availableUsers.map(M=>{let V=y.assignees?.some(Me=>Me.name===M.name);return jsxRuntime.jsxs("button",{onClick:()=>{let Me=y.assignees||[],Ye;V?Ye=Me.filter(Pt=>Pt.name!==M.name):Ye=[...Me,{name:M.name,avatar:M.avatar,initials:M.initials||M.name.slice(0,2).toUpperCase(),color:M.color||"#8B5CF6"}],pe("assignees",Ye);},className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",c?"hover:bg-white/5":"hover:bg-gray-50",V&&(c?"bg-white/5":"bg-gray-50")),children:[M.avatar?jsxRuntime.jsx("img",{src:M.avatar,alt:M.name,className:"w-6 h-6 rounded-full object-cover"}):jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-medium",style:{backgroundColor:M.color||"#8B5CF6"},children:M.initials||M.name.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:d("flex-1 text-left",c?"text-white":"text-gray-900"),children:M.name}),V&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-green-500"})]},M.id||M.name)}):jsxRuntime.jsx("div",{className:d("px-3 py-4 text-sm text-center",c?"text-[#6B7280]":"text-gray-400"),children:f==="es"?"No hay usuarios disponibles":"No users available"})})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Fechas":"Dates"}),jsxRuntime.jsxs("button",{onClick:()=>{O(W?null:"start"),te(y.startDate||new Date);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10 text-white":"bg-gray-100 hover:bg-gray-200 text-gray-900"),children:[y.startDate?.toLocaleDateString(f==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(f==="es"?"Inicio":"Start"),jsxRuntime.jsx("span",{className:d("mx-1",c?"text-[#6B7280]":"text-gray-400"),children:"\u2192"}),y.endDate?.toLocaleDateString(f==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(f==="es"?"Fin":"End"),(y.startDate||y.endDate)&&jsxRuntime.jsx(lucideReact.X,{className:"w-3.5 h-3.5 ml-1 opacity-50 hover:opacity-100",onClick:M=>{M.stopPropagation();}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:W&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>O(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:d("absolute left-0 top-full mt-2 z-50 rounded-xl shadow-2xl overflow-hidden flex",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:M=>M.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:d("w-44 py-2 border-r",c?"border-white/10":"border-gray-200"),children:[(()=>{let M=new Date,V=new Date(M);V.setDate(M.getDate()+1);let Me=new Date(M);Me.setDate(M.getDate()+((6-M.getDay()+7)%7||7));let Ye=new Date(M);Ye.setDate(M.getDate()+((1-M.getDay()+7)%7||7));let Pt=new Date(M);Pt.setDate(M.getDate()+(6-M.getDay()+7)%7+7);let de=new Date(M);de.setDate(M.getDate()+14);let We=new Date(M);return We.setDate(M.getDate()+28),[{label:f==="es"?"Hoy":"Today",date:M,display:M.toLocaleDateString(f==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:f==="es"?"Ma\xF1ana":"Tomorrow",date:V,display:V.toLocaleDateString(f==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:f==="es"?"Este fin de semana":"This weekend",date:Me,display:f==="es"?"s\xE1b.":"sat."},{label:f==="es"?"Pr\xF3xima semana":"Next week",date:Ye,display:f==="es"?"lun.":"mon."},{label:f==="es"?"Pr\xF3ximo fin de semana":"Next weekend",date:Pt,display:Pt.toLocaleDateString(f==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:f==="es"?"2 semanas":"2 weeks",date:de,display:de.toLocaleDateString(f==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:f==="es"?"4 semanas":"4 weeks",date:We,display:We.toLocaleDateString(f==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}].map((Re,gt)=>jsxRuntime.jsxs("button",{className:d("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",c?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{if(W==="start"){let va=y.endDate&&Re.date>y.endDate?Re.date:y.endDate;ze(Re.date,va),O("end");}else {let va=y.startDate&&Re.date<y.startDate?Re.date:y.startDate;ze(va,Re.date),O(null);}},children:[jsxRuntime.jsx("span",{children:Re.label}),jsxRuntime.jsx("span",{className:d("text-xs",c?"text-[#6B7280]":"text-gray-400"),children:Re.display})]},gt))})(),jsxRuntime.jsx("div",{className:d("border-t mt-2 pt-2",c?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:()=>{ze(void 0,void 0),O(null);},className:d("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",c?"hover:bg-white/5 text-red-400":"hover:bg-gray-50 text-red-500"),children:[jsxRuntime.jsx("span",{children:f==="es"?"Quitar fechas":"Clear dates"}),jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4 opacity-50"})]})})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("div",{className:d("text-xs mb-3 px-2 py-1 rounded",c?"bg-white/5 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:W==="start"?f==="es"?"\u{1F4C5} Selecciona fecha de inicio":"\u{1F4C5} Select start date":f==="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:d("font-medium",c?"text-white":"text-gray-900"),children:q.toLocaleDateString(f==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>te(new Date),className:d("p-1 rounded text-sm transition-colors",c?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:f==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>te(new Date(q.getFullYear(),q.getMonth()-1)),className:d("p-1 rounded",c?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-4 h-4"})}),jsxRuntime.jsx("button",{onClick:()=>te(new Date(q.getFullYear(),q.getMonth()+1)),className:d("p-1 rounded",c?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:(f==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(M=>jsxRuntime.jsx("div",{className:d("w-8 h-8 flex items-center justify-center text-xs",c?"text-[#6B7280]":"text-gray-400"),children:M},M))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:(()=>{let M=q.getFullYear(),V=q.getMonth(),Me=new Date(M,V,1).getDay(),Ye=new Date(M,V+1,0).getDate(),Pt=new Date(M,V,0).getDate(),de=new Date,We=[];for(let Re=Me-1;Re>=0;Re--)We.push({day:Pt-Re,isCurrentMonth:false,date:new Date(M,V-1,Pt-Re)});for(let Re=1;Re<=Ye;Re++)We.push({day:Re,isCurrentMonth:true,date:new Date(M,V,Re)});let vt=42-We.length;for(let Re=1;Re<=vt;Re++)We.push({day:Re,isCurrentMonth:false,date:new Date(M,V+1,Re)});return We.map((Re,gt)=>{let va=Re.date.toDateString()===de.toDateString(),wa=y.startDate?.toDateString()===Re.date.toDateString(),Kt=y.endDate?.toDateString()===Re.date.toDateString(),je=wa||Kt,Yt=y.startDate&&y.endDate&&Re.date>=y.startDate&&Re.date<=y.endDate;return jsxRuntime.jsx("button",{className:d("w-8 h-8 rounded-full flex items-center justify-center text-sm transition-colors",!Re.isCurrentMonth&&(c?"text-[#4B5563]":"text-gray-300"),Re.isCurrentMonth&&(c?"text-white":"text-gray-900"),va&&"ring-2 ring-[#3B82F6]",wa&&"bg-[#3B82F6] text-white",Kt&&!wa&&"bg-[#7C3AED] text-white",Yt&&!je&&(c?"bg-[#7C3AED]/20":"bg-purple-100"),!je&&(c?"hover:bg-white/10":"hover:bg-gray-100")),onClick:()=>{let ga=new Date(Re.date);if(W==="start"){let Ar=y.endDate&&ga>y.endDate?ga:y.endDate;ze(ga,Ar),O("end");}else {let Ar=y.startDate&&ga<y.startDate?ga:y.startDate;ze(Ar,ga),O(null);}},children:Re.day},gt)})})()})]})]})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Flag,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Prioridad":"Priority"}),jsxRuntime.jsx("button",{onClick:()=>{H(),L(!R);},className:d("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",y.priority==="high"||y.priority==="urgent"?"bg-red-500/20 text-red-400":y.priority==="medium"?"bg-yellow-500/20 text-yellow-400":y.priority==="low"?"bg-green-500/20 text-green-400":c?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:y.priority?y.priority==="high"||y.priority==="urgent"?f==="es"?"Urgente":"Urgent":y.priority==="medium"?f==="es"?"Media":"Medium":f==="es"?"Baja":"Low":f==="es"?"Sin prioridad":"No priority"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:R&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>L(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"urgent",label:f==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:f==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:f==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:f==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:f==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(M=>jsxRuntime.jsxs("button",{onClick:()=>{pe("priority",M.id),L(false);},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",c?"hover:bg-white/5":"hover:bg-gray-50",y.priority===M.id&&(c?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:d("w-2 h-2 rounded-full",M.color)}),jsxRuntime.jsx("span",{className:c?"text-white":"text-gray-900",children:M.label})]},M.id||"none"))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Clock,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Duraci\xF3n":"Duration"}),jsxRuntime.jsx("span",{className:d("text-sm",c?"text-white":"text-gray-900"),children:y.startDate&&y.endDate?`${Math.ceil((y.endDate.getTime()-y.startDate.getTime())/(1e3*60*60*24))} ${f==="es"?"d\xEDas":"days"}`:f==="es"?"Sin definir":"Not set"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:d("w-4 h-4 rounded-full border-2",c?"border-[#6B7280]":"border-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Progreso":"Progress"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[z?jsxRuntime.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:y.progress||0,onChange:M=>{let V=parseInt(M.target.value),Me=y.status;V===100?Me="completed":V>0?Me="in-progress":Me="todo";let Ye={...y,progress:V,status:Me};I(Ye),a.onTaskUpdate?.(Ye);},onBlur:()=>ve(false),className:d("flex-1 max-w-[120px] h-2 rounded-full appearance-none cursor-pointer",c?"bg-white/10":"bg-gray-200","[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[#3B82F6] [&::-webkit-slider-thumb]:cursor-pointer"),autoFocus:true}):jsxRuntime.jsx("button",{onClick:()=>ve(true),className:d("flex-1 h-2 rounded-full overflow-hidden max-w-[120px] cursor-pointer hover:ring-2 hover:ring-white/20 transition-all",c?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:d("h-full rounded-full transition-all",y.progress===100?"bg-green-500":"bg-[#3B82F6]"),style:{width:`${y.progress||0}%`}})}),jsxRuntime.jsxs("span",{className:d("text-sm font-medium min-w-[40px]",c?"text-white":"text-gray-900"),children:[y.progress||0,"%"]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Tag,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Etiquetas":"Tags"}),jsxRuntime.jsx(br,{selectedTags:y.tags||[],availableTags:g,onChange:M=>{pe("tags",M);},onCreateTag:i,theme:N})]}),jsxRuntime.jsxs("div",{className:"flex items-start gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Link2,{className:d("w-4 h-4 mt-1.5",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24 mt-1",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Relaciones":"Relations"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[y.dependencies&&y.dependencies.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:y.dependencies.map(M=>{let V=e.find(Me=>Me.id===M);return jsxRuntime.jsxs("span",{className:d("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",c?"bg-blue-500/20 text-blue-400":"bg-blue-100 text-blue-700"),children:[V?.name||M.slice(0,8),jsxRuntime.jsx("button",{onClick:()=>{let Me=(y.dependencies||[]).filter(Ye=>Ye!==M);pe("dependencies",Me);},className:d("ml-0.5 hover:bg-white/20 rounded-full p-0.5 transition-colors"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},M)})}),jsxRuntime.jsxs("button",{onClick:()=>{H(),Se(!jt);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{className:d("text-sm",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Agregar dependencia":"Add dependency"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jt&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>{Se(false),ua("");}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[280px] max-h-[320px]",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[jsxRuntime.jsx("div",{className:d("p-2 border-b",c?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("input",{type:"text",value:Ve,onChange:M=>ua(M.target.value),placeholder:f==="es"?"Buscar tarea...":"Search task...",className:d("w-full px-3 py-2 rounded-md text-sm outline-none",c?"bg-white/5 text-white placeholder:text-[#6B7280] focus:bg-white/10":"bg-gray-100 text-gray-900 placeholder:text-gray-400"),autoFocus:true})}),jsxRuntime.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:e.length>0?e.filter(M=>M.id!==y.id).filter(M=>Ve===""||M.name.toLowerCase().includes(Ve.toLowerCase())).map(M=>{let V=y.dependencies?.includes(M.id);return jsxRuntime.jsxs("button",{onClick:()=>{let Me=y.dependencies||[],Ye;V?Ye=Me.filter(Pt=>Pt!==M.id):Ye=[...Me,M.id],pe("dependencies",Ye);},className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors text-left",c?"hover:bg-white/5":"hover:bg-gray-50",V&&(c?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:d("w-4 h-4 rounded border-2 flex items-center justify-center flex-shrink-0",V?"bg-blue-500 border-blue-500":c?"border-white/30":"border-gray-300"),children:V&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("span",{className:d("block truncate",c?"text-white":"text-gray-900"),children:M.name}),jsxRuntime.jsx("span",{className:d("text-xs",c?"text-[#6B7280]":"text-gray-400"),children:M.id.slice(0,8)})]})]},M.id)}):jsxRuntime.jsx("div",{className:d("px-3 py-4 text-sm text-center",c?"text-[#6B7280]":"text-gray-500"),children:f==="es"?"No hay tareas disponibles":"No tasks available"})})]})]})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Palette,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:"Color"}),jsxRuntime.jsxs("button",{onClick:()=>{H(),Ke(!Ze);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full",style:{backgroundColor:y.color||"#6366F1"}}),jsxRuntime.jsx("span",{className:d("text-sm",c?"text-white":"text-gray-900"),children:hr.find(M=>M.value===y.color)?.name||(f==="es"?"Azul":"Blue")}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3",c?"text-[#6B7280]":"text-gray-400")})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Ze&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>Ke(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden p-3",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:jsxRuntime.jsx("div",{className:"grid grid-cols-6 gap-1.5",children:hr.map(M=>{let V=y.color===M.value;return jsxRuntime.jsx("button",{onClick:()=>{pe("color",M.value),Ke(false);},className:d("w-7 h-7 rounded-full flex items-center justify-center transition-all",V&&"ring-2 ring-offset-2",c?"ring-offset-[#1A1D25]":"ring-offset-white"),style:{backgroundColor:M.value,outlineColor:V?M.value:void 0},title:M.name,children:V&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 text-white"})},M.value)})})})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Diamond,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Hito":"Milestone"}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:y.isMilestone||false,onChange:M=>pe("isMilestone",M.target.checked),className:d("w-4 h-4 rounded border-2 cursor-pointer appearance-none transition-colors",y.isMilestone?"bg-purple-500 border-purple-500":c?"border-white/30 bg-transparent":"border-gray-300 bg-transparent","checked:bg-purple-500 checked:border-purple-500")}),jsxRuntime.jsx("span",{className:d("text-sm",c?"text-white":"text-gray-900"),children:f==="es"?"Marcar como hito":"Mark as milestone"})]})]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[jsxRuntime.jsx(lucideReact.FileText,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("h3",{className:d("text-sm font-semibold",c?"text-white":"text-gray-900"),children:f==="es"?"Descripci\xF3n":"Description"})]}),jsxRuntime.jsx("textarea",{value:y.description||"",onChange:M=>pe("description",M.target.value),placeholder:f==="es"?"Agregar descripci\xF3n...":"Add description...",className:d("w-full min-h-[100px] px-3 py-2 rounded-lg text-sm resize-none outline-none transition-colors",c?"bg-white/5 text-white placeholder:text-[#6B7280] focus:bg-white/10":"bg-gray-100 text-gray-900 placeholder:text-gray-400 focus:bg-gray-200")}),jsxRuntime.jsxs("button",{className:d("flex items-center gap-2 text-sm mt-2 transition-colors",c?"text-purple-400 hover:text-purple-300":"text-purple-600 hover:text-purple-700"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4"}),f==="es"?"Escribe con IA":"Write with AI"]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:d("text-sm font-semibold mb-3",c?"text-white":"text-gray-900"),children:f==="es"?"Campos personalizados":"Custom fields"}),jsxRuntime.jsxs("button",{className:d("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),f==="es"?"Crea un campo en esta lista":"Create a field in this list"]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:d("text-sm font-semibold mb-3",c?"text-white":"text-gray-900"),children:f==="es"?"Agregar subtarea":"Add subtask"}),y.subtasks&&y.subtasks.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-3",children:y.subtasks.map(M=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:d("w-4 h-4 rounded border flex items-center justify-center cursor-pointer",M.progress===100?"bg-green-500 border-green-500":c?"border-white/20 hover:border-white/40":"border-gray-300 hover:border-gray-400"),children:M.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:d("text-sm",M.progress===100?"line-through text-[#6B7280]":c?"text-white":"text-gray-900"),children:M.name})]},M.id))}),jsxRuntime.jsxs("button",{className:d("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),f==="es"?"Add Tarea":"Add Task"]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("h3",{className:d("text-sm font-semibold",c?"text-white":"text-gray-900"),children:f==="es"?"Listas de control":"Checklists"}),jsxRuntime.jsx("button",{className:d("p-1 rounded transition-colors",c?"hover:bg-white/10 text-[#6B7280]":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("button",{className:d("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.ListChecks,{className:"w-4 h-4"}),f==="es"?"Crear lista de control":"Create checklist"]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("h3",{className:d("text-sm font-semibold mb-3",c?"text-white":"text-gray-900"),children:[f==="es"?"Adjuntos":"Attachments",ct.length>0&&jsxRuntime.jsxs("span",{className:d("ml-2 text-xs font-normal",c?"text-[#6B7280]":"text-gray-400"),children:["(",ct.length,")"]})]}),ct.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-4",children:ct.map(M=>{let V=$a(M.type),Me=M.type.startsWith("image/");return jsxRuntime.jsxs("div",{className:d("flex items-center gap-3 p-2 rounded-lg group transition-colors",c?"bg-white/5 hover:bg-white/10":"bg-gray-50 hover:bg-gray-100"),children:[Me&&M.thumbnailUrl?jsxRuntime.jsx("img",{src:M.thumbnailUrl,alt:M.name,className:"w-10 h-10 rounded object-cover"}):jsxRuntime.jsx("div",{className:d("w-10 h-10 rounded flex items-center justify-center",c?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(V,{className:d("w-5 h-5",c?"text-[#9CA3AF]":"text-gray-500")})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("a",{href:M.url,target:"_blank",rel:"noopener noreferrer",className:d("text-sm font-medium truncate block hover:underline",c?"text-white":"text-gray-900"),children:M.name}),jsxRuntime.jsx("p",{className:d("text-xs",c?"text-[#6B7280]":"text-gray-400"),children:ya(M.size)})]}),a.onDeleteAttachment&&jsxRuntime.jsx("button",{onClick:()=>a.onDeleteAttachment?.(M.id),className:d("p-1.5 rounded opacity-0 group-hover:opacity-100 transition-all",c?"hover:bg-red-500/20 text-red-400":"hover:bg-red-100 text-red-500"),title:f==="es"?"Eliminar":"Delete",children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},M.id)})}),jsxRuntime.jsxs("div",{onDragOver:Ft,onDragLeave:rt,onDrop:le,className:d("border-2 border-dashed rounded-lg p-6 text-center transition-all cursor-pointer relative",Ue?c?"border-blue-500 bg-blue-500/10":"border-blue-400 bg-blue-50":c?"border-white/10 hover:border-white/20":"border-gray-200 hover:border-gray-300",ut&&"pointer-events-none opacity-50"),children:[jsxRuntime.jsx("input",{type:"file",multiple:true,onChange:He,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",disabled:!a.onUploadAttachments||ut}),ut?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-6 h-6 mx-auto mb-2 border-2 border-blue-500 border-t-transparent rounded-full animate-spin"}),jsxRuntime.jsx("p",{className:d("text-sm",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Subiendo...":"Uploading..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Upload,{className:d("w-6 h-6 mx-auto mb-2",Ue?"text-blue-500":c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("p",{className:d("text-sm",c?"text-[#9CA3AF]":"text-gray-500"),children:Ue?f==="es"?"Suelta los archivos aqu\xED":"Drop files here":f==="es"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Suelta tus archivos aqu\xED o ",jsxRuntime.jsx("span",{className:"underline",children:"haz clic para subir"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Drop your files here or ",jsxRuntime.jsx("span",{className:"underline",children:"click to upload"})]})}),!a.onUploadAttachments&&jsxRuntime.jsx("p",{className:d("text-xs mt-1",c?"text-[#6B7280]":"text-gray-400"),children:f==="es"?"Upload no disponible":"Upload not available"})]})]})]})]})]}),jsxRuntime.jsxs("div",{className:d("w-80 border-l flex flex-col",c?"border-white/10 bg-[#0F1117]":"border-gray-200 bg-gray-50"),children:[jsxRuntime.jsx("div",{className:d("px-4 py-3 border-b",c?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("h3",{className:d("text-sm font-semibold",c?"text-white":"text-gray-900"),children:[f==="es"?"Actividad":"Activity",l&&l.length>0&&jsxRuntime.jsxs("span",{className:d("ml-2 text-xs font-normal",c?"text-[#6B7280]":"text-gray-400"),children:["(",l.length,")"]})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:l&&l.length>0?jsxRuntime.jsx("div",{className:"space-y-4",children:l.map(M=>{let V=(()=>{let Me=new Date,Ye=new Date(M.createdAt),Pt=Me.getTime()-Ye.getTime(),de=Math.floor(Pt/6e4),We=Math.floor(de/60),vt=Math.floor(We/24);return de<1?f==="es"?"ahora":"now":de<60?f==="es"?`hace ${de}m`:`${de}m ago`:We<24?f==="es"?`hace ${We}h`:`${We}h ago`:f==="es"?`hace ${vt}d`:`${vt}d ago`})();return jsxRuntime.jsxs("div",{className:"flex gap-3",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:{backgroundColor:"#8B5CF6"},children:M.user?.name?.slice(0,2).toUpperCase()||"U"}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsx("span",{className:d("text-sm font-medium",c?"text-white":"text-gray-900"),children:M.user?.name||(f==="es"?"Usuario":"User")}),jsxRuntime.jsx("span",{className:d("text-xs",c?"text-[#6B7280]":"text-gray-400"),children:V})]}),jsxRuntime.jsx("p",{className:d("text-sm break-words",c?"text-[#9CA3AF]":"text-gray-600"),children:M.content})]})]},M.id)})}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[jsxRuntime.jsx(lucideReact.MessageSquare,{className:d("w-10 h-10 mb-3",c?"text-[#3B4252]":"text-gray-300")}),jsxRuntime.jsx("p",{className:d("text-sm",c?"text-[#6B7280]":"text-gray-500"),children:f==="es"?"Sin actividad reciente":"No recent activity"})]})}),jsxRuntime.jsx("div",{className:d("p-4 border-t",c?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-start gap-2",children:[v&&jsxRuntime.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:{backgroundColor:v.color||"#8B5CF6"},children:v.name?.slice(0,2).toUpperCase()||"U"}),jsxRuntime.jsxs("div",{className:d("flex-1 flex items-center gap-2 px-3 py-2 rounded-lg",c?"bg-white/5":"bg-white border border-gray-200"),children:[jsxRuntime.jsx("input",{type:"text",value:F,onChange:M=>Te(M.target.value),onKeyDown:async M=>{if(M.key==="Enter"&&!M.shiftKey&&y&&F.trim()&&b){M.preventDefault(),ke(true);try{await b(y.id,F.trim()),Te("");}finally{ke(false);}}},placeholder:f==="es"?"Escribe un comentario...":"Write a comment...",disabled:Z||!b,className:d("flex-1 bg-transparent text-sm outline-none",c?"text-white placeholder:text-[#6B7280]":"text-gray-900 placeholder:text-gray-400",(Z||!b)&&"opacity-50")}),jsxRuntime.jsx("button",{onClick:async()=>{if(y&&F.trim()&&b){ke(true);try{await b(y.id,F.trim()),Te("");}finally{ke(false);}}},disabled:Z||!F.trim()||!b,className:d("p-1.5 rounded transition-colors",F.trim()&&b?"bg-blue-500 text-white hover:bg-blue-600":c?"text-[#6B7280]":"text-gray-400",Z&&"opacity-50 cursor-not-allowed"),children:Z?jsxRuntime.jsx("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):jsxRuntime.jsx(lucideReact.Send,{className:"w-4 h-4"})})]})]})})]})]})]})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:P&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>T(null),className:"fixed inset-0 bg-black/30 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:d("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",c?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:d("px-4 py-3 border-b flex items-center justify-between",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("span",{className:d("font-medium",c?"text-white":"text-gray-900"),children:P.date.toLocaleDateString(f==="es"?"es-ES":"en-US",{weekday:"long",month:"long",day:"numeric"})}),jsxRuntime.jsx("button",{onClick:()=>T(null),className:d("p-1 rounded",c?"hover:bg-white/10 text-[#9CA3AF]":"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-2",children:P.events.map(M=>jsxRuntime.jsxs("button",{onClick:()=>{T(null),I(M.task),C?.(M.task.id);},className:d("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors",c?"hover:bg-white/5":"hover:bg-gray-50"),children:[jsxRuntime.jsx(fp,{task:M.task}),jsxRuntime.jsx("span",{className:d("text-sm truncate flex-1",c?"text-white":"text-gray-900"),children:M.title}),M.task.priority==="high"||M.task.priority==="urgent"?jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5 text-red-400"}):null]},M.id))})]})]})})]})}var xl={bgPrimary:"#0d1117",bgSecondary:"#161b22",bgHover:"#21262d",bgToday:"#1f6feb20",bgWeekend:"#161b2280",bgOtherMonth:"#0d111750",border:"#30363d",borderLight:"#21262d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681",textToday:"#58a6ff",accent:"#58a6ff",accentHover:"#79b8ff",accentLight:"#58a6ff20",statusTodo:"#8b949e",statusInProgress:"#f0883e",statusCompleted:"#3fb950",focusRing:"#58a6ff"},kl={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"},wl={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"},hs={dark:xl,light:kl,neutral:wl};function yp(e){return hs[e]||hs.dark}function cv({stack:e,cards:t,renderCard:a,onCardClick:r,onToggleExpand:o,onUnstack:s,onDeleteStack:n,className:m}){let[g,i]=react.useState(false),p=react.useMemo(()=>t.filter(v=>e.cardIds.includes(v.id)),[t,e.cardIds]),l=react.useMemo(()=>{let v=p.length,k=new Set(p.flatMap(f=>f.assignedUserIds||[])).size,C=p.map(f=>f.priority).filter(Boolean),h=new Set(p.flatMap(f=>f.labels||[])).size;return {totalCards:v,uniqueAssignees:k,priorities:C,labels:h}},[p]),b=()=>{o?.(e.id);};return jsxRuntime.jsxs("div",{className:d("card-stack",!e.isExpanded&&"card-stack-collapsed",m),onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),style:{"--stack-color":e.color||"var(--color-accent-primary)"},children:[jsxRuntime.jsxs("div",{className:"card-stack-header",onClick:b,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:d("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:l.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"]})]}),g&&jsxRuntime.jsx("div",{className:"card-stack-actions",children:jsxRuntime.jsx("button",{className:"card-stack-action",onClick:v=>{v.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:[l.uniqueAssignees," assignees"]})]}),l.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:[l.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:p.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:p.map(v=>jsxRuntime.jsxs("div",{className:"card-stack-card-wrapper",children:[a?jsxRuntime.jsx("div",{onClick:()=>r?.(v),children:a(v)}):jsxRuntime.jsxs("div",{className:"card-stack-default-card",onClick:()=>r?.(v),children:[jsxRuntime.jsx("h4",{children:v.title}),v.description&&jsxRuntime.jsxs("p",{children:[v.description.substring(0,100),"..."]})]}),jsxRuntime.jsx("button",{className:"card-stack-unstack-btn",onClick:k=>{k.stopPropagation(),s?.(e.id,v.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"})]})})]},v.id))})})]})}var xp={showIcons:true,showAvatars:true,groupByDay:true,useRelativeTime:true,compact:false};function dn(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 cn(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 kp(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 wp({events:e,filter:t,onFilterChange:a,onClearFilter:r,onEventClick:o,selectedEventId:s,config:n,className:m}){let g=react.useMemo(()=>({...xp,...n}),[n]),[i,p]=react.useState(new Set),l=react.useRef(null),b=react.useMemo(()=>{if(!g.groupByDay)return [{date:null,events:e}];let u=new Map;return e.forEach(x=>{let c=x.timestamp.toISOString().split("T")[0],N=u.get(c);N?N.push(x):u.set(c,[x]);}),Array.from(u.entries()).sort((x,c)=>c[0].localeCompare(x[0])).map(([x,c])=>({date:new Date(x),events:c.sort((N,w)=>w.timestamp.getTime()-N.timestamp.getTime())}))},[e,g.groupByDay]),{uniqueUsers:v,uniqueTypes:k}=react.useMemo(()=>{let u=new Set,x=new Set;return e.forEach(c=>{u.add(c.userId),x.add(c.type);}),{uniqueUsers:Array.from(u),uniqueTypes:Array.from(x)}},[e]),C=u=>{p(x=>{let c=new Set(x);return c.has(u)?c.delete(u):c.add(u),c});},h=u=>{let c=new Date().getTime()-u.getTime(),N=Math.floor(c/6e4),w=Math.floor(c/36e5),B=Math.floor(c/864e5);return N<1?"just now":N<60?`${N}m ago`:w<24?`${w}h ago`:B<7?`${B}d ago`:u.toLocaleDateString()},f=react.useMemo(()=>{let u=0;return t.types&&t.types.length>0&&u++,t.users&&t.users.length>0&&u++,t.dateRange&&u++,t.searchTerm&&u++,u},[t]);return react.useEffect(()=>{if(s&&l.current){let u=l.current.querySelector(`[data-event-id="${s}"]`);u&&u.scrollIntoView({behavior:"smooth",block:"center"});}},[s]),e.length===0?jsxRuntime.jsxs("div",{className:d("history-timeline-empty",m),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:d("history-timeline",g.compact&&"compact",m),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:u=>{let x=u.target.value;a({...t,types:x?[x]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Events"}),k.map(u=>jsxRuntime.jsxs("option",{value:u,children:[cn(u)," ",u.replace("_"," ")]},u))]}),v.length>1&&jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.users?.[0]||"",onChange:u=>{let x=u.target.value;a({...t,users:x?[x]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Users"}),v.map(u=>jsxRuntime.jsx("option",{value:u,children:u},u))]}),jsxRuntime.jsx("input",{type:"text",className:"history-timeline-filter-search",placeholder:"Search history...",value:t.searchTerm||"",onChange:u=>a({...t,searchTerm:u.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:l,children:b.map(u=>jsxRuntime.jsxs("div",{className:"history-timeline-group",children:[g.groupByDay&&u.date&&jsxRuntime.jsxs("div",{className:"history-timeline-day-header",children:[jsxRuntime.jsx("span",{className:"history-timeline-day-date",children:u.date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),jsxRuntime.jsxs("span",{className:"history-timeline-day-count",children:[u.events.length," events"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-events",children:u.events.map((x,c)=>{let N=i.has(x.id),w=s===x.id,B=kp(x.type);return jsxRuntime.jsxs("div",{"data-event-id":x.id,className:d("history-timeline-event",N&&"expanded",w&&"selected"),onClick:()=>o?.(x),children:[jsxRuntime.jsxs("div",{className:"history-timeline-line",children:[jsxRuntime.jsx("div",{className:"history-timeline-dot",style:{backgroundColor:B},children:g.showIcons&&jsxRuntime.jsx("span",{className:"history-timeline-dot-icon",children:cn(x.type)})}),c<u.events.length-1&&jsxRuntime.jsx("div",{className:"history-timeline-connector",style:{borderColor:B}})]}),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:[g.showAvatars&&x.userAvatar&&jsxRuntime.jsx("img",{src:x.userAvatar,alt:x.userName||x.userId,className:"history-timeline-event-avatar"}),jsxRuntime.jsxs("div",{className:"history-timeline-event-description",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-user",children:x.userName||x.userId}),jsxRuntime.jsx("span",{className:"history-timeline-event-action",children:dn(x)})]})]}),jsxRuntime.jsx("div",{className:"history-timeline-event-time",children:g.useRelativeTime?h(x.timestamp):x.timestamp.toLocaleString()})]}),Object.keys(x.changes).length>0&&jsxRuntime.jsxs("button",{className:"history-timeline-event-toggle",onClick:y=>{y.stopPropagation(),C(x.id);},children:[N?"\u25BC":"\u25B6"," Show changes"]}),N&&jsxRuntime.jsxs("div",{className:"history-timeline-event-changes",children:[Object.entries(x.changes).map(([y,I])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-change",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-change-key",children:[y,":"]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-change-values",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-change-from",children:JSON.stringify(I.from)}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-arrow",children:"\u2192"}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-to",children:JSON.stringify(I.to)})]})]},y)),x.metadata&&Object.keys(x.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(x.metadata).map(([y,I])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata-item",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-metadata-key",children:[y,":"]}),jsxRuntime.jsx("span",{className:"history-timeline-event-metadata-value",children:JSON.stringify(I)})]},y))]})]})]})]},x.id)})})]},u.date?.toISOString()||"all"))})]})}function Tp({replayState:e,events:t,onStartReplay:a,onStopReplay:r,onTogglePlayback:o,onPrevious:s,onNext:n,onGoToEvent:m,onSpeedChange:g,className:i}){let p=[.5,1,1.5,2,3],l=react.useMemo(()=>!e||t.length===0?null:t[e.currentIndex],[e,t]),b=react.useMemo(()=>!e||e.totalEvents===0?0:e.currentIndex/(e.totalEvents-1)*100,[e]);return t.length===0?jsxRuntime.jsxs("div",{className:d("history-replay-empty",i),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:d("history-replay",i),children:[jsxRuntime.jsxs("div",{className:"history-replay-current-event",children:[jsxRuntime.jsx("div",{className:"history-replay-event-icon",children:l&&cn(l.type)}),jsxRuntime.jsxs("div",{className:"history-replay-event-info",children:[jsxRuntime.jsx("div",{className:"history-replay-event-description",children:l&&dn(l)}),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:l&&l.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:v=>m(parseInt(v.target.value))}),jsxRuntime.jsx("div",{className:"history-replay-progress-fill",style:{width:`${b}%`}}),jsxRuntime.jsx("div",{className:"history-replay-progress-markers",children:t.map((v,k)=>jsxRuntime.jsx("div",{className:d("history-replay-progress-marker",k===e.currentIndex&&"active"),style:{left:`${k/(e.totalEvents-1)*100}%`},onClick:()=>m(k),title:dn(v)},v.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:p.map(v=>jsxRuntime.jsxs("button",{className:d("history-replay-speed-btn",e.speed===v&&"active"),onClick:()=>g(v),children:[v,"x"]},v))})]}),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:l&&l.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(v=>jsxRuntime.jsx("span",{className:"history-replay-card-preview-label-tag",children:v},v))})]})]})]})]}):jsxRuntime.jsxs("div",{className:d("history-replay-start",i),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 Cl(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 Tl(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 Np(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 Dp(e){return ["blocks","blocked_by","depends_on","required_by","parent_of","child_of"].includes(e)}function bv(e,t,a,r,o,s=100){let n=e.map(g=>({...g,x:g.x??a/2+Math.random()*100-50,y:g.y??r/2+Math.random()*100-50,vx:0,vy:0})),m=new Map(n.map(g=>[g.id,g]));for(let g=0;g<s;g++){let i=1-g/s;n.forEach(p=>{let l=a/2,b=r/2;p.vx+=(l-p.x)*o.centerForce*i,p.vy+=(b-p.y)*o.centerForce*i,n.forEach(v=>{if(p.id===v.id)return;let k=p.x-v.x,C=p.y-v.y,h=Math.sqrt(k*k+C*C)||1,f=o.chargeStrength*i/(h*h);p.vx+=k/h*f,p.vy+=C/h*f;});}),t.forEach(p=>{let l=m.get(typeof p.source=="string"?p.source:p.source.id),b=m.get(typeof p.target=="string"?p.target:p.target.id);if(!l||!b)return;let v=b.x-l.x,k=b.y-l.y,C=Math.sqrt(v*v+k*k)||1,h=(C-o.linkDistance)/C*o.forceStrength*i;l.vx+=v*h,l.vy+=k*h,b.vx-=v*h,b.vy-=k*h;}),n.forEach(p=>{p.fx!==null&&p.fx!==void 0?(p.x=p.fx,p.vx=0):p.x+=p.vx,p.fy!==null&&p.fy!==void 0?(p.y=p.fy,p.vy=0):p.y+=p.vy,p.x=Math.max(o.nodeSize,Math.min(a-o.nodeSize,p.x)),p.y=Math.max(o.nodeSize,Math.min(r-o.nodeSize,p.y)),p.vx*=.9,p.vy*=.9;});}return n}function Sp({nodes:e,edges:t,config:a,filter:r,onFilterChange:o,criticalPath:s,stats:n,onInteraction:m,className:g}){let i=react.useRef(null),[p,l]=react.useState([]),[b,v]=react.useState(null),[k,C]=react.useState(null),[h,f]=react.useState(null),[u,x]=react.useState(1),[c,N]=react.useState({x:0,y:0});react.useEffect(()=>{if(e.length===0)return;let O=bv(e,t,a.width,a.height,a,150);l(O);},[e,t,a]);let w=react.useCallback((O,q)=>{a.enableDragging&&(q.stopPropagation(),v(O));},[a.enableDragging]),B=react.useCallback(O=>{if(!b||!i.current)return;let te=i.current.getBoundingClientRect(),ne=(O.clientX-te.left-c.x)/u,oe=(O.clientY-te.top-c.y)/u;l(ce=>ce.map(be=>be.id===b?{...be,x:ne,y:oe,fx:ne,fy:oe}:be));},[b,u,c]),y=react.useCallback(()=>{v(null);},[]),I=react.useCallback((O,q)=>{q.stopPropagation(),m?.({type:"node-click",node:O,position:{x:q.clientX,y:q.clientY}});},[m]),P=react.useCallback((O,q)=>{q.stopPropagation(),m?.({type:"edge-click",edge:O,position:{x:q.clientX,y:q.clientY}});},[m]),T=react.useCallback(O=>{let q=p.find(te=>te.id===O);return q?{x:q.x,y:q.y}:{x:0,y:0}},[p]),W=react.useCallback(O=>{if(O.onCriticalPath)return "#ef4444";switch(a.colorScheme){case "status":return O.card.columnId==="done"?"#10b981":"#3b82f6";case "priority":let q=O.card.priority;return q==="URGENT"?"#ef4444":q==="HIGH"?"#f59e0b":q==="MEDIUM"?"#3b82f6":"#6b7280";case "assignee":return O.card.assigneeId?"#8b5cf6":"#6b7280";default:return "#3b82f6"}},[a.colorScheme]);return e.length===0?jsxRuntime.jsxs("div",{className:d("relationships-graph-empty",g),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:d("relationships-graph",g),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:()=>x(O=>Math.min(O+.2,3)),children:"+"}),jsxRuntime.jsxs("span",{className:"relationships-graph-zoom-value",children:[Math.round(u*100),"%"]}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>x(O=>Math.max(O-.2,.5)),children:"\u2212"}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>{x(1),N({x:0,y:0});},children:"Reset"})]})]}),jsxRuntime.jsx("div",{className:"relationships-graph-legend",children:Array.from(new Set(t.map(O=>O.type))).map(O=>jsxRuntime.jsxs("div",{className:"relationships-graph-legend-item",children:[jsxRuntime.jsx("div",{className:"relationships-graph-legend-color",style:{background:Cl(O)}}),jsxRuntime.jsxs("span",{className:"relationships-graph-legend-label",children:[Np(O)," ",Tl(O)]})]},O))}),jsxRuntime.jsxs("svg",{ref:i,className:"relationships-graph-canvas",width:a.width,height:a.height,onMouseMove:B,onMouseUp:y,onMouseLeave:y,children:[jsxRuntime.jsxs("g",{transform:`translate(${c.x}, ${c.y}) scale(${u})`,children:[jsxRuntime.jsx("g",{className:"relationships-graph-edges",children:t.map(O=>{let q=T(typeof O.source=="string"?O.source:O.source.id),te=T(typeof O.target=="string"?O.target:O.target.id),ne=Dp(O.type),oe=h===O.id,ce=O.onCriticalPath;return jsxRuntime.jsxs("g",{className:d("relationships-graph-edge",oe&&"hovered",ce&&"critical"),onMouseEnter:()=>f(O.id),onMouseLeave:()=>f(null),onClick:be=>P(O,be),children:[jsxRuntime.jsx("line",{x1:q.x,y1:q.y,x2:te.x,y2:te.y,stroke:Cl(O.type),strokeWidth:ce?a.edgeWidth*2:a.edgeWidth,strokeOpacity:oe?1:.6,markerEnd:ne?"url(#arrowhead)":void 0}),a.showEdgeLabels&&oe&&jsxRuntime.jsx("text",{x:(q.x+te.x)/2,y:(q.y+te.y)/2,className:"relationships-graph-edge-label",textAnchor:"middle",children:Tl(O.type)})]},O.id)})}),jsxRuntime.jsx("g",{className:"relationships-graph-nodes",children:p.map(O=>{let q=k===O.id,te=O.onCriticalPath;return jsxRuntime.jsxs("g",{className:d("relationships-graph-node",q&&"hovered",te&&"critical"),transform:`translate(${O.x}, ${O.y})`,onMouseDown:ne=>w(O.id,ne),onMouseEnter:()=>C(O.id),onMouseLeave:()=>C(null),onClick:ne=>I(O,ne),children:[jsxRuntime.jsx("circle",{r:te?a.nodeSize*1.2:a.nodeSize,fill:W(O),stroke:te?"#fbbf24":"#ffffff",strokeWidth:te?3:2,opacity:q?1:.9}),a.showLabels&&jsxRuntime.jsx("text",{y:a.nodeSize+20,className:"relationships-graph-node-label",textAnchor:"middle",children:O.card.title.length>20?O.card.title.substring(0,20)+"...":O.card.title})]},O.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 Mp({isOpen:e,onClose:t,onPlanGenerated:a,onGeneratePlan:r,isLoading:o}){let[s,n]=react.useState(""),[m,g]=react.useState(false),[i,p]=react.useState(null),[l,b]=react.useState(null),v=react.useRef(null),k=m||o;react.useEffect(()=>{e&&v.current&&v.current.focus();},[e]),react.useEffect(()=>{let u=x=>{x.key==="Escape"&&!k&&C();};if(e)return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,k]);let C=()=>{k||(n(""),p(null),b(null),t());},h=async()=>{if(!(!s.trim()||k)){g(true),p(null),b(null);try{let u=await r(s.trim());b(u);}catch(u){p(u instanceof Error?u.message:"Failed to generate plan");}finally{g(false);}}},f=()=>{l&&(a(l),C());};return e?jsxRuntime.jsxs(ft,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:C}),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:u=>u.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:C,disabled:k,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:l?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!"})]}),l.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:l.explanation})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Columns (",l.columns.length,")"]}),jsxRuntime.jsx("div",{className:"flex gap-2 flex-wrap",children:l.columns.map((u,x)=>jsxRuntime.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-white/5 border border-white/20 text-sm text-white/80",children:u.title},x))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Tasks (",l.cards.length,")"]}),jsxRuntime.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[l.cards.slice(0,10).map((u,x)=>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:u.title}),u.description&&jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-1 line-clamp-2",children:u.description})]}),u.priority&&jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${u.priority==="URGENT"?"bg-red-500/20 text-red-400":u.priority==="HIGH"?"bg-orange-500/20 text-orange-400":u.priority==="MEDIUM"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:u.priority})]})},x)),l.cards.length>10&&jsxRuntime.jsxs("p",{className:"text-xs text-white/50 text-center py-2",children:["+",l.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:v,value:s,onChange:u=>n(u.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:k}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),i&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:i}),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((u,x)=>jsxRuntime.jsx("button",{onClick:()=>n(u),disabled:k,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:u},x))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:k&&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:C,disabled:k,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"}),l?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()||k,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#ffffff"},children:k?"Generating...":"Generate Plan"})]})]})]})})]}):null}var Nl={"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 yv={hobby:{requestsPerMonth:50,maxConcurrent:1,maxTokensPerRequest:4096},pro:{requestsPerMonth:500,maxConcurrent:3,maxTokensPerRequest:8192},enterprise:{requestsPerMonth:2e3,maxConcurrent:10,maxTokensPerRequest:16384}},vv={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 xv(e,t,a){let r=Nl[e];if(!r)throw new Error(`Unknown model: ${e}`);let o=t/1e3*r.costPer1kInput,s=a/1e3*r.costPer1kOutput;return o+s}function mn(e){return `$${e.toFixed(4)}`}var Dl=class{constructor(){this.operations=[];this.listeners=[];}record(t){let a=xv(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(l=>l.timestamp>=t.start&&l.timestamp<=t.end));let r=a.length,o=a.reduce((l,b)=>l+b.cost,0),s=a.reduce((l,b)=>l+b.inputTokens,0),n=a.reduce((l,b)=>l+b.outputTokens,0),m=a.filter(l=>l.success),g=a.reduce((l,b)=>l+b.duration,0),i={},p={};return a.forEach(l=>{i[l.feature]=(i[l.feature]||0)+1,p[l.feature]=(p[l.feature]||0)+l.cost;}),{totalOperations:r,totalCost:o,totalInputTokens:s,totalOutputTokens:n,operationsByFeature:i,costsByFeature:p,averageDuration:r>0?g/r:0,successRate:r>0?m.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 m=this.operations.filter(p=>p.timestamp>=n).length,g=Math.max(0,o-m),i=m/o*100;return {used:m,limit:o,remaining:g,percentUsed:i,isExceeded:m>=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)}},fo=new Dl;function Lp({isOpen:e,onClose:t,planTier:a="hobby"}){let[r,o]=react.useState(fo.getStats()),[s,n]=react.useState(fo.checkLimit(a));if(react.useEffect(()=>{if(!e)return;let g=setInterval(()=>{o(fo.getStats()),n(fo.checkLimit(a));},1e3);return ()=>clearInterval(g)},[e,a]),react.useEffect(()=>{let g=i=>{i.key==="Escape"&&t();};if(e)return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[e,t]),!e)return null;let m=fo.getRecentOperations(5);return jsxRuntime.jsxs(ft,{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:g=>g.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:mn(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(([g,i])=>{let p=r.costsByFeature[g]||0,l=r.totalOperations>0?i/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:g.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:[i," ops"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:mn(p)})]})]}),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:`${l}%`}})})]},g)})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Recent Operations"}),m.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:m.map(g=>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:g.feature.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-0.5",children:[new Date(g.timestamp).toLocaleTimeString()," \u2022"," ",g.duration,"ms"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[g.inputTokens+g.outputTokens," tokens"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:mn(g.cost)}),jsxRuntime.jsx("div",{className:`w-2 h-2 rounded-full ${g.success?"bg-green-400":"bg-red-400"}`})]})]},g.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 Rp({isOpen:e,onClose:t,onTasksGenerated:a,onGenerateTasks:r,isLoading:o,projectName:s}){let[n,m]=react.useState(""),[g,i]=react.useState(""),[p,l]=react.useState(""),[b,v]=react.useState(false),[k,C]=react.useState(null),[h,f]=react.useState(null),[u,x]=react.useState(null),c=react.useRef(null),N=b||o;react.useEffect(()=>{e&&c.current&&c.current.focus();},[e]),react.useEffect(()=>{let P=T=>{T.key==="Escape"&&!N&&w();};if(e)return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[e,N]);let w=()=>{N||(m(""),i(""),l(""),C(null),f(null),x(null),t());},B=async()=>{if(!(!n.trim()||N)){v(true),C(null),f(null),x(null);try{let P=await r({prompt:n.trim(),projectName:s||"Mi Proyecto",startDate:g||void 0,endDate:p||void 0});f(P.tasks.tasks),x({from_cache:P.from_cache,tokens_used:P.tokens_used,mock_mode:P.mock_mode,similarity:P.similarity,tokens_saved:P.tokens_saved});}catch(P){C(P instanceof Error?P.message:"Failed to generate tasks");}finally{v(false);}}},y=()=>{h&&(a(h),w());};if(!e)return null;let I=u?.similarity?((u.similarity||0)*100).toFixed(0):"0";return jsxRuntime.jsxs(ft,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:w}),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:P=>P.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:w,disabled:N,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:[u?.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"}),u?.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 (",I,"% 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:[u?.tokens_used||0," tokens"]}),u?.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:[u.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((P,T)=>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:["#",T+1]}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:P.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"})]}),P.start," \u2192 ",P.end]}),jsxRuntime.jsxs("span",{children:[P.duration," days"]}),P.dependencies.length>0&&jsxRuntime.jsxs("span",{className:"text-blue-400",children:["Depends: ",P.dependencies.join(", ")]})]})]}),jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${P.priority==="high"?"bg-red-500/20 text-red-400":P.priority==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:P.priority})]})},P.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:P=>m(P.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:N}),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:g,onChange:P=>i(P.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:N})]}),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:p,onChange:P=>l(P.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:N})]})]}),k&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:k}),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((P,T)=>jsxRuntime.jsx("button",{onClick:()=>m(P),disabled:N,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:P},T))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:N&&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:w,disabled:N,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:y,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:B,disabled:!n.trim()||N,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#ffffff"},children:N?"Generating...":"Generate Tasks"})]})]})]})})]})}function xs({initialBoard:e,onPersist:t}){let[a,r]=react.useState(e),o=react.useCallback(h=>{t&&kn(()=>Promise.resolve(t(h)),{maxAttempts:3,initialDelay:1e3,onRetry:(f,u,x)=>{console.warn(`Retry attempt ${u} after ${x}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,u)=>{r(x=>{let c=x.cards.find(P=>P.id===h);if(!c)return x;let N=c.columnId,w={...c,columnId:f,position:u},B=x.cards.map(P=>P.id===h?w:P),y=x.columns.map(P=>{if(P.id===N)return {...P,cardIds:P.cardIds.filter(T=>T!==h)};if(P.id===f){let T=B.filter(W=>W.columnId===f).sort((W,O)=>W.position-O.position);return {...P,cardIds:T.map(W=>W.id)}}return P}),I={...x,cards:B,columns:y};return o(I),I});},[o]),n=react.useCallback(async(h,f)=>{r(u=>{let x=u.cards.map(N=>N.id===h?{...N,...f}:N),c={...u,cards:x};return o(c),c});},[o]),m=react.useCallback(async h=>{let f=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(u=>{let x={...h,id:f},c=u.columns.map(w=>w.id===h.columnId?{...w,cardIds:[...w.cardIds,f]}:w),N={...u,cards:[...u.cards,x],columns:c};return o(N),N});},[o]),g=react.useCallback(async h=>{r(f=>{let u=f.cards.find(w=>w.id===h);if(!u)return f;let x=f.cards.filter(w=>w.id!==h),c=f.columns.map(w=>w.id===u.columnId?{...w,cardIds:w.cardIds.filter(B=>B!==h)}:w),N={...f,cards:x,columns:c};return o(N),N});},[o]),i=react.useCallback(async h=>{let f=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(u=>{let x={...h,id:f,cardIds:[]},c={...u,columns:[...u.columns,x]};return o(c),c});},[o]),p=react.useCallback(async(h,f)=>{r(u=>{let x=u.columns.map(N=>N.id===h?{...N,...f}:N),c={...u,columns:x};return o(c),c});},[o]),l=react.useCallback(async h=>{r(f=>{let u=f.cards.filter(N=>N.columnId!==h),x=f.columns.filter(N=>N.id!==h),c={...f,cards:u,columns:x};return o(c),c});},[o]),b=react.useCallback(h=>{let f=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return m(h),f},[m]),v=react.useCallback(h=>{let f=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return i(h),f},[i]),k=react.useCallback(()=>{r(h=>{let f={...h,cards:[],columns:[]};return o(f),f});},[o]);return {board:a,callbacks:{onCardMove:s,onCardUpdate:n,onCardCreate:m,onCardDelete:g,onColumnCreate:i,onColumnUpdate:p,onColumnDelete:l},setBoard:r,helpers:{addCard:b,addColumn:v,deleteCard:g,deleteColumn:l,clearBoard:k}}}function $p({initialData:e,availableUsers:t=[],onSave:a}){let{board:r,callbacks:o,helpers:s}=xs({initialBoard:e,onPersist:a}),n=react.useMemo(()=>({addCard:(g,i,p={})=>{s.addCard({title:i,columnId:g,position:r.cards.filter(l=>l.columnId===g).length,...p});},addColumn:(g,i)=>{let p=r.columns.length>0?Math.max(...r.columns.map(l=>l.position)):0;s.addColumn({title:g,position:i??p+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 pn={dateFilter:"all",priorities:[],assignees:[],labels:[],columns:[],search:""},zp={by:"none",order:"asc"};function Hp({initialFilters:e={},initialSort:t={},currentUserId:a}={}){let[r,o]=react.useState({...pn,...e}),[s,n]=react.useState({...zp,...t}),m=react.useCallback(C=>{o(h=>({...h,...C}));},[]),g=react.useCallback(C=>{n(h=>({...h,...C}));},[]),i=react.useCallback(()=>{o(pn),n(zp);},[]),p=react.useCallback(()=>{a&&o({...pn,assignees:[a]});},[a]),l=react.useCallback(()=>{o({...pn,dateFilter:"overdue"});},[]),b=react.useCallback(()=>{o({...pn,priorities:["HIGH","URGENT"]});},[]),v=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]),k=react.useCallback(C=>{let h=[...C];if(r.search){let f=r.search.toLowerCase();h=h.filter(u=>u.title.toLowerCase().includes(f)||u.description?.toLowerCase().includes(f));}if(r.dateFilter!=="all"){let f=new Date,u=f.getFullYear(),x=String(f.getMonth()+1).padStart(2,"0"),c=String(f.getDate()).padStart(2,"0"),N=`${u}-${x}-${c}`;h=h.filter(w=>{if(!w.endDate&&!w.dueDate)return false;let B=w.endDate||w.dueDate;if(!B)return false;let y;if(typeof B=="string")y=B.split("T")[0]||B;else {let I=B.getUTCFullYear(),P=String(B.getUTCMonth()+1).padStart(2,"0"),T=String(B.getUTCDate()).padStart(2,"0");y=`${I}-${P}-${T}`;}switch(r.dateFilter){case "overdue":return y<N;case "today":return y===N;case "this-week":let I=new Date(N+"T00:00:00"),P=new Date(y+"T00:00:00"),T=new Date(I);return T.setDate(T.getDate()+7),P>=I&&P<=T;case "custom":if(r.dateRange){let W=typeof B=="string"?new Date(B):B;return W>=r.dateRange.start&&W<=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(x=>r.assignees.includes(x)))),r.labels.length>0&&(h=h.filter(f=>f.labels&&f.labels.some(u=>r.labels.includes(u)))),r.columns.length>0&&(h=h.filter(f=>r.columns.includes(f.columnId))),s.by!=="none"&&h.sort((f,u)=>{let x=0;switch(s.by){case "created":let c=f.createdAt?new Date(f.createdAt).getTime():0,N=u.createdAt?new Date(u.createdAt).getTime():0;x=c-N;break;case "priority":let w={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},B=w[f.priority||"LOW"],y=w[u.priority||"LOW"];x=B-y;break;case "dueDate":let I=f.endDate||f.dueDate,P=u.endDate||u.dueDate;if(!I)return 1;if(!P)return -1;let T=typeof I=="string"?new Date(I).getTime():I.getTime(),W=typeof P=="string"?new Date(P).getTime():P.getTime();x=T-W;break;case "title":x=f.title.localeCompare(u.title);break;case "estimate":let O=f.estimatedTime||0,q=u.estimatedTime||0;x=O-q;break;default:x=0;}return s.order==="asc"?x:-x}),h},[r,s]);return {filters:r,sort:s,setFilters:m,setSort:g,resetFilters:i,filterMyTasks:p,filterOverdue:l,filterHighPriority:b,applyFilters:k,hasActiveFilters:v}}var Gp,_p;if(typeof window<"u")try{let e=yn("ai");Gp=e.generateObject,_p=e.generateText;}catch{}function Vp(e={}){let[t,a]=react.useState(false),[r,o]=react.useState(null),s=!!(Gp&&_p&&e.apiKey),n=react.useCallback(async l=>{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:",l),{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: ${l}`,position:1e3,columnId:"temp-col-1"}],explanation:"This is a sample plan. Real implementation would use AI SDK."}}catch(b){let v=b instanceof Error?b:new Error("Failed to generate plan");throw o(v),v}finally{a(false);}},[s]),m=react.useCallback(async l=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Suggesting assignee for:",l.title),{userId:"user-123",confidence:.85,reasoning:"Based on past performance and expertise"}}catch(b){let v=b instanceof Error?b:new Error("Failed to suggest assignee");throw o(v),v}finally{a(false);}},[s]),g=react.useCallback(async l=>{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(b){let v=b instanceof Error?b:new Error("Failed to predict risks");throw o(v),v}finally{a(false);}},[s]),i=react.useCallback(async l=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Generating subtasks for:",l.title),[{title:`Subtask 1 for: ${l.title}`,position:l.position+.1,columnId:l.columnId},{title:`Subtask 2 for: ${l.title}`,position:l.position+.2,columnId:l.columnId}]}catch(b){let v=b instanceof Error?b:new Error("Failed to generate subtasks");throw o(v),v}finally{a(false);}},[s]),p=react.useCallback(async l=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Estimating effort for:",l.title),{hours:8,confidence:.75}}catch(b){let v=b instanceof Error?b:new Error("Failed to estimate effort");throw o(v),v}finally{a(false);}},[s]);return {onGeneratePlan:n,onSuggestAssignee:m,onPredictRisks:g,onGenerateSubtasks:i,onEstimateEffort:p,isAvailable:s,isLoading:t,error:r}}function El(){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 jp(e){let{cards:t}=e,[a,r]=El(),o=react.useCallback(l=>a.selectedCardIds.includes(l),[a.selectedCardIds]),s=react.useCallback((l,b)=>{if(!b){r({selectedCardIds:[l],lastSelectedCardId:l});return}let v=b.ctrlKey||b.metaKey,k=b.shiftKey;if(v)a.selectedCardIds.includes(l)?r({selectedCardIds:a.selectedCardIds.filter(C=>C!==l),lastSelectedCardId:a.lastSelectedCardId}):r({selectedCardIds:[...a.selectedCardIds,l],lastSelectedCardId:l});else if(k&&a.lastSelectedCardId){let C=t.find(f=>f.id===l),h=t.find(f=>f.id===a.lastSelectedCardId);if(C&&h&&C.columnId===h.columnId){let f=t.filter(y=>y.columnId===C.columnId).sort((y,I)=>y.position-I.position),u=f.findIndex(y=>y.id===a.lastSelectedCardId),x=f.findIndex(y=>y.id===l),[c,N]=u<x?[u,x]:[x,u],w=f.slice(c,N+1).map(y=>y.id),B=Array.from(new Set([...a.selectedCardIds,...w]));r({selectedCardIds:B,lastSelectedCardId:l});}else r({selectedCardIds:[l],lastSelectedCardId:l});}else r({selectedCardIds:[l],lastSelectedCardId:l});},[t,a,r]),n=react.useCallback(l=>{r({selectedCardIds:a.selectedCardIds.filter(b=>b!==l),lastSelectedCardId:a.lastSelectedCardId});},[a,r]),m=react.useCallback(()=>{r({selectedCardIds:[],lastSelectedCardId:null});},[r]),g=react.useCallback(()=>{r({selectedCardIds:t.map(l=>l.id),lastSelectedCardId:t[t.length-1]?.id||null});},[t,r]),i=react.useCallback(l=>{a.selectedCardIds.includes(l)?n(l):r({selectedCardIds:[...a.selectedCardIds,l],lastSelectedCardId:l});},[a,n,r]),p=react.useCallback(()=>t.filter(l=>a.selectedCardIds.includes(l.id)),[t,a.selectedCardIds]);return {selectedCardIds:a.selectedCardIds,lastSelectedCardId:a.lastSelectedCardId,isCardSelected:o,selectCard:s,deselectCard:n,clearSelection:m,selectAll:g,toggleCard:i,getSelectedCards:p}}var Kp={enableAutoStacking:true,autoStackConfidenceThreshold:.7,minCardsPerStack:2,enableManualStacking:true,showStackSummaries:true,animationDuration:200};function Yp(e){let{cards:t,config:a,aiService:r}=e,o=react.useMemo(()=>({...Kp,...a}),[a]),[s,n]=react.useState([]),m=react.useCallback((C,h,f,u,x)=>{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:C,cardIds:h,columnId:f,strategy:u,color:x,isExpanded:true,position:s.filter(N=>N.columnId===f).length,createdAt:new Date};n(N=>[...N,c]);},[o.minCardsPerStack,s]),g=react.useCallback(C=>{n(h=>h.filter(f=>f.id!==C));},[]),i=react.useCallback(C=>{n(h=>h.map(f=>f.id===C?{...f,isExpanded:!f.isExpanded}:f));},[]),p=react.useCallback((C,h)=>{n(f=>f.map(u=>u.id===C&&!u.cardIds.includes(h)?{...u,cardIds:[...u.cardIds,h]}:u));},[]),l=react.useCallback((C,h)=>{n(f=>f.map(u=>{if(u.id===C){let x=u.cardIds.filter(c=>c!==h);return x.length<o.minCardsPerStack?null:{...u,cardIds:x}}return u}).filter(u=>u!==null));},[o.minCardsPerStack]),b=react.useCallback(C=>s.filter(h=>h.columnId===C).sort((h,f)=>h.position-f.position),[s]),v=react.useCallback(async C=>{let h=t.filter(N=>N.columnId===C);if(h.length<o.minCardsPerStack*2)return [];let f=[],u=new Map;h.forEach(N=>{N.labels&&N.labels.length>0&&N.labels.forEach(w=>{u.has(w)||u.set(w,[]),u.get(w).push(N);});}),u.forEach((N,w)=>{N.length>=o.minCardsPerStack&&f.push({stack:{title:`\u{1F4CC} ${w}`,cardIds:N.map(B=>B.id),columnId:C,strategy:"labels",color:"#3b82f6"},reason:`${N.length} cards with label "${w}"`,confidence:.85});});let x=new Map;h.forEach(N=>{N.assignedUserIds&&N.assignedUserIds.length>0&&N.assignedUserIds.forEach(w=>{x.has(w)||x.set(w,[]),x.get(w).push(N);});}),x.forEach((N,w)=>{N.length>=o.minCardsPerStack&&f.push({stack:{title:`\u{1F464} Assigned to user-${w.slice(-4)}`,cardIds:N.map(B=>B.id),columnId:C,strategy:"assignee",color:"#8b5cf6"},reason:`${N.length} cards assigned to the same user`,confidence:.8});});let c=new Map;if(h.forEach(N=>{N.priority&&(c.has(N.priority)||c.set(N.priority,[]),c.get(N.priority).push(N));}),c.forEach((N,w)=>{if(N.length>=o.minCardsPerStack){let B={low:"\u{1F7E2}",medium:"\u{1F7E1}",high:"\u{1F534}",urgent:"\u{1F6A8}"}[w.toLowerCase()]||"\u26AA";f.push({stack:{title:`${B} ${w} Priority`,cardIds:N.map(y=>y.id),columnId:C,strategy:"priority",color:w==="high"||w==="urgent"?"#ef4444":"#10b981"},reason:`${N.length} cards with ${w} priority`,confidence:.75});}}),r&&o.enableAutoStacking)for(let N of h){let B=(await r.findSimilar(N,h)).filter(y=>y.similarity>=o.autoStackConfidenceThreshold);if(B.length>=o.minCardsPerStack-1){let y=[N.id,...B.map(P=>P.card.id)],I=B.reduce((P,T)=>P+T.similarity,0)/B.length;f.push({stack:{title:`\u2728 Similar to "${N.title.substring(0,30)}${N.title.length>30?"...":""}"`,cardIds:y,columnId:C,strategy:"ai-similarity",color:"#f59e0b"},reason:`AI detected ${B.length+1} similar tasks`,confidence:I});}}return f.filter(N=>N.confidence>=o.autoStackConfidenceThreshold).sort((N,w)=>w.confidence-N.confidence).slice(0,5)},[t,o,r]),k=react.useCallback(C=>{m(C.stack.title,C.stack.cardIds,C.stack.columnId,C.stack.strategy,C.stack.color);},[m]);return react.useEffect(()=>{o.enableAutoStacking&&s.length===0&&new Set(t.map(h=>h.columnId)).forEach(async h=>{let f=await v(h),u=f[0];f.length>0&&u&&u.confidence>=.9&&k(u);});},[]),{stacks:s,createStack:m,deleteStack:g,toggleStack:i,addToStack:p,removeFromStack:l,getStacksForColumn:b,getSuggestions:v,applySuggestion:k,config:o}}var qp=react.createContext(null);function Xp({children:e,initialData:t,onStateChange:a}){let r=react.useRef();if(!r.current){let s=new Map,n=new Map;t?.columns?.forEach(g=>{let{Column:i}=yn("@libxai/core");s.set(g.id,new i(g));}),t?.cards?.forEach(g=>{let{Card:i}=yn("@libxai/core");n.set(g.id,new i(g));});let m=null;if(t?.board){let{Board:g}=yn("@libxai/core");m=new g(t.board);}r.current=new core.BoardStore({board:m,columns:s,cards:n});}let o=r.current;return react.useEffect(()=>{if(a)return o.subscribeAll(s=>{a(o.getState());})},[o,a]),jsxRuntime.jsx(qp.Provider,{value:{store:o},children:e})}function ks(){let e=react.useContext(qp);if(!e)throw new Error("useBoardStore must be used within BoardProvider");return e.store}function gn(){let e=ks(),[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 m=react.useCallback(u=>{e.updateBoard(u);},[e]),g=react.useCallback(u=>{e.addColumn(u);},[e]),i=react.useCallback((u,x)=>{e.updateColumn(u,x);},[e]),p=react.useCallback(u=>{e.deleteColumn(u);},[e]),l=react.useCallback(u=>e.getColumn(u),[e]),b=react.useCallback(u=>{e.addCard(u);},[e]),v=react.useCallback((u,x)=>{e.updateCard(u,x);},[e]),k=react.useCallback(u=>{e.deleteCard(u);},[e]),C=react.useCallback((u,x,c)=>{e.moveCard(u,x,c);},[e]),h=react.useCallback(u=>e.getCard(u),[e]),f=react.useCallback(u=>e.getCardsByColumn(u),[e]);return {board:t,columns:r,cards:s,updateBoard:m,addColumn:g,updateColumn:i,deleteColumn:p,getColumn:l,addCard:b,updateCard:v,deleteCard:k,moveCard:C,getCard:h,getCardsByColumn:f}}function Zp(e){let{cards:t}=gn();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 Qp(e="position",t="asc"){let{cards:a}=gn();return react.useMemo(()=>[...a].sort((o,s)=>{let n=0;switch(e){case "title":n=o.title.localeCompare(s.title);break;case "priority":{let m={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},g=o.priority?m[o.priority]:0,i=s.priority?m[s.priority]:0;n=g-i;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 ws=class{constructor(){this.plugins=new Map;this.enabled=new Set;this.config=new Map;this.context=null;this.pluginLogger=id.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 m=await Promise.resolve(n.apply(s,a));m!==void 0&&(o=m,a[0]=m);}catch(m){this.pluginLogger.error(`Plugin hook failed: ${s.id}.${t}`,m,{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);}},Ov=new ws;function tu({items:e,height:t,estimateSize:a,renderItem:r,className:o="",overscan:s=5,horizontal:n=false,gap:m=0,getItemKey:g}){let i=react.useRef(null),p=reactVirtual.useVirtualizer({count:e.length,getScrollElement:()=>i.current,estimateSize:()=>a,overscan:s,horizontal:n,gap:m}),l=p.getVirtualItems(),b={height:typeof t=="number"?`${t}px`:t,width:"100%",overflow:"auto",position:"relative"},v=n?{width:`${p.getTotalSize()}px`,height:"100%",position:"relative"}:{height:`${p.getTotalSize()}px`,width:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:i,style:b,className:o,children:jsxRuntime.jsx("div",{style:v,children:l.map(k=>{let C=e[k.index];if(!C)return null;let h=g?g(C,k.index):k.index,f={position:"absolute",top:n?0:k.start,left:n?k.start:0,width:n?k.size:"100%",height:n?"100%":k.size};return jsxRuntime.jsx("div",{style:f,"data-index":k.index,children:r(C,k.index)},h)})})})}function au(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 ou({items:e,height:t,width:a="100%",estimateColumnWidth:r,renderColumn:o,className:s="",overscan:n=3,gap:m=16,getItemKey:g,horizontal:i=true}){let p=react.useRef(null),l=reactVirtual.useVirtualizer({horizontal:i,count:e.length,getScrollElement:()=>p.current,estimateSize:()=>r,overscan:n,gap:m}),b=l.getVirtualItems(),v={height:typeof t=="number"?`${t}px`:t,width:typeof a=="number"?`${a}px`:a,overflow:"auto",position:"relative"},k={width:`${l.getTotalSize()}px`,height:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:p,style:v,className:s,children:jsxRuntime.jsx("div",{style:k,children:b.map(C=>{let h=e[C.index];if(!h)return null;let f=g?g(h,C.index):C.index,u={position:"absolute",top:0,left:C.start,width:C.size,height:"100%"};return jsxRuntime.jsx("div",{style:u,"data-index":C.index,children:o(h,C.index)},f)})})})}function nu(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 su(e,t=10){return e>t}var Fl={none:0,xs:4,sm:8,md:12,lg:16,xl:20,"2xl":24,"3xl":32,"4xl":40,"5xl":48,"6xl":64},Ll={none:0,sm:4,md:8,lg:12,xl:16,"2xl":20,full:9999},Il={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48},Bl={light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800},Rl={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},Ol={base:0,dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070},$l={instant:0,fastest:75,faster:100,fast:150,normal:200,slow:300,slower:400,slowest:500},Ul={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)"},zl={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)"},Hl={0:0,5:.05,10:.1,20:.2,30:.3,40:.4,50:.5,60:.6,70:.7,80:.8,90:.9,100:1},Wl={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}},Gl={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}},Cs={spacing:Fl,borderRadius:Ll,fontSize:Il,fontWeight:Bl,lineHeight:Rl,zIndex:Ol,duration:$l,easing:Ul,shadows:zl,opacity:Hl,kanban:Wl,gantt:Gl};function iu(e,t,a){return e[t]??a}function _l(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)?_l(o,s,a):(typeof o=="string"||typeof o=="number")&&(a[s]=o);}return a}function zv(e){return typeof e=="number"?e>0&&e<1e3?`${e}px`:e.toString():e}function Vl(e="asakaa"){let t=_l(Cs),a=[];for(let[r,o]of Object.entries(t)){let s=`--${e}-${r}`,n=zv(o);a.push(` ${s}: ${n};`);}return `:root {
|
|
389
|
+
Today's date: ${new Date().toISOString().split("T")[0]}`}function bm(e){let t=[],a=r=>{for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);};return a(e),t}function Mr(e,t){let a=bm(e),r=t.toLowerCase().trim(),o=a.find(m=>m.name.toLowerCase()===r);if(o)return o;let s=a.find(m=>m.name.toLowerCase().includes(r));if(s)return s;let n=r.split(/\s+/);return a.find(m=>{let g=m.name.toLowerCase();return n.every(i=>g.includes(i))})}function Xi(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 b=new Date(r);return b.setDate(b.getDate()+1),b}if(a==="yesterday"||a==="ayer"){let b=new Date(r);return b.setDate(b.getDate()-1),b}if(a==="next week"||a==="la pr\xF3xima semana"){let b=new Date(r);return b.setDate(b.getDate()+7),b}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 v={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(v!==void 0){let k=new Date(r),C=k.getDay(),h=v-C;return h<=0&&(h+=7),k.setDate(k.getDate()+h),k}}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 b=parseInt(s[1],10),v=s[2].toLowerCase(),k=new Date(r);return v==="day"||v==="d\xEDa"||v==="dias"?k.setDate(k.getDate()+b):v==="week"||v==="semana"||v==="semanas"?k.setDate(k.getDate()+b*7):(v==="month"||v==="mes"||v==="meses")&&k.setMonth(k.getMonth()+b),k}if(a.match(/(\d{4})-(\d{2})-(\d{2})/))return new Date(a);let m=a.match(/(\d{1,2})\/(\d{1,2})\/(\d{4})/);if(m&&m[1]&&m[2]&&m[3]){let b=parseInt(m[1],10),v=parseInt(m[2],10)-1,k=parseInt(m[3],10);return new Date(k,v,b)}let g={enero:0,febrero:1,marzo:2,abril:3,mayo:4,junio:5,julio:6,agosto:7,septiembre:8,octubre:9,noviembre:10,diciembre:11},i=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(i&&i[1]&&i[2]){let b=parseInt(i[1],10),v=g[i[2].toLowerCase()],k=i[3]?parseInt(i[3],10):r.getFullYear();if(v!==void 0)return new Date(k,v,b)}let p={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},l=a.match(/(january|february|march|april|may|june|july|august|september|october|november|december)\s+(\d{1,2})(?:,?\s+(\d{4}))?/i);if(l&&l[1]&&l[2]){let b=p[l[1].toLowerCase()],v=parseInt(l[2],10),k=l[3]?parseInt(l[3],10):r.getFullYear();if(b!==void 0)return new Date(k,b,v)}return null}function Ji(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 Zi(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 hm(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 ym(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 i=r[1].trim(),p=r[2].trim(),l=Mr(t,i),b=Xi(p);if(!l)return {type:"move_task",taskName:i,message:`Could not find a task named "${i}". Please check the task name and try again.`,success:false,error:"Task not found"};if(!b)return {type:"move_task",taskId:l.id,taskName:l.name,message:`Could not parse the date "${p}". Try using formats like "next Monday", "in 3 days", or "2024-01-15".`,success:false,error:"Invalid date"};let v=l.startDate&&l.endDate?Math.round((l.endDate.getTime()-l.startDate.getTime())/(1e3*60*60*24)):1,k=new Date(b);return k.setDate(k.getDate()+v),{type:"move_task",taskId:l.id,taskName:l.name,updates:{startDate:b,endDate:k},message:`Moved "${l.name}" to ${b.toLocaleDateString()}.`,success:true}}let o=a.match(/(?:extend|extender|extiende|alargar)\s+["""]?(.+?)["""]?\s+(?:by|por)\s+(.+)/i);if(o&&o[1]&&o[2]){let i=o[1].trim(),p=o[2].trim(),l=Mr(t,i),b=Ji(p);if(!l)return {type:"resize_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"};if(!b||!l.endDate)return {type:"resize_task",taskId:l.id,taskName:l.name,message:`Could not parse the duration "${p}".`,success:false,error:"Invalid duration"};let v=new Date(l.endDate);return v.setDate(v.getDate()+b),{type:"resize_task",taskId:l.id,taskName:l.name,updates:{endDate:v},message:`Extended "${l.name}" by ${b} days. New end date: ${v.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 i=s[1].trim(),p=s[2].trim(),l=Mr(t,i),b=Zi(p);return l?b===null?{type:"set_progress",taskId:l.id,taskName:l.name,message:`Could not parse the progress value "${p}".`,success:false,error:"Invalid progress"}:{type:"set_progress",taskId:l.id,taskName:l.name,updates:{progress:b},message:`Set "${l.name}" progress to ${b}%.`,success:true}:{type:"set_progress",taskName:i,message:`Could not find a task named "${i}".`,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 i=n[1].trim(),p=n[2].trim(),l=Mr(t,i);return l?{type:"rename_task",taskId:l.id,taskName:l.name,updates:{name:p},message:`Renamed "${l.name}" to "${p}".`,success:true}:{type:"rename_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}let m=a.match(/(?:link|vincular|conectar)\s+["""]?(.+?)["""]?\s+(?:to|a|con)\s+["""]?(.+?)["""]?$/i);if(m&&m[1]&&m[2]){let i=m[1].trim(),p=m[2].trim(),l=Mr(t,i),b=Mr(t,p);return l?b?{type:"link_tasks",taskId:b.id,taskName:b.name,dependencyFrom:l.id,dependencyTo:b.id,message:`Linked "${l.name}" \u2192 "${b.name}".`,success:true}:{type:"link_tasks",taskName:p,message:`Could not find a task named "${p}".`,success:false,error:"Target task not found"}:{type:"link_tasks",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Source task not found"}}let g=a.match(/(?:delete|eliminar|borrar|remove|quitar)\s+["""]?(.+?)["""]?$/i);if(g&&g[1]){let i=g[1].trim(),p=Mr(t,i);return p?{type:"delete_task",taskId:p.id,taskName:p.name,message:`Deleted "${p.name}".`,success:true}:{type:"delete_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}return null}function vm(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 dh(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 ch(e){switch(e){case "todo":return "TODO";case "in-progress":return "IN_PROGRESS";case "completed":return "DONE";default:return e||"TODO"}}function rs(e,t=[],a=[]){let r=e.assignedUserIds?.map(p=>{let l=a.find(b=>b.id===p);return l?{name:l.name,initials:l.initials,color:l.color}:null}).filter(p=>p!==null),o=t.filter(p=>p.metadata?.parentCardId===e.id).map(p=>rs(p,t,a)),s;e.dependencies&&(typeof e.dependencies[0]=="string"?s=e.dependencies:s=e.dependencies.filter(p=>p.type==="finish-to-start").map(p=>p.taskId));let n=p=>{if(p)return typeof p=="string"?new Date(p):p},m=n(e.startDate),g=n(e.endDate),i=e.metadata?.isMilestone===true||m&&g&&Math.abs(g.getTime()-m.getTime())<=864e5;return {id:e.id,name:e.title,startDate:m,endDate:g,progress:e.progress||0,status:dh(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:i,isCriticalPath:e.metadata?.isCriticalPath===true}}function xm(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:ch(e.status),isExpanded:e.isExpanded,isMilestone:e.isMilestone,isCriticalPath:e.isCriticalPath}}}function km(e,t=[]){return e.filter(r=>!r.metadata?.parentCardId).map(r=>rs(r,e,t))}var Qi={columns:{name:"Task Name",startDate:"Start Date",endDate:"End Date",progress:"Progress",status:"Status",assignees:"Assignees",priority:"Priority",actions:"Actions"},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"}},el={columns:{name:"Nombre de Tarea",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",status:"Estado",assignees:"Asignados",priority:"Prioridad",actions:"Acciones"},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"}},os={en:Qi,es:el};function tl(e){return os[e]||os.en}function ns(e,t){let a=tl(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 al=[{value:"todo",icon:lucideReact.Circle,color:"text-gray-400"},{value:"in-progress",icon:lucideReact.PlayCircle,color:"text-blue-500"},{value:"completed",icon:lucideReact.CheckCircle2,color:"text-green-500"}];function wm({value:e,onChange:t,isDark:a,translations:r,disabled:o=false}){let[s,n]=react.useState(false),m=react.useRef(null);react.useEffect(()=>{let b=v=>{m.current&&!m.current.contains(v.target)&&n(false);};return s&&document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[s]);let g=al[0],i=al.find(b=>b.value===e)??g,p=i.icon,l=b=>{switch(b){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(p,{className:d("w-4 h-4",i.color)}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:l(e)})]}):jsxRuntime.jsxs("div",{ref:m,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:b=>{b.stopPropagation(),n(!s);},className:d("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(p,{className:d("w-4 h-4",i.color)}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:l(e)}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3",a?"text-[#6B7280]":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:d("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[140px]",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:al.map(b=>{let v=b.icon;return jsxRuntime.jsxs("button",{onClick:k=>{k.stopPropagation(),t(b.value),n(false);},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",e===b.value&&(a?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx(v,{className:d("w-4 h-4",b.color)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:l(b.value)})]},b.value)})})]})}var rl=[{value:"urgent",label:{en:"Urgent",es:"Urgente"},color:"text-red-500",bg:"bg-red-500"},{value:"high",label:{en:"High",es:"Alta"},color:"text-orange-500",bg:"bg-orange-500"},{value:"medium",label:{en:"Medium",es:"Media"},color:"text-yellow-500",bg:"bg-yellow-500"},{value:"low",label:{en:"Low",es:"Baja"},color:"text-blue-500",bg:"bg-blue-500"},{value:"none",label:{en:"None",es:"Ninguna"},color:"text-gray-400",bg:"bg-gray-400"}];function Tm({value:e="none",onChange:t,isDark:a,locale:r,disabled:o=false}){let[s,n]=react.useState(false),m=react.useRef(null);react.useEffect(()=>{let p=l=>{m.current&&!m.current.contains(l.target)&&n(false);};return s&&document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[s]);let g=rl.find(p=>p.value===e)??rl[4],i=r==="es"?"es":"en";return o||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Flag,{className:d("w-4 h-4",g.color)}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:g.label[i]})]}):jsxRuntime.jsxs("div",{ref:m,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:p=>{p.stopPropagation(),n(!s);},className:d("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Flag,{className:d("w-4 h-4",g.color)}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:g.label[i]}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3",a?"text-[#6B7280]":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:d("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px]",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:rl.map(p=>jsxRuntime.jsxs("button",{onClick:l=>{l.stopPropagation(),t(p.value),n(false);},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",e===p.value&&(a?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:d("w-2 h-2 rounded-full",p.bg)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:p.label[i]})]},p.value))})]})}function ls(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function ds(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 Dm({value:e=[],availableUsers:t=[],onChange:a,isDark:r,locale:o,disabled:s=false}){let[n,m]=react.useState(false),[g,i]=react.useState(""),p=react.useRef(null);react.useEffect(()=>{let k=C=>{p.current&&!p.current.contains(C.target)&&(m(false),i(""));};return n&&document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[n]);let l=t.filter(k=>k.name.toLowerCase().includes(g.toLowerCase())||k.email?.toLowerCase().includes(g.toLowerCase())),b=k=>e.some(C=>C.name===k),v=k=>{if(a)if(b(k.name))a(e.filter(C=>C.name!==k.name));else {let C={name:k.name,initials:ls(k.name),color:k.color||ds(k.name).replace("bg-","").replace("-500",""),avatar:k.avatarUrl};a([...e,C]);}};return s||!a?e.length===0?jsxRuntime.jsx("span",{className:d("text-sm",r?"text-[#6B7280]":"text-gray-400"),children:"-"}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-2",children:[e.slice(0,3).map((k,C)=>jsxRuntime.jsx("div",{className:d("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium text-white border-2",r?"border-[#0F1117]":"border-white",!k.avatar&&ds(k.name)),style:k.color&&!k.avatar?{backgroundColor:k.color}:void 0,title:k.name,children:k.avatar?jsxRuntime.jsx("img",{src:k.avatar,alt:k.name,className:"w-full h-full rounded-full object-cover"}):k.initials||ls(k.name)},`${k.name}-${C}`)),e.length>3&&jsxRuntime.jsxs("div",{className:d("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium border-2",r?"bg-[#374151] border-[#0F1117] text-white":"bg-gray-200 border-white text-gray-600"),children:["+",e.length-3]})]}):jsxRuntime.jsxs("div",{ref:p,className:"relative",children:[jsxRuntime.jsx("button",{onClick:k=>{k.stopPropagation(),m(!n);},className:d("flex items-center gap-1 px-2 py-1 rounded transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100"),children:e.length===0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.User,{className:d("w-4 h-4",r?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx(lucideReact.Plus,{className:d("w-3 h-3",r?"text-[#6B7280]":"text-gray-400")})]}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-1",children:[e.slice(0,2).map((k,C)=>jsxRuntime.jsx("div",{className:d("w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-medium text-white border",r?"border-[#0F1117]":"border-white",!k.avatar&&ds(k.name)),style:k.color&&!k.avatar?{backgroundColor:k.color}:void 0,children:k.avatar?jsxRuntime.jsx("img",{src:k.avatar,alt:k.name,className:"w-full h-full rounded-full object-cover"}):k.initials||ls(k.name)},`${k.name}-${C}`)),e.length>2&&jsxRuntime.jsxs("span",{className:d("text-xs ml-1",r?"text-[#9CA3AF]":"text-gray-500"),children:["+",e.length-2]})]})}),n&&jsxRuntime.jsxs("div",{className:d("absolute z-50 top-full left-0 mt-1 rounded-lg shadow-lg border w-64",r?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsx("div",{className:"p-2 border-b",style:{borderColor:r?"rgba(255,255,255,0.1)":"#E5E7EB"},children:jsxRuntime.jsx("input",{type:"text",value:g,onChange:k=>i(k.target.value),placeholder:o==="es"?"Buscar usuario...":"Search user...",className:d("w-full px-3 py-1.5 text-sm rounded border outline-none",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400"),onClick:k=>k.stopPropagation()})}),jsxRuntime.jsx("div",{className:"max-h-48 overflow-y-auto py-1",children:l.length===0?jsxRuntime.jsx("p",{className:d("px-3 py-2 text-sm",r?"text-[#6B7280]":"text-gray-400"),children:o==="es"?"No se encontraron usuarios":"No users found"}):l.map(k=>jsxRuntime.jsxs("button",{onClick:C=>{C.stopPropagation(),v(k);},className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx("div",{className:d("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium text-white",!k.avatarUrl&&ds(k.name)),children:k.avatarUrl?jsxRuntime.jsx("img",{src:k.avatarUrl,alt:k.name,className:"w-full h-full rounded-full object-cover"}):ls(k.name)}),jsxRuntime.jsxs("div",{className:"flex-1 text-left",children:[jsxRuntime.jsx("div",{className:r?"text-white":"text-gray-900",children:k.name}),k.email&&jsxRuntime.jsx("div",{className:d("text-xs",r?"text-[#6B7280]":"text-gray-400"),children:k.email})]}),b(k.name)&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-green-500"})]},k.id))}),e.length>0&&jsxRuntime.jsx("div",{className:"p-2 border-t flex flex-wrap gap-1",style:{borderColor:r?"rgba(255,255,255,0.1)":"#E5E7EB"},children:e.map((k,C)=>jsxRuntime.jsxs("span",{className:d("inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded-full",r?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:[k.name,jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),a(e.filter(f=>f.name!==k.name));},className:"hover:text-red-500",children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},`${k.name}-${C}`))})]})]})}var Ih={en:["January","February","March","April","May","June","July","August","September","October","November","December"],es:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"]},Bh={en:["Su","Mo","Tu","We","Th","Fr","Sa"],es:["Do","Lu","Ma","Mi","Ju","Vi","S\xE1"]};function cs({value:e,onChange:t,isDark:a,locale:r,disabled:o=false}){let[s,n]=react.useState(false),[m,g]=react.useState(()=>{if(e){let h=e instanceof Date?e:new Date(e);return new Date(h.getFullYear(),h.getMonth(),1)}return new Date(new Date().getFullYear(),new Date().getMonth(),1)}),i=react.useRef(null),p=e?e instanceof Date?e:new Date(e):null,l=r==="es"?"es":"en";react.useEffect(()=>{let h=f=>{i.current&&!i.current.contains(f.target)&&n(false);};return s&&document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s]);let b=h=>h?h.toLocaleDateString(r==="es"?"es-ES":"en-US",{day:"numeric",month:"short"}):"-",v=(h,f)=>new Date(h,f+1,0).getDate(),k=(h,f)=>new Date(h,f,1).getDay(),C=()=>{let h=m.getFullYear(),f=m.getMonth(),u=v(h,f),x=k(h,f),c=new Date,N=[];for(let w=0;w<x;w++)N.push(jsxRuntime.jsx("div",{className:"w-8 h-8"},`empty-${w}`));for(let w=1;w<=u;w++){let B=new Date(h,f,w),y=p&&p.getDate()===w&&p.getMonth()===f&&p.getFullYear()===h,I=c.getDate()===w&&c.getMonth()===f&&c.getFullYear()===h;N.push(jsxRuntime.jsx("button",{onClick:P=>{P.stopPropagation(),t?.(B),n(false);},className:d("w-8 h-8 rounded-full text-sm transition-colors",y?"bg-[#3B82F6] text-white":I?a?"bg-white/10 text-white":"bg-gray-100 text-gray-900":a?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-900"),children:w},w));}return N};return o||!t?jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:b(p)}):jsxRuntime.jsxs("div",{ref:i,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:h=>{h.stopPropagation(),n(!s);},className:d("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:d("w-4 h-4",a?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:b(p)})]}),s&&jsxRuntime.jsxs("div",{className:d("absolute z-50 top-full left-0 mt-1 p-3 rounded-lg shadow-lg border",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),g(new Date(m.getFullYear(),m.getMonth()-1,1));},className:d("p-1 rounded",a?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:d("w-4 h-4",a?"text-white":"text-gray-600")})}),jsxRuntime.jsxs("span",{className:d("text-sm font-medium",a?"text-white":"text-gray-900"),children:[Ih[l][m.getMonth()]," ",m.getFullYear()]}),jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),g(new Date(m.getFullYear(),m.getMonth()+1,1));},className:d("p-1 rounded",a?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:d("w-4 h-4",a?"text-white":"text-gray-600")})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-1",children:Bh[l].map(h=>jsxRuntime.jsx("div",{className:d("w-8 h-6 text-xs flex items-center justify-center",a?"text-[#6B7280]":"text-gray-400"),children:h},h))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:C()}),jsxRuntime.jsxs("div",{className:"mt-3 pt-3 border-t flex gap-2",style:{borderColor:a?"rgba(255,255,255,0.1)":"#E5E7EB"},children:[jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),t?.(new Date),n(false);},className:d("flex-1 py-1.5 text-xs rounded",a?"bg-white/10 text-white hover:bg-white/20":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:r==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation();let f=new Date;f.setDate(f.getDate()+1),t?.(f),n(false);},className:d("flex-1 py-1.5 text-xs rounded",a?"bg-white/10 text-white hover:bg-white/20":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:r==="es"?"Ma\xF1ana":"Tomorrow"})]})]})]})}function Mm({value:e=0,onChange:t,isDark:a,disabled:r=false}){return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 w-full",children:[jsxRuntime.jsx("div",{onClick:s=>{if(r||!t)return;s.stopPropagation();let n=s.currentTarget.getBoundingClientRect(),m=s.clientX-n.left,g=Math.round(m/n.width*100),i=Math.max(0,Math.min(100,g));t(i);},className:d("flex-1 h-2 rounded-full overflow-hidden",a?"bg-white/10":"bg-gray-200",!r&&t&&"cursor-pointer"),children:jsxRuntime.jsx("div",{className:d("h-full rounded-full transition-all",e===100?"bg-green-500":"bg-[#3B82F6]"),style:{width:`${e}%`}})}),jsxRuntime.jsxs("span",{className:d("text-xs w-8 text-right",a?"text-[#9CA3AF]":"text-gray-500"),children:[e,"%"]})]})}function Lm({value:e="",onChange:t,isDark:a,placeholder:r="-",disabled:o=false}){let[s,n]=react.useState(false),[m,g]=react.useState(e),i=react.useRef(null);react.useEffect(()=>{s&&i.current&&(i.current.focus(),i.current.select());},[s]),react.useEffect(()=>{g(e);},[e]);let p=()=>{m!==e&&t?.(m),n(false);},l=b=>{b.key==="Enter"?p():b.key==="Escape"&&(g(e),n(false));};return o||!t?jsxRuntime.jsx("span",{className:d("text-sm truncate",a?"text-[#94A3B8]":"text-gray-500"),children:e||r}):s?jsxRuntime.jsx("input",{ref:i,type:"text",value:m,onChange:b=>g(b.target.value),onBlur:p,onKeyDown:l,onClick:b=>b.stopPropagation(),className:d("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/5 border-[#3B82F6] text-white":"bg-white border-[#3B82F6] text-gray-900")}):jsxRuntime.jsx("button",{onClick:b=>{b.stopPropagation(),n(true);},className:d("text-sm truncate text-left w-full px-2 py-1 rounded transition-colors",a?"text-[#94A3B8] hover:bg-white/10":"text-gray-500 hover:bg-gray-100",!e&&(a?"text-[#6B7280]":"text-gray-400")),children:e||r})}function Rm({value:e,onChange:t,isDark:a,placeholder:r="-",min:o,max:s,disabled:n=false}){let[m,g]=react.useState(false),[i,p]=react.useState(e?.toString()||""),l=react.useRef(null);react.useEffect(()=>{m&&l.current&&(l.current.focus(),l.current.select());},[m]),react.useEffect(()=>{p(e?.toString()||"");},[e]);let b=()=>{let k=parseFloat(i);if(!isNaN(k)){let C=k;o!==void 0&&(C=Math.max(o,C)),s!==void 0&&(C=Math.min(s,C)),C!==e&&t?.(C);}g(false);},v=k=>{k.key==="Enter"?b():k.key==="Escape"&&(p(e?.toString()||""),g(false));};return n||!t?jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:e!==void 0?e:r}):m?jsxRuntime.jsx("input",{ref:l,type:"number",value:i,onChange:k=>p(k.target.value),onBlur:b,onKeyDown:v,onClick:k=>k.stopPropagation(),min:o,max:s,className:d("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/5 border-[#3B82F6] text-white":"bg-white border-[#3B82F6] text-gray-900")}):jsxRuntime.jsx("button",{onClick:k=>{k.stopPropagation(),g(true);},className:d("text-sm text-left w-full px-2 py-1 rounded transition-colors",a?"text-[#94A3B8] hover:bg-white/10":"text-gray-500 hover:bg-gray-100",e===void 0&&(a?"text-[#6B7280]":"text-gray-400")),children:e!==void 0?e:r})}function Om({value:e,options:t=[],onChange:a,isDark:r,placeholder:o="-",disabled:s=false}){let[n,m]=react.useState(false),g=react.useRef(null);return react.useEffect(()=>{let i=p=>{g.current&&!g.current.contains(p.target)&&m(false);};return n&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n]),s||!a?jsxRuntime.jsx("span",{className:d("text-sm",r?"text-[#94A3B8]":"text-gray-500"),children:e||o}):jsxRuntime.jsxs("div",{ref:g,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:i=>{i.stopPropagation(),m(!n);},className:d("flex items-center gap-2 px-2 py-1 rounded transition-colors min-w-[80px]",r?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx("span",{className:d("text-sm flex-1 text-left truncate",r?"text-[#94A3B8]":"text-gray-500",!e&&(r?"text-[#6B7280]":"text-gray-400")),children:e||o}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3 flex-shrink-0",r?"text-[#6B7280]":"text-gray-400")})]}),n&&jsxRuntime.jsx("div",{className:d("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-[#1F2937] border-white/10":"bg-white border-gray-200"),children:t.length===0?jsxRuntime.jsx("p",{className:d("px-3 py-2 text-sm",r?"text-[#6B7280]":"text-gray-400"),children:"No options"}):t.map(i=>jsxRuntime.jsxs("button",{onClick:p=>{p.stopPropagation(),a(i),m(false);},className:d("w-full flex items-center justify-between gap-2 px-3 py-2 text-sm transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100",e===i&&(r?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:i}),e===i&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-[#3B82F6]"})]},i))})]})}function Um({value:e=false,onChange:t,isDark:a,disabled:r=false}){return jsxRuntime.jsx("button",{onClick:s=>{s.stopPropagation(),!r&&t&&t(!e);},disabled:r||!t,className:d("w-5 h-5 rounded border-2 flex items-center justify-center transition-colors",e?"bg-[#3B82F6] border-[#3B82F6]":a?"border-[#4B5563] hover:border-[#6B7280]":"border-gray-300 hover:border-gray-400",(r||!t)&&"opacity-50 cursor-not-allowed"),children:e&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})})}function Wm({value:e=[],isDark:t,maxVisible:a=2}){if(e.length===0)return jsxRuntime.jsx("span",{className:d("text-sm",t?"text-[#6B7280]":"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-xs rounded-full",style:{backgroundColor:s.color?`${s.color}20`:t?"rgba(255,255,255,0.1)":"#F3F4F6",color:s.color||(t?"#9CA3AF":"#6B7280")},children:s.name},s.id)),o>0&&jsxRuntime.jsxs("span",{className:d("inline-flex items-center px-2 py-0.5 text-xs rounded-full",t?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-500"),children:["+",o]})]})}function ry(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function oy(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 jm({state:e,onClose:t,isDark:a,locale:r,onTaskEdit:o,onTaskDuplicate:s,onTaskDelete:n,onTaskUpdate:m,onColumnHide:g,onColumnSort:i,availableUsers:p=[]}){let l=react.useRef(null),b=r==="es"?_m.es:_m.en;if(react.useEffect(()=>{let f=x=>{l.current&&!l.current.contains(x.target)&&t();},u=x=>{x.key==="Escape"&&t();};return document.addEventListener("mousedown",f),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",u);}},[t]),!e.isOpen)return null;let v=()=>{if(!e.task)return [];let f=[];return o&&f.push({id:"edit",label:b.edit,icon:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),onClick:()=>{o(e.task),t();}}),f.push({id:"sep1",label:"",icon:null,separator:true}),m&&(f.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:()=>{m({...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:()=>{m({...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:()=>{m({...e.task,status:"completed",progress:100}),t();}}]}),f.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:()=>{m({...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:()=>{m({...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:()=>{m({...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:()=>{m({...e.task,priority:"low"}),t();}}]}),p.length>0&&f.push({id:"assign",label:b.assignUser,icon:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),submenu:p.slice(0,5).map(u=>({id:`assign-${u.id}`,label:u.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:u.name.charAt(0).toUpperCase()}),onClick:()=>{let x=e.task.assignees||[],N=x.some(w=>w.name===u.name)?x.filter(w=>w.name!==u.name):[...x,{name:u.name,initials:ry(u.name),color:u.color||oy(u.name),avatar:u.avatarUrl}];m({...e.task,assignees:N}),t();}}))})),f.push({id:"sep2",label:"",icon:null,separator:true}),s&&f.push({id:"duplicate",label:b.duplicate,icon:jsxRuntime.jsx(lucideReact.Copy,{className:"w-4 h-4"}),onClick:()=>{s(e.task),t();}}),n&&f.push({id:"delete",label:b.delete,icon:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),danger:true,onClick:()=>{n(e.task.id),t();}}),f},k=()=>{if(!e.columnId)return [];let f=[];return i&&(f.push({id:"sort-asc",label:b.sortAsc,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),onClick:()=>{i(e.columnId,"asc"),t();}}),f.push({id:"sort-desc",label:b.sortDesc,icon:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),onClick:()=>{i(e.columnId,"desc"),t();}})),g&&e.columnId!=="name"&&(f.push({id:"sep-hide",label:"",icon:null,separator:true}),f.push({id:"hide",label:b.hideColumn,icon:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),onClick:()=>{g(e.columnId),t();}})),f},C=e.type==="task"?v():k(),h={position:"fixed",left:e.x,top:e.y,zIndex:9999};return jsxRuntime.jsx("div",{ref:l,style:h,className:d("py-1 rounded-lg shadow-xl border min-w-[180px]",a?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:C.map(f=>f.separator?jsxRuntime.jsx("div",{className:d("my-1 h-px",a?"bg-white/10":"bg-gray-200")},f.id):f.submenu?jsxRuntime.jsx(ny,{item:f,isDark:a},f.id):jsxRuntime.jsxs("button",{onClick:f.onClick,className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",f.danger?"text-red-500 hover:text-red-600":a?"text-white":"text-gray-700"),children:[jsxRuntime.jsx("span",{className:d(f.danger?"text-red-500":a?"text-[#9CA3AF]":"text-gray-400"),children:f.icon}),f.label]},f.id))})}function ny({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:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-[#9CA3AF]":"text-gray-400",children:e.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:e.label}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:d("w-4 h-4",t?"text-[#6B7280]":"text-gray-400")})]}),a&&e.submenu&&jsxRuntime.jsx("div",{className:d("absolute left-full top-0 ml-1 py-1 rounded-lg shadow-xl border min-w-[160px]",t?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:e.submenu.map(m=>jsxRuntime.jsxs("button",{onClick:m.onClick,className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-[#9CA3AF]":"text-gray-400",children:m.icon}),m.label]},m.id))})]})}var _m={en:{edit:"Edit",changeStatus:"Change status",changePriority:"Change priority",assignUser:"Assign user",duplicate:"Duplicate",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"},es:{edit:"Editar",changeStatus:"Cambiar estado",changePriority:"Cambiar prioridad",assignUser:"Asignar usuario",duplicate:"Duplicar",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"}};var qm={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"}),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"})},ky=["name","status","priority","assignees","startDate","endDate","progress","tags"];function Jm({isOpen:e,onClose:t,columns:a,customFields:r=[],onColumnsChange:o,onCreateCustomField:s,isDark:n,locale:m}){let[g,i]=react.useState(""),p=react.useRef(null),l=m==="es"?Xm.es:Xm.en;if(react.useEffect(()=>{if(!e)return;let f=setTimeout(()=>{let u=c=>{p.current&&!p.current.contains(c.target)&&t();},x=c=>{c.key==="Escape"&&t();};document.addEventListener("mousedown",u),document.addEventListener("keydown",x),p._cleanup=()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",x);};},100);return ()=>{clearTimeout(f),p._cleanup&&p._cleanup();}},[e,t]),!e)return null;let b=f=>l.columns[f]||f,v=f=>{if(f==="name")return;let u=a.map(x=>x.id===f?{...x,visible:!x.visible}:x);o(u);},k=(f,u)=>{let x=a.find(N=>N.type===f&&(!u||N.customFieldId===u));if(x){v(x.id);return}let c={id:u||f,type:f,label:u?r.find(N=>N.id===u)?.name||f:b(f),width:120,visible:true,sortable:true,resizable:true,customFieldId:u};o([...a,c]);},C=ky.filter(f=>b(f).toLowerCase().includes(g.toLowerCase())),h=r.filter(f=>f.name.toLowerCase().includes(g.toLowerCase()));return jsxRuntime.jsxs("div",{ref:p,className:d("absolute right-0 top-full mt-1 w-72 rounded-lg shadow-xl border z-50",n?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:d("flex items-center justify-between px-4 py-3 border-b",n?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:d("font-medium",n?"text-white":"text-gray-900"),children:l.title}),jsxRuntime.jsx("button",{onClick:t,className:d("p-1 rounded",n?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.X,{className:d("w-4 h-4",n?"text-[#9CA3AF]":"text-gray-400")})})]}),jsxRuntime.jsx("div",{className:"p-3",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:d("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",n?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:g,onChange:f=>i(f.target.value),placeholder:l.searchPlaceholder,className:d("w-full pl-9 pr-3 py-2 text-sm rounded-lg border outline-none",n?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400")})]})}),jsxRuntime.jsxs("div",{className:"px-3 pb-2",children:[jsxRuntime.jsx("h4",{className:d("text-xs font-medium uppercase tracking-wider mb-2",n?"text-[#6B7280]":"text-gray-400"),children:l.standardFields}),jsxRuntime.jsx("div",{className:"space-y-1",children:C.map(f=>{let u=a.find(N=>N.type===f&&!N.customFieldId),x=u?.visible??false,c=f==="name";return jsxRuntime.jsxs("button",{onClick:()=>{c||(u?v(u.id):k(f));},disabled:c,className:d("w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",n?"hover:bg-white/10":"hover:bg-gray-100",c&&"opacity-50 cursor-not-allowed"),children:[jsxRuntime.jsx("div",{className:d("w-5 h-5 rounded border flex items-center justify-center",x?"bg-[#3B82F6] border-[#3B82F6]":n?"border-[#4B5563]":"border-gray-300"),children:x&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:n?"text-[#9CA3AF]":"text-gray-400",children:qm[f]}),jsxRuntime.jsx("span",{className:n?"text-white":"text-gray-900",children:b(f)})]},f)})})]}),h.length>0&&jsxRuntime.jsxs("div",{className:"px-3 pb-2",children:[jsxRuntime.jsx("h4",{className:d("text-xs font-medium uppercase tracking-wider mb-2",n?"text-[#6B7280]":"text-gray-400"),children:l.customFields}),jsxRuntime.jsx("div",{className:"space-y-1",children:h.map(f=>{let x=a.find(c=>c.customFieldId===f.id)?.visible??false;return jsxRuntime.jsxs("button",{onClick:()=>k(f.type,f.id),className:d("w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",n?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx("div",{className:d("w-5 h-5 rounded border flex items-center justify-center",x?"bg-[#3B82F6] border-[#3B82F6]":n?"border-[#4B5563]":"border-gray-300"),children:x&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:n?"text-[#9CA3AF]":"text-gray-400",children:qm[f.type]||jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"})}),jsxRuntime.jsx("span",{className:n?"text-white":"text-gray-900",children:f.name})]},f.id)})})]}),s&&jsxRuntime.jsx("div",{className:d("p-3 border-t",n?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:s,className:d("w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-colors",n?"bg-[#3B82F6]/20 text-[#3B82F6] hover:bg-[#3B82F6]/30":"bg-blue-50 text-blue-600 hover:bg-blue-100"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),l.createField]})})]})}var Xm={en:{title:"Columns",searchPlaceholder:"Search fields...",standardFields:"Standard Fields",customFields:"Custom Fields",createField:"Create custom field",columns:{name:"Name",status:"Status",priority:"Priority",assignees:"Assignees",startDate:"Start Date",endDate:"End Date",progress:"Progress",tags:"Tags",text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox"}},es:{title:"Columnas",searchPlaceholder:"Buscar campos...",standardFields:"Campos Est\xE1ndar",customFields:"Campos Personalizados",createField:"Crear campo personalizado",columns:{name:"Nombre",status:"Estado",priority:"Prioridad",assignees:"Asignados",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",tags:"Etiquetas",text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla"}}};var My=[{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 ep({isOpen:e,onClose:t,onSave:a,isDark:r,locale:o}){let[s,n]=react.useState(""),[m,g]=react.useState("text"),[i,p]=react.useState([""]),l=o==="es"?Qm.es:Qm.en;react.useEffect(()=>{e&&(n(""),g("text"),p([""]));},[e]),react.useEffect(()=>{let h=f=>{f.key==="Escape"&&t();};return e&&document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,t]);let b=()=>{if(!s.trim())return;let h={name:s.trim(),type:m};m==="dropdown"&&(h.options=i.filter(f=>f.trim())),a(h),t();},v=()=>{p([...i,""]);},k=(h,f)=>{let u=[...i];u[h]=f,p(u);},C=h=>{i.length>1&&p(i.filter((f,u)=>u!==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:d("relative w-full max-w-md rounded-xl shadow-2xl border",r?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:d("flex items-center justify-between px-6 py-4 border-b",r?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h2",{className:d("text-lg font-semibold",r?"text-white":"text-gray-900"),children:l.title}),jsxRuntime.jsx("button",{onClick:t,className:d("p-1 rounded",r?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.X,{className:d("w-5 h-5",r?"text-[#9CA3AF]":"text-gray-400")})})]}),jsxRuntime.jsxs("div",{className:"p-6 space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:d("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:l.fieldName}),jsxRuntime.jsx("input",{type:"text",value:s,onChange:h=>n(h.target.value),placeholder:l.fieldNamePlaceholder,className:d("w-full px-4 py-2.5 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400"),autoFocus:true})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:d("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:l.fieldType}),jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-2",children:My.map(h=>jsxRuntime.jsxs("button",{onClick:()=>g(h.type),className:d("flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors",m===h.type?"border-[#3B82F6] bg-[#3B82F6]/10":r?"border-white/10 hover:border-white/20":"border-gray-200 hover:border-gray-300"),children:[jsxRuntime.jsx("span",{className:m===h.type?"text-[#3B82F6]":r?"text-[#9CA3AF]":"text-gray-400",children:h.icon}),jsxRuntime.jsx("span",{className:d("text-xs",m===h.type?"text-[#3B82F6]":r?"text-[#9CA3AF]":"text-gray-500"),children:l.types[h.type]})]},h.type))})]}),m==="dropdown"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:d("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:l.options}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[i.map((h,f)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"text",value:h,onChange:u=>k(f,u.target.value),placeholder:`${l.option} ${f+1}`,className:d("flex-1 px-3 py-2 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400")}),i.length>1&&jsxRuntime.jsx("button",{onClick:()=>C(f),className:d("p-2 rounded-lg transition-colors",r?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},f)),jsxRuntime.jsxs("button",{onClick:v,className:d("flex items-center gap-2 px-3 py-2 text-sm rounded-lg transition-colors",r?"text-[#3B82F6] hover:bg-white/10":"text-blue-600 hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),l.addOption]})]})]})]}),jsxRuntime.jsxs("div",{className:d("flex items-center justify-end gap-3 px-6 py-4 border-t",r?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("button",{onClick:t,className:d("px-4 py-2 text-sm font-medium rounded-lg transition-colors",r?"text-[#9CA3AF] hover:bg-white/10":"text-gray-600 hover:bg-gray-100"),children:l.cancel}),jsxRuntime.jsx("button",{onClick:b,disabled:!s.trim(),className:d("px-4 py-2 text-sm font-medium rounded-lg transition-colors","bg-[#3B82F6] text-white hover:bg-[#2563EB]",!s.trim()&&"opacity-50 cursor-not-allowed"),children:l.create})]})]})]}):null}var Qm={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 Wy=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:120,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 rp(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(...rp(r.subtasks,t+1));return a}function Gy({status:e,progress:t}){return t===100||e==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-5 h-5 text-green-500"}):t&&t>0||e==="in-progress"?jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-5 h-5 text-blue-500"}):jsxRuntime.jsx(lucideReact.Circle,{className:"w-5 h-5 text-gray-400"})}function op({tasks:e,config:t={},callbacks:a={},isLoading:r=false,error:o,className:s,style:n,availableUsers:m=[],customFields:g=[]}){let{theme:i="dark",locale:p="en",customTranslations:l,showSearch:b=true,showHierarchy:v=true,tableColumns:k,allowColumnCustomization:C=true,allowColumnResize:h=true,enableContextMenu:f=true}=t,u=ns(p,l),x=i==="dark",[c,N]=react.useState("startDate"),[w,B]=react.useState("asc"),[y,I]=react.useState(""),[P,T]=react.useState(k||Wy),[W,O]=react.useState(false),[q,te]=react.useState(false),[ne,oe]=react.useState({isOpen:false,x:0,y:0,type:"task"}),[ce,be]=react.useState(null),[Le,A]=react.useState(0),[R,L]=react.useState(0),j=react.useRef(null);react.useEffect(()=>{k&&T(k);},[k]);let X=react.useMemo(()=>{let G=new Set;function ae(xe){for(let Oe of xe)Oe.subtasks?.length&&(Oe.isExpanded!==false&&G.add(Oe.id),ae(Oe.subtasks));}return ae(e),G},[e]),z=react.useMemo(()=>P.filter(G=>G.visible),[P]),ve=react.useCallback(G=>{a.onTaskToggleExpand?.(G);},[a]),se=react.useCallback(G=>{c===G?B(ae=>ae==="asc"?"desc":"asc"):(N(G),B("asc")),a.onSortChange?.({column:G,direction:w==="asc"?"desc":"asc"});},[c,w,a]),Ie=react.useCallback(G=>{T(G),a.onColumnsChange?.(G);},[a]),qe=react.useCallback(G=>{let ae=P.map(xe=>xe.id===G?{...xe,visible:false}:xe);Ie(ae);},[P,Ie]),Qe=react.useCallback((G,ae)=>{N(G),B(ae);},[]),ie=react.useCallback((G,ae,xe)=>{f&&(G.preventDefault(),oe({isOpen:true,x:G.clientX,y:G.clientY,type:ae?"task":"header",task:ae,columnId:xe}));},[f]),Xe=react.useCallback(()=>{oe(G=>({...G,isOpen:false}));},[]),lt=react.useCallback((G,ae)=>{if(!h)return;G.preventDefault(),G.stopPropagation();let xe=P.find(Oe=>Oe.id===ae);xe&&(be(ae),A(G.clientX),L(xe.width));},[P,h]);react.useEffect(()=>{if(!ce)return;let G=xe=>{let Oe=xe.clientX-Le,ye=Math.max(50,R+Oe),it=P.map(Ue=>Ue.id===ce?{...Ue,width:ye}:Ue);T(it);},ae=()=>{ce&&a.onColumnsChange?.(P),be(null);};return document.addEventListener("mousemove",G),document.addEventListener("mouseup",ae),()=>{document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",ae);}},[ce,Le,R,P,a]);let kt=react.useCallback(async G=>{if(a.onCreateCustomField){let ae={...G,id:`cf_${Date.now()}`,projectId:""};await a.onCreateCustomField(ae);}te(false);},[a]),yt=react.useMemo(()=>{let G=rp(e);if(y.trim()){let ae=y.toLowerCase();G=G.filter(xe=>xe.name.toLowerCase().includes(ae));}return G.sort((ae,xe)=>{let Oe,ye;switch(c){case "name":Oe=ae.name.toLowerCase(),ye=xe.name.toLowerCase();break;case "startDate":Oe=ae.startDate?.getTime()||0,ye=xe.startDate?.getTime()||0;break;case "endDate":Oe=ae.endDate?.getTime()||0,ye=xe.endDate?.getTime()||0;break;case "progress":Oe=ae.progress||0,ye=xe.progress||0;break;case "status":Oe=ae.status||"todo",ye=xe.status||"todo";break;case "priority":let it={urgent:0,high:1,medium:2,low:3,none:4};Oe=it[ae.priority]??4,ye=it[xe.priority]??4;break;default:return 0}return Oe<ye?w==="asc"?-1:1:Oe>ye?w==="asc"?1:-1:0}),G},[e,y,c,w]),$=react.useCallback((G,ae)=>{let xe=it=>{a.onTaskUpdate?.({...G,...it});},Oe=it=>it?G.customFields?.find(wt=>wt.fieldId===it)?.value:void 0,ye=(it,Ue)=>{if(!it)return;let ut=[...G.customFields||[]],Bt=ut.findIndex(jt=>jt.fieldId===it);Bt>=0?ut[Bt]={fieldId:it,value:Ue}:ut.push({fieldId:it,value:Ue}),xe({customFields:ut});};switch(ae.type){case "name":return null;case "status":return jsxRuntime.jsx(wm,{value:G.status||(G.progress===100?"completed":G.progress&&G.progress>0?"in-progress":"todo"),onChange:Ue=>{xe({status:Ue,progress:Ue==="completed"?100:Ue==="in-progress"?50:0});},isDark:x,locale:p,translations:u.status});case "priority":return jsxRuntime.jsx(Tm,{value:G.priority,onChange:Ue=>xe({priority:Ue}),isDark:x,locale:p});case "assignees":return jsxRuntime.jsx(Dm,{value:G.assignees||[],availableUsers:m,onChange:Ue=>xe({assignees:Ue}),isDark:x,locale:p});case "startDate":return jsxRuntime.jsx(cs,{value:G.startDate,onChange:Ue=>xe({startDate:Ue}),isDark:x,locale:p});case "endDate":return jsxRuntime.jsx(cs,{value:G.endDate,onChange:Ue=>xe({endDate:Ue}),isDark:x,locale:p});case "progress":return jsxRuntime.jsx(Mm,{value:G.progress||0,onChange:Ue=>{let wt=Ue===100?"completed":Ue>0?"in-progress":"todo";xe({progress:Ue,status:wt});},isDark:x});case "tags":return jsxRuntime.jsx(Wm,{value:G.tags||[],isDark:x});case "text":return jsxRuntime.jsx(Lm,{value:Oe(ae.customFieldId)||"",onChange:Ue=>ye(ae.customFieldId,Ue),isDark:x});case "number":return jsxRuntime.jsx(Rm,{value:Oe(ae.customFieldId)||0,onChange:Ue=>ye(ae.customFieldId,Ue),isDark:x});case "date":let it=Oe(ae.customFieldId);return jsxRuntime.jsx(cs,{value:it?new Date(it):void 0,onChange:Ue=>ye(ae.customFieldId,Ue),isDark:x,locale:p});case "dropdown":return jsxRuntime.jsx(Om,{value:Oe(ae.customFieldId)||"",options:ae.options||[],onChange:Ue=>ye(ae.customFieldId,Ue),isDark:x});case "checkbox":return jsxRuntime.jsx(Um,{value:Oe(ae.customFieldId)||false,onChange:Ue=>ye(ae.customFieldId,Ue),isDark:x});default:return jsxRuntime.jsx("span",{className:d("text-sm",x?"text-[#94A3B8]":"text-gray-500"),children:"-"})}},[a,x,p,m,u]),fe=react.useCallback(G=>({name:u.columns.name,status:u.columns.status,priority:u.columns.priority,assignees:u.columns.assignees,startDate:u.columns.startDate,endDate:u.columns.endDate,progress:u.columns.progress})[G.type]||G.label,[u]),Ae=react.useMemo(()=>z.reduce((G,ae)=>G+ae.width,0)+(C?48:0),[z,C]);return r?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",x?"bg-[#0F1117]":"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-[#3B82F6]"}),jsxRuntime.jsxs("p",{className:d("text-sm",x?"text-[#9CA3AF]":"text-gray-600"),children:[u.empty.noTasks,"..."]})]})}):o?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",x?"bg-[#0F1117]":"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:d("text-lg font-semibold mb-2",x?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:d("text-sm",x?"text-[#9CA3AF]":"text-gray-600"),children:typeof o=="string"?o:o.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",x?"bg-[#0F1117]":"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-[#3B82F6]/10 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.List,{className:"w-8 h-8 text-[#3B82F6]"})}),jsxRuntime.jsx("h3",{className:d("text-lg font-semibold mb-2",x?"text-white":"text-gray-900"),children:u.empty.noTasks}),jsxRuntime.jsx("p",{className:d("text-sm",x?"text-[#9CA3AF]":"text-gray-600"),children:u.empty.addFirstTask})]})}):jsxRuntime.jsxs("div",{ref:j,className:d("flex-1 flex flex-col w-full h-full overflow-hidden",x?"bg-[#0F1117]":"bg-white",ce&&"select-none",s),style:n,children:[jsxRuntime.jsx("div",{className:d("flex-shrink-0 px-6 py-4 border-b",x?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[b&&jsxRuntime.jsxs("div",{className:"relative flex-1 max-w-md",children:[jsxRuntime.jsx(lucideReact.Search,{className:d("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",x?"text-[#9CA3AF]":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:y,onChange:G=>I(G.target.value),placeholder:u.toolbar.searchPlaceholder,className:d("w-full h-9 pl-10 pr-4 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",x?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-100 border-gray-200 text-gray-900 placeholder:text-gray-400")})]}),jsxRuntime.jsxs("div",{className:d("text-sm",x?"text-[#9CA3AF]":"text-gray-600"),children:[yt.length," ",u.pagination.tasks]})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-auto",children:jsxRuntime.jsxs("div",{style:{minWidth:Ae},children:[jsxRuntime.jsxs("div",{className:d("flex-shrink-0 flex items-center border-b text-xs font-medium uppercase tracking-wider sticky top-0 z-10",x?"border-white/10 bg-[#0F1117]":"border-gray-200 bg-gray-50"),children:[z.map(G=>jsxRuntime.jsxs("div",{className:d("relative flex items-center gap-2 px-4 py-3",x?"text-[#9CA3AF]":"text-gray-500"),style:{width:G.width,minWidth:G.minWidth},onContextMenu:ae=>ie(ae,void 0,G.id),children:[G.sortable?jsxRuntime.jsxs("button",{onClick:()=>se(G.id),className:"flex items-center gap-1 hover:text-[#3B82F6]",children:[fe(G),jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:d("w-3 h-3",c===G.id&&"text-[#3B82F6]")})]}):jsxRuntime.jsx("span",{children:fe(G)}),h&&G.resizable&&jsxRuntime.jsx("div",{className:d("absolute right-0 top-0 bottom-0 w-1 cursor-col-resize group","hover:bg-[#3B82F6]",ce===G.id&&"bg-[#3B82F6]"),onMouseDown:ae=>lt(ae,G.id)})]},G.id)),C&&jsxRuntime.jsxs("div",{className:"relative flex items-center justify-center px-3 py-3",children:[jsxRuntime.jsx("button",{onClick:G=>{G.stopPropagation(),O(ae=>!ae);},className:d("p-1.5 rounded-lg transition-colors",x?"hover:bg-white/10 text-[#9CA3AF] hover:text-white":"hover:bg-gray-200 text-gray-400 hover:text-gray-600",W&&(x?"bg-white/10":"bg-gray-200")),title:p==="es"?"Agregar columna":"Add column",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"})}),jsxRuntime.jsx(Jm,{isOpen:W,onClose:()=>O(false),columns:P,customFields:g,onColumnsChange:Ie,onCreateCustomField:()=>{O(false),te(true);},isDark:x,locale:p})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:yt.map((G,ae)=>{let xe=X.has(G.id);return jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{delay:ae*.02},className:d("flex items-center border-b transition-colors",x?"border-white/5 hover:bg-white/5":"border-gray-100 hover:bg-gray-50"),onClick:()=>a.onTaskClick?.(G),onDoubleClick:()=>a.onTaskDoubleClick?.(G),onContextMenu:Oe=>ie(Oe,G),children:[z.map(Oe=>jsxRuntime.jsx("div",{className:"flex items-center px-4 py-3 min-h-[52px]",style:{width:Oe.width,minWidth:Oe.minWidth},children:Oe.type==="name"?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 min-w-0 w-full",children:[v&&G.level>0&&jsxRuntime.jsx("div",{style:{width:`${G.level*24}px`},className:"flex-shrink-0"}),v&&G.hasChildren&&jsxRuntime.jsx("button",{onClick:ye=>{ye.stopPropagation(),ve(G.id);},className:d("p-0.5 rounded flex-shrink-0",x?"hover:bg-white/10":"hover:bg-gray-200"),children:xe?jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-4 h-4",x?"text-[#9CA3AF]":"text-gray-400")}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:d("w-4 h-4",x?"text-[#9CA3AF]":"text-gray-400")})}),v&&!G.hasChildren&&jsxRuntime.jsx("div",{className:"w-5 flex-shrink-0"}),jsxRuntime.jsx("button",{onClick:ye=>{ye.stopPropagation(),a.onTaskUpdate?.({...G,progress:G.progress===100?0:100,status:G.progress===100?"todo":"completed"});},className:"flex-shrink-0",children:jsxRuntime.jsx(Gy,{status:G.status,progress:G.progress})}),jsxRuntime.jsx("span",{className:d("truncate font-medium",x?"text-white":"text-gray-900",G.progress===100&&(x?"line-through text-[#6B7280]":"line-through text-gray-400")),children:G.name})]}):$(G,Oe)},Oe.id)),C&&jsxRuntime.jsx("div",{className:"w-12 flex-shrink-0"})]},G.id)})}),yt.length===0&&y&&jsxRuntime.jsx("div",{className:"flex items-center justify-center py-12",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(lucideReact.List,{className:d("w-12 h-12 mx-auto mb-4",x?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("p",{className:d(x?"text-[#9CA3AF]":"text-gray-600"),children:u.empty.noResults})]})})]})}),jsxRuntime.jsx(jm,{state:ne,onClose:Xe,isDark:x,locale:p,onTaskEdit:a.onTaskEdit,onTaskDuplicate:a.onTaskDuplicate,onTaskDelete:a.onTaskDelete,onTaskUpdate:a.onTaskUpdate,onColumnHide:qe,onColumnSort:Qe,availableUsers:m}),jsxRuntime.jsx(ep,{isOpen:q,onClose:()=>te(false),onSave:kt,isDark:x,locale:p})]})}var np=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:120,visible:true,sortable:true,resizable:true},{id:"priority",type:"priority",label:"Priority",width:100,visible:false,sortable:true,resizable:true},{id:"assignees",type:"assignees",label:"Assignees",width:150,visible:false,sortable:false,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}],sp=[{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"}],ip=[{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 dl={bgPrimary:"#0d1117",bgSecondary:"#161b22",bgHover:"#21262d",bgSelected:"#1f6feb20",bgAlternate:"#0d111780",border:"#30363d",borderLight:"#21262d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681",accent:"#58a6ff",accentHover:"#79b8ff",accentLight:"#58a6ff20",statusTodo:"#8b949e",statusInProgress:"#f0883e",statusCompleted:"#3fb950",focusRing:"#58a6ff",checkboxBg:"#21262d",checkboxChecked:"#58a6ff"},cl={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"},ml={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"},us={dark:dl,light:cl,neutral:ml};function lp(e){return us[e]||us.dark}var pl={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"},tooltips:{progress:"Progress",status:"Status",assignees:"Assignees",duration:"Duration",days:"days"}},ul={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"},tooltips:{progress:"Progreso",status:"Estado",assignees:"Asignados",duration:"Duraci\xF3n",days:"d\xEDas"}},gs={en:pl,es:ul};function nn(e){return gs[e]||gs.en}function fs(e,t){let a=nn(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 dp(e){let t=nn(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 cp(e,t=0,a=true){let r=nn(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 lv(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 vl(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 fp({task:e}){return e.progress===100||e.status==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-green-500 flex-shrink-0"}):e.progress&&e.progress>0||e.status==="in-progress"?jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-3 h-3 text-blue-500 flex-shrink-0"}):jsxRuntime.jsx(lucideReact.Circle,{className:"w-3 h-3 text-gray-400 flex-shrink-0"})}function hp({tasks:e,config:t={},callbacks:a={},initialDate:r,isLoading:o=false,error:s,className:n,style:m,availableTags:g=[],onCreateTag:i,attachmentsByTask:p,comments:l,onAddComment:b,currentUser:v,mentionableUsers:k,onTaskOpen:C}){let{theme:h="dark",locale:f="en",customTranslations:u}=t,x=fs(f,u),c=h==="dark",N={textTertiary:c?"#6B7280":"#9CA3AF",textSecondary:c?"#9CA3AF":"#6B7280",textPrimary:c?"#FFFFFF":"#111827",borderLight:c?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",border:c?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",bgPrimary:c?"#1A1D25":"#FFFFFF",bgSecondary:c?"#0F1117":"#F9FAFB",hoverBg:c?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)"},[w,B]=react.useState(r||new Date),[y,I]=react.useState(null),[P,T]=react.useState(null),[W,O]=react.useState(null),[q,te]=react.useState(new Date),[ne,oe]=react.useState({}),ce=4,be=3,[Le,A]=react.useState(false),[R,L]=react.useState(false),[j,X]=react.useState(false),[z,ve]=react.useState(false),[se,Ie]=react.useState(null),[qe,Qe]=react.useState(""),[ie,Xe]=react.useState(void 0),[lt,kt]=react.useState(null),[yt,$]=react.useState(false),[fe,Ae]=react.useState(false),[G,ae]=react.useState(null),[xe,Oe]=react.useState(false),[ye,it]=react.useState(new Date),[Ue,wt]=react.useState(false),[ut,Bt]=react.useState(false),[jt,Se]=react.useState(false),[Ve,ua]=react.useState(""),[Ze,Ke]=react.useState(false),[F,Te]=react.useState(""),[Z,ke]=react.useState(false),Ce=react.useCallback(()=>{B(new Date(w.getFullYear(),w.getMonth()-1,1));},[w]),$e=react.useCallback(()=>{B(new Date(w.getFullYear(),w.getMonth()+1,1));},[w]),Be=react.useCallback(()=>{B(new Date);},[]),st=react.useMemo(()=>{let M=w.getFullYear(),V=w.getMonth(),Me=new Date(M,V,1),Ye=new Date(M,V+1,0),Pt=Me.getDay(),de=Ye.getDate(),We=lv(e),vt=new Date;vt.setHours(0,0,0,0);let Re=[],gt=Pt,va=new Date(M,V,0).getDate();for(let Kt=gt-1;Kt>=0;Kt--){let je=new Date(M,V-1,va-Kt);Re.push({date:je,isCurrentMonth:false,isToday:false,isWeekend:je.getDay()===0||je.getDay()===6,events:We.filter(Yt=>vl(je,Yt)).map(Yt=>({id:Yt.id,title:Yt.name,start:Yt.startDate,end:Yt.endDate,task:Yt}))});}for(let Kt=1;Kt<=de;Kt++){let je=new Date(M,V,Kt),Yt=je.getTime()===vt.getTime();Re.push({date:je,isCurrentMonth:true,isToday:Yt,isWeekend:je.getDay()===0||je.getDay()===6,events:We.filter(ga=>vl(je,ga)).map(ga=>({id:ga.id,title:ga.name,start:ga.startDate,end:ga.endDate,task:ga}))});}let wa=42-Re.length;for(let Kt=1;Kt<=wa;Kt++){let je=new Date(M,V+1,Kt);Re.push({date:je,isCurrentMonth:false,isToday:false,isWeekend:je.getDay()===0||je.getDay()===6,events:We.filter(Yt=>vl(je,Yt)).map(Yt=>({id:Yt.id,title:Yt.name,start:Yt.startDate,end:Yt.endDate,task:Yt}))});}return Re},[w,e]),U=f==="es"?["Dom","Lun","Mar","Mi\xE9","Jue","Vie","S\xE1b"]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Y=w.toLocaleDateString(f==="es"?"es-ES":"en-US",{month:"long",year:"numeric"}),pe=react.useCallback((M,V)=>{if(!y)return;let Me={...y,[M]:V};I(Me),a.onTaskUpdate?.(Me);},[y,a]),_e=react.useCallback(M=>{if(!y)return;let V=y.progress||0;M==="completed"?V=100:M==="todo"&&(V=0);let Me={...y,status:M,progress:V};I(Me),a.onTaskUpdate?.(Me),A(false);},[y,a]),ze=react.useCallback((M,V)=>{if(!y)return;let Me={...y,startDate:M,endDate:V};I(Me),a.onTaskUpdate?.(Me);},[y,a]),H=react.useCallback(()=>{A(false),L(false),X(false),O(null),Se(false),ua(""),Ke(false);},[]),le=react.useCallback(async M=>{if(M.preventDefault(),M.stopPropagation(),wt(false),!y||!a.onUploadAttachments)return;let V=Array.from(M.dataTransfer.files);if(V.length!==0){Bt(true);try{await a.onUploadAttachments(y.id,V);}finally{Bt(false);}}},[y,a]),He=react.useCallback(async M=>{if(!y||!a.onUploadAttachments||!M.target.files)return;let V=Array.from(M.target.files);if(V.length!==0){Bt(true);try{await a.onUploadAttachments(y.id,V);}finally{Bt(false);}M.target.value="";}},[y,a]),Ft=react.useCallback(M=>{M.preventDefault(),M.stopPropagation(),wt(true);},[]),rt=react.useCallback(M=>{M.preventDefault(),M.stopPropagation(),wt(false);},[]),ya=react.useCallback(M=>M<1024?`${M} B`:M<1024*1024?`${(M/1024).toFixed(1)} KB`:`${(M/(1024*1024)).toFixed(1)} MB`,[]),$a=react.useCallback(M=>M.startsWith("image/")?lucideReact.Image:M.includes("pdf")||M.includes("document")?lucideReact.FileText:lucideReact.File,[]),ct=react.useMemo(()=>!y||!p?[]:p.get(y.id)||[],[y,p]);return o?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",c?"bg-[#0F1117]":"bg-white",n),style:m,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-[#3B82F6]"}),jsxRuntime.jsxs("p",{className:d("text-sm",c?"text-[#9CA3AF]":"text-gray-600"),children:[x.labels.noEvents,"..."]})]})}):s?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",c?"bg-[#0F1117]":"bg-white",n),style:m,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:d("text-lg font-semibold mb-2",c?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:d("text-sm",c?"text-[#9CA3AF]":"text-gray-600"),children:typeof s=="string"?s:s.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",c?"bg-[#0F1117]":"bg-white",n),style:m,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-[#3B82F6]/10 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-8 h-8 text-[#3B82F6]"})}),jsxRuntime.jsx("h3",{className:d("text-lg font-semibold mb-2",c?"text-white":"text-gray-900"),children:x.labels.noEvents}),jsxRuntime.jsx("p",{className:d("text-sm",c?"text-[#9CA3AF]":"text-gray-600"),children:x.labels.newTask})]})}):jsxRuntime.jsxs("div",{className:d("flex-1 flex flex-col w-full h-full overflow-auto",c?"bg-[#0F1117]":"bg-white",n),style:m,children:[jsxRuntime.jsx("div",{className:d("flex-shrink-0 px-6 py-4 border-b",c?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx("h2",{className:d("text-xl font-semibold capitalize",c?"text-white":"text-gray-900"),children:Y}),jsxRuntime.jsx("button",{onClick:Be,className:d("px-3 py-1.5 text-sm rounded-lg transition-colors",c?"bg-white/5 text-white hover:bg-white/10":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:x.navigation.today})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("button",{onClick:Ce,className:d("p-2 rounded-lg transition-colors",c?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:d("w-5 h-5",c?"text-[#9CA3AF]":"text-gray-600")})}),jsxRuntime.jsx("button",{onClick:$e,className:d("p-2 rounded-lg transition-colors",c?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:d("w-5 h-5",c?"text-[#9CA3AF]":"text-gray-600")})})]})]})}),jsxRuntime.jsx("div",{className:"flex-1 p-6 min-h-0",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-px mb-2",children:U.map(M=>jsxRuntime.jsx("div",{className:d("py-2 text-center text-xs font-medium uppercase",c?"text-[#9CA3AF]":"text-gray-500"),children:M},M))}),jsxRuntime.jsx("div",{className:d("grid grid-cols-7 auto-rows-min gap-px rounded-lg",c?"bg-[#2D2D2D]":"bg-gray-300"),children:st.map((M,V)=>{let Me=M.date.getDay()===0||M.date.getDay()===6;return jsxRuntime.jsxs("div",{className:d("min-h-[120px] p-2 transition-colors flex flex-col relative group",c?Me?"bg-[#1C1F26]":M.isCurrentMonth?"bg-[#13161B]":"bg-[#0D0F13]":Me?"bg-gray-100":M.isCurrentMonth?"bg-white":"bg-gray-50",M.isToday&&"ring-2 ring-[#3B82F6] ring-inset"),children:[(()=>{let Ye=ne[V]||ce,Pt=M.events.slice(0,Ye),de=M.events.length-Ye;return jsxRuntime.jsxs("div",{className:"space-y-1 flex-1",children:[Pt.map(We=>jsxRuntime.jsx("div",{className:"relative group",children:jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{I(We.task),a.onEventClick?.(We),C?.(We.task.id);},whileHover:{scale:1.02},className:d("w-full flex items-center gap-1 px-1.5 py-0.5 rounded text-xs truncate",We.task.progress===100?c?"bg-green-500/20 text-green-400":"bg-green-500/10 text-green-600":c?"bg-[#3B82F6]/20 text-[#3B82F6]":"bg-[#3B82F6]/10 text-[#3B82F6]"),children:[jsxRuntime.jsx(fp,{task:We.task}),jsxRuntime.jsx("span",{className:"truncate",children:We.title})]})},We.id)),de>0&&jsxRuntime.jsxs("button",{onClick:We=>{We.stopPropagation(),oe(vt=>({...vt,[V]:Ye+be}));},className:d("text-xs px-1.5 py-0.5 hover:underline cursor-pointer font-medium",c?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-600"),children:["+",de," ",f==="es"?"M\xC1S":"MORE"]}),Ye>ce&&M.events.length>ce&&jsxRuntime.jsx("button",{onClick:We=>{We.stopPropagation(),oe(vt=>({...vt,[V]:ce}));},className:d("text-xs px-1.5 py-0.5 hover:underline cursor-pointer font-medium",c?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-600"),children:f==="es"?"MENOS":"LESS"})]})})(),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-1",children:[(()=>{let Ye=V>=28,Pt=V%7>=5;return jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:de=>{de.stopPropagation(),se===V?Ie(null):(Ie(V),Qe(""),Xe(void 0),kt(null),ae(null),$(false),Ae(false),Oe(false),it(M.date));},className:d("w-5 h-5 rounded flex items-center justify-center transition-all",se===V?"opacity-100 bg-[#7C3AED] text-white":"opacity-0 group-hover:opacity-100",c?"hover:bg-[#7C3AED] text-[#6B7280] hover:text-white":"hover:bg-[#7C3AED] text-gray-400 hover:text-white"),children:jsxRuntime.jsx(lucideReact.Plus,{className:d("w-3.5 h-3.5 transition-transform",se===V&&"rotate-45")})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:se===V&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>{Ie(null),Qe(""),Xe(void 0),kt(null),ae(null),$(false),Ae(false),Oe(false);}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:Ye?-5:5,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:Ye?-5:5,scale:.95},transition:{duration:.12},className:d("absolute w-[320px] rounded-lg shadow-2xl z-50",Ye?"bottom-full mb-1":"top-full mt-1",Pt?"right-0":"left-0",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:de=>{de.stopPropagation(),$(false),Ae(false),Oe(false);},children:[jsxRuntime.jsx("div",{className:"p-2.5",children:jsxRuntime.jsx("input",{type:"text",value:qe,onChange:de=>Qe(de.target.value),placeholder:f==="es"?'Escribe el nombre de la tarea o "/" para los comandos':'Type task name or "/" for commands',className:d("w-full bg-transparent text-sm outline-none placeholder:opacity-40",c?"text-white":"text-gray-900"),autoFocus:true,onKeyDown:de=>{if(de.key==="Enter"&&qe.trim()){let We=t.availableUsers?.find(Re=>Re.id===lt),vt=G||M.date;a.onTaskCreate?.({name:qe.trim(),startDate:vt,endDate:vt,priority:ie,assignees:We?[We]:void 0}),Qe(""),Xe(void 0),kt(null),ae(null),Ie(null);}de.key==="Escape"&&(Ie(null),Qe(""),Xe(void 0),kt(null),ae(null));}})}),jsxRuntime.jsxs("div",{className:d("px-2.5 py-2 flex items-center justify-between border-t",c?"border-white/10":"border-gray-100"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:de=>{de.stopPropagation(),$(!yt),Ae(false);},className:d("p-1 rounded transition-colors",ie?ie==="urgent"||ie==="high"?"text-red-400 bg-red-500/20":ie==="medium"?"text-yellow-400 bg-yellow-500/20":"text-green-400 bg-green-500/20":c?"hover:bg-white/10 text-[#6B7280]":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:yt&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-0 bottom-full mb-1 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[120px]",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:de=>de.stopPropagation(),children:[{id:"urgent",label:f==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:f==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:f==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:f==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:f==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(de=>jsxRuntime.jsxs("button",{onClick:()=>{Xe(de.id),$(false);},className:d("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",c?"hover:bg-white/5":"hover:bg-gray-50",ie===de.id&&(c?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:d("w-2 h-2 rounded-full",de.color)}),jsxRuntime.jsx("span",{className:c?"text-white":"text-gray-900",children:de.label})]},de.id||"none"))})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs("button",{onClick:de=>{de.stopPropagation(),Oe(!xe),$(false),Ae(false),it(G||M.date);},className:d("flex items-center gap-1 text-xs px-1.5 py-0.5 rounded transition-colors",G?"bg-[#7C3AED]/20 text-[#7C3AED]":c?"bg-white/5 text-[#9CA3AF] hover:bg-white/10":"bg-gray-100 text-gray-500 hover:bg-gray-200"),children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:"w-3 h-3"}),(G||M.date).toLocaleDateString(f==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:xe&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-0 bottom-full mb-1 z-[60] rounded-xl shadow-2xl overflow-hidden flex",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:de=>de.stopPropagation(),children:[jsxRuntime.jsx("div",{className:d("w-40 py-2 border-r",c?"border-white/10":"border-gray-200"),children:(()=>{let de=new Date,We=new Date(de);We.setDate(de.getDate()+1);let vt=new Date(de);vt.setDate(de.getDate()+((6-de.getDay()+7)%7||7));let Re=new Date(de);Re.setDate(de.getDate()+((1-de.getDay()+7)%7||7));let gt=new Date(de);gt.setDate(de.getDate()+14);let va=new Date(de);return va.setDate(de.getDate()+28),[{label:f==="es"?"Hoy":"Today",date:de,display:de.toLocaleDateString(f==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:f==="es"?"Ma\xF1ana":"Tomorrow",date:We,display:We.toLocaleDateString(f==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:f==="es"?"Este fin de semana":"This weekend",date:vt,display:f==="es"?"s\xE1b.":"sat."},{label:f==="es"?"Pr\xF3xima semana":"Next week",date:Re,display:f==="es"?"lun.":"mon."},{label:f==="es"?"2 semanas":"2 weeks",date:gt,display:gt.toLocaleDateString(f==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:f==="es"?"4 semanas":"4 weeks",date:va,display:va.toLocaleDateString(f==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}].map((Kt,je)=>jsxRuntime.jsxs("button",{className:d("w-full flex items-center justify-between px-3 py-1.5 text-xs transition-colors",c?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{ae(Kt.date),Oe(false);},children:[jsxRuntime.jsx("span",{children:Kt.label}),jsxRuntime.jsx("span",{className:d("text-[10px]",c?"text-[#6B7280]":"text-gray-400"),children:Kt.display})]},je))})()}),jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("span",{className:d("text-xs font-medium",c?"text-white":"text-gray-900"),children:ye.toLocaleDateString(f==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{onClick:()=>it(new Date),className:d("px-1.5 py-0.5 rounded text-[10px] transition-colors",c?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:f==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>it(new Date(ye.getFullYear(),ye.getMonth()-1)),className:d("p-0.5 rounded",c?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{onClick:()=>it(new Date(ye.getFullYear(),ye.getMonth()+1)),className:d("p-0.5 rounded",c?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:(f==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(de=>jsxRuntime.jsx("div",{className:d("w-6 h-6 flex items-center justify-center text-[10px]",c?"text-[#6B7280]":"text-gray-400"),children:de},de))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let de=ye.getFullYear(),We=ye.getMonth(),vt=new Date(de,We,1).getDay(),Re=new Date(de,We+1,0).getDate(),gt=new Date(de,We,0).getDate(),va=new Date,wa=[];for(let je=vt-1;je>=0;je--)wa.push({dayNum:gt-je,isCurrentMonth:false,date:new Date(de,We-1,gt-je)});for(let je=1;je<=Re;je++)wa.push({dayNum:je,isCurrentMonth:true,date:new Date(de,We,je)});let Kt=42-wa.length;for(let je=1;je<=Kt;je++)wa.push({dayNum:je,isCurrentMonth:false,date:new Date(de,We+1,je)});return wa.map((je,Yt)=>{let ga=je.date.toDateString()===va.toDateString(),Ar=(G||M.date).toDateString()===je.date.toDateString();return jsxRuntime.jsx("button",{className:d("w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors",!je.isCurrentMonth&&(c?"text-[#4B5563]":"text-gray-300"),je.isCurrentMonth&&(c?"text-white":"text-gray-900"),ga&&"ring-1 ring-[#3B82F6]",Ar&&"bg-[#7C3AED] text-white",!Ar&&(c?"hover:bg-white/10":"hover:bg-gray-100")),onClick:()=>{ae(je.date),Oe(false);},children:je.dayNum},Yt)})})()})]})]})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:de=>{de.stopPropagation(),Ae(!fe),$(false);},className:d("p-1 rounded transition-colors",lt?"text-[#7C3AED] bg-[#7C3AED]/20":c?"hover:bg-white/10 text-[#6B7280]":"hover:bg-gray-100 text-gray-400"),children:lt?jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center text-white text-[8px] font-medium",style:{backgroundColor:t.availableUsers?.find(de=>de.id===lt)?.color||"#7C3AED"},children:t.availableUsers?.find(de=>de.id===lt)?.initials||t.availableUsers?.find(de=>de.id===lt)?.name?.slice(0,2).toUpperCase()}):jsxRuntime.jsx(lucideReact.User,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:fe&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-0 bottom-full mb-1 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[160px] max-h-[200px] overflow-y-auto",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:de=>de.stopPropagation(),children:[jsxRuntime.jsxs("button",{onClick:()=>{kt(null),Ae(false);},className:d("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",c?"hover:bg-white/5":"hover:bg-gray-50",!lt&&(c?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:d("w-5 h-5 rounded-full flex items-center justify-center",c?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(lucideReact.User,{className:"w-3 h-3 text-gray-400"})}),jsxRuntime.jsx("span",{className:c?"text-[#9CA3AF]":"text-gray-500",children:f==="es"?"Sin asignar":"Unassigned"})]}),t.availableUsers?.map(de=>jsxRuntime.jsxs("button",{onClick:()=>{kt(de.id),Ae(false);},className:d("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",c?"hover:bg-white/5":"hover:bg-gray-50",lt===de.id&&(c?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-white text-[9px] font-medium",style:{backgroundColor:de.color||"#7C3AED"},children:de.initials||de.name?.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:c?"text-white":"text-gray-900",children:de.name})]},de.id)),(!t.availableUsers||t.availableUsers.length===0)&&jsxRuntime.jsx("div",{className:d("px-3 py-2 text-xs",c?"text-[#6B7280]":"text-gray-400"),children:f==="es"?"No hay usuarios disponibles":"No users available"})]})})]})]}),jsxRuntime.jsx("button",{onClick:()=>{if(qe.trim()){let de=t.availableUsers?.find(vt=>vt.id===lt),We=G||M.date;a.onTaskCreate?.({name:qe.trim(),startDate:We,endDate:We,priority:ie,assignees:de?[de]:void 0}),Qe(""),Xe(void 0),kt(null),ae(null),Ie(null);}},disabled:!qe.trim(),className:d("px-2.5 py-1 rounded text-xs font-medium transition-colors",qe.trim()?"bg-[#7C3AED] hover:bg-[#6D28D9] text-white":c?"bg-white/5 text-[#4B5563]":"bg-gray-100 text-gray-400"),children:f==="es"?"Guardar":"Save"})]})]})]})})]})})(),jsxRuntime.jsx("span",{className:d("text-sm font-medium",M.isToday?"text-[#3B82F6]":M.isCurrentMonth?c?"text-white":"text-gray-900":c?"text-[#6B7280]":"text-gray-400"),children:M.date.getDate()})]})]},V)})})]})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:y&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>{I(null),Te("");},className:"fixed inset-0 bg-black/50 z-40"}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},className:d("fixed inset-4 md:inset-8 lg:inset-12 rounded-xl shadow-2xl z-50 flex overflow-hidden",c?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxRuntime.jsxs("div",{className:d("px-6 py-3 border-b flex items-center gap-3",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Circle,{className:d("w-4 h-4",c?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsxs("span",{className:d("text-xs px-2 py-0.5 rounded",c?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:[f==="es"?"Tarea":"Task"," \u2228"]}),jsxRuntime.jsx("span",{className:d("text-xs font-mono",c?"text-[#6B7280]":"text-gray-400"),children:y.id.slice(0,8)}),jsxRuntime.jsxs("button",{className:d("flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium transition-colors",c?"bg-purple-500/20 text-purple-400 hover:bg-purple-500/30":"bg-purple-100 text-purple-700 hover:bg-purple-200"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-3 h-3"}),"Ask AI"]})]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{className:d("p-1.5 rounded transition-colors",c?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.Maximize2,{className:"w-4 h-4"})}),jsxRuntime.jsx("button",{className:d("p-1.5 rounded transition-colors",c?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{onClick:()=>{I(null),Te("");},className:d("p-1.5 rounded transition-colors",c?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"px-6 py-4",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>{let M=y.progress===100?0:100,Me={...y,progress:M,status:M===100?"completed":"todo"};I(Me),a.onTaskUpdate?.(Me);},className:d("mt-1 w-5 h-5 rounded-full border-2 flex items-center justify-center transition-colors",y.progress===100?"bg-green-500 border-green-500":c?"border-white/30 hover:border-white/50":"border-gray-300 hover:border-gray-400"),children:y.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("h2",{className:d("text-xl font-semibold flex-1",y.progress===100?"line-through text-[#6B7280]":c?"text-white":"text-gray-900"),children:y.name})]})}),jsxRuntime.jsxs("div",{className:"px-6 pb-6 flex-1 overflow-y-auto overflow-x-visible",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-12 gap-y-5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CheckCircle2,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Estado":"Status"}),jsxRuntime.jsx("button",{onClick:()=>{H(),A(!Le);},className:d("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",y.progress===100||y.status==="completed"?"bg-green-500/20 text-green-400":y.progress&&y.progress>0||y.status==="in-progress"?"bg-blue-500/20 text-blue-400":c?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:y.progress===100||y.status==="completed"?f==="es"?"COMPLETADO":"DONE":y.progress&&y.progress>0||y.status==="in-progress"?f==="es"?"EN PROGRESO":"IN PROGRESS":f==="es"?"POR HACER":"TO DO"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Le&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>A(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"todo",label:f==="es"?"Por hacer":"To Do",color:"bg-white/10 text-white"},{id:"in-progress",label:f==="es"?"En progreso":"In Progress",color:"bg-blue-500/20 text-blue-400"},{id:"completed",label:f==="es"?"Completado":"Done",color:"bg-green-500/20 text-green-400"}].map(M=>jsxRuntime.jsxs("button",{onClick:()=>_e(M.id),className:d("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",c?"hover:bg-white/5":"hover:bg-gray-50",(y.status===M.id||M.id==="completed"&&y.progress===100||M.id==="in-progress"&&y.progress&&y.progress>0&&y.progress<100||M.id==="todo"&&(!y.progress||y.progress===0)&&y.status!=="in-progress"&&y.status!=="completed")&&(c?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:d("w-2 h-2 rounded-full",M.id==="completed"?"bg-green-500":M.id==="in-progress"?"bg-blue-500":"bg-gray-400")}),jsxRuntime.jsx("span",{className:c?"text-white":"text-gray-900",children:M.label})]},M.id))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.User,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Asignados":"Assignees"}),jsxRuntime.jsxs("button",{onClick:()=>{A(false),L(false),O(null),X(!j);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[y.assignees&&y.assignees.length>0?jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[y.assignees.slice(0,3).map((M,V)=>jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-medium",style:{backgroundColor:M.color||"#8B5CF6"},title:M.name,children:M.initials||M.name.slice(0,2).toUpperCase()},V)),y.assignees.length>3&&jsxRuntime.jsxs("span",{className:d("text-xs",c?"text-[#6B7280]":"text-gray-400"),children:["+",y.assignees.length-3]})]}):jsxRuntime.jsx("span",{className:d("text-sm",c?"text-[#6B7280]":"text-gray-400"),children:f==="es"?"Agregar":"Add"}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3",c?"text-[#6B7280]":"text-gray-400")})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:j&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>X(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[200px] max-h-[280px] overflow-y-auto",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:t.availableUsers&&t.availableUsers.length>0?t.availableUsers.map(M=>{let V=y.assignees?.some(Me=>Me.name===M.name);return jsxRuntime.jsxs("button",{onClick:()=>{let Me=y.assignees||[],Ye;V?Ye=Me.filter(Pt=>Pt.name!==M.name):Ye=[...Me,{name:M.name,avatar:M.avatar,initials:M.initials||M.name.slice(0,2).toUpperCase(),color:M.color||"#8B5CF6"}],pe("assignees",Ye);},className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",c?"hover:bg-white/5":"hover:bg-gray-50",V&&(c?"bg-white/5":"bg-gray-50")),children:[M.avatar?jsxRuntime.jsx("img",{src:M.avatar,alt:M.name,className:"w-6 h-6 rounded-full object-cover"}):jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-medium",style:{backgroundColor:M.color||"#8B5CF6"},children:M.initials||M.name.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:d("flex-1 text-left",c?"text-white":"text-gray-900"),children:M.name}),V&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-green-500"})]},M.id||M.name)}):jsxRuntime.jsx("div",{className:d("px-3 py-4 text-sm text-center",c?"text-[#6B7280]":"text-gray-400"),children:f==="es"?"No hay usuarios disponibles":"No users available"})})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Fechas":"Dates"}),jsxRuntime.jsxs("button",{onClick:()=>{O(W?null:"start"),te(y.startDate||new Date);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10 text-white":"bg-gray-100 hover:bg-gray-200 text-gray-900"),children:[y.startDate?.toLocaleDateString(f==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(f==="es"?"Inicio":"Start"),jsxRuntime.jsx("span",{className:d("mx-1",c?"text-[#6B7280]":"text-gray-400"),children:"\u2192"}),y.endDate?.toLocaleDateString(f==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(f==="es"?"Fin":"End"),(y.startDate||y.endDate)&&jsxRuntime.jsx(lucideReact.X,{className:"w-3.5 h-3.5 ml-1 opacity-50 hover:opacity-100",onClick:M=>{M.stopPropagation();}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:W&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>O(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:d("absolute left-0 top-full mt-2 z-50 rounded-xl shadow-2xl overflow-hidden flex",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:M=>M.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:d("w-44 py-2 border-r",c?"border-white/10":"border-gray-200"),children:[(()=>{let M=new Date,V=new Date(M);V.setDate(M.getDate()+1);let Me=new Date(M);Me.setDate(M.getDate()+((6-M.getDay()+7)%7||7));let Ye=new Date(M);Ye.setDate(M.getDate()+((1-M.getDay()+7)%7||7));let Pt=new Date(M);Pt.setDate(M.getDate()+(6-M.getDay()+7)%7+7);let de=new Date(M);de.setDate(M.getDate()+14);let We=new Date(M);return We.setDate(M.getDate()+28),[{label:f==="es"?"Hoy":"Today",date:M,display:M.toLocaleDateString(f==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:f==="es"?"Ma\xF1ana":"Tomorrow",date:V,display:V.toLocaleDateString(f==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:f==="es"?"Este fin de semana":"This weekend",date:Me,display:f==="es"?"s\xE1b.":"sat."},{label:f==="es"?"Pr\xF3xima semana":"Next week",date:Ye,display:f==="es"?"lun.":"mon."},{label:f==="es"?"Pr\xF3ximo fin de semana":"Next weekend",date:Pt,display:Pt.toLocaleDateString(f==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:f==="es"?"2 semanas":"2 weeks",date:de,display:de.toLocaleDateString(f==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:f==="es"?"4 semanas":"4 weeks",date:We,display:We.toLocaleDateString(f==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}].map((Re,gt)=>jsxRuntime.jsxs("button",{className:d("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",c?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{if(W==="start"){let va=y.endDate&&Re.date>y.endDate?Re.date:y.endDate;ze(Re.date,va),O("end");}else {let va=y.startDate&&Re.date<y.startDate?Re.date:y.startDate;ze(va,Re.date),O(null);}},children:[jsxRuntime.jsx("span",{children:Re.label}),jsxRuntime.jsx("span",{className:d("text-xs",c?"text-[#6B7280]":"text-gray-400"),children:Re.display})]},gt))})(),jsxRuntime.jsx("div",{className:d("border-t mt-2 pt-2",c?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:()=>{ze(void 0,void 0),O(null);},className:d("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",c?"hover:bg-white/5 text-red-400":"hover:bg-gray-50 text-red-500"),children:[jsxRuntime.jsx("span",{children:f==="es"?"Quitar fechas":"Clear dates"}),jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4 opacity-50"})]})})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("div",{className:d("text-xs mb-3 px-2 py-1 rounded",c?"bg-white/5 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:W==="start"?f==="es"?"\u{1F4C5} Selecciona fecha de inicio":"\u{1F4C5} Select start date":f==="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:d("font-medium",c?"text-white":"text-gray-900"),children:q.toLocaleDateString(f==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>te(new Date),className:d("p-1 rounded text-sm transition-colors",c?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:f==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>te(new Date(q.getFullYear(),q.getMonth()-1)),className:d("p-1 rounded",c?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-4 h-4"})}),jsxRuntime.jsx("button",{onClick:()=>te(new Date(q.getFullYear(),q.getMonth()+1)),className:d("p-1 rounded",c?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:(f==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(M=>jsxRuntime.jsx("div",{className:d("w-8 h-8 flex items-center justify-center text-xs",c?"text-[#6B7280]":"text-gray-400"),children:M},M))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:(()=>{let M=q.getFullYear(),V=q.getMonth(),Me=new Date(M,V,1).getDay(),Ye=new Date(M,V+1,0).getDate(),Pt=new Date(M,V,0).getDate(),de=new Date,We=[];for(let Re=Me-1;Re>=0;Re--)We.push({day:Pt-Re,isCurrentMonth:false,date:new Date(M,V-1,Pt-Re)});for(let Re=1;Re<=Ye;Re++)We.push({day:Re,isCurrentMonth:true,date:new Date(M,V,Re)});let vt=42-We.length;for(let Re=1;Re<=vt;Re++)We.push({day:Re,isCurrentMonth:false,date:new Date(M,V+1,Re)});return We.map((Re,gt)=>{let va=Re.date.toDateString()===de.toDateString(),wa=y.startDate?.toDateString()===Re.date.toDateString(),Kt=y.endDate?.toDateString()===Re.date.toDateString(),je=wa||Kt,Yt=y.startDate&&y.endDate&&Re.date>=y.startDate&&Re.date<=y.endDate;return jsxRuntime.jsx("button",{className:d("w-8 h-8 rounded-full flex items-center justify-center text-sm transition-colors",!Re.isCurrentMonth&&(c?"text-[#4B5563]":"text-gray-300"),Re.isCurrentMonth&&(c?"text-white":"text-gray-900"),va&&"ring-2 ring-[#3B82F6]",wa&&"bg-[#3B82F6] text-white",Kt&&!wa&&"bg-[#7C3AED] text-white",Yt&&!je&&(c?"bg-[#7C3AED]/20":"bg-purple-100"),!je&&(c?"hover:bg-white/10":"hover:bg-gray-100")),onClick:()=>{let ga=new Date(Re.date);if(W==="start"){let Ar=y.endDate&&ga>y.endDate?ga:y.endDate;ze(ga,Ar),O("end");}else {let Ar=y.startDate&&ga<y.startDate?ga:y.startDate;ze(Ar,ga),O(null);}},children:Re.day},gt)})})()})]})]})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Flag,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Prioridad":"Priority"}),jsxRuntime.jsx("button",{onClick:()=>{H(),L(!R);},className:d("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",y.priority==="high"||y.priority==="urgent"?"bg-red-500/20 text-red-400":y.priority==="medium"?"bg-yellow-500/20 text-yellow-400":y.priority==="low"?"bg-green-500/20 text-green-400":c?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:y.priority?y.priority==="high"||y.priority==="urgent"?f==="es"?"Urgente":"Urgent":y.priority==="medium"?f==="es"?"Media":"Medium":f==="es"?"Baja":"Low":f==="es"?"Sin prioridad":"No priority"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:R&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>L(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"urgent",label:f==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:f==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:f==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:f==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:f==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(M=>jsxRuntime.jsxs("button",{onClick:()=>{pe("priority",M.id),L(false);},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",c?"hover:bg-white/5":"hover:bg-gray-50",y.priority===M.id&&(c?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:d("w-2 h-2 rounded-full",M.color)}),jsxRuntime.jsx("span",{className:c?"text-white":"text-gray-900",children:M.label})]},M.id||"none"))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Clock,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Duraci\xF3n":"Duration"}),jsxRuntime.jsx("span",{className:d("text-sm",c?"text-white":"text-gray-900"),children:y.startDate&&y.endDate?`${Math.ceil((y.endDate.getTime()-y.startDate.getTime())/(1e3*60*60*24))} ${f==="es"?"d\xEDas":"days"}`:f==="es"?"Sin definir":"Not set"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:d("w-4 h-4 rounded-full border-2",c?"border-[#6B7280]":"border-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Progreso":"Progress"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[z?jsxRuntime.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:y.progress||0,onChange:M=>{let V=parseInt(M.target.value),Me=y.status;V===100?Me="completed":V>0?Me="in-progress":Me="todo";let Ye={...y,progress:V,status:Me};I(Ye),a.onTaskUpdate?.(Ye);},onBlur:()=>ve(false),className:d("flex-1 max-w-[120px] h-2 rounded-full appearance-none cursor-pointer",c?"bg-white/10":"bg-gray-200","[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[#3B82F6] [&::-webkit-slider-thumb]:cursor-pointer"),autoFocus:true}):jsxRuntime.jsx("button",{onClick:()=>ve(true),className:d("flex-1 h-2 rounded-full overflow-hidden max-w-[120px] cursor-pointer hover:ring-2 hover:ring-white/20 transition-all",c?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:d("h-full rounded-full transition-all",y.progress===100?"bg-green-500":"bg-[#3B82F6]"),style:{width:`${y.progress||0}%`}})}),jsxRuntime.jsxs("span",{className:d("text-sm font-medium min-w-[40px]",c?"text-white":"text-gray-900"),children:[y.progress||0,"%"]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Tag,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Etiquetas":"Tags"}),jsxRuntime.jsx(br,{selectedTags:y.tags||[],availableTags:g,onChange:M=>{pe("tags",M);},onCreateTag:i,theme:N})]}),jsxRuntime.jsxs("div",{className:"flex items-start gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Link2,{className:d("w-4 h-4 mt-1.5",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24 mt-1",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Relaciones":"Relations"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[y.dependencies&&y.dependencies.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:y.dependencies.map(M=>{let V=e.find(Me=>Me.id===M);return jsxRuntime.jsxs("span",{className:d("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",c?"bg-blue-500/20 text-blue-400":"bg-blue-100 text-blue-700"),children:[V?.name||M.slice(0,8),jsxRuntime.jsx("button",{onClick:()=>{let Me=(y.dependencies||[]).filter(Ye=>Ye!==M);pe("dependencies",Me);},className:d("ml-0.5 hover:bg-white/20 rounded-full p-0.5 transition-colors"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},M)})}),jsxRuntime.jsxs("button",{onClick:()=>{H(),Se(!jt);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{className:d("text-sm",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Agregar dependencia":"Add dependency"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jt&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>{Se(false),ua("");}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[280px] max-h-[320px]",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[jsxRuntime.jsx("div",{className:d("p-2 border-b",c?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("input",{type:"text",value:Ve,onChange:M=>ua(M.target.value),placeholder:f==="es"?"Buscar tarea...":"Search task...",className:d("w-full px-3 py-2 rounded-md text-sm outline-none",c?"bg-white/5 text-white placeholder:text-[#6B7280] focus:bg-white/10":"bg-gray-100 text-gray-900 placeholder:text-gray-400"),autoFocus:true})}),jsxRuntime.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:e.length>0?e.filter(M=>M.id!==y.id).filter(M=>Ve===""||M.name.toLowerCase().includes(Ve.toLowerCase())).map(M=>{let V=y.dependencies?.includes(M.id);return jsxRuntime.jsxs("button",{onClick:()=>{let Me=y.dependencies||[],Ye;V?Ye=Me.filter(Pt=>Pt!==M.id):Ye=[...Me,M.id],pe("dependencies",Ye);},className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors text-left",c?"hover:bg-white/5":"hover:bg-gray-50",V&&(c?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:d("w-4 h-4 rounded border-2 flex items-center justify-center flex-shrink-0",V?"bg-blue-500 border-blue-500":c?"border-white/30":"border-gray-300"),children:V&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("span",{className:d("block truncate",c?"text-white":"text-gray-900"),children:M.name}),jsxRuntime.jsx("span",{className:d("text-xs",c?"text-[#6B7280]":"text-gray-400"),children:M.id.slice(0,8)})]})]},M.id)}):jsxRuntime.jsx("div",{className:d("px-3 py-4 text-sm text-center",c?"text-[#6B7280]":"text-gray-500"),children:f==="es"?"No hay tareas disponibles":"No tasks available"})})]})]})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Palette,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:"Color"}),jsxRuntime.jsxs("button",{onClick:()=>{H(),Ke(!Ze);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full",style:{backgroundColor:y.color||"#6366F1"}}),jsxRuntime.jsx("span",{className:d("text-sm",c?"text-white":"text-gray-900"),children:hr.find(M=>M.value===y.color)?.name||(f==="es"?"Azul":"Blue")}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3",c?"text-[#6B7280]":"text-gray-400")})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Ze&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>Ke(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden p-3",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:jsxRuntime.jsx("div",{className:"grid grid-cols-6 gap-1.5",children:hr.map(M=>{let V=y.color===M.value;return jsxRuntime.jsx("button",{onClick:()=>{pe("color",M.value),Ke(false);},className:d("w-7 h-7 rounded-full flex items-center justify-center transition-all",V&&"ring-2 ring-offset-2",c?"ring-offset-[#1A1D25]":"ring-offset-white"),style:{backgroundColor:M.value,outlineColor:V?M.value:void 0},title:M.name,children:V&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 text-white"})},M.value)})})})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Diamond,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Hito":"Milestone"}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:y.isMilestone||false,onChange:M=>pe("isMilestone",M.target.checked),className:d("w-4 h-4 rounded border-2 cursor-pointer appearance-none transition-colors",y.isMilestone?"bg-purple-500 border-purple-500":c?"border-white/30 bg-transparent":"border-gray-300 bg-transparent","checked:bg-purple-500 checked:border-purple-500")}),jsxRuntime.jsx("span",{className:d("text-sm",c?"text-white":"text-gray-900"),children:f==="es"?"Marcar como hito":"Mark as milestone"})]})]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[jsxRuntime.jsx(lucideReact.FileText,{className:d("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("h3",{className:d("text-sm font-semibold",c?"text-white":"text-gray-900"),children:f==="es"?"Descripci\xF3n":"Description"})]}),jsxRuntime.jsx("textarea",{value:y.description||"",onChange:M=>pe("description",M.target.value),placeholder:f==="es"?"Agregar descripci\xF3n...":"Add description...",className:d("w-full min-h-[100px] px-3 py-2 rounded-lg text-sm resize-none outline-none transition-colors",c?"bg-white/5 text-white placeholder:text-[#6B7280] focus:bg-white/10":"bg-gray-100 text-gray-900 placeholder:text-gray-400 focus:bg-gray-200")}),jsxRuntime.jsxs("button",{className:d("flex items-center gap-2 text-sm mt-2 transition-colors",c?"text-purple-400 hover:text-purple-300":"text-purple-600 hover:text-purple-700"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4"}),f==="es"?"Escribe con IA":"Write with AI"]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:d("text-sm font-semibold mb-3",c?"text-white":"text-gray-900"),children:f==="es"?"Campos personalizados":"Custom fields"}),jsxRuntime.jsxs("button",{className:d("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),f==="es"?"Crea un campo en esta lista":"Create a field in this list"]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:d("text-sm font-semibold mb-3",c?"text-white":"text-gray-900"),children:f==="es"?"Agregar subtarea":"Add subtask"}),y.subtasks&&y.subtasks.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-3",children:y.subtasks.map(M=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:d("w-4 h-4 rounded border flex items-center justify-center cursor-pointer",M.progress===100?"bg-green-500 border-green-500":c?"border-white/20 hover:border-white/40":"border-gray-300 hover:border-gray-400"),children:M.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:d("text-sm",M.progress===100?"line-through text-[#6B7280]":c?"text-white":"text-gray-900"),children:M.name})]},M.id))}),jsxRuntime.jsxs("button",{className:d("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),f==="es"?"Add Tarea":"Add Task"]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("h3",{className:d("text-sm font-semibold",c?"text-white":"text-gray-900"),children:f==="es"?"Listas de control":"Checklists"}),jsxRuntime.jsx("button",{className:d("p-1 rounded transition-colors",c?"hover:bg-white/10 text-[#6B7280]":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("button",{className:d("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.ListChecks,{className:"w-4 h-4"}),f==="es"?"Crear lista de control":"Create checklist"]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("h3",{className:d("text-sm font-semibold mb-3",c?"text-white":"text-gray-900"),children:[f==="es"?"Adjuntos":"Attachments",ct.length>0&&jsxRuntime.jsxs("span",{className:d("ml-2 text-xs font-normal",c?"text-[#6B7280]":"text-gray-400"),children:["(",ct.length,")"]})]}),ct.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-4",children:ct.map(M=>{let V=$a(M.type),Me=M.type.startsWith("image/");return jsxRuntime.jsxs("div",{className:d("flex items-center gap-3 p-2 rounded-lg group transition-colors",c?"bg-white/5 hover:bg-white/10":"bg-gray-50 hover:bg-gray-100"),children:[Me&&M.thumbnailUrl?jsxRuntime.jsx("img",{src:M.thumbnailUrl,alt:M.name,className:"w-10 h-10 rounded object-cover"}):jsxRuntime.jsx("div",{className:d("w-10 h-10 rounded flex items-center justify-center",c?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(V,{className:d("w-5 h-5",c?"text-[#9CA3AF]":"text-gray-500")})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("a",{href:M.url,target:"_blank",rel:"noopener noreferrer",className:d("text-sm font-medium truncate block hover:underline",c?"text-white":"text-gray-900"),children:M.name}),jsxRuntime.jsx("p",{className:d("text-xs",c?"text-[#6B7280]":"text-gray-400"),children:ya(M.size)})]}),a.onDeleteAttachment&&jsxRuntime.jsx("button",{onClick:()=>a.onDeleteAttachment?.(M.id),className:d("p-1.5 rounded opacity-0 group-hover:opacity-100 transition-all",c?"hover:bg-red-500/20 text-red-400":"hover:bg-red-100 text-red-500"),title:f==="es"?"Eliminar":"Delete",children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},M.id)})}),jsxRuntime.jsxs("div",{onDragOver:Ft,onDragLeave:rt,onDrop:le,className:d("border-2 border-dashed rounded-lg p-6 text-center transition-all cursor-pointer relative",Ue?c?"border-blue-500 bg-blue-500/10":"border-blue-400 bg-blue-50":c?"border-white/10 hover:border-white/20":"border-gray-200 hover:border-gray-300",ut&&"pointer-events-none opacity-50"),children:[jsxRuntime.jsx("input",{type:"file",multiple:true,onChange:He,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",disabled:!a.onUploadAttachments||ut}),ut?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-6 h-6 mx-auto mb-2 border-2 border-blue-500 border-t-transparent rounded-full animate-spin"}),jsxRuntime.jsx("p",{className:d("text-sm",c?"text-[#9CA3AF]":"text-gray-500"),children:f==="es"?"Subiendo...":"Uploading..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Upload,{className:d("w-6 h-6 mx-auto mb-2",Ue?"text-blue-500":c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("p",{className:d("text-sm",c?"text-[#9CA3AF]":"text-gray-500"),children:Ue?f==="es"?"Suelta los archivos aqu\xED":"Drop files here":f==="es"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Suelta tus archivos aqu\xED o ",jsxRuntime.jsx("span",{className:"underline",children:"haz clic para subir"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Drop your files here or ",jsxRuntime.jsx("span",{className:"underline",children:"click to upload"})]})}),!a.onUploadAttachments&&jsxRuntime.jsx("p",{className:d("text-xs mt-1",c?"text-[#6B7280]":"text-gray-400"),children:f==="es"?"Upload no disponible":"Upload not available"})]})]})]})]})]}),jsxRuntime.jsxs("div",{className:d("w-80 border-l flex flex-col",c?"border-white/10 bg-[#0F1117]":"border-gray-200 bg-gray-50"),children:[jsxRuntime.jsx("div",{className:d("px-4 py-3 border-b",c?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("h3",{className:d("text-sm font-semibold",c?"text-white":"text-gray-900"),children:[f==="es"?"Actividad":"Activity",l&&l.length>0&&jsxRuntime.jsxs("span",{className:d("ml-2 text-xs font-normal",c?"text-[#6B7280]":"text-gray-400"),children:["(",l.length,")"]})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:l&&l.length>0?jsxRuntime.jsx("div",{className:"space-y-4",children:l.map(M=>{let V=(()=>{let Me=new Date,Ye=new Date(M.createdAt),Pt=Me.getTime()-Ye.getTime(),de=Math.floor(Pt/6e4),We=Math.floor(de/60),vt=Math.floor(We/24);return de<1?f==="es"?"ahora":"now":de<60?f==="es"?`hace ${de}m`:`${de}m ago`:We<24?f==="es"?`hace ${We}h`:`${We}h ago`:f==="es"?`hace ${vt}d`:`${vt}d ago`})();return jsxRuntime.jsxs("div",{className:"flex gap-3",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:{backgroundColor:"#8B5CF6"},children:M.user?.name?.slice(0,2).toUpperCase()||"U"}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsx("span",{className:d("text-sm font-medium",c?"text-white":"text-gray-900"),children:M.user?.name||(f==="es"?"Usuario":"User")}),jsxRuntime.jsx("span",{className:d("text-xs",c?"text-[#6B7280]":"text-gray-400"),children:V})]}),jsxRuntime.jsx("p",{className:d("text-sm break-words",c?"text-[#9CA3AF]":"text-gray-600"),children:M.content})]})]},M.id)})}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[jsxRuntime.jsx(lucideReact.MessageSquare,{className:d("w-10 h-10 mb-3",c?"text-[#3B4252]":"text-gray-300")}),jsxRuntime.jsx("p",{className:d("text-sm",c?"text-[#6B7280]":"text-gray-500"),children:f==="es"?"Sin actividad reciente":"No recent activity"})]})}),jsxRuntime.jsx("div",{className:d("p-4 border-t",c?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-start gap-2",children:[v&&jsxRuntime.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:{backgroundColor:v.color||"#8B5CF6"},children:v.name?.slice(0,2).toUpperCase()||"U"}),jsxRuntime.jsxs("div",{className:d("flex-1 flex items-center gap-2 px-3 py-2 rounded-lg",c?"bg-white/5":"bg-white border border-gray-200"),children:[jsxRuntime.jsx("input",{type:"text",value:F,onChange:M=>Te(M.target.value),onKeyDown:async M=>{if(M.key==="Enter"&&!M.shiftKey&&y&&F.trim()&&b){M.preventDefault(),ke(true);try{await b(y.id,F.trim()),Te("");}finally{ke(false);}}},placeholder:f==="es"?"Escribe un comentario...":"Write a comment...",disabled:Z||!b,className:d("flex-1 bg-transparent text-sm outline-none",c?"text-white placeholder:text-[#6B7280]":"text-gray-900 placeholder:text-gray-400",(Z||!b)&&"opacity-50")}),jsxRuntime.jsx("button",{onClick:async()=>{if(y&&F.trim()&&b){ke(true);try{await b(y.id,F.trim()),Te("");}finally{ke(false);}}},disabled:Z||!F.trim()||!b,className:d("p-1.5 rounded transition-colors",F.trim()&&b?"bg-blue-500 text-white hover:bg-blue-600":c?"text-[#6B7280]":"text-gray-400",Z&&"opacity-50 cursor-not-allowed"),children:Z?jsxRuntime.jsx("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):jsxRuntime.jsx(lucideReact.Send,{className:"w-4 h-4"})})]})]})})]})]})]})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:P&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>T(null),className:"fixed inset-0 bg-black/30 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:d("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",c?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:d("px-4 py-3 border-b flex items-center justify-between",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("span",{className:d("font-medium",c?"text-white":"text-gray-900"),children:P.date.toLocaleDateString(f==="es"?"es-ES":"en-US",{weekday:"long",month:"long",day:"numeric"})}),jsxRuntime.jsx("button",{onClick:()=>T(null),className:d("p-1 rounded",c?"hover:bg-white/10 text-[#9CA3AF]":"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-2",children:P.events.map(M=>jsxRuntime.jsxs("button",{onClick:()=>{T(null),I(M.task),C?.(M.task.id);},className:d("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors",c?"hover:bg-white/5":"hover:bg-gray-50"),children:[jsxRuntime.jsx(fp,{task:M.task}),jsxRuntime.jsx("span",{className:d("text-sm truncate flex-1",c?"text-white":"text-gray-900"),children:M.title}),M.task.priority==="high"||M.task.priority==="urgent"?jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5 text-red-400"}):null]},M.id))})]})]})})]})}var xl={bgPrimary:"#0d1117",bgSecondary:"#161b22",bgHover:"#21262d",bgToday:"#1f6feb20",bgWeekend:"#161b2280",bgOtherMonth:"#0d111750",border:"#30363d",borderLight:"#21262d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681",textToday:"#58a6ff",accent:"#58a6ff",accentHover:"#79b8ff",accentLight:"#58a6ff20",statusTodo:"#8b949e",statusInProgress:"#f0883e",statusCompleted:"#3fb950",focusRing:"#58a6ff"},kl={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"},wl={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"},hs={dark:xl,light:kl,neutral:wl};function yp(e){return hs[e]||hs.dark}function cv({stack:e,cards:t,renderCard:a,onCardClick:r,onToggleExpand:o,onUnstack:s,onDeleteStack:n,className:m}){let[g,i]=react.useState(false),p=react.useMemo(()=>t.filter(v=>e.cardIds.includes(v.id)),[t,e.cardIds]),l=react.useMemo(()=>{let v=p.length,k=new Set(p.flatMap(f=>f.assignedUserIds||[])).size,C=p.map(f=>f.priority).filter(Boolean),h=new Set(p.flatMap(f=>f.labels||[])).size;return {totalCards:v,uniqueAssignees:k,priorities:C,labels:h}},[p]),b=()=>{o?.(e.id);};return jsxRuntime.jsxs("div",{className:d("card-stack",!e.isExpanded&&"card-stack-collapsed",m),onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),style:{"--stack-color":e.color||"var(--color-accent-primary)"},children:[jsxRuntime.jsxs("div",{className:"card-stack-header",onClick:b,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:d("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:l.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"]})]}),g&&jsxRuntime.jsx("div",{className:"card-stack-actions",children:jsxRuntime.jsx("button",{className:"card-stack-action",onClick:v=>{v.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:[l.uniqueAssignees," assignees"]})]}),l.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:[l.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:p.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:p.map(v=>jsxRuntime.jsxs("div",{className:"card-stack-card-wrapper",children:[a?jsxRuntime.jsx("div",{onClick:()=>r?.(v),children:a(v)}):jsxRuntime.jsxs("div",{className:"card-stack-default-card",onClick:()=>r?.(v),children:[jsxRuntime.jsx("h4",{children:v.title}),v.description&&jsxRuntime.jsxs("p",{children:[v.description.substring(0,100),"..."]})]}),jsxRuntime.jsx("button",{className:"card-stack-unstack-btn",onClick:k=>{k.stopPropagation(),s?.(e.id,v.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"})]})})]},v.id))})})]})}var xp={showIcons:true,showAvatars:true,groupByDay:true,useRelativeTime:true,compact:false};function dn(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 cn(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 kp(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 wp({events:e,filter:t,onFilterChange:a,onClearFilter:r,onEventClick:o,selectedEventId:s,config:n,className:m}){let g=react.useMemo(()=>({...xp,...n}),[n]),[i,p]=react.useState(new Set),l=react.useRef(null),b=react.useMemo(()=>{if(!g.groupByDay)return [{date:null,events:e}];let u=new Map;return e.forEach(x=>{let c=x.timestamp.toISOString().split("T")[0],N=u.get(c);N?N.push(x):u.set(c,[x]);}),Array.from(u.entries()).sort((x,c)=>c[0].localeCompare(x[0])).map(([x,c])=>({date:new Date(x),events:c.sort((N,w)=>w.timestamp.getTime()-N.timestamp.getTime())}))},[e,g.groupByDay]),{uniqueUsers:v,uniqueTypes:k}=react.useMemo(()=>{let u=new Set,x=new Set;return e.forEach(c=>{u.add(c.userId),x.add(c.type);}),{uniqueUsers:Array.from(u),uniqueTypes:Array.from(x)}},[e]),C=u=>{p(x=>{let c=new Set(x);return c.has(u)?c.delete(u):c.add(u),c});},h=u=>{let c=new Date().getTime()-u.getTime(),N=Math.floor(c/6e4),w=Math.floor(c/36e5),B=Math.floor(c/864e5);return N<1?"just now":N<60?`${N}m ago`:w<24?`${w}h ago`:B<7?`${B}d ago`:u.toLocaleDateString()},f=react.useMemo(()=>{let u=0;return t.types&&t.types.length>0&&u++,t.users&&t.users.length>0&&u++,t.dateRange&&u++,t.searchTerm&&u++,u},[t]);return react.useEffect(()=>{if(s&&l.current){let u=l.current.querySelector(`[data-event-id="${s}"]`);u&&u.scrollIntoView({behavior:"smooth",block:"center"});}},[s]),e.length===0?jsxRuntime.jsxs("div",{className:d("history-timeline-empty",m),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:d("history-timeline",g.compact&&"compact",m),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:u=>{let x=u.target.value;a({...t,types:x?[x]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Events"}),k.map(u=>jsxRuntime.jsxs("option",{value:u,children:[cn(u)," ",u.replace("_"," ")]},u))]}),v.length>1&&jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.users?.[0]||"",onChange:u=>{let x=u.target.value;a({...t,users:x?[x]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Users"}),v.map(u=>jsxRuntime.jsx("option",{value:u,children:u},u))]}),jsxRuntime.jsx("input",{type:"text",className:"history-timeline-filter-search",placeholder:"Search history...",value:t.searchTerm||"",onChange:u=>a({...t,searchTerm:u.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:l,children:b.map(u=>jsxRuntime.jsxs("div",{className:"history-timeline-group",children:[g.groupByDay&&u.date&&jsxRuntime.jsxs("div",{className:"history-timeline-day-header",children:[jsxRuntime.jsx("span",{className:"history-timeline-day-date",children:u.date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),jsxRuntime.jsxs("span",{className:"history-timeline-day-count",children:[u.events.length," events"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-events",children:u.events.map((x,c)=>{let N=i.has(x.id),w=s===x.id,B=kp(x.type);return jsxRuntime.jsxs("div",{"data-event-id":x.id,className:d("history-timeline-event",N&&"expanded",w&&"selected"),onClick:()=>o?.(x),children:[jsxRuntime.jsxs("div",{className:"history-timeline-line",children:[jsxRuntime.jsx("div",{className:"history-timeline-dot",style:{backgroundColor:B},children:g.showIcons&&jsxRuntime.jsx("span",{className:"history-timeline-dot-icon",children:cn(x.type)})}),c<u.events.length-1&&jsxRuntime.jsx("div",{className:"history-timeline-connector",style:{borderColor:B}})]}),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:[g.showAvatars&&x.userAvatar&&jsxRuntime.jsx("img",{src:x.userAvatar,alt:x.userName||x.userId,className:"history-timeline-event-avatar"}),jsxRuntime.jsxs("div",{className:"history-timeline-event-description",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-user",children:x.userName||x.userId}),jsxRuntime.jsx("span",{className:"history-timeline-event-action",children:dn(x)})]})]}),jsxRuntime.jsx("div",{className:"history-timeline-event-time",children:g.useRelativeTime?h(x.timestamp):x.timestamp.toLocaleString()})]}),Object.keys(x.changes).length>0&&jsxRuntime.jsxs("button",{className:"history-timeline-event-toggle",onClick:y=>{y.stopPropagation(),C(x.id);},children:[N?"\u25BC":"\u25B6"," Show changes"]}),N&&jsxRuntime.jsxs("div",{className:"history-timeline-event-changes",children:[Object.entries(x.changes).map(([y,I])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-change",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-change-key",children:[y,":"]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-change-values",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-change-from",children:JSON.stringify(I.from)}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-arrow",children:"\u2192"}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-to",children:JSON.stringify(I.to)})]})]},y)),x.metadata&&Object.keys(x.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(x.metadata).map(([y,I])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata-item",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-metadata-key",children:[y,":"]}),jsxRuntime.jsx("span",{className:"history-timeline-event-metadata-value",children:JSON.stringify(I)})]},y))]})]})]})]},x.id)})})]},u.date?.toISOString()||"all"))})]})}function Tp({replayState:e,events:t,onStartReplay:a,onStopReplay:r,onTogglePlayback:o,onPrevious:s,onNext:n,onGoToEvent:m,onSpeedChange:g,className:i}){let p=[.5,1,1.5,2,3],l=react.useMemo(()=>!e||t.length===0?null:t[e.currentIndex],[e,t]),b=react.useMemo(()=>!e||e.totalEvents===0?0:e.currentIndex/(e.totalEvents-1)*100,[e]);return t.length===0?jsxRuntime.jsxs("div",{className:d("history-replay-empty",i),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:d("history-replay",i),children:[jsxRuntime.jsxs("div",{className:"history-replay-current-event",children:[jsxRuntime.jsx("div",{className:"history-replay-event-icon",children:l&&cn(l.type)}),jsxRuntime.jsxs("div",{className:"history-replay-event-info",children:[jsxRuntime.jsx("div",{className:"history-replay-event-description",children:l&&dn(l)}),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:l&&l.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:v=>m(parseInt(v.target.value))}),jsxRuntime.jsx("div",{className:"history-replay-progress-fill",style:{width:`${b}%`}}),jsxRuntime.jsx("div",{className:"history-replay-progress-markers",children:t.map((v,k)=>jsxRuntime.jsx("div",{className:d("history-replay-progress-marker",k===e.currentIndex&&"active"),style:{left:`${k/(e.totalEvents-1)*100}%`},onClick:()=>m(k),title:dn(v)},v.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:p.map(v=>jsxRuntime.jsxs("button",{className:d("history-replay-speed-btn",e.speed===v&&"active"),onClick:()=>g(v),children:[v,"x"]},v))})]}),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:l&&l.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(v=>jsxRuntime.jsx("span",{className:"history-replay-card-preview-label-tag",children:v},v))})]})]})]})]}):jsxRuntime.jsxs("div",{className:d("history-replay-start",i),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 Cl(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 Tl(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 Np(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 Dp(e){return ["blocks","blocked_by","depends_on","required_by","parent_of","child_of"].includes(e)}function bv(e,t,a,r,o,s=100){let n=e.map(g=>({...g,x:g.x??a/2+Math.random()*100-50,y:g.y??r/2+Math.random()*100-50,vx:0,vy:0})),m=new Map(n.map(g=>[g.id,g]));for(let g=0;g<s;g++){let i=1-g/s;n.forEach(p=>{let l=a/2,b=r/2;p.vx+=(l-p.x)*o.centerForce*i,p.vy+=(b-p.y)*o.centerForce*i,n.forEach(v=>{if(p.id===v.id)return;let k=p.x-v.x,C=p.y-v.y,h=Math.sqrt(k*k+C*C)||1,f=o.chargeStrength*i/(h*h);p.vx+=k/h*f,p.vy+=C/h*f;});}),t.forEach(p=>{let l=m.get(typeof p.source=="string"?p.source:p.source.id),b=m.get(typeof p.target=="string"?p.target:p.target.id);if(!l||!b)return;let v=b.x-l.x,k=b.y-l.y,C=Math.sqrt(v*v+k*k)||1,h=(C-o.linkDistance)/C*o.forceStrength*i;l.vx+=v*h,l.vy+=k*h,b.vx-=v*h,b.vy-=k*h;}),n.forEach(p=>{p.fx!==null&&p.fx!==void 0?(p.x=p.fx,p.vx=0):p.x+=p.vx,p.fy!==null&&p.fy!==void 0?(p.y=p.fy,p.vy=0):p.y+=p.vy,p.x=Math.max(o.nodeSize,Math.min(a-o.nodeSize,p.x)),p.y=Math.max(o.nodeSize,Math.min(r-o.nodeSize,p.y)),p.vx*=.9,p.vy*=.9;});}return n}function Sp({nodes:e,edges:t,config:a,filter:r,onFilterChange:o,criticalPath:s,stats:n,onInteraction:m,className:g}){let i=react.useRef(null),[p,l]=react.useState([]),[b,v]=react.useState(null),[k,C]=react.useState(null),[h,f]=react.useState(null),[u,x]=react.useState(1),[c,N]=react.useState({x:0,y:0});react.useEffect(()=>{if(e.length===0)return;let O=bv(e,t,a.width,a.height,a,150);l(O);},[e,t,a]);let w=react.useCallback((O,q)=>{a.enableDragging&&(q.stopPropagation(),v(O));},[a.enableDragging]),B=react.useCallback(O=>{if(!b||!i.current)return;let te=i.current.getBoundingClientRect(),ne=(O.clientX-te.left-c.x)/u,oe=(O.clientY-te.top-c.y)/u;l(ce=>ce.map(be=>be.id===b?{...be,x:ne,y:oe,fx:ne,fy:oe}:be));},[b,u,c]),y=react.useCallback(()=>{v(null);},[]),I=react.useCallback((O,q)=>{q.stopPropagation(),m?.({type:"node-click",node:O,position:{x:q.clientX,y:q.clientY}});},[m]),P=react.useCallback((O,q)=>{q.stopPropagation(),m?.({type:"edge-click",edge:O,position:{x:q.clientX,y:q.clientY}});},[m]),T=react.useCallback(O=>{let q=p.find(te=>te.id===O);return q?{x:q.x,y:q.y}:{x:0,y:0}},[p]),W=react.useCallback(O=>{if(O.onCriticalPath)return "#ef4444";switch(a.colorScheme){case "status":return O.card.columnId==="done"?"#10b981":"#3b82f6";case "priority":let q=O.card.priority;return q==="URGENT"?"#ef4444":q==="HIGH"?"#f59e0b":q==="MEDIUM"?"#3b82f6":"#6b7280";case "assignee":return O.card.assigneeId?"#8b5cf6":"#6b7280";default:return "#3b82f6"}},[a.colorScheme]);return e.length===0?jsxRuntime.jsxs("div",{className:d("relationships-graph-empty",g),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:d("relationships-graph",g),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:()=>x(O=>Math.min(O+.2,3)),children:"+"}),jsxRuntime.jsxs("span",{className:"relationships-graph-zoom-value",children:[Math.round(u*100),"%"]}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>x(O=>Math.max(O-.2,.5)),children:"\u2212"}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>{x(1),N({x:0,y:0});},children:"Reset"})]})]}),jsxRuntime.jsx("div",{className:"relationships-graph-legend",children:Array.from(new Set(t.map(O=>O.type))).map(O=>jsxRuntime.jsxs("div",{className:"relationships-graph-legend-item",children:[jsxRuntime.jsx("div",{className:"relationships-graph-legend-color",style:{background:Cl(O)}}),jsxRuntime.jsxs("span",{className:"relationships-graph-legend-label",children:[Np(O)," ",Tl(O)]})]},O))}),jsxRuntime.jsxs("svg",{ref:i,className:"relationships-graph-canvas",width:a.width,height:a.height,onMouseMove:B,onMouseUp:y,onMouseLeave:y,children:[jsxRuntime.jsxs("g",{transform:`translate(${c.x}, ${c.y}) scale(${u})`,children:[jsxRuntime.jsx("g",{className:"relationships-graph-edges",children:t.map(O=>{let q=T(typeof O.source=="string"?O.source:O.source.id),te=T(typeof O.target=="string"?O.target:O.target.id),ne=Dp(O.type),oe=h===O.id,ce=O.onCriticalPath;return jsxRuntime.jsxs("g",{className:d("relationships-graph-edge",oe&&"hovered",ce&&"critical"),onMouseEnter:()=>f(O.id),onMouseLeave:()=>f(null),onClick:be=>P(O,be),children:[jsxRuntime.jsx("line",{x1:q.x,y1:q.y,x2:te.x,y2:te.y,stroke:Cl(O.type),strokeWidth:ce?a.edgeWidth*2:a.edgeWidth,strokeOpacity:oe?1:.6,markerEnd:ne?"url(#arrowhead)":void 0}),a.showEdgeLabels&&oe&&jsxRuntime.jsx("text",{x:(q.x+te.x)/2,y:(q.y+te.y)/2,className:"relationships-graph-edge-label",textAnchor:"middle",children:Tl(O.type)})]},O.id)})}),jsxRuntime.jsx("g",{className:"relationships-graph-nodes",children:p.map(O=>{let q=k===O.id,te=O.onCriticalPath;return jsxRuntime.jsxs("g",{className:d("relationships-graph-node",q&&"hovered",te&&"critical"),transform:`translate(${O.x}, ${O.y})`,onMouseDown:ne=>w(O.id,ne),onMouseEnter:()=>C(O.id),onMouseLeave:()=>C(null),onClick:ne=>I(O,ne),children:[jsxRuntime.jsx("circle",{r:te?a.nodeSize*1.2:a.nodeSize,fill:W(O),stroke:te?"#fbbf24":"#ffffff",strokeWidth:te?3:2,opacity:q?1:.9}),a.showLabels&&jsxRuntime.jsx("text",{y:a.nodeSize+20,className:"relationships-graph-node-label",textAnchor:"middle",children:O.card.title.length>20?O.card.title.substring(0,20)+"...":O.card.title})]},O.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 Mp({isOpen:e,onClose:t,onPlanGenerated:a,onGeneratePlan:r,isLoading:o}){let[s,n]=react.useState(""),[m,g]=react.useState(false),[i,p]=react.useState(null),[l,b]=react.useState(null),v=react.useRef(null),k=m||o;react.useEffect(()=>{e&&v.current&&v.current.focus();},[e]),react.useEffect(()=>{let u=x=>{x.key==="Escape"&&!k&&C();};if(e)return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,k]);let C=()=>{k||(n(""),p(null),b(null),t());},h=async()=>{if(!(!s.trim()||k)){g(true),p(null),b(null);try{let u=await r(s.trim());b(u);}catch(u){p(u instanceof Error?u.message:"Failed to generate plan");}finally{g(false);}}},f=()=>{l&&(a(l),C());};return e?jsxRuntime.jsxs(ft,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:C}),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:u=>u.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:C,disabled:k,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:l?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!"})]}),l.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:l.explanation})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Columns (",l.columns.length,")"]}),jsxRuntime.jsx("div",{className:"flex gap-2 flex-wrap",children:l.columns.map((u,x)=>jsxRuntime.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-white/5 border border-white/20 text-sm text-white/80",children:u.title},x))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Tasks (",l.cards.length,")"]}),jsxRuntime.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[l.cards.slice(0,10).map((u,x)=>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:u.title}),u.description&&jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-1 line-clamp-2",children:u.description})]}),u.priority&&jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${u.priority==="URGENT"?"bg-red-500/20 text-red-400":u.priority==="HIGH"?"bg-orange-500/20 text-orange-400":u.priority==="MEDIUM"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:u.priority})]})},x)),l.cards.length>10&&jsxRuntime.jsxs("p",{className:"text-xs text-white/50 text-center py-2",children:["+",l.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:v,value:s,onChange:u=>n(u.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:k}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),i&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:i}),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((u,x)=>jsxRuntime.jsx("button",{onClick:()=>n(u),disabled:k,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:u},x))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:k&&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:C,disabled:k,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"}),l?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()||k,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#ffffff"},children:k?"Generating...":"Generate Plan"})]})]})]})})]}):null}var Nl={"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 yv={hobby:{requestsPerMonth:50,maxConcurrent:1,maxTokensPerRequest:4096},pro:{requestsPerMonth:500,maxConcurrent:3,maxTokensPerRequest:8192},enterprise:{requestsPerMonth:2e3,maxConcurrent:10,maxTokensPerRequest:16384}},vv={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 xv(e,t,a){let r=Nl[e];if(!r)throw new Error(`Unknown model: ${e}`);let o=t/1e3*r.costPer1kInput,s=a/1e3*r.costPer1kOutput;return o+s}function mn(e){return `$${e.toFixed(4)}`}var Dl=class{constructor(){this.operations=[];this.listeners=[];}record(t){let a=xv(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(l=>l.timestamp>=t.start&&l.timestamp<=t.end));let r=a.length,o=a.reduce((l,b)=>l+b.cost,0),s=a.reduce((l,b)=>l+b.inputTokens,0),n=a.reduce((l,b)=>l+b.outputTokens,0),m=a.filter(l=>l.success),g=a.reduce((l,b)=>l+b.duration,0),i={},p={};return a.forEach(l=>{i[l.feature]=(i[l.feature]||0)+1,p[l.feature]=(p[l.feature]||0)+l.cost;}),{totalOperations:r,totalCost:o,totalInputTokens:s,totalOutputTokens:n,operationsByFeature:i,costsByFeature:p,averageDuration:r>0?g/r:0,successRate:r>0?m.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 m=this.operations.filter(p=>p.timestamp>=n).length,g=Math.max(0,o-m),i=m/o*100;return {used:m,limit:o,remaining:g,percentUsed:i,isExceeded:m>=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)}},fo=new Dl;function Lp({isOpen:e,onClose:t,planTier:a="hobby"}){let[r,o]=react.useState(fo.getStats()),[s,n]=react.useState(fo.checkLimit(a));if(react.useEffect(()=>{if(!e)return;let g=setInterval(()=>{o(fo.getStats()),n(fo.checkLimit(a));},1e3);return ()=>clearInterval(g)},[e,a]),react.useEffect(()=>{let g=i=>{i.key==="Escape"&&t();};if(e)return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[e,t]),!e)return null;let m=fo.getRecentOperations(5);return jsxRuntime.jsxs(ft,{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:g=>g.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:mn(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(([g,i])=>{let p=r.costsByFeature[g]||0,l=r.totalOperations>0?i/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:g.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:[i," ops"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:mn(p)})]})]}),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:`${l}%`}})})]},g)})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Recent Operations"}),m.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:m.map(g=>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:g.feature.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-0.5",children:[new Date(g.timestamp).toLocaleTimeString()," \u2022"," ",g.duration,"ms"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[g.inputTokens+g.outputTokens," tokens"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:mn(g.cost)}),jsxRuntime.jsx("div",{className:`w-2 h-2 rounded-full ${g.success?"bg-green-400":"bg-red-400"}`})]})]},g.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 Rp({isOpen:e,onClose:t,onTasksGenerated:a,onGenerateTasks:r,isLoading:o,projectName:s}){let[n,m]=react.useState(""),[g,i]=react.useState(""),[p,l]=react.useState(""),[b,v]=react.useState(false),[k,C]=react.useState(null),[h,f]=react.useState(null),[u,x]=react.useState(null),c=react.useRef(null),N=b||o;react.useEffect(()=>{e&&c.current&&c.current.focus();},[e]),react.useEffect(()=>{let P=T=>{T.key==="Escape"&&!N&&w();};if(e)return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[e,N]);let w=()=>{N||(m(""),i(""),l(""),C(null),f(null),x(null),t());},B=async()=>{if(!(!n.trim()||N)){v(true),C(null),f(null),x(null);try{let P=await r({prompt:n.trim(),projectName:s||"Mi Proyecto",startDate:g||void 0,endDate:p||void 0});f(P.tasks.tasks),x({from_cache:P.from_cache,tokens_used:P.tokens_used,mock_mode:P.mock_mode,similarity:P.similarity,tokens_saved:P.tokens_saved});}catch(P){C(P instanceof Error?P.message:"Failed to generate tasks");}finally{v(false);}}},y=()=>{h&&(a(h),w());};if(!e)return null;let I=u?.similarity?((u.similarity||0)*100).toFixed(0):"0";return jsxRuntime.jsxs(ft,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:w}),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:P=>P.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:w,disabled:N,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:[u?.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"}),u?.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 (",I,"% 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:[u?.tokens_used||0," tokens"]}),u?.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:[u.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((P,T)=>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:["#",T+1]}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:P.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"})]}),P.start," \u2192 ",P.end]}),jsxRuntime.jsxs("span",{children:[P.duration," days"]}),P.dependencies.length>0&&jsxRuntime.jsxs("span",{className:"text-blue-400",children:["Depends: ",P.dependencies.join(", ")]})]})]}),jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${P.priority==="high"?"bg-red-500/20 text-red-400":P.priority==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:P.priority})]})},P.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:P=>m(P.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:N}),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:g,onChange:P=>i(P.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:N})]}),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:p,onChange:P=>l(P.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:N})]})]}),k&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:k}),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((P,T)=>jsxRuntime.jsx("button",{onClick:()=>m(P),disabled:N,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:P},T))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:N&&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:w,disabled:N,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:y,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:B,disabled:!n.trim()||N,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#ffffff"},children:N?"Generating...":"Generate Tasks"})]})]})]})})]})}function xs({initialBoard:e,onPersist:t}){let[a,r]=react.useState(e),o=react.useCallback(h=>{t&&kn(()=>Promise.resolve(t(h)),{maxAttempts:3,initialDelay:1e3,onRetry:(f,u,x)=>{console.warn(`Retry attempt ${u} after ${x}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,u)=>{r(x=>{let c=x.cards.find(P=>P.id===h);if(!c)return x;let N=c.columnId,w={...c,columnId:f,position:u},B=x.cards.map(P=>P.id===h?w:P),y=x.columns.map(P=>{if(P.id===N)return {...P,cardIds:P.cardIds.filter(T=>T!==h)};if(P.id===f){let T=B.filter(W=>W.columnId===f).sort((W,O)=>W.position-O.position);return {...P,cardIds:T.map(W=>W.id)}}return P}),I={...x,cards:B,columns:y};return o(I),I});},[o]),n=react.useCallback(async(h,f)=>{r(u=>{let x=u.cards.map(N=>N.id===h?{...N,...f}:N),c={...u,cards:x};return o(c),c});},[o]),m=react.useCallback(async h=>{let f=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(u=>{let x={...h,id:f},c=u.columns.map(w=>w.id===h.columnId?{...w,cardIds:[...w.cardIds,f]}:w),N={...u,cards:[...u.cards,x],columns:c};return o(N),N});},[o]),g=react.useCallback(async h=>{r(f=>{let u=f.cards.find(w=>w.id===h);if(!u)return f;let x=f.cards.filter(w=>w.id!==h),c=f.columns.map(w=>w.id===u.columnId?{...w,cardIds:w.cardIds.filter(B=>B!==h)}:w),N={...f,cards:x,columns:c};return o(N),N});},[o]),i=react.useCallback(async h=>{let f=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(u=>{let x={...h,id:f,cardIds:[]},c={...u,columns:[...u.columns,x]};return o(c),c});},[o]),p=react.useCallback(async(h,f)=>{r(u=>{let x=u.columns.map(N=>N.id===h?{...N,...f}:N),c={...u,columns:x};return o(c),c});},[o]),l=react.useCallback(async h=>{r(f=>{let u=f.cards.filter(N=>N.columnId!==h),x=f.columns.filter(N=>N.id!==h),c={...f,cards:u,columns:x};return o(c),c});},[o]),b=react.useCallback(h=>{let f=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return m(h),f},[m]),v=react.useCallback(h=>{let f=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return i(h),f},[i]),k=react.useCallback(()=>{r(h=>{let f={...h,cards:[],columns:[]};return o(f),f});},[o]);return {board:a,callbacks:{onCardMove:s,onCardUpdate:n,onCardCreate:m,onCardDelete:g,onColumnCreate:i,onColumnUpdate:p,onColumnDelete:l},setBoard:r,helpers:{addCard:b,addColumn:v,deleteCard:g,deleteColumn:l,clearBoard:k}}}function $p({initialData:e,availableUsers:t=[],onSave:a}){let{board:r,callbacks:o,helpers:s}=xs({initialBoard:e,onPersist:a}),n=react.useMemo(()=>({addCard:(g,i,p={})=>{s.addCard({title:i,columnId:g,position:r.cards.filter(l=>l.columnId===g).length,...p});},addColumn:(g,i)=>{let p=r.columns.length>0?Math.max(...r.columns.map(l=>l.position)):0;s.addColumn({title:g,position:i??p+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 pn={dateFilter:"all",priorities:[],assignees:[],labels:[],columns:[],search:""},zp={by:"none",order:"asc"};function Hp({initialFilters:e={},initialSort:t={},currentUserId:a}={}){let[r,o]=react.useState({...pn,...e}),[s,n]=react.useState({...zp,...t}),m=react.useCallback(C=>{o(h=>({...h,...C}));},[]),g=react.useCallback(C=>{n(h=>({...h,...C}));},[]),i=react.useCallback(()=>{o(pn),n(zp);},[]),p=react.useCallback(()=>{a&&o({...pn,assignees:[a]});},[a]),l=react.useCallback(()=>{o({...pn,dateFilter:"overdue"});},[]),b=react.useCallback(()=>{o({...pn,priorities:["HIGH","URGENT"]});},[]),v=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]),k=react.useCallback(C=>{let h=[...C];if(r.search){let f=r.search.toLowerCase();h=h.filter(u=>u.title.toLowerCase().includes(f)||u.description?.toLowerCase().includes(f));}if(r.dateFilter!=="all"){let f=new Date,u=f.getFullYear(),x=String(f.getMonth()+1).padStart(2,"0"),c=String(f.getDate()).padStart(2,"0"),N=`${u}-${x}-${c}`;h=h.filter(w=>{if(!w.endDate&&!w.dueDate)return false;let B=w.endDate||w.dueDate;if(!B)return false;let y;if(typeof B=="string")y=B.split("T")[0]||B;else {let I=B.getUTCFullYear(),P=String(B.getUTCMonth()+1).padStart(2,"0"),T=String(B.getUTCDate()).padStart(2,"0");y=`${I}-${P}-${T}`;}switch(r.dateFilter){case "overdue":return y<N;case "today":return y===N;case "this-week":let I=new Date(N+"T00:00:00"),P=new Date(y+"T00:00:00"),T=new Date(I);return T.setDate(T.getDate()+7),P>=I&&P<=T;case "custom":if(r.dateRange){let W=typeof B=="string"?new Date(B):B;return W>=r.dateRange.start&&W<=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(x=>r.assignees.includes(x)))),r.labels.length>0&&(h=h.filter(f=>f.labels&&f.labels.some(u=>r.labels.includes(u)))),r.columns.length>0&&(h=h.filter(f=>r.columns.includes(f.columnId))),s.by!=="none"&&h.sort((f,u)=>{let x=0;switch(s.by){case "created":let c=f.createdAt?new Date(f.createdAt).getTime():0,N=u.createdAt?new Date(u.createdAt).getTime():0;x=c-N;break;case "priority":let w={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},B=w[f.priority||"LOW"],y=w[u.priority||"LOW"];x=B-y;break;case "dueDate":let I=f.endDate||f.dueDate,P=u.endDate||u.dueDate;if(!I)return 1;if(!P)return -1;let T=typeof I=="string"?new Date(I).getTime():I.getTime(),W=typeof P=="string"?new Date(P).getTime():P.getTime();x=T-W;break;case "title":x=f.title.localeCompare(u.title);break;case "estimate":let O=f.estimatedTime||0,q=u.estimatedTime||0;x=O-q;break;default:x=0;}return s.order==="asc"?x:-x}),h},[r,s]);return {filters:r,sort:s,setFilters:m,setSort:g,resetFilters:i,filterMyTasks:p,filterOverdue:l,filterHighPriority:b,applyFilters:k,hasActiveFilters:v}}var Gp,_p;if(typeof window<"u")try{let e=yn("ai");Gp=e.generateObject,_p=e.generateText;}catch{}function Vp(e={}){let[t,a]=react.useState(false),[r,o]=react.useState(null),s=!!(Gp&&_p&&e.apiKey),n=react.useCallback(async l=>{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:",l),{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: ${l}`,position:1e3,columnId:"temp-col-1"}],explanation:"This is a sample plan. Real implementation would use AI SDK."}}catch(b){let v=b instanceof Error?b:new Error("Failed to generate plan");throw o(v),v}finally{a(false);}},[s]),m=react.useCallback(async l=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Suggesting assignee for:",l.title),{userId:"user-123",confidence:.85,reasoning:"Based on past performance and expertise"}}catch(b){let v=b instanceof Error?b:new Error("Failed to suggest assignee");throw o(v),v}finally{a(false);}},[s]),g=react.useCallback(async l=>{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(b){let v=b instanceof Error?b:new Error("Failed to predict risks");throw o(v),v}finally{a(false);}},[s]),i=react.useCallback(async l=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Generating subtasks for:",l.title),[{title:`Subtask 1 for: ${l.title}`,position:l.position+.1,columnId:l.columnId},{title:`Subtask 2 for: ${l.title}`,position:l.position+.2,columnId:l.columnId}]}catch(b){let v=b instanceof Error?b:new Error("Failed to generate subtasks");throw o(v),v}finally{a(false);}},[s]),p=react.useCallback(async l=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Estimating effort for:",l.title),{hours:8,confidence:.75}}catch(b){let v=b instanceof Error?b:new Error("Failed to estimate effort");throw o(v),v}finally{a(false);}},[s]);return {onGeneratePlan:n,onSuggestAssignee:m,onPredictRisks:g,onGenerateSubtasks:i,onEstimateEffort:p,isAvailable:s,isLoading:t,error:r}}function El(){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 jp(e){let{cards:t}=e,[a,r]=El(),o=react.useCallback(l=>a.selectedCardIds.includes(l),[a.selectedCardIds]),s=react.useCallback((l,b)=>{if(!b){r({selectedCardIds:[l],lastSelectedCardId:l});return}let v=b.ctrlKey||b.metaKey,k=b.shiftKey;if(v)a.selectedCardIds.includes(l)?r({selectedCardIds:a.selectedCardIds.filter(C=>C!==l),lastSelectedCardId:a.lastSelectedCardId}):r({selectedCardIds:[...a.selectedCardIds,l],lastSelectedCardId:l});else if(k&&a.lastSelectedCardId){let C=t.find(f=>f.id===l),h=t.find(f=>f.id===a.lastSelectedCardId);if(C&&h&&C.columnId===h.columnId){let f=t.filter(y=>y.columnId===C.columnId).sort((y,I)=>y.position-I.position),u=f.findIndex(y=>y.id===a.lastSelectedCardId),x=f.findIndex(y=>y.id===l),[c,N]=u<x?[u,x]:[x,u],w=f.slice(c,N+1).map(y=>y.id),B=Array.from(new Set([...a.selectedCardIds,...w]));r({selectedCardIds:B,lastSelectedCardId:l});}else r({selectedCardIds:[l],lastSelectedCardId:l});}else r({selectedCardIds:[l],lastSelectedCardId:l});},[t,a,r]),n=react.useCallback(l=>{r({selectedCardIds:a.selectedCardIds.filter(b=>b!==l),lastSelectedCardId:a.lastSelectedCardId});},[a,r]),m=react.useCallback(()=>{r({selectedCardIds:[],lastSelectedCardId:null});},[r]),g=react.useCallback(()=>{r({selectedCardIds:t.map(l=>l.id),lastSelectedCardId:t[t.length-1]?.id||null});},[t,r]),i=react.useCallback(l=>{a.selectedCardIds.includes(l)?n(l):r({selectedCardIds:[...a.selectedCardIds,l],lastSelectedCardId:l});},[a,n,r]),p=react.useCallback(()=>t.filter(l=>a.selectedCardIds.includes(l.id)),[t,a.selectedCardIds]);return {selectedCardIds:a.selectedCardIds,lastSelectedCardId:a.lastSelectedCardId,isCardSelected:o,selectCard:s,deselectCard:n,clearSelection:m,selectAll:g,toggleCard:i,getSelectedCards:p}}var Kp={enableAutoStacking:true,autoStackConfidenceThreshold:.7,minCardsPerStack:2,enableManualStacking:true,showStackSummaries:true,animationDuration:200};function Yp(e){let{cards:t,config:a,aiService:r}=e,o=react.useMemo(()=>({...Kp,...a}),[a]),[s,n]=react.useState([]),m=react.useCallback((C,h,f,u,x)=>{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:C,cardIds:h,columnId:f,strategy:u,color:x,isExpanded:true,position:s.filter(N=>N.columnId===f).length,createdAt:new Date};n(N=>[...N,c]);},[o.minCardsPerStack,s]),g=react.useCallback(C=>{n(h=>h.filter(f=>f.id!==C));},[]),i=react.useCallback(C=>{n(h=>h.map(f=>f.id===C?{...f,isExpanded:!f.isExpanded}:f));},[]),p=react.useCallback((C,h)=>{n(f=>f.map(u=>u.id===C&&!u.cardIds.includes(h)?{...u,cardIds:[...u.cardIds,h]}:u));},[]),l=react.useCallback((C,h)=>{n(f=>f.map(u=>{if(u.id===C){let x=u.cardIds.filter(c=>c!==h);return x.length<o.minCardsPerStack?null:{...u,cardIds:x}}return u}).filter(u=>u!==null));},[o.minCardsPerStack]),b=react.useCallback(C=>s.filter(h=>h.columnId===C).sort((h,f)=>h.position-f.position),[s]),v=react.useCallback(async C=>{let h=t.filter(N=>N.columnId===C);if(h.length<o.minCardsPerStack*2)return [];let f=[],u=new Map;h.forEach(N=>{N.labels&&N.labels.length>0&&N.labels.forEach(w=>{u.has(w)||u.set(w,[]),u.get(w).push(N);});}),u.forEach((N,w)=>{N.length>=o.minCardsPerStack&&f.push({stack:{title:`\u{1F4CC} ${w}`,cardIds:N.map(B=>B.id),columnId:C,strategy:"labels",color:"#3b82f6"},reason:`${N.length} cards with label "${w}"`,confidence:.85});});let x=new Map;h.forEach(N=>{N.assignedUserIds&&N.assignedUserIds.length>0&&N.assignedUserIds.forEach(w=>{x.has(w)||x.set(w,[]),x.get(w).push(N);});}),x.forEach((N,w)=>{N.length>=o.minCardsPerStack&&f.push({stack:{title:`\u{1F464} Assigned to user-${w.slice(-4)}`,cardIds:N.map(B=>B.id),columnId:C,strategy:"assignee",color:"#8b5cf6"},reason:`${N.length} cards assigned to the same user`,confidence:.8});});let c=new Map;if(h.forEach(N=>{N.priority&&(c.has(N.priority)||c.set(N.priority,[]),c.get(N.priority).push(N));}),c.forEach((N,w)=>{if(N.length>=o.minCardsPerStack){let B={low:"\u{1F7E2}",medium:"\u{1F7E1}",high:"\u{1F534}",urgent:"\u{1F6A8}"}[w.toLowerCase()]||"\u26AA";f.push({stack:{title:`${B} ${w} Priority`,cardIds:N.map(y=>y.id),columnId:C,strategy:"priority",color:w==="high"||w==="urgent"?"#ef4444":"#10b981"},reason:`${N.length} cards with ${w} priority`,confidence:.75});}}),r&&o.enableAutoStacking)for(let N of h){let B=(await r.findSimilar(N,h)).filter(y=>y.similarity>=o.autoStackConfidenceThreshold);if(B.length>=o.minCardsPerStack-1){let y=[N.id,...B.map(P=>P.card.id)],I=B.reduce((P,T)=>P+T.similarity,0)/B.length;f.push({stack:{title:`\u2728 Similar to "${N.title.substring(0,30)}${N.title.length>30?"...":""}"`,cardIds:y,columnId:C,strategy:"ai-similarity",color:"#f59e0b"},reason:`AI detected ${B.length+1} similar tasks`,confidence:I});}}return f.filter(N=>N.confidence>=o.autoStackConfidenceThreshold).sort((N,w)=>w.confidence-N.confidence).slice(0,5)},[t,o,r]),k=react.useCallback(C=>{m(C.stack.title,C.stack.cardIds,C.stack.columnId,C.stack.strategy,C.stack.color);},[m]);return react.useEffect(()=>{o.enableAutoStacking&&s.length===0&&new Set(t.map(h=>h.columnId)).forEach(async h=>{let f=await v(h),u=f[0];f.length>0&&u&&u.confidence>=.9&&k(u);});},[]),{stacks:s,createStack:m,deleteStack:g,toggleStack:i,addToStack:p,removeFromStack:l,getStacksForColumn:b,getSuggestions:v,applySuggestion:k,config:o}}var qp=react.createContext(null);function Xp({children:e,initialData:t,onStateChange:a}){let r=react.useRef();if(!r.current){let s=new Map,n=new Map;t?.columns?.forEach(g=>{let{Column:i}=yn("@libxai/core");s.set(g.id,new i(g));}),t?.cards?.forEach(g=>{let{Card:i}=yn("@libxai/core");n.set(g.id,new i(g));});let m=null;if(t?.board){let{Board:g}=yn("@libxai/core");m=new g(t.board);}r.current=new core.BoardStore({board:m,columns:s,cards:n});}let o=r.current;return react.useEffect(()=>{if(a)return o.subscribeAll(s=>{a(o.getState());})},[o,a]),jsxRuntime.jsx(qp.Provider,{value:{store:o},children:e})}function ks(){let e=react.useContext(qp);if(!e)throw new Error("useBoardStore must be used within BoardProvider");return e.store}function gn(){let e=ks(),[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 m=react.useCallback(u=>{e.updateBoard(u);},[e]),g=react.useCallback(u=>{e.addColumn(u);},[e]),i=react.useCallback((u,x)=>{e.updateColumn(u,x);},[e]),p=react.useCallback(u=>{e.deleteColumn(u);},[e]),l=react.useCallback(u=>e.getColumn(u),[e]),b=react.useCallback(u=>{e.addCard(u);},[e]),v=react.useCallback((u,x)=>{e.updateCard(u,x);},[e]),k=react.useCallback(u=>{e.deleteCard(u);},[e]),C=react.useCallback((u,x,c)=>{e.moveCard(u,x,c);},[e]),h=react.useCallback(u=>e.getCard(u),[e]),f=react.useCallback(u=>e.getCardsByColumn(u),[e]);return {board:t,columns:r,cards:s,updateBoard:m,addColumn:g,updateColumn:i,deleteColumn:p,getColumn:l,addCard:b,updateCard:v,deleteCard:k,moveCard:C,getCard:h,getCardsByColumn:f}}function Zp(e){let{cards:t}=gn();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 Qp(e="position",t="asc"){let{cards:a}=gn();return react.useMemo(()=>[...a].sort((o,s)=>{let n=0;switch(e){case "title":n=o.title.localeCompare(s.title);break;case "priority":{let m={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},g=o.priority?m[o.priority]:0,i=s.priority?m[s.priority]:0;n=g-i;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 ws=class{constructor(){this.plugins=new Map;this.enabled=new Set;this.config=new Map;this.context=null;this.pluginLogger=id.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 m=await Promise.resolve(n.apply(s,a));m!==void 0&&(o=m,a[0]=m);}catch(m){this.pluginLogger.error(`Plugin hook failed: ${s.id}.${t}`,m,{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);}},Ov=new ws;function tu({items:e,height:t,estimateSize:a,renderItem:r,className:o="",overscan:s=5,horizontal:n=false,gap:m=0,getItemKey:g}){let i=react.useRef(null),p=reactVirtual.useVirtualizer({count:e.length,getScrollElement:()=>i.current,estimateSize:()=>a,overscan:s,horizontal:n,gap:m}),l=p.getVirtualItems(),b={height:typeof t=="number"?`${t}px`:t,width:"100%",overflow:"auto",position:"relative"},v=n?{width:`${p.getTotalSize()}px`,height:"100%",position:"relative"}:{height:`${p.getTotalSize()}px`,width:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:i,style:b,className:o,children:jsxRuntime.jsx("div",{style:v,children:l.map(k=>{let C=e[k.index];if(!C)return null;let h=g?g(C,k.index):k.index,f={position:"absolute",top:n?0:k.start,left:n?k.start:0,width:n?k.size:"100%",height:n?"100%":k.size};return jsxRuntime.jsx("div",{style:f,"data-index":k.index,children:r(C,k.index)},h)})})})}function au(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 ou({items:e,height:t,width:a="100%",estimateColumnWidth:r,renderColumn:o,className:s="",overscan:n=3,gap:m=16,getItemKey:g,horizontal:i=true}){let p=react.useRef(null),l=reactVirtual.useVirtualizer({horizontal:i,count:e.length,getScrollElement:()=>p.current,estimateSize:()=>r,overscan:n,gap:m}),b=l.getVirtualItems(),v={height:typeof t=="number"?`${t}px`:t,width:typeof a=="number"?`${a}px`:a,overflow:"auto",position:"relative"},k={width:`${l.getTotalSize()}px`,height:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:p,style:v,className:s,children:jsxRuntime.jsx("div",{style:k,children:b.map(C=>{let h=e[C.index];if(!h)return null;let f=g?g(h,C.index):C.index,u={position:"absolute",top:0,left:C.start,width:C.size,height:"100%"};return jsxRuntime.jsx("div",{style:u,"data-index":C.index,children:o(h,C.index)},f)})})})}function nu(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 su(e,t=10){return e>t}var Fl={none:0,xs:4,sm:8,md:12,lg:16,xl:20,"2xl":24,"3xl":32,"4xl":40,"5xl":48,"6xl":64},Ll={none:0,sm:4,md:8,lg:12,xl:16,"2xl":20,full:9999},Il={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48},Bl={light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800},Rl={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},Ol={base:0,dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070},$l={instant:0,fastest:75,faster:100,fast:150,normal:200,slow:300,slower:400,slowest:500},Ul={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)"},zl={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)"},Hl={0:0,5:.05,10:.1,20:.2,30:.3,40:.4,50:.5,60:.6,70:.7,80:.8,90:.9,100:1},Wl={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}},Gl={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}},Cs={spacing:Fl,borderRadius:Ll,fontSize:Il,fontWeight:Bl,lineHeight:Rl,zIndex:Ol,duration:$l,easing:Ul,shadows:zl,opacity:Hl,kanban:Wl,gantt:Gl};function iu(e,t,a){return e[t]??a}function _l(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)?_l(o,s,a):(typeof o=="string"||typeof o=="number")&&(a[s]=o);}return a}function zv(e){return typeof e=="number"?e>0&&e<1e3?`${e}px`:e.toString():e}function Vl(e="asakaa"){let t=_l(Cs),a=[];for(let[r,o]of Object.entries(t)){let s=`--${e}-${r}`,n=zv(o);a.push(` ${s}: ${n};`);}return `:root {
|
|
390
390
|
${a.join(`
|
|
391
391
|
`)}
|
|
392
392
|
}`}function fn(e,t="asakaa"){let a=[],r=_l(e);for(let[o,s]of Object.entries(r)){let n=`--${t}-color-${o}`;a.push(` ${n}: ${s};`);}return `:root {
|